linux-stable/drivers/thermal/intel
Ricardo Neri 28f010dc50 thermal: intel: hfi: Add syscore callbacks for system-wide PM
[ Upstream commit 97566d09fd ]

The kernel allocates a memory buffer and provides its location to the
hardware, which uses it to update the HFI table. This allocation occurs
during boot and remains constant throughout runtime.

When resuming from hibernation, the restore kernel allocates a second
memory buffer and reprograms the HFI hardware with the new location as
part of a normal boot. The location of the second memory buffer may
differ from the one allocated by the image kernel.

When the restore kernel transfers control to the image kernel, its HFI
buffer becomes invalid, potentially leading to memory corruption if the
hardware writes to it (the hardware continues to use the buffer from the
restore kernel).

It is also possible that the hardware "forgets" the address of the memory
buffer when resuming from "deep" suspend. Memory corruption may also occur
in such a scenario.

To prevent the described memory corruption, disable HFI when preparing to
suspend or hibernate. Enable it when resuming.

Add syscore callbacks to handle the package of the boot CPU (packages of
non-boot CPUs are handled via CPU offline). Syscore ops always run on the
boot CPU. Additionally, HFI only needs to be disabled during "deep" suspend
and hibernation. Syscore ops only run in these cases.

Cc: 6.1+ <stable@vger.kernel.org> # 6.1+
Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
[ rjw: Comment adjustment, subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-01-31 16:17:09 -08:00
..
int340x_thermal
intel_bxt_pmic_thermal.c
intel_hfi.c thermal: intel: hfi: Add syscore callbacks for system-wide PM 2024-01-31 16:17:09 -08:00
intel_hfi.h
intel_menlow.c
intel_pch_thermal.c thermal: intel: intel_pch: Add support for Wellsburg PCH 2023-03-10 09:33:50 +01:00
intel_powerclamp.c thermal: intel: powerclamp: Fix cur_state for multi package system 2023-03-10 09:34:22 +01:00
intel_quark_dts_thermal.c thermal: intel: quark_dts: fix error pointer dereference 2023-03-11 13:55:31 +01:00
intel_soc_dts_iosf.c thermal: intel: Fix unsigned comparison with less than zero 2023-03-10 09:33:49 +01:00
intel_soc_dts_iosf.h
intel_soc_dts_thermal.c
intel_tcc_cooling.c
Kconfig thermal: intel: BXT_PMIC: select REGMAP instead of depending on it 2023-03-11 13:55:32 +01:00
Makefile
therm_throt.c
thermal_interrupt.h
x86_pkg_temp_thermal.c