All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] clk: fix critical clock locking
@ 2016-05-13  8:00 Maxime Ripard
  2016-05-17 12:25 ` Heiko Stuebner
  2016-05-19 21:10 ` Stephen Boyd
  0 siblings, 2 replies; 3+ messages in thread
From: Maxime Ripard @ 2016-05-13  8:00 UTC (permalink / raw)
  To: Mike Turquette, Stephen Boyd; +Cc: linux-clk, Maxime Ripard

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>

---
Changes from v1:
  - Removed the redundant prepare lock

 drivers/clk/clk.c | 5 +++++
 1 file changed, 5 insertions(+)

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)
 		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);
-- 
2.8.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2016-05-19 21:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-13  8:00 [PATCH] clk: fix critical clock locking Maxime Ripard
2016-05-17 12:25 ` Heiko Stuebner
2016-05-19 21:10 ` Stephen Boyd

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.