From: Kristen Carlson Accardi Date: Tue, 14 Jul 2015 23:46:23 +0000 (-0700) Subject: intel_pstate: enable HWP per CPU X-Git-Tag: v4.1.12-92~286^2~1 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=9b6437fa371cd4d55ec628a4422c79d534adf14b;p=users%2Fjedix%2Flinux-maple.git intel_pstate: enable HWP per CPU intel_pstate: enable HWP per CPU Orabug: 21325983 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 Tested-by: David Zhuang Signed-off-by: Rafael J. Wysocki (cherry picked from commit ba88d4338f226766f510e207911dde8c1875e072) Signed-off-by: Brian Maly Conflicts: drivers/cpufreq/intel_pstate.c Signed-off-by: Santosh Shilimkar --- diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 7c2f6884dc51..c7233db551c0 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -481,12 +481,12 @@ 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); + pr_info("intel_pstate: HWP enabled\n"); + + wrmsrl_on_cpu(cpudata->cpu, MSR_PM_ENABLE, 0x1); } static int byt_get_min_pstate(void) @@ -919,6 +919,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); @@ -1236,7 +1240,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;