Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Drivers/thermal: Fix hysteresis takes no effect error #91

Merged

Conversation

JianyuWang0623
Copy link
Member

Summary

  1. sim:thermal: The sim:thermal is based on sim:nsh : Users can get basic configuration of thermal from sim:thermal.
  2. sim:thermal: The thermal core depends on LPWORK : The thermal core depends on LPWORK without which will not work.
  3. Thermal: The thermal core depends on LPWORK : Like 2, Add depends to Kconfig of thermal.
  4. Thermal/dummy: Add temperature jump to test hysteresis : Update temperature of dummy thermal driver, so that we can test hysteresis with sim.
  5. Thermal/procfs: Do not print invalid target cooling state directly : Maybe we should print special string (e.g. invalid) to mark that the target cooling state is invalid instead of print UINT_MAX directly.
  6. sim:thermal: Enable command line history : Enable command line history for sim:thermal, make it eaiser to input repeat commands.
  7. Thermal/step_wise: Fix that hysteresis takes no effect : Fix error that hysteresis takes no effect

Details can be found in commit message if need.

Impact

drivers/thermal

Testing

  1. Selftest (log can be found in commit message)
  2. NuttX CI

Coverting to including sim:nsh.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Log

  z:cpu-thermal t:50 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:47 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:52 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:49 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:54 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:51 t:1 h:16 l:0 c:fan0 s:0|(invalid)
  z:cpu-thermal t:56 t:1 h:16 l:0 c:fan0 s:0|(invalid)

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Diff
  - z:cpu-thermal t:48 t:1 h:16 l:0 c:fan0 s:0|4294967295
  + z:cpu-thermal t:48 t:1 h:16 l:0 c:fan0 s:0|(invalid)

The invalid value 4294967295(THERMAL_NO_TARGET, defined as UINT_MAX(0xffffffff)) may bother users.

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
Make it easier to debug.
e.g. execute some commands frequently, like:
  cat /proc/thermal/cpu-thermal

Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
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>
Copy link
Collaborator

@GUIDINGLI GUIDINGLI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@GUIDINGLI GUIDINGLI merged commit e74f460 into open-vela:dev Dec 27, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants