Hi, Charles Thanks for your explanation. I used Sumsung onenand whose page size is 4KB and it can correct up to 4 bits in one sector(521B), onenand driver reports -EUCLEAN if there is less than 4 bit errors (1 ,2,3,4). It doesn¡¯t Distinguish how many bits error happened. I think it is a good idea to split the report procedure. thanks Xiaoguang -----Original Message----- From: yaffs-bounces@lists.aleph1.co.uk [mailto:yaffs-bounces@lists.aleph1.co.uk] On Behalf Of Charles Manning Sent: 2011Äê9ÔÂ21ÈÕ 13:22 To: yaffs@lists.aleph1.co.uk Subject: Re: [Yaffs] yaffs handle chunk error calling On Tuesday 20 September 2011 14:47:08 Xiaoguang Chen wrote: > Hi, Yaffs friends > I have one question about yaffs_handleChunkError function calling code > logic. In yaffs_ReadChunkWithTagsFromNAND: > > if (tags && > tags->eccResult > YAFFS_ECC_RESULT_NO_ERROR) { > > yaffs_BlockInfo *bi; > bi = yaffs_GetBlockInfo(dev, > chunkInNAND/dev->param.nChunksPerBlock); yaffs_HandleChunkError(dev, bi); > } > > Why use "tags->eccResult > YAFFS_ECC_RESULT_NO_ERROR " instead of > "tags->eccResult > YAFFS_ECC_RESULT_FIXED" ? > > If the flash has some one bit errors and these errors are corrected, > Tags->eccResult will be set to YAFFS_ECC_RESULT_FIXED. in this condition, > there should be no ecc problem. Why need to call yaffs_HandleChunkError ? We do this because we want to handle errors on the block before they start corrupting data. > > The problem is : if call yaffs_HandleChunkError, bi->chunkErrorStrikes++ > will be executed. After chunkErrorStrikes > 3, the block will be retired. > It will be marked as bad. But the block is not really bad. We can still use > it since it only has 4 times of fixed ECC error happened. If you have 1-bit correcting ECC then the above policy handles things well because single bit errors indicate that a block might have started going bad and we want to retire it before the block starts corrupting data. If you have multi-bit correcting data then it makes sense to modify what the driver reports. eg if you have 4 bit correcting then something like this makes sense: For 0,1 or 2 errors report NO ERROR. For 3 or 4 errors report FIXED. -- Charles _______________________________________________ yaffs mailing list yaffs@lists.aleph1.co.uk http://lists.aleph1.co.uk/cgi-bin/mailman/listinfo/yaffs