dmaengine: dw-axi-dmac: Fix alignment checks

Remove a bogus memory alignment check - transfers will be run bytewise
if needed - and add a check that the overall length is multiple of the
register size, otherwise there is residue.

See: https://github.com/raspberrypi/linux/issues/6733

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
This commit is contained in:
Phil Elwell
2025-03-20 16:41:14 +00:00
committed by Dom Cobley
parent 796800fe4f
commit 47010c6324

View File

@@ -750,11 +750,6 @@ static int dw_axi_dma_set_hw_desc(struct axi_dma_chan *chan,
mem_width = __ffs(data_width | mem_addr | len);
if (!IS_ALIGNED(mem_addr, 4)) {
dev_err(chan->chip->dev, "invalid buffer alignment\n");
return -EINVAL;
}
/* Use a reasonable upper limit otherwise residue reporting granularity grows large */
mem_burst_msize = axi_dma_encode_msize(16);
@@ -799,6 +794,11 @@ static int dw_axi_dma_set_hw_desc(struct axi_dma_chan *chan,
return -EINVAL;
}
if (len % (1 << reg_width)) {
dev_err_ratelimited(chan->chip->dev, "length %ld not aligned to device width %d\n", len, 1 << reg_width);
return -EINVAL;
}
if (block_ts > axi_block_ts)
return -EINVAL;