From: Frank Li <Frank.li@oss.nxp.com>
To: Xu Yang <xu.yang_2@oss.nxp.com>
Cc: peter.chen@kernel.org, gregkh@linuxfoundation.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
imx@lists.linux.dev, jun.li@nxp.com
Subject: Re: [PATCH] usb: chipidea: fix usage_count leak when autosuspend_delay is negative
Date: Thu, 16 Jul 2026 07:42:59 -0500 [thread overview]
Message-ID: <aljR05aAspEK-ksA@SMW015318> (raw)
In-Reply-To: <20260716104126.2763454-1-xu.yang_2@oss.nxp.com>
On Thu, Jul 16, 2026 at 06:41:26PM +0800, Xu Yang wrote:
> From: Xu Yang <xu.yang_2@nxp.com>
>
> The probe() calls pm_runtime_use_autosuspend(), but remove() does not call
> pm_runtime_dont_use_autosuspend(). This can lead to a usage_count leak if
> autosuspend_delay is set to a negative value.
>
> The pm_runtime_use_autosuspend() also notes that it's important to undo
> this with pm_runtime_dont_use_autosuspend() at driver exit time.
>
> Fixes: 1f874edcb731 ("usb: chipidea: add runtime power management support")
> Assisted-by: Claude:claude-sonnet-4.6
> Signed-off-by: Xu Yang <xu.yang_2@nxp.com>
> ---
Reviewed-by: Frank Li <Frank.Li@nxp.com>
> drivers/usb/chipidea/core.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/chipidea/core.c b/drivers/usb/chipidea/core.c
> index 7edc512cc37d..3461dd763a6e 100644
> --- a/drivers/usb/chipidea/core.c
> +++ b/drivers/usb/chipidea/core.c
> @@ -1250,6 +1250,7 @@ static void ci_hdrc_remove(struct platform_device *pdev)
> usb_role_switch_unregister(ci->role_switch);
>
> if (ci->supports_runtime_pm) {
> + pm_runtime_dont_use_autosuspend(&pdev->dev);
> pm_runtime_get_sync(&pdev->dev);
> pm_runtime_disable(&pdev->dev);
> pm_runtime_put_noidle(&pdev->dev);
> --
> 2.34.1
>
>
prev parent reply other threads:[~2026-07-16 12:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-16 10:41 [PATCH] usb: chipidea: fix usage_count leak when autosuspend_delay is negative Xu Yang
2026-07-16 12:42 ` Frank Li [this message]
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=aljR05aAspEK-ksA@SMW015318 \
--to=frank.li@oss.nxp.com \
--cc=gregkh@linuxfoundation.org \
--cc=imx@lists.linux.dev \
--cc=jun.li@nxp.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=peter.chen@kernel.org \
--cc=xu.yang_2@oss.nxp.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