Skip to content

Commit

Permalink
[MTD] [OneNAND] Check the initial bad block using ONENAND_CTRL_ERROR
Browse files Browse the repository at this point in the history
Some chips don't set the ONENAND_CTRL_LOAD bit.

Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
  • Loading branch information
Kyungmin Park committed Jan 29, 2008
1 parent e71f04f commit b2581be
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions drivers/mtd/onenand/onenand_base.c
Original file line number Diff line number Diff line change
Expand Up @@ -1119,12 +1119,10 @@ static int onenand_bbt_wait(struct mtd_info *mtd, int state)
interrupt = this->read_word(this->base + ONENAND_REG_INTERRUPT);
ctrl = this->read_word(this->base + ONENAND_REG_CTRL_STATUS);

/* Initial bad block case: 0x2400 or 0x0400 */
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)
return ONENAND_BBT_READ_ERROR;
return ONENAND_BBT_READ_FATAL_ERROR;
return ONENAND_BBT_READ_ERROR;
}

if (interrupt & ONENAND_INT_READ) {
Expand Down

0 comments on commit b2581be

Please sign in to comment.