linux-stable/drivers/thermal
Viresh Kumar a51afb1331 thermal: cpufreq_cooling: freq_qos_update_request() returns < 0 on error
freq_qos_update_request() returns 1 if the effective constraint value
has changed, 0 if the effective constraint value has not changed, or a
negative error code on failures.

The frequency constraints for CPUs can be set by different parts of the
kernel. If the maximum frequency constraint set by other parts of the
kernel are set at a lower value than the one corresponding to cooling
state 0, then we will never be able to cool down the system as
freq_qos_update_request() will keep on returning 0 and we will skip
updating cpufreq_state and thermal pressure.

Fix that by doing the updates even in the case where
freq_qos_update_request() returns 0, as we have effectively set the
constraint to a new value even if the consolidated value of the
actual constraint is unchanged because of external factors.

Cc: v5.7+ <stable@vger.kernel.org> # v5.7+
Reported-by: Thara Gopinath <thara.gopinath@linaro.org>
Fixes: f12e4f66ab ("thermal/cpu-cooling: Update thermal pressure in case of a maximum frequency capping")
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: Lukasz Luba <lukasz.luba@arm.com>
Tested-by: Lukasz Luba <lukasz.luba@arm.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Tested-by: Thara Gopinath<thara.gopinath@linaro.org>
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/b2b7e84944937390256669df5a48ce5abba0c1ef.1613540713.git.viresh.kumar@linaro.org
2021-02-17 18:53:19 +01:00
..
broadcom thermal: broadcom: simplify the return expression of bcm2711_thermal_probe() 2020-12-10 18:29:43 +01:00
intel thermal: intel: pch: Fix unexpected shutdown at critical temperature 2021-01-19 22:30:25 +01:00
qcom thermal: qcom: Fix comparison with uninitialized variable channels_available 2021-02-16 19:05:23 +01:00
samsung thermal: exynos: Silence warning during deferred probe 2020-03-12 11:56:53 +01:00
st thermal: stm32: simplify the return expression of stm_thermal_prepare() 2020-10-12 12:08:35 +02:00
tegra
ti-soc-thermal thermal: ti-soc-thermal: Use non-inverted define for omap4 2021-02-15 21:19:32 +01:00
amlogic_thermal.c thermal: amlogic: Add hwmon support 2020-11-16 10:30:53 +01:00
armada_thermal.c thermal: Explicitly enable non-changing thermal zone devices 2020-06-29 20:26:37 +02:00
cpufreq_cooling.c thermal: cpufreq_cooling: freq_qos_update_request() returns < 0 on error 2021-02-17 18:53:19 +01:00
cpuidle_cooling.c thermal/idle_inject: Fix comment of idle_duration_us and name of latency_ns 2020-10-12 12:08:35 +02:00
da9062-thermal.c thermal/core: Remove ms based delay fields 2021-01-19 22:23:49 +01:00
db8500_thermal.c
devfreq_cooling.c thermal/drivers/devfreq_cooling: Fix the build when !ENERGY_MODEL 2020-12-15 17:03:56 +01:00
dove_thermal.c thermal: Explicitly enable non-changing thermal zone devices 2020-06-29 20:26:37 +02:00
gov_bang_bang.c
gov_fair_share.c thermal/governors: Prefix all source files with gov_ 2020-05-22 18:48:54 +02:00
gov_power_allocator.c thermal: power allocator: fail binding for non-power actor devices 2021-01-19 22:31:10 +01:00
gov_step_wise.c thermal/core: Remove the 'forced_passive' option 2021-01-19 22:22:45 +01:00
gov_user_space.c thermal/governors: Prefix all source files with gov_ 2020-05-22 18:48:54 +02:00
hisi_thermal.c thermal: Use mode helpers in drivers 2020-06-29 20:26:36 +02:00
imx8mm_thermal.c thermal: imx8mm: Disable the clock on probe failure 2020-12-04 20:46:03 +01:00
imx_sc_thermal.c - Add the hwmon support on the i.MX SC (Anson Huang) 2020-06-12 14:10:21 -07:00
imx_thermal.c thermal: imx: Use dev_err_probe() to simplify error handling 2020-10-12 12:08:34 +02:00
k3_bandgap.c thermal: k3: Add support for bandgap sensors 2020-04-14 11:41:12 +02:00
Kconfig thermal/drivers/zx: Remove zx driver 2021-02-03 09:17:47 +01:00
khadas_mcu_fan.c thermal/core: Make cooling device state change private 2021-01-19 22:31:10 +01:00
kirkwood_thermal.c thermal: Explicitly enable non-changing thermal zone devices 2020-06-29 20:26:37 +02:00
Makefile thermal/drivers/zx: Remove zx driver 2021-02-03 09:17:47 +01:00
max77620_thermal.c
mtk_thermal.c thermal: mtk_thermal: make device_reset optional 2020-10-27 11:19:18 +01:00
qoriq_thermal.c thermal: qoriq: Update the settings for TMUv2 2020-05-29 20:26:51 +02:00
rcar_gen3_thermal.c thermal: rcar_gen3_thermal: Add r8a779a0 support 2020-12-08 21:18:01 +01:00
rcar_thermal.c thermal/drivers/rcar: Remove notification usage 2020-12-15 17:01:55 +01:00
rockchip_thermal.c thermal: Use mode helpers in drivers 2020-06-29 20:26:36 +02:00
spear_thermal.c thermal: Explicitly enable non-changing thermal zone devices 2020-06-29 20:26:37 +02:00
sprd_thermal.c - Add support to enable/disable the thermal zones resulting on core code and 2020-08-06 18:10:55 -07:00
sun8i_thermal.c thermal: sun8i: Use bitmap API instead of open code 2020-11-12 11:05:12 +01:00
thermal-generic-adc.c thermal: generic-adc: silence info message for IIO_TEMP channels 2020-01-27 10:24:32 +01:00
thermal_core.c thermal/core: Remove pointless thermal_zone_device_reset() function 2021-01-19 22:23:49 +01:00
thermal_core.h thermal/core: Make cooling device state change private 2021-01-19 22:31:10 +01:00
thermal_helpers.c thermal/core: Precompute the delays from msecs to jiffies 2021-01-19 22:23:38 +01:00
thermal_hwmon.c thermal/drivers/hwmon: Cleanup coding style a bit 2020-11-12 11:24:01 +01:00
thermal_hwmon.h thermal_hwmon: Add devres wrapper for thermal_add_hwmon_sysfs() 2020-01-27 10:24:32 +01:00
thermal_mmio.c
thermal_netlink.c - Fix Kconfig typo "acces" -> "access" (Colin Ian King) 2020-10-17 10:40:22 -07:00
thermal_netlink.h thermal: netlink: Improve the initcall ordering 2020-07-21 10:40:08 +02:00
thermal_of.c thermal: Simplify or eliminate unnecessary set_mode() methods 2020-06-29 20:26:39 +02:00
thermal_sysfs.c thermal/core: Remove pointless test with the THERMAL_TRIPS_NONE macro 2021-01-19 22:23:11 +01:00
uniphier_thermal.c