From: Peter Ujfalusi Date: Tue, 14 Nov 2017 14:32:06 +0000 (+0200) Subject: dmaengine: edma: Use vchan_terminate_vdesc() instead of desc_free X-Git-Tag: v4.16-rc1~138^2~1^2~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=174334bcd9f87286aead3b1a470a82348f9d43ec;p=thirdparty%2Flinux.git dmaengine: edma: Use vchan_terminate_vdesc() instead of desc_free To avoid race with vchan_complete, use the race free way to terminate running transfer. Signed-off-by: Peter Ujfalusi Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/edma.c b/drivers/dma/edma.c index 9364a3ed345a2..948df1ab5f1a2 100644 --- a/drivers/dma/edma.c +++ b/drivers/dma/edma.c @@ -860,11 +860,8 @@ static int edma_terminate_all(struct dma_chan *chan) /* Move the cyclic channel back to default queue */ if (!echan->tc && echan->edesc->cyclic) edma_assign_channel_eventq(echan, EVENTQ_DEFAULT); - /* - * free the running request descriptor - * since it is not in any of the vdesc lists - */ - edma_desc_free(&echan->edesc->vdesc); + + vchan_terminate_vdesc(&echan->edesc->vdesc); echan->edesc = NULL; }