Skip to content

Commit 4ca5346

Browse files
pelwellpopcornmix
authored andcommitted
dma-mapping: Use any dma_range_map for phys to DMA
Device Tree properties ranges and dma-ranges describe address mappings required when moving between buses. Ensure this translation happens when mapping MMIO addresses for DMA accesses. This commit replaces another downstream commit that no longer applies as of 6.18: dma-direct: take dma-ranges/offsets into account in resource mapping Signed-off-by: Phil Elwell <phil@raspberrypi.com>
1 parent 155c9c1 commit 4ca5346

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

kernel/dma/direct.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ static inline dma_addr_t dma_direct_map_phys(struct device *dev,
9494
}
9595

9696
if (attrs & DMA_ATTR_MMIO) {
97-
dma_addr = phys;
97+
dma_addr = phys_to_dma(dev, phys);
9898
if (unlikely(!dma_capable(dev, dma_addr, size, false)))
9999
goto err_overflow;
100100
} else {

0 commit comments

Comments
 (0)