[PATCH] [MTD][OneNAND] Check the initial bad block using ONENAND_CTRL_ERROR

Kyungmin Park kyungmin.park at samsung.com
Wed Dec 12 03:33:09 EST 2007


Some chips don't set the ONENAND_CTRL_LOAD bit.

Signed-off-by: Kyungmin Park <kyungmin.park at samsung.com>
---
 drivers/mtd/onenand/onenand_base.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/onenand/onenand_base.c b/drivers/mtd/onenand/onenand_base.c
index bfc8399..e9aac83 100644
--- a/drivers/mtd/onenand/onenand_base.c
+++ b/drivers/mtd/onenand/onenand_base.c
@@ -1121,8 +1121,8 @@ static int onenand_bbt_wait(struct mtd_info *mtd, int state)
 
 	if (ctrl & ONENAND_CTRL_ERROR) {
 		printk(KERN_DEBUG "onenand_bbt_wait: controller error = 0x%04x\n", ctrl);
-		/* Initial bad block case */
-		if (ctrl & ONENAND_CTRL_LOAD)
+		/* Initial bad block case: 0x2400 or 0x0400 */
+		if (ctrl & ONENAND_CTRL_ERROR)
 			return ONENAND_BBT_READ_ERROR;
 		return ONENAND_BBT_READ_FATAL_ERROR;
 	}
-- 
1.5.0.6




More information about the linux-mtd mailing list