linux-stable/drivers/thermal
Ansuel Smith 3792174592 thermal/drivers/tsens: Add timeout to get_temp_tsens_valid
[ Upstream commit d012f9189f ]

The function can loop and lock the system if for whatever reason the bit
for the target sensor is NEVER valid. This is the case if a sensor is
disabled by the factory and the valid bit is never reported as actually
valid. Add a timeout check and exit if a timeout occurs. As this is
a very rare condition, handle the timeout only if the first read fails.
While at it also rework the function to improve readability and convert
to poll_timeout generic macro.

Signed-off-by: Ansuel Smith <ansuelsmth@gmail.com>
Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Link: https://lore.kernel.org/r/20211007172859.583-1-ansuelsmth@gmail.com
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2021-11-18 19:16:16 +01:00
..
broadcom thermal/drivers/bcm2835: Remove redundant dev_err call in bcm2835_thermal_probe() 2021-04-20 08:58:47 +02:00
intel thermal/drivers/int340x: Do not set a wrong tcc offset on resume 2021-09-14 19:53:24 +02:00
qcom thermal/drivers/tsens: Add timeout to get_temp_tsens_valid 2021-11-18 19:16:16 +01:00
samsung thermal/drivers/exynos: Fix an error code in exynos_tmu_probe() 2021-08-14 12:40:35 +02:00
st thermal/drivers/st: Use devm_platform_get_and_ioremap_resource() 2021-06-14 19:01:15 +02:00
tegra thermal/drivers/tegra-soctherm: Silence message about clamped temperature 2021-08-14 15:44:15 +02:00
ti-soc-thermal thermal/ti-soc-thermal: Fix kernel-doc 2021-05-24 22:38:05 +02:00
amlogic_thermal.c
armada_thermal.c
cpufreq_cooling.c thermal/cpufreq_cooling: Update offline CPUs per-cpu thermal_pressure 2021-06-17 14:11:43 +02:00
cpuidle_cooling.c thermal/drivers/cpuidle_cooling: Fix use after error 2021-04-15 13:21:26 +02:00
da9062-thermal.c
db8500_thermal.c
devfreq_cooling.c thermal/drivers/devfreq_cooling: use HZ macros 2021-09-08 11:50:25 -07:00
dove_thermal.c
gov_bang_bang.c
gov_fair_share.c thermal/core/fair share: Use the lockless __thermal_cdev_update() function 2021-04-22 23:51:32 +02:00
gov_power_allocator.c thermal/core/power allocator: Use the lockless __thermal_cdev_update() function 2021-04-22 23:51:32 +02:00
gov_step_wise.c
gov_user_space.c
hisi_thermal.c thermal/drivers/hisi: Remove redundant dev_err call in hisi_thermal_probe() 2021-04-20 09:18:57 +02:00
imx8mm_thermal.c
imx_sc_thermal.c thermal/drivers/imx_sc: Add missing of_node_put for loop iteration 2021-06-14 22:41:00 +02:00
imx_thermal.c
k3_bandgap.c
Kconfig
khadas_mcu_fan.c
kirkwood_thermal.c
Makefile
max77620_thermal.c
mtk_thermal.c thermal/drivers/mediatek: Add sensors-support 2021-07-04 18:28:04 +02:00
qoriq_thermal.c
rcar_gen3_thermal.c thermal/drivers/rcar_gen3_thermal: Store TSC id as unsigned int 2021-08-14 12:49:05 +02:00
rcar_thermal.c
rockchip_thermal.c thermal/drivers/rockchip: Support RK3568 SoCs in the thermal driver 2021-06-11 11:30:30 +02:00
spear_thermal.c
sprd_thermal.c thermal/drivers/sprd: Add missing of_node_put for loop iteration 2021-06-14 22:42:09 +02:00
sun8i_thermal.c thermal: Fix couple of spellos in the file sun8i_thermal.c 2021-03-10 12:54:58 +01:00
thermal-generic-adc.c
thermal_core.c thermal/core: Fix null pointer dereference in thermal_release() 2021-11-18 19:16:16 +01:00
thermal_core.h thermal/core: Create a helper __thermal_cdev_update() without a lock 2021-04-22 14:10:28 +02:00
thermal_helpers.c thermal/core: Create a helper __thermal_cdev_update() without a lock 2021-04-22 14:10:28 +02:00
thermal_hwmon.c
thermal_hwmon.h
thermal_mmio.c thermal/drivers/thermal_mmio: Remove redundant dev_err call in thermal_mmio_probe() 2021-04-20 08:58:47 +02:00
thermal_netlink.c
thermal_netlink.h
thermal_of.c thermal/core/thermal_of: Stop zone device before unregistering it 2021-07-04 18:28:04 +02:00
thermal_sysfs.c thermal/core: Add NULL pointer check before using cooling device stats 2021-03-17 09:55:58 +01:00
uniphier_thermal.c