]> git.itanic.dy.fi Git - linux-stable/commit
thermal: intel: hfi: Disable an HFI instance when all its CPUs go offline
authorRicardo Neri <ricardo.neri-calderon@linux.intel.com>
Wed, 3 Jan 2024 04:14:58 +0000 (20:14 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Feb 2024 00:21:16 +0000 (16:21 -0800)
commit74090a40021a7d78429bd7af6f7cd7e90e489444
tree49f2b4def4b060c1abec885aa78219b04555b3a8
parentb326de729f87b3ad53a382c871701f3016582e24
thermal: intel: hfi: Disable an HFI instance when all its CPUs go offline

[ Upstream commit 1c53081d773c2cb4461636559b0d55b46559ceec ]

In preparation to support hibernation, add functionality to disable an HFI
instance during CPU offline. The last CPU of an instance that goes offline
will disable such instance.

The Intel Software Development Manual states that the operating system must
wait for the hardware to set MSR_IA32_PACKAGE_THERM_STATUS[26] after
disabling an HFI instance to ensure that it will no longer write on the HFI
memory. Some processors, however, do not ever set such bit. Wait a minimum
of 2ms to give time hardware to complete any pending memory writes.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Stable-dep-of: 97566d09fd02 ("thermal: intel: hfi: Add syscore callbacks for system-wide PM")
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/thermal/intel/intel_hfi.c