cpufreq: conservative: set requested_freq to policy max when it is over policy max
authorXiaoguang Chen <chenxg@marvell.com>
Fri, 8 Nov 2013 05:23:52 +0000 (13:23 +0800)
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>
Tue, 12 Nov 2013 22:18:20 +0000 (23:18 +0100)
When requested_freq is over policy->max, set it to policy->max.
This can help to speed up decreasing frequency.

Signed-off-by: Xiaoguang Chen <chenxg@marvell.com>
Acked-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
drivers/cpufreq/cpufreq_conservative.c

index 218460f..25a70d0 100644 (file)
@@ -68,6 +68,9 @@ static void cs_check_cpu(int cpu, unsigned int load)
 
                dbs_info->requested_freq += get_freq_target(cs_tuners, policy);
 
+               if (dbs_info->requested_freq > policy->max)
+                       dbs_info->requested_freq = policy->max;
+
                __cpufreq_driver_target(policy, dbs_info->requested_freq,
                        CPUFREQ_RELATION_H);
                return;