From: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
To: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
Cc: Thinh Nguyen <Thinh.Nguyen@synopsys.com>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Aswath Govindraju <a-govindraju@ti.com>,
Roger Quadros <rogerq@kernel.org>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] usb: dwc3: am62: Fix runtime PM usage count leak on probe error path
Date: Sat, 5 Sep 2026 00:21:02 +0000 [thread overview]
Message-ID: <aptgYY7QUc79z4rC@vbox> (raw)
In-Reply-To: <20260902-dwc3-am62-rpm-fix-v1-1-7a2807e33307@amd.com>
On Wed, Sep 02, 2026, Radhey Shyam Pandey wrote:
> dwc3_ti_probe() takes a runtime PM reference with pm_runtime_get_noresume()
> before creating the dwc3 core child device, and releases it with
> pm_runtime_put_autosuspend() once probe has succeeded. The err_pm_disable
> error path only disables runtime PM, so the reference taken a few lines
> earlier is never dropped.
>
> The usage counter lives in struct device and is not reset when the driver
> is unbound, so the leaked reference outlives the failed probe. If the
> device is probed again, through a manual rebind or a module reload, the
> counter starts at one instead of zero and the pm_runtime_put_autosuspend()
> on the success path can no longer bring it back down. The wrapper then
> stays runtime resumed for good and autosuspend never kicks in.
>
> Drop the reference before disabling runtime PM, matching the ordering
> already used in dwc3_ti_remove().
>
> Fixes: e8784c0aec03 ("drivers: usb: dwc3: Add AM62 USB wrapper driver")
> Cc: stable@vger.kernel.org
> Assisted-by: Claude:claude-opus-5
> Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@amd.com>
> ---
> drivers/usb/dwc3/dwc3-am62.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/drivers/usb/dwc3/dwc3-am62.c b/drivers/usb/dwc3/dwc3-am62.c
> index 632634d6e81e..d03b3950ce04 100644
> --- a/drivers/usb/dwc3/dwc3-am62.c
> +++ b/drivers/usb/dwc3/dwc3-am62.c
> @@ -299,6 +299,7 @@ static int dwc3_ti_probe(struct platform_device *pdev)
>
> err_pm_disable:
> clk_disable_unprepare(am62->usb2_refclk);
> + pm_runtime_put_noidle(dev);
> pm_runtime_disable(dev);
> pm_runtime_set_suspended(dev);
> return ret;
>
> ---
> base-commit: 8b72f6626dc39b9e7e82b2721d4f7c3b86286012
> change-id: 20260902-dwc3-am62-rpm-fix-514ccf0696a3
>
Acked-by: Thinh Nguyen <Thinh.Nguyen@synopsys.com>
BR,
Thinh
prev parent reply other threads:[~2026-09-05 0:21 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-02 14:54 Radhey Shyam Pandey
2026-09-05 0:21 ` Thinh Nguyen [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=aptgYY7QUc79z4rC@vbox \
--to=thinh.nguyen@synopsys.com \
--cc=a-govindraju@ti.com \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=radhey.shyam.pandey@amd.com \
--cc=rogerq@kernel.org \
--cc=stable@vger.kernel.org \
/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
all inboxes | Powered by JetHome®