OSDN Git Service

dmaengine: edma: Use vchan_terminate_vdesc() instead of desc_free
authorPeter Ujfalusi <peter.ujfalusi@ti.com>
Tue, 14 Nov 2017 14:32:06 +0000 (16:32 +0200)
committerVinod Koul <vinod.koul@intel.com>
Mon, 4 Dec 2017 17:03:51 +0000 (22:33 +0530)
To avoid race with vchan_complete, use the race free way to terminate
running transfer.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
drivers/dma/edma.c

index 9364a3e..948df1a 100644 (file)
@@ -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;
        }