Skip to content

Commit 3e01ae2

Browse files
groecklinusw
authored andcommitted
drm/pl111: Initialize clock spinlock early
The following warning is seen on systems with broken clock divider. INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. CPU: 0 PID: 1 Comm: swapper Not tainted 5.1.0-09698-g1fb3b52 #1 Hardware name: ARM Integrator/CP (Device Tree) [<c0011be8>] (unwind_backtrace) from [<c000ebb8>] (show_stack+0x10/0x18) [<c000ebb8>] (show_stack) from [<c07d3fd0>] (dump_stack+0x18/0x24) [<c07d3fd0>] (dump_stack) from [<c0060d48>] (register_lock_class+0x674/0x6f8) [<c0060d48>] (register_lock_class) from [<c005de2c>] (__lock_acquire+0x68/0x2128) [<c005de2c>] (__lock_acquire) from [<c0060408>] (lock_acquire+0x110/0x21c) [<c0060408>] (lock_acquire) from [<c07f755c>] (_raw_spin_lock+0x34/0x48) [<c07f755c>] (_raw_spin_lock) from [<c0536c8c>] (pl111_display_enable+0xf8/0x5fc) [<c0536c8c>] (pl111_display_enable) from [<c0502f54>] (drm_atomic_helper_commit_modeset_enables+0x1ec/0x244) Since commit eedd603 ("drm/pl111: Support variants with broken clock divider"), the spinlock is not initialized if the clock divider is broken. Initialize it earlier to fix the problem. Fixes: eedd603 ("drm/pl111: Support variants with broken clock divider") Cc: Linus Walleij <[email protected]> Signed-off-by: Guenter Roeck <[email protected]> Signed-off-by: Linus Walleij <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 90f9466 commit 3e01ae2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/pl111/pl111_display.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,14 +531,15 @@ pl111_init_clock_divider(struct drm_device *drm)
531531
dev_err(drm->dev, "CLCD: unable to get clcdclk.\n");
532532
return PTR_ERR(parent);
533533
}
534+
535+
spin_lock_init(&priv->tim2_lock);
536+
534537
/* If the clock divider is broken, use the parent directly */
535538
if (priv->variant->broken_clockdivider) {
536539
priv->clk = parent;
537540
return 0;
538541
}
539542
parent_name = __clk_get_name(parent);
540-
541-
spin_lock_init(&priv->tim2_lock);
542543
div->init = &init;
543544

544545
ret = devm_clk_hw_register(drm->dev, div);

0 commit comments

Comments
 (0)