Thanks, but I would still like to pinpoint the point where something went wrong and YAFFS decided to mark the block as bad. I think this could help me determine the root cause for this issue. FYI, I am using HW ecc and therefor I've enabled CONFIG_YAFFS_DISABLE_TAGS_ECC. Boaz. On Thu, 2011-04-07 at 09:36 +0100, Laurie van Someren wrote: > On Thu, 2011-04-07 at 10:51 +0300, Boaz Ben-David wrote: > > Hi, > > > > This indeed seems like a problem in our kernel, but this brings me to > > another question. > > It seems that YAFFS is marking a lot of blocks as bad, the board itself > > is very new so this couldn't be a bad NAND chip and it happens on all of > > our boards. > > > > Is there any debugging option that can help me find out why YAFFS is > > marking blocks as bad? > > > > Also, could this be somehow related to the fact I am using YAFFS on a > > MLC device? Is there some kernel option I need to enable/disable? > Mr Ben-David, > Charles Manning is better placed than I to answer your question, but I > can tell you there is no kernel option relating to MLC chips. I > believe it is Charles's intention that improved (more active and > therefore slower) Error Correction Code should be brought in to > improve the reliability of MLCs. > LvS > > > > On Mon, 2011-04-04 at 08:10 +1200, Charles Manning wrote: > > > On Sunday 03 April 2011 17:28:15 Boaz Ben-David wrote: > > > > Hi, > > > > > > > > I'm using yaffs2 on a 2GB MLC Samsung flash. > > > > We have a few systems running for testing purposes and I've noticed the > > > > following error in the kernel log: > > > > > > > > Apr 1 07:22:46 wellsense kernel: yaffs: Block struck out > > > > Apr 1 13:52:31 wellsense kernel: yaffs-bg-1: page allocation failure. > > > > order:8, mode:0x40d0 > > > > Apr 1 13:52:32 wellsense kernel: [] (unwind_backtrace > > > > +0x0/0xd0) from [] (__alloc_pages_nodemask+0x49c/0x504) > > > > Apr 1 13:52:32 wellsense kernel: [] (__alloc_pages_nodemask > > > > +0x49c/0x504) from [] (__get_free_pages+0x10/0x3c) > > > > Apr 1 13:52:32 wellsense kernel: [] (__get_free_pages > > > > +0x10/0x3c) from [] (__kmalloc+0x3c/0x1d4) > > > > Apr 1 13:52:32 wellsense kernel: [] (__kmalloc+0x3c/0x1d4) > > > > from [] (nand_update_bbt+0x54/0x15c) > > > > Apr 1 13:52:32 wellsense kernel: [] (nand_update_bbt > > > > +0x54/0x15c) from [] (nand_default_block_markbad+0x74/0xfc) > > > > Apr 1 13:52:32 wellsense kernel: [] > > > > (nand_default_block_markbad+0x74/0xfc) from [] > > > > (nand_block_markbad+0x38/0x3c) > > > > Apr 1 13:52:32 wellsense kernel: [] (nand_block_markbad > > > > +0x38/0x3c) from [] (part_block_markbad+0x50/0x64) > > > > Apr 1 13:52:32 wellsense kernel: [] (part_block_markbad > > > > +0x50/0x64) from [] (nandmtd2_MarkNANDBlockBad+0x48/0x5c) > > > > Apr 1 13:52:32 wellsense kernel: [] > > > > (nandmtd2_MarkNANDBlockBad+0x48/0x5c) from [] > > > > (yaffs_MarkBlockBad+0x1c/0x28) > > > > Apr 1 13:52:32 wellsense kernel: [] (yaffs_MarkBlockBad > > > > +0x1c/0x28) from [] (yaffs_BlockBecameDirty+0x1e4/0x388) > > > > Apr 1 13:52:32 wellsense kernel: [] (yaffs_BlockBecameDirty > > > > +0x1e4/0x388) from [] (yaffs_DeleteChunk+0x1f4/0x214) > > > > Apr 1 13:52:32 wellsense kernel: [] (yaffs_DeleteChunk > > > > +0x1f4/0x214) from [] (yaffs_CheckGarbageCollection > > > > +0x8f8/0xb7c) > > > > Apr 1 13:52:32 wellsense kernel: [] > > > > (yaffs_CheckGarbageCollection+0x8f8/0xb7c) from [] > > > > (yaffs_BackgroundGarbageCollect+0x34/0x58) > > > > Apr 1 13:52:32 wellsense kernel: [] > > > > (yaffs_BackgroundGarbageCollect+0x34/0x58) from [] > > > > (yaffs_BackgroundThread+0x114/0x1c4) > > > > Apr 1 13:52:32 wellsense kernel: [] (yaffs_BackgroundThread > > > > +0x114/0x1c4) from [] (kthread+0x78/0x80) > > > > Apr 1 13:52:32 wellsense kernel: [] (kthread+0x78/0x80) from > > > > [] (kernel_thread_exit+0x0/0x8) > > > > Apr 1 13:52:32 wellsense kernel: Mem-info: > > > > Apr 1 13:52:32 wellsense kernel: DMA per-cpu: > > > > Apr 1 13:52:32 wellsense kernel: CPU 0: hi: 0, btch: 1 usd: 0 > > > > Apr 1 13:52:32 wellsense kernel: Normal per-cpu: > > > > Apr 1 13:52:32 wellsense kernel: CPU 0: hi: 90, btch: 15 usd: 23 > > > > Apr 1 13:52:32 wellsense kernel: Active_anon:16294 active_file:12696 > > > > inactive_anon:16145 > > > > Apr 1 13:52:32 wellsense kernel: inactive_file:13013 unevictable:658 > > > > dirty:0 writeback:0 unstable:0 > > > > Apr 1 13:52:32 wellsense kernel: free:2366 slab:1219 mapped:3563 > > > > pagetables:70 bounce:0 > > > > Apr 1 13:52:32 wellsense kernel: DMA free:1976kB min:188kB low:232kB > > > > high:280kB active_anon:3372kB inactive_anon:3500kB active_file:3476kB > > > > inactive_file:2448kB unevictable:0kB present:24384kB pages_scanned:0 > > > > all_unreclaimable? no > > > > Apr 1 13:52:32 wellsense kernel: lowmem_reserve[]: 0 229 229 > > > > Apr 1 13:52:32 wellsense kernel: Normal free:9948kB min:1840kB > > > > low:2300kB high:2760kB active_anon:61640kB inactive_anon:61244kB > > > > active_file:44796kB inactive_file:49304kB unevictable:2632kB > > > > present:234688kB pages_scanned:0 all_unreclaimable? no > > > > Apr 1 13:52:32 wellsense kernel: lowmem_reserve[]: 0 0 0 > > > > Apr 1 13:52:32 wellsense kernel: DMA: 70*4kB 20*8kB 6*16kB 5*32kB > > > > 2*64kB 1*128kB 0*256kB 0*512kB 1*1024kB 0*2048kB 0*4096kB 0*8192kB > > > > 0*16384kB = 1976kB > > > > Apr 1 13:52:32 wellsense kernel: Normal: 986*4kB 155*8kB 57*16kB > > > > 36*32kB 11*64kB 9*128kB 4*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB > > > > 0*8192kB 0*16384kB = 10128kB > > > > Apr 1 13:52:32 wellsense kernel: 55383 total pagecache pages > > > > Apr 1 13:52:32 wellsense kernel: 0 pages in swap cache > > > > Apr 1 13:52:32 wellsense kernel: Swap cache stats: add 0, delete 0, > > > > find 0/0 > > > > Apr 1 13:52:32 wellsense kernel: Free swap = 0kB > > > > Apr 1 13:52:32 wellsense kernel: Total swap = 0kB > > > > Apr 1 13:52:32 wellsense kernel: 65536 pages of RAM > > > > Apr 1 13:52:32 wellsense kernel: 3406 free pages > > > > Apr 1 13:52:32 wellsense kernel: 2456 reserved pages > > > > Apr 1 13:52:32 wellsense kernel: 985 slab pages > > > > Apr 1 13:52:32 wellsense kernel: 4497 pages shared > > > > Apr 1 13:52:32 wellsense kernel: 0 pages swap cached > > > > Apr 1 13:52:32 wellsense kernel: nand_update_bbt: Out of memory > > > > Apr 1 13:52:32 wellsense kernel: nand_erase: attempt to erase a bad > > > > block at page 0x00021c00 > > > > Apr 1 13:52:32 wellsense kernel: yaffs: Failed to mark bad and erase > > > > block 285 > > > > Apr 1 13:52:32 wellsense kernel: **>> Block 285 retired > > > > Apr 1 13:52:32 wellsense kernel: Block 285 is in state 9 after gc, > > > > should be erased > > > > > > > > Anyone know what this is about? > > > > > > > > > The following: > > > > Apr 1 13:52:32 wellsense kernel: nand_update_bbt: Out of memory > > > > Apr 1 13:52:32 wellsense kernel: nand_erase: attempt to erase a bad > > > > > > tells me it is a problem in the mtd layer. > > > > > > Looks like yaffs still handled the problem properly though. > > > > > > -- Charles > > > > > > _______________________________________________ > > > yaffs mailing list > > > yaffs@lists.aleph1.co.uk > > > http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs > > > > _______________________________________________ > > yaffs mailing list > > yaffs@lists.aleph1.co.uk > > http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs > > > -- > Laurie van Someren, Aleph One Ltd, Old Courthouse, Bottisham, CAMBRIDGE > CB25 9BA UK t: +44 (0)1 223 811 679 www.aleph1.co.uk & www.yaffs.net >