linux-stable/drivers/thermal
Zhang Rui d6c83ee705 powercap: intel_rapl: Fix locking in TPMI RAPL
[ Upstream commit 1aa09b9379 ]

The RAPL framework uses CPU hotplug locking to protect the rapl_packages
list and rp->lead_cpu to guarantee that

 1. the RAPL package device is not unprobed and freed
 2. the cached rp->lead_cpu is always valid

for operations like powercap sysfs accesses.

Current RAPL APIs assume being called from CPU hotplug callbacks which
hold the CPU hotplug lock, but TPMI RAPL driver invokes the APIs in the
driver's .probe() function without acquiring the CPU hotplug lock.

Fix the problem by providing both locked and lockless versions of RAPL
APIs.

Fixes: 9eef7f9da9 ("powercap: intel_rapl: Introduce RAPL TPMI interface driver")
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Cc: 6.5+ <stable@vger.kernel.org> # 6.5+
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:28:19 +02:00
..
broadcom thermal/drivers/broadcom/brcstb_thermal: Removed unneeded platform_set_drvdata() 2023-08-16 12:22:28 +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: Fix a memory leak in an error handling path 2024-03-26 18:20:07 -04:00
qcom thermal/drivers/tsens: Make tsens_xxxx_nvmem static 2023-08-16 09:54:39 +02:00
samsung thermal/drivers/samsung: Fix Wvoid-pointer-to-enum-cast warning 2023-08-16 12:11:19 +02:00
st thermal: Explicitly include correct DT includes 2023-07-31 20:03:42 +02:00
tegra thermal/drivers/tegra-bpmp: Check if BPMP supports trip points 2023-08-22 19:10:28 +02:00
ti-soc-thermal thermal: Constify the trip argument of the .get_trend() zone callback 2023-09-11 17:16:40 +02:00
Kconfig thermal/drivers/loongson-2: Add thermal management support 2023-08-17 09:27:18 +02:00
Makefile thermal/drivers/loongson-2: Add thermal management support 2023-08-17 09:27:18 +02:00
amlogic_thermal.c thermal: Explicitly include correct DT includes 2023-07-31 20:03:42 +02:00
armada_thermal.c thermal: Use thermal_tripless_zone_device_register() 2023-09-05 21:42:18 +02:00
cpufreq_cooling.c
cpuidle_cooling.c
da9062-thermal.c
db8500_thermal.c thermal/drivers/db8500: Remove redundant of_match_ptr() 2023-08-16 12:09:19 +02:00
devfreq_cooling.c
dove_thermal.c thermal: Use thermal_tripless_zone_device_register() 2023-09-05 21:42:18 +02:00
gov_bang_bang.c thermal: core: Store trip pointer in struct thermal_instance 2024-01-31 16:19:10 -08:00
gov_fair_share.c thermal: core: Store trip pointer in struct thermal_instance 2024-01-31 16:19:10 -08:00
gov_power_allocator.c thermal: gov_power_allocator: avoid inability to reset a cdev 2024-01-31 16:19:10 -08:00
gov_step_wise.c thermal: core: Store trip pointer in struct thermal_instance 2024-01-31 16:19:10 -08:00
gov_user_space.c
hisi_thermal.c thermal: Explicitly include correct DT includes 2023-07-31 20:03:42 +02:00
imx8mm_thermal.c thermal/drivers/imx8mm: Suppress log message on probe deferral 2023-08-16 09:54:39 +02:00
imx_sc_thermal.c thermal: Explicitly include correct DT includes 2023-07-31 20:03:42 +02:00
imx_thermal.c thermal: Explicitly include correct DT includes 2023-07-31 20:03:42 +02:00
k3_bandgap.c thermal/drivers/k3_bandgap: Remove unneeded call to platform_set_drvdata() 2023-08-16 12:19:28 +02:00
k3_j72xx_bandgap.c thermal/drivers/k3_j72xx_bandgap: Removed unneeded call to platform_set_drvdata() 2023-08-16 12:18:02 +02:00
khadas_mcu_fan.c
kirkwood_thermal.c thermal: Use thermal_tripless_zone_device_register() 2023-09-05 21:42:18 +02:00
loongson2_thermal.c drivers/thermal/loongson2_thermal: Fix incorrect PTR_ERR() judgment 2024-01-25 15:35:15 -08:00
max77620_thermal.c thermal/drivers/max77620_thermal: Removed unneeded call to platform_set_drvdata() 2023-08-16 12:33:53 +02:00
qoriq_thermal.c thermal/drivers/qoriq: Fix getting tmu range 2024-03-26 18:20:07 -04:00
rcar_gen3_thermal.c thermal: Explicitly include correct DT includes 2023-07-31 20:03:42 +02:00
rcar_thermal.c thermal: Explicitly include correct DT includes 2023-07-31 20:03:42 +02:00
rockchip_thermal.c
rzg2l_thermal.c thermal: Explicitly include correct DT includes 2023-07-31 20:03:42 +02:00
spear_thermal.c thermal: Use thermal_tripless_zone_device_register() 2023-09-05 21:42:18 +02:00
sprd_thermal.c thermal: Explicitly include correct DT includes 2023-07-31 20:03:42 +02:00
sun8i_thermal.c thermal/drivers/sun8i_thermal: Remove unneeded call to platform_set_drvdata() 2023-08-16 12:31:22 +02:00
thermal-generic-adc.c thermal/drivers/generic-adc: Removed unneeded call to platform_set_drvdata() 2023-08-16 12:36:21 +02:00
thermal_acpi.c
thermal_core.c thermal: core: Fix thermal zone suspend-resume synchronization 2024-02-05 20:14:15 +00:00
thermal_core.h thermal: core: Store trip pointer in struct thermal_instance 2024-01-31 16:19:10 -08:00
thermal_helpers.c thermal: core: Store trip pointer in struct thermal_instance 2024-01-31 16:19:10 -08:00
thermal_hwmon.c
thermal_hwmon.h
thermal_mmio.c
thermal_netlink.c
thermal_netlink.h
thermal_of.c thermal/of: add missing of_node_put() 2023-09-11 17:16:36 +02:00
thermal_sysfs.c thermal: core: Store trip pointer in struct thermal_instance 2024-01-31 16:19:10 -08:00
thermal_trace.h
thermal_trace_ipa.h
thermal_trip.c thermal: trip: Drop lockdep assertion from thermal_zone_trip_id() 2024-01-31 16:19:14 -08:00
uniphier_thermal.c thermal: Explicitly include correct DT includes 2023-07-31 20:03:42 +02:00