lkml.org 
[lkml]   [2022]   [Jul]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 3/3] thermal/core: Fix thermal trip cross point
From
On 08/07/2022 05:56, Zhang Rui wrote:

[ ... ]

>> + if (tz->last_temperature < trip_temp && tz->temperature >=
>> trip_temp &&
>> + trip != tz->prev_trip) {
>> + thermal_notify_tz_trip_up(tz->id, trip, tz-
>>> temperature);
>> + tz->prev_trip = trip;
>> +
>> + } else if (tz->last_temperature >= trip_low_temp && tz-
>>> temperature < trip_low_temp &&
>> + trip == tz->prev_trip) {
>> + thermal_notify_tz_trip_down(tz->id, trip, tz-
>>> temperature);
>> + tz->prev_trip = trip - 1;
>
> Say, let's assume hysteresis is Zero,
> When the temperature increases and we do thermal_notify_tz_trip_up()
> for trip 0 and trip 1, tz->prev_trip is set to 1 in this case.
> And then the temperature drops below trip 0, we don't have chance to do
> thermal_notify_tz_trip_down() for trip 0, because we always handle the
> trips in ascending order, and tz->prev_trip is 1 when we do
> handle_thermal_trip(0).
Well actually you are right, I reproduced the scenario with temperature
emulation. I'll investigate how to handle this case.

Thanks for spotting this



<http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro: <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog

\
 
 \ /
  Last update: 2022-07-08 12:50    [W:0.067 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site