media: stm32: dcmi: stop the dma transfer on overrun

Ensure to stop the dma transfer whenever receiving a overrun
to avoid having a buffer partially filled with a frame and
partially with the next frame.

Signed-off-by: Alain Volmat <alain.volmat@foss.st.com>
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
This commit is contained in:
Alain Volmat 2026-01-06 12:34:32 +01:00 committed by Mauro Carvalho Chehab
parent 9b6f6208f4
commit 4847286b87

View File

@ -402,9 +402,21 @@ static irqreturn_t dcmi_irq_thread(int irq, void *arg)
spin_lock_irq(&dcmi->irqlock);
if (dcmi->misr & IT_OVR) {
/* Disable capture */
reg_clear(dcmi->regs, DCMI_CR, CR_CAPTURE);
dcmi->overrun_count++;
if (dcmi->overrun_count > OVERRUN_ERROR_THRESHOLD)
dcmi->errors_count++;
spin_unlock_irq(&dcmi->irqlock);
dmaengine_terminate_sync(dcmi->dma_chan);
if (dcmi_restart_capture(dcmi))
dev_err(dcmi->dev, "%s: Cannot restart capture\n", __func__);
return IRQ_HANDLED;
}
if (dcmi->misr & IT_ERR)
dcmi->errors_count++;