Skip to content

Commit

Permalink
clk: Really fix deadlock with mmap_sem
Browse files Browse the repository at this point in the history
Commit 6314b67 (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: Russell King <rmk+kernel@arm.linux.org.uk>
Fixes: 6314b67 "clk: Don't hold prepare_lock across debugfs creation"
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Michael Turquette <mturquette@linaro.org>
[mturquette@linaro.org: removed lockdep_assert]
  • Loading branch information
Stephen Boyd authored and Michael Turquette committed Dec 16, 2014
1 parent c9b9281 commit 89f7e9d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/clk/clk.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ static const struct file_operations clk_dump_fops = {
.release = single_release,
};

/* caller must hold prepare_lock */
static int clk_debug_create_one(struct clk *clk, struct dentry *pdentry)
{
struct dentry *d;
Expand Down Expand Up @@ -1944,7 +1943,6 @@ int __clk_init(struct device *dev, struct clk *clk)
else
clk->rate = 0;

clk_debug_register(clk);
/*
* walk the list of orphan clocks and reparent any that are children of
* this clock
Expand Down Expand Up @@ -1979,6 +1977,9 @@ int __clk_init(struct device *dev, struct clk *clk)
out:
clk_prepare_unlock();

if (!ret)
clk_debug_register(clk);

return ret;
}

Expand Down

0 comments on commit 89f7e9d

Please sign in to comment.