linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] intel-pstate: Use #defines instead of hard-coded values.
@ 2013-03-20 14:21 Konrad Rzeszutek Wilk
  2013-03-20 14:38 ` Viresh Kumar
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Konrad Rzeszutek Wilk @ 2013-03-20 14:21 UTC (permalink / raw)
  To: linux-acpi, linux-kernel
  Cc: Konrad Rzeszutek Wilk, rafael.j.wysocki, dirk.j.brandewie

They are defined in coreboot (MSR_PLATFORM) and the other
one is already defined in msr-index.h.

Lets use those.

CC: rafael.j.wysocki@intel.com
CC: dirk.j.brandewie@intel.com
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
---
 arch/x86/include/uapi/asm/msr-index.h | 1 +
 drivers/cpufreq/intel_pstate.c        | 6 +++---
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h
index 892ce40..7a060f4 100644
--- a/arch/x86/include/uapi/asm/msr-index.h
+++ b/arch/x86/include/uapi/asm/msr-index.h
@@ -44,6 +44,7 @@
 #define SNB_C1_AUTO_UNDEMOTE		(1UL << 27)
 #define SNB_C3_AUTO_UNDEMOTE		(1UL << 28)
 
+#define MSR_PLATFORM_INFO		0x000000ce
 #define MSR_MTRRcap			0x000000fe
 #define MSR_IA32_BBL_CR_CTL		0x00000119
 #define MSR_IA32_BBL_CR_CTL3		0x0000011e
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index f6dd1e7..dadc27d 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -358,14 +358,14 @@ static void intel_pstate_sysfs_expose_params(void)
 static int intel_pstate_min_pstate(void)
 {
 	u64 value;
-	rdmsrl(0xCE, value);
+	rdmsrl(MSR_PLATFORM_INFO, value);
 	return (value >> 40) & 0xFF;
 }
 
 static int intel_pstate_max_pstate(void)
 {
 	u64 value;
-	rdmsrl(0xCE, value);
+	rdmsrl(MSR_PLATFORM_INFO, value);
 	return (value >> 8) & 0xFF;
 }
 
@@ -373,7 +373,7 @@ static int intel_pstate_turbo_pstate(void)
 {
 	u64 value;
 	int nont, ret;
-	rdmsrl(0x1AD, value);
+	rdmsrl(MSR_NHM_TURBO_RATIO_LIMIT, value);
 	nont = intel_pstate_max_pstate();
 	ret = ((value) & 255);
 	if (ret <= nont)
-- 
1.8.0.2


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

* Re: [PATCH] intel-pstate: Use #defines instead of hard-coded values.
  2013-03-20 14:21 [PATCH] intel-pstate: Use #defines instead of hard-coded values Konrad Rzeszutek Wilk
@ 2013-03-20 14:38 ` Viresh Kumar
  2013-03-20 16:11 ` Dirk Brandewie
  2013-03-26 13:37 ` Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Viresh Kumar @ 2013-03-20 14:38 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: linux-acpi, linux-kernel, rafael.j.wysocki, dirk.j.brandewie

On Wed, Mar 20, 2013 at 7:51 PM, Konrad Rzeszutek Wilk
<konrad.wilk@oracle.com> wrote:
> They are defined in coreboot (MSR_PLATFORM) and the other
> one is already defined in msr-index.h.
>
> Lets use those.
>
> CC: rafael.j.wysocki@intel.com
> CC: dirk.j.brandewie@intel.com
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
> ---
>  arch/x86/include/uapi/asm/msr-index.h | 1 +
>  drivers/cpufreq/intel_pstate.c        | 6 +++---
>  2 files changed, 4 insertions(+), 3 deletions(-)

Acked-by: Viresh Kumar <viresh.kumar@linaro.org>

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

* Re: [PATCH] intel-pstate: Use #defines instead of hard-coded values.
  2013-03-20 14:21 [PATCH] intel-pstate: Use #defines instead of hard-coded values Konrad Rzeszutek Wilk
  2013-03-20 14:38 ` Viresh Kumar
@ 2013-03-20 16:11 ` Dirk Brandewie
  2013-03-26 13:37 ` Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Dirk Brandewie @ 2013-03-20 16:11 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: linux-acpi, linux-kernel, rafael.j.wysocki, dirk.j.brandewie

On 03/20/2013 07:21 AM, Konrad Rzeszutek Wilk wrote:
> They are defined in coreboot (MSR_PLATFORM) and the other
> one is already defined in msr-index.h.
>
> Lets use those.
>
> CC: rafael.j.wysocki@intel.com
> CC: dirk.j.brandewie@intel.com
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>

> ---
>   arch/x86/include/uapi/asm/msr-index.h | 1 +
>   drivers/cpufreq/intel_pstate.c        | 6 +++---
>   2 files changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h
> index 892ce40..7a060f4 100644
> --- a/arch/x86/include/uapi/asm/msr-index.h
> +++ b/arch/x86/include/uapi/asm/msr-index.h
> @@ -44,6 +44,7 @@
>   #define SNB_C1_AUTO_UNDEMOTE		(1UL << 27)
>   #define SNB_C3_AUTO_UNDEMOTE		(1UL << 28)
>
> +#define MSR_PLATFORM_INFO		0x000000ce
>   #define MSR_MTRRcap			0x000000fe
>   #define MSR_IA32_BBL_CR_CTL		0x00000119
>   #define MSR_IA32_BBL_CR_CTL3		0x0000011e
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index f6dd1e7..dadc27d 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -358,14 +358,14 @@ static void intel_pstate_sysfs_expose_params(void)
>   static int intel_pstate_min_pstate(void)
>   {
>   	u64 value;
> -	rdmsrl(0xCE, value);
> +	rdmsrl(MSR_PLATFORM_INFO, value);
>   	return (value >> 40) & 0xFF;
>   }
>
>   static int intel_pstate_max_pstate(void)
>   {
>   	u64 value;
> -	rdmsrl(0xCE, value);
> +	rdmsrl(MSR_PLATFORM_INFO, value);
>   	return (value >> 8) & 0xFF;
>   }
>
> @@ -373,7 +373,7 @@ static int intel_pstate_turbo_pstate(void)
>   {
>   	u64 value;
>   	int nont, ret;
> -	rdmsrl(0x1AD, value);
> +	rdmsrl(MSR_NHM_TURBO_RATIO_LIMIT, value);
>   	nont = intel_pstate_max_pstate();
>   	ret = ((value) & 255);
>   	if (ret <= nont)
>


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

* Re: [PATCH] intel-pstate: Use #defines instead of hard-coded values.
  2013-03-20 14:21 [PATCH] intel-pstate: Use #defines instead of hard-coded values Konrad Rzeszutek Wilk
  2013-03-20 14:38 ` Viresh Kumar
  2013-03-20 16:11 ` Dirk Brandewie
@ 2013-03-26 13:37 ` Rafael J. Wysocki
  2 siblings, 0 replies; 4+ messages in thread
From: Rafael J. Wysocki @ 2013-03-26 13:37 UTC (permalink / raw)
  To: Konrad Rzeszutek Wilk
  Cc: linux-acpi, linux-kernel, rafael.j.wysocki, dirk.j.brandewie

On Wednesday, March 20, 2013 10:21:10 AM Konrad Rzeszutek Wilk wrote:
> They are defined in coreboot (MSR_PLATFORM) and the other
> one is already defined in msr-index.h.
> 
> Lets use those.
> 
> CC: rafael.j.wysocki@intel.com
> CC: dirk.j.brandewie@intel.com
> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>

Applied.

Thanks,
Rafael


> ---
>  arch/x86/include/uapi/asm/msr-index.h | 1 +
>  drivers/cpufreq/intel_pstate.c        | 6 +++---
>  2 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/arch/x86/include/uapi/asm/msr-index.h b/arch/x86/include/uapi/asm/msr-index.h
> index 892ce40..7a060f4 100644
> --- a/arch/x86/include/uapi/asm/msr-index.h
> +++ b/arch/x86/include/uapi/asm/msr-index.h
> @@ -44,6 +44,7 @@
>  #define SNB_C1_AUTO_UNDEMOTE		(1UL << 27)
>  #define SNB_C3_AUTO_UNDEMOTE		(1UL << 28)
>  
> +#define MSR_PLATFORM_INFO		0x000000ce
>  #define MSR_MTRRcap			0x000000fe
>  #define MSR_IA32_BBL_CR_CTL		0x00000119
>  #define MSR_IA32_BBL_CR_CTL3		0x0000011e
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index f6dd1e7..dadc27d 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -358,14 +358,14 @@ static void intel_pstate_sysfs_expose_params(void)
>  static int intel_pstate_min_pstate(void)
>  {
>  	u64 value;
> -	rdmsrl(0xCE, value);
> +	rdmsrl(MSR_PLATFORM_INFO, value);
>  	return (value >> 40) & 0xFF;
>  }
>  
>  static int intel_pstate_max_pstate(void)
>  {
>  	u64 value;
> -	rdmsrl(0xCE, value);
> +	rdmsrl(MSR_PLATFORM_INFO, value);
>  	return (value >> 8) & 0xFF;
>  }
>  
> @@ -373,7 +373,7 @@ static int intel_pstate_turbo_pstate(void)
>  {
>  	u64 value;
>  	int nont, ret;
> -	rdmsrl(0x1AD, value);
> +	rdmsrl(MSR_NHM_TURBO_RATIO_LIMIT, value);
>  	nont = intel_pstate_max_pstate();
>  	ret = ((value) & 255);
>  	if (ret <= nont)
> 
-- 
I speak only for myself.
Rafael J. Wysocki, Intel Open Source Technology Center.

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

end of thread, other threads:[~2013-03-26 13:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-03-20 14:21 [PATCH] intel-pstate: Use #defines instead of hard-coded values Konrad Rzeszutek Wilk
2013-03-20 14:38 ` Viresh Kumar
2013-03-20 16:11 ` Dirk Brandewie
2013-03-26 13:37 ` 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).