Skip to content

Commit 5950fc4

Browse files
spandruvadadlezcano
authored andcommitted
thermal/drivers/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 <srinivas.pandruvada@linux.intel.com> Acked-by: Zhang Rui <rui.zhang@intel.com> Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org> Link: https://lore.kernel.org/r/20210820024006.2347720-1-srinivas.pandruvada@linux.intel.com
1 parent 0284b52 commit 5950fc4

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

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)