From: Brian Masney <bmasney@redhat.com>
To: Hans de Goede <hansg@kernel.org>
Cc: Maxime Ripard <mripard@kernel.org>,
Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Michael Turquette <mturquette@baylibre.com>,
Stephen Boyd <sboyd@kernel.org>, Abel Vesa <abelvesa@kernel.org>,
Saravana Kannan <saravanak@kernel.org>,
linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-clk@vger.kernel.org
Subject: Re: [PATCH] clk: add new Kconfig to control default behavior of disabling unused clocks
Date: Tue, 17 Mar 2026 08:20:59 -0400 [thread overview]
Message-ID: <ablHK4t6iQKMWysb@redhat.com> (raw)
In-Reply-To: <75a9514c-2e62-4535-b963-65a99cdfd3f6@kernel.org>
On Tue, Mar 17, 2026 at 12:53:10PM +0100, Hans de Goede wrote:
> On 17-Mar-26 08:30, Maxime Ripard wrote:
> > 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?
One of the problems that I am aware of is that clk_disable_unused() runs
in late_initcall_sync(), and the intention was for it to run after all
of the deferred probing happens, however, it actually runs in parallel
with async and deferred probing. So there's a race between these
actions.
> > 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.
>
> Both things can be true at the same time. Yes there are ways to work
> around issues causes by clk_ignore_unused and those ways should be
> used more often. And in example of the X1E laptops I do indeed want
> to try and figure out which clocks must not be turned off and
> try to see if it will be accepted to mark these as CLK_IS_CRITICAL.
>
> But at the same time the fundamental concept of turning off all unused
> clocks as soon as all *builtin* drivers are done probing is a broken
> concept when working with generic distro kernels where many drivers
> are modules. To me it looks like this was very much made with
> embedded systems with device specific kernels where all drivers for
> the used SoC are builtin.
>
> The problem basically is, that if we want something like disabling
> unused clocks at all (1), it should happen when all drivers including
> those build as module have had a chance to run. ATM the clocks
> simply get turned off too soon.
>
> Also see Stephen Boyd's LPC talk about this:
>
> "Make sync_state()/handoff work for the common clk framework"
> https://lpc.events/event/17/contributions/1432/
>
> When the clk framework maintainer themselves are arguing for
> replacing the way unused clks are disabled atm with something
> better then to me that is a clear sign that there is something
> wrong with the current mechanism.
>
> Arguably it would be better to tie this into the deferred_probe_timeout
> mechanism with some way for subsystems to register callbacks for
> when the deferred_probe_timeout triggers. This way there will at
> least be some attempt by the kernel to delay it until all probing
> is done.
One of the things to fix is that not all clks have a struct device
since some need to be initialized early. See of_clk_hw_register().
Brian
next prev parent reply other threads:[~2026-03-17 12:21 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-16 22:33 [PATCH] clk: add new Kconfig to control default behavior of disabling unused clocks Brian Masney
2026-03-17 7:30 ` Maxime Ripard
2026-03-17 11:53 ` Hans de Goede
2026-03-17 12:20 ` Brian Masney [this message]
2026-03-17 13:32 ` Maxime Ripard
2026-03-17 13:51 ` Abel Vesa
2026-03-17 14:02 ` Hans de Goede
2026-03-17 12:14 ` Abel Vesa
2026-03-17 12:16 ` Hans de Goede
2026-03-17 12:26 ` Brian Masney
2026-03-17 13:03 ` Abel Vesa
2026-03-17 13:18 ` Maxime Ripard
2026-03-17 13:22 ` Abel Vesa
2026-03-17 12:57 ` Abel Vesa
2026-03-17 13:15 ` Maxime Ripard
2026-03-17 13:21 ` Abel Vesa
2026-03-17 13:40 ` Maxime Ripard
2026-03-17 14:13 ` Brian Masney
2026-03-17 14:20 ` Abel Vesa
2026-03-17 15:00 ` Brian Masney
2026-03-17 15:14 ` Hans de Goede
2026-03-19 5:40 ` Jagadeesh Kona
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=ablHK4t6iQKMWysb@redhat.com \
--to=bmasney@redhat.com \
--cc=abelvesa@kernel.org \
--cc=corbet@lwn.net \
--cc=hansg@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=saravanak@kernel.org \
--cc=sboyd@kernel.org \
--cc=skhan@linuxfoundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.