* [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized
2026-08-19 19:05 [PATCH treewide 0/5] clk: Make sure clk_init_data is fully initialized (part 1) Geert Uytterhoeven
@ 2026-08-19 19:05 ` Geert Uytterhoeven
2026-08-19 19:10 ` sashiko-bot
` (3 more replies)
2026-08-19 19:05 ` [PATCH treewide 2/5] clk: visconti: " Geert Uytterhoeven
` (4 subsequent siblings)
5 siblings, 4 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2026-08-19 19:05 UTC (permalink / raw)
To: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck, Michael Hennerich,
Antoniu Miclaus, Jonathan Cameron, David Lechner, Andy Shevchenko,
Sunny Luo, Xianwei Zhao, Mark Brown, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand
Cc: linux-omap, linux-arm-kernel, linux-hwmon, linux, linux-iio,
linux-amlogic, linux-spi, linux-clk, linux-kernel,
Geert Uytterhoeven
The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need. However,
not initializing all members may cause subtle issues, which are only
exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
enabled.
_register_mux() fills in init.parent_data, and assumes that
init.parent_names is NULL. However, the latter in uninitialized, and
thus may cause a crash.
Make sure all members are fully initialized, to fix such bugs, and to
avoid future breakage when converting drivers to a different method for
specifying the parents.
Fixes: 667f420c09f1417c ("clk: ti: mux: resolve parent clocks by DT index, not by name")
Closes: https://lore.kernel.org/CAMuHMdU3yVqoyHC4eNF2NuYo8wy+6ODLoYat4R71X99Mxc_=kw@mail.gmail.com
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/clk/ti/adpll.c | 4 ++--
drivers/clk/ti/divider.c | 2 +-
drivers/clk/ti/mux.c | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/clk/ti/adpll.c b/drivers/clk/ti/adpll.c
index e305fcbac6475b03..8885d28face50beb 100644
--- a/drivers/clk/ti/adpll.c
+++ b/drivers/clk/ti/adpll.c
@@ -483,7 +483,7 @@ static const struct clk_ops ti_adpll_ops = {
static int ti_adpll_init_dco(struct ti_adpll_data *d)
{
- struct clk_init_data init;
+ struct clk_init_data init = {};
struct clk *clock;
const char *postfix;
int width, err;
@@ -576,7 +576,7 @@ static int ti_adpll_init_clkout(struct ti_adpll_data *d,
struct clk *clk1)
{
struct ti_adpll_clkout_data *co;
- struct clk_init_data init;
+ struct clk_init_data init = {};
struct clk_ops *ops;
const char *parent_names[2];
const char *child_name;
diff --git a/drivers/clk/ti/divider.c b/drivers/clk/ti/divider.c
index af923b8cb0ed8fbc..3b438c2d68aacd7c 100644
--- a/drivers/clk/ti/divider.c
+++ b/drivers/clk/ti/divider.c
@@ -311,7 +311,7 @@ static struct clk *_register_divider(struct device_node *node,
u32 flags,
struct clk_omap_divider *div)
{
- struct clk_init_data init;
+ struct clk_init_data init = {};
const char *parent_name;
const char *name;
diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c
index ded4432f7528cc6e..0fef60e82107a5a5 100644
--- a/drivers/clk/ti/mux.c
+++ b/drivers/clk/ti/mux.c
@@ -124,9 +124,9 @@ static struct clk *_register_mux(struct device_node *node, const char *name,
struct clk_omap_reg *reg, u8 shift, u32 mask,
s8 latch, u8 clk_mux_flags, u32 *table)
{
+ struct clk_init_data init = {};
struct clk_omap_mux *mux;
struct clk *clk;
- struct clk_init_data init;
/* allocate the mux */
mux = kzalloc_obj(*mux);
--
2.43.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized Geert Uytterhoeven
@ 2026-08-19 19:10 ` sashiko-bot
2026-08-19 21:21 ` Brian Masney
` (2 subsequent siblings)
3 siblings, 0 replies; 25+ messages in thread
From: sashiko-bot @ 2026-08-19 19:10 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-hwmon, neil.armstrong, linux-clk, linux-amlogic
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> _register_mux() fills in init.parent_data, and assumes that
> init.parent_names is NULL. However, the latter in uninitialized, and
> thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: 667f420c09f1417c ("clk: ti: mux: resolve parent clocks by DT index, not by name")
> Closes: https://lore.kernel.org/CAMuHMdU3yVqoyHC4eNF2NuYo8wy+6ODLoYat4R71X99Mxc_=kw@mail.gmail.com
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787165329.git.geert+renesas@glider.be?part=1
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized Geert Uytterhoeven
2026-08-19 19:10 ` sashiko-bot
@ 2026-08-19 21:21 ` Brian Masney
2026-08-20 5:02 ` Mathieu Dubois-Briand
2026-08-20 5:56 ` Stephen Boyd
3 siblings, 0 replies; 25+ messages in thread
From: Brian Masney @ 2026-08-19 21:21 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck, Michael Hennerich,
Antoniu Miclaus, Jonathan Cameron, David Lechner, Andy Shevchenko,
Sunny Luo, Xianwei Zhao, Mark Brown, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand, linux-omap, linux-arm-kernel, linux-hwmon,
linux, linux-iio, linux-amlogic, linux-spi, linux-clk,
linux-kernel
On Wed, Aug 19, 2026 at 09:05:15PM +0200, Geert Uytterhoeven wrote:
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> _register_mux() fills in init.parent_data, and assumes that
> init.parent_names is NULL. However, the latter in uninitialized, and
> thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: 667f420c09f1417c ("clk: ti: mux: resolve parent clocks by DT index, not by name")
> Closes: https://lore.kernel.org/CAMuHMdU3yVqoyHC4eNF2NuYo8wy+6ODLoYat4R71X99Mxc_=kw@mail.gmail.com
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Brian Masney <bmasney@redhat.com>
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized Geert Uytterhoeven
2026-08-19 19:10 ` sashiko-bot
2026-08-19 21:21 ` Brian Masney
@ 2026-08-20 5:02 ` Mathieu Dubois-Briand
2026-08-20 5:56 ` Stephen Boyd
3 siblings, 0 replies; 25+ messages in thread
From: Mathieu Dubois-Briand @ 2026-08-20 5:02 UTC (permalink / raw)
To: Geert Uytterhoeven, Tero Kristo, Stephen Boyd, Brian Masney,
Jerome Brunet, Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck,
Michael Hennerich, Antoniu Miclaus, Jonathan Cameron,
David Lechner, Andy Shevchenko, Sunny Luo, Xianwei Zhao,
Mark Brown, Kees Cook, Kevin Hilman
Cc: linux-omap, linux-arm-kernel, linux-hwmon, linux, linux-iio,
linux-amlogic, linux-spi, linux-clk, linux-kernel
On Wed Aug 19, 2026 at 9:05 PM CEST, Geert Uytterhoeven wrote:
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> _register_mux() fills in init.parent_data, and assumes that
> init.parent_names is NULL. However, the latter in uninitialized, and
> thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: 667f420c09f1417c ("clk: ti: mux: resolve parent clocks by DT index, not by name")
> Closes: https://lore.kernel.org/CAMuHMdU3yVqoyHC4eNF2NuYo8wy+6ODLoYat4R71X99Mxc_=kw@mail.gmail.com
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
Reviewed-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Thanks again for the fix.
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized Geert Uytterhoeven
` (2 preceding siblings ...)
2026-08-20 5:02 ` Mathieu Dubois-Briand
@ 2026-08-20 5:56 ` Stephen Boyd
3 siblings, 0 replies; 25+ messages in thread
From: Stephen Boyd @ 2026-08-20 5:56 UTC (permalink / raw)
To: Andy Shevchenko, Antoniu Miclaus, Brian Masney, David Lechner,
Geert Uytterhoeven, Guenter Roeck, Jerome Brunet,
Jonathan Cameron, Kees Cook, Kevin Hilman, Mark Brown,
Mathieu Dubois-Briand, Michael Hennerich, Nobuhiro Iwamatsu,
Nuno Sa, Sunny Luo, Tero Kristo, Xianwei Zhao
Cc: linux-omap, linux-arm-kernel, linux-hwmon, linux, linux-iio,
linux-amlogic, linux-spi, linux-clk, linux-kernel,
Geert Uytterhoeven
Quoting Geert Uytterhoeven (2026-08-19 12:05:15)
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> _register_mux() fills in init.parent_data, and assumes that
> init.parent_names is NULL. However, the latter in uninitialized, and
> thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: 667f420c09f1417c ("clk: ti: mux: resolve parent clocks by DT index, not by name")
> Closes: https://lore.kernel.org/CAMuHMdU3yVqoyHC4eNF2NuYo8wy+6ODLoYat4R71X99Mxc_=kw@mail.gmail.com
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH treewide 2/5] clk: visconti: Make sure clk_init_data is fully initialized
2026-08-19 19:05 [PATCH treewide 0/5] clk: Make sure clk_init_data is fully initialized (part 1) Geert Uytterhoeven
2026-08-19 19:05 ` [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized Geert Uytterhoeven
@ 2026-08-19 19:05 ` Geert Uytterhoeven
2026-08-19 19:14 ` sashiko-bot
` (3 more replies)
2026-08-19 19:05 ` [PATCH treewide 3/5] hwmon: (ltc4282) " Geert Uytterhoeven
` (3 subsequent siblings)
5 siblings, 4 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2026-08-19 19:05 UTC (permalink / raw)
To: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck, Michael Hennerich,
Antoniu Miclaus, Jonathan Cameron, David Lechner, Andy Shevchenko,
Sunny Luo, Xianwei Zhao, Mark Brown, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand
Cc: linux-omap, linux-arm-kernel, linux-hwmon, linux, linux-iio,
linux-amlogic, linux-spi, linux-clk, linux-kernel,
Geert Uytterhoeven
The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need. However,
not initializing all members may cause subtle issues, which are only
exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
enabled.
visconti_clk_register_gate() fills in init.parent_data, and assumes that
init.parent_names is NULL. However, the latter in uninitialized, and
thus may cause a crash.
Make sure all members are fully initialized, to fix such bugs, and to
avoid future breakage when converting drivers to a different method for
specifying the parents.
Fixes: b4cbe606dc3674b2 ("clk: visconti: Add support common clock driver and reset driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
drivers/clk/visconti/clkc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/clk/visconti/clkc.c b/drivers/clk/visconti/clkc.c
index d0b193b5d0b35f94..4018d1298880dfbb 100644
--- a/drivers/clk/visconti/clkc.c
+++ b/drivers/clk/visconti/clkc.c
@@ -81,9 +81,9 @@ static struct clk_hw *visconti_clk_register_gate(struct device *dev,
u8 rs_idx,
spinlock_t *lock)
{
+ struct clk_init_data init = {};
struct visconti_clk_gate *gate;
struct clk_parent_data *pdata;
- struct clk_init_data init;
struct clk_hw *hw;
int ret;
--
2.43.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH treewide 2/5] clk: visconti: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 2/5] clk: visconti: " Geert Uytterhoeven
@ 2026-08-19 19:14 ` sashiko-bot
2026-08-19 21:21 ` Brian Masney
` (2 subsequent siblings)
3 siblings, 0 replies; 25+ messages in thread
From: sashiko-bot @ 2026-08-19 19:14 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-clk, neil.armstrong, linux-amlogic, linux-hwmon
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] visconti_reset_status() incorrectly uses the bit index directly instead of a bitmask, resulting in corrupted status checks.
--
--- Patch [2]: [PATCH treewide 2/5] clk: visconti: Make sure clk_init_data is fully initialized ---
commit 61772ea3c610a3b3ebf435b199e400c1c5aaee4c
Author: Geert Uytterhoeven <geert+renesas@glider.be>
clk: visconti: Make sure clk_init_data is fully initialized
The clk_init_data structure contains several mutually-exclusive members for
different methods to specify the possible parents of a clock. Not
initializing all members may cause subtle issues when uninitialized members
are unexpectedly accessed. This commit ensures all members are fully
initialized to zero.
> diff --git a/drivers/clk/visconti/clkc.c b/drivers/clk/visconti/clkc.c
> index d0b193b5d0b35..4018d1298880d 100644
> --- a/drivers/clk/visconti/clkc.c
> +++ b/drivers/clk/visconti/clkc.c
> @@ -81,9 +81,9 @@ static struct clk_hw *visconti_clk_register_gate(struct device *dev,
> u8 rs_idx,
> spinlock_t *lock)
> {
> + struct clk_init_data init = {};
> struct visconti_clk_gate *gate;
> struct clk_parent_data *pdata;
> - struct clk_init_data init;
> struct clk_hw *hw;
> int ret;
>
[Severity: High]
This is a pre-existing issue, but while reviewing the visconti clock and
reset driver changes, I noticed a potential problem with how rs_idx is used.
In drivers/clk/visconti/reset.c:visconti_reset_status():
spin_lock_irqsave(reset->lock, flags);
ret = regmap_read(reset->regmap, data->rson_offset, ®);
spin_unlock_irqrestore(reset->lock, flags);
if (ret)
return ret;
return !(reg & data->rs_idx);
Is this reset status check operating as intended? Since rs_idx is a raw bit
index (0-31), would it be more accurate to mask the register with
BIT(data->rs_idx) rather than the raw index value?
Masking with the raw index seems like it could produce incorrect status
returns. For example, if rs_idx is 0, the mask would always evaluate to 0.
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787165329.git.geert+renesas@glider.be?part=2
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH treewide 2/5] clk: visconti: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 2/5] clk: visconti: " Geert Uytterhoeven
2026-08-19 19:14 ` sashiko-bot
@ 2026-08-19 21:21 ` Brian Masney
2026-08-20 2:03 ` nobuhiro.iwamatsu.x90
2026-08-20 5:56 ` Stephen Boyd
3 siblings, 0 replies; 25+ messages in thread
From: Brian Masney @ 2026-08-19 21:21 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck, Michael Hennerich,
Antoniu Miclaus, Jonathan Cameron, David Lechner, Andy Shevchenko,
Sunny Luo, Xianwei Zhao, Mark Brown, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand, linux-omap, linux-arm-kernel, linux-hwmon,
linux, linux-iio, linux-amlogic, linux-spi, linux-clk,
linux-kernel
On Wed, Aug 19, 2026 at 09:05:16PM +0200, Geert Uytterhoeven wrote:
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> visconti_clk_register_gate() fills in init.parent_data, and assumes that
> init.parent_names is NULL. However, the latter in uninitialized, and
> thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: b4cbe606dc3674b2 ("clk: visconti: Add support common clock driver and reset driver")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Brian Masney <bmasney@redhat.com>
^ permalink raw reply [flat|nested] 25+ messages in thread* RE: [PATCH treewide 2/5] clk: visconti: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 2/5] clk: visconti: " Geert Uytterhoeven
2026-08-19 19:14 ` sashiko-bot
2026-08-19 21:21 ` Brian Masney
@ 2026-08-20 2:03 ` nobuhiro.iwamatsu.x90
2026-08-20 5:56 ` Stephen Boyd
3 siblings, 0 replies; 25+ messages in thread
From: nobuhiro.iwamatsu.x90 @ 2026-08-20 2:03 UTC (permalink / raw)
To: geert+renesas, kristo, sboyd, bmasney+clk, jbrunet+clk, nuno.sa,
linux, Michael.Hennerich, antoniu.miclaus, jic23, dlechner, andy,
sunny.luo, xianwei.zhao, broonie, kees, khilman,
mathieu.dubois-briand
Cc: linux-omap, linux-arm-kernel, linux-hwmon, linux, linux-iio,
linux-amlogic, linux-spi, linux-clk, linux-kernel
> -----Original Message-----
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Sent: Thursday, August 20, 2026 4:05 AM
> To: Tero Kristo <kristo@kernel.org>; Stephen Boyd <sboyd@kernel.org>; Brian
> Masney <bmasney+clk@redhat.com>; Jerome Brunet
> <jbrunet+clk@baylibre.com>; iwamatsu nobuhiro(岩松 信洋 □DITC○C
> PT) <nobuhiro.iwamatsu.x90@mail.toshiba>; Nuno Sa
> <nuno.sa@analog.com>; Guenter Roeck <linux@roeck-us.net>; Michael
> Hennerich <Michael.Hennerich@analog.com>; Antoniu Miclaus
> <antoniu.miclaus@analog.com>; Jonathan Cameron <jic23@kernel.org>;
> David Lechner <dlechner@baylibre.com>; Andy Shevchenko
> <andy@kernel.org>; Sunny Luo <sunny.luo@amlogic.com>; Xianwei Zhao
> <xianwei.zhao@amlogic.com>; Mark Brown <broonie@kernel.org>; Kees
> Cook <kees@kernel.org>; Kevin Hilman <khilman@baylibre.com>; Mathieu
> Dubois-Briand <mathieu.dubois-briand@bootlin.com>
> Cc: linux-omap@vger.kernel.org; linux-arm-kernel@lists.infradead.org;
> linux-hwmon@vger.kernel.org; linux@analog.com; linux-iio@vger.kernel.org;
> linux-amlogic@lists.infradead.org; linux-spi@vger.kernel.org;
> linux-clk@vger.kernel.org; linux-kernel@vger.kernel.org; Geert Uytterhoeven
> <geert+renesas@glider.be>
> Subject: [PATCH treewide 2/5] clk: visconti: Make sure clk_init_data is fully
> initialized
>
> The clk_init_data structure contains several mutually-exclusive members for
> different methods to specify the possible parents of a clock, prompting drivers
> to initialize only the members they need. However, not initializing all members
> may cause subtle issues, which are only exposed when
> CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> visconti_clk_register_gate() fills in init.parent_data, and assumes that
> init.parent_names is NULL. However, the latter in uninitialized, and thus may
> cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to avoid future
> breakage when converting drivers to a different method for specifying the
> parents.
>
> Fixes: b4cbe606dc3674b2 ("clk: visconti: Add support common clock driver
> and reset driver")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.x90@mail.toshiba>
Best regards,
Nobuhiro
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH treewide 2/5] clk: visconti: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 2/5] clk: visconti: " Geert Uytterhoeven
` (2 preceding siblings ...)
2026-08-20 2:03 ` nobuhiro.iwamatsu.x90
@ 2026-08-20 5:56 ` Stephen Boyd
3 siblings, 0 replies; 25+ messages in thread
From: Stephen Boyd @ 2026-08-20 5:56 UTC (permalink / raw)
To: Andy Shevchenko, Antoniu Miclaus, Brian Masney, David Lechner,
Geert Uytterhoeven, Guenter Roeck, Jerome Brunet,
Jonathan Cameron, Kees Cook, Kevin Hilman, Mark Brown,
Mathieu Dubois-Briand, Michael Hennerich, Nobuhiro Iwamatsu,
Nuno Sa, Sunny Luo, Tero Kristo, Xianwei Zhao
Cc: linux-omap, linux-arm-kernel, linux-hwmon, linux, linux-iio,
linux-amlogic, linux-spi, linux-clk, linux-kernel,
Geert Uytterhoeven
Quoting Geert Uytterhoeven (2026-08-19 12:05:16)
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> visconti_clk_register_gate() fills in init.parent_data, and assumes that
> init.parent_names is NULL. However, the latter in uninitialized, and
> thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: b4cbe606dc3674b2 ("clk: visconti: Add support common clock driver and reset driver")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
Applied to clk-next
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH treewide 3/5] hwmon: (ltc4282) Make sure clk_init_data is fully initialized
2026-08-19 19:05 [PATCH treewide 0/5] clk: Make sure clk_init_data is fully initialized (part 1) Geert Uytterhoeven
2026-08-19 19:05 ` [PATCH treewide 1/5] clk: ti: Make sure clk_init_data is fully initialized Geert Uytterhoeven
2026-08-19 19:05 ` [PATCH treewide 2/5] clk: visconti: " Geert Uytterhoeven
@ 2026-08-19 19:05 ` Geert Uytterhoeven
2026-08-19 19:12 ` sashiko-bot
` (2 more replies)
2026-08-19 19:05 ` [PATCH treewide 4/5] iio: frequency: adf4377: " Geert Uytterhoeven
` (2 subsequent siblings)
5 siblings, 3 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2026-08-19 19:05 UTC (permalink / raw)
To: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck, Michael Hennerich,
Antoniu Miclaus, Jonathan Cameron, David Lechner, Andy Shevchenko,
Sunny Luo, Xianwei Zhao, Mark Brown, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand
Cc: linux-omap, linux-arm-kernel, linux-hwmon, linux, linux-iio,
linux-amlogic, linux-spi, linux-clk, linux-kernel,
Geert Uytterhoeven
The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need. However,
not initializing all members may cause subtle issues, which are only
exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
enabled.
ltc428_clk_provider_setup() does not fill in any parent clocks, and
assumes that init.num_parents is NULL. However, the latter in
uninitialized, and thus may cause a crash.
Make sure all members are fully initialized, to fix such bugs, and to
avoid future breakage when converting drivers to a different method for
specifying the parents.
Fixes: cbc29538dbf7d740 ("hwmon: Add driver for LTC4282")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
drivers/hwmon/ltc4282.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hwmon/ltc4282.c b/drivers/hwmon/ltc4282.c
index b1675dc5b3c7fd2f..54ba4b8542e94b7b 100644
--- a/drivers/hwmon/ltc4282.c
+++ b/drivers/hwmon/ltc4282.c
@@ -1106,7 +1106,7 @@ static const struct clk_ops ltc4282_ops = {
static int ltc428_clk_provider_setup(struct ltc4282_state *st,
struct device *dev)
{
- struct clk_init_data init;
+ struct clk_init_data init = {};
int ret;
if (!IS_ENABLED(CONFIG_COMMON_CLK))
--
2.43.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH treewide 3/5] hwmon: (ltc4282) Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 3/5] hwmon: (ltc4282) " Geert Uytterhoeven
@ 2026-08-19 19:12 ` sashiko-bot
2026-08-19 20:32 ` Guenter Roeck
2026-08-19 21:22 ` Brian Masney
2 siblings, 0 replies; 25+ messages in thread
From: sashiko-bot @ 2026-08-19 19:12 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-clk, neil.armstrong, linux-amlogic, linux-hwmon
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> ltc428_clk_provider_setup() does not fill in any parent clocks, and
> assumes that init.num_parents is NULL. However, the latter in
> uninitialized, and thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: cbc29538dbf7d740 ("hwmon: Add driver for LTC4282")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787165329.git.geert+renesas@glider.be?part=3
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH treewide 3/5] hwmon: (ltc4282) Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 3/5] hwmon: (ltc4282) " Geert Uytterhoeven
2026-08-19 19:12 ` sashiko-bot
@ 2026-08-19 20:32 ` Guenter Roeck
2026-08-19 21:22 ` Brian Masney
2 siblings, 0 replies; 25+ messages in thread
From: Guenter Roeck @ 2026-08-19 20:32 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Michael Hennerich, Antoniu Miclaus,
Jonathan Cameron, David Lechner, Andy Shevchenko, Sunny Luo,
Xianwei Zhao, Mark Brown, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand, linux-omap, linux-arm-kernel, linux-hwmon,
linux, linux-iio, linux-amlogic, linux-spi, linux-clk,
linux-kernel
On Wed, Aug 19, 2026 at 09:05:17PM +0200, Geert Uytterhoeven wrote:
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> ltc428_clk_provider_setup() does not fill in any parent clocks, and
> assumes that init.num_parents is NULL. However, the latter in
> uninitialized, and thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: cbc29538dbf7d740 ("hwmon: Add driver for LTC4282")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Applied.
Thanks,
Guenter
> ---
> Compile-tested only.
> ---
> drivers/hwmon/ltc4282.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/hwmon/ltc4282.c b/drivers/hwmon/ltc4282.c
> index b1675dc5b3c7fd2f..54ba4b8542e94b7b 100644
> --- a/drivers/hwmon/ltc4282.c
> +++ b/drivers/hwmon/ltc4282.c
> @@ -1106,7 +1106,7 @@ static const struct clk_ops ltc4282_ops = {
> static int ltc428_clk_provider_setup(struct ltc4282_state *st,
> struct device *dev)
> {
> - struct clk_init_data init;
> + struct clk_init_data init = {};
> int ret;
>
> if (!IS_ENABLED(CONFIG_COMMON_CLK))
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH treewide 3/5] hwmon: (ltc4282) Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 3/5] hwmon: (ltc4282) " Geert Uytterhoeven
2026-08-19 19:12 ` sashiko-bot
2026-08-19 20:32 ` Guenter Roeck
@ 2026-08-19 21:22 ` Brian Masney
2 siblings, 0 replies; 25+ messages in thread
From: Brian Masney @ 2026-08-19 21:22 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck, Michael Hennerich,
Antoniu Miclaus, Jonathan Cameron, David Lechner, Andy Shevchenko,
Sunny Luo, Xianwei Zhao, Mark Brown, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand, linux-omap, linux-arm-kernel, linux-hwmon,
linux, linux-iio, linux-amlogic, linux-spi, linux-clk,
linux-kernel
On Wed, Aug 19, 2026 at 09:05:17PM +0200, Geert Uytterhoeven wrote:
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> ltc428_clk_provider_setup() does not fill in any parent clocks, and
> assumes that init.num_parents is NULL. However, the latter in
> uninitialized, and thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: cbc29538dbf7d740 ("hwmon: Add driver for LTC4282")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Brian Masney <bmasney@redhat.com>
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH treewide 4/5] iio: frequency: adf4377: Make sure clk_init_data is fully initialized
2026-08-19 19:05 [PATCH treewide 0/5] clk: Make sure clk_init_data is fully initialized (part 1) Geert Uytterhoeven
` (2 preceding siblings ...)
2026-08-19 19:05 ` [PATCH treewide 3/5] hwmon: (ltc4282) " Geert Uytterhoeven
@ 2026-08-19 19:05 ` Geert Uytterhoeven
2026-08-19 19:13 ` sashiko-bot
2026-08-19 21:22 ` Brian Masney
2026-08-19 19:05 ` [PATCH treewide 5/5] spi: amlogic-spisg: " Geert Uytterhoeven
2026-08-20 12:11 ` (subset) [PATCH treewide 0/5] clk: Make sure clk_init_data is fully initialized (part 1) Mark Brown
5 siblings, 2 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2026-08-19 19:05 UTC (permalink / raw)
To: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck, Michael Hennerich,
Antoniu Miclaus, Jonathan Cameron, David Lechner, Andy Shevchenko,
Sunny Luo, Xianwei Zhao, Mark Brown, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand
Cc: linux-omap, linux-arm-kernel, linux-hwmon, linux, linux-iio,
linux-amlogic, linux-spi, linux-clk, linux-kernel,
Geert Uytterhoeven
The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need. However,
not initializing all members may cause subtle issues, which are only
exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
enabled.
adf4377_clk_register() fills in init.parent_data, and assumes that
init.parent_names is NULL. However, the latter in uninitialized, and
thus may cause a crash.
Make sure all members are fully initialized, to fix such bugs, and to
avoid future breakage when converting drivers to a different method for
specifying the parents.
Fixes: 60e5448ddbec2dc2 ("iio: frequency: adf4377: add clk provider support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
drivers/iio/frequency/adf4377.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/frequency/adf4377.c b/drivers/iio/frequency/adf4377.c
index 4dd19a9aa9943c57..f4eb9ba5878e1893 100644
--- a/drivers/iio/frequency/adf4377.c
+++ b/drivers/iio/frequency/adf4377.c
@@ -990,7 +990,7 @@ static int adf4377_clk_register(struct adf4377_state *st)
{
struct spi_device *spi = st->spi;
struct device *dev = &spi->dev;
- struct clk_init_data init;
+ struct clk_init_data init = {};
struct clk_parent_data parent_data;
int ret;
--
2.43.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH treewide 4/5] iio: frequency: adf4377: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 4/5] iio: frequency: adf4377: " Geert Uytterhoeven
@ 2026-08-19 19:13 ` sashiko-bot
2026-08-20 7:40 ` Geert Uytterhoeven
2026-08-19 21:22 ` Brian Masney
1 sibling, 1 reply; 25+ messages in thread
From: sashiko-bot @ 2026-08-19 19:13 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-amlogic, linux-clk, neil.armstrong, linux-hwmon
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
Pre-existing issues:
- [High] Incomplete fix for uninitialized stack variables: `struct clk_parent_data parent_data` remains uninitialized on the stack, leading to a kernel crash during clock registration.
--
--- Patch [4]: [PATCH treewide 4/5] iio: frequency: adf4377: Make sure clk_init_data is fully initialized ---
commit 99e024a77f5bce5921d3c6b46054263aa450610d
Author: Geert Uytterhoeven <geert+renesas@glider.be>
iio: frequency: adf4377: Make sure clk_init_data is fully initialized
This commit initializes the clk_init_data structure in
adf4377_clk_register() to zero. This prevents crashes caused by
uninitialized fields like parent_names when CONFIG_INIT_STACK_ALL_PATTERN
or CONFIG_INIT_STACK_NONE is enabled.
> diff --git a/drivers/iio/frequency/adf4377.c b/drivers/iio/frequency/adf4377.c
> --- a/drivers/iio/frequency/adf4377.c
> +++ b/drivers/iio/frequency/adf4377.c
> @@ -999,7 +999,7 @@ static int adf4377_clk_register(struct adf4377_state *st)
> {
> struct spi_device *spi = st->spi;
> struct device *dev = &spi->dev;
> - struct clk_init_data init;
> + struct clk_init_data init = {};
> struct clk_parent_data parent_data;
[Severity: High]
This is a pre-existing issue, but does this struct clk_parent_data also
need to be zero-initialized?
Only fw_name is explicitly assigned below, leaving name, hw, and index
populated with stack garbage. When adf4377_clk_register() passes this to
the clock framework, clk_core_populate_parent_map() will read
parent_data.name and pass it to clk_cpy_name(), which ultimately calls
strlen() and can cause a page fault during probe.
[ ... ]
> parent_data.fw_name = "ref_in";
>
> init.ops = &adf4377_clk_ops;
> init.parent_data = &parent_data;
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787165329.git.geert+renesas@glider.be?part=4
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH treewide 4/5] iio: frequency: adf4377: Make sure clk_init_data is fully initialized
2026-08-19 19:13 ` sashiko-bot
@ 2026-08-20 7:40 ` Geert Uytterhoeven
0 siblings, 0 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2026-08-20 7:40 UTC (permalink / raw)
To: sashiko-reviews
Cc: linux-amlogic, linux-clk, neil.armstrong, linux-hwmon,
Jonathan Cameron
Hi Sashiko,
On Wed, 19 Aug 2026 at 21:13, <sashiko-bot@kernel.org> wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
>
> Pre-existing issues:
> - [High] Incomplete fix for uninitialized stack variables: `struct clk_parent_data parent_data` remains uninitialized on the stack, leading to a kernel crash during clock registration.
> --
>
> --- Patch [4]: [PATCH treewide 4/5] iio: frequency: adf4377: Make sure clk_init_data is fully initialized ---
> commit 99e024a77f5bce5921d3c6b46054263aa450610d
> Author: Geert Uytterhoeven <geert+renesas@glider.be>
>
> iio: frequency: adf4377: Make sure clk_init_data is fully initialized
>
> This commit initializes the clk_init_data structure in
> adf4377_clk_register() to zero. This prevents crashes caused by
> uninitialized fields like parent_names when CONFIG_INIT_STACK_ALL_PATTERN
> or CONFIG_INIT_STACK_NONE is enabled.
>
> > diff --git a/drivers/iio/frequency/adf4377.c b/drivers/iio/frequency/adf4377.c
> > --- a/drivers/iio/frequency/adf4377.c
> > +++ b/drivers/iio/frequency/adf4377.c
> > @@ -999,7 +999,7 @@ static int adf4377_clk_register(struct adf4377_state *st)
> > {
> > struct spi_device *spi = st->spi;
> > struct device *dev = &spi->dev;
> > - struct clk_init_data init;
> > + struct clk_init_data init = {};
> > struct clk_parent_data parent_data;
>
> [Severity: High]
> This is a pre-existing issue, but does this struct clk_parent_data also
> need to be zero-initialized?
>
> Only fw_name is explicitly assigned below, leaving name, hw, and index
> populated with stack garbage. When adf4377_clk_register() passes this to
> the clock framework, clk_core_populate_parent_map() will read
> parent_data.name and pass it to clk_cpy_name(), which ultimately calls
> strlen() and can cause a page fault during probe.
Yes, parent_data has the same issue.
As Jonathan will rebase against rc1 anyway, I will send a v2.
Thanks!
>
> [ ... ]
>
> > parent_data.fw_name = "ref_in";
> >
> > init.ops = &adf4377_clk_ops;
> > init.parent_data = &parent_data;
>
> --
> Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787165329.git.geert+renesas@glider.be?part=4
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [PATCH treewide 4/5] iio: frequency: adf4377: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 4/5] iio: frequency: adf4377: " Geert Uytterhoeven
2026-08-19 19:13 ` sashiko-bot
@ 2026-08-19 21:22 ` Brian Masney
2026-08-20 1:38 ` Jonathan Cameron
1 sibling, 1 reply; 25+ messages in thread
From: Brian Masney @ 2026-08-19 21:22 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck, Michael Hennerich,
Antoniu Miclaus, Jonathan Cameron, David Lechner, Andy Shevchenko,
Sunny Luo, Xianwei Zhao, Mark Brown, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand, linux-omap, linux-arm-kernel, linux-hwmon,
linux, linux-iio, linux-amlogic, linux-spi, linux-clk,
linux-kernel
On Wed, Aug 19, 2026 at 09:05:18PM +0200, Geert Uytterhoeven wrote:
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> adf4377_clk_register() fills in init.parent_data, and assumes that
> init.parent_names is NULL. However, the latter in uninitialized, and
> thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: 60e5448ddbec2dc2 ("iio: frequency: adf4377: add clk provider support")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Brian Masney <bmasney@redhat.com>
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH treewide 4/5] iio: frequency: adf4377: Make sure clk_init_data is fully initialized
2026-08-19 21:22 ` Brian Masney
@ 2026-08-20 1:38 ` Jonathan Cameron
0 siblings, 0 replies; 25+ messages in thread
From: Jonathan Cameron @ 2026-08-20 1:38 UTC (permalink / raw)
To: Brian Masney
Cc: Geert Uytterhoeven, Tero Kristo, Stephen Boyd, Brian Masney,
Jerome Brunet, Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck,
Michael Hennerich, Antoniu Miclaus, David Lechner,
Andy Shevchenko, Sunny Luo, Xianwei Zhao, Mark Brown, Kees Cook,
Kevin Hilman, Mathieu Dubois-Briand, linux-omap, linux-arm-kernel,
linux-hwmon, linux, linux-iio, linux-amlogic, linux-spi,
linux-clk, linux-kernel
On Wed, 19 Aug 2026 17:22:41 -0400
Brian Masney <bmasney@redhat.com> wrote:
> On Wed, Aug 19, 2026 at 09:05:18PM +0200, Geert Uytterhoeven wrote:
> > The clk_init_data structure contains several mutually-exclusive members
> > for different methods to specify the possible parents of a clock,
> > prompting drivers to initialize only the members they need. However,
> > not initializing all members may cause subtle issues, which are only
> > exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> > enabled.
> >
> > adf4377_clk_register() fills in init.parent_data, and assumes that
> > init.parent_names is NULL. However, the latter in uninitialized, and
> > thus may cause a crash.
> >
> > Make sure all members are fully initialized, to fix such bugs, and to
> > avoid future breakage when converting drivers to a different method for
> > specifying the parents.
> >
> > Fixes: 60e5448ddbec2dc2 ("iio: frequency: adf4377: add clk provider support")
> > Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
>
> Reviewed-by: Brian Masney <bmasney@redhat.com>
>
Applied to the fixes-togreg branch of iio.git
I'll rebase on rc1 before sending a pull request (so waiting for that
to be available)
Thanks,
Jonathan
^ permalink raw reply [flat|nested] 25+ messages in thread
* [PATCH treewide 5/5] spi: amlogic-spisg: Make sure clk_init_data is fully initialized
2026-08-19 19:05 [PATCH treewide 0/5] clk: Make sure clk_init_data is fully initialized (part 1) Geert Uytterhoeven
` (3 preceding siblings ...)
2026-08-19 19:05 ` [PATCH treewide 4/5] iio: frequency: adf4377: " Geert Uytterhoeven
@ 2026-08-19 19:05 ` Geert Uytterhoeven
2026-08-19 19:13 ` sashiko-bot
` (2 more replies)
2026-08-20 12:11 ` (subset) [PATCH treewide 0/5] clk: Make sure clk_init_data is fully initialized (part 1) Mark Brown
5 siblings, 3 replies; 25+ messages in thread
From: Geert Uytterhoeven @ 2026-08-19 19:05 UTC (permalink / raw)
To: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck, Michael Hennerich,
Antoniu Miclaus, Jonathan Cameron, David Lechner, Andy Shevchenko,
Sunny Luo, Xianwei Zhao, Mark Brown, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand
Cc: linux-omap, linux-arm-kernel, linux-hwmon, linux, linux-iio,
linux-amlogic, linux-spi, linux-clk, linux-kernel,
Geert Uytterhoeven
The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need. However,
not initializing all members may cause subtle issues, which are only
exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
enabled.
aml_spisg_clk_init() fills in init.parent_data, and assumes that
init.parent_names is NULL. However, the latter in uninitialized, and
thus may cause a crash.
Make sure all members are fully initialized, to fix such bugs, and to
avoid future breakage when converting drivers to a different method for
specifying the parents.
Fixes: cef9991e04aed330 ("spi: Add Amlogic SPISG driver")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
drivers/spi/spi-amlogic-spisg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/spi/spi-amlogic-spisg.c b/drivers/spi/spi-amlogic-spisg.c
index afc8af04638d3b6e..9049a87e9d0f2df6 100644
--- a/drivers/spi/spi-amlogic-spisg.c
+++ b/drivers/spi/spi-amlogic-spisg.c
@@ -636,7 +636,7 @@ static int aml_spisg_target_abort(struct spi_controller *ctlr)
static int aml_spisg_clk_init(struct spisg_device *spisg, void __iomem *base)
{
struct device *dev = &spisg->pdev->dev;
- struct clk_init_data init;
+ struct clk_init_data init = {};
struct clk_divider *div;
struct clk_div_table *tbl;
char name[32];
--
2.43.0
^ permalink raw reply related [flat|nested] 25+ messages in thread* Re: [PATCH treewide 5/5] spi: amlogic-spisg: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 5/5] spi: amlogic-spisg: " Geert Uytterhoeven
@ 2026-08-19 19:13 ` sashiko-bot
2026-08-19 21:23 ` Brian Masney
2026-08-20 8:49 ` Xianwei Zhao
2 siblings, 0 replies; 25+ messages in thread
From: sashiko-bot @ 2026-08-19 19:13 UTC (permalink / raw)
To: Geert Uytterhoeven; +Cc: linux-clk, neil.armstrong, linux-hwmon, linux-amlogic
Thank you for your contribution! Sashiko AI review found 2 potential issue(s) to consider:
Pre-existing issues:
- [High] Severe imbalance in clock prepare/enable counts for `pclk` and `core` clocks, leading to negative enable counts and warnings during driver probe failure or removal.
- [High] Missing cleanup for runtime PM and `sclk` clock on the probe error path and module removal.
--
--- Patch [5]: [PATCH treewide 5/5] spi: amlogic-spisg: Make sure clk_init_data is fully initialized ---
commit aa4fc6e665f6f8293335c8edd96584e8cdda40c6
Author: Geert Uytterhoeven <geert+renesas@glider.be>
Subject: spi: amlogic-spisg: Make sure clk_init_data is fully initialized
The clk_init_data structure contains several mutually-exclusive members
for different methods to specify the possible parents of a clock,
prompting drivers to initialize only the members they need. However,
not initializing all members may cause subtle issues.
Fixes: cef9991e04aed330 ("spi: Add Amlogic SPISG driver")
> diff --git a/drivers/spi/spi-amlogic-spisg.c b/drivers/spi/spi-amlogic-spisg.c
> index afc8af04638d3..9049a87e9d0f2 100644
> --- a/drivers/spi/spi-amlogic-spisg.c
> +++ b/drivers/spi/spi-amlogic-spisg.c
> @@ -636,7 +636,7 @@ static int aml_spisg_target_abort(struct spi_controller *ctlr)
> static int aml_spisg_clk_init(struct spisg_device *spisg, void __iomem *base)
> {
> struct device *dev = &spisg->pdev->dev;
> - struct clk_init_data init;
> + struct clk_init_data init = {};
> struct clk_divider *div;
> struct clk_div_table *tbl;
> char name[32];
[Severity: High]
This is a pre-existing issue, but I noticed a severe imbalance in clock
prepare/enable counts for the pclk and core clocks.
In aml_spisg_clk_init(), pclk is acquired with devm_clk_get_enabled():
spisg->pclk = devm_clk_get_enabled(dev, "pclk");
But later in the same function, it is manually disabled:
clk_disable_unprepare(spisg->pclk);
Since pclk is managed by devres, won't this manual disable unbalance the
clock enable count right from the start?
This pattern is also repeated in the probe error path and remove functions:
drivers/spi/spi-amlogic-spisg.c:aml_spisg_probe() {
...
out_clk:
if (spisg->core)
clk_disable_unprepare(spisg->core);
clk_disable_unprepare(spisg->pclk);
return ret;
}
Does this cause double-disables and negative enable counts when the
devres cleanup runs?
[Severity: High]
This is also a pre-existing issue, but I noticed missing cleanup for
runtime PM and the sclk clock.
In aml_spisg_clk_init(), sclk is manually enabled:
clk_prepare_enable(spisg->sclk);
And in aml_spisg_probe(), runtime PM is enabled:
pm_runtime_enable(&spisg->pdev->dev);
However, if devm_request_irq() or spi_register_controller() fails, the
out_clk error path simply returns:
drivers/spi/spi-amlogic-spisg.c:aml_spisg_probe() {
...
out_clk:
if (spisg->core)
clk_disable_unprepare(spisg->core);
clk_disable_unprepare(spisg->pclk);
return ret;
}
Doesn't this leak the sclk enable count and leave runtime PM enabled?
Additionally, aml_spisg_remove() also lacks a pm_runtime_disable() call
and skips disabling sclk if the device is not runtime suspended. Should
there be explicit teardowns for these in the error and removal paths?
--
Sashiko AI review · https://sashiko.dev/#/patchset/cover.1787165329.git.geert+renesas@glider.be?part=5
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH treewide 5/5] spi: amlogic-spisg: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 5/5] spi: amlogic-spisg: " Geert Uytterhoeven
2026-08-19 19:13 ` sashiko-bot
@ 2026-08-19 21:23 ` Brian Masney
2026-08-20 8:49 ` Xianwei Zhao
2 siblings, 0 replies; 25+ messages in thread
From: Brian Masney @ 2026-08-19 21:23 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck, Michael Hennerich,
Antoniu Miclaus, Jonathan Cameron, David Lechner, Andy Shevchenko,
Sunny Luo, Xianwei Zhao, Mark Brown, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand, linux-omap, linux-arm-kernel, linux-hwmon,
linux, linux-iio, linux-amlogic, linux-spi, linux-clk,
linux-kernel
On Wed, Aug 19, 2026 at 09:05:19PM +0200, Geert Uytterhoeven wrote:
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> aml_spisg_clk_init() fills in init.parent_data, and assumes that
> init.parent_names is NULL. However, the latter in uninitialized, and
> thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: cef9991e04aed330 ("spi: Add Amlogic SPISG driver")
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Brian Masney <bmasney@redhat.com>
^ permalink raw reply [flat|nested] 25+ messages in thread* Re: [PATCH treewide 5/5] spi: amlogic-spisg: Make sure clk_init_data is fully initialized
2026-08-19 19:05 ` [PATCH treewide 5/5] spi: amlogic-spisg: " Geert Uytterhoeven
2026-08-19 19:13 ` sashiko-bot
2026-08-19 21:23 ` Brian Masney
@ 2026-08-20 8:49 ` Xianwei Zhao
2 siblings, 0 replies; 25+ messages in thread
From: Xianwei Zhao @ 2026-08-20 8:49 UTC (permalink / raw)
To: Geert Uytterhoeven, Tero Kristo, Stephen Boyd, Brian Masney,
Jerome Brunet, Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck,
Michael Hennerich, Antoniu Miclaus, Jonathan Cameron,
David Lechner, Andy Shevchenko, Sunny Luo, Mark Brown, Kees Cook,
Kevin Hilman, Mathieu Dubois-Briand
Cc: linux-omap, linux-arm-kernel, linux-hwmon, linux, linux-iio,
linux-amlogic, linux-spi, linux-clk, linux-kernel
Reviewed-by: Xianwei Zhao <xianwei.zhao@amlogic.com>
On 2026/8/20 03:05, Geert Uytterhoeven wrote:
> The clk_init_data structure contains several mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. However,
> not initializing all members may cause subtle issues, which are only
> exposed when CONFIG_INIT_STACK_ALL_PATTERN or CONFIG_INIT_STACK_NONE is
> enabled.
>
> aml_spisg_clk_init() fills in init.parent_data, and assumes that
> init.parent_names is NULL. However, the latter in uninitialized, and
> thus may cause a crash.
>
> Make sure all members are fully initialized, to fix such bugs, and to
> avoid future breakage when converting drivers to a different method for
> specifying the parents.
>
> Fixes: cef9991e04aed330 ("spi: Add Amlogic SPISG driver")
> Signed-off-by: Geert Uytterhoeven<geert+renesas@glider.be>
> ---
> Compile-tested only.
> ---
> drivers/spi/spi-amlogic-spisg.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/spi/spi-amlogic-spisg.c b/drivers/spi/spi-amlogic-spisg.c
> index afc8af04638d3b6e..9049a87e9d0f2df6 100644
> --- a/drivers/spi/spi-amlogic-spisg.c
> +++ b/drivers/spi/spi-amlogic-spisg.c
> @@ -636,7 +636,7 @@ static int aml_spisg_target_abort(struct spi_controller *ctlr)
> static int aml_spisg_clk_init(struct spisg_device *spisg, void __iomem *base)
> {
> struct device *dev = &spisg->pdev->dev;
> - struct clk_init_data init;
> + struct clk_init_data init = {};
> struct clk_divider *div;
> struct clk_div_table *tbl;
> char name[32];
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: (subset) [PATCH treewide 0/5] clk: Make sure clk_init_data is fully initialized (part 1)
2026-08-19 19:05 [PATCH treewide 0/5] clk: Make sure clk_init_data is fully initialized (part 1) Geert Uytterhoeven
` (4 preceding siblings ...)
2026-08-19 19:05 ` [PATCH treewide 5/5] spi: amlogic-spisg: " Geert Uytterhoeven
@ 2026-08-20 12:11 ` Mark Brown
5 siblings, 0 replies; 25+ messages in thread
From: Mark Brown @ 2026-08-20 12:11 UTC (permalink / raw)
To: Tero Kristo, Stephen Boyd, Brian Masney, Jerome Brunet,
Nobuhiro Iwamatsu, Nuno Sa, Guenter Roeck, Michael Hennerich,
Antoniu Miclaus, Jonathan Cameron, David Lechner, Andy Shevchenko,
Sunny Luo, Xianwei Zhao, Kees Cook, Kevin Hilman,
Mathieu Dubois-Briand, Geert Uytterhoeven
Cc: linux-omap, linux-arm-kernel, linux-hwmon, linux, linux-iio,
linux-amlogic, linux-spi, linux-clk, linux-kernel
On Wed, 19 Aug 2026 21:05:14 +0200, Geert Uytterhoeven wrote:
> clk: Make sure clk_init_data is fully initialized (part 1)
>
> Hi all,
>
> The clk_init_data structure contains three mutually-exclusive members
> for different methods to specify the possible parents of a clock,
> prompting drivers to initialize only the members they need. When commit
> fc0c209c147f35ed ("clk: Allow parents to be specified without string
> names") added the last two methods, this was done in a
> backwards-compatible way, using a priority-based scheme:
> - .name, .ops, .num_parents, and .flags must always be initialized,
> - if .num_parents is non-zero, .parent_names must be initialized,
> - if .parent_names is NULL, .parent_data must be initialized,
> - if .parent_data is NULL, .parent_hws must be initialized
> and valid.
>
> [...]
Applied to
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-7.3
Thanks!
[5/5] spi: amlogic-spisg: Make sure clk_init_data is fully initialized
https://git.kernel.org/broonie/spi/c/b2702908ee23
All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.
You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.
If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.
Please add any relevant lists and maintainers to the CCs when replying
to this mail.
Thanks,
Mark
^ permalink raw reply [flat|nested] 25+ messages in thread