diff mbox

[U-Boot] env_nand: Use nand_read_skip_bad instead of nand_read

Message ID 1291418743.23352.12.camel@quadra
State Accepted
Headers show

Commit Message

Steve Sakoman Dec. 3, 2010, 11:25 p.m. UTC
The nand-read function returns an error code if correctable errors have occurred.
This is not desirable, since the errors have been corrected!

This patch switches to the nand_read_skip_bad function which does not
return an error code if the errors are correctable.

Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org>
---

Comments

Sandeep Paulraj Dec. 5, 2010, 9:22 p.m. UTC | #1
> The nand-read function returns an error code if correctable errors have
> occurred.
> This is not desirable, since the errors have been corrected!
> 
> This patch switches to the nand_read_skip_bad function which does not
> return an error code if the errors are correctable.
> 
> Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org>
> ---
> 
> diff --git a/common/env_nand.c b/common/env_nand.c
> index 4e8307a..7f6c917 100644
> --- a/common/env_nand.c
> +++ b/common/env_nand.c
> @@ -297,7 +297,7 @@ int readenv(size_t offset, u_char * buf)
>  			offset += blocksize;
>  		} else {
>  			char_ptr = &buf[amount_loaded];
> -			if (nand_read(&nand_info[0], offset, &len, char_ptr))
> +			if (nand_read_skip_bad(&nand_info[0], offset, &len,
> char_ptr))
>  				return 1;
>  			offset += blocksize;
>  			amount_loaded += len;
> 

Scott,

Can I add this to u-boot-ti?

Regards,
Sandeep
Scott Wood Dec. 6, 2010, 5:13 p.m. UTC | #2
On Sun, 5 Dec 2010 15:22:25 -0600
"Paulraj, Sandeep" <s-paulraj@ti.com> wrote:

> 
> 
> > The nand-read function returns an error code if correctable errors have
> > occurred.
> > This is not desirable, since the errors have been corrected!
> > 
> > This patch switches to the nand_read_skip_bad function which does not
> > return an error code if the errors are correctable.
> > 
> > Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org>
> > ---
> > 
> > diff --git a/common/env_nand.c b/common/env_nand.c
> > index 4e8307a..7f6c917 100644
> > --- a/common/env_nand.c
> > +++ b/common/env_nand.c
> > @@ -297,7 +297,7 @@ int readenv(size_t offset, u_char * buf)
> >  			offset += blocksize;
> >  		} else {
> >  			char_ptr = &buf[amount_loaded];
> > -			if (nand_read(&nand_info[0], offset, &len, char_ptr))
> > +			if (nand_read_skip_bad(&nand_info[0], offset, &len,
> > char_ptr))
> >  				return 1;
> >  			offset += blocksize;
> >  			amount_loaded += len;
> > 
> 
> Scott,
> 
> Can I add this to u-boot-ti?

Acked-by: Scott Wood <scottwood@freescale.com>

Sorry about the delay, I'll try to get to the NAND patches soon.  I've
been busy with other things.

-Scott
Scott Wood Dec. 7, 2010, 12:30 a.m. UTC | #3
On Mon, 6 Dec 2010 11:13:22 -0600
Scott Wood <scottwood@freescale.com> wrote:

> On Sun, 5 Dec 2010 15:22:25 -0600
> "Paulraj, Sandeep" <s-paulraj@ti.com> wrote:
> 
> > 
> > 
> > > The nand-read function returns an error code if correctable errors have
> > > occurred.
> > > This is not desirable, since the errors have been corrected!
> > > 
> > > This patch switches to the nand_read_skip_bad function which does not
> > > return an error code if the errors are correctable.
> > > 
> > > Signed-off-by: Steve Sakoman <steve.sakoman@linaro.org>
> > > ---
> > > 
> > > diff --git a/common/env_nand.c b/common/env_nand.c
> > > index 4e8307a..7f6c917 100644
> > > --- a/common/env_nand.c
> > > +++ b/common/env_nand.c
> > > @@ -297,7 +297,7 @@ int readenv(size_t offset, u_char * buf)
> > >  			offset += blocksize;
> > >  		} else {
> > >  			char_ptr = &buf[amount_loaded];
> > > -			if (nand_read(&nand_info[0], offset, &len, char_ptr))
> > > +			if (nand_read_skip_bad(&nand_info[0], offset, &len,
> > > char_ptr))
> > >  				return 1;
> > >  			offset += blocksize;
> > >  			amount_loaded += len;
> > > 
> > 
> > Scott,
> > 
> > Can I add this to u-boot-ti?
> 
> Acked-by: Scott Wood <scottwood@freescale.com>
> 
> Sorry about the delay, I'll try to get to the NAND patches soon.  I've
> been busy with other things.

Applied to u-boot-nand-flash.

-Scott
diff mbox

Patch

diff --git a/common/env_nand.c b/common/env_nand.c
index 4e8307a..7f6c917 100644
--- a/common/env_nand.c
+++ b/common/env_nand.c
@@ -297,7 +297,7 @@  int readenv(size_t offset, u_char * buf)
 			offset += blocksize;
 		} else {
 			char_ptr = &buf[amount_loaded];
-			if (nand_read(&nand_info[0], offset, &len, char_ptr))
+			if (nand_read_skip_bad(&nand_info[0], offset, &len, char_ptr))
 				return 1;
 			offset += blocksize;
 			amount_loaded += len;