[PATCH] mtd: nand: docg4: ecc.read_page() returns 0 on uncorrectible errors

Mike Dunn mikedunn at newsguy.com
Sat Sep 15 14:08:07 EDT 2012


Hi Brian, thanks for the Ack.  It seems I was careless with my own driver when I
did the bitflip patches.

BTW, the consequence of this oversight was seen when using mtdchar (e.g.,
mtd-utils 'nanddump') when uncorrectAble bitflips occurred.  The userspace app
just kept repeating the read call, because the prior call indicated that no data
was read.


On 09/14/2012 08:20 PM, Brian Norris wrote:
>> +       if (bits_corrected == -EBADMSG)   /* uncorrectible errors */
> 
> s/uncorrectible/uncorrectable/


Ha!  I actualy looked the word up in the dictionary, and either spelling is
correct.  But yours is more common.


> 
>> +               return 0;
>>         return bits_corrected;
>>  }
>>
> 
> With that change:
> 
> Acked-by: Brian Norris <computersforpeace at gmail.com>
> 
> Also, not a blocker for this patch, but this made me look elsewhere in docg4.c:
> 
> static int __init read_factory_bbt(struct mtd_info *mtd)
> {
> ...
>         status = docg4_read_page(mtd, nand, buf, 0, DOCG4_FACTORY_BBT_PAGE);
>         if (status)
>                 goto exit;
> 
> This could cause problems if there are ever bitflips on the BBT page.
> Can the factory BBT contain bitflips?


Ah, yes, thank you for catching that!!  Overlooked when docg4_read_page() was
changed to return max bitflips; status should be tested for negative value.
Should also try to recover from uncorrectable bitflips (I believe that table is
stored redundantly).

Thanks again,
Mike



More information about the linux-mtd mailing list