Skip to content

clk: Make sure clk_init_data is fully initialized (part 1)

Geert Uytterhoeven linux-amlogic linux-arm-kernel linux-clk linux-hwmon linux-iio linux-omap linux-spi lkml sashiko-reviews 1 version Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 15 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5clk: ti: Make sure clk_init_data is fully initializeddrivers/clk/ti/adpll.c drivers/clk/ti/divider.c drivers/clk/ti/mux.c+4 -43 replies
2/5clk: visconti: Make sure clk_init_data is fully initializeddrivers/clk/visconti/clkc.c+1 -13 replies
3/5hwmon: (ltc4282) Make sure clk_init_data is fully initializeddrivers/hwmon/ltc4282.c+1 -12 replies
4/5iio: frequency: adf4377: Make sure clk_init_data is fully initializeddrivers/iio/frequency/adf4377.c+1 -13 replies
5/5spi: amlogic-spisg: Make sure clk_init_data is fully initializeddrivers/spi/spi-amlogic-spisg.c+1 -12 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchBrian MasneyNobuhiro IwamatsuMathieu Dubois-BriandXianwei Zhao
1/5R-b R-b
2/5R-b R-b
3/5R-b
4/5R-b
5/5R-b R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v1 thread

Cover letter [PATCH treewide 0/5] 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.

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 makes 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.

This (small) series is part 1, and fixes all cases that I identified to be real bugs:
- The first patch fixes a crash I saw on BeagleBone Black,
- The other patches are only compile-tested.
All patches in this series can be applied independently.

Part 2 will be much larger (touching 185 files), and will fix the remaining cases that are currently harmless.

Thanks for your comments!

Geert Uytterhoeven (5):
clk: ti: Make sure clk_init_data is fully initialized
clk: visconti: Make sure clk_init_data is fully initialized
hwmon: (ltc4282) Make sure clk_init_data is fully initialized
iio: frequency: adf4377: Make sure clk_init_data is fully initialized
spi: amlogic-spisg: Make sure clk_init_data is fully initialized

 drivers/clk/ti/adpll.c          | 4 ++--
 drivers/clk/ti/divider.c        | 2 +-
 drivers/clk/ti/mux.c            | 2 +-
 drivers/clk/visconti/clkc.c     | 2 +-
 drivers/hwmon/ltc4282.c         | 2 +-
 drivers/iio/frequency/adf4377.c | 2 +-
 drivers/spi/spi-amlogic-spisg.c | 2 +-
 7 files changed, 8 insertions(+), 8 deletions(-)
Signature · 12 lines
2.43.0

Gr{oetje,eeting}s,

						Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- [email protected]

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