* [PATCH] clk: imx31: Skip EMI enable if clock registration fails
@ 2026-11-29 19:25 Jiawen Liu
2026-11-30 2:11 ` Krzysztof Kozlowski
2026-11-30 2:13 ` Peng Fan (OSS)
0 siblings, 2 replies; 3+ messages in thread
From: Jiawen Liu @ 2026-11-29 19:25 UTC (permalink / raw)
To: Abel Vesa, Stephen Boyd, Brian Masney, Jerome Brunet, Frank Li,
Sascha Hauer
Cc: Peng Fan, Pengutronix Kernel Team, Fabio Estevam, linux-clk, imx,
linux-arm-kernel
EMI gate registration can return an error pointer during early i.MX31
device-tree clock initialization. imx_check_clocks() logs the failure,
then _mx31_clocks_init() passes the error pointer to clk_prepare_enable().
clk_prepare() dereferences the pointer, which can fault before the
clock provider is published.
Check the EMI slot with IS_ERR() before enabling it. Keep the
registration error in the onecell table for provider lookups and retain
the boot-time enable reference when registration succeeds.
Statically traced both registration
paths and built clk-imx31.o with LLVM 19 using ARM imx_v6_v7_defconfig
with SMP disabled and i.MX31 enabled. git diff --check and checkpatch
passed. No runtime or hardware reproduction was performed.
Fixes: 95878cbed895 ("ARM i.MX31: implement clocks using common clock framework")
Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>
---
drivers/clk/imx/clk-imx31.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/clk/imx/clk-imx31.c b/drivers/clk/imx/clk-imx31.c
index 962eccac63cea..4511abc2bf7d8 100644
--- a/drivers/clk/imx/clk-imx31.c
+++ b/drivers/clk/imx/clk-imx31.c
@@ -115,7 +115,8 @@ static void __init _mx31_clocks_init(void __iomem *base, unsigned long fref)
imx_check_clocks(clk, ARRAY_SIZE(clk));
clk_set_parent(clk[csi], clk[upll]);
- clk_prepare_enable(clk[emi_gate]);
+ if (!IS_ERR(clk[emi_gate]))
+ clk_prepare_enable(clk[emi_gate]);
clk_prepare_enable(clk[iim_gate]);
mx31_revision();
clk_disable_unprepare(clk[iim_gate]);
--
2.34.1
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH] clk: imx31: Skip EMI enable if clock registration fails
2026-11-29 19:25 [PATCH] clk: imx31: Skip EMI enable if clock registration fails Jiawen Liu
@ 2026-11-30 2:11 ` Krzysztof Kozlowski
2026-11-30 2:13 ` Peng Fan (OSS)
1 sibling, 0 replies; 3+ messages in thread
From: Krzysztof Kozlowski @ 2026-11-30 2:11 UTC (permalink / raw)
To: Jiawen Liu
Cc: Brian Masney, Abel Vesa, Fabio Estevam, Sascha Hauer, Frank Li,
linux-arm-kernel, Stephen Boyd, Jerome Brunet,
Pengutronix Kernel Team, linux-clk, imx, Peng Fan
On Sun, 29 Nov 2026 19:25:33 +0000, Jiawen Liu wrote:
> EMI gate registration can return an error pointer during early i.MX31
> device-tree clock initialization. imx_check_clocks() logs the failure,
> then _mx31_clocks_init() passes the error pointer to clk_prepare_enable().
> clk_prepare() dereferences the pointer, which can fault before the
> clock provider is published.
>
> Check the EMI slot with IS_ERR() before enabling it. Keep the
> registration error in the onecell table for provider lookups and retain
> the boot-time enable reference when registration succeeds.
>
> Statically traced both registration
> paths and built clk-imx31.o with LLVM 19 using ARM imx_v6_v7_defconfig
> with SMP disabled and i.MX31 enabled. git diff --check and checkpatch
> passed. No runtime or hardware reproduction was performed.
>
> Fixes: 95878cbed895 ("ARM i.MX31: implement clocks using common clock framework")
> Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>
> ---
> drivers/clk/imx/clk-imx31.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
You sent multiple independent patches, to multiple independent
subsystems. The amount of these patches clearly suggest this was
AI generated and most likely not tested.
More importantly, you sent all this work without properly organizing
relevant patches into patchsets. This makes reviewing difficult
and might cause multiple reviewers to address the same issue.
Replying to the entire set is impossible and requires handling each
patch independently, instead of applying or discarding the set.
Maintainers also won't see the bigger picture of your work. Quite
worrying.
Please read kernel documentation BEFORE posting more work. It will
explain you how to identify subsystems, how to organize your work per
subsystem (so a patchset grouping multiple patches with a short cover
letter), how to document the issue discovery method and what was
or was not tested.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: [PATCH] clk: imx31: Skip EMI enable if clock registration fails
2026-11-29 19:25 [PATCH] clk: imx31: Skip EMI enable if clock registration fails Jiawen Liu
2026-11-30 2:11 ` Krzysztof Kozlowski
@ 2026-11-30 2:13 ` Peng Fan (OSS)
1 sibling, 0 replies; 3+ messages in thread
From: Peng Fan (OSS) @ 2026-11-30 2:13 UTC (permalink / raw)
To: Jiawen Liu
Cc: Peng Fan, Abel Vesa, Stephen Boyd, Brian Masney, Jerome Brunet,
Frank Li, Sascha Hauer, Peng Fan, Pengutronix Kernel Team,
Fabio Estevam, linux-clk, imx, linux-arm-kernel
On Sun, 29 Nov 2026 19:25:33 +0000 Jiawen Liu <liu1298662399@gmail.com> wrote:
> EMI gate registration can return an error pointer during early i.MX31
> device-tree clock initialization. imx_check_clocks() logs the failure,
> then _mx31_clocks_init() passes the error pointer to clk_prepare_enable().
> clk_prepare() dereferences the pointer, which can fault before the
> clock provider is published.
>
> Check the EMI slot with IS_ERR() before enabling it. Keep the
> registration error in the onecell table for provider lookups and retain
> the boot-time enable reference when registration succeeds.
>
> Statically traced both registration
> paths and built clk-imx31.o with LLVM 19 using ARM imx_v6_v7_defconfig
> with SMP disabled and i.MX31 enabled. git diff --check and checkpatch
> passed. No runtime or hardware reproduction was performed.
>
> Fixes: 95878cbed895 ("ARM i.MX31: implement clocks using common clock framework")
> Signed-off-by: Jiawen Liu <liu1298662399@gmail.com>
> ---
> drivers/clk/imx/clk-imx31.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/clk/imx/clk-imx31.c b/drivers/clk/imx/clk-imx31.c
> index 962eccac63cea..4511abc2bf7d8 100644
> --- a/drivers/clk/imx/clk-imx31.c
> +++ b/drivers/clk/imx/clk-imx31.c
> @@ -115,7 +115,8 @@ static void __init _mx31_clocks_init(void __iomem *base, unsigned long fref)
> imx_check_clocks(clk, ARRAY_SIZE(clk));
>
> clk_set_parent(clk[csi], clk[upll]);
> - clk_prepare_enable(clk[emi_gate]);
> + if (!IS_ERR(clk[emi_gate]))
> + clk_prepare_enable(clk[emi_gate]);
> clk_prepare_enable(clk[iim_gate]);
> mx31_revision();
> clk_disable_unprepare(clk[iim_gate]);
Seems generated by LLM tool and wrong patch.
NAK!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-11-30 2:16 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-29 19:25 [PATCH] clk: imx31: Skip EMI enable if clock registration fails Jiawen Liu
2026-11-30 2:11 ` Krzysztof Kozlowski
2026-11-30 2:13 ` Peng Fan (OSS)
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox