diff mbox series

[05/12] mips: Discard post-CMA-init foreach loop

Message ID 20190423224748.3765-6-fancer.lancer@gmail.com (mailing list archive)
State Superseded
Headers show
Series mips: Post-bootmem-memblock transition fixes | expand

Commit Message

Serge Semin April 23, 2019, 10:47 p.m. UTC
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>
---
 arch/mips/kernel/setup.c | 5 -----
 1 file changed, 5 deletions(-)

Comments

Paul Burton May 2, 2019, 6:35 p.m. UTC | #1
Hello,

Serge Semin wrote:
> 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>

Applied to mips-next.

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paul.burton@mips.com to report it. ]
diff mbox series

Patch

diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index f71a7d32a687..2ae6b02b948f 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -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 */