From 1e768cc92bc7394b65898261b1b2e369732e0723 Mon Sep 17 00:00:00 2001 From: Ricardo Neri Date: Sat, 13 Jun 2026 15:17:52 -0700 Subject: [PATCH] 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 Link: https://patch.msgid.link/20260613-rneri-directed-therm-intr-v3-6-3a26d1e47fc8@linux.intel.com Signed-off-by: Rafael J. Wysocki --- drivers/thermal/intel/therm_throt.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/thermal/intel/therm_throt.c b/drivers/thermal/intel/therm_throt.c index 184deb2ad40b..d1f9cf8bf6c5 100644 --- a/drivers/thermal/intel/therm_throt.c +++ b/drivers/thermal/intel/therm_throt.c @@ -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 = {