summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-08-07 20:01:24 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2023-08-10 20:57:35 +0200
commitbc840ea5f9a98cfab61f6f8f70a73dac43db27d0 (patch)
tree086278355f0dcc5d277dbc66be19b5129c54bbd2
parent1996e9d73217276297ee09c0d57af911c6d468ef (diff)
downloadlinux-stable-bc840ea5f9a98cfab61f6f8f70a73dac43db27d0.tar.gz
linux-stable-bc840ea5f9a98cfab61f6f8f70a73dac43db27d0.tar.bz2
linux-stable-bc840ea5f9a98cfab61f6f8f70a73dac43db27d0.zip
thermal: core: Do not handle trip points with invalid temperature
Trip points with temperature set to THERMAL_TEMP_INVALID are as good as disabled, so make handle_thermal_trip() ignore them. Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Acked-by: Daniel Lezcano <daniel.lezcano@linaro.org>
-rw-r--r--drivers/thermal/thermal_core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index 842f678c1c3e..b38abe8a080a 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -348,7 +348,8 @@ static void handle_thermal_trip(struct thermal_zone_device *tz, int trip_id)
struct thermal_trip trip;
/* Ignore disabled trip points */
- if (test_bit(trip_id, &tz->trips_disabled))
+ if (test_bit(trip_id, &tz->trips_disabled) ||
+ trip.temperature == THERMAL_TEMP_INVALID)
return;
__thermal_zone_get_trip(tz, trip_id, &trip);