summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2010-11-05 16:54:07 +0800
committerJustin Waters <justin.waters@timesys.com>2010-12-13 16:10:43 -0500
commitddde144f5e9f67483bfeb7b045596c34917d4993 (patch)
tree27c43530695bce468e219ab2df19aaf0eddd9ac1
parenta534a03e0edeb2f9a98ddb18eacbfabaf409f015 (diff)
ENGR00133310 NAND : 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/gpmi-nfc-mil.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c b/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
index 181cb477e6a4..c7a0b76a505c 100644
--- a/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
+++ b/drivers/mtd/nand/gpmi-nfc/gpmi-nfc-mil.c
@@ -677,10 +677,14 @@ static int mil_ecc_read_page(struct mtd_info *mtd, struct nand_chip *nand,
}
- /* 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 >= (nfc_geo->ecc_strength - 1)) {
+ mtd->ecc_stats.failed += failed;
+ mtd->ecc_stats.corrected += corrected;
+ }
/*
* It's time to deliver the OOB bytes. See mil_ecc_read_oob() for