dangerous NAND_BBT_SCANBYTE1AND6

Ivan Djelic ivan.djelic at parrot.com
Thu Apr 21 13:10:46 EDT 2011


On Thu, Apr 21, 2011 at 04:52:59PM +0100, Matthieu Castet wrote:
> Hi,
> 
> I believe NAND_BBT_SCANBYTE1AND6 behavior is very dangerous.
> We have a ST flash where ecc where but on bit 5 and 6.
> With new kernel all block are bad.
> 
> Is this option is really needed ?
> ST datasheet say [1]. We already check the first Word.
> Why do we need to check the 6th Byte ?

I agree with Matthieu, NAND_BBT_SCANBYTE1AND6 code also seems wrong to me.

Old small page nand devices used to have their bad block marker in 6th byte of
the spare area of the first page.

ST datasheet says that factory bad blocks will have _both_ bytes cleared
(1st and 6th); I guess this was done to allow choosing which marker to check
(but I may be wrong). Maybe to be compatible with large page marker location
scheme (again, just guessing).

Option NAND_BBT_SCANBYTE1AND6 code was introduced in commit
58373ff0afff4cc8ac40608872995f4d87eb72ec; but the commit message does not
clearly explain why both markers should be checked.

My understanding of bad block markers is (please correct me if I am wrong):
small page => check 6th byte of spare area of first page
large page, non-ONFI => check first word of spare area of first page
ONFI => see ONFI spec

Ivan



More information about the linux-mtd mailing list