Merge tag 'arc-5.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
[linux-2.6-microblaze.git] / arch / microblaze / mm / pgtable.c
index 38ccb90..c1833b1 100644 (file)
@@ -33,6 +33,7 @@
 #include <linux/init.h>
 #include <linux/mm_types.h>
 #include <linux/pgtable.h>
+#include <linux/memblock.h>
 
 #include <asm/pgalloc.h>
 #include <linux/io.h>
@@ -242,15 +243,13 @@ unsigned long iopa(unsigned long addr)
 
 __ref pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
 {
-       pte_t *pte;
-       if (mem_init_done) {
-               pte = (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
-       } else {
-               pte = (pte_t *)early_get_page();
-               if (pte)
-                       clear_page(pte);
-       }
-       return pte;
+       if (mem_init_done)
+               return (pte_t *)__get_free_page(GFP_KERNEL | __GFP_ZERO);
+       else
+               return memblock_alloc_try_nid(PAGE_SIZE, PAGE_SIZE,
+                                             MEMBLOCK_LOW_LIMIT,
+                                             memory_start + kernel_tlb,
+                                             NUMA_NO_NODE);
 }
 
 void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t flags)