[Yaffs] Bad block management

Jacob Dall jacob.dall@operamail.com
Thu, 20 Jan 2005 11:02:12 +0100


Hello yaffers,

I've a few questions regarding why yaffs' bad block management is designed =
the way it is.=20

According to Toshiba, NAND failures can be distinguished as "permanent fail=
ures" or "soft errors"

1) Permanent failures: this error occurs when programming or erasing, and c=
an be detected by reading the status register after operation.

2) Soft errors: this error occurs during a program, but can only be detecte=
d by reads. The error is cleared by a block erase.

Now, upon read, if yaffs detects an unfixable ECC error in a page, the bloc=
k holding that page is marked as bad.=20
According to 2) it would be ok to just mark the page as discarded and let t=
he garbage collector do its job - or have I missed something?=20

In yaffs, a block is marked bad by writing 0 to byte 517 in page 0 / 1 in t=
he block. Why wasn't it decided to use another value (for instance, like Sm=
artMedia's 0xF0). Then it would have been possible to destinguish initial b=
ad blocks from operational bad blocks.

I've an issue with some of my devices - bad blocks is increased very rapidl=
y. Beyond the fact that it's due to ECC read errors, I'm yet to discover th=
e root of the problem.=20

I'm not blaming yaffs - I'm sure the problem is to be found else where, but=
 I'm thinking really hard of making those changes to yaffs, making me able =
to get back to the state when the NAND was first taken into use.

Please let me know your reasons / thoughts...


Thanks and regards,
Jacob Dall

FYI: the 'According to Toshiba' stuff was taken from a document named 'NAND=
 Flash Application Design Guide'