Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dmaengine: axi-dmac: Don't check the number of frames for alignment

In 2D transfers (for the AXI DMAC), the number of frames (numf) represents
Y_LENGTH, and the length of a frame is X_LENGTH. 2D transfers are useful
for video transfers where screen resolutions ( X * Y ) are typically
aligned for X, but not for Y.

There is no requirement for Y_LENGTH to be aligned to the bus-width (or
anything), and this is also true for AXI DMAC.

Checking the Y_LENGTH for alignment causes false errors when initiating DMA
transfers. This change fixes this by checking only that the Y_LENGTH is
non-zero.

Fixes: 0e3b67b348b8 ("dmaengine: Add support for the Analog Devices AXI-DMAC DMA controller")
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Alexandru Ardelean and committed by
Vinod Koul
648865a7 56009f0d

+1 -1
+1 -1
drivers/dma/dma-axi-dmac.c
··· 526 526 527 527 if (chan->hw_2d) { 528 528 if (!axi_dmac_check_len(chan, xt->sgl[0].size) || 529 - !axi_dmac_check_len(chan, xt->numf)) 529 + xt->numf == 0) 530 530 return NULL; 531 531 if (xt->sgl[0].size + dst_icg > chan->max_length || 532 532 xt->sgl[0].size + src_icg > chan->max_length)