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

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 thermal: intel: int340x: Add locking to int340x_thermal_get_trip_type() 2023-02-01 08:34:48 +01: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-31 16:17:09 -08:00
intel_hfi.h thermal: intel: hfi: Enable notification interrupt 2022-02-03 19:50:49 +01:00
intel_menlow.c thermal/drivers/intel: Move intel_menlow to thermal drivers 2021-08-17 14:11:48 +02:00
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 thermal: intel: intel_soc_dts_iosf: Utilize for_each_set_clump8 macro 2019-12-04 19:44:12 -08:00
intel_soc_dts_thermal.c thermal: Convert to new X86 CPU match macros 2020-03-24 21:33:53 +01:00
intel_tcc_cooling.c thermal: intel: Add TCC cooling support for Alder Lake-N and Raptor Lake-P 2022-08-03 19:11:38 +02:00
Kconfig thermal: intel: BXT_PMIC: select REGMAP instead of depending on it 2023-03-11 13:55:32 +01:00
Makefile thermal: intel: hfi: Minimally initialize the Hardware Feedback Interface 2022-02-03 19:50:49 +01:00
therm_throt.c thermal: intel: hfi: Enable notification interrupt 2022-02-03 19:50:49 +01:00
thermal_interrupt.h thermal/drivers/intel: Allow processing of HWP interrupt 2021-09-09 16:33:20 +02:00
x86_pkg_temp_thermal.c thermal: intel: x86_pkg_temp_thermal: Drop duplicate 'is' from comment 2022-07-12 20:23:16 +02:00