* [PATCH] misc: atmel-ssc: handle clock enable failure
@ 2026-08-18 13:22 Jiawen Liu
2026-10-01 11:57 ` Greg Kroah-Hartman
0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Liu @ 2026-08-18 13:22 UTC (permalink / raw)
To: Claudiu Beznea, Andrei Simion, Arnd Bergmann, Greg Kroah-Hartman,
linux-arm-kernel, linux-kernel
Return error from failed clock enable.
ssc_probe ignores clk_prepare_enable return before register writes and
unconditional disable_unprepare. Unchecked prepare/enable may be
unprepared on failure.
Check temporary pclk enable before SSC register access in ssc_probe.
Signed-off-by: jiawen <1298662399@qq.com>
---
diff --git a/drivers/misc/atmel-ssc.c b/drivers/misc/atmel-ssc.c
--- a/drivers/misc/atmel-ssc.c
+++ b/drivers/misc/atmel-ssc.c
@@ -192,6 +192,7 @@
struct resource *regs;
struct ssc_device *ssc;
const struct atmel_ssc_platform_data *plat_dat;
+ int ret;
ssc = devm_kzalloc(&pdev->dev, sizeof(struct ssc_device), GFP_KERNEL);
if (!ssc) {
@@ -225,7 +226,9 @@
}
/* disable all interrupts */
- clk_prepare_enable(ssc->clk);
+ ret = clk_prepare_enable(ssc->clk);
+ if (ret)
+ return ret;
ssc_writel(ssc->regs, IDR, -1);
ssc_readl(ssc->regs, SR);
clk_disable_unprepare(ssc->clk);
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] misc: atmel-ssc: handle clock enable failure
2026-08-18 13:22 [PATCH] misc: atmel-ssc: handle clock enable failure Jiawen Liu
@ 2026-10-01 11:57 ` Greg Kroah-Hartman
0 siblings, 0 replies; 2+ messages in thread
From: Greg Kroah-Hartman @ 2026-10-01 11:57 UTC (permalink / raw)
To: Jiawen Liu
Cc: Claudiu Beznea, Andrei Simion, Arnd Bergmann, linux-arm-kernel,
linux-kernel
On Tue, Aug 18, 2026 at 05:22:40PM +0400, Jiawen Liu wrote:
> Return error from failed clock enable.
>
> ssc_probe ignores clk_prepare_enable return before register writes and
> unconditional disable_unprepare. Unchecked prepare/enable may be
> unprepared on failure.
>
> Check temporary pclk enable before SSC register access in ssc_probe.
>
> Signed-off-by: jiawen <1298662399@qq.com>
Does not match your From: line :(
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-01 12:08 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:22 [PATCH] misc: atmel-ssc: handle clock enable failure Jiawen Liu
2026-10-01 11:57 ` Greg Kroah-Hartman
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®