diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-07-09 13:14:49 +0200 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2013-10-31 15:49:21 +0100 |
commit | 4dcfa60071b3d23f0181f27d8519f12e37cefbb9 (patch) | |
tree | a3c568b34226152a8f825c7ce1cff8a8bf1a20c2 /arch/arm/mm/mm.h | |
parent | ARM: 7857/1: dma: imx-sdma: setup dma mask (diff) | |
download | linux-4dcfa60071b3d23f0181f27d8519f12e37cefbb9.tar.xz linux-4dcfa60071b3d23f0181f27d8519f12e37cefbb9.zip |
ARM: DMA-API: better handing of DMA masks for coherent allocations
We need to start treating DMA masks as something which is specific to
the bus that the device resides on, otherwise we're going to hit all
sorts of nasty issues with LPAE and 32-bit DMA controllers in >32-bit
systems, where memory is offset from PFN 0.
In order to start doing this, we convert the DMA mask to a PFN using
the device specific dma_to_pfn() macro. This is the reverse of the
pfn_to_dma() macro which is used to get the DMA address for the device.
This gives us a PFN mask, which we can then check against the PFN
limit of the DMA zone.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/mm/mm.h')
-rw-r--r-- | arch/arm/mm/mm.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mm/mm.h b/arch/arm/mm/mm.h index d5a4e9ad8f0f..d5a982d15a88 100644 --- a/arch/arm/mm/mm.h +++ b/arch/arm/mm/mm.h @@ -81,8 +81,10 @@ extern __init void add_static_vm_early(struct static_vm *svm); #ifdef CONFIG_ZONE_DMA extern phys_addr_t arm_dma_limit; +extern unsigned long arm_dma_pfn_limit; #else #define arm_dma_limit ((phys_addr_t)~0) +#define arm_dma_pfn_limit (~0ul >> PAGE_SHIFT) #endif extern phys_addr_t arm_lowmem_limit; |