diff mbox

cpufreq: intel_pstate: Check cpuid for MSR_HWP_INTERRUPT

Message ID 1468971284-17686-1-git-send-email-srinivas.pandruvada@linux.intel.com (mailing list archive)
State Superseded, archived
Headers show

Commit Message

Srinivas Pandruvada July 19, 2016, 11:34 p.m. UTC
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(-)

Comments

Rafael J. Wysocki July 19, 2016, 11:38 p.m. UTC | #1
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);
>  }
> --
--
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
Rafael J. Wysocki July 19, 2016, 11:40 p.m. UTC | #2
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.
--
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
Pandruvada, Srinivas July 19, 2016, 11:40 p.m. UTC | #3
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);

>  }
Srinivas Pandruvada July 19, 2016, 11:42 p.m. UTC | #4
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
--
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
diff mbox

Patch

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