]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
mips: Discard post-CMA-init foreach loop
authorSerge Semin <fancer.lancer@gmail.com>
Tue, 23 Apr 2019 22:47:41 +0000 (01:47 +0300)
committerPaul Burton <paul.burton@mips.com>
Thu, 2 May 2019 18:22:37 +0000 (11:22 -0700)
Really the loop is pointless, since it walks over memblock-reserved
memory regions and mark them as reserved in memblock. Before
bootmem was removed from the kernel, this loop had been
used to map the memory reserved by CMA into the legacy bootmem
allocator. But now the early memory allocator is memblock,
which is used by CMA for reservation, so we don't need any mapping
anymore.

Reviewed-by: Matt Redfearn <matt.redfearn@mips.com>
Signed-off-by: Serge Semin <fancer.lancer@gmail.com>
Signed-off-by: Paul Burton <paul.burton@mips.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: James Hogan <jhogan@kernel.org>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@suse.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Thomas Bogendoerfer <tbogendoerfer@suse.de>
Cc: Huacai Chen <chenhc@lemote.com>
Cc: Stefan Agner <stefan@agner.ch>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Juergen Gross <jgross@suse.com>
Cc: linux-mips@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
arch/mips/kernel/setup.c

index f71a7d32a687169ebd63efd421f45204bf694727..2ae6b02b948fdc2958a06bb7f69a34cdc16ec680 100644 (file)
@@ -708,7 +708,6 @@ static void __init request_crashkernel(struct resource *res)
  */
 static void __init arch_mem_init(char **cmdline_p)
 {
-       struct memblock_region *reg;
        extern void plat_mem_setup(void);
 
        /*
@@ -814,10 +813,6 @@ static void __init arch_mem_init(char **cmdline_p)
        plat_swiotlb_setup();
 
        dma_contiguous_reserve(PFN_PHYS(max_low_pfn));
-       /* Tell bootmem about cma reserved memblock section */
-       for_each_memblock(reserved, reg)
-               if (reg->size != 0)
-                       memblock_reserve(reg->base, reg->size);
 
        reserve_bootmem_region(__pa_symbol(&__nosave_begin),
                        __pa_symbol(&__nosave_end)); /* Reserve for hibernation */