[PATCH 6.19 614/844] media: stm32: dcmipp: bytecap: clear all interrupts upon stream stop
From: Sasha Levin
Date: Sat Feb 28 2026 - 15:43:04 EST
From: Alain Volmat <alain.volmat@xxxxxxxxxxx>
[ Upstream commit 222f1279edd9008ee35b62de156ddac84e31443c ]
Ensure that there are no pending interrupts after we have stopped the
pipeline. Indeed, it could happen that new interrupt has been generated
during the stop_streaming processing hence clear them in order to avoid
getting a new interrupt right from the start of a next start_streaming.
Fixes: 28e0f3772296 ("media: stm32-dcmipp: STM32 DCMIPP camera interface driver")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Alain Volmat <alain.volmat@xxxxxxxxxxx>
Signed-off-by: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
Signed-off-by: Hans Verkuil <hverkuil+cisco@xxxxxxxxxx>
Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>
---
drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c
index 1c1b6b48918ee..b18e273ef4a3e 100644
--- a/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c
+++ b/drivers/media/platform/st/stm32/stm32-dcmipp/dcmipp-bytecap.c
@@ -512,6 +512,9 @@ static void dcmipp_bytecap_stop_streaming(struct vb2_queue *vq)
/* Disable pipe */
reg_clear(vcap, DCMIPP_P0FSCR, DCMIPP_P0FSCR_PIPEN);
+ /* Clear any pending interrupts */
+ reg_write(vcap, DCMIPP_CMFCR, DCMIPP_CMIER_P0ALL);
+
spin_lock_irq(&vcap->irqlock);
/* Return all queued buffers to vb2 in ERROR state */
--
2.51.0