Eugene, Thanks for the tip. It is a pity I have to verify content because our hardware cannot help me here, but it may be not a big deal since I have to do it only in case of an uncorrectable error. One question though - are you saying yaffs may decide to retire a block based on _corrected_ errors reported by mtd? I know nand layer (I am on 2.6.26.8) returns -EUCLEAN on corrected error, but I see that yaffs treats it as any other error. Our hardware has pretty strong ecc block - up to 6 bit errors per 512 byte chunk. I would hate to waste that capability. So where is the threshold where I need to report correctable errors? Maybe I should not do it at all? Regards, Max 949-483-9081 (office) 949-483-9414 (lab) -----Original Message----- From: Eugene Surovegin [mailto:ebs@ebshome.net] Sent: Thursday, July 01, 2010 7:57 AM To: Max Rayskiy Cc: 'yaffs@lists.aleph1.co.uk' Subject: Re: [Yaffs] Failure to write to an erased flash due to yaffs_CheckChunkErased failure On Wed, Jun 30, 2010 at 11:19:07AM -0700, Max Rayskiy wrote: > Hello, > > I am developing a NAND driver for an SOC and trying to use YAFFS2 with it. Our proprietary flash controller has hardware ECC support. One problem I cannot find a solution for is how to tell yaffs to ignore ECC errors when reading pages from erased blocks. > I am getting a request for full page read with tags, and obviously for > an erased block I have to return that there were uncorrectable ECC > errors. I would assume that yaffs should be able to tell erased block > from real ECC failure. But all I am getting is messages like I have written MTD driver for a similar controller, and I deal with this in the driver itself - on uncorrectable ECC error I verify contents of that page, and if it's all 0xff I don't report ECC errors to the upper levels. You also probably shouldn't report 1-bit correctable ECC errors if hw ECC is much stronger (say it can correct 3 bit erros per 512 byte chunk) - 1-bit errors are frequent enough so after several weeks or months, YAFFS will retire a lot of blocks without any good reason. -- Eugene Conexant E-mail Firewall (Conexant.Com) made the following annotations --------------------------------------------------------------------- ********************** Legal Disclaimer **************************** "This email may contain confidential and privileged material for the sole use of the intended recipient. Any unauthorized review, use or distribution by others is strictly prohibited. If you have received the message in error, please advise the sender by reply email and delete the message. Thank you." ********************************************************************** ---------------------------------------------------------------------