thermal: intel: Add a syscore shutdown callback for kexec reboot

A kexec reboot may load a kernel that does not support directed package-
level thermal interrupts. Without a shutdown callback, the directed
interrupt configuration remains enabled across kexec but will not be
handled correctly. In particular, if the CPU designated to receive the
directed interrupt goes offline, no other CPU in the package will receive
it.

Add a syscore shutdown callback to disable directed package-level thermal
interrupts on all packages before a kexec reboot. If the post-kexec kernel
does not enable directed interrupts, it falls back to broadcasting the
interrupt to all CPUs.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Link: https://patch.msgid.link/20260613-rneri-directed-therm-intr-v3-6-3a26d1e47fc8@linux.intel.com
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
This commit is contained in:
Ricardo Neri 2026-06-13 15:17:52 -07:00 committed by Rafael J. Wysocki
parent 66e1929b48
commit 1e768cc92b

View File

@ -592,7 +592,8 @@ static bool directed_thermal_pkg_intr_supported(void)
/*
* Must be called with cpu_hotplug_lock held to prevent CPUs from going offline
* while iterating through packages and interrupts must be enabled to avoid
* deadlocks in SMP function calls.
* deadlocks in SMP function calls. The syscore shutdown callback also calls
* this function, but runs with CPU hotplug disabled (and interrupts enabled).
*/
static void disable_directed_thermal_pkg_intr_all(void)
{
@ -735,9 +736,15 @@ static int directed_pkg_intr_syscore_suspend(void *data)
return 0;
}
static void directed_pkg_intr_syscore_shutdown(void *data)
{
disable_directed_thermal_pkg_intr_all();
}
static const struct syscore_ops directed_pkg_intr_pm_ops = {
.resume = directed_pkg_intr_syscore_resume,
.suspend = directed_pkg_intr_syscore_suspend,
.shutdown = directed_pkg_intr_syscore_shutdown,
};
static struct syscore directed_pkg_intr_pm = {