Skip to content

Commit

Permalink
dmaengine: stm32-dma: mark pending descriptor complete in terminate_all
Browse files Browse the repository at this point in the history
To prevent accidental repeated completion, mark pending descriptor
complete in terminate_all. It can be the case when terminate_all is called
while no end of transfer interrupt occurs.

Signed-off-by: Amelie Delaunay <amelie.delaunay@foss.st.com>
Link: https://lore.kernel.org/r/20211011094259.315023-2-amelie.delaunay@foss.st.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
  • Loading branch information
Amelie Delaunay authored and Vinod Koul committed Oct 18, 2021
1 parent 981703a commit 79e40b0
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/dma/stm32-dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,6 +497,7 @@ static int stm32_dma_terminate_all(struct dma_chan *c)
spin_lock_irqsave(&chan->vchan.lock, flags);

if (chan->desc) {
dma_cookie_complete(&chan->desc->vdesc.tx);
vchan_terminate_vdesc(&chan->desc->vdesc);
if (chan->busy)
stm32_dma_stop(chan);
Expand Down

0 comments on commit 79e40b0

Please sign in to comment.