Skip to content

Commit 820f5ce

Browse files
bjdooks-sifivevinodkoul
authored andcommitted
dmaengine: dw-axi-dmac: ignore interrupt if no descriptor
If the channel has no descriptor and the interrupt is raised then the kernel will OOPS. Check the result of vchan_next_desc() in the handler axi_chan_block_xfer_complete() to avoid the error happening. Signed-off-by: Ben Dooks <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 86cb0de commit 820f5ce

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1054,6 +1054,11 @@ static void axi_chan_block_xfer_complete(struct axi_dma_chan *chan)
10541054

10551055
/* The completed descriptor currently is in the head of vc list */
10561056
vd = vchan_next_desc(&chan->vc);
1057+
if (!vd) {
1058+
dev_err(chan2dev(chan), "BUG: %s, IRQ with no descriptors\n",
1059+
axi_chan_name(chan));
1060+
goto out;
1061+
}
10571062

10581063
if (chan->cyclic) {
10591064
desc = vd_to_axi_desc(vd);
@@ -1083,6 +1088,7 @@ static void axi_chan_block_xfer_complete(struct axi_dma_chan *chan)
10831088
axi_chan_start_first_queued(chan);
10841089
}
10851090

1091+
out:
10861092
spin_unlock_irqrestore(&chan->vc.lock, flags);
10871093
}
10881094

0 commit comments

Comments
 (0)