On 21/02/12 19:06, Ezio Zhang wrote: > As yaffs just provides a interface for query block’s state and not > implement it,I’m confused about how to archieve this work EFFICIENTLY. YAFFS needs to know whether or not the block is marked as bad. It's quite common for a NAND driver to keep a table of known-bad blocks (both those marked bad at the factory, and those that have worn out in use). This is what the Linux MTD layer does. The first time you use a chip, you have to scan it looking for factory-bad markers and build up the initial table; once you have that, it is stored on the chip (taking up a block or two) and is very quick to look up later. > Some one suggest me to scan the whole flash,but I think it will cost to > much time when nand flash is big. If your nand flash array is really large, you may want to consider trading off time for spatial efficiency: use virtual pages and/or virtual blocks that are larger than your chip's physical pages and blocks. Ross