mtd: nand: do not scan BBT after scrub
authorMasahiro Yamada <yamada.m@jp.panasonic.com>
Fri, 26 Dec 2014 13:20:58 +0000 (22:20 +0900)
committerScott Wood <scottwood@freescale.com>
Fri, 9 Jan 2015 18:19:06 +0000 (12:19 -0600)
commitab37b76d5d7879009565d1d1a2be6de63f86a674
tree14906cff88b75a630b36ac753a86325fd3415f81
parentbf80ee6e1d73be046a7c5454c7e7493e7a6ea5e0
mtd: nand: do not scan BBT after scrub

Currently, "nand scrub" runs chip->scan_bbt at the end of
nand_erase_opts() even if NAND_SKIP_BBTSCAN flag is set.

It violates the intention of NAND_SKIP_BBTSCAN.

Move NAND_SKIP_BBTSCAN flag check to nand_block_checkbad() so that
chip->scan_bbt() is never run if NAND_SKIP_BBTSCAN is set.

Also, unset NAND_BBT_SCANNED flag instead of running chip->scan_bbt()
right after scrub.  We can be lazier here because the BBT is scanned
at the next call of nand_block_checkbad().

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Scott Wood <scottwood@freescale.com>
drivers/mtd/nand/nand_base.c
drivers/mtd/nand/nand_util.c