projects/linux·commit ef56b79b

clk: fix critical clock locking

ef56b79b · Maxime Ripard <[email protected]> · 2016-05-13 10:00:31 +02:00

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: 32b9b1096186 ("clk: Allow clocks to be marked as CRITICAL")
Signed-off-by: Maxime Ripard <[email protected]>
Reviewed-by: Heiko Stuebner <[email protected]>
Tested-by: Heiko Stuebner <[email protected]>
Signed-off-by: Stephen Boyd <[email protected]>
Commit
ef56b79b66faeeb0dc14213d3cc9e0534a960dee
Parents
9ffee1c4

Changes

1 files changed · +5 −0

FileStatusAddDelContent
drivers/clk/clk.cmodified+5−0View file

drivers/clk/clk.c

View file
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index ce39add..d584004 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -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);