Skip to contentSkip to conversation

Why are there 2 oobinfos for a NAND mtd?

DISCUSSION Charles Manning 2 participants 2 messages May 18, 2006 – May 19, 2006 Memory technology devices (MTD)

lore
Share & tools
lore
#0 lore raw

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

#1 lore raw
Quoted 6 lines · Charles Manning

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?

Quoted 7 lines

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