[PATCH 2/5] ARM: make dma_addr_t 64-bit on LPAE

Russell King - ARM Linux linux at arm.linux.org.uk
Mon Aug 5 20:15:52 EDT 2013


On Mon, Aug 05, 2013 at 05:50:06PM -0500, Rob Herring wrote:
> From: Rob Herring <rob.herring at calxeda.com>
> 
> LPAE systems may have 64-bit capable DMA, so dma_addr_t needs to be
> 64-bit.

The question I put to you here is: any can your DMA controllers produce
more than 32-bits of address?

Yes, physical memory may be mapped at addresses greater than 4GB phys.
That doesn't mean that dma_addr_t also becomes 64-bit.

dma_addr_t is the bus address - the address you program into the DMA
controller.  If you're only ever writing it into a 32-bit address
register then you can only address 32-bits of memory, even though that
may be in the physical address range of 4GB-8GB.  In such cases where
that applies to all DMA controllers in the system, dma_addr_t should
still be 32-bit.

This is where it's broken to think that DMA addresses are the same as
physical addresses.  They aren't.



More information about the linux-arm-kernel mailing list