]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit - drivers/dma/pch_dma.c
dmaengine: Use sg_dma_address instead of sg_phys
authorLars-Peter Clausen <lars@metafoo.de>
Wed, 25 Apr 2012 18:50:51 +0000 (20:50 +0200)
committerVinod Koul <vinod.koul@linux.intel.com>
Fri, 11 May 2012 06:34:38 +0000 (12:04 +0530)
commitcbb796ccd8c33c50249b876d9773dfa8e67d39cb
treee1384d10cf0cf86328a69c4f9bf6931dbe9250fe
parent12366ad91adb41a193f93b3b0f2829ea06df1773
dmaengine: Use sg_dma_address instead of sg_phys

dmaengine drivers should always use sg_dma_address instead of sg_phys to get the
addresses for the transfer from a sg element.

To quote Russel King:
sg_phys(sg) of course has nothing to do with DMA addresses. It's the
physical address _to the CPU_ of the memory associated with the scatterlist
entry. That may, or may not have the same value for the DMA engine,
particularly if IOMMUs are involved.

And if these drivers are used on ARM, they must be fixed, sooner rather
than later.  There's patches in the works which will mean we will end up
with IOMMU support in the DMA mapping later, which means everything I've
said above will become reality.

The patch has been generated using the following coccinelle patch:
<smpl>
@@
struct scatterlist *sg;
@@
-sg_phys(sg)
+sg_dma_address(sg)
</smpl>

Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
drivers/dma/amba-pl08x.c
drivers/dma/coh901318_lli.c
drivers/dma/dw_dmac.c
drivers/dma/intel_mid_dma.c
drivers/dma/pch_dma.c