From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Date: Wed, 27 Feb 2013 15:48:58 -0600 Subject: [U-Boot] [PATCH 1/1] nand: adjust erase/read/write partition/chip size for bad blocks In-Reply-To: <3570adfb2947eff6fe6cdb8ee38754361cfdc4f0.1361937259.git.hchapman@3gfp.com> (from hchapman@3gfp.com on Tue Feb 26 21:57:14 2013) Message-ID: <1362001738.15577.16@snotra> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 02/26/2013 09:57:14 PM, Harvey Chapman wrote: > Adjust the sizes calculated for whole partition/chip operations by > removing the size of bad blocks so we don't try to erase/read/write > past a partition/chip boundary. > > Signed-off-by: Harvey Chapman > --- > common/cmd_nand.c | 35 +++++++++++++++++++++++++++++++++++ > 1 file changed, 35 insertions(+) I don't think we want to do this adjustment for erase -- the value you pass in there is already defined as being the range of blocks on the flash, rather than the amount of data you want to be able to store in the range (except for the ".spread" variant, but that can't be used with .part or .chip). This makes me wonder if a better approach would be a flag that tells the nand_read|write_skip_bad() function whether "size" is meant as "good data size" or "actual size"? Then we could just set that flag for whole-chip/whole-partition accesses, and let the existing bad block skipping code handle it with some minor tweaks. This would be similar to opts->spread for erase. -Scott