The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <ukleinek@kernel.org>
To: Guangshuo Li <lgs201920130244@gmail.com>
Cc: Thierry Reding <thierry.reding@gmail.com>,
	 Ed Blake <ed.blake@sondrel.com>,
	linux-pwm@vger.kernel.org, linux-kernel@vger.kernel.org,
	 stable@vger.kernel.org, "Rafael J. Wysocki" <rafael@kernel.org>
Subject: Re: [PATCH] pwm: img: stop using autosuspend on remove
Date: Mon, 30 Nov 2026 12:44:26 +0100	[thread overview]
Message-ID: <aw1glnQQMZoul459@monoceros> (raw)
In-Reply-To: <20260918033017.3441183-1-lgs201920130244@gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1637 bytes --]

Hello,

[adding Rafael as expert on runtime PM]

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@vger.kernel.org
> Signed-off-by: Guangshuo Li <lgs201920130244@gmail.com>
> ---
>  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);

What is the effect of not having that? It that relevant at all with
runtime PM disabled? If the worst effect is that the device will have
autosuspend enabled when it's probed the next time, I think it's fine to
fix, but I'd drop the Cc: stable then.

Would it make sense to let pm_runtime_disable() call
pm_runtime_dont_use_autosuspend()?

Best regards
Uwe

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2026-11-30 11:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-18  3:30 [PATCH] pwm: img: stop using autosuspend on remove Guangshuo Li
2026-11-30 11:44 ` Uwe Kleine-König [this message]
2026-11-30 12:33   ` Joshua Crofts
2026-11-30 13:31     ` Uwe Kleine-König
2026-11-30 13:41       ` Joshua Crofts

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aw1glnQQMZoul459@monoceros \
    --to=ukleinek@kernel.org \
    --cc=ed.blake@sondrel.com \
    --cc=lgs201920130244@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pwm@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=thierry.reding@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox