From: Johan Hovold <johan@kernel.org>
To: Ulf Hansson <ulfh@kernel.org>
Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org,
Johan Hovold <johan@kernel.org>,
Geert Uytterhoeven <geert@linux-m68k.org>
Subject: [PATCH] pmdomain: fix early domain registration
Date: Tue, 9 Jun 2026 18:06:34 +0200 [thread overview]
Message-ID: <20260609160634.246526-1-johan@kernel.org> (raw)
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
reply other threads:[~2026-06-09 16:07 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20260609160634.246526-1-johan@kernel.org \
--to=johan@kernel.org \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=ulfh@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.