lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 30 Mar 2023 08:06:01 +0200
From:   Uwe Kleine-König <u.kleine-koenig@...gutronix.de>
To:     Stephen Boyd <sboyd@...nel.org>
Cc:     linux-doc@...r.kernel.org,
        Michael Turquette <mturquette@...libre.com>,
        Jonathan Corbet <corbet@....net>, linux-kernel@...r.kernel.org,
        kernel@...gutronix.de, linux-clk@...r.kernel.org
Subject: Re: [PATCH v4] clk: expand clk_ignore_unused mechanism to keep only
 a few clks on

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/ |

Download attachment "signature.asc" of type "application/pgp-signature" (489 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ