* [PATCH v2] dmaengine: qcom_hidma: Fix runtime PM leak in hidma_issue_task()
@ 2026-11-06 8:42 Wentao Liang
2026-11-06 17:05 ` Frank Li
0 siblings, 1 reply; 2+ messages in thread
From: Wentao Liang @ 2026-11-06 8:42 UTC (permalink / raw)
To: Sinan Kaya, Vinod Koul, Frank Li
Cc: Andy Shevchenko, linux-arm-msm, linux-arm-kernel, dmaengine,
linux-kernel, stable, vulab
hidma_issue_task() bumps the device usage counter with
pm_runtime_get_sync() without checking the return value. The counter is
incremented even when the resume fails, e.g. when runtime PM has been
disabled or the device is suspending, and nothing drops it in that case,
so each failure leaves the device with an elevated usage count and it can
no longer runtime suspend.
Use pm_runtime_resume_and_get(), which drops the reference it took when
the resume fails, and do not start the transfer in that case. The counter
taken by a successful resume is still dropped by hidma_callback() as
before.
Fixes: 67a2003e0607 ("dmaengine: add Qualcomm Technologies HIDMA channel driver")
Cc: stable@vger.kernel.org
Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
---
Changes in v2:
- Use pm_runtime_resume_and_get() instead of pm_runtime_get_sync()
followed by pm_runtime_put_noidle(), as Frank Li suggested.
- Link to v1: https://lore.kernel.org/all/20260916093032.2003397-1-vulab@iscas.ac.cn/
- Sorry for the very late reply to this review.
drivers/dma/qcom/hidma.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/qcom/hidma.c b/drivers/dma/qcom/hidma.c
index 1349066b1544..c49cf622e5fb 100644
--- a/drivers/dma/qcom/hidma.c
+++ b/drivers/dma/qcom/hidma.c
@@ -219,7 +219,8 @@ static void hidma_issue_task(struct tasklet_struct *t)
{
struct hidma_dev *dmadev = from_tasklet(dmadev, t, task);
- pm_runtime_get_sync(dmadev->ddev.dev);
+ if (pm_runtime_resume_and_get(dmadev->ddev.dev) < 0)
+ return;
hidma_ll_start(dmadev->lldev);
}
--
2.34.1
^ permalink raw reply [flat|nested] 2+ messages in thread* Re: [PATCH v2] dmaengine: qcom_hidma: Fix runtime PM leak in hidma_issue_task()
2026-11-06 8:42 [PATCH v2] dmaengine: qcom_hidma: Fix runtime PM leak in hidma_issue_task() Wentao Liang
@ 2026-11-06 17:05 ` Frank Li
0 siblings, 0 replies; 2+ messages in thread
From: Frank Li @ 2026-11-06 17:05 UTC (permalink / raw)
To: Wentao Liang
Cc: Sinan Kaya, Vinod Koul, Frank Li, Andy Shevchenko, linux-arm-msm,
linux-arm-kernel, dmaengine, linux-kernel, stable
On Fri, Nov 06, 2026 at 08:42:52AM -0000, Wentao Liang wrote:
> hidma_issue_task() bumps the device usage counter with
> pm_runtime_get_sync() without checking the return value. The counter is
> incremented even when the resume fails, e.g. when runtime PM has been
> disabled or the device is suspending, and nothing drops it in that case,
> so each failure leaves the device with an elevated usage count and it can
> no longer runtime suspend.
>
> Use pm_runtime_resume_and_get(), which drops the reference it took when
> the resume fails, and do not start the transfer in that case. The counter
> taken by a successful resume is still dropped by hidma_callback() as
> before.
>
> Fixes: 67a2003e0607 ("dmaengine: add Qualcomm Technologies HIDMA channel driver")
> Cc: stable@vger.kernel.org
> Signed-off-by: Wentao Liang <vulab@iscas.ac.cn>
> ---
Krzysztof already report at many threads
https://lore.kernel.org/all/e34e5630-2f3e-4f7f-9f47-4fec11c1a61e@kernel.org/
https://lore.kernel.org/imx/20261104-small-pompous-basilisk-ac9df8@quoll/
vulab@iscas.ac.cn is bot, which is not real person.
If you can't reply and clear this situation, I will mark all patches from
vulab@iscas.ac.cn as not appliable at patchworks for dmaengine.
Frank
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-06 17:05 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-06 8:42 [PATCH v2] dmaengine: qcom_hidma: Fix runtime PM leak in hidma_issue_task() Wentao Liang
2026-11-06 17:05 ` Frank Li
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®