On Friday 10 February 2006 05:52, Claudio Lanconelli wrote: > Hi Charles, > I have a question regarding the condition YAFFS and YAFFS2 mark a block > as bad. > > Charles Manning wrote: > >YAFFS takes a fairly cautious approach to handling bad blocks. If a block > >fails an ECC test then it's retired at the next garbage collection of that > >block (ie we suck out the data first). > > Does this mean that if there is a single bit error corrected by the ECC > algo YAFFS retire the block and mark it as BAD? Yes. > > If it's the case I think Toshiba suggest a different behavior in the > document > you linked previously Toshiba NAND Flash Applications design guide on > page 19. > > It says: > "Therefore, blocks should be marked as bad and no > longer accessed if there is either a block erase failure > or a page program failure. This can be determined by > doing a status read after either operation" > > and then > > "Although random bit errors may occur during use, > this does not necessarily mean that a block is bad. > Generally, a block should be marked as bad only if > there is a program or erase failure" That is true. This is what they recommend. > > How YAFFS and YAFFS2 behave? YAFFS is being more cautious than that, which means that in theory YAFFS will lose blocks faster than they recommend. However from accelerated lifetime testing I've done, I have not seen this to be a practical problem since ECC errors are so rare once the problematic blocks have been removed. It also means that in theory YAFFS is likely to be more secure than something designed the way they recommend. I would be concerned that by the time you start getting programming errors you might be exposing yourself to data loss. Most of the ECC handling etc for NAND was designed in the old days (256-byte pages etc) when NAND was quite flaky and 1-bit errors were relatively common. These days NAND is far better and far less likely to give ECC errors except on a few "soft" blocks. It would be quite simple to change the retirement policy, but I'd like to see evidence that it is safe to do so first. I believe there are some Toshiba guys on the list. I'd like to hear their opinions on or off list. -- Charles In practice though