]>
Commit | Line | Data |
---|---|---|
37554d48 SL |
1 | From ae5788f0fcdb418b4cfe2528954e50b783d3620b Mon Sep 17 00:00:00 2001 |
2 | From: Guenter Roeck <linux@roeck-us.net> | |
3 | Date: Mon, 13 May 2019 07:46:21 -0700 | |
4 | Subject: drm/pl111: Initialize clock spinlock early | |
5 | ||
6 | [ Upstream commit 3e01ae2612bdd7975c74ec7123d7f8f5e6eed795 ] | |
7 | ||
8 | The following warning is seen on systems with broken clock divider. | |
9 | ||
10 | INFO: trying to register non-static key. | |
11 | the code is fine but needs lockdep annotation. | |
12 | turning off the locking correctness validator. | |
13 | CPU: 0 PID: 1 Comm: swapper Not tainted 5.1.0-09698-g1fb3b52 #1 | |
14 | Hardware name: ARM Integrator/CP (Device Tree) | |
15 | [<c0011be8>] (unwind_backtrace) from [<c000ebb8>] (show_stack+0x10/0x18) | |
16 | [<c000ebb8>] (show_stack) from [<c07d3fd0>] (dump_stack+0x18/0x24) | |
17 | [<c07d3fd0>] (dump_stack) from [<c0060d48>] (register_lock_class+0x674/0x6f8) | |
18 | [<c0060d48>] (register_lock_class) from [<c005de2c>] | |
19 | (__lock_acquire+0x68/0x2128) | |
20 | [<c005de2c>] (__lock_acquire) from [<c0060408>] (lock_acquire+0x110/0x21c) | |
21 | [<c0060408>] (lock_acquire) from [<c07f755c>] (_raw_spin_lock+0x34/0x48) | |
22 | [<c07f755c>] (_raw_spin_lock) from [<c0536c8c>] | |
23 | (pl111_display_enable+0xf8/0x5fc) | |
24 | [<c0536c8c>] (pl111_display_enable) from [<c0502f54>] | |
25 | (drm_atomic_helper_commit_modeset_enables+0x1ec/0x244) | |
26 | ||
27 | Since commit eedd6033b4c8 ("drm/pl111: Support variants with broken clock | |
28 | divider"), the spinlock is not initialized if the clock divider is broken. | |
29 | Initialize it earlier to fix the problem. | |
30 | ||
31 | Fixes: eedd6033b4c8 ("drm/pl111: Support variants with broken clock divider") | |
32 | Cc: Linus Walleij <linus.walleij@linaro.org> | |
33 | Signed-off-by: Guenter Roeck <linux@roeck-us.net> | |
34 | Signed-off-by: Linus Walleij <linus.walleij@linaro.org> | |
35 | Link: https://patchwork.freedesktop.org/patch/msgid/1557758781-23586-1-git-send-email-linux@roeck-us.net | |
36 | Signed-off-by: Sasha Levin <sashal@kernel.org> | |
37 | --- | |
38 | drivers/gpu/drm/pl111/pl111_display.c | 5 +++-- | |
39 | 1 file changed, 3 insertions(+), 2 deletions(-) | |
40 | ||
41 | diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c | |
42 | index 754f6b25f265..6d9f78612dee 100644 | |
43 | --- a/drivers/gpu/drm/pl111/pl111_display.c | |
44 | +++ b/drivers/gpu/drm/pl111/pl111_display.c | |
45 | @@ -531,14 +531,15 @@ pl111_init_clock_divider(struct drm_device *drm) | |
46 | dev_err(drm->dev, "CLCD: unable to get clcdclk.\n"); | |
47 | return PTR_ERR(parent); | |
48 | } | |
49 | + | |
50 | + spin_lock_init(&priv->tim2_lock); | |
51 | + | |
52 | /* If the clock divider is broken, use the parent directly */ | |
53 | if (priv->variant->broken_clockdivider) { | |
54 | priv->clk = parent; | |
55 | return 0; | |
56 | } | |
57 | parent_name = __clk_get_name(parent); | |
58 | - | |
59 | - spin_lock_init(&priv->tim2_lock); | |
60 | div->init = &init; | |
61 | ||
62 | ret = devm_clk_hw_register(drm->dev, div); | |
63 | -- | |
64 | 2.20.1 | |
65 |