]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blame - releases/4.19.51/drm-pl111-initialize-clock-spinlock-early.patch
Linux 4.19.51
[thirdparty/kernel/stable-queue.git] / releases / 4.19.51 / drm-pl111-initialize-clock-spinlock-early.patch
CommitLineData
37554d48
SL
1From ae5788f0fcdb418b4cfe2528954e50b783d3620b Mon Sep 17 00:00:00 2001
2From: Guenter Roeck <linux@roeck-us.net>
3Date: Mon, 13 May 2019 07:46:21 -0700
4Subject: drm/pl111: Initialize clock spinlock early
5
6[ Upstream commit 3e01ae2612bdd7975c74ec7123d7f8f5e6eed795 ]
7
8The following warning is seen on systems with broken clock divider.
9
10INFO: trying to register non-static key.
11the code is fine but needs lockdep annotation.
12turning off the locking correctness validator.
13CPU: 0 PID: 1 Comm: swapper Not tainted 5.1.0-09698-g1fb3b52 #1
14Hardware 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
27Since commit eedd6033b4c8 ("drm/pl111: Support variants with broken clock
28divider"), the spinlock is not initialized if the clock divider is broken.
29Initialize it earlier to fix the problem.
30
31Fixes: eedd6033b4c8 ("drm/pl111: Support variants with broken clock divider")
32Cc: Linus Walleij <linus.walleij@linaro.org>
33Signed-off-by: Guenter Roeck <linux@roeck-us.net>
34Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
35Link: https://patchwork.freedesktop.org/patch/msgid/1557758781-23586-1-git-send-email-linux@roeck-us.net
36Signed-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
41diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
42index 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--
642.20.1
65