Skip to content

Commit 9635c58

Browse files
committed
thermal: intel: x86_pkg_temp_thermal: Handle invalid temperature
After commit be0a360 ("thermal: sysfs: Rework the handling of trip point updates"), THERMAL_TEMP_INVALID can be passed to sys_set_trip_temp() and it is treated as a regular temperature value there, so the sysfs write fails even though it is expected to succeed and disable the given trip point. Address this by making sys_set_trip_temp() clear its temp variable when it is equal to THERMAL_TEMP_INVALID. Fixes: be0a360 ("thermal: sysfs: Rework the handling of trip point updates") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Link: https://patch.msgid.link/2815400.mvXUDI8C0e@rafael.j.wysocki
1 parent 75faabf commit 9635c58

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/thermal/intel/x86_pkg_temp_thermal.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,9 @@ sys_set_trip_temp(struct thermal_zone_device *tzd,
128128
u32 l, h, mask, shift, intr;
129129
int tj_max, val, ret;
130130

131+
if (temp == THERMAL_TEMP_INVALID)
132+
temp = 0;
133+
131134
tj_max = intel_tcc_get_tjmax(zonedev->cpu);
132135
if (tj_max < 0)
133136
return tj_max;

0 commit comments

Comments
 (0)