* [U-Boot] [PATCH] nand read.jffs2 (nand_legacy) in common/cmd_nand.c
@ 2009-01-20 15:57 Schlaegl Manfred jun.
2009-01-20 18:09 ` Scott Wood
0 siblings, 1 reply; 5+ messages in thread
From: Schlaegl Manfred jun. @ 2009-01-20 15:57 UTC (permalink / raw)
To: u-boot
Hi!
Error with CONFIG_NAND_LEGACY in common/cmd_nand.c:
With current code "nand read.jffs2s" (read and skip bad blocks) is always interpreted as
"nand read.jffs2" (read and fill bad blocks with 0xff). This is because ".jffs2" is
tested before ".jffs2s" and only the first two characters are compared.
Correction:
Test for ".jffs2s" first and compare the first 7 characters.
diff --git a/common/cmd_nand.c b/common/cmd_nand.c
index 0a366d3..ba1b27f 100644
--- a/common/cmd_nand.c
+++ b/common/cmd_nand.c
@@ -854,13 +854,12 @@ int do_nand (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
(u_char *) addr);
}
return ret;
- } else if (cmdtail && !strncmp (cmdtail, ".jffs2", 2))
- cmd |= NANDRW_JFFS2; /* skip bad blocks */
- else if (cmdtail && !strncmp (cmdtail, ".jffs2s", 2)) {
+ } else if (cmdtail && !strncmp (cmdtail, ".jffs2s", 7)) {
cmd |= NANDRW_JFFS2; /* skip bad blocks (on read too) */
if (cmd & NANDRW_READ)
cmd |= NANDRW_JFFS2_SKIP; /* skip bad blocks (on read too) */
- }
+ } else if (cmdtail && !strncmp (cmdtail, ".jffs2", 2))
+ cmd |= NANDRW_JFFS2; /* skip bad blocks */
#ifdef SXNI855T
/* need ".e" same as ".j" for compatibility with older units */
else if (cmdtail && !strcmp (cmdtail, ".e"))
Signed-off-by: Manfred Schlaegl jun. <manfred.schlaegl@gmx.at>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] nand read.jffs2 (nand_legacy) in common/cmd_nand.c
2009-01-20 15:57 [U-Boot] [PATCH] nand read.jffs2 (nand_legacy) in common/cmd_nand.c Schlaegl Manfred jun.
@ 2009-01-20 18:09 ` Scott Wood
2009-01-20 18:14 ` Scott Wood
2009-01-20 18:32 ` Stefan Roese
0 siblings, 2 replies; 5+ messages in thread
From: Scott Wood @ 2009-01-20 18:09 UTC (permalink / raw)
To: u-boot
On Tue, Jan 20, 2009 at 04:57:55PM +0100, Schlaegl Manfred jun. wrote:
> Error with CONFIG_NAND_LEGACY in common/cmd_nand.c:
> With current code "nand read.jffs2s" (read and skip bad blocks) is always interpreted as
> "nand read.jffs2" (read and fill bad blocks with 0xff). This is because ".jffs2" is
> tested before ".jffs2s" and only the first two characters are compared.
>
> Correction:
> Test for ".jffs2s" first and compare the first 7 characters.
I'll apply this, though I recommend switching to the non-legacy code
(which always block-skips, BTW). I'd like to see the legacy code go away
soon.
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] nand read.jffs2 (nand_legacy) in common/cmd_nand.c
2009-01-20 18:09 ` Scott Wood
@ 2009-01-20 18:14 ` Scott Wood
2009-01-20 18:32 ` Stefan Roese
1 sibling, 0 replies; 5+ messages in thread
From: Scott Wood @ 2009-01-20 18:14 UTC (permalink / raw)
To: u-boot
Scott Wood wrote:
> On Tue, Jan 20, 2009 at 04:57:55PM +0100, Schlaegl Manfred jun. wrote:
>> Error with CONFIG_NAND_LEGACY in common/cmd_nand.c:
>> With current code "nand read.jffs2s" (read and skip bad blocks) is always interpreted as
>> "nand read.jffs2" (read and fill bad blocks with 0xff). This is because ".jffs2" is
>> tested before ".jffs2s" and only the first two characters are compared.
>>
>> Correction:
>> Test for ".jffs2s" first and compare the first 7 characters.
>
> I'll apply this, though I recommend switching to the non-legacy code
> (which always block-skips, BTW). I'd like to see the legacy code go away
> soon.
And in the future, please add a Signed-off-by line.
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] [PATCH] nand read.jffs2 (nand_legacy) in common/cmd_nand.c
2009-01-20 18:09 ` Scott Wood
2009-01-20 18:14 ` Scott Wood
@ 2009-01-20 18:32 ` Stefan Roese
2009-01-20 19:35 ` [U-Boot] Legacy NAND support to be removed after April 2009; please update your boards Scott Wood
1 sibling, 1 reply; 5+ messages in thread
From: Stefan Roese @ 2009-01-20 18:32 UTC (permalink / raw)
To: u-boot
On Tuesday 20 January 2009, Scott Wood wrote:
> On Tue, Jan 20, 2009 at 04:57:55PM +0100, Schlaegl Manfred jun. wrote:
> > Error with CONFIG_NAND_LEGACY in common/cmd_nand.c:
> > With current code "nand read.jffs2s" (read and skip bad blocks) is always
> > interpreted as "nand read.jffs2" (read and fill bad blocks with 0xff).
> > This is because ".jffs2" is tested before ".jffs2s" and only the first
> > two characters are compared.
> >
> > Correction:
> > Test for ".jffs2s" first and compare the first 7 characters.
>
> I'll apply this, though I recommend switching to the non-legacy code
> (which always block-skips, BTW). I'd like to see the legacy code go away
> soon.
Yes. How about setting a date for this removal? I suggest to remove it after
the next two releases (after v2009-03/04).
Best regards,
Stefan
=====================================================================
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-0 Fax: +49-8142-66989-80 Email: office at denx.de
=====================================================================
^ permalink raw reply [flat|nested] 5+ messages in thread
* [U-Boot] Legacy NAND support to be removed after April 2009; please update your boards.
2009-01-20 18:32 ` Stefan Roese
@ 2009-01-20 19:35 ` Scott Wood
0 siblings, 0 replies; 5+ messages in thread
From: Scott Wood @ 2009-01-20 19:35 UTC (permalink / raw)
To: u-boot
Stefan Roese wrote:
> On Tuesday 20 January 2009, Scott Wood wrote:
> > I'll apply this, though I recommend switching to the non-legacy code
> > (which always block-skips, BTW). I'd like to see the legacy code go away
> > soon.
>
> Yes. How about setting a date for this removal? I suggest to remove it after
> the next two releases (after v2009-03/04).
OK, feature removal schedule updated.
To anyone with an interest in a board that still uses legacy NAND,
please try to get it converted over the next two merge windows.
-Scott
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2009-01-20 19:35 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-20 15:57 [U-Boot] [PATCH] nand read.jffs2 (nand_legacy) in common/cmd_nand.c Schlaegl Manfred jun.
2009-01-20 18:09 ` Scott Wood
2009-01-20 18:14 ` Scott Wood
2009-01-20 18:32 ` Stefan Roese
2009-01-20 19:35 ` [U-Boot] Legacy NAND support to be removed after April 2009; please update your boards Scott Wood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox