Skip to contentSkip to conversation

image-board: fix wrong implementation ram disk address setup from cmdline

PATCH Superseded Artem Lapkin 2 participants 4 messages Oct 16, 2021 – Nov 5, 2021 1 message not in the archive

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image-board: fix wrong implementation ram disk address setup from cmdline

Problem

Wrong implementation logic: ramdisk cmdline image address always ignored! Next block { rd_addr = hextoul(select, NULL) } unusable for raw initrd.

We have unbootable raw initrd images because, select_ramdisk for raw initrd images ignore submited select addr and setup rd_datap value to 0

Come-from: https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

---
 common/image-board.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
common/image-board.c +3 -3
index e7660352e9..e7063016ef 100644
@@ -333,7 +333,7 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
 
 	if (select) {
 		ulong default_addr;
-		bool done = true;
+		bool done = false;
 
 		if (CONFIG_IS_ENABLED(FIT)) {
 			/*
@@ -351,13 +351,13 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
 					   &fit_uname_config)) {
 				debug("*  ramdisk: config '%s' from image at 0x%08lx\n",
 				      fit_uname_config, rd_addr);
+				done = true;
 			} else if (fit_parse_subimage(select, default_addr,
 						      &rd_addr,
 						      &fit_uname_ramdisk)) {
 				debug("*  ramdisk: subimage '%s' from image at 0x%08lx\n",
 				      fit_uname_ramdisk, rd_addr);
-			} else {
-				done = false;
+				done = true;
 			}
 		}
 		if (!done) {
Signature · 1 line
2.25.1
Reviewed-by on v1 1/1
#1 lore raw

Hi Artem,

Quoted 9 lines · Artem Lapkin

Problem

Wrong implementation logic: ramdisk cmdline image address always ignored! Next block { rd_addr = hextoul(select, NULL) } unusable for raw initrd.

We have unbootable raw initrd images because, select_ramdisk for raw initrd images ignore submited select addr and setup rd_datap value to 0

Quoted 6 lines

Come-from: https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

---
 common/image-board.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Fixes f33a2c1bd0f ("image: Remove #ifdefs from select_ramdisk()")

(I believe, can you confirm?)

Quoted 33 lines
common/image-board.c +3 -4
index e7660352e9..e7063016ef 100644
@@ -333,7 +333,7 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
 
        if (select) {
                ulong default_addr;
-               bool done = true;
+               bool done = false;
 
                if (CONFIG_IS_ENABLED(FIT)) {
                        /*
@@ -351,13 +351,13 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
                                           &fit_uname_config)) {
                                debug("*  ramdisk: config '%s' from image at 0x%08lx\n",
                                      fit_uname_config, rd_addr);
+                               done = true;
                        } else if (fit_parse_subimage(select, default_addr,
                                                      &rd_addr,
                                                      &fit_uname_ramdisk)) {
                                debug("*  ramdisk: subimage '%s' from image at 0x%08lx\n",
                                      fit_uname_ramdisk, rd_addr);
-                       } else {
-                               done = false;
+                               done = true;
                        }
                }
                if (!done) {
--

2.25.1

A message that is not in the archive (sent off-list or not yet received): [email protected]

author
#3 lore raw

hi Simon

Quoted 2 lines
Fixes f33a2c1bd0f ("image: Remove #ifdefs from select_ramdisk()")

(I believe, can you confirm?)

confirm f33a2c1bd0f has wrong implementation logic for raw ramdisk image sure i have tested it ...

Quoted 60 lines · Simon Glass

Hi Artem,

Quoted 9 lines · Artem Lapkin

Problem

Wrong implementation logic: ramdisk cmdline image address always ignored! Next block { rd_addr = hextoul(select, NULL) } unusable for raw initrd.

We have unbootable raw initrd images because, select_ramdisk for raw initrd images ignore submited select addr and setup rd_datap value to 0

Quoted 6 lines

Come-from: https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

---
 common/image-board.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Fixes f33a2c1bd0f ("image: Remove #ifdefs from select_ramdisk()")

(I believe, can you confirm?)

Quoted 33 lines
common/image-board.c +3 -4
index e7660352e9..e7063016ef 100644
@@ -333,7 +333,7 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
 
        if (select) {
                ulong default_addr;
-               bool done = true;
+               bool done = false;
 
                if (CONFIG_IS_ENABLED(FIT)) {
                        /*
@@ -351,13 +351,13 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
                                           &fit_uname_config)) {
                                debug("*  ramdisk: config '%s' from image at 0x%08lx\n",
                                      fit_uname_config, rd_addr);
+                               done = true;
                        } else if (fit_parse_subimage(select, default_addr,
                                                      &rd_addr,
                                                      &fit_uname_ramdisk)) {
                                debug("*  ramdisk: subimage '%s' from image at 0x%08lx\n",
                                      fit_uname_ramdisk, rd_addr);
-                       } else {
-                               done = false;
+                               done = true;
                        }
                }
                if (!done) {
--

2.25.1

#4 lore raw

Hi Art,

Quoted 8 lines · Art Nikpal

hi Simon

Quoted 2 lines
Fixes f33a2c1bd0f ("image: Remove #ifdefs from select_ramdisk()")

(I believe, can you confirm?)

confirm f33a2c1bd0f has wrong implementation logic for raw ramdisk image sure i have tested it ...

Thanks!

BTW please can you try not to top-post?

Regards,
Simon

Quoted 62 lines · Simon Glass
Quoted 60 lines

Hi Artem,

Quoted 9 lines · Artem Lapkin

Problem

Wrong implementation logic: ramdisk cmdline image address always ignored! Next block { rd_addr = hextoul(select, NULL) } unusable for raw initrd.

We have unbootable raw initrd images because, select_ramdisk for raw initrd images ignore submited select addr and setup rd_datap value to 0

Quoted 6 lines

Come-from: https://patchwork.ozlabs.org/project/uboot/patch/[email protected]/

---
 common/image-board.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
Fixes f33a2c1bd0f ("image: Remove #ifdefs from select_ramdisk()")

(I believe, can you confirm?)

Quoted 33 lines
common/image-board.c +3 -4
index e7660352e9..e7063016ef 100644
@@ -333,7 +333,7 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
 
        if (select) {
                ulong default_addr;
-               bool done = true;
+               bool done = false;
 
                if (CONFIG_IS_ENABLED(FIT)) {
                        /*
@@ -351,13 +351,13 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
                                           &fit_uname_config)) {
                                debug("*  ramdisk: config '%s' from image at 0x%08lx\n",
                                      fit_uname_config, rd_addr);
+                               done = true;
                        } else if (fit_parse_subimage(select, default_addr,
                                                      &rd_addr,
                                                      &fit_uname_ramdisk)) {
                                debug("*  ramdisk: subimage '%s' from image at 0x%08lx\n",
                                      fit_uname_ramdisk, rd_addr);
-                       } else {
-                               done = false;
+                               done = true;
                        }
                }
                if (!done) {
--

2.25.1