Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.14 commit in: /
Date: Wed, 22 Dec 2021 14:07:55
Message-Id: 1640182057.aba288c2b172fea07e242cc010c8f566c96008d2.mpagano@gentoo
1 commit: aba288c2b172fea07e242cc010c8f566c96008d2
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 22 14:07:37 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 22 14:07:37 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=aba288c2
7
8 Linux patch 4.14.259
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1258_linux-4.14.259.patch | 2159 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2163 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index dda40838..db2d1b6c 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -1079,6 +1079,10 @@ Patch: 1257_linux-4.14.258.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.14.258
23
24 +Patch: 1258_linux-4.14.259.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.14.259
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/1258_linux-4.14.259.patch b/1258_linux-4.14.259.patch
33 new file mode 100644
34 index 00000000..ef93e75d
35 --- /dev/null
36 +++ b/1258_linux-4.14.259.patch
37 @@ -0,0 +1,2159 @@
38 +diff --git a/Makefile b/Makefile
39 +index f77e1d686f872..1d22e50da86e8 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 14
46 +-SUBLEVEL = 258
47 ++SUBLEVEL = 259
48 + EXTRAVERSION =
49 + NAME = Petit Gorille
50 +
51 +diff --git a/arch/Kconfig b/arch/Kconfig
52 +index 95567f6832752..c2e73c01d7adc 100644
53 +--- a/arch/Kconfig
54 ++++ b/arch/Kconfig
55 +@@ -980,4 +980,7 @@ config HAVE_ARCH_COMPILER_H
56 + linux/compiler-*.h in order to override macro definitions that those
57 + headers generally provide.
58 +
59 ++config ARCH_USE_MEMREMAP_PROT
60 ++ bool
61 ++
62 + source "kernel/gcov/Kconfig"
63 +diff --git a/arch/arm/Kconfig.debug b/arch/arm/Kconfig.debug
64 +index b14f154919a5d..d6cf18a0cb0a9 100644
65 +--- a/arch/arm/Kconfig.debug
66 ++++ b/arch/arm/Kconfig.debug
67 +@@ -16,30 +16,42 @@ config ARM_PTDUMP
68 + kernel.
69 + If in doubt, say "N"
70 +
71 +-# RMK wants arm kernels compiled with frame pointers or stack unwinding.
72 +-# If you know what you are doing and are willing to live without stack
73 +-# traces, you can get a slightly smaller kernel by setting this option to
74 +-# n, but then RMK will have to kill you ;).
75 +-config FRAME_POINTER
76 +- bool
77 +- depends on !THUMB2_KERNEL
78 +- default y if !ARM_UNWIND || FUNCTION_GRAPH_TRACER
79 ++choice
80 ++ prompt "Choose kernel unwinder"
81 ++ default UNWINDER_ARM if AEABI && !FUNCTION_GRAPH_TRACER
82 ++ default UNWINDER_FRAME_POINTER if !AEABI || FUNCTION_GRAPH_TRACER
83 ++ help
84 ++ This determines which method will be used for unwinding kernel stack
85 ++ traces for panics, oopses, bugs, warnings, perf, /proc/<pid>/stack,
86 ++ livepatch, lockdep, and more.
87 ++
88 ++config UNWINDER_FRAME_POINTER
89 ++ bool "Frame pointer unwinder"
90 ++ depends on !THUMB2_KERNEL && !CC_IS_CLANG
91 ++ select ARCH_WANT_FRAME_POINTERS
92 ++ select FRAME_POINTER
93 + help
94 +- If you say N here, the resulting kernel will be slightly smaller and
95 +- faster. However, if neither FRAME_POINTER nor ARM_UNWIND are enabled,
96 +- when a problem occurs with the kernel, the information that is
97 +- reported is severely limited.
98 ++ This option enables the frame pointer unwinder for unwinding
99 ++ kernel stack traces.
100 +
101 +-config ARM_UNWIND
102 +- bool "Enable stack unwinding support (EXPERIMENTAL)"
103 ++config UNWINDER_ARM
104 ++ bool "ARM EABI stack unwinder"
105 + depends on AEABI
106 +- default y
107 ++ select ARM_UNWIND
108 + help
109 + This option enables stack unwinding support in the kernel
110 + using the information automatically generated by the
111 + compiler. The resulting kernel image is slightly bigger but
112 + the performance is not affected. Currently, this feature
113 +- only works with EABI compilers. If unsure say Y.
114 ++ only works with EABI compilers.
115 ++
116 ++endchoice
117 ++
118 ++config ARM_UNWIND
119 ++ bool
120 ++
121 ++config FRAME_POINTER
122 ++ bool
123 +
124 + config OLD_MCOUNT
125 + bool
126 +diff --git a/arch/arm/boot/dts/imx6ull-pinfunc.h b/arch/arm/boot/dts/imx6ull-pinfunc.h
127 +index 1182023366912..c4dcb3c6c5086 100644
128 +--- a/arch/arm/boot/dts/imx6ull-pinfunc.h
129 ++++ b/arch/arm/boot/dts/imx6ull-pinfunc.h
130 +@@ -51,6 +51,6 @@
131 + #define MX6ULL_PAD_CSI_DATA04__ESAI_TX_FS 0x01F4 0x0480 0x0000 0x9 0x0
132 + #define MX6ULL_PAD_CSI_DATA05__ESAI_TX_CLK 0x01F8 0x0484 0x0000 0x9 0x0
133 + #define MX6ULL_PAD_CSI_DATA06__ESAI_TX5_RX0 0x01FC 0x0488 0x0000 0x9 0x0
134 +-#define MX6ULL_PAD_CSI_DATA07__ESAI_T0 0x0200 0x048C 0x0000 0x9 0x0
135 ++#define MX6ULL_PAD_CSI_DATA07__ESAI_TX0 0x0200 0x048C 0x0000 0x9 0x0
136 +
137 + #endif /* __DTS_IMX6ULL_PINFUNC_H */
138 +diff --git a/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts b/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts
139 +index beb2fc6b9eb63..adfdc43ac052f 100644
140 +--- a/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts
141 ++++ b/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts
142 +@@ -23,7 +23,7 @@
143 + flash0: n25q00@0 {
144 + #address-cells = <1>;
145 + #size-cells = <1>;
146 +- compatible = "n25q00aa";
147 ++ compatible = "micron,mt25qu02g", "jedec,spi-nor";
148 + reg = <0>;
149 + spi-max-frequency = <100000000>;
150 +
151 +diff --git a/arch/arm/boot/dts/socfpga_arria5_socdk.dts b/arch/arm/boot/dts/socfpga_arria5_socdk.dts
152 +index aac4feea86f38..09ffa79240c84 100644
153 +--- a/arch/arm/boot/dts/socfpga_arria5_socdk.dts
154 ++++ b/arch/arm/boot/dts/socfpga_arria5_socdk.dts
155 +@@ -131,7 +131,7 @@
156 + flash: flash@0 {
157 + #address-cells = <1>;
158 + #size-cells = <1>;
159 +- compatible = "n25q256a";
160 ++ compatible = "micron,n25q256a", "jedec,spi-nor";
161 + reg = <0>;
162 + spi-max-frequency = <100000000>;
163 +
164 +diff --git a/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts b/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
165 +index 155829f9eba16..907d8aa6d9fc8 100644
166 +--- a/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
167 ++++ b/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
168 +@@ -136,7 +136,7 @@
169 + flash0: n25q00@0 {
170 + #address-cells = <1>;
171 + #size-cells = <1>;
172 +- compatible = "n25q00";
173 ++ compatible = "micron,mt25qu02g", "jedec,spi-nor";
174 + reg = <0>; /* chip select */
175 + spi-max-frequency = <100000000>;
176 +
177 +diff --git a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
178 +index a4a555c19d943..fe5fe4559969d 100644
179 +--- a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
180 ++++ b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
181 +@@ -181,7 +181,7 @@
182 + flash: flash@0 {
183 + #address-cells = <1>;
184 + #size-cells = <1>;
185 +- compatible = "n25q00";
186 ++ compatible = "micron,mt25qu02g", "jedec,spi-nor";
187 + reg = <0>;
188 + spi-max-frequency = <100000000>;
189 +
190 +diff --git a/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts b/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts
191 +index 53bf99eef66de..0992cae3e60ef 100644
192 +--- a/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts
193 ++++ b/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts
194 +@@ -87,7 +87,7 @@
195 + flash: flash@0 {
196 + #address-cells = <1>;
197 + #size-cells = <1>;
198 +- compatible = "n25q256a";
199 ++ compatible = "micron,n25q256a", "jedec,spi-nor";
200 + reg = <0>;
201 + spi-max-frequency = <100000000>;
202 + m25p,fast-read;
203 +diff --git a/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts b/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts
204 +index 8860dd2e242c4..22bfef024913a 100644
205 +--- a/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts
206 ++++ b/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts
207 +@@ -128,7 +128,7 @@
208 + flash0: n25q512a@0 {
209 + #address-cells = <1>;
210 + #size-cells = <1>;
211 +- compatible = "n25q512a";
212 ++ compatible = "micron,n25q512a", "jedec,spi-nor";
213 + reg = <0>;
214 + spi-max-frequency = <100000000>;
215 +
216 +diff --git a/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts b/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts
217 +index 655fe87e272d9..349719a9c1360 100644
218 +--- a/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts
219 ++++ b/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts
220 +@@ -249,7 +249,7 @@
221 + n25q128@0 {
222 + #address-cells = <1>;
223 + #size-cells = <1>;
224 +- compatible = "n25q128";
225 ++ compatible = "micron,n25q128", "jedec,spi-nor";
226 + reg = <0>; /* chip select */
227 + spi-max-frequency = <100000000>;
228 + m25p,fast-read;
229 +@@ -266,7 +266,7 @@
230 + n25q00@1 {
231 + #address-cells = <1>;
232 + #size-cells = <1>;
233 +- compatible = "n25q00";
234 ++ compatible = "micron,mt25qu02g", "jedec,spi-nor";
235 + reg = <1>; /* chip select */
236 + spi-max-frequency = <100000000>;
237 + m25p,fast-read;
238 +diff --git a/arch/arm/mm/copypage-fa.c b/arch/arm/mm/copypage-fa.c
239 +index d130a5ece5d55..bf24690ec83af 100644
240 +--- a/arch/arm/mm/copypage-fa.c
241 ++++ b/arch/arm/mm/copypage-fa.c
242 +@@ -17,26 +17,25 @@
243 + /*
244 + * Faraday optimised copy_user_page
245 + */
246 +-static void __naked
247 +-fa_copy_user_page(void *kto, const void *kfrom)
248 ++static void fa_copy_user_page(void *kto, const void *kfrom)
249 + {
250 +- asm("\
251 +- stmfd sp!, {r4, lr} @ 2\n\
252 +- mov r2, %0 @ 1\n\
253 +-1: ldmia r1!, {r3, r4, ip, lr} @ 4\n\
254 +- stmia r0, {r3, r4, ip, lr} @ 4\n\
255 +- mcr p15, 0, r0, c7, c14, 1 @ 1 clean and invalidate D line\n\
256 +- add r0, r0, #16 @ 1\n\
257 +- ldmia r1!, {r3, r4, ip, lr} @ 4\n\
258 +- stmia r0, {r3, r4, ip, lr} @ 4\n\
259 +- mcr p15, 0, r0, c7, c14, 1 @ 1 clean and invalidate D line\n\
260 +- add r0, r0, #16 @ 1\n\
261 +- subs r2, r2, #1 @ 1\n\
262 ++ int tmp;
263 ++
264 ++ asm volatile ("\
265 ++1: ldmia %1!, {r3, r4, ip, lr} @ 4\n\
266 ++ stmia %0, {r3, r4, ip, lr} @ 4\n\
267 ++ mcr p15, 0, %0, c7, c14, 1 @ 1 clean and invalidate D line\n\
268 ++ add %0, %0, #16 @ 1\n\
269 ++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\
270 ++ stmia %0, {r3, r4, ip, lr} @ 4\n\
271 ++ mcr p15, 0, %0, c7, c14, 1 @ 1 clean and invalidate D line\n\
272 ++ add %0, %0, #16 @ 1\n\
273 ++ subs %2, %2, #1 @ 1\n\
274 + bne 1b @ 1\n\
275 +- mcr p15, 0, r2, c7, c10, 4 @ 1 drain WB\n\
276 +- ldmfd sp!, {r4, pc} @ 3"
277 +- :
278 +- : "I" (PAGE_SIZE / 32));
279 ++ mcr p15, 0, %2, c7, c10, 4 @ 1 drain WB"
280 ++ : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp)
281 ++ : "2" (PAGE_SIZE / 32)
282 ++ : "r3", "r4", "ip", "lr");
283 + }
284 +
285 + void fa_copy_user_highpage(struct page *to, struct page *from,
286 +diff --git a/arch/arm/mm/copypage-feroceon.c b/arch/arm/mm/copypage-feroceon.c
287 +index 49ee0c1a72097..cc819732d9b82 100644
288 +--- a/arch/arm/mm/copypage-feroceon.c
289 ++++ b/arch/arm/mm/copypage-feroceon.c
290 +@@ -13,58 +13,56 @@
291 + #include <linux/init.h>
292 + #include <linux/highmem.h>
293 +
294 +-static void __naked
295 +-feroceon_copy_user_page(void *kto, const void *kfrom)
296 ++static void feroceon_copy_user_page(void *kto, const void *kfrom)
297 + {
298 +- asm("\
299 +- stmfd sp!, {r4-r9, lr} \n\
300 +- mov ip, %2 \n\
301 +-1: mov lr, r1 \n\
302 +- ldmia r1!, {r2 - r9} \n\
303 +- pld [lr, #32] \n\
304 +- pld [lr, #64] \n\
305 +- pld [lr, #96] \n\
306 +- pld [lr, #128] \n\
307 +- pld [lr, #160] \n\
308 +- pld [lr, #192] \n\
309 +- pld [lr, #224] \n\
310 +- stmia r0, {r2 - r9} \n\
311 +- ldmia r1!, {r2 - r9} \n\
312 +- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\
313 +- add r0, r0, #32 \n\
314 +- stmia r0, {r2 - r9} \n\
315 +- ldmia r1!, {r2 - r9} \n\
316 +- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\
317 +- add r0, r0, #32 \n\
318 +- stmia r0, {r2 - r9} \n\
319 +- ldmia r1!, {r2 - r9} \n\
320 +- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\
321 +- add r0, r0, #32 \n\
322 +- stmia r0, {r2 - r9} \n\
323 +- ldmia r1!, {r2 - r9} \n\
324 +- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\
325 +- add r0, r0, #32 \n\
326 +- stmia r0, {r2 - r9} \n\
327 +- ldmia r1!, {r2 - r9} \n\
328 +- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\
329 +- add r0, r0, #32 \n\
330 +- stmia r0, {r2 - r9} \n\
331 +- ldmia r1!, {r2 - r9} \n\
332 +- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\
333 +- add r0, r0, #32 \n\
334 +- stmia r0, {r2 - r9} \n\
335 +- ldmia r1!, {r2 - r9} \n\
336 +- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\
337 +- add r0, r0, #32 \n\
338 +- stmia r0, {r2 - r9} \n\
339 +- subs ip, ip, #(32 * 8) \n\
340 +- mcr p15, 0, r0, c7, c14, 1 @ clean and invalidate D line\n\
341 +- add r0, r0, #32 \n\
342 ++ int tmp;
343 ++
344 ++ asm volatile ("\
345 ++1: ldmia %1!, {r2 - r7, ip, lr} \n\
346 ++ pld [%1, #0] \n\
347 ++ pld [%1, #32] \n\
348 ++ pld [%1, #64] \n\
349 ++ pld [%1, #96] \n\
350 ++ pld [%1, #128] \n\
351 ++ pld [%1, #160] \n\
352 ++ pld [%1, #192] \n\
353 ++ stmia %0, {r2 - r7, ip, lr} \n\
354 ++ ldmia %1!, {r2 - r7, ip, lr} \n\
355 ++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\
356 ++ add %0, %0, #32 \n\
357 ++ stmia %0, {r2 - r7, ip, lr} \n\
358 ++ ldmia %1!, {r2 - r7, ip, lr} \n\
359 ++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\
360 ++ add %0, %0, #32 \n\
361 ++ stmia %0, {r2 - r7, ip, lr} \n\
362 ++ ldmia %1!, {r2 - r7, ip, lr} \n\
363 ++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\
364 ++ add %0, %0, #32 \n\
365 ++ stmia %0, {r2 - r7, ip, lr} \n\
366 ++ ldmia %1!, {r2 - r7, ip, lr} \n\
367 ++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\
368 ++ add %0, %0, #32 \n\
369 ++ stmia %0, {r2 - r7, ip, lr} \n\
370 ++ ldmia %1!, {r2 - r7, ip, lr} \n\
371 ++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\
372 ++ add %0, %0, #32 \n\
373 ++ stmia %0, {r2 - r7, ip, lr} \n\
374 ++ ldmia %1!, {r2 - r7, ip, lr} \n\
375 ++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\
376 ++ add %0, %0, #32 \n\
377 ++ stmia %0, {r2 - r7, ip, lr} \n\
378 ++ ldmia %1!, {r2 - r7, ip, lr} \n\
379 ++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\
380 ++ add %0, %0, #32 \n\
381 ++ stmia %0, {r2 - r7, ip, lr} \n\
382 ++ subs %2, %2, #(32 * 8) \n\
383 ++ mcr p15, 0, %0, c7, c14, 1 @ clean and invalidate D line\n\
384 ++ add %0, %0, #32 \n\
385 + bne 1b \n\
386 +- mcr p15, 0, ip, c7, c10, 4 @ drain WB\n\
387 +- ldmfd sp!, {r4-r9, pc}"
388 +- :
389 +- : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE));
390 ++ mcr p15, 0, %2, c7, c10, 4 @ drain WB"
391 ++ : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp)
392 ++ : "2" (PAGE_SIZE)
393 ++ : "r2", "r3", "r4", "r5", "r6", "r7", "ip", "lr");
394 + }
395 +
396 + void feroceon_copy_user_highpage(struct page *to, struct page *from,
397 +diff --git a/arch/arm/mm/copypage-v4mc.c b/arch/arm/mm/copypage-v4mc.c
398 +index 1267e64133b92..db624170854a0 100644
399 +--- a/arch/arm/mm/copypage-v4mc.c
400 ++++ b/arch/arm/mm/copypage-v4mc.c
401 +@@ -40,12 +40,11 @@ static DEFINE_RAW_SPINLOCK(minicache_lock);
402 + * instruction. If your processor does not supply this, you have to write your
403 + * own copy_user_highpage that does the right thing.
404 + */
405 +-static void __naked
406 +-mc_copy_user_page(void *from, void *to)
407 ++static void mc_copy_user_page(void *from, void *to)
408 + {
409 +- asm volatile(
410 +- "stmfd sp!, {r4, lr} @ 2\n\
411 +- mov r4, %2 @ 1\n\
412 ++ int tmp;
413 ++
414 ++ asm volatile ("\
415 + ldmia %0!, {r2, r3, ip, lr} @ 4\n\
416 + 1: mcr p15, 0, %1, c7, c6, 1 @ 1 invalidate D line\n\
417 + stmia %1!, {r2, r3, ip, lr} @ 4\n\
418 +@@ -55,13 +54,13 @@ mc_copy_user_page(void *from, void *to)
419 + mcr p15, 0, %1, c7, c6, 1 @ 1 invalidate D line\n\
420 + stmia %1!, {r2, r3, ip, lr} @ 4\n\
421 + ldmia %0!, {r2, r3, ip, lr} @ 4\n\
422 +- subs r4, r4, #1 @ 1\n\
423 ++ subs %2, %2, #1 @ 1\n\
424 + stmia %1!, {r2, r3, ip, lr} @ 4\n\
425 + ldmneia %0!, {r2, r3, ip, lr} @ 4\n\
426 +- bne 1b @ 1\n\
427 +- ldmfd sp!, {r4, pc} @ 3"
428 +- :
429 +- : "r" (from), "r" (to), "I" (PAGE_SIZE / 64));
430 ++ bne 1b @ "
431 ++ : "+&r" (from), "+&r" (to), "=&r" (tmp)
432 ++ : "2" (PAGE_SIZE / 64)
433 ++ : "r2", "r3", "ip", "lr");
434 + }
435 +
436 + void v4_mc_copy_user_highpage(struct page *to, struct page *from,
437 +diff --git a/arch/arm/mm/copypage-v4wb.c b/arch/arm/mm/copypage-v4wb.c
438 +index 067d0fdd630c1..cd3e165afeede 100644
439 +--- a/arch/arm/mm/copypage-v4wb.c
440 ++++ b/arch/arm/mm/copypage-v4wb.c
441 +@@ -22,29 +22,28 @@
442 + * instruction. If your processor does not supply this, you have to write your
443 + * own copy_user_highpage that does the right thing.
444 + */
445 +-static void __naked
446 +-v4wb_copy_user_page(void *kto, const void *kfrom)
447 ++static void v4wb_copy_user_page(void *kto, const void *kfrom)
448 + {
449 +- asm("\
450 +- stmfd sp!, {r4, lr} @ 2\n\
451 +- mov r2, %2 @ 1\n\
452 +- ldmia r1!, {r3, r4, ip, lr} @ 4\n\
453 +-1: mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\
454 +- stmia r0!, {r3, r4, ip, lr} @ 4\n\
455 +- ldmia r1!, {r3, r4, ip, lr} @ 4+1\n\
456 +- stmia r0!, {r3, r4, ip, lr} @ 4\n\
457 +- ldmia r1!, {r3, r4, ip, lr} @ 4\n\
458 +- mcr p15, 0, r0, c7, c6, 1 @ 1 invalidate D line\n\
459 +- stmia r0!, {r3, r4, ip, lr} @ 4\n\
460 +- ldmia r1!, {r3, r4, ip, lr} @ 4\n\
461 +- subs r2, r2, #1 @ 1\n\
462 +- stmia r0!, {r3, r4, ip, lr} @ 4\n\
463 +- ldmneia r1!, {r3, r4, ip, lr} @ 4\n\
464 ++ int tmp;
465 ++
466 ++ asm volatile ("\
467 ++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\
468 ++1: mcr p15, 0, %0, c7, c6, 1 @ 1 invalidate D line\n\
469 ++ stmia %0!, {r3, r4, ip, lr} @ 4\n\
470 ++ ldmia %1!, {r3, r4, ip, lr} @ 4+1\n\
471 ++ stmia %0!, {r3, r4, ip, lr} @ 4\n\
472 ++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\
473 ++ mcr p15, 0, %0, c7, c6, 1 @ 1 invalidate D line\n\
474 ++ stmia %0!, {r3, r4, ip, lr} @ 4\n\
475 ++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\
476 ++ subs %2, %2, #1 @ 1\n\
477 ++ stmia %0!, {r3, r4, ip, lr} @ 4\n\
478 ++ ldmneia %1!, {r3, r4, ip, lr} @ 4\n\
479 + bne 1b @ 1\n\
480 +- mcr p15, 0, r1, c7, c10, 4 @ 1 drain WB\n\
481 +- ldmfd sp!, {r4, pc} @ 3"
482 +- :
483 +- : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64));
484 ++ mcr p15, 0, %1, c7, c10, 4 @ 1 drain WB"
485 ++ : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp)
486 ++ : "2" (PAGE_SIZE / 64)
487 ++ : "r3", "r4", "ip", "lr");
488 + }
489 +
490 + void v4wb_copy_user_highpage(struct page *to, struct page *from,
491 +diff --git a/arch/arm/mm/copypage-v4wt.c b/arch/arm/mm/copypage-v4wt.c
492 +index b85c5da2e510e..8614572e1296b 100644
493 +--- a/arch/arm/mm/copypage-v4wt.c
494 ++++ b/arch/arm/mm/copypage-v4wt.c
495 +@@ -20,27 +20,26 @@
496 + * dirty data in the cache. However, we do have to ensure that
497 + * subsequent reads are up to date.
498 + */
499 +-static void __naked
500 +-v4wt_copy_user_page(void *kto, const void *kfrom)
501 ++static void v4wt_copy_user_page(void *kto, const void *kfrom)
502 + {
503 +- asm("\
504 +- stmfd sp!, {r4, lr} @ 2\n\
505 +- mov r2, %2 @ 1\n\
506 +- ldmia r1!, {r3, r4, ip, lr} @ 4\n\
507 +-1: stmia r0!, {r3, r4, ip, lr} @ 4\n\
508 +- ldmia r1!, {r3, r4, ip, lr} @ 4+1\n\
509 +- stmia r0!, {r3, r4, ip, lr} @ 4\n\
510 +- ldmia r1!, {r3, r4, ip, lr} @ 4\n\
511 +- stmia r0!, {r3, r4, ip, lr} @ 4\n\
512 +- ldmia r1!, {r3, r4, ip, lr} @ 4\n\
513 +- subs r2, r2, #1 @ 1\n\
514 +- stmia r0!, {r3, r4, ip, lr} @ 4\n\
515 +- ldmneia r1!, {r3, r4, ip, lr} @ 4\n\
516 ++ int tmp;
517 ++
518 ++ asm volatile ("\
519 ++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\
520 ++1: stmia %0!, {r3, r4, ip, lr} @ 4\n\
521 ++ ldmia %1!, {r3, r4, ip, lr} @ 4+1\n\
522 ++ stmia %0!, {r3, r4, ip, lr} @ 4\n\
523 ++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\
524 ++ stmia %0!, {r3, r4, ip, lr} @ 4\n\
525 ++ ldmia %1!, {r3, r4, ip, lr} @ 4\n\
526 ++ subs %2, %2, #1 @ 1\n\
527 ++ stmia %0!, {r3, r4, ip, lr} @ 4\n\
528 ++ ldmneia %1!, {r3, r4, ip, lr} @ 4\n\
529 + bne 1b @ 1\n\
530 +- mcr p15, 0, r2, c7, c7, 0 @ flush ID cache\n\
531 +- ldmfd sp!, {r4, pc} @ 3"
532 +- :
533 +- : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64));
534 ++ mcr p15, 0, %2, c7, c7, 0 @ flush ID cache"
535 ++ : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp)
536 ++ : "2" (PAGE_SIZE / 64)
537 ++ : "r3", "r4", "ip", "lr");
538 + }
539 +
540 + void v4wt_copy_user_highpage(struct page *to, struct page *from,
541 +diff --git a/arch/arm/mm/copypage-xsc3.c b/arch/arm/mm/copypage-xsc3.c
542 +index 03a2042aced5f..55cbc3a89d858 100644
543 +--- a/arch/arm/mm/copypage-xsc3.c
544 ++++ b/arch/arm/mm/copypage-xsc3.c
545 +@@ -21,53 +21,46 @@
546 +
547 + /*
548 + * XSC3 optimised copy_user_highpage
549 +- * r0 = destination
550 +- * r1 = source
551 + *
552 + * The source page may have some clean entries in the cache already, but we
553 + * can safely ignore them - break_cow() will flush them out of the cache
554 + * if we eventually end up using our copied page.
555 + *
556 + */
557 +-static void __naked
558 +-xsc3_mc_copy_user_page(void *kto, const void *kfrom)
559 ++static void xsc3_mc_copy_user_page(void *kto, const void *kfrom)
560 + {
561 +- asm("\
562 +- stmfd sp!, {r4, r5, lr} \n\
563 +- mov lr, %2 \n\
564 +- \n\
565 +- pld [r1, #0] \n\
566 +- pld [r1, #32] \n\
567 +-1: pld [r1, #64] \n\
568 +- pld [r1, #96] \n\
569 ++ int tmp;
570 ++
571 ++ asm volatile ("\
572 ++ pld [%1, #0] \n\
573 ++ pld [%1, #32] \n\
574 ++1: pld [%1, #64] \n\
575 ++ pld [%1, #96] \n\
576 + \n\
577 +-2: ldrd r2, [r1], #8 \n\
578 +- mov ip, r0 \n\
579 +- ldrd r4, [r1], #8 \n\
580 +- mcr p15, 0, ip, c7, c6, 1 @ invalidate\n\
581 +- strd r2, [r0], #8 \n\
582 +- ldrd r2, [r1], #8 \n\
583 +- strd r4, [r0], #8 \n\
584 +- ldrd r4, [r1], #8 \n\
585 +- strd r2, [r0], #8 \n\
586 +- strd r4, [r0], #8 \n\
587 +- ldrd r2, [r1], #8 \n\
588 +- mov ip, r0 \n\
589 +- ldrd r4, [r1], #8 \n\
590 +- mcr p15, 0, ip, c7, c6, 1 @ invalidate\n\
591 +- strd r2, [r0], #8 \n\
592 +- ldrd r2, [r1], #8 \n\
593 +- subs lr, lr, #1 \n\
594 +- strd r4, [r0], #8 \n\
595 +- ldrd r4, [r1], #8 \n\
596 +- strd r2, [r0], #8 \n\
597 +- strd r4, [r0], #8 \n\
598 ++2: ldrd r2, [%1], #8 \n\
599 ++ ldrd r4, [%1], #8 \n\
600 ++ mcr p15, 0, %0, c7, c6, 1 @ invalidate\n\
601 ++ strd r2, [%0], #8 \n\
602 ++ ldrd r2, [%1], #8 \n\
603 ++ strd r4, [%0], #8 \n\
604 ++ ldrd r4, [%1], #8 \n\
605 ++ strd r2, [%0], #8 \n\
606 ++ strd r4, [%0], #8 \n\
607 ++ ldrd r2, [%1], #8 \n\
608 ++ ldrd r4, [%1], #8 \n\
609 ++ mcr p15, 0, %0, c7, c6, 1 @ invalidate\n\
610 ++ strd r2, [%0], #8 \n\
611 ++ ldrd r2, [%1], #8 \n\
612 ++ subs %2, %2, #1 \n\
613 ++ strd r4, [%0], #8 \n\
614 ++ ldrd r4, [%1], #8 \n\
615 ++ strd r2, [%0], #8 \n\
616 ++ strd r4, [%0], #8 \n\
617 + bgt 1b \n\
618 +- beq 2b \n\
619 +- \n\
620 +- ldmfd sp!, {r4, r5, pc}"
621 +- :
622 +- : "r" (kto), "r" (kfrom), "I" (PAGE_SIZE / 64 - 1));
623 ++ beq 2b "
624 ++ : "+&r" (kto), "+&r" (kfrom), "=&r" (tmp)
625 ++ : "2" (PAGE_SIZE / 64 - 1)
626 ++ : "r2", "r3", "r4", "r5");
627 + }
628 +
629 + void xsc3_mc_copy_user_highpage(struct page *to, struct page *from,
630 +@@ -85,8 +78,6 @@ void xsc3_mc_copy_user_highpage(struct page *to, struct page *from,
631 +
632 + /*
633 + * XScale optimised clear_user_page
634 +- * r0 = destination
635 +- * r1 = virtual user address of ultimate destination page
636 + */
637 + void xsc3_mc_clear_user_highpage(struct page *page, unsigned long vaddr)
638 + {
639 +diff --git a/arch/arm/mm/copypage-xscale.c b/arch/arm/mm/copypage-xscale.c
640 +index 0fb85025344d9..c775d4b7adb08 100644
641 +--- a/arch/arm/mm/copypage-xscale.c
642 ++++ b/arch/arm/mm/copypage-xscale.c
643 +@@ -36,52 +36,51 @@ static DEFINE_RAW_SPINLOCK(minicache_lock);
644 + * Dcache aliasing issue. The writes will be forwarded to the write buffer,
645 + * and merged as appropriate.
646 + */
647 +-static void __naked
648 +-mc_copy_user_page(void *from, void *to)
649 ++static void mc_copy_user_page(void *from, void *to)
650 + {
651 ++ int tmp;
652 ++
653 + /*
654 + * Strangely enough, best performance is achieved
655 + * when prefetching destination as well. (NP)
656 + */
657 +- asm volatile(
658 +- "stmfd sp!, {r4, r5, lr} \n\
659 +- mov lr, %2 \n\
660 +- pld [r0, #0] \n\
661 +- pld [r0, #32] \n\
662 +- pld [r1, #0] \n\
663 +- pld [r1, #32] \n\
664 +-1: pld [r0, #64] \n\
665 +- pld [r0, #96] \n\
666 +- pld [r1, #64] \n\
667 +- pld [r1, #96] \n\
668 +-2: ldrd r2, [r0], #8 \n\
669 +- ldrd r4, [r0], #8 \n\
670 +- mov ip, r1 \n\
671 +- strd r2, [r1], #8 \n\
672 +- ldrd r2, [r0], #8 \n\
673 +- strd r4, [r1], #8 \n\
674 +- ldrd r4, [r0], #8 \n\
675 +- strd r2, [r1], #8 \n\
676 +- strd r4, [r1], #8 \n\
677 ++ asm volatile ("\
678 ++ pld [%0, #0] \n\
679 ++ pld [%0, #32] \n\
680 ++ pld [%1, #0] \n\
681 ++ pld [%1, #32] \n\
682 ++1: pld [%0, #64] \n\
683 ++ pld [%0, #96] \n\
684 ++ pld [%1, #64] \n\
685 ++ pld [%1, #96] \n\
686 ++2: ldrd r2, [%0], #8 \n\
687 ++ ldrd r4, [%0], #8 \n\
688 ++ mov ip, %1 \n\
689 ++ strd r2, [%1], #8 \n\
690 ++ ldrd r2, [%0], #8 \n\
691 ++ strd r4, [%1], #8 \n\
692 ++ ldrd r4, [%0], #8 \n\
693 ++ strd r2, [%1], #8 \n\
694 ++ strd r4, [%1], #8 \n\
695 + mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\
696 +- ldrd r2, [r0], #8 \n\
697 ++ ldrd r2, [%0], #8 \n\
698 + mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\
699 +- ldrd r4, [r0], #8 \n\
700 +- mov ip, r1 \n\
701 +- strd r2, [r1], #8 \n\
702 +- ldrd r2, [r0], #8 \n\
703 +- strd r4, [r1], #8 \n\
704 +- ldrd r4, [r0], #8 \n\
705 +- strd r2, [r1], #8 \n\
706 +- strd r4, [r1], #8 \n\
707 ++ ldrd r4, [%0], #8 \n\
708 ++ mov ip, %1 \n\
709 ++ strd r2, [%1], #8 \n\
710 ++ ldrd r2, [%0], #8 \n\
711 ++ strd r4, [%1], #8 \n\
712 ++ ldrd r4, [%0], #8 \n\
713 ++ strd r2, [%1], #8 \n\
714 ++ strd r4, [%1], #8 \n\
715 + mcr p15, 0, ip, c7, c10, 1 @ clean D line\n\
716 +- subs lr, lr, #1 \n\
717 ++ subs %2, %2, #1 \n\
718 + mcr p15, 0, ip, c7, c6, 1 @ invalidate D line\n\
719 + bgt 1b \n\
720 +- beq 2b \n\
721 +- ldmfd sp!, {r4, r5, pc} "
722 +- :
723 +- : "r" (from), "r" (to), "I" (PAGE_SIZE / 64 - 1));
724 ++ beq 2b "
725 ++ : "+&r" (from), "+&r" (to), "=&r" (tmp)
726 ++ : "2" (PAGE_SIZE / 64 - 1)
727 ++ : "r2", "r3", "r4", "r5", "ip");
728 + }
729 +
730 + void xscale_mc_copy_user_highpage(struct page *to, struct page *from,
731 +diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
732 +index 290254849f97a..6301a8d2b87ee 100644
733 +--- a/arch/x86/Kconfig
734 ++++ b/arch/x86/Kconfig
735 +@@ -1449,6 +1449,7 @@ config ARCH_HAS_MEM_ENCRYPT
736 + config AMD_MEM_ENCRYPT
737 + bool "AMD Secure Memory Encryption (SME) support"
738 + depends on X86_64 && CPU_SUP_AMD
739 ++ select ARCH_USE_MEMREMAP_PROT
740 + ---help---
741 + Say yes to enable support for the encryption of system memory.
742 + This requires an AMD processor that supports Secure Memory
743 +@@ -1467,10 +1468,6 @@ config AMD_MEM_ENCRYPT_ACTIVE_BY_DEFAULT
744 + If set to N, then the encryption of system memory can be
745 + activated with the mem_encrypt=on command line option.
746 +
747 +-config ARCH_USE_MEMREMAP_PROT
748 +- def_bool y
749 +- depends on AMD_MEM_ENCRYPT
750 +-
751 + # Common NUMA Features
752 + config NUMA
753 + bool "Numa Memory Allocation and Scheduler Support"
754 +@@ -1903,6 +1900,7 @@ config EFI
755 + depends on ACPI
756 + select UCS2_STRING
757 + select EFI_RUNTIME_WRAPPERS
758 ++ select ARCH_USE_MEMREMAP_PROT
759 + ---help---
760 + This enables the kernel to use EFI runtime services that are
761 + available (such as the EFI variable services).
762 +diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c
763 +index 7bebdd0273d34..3faf9667cc409 100644
764 +--- a/arch/x86/mm/ioremap.c
765 ++++ b/arch/x86/mm/ioremap.c
766 +@@ -626,7 +626,7 @@ bool phys_mem_access_encrypted(unsigned long phys_addr, unsigned long size)
767 + return arch_memremap_can_ram_remap(phys_addr, size, 0);
768 + }
769 +
770 +-#ifdef CONFIG_ARCH_USE_MEMREMAP_PROT
771 ++#ifdef CONFIG_AMD_MEM_ENCRYPT
772 + /* Remap memory with encryption */
773 + void __init *early_memremap_encrypted(resource_size_t phys_addr,
774 + unsigned long size)
775 +@@ -668,7 +668,7 @@ void __init *early_memremap_decrypted_wp(resource_size_t phys_addr,
776 +
777 + return early_memremap_prot(phys_addr, size, __PAGE_KERNEL_NOENC_WP);
778 + }
779 +-#endif /* CONFIG_ARCH_USE_MEMREMAP_PROT */
780 ++#endif /* CONFIG_AMD_MEM_ENCRYPT */
781 +
782 + static pte_t bm_pte[PAGE_SIZE/sizeof(pte_t)] __page_aligned_bss;
783 +
784 +diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
785 +index cadd7fd290fa8..2a4ad0606fa30 100644
786 +--- a/arch/x86/platform/efi/quirks.c
787 ++++ b/arch/x86/platform/efi/quirks.c
788 +@@ -276,7 +276,8 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
789 + return;
790 + }
791 +
792 +- new = early_memremap(new_phys, new_size);
793 ++ new = early_memremap_prot(new_phys, new_size,
794 ++ pgprot_val(pgprot_encrypted(FIXMAP_PAGE_NORMAL)));
795 + if (!new) {
796 + pr_err("Failed to map new boot services memmap\n");
797 + return;
798 +diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
799 +index 4b299efbd8047..fdf7b5edd520e 100644
800 +--- a/drivers/ata/libata-scsi.c
801 ++++ b/drivers/ata/libata-scsi.c
802 +@@ -3182,8 +3182,19 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
803 + goto invalid_fld;
804 + }
805 +
806 +- if (ata_is_ncq(tf->protocol) && (cdb[2 + cdb_offset] & 0x3) == 0)
807 +- tf->protocol = ATA_PROT_NCQ_NODATA;
808 ++ if ((cdb[2 + cdb_offset] & 0x3) == 0) {
809 ++ /*
810 ++ * When T_LENGTH is zero (No data is transferred), dir should
811 ++ * be DMA_NONE.
812 ++ */
813 ++ if (scmd->sc_data_direction != DMA_NONE) {
814 ++ fp = 2 + cdb_offset;
815 ++ goto invalid_fld;
816 ++ }
817 ++
818 ++ if (ata_is_ncq(tf->protocol))
819 ++ tf->protocol = ATA_PROT_NCQ_NODATA;
820 ++ }
821 +
822 + /* enable LBA */
823 + tf->flags |= ATA_TFLAG_LBA;
824 +diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
825 +index 878eb9ba06b27..4487530217246 100644
826 +--- a/drivers/block/xen-blkfront.c
827 ++++ b/drivers/block/xen-blkfront.c
828 +@@ -1566,9 +1566,12 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
829 + unsigned long flags;
830 + struct blkfront_ring_info *rinfo = (struct blkfront_ring_info *)dev_id;
831 + struct blkfront_info *info = rinfo->dev_info;
832 ++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS;
833 +
834 +- if (unlikely(info->connected != BLKIF_STATE_CONNECTED))
835 ++ if (unlikely(info->connected != BLKIF_STATE_CONNECTED)) {
836 ++ xen_irq_lateeoi(irq, XEN_EOI_FLAG_SPURIOUS);
837 + return IRQ_HANDLED;
838 ++ }
839 +
840 + spin_lock_irqsave(&rinfo->ring_lock, flags);
841 + again:
842 +@@ -1584,6 +1587,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
843 + unsigned long id;
844 + unsigned int op;
845 +
846 ++ eoiflag = 0;
847 ++
848 + RING_COPY_RESPONSE(&rinfo->ring, i, &bret);
849 + id = bret.id;
850 +
851 +@@ -1699,6 +1704,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
852 +
853 + spin_unlock_irqrestore(&rinfo->ring_lock, flags);
854 +
855 ++ xen_irq_lateeoi(irq, eoiflag);
856 ++
857 + return IRQ_HANDLED;
858 +
859 + err:
860 +@@ -1706,6 +1713,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
861 +
862 + spin_unlock_irqrestore(&rinfo->ring_lock, flags);
863 +
864 ++ /* No EOI in order to avoid further interrupts. */
865 ++
866 + pr_alert("%s disabled for further use\n", info->gd->disk_name);
867 + return IRQ_HANDLED;
868 + }
869 +@@ -1745,8 +1754,8 @@ static int setup_blkring(struct xenbus_device *dev,
870 + if (err)
871 + goto fail;
872 +
873 +- err = bind_evtchn_to_irqhandler(rinfo->evtchn, blkif_interrupt, 0,
874 +- "blkif", rinfo);
875 ++ err = bind_evtchn_to_irqhandler_lateeoi(rinfo->evtchn, blkif_interrupt,
876 ++ 0, "blkif", rinfo);
877 + if (err <= 0) {
878 + xenbus_dev_fatal(dev, err,
879 + "bind_evtchn_to_irqhandler failed");
880 +diff --git a/drivers/char/agp/parisc-agp.c b/drivers/char/agp/parisc-agp.c
881 +index 15f2e7025b78e..1d5510cb6db4e 100644
882 +--- a/drivers/char/agp/parisc-agp.c
883 ++++ b/drivers/char/agp/parisc-agp.c
884 +@@ -285,7 +285,7 @@ agp_ioc_init(void __iomem *ioc_regs)
885 + return 0;
886 + }
887 +
888 +-static int
889 ++static int __init
890 + lba_find_capability(int cap)
891 + {
892 + struct _parisc_agp_info *info = &parisc_agp_info;
893 +@@ -370,7 +370,7 @@ fail:
894 + return error;
895 + }
896 +
897 +-static int
898 ++static int __init
899 + find_quicksilver(struct device *dev, void *data)
900 + {
901 + struct parisc_device **lba = data;
902 +@@ -382,7 +382,7 @@ find_quicksilver(struct device *dev, void *data)
903 + return 0;
904 + }
905 +
906 +-static int
907 ++static int __init
908 + parisc_agp_init(void)
909 + {
910 + extern struct sba_device *sba_list;
911 +diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c
912 +index bfb79bd0c6de5..087d22ba8a2f6 100644
913 +--- a/drivers/dma/st_fdma.c
914 ++++ b/drivers/dma/st_fdma.c
915 +@@ -886,4 +886,4 @@ MODULE_LICENSE("GPL v2");
916 + MODULE_DESCRIPTION("STMicroelectronics FDMA engine driver");
917 + MODULE_AUTHOR("Ludovic.barre <Ludovic.barre@××.com>");
918 + MODULE_AUTHOR("Peter Griffin <peter.griffin@××××××.org>");
919 +-MODULE_ALIAS("platform: " DRIVER_NAME);
920 ++MODULE_ALIAS("platform:" DRIVER_NAME);
921 +diff --git a/drivers/firmware/scpi_pm_domain.c b/drivers/firmware/scpi_pm_domain.c
922 +index f395dec271131..a6e62a793fbe6 100644
923 +--- a/drivers/firmware/scpi_pm_domain.c
924 ++++ b/drivers/firmware/scpi_pm_domain.c
925 +@@ -27,7 +27,6 @@ struct scpi_pm_domain {
926 + struct generic_pm_domain genpd;
927 + struct scpi_ops *ops;
928 + u32 domain;
929 +- char name[30];
930 + };
931 +
932 + /*
933 +@@ -121,8 +120,13 @@ static int scpi_pm_domain_probe(struct platform_device *pdev)
934 +
935 + scpi_pd->domain = i;
936 + scpi_pd->ops = scpi_ops;
937 +- sprintf(scpi_pd->name, "%s.%d", np->name, i);
938 +- scpi_pd->genpd.name = scpi_pd->name;
939 ++ scpi_pd->genpd.name = devm_kasprintf(dev, GFP_KERNEL,
940 ++ "%s.%d", np->name, i);
941 ++ if (!scpi_pd->genpd.name) {
942 ++ dev_err(dev, "Failed to allocate genpd name:%s.%d\n",
943 ++ np->name, i);
944 ++ continue;
945 ++ }
946 + scpi_pd->genpd.power_off = scpi_pd_power_off;
947 + scpi_pd->genpd.power_on = scpi_pd_power_on;
948 +
949 +diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
950 +index ef4e81d774464..d49f177481195 100644
951 +--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
952 ++++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
953 +@@ -1563,6 +1563,8 @@ static int dsi_host_parse_lane_data(struct msm_dsi_host *msm_host,
954 + if (!prop) {
955 + dev_dbg(dev,
956 + "failed to find data lane mapping, using default\n");
957 ++ /* Set the number of date lanes to 4 by default. */
958 ++ msm_host->num_data_lanes = 4;
959 + return 0;
960 + }
961 +
962 +diff --git a/drivers/hwmon/dell-smm-hwmon.c b/drivers/hwmon/dell-smm-hwmon.c
963 +index c7c9e95e58a83..123b870728fbc 100644
964 +--- a/drivers/hwmon/dell-smm-hwmon.c
965 ++++ b/drivers/hwmon/dell-smm-hwmon.c
966 +@@ -578,15 +578,18 @@ static const struct file_operations i8k_fops = {
967 + .unlocked_ioctl = i8k_ioctl,
968 + };
969 +
970 ++static struct proc_dir_entry *entry;
971 ++
972 + static void __init i8k_init_procfs(void)
973 + {
974 + /* Register the proc entry */
975 +- proc_create("i8k", 0, NULL, &i8k_fops);
976 ++ entry = proc_create("i8k", 0, NULL, &i8k_fops);
977 + }
978 +
979 + static void __exit i8k_exit_procfs(void)
980 + {
981 +- remove_proc_entry("i8k", NULL);
982 ++ if (entry)
983 ++ remove_proc_entry("i8k", NULL);
984 + }
985 +
986 + #else
987 +diff --git a/drivers/i2c/busses/i2c-rk3x.c b/drivers/i2c/busses/i2c-rk3x.c
988 +index fe234578380ac..548089aa9aba5 100644
989 +--- a/drivers/i2c/busses/i2c-rk3x.c
990 ++++ b/drivers/i2c/busses/i2c-rk3x.c
991 +@@ -424,8 +424,8 @@ static void rk3x_i2c_handle_read(struct rk3x_i2c *i2c, unsigned int ipd)
992 + if (!(ipd & REG_INT_MBRF))
993 + return;
994 +
995 +- /* ack interrupt */
996 +- i2c_writel(i2c, REG_INT_MBRF, REG_IPD);
997 ++ /* ack interrupt (read also produces a spurious START flag, clear it too) */
998 ++ i2c_writel(i2c, REG_INT_MBRF | REG_INT_START, REG_IPD);
999 +
1000 + /* Can only handle a maximum of 32 bytes at a time */
1001 + if (len > 32)
1002 +diff --git a/drivers/input/touchscreen/of_touchscreen.c b/drivers/input/touchscreen/of_touchscreen.c
1003 +index 8d7f9c8f2771c..db499ef6ccff4 100644
1004 +--- a/drivers/input/touchscreen/of_touchscreen.c
1005 ++++ b/drivers/input/touchscreen/of_touchscreen.c
1006 +@@ -79,8 +79,8 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
1007 + data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-x",
1008 + input_abs_get_max(input,
1009 + axis) + 1,
1010 +- &maximum) |
1011 +- touchscreen_get_prop_u32(dev, "touchscreen-fuzz-x",
1012 ++ &maximum);
1013 ++ data_present |= touchscreen_get_prop_u32(dev, "touchscreen-fuzz-x",
1014 + input_abs_get_fuzz(input, axis),
1015 + &fuzz);
1016 + if (data_present)
1017 +@@ -90,8 +90,8 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
1018 + data_present = touchscreen_get_prop_u32(dev, "touchscreen-size-y",
1019 + input_abs_get_max(input,
1020 + axis) + 1,
1021 +- &maximum) |
1022 +- touchscreen_get_prop_u32(dev, "touchscreen-fuzz-y",
1023 ++ &maximum);
1024 ++ data_present |= touchscreen_get_prop_u32(dev, "touchscreen-fuzz-y",
1025 + input_abs_get_fuzz(input, axis),
1026 + &fuzz);
1027 + if (data_present)
1028 +@@ -101,11 +101,11 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
1029 + data_present = touchscreen_get_prop_u32(dev,
1030 + "touchscreen-max-pressure",
1031 + input_abs_get_max(input, axis),
1032 +- &maximum) |
1033 +- touchscreen_get_prop_u32(dev,
1034 +- "touchscreen-fuzz-pressure",
1035 +- input_abs_get_fuzz(input, axis),
1036 +- &fuzz);
1037 ++ &maximum);
1038 ++ data_present |= touchscreen_get_prop_u32(dev,
1039 ++ "touchscreen-fuzz-pressure",
1040 ++ input_abs_get_fuzz(input, axis),
1041 ++ &fuzz);
1042 + if (data_present)
1043 + touchscreen_set_params(input, axis, maximum, fuzz);
1044 +
1045 +diff --git a/drivers/md/persistent-data/dm-btree-remove.c b/drivers/md/persistent-data/dm-btree-remove.c
1046 +index 9e4d1212f4c16..63f2baed3c8a6 100644
1047 +--- a/drivers/md/persistent-data/dm-btree-remove.c
1048 ++++ b/drivers/md/persistent-data/dm-btree-remove.c
1049 +@@ -423,9 +423,9 @@ static int rebalance_children(struct shadow_spine *s,
1050 +
1051 + memcpy(n, dm_block_data(child),
1052 + dm_bm_block_size(dm_tm_get_bm(info->tm)));
1053 +- dm_tm_unlock(info->tm, child);
1054 +
1055 + dm_tm_dec(info->tm, dm_block_location(child));
1056 ++ dm_tm_unlock(info->tm, child);
1057 + return 0;
1058 + }
1059 +
1060 +diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
1061 +index 0083e2a52a30f..576381ee757dd 100644
1062 +--- a/drivers/net/ethernet/broadcom/bcmsysport.c
1063 ++++ b/drivers/net/ethernet/broadcom/bcmsysport.c
1064 +@@ -120,9 +120,13 @@ static inline void tdma_port_write_desc_addr(struct bcm_sysport_priv *priv,
1065 + struct dma_desc *desc,
1066 + unsigned int port)
1067 + {
1068 ++ unsigned long desc_flags;
1069 ++
1070 + /* Ports are latched, so write upper address first */
1071 ++ spin_lock_irqsave(&priv->desc_lock, desc_flags);
1072 + tdma_writel(priv, desc->addr_status_len, TDMA_WRITE_PORT_HI(port));
1073 + tdma_writel(priv, desc->addr_lo, TDMA_WRITE_PORT_LO(port));
1074 ++ spin_unlock_irqrestore(&priv->desc_lock, desc_flags);
1075 + }
1076 +
1077 + /* Ethtool operations */
1078 +@@ -1880,6 +1884,7 @@ static int bcm_sysport_open(struct net_device *dev)
1079 + }
1080 +
1081 + /* Initialize both hardware and software ring */
1082 ++ spin_lock_init(&priv->desc_lock);
1083 + for (i = 0; i < dev->num_tx_queues; i++) {
1084 + ret = bcm_sysport_init_tx_ring(priv, i);
1085 + if (ret) {
1086 +diff --git a/drivers/net/ethernet/broadcom/bcmsysport.h b/drivers/net/ethernet/broadcom/bcmsysport.h
1087 +index 3df4a48b8eac8..de2c7a6b3cd26 100644
1088 +--- a/drivers/net/ethernet/broadcom/bcmsysport.h
1089 ++++ b/drivers/net/ethernet/broadcom/bcmsysport.h
1090 +@@ -733,6 +733,7 @@ struct bcm_sysport_priv {
1091 + int wol_irq;
1092 +
1093 + /* Transmit rings */
1094 ++ spinlock_t desc_lock;
1095 + struct bcm_sysport_tx_ring *tx_rings;
1096 +
1097 + /* Receive queue */
1098 +diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
1099 +index 6f5888bd91944..98fd214f2c42b 100644
1100 +--- a/drivers/net/ethernet/intel/igbvf/netdev.c
1101 ++++ b/drivers/net/ethernet/intel/igbvf/netdev.c
1102 +@@ -2911,6 +2911,7 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1103 + return 0;
1104 +
1105 + err_hw_init:
1106 ++ netif_napi_del(&adapter->rx_ring->napi);
1107 + kfree(adapter->tx_ring);
1108 + kfree(adapter->rx_ring);
1109 + err_sw_init:
1110 +diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
1111 +index a37c951b07530..10fa0e095ec37 100644
1112 +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
1113 ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
1114 +@@ -3397,6 +3397,9 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
1115 + /* flush pending Tx transactions */
1116 + ixgbe_clear_tx_pending(hw);
1117 +
1118 ++ /* set MDIO speed before talking to the PHY in case it's the 1st time */
1119 ++ ixgbe_set_mdio_speed(hw);
1120 ++
1121 + /* PHY ops must be identified and initialized prior to reset */
1122 +
1123 + /* Identify PHY and related function pointers */
1124 +diff --git a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
1125 +index 64c4b88de8449..565e1ac241aab 100644
1126 +--- a/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
1127 ++++ b/drivers/net/ethernet/mellanox/mlx4/en_ethtool.c
1128 +@@ -649,7 +649,7 @@ void __init mlx4_en_init_ptys2ethtool_map(void)
1129 + MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_1000BASE_T, SPEED_1000,
1130 + ETHTOOL_LINK_MODE_1000baseT_Full_BIT);
1131 + MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_1000BASE_CX_SGMII, SPEED_1000,
1132 +- ETHTOOL_LINK_MODE_1000baseKX_Full_BIT);
1133 ++ ETHTOOL_LINK_MODE_1000baseX_Full_BIT);
1134 + MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_1000BASE_KX, SPEED_1000,
1135 + ETHTOOL_LINK_MODE_1000baseKX_Full_BIT);
1136 + MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_T, SPEED_10000,
1137 +@@ -661,9 +661,9 @@ void __init mlx4_en_init_ptys2ethtool_map(void)
1138 + MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_KR, SPEED_10000,
1139 + ETHTOOL_LINK_MODE_10000baseKR_Full_BIT);
1140 + MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_CR, SPEED_10000,
1141 +- ETHTOOL_LINK_MODE_10000baseKR_Full_BIT);
1142 ++ ETHTOOL_LINK_MODE_10000baseCR_Full_BIT);
1143 + MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_10GBASE_SR, SPEED_10000,
1144 +- ETHTOOL_LINK_MODE_10000baseKR_Full_BIT);
1145 ++ ETHTOOL_LINK_MODE_10000baseSR_Full_BIT);
1146 + MLX4_BUILD_PTYS2ETHTOOL_CONFIG(MLX4_20GBASE_KR2, SPEED_20000,
1147 + ETHTOOL_LINK_MODE_20000baseMLD2_Full_BIT,
1148 + ETHTOOL_LINK_MODE_20000baseKR2_Full_BIT);
1149 +diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
1150 +index 838b6fe9dfaaf..e286188b6ea1b 100644
1151 +--- a/drivers/net/usb/lan78xx.c
1152 ++++ b/drivers/net/usb/lan78xx.c
1153 +@@ -920,11 +920,9 @@ static int lan78xx_read_otp(struct lan78xx_net *dev, u32 offset,
1154 + ret = lan78xx_read_raw_otp(dev, 0, 1, &sig);
1155 +
1156 + if (ret == 0) {
1157 +- if (sig == OTP_INDICATOR_1)
1158 +- offset = offset;
1159 +- else if (sig == OTP_INDICATOR_2)
1160 ++ if (sig == OTP_INDICATOR_2)
1161 + offset += 0x100;
1162 +- else
1163 ++ else if (sig != OTP_INDICATOR_1)
1164 + ret = -EINVAL;
1165 + if (!ret)
1166 + ret = lan78xx_read_raw_otp(dev, offset, length, data);
1167 +diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
1168 +index 0edc5d621304b..a9cee3dac97b0 100644
1169 +--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
1170 ++++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
1171 +@@ -323,9 +323,9 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
1172 +
1173 + adapter->seq_num++;
1174 + sleep_cfm_buf->seq_num =
1175 +- cpu_to_le16((HostCmd_SET_SEQ_NO_BSS_INFO
1176 ++ cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO
1177 + (adapter->seq_num, priv->bss_num,
1178 +- priv->bss_type)));
1179 ++ priv->bss_type));
1180 +
1181 + mwifiex_dbg(adapter, CMD,
1182 + "cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n",
1183 +diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h
1184 +index 1d86d29b64ccc..c802b73a15c5c 100644
1185 +--- a/drivers/net/wireless/marvell/mwifiex/fw.h
1186 ++++ b/drivers/net/wireless/marvell/mwifiex/fw.h
1187 +@@ -498,10 +498,10 @@ enum mwifiex_channel_flags {
1188 +
1189 + #define RF_ANTENNA_AUTO 0xFFFF
1190 +
1191 +-#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
1192 +- (((seq) & 0x00ff) | \
1193 +- (((num) & 0x000f) << 8)) | \
1194 +- (((type) & 0x000f) << 12); }
1195 ++#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) \
1196 ++ ((((seq) & 0x00ff) | \
1197 ++ (((num) & 0x000f) << 8)) | \
1198 ++ (((type) & 0x000f) << 12))
1199 +
1200 + #define HostCmd_GET_SEQ_NO(seq) \
1201 + ((seq) & HostCmd_SEQ_NUM_MASK)
1202 +diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
1203 +index 347c796afd4ed..bfa3c6aaebe6b 100644
1204 +--- a/drivers/net/xen-netback/common.h
1205 ++++ b/drivers/net/xen-netback/common.h
1206 +@@ -203,6 +203,7 @@ struct xenvif_queue { /* Per-queue data for xenvif */
1207 + unsigned int rx_queue_max;
1208 + unsigned int rx_queue_len;
1209 + unsigned long last_rx_time;
1210 ++ unsigned int rx_slots_needed;
1211 + bool stalled;
1212 +
1213 + struct xenvif_copy_state rx_copy;
1214 +diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c
1215 +index ddfb1cfa2dd94..29c7645f57805 100644
1216 +--- a/drivers/net/xen-netback/rx.c
1217 ++++ b/drivers/net/xen-netback/rx.c
1218 +@@ -33,28 +33,36 @@
1219 + #include <xen/xen.h>
1220 + #include <xen/events.h>
1221 +
1222 +-static bool xenvif_rx_ring_slots_available(struct xenvif_queue *queue)
1223 ++/*
1224 ++ * Update the needed ring page slots for the first SKB queued.
1225 ++ * Note that any call sequence outside the RX thread calling this function
1226 ++ * needs to wake up the RX thread via a call of xenvif_kick_thread()
1227 ++ * afterwards in order to avoid a race with putting the thread to sleep.
1228 ++ */
1229 ++static void xenvif_update_needed_slots(struct xenvif_queue *queue,
1230 ++ const struct sk_buff *skb)
1231 + {
1232 +- RING_IDX prod, cons;
1233 +- struct sk_buff *skb;
1234 +- int needed;
1235 +- unsigned long flags;
1236 +-
1237 +- spin_lock_irqsave(&queue->rx_queue.lock, flags);
1238 ++ unsigned int needed = 0;
1239 +
1240 +- skb = skb_peek(&queue->rx_queue);
1241 +- if (!skb) {
1242 +- spin_unlock_irqrestore(&queue->rx_queue.lock, flags);
1243 +- return false;
1244 ++ if (skb) {
1245 ++ needed = DIV_ROUND_UP(skb->len, XEN_PAGE_SIZE);
1246 ++ if (skb_is_gso(skb))
1247 ++ needed++;
1248 ++ if (skb->sw_hash)
1249 ++ needed++;
1250 + }
1251 +
1252 +- needed = DIV_ROUND_UP(skb->len, XEN_PAGE_SIZE);
1253 +- if (skb_is_gso(skb))
1254 +- needed++;
1255 +- if (skb->sw_hash)
1256 +- needed++;
1257 ++ WRITE_ONCE(queue->rx_slots_needed, needed);
1258 ++}
1259 +
1260 +- spin_unlock_irqrestore(&queue->rx_queue.lock, flags);
1261 ++static bool xenvif_rx_ring_slots_available(struct xenvif_queue *queue)
1262 ++{
1263 ++ RING_IDX prod, cons;
1264 ++ unsigned int needed;
1265 ++
1266 ++ needed = READ_ONCE(queue->rx_slots_needed);
1267 ++ if (!needed)
1268 ++ return false;
1269 +
1270 + do {
1271 + prod = queue->rx.sring->req_prod;
1272 +@@ -80,13 +88,19 @@ void xenvif_rx_queue_tail(struct xenvif_queue *queue, struct sk_buff *skb)
1273 +
1274 + spin_lock_irqsave(&queue->rx_queue.lock, flags);
1275 +
1276 +- __skb_queue_tail(&queue->rx_queue, skb);
1277 +-
1278 +- queue->rx_queue_len += skb->len;
1279 +- if (queue->rx_queue_len > queue->rx_queue_max) {
1280 ++ if (queue->rx_queue_len >= queue->rx_queue_max) {
1281 + struct net_device *dev = queue->vif->dev;
1282 +
1283 + netif_tx_stop_queue(netdev_get_tx_queue(dev, queue->id));
1284 ++ kfree_skb(skb);
1285 ++ queue->vif->dev->stats.rx_dropped++;
1286 ++ } else {
1287 ++ if (skb_queue_empty(&queue->rx_queue))
1288 ++ xenvif_update_needed_slots(queue, skb);
1289 ++
1290 ++ __skb_queue_tail(&queue->rx_queue, skb);
1291 ++
1292 ++ queue->rx_queue_len += skb->len;
1293 + }
1294 +
1295 + spin_unlock_irqrestore(&queue->rx_queue.lock, flags);
1296 +@@ -100,6 +114,8 @@ static struct sk_buff *xenvif_rx_dequeue(struct xenvif_queue *queue)
1297 +
1298 + skb = __skb_dequeue(&queue->rx_queue);
1299 + if (skb) {
1300 ++ xenvif_update_needed_slots(queue, skb_peek(&queue->rx_queue));
1301 ++
1302 + queue->rx_queue_len -= skb->len;
1303 + if (queue->rx_queue_len < queue->rx_queue_max) {
1304 + struct netdev_queue *txq;
1305 +@@ -134,6 +150,7 @@ static void xenvif_rx_queue_drop_expired(struct xenvif_queue *queue)
1306 + break;
1307 + xenvif_rx_dequeue(queue);
1308 + kfree_skb(skb);
1309 ++ queue->vif->dev->stats.rx_dropped++;
1310 + }
1311 + }
1312 +
1313 +@@ -474,27 +491,31 @@ void xenvif_rx_action(struct xenvif_queue *queue)
1314 + xenvif_rx_copy_flush(queue);
1315 + }
1316 +
1317 +-static bool xenvif_rx_queue_stalled(struct xenvif_queue *queue)
1318 ++static RING_IDX xenvif_rx_queue_slots(const struct xenvif_queue *queue)
1319 + {
1320 + RING_IDX prod, cons;
1321 +
1322 + prod = queue->rx.sring->req_prod;
1323 + cons = queue->rx.req_cons;
1324 +
1325 ++ return prod - cons;
1326 ++}
1327 ++
1328 ++static bool xenvif_rx_queue_stalled(const struct xenvif_queue *queue)
1329 ++{
1330 ++ unsigned int needed = READ_ONCE(queue->rx_slots_needed);
1331 ++
1332 + return !queue->stalled &&
1333 +- prod - cons < 1 &&
1334 ++ xenvif_rx_queue_slots(queue) < needed &&
1335 + time_after(jiffies,
1336 + queue->last_rx_time + queue->vif->stall_timeout);
1337 + }
1338 +
1339 + static bool xenvif_rx_queue_ready(struct xenvif_queue *queue)
1340 + {
1341 +- RING_IDX prod, cons;
1342 +-
1343 +- prod = queue->rx.sring->req_prod;
1344 +- cons = queue->rx.req_cons;
1345 ++ unsigned int needed = READ_ONCE(queue->rx_slots_needed);
1346 +
1347 +- return queue->stalled && prod - cons >= 1;
1348 ++ return queue->stalled && xenvif_rx_queue_slots(queue) >= needed;
1349 + }
1350 +
1351 + bool xenvif_have_rx_work(struct xenvif_queue *queue, bool test_kthread)
1352 +diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
1353 +index ef7dd70a40a12..56c7f2ebf5738 100644
1354 +--- a/drivers/net/xen-netfront.c
1355 ++++ b/drivers/net/xen-netfront.c
1356 +@@ -142,6 +142,9 @@ struct netfront_queue {
1357 + struct sk_buff *rx_skbs[NET_RX_RING_SIZE];
1358 + grant_ref_t gref_rx_head;
1359 + grant_ref_t grant_rx_ref[NET_RX_RING_SIZE];
1360 ++
1361 ++ unsigned int rx_rsp_unconsumed;
1362 ++ spinlock_t rx_cons_lock;
1363 + };
1364 +
1365 + struct netfront_info {
1366 +@@ -366,12 +369,13 @@ static int xennet_open(struct net_device *dev)
1367 + return 0;
1368 + }
1369 +
1370 +-static void xennet_tx_buf_gc(struct netfront_queue *queue)
1371 ++static bool xennet_tx_buf_gc(struct netfront_queue *queue)
1372 + {
1373 + RING_IDX cons, prod;
1374 + unsigned short id;
1375 + struct sk_buff *skb;
1376 + bool more_to_do;
1377 ++ bool work_done = false;
1378 + const struct device *dev = &queue->info->netdev->dev;
1379 +
1380 + BUG_ON(!netif_carrier_ok(queue->info->netdev));
1381 +@@ -388,6 +392,8 @@ static void xennet_tx_buf_gc(struct netfront_queue *queue)
1382 + for (cons = queue->tx.rsp_cons; cons != prod; cons++) {
1383 + struct xen_netif_tx_response txrsp;
1384 +
1385 ++ work_done = true;
1386 ++
1387 + RING_COPY_RESPONSE(&queue->tx, cons, &txrsp);
1388 + if (txrsp.status == XEN_NETIF_RSP_NULL)
1389 + continue;
1390 +@@ -431,11 +437,13 @@ static void xennet_tx_buf_gc(struct netfront_queue *queue)
1391 +
1392 + xennet_maybe_wake_tx(queue);
1393 +
1394 +- return;
1395 ++ return work_done;
1396 +
1397 + err:
1398 + queue->info->broken = true;
1399 + dev_alert(dev, "Disabled for further use\n");
1400 ++
1401 ++ return work_done;
1402 + }
1403 +
1404 + struct xennet_gnttab_make_txreq {
1405 +@@ -755,6 +763,16 @@ static int xennet_close(struct net_device *dev)
1406 + return 0;
1407 + }
1408 +
1409 ++static void xennet_set_rx_rsp_cons(struct netfront_queue *queue, RING_IDX val)
1410 ++{
1411 ++ unsigned long flags;
1412 ++
1413 ++ spin_lock_irqsave(&queue->rx_cons_lock, flags);
1414 ++ queue->rx.rsp_cons = val;
1415 ++ queue->rx_rsp_unconsumed = RING_HAS_UNCONSUMED_RESPONSES(&queue->rx);
1416 ++ spin_unlock_irqrestore(&queue->rx_cons_lock, flags);
1417 ++}
1418 ++
1419 + static void xennet_move_rx_slot(struct netfront_queue *queue, struct sk_buff *skb,
1420 + grant_ref_t ref)
1421 + {
1422 +@@ -806,7 +824,7 @@ static int xennet_get_extras(struct netfront_queue *queue,
1423 + xennet_move_rx_slot(queue, skb, ref);
1424 + } while (extra.flags & XEN_NETIF_EXTRA_FLAG_MORE);
1425 +
1426 +- queue->rx.rsp_cons = cons;
1427 ++ xennet_set_rx_rsp_cons(queue, cons);
1428 + return err;
1429 + }
1430 +
1431 +@@ -886,7 +904,7 @@ next:
1432 + }
1433 +
1434 + if (unlikely(err))
1435 +- queue->rx.rsp_cons = cons + slots;
1436 ++ xennet_set_rx_rsp_cons(queue, cons + slots);
1437 +
1438 + return err;
1439 + }
1440 +@@ -940,7 +958,8 @@ static int xennet_fill_frags(struct netfront_queue *queue,
1441 + __pskb_pull_tail(skb, pull_to - skb_headlen(skb));
1442 + }
1443 + if (unlikely(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) {
1444 +- queue->rx.rsp_cons = ++cons + skb_queue_len(list);
1445 ++ xennet_set_rx_rsp_cons(queue,
1446 ++ ++cons + skb_queue_len(list));
1447 + kfree_skb(nskb);
1448 + return -ENOENT;
1449 + }
1450 +@@ -953,7 +972,7 @@ static int xennet_fill_frags(struct netfront_queue *queue,
1451 + kfree_skb(nskb);
1452 + }
1453 +
1454 +- queue->rx.rsp_cons = cons;
1455 ++ xennet_set_rx_rsp_cons(queue, cons);
1456 +
1457 + return 0;
1458 + }
1459 +@@ -1074,7 +1093,9 @@ err:
1460 +
1461 + if (unlikely(xennet_set_skb_gso(skb, gso))) {
1462 + __skb_queue_head(&tmpq, skb);
1463 +- queue->rx.rsp_cons += skb_queue_len(&tmpq);
1464 ++ xennet_set_rx_rsp_cons(queue,
1465 ++ queue->rx.rsp_cons +
1466 ++ skb_queue_len(&tmpq));
1467 + goto err;
1468 + }
1469 + }
1470 +@@ -1098,7 +1119,8 @@ err:
1471 +
1472 + __skb_queue_tail(&rxq, skb);
1473 +
1474 +- i = ++queue->rx.rsp_cons;
1475 ++ i = queue->rx.rsp_cons + 1;
1476 ++ xennet_set_rx_rsp_cons(queue, i);
1477 + work_done++;
1478 + }
1479 +
1480 +@@ -1260,40 +1282,79 @@ static int xennet_set_features(struct net_device *dev,
1481 + return 0;
1482 + }
1483 +
1484 +-static irqreturn_t xennet_tx_interrupt(int irq, void *dev_id)
1485 ++static bool xennet_handle_tx(struct netfront_queue *queue, unsigned int *eoi)
1486 + {
1487 +- struct netfront_queue *queue = dev_id;
1488 + unsigned long flags;
1489 +
1490 +- if (queue->info->broken)
1491 +- return IRQ_HANDLED;
1492 ++ if (unlikely(queue->info->broken))
1493 ++ return false;
1494 +
1495 + spin_lock_irqsave(&queue->tx_lock, flags);
1496 +- xennet_tx_buf_gc(queue);
1497 ++ if (xennet_tx_buf_gc(queue))
1498 ++ *eoi = 0;
1499 + spin_unlock_irqrestore(&queue->tx_lock, flags);
1500 +
1501 ++ return true;
1502 ++}
1503 ++
1504 ++static irqreturn_t xennet_tx_interrupt(int irq, void *dev_id)
1505 ++{
1506 ++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS;
1507 ++
1508 ++ if (likely(xennet_handle_tx(dev_id, &eoiflag)))
1509 ++ xen_irq_lateeoi(irq, eoiflag);
1510 ++
1511 + return IRQ_HANDLED;
1512 + }
1513 +
1514 +-static irqreturn_t xennet_rx_interrupt(int irq, void *dev_id)
1515 ++static bool xennet_handle_rx(struct netfront_queue *queue, unsigned int *eoi)
1516 + {
1517 +- struct netfront_queue *queue = dev_id;
1518 +- struct net_device *dev = queue->info->netdev;
1519 ++ unsigned int work_queued;
1520 ++ unsigned long flags;
1521 +
1522 +- if (queue->info->broken)
1523 +- return IRQ_HANDLED;
1524 ++ if (unlikely(queue->info->broken))
1525 ++ return false;
1526 ++
1527 ++ spin_lock_irqsave(&queue->rx_cons_lock, flags);
1528 ++ work_queued = RING_HAS_UNCONSUMED_RESPONSES(&queue->rx);
1529 ++ if (work_queued > queue->rx_rsp_unconsumed) {
1530 ++ queue->rx_rsp_unconsumed = work_queued;
1531 ++ *eoi = 0;
1532 ++ } else if (unlikely(work_queued < queue->rx_rsp_unconsumed)) {
1533 ++ const struct device *dev = &queue->info->netdev->dev;
1534 ++
1535 ++ spin_unlock_irqrestore(&queue->rx_cons_lock, flags);
1536 ++ dev_alert(dev, "RX producer index going backwards\n");
1537 ++ dev_alert(dev, "Disabled for further use\n");
1538 ++ queue->info->broken = true;
1539 ++ return false;
1540 ++ }
1541 ++ spin_unlock_irqrestore(&queue->rx_cons_lock, flags);
1542 +
1543 +- if (likely(netif_carrier_ok(dev) &&
1544 +- RING_HAS_UNCONSUMED_RESPONSES(&queue->rx)))
1545 ++ if (likely(netif_carrier_ok(queue->info->netdev) && work_queued))
1546 + napi_schedule(&queue->napi);
1547 +
1548 ++ return true;
1549 ++}
1550 ++
1551 ++static irqreturn_t xennet_rx_interrupt(int irq, void *dev_id)
1552 ++{
1553 ++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS;
1554 ++
1555 ++ if (likely(xennet_handle_rx(dev_id, &eoiflag)))
1556 ++ xen_irq_lateeoi(irq, eoiflag);
1557 ++
1558 + return IRQ_HANDLED;
1559 + }
1560 +
1561 + static irqreturn_t xennet_interrupt(int irq, void *dev_id)
1562 + {
1563 +- xennet_tx_interrupt(irq, dev_id);
1564 +- xennet_rx_interrupt(irq, dev_id);
1565 ++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS;
1566 ++
1567 ++ if (xennet_handle_tx(dev_id, &eoiflag) &&
1568 ++ xennet_handle_rx(dev_id, &eoiflag))
1569 ++ xen_irq_lateeoi(irq, eoiflag);
1570 ++
1571 + return IRQ_HANDLED;
1572 + }
1573 +
1574 +@@ -1527,9 +1588,10 @@ static int setup_netfront_single(struct netfront_queue *queue)
1575 + if (err < 0)
1576 + goto fail;
1577 +
1578 +- err = bind_evtchn_to_irqhandler(queue->tx_evtchn,
1579 +- xennet_interrupt,
1580 +- 0, queue->info->netdev->name, queue);
1581 ++ err = bind_evtchn_to_irqhandler_lateeoi(queue->tx_evtchn,
1582 ++ xennet_interrupt, 0,
1583 ++ queue->info->netdev->name,
1584 ++ queue);
1585 + if (err < 0)
1586 + goto bind_fail;
1587 + queue->rx_evtchn = queue->tx_evtchn;
1588 +@@ -1557,18 +1619,18 @@ static int setup_netfront_split(struct netfront_queue *queue)
1589 +
1590 + snprintf(queue->tx_irq_name, sizeof(queue->tx_irq_name),
1591 + "%s-tx", queue->name);
1592 +- err = bind_evtchn_to_irqhandler(queue->tx_evtchn,
1593 +- xennet_tx_interrupt,
1594 +- 0, queue->tx_irq_name, queue);
1595 ++ err = bind_evtchn_to_irqhandler_lateeoi(queue->tx_evtchn,
1596 ++ xennet_tx_interrupt, 0,
1597 ++ queue->tx_irq_name, queue);
1598 + if (err < 0)
1599 + goto bind_tx_fail;
1600 + queue->tx_irq = err;
1601 +
1602 + snprintf(queue->rx_irq_name, sizeof(queue->rx_irq_name),
1603 + "%s-rx", queue->name);
1604 +- err = bind_evtchn_to_irqhandler(queue->rx_evtchn,
1605 +- xennet_rx_interrupt,
1606 +- 0, queue->rx_irq_name, queue);
1607 ++ err = bind_evtchn_to_irqhandler_lateeoi(queue->rx_evtchn,
1608 ++ xennet_rx_interrupt, 0,
1609 ++ queue->rx_irq_name, queue);
1610 + if (err < 0)
1611 + goto bind_rx_fail;
1612 + queue->rx_irq = err;
1613 +@@ -1670,6 +1732,7 @@ static int xennet_init_queue(struct netfront_queue *queue)
1614 +
1615 + spin_lock_init(&queue->tx_lock);
1616 + spin_lock_init(&queue->rx_lock);
1617 ++ spin_lock_init(&queue->rx_cons_lock);
1618 +
1619 + setup_timer(&queue->rx_refill_timer, rx_refill_timeout,
1620 + (unsigned long)queue);
1621 +diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
1622 +index 2c000b9b0a42e..bbddf492da9fc 100644
1623 +--- a/drivers/pci/msi.c
1624 ++++ b/drivers/pci/msi.c
1625 +@@ -796,9 +796,6 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
1626 + goto out_disable;
1627 + }
1628 +
1629 +- /* Ensure that all table entries are masked. */
1630 +- msix_mask_all(base, tsize);
1631 +-
1632 + ret = msix_setup_entries(dev, base, entries, nvec, affd);
1633 + if (ret)
1634 + goto out_disable;
1635 +@@ -821,6 +818,16 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
1636 + /* Set MSI-X enabled bits and unmask the function */
1637 + pci_intx_for_msi(dev, 0);
1638 + dev->msix_enabled = 1;
1639 ++
1640 ++ /*
1641 ++ * Ensure that all table entries are masked to prevent
1642 ++ * stale entries from firing in a crash kernel.
1643 ++ *
1644 ++ * Done late to deal with a broken Marvell NVME device
1645 ++ * which takes the MSI-X mask bits into account even
1646 ++ * when MSI-X is disabled, which prevents MSI delivery.
1647 ++ */
1648 ++ msix_mask_all(base, tsize);
1649 + pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL, 0);
1650 +
1651 + pcibios_free_irq(dev);
1652 +@@ -847,7 +854,7 @@ out_free:
1653 + free_msi_irqs(dev);
1654 +
1655 + out_disable:
1656 +- pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);
1657 ++ pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL | PCI_MSIX_FLAGS_ENABLE, 0);
1658 +
1659 + return ret;
1660 + }
1661 +diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
1662 +index aba1a3396890b..b553ae4a88635 100644
1663 +--- a/drivers/scsi/scsi_debug.c
1664 ++++ b/drivers/scsi/scsi_debug.c
1665 +@@ -2181,11 +2181,11 @@ static int resp_mode_select(struct scsi_cmnd *scp,
1666 + __func__, param_len, res);
1667 + md_len = mselect6 ? (arr[0] + 1) : (get_unaligned_be16(arr + 0) + 2);
1668 + bd_len = mselect6 ? arr[3] : get_unaligned_be16(arr + 6);
1669 +- if (md_len > 2) {
1670 ++ off = bd_len + (mselect6 ? 4 : 8);
1671 ++ if (md_len > 2 || off >= res) {
1672 + mk_sense_invalid_fld(scp, SDEB_IN_DATA, 0, -1);
1673 + return check_condition_result;
1674 + }
1675 +- off = bd_len + (mselect6 ? 4 : 8);
1676 + mpage = arr[off] & 0x3f;
1677 + ps = !!(arr[off] & 0x80);
1678 + if (ps) {
1679 +diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
1680 +index 37bde5c8268d1..a623e498a97bc 100644
1681 +--- a/drivers/soc/tegra/fuse/fuse-tegra.c
1682 ++++ b/drivers/soc/tegra/fuse/fuse-tegra.c
1683 +@@ -178,7 +178,7 @@ static struct platform_driver tegra_fuse_driver = {
1684 + };
1685 + builtin_platform_driver(tegra_fuse_driver);
1686 +
1687 +-bool __init tegra_fuse_read_spare(unsigned int spare)
1688 ++u32 __init tegra_fuse_read_spare(unsigned int spare)
1689 + {
1690 + unsigned int offset = fuse->soc->info->spare + spare * 4;
1691 +
1692 +diff --git a/drivers/soc/tegra/fuse/fuse.h b/drivers/soc/tegra/fuse/fuse.h
1693 +index 10c2076d5089a..f368bd5373088 100644
1694 +--- a/drivers/soc/tegra/fuse/fuse.h
1695 ++++ b/drivers/soc/tegra/fuse/fuse.h
1696 +@@ -62,7 +62,7 @@ struct tegra_fuse {
1697 + void tegra_init_revision(void);
1698 + void tegra_init_apbmisc(void);
1699 +
1700 +-bool __init tegra_fuse_read_spare(unsigned int spare);
1701 ++u32 __init tegra_fuse_read_spare(unsigned int spare);
1702 + u32 __init tegra_fuse_read_early(unsigned int offset);
1703 +
1704 + #ifdef CONFIG_ARCH_TEGRA_2x_SOC
1705 +diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
1706 +index 858c7b4b197cb..2af089b2a343d 100644
1707 +--- a/drivers/tty/hvc/hvc_xen.c
1708 ++++ b/drivers/tty/hvc/hvc_xen.c
1709 +@@ -50,6 +50,8 @@ struct xencons_info {
1710 + struct xenbus_device *xbdev;
1711 + struct xencons_interface *intf;
1712 + unsigned int evtchn;
1713 ++ XENCONS_RING_IDX out_cons;
1714 ++ unsigned int out_cons_same;
1715 + struct hvc_struct *hvc;
1716 + int irq;
1717 + int vtermno;
1718 +@@ -151,6 +153,8 @@ static int domU_read_console(uint32_t vtermno, char *buf, int len)
1719 + XENCONS_RING_IDX cons, prod;
1720 + int recv = 0;
1721 + struct xencons_info *xencons = vtermno_to_xencons(vtermno);
1722 ++ unsigned int eoiflag = 0;
1723 ++
1724 + if (xencons == NULL)
1725 + return -EINVAL;
1726 + intf = xencons->intf;
1727 +@@ -170,7 +174,27 @@ static int domU_read_console(uint32_t vtermno, char *buf, int len)
1728 + mb(); /* read ring before consuming */
1729 + intf->in_cons = cons;
1730 +
1731 +- notify_daemon(xencons);
1732 ++ /*
1733 ++ * When to mark interrupt having been spurious:
1734 ++ * - there was no new data to be read, and
1735 ++ * - the backend did not consume some output bytes, and
1736 ++ * - the previous round with no read data didn't see consumed bytes
1737 ++ * (we might have a race with an interrupt being in flight while
1738 ++ * updating xencons->out_cons, so account for that by allowing one
1739 ++ * round without any visible reason)
1740 ++ */
1741 ++ if (intf->out_cons != xencons->out_cons) {
1742 ++ xencons->out_cons = intf->out_cons;
1743 ++ xencons->out_cons_same = 0;
1744 ++ }
1745 ++ if (recv) {
1746 ++ notify_daemon(xencons);
1747 ++ } else if (xencons->out_cons_same++ > 1) {
1748 ++ eoiflag = XEN_EOI_FLAG_SPURIOUS;
1749 ++ }
1750 ++
1751 ++ xen_irq_lateeoi(xencons->irq, eoiflag);
1752 ++
1753 + return recv;
1754 + }
1755 +
1756 +@@ -399,7 +423,7 @@ static int xencons_connect_backend(struct xenbus_device *dev,
1757 + if (ret)
1758 + return ret;
1759 + info->evtchn = evtchn;
1760 +- irq = bind_evtchn_to_irq(evtchn);
1761 ++ irq = bind_interdomain_evtchn_to_irq_lateeoi(dev->otherend_id, evtchn);
1762 + if (irq < 0)
1763 + return irq;
1764 + info->irq = irq;
1765 +@@ -563,7 +587,7 @@ static int __init xen_hvc_init(void)
1766 + return r;
1767 +
1768 + info = vtermno_to_xencons(HVC_COOKIE);
1769 +- info->irq = bind_evtchn_to_irq(info->evtchn);
1770 ++ info->irq = bind_evtchn_to_irq_lateeoi(info->evtchn);
1771 + }
1772 + if (info->irq < 0)
1773 + info->irq = 0; /* NO_IRQ */
1774 +diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
1775 +index bcebec17bdd51..b407f907d6555 100644
1776 +--- a/drivers/usb/gadget/composite.c
1777 ++++ b/drivers/usb/gadget/composite.c
1778 +@@ -1636,14 +1636,14 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1779 + u8 endp;
1780 +
1781 + if (w_length > USB_COMP_EP0_BUFSIZ) {
1782 +- if (ctrl->bRequestType == USB_DIR_OUT) {
1783 +- goto done;
1784 +- } else {
1785 ++ if (ctrl->bRequestType & USB_DIR_IN) {
1786 + /* Cast away the const, we are going to overwrite on purpose. */
1787 + __le16 *temp = (__le16 *)&ctrl->wLength;
1788 +
1789 + *temp = cpu_to_le16(USB_COMP_EP0_BUFSIZ);
1790 + w_length = USB_COMP_EP0_BUFSIZ;
1791 ++ } else {
1792 ++ goto done;
1793 + }
1794 + }
1795 +
1796 +diff --git a/drivers/usb/gadget/legacy/dbgp.c b/drivers/usb/gadget/legacy/dbgp.c
1797 +index f1c5a22704b28..e8818ad973e4b 100644
1798 +--- a/drivers/usb/gadget/legacy/dbgp.c
1799 ++++ b/drivers/usb/gadget/legacy/dbgp.c
1800 +@@ -345,14 +345,14 @@ static int dbgp_setup(struct usb_gadget *gadget,
1801 + u16 len = 0;
1802 +
1803 + if (length > DBGP_REQ_LEN) {
1804 +- if (ctrl->bRequestType == USB_DIR_OUT) {
1805 +- return err;
1806 +- } else {
1807 ++ if (ctrl->bRequestType & USB_DIR_IN) {
1808 + /* Cast away the const, we are going to overwrite on purpose. */
1809 + __le16 *temp = (__le16 *)&ctrl->wLength;
1810 +
1811 + *temp = cpu_to_le16(DBGP_REQ_LEN);
1812 + length = DBGP_REQ_LEN;
1813 ++ } else {
1814 ++ return err;
1815 + }
1816 + }
1817 +
1818 +diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
1819 +index ee4c206150a83..c67d53beed85e 100644
1820 +--- a/drivers/usb/gadget/legacy/inode.c
1821 ++++ b/drivers/usb/gadget/legacy/inode.c
1822 +@@ -1339,14 +1339,14 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1823 + u16 w_length = le16_to_cpu(ctrl->wLength);
1824 +
1825 + if (w_length > RBUF_SIZE) {
1826 +- if (ctrl->bRequestType == USB_DIR_OUT) {
1827 +- return value;
1828 +- } else {
1829 ++ if (ctrl->bRequestType & USB_DIR_IN) {
1830 + /* Cast away the const, we are going to overwrite on purpose. */
1831 + __le16 *temp = (__le16 *)&ctrl->wLength;
1832 +
1833 + *temp = cpu_to_le16(RBUF_SIZE);
1834 + w_length = RBUF_SIZE;
1835 ++ } else {
1836 ++ return value;
1837 + }
1838 + }
1839 +
1840 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1841 +index 4e2a9852147b3..b101a505c74bc 100644
1842 +--- a/drivers/usb/serial/option.c
1843 ++++ b/drivers/usb/serial/option.c
1844 +@@ -1222,6 +1222,14 @@ static const struct usb_device_id option_ids[] = {
1845 + .driver_info = NCTRL(2) | RSVD(3) },
1846 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1063, 0xff), /* Telit LN920 (ECM) */
1847 + .driver_info = NCTRL(0) | RSVD(1) },
1848 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1070, 0xff), /* Telit FN990 (rmnet) */
1849 ++ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1850 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1071, 0xff), /* Telit FN990 (MBIM) */
1851 ++ .driver_info = NCTRL(0) | RSVD(1) },
1852 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1072, 0xff), /* Telit FN990 (RNDIS) */
1853 ++ .driver_info = NCTRL(2) | RSVD(3) },
1854 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1073, 0xff), /* Telit FN990 (ECM) */
1855 ++ .driver_info = NCTRL(0) | RSVD(1) },
1856 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
1857 + .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
1858 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
1859 +diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
1860 +index 4d95a416fc36b..b8d13b69583cc 100644
1861 +--- a/fs/fuse/dir.c
1862 ++++ b/fs/fuse/dir.c
1863 +@@ -969,7 +969,7 @@ int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid,
1864 + if (!parent)
1865 + return -ENOENT;
1866 +
1867 +- inode_lock(parent);
1868 ++ inode_lock_nested(parent, I_MUTEX_PARENT);
1869 + if (!S_ISDIR(parent->i_mode))
1870 + goto unlock;
1871 +
1872 +diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
1873 +index d5d1c70bb927b..1c7a695ac265b 100644
1874 +--- a/fs/nfsd/nfs4state.c
1875 ++++ b/fs/nfsd/nfs4state.c
1876 +@@ -955,6 +955,11 @@ hash_delegation_locked(struct nfs4_delegation *dp, struct nfs4_file *fp)
1877 + return 0;
1878 + }
1879 +
1880 ++static bool delegation_hashed(struct nfs4_delegation *dp)
1881 ++{
1882 ++ return !(list_empty(&dp->dl_perfile));
1883 ++}
1884 ++
1885 + static bool
1886 + unhash_delegation_locked(struct nfs4_delegation *dp)
1887 + {
1888 +@@ -962,7 +967,7 @@ unhash_delegation_locked(struct nfs4_delegation *dp)
1889 +
1890 + lockdep_assert_held(&state_lock);
1891 +
1892 +- if (list_empty(&dp->dl_perfile))
1893 ++ if (!delegation_hashed(dp))
1894 + return false;
1895 +
1896 + dp->dl_stid.sc_type = NFS4_CLOSED_DELEG_STID;
1897 +@@ -3881,7 +3886,7 @@ static void nfsd4_cb_recall_prepare(struct nfsd4_callback *cb)
1898 + * queued for a lease break. Don't queue it again.
1899 + */
1900 + spin_lock(&state_lock);
1901 +- if (dp->dl_time == 0) {
1902 ++ if (delegation_hashed(dp) && dp->dl_time == 0) {
1903 + dp->dl_time = get_seconds();
1904 + list_add_tail(&dp->dl_recall_lru, &nn->del_recall_lru);
1905 + }
1906 +diff --git a/kernel/audit.c b/kernel/audit.c
1907 +index 6faaa908544af..2b82316b844b7 100644
1908 +--- a/kernel/audit.c
1909 ++++ b/kernel/audit.c
1910 +@@ -686,7 +686,7 @@ static int kauditd_send_queue(struct sock *sk, u32 portid,
1911 + {
1912 + int rc = 0;
1913 + struct sk_buff *skb;
1914 +- static unsigned int failed = 0;
1915 ++ unsigned int failed = 0;
1916 +
1917 + /* NOTE: kauditd_thread takes care of all our locking, we just use
1918 + * the netlink info passed to us (e.g. sk and portid) */
1919 +@@ -703,32 +703,30 @@ static int kauditd_send_queue(struct sock *sk, u32 portid,
1920 + continue;
1921 + }
1922 +
1923 ++retry:
1924 + /* grab an extra skb reference in case of error */
1925 + skb_get(skb);
1926 + rc = netlink_unicast(sk, skb, portid, 0);
1927 + if (rc < 0) {
1928 +- /* fatal failure for our queue flush attempt? */
1929 ++ /* send failed - try a few times unless fatal error */
1930 + if (++failed >= retry_limit ||
1931 + rc == -ECONNREFUSED || rc == -EPERM) {
1932 +- /* yes - error processing for the queue */
1933 + sk = NULL;
1934 + if (err_hook)
1935 + (*err_hook)(skb);
1936 +- if (!skb_hook)
1937 +- goto out;
1938 +- /* keep processing with the skb_hook */
1939 ++ if (rc == -EAGAIN)
1940 ++ rc = 0;
1941 ++ /* continue to drain the queue */
1942 + continue;
1943 + } else
1944 +- /* no - requeue to preserve ordering */
1945 +- skb_queue_head(queue, skb);
1946 ++ goto retry;
1947 + } else {
1948 +- /* it worked - drop the extra reference and continue */
1949 ++ /* skb sent - drop the extra reference and continue */
1950 + consume_skb(skb);
1951 + failed = 0;
1952 + }
1953 + }
1954 +
1955 +-out:
1956 + return (rc >= 0 ? 0 : rc);
1957 + }
1958 +
1959 +@@ -1518,7 +1516,8 @@ static int __net_init audit_net_init(struct net *net)
1960 + audit_panic("cannot initialize netlink socket in namespace");
1961 + return -ENOMEM;
1962 + }
1963 +- aunet->sk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT;
1964 ++ /* limit the timeout in case auditd is blocked/stopped */
1965 ++ aunet->sk->sk_sndtimeo = HZ / 10;
1966 +
1967 + return 0;
1968 + }
1969 +diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
1970 +index 5b6f815a74ee3..602b476627dd5 100644
1971 +--- a/kernel/time/timekeeping.c
1972 ++++ b/kernel/time/timekeeping.c
1973 +@@ -1235,8 +1235,7 @@ int do_settimeofday64(const struct timespec64 *ts)
1974 + timekeeping_forward_now(tk);
1975 +
1976 + xt = tk_xtime(tk);
1977 +- ts_delta.tv_sec = ts->tv_sec - xt.tv_sec;
1978 +- ts_delta.tv_nsec = ts->tv_nsec - xt.tv_nsec;
1979 ++ ts_delta = timespec64_sub(*ts, xt);
1980 +
1981 + if (timespec64_compare(&tk->wall_to_monotonic, &ts_delta) > 0) {
1982 + ret = -EINVAL;
1983 +diff --git a/kernel/trace/tracing_map.c b/kernel/trace/tracing_map.c
1984 +index 379db35838b64..572c0854d631c 100644
1985 +--- a/kernel/trace/tracing_map.c
1986 ++++ b/kernel/trace/tracing_map.c
1987 +@@ -24,6 +24,7 @@
1988 + #include <linux/jhash.h>
1989 + #include <linux/slab.h>
1990 + #include <linux/sort.h>
1991 ++#include <linux/kmemleak.h>
1992 +
1993 + #include "tracing_map.h"
1994 + #include "trace.h"
1995 +@@ -227,6 +228,7 @@ void tracing_map_array_free(struct tracing_map_array *a)
1996 + for (i = 0; i < a->n_pages; i++) {
1997 + if (!a->pages[i])
1998 + break;
1999 ++ kmemleak_free(a->pages[i]);
2000 + free_page((unsigned long)a->pages[i]);
2001 + }
2002 +
2003 +@@ -262,6 +264,7 @@ struct tracing_map_array *tracing_map_array_alloc(unsigned int n_elts,
2004 + a->pages[i] = (void *)get_zeroed_page(GFP_KERNEL);
2005 + if (!a->pages[i])
2006 + goto free;
2007 ++ kmemleak_alloc(a->pages[i], PAGE_SIZE, 1, GFP_KERNEL);
2008 + }
2009 + out:
2010 + return a;
2011 +diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug
2012 +index 428eaf16a1d25..f63a4faf244e8 100644
2013 +--- a/lib/Kconfig.debug
2014 ++++ b/lib/Kconfig.debug
2015 +@@ -1131,7 +1131,7 @@ config LOCKDEP
2016 + bool
2017 + depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
2018 + select STACKTRACE
2019 +- select FRAME_POINTER if !MIPS && !PPC && !ARM_UNWIND && !S390 && !MICROBLAZE && !ARC && !SCORE && !X86
2020 ++ select FRAME_POINTER if !MIPS && !PPC && !ARM && !S390 && !MICROBLAZE && !ARC && !SCORE && !X86
2021 + select KALLSYMS
2022 + select KALLSYMS_ALL
2023 +
2024 +@@ -1566,7 +1566,7 @@ config FAULT_INJECTION_STACKTRACE_FILTER
2025 + depends on FAULT_INJECTION_DEBUG_FS && STACKTRACE_SUPPORT
2026 + depends on !X86_64
2027 + select STACKTRACE
2028 +- select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !SCORE && !X86
2029 ++ select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !SCORE && !X86
2030 + help
2031 + Provide stacktrace filter for fault-injection capabilities
2032 +
2033 +@@ -1575,7 +1575,7 @@ config LATENCYTOP
2034 + depends on DEBUG_KERNEL
2035 + depends on STACKTRACE_SUPPORT
2036 + depends on PROC_FS
2037 +- select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM_UNWIND && !ARC && !X86
2038 ++ select FRAME_POINTER if !MIPS && !PPC && !S390 && !MICROBLAZE && !ARM && !ARC && !X86
2039 + select KALLSYMS
2040 + select KALLSYMS_ALL
2041 + select STACKTRACE
2042 +diff --git a/net/bpf/test_run.c b/net/bpf/test_run.c
2043 +index 6be41a44d688a..4f3c08583d8c5 100644
2044 +--- a/net/bpf/test_run.c
2045 ++++ b/net/bpf/test_run.c
2046 +@@ -96,6 +96,7 @@ int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr,
2047 + u32 size = kattr->test.data_size_in;
2048 + u32 repeat = kattr->test.repeat;
2049 + u32 retval, duration;
2050 ++ int hh_len = ETH_HLEN;
2051 + struct sk_buff *skb;
2052 + void *data;
2053 + int ret;
2054 +@@ -131,12 +132,22 @@ int bpf_prog_test_run_skb(struct bpf_prog *prog, const union bpf_attr *kattr,
2055 + skb_reset_network_header(skb);
2056 +
2057 + if (is_l2)
2058 +- __skb_push(skb, ETH_HLEN);
2059 ++ __skb_push(skb, hh_len);
2060 + if (is_direct_pkt_access)
2061 + bpf_compute_data_end(skb);
2062 + retval = bpf_test_run(prog, skb, repeat, &duration);
2063 +- if (!is_l2)
2064 +- __skb_push(skb, ETH_HLEN);
2065 ++ if (!is_l2) {
2066 ++ if (skb_headroom(skb) < hh_len) {
2067 ++ int nhead = HH_DATA_ALIGN(hh_len - skb_headroom(skb));
2068 ++
2069 ++ if (pskb_expand_head(skb, nhead, 0, GFP_USER)) {
2070 ++ kfree_skb(skb);
2071 ++ return -ENOMEM;
2072 ++ }
2073 ++ }
2074 ++ memset(__skb_push(skb, hh_len), 0, hh_len);
2075 ++ }
2076 ++
2077 + size = skb->len;
2078 + /* bpf program can never convert linear skb to non-linear */
2079 + if (WARN_ON_ONCE(skb_is_nonlinear(skb)))
2080 +diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
2081 +index 0c71137c5d41b..43fd9cfa7b115 100644
2082 +--- a/net/ipv6/sit.c
2083 ++++ b/net/ipv6/sit.c
2084 +@@ -1858,7 +1858,6 @@ static int __net_init sit_init_net(struct net *net)
2085 + return 0;
2086 +
2087 + err_reg_dev:
2088 +- ipip6_dev_free(sitn->fb_tunnel_dev);
2089 + free_netdev(sitn->fb_tunnel_dev);
2090 + err_alloc_dev:
2091 + return err;
2092 +diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
2093 +index ed57db9b60861..060d3ed5c191a 100644
2094 +--- a/net/mac80211/agg-tx.c
2095 ++++ b/net/mac80211/agg-tx.c
2096 +@@ -109,7 +109,7 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
2097 + mgmt->u.action.u.addba_req.start_seq_num =
2098 + cpu_to_le16(start_seq_num << 4);
2099 +
2100 +- ieee80211_tx_skb(sdata, skb);
2101 ++ ieee80211_tx_skb_tid(sdata, skb, tid);
2102 + }
2103 +
2104 + void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn)
2105 +diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
2106 +index d1fd9f7c867ef..0563b4d34eaec 100644
2107 +--- a/net/netlink/af_netlink.c
2108 ++++ b/net/netlink/af_netlink.c
2109 +@@ -1822,6 +1822,11 @@ static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
2110 + if (msg->msg_flags&MSG_OOB)
2111 + return -EOPNOTSUPP;
2112 +
2113 ++ if (len == 0) {
2114 ++ pr_warn_once("Zero length message leads to an empty skb\n");
2115 ++ return -ENODATA;
2116 ++ }
2117 ++
2118 + err = scm_send(sock, msg, &scm, true);
2119 + if (err < 0)
2120 + return err;
2121 +diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c
2122 +index d7a2580f04206..ff5995624146a 100644
2123 +--- a/net/nfc/netlink.c
2124 ++++ b/net/nfc/netlink.c
2125 +@@ -666,8 +666,10 @@ static int nfc_genl_dump_devices_done(struct netlink_callback *cb)
2126 + {
2127 + struct class_dev_iter *iter = (struct class_dev_iter *) cb->args[0];
2128 +
2129 +- nfc_device_iter_exit(iter);
2130 +- kfree(iter);
2131 ++ if (iter) {
2132 ++ nfc_device_iter_exit(iter);
2133 ++ kfree(iter);
2134 ++ }
2135 +
2136 + return 0;
2137 + }
2138 +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
2139 +index 50ca70b3c1759..3177b9320c62d 100644
2140 +--- a/net/packet/af_packet.c
2141 ++++ b/net/packet/af_packet.c
2142 +@@ -4477,9 +4477,10 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
2143 + }
2144 +
2145 + out_free_pg_vec:
2146 +- bitmap_free(rx_owner_map);
2147 +- if (pg_vec)
2148 ++ if (pg_vec) {
2149 ++ bitmap_free(rx_owner_map);
2150 + free_pg_vec(pg_vec, order, req->tp_block_nr);
2151 ++ }
2152 + out:
2153 + return err;
2154 + }
2155 +diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
2156 +index cdf63eccad11e..ebc78cb3bc7dc 100755
2157 +--- a/scripts/recordmcount.pl
2158 ++++ b/scripts/recordmcount.pl
2159 +@@ -252,7 +252,7 @@ if ($arch eq "x86_64") {
2160 +
2161 + } elsif ($arch eq "s390" && $bits == 64) {
2162 + if ($cc =~ /-DCC_USING_HOTPATCH/) {
2163 +- $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*brcl\\s*0,[0-9a-f]+ <([^\+]*)>\$";
2164 ++ $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(bcrl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
2165 + $mcount_adjust = 0;
2166 + } else {
2167 + $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
2168 +diff --git a/tools/testing/selftests/bpf/test_verifier.c b/tools/testing/selftests/bpf/test_verifier.c
2169 +index d4f611546fc0b..0846345fe1e5c 100644
2170 +--- a/tools/testing/selftests/bpf/test_verifier.c
2171 ++++ b/tools/testing/selftests/bpf/test_verifier.c
2172 +@@ -4334,6 +4334,24 @@ static struct bpf_test tests[] = {
2173 + .result = ACCEPT,
2174 + .prog_type = BPF_PROG_TYPE_LWT_XMIT,
2175 + },
2176 ++ {
2177 ++ "make headroom for LWT_XMIT",
2178 ++ .insns = {
2179 ++ BPF_MOV64_REG(BPF_REG_6, BPF_REG_1),
2180 ++ BPF_MOV64_IMM(BPF_REG_2, 34),
2181 ++ BPF_MOV64_IMM(BPF_REG_3, 0),
2182 ++ BPF_EMIT_CALL(BPF_FUNC_skb_change_head),
2183 ++ /* split for s390 to succeed */
2184 ++ BPF_MOV64_REG(BPF_REG_1, BPF_REG_6),
2185 ++ BPF_MOV64_IMM(BPF_REG_2, 42),
2186 ++ BPF_MOV64_IMM(BPF_REG_3, 0),
2187 ++ BPF_EMIT_CALL(BPF_FUNC_skb_change_head),
2188 ++ BPF_MOV64_IMM(BPF_REG_0, 0),
2189 ++ BPF_EXIT_INSN(),
2190 ++ },
2191 ++ .result = ACCEPT,
2192 ++ .prog_type = BPF_PROG_TYPE_LWT_XMIT,
2193 ++ },
2194 + {
2195 + "invalid access of tc_classid for LWT_IN",
2196 + .insns = {