From 0e0809a58869e3e422985f868ad5e0da1fc0ba85 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Sun, 26 Sep 2010 09:01:26 -0300 Subject: V4L/DVB: videobuf: add queue argument to videobuf_waiton() videobuf_waiton() must unlock and relock ext_lock if it has to wait. For that to happen it needs the videobuf_queue pointer. Don't attempt to unlock/relock q->ext_lock unless it was locked in the first place. vb->state has to be protected by a spinlock to be safe. This patch is based on code from Mauro Carvalho Chehab . [mchehab@redhat.com: add extra argument to a few missing places] Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/staging/dt3155v4l/dt3155v4l.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'drivers/staging/dt3155v4l/dt3155v4l.c') diff --git a/drivers/staging/dt3155v4l/dt3155v4l.c b/drivers/staging/dt3155v4l/dt3155v4l.c index fd48b38e797c..b996697e7eb2 100644 --- a/drivers/staging/dt3155v4l/dt3155v4l.c +++ b/drivers/staging/dt3155v4l/dt3155v4l.c @@ -293,7 +293,7 @@ static void dt3155_buf_release(struct videobuf_queue *q, struct videobuf_buffer *vb) { if (vb->state == VIDEOBUF_ACTIVE) - videobuf_waiton(vb, 0, 0); /* FIXME: cannot be interrupted */ + videobuf_waiton(q, vb, 0, 0); /* FIXME: cannot be interrupted */ videobuf_dma_contig_free(q, vb); vb->state = VIDEOBUF_NEEDS_INIT; } @@ -440,7 +440,7 @@ dt3155_open(struct file *filp) videobuf_queue_dma_contig_init(pd->vidq, &vbq_ops, &pd->pdev->dev, &pd->lock, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FIELD_NONE, - sizeof(struct videobuf_buffer), pd); + sizeof(struct videobuf_buffer), pd, NULL); /* disable all irqs, clear all irq flags */ iowrite32(FLD_START | FLD_END_EVEN | FLD_END_ODD, pd->regs + INT_CSR); @@ -494,7 +494,7 @@ dt3155_release(struct file *filp) tmp = pd->curr_buf; spin_unlock_irqrestore(&pd->lock, flags); if (tmp) - videobuf_waiton(tmp, 0, 1); /* block, interruptible */ + videobuf_waiton(pd->vidq, tmp, 0, 1); /* block, interruptible */ dt3155_stop_acq(pd); videobuf_stop(pd->vidq); pd->acq_fp = NULL; @@ -603,7 +603,7 @@ dt3155_ioc_streamoff(struct file *filp, void *p, enum v4l2_buf_type type) tmp = pd->curr_buf; spin_unlock_irqrestore(&pd->lock, flags); if (tmp) - videobuf_waiton(tmp, 0, 1); /* block, interruptible */ + videobuf_waiton(pd->vidq, tmp, 0, 1); /* block, interruptible */ return ret; } -- cgit v1.2.3-59-g8ed1b