Re: [PATCH] clk: add new Kconfig to control default behavior of disabling unused clocks
From: Maxime Ripard
Date: Tue Mar 17 2026 - 09:42:44 EST
On Tue, Mar 17, 2026 at 03:21:17PM +0200, Abel Vesa wrote:
> On 26-03-17 14:15:50, Maxime Ripard wrote:
> > On Tue, Mar 17, 2026 at 02:14:25PM +0200, Abel Vesa wrote:
> > > On 26-03-17 08:30:24, Maxime Ripard wrote:
> > > > Hi,
> > > >
> > > > On Mon, Mar 16, 2026 at 06:33:45PM -0400, Brian Masney wrote:
> > > > > At the 2023 Linux Plumbers Conference in Richmond VA, there was a
> > > > > discussion about how large number of systems need to boot with
> > > > > clk_ignore_unused. Per the discussions at the conference, the existing
> > > > > behavior in the clk core is broken, and there is a desire to completely
> > > > > remove this functionality.
> > > >
> > > > Broken how?
> > > >
> > > > clk_ignore_unused is to a point where it's seriously cargo-culted and
> > > > documented as a silver bullet, when in reality it's just a debug tool
> > > > for broken drivers, and the driver must be fixed.
> > > >
> > > > But nobody is actually fixing it.
> > > >
> > > > See
> > > > https://fedoraproject.org/wiki/Changes/Automatic_DTB_selection_for_aarch64_EFI_systems#How_To_Test
> > > > for example. The affected clock could be marked as CLK_IS_CRITICAL, and
> > > > fedora wouldn't have to package anything, change anything, etc. But no,
> > > > the problem is clk_ignore_unused.
> > >
> > > Nope. Don't ever mark clocks as critical unless system crashes without
> > > them.
> > >
> > > Here is an example or why clocks cannot be marked as critical but need
> > > to be kept by the clk_ignore_unused: display driver probes later.
> > > If you mark it as critical you just made the clock stay enabled even
> > > when display is off.
> > >
> > > And this is just one example.
> >
> > Then use CLK_IGNORE_UNUSED.
>
> But there is no way of knowing in advance to which clocks should this
> flag be applied. As I mentioned on this thread already, we will be
> playing whack-a-mole with clocks for a long time before we get this
> right.
Oh, I know, I did my fair share of these already.
> The solution has been already discussed for a long time now and it is:
> drop the clk_ignore_unused late_initcall entirely and then make a
> generic sync_state callback that the clock providers can use (or they
> could implement one themselves). This way, until sync_state is reached
> for a specific clock provider driver, all unused clocks remain as is.
I don't argue with sync_state being the way forward. It seems
reasonable, even though I'm not sure how we can reasonably expect all
consumers to show up, and / or if we would need some kind of timeout or
something for disabled drivers for example. Anyway. What I'm saying is
that we shouldn't remove that mechanism, no matter how imperfect it is,
without any viable alternative.
Maxime
Attachment:
signature.asc
Description: PGP signature