Skip to content

Commit c8ce94b

Browse files
committed
Merge tag 'mips_fixes_4.20_3' of git://git.kernel.org/pub/scm/linux/kernel/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
2 parents 06e68fe + 1229ace commit c8ce94b

File tree

5 files changed

+6
-22
lines changed

5 files changed

+6
-22
lines changed

arch/mips/configs/cavium_octeon_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,7 @@ CONFIG_RTC_CLASS=y
140140
CONFIG_RTC_DRV_DS1307=y
141141
CONFIG_STAGING=y
142142
CONFIG_OCTEON_ETHERNET=y
143+
CONFIG_OCTEON_USB=y
143144
# CONFIG_IOMMU_SUPPORT is not set
144145
CONFIG_RAS=y
145146
CONFIG_EXT4_FS=y

arch/mips/kernel/setup.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -794,6 +794,7 @@ static void __init arch_mem_init(char **cmdline_p)
794794

795795
/* call board setup routine */
796796
plat_mem_setup();
797+
memblock_set_bottom_up(true);
797798

798799
/*
799800
* Make sure all kernel memory is in the maps. The "UP" and

arch/mips/kernel/traps.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,10 +2260,8 @@ void __init trap_init(void)
22602260
unsigned long size = 0x200 + VECTORSPACING*64;
22612261
phys_addr_t ebase_pa;
22622262

2263-
memblock_set_bottom_up(true);
22642263
ebase = (unsigned long)
22652264
memblock_alloc_from(size, 1 << fls(size), 0);
2266-
memblock_set_bottom_up(false);
22672265

22682266
/*
22692267
* Try to ensure ebase resides in KSeg0 if possible.
@@ -2307,6 +2305,7 @@ void __init trap_init(void)
23072305
if (board_ebase_setup)
23082306
board_ebase_setup();
23092307
per_cpu_trap_init(true);
2308+
memblock_set_bottom_up(false);
23102309

23112310
/*
23122311
* Copy the generic exception handlers to their final destination.

arch/mips/loongson64/loongson-3/numa.c

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,8 @@ static __init void prom_meminit(void)
231231
cpumask_clear(&__node_data[(node)]->cpumask);
232232
}
233233
}
234+
max_low_pfn = PHYS_PFN(memblock_end_of_DRAM());
235+
234236
for (cpu = 0; cpu < loongson_sysconf.nr_cpus; cpu++) {
235237
node = cpu / loongson_sysconf.cores_per_node;
236238
if (node >= num_online_nodes())
@@ -248,19 +250,9 @@ static __init void prom_meminit(void)
248250

249251
void __init paging_init(void)
250252
{
251-
unsigned node;
252253
unsigned long zones_size[MAX_NR_ZONES] = {0, };
253254

254255
pagetable_init();
255-
256-
for_each_online_node(node) {
257-
unsigned long start_pfn, end_pfn;
258-
259-
get_pfn_range_for_nid(node, &start_pfn, &end_pfn);
260-
261-
if (end_pfn > max_low_pfn)
262-
max_low_pfn = end_pfn;
263-
}
264256
#ifdef CONFIG_ZONE_DMA32
265257
zones_size[ZONE_DMA32] = MAX_DMA32_PFN;
266258
#endif

arch/mips/sgi-ip27/ip27-memory.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -435,6 +435,7 @@ void __init prom_meminit(void)
435435

436436
mlreset();
437437
szmem();
438+
max_low_pfn = PHYS_PFN(memblock_end_of_DRAM());
438439

439440
for (node = 0; node < MAX_COMPACT_NODES; node++) {
440441
if (node_online(node)) {
@@ -455,18 +456,8 @@ extern void setup_zero_pages(void);
455456
void __init paging_init(void)
456457
{
457458
unsigned long zones_size[MAX_NR_ZONES] = {0, };
458-
unsigned node;
459459

460460
pagetable_init();
461-
462-
for_each_online_node(node) {
463-
unsigned long start_pfn, end_pfn;
464-
465-
get_pfn_range_for_nid(node, &start_pfn, &end_pfn);
466-
467-
if (end_pfn > max_low_pfn)
468-
max_low_pfn = end_pfn;
469-
}
470461
zones_size[ZONE_NORMAL] = max_low_pfn;
471462
free_area_init_nodes(zones_size);
472463
}

0 commit comments

Comments
 (0)