1
From a93b56fc57b517f228910355d3a0fe8ff22ebc41 Mon Sep 17 00:00:00 2001
2
From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
3
Date: Mon, 3 Feb 2014 10:26:13 -0800
4
Subject: [PATCH 3/3] Fix compenstion using "Processor" thermal cooling device
6
When any of the processor state is changed, it will impact all
7
processors. If thermal sysfs defines different cdev trip for
8
each processor, if we read and apply, the next processor will
9
already impacted by change by previous cdev.
11
src/thd_cdev_therm_sys_fs.cpp | 7 +++++++
12
1 file changed, 7 insertions(+)
14
diff --git a/src/thd_cdev_therm_sys_fs.cpp b/src/thd_cdev_therm_sys_fs.cpp
15
index b7d16f8..a01d608 100644
16
--- a/src/thd_cdev_therm_sys_fs.cpp
17
+++ b/src/thd_cdev_therm_sys_fs.cpp
18
@@ -54,6 +54,13 @@ int cthd_sysfs_cdev::update() {
19
tc_type_dev << "cooling_device" << index << "/type";
20
if (cdev_sysfs.exists(tc_type_dev.str())) {
21
cdev_sysfs.read(tc_type_dev.str(), type_str);
22
+ if (type_str.size()) {
23
+ // They essentially change same ACPI object, so reading their
24
+ // state from sysfs after a change to any processor will cause
25
+ // double compensation
26
+ if (type_str == "Processor")
31
thd_log_debug("cooling dev %d:%d:%d:%s\n", index, curr_state, max_state,