aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/cpufreq
diff options
context:
space:
mode:
authorDirk Brandewie <dirk.j.brandewie@intel.com>2014-03-19 11:45:54 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-03-19 23:04:40 -0400
commitbb18008f8086283f8f03e8e50fbbf17f213b9ea9 (patch)
treeec63fd8378f40fe59fae85671d0fd69f118df125 /drivers/cpufreq
parent367dc4aa932bfb33a3189064d33f7890a8ec1ca8 (diff)
intel_pstate: Set core to min P state during core offline
Change to use the new ->stop_cpu() callback to do clean up during CPU hotplug. The requested P state for an offline core will be used by the hardware coordination function to select the package P state. If the core is under load when it is offlined it will fix the package P state floor to the requested P state of offline core. Reported-by: Patrick Marlier <patrick.marlier@gmail.com> Signed-off-by: Dirk Brandewie <dirk.j.brandewie@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/cpufreq')
-rw-r--r--drivers/cpufreq/intel_pstate.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 9ab109c0f90c..bcb9a6d0ae11 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -446,7 +446,7 @@ static void core_set_pstate(struct cpudata *cpudata, int pstate)
446 if (limits.no_turbo) 446 if (limits.no_turbo)
447 val |= (u64)1 << 32; 447 val |= (u64)1 << 32;
448 448
449 wrmsrl(MSR_IA32_PERF_CTL, val); 449 wrmsrl_on_cpu(cpudata->cpu, MSR_IA32_PERF_CTL, val);
450} 450}
451 451
452static struct cpu_defaults core_params = { 452static struct cpu_defaults core_params = {
@@ -771,14 +771,17 @@ static int intel_pstate_verify_policy(struct cpufreq_policy *policy)
771 return 0; 771 return 0;
772} 772}
773 773
774static int intel_pstate_cpu_exit(struct cpufreq_policy *policy) 774static void intel_pstate_stop_cpu(struct cpufreq_policy *policy)
775{ 775{
776 int cpu = policy->cpu; 776 int cpu_num = policy->cpu;
777 struct cpudata *cpu = all_cpu_data[cpu_num];
777 778
778 del_timer(&all_cpu_data[cpu]->timer); 779 pr_info("intel_pstate CPU %d exiting\n", cpu_num);
779 kfree(all_cpu_data[cpu]); 780
780 all_cpu_data[cpu] = NULL; 781 del_timer(&all_cpu_data[cpu_num]->timer);
781 return 0; 782 intel_pstate_set_pstate(cpu, cpu->pstate.min_pstate);
783 kfree(all_cpu_data[cpu_num]);
784 all_cpu_data[cpu_num] = NULL;
782} 785}
783 786
784static int intel_pstate_cpu_init(struct cpufreq_policy *policy) 787static int intel_pstate_cpu_init(struct cpufreq_policy *policy)
@@ -816,7 +819,7 @@ static struct cpufreq_driver intel_pstate_driver = {
816 .setpolicy = intel_pstate_set_policy, 819 .setpolicy = intel_pstate_set_policy,
817 .get = intel_pstate_get, 820 .get = intel_pstate_get,
818 .init = intel_pstate_cpu_init, 821 .init = intel_pstate_cpu_init,
819 .exit = intel_pstate_cpu_exit, 822 .stop_cpu = intel_pstate_stop_cpu,
820 .name = "intel_pstate", 823 .name = "intel_pstate",
821}; 824};
822 825