浏览代码

NAND: Mark the BBT as scanned prior to calling scan_bbt.

Otherwise, recursion can occur if scan_bbt does not find a bad block
table, and tries to write one, and the attempt to erase the BBT area
causes a bad block check.

Signed-off-by: Scott Wood <scottwood@freescale.com>
Scott Wood 16 年之前
父节点
当前提交
ff49ea8977
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      drivers/mtd/nand/nand_base.c

+ 1 - 1
drivers/mtd/nand/nand_base.c

@@ -460,8 +460,8 @@ static int nand_block_checkbad(struct mtd_info *mtd, loff_t ofs, int getchip,
 	struct nand_chip *chip = mtd->priv;
 
 	if (!(chip->options & NAND_BBT_SCANNED)) {
-		chip->scan_bbt(mtd);
 		chip->options |= NAND_BBT_SCANNED;
+		chip->scan_bbt(mtd);
 	}
 
 	if (!chip->bbt)