From: Kedareswara rao Appana Date: Wed, 3 Jan 2018 06:42:11 +0000 (+0530) Subject: dmaengine: xilinx_dma: Free BD consistent memory X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=0e847d44b3f2f7ab5d4a826f25be9b24a632ce9e;p=openwrt%2Fstaging%2Fblogic.git dmaengine: xilinx_dma: Free BD consistent memory Free BD consistent memory while freeing the channel i.e in free_chan_resources. Signed-off-by: Radhey Shyam Pandey Signed-off-by: Kedareswara rao Appana Signed-off-by: Vinod Koul --- diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c index 855ea14f6877..27b523530c4a 100644 --- a/drivers/dma/xilinx/xilinx_dma.c +++ b/drivers/dma/xilinx/xilinx_dma.c @@ -764,6 +764,11 @@ static void xilinx_dma_free_chan_resources(struct dma_chan *dchan) INIT_LIST_HEAD(&chan->free_seg_list); spin_unlock_irqrestore(&chan->lock, flags); + /* Free memory that is allocated for BD */ + dma_free_coherent(chan->dev, sizeof(*chan->seg_v) * + XILINX_DMA_NUM_DESCS, chan->seg_v, + chan->seg_p); + /* Free Memory that is allocated for cyclic DMA Mode */ dma_free_coherent(chan->dev, sizeof(*chan->cyclic_seg_v), chan->cyclic_seg_v, chan->cyclic_seg_p);