* [PATCH] usb: chipidea: tegra: disable runtime PM on resume failure
@ 2026-09-13 4:10 Myeonghun Pak
2026-09-15 6:34 ` Peter Chen
0 siblings, 1 reply; 2+ messages in thread
From: Myeonghun Pak @ 2026-09-13 4:10 UTC (permalink / raw)
To: Peter Chen, Greg Kroah-Hartman, Thierry Reding, Jonathan Hunter
Cc: Dmitry Osipenko, linux-usb, linux-tegra, linux-kernel, stable, Ijae Kim
tegra_usb_probe() enables runtime PM before resuming the device. If
pm_runtime_resume_and_get() fails, probe returns without disabling runtime
PM. The later error paths reach pm_runtime_force_suspend(), but this early
return bypasses that cleanup.
Disable runtime PM before returning the resume error. Do not use the
fail_power_off path: the failed resume did not retain a usage reference,
so its pm_runtime_put_sync_suspend() would be unbalanced.
This issue was identified during our ongoing static-analysis research while
reviewing kernel code.
Fixes: 8b85e11c1a7a ("usb: chipidea: tegra: Add runtime PM and OPP support")
Cc: stable@vger.kernel.org
Assisted-by: OpenAI:GPT-5.6
Co-developed-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Ijae Kim <ae878000@gmail.com>
Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
---
drivers/usb/chipidea/ci_hdrc_tegra.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/usb/chipidea/ci_hdrc_tegra.c b/drivers/usb/chipidea/ci_hdrc_tegra.c
index 372788f0f..26225b034 100644
--- a/drivers/usb/chipidea/ci_hdrc_tegra.c
+++ b/drivers/usb/chipidea/ci_hdrc_tegra.c
@@ -306,8 +306,10 @@ static int tegra_usb_probe(struct platform_device *pdev)
pm_runtime_enable(&pdev->dev);
err = pm_runtime_resume_and_get(&pdev->dev);
- if (err)
+ if (err) {
+ pm_runtime_disable(&pdev->dev);
return err;
+ }
if (device_property_present(&pdev->dev, "nvidia,needs-double-reset"))
usb->needs_double_reset = true;
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH] usb: chipidea: tegra: disable runtime PM on resume failure
2026-09-13 4:10 [PATCH] usb: chipidea: tegra: disable runtime PM on resume failure Myeonghun Pak
@ 2026-09-15 6:34 ` Peter Chen
0 siblings, 0 replies; 2+ messages in thread
From: Peter Chen @ 2026-09-15 6:34 UTC (permalink / raw)
To: Myeonghun Pak
Cc: Greg Kroah-Hartman, Thierry Reding, Jonathan Hunter,
Dmitry Osipenko, linux-usb, linux-tegra, linux-kernel, stable,
Ijae Kim
On 26-09-13 00:10:33, Myeonghun Pak wrote:
> tegra_usb_probe() enables runtime PM before resuming the device. If
> pm_runtime_resume_and_get() fails, probe returns without disabling runtime
> PM. The later error paths reach pm_runtime_force_suspend(), but this early
> return bypasses that cleanup.
>
> Disable runtime PM before returning the resume error. Do not use the
> fail_power_off path: the failed resume did not retain a usage reference,
> so its pm_runtime_put_sync_suspend() would be unbalanced.
>
> This issue was identified during our ongoing static-analysis research while
> reviewing kernel code.
>
> Fixes: 8b85e11c1a7a ("usb: chipidea: tegra: Add runtime PM and OPP support")
> Cc: stable@vger.kernel.org
> Assisted-by: OpenAI:GPT-5.6
> Co-developed-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Ijae Kim <ae878000@gmail.com>
> Signed-off-by: Myeonghun Pak <mhun512@gmail.com>
Acked-by: Peter Chen <peter.chen@kernel.org>
Peter
> ---
> drivers/usb/chipidea/ci_hdrc_tegra.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/usb/chipidea/ci_hdrc_tegra.c b/drivers/usb/chipidea/ci_hdrc_tegra.c
> index 372788f0f..26225b034 100644
> --- a/drivers/usb/chipidea/ci_hdrc_tegra.c
> +++ b/drivers/usb/chipidea/ci_hdrc_tegra.c
> @@ -306,8 +306,10 @@ static int tegra_usb_probe(struct platform_device *pdev)
>
> pm_runtime_enable(&pdev->dev);
> err = pm_runtime_resume_and_get(&pdev->dev);
> - if (err)
> + if (err) {
> + pm_runtime_disable(&pdev->dev);
> return err;
> + }
>
> if (device_property_present(&pdev->dev, "nvidia,needs-double-reset"))
> usb->needs_double_reset = true;
--
Thanks,
Peter Chen
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-09-15 6:34 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-13 4:10 [PATCH] usb: chipidea: tegra: disable runtime PM on resume failure Myeonghun Pak
2026-09-15 6:34 ` Peter Chen
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®