Charles Manning wrote: > On Thursday 23 July 2009 05:07:19 Andrew McKay wrote: >> Hi, >> >> I'm using YAFFS2 on a Micron 2GB NAND part (MT29F16G08). I'm using kernel >> version 2.6.20.4. I have back ported a patch for 128Bit OOB support at the >> MTD level and things seem to be working fine from that perspective. >> However during bootup I see messages like: >> >> **>> Erasure failed 302 >> **>> Block 302 retired >> Block 302 is in state 9 after gc, should be erased >> page 134426 in gc has no object: 0 0 0 >> **>> Erasure failed 2100 >> **>> Block 2100 retired >> Block 2100 is in state 9 after gc, should be erased >> >> This message repeats every time the board is booted. I would assume that >> if a block is retired it should be listed in the bad block list during boot >> up. This device has a long long list of bad blocks (some of them may have >> gotten that way during development of my NAND driver). Another board we >> are using has less bad blocks but also has messages that it retired a >> block, and yet on next boot it does it again. >> >> Anybody have any hints as to what I should be looking for, or whether this >> is really an issue or not? > > It looks like your bad block marking strategy or the erase is not working > properly. I think erase is working properly. I enabled debug on erase: echo +erase > /proc/yaffs I'm seeing the garbage collection algorithm cleaning up blocks successfully: yaffs_BlockBecameDirty block 5702 state 5 Erased block 5702 yaffs_BlockBecameDirty block 5703 state 8 Erased block 5703 yaffs_BlockBecameDirty block 5704 state 8 Erased block 5704 yaffs_BlockBecameDirty block 5706 state 8 Erased block 5706 yaffs_BlockBecameDirty block 5707 state 8 Erased block 5707 yaffs_BlockBecameDirty block 5709 state 5 Erased block 5709 yaffs_BlockBecameDirty block 5710 state 8 Erased block 5710 Now I'll look into marking of bad blocks. Who is responsible for marking bad blocks YAFFS or MTD? Or does YAFFS make calls into MTD to mark the blocks bad? > > Try doing some nandwrites etc to manually do stuff to the block and see if > that works. How would you recommend doing this? Unmounting the YAFFS2 file system and reading and writing the NAND block device directly? Thanks, Andrew