Commit 89f7e9de authored by Stephen Boyd's avatar Stephen Boyd Committed by Michael Turquette

clk: Really fix deadlock with mmap_sem

Commit 6314b679 (clk: Don't hold prepare_lock across debugfs
creation, 2014-09-04) forgot to update one place where we hold
the prepare_lock while creating debugfs directories. This means
we still have the chance of a deadlock that the commit was trying
to fix. Actually fix it by moving the debugfs creation outside
the prepare_lock.

Cc: <stable@vger.kernel.org> # 3.18
Reported-by: default avatarRussell King <rmk+kernel@arm.linux.org.uk>
Fixes: 6314b679 "clk: Don't hold prepare_lock across debugfs creation"
Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarMichael Turquette <mturquette@linaro.org>
[mturquette@linaro.org: removed lockdep_assert]
parent c9b92814
...@@ -240,7 +240,6 @@ static const struct file_operations clk_dump_fops = { ...@@ -240,7 +240,6 @@ static const struct file_operations clk_dump_fops = {
.release = single_release, .release = single_release,
}; };
/* caller must hold prepare_lock */
static int clk_debug_create_one(struct clk *clk, struct dentry *pdentry) static int clk_debug_create_one(struct clk *clk, struct dentry *pdentry)
{ {
struct dentry *d; struct dentry *d;
...@@ -1944,7 +1943,6 @@ int __clk_init(struct device *dev, struct clk *clk) ...@@ -1944,7 +1943,6 @@ int __clk_init(struct device *dev, struct clk *clk)
else else
clk->rate = 0; clk->rate = 0;
clk_debug_register(clk);
/* /*
* walk the list of orphan clocks and reparent any that are children of * walk the list of orphan clocks and reparent any that are children of
* this clock * this clock
...@@ -1979,6 +1977,9 @@ int __clk_init(struct device *dev, struct clk *clk) ...@@ -1979,6 +1977,9 @@ int __clk_init(struct device *dev, struct clk *clk)
out: out:
clk_prepare_unlock(); clk_prepare_unlock();
if (!ret)
clk_debug_register(clk);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment