From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michele De Candia (VT) Date: Wed, 17 Jun 2009 09:43:50 +0200 Subject: [U-Boot] PATCH: bugfix for nand erase failure with bad blocks In-Reply-To: <4A3898B5.8060309@valueteam.com> References: <4A3798C4.8000303@valueteam.com> <20090616181035.52228832E416@gemini.denx.de> <4A37F7BF.2090101@valueteam.com> <20090616200940.DD093832E416@gemini.denx.de> <4A37FE47.3030203@freescale.com> <4A3898B5.8060309@valueteam.com> Message-ID: <4A389EB6.4060808@valueteam.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Michele De Candia (VT) wrote: > Scott Wood wrote: > >> Wolfgang Denk wrote: >> >>> Dear "Michele De Candia (VT)", >>> >>> In message <4A37F7BF.2090101@valueteam.com> you wrote: >>> >>>>>> this patch fixes a bug for 'nand erase' command: when bad blocks >>>>>> are present into erasing area, they were skipped but the erased >>>>>> size was updated anyway. >>>>>> >>>>> And what exactly is the bug in this behaviour? >>>>> >>>>> >>>> I think that 'erase' should have the same behaviour of 'write' and >>>> 'read' commands: skip bad blocks until read/write size is reached. >>>> If you write a script that erases and then writes a NAND area and >>>> bad blocks are not skipped while erasing (as U-Boot actually does), >>>> the following 'write' is successfully done but ECC checks fail on >>>> next read on the same area. >>>> >>> I see - thanks for the explanation. >>> >>> Hm... actually I think the write should fail in such a case... >>> >>> Scott, what do you think? >>> >> I think the current behavior is reasonable. You're erasing a specific >> region of flash, not an amount needed to hold a certain amount of data. >> >> > From this point of view you're in the right; maybe this would be > explained in 'README.nand' documentation or what do you think about add > ing an option to 'nand erase' command to consider 'size' field as the > effective blocks size to be erased and not as the area size? > Moreover, I think that if you want to erase a specific NAND area, the correct way to use 'nand erase' command would be: 'nand erase start end' If you want to erase an area but you want to be sure that 'size' bytes were erased, you should use: 'nand erase off size' In this case a bad block should be skipped and next block will be erased. Obviously this behavior must be implemented. What do you think about it? >> While I can see the appeal of Michele's suggestion, I think it would >> be more error-prone as people trying to erase a region rather than >> just the size of data could erase too much. >> >> It definitely should not be an error to erase a region that happens to >> contain a bad block. Bad blocks are expected and we need to work >> around them. >> >> -Scott >> > > >