Re: [PATCH v2 0/2] clk: ti: mux: resolve parent clocks by DT index, not by name
From: Mathieu Dubois-Briand
Date: Wed Sep 02 2026 - 04:30:25 EST
On Wed Sep 2, 2026 at 8:26 AM CEST, Andreas Kemnade wrote:
> Hi,
>
> this seems to produce on OMAP3 (DM3730), even with the init fix.
>
> [ 0.000000] clocksource: 32k_counter: mask: 0xffffffff max_cycles: 0xffffffff
> , max_idle_ns: 58327039986419 ns
> [ 0.000030] sched_clock: 32 bits at 33kHz, resolution 30517ns, wraps every 65
> 535999984741ns
> [ 0.013488] clk: failed to reparent gpt1_fck to omap_32k_fck: -22
> [ 0.019805] Failed to initialize '/ocp@68000000/target-module@48318000/timer@
> 0': -19
>
> Regards,
> Andreas
Hi Andreas,
That one will be a bit harder for me to debug, as I'm not sure I can
easily get this hardware. But looking at the device tree and the
reference manual, I suspect something is wrong in the omap3 device tree.
In omap3.dtsi, we have this node [1]:
&timer1_target {
ti,no-reset-on-init;
ti,no-idle;
timer@0 {
assigned-clocks = <&gpt1_fck>;
assigned-clock-parents = <&omap_32k_fck>;
};
};
I suspect that's the source of the error: __set_clk_parents() in
drivers/clk/clk-conf.c will try to set &omap_32k_fck as a parent of
&gpt1_fck. But looking at omap3xxx-clocks.dtsi [2], &omap_32k_fck is not
a valid parent:
gpt1_fck: gpt1_fck {
#clock-cells = <0>;
compatible = "ti,composite-clock";
clocks = <&gpt1_gate_fck>, <&gpt1_mux_fck>;
};
Yet the &gpt1_mux_fck is a mux, and one of the parent is indeed
&omap_32k_fck [3]. So I suspect the correct assigned clock parent in
timer@0 should be &gpt1_mux_fck.
Can you try it that way?
Now, I have doubts about how this was working correctly so far. You
don't see any error at all without my changes?
[1]: https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/ti/omap/omap3.dtsi?h=v7.3-rc1#n1036
[2]: https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/ti/omap/omap3xxx-clocks.dtsi?h=v7.3-rc1#n1183
[3]: https://web.git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/arm/boot/dts/ti/omap/omap3xxx-clocks.dtsi?h=v7.3-rc1#n737
Thanks,
Mathieu
>
> On Mon, 27 Jul 2026 09:41:39 +0200
> Mathieu Dubois-Briand <mathieu.dubois-briand@xxxxxxxxxxx> wrote:
>
>> 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@xxxxxxxxxxx/
>>
>> Signed-off-by: Mathieu Dubois-Briand <mathieu.dubois-briand@xxxxxxxxxxx>
>> ---
>> 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@xxxxxxxxxxx
>>
>> ---
>> 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, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com