diff mbox

[media] vb2: drop queued buffers while q->start_streaming_called is still set

Message ID 1399649540-20943-1-git-send-email-p.zabel@pengutronix.de (mailing list archive)
State New, archived
Headers show

Commit Message

Philipp Zabel May 9, 2014, 3:32 p.m. UTC
Otherwise yet another warning will trigger in vb2_buffer_done.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
---
 drivers/media/v4l2-core/videobuf2-core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Hans Verkuil May 9, 2014, 3:50 p.m. UTC | #1
On 05/09/2014 05:32 PM, Philipp Zabel wrote:
> Otherwise yet another warning will trigger in vb2_buffer_done.
> 
> Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>

Duplicate of: https://patchwork.linuxtv.org/patch/23723/

I'm setting your patch to superseded in patchwork.

Regards,

	Hans

> ---
>  drivers/media/v4l2-core/videobuf2-core.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
> index 4d4f6ba..bdca528 100644
> --- a/drivers/media/v4l2-core/videobuf2-core.c
> +++ b/drivers/media/v4l2-core/videobuf2-core.c
> @@ -2088,8 +2088,6 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
>  	if (q->start_streaming_called)
>  		call_void_qop(q, stop_streaming, q);
>  	q->streaming = 0;
> -	q->start_streaming_called = 0;
> -	q->queued_count = 0;
>  
>  	if (WARN_ON(atomic_read(&q->owned_by_drv_count))) {
>  		for (i = 0; i < q->num_buffers; ++i)
> @@ -2098,6 +2096,8 @@ static void __vb2_queue_cancel(struct vb2_queue *q)
>  		/* Must be zero now */
>  		WARN_ON(atomic_read(&q->owned_by_drv_count));
>  	}
> +	q->start_streaming_called = 0;
> +	q->queued_count = 0;
>  
>  	/*
>  	 * Remove all buffers from videobuf's list...
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c
index 4d4f6ba..bdca528 100644
--- a/drivers/media/v4l2-core/videobuf2-core.c
+++ b/drivers/media/v4l2-core/videobuf2-core.c
@@ -2088,8 +2088,6 @@  static void __vb2_queue_cancel(struct vb2_queue *q)
 	if (q->start_streaming_called)
 		call_void_qop(q, stop_streaming, q);
 	q->streaming = 0;
-	q->start_streaming_called = 0;
-	q->queued_count = 0;
 
 	if (WARN_ON(atomic_read(&q->owned_by_drv_count))) {
 		for (i = 0; i < q->num_buffers; ++i)
@@ -2098,6 +2096,8 @@  static void __vb2_queue_cancel(struct vb2_queue *q)
 		/* Must be zero now */
 		WARN_ON(atomic_read(&q->owned_by_drv_count));
 	}
+	q->start_streaming_called = 0;
+	q->queued_count = 0;
 
 	/*
 	 * Remove all buffers from videobuf's list...