Linux clock framework development
 help / color / mirror / Atom feed
From: "Mathieu Dubois-Briand" <mathieu.dubois-briand@bootlin.com>
To: "Brian Masney" <bmasney@redhat.com>
Cc: "Tero Kristo" <kristo@kernel.org>,
	"Michael Turquette" <mturquette@baylibre.com>,
	"Stephen Boyd" <sboyd@kernel.org>,
	"Tony Lindgren" <tony@atomide.com>,
	"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
	"Théo Lebrun" <theo.lebrun@bootlin.com>,
	"Grégory Clement" <gregory.clement@bootlin.com>,
	linux-omap@vger.kernel.org, linux-clk@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] clk: ti: mux: resolve parent clocks by DT index, not by name
Date: Fri, 24 Jul 2026 16:56:01 +0200	[thread overview]
Message-ID: <DK6W03NSALJN.1SASGAY5HWSPN@bootlin.com> (raw)
In-Reply-To: <alkZmw-XmnCOZfOD@redhat.com>

On Thu Jul 16, 2026 at 7:49 PM CEST, Brian Masney wrote:
> Hi Mathieu,
>
> 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 <mathieu.dubois-briand@bootlin.com>
>
> 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 had a look at the other files in drivers/clk/ti/, here are my first
thoughts:
- drivers/clk/ti/apll.c, drivers/clk/ti/dpll.c, drivers/clk/ti/fapll.c:
  Changes would be similar to what was made here.
- drivers/clk/ti/divider.c, drivers/clk/ti/gate.c,
  drivers/clk/ti/interface.c, drivers/clk/ti/adpll.c: I believe we have
  to stick with matching parents by name. This could be made using
  clk_parent_data .name field if we really want to switch to
  clk_parent_data structure. Is that a target?
- drivers/clk/ti/clkctrl.c: similarly, I believe we have to stick to
  clock names. Using clk_parent_data structure requires a lot of changes
  in drivers/clk/ti/clk-* files, but these changes should be trivial.

What would be the relevant changes here?

Thanks,
Mathieu

-- 
Mathieu Dubois-Briand, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


  reply	other threads:[~2026-07-24 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-15 15:09 [PATCH] clk: ti: mux: resolve parent clocks by DT index, not by name Mathieu Dubois-Briand
2026-07-16 17:49 ` Brian Masney
2026-07-24 14:56   ` Mathieu Dubois-Briand [this message]
2026-07-24 15:55     ` Brian Masney

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DK6W03NSALJN.1SASGAY5HWSPN@bootlin.com \
    --to=mathieu.dubois-briand@bootlin.com \
    --cc=bmasney@redhat.com \
    --cc=gregory.clement@bootlin.com \
    --cc=kristo@kernel.org \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.org \
    --cc=theo.lebrun@bootlin.com \
    --cc=thomas.petazzoni@bootlin.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox