dmaengine: sprd: Fix block length overflow
authorEric Long <eric.long@unisoc.com>
Mon, 6 May 2019 07:28:31 +0000 (15:28 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 25 Jun 2019 03:35:55 +0000 (11:35 +0800)
commit8f3793bfa3ea69af84d0a6a398ccc3d80e6860a8
tree16f2a1fb2947f8f371065fbbd886541032f2c92f
parente478abd4ebf720121cbc5ab4bf14bd4b1cbe2f3a
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>
drivers/dma/sprd-dma.c