mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <a.fatoum@pengutronix.de>
To: barebox@lists.infradead.org
Cc: Ahmad Fatoum <a.fatoum@pengutronix.de>
Subject: [PATCH 3/7] of: overlay: rescan aliases calling of_overlay_apply_tree on live tree
Date: Thu, 25 Nov 2021 17:10:38 +0100	[thread overview]
Message-ID: <20211125161042.3829996-4-a.fatoum@pengutronix.de> (raw)
In-Reply-To: <20211125161042.3829996-1-a.fatoum@pengutronix.de>

Couple of drivers in-tree, like state, depend on aliases for correct
operation. If state node is added via overlay and oftree -p is called,
driver would start probing, but fail because aliases weren't reloaded.

Fix this corner case by always just calling of_alias_scan() on every
successful of_overlay_apply_tree to the live tree. No functional change
yet, as the only user of this function is overlay application code of
ARM QEMU machine, which happens at pure_initcall level, making
of_alias_scan a no-op. Follow-up commit will move overlay application to
happen after device tree is registered, necessitating this change.

Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
---
 drivers/of/overlay.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/drivers/of/overlay.c b/drivers/of/overlay.c
index e6f6634d6042..20a43f5170c8 100644
--- a/drivers/of/overlay.c
+++ b/drivers/of/overlay.c
@@ -199,6 +199,10 @@ int of_overlay_apply_tree(struct device_node *root,
 			pr_warn("failed to apply %s\n", fragment->name);
 	}
 
+	/* We are patching the live tree, reload aliases */
+	if (root == of_get_root_node())
+		of_alias_scan();
+
 out_err:
 	of_delete_node(resolved);
 
-- 
2.30.2


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


  parent reply	other threads:[~2021-11-25 16:12 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-25 16:10 [PATCH 0/7] ARM/RISC-V: qemu-virt: share common cleaned up state/env support Ahmad Fatoum
2021-11-25 16:10 ` [PATCH 1/7] state: mark state init errors specially Ahmad Fatoum
2021-11-25 16:10 ` [PATCH 2/7] state: make first boot less verbose Ahmad Fatoum
2021-11-30 10:47   ` Sascha Hauer
2021-11-30 13:52     ` Ahmad Fatoum
2021-11-25 16:10 ` Ahmad Fatoum [this message]
2021-11-25 16:10 ` [PATCH 4/7] ARM: qemu: enable deep probe support Ahmad Fatoum
2021-11-25 16:10 ` [PATCH 5/7] ARM: qemu: move board code to central location Ahmad Fatoum
2021-11-25 16:10 ` [PATCH 6/7] common: boards: qemu-virt: genericize to support non-ARM architectures Ahmad Fatoum
2021-11-25 16:10 ` [PATCH 7/7] RISC-V: qemu-virt: add overlay for environment and state Ahmad Fatoum
2021-12-07 14:04 ` [PATCH 0/7] ARM/RISC-V: qemu-virt: share common cleaned up state/env support Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211125161042.3829996-4-a.fatoum@pengutronix.de \
    --to=a.fatoum@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox