Skip to content

Commit

Permalink
dmaengine: edma: Use vchan_terminate_vdesc() instead of desc_free
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Peter Ujfalusi authored and Vinod Koul committed Dec 4, 2017
1 parent b1faf0f commit 174334b
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions drivers/dma/edma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 174334b

Please sign in to comment.