RE: [PATCH] thermal: imx8mm: Add get_trend ops

From: Anson Huang
Date: Wed May 27 2020 - 08:26:35 EST


Hi, Daniel

> Subject: RE: [PATCH] thermal: imx8mm: Add get_trend ops
>
> Hi, Daniel
>
> > Subject: Re: [PATCH] thermal: imx8mm: Add get_trend ops
> >
> > On 25/05/2020 04:46, Anson Huang wrote:
> > > Hi, Daniel
> >
> > [ ... ]
> >
> > > I tried modifying the min/max to '2' in cooling map, it works that
> > > whenever cooling action is needed, the max cooling action will be
> > > applied. But I also noticed some behaviors which NOT as expected:
> > >

After looking further into the min/max setting in cooling map, it looks like NOT
suitable for our i.MX platforms, although OPP table is defined in DT, but the OPP
table is a full list of all available set points, and chips with different fuse settings
will ONLY enable some of set points in the OPP table, that introduces the trouble
of calculating the max state of cpufreq cooling, for example, on i.MX8MM, there are
3 set points defined in OPP table, but if the chip is with speed_grading fuse set to
1.6GHz, then ONLY 1.2GHz/1.6GHz are available for cpufreq, so the real max state
for cpufreq cooling is '1' actually, so how do I handle such scenario?

If thermal_zone_bind_cooling_device() can support parsing other macro new definition
like 'THERMAL_MAX_STATE' in DT, then in thermal_core.c, it can get real max state via
cdev->ops->get_max_state(cdev, &max_state) and set to lower/upper state, that will help
a lot for the case of our i.MX platforms. Do you have any suggestion?

122 opp-1200000000 {
123 opp-hz = /bits/ 64 <1200000000>;
124 opp-microvolt = <850000>;
125 opp-supported-hw = <0xe>, <0x7>;
126 clock-latency-ns = <150000>;
127 opp-suspend;
128 };
129
130 opp-1600000000 {
131 opp-hz = /bits/ 64 <1600000000>;
132 opp-microvolt = <900000>;
133 opp-supported-hw = <0xc>, <0x7>;
134 clock-latency-ns = <150000>;
135 opp-suspend;
136 };
137
138 opp-1800000000 {
139 opp-hz = /bits/ 64 <1800000000>;
140 opp-microvolt = <1000000>;
141 opp-supported-hw = <0x8>, <0x3>;
142 clock-latency-ns = <150000>;
143 opp-suspend;
144 };

Thanks,
Anson