abuse of nand_correct_data in tmio_nand driver
Dmitry Eremin-Solenikov
dbaryshkov at gmail.com
Sun Jul 19 12:08:59 EDT 2009
2009/7/19, Atsushi Nemoto <anemo at mba.ocn.ne.jp>:
> On Sun, 19 Jul 2009 04:11:27 +0400, Dmitry Eremin-Solenikov
> <dbaryshkov at gmail.com> wrote:
>> > The current nand_correct_data() can be used for ecc.bytes = 3 case
>> > only. The tmio_nand driver uses ecc.bytes = 6.
>>
>> IIRC, tmio_nand driver accesses two ecc "sectors" at once, so this is
>> most probably ok. I'll look into it though, when I have some time.
>
> Yes, tmio_nand driver read 512 byte data and calculate 6 byte ecc at
> once, but nand_correct_data only references first 3 byte of ecc.
>
> I doubt the driver cannot detect errors in the second 256 byte sector
> of the 512 byte block.
Hmm. That's strange: nand_correct_data() seems to support 512-byte sectors,
however it assumes that ECC is still 3 bytes. I'll have to check specs to see
who is wrong...
--
With best wishes
Dmitry
More information about the linux-mtd
mailing list