summaryrefslogtreecommitdiff
path: root/drivers/uio
diff options
context:
space:
mode:
authorRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-05-17 11:24:03 +0200
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2024-05-17 12:37:33 +0200
commit8c69a777e480174b1fdd75dab5ad584454dd6555 (patch)
tree486e24e6d062012ce557678493bd3eeb862d4554 /drivers/uio
parent9dbbcd6c83ce1fbf634562ac2b8b5aef4e116b60 (diff)
downloadlinux-8c69a777e480174b1fdd75dab5ad584454dd6555.tar.gz
linux-8c69a777e480174b1fdd75dab5ad584454dd6555.tar.bz2
linux-8c69a777e480174b1fdd75dab5ad584454dd6555.zip
thermal: core: Fix the handling of invalid trip points
Commit 9ad18043fb35 ("thermal: core: Send trip crossing notifications at init time if needed") overlooked the case when a trip point that has started as invalid is set to a valid temperature later. Namely, the initial threshold value for all trips is zero, so if a previously invalid trip becomes valid and its (new) low temperature is above the zone temperature, a spurious trip crossing notification will occur and it may trigger the WARN_ON() in handle_thermal_trip(). To address this, set the initial threshold for all trips to INT_MAX. There is also the case when a valid writable trip becomes invalid that requires special handling. First, in accordance with the change mentioned above, the trip's threshold needs to be set to INT_MAX to avoid the same issue. Second, if the trip in question is passive and it has been crossed by the thermal zone temperature on the way up, the zone's passive count has been incremented and it is in the passive polling mode, so its passive count needs to be adjusted to allow the passive polling to be turned off eventually. Fixes: 9ad18043fb35 ("thermal: core: Send trip crossing notifications at init time if needed") Fixes: 042a3d80f118 ("thermal: core: Move passive polling management to the core") Reported-by: Zhang Rui <zhang.rui@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com> Tested-by: Wendy Wang <wendy.wang@intel.com>
Diffstat (limited to 'drivers/uio')
0 files changed, 0 insertions, 0 deletions