1 |
commit: 69d400b9dc2731690a4900bf1099f8e6426c7e7a |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Dec 30 12:51:46 2020 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Dec 30 12:51:46 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=69d400b9 |
7 |
|
8 |
Linux patch 4.19.164 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1163_linux-4.19.164.patch | 9937 +++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 9941 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index e1c0627..5ffa36c 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -691,6 +691,10 @@ Patch: 1162_linux-4.19.163.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.19.163 |
23 |
|
24 |
+Patch: 1163_linux-4.19.164.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.19.164 |
27 |
+ |
28 |
Patch: 1500_XATTR_USER_PREFIX.patch |
29 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
30 |
Desc: Support for namespace user.pax.* on tmpfs. |
31 |
|
32 |
diff --git a/1163_linux-4.19.164.patch b/1163_linux-4.19.164.patch |
33 |
new file mode 100644 |
34 |
index 0000000..581268c |
35 |
--- /dev/null |
36 |
+++ b/1163_linux-4.19.164.patch |
37 |
@@ -0,0 +1,9937 @@ |
38 |
+diff --git a/Documentation/admin-guide/kernel-parameters.txt b/Documentation/admin-guide/kernel-parameters.txt |
39 |
+index 7371643dd8d4f..558332df02a84 100644 |
40 |
+--- a/Documentation/admin-guide/kernel-parameters.txt |
41 |
++++ b/Documentation/admin-guide/kernel-parameters.txt |
42 |
+@@ -4998,6 +4998,7 @@ |
43 |
+ device); |
44 |
+ j = NO_REPORT_LUNS (don't use report luns |
45 |
+ command, uas only); |
46 |
++ k = NO_SAME (do not use WRITE_SAME, uas only) |
47 |
+ l = NOT_LOCKABLE (don't try to lock and |
48 |
+ unlock ejectable media, not on uas); |
49 |
+ m = MAX_SECTORS_64 (don't transfer more |
50 |
+diff --git a/Makefile b/Makefile |
51 |
+index b651d77eb2df9..d02af6881a5fe 100644 |
52 |
+--- a/Makefile |
53 |
++++ b/Makefile |
54 |
+@@ -1,7 +1,7 @@ |
55 |
+ # SPDX-License-Identifier: GPL-2.0 |
56 |
+ VERSION = 4 |
57 |
+ PATCHLEVEL = 19 |
58 |
+-SUBLEVEL = 163 |
59 |
++SUBLEVEL = 164 |
60 |
+ EXTRAVERSION = |
61 |
+ NAME = "People's Front" |
62 |
+ |
63 |
+@@ -745,8 +745,11 @@ KBUILD_CFLAGS += $(call cc-option, -gsplit-dwarf, -g) |
64 |
+ else |
65 |
+ KBUILD_CFLAGS += -g |
66 |
+ endif |
67 |
++ifneq ($(LLVM_IAS),1) |
68 |
+ KBUILD_AFLAGS += -Wa,-gdwarf-2 |
69 |
+ endif |
70 |
++endif |
71 |
++ |
72 |
+ ifdef CONFIG_DEBUG_INFO_DWARF4 |
73 |
+ KBUILD_CFLAGS += $(call cc-option, -gdwarf-4,) |
74 |
+ endif |
75 |
+diff --git a/arch/arc/kernel/stacktrace.c b/arch/arc/kernel/stacktrace.c |
76 |
+index 0fed32b959232..a211e87aa6d93 100644 |
77 |
+--- a/arch/arc/kernel/stacktrace.c |
78 |
++++ b/arch/arc/kernel/stacktrace.c |
79 |
+@@ -41,15 +41,15 @@ |
80 |
+ |
81 |
+ #ifdef CONFIG_ARC_DW2_UNWIND |
82 |
+ |
83 |
+-static void seed_unwind_frame_info(struct task_struct *tsk, |
84 |
+- struct pt_regs *regs, |
85 |
+- struct unwind_frame_info *frame_info) |
86 |
++static int |
87 |
++seed_unwind_frame_info(struct task_struct *tsk, struct pt_regs *regs, |
88 |
++ struct unwind_frame_info *frame_info) |
89 |
+ { |
90 |
+ /* |
91 |
+ * synchronous unwinding (e.g. dump_stack) |
92 |
+ * - uses current values of SP and friends |
93 |
+ */ |
94 |
+- if (tsk == NULL && regs == NULL) { |
95 |
++ if (regs == NULL && (tsk == NULL || tsk == current)) { |
96 |
+ unsigned long fp, sp, blink, ret; |
97 |
+ frame_info->task = current; |
98 |
+ |
99 |
+@@ -68,11 +68,15 @@ static void seed_unwind_frame_info(struct task_struct *tsk, |
100 |
+ frame_info->call_frame = 0; |
101 |
+ } else if (regs == NULL) { |
102 |
+ /* |
103 |
+- * Asynchronous unwinding of sleeping task |
104 |
+- * - Gets SP etc from task's pt_regs (saved bottom of kernel |
105 |
+- * mode stack of task) |
106 |
++ * Asynchronous unwinding of a likely sleeping task |
107 |
++ * - first ensure it is actually sleeping |
108 |
++ * - if so, it will be in __switch_to, kernel mode SP of task |
109 |
++ * is safe-kept and BLINK at a well known location in there |
110 |
+ */ |
111 |
+ |
112 |
++ if (tsk->state == TASK_RUNNING) |
113 |
++ return -1; |
114 |
++ |
115 |
+ frame_info->task = tsk; |
116 |
+ |
117 |
+ frame_info->regs.r27 = TSK_K_FP(tsk); |
118 |
+@@ -106,6 +110,8 @@ static void seed_unwind_frame_info(struct task_struct *tsk, |
119 |
+ frame_info->regs.r63 = regs->ret; |
120 |
+ frame_info->call_frame = 0; |
121 |
+ } |
122 |
++ |
123 |
++ return 0; |
124 |
+ } |
125 |
+ |
126 |
+ #endif |
127 |
+@@ -119,7 +125,8 @@ arc_unwind_core(struct task_struct *tsk, struct pt_regs *regs, |
128 |
+ unsigned int address; |
129 |
+ struct unwind_frame_info frame_info; |
130 |
+ |
131 |
+- seed_unwind_frame_info(tsk, regs, &frame_info); |
132 |
++ if (seed_unwind_frame_info(tsk, regs, &frame_info)) |
133 |
++ return 0; |
134 |
+ |
135 |
+ while (1) { |
136 |
+ address = UNW_PC(&frame_info); |
137 |
+diff --git a/arch/arm/boot/dts/armada-xp-98dx3236.dtsi b/arch/arm/boot/dts/armada-xp-98dx3236.dtsi |
138 |
+index 3e7d093d7a9a2..966d9a6c40fca 100644 |
139 |
+--- a/arch/arm/boot/dts/armada-xp-98dx3236.dtsi |
140 |
++++ b/arch/arm/boot/dts/armada-xp-98dx3236.dtsi |
141 |
+@@ -266,11 +266,6 @@ |
142 |
+ reg = <0x11000 0x100>; |
143 |
+ }; |
144 |
+ |
145 |
+-&i2c1 { |
146 |
+- compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c"; |
147 |
+- reg = <0x11100 0x100>; |
148 |
+-}; |
149 |
+- |
150 |
+ &mpic { |
151 |
+ reg = <0x20a00 0x2d0>, <0x21070 0x58>; |
152 |
+ }; |
153 |
+diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-s2600wf.dts b/arch/arm/boot/dts/aspeed-bmc-intel-s2600wf.dts |
154 |
+index 22dade6393d06..d1dbe3b6ad5a7 100644 |
155 |
+--- a/arch/arm/boot/dts/aspeed-bmc-intel-s2600wf.dts |
156 |
++++ b/arch/arm/boot/dts/aspeed-bmc-intel-s2600wf.dts |
157 |
+@@ -22,9 +22,9 @@ |
158 |
+ #size-cells = <1>; |
159 |
+ ranges; |
160 |
+ |
161 |
+- vga_memory: framebuffer@7f000000 { |
162 |
++ vga_memory: framebuffer@9f000000 { |
163 |
+ no-map; |
164 |
+- reg = <0x7f000000 0x01000000>; |
165 |
++ reg = <0x9f000000 0x01000000>; /* 16M */ |
166 |
+ }; |
167 |
+ }; |
168 |
+ |
169 |
+diff --git a/arch/arm/boot/dts/at91-sama5d3_xplained.dts b/arch/arm/boot/dts/at91-sama5d3_xplained.dts |
170 |
+index 02c1d2958d780..74440dad43354 100644 |
171 |
+--- a/arch/arm/boot/dts/at91-sama5d3_xplained.dts |
172 |
++++ b/arch/arm/boot/dts/at91-sama5d3_xplained.dts |
173 |
+@@ -243,6 +243,11 @@ |
174 |
+ atmel,pins = |
175 |
+ <AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PE9, conflicts with A9 */ |
176 |
+ }; |
177 |
++ pinctrl_usb_default: usb_default { |
178 |
++ atmel,pins = |
179 |
++ <AT91_PIOE 3 AT91_PERIPH_GPIO AT91_PINCTRL_NONE |
180 |
++ AT91_PIOE 4 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; |
181 |
++ }; |
182 |
+ }; |
183 |
+ }; |
184 |
+ }; |
185 |
+@@ -260,6 +265,8 @@ |
186 |
+ &pioE 3 GPIO_ACTIVE_LOW |
187 |
+ &pioE 4 GPIO_ACTIVE_LOW |
188 |
+ >; |
189 |
++ pinctrl-names = "default"; |
190 |
++ pinctrl-0 = <&pinctrl_usb_default>; |
191 |
+ status = "okay"; |
192 |
+ }; |
193 |
+ |
194 |
+diff --git a/arch/arm/boot/dts/at91-sama5d4_xplained.dts b/arch/arm/boot/dts/at91-sama5d4_xplained.dts |
195 |
+index 7d554b9ab27fd..e998d72d8b107 100644 |
196 |
+--- a/arch/arm/boot/dts/at91-sama5d4_xplained.dts |
197 |
++++ b/arch/arm/boot/dts/at91-sama5d4_xplained.dts |
198 |
+@@ -170,6 +170,11 @@ |
199 |
+ atmel,pins = |
200 |
+ <AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; |
201 |
+ }; |
202 |
++ pinctrl_usb_default: usb_default { |
203 |
++ atmel,pins = |
204 |
++ <AT91_PIOE 11 AT91_PERIPH_GPIO AT91_PINCTRL_NONE |
205 |
++ AT91_PIOE 14 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>; |
206 |
++ }; |
207 |
+ pinctrl_key_gpio: key_gpio_0 { |
208 |
+ atmel,pins = |
209 |
+ <AT91_PIOE 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>; |
210 |
+@@ -195,6 +200,8 @@ |
211 |
+ &pioE 11 GPIO_ACTIVE_HIGH |
212 |
+ &pioE 14 GPIO_ACTIVE_HIGH |
213 |
+ >; |
214 |
++ pinctrl-names = "default"; |
215 |
++ pinctrl-0 = <&pinctrl_usb_default>; |
216 |
+ status = "okay"; |
217 |
+ }; |
218 |
+ |
219 |
+diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi |
220 |
+index ad495f5a5790f..cdf016232fb7d 100644 |
221 |
+--- a/arch/arm/boot/dts/at91sam9rl.dtsi |
222 |
++++ b/arch/arm/boot/dts/at91sam9rl.dtsi |
223 |
+@@ -277,23 +277,26 @@ |
224 |
+ atmel,adc-use-res = "highres"; |
225 |
+ |
226 |
+ trigger0 { |
227 |
+- trigger-name = "timer-counter-0"; |
228 |
++ trigger-name = "external-rising"; |
229 |
+ trigger-value = <0x1>; |
230 |
++ trigger-external; |
231 |
+ }; |
232 |
++ |
233 |
+ trigger1 { |
234 |
+- trigger-name = "timer-counter-1"; |
235 |
+- trigger-value = <0x3>; |
236 |
++ trigger-name = "external-falling"; |
237 |
++ trigger-value = <0x2>; |
238 |
++ trigger-external; |
239 |
+ }; |
240 |
+ |
241 |
+ trigger2 { |
242 |
+- trigger-name = "timer-counter-2"; |
243 |
+- trigger-value = <0x5>; |
244 |
++ trigger-name = "external-any"; |
245 |
++ trigger-value = <0x3>; |
246 |
++ trigger-external; |
247 |
+ }; |
248 |
+ |
249 |
+ trigger3 { |
250 |
+- trigger-name = "external"; |
251 |
+- trigger-value = <0x13>; |
252 |
+- trigger-external; |
253 |
++ trigger-name = "continuous"; |
254 |
++ trigger-value = <0x6>; |
255 |
+ }; |
256 |
+ }; |
257 |
+ |
258 |
+diff --git a/arch/arm/boot/dts/exynos5410-odroidxu.dts b/arch/arm/boot/dts/exynos5410-odroidxu.dts |
259 |
+index a2046f5f998c1..840a854ee8385 100644 |
260 |
+--- a/arch/arm/boot/dts/exynos5410-odroidxu.dts |
261 |
++++ b/arch/arm/boot/dts/exynos5410-odroidxu.dts |
262 |
+@@ -324,6 +324,8 @@ |
263 |
+ regulator-name = "vddq_lcd"; |
264 |
+ regulator-min-microvolt = <1800000>; |
265 |
+ regulator-max-microvolt = <1800000>; |
266 |
++ /* Supplies also GPK and GPJ */ |
267 |
++ regulator-always-on; |
268 |
+ }; |
269 |
+ |
270 |
+ ldo8_reg: LDO8 { |
271 |
+@@ -626,11 +628,11 @@ |
272 |
+ }; |
273 |
+ |
274 |
+ &usbdrd_dwc3_0 { |
275 |
+- dr_mode = "host"; |
276 |
++ dr_mode = "peripheral"; |
277 |
+ }; |
278 |
+ |
279 |
+ &usbdrd_dwc3_1 { |
280 |
+- dr_mode = "peripheral"; |
281 |
++ dr_mode = "host"; |
282 |
+ }; |
283 |
+ |
284 |
+ &usbdrd3_0 { |
285 |
+diff --git a/arch/arm/boot/dts/exynos5410-pinctrl.dtsi b/arch/arm/boot/dts/exynos5410-pinctrl.dtsi |
286 |
+index 369a8a7f21050..481ee99aa9c97 100644 |
287 |
+--- a/arch/arm/boot/dts/exynos5410-pinctrl.dtsi |
288 |
++++ b/arch/arm/boot/dts/exynos5410-pinctrl.dtsi |
289 |
+@@ -560,6 +560,34 @@ |
290 |
+ interrupt-controller; |
291 |
+ #interrupt-cells = <2>; |
292 |
+ }; |
293 |
++ |
294 |
++ usb3_1_oc: usb3-1-oc { |
295 |
++ samsung,pins = "gpk2-4", "gpk2-5"; |
296 |
++ samsung,pin-function = <EXYNOS_PIN_FUNC_2>; |
297 |
++ samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; |
298 |
++ samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>; |
299 |
++ }; |
300 |
++ |
301 |
++ usb3_1_vbusctrl: usb3-1-vbusctrl { |
302 |
++ samsung,pins = "gpk2-6", "gpk2-7"; |
303 |
++ samsung,pin-function = <EXYNOS_PIN_FUNC_2>; |
304 |
++ samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>; |
305 |
++ samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>; |
306 |
++ }; |
307 |
++ |
308 |
++ usb3_0_oc: usb3-0-oc { |
309 |
++ samsung,pins = "gpk3-0", "gpk3-1"; |
310 |
++ samsung,pin-function = <EXYNOS_PIN_FUNC_2>; |
311 |
++ samsung,pin-pud = <EXYNOS_PIN_PULL_UP>; |
312 |
++ samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>; |
313 |
++ }; |
314 |
++ |
315 |
++ usb3_0_vbusctrl: usb3-0-vbusctrl { |
316 |
++ samsung,pins = "gpk3-2", "gpk3-3"; |
317 |
++ samsung,pin-function = <EXYNOS_PIN_FUNC_2>; |
318 |
++ samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>; |
319 |
++ samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>; |
320 |
++ }; |
321 |
+ }; |
322 |
+ |
323 |
+ &pinctrl_2 { |
324 |
+diff --git a/arch/arm/boot/dts/exynos5410.dtsi b/arch/arm/boot/dts/exynos5410.dtsi |
325 |
+index 57fc9c949e54a..95b794b1ea62e 100644 |
326 |
+--- a/arch/arm/boot/dts/exynos5410.dtsi |
327 |
++++ b/arch/arm/boot/dts/exynos5410.dtsi |
328 |
+@@ -392,6 +392,8 @@ |
329 |
+ &usbdrd3_0 { |
330 |
+ clocks = <&clock CLK_USBD300>; |
331 |
+ clock-names = "usbdrd30"; |
332 |
++ pinctrl-names = "default"; |
333 |
++ pinctrl-0 = <&usb3_0_oc>, <&usb3_0_vbusctrl>; |
334 |
+ }; |
335 |
+ |
336 |
+ &usbdrd_phy0 { |
337 |
+@@ -403,6 +405,8 @@ |
338 |
+ &usbdrd3_1 { |
339 |
+ clocks = <&clock CLK_USBD301>; |
340 |
+ clock-names = "usbdrd30"; |
341 |
++ pinctrl-names = "default"; |
342 |
++ pinctrl-0 = <&usb3_1_oc>, <&usb3_1_vbusctrl>; |
343 |
+ }; |
344 |
+ |
345 |
+ &usbdrd_dwc3_1 { |
346 |
+diff --git a/arch/arm/boot/dts/omap4-panda-es.dts b/arch/arm/boot/dts/omap4-panda-es.dts |
347 |
+index 19d02df8d8a59..70fd28120c275 100644 |
348 |
+--- a/arch/arm/boot/dts/omap4-panda-es.dts |
349 |
++++ b/arch/arm/boot/dts/omap4-panda-es.dts |
350 |
+@@ -49,7 +49,7 @@ |
351 |
+ |
352 |
+ button_pins: pinmux_button_pins { |
353 |
+ pinctrl-single,pins = < |
354 |
+- OMAP4_IOPAD(0x11b, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio_113 */ |
355 |
++ OMAP4_IOPAD(0x0fc, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio_113 */ |
356 |
+ >; |
357 |
+ }; |
358 |
+ }; |
359 |
+diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi |
360 |
+index b405992eb6016..d856c16d00156 100644 |
361 |
+--- a/arch/arm/boot/dts/sama5d2.dtsi |
362 |
++++ b/arch/arm/boot/dts/sama5d2.dtsi |
363 |
+@@ -1247,6 +1247,7 @@ |
364 |
+ clocks = <&securam_clk>; |
365 |
+ #address-cells = <1>; |
366 |
+ #size-cells = <1>; |
367 |
++ no-memory-wc; |
368 |
+ ranges = <0 0xf8044000 0x1420>; |
369 |
+ }; |
370 |
+ |
371 |
+@@ -1297,7 +1298,7 @@ |
372 |
+ |
373 |
+ can0: can@f8054000 { |
374 |
+ compatible = "bosch,m_can"; |
375 |
+- reg = <0xf8054000 0x4000>, <0x210000 0x4000>; |
376 |
++ reg = <0xf8054000 0x4000>, <0x210000 0x1c00>; |
377 |
+ reg-names = "m_can", "message_ram"; |
378 |
+ interrupts = <56 IRQ_TYPE_LEVEL_HIGH 7>, |
379 |
+ <64 IRQ_TYPE_LEVEL_HIGH 7>; |
380 |
+@@ -1490,7 +1491,7 @@ |
381 |
+ |
382 |
+ can1: can@fc050000 { |
383 |
+ compatible = "bosch,m_can"; |
384 |
+- reg = <0xfc050000 0x4000>, <0x210000 0x4000>; |
385 |
++ reg = <0xfc050000 0x4000>, <0x210000 0x3800>; |
386 |
+ reg-names = "m_can", "message_ram"; |
387 |
+ interrupts = <57 IRQ_TYPE_LEVEL_HIGH 7>, |
388 |
+ <65 IRQ_TYPE_LEVEL_HIGH 7>; |
389 |
+@@ -1500,7 +1501,7 @@ |
390 |
+ assigned-clocks = <&can1_gclk>; |
391 |
+ assigned-clock-parents = <&utmi>; |
392 |
+ assigned-clock-rates = <40000000>; |
393 |
+- bosch,mram-cfg = <0x1100 0 0 64 0 0 32 32>; |
394 |
++ bosch,mram-cfg = <0x1c00 0 0 64 0 0 32 32>; |
395 |
+ status = "disabled"; |
396 |
+ }; |
397 |
+ |
398 |
+diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi |
399 |
+index 92fcb756a08a9..97cac6d636923 100644 |
400 |
+--- a/arch/arm/boot/dts/sun8i-v3s.dtsi |
401 |
++++ b/arch/arm/boot/dts/sun8i-v3s.dtsi |
402 |
+@@ -419,7 +419,7 @@ |
403 |
+ gic: interrupt-controller@1c81000 { |
404 |
+ compatible = "arm,cortex-a7-gic", "arm,cortex-a15-gic"; |
405 |
+ reg = <0x01c81000 0x1000>, |
406 |
+- <0x01c82000 0x1000>, |
407 |
++ <0x01c82000 0x2000>, |
408 |
+ <0x01c84000 0x2000>, |
409 |
+ <0x01c86000 0x2000>; |
410 |
+ interrupt-controller; |
411 |
+diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S |
412 |
+index 6b1148cafffdb..90add5ded3f1f 100644 |
413 |
+--- a/arch/arm/kernel/head.S |
414 |
++++ b/arch/arm/kernel/head.S |
415 |
+@@ -674,12 +674,8 @@ ARM_BE8(rev16 ip, ip) |
416 |
+ ldrcc r7, [r4], #4 @ use branch for delay slot |
417 |
+ bcc 1b |
418 |
+ bx lr |
419 |
+-#else |
420 |
+-#ifdef CONFIG_CPU_ENDIAN_BE8 |
421 |
+- moveq r0, #0x00004000 @ set bit 22, mov to mvn instruction |
422 |
+ #else |
423 |
+ moveq r0, #0x400000 @ set bit 22, mov to mvn instruction |
424 |
+-#endif |
425 |
+ b 2f |
426 |
+ 1: ldr ip, [r7, r3] |
427 |
+ #ifdef CONFIG_CPU_ENDIAN_BE8 |
428 |
+@@ -688,7 +684,7 @@ ARM_BE8(rev16 ip, ip) |
429 |
+ tst ip, #0x000f0000 @ check the rotation field |
430 |
+ orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24 |
431 |
+ biceq ip, ip, #0x00004000 @ clear bit 22 |
432 |
+- orreq ip, ip, r0 @ mask in offset bits 7-0 |
433 |
++ orreq ip, ip, r0, ror #8 @ mask in offset bits 7-0 |
434 |
+ #else |
435 |
+ bic ip, ip, #0x000000ff |
436 |
+ tst ip, #0xf00 @ check the rotation field |
437 |
+diff --git a/arch/arm/mach-shmobile/pm-rmobile.c b/arch/arm/mach-shmobile/pm-rmobile.c |
438 |
+index e348bcfe389da..cb8b02a1abe26 100644 |
439 |
+--- a/arch/arm/mach-shmobile/pm-rmobile.c |
440 |
++++ b/arch/arm/mach-shmobile/pm-rmobile.c |
441 |
+@@ -330,6 +330,7 @@ static int __init rmobile_init_pm_domains(void) |
442 |
+ |
443 |
+ pmd = of_get_child_by_name(np, "pm-domains"); |
444 |
+ if (!pmd) { |
445 |
++ iounmap(base); |
446 |
+ pr_warn("%pOF lacks pm-domains node\n", np); |
447 |
+ continue; |
448 |
+ } |
449 |
+diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c |
450 |
+index de4b0e932f22e..aa08b8cb01524 100644 |
451 |
+--- a/arch/arm/mach-sunxi/sunxi.c |
452 |
++++ b/arch/arm/mach-sunxi/sunxi.c |
453 |
+@@ -66,6 +66,7 @@ static const char * const sun8i_board_dt_compat[] = { |
454 |
+ "allwinner,sun8i-h2-plus", |
455 |
+ "allwinner,sun8i-h3", |
456 |
+ "allwinner,sun8i-r40", |
457 |
++ "allwinner,sun8i-v3", |
458 |
+ "allwinner,sun8i-v3s", |
459 |
+ NULL, |
460 |
+ }; |
461 |
+diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts |
462 |
+index bdf7c6c5983ce..30fa9302a4dc8 100644 |
463 |
+--- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts |
464 |
++++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts |
465 |
+@@ -399,7 +399,7 @@ |
466 |
+ #size-cells = <1>; |
467 |
+ compatible = "winbond,w25q16", "jedec,spi-nor"; |
468 |
+ reg = <0>; |
469 |
+- spi-max-frequency = <3000000>; |
470 |
++ spi-max-frequency = <104000000>; |
471 |
+ }; |
472 |
+ }; |
473 |
+ |
474 |
+diff --git a/arch/arm64/boot/dts/exynos/exynos7.dtsi b/arch/arm64/boot/dts/exynos/exynos7.dtsi |
475 |
+index 31b1a606cb664..5c5e57026c275 100644 |
476 |
+--- a/arch/arm64/boot/dts/exynos/exynos7.dtsi |
477 |
++++ b/arch/arm64/boot/dts/exynos/exynos7.dtsi |
478 |
+@@ -62,8 +62,10 @@ |
479 |
+ }; |
480 |
+ |
481 |
+ psci { |
482 |
+- compatible = "arm,psci-0.2"; |
483 |
++ compatible = "arm,psci"; |
484 |
+ method = "smc"; |
485 |
++ cpu_off = <0x84000002>; |
486 |
++ cpu_on = <0xC4000003>; |
487 |
+ }; |
488 |
+ |
489 |
+ soc: soc { |
490 |
+@@ -494,13 +496,6 @@ |
491 |
+ pmu_system_controller: system-controller@105c0000 { |
492 |
+ compatible = "samsung,exynos7-pmu", "syscon"; |
493 |
+ reg = <0x105c0000 0x5000>; |
494 |
+- |
495 |
+- reboot: syscon-reboot { |
496 |
+- compatible = "syscon-reboot"; |
497 |
+- regmap = <&pmu_system_controller>; |
498 |
+- offset = <0x0400>; |
499 |
+- mask = <0x1>; |
500 |
+- }; |
501 |
+ }; |
502 |
+ |
503 |
+ rtc: rtc@10590000 { |
504 |
+@@ -638,3 +633,4 @@ |
505 |
+ }; |
506 |
+ |
507 |
+ #include "exynos7-pinctrl.dtsi" |
508 |
++#include "arm/exynos-syscon-restart.dtsi" |
509 |
+diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts |
510 |
+index 91061d9cf78bc..5b1ece4a68d67 100644 |
511 |
+--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts |
512 |
++++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts |
513 |
+@@ -255,6 +255,7 @@ |
514 |
+ }; |
515 |
+ |
516 |
+ &usb20_otg { |
517 |
++ dr_mode = "host"; |
518 |
+ status = "okay"; |
519 |
+ }; |
520 |
+ |
521 |
+diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi |
522 |
+index 92186edefeb96..6be7c67584ba9 100644 |
523 |
+--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi |
524 |
++++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi |
525 |
+@@ -1085,8 +1085,8 @@ |
526 |
+ |
527 |
+ uart0 { |
528 |
+ uart0_xfer: uart0-xfer { |
529 |
+- rockchip,pins = <1 RK_PB1 1 &pcfg_pull_up>, |
530 |
+- <1 RK_PB0 1 &pcfg_pull_none>; |
531 |
++ rockchip,pins = <1 RK_PB1 1 &pcfg_pull_none>, |
532 |
++ <1 RK_PB0 1 &pcfg_pull_up>; |
533 |
+ }; |
534 |
+ |
535 |
+ uart0_cts: uart0-cts { |
536 |
+@@ -1104,8 +1104,8 @@ |
537 |
+ |
538 |
+ uart1 { |
539 |
+ uart1_xfer: uart1-xfer { |
540 |
+- rockchip,pins = <3 RK_PA4 4 &pcfg_pull_up>, |
541 |
+- <3 RK_PA6 4 &pcfg_pull_none>; |
542 |
++ rockchip,pins = <3 RK_PA4 4 &pcfg_pull_none>, |
543 |
++ <3 RK_PA6 4 &pcfg_pull_up>; |
544 |
+ }; |
545 |
+ |
546 |
+ uart1_cts: uart1-cts { |
547 |
+@@ -1123,15 +1123,15 @@ |
548 |
+ |
549 |
+ uart2-0 { |
550 |
+ uart2m0_xfer: uart2m0-xfer { |
551 |
+- rockchip,pins = <1 RK_PA0 2 &pcfg_pull_up>, |
552 |
+- <1 RK_PA1 2 &pcfg_pull_none>; |
553 |
++ rockchip,pins = <1 RK_PA0 2 &pcfg_pull_none>, |
554 |
++ <1 RK_PA1 2 &pcfg_pull_up>; |
555 |
+ }; |
556 |
+ }; |
557 |
+ |
558 |
+ uart2-1 { |
559 |
+ uart2m1_xfer: uart2m1-xfer { |
560 |
+- rockchip,pins = <2 RK_PA0 1 &pcfg_pull_up>, |
561 |
+- <2 RK_PA1 1 &pcfg_pull_none>; |
562 |
++ rockchip,pins = <2 RK_PA0 1 &pcfg_pull_none>, |
563 |
++ <2 RK_PA1 1 &pcfg_pull_up>; |
564 |
+ }; |
565 |
+ }; |
566 |
+ |
567 |
+diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi |
568 |
+index f14e8c5c41acc..f4ee7c4f83b8b 100644 |
569 |
+--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi |
570 |
++++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi |
571 |
+@@ -29,6 +29,9 @@ |
572 |
+ i2c6 = &i2c6; |
573 |
+ i2c7 = &i2c7; |
574 |
+ i2c8 = &i2c8; |
575 |
++ mmc0 = &sdio0; |
576 |
++ mmc1 = &sdmmc; |
577 |
++ mmc2 = &sdhci; |
578 |
+ serial0 = &uart0; |
579 |
+ serial1 = &uart1; |
580 |
+ serial2 = &uart2; |
581 |
+diff --git a/arch/arm64/include/asm/atomic_lse.h b/arch/arm64/include/asm/atomic_lse.h |
582 |
+index f9b0b09153e0e..eab3de4f2ad25 100644 |
583 |
+--- a/arch/arm64/include/asm/atomic_lse.h |
584 |
++++ b/arch/arm64/include/asm/atomic_lse.h |
585 |
+@@ -32,7 +32,9 @@ static inline void atomic_##op(int i, atomic_t *v) \ |
586 |
+ register int w0 asm ("w0") = i; \ |
587 |
+ register atomic_t *x1 asm ("x1") = v; \ |
588 |
+ \ |
589 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN(__LL_SC_ATOMIC(op), \ |
590 |
++ asm volatile( \ |
591 |
++ __LSE_PREAMBLE \ |
592 |
++ ARM64_LSE_ATOMIC_INSN(__LL_SC_ATOMIC(op), \ |
593 |
+ " " #asm_op " %w[i], %[v]\n") \ |
594 |
+ : [i] "+r" (w0), [v] "+Q" (v->counter) \ |
595 |
+ : "r" (x1) \ |
596 |
+@@ -52,7 +54,9 @@ static inline int atomic_fetch_##op##name(int i, atomic_t *v) \ |
597 |
+ register int w0 asm ("w0") = i; \ |
598 |
+ register atomic_t *x1 asm ("x1") = v; \ |
599 |
+ \ |
600 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
601 |
++ asm volatile( \ |
602 |
++ __LSE_PREAMBLE \ |
603 |
++ ARM64_LSE_ATOMIC_INSN( \ |
604 |
+ /* LL/SC */ \ |
605 |
+ __LL_SC_ATOMIC(fetch_##op##name), \ |
606 |
+ /* LSE atomics */ \ |
607 |
+@@ -84,7 +88,9 @@ static inline int atomic_add_return##name(int i, atomic_t *v) \ |
608 |
+ register int w0 asm ("w0") = i; \ |
609 |
+ register atomic_t *x1 asm ("x1") = v; \ |
610 |
+ \ |
611 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
612 |
++ asm volatile( \ |
613 |
++ __LSE_PREAMBLE \ |
614 |
++ ARM64_LSE_ATOMIC_INSN( \ |
615 |
+ /* LL/SC */ \ |
616 |
+ __LL_SC_ATOMIC(add_return##name) \ |
617 |
+ __nops(1), \ |
618 |
+@@ -110,7 +116,9 @@ static inline void atomic_and(int i, atomic_t *v) |
619 |
+ register int w0 asm ("w0") = i; |
620 |
+ register atomic_t *x1 asm ("x1") = v; |
621 |
+ |
622 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( |
623 |
++ asm volatile( |
624 |
++ __LSE_PREAMBLE |
625 |
++ ARM64_LSE_ATOMIC_INSN( |
626 |
+ /* LL/SC */ |
627 |
+ __LL_SC_ATOMIC(and) |
628 |
+ __nops(1), |
629 |
+@@ -128,7 +136,9 @@ static inline int atomic_fetch_and##name(int i, atomic_t *v) \ |
630 |
+ register int w0 asm ("w0") = i; \ |
631 |
+ register atomic_t *x1 asm ("x1") = v; \ |
632 |
+ \ |
633 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
634 |
++ asm volatile( \ |
635 |
++ __LSE_PREAMBLE \ |
636 |
++ ARM64_LSE_ATOMIC_INSN( \ |
637 |
+ /* LL/SC */ \ |
638 |
+ __LL_SC_ATOMIC(fetch_and##name) \ |
639 |
+ __nops(1), \ |
640 |
+@@ -154,7 +164,9 @@ static inline void atomic_sub(int i, atomic_t *v) |
641 |
+ register int w0 asm ("w0") = i; |
642 |
+ register atomic_t *x1 asm ("x1") = v; |
643 |
+ |
644 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( |
645 |
++ asm volatile( |
646 |
++ __LSE_PREAMBLE |
647 |
++ ARM64_LSE_ATOMIC_INSN( |
648 |
+ /* LL/SC */ |
649 |
+ __LL_SC_ATOMIC(sub) |
650 |
+ __nops(1), |
651 |
+@@ -172,7 +184,9 @@ static inline int atomic_sub_return##name(int i, atomic_t *v) \ |
652 |
+ register int w0 asm ("w0") = i; \ |
653 |
+ register atomic_t *x1 asm ("x1") = v; \ |
654 |
+ \ |
655 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
656 |
++ asm volatile( \ |
657 |
++ __LSE_PREAMBLE \ |
658 |
++ ARM64_LSE_ATOMIC_INSN( \ |
659 |
+ /* LL/SC */ \ |
660 |
+ __LL_SC_ATOMIC(sub_return##name) \ |
661 |
+ __nops(2), \ |
662 |
+@@ -200,7 +214,9 @@ static inline int atomic_fetch_sub##name(int i, atomic_t *v) \ |
663 |
+ register int w0 asm ("w0") = i; \ |
664 |
+ register atomic_t *x1 asm ("x1") = v; \ |
665 |
+ \ |
666 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
667 |
++ asm volatile( \ |
668 |
++ __LSE_PREAMBLE \ |
669 |
++ ARM64_LSE_ATOMIC_INSN( \ |
670 |
+ /* LL/SC */ \ |
671 |
+ __LL_SC_ATOMIC(fetch_sub##name) \ |
672 |
+ __nops(1), \ |
673 |
+@@ -229,7 +245,9 @@ static inline void atomic64_##op(long i, atomic64_t *v) \ |
674 |
+ register long x0 asm ("x0") = i; \ |
675 |
+ register atomic64_t *x1 asm ("x1") = v; \ |
676 |
+ \ |
677 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN(__LL_SC_ATOMIC64(op), \ |
678 |
++ asm volatile( \ |
679 |
++ __LSE_PREAMBLE \ |
680 |
++ ARM64_LSE_ATOMIC_INSN(__LL_SC_ATOMIC64(op), \ |
681 |
+ " " #asm_op " %[i], %[v]\n") \ |
682 |
+ : [i] "+r" (x0), [v] "+Q" (v->counter) \ |
683 |
+ : "r" (x1) \ |
684 |
+@@ -249,7 +267,9 @@ static inline long atomic64_fetch_##op##name(long i, atomic64_t *v) \ |
685 |
+ register long x0 asm ("x0") = i; \ |
686 |
+ register atomic64_t *x1 asm ("x1") = v; \ |
687 |
+ \ |
688 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
689 |
++ asm volatile( \ |
690 |
++ __LSE_PREAMBLE \ |
691 |
++ ARM64_LSE_ATOMIC_INSN( \ |
692 |
+ /* LL/SC */ \ |
693 |
+ __LL_SC_ATOMIC64(fetch_##op##name), \ |
694 |
+ /* LSE atomics */ \ |
695 |
+@@ -281,7 +301,9 @@ static inline long atomic64_add_return##name(long i, atomic64_t *v) \ |
696 |
+ register long x0 asm ("x0") = i; \ |
697 |
+ register atomic64_t *x1 asm ("x1") = v; \ |
698 |
+ \ |
699 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
700 |
++ asm volatile( \ |
701 |
++ __LSE_PREAMBLE \ |
702 |
++ ARM64_LSE_ATOMIC_INSN( \ |
703 |
+ /* LL/SC */ \ |
704 |
+ __LL_SC_ATOMIC64(add_return##name) \ |
705 |
+ __nops(1), \ |
706 |
+@@ -307,7 +329,9 @@ static inline void atomic64_and(long i, atomic64_t *v) |
707 |
+ register long x0 asm ("x0") = i; |
708 |
+ register atomic64_t *x1 asm ("x1") = v; |
709 |
+ |
710 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( |
711 |
++ asm volatile( |
712 |
++ __LSE_PREAMBLE |
713 |
++ ARM64_LSE_ATOMIC_INSN( |
714 |
+ /* LL/SC */ |
715 |
+ __LL_SC_ATOMIC64(and) |
716 |
+ __nops(1), |
717 |
+@@ -325,7 +349,9 @@ static inline long atomic64_fetch_and##name(long i, atomic64_t *v) \ |
718 |
+ register long x0 asm ("x0") = i; \ |
719 |
+ register atomic64_t *x1 asm ("x1") = v; \ |
720 |
+ \ |
721 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
722 |
++ asm volatile( \ |
723 |
++ __LSE_PREAMBLE \ |
724 |
++ ARM64_LSE_ATOMIC_INSN( \ |
725 |
+ /* LL/SC */ \ |
726 |
+ __LL_SC_ATOMIC64(fetch_and##name) \ |
727 |
+ __nops(1), \ |
728 |
+@@ -351,7 +377,9 @@ static inline void atomic64_sub(long i, atomic64_t *v) |
729 |
+ register long x0 asm ("x0") = i; |
730 |
+ register atomic64_t *x1 asm ("x1") = v; |
731 |
+ |
732 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( |
733 |
++ asm volatile( |
734 |
++ __LSE_PREAMBLE |
735 |
++ ARM64_LSE_ATOMIC_INSN( |
736 |
+ /* LL/SC */ |
737 |
+ __LL_SC_ATOMIC64(sub) |
738 |
+ __nops(1), |
739 |
+@@ -369,7 +397,9 @@ static inline long atomic64_sub_return##name(long i, atomic64_t *v) \ |
740 |
+ register long x0 asm ("x0") = i; \ |
741 |
+ register atomic64_t *x1 asm ("x1") = v; \ |
742 |
+ \ |
743 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
744 |
++ asm volatile( \ |
745 |
++ __LSE_PREAMBLE \ |
746 |
++ ARM64_LSE_ATOMIC_INSN( \ |
747 |
+ /* LL/SC */ \ |
748 |
+ __LL_SC_ATOMIC64(sub_return##name) \ |
749 |
+ __nops(2), \ |
750 |
+@@ -397,7 +427,9 @@ static inline long atomic64_fetch_sub##name(long i, atomic64_t *v) \ |
751 |
+ register long x0 asm ("x0") = i; \ |
752 |
+ register atomic64_t *x1 asm ("x1") = v; \ |
753 |
+ \ |
754 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
755 |
++ asm volatile( \ |
756 |
++ __LSE_PREAMBLE \ |
757 |
++ ARM64_LSE_ATOMIC_INSN( \ |
758 |
+ /* LL/SC */ \ |
759 |
+ __LL_SC_ATOMIC64(fetch_sub##name) \ |
760 |
+ __nops(1), \ |
761 |
+@@ -422,7 +454,9 @@ static inline long atomic64_dec_if_positive(atomic64_t *v) |
762 |
+ { |
763 |
+ register long x0 asm ("x0") = (long)v; |
764 |
+ |
765 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( |
766 |
++ asm volatile( |
767 |
++ __LSE_PREAMBLE |
768 |
++ ARM64_LSE_ATOMIC_INSN( |
769 |
+ /* LL/SC */ |
770 |
+ __LL_SC_ATOMIC64(dec_if_positive) |
771 |
+ __nops(6), |
772 |
+@@ -455,7 +489,9 @@ static inline unsigned long __cmpxchg_case_##name(volatile void *ptr, \ |
773 |
+ register unsigned long x1 asm ("x1") = old; \ |
774 |
+ register unsigned long x2 asm ("x2") = new; \ |
775 |
+ \ |
776 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
777 |
++ asm volatile( \ |
778 |
++ __LSE_PREAMBLE \ |
779 |
++ ARM64_LSE_ATOMIC_INSN( \ |
780 |
+ /* LL/SC */ \ |
781 |
+ __LL_SC_CMPXCHG(name) \ |
782 |
+ __nops(2), \ |
783 |
+@@ -507,7 +543,9 @@ static inline long __cmpxchg_double##name(unsigned long old1, \ |
784 |
+ register unsigned long x3 asm ("x3") = new2; \ |
785 |
+ register unsigned long x4 asm ("x4") = (unsigned long)ptr; \ |
786 |
+ \ |
787 |
+- asm volatile(ARM64_LSE_ATOMIC_INSN( \ |
788 |
++ asm volatile( \ |
789 |
++ __LSE_PREAMBLE \ |
790 |
++ ARM64_LSE_ATOMIC_INSN( \ |
791 |
+ /* LL/SC */ \ |
792 |
+ __LL_SC_CMPXCHG_DBL(name) \ |
793 |
+ __nops(3), \ |
794 |
+diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h |
795 |
+index c67cae9d52293..151e69a93e341 100644 |
796 |
+--- a/arch/arm64/include/asm/kvm_host.h |
797 |
++++ b/arch/arm64/include/asm/kvm_host.h |
798 |
+@@ -165,6 +165,7 @@ enum vcpu_sysreg { |
799 |
+ #define c2_TTBR1 (TTBR1_EL1 * 2) /* Translation Table Base Register 1 */ |
800 |
+ #define c2_TTBR1_high (c2_TTBR1 + 1) /* TTBR1 top 32 bits */ |
801 |
+ #define c2_TTBCR (TCR_EL1 * 2) /* Translation Table Base Control R. */ |
802 |
++#define c2_TTBCR2 (c2_TTBCR + 1) /* Translation Table Base Control R. 2 */ |
803 |
+ #define c3_DACR (DACR32_EL2 * 2)/* Domain Access Control Register */ |
804 |
+ #define c5_DFSR (ESR_EL1 * 2) /* Data Fault Status Register */ |
805 |
+ #define c5_IFSR (IFSR32_EL2 * 2)/* Instruction Fault Status Register */ |
806 |
+diff --git a/arch/arm64/include/asm/lse.h b/arch/arm64/include/asm/lse.h |
807 |
+index 8262325e2fc66..13536c4da2c26 100644 |
808 |
+--- a/arch/arm64/include/asm/lse.h |
809 |
++++ b/arch/arm64/include/asm/lse.h |
810 |
+@@ -4,6 +4,8 @@ |
811 |
+ |
812 |
+ #if defined(CONFIG_AS_LSE) && defined(CONFIG_ARM64_LSE_ATOMICS) |
813 |
+ |
814 |
++#define __LSE_PREAMBLE ".arch_extension lse\n" |
815 |
++ |
816 |
+ #include <linux/compiler_types.h> |
817 |
+ #include <linux/export.h> |
818 |
+ #include <linux/stringify.h> |
819 |
+@@ -20,8 +22,6 @@ |
820 |
+ |
821 |
+ #else /* __ASSEMBLER__ */ |
822 |
+ |
823 |
+-__asm__(".arch_extension lse"); |
824 |
+- |
825 |
+ /* Move the ll/sc atomics out-of-line */ |
826 |
+ #define __LL_SC_INLINE notrace |
827 |
+ #define __LL_SC_PREFIX(x) __ll_sc_##x |
828 |
+@@ -33,7 +33,7 @@ __asm__(".arch_extension lse"); |
829 |
+ |
830 |
+ /* In-line patching at runtime */ |
831 |
+ #define ARM64_LSE_ATOMIC_INSN(llsc, lse) \ |
832 |
+- ALTERNATIVE(llsc, lse, ARM64_HAS_LSE_ATOMICS) |
833 |
++ ALTERNATIVE(llsc, __LSE_PREAMBLE lse, ARM64_HAS_LSE_ATOMICS) |
834 |
+ |
835 |
+ #endif /* __ASSEMBLER__ */ |
836 |
+ #else /* CONFIG_AS_LSE && CONFIG_ARM64_LSE_ATOMICS */ |
837 |
+diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c |
838 |
+index 1457a0ba83dbc..f2d2dbbbfca20 100644 |
839 |
+--- a/arch/arm64/kernel/syscall.c |
840 |
++++ b/arch/arm64/kernel/syscall.c |
841 |
+@@ -102,8 +102,8 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr, |
842 |
+ regs->syscallno = scno; |
843 |
+ |
844 |
+ cortex_a76_erratum_1463225_svc_handler(); |
845 |
++ user_exit_irqoff(); |
846 |
+ local_daif_restore(DAIF_PROCCTX); |
847 |
+- user_exit(); |
848 |
+ |
849 |
+ if (has_syscall_work(flags)) { |
850 |
+ /* set default errno for user-issued syscall(-1) */ |
851 |
+diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c |
852 |
+index b53d0ebb87fcc..847b2d80ce870 100644 |
853 |
+--- a/arch/arm64/kvm/sys_regs.c |
854 |
++++ b/arch/arm64/kvm/sys_regs.c |
855 |
+@@ -1661,6 +1661,7 @@ static const struct sys_reg_desc cp15_regs[] = { |
856 |
+ { Op1( 0), CRn( 2), CRm( 0), Op2( 0), access_vm_reg, NULL, c2_TTBR0 }, |
857 |
+ { Op1( 0), CRn( 2), CRm( 0), Op2( 1), access_vm_reg, NULL, c2_TTBR1 }, |
858 |
+ { Op1( 0), CRn( 2), CRm( 0), Op2( 2), access_vm_reg, NULL, c2_TTBCR }, |
859 |
++ { Op1( 0), CRn( 2), CRm( 0), Op2( 3), access_vm_reg, NULL, c2_TTBCR2 }, |
860 |
+ { Op1( 0), CRn( 3), CRm( 0), Op2( 0), access_vm_reg, NULL, c3_DACR }, |
861 |
+ { Op1( 0), CRn( 5), CRm( 0), Op2( 0), access_vm_reg, NULL, c5_DFSR }, |
862 |
+ { Op1( 0), CRn( 5), CRm( 0), Op2( 1), access_vm_reg, NULL, c5_IFSR }, |
863 |
+diff --git a/arch/arm64/lib/memcpy.S b/arch/arm64/lib/memcpy.S |
864 |
+index 67613937711f1..dfedd4ab1a766 100644 |
865 |
+--- a/arch/arm64/lib/memcpy.S |
866 |
++++ b/arch/arm64/lib/memcpy.S |
867 |
+@@ -68,9 +68,8 @@ |
868 |
+ stp \ptr, \regB, [\regC], \val |
869 |
+ .endm |
870 |
+ |
871 |
+- .weak memcpy |
872 |
+ ENTRY(__memcpy) |
873 |
+-ENTRY(memcpy) |
874 |
++WEAK(memcpy) |
875 |
+ #include "copy_template.S" |
876 |
+ ret |
877 |
+ ENDPIPROC(memcpy) |
878 |
+diff --git a/arch/arm64/lib/memmove.S b/arch/arm64/lib/memmove.S |
879 |
+index a5a4459013b1a..e3de8f05c21a8 100644 |
880 |
+--- a/arch/arm64/lib/memmove.S |
881 |
++++ b/arch/arm64/lib/memmove.S |
882 |
+@@ -57,9 +57,8 @@ C_h .req x12 |
883 |
+ D_l .req x13 |
884 |
+ D_h .req x14 |
885 |
+ |
886 |
+- .weak memmove |
887 |
+ ENTRY(__memmove) |
888 |
+-ENTRY(memmove) |
889 |
++WEAK(memmove) |
890 |
+ cmp dstin, src |
891 |
+ b.lo __memcpy |
892 |
+ add tmp1, src, count |
893 |
+diff --git a/arch/arm64/lib/memset.S b/arch/arm64/lib/memset.S |
894 |
+index f2670a9f218c9..316263c47c006 100644 |
895 |
+--- a/arch/arm64/lib/memset.S |
896 |
++++ b/arch/arm64/lib/memset.S |
897 |
+@@ -54,9 +54,8 @@ dst .req x8 |
898 |
+ tmp3w .req w9 |
899 |
+ tmp3 .req x9 |
900 |
+ |
901 |
+- .weak memset |
902 |
+ ENTRY(__memset) |
903 |
+-ENTRY(memset) |
904 |
++WEAK(memset) |
905 |
+ mov dst, dstin /* Preserve return value. */ |
906 |
+ and A_lw, val, #255 |
907 |
+ orr A_lw, A_lw, A_lw, lsl #8 |
908 |
+diff --git a/arch/mips/bcm47xx/Kconfig b/arch/mips/bcm47xx/Kconfig |
909 |
+index 29471038d817e..c6b99845fb377 100644 |
910 |
+--- a/arch/mips/bcm47xx/Kconfig |
911 |
++++ b/arch/mips/bcm47xx/Kconfig |
912 |
+@@ -27,6 +27,7 @@ config BCM47XX_BCMA |
913 |
+ select BCMA |
914 |
+ select BCMA_HOST_SOC |
915 |
+ select BCMA_DRIVER_MIPS |
916 |
++ select BCMA_DRIVER_PCI if PCI |
917 |
+ select BCMA_DRIVER_PCI_HOSTMODE if PCI |
918 |
+ select BCMA_DRIVER_GPIO |
919 |
+ default y |
920 |
+diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile |
921 |
+index 8954108df4570..f51e21ea53492 100644 |
922 |
+--- a/arch/powerpc/Makefile |
923 |
++++ b/arch/powerpc/Makefile |
924 |
+@@ -251,7 +251,6 @@ endif |
925 |
+ |
926 |
+ cpu-as-$(CONFIG_4xx) += -Wa,-m405 |
927 |
+ cpu-as-$(CONFIG_ALTIVEC) += $(call as-option,-Wa$(comma)-maltivec) |
928 |
+-cpu-as-$(CONFIG_E200) += -Wa,-me200 |
929 |
+ cpu-as-$(CONFIG_E500) += -Wa,-me500 |
930 |
+ |
931 |
+ # When using '-many -mpower4' gas will first try and find a matching power4 |
932 |
+diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h b/arch/powerpc/include/asm/book3s/32/pgtable.h |
933 |
+index 751cf931bb3f4..a4f4820826b74 100644 |
934 |
+--- a/arch/powerpc/include/asm/book3s/32/pgtable.h |
935 |
++++ b/arch/powerpc/include/asm/book3s/32/pgtable.h |
936 |
+@@ -434,9 +434,9 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr, |
937 |
+ if (pte_val(*ptep) & _PAGE_HASHPTE) |
938 |
+ flush_hash_entry(mm, ptep, addr); |
939 |
+ __asm__ __volatile__("\ |
940 |
+- stw%U0%X0 %2,%0\n\ |
941 |
++ stw%X0 %2,%0\n\ |
942 |
+ eieio\n\ |
943 |
+- stw%U0%X0 %L2,%1" |
944 |
++ stw%X1 %L2,%1" |
945 |
+ : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4)) |
946 |
+ : "r" (pte) : "memory"); |
947 |
+ |
948 |
+diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h |
949 |
+index 59b35b93eadec..d90093a88e096 100644 |
950 |
+--- a/arch/powerpc/include/asm/cputable.h |
951 |
++++ b/arch/powerpc/include/asm/cputable.h |
952 |
+@@ -411,7 +411,6 @@ static inline void cpu_feature_keys_init(void) { } |
953 |
+ CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \ |
954 |
+ CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \ |
955 |
+ CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT) |
956 |
+-#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN) |
957 |
+ |
958 |
+ /* 64-bit CPUs */ |
959 |
+ #define CPU_FTRS_PPC970 (CPU_FTR_LWSYNC | \ |
960 |
+@@ -509,8 +508,6 @@ enum { |
961 |
+ CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX | |
962 |
+ CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 | |
963 |
+ CPU_FTRS_CLASSIC32 | |
964 |
+-#else |
965 |
+- CPU_FTRS_GENERIC_32 | |
966 |
+ #endif |
967 |
+ #ifdef CONFIG_PPC_8xx |
968 |
+ CPU_FTRS_8XX | |
969 |
+@@ -585,8 +582,6 @@ enum { |
970 |
+ CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX & |
971 |
+ CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 & |
972 |
+ CPU_FTRS_CLASSIC32 & |
973 |
+-#else |
974 |
+- CPU_FTRS_GENERIC_32 & |
975 |
+ #endif |
976 |
+ #ifdef CONFIG_PPC_8xx |
977 |
+ CPU_FTRS_8XX & |
978 |
+diff --git a/arch/powerpc/include/asm/nohash/pgtable.h b/arch/powerpc/include/asm/nohash/pgtable.h |
979 |
+index b321c82b36247..913878d8e3bec 100644 |
980 |
+--- a/arch/powerpc/include/asm/nohash/pgtable.h |
981 |
++++ b/arch/powerpc/include/asm/nohash/pgtable.h |
982 |
+@@ -151,9 +151,9 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr, |
983 |
+ */ |
984 |
+ if (IS_ENABLED(CONFIG_PPC32) && IS_ENABLED(CONFIG_PTE_64BIT) && !percpu) { |
985 |
+ __asm__ __volatile__("\ |
986 |
+- stw%U0%X0 %2,%0\n\ |
987 |
++ stw%X0 %2,%0\n\ |
988 |
+ eieio\n\ |
989 |
+- stw%U0%X0 %L2,%1" |
990 |
++ stw%X1 %L2,%1" |
991 |
+ : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4)) |
992 |
+ : "r" (pte) : "memory"); |
993 |
+ return; |
994 |
+diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S |
995 |
+index 389da790c1296..4f7b225d78cff 100644 |
996 |
+--- a/arch/powerpc/kernel/head_64.S |
997 |
++++ b/arch/powerpc/kernel/head_64.S |
998 |
+@@ -423,6 +423,10 @@ generic_secondary_common_init: |
999 |
+ /* From now on, r24 is expected to be logical cpuid */ |
1000 |
+ mr r24,r5 |
1001 |
+ |
1002 |
++ /* Create a temp kernel stack for use before relocation is on. */ |
1003 |
++ ld r1,PACAEMERGSP(r13) |
1004 |
++ subi r1,r1,STACK_FRAME_OVERHEAD |
1005 |
++ |
1006 |
+ /* See if we need to call a cpu state restore handler */ |
1007 |
+ LOAD_REG_ADDR(r23, cur_cpu_spec) |
1008 |
+ ld r23,0(r23) |
1009 |
+@@ -451,10 +455,6 @@ generic_secondary_common_init: |
1010 |
+ sync /* order paca.run and cur_cpu_spec */ |
1011 |
+ isync /* In case code patching happened */ |
1012 |
+ |
1013 |
+- /* Create a temp kernel stack for use before relocation is on. */ |
1014 |
+- ld r1,PACAEMERGSP(r13) |
1015 |
+- subi r1,r1,STACK_FRAME_OVERHEAD |
1016 |
+- |
1017 |
+ b __secondary_start |
1018 |
+ #endif /* SMP */ |
1019 |
+ |
1020 |
+diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c |
1021 |
+index 7e0722b62cae9..b3aa0cea6283f 100644 |
1022 |
+--- a/arch/powerpc/kernel/rtas.c |
1023 |
++++ b/arch/powerpc/kernel/rtas.c |
1024 |
+@@ -1095,7 +1095,7 @@ static struct rtas_filter rtas_filters[] __ro_after_init = { |
1025 |
+ { "ibm,display-message", -1, 0, -1, -1, -1 }, |
1026 |
+ { "ibm,errinjct", -1, 2, -1, -1, -1, 1024 }, |
1027 |
+ { "ibm,close-errinjct", -1, -1, -1, -1, -1 }, |
1028 |
+- { "ibm,open-errinct", -1, -1, -1, -1, -1 }, |
1029 |
++ { "ibm,open-errinjct", -1, -1, -1, -1, -1 }, |
1030 |
+ { "ibm,get-config-addr-info2", -1, -1, -1, -1, -1 }, |
1031 |
+ { "ibm,get-dynamic-sensor-state", -1, 1, -1, -1, -1 }, |
1032 |
+ { "ibm,get-indices", -1, 2, 3, -1, -1 }, |
1033 |
+diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c |
1034 |
+index 508244bcf19c2..7787a26d47777 100644 |
1035 |
+--- a/arch/powerpc/kernel/setup-common.c |
1036 |
++++ b/arch/powerpc/kernel/setup-common.c |
1037 |
+@@ -929,8 +929,6 @@ void __init setup_arch(char **cmdline_p) |
1038 |
+ |
1039 |
+ /* On BookE, setup per-core TLB data structures. */ |
1040 |
+ setup_tlb_core_data(); |
1041 |
+- |
1042 |
+- smp_release_cpus(); |
1043 |
+ #endif |
1044 |
+ |
1045 |
+ /* Print various info about the machine that has been gathered so far. */ |
1046 |
+@@ -964,6 +962,8 @@ void __init setup_arch(char **cmdline_p) |
1047 |
+ exc_lvl_early_init(); |
1048 |
+ emergency_stack_init(); |
1049 |
+ |
1050 |
++ smp_release_cpus(); |
1051 |
++ |
1052 |
+ initmem_init(); |
1053 |
+ |
1054 |
+ #ifdef CONFIG_DUMMY_CONSOLE |
1055 |
+diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c |
1056 |
+index d407b73298171..70de138228286 100644 |
1057 |
+--- a/arch/powerpc/perf/core-book3s.c |
1058 |
++++ b/arch/powerpc/perf/core-book3s.c |
1059 |
+@@ -2058,6 +2058,16 @@ static void record_and_restart(struct perf_event *event, unsigned long val, |
1060 |
+ local64_set(&event->hw.period_left, left); |
1061 |
+ perf_event_update_userpage(event); |
1062 |
+ |
1063 |
++ /* |
1064 |
++ * Due to hardware limitation, sometimes SIAR could sample a kernel |
1065 |
++ * address even when freeze on supervisor state (kernel) is set in |
1066 |
++ * MMCR2. Check attr.exclude_kernel and address to drop the sample in |
1067 |
++ * these cases. |
1068 |
++ */ |
1069 |
++ if (event->attr.exclude_kernel && record) |
1070 |
++ if (is_kernel_addr(mfspr(SPRN_SIAR))) |
1071 |
++ record = 0; |
1072 |
++ |
1073 |
+ /* |
1074 |
+ * Finally record data if requested. |
1075 |
+ */ |
1076 |
+diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c |
1077 |
+index 84d038ed3882a..ce6597a29bc9f 100644 |
1078 |
+--- a/arch/powerpc/platforms/powernv/memtrace.c |
1079 |
++++ b/arch/powerpc/platforms/powernv/memtrace.c |
1080 |
+@@ -33,6 +33,7 @@ struct memtrace_entry { |
1081 |
+ char name[16]; |
1082 |
+ }; |
1083 |
+ |
1084 |
++static DEFINE_MUTEX(memtrace_mutex); |
1085 |
+ static u64 memtrace_size; |
1086 |
+ |
1087 |
+ static struct memtrace_entry *memtrace_array; |
1088 |
+@@ -70,6 +71,23 @@ static int change_memblock_state(struct memory_block *mem, void *arg) |
1089 |
+ return 0; |
1090 |
+ } |
1091 |
+ |
1092 |
++static void memtrace_clear_range(unsigned long start_pfn, |
1093 |
++ unsigned long nr_pages) |
1094 |
++{ |
1095 |
++ unsigned long pfn; |
1096 |
++ |
1097 |
++ /* |
1098 |
++ * As pages are offline, we cannot trust the memmap anymore. As HIGHMEM |
1099 |
++ * does not apply, avoid passing around "struct page" and use |
1100 |
++ * clear_page() instead directly. |
1101 |
++ */ |
1102 |
++ for (pfn = start_pfn; pfn < start_pfn + nr_pages; pfn++) { |
1103 |
++ if (IS_ALIGNED(pfn, PAGES_PER_SECTION)) |
1104 |
++ cond_resched(); |
1105 |
++ clear_page(__va(PFN_PHYS(pfn))); |
1106 |
++ } |
1107 |
++} |
1108 |
++ |
1109 |
+ /* called with device_hotplug_lock held */ |
1110 |
+ static bool memtrace_offline_pages(u32 nid, u64 start_pfn, u64 nr_pages) |
1111 |
+ { |
1112 |
+@@ -114,6 +132,11 @@ static u64 memtrace_alloc_node(u32 nid, u64 size) |
1113 |
+ lock_device_hotplug(); |
1114 |
+ for (base_pfn = end_pfn; base_pfn > start_pfn; base_pfn -= nr_pages) { |
1115 |
+ if (memtrace_offline_pages(nid, base_pfn, nr_pages) == true) { |
1116 |
++ /* |
1117 |
++ * Clear the range while we still have a linear |
1118 |
++ * mapping. |
1119 |
++ */ |
1120 |
++ memtrace_clear_range(base_pfn, nr_pages); |
1121 |
+ /* |
1122 |
+ * Remove memory in memory block size chunks so that |
1123 |
+ * iomem resources are always split to the same size and |
1124 |
+@@ -272,6 +295,7 @@ static int memtrace_online(void) |
1125 |
+ |
1126 |
+ static int memtrace_enable_set(void *data, u64 val) |
1127 |
+ { |
1128 |
++ int rc = -EAGAIN; |
1129 |
+ u64 bytes; |
1130 |
+ |
1131 |
+ /* |
1132 |
+@@ -284,25 +308,31 @@ static int memtrace_enable_set(void *data, u64 val) |
1133 |
+ return -EINVAL; |
1134 |
+ } |
1135 |
+ |
1136 |
++ mutex_lock(&memtrace_mutex); |
1137 |
++ |
1138 |
+ /* Re-add/online previously removed/offlined memory */ |
1139 |
+ if (memtrace_size) { |
1140 |
+ if (memtrace_online()) |
1141 |
+- return -EAGAIN; |
1142 |
++ goto out_unlock; |
1143 |
+ } |
1144 |
+ |
1145 |
+- if (!val) |
1146 |
+- return 0; |
1147 |
++ if (!val) { |
1148 |
++ rc = 0; |
1149 |
++ goto out_unlock; |
1150 |
++ } |
1151 |
+ |
1152 |
+ /* Offline and remove memory */ |
1153 |
+ if (memtrace_init_regions_runtime(val)) |
1154 |
+- return -EINVAL; |
1155 |
++ goto out_unlock; |
1156 |
+ |
1157 |
+ if (memtrace_init_debugfs()) |
1158 |
+- return -EINVAL; |
1159 |
++ goto out_unlock; |
1160 |
+ |
1161 |
+ memtrace_size = val; |
1162 |
+- |
1163 |
+- return 0; |
1164 |
++ rc = 0; |
1165 |
++out_unlock: |
1166 |
++ mutex_unlock(&memtrace_mutex); |
1167 |
++ return rc; |
1168 |
+ } |
1169 |
+ |
1170 |
+ static int memtrace_enable_get(void *data, u64 *val) |
1171 |
+diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c |
1172 |
+index 52a021e1f86bf..5414d3295e0a1 100644 |
1173 |
+--- a/arch/powerpc/platforms/pseries/suspend.c |
1174 |
++++ b/arch/powerpc/platforms/pseries/suspend.c |
1175 |
+@@ -26,7 +26,6 @@ |
1176 |
+ #include <asm/mmu.h> |
1177 |
+ #include <asm/rtas.h> |
1178 |
+ #include <asm/topology.h> |
1179 |
+-#include "../../kernel/cacheinfo.h" |
1180 |
+ |
1181 |
+ static u64 stream_id; |
1182 |
+ static struct device suspend_dev; |
1183 |
+@@ -91,9 +90,7 @@ static void pseries_suspend_enable_irqs(void) |
1184 |
+ * Update configuration which can be modified based on device tree |
1185 |
+ * changes during resume. |
1186 |
+ */ |
1187 |
+- cacheinfo_cpu_offline(smp_processor_id()); |
1188 |
+ post_mobility_fixup(); |
1189 |
+- cacheinfo_cpu_online(smp_processor_id()); |
1190 |
+ } |
1191 |
+ |
1192 |
+ /** |
1193 |
+@@ -223,7 +220,6 @@ static struct bus_type suspend_subsys = { |
1194 |
+ |
1195 |
+ static const struct platform_suspend_ops pseries_suspend_ops = { |
1196 |
+ .valid = suspend_valid_only_mem, |
1197 |
+- .begin = pseries_suspend_begin, |
1198 |
+ .prepare_late = pseries_prepare_late, |
1199 |
+ .enter = pseries_suspend_enter, |
1200 |
+ }; |
1201 |
+diff --git a/arch/powerpc/xmon/nonstdio.c b/arch/powerpc/xmon/nonstdio.c |
1202 |
+index d00123421e007..eefe1b94e0aad 100644 |
1203 |
+--- a/arch/powerpc/xmon/nonstdio.c |
1204 |
++++ b/arch/powerpc/xmon/nonstdio.c |
1205 |
+@@ -182,7 +182,7 @@ void xmon_printf(const char *format, ...) |
1206 |
+ |
1207 |
+ if (n && rc == 0) { |
1208 |
+ /* No udbg hooks, fallback to printk() - dangerous */ |
1209 |
+- printk("%s", xmon_outbuf); |
1210 |
++ pr_cont("%s", xmon_outbuf); |
1211 |
+ } |
1212 |
+ } |
1213 |
+ |
1214 |
+diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c |
1215 |
+index 888f247c9261a..c47bd581a08a9 100644 |
1216 |
+--- a/arch/s390/kernel/smp.c |
1217 |
++++ b/arch/s390/kernel/smp.c |
1218 |
+@@ -863,24 +863,12 @@ static void smp_start_secondary(void *cpuvoid) |
1219 |
+ /* Upping and downing of CPUs */ |
1220 |
+ int __cpu_up(unsigned int cpu, struct task_struct *tidle) |
1221 |
+ { |
1222 |
+- struct pcpu *pcpu; |
1223 |
+- int base, i, rc; |
1224 |
++ struct pcpu *pcpu = pcpu_devices + cpu; |
1225 |
++ int rc; |
1226 |
+ |
1227 |
+- pcpu = pcpu_devices + cpu; |
1228 |
+ if (pcpu->state != CPU_STATE_CONFIGURED) |
1229 |
+ return -EIO; |
1230 |
+- base = smp_get_base_cpu(cpu); |
1231 |
+- for (i = 0; i <= smp_cpu_mtid; i++) { |
1232 |
+- if (base + i < nr_cpu_ids) |
1233 |
+- if (cpu_online(base + i)) |
1234 |
+- break; |
1235 |
+- } |
1236 |
+- /* |
1237 |
+- * If this is the first CPU of the core to get online |
1238 |
+- * do an initial CPU reset. |
1239 |
+- */ |
1240 |
+- if (i > smp_cpu_mtid && |
1241 |
+- pcpu_sigp_retry(pcpu_devices + base, SIGP_INITIAL_CPU_RESET, 0) != |
1242 |
++ if (pcpu_sigp_retry(pcpu, SIGP_INITIAL_CPU_RESET, 0) != |
1243 |
+ SIGP_CC_ORDER_CODE_ACCEPTED) |
1244 |
+ return -EIO; |
1245 |
+ |
1246 |
+diff --git a/arch/s390/purgatory/head.S b/arch/s390/purgatory/head.S |
1247 |
+index 2e3707b12eddb..9b2d7a71fd1bd 100644 |
1248 |
+--- a/arch/s390/purgatory/head.S |
1249 |
++++ b/arch/s390/purgatory/head.S |
1250 |
+@@ -61,14 +61,15 @@ |
1251 |
+ jh 10b |
1252 |
+ .endm |
1253 |
+ |
1254 |
+-.macro START_NEXT_KERNEL base |
1255 |
++.macro START_NEXT_KERNEL base subcode |
1256 |
+ lg %r4,kernel_entry-\base(%r13) |
1257 |
+ lg %r5,load_psw_mask-\base(%r13) |
1258 |
+ ogr %r4,%r5 |
1259 |
+ stg %r4,0(%r0) |
1260 |
+ |
1261 |
+ xgr %r0,%r0 |
1262 |
+- diag %r0,%r0,0x308 |
1263 |
++ lghi %r1,\subcode |
1264 |
++ diag %r0,%r1,0x308 |
1265 |
+ .endm |
1266 |
+ |
1267 |
+ .text |
1268 |
+@@ -123,7 +124,7 @@ ENTRY(purgatory_start) |
1269 |
+ je .start_crash_kernel |
1270 |
+ |
1271 |
+ /* start normal kernel */ |
1272 |
+- START_NEXT_KERNEL .base_crash |
1273 |
++ START_NEXT_KERNEL .base_crash 0 |
1274 |
+ |
1275 |
+ .return_old_kernel: |
1276 |
+ lmg %r6,%r15,gprregs-.base_crash(%r13) |
1277 |
+@@ -227,7 +228,7 @@ ENTRY(purgatory_start) |
1278 |
+ MEMCPY %r9,%r10,%r11 |
1279 |
+ |
1280 |
+ /* start crash kernel */ |
1281 |
+- START_NEXT_KERNEL .base_dst |
1282 |
++ START_NEXT_KERNEL .base_dst 1 |
1283 |
+ |
1284 |
+ |
1285 |
+ load_psw_mask: |
1286 |
+diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c |
1287 |
+index 3fd7c3efdb18d..9cffbbb15c569 100644 |
1288 |
+--- a/arch/um/drivers/chan_user.c |
1289 |
++++ b/arch/um/drivers/chan_user.c |
1290 |
+@@ -26,10 +26,10 @@ int generic_read(int fd, char *c_out, void *unused) |
1291 |
+ n = read(fd, c_out, sizeof(*c_out)); |
1292 |
+ if (n > 0) |
1293 |
+ return n; |
1294 |
+- else if (errno == EAGAIN) |
1295 |
+- return 0; |
1296 |
+ else if (n == 0) |
1297 |
+ return -EIO; |
1298 |
++ else if (errno == EAGAIN) |
1299 |
++ return 0; |
1300 |
+ return -errno; |
1301 |
+ } |
1302 |
+ |
1303 |
+diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c |
1304 |
+index 20e30be44795b..e3b422ebce09f 100644 |
1305 |
+--- a/arch/um/drivers/xterm.c |
1306 |
++++ b/arch/um/drivers/xterm.c |
1307 |
+@@ -18,6 +18,7 @@ |
1308 |
+ struct xterm_chan { |
1309 |
+ int pid; |
1310 |
+ int helper_pid; |
1311 |
++ int chan_fd; |
1312 |
+ char *title; |
1313 |
+ int device; |
1314 |
+ int raw; |
1315 |
+@@ -33,6 +34,7 @@ static void *xterm_init(char *str, int device, const struct chan_opts *opts) |
1316 |
+ return NULL; |
1317 |
+ *data = ((struct xterm_chan) { .pid = -1, |
1318 |
+ .helper_pid = -1, |
1319 |
++ .chan_fd = -1, |
1320 |
+ .device = device, |
1321 |
+ .title = opts->xterm_title, |
1322 |
+ .raw = opts->raw } ); |
1323 |
+@@ -149,6 +151,7 @@ static int xterm_open(int input, int output, int primary, void *d, |
1324 |
+ goto out_kill; |
1325 |
+ } |
1326 |
+ |
1327 |
++ data->chan_fd = fd; |
1328 |
+ new = xterm_fd(fd, &data->helper_pid); |
1329 |
+ if (new < 0) { |
1330 |
+ err = new; |
1331 |
+@@ -206,6 +209,8 @@ static void xterm_close(int fd, void *d) |
1332 |
+ os_kill_process(data->helper_pid, 0); |
1333 |
+ data->helper_pid = -1; |
1334 |
+ |
1335 |
++ if (data->chan_fd != -1) |
1336 |
++ os_close_file(data->chan_fd); |
1337 |
+ os_close_file(fd); |
1338 |
+ } |
1339 |
+ |
1340 |
+diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c |
1341 |
+index 365823010346a..90ef404622805 100644 |
1342 |
+--- a/arch/um/os-Linux/irq.c |
1343 |
++++ b/arch/um/os-Linux/irq.c |
1344 |
+@@ -48,7 +48,7 @@ int os_epoll_triggered(int index, int events) |
1345 |
+ int os_event_mask(int irq_type) |
1346 |
+ { |
1347 |
+ if (irq_type == IRQ_READ) |
1348 |
+- return EPOLLIN | EPOLLPRI; |
1349 |
++ return EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP | EPOLLRDHUP; |
1350 |
+ if (irq_type == IRQ_WRITE) |
1351 |
+ return EPOLLOUT; |
1352 |
+ return 0; |
1353 |
+diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h |
1354 |
+index 3c1e51ead0722..cd2aa72e21239 100644 |
1355 |
+--- a/arch/x86/include/asm/apic.h |
1356 |
++++ b/arch/x86/include/asm/apic.h |
1357 |
+@@ -252,6 +252,7 @@ static inline u64 native_x2apic_icr_read(void) |
1358 |
+ |
1359 |
+ extern int x2apic_mode; |
1360 |
+ extern int x2apic_phys; |
1361 |
++extern void __init x2apic_set_max_apicid(u32 apicid); |
1362 |
+ extern void __init check_x2apic(void); |
1363 |
+ extern void x2apic_setup(void); |
1364 |
+ static inline int x2apic_enabled(void) |
1365 |
+diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h |
1366 |
+index 71ea49e7db747..02806d95ad6ee 100644 |
1367 |
+--- a/arch/x86/include/asm/pgtable_types.h |
1368 |
++++ b/arch/x86/include/asm/pgtable_types.h |
1369 |
+@@ -148,6 +148,7 @@ enum page_cache_mode { |
1370 |
+ #endif |
1371 |
+ |
1372 |
+ #define _PAGE_CACHE_MASK (_PAGE_PAT | _PAGE_PCD | _PAGE_PWT) |
1373 |
++#define _PAGE_LARGE_CACHE_MASK (_PAGE_PWT | _PAGE_PCD | _PAGE_PAT_LARGE) |
1374 |
+ #define _PAGE_NOCACHE (cachemode2protval(_PAGE_CACHE_MODE_UC)) |
1375 |
+ #define _PAGE_CACHE_WP (cachemode2protval(_PAGE_CACHE_MODE_WP)) |
1376 |
+ |
1377 |
+diff --git a/arch/x86/include/asm/sync_core.h b/arch/x86/include/asm/sync_core.h |
1378 |
+index c67caafd33817..43b5e02a7b4b9 100644 |
1379 |
+--- a/arch/x86/include/asm/sync_core.h |
1380 |
++++ b/arch/x86/include/asm/sync_core.h |
1381 |
+@@ -16,12 +16,13 @@ static inline void sync_core_before_usermode(void) |
1382 |
+ /* With PTI, we unconditionally serialize before running user code. */ |
1383 |
+ if (static_cpu_has(X86_FEATURE_PTI)) |
1384 |
+ return; |
1385 |
++ |
1386 |
+ /* |
1387 |
+- * Return from interrupt and NMI is done through iret, which is core |
1388 |
+- * serializing. |
1389 |
++ * Even if we're in an interrupt, we might reschedule before returning, |
1390 |
++ * in which case we could switch to a different thread in the same mm |
1391 |
++ * and return using SYSRET or SYSEXIT. Instead of trying to keep |
1392 |
++ * track of our need to sync the core, just sync right away. |
1393 |
+ */ |
1394 |
+- if (in_irq() || in_nmi()) |
1395 |
+- return; |
1396 |
+ sync_core(); |
1397 |
+ } |
1398 |
+ |
1399 |
+diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c |
1400 |
+index e9456a2eef585..ab8187271d470 100644 |
1401 |
+--- a/arch/x86/kernel/apic/apic.c |
1402 |
++++ b/arch/x86/kernel/apic/apic.c |
1403 |
+@@ -1813,20 +1813,22 @@ static __init void try_to_enable_x2apic(int remap_mode) |
1404 |
+ return; |
1405 |
+ |
1406 |
+ if (remap_mode != IRQ_REMAP_X2APIC_MODE) { |
1407 |
+- /* IR is required if there is APIC ID > 255 even when running |
1408 |
+- * under KVM |
1409 |
++ /* |
1410 |
++ * Using X2APIC without IR is not architecturally supported |
1411 |
++ * on bare metal but may be supported in guests. |
1412 |
+ */ |
1413 |
+- if (max_physical_apicid > 255 || |
1414 |
+- !x86_init.hyper.x2apic_available()) { |
1415 |
++ if (!x86_init.hyper.x2apic_available()) { |
1416 |
+ pr_info("x2apic: IRQ remapping doesn't support X2APIC mode\n"); |
1417 |
+ x2apic_disable(); |
1418 |
+ return; |
1419 |
+ } |
1420 |
+ |
1421 |
+ /* |
1422 |
+- * without IR all CPUs can be addressed by IOAPIC/MSI |
1423 |
+- * only in physical mode |
1424 |
++ * Without IR, all CPUs can be addressed by IOAPIC/MSI only |
1425 |
++ * in physical mode, and CPUs with an APIC ID that cannnot |
1426 |
++ * be addressed must not be brought online. |
1427 |
+ */ |
1428 |
++ x2apic_set_max_apicid(255); |
1429 |
+ x2apic_phys = 1; |
1430 |
+ } |
1431 |
+ x2apic_enable(); |
1432 |
+diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c |
1433 |
+index 8b7e0b46e86ea..f0d0535e8f345 100644 |
1434 |
+--- a/arch/x86/kernel/apic/vector.c |
1435 |
++++ b/arch/x86/kernel/apic/vector.c |
1436 |
+@@ -274,20 +274,24 @@ static int assign_irq_vector_any_locked(struct irq_data *irqd) |
1437 |
+ const struct cpumask *affmsk = irq_data_get_affinity_mask(irqd); |
1438 |
+ int node = irq_data_get_node(irqd); |
1439 |
+ |
1440 |
+- if (node == NUMA_NO_NODE) |
1441 |
+- goto all; |
1442 |
+- /* Try the intersection of @affmsk and node mask */ |
1443 |
+- cpumask_and(vector_searchmask, cpumask_of_node(node), affmsk); |
1444 |
+- if (!assign_vector_locked(irqd, vector_searchmask)) |
1445 |
+- return 0; |
1446 |
+- /* Try the node mask */ |
1447 |
+- if (!assign_vector_locked(irqd, cpumask_of_node(node))) |
1448 |
+- return 0; |
1449 |
+-all: |
1450 |
++ if (node != NUMA_NO_NODE) { |
1451 |
++ /* Try the intersection of @affmsk and node mask */ |
1452 |
++ cpumask_and(vector_searchmask, cpumask_of_node(node), affmsk); |
1453 |
++ if (!assign_vector_locked(irqd, vector_searchmask)) |
1454 |
++ return 0; |
1455 |
++ } |
1456 |
++ |
1457 |
+ /* Try the full affinity mask */ |
1458 |
+ cpumask_and(vector_searchmask, affmsk, cpu_online_mask); |
1459 |
+ if (!assign_vector_locked(irqd, vector_searchmask)) |
1460 |
+ return 0; |
1461 |
++ |
1462 |
++ if (node != NUMA_NO_NODE) { |
1463 |
++ /* Try the node mask */ |
1464 |
++ if (!assign_vector_locked(irqd, cpumask_of_node(node))) |
1465 |
++ return 0; |
1466 |
++ } |
1467 |
++ |
1468 |
+ /* Try the full online mask */ |
1469 |
+ return assign_vector_locked(irqd, cpu_online_mask); |
1470 |
+ } |
1471 |
+diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c |
1472 |
+index b5cf9e7b3830c..ed56d2850e96a 100644 |
1473 |
+--- a/arch/x86/kernel/apic/x2apic_phys.c |
1474 |
++++ b/arch/x86/kernel/apic/x2apic_phys.c |
1475 |
+@@ -13,6 +13,12 @@ |
1476 |
+ int x2apic_phys; |
1477 |
+ |
1478 |
+ static struct apic apic_x2apic_phys; |
1479 |
++static u32 x2apic_max_apicid __ro_after_init; |
1480 |
++ |
1481 |
++void __init x2apic_set_max_apicid(u32 apicid) |
1482 |
++{ |
1483 |
++ x2apic_max_apicid = apicid; |
1484 |
++} |
1485 |
+ |
1486 |
+ static int __init set_x2apic_phys_mode(char *arg) |
1487 |
+ { |
1488 |
+@@ -103,6 +109,9 @@ static int x2apic_phys_probe(void) |
1489 |
+ /* Common x2apic functions, also used by x2apic_cluster */ |
1490 |
+ int x2apic_apic_id_valid(u32 apicid) |
1491 |
+ { |
1492 |
++ if (x2apic_max_apicid && apicid > x2apic_max_apicid) |
1493 |
++ return 0; |
1494 |
++ |
1495 |
+ return 1; |
1496 |
+ } |
1497 |
+ |
1498 |
+diff --git a/arch/x86/kernel/cpu/intel_rdt.h b/arch/x86/kernel/cpu/intel_rdt.h |
1499 |
+index 2b483b739cf1b..8412234eabd35 100644 |
1500 |
+--- a/arch/x86/kernel/cpu/intel_rdt.h |
1501 |
++++ b/arch/x86/kernel/cpu/intel_rdt.h |
1502 |
+@@ -251,7 +251,6 @@ struct rftype { |
1503 |
+ * struct mbm_state - status for each MBM counter in each domain |
1504 |
+ * @chunks: Total data moved (multiply by rdt_group.mon_scale to get bytes) |
1505 |
+ * @prev_msr Value of IA32_QM_CTR for this RMID last time we read it |
1506 |
+- * @chunks_bw Total local data moved. Used for bandwidth calculation |
1507 |
+ * @prev_bw_msr:Value of previous IA32_QM_CTR for bandwidth counting |
1508 |
+ * @prev_bw The most recent bandwidth in MBps |
1509 |
+ * @delta_bw Difference between the current and previous bandwidth |
1510 |
+@@ -260,7 +259,6 @@ struct rftype { |
1511 |
+ struct mbm_state { |
1512 |
+ u64 chunks; |
1513 |
+ u64 prev_msr; |
1514 |
+- u64 chunks_bw; |
1515 |
+ u64 prev_bw_msr; |
1516 |
+ u32 prev_bw; |
1517 |
+ u32 delta_bw; |
1518 |
+diff --git a/arch/x86/kernel/cpu/intel_rdt_monitor.c b/arch/x86/kernel/cpu/intel_rdt_monitor.c |
1519 |
+index 3d4ec80a6bb96..5dfa5ab9a5ae2 100644 |
1520 |
+--- a/arch/x86/kernel/cpu/intel_rdt_monitor.c |
1521 |
++++ b/arch/x86/kernel/cpu/intel_rdt_monitor.c |
1522 |
+@@ -290,8 +290,6 @@ static void mbm_bw_count(u32 rmid, struct rmid_read *rr) |
1523 |
+ return; |
1524 |
+ |
1525 |
+ chunks = mbm_overflow_count(m->prev_bw_msr, tval); |
1526 |
+- m->chunks_bw += chunks; |
1527 |
+- m->chunks = m->chunks_bw; |
1528 |
+ cur_bw = (chunks * r->mon_scale) >> 20; |
1529 |
+ |
1530 |
+ if (m->delta_comp) |
1531 |
+@@ -461,15 +459,14 @@ static void mbm_update(struct rdt_domain *d, int rmid) |
1532 |
+ } |
1533 |
+ if (is_mbm_local_enabled()) { |
1534 |
+ rr.evtid = QOS_L3_MBM_LOCAL_EVENT_ID; |
1535 |
++ __mon_event_count(rmid, &rr); |
1536 |
+ |
1537 |
+ /* |
1538 |
+ * Call the MBA software controller only for the |
1539 |
+ * control groups and when user has enabled |
1540 |
+ * the software controller explicitly. |
1541 |
+ */ |
1542 |
+- if (!is_mba_sc(NULL)) |
1543 |
+- __mon_event_count(rmid, &rr); |
1544 |
+- else |
1545 |
++ if (is_mba_sc(NULL)) |
1546 |
+ mbm_bw_count(rmid, &rr); |
1547 |
+ } |
1548 |
+ } |
1549 |
+diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c |
1550 |
+index 07e290244ca94..dfc3ab44bc5d3 100644 |
1551 |
+--- a/arch/x86/kernel/kprobes/core.c |
1552 |
++++ b/arch/x86/kernel/kprobes/core.c |
1553 |
+@@ -1041,6 +1041,11 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr) |
1554 |
+ * So clear it by resetting the current kprobe: |
1555 |
+ */ |
1556 |
+ regs->flags &= ~X86_EFLAGS_TF; |
1557 |
++ /* |
1558 |
++ * Since the single step (trap) has been cancelled, |
1559 |
++ * we need to restore BTF here. |
1560 |
++ */ |
1561 |
++ restore_btf(); |
1562 |
+ |
1563 |
+ /* |
1564 |
+ * If the TF flag was set before the kprobe hit, |
1565 |
+diff --git a/arch/x86/lib/memcpy_64.S b/arch/x86/lib/memcpy_64.S |
1566 |
+index 9d05572370edc..84b0078272d1d 100644 |
1567 |
+--- a/arch/x86/lib/memcpy_64.S |
1568 |
++++ b/arch/x86/lib/memcpy_64.S |
1569 |
+@@ -14,8 +14,6 @@ |
1570 |
+ * to a jmp to memcpy_erms which does the REP; MOVSB mem copy. |
1571 |
+ */ |
1572 |
+ |
1573 |
+-.weak memcpy |
1574 |
+- |
1575 |
+ /* |
1576 |
+ * memcpy - Copy a memory block. |
1577 |
+ * |
1578 |
+@@ -28,7 +26,9 @@ |
1579 |
+ * rax original destination |
1580 |
+ */ |
1581 |
+ ENTRY(__memcpy) |
1582 |
+-ENTRY(memcpy) |
1583 |
++.weak memcpy |
1584 |
++.p2align 4, 0x90 |
1585 |
++memcpy: |
1586 |
+ ALTERNATIVE_2 "jmp memcpy_orig", "", X86_FEATURE_REP_GOOD, \ |
1587 |
+ "jmp memcpy_erms", X86_FEATURE_ERMS |
1588 |
+ |
1589 |
+diff --git a/arch/x86/lib/memmove_64.S b/arch/x86/lib/memmove_64.S |
1590 |
+index bbec69d8223bf..e1cfc880f42df 100644 |
1591 |
+--- a/arch/x86/lib/memmove_64.S |
1592 |
++++ b/arch/x86/lib/memmove_64.S |
1593 |
+@@ -25,8 +25,8 @@ |
1594 |
+ * rax: dest |
1595 |
+ */ |
1596 |
+ .weak memmove |
1597 |
+- |
1598 |
+-ENTRY(memmove) |
1599 |
++.p2align 4, 0x90 |
1600 |
++memmove: |
1601 |
+ ENTRY(__memmove) |
1602 |
+ |
1603 |
+ /* Handle more 32 bytes in loop */ |
1604 |
+diff --git a/arch/x86/lib/memset_64.S b/arch/x86/lib/memset_64.S |
1605 |
+index 9bc861c71e754..084189acdcd0d 100644 |
1606 |
+--- a/arch/x86/lib/memset_64.S |
1607 |
++++ b/arch/x86/lib/memset_64.S |
1608 |
+@@ -6,8 +6,6 @@ |
1609 |
+ #include <asm/alternative-asm.h> |
1610 |
+ #include <asm/export.h> |
1611 |
+ |
1612 |
+-.weak memset |
1613 |
+- |
1614 |
+ /* |
1615 |
+ * ISO C memset - set a memory block to a byte value. This function uses fast |
1616 |
+ * string to get better performance than the original function. The code is |
1617 |
+@@ -19,7 +17,9 @@ |
1618 |
+ * |
1619 |
+ * rax original destination |
1620 |
+ */ |
1621 |
+-ENTRY(memset) |
1622 |
++.weak memset |
1623 |
++.p2align 4, 0x90 |
1624 |
++memset: |
1625 |
+ ENTRY(__memset) |
1626 |
+ /* |
1627 |
+ * Some CPUs support enhanced REP MOVSB/STOSB feature. It is recommended |
1628 |
+diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c |
1629 |
+index fe7a12599d8eb..968d7005f4a72 100644 |
1630 |
+--- a/arch/x86/mm/ident_map.c |
1631 |
++++ b/arch/x86/mm/ident_map.c |
1632 |
+@@ -62,6 +62,7 @@ static int ident_p4d_init(struct x86_mapping_info *info, p4d_t *p4d_page, |
1633 |
+ unsigned long addr, unsigned long end) |
1634 |
+ { |
1635 |
+ unsigned long next; |
1636 |
++ int result; |
1637 |
+ |
1638 |
+ for (; addr < end; addr = next) { |
1639 |
+ p4d_t *p4d = p4d_page + p4d_index(addr); |
1640 |
+@@ -73,13 +74,20 @@ static int ident_p4d_init(struct x86_mapping_info *info, p4d_t *p4d_page, |
1641 |
+ |
1642 |
+ if (p4d_present(*p4d)) { |
1643 |
+ pud = pud_offset(p4d, 0); |
1644 |
+- ident_pud_init(info, pud, addr, next); |
1645 |
++ result = ident_pud_init(info, pud, addr, next); |
1646 |
++ if (result) |
1647 |
++ return result; |
1648 |
++ |
1649 |
+ continue; |
1650 |
+ } |
1651 |
+ pud = (pud_t *)info->alloc_pgt_page(info->context); |
1652 |
+ if (!pud) |
1653 |
+ return -ENOMEM; |
1654 |
+- ident_pud_init(info, pud, addr, next); |
1655 |
++ |
1656 |
++ result = ident_pud_init(info, pud, addr, next); |
1657 |
++ if (result) |
1658 |
++ return result; |
1659 |
++ |
1660 |
+ set_p4d(p4d, __p4d(__pa(pud) | info->kernpg_flag)); |
1661 |
+ } |
1662 |
+ |
1663 |
+diff --git a/arch/x86/mm/mem_encrypt_identity.c b/arch/x86/mm/mem_encrypt_identity.c |
1664 |
+index c9faf34cbb62e..1f25201de0afb 100644 |
1665 |
+--- a/arch/x86/mm/mem_encrypt_identity.c |
1666 |
++++ b/arch/x86/mm/mem_encrypt_identity.c |
1667 |
+@@ -47,8 +47,8 @@ |
1668 |
+ #define PMD_FLAGS_LARGE (__PAGE_KERNEL_LARGE_EXEC & ~_PAGE_GLOBAL) |
1669 |
+ |
1670 |
+ #define PMD_FLAGS_DEC PMD_FLAGS_LARGE |
1671 |
+-#define PMD_FLAGS_DEC_WP ((PMD_FLAGS_DEC & ~_PAGE_CACHE_MASK) | \ |
1672 |
+- (_PAGE_PAT | _PAGE_PWT)) |
1673 |
++#define PMD_FLAGS_DEC_WP ((PMD_FLAGS_DEC & ~_PAGE_LARGE_CACHE_MASK) | \ |
1674 |
++ (_PAGE_PAT_LARGE | _PAGE_PWT)) |
1675 |
+ |
1676 |
+ #define PMD_FLAGS_ENC (PMD_FLAGS_LARGE | _PAGE_ENC) |
1677 |
+ |
1678 |
+diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c |
1679 |
+index b72296bd04a29..2f41a34c8f574 100644 |
1680 |
+--- a/arch/x86/mm/tlb.c |
1681 |
++++ b/arch/x86/mm/tlb.c |
1682 |
+@@ -321,8 +321,14 @@ void switch_mm_irqs_off(struct mm_struct *prev, struct mm_struct *next, |
1683 |
+ /* |
1684 |
+ * The membarrier system call requires a full memory barrier and |
1685 |
+ * core serialization before returning to user-space, after |
1686 |
+- * storing to rq->curr. Writing to CR3 provides that full |
1687 |
+- * memory barrier and core serializing instruction. |
1688 |
++ * storing to rq->curr, when changing mm. This is because |
1689 |
++ * membarrier() sends IPIs to all CPUs that are in the target mm |
1690 |
++ * to make them issue memory barriers. However, if another CPU |
1691 |
++ * switches to/from the target mm concurrently with |
1692 |
++ * membarrier(), it can cause that CPU not to receive an IPI |
1693 |
++ * when it really should issue a memory barrier. Writing to CR3 |
1694 |
++ * provides that full memory barrier and core serializing |
1695 |
++ * instruction. |
1696 |
+ */ |
1697 |
+ if (real_prev == next) { |
1698 |
+ VM_WARN_ON(this_cpu_read(cpu_tlbstate.ctxs[prev_asid].ctx_id) != |
1699 |
+diff --git a/block/blk-mq.c b/block/blk-mq.c |
1700 |
+index db2db0b70d34f..0df43515ff949 100644 |
1701 |
+--- a/block/blk-mq.c |
1702 |
++++ b/block/blk-mq.c |
1703 |
+@@ -1118,6 +1118,23 @@ static void blk_mq_update_dispatch_busy(struct blk_mq_hw_ctx *hctx, bool busy) |
1704 |
+ |
1705 |
+ #define BLK_MQ_RESOURCE_DELAY 3 /* ms units */ |
1706 |
+ |
1707 |
++static void blk_mq_handle_dev_resource(struct request *rq, |
1708 |
++ struct list_head *list) |
1709 |
++{ |
1710 |
++ struct request *next = |
1711 |
++ list_first_entry_or_null(list, struct request, queuelist); |
1712 |
++ |
1713 |
++ /* |
1714 |
++ * If an I/O scheduler has been configured and we got a driver tag for |
1715 |
++ * the next request already, free it. |
1716 |
++ */ |
1717 |
++ if (next) |
1718 |
++ blk_mq_put_driver_tag(next); |
1719 |
++ |
1720 |
++ list_add(&rq->queuelist, list); |
1721 |
++ __blk_mq_requeue_request(rq); |
1722 |
++} |
1723 |
++ |
1724 |
+ /* |
1725 |
+ * Returns true if we did some work AND can potentially do more. |
1726 |
+ */ |
1727 |
+@@ -1185,17 +1202,7 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list, |
1728 |
+ |
1729 |
+ ret = q->mq_ops->queue_rq(hctx, &bd); |
1730 |
+ if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE) { |
1731 |
+- /* |
1732 |
+- * If an I/O scheduler has been configured and we got a |
1733 |
+- * driver tag for the next request already, free it |
1734 |
+- * again. |
1735 |
+- */ |
1736 |
+- if (!list_empty(list)) { |
1737 |
+- nxt = list_first_entry(list, struct request, queuelist); |
1738 |
+- blk_mq_put_driver_tag(nxt); |
1739 |
+- } |
1740 |
+- list_add(&rq->queuelist, list); |
1741 |
+- __blk_mq_requeue_request(rq); |
1742 |
++ blk_mq_handle_dev_resource(rq, list); |
1743 |
+ break; |
1744 |
+ } |
1745 |
+ |
1746 |
+diff --git a/crypto/af_alg.c b/crypto/af_alg.c |
1747 |
+index 272879d7b0d1f..d0276a4ed9876 100644 |
1748 |
+--- a/crypto/af_alg.c |
1749 |
++++ b/crypto/af_alg.c |
1750 |
+@@ -151,7 +151,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) |
1751 |
+ const u32 allowed = CRYPTO_ALG_KERN_DRIVER_ONLY; |
1752 |
+ struct sock *sk = sock->sk; |
1753 |
+ struct alg_sock *ask = alg_sk(sk); |
1754 |
+- struct sockaddr_alg *sa = (void *)uaddr; |
1755 |
++ struct sockaddr_alg_new *sa = (void *)uaddr; |
1756 |
+ const struct af_alg_type *type; |
1757 |
+ void *private; |
1758 |
+ int err; |
1759 |
+@@ -159,7 +159,11 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) |
1760 |
+ if (sock->state == SS_CONNECTED) |
1761 |
+ return -EINVAL; |
1762 |
+ |
1763 |
+- if (addr_len < sizeof(*sa)) |
1764 |
++ BUILD_BUG_ON(offsetof(struct sockaddr_alg_new, salg_name) != |
1765 |
++ offsetof(struct sockaddr_alg, salg_name)); |
1766 |
++ BUILD_BUG_ON(offsetof(struct sockaddr_alg, salg_name) != sizeof(*sa)); |
1767 |
++ |
1768 |
++ if (addr_len < sizeof(*sa) + 1) |
1769 |
+ return -EINVAL; |
1770 |
+ |
1771 |
+ /* If caller uses non-allowed flag, return error. */ |
1772 |
+@@ -167,7 +171,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) |
1773 |
+ return -EINVAL; |
1774 |
+ |
1775 |
+ sa->salg_type[sizeof(sa->salg_type) - 1] = 0; |
1776 |
+- sa->salg_name[sizeof(sa->salg_name) + addr_len - sizeof(*sa) - 1] = 0; |
1777 |
++ sa->salg_name[addr_len - sizeof(*sa) - 1] = 0; |
1778 |
+ |
1779 |
+ type = alg_get_type(sa->salg_type); |
1780 |
+ if (IS_ERR(type) && PTR_ERR(type) == -ENOENT) { |
1781 |
+diff --git a/crypto/ecdh.c b/crypto/ecdh.c |
1782 |
+index bf6300175b9cd..a6e1a5d43fa7a 100644 |
1783 |
+--- a/crypto/ecdh.c |
1784 |
++++ b/crypto/ecdh.c |
1785 |
+@@ -57,12 +57,13 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf, |
1786 |
+ return ecc_gen_privkey(ctx->curve_id, ctx->ndigits, |
1787 |
+ ctx->private_key); |
1788 |
+ |
1789 |
+- if (ecc_is_key_valid(ctx->curve_id, ctx->ndigits, |
1790 |
+- (const u64 *)params.key, params.key_size) < 0) |
1791 |
+- return -EINVAL; |
1792 |
+- |
1793 |
+ memcpy(ctx->private_key, params.key, params.key_size); |
1794 |
+ |
1795 |
++ if (ecc_is_key_valid(ctx->curve_id, ctx->ndigits, |
1796 |
++ ctx->private_key, params.key_size) < 0) { |
1797 |
++ memzero_explicit(ctx->private_key, params.key_size); |
1798 |
++ return -EINVAL; |
1799 |
++ } |
1800 |
+ return 0; |
1801 |
+ } |
1802 |
+ |
1803 |
+diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c |
1804 |
+index 67d97c0090a27..5d72baf60ac83 100644 |
1805 |
+--- a/drivers/acpi/acpi_pnp.c |
1806 |
++++ b/drivers/acpi/acpi_pnp.c |
1807 |
+@@ -320,6 +320,9 @@ static bool matching_id(const char *idstr, const char *list_id) |
1808 |
+ { |
1809 |
+ int i; |
1810 |
+ |
1811 |
++ if (strlen(idstr) != strlen(list_id)) |
1812 |
++ return false; |
1813 |
++ |
1814 |
+ if (memcmp(idstr, list_id, 3)) |
1815 |
+ return false; |
1816 |
+ |
1817 |
+diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c |
1818 |
+index ca735dc24d377..9617e58832719 100644 |
1819 |
+--- a/drivers/acpi/device_pm.c |
1820 |
++++ b/drivers/acpi/device_pm.c |
1821 |
+@@ -702,7 +702,7 @@ static void acpi_pm_notify_work_func(struct acpi_device_wakeup_context *context) |
1822 |
+ static DEFINE_MUTEX(acpi_wakeup_lock); |
1823 |
+ |
1824 |
+ static int __acpi_device_wakeup_enable(struct acpi_device *adev, |
1825 |
+- u32 target_state, int max_count) |
1826 |
++ u32 target_state) |
1827 |
+ { |
1828 |
+ struct acpi_device_wakeup *wakeup = &adev->wakeup; |
1829 |
+ acpi_status status; |
1830 |
+@@ -710,9 +710,10 @@ static int __acpi_device_wakeup_enable(struct acpi_device *adev, |
1831 |
+ |
1832 |
+ mutex_lock(&acpi_wakeup_lock); |
1833 |
+ |
1834 |
+- if (wakeup->enable_count >= max_count) |
1835 |
++ if (wakeup->enable_count >= INT_MAX) { |
1836 |
++ acpi_handle_info(adev->handle, "Wakeup enable count out of bounds!\n"); |
1837 |
+ goto out; |
1838 |
+- |
1839 |
++ } |
1840 |
+ if (wakeup->enable_count > 0) |
1841 |
+ goto inc; |
1842 |
+ |
1843 |
+@@ -749,7 +750,7 @@ out: |
1844 |
+ */ |
1845 |
+ static int acpi_device_wakeup_enable(struct acpi_device *adev, u32 target_state) |
1846 |
+ { |
1847 |
+- return __acpi_device_wakeup_enable(adev, target_state, 1); |
1848 |
++ return __acpi_device_wakeup_enable(adev, target_state); |
1849 |
+ } |
1850 |
+ |
1851 |
+ /** |
1852 |
+@@ -779,8 +780,12 @@ out: |
1853 |
+ mutex_unlock(&acpi_wakeup_lock); |
1854 |
+ } |
1855 |
+ |
1856 |
+-static int __acpi_pm_set_device_wakeup(struct device *dev, bool enable, |
1857 |
+- int max_count) |
1858 |
++/** |
1859 |
++ * acpi_pm_set_device_wakeup - Enable/disable remote wakeup for given device. |
1860 |
++ * @dev: Device to enable/disable to generate wakeup events. |
1861 |
++ * @enable: Whether to enable or disable the wakeup functionality. |
1862 |
++ */ |
1863 |
++int acpi_pm_set_device_wakeup(struct device *dev, bool enable) |
1864 |
+ { |
1865 |
+ struct acpi_device *adev; |
1866 |
+ int error; |
1867 |
+@@ -800,36 +805,14 @@ static int __acpi_pm_set_device_wakeup(struct device *dev, bool enable, |
1868 |
+ return 0; |
1869 |
+ } |
1870 |
+ |
1871 |
+- error = __acpi_device_wakeup_enable(adev, acpi_target_system_state(), |
1872 |
+- max_count); |
1873 |
++ error = __acpi_device_wakeup_enable(adev, acpi_target_system_state()); |
1874 |
+ if (!error) |
1875 |
+ dev_dbg(dev, "Wakeup enabled by ACPI\n"); |
1876 |
+ |
1877 |
+ return error; |
1878 |
+ } |
1879 |
+- |
1880 |
+-/** |
1881 |
+- * acpi_pm_set_device_wakeup - Enable/disable remote wakeup for given device. |
1882 |
+- * @dev: Device to enable/disable to generate wakeup events. |
1883 |
+- * @enable: Whether to enable or disable the wakeup functionality. |
1884 |
+- */ |
1885 |
+-int acpi_pm_set_device_wakeup(struct device *dev, bool enable) |
1886 |
+-{ |
1887 |
+- return __acpi_pm_set_device_wakeup(dev, enable, 1); |
1888 |
+-} |
1889 |
+ EXPORT_SYMBOL_GPL(acpi_pm_set_device_wakeup); |
1890 |
+ |
1891 |
+-/** |
1892 |
+- * acpi_pm_set_bridge_wakeup - Enable/disable remote wakeup for given bridge. |
1893 |
+- * @dev: Bridge device to enable/disable to generate wakeup events. |
1894 |
+- * @enable: Whether to enable or disable the wakeup functionality. |
1895 |
+- */ |
1896 |
+-int acpi_pm_set_bridge_wakeup(struct device *dev, bool enable) |
1897 |
+-{ |
1898 |
+- return __acpi_pm_set_device_wakeup(dev, enable, INT_MAX); |
1899 |
+-} |
1900 |
+-EXPORT_SYMBOL_GPL(acpi_pm_set_bridge_wakeup); |
1901 |
+- |
1902 |
+ /** |
1903 |
+ * acpi_dev_pm_low_power - Put ACPI device into a low-power state. |
1904 |
+ * @dev: Device to put into a low-power state. |
1905 |
+diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c |
1906 |
+index 316a0fc785e36..d3f9a320e880e 100644 |
1907 |
+--- a/drivers/acpi/resource.c |
1908 |
++++ b/drivers/acpi/resource.c |
1909 |
+@@ -549,7 +549,7 @@ static acpi_status acpi_dev_process_resource(struct acpi_resource *ares, |
1910 |
+ ret = c->preproc(ares, c->preproc_data); |
1911 |
+ if (ret < 0) { |
1912 |
+ c->error = ret; |
1913 |
+- return AE_CTRL_TERMINATE; |
1914 |
++ return AE_ABORT_METHOD; |
1915 |
+ } else if (ret > 0) { |
1916 |
+ return AE_OK; |
1917 |
+ } |
1918 |
+diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c |
1919 |
+index 93896c992245b..42af2f37ba4e1 100644 |
1920 |
+--- a/drivers/block/xen-blkback/xenbus.c |
1921 |
++++ b/drivers/block/xen-blkback/xenbus.c |
1922 |
+@@ -264,6 +264,7 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif) |
1923 |
+ |
1924 |
+ if (ring->xenblkd) { |
1925 |
+ kthread_stop(ring->xenblkd); |
1926 |
++ ring->xenblkd = NULL; |
1927 |
+ wake_up(&ring->shutdown_wq); |
1928 |
+ } |
1929 |
+ |
1930 |
+@@ -651,7 +652,8 @@ static int xen_blkbk_probe(struct xenbus_device *dev, |
1931 |
+ /* setup back pointer */ |
1932 |
+ be->blkif->be = be; |
1933 |
+ |
1934 |
+- err = xenbus_watch_pathfmt(dev, &be->backend_watch, backend_changed, |
1935 |
++ err = xenbus_watch_pathfmt(dev, &be->backend_watch, NULL, |
1936 |
++ backend_changed, |
1937 |
+ "%s/%s", dev->nodename, "physical-device"); |
1938 |
+ if (err) |
1939 |
+ goto fail; |
1940 |
+diff --git a/drivers/bluetooth/hci_h5.c b/drivers/bluetooth/hci_h5.c |
1941 |
+index 5a68cd4dd71cb..7ffeb37e8f202 100644 |
1942 |
+--- a/drivers/bluetooth/hci_h5.c |
1943 |
++++ b/drivers/bluetooth/hci_h5.c |
1944 |
+@@ -257,6 +257,9 @@ static int h5_close(struct hci_uart *hu) |
1945 |
+ skb_queue_purge(&h5->rel); |
1946 |
+ skb_queue_purge(&h5->unrel); |
1947 |
+ |
1948 |
++ kfree_skb(h5->rx_skb); |
1949 |
++ h5->rx_skb = NULL; |
1950 |
++ |
1951 |
+ if (h5->vnd && h5->vnd->close) |
1952 |
+ h5->vnd->close(h5); |
1953 |
+ |
1954 |
+diff --git a/drivers/bus/fsl-mc/fsl-mc-allocator.c b/drivers/bus/fsl-mc/fsl-mc-allocator.c |
1955 |
+index e906ecfe23dd8..9cb0733a03991 100644 |
1956 |
+--- a/drivers/bus/fsl-mc/fsl-mc-allocator.c |
1957 |
++++ b/drivers/bus/fsl-mc/fsl-mc-allocator.c |
1958 |
+@@ -292,8 +292,10 @@ int __must_check fsl_mc_object_allocate(struct fsl_mc_device *mc_dev, |
1959 |
+ goto error; |
1960 |
+ |
1961 |
+ mc_adev = resource->data; |
1962 |
+- if (!mc_adev) |
1963 |
++ if (!mc_adev) { |
1964 |
++ error = -EINVAL; |
1965 |
+ goto error; |
1966 |
++ } |
1967 |
+ |
1968 |
+ *new_mc_adev = mc_adev; |
1969 |
+ return 0; |
1970 |
+diff --git a/drivers/bus/mips_cdmm.c b/drivers/bus/mips_cdmm.c |
1971 |
+index 1b14256376d24..7c1da45be166e 100644 |
1972 |
+--- a/drivers/bus/mips_cdmm.c |
1973 |
++++ b/drivers/bus/mips_cdmm.c |
1974 |
+@@ -544,10 +544,8 @@ static void mips_cdmm_bus_discover(struct mips_cdmm_bus *bus) |
1975 |
+ dev_set_name(&dev->dev, "cdmm%u-%u", cpu, id); |
1976 |
+ ++id; |
1977 |
+ ret = device_register(&dev->dev); |
1978 |
+- if (ret) { |
1979 |
++ if (ret) |
1980 |
+ put_device(&dev->dev); |
1981 |
+- kfree(dev); |
1982 |
+- } |
1983 |
+ } |
1984 |
+ } |
1985 |
+ |
1986 |
+diff --git a/drivers/clk/clk-s2mps11.c b/drivers/clk/clk-s2mps11.c |
1987 |
+index 4080d4e78e8e4..f3aaefafba893 100644 |
1988 |
+--- a/drivers/clk/clk-s2mps11.c |
1989 |
++++ b/drivers/clk/clk-s2mps11.c |
1990 |
+@@ -211,6 +211,7 @@ static int s2mps11_clk_probe(struct platform_device *pdev) |
1991 |
+ return ret; |
1992 |
+ |
1993 |
+ err_reg: |
1994 |
++ of_node_put(s2mps11_clks[0].clk_np); |
1995 |
+ while (--i >= 0) |
1996 |
+ clkdev_drop(s2mps11_clks[i].lookup); |
1997 |
+ |
1998 |
+diff --git a/drivers/clk/mvebu/armada-37xx-xtal.c b/drivers/clk/mvebu/armada-37xx-xtal.c |
1999 |
+index 612d65ede10a0..5370514959e15 100644 |
2000 |
+--- a/drivers/clk/mvebu/armada-37xx-xtal.c |
2001 |
++++ b/drivers/clk/mvebu/armada-37xx-xtal.c |
2002 |
+@@ -15,8 +15,8 @@ |
2003 |
+ #include <linux/platform_device.h> |
2004 |
+ #include <linux/regmap.h> |
2005 |
+ |
2006 |
+-#define NB_GPIO1_LATCH 0xC |
2007 |
+-#define XTAL_MODE BIT(31) |
2008 |
++#define NB_GPIO1_LATCH 0x8 |
2009 |
++#define XTAL_MODE BIT(9) |
2010 |
+ |
2011 |
+ static int armada_3700_xtal_clock_probe(struct platform_device *pdev) |
2012 |
+ { |
2013 |
+diff --git a/drivers/clk/renesas/r9a06g032-clocks.c b/drivers/clk/renesas/r9a06g032-clocks.c |
2014 |
+index 6d2b568915597..6e03b467395b2 100644 |
2015 |
+--- a/drivers/clk/renesas/r9a06g032-clocks.c |
2016 |
++++ b/drivers/clk/renesas/r9a06g032-clocks.c |
2017 |
+@@ -51,7 +51,7 @@ struct r9a06g032_clkdesc { |
2018 |
+ u16 sel, g1, r1, g2, r2; |
2019 |
+ } dual; |
2020 |
+ }; |
2021 |
+-} __packed; |
2022 |
++}; |
2023 |
+ |
2024 |
+ #define I_GATE(_clk, _rst, _rdy, _midle, _scon, _mirack, _mistat) \ |
2025 |
+ { .gate = _clk, .reset = _rst, \ |
2026 |
+diff --git a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c |
2027 |
+index 9ac6c299e0744..19304d6b2c05d 100644 |
2028 |
+--- a/drivers/clk/sunxi-ng/ccu-sun50i-a64.c |
2029 |
++++ b/drivers/clk/sunxi-ng/ccu-sun50i-a64.c |
2030 |
+@@ -381,6 +381,7 @@ static struct clk_div_table ths_div_table[] = { |
2031 |
+ { .val = 1, .div = 2 }, |
2032 |
+ { .val = 2, .div = 4 }, |
2033 |
+ { .val = 3, .div = 6 }, |
2034 |
++ { /* Sentinel */ }, |
2035 |
+ }; |
2036 |
+ static const char * const ths_parents[] = { "osc24M" }; |
2037 |
+ static struct ccu_div ths_clk = { |
2038 |
+diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c |
2039 |
+index 61e3ba12773ea..d9789378caf55 100644 |
2040 |
+--- a/drivers/clk/sunxi-ng/ccu-sun8i-h3.c |
2041 |
++++ b/drivers/clk/sunxi-ng/ccu-sun8i-h3.c |
2042 |
+@@ -328,6 +328,7 @@ static struct clk_div_table ths_div_table[] = { |
2043 |
+ { .val = 1, .div = 2 }, |
2044 |
+ { .val = 2, .div = 4 }, |
2045 |
+ { .val = 3, .div = 6 }, |
2046 |
++ { /* Sentinel */ }, |
2047 |
+ }; |
2048 |
+ static SUNXI_CCU_DIV_TABLE_WITH_GATE(ths_clk, "ths", "osc24M", |
2049 |
+ 0x074, 0, 2, ths_div_table, BIT(31), 0); |
2050 |
+diff --git a/drivers/clk/tegra/clk-id.h b/drivers/clk/tegra/clk-id.h |
2051 |
+index de466b4446da9..0efcb200dde5a 100644 |
2052 |
+--- a/drivers/clk/tegra/clk-id.h |
2053 |
++++ b/drivers/clk/tegra/clk-id.h |
2054 |
+@@ -233,6 +233,7 @@ enum clk_id { |
2055 |
+ tegra_clk_sdmmc4, |
2056 |
+ tegra_clk_sdmmc4_8, |
2057 |
+ tegra_clk_se, |
2058 |
++ tegra_clk_se_10, |
2059 |
+ tegra_clk_soc_therm, |
2060 |
+ tegra_clk_soc_therm_8, |
2061 |
+ tegra_clk_sor0, |
2062 |
+diff --git a/drivers/clk/tegra/clk-tegra-periph.c b/drivers/clk/tegra/clk-tegra-periph.c |
2063 |
+index b137c5d34eec4..9d05fb48686db 100644 |
2064 |
+--- a/drivers/clk/tegra/clk-tegra-periph.c |
2065 |
++++ b/drivers/clk/tegra/clk-tegra-periph.c |
2066 |
+@@ -650,7 +650,7 @@ static struct tegra_periph_init_data periph_clks[] = { |
2067 |
+ INT8("host1x", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_HOST1X, 28, 0, tegra_clk_host1x_8), |
2068 |
+ INT8("host1x", mux_pllc4_out1_pllc_pllc4_out2_pllp_clkm_plla_pllc4_out0, CLK_SOURCE_HOST1X, 28, 0, tegra_clk_host1x_9), |
2069 |
+ INT8("se", mux_pllp_pllc2_c_c3_pllm_clkm, CLK_SOURCE_SE, 127, TEGRA_PERIPH_ON_APB, tegra_clk_se), |
2070 |
+- INT8("se", mux_pllp_pllc2_c_c3_clkm, CLK_SOURCE_SE, 127, TEGRA_PERIPH_ON_APB, tegra_clk_se), |
2071 |
++ INT8("se", mux_pllp_pllc2_c_c3_clkm, CLK_SOURCE_SE, 127, TEGRA_PERIPH_ON_APB, tegra_clk_se_10), |
2072 |
+ INT8("2d", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_2D, 21, 0, tegra_clk_gr2d_8), |
2073 |
+ INT8("3d", mux_pllm_pllc2_c_c3_pllp_plla, CLK_SOURCE_3D, 24, 0, tegra_clk_gr3d_8), |
2074 |
+ INT8("vic03", mux_pllm_pllc_pllp_plla_pllc2_c3_clkm, CLK_SOURCE_VIC03, 178, 0, tegra_clk_vic03), |
2075 |
+diff --git a/drivers/clk/ti/fapll.c b/drivers/clk/ti/fapll.c |
2076 |
+index 071af44b1ba85..e33ce851837e4 100644 |
2077 |
+--- a/drivers/clk/ti/fapll.c |
2078 |
++++ b/drivers/clk/ti/fapll.c |
2079 |
+@@ -497,6 +497,7 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, |
2080 |
+ { |
2081 |
+ struct clk_init_data *init; |
2082 |
+ struct fapll_synth *synth; |
2083 |
++ struct clk *clk = ERR_PTR(-ENOMEM); |
2084 |
+ |
2085 |
+ init = kzalloc(sizeof(*init), GFP_KERNEL); |
2086 |
+ if (!init) |
2087 |
+@@ -519,13 +520,19 @@ static struct clk * __init ti_fapll_synth_setup(struct fapll_data *fd, |
2088 |
+ synth->hw.init = init; |
2089 |
+ synth->clk_pll = pll_clk; |
2090 |
+ |
2091 |
+- return clk_register(NULL, &synth->hw); |
2092 |
++ clk = clk_register(NULL, &synth->hw); |
2093 |
++ if (IS_ERR(clk)) { |
2094 |
++ pr_err("failed to register clock\n"); |
2095 |
++ goto free; |
2096 |
++ } |
2097 |
++ |
2098 |
++ return clk; |
2099 |
+ |
2100 |
+ free: |
2101 |
+ kfree(synth); |
2102 |
+ kfree(init); |
2103 |
+ |
2104 |
+- return ERR_PTR(-ENOMEM); |
2105 |
++ return clk; |
2106 |
+ } |
2107 |
+ |
2108 |
+ static void __init ti_fapll_setup(struct device_node *node) |
2109 |
+diff --git a/drivers/clocksource/arm_arch_timer.c b/drivers/clocksource/arm_arch_timer.c |
2110 |
+index 0445ad7e559e5..e67ab217eef41 100644 |
2111 |
+--- a/drivers/clocksource/arm_arch_timer.c |
2112 |
++++ b/drivers/clocksource/arm_arch_timer.c |
2113 |
+@@ -827,15 +827,24 @@ static void arch_timer_evtstrm_enable(int divider) |
2114 |
+ |
2115 |
+ static void arch_timer_configure_evtstream(void) |
2116 |
+ { |
2117 |
+- int evt_stream_div, pos; |
2118 |
++ int evt_stream_div, lsb; |
2119 |
++ |
2120 |
++ /* |
2121 |
++ * As the event stream can at most be generated at half the frequency |
2122 |
++ * of the counter, use half the frequency when computing the divider. |
2123 |
++ */ |
2124 |
++ evt_stream_div = arch_timer_rate / ARCH_TIMER_EVT_STREAM_FREQ / 2; |
2125 |
++ |
2126 |
++ /* |
2127 |
++ * Find the closest power of two to the divisor. If the adjacent bit |
2128 |
++ * of lsb (last set bit, starts from 0) is set, then we use (lsb + 1). |
2129 |
++ */ |
2130 |
++ lsb = fls(evt_stream_div) - 1; |
2131 |
++ if (lsb > 0 && (evt_stream_div & BIT(lsb - 1))) |
2132 |
++ lsb++; |
2133 |
+ |
2134 |
+- /* Find the closest power of two to the divisor */ |
2135 |
+- evt_stream_div = arch_timer_rate / ARCH_TIMER_EVT_STREAM_FREQ; |
2136 |
+- pos = fls(evt_stream_div); |
2137 |
+- if (pos > 1 && !(evt_stream_div & (1 << (pos - 2)))) |
2138 |
+- pos--; |
2139 |
+ /* enable event stream */ |
2140 |
+- arch_timer_evtstrm_enable(min(pos, 15)); |
2141 |
++ arch_timer_evtstrm_enable(max(0, min(lsb, 15))); |
2142 |
+ } |
2143 |
+ |
2144 |
+ static void arch_counter_set_user_access(void) |
2145 |
+diff --git a/drivers/clocksource/cadence_ttc_timer.c b/drivers/clocksource/cadence_ttc_timer.c |
2146 |
+index 29d51755e18b2..a7eb858a84a0f 100644 |
2147 |
+--- a/drivers/clocksource/cadence_ttc_timer.c |
2148 |
++++ b/drivers/clocksource/cadence_ttc_timer.c |
2149 |
+@@ -419,10 +419,8 @@ static int __init ttc_setup_clockevent(struct clk *clk, |
2150 |
+ ttcce->ttc.clk = clk; |
2151 |
+ |
2152 |
+ err = clk_prepare_enable(ttcce->ttc.clk); |
2153 |
+- if (err) { |
2154 |
+- kfree(ttcce); |
2155 |
+- return err; |
2156 |
+- } |
2157 |
++ if (err) |
2158 |
++ goto out_kfree; |
2159 |
+ |
2160 |
+ ttcce->ttc.clk_rate_change_nb.notifier_call = |
2161 |
+ ttc_rate_change_clockevent_cb; |
2162 |
+@@ -432,7 +430,7 @@ static int __init ttc_setup_clockevent(struct clk *clk, |
2163 |
+ &ttcce->ttc.clk_rate_change_nb); |
2164 |
+ if (err) { |
2165 |
+ pr_warn("Unable to register clock notifier.\n"); |
2166 |
+- return err; |
2167 |
++ goto out_kfree; |
2168 |
+ } |
2169 |
+ |
2170 |
+ ttcce->ttc.freq = clk_get_rate(ttcce->ttc.clk); |
2171 |
+@@ -461,15 +459,17 @@ static int __init ttc_setup_clockevent(struct clk *clk, |
2172 |
+ |
2173 |
+ err = request_irq(irq, ttc_clock_event_interrupt, |
2174 |
+ IRQF_TIMER, ttcce->ce.name, ttcce); |
2175 |
+- if (err) { |
2176 |
+- kfree(ttcce); |
2177 |
+- return err; |
2178 |
+- } |
2179 |
++ if (err) |
2180 |
++ goto out_kfree; |
2181 |
+ |
2182 |
+ clockevents_config_and_register(&ttcce->ce, |
2183 |
+ ttcce->ttc.freq / PRESCALE, 1, 0xfffe); |
2184 |
+ |
2185 |
+ return 0; |
2186 |
++ |
2187 |
++out_kfree: |
2188 |
++ kfree(ttcce); |
2189 |
++ return err; |
2190 |
+ } |
2191 |
+ |
2192 |
+ /** |
2193 |
+diff --git a/drivers/cpufreq/highbank-cpufreq.c b/drivers/cpufreq/highbank-cpufreq.c |
2194 |
+index 1608f7105c9f8..ad743f2f31e78 100644 |
2195 |
+--- a/drivers/cpufreq/highbank-cpufreq.c |
2196 |
++++ b/drivers/cpufreq/highbank-cpufreq.c |
2197 |
+@@ -104,6 +104,13 @@ out_put_node: |
2198 |
+ } |
2199 |
+ module_init(hb_cpufreq_driver_init); |
2200 |
+ |
2201 |
++static const struct of_device_id __maybe_unused hb_cpufreq_of_match[] = { |
2202 |
++ { .compatible = "calxeda,highbank" }, |
2203 |
++ { .compatible = "calxeda,ecx-2000" }, |
2204 |
++ { }, |
2205 |
++}; |
2206 |
++MODULE_DEVICE_TABLE(of, hb_cpufreq_of_match); |
2207 |
++ |
2208 |
+ MODULE_AUTHOR("Mark Langsdorf <mark.langsdorf@×××××××.com>"); |
2209 |
+ MODULE_DESCRIPTION("Calxeda Highbank cpufreq driver"); |
2210 |
+ MODULE_LICENSE("GPL"); |
2211 |
+diff --git a/drivers/cpufreq/loongson1-cpufreq.c b/drivers/cpufreq/loongson1-cpufreq.c |
2212 |
+index be89416e2358f..9d902f67f8716 100644 |
2213 |
+--- a/drivers/cpufreq/loongson1-cpufreq.c |
2214 |
++++ b/drivers/cpufreq/loongson1-cpufreq.c |
2215 |
+@@ -217,6 +217,7 @@ static struct platform_driver ls1x_cpufreq_platdrv = { |
2216 |
+ |
2217 |
+ module_platform_driver(ls1x_cpufreq_platdrv); |
2218 |
+ |
2219 |
++MODULE_ALIAS("platform:ls1x-cpufreq"); |
2220 |
+ MODULE_AUTHOR("Kelvin Cheung <keguang.zhang@×××××.com>"); |
2221 |
+ MODULE_DESCRIPTION("Loongson1 CPUFreq driver"); |
2222 |
+ MODULE_LICENSE("GPL"); |
2223 |
+diff --git a/drivers/cpufreq/mediatek-cpufreq.c b/drivers/cpufreq/mediatek-cpufreq.c |
2224 |
+index eb8920d398181..5a81e20f02824 100644 |
2225 |
+--- a/drivers/cpufreq/mediatek-cpufreq.c |
2226 |
++++ b/drivers/cpufreq/mediatek-cpufreq.c |
2227 |
+@@ -554,6 +554,7 @@ static const struct of_device_id mtk_cpufreq_machines[] __initconst = { |
2228 |
+ |
2229 |
+ { } |
2230 |
+ }; |
2231 |
++MODULE_DEVICE_TABLE(of, mtk_cpufreq_machines); |
2232 |
+ |
2233 |
+ static int __init mtk_cpufreq_driver_init(void) |
2234 |
+ { |
2235 |
+diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c |
2236 |
+index 87a98ec77773a..0338885332a75 100644 |
2237 |
+--- a/drivers/cpufreq/scpi-cpufreq.c |
2238 |
++++ b/drivers/cpufreq/scpi-cpufreq.c |
2239 |
+@@ -246,6 +246,7 @@ static struct platform_driver scpi_cpufreq_platdrv = { |
2240 |
+ }; |
2241 |
+ module_platform_driver(scpi_cpufreq_platdrv); |
2242 |
+ |
2243 |
++MODULE_ALIAS("platform:scpi-cpufreq"); |
2244 |
+ MODULE_AUTHOR("Sudeep Holla <sudeep.holla@×××.com>"); |
2245 |
+ MODULE_DESCRIPTION("ARM SCPI CPUFreq interface driver"); |
2246 |
+ MODULE_LICENSE("GPL v2"); |
2247 |
+diff --git a/drivers/cpufreq/sti-cpufreq.c b/drivers/cpufreq/sti-cpufreq.c |
2248 |
+index 6b5d241c30b70..2d09960afa591 100644 |
2249 |
+--- a/drivers/cpufreq/sti-cpufreq.c |
2250 |
++++ b/drivers/cpufreq/sti-cpufreq.c |
2251 |
+@@ -295,6 +295,13 @@ register_cpufreq_dt: |
2252 |
+ } |
2253 |
+ module_init(sti_cpufreq_init); |
2254 |
+ |
2255 |
++static const struct of_device_id __maybe_unused sti_cpufreq_of_match[] = { |
2256 |
++ { .compatible = "st,stih407" }, |
2257 |
++ { .compatible = "st,stih410" }, |
2258 |
++ { }, |
2259 |
++}; |
2260 |
++MODULE_DEVICE_TABLE(of, sti_cpufreq_of_match); |
2261 |
++ |
2262 |
+ MODULE_DESCRIPTION("STMicroelectronics CPUFreq/OPP driver"); |
2263 |
+ MODULE_AUTHOR("Ajitpal Singh <ajitpal.singh@××.com>"); |
2264 |
+ MODULE_AUTHOR("Lee Jones <lee.jones@××××××.org>"); |
2265 |
+diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c |
2266 |
+index 68d5ea818b6c0..cd00afb5786e8 100644 |
2267 |
+--- a/drivers/crypto/amcc/crypto4xx_core.c |
2268 |
++++ b/drivers/crypto/amcc/crypto4xx_core.c |
2269 |
+@@ -926,7 +926,7 @@ int crypto4xx_build_pd(struct crypto_async_request *req, |
2270 |
+ } |
2271 |
+ |
2272 |
+ pd->pd_ctl.w = PD_CTL_HOST_READY | |
2273 |
+- ((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) | |
2274 |
++ ((crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AHASH) || |
2275 |
+ (crypto_tfm_alg_type(req->tfm) == CRYPTO_ALG_TYPE_AEAD) ? |
2276 |
+ PD_CTL_HASH_FINAL : 0); |
2277 |
+ pd->pd_ctl_len.w = 0x00400000 | (assoclen + datalen); |
2278 |
+diff --git a/drivers/crypto/inside-secure/safexcel.c b/drivers/crypto/inside-secure/safexcel.c |
2279 |
+index 86c699c14f849..bc6c5cb7de239 100644 |
2280 |
+--- a/drivers/crypto/inside-secure/safexcel.c |
2281 |
++++ b/drivers/crypto/inside-secure/safexcel.c |
2282 |
+@@ -1066,7 +1066,7 @@ static int safexcel_probe(struct platform_device *pdev) |
2283 |
+ |
2284 |
+ priv->ring[i].rdr_req = devm_kcalloc(dev, |
2285 |
+ EIP197_DEFAULT_RING_SIZE, |
2286 |
+- sizeof(priv->ring[i].rdr_req), |
2287 |
++ sizeof(*priv->ring[i].rdr_req), |
2288 |
+ GFP_KERNEL); |
2289 |
+ if (!priv->ring[i].rdr_req) { |
2290 |
+ ret = -ENOMEM; |
2291 |
+diff --git a/drivers/crypto/omap-aes.c b/drivers/crypto/omap-aes.c |
2292 |
+index 9019f6b67986b..a5d6e1a0192bc 100644 |
2293 |
+--- a/drivers/crypto/omap-aes.c |
2294 |
++++ b/drivers/crypto/omap-aes.c |
2295 |
+@@ -1163,7 +1163,7 @@ static int omap_aes_probe(struct platform_device *pdev) |
2296 |
+ if (err < 0) { |
2297 |
+ dev_err(dev, "%s: failed to get_sync(%d)\n", |
2298 |
+ __func__, err); |
2299 |
+- goto err_res; |
2300 |
++ goto err_pm_disable; |
2301 |
+ } |
2302 |
+ |
2303 |
+ omap_aes_dma_stop(dd); |
2304 |
+@@ -1276,6 +1276,7 @@ err_engine: |
2305 |
+ omap_aes_dma_cleanup(dd); |
2306 |
+ err_irq: |
2307 |
+ tasklet_kill(&dd->done_task); |
2308 |
++err_pm_disable: |
2309 |
+ pm_runtime_disable(dev); |
2310 |
+ err_res: |
2311 |
+ dd = NULL; |
2312 |
+diff --git a/drivers/crypto/qat/qat_common/qat_hal.c b/drivers/crypto/qat/qat_common/qat_hal.c |
2313 |
+index ff149e176f649..dac130bb807ae 100644 |
2314 |
+--- a/drivers/crypto/qat/qat_common/qat_hal.c |
2315 |
++++ b/drivers/crypto/qat/qat_common/qat_hal.c |
2316 |
+@@ -1189,7 +1189,7 @@ static int qat_hal_put_rel_rd_xfer(struct icp_qat_fw_loader_handle *handle, |
2317 |
+ unsigned short mask; |
2318 |
+ unsigned short dr_offset = 0x10; |
2319 |
+ |
2320 |
+- status = ctx_enables = qat_hal_rd_ae_csr(handle, ae, CTX_ENABLES); |
2321 |
++ ctx_enables = qat_hal_rd_ae_csr(handle, ae, CTX_ENABLES); |
2322 |
+ if (CE_INUSE_CONTEXTS & ctx_enables) { |
2323 |
+ if (ctx & 0x1) { |
2324 |
+ pr_err("QAT: bad 4-ctx mode,ctx=0x%x\n", ctx); |
2325 |
+diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c |
2326 |
+index ea16308fae0a5..c70a7c4f5b739 100644 |
2327 |
+--- a/drivers/crypto/talitos.c |
2328 |
++++ b/drivers/crypto/talitos.c |
2329 |
+@@ -474,7 +474,7 @@ DEF_TALITOS2_DONE(ch1_3, TALITOS2_ISR_CH_1_3_DONE) |
2330 |
+ /* |
2331 |
+ * locate current (offending) descriptor |
2332 |
+ */ |
2333 |
+-static u32 current_desc_hdr(struct device *dev, int ch) |
2334 |
++static __be32 current_desc_hdr(struct device *dev, int ch) |
2335 |
+ { |
2336 |
+ struct talitos_private *priv = dev_get_drvdata(dev); |
2337 |
+ int tail, iter; |
2338 |
+@@ -492,7 +492,7 @@ static u32 current_desc_hdr(struct device *dev, int ch) |
2339 |
+ |
2340 |
+ iter = tail; |
2341 |
+ while (priv->chan[ch].fifo[iter].dma_desc != cur_desc && |
2342 |
+- priv->chan[ch].fifo[iter].desc->next_desc != cur_desc) { |
2343 |
++ priv->chan[ch].fifo[iter].desc->next_desc != cpu_to_be32(cur_desc)) { |
2344 |
+ iter = (iter + 1) & (priv->fifo_len - 1); |
2345 |
+ if (iter == tail) { |
2346 |
+ dev_err(dev, "couldn't locate current descriptor\n"); |
2347 |
+@@ -500,7 +500,7 @@ static u32 current_desc_hdr(struct device *dev, int ch) |
2348 |
+ } |
2349 |
+ } |
2350 |
+ |
2351 |
+- if (priv->chan[ch].fifo[iter].desc->next_desc == cur_desc) { |
2352 |
++ if (priv->chan[ch].fifo[iter].desc->next_desc == cpu_to_be32(cur_desc)) { |
2353 |
+ struct talitos_edesc *edesc; |
2354 |
+ |
2355 |
+ edesc = container_of(priv->chan[ch].fifo[iter].desc, |
2356 |
+@@ -515,13 +515,13 @@ static u32 current_desc_hdr(struct device *dev, int ch) |
2357 |
+ /* |
2358 |
+ * user diagnostics; report root cause of error based on execution unit status |
2359 |
+ */ |
2360 |
+-static void report_eu_error(struct device *dev, int ch, u32 desc_hdr) |
2361 |
++static void report_eu_error(struct device *dev, int ch, __be32 desc_hdr) |
2362 |
+ { |
2363 |
+ struct talitos_private *priv = dev_get_drvdata(dev); |
2364 |
+ int i; |
2365 |
+ |
2366 |
+ if (!desc_hdr) |
2367 |
+- desc_hdr = in_be32(priv->chan[ch].reg + TALITOS_DESCBUF); |
2368 |
++ desc_hdr = cpu_to_be32(in_be32(priv->chan[ch].reg + TALITOS_DESCBUF)); |
2369 |
+ |
2370 |
+ switch (desc_hdr & DESC_HDR_SEL0_MASK) { |
2371 |
+ case DESC_HDR_SEL0_AFEU: |
2372 |
+diff --git a/drivers/dma/mv_xor_v2.c b/drivers/dma/mv_xor_v2.c |
2373 |
+index 8dc0aa4d73ab8..462adf7e4e952 100644 |
2374 |
+--- a/drivers/dma/mv_xor_v2.c |
2375 |
++++ b/drivers/dma/mv_xor_v2.c |
2376 |
+@@ -777,8 +777,10 @@ static int mv_xor_v2_probe(struct platform_device *pdev) |
2377 |
+ goto disable_clk; |
2378 |
+ |
2379 |
+ msi_desc = first_msi_entry(&pdev->dev); |
2380 |
+- if (!msi_desc) |
2381 |
++ if (!msi_desc) { |
2382 |
++ ret = -ENODEV; |
2383 |
+ goto free_msi_irqs; |
2384 |
++ } |
2385 |
+ xor_dev->msi_desc = msi_desc; |
2386 |
+ |
2387 |
+ ret = devm_request_irq(&pdev->dev, msi_desc->irq, |
2388 |
+diff --git a/drivers/edac/amd64_edac.c b/drivers/edac/amd64_edac.c |
2389 |
+index cbe4158531979..fe25c98380ad0 100644 |
2390 |
+--- a/drivers/edac/amd64_edac.c |
2391 |
++++ b/drivers/edac/amd64_edac.c |
2392 |
+@@ -18,6 +18,9 @@ static struct msr __percpu *msrs; |
2393 |
+ /* Per-node stuff */ |
2394 |
+ static struct ecc_settings **ecc_stngs; |
2395 |
+ |
2396 |
++/* Device for the PCI component */ |
2397 |
++static struct device *pci_ctl_dev; |
2398 |
++ |
2399 |
+ /* |
2400 |
+ * Valid scrub rates for the K8 hardware memory scrubber. We map the scrubbing |
2401 |
+ * bandwidth to a valid bit pattern. The 'set' operation finds the 'matching- |
2402 |
+@@ -2563,6 +2566,9 @@ reserve_mc_sibling_devs(struct amd64_pvt *pvt, u16 pci_id1, u16 pci_id2) |
2403 |
+ return -ENODEV; |
2404 |
+ } |
2405 |
+ |
2406 |
++ if (!pci_ctl_dev) |
2407 |
++ pci_ctl_dev = &pvt->F0->dev; |
2408 |
++ |
2409 |
+ edac_dbg(1, "F0: %s\n", pci_name(pvt->F0)); |
2410 |
+ edac_dbg(1, "F3: %s\n", pci_name(pvt->F3)); |
2411 |
+ edac_dbg(1, "F6: %s\n", pci_name(pvt->F6)); |
2412 |
+@@ -2587,6 +2593,9 @@ reserve_mc_sibling_devs(struct amd64_pvt *pvt, u16 pci_id1, u16 pci_id2) |
2413 |
+ return -ENODEV; |
2414 |
+ } |
2415 |
+ |
2416 |
++ if (!pci_ctl_dev) |
2417 |
++ pci_ctl_dev = &pvt->F2->dev; |
2418 |
++ |
2419 |
+ edac_dbg(1, "F1: %s\n", pci_name(pvt->F1)); |
2420 |
+ edac_dbg(1, "F2: %s\n", pci_name(pvt->F2)); |
2421 |
+ edac_dbg(1, "F3: %s\n", pci_name(pvt->F3)); |
2422 |
+@@ -3441,21 +3450,10 @@ static void remove_one_instance(unsigned int nid) |
2423 |
+ |
2424 |
+ static void setup_pci_device(void) |
2425 |
+ { |
2426 |
+- struct mem_ctl_info *mci; |
2427 |
+- struct amd64_pvt *pvt; |
2428 |
+- |
2429 |
+ if (pci_ctl) |
2430 |
+ return; |
2431 |
+ |
2432 |
+- mci = edac_mc_find(0); |
2433 |
+- if (!mci) |
2434 |
+- return; |
2435 |
+- |
2436 |
+- pvt = mci->pvt_info; |
2437 |
+- if (pvt->umc) |
2438 |
+- pci_ctl = edac_pci_create_generic_ctl(&pvt->F0->dev, EDAC_MOD_STR); |
2439 |
+- else |
2440 |
+- pci_ctl = edac_pci_create_generic_ctl(&pvt->F2->dev, EDAC_MOD_STR); |
2441 |
++ pci_ctl = edac_pci_create_generic_ctl(pci_ctl_dev, EDAC_MOD_STR); |
2442 |
+ if (!pci_ctl) { |
2443 |
+ pr_warn("%s(): Unable to create PCI control\n", __func__); |
2444 |
+ pr_warn("%s(): PCI error report via EDAC not set\n", __func__); |
2445 |
+@@ -3535,6 +3533,8 @@ static int __init amd64_edac_init(void) |
2446 |
+ return 0; |
2447 |
+ |
2448 |
+ err_pci: |
2449 |
++ pci_ctl_dev = NULL; |
2450 |
++ |
2451 |
+ msrs_free(msrs); |
2452 |
+ msrs = NULL; |
2453 |
+ |
2454 |
+@@ -3566,6 +3566,8 @@ static void __exit amd64_edac_exit(void) |
2455 |
+ kfree(ecc_stngs); |
2456 |
+ ecc_stngs = NULL; |
2457 |
+ |
2458 |
++ pci_ctl_dev = NULL; |
2459 |
++ |
2460 |
+ msrs_free(msrs); |
2461 |
+ msrs = NULL; |
2462 |
+ } |
2463 |
+diff --git a/drivers/extcon/extcon-max77693.c b/drivers/extcon/extcon-max77693.c |
2464 |
+index 227651ff9666a..c221a0aec0f37 100644 |
2465 |
+--- a/drivers/extcon/extcon-max77693.c |
2466 |
++++ b/drivers/extcon/extcon-max77693.c |
2467 |
+@@ -1275,4 +1275,4 @@ module_platform_driver(max77693_muic_driver); |
2468 |
+ MODULE_DESCRIPTION("Maxim MAX77693 Extcon driver"); |
2469 |
+ MODULE_AUTHOR("Chanwoo Choi <cw00.choi@×××××××.com>"); |
2470 |
+ MODULE_LICENSE("GPL"); |
2471 |
+-MODULE_ALIAS("platform:extcon-max77693"); |
2472 |
++MODULE_ALIAS("platform:max77693-muic"); |
2473 |
+diff --git a/drivers/gpio/gpio-eic-sprd.c b/drivers/gpio/gpio-eic-sprd.c |
2474 |
+index 4935cda5301ea..4f1af323ec03b 100644 |
2475 |
+--- a/drivers/gpio/gpio-eic-sprd.c |
2476 |
++++ b/drivers/gpio/gpio-eic-sprd.c |
2477 |
+@@ -599,7 +599,7 @@ static int sprd_eic_probe(struct platform_device *pdev) |
2478 |
+ */ |
2479 |
+ res = platform_get_resource(pdev, IORESOURCE_MEM, i); |
2480 |
+ if (!res) |
2481 |
+- continue; |
2482 |
++ break; |
2483 |
+ |
2484 |
+ sprd_eic->base[i] = devm_ioremap_resource(&pdev->dev, res); |
2485 |
+ if (IS_ERR(sprd_eic->base[i])) |
2486 |
+diff --git a/drivers/gpio/gpio-mvebu.c b/drivers/gpio/gpio-mvebu.c |
2487 |
+index adc768f908f1a..3b78dcda47364 100644 |
2488 |
+--- a/drivers/gpio/gpio-mvebu.c |
2489 |
++++ b/drivers/gpio/gpio-mvebu.c |
2490 |
+@@ -1191,6 +1191,13 @@ static int mvebu_gpio_probe(struct platform_device *pdev) |
2491 |
+ |
2492 |
+ devm_gpiochip_add_data(&pdev->dev, &mvchip->chip, mvchip); |
2493 |
+ |
2494 |
++ /* Some MVEBU SoCs have simple PWM support for GPIO lines */ |
2495 |
++ if (IS_ENABLED(CONFIG_PWM)) { |
2496 |
++ err = mvebu_pwm_probe(pdev, mvchip, id); |
2497 |
++ if (err) |
2498 |
++ return err; |
2499 |
++ } |
2500 |
++ |
2501 |
+ /* Some gpio controllers do not provide irq support */ |
2502 |
+ if (!have_irqs) |
2503 |
+ return 0; |
2504 |
+@@ -1200,7 +1207,8 @@ static int mvebu_gpio_probe(struct platform_device *pdev) |
2505 |
+ if (!mvchip->domain) { |
2506 |
+ dev_err(&pdev->dev, "couldn't allocate irq domain %s (DT).\n", |
2507 |
+ mvchip->chip.label); |
2508 |
+- return -ENODEV; |
2509 |
++ err = -ENODEV; |
2510 |
++ goto err_pwm; |
2511 |
+ } |
2512 |
+ |
2513 |
+ err = irq_alloc_domain_generic_chips( |
2514 |
+@@ -1248,14 +1256,12 @@ static int mvebu_gpio_probe(struct platform_device *pdev) |
2515 |
+ mvchip); |
2516 |
+ } |
2517 |
+ |
2518 |
+- /* Some MVEBU SoCs have simple PWM support for GPIO lines */ |
2519 |
+- if (IS_ENABLED(CONFIG_PWM)) |
2520 |
+- return mvebu_pwm_probe(pdev, mvchip, id); |
2521 |
+- |
2522 |
+ return 0; |
2523 |
+ |
2524 |
+ err_domain: |
2525 |
+ irq_domain_remove(mvchip->domain); |
2526 |
++err_pwm: |
2527 |
++ pwmchip_remove(&mvchip->mvpwm->chip); |
2528 |
+ |
2529 |
+ return err; |
2530 |
+ } |
2531 |
+diff --git a/drivers/gpu/drm/drm_dp_aux_dev.c b/drivers/gpu/drm/drm_dp_aux_dev.c |
2532 |
+index 0e4f25d63fd2d..0b11210c882ee 100644 |
2533 |
+--- a/drivers/gpu/drm/drm_dp_aux_dev.c |
2534 |
++++ b/drivers/gpu/drm/drm_dp_aux_dev.c |
2535 |
+@@ -60,7 +60,7 @@ static struct drm_dp_aux_dev *drm_dp_aux_dev_get_by_minor(unsigned index) |
2536 |
+ |
2537 |
+ mutex_lock(&aux_idr_mutex); |
2538 |
+ aux_dev = idr_find(&aux_idr, index); |
2539 |
+- if (!kref_get_unless_zero(&aux_dev->refcount)) |
2540 |
++ if (aux_dev && !kref_get_unless_zero(&aux_dev->refcount)) |
2541 |
+ aux_dev = NULL; |
2542 |
+ mutex_unlock(&aux_idr_mutex); |
2543 |
+ |
2544 |
+diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c b/drivers/gpu/drm/drm_dp_mst_topology.c |
2545 |
+index a0aafd9a37e60..c50fe915f5c84 100644 |
2546 |
+--- a/drivers/gpu/drm/drm_dp_mst_topology.c |
2547 |
++++ b/drivers/gpu/drm/drm_dp_mst_topology.c |
2548 |
+@@ -2706,11 +2706,11 @@ bool drm_dp_mst_allocate_vcpi(struct drm_dp_mst_topology_mgr *mgr, |
2549 |
+ { |
2550 |
+ int ret; |
2551 |
+ |
2552 |
+- port = drm_dp_get_validated_port_ref(mgr, port); |
2553 |
+- if (!port) |
2554 |
++ if (slots < 0) |
2555 |
+ return false; |
2556 |
+ |
2557 |
+- if (slots < 0) |
|