Re: [PATCH] pwm: img: stop using autosuspend on remove
From: Uwe Kleine-König
Date: Mon Nov 30 2026 - 08:31:50 EST
Hello,
On Mon, Nov 30, 2026 at 01:33:08PM +0100, Joshua Crofts wrote:
> On Fri, Sep 18, 2026 at 11:30:17AM +0800, Guangshuo Li wrote:
> > img_pwm_probe() enables runtime PM autosuspend with
> > pm_runtime_use_autosuspend(). The probe failure path disables
> > autosuspend again, but the remove path only disables runtime PM.
> >
> > As a result, the runtime PM autosuspend setting is left enabled after
> > the driver is unbound.
> >
> > Call pm_runtime_dont_use_autosuspend() from img_pwm_remove() to undo
> > the setting established during probe, matching the probe error path
> > and the runtime PM API requirements.
> >
> > This issue was found by manual code inspection.
> >
> > Fixes: e690ae526216 ("pwm: img: Add runtime PM")
> > Cc: stable@xxxxxxxxxxxxxxx
> > Signed-off-by: Guangshuo Li <lgs201920130244@xxxxxxxxx>
> > ---
> > drivers/pwm/pwm-img.c | 1 +
> > 1 file changed, 1 insertion(+)
> >
> > diff --git a/drivers/pwm/pwm-img.c b/drivers/pwm/pwm-img.c
> > index 91e0b19f0c08..c0747f5e0020 100644
> > --- a/drivers/pwm/pwm-img.c
> > +++ b/drivers/pwm/pwm-img.c
> > @@ -339,6 +339,7 @@ static void img_pwm_remove(struct platform_device *pdev)
> > struct pwm_chip *chip = platform_get_drvdata(pdev);
> >
> > pm_runtime_disable(&pdev->dev);
> > + pm_runtime_dont_use_autosuspend(&pdev->dev);
>
> No need to add this as I added a change [1] that causes dont_use_autosuspend() to
> be called on driver exit.
>
> [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d1706f9da9f40dffe8621cc0ee03b847f41f1d6d
That sounds like the right thing to do. So I guess this patch can be
replaced by one that drops pm_runtime_dont_use_autosuspend() from
img_pwm_probe() then.
Best regards
Uwe
Attachment:
signature.asc
Description: PGP signature