[PATCH v2 2/3] arm64: mm: move dma_contiguous_reserve() to bootmem_init()

Chen Zhou chenzhou10 at huawei.com
Wed Dec 30 05:23:21 EST 2020


Like crashkernel, CMA might also reserve memory located in ZONE_DMA,
so move dma_contiguous_reserve() to bootmem_init() to make sure that
arm64_dma_phys_limit is populated.

Just place dma_contiguous_reserve() after reserve_crashkernel() as
before.

Signed-off-by: Chen Zhou <chenzhou10 at huawei.com>
Suggested-by: Nicolas Saenz Julienne <nsaenzjulienne at suse.de>
---
 arch/arm64/mm/init.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c
index 7b9809e39927..64a0e8f551d6 100644
--- a/arch/arm64/mm/init.c
+++ b/arch/arm64/mm/init.c
@@ -403,8 +403,6 @@ void __init arm64_memblock_init(void)
 	reserve_elfcorehdr();
 
 	high_memory = __va(memblock_end_of_DRAM() - 1) + 1;
-
-	dma_contiguous_reserve(arm64_dma32_phys_limit);
 }
 
 void __init bootmem_init(void)
@@ -445,6 +443,8 @@ void __init bootmem_init(void)
 	 */
 	reserve_crashkernel();
 
+	dma_contiguous_reserve(arm64_dma32_phys_limit);
+
 	memblock_dump_all();
 }
 
-- 
2.20.1




More information about the linux-arm-kernel mailing list