Why are there 2 oobinfos for a NAND mtd?

Charles Manning manningc2 at actrix.gen.nz
Thu May 18 17:43:03 EDT 2006


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?

-- Charles










More information about the linux-mtd mailing list