]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
ARM: 9175/1: Convert to reserve_initrd_mem()
authorWang Kefeng <wangkefeng.wang@huawei.com>
Wed, 22 Dec 2021 13:18:17 +0000 (14:18 +0100)
committerRussell King (Oracle) <rmk+kernel@armlinux.org.uk>
Mon, 28 Feb 2022 13:59:25 +0000 (13:59 +0000)
Covert to the generic reserve_initrd_mem() function.

Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
Signed-off-by: Russell King (Oracle) <rmk+kernel@armlinux.org.uk>
arch/arm/mm/init.c

index 6d0cb0f7bc54bd1c66b7215ae8e2711de3105efb..fe249ea919083f5a918e799fd2006f407674262e 100644 (file)
@@ -164,47 +164,6 @@ phys_addr_t __init arm_memblock_steal(phys_addr_t size, phys_addr_t align)
        return phys;
 }
 
-static void __init arm_initrd_init(void)
-{
-#ifdef CONFIG_BLK_DEV_INITRD
-       phys_addr_t start;
-       unsigned long size;
-
-       initrd_start = initrd_end = 0;
-
-       if (!phys_initrd_size)
-               return;
-
-       /*
-        * Round the memory region to page boundaries as per free_initrd_mem()
-        * This allows us to detect whether the pages overlapping the initrd
-        * are in use, but more importantly, reserves the entire set of pages
-        * as we don't want these pages allocated for other purposes.
-        */
-       start = round_down(phys_initrd_start, PAGE_SIZE);
-       size = phys_initrd_size + (phys_initrd_start - start);
-       size = round_up(size, PAGE_SIZE);
-
-       if (!memblock_is_region_memory(start, size)) {
-               pr_err("INITRD: 0x%08llx+0x%08lx is not a memory region - disabling initrd\n",
-                      (u64)start, size);
-               return;
-       }
-
-       if (memblock_is_region_reserved(start, size)) {
-               pr_err("INITRD: 0x%08llx+0x%08lx overlaps in-use memory region - disabling initrd\n",
-                      (u64)start, size);
-               return;
-       }
-
-       memblock_reserve(start, size);
-
-       /* Now convert initrd to virtual addresses */
-       initrd_start = __phys_to_virt(phys_initrd_start);
-       initrd_end = initrd_start + phys_initrd_size;
-#endif
-}
-
 #ifdef CONFIG_CPU_ICACHE_MISMATCH_WORKAROUND
 void check_cpu_icache_size(int cpuid)
 {
@@ -226,7 +185,7 @@ void __init arm_memblock_init(const struct machine_desc *mdesc)
        /* Register the kernel text, kernel data and initrd with memblock. */
        memblock_reserve(__pa(KERNEL_START), KERNEL_END - KERNEL_START);
 
-       arm_initrd_init();
+       reserve_initrd_mem();
 
        arm_mm_memblock_reserve();