[PATCH 1/2] mtd: nand: add erased-page bitflip correction

Brian Norris computersforpeace at gmail.com
Mon Mar 17 14:53:47 EDT 2014


On Thu, Mar 13, 2014 at 09:57:17AM -0300, Ezequiel Garcia wrote:
> On Mar 12, Brian Norris wrote:
> > Really? So if you read a blank (all 0xff) page that has no bitflips, you
> > see an ECC error? I'm sorry, but I didn't realize that's how your
> > hardware worked. That's the worst hardware ECC design I've seen so far
> > :(
> > 
> 
> I haven't had time to follow this discussion yet, but just wanted to point
> out the above is also true for pxa3xx-nand.c.

I'm learning every day!

> If a completely erased page is read, the calculated ECC would be 0 and the
> stored ECC would be all 0xff (although I never actually checked this).
> See the snippet below:
> 
> static int pxa3xx_nand_read_page_hwecc(struct mtd_info *mtd,
> 		struct nand_chip *chip, uint8_t *buf, int oob_required,
> 		int page)
> {
> 	[..]
> 	} else if (info->retcode == ERR_UNCORERR) {
> 		/*
> 		 * for blank page (all 0xff), HW will calculate its ECC as
> 		 * 0, which is different from the ECC information within
> 		 * OOB, ignore such uncorrectable errors
> 		 */
> 		if (is_buf_blank(buf, mtd->writesize))
> 			info->retcode = ERR_NONE;
> 	}
> 	[..]
> }

Looks like pxa3xx_nand will probably need the same flag, then we could
probably kill the is_buf_blank() check.

Brian



More information about the linux-mtd mailing list