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

Kyungmin Park kmpark at infradead.org
Wed Dec 12 06:52:57 EST 2007


Hi,

> You have:
>
>         if (ctrl & ONENAND_CTRL_ERROR) {
>                 printk(KERN_DEBUG "onenand_bbt_wait: controller error = 0x%04x\n", ctrl);
>                 /* Initial bad block case: 0x2400 or 0x0400 */
>                 if (ctrl & ONENAND_CTRL_ERROR)
>                         return ONENAND_BBT_READ_ERROR;
>                 return ONENAND_BBT_READ_FATAL_ERROR;
>         }
>
> which is the same as:
>
>         if (ctrl & ONENAND_CTRL_ERROR) {
>                 printk(KERN_DEBUG "onenand_bbt_wait: controller error = 0x%04x\n", ctrl);
>                 return ONENAND_BBT_READ_ERROR;
>         }
>
> Is that what you intended?
>

Aha, You're right.
The original goal is to find a initial bad block and other unknown errors.
First it checks the controller error and try to find a initial bad
block with load error.
But some chips are not set the load error. it only sets the error bit (10).

Strictly to find a initial bad block, it checks the non 0xff pattern
from oob area.
But now it checks the controller error as initial bad block.
I'm not sure it have to check the non 0xff pattern after controller error.
I think it's enough to check controller error at least onenand_bbt_wait. :)

I will change it as you suggested.

Thank you,
Kyungmin Park



More information about the linux-mtd mailing list