Revert "ARM: tegra: clock: Don't fail clk_enable when max_rate has been lowered"
Alex Frid [Sat, 5 May 2012 01:07:08 +0000 (18:07 -0700)]
This reverts commit 8d351aa5478de533114e614f2607bc85ed23df91.

The above commit introduced recursive call of clk enable/set rate APIs
that may hang the system.

Change-Id: I04eff9e1c3ddee82f6d2e17690122cc41fad203f
Signed-off-by: Alex Frid <afrid@nvidia.com>
Reviewed-on: http://git-master/r/100710
Reviewed-by: Simone Willett <swillett@nvidia.com>
Tested-by: Simone Willett <swillett@nvidia.com>

arch/arm/mach-tegra/clock.c

index d173449..2560b83 100644 (file)
@@ -238,16 +238,9 @@ void clk_init(struct clk *c)
 static int clk_enable_locked(struct clk *c)
 {
        int ret = 0;
-       int rate = clk_get_rate_locked(c);
-       bool set_rate = false;
-
-       if (rate > c->max_rate) {
-               rate = c->max_rate;
-               set_rate = true;
-       }
 
        if (clk_is_auto_dvfs(c)) {
-               ret = tegra_dvfs_set_rate(c, rate);
+               ret = tegra_dvfs_set_rate(c, clk_get_rate_locked(c));
                if (ret)
                        return ret;
        }
@@ -259,9 +252,6 @@ static int clk_enable_locked(struct clk *c)
                                return ret;
                }
 
-               if (set_rate)
-                       clk_set_rate_locked(c, rate);
-
                if (c->ops && c->ops->enable) {
                        ret = c->ops->enable(c);
                        trace_clock_enable(c->name, 1, 0);