[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB3PR0402MB391651E56C147B1BD13727C5F5F60@DB3PR0402MB3916.eurprd04.prod.outlook.com>
Date: Mon, 8 Jul 2019 07:54:03 +0000
From: Anson Huang <anson.huang@....com>
To: Leonard Crestez <leonard.crestez@....com>,
"viresh.kumar@...aro.org" <viresh.kumar@...aro.org>
CC: "robh+dt@...nel.org" <robh+dt@...nel.org>,
"mark.rutland@....com" <mark.rutland@....com>,
"shawnguo@...nel.org" <shawnguo@...nel.org>,
"s.hauer@...gutronix.de" <s.hauer@...gutronix.de>,
"kernel@...gutronix.de" <kernel@...gutronix.de>,
"festevam@...il.com" <festevam@...il.com>,
Jacky Bai <ping.bai@....com>,
Daniel Baluta <daniel.baluta@....com>,
"l.stach@...gutronix.de" <l.stach@...gutronix.de>,
Abel Vesa <abel.vesa@....com>,
"andrew.smirnov@...il.com" <andrew.smirnov@...il.com>,
"ccaione@...libre.com" <ccaione@...libre.com>,
"angus@...ea.ca" <angus@...ea.ca>,
"agx@...xcpu.org" <agx@...xcpu.org>,
"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
"linux-arm-kernel@...ts.infradead.org"
<linux-arm-kernel@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
dl-linux-imx <linux-imx@....com>
Subject: RE: [PATCH 2/2] arm64: dts: imx8mm: Assign highest opp as suspend opp
Hi, Leonard
> > On 7/4/2019 9:23 AM, Anson.Huang@....com wrote:
> > > From: Anson Huang <Anson.Huang@....com>
> > >
> > > Assign highest OPP as suspend OPP to reduce suspend/resume latency
> > > on i.MX8MM.
> > >
> > > Signed-off-by: Anson Huang <Anson.Huang@....com>
> > > ---
> > > arch/arm64/boot/dts/freescale/imx8mm.dtsi | 1 +
> > > 1 file changed, 1 insertion(+)
> > >
> > > diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > > b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > > index b11fc5e..3a62407 100644
> > > --- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > > +++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
> > > @@ -136,6 +136,7 @@
> > > opp-microvolt = <1000000>;
> > > opp-supported-hw = <0x8>, <0x3>;
> > > clock-latency-ns = <150000>;
> > > + opp-suspend;
> > > };
> > > };
> >
> > What if the highest OPP is unavailable due to speed grading? Ideally
> > we should find a way to suspend at the highest *supported* OPP.
> >
> > Maybe the opp-suspend marking could be assigned from imx-cpufreq-dt
> > driver code?
>
> Yes, this is also my concern, the current OPP driver does NOT handle it well,
> and I was thinking to assigne it from imx-cpufreq-dt driver, 1 option is to
> runtime add "suspend-opp" property into DT OPP node after parsing the
> speed grading fuse and OPP table, but I do NOT like that very much, as we
> need to manually create a property, the other option is to change cpu freq
> policy inside imx-cpufreq-dt driver in suspend/resume callback? Which one
> do you prefer?
After looking through the cpufreq driver, I think we can use below late init function
to assign the suspend_freq, then no need to add "opp-suspend " in DT, and the freq
get from cpufreq_quick_get_max() is already the max supported freq considering the
speed grading and market segment fuse settings, please ignore these 2 patches, I will
send out a imx-cpufreq-dt.c patch with below change to support all SoCs with imx-cpufreq-dt
driver.
+static int __init imx_cpufreq_dt_setup_suspend_opp(void)
+{
+ struct cpufreq_policy *policy = cpufreq_cpu_get(0);
+
+ policy->suspend_freq = cpufreq_quick_get_max(0);
+
+ return 0;
+}
+late_initcall(imx_cpufreq_dt_setup_suspend_opp);
Anson.
Powered by blists - more mailing lists