diff options
author | Anuj Mittal <anuj.mittal@intel.com> | 2018-09-24 17:50:31 +0800 |
---|---|---|
committer | Anuj Mittal <anuj.mittal@intel.com> | 2018-09-27 10:29:14 +0800 |
commit | af677f5e4aba2c027365843d61cb8f9f31de4e91 (patch) | |
tree | d526124ce3d7a8eb1781109248777fe6ac3971a8 | |
parent | ba19605153725d66dc55e0a16962ae684e66c9e4 (diff) | |
download | meta-intel-af677f5e4aba2c027365843d61cb8f9f31de4e91.tar.gz |
thermald: 1.7.2 -> 1.8
Changes from release notes:
- Support of KBL-G with discrete GPU
- Fast removal of any cooling action which was applied once
temperature is normal
- Android support
- Add Hot trip point, which when reached just calls "suspend"
- Adding new tag "DependsOn" which enable/disable trip based on some other trip
- Polling interval can be configured via thermal xml config
- Per trip PID control
- Simplify RAPL cooling device
Also remove upstreamed patches and add a change to fix build failures.
Signed-off-by: Anuj Mittal <anuj.mittal@intel.com>
-rw-r--r-- | recipes-bsp/thermald/files/0001-Include-poll.h-instead-of-sys-poll.h.patch | 36 | ||||
-rw-r--r-- | recipes-bsp/thermald/files/0002-Use-correct-format-specifier-for-X32.patch | 87 | ||||
-rw-r--r-- | recipes-bsp/thermald/thermald/0001-Use-correct-format-specifier-for-size_t.patch | 37 | ||||
-rw-r--r-- | recipes-bsp/thermald/thermald_1.8.bb (renamed from recipes-bsp/thermald/thermald_1.7.2.bb) | 5 |
4 files changed, 39 insertions, 126 deletions
diff --git a/recipes-bsp/thermald/files/0001-Include-poll.h-instead-of-sys-poll.h.patch b/recipes-bsp/thermald/files/0001-Include-poll.h-instead-of-sys-poll.h.patch deleted file mode 100644 index 16d2ff10..00000000 --- a/recipes-bsp/thermald/files/0001-Include-poll.h-instead-of-sys-poll.h.patch +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | From b3de44c28cd930d68c17638575d46e590679f9fe Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Thu, 18 Jan 2018 10:10:40 +0800 | ||
4 | Subject: [PATCH] Include poll.h instead of sys/poll.h | ||
5 | |||
6 | POSIX specifies poll.h to be the correct header name [1]. Also fixes | ||
7 | a warning when built with musl. | ||
8 | |||
9 | | <sysroot>/usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include <sys/poll.h> to <poll.h> [-Werror=cpp] | ||
10 | | #warning redirecting incorrect #include <sys/poll.h> to <poll.h> | ||
11 | |||
12 | [1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/poll.h.html | ||
13 | |||
14 | Upstream-Status: Submitted [https://github.com/intel/thermal_daemon/pull/147] | ||
15 | |||
16 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
17 | --- | ||
18 | src/thd_kobj_uevent.h | 2 +- | ||
19 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
20 | |||
21 | diff --git a/src/thd_kobj_uevent.h b/src/thd_kobj_uevent.h | ||
22 | index d30ea5c..aa8e33f 100644 | ||
23 | --- a/src/thd_kobj_uevent.h | ||
24 | +++ b/src/thd_kobj_uevent.h | ||
25 | @@ -28,7 +28,7 @@ | ||
26 | #include <stdlib.h> | ||
27 | #include <string.h> | ||
28 | |||
29 | -#include <sys/poll.h> | ||
30 | +#include <poll.h> | ||
31 | #include <sys/socket.h> | ||
32 | #include <sys/types.h> | ||
33 | #include <unistd.h> | ||
34 | -- | ||
35 | 2.7.4 | ||
36 | |||
diff --git a/recipes-bsp/thermald/files/0002-Use-correct-format-specifier-for-X32.patch b/recipes-bsp/thermald/files/0002-Use-correct-format-specifier-for-X32.patch deleted file mode 100644 index 893b343a..00000000 --- a/recipes-bsp/thermald/files/0002-Use-correct-format-specifier-for-X32.patch +++ /dev/null | |||
@@ -1,87 +0,0 @@ | |||
1 | From fa6cfd59e52be6a45a067cc770adc62437295085 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Thu, 18 Jan 2018 14:29:09 +0800 | ||
4 | Subject: [PATCH 2/2] Use correct format specifier for X32 | ||
5 | |||
6 | time_t in x32 is of long long type. Using %ld specifier leads | ||
7 | to errors like: | ||
8 | |||
9 | | ../git/src/thd_model.cpp: In member function 'unsigned int cthd_model::update_set_point(unsigned int)': | ||
10 | | ../git/src/thermald.h:74:68: error: format '%ld' expects argument of type 'long int', but argument 4 has type 'time_t {aka long long int}' [-Werror=format=] | ||
11 | | #define thd_log_info(...) g_log(NULL, G_LOG_LEVEL_INFO, __VA_ARGS__) | ||
12 | | ^ | ||
13 | | ../git/src/thd_model.cpp:112:3: note: in expansion of macro 'thd_log_info' | ||
14 | | thd_log_info("update_pid %ld %ld %d %g %d\n", now, last_time, error, | ||
15 | | ^~~~~~~~~~~~ | ||
16 | |||
17 | Use the correct format specifier based on the address model. | ||
18 | |||
19 | Upstream-Status: Submitted [https://github.com/intel/thermal_daemon/pull/147] | ||
20 | |||
21 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
22 | --- | ||
23 | src/thd_model.cpp | 14 ++++++++++++++ | ||
24 | src/thd_trip_point.cpp | 6 ++++++ | ||
25 | 2 files changed, 20 insertions(+) | ||
26 | |||
27 | diff --git a/src/thd_model.cpp b/src/thd_model.cpp | ||
28 | index 5f1d0d7..46b95dc 100644 | ||
29 | --- a/src/thd_model.cpp | ||
30 | +++ b/src/thd_model.cpp | ||
31 | @@ -109,8 +109,14 @@ unsigned int cthd_model::update_set_point(unsigned int curr_temp) { | ||
32 | /*Compute PID Output*/ | ||
33 | output = kp * error + ki * err_sum + kd * d_err; | ||
34 | _setpoint = max_temp - (unsigned int) output; | ||
35 | + | ||
36 | +#if defined __x86_64__ && defined __ILP32__ | ||
37 | + thd_log_info("update_pid %lld %lld %d %g %d\n", now, last_time, error, | ||
38 | + output, _setpoint); | ||
39 | +#else | ||
40 | thd_log_info("update_pid %ld %ld %d %g %d\n", now, last_time, error, | ||
41 | output, _setpoint); | ||
42 | +#endif | ||
43 | if ((_setpoint < 0) || (abs(set_point - _setpoint) > max_compensation)) | ||
44 | set_point -= max_compensation; | ||
45 | else | ||
46 | @@ -134,10 +140,18 @@ void cthd_model::add_sample(int temperature) { | ||
47 | updated_set_point = false; | ||
48 | if (trend_increase_start == 0 && temperature > hot_zone) { | ||
49 | trend_increase_start = tm; | ||
50 | +#if defined __x86_64__ && defined __ILP32__ | ||
51 | + thd_log_debug("Trend increase start %lld\n", trend_increase_start); | ||
52 | +#else | ||
53 | thd_log_debug("Trend increase start %ld\n", trend_increase_start); | ||
54 | +#endif | ||
55 | } else if (trend_increase_start && temperature < hot_zone) { | ||
56 | int _set_point; | ||
57 | +#if defined __x86_64__ && defined __ILP32__ | ||
58 | + thd_log_debug("Trend increase stopped %lld\n", trend_increase_start); | ||
59 | +#else | ||
60 | thd_log_debug("Trend increase stopped %ld\n", trend_increase_start); | ||
61 | +#endif | ||
62 | trend_increase_start = 0; | ||
63 | _set_point = read_set_point(); // Restore set point to a calculated max | ||
64 | if (_set_point > set_point) { | ||
65 | diff --git a/src/thd_trip_point.cpp b/src/thd_trip_point.cpp | ||
66 | index dd1b881..170adcf 100644 | ||
67 | --- a/src/thd_trip_point.cpp | ||
68 | +++ b/src/thd_trip_point.cpp | ||
69 | @@ -132,9 +132,15 @@ bool cthd_trip_point::thd_trip_point_check(int id, unsigned int read_temp, | ||
70 | time_t tm; | ||
71 | time(&tm); | ||
72 | if ((tm - cdevs[i].last_op_time) < cdevs[i].sampling_priod) { | ||
73 | +#if defined __x86_64__ && defined __ILP32__ | ||
74 | + thd_log_info("Too early to act index %d tm %lld\n", | ||
75 | + cdev->thd_cdev_get_index(), | ||
76 | + tm - cdevs[i].last_op_time); | ||
77 | +#else | ||
78 | thd_log_info("Too early to act index %d tm %ld\n", | ||
79 | cdev->thd_cdev_get_index(), | ||
80 | tm - cdevs[i].last_op_time); | ||
81 | +#endif | ||
82 | break; | ||
83 | } | ||
84 | cdevs[i].last_op_time = tm; | ||
85 | -- | ||
86 | 2.7.4 | ||
87 | |||
diff --git a/recipes-bsp/thermald/thermald/0001-Use-correct-format-specifier-for-size_t.patch b/recipes-bsp/thermald/thermald/0001-Use-correct-format-specifier-for-size_t.patch new file mode 100644 index 00000000..6897ffc1 --- /dev/null +++ b/recipes-bsp/thermald/thermald/0001-Use-correct-format-specifier-for-size_t.patch | |||
@@ -0,0 +1,37 @@ | |||
1 | From bb7631163c8f3f44d0dc83690765cdb799664fd5 Mon Sep 17 00:00:00 2001 | ||
2 | From: Anuj Mittal <anuj.mittal@intel.com> | ||
3 | Date: Wed, 26 Sep 2018 10:34:15 +0800 | ||
4 | Subject: [PATCH] Use correct format specifier for size_t | ||
5 | |||
6 | %zu instead of %lu, otherwise on 32 bit: | ||
7 | |||
8 | | ../git/src/thd_zone.cpp: In member function 'void cthd_zone::sort_and_update_poll_trip()': | ||
9 | | ../git/src/thd_zone.cpp:106:16: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'std::vector<cthd_trip_point>::size_type' {aka 'unsigned int'} [-Werror=format=] | ||
10 | | thd_log_debug("sort_and_update_poll_trip: trip_points_size =%lu\n", | ||
11 | | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
12 | | trip_points.size()); | ||
13 | |||
14 | Upstream-Status: Submitted | ||
15 | [https://github.com/intel/thermal_daemon/pull/165] | ||
16 | |||
17 | Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> | ||
18 | --- | ||
19 | src/thd_zone.cpp | 2 +- | ||
20 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
21 | |||
22 | diff --git a/src/thd_zone.cpp b/src/thd_zone.cpp | ||
23 | index b7edf9e..cb7b8e8 100644 | ||
24 | --- a/src/thd_zone.cpp | ||
25 | +++ b/src/thd_zone.cpp | ||
26 | @@ -103,7 +103,7 @@ int cthd_zone::read_user_set_psv_temp() { | ||
27 | } | ||
28 | |||
29 | void cthd_zone::sort_and_update_poll_trip() { | ||
30 | - thd_log_debug("sort_and_update_poll_trip: trip_points_size =%lu\n", | ||
31 | + thd_log_debug("sort_and_update_poll_trip: trip_points_size =%zu\n", | ||
32 | trip_points.size()); | ||
33 | if (trip_points.size()) { | ||
34 | unsigned int polling_trip = 0; | ||
35 | -- | ||
36 | 2.17.1 | ||
37 | |||
diff --git a/recipes-bsp/thermald/thermald_1.7.2.bb b/recipes-bsp/thermald/thermald_1.8.bb index 506cd4c8..f7725f31 100644 --- a/recipes-bsp/thermald/thermald_1.7.2.bb +++ b/recipes-bsp/thermald/thermald_1.8.bb | |||
@@ -14,10 +14,9 @@ LICENSE = "GPLv2" | |||
14 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea8831610e926e2e469075b52bf08848" | 14 | LIC_FILES_CHKSUM = "file://COPYING;md5=ea8831610e926e2e469075b52bf08848" |
15 | 15 | ||
16 | SRC_URI = "git://github.com/intel/thermal_daemon/ \ | 16 | SRC_URI = "git://github.com/intel/thermal_daemon/ \ |
17 | file://0001-Include-poll.h-instead-of-sys-poll.h.patch \ | 17 | file://0001-Use-correct-format-specifier-for-size_t.patch \ |
18 | file://0002-Use-correct-format-specifier-for-X32.patch \ | ||
19 | " | 18 | " |
20 | SRCREV = "855c91c91b3b5b52c02cb1adc0dd940f8a39df1b" | 19 | SRCREV = "517c0e5f92d49aeeef3a22b04caf40d588216827" |
21 | S = "${WORKDIR}/git" | 20 | S = "${WORKDIR}/git" |
22 | 21 | ||
23 | inherit pkgconfig autotools systemd | 22 | inherit pkgconfig autotools systemd |