mtd: rawnand: nand_bbt: Skip bad blocks when searching for the BBT in NAND
authorStefan Riedmueller <s.riedmueller@phytec.de>
Fri, 25 Jun 2021 12:38:21 +0000 (14:38 +0200)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Thu, 15 Jul 2021 23:06:22 +0000 (01:06 +0200)
commit1a57b13e6017d2af575f4f42e848aa0b64d4bcf1
treec37acdf5000773a5792412166f83abb10e35a117
parent778cb8e39f6ec252be50fc3850d66f3dcbd5dd5a
mtd: rawnand: nand_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.

This only applies to drivers which make use of a bad block marker in flash.
Other drivers won't be able to identify bad BBT blocks and thus can't skip
these.

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/20210625123821.207458-1-s.riedmueller@phytec.de
drivers/mtd/nand/raw/nand_bbt.c