[PATCH v2] mtd: gpmi: Deal with bitflips in erased regions regions
Huang Shijie
b32955 at freescale.com
Mon Dec 16 22:50:33 EST 2013
On Sun, Dec 15, 2013 at 07:44:21PM +0100, Elie De Brauwer wrote:
> @@ -1057,15 +1082,27 @@ static int gpmi_ecc_read_page(struct mtd_info *mtd, struct nand_chip *chip,
> status = auxiliary_virt + nfc_geo->auxiliary_status_offset;
>
> for (i = 0; i < nfc_geo->ecc_chunk_count; i++, status++) {
> - if ((*status == STATUS_GOOD) || (*status == STATUS_ERASED))
> + if (*status == STATUS_GOOD)
> continue;
>
> if (*status == STATUS_UNCORRECTABLE) {
> mtd->ecc_stats.failed++;
> continue;
> }
> - mtd->ecc_stats.corrected += *status;
> - max_bitflips = max_t(unsigned int, max_bitflips, *status);
> +
> + if (*status == STATUS_ERASED)
> + if (gpmi_allones(this))
> + continue;
I think it is better to use "break" here, not "continue".
Since if the gpmi_allones() return true, it means all the ECC chunks are
0xff.
thanks
Huang Shijie.
More information about the linux-mtd
mailing list