summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorAmelie Delaunay <amelie.delaunay@foss.st.com>2021-10-11 12:42:57 +0300
committerVinod Koul <vkoul@kernel.org>2021-10-18 09:42:50 +0300
commit79e40b06a4ebfc8e0a48ed6164345f8e0a96b699 (patch)
tree0dd2d134ccd9a1902586ef0d2e0096e08a77a6f6 /drivers/dma
parent981703aae3b1965896caaef95f25886ec8007744 (diff)
downloadlinux-79e40b06a4ebfc8e0a48ed6164345f8e0a96b699.tar.xz
dmaengine: stm32-dma: mark pending descriptor complete in terminate_all
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>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/stm32-dma.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/dma/stm32-dma.c b/drivers/dma/stm32-dma.c
index 9063c727962e..a5ccf3fa95e0 100644
--- a/drivers/dma/stm32-dma.c
+++ b/drivers/dma/stm32-dma.c
@@ -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);