summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHuang Shijie <b32955@freescale.com>2010-11-05 16:54:07 +0800
committerScott Sweeny <scott.sweeny@timesys.com>2011-01-19 11:50:20 -0500
commite9fb8d81685c11b5b49af852b4cd9810d12358e1 (patch)
tree27c43530695bce468e219ab2df19aaf0eddd9ac1
parent2592ce445c4fe1f83e2a5344fb97053915c9faea (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