aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mm/init.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2013-07-09 07:14:49 -0400
committerRussell King <rmk+kernel@arm.linux.org.uk>2013-10-31 10:49:21 -0400
commit4dcfa60071b3d23f0181f27d8519f12e37cefbb9 (patch)
treea3c568b34226152a8f825c7ce1cff8a8bf1a20c2 /arch/arm/mm/init.c
parent42536b9f9ce38b07ac213c5f4550301f9a0d251d (diff)
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/init.c')
-rw-r--r--arch/arm/mm/init.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mm/init.c b/arch/arm/mm/init.c
index febaee7ca57b..8aab24f35a5e 100644
--- a/arch/arm/mm/init.c
+++ b/arch/arm/mm/init.c
@@ -218,6 +218,7 @@ EXPORT_SYMBOL(arm_dma_zone_size);
218 * so a successful GFP_DMA allocation will always satisfy this. 218 * so a successful GFP_DMA allocation will always satisfy this.
219 */ 219 */
220phys_addr_t arm_dma_limit; 220phys_addr_t arm_dma_limit;
221unsigned long arm_dma_pfn_limit;
221 222
222static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole, 223static void __init arm_adjust_dma_zone(unsigned long *size, unsigned long *hole,
223 unsigned long dma_size) 224 unsigned long dma_size)
@@ -240,6 +241,7 @@ void __init setup_dma_zone(const struct machine_desc *mdesc)
240 arm_dma_limit = PHYS_OFFSET + arm_dma_zone_size - 1; 241 arm_dma_limit = PHYS_OFFSET + arm_dma_zone_size - 1;
241 } else 242 } else
242 arm_dma_limit = 0xffffffff; 243 arm_dma_limit = 0xffffffff;
244 arm_dma_pfn_limit = arm_dma_limit >> PAGE_SHIFT;
243#endif 245#endif
244} 246}
245 247