diff options
author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2016-05-13 04:00:31 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2016-05-19 17:09:30 -0400 |
commit | ef56b79b66faeeb0dc14213d3cc9e0534a960dee (patch) | |
tree | 0121cda9a0842adc5f8f5bf1220d208d4f772c29 | |
parent | 9ffee1c4be7c1981e47e520172638a4b00881880 (diff) |
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: 32b9b1096186 ("clk: Allow clocks to be marked as CRITICAL")
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
-rw-r--r-- | drivers/clk/clk.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index ce39add5a258..d584004f7af7 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c | |||
@@ -2404,8 +2404,13 @@ static int __clk_core_init(struct clk_core *core) | |||
2404 | core->ops->init(core->hw); | 2404 | core->ops->init(core->hw); |
2405 | 2405 | ||
2406 | if (core->flags & CLK_IS_CRITICAL) { | 2406 | if (core->flags & CLK_IS_CRITICAL) { |
2407 | unsigned long flags; | ||
2408 | |||
2407 | clk_core_prepare(core); | 2409 | clk_core_prepare(core); |
2410 | |||
2411 | flags = clk_enable_lock(); | ||
2408 | clk_core_enable(core); | 2412 | clk_core_enable(core); |
2413 | clk_enable_unlock(flags); | ||
2409 | } | 2414 | } |
2410 | 2415 | ||
2411 | kref_init(&core->ref); | 2416 | kref_init(&core->ref); |