All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cpufreq: intel_pstate: Check cpuid for MSR_HWP_INTERRUPT
@ 2016-07-19 23:34 Srinivas Pandruvada
  2016-07-19 23:38 ` Rafael J. Wysocki
  2016-07-19 23:40 ` Pandruvada, Srinivas
  0 siblings, 2 replies; 5+ messages in thread
From: Srinivas Pandruvada @ 2016-07-19 23:34 UTC (permalink / raw)
  To: rjw; +Cc: linux-pm, spandruv

From: spandruv <spandruv@spandruv-mobl.jf.intel.com>

The MSR MSR_HWP_INTERRUPT is valid only when CPUID.06H:EAX[8] = 1, so
check for feature before accessing this MSR.

Signed-off-by: spandruv <spandruv@spandruv-mobl.jf.intel.com>
---
 drivers/cpufreq/intel_pstate.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 2fe9af1..712afbd 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -822,8 +822,10 @@ static void __init intel_pstate_sysfs_expose_params(void)
 
 static void intel_pstate_hwp_enable(struct cpudata *cpudata)
 {
+
 	/* First disable HWP notification interrupt as we don't process them */
-	wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x00);
+	if (static_cpu_has(X86_FEATURE_HWP_NOTIFY))
+		wrmsrl_on_cpu(cpudata->cpu, MSR_HWP_INTERRUPT, 0x00);
 
 	wrmsrl_on_cpu(cpudata->cpu, MSR_PM_ENABLE, 0x1);
 }
-- 
2.7.4


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

end of thread, other threads:[~2016-07-19 23:44 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-19 23:34 [PATCH] cpufreq: intel_pstate: Check cpuid for MSR_HWP_INTERRUPT Srinivas Pandruvada
2016-07-19 23:38 ` Rafael J. Wysocki
2016-07-19 23:40   ` Rafael J. Wysocki
2016-07-19 23:42     ` Srinivas Pandruvada
2016-07-19 23:40 ` Pandruvada, Srinivas

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.