linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/pl111: Initialize clock spinlock early
@ 2019-05-13 14:46 Guenter Roeck
  2019-05-14 22:20 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Guenter Roeck @ 2019-05-13 14:46 UTC (permalink / raw)
  To: Eric Anholt
  Cc: David Airlie, Daniel Vetter, dri-devel, linux-kernel,
	Guenter Roeck, Linus Walleij

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 eedd6033b4c8 ("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: eedd6033b4c8 ("drm/pl111: Support variants with broken clock divider")
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
---
 drivers/gpu/drm/pl111/pl111_display.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/pl111/pl111_display.c b/drivers/gpu/drm/pl111/pl111_display.c
index 0c5d391f0a8f..4501597f30ab 100644
--- a/drivers/gpu/drm/pl111/pl111_display.c
+++ b/drivers/gpu/drm/pl111/pl111_display.c
@@ -531,14 +531,15 @@ pl111_init_clock_divider(struct drm_device *drm)
 		dev_err(drm->dev, "CLCD: unable to get clcdclk.\n");
 		return PTR_ERR(parent);
 	}
+
+	spin_lock_init(&priv->tim2_lock);
+
 	/* If the clock divider is broken, use the parent directly */
 	if (priv->variant->broken_clockdivider) {
 		priv->clk = parent;
 		return 0;
 	}
 	parent_name = __clk_get_name(parent);
-
-	spin_lock_init(&priv->tim2_lock);
 	div->init = &init;
 
 	ret = devm_clk_hw_register(drm->dev, div);
-- 
2.7.4


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/pl111: Initialize clock spinlock early
  2019-05-13 14:46 [PATCH] drm/pl111: Initialize clock spinlock early Guenter Roeck
@ 2019-05-14 22:20 ` Linus Walleij
  2019-05-15  1:05   ` Guenter Roeck
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2019-05-14 22:20 UTC (permalink / raw)
  To: Guenter Roeck
  Cc: Eric Anholt, David Airlie, Daniel Vetter,
	open list:DRM PANEL DRIVERS, linux-kernel

On Mon, May 13, 2019 at 4:46 PM Guenter Roeck <linux@roeck-us.net> wrote:

> 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 eedd6033b4c8 ("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: eedd6033b4c8 ("drm/pl111: Support variants with broken clock divider")
> Cc: Linus Walleij <linus.walleij@linaro.org>
> Signed-off-by: Guenter Roeck <linux@roeck-us.net>

Applied to drm-misc-next-fixes and pushed.

Out of curiosity: do you have a "real" Integrator/CP or is this
QEMU?

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] drm/pl111: Initialize clock spinlock early
  2019-05-14 22:20 ` Linus Walleij
@ 2019-05-15  1:05   ` Guenter Roeck
  0 siblings, 0 replies; 3+ messages in thread
From: Guenter Roeck @ 2019-05-15  1:05 UTC (permalink / raw)
  To: Linus Walleij
  Cc: Eric Anholt, David Airlie, Daniel Vetter,
	open list:DRM PANEL DRIVERS, linux-kernel

On 5/14/19 3:20 PM, Linus Walleij wrote:
> On Mon, May 13, 2019 at 4:46 PM Guenter Roeck <linux@roeck-us.net> wrote:
> 
>> 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 eedd6033b4c8 ("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: eedd6033b4c8 ("drm/pl111: Support variants with broken clock divider")
>> Cc: Linus Walleij <linus.walleij@linaro.org>
>> Signed-off-by: Guenter Roeck <linux@roeck-us.net>
> 
> Applied to drm-misc-next-fixes and pushed.
> 
> Out of curiosity: do you have a "real" Integrator/CP or is this
> QEMU?
> 

This is with qemu.

Guenter

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-15  1:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-13 14:46 [PATCH] drm/pl111: Initialize clock spinlock early Guenter Roeck
2019-05-14 22:20 ` Linus Walleij
2019-05-15  1:05   ` Guenter Roeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).