Skip to content

Commit

Permalink
thermal: intel: Allow processing of HWP interrupt
Browse files Browse the repository at this point in the history
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: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
  • Loading branch information
Srinivas Pandruvada authored and Rafael J. Wysocki committed Aug 25, 2021
1 parent 43dde64 commit 950809c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/thermal/intel/therm_throt.c
Original file line number Diff line number Diff line change
Expand Up @@ -569,13 +569,18 @@ static void notify_thresholds(__u64 msr_val)
platform_thermal_notify(msr_val);
}

void __weak notify_hwp_interrupt(void)
{
wrmsrl_safe(MSR_HWP_STATUS, 0);
}

/* Thermal transition interrupt handler */
void intel_thermal_interrupt(void)
{
__u64 msr_val;

if (static_cpu_has(X86_FEATURE_HWP))
wrmsrl_safe(MSR_HWP_STATUS, 0);
notify_hwp_interrupt();

rdmsrl(MSR_IA32_THERM_STATUS, msr_val);

Expand Down
3 changes: 3 additions & 0 deletions drivers/thermal/intel/thermal_interrupt.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,7 @@ extern int (*platform_thermal_notify)(__u64 msr_val);
* callback has rate control */
extern bool (*platform_thermal_package_rate_control)(void);

/* Handle HWP interrupt */
extern void notify_hwp_interrupt(void);

#endif /* _INTEL_THERMAL_INTERRUPT_H */

0 comments on commit 950809c

Please sign in to comment.