Skip to content

Commit 89f7e9d

Browse files
bebarinoMichael Turquette
authored andcommitted
clk: Really fix deadlock with mmap_sem
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]
1 parent c9b9281 commit 89f7e9d

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/clk/clk.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,6 @@ static const struct file_operations clk_dump_fops = {
240240
.release = single_release,
241241
};
242242

243-
/* caller must hold prepare_lock */
244243
static int clk_debug_create_one(struct clk *clk, struct dentry *pdentry)
245244
{
246245
struct dentry *d;
@@ -1944,7 +1943,6 @@ int __clk_init(struct device *dev, struct clk *clk)
19441943
else
19451944
clk->rate = 0;
19461945

1947-
clk_debug_register(clk);
19481946
/*
19491947
* walk the list of orphan clocks and reparent any that are children of
19501948
* this clock
@@ -1979,6 +1977,9 @@ int __clk_init(struct device *dev, struct clk *clk)
19791977
out:
19801978
clk_prepare_unlock();
19811979

1980+
if (!ret)
1981+
clk_debug_register(clk);
1982+
19821983
return ret;
19831984
}
19841985

0 commit comments

Comments
 (0)