mtd: rawnand: bbt: Skip bad blocks when searching for the BBT in NAND
authorStefan Riedmueller <s.riedmueller@phytec.de>
Thu, 25 Mar 2021 10:23:37 +0000 (11:23 +0100)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Sun, 28 Mar 2021 17:34:36 +0000 (19:34 +0200)
commitbd9c9fe2ad04546940f4a9979d679e62cae6aa51
tree700e230b733a8f81243e32908122f4df415ac1d2
parent25fefc88c71f47db0466570335e3f75f10952e7a
mtd: rawnand: bbt: Skip bad blocks when searching for the BBT in NAND

The blocks containing the bad block table can become bad as well. So
make sure to skip any blocks that are marked bad when searching for the
bad block table.

Otherwise in very rare cases where two BBT blocks wear out it might
happen that an obsolete BBT is used instead of a newer available
version.

Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20210325102337.481172-1-s.riedmueller@phytec.de
drivers/mtd/nand/raw/nand_bbt.c