Skip to content

Commit

Permalink
Merge tag 'mips_fixes_4.20_3' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/git/mips/linux

Pull MIPS fixes from Paul Burton:
 "A few MIPS fixes for 4.20:

   - Re-enable the Cavium Octeon USB driver in its defconfig after it
     was accidentally removed back in 4.14.

   - Have early memblock allocations be performed bottom-up to more
     closely match the behaviour we used to have with bootmem, which
     seems a safer choice since we've seen fallout from the change made
     in the 4.20 merge window.

   - Simplify max_low_pfn calculation in the NUMA code for the Loongson3
     and SGI IP27 platforms to both clean up the code & ensure
     max_low_pfn has been set appropriately before it is used"

* tag 'mips_fixes_4.20_3' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
  MIPS: Loongson3,SGI-IP27: Simplify max_low_pfn calculation
  MIPS: Let early memblock_alloc*() allocate memories bottom-up
  MIPS: OCTEON: cavium_octeon_defconfig: re-enable OCTEON USB driver
  • Loading branch information
Linus Torvalds committed Nov 20, 2018
2 parents 06e68fe + 1229ace commit c8ce94b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 22 deletions.
1 change: 1 addition & 0 deletions arch/mips/configs/cavium_octeon_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ CONFIG_RTC_CLASS=y
CONFIG_RTC_DRV_DS1307=y
CONFIG_STAGING=y
CONFIG_OCTEON_ETHERNET=y
CONFIG_OCTEON_USB=y
# CONFIG_IOMMU_SUPPORT is not set
CONFIG_RAS=y
CONFIG_EXT4_FS=y
Expand Down
1 change: 1 addition & 0 deletions arch/mips/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -794,6 +794,7 @@ static void __init arch_mem_init(char **cmdline_p)

/* call board setup routine */
plat_mem_setup();
memblock_set_bottom_up(true);

/*
* Make sure all kernel memory is in the maps. The "UP" and
Expand Down
3 changes: 1 addition & 2 deletions arch/mips/kernel/traps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2260,10 +2260,8 @@ void __init trap_init(void)
unsigned long size = 0x200 + VECTORSPACING*64;
phys_addr_t ebase_pa;

memblock_set_bottom_up(true);
ebase = (unsigned long)
memblock_alloc_from(size, 1 << fls(size), 0);
memblock_set_bottom_up(false);

/*
* Try to ensure ebase resides in KSeg0 if possible.
Expand Down Expand Up @@ -2307,6 +2305,7 @@ void __init trap_init(void)
if (board_ebase_setup)
board_ebase_setup();
per_cpu_trap_init(true);
memblock_set_bottom_up(false);

/*
* Copy the generic exception handlers to their final destination.
Expand Down
12 changes: 2 additions & 10 deletions arch/mips/loongson64/loongson-3/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,8 @@ static __init void prom_meminit(void)
cpumask_clear(&__node_data[(node)]->cpumask);
}
}
max_low_pfn = PHYS_PFN(memblock_end_of_DRAM());

for (cpu = 0; cpu < loongson_sysconf.nr_cpus; cpu++) {
node = cpu / loongson_sysconf.cores_per_node;
if (node >= num_online_nodes())
Expand All @@ -248,19 +250,9 @@ static __init void prom_meminit(void)

void __init paging_init(void)
{
unsigned node;
unsigned long zones_size[MAX_NR_ZONES] = {0, };

pagetable_init();

for_each_online_node(node) {
unsigned long start_pfn, end_pfn;

get_pfn_range_for_nid(node, &start_pfn, &end_pfn);

if (end_pfn > max_low_pfn)
max_low_pfn = end_pfn;
}
#ifdef CONFIG_ZONE_DMA32
zones_size[ZONE_DMA32] = MAX_DMA32_PFN;
#endif
Expand Down
11 changes: 1 addition & 10 deletions arch/mips/sgi-ip27/ip27-memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ void __init prom_meminit(void)

mlreset();
szmem();
max_low_pfn = PHYS_PFN(memblock_end_of_DRAM());

for (node = 0; node < MAX_COMPACT_NODES; node++) {
if (node_online(node)) {
Expand All @@ -455,18 +456,8 @@ extern void setup_zero_pages(void);
void __init paging_init(void)
{
unsigned long zones_size[MAX_NR_ZONES] = {0, };
unsigned node;

pagetable_init();

for_each_online_node(node) {
unsigned long start_pfn, end_pfn;

get_pfn_range_for_nid(node, &start_pfn, &end_pfn);

if (end_pfn > max_low_pfn)
max_low_pfn = end_pfn;
}
zones_size[ZONE_NORMAL] = max_low_pfn;
free_area_init_nodes(zones_size);
}
Expand Down

0 comments on commit c8ce94b

Please sign in to comment.