There is only one frame known to the DMA engine in scatter/gather mode, but
it still tells us that any or all of frames 1-3 are done at each completion
interrupt.  Avoid the creation of junk frames by being sure to only
"complete" one on each interrupt.

Signed-off-by: Jonathan Corbet <cor...@lwn.net>
---
 drivers/media/video/marvell-ccic/mcam-core.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/media/video/marvell-ccic/mcam-core.c 
b/drivers/media/video/marvell-ccic/mcam-core.c
index e46a72a..036db27 100644
--- a/drivers/media/video/marvell-ccic/mcam-core.c
+++ b/drivers/media/video/marvell-ccic/mcam-core.c
@@ -1697,6 +1697,8 @@ int mccic_irq(struct mcam_camera *cam, unsigned int irqs)
                if (irqs & (IRQ_EOF0 << frame)) {
                        mcam_frame_complete(cam, frame);
                        handled = 1;
+                       if (cam->buffer_mode == B_DMA_sg)
+                               break;
                }
        /*
         * If a frame starts, note that we have DMA active.  This
-- 
1.7.9.3

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

Reply via email to