linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] intel_pstate: provide option to only use intel_pstate with HWP
@ 2015-02-06 21:41 Kristen Carlson Accardi
  2015-02-06 22:31 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Kristen Carlson Accardi @ 2015-02-06 21:41 UTC (permalink / raw)
  To: rjw; +Cc: linux-pm

Allow users the option to disable the driver for any hardware
which does not support HWP.

Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>
---
 Documentation/kernel-parameters.txt | 3 +++
 drivers/cpufreq/intel_pstate.c      | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
index 4df73da..07e6701 100644
--- a/Documentation/kernel-parameters.txt
+++ b/Documentation/kernel-parameters.txt
@@ -1469,6 +1469,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
 		       no_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.
 
 	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 e7e808d..872c577 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -1019,6 +1019,7 @@ static struct cpufreq_driver intel_pstate_driver = {
 
 static int __initdata no_load;
 static int __initdata no_hwp;
+static int __initdata hwp_only;
 static unsigned int force_load;
 
 static int intel_pstate_msrs_not_valid(void)
@@ -1216,6 +1217,9 @@ static int __init intel_pstate_init(void)
 	if (cpu_has(c,X86_FEATURE_HWP) && !no_hwp)
 		intel_pstate_hwp_enable();
 
+	if (!hwp_active && hwp_only)
+		goto out;
+
 	rc = cpufreq_register_driver(&intel_pstate_driver);
 	if (rc)
 		goto out;
@@ -1250,6 +1254,8 @@ static int __init intel_pstate_setup(char *str)
 		no_hwp = 1;
 	if (!strcmp(str, "force"))
 		force_load = 1;
+	if (!strcmp(str, "hwp_only"))
+		hwp_only = 1;
 	return 0;
 }
 early_param("intel_pstate", intel_pstate_setup);
-- 
1.9.3


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

* Re: [PATCH] intel_pstate: provide option to only use intel_pstate with HWP
  2015-02-06 21:41 [PATCH] intel_pstate: provide option to only use intel_pstate with HWP Kristen Carlson Accardi
@ 2015-02-06 22:31 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2015-02-06 22:31 UTC (permalink / raw)
  To: Kristen Carlson Accardi; +Cc: linux-pm

On Friday, February 06, 2015 01:41:55 PM Kristen Carlson Accardi wrote:
> Allow users the option to disable the driver for any hardware
> which does not support HWP.
> 
> Signed-off-by: Kristen Carlson Accardi <kristen@linux.intel.com>

OK, queued up for 3.20, thanks!

> ---
>  Documentation/kernel-parameters.txt | 3 +++
>  drivers/cpufreq/intel_pstate.c      | 6 ++++++
>  2 files changed, 9 insertions(+)
> 
> diff --git a/Documentation/kernel-parameters.txt b/Documentation/kernel-parameters.txt
> index 4df73da..07e6701 100644
> --- a/Documentation/kernel-parameters.txt
> +++ b/Documentation/kernel-parameters.txt
> @@ -1469,6 +1469,9 @@ bytes respectively. Such letter suffixes can also be entirely omitted.
>  		       no_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.
>  
>  	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 e7e808d..872c577 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -1019,6 +1019,7 @@ static struct cpufreq_driver intel_pstate_driver = {
>  
>  static int __initdata no_load;
>  static int __initdata no_hwp;
> +static int __initdata hwp_only;
>  static unsigned int force_load;
>  
>  static int intel_pstate_msrs_not_valid(void)
> @@ -1216,6 +1217,9 @@ static int __init intel_pstate_init(void)
>  	if (cpu_has(c,X86_FEATURE_HWP) && !no_hwp)
>  		intel_pstate_hwp_enable();
>  
> +	if (!hwp_active && hwp_only)
> +		goto out;
> +
>  	rc = cpufreq_register_driver(&intel_pstate_driver);
>  	if (rc)
>  		goto out;
> @@ -1250,6 +1254,8 @@ static int __init intel_pstate_setup(char *str)
>  		no_hwp = 1;
>  	if (!strcmp(str, "force"))
>  		force_load = 1;
> +	if (!strcmp(str, "hwp_only"))
> +		hwp_only = 1;
>  	return 0;
>  }
>  early_param("intel_pstate", intel_pstate_setup);
> 

-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

end of thread, other threads:[~2015-02-06 22:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-06 21:41 [PATCH] intel_pstate: provide option to only use intel_pstate with HWP Kristen Carlson Accardi
2015-02-06 22:31 ` Rafael J. Wysocki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).