[PATCH] pmdomain: imx: gpc: set fwnode from parent device

Ulf Hansson ulf.hansson at linaro.org
Mon Oct 16 02:53:19 PDT 2023


On Fri, 13 Oct 2023 at 23:30, Saravana Kannan <saravanak at google.com> wrote:
>
> On Thu, Oct 12, 2023 at 6:22 AM Emil Kronborg Andersen <emkan at prevas.dk> wrote:
> >
> > Before commit 3fb16866b51d ("driver core: fw_devlink: Make cycle
> > detection more robust"), consumer devices without their fwnode set
> > printed errors like the one below:
> >
> > [    1.039830] imx-gpc 20dc000.gpc: Failed to create device link (0x180) with 20c8000.anatop:regulator-vddpu
> >
> > To fix this, set the fwnode so fw_devlink can find and handle it
> > properly.
> >
> > Signed-off-by: Emil Kronborg Andersen <emkan at prevas.dk>
> > ---
> >  drivers/pmdomain/imx/gpc.c | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/drivers/pmdomain/imx/gpc.c b/drivers/pmdomain/imx/gpc.c
> > index 90a8b2c0676f..8759eab72880 100644
> > --- a/drivers/pmdomain/imx/gpc.c
> > +++ b/drivers/pmdomain/imx/gpc.c
> > @@ -411,6 +411,8 @@ static int imx_gpc_probe(struct platform_device *pdev)
> >         void __iomem *base;
> >         int ret;
> >
> > +       device_set_node(&pdev->dev, dev_fwnode(pdev->dev.parent));
> > +
>
> Similar question as the other patch. Can we do this at a pmdomain
> framework level instead of per driver?

Unfortunately, it's not that easy. It's not required by
pm_genpd_init() (or of_genpd_add_provider_*) to use a struct *device
when registering a genpd provider. In fact, that's also the reason why
pm_genpd_init() needs to initialize its own struct device.

That said, can you please explain the special condition that caused
this thing to be needed in the first place?

[...]

Kind regards
Uffe



More information about the linux-arm-kernel mailing list