From: Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
To: "Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@kernel.org>,
Lukasz Luba <lukasz.luba@arm.com>
Cc: x86@kernel.org,
Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
Zhang Rui <rui.zhang@intel.com>,
linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org,
Ricardo Neri <ricardo.neri@intel.com>,
Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Subject: [PATCH 4/4] thermal: intel: Add a syscore shutdown callback for kexec reboot
Date: Mon, 09 Mar 2026 15:19:27 -0700 [thread overview]
Message-ID: <20260309-rneri-directed-therm-intr-v1-4-2956e3000950@linux.intel.com> (raw)
In-Reply-To: <20260309-rneri-directed-therm-intr-v1-0-2956e3000950@linux.intel.com>
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@linux.intel.com>
---
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
prev parent reply other threads:[~2026-03-09 22:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-09 22:19 [PATCH 0/4] thermal: intel: Add support for Directed Package Thermal Interrupts Ricardo Neri
2026-03-09 22:19 ` [PATCH 1/4] x86/thermal: Add bit definitions for Intel Directed Package Thermal Interrupt Ricardo Neri
2026-03-10 9:35 ` Borislav Petkov
2026-03-10 22:21 ` Ricardo Neri
2026-03-09 22:19 ` [PATCH 2/4] thermal: intel: Enable Directed Package-level Thermal Interrupts Ricardo Neri
2026-03-09 22:19 ` [PATCH 3/4] thermal: intel: Add syscore callbacks for suspend and resume Ricardo Neri
2026-03-09 22:19 ` Ricardo Neri [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260309-rneri-directed-therm-intr-v1-4-2956e3000950@linux.intel.com \
--to=ricardo.neri-calderon@linux.intel.com \
--cc=daniel.lezcano@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=lukasz.luba@arm.com \
--cc=rafael@kernel.org \
--cc=ricardo.neri@intel.com \
--cc=rui.zhang@intel.com \
--cc=srinivas.pandruvada@linux.intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®