aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/cpufreq/intel_pstate.c17
1 files changed, 4 insertions, 13 deletions
diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c
index 3dc546601c88..f1f8fbe0b4c4 100644
--- a/drivers/cpufreq/intel_pstate.c
+++ b/drivers/cpufreq/intel_pstate.c
@@ -382,6 +382,7 @@ static void intel_pstate_set_performance_limits(struct perf_limits *limits)
382 intel_pstate_init_limits(limits); 382 intel_pstate_init_limits(limits);
383 limits->min_perf_pct = 100; 383 limits->min_perf_pct = 100;
384 limits->min_perf = int_ext_tofp(1); 384 limits->min_perf = int_ext_tofp(1);
385 limits->min_sysfs_pct = 100;
385} 386}
386 387
387static DEFINE_MUTEX(intel_pstate_driver_lock); 388static DEFINE_MUTEX(intel_pstate_driver_lock);
@@ -2146,16 +2147,11 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
2146 mutex_lock(&intel_pstate_limits_lock); 2147 mutex_lock(&intel_pstate_limits_lock);
2147 2148
2148 if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) { 2149 if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) {
2150 pr_debug("set performance\n");
2149 if (!perf_limits) { 2151 if (!perf_limits) {
2150 limits = &performance_limits; 2152 limits = &performance_limits;
2151 perf_limits = limits; 2153 perf_limits = limits;
2152 } 2154 }
2153 if (policy->max >= policy->cpuinfo.max_freq &&
2154 !limits->no_turbo) {
2155 pr_debug("set performance\n");
2156 intel_pstate_set_performance_limits(perf_limits);
2157 goto out;
2158 }
2159 } else { 2155 } else {
2160 pr_debug("set powersave\n"); 2156 pr_debug("set powersave\n");
2161 if (!perf_limits) { 2157 if (!perf_limits) {
@@ -2166,7 +2162,7 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy)
2166 } 2162 }
2167 2163
2168 intel_pstate_update_perf_limits(policy, perf_limits); 2164 intel_pstate_update_perf_limits(policy, perf_limits);
2169 out: 2165
2170 if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) { 2166 if (cpu->policy == CPUFREQ_POLICY_PERFORMANCE) {
2171 /* 2167 /*
2172 * NOHZ_FULL CPUs need this as the governor callback may not 2168 * NOHZ_FULL CPUs need this as the governor callback may not
@@ -2257,13 +2253,8 @@ static int __intel_pstate_cpu_init(struct cpufreq_policy *policy)
2257 2253
2258 cpu = all_cpu_data[policy->cpu]; 2254 cpu = all_cpu_data[policy->cpu];
2259 2255
2260 /*
2261 * We need sane value in the cpu->perf_limits, so inherit from global
2262 * perf_limits limits, which are seeded with values based on the
2263 * CONFIG_CPU_FREQ_DEFAULT_GOV_*, during boot up.
2264 */
2265 if (per_cpu_limits) 2256 if (per_cpu_limits)
2266 memcpy(cpu->perf_limits, limits, sizeof(struct perf_limits)); 2257 intel_pstate_init_limits(cpu->perf_limits);
2267 2258
2268 policy->min = cpu->pstate.min_pstate * cpu->pstate.scaling; 2259 policy->min = cpu->pstate.min_pstate * cpu->pstate.scaling;
2269 policy->max = cpu->pstate.turbo_pstate * cpu->pstate.scaling; 2260 policy->max = cpu->pstate.turbo_pstate * cpu->pstate.scaling;