linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] [media] v4l2-mem2mem: use CAPTURE queue lock
@ 2013-02-07  0:03 John Sheu
  2013-02-07  0:03 ` [PATCH 2/3] [media]: v4l2-mem2mem: drop rdy_queue on STREAMOFF John Sheu
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: John Sheu @ 2013-02-07  0:03 UTC (permalink / raw)
  To: linux-media; +Cc: John Sheu, John Sheu

From: John Sheu <sheu@chromium.org>

In v4l2_m2m_try_schedule(), use the CAPTURE queue lock when accessing
the CAPTURE queue, instead of relying on just holding the OUTPUT queue
lock.

Signed-off-by: John Sheu <sheu@google.com>
---
 drivers/media/v4l2-core/v4l2-mem2mem.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/drivers/media/v4l2-core/v4l2-mem2mem.c b/drivers/media/v4l2-core/v4l2-mem2mem.c
index 438ea45..c52a2c5 100644
--- a/drivers/media/v4l2-core/v4l2-mem2mem.c
+++ b/drivers/media/v4l2-core/v4l2-mem2mem.c
@@ -230,12 +230,15 @@ static void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx *m2m_ctx)
 		dprintk("No input buffers available\n");
 		return;
 	}
+	spin_lock_irqsave(&m2m_ctx->cap_q_ctx.rdy_spinlock, flags);
 	if (list_empty(&m2m_ctx->cap_q_ctx.rdy_queue)) {
+		spin_unlock_irqrestore(&m2m_ctx->cap_q_ctx.rdy_spinlock, flags);
 		spin_unlock_irqrestore(&m2m_ctx->out_q_ctx.rdy_spinlock, flags);
 		spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags_job);
 		dprintk("No output buffers available\n");
 		return;
 	}
+	spin_unlock_irqrestore(&m2m_ctx->cap_q_ctx.rdy_spinlock, flags);
 	spin_unlock_irqrestore(&m2m_ctx->out_q_ctx.rdy_spinlock, flags);
 
 	if (m2m_dev->m2m_ops->job_ready
-- 
1.8.1


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

end of thread, other threads:[~2013-03-25 11:25 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-07  0:03 [PATCH 1/3] [media] v4l2-mem2mem: use CAPTURE queue lock John Sheu
2013-02-07  0:03 ` [PATCH 2/3] [media]: v4l2-mem2mem: drop rdy_queue on STREAMOFF John Sheu
2013-02-28 15:45   ` Pawel Osciak
2013-02-07  0:03 ` [PATCH 3/3] dma-buf: restore args on failure of dma_buf_mmap John Sheu
2013-02-07 10:24   ` Sumit Semwal
2013-03-18 23:49     ` Mauro Carvalho Chehab
2013-03-25 11:24       ` Sumit Semwal
2013-02-28 15:44 ` [PATCH 1/3] [media] v4l2-mem2mem: use CAPTURE queue lock Pawel Osciak

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