linux/drivers/thermal
Manaf Meethalavalappu Pallikunhi ec0d89150a thermal: gov_step_wise: Fix stale mitigation vote with non-zero lower bounds
When two or more thermal zones bind to a common cooling device and one zone
uses a non-zero instance->lower value, there is a bug where the instance
holds a stale mitigation vote even after its trip is cleared.

Problem scenario:
- thermal-zone1: Trip at 50°C, cooling-map with lower=0
- thermal-zone2: Trip at 55°C, cooling-map with lower=2
- Both zones share the same cooling device (e.g., CPU)

Issue flow:
1. Both trips trigger, zone1 requests state 5, zone2 also mitigates
2. Zone2 trip clears (temp < 53°C due to hysteresis)
3. When throttle=false and trend=THERMAL_TREND_DROPPING:
   - Current code checks: if (cur_state <= instance->lower)
     return THERMAL_NO_TARGET
   - Since cur_state (5) > instance->lower (2),
     it returns instance->lower (2)
   - This is the BUG where it returns instance->lower even though
     trip is cleared
4. Zone2's passive polling stops (tz->passive reaches 0) - no more updates
   for zone2
5. Zone2's stale vote of 2 persists indefinitely
6. Even when zone1 wants to reduce cooling to state, the cooling device
   cannot go below state 2 due to zone2's stale vote

When a trip is cleared (throttle == false), always return THERMAL_NO_TARGET
instead of instance->lower. Remove the unnecessary check comparing
cur_state with instance->lower. Since passive polling is already
deactivated when the trip is cleared, the instance should always be
deactivated regardless of its current cooling state. This ensures that
instances with non-zero lower bounds do not retain stale mitigation votes
after their trips are cleared.

Fixes: 042a3d80f1 ("thermal: core: Move passive polling management to the core")
Signed-off-by: Manaf Meethalavalappu Pallikunhi <manaf.pallikunhi@oss.qualcomm.com>
Link: https://patch.msgid.link/20260922-step_wise_multi_zone_stale_vote_fix-v1-1-789f68dab229@oss.qualcomm.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
2026-09-22 21:16:11 +02:00
..
broadcom thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
intel - Get rid of static_cpu_has() - one less API to care about testing CPU 2026-08-18 19:09:42 -07:00
mediatek thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
qcom More thermal control updates for 7.3-rc1 2026-08-26 14:21:30 -07:00
renesas More thermal control updates for 7.3-rc1 2026-08-26 14:21:30 -07:00
samsung thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
spacemit thermal/drivers/spacemit: Validate clamped trip thresholds 2026-08-07 17:18:53 +02:00
st thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
tegra thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
testing thermal: testing: zone: Flush work items during cleanup 2026-06-24 14:59:25 +02:00
ti-soc-thermal
airoha_thermal.c thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
amlogic_thermal.c thermal/drivers/amlogic: Add support for secure monitor calibration readout 2026-06-03 09:12:17 +02:00
armada_thermal.c thermal/drivers/armada: Fix missing bitfields include 2026-08-18 13:09:22 +02:00
cpufreq_cooling.c thermal/of: Add cooling device ID support 2026-06-03 09:12:55 +02:00
cpuidle_cooling.c thermal/of: Add cooling device ID support 2026-06-03 09:12:55 +02:00
da9062-thermal.c thermal: Constify struct thermal_zone_device_ops 2025-07-15 15:26:04 +02:00
db8500_thermal.c MFD for v7.3 2026-08-27 10:45:08 -07:00
devfreq_cooling.c thermal/of: Add cooling device ID support 2026-06-03 09:12:55 +02:00
dove_thermal.c thermal: Constify struct thermal_zone_device_ops 2025-07-15 15:26:04 +02:00
gov_bang_bang.c
gov_fair_share.c
gov_power_allocator.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
gov_step_wise.c thermal: gov_step_wise: Fix stale mitigation vote with non-zero lower bounds 2026-09-22 21:16:11 +02:00
gov_user_space.c
hisi_thermal.c thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
imx_sc_thermal.c
imx_thermal.c thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
imx8mm_thermal.c
imx91_thermal.c thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
k3_bandgap.c
k3_j72xx_bandgap.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
Kconfig thermal/drivers/spacemit/k1: Add thermal sensor support 2026-06-03 09:12:31 +02:00
khadas_mcu_fan.c thermal/of: Rename the devm_thermal_of_cooling_device_register() function 2026-06-03 09:12:53 +02:00
kirkwood_thermal.c thermal: Constify struct thermal_zone_device_ops 2025-07-15 15:26:04 +02:00
loongson2_thermal.c thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
Makefile thermal/drivers/spacemit/k1: Add thermal sensor support 2026-06-03 09:12:31 +02:00
max77620_thermal.c thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
pcie_cooling.c
qoriq_thermal.c thermal/drivers/qoriq: Disable clock on resume failure 2026-08-07 17:18:50 +02:00
rockchip_thermal.c thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
spear_thermal.c thermal/drivers/spear: Fix error condition for reading st,thermal-flags 2026-03-27 11:26:43 +01:00
sprd_thermal.c thermal/drivers/sprd: Use min instead of clamp in sprd_thm_temp_to_rawdata 2026-03-10 11:54:12 +01:00
sun8i_thermal.c thermal: Remove unneeded 'fast_io' parameter in regmap_config 2026-07-27 13:51:56 +02:00
thermal_core.c Revert "thermal/core: Allocate the thermal class dynamically" 2026-08-25 21:08:46 +02:00
thermal_core.h thermal/of: Move cooling device OF helpers out of thermal core 2026-06-03 09:12:50 +02:00
thermal_debugfs.c Convert 'alloc_flex' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
thermal_debugfs.h
thermal_fw.c thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
thermal_helpers.c
thermal_hwmon.c thermal: hwmon: Remove hwmon class device along with its parent 2026-08-05 13:57:39 +02:00
thermal_hwmon.h
thermal_mmio.c
thermal_netlink.c
thermal_netlink.h
thermal_of.c thermal/of: Fix trivial enabled typo 2026-08-07 17:18:40 +02:00
thermal_sysfs.c thermal: sysfs: switch to use scnprintf() to suppress truncation warning 2026-09-04 15:49:46 +02:00
thermal_thresholds.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
thermal_thresholds.h
thermal_trace_ipa.h
thermal_trace.h
thermal_trip.c
thermal-fw.c thermal/drivers: Remove redundant error messages on IRQ request failure 2026-08-07 17:27:28 +02:00
thermal-generic-adc.c iio: inkern: Use namespaced exports 2026-07-05 01:37:19 +01:00
uniphier_thermal.c