Re: [PATCH] clk: disable unused clocks registered after boot
From: Brian Masney
Date: Thu Sep 17 2026 - 16:35:33 EST
Hi Alexandre,
On Thu, Sep 17, 2026 at 07:23:36PM +0200, Alexandre Belloni wrote:
> On 17/09/2026 12:01:42-0400, Brian Masney wrote:
> > On Thu, Sep 17, 2026 at 04:40:10PM +0200, alexandre.belloni@xxxxxxxxxxx wrote:
> > > From: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
> > >
> > > clk_disable_unused() only runs once as a late_initcall, so clocks
> > > registered afterwards by loading a module are never checked and may be left
> > > running needlessly.
> > >
> > > So record when clk_disable_unused has run and afterwards, schedule a
> > > delayed work to run the scan when new clocks are registered.
> > >
> > > Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>
> >
> > We're actually in the process of redoing the way clk_disable_unused is
> > handled. I posted a series to add sync_state support to the clk
> > framework:
> >
> > https://lore.kernel.org/linux-clk/20260626-clk-sync-state-v1-0-4156d8196dc8@xxxxxxxxxx/
> >
> > Will you be at Linux Plumbers in Prague in 2.5 weeks? If so, come to
> > this talk where we will talk about the clk subsystem.
> >
> > Evolving support for sync_state to subsystems beyond genpd
> > https://lpc.events/event/20/contributions/2504/
> >
>
> I will be at plumbers and I'll try to attend, thanks!
>
> For reference, this is the reason for the patch:
> https://lore.kernel.org/all/2ce03d3b4cd9cce8e32fe1fe1ffbea5760bf9ef3.camel@xxxxxxxxxxx/
Can you try running with my sync_state patch set before LPC and see if
it works as expected for you? Be sure to leave clk_ignore_unused off the
kernel command line.
https://lore.kernel.org/linux-clk/20260626-clk-sync-state-v1-0-4156d8196dc8@xxxxxxxxxx/
Brian