Skip to content

Commit 4e50a35

Browse files
fancerpaulburton
authored andcommitted
mips: Use memblock to reserve the __nosave memory range
Originally before legacy bootmem was removed, the memory for the range was correctly reserved by reserve_bootmem_region(). But since memblock has been selected for early memory allocation the function can be utilized only after paging is fully initialized (as it is done by memblock_free_all() function). So calling it from arch_mem_init() method is prone to errors, and at this stage we need to reserve the memory in the memblock allocator. Signed-off-by: Serge Semin <[email protected]> Signed-off-by: Paul Burton <[email protected]> Cc: Ralf Baechle <[email protected]> Cc: James Hogan <[email protected]> Cc: Matt Redfearn <[email protected]> Cc: Mike Rapoport <[email protected]> Cc: Andrew Morton <[email protected]> Cc: Michal Hocko <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Thomas Bogendoerfer <[email protected]> Cc: Huacai Chen <[email protected]> Cc: Stefan Agner <[email protected]> Cc: Stephen Rothwell <[email protected]> Cc: Alexandre Belloni <[email protected]> Cc: Juergen Gross <[email protected]> Cc: [email protected] Cc: [email protected]
1 parent eadb692 commit 4e50a35

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

arch/mips/kernel/setup.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -814,8 +814,9 @@ static void __init arch_mem_init(char **cmdline_p)
814814

815815
dma_contiguous_reserve(PFN_PHYS(max_low_pfn));
816816

817-
reserve_bootmem_region(__pa_symbol(&__nosave_begin),
818-
__pa_symbol(&__nosave_end)); /* Reserve for hibernation */
817+
/* Reserve for hibernation. */
818+
memblock_reserve(__pa_symbol(&__nosave_begin),
819+
__pa_symbol(&__nosave_end) - __pa_symbol(&__nosave_begin));
819820
}
820821

821822
static void __init resource_init(void)

0 commit comments

Comments
 (0)