linux-stable/drivers/thermal/intel
Zhang Rui 7cb1cb1553 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:32:04 +02:00
..
int340x_thermal powercap: intel_rapl: Fix locking in TPMI RAPL 2024-04-03 15:32:04 +02:00
intel_bxt_pmic_thermal.c treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 174 2019-05-30 11:26:41 -07:00
intel_hfi.c thermal: intel: hfi: Add syscore callbacks for system-wide PM 2024-01-12 15:44:42 +01:00
intel_hfi.h thermal: intel: hfi: Enable notification interrupt 2022-02-03 19:50:49 +01:00
intel_pch_thermal.c thermal: intel: pch_thermal: Use thermal driver device to write a trace 2023-04-27 19:20:12 +02:00
intel_powerclamp.c thermal: intel: powerclamp: Remove dead code for target mwait value 2024-01-22 11:59:22 +01:00
intel_quark_dts_thermal.c thermal/core: Use the thermal zone 'devdata' accessor in thermal located drivers 2023-03-03 20:45:02 +01:00
intel_soc_dts_iosf.c thermal: intel: intel_soc_dts_iosf: Remove redundant check 2023-08-22 22:07:10 +02:00
intel_soc_dts_iosf.h thermal: intel: intel_soc_dts_iosf: Use struct thermal_trip 2023-08-11 18:44:45 +02:00
intel_soc_dts_thermal.c thermal: intel: intel_soc_dts_iosf: Rework critical trip setup 2023-08-11 18:44:45 +02:00
intel_tcc.c thermal/intel: Fix intel_tcc_get_temp() to support negative CPU temperature 2024-04-03 15:32:04 +02:00
intel_tcc_cooling.c x86/cpu: Fix Gracemont uarch 2023-08-09 21:51:06 +02:00
Kconfig thermal: ACPI: Move the ACPI thermal library to drivers/acpi/ 2023-11-21 15:04:08 +01:00
Makefile thermal: intel: menlow: Get rid of this driver 2023-04-27 19:24:13 +02:00
therm_throt.c thermal: intel: Avoid updating unsupported THERM_STATUS_CLEAR mask bits 2023-04-11 18:12:19 +02:00
thermal_interrupt.h thermal: intel: Protect clearing of thermal status bits 2022-11-23 20:09:06 +01:00
x86_pkg_temp_thermal.c thermal/intel: Fix intel_tcc_get_temp() to support negative CPU temperature 2024-04-03 15:32:04 +02:00