MIPS: Reserve nosave data for hibernation
authorHuacai Chen <[email protected]>
Thu, 17 Mar 2016 12:37:10 +0000 (20:37 +0800)
committerRalf Baechle <[email protected]>
Mon, 9 May 2016 10:00:03 +0000 (12:00 +0200)
After commit 92923ca3aacef63c92d ("mm: meminit: only set page reserved
in the memblock region"), the MIPS hibernation is broken. Because pages
in nosave data section should be "reserved", but currently they aren't
set to "reserved" at initialization. This patch makes hibernation work
again.

Signed-off-by: Huacai Chen <[email protected]>
Cc: Aurelien Jarno <[email protected]>
Cc: Steven J . Hill <[email protected]>
Cc: Fuxin Zhang <[email protected]>
Cc: Zhangjin Wu <[email protected]>
Cc: [email protected]
Cc: [email protected]
Patchwork: https://patchwork.linux-mips.org/patch/12888/
Signed-off-by: Ralf Baechle <[email protected]>
arch/mips/kernel/setup.c

index 4f607341a7938867efc6f0f0646c218bf168421b..d20caacfdbd3308d5771a20470c41b3b0563a20a 100644 (file)
@@ -706,6 +706,9 @@ static void __init arch_mem_init(char **cmdline_p)
        for_each_memblock(reserved, reg)
                if (reg->size != 0)
                        reserve_bootmem(reg->base, reg->size, BOOTMEM_DEFAULT);
+
+       reserve_bootmem_region(__pa_symbol(&__nosave_begin),
+                       __pa_symbol(&__nosave_end)); /* Reserve for hibernation */
 }
 
 static void __init resource_init(void)