diff mbox series

image: fix select_ramdisk for raw initrd

Message ID 20211015101501.4091141-1-art@khadas.com
State Superseded
Delegated to: Tom Rini
Headers show
Series image: fix select_ramdisk for raw initrd | expand

Commit Message

Art Nikpal Oct. 15, 2021, 10:15 a.m. UTC
Problem

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

Solution: setup rd_datap value from select

Signed-off-by: Artem Lapkin <art@khadas.com>
---
 common/image-board.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Simon Glass Oct. 31, 2021, 11:47 p.m. UTC | #1
Hi Artem,

On Fri, 15 Oct 2021 at 04:15, Artem Lapkin <email2tema@gmail.com> wrote:
>
> Problem
>
> We have unbootable raw initrd images because, select_ramdisk for raw
> initrd images ignore submited select addr and setup rd_datap value to 0
>
> Solution: setup rd_datap value from select
>
> Signed-off-by: Artem Lapkin <art@khadas.com>
> ---
>  common/image-board.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Do we need this patch as well as the other one? If so, can you combine them?

Also, is it possible to drop the assignment to rd_addr at the top of
the function?

>
> diff --git a/common/image-board.c b/common/image-board.c
> index e7660352e9..e3c6ea806a 100644
> --- a/common/image-board.c
> +++ b/common/image-board.c
> @@ -439,7 +439,7 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
>                                 end = strchr(select, ':');
>                         if (end) {
>                                 *rd_lenp = hextoul(++end, NULL);
> -                               *rd_datap = rd_addr;
> +                               *rd_datap = hextoul(select, NULL);
>                                 processed = true;
>                         }
>                 }
> --
> 2.25.1
>

Regards,
Simon
Art Nikpal Nov. 1, 2021, 7 a.m. UTC | #2
Hi Simon, Tom , and ...

> Do we need this patch as well as the other one? If so, can you combine them?
> Also, is it possible to drop the assignment to rd_addr at the top of
the function?

this patch must be replaced by another one
https://patchwork.ozlabs.org/project/uboot/patch/20211016051915.4157293-1-art@khadas.com/
( last patch will be enough alone)

On Mon, Nov 1, 2021 at 7:47 AM Simon Glass <sjg@chromium.org> wrote:
>
> Hi Artem,
>
> On Fri, 15 Oct 2021 at 04:15, Artem Lapkin <email2tema@gmail.com> wrote:
> >
> > Problem
> >
> > We have unbootable raw initrd images because, select_ramdisk for raw
> > initrd images ignore submited select addr and setup rd_datap value to 0
> >
> > Solution: setup rd_datap value from select
> >
> > Signed-off-by: Artem Lapkin <art@khadas.com>
> > ---
> >  common/image-board.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
>
> Do we need this patch as well as the other one? If so, can you combine them?
>
> Also, is it possible to drop the assignment to rd_addr at the top of
> the function?
>
> >
> > diff --git a/common/image-board.c b/common/image-board.c
> > index e7660352e9..e3c6ea806a 100644
> > --- a/common/image-board.c
> > +++ b/common/image-board.c
> > @@ -439,7 +439,7 @@ static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
> >                                 end = strchr(select, ':');
> >                         if (end) {
> >                                 *rd_lenp = hextoul(++end, NULL);
> > -                               *rd_datap = rd_addr;
> > +                               *rd_datap = hextoul(select, NULL);
> >                                 processed = true;
> >                         }
> >                 }
> > --
> > 2.25.1
> >
>
> Regards,
> Simon
diff mbox series

Patch

diff --git a/common/image-board.c b/common/image-board.c
index e7660352e9..e3c6ea806a 100644
--- a/common/image-board.c
+++ b/common/image-board.c
@@ -439,7 +439,7 @@  static int select_ramdisk(bootm_headers_t *images, const char *select, u8 arch,
 				end = strchr(select, ':');
 			if (end) {
 				*rd_lenp = hextoul(++end, NULL);
-				*rd_datap = rd_addr;
+				*rd_datap = hextoul(select, NULL);
 				processed = true;
 			}
 		}