aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKedareswara rao Appana <appana.durga.rao@xilinx.com>2016-07-09 04:39:48 -0400
committerVinod Koul <vinod.koul@intel.com>2016-07-12 00:31:36 -0400
commite598e6eb46dd448d9b77a564e4d9664da52e3e1f (patch)
tree18c321dfa37a0be4732ef555f554b802bf68c855
parentb0cc417c1637192be658e68a74c8d1568e3d35f6 (diff)
dmaengine: xilinx: Fix race condition in axi dma cyclic dma mode
In cyclic DMA mode need to link the tail bd segment with the head bd segment to process bd's in cyclic. Current driver is doing this only for tx channel needs to update the same for rx channel case also. This patch fixes the same. Signed-off-by: Kedareswara rao Appana <appanad@xilinx.com> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
-rw-r--r--drivers/dma/xilinx/xilinx_dma.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/dma/xilinx/xilinx_dma.c b/drivers/dma/xilinx/xilinx_dma.c
index cf47347a1bc6..4e223d094433 100644
--- a/drivers/dma/xilinx/xilinx_dma.c
+++ b/drivers/dma/xilinx/xilinx_dma.c
@@ -1895,14 +1895,15 @@ static struct dma_async_tx_descriptor *xilinx_dma_prep_dma_cyclic(
1895 reg |= XILINX_DMA_CR_CYCLIC_BD_EN_MASK; 1895 reg |= XILINX_DMA_CR_CYCLIC_BD_EN_MASK;
1896 dma_ctrl_write(chan, XILINX_DMA_REG_DMACR, reg); 1896 dma_ctrl_write(chan, XILINX_DMA_REG_DMACR, reg);
1897 1897
1898 segment = list_last_entry(&desc->segments,
1899 struct xilinx_axidma_tx_segment,
1900 node);
1901 segment->hw.next_desc = (u32) head_segment->phys;
1902
1898 /* For the last DMA_MEM_TO_DEV transfer, set EOP */ 1903 /* For the last DMA_MEM_TO_DEV transfer, set EOP */
1899 if (direction == DMA_MEM_TO_DEV) { 1904 if (direction == DMA_MEM_TO_DEV) {
1900 head_segment->hw.control |= XILINX_DMA_BD_SOP; 1905 head_segment->hw.control |= XILINX_DMA_BD_SOP;
1901 segment = list_last_entry(&desc->segments,
1902 struct xilinx_axidma_tx_segment,
1903 node);
1904 segment->hw.control |= XILINX_DMA_BD_EOP; 1906 segment->hw.control |= XILINX_DMA_BD_EOP;
1905 segment->hw.next_desc = (u32) head_segment->phys;
1906 } 1907 }
1907 1908
1908 return &desc->async_tx; 1909 return &desc->async_tx;