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

From: Chen Zhou
Date: Wed Dec 30 2020 - 05:18:29 EST


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@xxxxxxxxxx>
Suggested-by: Nicolas Saenz Julienne <nsaenzjulienne@xxxxxxx>
---
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