aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacopo Mondi <jacopo+renesas@jmondi.org>2017-11-15 12:59:12 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2017-12-18 14:57:25 -0500
commit866a6eccdd998418065ff28fd280252bfa63e43c (patch)
tree70be833d60091aa1e575af6f7008a43216cabec5
parentmedia: vb2-core: fix descriptions for VB2-only functions (diff)
downloadlinux-dev-866a6eccdd998418065ff28fd280252bfa63e43c.tar.xz
linux-dev-866a6eccdd998418065ff28fd280252bfa63e43c.zip
media: v4l: sh_mobile_ceu: Return buffers on streamoff()
videobuf2 core reports an error when not all buffers have been returned to the framework: drivers/media/v4l2-core/videobuf2-core.c:1651 WARN_ON(atomic_read(&q->owned_by_drv_count)) Fix this returning all buffers currently in capture queue. Signed-off-by: Jacopo Mondi <jacopo+renesas@jmondi.org> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
-rw-r--r--drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
index 36762ec954e7..9180a1d96acb 100644
--- a/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
+++ b/drivers/media/platform/soc_camera/sh_mobile_ceu_camera.c
@@ -451,13 +451,18 @@ static void sh_mobile_ceu_stop_streaming(struct vb2_queue *q)
struct soc_camera_host *ici = to_soc_camera_host(icd->parent);
struct sh_mobile_ceu_dev *pcdev = ici->priv;
struct list_head *buf_head, *tmp;
+ struct vb2_v4l2_buffer *vbuf;
spin_lock_irq(&pcdev->lock);
pcdev->active = NULL;
- list_for_each_safe(buf_head, tmp, &pcdev->capture)
+ list_for_each_safe(buf_head, tmp, &pcdev->capture) {
+ vbuf = &list_entry(buf_head, struct sh_mobile_ceu_buffer,
+ queue)->vb;
+ vb2_buffer_done(&vbuf->vb2_buf, VB2_BUF_STATE_DONE);
list_del_init(buf_head);
+ }
spin_unlock_irq(&pcdev->lock);