summaryrefslogtreecommitdiff
path: root/drivers/mtd/nand/gpmi_nfc_mil.c
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2012-08-15 10:47:52 +0800
committerHuang Shijie <b32955@freescale.com>2012-08-20 16:08:53 +0800
commitc2513f07acd37220829246613d7f43507ab9c840 (patch)
treedc6830814caa18b2cfc1aeb3c50448e6ecd6d625 /drivers/mtd/nand/gpmi_nfc_mil.c
parentd20be8615307ac9af0cd8f2b7dcbdb1511277cfd (diff)
downloadu-boot-imx-c2513f07acd37220829246613d7f43507ab9c840.zip
u-boot-imx-c2513f07acd37220829246613d7f43507ab9c840.tar.gz
u-boot-imx-c2513f07acd37220829246613d7f43507ab9c840.tar.bz2
ENGR00217505-7 uboot: gpmi: update the mtd->ecc_stats when reading page failed
If tell the real correcting infomation to the upper layer of MTD, the torture thread of UBIFS will do the torture test in a very often frequency. This will eat up all the reservation blocks of the UBIFS. So tell the real correcting infomation only when the failure occured, or the corrected times nearly reached the ECC threshold. Signed-off-by: Huang Shijie <b32955@freescale.com>
Diffstat (limited to 'drivers/mtd/nand/gpmi_nfc_mil.c')
-rw-r--r--drivers/mtd/nand/gpmi_nfc_mil.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/mtd/nand/gpmi_nfc_mil.c b/drivers/mtd/nand/gpmi_nfc_mil.c
index 0317c9d..3a172bf 100644
--- a/drivers/mtd/nand/gpmi_nfc_mil.c
+++ b/drivers/mtd/nand/gpmi_nfc_mil.c
@@ -405,9 +405,14 @@ static int gpmi_nfc_ecc_read_page(struct mtd_info *mtd,
corrected += *status;
}
- /* Propagate ECC status to the owning MTD. */
- mtd->ecc_stats.failed += failed;
- mtd->ecc_stats.corrected += corrected;
+ /*
+ * Propagate ECC status to the owning MTD only when failed or
+ * corrected times nearly reaches our ECC correction threshold.
+ */
+ if (failed || corrected >= (gpmi_info->ecc_strength - 1)) {
+ mtd->ecc_stats.failed += failed;
+ mtd->ecc_stats.corrected += corrected;
+ }
/*
* It's time to deliver the OOB bytes. See gpmi_nfc_ecc_read_oob() for