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
wangjianyu3
975eddaac5
Thermal/procfs: Do not print invalid target cooling state directly
...
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>
2024-12-26 09:23:10 +08:00
wangjianyu3
e06ff62063
Thermal/dummy: Add temperature jump to test hysteresis
...
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>
2024-12-26 09:23:10 +08:00
wangjianyu3
8c5a61d93c
Thermal: The thermal core depends on LPWORK
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-12-26 09:23:10 +08:00
chao an
86ffd45707
drivers/virtio: fix typo deivce -> device
...
Signed-off-by: chao an <anchao@lixiang.com>
2024-12-17 20:48:07 +08:00
Alin Jerpelea
286d37026c
drivers: migrate to SPDX identifier
...
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
2024-11-06 18:02:25 +08:00
xuxin19
4667163152
cmake:add driver thermal CMake scripts
...
Signed-off-by: xuxin19 <xuxin19@xiaomi.com>
2024-10-13 02:25:06 +08:00
wangjianyu3
a73ee73c78
Thermal/dummy: Fix depends error
...
1. cpufreq.h not found if cpufreq is not supported on some branches.
./thermal/thermal_dummy.c:25:10: fatal error: nuttx/cpufreq.h: No such file or directory
25 | #include <nuttx/cpufreq.h>
| ^~~~~~~~~~~~~~~~~
compilation terminated.
2. debug.h is included by including <nuttx/cpufreq.h>, should not.
CC: thermal/thermal_dummy.c thermal/thermal_dummy.c: In function ‘thermal_dummy_init’:
thermal/thermal_dummy.c:338:7: warning: implicit declaration of function ‘therr’ [-Wimplicit-function-declaration]
338 | therr("Register cooling device fan0 failed!\n");
|
https://github.com/apache/nuttx/pull/12824
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
efd7e31b3a
Thermal/procfs: Remove unnecessary nxmutex_unlock
...
https://github.com/apache/nuttx/pull/12824
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
88cc4b1120
Thermal/procfs: Disabled immediately after enabling.
...
When exec "echo 1 > /proc/thermal/cpu-thermal", procfs get "\n" after "1", treat as disable:
```
#1 0x000000000040f452 in thermal_procfs_write (filep=0x7ffff3d241e8, buffer=0x7ffff3d344fc "\n", buflen=1) at thermal/thermal_procfs.c:179
```
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
d5ffed635b
Thermal/dummy: Get cpufreq_driver from cpufreq_policy.
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
e8758eb974
Thermal/step_wise: Increase cooling state in case of "stable" trend and "hot" trip.
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
68d5516c90
Thermal/dummy: Fix warning
...
```
CID 1159822: (#1 of 2): 宏将无符号值与 0 做了比较 (NO_EFFECT)
unsigned_compare: 不带符号值的此 greater-than-or-equal-to-zero 比较总是为 true。index >= 0U。
```
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
515c3978dd
Thermal: Check trip type in thermal_zone_device_register().
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
f96d3798a1
Thermal: remove assert of thermal_zone_device_update()
...
Called by both of lpwork and Idle_Task:
[ 0.000000] [ 0] [ INFO] [ap] thermal_zone_device_register: Registered zone device cpu-thermal
[ 0.000000] [ 0] [ EMERG] [ap] _assert: Current Version: NuttX ap 0.0.0 Dec 11 2023 20:59:20 sim
[ 0.000000] [ 0] [ EMERG] [ap] _assert: Assertion failed : at file: thermal/thermal_core.c:820 task: Idle_Task process: Kernel 0x32ade29
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
d43f0272e5
Thermal: Add dummy driver
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
b30f866f80
Thermal: Add procfs file nodes
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
520e4042ce
Thermal: Register pm suspend notifier
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
2f285a04f9
Thermal: Support cpufreq cooling device
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
338b5d7415
Thermal: Support step_wise governor
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00
wangjianyu3
d1b87bd021
Add thermal framework
...
Signed-off-by: wangjianyu3 <wangjianyu3@xiaomi.com>
2024-09-23 08:57:29 +08:00