[PATCH] mtd: nand: add option to erase NAND blocks even if detected as bad.

Boris Brezillon boris.brezillon at free-electrons.com
Fri May 12 01:44:04 PDT 2017


On Fri, 12 May 2017 10:33:27 +0200
Richard Weinberger <richard at nod.at> wrote:

> Boris, Mario,
> 
> Am 12.05.2017 um 10:24 schrieb Boris Brezillon:
> >>> Hmm, this sounds like a gross hack.    
> >> It is, but I see no other solution. The NAND chips were used in an
> >> incompatible way by a hack-n-slash driver made by allwinner, and
> >> trying to load them with a proper MTD driver fails miserably if this
> >> is not done.
> >> If anyone can propose a better solution I'll more than happily implement it.
> >> I'm open to suggestions, and of course I'm open to rejection of my
> >> patches if needed.  
> > 
> > u-boot provides the nand.scrub command, which does exactly what you're
> > looking for. And no, I don't think it's a good idea to allow erasing
> > bad blocks, at least not by default.  
> 
> To make this very clear for all MTD users out there, scrubbing the NAND and
> losing the information which blocks are bad is awful.
> Bad blocks can work somehow and fail much later in funny ways.
> UBI/FS problems ahead...
> 
> Do this only if you *really* know what you are doing.

I'm clearly not encouraging people to use nand.scrub, it's just that
sometime you don't have a choice, and this is the case here:
Allwinner is putting non-FF data in the BBM region, and when we switch
from an Allwinner kernel to a mainline kernel, the mainline kernel
considers all programmed blocks as bad.



More information about the linux-mtd mailing list