wlan-ap-Telecominfraproject/feeds/qca-wifi-7/ipq53xx/patches-6.1/0205-mtd-rawnand-qcom-Fix-for-ECC-strength-updation.patch
John Crispin 68cf54d9f7 qca-wifi-7: update to ath12.5.5
Signed-off-by: John Crispin <john@phrozen.org>
2025-02-27 12:45:52 +01:00

43 lines
1.5 KiB
Diff

From c81182b7f069aaaadd6733f60d812330c6a92c15 Mon Sep 17 00:00:00 2001
From: Timple Raj M <quic_timple@quicinc.com>
Date: Wed, 3 May 2023 13:21:38 +0530
Subject: [PATCH 205/281] mtd: rawnand: qcom: Fix for ECC strength updation
The ecc strength has to be updated before the nand_ecc_choose_conf
function call since the ecc->strength is used in
nand_ecc_choose_conf -> nand_check_ecc_caps
Reference commit:
ebb6e582d6bd (Fix ECC error for 4-bit ECC serial NAND)
Change-Id: If72e720cf8c543bef2d2c2e072c42b43c232b016
Signed-off-by: Timple Raj M <quic_timple@quicinc.com>
---
drivers/mtd/nand/raw/qcom_nandc.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/mtd/nand/raw/qcom_nandc.c b/drivers/mtd/nand/raw/qcom_nandc.c
index f2696d1ac125..2c3e2b18b2f4 100644
--- a/drivers/mtd/nand/raw/qcom_nandc.c
+++ b/drivers/mtd/nand/raw/qcom_nandc.c
@@ -2925,6 +2925,7 @@ static int qcom_nand_attach_chip(struct nand_chip *chip)
ecc->size = NANDC_STEP_SIZE;
wide_bus = chip->options & NAND_BUSWIDTH_16 ? true : false;
cwperpage = mtd->writesize / NANDC_STEP_SIZE;
+ ecc->strength = mtd->oobsize >= 128 ? 8 : 4;
/*
* Each CW has 4 available OOB bytes which will be protected with ECC
@@ -2937,8 +2938,6 @@ static int qcom_nand_attach_chip(struct nand_chip *chip)
return ret;
}
- ecc->strength = mtd->oobsize >= 128 ? 8 : 4;
-
if (ecc->strength >= 8) {
/* 8 bit ECC defaults to BCH ECC on all platforms */
host->bch_enabled = true;
--
2.17.1