From: Srinivas Pandruvada Date: Thu, 29 Jan 2015 20:17:13 +0000 (-0800) Subject: intel_pstate: respect cpufreq policy request X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=630ec286dd85c5838493ab7ef975881c42069ef0;p=linux-beck.git intel_pstate: respect cpufreq policy request When thermal or other subsystem requests to change the policy, use that irrepective of whether cpufreq policy is PERFORMANCE or not. Without this change, when thermal subsystem passive policy wants to reduce performance, it still runs at 100%. Signed-off-by: Srinivas Pandruvada Signed-off-by: Kristen Carlson Accardi Signed-off-by: Rafael J. Wysocki --- diff --git a/drivers/cpufreq/intel_pstate.c b/drivers/cpufreq/intel_pstate.c index 80ecc351d613..dfee5725903b 100644 --- a/drivers/cpufreq/intel_pstate.c +++ b/drivers/cpufreq/intel_pstate.c @@ -919,7 +919,8 @@ static int intel_pstate_set_policy(struct cpufreq_policy *policy) if (!policy->cpuinfo.max_freq) return -ENODEV; - if (policy->policy == CPUFREQ_POLICY_PERFORMANCE) { + if (policy->policy == CPUFREQ_POLICY_PERFORMANCE && + policy->max >= policy->cpuinfo.max_freq) { limits.min_perf_pct = 100; limits.min_perf = int_tofp(1); limits.max_policy_pct = 100;