]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - drivers/cpufreq/cppc_cpufreq.c
cpufreq / CPPC: Initialize policy->min to lowest nonlinear performance
[mirror_ubuntu-artful-kernel.git] / drivers / cpufreq / cppc_cpufreq.c
index e82bb3c30b923c085c981bf517d689b414646c09..10be285c9055791d7e54927da62666c394dc6dc0 100644 (file)
@@ -144,10 +144,23 @@ static int cppc_cpufreq_cpu_init(struct cpufreq_policy *policy)
 
        cppc_dmi_max_khz = cppc_get_dmi_max_khz();
 
-       policy->min = cpu->perf_caps.lowest_perf * cppc_dmi_max_khz / cpu->perf_caps.highest_perf;
+       /*
+        * Set min to lowest nonlinear perf to avoid any efficiency penalty (see
+        * Section 8.4.7.1.1.5 of ACPI 6.1 spec)
+        */
+       policy->min = cpu->perf_caps.lowest_nonlinear_perf * cppc_dmi_max_khz /
+               cpu->perf_caps.highest_perf;
        policy->max = cppc_dmi_max_khz;
-       policy->cpuinfo.min_freq = policy->min;
-       policy->cpuinfo.max_freq = policy->max;
+
+       /*
+        * Set cpuinfo.min_freq to Lowest to make the full range of performance
+        * available if userspace wants to use any perf between lowest & lowest
+        * nonlinear perf
+        */
+       policy->cpuinfo.min_freq = cpu->perf_caps.lowest_perf * cppc_dmi_max_khz /
+               cpu->perf_caps.highest_perf;
+       policy->cpuinfo.max_freq = cppc_dmi_max_khz;
+
        policy->cpuinfo.transition_latency = cppc_get_transition_latency(cpu_num);
        policy->shared_type = cpu->shared_type;