Commit 5950fc44 authored by Srinivas Pandruvada's avatar Srinivas Pandruvada Committed by Daniel Lezcano

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: default avatarSrinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Acked-by: default avatarZhang Rui <rui.zhang@intel.com>
Signed-off-by: default avatarDaniel Lezcano <daniel.lezcano@linaro.org>
Link: https://lore.kernel.org/r/20210820024006.2347720-1-srinivas.pandruvada@linux.intel.com
parent 0284b52e
...@@ -569,13 +569,18 @@ static void notify_thresholds(__u64 msr_val) ...@@ -569,13 +569,18 @@ static void notify_thresholds(__u64 msr_val)
platform_thermal_notify(msr_val); platform_thermal_notify(msr_val);
} }
void __weak notify_hwp_interrupt(void)
{
wrmsrl_safe(MSR_HWP_STATUS, 0);
}
/* Thermal transition interrupt handler */ /* Thermal transition interrupt handler */
void intel_thermal_interrupt(void) void intel_thermal_interrupt(void)
{ {
__u64 msr_val; __u64 msr_val;
if (static_cpu_has(X86_FEATURE_HWP)) if (static_cpu_has(X86_FEATURE_HWP))
wrmsrl_safe(MSR_HWP_STATUS, 0); notify_hwp_interrupt();
rdmsrl(MSR_IA32_THERM_STATUS, msr_val); rdmsrl(MSR_IA32_THERM_STATUS, msr_val);
......
...@@ -12,4 +12,7 @@ extern int (*platform_thermal_notify)(__u64 msr_val); ...@@ -12,4 +12,7 @@ extern int (*platform_thermal_notify)(__u64 msr_val);
* callback has rate control */ * callback has rate control */
extern bool (*platform_thermal_package_rate_control)(void); extern bool (*platform_thermal_package_rate_control)(void);
/* Handle HWP interrupt */
extern void notify_hwp_interrupt(void);
#endif /* _INTEL_THERMAL_INTERRUPT_H */ #endif /* _INTEL_THERMAL_INTERRUPT_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment