]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
cpufreq: interactive: Fix hispeed_freq boost
authorSai Gurrappadi <sgurrappadi@nvidia.com>
Thu, 27 Mar 2014 00:58:10 +0000 (17:58 -0700)
committerTony Ly <tly@nvidia.com>
Mon, 21 Apr 2014 19:55:58 +0000 (12:55 -0700)
Select the maximum of the result from choose_freq and hispeed_freq
instead of always assuming choose_freq would return a target less than
hispeed_freq.

Bug 1470007

Change-Id: Idf950a7bbbad78f87928d8c23d0823c51ba764d3
Signed-off-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-on: http://git-master/r/394574
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Mitch Luban <mluban@nvidia.com>
drivers/cpufreq/cpufreq_interactive.c

index b4c21feea256549b1eb20babfb61eb1437eb6a5f..e6bef7c8a18f0f184d64ccacb094a162baa1195f 100644 (file)
@@ -2,7 +2,7 @@
  * drivers/cpufreq/cpufreq_interactive.c
  *
  * Copyright (C) 2010 Google, Inc.
- * Copyright (c) 2012-2013, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2012-2014, NVIDIA CORPORATION. All rights reserved.
  *
  * This software is licensed under the terms of the GNU General Public
  * License version 2, as published by the Free Software Foundation, and
@@ -383,21 +383,13 @@ static void cpufreq_interactive_timer(unsigned long data)
        cpu_load = loadadjfreq / pcpu->target_freq;
        boosted = tunables->boost_val || now < tunables->boostpulse_endtime;
 
+       new_freq = choose_freq(pcpu, loadadjfreq);
        if (cpu_load >= tunables->go_hispeed_load || boosted) {
-               if (pcpu->target_freq < tunables->hispeed_freq) {
-                       if (tunables->boost_factor)
-                               new_freq = min((pcpu->target_freq
+               new_freq = max(new_freq, tunables->hispeed_freq);
+               if (pcpu->target_freq < tunables->hispeed_freq &&
+                               tunables->boost_factor)
+                       new_freq = min((pcpu->target_freq
                                        * tunables->boost_factor), tunables->hispeed_freq);
-                       else
-                               new_freq = tunables->hispeed_freq;
-               } else {
-                       new_freq = choose_freq(pcpu, loadadjfreq);
-
-                       if (new_freq < tunables->hispeed_freq)
-                               new_freq = tunables->hispeed_freq;
-               }
-       } else {
-               new_freq = choose_freq(pcpu, loadadjfreq);
        }
 
        if (pcpu->target_freq >= tunables->hispeed_freq &&