Skip to content

Commit

Permalink
Merge tag 'mips_fixes_5.4_1' of git:https://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/mips/linux

Pull MIPS fixes from Paul Burton:

 - Build fixes for Cavium Octeon & PMC-Sierra MSP systems, as well as
   all pre-MIPSr6 configurations built with binutils < 2.25.

 - Boot fixes for 64-bit Loongson systems & SGI IP28 systems.

 - Wire up the new clone3 syscall.

 - Clean ups for a few build-time warnings.

* tag 'mips_fixes_5.4_1' of git:https://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
  MIPS: fw/arc: Remove unused addr variable
  MIPS: pmcs-msp71xx: Remove unused addr variable
  MIPS: pmcs-msp71xx: Add missing MAX_PROM_MEM definition
  mips: Loongson: Fix the link time qualifier of 'serial_exit()'
  MIPS: init: Prevent adding memory before PHYS_OFFSET
  MIPS: init: Fix reservation of memory between PHYS_OFFSET and mem start
  MIPS: VDSO: Fix build for binutils < 2.25
  MIPS: VDSO: Remove unused gettimeofday.c
  MIPS: Wire up clone3 syscall
  MIPS: octeon: Include required header; fix octeon ethernet build
  MIPS: cpu-bugs64: Mark inline functions as __always_inline
  MIPS: dts: ar9331: fix interrupt-controller size
  MIPS: Loongson64: Fix boot failure after dropping boot_mem_map
  • Loading branch information
torvalds committed Oct 4, 2019
2 parents 812ad49 + 6822c29 commit 4ea6553
Show file tree
Hide file tree
Showing 16 changed files with 41 additions and 313 deletions.
2 changes: 1 addition & 1 deletion arch/mips/boot/dts/qca/ar9331.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@

miscintc: interrupt-controller@18060010 {
compatible = "qca,ar7240-misc-intc";
reg = <0x18060010 0x4>;
reg = <0x18060010 0x8>;

interrupt-parent = <&cpuintc>;
interrupts = <6>;
Expand Down
1 change: 0 additions & 1 deletion arch/mips/fw/arc/memory.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ void __init prom_meminit(void)

void __init prom_free_prom_memory(void)
{
unsigned long addr;
int i;

if (prom_flags & PROM_FLAG_DONT_FREE_TEMP)
Expand Down
1 change: 1 addition & 0 deletions arch/mips/include/asm/octeon/cvmx-ipd.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
#include <asm/octeon/octeon-feature.h>

#include <asm/octeon/cvmx-ipd-defs.h>
#include <asm/octeon/cvmx-pip-defs.h>

enum cvmx_ipd_mode {
CVMX_IPD_OPC_MODE_STT = 0LL, /* All blocks DRAM, not cached in L2 */
Expand Down
1 change: 1 addition & 0 deletions arch/mips/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@
# endif
#define __ARCH_WANT_SYS_FORK
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_CLONE3

/* whitelists for checksyscalls */
#define __IGNORE_fadvise64_64
Expand Down
14 changes: 8 additions & 6 deletions arch/mips/kernel/cpu-bugs64.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ static char r4kwar[] __initdata =
static char daddiwar[] __initdata =
"Enable CPU_DADDI_WORKAROUNDS to rectify.";

static inline void align_mod(const int align, const int mod)
static __always_inline __init
void align_mod(const int align, const int mod)
{
asm volatile(
".set push\n\t"
Expand All @@ -38,8 +39,9 @@ static inline void align_mod(const int align, const int mod)
: "n"(align), "n"(mod));
}

static __always_inline void mult_sh_align_mod(long *v1, long *v2, long *w,
const int align, const int mod)
static __always_inline __init
void mult_sh_align_mod(long *v1, long *v2, long *w,
const int align, const int mod)
{
unsigned long flags;
int m1, m2;
Expand Down Expand Up @@ -113,7 +115,7 @@ static __always_inline void mult_sh_align_mod(long *v1, long *v2, long *w,
*w = lw;
}

static inline void check_mult_sh(void)
static __always_inline __init void check_mult_sh(void)
{
long v1[8], v2[8], w[8];
int bug, fix, i;
Expand Down Expand Up @@ -176,7 +178,7 @@ asmlinkage void __init do_daddi_ov(struct pt_regs *regs)
exception_exit(prev_state);
}

static inline void check_daddi(void)
static __init void check_daddi(void)
{
extern asmlinkage void handle_daddi_ov(void);
unsigned long flags;
Expand Down Expand Up @@ -242,7 +244,7 @@ static inline void check_daddi(void)

int daddiu_bug = IS_ENABLED(CONFIG_CPU_MIPSR6) ? 0 : -1;

static inline void check_daddiu(void)
static __init void check_daddiu(void)
{
long v, w, tmp;

Expand Down
5 changes: 4 additions & 1 deletion arch/mips/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ void __init add_memory_region(phys_addr_t start, phys_addr_t size, long type)
return;
}

if (start < PHYS_OFFSET)
return;

memblock_add(start, size);
/* Reserve any memory except the ordinary RAM ranges. */
switch (type) {
Expand Down Expand Up @@ -321,7 +324,7 @@ static void __init bootmem_init(void)
* Reserve any memory between the start of RAM and PHYS_OFFSET
*/
if (ramstart > PHYS_OFFSET)
memblock_reserve(PHYS_OFFSET, PFN_UP(ramstart) - PHYS_OFFSET);
memblock_reserve(PHYS_OFFSET, ramstart - PHYS_OFFSET);

if (PFN_UP(ramstart) > ARCH_PFN_OFFSET) {
pr_info("Wasting %lu bytes for tracking %lu unused pages\n",
Expand Down
1 change: 1 addition & 0 deletions arch/mips/kernel/syscall.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ SYSCALL_DEFINE6(mips_mmap2, unsigned long, addr, unsigned long, len,

save_static_function(sys_fork);
save_static_function(sys_clone);
save_static_function(sys_clone3);

SYSCALL_DEFINE1(set_thread_area, unsigned long, addr)
{
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/syscalls/syscall_n32.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -373,4 +373,4 @@
432 n32 fsmount sys_fsmount
433 n32 fspick sys_fspick
434 n32 pidfd_open sys_pidfd_open
# 435 reserved for clone3
435 n32 clone3 __sys_clone3
2 changes: 1 addition & 1 deletion arch/mips/kernel/syscalls/syscall_n64.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -349,4 +349,4 @@
432 n64 fsmount sys_fsmount
433 n64 fspick sys_fspick
434 n64 pidfd_open sys_pidfd_open
# 435 reserved for clone3
435 n64 clone3 __sys_clone3
2 changes: 1 addition & 1 deletion arch/mips/kernel/syscalls/syscall_o32.tbl
Original file line number Diff line number Diff line change
Expand Up @@ -422,4 +422,4 @@
432 o32 fsmount sys_fsmount
433 o32 fspick sys_fspick
434 o32 pidfd_open sys_pidfd_open
# 435 reserved for clone3
435 o32 clone3 __sys_clone3
35 changes: 17 additions & 18 deletions arch/mips/loongson64/common/mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
*/
#include <linux/fs.h>
#include <linux/fcntl.h>
#include <linux/memblock.h>
#include <linux/mm.h>

#include <asm/bootinfo.h>
Expand Down Expand Up @@ -64,24 +65,22 @@ void __init prom_init_memory(void)
node_id = loongson_memmap->map[i].node_id;
mem_type = loongson_memmap->map[i].mem_type;

if (node_id == 0) {
switch (mem_type) {
case SYSTEM_RAM_LOW:
add_memory_region(loongson_memmap->map[i].mem_start,
(u64)loongson_memmap->map[i].mem_size << 20,
BOOT_MEM_RAM);
break;
case SYSTEM_RAM_HIGH:
add_memory_region(loongson_memmap->map[i].mem_start,
(u64)loongson_memmap->map[i].mem_size << 20,
BOOT_MEM_RAM);
break;
case SYSTEM_RAM_RESERVED:
add_memory_region(loongson_memmap->map[i].mem_start,
(u64)loongson_memmap->map[i].mem_size << 20,
BOOT_MEM_RESERVED);
break;
}
if (node_id != 0)
continue;

switch (mem_type) {
case SYSTEM_RAM_LOW:
memblock_add(loongson_memmap->map[i].mem_start,
(u64)loongson_memmap->map[i].mem_size << 20);
break;
case SYSTEM_RAM_HIGH:
memblock_add(loongson_memmap->map[i].mem_start,
(u64)loongson_memmap->map[i].mem_size << 20);
break;
case SYSTEM_RAM_RESERVED:
memblock_reserve(loongson_memmap->map[i].mem_start,
(u64)loongson_memmap->map[i].mem_size << 20);
break;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/loongson64/common/serial.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ static int __init serial_init(void)
}
module_init(serial_init);

static void __init serial_exit(void)
static void __exit serial_exit(void)
{
platform_device_unregister(&uart8250_device);
}
Expand Down
11 changes: 1 addition & 10 deletions arch/mips/loongson64/loongson-3/numa.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,6 @@ static void __init szmem(unsigned int node)
(u32)node_id, mem_type, mem_start, mem_size);
pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n",
start_pfn, end_pfn, num_physpages);
add_memory_region((node_id << 44) + mem_start,
(u64)mem_size << 20, BOOT_MEM_RAM);
memblock_add_node(PFN_PHYS(start_pfn),
PFN_PHYS(end_pfn - start_pfn), node);
break;
Expand All @@ -156,16 +154,12 @@ static void __init szmem(unsigned int node)
(u32)node_id, mem_type, mem_start, mem_size);
pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n",
start_pfn, end_pfn, num_physpages);
add_memory_region((node_id << 44) + mem_start,
(u64)mem_size << 20, BOOT_MEM_RAM);
memblock_add_node(PFN_PHYS(start_pfn),
PFN_PHYS(end_pfn - start_pfn), node);
break;
case SYSTEM_RAM_RESERVED:
pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx MB\n",
(u32)node_id, mem_type, mem_start, mem_size);
add_memory_region((node_id << 44) + mem_start,
(u64)mem_size << 20, BOOT_MEM_RESERVED);
memblock_reserve(((node_id << 44) + mem_start),
mem_size << 20);
break;
Expand All @@ -191,8 +185,6 @@ static void __init node_mem_init(unsigned int node)
NODE_DATA(node)->node_start_pfn = start_pfn;
NODE_DATA(node)->node_spanned_pages = end_pfn - start_pfn;

free_bootmem_with_active_regions(node, end_pfn);

if (node == 0) {
/* kernel end address */
unsigned long kernel_end_pfn = PFN_UP(__pa_symbol(&_end));
Expand All @@ -209,8 +201,6 @@ static void __init node_mem_init(unsigned int node)
memblock_reserve((node_addrspace_offset | 0xfe000000),
32 << 20);
}

sparse_memory_present_with_active_regions(node);
}

static __init void prom_meminit(void)
Expand All @@ -227,6 +217,7 @@ static __init void prom_meminit(void)
cpumask_clear(&__node_data[(node)]->cpumask);
}
}
memblocks_present();
max_low_pfn = PHYS_PFN(memblock_end_of_DRAM());

for (cpu = 0; cpu < loongson_sysconf.nr_cpus; cpu++) {
Expand Down
4 changes: 2 additions & 2 deletions arch/mips/pmcs-msp71xx/msp_prom.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ int init_debug = 1;
/* memory blocks */
struct prom_pmemblock mdesc[PROM_MAX_PMEMBLOCKS];

#define MAX_PROM_MEM 5
static phys_addr_t prom_mem_base[MAX_PROM_MEM] __initdata;
static phys_addr_t prom_mem_size[MAX_PROM_MEM] __initdata;
static unsigned int nr_prom_mem __initdata;
Expand Down Expand Up @@ -358,7 +359,7 @@ void __init prom_meminit(void)
p++;

if (type == BOOT_MEM_ROM_DATA) {
if (nr_prom_mem >= 5) {
if (nr_prom_mem >= MAX_PROM_MEM) {
pr_err("Too many ROM DATA regions");
continue;
}
Expand All @@ -377,7 +378,6 @@ void __init prom_free_prom_memory(void)
char *ptr;
int len = 0;
int i;
unsigned long addr;

/*
* preserve environment variables and command line from pmon/bbload
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/vdso/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ CFLAGS_REMOVE_vgettimeofday.o = -pg
ifndef CONFIG_CPU_MIPSR6
ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
$(warning MIPS VDSO requires binutils >= 2.25)
obj-vdso-y := $(filter-out gettimeofday.o, $(obj-vdso-y))
obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))
ccflags-vdso += -DDISABLE_MIPS_VDSO
endif
endif
Expand Down
Loading

0 comments on commit 4ea6553

Please sign in to comment.