linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] [media] rc: sunxi-cir: Initialize the spinlock properly
@ 2015-12-22  4:27 Chen-Yu Tsai
  2015-12-22 11:43 ` Hans de Goede
  2015-12-22 20:38 ` Maxime Ripard
  0 siblings, 2 replies; 3+ messages in thread
From: Chen-Yu Tsai @ 2015-12-22  4:27 UTC (permalink / raw)
  To: Mauro Carvalho Chehab, Maxime Ripard
  Cc: Chen-Yu Tsai, Hans de Goede, linux-media, linux-arm-kernel, linux-kernel

The driver allocates the spinlock but fails to initialize it correctly.
The kernel reports a BUG indicating bad spinlock magic when spinlock
debugging is enabled.

Call spin_lock_init() on it to initialize it correctly.

Fixes: b4e3e59fb59c ("[media] rc: add sunxi-ir driver")
Signed-off-by: Chen-Yu Tsai <wens@csie.org>
---
 drivers/media/rc/sunxi-cir.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c
index 7830aef3db45..40f77685cc4a 100644
--- a/drivers/media/rc/sunxi-cir.c
+++ b/drivers/media/rc/sunxi-cir.c
@@ -153,6 +153,8 @@ static int sunxi_ir_probe(struct platform_device *pdev)
 	if (!ir)
 		return -ENOMEM;
 
+	spin_lock_init(&ir->ir_lock);
+
 	if (of_device_is_compatible(dn, "allwinner,sun5i-a13-ir"))
 		ir->fifo_size = 64;
 	else
-- 
2.6.4


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

* Re: [PATCH] [media] rc: sunxi-cir: Initialize the spinlock properly
  2015-12-22  4:27 [PATCH] [media] rc: sunxi-cir: Initialize the spinlock properly Chen-Yu Tsai
@ 2015-12-22 11:43 ` Hans de Goede
  2015-12-22 20:38 ` Maxime Ripard
  1 sibling, 0 replies; 3+ messages in thread
From: Hans de Goede @ 2015-12-22 11:43 UTC (permalink / raw)
  To: Chen-Yu Tsai, Mauro Carvalho Chehab, Maxime Ripard
  Cc: linux-media, linux-arm-kernel, linux-kernel

Hi,

On 22-12-15 05:27, Chen-Yu Tsai wrote:
> The driver allocates the spinlock but fails to initialize it correctly.
> The kernel reports a BUG indicating bad spinlock magic when spinlock
> debugging is enabled.
>
> Call spin_lock_init() on it to initialize it correctly.
>
> Fixes: b4e3e59fb59c ("[media] rc: add sunxi-ir driver")
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

Good catch:

Acked-by: Hans de Goede <hdegoede@redhat.com>

Regards,

Hans


> ---
>   drivers/media/rc/sunxi-cir.c | 2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/drivers/media/rc/sunxi-cir.c b/drivers/media/rc/sunxi-cir.c
> index 7830aef3db45..40f77685cc4a 100644
> --- a/drivers/media/rc/sunxi-cir.c
> +++ b/drivers/media/rc/sunxi-cir.c
> @@ -153,6 +153,8 @@ static int sunxi_ir_probe(struct platform_device *pdev)
>   	if (!ir)
>   		return -ENOMEM;
>
> +	spin_lock_init(&ir->ir_lock);
> +
>   	if (of_device_is_compatible(dn, "allwinner,sun5i-a13-ir"))
>   		ir->fifo_size = 64;
>   	else
>

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

* Re: [PATCH] [media] rc: sunxi-cir: Initialize the spinlock properly
  2015-12-22  4:27 [PATCH] [media] rc: sunxi-cir: Initialize the spinlock properly Chen-Yu Tsai
  2015-12-22 11:43 ` Hans de Goede
@ 2015-12-22 20:38 ` Maxime Ripard
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Ripard @ 2015-12-22 20:38 UTC (permalink / raw)
  To: Chen-Yu Tsai
  Cc: Mauro Carvalho Chehab, Hans de Goede, linux-media,
	linux-arm-kernel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 593 bytes --]

Hi,

On Tue, Dec 22, 2015 at 12:27:35PM +0800, Chen-Yu Tsai wrote:
> The driver allocates the spinlock but fails to initialize it correctly.
> The kernel reports a BUG indicating bad spinlock magic when spinlock
> debugging is enabled.
> 
> Call spin_lock_init() on it to initialize it correctly.
> 
> Fixes: b4e3e59fb59c ("[media] rc: add sunxi-ir driver")
> Signed-off-by: Chen-Yu Tsai <wens@csie.org>

You should probably Cc stable on this one.

Thanks!
Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

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

end of thread, other threads:[~2015-12-22 20:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-12-22  4:27 [PATCH] [media] rc: sunxi-cir: Initialize the spinlock properly Chen-Yu Tsai
2015-12-22 11:43 ` Hans de Goede
2015-12-22 20:38 ` Maxime Ripard

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).