Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: xilinx_dma: Fix SG capability check for MCDMA

The SG capability is inherently present with Multichannel DMA operation.
The register used to check for this capability with other DMA driver types
is not defined for MCDMA.

Fixes: 6ccd692bfb7f ("dmaengine: xilinx_dma: Add Xilinx AXI MCDMA Engine driver support")
Signed-off-by: Matthew Murrian <matthew.murrian@goctsi.com>
Signed-off-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Link: https://lore.kernel.org/r/1604473206-32573-4-git-send-email-radhey.shyam.pandey@xilinx.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Matthew Murrian and committed by
Vinod Koul
96d5d884 c8ae7932

+4 -3
+4 -3
drivers/dma/xilinx/xilinx_dma.c
··· 2855 2855 chan->stop_transfer = xilinx_dma_stop_transfer; 2856 2856 } 2857 2857 2858 - /* check if SG is enabled (only for AXIDMA and CDMA) */ 2858 + /* check if SG is enabled (only for AXIDMA, AXIMCDMA, and CDMA) */ 2859 2859 if (xdev->dma_config->dmatype != XDMA_TYPE_VDMA) { 2860 - if (dma_ctrl_read(chan, XILINX_DMA_REG_DMASR) & 2861 - XILINX_DMA_DMASR_SG_MASK) 2860 + if (xdev->dma_config->dmatype == XDMA_TYPE_AXIMCDMA || 2861 + dma_ctrl_read(chan, XILINX_DMA_REG_DMASR) & 2862 + XILINX_DMA_DMASR_SG_MASK) 2862 2863 chan->has_sg = true; 2863 2864 dev_dbg(chan->dev, "ch %d: SG %s\n", chan->id, 2864 2865 chan->has_sg ? "enabled" : "disabled");