[U-Boot] [PATCH v2] mtd: nand: revive "nand scrub" command

Masahiro Yamada yamada.m at jp.panasonic.com
Tue Dec 16 07:36:33 CET 2014


Since commit ff94bc40af34 (mtd, ubi, ubifs: resync with Linux-3.14),
the "nand scrub" command has not been working.

Signed-off-by: Masahiro Yamada <yamada.m at jp.panasonic.com>
Cc: Scott Wood <scottwood at freescale.com>
Cc: Heiko Schocher <hs at denx.de>
---

Changes in v2:
  - Drop #ifdef __UBOOT__

 drivers/mtd/nand/nand_base.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/nand/nand_base.c b/drivers/mtd/nand/nand_base.c
index 70e780c..d04c7ea 100644
--- a/drivers/mtd/nand/nand_base.c
+++ b/drivers/mtd/nand/nand_base.c
@@ -2905,7 +2905,7 @@ int nand_erase_nand(struct mtd_info *mtd, struct erase_info *instr,
 		WATCHDOG_RESET();
 
 		/* Check if we have a bad block, we do not erase bad blocks! */
-		if (nand_block_checkbad(mtd, ((loff_t) page) <<
+		if (!instr->scrub && nand_block_checkbad(mtd, ((loff_t) page) <<
 					chip->page_shift, 0, allowbbt)) {
 			pr_warn("%s: attempt to erase a bad block at page 0x%08x\n",
 				    __func__, page);
-- 
1.9.1



More information about the U-Boot mailing list