Re: [PATCH v3 0/6] thermal: intel: Add support for Directed Package Thermal Interrupt
From: Rafael J. Wysocki (Intel)
Date: Fri Jul 10 2026 - 06:40:00 EST
On Sun, Jun 14, 2026 at 12:07 AM Ricardo Neri
<ricardo.neri-calderon@xxxxxxxxxxxxxxx> wrote:
>
> Hi,
>
> This is v3 of this series. The main change is the reworking of the
> rollback mechanism to fix a bug in which kfree() could be called with local
> interrupts disabled in PREEMPT_RT kernels. Please see the changelog for
> details.
>
> Package-level thermal interrupts are currently broadcast to all CPUs in a
> package. Only one CPU is needed to service package-wide events.
> Broadcasting creates unnecessary resource contention. Thermal interrupts
> generated for Hardware Feedback Interface[1] updates are an example: all
> CPUs in the package receive the interrupt and race for a lock to update a
> shared data structure. Idle CPUs are needlessly woken up.
>
> Newer Intel processors allow directing package-level thermal interrupts
> only to CPUs that explicitly request them. A CPU opts in by setting a
> designated bit in IA32_THERM_INTERRUPT. Hardware acknowledges the request
> by setting a designated bit in IA32_PACKAGE_THERM_STATUS.
>
> This series enables directed package-level thermal interrupts and
> designates one handler CPU per package using the CPU hotplug
> infrastructure. A new CPU is selected if the handler CPU goes offline.
>
> Because CPU0's hotplug callbacks are not invoked during suspend and resume,
> syscore callbacks are added to restore the handler for the boot package.
> The series also disables directed delivery during kexec reboot, avoiding
> stale interrupt routing when rebooting into a kernel that does not support
> the feature.
>
> This patchset introduces a change in behavior in the /sys/devices/system/
> cpu/cpuN/thermal_throttle/package* sysfs files. These files reflect per-CPU
> variables updated when a CPU handles a package-level thermal interrupt. In
> broadcast mode, all CPUs update their variables. When directed package-
> level thermal interrupts are enabled, only the handler CPU's variables are
> updated.
>
> Lastly, nothing changes for processors that do not support this feature:
> they fall back to broadcast delivery.
>
> [1] Intel Software Developer's Manual Vol. 3, Section 17.6, March 2026 https://www.intel.com/SDM
>
> Signed-off-by: Ricardo Neri <ricardo.neri-calderon@xxxxxxxxxxxxxxx>
> ---
> Changes in v3:
> - Fixed a potential deadlock when calling kfree() with interrupts
> disabled in PREEMPT_RT kernels. (Sashiko)
> - Introduced cleanup_directed_pkg_thermal_intr() to tear down DPTI
> resources on error.
> - Split patch 4 into two since it had become too big.
> - Miscellaneous changes to inline comments.
> - Link to v2: https://lore.kernel.org/r/20260528-rneri-directed-therm-intr-v2-0-8e2f9e0c1a36@xxxxxxxxxxxxxxx
>
> Changes in v2:
> - Fixed an existing bug in the error-handling of thermal_throttle_online()
> CPU hotplug callback.
> - Redesigned the rollback mechanism to handle all packages, not only
> the boot package.
> - Fixed the handling of the return value of cpumask_any_but(), which on
> failure returns small_cpumask_bits, not nr_cpu_ids.
> - Renamed the Directed Package Thermal Interrupt CPUID and MSR bits for
> consistency and brevity. (Boris)
> - Added measurements of the latency of setup acknowledgment from hardware.
> - Removed an unused argument from directed_thermal_pkg_intr_supported().
> - Reused the global rollback mechanism in the syscore shutdown callback.
> - Link to v1: https://lore.kernel.org/r/20260309-rneri-directed-therm-intr-v1-0-2956e3000950@xxxxxxxxxxxxxxx
>
> ---
> Ricardo Neri (6):
> thermal: intel: Fix dangling resources on thermal_throttle_online() failure
This one is there already in 7.2-rc.
> x86/thermal: Add bit definitions for Intel Directed Package Thermal Interrupt
> thermal: intel: Add resources to handle directed package-level thermal interrupts
> thermal: intel: Enable the Directed Package-level Thermal Interrupt
> thermal: intel: Add syscore callbacks for suspend and resume
> thermal: intel: Add a syscore shutdown callback for kexec reboot
>
> arch/x86/include/asm/cpufeatures.h | 2 +
> arch/x86/include/asm/msr-index.h | 2 +
> drivers/thermal/intel/therm_throt.c | 284 +++++++++++++++++++++++++++++++++++-
> 3 files changed, 284 insertions(+), 4 deletions(-)
> ---
Assumed no objections from the x86 folks and applied patches [2-6] as
7.3 material, thanks!