RISC-V: Setup init_mm before parse_early_param()
authorAnup Patel <anup.patel@wdc.com>
Mon, 7 Jan 2019 13:49:14 +0000 (19:19 +0530)
committerAnup Patel <anup@brainfault.org>
Thu, 21 Feb 2019 05:01:48 +0000 (10:31 +0530)
We should setup init_mm before doing parse_early_param() in setup_arch()
to be consistent with setup_arch() of other architectures such as x86,
ARM, and ARM64.

Signed-off-by: Anup Patel <anup.patel@wdc.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Palmer Dabbelt <palmer@sifive.com>
arch/riscv/kernel/setup.c

index fb09e0136026b7106e4ed117a18691ddf0d57cbb..6a8a89740b7c840db8591d64fc84bded03c90b6a 100644 (file)
@@ -204,15 +204,15 @@ static void __init setup_bootmem(void)
 
 void __init setup_arch(char **cmdline_p)
 {
-       *cmdline_p = boot_command_line;
-
-       parse_early_param();
-
        init_mm.start_code = (unsigned long) _stext;
        init_mm.end_code   = (unsigned long) _etext;
        init_mm.end_data   = (unsigned long) _edata;
        init_mm.brk        = (unsigned long) _end;
 
+       *cmdline_p = boot_command_line;
+
+       parse_early_param();
+
        setup_bootmem();
        paging_init();
        unflatten_device_tree();
@@ -231,4 +231,3 @@ void __init setup_arch(char **cmdline_p)
 
        riscv_fill_hwcap();
 }
-