All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] soc: renesas: rmobile-sysc: Mark fwnode when PM domain is added
@ 2021-02-16 12:39 ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-02-16 12:39 UTC (permalink / raw)
  To: Magnus Damm, Saravana Kannan
  Cc: Sebastian Reichel, linux-renesas-soc, linux-arm-kernel, linux-pm,
	linux-kernel, Geert Uytterhoeven

Currently, there are two drivers binding to the R-Mobile System
Controller (SYSC):
  - The rmobile-sysc driver registers PM domains from a core_initcall(),
    and does not use a platform driver,
  - The optional rmobile-reset driver registers a reset handler, and
    does use a platform driver.

As fw_devlink only considers devices, commit bab2d712eeaf9d60 ("PM:
domains: Mark fwnodes when their powerdomain is added/removed") works
only for PM Domain drivers where the DT node is a real device node, and
not for PM Domain drivers using a hierarchical representation inside a
subnode.  Hence if fw_devlink is enabled, probing of on-chip devices
that are part of the SYSC PM domain is deferred until the optional
rmobile-reset driver has been bound.   If the rmobile-reset driver is
not available, this will never happen, and thus lead to complete system
boot failures.

Fix this by explicitly marking the fwnode initialized.

Suggested-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This is v2 of "soc: renesas: rmobile-sysc: Set OF_POPULATED and absorb
reset handling".
To be queued in renesas-devel as a fix for v5.12 if v5.12-rc1 will have
fw_devlink enabled.

v2:
  - Call fwnode_dev_initialized() instead of setting OF_POPULATED,
  - Drop reset handling move, as fwnode_dev_initialized() does not
    prevent the rmobile-reset driver from binding against the same
    device.
---
 drivers/soc/renesas/rmobile-sysc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/soc/renesas/rmobile-sysc.c b/drivers/soc/renesas/rmobile-sysc.c
index bf64d052f9245db5..204e6135180b919c 100644
--- a/drivers/soc/renesas/rmobile-sysc.c
+++ b/drivers/soc/renesas/rmobile-sysc.c
@@ -342,6 +342,8 @@ static int __init rmobile_init_pm_domains(void)
 			of_node_put(np);
 			break;
 		}
+
+		fwnode_dev_initialized(&np->fwnode, true);
 	}
 
 	put_special_pds();
-- 
2.25.1


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

* [PATCH v2] soc: renesas: rmobile-sysc: Mark fwnode when PM domain is added
@ 2021-02-16 12:39 ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-02-16 12:39 UTC (permalink / raw)
  To: Magnus Damm, Saravana Kannan
  Cc: Geert Uytterhoeven, linux-pm, linux-kernel, Sebastian Reichel,
	linux-renesas-soc, linux-arm-kernel

Currently, there are two drivers binding to the R-Mobile System
Controller (SYSC):
  - The rmobile-sysc driver registers PM domains from a core_initcall(),
    and does not use a platform driver,
  - The optional rmobile-reset driver registers a reset handler, and
    does use a platform driver.

As fw_devlink only considers devices, commit bab2d712eeaf9d60 ("PM:
domains: Mark fwnodes when their powerdomain is added/removed") works
only for PM Domain drivers where the DT node is a real device node, and
not for PM Domain drivers using a hierarchical representation inside a
subnode.  Hence if fw_devlink is enabled, probing of on-chip devices
that are part of the SYSC PM domain is deferred until the optional
rmobile-reset driver has been bound.   If the rmobile-reset driver is
not available, this will never happen, and thus lead to complete system
boot failures.

Fix this by explicitly marking the fwnode initialized.

Suggested-by: Saravana Kannan <saravanak@google.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
This is v2 of "soc: renesas: rmobile-sysc: Set OF_POPULATED and absorb
reset handling".
To be queued in renesas-devel as a fix for v5.12 if v5.12-rc1 will have
fw_devlink enabled.

v2:
  - Call fwnode_dev_initialized() instead of setting OF_POPULATED,
  - Drop reset handling move, as fwnode_dev_initialized() does not
    prevent the rmobile-reset driver from binding against the same
    device.
---
 drivers/soc/renesas/rmobile-sysc.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/soc/renesas/rmobile-sysc.c b/drivers/soc/renesas/rmobile-sysc.c
index bf64d052f9245db5..204e6135180b919c 100644
--- a/drivers/soc/renesas/rmobile-sysc.c
+++ b/drivers/soc/renesas/rmobile-sysc.c
@@ -342,6 +342,8 @@ static int __init rmobile_init_pm_domains(void)
 			of_node_put(np);
 			break;
 		}
+
+		fwnode_dev_initialized(&np->fwnode, true);
 	}
 
 	put_special_pds();
-- 
2.25.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] soc: renesas: rmobile-sysc: Mark fwnode when PM domain is added
  2021-02-16 12:39 ` Geert Uytterhoeven
@ 2021-02-16 18:25   ` Saravana Kannan
  -1 siblings, 0 replies; 6+ messages in thread
From: Saravana Kannan @ 2021-02-16 18:25 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Magnus Damm, Sebastian Reichel, Linux-Renesas, linux-arm-kernel,
	Linux PM, LKML, Greg Kroah-Hartman

On Tue, Feb 16, 2021 at 4:40 AM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>
> Currently, there are two drivers binding to the R-Mobile System
> Controller (SYSC):
>   - The rmobile-sysc driver registers PM domains from a core_initcall(),
>     and does not use a platform driver,
>   - The optional rmobile-reset driver registers a reset handler, and
>     does use a platform driver.
>
> As fw_devlink only considers devices, commit bab2d712eeaf9d60 ("PM:
> domains: Mark fwnodes when their powerdomain is added/removed") works
> only for PM Domain drivers where the DT node is a real device node, and
> not for PM Domain drivers using a hierarchical representation inside a
> subnode.  Hence if fw_devlink is enabled, probing of on-chip devices
> that are part of the SYSC PM domain is deferred until the optional
> rmobile-reset driver has been bound.   If the rmobile-reset driver is
> not available, this will never happen, and thus lead to complete system
> boot failures.
>
> Fix this by explicitly marking the fwnode initialized.
>
> Suggested-by: Saravana Kannan <saravanak@google.com>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> This is v2 of "soc: renesas: rmobile-sysc: Set OF_POPULATED and absorb
> reset handling".
> To be queued in renesas-devel as a fix for v5.12 if v5.12-rc1 will have
> fw_devlink enabled.
>
> v2:
>   - Call fwnode_dev_initialized() instead of setting OF_POPULATED,
>   - Drop reset handling move, as fwnode_dev_initialized() does not
>     prevent the rmobile-reset driver from binding against the same
>     device.
> ---
>  drivers/soc/renesas/rmobile-sysc.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/soc/renesas/rmobile-sysc.c b/drivers/soc/renesas/rmobile-sysc.c
> index bf64d052f9245db5..204e6135180b919c 100644
> --- a/drivers/soc/renesas/rmobile-sysc.c
> +++ b/drivers/soc/renesas/rmobile-sysc.c
> @@ -342,6 +342,8 @@ static int __init rmobile_init_pm_domains(void)
>                         of_node_put(np);
>                         break;
>                 }
> +
> +               fwnode_dev_initialized(&np->fwnode, true);
>         }
>
>         put_special_pds();

Acked-by: Saravana Kannan <saravanak@google.com>

Keep in mind that this might have to land in driver-core-next since
that API is currently only in driver-core-next.

-Saravana

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

* Re: [PATCH v2] soc: renesas: rmobile-sysc: Mark fwnode when PM domain is added
@ 2021-02-16 18:25   ` Saravana Kannan
  0 siblings, 0 replies; 6+ messages in thread
From: Saravana Kannan @ 2021-02-16 18:25 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Linux PM, Greg Kroah-Hartman, Magnus Damm, LKML,
	Sebastian Reichel, Linux-Renesas, linux-arm-kernel

On Tue, Feb 16, 2021 at 4:40 AM Geert Uytterhoeven
<geert+renesas@glider.be> wrote:
>
> Currently, there are two drivers binding to the R-Mobile System
> Controller (SYSC):
>   - The rmobile-sysc driver registers PM domains from a core_initcall(),
>     and does not use a platform driver,
>   - The optional rmobile-reset driver registers a reset handler, and
>     does use a platform driver.
>
> As fw_devlink only considers devices, commit bab2d712eeaf9d60 ("PM:
> domains: Mark fwnodes when their powerdomain is added/removed") works
> only for PM Domain drivers where the DT node is a real device node, and
> not for PM Domain drivers using a hierarchical representation inside a
> subnode.  Hence if fw_devlink is enabled, probing of on-chip devices
> that are part of the SYSC PM domain is deferred until the optional
> rmobile-reset driver has been bound.   If the rmobile-reset driver is
> not available, this will never happen, and thus lead to complete system
> boot failures.
>
> Fix this by explicitly marking the fwnode initialized.
>
> Suggested-by: Saravana Kannan <saravanak@google.com>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> This is v2 of "soc: renesas: rmobile-sysc: Set OF_POPULATED and absorb
> reset handling".
> To be queued in renesas-devel as a fix for v5.12 if v5.12-rc1 will have
> fw_devlink enabled.
>
> v2:
>   - Call fwnode_dev_initialized() instead of setting OF_POPULATED,
>   - Drop reset handling move, as fwnode_dev_initialized() does not
>     prevent the rmobile-reset driver from binding against the same
>     device.
> ---
>  drivers/soc/renesas/rmobile-sysc.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/soc/renesas/rmobile-sysc.c b/drivers/soc/renesas/rmobile-sysc.c
> index bf64d052f9245db5..204e6135180b919c 100644
> --- a/drivers/soc/renesas/rmobile-sysc.c
> +++ b/drivers/soc/renesas/rmobile-sysc.c
> @@ -342,6 +342,8 @@ static int __init rmobile_init_pm_domains(void)
>                         of_node_put(np);
>                         break;
>                 }
> +
> +               fwnode_dev_initialized(&np->fwnode, true);
>         }
>
>         put_special_pds();

Acked-by: Saravana Kannan <saravanak@google.com>

Keep in mind that this might have to land in driver-core-next since
that API is currently only in driver-core-next.

-Saravana

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2] soc: renesas: rmobile-sysc: Mark fwnode when PM domain is added
  2021-02-16 18:25   ` Saravana Kannan
@ 2021-02-16 20:33     ` Geert Uytterhoeven
  -1 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-02-16 20:33 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: Magnus Damm, Sebastian Reichel, Linux-Renesas, linux-arm-kernel,
	Linux PM, LKML, Greg Kroah-Hartman

Hi Saravana,

On Tue, Feb 16, 2021 at 7:26 PM Saravana Kannan <saravanak@google.com> wrote:
> On Tue, Feb 16, 2021 at 4:40 AM Geert Uytterhoeven
> <geert+renesas@glider.be> wrote:
> > Currently, there are two drivers binding to the R-Mobile System
> > Controller (SYSC):
> >   - The rmobile-sysc driver registers PM domains from a core_initcall(),
> >     and does not use a platform driver,
> >   - The optional rmobile-reset driver registers a reset handler, and
> >     does use a platform driver.
> >
> > As fw_devlink only considers devices, commit bab2d712eeaf9d60 ("PM:
> > domains: Mark fwnodes when their powerdomain is added/removed") works
> > only for PM Domain drivers where the DT node is a real device node, and
> > not for PM Domain drivers using a hierarchical representation inside a
> > subnode.  Hence if fw_devlink is enabled, probing of on-chip devices
> > that are part of the SYSC PM domain is deferred until the optional
> > rmobile-reset driver has been bound.   If the rmobile-reset driver is
> > not available, this will never happen, and thus lead to complete system
> > boot failures.
> >
> > Fix this by explicitly marking the fwnode initialized.
> >
> > Suggested-by: Saravana Kannan <saravanak@google.com>
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > This is v2 of "soc: renesas: rmobile-sysc: Set OF_POPULATED and absorb
> > reset handling".
> > To be queued in renesas-devel as a fix for v5.12 if v5.12-rc1 will have
> > fw_devlink enabled.

> Acked-by: Saravana Kannan <saravanak@google.com>

Thanks!

> Keep in mind that this might have to land in driver-core-next since
> that API is currently only in driver-core-next.

That will be resolved once driver-core-next has been merged in v5.12-rc1.

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] 6+ messages in thread

* Re: [PATCH v2] soc: renesas: rmobile-sysc: Mark fwnode when PM domain is added
@ 2021-02-16 20:33     ` Geert Uytterhoeven
  0 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2021-02-16 20:33 UTC (permalink / raw)
  To: Saravana Kannan
  Cc: Linux PM, Greg Kroah-Hartman, Magnus Damm, LKML,
	Sebastian Reichel, Linux-Renesas, linux-arm-kernel

Hi Saravana,

On Tue, Feb 16, 2021 at 7:26 PM Saravana Kannan <saravanak@google.com> wrote:
> On Tue, Feb 16, 2021 at 4:40 AM Geert Uytterhoeven
> <geert+renesas@glider.be> wrote:
> > Currently, there are two drivers binding to the R-Mobile System
> > Controller (SYSC):
> >   - The rmobile-sysc driver registers PM domains from a core_initcall(),
> >     and does not use a platform driver,
> >   - The optional rmobile-reset driver registers a reset handler, and
> >     does use a platform driver.
> >
> > As fw_devlink only considers devices, commit bab2d712eeaf9d60 ("PM:
> > domains: Mark fwnodes when their powerdomain is added/removed") works
> > only for PM Domain drivers where the DT node is a real device node, and
> > not for PM Domain drivers using a hierarchical representation inside a
> > subnode.  Hence if fw_devlink is enabled, probing of on-chip devices
> > that are part of the SYSC PM domain is deferred until the optional
> > rmobile-reset driver has been bound.   If the rmobile-reset driver is
> > not available, this will never happen, and thus lead to complete system
> > boot failures.
> >
> > Fix this by explicitly marking the fwnode initialized.
> >
> > Suggested-by: Saravana Kannan <saravanak@google.com>
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> > ---
> > This is v2 of "soc: renesas: rmobile-sysc: Set OF_POPULATED and absorb
> > reset handling".
> > To be queued in renesas-devel as a fix for v5.12 if v5.12-rc1 will have
> > fw_devlink enabled.

> Acked-by: Saravana Kannan <saravanak@google.com>

Thanks!

> Keep in mind that this might have to land in driver-core-next since
> that API is currently only in driver-core-next.

That will be resolved once driver-core-next has been merged in v5.12-rc1.

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2021-02-16 20:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 12:39 [PATCH v2] soc: renesas: rmobile-sysc: Mark fwnode when PM domain is added Geert Uytterhoeven
2021-02-16 12:39 ` Geert Uytterhoeven
2021-02-16 18:25 ` Saravana Kannan
2021-02-16 18:25   ` Saravana Kannan
2021-02-16 20:33   ` Geert Uytterhoeven
2021-02-16 20:33     ` Geert Uytterhoeven

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.