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] [day] [month] [year] [list]
Date:   Thu, 26 Oct 2023 10:03:52 +0200
From:   Geert Uytterhoeven <geert@...ux-m68k.org>
To:     Peng Fan <peng.fan@....com>
Cc:     "Peng Fan (OSS)" <peng.fan@....nxp.com>,
        "sboyd@...nel.org" <sboyd@...nel.org>,
        "abelvesa@...nel.org" <abelvesa@...nel.org>,
        "mturquette@...libre.com" <mturquette@...libre.com>,
        "clement.leger@...tlin.com" <clement.leger@...tlin.com>,
        "sudeep.holla@....com" <sudeep.holla@....com>,
        "cristian.marussi@....com" <cristian.marussi@....com>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "pure.logic@...us-software.ie" <pure.logic@...us-software.ie>,
        "a.fatoum@...gutronix.de" <a.fatoum@...gutronix.de>,
        "aford173@...il.com" <aford173@...il.com>,
        "absahu@...eaurora.org" <absahu@...eaurora.org>,
        "linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] clk: clk-conf: bypass setting rate/parent if already same

Hi Peng,

On Thu, Oct 26, 2023 at 10:01 AM Peng Fan <peng.fan@....com> wrote:
> > Subject: Re: [PATCH] clk: clk-conf: bypass setting rate/parent if already same
> > On Thu, Oct 26, 2023 at 8:35 AM Peng Fan (OSS) <peng.fan@....nxp.com>
> > wrote:
> > > From: Peng Fan <peng.fan@....com>
> > >
> > > If the original rate and parent is already the same as what users
> > > wanna to configure through assigned clock rate and parent, there is no
> > > need to configure them again which may cause more cpu cycles or more
> > > SCMI RPC calls.
> > >
> > > So check the rate and parent first, and bypass when the original rate
> > > and parent are same as requested by device tree node.
> > >
> > > Signed-off-by: Peng Fan <peng.fan@....com>

> >     /**
> >      * clk_get_rate - obtain the current clock rate (in Hz) for a clock source.
> >      *                This is only valid once the clock source has been enabled.
> >      * @clk: clock source
> >      */
> >
> > So at least the second part is not guaranteed to work?
>
> I am not sure, but seems there is no clk enabled check in clk_get_rate
> function.

There is indeed no such check.  On most hardware, clk_get_rate()
works fine when the clock is disabled, but that is not guaranteed to
work everywhere.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@...ux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ