All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] crypto: jh7110-cryp: handle clock enable failures
@ 2026-08-18 13:25 Jiawen Liu
  2026-08-20 11:31 ` Markus Elfring
  0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Liu @ 2026-08-18 13:25 UTC (permalink / raw)
  To: Jia Jie Ho, William Qiu, Herbert Xu, David S. Miller,
	linux-crypto, linux-kernel

Return error from failed clock enable.

starfive_cryp_probe ignores clk_prepare_enable return for hclk/ahb, then
remove/error paths unconditionally clk_disable_unprepare both clocks.

Check consecutive clk_prepare_enable(cryp->hclk)/cryp->ahb returns in
starfive_cryp_probe.

Signed-off-by: jiawen <1298662399@qq.com>
---
diff --git a/drivers/crypto/starfive/jh7110-cryp.c b/drivers/crypto/starfive/jh7110-cryp.c
--- a/drivers/crypto/starfive/jh7110-cryp.c
+++ b/drivers/crypto/starfive/jh7110-cryp.c
@@ -120,8 +120,15 @@
 		return dev_err_probe(&pdev->dev, PTR_ERR(cryp->rst),
 				     "Error getting hardware reset line\n");
 
-	clk_prepare_enable(cryp->hclk);
-	clk_prepare_enable(cryp->ahb);
+	ret = clk_prepare_enable(cryp->hclk);
+	if (ret)
+		return ret;
+
+	ret = clk_prepare_enable(cryp->ahb);
+	if (ret) {
+		clk_disable_unprepare(cryp->hclk);
+		return ret;
+	}
 	reset_control_deassert(cryp->rst);
 
 	spin_lock(&dev_list.lock);


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

* Re: [PATCH] crypto: jh7110-cryp: handle clock enable failures
  2026-08-18 13:25 [PATCH] crypto: jh7110-cryp: handle clock enable failures Jiawen Liu
@ 2026-08-20 11:31 ` Markus Elfring
  0 siblings, 0 replies; 2+ messages in thread
From: Markus Elfring @ 2026-08-20 11:31 UTC (permalink / raw)
  To: 1298662399, linux-crypto, David S. Miller, Herbert Xu, Jia Jie Ho,
	William Qiu
  Cc: LKML, kernel-janitors

…
> Check consecutive clk_prepare_enable(cryp->hclk)/cryp->ahb returns in
> starfive_cryp_probe.

I find such a wording approach improvable.
How do you think about to add any tags (like “Fixes” and “Cc”) accordingly?

See also once more:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/stable-kernel-rules.rst?h=v7.2#n34
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.2#n145
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v7.2#n792

Regards,
Markus

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

end of thread, other threads:[~2026-08-20 11:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-18 13:25 [PATCH] crypto: jh7110-cryp: handle clock enable failures Jiawen Liu
2026-08-20 11:31 ` Markus Elfring

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.