drivers/thermal: Update state when temp is stable
Fix cooling state not decreasing error when the temperature is kept at low trip(stable, not dropping).
Test on "sim:thermal", log is from /proc/thermal/cpu-thermal and see thermal/thermal_dummy.c for trip point details.
e.g. The temperature decreasing from 71 to 65 and then kept.
z:cpu-thermal t:71 t:1 h:16 l:0 c:fan0 s:16|16
a. Without this patch, the cooling state of "fan0" will be kept at 15, even if the temperature is at a lower trip:
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15
... ...
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15
b. With this patch, the cooling state of "fan0" was continually decreasing to zero according to current trip point:
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:15|15
... ...
z:cpu-thermal t:65 t:1 h:16 l:0 c:fan0 s:0|0
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
This commit is contained in:
parent
2aab12ff56
commit
0e71a944b9
1 changed files with 4 additions and 0 deletions
|
|
@ -134,6 +134,10 @@ static unsigned int get_target_state(FAR struct thermal_instance_s *instance,
|
|||
return validate_state(instance, throttle, cur_state, 1);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
return validate_state(instance, throttle, cur_state, -1);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue