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

dmaengine: dw-edma: Revert fix scatter-gather address calculation

Reverting the applied patch because it caused a regression on
ARC700 platform (32 bits).

Fixes: 05655541c950 ("dmaengine: dw-edma: Fix scatter-gather address calculation")
Signed-off-by: Gustavo Pimentel <gustavo.pimentel@synopsys.com>
Link: https://lore.kernel.org/r/1778422e389fe40032e216b59b1b992c61ec9887.1613674948.git.gustavo.pimentel@synopsys.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>

authored by

Gustavo Pimentel and committed by
Vinod Koul
b671d098 cb498d7f

+4 -4
+4 -4
drivers/dma/dw-edma/dw-edma-core.c
··· 429 429 if (xfer->type == EDMA_XFER_CYCLIC) { 430 430 burst->dar = xfer->xfer.cyclic.paddr; 431 431 } else if (xfer->type == EDMA_XFER_SCATTER_GATHER) { 432 - burst->dar = dst_addr; 432 + src_addr += sg_dma_len(sg); 433 + burst->dar = sg_dma_address(sg); 433 434 /* Unlike the typical assumption by other 434 435 * drivers/IPs the peripheral memory isn't 435 436 * a FIFO memory, in this case, it's a ··· 444 443 if (xfer->type == EDMA_XFER_CYCLIC) { 445 444 burst->sar = xfer->xfer.cyclic.paddr; 446 445 } else if (xfer->type == EDMA_XFER_SCATTER_GATHER) { 447 - burst->sar = src_addr; 446 + dst_addr += sg_dma_len(sg); 447 + burst->sar = sg_dma_address(sg); 448 448 /* Unlike the typical assumption by other 449 449 * drivers/IPs the peripheral memory isn't 450 450 * a FIFO memory, in this case, it's a ··· 457 455 } 458 456 459 457 if (xfer->type == EDMA_XFER_SCATTER_GATHER) { 460 - src_addr += sg_dma_len(sg); 461 - dst_addr += sg_dma_len(sg); 462 458 sg = sg_next(sg); 463 459 } else if (xfer->type == EDMA_XFER_INTERLEAVED && 464 460 xfer->xfer.il->frame_size > 0) {