On Fri, 9 May 2014, Qi Wang ?? (qiwang) wrote: > But now, MTD layer read function only return ?EUCLEAN to YAFFS2, YAFFS2 cannot > get how many bit flip occur. Since a couple of kernel versions back, the mtd layer now includes a method of notifying how many bits were corrected during a read operation, and not just -EUCLEAN. So the mechanism to find out how many bitflips have occurred actually exists now. (Not all NAND flash controllers with hardware ECC support this however, i.e. they correct the data but it's not possible to read from the hardware how many bits were corrected (or in some cases even if bit correction occurred).) > But actually, in NAND flash, only program and erase error can be marked bad > block. Bit flip symptom is easy happen after a page is read many cycles. > > If a system use YAFFS2, and never power down this system, user will see a > lot of bad block after they run a time, But this block isn?t a real bad block. > > How about just refresh the block when bit flip occur, but not record the bit > flip count, and mark it as bad block? I would think that one factor in deciding if the block is going really bad would be to estimate how many read cycles have been done since the last rewrite. If there have been a lot of read cycles, or a lot of time has passed since the last rewrite, it would be more expected for bitflips to occur and hence the block should not be marked as bad. /Ricard -- Ricard Wolf Wanderlöf ricardw(at)axis.com Axis Communications AB, Lund, Sweden www.axis.com Phone +46 46 272 2016 Fax +46 46 13 61 30