mtd: nand_bbt: Skip bad blocks when searching for the BBT in NAND
Subsystems (2)
PATCH 1/1 mtd: nand_bbt: Skip bad blocks when searching for the BBT in NAND
From: Stefan Riedmueller <[email protected]>
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.
--- drivers/mtd/nand/nand_bbt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/mtd/nand/nand_bbt.c +8 -2
@@ -560,8 +560,14 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descrint actblock = startblock + dir * block;loff_t offs = (loff_t )actblock << this->bbt_erase_shift; -/* Read first page */ -scan_read (mtd, buf, offs, mtd->writesize, td); +/* Read first page including oob */ +scan_read_oob (mtd, buf, offs, scanlen); + +/* Skip blocks which are marked bad */ +if (buf[mtd->writesize] ==0x00 ) { +continue ; + } +if (!check_pattern (buf, scanlen, mtd->writesize, td)) { td->pages[i] = actblock << blocktopage;if (td->options &NAND_BBT_VERSION ) {
Signature · 7 lines
2.7.4 _______________________________________________ barebox mailing list [email protected] http://lists.infradead.org/mailman/listinfo/barebox
Please skip this patch, there seems to be a problem here.
Regards
Y. Bas
Am 04.05.20 um 15:44 schrieb Yunus Bas:
Quoted 24 lines
From: Stefan Riedmueller <[email protected]>
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.
Signed-off-by Stefan Riedmueller <[email protected]>Signed-off-by Christian Hemp <[email protected]>Signed-off-by Yunus Bas <[email protected]>--- drivers/mtd/nand/nand_bbt.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)drivers/mtd/nand/nand_bbt.c +1
-2@@ -560,8 +560,14 @@ static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descrint actblock = startblock + dir * block;loff_t offs = (loff_t )actblock << this->bbt_erase_shift; -/* Read first page */ -scan_read (mtd, buf, offs, mtd->writesize, td); +/* Read first page including oob */
drivers/mtd/nand/nand_bbt.c static int search_bbt(struct mtd_info *mtd, uint8_t *buf, struct nand_bbt_descr · line 573
Quoted 10 lines
drivers/mtd/nand/nand_bbt.c +7
-0+scan_read_oob (mtd, buf, offs, scanlen); + +/* Skip blocks which are marked bad */ +if (buf[mtd->writesize] ==0x00 ) { +continue ; + } +if (!check_pattern (buf, scanlen, mtd->writesize, td)) { td->pages[i] = actblock << blocktopage;if (td->options &NAND_BBT_VERSION ) {
_______________________________________________
barebox mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/barebox