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, 03 Jun 2020 11:39:34
Message-Id: 1591184356.169675c206c9f9e6eab0c71380231685c694bd91.mpagano@gentoo
1 commit: 169675c206c9f9e6eab0c71380231685c694bd91
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 3 11:39:16 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 3 11:39:16 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=169675c2
7
8 Linux patch 4.14.183
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1182_linux-4.14.183.patch | 2396 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2400 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index b13e85f..c905009 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -771,6 +771,10 @@ Patch: 1181_linux-4.14.182.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.14.182
23
24 +Patch: 1182_linux-4.14.183.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.14.183
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/1182_linux-4.14.183.patch b/1182_linux-4.14.183.patch
33 new file mode 100644
34 index 0000000..18079db
35 --- /dev/null
36 +++ b/1182_linux-4.14.183.patch
37 @@ -0,0 +1,2396 @@
38 +diff --git a/Makefile b/Makefile
39 +index 591582e26a57..aa9d8c79bff0 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 = 182
47 ++SUBLEVEL = 183
48 + EXTRAVERSION =
49 + NAME = Petit Gorille
50 +
51 +diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
52 +index e5f2cca86f04..120776d45441 100644
53 +--- a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
54 ++++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
55 +@@ -25,7 +25,7 @@
56 +
57 + leds {
58 + act {
59 +- gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
60 ++ gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
61 + };
62 + };
63 +
64 +diff --git a/arch/arm/boot/dts/imx6q-b450v3.dts b/arch/arm/boot/dts/imx6q-b450v3.dts
65 +index 404a93d9596b..dc7d65da7d01 100644
66 +--- a/arch/arm/boot/dts/imx6q-b450v3.dts
67 ++++ b/arch/arm/boot/dts/imx6q-b450v3.dts
68 +@@ -65,13 +65,6 @@
69 + };
70 + };
71 +
72 +-&clks {
73 +- assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
74 +- <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
75 +- assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
76 +- <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
77 +-};
78 +-
79 + &ldb {
80 + status = "okay";
81 +
82 +diff --git a/arch/arm/boot/dts/imx6q-b650v3.dts b/arch/arm/boot/dts/imx6q-b650v3.dts
83 +index 7f9f176901d4..101d61f93070 100644
84 +--- a/arch/arm/boot/dts/imx6q-b650v3.dts
85 ++++ b/arch/arm/boot/dts/imx6q-b650v3.dts
86 +@@ -65,13 +65,6 @@
87 + };
88 + };
89 +
90 +-&clks {
91 +- assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
92 +- <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
93 +- assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
94 +- <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
95 +-};
96 +-
97 + &ldb {
98 + status = "okay";
99 +
100 +diff --git a/arch/arm/boot/dts/imx6q-b850v3.dts b/arch/arm/boot/dts/imx6q-b850v3.dts
101 +index 46bdc6722715..8fc831dc3156 100644
102 +--- a/arch/arm/boot/dts/imx6q-b850v3.dts
103 ++++ b/arch/arm/boot/dts/imx6q-b850v3.dts
104 +@@ -53,17 +53,6 @@
105 + };
106 + };
107 +
108 +-&clks {
109 +- assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
110 +- <&clks IMX6QDL_CLK_LDB_DI1_SEL>,
111 +- <&clks IMX6QDL_CLK_IPU1_DI0_PRE_SEL>,
112 +- <&clks IMX6QDL_CLK_IPU2_DI0_PRE_SEL>;
113 +- assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
114 +- <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
115 +- <&clks IMX6QDL_CLK_PLL2_PFD2_396M>,
116 +- <&clks IMX6QDL_CLK_PLL2_PFD2_396M>;
117 +-};
118 +-
119 + &ldb {
120 + fsl,dual-channel;
121 + status = "okay";
122 +diff --git a/arch/arm/boot/dts/imx6q-bx50v3.dtsi b/arch/arm/boot/dts/imx6q-bx50v3.dtsi
123 +index 1015e55ca8f7..f3c2c5587616 100644
124 +--- a/arch/arm/boot/dts/imx6q-bx50v3.dtsi
125 ++++ b/arch/arm/boot/dts/imx6q-bx50v3.dtsi
126 +@@ -92,6 +92,56 @@
127 + mux-int-port = <1>;
128 + mux-ext-port = <4>;
129 + };
130 ++
131 ++ aliases {
132 ++ mdio-gpio0 = &mdio0;
133 ++ };
134 ++
135 ++ mdio0: mdio-gpio {
136 ++ compatible = "virtual,mdio-gpio";
137 ++ gpios = <&gpio2 5 GPIO_ACTIVE_HIGH>, /* mdc */
138 ++ <&gpio2 7 GPIO_ACTIVE_HIGH>; /* mdio */
139 ++
140 ++ #address-cells = <1>;
141 ++ #size-cells = <0>;
142 ++
143 ++ switch@0 {
144 ++ compatible = "marvell,mv88e6085"; /* 88e6240*/
145 ++ #address-cells = <1>;
146 ++ #size-cells = <0>;
147 ++ reg = <0>;
148 ++
149 ++ switch_ports: ports {
150 ++ #address-cells = <1>;
151 ++ #size-cells = <0>;
152 ++ };
153 ++
154 ++ mdio {
155 ++ #address-cells = <1>;
156 ++ #size-cells = <0>;
157 ++
158 ++ switchphy0: switchphy@0 {
159 ++ reg = <0>;
160 ++ };
161 ++
162 ++ switchphy1: switchphy@1 {
163 ++ reg = <1>;
164 ++ };
165 ++
166 ++ switchphy2: switchphy@2 {
167 ++ reg = <2>;
168 ++ };
169 ++
170 ++ switchphy3: switchphy@3 {
171 ++ reg = <3>;
172 ++ };
173 ++
174 ++ switchphy4: switchphy@4 {
175 ++ reg = <4>;
176 ++ };
177 ++ };
178 ++ };
179 ++ };
180 + };
181 +
182 + &ecspi5 {
183 +@@ -326,3 +376,30 @@
184 + tcxo-clock-frequency = <26000000>;
185 + };
186 + };
187 ++
188 ++&pcie {
189 ++ /* Synopsys, Inc. Device */
190 ++ pci_root: root@0,0 {
191 ++ compatible = "pci16c3,abcd";
192 ++ reg = <0x00000000 0 0 0 0>;
193 ++
194 ++ #address-cells = <3>;
195 ++ #size-cells = <2>;
196 ++ #interrupt-cells = <1>;
197 ++ };
198 ++};
199 ++
200 ++&clks {
201 ++ assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
202 ++ <&clks IMX6QDL_CLK_LDB_DI1_SEL>,
203 ++ <&clks IMX6QDL_CLK_IPU1_DI0_PRE_SEL>,
204 ++ <&clks IMX6QDL_CLK_IPU1_DI1_PRE_SEL>,
205 ++ <&clks IMX6QDL_CLK_IPU2_DI0_PRE_SEL>,
206 ++ <&clks IMX6QDL_CLK_IPU2_DI1_PRE_SEL>;
207 ++ assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
208 ++ <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
209 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
210 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
211 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
212 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>;
213 ++};
214 +diff --git a/arch/arm/boot/dts/rk3228-evb.dts b/arch/arm/boot/dts/rk3228-evb.dts
215 +index 1be9daacc4f9..b69c842d8306 100644
216 +--- a/arch/arm/boot/dts/rk3228-evb.dts
217 ++++ b/arch/arm/boot/dts/rk3228-evb.dts
218 +@@ -84,7 +84,7 @@
219 + #address-cells = <1>;
220 + #size-cells = <0>;
221 +
222 +- phy: phy@0 {
223 ++ phy: ethernet-phy@0 {
224 + compatible = "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22";
225 + reg = <0>;
226 + clocks = <&cru SCLK_MAC_PHY>;
227 +diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi
228 +index f59f7cc62be6..0c60dbc4b46a 100644
229 +--- a/arch/arm/boot/dts/rk322x.dtsi
230 ++++ b/arch/arm/boot/dts/rk322x.dtsi
231 +@@ -950,7 +950,7 @@
232 + };
233 + };
234 +
235 +- spi-0 {
236 ++ spi0 {
237 + spi0_clk: spi0-clk {
238 + rockchip,pins = <0 9 RK_FUNC_2 &pcfg_pull_up>;
239 + };
240 +@@ -968,7 +968,7 @@
241 + };
242 + };
243 +
244 +- spi-1 {
245 ++ spi1 {
246 + spi1_clk: spi1-clk {
247 + rockchip,pins = <0 23 RK_FUNC_2 &pcfg_pull_up>;
248 + };
249 +diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
250 +index 88286dd483ff..1935b580f0e8 100644
251 +--- a/arch/arm/include/asm/assembler.h
252 ++++ b/arch/arm/include/asm/assembler.h
253 +@@ -21,11 +21,11 @@
254 + #endif
255 +
256 + #include <asm/ptrace.h>
257 +-#include <asm/domain.h>
258 + #include <asm/opcodes-virt.h>
259 + #include <asm/asm-offsets.h>
260 + #include <asm/page.h>
261 + #include <asm/thread_info.h>
262 ++#include <asm/uaccess-asm.h>
263 +
264 + #define IOMEM(x) (x)
265 +
266 +@@ -374,9 +374,9 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
267 + .macro usraccoff, instr, reg, ptr, inc, off, cond, abort, t=TUSER()
268 + 9999:
269 + .if \inc == 1
270 +- \instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
271 ++ \instr\()b\t\cond\().w \reg, [\ptr, #\off]
272 + .elseif \inc == 4
273 +- \instr\cond\()\t\().w \reg, [\ptr, #\off]
274 ++ \instr\t\cond\().w \reg, [\ptr, #\off]
275 + .else
276 + .error "Unsupported inc macro argument"
277 + .endif
278 +@@ -415,9 +415,9 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
279 + .rept \rept
280 + 9999:
281 + .if \inc == 1
282 +- \instr\cond\()b\()\t \reg, [\ptr], #\inc
283 ++ \instr\()b\t\cond \reg, [\ptr], #\inc
284 + .elseif \inc == 4
285 +- \instr\cond\()\t \reg, [\ptr], #\inc
286 ++ \instr\t\cond \reg, [\ptr], #\inc
287 + .else
288 + .error "Unsupported inc macro argument"
289 + .endif
290 +@@ -447,79 +447,6 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
291 + .size \name , . - \name
292 + .endm
293 +
294 +- .macro csdb
295 +-#ifdef CONFIG_THUMB2_KERNEL
296 +- .inst.w 0xf3af8014
297 +-#else
298 +- .inst 0xe320f014
299 +-#endif
300 +- .endm
301 +-
302 +- .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req
303 +-#ifndef CONFIG_CPU_USE_DOMAINS
304 +- adds \tmp, \addr, #\size - 1
305 +- sbcccs \tmp, \tmp, \limit
306 +- bcs \bad
307 +-#ifdef CONFIG_CPU_SPECTRE
308 +- movcs \addr, #0
309 +- csdb
310 +-#endif
311 +-#endif
312 +- .endm
313 +-
314 +- .macro uaccess_mask_range_ptr, addr:req, size:req, limit:req, tmp:req
315 +-#ifdef CONFIG_CPU_SPECTRE
316 +- sub \tmp, \limit, #1
317 +- subs \tmp, \tmp, \addr @ tmp = limit - 1 - addr
318 +- addhs \tmp, \tmp, #1 @ if (tmp >= 0) {
319 +- subhss \tmp, \tmp, \size @ tmp = limit - (addr + size) }
320 +- movlo \addr, #0 @ if (tmp < 0) addr = NULL
321 +- csdb
322 +-#endif
323 +- .endm
324 +-
325 +- .macro uaccess_disable, tmp, isb=1
326 +-#ifdef CONFIG_CPU_SW_DOMAIN_PAN
327 +- /*
328 +- * Whenever we re-enter userspace, the domains should always be
329 +- * set appropriately.
330 +- */
331 +- mov \tmp, #DACR_UACCESS_DISABLE
332 +- mcr p15, 0, \tmp, c3, c0, 0 @ Set domain register
333 +- .if \isb
334 +- instr_sync
335 +- .endif
336 +-#endif
337 +- .endm
338 +-
339 +- .macro uaccess_enable, tmp, isb=1
340 +-#ifdef CONFIG_CPU_SW_DOMAIN_PAN
341 +- /*
342 +- * Whenever we re-enter userspace, the domains should always be
343 +- * set appropriately.
344 +- */
345 +- mov \tmp, #DACR_UACCESS_ENABLE
346 +- mcr p15, 0, \tmp, c3, c0, 0
347 +- .if \isb
348 +- instr_sync
349 +- .endif
350 +-#endif
351 +- .endm
352 +-
353 +- .macro uaccess_save, tmp
354 +-#ifdef CONFIG_CPU_SW_DOMAIN_PAN
355 +- mrc p15, 0, \tmp, c3, c0, 0
356 +- str \tmp, [sp, #SVC_DACR]
357 +-#endif
358 +- .endm
359 +-
360 +- .macro uaccess_restore
361 +-#ifdef CONFIG_CPU_SW_DOMAIN_PAN
362 +- ldr r0, [sp, #SVC_DACR]
363 +- mcr p15, 0, r0, c3, c0, 0
364 +-#endif
365 +- .endm
366 +-
367 + .irp c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo
368 + .macro ret\c, reg
369 + #if __LINUX_ARM_ARCH__ < 6
370 +diff --git a/arch/arm/include/asm/uaccess-asm.h b/arch/arm/include/asm/uaccess-asm.h
371 +new file mode 100644
372 +index 000000000000..907571fd05c6
373 +--- /dev/null
374 ++++ b/arch/arm/include/asm/uaccess-asm.h
375 +@@ -0,0 +1,117 @@
376 ++/* SPDX-License-Identifier: GPL-2.0-only */
377 ++
378 ++#ifndef __ASM_UACCESS_ASM_H__
379 ++#define __ASM_UACCESS_ASM_H__
380 ++
381 ++#include <asm/asm-offsets.h>
382 ++#include <asm/domain.h>
383 ++#include <asm/memory.h>
384 ++#include <asm/thread_info.h>
385 ++
386 ++ .macro csdb
387 ++#ifdef CONFIG_THUMB2_KERNEL
388 ++ .inst.w 0xf3af8014
389 ++#else
390 ++ .inst 0xe320f014
391 ++#endif
392 ++ .endm
393 ++
394 ++ .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req
395 ++#ifndef CONFIG_CPU_USE_DOMAINS
396 ++ adds \tmp, \addr, #\size - 1
397 ++ sbcscc \tmp, \tmp, \limit
398 ++ bcs \bad
399 ++#ifdef CONFIG_CPU_SPECTRE
400 ++ movcs \addr, #0
401 ++ csdb
402 ++#endif
403 ++#endif
404 ++ .endm
405 ++
406 ++ .macro uaccess_mask_range_ptr, addr:req, size:req, limit:req, tmp:req
407 ++#ifdef CONFIG_CPU_SPECTRE
408 ++ sub \tmp, \limit, #1
409 ++ subs \tmp, \tmp, \addr @ tmp = limit - 1 - addr
410 ++ addhs \tmp, \tmp, #1 @ if (tmp >= 0) {
411 ++ subshs \tmp, \tmp, \size @ tmp = limit - (addr + size) }
412 ++ movlo \addr, #0 @ if (tmp < 0) addr = NULL
413 ++ csdb
414 ++#endif
415 ++ .endm
416 ++
417 ++ .macro uaccess_disable, tmp, isb=1
418 ++#ifdef CONFIG_CPU_SW_DOMAIN_PAN
419 ++ /*
420 ++ * Whenever we re-enter userspace, the domains should always be
421 ++ * set appropriately.
422 ++ */
423 ++ mov \tmp, #DACR_UACCESS_DISABLE
424 ++ mcr p15, 0, \tmp, c3, c0, 0 @ Set domain register
425 ++ .if \isb
426 ++ instr_sync
427 ++ .endif
428 ++#endif
429 ++ .endm
430 ++
431 ++ .macro uaccess_enable, tmp, isb=1
432 ++#ifdef CONFIG_CPU_SW_DOMAIN_PAN
433 ++ /*
434 ++ * Whenever we re-enter userspace, the domains should always be
435 ++ * set appropriately.
436 ++ */
437 ++ mov \tmp, #DACR_UACCESS_ENABLE
438 ++ mcr p15, 0, \tmp, c3, c0, 0
439 ++ .if \isb
440 ++ instr_sync
441 ++ .endif
442 ++#endif
443 ++ .endm
444 ++
445 ++#if defined(CONFIG_CPU_SW_DOMAIN_PAN) || defined(CONFIG_CPU_USE_DOMAINS)
446 ++#define DACR(x...) x
447 ++#else
448 ++#define DACR(x...)
449 ++#endif
450 ++
451 ++ /*
452 ++ * Save the address limit on entry to a privileged exception.
453 ++ *
454 ++ * If we are using the DACR for kernel access by the user accessors
455 ++ * (CONFIG_CPU_USE_DOMAINS=y), always reset the DACR kernel domain
456 ++ * back to client mode, whether or not \disable is set.
457 ++ *
458 ++ * If we are using SW PAN, set the DACR user domain to no access
459 ++ * if \disable is set.
460 ++ */
461 ++ .macro uaccess_entry, tsk, tmp0, tmp1, tmp2, disable
462 ++ ldr \tmp1, [\tsk, #TI_ADDR_LIMIT]
463 ++ mov \tmp2, #TASK_SIZE
464 ++ str \tmp2, [\tsk, #TI_ADDR_LIMIT]
465 ++ DACR( mrc p15, 0, \tmp0, c3, c0, 0)
466 ++ DACR( str \tmp0, [sp, #SVC_DACR])
467 ++ str \tmp1, [sp, #SVC_ADDR_LIMIT]
468 ++ .if \disable && IS_ENABLED(CONFIG_CPU_SW_DOMAIN_PAN)
469 ++ /* kernel=client, user=no access */
470 ++ mov \tmp2, #DACR_UACCESS_DISABLE
471 ++ mcr p15, 0, \tmp2, c3, c0, 0
472 ++ instr_sync
473 ++ .elseif IS_ENABLED(CONFIG_CPU_USE_DOMAINS)
474 ++ /* kernel=client */
475 ++ bic \tmp2, \tmp0, #domain_mask(DOMAIN_KERNEL)
476 ++ orr \tmp2, \tmp2, #domain_val(DOMAIN_KERNEL, DOMAIN_CLIENT)
477 ++ mcr p15, 0, \tmp2, c3, c0, 0
478 ++ instr_sync
479 ++ .endif
480 ++ .endm
481 ++
482 ++ /* Restore the user access state previously saved by uaccess_entry */
483 ++ .macro uaccess_exit, tsk, tmp0, tmp1
484 ++ ldr \tmp1, [sp, #SVC_ADDR_LIMIT]
485 ++ DACR( ldr \tmp0, [sp, #SVC_DACR])
486 ++ str \tmp1, [\tsk, #TI_ADDR_LIMIT]
487 ++ DACR( mcr p15, 0, \tmp0, c3, c0, 0)
488 ++ .endm
489 ++
490 ++#undef DACR
491 ++
492 ++#endif /* __ASM_UACCESS_ASM_H__ */
493 +diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
494 +index ef5dfedacd8d..628c336e8e3b 100644
495 +--- a/arch/arm/include/asm/vfpmacros.h
496 ++++ b/arch/arm/include/asm/vfpmacros.h
497 +@@ -29,13 +29,13 @@
498 + ldr \tmp, =elf_hwcap @ may not have MVFR regs
499 + ldr \tmp, [\tmp, #0]
500 + tst \tmp, #HWCAP_VFPD32
501 +- ldcnel p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
502 ++ ldclne p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
503 + addeq \base, \base, #32*4 @ step over unused register space
504 + #else
505 + VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
506 + and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
507 + cmp \tmp, #2 @ 32 x 64bit registers?
508 +- ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
509 ++ ldcleq p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
510 + addne \base, \base, #32*4 @ step over unused register space
511 + #endif
512 + #endif
513 +@@ -53,13 +53,13 @@
514 + ldr \tmp, =elf_hwcap @ may not have MVFR regs
515 + ldr \tmp, [\tmp, #0]
516 + tst \tmp, #HWCAP_VFPD32
517 +- stcnel p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
518 ++ stclne p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
519 + addeq \base, \base, #32*4 @ step over unused register space
520 + #else
521 + VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
522 + and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
523 + cmp \tmp, #2 @ 32 x 64bit registers?
524 +- stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
525 ++ stcleq p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
526 + addne \base, \base, #32*4 @ step over unused register space
527 + #endif
528 + #endif
529 +diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
530 +index fbc707626b3e..f3de76f7ad43 100644
531 +--- a/arch/arm/kernel/entry-armv.S
532 ++++ b/arch/arm/kernel/entry-armv.S
533 +@@ -30,6 +30,7 @@
534 + #include <asm/unistd.h>
535 + #include <asm/tls.h>
536 + #include <asm/system_info.h>
537 ++#include <asm/uaccess-asm.h>
538 +
539 + #include "entry-header.S"
540 + #include <asm/entry-macro-multi.S>
541 +@@ -186,15 +187,7 @@ ENDPROC(__und_invalid)
542 + stmia r7, {r2 - r6}
543 +
544 + get_thread_info tsk
545 +- ldr r0, [tsk, #TI_ADDR_LIMIT]
546 +- mov r1, #TASK_SIZE
547 +- str r1, [tsk, #TI_ADDR_LIMIT]
548 +- str r0, [sp, #SVC_ADDR_LIMIT]
549 +-
550 +- uaccess_save r0
551 +- .if \uaccess
552 +- uaccess_disable r0
553 +- .endif
554 ++ uaccess_entry tsk, r0, r1, r2, \uaccess
555 +
556 + .if \trace
557 + #ifdef CONFIG_TRACE_IRQFLAGS
558 +diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
559 +index 62db1c9746cb..7b595f2d4a28 100644
560 +--- a/arch/arm/kernel/entry-header.S
561 ++++ b/arch/arm/kernel/entry-header.S
562 +@@ -6,6 +6,7 @@
563 + #include <asm/asm-offsets.h>
564 + #include <asm/errno.h>
565 + #include <asm/thread_info.h>
566 ++#include <asm/uaccess-asm.h>
567 + #include <asm/v7m.h>
568 +
569 + @ Bad Abort numbers
570 +@@ -217,9 +218,7 @@
571 + blne trace_hardirqs_off
572 + #endif
573 + .endif
574 +- ldr r1, [sp, #SVC_ADDR_LIMIT]
575 +- uaccess_restore
576 +- str r1, [tsk, #TI_ADDR_LIMIT]
577 ++ uaccess_exit tsk, r0, r1
578 +
579 + #ifndef CONFIG_THUMB2_KERNEL
580 + @ ARM mode SVC restore
581 +@@ -263,9 +262,7 @@
582 + @ on the stack remains correct).
583 + @
584 + .macro svc_exit_via_fiq
585 +- ldr r1, [sp, #SVC_ADDR_LIMIT]
586 +- uaccess_restore
587 +- str r1, [tsk, #TI_ADDR_LIMIT]
588 ++ uaccess_exit tsk, r0, r1
589 + #ifndef CONFIG_THUMB2_KERNEL
590 + @ ARM mode restore
591 + mov r0, sp
592 +diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
593 +index 93cddab73072..95bd35991288 100644
594 +--- a/arch/arm/lib/bitops.h
595 ++++ b/arch/arm/lib/bitops.h
596 +@@ -7,7 +7,7 @@
597 + ENTRY( \name )
598 + UNWIND( .fnstart )
599 + ands ip, r1, #3
600 +- strneb r1, [ip] @ assert word-aligned
601 ++ strbne r1, [ip] @ assert word-aligned
602 + mov r2, #1
603 + and r3, r0, #31 @ Get bit offset
604 + mov r0, r0, lsr #5
605 +@@ -32,7 +32,7 @@ ENDPROC(\name )
606 + ENTRY( \name )
607 + UNWIND( .fnstart )
608 + ands ip, r1, #3
609 +- strneb r1, [ip] @ assert word-aligned
610 ++ strbne r1, [ip] @ assert word-aligned
611 + mov r2, #1
612 + and r3, r0, #31 @ Get bit offset
613 + mov r0, r0, lsr #5
614 +@@ -62,7 +62,7 @@ ENDPROC(\name )
615 + ENTRY( \name )
616 + UNWIND( .fnstart )
617 + ands ip, r1, #3
618 +- strneb r1, [ip] @ assert word-aligned
619 ++ strbne r1, [ip] @ assert word-aligned
620 + and r2, r0, #31
621 + mov r0, r0, lsr #5
622 + mov r3, #1
623 +@@ -89,7 +89,7 @@ ENDPROC(\name )
624 + ENTRY( \name )
625 + UNWIND( .fnstart )
626 + ands ip, r1, #3
627 +- strneb r1, [ip] @ assert word-aligned
628 ++ strbne r1, [ip] @ assert word-aligned
629 + and r3, r0, #31
630 + mov r0, r0, lsr #5
631 + save_and_disable_irqs ip
632 +diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
633 +index ff8df7fd44a7..b63d9653ff55 100644
634 +--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
635 ++++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
636 +@@ -1691,10 +1691,10 @@
637 + gpu: gpu@ff9a0000 {
638 + compatible = "rockchip,rk3399-mali", "arm,mali-t860";
639 + reg = <0x0 0xff9a0000 0x0 0x10000>;
640 +- interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH 0>,
641 +- <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH 0>,
642 +- <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH 0>;
643 +- interrupt-names = "gpu", "job", "mmu";
644 ++ interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH 0>,
645 ++ <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH 0>,
646 ++ <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH 0>;
647 ++ interrupt-names = "job", "mmu", "gpu";
648 + clocks = <&cru ACLK_GPU>;
649 + power-domains = <&power RK3399_PD_GPU>;
650 + status = "disabled";
651 +diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
652 +index cc700f7dda54..8be075f81ce6 100644
653 +--- a/arch/parisc/mm/init.c
654 ++++ b/arch/parisc/mm/init.c
655 +@@ -608,7 +608,7 @@ void __init mem_init(void)
656 + > BITS_PER_LONG);
657 +
658 + high_memory = __va((max_pfn << PAGE_SHIFT));
659 +- set_max_mapnr(page_to_pfn(virt_to_page(high_memory - 1)) + 1);
660 ++ set_max_mapnr(max_low_pfn);
661 + free_all_bootmem();
662 +
663 + #ifdef CONFIG_PA11
664 +diff --git a/arch/x86/include/asm/dma.h b/arch/x86/include/asm/dma.h
665 +index 00f7cf45e699..8e95aa4b0d17 100644
666 +--- a/arch/x86/include/asm/dma.h
667 ++++ b/arch/x86/include/asm/dma.h
668 +@@ -74,7 +74,7 @@
669 + #define MAX_DMA_PFN ((16UL * 1024 * 1024) >> PAGE_SHIFT)
670 +
671 + /* 4GB broken PCI/AGP hardware bus master zone */
672 +-#define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT)
673 ++#define MAX_DMA32_PFN (1UL << (32 - PAGE_SHIFT))
674 +
675 + #ifdef CONFIG_X86_32
676 + /* The maximum address that we can perform a DMA transfer to on this platform */
677 +diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
678 +index 87a57b7642d3..61c2fb8b1f8e 100644
679 +--- a/arch/x86/kernel/fpu/xstate.c
680 ++++ b/arch/x86/kernel/fpu/xstate.c
681 +@@ -964,18 +964,31 @@ static inline bool xfeatures_mxcsr_quirk(u64 xfeatures)
682 + return true;
683 + }
684 +
685 +-/*
686 +- * This is similar to user_regset_copyout(), but will not add offset to
687 +- * the source data pointer or increment pos, count, kbuf, and ubuf.
688 +- */
689 +-static inline void
690 +-__copy_xstate_to_kernel(void *kbuf, const void *data,
691 +- unsigned int offset, unsigned int size, unsigned int size_total)
692 ++static void fill_gap(unsigned to, void **kbuf, unsigned *pos, unsigned *count)
693 + {
694 +- if (offset < size_total) {
695 +- unsigned int copy = min(size, size_total - offset);
696 ++ if (*pos < to) {
697 ++ unsigned size = to - *pos;
698 ++
699 ++ if (size > *count)
700 ++ size = *count;
701 ++ memcpy(*kbuf, (void *)&init_fpstate.xsave + *pos, size);
702 ++ *kbuf += size;
703 ++ *pos += size;
704 ++ *count -= size;
705 ++ }
706 ++}
707 +
708 +- memcpy(kbuf + offset, data, copy);
709 ++static void copy_part(unsigned offset, unsigned size, void *from,
710 ++ void **kbuf, unsigned *pos, unsigned *count)
711 ++{
712 ++ fill_gap(offset, kbuf, pos, count);
713 ++ if (size > *count)
714 ++ size = *count;
715 ++ if (size) {
716 ++ memcpy(*kbuf, from, size);
717 ++ *kbuf += size;
718 ++ *pos += size;
719 ++ *count -= size;
720 + }
721 + }
722 +
723 +@@ -988,8 +1001,9 @@ __copy_xstate_to_kernel(void *kbuf, const void *data,
724 + */
725 + int copy_xstate_to_kernel(void *kbuf, struct xregs_state *xsave, unsigned int offset_start, unsigned int size_total)
726 + {
727 +- unsigned int offset, size;
728 + struct xstate_header header;
729 ++ const unsigned off_mxcsr = offsetof(struct fxregs_state, mxcsr);
730 ++ unsigned count = size_total;
731 + int i;
732 +
733 + /*
734 +@@ -1005,46 +1019,42 @@ int copy_xstate_to_kernel(void *kbuf, struct xregs_state *xsave, unsigned int of
735 + header.xfeatures = xsave->header.xfeatures;
736 + header.xfeatures &= ~XFEATURE_MASK_SUPERVISOR;
737 +
738 ++ if (header.xfeatures & XFEATURE_MASK_FP)
739 ++ copy_part(0, off_mxcsr,
740 ++ &xsave->i387, &kbuf, &offset_start, &count);
741 ++ if (header.xfeatures & (XFEATURE_MASK_SSE | XFEATURE_MASK_YMM))
742 ++ copy_part(off_mxcsr, MXCSR_AND_FLAGS_SIZE,
743 ++ &xsave->i387.mxcsr, &kbuf, &offset_start, &count);
744 ++ if (header.xfeatures & XFEATURE_MASK_FP)
745 ++ copy_part(offsetof(struct fxregs_state, st_space), 128,
746 ++ &xsave->i387.st_space, &kbuf, &offset_start, &count);
747 ++ if (header.xfeatures & XFEATURE_MASK_SSE)
748 ++ copy_part(xstate_offsets[XFEATURE_MASK_SSE], 256,
749 ++ &xsave->i387.xmm_space, &kbuf, &offset_start, &count);
750 ++ /*
751 ++ * Fill xsave->i387.sw_reserved value for ptrace frame:
752 ++ */
753 ++ copy_part(offsetof(struct fxregs_state, sw_reserved), 48,
754 ++ xstate_fx_sw_bytes, &kbuf, &offset_start, &count);
755 + /*
756 + * Copy xregs_state->header:
757 + */
758 +- offset = offsetof(struct xregs_state, header);
759 +- size = sizeof(header);
760 +-
761 +- __copy_xstate_to_kernel(kbuf, &header, offset, size, size_total);
762 ++ copy_part(offsetof(struct xregs_state, header), sizeof(header),
763 ++ &header, &kbuf, &offset_start, &count);
764 +
765 +- for (i = 0; i < XFEATURE_MAX; i++) {
766 ++ for (i = FIRST_EXTENDED_XFEATURE; i < XFEATURE_MAX; i++) {
767 + /*
768 + * Copy only in-use xstates:
769 + */
770 + if ((header.xfeatures >> i) & 1) {
771 + void *src = __raw_xsave_addr(xsave, 1 << i);
772 +
773 +- offset = xstate_offsets[i];
774 +- size = xstate_sizes[i];
775 +-
776 +- /* The next component has to fit fully into the output buffer: */
777 +- if (offset + size > size_total)
778 +- break;
779 +-
780 +- __copy_xstate_to_kernel(kbuf, src, offset, size, size_total);
781 ++ copy_part(xstate_offsets[i], xstate_sizes[i],
782 ++ src, &kbuf, &offset_start, &count);
783 + }
784 +
785 + }
786 +-
787 +- if (xfeatures_mxcsr_quirk(header.xfeatures)) {
788 +- offset = offsetof(struct fxregs_state, mxcsr);
789 +- size = MXCSR_AND_FLAGS_SIZE;
790 +- __copy_xstate_to_kernel(kbuf, &xsave->i387.mxcsr, offset, size, size_total);
791 +- }
792 +-
793 +- /*
794 +- * Fill xsave->i387.sw_reserved value for ptrace frame:
795 +- */
796 +- offset = offsetof(struct fxregs_state, sw_reserved);
797 +- size = sizeof(xstate_fx_sw_bytes);
798 +-
799 +- __copy_xstate_to_kernel(kbuf, xstate_fx_sw_bytes, offset, size, size_total);
800 ++ fill_gap(size_total, &kbuf, &offset_start, &count);
801 +
802 + return 0;
803 + }
804 +diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c
805 +index c139dedec12b..133b9b25e7c5 100644
806 +--- a/arch/x86/kvm/vmx.c
807 ++++ b/arch/x86/kvm/vmx.c
808 +@@ -9280,15 +9280,16 @@ static void vmx_set_virtual_apic_mode(struct kvm_vcpu *vcpu)
809 + if (!lapic_in_kernel(vcpu))
810 + return;
811 +
812 ++ if (!flexpriority_enabled &&
813 ++ !cpu_has_vmx_virtualize_x2apic_mode())
814 ++ return;
815 ++
816 + /* Postpone execution until vmcs01 is the current VMCS. */
817 + if (is_guest_mode(vcpu)) {
818 + to_vmx(vcpu)->nested.change_vmcs01_virtual_apic_mode = true;
819 + return;
820 + }
821 +
822 +- if (!cpu_need_tpr_shadow(vcpu))
823 +- return;
824 +-
825 + sec_exec_control = vmcs_read32(SECONDARY_VM_EXEC_CONTROL);
826 + sec_exec_control &= ~(SECONDARY_EXEC_VIRTUALIZE_APIC_ACCESSES |
827 + SECONDARY_EXEC_VIRTUALIZE_X2APIC_MODE);
828 +diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
829 +index a09d2f9ebacc..695c19901eff 100644
830 +--- a/drivers/gpio/gpio-exar.c
831 ++++ b/drivers/gpio/gpio-exar.c
832 +@@ -148,8 +148,10 @@ static int gpio_exar_probe(struct platform_device *pdev)
833 + mutex_init(&exar_gpio->lock);
834 +
835 + index = ida_simple_get(&ida_index, 0, 0, GFP_KERNEL);
836 +- if (index < 0)
837 +- goto err_destroy;
838 ++ if (index < 0) {
839 ++ ret = index;
840 ++ goto err_mutex_destroy;
841 ++ }
842 +
843 + sprintf(exar_gpio->name, "exar_gpio%d", index);
844 + exar_gpio->gpio_chip.label = exar_gpio->name;
845 +@@ -176,6 +178,7 @@ static int gpio_exar_probe(struct platform_device *pdev)
846 +
847 + err_destroy:
848 + ida_simple_remove(&ida_index, index);
849 ++err_mutex_destroy:
850 + mutex_destroy(&exar_gpio->lock);
851 + return ret;
852 + }
853 +diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
854 +index 1eb857e2f62f..dd801f5d5253 100644
855 +--- a/drivers/gpio/gpio-tegra.c
856 ++++ b/drivers/gpio/gpio-tegra.c
857 +@@ -356,6 +356,7 @@ static void tegra_gpio_irq_shutdown(struct irq_data *d)
858 + struct tegra_gpio_info *tgi = bank->tgi;
859 + unsigned int gpio = d->hwirq;
860 +
861 ++ tegra_gpio_irq_mask(d);
862 + gpiochip_unlock_as_irq(&tgi->gc, gpio);
863 + }
864 +
865 +diff --git a/drivers/infiniband/hw/qib/qib_sysfs.c b/drivers/infiniband/hw/qib/qib_sysfs.c
866 +index d831f3e61ae8..2626205780ee 100644
867 +--- a/drivers/infiniband/hw/qib/qib_sysfs.c
868 ++++ b/drivers/infiniband/hw/qib/qib_sysfs.c
869 +@@ -756,7 +756,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
870 + qib_dev_err(dd,
871 + "Skipping linkcontrol sysfs info, (err %d) port %u\n",
872 + ret, port_num);
873 +- goto bail;
874 ++ goto bail_link;
875 + }
876 + kobject_uevent(&ppd->pport_kobj, KOBJ_ADD);
877 +
878 +@@ -766,7 +766,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
879 + qib_dev_err(dd,
880 + "Skipping sl2vl sysfs info, (err %d) port %u\n",
881 + ret, port_num);
882 +- goto bail_link;
883 ++ goto bail_sl;
884 + }
885 + kobject_uevent(&ppd->sl2vl_kobj, KOBJ_ADD);
886 +
887 +@@ -776,7 +776,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
888 + qib_dev_err(dd,
889 + "Skipping diag_counters sysfs info, (err %d) port %u\n",
890 + ret, port_num);
891 +- goto bail_sl;
892 ++ goto bail_diagc;
893 + }
894 + kobject_uevent(&ppd->diagc_kobj, KOBJ_ADD);
895 +
896 +@@ -789,7 +789,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
897 + qib_dev_err(dd,
898 + "Skipping Congestion Control sysfs info, (err %d) port %u\n",
899 + ret, port_num);
900 +- goto bail_diagc;
901 ++ goto bail_cc;
902 + }
903 +
904 + kobject_uevent(&ppd->pport_cc_kobj, KOBJ_ADD);
905 +@@ -871,6 +871,7 @@ void qib_verbs_unregister_sysfs(struct qib_devdata *dd)
906 + &cc_table_bin_attr);
907 + kobject_put(&ppd->pport_cc_kobj);
908 + }
909 ++ kobject_put(&ppd->diagc_kobj);
910 + kobject_put(&ppd->sl2vl_kobj);
911 + kobject_put(&ppd->pport_kobj);
912 + }
913 +diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
914 +index d549c9ffadcb..867303235f57 100644
915 +--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
916 ++++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
917 +@@ -774,7 +774,7 @@ static int pvrdma_pci_probe(struct pci_dev *pdev,
918 + !(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
919 + dev_err(&pdev->dev, "PCI BAR region not MMIO\n");
920 + ret = -ENOMEM;
921 +- goto err_free_device;
922 ++ goto err_disable_pdev;
923 + }
924 +
925 + ret = pci_request_regions(pdev, DRV_NAME);
926 +diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
927 +index 925571475005..2463d02e3f99 100644
928 +--- a/drivers/input/evdev.c
929 ++++ b/drivers/input/evdev.c
930 +@@ -342,20 +342,6 @@ static int evdev_fasync(int fd, struct file *file, int on)
931 + return fasync_helper(fd, file, on, &client->fasync);
932 + }
933 +
934 +-static int evdev_flush(struct file *file, fl_owner_t id)
935 +-{
936 +- struct evdev_client *client = file->private_data;
937 +- struct evdev *evdev = client->evdev;
938 +-
939 +- mutex_lock(&evdev->mutex);
940 +-
941 +- if (evdev->exist && !client->revoked)
942 +- input_flush_device(&evdev->handle, file);
943 +-
944 +- mutex_unlock(&evdev->mutex);
945 +- return 0;
946 +-}
947 +-
948 + static void evdev_free(struct device *dev)
949 + {
950 + struct evdev *evdev = container_of(dev, struct evdev, dev);
951 +@@ -469,6 +455,10 @@ static int evdev_release(struct inode *inode, struct file *file)
952 + unsigned int i;
953 +
954 + mutex_lock(&evdev->mutex);
955 ++
956 ++ if (evdev->exist && !client->revoked)
957 ++ input_flush_device(&evdev->handle, file);
958 ++
959 + evdev_ungrab(evdev, client);
960 + mutex_unlock(&evdev->mutex);
961 +
962 +@@ -1331,7 +1321,6 @@ static const struct file_operations evdev_fops = {
963 + .compat_ioctl = evdev_ioctl_compat,
964 + #endif
965 + .fasync = evdev_fasync,
966 +- .flush = evdev_flush,
967 + .llseek = no_llseek,
968 + };
969 +
970 +diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
971 +index 26476a64e663..54a6691d7d87 100644
972 +--- a/drivers/input/joystick/xpad.c
973 ++++ b/drivers/input/joystick/xpad.c
974 +@@ -475,6 +475,16 @@ static const u8 xboxone_fw2015_init[] = {
975 + 0x05, 0x20, 0x00, 0x01, 0x00
976 + };
977 +
978 ++/*
979 ++ * This packet is required for Xbox One S (0x045e:0x02ea)
980 ++ * and Xbox One Elite Series 2 (0x045e:0x0b00) pads to
981 ++ * initialize the controller that was previously used in
982 ++ * Bluetooth mode.
983 ++ */
984 ++static const u8 xboxone_s_init[] = {
985 ++ 0x05, 0x20, 0x00, 0x0f, 0x06
986 ++};
987 ++
988 + /*
989 + * This packet is required for the Titanfall 2 Xbox One pads
990 + * (0x0e6f:0x0165) to finish initialization and for Hori pads
991 +@@ -533,6 +543,8 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
992 + XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init),
993 + XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init),
994 + XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init),
995 ++ XBOXONE_INIT_PKT(0x045e, 0x02ea, xboxone_s_init),
996 ++ XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init),
997 + XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1),
998 + XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2),
999 + XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
1000 +diff --git a/drivers/input/keyboard/dlink-dir685-touchkeys.c b/drivers/input/keyboard/dlink-dir685-touchkeys.c
1001 +index 88e321b76397..6fe4062e3ac2 100644
1002 +--- a/drivers/input/keyboard/dlink-dir685-touchkeys.c
1003 ++++ b/drivers/input/keyboard/dlink-dir685-touchkeys.c
1004 +@@ -142,7 +142,7 @@ MODULE_DEVICE_TABLE(of, dir685_tk_of_match);
1005 +
1006 + static struct i2c_driver dir685_tk_i2c_driver = {
1007 + .driver = {
1008 +- .name = "dlin-dir685-touchkeys",
1009 ++ .name = "dlink-dir685-touchkeys",
1010 + .of_match_table = of_match_ptr(dir685_tk_of_match),
1011 + },
1012 + .probe = dir685_tk_probe,
1013 +diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
1014 +index 997ccae7ee05..30a8d816c45c 100644
1015 +--- a/drivers/input/rmi4/rmi_driver.c
1016 ++++ b/drivers/input/rmi4/rmi_driver.c
1017 +@@ -232,7 +232,7 @@ static irqreturn_t rmi_irq_fn(int irq, void *dev_id)
1018 +
1019 + if (count) {
1020 + kfree(attn_data.data);
1021 +- attn_data.data = NULL;
1022 ++ drvdata->attn_data.data = NULL;
1023 + }
1024 +
1025 + if (!kfifo_is_empty(&drvdata->attn_fifo))
1026 +@@ -1220,7 +1220,8 @@ static int rmi_driver_probe(struct device *dev)
1027 + if (data->input) {
1028 + rmi_driver_set_input_name(rmi_dev, data->input);
1029 + if (!rmi_dev->xport->input) {
1030 +- if (input_register_device(data->input)) {
1031 ++ retval = input_register_device(data->input);
1032 ++ if (retval) {
1033 + dev_err(dev, "%s: Failed to register input device.\n",
1034 + __func__);
1035 + goto err_destroy_functions;
1036 +diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
1037 +index 0d0f977a2f39..c4201d1da239 100644
1038 +--- a/drivers/input/serio/i8042-x86ia64io.h
1039 ++++ b/drivers/input/serio/i8042-x86ia64io.h
1040 +@@ -666,6 +666,13 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
1041 + DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
1042 + },
1043 + },
1044 ++ {
1045 ++ /* Lenovo ThinkPad Twist S230u */
1046 ++ .matches = {
1047 ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1048 ++ DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
1049 ++ },
1050 ++ },
1051 + { }
1052 + };
1053 +
1054 +diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
1055 +index 2c41107240de..499402a975b3 100644
1056 +--- a/drivers/input/touchscreen/usbtouchscreen.c
1057 ++++ b/drivers/input/touchscreen/usbtouchscreen.c
1058 +@@ -197,6 +197,7 @@ static const struct usb_device_id usbtouch_devices[] = {
1059 + #endif
1060 +
1061 + #ifdef CONFIG_TOUCHSCREEN_USB_IRTOUCH
1062 ++ {USB_DEVICE(0x255e, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
1063 + {USB_DEVICE(0x595a, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
1064 + {USB_DEVICE(0x6615, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
1065 + {USB_DEVICE(0x6615, 0x0012), .driver_info = DEVTYPE_IRTOUCH_HIRES},
1066 +diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
1067 +index 2c48a9d6d91e..e0a6ae6a5796 100644
1068 +--- a/drivers/iommu/iommu.c
1069 ++++ b/drivers/iommu/iommu.c
1070 +@@ -359,7 +359,7 @@ struct iommu_group *iommu_group_alloc(void)
1071 + NULL, "%d", group->id);
1072 + if (ret) {
1073 + ida_simple_remove(&iommu_group_ida, group->id);
1074 +- kfree(group);
1075 ++ kobject_put(&group->kobj);
1076 + return ERR_PTR(ret);
1077 + }
1078 +
1079 +diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
1080 +index 916b88ee2de4..cbb72b460755 100644
1081 +--- a/drivers/mmc/core/block.c
1082 ++++ b/drivers/mmc/core/block.c
1083 +@@ -2333,8 +2333,8 @@ static int mmc_rpmb_chrdev_release(struct inode *inode, struct file *filp)
1084 + struct mmc_rpmb_data *rpmb = container_of(inode->i_cdev,
1085 + struct mmc_rpmb_data, chrdev);
1086 +
1087 +- put_device(&rpmb->dev);
1088 + mmc_blk_put(rpmb->md);
1089 ++ put_device(&rpmb->dev);
1090 +
1091 + return 0;
1092 + }
1093 +diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c
1094 +index 641a532b67cb..3f756fa2f603 100644
1095 +--- a/drivers/net/bonding/bond_sysfs_slave.c
1096 ++++ b/drivers/net/bonding/bond_sysfs_slave.c
1097 +@@ -153,8 +153,10 @@ int bond_sysfs_slave_add(struct slave *slave)
1098 +
1099 + err = kobject_init_and_add(&slave->kobj, &slave_ktype,
1100 + &(slave->dev->dev.kobj), "bonding_slave");
1101 +- if (err)
1102 ++ if (err) {
1103 ++ kobject_put(&slave->kobj);
1104 + return err;
1105 ++ }
1106 +
1107 + for (a = slave_attrs; *a; ++a) {
1108 + err = sysfs_create_file(&slave->kobj, &((*a)->attr));
1109 +diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
1110 +index 6e490fd2345d..71f0640200bc 100644
1111 +--- a/drivers/net/ethernet/freescale/Kconfig
1112 ++++ b/drivers/net/ethernet/freescale/Kconfig
1113 +@@ -76,6 +76,7 @@ config UCC_GETH
1114 + depends on QUICC_ENGINE
1115 + select FSL_PQ_MDIO
1116 + select PHYLIB
1117 ++ select FIXED_PHY
1118 + ---help---
1119 + This driver supports the Gigabit Ethernet mode of the QUICC Engine,
1120 + which is available on some Freescale SOCs.
1121 +@@ -89,6 +90,7 @@ config GIANFAR
1122 + depends on HAS_DMA
1123 + select FSL_PQ_MDIO
1124 + select PHYLIB
1125 ++ select FIXED_PHY
1126 + select CRC32
1127 + ---help---
1128 + This driver supports the Gigabit TSEC on the MPC83xx, MPC85xx,
1129 +diff --git a/drivers/net/ethernet/freescale/dpaa/Kconfig b/drivers/net/ethernet/freescale/dpaa/Kconfig
1130 +index a654736237a9..8fec41e57178 100644
1131 +--- a/drivers/net/ethernet/freescale/dpaa/Kconfig
1132 ++++ b/drivers/net/ethernet/freescale/dpaa/Kconfig
1133 +@@ -2,6 +2,7 @@ menuconfig FSL_DPAA_ETH
1134 + tristate "DPAA Ethernet"
1135 + depends on FSL_DPAA && FSL_FMAN
1136 + select PHYLIB
1137 ++ select FIXED_PHY
1138 + select FSL_FMAN_MAC
1139 + ---help---
1140 + Data Path Acceleration Architecture Ethernet driver,
1141 +diff --git a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
1142 +index 7d0f3cd8a002..9e1e2d5b80dc 100644
1143 +--- a/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
1144 ++++ b/drivers/net/ethernet/hisilicon/hns/hns_dsaf_main.c
1145 +@@ -2770,7 +2770,7 @@ static void set_promisc_tcam_enable(struct dsaf_device *dsaf_dev, u32 port)
1146 + struct hns_mac_cb *mac_cb;
1147 + u8 addr[ETH_ALEN] = {0};
1148 + u8 port_num;
1149 +- u16 mskid;
1150 ++ int mskid;
1151 +
1152 + /* promisc use vague table match with vlanid = 0 & macaddr = 0 */
1153 + hns_dsaf_set_mac_key(dsaf_dev, &mac_key, 0x00, port, addr);
1154 +@@ -3142,6 +3142,9 @@ int hns_dsaf_roce_reset(struct fwnode_handle *dsaf_fwnode, bool dereset)
1155 + dsaf_set_bit(credit, DSAF_SBM_ROCEE_CFG_CRD_EN_B, 1);
1156 + dsaf_write_dev(dsaf_dev, DSAF_SBM_ROCEE_CFG_REG_REG, credit);
1157 + }
1158 ++
1159 ++ put_device(&pdev->dev);
1160 ++
1161 + return 0;
1162 + }
1163 + EXPORT_SYMBOL(hns_dsaf_roce_reset);
1164 +diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
1165 +index 7440c769b30f..8aecc4f4f123 100644
1166 +--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
1167 ++++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
1168 +@@ -2715,7 +2715,7 @@ void mlx4_opreq_action(struct work_struct *work)
1169 + if (err) {
1170 + mlx4_err(dev, "Failed to retrieve required operation: %d\n",
1171 + err);
1172 +- return;
1173 ++ goto out;
1174 + }
1175 + MLX4_GET(modifier, outbox, GET_OP_REQ_MODIFIER_OFFSET);
1176 + MLX4_GET(token, outbox, GET_OP_REQ_TOKEN_OFFSET);
1177 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
1178 +index 950ea980808b..6ae9a1987371 100644
1179 +--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
1180 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
1181 +@@ -804,6 +804,7 @@ static void cmd_work_handler(struct work_struct *work)
1182 + int alloc_ret;
1183 + int cmd_mode;
1184 +
1185 ++ complete(&ent->handling);
1186 + sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;
1187 + down(sem);
1188 + if (!ent->page_queue) {
1189 +@@ -922,6 +923,11 @@ static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent)
1190 + struct mlx5_cmd *cmd = &dev->cmd;
1191 + int err;
1192 +
1193 ++ if (!wait_for_completion_timeout(&ent->handling, timeout) &&
1194 ++ cancel_work_sync(&ent->work)) {
1195 ++ ent->ret = -ECANCELED;
1196 ++ goto out_err;
1197 ++ }
1198 + if (cmd->mode == CMD_MODE_POLLING || ent->polling) {
1199 + wait_for_completion(&ent->done);
1200 + } else if (!wait_for_completion_timeout(&ent->done, timeout)) {
1201 +@@ -929,12 +935,17 @@ static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent)
1202 + mlx5_cmd_comp_handler(dev, 1UL << ent->idx, true);
1203 + }
1204 +
1205 ++out_err:
1206 + err = ent->ret;
1207 +
1208 + if (err == -ETIMEDOUT) {
1209 + mlx5_core_warn(dev, "%s(0x%x) timeout. Will cause a leak of a command resource\n",
1210 + mlx5_command_str(msg_to_opcode(ent->in)),
1211 + msg_to_opcode(ent->in));
1212 ++ } else if (err == -ECANCELED) {
1213 ++ mlx5_core_warn(dev, "%s(0x%x) canceled on out of queue timeout.\n",
1214 ++ mlx5_command_str(msg_to_opcode(ent->in)),
1215 ++ msg_to_opcode(ent->in));
1216 + }
1217 + mlx5_core_dbg(dev, "err %d, delivery status %s(%d)\n",
1218 + err, deliv_status_to_str(ent->status), ent->status);
1219 +@@ -970,6 +981,7 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in,
1220 + ent->token = token;
1221 + ent->polling = force_polling;
1222 +
1223 ++ init_completion(&ent->handling);
1224 + if (!callback)
1225 + init_completion(&ent->done);
1226 +
1227 +@@ -989,6 +1001,8 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in,
1228 + err = wait_func(dev, ent);
1229 + if (err == -ETIMEDOUT)
1230 + goto out;
1231 ++ if (err == -ECANCELED)
1232 ++ goto out_free;
1233 +
1234 + ds = ent->ts2 - ent->ts1;
1235 + op = MLX5_GET(mbox_in, in->first.data, opcode);
1236 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
1237 +index d560047c0bf9..abdb444c6ed0 100644
1238 +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
1239 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
1240 +@@ -496,8 +496,9 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
1241 + void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq)
1242 + {
1243 + struct mlx5e_tx_wqe_info *wi;
1244 ++ u32 nbytes = 0;
1245 ++ u16 ci, npkts = 0;
1246 + struct sk_buff *skb;
1247 +- u16 ci;
1248 + int i;
1249 +
1250 + while (sq->cc != sq->pc) {
1251 +@@ -518,8 +519,11 @@ void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq)
1252 + }
1253 +
1254 + dev_kfree_skb_any(skb);
1255 ++ npkts++;
1256 ++ nbytes += wi->num_bytes;
1257 + sq->cc += wi->num_wqebbs;
1258 + }
1259 ++ netdev_tx_completed_queue(sq->txq, npkts, nbytes);
1260 + }
1261 +
1262 + #ifdef CONFIG_MLX5_CORE_IPOIB
1263 +diff --git a/drivers/net/ethernet/microchip/encx24j600.c b/drivers/net/ethernet/microchip/encx24j600.c
1264 +index f831238d9793..84b6ad76f5bc 100644
1265 +--- a/drivers/net/ethernet/microchip/encx24j600.c
1266 ++++ b/drivers/net/ethernet/microchip/encx24j600.c
1267 +@@ -1075,7 +1075,7 @@ static int encx24j600_spi_probe(struct spi_device *spi)
1268 + if (unlikely(ret)) {
1269 + netif_err(priv, probe, ndev, "Error %d initializing card encx24j600 card\n",
1270 + ret);
1271 +- goto out_free;
1272 ++ goto out_stop;
1273 + }
1274 +
1275 + eidled = encx24j600_read_reg(priv, EIDLED);
1276 +@@ -1093,6 +1093,8 @@ static int encx24j600_spi_probe(struct spi_device *spi)
1277 +
1278 + out_unregister:
1279 + unregister_netdev(priv->ndev);
1280 ++out_stop:
1281 ++ kthread_stop(priv->kworker_task);
1282 + out_free:
1283 + free_netdev(ndev);
1284 +
1285 +@@ -1105,6 +1107,7 @@ static int encx24j600_spi_remove(struct spi_device *spi)
1286 + struct encx24j600_priv *priv = dev_get_drvdata(&spi->dev);
1287 +
1288 + unregister_netdev(priv->ndev);
1289 ++ kthread_stop(priv->kworker_task);
1290 +
1291 + free_netdev(priv->ndev);
1292 +
1293 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
1294 +index 1fc84d8f891b..aae81226a0a4 100644
1295 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
1296 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
1297 +@@ -3650,7 +3650,7 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
1298 + ahw->diag_cnt = 0;
1299 + ret = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_INTRPT_TEST);
1300 + if (ret)
1301 +- goto fail_diag_irq;
1302 ++ goto fail_mbx_args;
1303 +
1304 + if (adapter->flags & QLCNIC_MSIX_ENABLED)
1305 + intrpt_id = ahw->intr_tbl[0].id;
1306 +@@ -3680,6 +3680,8 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
1307 +
1308 + done:
1309 + qlcnic_free_mbx_args(&cmd);
1310 ++
1311 ++fail_mbx_args:
1312 + qlcnic_83xx_diag_free_res(netdev, drv_sds_rings);
1313 +
1314 + fail_diag_irq:
1315 +diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
1316 +index 382993c1561c..7e5c0f182770 100644
1317 +--- a/drivers/net/ethernet/sun/cassini.c
1318 ++++ b/drivers/net/ethernet/sun/cassini.c
1319 +@@ -4983,7 +4983,7 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1320 + cas_cacheline_size)) {
1321 + dev_err(&pdev->dev, "Could not set PCI cache "
1322 + "line size\n");
1323 +- goto err_write_cacheline;
1324 ++ goto err_out_free_res;
1325 + }
1326 + }
1327 + #endif
1328 +@@ -5158,7 +5158,6 @@ err_out_iounmap:
1329 + err_out_free_res:
1330 + pci_release_regions(pdev);
1331 +
1332 +-err_write_cacheline:
1333 + /* Try to restore it in case the error occurred after we
1334 + * set it.
1335 + */
1336 +diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
1337 +index 6c7a169d906a..f3def96d35d4 100644
1338 +--- a/drivers/net/usb/cdc_ether.c
1339 ++++ b/drivers/net/usb/cdc_ether.c
1340 +@@ -821,14 +821,21 @@ static const struct usb_device_id products[] = {
1341 + .driver_info = 0,
1342 + },
1343 +
1344 +-/* Microsoft Surface 3 dock (based on Realtek RTL8153) */
1345 ++/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153) */
1346 + {
1347 + USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07c6, USB_CLASS_COMM,
1348 + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
1349 + .driver_info = 0,
1350 + },
1351 +
1352 +- /* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */
1353 ++/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153B) */
1354 ++{
1355 ++ USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x0927, USB_CLASS_COMM,
1356 ++ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
1357 ++ .driver_info = 0,
1358 ++},
1359 ++
1360 ++/* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */
1361 + {
1362 + USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, 0x0601, USB_CLASS_COMM,
1363 + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
1364 +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
1365 +index cadf5ded45a9..e30792380812 100644
1366 +--- a/drivers/net/usb/r8152.c
1367 ++++ b/drivers/net/usb/r8152.c
1368 +@@ -5329,6 +5329,7 @@ static const struct usb_device_id rtl8152_table[] = {
1369 + {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)},
1370 + {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)},
1371 + {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)},
1372 ++ {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927)},
1373 + {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)},
1374 + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f)},
1375 + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062)},
1376 +diff --git a/drivers/s390/scsi/zfcp_fsf.c b/drivers/s390/scsi/zfcp_fsf.c
1377 +index 94d1bcc83fa2..119238faf1ac 100644
1378 +--- a/drivers/s390/scsi/zfcp_fsf.c
1379 ++++ b/drivers/s390/scsi/zfcp_fsf.c
1380 +@@ -1594,6 +1594,7 @@ int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port)
1381 + {
1382 + struct zfcp_qdio *qdio = wka_port->adapter->qdio;
1383 + struct zfcp_fsf_req *req;
1384 ++ unsigned long req_id = 0;
1385 + int retval = -EIO;
1386 +
1387 + spin_lock_irq(&qdio->req_q_lock);
1388 +@@ -1616,6 +1617,8 @@ int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port)
1389 + hton24(req->qtcb->bottom.support.d_id, wka_port->d_id);
1390 + req->data = wka_port;
1391 +
1392 ++ req_id = req->req_id;
1393 ++
1394 + zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
1395 + retval = zfcp_fsf_req_send(req);
1396 + if (retval)
1397 +@@ -1623,7 +1626,7 @@ int zfcp_fsf_open_wka_port(struct zfcp_fc_wka_port *wka_port)
1398 + out:
1399 + spin_unlock_irq(&qdio->req_q_lock);
1400 + if (!retval)
1401 +- zfcp_dbf_rec_run_wka("fsowp_1", wka_port, req->req_id);
1402 ++ zfcp_dbf_rec_run_wka("fsowp_1", wka_port, req_id);
1403 + return retval;
1404 + }
1405 +
1406 +@@ -1649,6 +1652,7 @@ int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *wka_port)
1407 + {
1408 + struct zfcp_qdio *qdio = wka_port->adapter->qdio;
1409 + struct zfcp_fsf_req *req;
1410 ++ unsigned long req_id = 0;
1411 + int retval = -EIO;
1412 +
1413 + spin_lock_irq(&qdio->req_q_lock);
1414 +@@ -1671,6 +1675,8 @@ int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *wka_port)
1415 + req->data = wka_port;
1416 + req->qtcb->header.port_handle = wka_port->handle;
1417 +
1418 ++ req_id = req->req_id;
1419 ++
1420 + zfcp_fsf_start_timer(req, ZFCP_FSF_REQUEST_TIMEOUT);
1421 + retval = zfcp_fsf_req_send(req);
1422 + if (retval)
1423 +@@ -1678,7 +1684,7 @@ int zfcp_fsf_close_wka_port(struct zfcp_fc_wka_port *wka_port)
1424 + out:
1425 + spin_unlock_irq(&qdio->req_q_lock);
1426 + if (!retval)
1427 +- zfcp_dbf_rec_run_wka("fscwp_1", wka_port, req->req_id);
1428 ++ zfcp_dbf_rec_run_wka("fscwp_1", wka_port, req_id);
1429 + return retval;
1430 + }
1431 +
1432 +diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
1433 +index c1655aba131f..590acca60134 100644
1434 +--- a/drivers/tty/serial/sc16is7xx.c
1435 ++++ b/drivers/tty/serial/sc16is7xx.c
1436 +@@ -1524,10 +1524,12 @@ static int __init sc16is7xx_init(void)
1437 + #endif
1438 + return ret;
1439 +
1440 ++#ifdef CONFIG_SERIAL_SC16IS7XX_SPI
1441 + err_spi:
1442 + #ifdef CONFIG_SERIAL_SC16IS7XX_I2C
1443 + i2c_del_driver(&sc16is7xx_i2c_uart_driver);
1444 + #endif
1445 ++#endif
1446 + err_i2c:
1447 + uart_unregister_driver(&sc16is7xx_uart);
1448 + return ret;
1449 +diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
1450 +index 5c28bee327e1..e431a8bc3a9d 100644
1451 +--- a/drivers/usb/gadget/legacy/inode.c
1452 ++++ b/drivers/usb/gadget/legacy/inode.c
1453 +@@ -1364,7 +1364,6 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1454 +
1455 + req->buf = dev->rbuf;
1456 + req->context = NULL;
1457 +- value = -EOPNOTSUPP;
1458 + switch (ctrl->bRequest) {
1459 +
1460 + case USB_REQ_GET_DESCRIPTOR:
1461 +@@ -1788,7 +1787,7 @@ static ssize_t
1462 + dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
1463 + {
1464 + struct dev_data *dev = fd->private_data;
1465 +- ssize_t value = len, length = len;
1466 ++ ssize_t value, length = len;
1467 + unsigned total;
1468 + u32 tag;
1469 + char *kbuf;
1470 +diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
1471 +index 166846a40078..2c433c95adb5 100644
1472 +--- a/fs/binfmt_elf.c
1473 ++++ b/fs/binfmt_elf.c
1474 +@@ -1740,7 +1740,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
1475 + (!regset->active || regset->active(t->task, regset) > 0)) {
1476 + int ret;
1477 + size_t size = regset->n * regset->size;
1478 +- void *data = kmalloc(size, GFP_KERNEL);
1479 ++ void *data = kzalloc(size, GFP_KERNEL);
1480 + if (unlikely(!data))
1481 + return 0;
1482 + ret = regset->get(t->task, regset,
1483 +diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
1484 +index 5e9176ec0d3a..c073a0f680fd 100644
1485 +--- a/fs/cachefiles/rdwr.c
1486 ++++ b/fs/cachefiles/rdwr.c
1487 +@@ -64,9 +64,9 @@ static int cachefiles_read_waiter(wait_queue_entry_t *wait, unsigned mode,
1488 + object = container_of(op->op.object, struct cachefiles_object, fscache);
1489 + spin_lock(&object->work_lock);
1490 + list_add_tail(&monitor->op_link, &op->to_do);
1491 ++ fscache_enqueue_retrieval(op);
1492 + spin_unlock(&object->work_lock);
1493 +
1494 +- fscache_enqueue_retrieval(op);
1495 + fscache_put_retrieval(op);
1496 + return 0;
1497 + }
1498 +diff --git a/fs/cifs/file.c b/fs/cifs/file.c
1499 +index 662977b8d6ae..72e7cbfb325a 100644
1500 +--- a/fs/cifs/file.c
1501 ++++ b/fs/cifs/file.c
1502 +@@ -3496,7 +3496,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset)
1503 + * than it negotiated since it will refuse the read
1504 + * then.
1505 + */
1506 +- if ((tcon->ses) && !(tcon->ses->capabilities &
1507 ++ if (!(tcon->ses->capabilities &
1508 + tcon->ses->server->vals->cap_large_files)) {
1509 + current_read_size = min_t(uint,
1510 + current_read_size, CIFSMaxBufSize);
1511 +diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
1512 +index e700fb162664..a833e2e07167 100644
1513 +--- a/fs/gfs2/quota.c
1514 ++++ b/fs/gfs2/quota.c
1515 +@@ -1039,8 +1039,7 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
1516 + u32 x;
1517 + int error = 0;
1518 +
1519 +- if (capable(CAP_SYS_RESOURCE) ||
1520 +- sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
1521 ++ if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
1522 + return 0;
1523 +
1524 + error = gfs2_quota_hold(ip, uid, gid);
1525 +diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h
1526 +index 836f29480be6..e3a6e2404d11 100644
1527 +--- a/fs/gfs2/quota.h
1528 ++++ b/fs/gfs2/quota.h
1529 +@@ -47,7 +47,8 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip,
1530 + int ret;
1531 +
1532 + ap->allowed = UINT_MAX; /* Assume we are permitted a whole lot */
1533 +- if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
1534 ++ if (capable(CAP_SYS_RESOURCE) ||
1535 ++ sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
1536 + return 0;
1537 + ret = gfs2_quota_lock(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
1538 + if (ret)
1539 +diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
1540 +index 5d2add1a6c96..864fcfa1df41 100644
1541 +--- a/include/asm-generic/topology.h
1542 ++++ b/include/asm-generic/topology.h
1543 +@@ -51,7 +51,7 @@
1544 + #ifdef CONFIG_NEED_MULTIPLE_NODES
1545 + #define cpumask_of_node(node) ((node) == 0 ? cpu_online_mask : cpu_none_mask)
1546 + #else
1547 +- #define cpumask_of_node(node) ((void)node, cpu_online_mask)
1548 ++ #define cpumask_of_node(node) ((void)(node), cpu_online_mask)
1549 + #endif
1550 + #endif
1551 + #ifndef pcibus_to_node
1552 +diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
1553 +index 32d445315128..983cd796cbb3 100644
1554 +--- a/include/linux/mlx5/driver.h
1555 ++++ b/include/linux/mlx5/driver.h
1556 +@@ -841,6 +841,7 @@ struct mlx5_cmd_work_ent {
1557 + struct delayed_work cb_timeout_work;
1558 + void *context;
1559 + int idx;
1560 ++ struct completion handling;
1561 + struct completion done;
1562 + struct mlx5_cmd *cmd;
1563 + struct work_struct work;
1564 +diff --git a/include/linux/mm.h b/include/linux/mm.h
1565 +index 858ce84ac7c5..6f852d5fbada 100644
1566 +--- a/include/linux/mm.h
1567 ++++ b/include/linux/mm.h
1568 +@@ -549,6 +549,11 @@ static inline void *kvmalloc_array(size_t n, size_t size, gfp_t flags)
1569 +
1570 + extern void kvfree(const void *addr);
1571 +
1572 ++/*
1573 ++ * Mapcount of compound page as a whole, does not include mapped sub-pages.
1574 ++ *
1575 ++ * Must be called only for compound pages or any their tail sub-pages.
1576 ++ */
1577 + static inline int compound_mapcount(struct page *page)
1578 + {
1579 + VM_BUG_ON_PAGE(!PageCompound(page), page);
1580 +@@ -568,10 +573,16 @@ static inline void page_mapcount_reset(struct page *page)
1581 +
1582 + int __page_mapcount(struct page *page);
1583 +
1584 ++/*
1585 ++ * Mapcount of 0-order page; when compound sub-page, includes
1586 ++ * compound_mapcount().
1587 ++ *
1588 ++ * Result is undefined for pages which cannot be mapped into userspace.
1589 ++ * For example SLAB or special types of pages. See function page_has_type().
1590 ++ * They use this place in struct page differently.
1591 ++ */
1592 + static inline int page_mapcount(struct page *page)
1593 + {
1594 +- VM_BUG_ON_PAGE(PageSlab(page), page);
1595 +-
1596 + if (unlikely(PageCompound(page)))
1597 + return __page_mapcount(page);
1598 + return atomic_read(&page->_mapcount) + 1;
1599 +diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h
1600 +index 833a5b2255ea..ade993809ebc 100644
1601 +--- a/include/linux/netfilter/nf_conntrack_pptp.h
1602 ++++ b/include/linux/netfilter/nf_conntrack_pptp.h
1603 +@@ -5,7 +5,7 @@
1604 +
1605 + #include <linux/netfilter/nf_conntrack_common.h>
1606 +
1607 +-extern const char *const pptp_msg_name[];
1608 ++const char *pptp_msg_name(u_int16_t msg);
1609 +
1610 + /* state of the control session */
1611 + enum pptp_ctrlsess_state {
1612 +diff --git a/include/net/act_api.h b/include/net/act_api.h
1613 +index 775387d6ca95..ff268bb0c60f 100644
1614 +--- a/include/net/act_api.h
1615 ++++ b/include/net/act_api.h
1616 +@@ -69,7 +69,8 @@ static inline void tcf_tm_dump(struct tcf_t *dtm, const struct tcf_t *stm)
1617 + {
1618 + dtm->install = jiffies_to_clock_t(jiffies - stm->install);
1619 + dtm->lastuse = jiffies_to_clock_t(jiffies - stm->lastuse);
1620 +- dtm->firstuse = jiffies_to_clock_t(jiffies - stm->firstuse);
1621 ++ dtm->firstuse = stm->firstuse ?
1622 ++ jiffies_to_clock_t(jiffies - stm->firstuse) : 0;
1623 + dtm->expires = jiffies_to_clock_t(stm->expires);
1624 + }
1625 +
1626 +diff --git a/include/uapi/linux/xfrm.h b/include/uapi/linux/xfrm.h
1627 +index e3af2859188b..0b636432cdf3 100644
1628 +--- a/include/uapi/linux/xfrm.h
1629 ++++ b/include/uapi/linux/xfrm.h
1630 +@@ -304,7 +304,7 @@ enum xfrm_attr_type_t {
1631 + XFRMA_PROTO, /* __u8 */
1632 + XFRMA_ADDRESS_FILTER, /* struct xfrm_address_filter */
1633 + XFRMA_PAD,
1634 +- XFRMA_OFFLOAD_DEV, /* struct xfrm_state_offload */
1635 ++ XFRMA_OFFLOAD_DEV, /* struct xfrm_user_offload */
1636 + XFRMA_OUTPUT_MARK, /* __u32 */
1637 + __XFRMA_MAX
1638 +
1639 +diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c
1640 +index 86ae0eb80b53..8b8cecd18cce 100644
1641 +--- a/kernel/irq/migration.c
1642 ++++ b/kernel/irq/migration.c
1643 +@@ -38,17 +38,18 @@ bool irq_fixup_move_pending(struct irq_desc *desc, bool force_clear)
1644 + void irq_move_masked_irq(struct irq_data *idata)
1645 + {
1646 + struct irq_desc *desc = irq_data_to_desc(idata);
1647 +- struct irq_chip *chip = desc->irq_data.chip;
1648 ++ struct irq_data *data = &desc->irq_data;
1649 ++ struct irq_chip *chip = data->chip;
1650 +
1651 +- if (likely(!irqd_is_setaffinity_pending(&desc->irq_data)))
1652 ++ if (likely(!irqd_is_setaffinity_pending(data)))
1653 + return;
1654 +
1655 +- irqd_clr_move_pending(&desc->irq_data);
1656 ++ irqd_clr_move_pending(data);
1657 +
1658 + /*
1659 + * Paranoia: cpu-local interrupts shouldn't be calling in here anyway.
1660 + */
1661 +- if (irqd_is_per_cpu(&desc->irq_data)) {
1662 ++ if (irqd_is_per_cpu(data)) {
1663 + WARN_ON(1);
1664 + return;
1665 + }
1666 +@@ -73,9 +74,20 @@ void irq_move_masked_irq(struct irq_data *idata)
1667 + * For correct operation this depends on the caller
1668 + * masking the irqs.
1669 + */
1670 +- if (cpumask_any_and(desc->pending_mask, cpu_online_mask) < nr_cpu_ids)
1671 +- irq_do_set_affinity(&desc->irq_data, desc->pending_mask, false);
1672 +-
1673 ++ if (cpumask_any_and(desc->pending_mask, cpu_online_mask) < nr_cpu_ids) {
1674 ++ int ret;
1675 ++
1676 ++ ret = irq_do_set_affinity(data, desc->pending_mask, false);
1677 ++ /*
1678 ++ * If the there is a cleanup pending in the underlying
1679 ++ * vector management, reschedule the move for the next
1680 ++ * interrupt. Leave desc->pending_mask intact.
1681 ++ */
1682 ++ if (ret == -EBUSY) {
1683 ++ irqd_set_move_pending(data);
1684 ++ return;
1685 ++ }
1686 ++ }
1687 + cpumask_clear(desc->pending_mask);
1688 + }
1689 +
1690 +diff --git a/mm/vmalloc.c b/mm/vmalloc.c
1691 +index 63bf3f207e16..e8c64dddfecd 100644
1692 +--- a/mm/vmalloc.c
1693 ++++ b/mm/vmalloc.c
1694 +@@ -1524,7 +1524,7 @@ static void __vunmap(const void *addr, int deallocate_pages)
1695 + addr))
1696 + return;
1697 +
1698 +- area = find_vmap_area((unsigned long)addr)->vm;
1699 ++ area = find_vm_area(addr);
1700 + if (unlikely(!area)) {
1701 + WARN(1, KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n",
1702 + addr);
1703 +diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
1704 +index 63fa6ea2341e..89d074ce10fc 100644
1705 +--- a/net/ax25/af_ax25.c
1706 ++++ b/net/ax25/af_ax25.c
1707 +@@ -639,8 +639,10 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
1708 + break;
1709 +
1710 + case SO_BINDTODEVICE:
1711 +- if (optlen > IFNAMSIZ)
1712 +- optlen = IFNAMSIZ;
1713 ++ if (optlen > IFNAMSIZ - 1)
1714 ++ optlen = IFNAMSIZ - 1;
1715 ++
1716 ++ memset(devname, 0, sizeof(devname));
1717 +
1718 + if (copy_from_user(devname, optval, optlen)) {
1719 + res = -EFAULT;
1720 +diff --git a/net/bridge/netfilter/nft_reject_bridge.c b/net/bridge/netfilter/nft_reject_bridge.c
1721 +index b09ec869c913..0ab7688bb724 100644
1722 +--- a/net/bridge/netfilter/nft_reject_bridge.c
1723 ++++ b/net/bridge/netfilter/nft_reject_bridge.c
1724 +@@ -34,6 +34,12 @@ static void nft_reject_br_push_etherhdr(struct sk_buff *oldskb,
1725 + ether_addr_copy(eth->h_dest, eth_hdr(oldskb)->h_source);
1726 + eth->h_proto = eth_hdr(oldskb)->h_proto;
1727 + skb_pull(nskb, ETH_HLEN);
1728 ++
1729 ++ if (skb_vlan_tag_present(oldskb)) {
1730 ++ u16 vid = skb_vlan_tag_get(oldskb);
1731 ++
1732 ++ __vlan_hwaccel_put_tag(nskb, oldskb->vlan_proto, vid);
1733 ++ }
1734 + }
1735 +
1736 + static int nft_bridge_iphdr_validate(struct sk_buff *skb)
1737 +diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
1738 +index 92b2641ab93b..753cbfd32dab 100644
1739 +--- a/net/ceph/osd_client.c
1740 ++++ b/net/ceph/osd_client.c
1741 +@@ -3444,7 +3444,9 @@ static void handle_reply(struct ceph_osd *osd, struct ceph_msg *msg)
1742 + * supported.
1743 + */
1744 + req->r_t.target_oloc.pool = m.redirect.oloc.pool;
1745 +- req->r_flags |= CEPH_OSD_FLAG_REDIRECTED;
1746 ++ req->r_flags |= CEPH_OSD_FLAG_REDIRECTED |
1747 ++ CEPH_OSD_FLAG_IGNORE_OVERLAY |
1748 ++ CEPH_OSD_FLAG_IGNORE_CACHE;
1749 + req->r_tid = 0;
1750 + __submit_request(req, false);
1751 + goto out_unlock_osdc;
1752 +diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
1753 +index c1693d75e196..33a85269a9f2 100644
1754 +--- a/net/ipv4/ip_vti.c
1755 ++++ b/net/ipv4/ip_vti.c
1756 +@@ -50,7 +50,7 @@ static unsigned int vti_net_id __read_mostly;
1757 + static int vti_tunnel_init(struct net_device *dev);
1758 +
1759 + static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi,
1760 +- int encap_type)
1761 ++ int encap_type, bool update_skb_dev)
1762 + {
1763 + struct ip_tunnel *tunnel;
1764 + const struct iphdr *iph = ip_hdr(skb);
1765 +@@ -65,6 +65,9 @@ static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi,
1766 +
1767 + XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel;
1768 +
1769 ++ if (update_skb_dev)
1770 ++ skb->dev = tunnel->dev;
1771 ++
1772 + return xfrm_input(skb, nexthdr, spi, encap_type);
1773 + }
1774 +
1775 +@@ -74,25 +77,43 @@ drop:
1776 + return 0;
1777 + }
1778 +
1779 +-static int vti_input_ipip(struct sk_buff *skb, int nexthdr, __be32 spi,
1780 +- int encap_type)
1781 ++static int vti_input_proto(struct sk_buff *skb, int nexthdr, __be32 spi,
1782 ++ int encap_type)
1783 + {
1784 +- struct ip_tunnel *tunnel;
1785 ++ return vti_input(skb, nexthdr, spi, encap_type, false);
1786 ++}
1787 ++
1788 ++static int vti_rcv(struct sk_buff *skb, __be32 spi, bool update_skb_dev)
1789 ++{
1790 ++ XFRM_SPI_SKB_CB(skb)->family = AF_INET;
1791 ++ XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr);
1792 ++
1793 ++ return vti_input(skb, ip_hdr(skb)->protocol, spi, 0, update_skb_dev);
1794 ++}
1795 ++
1796 ++static int vti_rcv_proto(struct sk_buff *skb)
1797 ++{
1798 ++ return vti_rcv(skb, 0, false);
1799 ++}
1800 ++
1801 ++static int vti_rcv_tunnel(struct sk_buff *skb)
1802 ++{
1803 ++ struct ip_tunnel_net *itn = net_generic(dev_net(skb->dev), vti_net_id);
1804 + const struct iphdr *iph = ip_hdr(skb);
1805 +- struct net *net = dev_net(skb->dev);
1806 +- struct ip_tunnel_net *itn = net_generic(net, vti_net_id);
1807 ++ struct ip_tunnel *tunnel;
1808 +
1809 + tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, TUNNEL_NO_KEY,
1810 + iph->saddr, iph->daddr, 0);
1811 + if (tunnel) {
1812 ++ struct tnl_ptk_info tpi = {
1813 ++ .proto = htons(ETH_P_IP),
1814 ++ };
1815 ++
1816 + if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb))
1817 + goto drop;
1818 +-
1819 +- XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel;
1820 +-
1821 +- skb->dev = tunnel->dev;
1822 +-
1823 +- return xfrm_input(skb, nexthdr, spi, encap_type);
1824 ++ if (iptunnel_pull_header(skb, 0, tpi.proto, false))
1825 ++ goto drop;
1826 ++ return ip_tunnel_rcv(tunnel, skb, &tpi, NULL, false);
1827 + }
1828 +
1829 + return -EINVAL;
1830 +@@ -101,22 +122,6 @@ drop:
1831 + return 0;
1832 + }
1833 +
1834 +-static int vti_rcv(struct sk_buff *skb)
1835 +-{
1836 +- XFRM_SPI_SKB_CB(skb)->family = AF_INET;
1837 +- XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr);
1838 +-
1839 +- return vti_input(skb, ip_hdr(skb)->protocol, 0, 0);
1840 +-}
1841 +-
1842 +-static int vti_rcv_ipip(struct sk_buff *skb)
1843 +-{
1844 +- XFRM_SPI_SKB_CB(skb)->family = AF_INET;
1845 +- XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr);
1846 +-
1847 +- return vti_input_ipip(skb, ip_hdr(skb)->protocol, ip_hdr(skb)->saddr, 0);
1848 +-}
1849 +-
1850 + static int vti_rcv_cb(struct sk_buff *skb, int err)
1851 + {
1852 + unsigned short family;
1853 +@@ -482,31 +487,31 @@ static void __net_init vti_fb_tunnel_init(struct net_device *dev)
1854 + }
1855 +
1856 + static struct xfrm4_protocol vti_esp4_protocol __read_mostly = {
1857 +- .handler = vti_rcv,
1858 +- .input_handler = vti_input,
1859 ++ .handler = vti_rcv_proto,
1860 ++ .input_handler = vti_input_proto,
1861 + .cb_handler = vti_rcv_cb,
1862 + .err_handler = vti4_err,
1863 + .priority = 100,
1864 + };
1865 +
1866 + static struct xfrm4_protocol vti_ah4_protocol __read_mostly = {
1867 +- .handler = vti_rcv,
1868 +- .input_handler = vti_input,
1869 ++ .handler = vti_rcv_proto,
1870 ++ .input_handler = vti_input_proto,
1871 + .cb_handler = vti_rcv_cb,
1872 + .err_handler = vti4_err,
1873 + .priority = 100,
1874 + };
1875 +
1876 + static struct xfrm4_protocol vti_ipcomp4_protocol __read_mostly = {
1877 +- .handler = vti_rcv,
1878 +- .input_handler = vti_input,
1879 ++ .handler = vti_rcv_proto,
1880 ++ .input_handler = vti_input_proto,
1881 + .cb_handler = vti_rcv_cb,
1882 + .err_handler = vti4_err,
1883 + .priority = 100,
1884 + };
1885 +
1886 + static struct xfrm_tunnel ipip_handler __read_mostly = {
1887 +- .handler = vti_rcv_ipip,
1888 ++ .handler = vti_rcv_tunnel,
1889 + .err_handler = vti4_err,
1890 + .priority = 0,
1891 + };
1892 +diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
1893 +index cdd627355ed1..df610245d21a 100644
1894 +--- a/net/ipv4/ipip.c
1895 ++++ b/net/ipv4/ipip.c
1896 +@@ -702,7 +702,7 @@ out:
1897 +
1898 + rtnl_link_failed:
1899 + #if IS_ENABLED(CONFIG_MPLS)
1900 +- xfrm4_tunnel_deregister(&mplsip_handler, AF_INET);
1901 ++ xfrm4_tunnel_deregister(&mplsip_handler, AF_MPLS);
1902 + xfrm_tunnel_mplsip_failed:
1903 +
1904 + #endif
1905 +diff --git a/net/ipv4/netfilter/nf_nat_pptp.c b/net/ipv4/netfilter/nf_nat_pptp.c
1906 +index 8a69363b4884..c66103de86bd 100644
1907 +--- a/net/ipv4/netfilter/nf_nat_pptp.c
1908 ++++ b/net/ipv4/netfilter/nf_nat_pptp.c
1909 +@@ -165,8 +165,7 @@ pptp_outbound_pkt(struct sk_buff *skb,
1910 + break;
1911 + default:
1912 + pr_debug("unknown outbound packet 0x%04x:%s\n", msg,
1913 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] :
1914 +- pptp_msg_name[0]);
1915 ++ pptp_msg_name(msg));
1916 + /* fall through */
1917 + case PPTP_SET_LINK_INFO:
1918 + /* only need to NAT in case PAC is behind NAT box */
1919 +@@ -267,9 +266,7 @@ pptp_inbound_pkt(struct sk_buff *skb,
1920 + pcid_off = offsetof(union pptp_ctrl_union, setlink.peersCallID);
1921 + break;
1922 + default:
1923 +- pr_debug("unknown inbound packet %s\n",
1924 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] :
1925 +- pptp_msg_name[0]);
1926 ++ pr_debug("unknown inbound packet %s\n", pptp_msg_name(msg));
1927 + /* fall through */
1928 + case PPTP_START_SESSION_REQUEST:
1929 + case PPTP_START_SESSION_REPLY:
1930 +diff --git a/net/ipv4/route.c b/net/ipv4/route.c
1931 +index 967acf2844ef..a894adbb6c9b 100644
1932 +--- a/net/ipv4/route.c
1933 ++++ b/net/ipv4/route.c
1934 +@@ -499,18 +499,16 @@ u32 ip_idents_reserve(u32 hash, int segs)
1935 + atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ;
1936 + u32 old = ACCESS_ONCE(*p_tstamp);
1937 + u32 now = (u32)jiffies;
1938 +- u32 new, delta = 0;
1939 ++ u32 delta = 0;
1940 +
1941 + if (old != now && cmpxchg(p_tstamp, old, now) == old)
1942 + delta = prandom_u32_max(now - old);
1943 +
1944 +- /* Do not use atomic_add_return() as it makes UBSAN unhappy */
1945 +- do {
1946 +- old = (u32)atomic_read(p_id);
1947 +- new = old + delta + segs;
1948 +- } while (atomic_cmpxchg(p_id, old, new) != old);
1949 +-
1950 +- return new - segs;
1951 ++ /* If UBSAN reports an error there, please make sure your compiler
1952 ++ * supports -fno-strict-overflow before reporting it that was a bug
1953 ++ * in UBSAN, and it has been fixed in GCC-8.
1954 ++ */
1955 ++ return atomic_add_return(segs + delta, p_id) - segs;
1956 + }
1957 + EXPORT_SYMBOL(ip_idents_reserve);
1958 +
1959 +diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
1960 +index f52c314d4c97..a50d1943dd62 100644
1961 +--- a/net/ipv6/esp6_offload.c
1962 ++++ b/net/ipv6/esp6_offload.c
1963 +@@ -121,9 +121,16 @@ static void esp6_gso_encap(struct xfrm_state *x, struct sk_buff *skb)
1964 + struct ip_esp_hdr *esph;
1965 + struct ipv6hdr *iph = ipv6_hdr(skb);
1966 + struct xfrm_offload *xo = xfrm_offload(skb);
1967 +- int proto = iph->nexthdr;
1968 ++ u8 proto = iph->nexthdr;
1969 +
1970 + skb_push(skb, -skb_network_offset(skb));
1971 ++
1972 ++ if (x->outer_mode->encap == XFRM_MODE_TRANSPORT) {
1973 ++ __be16 frag;
1974 ++
1975 ++ ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &proto, &frag);
1976 ++ }
1977 ++
1978 + esph = ip_esp_hdr(skb);
1979 + *skb_mac_header(skb) = IPPROTO_ESP;
1980 +
1981 +diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
1982 +index 986e9b6b961d..fe65701fe95c 100644
1983 +--- a/net/mac80211/mesh_hwmp.c
1984 ++++ b/net/mac80211/mesh_hwmp.c
1985 +@@ -1088,7 +1088,14 @@ void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata)
1986 + mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->vif.addr, ifmsh->sn,
1987 + target_flags, mpath->dst, mpath->sn, da, 0,
1988 + ttl, lifetime, 0, ifmsh->preq_id++, sdata);
1989 ++
1990 ++ spin_lock_bh(&mpath->state_lock);
1991 ++ if (mpath->flags & MESH_PATH_DELETED) {
1992 ++ spin_unlock_bh(&mpath->state_lock);
1993 ++ goto enddiscovery;
1994 ++ }
1995 + mod_timer(&mpath->timer, jiffies + mpath->discovery_timeout);
1996 ++ spin_unlock_bh(&mpath->state_lock);
1997 +
1998 + enddiscovery:
1999 + rcu_read_unlock();
2000 +diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c
2001 +index e563921e6af5..6ebd63a5d8ba 100644
2002 +--- a/net/netfilter/ipset/ip_set_list_set.c
2003 ++++ b/net/netfilter/ipset/ip_set_list_set.c
2004 +@@ -61,7 +61,7 @@ list_set_ktest(struct ip_set *set, const struct sk_buff *skb,
2005 + /* Don't lookup sub-counters at all */
2006 + opt->cmdflags &= ~IPSET_FLAG_MATCH_COUNTERS;
2007 + if (opt->cmdflags & IPSET_FLAG_SKIP_SUBCOUNTER_UPDATE)
2008 +- opt->cmdflags &= ~IPSET_FLAG_SKIP_COUNTER_UPDATE;
2009 ++ opt->cmdflags |= IPSET_FLAG_SKIP_COUNTER_UPDATE;
2010 + list_for_each_entry_rcu(e, &map->members, list) {
2011 + if (SET_WITH_TIMEOUT(set) &&
2012 + ip_set_timeout_expired(ext_timeout(e, set)))
2013 +diff --git a/net/netfilter/nf_conntrack_pptp.c b/net/netfilter/nf_conntrack_pptp.c
2014 +index 11562f2a08bb..203107ce2455 100644
2015 +--- a/net/netfilter/nf_conntrack_pptp.c
2016 ++++ b/net/netfilter/nf_conntrack_pptp.c
2017 +@@ -71,24 +71,32 @@ EXPORT_SYMBOL_GPL(nf_nat_pptp_hook_expectfn);
2018 +
2019 + #if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
2020 + /* PptpControlMessageType names */
2021 +-const char *const pptp_msg_name[] = {
2022 +- "UNKNOWN_MESSAGE",
2023 +- "START_SESSION_REQUEST",
2024 +- "START_SESSION_REPLY",
2025 +- "STOP_SESSION_REQUEST",
2026 +- "STOP_SESSION_REPLY",
2027 +- "ECHO_REQUEST",
2028 +- "ECHO_REPLY",
2029 +- "OUT_CALL_REQUEST",
2030 +- "OUT_CALL_REPLY",
2031 +- "IN_CALL_REQUEST",
2032 +- "IN_CALL_REPLY",
2033 +- "IN_CALL_CONNECT",
2034 +- "CALL_CLEAR_REQUEST",
2035 +- "CALL_DISCONNECT_NOTIFY",
2036 +- "WAN_ERROR_NOTIFY",
2037 +- "SET_LINK_INFO"
2038 ++static const char *const pptp_msg_name_array[PPTP_MSG_MAX + 1] = {
2039 ++ [0] = "UNKNOWN_MESSAGE",
2040 ++ [PPTP_START_SESSION_REQUEST] = "START_SESSION_REQUEST",
2041 ++ [PPTP_START_SESSION_REPLY] = "START_SESSION_REPLY",
2042 ++ [PPTP_STOP_SESSION_REQUEST] = "STOP_SESSION_REQUEST",
2043 ++ [PPTP_STOP_SESSION_REPLY] = "STOP_SESSION_REPLY",
2044 ++ [PPTP_ECHO_REQUEST] = "ECHO_REQUEST",
2045 ++ [PPTP_ECHO_REPLY] = "ECHO_REPLY",
2046 ++ [PPTP_OUT_CALL_REQUEST] = "OUT_CALL_REQUEST",
2047 ++ [PPTP_OUT_CALL_REPLY] = "OUT_CALL_REPLY",
2048 ++ [PPTP_IN_CALL_REQUEST] = "IN_CALL_REQUEST",
2049 ++ [PPTP_IN_CALL_REPLY] = "IN_CALL_REPLY",
2050 ++ [PPTP_IN_CALL_CONNECT] = "IN_CALL_CONNECT",
2051 ++ [PPTP_CALL_CLEAR_REQUEST] = "CALL_CLEAR_REQUEST",
2052 ++ [PPTP_CALL_DISCONNECT_NOTIFY] = "CALL_DISCONNECT_NOTIFY",
2053 ++ [PPTP_WAN_ERROR_NOTIFY] = "WAN_ERROR_NOTIFY",
2054 ++ [PPTP_SET_LINK_INFO] = "SET_LINK_INFO"
2055 + };
2056 ++
2057 ++const char *pptp_msg_name(u_int16_t msg)
2058 ++{
2059 ++ if (msg > PPTP_MSG_MAX)
2060 ++ return pptp_msg_name_array[0];
2061 ++
2062 ++ return pptp_msg_name_array[msg];
2063 ++}
2064 + EXPORT_SYMBOL(pptp_msg_name);
2065 + #endif
2066 +
2067 +@@ -275,7 +283,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2068 + typeof(nf_nat_pptp_hook_inbound) nf_nat_pptp_inbound;
2069 +
2070 + msg = ntohs(ctlh->messageType);
2071 +- pr_debug("inbound control message %s\n", pptp_msg_name[msg]);
2072 ++ pr_debug("inbound control message %s\n", pptp_msg_name(msg));
2073 +
2074 + switch (msg) {
2075 + case PPTP_START_SESSION_REPLY:
2076 +@@ -310,7 +318,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2077 + pcid = pptpReq->ocack.peersCallID;
2078 + if (info->pns_call_id != pcid)
2079 + goto invalid;
2080 +- pr_debug("%s, CID=%X, PCID=%X\n", pptp_msg_name[msg],
2081 ++ pr_debug("%s, CID=%X, PCID=%X\n", pptp_msg_name(msg),
2082 + ntohs(cid), ntohs(pcid));
2083 +
2084 + if (pptpReq->ocack.resultCode == PPTP_OUTCALL_CONNECT) {
2085 +@@ -327,7 +335,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2086 + goto invalid;
2087 +
2088 + cid = pptpReq->icreq.callID;
2089 +- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
2090 ++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid));
2091 + info->cstate = PPTP_CALL_IN_REQ;
2092 + info->pac_call_id = cid;
2093 + break;
2094 +@@ -346,7 +354,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2095 + if (info->pns_call_id != pcid)
2096 + goto invalid;
2097 +
2098 +- pr_debug("%s, PCID=%X\n", pptp_msg_name[msg], ntohs(pcid));
2099 ++ pr_debug("%s, PCID=%X\n", pptp_msg_name(msg), ntohs(pcid));
2100 + info->cstate = PPTP_CALL_IN_CONF;
2101 +
2102 + /* we expect a GRE connection from PAC to PNS */
2103 +@@ -356,7 +364,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2104 + case PPTP_CALL_DISCONNECT_NOTIFY:
2105 + /* server confirms disconnect */
2106 + cid = pptpReq->disc.callID;
2107 +- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
2108 ++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid));
2109 + info->cstate = PPTP_CALL_NONE;
2110 +
2111 + /* untrack this call id, unexpect GRE packets */
2112 +@@ -383,7 +391,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2113 + invalid:
2114 + pr_debug("invalid %s: type=%d cid=%u pcid=%u "
2115 + "cstate=%d sstate=%d pns_cid=%u pac_cid=%u\n",
2116 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] : pptp_msg_name[0],
2117 ++ pptp_msg_name(msg),
2118 + msg, ntohs(cid), ntohs(pcid), info->cstate, info->sstate,
2119 + ntohs(info->pns_call_id), ntohs(info->pac_call_id));
2120 + return NF_ACCEPT;
2121 +@@ -403,7 +411,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
2122 + typeof(nf_nat_pptp_hook_outbound) nf_nat_pptp_outbound;
2123 +
2124 + msg = ntohs(ctlh->messageType);
2125 +- pr_debug("outbound control message %s\n", pptp_msg_name[msg]);
2126 ++ pr_debug("outbound control message %s\n", pptp_msg_name(msg));
2127 +
2128 + switch (msg) {
2129 + case PPTP_START_SESSION_REQUEST:
2130 +@@ -425,7 +433,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
2131 + info->cstate = PPTP_CALL_OUT_REQ;
2132 + /* track PNS call id */
2133 + cid = pptpReq->ocreq.callID;
2134 +- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
2135 ++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid));
2136 + info->pns_call_id = cid;
2137 + break;
2138 +
2139 +@@ -439,7 +447,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
2140 + pcid = pptpReq->icack.peersCallID;
2141 + if (info->pac_call_id != pcid)
2142 + goto invalid;
2143 +- pr_debug("%s, CID=%X PCID=%X\n", pptp_msg_name[msg],
2144 ++ pr_debug("%s, CID=%X PCID=%X\n", pptp_msg_name(msg),
2145 + ntohs(cid), ntohs(pcid));
2146 +
2147 + if (pptpReq->icack.resultCode == PPTP_INCALL_ACCEPT) {
2148 +@@ -479,7 +487,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
2149 + invalid:
2150 + pr_debug("invalid %s: type=%d cid=%u pcid=%u "
2151 + "cstate=%d sstate=%d pns_cid=%u pac_cid=%u\n",
2152 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] : pptp_msg_name[0],
2153 ++ pptp_msg_name(msg),
2154 + msg, ntohs(cid), ntohs(pcid), info->cstate, info->sstate,
2155 + ntohs(info->pns_call_id), ntohs(info->pac_call_id));
2156 + return NF_ACCEPT;
2157 +diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c
2158 +index dd1030f5dd5e..dfe4e6787219 100644
2159 +--- a/net/netfilter/nfnetlink_cthelper.c
2160 ++++ b/net/netfilter/nfnetlink_cthelper.c
2161 +@@ -106,7 +106,7 @@ nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct)
2162 + if (help->helper->data_len == 0)
2163 + return -EINVAL;
2164 +
2165 +- nla_memcpy(help->data, nla_data(attr), sizeof(help->data));
2166 ++ nla_memcpy(help->data, attr, sizeof(help->data));
2167 + return 0;
2168 + }
2169 +
2170 +@@ -240,6 +240,7 @@ nfnl_cthelper_create(const struct nlattr * const tb[],
2171 + ret = -ENOMEM;
2172 + goto err2;
2173 + }
2174 ++ helper->data_len = size;
2175 +
2176 + helper->flags |= NF_CT_HELPER_F_USERSPACE;
2177 + memcpy(&helper->tuple, tuple, sizeof(struct nf_conntrack_tuple));
2178 +diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
2179 +index 944ce686bfe5..b9b6235a4cf2 100644
2180 +--- a/net/qrtr/qrtr.c
2181 ++++ b/net/qrtr/qrtr.c
2182 +@@ -660,7 +660,7 @@ static int qrtr_bcast_enqueue(struct qrtr_node *node, struct sk_buff *skb)
2183 + }
2184 + mutex_unlock(&qrtr_node_lock);
2185 +
2186 +- qrtr_local_enqueue(node, skb);
2187 ++ qrtr_local_enqueue(NULL, skb);
2188 +
2189 + return 0;
2190 + }
2191 +diff --git a/net/rxrpc/local_object.c b/net/rxrpc/local_object.c
2192 +index 2af42c7d5b82..383292adcac6 100644
2193 +--- a/net/rxrpc/local_object.c
2194 ++++ b/net/rxrpc/local_object.c
2195 +@@ -134,10 +134,10 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
2196 + }
2197 +
2198 + switch (local->srx.transport.family) {
2199 +- case AF_INET:
2200 +- /* we want to receive ICMP errors */
2201 ++ case AF_INET6:
2202 ++ /* we want to receive ICMPv6 errors */
2203 + opt = 1;
2204 +- ret = kernel_setsockopt(local->socket, SOL_IP, IP_RECVERR,
2205 ++ ret = kernel_setsockopt(local->socket, SOL_IPV6, IPV6_RECVERR,
2206 + (char *) &opt, sizeof(opt));
2207 + if (ret < 0) {
2208 + _debug("setsockopt failed");
2209 +@@ -145,19 +145,22 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
2210 + }
2211 +
2212 + /* we want to set the don't fragment bit */
2213 +- opt = IP_PMTUDISC_DO;
2214 +- ret = kernel_setsockopt(local->socket, SOL_IP, IP_MTU_DISCOVER,
2215 ++ opt = IPV6_PMTUDISC_DO;
2216 ++ ret = kernel_setsockopt(local->socket, SOL_IPV6, IPV6_MTU_DISCOVER,
2217 + (char *) &opt, sizeof(opt));
2218 + if (ret < 0) {
2219 + _debug("setsockopt failed");
2220 + goto error;
2221 + }
2222 +- break;
2223 +
2224 +- case AF_INET6:
2225 ++ /* Fall through and set IPv4 options too otherwise we don't get
2226 ++ * errors from IPv4 packets sent through the IPv6 socket.
2227 ++ */
2228 ++
2229 ++ case AF_INET:
2230 + /* we want to receive ICMP errors */
2231 + opt = 1;
2232 +- ret = kernel_setsockopt(local->socket, SOL_IPV6, IPV6_RECVERR,
2233 ++ ret = kernel_setsockopt(local->socket, SOL_IP, IP_RECVERR,
2234 + (char *) &opt, sizeof(opt));
2235 + if (ret < 0) {
2236 + _debug("setsockopt failed");
2237 +@@ -165,8 +168,8 @@ static int rxrpc_open_socket(struct rxrpc_local *local, struct net *net)
2238 + }
2239 +
2240 + /* we want to set the don't fragment bit */
2241 +- opt = IPV6_PMTUDISC_DO;
2242 +- ret = kernel_setsockopt(local->socket, SOL_IPV6, IPV6_MTU_DISCOVER,
2243 ++ opt = IP_PMTUDISC_DO;
2244 ++ ret = kernel_setsockopt(local->socket, SOL_IP, IP_MTU_DISCOVER,
2245 + (char *) &opt, sizeof(opt));
2246 + if (ret < 0) {
2247 + _debug("setsockopt failed");
2248 +diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
2249 +index ba29d782af30..80b9f7f097fa 100644
2250 +--- a/net/sctp/sm_statefuns.c
2251 ++++ b/net/sctp/sm_statefuns.c
2252 +@@ -1829,12 +1829,13 @@ static enum sctp_disposition sctp_sf_do_dupcook_a(
2253 + /* Update the content of current association. */
2254 + sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc));
2255 + sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev));
2256 +- if (sctp_state(asoc, SHUTDOWN_PENDING) &&
2257 ++ if ((sctp_state(asoc, SHUTDOWN_PENDING) ||
2258 ++ sctp_state(asoc, SHUTDOWN_SENT)) &&
2259 + (sctp_sstate(asoc->base.sk, CLOSING) ||
2260 + sock_flag(asoc->base.sk, SOCK_DEAD))) {
2261 +- /* if were currently in SHUTDOWN_PENDING, but the socket
2262 +- * has been closed by user, don't transition to ESTABLISHED.
2263 +- * Instead trigger SHUTDOWN bundled with COOKIE_ACK.
2264 ++ /* If the socket has been closed by user, don't
2265 ++ * transition to ESTABLISHED. Instead trigger SHUTDOWN
2266 ++ * bundled with COOKIE_ACK.
2267 + */
2268 + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
2269 + return sctp_sf_do_9_2_start_shutdown(net, ep, asoc,
2270 +diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
2271 +index 311597401b82..874735742152 100644
2272 +--- a/net/xfrm/xfrm_input.c
2273 ++++ b/net/xfrm/xfrm_input.c
2274 +@@ -402,7 +402,7 @@ resume:
2275 + dev_put(skb->dev);
2276 +
2277 + spin_lock(&x->lock);
2278 +- if (nexthdr <= 0) {
2279 ++ if (nexthdr < 0) {
2280 + if (nexthdr == -EBADMSG) {
2281 + xfrm_audit_state_icvfail(x, skb,
2282 + x->type->proto);
2283 +diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
2284 +index b226b230e8bf..80760a753d72 100644
2285 +--- a/net/xfrm/xfrm_output.c
2286 ++++ b/net/xfrm/xfrm_output.c
2287 +@@ -236,18 +236,20 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb)
2288 + xfrm_state_hold(x);
2289 +
2290 + if (skb_is_gso(skb)) {
2291 +- skb_shinfo(skb)->gso_type |= SKB_GSO_ESP;
2292 ++ if (skb->inner_protocol)
2293 ++ return xfrm_output_gso(net, sk, skb);
2294 +
2295 +- return xfrm_output2(net, sk, skb);
2296 ++ skb_shinfo(skb)->gso_type |= SKB_GSO_ESP;
2297 ++ goto out;
2298 + }
2299 +
2300 + if (x->xso.dev && x->xso.dev->features & NETIF_F_HW_ESP_TX_CSUM)
2301 + goto out;
2302 ++ } else {
2303 ++ if (skb_is_gso(skb))
2304 ++ return xfrm_output_gso(net, sk, skb);
2305 + }
2306 +
2307 +- if (skb_is_gso(skb))
2308 +- return xfrm_output_gso(net, sk, skb);
2309 +-
2310 + if (skb->ip_summed == CHECKSUM_PARTIAL) {
2311 + err = skb_checksum_help(skb);
2312 + if (err) {
2313 +@@ -284,7 +286,8 @@ void xfrm_local_error(struct sk_buff *skb, int mtu)
2314 +
2315 + if (skb->protocol == htons(ETH_P_IP))
2316 + proto = AF_INET;
2317 +- else if (skb->protocol == htons(ETH_P_IPV6))
2318 ++ else if (skb->protocol == htons(ETH_P_IPV6) &&
2319 ++ skb->sk->sk_family == AF_INET6)
2320 + proto = AF_INET6;
2321 + else
2322 + return;
2323 +diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
2324 +index f76bb5237df3..f8fd0aebf771 100644
2325 +--- a/net/xfrm/xfrm_policy.c
2326 ++++ b/net/xfrm/xfrm_policy.c
2327 +@@ -722,12 +722,7 @@ static void xfrm_policy_requeue(struct xfrm_policy *old,
2328 + static bool xfrm_policy_mark_match(struct xfrm_policy *policy,
2329 + struct xfrm_policy *pol)
2330 + {
2331 +- u32 mark = policy->mark.v & policy->mark.m;
2332 +-
2333 +- if (policy->mark.v == pol->mark.v && policy->mark.m == pol->mark.m)
2334 +- return true;
2335 +-
2336 +- if ((mark & pol->mark.m) == pol->mark.v &&
2337 ++ if (policy->mark.v == pol->mark.v &&
2338 + policy->priority == pol->priority)
2339 + return true;
2340 +
2341 +diff --git a/samples/bpf/lwt_len_hist_user.c b/samples/bpf/lwt_len_hist_user.c
2342 +index 7fcb94c09112..965108527a4f 100644
2343 +--- a/samples/bpf/lwt_len_hist_user.c
2344 ++++ b/samples/bpf/lwt_len_hist_user.c
2345 +@@ -15,8 +15,6 @@
2346 + #define MAX_INDEX 64
2347 + #define MAX_STARS 38
2348 +
2349 +-char bpf_log_buf[BPF_LOG_BUF_SIZE];
2350 +-
2351 + static void stars(char *str, long val, long max, int width)
2352 + {
2353 + int i;
2354 +diff --git a/security/commoncap.c b/security/commoncap.c
2355 +index ae26ef006988..ac031fa39190 100644
2356 +--- a/security/commoncap.c
2357 ++++ b/security/commoncap.c
2358 +@@ -711,6 +711,7 @@ int cap_bprm_set_creds(struct linux_binprm *bprm)
2359 + int ret;
2360 + kuid_t root_uid;
2361 +
2362 ++ new->cap_ambient = old->cap_ambient;
2363 + if (WARN_ON(!cap_ambient_invariant_ok(old)))
2364 + return -EPERM;
2365 +
2366 +diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
2367 +index a73baa1242be..727219f40201 100644
2368 +--- a/sound/core/hwdep.c
2369 ++++ b/sound/core/hwdep.c
2370 +@@ -229,14 +229,14 @@ static int snd_hwdep_dsp_load(struct snd_hwdep *hw,
2371 + if (copy_from_user(&info, _info, sizeof(info)))
2372 + return -EFAULT;
2373 + /* check whether the dsp was already loaded */
2374 +- if (hw->dsp_loaded & (1 << info.index))
2375 ++ if (hw->dsp_loaded & (1u << info.index))
2376 + return -EBUSY;
2377 + if (!access_ok(VERIFY_READ, info.image, info.length))
2378 + return -EFAULT;
2379 + err = hw->ops.dsp_load(hw, &info);
2380 + if (err < 0)
2381 + return err;
2382 +- hw->dsp_loaded |= (1 << info.index);
2383 ++ hw->dsp_loaded |= (1u << info.index);
2384 + return 0;
2385 + }
2386 +
2387 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
2388 +index c4e97b3ba1dd..5be3c926364e 100644
2389 +--- a/sound/pci/hda/patch_realtek.c
2390 ++++ b/sound/pci/hda/patch_realtek.c
2391 +@@ -341,6 +341,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec)
2392 + case 0x10ec0282:
2393 + case 0x10ec0283:
2394 + case 0x10ec0286:
2395 ++ case 0x10ec0287:
2396 + case 0x10ec0288:
2397 + case 0x10ec0285:
2398 + case 0x10ec0298:
2399 +@@ -7290,6 +7291,7 @@ static int patch_alc269(struct hda_codec *codec)
2400 + case 0x10ec0215:
2401 + case 0x10ec0245:
2402 + case 0x10ec0285:
2403 ++ case 0x10ec0287:
2404 + case 0x10ec0289:
2405 + spec->codec_variant = ALC269_TYPE_ALC215;
2406 + spec->gen.mixer_nid = 0;
2407 +@@ -8389,6 +8391,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = {
2408 + HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
2409 + HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
2410 + HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
2411 ++ HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
2412 + HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
2413 + HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
2414 + HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
2415 +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
2416 +index 7b75208d5cea..dbbc5609b453 100644
2417 +--- a/sound/usb/mixer.c
2418 ++++ b/sound/usb/mixer.c
2419 +@@ -986,6 +986,14 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval,
2420 + cval->res = 384;
2421 + }
2422 + break;
2423 ++ case USB_ID(0x0495, 0x3042): /* ESS Technology Asus USB DAC */
2424 ++ if ((strstr(kctl->id.name, "Playback Volume") != NULL) ||
2425 ++ strstr(kctl->id.name, "Capture Volume") != NULL) {
2426 ++ cval->min >>= 8;
2427 ++ cval->max = 0;
2428 ++ cval->res = 1;
2429 ++ }
2430 ++ break;
2431 + }
2432 + }
2433 +