Why are there 2 oobinfos for a NAND mtd?

Josh Boyer jwboyer at gmail.com
Thu May 18 20:41:38 EDT 2006


On 5/18/06, Charles Manning <manningc2 at actrix.gen.nz> wrote:
> There are both mtd->oobinfo and
> ((struct nand_chip *)mtd->priv)->autooob.
>
> There's even a memcpy from one to the other. If they're supposed to be the
> same all the time, surely there should only be one of these?
>
> They both get used in nand_base, which is perhaps wrong. For example,
> nand_read_ecc() uses mtd->oobinfo and nand_do_read_ecc() uses the other one.
>
> Having two gets confusing and I have seen drivers where one has been  hacked
> one but not the other  which has lead to inconsistencies and faailures.
>
> Is there any valid reason to have two?

I have no idea, but I do know that Thomas plans for some oob cleanup
soon.  Perhaps this is on his list.

josh




More information about the linux-mtd mailing list