Messages in this thread | | | From | "Rafael J. Wysocki" <> | Date | Fri, 4 Mar 2022 18:30:49 +0100 | Subject | Re: [PATCH] PM: runtime: Have devm_pm_runtime_enable() handle pm_runtime_dont_use_autosuspend() |
| |
On Fri, Mar 4, 2022 at 11:04 AM Ulf Hansson <ulf.hansson@linaro.org> wrote: > > On Wed, 23 Feb 2022 at 17:35, Douglas Anderson <dianders@chromium.org> wrote: > > > > The PM Runtime docs say: > > Drivers in ->remove() callback should undo the runtime PM changes done > > in ->probe(). Usually this means calling pm_runtime_disable(), > > pm_runtime_dont_use_autosuspend() etc. > > > > From grepping code, it's clear that many people aren't aware of the > > need to call pm_runtime_dont_use_autosuspend(). > > > > When brainstorming solutions, one idea that came up was to leverage > > the new-ish devm_pm_runtime_enable() function. The idea here is that: > > * When the devm action is called we know that the driver is being > > removed. It's the perfect time to undo the use_autosuspend. > > * The code of pm_runtime_dont_use_autosuspend() already handles the > > case of being called when autosuspend wasn't enabled. > > > > Suggested-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> > > Signed-off-by: Douglas Anderson <dianders@chromium.org> > > Okay, this provides an improvement from the short term perspective.
I agree.
> Reviewed-by: Ulf Hansson <ulf.hansson@linaro.org>
And so I've queued up the patch (for 5.18).
Thanks!
| |