summaryrefslogtreecommitdiff
path: root/drivers/thermal/intel/x86_pkg_temp_thermal.c
diff options
context:
space:
mode:
authorSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>2021-04-30 05:23:43 -0700
committerDaniel Lezcano <daniel.lezcano@linaro.org>2021-05-14 09:37:27 +0200
commiteb8500b874cf295971a6a2a04e14eb0854197a3c (patch)
treeec845b66d41c4a75706cdb605f39fc569a3d5a2e /drivers/thermal/intel/x86_pkg_temp_thermal.c
parent6efb943b8616ec53a5e444193dccf1af9ad627b5 (diff)
thermal/drivers/intel: Initialize RW trip to THERMAL_TEMP_INVALID
After commit 81ad4276b505 ("Thermal: Ignore invalid trip points") all user_space governor notifications via RW trip point is broken in intel thermal drivers. This commits marks trip_points with value of 0 during call to thermal_zone_device_register() as invalid. RW trip points can be 0 as user space will set the correct trip temperature later. During driver init, x86_package_temp and all int340x drivers sets RW trip temperature as 0. This results in all these trips marked as invalid by the thermal core. To fix this initialize RW trips to THERMAL_TEMP_INVALID instead of 0. Cc: <stable@vger.kernel.org> Signed-off-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20210430122343.1789899-1-srinivas.pandruvada@linux.intel.com
Diffstat (limited to 'drivers/thermal/intel/x86_pkg_temp_thermal.c')
-rw-r--r--drivers/thermal/intel/x86_pkg_temp_thermal.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/thermal/intel/x86_pkg_temp_thermal.c b/drivers/thermal/intel/x86_pkg_temp_thermal.c
index 295742e83960..4d8edc61a78b 100644
--- a/drivers/thermal/intel/x86_pkg_temp_thermal.c
+++ b/drivers/thermal/intel/x86_pkg_temp_thermal.c
@@ -166,7 +166,7 @@ static int sys_get_trip_temp(struct thermal_zone_device *tzd,
if (thres_reg_value)
*temp = zonedev->tj_max - thres_reg_value * 1000;
else
- *temp = 0;
+ *temp = THERMAL_TEMP_INVALID;
pr_debug("sys_get_trip_temp %d\n", *temp);
return 0;