From: Chen-Yu Tsai Date: Mon, 22 Aug 2022 08:14:24 +0000 (+0800) Subject: clk: core: Fix runtime PM sequence in clk_core_unprepare() X-Git-Tag: v5.15.73~507 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9766749a30f6f4425e3d61ce287e0e6eb5e90e25;p=platform%2Fkernel%2Flinux-rpi.git clk: core: Fix runtime PM sequence in clk_core_unprepare() [ Upstream commit 4b592061f7b3971c70e8b72fc42aaead47c24701 ] In the original commit 9a34b45397e5 ("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: 9a34b45397e5 ("clk: Add support for runtime PM") Signed-off-by: Chen-Yu Tsai Reviewed-by: NĂ­colas F. R. A. Prado Link: https://lore.kernel.org/r/20220822081424.1310926-3-wenst@chromium.org Signed-off-by: Stephen Boyd Signed-off-by: Sasha Levin --- diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index d6dc58b..0674dbc 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -846,10 +846,9 @@ 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); clk_core_unprepare(core->parent); + clk_pm_runtime_put(core); } static void clk_core_unprepare_lock(struct clk_core *core)