Skip to content

Commit d67f250

Browse files
committed
Merge branch 'mips-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux
Pull MIPS fixes from Paul Burton: "Here are a few MIPS fixes, and a MAINTAINERS update to hand over MIPS maintenance to Thomas Bogendoerfer - this will be my final pull request as MIPS maintainer. Thanks for your helpful comments, useful corrections & responsiveness during the time I've fulfilled the role, and I'm sure I'll pop up elsewhere in the tree somewhere down the line" * 'mips-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux: MAINTAINERS: Hand MIPS over to Thomas MIPS: ingenic: DTS: Fix watchdog nodes MIPS: X1000: Fix clock of watchdog node. MIPS: vdso: Wrap -mexplicit-relocs in cc-option MIPS: VPE: Fix a double free and a memory leak in 'release_vpe()' MIPS: cavium_octeon: Fix syncw generation. mips: vdso: add build time check that no 'jalr t9' calls left MIPS: Disable VDSO time functionality on microMIPS mips: vdso: fix 'jalr t9' crash in vdso code
2 parents 63623fd + 3234f4e commit d67f250

File tree

8 files changed

+56
-29
lines changed

8 files changed

+56
-29
lines changed

CREDITS

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -567,6 +567,11 @@ D: Original author of Amiga FFS filesystem
567567
S: Orlando, Florida
568568
S: USA
569569

570+
N: Paul Burton
571+
572+
W: https://pburton.com
573+
D: MIPS maintainer 2018-2020
574+
570575
N: Lennert Buytenhek
571576
572577
D: Original (2.4) rewrite of the ethernet bridging code

MAINTAINERS

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11115,14 +11115,12 @@ S: Maintained
1111511115
F: drivers/usb/image/microtek.*
1111611116

1111711117
MIPS
11118-
M: Ralf Baechle <[email protected]>
11119-
M: Paul Burton <[email protected]>
11118+
M: Thomas Bogendoerfer <[email protected]>
1112011119
1112111120
W: http://www.linux-mips.org/
11122-
T: git git://git.linux-mips.org/pub/scm/ralf/linux.git
1112311121
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux.git
1112411122
Q: http://patchwork.linux-mips.org/project/linux-mips/list/
11125-
S: Supported
11123+
S: Maintained
1112611124
F: Documentation/devicetree/bindings/mips/
1112711125
F: Documentation/mips/
1112811126
F: arch/mips/

arch/mips/boot/dts/ingenic/jz4740.dtsi

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <dt-bindings/clock/jz4740-cgu.h>
3+
#include <dt-bindings/clock/ingenic,tcu.h>
34

45
/ {
56
#address-cells = <1>;
@@ -45,14 +46,6 @@
4546
#clock-cells = <1>;
4647
};
4748

48-
watchdog: watchdog@10002000 {
49-
compatible = "ingenic,jz4740-watchdog";
50-
reg = <0x10002000 0x10>;
51-
52-
clocks = <&cgu JZ4740_CLK_RTC>;
53-
clock-names = "rtc";
54-
};
55-
5649
tcu: timer@10002000 {
5750
compatible = "ingenic,jz4740-tcu", "simple-mfd";
5851
reg = <0x10002000 0x1000>;
@@ -73,6 +66,14 @@
7366

7467
interrupt-parent = <&intc>;
7568
interrupts = <23 22 21>;
69+
70+
watchdog: watchdog@0 {
71+
compatible = "ingenic,jz4740-watchdog";
72+
reg = <0x0 0xc>;
73+
74+
clocks = <&tcu TCU_CLK_WDT>;
75+
clock-names = "wdt";
76+
};
7677
};
7778

7879
rtc_dev: rtc@10003000 {

arch/mips/boot/dts/ingenic/jz4780.dtsi

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
// SPDX-License-Identifier: GPL-2.0
22
#include <dt-bindings/clock/jz4780-cgu.h>
3+
#include <dt-bindings/clock/ingenic,tcu.h>
34
#include <dt-bindings/dma/jz4780-dma.h>
45

56
/ {
@@ -67,6 +68,14 @@
6768

6869
interrupt-parent = <&intc>;
6970
interrupts = <27 26 25>;
71+
72+
watchdog: watchdog@0 {
73+
compatible = "ingenic,jz4780-watchdog";
74+
reg = <0x0 0xc>;
75+
76+
clocks = <&tcu TCU_CLK_WDT>;
77+
clock-names = "wdt";
78+
};
7079
};
7180

7281
rtc_dev: rtc@10003000 {
@@ -348,14 +357,6 @@
348357
status = "disabled";
349358
};
350359

351-
watchdog: watchdog@10002000 {
352-
compatible = "ingenic,jz4780-watchdog";
353-
reg = <0x10002000 0x10>;
354-
355-
clocks = <&cgu JZ4780_CLK_RTCLK>;
356-
clock-names = "rtc";
357-
};
358-
359360
nemc: nemc@13410000 {
360361
compatible = "ingenic,jz4780-nemc";
361362
reg = <0x13410000 0x10000>;

arch/mips/boot/dts/ingenic/x1000.dtsi

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0
2+
#include <dt-bindings/clock/ingenic,tcu.h>
23
#include <dt-bindings/clock/x1000-cgu.h>
34
#include <dt-bindings/dma/x1000-dma.h>
45

@@ -72,7 +73,7 @@
7273
compatible = "ingenic,x1000-watchdog", "ingenic,jz4780-watchdog";
7374
reg = <0x0 0x10>;
7475

75-
clocks = <&cgu X1000_CLK_RTCLK>;
76+
clocks = <&tcu TCU_CLK_WDT>;
7677
clock-names = "wdt";
7778
};
7879
};
@@ -158,7 +159,6 @@
158159
i2c0: i2c-controller@10050000 {
159160
compatible = "ingenic,x1000-i2c";
160161
reg = <0x10050000 0x1000>;
161-
162162
#address-cells = <1>;
163163
#size-cells = <0>;
164164

@@ -173,7 +173,6 @@
173173
i2c1: i2c-controller@10051000 {
174174
compatible = "ingenic,x1000-i2c";
175175
reg = <0x10051000 0x1000>;
176-
177176
#address-cells = <1>;
178177
#size-cells = <0>;
179178

@@ -188,7 +187,6 @@
188187
i2c2: i2c-controller@10052000 {
189188
compatible = "ingenic,x1000-i2c";
190189
reg = <0x10052000 0x1000>;
191-
192190
#address-cells = <1>;
193191
#size-cells = <0>;
194192

arch/mips/include/asm/sync.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,9 +155,11 @@
155155
* effective barrier as noted by commit 6b07d38aaa52 ("MIPS: Octeon: Use
156156
* optimized memory barrier primitives."). Here we specify that the affected
157157
* sync instructions should be emitted twice.
158+
* Note that this expression is evaluated by the assembler (not the compiler),
159+
* and that the assembler evaluates '==' as 0 or -1, not 0 or 1.
158160
*/
159161
#ifdef CONFIG_CPU_CAVIUM_OCTEON
160-
# define __SYNC_rpt(type) (1 + (type == __SYNC_wmb))
162+
# define __SYNC_rpt(type) (1 - (type == __SYNC_wmb))
161163
#else
162164
# define __SYNC_rpt(type) 1
163165
#endif

arch/mips/kernel/vpe.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ void release_vpe(struct vpe *v)
134134
{
135135
list_del(&v->list);
136136
if (v->load_addr)
137-
release_progmem(v);
137+
release_progmem(v->load_addr);
138138
kfree(v);
139139
}
140140

arch/mips/vdso/Makefile

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ endif
3333
cflags-vdso := $(ccflags-vdso) \
3434
$(filter -W%,$(filter-out -Wa$(comma)%,$(KBUILD_CFLAGS))) \
3535
-O3 -g -fPIC -fno-strict-aliasing -fno-common -fno-builtin -G 0 \
36+
-mrelax-pic-calls $(call cc-option, -mexplicit-relocs) \
3637
-fno-stack-protector -fno-jump-tables -DDISABLE_BRANCH_PROFILING \
3738
$(call cc-option, -fno-asynchronous-unwind-tables) \
3839
$(call cc-option, -fno-stack-protector)
@@ -51,6 +52,8 @@ endif
5152

5253
CFLAGS_REMOVE_vgettimeofday.o = -pg
5354

55+
DISABLE_VDSO := n
56+
5457
#
5558
# For the pre-R6 code in arch/mips/vdso/vdso.h for locating
5659
# the base address of VDSO, the linker will emit a R_MIPS_PC32
@@ -64,11 +67,24 @@ CFLAGS_REMOVE_vgettimeofday.o = -pg
6467
ifndef CONFIG_CPU_MIPSR6
6568
ifeq ($(call ld-ifversion, -lt, 225000000, y),y)
6669
$(warning MIPS VDSO requires binutils >= 2.25)
67-
obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))
68-
ccflags-vdso += -DDISABLE_MIPS_VDSO
70+
DISABLE_VDSO := y
6971
endif
7072
endif
7173

74+
#
75+
# GCC (at least up to version 9.2) appears to emit function calls that make use
76+
# of the GOT when targeting microMIPS, which we can't use in the VDSO due to
77+
# the lack of relocations. As such, we disable the VDSO for microMIPS builds.
78+
#
79+
ifdef CONFIG_CPU_MICROMIPS
80+
DISABLE_VDSO := y
81+
endif
82+
83+
ifeq ($(DISABLE_VDSO),y)
84+
obj-vdso-y := $(filter-out vgettimeofday.o, $(obj-vdso-y))
85+
ccflags-vdso += -DDISABLE_MIPS_VDSO
86+
endif
87+
7288
# VDSO linker flags.
7389
VDSO_LDFLAGS := \
7490
-Wl,-Bsymbolic -Wl,--no-undefined -Wl,-soname=linux-vdso.so.1 \
@@ -81,12 +97,18 @@ GCOV_PROFILE := n
8197
UBSAN_SANITIZE := n
8298
KCOV_INSTRUMENT := n
8399

100+
# Check that we don't have PIC 'jalr t9' calls left
101+
quiet_cmd_vdso_mips_check = VDSOCHK $@
102+
cmd_vdso_mips_check = if $(OBJDUMP) --disassemble $@ | egrep -h "jalr.*t9" > /dev/null; \
103+
then (echo >&2 "$@: PIC 'jalr t9' calls are not supported"; \
104+
rm -f $@; /bin/false); fi
105+
84106
#
85107
# Shared build commands.
86108
#
87109

88110
quiet_cmd_vdsold_and_vdso_check = LD $@
89-
cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check)
111+
cmd_vdsold_and_vdso_check = $(cmd_vdsold); $(cmd_vdso_check); $(cmd_vdso_mips_check)
90112

91113
quiet_cmd_vdsold = VDSO $@
92114
cmd_vdsold = $(CC) $(c_flags) $(VDSO_LDFLAGS) \

0 commit comments

Comments
 (0)