diff options
author | Huang Shijie <b32955@freescale.com> | 2012-08-15 10:47:52 +0800 |
---|---|---|
committer | Huang Shijie <b32955@freescale.com> | 2012-08-20 16:08:53 +0800 |
commit | c2513f07acd37220829246613d7f43507ab9c840 (patch) | |
tree | dc6830814caa18b2cfc1aeb3c50448e6ecd6d625 /drivers | |
parent | d20be8615307ac9af0cd8f2b7dcbdb1511277cfd (diff) | |
download | u-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')
-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 |