nuttx-mirror/drivers/thermal
wangjianyu3 c6c89ac262 Thermal/step_wise: Fix that hysteresis takes no effect
Test command

  nsh> cat /proc/thermal/cpu-thermal

Trips

  /* Copy from drivers/thermal/thermal_dummy.c */

  {.name = "cpu_crit",   .temp = 90, .hyst = 5, .type = THERMAL_CRITICAL},
  {.name = "cpu_alert1", .temp = 70, .hyst = 5, .type = THERMAL_HOT},
  {.name = "cpu_alert0", .temp = 60, .hyst = 5, .type = THERMAL_NORMAL},

Without this patch

  # Error occured when temperature jump to 69.

  z:cpu-thermal t:67 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:72 t:1 h:16 l:0 c:fan0 s:1|1
  z:cpu-thermal t:69 t:1 h:16 l:0 c:fan0 s:0|0
  z:cpu-thermal t:74 t:1 h:16 l:0 c:fan0 s:1|1

With this patch

  z:cpu-thermal t:67 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:72 t:1 h:16 l:0 c:fan0 s:1|1
  z:cpu-thermal t:69 t:1 h:16 l:0 c:fan0 s:1|1
  z:cpu-thermal t:74 t:1 h:16 l:0 c:fan0 s:2|2

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-26 09:23:10 +08:00
..
CMakeLists.txt drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
Kconfig Thermal: The thermal core depends on LPWORK 2024-12-26 09:23:10 +08:00
Make.defs drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
thermal_core.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
thermal_core.h drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
thermal_cpufreq_cooling.c drivers: migrate to SPDX identifier 2024-11-06 18:02:25 +08:00
thermal_dummy.c Thermal/dummy: Add temperature jump to test hysteresis 2024-12-26 09:23:10 +08:00
thermal_procfs.c Thermal/procfs: Do not print invalid target cooling state directly 2024-12-26 09:23:10 +08:00
thermal_step_wise.c Thermal/step_wise: Fix that hysteresis takes no effect 2024-12-26 09:23:10 +08:00