From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Tue, 1 Dec 2009 17:55:10 -0600 Subject: [U-Boot] [PATCH] Fix computation in nand_util.c:get_len_incl_bad In-Reply-To: <1259672755-929-1-git-send-email-daniel.hobi@schmid-telecom.ch> References: <1259672755-929-1-git-send-email-daniel.hobi@schmid-telecom.ch> Message-ID: <20091201235510.GA19547@loki.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Dec 01, 2009 at 02:05:55PM +0100, Daniel Hobi wrote: > Depending on offset, flash size and the number of bad blocks, > get_len_incl_bad may return a too small value which may lead to: > > 1) If there are no bad blocks, nand_{read,write}_skip_bad chooses the > bad block aware read/write code. This may hurt performance, but does > not have any adverse effects. > > 2) If there are bad blocks, the nand_{read,write}_skip_bad may choose > the bad block unaware read/write code (if len_incl_bad == *length) > which leads to corrupted data. It could also lead to the rejection of accesses near the end of flash. > Signed-off-by: Daniel Hobi > --- > @Scott: please review > @Wolfgang: please consider for 2009.11 Applied to next. I think it's too late for 2009.12, since it's supposed to be released tomorrow according to http://www.denx.de/wiki/U-Boot/ReleaseCycle, and it's not a regression from the previous version. -Scott