ARM: tegra: power: Go to G-CPU if minimum 1 is requested
Alex Frid [Sat, 12 May 2012 07:16:31 +0000 (00:16 -0700)]
On Tegra3 switch and stay on G-CPU if minimum 1 is requested via
PM QoS interface. Allow return to LP-CPU only if request is at
default 0 level.

Change-Id: Ie1a732fe6c6a1dcd2f7e78be01e32dcc5a7993a6
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/102120
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Donghan Ryu <dryu@nvidia.com>
Reviewed-by: Satya Popuri <spopuri@nvidia.com>
Reviewed-by: Diwakar Tundlam <dtundlam@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

arch/arm/mach-tegra/cpu-tegra3.c

index 86a0b13..fe2b6bb 100644 (file)
@@ -230,7 +230,8 @@ static void tegra_auto_hotplug_work_func(struct work_struct *work)
                cpu = tegra_get_slowest_cpu_n();
                if (cpu < nr_cpu_ids) {
                        up = false;
-               } else if (!is_lp_cluster() && !no_lp) {
+               } else if (!is_lp_cluster() && !no_lp &&
+                          !pm_qos_request(PM_QOS_MIN_ONLINE_CPUS)) {
                        if(!clk_set_parent(cpu_clk, cpu_lp_clk)) {
                                hp_stats_update(CONFIG_NR_CPUS, true);
                                hp_stats_update(0, false);
@@ -299,7 +300,7 @@ static int min_cpus_notify(struct notifier_block *nb, unsigned long n, void *p)
 {
        mutex_lock(tegra3_cpu_lock);
 
-       if ((n >= 2) && is_lp_cluster()) {
+       if ((n >= 1) && is_lp_cluster()) {
                /* make sure cpu rate is within g-mode range before switching */
                unsigned int speed = max(
                        tegra_getspeed(0), clk_get_min_rate(cpu_g_clk) / 1000);