]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
NAND: Mark the BBT as scanned prior to calling scan_bbt.
authorScott Wood <scottwood@freescale.com>
Tue, 16 Dec 2008 20:24:16 +0000 (14:24 -0600)
committerScott Wood <scottwood@freescale.com>
Tue, 16 Dec 2008 20:40:34 +0000 (14:40 -0600)
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>
drivers/mtd/nand/nand_base.c

index ba05b762ed2c7b99144df648f6f2a0681796e365..94a65d4e72b02fa5bc7e981a66a96e72b048c3fe 100644 (file)
@@ -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)