Message ID | 20210902230442.1515531-3-saravanak@google.com |
---|---|
State | New |
Headers | show |
Series | Fix simple-bus issues with fw_devlink | expand |
On Fri, 3 Sept 2021 at 01:04, Saravana Kannan <saravanak@google.com> wrote: > > The OF platform code sets up simple bus only devices (i.e. devices that > won't match with any other driver) to get probed by the simple-pm-bus to > keep fw_devlink from blocking probe() or sync_state() [1] callbacks of > other devices. There's no need to populate the child devices since the > OF platform code would do that anyway, so return early for these simple > bus only devices. This looks like a neat solution to our problem. Although, a few comments below. > > [1] - https://lore.kernel.org/lkml/CAPDyKFo9Bxremkb1dDrr4OcXSpE0keVze94Cm=zrkOVxHHxBmQ@mail.gmail.com/ > Signed-off-by: Saravana Kannan <saravanak@google.com> > Tested-by: Saravana Kannan <saravanak@google.com> > --- > drivers/bus/simple-pm-bus.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c > index 01a3d0cd08ed..91d52021b7f9 100644 > --- a/drivers/bus/simple-pm-bus.c > +++ b/drivers/bus/simple-pm-bus.c > @@ -19,6 +19,13 @@ static int simple_pm_bus_probe(struct platform_device *pdev) > const struct of_dev_auxdata *lookup = dev_get_platdata(&pdev->dev); > struct device_node *np = pdev->dev.of_node; > > + /* > + * These are transparent bus devices (not simple-pm-bus matches) that > + * get populated automatically. So, don't need to do anything more. > + */ > + if (pdev->driver_override) > + return 0; You need the same kind of check in simple_pm_bus_remove(), to avoid pm_runtime_disable(). At least for consistency. > + > dev_dbg(&pdev->dev, "%s\n", __func__); > > pm_runtime_enable(&pdev->dev); > -- > 2.33.0.153.gba50c8fa24-goog > It also looks like we should flip the order of the patches in the series, to keep things bisectable. Kind regards Uffe
On Fri, Sep 3, 2021 at 2:15 AM Ulf Hansson <ulf.hansson@linaro.org> wrote: > > On Fri, 3 Sept 2021 at 01:04, Saravana Kannan <saravanak@google.com> wrote: > > > > The OF platform code sets up simple bus only devices (i.e. devices that > > won't match with any other driver) to get probed by the simple-pm-bus to > > keep fw_devlink from blocking probe() or sync_state() [1] callbacks of > > other devices. There's no need to populate the child devices since the > > OF platform code would do that anyway, so return early for these simple > > bus only devices. > > This looks like a neat solution to our problem. Although, a few comments below. > > > > > [1] - https://lore.kernel.org/lkml/CAPDyKFo9Bxremkb1dDrr4OcXSpE0keVze94Cm=zrkOVxHHxBmQ@mail.gmail.com/ > > Signed-off-by: Saravana Kannan <saravanak@google.com> > > Tested-by: Saravana Kannan <saravanak@google.com> > > --- > > drivers/bus/simple-pm-bus.c | 7 +++++++ > > 1 file changed, 7 insertions(+) > > > > diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c > > index 01a3d0cd08ed..91d52021b7f9 100644 > > --- a/drivers/bus/simple-pm-bus.c > > +++ b/drivers/bus/simple-pm-bus.c > > @@ -19,6 +19,13 @@ static int simple_pm_bus_probe(struct platform_device *pdev) > > const struct of_dev_auxdata *lookup = dev_get_platdata(&pdev->dev); > > struct device_node *np = pdev->dev.of_node; > > > > + /* > > + * These are transparent bus devices (not simple-pm-bus matches) that > > + * get populated automatically. So, don't need to do anything more. > > + */ > > + if (pdev->driver_override) > > + return 0; > > You need the same kind of check in simple_pm_bus_remove(), to avoid > pm_runtime_disable(). At least for consistency. Ack. > > > + > > dev_dbg(&pdev->dev, "%s\n", __func__); > > > > pm_runtime_enable(&pdev->dev); > > -- > > 2.33.0.153.gba50c8fa24-goog > > > > It also looks like we should flip the order of the patches in the > series, to keep things bisectable. Sorry I didn't get this. I'm not causing any compilation issues. Why does this matter for bisecting? -Saravana
diff --git a/drivers/bus/simple-pm-bus.c b/drivers/bus/simple-pm-bus.c index 01a3d0cd08ed..91d52021b7f9 100644 --- a/drivers/bus/simple-pm-bus.c +++ b/drivers/bus/simple-pm-bus.c @@ -19,6 +19,13 @@ static int simple_pm_bus_probe(struct platform_device *pdev) const struct of_dev_auxdata *lookup = dev_get_platdata(&pdev->dev); struct device_node *np = pdev->dev.of_node; + /* + * These are transparent bus devices (not simple-pm-bus matches) that + * get populated automatically. So, don't need to do anything more. + */ + if (pdev->driver_override) + return 0; + dev_dbg(&pdev->dev, "%s\n", __func__); pm_runtime_enable(&pdev->dev);