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

* Re: [PATCH] cpufreq: intel_pstate: Check cpuid for MSR_HWP_INTERRUPT
  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:40 ` Pandruvada, Srinivas
  1 sibling, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2016-07-19 23:38 UTC (permalink / raw)
  To: Srinivas Pandruvada; +Cc: Rafael J. Wysocki, Linux PM, spandruv

On Wed, Jul 20, 2016 at 1:34 AM, Srinivas Pandruvada
<srinivas.pandruvada@linux.intel.com> wrote:
> 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>

Do you really want this in the S-o-b tag?

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

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

* Re: [PATCH] cpufreq: intel_pstate: Check cpuid for MSR_HWP_INTERRUPT
  2016-07-19 23:38 ` Rafael J. Wysocki
@ 2016-07-19 23:40   ` Rafael J. Wysocki
  2016-07-19 23:42     ` Srinivas Pandruvada
  0 siblings, 1 reply; 5+ messages in thread
From: Rafael J. Wysocki @ 2016-07-19 23:40 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Srinivas Pandruvada, Rafael J. Wysocki, Linux PM

On Wed, Jul 20, 2016 at 1:38 AM, Rafael J. Wysocki <rafael@kernel.org> wrote:
> On Wed, Jul 20, 2016 at 1:34 AM, Srinivas Pandruvada
> <srinivas.pandruvada@linux.intel.com> wrote:
>> 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>
>
> Do you really want this in the S-o-b tag?

Well, it isn't a valid address even, so it can't be here.

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

* Re: [PATCH] cpufreq: intel_pstate: Check cpuid for MSR_HWP_INTERRUPT
  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 ` Pandruvada, Srinivas
  1 sibling, 0 replies; 5+ messages in thread
From: Pandruvada, Srinivas @ 2016-07-19 23:40 UTC (permalink / raw)
  To: rjw; +Cc: spandruv, linux-pm


On Tue, 2016-07-19 at 16:34 -0700, Srinivas Pandruvada wrote:
> From: spandruv <spandruv@spandruv-mobl.jf.intel.com>
> 
Please ignore this patch. Tried from wrong computer.



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

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

* Re: [PATCH] cpufreq: intel_pstate: Check cpuid for MSR_HWP_INTERRUPT
  2016-07-19 23:40   ` Rafael J. Wysocki
@ 2016-07-19 23:42     ` Srinivas Pandruvada
  0 siblings, 0 replies; 5+ messages in thread
From: Srinivas Pandruvada @ 2016-07-19 23:42 UTC (permalink / raw)
  To: Rafael J. Wysocki; +Cc: Rafael J. Wysocki, Linux PM

On Wed, 2016-07-20 at 01:40 +0200, Rafael J. Wysocki wrote:
> On Wed, Jul 20, 2016 at 1:38 AM, Rafael J. Wysocki <rafael@kernel.org
> > wrote:
> > 
> > On Wed, Jul 20, 2016 at 1:34 AM, Srinivas Pandruvada
> > <srinivas.pandruvada@linux.intel.com> wrote:
> > > 
> > > 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>
> > Do you really want this in the S-o-b tag?
> Well, it isn't a valid address even, so it can't be here.
Resending, setup a new computer and forgot to add .gitconfig.



> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[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.