diff mbox

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

Message ID 049cea9e6964bdffb7b0f76f036880a1@michaelmarley.com
State New
Headers show

Commit Message

Michael Marley Oct. 6, 2015, 5:25 p.m. UTC
From 6ec94e46055dcd25c2246270e2e63fd7a0f052b5 Mon Sep 17 00:00:00 2001
 From: Michael Marley <michael@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@michaelmarley.com>
---
  Documentation/kernel-parameters.txt | 11 +++++++----
  drivers/cpufreq/intel_pstate.c      |  5 ++++-
  2 files changed, 11 insertions(+), 5 deletions(-)

  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);

Comments

Tim Gardner Oct. 6, 2015, 6:46 p.m. UTC | #1
I had to apply this by hand. Against which kernel version did you develop ?
Jason DeRose Oct. 6, 2015, 8:46 p.m. UTC | #2
On 10/06/2015 12:46 PM, Tim Gardner wrote:
> I had to apply this by hand. Against which kernel version did you develop ?
>

For the record, +1 for this patch. It would allow System76 to still 
properly enable the pstate driver on our upcoming Skylake S/H laptops, 
even if it requires a kernel boot param for now.

I'm building a Wily kernel from master-next now, will chime in with my 
results.
diff mbox

Patch

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;