mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "H. Nikolaus Schaller" <hns@goldelico.com>
To: Jiawen Liu <1298662399@qq.com>
Cc: Paul Cercueil <paul@crapouillou.net>,
	Vinod Koul <vkoul@kernel.org>, Frank Li <Frank.Li@kernel.org>,
	linux-mips@vger.kernel.org, dmaengine@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dmaengine: jz4780: handle clock enable failures
Date: Sun, 29 Nov 2026 15:50:30 +0100	[thread overview]
Message-ID: <F3AF96DB-1CA8-4998-8308-98F681DA237E@goldelico.com> (raw)
In-Reply-To: <tencent_FA750B9CEA00B77EDF2A0FEA5F8BBE20B509@qq.com>

Hi,

> Am 29.11.2026 um 13:53 schrieb Jiawen Liu <1298662399@qq.com>:
> 
> 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
> 
> 

there seems to be a patch for a related problem from 2025:

https://linuxtesting.org/pipermail/lvc-project/2025-January/003978.html

It was acked by Paul but I could not find it upstream.

BR,
Nikolaus

  reply	other threads:[~2026-11-29 14:51 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-29 12:53 Jiawen Liu
2026-11-29 14:50 ` H. Nikolaus Schaller [this message]
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=F3AF96DB-1CA8-4998-8308-98F681DA237E@goldelico.com \
    --to=hns@goldelico.com \
    --cc=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®