Commit 5a6187d7 authored by Daniel Silsby's avatar Daniel Silsby Committed by Vinod Koul

dmaengine: dma-jz4780: Add missing residue DTC mask

The 'dtc' word in jz DMA descriptors contains two fields: The
lowest 24 bits are the transfer count, and upper 8 bits are the DOA
offset to next descriptor. The upper 8 bits are now correctly masked
off when computing residue in jz4780_dma_desc_residue(). Note that
reads of the DTCn hardware reg are automatically masked this way.
Signed-off-by: default avatarDaniel Silsby <dansilsby@gmail.com>
Signed-off-by: default avatarPaul Cercueil <paul@crapouillou.net>
Tested-by: default avatarMathieu Malaterre <malat@debian.org>
Signed-off-by: default avatarVinod Koul <vkoul@kernel.org>
parent 17a8e30e
...@@ -616,7 +616,8 @@ static size_t jz4780_dma_desc_residue(struct jz4780_dma_chan *jzchan, ...@@ -616,7 +616,8 @@ static size_t jz4780_dma_desc_residue(struct jz4780_dma_chan *jzchan,
residue = 0; residue = 0;
for (i = next_sg; i < desc->count; i++) for (i = next_sg; i < desc->count; i++)
residue += desc->desc[i].dtc << jzchan->transfer_shift; residue += (desc->desc[i].dtc & GENMASK(23, 0)) <<
jzchan->transfer_shift;
if (next_sg != 0) { if (next_sg != 0) {
count = jz4780_dma_chn_readl(jzdma, jzchan->id, count = jz4780_dma_chn_readl(jzdma, jzchan->id,
......
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