* [PATCH v2] memory: exynos5422-dmc: handle clock enable failures
@ 2026-09-04 10:01 Jiawen Liu
2026-09-07 8:43 ` Lukasz Luba
2026-09-11 6:55 ` Krzysztof Kozlowski
0 siblings, 2 replies; 3+ messages in thread
From: Jiawen Liu @ 2026-09-04 10:01 UTC (permalink / raw)
To: Lukasz Luba, Krzysztof Kozlowski, Peter Griffin, linux-pm,
linux-samsung-soc, linux-kernel, linux-arm-kernel
Cc: Alim Akhtar, stable, Jiawen Liu
Check the return values of clk_prepare_enable() for fout_bpll and
mout_bpll.
If enabling fout_bpll fails, propagate the error. If enabling mout_bpll
fails, disable fout_bpll before returning. This keeps the clock enable
count balanced on probe error paths.
Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422")
Cc: stable@vger.kernel.org
Signed-off-by: Jiawen Liu <1298662399@qq.com>
---
Changes in v2:
- Use the full author name in From and Signed-off-by.
- Add Fixes and Cc stable tags.
- Generate the submission with git format-patch.
drivers/memory/samsung/exynos5422-dmc.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
index 788d49c688b1..98c319552583 100644
--- a/drivers/memory/samsung/exynos5422-dmc.c
+++ b/drivers/memory/samsung/exynos5422-dmc.c
@@ -1297,8 +1297,15 @@ static int exynos5_dmc_init_clks(struct exynos5_dmc *dmc)
if (ret)
return ret;
- clk_prepare_enable(dmc->fout_bpll);
- clk_prepare_enable(dmc->mout_bpll);
+ ret = clk_prepare_enable(dmc->fout_bpll);
+ if (ret)
+ return ret;
+
+ ret = clk_prepare_enable(dmc->mout_bpll);
+ if (ret) {
+ clk_disable_unprepare(dmc->fout_bpll);
+ return ret;
+ }
/*
* Some bootloaders do not set clock routes correctly.
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH v2] memory: exynos5422-dmc: handle clock enable failures
2026-09-04 10:01 [PATCH v2] memory: exynos5422-dmc: handle clock enable failures Jiawen Liu
@ 2026-09-07 8:43 ` Lukasz Luba
2026-09-11 6:55 ` Krzysztof Kozlowski
1 sibling, 0 replies; 3+ messages in thread
From: Lukasz Luba @ 2026-09-07 8:43 UTC (permalink / raw)
To: Jiawen Liu, Krzysztof Kozlowski, Peter Griffin, linux-pm,
linux-samsung-soc, linux-kernel, linux-arm-kernel
Cc: Alim Akhtar, stable
On 9/4/26 11:01, Jiawen Liu wrote:
> Check the return values of clk_prepare_enable() for fout_bpll and
> mout_bpll.
>
> If enabling fout_bpll fails, propagate the error. If enabling mout_bpll
> fails, disable fout_bpll before returning. This keeps the clock enable
> count balanced on probe error paths.
>
> Fixes: 6e7674c3c6df ("memory: Add DMC driver for Exynos5422")
> Cc: stable@vger.kernel.org
> Signed-off-by: Jiawen Liu <1298662399@qq.com>
> ---
> Changes in v2:
> - Use the full author name in From and Signed-off-by.
> - Add Fixes and Cc stable tags.
> - Generate the submission with git format-patch.
>
> drivers/memory/samsung/exynos5422-dmc.c | 11 +++++++++--
> 1 file changed, 9 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/memory/samsung/exynos5422-dmc.c b/drivers/memory/samsung/exynos5422-dmc.c
> index 788d49c688b1..98c319552583 100644
> --- a/drivers/memory/samsung/exynos5422-dmc.c
> +++ b/drivers/memory/samsung/exynos5422-dmc.c
> @@ -1297,8 +1297,15 @@ static int exynos5_dmc_init_clks(struct exynos5_dmc *dmc)
> if (ret)
> return ret;
>
> - clk_prepare_enable(dmc->fout_bpll);
> - clk_prepare_enable(dmc->mout_bpll);
> + ret = clk_prepare_enable(dmc->fout_bpll);
> + if (ret)
> + return ret;
> +
> + ret = clk_prepare_enable(dmc->mout_bpll);
> + if (ret) {
> + clk_disable_unprepare(dmc->fout_bpll);
> + return ret;
> + }
>
> /*
> * Some bootloaders do not set clock routes correctly.
This one looks good.
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH v2] memory: exynos5422-dmc: handle clock enable failures
2026-09-04 10:01 [PATCH v2] memory: exynos5422-dmc: handle clock enable failures Jiawen Liu
2026-09-07 8:43 ` Lukasz Luba
@ 2026-09-11 6:55 ` Krzysztof Kozlowski
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2026-09-11 6:55 UTC (permalink / raw)
To: Lukasz Luba, Peter Griffin, linux-pm, linux-samsung-soc,
linux-kernel, linux-arm-kernel, Jiawen Liu
Cc: Alim Akhtar, stable
On Fri, 04 Sep 2026 14:01:35 +0400, Jiawen Liu wrote:
> Check the return values of clk_prepare_enable() for fout_bpll and
> mout_bpll.
>
> If enabling fout_bpll fails, propagate the error. If enabling mout_bpll
> fails, disable fout_bpll before returning. This keeps the clock enable
> count balanced on probe error paths.
>
> [...]
Applied, thanks!
[1/1] memory: exynos5422-dmc: handle clock enable failures
https://git.kernel.org/krzk/linux-mem-ctrl/c/cce46902ea9fcd585cd200fffa3166f63bc571f1
Best regards,
--
Krzysztof Kozlowski <krzk@kernel.org>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-09-11 6:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-04 10:01 [PATCH v2] memory: exynos5422-dmc: handle clock enable failures Jiawen Liu
2026-09-07 8:43 ` Lukasz Luba
2026-09-11 6:55 ` Krzysztof Kozlowski
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox