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

From: Ricardo Neri

Date: Sat Jun 13 2026 - 18:08:35 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, it falls back to broadcasting the
interrupt to all CPUs.

Signed-off-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>
---
Changes in v3:
* Reworded comments.

Changes in v2:
* Used the disable_all_directed_thermal_pkg_intr() function introduced
in patch 3.
---
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 916b76c0822e..c2980e88af31 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 = {

--
2.43.0