arm64: Limit the CMA buffer to 32-bit if ZONE_DMA
authorCatalin Marinas <catalin.marinas@arm.com>
Fri, 13 Jun 2014 12:41:20 +0000 (13:41 +0100)
committerMark Brown <broonie@kernel.org>
Thu, 22 Jan 2015 21:27:23 +0000 (21:27 +0000)
When the CMA buffer is allocated, it is too early to know whether
devices will require ZONE_DMA memory. This patch limits the CMA buffer
to (DMA_BIT_MASK(32) + 1) if CONFIG_ZONE_DMA is enabled.

In addition, it computes the dma_to_phys(DMA_BIT_MASK(32)) before the
increment (no current functional change).

Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
(cherry picked from commit 2d5a5612bceda8edd25b29f363c4e2c6cda28bab)
Signed-off-by: Mark Brown <broonie@kernel.org>
Conflicts:
arch/arm64/mm/init.c

arch/arm64/mm/init.c

index 6757d02d697631ebc8c4a9d9aed9e800c2975b51..d0f86b74fce65fc8e7f2b4675fdc6aa3940a1972 100644 (file)
@@ -144,6 +144,7 @@ static void arm64_memory_present(void)
 void __init arm64_memblock_init(void)
 {
        u64 *reserve_map, base, size;
+       phys_addr_t dma_phys_limit = 0;
 
        /*
         * Register the kernel text, kernel data, initrd, and initial