Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.4 commit in: /
Date: Wed, 30 Dec 2020 12:53:39
Message-Id: 1609332799.bdd615062cf3d0452d81dffd70baac4ddcebbf5b.mpagano@gentoo
1 commit: bdd615062cf3d0452d81dffd70baac4ddcebbf5b
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 30 12:53:19 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 30 12:53:19 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=bdd61506
7
8 Linux patch 5.4.86
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1085_linux-5.4.86.patch | 12955 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 12959 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 377ed61..06423b4 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -383,6 +383,10 @@ Patch: 1084_linux-5.4.85.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.4.85
23
24 +Patch: 1085_linux-5.4.86.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.4.86
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/1085_linux-5.4.86.patch b/1085_linux-5.4.86.patch
33 new file mode 100644
34 index 0000000..2b46e9a
35 --- /dev/null
36 +++ b/1085_linux-5.4.86.patch
37 @@ -0,0 +1,12955 @@
38 +diff --git a/Documentation/x86/topology.rst b/Documentation/x86/topology.rst
39 +index e29739904e37e..7f58010ea86af 100644
40 +--- a/Documentation/x86/topology.rst
41 ++++ b/Documentation/x86/topology.rst
42 +@@ -41,6 +41,8 @@ Package
43 + Packages contain a number of cores plus shared resources, e.g. DRAM
44 + controller, shared caches etc.
45 +
46 ++Modern systems may also use the term 'Die' for package.
47 ++
48 + AMD nomenclature for package is 'Node'.
49 +
50 + Package-related topology information in the kernel:
51 +@@ -53,11 +55,18 @@ Package-related topology information in the kernel:
52 +
53 + The number of dies in a package. This information is retrieved via CPUID.
54 +
55 ++ - cpuinfo_x86.cpu_die_id:
56 ++
57 ++ The physical ID of the die. This information is retrieved via CPUID.
58 ++
59 + - cpuinfo_x86.phys_proc_id:
60 +
61 + The physical ID of the package. This information is retrieved via CPUID
62 + and deduced from the APIC IDs of the cores in the package.
63 +
64 ++ Modern systems use this value for the socket. There may be multiple
65 ++ packages within a socket. This value may differ from cpu_die_id.
66 ++
67 + - cpuinfo_x86.logical_proc_id:
68 +
69 + The logical ID of the package. As we do not trust BIOSes to enumerate the
70 +diff --git a/Makefile b/Makefile
71 +index a2a2546fcda80..e1a94c8d278e6 100644
72 +--- a/Makefile
73 ++++ b/Makefile
74 +@@ -1,7 +1,7 @@
75 + # SPDX-License-Identifier: GPL-2.0
76 + VERSION = 5
77 + PATCHLEVEL = 4
78 +-SUBLEVEL = 85
79 ++SUBLEVEL = 86
80 + EXTRAVERSION =
81 + NAME = Kleptomaniac Octopus
82 +
83 +diff --git a/arch/Kconfig b/arch/Kconfig
84 +index 84653a823d3b0..a8df66e645442 100644
85 +--- a/arch/Kconfig
86 ++++ b/arch/Kconfig
87 +@@ -131,6 +131,22 @@ config UPROBES
88 + managed by the kernel and kept transparent to the probed
89 + application. )
90 +
91 ++config HAVE_64BIT_ALIGNED_ACCESS
92 ++ def_bool 64BIT && !HAVE_EFFICIENT_UNALIGNED_ACCESS
93 ++ help
94 ++ Some architectures require 64 bit accesses to be 64 bit
95 ++ aligned, which also requires structs containing 64 bit values
96 ++ to be 64 bit aligned too. This includes some 32 bit
97 ++ architectures which can do 64 bit accesses, as well as 64 bit
98 ++ architectures without unaligned access.
99 ++
100 ++ This symbol should be selected by an architecture if 64 bit
101 ++ accesses are required to be 64 bit aligned in this way even
102 ++ though it is not a 64 bit architecture.
103 ++
104 ++ See Documentation/unaligned-memory-access.txt for more
105 ++ information on the topic of unaligned memory accesses.
106 ++
107 + config HAVE_EFFICIENT_UNALIGNED_ACCESS
108 + bool
109 + help
110 +diff --git a/arch/arm/boot/dts/armada-xp-98dx3236.dtsi b/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
111 +index 267d0c178e55c..30abb4b64a1b6 100644
112 +--- a/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
113 ++++ b/arch/arm/boot/dts/armada-xp-98dx3236.dtsi
114 +@@ -266,11 +266,6 @@
115 + reg = <0x11000 0x100>;
116 + };
117 +
118 +-&i2c1 {
119 +- compatible = "marvell,mv78230-i2c", "marvell,mv64xxx-i2c";
120 +- reg = <0x11100 0x100>;
121 +-};
122 +-
123 + &mpic {
124 + reg = <0x20a00 0x2d0>, <0x21070 0x58>;
125 + };
126 +diff --git a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
127 +index 682f729ea25e1..c58230fea45f8 100644
128 +--- a/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
129 ++++ b/arch/arm/boot/dts/aspeed-bmc-facebook-tiogapass.dts
130 +@@ -81,11 +81,6 @@
131 + status = "okay";
132 + };
133 +
134 +-&vuart {
135 +- // VUART Host Console
136 +- status = "okay";
137 +-};
138 +-
139 + &uart1 {
140 + // Host Console
141 + status = "okay";
142 +diff --git a/arch/arm/boot/dts/aspeed-bmc-intel-s2600wf.dts b/arch/arm/boot/dts/aspeed-bmc-intel-s2600wf.dts
143 +index 22dade6393d06..d1dbe3b6ad5a7 100644
144 +--- a/arch/arm/boot/dts/aspeed-bmc-intel-s2600wf.dts
145 ++++ b/arch/arm/boot/dts/aspeed-bmc-intel-s2600wf.dts
146 +@@ -22,9 +22,9 @@
147 + #size-cells = <1>;
148 + ranges;
149 +
150 +- vga_memory: framebuffer@7f000000 {
151 ++ vga_memory: framebuffer@9f000000 {
152 + no-map;
153 +- reg = <0x7f000000 0x01000000>;
154 ++ reg = <0x9f000000 0x01000000>; /* 16M */
155 + };
156 + };
157 +
158 +diff --git a/arch/arm/boot/dts/at91-sama5d3_xplained.dts b/arch/arm/boot/dts/at91-sama5d3_xplained.dts
159 +index 61f068a7b362a..400eaf640fe42 100644
160 +--- a/arch/arm/boot/dts/at91-sama5d3_xplained.dts
161 ++++ b/arch/arm/boot/dts/at91-sama5d3_xplained.dts
162 +@@ -242,6 +242,11 @@
163 + atmel,pins =
164 + <AT91_PIOE 9 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>; /* PE9, conflicts with A9 */
165 + };
166 ++ pinctrl_usb_default: usb_default {
167 ++ atmel,pins =
168 ++ <AT91_PIOE 3 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
169 ++ AT91_PIOE 4 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
170 ++ };
171 + };
172 + };
173 + };
174 +@@ -259,6 +264,8 @@
175 + &pioE 3 GPIO_ACTIVE_LOW
176 + &pioE 4 GPIO_ACTIVE_LOW
177 + >;
178 ++ pinctrl-names = "default";
179 ++ pinctrl-0 = <&pinctrl_usb_default>;
180 + status = "okay";
181 + };
182 +
183 +diff --git a/arch/arm/boot/dts/at91-sama5d4_xplained.dts b/arch/arm/boot/dts/at91-sama5d4_xplained.dts
184 +index fdfc37d716e01..1d101067371b4 100644
185 +--- a/arch/arm/boot/dts/at91-sama5d4_xplained.dts
186 ++++ b/arch/arm/boot/dts/at91-sama5d4_xplained.dts
187 +@@ -133,6 +133,11 @@
188 + atmel,pins =
189 + <AT91_PIOE 31 AT91_PERIPH_GPIO AT91_PINCTRL_DEGLITCH>;
190 + };
191 ++ pinctrl_usb_default: usb_default {
192 ++ atmel,pins =
193 ++ <AT91_PIOE 11 AT91_PERIPH_GPIO AT91_PINCTRL_NONE
194 ++ AT91_PIOE 14 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
195 ++ };
196 + pinctrl_key_gpio: key_gpio_0 {
197 + atmel,pins =
198 + <AT91_PIOE 8 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
199 +@@ -158,6 +163,8 @@
200 + &pioE 11 GPIO_ACTIVE_HIGH
201 + &pioE 14 GPIO_ACTIVE_HIGH
202 + >;
203 ++ pinctrl-names = "default";
204 ++ pinctrl-0 = <&pinctrl_usb_default>;
205 + status = "okay";
206 + };
207 +
208 +diff --git a/arch/arm/boot/dts/at91sam9rl.dtsi b/arch/arm/boot/dts/at91sam9rl.dtsi
209 +index ea024e4b6e095..0121bb0ecde16 100644
210 +--- a/arch/arm/boot/dts/at91sam9rl.dtsi
211 ++++ b/arch/arm/boot/dts/at91sam9rl.dtsi
212 +@@ -278,23 +278,26 @@
213 + atmel,adc-use-res = "highres";
214 +
215 + trigger0 {
216 +- trigger-name = "timer-counter-0";
217 ++ trigger-name = "external-rising";
218 + trigger-value = <0x1>;
219 ++ trigger-external;
220 + };
221 ++
222 + trigger1 {
223 +- trigger-name = "timer-counter-1";
224 +- trigger-value = <0x3>;
225 ++ trigger-name = "external-falling";
226 ++ trigger-value = <0x2>;
227 ++ trigger-external;
228 + };
229 +
230 + trigger2 {
231 +- trigger-name = "timer-counter-2";
232 +- trigger-value = <0x5>;
233 ++ trigger-name = "external-any";
234 ++ trigger-value = <0x3>;
235 ++ trigger-external;
236 + };
237 +
238 + trigger3 {
239 +- trigger-name = "external";
240 +- trigger-value = <0x13>;
241 +- trigger-external;
242 ++ trigger-name = "continuous";
243 ++ trigger-value = <0x6>;
244 + };
245 + };
246 +
247 +diff --git a/arch/arm/boot/dts/exynos5410-odroidxu.dts b/arch/arm/boot/dts/exynos5410-odroidxu.dts
248 +index e0db251e253f0..f68baaf58f9e3 100644
249 +--- a/arch/arm/boot/dts/exynos5410-odroidxu.dts
250 ++++ b/arch/arm/boot/dts/exynos5410-odroidxu.dts
251 +@@ -327,6 +327,8 @@
252 + regulator-name = "vddq_lcd";
253 + regulator-min-microvolt = <1800000>;
254 + regulator-max-microvolt = <1800000>;
255 ++ /* Supplies also GPK and GPJ */
256 ++ regulator-always-on;
257 + };
258 +
259 + ldo8_reg: LDO8 {
260 +@@ -637,11 +639,11 @@
261 + };
262 +
263 + &usbdrd_dwc3_0 {
264 +- dr_mode = "host";
265 ++ dr_mode = "peripheral";
266 + };
267 +
268 + &usbdrd_dwc3_1 {
269 +- dr_mode = "peripheral";
270 ++ dr_mode = "host";
271 + };
272 +
273 + &usbdrd3_0 {
274 +diff --git a/arch/arm/boot/dts/exynos5410-pinctrl.dtsi b/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
275 +index 369a8a7f21050..481ee99aa9c97 100644
276 +--- a/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
277 ++++ b/arch/arm/boot/dts/exynos5410-pinctrl.dtsi
278 +@@ -560,6 +560,34 @@
279 + interrupt-controller;
280 + #interrupt-cells = <2>;
281 + };
282 ++
283 ++ usb3_1_oc: usb3-1-oc {
284 ++ samsung,pins = "gpk2-4", "gpk2-5";
285 ++ samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
286 ++ samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
287 ++ samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
288 ++ };
289 ++
290 ++ usb3_1_vbusctrl: usb3-1-vbusctrl {
291 ++ samsung,pins = "gpk2-6", "gpk2-7";
292 ++ samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
293 ++ samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
294 ++ samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
295 ++ };
296 ++
297 ++ usb3_0_oc: usb3-0-oc {
298 ++ samsung,pins = "gpk3-0", "gpk3-1";
299 ++ samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
300 ++ samsung,pin-pud = <EXYNOS_PIN_PULL_UP>;
301 ++ samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
302 ++ };
303 ++
304 ++ usb3_0_vbusctrl: usb3-0-vbusctrl {
305 ++ samsung,pins = "gpk3-2", "gpk3-3";
306 ++ samsung,pin-function = <EXYNOS_PIN_FUNC_2>;
307 ++ samsung,pin-pud = <EXYNOS_PIN_PULL_DOWN>;
308 ++ samsung,pin-drv = <EXYNOS5420_PIN_DRV_LV1>;
309 ++ };
310 + };
311 +
312 + &pinctrl_2 {
313 +diff --git a/arch/arm/boot/dts/exynos5410.dtsi b/arch/arm/boot/dts/exynos5410.dtsi
314 +index e6f78b1cee7c8..d077373cf872d 100644
315 +--- a/arch/arm/boot/dts/exynos5410.dtsi
316 ++++ b/arch/arm/boot/dts/exynos5410.dtsi
317 +@@ -398,6 +398,8 @@
318 + &usbdrd3_0 {
319 + clocks = <&clock CLK_USBD300>;
320 + clock-names = "usbdrd30";
321 ++ pinctrl-names = "default";
322 ++ pinctrl-0 = <&usb3_0_oc>, <&usb3_0_vbusctrl>;
323 + };
324 +
325 + &usbdrd_phy0 {
326 +@@ -409,6 +411,8 @@
327 + &usbdrd3_1 {
328 + clocks = <&clock CLK_USBD301>;
329 + clock-names = "usbdrd30";
330 ++ pinctrl-names = "default";
331 ++ pinctrl-0 = <&usb3_1_oc>, <&usb3_1_vbusctrl>;
332 + };
333 +
334 + &usbdrd_dwc3_1 {
335 +diff --git a/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi b/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi
336 +index 81c7ebb4b3fbe..6acc8591219a7 100644
337 +--- a/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi
338 ++++ b/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi
339 +@@ -551,7 +551,7 @@
340 +
341 + pinctrl_i2c3: i2c3grp {
342 + fsl,pins = <
343 +- MX6QDL_PAD_GPIO_3__I2C3_SCL 0x4001b8b1
344 ++ MX6QDL_PAD_GPIO_5__I2C3_SCL 0x4001b8b1
345 + MX6QDL_PAD_GPIO_16__I2C3_SDA 0x4001b8b1
346 + >;
347 + };
348 +diff --git a/arch/arm/boot/dts/imx6qdl-wandboard-revd1.dtsi b/arch/arm/boot/dts/imx6qdl-wandboard-revd1.dtsi
349 +index 93909796885a0..b9b698f72b261 100644
350 +--- a/arch/arm/boot/dts/imx6qdl-wandboard-revd1.dtsi
351 ++++ b/arch/arm/boot/dts/imx6qdl-wandboard-revd1.dtsi
352 +@@ -166,7 +166,6 @@
353 + MX6QDL_PAD_RGMII_RD2__RGMII_RD2 0x1b030
354 + MX6QDL_PAD_RGMII_RD3__RGMII_RD3 0x1b030
355 + MX6QDL_PAD_RGMII_RX_CTL__RGMII_RX_CTL 0x1b030
356 +- MX6QDL_PAD_GPIO_6__ENET_IRQ 0x000b1
357 + >;
358 + };
359 +
360 +diff --git a/arch/arm/boot/dts/meson8b-odroidc1.dts b/arch/arm/boot/dts/meson8b-odroidc1.dts
361 +index a24eccc354b95..0f9c71137bed5 100644
362 +--- a/arch/arm/boot/dts/meson8b-odroidc1.dts
363 ++++ b/arch/arm/boot/dts/meson8b-odroidc1.dts
364 +@@ -219,7 +219,7 @@
365 + reg = <0>;
366 +
367 + reset-assert-us = <10000>;
368 +- reset-deassert-us = <30000>;
369 ++ reset-deassert-us = <80000>;
370 + reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
371 +
372 + interrupt-parent = <&gpio_intc>;
373 +diff --git a/arch/arm/boot/dts/meson8m2-mxiii-plus.dts b/arch/arm/boot/dts/meson8m2-mxiii-plus.dts
374 +index d54477b1001ca..84b6ed51099db 100644
375 +--- a/arch/arm/boot/dts/meson8m2-mxiii-plus.dts
376 ++++ b/arch/arm/boot/dts/meson8m2-mxiii-plus.dts
377 +@@ -83,7 +83,7 @@
378 + reg = <0>;
379 +
380 + reset-assert-us = <10000>;
381 +- reset-deassert-us = <30000>;
382 ++ reset-deassert-us = <80000>;
383 + reset-gpios = <&gpio GPIOH_4 GPIO_ACTIVE_LOW>;
384 + };
385 + };
386 +diff --git a/arch/arm/boot/dts/omap4-panda-es.dts b/arch/arm/boot/dts/omap4-panda-es.dts
387 +index 9dd307b526048..468ad1b641380 100644
388 +--- a/arch/arm/boot/dts/omap4-panda-es.dts
389 ++++ b/arch/arm/boot/dts/omap4-panda-es.dts
390 +@@ -46,7 +46,7 @@
391 +
392 + button_pins: pinmux_button_pins {
393 + pinctrl-single,pins = <
394 +- OMAP4_IOPAD(0x11b, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio_113 */
395 ++ OMAP4_IOPAD(0x0fc, PIN_INPUT_PULLUP | MUX_MODE3) /* gpio_113 */
396 + >;
397 + };
398 + };
399 +diff --git a/arch/arm/boot/dts/sama5d2.dtsi b/arch/arm/boot/dts/sama5d2.dtsi
400 +index 2e2c1a7b1d1dc..b05bab57f90a3 100644
401 +--- a/arch/arm/boot/dts/sama5d2.dtsi
402 ++++ b/arch/arm/boot/dts/sama5d2.dtsi
403 +@@ -648,6 +648,7 @@
404 + clocks = <&pmc PMC_TYPE_PERIPHERAL 51>;
405 + #address-cells = <1>;
406 + #size-cells = <1>;
407 ++ no-memory-wc;
408 + ranges = <0 0xf8044000 0x1420>;
409 + };
410 +
411 +@@ -716,7 +717,7 @@
412 +
413 + can0: can@f8054000 {
414 + compatible = "bosch,m_can";
415 +- reg = <0xf8054000 0x4000>, <0x210000 0x4000>;
416 ++ reg = <0xf8054000 0x4000>, <0x210000 0x1c00>;
417 + reg-names = "m_can", "message_ram";
418 + interrupts = <56 IRQ_TYPE_LEVEL_HIGH 7>,
419 + <64 IRQ_TYPE_LEVEL_HIGH 7>;
420 +@@ -938,7 +939,7 @@
421 +
422 + can1: can@fc050000 {
423 + compatible = "bosch,m_can";
424 +- reg = <0xfc050000 0x4000>, <0x210000 0x4000>;
425 ++ reg = <0xfc050000 0x4000>, <0x210000 0x3800>;
426 + reg-names = "m_can", "message_ram";
427 + interrupts = <57 IRQ_TYPE_LEVEL_HIGH 7>,
428 + <65 IRQ_TYPE_LEVEL_HIGH 7>;
429 +@@ -948,7 +949,7 @@
430 + assigned-clocks = <&pmc PMC_TYPE_GCK 57>;
431 + assigned-clock-parents = <&pmc PMC_TYPE_CORE PMC_UTMI>;
432 + assigned-clock-rates = <40000000>;
433 +- bosch,mram-cfg = <0x1100 0 0 64 0 0 32 32>;
434 ++ bosch,mram-cfg = <0x1c00 0 0 64 0 0 32 32>;
435 + status = "disabled";
436 + };
437 +
438 +diff --git a/arch/arm/boot/dts/sun7i-a20-bananapi.dts b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
439 +index bb3987e101c29..0b3d9ae756503 100644
440 +--- a/arch/arm/boot/dts/sun7i-a20-bananapi.dts
441 ++++ b/arch/arm/boot/dts/sun7i-a20-bananapi.dts
442 +@@ -132,7 +132,7 @@
443 + pinctrl-names = "default";
444 + pinctrl-0 = <&gmac_rgmii_pins>;
445 + phy-handle = <&phy1>;
446 +- phy-mode = "rgmii";
447 ++ phy-mode = "rgmii-id";
448 + phy-supply = <&reg_gmac_3v3>;
449 + status = "okay";
450 + };
451 +diff --git a/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts b/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
452 +index fce2f7fcd084a..bf38c66c1815b 100644
453 +--- a/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
454 ++++ b/arch/arm/boot/dts/sun7i-a20-pcduino3-nano.dts
455 +@@ -1,5 +1,5 @@
456 + /*
457 +- * Copyright 2015 Adam Sampson <ats@×××××.org>
458 ++ * Copyright 2015-2020 Adam Sampson <ats@×××××.org>
459 + *
460 + * This file is dual-licensed: you can use it either under the terms
461 + * of the GPL or the X11 license, at your option. Note that this dual
462 +@@ -115,7 +115,7 @@
463 + pinctrl-names = "default";
464 + pinctrl-0 = <&gmac_rgmii_pins>;
465 + phy-handle = <&phy1>;
466 +- phy-mode = "rgmii";
467 ++ phy-mode = "rgmii-id";
468 + status = "okay";
469 + };
470 +
471 +diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
472 +index 2abcba35d27e6..50c32cf72c65c 100644
473 +--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
474 ++++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
475 +@@ -423,7 +423,7 @@
476 + gic: interrupt-controller@1c81000 {
477 + compatible = "arm,gic-400";
478 + reg = <0x01c81000 0x1000>,
479 +- <0x01c82000 0x1000>,
480 ++ <0x01c82000 0x2000>,
481 + <0x01c84000 0x2000>,
482 + <0x01c86000 0x2000>;
483 + interrupt-controller;
484 +diff --git a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
485 +index 15c22b06fc4b6..47954551f5735 100644
486 +--- a/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
487 ++++ b/arch/arm/boot/dts/sun8i-v40-bananapi-m2-berry.dts
488 +@@ -120,7 +120,7 @@
489 + pinctrl-names = "default";
490 + pinctrl-0 = <&gmac_rgmii_pins>;
491 + phy-handle = <&phy1>;
492 +- phy-mode = "rgmii";
493 ++ phy-mode = "rgmii-id";
494 + phy-supply = <&reg_dc1sw>;
495 + status = "okay";
496 + };
497 +@@ -198,16 +198,16 @@
498 + };
499 +
500 + &reg_dc1sw {
501 +- regulator-min-microvolt = <3000000>;
502 +- regulator-max-microvolt = <3000000>;
503 ++ regulator-min-microvolt = <3300000>;
504 ++ regulator-max-microvolt = <3300000>;
505 + regulator-name = "vcc-gmac-phy";
506 + };
507 +
508 + &reg_dcdc1 {
509 + regulator-always-on;
510 +- regulator-min-microvolt = <3000000>;
511 +- regulator-max-microvolt = <3000000>;
512 +- regulator-name = "vcc-3v0";
513 ++ regulator-min-microvolt = <3300000>;
514 ++ regulator-max-microvolt = <3300000>;
515 ++ regulator-name = "vcc-3v3";
516 + };
517 +
518 + &reg_dcdc2 {
519 +diff --git a/arch/arm/crypto/aes-ce-core.S b/arch/arm/crypto/aes-ce-core.S
520 +index 4d1707388d941..312428d83eedb 100644
521 +--- a/arch/arm/crypto/aes-ce-core.S
522 ++++ b/arch/arm/crypto/aes-ce-core.S
523 +@@ -386,20 +386,32 @@ ENTRY(ce_aes_ctr_encrypt)
524 + .Lctrloop4x:
525 + subs r4, r4, #4
526 + bmi .Lctr1x
527 +- add r6, r6, #1
528 ++
529 ++ /*
530 ++ * NOTE: the sequence below has been carefully tweaked to avoid
531 ++ * a silicon erratum that exists in Cortex-A57 (#1742098) and
532 ++ * Cortex-A72 (#1655431) cores, where AESE/AESMC instruction pairs
533 ++ * may produce an incorrect result if they take their input from a
534 ++ * register of which a single 32-bit lane has been updated the last
535 ++ * time it was modified. To work around this, the lanes of registers
536 ++ * q0-q3 below are not manipulated individually, and the different
537 ++ * counter values are prepared by successive manipulations of q7.
538 ++ */
539 ++ add ip, r6, #1
540 + vmov q0, q7
541 ++ rev ip, ip
542 ++ add lr, r6, #2
543 ++ vmov s31, ip @ set lane 3 of q1 via q7
544 ++ add ip, r6, #3
545 ++ rev lr, lr
546 + vmov q1, q7
547 +- rev ip, r6
548 +- add r6, r6, #1
549 ++ vmov s31, lr @ set lane 3 of q2 via q7
550 ++ rev ip, ip
551 + vmov q2, q7
552 +- vmov s7, ip
553 +- rev ip, r6
554 +- add r6, r6, #1
555 ++ vmov s31, ip @ set lane 3 of q3 via q7
556 ++ add r6, r6, #4
557 + vmov q3, q7
558 +- vmov s11, ip
559 +- rev ip, r6
560 +- add r6, r6, #1
561 +- vmov s15, ip
562 ++
563 + vld1.8 {q4-q5}, [r1]!
564 + vld1.8 {q6}, [r1]!
565 + vld1.8 {q15}, [r1]!
566 +diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S
567 +index c49b39340ddbd..f1cdc1f369575 100644
568 +--- a/arch/arm/kernel/head.S
569 ++++ b/arch/arm/kernel/head.S
570 +@@ -671,12 +671,8 @@ ARM_BE8(rev16 ip, ip)
571 + ldrcc r7, [r4], #4 @ use branch for delay slot
572 + bcc 1b
573 + bx lr
574 +-#else
575 +-#ifdef CONFIG_CPU_ENDIAN_BE8
576 +- moveq r0, #0x00004000 @ set bit 22, mov to mvn instruction
577 + #else
578 + moveq r0, #0x400000 @ set bit 22, mov to mvn instruction
579 +-#endif
580 + b 2f
581 + 1: ldr ip, [r7, r3]
582 + #ifdef CONFIG_CPU_ENDIAN_BE8
583 +@@ -685,7 +681,7 @@ ARM_BE8(rev16 ip, ip)
584 + tst ip, #0x000f0000 @ check the rotation field
585 + orrne ip, ip, r6, lsl #24 @ mask in offset bits 31-24
586 + biceq ip, ip, #0x00004000 @ clear bit 22
587 +- orreq ip, ip, r0 @ mask in offset bits 7-0
588 ++ orreq ip, ip, r0, ror #8 @ mask in offset bits 7-0
589 + #else
590 + bic ip, ip, #0x000000ff
591 + tst ip, #0xf00 @ check the rotation field
592 +diff --git a/arch/arm/mach-sunxi/sunxi.c b/arch/arm/mach-sunxi/sunxi.c
593 +index 933b6930f024f..a0ca5e7a68de2 100644
594 +--- a/arch/arm/mach-sunxi/sunxi.c
595 ++++ b/arch/arm/mach-sunxi/sunxi.c
596 +@@ -66,6 +66,7 @@ static const char * const sun8i_board_dt_compat[] = {
597 + "allwinner,sun8i-h2-plus",
598 + "allwinner,sun8i-h3",
599 + "allwinner,sun8i-r40",
600 ++ "allwinner,sun8i-v3",
601 + "allwinner,sun8i-v3s",
602 + NULL,
603 + };
604 +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
605 +index 17155fb73fce9..c48125bf9d1e3 100644
606 +--- a/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
607 ++++ b/arch/arm64/boot/dts/amlogic/meson-g12a-x96-max.dts
608 +@@ -340,7 +340,7 @@
609 + eee-broken-1000t;
610 +
611 + reset-assert-us = <10000>;
612 +- reset-deassert-us = <30000>;
613 ++ reset-deassert-us = <80000>;
614 + reset-gpios = <&gpio GPIOZ_15 (GPIO_ACTIVE_LOW | GPIO_OPEN_DRAIN)>;
615 +
616 + interrupt-parent = <&gpio_intc>;
617 +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts
618 +index 233eb1cd79671..d94b695916a35 100644
619 +--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts
620 ++++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-nanopi-k2.dts
621 +@@ -165,7 +165,7 @@
622 + reg = <0>;
623 +
624 + reset-assert-us = <10000>;
625 +- reset-deassert-us = <30000>;
626 ++ reset-deassert-us = <80000>;
627 + reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
628 +
629 + interrupt-parent = <&gpio_intc>;
630 +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
631 +index b0b12e3898350..8828acb3fd4c5 100644
632 +--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
633 ++++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-odroidc2.dts
634 +@@ -138,7 +138,7 @@
635 + reg = <0>;
636 +
637 + reset-assert-us = <10000>;
638 +- reset-deassert-us = <30000>;
639 ++ reset-deassert-us = <80000>;
640 + reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
641 +
642 + interrupt-parent = <&gpio_intc>;
643 +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
644 +index 43b11e3dfe119..29976215e1446 100644
645 +--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
646 ++++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-vega-s95.dtsi
647 +@@ -126,7 +126,7 @@
648 + reg = <0>;
649 +
650 + reset-assert-us = <10000>;
651 +- reset-deassert-us = <30000>;
652 ++ reset-deassert-us = <80000>;
653 + reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
654 +
655 + interrupt-parent = <&gpio_intc>;
656 +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
657 +index 4c539881fbb73..e3d17569d98ad 100644
658 +--- a/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
659 ++++ b/arch/arm64/boot/dts/amlogic/meson-gxbb-wetek.dtsi
660 +@@ -147,7 +147,7 @@
661 + reg = <0>;
662 +
663 + reset-assert-us = <10000>;
664 +- reset-deassert-us = <30000>;
665 ++ reset-deassert-us = <80000>;
666 + reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
667 + };
668 + };
669 +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts
670 +index b08c4537f260d..b2ab05c220903 100644
671 +--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts
672 ++++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905d-p230.dts
673 +@@ -82,7 +82,7 @@
674 +
675 + /* External PHY reset is shared with internal PHY Led signal */
676 + reset-assert-us = <10000>;
677 +- reset-deassert-us = <30000>;
678 ++ reset-deassert-us = <80000>;
679 + reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
680 +
681 + interrupt-parent = <&gpio_intc>;
682 +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
683 +index 3f43716d5c453..c8a4205117f15 100644
684 +--- a/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
685 ++++ b/arch/arm64/boot/dts/amlogic/meson-gxm-khadas-vim2.dts
686 +@@ -251,7 +251,7 @@
687 + reg = <0>;
688 +
689 + reset-assert-us = <10000>;
690 +- reset-deassert-us = <30000>;
691 ++ reset-deassert-us = <80000>;
692 + reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
693 +
694 + interrupt-parent = <&gpio_intc>;
695 +@@ -395,7 +395,7 @@
696 + #size-cells = <1>;
697 + compatible = "winbond,w25q16", "jedec,spi-nor";
698 + reg = <0>;
699 +- spi-max-frequency = <3000000>;
700 ++ spi-max-frequency = <104000000>;
701 + };
702 + };
703 +
704 +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
705 +index c2bd4dbbf38c5..8dccf91d68da7 100644
706 +--- a/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
707 ++++ b/arch/arm64/boot/dts/amlogic/meson-gxm-nexbox-a1.dts
708 +@@ -112,7 +112,7 @@
709 + max-speed = <1000>;
710 +
711 + reset-assert-us = <10000>;
712 +- reset-deassert-us = <30000>;
713 ++ reset-deassert-us = <80000>;
714 + reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
715 + };
716 + };
717 +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts
718 +index ea45ae0c71b7f..8edbfe040805c 100644
719 +--- a/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts
720 ++++ b/arch/arm64/boot/dts/amlogic/meson-gxm-q200.dts
721 +@@ -64,7 +64,7 @@
722 +
723 + /* External PHY reset is shared with internal PHY Led signal */
724 + reset-assert-us = <10000>;
725 +- reset-deassert-us = <30000>;
726 ++ reset-deassert-us = <80000>;
727 + reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
728 +
729 + interrupt-parent = <&gpio_intc>;
730 +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts b/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts
731 +index 5cd4d35006d09..f72d29e33a9e4 100644
732 +--- a/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts
733 ++++ b/arch/arm64/boot/dts/amlogic/meson-gxm-rbox-pro.dts
734 +@@ -114,7 +114,7 @@
735 + max-speed = <1000>;
736 +
737 + reset-assert-us = <10000>;
738 +- reset-deassert-us = <30000>;
739 ++ reset-deassert-us = <80000>;
740 + reset-gpios = <&gpio GPIOZ_14 GPIO_ACTIVE_LOW>;
741 + };
742 + };
743 +diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
744 +index 521573f3a5bab..8ba3555ca3693 100644
745 +--- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
746 ++++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
747 +@@ -90,7 +90,7 @@
748 + opp-microvolt = <790000>;
749 + };
750 +
751 +- opp-1512000000 {
752 ++ opp-1500000000 {
753 + opp-hz = /bits/ 64 <1500000000>;
754 + opp-microvolt = <800000>;
755 + };
756 +diff --git a/arch/arm64/boot/dts/exynos/exynos7.dtsi b/arch/arm64/boot/dts/exynos/exynos7.dtsi
757 +index 0821489a874de..25549d9552ae2 100644
758 +--- a/arch/arm64/boot/dts/exynos/exynos7.dtsi
759 ++++ b/arch/arm64/boot/dts/exynos/exynos7.dtsi
760 +@@ -90,8 +90,10 @@
761 + };
762 +
763 + psci {
764 +- compatible = "arm,psci-0.2";
765 ++ compatible = "arm,psci";
766 + method = "smc";
767 ++ cpu_off = <0x84000002>;
768 ++ cpu_on = <0xC4000003>;
769 + };
770 +
771 + soc: soc {
772 +@@ -494,13 +496,6 @@
773 + pmu_system_controller: system-controller@105c0000 {
774 + compatible = "samsung,exynos7-pmu", "syscon";
775 + reg = <0x105c0000 0x5000>;
776 +-
777 +- reboot: syscon-reboot {
778 +- compatible = "syscon-reboot";
779 +- regmap = <&pmu_system_controller>;
780 +- offset = <0x0400>;
781 +- mask = <0x1>;
782 +- };
783 + };
784 +
785 + rtc: rtc@10590000 {
786 +@@ -650,3 +645,4 @@
787 + };
788 +
789 + #include "exynos7-pinctrl.dtsi"
790 ++#include "arm/exynos-syscon-restart.dtsi"
791 +diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
792 +index 9589b15693d6e..795d6ca4bbd1f 100644
793 +--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
794 ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
795 +@@ -673,7 +673,7 @@
796 + ethernet@0,4 {
797 + compatible = "fsl,enetc-ptp";
798 + reg = <0x000400 0 0 0 0>;
799 +- clocks = <&clockgen 4 0>;
800 ++ clocks = <&clockgen 2 3>;
801 + little-endian;
802 + };
803 + };
804 +diff --git a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
805 +index c3668187b8446..aa52927e2e9c2 100644
806 +--- a/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
807 ++++ b/arch/arm64/boot/dts/marvell/armada-3720-turris-mox.dts
808 +@@ -144,7 +144,7 @@
809 + pinctrl-names = "default";
810 + pinctrl-0 = <&rgmii_pins>;
811 + phy-mode = "rgmii-id";
812 +- phy = <&phy1>;
813 ++ phy-handle = <&phy1>;
814 + status = "okay";
815 + };
816 +
817 +diff --git a/arch/arm64/boot/dts/nvidia/tegra194.dtsi b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
818 +index 78f7e6e50beb0..0821754f0fd6d 100644
819 +--- a/arch/arm64/boot/dts/nvidia/tegra194.dtsi
820 ++++ b/arch/arm64/boot/dts/nvidia/tegra194.dtsi
821 +@@ -144,7 +144,7 @@
822 + nvidia,schmitt = <TEGRA_PIN_DISABLE>;
823 + nvidia,lpdr = <TEGRA_PIN_ENABLE>;
824 + nvidia,enable-input = <TEGRA_PIN_DISABLE>;
825 +- nvidia,io-high-voltage = <TEGRA_PIN_ENABLE>;
826 ++ nvidia,io-hv = <TEGRA_PIN_ENABLE>;
827 + nvidia,tristate = <TEGRA_PIN_DISABLE>;
828 + nvidia,pull = <TEGRA_PIN_PULL_NONE>;
829 + };
830 +@@ -156,7 +156,7 @@
831 + nvidia,schmitt = <TEGRA_PIN_DISABLE>;
832 + nvidia,lpdr = <TEGRA_PIN_ENABLE>;
833 + nvidia,enable-input = <TEGRA_PIN_ENABLE>;
834 +- nvidia,io-high-voltage = <TEGRA_PIN_ENABLE>;
835 ++ nvidia,io-hv = <TEGRA_PIN_ENABLE>;
836 + nvidia,tristate = <TEGRA_PIN_DISABLE>;
837 + nvidia,pull = <TEGRA_PIN_PULL_NONE>;
838 + };
839 +diff --git a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
840 +index ded120d3aef58..f539b3655f6b9 100644
841 +--- a/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
842 ++++ b/arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
843 +@@ -244,23 +244,28 @@
844 + status = "okay";
845 + clock-frequency = <400000>;
846 +
847 +- hid@15 {
848 ++ tsel: hid@15 {
849 + compatible = "hid-over-i2c";
850 + reg = <0x15>;
851 + hid-descr-addr = <0x1>;
852 +
853 +- interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_RISING>;
854 ++ interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>;
855 ++
856 ++ pinctrl-names = "default";
857 ++ pinctrl-0 = <&i2c3_hid_active>;
858 + };
859 +
860 +- hid@2c {
861 ++ tsc2: hid@2c {
862 + compatible = "hid-over-i2c";
863 + reg = <0x2c>;
864 + hid-descr-addr = <0x20>;
865 +
866 +- interrupts-extended = <&tlmm 37 IRQ_TYPE_EDGE_RISING>;
867 ++ interrupts-extended = <&tlmm 37 IRQ_TYPE_LEVEL_HIGH>;
868 +
869 + pinctrl-names = "default";
870 +- pinctrl-0 = <&i2c2_hid_active>;
871 ++ pinctrl-0 = <&i2c3_hid_active>;
872 ++
873 ++ status = "disabled";
874 + };
875 + };
876 +
877 +@@ -268,15 +273,15 @@
878 + status = "okay";
879 + clock-frequency = <400000>;
880 +
881 +- hid@10 {
882 ++ tsc1: hid@10 {
883 + compatible = "hid-over-i2c";
884 + reg = <0x10>;
885 + hid-descr-addr = <0x1>;
886 +
887 +- interrupts-extended = <&tlmm 125 IRQ_TYPE_EDGE_FALLING>;
888 ++ interrupts-extended = <&tlmm 125 IRQ_TYPE_LEVEL_LOW>;
889 +
890 + pinctrl-names = "default";
891 +- pinctrl-0 = <&i2c6_hid_active>;
892 ++ pinctrl-0 = <&i2c5_hid_active>;
893 + };
894 + };
895 +
896 +@@ -284,7 +289,7 @@
897 + status = "okay";
898 + clock-frequency = <400000>;
899 +
900 +- hid@5c {
901 ++ ecsh: hid@5c {
902 + compatible = "hid-over-i2c";
903 + reg = <0x5c>;
904 + hid-descr-addr = <0x1>;
905 +@@ -292,7 +297,7 @@
906 + interrupts-extended = <&tlmm 92 IRQ_TYPE_LEVEL_LOW>;
907 +
908 + pinctrl-names = "default";
909 +- pinctrl-0 = <&i2c12_hid_active>;
910 ++ pinctrl-0 = <&i2c11_hid_active>;
911 + };
912 + };
913 +
914 +@@ -335,7 +340,7 @@
915 + &tlmm {
916 + gpio-reserved-ranges = <0 4>, <81 4>;
917 +
918 +- i2c2_hid_active: i2c2-hid-active {
919 ++ i2c3_hid_active: i2c2-hid-active {
920 + pins = <37>;
921 + function = "gpio";
922 +
923 +@@ -344,7 +349,7 @@
924 + drive-strength = <2>;
925 + };
926 +
927 +- i2c6_hid_active: i2c6-hid-active {
928 ++ i2c5_hid_active: i2c5-hid-active {
929 + pins = <125>;
930 + function = "gpio";
931 +
932 +@@ -353,7 +358,7 @@
933 + drive-strength = <2>;
934 + };
935 +
936 +- i2c12_hid_active: i2c12-hid-active {
937 ++ i2c11_hid_active: i2c11-hid-active {
938 + pins = <92>;
939 + function = "gpio";
940 +
941 +diff --git a/arch/arm64/boot/dts/renesas/cat875.dtsi b/arch/arm64/boot/dts/renesas/cat875.dtsi
942 +index aaefc3ae56d50..dbdb8b093e733 100644
943 +--- a/arch/arm64/boot/dts/renesas/cat875.dtsi
944 ++++ b/arch/arm64/boot/dts/renesas/cat875.dtsi
945 +@@ -22,7 +22,6 @@
946 + status = "okay";
947 +
948 + phy0: ethernet-phy@0 {
949 +- rxc-skew-ps = <1500>;
950 + reg = <0>;
951 + interrupt-parent = <&gpio2>;
952 + interrupts = <21 IRQ_TYPE_LEVEL_LOW>;
953 +diff --git a/arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi b/arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi
954 +index 4280b190dc682..6a001cdfd38e2 100644
955 +--- a/arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi
956 ++++ b/arch/arm64/boot/dts/renesas/hihope-rzg2-ex.dtsi
957 +@@ -23,7 +23,6 @@
958 + status = "okay";
959 +
960 + phy0: ethernet-phy@0 {
961 +- rxc-skew-ps = <1500>;
962 + reg = <0>;
963 + interrupt-parent = <&gpio2>;
964 + interrupts = <11 IRQ_TYPE_LEVEL_LOW>;
965 +diff --git a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
966 +index bb40c163b05dc..6c3368f795ca3 100644
967 +--- a/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
968 ++++ b/arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
969 +@@ -333,6 +333,7 @@
970 + };
971 +
972 + &usb20_otg {
973 ++ dr_mode = "host";
974 + status = "okay";
975 + };
976 +
977 +diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
978 +index 31cc1541f1f59..e0ed323935a4d 100644
979 +--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi
980 ++++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi
981 +@@ -1190,8 +1190,8 @@
982 +
983 + uart0 {
984 + uart0_xfer: uart0-xfer {
985 +- rockchip,pins = <1 RK_PB1 1 &pcfg_pull_up>,
986 +- <1 RK_PB0 1 &pcfg_pull_none>;
987 ++ rockchip,pins = <1 RK_PB1 1 &pcfg_pull_none>,
988 ++ <1 RK_PB0 1 &pcfg_pull_up>;
989 + };
990 +
991 + uart0_cts: uart0-cts {
992 +@@ -1209,8 +1209,8 @@
993 +
994 + uart1 {
995 + uart1_xfer: uart1-xfer {
996 +- rockchip,pins = <3 RK_PA4 4 &pcfg_pull_up>,
997 +- <3 RK_PA6 4 &pcfg_pull_none>;
998 ++ rockchip,pins = <3 RK_PA4 4 &pcfg_pull_none>,
999 ++ <3 RK_PA6 4 &pcfg_pull_up>;
1000 + };
1001 +
1002 + uart1_cts: uart1-cts {
1003 +@@ -1228,15 +1228,15 @@
1004 +
1005 + uart2-0 {
1006 + uart2m0_xfer: uart2m0-xfer {
1007 +- rockchip,pins = <1 RK_PA0 2 &pcfg_pull_up>,
1008 +- <1 RK_PA1 2 &pcfg_pull_none>;
1009 ++ rockchip,pins = <1 RK_PA0 2 &pcfg_pull_none>,
1010 ++ <1 RK_PA1 2 &pcfg_pull_up>;
1011 + };
1012 + };
1013 +
1014 + uart2-1 {
1015 + uart2m1_xfer: uart2m1-xfer {
1016 +- rockchip,pins = <2 RK_PA0 1 &pcfg_pull_up>,
1017 +- <2 RK_PA1 1 &pcfg_pull_none>;
1018 ++ rockchip,pins = <2 RK_PA0 1 &pcfg_pull_none>,
1019 ++ <2 RK_PA1 1 &pcfg_pull_up>;
1020 + };
1021 + };
1022 +
1023 +diff --git a/arch/arm64/include/asm/kvm_host.h b/arch/arm64/include/asm/kvm_host.h
1024 +index 7140701f65f91..dfa6dc4575bec 100644
1025 +--- a/arch/arm64/include/asm/kvm_host.h
1026 ++++ b/arch/arm64/include/asm/kvm_host.h
1027 +@@ -182,6 +182,7 @@ enum vcpu_sysreg {
1028 + #define c2_TTBR1 (TTBR1_EL1 * 2) /* Translation Table Base Register 1 */
1029 + #define c2_TTBR1_high (c2_TTBR1 + 1) /* TTBR1 top 32 bits */
1030 + #define c2_TTBCR (TCR_EL1 * 2) /* Translation Table Base Control R. */
1031 ++#define c2_TTBCR2 (c2_TTBCR + 1) /* Translation Table Base Control R. 2 */
1032 + #define c3_DACR (DACR32_EL2 * 2)/* Domain Access Control Register */
1033 + #define c5_DFSR (ESR_EL1 * 2) /* Data Fault Status Register */
1034 + #define c5_IFSR (IFSR32_EL2 * 2)/* Instruction Fault Status Register */
1035 +diff --git a/arch/arm64/kernel/syscall.c b/arch/arm64/kernel/syscall.c
1036 +index 1457a0ba83dbc..f2d2dbbbfca20 100644
1037 +--- a/arch/arm64/kernel/syscall.c
1038 ++++ b/arch/arm64/kernel/syscall.c
1039 +@@ -102,8 +102,8 @@ static void el0_svc_common(struct pt_regs *regs, int scno, int sc_nr,
1040 + regs->syscallno = scno;
1041 +
1042 + cortex_a76_erratum_1463225_svc_handler();
1043 ++ user_exit_irqoff();
1044 + local_daif_restore(DAIF_PROCCTX);
1045 +- user_exit();
1046 +
1047 + if (has_syscall_work(flags)) {
1048 + /* set default errno for user-issued syscall(-1) */
1049 +diff --git a/arch/arm64/kvm/sys_regs.c b/arch/arm64/kvm/sys_regs.c
1050 +index f1f4f42e8ef46..6478635ff2142 100644
1051 +--- a/arch/arm64/kvm/sys_regs.c
1052 ++++ b/arch/arm64/kvm/sys_regs.c
1053 +@@ -1837,6 +1837,7 @@ static const struct sys_reg_desc cp15_regs[] = {
1054 + { Op1( 0), CRn( 2), CRm( 0), Op2( 0), access_vm_reg, NULL, c2_TTBR0 },
1055 + { Op1( 0), CRn( 2), CRm( 0), Op2( 1), access_vm_reg, NULL, c2_TTBR1 },
1056 + { Op1( 0), CRn( 2), CRm( 0), Op2( 2), access_vm_reg, NULL, c2_TTBCR },
1057 ++ { Op1( 0), CRn( 2), CRm( 0), Op2( 3), access_vm_reg, NULL, c2_TTBCR2 },
1058 + { Op1( 0), CRn( 3), CRm( 0), Op2( 0), access_vm_reg, NULL, c3_DACR },
1059 + { Op1( 0), CRn( 5), CRm( 0), Op2( 0), access_vm_reg, NULL, c5_DFSR },
1060 + { Op1( 0), CRn( 5), CRm( 0), Op2( 1), access_vm_reg, NULL, c5_IFSR },
1061 +diff --git a/arch/mips/bcm47xx/Kconfig b/arch/mips/bcm47xx/Kconfig
1062 +index 6889f74e06f54..490bb6da74b7e 100644
1063 +--- a/arch/mips/bcm47xx/Kconfig
1064 ++++ b/arch/mips/bcm47xx/Kconfig
1065 +@@ -27,6 +27,7 @@ config BCM47XX_BCMA
1066 + select BCMA
1067 + select BCMA_HOST_SOC
1068 + select BCMA_DRIVER_MIPS
1069 ++ select BCMA_DRIVER_PCI if PCI
1070 + select BCMA_DRIVER_PCI_HOSTMODE if PCI
1071 + select BCMA_DRIVER_GPIO
1072 + default y
1073 +diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c
1074 +index b8884de89c81e..82e44b31aad59 100644
1075 +--- a/arch/mips/kernel/setup.c
1076 ++++ b/arch/mips/kernel/setup.c
1077 +@@ -529,8 +529,8 @@ static void __init request_crashkernel(struct resource *res)
1078 +
1079 + static void __init check_kernel_sections_mem(void)
1080 + {
1081 +- phys_addr_t start = PFN_PHYS(PFN_DOWN(__pa_symbol(&_text)));
1082 +- phys_addr_t size = PFN_PHYS(PFN_UP(__pa_symbol(&_end))) - start;
1083 ++ phys_addr_t start = __pa_symbol(&_text);
1084 ++ phys_addr_t size = __pa_symbol(&_end) - start;
1085 +
1086 + if (!memblock_is_region_memory(start, size)) {
1087 + pr_info("Kernel sections are not in the memory maps\n");
1088 +diff --git a/arch/powerpc/include/asm/book3s/32/pgtable.h b/arch/powerpc/include/asm/book3s/32/pgtable.h
1089 +index 7b6349be621a3..5325bd9c9b47b 100644
1090 +--- a/arch/powerpc/include/asm/book3s/32/pgtable.h
1091 ++++ b/arch/powerpc/include/asm/book3s/32/pgtable.h
1092 +@@ -557,9 +557,9 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
1093 + if (pte_val(*ptep) & _PAGE_HASHPTE)
1094 + flush_hash_entry(mm, ptep, addr);
1095 + __asm__ __volatile__("\
1096 +- stw%U0%X0 %2,%0\n\
1097 ++ stw%X0 %2,%0\n\
1098 + eieio\n\
1099 +- stw%U0%X0 %L2,%1"
1100 ++ stw%X1 %L2,%1"
1101 + : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4))
1102 + : "r" (pte) : "memory");
1103 +
1104 +diff --git a/arch/powerpc/include/asm/cpm1.h b/arch/powerpc/include/asm/cpm1.h
1105 +index a116fe9317892..3bdd74739cb88 100644
1106 +--- a/arch/powerpc/include/asm/cpm1.h
1107 ++++ b/arch/powerpc/include/asm/cpm1.h
1108 +@@ -68,6 +68,7 @@ extern void cpm_reset(void);
1109 + #define PROFF_SPI ((uint)0x0180)
1110 + #define PROFF_SCC3 ((uint)0x0200)
1111 + #define PROFF_SMC1 ((uint)0x0280)
1112 ++#define PROFF_DSP1 ((uint)0x02c0)
1113 + #define PROFF_SCC4 ((uint)0x0300)
1114 + #define PROFF_SMC2 ((uint)0x0380)
1115 +
1116 +diff --git a/arch/powerpc/include/asm/cputable.h b/arch/powerpc/include/asm/cputable.h
1117 +index cf00ff0d121de..235911fb0e24f 100644
1118 +--- a/arch/powerpc/include/asm/cputable.h
1119 ++++ b/arch/powerpc/include/asm/cputable.h
1120 +@@ -367,7 +367,7 @@ static inline void cpu_feature_keys_init(void) { }
1121 + CPU_FTR_PPC_LE | CPU_FTR_NEED_PAIRED_STWCX)
1122 + #define CPU_FTRS_82XX (CPU_FTR_COMMON | CPU_FTR_MAYBE_CAN_DOZE | CPU_FTR_NOEXECUTE)
1123 + #define CPU_FTRS_G2_LE (CPU_FTR_COMMON | CPU_FTR_MAYBE_CAN_DOZE | \
1124 +- CPU_FTR_MAYBE_CAN_NAP)
1125 ++ CPU_FTR_MAYBE_CAN_NAP | CPU_FTR_NOEXECUTE)
1126 + #define CPU_FTRS_E300 (CPU_FTR_MAYBE_CAN_DOZE | \
1127 + CPU_FTR_MAYBE_CAN_NAP | \
1128 + CPU_FTR_COMMON | CPU_FTR_NOEXECUTE)
1129 +@@ -407,7 +407,6 @@ static inline void cpu_feature_keys_init(void) { }
1130 + CPU_FTR_DBELL | CPU_FTR_POPCNTB | CPU_FTR_POPCNTD | \
1131 + CPU_FTR_DEBUG_LVL_EXC | CPU_FTR_EMB_HV | CPU_FTR_ALTIVEC_COMP | \
1132 + CPU_FTR_CELL_TB_BUG | CPU_FTR_SMT)
1133 +-#define CPU_FTRS_GENERIC_32 (CPU_FTR_COMMON | CPU_FTR_NODSISRALIGN)
1134 +
1135 + /* 64-bit CPUs */
1136 + #define CPU_FTRS_PPC970 (CPU_FTR_LWSYNC | \
1137 +@@ -507,8 +506,6 @@ enum {
1138 + CPU_FTRS_7447 | CPU_FTRS_7447A | CPU_FTRS_82XX |
1139 + CPU_FTRS_G2_LE | CPU_FTRS_E300 | CPU_FTRS_E300C2 |
1140 + CPU_FTRS_CLASSIC32 |
1141 +-#else
1142 +- CPU_FTRS_GENERIC_32 |
1143 + #endif
1144 + #ifdef CONFIG_PPC_8xx
1145 + CPU_FTRS_8XX |
1146 +@@ -585,8 +582,6 @@ enum {
1147 + CPU_FTRS_7447 & CPU_FTRS_7447A & CPU_FTRS_82XX &
1148 + CPU_FTRS_G2_LE & CPU_FTRS_E300 & CPU_FTRS_E300C2 &
1149 + CPU_FTRS_CLASSIC32 &
1150 +-#else
1151 +- CPU_FTRS_GENERIC_32 &
1152 + #endif
1153 + #ifdef CONFIG_PPC_8xx
1154 + CPU_FTRS_8XX &
1155 +diff --git a/arch/powerpc/include/asm/nohash/pgtable.h b/arch/powerpc/include/asm/nohash/pgtable.h
1156 +index 7fed9dc0f147a..3d2a78ab051a7 100644
1157 +--- a/arch/powerpc/include/asm/nohash/pgtable.h
1158 ++++ b/arch/powerpc/include/asm/nohash/pgtable.h
1159 +@@ -199,9 +199,9 @@ static inline void __set_pte_at(struct mm_struct *mm, unsigned long addr,
1160 + */
1161 + if (IS_ENABLED(CONFIG_PPC32) && IS_ENABLED(CONFIG_PTE_64BIT) && !percpu) {
1162 + __asm__ __volatile__("\
1163 +- stw%U0%X0 %2,%0\n\
1164 ++ stw%X0 %2,%0\n\
1165 + eieio\n\
1166 +- stw%U0%X0 %L2,%1"
1167 ++ stw%X1 %L2,%1"
1168 + : "=m" (*ptep), "=m" (*((unsigned char *)ptep+4))
1169 + : "r" (pte) : "memory");
1170 + return;
1171 +diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
1172 +index 59260eb962916..afbd47b0a75cc 100644
1173 +--- a/arch/powerpc/kernel/Makefile
1174 ++++ b/arch/powerpc/kernel/Makefile
1175 +@@ -181,6 +181,9 @@ KCOV_INSTRUMENT_cputable.o := n
1176 + KCOV_INSTRUMENT_setup_64.o := n
1177 + KCOV_INSTRUMENT_paca.o := n
1178 +
1179 ++CFLAGS_setup_64.o += -fno-stack-protector
1180 ++CFLAGS_paca.o += -fno-stack-protector
1181 ++
1182 + extra-$(CONFIG_PPC_FPU) += fpu.o
1183 + extra-$(CONFIG_ALTIVEC) += vector.o
1184 + extra-$(CONFIG_PPC64) += entry_64.o
1185 +diff --git a/arch/powerpc/kernel/head_64.S b/arch/powerpc/kernel/head_64.S
1186 +index 780f527eabd2c..9019f1395d39a 100644
1187 +--- a/arch/powerpc/kernel/head_64.S
1188 ++++ b/arch/powerpc/kernel/head_64.S
1189 +@@ -420,6 +420,10 @@ generic_secondary_common_init:
1190 + /* From now on, r24 is expected to be logical cpuid */
1191 + mr r24,r5
1192 +
1193 ++ /* Create a temp kernel stack for use before relocation is on. */
1194 ++ ld r1,PACAEMERGSP(r13)
1195 ++ subi r1,r1,STACK_FRAME_OVERHEAD
1196 ++
1197 + /* See if we need to call a cpu state restore handler */
1198 + LOAD_REG_ADDR(r23, cur_cpu_spec)
1199 + ld r23,0(r23)
1200 +@@ -448,10 +452,6 @@ generic_secondary_common_init:
1201 + sync /* order paca.run and cur_cpu_spec */
1202 + isync /* In case code patching happened */
1203 +
1204 +- /* Create a temp kernel stack for use before relocation is on. */
1205 +- ld r1,PACAEMERGSP(r13)
1206 +- subi r1,r1,STACK_FRAME_OVERHEAD
1207 +-
1208 + b __secondary_start
1209 + #endif /* SMP */
1210 +
1211 +@@ -992,7 +992,7 @@ start_here_common:
1212 + bl start_kernel
1213 +
1214 + /* Not reached */
1215 +- trap
1216 ++0: trap
1217 + EMIT_BUG_ENTRY 0b, __FILE__, __LINE__, 0
1218 +
1219 + /*
1220 +diff --git a/arch/powerpc/kernel/paca.c b/arch/powerpc/kernel/paca.c
1221 +index 4ea0cca52e162..c786adfb9413f 100644
1222 +--- a/arch/powerpc/kernel/paca.c
1223 ++++ b/arch/powerpc/kernel/paca.c
1224 +@@ -176,7 +176,7 @@ static struct slb_shadow * __init new_slb_shadow(int cpu, unsigned long limit)
1225 + struct paca_struct **paca_ptrs __read_mostly;
1226 + EXPORT_SYMBOL(paca_ptrs);
1227 +
1228 +-void __init __nostackprotector initialise_paca(struct paca_struct *new_paca, int cpu)
1229 ++void __init initialise_paca(struct paca_struct *new_paca, int cpu)
1230 + {
1231 + #ifdef CONFIG_PPC_PSERIES
1232 + new_paca->lppaca_ptr = NULL;
1233 +@@ -205,7 +205,7 @@ void __init __nostackprotector initialise_paca(struct paca_struct *new_paca, int
1234 + }
1235 +
1236 + /* Put the paca pointer into r13 and SPRG_PACA */
1237 +-void __nostackprotector setup_paca(struct paca_struct *new_paca)
1238 ++void setup_paca(struct paca_struct *new_paca)
1239 + {
1240 + /* Setup r13 */
1241 + local_paca = new_paca;
1242 +diff --git a/arch/powerpc/kernel/rtas.c b/arch/powerpc/kernel/rtas.c
1243 +index c62ff66d44ad9..c1e2e351ebff8 100644
1244 +--- a/arch/powerpc/kernel/rtas.c
1245 ++++ b/arch/powerpc/kernel/rtas.c
1246 +@@ -978,7 +978,7 @@ static struct rtas_filter rtas_filters[] __ro_after_init = {
1247 + { "ibm,display-message", -1, 0, -1, -1, -1 },
1248 + { "ibm,errinjct", -1, 2, -1, -1, -1, 1024 },
1249 + { "ibm,close-errinjct", -1, -1, -1, -1, -1 },
1250 +- { "ibm,open-errinct", -1, -1, -1, -1, -1 },
1251 ++ { "ibm,open-errinjct", -1, -1, -1, -1, -1 },
1252 + { "ibm,get-config-addr-info2", -1, -1, -1, -1, -1 },
1253 + { "ibm,get-dynamic-sensor-state", -1, 1, -1, -1, -1 },
1254 + { "ibm,get-indices", -1, 2, 3, -1, -1 },
1255 +diff --git a/arch/powerpc/kernel/setup-common.c b/arch/powerpc/kernel/setup-common.c
1256 +index 25aaa39030009..f281d011f4b97 100644
1257 +--- a/arch/powerpc/kernel/setup-common.c
1258 ++++ b/arch/powerpc/kernel/setup-common.c
1259 +@@ -903,8 +903,6 @@ void __init setup_arch(char **cmdline_p)
1260 +
1261 + /* On BookE, setup per-core TLB data structures. */
1262 + setup_tlb_core_data();
1263 +-
1264 +- smp_release_cpus();
1265 + #endif
1266 +
1267 + /* Print various info about the machine that has been gathered so far. */
1268 +@@ -925,6 +923,8 @@ void __init setup_arch(char **cmdline_p)
1269 + exc_lvl_early_init();
1270 + emergency_stack_init();
1271 +
1272 ++ smp_release_cpus();
1273 ++
1274 + initmem_init();
1275 +
1276 + early_memtest(min_low_pfn << PAGE_SHIFT, max_low_pfn << PAGE_SHIFT);
1277 +diff --git a/arch/powerpc/kernel/setup.h b/arch/powerpc/kernel/setup.h
1278 +index 1b02d338a5f55..c82577c4b15d3 100644
1279 +--- a/arch/powerpc/kernel/setup.h
1280 ++++ b/arch/powerpc/kernel/setup.h
1281 +@@ -8,12 +8,6 @@
1282 + #ifndef __ARCH_POWERPC_KERNEL_SETUP_H
1283 + #define __ARCH_POWERPC_KERNEL_SETUP_H
1284 +
1285 +-#ifdef CONFIG_CC_IS_CLANG
1286 +-#define __nostackprotector
1287 +-#else
1288 +-#define __nostackprotector __attribute__((__optimize__("no-stack-protector")))
1289 +-#endif
1290 +-
1291 + void initialize_cache_info(void);
1292 + void irqstack_early_init(void);
1293 +
1294 +diff --git a/arch/powerpc/kernel/setup_64.c b/arch/powerpc/kernel/setup_64.c
1295 +index 480c236724da2..5bc7e753df4d0 100644
1296 +--- a/arch/powerpc/kernel/setup_64.c
1297 ++++ b/arch/powerpc/kernel/setup_64.c
1298 +@@ -284,7 +284,7 @@ void __init record_spr_defaults(void)
1299 + * device-tree is not accessible via normal means at this point.
1300 + */
1301 +
1302 +-void __init __nostackprotector early_setup(unsigned long dt_ptr)
1303 ++void __init early_setup(unsigned long dt_ptr)
1304 + {
1305 + static __initdata struct paca_struct boot_paca;
1306 +
1307 +diff --git a/arch/powerpc/mm/fault.c b/arch/powerpc/mm/fault.c
1308 +index 187047592d53c..bb01a862aaf8d 100644
1309 +--- a/arch/powerpc/mm/fault.c
1310 ++++ b/arch/powerpc/mm/fault.c
1311 +@@ -349,7 +349,6 @@ static inline void cmo_account_page_fault(void)
1312 + static inline void cmo_account_page_fault(void) { }
1313 + #endif /* CONFIG_PPC_SMLPAR */
1314 +
1315 +-#ifdef CONFIG_PPC_BOOK3S
1316 + static void sanity_check_fault(bool is_write, bool is_user,
1317 + unsigned long error_code, unsigned long address)
1318 + {
1319 +@@ -366,6 +365,9 @@ static void sanity_check_fault(bool is_write, bool is_user,
1320 + return;
1321 + }
1322 +
1323 ++ if (!IS_ENABLED(CONFIG_PPC_BOOK3S))
1324 ++ return;
1325 ++
1326 + /*
1327 + * For hash translation mode, we should never get a
1328 + * PROTFAULT. Any update to pte to reduce access will result in us
1329 +@@ -400,10 +402,6 @@ static void sanity_check_fault(bool is_write, bool is_user,
1330 +
1331 + WARN_ON_ONCE(error_code & DSISR_PROTFAULT);
1332 + }
1333 +-#else
1334 +-static void sanity_check_fault(bool is_write, bool is_user,
1335 +- unsigned long error_code, unsigned long address) { }
1336 +-#endif /* CONFIG_PPC_BOOK3S */
1337 +
1338 + /*
1339 + * Define the correct "is_write" bit in error_code based
1340 +diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
1341 +index 96ca90ce0264a..c48705c726ac6 100644
1342 +--- a/arch/powerpc/mm/mem.c
1343 ++++ b/arch/powerpc/mm/mem.c
1344 +@@ -530,7 +530,7 @@ void __flush_dcache_icache(void *p)
1345 + * space occurs, before returning to user space.
1346 + */
1347 +
1348 +- if (cpu_has_feature(MMU_FTR_TYPE_44x))
1349 ++ if (mmu_has_feature(MMU_FTR_TYPE_44x))
1350 + return;
1351 +
1352 + invalidate_icache_range(addr, addr + PAGE_SIZE);
1353 +diff --git a/arch/powerpc/perf/core-book3s.c b/arch/powerpc/perf/core-book3s.c
1354 +index f582aa2d98078..02fc75ddcbb36 100644
1355 +--- a/arch/powerpc/perf/core-book3s.c
1356 ++++ b/arch/powerpc/perf/core-book3s.c
1357 +@@ -133,6 +133,9 @@ static void pmao_restore_workaround(bool ebb) { }
1358 +
1359 + bool is_sier_available(void)
1360 + {
1361 ++ if (!ppmu)
1362 ++ return false;
1363 ++
1364 + if (ppmu->flags & PPMU_HAS_SIER)
1365 + return true;
1366 +
1367 +@@ -2086,6 +2089,16 @@ static void record_and_restart(struct perf_event *event, unsigned long val,
1368 + local64_set(&event->hw.period_left, left);
1369 + perf_event_update_userpage(event);
1370 +
1371 ++ /*
1372 ++ * Due to hardware limitation, sometimes SIAR could sample a kernel
1373 ++ * address even when freeze on supervisor state (kernel) is set in
1374 ++ * MMCR2. Check attr.exclude_kernel and address to drop the sample in
1375 ++ * these cases.
1376 ++ */
1377 ++ if (event->attr.exclude_kernel && record)
1378 ++ if (is_kernel_addr(mfspr(SPRN_SIAR)))
1379 ++ record = 0;
1380 ++
1381 + /*
1382 + * Finally record data if requested.
1383 + */
1384 +diff --git a/arch/powerpc/platforms/8xx/micropatch.c b/arch/powerpc/platforms/8xx/micropatch.c
1385 +index c80bd7afd6c5e..b06c6d26dd722 100644
1386 +--- a/arch/powerpc/platforms/8xx/micropatch.c
1387 ++++ b/arch/powerpc/platforms/8xx/micropatch.c
1388 +@@ -361,6 +361,17 @@ void __init cpm_load_patch(cpm8xx_t *cp)
1389 + if (IS_ENABLED(CONFIG_SMC_UCODE_PATCH)) {
1390 + smc_uart_t *smp;
1391 +
1392 ++ if (IS_ENABLED(CONFIG_PPC_EARLY_DEBUG_CPM)) {
1393 ++ int i;
1394 ++
1395 ++ for (i = 0; i < sizeof(*smp); i += 4) {
1396 ++ u32 __iomem *src = (u32 __iomem *)&cp->cp_dparam[PROFF_SMC1 + i];
1397 ++ u32 __iomem *dst = (u32 __iomem *)&cp->cp_dparam[PROFF_DSP1 + i];
1398 ++
1399 ++ out_be32(dst, in_be32(src));
1400 ++ }
1401 ++ }
1402 ++
1403 + smp = (smc_uart_t *)&cp->cp_dparam[PROFF_SMC1];
1404 + out_be16(&smp->smc_rpbase, 0x1ec0);
1405 + smp = (smc_uart_t *)&cp->cp_dparam[PROFF_SMC2];
1406 +diff --git a/arch/powerpc/platforms/powernv/memtrace.c b/arch/powerpc/platforms/powernv/memtrace.c
1407 +index eb2e75dac369a..b45ab455a18e8 100644
1408 +--- a/arch/powerpc/platforms/powernv/memtrace.c
1409 ++++ b/arch/powerpc/platforms/powernv/memtrace.c
1410 +@@ -30,6 +30,7 @@ struct memtrace_entry {
1411 + char name[16];
1412 + };
1413 +
1414 ++static DEFINE_MUTEX(memtrace_mutex);
1415 + static u64 memtrace_size;
1416 +
1417 + static struct memtrace_entry *memtrace_array;
1418 +@@ -67,6 +68,23 @@ static int change_memblock_state(struct memory_block *mem, void *arg)
1419 + return 0;
1420 + }
1421 +
1422 ++static void memtrace_clear_range(unsigned long start_pfn,
1423 ++ unsigned long nr_pages)
1424 ++{
1425 ++ unsigned long pfn;
1426 ++
1427 ++ /*
1428 ++ * As pages are offline, we cannot trust the memmap anymore. As HIGHMEM
1429 ++ * does not apply, avoid passing around "struct page" and use
1430 ++ * clear_page() instead directly.
1431 ++ */
1432 ++ for (pfn = start_pfn; pfn < start_pfn + nr_pages; pfn++) {
1433 ++ if (IS_ALIGNED(pfn, PAGES_PER_SECTION))
1434 ++ cond_resched();
1435 ++ clear_page(__va(PFN_PHYS(pfn)));
1436 ++ }
1437 ++}
1438 ++
1439 + /* called with device_hotplug_lock held */
1440 + static bool memtrace_offline_pages(u32 nid, u64 start_pfn, u64 nr_pages)
1441 + {
1442 +@@ -111,6 +129,11 @@ static u64 memtrace_alloc_node(u32 nid, u64 size)
1443 + lock_device_hotplug();
1444 + for (base_pfn = end_pfn; base_pfn > start_pfn; base_pfn -= nr_pages) {
1445 + if (memtrace_offline_pages(nid, base_pfn, nr_pages) == true) {
1446 ++ /*
1447 ++ * Clear the range while we still have a linear
1448 ++ * mapping.
1449 ++ */
1450 ++ memtrace_clear_range(base_pfn, nr_pages);
1451 + /*
1452 + * Remove memory in memory block size chunks so that
1453 + * iomem resources are always split to the same size and
1454 +@@ -268,6 +291,7 @@ static int memtrace_online(void)
1455 +
1456 + static int memtrace_enable_set(void *data, u64 val)
1457 + {
1458 ++ int rc = -EAGAIN;
1459 + u64 bytes;
1460 +
1461 + /*
1462 +@@ -280,25 +304,31 @@ static int memtrace_enable_set(void *data, u64 val)
1463 + return -EINVAL;
1464 + }
1465 +
1466 ++ mutex_lock(&memtrace_mutex);
1467 ++
1468 + /* Re-add/online previously removed/offlined memory */
1469 + if (memtrace_size) {
1470 + if (memtrace_online())
1471 +- return -EAGAIN;
1472 ++ goto out_unlock;
1473 + }
1474 +
1475 +- if (!val)
1476 +- return 0;
1477 ++ if (!val) {
1478 ++ rc = 0;
1479 ++ goto out_unlock;
1480 ++ }
1481 +
1482 + /* Offline and remove memory */
1483 + if (memtrace_init_regions_runtime(val))
1484 +- return -EINVAL;
1485 ++ goto out_unlock;
1486 +
1487 + if (memtrace_init_debugfs())
1488 +- return -EINVAL;
1489 ++ goto out_unlock;
1490 +
1491 + memtrace_size = val;
1492 +-
1493 +- return 0;
1494 ++ rc = 0;
1495 ++out_unlock:
1496 ++ mutex_unlock(&memtrace_mutex);
1497 ++ return rc;
1498 + }
1499 +
1500 + static int memtrace_enable_get(void *data, u64 *val)
1501 +diff --git a/arch/powerpc/platforms/powernv/npu-dma.c b/arch/powerpc/platforms/powernv/npu-dma.c
1502 +index b95b9e3c4c98e..c640cb993209a 100644
1503 +--- a/arch/powerpc/platforms/powernv/npu-dma.c
1504 ++++ b/arch/powerpc/platforms/powernv/npu-dma.c
1505 +@@ -384,7 +384,8 @@ static void pnv_npu_peers_take_ownership(struct iommu_table_group *table_group)
1506 + for (i = 0; i < npucomp->pe_num; ++i) {
1507 + struct pnv_ioda_pe *pe = npucomp->pe[i];
1508 +
1509 +- if (!pe->table_group.ops->take_ownership)
1510 ++ if (!pe->table_group.ops ||
1511 ++ !pe->table_group.ops->take_ownership)
1512 + continue;
1513 + pe->table_group.ops->take_ownership(&pe->table_group);
1514 + }
1515 +@@ -400,7 +401,8 @@ static void pnv_npu_peers_release_ownership(
1516 + for (i = 0; i < npucomp->pe_num; ++i) {
1517 + struct pnv_ioda_pe *pe = npucomp->pe[i];
1518 +
1519 +- if (!pe->table_group.ops->release_ownership)
1520 ++ if (!pe->table_group.ops ||
1521 ++ !pe->table_group.ops->release_ownership)
1522 + continue;
1523 + pe->table_group.ops->release_ownership(&pe->table_group);
1524 + }
1525 +@@ -560,6 +562,11 @@ int pnv_npu2_map_lpar_dev(struct pci_dev *gpdev, unsigned int lparid,
1526 + return -ENODEV;
1527 +
1528 + hose = pci_bus_to_host(npdev->bus);
1529 ++ if (hose->npu == NULL) {
1530 ++ dev_info_once(&npdev->dev, "Nvlink1 does not support contexts");
1531 ++ return 0;
1532 ++ }
1533 ++
1534 + nphb = hose->private_data;
1535 +
1536 + dev_dbg(&gpdev->dev, "Map LPAR opalid=%llu lparid=%u\n",
1537 +@@ -607,6 +614,11 @@ int pnv_npu2_unmap_lpar_dev(struct pci_dev *gpdev)
1538 + return -ENODEV;
1539 +
1540 + hose = pci_bus_to_host(npdev->bus);
1541 ++ if (hose->npu == NULL) {
1542 ++ dev_info_once(&npdev->dev, "Nvlink1 does not support contexts");
1543 ++ return 0;
1544 ++ }
1545 ++
1546 + nphb = hose->private_data;
1547 +
1548 + dev_dbg(&gpdev->dev, "destroy context opalid=%llu\n",
1549 +diff --git a/arch/powerpc/platforms/pseries/suspend.c b/arch/powerpc/platforms/pseries/suspend.c
1550 +index f789693f61f40..e5ecadfb5dea2 100644
1551 +--- a/arch/powerpc/platforms/pseries/suspend.c
1552 ++++ b/arch/powerpc/platforms/pseries/suspend.c
1553 +@@ -13,7 +13,6 @@
1554 + #include <asm/mmu.h>
1555 + #include <asm/rtas.h>
1556 + #include <asm/topology.h>
1557 +-#include "../../kernel/cacheinfo.h"
1558 +
1559 + static u64 stream_id;
1560 + static struct device suspend_dev;
1561 +@@ -78,9 +77,7 @@ static void pseries_suspend_enable_irqs(void)
1562 + * Update configuration which can be modified based on device tree
1563 + * changes during resume.
1564 + */
1565 +- cacheinfo_cpu_offline(smp_processor_id());
1566 + post_mobility_fixup();
1567 +- cacheinfo_cpu_online(smp_processor_id());
1568 + }
1569 +
1570 + /**
1571 +@@ -190,7 +187,6 @@ static struct bus_type suspend_subsys = {
1572 +
1573 + static const struct platform_suspend_ops pseries_suspend_ops = {
1574 + .valid = suspend_valid_only_mem,
1575 +- .begin = pseries_suspend_begin,
1576 + .prepare_late = pseries_prepare_late,
1577 + .enter = pseries_suspend_enter,
1578 + };
1579 +diff --git a/arch/powerpc/xmon/nonstdio.c b/arch/powerpc/xmon/nonstdio.c
1580 +index 5c1a50912229a..9b0d85bff021e 100644
1581 +--- a/arch/powerpc/xmon/nonstdio.c
1582 ++++ b/arch/powerpc/xmon/nonstdio.c
1583 +@@ -178,7 +178,7 @@ void xmon_printf(const char *format, ...)
1584 +
1585 + if (n && rc == 0) {
1586 + /* No udbg hooks, fallback to printk() - dangerous */
1587 +- printk("%s", xmon_outbuf);
1588 ++ pr_cont("%s", xmon_outbuf);
1589 + }
1590 + }
1591 +
1592 +diff --git a/arch/s390/kernel/smp.c b/arch/s390/kernel/smp.c
1593 +index 66d7ba61803c8..659d99af91566 100644
1594 +--- a/arch/s390/kernel/smp.c
1595 ++++ b/arch/s390/kernel/smp.c
1596 +@@ -885,24 +885,12 @@ static void __no_sanitize_address smp_start_secondary(void *cpuvoid)
1597 + /* Upping and downing of CPUs */
1598 + int __cpu_up(unsigned int cpu, struct task_struct *tidle)
1599 + {
1600 +- struct pcpu *pcpu;
1601 +- int base, i, rc;
1602 ++ struct pcpu *pcpu = pcpu_devices + cpu;
1603 ++ int rc;
1604 +
1605 +- pcpu = pcpu_devices + cpu;
1606 + if (pcpu->state != CPU_STATE_CONFIGURED)
1607 + return -EIO;
1608 +- base = smp_get_base_cpu(cpu);
1609 +- for (i = 0; i <= smp_cpu_mtid; i++) {
1610 +- if (base + i < nr_cpu_ids)
1611 +- if (cpu_online(base + i))
1612 +- break;
1613 +- }
1614 +- /*
1615 +- * If this is the first CPU of the core to get online
1616 +- * do an initial CPU reset.
1617 +- */
1618 +- if (i > smp_cpu_mtid &&
1619 +- pcpu_sigp_retry(pcpu_devices + base, SIGP_INITIAL_CPU_RESET, 0) !=
1620 ++ if (pcpu_sigp_retry(pcpu, SIGP_INITIAL_CPU_RESET, 0) !=
1621 + SIGP_CC_ORDER_CODE_ACCEPTED)
1622 + return -EIO;
1623 +
1624 +diff --git a/arch/s390/purgatory/head.S b/arch/s390/purgatory/head.S
1625 +index 5a10ce34b95d1..3d1c31e0cf3dd 100644
1626 +--- a/arch/s390/purgatory/head.S
1627 ++++ b/arch/s390/purgatory/head.S
1628 +@@ -62,14 +62,15 @@
1629 + jh 10b
1630 + .endm
1631 +
1632 +-.macro START_NEXT_KERNEL base
1633 ++.macro START_NEXT_KERNEL base subcode
1634 + lg %r4,kernel_entry-\base(%r13)
1635 + lg %r5,load_psw_mask-\base(%r13)
1636 + ogr %r4,%r5
1637 + stg %r4,0(%r0)
1638 +
1639 + xgr %r0,%r0
1640 +- diag %r0,%r0,0x308
1641 ++ lghi %r1,\subcode
1642 ++ diag %r0,%r1,0x308
1643 + .endm
1644 +
1645 + .text
1646 +@@ -123,7 +124,7 @@ ENTRY(purgatory_start)
1647 + je .start_crash_kernel
1648 +
1649 + /* start normal kernel */
1650 +- START_NEXT_KERNEL .base_crash
1651 ++ START_NEXT_KERNEL .base_crash 0
1652 +
1653 + .return_old_kernel:
1654 + lmg %r6,%r15,gprregs-.base_crash(%r13)
1655 +@@ -227,7 +228,7 @@ ENTRY(purgatory_start)
1656 + MEMCPY %r9,%r10,%r11
1657 +
1658 + /* start crash kernel */
1659 +- START_NEXT_KERNEL .base_dst
1660 ++ START_NEXT_KERNEL .base_dst 1
1661 +
1662 +
1663 + load_psw_mask:
1664 +diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c
1665 +index e6d91819da921..28b9ffd85db0b 100644
1666 +--- a/arch/sparc/mm/init_64.c
1667 ++++ b/arch/sparc/mm/init_64.c
1668 +@@ -2904,7 +2904,7 @@ pgtable_t pte_alloc_one(struct mm_struct *mm)
1669 + if (!page)
1670 + return NULL;
1671 + if (!pgtable_pte_page_ctor(page)) {
1672 +- free_unref_page(page);
1673 ++ __free_page(page);
1674 + return NULL;
1675 + }
1676 + return (pte_t *) page_address(page);
1677 +diff --git a/arch/um/drivers/chan_user.c b/arch/um/drivers/chan_user.c
1678 +index 4d80526a4236e..d8845d4aac6a7 100644
1679 +--- a/arch/um/drivers/chan_user.c
1680 ++++ b/arch/um/drivers/chan_user.c
1681 +@@ -26,10 +26,10 @@ int generic_read(int fd, char *c_out, void *unused)
1682 + n = read(fd, c_out, sizeof(*c_out));
1683 + if (n > 0)
1684 + return n;
1685 +- else if (errno == EAGAIN)
1686 +- return 0;
1687 + else if (n == 0)
1688 + return -EIO;
1689 ++ else if (errno == EAGAIN)
1690 ++ return 0;
1691 + return -errno;
1692 + }
1693 +
1694 +diff --git a/arch/um/drivers/xterm.c b/arch/um/drivers/xterm.c
1695 +index fc7f1e7467032..87ca4a47cd66e 100644
1696 +--- a/arch/um/drivers/xterm.c
1697 ++++ b/arch/um/drivers/xterm.c
1698 +@@ -18,6 +18,7 @@
1699 + struct xterm_chan {
1700 + int pid;
1701 + int helper_pid;
1702 ++ int chan_fd;
1703 + char *title;
1704 + int device;
1705 + int raw;
1706 +@@ -33,6 +34,7 @@ static void *xterm_init(char *str, int device, const struct chan_opts *opts)
1707 + return NULL;
1708 + *data = ((struct xterm_chan) { .pid = -1,
1709 + .helper_pid = -1,
1710 ++ .chan_fd = -1,
1711 + .device = device,
1712 + .title = opts->xterm_title,
1713 + .raw = opts->raw } );
1714 +@@ -149,6 +151,7 @@ static int xterm_open(int input, int output, int primary, void *d,
1715 + goto out_kill;
1716 + }
1717 +
1718 ++ data->chan_fd = fd;
1719 + new = xterm_fd(fd, &data->helper_pid);
1720 + if (new < 0) {
1721 + err = new;
1722 +@@ -206,6 +209,8 @@ static void xterm_close(int fd, void *d)
1723 + os_kill_process(data->helper_pid, 0);
1724 + data->helper_pid = -1;
1725 +
1726 ++ if (data->chan_fd != -1)
1727 ++ os_close_file(data->chan_fd);
1728 + os_close_file(fd);
1729 + }
1730 +
1731 +diff --git a/arch/um/os-Linux/irq.c b/arch/um/os-Linux/irq.c
1732 +index d508310ee5e1e..f1732c308c615 100644
1733 +--- a/arch/um/os-Linux/irq.c
1734 ++++ b/arch/um/os-Linux/irq.c
1735 +@@ -48,7 +48,7 @@ int os_epoll_triggered(int index, int events)
1736 + int os_event_mask(int irq_type)
1737 + {
1738 + if (irq_type == IRQ_READ)
1739 +- return EPOLLIN | EPOLLPRI;
1740 ++ return EPOLLIN | EPOLLPRI | EPOLLERR | EPOLLHUP | EPOLLRDHUP;
1741 + if (irq_type == IRQ_WRITE)
1742 + return EPOLLOUT;
1743 + return 0;
1744 +diff --git a/arch/um/os-Linux/umid.c b/arch/um/os-Linux/umid.c
1745 +index 44def53a11cd6..ea5c60f4393e9 100644
1746 +--- a/arch/um/os-Linux/umid.c
1747 ++++ b/arch/um/os-Linux/umid.c
1748 +@@ -137,20 +137,13 @@ static inline int is_umdir_used(char *dir)
1749 + {
1750 + char pid[sizeof("nnnnn\0")], *end, *file;
1751 + int dead, fd, p, n, err;
1752 +- size_t filelen;
1753 ++ size_t filelen = strlen(dir) + sizeof("/pid") + 1;
1754 +
1755 +- err = asprintf(&file, "%s/pid", dir);
1756 +- if (err < 0)
1757 +- return 0;
1758 +-
1759 +- filelen = strlen(file);
1760 ++ file = malloc(filelen);
1761 ++ if (!file)
1762 ++ return -ENOMEM;
1763 +
1764 +- n = snprintf(file, filelen, "%s/pid", dir);
1765 +- if (n >= filelen) {
1766 +- printk(UM_KERN_ERR "is_umdir_used - pid filename too long\n");
1767 +- err = -E2BIG;
1768 +- goto out;
1769 +- }
1770 ++ snprintf(file, filelen, "%s/pid", dir);
1771 +
1772 + dead = 0;
1773 + fd = open(file, O_RDONLY);
1774 +diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c
1775 +index c4def90777475..b24c38090dd99 100644
1776 +--- a/arch/x86/events/intel/core.c
1777 ++++ b/arch/x86/events/intel/core.c
1778 +@@ -253,7 +253,8 @@ static struct event_constraint intel_icl_event_constraints[] = {
1779 + INTEL_EVENT_CONSTRAINT_RANGE(0x48, 0x54, 0xf),
1780 + INTEL_EVENT_CONSTRAINT_RANGE(0x60, 0x8b, 0xf),
1781 + INTEL_UEVENT_CONSTRAINT(0x04a3, 0xff), /* CYCLE_ACTIVITY.STALLS_TOTAL */
1782 +- INTEL_UEVENT_CONSTRAINT(0x10a3, 0xff), /* CYCLE_ACTIVITY.STALLS_MEM_ANY */
1783 ++ INTEL_UEVENT_CONSTRAINT(0x10a3, 0xff), /* CYCLE_ACTIVITY.CYCLES_MEM_ANY */
1784 ++ INTEL_UEVENT_CONSTRAINT(0x14a3, 0xff), /* CYCLE_ACTIVITY.STALLS_MEM_ANY */
1785 + INTEL_EVENT_CONSTRAINT(0xa3, 0xf), /* CYCLE_ACTIVITY.* */
1786 + INTEL_EVENT_CONSTRAINT_RANGE(0xa8, 0xb0, 0xf),
1787 + INTEL_EVENT_CONSTRAINT_RANGE(0xb7, 0xbd, 0xf),
1788 +@@ -5057,7 +5058,7 @@ __init int intel_pmu_init(void)
1789 + extra_skl_attr = skl_format_attr;
1790 + mem_attr = icl_events_attrs;
1791 + tsx_attr = icl_tsx_events_attrs;
1792 +- x86_pmu.rtm_abort_event = X86_CONFIG(.event=0xca, .umask=0x02);
1793 ++ x86_pmu.rtm_abort_event = X86_CONFIG(.event=0xc9, .umask=0x04);
1794 + x86_pmu.lbr_pt_coexist = true;
1795 + intel_pmu_pebs_data_source_skl(pmem);
1796 + pr_cont("Icelake events, ");
1797 +diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c
1798 +index 1aaba2c8a9ba6..eb8bd0eeace7d 100644
1799 +--- a/arch/x86/events/intel/ds.c
1800 ++++ b/arch/x86/events/intel/ds.c
1801 +@@ -1912,7 +1912,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs)
1802 + * that caused the PEBS record. It's called collision.
1803 + * If collision happened, the record will be dropped.
1804 + */
1805 +- if (p->status != (1ULL << bit)) {
1806 ++ if (pebs_status != (1ULL << bit)) {
1807 + for_each_set_bit(i, (unsigned long *)&pebs_status, size)
1808 + error[i]++;
1809 + continue;
1810 +diff --git a/arch/x86/include/asm/apic.h b/arch/x86/include/asm/apic.h
1811 +index 19e94af9cc5d7..6016559ed1713 100644
1812 +--- a/arch/x86/include/asm/apic.h
1813 ++++ b/arch/x86/include/asm/apic.h
1814 +@@ -259,6 +259,7 @@ static inline u64 native_x2apic_icr_read(void)
1815 +
1816 + extern int x2apic_mode;
1817 + extern int x2apic_phys;
1818 ++extern void __init x2apic_set_max_apicid(u32 apicid);
1819 + extern void __init check_x2apic(void);
1820 + extern void x2apic_setup(void);
1821 + static inline int x2apic_enabled(void)
1822 +diff --git a/arch/x86/include/asm/cacheinfo.h b/arch/x86/include/asm/cacheinfo.h
1823 +index 86b63c7feab75..86b2e0dcc4bfe 100644
1824 +--- a/arch/x86/include/asm/cacheinfo.h
1825 ++++ b/arch/x86/include/asm/cacheinfo.h
1826 +@@ -2,7 +2,7 @@
1827 + #ifndef _ASM_X86_CACHEINFO_H
1828 + #define _ASM_X86_CACHEINFO_H
1829 +
1830 +-void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id);
1831 +-void cacheinfo_hygon_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id);
1832 ++void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu);
1833 ++void cacheinfo_hygon_init_llc_id(struct cpuinfo_x86 *c, int cpu);
1834 +
1835 + #endif /* _ASM_X86_CACHEINFO_H */
1836 +diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c
1837 +index fce94c799f015..06fa808d72032 100644
1838 +--- a/arch/x86/kernel/apic/apic.c
1839 ++++ b/arch/x86/kernel/apic/apic.c
1840 +@@ -1886,20 +1886,22 @@ static __init void try_to_enable_x2apic(int remap_mode)
1841 + return;
1842 +
1843 + if (remap_mode != IRQ_REMAP_X2APIC_MODE) {
1844 +- /* IR is required if there is APIC ID > 255 even when running
1845 +- * under KVM
1846 ++ /*
1847 ++ * Using X2APIC without IR is not architecturally supported
1848 ++ * on bare metal but may be supported in guests.
1849 + */
1850 +- if (max_physical_apicid > 255 ||
1851 +- !x86_init.hyper.x2apic_available()) {
1852 ++ if (!x86_init.hyper.x2apic_available()) {
1853 + pr_info("x2apic: IRQ remapping doesn't support X2APIC mode\n");
1854 + x2apic_disable();
1855 + return;
1856 + }
1857 +
1858 + /*
1859 +- * without IR all CPUs can be addressed by IOAPIC/MSI
1860 +- * only in physical mode
1861 ++ * Without IR, all CPUs can be addressed by IOAPIC/MSI only
1862 ++ * in physical mode, and CPUs with an APIC ID that cannnot
1863 ++ * be addressed must not be brought online.
1864 + */
1865 ++ x2apic_set_max_apicid(255);
1866 + x2apic_phys = 1;
1867 + }
1868 + x2apic_enable();
1869 +diff --git a/arch/x86/kernel/apic/x2apic_phys.c b/arch/x86/kernel/apic/x2apic_phys.c
1870 +index bc9693841353c..e14eae6d6ea71 100644
1871 +--- a/arch/x86/kernel/apic/x2apic_phys.c
1872 ++++ b/arch/x86/kernel/apic/x2apic_phys.c
1873 +@@ -8,6 +8,12 @@
1874 + int x2apic_phys;
1875 +
1876 + static struct apic apic_x2apic_phys;
1877 ++static u32 x2apic_max_apicid __ro_after_init;
1878 ++
1879 ++void __init x2apic_set_max_apicid(u32 apicid)
1880 ++{
1881 ++ x2apic_max_apicid = apicid;
1882 ++}
1883 +
1884 + static int __init set_x2apic_phys_mode(char *arg)
1885 + {
1886 +@@ -98,6 +104,9 @@ static int x2apic_phys_probe(void)
1887 + /* Common x2apic functions, also used by x2apic_cluster */
1888 + int x2apic_apic_id_valid(u32 apicid)
1889 + {
1890 ++ if (x2apic_max_apicid && apicid > x2apic_max_apicid)
1891 ++ return 0;
1892 ++
1893 + return 1;
1894 + }
1895 +
1896 +diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
1897 +index c553cafd0736b..52373921af2eb 100644
1898 +--- a/arch/x86/kernel/cpu/amd.c
1899 ++++ b/arch/x86/kernel/cpu/amd.c
1900 +@@ -335,7 +335,6 @@ static void amd_get_topology_early(struct cpuinfo_x86 *c)
1901 + */
1902 + static void amd_get_topology(struct cpuinfo_x86 *c)
1903 + {
1904 +- u8 node_id;
1905 + int cpu = smp_processor_id();
1906 +
1907 + /* get information required for multi-node processors */
1908 +@@ -345,7 +344,7 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
1909 +
1910 + cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
1911 +
1912 +- node_id = ecx & 0xff;
1913 ++ c->cpu_die_id = ecx & 0xff;
1914 +
1915 + if (c->x86 == 0x15)
1916 + c->cu_id = ebx & 0xff;
1917 +@@ -365,15 +364,15 @@ static void amd_get_topology(struct cpuinfo_x86 *c)
1918 + if (!err)
1919 + c->x86_coreid_bits = get_count_order(c->x86_max_cores);
1920 +
1921 +- cacheinfo_amd_init_llc_id(c, cpu, node_id);
1922 ++ cacheinfo_amd_init_llc_id(c, cpu);
1923 +
1924 + } else if (cpu_has(c, X86_FEATURE_NODEID_MSR)) {
1925 + u64 value;
1926 +
1927 + rdmsrl(MSR_FAM10H_NODE_ID, value);
1928 +- node_id = value & 7;
1929 ++ c->cpu_die_id = value & 7;
1930 +
1931 +- per_cpu(cpu_llc_id, cpu) = node_id;
1932 ++ per_cpu(cpu_llc_id, cpu) = c->cpu_die_id;
1933 + } else
1934 + return;
1935 +
1936 +@@ -398,7 +397,7 @@ static void amd_detect_cmp(struct cpuinfo_x86 *c)
1937 + /* Convert the initial APIC ID into the socket ID */
1938 + c->phys_proc_id = c->initial_apicid >> bits;
1939 + /* use socket ID also for last level cache */
1940 +- per_cpu(cpu_llc_id, cpu) = c->phys_proc_id;
1941 ++ per_cpu(cpu_llc_id, cpu) = c->cpu_die_id = c->phys_proc_id;
1942 + }
1943 +
1944 + u16 amd_get_nb_id(int cpu)
1945 +diff --git a/arch/x86/kernel/cpu/cacheinfo.c b/arch/x86/kernel/cpu/cacheinfo.c
1946 +index c7503be92f359..30f33b75209a1 100644
1947 +--- a/arch/x86/kernel/cpu/cacheinfo.c
1948 ++++ b/arch/x86/kernel/cpu/cacheinfo.c
1949 +@@ -646,7 +646,7 @@ static int find_num_cache_leaves(struct cpuinfo_x86 *c)
1950 + return i;
1951 + }
1952 +
1953 +-void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id)
1954 ++void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu)
1955 + {
1956 + /*
1957 + * We may have multiple LLCs if L3 caches exist, so check if we
1958 +@@ -657,7 +657,7 @@ void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id)
1959 +
1960 + if (c->x86 < 0x17) {
1961 + /* LLC is at the node level. */
1962 +- per_cpu(cpu_llc_id, cpu) = node_id;
1963 ++ per_cpu(cpu_llc_id, cpu) = c->cpu_die_id;
1964 + } else if (c->x86 == 0x17 && c->x86_model <= 0x1F) {
1965 + /*
1966 + * LLC is at the core complex level.
1967 +@@ -684,7 +684,7 @@ void cacheinfo_amd_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id)
1968 + }
1969 + }
1970 +
1971 +-void cacheinfo_hygon_init_llc_id(struct cpuinfo_x86 *c, int cpu, u8 node_id)
1972 ++void cacheinfo_hygon_init_llc_id(struct cpuinfo_x86 *c, int cpu)
1973 + {
1974 + /*
1975 + * We may have multiple LLCs if L3 caches exist, so check if we
1976 +diff --git a/arch/x86/kernel/cpu/hygon.c b/arch/x86/kernel/cpu/hygon.c
1977 +index 4e28c1fc87499..62e9a982adaf9 100644
1978 +--- a/arch/x86/kernel/cpu/hygon.c
1979 ++++ b/arch/x86/kernel/cpu/hygon.c
1980 +@@ -64,7 +64,6 @@ static void hygon_get_topology_early(struct cpuinfo_x86 *c)
1981 + */
1982 + static void hygon_get_topology(struct cpuinfo_x86 *c)
1983 + {
1984 +- u8 node_id;
1985 + int cpu = smp_processor_id();
1986 +
1987 + /* get information required for multi-node processors */
1988 +@@ -74,7 +73,7 @@ static void hygon_get_topology(struct cpuinfo_x86 *c)
1989 +
1990 + cpuid(0x8000001e, &eax, &ebx, &ecx, &edx);
1991 +
1992 +- node_id = ecx & 0xff;
1993 ++ c->cpu_die_id = ecx & 0xff;
1994 +
1995 + c->cpu_core_id = ebx & 0xff;
1996 +
1997 +@@ -92,14 +91,14 @@ static void hygon_get_topology(struct cpuinfo_x86 *c)
1998 + /* Socket ID is ApicId[6] for these processors. */
1999 + c->phys_proc_id = c->apicid >> APICID_SOCKET_ID_BIT;
2000 +
2001 +- cacheinfo_hygon_init_llc_id(c, cpu, node_id);
2002 ++ cacheinfo_hygon_init_llc_id(c, cpu);
2003 + } else if (cpu_has(c, X86_FEATURE_NODEID_MSR)) {
2004 + u64 value;
2005 +
2006 + rdmsrl(MSR_FAM10H_NODE_ID, value);
2007 +- node_id = value & 7;
2008 ++ c->cpu_die_id = value & 7;
2009 +
2010 +- per_cpu(cpu_llc_id, cpu) = node_id;
2011 ++ per_cpu(cpu_llc_id, cpu) = c->cpu_die_id;
2012 + } else
2013 + return;
2014 +
2015 +@@ -122,7 +121,7 @@ static void hygon_detect_cmp(struct cpuinfo_x86 *c)
2016 + /* Convert the initial APIC ID into the socket ID */
2017 + c->phys_proc_id = c->initial_apicid >> bits;
2018 + /* use socket ID also for last level cache */
2019 +- per_cpu(cpu_llc_id, cpu) = c->phys_proc_id;
2020 ++ per_cpu(cpu_llc_id, cpu) = c->cpu_die_id = c->phys_proc_id;
2021 + }
2022 +
2023 + static void srat_detect_node(struct cpuinfo_x86 *c)
2024 +diff --git a/arch/x86/kernel/kprobes/core.c b/arch/x86/kernel/kprobes/core.c
2025 +index 62c39baea39e3..5294018535d0c 100644
2026 +--- a/arch/x86/kernel/kprobes/core.c
2027 ++++ b/arch/x86/kernel/kprobes/core.c
2028 +@@ -1019,6 +1019,11 @@ int kprobe_fault_handler(struct pt_regs *regs, int trapnr)
2029 + * So clear it by resetting the current kprobe:
2030 + */
2031 + regs->flags &= ~X86_EFLAGS_TF;
2032 ++ /*
2033 ++ * Since the single step (trap) has been cancelled,
2034 ++ * we need to restore BTF here.
2035 ++ */
2036 ++ restore_btf();
2037 +
2038 + /*
2039 + * If the TF flag was set before the kprobe hit,
2040 +diff --git a/arch/x86/mm/ident_map.c b/arch/x86/mm/ident_map.c
2041 +index fe7a12599d8eb..968d7005f4a72 100644
2042 +--- a/arch/x86/mm/ident_map.c
2043 ++++ b/arch/x86/mm/ident_map.c
2044 +@@ -62,6 +62,7 @@ static int ident_p4d_init(struct x86_mapping_info *info, p4d_t *p4d_page,
2045 + unsigned long addr, unsigned long end)
2046 + {
2047 + unsigned long next;
2048 ++ int result;
2049 +
2050 + for (; addr < end; addr = next) {
2051 + p4d_t *p4d = p4d_page + p4d_index(addr);
2052 +@@ -73,13 +74,20 @@ static int ident_p4d_init(struct x86_mapping_info *info, p4d_t *p4d_page,
2053 +
2054 + if (p4d_present(*p4d)) {
2055 + pud = pud_offset(p4d, 0);
2056 +- ident_pud_init(info, pud, addr, next);
2057 ++ result = ident_pud_init(info, pud, addr, next);
2058 ++ if (result)
2059 ++ return result;
2060 ++
2061 + continue;
2062 + }
2063 + pud = (pud_t *)info->alloc_pgt_page(info->context);
2064 + if (!pud)
2065 + return -ENOMEM;
2066 +- ident_pud_init(info, pud, addr, next);
2067 ++
2068 ++ result = ident_pud_init(info, pud, addr, next);
2069 ++ if (result)
2070 ++ return result;
2071 ++
2072 + set_p4d(p4d, __p4d(__pa(pud) | info->kernpg_flag));
2073 + }
2074 +
2075 +diff --git a/block/blk-mq.c b/block/blk-mq.c
2076 +index b748d1e63f9c8..057a634396a90 100644
2077 +--- a/block/blk-mq.c
2078 ++++ b/block/blk-mq.c
2079 +@@ -1205,6 +1205,23 @@ static void blk_mq_update_dispatch_busy(struct blk_mq_hw_ctx *hctx, bool busy)
2080 +
2081 + #define BLK_MQ_RESOURCE_DELAY 3 /* ms units */
2082 +
2083 ++static void blk_mq_handle_dev_resource(struct request *rq,
2084 ++ struct list_head *list)
2085 ++{
2086 ++ struct request *next =
2087 ++ list_first_entry_or_null(list, struct request, queuelist);
2088 ++
2089 ++ /*
2090 ++ * If an I/O scheduler has been configured and we got a driver tag for
2091 ++ * the next request already, free it.
2092 ++ */
2093 ++ if (next)
2094 ++ blk_mq_put_driver_tag(next);
2095 ++
2096 ++ list_add(&rq->queuelist, list);
2097 ++ __blk_mq_requeue_request(rq);
2098 ++}
2099 ++
2100 + /*
2101 + * Returns true if we did some work AND can potentially do more.
2102 + */
2103 +@@ -1216,6 +1233,7 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
2104 + bool no_tag = false;
2105 + int errors, queued;
2106 + blk_status_t ret = BLK_STS_OK;
2107 ++ bool no_budget_avail = false;
2108 +
2109 + if (list_empty(list))
2110 + return false;
2111 +@@ -1234,6 +1252,7 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
2112 + hctx = rq->mq_hctx;
2113 + if (!got_budget && !blk_mq_get_dispatch_budget(hctx)) {
2114 + blk_mq_put_driver_tag(rq);
2115 ++ no_budget_avail = true;
2116 + break;
2117 + }
2118 +
2119 +@@ -1274,17 +1293,7 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
2120 +
2121 + ret = q->mq_ops->queue_rq(hctx, &bd);
2122 + if (ret == BLK_STS_RESOURCE || ret == BLK_STS_DEV_RESOURCE) {
2123 +- /*
2124 +- * If an I/O scheduler has been configured and we got a
2125 +- * driver tag for the next request already, free it
2126 +- * again.
2127 +- */
2128 +- if (!list_empty(list)) {
2129 +- nxt = list_first_entry(list, struct request, queuelist);
2130 +- blk_mq_put_driver_tag(nxt);
2131 +- }
2132 +- list_add(&rq->queuelist, list);
2133 +- __blk_mq_requeue_request(rq);
2134 ++ blk_mq_handle_dev_resource(rq, list);
2135 + break;
2136 + }
2137 +
2138 +@@ -1349,13 +1358,15 @@ bool blk_mq_dispatch_rq_list(struct request_queue *q, struct list_head *list,
2139 + *
2140 + * If driver returns BLK_STS_RESOURCE and SCHED_RESTART
2141 + * bit is set, run queue after a delay to avoid IO stalls
2142 +- * that could otherwise occur if the queue is idle.
2143 ++ * that could otherwise occur if the queue is idle. We'll do
2144 ++ * similar if we couldn't get budget and SCHED_RESTART is set.
2145 + */
2146 + needs_restart = blk_mq_sched_needs_restart(hctx);
2147 + if (!needs_restart ||
2148 + (no_tag && list_empty_careful(&hctx->dispatch_wait.entry)))
2149 + blk_mq_run_hw_queue(hctx, true);
2150 +- else if (needs_restart && (ret == BLK_STS_RESOURCE))
2151 ++ else if (needs_restart && (ret == BLK_STS_RESOURCE ||
2152 ++ no_budget_avail))
2153 + blk_mq_delay_run_hw_queue(hctx, BLK_MQ_RESOURCE_DELAY);
2154 +
2155 + blk_mq_update_dispatch_busy(hctx, true);
2156 +diff --git a/block/blk-zoned.c b/block/blk-zoned.c
2157 +index 4bc5f260248a6..b17c094cb977c 100644
2158 +--- a/block/blk-zoned.c
2159 ++++ b/block/blk-zoned.c
2160 +@@ -202,32 +202,14 @@ int blkdev_report_zones(struct block_device *bdev, sector_t sector,
2161 + }
2162 + EXPORT_SYMBOL_GPL(blkdev_report_zones);
2163 +
2164 +-/*
2165 +- * Special case of zone reset operation to reset all zones in one command,
2166 +- * useful for applications like mkfs.
2167 +- */
2168 +-static int __blkdev_reset_all_zones(struct block_device *bdev, gfp_t gfp_mask)
2169 +-{
2170 +- struct bio *bio = bio_alloc(gfp_mask, 0);
2171 +- int ret;
2172 +-
2173 +- /* across the zones operations, don't need any sectors */
2174 +- bio_set_dev(bio, bdev);
2175 +- bio_set_op_attrs(bio, REQ_OP_ZONE_RESET_ALL, 0);
2176 +-
2177 +- ret = submit_bio_wait(bio);
2178 +- bio_put(bio);
2179 +-
2180 +- return ret;
2181 +-}
2182 +-
2183 + static inline bool blkdev_allow_reset_all_zones(struct block_device *bdev,
2184 ++ sector_t sector,
2185 + sector_t nr_sectors)
2186 + {
2187 + if (!blk_queue_zone_resetall(bdev_get_queue(bdev)))
2188 + return false;
2189 +
2190 +- if (nr_sectors != part_nr_sects_read(bdev->bd_part))
2191 ++ if (sector || nr_sectors != part_nr_sects_read(bdev->bd_part))
2192 + return false;
2193 + /*
2194 + * REQ_OP_ZONE_RESET_ALL can be executed only if the block device is
2195 +@@ -271,9 +253,6 @@ int blkdev_reset_zones(struct block_device *bdev,
2196 + /* Out of range */
2197 + return -EINVAL;
2198 +
2199 +- if (blkdev_allow_reset_all_zones(bdev, nr_sectors))
2200 +- return __blkdev_reset_all_zones(bdev, gfp_mask);
2201 +-
2202 + /* Check alignment (handle eventual smaller last zone) */
2203 + zone_sectors = blk_queue_zone_sectors(q);
2204 + if (sector & (zone_sectors - 1))
2205 +@@ -285,17 +264,24 @@ int blkdev_reset_zones(struct block_device *bdev,
2206 +
2207 + blk_start_plug(&plug);
2208 + while (sector < end_sector) {
2209 +-
2210 + bio = blk_next_bio(bio, 0, gfp_mask);
2211 +- bio->bi_iter.bi_sector = sector;
2212 + bio_set_dev(bio, bdev);
2213 +- bio_set_op_attrs(bio, REQ_OP_ZONE_RESET, 0);
2214 +
2215 ++ /*
2216 ++ * Special case for the zone reset operation that reset all
2217 ++ * zones, this is useful for applications like mkfs.
2218 ++ */
2219 ++ if (blkdev_allow_reset_all_zones(bdev, sector, nr_sectors)) {
2220 ++ bio->bi_opf = REQ_OP_ZONE_RESET_ALL;
2221 ++ break;
2222 ++ }
2223 ++
2224 ++ bio->bi_opf = REQ_OP_ZONE_RESET;
2225 ++ bio->bi_iter.bi_sector = sector;
2226 + sector += zone_sectors;
2227 +
2228 + /* This may take a while, so be nice to others */
2229 + cond_resched();
2230 +-
2231 + }
2232 +
2233 + ret = submit_bio_wait(bio);
2234 +diff --git a/crypto/af_alg.c b/crypto/af_alg.c
2235 +index 1d4b0157ee5dc..4a2e91baabdef 100644
2236 +--- a/crypto/af_alg.c
2237 ++++ b/crypto/af_alg.c
2238 +@@ -147,7 +147,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
2239 + const u32 allowed = CRYPTO_ALG_KERN_DRIVER_ONLY;
2240 + struct sock *sk = sock->sk;
2241 + struct alg_sock *ask = alg_sk(sk);
2242 +- struct sockaddr_alg *sa = (void *)uaddr;
2243 ++ struct sockaddr_alg_new *sa = (void *)uaddr;
2244 + const struct af_alg_type *type;
2245 + void *private;
2246 + int err;
2247 +@@ -155,7 +155,11 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
2248 + if (sock->state == SS_CONNECTED)
2249 + return -EINVAL;
2250 +
2251 +- if (addr_len < sizeof(*sa))
2252 ++ BUILD_BUG_ON(offsetof(struct sockaddr_alg_new, salg_name) !=
2253 ++ offsetof(struct sockaddr_alg, salg_name));
2254 ++ BUILD_BUG_ON(offsetof(struct sockaddr_alg, salg_name) != sizeof(*sa));
2255 ++
2256 ++ if (addr_len < sizeof(*sa) + 1)
2257 + return -EINVAL;
2258 +
2259 + /* If caller uses non-allowed flag, return error. */
2260 +@@ -163,7 +167,7 @@ static int alg_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len)
2261 + return -EINVAL;
2262 +
2263 + sa->salg_type[sizeof(sa->salg_type) - 1] = 0;
2264 +- sa->salg_name[sizeof(sa->salg_name) + addr_len - sizeof(*sa) - 1] = 0;
2265 ++ sa->salg_name[addr_len - sizeof(*sa) - 1] = 0;
2266 +
2267 + type = alg_get_type(sa->salg_type);
2268 + if (IS_ERR(type) && PTR_ERR(type) == -ENOENT) {
2269 +diff --git a/crypto/ecdh.c b/crypto/ecdh.c
2270 +index bd599053a8c4b..efa4ee72301f8 100644
2271 +--- a/crypto/ecdh.c
2272 ++++ b/crypto/ecdh.c
2273 +@@ -53,12 +53,13 @@ static int ecdh_set_secret(struct crypto_kpp *tfm, const void *buf,
2274 + return ecc_gen_privkey(ctx->curve_id, ctx->ndigits,
2275 + ctx->private_key);
2276 +
2277 +- if (ecc_is_key_valid(ctx->curve_id, ctx->ndigits,
2278 +- (const u64 *)params.key, params.key_size) < 0)
2279 +- return -EINVAL;
2280 +-
2281 + memcpy(ctx->private_key, params.key, params.key_size);
2282 +
2283 ++ if (ecc_is_key_valid(ctx->curve_id, ctx->ndigits,
2284 ++ ctx->private_key, params.key_size) < 0) {
2285 ++ memzero_explicit(ctx->private_key, params.key_size);
2286 ++ return -EINVAL;
2287 ++ }
2288 + return 0;
2289 + }
2290 +
2291 +diff --git a/drivers/acpi/acpi_pnp.c b/drivers/acpi/acpi_pnp.c
2292 +index f3039b93ff61a..101887528848d 100644
2293 +--- a/drivers/acpi/acpi_pnp.c
2294 ++++ b/drivers/acpi/acpi_pnp.c
2295 +@@ -317,6 +317,9 @@ static bool matching_id(const char *idstr, const char *list_id)
2296 + {
2297 + int i;
2298 +
2299 ++ if (strlen(idstr) != strlen(list_id))
2300 ++ return false;
2301 ++
2302 + if (memcmp(idstr, list_id, 3))
2303 + return false;
2304 +
2305 +diff --git a/drivers/acpi/device_pm.c b/drivers/acpi/device_pm.c
2306 +index 1a5956fb2cbce..72e6fad39a5e1 100644
2307 +--- a/drivers/acpi/device_pm.c
2308 ++++ b/drivers/acpi/device_pm.c
2309 +@@ -749,7 +749,7 @@ static void acpi_pm_notify_work_func(struct acpi_device_wakeup_context *context)
2310 + static DEFINE_MUTEX(acpi_wakeup_lock);
2311 +
2312 + static int __acpi_device_wakeup_enable(struct acpi_device *adev,
2313 +- u32 target_state, int max_count)
2314 ++ u32 target_state)
2315 + {
2316 + struct acpi_device_wakeup *wakeup = &adev->wakeup;
2317 + acpi_status status;
2318 +@@ -757,9 +757,10 @@ static int __acpi_device_wakeup_enable(struct acpi_device *adev,
2319 +
2320 + mutex_lock(&acpi_wakeup_lock);
2321 +
2322 +- if (wakeup->enable_count >= max_count)
2323 ++ if (wakeup->enable_count >= INT_MAX) {
2324 ++ acpi_handle_info(adev->handle, "Wakeup enable count out of bounds!\n");
2325 + goto out;
2326 +-
2327 ++ }
2328 + if (wakeup->enable_count > 0)
2329 + goto inc;
2330 +
2331 +@@ -799,7 +800,7 @@ out:
2332 + */
2333 + static int acpi_device_wakeup_enable(struct acpi_device *adev, u32 target_state)
2334 + {
2335 +- return __acpi_device_wakeup_enable(adev, target_state, 1);
2336 ++ return __acpi_device_wakeup_enable(adev, target_state);
2337 + }
2338 +
2339 + /**
2340 +@@ -829,8 +830,12 @@ out:
2341 + mutex_unlock(&acpi_wakeup_lock);
2342 + }
2343 +
2344 +-static int __acpi_pm_set_device_wakeup(struct device *dev, bool enable,
2345 +- int max_count)
2346 ++/**
2347 ++ * acpi_pm_set_device_wakeup - Enable/disable remote wakeup for given device.
2348 ++ * @dev: Device to enable/disable to generate wakeup events.
2349 ++ * @enable: Whether to enable or disable the wakeup functionality.
2350 ++ */
2351 ++int acpi_pm_set_device_wakeup(struct device *dev, bool enable)
2352 + {
2353 + struct acpi_device *adev;
2354 + int error;
2355 +@@ -850,36 +855,14 @@ static int __acpi_pm_set_device_wakeup(struct device *dev, bool enable,
2356 + return 0;
2357 + }
2358 +
2359 +- error = __acpi_device_wakeup_enable(adev, acpi_target_system_state(),
2360 +- max_count);
2361 ++ error = __acpi_device_wakeup_enable(adev, acpi_target_system_state());
2362 + if (!error)
2363 + dev_dbg(dev, "Wakeup enabled by ACPI\n");
2364 +
2365 + return error;
2366 + }
2367 +-
2368 +-/**
2369 +- * acpi_pm_set_device_wakeup - Enable/disable remote wakeup for given device.
2370 +- * @dev: Device to enable/disable to generate wakeup events.
2371 +- * @enable: Whether to enable or disable the wakeup functionality.
2372 +- */
2373 +-int acpi_pm_set_device_wakeup(struct device *dev, bool enable)
2374 +-{
2375 +- return __acpi_pm_set_device_wakeup(dev, enable, 1);
2376 +-}
2377 + EXPORT_SYMBOL_GPL(acpi_pm_set_device_wakeup);
2378 +
2379 +-/**
2380 +- * acpi_pm_set_bridge_wakeup - Enable/disable remote wakeup for given bridge.
2381 +- * @dev: Bridge device to enable/disable to generate wakeup events.
2382 +- * @enable: Whether to enable or disable the wakeup functionality.
2383 +- */
2384 +-int acpi_pm_set_bridge_wakeup(struct device *dev, bool enable)
2385 +-{
2386 +- return __acpi_pm_set_device_wakeup(dev, enable, INT_MAX);
2387 +-}
2388 +-EXPORT_SYMBOL_GPL(acpi_pm_set_bridge_wakeup);
2389 +-
2390 + /**
2391 + * acpi_dev_pm_low_power - Put ACPI device into a low-power state.
2392 + * @dev: Device to put into a low-power state.
2393 +diff --git a/drivers/acpi/resource.c b/drivers/acpi/resource.c
2394 +index 2a3e392751e0a..48ca9a844f06b 100644
2395 +--- a/drivers/acpi/resource.c
2396 ++++ b/drivers/acpi/resource.c
2397 +@@ -541,7 +541,7 @@ static acpi_status acpi_dev_process_resource(struct acpi_resource *ares,
2398 + ret = c->preproc(ares, c->preproc_data);
2399 + if (ret < 0) {
2400 + c->error = ret;
2401 +- return AE_CTRL_TERMINATE;
2402 ++ return AE_ABORT_METHOD;
2403 + } else if (ret > 0) {
2404 + return AE_OK;
2405 + }
2406 +diff --git a/drivers/android/binder.c b/drivers/android/binder.c
2407 +index b62b1ab6bb699..89b590c9573ff 100644
2408 +--- a/drivers/android/binder.c
2409 ++++ b/drivers/android/binder.c
2410 +@@ -3150,6 +3150,7 @@ static void binder_transaction(struct binder_proc *proc,
2411 + t->buffer->debug_id = t->debug_id;
2412 + t->buffer->transaction = t;
2413 + t->buffer->target_node = target_node;
2414 ++ t->buffer->clear_on_free = !!(t->flags & TF_CLEAR_BUF);
2415 + trace_binder_transaction_alloc_buf(t->buffer);
2416 +
2417 + if (binder_alloc_copy_user_to_buffer(
2418 +diff --git a/drivers/android/binder_alloc.c b/drivers/android/binder_alloc.c
2419 +index 2048ba6c8b082..3526bb1488e5e 100644
2420 +--- a/drivers/android/binder_alloc.c
2421 ++++ b/drivers/android/binder_alloc.c
2422 +@@ -647,6 +647,8 @@ static void binder_free_buf_locked(struct binder_alloc *alloc,
2423 + binder_insert_free_buffer(alloc, buffer);
2424 + }
2425 +
2426 ++static void binder_alloc_clear_buf(struct binder_alloc *alloc,
2427 ++ struct binder_buffer *buffer);
2428 + /**
2429 + * binder_alloc_free_buf() - free a binder buffer
2430 + * @alloc: binder_alloc for this proc
2431 +@@ -657,6 +659,18 @@ static void binder_free_buf_locked(struct binder_alloc *alloc,
2432 + void binder_alloc_free_buf(struct binder_alloc *alloc,
2433 + struct binder_buffer *buffer)
2434 + {
2435 ++ /*
2436 ++ * We could eliminate the call to binder_alloc_clear_buf()
2437 ++ * from binder_alloc_deferred_release() by moving this to
2438 ++ * binder_alloc_free_buf_locked(). However, that could
2439 ++ * increase contention for the alloc mutex if clear_on_free
2440 ++ * is used frequently for large buffers. The mutex is not
2441 ++ * needed for correctness here.
2442 ++ */
2443 ++ if (buffer->clear_on_free) {
2444 ++ binder_alloc_clear_buf(alloc, buffer);
2445 ++ buffer->clear_on_free = false;
2446 ++ }
2447 + mutex_lock(&alloc->mutex);
2448 + binder_free_buf_locked(alloc, buffer);
2449 + mutex_unlock(&alloc->mutex);
2450 +@@ -753,6 +767,10 @@ void binder_alloc_deferred_release(struct binder_alloc *alloc)
2451 + /* Transaction should already have been freed */
2452 + BUG_ON(buffer->transaction);
2453 +
2454 ++ if (buffer->clear_on_free) {
2455 ++ binder_alloc_clear_buf(alloc, buffer);
2456 ++ buffer->clear_on_free = false;
2457 ++ }
2458 + binder_free_buf_locked(alloc, buffer);
2459 + buffers++;
2460 + }
2461 +@@ -1086,6 +1104,36 @@ static struct page *binder_alloc_get_page(struct binder_alloc *alloc,
2462 + return lru_page->page_ptr;
2463 + }
2464 +
2465 ++/**
2466 ++ * binder_alloc_clear_buf() - zero out buffer
2467 ++ * @alloc: binder_alloc for this proc
2468 ++ * @buffer: binder buffer to be cleared
2469 ++ *
2470 ++ * memset the given buffer to 0
2471 ++ */
2472 ++static void binder_alloc_clear_buf(struct binder_alloc *alloc,
2473 ++ struct binder_buffer *buffer)
2474 ++{
2475 ++ size_t bytes = binder_alloc_buffer_size(alloc, buffer);
2476 ++ binder_size_t buffer_offset = 0;
2477 ++
2478 ++ while (bytes) {
2479 ++ unsigned long size;
2480 ++ struct page *page;
2481 ++ pgoff_t pgoff;
2482 ++ void *kptr;
2483 ++
2484 ++ page = binder_alloc_get_page(alloc, buffer,
2485 ++ buffer_offset, &pgoff);
2486 ++ size = min_t(size_t, bytes, PAGE_SIZE - pgoff);
2487 ++ kptr = kmap(page) + pgoff;
2488 ++ memset(kptr, 0, size);
2489 ++ kunmap(page);
2490 ++ bytes -= size;
2491 ++ buffer_offset += size;
2492 ++ }
2493 ++}
2494 ++
2495 + /**
2496 + * binder_alloc_copy_user_to_buffer() - copy src user to tgt user
2497 + * @alloc: binder_alloc for this proc
2498 +diff --git a/drivers/android/binder_alloc.h b/drivers/android/binder_alloc.h
2499 +index db9c1b984695d..288d0f478aa38 100644
2500 +--- a/drivers/android/binder_alloc.h
2501 ++++ b/drivers/android/binder_alloc.h
2502 +@@ -23,6 +23,7 @@ struct binder_transaction;
2503 + * @entry: entry alloc->buffers
2504 + * @rb_node: node for allocated_buffers/free_buffers rb trees
2505 + * @free: %true if buffer is free
2506 ++ * @clear_on_free: %true if buffer must be zeroed after use
2507 + * @allow_user_free: %true if user is allowed to free buffer
2508 + * @async_transaction: %true if buffer is in use for an async txn
2509 + * @debug_id: unique ID for debugging
2510 +@@ -40,9 +41,10 @@ struct binder_buffer {
2511 + struct rb_node rb_node; /* free entry by size or allocated entry */
2512 + /* by address */
2513 + unsigned free:1;
2514 ++ unsigned clear_on_free:1;
2515 + unsigned allow_user_free:1;
2516 + unsigned async_transaction:1;
2517 +- unsigned debug_id:29;
2518 ++ unsigned debug_id:28;
2519 +
2520 + struct binder_transaction *transaction;
2521 +
2522 +diff --git a/drivers/block/xen-blkback/xenbus.c b/drivers/block/xen-blkback/xenbus.c
2523 +index 192ca58cc3c7f..040d7bb213978 100644
2524 +--- a/drivers/block/xen-blkback/xenbus.c
2525 ++++ b/drivers/block/xen-blkback/xenbus.c
2526 +@@ -256,6 +256,7 @@ static int xen_blkif_disconnect(struct xen_blkif *blkif)
2527 +
2528 + if (ring->xenblkd) {
2529 + kthread_stop(ring->xenblkd);
2530 ++ ring->xenblkd = NULL;
2531 + wake_up(&ring->shutdown_wq);
2532 + }
2533 +
2534 +@@ -643,7 +644,8 @@ static int xen_blkbk_probe(struct xenbus_device *dev,
2535 + /* setup back pointer */
2536 + be->blkif->be = be;
2537 +
2538 +- err = xenbus_watch_pathfmt(dev, &be->backend_watch, backend_changed,
2539 ++ err = xenbus_watch_pathfmt(dev, &be->backend_watch, NULL,
2540 ++ backend_changed,
2541 + "%s/%s", dev->nodename, "physical-device");
2542 + if (err)
2543 + goto fail;
2544 +diff --git a/drivers/bluetooth/btmtksdio.c b/drivers/bluetooth/btmtksdio.c
2545 +index b7de7cb8cca90..304178be1ef40 100644
2546 +--- a/drivers/bluetooth/btmtksdio.c
2547 ++++ b/drivers/bluetooth/btmtksdio.c
2548 +@@ -703,7 +703,7 @@ static int mtk_setup_firmware(struct hci_dev *hdev, const char *fwname)
2549 + err = mtk_hci_wmt_sync(hdev, &wmt_params);
2550 + if (err < 0) {
2551 + bt_dev_err(hdev, "Failed to power on data RAM (%d)", err);
2552 +- return err;
2553 ++ goto free_fw;
2554 + }
2555 +