linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/4] [media] solo6x10: free vb2 buffers on stop_streaming
@ 2014-10-29 16:03 Andrey Utkin
  2014-10-29 16:03 ` [PATCH 2/4] [media] solo6x10: free DMA allocation when releasing encoder Andrey Utkin
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Andrey Utkin @ 2014-10-29 16:03 UTC (permalink / raw)
  To: linux-kernel, linux-media, devel
  Cc: ismael.luceno, m.chehab, hverkuil, Andrey Utkin

This fixes warning from drivers/media/v4l2-core/videobuf2-core.c:2144

Signed-off-by: Andrey Utkin <andrey.krieger.utkin@gmail.com>
---
 drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
index 28023f9..6cd6a25 100644
--- a/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
+++ b/drivers/media/pci/solo6x10/solo6x10-v4l2-enc.c
@@ -781,9 +781,19 @@ static int solo_enc_start_streaming(struct vb2_queue *q, unsigned int count)
 static void solo_enc_stop_streaming(struct vb2_queue *q)
 {
 	struct solo_enc_dev *solo_enc = vb2_get_drv_priv(q);
+	unsigned long flags;
 
+	spin_lock_irqsave(&solo_enc->av_lock, flags);
 	solo_enc_off(solo_enc);
-	INIT_LIST_HEAD(&solo_enc->vidq_active);
+	while (!list_empty(&solo_enc->vidq_active)) {
+		struct solo_vb2_buf *buf = list_entry(
+				solo_enc->vidq_active.next,
+				struct solo_vb2_buf, list);
+
+		list_del(&buf->list);
+		vb2_buffer_done(&buf->vb, VB2_BUF_STATE_ERROR);
+	}
+	spin_unlock_irqrestore(&solo_enc->av_lock, flags);
 	solo_ring_stop(solo_enc->solo_dev);
 }
 
-- 
1.8.5.5


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

end of thread, other threads:[~2014-11-07  6:31 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-29 16:03 [PATCH 1/4] [media] solo6x10: free vb2 buffers on stop_streaming Andrey Utkin
2014-10-29 16:03 ` [PATCH 2/4] [media] solo6x10: free DMA allocation when releasing encoder Andrey Utkin
2014-10-29 16:03 ` [PATCH 3/4] [media] solo6x10: bind start & stop of encoded frames processing thread to device (de)init Andrey Utkin
2014-10-29 16:03 ` [PATCH 4/4] [media] solo6x10: don't turn off/on encoder interrupt in processing loop Andrey Utkin
2014-11-03 15:15   ` Hans Verkuil
2014-11-04 17:55     ` Andrey Utkin
2014-11-06 14:58 ` [PATCH 1/4] [media] solo6x10: free vb2 buffers on stop_streaming Dan Carpenter
2014-11-06 21:06   ` [PATCH v2 1/4] [media] solo6x10: clean up properly in stop_streaming Andrey Utkin
2014-11-07  6:30     ` Dan Carpenter

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