[PATCH] Fixup in NAND bad block management + fix of misspring.(nand_base.c)
Thomas Gleixner
tglx at linutronix.de
Mon Feb 20 07:11:43 EST 2006
On Mon, 2006-02-20 at 14:56 +0300, Alexey, Korolev wrote:
> Thomas,
>
> > I still do not get why you need all this magic instead of fixing up
> > this->badblockpos in the first place.
> >
> Fixing this->badblockpos in low level driver will not help because,
> according to the code this->badblockpos updates in nand_base.c
> unconditionally.
Did I say low level driver ?
> Moreover it's rather hard to define the conditions, because by default
> structure "this" is filled by zeroes. (We can't distinguish advisedly
> setting of badblockpos from the default value).
And you believe that your patch is the only way to solve that trivial
problem ?
Without thinking too much about the problem, there _are_ at least two
sane places to fix that.
1. nand_scan() can handle this based on chip id and/or manufacturer id
2. nand_scan_bbt() can do the fixup as well
When the ST chips have the bad block pos at offset 0 in general then we
want a generic solution which fixes up the nand_scan_bbt code as well
instead of requiring a seperate board driver supplied badblock_pattern.
Your patch is bogus anyway, as the else path will _NEVER_ be executed.
this->badblock_pattern is never NULL.
tglx
More information about the linux-mtd
mailing list