summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2017-01-01 20:19:53 -0800
committerGerrit - the friendly Code Review server <code-review@localhost>2017-01-01 20:19:53 -0800
commitc88fe01f9a09ec362ee89d3cafc986373f502b06 (patch)
tree046c5e12de8f391320f16cef95c91b2aa69d53a4
parent613765204325713b6419765d5d27e7b8f633ef59 (diff)
parent9e3ba4ae70172d3850b173427e4a4cf32697178a (diff)
Merge "clk: Fix handoff counts for parent of handoff enabled clocks"
-rw-r--r--drivers/clk/clk.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ac815c6dbac0..6493b59dac01 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -188,6 +188,9 @@ static bool clk_core_is_enabled(struct clk_core *core)
return core->ops->is_enabled(core->hw);
}
+static void clk_core_unprepare(struct clk_core *core);
+static void clk_core_disable(struct clk_core *core);
+
static void clk_unprepare_unused_subtree(struct clk_core *core)
{
struct clk_core *child;
@@ -207,7 +210,7 @@ static void clk_unprepare_unused_subtree(struct clk_core *core)
*/
if (core->need_handoff_prepare) {
core->need_handoff_prepare = false;
- core->prepare_count--;
+ clk_core_unprepare(core);
}
if (core->prepare_count)
@@ -246,7 +249,9 @@ static void clk_disable_unused_subtree(struct clk_core *core)
*/
if (core->need_handoff_enable) {
core->need_handoff_enable = false;
- core->enable_count--;
+ flags = clk_enable_lock();
+ clk_core_disable(core);
+ clk_enable_unlock(flags);
}
flags = clk_enable_lock();