From af677f5e4aba2c027365843d61cb8f9f31de4e91 Mon Sep 17 00:00:00 2001 From: Anuj Mittal Date: Mon, 24 Sep 2018 17:50:31 +0800 Subject: 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 --- ...0001-Include-poll.h-instead-of-sys-poll.h.patch | 36 --------- ...0002-Use-correct-format-specifier-for-X32.patch | 87 ---------------------- ...1-Use-correct-format-specifier-for-size_t.patch | 37 +++++++++ recipes-bsp/thermald/thermald_1.7.2.bb | 36 --------- recipes-bsp/thermald/thermald_1.8.bb | 35 +++++++++ 5 files changed, 72 insertions(+), 159 deletions(-) delete mode 100644 recipes-bsp/thermald/files/0001-Include-poll.h-instead-of-sys-poll.h.patch delete mode 100644 recipes-bsp/thermald/files/0002-Use-correct-format-specifier-for-X32.patch create mode 100644 recipes-bsp/thermald/thermald/0001-Use-correct-format-specifier-for-size_t.patch delete mode 100644 recipes-bsp/thermald/thermald_1.7.2.bb create mode 100644 recipes-bsp/thermald/thermald_1.8.bb 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 @@ -From b3de44c28cd930d68c17638575d46e590679f9fe Mon Sep 17 00:00:00 2001 -From: Anuj Mittal -Date: Thu, 18 Jan 2018 10:10:40 +0800 -Subject: [PATCH] Include poll.h instead of sys/poll.h - -POSIX specifies poll.h to be the correct header name [1]. Also fixes -a warning when built with musl. - - | /usr/include/sys/poll.h:1:2: warning: #warning redirecting incorrect #include to [-Werror=cpp] - | #warning redirecting incorrect #include to - -[1] http://pubs.opengroup.org/onlinepubs/9699919799/basedefs/poll.h.html - -Upstream-Status: Submitted [https://github.com/intel/thermal_daemon/pull/147] - -Signed-off-by: Anuj Mittal ---- - src/thd_kobj_uevent.h | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/src/thd_kobj_uevent.h b/src/thd_kobj_uevent.h -index d30ea5c..aa8e33f 100644 ---- a/src/thd_kobj_uevent.h -+++ b/src/thd_kobj_uevent.h -@@ -28,7 +28,7 @@ - #include - #include - --#include -+#include - #include - #include - #include --- -2.7.4 - 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 @@ -From fa6cfd59e52be6a45a067cc770adc62437295085 Mon Sep 17 00:00:00 2001 -From: Anuj Mittal -Date: Thu, 18 Jan 2018 14:29:09 +0800 -Subject: [PATCH 2/2] Use correct format specifier for X32 - -time_t in x32 is of long long type. Using %ld specifier leads -to errors like: - -| ../git/src/thd_model.cpp: In member function 'unsigned int cthd_model::update_set_point(unsigned int)': -| ../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=] -| #define thd_log_info(...) g_log(NULL, G_LOG_LEVEL_INFO, __VA_ARGS__) -| ^ -| ../git/src/thd_model.cpp:112:3: note: in expansion of macro 'thd_log_info' -| thd_log_info("update_pid %ld %ld %d %g %d\n", now, last_time, error, -| ^~~~~~~~~~~~ - -Use the correct format specifier based on the address model. - -Upstream-Status: Submitted [https://github.com/intel/thermal_daemon/pull/147] - -Signed-off-by: Anuj Mittal ---- - src/thd_model.cpp | 14 ++++++++++++++ - src/thd_trip_point.cpp | 6 ++++++ - 2 files changed, 20 insertions(+) - -diff --git a/src/thd_model.cpp b/src/thd_model.cpp -index 5f1d0d7..46b95dc 100644 ---- a/src/thd_model.cpp -+++ b/src/thd_model.cpp -@@ -109,8 +109,14 @@ unsigned int cthd_model::update_set_point(unsigned int curr_temp) { - /*Compute PID Output*/ - output = kp * error + ki * err_sum + kd * d_err; - _setpoint = max_temp - (unsigned int) output; -+ -+#if defined __x86_64__ && defined __ILP32__ -+ thd_log_info("update_pid %lld %lld %d %g %d\n", now, last_time, error, -+ output, _setpoint); -+#else - thd_log_info("update_pid %ld %ld %d %g %d\n", now, last_time, error, - output, _setpoint); -+#endif - if ((_setpoint < 0) || (abs(set_point - _setpoint) > max_compensation)) - set_point -= max_compensation; - else -@@ -134,10 +140,18 @@ void cthd_model::add_sample(int temperature) { - updated_set_point = false; - if (trend_increase_start == 0 && temperature > hot_zone) { - trend_increase_start = tm; -+#if defined __x86_64__ && defined __ILP32__ -+ thd_log_debug("Trend increase start %lld\n", trend_increase_start); -+#else - thd_log_debug("Trend increase start %ld\n", trend_increase_start); -+#endif - } else if (trend_increase_start && temperature < hot_zone) { - int _set_point; -+#if defined __x86_64__ && defined __ILP32__ -+ thd_log_debug("Trend increase stopped %lld\n", trend_increase_start); -+#else - thd_log_debug("Trend increase stopped %ld\n", trend_increase_start); -+#endif - trend_increase_start = 0; - _set_point = read_set_point(); // Restore set point to a calculated max - if (_set_point > set_point) { -diff --git a/src/thd_trip_point.cpp b/src/thd_trip_point.cpp -index dd1b881..170adcf 100644 ---- a/src/thd_trip_point.cpp -+++ b/src/thd_trip_point.cpp -@@ -132,9 +132,15 @@ bool cthd_trip_point::thd_trip_point_check(int id, unsigned int read_temp, - time_t tm; - time(&tm); - if ((tm - cdevs[i].last_op_time) < cdevs[i].sampling_priod) { -+#if defined __x86_64__ && defined __ILP32__ -+ thd_log_info("Too early to act index %d tm %lld\n", -+ cdev->thd_cdev_get_index(), -+ tm - cdevs[i].last_op_time); -+#else - thd_log_info("Too early to act index %d tm %ld\n", - cdev->thd_cdev_get_index(), - tm - cdevs[i].last_op_time); -+#endif - break; - } - cdevs[i].last_op_time = tm; --- -2.7.4 - 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 @@ +From bb7631163c8f3f44d0dc83690765cdb799664fd5 Mon Sep 17 00:00:00 2001 +From: Anuj Mittal +Date: Wed, 26 Sep 2018 10:34:15 +0800 +Subject: [PATCH] Use correct format specifier for size_t + +%zu instead of %lu, otherwise on 32 bit: + +| ../git/src/thd_zone.cpp: In member function 'void cthd_zone::sort_and_update_poll_trip()': +| ../git/src/thd_zone.cpp:106:16: error: format '%lu' expects argument of type 'long unsigned int', but argument 4 has type 'std::vector::size_type' {aka 'unsigned int'} [-Werror=format=] +| thd_log_debug("sort_and_update_poll_trip: trip_points_size =%lu\n", +| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +| trip_points.size()); + +Upstream-Status: Submitted +[https://github.com/intel/thermal_daemon/pull/165] + +Signed-off-by: Anuj Mittal +--- + src/thd_zone.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/thd_zone.cpp b/src/thd_zone.cpp +index b7edf9e..cb7b8e8 100644 +--- a/src/thd_zone.cpp ++++ b/src/thd_zone.cpp +@@ -103,7 +103,7 @@ int cthd_zone::read_user_set_psv_temp() { + } + + void cthd_zone::sort_and_update_poll_trip() { +- thd_log_debug("sort_and_update_poll_trip: trip_points_size =%lu\n", ++ thd_log_debug("sort_and_update_poll_trip: trip_points_size =%zu\n", + trip_points.size()); + if (trip_points.size()) { + unsigned int polling_trip = 0; +-- +2.17.1 + diff --git a/recipes-bsp/thermald/thermald_1.7.2.bb b/recipes-bsp/thermald/thermald_1.7.2.bb deleted file mode 100644 index 506cd4c8..00000000 --- a/recipes-bsp/thermald/thermald_1.7.2.bb +++ /dev/null @@ -1,36 +0,0 @@ -SUMMARY = "Linux thermal daemon" - -DESCRIPTION = "Thermal Daemon is a Linux daemon used to prevent the \ -overheating of platforms. This daemon monitors temperature and applies \ -compensation using available cooling methods." - -HOMEPAGE = "https://github.com/01org/thermal_daemon" - -DEPENDS = "dbus dbus-glib dbus-glib-native libxml2 glib-2.0 glib-2.0-native" -DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}" -DEPENDS_append_libc-musl = " argp-standalone" -DEPENDS_append_toolchain-clang = " openmp" -LICENSE = "GPLv2" -LIC_FILES_CHKSUM = "file://COPYING;md5=ea8831610e926e2e469075b52bf08848" - -SRC_URI = "git://github.com/intel/thermal_daemon/ \ - file://0001-Include-poll.h-instead-of-sys-poll.h.patch \ - file://0002-Use-correct-format-specifier-for-X32.patch \ - " -SRCREV = "855c91c91b3b5b52c02cb1adc0dd940f8a39df1b" -S = "${WORKDIR}/git" - -inherit pkgconfig autotools systemd - -FILES_${PN} += "${datadir}/dbus-1/system-services/*.service" - -SYSTEMD_SERVICE_${PN} = "thermald.service" - -COMPATIBLE_HOST = '(i.86|x86_64).*-linux' - -CONFFILES_${PN} = " \ - ${sysconfdir}/thermald/thermal-conf.xml \ - ${sysconfdir}/thermald/thermal-cpu-cdev-order.xml \ - " - -UPSTREAM_CHECK_URI = "https://github.com/01org/thermal_daemon/releases" diff --git a/recipes-bsp/thermald/thermald_1.8.bb b/recipes-bsp/thermald/thermald_1.8.bb new file mode 100644 index 00000000..f7725f31 --- /dev/null +++ b/recipes-bsp/thermald/thermald_1.8.bb @@ -0,0 +1,35 @@ +SUMMARY = "Linux thermal daemon" + +DESCRIPTION = "Thermal Daemon is a Linux daemon used to prevent the \ +overheating of platforms. This daemon monitors temperature and applies \ +compensation using available cooling methods." + +HOMEPAGE = "https://github.com/01org/thermal_daemon" + +DEPENDS = "dbus dbus-glib dbus-glib-native libxml2 glib-2.0 glib-2.0-native" +DEPENDS += "${@bb.utils.contains('DISTRO_FEATURES','systemd','systemd','',d)}" +DEPENDS_append_libc-musl = " argp-standalone" +DEPENDS_append_toolchain-clang = " openmp" +LICENSE = "GPLv2" +LIC_FILES_CHKSUM = "file://COPYING;md5=ea8831610e926e2e469075b52bf08848" + +SRC_URI = "git://github.com/intel/thermal_daemon/ \ + file://0001-Use-correct-format-specifier-for-size_t.patch \ + " +SRCREV = "517c0e5f92d49aeeef3a22b04caf40d588216827" +S = "${WORKDIR}/git" + +inherit pkgconfig autotools systemd + +FILES_${PN} += "${datadir}/dbus-1/system-services/*.service" + +SYSTEMD_SERVICE_${PN} = "thermald.service" + +COMPATIBLE_HOST = '(i.86|x86_64).*-linux' + +CONFFILES_${PN} = " \ + ${sysconfdir}/thermald/thermal-conf.xml \ + ${sysconfdir}/thermald/thermal-cpu-cdev-order.xml \ + " + +UPSTREAM_CHECK_URI = "https://github.com/01org/thermal_daemon/releases" -- cgit v1.2.3-54-g00ecf