diff options
author | Maxime Ripard <maxime.ripard@free-electrons.com> | 2018-07-26 18:42:28 +0100 |
---|---|---|
committer | Pavel <pavel@ucw.cz> | 2019-06-23 12:14:52 +0200 |
commit | ab84de7a26cb6aeceb1679a7e97b5161c40ce1c2 (patch) | |
tree | 679d789f7ad63ad43b063e17ecc06359071458dc | |
parent | debe686096ca3c9dce14c0798ac513ba5257cf14 (diff) | |
download | linux-cip-ab84de7a26cb6aeceb1679a7e97b5161c40ce1c2.tar.gz |
clk: fix critical clock locking
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>
Reviewed-by: Heiko Stuebner <heiko@sntech.de>
Tested-by: Heiko Stuebner <heiko@sntech.de>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
(cherry picked from commit ef56b79b66faeeb0dc14213d3cc9e0534a960dee)
Signed-off-by: Fabrizio Castro <fabrizio.castro@bp.renesas.com>
Reviewed-by: Biju Das <biju.das@bp.renesas.com>
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
-rw-r--r-- | drivers/clk/clk.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index a5b6a200ffcb59..ef6b789161c877 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -2476,8 +2476,13 @@ static int __clk_init(struct device *dev, struct clk *clk_user) 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); |