public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] v4l: Deadlock in videobuf-core for DQBUF waiting on QBUF
@ 2008-02-27  7:54 Brandon Philips
  2008-02-27 20:09 ` [v4l-dvb-maintainer] " Trent Piepho
       [not found] ` <20679.1204128530@vena.lwn.net>
  0 siblings, 2 replies; 7+ messages in thread
From: Brandon Philips @ 2008-02-27  7:54 UTC (permalink / raw)
  To: mchehab; +Cc: video4linux-list, v4l-dvb-maintainer

# HG changeset patch
# User Brandon Philips <brandon@ifup.org>
# Date 1204098775 28800
# Node ID 54fa1a0d9c5bcdfcb2ba70be2fc68d51a1ab7b9c
# Parent  9756fb75295872570d1fa49b4bcf5d0967ecedaa
v4l: Deadlock in videobuf-core for DQBUF waiting on QBUF

Avoid a deadlock where DQBUF is holding the vb_lock while waiting on a QBUF
which also needs the vb_lock.  Reported by Hans Verkuil <hverkuil@xs4all.nl>.

Signed-off-by: Brandon Philips <bphilips@suse.de>

---
Pull from: http://ifup.org/hg/v4l-dvb

Should be merged for 2.6.25

diff --git a/linux/drivers/media/video/videobuf-core.c b/linux/drivers/media/video/videobuf-core.c
--- a/linux/drivers/media/video/videobuf-core.c
+++ b/linux/drivers/media/video/videobuf-core.c
@@ -606,7 +606,9 @@ int videobuf_dqbuf(struct videobuf_queue
 		goto done;
 	}
 	buf = list_entry(q->stream.next, struct videobuf_buffer, stream);
+	mutex_unlock(&q->vb_lock);
 	retval = videobuf_waiton(buf, nonblocking, 1);
+	mutex_lock(&q->vb_lock);
 	if (retval < 0) {
 		dprintk(1, "dqbuf: waiton returned %d\n", retval);
 		goto done;


--
video4linux-list mailing list
Unsubscribe mailto:video4linux-list-request@redhat.com?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

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

end of thread, other threads:[~2008-03-04 20:16 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-27  7:54 [PATCH] v4l: Deadlock in videobuf-core for DQBUF waiting on QBUF Brandon Philips
2008-02-27 20:09 ` [v4l-dvb-maintainer] " Trent Piepho
     [not found] ` <20679.1204128530@vena.lwn.net>
2008-02-28  2:56   ` Brandon Philips
2008-02-29  9:34     ` Mauro Carvalho Chehab
2008-03-03  8:13       ` Brandon Philips
2008-03-04 13:45         ` Mauro Carvalho Chehab
2008-03-04 20:14           ` Brandon Philips

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox