mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-21 10:01:00 +00:00
dmaengine: dw-axi-dmac: ignore interrupt if no descriptor
[ Upstream commit 820f5ce999
]
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 <ben.dooks@sifive.com>
Link: https://lore.kernel.org/r/20220708170153.269991-4-ben.dooks@sifive.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
af76e6fdcf
commit
54aa6c4936
1 changed files with 6 additions and 0 deletions
|
@ -1016,6 +1016,11 @@ static void axi_chan_block_xfer_complete(struct axi_dma_chan *chan)
|
||||||
|
|
||||||
/* The completed descriptor currently is in the head of vc list */
|
/* The completed descriptor currently is in the head of vc list */
|
||||||
vd = vchan_next_desc(&chan->vc);
|
vd = vchan_next_desc(&chan->vc);
|
||||||
|
if (!vd) {
|
||||||
|
dev_err(chan2dev(chan), "BUG: %s, IRQ with no descriptors\n",
|
||||||
|
axi_chan_name(chan));
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
if (chan->cyclic) {
|
if (chan->cyclic) {
|
||||||
desc = vd_to_axi_desc(vd);
|
desc = vd_to_axi_desc(vd);
|
||||||
|
@ -1045,6 +1050,7 @@ static void axi_chan_block_xfer_complete(struct axi_dma_chan *chan)
|
||||||
axi_chan_start_first_queued(chan);
|
axi_chan_start_first_queued(chan);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
out:
|
||||||
spin_unlock_irqrestore(&chan->vc.lock, flags);
|
spin_unlock_irqrestore(&chan->vc.lock, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue