Skip to content

Commit 8a21d9f

Browse files
committed
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS updates from Ralf Baechle: "A fair number of fixes all across arch/mips. Nothing really stands out though APRP, the FPU code and syscall tracing code received multiple patches those all were small" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: mark O32+FP64 experimental for now MIPS: ftrace: Fix icache flush range error MIPS: Fix syscall tracing interface MIPS: asm: syscall: Fix copying system call arguments MIPS: Octeon: Fix fall through on bar type OCTEON_DMA_BAR_TYPE_SMALL MIPS: FPU: Fix conflict of register usage MIPS: Replace CONFIG_MIPS64 and CONFIG_MIPS32_R2 MIPS: math-emu: Fix prefx detection and COP1X function field definition MIPS: APRP: Choose the correct VPE loader by fixing the linking MIPS: APRP: Unregister rtlx interrupt hook at module exit MIPS: APRP: Fix the linking of rtlx interrupt hook MIPS: bcm47xx: Include missing errno.h for ENXIO MIPS: Alchemy: Fix unchecked kstrtoul return value MIPS: Fix randconfig build error.
2 parents 9f8b483 + 06e2e88 commit 8a21d9f

File tree

16 files changed

+46
-35
lines changed

16 files changed

+46
-35
lines changed

arch/mips/Kconfig

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2353,9 +2353,8 @@ config SECCOMP
23532353
If unsure, say Y. Only embedded should say N here.
23542354

23552355
config MIPS_O32_FP64_SUPPORT
2356-
bool "Support for O32 binaries using 64-bit FP"
2356+
bool "Support for O32 binaries using 64-bit FP (EXPERIMENTAL)"
23572357
depends on 32BIT || MIPS32_O32
2358-
default y
23592358
help
23602359
When this is enabled, the kernel will support use of 64-bit floating
23612360
point registers with binaries using the O32 ABI along with the
@@ -2367,7 +2366,14 @@ config MIPS_O32_FP64_SUPPORT
23672366
of your kernel & potentially improve FP emulation performance by
23682367
saying N here.
23692368

2370-
If unsure, say Y.
2369+
Although binutils currently supports use of this flag the details
2370+
concerning its effect upon the O32 ABI in userland are still being
2371+
worked on. In order to avoid userland becoming dependant upon current
2372+
behaviour before the details have been finalised, this option should
2373+
be considered experimental and only enabled by those working upon
2374+
said details.
2375+
2376+
If unsure, say N.
23712377

23722378
config USE_OF
23732379
bool

arch/mips/alchemy/board-gpr.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,8 @@ void __init prom_init(void)
5353
prom_init_cmdline();
5454

5555
memsize_str = prom_getenv("memsize");
56-
if (!memsize_str)
56+
if (!memsize_str || kstrtoul(memsize_str, 0, &memsize))
5757
memsize = 0x04000000;
58-
else
59-
strict_strtoul(memsize_str, 0, &memsize);
6058
add_memory_region(0, memsize, BOOT_MEM_RAM);
6159
}
6260

arch/mips/alchemy/board-mtx1.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ void __init prom_init(void)
5252
prom_init_cmdline();
5353

5454
memsize_str = prom_getenv("memsize");
55-
if (!memsize_str)
55+
if (!memsize_str || kstrtoul(memsize_str, 0, &memsize))
5656
memsize = 0x04000000;
57-
else
58-
strict_strtoul(memsize_str, 0, &memsize);
5957
add_memory_region(0, memsize, BOOT_MEM_RAM);
6058
}
6159

arch/mips/bcm47xx/board.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#include <linux/errno.h>
12
#include <linux/export.h>
23
#include <linux/string.h>
34
#include <bcm47xx_board.h>

arch/mips/include/asm/asmmacro.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@
106106
.endm
107107

108108
.macro fpu_save_double thread status tmp
109-
#if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2)
109+
#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
110110
sll \tmp, \status, 5
111111
bgez \tmp, 10f
112112
fpu_save_16odd \thread
@@ -159,7 +159,7 @@
159159
.endm
160160

161161
.macro fpu_restore_double thread status tmp
162-
#if defined(CONFIG_MIPS64) || defined(CONFIG_CPU_MIPS32_R2)
162+
#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
163163
sll \tmp, \status, 5
164164
bgez \tmp, 10f # 16 register mode?
165165

arch/mips/include/asm/fpu.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ static inline int __enable_fpu(enum fpu_mode mode)
5757
return 0;
5858

5959
case FPU_64BIT:
60-
#if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_MIPS64))
60+
#if !(defined(CONFIG_CPU_MIPS32_R2) || defined(CONFIG_64BIT))
6161
/* we only have a 32-bit FPU */
6262
return SIGFPE;
6363
#endif

arch/mips/include/asm/syscall.h

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#ifndef __ASM_MIPS_SYSCALL_H
1414
#define __ASM_MIPS_SYSCALL_H
1515

16+
#include <linux/compiler.h>
1617
#include <linux/audit.h>
1718
#include <linux/elf-em.h>
1819
#include <linux/kernel.h>
@@ -39,14 +40,14 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
3940

4041
#ifdef CONFIG_32BIT
4142
case 4: case 5: case 6: case 7:
42-
return get_user(*arg, (int *)usp + 4 * n);
43+
return get_user(*arg, (int *)usp + n);
4344
#endif
4445

4546
#ifdef CONFIG_64BIT
4647
case 4: case 5: case 6: case 7:
4748
#ifdef CONFIG_MIPS32_O32
4849
if (test_thread_flag(TIF_32BIT_REGS))
49-
return get_user(*arg, (int *)usp + 4 * n);
50+
return get_user(*arg, (int *)usp + n);
5051
else
5152
#endif
5253
*arg = regs->regs[4 + n];
@@ -57,6 +58,8 @@ static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
5758
default:
5859
BUG();
5960
}
61+
62+
unreachable();
6063
}
6164

6265
static inline long syscall_get_return_value(struct task_struct *task,
@@ -83,11 +86,10 @@ static inline void syscall_get_arguments(struct task_struct *task,
8386
unsigned int i, unsigned int n,
8487
unsigned long *args)
8588
{
86-
unsigned long arg;
8789
int ret;
8890

8991
while (n--)
90-
ret |= mips_get_syscall_arg(&arg, task, regs, i++);
92+
ret |= mips_get_syscall_arg(args++, task, regs, i++);
9193

9294
/*
9395
* No way to communicate an error because this is a void function.

arch/mips/include/uapi/asm/inst.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,8 @@ enum cop1_sdw_func {
163163
*/
164164
enum cop1x_func {
165165
lwxc1_op = 0x00, ldxc1_op = 0x01,
166-
pfetch_op = 0x07, swxc1_op = 0x08,
167-
sdxc1_op = 0x09, madd_s_op = 0x20,
166+
swxc1_op = 0x08, sdxc1_op = 0x09,
167+
pfetch_op = 0x0f, madd_s_op = 0x20,
168168
madd_d_op = 0x21, madd_e_op = 0x22,
169169
msub_s_op = 0x28, msub_d_op = 0x29,
170170
msub_e_op = 0x2a, nmadd_s_op = 0x30,

arch/mips/kernel/ftrace.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -111,11 +111,10 @@ static int ftrace_modify_code_2(unsigned long ip, unsigned int new_code1,
111111
safe_store_code(new_code1, ip, faulted);
112112
if (unlikely(faulted))
113113
return -EFAULT;
114-
ip += 4;
115-
safe_store_code(new_code2, ip, faulted);
114+
safe_store_code(new_code2, ip + 4, faulted);
116115
if (unlikely(faulted))
117116
return -EFAULT;
118-
flush_icache_range(ip, ip + 8); /* original ip + 12 */
117+
flush_icache_range(ip, ip + 8);
119118
return 0;
120119
}
121120
#endif

arch/mips/kernel/r4k_fpu.S

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@
3535
LEAF(_save_fp_context)
3636
cfc1 t1, fcr31
3737

38-
#if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2)
38+
#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
3939
.set push
40-
#ifdef CONFIG_MIPS32_R2
40+
#ifdef CONFIG_CPU_MIPS32_R2
4141
.set mips64r2
4242
mfc0 t0, CP0_STATUS
4343
sll t0, t0, 5
@@ -146,11 +146,11 @@ LEAF(_save_fp_context32)
146146
* - cp1 status/control register
147147
*/
148148
LEAF(_restore_fp_context)
149-
EX lw t0, SC_FPC_CSR(a0)
149+
EX lw t1, SC_FPC_CSR(a0)
150150

151-
#if defined(CONFIG_64BIT) || defined(CONFIG_MIPS32_R2)
151+
#if defined(CONFIG_64BIT) || defined(CONFIG_CPU_MIPS32_R2)
152152
.set push
153-
#ifdef CONFIG_MIPS32_R2
153+
#ifdef CONFIG_CPU_MIPS32_R2
154154
.set mips64r2
155155
mfc0 t0, CP0_STATUS
156156
sll t0, t0, 5
@@ -191,15 +191,15 @@ LEAF(_restore_fp_context)
191191
EX ldc1 $f26, SC_FPREGS+208(a0)
192192
EX ldc1 $f28, SC_FPREGS+224(a0)
193193
EX ldc1 $f30, SC_FPREGS+240(a0)
194-
ctc1 t0, fcr31
194+
ctc1 t1, fcr31
195195
jr ra
196196
li v0, 0 # success
197197
END(_restore_fp_context)
198198

199199
#ifdef CONFIG_MIPS32_COMPAT
200200
LEAF(_restore_fp_context32)
201201
/* Restore an o32 sigcontext. */
202-
EX lw t0, SC32_FPC_CSR(a0)
202+
EX lw t1, SC32_FPC_CSR(a0)
203203

204204
mfc0 t0, CP0_STATUS
205205
sll t0, t0, 5
@@ -239,7 +239,7 @@ LEAF(_restore_fp_context32)
239239
EX ldc1 $f26, SC32_FPREGS+208(a0)
240240
EX ldc1 $f28, SC32_FPREGS+224(a0)
241241
EX ldc1 $f30, SC32_FPREGS+240(a0)
242-
ctc1 t0, fcr31
242+
ctc1 t1, fcr31
243243
jr ra
244244
li v0, 0 # success
245245
END(_restore_fp_context32)

arch/mips/kernel/rtlx-cmp.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,8 @@ void __exit rtlx_module_exit(void)
112112

113113
for (i = 0; i < RTLX_CHANNELS; i++)
114114
device_destroy(mt_class, MKDEV(major, i));
115+
115116
unregister_chrdev(major, RTLX_MODULE_NAME);
117+
118+
aprp_hook = NULL;
116119
}

arch/mips/kernel/rtlx-mt.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,5 +144,8 @@ void __exit rtlx_module_exit(void)
144144

145145
for (i = 0; i < RTLX_CHANNELS; i++)
146146
device_destroy(mt_class, MKDEV(major, i));
147+
147148
unregister_chrdev(major, RTLX_MODULE_NAME);
149+
150+
aprp_hook = NULL;
148151
}

arch/mips/math-emu/cp1emu.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1538,10 +1538,10 @@ static int fpux_emu(struct pt_regs *xcp, struct mips_fpu_struct *ctx,
15381538
break;
15391539
}
15401540

1541-
case 0x7: /* 7 */
1542-
if (MIPSInst_FUNC(ir) != pfetch_op) {
1541+
case 0x3:
1542+
if (MIPSInst_FUNC(ir) != pfetch_op)
15431543
return SIGILL;
1544-
}
1544+
15451545
/* ignore prefx operation */
15461546
break;
15471547

arch/mips/mti-malta/malta-amon.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ int amon_cpu_start(int cpu,
7272
return 0;
7373
}
7474

75-
#ifdef CONFIG_MIPS_VPE_LOADER
75+
#ifdef CONFIG_MIPS_VPE_LOADER_CMP
7676
int vpe_run(struct vpe *v)
7777
{
7878
struct vpe_notifications *n;

arch/mips/mti-malta/malta-int.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ static void malta_hw0_irqdispatch(void)
119119

120120
do_IRQ(MALTA_INT_BASE + irq);
121121

122-
#ifdef MIPS_VPE_APSP_API
122+
#ifdef CONFIG_MIPS_VPE_APSP_API_MT
123123
if (aprp_hook)
124124
aprp_hook();
125125
#endif
@@ -310,7 +310,7 @@ static void ipi_call_dispatch(void)
310310

311311
static irqreturn_t ipi_resched_interrupt(int irq, void *dev_id)
312312
{
313-
#ifdef MIPS_VPE_APSP_API
313+
#ifdef CONFIG_MIPS_VPE_APSP_API_CMP
314314
if (aprp_hook)
315315
aprp_hook();
316316
#endif

arch/mips/pci/msi-octeon.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ int arch_setup_msi_irq(struct pci_dev *dev, struct msi_desc *desc)
150150
msg.address_lo =
151151
((128ul << 20) + CVMX_PCI_MSI_RCV) & 0xffffffff;
152152
msg.address_hi = ((128ul << 20) + CVMX_PCI_MSI_RCV) >> 32;
153+
break;
153154
case OCTEON_DMA_BAR_TYPE_BIG:
154155
/* When using big bar, Bar 0 is based at 0 */
155156
msg.address_lo = (0 + CVMX_PCI_MSI_RCV) & 0xffffffff;

0 commit comments

Comments
 (0)