Skip to content

Commit 950809c

Browse files
spandruvadarafaeljw
authored andcommitted
thermal: intel: Allow processing of HWP interrupt
Add a weak function to process HWP (Hardware P-states) notifications and move updating HWP_STATUS MSR to this function. This allows HWP interrupts to be processed by the intel_pstate driver in HWP mode by overriding the implementation. Signed-off-by: Srinivas Pandruvada <[email protected]> Acked-by: Zhang Rui <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
1 parent 43dde64 commit 950809c

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

drivers/thermal/intel/therm_throt.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,13 +569,18 @@ static void notify_thresholds(__u64 msr_val)
569569
platform_thermal_notify(msr_val);
570570
}
571571

572+
void __weak notify_hwp_interrupt(void)
573+
{
574+
wrmsrl_safe(MSR_HWP_STATUS, 0);
575+
}
576+
572577
/* Thermal transition interrupt handler */
573578
void intel_thermal_interrupt(void)
574579
{
575580
__u64 msr_val;
576581

577582
if (static_cpu_has(X86_FEATURE_HWP))
578-
wrmsrl_safe(MSR_HWP_STATUS, 0);
583+
notify_hwp_interrupt();
579584

580585
rdmsrl(MSR_IA32_THERM_STATUS, msr_val);
581586

drivers/thermal/intel/thermal_interrupt.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,7 @@ extern int (*platform_thermal_notify)(__u64 msr_val);
1212
* callback has rate control */
1313
extern bool (*platform_thermal_package_rate_control)(void);
1414

15+
/* Handle HWP interrupt */
16+
extern void notify_hwp_interrupt(void);
17+
1518
#endif /* _INTEL_THERMAL_INTERRUPT_H */

0 commit comments

Comments
 (0)