Commit 4b592061 authored by Chen-Yu Tsai's avatar Chen-Yu Tsai Committed by Stephen Boyd
Browse files

clk: core: Fix runtime PM sequence in clk_core_unprepare()



In the original commit 9a34b453 ("clk: Add support for runtime PM"),
the commit message mentioned that pm_runtime_put_sync() would be done
at the end of clk_core_unprepare(). This mirrors the operations in
clk_core_prepare() in the opposite order.

However, the actual code that was added wasn't in the order the commit
message described. Move clk_pm_runtime_put() to the end of
clk_core_unprepare() so that it is in the correct order.

Fixes: 9a34b453 ("clk: Add support for runtime PM")
Signed-off-by: default avatarChen-Yu Tsai <wenst@chromium.org>
Reviewed-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
Link: https://lore.kernel.org/r/20220822081424.1310926-3-wenst@chromium.org


Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent 35b0fac8
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -859,13 +859,12 @@ static void clk_core_unprepare(struct clk_core *core)
	if (core->ops->unprepare)
		core->ops->unprepare(core->hw);

	clk_pm_runtime_put(core);

	trace_clk_unprepare_complete(core);

	if (core->flags & CLK_OPS_PARENT_ENABLE)
		clk_core_disable_lock(core->parent);
	clk_core_unprepare(core->parent);
	clk_pm_runtime_put(core);
}

static void clk_core_unprepare_lock(struct clk_core *core)