]> rtime.felk.cvut.cz Git - sojka/nv-tegra/linux-3.10.git/commitdiff
ARM: tegra: clock:Fix Sleeping while atomic in LP0
authorGaurav Sarode <gsarode@nvidia.com>
Wed, 16 Jul 2014 19:58:40 +0000 (12:58 -0700)
committerMatthew Pedro <mapedro@nvidia.com>
Thu, 31 Jul 2014 17:53:47 +0000 (10:53 -0700)
After enabling CONFIG_DEBUG_ATOMIC_SLEEP,during LP0 we see warning
regarding sleep in atomic region for clk_enable and clk_disable.
To fix this, we need to use clk_enable_locked and clk_disable_locked
instead.These functions do not acquire locks.

Bug 1534913

Change-Id: I7ca661a8030308107c3467d9d524c79b6ec374e8
Signed-off-by: Gaurav Sarode <gsarode@nvidia.com>
Reviewed-on: http://git-master/r/438904
(cherry picked from commit 908ff199970a093a022f4434afc1689ba979bfed)
Reviewed-on: http://git-master/r/440467
Reviewed-by: Automatic_Commit_Validation_User
GVS: Gerrit_Virtual_Submit
Reviewed-by: Matthew Pedro <mapedro@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: Venkat Moganty <vmoganty@nvidia.com>
arch/arm/mach-tegra/clock.c
arch/arm/mach-tegra/clock.h
arch/arm/mach-tegra/tegra12_clocks.c

index 76b6594a0ff90bccd81752893c960b40ebb6a240..a3428d23cffbffdbe8ecd12950648d41b2a85bcd 100644 (file)
@@ -261,7 +261,7 @@ void clk_init(struct clk *c)
        mutex_unlock(&clock_list_lock);
 }
 
-static int clk_enable_locked(struct clk *c)
+int clk_enable_locked(struct clk *c)
 {
        int ret = 0;
 
@@ -296,7 +296,7 @@ static int clk_enable_locked(struct clk *c)
        return ret;
 }
 
-static void clk_disable_locked(struct clk *c)
+void clk_disable_locked(struct clk *c)
 {
        if (c->refcnt == 0) {
                WARN(1, "Attempting to disable clock %s with refcnt 0", c->name);
index 2ed6d1175120dae1e0786c59c91033365bc7fe16..2b95bc31f6f6e1d92ce4c1fe566facb26c3e356d 100644 (file)
@@ -382,6 +382,8 @@ long clk_round_rate_locked(struct clk *c, unsigned long rate);
 int tegra_clk_shared_bus_update(struct clk *c);
 void tegra3_set_cpu_skipper_delay(int delay);
 unsigned long tegra_clk_measure_input_freq(void);
+int clk_enable_locked(struct clk *c);
+void clk_disable_locked(struct clk *c);
 #ifdef CONFIG_ARCH_TEGRA_2x_SOC
 static inline bool tegra_clk_is_parent_allowed(struct clk *c, struct clk *p)
 { return true; }
index b96c2a91216adf21bc8847fab752c8178c3b879e..a621bf490e84a3adcb36c7087d5cea81ef1723b0 100644 (file)
@@ -9678,8 +9678,8 @@ static void tegra12_clk_resume(void)
 
                /* emc switched to the new parent by low level code, but ref
                   count and s/w state need to be updated */
-               clk_disable(p);
-               clk_enable(tegra_clk_emc.parent);
+               clk_disable_locked(p);
+               clk_enable_locked(tegra_clk_emc.parent);
        }
 
        rate = clk_get_rate_all_locked(&tegra_clk_emc);