diff options
Diffstat (limited to 'drivers/mtd/nand/gpmi_nfc_mil.c')
-rw-r--r-- | drivers/mtd/nand/gpmi_nfc_mil.c | 11 |
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 |