mirror of
https://github.com/torvalds/linux.git
synced 2026-10-26 00:56:03 +01:00
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:
|
||
|---|---|---|
| .. | ||
| broadcom | ||
| intel | ||
| mediatek | ||
| qcom | ||
| renesas | ||
| samsung | ||
| spacemit | ||
| st | ||
| tegra | ||
| testing | ||
| ti-soc-thermal | ||
| airoha_thermal.c | ||
| amlogic_thermal.c | ||
| armada_thermal.c | ||
| cpufreq_cooling.c | ||
| cpuidle_cooling.c | ||
| da9062-thermal.c | ||
| db8500_thermal.c | ||
| devfreq_cooling.c | ||
| dove_thermal.c | ||
| gov_bang_bang.c | ||
| gov_fair_share.c | ||
| gov_power_allocator.c | ||
| gov_step_wise.c | ||
| gov_user_space.c | ||
| hisi_thermal.c | ||
| imx_sc_thermal.c | ||
| imx_thermal.c | ||
| imx8mm_thermal.c | ||
| imx91_thermal.c | ||
| k3_bandgap.c | ||
| k3_j72xx_bandgap.c | ||
| Kconfig | ||
| khadas_mcu_fan.c | ||
| kirkwood_thermal.c | ||
| loongson2_thermal.c | ||
| Makefile | ||
| max77620_thermal.c | ||
| pcie_cooling.c | ||
| qoriq_thermal.c | ||
| rockchip_thermal.c | ||
| spear_thermal.c | ||
| sprd_thermal.c | ||
| sun8i_thermal.c | ||
| thermal_core.c | ||
| thermal_core.h | ||
| thermal_debugfs.c | ||
| thermal_debugfs.h | ||
| thermal_fw.c | ||
| thermal_helpers.c | ||
| thermal_hwmon.c | ||
| thermal_hwmon.h | ||
| thermal_mmio.c | ||
| thermal_netlink.c | ||
| thermal_netlink.h | ||
| thermal_of.c | ||
| thermal_sysfs.c | ||
| thermal_thresholds.c | ||
| thermal_thresholds.h | ||
| thermal_trace_ipa.h | ||
| thermal_trace.h | ||
| thermal_trip.c | ||
| thermal-fw.c | ||
| thermal-generic-adc.c | ||
| uniphier_thermal.c | ||