UBI torture_peb() bad block detection problem

Artem Bityutskiy dedekind1 at gmail.com
Wed May 29 03:27:13 EDT 2013


On Sat, 2013-04-27 at 21:57 +0800, Qiang Yu wrote:
> Hi guys,
> 
> I'm writing MTD driver for Allwinner A10 nand controller. Now there is
> a problem with the UBI torture_peb() function. From the code and UBI
> doc, a PEB will be treated as bad when read with bit-flip after erase.

The assumption that the MTD driver covers empty ereaseblocks with ECC,
so the erased areas are also protected. And the driver reports bit-flips
only if the amount of bits flipped is above the "safe" threshold, see
'mtd_read()':

return ret_code >= mtd->bitflip_threshold ? -EUCLEAN : 0;

So, your driver tells UBI: hey, this area has a dangeours amount of
bit-flips. And UBI knows that it just erased it, so the reaction is -
let me assume it is bad.

So you should invent something in your driver to make it protect empty
NAND pages. Try to google, there were discussions about this.

> But with SAMSUNG K9GBG08U0A flash chip, sometimes the bit-flip does
> happen even after being erased.

The assumption is that it should be corrected by ECC. -EUCLEAN should
not be reported if it is harmless. It should only be reported if there
are too many bit-flips.

-- 
Best Regards,
Artem Bityutskiy




More information about the linux-mtd mailing list