linux-imx/drivers/thermal/intel
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
..
int340x_thermal powercap: intel_rapl: Fix locking in TPMI RAPL 2024-04-03 15:28:19 +02:00
intel_bxt_pmic_thermal.c
intel_hfi.c thermal: intel: hfi: Add syscore callbacks for system-wide PM 2024-01-31 16:19:09 -08:00
intel_hfi.h
intel_pch_thermal.c
intel_powerclamp.c
intel_quark_dts_thermal.c
intel_soc_dts_iosf.c
intel_soc_dts_iosf.h
intel_soc_dts_thermal.c
intel_tcc_cooling.c
intel_tcc.c thermal/intel: Fix intel_tcc_get_temp() to support negative CPU temperature 2024-04-03 15:28:18 +02:00
Kconfig
Makefile
therm_throt.c
thermal_interrupt.h
x86_pkg_temp_thermal.c thermal/intel: Fix intel_tcc_get_temp() to support negative CPU temperature 2024-04-03 15:28:18 +02:00