* [PATCH 1/2] iio: adc: meson-saradc: Make sure clk_init_data is fully initialized
2026-08-21 10:04 [PATCH 0/2] iio: Make sure clk_init_data is fully initialized Geert Uytterhoeven
@ 2026-08-21 10:04 ` Geert Uytterhoeven
2026-08-21 11:03 ` Joshua Crofts
2026-08-21 10:04 ` [PATCH 2/2] iio: frequency: adf4350: " Geert Uytterhoeven
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Geert Uytterhoeven @ 2026-08-21 10:04 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Michael Hennerich
Cc: linux-iio, linux, linux-clk, 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.
Make sure all members are fully initialized, to avoid such bugs, and to
prevent future breakage when converting drivers to a different method
for specifying the parents.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
drivers/iio/adc/meson_saradc.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c
index 000e39ca5c624eb6..7b89e2ecd0248b3a 100644
--- a/drivers/iio/adc/meson_saradc.c
+++ b/drivers/iio/adc/meson_saradc.c
@@ -739,7 +739,7 @@ static int meson_sar_adc_clk_init(struct iio_dev *indio_dev,
{
struct meson_sar_adc_priv *priv = iio_priv(indio_dev);
struct device *dev = indio_dev->dev.parent;
- struct clk_init_data init;
+ struct clk_init_data init = {};
const char *clk_parents[1];
init.name = devm_kasprintf(dev, GFP_KERNEL, "%s#adc_div", dev_name(dev));
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 1/2] iio: adc: meson-saradc: Make sure clk_init_data is fully initialized
2026-08-21 10:04 ` [PATCH 1/2] iio: adc: meson-saradc: " Geert Uytterhoeven
@ 2026-08-21 11:03 ` Joshua Crofts
0 siblings, 0 replies; 6+ messages in thread
From: Joshua Crofts @ 2026-08-21 11:03 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Michael Hennerich, linux-iio, linux, linux-clk
On Fri, 21 Aug 2026 12:04:06 +0200
Geert Uytterhoeven <geert+renesas@glider.be> 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.
>
> Make sure all members are fully initialized, to avoid such bugs, and to
> prevent future breakage when converting drivers to a different method
> for specifying the parents.
>
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
Reviewed-by: Joshua Crofts <joshua.crofts1@gmail.com>
--
Kind regards,
Joshua Crofts
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 2/2] iio: frequency: adf4350: Make sure clk_init_data is fully initialized
2026-08-21 10:04 [PATCH 0/2] iio: Make sure clk_init_data is fully initialized Geert Uytterhoeven
2026-08-21 10:04 ` [PATCH 1/2] iio: adc: meson-saradc: " Geert Uytterhoeven
@ 2026-08-21 10:04 ` Geert Uytterhoeven
2026-08-23 1:18 ` [PATCH 0/2] iio: " Jonathan Cameron
2026-08-24 15:18 ` Brian Masney
3 siblings, 0 replies; 6+ messages in thread
From: Geert Uytterhoeven @ 2026-08-21 10:04 UTC (permalink / raw)
To: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Michael Hennerich
Cc: linux-iio, linux, linux-clk, 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.
Make sure all members are fully initialized, to avoid such bugs, and to
prevent future breakage when converting drivers to a different method
for specifying the parents.
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
Compile-tested only.
---
drivers/iio/frequency/adf4350.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/iio/frequency/adf4350.c b/drivers/iio/frequency/adf4350.c
index 315317d6eec412f6..2e1f55d652cb14e6 100644
--- a/drivers/iio/frequency/adf4350.c
+++ b/drivers/iio/frequency/adf4350.c
@@ -461,7 +461,7 @@ static const struct clk_ops adf4350_clk_ops = {
static int adf4350_clk_register(struct adf4350_state *st)
{
struct spi_device *spi = st->spi;
- struct clk_init_data init;
+ struct clk_init_data init = {};
struct clk *clk;
const char *parent_name;
int ret;
--
2.43.0
^ permalink raw reply related [flat|nested] 6+ messages in thread* Re: [PATCH 0/2] iio: Make sure clk_init_data is fully initialized
2026-08-21 10:04 [PATCH 0/2] iio: Make sure clk_init_data is fully initialized Geert Uytterhoeven
2026-08-21 10:04 ` [PATCH 1/2] iio: adc: meson-saradc: " Geert Uytterhoeven
2026-08-21 10:04 ` [PATCH 2/2] iio: frequency: adf4350: " Geert Uytterhoeven
@ 2026-08-23 1:18 ` Jonathan Cameron
2026-08-24 15:18 ` Brian Masney
3 siblings, 0 replies; 6+ messages in thread
From: Jonathan Cameron @ 2026-08-23 1:18 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: David Lechner, Nuno Sá, Andy Shevchenko, Michael Hennerich,
linux-iio, linux, linux-clk
On Fri, 21 Aug 2026 12:04:05 +0200
Geert Uytterhoeven <geert+renesas@glider.be> wrote:
> Hi all,
>
> 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.
>
> Hence this series aims to make sure all members are fully initialized,
> to avoid such bugs, and to prevent future breakage when converting
> drivers to a different method for specifying the parents.
>
> Part One[1] fixed all cases that I identified to be real bugs, in
> response to a crash I saw on BeagleBone Black.
>
> This series is the IIO subpart of Part Two, which fixes remaining cases
> that are currently harmless. These are still fragile, and may cause
> future breakage when converting drivers to a different method for
> specifying the parents.
>
> Thanks for your comments!
>
> [1] "[PATCH treewide 0/5] clk: Make sure clk_init_data is fully
> initialized (part 1)"
> https://lore.kernel.org/cover.1787165329.git.geert+renesas@glider.be
Applied to the testing branch of iio.git.
I made a trivial tweak from {} to { } to follow the style we are trying
to stick to for these in IIO.
Thanks,
Jonathan
>
> Geert Uytterhoeven (2):
> iio: adc: meson-saradc: Make sure clk_init_data is fully initialized
> iio: frequency: adf4350: Make sure clk_init_data is fully initialized
>
> drivers/iio/adc/meson_saradc.c | 2 +-
> drivers/iio/frequency/adf4350.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH 0/2] iio: Make sure clk_init_data is fully initialized
2026-08-21 10:04 [PATCH 0/2] iio: Make sure clk_init_data is fully initialized Geert Uytterhoeven
` (2 preceding siblings ...)
2026-08-23 1:18 ` [PATCH 0/2] iio: " Jonathan Cameron
@ 2026-08-24 15:18 ` Brian Masney
3 siblings, 0 replies; 6+ messages in thread
From: Brian Masney @ 2026-08-24 15:18 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Michael Hennerich, linux-iio, linux, linux-clk
On Fri, Aug 21, 2026 at 12:04:05PM +0200, Geert Uytterhoeven wrote:
> Hi all,
>
> 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.
>
> Hence this series aims to make sure all members are fully initialized,
> to avoid such bugs, and to prevent future breakage when converting
> drivers to a different method for specifying the parents.
>
> Part One[1] fixed all cases that I identified to be real bugs, in
> response to a crash I saw on BeagleBone Black.
>
> This series is the IIO subpart of Part Two, which fixes remaining cases
> that are currently harmless. These are still fragile, and may cause
> future breakage when converting drivers to a different method for
> specifying the parents.
For the series:
Reviewed-by: Brian Masney <bmasney@redhat.com>
I see it was already picked up, and no need to add my tag unless you
wanted to. Just providing an OK from the clk side.
^ permalink raw reply [flat|nested] 6+ messages in thread