Skip to content

Commit

Permalink
thermal: core: Do not call handle_thermal_trip() if zone temperature …
Browse files Browse the repository at this point in the history
…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: 9ad1804 ("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>
  • Loading branch information
Rafael J. Wysocki committed Apr 30, 2024
1 parent 1502718 commit 202aa0d
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/thermal/thermal_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 202aa0d

Please sign in to comment.