[PATCH] intel_pstate: Allow manually forcing the use of HWP on Skylake-S

Michael Marley michael at michaelmarley.com
Tue Oct 6 17:25:40 UTC 2015


 From 6ec94e46055dcd25c2246270e2e63fd7a0f052b5 Mon Sep 17 00:00:00 2001
 From: Michael Marley <michael at michaelmarley.com>
Date: Tue, 6 Oct 2015 10:21:35 -0400
Subject: [PATCH] intel_pstate: Allow manually forcing the use of HWP on
  Skylake-S

HWP is currently disabled by default for Skylake-S processors
because some systems experience a hard lockup when using it.
This patch allows for the user to force the use of HWP anyway by
passing the "intel_pstate.skylake_hwp" parameter to the kernel
if he/she knows the system will not be affected by the lockup.

Signed-off-by: Michael Marley <michael at michaelmarley.com>
---
  Documentation/kernel-parameters.txt | 11 +++++++----
  drivers/cpufreq/intel_pstate.c      |  5 ++++-
  2 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/Documentation/kernel-parameters.txt 
b/Documentation/kernel-parameters.txt
index 98423ce..09af002 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1539,11 +1539,14 @@ bytes respectively. Such letter suffixes can 
also be entirely omitted.
  			 processors that aren't supported by the intel_pstate driver
  			 or on platforms that use pcc-cpufreq instead of acpi-cpufreq.
  		       no_hwp
-		         Do not enable hardware P state control (HWP)
+			 Do not enable hardware P state control (HWP)
  			 if available.
-		hwp_only
-			Only load intel_pstate on systems which support
-			hardware P state control (HWP) if available.
+		       hwp_only
+			 Only load intel_pstate on systems which support
+			 hardware P state control (HWP) if available.
+		       skylake_hwp
+			 Enable the use of HWP on Skylake-S processors even though
+			 it may cause hard lockups on certain systems.

  	intremap=	[X86-64, Intel-IOMMU]
  			on	enable Interrupt Remapping (default)
diff --git a/drivers/cpufreq/intel_pstate.c 
b/drivers/cpufreq/intel_pstate.c
index 5e95391..faac5e0 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1077,6 +1077,7 @@ static struct cpufreq_driver intel_pstate_driver = 
{
  static int __initdata no_load;
  static int __initdata no_hwp;
  static int __initdata hwp_only;
+static int __initdata skylake_hwp;
  static unsigned int force_load;

  static int intel_pstate_msrs_not_valid(void)
@@ -1257,7 +1258,7 @@ static int __init intel_pstate_init(void)
  		return -ENOMEM;

  	if (static_cpu_has_safe(X86_FEATURE_HWP) && !no_hwp
-		&& id->model != 0x5e)
+		&& (id->model != 0x5e || skylake_hwp))
  		hwp_active++;

  	if (!hwp_active && hwp_only)
@@ -1299,6 +1300,8 @@ static int __init intel_pstate_setup(char *str)
  		force_load = 1;
  	if (!strcmp(str, "hwp_only"))
  		hwp_only = 1;
+	if (!strcmp(str, "skylake_hwp"))
+		skylake_hwp = 1;
  	return 0;
  }
  early_param("intel_pstate", intel_pstate_setup);
-- 
2.6.1




More information about the kernel-team mailing list