* [PATCH] clk: samsung: exynos-arm64: Propagate CMU resume clock errors
@ 2026-11-29 19:25 Jiawen Liu
2026-11-29 19:42 ` sashiko-bot
0 siblings, 1 reply; 2+ messages in thread
From: Jiawen Liu @ 2026-11-29 19:25 UTC (permalink / raw)
To: Krzysztof Kozlowski, Sylwester Nawrocki, Chanwoo Choi,
Peter Griffin, Stephen Boyd, Brian Masney, Jerome Brunet
Cc: Alim Akhtar, linux-samsung-soc, linux-clk, linux-arm-kernel
When runtime PM resumes a suspended Exynos5433 audio CMU, enabling
fout_aud_pll can return -ETIMEDOUT if the PLL fails to lock. The
resume callback ignores the error and can restore registers without
the required clock. It then reports success to runtime PM, allowing
a later suspend to release a clock reference that resume never acquired.
Return the error from clk_prepare_enable() before enabling temporary
parent clocks or restoring registers. The clock framework rolls back
preparation if enable fails. On success, the callback keeps its clock
reference until suspend.
Verification included static
review of the clock and PM paths, ARM64 builds of the Exynos clock
objects with and without CONFIG_PM_SLEEP, and the kernel patch style
check. Runtime and hardware reproduction were not performed.
Fixes: 523d3de41f02 ("clk: samsung: exynos5433: Add support for runtime PM")
Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>
---
drivers/clk/samsung/clk-exynos-arm64.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/clk/samsung/clk-exynos-arm64.c b/drivers/clk/samsung/clk-exynos-arm64.c
index eac59c8df6fa8..e7e88df15e53a 100644
--- a/drivers/clk/samsung/clk-exynos-arm64.c
+++ b/drivers/clk/samsung/clk-exynos-arm64.c
@@ -359,9 +359,11 @@ int exynos_arm64_cmu_suspend(struct device *dev)
int exynos_arm64_cmu_resume(struct device *dev)
{
struct exynos_arm64_cmu_data *data = dev_get_drvdata(dev);
- int i;
+ int i, ret;
- clk_prepare_enable(data->clk);
+ ret = clk_prepare_enable(data->clk);
+ if (ret)
+ return ret;
for (i = 0; i < data->nr_pclks; i++)
clk_prepare_enable(data->pclks[i]);
--
2.34.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] clk: samsung: exynos-arm64: Propagate CMU resume clock errors
2026-11-29 19:25 [PATCH] clk: samsung: exynos-arm64: Propagate CMU resume clock errors Jiawen Liu
@ 2026-11-29 19:42 ` sashiko-bot
0 siblings, 0 replies; 2+ messages in thread
From: sashiko-bot @ 2026-11-29 19:42 UTC (permalink / raw)
To: Jiawen Liu; +Cc: linux-clk
Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] clk: samsung: ERR_PTR dereference in exynos_arm64_cmu_resume()
[1]
--
commit e3d194f1b1626249b01718daea54f9d69a2fb097
Author: Jiawen Liu <liu1298662399@gmail.com>
clk: samsung: exynos-arm64: Propagate CMU resume clock errors
This commit checks and propagates the return value of clk_prepare_enable()
on data->clk in exynos_arm64_cmu_resume() instead of ignoring errors.
> diff --git a/drivers/clk/samsung/clk-exynos-arm64.c b/drivers/clk/samsung/clk-exynos-arm64.c
> index eac59c8df6fa8..e7e88df15e53a 100644
> --- a/drivers/clk/samsung/clk-exynos-arm64.c
> +++ b/drivers/clk/samsung/clk-exynos-arm64.c
> @@ -359,9 +359,11 @@ int exynos_arm64_cmu_suspend(struct device *dev)
> int exynos_arm64_cmu_resume(struct device *dev)
> {
> struct exynos_arm64_cmu_data *data = dev_get_drvdata(dev);
> - int i;
> + int i, ret;
>
> - clk_prepare_enable(data->clk);
> + ret = clk_prepare_enable(data->clk);
> + if (ret)
> + return ret;
[Severity: High]
This problem wasn't introduced by this patch, but can clk_prepare_enable()
dereference an ERR_PTR in data->clk [1]?
In exynos_arm64_enable_bus_clk(), clk_get() is stored into data->clk
before checking IS_ERR(parent_clk):
drivers/clk/samsung/clk-exynos-arm64.c:exynos_arm64_enable_bus_clk() {
if (dev) {
struct exynos_arm64_cmu_data *data;
parent_clk = clk_get(dev, cmu->clk_name);
data = dev_get_drvdata(dev);
if (data)
data->clk = parent_clk;
}
}
If clk_get() fails, exynos_arm64_register_cmu_pm() logs a warning and
continues registering PM, so a subsequent resume passes the ERR_PTR to
clk_prepare_enable() and crashes.
[1] https://sashiko.dev/#/bug/linux-d237d28a-7387-4379-9bf4-331a7052082c
--
Sashiko AI review · https://sashiko.dev/#/patchset/179598033933.2.16274950563244133260.pattern-ext-106.14@gmail.com?part=1
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-11-29 19:42 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 19:25 [PATCH] clk: samsung: exynos-arm64: Propagate CMU resume clock errors Jiawen Liu
2026-11-29 19:42 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox