mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Stephen Boyd <sboyd@kernel.org>
Cc: linux-doc@vger.kernel.org,
	Michael Turquette <mturquette@baylibre.com>,
	Jonathan Corbet <corbet@lwn.net>,
	linux-kernel@vger.kernel.org, kernel@pengutronix.de,
	linux-clk@vger.kernel.org
Subject: Re: [PATCH v4] clk: expand clk_ignore_unused mechanism to keep only a few clks on
Date: Thu, 30 Mar 2023 08:06:01 +0200	[thread overview]
Message-ID: <20230330060601.6mo7b4ecd2sk5mdr@pengutronix.de> (raw)
In-Reply-To: <2f4967f2a079e23b2b8a6013012c66e0.sboyd@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 2276 bytes --]

On Wed, Mar 29, 2023 at 02:27:08PM -0700, Stephen Boyd wrote:
> Quoting Uwe Kleine-König (2023-03-29 13:46:32)
> > > > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> > > > index c3c3f8c07258..356119a7e5fe 100644
> > > > --- a/drivers/clk/clk.c
> > > > +++ b/drivers/clk/clk.c
> > > > [...]
> > > > @@ -1352,12 +1354,17 @@ static void __init clk_disable_unused_subtree(struct clk_core *core)
> > > >          * back to .disable
> > > >          */
> > > >         if (clk_core_is_enabled(core)) {
> > > > -               trace_clk_disable(core);
> > > > -               if (core->ops->disable_unused)
> > > > -                       core->ops->disable_unused(core->hw);
> > > > -               else if (core->ops->disable)
> > > > -                       core->ops->disable(core->hw);
> > > > -               trace_clk_disable_complete(core);
> > > > +               if (clk_unused_keep_on) {
> > > > +                       pr_warn("Keep unused clk \"%s\" on\n", core->name);
> > > > +                       clk_unused_keep_on -= 1;
> > > > +               } else {
> > > > +                       trace_clk_disable(core);
> > > 
> > > We have trace_clk_disable() here. Can you have this tracepoint print to
> > > the kernel log and watch over serial console? That would be faster than
> > > bisecting.
> > 
> > Well no, that doesn't work for all the problems where
> > clk_ignore_unused=7 could be useful. Consider that e.g. you know that
> > eth0 is broken, but with clk_ignore_unused is works. So one of the (say)
> > 25 nominally unused clks are required for eth0. But it's not possible to
> > test the network after each of the 25 clk_disable()s. Unless I'm missing
> > something and you can hook a userspace action on a trace line?!
> 
> In that case it sounds like you want to compile the kernel with the
> support for enabling clks from debugfs. Can you use that?

In some of the cases that might work. Unless for example the problem
makes the kernel fail to boot or the device is broken when the clk was
disabled and reenable doesn't help?!

Best regards
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-König            |
Industrial Linux Solutions                 | https://www.pengutronix.de/ |

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  reply	other threads:[~2023-03-30  6:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-26 15:18 [PATCH v3] " Uwe Kleine-König
2023-03-13 18:27 ` Uwe Kleine-König
2023-03-29 19:49 ` Stephen Boyd
2023-03-29 20:46   ` [PATCH v4] " Uwe Kleine-König
2023-03-29 21:27     ` Stephen Boyd
2023-03-30  6:06       ` Uwe Kleine-König [this message]
2023-03-30 15:26         ` Sebastian Reichel
2023-03-30 17:33           ` Uwe Kleine-König

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=20230330060601.6mo7b4ecd2sk5mdr@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=corbet@lwn.net \
    --cc=kernel@pengutronix.de \
    --cc=linux-clk@vger.kernel.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mturquette@baylibre.com \
    --cc=sboyd@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®