Skip to content

Commit 8a20040

Browse files
Marek Vasutvinodkoul
authored andcommitted
dmaengine: xilinx_dma: Configure parking registers only if parking enabled
The VDMA can work in two modes, parking or circular. Do not program the parking mode registers in case circular mode is used, it is useless. Signed-off-by: Marek Vasut <[email protected]> Reviewed-by: Radhey Shyam Pandey <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Vinod Koul <[email protected]>
1 parent 0f31c09 commit 8a20040

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

drivers/dma/xilinx/xilinx_dma.c

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,16 +1404,18 @@ static void xilinx_vdma_start_transfer(struct xilinx_dma_chan *chan)
14041404

14051405
dma_ctrl_write(chan, XILINX_DMA_REG_DMACR, reg);
14061406

1407-
j = chan->desc_submitcount;
1408-
reg = dma_read(chan, XILINX_DMA_REG_PARK_PTR);
1409-
if (chan->direction == DMA_MEM_TO_DEV) {
1410-
reg &= ~XILINX_DMA_PARK_PTR_RD_REF_MASK;
1411-
reg |= j << XILINX_DMA_PARK_PTR_RD_REF_SHIFT;
1412-
} else {
1413-
reg &= ~XILINX_DMA_PARK_PTR_WR_REF_MASK;
1414-
reg |= j << XILINX_DMA_PARK_PTR_WR_REF_SHIFT;
1407+
if (config->park) {
1408+
j = chan->desc_submitcount;
1409+
reg = dma_read(chan, XILINX_DMA_REG_PARK_PTR);
1410+
if (chan->direction == DMA_MEM_TO_DEV) {
1411+
reg &= ~XILINX_DMA_PARK_PTR_RD_REF_MASK;
1412+
reg |= j << XILINX_DMA_PARK_PTR_RD_REF_SHIFT;
1413+
} else {
1414+
reg &= ~XILINX_DMA_PARK_PTR_WR_REF_MASK;
1415+
reg |= j << XILINX_DMA_PARK_PTR_WR_REF_SHIFT;
1416+
}
1417+
dma_write(chan, XILINX_DMA_REG_PARK_PTR, reg);
14151418
}
1416-
dma_write(chan, XILINX_DMA_REG_PARK_PTR, reg);
14171419

14181420
/* Start the hardware */
14191421
xilinx_dma_start(chan);

0 commit comments

Comments
 (0)