]> rtime.felk.cvut.cz Git - zynq/linux.git/commitdiff
dma: xilinx: xilinx_dma: Free BD consistent memory
authorRadhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Mon, 18 Dec 2017 07:47:02 +0000 (13:17 +0530)
committerMichal Simek <michal.simek@xilinx.com>
Thu, 1 Mar 2018 08:19:56 +0000 (09:19 +0100)
Free BD consistent memory in channel free_chan_resources.

Signed-off-by: Radhey Shyam Pandey <radheys@xilinx.com>
Reported-by: Bjorn Gottschall <bgottsch@xilinx.com>
Acked-by: Kedareswara rao Appana <appanad@xilinx.com>
Signed-off-by: Michal Simek <michal.simek@xilinx.com>
drivers/dma/xilinx/xilinx_dma.c

index 202545368f123143b685c64b5fbfc93d47dfbe6d..b835ba9f20abdd8661c7ce746073954a98eb7865 100644 (file)
@@ -750,6 +750,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);