diff options
author | Lars-Peter Clausen <lars@metafoo.de> | 2012-04-25 14:50:51 -0400 |
---|---|---|
committer | Vinod Koul <vinod.koul@linux.intel.com> | 2012-05-11 02:34:38 -0400 |
commit | cbb796ccd8c33c50249b876d9773dfa8e67d39cb (patch) | |
tree | e1384d10cf0cf86328a69c4f9bf6931dbe9250fe /drivers/dma/pch_dma.c | |
parent | 12366ad91adb41a193f93b3b0f2829ea06df1773 (diff) |
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>
Diffstat (limited to 'drivers/dma/pch_dma.c')
-rw-r--r-- | drivers/dma/pch_dma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/pch_dma.c b/drivers/dma/pch_dma.c index 65c0495a6d40..987ab5cd2617 100644 --- a/drivers/dma/pch_dma.c +++ b/drivers/dma/pch_dma.c | |||
@@ -621,7 +621,7 @@ static struct dma_async_tx_descriptor *pd_prep_slave_sg(struct dma_chan *chan, | |||
621 | goto err_desc_get; | 621 | goto err_desc_get; |
622 | 622 | ||
623 | desc->regs.dev_addr = reg; | 623 | desc->regs.dev_addr = reg; |
624 | desc->regs.mem_addr = sg_phys(sg); | 624 | desc->regs.mem_addr = sg_dma_address(sg); |
625 | desc->regs.size = sg_dma_len(sg); | 625 | desc->regs.size = sg_dma_len(sg); |
626 | desc->regs.next = DMA_DESC_FOLLOW_WITHOUT_IRQ; | 626 | desc->regs.next = DMA_DESC_FOLLOW_WITHOUT_IRQ; |
627 | 627 | ||