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

Subject: media: rcar-vin: Add check for completed capture before completing 
buffer
Author:  Niklas Söderlund <[email protected]>
Date:    Tue Nov 23 16:54:43 2021 +0100

Before reading which slot was captured to by examining the module status
(VnMS) register, make sure something was captured at all by examining
the interrupt status register (VnINTS).

Failing this a buffer maybe completed before it was captured too.

Signed-off-by: Niklas Söderlund <[email protected]>
Reviewed-by: Kieran Bingham <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>

 drivers/media/platform/rcar-vin/rcar-dma.c | 7 +++++++
 1 file changed, 7 insertions(+)

---

diff --git a/drivers/media/platform/rcar-vin/rcar-dma.c 
b/drivers/media/platform/rcar-vin/rcar-dma.c
index 79bb9081853f..8136bc75e7c4 100644
--- a/drivers/media/platform/rcar-vin/rcar-dma.c
+++ b/drivers/media/platform/rcar-vin/rcar-dma.c
@@ -111,6 +111,9 @@
 #define VNIE_FIE               (1 << 4)
 #define VNIE_EFE               (1 << 1)
 
+/* Video n Interrupt Status Register bits */
+#define VNINTS_FIS             (1 << 4)
+
 /* Video n Data Mode Register bits */
 #define VNDMR_A8BIT(n)         (((n) & 0xff) << 24)
 #define VNDMR_A8BIT_MASK       (0xff << 24)
@@ -1005,6 +1008,10 @@ static irqreturn_t rvin_irq(int irq, void *data)
        rvin_ack_interrupt(vin);
        handled = 1;
 
+       /* Nothing to do if nothing was captured. */
+       if (!(int_status & VNINTS_FIS))
+               goto done;
+
        /* Nothing to do if capture status is 'STOPPED' */
        if (vin->state == STOPPED) {
                vin_dbg(vin, "IRQ while state stopped\n");

_______________________________________________
linuxtv-commits mailing list
[email protected]
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to