ARM: tegra: clock: Apply shared bus ceiling always
Alex Frid [Wed, 18 Apr 2012 06:02:30 +0000 (11:02 +0530)]
Apply shared bus ceiling regardless of whether Tegra3 SHARED_CEILING
user is enabled or disabled. Thus, we no longer need to enable ceiling
user - and the bus itself via child-parent relations - to cap the bus
rate.

Bug 954896

Change-Id: I7f96f03f05fd39334c9ee977cd1ac18d86a1fc0d
Signed-off-by: Alex Frid <afrid@nvidia.com>
(cherry picked from commit 07b1a707aa14dcab37f095a3bb78af79a54c399b)
Reviewed-on: http://git-master/r/95739
Reviewed-by: Daniel Solomon <daniels@nvidia.com>
Tested-by: Daniel Solomon <daniels@nvidia.com>
Reviewed-by: Automatic_Commit_Validation_User
Reviewed-by: Yu-Huan Hsu <yhsu@nvidia.com>

Conflicts:

arch/arm/mach-tegra/tegra3_clocks.c

Signed-off-by: Varun Wadekar <vwadekar@nvidia.com>

arch/arm/mach-tegra/tegra30_clocks.c
arch/arm/mach-tegra/tegra3_dvfs.c

index daa45f1..6b958d9 100644 (file)
@@ -3041,9 +3041,13 @@ static int tegra3_clk_shared_bus_update(struct clk *bus)
 
        list_for_each_entry(c, &bus->shared_bus_list,
                        u.shared_bus_user.node) {
-               /* Ignore requests from disabled users and from users with
-                  fixed bus-to-client ratio */
-               if (c->u.shared_bus_user.enabled) {
+               /* Ignore requests from disabled floor and bw users, and from
+                * auto-users riding the bus. Always honor ceiling users, even
+                * if they are disabled - we do not want to keep enabled parent
+                * bus just because ceiling is set.
+                */
+               if (c->u.shared_bus_user.enabled ||
+                   (c->u.shared_bus_user.mode == SHARED_CEILING)) {
                        switch (c->u.shared_bus_user.mode) {
                        case SHARED_BW:
                                bw += c->u.shared_bus_user.rate;
index f8ac96a..1dee311 100644 (file)
@@ -783,19 +783,11 @@ static void core_cap_enable(bool enable)
 {
        int i;
 
-       if (enable) {
+       if (enable)
                tegra3_core_cap.refcnt++;
-               if (tegra3_core_cap.refcnt == 1)
-                       for (i = 0; i < ARRAY_SIZE(core_cap_table); i++)
-                               if (core_cap_table[i].cap_clk)
-                                       clk_enable(core_cap_table[i].cap_clk);
-       } else if (tegra3_core_cap.refcnt) {
+       else if (tegra3_core_cap.refcnt)
                tegra3_core_cap.refcnt--;
-               if (tegra3_core_cap.refcnt == 0)
-                       for (i = ARRAY_SIZE(core_cap_table) - 1; i >= 0; i--)
-                               if (core_cap_table[i].cap_clk)
-                                       clk_disable(core_cap_table[i].cap_clk);
-       }
+
        core_cap_update();
 }