This is an automatic generated email to let you know that the following patch 
were queued:

Subject: [media] v4l: vsp1: Prevent pipelines from running when not streaming
Author:  Laurent Pinchart <>
Date:    Fri Jul 8 06:20:51 2016 -0300

Pipelines can only be run if all their video nodes are streaming. Commit
b4dfb9b35a19 ("[media] v4l: vsp1: Stop the pipeline upon the first
STREAMOFF") fixed the pipeline stop sequence, but introduced a race
condition that makes it possible to run a pipeline after stopping the
stream on a video node by queuing a buffer on the other side of the

Fix this by clearing the buffers ready flag when stopping the stream,
which will prevent the QBUF handler from running the pipeline.

Fixes: b4dfb9b35a19 ("[media] v4l: vsp1: Stop the pipeline upon the first 

Reported-by: Kieran Bingham <>
Tested-by: Kieran Bingham <>
Signed-off-by: Laurent Pinchart <>
Signed-off-by: Mauro Carvalho Chehab <>

 drivers/media/platform/vsp1/vsp1_video.c | 7 +++++++
 1 file changed, 7 insertions(+)


diff --git a/drivers/media/platform/vsp1/vsp1_video.c 
index 9fb4fc26a359..ed9759e8a6fc 100644
--- a/drivers/media/platform/vsp1/vsp1_video.c
+++ b/drivers/media/platform/vsp1/vsp1_video.c
@@ -675,6 +675,13 @@ static void vsp1_video_stop_streaming(struct vb2_queue *vq)
        unsigned long flags;
        int ret;
+       /* Clear the buffers ready flag to make sure the device won't be started
+        * by a QBUF on the video node on the other side of the pipeline.
+        */
+       spin_lock_irqsave(&video->irqlock, flags);
+       pipe->buffers_ready &= ~(1 << video->pipe_index);
+       spin_unlock_irqrestore(&video->irqlock, flags);
        if (--pipe->stream_count == pipe->num_inputs) {
                /* Stop the pipeline. */

linuxtv-commits mailing list

Reply via email to