* [PATCH v2 0/2] clk: ti: mux: resolve parent clocks by DT index, not by name
@ 2026-07-27 7:41 Mathieu Dubois-Briand
2026-07-27 7:41 ` [PATCH v2 1/2] " Mathieu Dubois-Briand
2026-07-27 7:41 ` [PATCH v2 2/2] clk: ti: composite: " Mathieu Dubois-Briand
0 siblings, 2 replies; 11+ messages in thread
From: Mathieu Dubois-Briand @ 2026-07-27 7:41 UTC (permalink / raw)
To: Tero Kristo, Michael Turquette, Stephen Boyd, Brian Masney,
Tony Lindgren
Cc: Thomas Petazzoni, Théo Lebrun, Grégory Clement,
linux-omap, linux-clk, linux-kernel, Mathieu Dubois-Briand
This commit aims to solve an issue I've been describing a few months ago
on AM335x SoC [1]. I believe using the parent_data field of
clk_init_data structure is now the preferred way to convey that data,
and it should be more reliable than string comparisons.
[1]: https://lore.kernel.org/all/DI4RUFQNSSNP.2QMSSQWJW9I2O@bootlin.com/
Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
---
Changes in v2:
- Also use clk_parent_data structure in composite.c.
- Rebase on v7.2-rc5.
- Link to v1: https://lore.kernel.org/r/20260715-mathieu-wdt-clock-theo-v1-1-da65bba1828b@bootlin.com
---
Mathieu Dubois-Briand (2):
clk: ti: mux: resolve parent clocks by DT index, not by name
clk: ti: composite: resolve parent clocks by DT index, not by name
drivers/clk/ti/composite.c | 26 ++++++++++++++------------
drivers/clk/ti/mux.c | 20 +++++++++++---------
2 files changed, 25 insertions(+), 21 deletions(-)
---
base-commit: f5098b6bae761e346ebcd9da7f95622c04733cff
change-id: 20260713-mathieu-wdt-clock-theo-f0c5ba58e258
Best regards,
--
Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
^ permalink raw reply [flat|nested] 11+ messages in thread* [PATCH v2 1/2] clk: ti: mux: resolve parent clocks by DT index, not by name 2026-07-27 7:41 [PATCH v2 0/2] clk: ti: mux: resolve parent clocks by DT index, not by name Mathieu Dubois-Briand @ 2026-07-27 7:41 ` Mathieu Dubois-Briand 2026-07-28 14:11 ` Brian Masney ` (2 more replies) 2026-07-27 7:41 ` [PATCH v2 2/2] clk: ti: composite: " Mathieu Dubois-Briand 1 sibling, 3 replies; 11+ messages in thread From: Mathieu Dubois-Briand @ 2026-07-27 7:41 UTC (permalink / raw) To: Tero Kristo, Michael Turquette, Stephen Boyd, Brian Masney, Tony Lindgren Cc: Thomas Petazzoni, Théo Lebrun, Grégory Clement, linux-omap, linux-clk, linux-kernel, Mathieu Dubois-Briand Resolve parent clocks by their index into the device tree "clocks" property rather than matching names as strings. Name-based matching is fragile because a clock's "clock-output-names" value in its provider node can differ from the name used to reference it in a consumer node, and because names must be globally unique across all clock providers. On AM335x, this caused broken clock trees where some clocks failed to enable because their parents could not be found. Replace of_clk_parent_fill() with a clk_parent_data array that sets .index to the array position. Fixes: ec7aa25fa483 ("ARM: dts: Use clock-output-names for am3") Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> --- drivers/clk/ti/mux.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/drivers/clk/ti/mux.c b/drivers/clk/ti/mux.c index d6a0ccfd81db..ded4432f7528 100644 --- a/drivers/clk/ti/mux.c +++ b/drivers/clk/ti/mux.c @@ -119,7 +119,7 @@ const struct clk_ops ti_clk_mux_ops = { }; static struct clk *_register_mux(struct device_node *node, const char *name, - const char * const *parent_names, + const struct clk_parent_data *parent_data, u8 num_parents, unsigned long flags, struct clk_omap_reg *reg, u8 shift, u32 mask, s8 latch, u8 clk_mux_flags, u32 *table) @@ -136,7 +136,7 @@ static struct clk *_register_mux(struct device_node *node, const char *name, init.name = name; init.ops = &ti_clk_mux_ops; init.flags = flags; - init.parent_names = parent_names; + init.parent_data = parent_data; init.num_parents = num_parents; /* struct clk_mux assignments */ @@ -167,24 +167,26 @@ static void of_mux_clk_setup(struct device_node *node) struct clk *clk; struct clk_omap_reg reg; unsigned int num_parents; - const char **parent_names; + struct clk_parent_data *parent_data; const char *name; u8 clk_mux_flags = 0; u32 mask = 0; u32 shift = 0; s32 latch = -EINVAL; u32 flags = CLK_SET_RATE_NO_REPARENT; + int i; num_parents = of_clk_get_parent_count(node); if (num_parents < 2) { pr_err("mux-clock %pOFn must have parents\n", node); return; } - parent_names = kcalloc(num_parents, sizeof(char *), GFP_KERNEL); - if (!parent_names) - goto cleanup; + parent_data = kcalloc(num_parents, sizeof(*parent_data), GFP_KERNEL); + if (!parent_data) + return; - of_clk_parent_fill(node, parent_names, num_parents); + for (i = 0; i < num_parents; i++) + parent_data[i].index = i; if (ti_clk_get_reg_addr(node, 0, ®)) goto cleanup; @@ -207,7 +209,7 @@ static void of_mux_clk_setup(struct device_node *node) mask = (1 << fls(mask)) - 1; name = ti_dt_clk_name(node); - clk = _register_mux(node, name, parent_names, num_parents, + clk = _register_mux(node, name, parent_data, num_parents, flags, ®, shift, mask, latch, clk_mux_flags, NULL); @@ -215,7 +217,7 @@ static void of_mux_clk_setup(struct device_node *node) of_clk_add_provider(node, of_clk_src_simple_get, clk); cleanup: - kfree(parent_names); + kfree(parent_data); } CLK_OF_DECLARE(mux_clk, "ti,mux-clock", of_mux_clk_setup); -- 2.47.3 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] clk: ti: mux: resolve parent clocks by DT index, not by name 2026-07-27 7:41 ` [PATCH v2 1/2] " Mathieu Dubois-Briand @ 2026-07-28 14:11 ` Brian Masney 2026-08-14 5:43 ` Stephen Boyd 2026-08-18 16:02 ` Geert Uytterhoeven 2 siblings, 0 replies; 11+ messages in thread From: Brian Masney @ 2026-07-28 14:11 UTC (permalink / raw) To: Mathieu Dubois-Briand Cc: Tero Kristo, Michael Turquette, Stephen Boyd, Tony Lindgren, Thomas Petazzoni, Théo Lebrun, Grégory Clement, linux-omap, linux-clk, linux-kernel On Mon, Jul 27, 2026 at 09:41:40AM +0200, Mathieu Dubois-Briand wrote: > Resolve parent clocks by their index into the device tree "clocks" > property rather than matching names as strings. Name-based matching is > fragile because a clock's "clock-output-names" value in its provider > node can differ from the name used to reference it in a consumer node, > and because names must be globally unique across all clock providers. > > On AM335x, this caused broken clock trees where some clocks failed to > enable because their parents could not be found. > > Replace of_clk_parent_fill() with a clk_parent_data array that sets > .index to the array position. > > Fixes: ec7aa25fa483 ("ARM: dts: Use clock-output-names for am3") > Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Reviewed-by: Brian Masney <bmasney@redhat.com> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] clk: ti: mux: resolve parent clocks by DT index, not by name 2026-07-27 7:41 ` [PATCH v2 1/2] " Mathieu Dubois-Briand 2026-07-28 14:11 ` Brian Masney @ 2026-08-14 5:43 ` Stephen Boyd 2026-08-18 16:02 ` Geert Uytterhoeven 2 siblings, 0 replies; 11+ messages in thread From: Stephen Boyd @ 2026-08-14 5:43 UTC (permalink / raw) To: Brian Masney, Mathieu Dubois-Briand, Michael Turquette, Tero Kristo, Tony Lindgren Cc: Thomas Petazzoni, Théo Lebrun, Grégory Clement, linux-omap, linux-clk, linux-kernel, Mathieu Dubois-Briand Quoting Mathieu Dubois-Briand (2026-07-27 00:41:40) > Resolve parent clocks by their index into the device tree "clocks" > property rather than matching names as strings. Name-based matching is > fragile because a clock's "clock-output-names" value in its provider > node can differ from the name used to reference it in a consumer node, > and because names must be globally unique across all clock providers. > > On AM335x, this caused broken clock trees where some clocks failed to > enable because their parents could not be found. > > Replace of_clk_parent_fill() with a clk_parent_data array that sets > .index to the array position. > > Fixes: ec7aa25fa483 ("ARM: dts: Use clock-output-names for am3") > Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> > --- Applied to clk-next ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] clk: ti: mux: resolve parent clocks by DT index, not by name 2026-07-27 7:41 ` [PATCH v2 1/2] " Mathieu Dubois-Briand 2026-07-28 14:11 ` Brian Masney 2026-08-14 5:43 ` Stephen Boyd @ 2026-08-18 16:02 ` Geert Uytterhoeven 2026-08-18 21:13 ` Brian Masney 2026-08-19 5:39 ` Mathieu Dubois-Briand 2 siblings, 2 replies; 11+ messages in thread From: Geert Uytterhoeven @ 2026-08-18 16:02 UTC (permalink / raw) To: Mathieu Dubois-Briand Cc: Tero Kristo, Michael Turquette, Stephen Boyd, Brian Masney, Tony Lindgren, Thomas Petazzoni, Théo Lebrun, Grégory Clement, linux-omap, linux-clk, linux-kernel, Matti Vaittinen Hi Mathieu, On Mon, 27 Jul 2026 at 09:44, Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> wrote: > Resolve parent clocks by their index into the device tree "clocks" > property rather than matching names as strings. Name-based matching is > fragile because a clock's "clock-output-names" value in its provider > node can differ from the name used to reference it in a consumer node, > and because names must be globally unique across all clock providers. > > On AM335x, this caused broken clock trees where some clocks failed to > enable because their parents could not be found. > > Replace of_clk_parent_fill() with a clk_parent_data array that sets > .index to the array position. > > Fixes: ec7aa25fa483 ("ARM: dts: Use clock-output-names for am3") > Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Thanks for your patch, which is now commit 667f420c09f1417c ("clk: ti: mux: resolve parent clocks by DT index, not by name") in clk/clk-next. This breaks booting BeagleBone Black for me: I don't get any output on the serial console, even with "earlycon keep_bootcon". When the watchdog kicks in (or on kernel panic?), the system reboots. Reverting this commit fixes the issue. After reverting, I added debug code to print all parents, and compared them to the DTB, but didn't see any discrepancies. Your similar change to drivers/clk/ti/composite.c does not cause any issues for me. Do you have a clue? Thanks! > --- a/drivers/clk/ti/mux.c > +++ b/drivers/clk/ti/mux.c > @@ -119,7 +119,7 @@ const struct clk_ops ti_clk_mux_ops = { > }; > > static struct clk *_register_mux(struct device_node *node, const char *name, > - const char * const *parent_names, > + const struct clk_parent_data *parent_data, > u8 num_parents, unsigned long flags, > struct clk_omap_reg *reg, u8 shift, u32 mask, > s8 latch, u8 clk_mux_flags, u32 *table) > @@ -136,7 +136,7 @@ static struct clk *_register_mux(struct device_node *node, const char *name, > init.name = name; > init.ops = &ti_clk_mux_ops; > init.flags = flags; > - init.parent_names = parent_names; > + init.parent_data = parent_data; > init.num_parents = num_parents; > > /* struct clk_mux assignments */ > @@ -167,24 +167,26 @@ static void of_mux_clk_setup(struct device_node *node) > struct clk *clk; > struct clk_omap_reg reg; > unsigned int num_parents; > - const char **parent_names; > + struct clk_parent_data *parent_data; > const char *name; > u8 clk_mux_flags = 0; > u32 mask = 0; > u32 shift = 0; > s32 latch = -EINVAL; > u32 flags = CLK_SET_RATE_NO_REPARENT; > + int i; > > num_parents = of_clk_get_parent_count(node); > if (num_parents < 2) { > pr_err("mux-clock %pOFn must have parents\n", node); > return; > } > - parent_names = kcalloc(num_parents, sizeof(char *), GFP_KERNEL); > - if (!parent_names) > - goto cleanup; > + parent_data = kcalloc(num_parents, sizeof(*parent_data), GFP_KERNEL); > + if (!parent_data) > + return; > > - of_clk_parent_fill(node, parent_names, num_parents); > + for (i = 0; i < num_parents; i++) > + parent_data[i].index = i; > > if (ti_clk_get_reg_addr(node, 0, ®)) > goto cleanup; > @@ -207,7 +209,7 @@ static void of_mux_clk_setup(struct device_node *node) > mask = (1 << fls(mask)) - 1; > > name = ti_dt_clk_name(node); > - clk = _register_mux(node, name, parent_names, num_parents, > + clk = _register_mux(node, name, parent_data, num_parents, > flags, ®, shift, mask, latch, clk_mux_flags, > NULL); > > @@ -215,7 +217,7 @@ static void of_mux_clk_setup(struct device_node *node) > of_clk_add_provider(node, of_clk_src_simple_get, clk); > > cleanup: > - kfree(parent_names); > + kfree(parent_data); > } > CLK_OF_DECLARE(mux_clk, "ti,mux-clock", of_mux_clk_setup); 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] 11+ messages in thread
* Re: [PATCH v2 1/2] clk: ti: mux: resolve parent clocks by DT index, not by name 2026-08-18 16:02 ` Geert Uytterhoeven @ 2026-08-18 21:13 ` Brian Masney 2026-08-19 5:39 ` Mathieu Dubois-Briand 1 sibling, 0 replies; 11+ messages in thread From: Brian Masney @ 2026-08-18 21:13 UTC (permalink / raw) To: Geert Uytterhoeven, Stephen Boyd Cc: Mathieu Dubois-Briand, Tero Kristo, Michael Turquette, Tony Lindgren, Thomas Petazzoni, Théo Lebrun, Grégory Clement, linux-omap, linux-clk, linux-kernel, Matti Vaittinen Hi Stephen / Geert, On Tue, Aug 18, 2026 at 06:02:56PM +0200, Geert Uytterhoeven wrote: > On Mon, 27 Jul 2026 at 09:44, Mathieu Dubois-Briand > <mathieu.dubois-briand@bootlin.com> wrote: > > Resolve parent clocks by their index into the device tree "clocks" > > property rather than matching names as strings. Name-based matching is > > fragile because a clock's "clock-output-names" value in its provider > > node can differ from the name used to reference it in a consumer node, > > and because names must be globally unique across all clock providers. > > > > On AM335x, this caused broken clock trees where some clocks failed to > > enable because their parents could not be found. > > > > Replace of_clk_parent_fill() with a clk_parent_data array that sets > > .index to the array position. > > > > Fixes: ec7aa25fa483 ("ARM: dts: Use clock-output-names for am3") > > Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> > > Thanks for your patch, which is now commit 667f420c09f1417c ("clk: ti: > mux: resolve parent clocks by DT index, not by name") in clk/clk-next. > > This breaks booting BeagleBone Black for me: I don't get any output > on the serial console, even with "earlycon keep_bootcon". When the > watchdog kicks in (or on kernel panic?), the system reboots. > > Reverting this commit fixes the issue. > After reverting, I added debug code to print all parents, and compared > them to the DTB, but didn't see any discrepancies. > > Your similar change to drivers/clk/ti/composite.c does not cause any > issues for me. > > Do you have a clue? Stephen: I think the safest thing is to just drop / revert the two patches in this series in the pull to Linus next week. I'd do it now, however I'm still waiting for my kernel.org account to get created, and don't have write access to the clk tree yet. Mathieu: Feel free to post an updated version, and we can get it merged earlier in the development cycle so it'll get more testing in next. Hopefully Geert will have time to test an updated version. Brian ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] clk: ti: mux: resolve parent clocks by DT index, not by name 2026-08-18 16:02 ` Geert Uytterhoeven 2026-08-18 21:13 ` Brian Masney @ 2026-08-19 5:39 ` Mathieu Dubois-Briand 2026-08-19 12:32 ` Geert Uytterhoeven 1 sibling, 1 reply; 11+ messages in thread From: Mathieu Dubois-Briand @ 2026-08-19 5:39 UTC (permalink / raw) To: Geert Uytterhoeven Cc: Tero Kristo, Michael Turquette, Stephen Boyd, Brian Masney, Tony Lindgren, Thomas Petazzoni, Théo Lebrun, Grégory Clement, linux-omap, linux-clk, linux-kernel, Matti Vaittinen Hi Geert, On Tue Aug 18, 2026 at 6:02 PM CEST, Geert Uytterhoeven wrote: > Hi Mathieu, > > On Mon, 27 Jul 2026 at 09:44, Mathieu Dubois-Briand > <mathieu.dubois-briand@bootlin.com> wrote: >> Resolve parent clocks by their index into the device tree "clocks" >> property rather than matching names as strings. Name-based matching is >> fragile because a clock's "clock-output-names" value in its provider >> node can differ from the name used to reference it in a consumer node, >> and because names must be globally unique across all clock providers. >> >> On AM335x, this caused broken clock trees where some clocks failed to >> enable because their parents could not be found. >> >> Replace of_clk_parent_fill() with a clk_parent_data array that sets >> .index to the array position. >> >> Fixes: ec7aa25fa483 ("ARM: dts: Use clock-output-names for am3") >> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> > > Thanks for your patch, which is now commit 667f420c09f1417c ("clk: ti: > mux: resolve parent clocks by DT index, not by name") in clk/clk-next. > > This breaks booting BeagleBone Black for me: I don't get any output > on the serial console, even with "earlycon keep_bootcon". When the > watchdog kicks in (or on kernel panic?), the system reboots. > Sorry for that! It's a bit unexpected, as the beaglebone black was one of my test platforms and I didn't see any issue. > Reverting this commit fixes the issue. > After reverting, I added debug code to print all parents, and compared > them to the DTB, but didn't see any discrepancies. > > Your similar change to drivers/clk/ti/composite.c does not cause any > issues for me. > > Do you have a clue? > Thanks! Can you describe what bootloader and device tree you are using for your tests? Any specific configuration? On my side, I have: - BeagleBone Black Wireless A5 - am335x-boneblack-wireless.dtb - U-boot 2025.10-ti-g6825d60bea17. Maybe I should try with u-boot master branch. Thanks, Mathieu -- Mathieu Dubois-Briand, Bootlin Embedded Linux and Kernel engineering https://bootlin.com ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 1/2] clk: ti: mux: resolve parent clocks by DT index, not by name 2026-08-19 5:39 ` Mathieu Dubois-Briand @ 2026-08-19 12:32 ` Geert Uytterhoeven 0 siblings, 0 replies; 11+ messages in thread From: Geert Uytterhoeven @ 2026-08-19 12:32 UTC (permalink / raw) To: Mathieu Dubois-Briand Cc: Tero Kristo, Michael Turquette, Stephen Boyd, Brian Masney, Tony Lindgren, Thomas Petazzoni, Théo Lebrun, Grégory Clement, linux-omap, linux-clk, linux-kernel, Matti Vaittinen Hi Mathieu, On Wed, 19 Aug 2026 at 07:39, Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> wrote: > On Tue Aug 18, 2026 at 6:02 PM CEST, Geert Uytterhoeven wrote: > > On Mon, 27 Jul 2026 at 09:44, Mathieu Dubois-Briand > > <mathieu.dubois-briand@bootlin.com> wrote: > >> Resolve parent clocks by their index into the device tree "clocks" > >> property rather than matching names as strings. Name-based matching is > >> fragile because a clock's "clock-output-names" value in its provider > >> node can differ from the name used to reference it in a consumer node, > >> and because names must be globally unique across all clock providers. > >> > >> On AM335x, this caused broken clock trees where some clocks failed to > >> enable because their parents could not be found. > >> > >> Replace of_clk_parent_fill() with a clk_parent_data array that sets > >> .index to the array position. > >> > >> Fixes: ec7aa25fa483 ("ARM: dts: Use clock-output-names for am3") > >> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> > > > > Thanks for your patch, which is now commit 667f420c09f1417c ("clk: ti: > > mux: resolve parent clocks by DT index, not by name") in clk/clk-next. > > > > This breaks booting BeagleBone Black for me: I don't get any output > > on the serial console, even with "earlycon keep_bootcon". When the > > watchdog kicks in (or on kernel panic?), the system reboots. > > Sorry for that! > > It's a bit unexpected, as the beaglebone black was one of my test > platforms and I didn't see any issue. > > > Reverting this commit fixes the issue. > > After reverting, I added debug code to print all parents, and compared > > them to the DTB, but didn't see any discrepancies. > > > > Your similar change to drivers/clk/ti/composite.c does not cause any > > issues for me. > > > > Do you have a clue? > > Thanks! > > Can you describe what bootloader and device tree you are using for your > tests? Any specific configuration? > > On my side, I have: > - BeagleBone Black Wireless A5 > - am335x-boneblack-wireless.dtb > - U-boot 2025.10-ti-g6825d60bea17. Maybe I should try with u-boot master > branch. BeagleBone Black Rev C3 (by Seeed Studio) am335x-boneblack.dtb Stock U-Boot SPL 2019.04-00002-g31a8ae0206 (May 13 2020 - 09:26:17 -0500) I am using my own config. With omap2plus_defconfig and multi_v7_defconfig, it does boot. However, this commit does have an impact on /sys/kernel/debug/clk/clk_summary: --- summary-7.2.0-rc2-00106-g0d4d262c1664 2026-08-19 10:56:51.622275674 +0200 +++ summary-7.2.0-rc2-00107-g667f420c09f1 2026-08-19 10:58:13.929823890 +0200 @@ -77,10 +77,14 @@ clk_summary: deviceless no_connection_id clk_summary: clkdiv32k_ck 0 1 0 32786 0 0 50000 Y deviceless of_clk_get_from_provider clk_summary: deviceless no_connection_id -clk_summary: clk-24mhz-clkctrl:0000:0 0 4 0 32786 0 0 50000 N deviceless clkdiv32k_ick +clk_summary: clk-24mhz-clkctrl:0000:0 0 5 0 32786 0 0 50000 N deviceless clkdiv32k_ick clk_summary: deviceless of_clk_get_from_provider clk_summary: deviceless of_clk_get_from_provider clk_summary: deviceless no_connection_id +clk_summary: wdt1_fck 0 1 0 32786 0 0 50000 Y deviceless wdt1_fck +clk_summary: deviceless no_connection_id +clk_summary: l4-wkup-clkctrl:00d4:0 0 1 0 32786 0 0 50000 N 44e35000.target-module fck +clk_summary: deviceless no_connection_id clk_summary: l4-rtc-clkctrl:0000:0 0 1 0 32786 0 0 50000 N 44e3e074.target-module fck clk_summary: deviceless no_connection_id clk_summary: l4ls-clkctrl:0074:18 0 2 0 32786 0 0 50000 N 4804c000.gpio dbclk @@ -297,17 +301,13 @@ clk_summary: l4-cefuse-clkctrl:0020:0 0 0 0 24000000 0 0 50000 N deviceless no_connection_id clk_summary: virt_19200000_ck 0 0 0 19200000 0 0 50000 Y deviceless of_clk_get_from_provider clk_summary: deviceless no_connection_id -clk_summary: clk_rc32k_ck 0 2 0 32000 0 0 50000 Y deviceless of_clk_get_from_provider +clk_summary: clk_rc32k_ck 0 1 0 32000 0 0 50000 Y deviceless of_clk_get_from_provider clk_summary: deviceless no_connection_id clk_summary: gpio0_dbclk_mux_ck 0 1 0 32000 0 0 50000 Y deviceless no_connection_id clk_summary: l4-wkup-clkctrl:0008:18 0 2 0 32000 0 0 50000 N 44e07000.gpio dbclk clk_summary: 44e07000.target-module dbclk clk_summary: deviceless of_clk_get_from_provider clk_summary: deviceless no_connection_id -clk_summary: wdt1_fck 0 1 0 32000 0 0 50000 Y deviceless wdt1_fck -clk_summary: deviceless no_connection_id -clk_summary: l4-wkup-clkctrl:00d4:0 0 1 0 32000 0 0 50000 N 44e35000.target-module fck -clk_summary: deviceless no_connection_id clk_summary: clk_32768_ck 1 1 0 32768 0 0 50000 Y deviceless of_clk_get_from_provider clk_summary: deviceless no_connection_id clk_summary: sysclkout_pre_ck 1 1 0 32768 0 0 50000 Y deviceless no_connection_id I.e. wdt1_fck changed its parent from clk_rc32k_ck to clk-24mhz-clkctrl:0000:0, which is probably not intended? However, that is not the cause of the crash. My .config has CONFIG_INIT_STACK_ALL_PATTERN enabled, so any uninitialized local variables contain garbage. > @@ -136,7 +136,7 @@ static struct clk *_register_mux(struct device_node *node, const char *name, > init.name = name; > init.ops = &ti_clk_mux_ops; > init.flags = flags; > - init.parent_names = parent_names; > + init.parent_data = parent_data; > init.num_parents = num_parents; > > /* struct clk_mux assignments Init is not fully initialized, hence init.parent_names contains garbage (before, .parent_data contained garbage). As clk_core_populate_parent_map() prioritizes .parent_names over .parent_data, the uninitialized .parent_data didn't cause any harm before. I will send a patch to fix this. This seems to be a recurring issue: lots of clk_init_data structures are not fully initialized... 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] 11+ messages in thread
* [PATCH v2 2/2] clk: ti: composite: resolve parent clocks by DT index, not by name 2026-07-27 7:41 [PATCH v2 0/2] clk: ti: mux: resolve parent clocks by DT index, not by name Mathieu Dubois-Briand 2026-07-27 7:41 ` [PATCH v2 1/2] " Mathieu Dubois-Briand @ 2026-07-27 7:41 ` Mathieu Dubois-Briand 2026-07-28 14:11 ` Brian Masney 2026-08-14 5:43 ` Stephen Boyd 1 sibling, 2 replies; 11+ messages in thread From: Mathieu Dubois-Briand @ 2026-07-27 7:41 UTC (permalink / raw) To: Tero Kristo, Michael Turquette, Stephen Boyd, Brian Masney, Tony Lindgren Cc: Thomas Petazzoni, Théo Lebrun, Grégory Clement, linux-omap, linux-clk, linux-kernel, Mathieu Dubois-Briand Resolve parent clocks by their index into the device tree "clocks" property rather than matching names as strings. This makes it consistent with other parts of the same driver. Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> --- drivers/clk/ti/composite.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/drivers/clk/ti/composite.c b/drivers/clk/ti/composite.c index c379bbdae25a..01eae8995254 100644 --- a/drivers/clk/ti/composite.c +++ b/drivers/clk/ti/composite.c @@ -52,7 +52,7 @@ static const struct clk_ops ti_composite_gate_ops = { struct component_clk { int num_parents; - const char **parent_names; + struct clk_parent_data *parent_data; struct device_node *node; int type; struct clk_hw *hw; @@ -116,7 +116,7 @@ static void __init _register_composite(void *user, struct clk_hw_omap_comp *cclk = to_clk_hw_comp(hw); struct component_clk *comp; int num_parents = 0; - const char **parent_names = NULL; + struct clk_parent_data *parent_data = NULL; const char *name; int i; int ret; @@ -155,7 +155,7 @@ static void __init _register_composite(void *user, continue; if (comp->num_parents) { num_parents = comp->num_parents; - parent_names = comp->parent_names; + parent_data = comp->parent_data; break; } } @@ -166,8 +166,8 @@ static void __init _register_composite(void *user, } name = ti_dt_clk_name(node); - clk = clk_register_composite(NULL, name, - parent_names, num_parents, + clk = clk_register_composite_pdata(NULL, name, + parent_data, num_parents, _get_hw(cclk, CLK_COMPONENT_TYPE_MUX), &ti_clk_mux_ops, _get_hw(cclk, CLK_COMPONENT_TYPE_DIVIDER), @@ -190,7 +190,7 @@ static void __init _register_composite(void *user, if (!cclk->comp_clks[i]) continue; list_del(&cclk->comp_clks[i]->link); - kfree(cclk->comp_clks[i]->parent_names); + kfree(cclk->comp_clks[i]->parent_data); kfree(cclk->comp_clks[i]); } @@ -237,8 +237,9 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw, int type) { unsigned int num_parents; - const char **parent_names; + struct clk_parent_data *parent_data; struct component_clk *clk; + unsigned int i; num_parents = of_clk_get_parent_count(node); @@ -247,20 +248,21 @@ int __init ti_clk_add_component(struct device_node *node, struct clk_hw *hw, return -EINVAL; } - parent_names = kcalloc(num_parents, sizeof(char *), GFP_KERNEL); - if (!parent_names) + parent_data = kcalloc(num_parents, sizeof(*parent_data), GFP_KERNEL); + if (!parent_data) return -ENOMEM; - of_clk_parent_fill(node, parent_names, num_parents); + for (i = 0; i < num_parents; i++) + parent_data[i].index = i; clk = kzalloc_obj(*clk); if (!clk) { - kfree(parent_names); + kfree(parent_data); return -ENOMEM; } clk->num_parents = num_parents; - clk->parent_names = parent_names; + clk->parent_data = parent_data; clk->hw = hw; clk->node = node; clk->type = type; -- 2.47.3 ^ permalink raw reply related [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] clk: ti: composite: resolve parent clocks by DT index, not by name 2026-07-27 7:41 ` [PATCH v2 2/2] clk: ti: composite: " Mathieu Dubois-Briand @ 2026-07-28 14:11 ` Brian Masney 2026-08-14 5:43 ` Stephen Boyd 1 sibling, 0 replies; 11+ messages in thread From: Brian Masney @ 2026-07-28 14:11 UTC (permalink / raw) To: Mathieu Dubois-Briand Cc: Tero Kristo, Michael Turquette, Stephen Boyd, Tony Lindgren, Thomas Petazzoni, Théo Lebrun, Grégory Clement, linux-omap, linux-clk, linux-kernel On Mon, Jul 27, 2026 at 09:41:41AM +0200, Mathieu Dubois-Briand wrote: > Resolve parent clocks by their index into the device tree "clocks" > property rather than matching names as strings. This makes it consistent > with other parts of the same driver. > > Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> Reviewed-by: Brian Masney <bmasney@redhat.com> ^ permalink raw reply [flat|nested] 11+ messages in thread
* Re: [PATCH v2 2/2] clk: ti: composite: resolve parent clocks by DT index, not by name 2026-07-27 7:41 ` [PATCH v2 2/2] clk: ti: composite: " Mathieu Dubois-Briand 2026-07-28 14:11 ` Brian Masney @ 2026-08-14 5:43 ` Stephen Boyd 1 sibling, 0 replies; 11+ messages in thread From: Stephen Boyd @ 2026-08-14 5:43 UTC (permalink / raw) To: Brian Masney, Mathieu Dubois-Briand, Michael Turquette, Tero Kristo, Tony Lindgren Cc: Thomas Petazzoni, Théo Lebrun, Grégory Clement, linux-omap, linux-clk, linux-kernel, Mathieu Dubois-Briand Quoting Mathieu Dubois-Briand (2026-07-27 00:41:41) > Resolve parent clocks by their index into the device tree "clocks" > property rather than matching names as strings. This makes it consistent > with other parts of the same driver. > > Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com> > --- Applied to clk-next ^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2026-08-19 12:32 UTC | newest] Thread overview: 11+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-07-27 7:41 [PATCH v2 0/2] clk: ti: mux: resolve parent clocks by DT index, not by name Mathieu Dubois-Briand 2026-07-27 7:41 ` [PATCH v2 1/2] " Mathieu Dubois-Briand 2026-07-28 14:11 ` Brian Masney 2026-08-14 5:43 ` Stephen Boyd 2026-08-18 16:02 ` Geert Uytterhoeven 2026-08-18 21:13 ` Brian Masney 2026-08-19 5:39 ` Mathieu Dubois-Briand 2026-08-19 12:32 ` Geert Uytterhoeven 2026-07-27 7:41 ` [PATCH v2 2/2] clk: ti: composite: " Mathieu Dubois-Briand 2026-07-28 14:11 ` Brian Masney 2026-08-14 5:43 ` Stephen Boyd
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.