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

Adrian Hunter ext-adrian.hunter at nokia.com
Wed Dec 12 05:57:04 EST 2007


ext Kyungmin Park wrote:
> 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;
>  	}

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?



More information about the linux-mtd mailing list