summaryrefslogtreecommitdiff
path: root/drivers/thermal/thermal_core.c
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-04-30 18:45:55 +0300
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-04-30 22:16:13 +0300
commit202aa0d4bb532338cd27bcc64c60abc2987a2be7 (patch)
tree50275337d625cff8507556be3ac83a5cbc0dc886 /drivers/thermal/thermal_core.c
parent1502718a66c573cb2df811da67d8de7bf5c4657e (diff)
downloadlinux-202aa0d4bb532338cd27bcc64c60abc2987a2be7.tar.xz
thermal: core: Do not call handle_thermal_trip() if zone temperature is invalid
Make __thermal_zone_device_update() bail out if update_temperature() fails to update the zone temperature because __thermal_zone_get_temp() has returned an error and the current zone temperature is THERMAL_TEMP_INVALID (user space receiving netlink thermal messages, thermal debug code and thermal governors may get confused otherwise). Fixes: 9ad18043fb35 ("thermal: core: Send trip crossing notifications at init time if needed") Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Reviewed-by: Lukasz Luba <lukasz.luba@arm.com> Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Diffstat (limited to 'drivers/thermal/thermal_core.c')
-rw-r--r--drivers/thermal/thermal_core.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c
index f43237ef2cd0..8bffd9101a32 100644
--- a/drivers/thermal/thermal_core.c
+++ b/drivers/thermal/thermal_core.c
@@ -487,6 +487,9 @@ void __thermal_zone_device_update(struct thermal_zone_device *tz,
update_temperature(tz);
+ if (tz->temperature == THERMAL_TEMP_INVALID)
+ return;
+
__thermal_zone_set_trips(tz);
tz->notify_event = event;