linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] soc: renesas: rcar-sysc: Mark device node OF_POPULATED after init
@ 2021-01-28  8:28 Geert Uytterhoeven
  0 siblings, 0 replies; only message in thread
From: Geert Uytterhoeven @ 2021-01-28  8:28 UTC (permalink / raw)
  To: Magnus Damm
  Cc: Rob Herring, Saravana Kannan, Yoshihiro Shimoda,
	Greg Kroah-Hartman, Rafael J . Wysocki, Marc Zyngier,
	Kevin Hilman, Marek Szyprowski, linux-renesas-soc,
	linux-arm-kernel, devicetree, linux-pm, linux-kernel,
	Geert Uytterhoeven

The R-Car System Controller (SYSC) driver registers PM domains from an
early_initcall().  It does not use a platform driver, as secondary CPU
startup on R-Car H1 needs to control the CPU power domains, before
initialization of the driver framework.

As fw_devlink only considers devices, it does not know that the System
Controller is ready.  Hence probing of on-chip devices that are part of
the SYSC PM domain fails if fw_devlink is enabled:

    probe deferral - supplier e6180000.system-controller not ready

Fix this by setting the OF_POPULATED flag for the SYSC device node after
successful initialization.  This will make of_link_to_phandle() ignore
the SYSC device node as a dependency, and consumer devices will be
probed again.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Saravana Kannan <saravanak@google.com>
---
As this seems to be harmless if commit e590474768f1cc04 ("driver core:
Set fw_devlink=on by default") won't make v5.12, I plan to queue this in
renesas-devel for v5.12.

v2:
  - Add Reviewed-by,
  - s/platform devices/devices/,
  - Drop Fixes tag,
  - Drop RFC.
---
 drivers/soc/renesas/rcar-sysc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/soc/renesas/rcar-sysc.c b/drivers/soc/renesas/rcar-sysc.c
index d51ddc7d5232b9db..53387a72ca00ce79 100644
--- a/drivers/soc/renesas/rcar-sysc.c
+++ b/drivers/soc/renesas/rcar-sysc.c
@@ -434,6 +434,8 @@ static int __init rcar_sysc_pd_init(void)
 	}
 
 	error = of_genpd_add_provider_onecell(np, &domains->onecell_data);
+	if (!error)
+		of_node_set_flag(np, OF_POPULATED);
 
 out_put:
 	of_node_put(np);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-28  8:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-28  8:28 [PATCH v2] soc: renesas: rcar-sysc: Mark device node OF_POPULATED after init Geert Uytterhoeven

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).