Commit 13e89979 authored by Eric Long's avatar Eric Long Committed by Vinod Koul

dmaengine: sprd: Fix the last link-list configuration

We will pass sglen as 0 configure the last link-list configuration
when filling the descriptor, which will cause the incorrect link-list
configuration. Thus we should check if the sglen is 0 to configure
the correct link-list configuration.
Signed-off-by: default avatarEric Long <eric.long@spreadtrum.com>
Signed-off-by: default avatarBaolin Wang <baolin.wang@linaro.org>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent d762ab33
...@@ -697,7 +697,8 @@ static int sprd_dma_fill_desc(struct dma_chan *chan, ...@@ -697,7 +697,8 @@ static int sprd_dma_fill_desc(struct dma_chan *chan,
hw->cfg |= SPRD_DMA_LINKLIST_EN; hw->cfg |= SPRD_DMA_LINKLIST_EN;
/* link-list index */ /* link-list index */
temp = (sg_index + 1) % sglen; temp = sglen ? (sg_index + 1) % sglen : 0;
/* Next link-list configuration's physical address offset */ /* Next link-list configuration's physical address offset */
temp = temp * sizeof(*hw) + SPRD_DMA_CHN_SRC_ADDR; temp = temp * sizeof(*hw) + SPRD_DMA_CHN_SRC_ADDR;
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment