All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/1] V4L: Event: debugging fixes
@ 2010-05-03 15:42 Sakari Ailus
  2010-05-03 15:42 ` [PATCH 1/1] V4L: Events: Replace bad WARN_ON() with assert_spin_locked() Sakari Ailus
  0 siblings, 1 reply; 3+ messages in thread
From: Sakari Ailus @ 2010-05-03 15:42 UTC (permalink / raw)
  To: linux-media@vger.kernel.org; +Cc: Laurent Pinchart

Hi,

Laurent Pinchart found that on uni-processor kernels without spinlock
debugging spin_is_locked() is always zero, which causes a bad WARN_ON()
message to be shown. The following patch removes the WARN_ON() and
replaces it with assert_spin_locked() which works correctly.

Regards,

-- 
Sakari Ailus
sakari.ailus@maxwell.research.nokia.com

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

* [PATCH 1/1] V4L: Events: Replace bad WARN_ON() with assert_spin_locked()
  2010-05-03 15:42 [PATCH 0/1] V4L: Event: debugging fixes Sakari Ailus
@ 2010-05-03 15:42 ` Sakari Ailus
  2010-05-03 15:57   ` Laurent Pinchart
  0 siblings, 1 reply; 3+ messages in thread
From: Sakari Ailus @ 2010-05-03 15:42 UTC (permalink / raw)
  To: linux-media; +Cc: laurent.pinchart

spin_is_locked() always returns zero when spinlock debugging is
disabled on a single CPU machine. Replace WARN_ON() with
assert_spin_locked().

Thanks to Laurent Pinchart for spotting this!

Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
---
 drivers/media/video/v4l2-event.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/media/video/v4l2-event.c b/drivers/media/video/v4l2-event.c
index 170e40f..91bb1c8 100644
--- a/drivers/media/video/v4l2-event.c
+++ b/drivers/media/video/v4l2-event.c
@@ -152,7 +152,7 @@ static struct v4l2_subscribed_event *v4l2_event_subscribed(
 	struct v4l2_events *events = fh->events;
 	struct v4l2_subscribed_event *sev;
 
-	WARN_ON(!spin_is_locked(&fh->vdev->fh_lock));
+	assert_spin_locked(&fh->vdev->fh_lock);
 
 	list_for_each_entry(sev, &events->subscribed, list) {
 		if (sev->type == type)
-- 
1.5.6.5


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

* Re: [PATCH 1/1] V4L: Events: Replace bad WARN_ON() with assert_spin_locked()
  2010-05-03 15:42 ` [PATCH 1/1] V4L: Events: Replace bad WARN_ON() with assert_spin_locked() Sakari Ailus
@ 2010-05-03 15:57   ` Laurent Pinchart
  0 siblings, 0 replies; 3+ messages in thread
From: Laurent Pinchart @ 2010-05-03 15:57 UTC (permalink / raw)
  To: Sakari Ailus; +Cc: linux-media

On Monday 03 May 2010 17:42:46 Sakari Ailus wrote:
> spin_is_locked() always returns zero when spinlock debugging is
> disabled on a single CPU machine. Replace WARN_ON() with
> assert_spin_locked().
> 
> Thanks to Laurent Pinchart for spotting this!
> 
> Signed-off-by: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>

Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> ---
>  drivers/media/video/v4l2-event.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/media/video/v4l2-event.c
> b/drivers/media/video/v4l2-event.c index 170e40f..91bb1c8 100644
> --- a/drivers/media/video/v4l2-event.c
> +++ b/drivers/media/video/v4l2-event.c
> @@ -152,7 +152,7 @@ static struct v4l2_subscribed_event
> *v4l2_event_subscribed( struct v4l2_events *events = fh->events;
>  	struct v4l2_subscribed_event *sev;
> 
> -	WARN_ON(!spin_is_locked(&fh->vdev->fh_lock));
> +	assert_spin_locked(&fh->vdev->fh_lock);
> 
>  	list_for_each_entry(sev, &events->subscribed, list) {
>  		if (sev->type == type)

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2010-05-03 15:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-03 15:42 [PATCH 0/1] V4L: Event: debugging fixes Sakari Ailus
2010-05-03 15:42 ` [PATCH 1/1] V4L: Events: Replace bad WARN_ON() with assert_spin_locked() Sakari Ailus
2010-05-03 15:57   ` Laurent Pinchart

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.