summaryrefslogtreecommitdiff
path: root/drivers/clk/clk.c
diff options
context:
space:
mode:
authorStephen Boyd <sboyd@codeaurora.org>2015-05-07 21:32:49 +0300
committerStephen Boyd <sboyd@codeaurora.org>2015-05-07 21:32:49 +0300
commit18e70efe3e2a27b53a63fb4454cc6c9e1dc0db49 (patch)
tree5c867e320c38b7a0b4b406e477a4ce787846a3fa /drivers/clk/clk.c
parentc542a54fcb5591e7637f71fa400065853ce54ee0 (diff)
parentd2a5d46b167a9a8231264daf80165b739aecf1d7 (diff)
downloadlinux-18e70efe3e2a27b53a63fb4454cc6c9e1dc0db49.tar.xz
Merge branch 'clk-fixes' into clk-next
Diffstat (limited to 'drivers/clk/clk.c')
-rw-r--r--drivers/clk/clk.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 4a2e9478edbd..9e9d18cadeee 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -1097,8 +1097,10 @@ static struct clk_core *__clk_set_parent_before(struct clk_core *core,
*/
if (core->prepare_count) {
clk_core_prepare(parent);
+ flags = clk_enable_lock();
clk_core_enable(parent);
clk_core_enable(core);
+ clk_enable_unlock(flags);
}
/* update the clk tree topology */
@@ -1113,13 +1115,17 @@ static void __clk_set_parent_after(struct clk_core *core,
struct clk_core *parent,
struct clk_core *old_parent)
{
+ unsigned long flags;
+
/*
* Finish the migration of prepare state and undo the changes done
* for preventing a race with clk_enable().
*/
if (core->prepare_count) {
+ flags = clk_enable_lock();
clk_core_disable(core);
clk_core_disable(old_parent);
+ clk_enable_unlock(flags);
clk_core_unprepare(old_parent);
}
}
@@ -1147,8 +1153,10 @@ static int __clk_set_parent(struct clk_core *core, struct clk_core *parent,
clk_enable_unlock(flags);
if (core->prepare_count) {
+ flags = clk_enable_lock();
clk_core_disable(core);
clk_core_disable(parent);
+ clk_enable_unlock(flags);
clk_core_unprepare(parent);
}
return ret;