summaryrefslogtreecommitdiff
path: root/arch/mips/kernel/setup.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/mips/kernel/setup.c')
-rw-r--r--arch/mips/kernel/setup.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
index fbfe0771317e..1ae6d0c0e1d6 100644
--- a/arch/mips/kernel/setup.c
+++ b/arch/mips/kernel/setup.c
@@ -13,6 +13,7 @@
#include <linux/init.h>
#include <linux/cpu.h>
#include <linux/delay.h>
+#include <linux/hex.h>
#include <linux/ioport.h>
#include <linux/export.h>
#include <linux/memblock.h>
@@ -30,6 +31,7 @@
#include <linux/of_fdt.h>
#include <linux/dmi.h>
#include <linux/crash_dump.h>
+#include <linux/string.h>
#include <asm/addrspace.h>
#include <asm/bootinfo.h>
@@ -458,7 +460,7 @@ static void __init mips_parse_crashkernel(void)
total_mem = memblock_phys_mem_size();
ret = parse_crashkernel(boot_command_line, total_mem,
&crash_size, &crash_base,
- NULL, NULL);
+ NULL, NULL, NULL);
if (ret != 0 || crash_size <= 0)
return;
@@ -540,6 +542,9 @@ static int __init bootcmdline_scan_chosen(unsigned long node, const char *uname,
p = of_get_flat_dt_prop(node, "bootargs", &l);
if (p != NULL && l > 0) {
+ if (strnlen(p, l) >= l)
+ return 1;
+
bootcmdline_append(p, min(l, COMMAND_LINE_SIZE));
*dt_bootargs = true;
}
@@ -614,8 +619,7 @@ static void __init bootcmdline_init(void)
* kernel but generic memory management system is still entirely uninitialized.
*
* o bootmem_init()
- * o sparse_init()
- * o paging_init()
+ * o pagetable_init()
* o dma_contiguous_reserve()
*
* At this stage the bootmem allocator is ready to use.
@@ -665,16 +669,6 @@ static void __init arch_mem_init(char **cmdline_p)
mips_parse_crashkernel();
device_tree_init();
- /*
- * In order to reduce the possibility of kernel panic when failed to
- * get IO TLB memory under CONFIG_SWIOTLB, it is better to allocate
- * low memory as small as possible before plat_swiotlb_setup(), so
- * make sparse_init() using top-down allocation.
- */
- memblock_set_bottom_up(false);
- sparse_init();
- memblock_set_bottom_up(true);
-
plat_swiotlb_setup();
dma_contiguous_reserve(PFN_PHYS(max_low_pfn));
@@ -789,7 +783,7 @@ void __init setup_arch(char **cmdline_p)
prefill_possible_map();
cpu_cache_init();
- paging_init();
+ pagetable_init();
memblock_dump_all();