]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
platfotrm: tegra: Set CPUFREQ maximum frequency target
authorAlex Frid <afrid@nvidia.com>
Sat, 4 Jul 2015 06:28:22 +0000 (23:28 -0700)
committerAleksandr Frid <afrid@nvidia.com>
Mon, 27 Jul 2015 20:36:52 +0000 (13:36 -0700)
When CONFIG_TEGRA_CPU_FREQ_GOVERNOR_KERNEL_START is selected, directly
set maximum CPU frequency target, instead of switching to PERFORMANCE
governor. This would still boosts CPU frequency while Tegra default
USERSPACE governor is set, but avoid reloading governor from kernel.

Bug 200114201

Change-Id: I17192cd5478e5e035302421b8593f7adb2e80a24
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/766359
Reviewed-by: Sreenivasulu Velpula <svelpula@nvidia.com>
Reviewed-by: Sai Gurrappadi <sgurrappadi@nvidia.com>
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>
arch/arm/mach-tegra/Kconfig
drivers/platform/tegra/cpu-tegra.c

index 1ca00ffd931ba572e5f1c08773df80ee2400b586..7157e983b27a61c330168571f43f40ad7756ed61 100644 (file)
@@ -437,15 +437,15 @@ config TEGRA_XHCI_ENABLE_CDP_PORT
         of xhci controller.
 
 config TEGRA_CPU_FREQ_GOVERNOR_KERNEL_START
-       bool "Initialize CPU governor to a performance after DVFS initialization"
+       bool "Start scaling CPU rate to maximum after DVFS initialization"
        default 0
        help
          During a boot up, once DVFS is initialized, there is a period of
-         time in which the frequency could adjusted higher before the userspace
-         configures the governor by using a more performance governor for
-         a faster boot up. Selecting this option will make the system to choose
-         a performance governor once the DVFS initialization is complete. Userspace
-         or init script can override the governor chosen here.
+         time in which the frequency could be adjusted higher for faster boot.
+         Selecting this option will make the system to set maximum possible
+         rate once the DVFS initialization is complete. This top rate persists
+         if default USERSPACE governor is retained, or it will be scaled down
+         if/when governor is reloaded from user space.
 
 config TEGRA_DYNAMIC_PWRDET
        bool "Enable dynamic activation of IO level auto-detection"
index d454dacaab0296e78dd5e539fe5027cdf9be20e9..b814f70fd5b7c8f808fd992a79b89370e89ae10d 100644 (file)
@@ -1500,29 +1500,28 @@ static int __init tegra_cpufreq_init(void)
 }
 
 #ifdef CONFIG_TEGRA_CPU_FREQ_GOVERNOR_KERNEL_START
-static int __init tegra_cpufreq_governor_init(void)
+static int __init tegra_cpufreq_governor_start(void)
 {
        /*
-        * At this point, the full range of clocks should be available
-        * Set the CPU governor to performance for a faster boot up
+        * At this point, the full range of clocks should be available,
+        * scaling up can start: set the CPU frequency, maximum possible
         */
-       unsigned int i;
        struct cpufreq_policy *policy;
-       static char *start_scaling_gov = "performance";
-       for_each_online_cpu(i) {
-               policy = cpufreq_cpu_get(i);
-               if (!(policy && policy->governor &&
-                       !(strcmp(policy->governor->name, start_scaling_gov) &&
-                               cpufreq_set_gov(start_scaling_gov, i))))
-                       pr_info("Failed to set the governor to %s for cpu %u\n",
-                               start_scaling_gov, i);
-               if (policy)
-                       cpufreq_cpu_put(policy);
-       }
+
+       policy = cpufreq_cpu_get(0);
+       if (!policy || tegra_target(policy, UINT_MAX, CPUFREQ_RELATION_H))
+               pr_warn("Failed to set maximum possible CPU frequency\n");
+       else
+               pr_info("Set maximum possible CPU frequency %u\n",
+                       tegra_getspeed_actual());
+
+       if (policy)
+               cpufreq_cpu_put(policy);
+
        return 0;
 }
 
-late_initcall_sync(tegra_cpufreq_governor_init);
+late_initcall_sync(tegra_cpufreq_governor_start);
 #endif
 
 static void __exit tegra_cpufreq_exit(void)