Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e3ba4ae authored by Amit Nischal's avatar Amit Nischal
Browse files

clk: Fix handoff counts for parent of handoff enabled clocks



For commit 44aa223a ("clk: move check for CLK_ENABLE_HAND_OFF at
unused tree") at unused tree level, prepare and enable counts are
only decrementing for handoff enabled clock(having CLK_ENABLE_HAND_OFF
flag) and counts are not decrementing for their parent clock.
So fixing the same by adding clk_core_unprepare/disable at unused tree
level for handoff enabled clocks so that parent handoff counts also
gets decrement.

Change-Id: Ib238540b2addbe8c9ff7f2e34428169c76e3f44b
Signed-off-by: default avatarAmit Nischal <anischal@codeaurora.org>
parent 55e8426a
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
@@ -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();