提交 5b617957 编写于 作者: N Nikhil Devshatwar 提交者: Mauro Carvalho Chehab

[media] media: ti-vpe: vpe: Post next descriptor only for list complete IRQ

vpe_irq checks for the possible interrupt sources and prints the
errors for the DEI_ERROR and DS_UV interrupts. But it also post the
next descriptor list irrespective of whichever interrupt has occurred.

Because of this, driver may release the buffers even before DMA is
complete and also schedule next descriptor list.

Fix this by _actually_ handling the IRQ only when ListComplete IRQ
occurs.
Signed-off-by: NNikhil Devshatwar <nikhil.nd@ti.com>
Signed-off-by: NBenoit Parrot <bparrot@ti.com>
Signed-off-by: NHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: NMauro Carvalho Chehab <mchehab@s-opensource.com>
上级 0f469c1a
...@@ -1304,6 +1304,7 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data) ...@@ -1304,6 +1304,7 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data)
struct vb2_v4l2_buffer *s_vb, *d_vb; struct vb2_v4l2_buffer *s_vb, *d_vb;
unsigned long flags; unsigned long flags;
u32 irqst0, irqst1; u32 irqst0, irqst1;
bool list_complete = false;
irqst0 = read_reg(dev, VPE_INT0_STATUS0); irqst0 = read_reg(dev, VPE_INT0_STATUS0);
if (irqst0) { if (irqst0) {
...@@ -1339,6 +1340,7 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data) ...@@ -1339,6 +1340,7 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data)
vpdma_clear_list_stat(ctx->dev->vpdma, 0, 0); vpdma_clear_list_stat(ctx->dev->vpdma, 0, 0);
irqst0 &= ~(VPE_INT0_LIST0_COMPLETE); irqst0 &= ~(VPE_INT0_LIST0_COMPLETE);
list_complete = true;
} }
if (irqst0 | irqst1) { if (irqst0 | irqst1) {
...@@ -1346,6 +1348,13 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data) ...@@ -1346,6 +1348,13 @@ static irqreturn_t vpe_irq(int irq_vpe, void *data)
irqst0, irqst1); irqst0, irqst1);
} }
/*
* Setup next operation only when list complete IRQ occurs
* otherwise, skip the following code
*/
if (!list_complete)
goto handled;
disable_irqs(ctx); disable_irqs(ctx);
vpdma_unmap_desc_buf(dev->vpdma, &ctx->desc_list.buf); vpdma_unmap_desc_buf(dev->vpdma, &ctx->desc_list.buf);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册