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]
Message-ID: <DB3PR0402MB39161EBE454F4095C275CFF0F5670@DB3PR0402MB3916.eurprd04.prod.outlook.com>
Date:   Thu, 14 Feb 2019 01:58:30 +0000
From:   Anson Huang <anson.huang@....com>
To:     Stephen Boyd <sboyd@...nel.org>,
        "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "festevam@...il.com" <festevam@...il.com>,
        "kernel@...gutronix.de" <kernel@...gutronix.de>,
        "linux-arm-kernel@...ts.infradead.org" 
        <linux-arm-kernel@...ts.infradead.org>,
        "linux-clk@...r.kernel.org" <linux-clk@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "mark.rutland@....com" <mark.rutland@....com>,
        "mturquette@...libre.com" <mturquette@...libre.com>,
        "robh+dt@...nel.org" <robh+dt@...nel.org>,
        "s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
        "shawnguo@...nel.org" <shawnguo@...nel.org>,
        "viresh.kumar@...aro.org" <viresh.kumar@...aro.org>,
        Aisheng Dong <aisheng.dong@....com>,
        Daniel Baluta <daniel.baluta@....com>
CC:     dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH V3 2/2] clk: imx: scu: add cpu frequency scaling support



Best Regards!
Anson Huang

> -----Original Message-----
> From: Stephen Boyd [mailto:sboyd@...nel.org]
> Sent: 2019年2月14日 1:43
> To: devicetree@...r.kernel.org; festevam@...il.com;
> kernel@...gutronix.de; linux-arm-kernel@...ts.infradead.org; linux-
> clk@...r.kernel.org; linux-kernel@...r.kernel.org; mark.rutland@....com;
> mturquette@...libre.com; robh+dt@...nel.org; s.hauer@...gutronix.de;
> shawnguo@...nel.org; viresh.kumar@...aro.org; Aisheng Dong
> <aisheng.dong@....com>; Anson Huang <anson.huang@....com>; Daniel
> Baluta <daniel.baluta@....com>
> Cc: dl-linux-imx <linux-imx@....com>
> Subject: Re: [PATCH V3 2/2] clk: imx: scu: add cpu frequency scaling support
> 
> Quoting Anson Huang (2019-02-13 07:59:32)
> > @@ -145,6 +161,39 @@ static long clk_scu_round_rate(struct clk_hw *hw,
> unsigned long rate,
> >         return rate;
> >  }
> >
> > +static bool clk_scu_atf_set_cpu_rate(struct clk_hw *hw, unsigned long
> > +rate) {
> > +       struct clk_scu *clk = to_clk_scu(hw);
> > +       struct arm_smccc_res res;
> > +       unsigned int cluster_id;
> > +       int i;
> > +
> > +       /* CPU frequency scaling can ONLY be done by ARM-Trusted-Firmware
> */
> > +       if (clk->clk_type == IMX_SC_PM_CLK_CPU) {
> > +               for (i = 0; i < ARRAY_SIZE(imx_sc_cpufreq_data); i++) {
> > +                       if (!strcmp(clk_hw_get_name(hw),
> > +                               imx_sc_cpufreq_data[i].clk_name)) {
> > +                               cluster_id = imx_sc_cpufreq_data[i].cluster_id;
> > +                               break;
> > +                       }
> > +               }
> 
> Is there some reason why these clks can't be determined once at boot time?
> It would be a good idea to avoid doing any sort of string comparison here,
> instead just calling the right arm_smccc_smc with the right arguments based
> on code that registers those types of clks.

Agree, I can avoid string comparison in runtime, in V4 patch I just sent, I add another
clk ops for CPU clock, and use resource ID to determine the CPU clk ops and cluster id,
thus we can save the runtime check and string comparison.

Thanks,
Anson.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ