From: Jiawen Liu <liu1298662399@gmail.com>
To: Vinod Koul <vkoul@kernel.org>
Cc: Frank Li <Frank.Li@kernel.org>,
linux-arm-msm@vger.kernel.org, dmaengine@vger.kernel.org
Subject: [PATCH] dmaengine: qcom: adm: Propagate reset errors from probe
Date: Sun, 29 Nov 2026 19:25:33 +0000 [thread overview]
Message-ID: <179598034305.2.8178651388048278541.pattern-ext-136.24@gmail.com> (raw)
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
reply other threads:[~2026-11-29 19:39 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=179598034305.2.8178651388048278541.pattern-ext-136.24@gmail.com \
--to=liu1298662399@gmail.com \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=vkoul@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