All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] thermal: intel: Allow processing of HWP interrupt
@ 2021-08-20  2:40 Srinivas Pandruvada
  2021-08-20  2:40 ` [PATCH 2/2] cpufreq: intel_pstate: Process HWP Guaranteed change notification Srinivas Pandruvada
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Srinivas Pandruvada @ 2021-08-20  2:40 UTC (permalink / raw)
  To: rui.zhang, daniel.lezcano, rjw, viresh.kumar, lenb
  Cc: linux-pm, linux-kernel, Srinivas Pandruvada

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>
---
 drivers/thermal/intel/therm_throt.c       | 7 ++++++-
 drivers/thermal/intel/thermal_interrupt.h | 3 +++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/drivers/thermal/intel/therm_throt.c b/drivers/thermal/intel/therm_throt.c
index 99abdc03c44c..dab7e8fb1059 100644
--- a/drivers/thermal/intel/therm_throt.c
+++ b/drivers/thermal/intel/therm_throt.c
@@ -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);
 
diff --git a/drivers/thermal/intel/thermal_interrupt.h b/drivers/thermal/intel/thermal_interrupt.h
index 53f427bb58dc..01e7bed2ffc7 100644
--- a/drivers/thermal/intel/thermal_interrupt.h
+++ b/drivers/thermal/intel/thermal_interrupt.h
@@ -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 */
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-09 14:46 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-20  2:40 [PATCH 1/2] thermal: intel: Allow processing of HWP interrupt Srinivas Pandruvada
2021-08-20  2:40 ` [PATCH 2/2] cpufreq: intel_pstate: Process HWP Guaranteed change notification Srinivas Pandruvada
2021-08-20 13:10   ` Daniel Lezcano
2021-08-25 18:11   ` Rafael J. Wysocki
     [not found]   ` <00450b0a9efbfde513ea8b445d31657ce5ac2f37.camel@mengyan1223.wang>
2021-09-08  1:54     ` Srinivas Pandruvada
2021-09-08  5:45       ` Xi Ruoyao
2021-08-20  3:35 ` [PATCH 1/2] thermal: intel: Allow processing of HWP interrupt Zhang Rui
2021-09-09 14:38 ` [thermal: thermal/next] thermal/drivers/intel: " thermal-bot for Srinivas Pandruvada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.