diff mbox series

[3/4] arm64: mm: move memblock_clear_nomap after __add_pages

Message ID 20220711122459.13773-4-me@linux.beauty (mailing list archive)
State New, archived
Headers show
Series add struct page and Direct I/O support to reserved memory | expand

Commit Message

Li Chen July 11, 2022, 12:24 p.m. UTC
From: Li Chen <lchen@ambarella.com>

I'm trying to add struct page support to nomap reserved memory,
and have skipped nomap bitmap_intersects check in fill_subsection_map,
so just move memblock_clear_nomap after __add_pages.

Signed-off-by: Li Chen <lchen@ambarella.com>
Change-Id: I5e26fdc3f3e55b12f1acc1adb47fb262c4877ff3
---
 arch/arm64/mm/mmu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 6680689242df..2e7f503837e4 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -1537,10 +1537,10 @@  int arch_add_memory(int nid, u64 start, u64 size,
 			     size, params->pgprot, __pgd_pgtable_alloc,
 			     flags);
 
-	memblock_clear_nomap(start, size);
 
 	ret = __add_pages(nid, start >> PAGE_SHIFT, size >> PAGE_SHIFT,
 			   params);
+	memblock_clear_nomap(start, size);
 	if (ret)
 		__remove_pgd_mapping(swapper_pg_dir,
 				     __phys_to_virt(start), size);