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

Commit ef56b79b authored by Maxime Ripard's avatar Maxime Ripard Committed by Stephen Boyd
Browse files

clk: fix critical clock locking



The critical clock handling in __clk_core_init isn't taking the enable lock
before calling clk_core_enable, which in turns triggers the warning in the
lockdep_assert_held call in that function when lockep is enabled.

Add the calls to clk_enable_lock/unlock to make sure it doesn't happen.

Fixes: 32b9b109 ("clk: Allow clocks to be marked as CRITICAL")
Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: default avatarHeiko Stuebner <heiko@sntech.de>
Tested-by: default avatarHeiko Stuebner <heiko@sntech.de>
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
parent 9ffee1c4
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2404,8 +2404,13 @@ static int __clk_core_init(struct clk_core *core)
		core->ops->init(core->hw);

	if (core->flags & CLK_IS_CRITICAL) {
		unsigned long flags;

		clk_core_prepare(core);

		flags = clk_enable_lock();
		clk_core_enable(core);
		clk_enable_unlock(flags);
	}

	kref_init(&core->ref);