mirror of
https://github.com/torvalds/linux.git
synced 2026-05-30 01:53:29 +02:00
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:
parent
9b6f6208f4
commit
4847286b87
|
|
@ -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++;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user