[PATCH] mtd: gpmi: fix the bitflips for erased page

Bill Pringlemeir bpringlemeir at nbsps.com
Thu Jan 9 15:08:08 EST 2014


On  9 Jan 2014, b32955 at freescale.com wrote:

> ---
> drivers/mtd/nand/gpmi-nand/gpmi-nand.c | 44 ++++++++++++++++++++++++++++++++
> 1 files changed, 44 insertions(+), 0 deletions(-)

[snip]

> +	if (flip_bits < threshold) {

Isn't it "if (flip_bits <= threshold)"?

> +		dev_dbg(this->dev, "check for the erased page:%d, chunk:%d\n",
> +				page, chunk);
> +		flip_bits = 0;
> +		memset(buf, 0, geo->payload_size);
> +
> +		/* read out the page without ECC enabled, and check it again. */
> +		chip->cmdfunc(mtd, NAND_CMD_READ0, 0, page);
> +		chip->read_buf(mtd, buf, geo->payload_size);
> +
> +		for (i = 0; i < geo->payload_size; i++)
> +			flip_bits += hweight8(~buf[i]);
> +
> +		if (flip_bits < threshold)

Perhaps the same?  At least 'strength' means the number of correctable
bit flips; or maybe you have multiple buffers?  It is just the boundary
of when an erase page is about to go bad, which might be hard to see
through testing?  I have the same issue with the Vybrid NFC and ECC, so
I maybe copying your code.

Thanks,
Bill Pringlemeir.




More information about the linux-mtd mailing list