From: John Sheu Date: Tue, 11 Dec 2012 06:33:50 +0000 (-0800) Subject: CHROMIUM: v4l2-m2m: use CAPTURE queue lock X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=1a6d966a3fe9ab4307785358ca2e97cddc16078b;p=cascardo%2Flinux.git CHROMIUM: v4l2-m2m: use CAPTURE queue lock 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 BUG=chrome-os-partner:10057 BUG=chrome-os-partner:14521 TEST=local build, run on exynos Change-Id: I3f90d703dd051201f338d8e5758d3036150c78a2 Reviewed-on: https://gerrit.chromium.org/gerrit/39537 Reviewed-by: Pawel Osciak Tested-by: John Sheu Commit-Queue: John Sheu --- diff --git a/drivers/media/video/v4l2-mem2mem.c b/drivers/media/video/v4l2-mem2mem.c index d64811c3cd72..8cad5acad7ad 100644 --- a/drivers/media/video/v4l2-mem2mem.c +++ b/drivers/media/video/v4l2-mem2mem.c @@ -227,12 +227,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