mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] of: base: add chosen node if it does not exist when adding initrd
@ 2016-12-08 10:15 Philipp Zabel
  2016-12-12  5:47 ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Philipp Zabel @ 2016-12-08 10:15 UTC (permalink / raw)
  To: barebox

If the chosen node does not exist, of_add_initrd fails to pass the
initrd to the kernel. Instead it should create the chosen node, just
like of_fixup_bootargs does.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/of/base.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/of/base.c b/drivers/of/base.c
index 767d4e1..0c20fcd 100644
--- a/drivers/of/base.c
+++ b/drivers/of/base.c
@@ -2019,9 +2019,9 @@ int of_add_initrd(struct device_node *root, resource_size_t start,
 	struct device_node *chosen;
 	__be32 buf[2];
 
-	chosen = of_find_node_by_path_from(root, "/chosen");
+	chosen = of_create_node(root, "/chosen");
 	if (!chosen)
-		return -EINVAL;
+		return -ENOMEM;
 
 	if (end) {
 		of_write_number(buf, start, 2);
-- 
2.10.2


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] of: base: add chosen node if it does not exist when adding initrd
  2016-12-08 10:15 [PATCH] of: base: add chosen node if it does not exist when adding initrd Philipp Zabel
@ 2016-12-12  5:47 ` Sascha Hauer
  2016-12-12  9:20   ` Jan Lübbe
  0 siblings, 1 reply; 4+ messages in thread
From: Sascha Hauer @ 2016-12-12  5:47 UTC (permalink / raw)
  To: Philipp Zabel; +Cc: barebox

On Thu, Dec 08, 2016 at 11:15:51AM +0100, Philipp Zabel wrote:
> If the chosen node does not exist, of_add_initrd fails to pass the
> initrd to the kernel. Instead it should create the chosen node, just
> like of_fixup_bootargs does.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> ---
>  drivers/of/base.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied, thanks

Sascha

> 
> diff --git a/drivers/of/base.c b/drivers/of/base.c
> index 767d4e1..0c20fcd 100644
> --- a/drivers/of/base.c
> +++ b/drivers/of/base.c
> @@ -2019,9 +2019,9 @@ int of_add_initrd(struct device_node *root, resource_size_t start,
>  	struct device_node *chosen;
>  	__be32 buf[2];
>  
> -	chosen = of_find_node_by_path_from(root, "/chosen");
> +	chosen = of_create_node(root, "/chosen");
>  	if (!chosen)
> -		return -EINVAL;
> +		return -ENOMEM;
>  
>  	if (end) {
>  		of_write_number(buf, start, 2);
> -- 
> 2.10.2
> 
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] of: base: add chosen node if it does not exist when adding initrd
  2016-12-12  5:47 ` Sascha Hauer
@ 2016-12-12  9:20   ` Jan Lübbe
  2017-01-09  6:42     ` Sascha Hauer
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Lübbe @ 2016-12-12  9:20 UTC (permalink / raw)
  To: Sascha Hauer; +Cc: barebox

On Mo, 2016-12-12 at 06:47 +0100, Sascha Hauer wrote:
> On Thu, Dec 08, 2016 at 11:15:51AM +0100, Philipp Zabel wrote:
> > If the chosen node does not exist, of_add_initrd fails to pass the
> > initrd to the kernel. Instead it should create the chosen node, just
> > like of_fixup_bootargs does.
> > 
> > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > ---
> >  drivers/of/base.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> Applied, thanks

This is actually a fix for booting linux-next with initramfs on barebox
and is the cause of some boot failures in our kernel-ci lab:
https://storage.kernelci.org/next/next-20161206/arm-imx_v6_v7_defconfig/lab-pengutronix/boot-imx6dl-riotboard.html

Maybe this should be merged to master instead of next?

Regards,
Jan
-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |


_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] of: base: add chosen node if it does not exist when adding initrd
  2016-12-12  9:20   ` Jan Lübbe
@ 2017-01-09  6:42     ` Sascha Hauer
  0 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2017-01-09  6:42 UTC (permalink / raw)
  To: Jan Lübbe; +Cc: barebox

On Mon, Dec 12, 2016 at 10:20:12AM +0100, Jan Lübbe wrote:
> On Mo, 2016-12-12 at 06:47 +0100, Sascha Hauer wrote:
> > On Thu, Dec 08, 2016 at 11:15:51AM +0100, Philipp Zabel wrote:
> > > If the chosen node does not exist, of_add_initrd fails to pass the
> > > initrd to the kernel. Instead it should create the chosen node, just
> > > like of_fixup_bootargs does.
> > > 
> > > Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
> > > ---
> > >  drivers/of/base.c | 4 ++--
> > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > Applied, thanks
> 
> This is actually a fix for booting linux-next with initramfs on barebox
> and is the cause of some boot failures in our kernel-ci lab:
> https://storage.kernelci.org/next/next-20161206/arm-imx_v6_v7_defconfig/lab-pengutronix/boot-imx6dl-riotboard.html
> 
> Maybe this should be merged to master instead of next?

Ok, did that.

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-01-09  6:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-08 10:15 [PATCH] of: base: add chosen node if it does not exist when adding initrd Philipp Zabel
2016-12-12  5:47 ` Sascha Hauer
2016-12-12  9:20   ` Jan Lübbe
2017-01-09  6:42     ` Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox