Skip to content

Commit 831e45d

Browse files
committed
Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus
Pull MIPS fixes from Ralf Baechle: "A round of 4.8 fixes: MIPS generic code: - Add a missing ".set pop" in an early commit - Fix memory regions reaching top of physical - MAAR: Fix address alignment - vDSO: Fix Malta EVA mapping to vDSO page structs - uprobes: fix incorrect uprobe brk handling - uprobes: select HAVE_REGS_AND_STACK_ACCESS_API - Avoid a BUG warning during PR_SET_FP_MODE prctl - SMP: Fix possibility of deadlock when bringing CPUs online - R6: Remove compact branch policy Kconfig entries - Fix size calc when avoiding IPIs for small icache flushes - Fix pre-r6 emulation FPU initialisation - Fix delay slot emulation count in debugfs ATH79: - Fix test for error return of clk_register_fixed_factor. Octeon: - Fix kernel header to work for VDSO build. - Fix initialization of platform device probing. paravirt: - Fix undefined reference to smp_bootstrap" * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus: MIPS: Fix delay slot emulation count in debugfs MIPS: SMP: Fix possibility of deadlock when bringing CPUs online MIPS: Fix pre-r6 emulation FPU initialisation MIPS: vDSO: Fix Malta EVA mapping to vDSO page structs MIPS: Select HAVE_REGS_AND_STACK_ACCESS_API MIPS: Octeon: Fix platform bus probing MIPS: Octeon: mangle-port: fix build failure with VDSO code MIPS: Avoid a BUG warning during prctl(PR_SET_FP_MODE, ...) MIPS: c-r4k: Fix size calc when avoiding IPIs for small icache flushes MIPS: Add a missing ".set pop" in an early commit MIPS: paravirt: Fix undefined reference to smp_bootstrap MIPS: Remove compact branch policy Kconfig entries MIPS: MAAR: Fix address alignment MIPS: Fix memory regions reaching top of physical MIPS: uprobes: fix incorrect uprobe brk handling MIPS: ath79: Fix test for error return of clk_register_fixed_factor().
2 parents 751b9a5 + 116e711 commit 831e45d

File tree

17 files changed

+37
-65
lines changed

17 files changed

+37
-65
lines changed

arch/mips/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@ config MIPS
6565
select ARCH_CLOCKSOURCE_DATA
6666
select HANDLE_DOMAIN_IRQ
6767
select HAVE_EXIT_THREAD
68+
select HAVE_REGS_AND_STACK_ACCESS_API
6869

6970
menu "Machine selection"
7071

arch/mips/Kconfig.debug

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -113,42 +113,6 @@ config SPINLOCK_TEST
113113
help
114114
Add several files to the debugfs to test spinlock speed.
115115

116-
if CPU_MIPSR6
117-
118-
choice
119-
prompt "Compact branch policy"
120-
default MIPS_COMPACT_BRANCHES_OPTIMAL
121-
122-
config MIPS_COMPACT_BRANCHES_NEVER
123-
bool "Never (force delay slot branches)"
124-
help
125-
Pass the -mcompact-branches=never flag to the compiler in order to
126-
force it to always emit branches with delay slots, and make no use
127-
of the compact branch instructions introduced by MIPSr6. This is
128-
useful if you suspect there may be an issue with compact branches in
129-
either the compiler or the CPU.
130-
131-
config MIPS_COMPACT_BRANCHES_OPTIMAL
132-
bool "Optimal (use where beneficial)"
133-
help
134-
Pass the -mcompact-branches=optimal flag to the compiler in order for
135-
it to make use of compact branch instructions where it deems them
136-
beneficial, and use branches with delay slots elsewhere. This is the
137-
default compiler behaviour, and should be used unless you have a
138-
reason to choose otherwise.
139-
140-
config MIPS_COMPACT_BRANCHES_ALWAYS
141-
bool "Always (force compact branches)"
142-
help
143-
Pass the -mcompact-branches=always flag to the compiler in order to
144-
force it to always emit compact branches, making no use of branch
145-
instructions with delay slots. This can result in more compact code
146-
which may be beneficial in some scenarios.
147-
148-
endchoice
149-
150-
endif # CPU_MIPSR6
151-
152116
config SCACHE_DEBUGFS
153117
bool "L2 cache debugfs entries"
154118
depends on DEBUG_FS

arch/mips/Makefile

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,10 +203,6 @@ endif
203203
toolchain-virt := $(call cc-option-yn,$(mips-cflags) -mvirt)
204204
cflags-$(toolchain-virt) += -DTOOLCHAIN_SUPPORTS_VIRT
205205

206-
cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_NEVER) += -mcompact-branches=never
207-
cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_OPTIMAL) += -mcompact-branches=optimal
208-
cflags-$(CONFIG_MIPS_COMPACT_BRANCHES_ALWAYS) += -mcompact-branches=always
209-
210206
#
211207
# Firmware support
212208
#

arch/mips/ath79/clock.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ static struct clk * __init ath79_reg_ffclk(const char *name,
9696
struct clk *clk;
9797

9898
clk = clk_register_fixed_factor(NULL, name, parent_name, 0, mult, div);
99-
if (!clk)
99+
if (IS_ERR(clk))
100100
panic("failed to allocate %s clock structure", name);
101101

102102
return clk;

arch/mips/cavium-octeon/octeon-platform.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1059,7 +1059,7 @@ static int __init octeon_publish_devices(void)
10591059
{
10601060
return of_platform_bus_probe(NULL, octeon_ids, NULL);
10611061
}
1062-
device_initcall(octeon_publish_devices);
1062+
arch_initcall(octeon_publish_devices);
10631063

10641064
MODULE_AUTHOR("David Daney <[email protected]>");
10651065
MODULE_LICENSE("GPL");

arch/mips/include/asm/asmmacro.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@
157157
ldc1 $f28, THREAD_FPR28(\thread)
158158
ldc1 $f30, THREAD_FPR30(\thread)
159159
ctc1 \tmp, fcr31
160+
.set pop
160161
.endm
161162

162163
.macro fpu_restore_16odd thread

arch/mips/include/asm/mach-cavium-octeon/mangle-port.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
static inline bool __should_swizzle_bits(volatile void *a)
1616
{
1717
extern const bool octeon_should_swizzle_table[];
18+
u64 did = ((u64)(uintptr_t)a >> 40) & 0xff;
1819

19-
unsigned long did = ((unsigned long)a >> 40) & 0xff;
2020
return octeon_should_swizzle_table[did];
2121
}
2222

@@ -29,7 +29,7 @@ static inline bool __should_swizzle_bits(volatile void *a)
2929

3030
#define __should_swizzle_bits(a) false
3131

32-
static inline bool __should_swizzle_addr(unsigned long p)
32+
static inline bool __should_swizzle_addr(u64 p)
3333
{
3434
/* boot bus? */
3535
return ((p >> 40) & 0xff) == 0;

arch/mips/include/asm/mach-paravirt/kernel-entry-init.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
#define CP0_EBASE $15, 1
1212

1313
.macro kernel_entry_setup
14+
#ifdef CONFIG_SMP
1415
mfc0 t0, CP0_EBASE
1516
andi t0, t0, 0x3ff # CPUNum
1617
beqz t0, 1f
1718
# CPUs other than zero goto smp_bootstrap
1819
j smp_bootstrap
20+
#endif /* CONFIG_SMP */
1921

2022
1:
2123
.endm

arch/mips/kernel/mips-r2-to-r6-emul.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1164,7 +1164,9 @@ int mipsr2_decoder(struct pt_regs *regs, u32 inst, unsigned long *fcr31)
11641164
regs->regs[31] = r31;
11651165
regs->cp0_epc = epc;
11661166
if (!used_math()) { /* First time FPU user. */
1167+
preempt_disable();
11671168
err = init_fpu();
1169+
preempt_enable();
11681170
set_used_math();
11691171
}
11701172
lose_fpu(1); /* Save FPU state for the emulator. */

arch/mips/kernel/process.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -605,14 +605,14 @@ int mips_set_process_fp_mode(struct task_struct *task, unsigned int value)
605605
return -EOPNOTSUPP;
606606

607607
/* Avoid inadvertently triggering emulation */
608-
if ((value & PR_FP_MODE_FR) && cpu_has_fpu &&
609-
!(current_cpu_data.fpu_id & MIPS_FPIR_F64))
608+
if ((value & PR_FP_MODE_FR) && raw_cpu_has_fpu &&
609+
!(raw_current_cpu_data.fpu_id & MIPS_FPIR_F64))
610610
return -EOPNOTSUPP;
611-
if ((value & PR_FP_MODE_FRE) && cpu_has_fpu && !cpu_has_fre)
611+
if ((value & PR_FP_MODE_FRE) && raw_cpu_has_fpu && !cpu_has_fre)
612612
return -EOPNOTSUPP;
613613

614614
/* FR = 0 not supported in MIPS R6 */
615-
if (!(value & PR_FP_MODE_FR) && cpu_has_fpu && cpu_has_mips_r6)
615+
if (!(value & PR_FP_MODE_FR) && raw_cpu_has_fpu && cpu_has_mips_r6)
616616
return -EOPNOTSUPP;
617617

618618
/* Proceed with the mode switch */

0 commit comments

Comments
 (0)