* [PATCH] ARM: i.MX50: Amazon Kindle: fix setup of board specific environment
@ 2018-03-18 21:10 Alexander Kurz
2018-03-19 8:28 ` Sascha Hauer
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Kurz @ 2018-03-18 21:10 UTC (permalink / raw)
To: barebox, Sascha Hauer; +Cc: Alexander Kurz
With patch 5b92cfceff38 ("startup: Load default environment earlier")
loading of the default environment moved from environment_initcall
four initcalls up to fs_initcall. At this time, most of the board specific
environment patches inserted via defaultenv_append_directory() have not
been processed yet (mostly done in device_initcall) and will not appear
in the environment.
Fix this problem for the mx50 kindles by moving defaultenv_append_directory()
one initcall in front of fs_initcall.
Similar patches may be necessary for all other board implementations and the
efi implementation using defaultenv_append_directory() in device_initcall.
Signed-off-by: Alexander Kurz <akurz@blala.de>
---
arch/arm/boards/kindle-mx50/board.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/arm/boards/kindle-mx50/board.c b/arch/arm/boards/kindle-mx50/board.c
index 089dd8ebb..86cf54a46 100644
--- a/arch/arm/boards/kindle-mx50/board.c
+++ b/arch/arm/boards/kindle-mx50/board.c
@@ -127,6 +127,13 @@ static int is_mx50_kindle(void)
of_machine_is_compatible("amazon,kindle-ey21");
}
+static int kindle_mx50_coredev_init(void)
+{
+ defaultenv_append_directory(defaultenv_kindle_mx50);
+ return 0;
+}
+coredevice_initcall(kindle_mx50_coredev_init);
+
static int kindle_mx50_late_init(void)
{
if (!is_mx50_kindle())
@@ -164,8 +171,6 @@ static int kindle_mx50_devices_init(void)
if (dev)
dev_set_param(dev, "probe", "1");
- defaultenv_append_directory(defaultenv_kindle_mx50);
-
return 0;
}
device_initcall(kindle_mx50_devices_init);
--
2.11.0
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] ARM: i.MX50: Amazon Kindle: fix setup of board specific environment
2018-03-18 21:10 [PATCH] ARM: i.MX50: Amazon Kindle: fix setup of board specific environment Alexander Kurz
@ 2018-03-19 8:28 ` Sascha Hauer
0 siblings, 0 replies; 2+ messages in thread
From: Sascha Hauer @ 2018-03-19 8:28 UTC (permalink / raw)
To: Alexander Kurz; +Cc: barebox
Hi Alexander,
On Sun, Mar 18, 2018 at 09:10:46PM +0000, Alexander Kurz wrote:
> With patch 5b92cfceff38 ("startup: Load default environment earlier")
> loading of the default environment moved from environment_initcall
> four initcalls up to fs_initcall. At this time, most of the board specific
> environment patches inserted via defaultenv_append_directory() have not
> been processed yet (mostly done in device_initcall) and will not appear
> in the environment.
> Fix this problem for the mx50 kindles by moving defaultenv_append_directory()
> one initcall in front of fs_initcall.
> Similar patches may be necessary for all other board implementations and the
> efi implementation using defaultenv_append_directory() in device_initcall.
You are right. Most boards do not cope with this change. Let's just
revert the original patch instead of reworking all boards.
It should be also possible to call defaultenv_load_one() instead of
putting it to the defaultenv_list list when we have already loaded the
environment, but for now I prefer the easy way out without possible
regressions.
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] 2+ messages in thread
end of thread, other threads:[~2018-03-19 8:29 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-18 21:10 [PATCH] ARM: i.MX50: Amazon Kindle: fix setup of board specific environment Alexander Kurz
2018-03-19 8:28 ` Sascha Hauer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox