Commit f1a0569b authored by John Sheu's avatar John Sheu Committed by Mauro Carvalho Chehab

[media] v4l2-mem2mem: 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: default avatarJohn Sheu <sheu@google.com>
Acked-by: default avatarPawel Osciak <pawel@osciak.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent b0a1f2a8
...@@ -230,12 +230,15 @@ static void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx *m2m_ctx) ...@@ -230,12 +230,15 @@ static void v4l2_m2m_try_schedule(struct v4l2_m2m_ctx *m2m_ctx)
dprintk("No input buffers available\n"); dprintk("No input buffers available\n");
return; return;
} }
spin_lock_irqsave(&m2m_ctx->cap_q_ctx.rdy_spinlock, flags);
if (list_empty(&m2m_ctx->cap_q_ctx.rdy_queue)) { 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_ctx->out_q_ctx.rdy_spinlock, flags);
spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags_job); spin_unlock_irqrestore(&m2m_dev->job_spinlock, flags_job);
dprintk("No output buffers available\n"); dprintk("No output buffers available\n");
return; return;
} }
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_ctx->out_q_ctx.rdy_spinlock, flags);
if (m2m_dev->m2m_ops->job_ready if (m2m_dev->m2m_ops->job_ready
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment