From: Jiawen Liu <1298662399@qq.com>
To: Paul Cercueil <paul@crapouillou.net>, Vinod Koul <vkoul@kernel.org>
Cc: Frank Li <Frank.Li@kernel.org>,
linux-mips@vger.kernel.org, dmaengine@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH] dmaengine: jz4780: handle clock enable failures
Date: Sun, 29 Nov 2026 16:53:25 +0400 [thread overview]
Message-ID: <tencent_FA750B9CEA00B77EDF2A0FEA5F8BBE20B509@qq.com> (raw)
jz4780_dma_probe() ignores the result of clk_prepare_enable() and
continues to configure controller registers, request resources, and
register the DMA controller. A parent-clock failure can therefore publish
a controller without a successful clock activation. Later probe cleanup
can also attempt to disable a clock that was never enabled.
Propagate the activation error before touching the controller.
Fixes: d894fc6046fe ("dmaengine: jz4780: add driver for the Ingenic JZ4780 DMA controller")
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
drivers/dma/dma-jz4780.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/dma/dma-jz4780.c b/drivers/dma/dma-jz4780.c
index e610aba094188..c1438bf3336b0 100644
--- a/drivers/dma/dma-jz4780.c
+++ b/drivers/dma/dma-jz4780.c
@@ -902,7 +902,9 @@ static int jz4780_dma_probe(struct platform_device *pdev)
return ret;
}
- clk_prepare_enable(jzdma->clk);
+ ret = clk_prepare_enable(jzdma->clk);
+ if (ret)
+ return dev_err_probe(dev, ret, "failed to enable clock\n");
/* Property is optional, if it doesn't exist the value will remain 0. */
of_property_read_u32_index(dev->of_node, "ingenic,reserved-channels",
--
2.34.1
next reply other threads:[~2026-11-29 14:22 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-29 12:53 Jiawen Liu [this message]
2026-11-29 14:50 ` H. Nikolaus Schaller
2026-11-29 19:10 ` Markus Elfring
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=tencent_FA750B9CEA00B77EDF2A0FEA5F8BBE20B509@qq.com \
--to=1298662399@qq.com \
--cc=Frank.Li@kernel.org \
--cc=dmaengine@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=paul@crapouillou.net \
--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
all inboxes | Powered by JetHome®