On Mon Sep 28 09:47:44 2026 +0200, Ginger Li wrote:
> fimc_lite_subdev_s_stream(on = 0) sets ST_FLITE_OFF outside of the
> fimc->slock protected region, and only then stops the capture in the
> hardware.  flite_irq_handler() runs under fimc->slock and clears
> ST_FLITE_OFF, so an interrupt can be handled in between: the handler finds
> ST_FLITE_OFF already set, clears it and wakes up fimc->irq_queue before the
> capture has actually been stopped.  The wait_event_timeout() right after it
> then returns immediately and the driver continues as if the capture had
> stopped.
> 
> Set ST_FLITE_OFF in the same critical section that stops the capture, as
> fimc_lite_stop_capture() already does.
> 
> Fixes: 6319d6a002be ("[media] fimc-lite: Add ISP FIFO output support")
> Cc: [email protected]
> Signed-off-by: Ginger Li <[email protected]>
> Signed-off-by: Hans Verkuil <[email protected]>

Patch committed.

Thanks,
Hans Verkuil

 drivers/media/platform/samsung/exynos4-is/fimc-lite.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

---

diff --git a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c 
b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c
index 1b7bae15189b..90599c82fd35 100644
--- a/drivers/media/platform/samsung/exynos4-is/fimc-lite.c
+++ b/drivers/media/platform/samsung/exynos4-is/fimc-lite.c
@@ -1212,9 +1212,8 @@ static int fimc_lite_subdev_s_stream(struct v4l2_subdev 
*sd, int on)
                        spin_unlock_irqrestore(&fimc->slock, flags);
                }
        } else {
-               set_bit(ST_FLITE_OFF, &fimc->state);
-
                spin_lock_irqsave(&fimc->slock, flags);
+               set_bit(ST_FLITE_OFF, &fimc->state);
                flite_hw_capture_stop(fimc);
                spin_unlock_irqrestore(&fimc->slock, flags);
 
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to