mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] pmdomain: fix early domain registration
@ 2026-06-09 16:06 Johan Hovold
  2026-06-10  9:12 ` Geert Uytterhoeven
  2026-06-10 21:18 ` Ulf Hansson
  0 siblings, 2 replies; 4+ messages 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	[flat|nested] 4+ messages in thread

* Re: [PATCH] pmdomain: fix early domain registration
  2026-06-09 16:06 [PATCH] pmdomain: fix early domain registration Johan Hovold
@ 2026-06-10  9:12 ` Geert Uytterhoeven
  2026-06-10  9:15   ` Johan Hovold
  2026-06-10 21:18 ` Ulf Hansson
  1 sibling, 1 reply; 4+ messages in thread
From: Geert Uytterhoeven @ 2026-06-10  9:12 UTC (permalink / raw)
  To: Johan Hovold; +Cc: Ulf Hansson, linux-pm, linux-kernel

Hi Johan,

On Tue, 9 Jun 2026 at 18:07, Johan Hovold <johan@kernel.org> wrote:
> 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.

Thanks for your patch!

> 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

s/Link/Closes/

> Signed-off-by: Johan Hovold <johan@kernel.org>

This fixes the issue on R-Car H1, M2-W, H3 ES2.0, and on RZ/A1H.
No regressions seen on SH-Mobile AG5, R-Mobile A1, and R-Car V4M.

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pmdomain: fix early domain registration
  2026-06-10  9:12 ` Geert Uytterhoeven
@ 2026-06-10  9:15   ` Johan Hovold
  0 siblings, 0 replies; 4+ messages in thread
From: Johan Hovold @ 2026-06-10  9:15 UTC (permalink / raw)
  To: Geert Uytterhoeven; +Cc: Ulf Hansson, linux-pm, linux-kernel

On Wed, Jun 10, 2026 at 11:12:19AM +0200, Geert Uytterhoeven wrote:

> On Tue, 9 Jun 2026 at 18:07, Johan Hovold <johan@kernel.org> wrote:
> > 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.
> 
> Thanks for your patch!
> 
> > 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
> 
> s/Link/Closes/

I use use Link: on purpose (like Linus does).

> > Signed-off-by: Johan Hovold <johan@kernel.org>
> 
> This fixes the issue on R-Car H1, M2-W, H3 ES2.0, and on RZ/A1H.
> No regressions seen on SH-Mobile AG5, R-Mobile A1, and R-Car V4M.
> 
> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thanks for confirming.

Johan

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] pmdomain: fix early domain registration
  2026-06-09 16:06 [PATCH] pmdomain: fix early domain registration Johan Hovold
  2026-06-10  9:12 ` Geert Uytterhoeven
@ 2026-06-10 21:18 ` Ulf Hansson
  1 sibling, 0 replies; 4+ messages in thread
From: Ulf Hansson @ 2026-06-10 21:18 UTC (permalink / raw)
  To: Johan Hovold; +Cc: Ulf Hansson, linux-pm, linux-kernel, Geert Uytterhoeven

On Tue, Jun 9, 2026 at 6:07 PM Johan Hovold <johan@kernel.org> wrote:
>
> 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>

Applied for next, thanks!

Kind regards
Uffe

> ---
>  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	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-06-10 21:19 UTC | newest]

Thread overview: 4+ messages (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
2026-06-10  9:12 ` Geert Uytterhoeven
2026-06-10  9:15   ` Johan Hovold
2026-06-10 21:18 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®