* [PATCH] pmdomain: fix early domain registration
@ 2026-06-09 16:06 Johan Hovold
0 siblings, 0 replies; only message in thread
From: Johan Hovold @ 2026-06-09 16:06 UTC (permalink / raw)
To: Ulf Hansson; +Cc: linux-pm, linux-kernel, Johan Hovold, Geert Uytterhoeven
A recent change switching to a dynamically allocated root device broke
platforms like rcar-sysc that registers PM domains before the PM domain
bus itself has been registered (cf. commit c5ae5a0c6112 ("pmdomain:
renesas: rcar-sysc: Add genpd OF provider at postcore_initcall")).
Defer the assignment of the parent root device until the domain is
registered with driver core to avoid it being left unset.
Fixes: a96e40f4afdc ("pmdomain: core: switch to dynamic root device")
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/r/CAMuHMdUHabMGJyJ7e7yp7DLC+JJc9k6NK9p4anj2wRKNuwZUng@mail.gmail.com
Signed-off-by: Johan Hovold <johan@kernel.org>
---
drivers/pmdomain/core.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/pmdomain/core.c b/drivers/pmdomain/core.c
index 3f265b57158a..19eaee1819c8 100644
--- a/drivers/pmdomain/core.c
+++ b/drivers/pmdomain/core.c
@@ -2323,7 +2323,6 @@ static int genpd_alloc_data(struct generic_pm_domain *genpd)
device_initialize(&genpd->dev);
genpd->dev.release = genpd_provider_release;
genpd->dev.bus = &genpd_provider_bus_type;
- genpd->dev.parent = genpd_provider_bus;
if (!genpd_is_dev_name_fw(genpd)) {
dev_set_name(&genpd->dev, "%s", genpd->name);
@@ -2688,6 +2687,7 @@ int of_genpd_add_provider_simple(struct device_node *np,
if (!genpd_present(genpd))
return -EINVAL;
+ genpd->dev.parent = genpd_provider_bus;
genpd->dev.of_node = np;
fwnode = of_fwnode_handle(np);
@@ -2782,6 +2782,7 @@ int of_genpd_add_provider_onecell(struct device_node *np,
if (!genpd_present(genpd))
goto error;
+ genpd->dev.parent = genpd_provider_bus;
genpd->dev.of_node = np;
if (sync_state && !genpd_is_no_sync_state(genpd)) {
--
2.53.0
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2026-06-09 16:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-09 16:06 [PATCH] pmdomain: fix early domain registration Johan Hovold
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox