DMA Engine development
 help / color / mirror / Atom feed
* [PATCH] dmaengine: qcom: adm: Propagate reset errors from probe
@ 2026-11-29 19:25 Jiawen Liu
  2026-11-29 19:43 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Liu @ 2026-11-29 19:25 UTC (permalink / raw)
  To: Vinod Koul; +Cc: Frank Li, linux-arm-msm, dmaengine

With fw_devlink=off on IPQ8064, GCC can unbind while ADM is probing.
If GCC unregisters its reset controller after ADM asserts reset, the
reset core invalidates the held handles. Deassertion then returns
-ENODEV. ADM ignores the error and can program its registers and
register a DMA provider while the block is still in reset. A NAND
client can then time out waiting for DMA completion.

Check each reset assertion and deassertion and return the first error
through the existing clock cleanup path, before programming ADM
registers, requesting the IRQ or registering the DMA provider.
Keep the reset order and the 2 us delay.

Verification included a source trace of the reset and clock unwind
paths, a 32-bit ARM qcom_adm.o build with QCOM_ADM, IPQ_GCC_806X and
RESET_CONTROLLER enabled, git diff --check and checkpatch.
Runtime and hardware reproduction were not performed.

Fixes: 78ebbff6d1a0 ("reset: handle removing supplier before consumers")
Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>
---
 drivers/dma/qcom/qcom_adm.c | 32 ++++++++++++++++++++++++--------
 1 file changed, 24 insertions(+), 8 deletions(-)

diff --git a/drivers/dma/qcom/qcom_adm.c b/drivers/dma/qcom/qcom_adm.c
index b38ee75a96378..2c6896b71a780 100644
--- a/drivers/dma/qcom/qcom_adm.c
+++ b/drivers/dma/qcom/qcom_adm.c
@@ -812,17 +812,33 @@ static int adm_dma_probe(struct platform_device *pdev)
 		goto err_disable_core_clk;
 	}
 
-	reset_control_assert(adev->clk_reset);
-	reset_control_assert(adev->c0_reset);
-	reset_control_assert(adev->c1_reset);
-	reset_control_assert(adev->c2_reset);
+	ret = reset_control_assert(adev->clk_reset);
+	if (ret)
+		goto err_disable_clks;
+	ret = reset_control_assert(adev->c0_reset);
+	if (ret)
+		goto err_disable_clks;
+	ret = reset_control_assert(adev->c1_reset);
+	if (ret)
+		goto err_disable_clks;
+	ret = reset_control_assert(adev->c2_reset);
+	if (ret)
+		goto err_disable_clks;
 
 	udelay(2);
 
-	reset_control_deassert(adev->clk_reset);
-	reset_control_deassert(adev->c0_reset);
-	reset_control_deassert(adev->c1_reset);
-	reset_control_deassert(adev->c2_reset);
+	ret = reset_control_deassert(adev->clk_reset);
+	if (ret)
+		goto err_disable_clks;
+	ret = reset_control_deassert(adev->c0_reset);
+	if (ret)
+		goto err_disable_clks;
+	ret = reset_control_deassert(adev->c1_reset);
+	if (ret)
+		goto err_disable_clks;
+	ret = reset_control_deassert(adev->c2_reset);
+	if (ret)
+		goto err_disable_clks;
 
 	adev->channels = devm_kzalloc_objs(adev->dev, *adev->channels,
 					   ADM_MAX_CHANNELS);
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] dmaengine: qcom: adm: Propagate reset errors from probe
  2026-11-29 19:25 [PATCH] dmaengine: qcom: adm: Propagate reset errors from probe Jiawen Liu
@ 2026-11-29 19:43 ` sashiko-bot
  0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-29 19:43 UTC (permalink / raw)
  To: Jiawen Liu; +Cc: dmaengine, vkoul, Frank.Li

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] dmaengine: qcom: adm: inaccurate Fixes trailer in commit message
--

commit 9bca7345605b3adf090ac246e6f33dd343ab2adb
Author: Jiawen Liu <liu1298662399@gmail.com>

> dmaengine: qcom: adm: Propagate reset errors from probe
>
> With fw_devlink=off on IPQ8064, GCC can unbind while ADM is probing.
> If GCC unregisters its reset controller after ADM asserts reset, the
> reset core invalidates the held handles. Deassertion then returns
> -ENODEV. ADM ignores the error and can program its registers and
> register a DMA provider while the block is still in reset. A NAND
> client can then time out waiting for DMA completion.
>
> Check each reset assertion and deassertion and return the first error
> through the existing clock cleanup path, before programming ADM
> registers, requesting the IRQ or registering the DMA provider.
> Keep the reset order and the 2 us delay.
>
> Verification included a source trace of the reset and clock unwind
> paths, a 32-bit ARM qcom_adm.o build with QCOM_ADM, IPQ_GCC_806X and
> RESET_CONTROLLER enabled, git diff --check and checkpatch.
> Runtime and hardware reproduction were not performed.
>
> Fixes: 78ebbff6d1a0 ("reset: handle removing supplier before consumers")
> Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>

[Severity: Low]
Commit 78ebbff6d1a0 ("reset: handle removing supplier before consumers") only
updated the reset core to return -ENODEV when a reset provider is removed.
The unchecked reset_control_assert() and reset_control_deassert() calls in
adm_dma_probe() were introduced when the driver was added.  Should the Fixes
tag point to that commit instead?

  Fixes: 5c9f8c2dbdbe ("dmaengine: qcom: Add ADM driver")

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/179598034305.2.8178651388048278541.pattern-ext-136.24@gmail.com?part=1

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-11-29 19:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 19:25 [PATCH] dmaengine: qcom: adm: Propagate reset errors from probe Jiawen Liu
2026-11-29 19:43 ` sashiko-bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox