Re: [PATCH] clk: ti: mux: resolve parent clocks by DT index, not by name

Brian Masney <[email protected]>
Newsgroups org.kernel.vger.linux-clk,org.kernel.vger.linux-kernel,org.kernel.vger.linux-omap
Message-ID <[email protected]>
Hi Mathieu,

On Fri, Jul 24, 2026 at 04:56:01PM +0200, Mathieu Dubois-Briand wrote:
> On Thu Jul 16, 2026 at 7:49 PM CEST, Brian Masney wrote:
> > On Wed, Jul 15, 2026 at 05:09:56PM +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 <[email protected]>
> >
> > So this only updates of_mux_clk_setup(). of_ti_composite_mux_clk_setup()
> > calls ti_clk_add_component(), which does a name based matching as well.
> > It would be nice to have this consistent within the same driver. I know
> > this is going to require a larger refactor.
> >
> > Otherwise your fix looks correct to me.
> >
> > Brian
> 
> Hi Brian,
> 
> Thanks for your comment.
> 
> Yes, it does make sense to make everything consistent here. I'm not
> really comfortable with this driver, but I can give it a try.
> 
> Just to be sure, are you talking only about drivers/clk/ti/composite.c
> or is it about more files in drivers/clk/ti/? I'm not sure to understand
> the whole interactions between each components here.
> 
> Fixing drivers/clk/ti/composite.c to use clk_parent_data looks easy, I
> can definitely send a patch for that. But you are talking about a larger
> refactor, so I suspect you would like to see more changes.

I think we should just get drivers/clk/ti/composite.c consistent with
itself.

Brian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.