* [PATCH 0/5] rtc: Make sure clk_init_data is fully initialized
@ 2026-08-21 10:09 Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 1/5] rtc: hym8563: " Geert Uytterhoeven
` (6 more replies)
0 siblings, 7 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2026-08-21 10:09 UTC (permalink / raw)
To: Alexandre Belloni, Andrew Jeffery, Avi Fishman, Tomer Maimon,
Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair
Cc: linux-rtc, openbmc, linux-clk, Geert Uytterhoeven
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 RTC 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
Geert Uytterhoeven (5):
rtc: hym8563: Make sure clk_init_data is fully initialized
rtc: m41t80: Make sure clk_init_data is fully initialized
rtc: nct3018y: Make sure clk_init_data is fully initialized
rtc: philips: Make sure clk_init_data is fully initialized
rtc: microcrystal: Make sure clk_init_data is fully initialized
drivers/rtc/rtc-hym8563.c | 2 +-
drivers/rtc/rtc-m41t80.c | 2 +-
drivers/rtc/rtc-nct3018y.c | 2 +-
drivers/rtc/rtc-pcf85063.c | 2 +-
drivers/rtc/rtc-pcf8563.c | 2 +-
drivers/rtc/rtc-rv3028.c | 2 +-
drivers/rtc/rtc-rv3032.c | 2 +-
7 files changed, 7 insertions(+), 7 deletions(-)
--
2.43.0
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] 8+ messages in thread
* [PATCH 1/5] rtc: hym8563: Make sure clk_init_data is fully initialized
2026-08-21 10:09 [PATCH 0/5] rtc: Make sure clk_init_data is fully initialized Geert Uytterhoeven
@ 2026-08-21 10:09 ` Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 2/5] rtc: m41t80: " Geert Uytterhoeven
` (5 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2026-08-21 10:09 UTC (permalink / raw)
To: Alexandre Belloni, Andrew Jeffery, Avi Fishman, Tomer Maimon,
Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair
Cc: linux-rtc, openbmc, 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/rtc/rtc-hym8563.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-hym8563.c b/drivers/rtc/rtc-hym8563.c
index 3156aa5f2d9ff264..1d52cc3def02ef22 100644
--- a/drivers/rtc/rtc-hym8563.c
+++ b/drivers/rtc/rtc-hym8563.c
@@ -376,8 +376,8 @@ static struct clk *hym8563_clkout_register_clk(struct hym8563 *hym8563)
{
struct i2c_client *client = hym8563->client;
struct device_node *node = client->dev.of_node;
+ struct clk_init_data init = {};
struct clk *clk;
- struct clk_init_data init;
int ret;
ret = i2c_smbus_write_byte_data(client, HYM8563_CLKOUT,
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/5] rtc: m41t80: Make sure clk_init_data is fully initialized
2026-08-21 10:09 [PATCH 0/5] rtc: Make sure clk_init_data is fully initialized Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 1/5] rtc: hym8563: " Geert Uytterhoeven
@ 2026-08-21 10:09 ` Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 3/5] rtc: nct3018y: " Geert Uytterhoeven
` (4 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2026-08-21 10:09 UTC (permalink / raw)
To: Alexandre Belloni, Andrew Jeffery, Avi Fishman, Tomer Maimon,
Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair
Cc: linux-rtc, openbmc, 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/rtc/rtc-m41t80.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-m41t80.c b/drivers/rtc/rtc-m41t80.c
index 3c8c379392c14078..ec86ca3f2c4c85f8 100644
--- a/drivers/rtc/rtc-m41t80.c
+++ b/drivers/rtc/rtc-m41t80.c
@@ -574,8 +574,8 @@ static struct clk *m41t80_sqw_register_clk(struct m41t80_data *m41t80)
struct i2c_client *client = m41t80->client;
struct device_node *node = client->dev.of_node;
struct device_node *fixed_clock;
+ struct clk_init_data init = {};
struct clk *clk;
- struct clk_init_data init;
int ret;
fixed_clock = of_get_child_by_name(node, "clock");
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/5] rtc: nct3018y: Make sure clk_init_data is fully initialized
2026-08-21 10:09 [PATCH 0/5] rtc: Make sure clk_init_data is fully initialized Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 1/5] rtc: hym8563: " Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 2/5] rtc: m41t80: " Geert Uytterhoeven
@ 2026-08-21 10:09 ` Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 4/5] rtc: philips: " Geert Uytterhoeven
` (3 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2026-08-21 10:09 UTC (permalink / raw)
To: Alexandre Belloni, Andrew Jeffery, Avi Fishman, Tomer Maimon,
Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair
Cc: linux-rtc, openbmc, 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/rtc/rtc-nct3018y.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/rtc/rtc-nct3018y.c b/drivers/rtc/rtc-nct3018y.c
index 700a395fad3a63b6..2f7ad57057a4b8a1 100644
--- a/drivers/rtc/rtc-nct3018y.c
+++ b/drivers/rtc/rtc-nct3018y.c
@@ -459,8 +459,8 @@ static struct clk *nct3018y_clkout_register_clk(struct nct3018y *nct3018y)
{
struct i2c_client *client = nct3018y->client;
struct device_node *node = client->dev.of_node;
+ struct clk_init_data init = {};
struct clk *clk;
- struct clk_init_data init;
init.name = "nct3018y-clkout";
init.ops = &nct3018y_clkout_ops;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/5] rtc: philips: Make sure clk_init_data is fully initialized
2026-08-21 10:09 [PATCH 0/5] rtc: Make sure clk_init_data is fully initialized Geert Uytterhoeven
` (2 preceding siblings ...)
2026-08-21 10:09 ` [PATCH 3/5] rtc: nct3018y: " Geert Uytterhoeven
@ 2026-08-21 10:09 ` Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 5/5] rtc: microcrystal: " Geert Uytterhoeven
` (2 subsequent siblings)
6 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2026-08-21 10:09 UTC (permalink / raw)
To: Alexandre Belloni, Andrew Jeffery, Avi Fishman, Tomer Maimon,
Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair
Cc: linux-rtc, openbmc, 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/rtc/rtc-pcf85063.c | 2 +-
drivers/rtc/rtc-pcf8563.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-pcf85063.c b/drivers/rtc/rtc-pcf85063.c
index 01e209d88f5f357f..8cb9ffc73f6d9001 100644
--- a/drivers/rtc/rtc-pcf85063.c
+++ b/drivers/rtc/rtc-pcf85063.c
@@ -498,7 +498,7 @@ static const struct clk_ops pcf85063_clkout_ops = {
static struct clk *pcf85063_clkout_register_clk(struct pcf85063 *pcf85063)
{
struct clk *clk;
- struct clk_init_data init;
+ struct clk_init_data init = {};
struct device_node *node = pcf85063->rtc->dev.parent->of_node;
struct device_node *fixed_clock;
diff --git a/drivers/rtc/rtc-pcf8563.c b/drivers/rtc/rtc-pcf8563.c
index 81d13733b1e9372f..5503eb61df13f4a6 100644
--- a/drivers/rtc/rtc-pcf8563.c
+++ b/drivers/rtc/rtc-pcf8563.c
@@ -425,7 +425,7 @@ static const struct clk_ops pcf8563_clkout_ops = {
static struct clk *pcf8563_clkout_register_clk(struct pcf8563 *pcf8563)
{
struct device_node *node = pcf8563->rtc->dev.parent->of_node;
- struct clk_init_data init;
+ struct clk_init_data init = {};
struct clk *clk;
int ret;
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 5/5] rtc: microcrystal: Make sure clk_init_data is fully initialized
2026-08-21 10:09 [PATCH 0/5] rtc: Make sure clk_init_data is fully initialized Geert Uytterhoeven
` (3 preceding siblings ...)
2026-08-21 10:09 ` [PATCH 4/5] rtc: philips: " Geert Uytterhoeven
@ 2026-08-21 10:09 ` Geert Uytterhoeven
2026-08-23 19:50 ` [PATCH 0/5] rtc: " Alexandre Belloni
2026-08-24 15:24 ` Brian Masney
6 siblings, 0 replies; 8+ messages in thread
From: Geert Uytterhoeven @ 2026-08-21 10:09 UTC (permalink / raw)
To: Alexandre Belloni, Andrew Jeffery, Avi Fishman, Tomer Maimon,
Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair
Cc: linux-rtc, openbmc, 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/rtc/rtc-rv3028.c | 2 +-
drivers/rtc/rtc-rv3032.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/rtc/rtc-rv3028.c b/drivers/rtc/rtc-rv3028.c
index d96f6bb68850dadb..d25e33d0835eea04 100644
--- a/drivers/rtc/rtc-rv3028.c
+++ b/drivers/rtc/rtc-rv3028.c
@@ -816,7 +816,7 @@ static int rv3028_clkout_register_clk(struct rv3028_data *rv3028,
{
int ret;
struct clk *clk;
- struct clk_init_data init;
+ struct clk_init_data init = {};
struct device_node *node = client->dev.of_node;
ret = regmap_update_bits(rv3028->regmap, RV3028_STATUS,
diff --git a/drivers/rtc/rtc-rv3032.c b/drivers/rtc/rtc-rv3032.c
index 6bafdec637aeadd0..687faaef42b257e5 100644
--- a/drivers/rtc/rtc-rv3032.c
+++ b/drivers/rtc/rtc-rv3032.c
@@ -752,7 +752,7 @@ static int rv3032_clkout_register_clk(struct rv3032_data *rv3032,
{
int ret;
struct clk *clk;
- struct clk_init_data init;
+ struct clk_init_data init = {};
struct device_node *node = client->dev.of_node;
ret = regmap_update_bits(rv3032->regmap, RV3032_TLSB, RV3032_TLSB_CLKF, 0);
--
2.43.0
^ permalink raw reply related [flat|nested] 8+ messages in thread
* Re: [PATCH 0/5] rtc: Make sure clk_init_data is fully initialized
2026-08-21 10:09 [PATCH 0/5] rtc: Make sure clk_init_data is fully initialized Geert Uytterhoeven
` (4 preceding siblings ...)
2026-08-21 10:09 ` [PATCH 5/5] rtc: microcrystal: " Geert Uytterhoeven
@ 2026-08-23 19:50 ` Alexandre Belloni
2026-08-24 15:24 ` Brian Masney
6 siblings, 0 replies; 8+ messages in thread
From: Alexandre Belloni @ 2026-08-23 19:50 UTC (permalink / raw)
To: Andrew Jeffery, Avi Fishman, Tomer Maimon, Tali Perry,
Patrick Venture, Nancy Yuen, Benjamin Fair, Geert Uytterhoeven
Cc: linux-rtc, openbmc, linux-clk
On Fri, 21 Aug 2026 12:09:01 +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.
>
> [...]
Applied, thanks!
[1/5] rtc: hym8563: Make sure clk_init_data is fully initialized
https://git.kernel.org/abelloni/c/db005bdaa5ff
[2/5] rtc: m41t80: Make sure clk_init_data is fully initialized
https://git.kernel.org/abelloni/c/bdcedfee8b87
[3/5] rtc: nct3018y: Make sure clk_init_data is fully initialized
https://git.kernel.org/abelloni/c/096c7ef4ef66
[4/5] rtc: philips: Make sure clk_init_data is fully initialized
https://git.kernel.org/abelloni/c/5ef3d51a3aaa
[5/5] rtc: microcrystal: Make sure clk_init_data is fully initialized
https://git.kernel.org/abelloni/c/a12eac458814
Best regards,
--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH 0/5] rtc: Make sure clk_init_data is fully initialized
2026-08-21 10:09 [PATCH 0/5] rtc: Make sure clk_init_data is fully initialized Geert Uytterhoeven
` (5 preceding siblings ...)
2026-08-23 19:50 ` [PATCH 0/5] rtc: " Alexandre Belloni
@ 2026-08-24 15:24 ` Brian Masney
6 siblings, 0 replies; 8+ messages in thread
From: Brian Masney @ 2026-08-24 15:24 UTC (permalink / raw)
To: Geert Uytterhoeven
Cc: Alexandre Belloni, Andrew Jeffery, Avi Fishman, Tomer Maimon,
Tali Perry, Patrick Venture, Nancy Yuen, Benjamin Fair, linux-rtc,
openbmc, linux-clk
On Fri, Aug 21, 2026 at 12:09:01PM +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 RTC 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
For the series:
Reviewed-by: Brian Masney <bmasney@redhat.com>
^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2026-08-24 23:43 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-21 10:09 [PATCH 0/5] rtc: Make sure clk_init_data is fully initialized Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 1/5] rtc: hym8563: " Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 2/5] rtc: m41t80: " Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 3/5] rtc: nct3018y: " Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 4/5] rtc: philips: " Geert Uytterhoeven
2026-08-21 10:09 ` [PATCH 5/5] rtc: microcrystal: " Geert Uytterhoeven
2026-08-23 19:50 ` [PATCH 0/5] rtc: " Alexandre Belloni
2026-08-24 15:24 ` Brian Masney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox