clk: Add some more lockdep assertions
We don't check to make sure the enable_lock is held across
enable/disable and we don't check if the prepare_lock is held
across prepare/unprepare. Add some asserts to catch any future
locking problems.
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 9e9d18c..659f2b0 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -543,6 +543,8 @@
static void clk_core_unprepare(struct clk_core *core)
{
+ lockdep_assert_held(&prepare_lock);
+
if (!core)
return;
@@ -589,6 +591,8 @@
{
int ret = 0;
+ lockdep_assert_held(&prepare_lock);
+
if (!core)
return 0;
@@ -644,6 +648,8 @@
static void clk_core_disable(struct clk_core *core)
{
+ lockdep_assert_held(&enable_lock);
+
if (!core)
return;
@@ -692,6 +698,8 @@
{
int ret = 0;
+ lockdep_assert_held(&enable_lock);
+
if (!core)
return 0;