[PATCH v7] mtd: gpmi: Deal with bitflips in erased regions
Huang Shijie
b32955 at freescale.com
Mon Jan 6 21:13:38 EST 2014
On Fri, Jan 03, 2014 at 10:27:19PM +0100, Elie De Brauwer wrote:
>
> @@ -1003,15 +1028,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);
> +
> + /*
Hi Brian:
Please do not forget to remove the whitespace at the end of the above line
when you merge this patch.
thanks
Huang Shijie
> + * The number of bitflips are either counted in software
> + * in case of an erased chunk or otherwise reported by
> + * the BCH block.
> + */
> + if (*status == STATUS_ERASED)
> + flips = erased_sector_bitflips(payload_virt, i,
> + nfc_geo);
> + else
> + flips = *status;
> +
More information about the linux-mtd
mailing list