Commit 7ba3c21c authored by Sonic Zhang's avatar Sonic Zhang Committed by Mauro Carvalho Chehab

[media] v4l2: bfin: Ensure delete and reinit list entry on NOMMU architecture

On NOMMU architecture page fault is not triggered if a deleted list entry is
accessed without reinit.
Signed-off-by: default avatarSonic Zhang <sonic.zhang@analog.com>
Acked-by: default avatarScott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent f7d0e6d6
...@@ -446,7 +446,7 @@ static void bcap_stop_streaming(struct vb2_queue *vq) ...@@ -446,7 +446,7 @@ static void bcap_stop_streaming(struct vb2_queue *vq)
while (!list_empty(&bcap_dev->dma_queue)) { while (!list_empty(&bcap_dev->dma_queue)) {
bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next, bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next,
struct bcap_buffer, list); struct bcap_buffer, list);
list_del(&bcap_dev->cur_frm->list); list_del_init(&bcap_dev->cur_frm->list);
vb2_buffer_done(&bcap_dev->cur_frm->vb, VB2_BUF_STATE_ERROR); vb2_buffer_done(&bcap_dev->cur_frm->vb, VB2_BUF_STATE_ERROR);
} }
} }
...@@ -533,7 +533,7 @@ static irqreturn_t bcap_isr(int irq, void *dev_id) ...@@ -533,7 +533,7 @@ static irqreturn_t bcap_isr(int irq, void *dev_id)
} }
bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next, bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next,
struct bcap_buffer, list); struct bcap_buffer, list);
list_del(&bcap_dev->cur_frm->list); list_del_init(&bcap_dev->cur_frm->list);
} else { } else {
/* clear error flag, we will get a new frame */ /* clear error flag, we will get a new frame */
if (ppi->err) if (ppi->err)
...@@ -583,7 +583,7 @@ static int bcap_streamon(struct file *file, void *priv, ...@@ -583,7 +583,7 @@ static int bcap_streamon(struct file *file, void *priv,
bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next, bcap_dev->cur_frm = list_entry(bcap_dev->dma_queue.next,
struct bcap_buffer, list); struct bcap_buffer, list);
/* remove buffer from the dma queue */ /* remove buffer from the dma queue */
list_del(&bcap_dev->cur_frm->list); list_del_init(&bcap_dev->cur_frm->list);
addr = vb2_dma_contig_plane_dma_addr(&bcap_dev->cur_frm->vb, 0); addr = vb2_dma_contig_plane_dma_addr(&bcap_dev->cur_frm->vb, 0);
/* update DMA address */ /* update DMA address */
ppi->ops->update_addr(ppi, (unsigned long)addr); ppi->ops->update_addr(ppi, (unsigned long)addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment