summaryrefslogtreecommitdiff
path: root/drivers/dma
diff options
context:
space:
mode:
authorEric Long <eric.long@unisoc.com>2019-05-06 10:28:31 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-25 06:34:48 +0300
commit544671fac56e69b646664311c9790b89dfb3d328 (patch)
tree03687ee8197b115642e42a7c143da9d82f048e39 /drivers/dma
parent3ef397924060d1431a1a2e4aa09964276da97d92 (diff)
downloadlinux-544671fac56e69b646664311c9790b89dfb3d328.tar.xz
dmaengine: sprd: Fix block length overflow
[ Upstream commit 89d03b3c126d683f7b2cd5b07178493993d12448 ] The maximum value of block length is 0xffff, so if the configured transfer length is more than 0xffff, that will cause block length overflow to lead a configuration error. Thus we can set block length as the maximum burst length to avoid this issue, since the maximum burst length will not be a big value which is more than 0xffff. Signed-off-by: Eric Long <eric.long@unisoc.com> Signed-off-by: Baolin Wang <baolin.wang@linaro.org> Signed-off-by: Vinod Koul <vkoul@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/dma')
-rw-r--r--drivers/dma/sprd-dma.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/sprd-dma.c b/drivers/dma/sprd-dma.c
index 0f92e60529d1..a01c23246632 100644
--- a/drivers/dma/sprd-dma.c
+++ b/drivers/dma/sprd-dma.c
@@ -778,7 +778,7 @@ static int sprd_dma_fill_desc(struct dma_chan *chan,
temp |= slave_cfg->src_maxburst & SPRD_DMA_FRG_LEN_MASK;
hw->frg_len = temp;
- hw->blk_len = len & SPRD_DMA_BLK_LEN_MASK;
+ hw->blk_len = slave_cfg->src_maxburst & SPRD_DMA_BLK_LEN_MASK;
hw->trsc_len = len & SPRD_DMA_TRSC_LEN_MASK;
temp = (dst_step & SPRD_DMA_TRSF_STEP_MASK) << SPRD_DMA_DEST_TRSF_STEP_OFFSET;