[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20191018153437.20614-18-bparrot@ti.com>
Date: Fri, 18 Oct 2019 10:34:35 -0500
From: Benoit Parrot <bparrot@...com>
To: Hans Verkuil <hverkuil@...all.nl>, Rob Herring <robh+dt@...nel.org>
CC: <linux-media@...r.kernel.org>, <devicetree@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, Benoit Parrot <bparrot@...com>
Subject: [Patch 17/19] media: ti-vpe: cal: Fix a WARN issued when start streaming fails
When start_streaming fails after the buffers have been queued we have to
make sure all buffers are returned to user-space properly otherwise a
v4l2 level WARN is generated.
Signed-off-by: Benoit Parrot <bparrot@...com>
---
drivers/media/platform/ti-vpe/cal.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/drivers/media/platform/ti-vpe/cal.c b/drivers/media/platform/ti-vpe/cal.c
index a0ff67412410..b55987ee70dd 100644
--- a/drivers/media/platform/ti-vpe/cal.c
+++ b/drivers/media/platform/ti-vpe/cal.c
@@ -1702,10 +1702,15 @@ static int cal_start_streaming(struct vb2_queue *vq, unsigned int count)
return 0;
err:
+ spin_lock_irqsave(&ctx->slock, flags);
+ vb2_buffer_done(&ctx->cur_frm->vb.vb2_buf, VB2_BUF_STATE_QUEUED);
+ ctx->cur_frm = NULL;
+ ctx->next_frm = NULL;
list_for_each_entry_safe(buf, tmp, &dma_q->active, list) {
list_del(&buf->list);
vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_QUEUED);
}
+ spin_unlock_irqrestore(&ctx->slock, flags);
return ret;
}
--
2.17.1
Powered by blists - more mailing lists