* [U-Boot] [PATCH] nand: Don't call adjust_size_for_badblocks for erase
@ 2013-06-20 17:52 Scott Wood
2013-06-21 4:19 ` Heiko Schocher
0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2013-06-20 17:52 UTC (permalink / raw)
To: u-boot
adjust_size_for_badblocks reduces the the operation size to account
for the block skipping done by the read/write functions when an
interval (partition name or whole chip) is specified rather than a data
amount.
Erase does not do block skipping, except for erase.spread which takes
a data amount rather than an interval (and thus already does not call
adjust_size_for_badblocks). Calling adjust_size_for_badblocks when
block skipping is not done means that if bad blocks are present,
the "nand erase.part" and "nand erase.chip" commands will fail to erase
blocks at the end of the interval.
Signed-off-by: Scott Wood <scottwood@freescale.com>
Cc: Harvey Chapman <hchapman@3gfp.com>
---
common/cmd_nand.c | 9 +--------
1 file changed, 1 insertion(+), 8 deletions(-)
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 8b1e01a..886212a 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -426,7 +426,7 @@ static int raw_access(nand_info_t *nand, ulong addr, loff_t off, ulong count,
}
/* Adjust a chip/partition size down for bad blocks so we don't
- * read/write/erase past the end of a chip/partition by accident.
+ * read/write past the end of a chip/partition by accident.
*/
static void adjust_size_for_badblocks(loff_t *size, loff_t offset, int dev)
{
@@ -546,7 +546,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
int scrub = !strncmp(cmd, "scrub", 5);
int spread = 0;
int args = 2;
- int adjust_size = 0;
const char *scrub_warn =
"Warning: "
"scrub option will erase all factory set bad blocks!\n"
@@ -563,10 +562,8 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
spread = 1;
} else if (!strcmp(&cmd[5], ".part")) {
args = 1;
- adjust_size = 1;
} else if (!strcmp(&cmd[5], ".chip")) {
args = 0;
- adjust_size = 1;
} else {
goto usage;
}
@@ -586,10 +583,6 @@ static int do_nand(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
&maxsize) != 0)
return 1;
- /* size is unspecified */
- if (adjust_size && !scrub)
- adjust_size_for_badblocks(&size, off, dev);
-
nand = &nand_info[dev];
memset(&opts, 0, sizeof(opts));
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] nand: Don't call adjust_size_for_badblocks for erase
2013-06-20 17:52 [U-Boot] [PATCH] nand: Don't call adjust_size_for_badblocks for erase Scott Wood
@ 2013-06-21 4:19 ` Heiko Schocher
2013-06-21 16:48 ` Scott Wood
0 siblings, 1 reply; 3+ messages in thread
From: Heiko Schocher @ 2013-06-21 4:19 UTC (permalink / raw)
To: u-boot
Hello Scott,
Am 20.06.2013 19:52, schrieb Scott Wood:
> adjust_size_for_badblocks reduces the the operation size to account
nitpicking:
please only one "the".
> for the block skipping done by the read/write functions when an
> interval (partition name or whole chip) is specified rather than a data
> amount.
>
> Erase does not do block skipping, except for erase.spread which takes
> a data amount rather than an interval (and thus already does not call
> adjust_size_for_badblocks). Calling adjust_size_for_badblocks when
> block skipping is not done means that if bad blocks are present,
> the "nand erase.part" and "nand erase.chip" commands will fail to erase
> blocks at the end of the interval.
>
> Signed-off-by: Scott Wood <scottwood@freescale.com>
> Cc: Harvey Chapman <hchapman@3gfp.com>
> ---
> common/cmd_nand.c | 9 +--------
> 1 file changed, 1 insertion(+), 8 deletions(-)
Acked-by: Heiko Schocher <hs@denx.de>
bye,
Heiko
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
^ permalink raw reply [flat|nested] 3+ messages in thread
* [U-Boot] [PATCH] nand: Don't call adjust_size_for_badblocks for erase
2013-06-21 4:19 ` Heiko Schocher
@ 2013-06-21 16:48 ` Scott Wood
0 siblings, 0 replies; 3+ messages in thread
From: Scott Wood @ 2013-06-21 16:48 UTC (permalink / raw)
To: u-boot
On 06/20/2013 11:19:19 PM, Heiko Schocher wrote:
> Hello Scott,
>
> Am 20.06.2013 19:52, schrieb Scott Wood:
> > adjust_size_for_badblocks reduces the the operation size to account
>
> nitpicking:
> please only one "the".
Thanks, I'll fix when applying.
-Scott
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2013-06-21 16:48 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-06-20 17:52 [U-Boot] [PATCH] nand: Don't call adjust_size_for_badblocks for erase Scott Wood
2013-06-21 4:19 ` Heiko Schocher
2013-06-21 16:48 ` Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox