Skip to contentSkip to conversation

env_nand: Use nand_read_skip_bad instead of nand_read

PATCH New Steve Sakoman 3 participants 4 messages Dec 3, 2010 – Dec 7, 2010

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 env_nand: Use nand_read_skip_bad instead of nand_read

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.

---

common/env_nand.c +1 -1
index 4e8307a..7f6c917 100644
@@ -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;
#1 lore raw

PATCH 1/1 env_nand: Use nand_read_skip_bad instead of nand_read

Quoted 25 lines

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.

---

common/env_nand.c +1 -1
index 4e8307a..7f6c917 100644
@@ -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;
Quoted 2 lines

amount_loaded += len;

Scott,

Can I add this to u-boot-ti?

Regards,
Sandeep

#2 lore raw

PATCH 1/1 env_nand: Use nand_read_skip_bad instead of nand_read

Quoted 30 lines · Sandeep
Quoted 25 lines

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.

---

common/env_nand.c +1 -1
index 4e8307a..7f6c917 100644
@@ -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;
Quoted 2 lines

amount_loaded += len;

Scott,

Quoted 1 line

Can I add this to u-boot-ti?

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

-Scott

#3 lore raw

PATCH 1/1 env_nand: Use nand_read_skip_bad instead of nand_read

Quoted 33 lines · On Mon, 6 Dec 2010 11:13:22 -0600 Scott Wood <[email protected]> wrote:
Quoted 30 lines · Sandeep
Quoted 25 lines

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.

---

common/env_nand.c +1 -1
index 4e8307a..7f6c917 100644
@@ -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;
Quoted 2 lines

amount_loaded += len;

Scott,

Quoted 6 lines
Quoted 1 line

Can I add this to u-boot-ti?

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