[PATCH 4/4] thermal: intel: Add a syscore shutdown callback for kexec reboot

From: Ricardo Neri

Date: Mon Mar 09 2026 - 18:20:54 EST


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, they will fall back to being broadcast
to all CPUs in the package.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>
---
drivers/thermal/intel/therm_throt.c | 16 ++++++++++++++++
1 file changed, 16 insertions(+)

diff --git a/drivers/thermal/intel/therm_throt.c b/drivers/thermal/intel/therm_throt.c
index c89485a8cda0..33b0c90cfe41 100644
--- a/drivers/thermal/intel/therm_throt.c
+++ b/drivers/thermal/intel/therm_throt.c
@@ -748,9 +748,25 @@ static int directed_pkg_intr_syscore_suspend(void *data)
return 0;
}

+static void directed_pkg_intr_syscore_shutdown(void *data)
+{
+ bool enable = false;
+ int i;
+
+ for (i = 0; i < topology_max_packages(); i++) {
+ if (directed_intr_handler_cpus[i] == nr_cpu_ids)
+ continue;
+
+ smp_call_function_single(directed_intr_handler_cpus[i],
+ config_directed_thermal_pkg_intr,
+ &enable, true);
+ }
+}
+
static 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 = {

--
2.43.0