All of lore.kernel.org
 help / color / mirror / Atom feed
From: Kristen Carlson Accardi <kristen@linux.intel.com>
To: rjw@rjwysocki.net
Cc: linux-pm@vger.kernel.org
Subject: Re: [PATCH] intel_pstate: enable hwp per cpu
Date: Tue, 14 Jul 2015 10:58:32 -0700	[thread overview]
Message-ID: <20150714105832.43ef93d0@kcaccard-desk.amr.corp.intel.com> (raw)
In-Reply-To: <1436892383-4217-1-git-send-email-kristen@linux.intel.com>

On Tue, 14 Jul 2015 09:46:23 -0700
Kristen Carlson Accardi <kristen@linux.intel.com> wrote:

> HWP previously was only enabled at driver load time, on the boot
> cpu, however, HWP must be enabled per package. Move the code to
> enable HWP to the cpufreq driver init path so that it will be
> called per cpu.
> 
> Signed-off-by:  Kristen Carlson Accardi <kristen@linux.intel.com>
> Tested-by: David Zhuang <david.zhuang@oracle.com>

Oops - don't apply this one yet please.  I think I
might have broken S3 resume.

Sorry for the noise,
Kristen

> ---
>  drivers/cpufreq/intel_pstate.c | 11 +++++++----
>  1 file changed, 7 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
> index 15ada47..763d8f3 100644
> --- a/drivers/cpufreq/intel_pstate.c
> +++ b/drivers/cpufreq/intel_pstate.c
> @@ -484,12 +484,11 @@ static void __init intel_pstate_sysfs_expose_params(void)
>  }
>  /************************** sysfs end ************************/
>  
> -static void intel_pstate_hwp_enable(void)
> +static void intel_pstate_hwp_enable(struct cpudata *cpudata)
>  {
> -	hwp_active++;
>  	pr_info("intel_pstate: HWP enabled\n");
>  
> -	wrmsrl( MSR_PM_ENABLE, 0x1);
> +	wrmsrl_on_cpu(cpudata->cpu, MSR_PM_ENABLE, 0x1);
>  }
>  
>  static int byt_get_min_pstate(void)
> @@ -932,6 +931,10 @@ static int intel_pstate_init_cpu(unsigned int cpunum)
>  	cpu = all_cpu_data[cpunum];
>  
>  	cpu->cpu = cpunum;
> +
> +	if (hwp_active)
> +		intel_pstate_hwp_enable(cpu);
> +
>  	intel_pstate_get_cpu_pstates(cpu);
>  
>  	init_timer_deferrable(&cpu->timer);
> @@ -1245,7 +1248,7 @@ static int __init intel_pstate_init(void)
>  		return -ENOMEM;
>  
>  	if (static_cpu_has_safe(X86_FEATURE_HWP) && !no_hwp)
> -		intel_pstate_hwp_enable();
> +		hwp_active++;
>  
>  	if (!hwp_active && hwp_only)
>  		goto out;


  reply	other threads:[~2015-07-14 17:58 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-14 16:46 [PATCH] intel_pstate: enable hwp per cpu Kristen Carlson Accardi
2015-07-14 17:58 ` Kristen Carlson Accardi [this message]
2015-07-15 11:17   ` yu chen
2015-07-15 14:41     ` Kristen Carlson Accardi
2015-07-16  0:36       ` Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150714105832.43ef93d0@kcaccard-desk.amr.corp.intel.com \
    --to=kristen@linux.intel.com \
    --cc=linux-pm@vger.kernel.org \
    --cc=rjw@rjwysocki.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.