summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2012-08-15 10:47:52 +0800
committerJustin Waters <justin.waters@timesys.com>2012-09-12 11:05:55 -0400
commiteb000ecb5daea75bb38fef2def1e131d3f25add5 (patch)
treedc6830814caa18b2cfc1aeb3c50448e6ecd6d625
parentef91335b0d67f6c80697ae982f950c2a1a523063 (diff)
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>
-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 0317c9deb0..3a172bf437 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