From 421676896cdd442477d863f405eef9d27851f479 Mon Sep 17 00:00:00 2001 From: Maxime Ripard Date: Fri, 13 May 2016 10:00:31 +0200 Subject: [PATCH] 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 Reviewed-by: Heiko Stuebner Tested-by: Heiko Stuebner Signed-off-by: Stephen Boyd (cherry picked from commit ef56b79b66faeeb0dc14213d3cc9e0534a960dee) Git-commit: ef56b79b66faeeb0dc14213d3cc9e0534a960dee Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Change-Id: Ifefcbe4741ddd046755ecc24c3f2d619566c2823 Signed-off-by: Taniya Das --- drivers/clk/clk.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 910c168bcbc1..c1865f9ee8b3 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3128,8 +3128,13 @@ static int __clk_init(struct device *dev, struct clk *clk_user) 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);