linux/drivers/thermal
Krzysztof Kozlowski 34e788045d thermal/drivers/broadcom: Fix race between removal and clock disable
[ Upstream commit e90c369cc2 ]

During the probe, driver enables clocks necessary to access registers
(in get_temp()) and then registers thermal zone with managed-resources
(devm) interface.  Removal of device is not done in reversed order,
because:
1. Clock will be disabled in driver remove() callback - thermal zone is
   still registered and accessible to users,
2. devm interface will unregister thermal zone.

This leaves short window between (1) and (2) for accessing the
get_temp() callback with disabled clock.

Fix this by enabling clock also via devm-interface, so entire cleanup
path will be in proper, reversed order.

Fixes: 8454c8c09c ("thermal/drivers/bcm2835: Remove buggy call to thermal_of_zone_unregister")
Cc: stable@vger.kernel.org
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240709-thermal-probe-v1-1-241644e2b6e0@linaro.org
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-11 12:47:12 +02:00
..
broadcom thermal/drivers/broadcom: Fix race between removal and clock disable 2024-08-11 12:47:12 +02:00
intel powercap: intel_rapl: Fix locking in TPMI RAPL 2024-04-03 15:28:19 +02:00
mediatek thermal/drivers/mediatek/lvts_thermal: Check NULL ptr on lvts_data 2024-07-11 12:49:07 +02:00
qcom thermal/drivers/qcom/lmh: Check for SCM availability at probe 2024-06-16 13:47:33 +02:00
samsung
st
tegra
ti-soc-thermal
amlogic_thermal.c
armada_thermal.c
cpufreq_cooling.c
cpuidle_cooling.c
da9062-thermal.c
db8500_thermal.c
devfreq_cooling.c thermal: devfreq_cooling: Fix perf state when calculate dfc res_util 2024-04-03 15:28:56 +02:00
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
imx8mm_thermal.c
imx_sc_thermal.c
imx_thermal.c
k3_bandgap.c
k3_j72xx_bandgap.c
Kconfig
khadas_mcu_fan.c
kirkwood_thermal.c
loongson2_thermal.c
Makefile
max77620_thermal.c
qoriq_thermal.c
rcar_gen3_thermal.c
rcar_thermal.c
rockchip_thermal.c
rzg2l_thermal.c
spear_thermal.c
sprd_thermal.c
sun8i_thermal.c
thermal_acpi.c
thermal_core.c
thermal_core.h
thermal_helpers.c
thermal_hwmon.c
thermal_hwmon.h
thermal_mmio.c
thermal_netlink.c
thermal_netlink.h
thermal_of.c thermal/of: Assume polling-delay(-passive) 0 when absent 2024-04-13 13:07:39 +02:00
thermal_sysfs.c
thermal_trace_ipa.h
thermal_trace.h
thermal_trip.c
thermal-generic-adc.c
uniphier_thermal.c