Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:4.19 commit in: /
Date: Wed, 03 Jun 2020 11:41:23
Message-Id: 1591184460.dfe0c2ff7fdae9e0680e678931049d7b1df3d35d.mpagano@gentoo
1 commit: dfe0c2ff7fdae9e0680e678931049d7b1df3d35d
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 3 11:41:00 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Jun 3 11:41:00 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=dfe0c2ff
7
8 Linux patch 4.19.126
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1125_linux-4.19.126.patch | 3160 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 3164 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index a36c8a4..4d5b261 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -539,6 +539,10 @@ Patch: 1124_linux-4.19.125.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.19.125
23
24 +Patch: 1125_linux-4.19.126.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.19.126
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/1125_linux-4.19.126.patch b/1125_linux-4.19.126.patch
33 new file mode 100644
34 index 0000000..6cd993d
35 --- /dev/null
36 +++ b/1125_linux-4.19.126.patch
37 @@ -0,0 +1,3160 @@
38 +diff --git a/Makefile b/Makefile
39 +index 93c63bda7115..f8da10c40271 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 4
45 + PATCHLEVEL = 19
46 +-SUBLEVEL = 125
47 ++SUBLEVEL = 126
48 + EXTRAVERSION =
49 + NAME = "People's Front"
50 +
51 +diff --git a/arch/arm/boot/compressed/vmlinux.lds.S b/arch/arm/boot/compressed/vmlinux.lds.S
52 +index 2b963d8e76dd..89a8f7588c78 100644
53 +--- a/arch/arm/boot/compressed/vmlinux.lds.S
54 ++++ b/arch/arm/boot/compressed/vmlinux.lds.S
55 +@@ -46,7 +46,7 @@ SECTIONS
56 + }
57 + .table : ALIGN(4) {
58 + _table_start = .;
59 +- LONG(ZIMAGE_MAGIC(2))
60 ++ LONG(ZIMAGE_MAGIC(4))
61 + LONG(ZIMAGE_MAGIC(0x5a534c4b))
62 + LONG(ZIMAGE_MAGIC(__piggy_size_addr - _start))
63 + LONG(ZIMAGE_MAGIC(_kernel_bss_size))
64 +diff --git a/arch/arm/boot/dts/bcm-hr2.dtsi b/arch/arm/boot/dts/bcm-hr2.dtsi
65 +index e4d49731287f..e35398cc60a0 100644
66 +--- a/arch/arm/boot/dts/bcm-hr2.dtsi
67 ++++ b/arch/arm/boot/dts/bcm-hr2.dtsi
68 +@@ -75,7 +75,7 @@
69 + timer@20200 {
70 + compatible = "arm,cortex-a9-global-timer";
71 + reg = <0x20200 0x100>;
72 +- interrupts = <GIC_PPI 11 IRQ_TYPE_LEVEL_HIGH>;
73 ++ interrupts = <GIC_PPI 11 IRQ_TYPE_EDGE_RISING>;
74 + clocks = <&periph_clk>;
75 + };
76 +
77 +@@ -83,7 +83,7 @@
78 + compatible = "arm,cortex-a9-twd-timer";
79 + reg = <0x20600 0x20>;
80 + interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(1) |
81 +- IRQ_TYPE_LEVEL_HIGH)>;
82 ++ IRQ_TYPE_EDGE_RISING)>;
83 + clocks = <&periph_clk>;
84 + };
85 +
86 +@@ -91,7 +91,7 @@
87 + compatible = "arm,cortex-a9-twd-wdt";
88 + reg = <0x20620 0x20>;
89 + interrupts = <GIC_PPI 14 (GIC_CPU_MASK_SIMPLE(1) |
90 +- IRQ_TYPE_LEVEL_HIGH)>;
91 ++ IRQ_TYPE_EDGE_RISING)>;
92 + clocks = <&periph_clk>;
93 + };
94 +
95 +diff --git a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
96 +index 5fcadb9cf992..9f7145b1cc5e 100644
97 +--- a/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
98 ++++ b/arch/arm/boot/dts/bcm2835-rpi-zero-w.dts
99 +@@ -25,7 +25,7 @@
100 +
101 + leds {
102 + act {
103 +- gpios = <&gpio 47 GPIO_ACTIVE_HIGH>;
104 ++ gpios = <&gpio 47 GPIO_ACTIVE_LOW>;
105 + };
106 + };
107 +
108 +diff --git a/arch/arm/boot/dts/imx6q-b450v3.dts b/arch/arm/boot/dts/imx6q-b450v3.dts
109 +index 3ec58500e9c2..25bf45659737 100644
110 +--- a/arch/arm/boot/dts/imx6q-b450v3.dts
111 ++++ b/arch/arm/boot/dts/imx6q-b450v3.dts
112 +@@ -65,13 +65,6 @@
113 + };
114 + };
115 +
116 +-&clks {
117 +- assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
118 +- <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
119 +- assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
120 +- <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
121 +-};
122 +-
123 + &ldb {
124 + status = "okay";
125 +
126 +diff --git a/arch/arm/boot/dts/imx6q-b650v3.dts b/arch/arm/boot/dts/imx6q-b650v3.dts
127 +index 5650a9b11091..0326711a8700 100644
128 +--- a/arch/arm/boot/dts/imx6q-b650v3.dts
129 ++++ b/arch/arm/boot/dts/imx6q-b650v3.dts
130 +@@ -65,13 +65,6 @@
131 + };
132 + };
133 +
134 +-&clks {
135 +- assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
136 +- <&clks IMX6QDL_CLK_LDB_DI1_SEL>;
137 +- assigned-clock-parents = <&clks IMX6QDL_CLK_PLL3_USB_OTG>,
138 +- <&clks IMX6QDL_CLK_PLL3_USB_OTG>;
139 +-};
140 +-
141 + &ldb {
142 + status = "okay";
143 +
144 +diff --git a/arch/arm/boot/dts/imx6q-b850v3.dts b/arch/arm/boot/dts/imx6q-b850v3.dts
145 +index 044a5bebe1c5..612f782ddaaa 100644
146 +--- a/arch/arm/boot/dts/imx6q-b850v3.dts
147 ++++ b/arch/arm/boot/dts/imx6q-b850v3.dts
148 +@@ -53,17 +53,6 @@
149 + };
150 + };
151 +
152 +-&clks {
153 +- assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
154 +- <&clks IMX6QDL_CLK_LDB_DI1_SEL>,
155 +- <&clks IMX6QDL_CLK_IPU1_DI0_PRE_SEL>,
156 +- <&clks IMX6QDL_CLK_IPU2_DI0_PRE_SEL>;
157 +- assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
158 +- <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
159 +- <&clks IMX6QDL_CLK_PLL2_PFD2_396M>,
160 +- <&clks IMX6QDL_CLK_PLL2_PFD2_396M>;
161 +-};
162 +-
163 + &ldb {
164 + fsl,dual-channel;
165 + status = "okay";
166 +diff --git a/arch/arm/boot/dts/imx6q-bx50v3.dtsi b/arch/arm/boot/dts/imx6q-bx50v3.dtsi
167 +index d3cba09be0cb..c1f554348187 100644
168 +--- a/arch/arm/boot/dts/imx6q-bx50v3.dtsi
169 ++++ b/arch/arm/boot/dts/imx6q-bx50v3.dtsi
170 +@@ -391,3 +391,18 @@
171 + #interrupt-cells = <1>;
172 + };
173 + };
174 ++
175 ++&clks {
176 ++ assigned-clocks = <&clks IMX6QDL_CLK_LDB_DI0_SEL>,
177 ++ <&clks IMX6QDL_CLK_LDB_DI1_SEL>,
178 ++ <&clks IMX6QDL_CLK_IPU1_DI0_PRE_SEL>,
179 ++ <&clks IMX6QDL_CLK_IPU1_DI1_PRE_SEL>,
180 ++ <&clks IMX6QDL_CLK_IPU2_DI0_PRE_SEL>,
181 ++ <&clks IMX6QDL_CLK_IPU2_DI1_PRE_SEL>;
182 ++ assigned-clock-parents = <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
183 ++ <&clks IMX6QDL_CLK_PLL5_VIDEO_DIV>,
184 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
185 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
186 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>,
187 ++ <&clks IMX6QDL_CLK_PLL2_PFD0_352M>;
188 ++};
189 +diff --git a/arch/arm/boot/dts/rk3036.dtsi b/arch/arm/boot/dts/rk3036.dtsi
190 +index d560fc4051c5..db612271371b 100644
191 +--- a/arch/arm/boot/dts/rk3036.dtsi
192 ++++ b/arch/arm/boot/dts/rk3036.dtsi
193 +@@ -128,7 +128,7 @@
194 + assigned-clocks = <&cru SCLK_GPU>;
195 + assigned-clock-rates = <100000000>;
196 + clocks = <&cru SCLK_GPU>, <&cru SCLK_GPU>;
197 +- clock-names = "core", "bus";
198 ++ clock-names = "bus", "core";
199 + resets = <&cru SRST_GPU>;
200 + status = "disabled";
201 + };
202 +diff --git a/arch/arm/boot/dts/rk3228-evb.dts b/arch/arm/boot/dts/rk3228-evb.dts
203 +index 5670b33fd1bd..aed879db6c15 100644
204 +--- a/arch/arm/boot/dts/rk3228-evb.dts
205 ++++ b/arch/arm/boot/dts/rk3228-evb.dts
206 +@@ -46,7 +46,7 @@
207 + #address-cells = <1>;
208 + #size-cells = <0>;
209 +
210 +- phy: phy@0 {
211 ++ phy: ethernet-phy@0 {
212 + compatible = "ethernet-phy-id1234.d400", "ethernet-phy-ieee802.3-c22";
213 + reg = <0>;
214 + clocks = <&cru SCLK_MAC_PHY>;
215 +diff --git a/arch/arm/boot/dts/rk322x.dtsi b/arch/arm/boot/dts/rk322x.dtsi
216 +index cd8f2a3b0e91..2aa74267ae51 100644
217 +--- a/arch/arm/boot/dts/rk322x.dtsi
218 ++++ b/arch/arm/boot/dts/rk322x.dtsi
219 +@@ -539,7 +539,7 @@
220 + "pp1",
221 + "ppmmu1";
222 + clocks = <&cru ACLK_GPU>, <&cru ACLK_GPU>;
223 +- clock-names = "core", "bus";
224 ++ clock-names = "bus", "core";
225 + resets = <&cru SRST_GPU_A>;
226 + status = "disabled";
227 + };
228 +@@ -944,7 +944,7 @@
229 + };
230 + };
231 +
232 +- spi-0 {
233 ++ spi0 {
234 + spi0_clk: spi0-clk {
235 + rockchip,pins = <0 9 RK_FUNC_2 &pcfg_pull_up>;
236 + };
237 +@@ -962,7 +962,7 @@
238 + };
239 + };
240 +
241 +- spi-1 {
242 ++ spi1 {
243 + spi1_clk: spi1-clk {
244 + rockchip,pins = <0 23 RK_FUNC_2 &pcfg_pull_up>;
245 + };
246 +diff --git a/arch/arm/boot/dts/rk3xxx.dtsi b/arch/arm/boot/dts/rk3xxx.dtsi
247 +index d752dc611fd7..86a0d98d28ff 100644
248 +--- a/arch/arm/boot/dts/rk3xxx.dtsi
249 ++++ b/arch/arm/boot/dts/rk3xxx.dtsi
250 +@@ -84,7 +84,7 @@
251 + compatible = "arm,mali-400";
252 + reg = <0x10090000 0x10000>;
253 + clocks = <&cru ACLK_GPU>, <&cru ACLK_GPU>;
254 +- clock-names = "core", "bus";
255 ++ clock-names = "bus", "core";
256 + assigned-clocks = <&cru ACLK_GPU>;
257 + assigned-clock-rates = <100000000>;
258 + resets = <&cru SRST_GPU>;
259 +diff --git a/arch/arm/include/asm/assembler.h b/arch/arm/include/asm/assembler.h
260 +index 88286dd483ff..1935b580f0e8 100644
261 +--- a/arch/arm/include/asm/assembler.h
262 ++++ b/arch/arm/include/asm/assembler.h
263 +@@ -21,11 +21,11 @@
264 + #endif
265 +
266 + #include <asm/ptrace.h>
267 +-#include <asm/domain.h>
268 + #include <asm/opcodes-virt.h>
269 + #include <asm/asm-offsets.h>
270 + #include <asm/page.h>
271 + #include <asm/thread_info.h>
272 ++#include <asm/uaccess-asm.h>
273 +
274 + #define IOMEM(x) (x)
275 +
276 +@@ -374,9 +374,9 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
277 + .macro usraccoff, instr, reg, ptr, inc, off, cond, abort, t=TUSER()
278 + 9999:
279 + .if \inc == 1
280 +- \instr\cond\()b\()\t\().w \reg, [\ptr, #\off]
281 ++ \instr\()b\t\cond\().w \reg, [\ptr, #\off]
282 + .elseif \inc == 4
283 +- \instr\cond\()\t\().w \reg, [\ptr, #\off]
284 ++ \instr\t\cond\().w \reg, [\ptr, #\off]
285 + .else
286 + .error "Unsupported inc macro argument"
287 + .endif
288 +@@ -415,9 +415,9 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
289 + .rept \rept
290 + 9999:
291 + .if \inc == 1
292 +- \instr\cond\()b\()\t \reg, [\ptr], #\inc
293 ++ \instr\()b\t\cond \reg, [\ptr], #\inc
294 + .elseif \inc == 4
295 +- \instr\cond\()\t \reg, [\ptr], #\inc
296 ++ \instr\t\cond \reg, [\ptr], #\inc
297 + .else
298 + .error "Unsupported inc macro argument"
299 + .endif
300 +@@ -447,79 +447,6 @@ THUMB( orr \reg , \reg , #PSR_T_BIT )
301 + .size \name , . - \name
302 + .endm
303 +
304 +- .macro csdb
305 +-#ifdef CONFIG_THUMB2_KERNEL
306 +- .inst.w 0xf3af8014
307 +-#else
308 +- .inst 0xe320f014
309 +-#endif
310 +- .endm
311 +-
312 +- .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req
313 +-#ifndef CONFIG_CPU_USE_DOMAINS
314 +- adds \tmp, \addr, #\size - 1
315 +- sbcccs \tmp, \tmp, \limit
316 +- bcs \bad
317 +-#ifdef CONFIG_CPU_SPECTRE
318 +- movcs \addr, #0
319 +- csdb
320 +-#endif
321 +-#endif
322 +- .endm
323 +-
324 +- .macro uaccess_mask_range_ptr, addr:req, size:req, limit:req, tmp:req
325 +-#ifdef CONFIG_CPU_SPECTRE
326 +- sub \tmp, \limit, #1
327 +- subs \tmp, \tmp, \addr @ tmp = limit - 1 - addr
328 +- addhs \tmp, \tmp, #1 @ if (tmp >= 0) {
329 +- subhss \tmp, \tmp, \size @ tmp = limit - (addr + size) }
330 +- movlo \addr, #0 @ if (tmp < 0) addr = NULL
331 +- csdb
332 +-#endif
333 +- .endm
334 +-
335 +- .macro uaccess_disable, tmp, isb=1
336 +-#ifdef CONFIG_CPU_SW_DOMAIN_PAN
337 +- /*
338 +- * Whenever we re-enter userspace, the domains should always be
339 +- * set appropriately.
340 +- */
341 +- mov \tmp, #DACR_UACCESS_DISABLE
342 +- mcr p15, 0, \tmp, c3, c0, 0 @ Set domain register
343 +- .if \isb
344 +- instr_sync
345 +- .endif
346 +-#endif
347 +- .endm
348 +-
349 +- .macro uaccess_enable, tmp, isb=1
350 +-#ifdef CONFIG_CPU_SW_DOMAIN_PAN
351 +- /*
352 +- * Whenever we re-enter userspace, the domains should always be
353 +- * set appropriately.
354 +- */
355 +- mov \tmp, #DACR_UACCESS_ENABLE
356 +- mcr p15, 0, \tmp, c3, c0, 0
357 +- .if \isb
358 +- instr_sync
359 +- .endif
360 +-#endif
361 +- .endm
362 +-
363 +- .macro uaccess_save, tmp
364 +-#ifdef CONFIG_CPU_SW_DOMAIN_PAN
365 +- mrc p15, 0, \tmp, c3, c0, 0
366 +- str \tmp, [sp, #SVC_DACR]
367 +-#endif
368 +- .endm
369 +-
370 +- .macro uaccess_restore
371 +-#ifdef CONFIG_CPU_SW_DOMAIN_PAN
372 +- ldr r0, [sp, #SVC_DACR]
373 +- mcr p15, 0, r0, c3, c0, 0
374 +-#endif
375 +- .endm
376 +-
377 + .irp c,,eq,ne,cs,cc,mi,pl,vs,vc,hi,ls,ge,lt,gt,le,hs,lo
378 + .macro ret\c, reg
379 + #if __LINUX_ARM_ARCH__ < 6
380 +diff --git a/arch/arm/include/asm/uaccess-asm.h b/arch/arm/include/asm/uaccess-asm.h
381 +new file mode 100644
382 +index 000000000000..907571fd05c6
383 +--- /dev/null
384 ++++ b/arch/arm/include/asm/uaccess-asm.h
385 +@@ -0,0 +1,117 @@
386 ++/* SPDX-License-Identifier: GPL-2.0-only */
387 ++
388 ++#ifndef __ASM_UACCESS_ASM_H__
389 ++#define __ASM_UACCESS_ASM_H__
390 ++
391 ++#include <asm/asm-offsets.h>
392 ++#include <asm/domain.h>
393 ++#include <asm/memory.h>
394 ++#include <asm/thread_info.h>
395 ++
396 ++ .macro csdb
397 ++#ifdef CONFIG_THUMB2_KERNEL
398 ++ .inst.w 0xf3af8014
399 ++#else
400 ++ .inst 0xe320f014
401 ++#endif
402 ++ .endm
403 ++
404 ++ .macro check_uaccess, addr:req, size:req, limit:req, tmp:req, bad:req
405 ++#ifndef CONFIG_CPU_USE_DOMAINS
406 ++ adds \tmp, \addr, #\size - 1
407 ++ sbcscc \tmp, \tmp, \limit
408 ++ bcs \bad
409 ++#ifdef CONFIG_CPU_SPECTRE
410 ++ movcs \addr, #0
411 ++ csdb
412 ++#endif
413 ++#endif
414 ++ .endm
415 ++
416 ++ .macro uaccess_mask_range_ptr, addr:req, size:req, limit:req, tmp:req
417 ++#ifdef CONFIG_CPU_SPECTRE
418 ++ sub \tmp, \limit, #1
419 ++ subs \tmp, \tmp, \addr @ tmp = limit - 1 - addr
420 ++ addhs \tmp, \tmp, #1 @ if (tmp >= 0) {
421 ++ subshs \tmp, \tmp, \size @ tmp = limit - (addr + size) }
422 ++ movlo \addr, #0 @ if (tmp < 0) addr = NULL
423 ++ csdb
424 ++#endif
425 ++ .endm
426 ++
427 ++ .macro uaccess_disable, tmp, isb=1
428 ++#ifdef CONFIG_CPU_SW_DOMAIN_PAN
429 ++ /*
430 ++ * Whenever we re-enter userspace, the domains should always be
431 ++ * set appropriately.
432 ++ */
433 ++ mov \tmp, #DACR_UACCESS_DISABLE
434 ++ mcr p15, 0, \tmp, c3, c0, 0 @ Set domain register
435 ++ .if \isb
436 ++ instr_sync
437 ++ .endif
438 ++#endif
439 ++ .endm
440 ++
441 ++ .macro uaccess_enable, tmp, isb=1
442 ++#ifdef CONFIG_CPU_SW_DOMAIN_PAN
443 ++ /*
444 ++ * Whenever we re-enter userspace, the domains should always be
445 ++ * set appropriately.
446 ++ */
447 ++ mov \tmp, #DACR_UACCESS_ENABLE
448 ++ mcr p15, 0, \tmp, c3, c0, 0
449 ++ .if \isb
450 ++ instr_sync
451 ++ .endif
452 ++#endif
453 ++ .endm
454 ++
455 ++#if defined(CONFIG_CPU_SW_DOMAIN_PAN) || defined(CONFIG_CPU_USE_DOMAINS)
456 ++#define DACR(x...) x
457 ++#else
458 ++#define DACR(x...)
459 ++#endif
460 ++
461 ++ /*
462 ++ * Save the address limit on entry to a privileged exception.
463 ++ *
464 ++ * If we are using the DACR for kernel access by the user accessors
465 ++ * (CONFIG_CPU_USE_DOMAINS=y), always reset the DACR kernel domain
466 ++ * back to client mode, whether or not \disable is set.
467 ++ *
468 ++ * If we are using SW PAN, set the DACR user domain to no access
469 ++ * if \disable is set.
470 ++ */
471 ++ .macro uaccess_entry, tsk, tmp0, tmp1, tmp2, disable
472 ++ ldr \tmp1, [\tsk, #TI_ADDR_LIMIT]
473 ++ mov \tmp2, #TASK_SIZE
474 ++ str \tmp2, [\tsk, #TI_ADDR_LIMIT]
475 ++ DACR( mrc p15, 0, \tmp0, c3, c0, 0)
476 ++ DACR( str \tmp0, [sp, #SVC_DACR])
477 ++ str \tmp1, [sp, #SVC_ADDR_LIMIT]
478 ++ .if \disable && IS_ENABLED(CONFIG_CPU_SW_DOMAIN_PAN)
479 ++ /* kernel=client, user=no access */
480 ++ mov \tmp2, #DACR_UACCESS_DISABLE
481 ++ mcr p15, 0, \tmp2, c3, c0, 0
482 ++ instr_sync
483 ++ .elseif IS_ENABLED(CONFIG_CPU_USE_DOMAINS)
484 ++ /* kernel=client */
485 ++ bic \tmp2, \tmp0, #domain_mask(DOMAIN_KERNEL)
486 ++ orr \tmp2, \tmp2, #domain_val(DOMAIN_KERNEL, DOMAIN_CLIENT)
487 ++ mcr p15, 0, \tmp2, c3, c0, 0
488 ++ instr_sync
489 ++ .endif
490 ++ .endm
491 ++
492 ++ /* Restore the user access state previously saved by uaccess_entry */
493 ++ .macro uaccess_exit, tsk, tmp0, tmp1
494 ++ ldr \tmp1, [sp, #SVC_ADDR_LIMIT]
495 ++ DACR( ldr \tmp0, [sp, #SVC_DACR])
496 ++ str \tmp1, [\tsk, #TI_ADDR_LIMIT]
497 ++ DACR( mcr p15, 0, \tmp0, c3, c0, 0)
498 ++ .endm
499 ++
500 ++#undef DACR
501 ++
502 ++#endif /* __ASM_UACCESS_ASM_H__ */
503 +diff --git a/arch/arm/include/asm/vfpmacros.h b/arch/arm/include/asm/vfpmacros.h
504 +index ef5dfedacd8d..628c336e8e3b 100644
505 +--- a/arch/arm/include/asm/vfpmacros.h
506 ++++ b/arch/arm/include/asm/vfpmacros.h
507 +@@ -29,13 +29,13 @@
508 + ldr \tmp, =elf_hwcap @ may not have MVFR regs
509 + ldr \tmp, [\tmp, #0]
510 + tst \tmp, #HWCAP_VFPD32
511 +- ldcnel p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
512 ++ ldclne p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
513 + addeq \base, \base, #32*4 @ step over unused register space
514 + #else
515 + VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
516 + and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
517 + cmp \tmp, #2 @ 32 x 64bit registers?
518 +- ldceql p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
519 ++ ldcleq p11, cr0, [\base],#32*4 @ FLDMIAD \base!, {d16-d31}
520 + addne \base, \base, #32*4 @ step over unused register space
521 + #endif
522 + #endif
523 +@@ -53,13 +53,13 @@
524 + ldr \tmp, =elf_hwcap @ may not have MVFR regs
525 + ldr \tmp, [\tmp, #0]
526 + tst \tmp, #HWCAP_VFPD32
527 +- stcnel p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
528 ++ stclne p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
529 + addeq \base, \base, #32*4 @ step over unused register space
530 + #else
531 + VFPFMRX \tmp, MVFR0 @ Media and VFP Feature Register 0
532 + and \tmp, \tmp, #MVFR0_A_SIMD_MASK @ A_SIMD field
533 + cmp \tmp, #2 @ 32 x 64bit registers?
534 +- stceql p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
535 ++ stcleq p11, cr0, [\base],#32*4 @ FSTMIAD \base!, {d16-d31}
536 + addne \base, \base, #32*4 @ step over unused register space
537 + #endif
538 + #endif
539 +diff --git a/arch/arm/kernel/entry-armv.S b/arch/arm/kernel/entry-armv.S
540 +index e85a3af9ddeb..89e551eebff1 100644
541 +--- a/arch/arm/kernel/entry-armv.S
542 ++++ b/arch/arm/kernel/entry-armv.S
543 +@@ -30,6 +30,7 @@
544 + #include <asm/unistd.h>
545 + #include <asm/tls.h>
546 + #include <asm/system_info.h>
547 ++#include <asm/uaccess-asm.h>
548 +
549 + #include "entry-header.S"
550 + #include <asm/entry-macro-multi.S>
551 +@@ -182,15 +183,7 @@ ENDPROC(__und_invalid)
552 + stmia r7, {r2 - r6}
553 +
554 + get_thread_info tsk
555 +- ldr r0, [tsk, #TI_ADDR_LIMIT]
556 +- mov r1, #TASK_SIZE
557 +- str r1, [tsk, #TI_ADDR_LIMIT]
558 +- str r0, [sp, #SVC_ADDR_LIMIT]
559 +-
560 +- uaccess_save r0
561 +- .if \uaccess
562 +- uaccess_disable r0
563 +- .endif
564 ++ uaccess_entry tsk, r0, r1, r2, \uaccess
565 +
566 + .if \trace
567 + #ifdef CONFIG_TRACE_IRQFLAGS
568 +diff --git a/arch/arm/kernel/entry-header.S b/arch/arm/kernel/entry-header.S
569 +index 62db1c9746cb..7b595f2d4a28 100644
570 +--- a/arch/arm/kernel/entry-header.S
571 ++++ b/arch/arm/kernel/entry-header.S
572 +@@ -6,6 +6,7 @@
573 + #include <asm/asm-offsets.h>
574 + #include <asm/errno.h>
575 + #include <asm/thread_info.h>
576 ++#include <asm/uaccess-asm.h>
577 + #include <asm/v7m.h>
578 +
579 + @ Bad Abort numbers
580 +@@ -217,9 +218,7 @@
581 + blne trace_hardirqs_off
582 + #endif
583 + .endif
584 +- ldr r1, [sp, #SVC_ADDR_LIMIT]
585 +- uaccess_restore
586 +- str r1, [tsk, #TI_ADDR_LIMIT]
587 ++ uaccess_exit tsk, r0, r1
588 +
589 + #ifndef CONFIG_THUMB2_KERNEL
590 + @ ARM mode SVC restore
591 +@@ -263,9 +262,7 @@
592 + @ on the stack remains correct).
593 + @
594 + .macro svc_exit_via_fiq
595 +- ldr r1, [sp, #SVC_ADDR_LIMIT]
596 +- uaccess_restore
597 +- str r1, [tsk, #TI_ADDR_LIMIT]
598 ++ uaccess_exit tsk, r0, r1
599 + #ifndef CONFIG_THUMB2_KERNEL
600 + @ ARM mode restore
601 + mov r0, sp
602 +diff --git a/arch/arm/lib/bitops.h b/arch/arm/lib/bitops.h
603 +index 93cddab73072..95bd35991288 100644
604 +--- a/arch/arm/lib/bitops.h
605 ++++ b/arch/arm/lib/bitops.h
606 +@@ -7,7 +7,7 @@
607 + ENTRY( \name )
608 + UNWIND( .fnstart )
609 + ands ip, r1, #3
610 +- strneb r1, [ip] @ assert word-aligned
611 ++ strbne r1, [ip] @ assert word-aligned
612 + mov r2, #1
613 + and r3, r0, #31 @ Get bit offset
614 + mov r0, r0, lsr #5
615 +@@ -32,7 +32,7 @@ ENDPROC(\name )
616 + ENTRY( \name )
617 + UNWIND( .fnstart )
618 + ands ip, r1, #3
619 +- strneb r1, [ip] @ assert word-aligned
620 ++ strbne r1, [ip] @ assert word-aligned
621 + mov r2, #1
622 + and r3, r0, #31 @ Get bit offset
623 + mov r0, r0, lsr #5
624 +@@ -62,7 +62,7 @@ ENDPROC(\name )
625 + ENTRY( \name )
626 + UNWIND( .fnstart )
627 + ands ip, r1, #3
628 +- strneb r1, [ip] @ assert word-aligned
629 ++ strbne r1, [ip] @ assert word-aligned
630 + and r2, r0, #31
631 + mov r0, r0, lsr #5
632 + mov r3, #1
633 +@@ -89,7 +89,7 @@ ENDPROC(\name )
634 + ENTRY( \name )
635 + UNWIND( .fnstart )
636 + ands ip, r1, #3
637 +- strneb r1, [ip] @ assert word-aligned
638 ++ strbne r1, [ip] @ assert word-aligned
639 + and r3, r0, #31
640 + mov r0, r0, lsr #5
641 + save_and_disable_irqs ip
642 +diff --git a/arch/arm64/boot/dts/rockchip/rk3328-evb.dts b/arch/arm64/boot/dts/rockchip/rk3328-evb.dts
643 +index 212dd8159da9..d89f3451ace5 100644
644 +--- a/arch/arm64/boot/dts/rockchip/rk3328-evb.dts
645 ++++ b/arch/arm64/boot/dts/rockchip/rk3328-evb.dts
646 +@@ -86,7 +86,7 @@
647 + assigned-clock-rate = <50000000>;
648 + assigned-clocks = <&cru SCLK_MAC2PHY>;
649 + assigned-clock-parents = <&cru SCLK_MAC2PHY_SRC>;
650 +-
651 ++ status = "okay";
652 + };
653 +
654 + &i2c1 {
655 +diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
656 +index 451f00a631c4..f14e8c5c41ac 100644
657 +--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi
658 ++++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi
659 +@@ -1817,10 +1817,10 @@
660 + gpu: gpu@ff9a0000 {
661 + compatible = "rockchip,rk3399-mali", "arm,mali-t860";
662 + reg = <0x0 0xff9a0000 0x0 0x10000>;
663 +- interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH 0>,
664 +- <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH 0>,
665 +- <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH 0>;
666 +- interrupt-names = "gpu", "job", "mmu";
667 ++ interrupts = <GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH 0>,
668 ++ <GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH 0>,
669 ++ <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH 0>;
670 ++ interrupt-names = "job", "mmu", "gpu";
671 + clocks = <&cru ACLK_GPU>;
672 + power-domains = <&power RK3399_PD_GPU>;
673 + status = "disabled";
674 +diff --git a/arch/parisc/mm/init.c b/arch/parisc/mm/init.c
675 +index aae9b0d71c1e..10a52664e29f 100644
676 +--- a/arch/parisc/mm/init.c
677 ++++ b/arch/parisc/mm/init.c
678 +@@ -607,7 +607,7 @@ void __init mem_init(void)
679 + > BITS_PER_LONG);
680 +
681 + high_memory = __va((max_pfn << PAGE_SHIFT));
682 +- set_max_mapnr(page_to_pfn(virt_to_page(high_memory - 1)) + 1);
683 ++ set_max_mapnr(max_low_pfn);
684 + free_all_bootmem();
685 +
686 + #ifdef CONFIG_PA11
687 +diff --git a/arch/riscv/kernel/stacktrace.c b/arch/riscv/kernel/stacktrace.c
688 +index a4b1d94371a0..74b2168d7298 100644
689 +--- a/arch/riscv/kernel/stacktrace.c
690 ++++ b/arch/riscv/kernel/stacktrace.c
691 +@@ -75,7 +75,7 @@ static void notrace walk_stackframe(struct task_struct *task,
692 +
693 + #else /* !CONFIG_FRAME_POINTER */
694 +
695 +-static void notrace walk_stackframe(struct task_struct *task,
696 ++void notrace walk_stackframe(struct task_struct *task,
697 + struct pt_regs *regs, bool (*fn)(unsigned long, void *), void *arg)
698 + {
699 + unsigned long sp, pc;
700 +diff --git a/arch/x86/include/asm/dma.h b/arch/x86/include/asm/dma.h
701 +index 00f7cf45e699..8e95aa4b0d17 100644
702 +--- a/arch/x86/include/asm/dma.h
703 ++++ b/arch/x86/include/asm/dma.h
704 +@@ -74,7 +74,7 @@
705 + #define MAX_DMA_PFN ((16UL * 1024 * 1024) >> PAGE_SHIFT)
706 +
707 + /* 4GB broken PCI/AGP hardware bus master zone */
708 +-#define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT)
709 ++#define MAX_DMA32_PFN (1UL << (32 - PAGE_SHIFT))
710 +
711 + #ifdef CONFIG_X86_32
712 + /* The maximum address that we can perform a DMA transfer to on this platform */
713 +diff --git a/arch/x86/kernel/fpu/xstate.c b/arch/x86/kernel/fpu/xstate.c
714 +index 87a57b7642d3..61c2fb8b1f8e 100644
715 +--- a/arch/x86/kernel/fpu/xstate.c
716 ++++ b/arch/x86/kernel/fpu/xstate.c
717 +@@ -964,18 +964,31 @@ static inline bool xfeatures_mxcsr_quirk(u64 xfeatures)
718 + return true;
719 + }
720 +
721 +-/*
722 +- * This is similar to user_regset_copyout(), but will not add offset to
723 +- * the source data pointer or increment pos, count, kbuf, and ubuf.
724 +- */
725 +-static inline void
726 +-__copy_xstate_to_kernel(void *kbuf, const void *data,
727 +- unsigned int offset, unsigned int size, unsigned int size_total)
728 ++static void fill_gap(unsigned to, void **kbuf, unsigned *pos, unsigned *count)
729 + {
730 +- if (offset < size_total) {
731 +- unsigned int copy = min(size, size_total - offset);
732 ++ if (*pos < to) {
733 ++ unsigned size = to - *pos;
734 ++
735 ++ if (size > *count)
736 ++ size = *count;
737 ++ memcpy(*kbuf, (void *)&init_fpstate.xsave + *pos, size);
738 ++ *kbuf += size;
739 ++ *pos += size;
740 ++ *count -= size;
741 ++ }
742 ++}
743 +
744 +- memcpy(kbuf + offset, data, copy);
745 ++static void copy_part(unsigned offset, unsigned size, void *from,
746 ++ void **kbuf, unsigned *pos, unsigned *count)
747 ++{
748 ++ fill_gap(offset, kbuf, pos, count);
749 ++ if (size > *count)
750 ++ size = *count;
751 ++ if (size) {
752 ++ memcpy(*kbuf, from, size);
753 ++ *kbuf += size;
754 ++ *pos += size;
755 ++ *count -= size;
756 + }
757 + }
758 +
759 +@@ -988,8 +1001,9 @@ __copy_xstate_to_kernel(void *kbuf, const void *data,
760 + */
761 + int copy_xstate_to_kernel(void *kbuf, struct xregs_state *xsave, unsigned int offset_start, unsigned int size_total)
762 + {
763 +- unsigned int offset, size;
764 + struct xstate_header header;
765 ++ const unsigned off_mxcsr = offsetof(struct fxregs_state, mxcsr);
766 ++ unsigned count = size_total;
767 + int i;
768 +
769 + /*
770 +@@ -1005,46 +1019,42 @@ int copy_xstate_to_kernel(void *kbuf, struct xregs_state *xsave, unsigned int of
771 + header.xfeatures = xsave->header.xfeatures;
772 + header.xfeatures &= ~XFEATURE_MASK_SUPERVISOR;
773 +
774 ++ if (header.xfeatures & XFEATURE_MASK_FP)
775 ++ copy_part(0, off_mxcsr,
776 ++ &xsave->i387, &kbuf, &offset_start, &count);
777 ++ if (header.xfeatures & (XFEATURE_MASK_SSE | XFEATURE_MASK_YMM))
778 ++ copy_part(off_mxcsr, MXCSR_AND_FLAGS_SIZE,
779 ++ &xsave->i387.mxcsr, &kbuf, &offset_start, &count);
780 ++ if (header.xfeatures & XFEATURE_MASK_FP)
781 ++ copy_part(offsetof(struct fxregs_state, st_space), 128,
782 ++ &xsave->i387.st_space, &kbuf, &offset_start, &count);
783 ++ if (header.xfeatures & XFEATURE_MASK_SSE)
784 ++ copy_part(xstate_offsets[XFEATURE_MASK_SSE], 256,
785 ++ &xsave->i387.xmm_space, &kbuf, &offset_start, &count);
786 ++ /*
787 ++ * Fill xsave->i387.sw_reserved value for ptrace frame:
788 ++ */
789 ++ copy_part(offsetof(struct fxregs_state, sw_reserved), 48,
790 ++ xstate_fx_sw_bytes, &kbuf, &offset_start, &count);
791 + /*
792 + * Copy xregs_state->header:
793 + */
794 +- offset = offsetof(struct xregs_state, header);
795 +- size = sizeof(header);
796 +-
797 +- __copy_xstate_to_kernel(kbuf, &header, offset, size, size_total);
798 ++ copy_part(offsetof(struct xregs_state, header), sizeof(header),
799 ++ &header, &kbuf, &offset_start, &count);
800 +
801 +- for (i = 0; i < XFEATURE_MAX; i++) {
802 ++ for (i = FIRST_EXTENDED_XFEATURE; i < XFEATURE_MAX; i++) {
803 + /*
804 + * Copy only in-use xstates:
805 + */
806 + if ((header.xfeatures >> i) & 1) {
807 + void *src = __raw_xsave_addr(xsave, 1 << i);
808 +
809 +- offset = xstate_offsets[i];
810 +- size = xstate_sizes[i];
811 +-
812 +- /* The next component has to fit fully into the output buffer: */
813 +- if (offset + size > size_total)
814 +- break;
815 +-
816 +- __copy_xstate_to_kernel(kbuf, src, offset, size, size_total);
817 ++ copy_part(xstate_offsets[i], xstate_sizes[i],
818 ++ src, &kbuf, &offset_start, &count);
819 + }
820 +
821 + }
822 +-
823 +- if (xfeatures_mxcsr_quirk(header.xfeatures)) {
824 +- offset = offsetof(struct fxregs_state, mxcsr);
825 +- size = MXCSR_AND_FLAGS_SIZE;
826 +- __copy_xstate_to_kernel(kbuf, &xsave->i387.mxcsr, offset, size, size_total);
827 +- }
828 +-
829 +- /*
830 +- * Fill xsave->i387.sw_reserved value for ptrace frame:
831 +- */
832 +- offset = offsetof(struct fxregs_state, sw_reserved);
833 +- size = sizeof(xstate_fx_sw_bytes);
834 +-
835 +- __copy_xstate_to_kernel(kbuf, xstate_fx_sw_bytes, offset, size, size_total);
836 ++ fill_gap(size_total, &kbuf, &offset_start, &count);
837 +
838 + return 0;
839 + }
840 +diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c
841 +index 1587f4ac6821..1e0cc96306dd 100644
842 +--- a/drivers/crypto/chelsio/chtls/chtls_io.c
843 ++++ b/drivers/crypto/chelsio/chtls/chtls_io.c
844 +@@ -686,7 +686,7 @@ int chtls_push_frames(struct chtls_sock *csk, int comp)
845 + make_tx_data_wr(sk, skb, immdlen, len,
846 + credits_needed, completion);
847 + tp->snd_nxt += len;
848 +- tp->lsndtime = tcp_time_stamp(tp);
849 ++ tp->lsndtime = tcp_jiffies32;
850 + if (completion)
851 + ULP_SKB_CB(skb)->flags &= ~ULPCB_FLAG_NEED_HDR;
852 + } else {
853 +diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
854 +index a09d2f9ebacc..695c19901eff 100644
855 +--- a/drivers/gpio/gpio-exar.c
856 ++++ b/drivers/gpio/gpio-exar.c
857 +@@ -148,8 +148,10 @@ static int gpio_exar_probe(struct platform_device *pdev)
858 + mutex_init(&exar_gpio->lock);
859 +
860 + index = ida_simple_get(&ida_index, 0, 0, GFP_KERNEL);
861 +- if (index < 0)
862 +- goto err_destroy;
863 ++ if (index < 0) {
864 ++ ret = index;
865 ++ goto err_mutex_destroy;
866 ++ }
867 +
868 + sprintf(exar_gpio->name, "exar_gpio%d", index);
869 + exar_gpio->gpio_chip.label = exar_gpio->name;
870 +@@ -176,6 +178,7 @@ static int gpio_exar_probe(struct platform_device *pdev)
871 +
872 + err_destroy:
873 + ida_simple_remove(&ida_index, index);
874 ++err_mutex_destroy:
875 + mutex_destroy(&exar_gpio->lock);
876 + return ret;
877 + }
878 +diff --git a/drivers/gpio/gpio-tegra.c b/drivers/gpio/gpio-tegra.c
879 +index 47dbd19751d0..57903501821e 100644
880 +--- a/drivers/gpio/gpio-tegra.c
881 ++++ b/drivers/gpio/gpio-tegra.c
882 +@@ -357,6 +357,7 @@ static void tegra_gpio_irq_shutdown(struct irq_data *d)
883 + struct tegra_gpio_info *tgi = bank->tgi;
884 + unsigned int gpio = d->hwirq;
885 +
886 ++ tegra_gpio_irq_mask(d);
887 + gpiochip_unlock_as_irq(&tgi->gc, gpio);
888 + }
889 +
890 +diff --git a/drivers/infiniband/core/rdma_core.c b/drivers/infiniband/core/rdma_core.c
891 +index bf937fec50dc..5819a2fb027d 100644
892 +--- a/drivers/infiniband/core/rdma_core.c
893 ++++ b/drivers/infiniband/core/rdma_core.c
894 +@@ -158,9 +158,9 @@ static int uverbs_destroy_uobject(struct ib_uobject *uobj,
895 + uobj->context = NULL;
896 +
897 + /*
898 +- * For DESTROY the usecnt is held write locked, the caller is expected
899 +- * to put it unlock and put the object when done with it. Only DESTROY
900 +- * can remove the IDR handle.
901 ++ * For DESTROY the usecnt is not changed, the caller is expected to
902 ++ * manage it via uobj_put_destroy(). Only DESTROY can remove the IDR
903 ++ * handle.
904 + */
905 + if (reason != RDMA_REMOVE_DESTROY)
906 + atomic_set(&uobj->usecnt, 0);
907 +@@ -192,7 +192,7 @@ static int uverbs_destroy_uobject(struct ib_uobject *uobj,
908 + /*
909 + * This calls uverbs_destroy_uobject() using the RDMA_REMOVE_DESTROY
910 + * sequence. It should only be used from command callbacks. On success the
911 +- * caller must pair this with rdma_lookup_put_uobject(LOOKUP_WRITE). This
912 ++ * caller must pair this with uobj_put_destroy(). This
913 + * version requires the caller to have already obtained an
914 + * LOOKUP_DESTROY uobject kref.
915 + */
916 +@@ -203,6 +203,13 @@ int uobj_destroy(struct ib_uobject *uobj)
917 +
918 + down_read(&ufile->hw_destroy_rwsem);
919 +
920 ++ /*
921 ++ * Once the uobject is destroyed by RDMA_REMOVE_DESTROY then it is left
922 ++ * write locked as the callers put it back with UVERBS_LOOKUP_DESTROY.
923 ++ * This is because any other concurrent thread can still see the object
924 ++ * in the xarray due to RCU. Leaving it locked ensures nothing else will
925 ++ * touch it.
926 ++ */
927 + ret = uverbs_try_lock_object(uobj, UVERBS_LOOKUP_WRITE);
928 + if (ret)
929 + goto out_unlock;
930 +@@ -221,7 +228,7 @@ out_unlock:
931 + /*
932 + * uobj_get_destroy destroys the HW object and returns a handle to the uobj
933 + * with a NULL object pointer. The caller must pair this with
934 +- * uverbs_put_destroy.
935 ++ * uobj_put_destroy().
936 + */
937 + struct ib_uobject *__uobj_get_destroy(const struct uverbs_api_object *obj,
938 + u32 id, struct ib_uverbs_file *ufile)
939 +@@ -256,7 +263,7 @@ int __uobj_perform_destroy(const struct uverbs_api_object *obj, u32 id,
940 + if (IS_ERR(uobj))
941 + return PTR_ERR(uobj);
942 +
943 +- rdma_lookup_put_uobject(uobj, UVERBS_LOOKUP_WRITE);
944 ++ uobj_put_destroy(uobj);
945 + return success_res;
946 + }
947 +
948 +diff --git a/drivers/infiniband/hw/i40iw/i40iw_cm.c b/drivers/infiniband/hw/i40iw/i40iw_cm.c
949 +index 771eb6bd0785..4321b9e3dbb4 100644
950 +--- a/drivers/infiniband/hw/i40iw/i40iw_cm.c
951 ++++ b/drivers/infiniband/hw/i40iw/i40iw_cm.c
952 +@@ -1984,7 +1984,6 @@ static int i40iw_addr_resolve_neigh(struct i40iw_device *iwdev,
953 + struct rtable *rt;
954 + struct neighbour *neigh;
955 + int rc = arpindex;
956 +- struct net_device *netdev = iwdev->netdev;
957 + __be32 dst_ipaddr = htonl(dst_ip);
958 + __be32 src_ipaddr = htonl(src_ip);
959 +
960 +@@ -1994,9 +1993,6 @@ static int i40iw_addr_resolve_neigh(struct i40iw_device *iwdev,
961 + return rc;
962 + }
963 +
964 +- if (netif_is_bond_slave(netdev))
965 +- netdev = netdev_master_upper_dev_get(netdev);
966 +-
967 + neigh = dst_neigh_lookup(&rt->dst, &dst_ipaddr);
968 +
969 + rcu_read_lock();
970 +@@ -2062,7 +2058,6 @@ static int i40iw_addr_resolve_neigh_ipv6(struct i40iw_device *iwdev,
971 + {
972 + struct neighbour *neigh;
973 + int rc = arpindex;
974 +- struct net_device *netdev = iwdev->netdev;
975 + struct dst_entry *dst;
976 + struct sockaddr_in6 dst_addr;
977 + struct sockaddr_in6 src_addr;
978 +@@ -2083,9 +2078,6 @@ static int i40iw_addr_resolve_neigh_ipv6(struct i40iw_device *iwdev,
979 + return rc;
980 + }
981 +
982 +- if (netif_is_bond_slave(netdev))
983 +- netdev = netdev_master_upper_dev_get(netdev);
984 +-
985 + neigh = dst_neigh_lookup(dst, dst_addr.sin6_addr.in6_u.u6_addr32);
986 +
987 + rcu_read_lock();
988 +diff --git a/drivers/infiniband/hw/qib/qib_sysfs.c b/drivers/infiniband/hw/qib/qib_sysfs.c
989 +index d831f3e61ae8..2626205780ee 100644
990 +--- a/drivers/infiniband/hw/qib/qib_sysfs.c
991 ++++ b/drivers/infiniband/hw/qib/qib_sysfs.c
992 +@@ -756,7 +756,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
993 + qib_dev_err(dd,
994 + "Skipping linkcontrol sysfs info, (err %d) port %u\n",
995 + ret, port_num);
996 +- goto bail;
997 ++ goto bail_link;
998 + }
999 + kobject_uevent(&ppd->pport_kobj, KOBJ_ADD);
1000 +
1001 +@@ -766,7 +766,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
1002 + qib_dev_err(dd,
1003 + "Skipping sl2vl sysfs info, (err %d) port %u\n",
1004 + ret, port_num);
1005 +- goto bail_link;
1006 ++ goto bail_sl;
1007 + }
1008 + kobject_uevent(&ppd->sl2vl_kobj, KOBJ_ADD);
1009 +
1010 +@@ -776,7 +776,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
1011 + qib_dev_err(dd,
1012 + "Skipping diag_counters sysfs info, (err %d) port %u\n",
1013 + ret, port_num);
1014 +- goto bail_sl;
1015 ++ goto bail_diagc;
1016 + }
1017 + kobject_uevent(&ppd->diagc_kobj, KOBJ_ADD);
1018 +
1019 +@@ -789,7 +789,7 @@ int qib_create_port_files(struct ib_device *ibdev, u8 port_num,
1020 + qib_dev_err(dd,
1021 + "Skipping Congestion Control sysfs info, (err %d) port %u\n",
1022 + ret, port_num);
1023 +- goto bail_diagc;
1024 ++ goto bail_cc;
1025 + }
1026 +
1027 + kobject_uevent(&ppd->pport_cc_kobj, KOBJ_ADD);
1028 +@@ -871,6 +871,7 @@ void qib_verbs_unregister_sysfs(struct qib_devdata *dd)
1029 + &cc_table_bin_attr);
1030 + kobject_put(&ppd->pport_cc_kobj);
1031 + }
1032 ++ kobject_put(&ppd->diagc_kobj);
1033 + kobject_put(&ppd->sl2vl_kobj);
1034 + kobject_put(&ppd->pport_kobj);
1035 + }
1036 +diff --git a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
1037 +index ed99f0a08dc4..0a414c5329ce 100644
1038 +--- a/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
1039 ++++ b/drivers/infiniband/hw/vmw_pvrdma/pvrdma_main.c
1040 +@@ -833,7 +833,7 @@ static int pvrdma_pci_probe(struct pci_dev *pdev,
1041 + !(pci_resource_flags(pdev, 1) & IORESOURCE_MEM)) {
1042 + dev_err(&pdev->dev, "PCI BAR region not MMIO\n");
1043 + ret = -ENOMEM;
1044 +- goto err_free_device;
1045 ++ goto err_disable_pdev;
1046 + }
1047 +
1048 + ret = pci_request_regions(pdev, DRV_NAME);
1049 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib.h b/drivers/infiniband/ulp/ipoib/ipoib.h
1050 +index b22d02c9de90..85267bbf4836 100644
1051 +--- a/drivers/infiniband/ulp/ipoib/ipoib.h
1052 ++++ b/drivers/infiniband/ulp/ipoib/ipoib.h
1053 +@@ -377,8 +377,12 @@ struct ipoib_dev_priv {
1054 + struct ipoib_rx_buf *rx_ring;
1055 +
1056 + struct ipoib_tx_buf *tx_ring;
1057 ++ /* cyclic ring variables for managing tx_ring, for UD only */
1058 + unsigned int tx_head;
1059 + unsigned int tx_tail;
1060 ++ /* cyclic ring variables for counting overall outstanding send WRs */
1061 ++ unsigned int global_tx_head;
1062 ++ unsigned int global_tx_tail;
1063 + struct ib_sge tx_sge[MAX_SKB_FRAGS + 1];
1064 + struct ib_ud_wr tx_wr;
1065 + struct ib_wc send_wc[MAX_SEND_CQE];
1066 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_cm.c b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
1067 +index aa9dcfc36cd3..196f1e6b5396 100644
1068 +--- a/drivers/infiniband/ulp/ipoib/ipoib_cm.c
1069 ++++ b/drivers/infiniband/ulp/ipoib/ipoib_cm.c
1070 +@@ -756,7 +756,8 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
1071 + return;
1072 + }
1073 +
1074 +- if ((priv->tx_head - priv->tx_tail) == ipoib_sendq_size - 1) {
1075 ++ if ((priv->global_tx_head - priv->global_tx_tail) ==
1076 ++ ipoib_sendq_size - 1) {
1077 + ipoib_dbg(priv, "TX ring 0x%x full, stopping kernel net queue\n",
1078 + tx->qp->qp_num);
1079 + netif_stop_queue(dev);
1080 +@@ -786,7 +787,7 @@ void ipoib_cm_send(struct net_device *dev, struct sk_buff *skb, struct ipoib_cm_
1081 + } else {
1082 + netif_trans_update(dev);
1083 + ++tx->tx_head;
1084 +- ++priv->tx_head;
1085 ++ ++priv->global_tx_head;
1086 + }
1087 + }
1088 +
1089 +@@ -820,10 +821,11 @@ void ipoib_cm_handle_tx_wc(struct net_device *dev, struct ib_wc *wc)
1090 + netif_tx_lock(dev);
1091 +
1092 + ++tx->tx_tail;
1093 +- ++priv->tx_tail;
1094 ++ ++priv->global_tx_tail;
1095 +
1096 + if (unlikely(netif_queue_stopped(dev) &&
1097 +- (priv->tx_head - priv->tx_tail) <= ipoib_sendq_size >> 1 &&
1098 ++ ((priv->global_tx_head - priv->global_tx_tail) <=
1099 ++ ipoib_sendq_size >> 1) &&
1100 + test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)))
1101 + netif_wake_queue(dev);
1102 +
1103 +@@ -1233,8 +1235,9 @@ timeout:
1104 + dev_kfree_skb_any(tx_req->skb);
1105 + netif_tx_lock_bh(p->dev);
1106 + ++p->tx_tail;
1107 +- ++priv->tx_tail;
1108 +- if (unlikely(priv->tx_head - priv->tx_tail == ipoib_sendq_size >> 1) &&
1109 ++ ++priv->global_tx_tail;
1110 ++ if (unlikely((priv->global_tx_head - priv->global_tx_tail) <=
1111 ++ ipoib_sendq_size >> 1) &&
1112 + netif_queue_stopped(p->dev) &&
1113 + test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags))
1114 + netif_wake_queue(p->dev);
1115 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_ib.c b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
1116 +index 9006a13af1de..0f2e80f54d33 100644
1117 +--- a/drivers/infiniband/ulp/ipoib/ipoib_ib.c
1118 ++++ b/drivers/infiniband/ulp/ipoib/ipoib_ib.c
1119 +@@ -406,9 +406,11 @@ static void ipoib_ib_handle_tx_wc(struct net_device *dev, struct ib_wc *wc)
1120 + dev_kfree_skb_any(tx_req->skb);
1121 +
1122 + ++priv->tx_tail;
1123 ++ ++priv->global_tx_tail;
1124 +
1125 + if (unlikely(netif_queue_stopped(dev) &&
1126 +- ((priv->tx_head - priv->tx_tail) <= ipoib_sendq_size >> 1) &&
1127 ++ ((priv->global_tx_head - priv->global_tx_tail) <=
1128 ++ ipoib_sendq_size >> 1) &&
1129 + test_bit(IPOIB_FLAG_ADMIN_UP, &priv->flags)))
1130 + netif_wake_queue(dev);
1131 +
1132 +@@ -633,7 +635,8 @@ int ipoib_send(struct net_device *dev, struct sk_buff *skb,
1133 + else
1134 + priv->tx_wr.wr.send_flags &= ~IB_SEND_IP_CSUM;
1135 + /* increase the tx_head after send success, but use it for queue state */
1136 +- if (priv->tx_head - priv->tx_tail == ipoib_sendq_size - 1) {
1137 ++ if ((priv->global_tx_head - priv->global_tx_tail) ==
1138 ++ ipoib_sendq_size - 1) {
1139 + ipoib_dbg(priv, "TX ring full, stopping kernel net queue\n");
1140 + netif_stop_queue(dev);
1141 + }
1142 +@@ -661,6 +664,7 @@ int ipoib_send(struct net_device *dev, struct sk_buff *skb,
1143 +
1144 + rc = priv->tx_head;
1145 + ++priv->tx_head;
1146 ++ ++priv->global_tx_head;
1147 + }
1148 + return rc;
1149 + }
1150 +@@ -807,6 +811,7 @@ int ipoib_ib_dev_stop_default(struct net_device *dev)
1151 + ipoib_dma_unmap_tx(priv, tx_req);
1152 + dev_kfree_skb_any(tx_req->skb);
1153 + ++priv->tx_tail;
1154 ++ ++priv->global_tx_tail;
1155 + }
1156 +
1157 + for (i = 0; i < ipoib_recvq_size; ++i) {
1158 +diff --git a/drivers/infiniband/ulp/ipoib/ipoib_main.c b/drivers/infiniband/ulp/ipoib/ipoib_main.c
1159 +index d8cb5bbe6eb5..6093e8268583 100644
1160 +--- a/drivers/infiniband/ulp/ipoib/ipoib_main.c
1161 ++++ b/drivers/infiniband/ulp/ipoib/ipoib_main.c
1162 +@@ -1188,9 +1188,11 @@ static void ipoib_timeout(struct net_device *dev)
1163 +
1164 + ipoib_warn(priv, "transmit timeout: latency %d msecs\n",
1165 + jiffies_to_msecs(jiffies - dev_trans_start(dev)));
1166 +- ipoib_warn(priv, "queue stopped %d, tx_head %u, tx_tail %u\n",
1167 +- netif_queue_stopped(dev),
1168 +- priv->tx_head, priv->tx_tail);
1169 ++ ipoib_warn(priv,
1170 ++ "queue stopped %d, tx_head %u, tx_tail %u, global_tx_head %u, global_tx_tail %u\n",
1171 ++ netif_queue_stopped(dev), priv->tx_head, priv->tx_tail,
1172 ++ priv->global_tx_head, priv->global_tx_tail);
1173 ++
1174 + /* XXX reset QP, etc. */
1175 + }
1176 +
1177 +@@ -1705,7 +1707,7 @@ static int ipoib_dev_init_default(struct net_device *dev)
1178 + goto out_rx_ring_cleanup;
1179 + }
1180 +
1181 +- /* priv->tx_head, tx_tail & tx_outstanding are already 0 */
1182 ++ /* priv->tx_head, tx_tail and global_tx_tail/head are already 0 */
1183 +
1184 + if (ipoib_transport_dev_init(dev, priv->ca)) {
1185 + pr_warn("%s: ipoib_transport_dev_init failed\n",
1186 +diff --git a/drivers/input/evdev.c b/drivers/input/evdev.c
1187 +index 4263e905cafb..3362dcb3ec0e 100644
1188 +--- a/drivers/input/evdev.c
1189 ++++ b/drivers/input/evdev.c
1190 +@@ -348,20 +348,6 @@ static int evdev_fasync(int fd, struct file *file, int on)
1191 + return fasync_helper(fd, file, on, &client->fasync);
1192 + }
1193 +
1194 +-static int evdev_flush(struct file *file, fl_owner_t id)
1195 +-{
1196 +- struct evdev_client *client = file->private_data;
1197 +- struct evdev *evdev = client->evdev;
1198 +-
1199 +- mutex_lock(&evdev->mutex);
1200 +-
1201 +- if (evdev->exist && !client->revoked)
1202 +- input_flush_device(&evdev->handle, file);
1203 +-
1204 +- mutex_unlock(&evdev->mutex);
1205 +- return 0;
1206 +-}
1207 +-
1208 + static void evdev_free(struct device *dev)
1209 + {
1210 + struct evdev *evdev = container_of(dev, struct evdev, dev);
1211 +@@ -475,6 +461,10 @@ static int evdev_release(struct inode *inode, struct file *file)
1212 + unsigned int i;
1213 +
1214 + mutex_lock(&evdev->mutex);
1215 ++
1216 ++ if (evdev->exist && !client->revoked)
1217 ++ input_flush_device(&evdev->handle, file);
1218 ++
1219 + evdev_ungrab(evdev, client);
1220 + mutex_unlock(&evdev->mutex);
1221 +
1222 +@@ -1336,7 +1326,6 @@ static const struct file_operations evdev_fops = {
1223 + .compat_ioctl = evdev_ioctl_compat,
1224 + #endif
1225 + .fasync = evdev_fasync,
1226 +- .flush = evdev_flush,
1227 + .llseek = no_llseek,
1228 + };
1229 +
1230 +diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
1231 +index aa4e431cbcd3..9adc72d65c63 100644
1232 +--- a/drivers/input/joystick/xpad.c
1233 ++++ b/drivers/input/joystick/xpad.c
1234 +@@ -472,6 +472,16 @@ static const u8 xboxone_fw2015_init[] = {
1235 + 0x05, 0x20, 0x00, 0x01, 0x00
1236 + };
1237 +
1238 ++/*
1239 ++ * This packet is required for Xbox One S (0x045e:0x02ea)
1240 ++ * and Xbox One Elite Series 2 (0x045e:0x0b00) pads to
1241 ++ * initialize the controller that was previously used in
1242 ++ * Bluetooth mode.
1243 ++ */
1244 ++static const u8 xboxone_s_init[] = {
1245 ++ 0x05, 0x20, 0x00, 0x0f, 0x06
1246 ++};
1247 ++
1248 + /*
1249 + * This packet is required for the Titanfall 2 Xbox One pads
1250 + * (0x0e6f:0x0165) to finish initialization and for Hori pads
1251 +@@ -530,6 +540,8 @@ static const struct xboxone_init_packet xboxone_init_packets[] = {
1252 + XBOXONE_INIT_PKT(0x0e6f, 0x0165, xboxone_hori_init),
1253 + XBOXONE_INIT_PKT(0x0f0d, 0x0067, xboxone_hori_init),
1254 + XBOXONE_INIT_PKT(0x0000, 0x0000, xboxone_fw2015_init),
1255 ++ XBOXONE_INIT_PKT(0x045e, 0x02ea, xboxone_s_init),
1256 ++ XBOXONE_INIT_PKT(0x045e, 0x0b00, xboxone_s_init),
1257 + XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init1),
1258 + XBOXONE_INIT_PKT(0x0e6f, 0x0000, xboxone_pdp_init2),
1259 + XBOXONE_INIT_PKT(0x24c6, 0x541a, xboxone_rumblebegin_init),
1260 +diff --git a/drivers/input/keyboard/dlink-dir685-touchkeys.c b/drivers/input/keyboard/dlink-dir685-touchkeys.c
1261 +index 88e321b76397..6fe4062e3ac2 100644
1262 +--- a/drivers/input/keyboard/dlink-dir685-touchkeys.c
1263 ++++ b/drivers/input/keyboard/dlink-dir685-touchkeys.c
1264 +@@ -142,7 +142,7 @@ MODULE_DEVICE_TABLE(of, dir685_tk_of_match);
1265 +
1266 + static struct i2c_driver dir685_tk_i2c_driver = {
1267 + .driver = {
1268 +- .name = "dlin-dir685-touchkeys",
1269 ++ .name = "dlink-dir685-touchkeys",
1270 + .of_match_table = of_match_ptr(dir685_tk_of_match),
1271 + },
1272 + .probe = dir685_tk_probe,
1273 +diff --git a/drivers/input/rmi4/rmi_driver.c b/drivers/input/rmi4/rmi_driver.c
1274 +index 162526a0d463..ac6a20f7afdf 100644
1275 +--- a/drivers/input/rmi4/rmi_driver.c
1276 ++++ b/drivers/input/rmi4/rmi_driver.c
1277 +@@ -208,7 +208,7 @@ static irqreturn_t rmi_irq_fn(int irq, void *dev_id)
1278 +
1279 + if (count) {
1280 + kfree(attn_data.data);
1281 +- attn_data.data = NULL;
1282 ++ drvdata->attn_data.data = NULL;
1283 + }
1284 +
1285 + if (!kfifo_is_empty(&drvdata->attn_fifo))
1286 +@@ -1213,7 +1213,8 @@ static int rmi_driver_probe(struct device *dev)
1287 + if (data->input) {
1288 + rmi_driver_set_input_name(rmi_dev, data->input);
1289 + if (!rmi_dev->xport->input) {
1290 +- if (input_register_device(data->input)) {
1291 ++ retval = input_register_device(data->input);
1292 ++ if (retval) {
1293 + dev_err(dev, "%s: Failed to register input device.\n",
1294 + __func__);
1295 + goto err_destroy_functions;
1296 +diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h
1297 +index 0d0f977a2f39..c4201d1da239 100644
1298 +--- a/drivers/input/serio/i8042-x86ia64io.h
1299 ++++ b/drivers/input/serio/i8042-x86ia64io.h
1300 +@@ -666,6 +666,13 @@ static const struct dmi_system_id __initconst i8042_dmi_reset_table[] = {
1301 + DMI_MATCH(DMI_PRODUCT_NAME, "P65xRP"),
1302 + },
1303 + },
1304 ++ {
1305 ++ /* Lenovo ThinkPad Twist S230u */
1306 ++ .matches = {
1307 ++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"),
1308 ++ DMI_MATCH(DMI_PRODUCT_NAME, "33474HU"),
1309 ++ },
1310 ++ },
1311 + { }
1312 + };
1313 +
1314 +diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c
1315 +index 48304e26f988..d939c1798518 100644
1316 +--- a/drivers/input/touchscreen/usbtouchscreen.c
1317 ++++ b/drivers/input/touchscreen/usbtouchscreen.c
1318 +@@ -195,6 +195,7 @@ static const struct usb_device_id usbtouch_devices[] = {
1319 + #endif
1320 +
1321 + #ifdef CONFIG_TOUCHSCREEN_USB_IRTOUCH
1322 ++ {USB_DEVICE(0x255e, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
1323 + {USB_DEVICE(0x595a, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
1324 + {USB_DEVICE(0x6615, 0x0001), .driver_info = DEVTYPE_IRTOUCH},
1325 + {USB_DEVICE(0x6615, 0x0012), .driver_info = DEVTYPE_IRTOUCH_HIRES},
1326 +diff --git a/drivers/iommu/iommu.c b/drivers/iommu/iommu.c
1327 +index 00e1c908cd8e..85ef6c9bc898 100644
1328 +--- a/drivers/iommu/iommu.c
1329 ++++ b/drivers/iommu/iommu.c
1330 +@@ -392,7 +392,7 @@ struct iommu_group *iommu_group_alloc(void)
1331 + NULL, "%d", group->id);
1332 + if (ret) {
1333 + ida_simple_remove(&iommu_group_ida, group->id);
1334 +- kfree(group);
1335 ++ kobject_put(&group->kobj);
1336 + return ERR_PTR(ret);
1337 + }
1338 +
1339 +diff --git a/drivers/mmc/core/block.c b/drivers/mmc/core/block.c
1340 +index 23bcdbba0cab..c723a1e54b18 100644
1341 +--- a/drivers/mmc/core/block.c
1342 ++++ b/drivers/mmc/core/block.c
1343 +@@ -2485,8 +2485,8 @@ static int mmc_rpmb_chrdev_release(struct inode *inode, struct file *filp)
1344 + struct mmc_rpmb_data *rpmb = container_of(inode->i_cdev,
1345 + struct mmc_rpmb_data, chrdev);
1346 +
1347 +- put_device(&rpmb->dev);
1348 + mmc_blk_put(rpmb->md);
1349 ++ put_device(&rpmb->dev);
1350 +
1351 + return 0;
1352 + }
1353 +diff --git a/drivers/mmc/core/queue.c b/drivers/mmc/core/queue.c
1354 +index 03f3d9c80fba..2a788169cbb8 100644
1355 +--- a/drivers/mmc/core/queue.c
1356 ++++ b/drivers/mmc/core/queue.c
1357 +@@ -108,7 +108,7 @@ static enum blk_eh_timer_return mmc_cqe_timed_out(struct request *req)
1358 + case MMC_ISSUE_DCMD:
1359 + if (host->cqe_ops->cqe_timeout(host, mrq, &recovery_needed)) {
1360 + if (recovery_needed)
1361 +- __mmc_cqe_recovery_notifier(mq);
1362 ++ mmc_cqe_recovery_notifier(mrq);
1363 + return BLK_EH_RESET_TIMER;
1364 + }
1365 + /* The request has gone already */
1366 +@@ -125,18 +125,13 @@ static enum blk_eh_timer_return mmc_mq_timed_out(struct request *req,
1367 + struct request_queue *q = req->q;
1368 + struct mmc_queue *mq = q->queuedata;
1369 + unsigned long flags;
1370 +- int ret;
1371 ++ bool ignore_tout;
1372 +
1373 + spin_lock_irqsave(q->queue_lock, flags);
1374 +-
1375 +- if (mq->recovery_needed || !mq->use_cqe)
1376 +- ret = BLK_EH_RESET_TIMER;
1377 +- else
1378 +- ret = mmc_cqe_timed_out(req);
1379 +-
1380 ++ ignore_tout = mq->recovery_needed || !mq->use_cqe;
1381 + spin_unlock_irqrestore(q->queue_lock, flags);
1382 +
1383 +- return ret;
1384 ++ return ignore_tout ? BLK_EH_RESET_TIMER : mmc_cqe_timed_out(req);
1385 + }
1386 +
1387 + static void mmc_mq_recovery_handler(struct work_struct *work)
1388 +diff --git a/drivers/net/bonding/bond_sysfs_slave.c b/drivers/net/bonding/bond_sysfs_slave.c
1389 +index 4985268e2273..36dee305c687 100644
1390 +--- a/drivers/net/bonding/bond_sysfs_slave.c
1391 ++++ b/drivers/net/bonding/bond_sysfs_slave.c
1392 +@@ -153,8 +153,10 @@ int bond_sysfs_slave_add(struct slave *slave)
1393 +
1394 + err = kobject_init_and_add(&slave->kobj, &slave_ktype,
1395 + &(slave->dev->dev.kobj), "bonding_slave");
1396 +- if (err)
1397 ++ if (err) {
1398 ++ kobject_put(&slave->kobj);
1399 + return err;
1400 ++ }
1401 +
1402 + for (a = slave_attrs; *a; ++a) {
1403 + err = sysfs_create_file(&slave->kobj, &((*a)->attr));
1404 +diff --git a/drivers/net/dsa/mt7530.c b/drivers/net/dsa/mt7530.c
1405 +index 05982e9fb6bb..8b39a211ecb6 100644
1406 +--- a/drivers/net/dsa/mt7530.c
1407 ++++ b/drivers/net/dsa/mt7530.c
1408 +@@ -685,11 +685,8 @@ mt7530_cpu_port_enable(struct mt7530_priv *priv,
1409 + /* Setup the MAC by default for the cpu port */
1410 + mt7530_write(priv, MT7530_PMCR_P(port), PMCR_CPUP_LINK);
1411 +
1412 +- /* Disable auto learning on the cpu port */
1413 +- mt7530_set(priv, MT7530_PSC_P(port), SA_DIS);
1414 +-
1415 +- /* Unknown unicast frame fordwarding to the cpu port */
1416 +- mt7530_set(priv, MT7530_MFC, UNU_FFP(BIT(port)));
1417 ++ /* Unknown multicast frame forwarding to the cpu port */
1418 ++ mt7530_rmw(priv, MT7530_MFC, UNM_FFP_MASK, UNM_FFP(BIT(port)));
1419 +
1420 + /* CPU port gets connected to all user ports of
1421 + * the switch
1422 +@@ -1288,8 +1285,6 @@ mt7530_setup(struct dsa_switch *ds)
1423 + /* Enable and reset MIB counters */
1424 + mt7530_mib_reset(ds);
1425 +
1426 +- mt7530_clear(priv, MT7530_MFC, UNU_FFP_MASK);
1427 +-
1428 + for (i = 0; i < MT7530_NUM_PORTS; i++) {
1429 + /* Disable forwarding by default on all ports */
1430 + mt7530_rmw(priv, MT7530_PCR_P(i), PCR_MATRIX_MASK,
1431 +diff --git a/drivers/net/dsa/mt7530.h b/drivers/net/dsa/mt7530.h
1432 +index ea30f10397aa..403adbe5a4b4 100644
1433 +--- a/drivers/net/dsa/mt7530.h
1434 ++++ b/drivers/net/dsa/mt7530.h
1435 +@@ -34,6 +34,7 @@
1436 + #define MT7530_MFC 0x10
1437 + #define BC_FFP(x) (((x) & 0xff) << 24)
1438 + #define UNM_FFP(x) (((x) & 0xff) << 16)
1439 ++#define UNM_FFP_MASK UNM_FFP(~0)
1440 + #define UNU_FFP(x) (((x) & 0xff) << 8)
1441 + #define UNU_FFP_MASK UNU_FFP(~0)
1442 +
1443 +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
1444 +index dca58d28d82f..ab4d1dacb585 100644
1445 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
1446 ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
1447 +@@ -7177,7 +7177,7 @@ static void __bnxt_close_nic(struct bnxt *bp, bool irq_re_init,
1448 + bnxt_free_skbs(bp);
1449 +
1450 + /* Save ring stats before shutdown */
1451 +- if (bp->bnapi)
1452 ++ if (bp->bnapi && irq_re_init)
1453 + bnxt_get_ring_stats(bp, &bp->net_stats_prev);
1454 + if (irq_re_init) {
1455 + bnxt_free_irq(bp);
1456 +diff --git a/drivers/net/ethernet/freescale/Kconfig b/drivers/net/ethernet/freescale/Kconfig
1457 +index a580a3dcbe59..e9f4326a0afa 100644
1458 +--- a/drivers/net/ethernet/freescale/Kconfig
1459 ++++ b/drivers/net/ethernet/freescale/Kconfig
1460 +@@ -76,6 +76,7 @@ config UCC_GETH
1461 + depends on QUICC_ENGINE
1462 + select FSL_PQ_MDIO
1463 + select PHYLIB
1464 ++ select FIXED_PHY
1465 + ---help---
1466 + This driver supports the Gigabit Ethernet mode of the QUICC Engine,
1467 + which is available on some Freescale SOCs.
1468 +@@ -89,6 +90,7 @@ config GIANFAR
1469 + depends on HAS_DMA
1470 + select FSL_PQ_MDIO
1471 + select PHYLIB
1472 ++ select FIXED_PHY
1473 + select CRC32
1474 + ---help---
1475 + This driver supports the Gigabit TSEC on the MPC83xx, MPC85xx,
1476 +diff --git a/drivers/net/ethernet/freescale/dpaa/Kconfig b/drivers/net/ethernet/freescale/dpaa/Kconfig
1477 +index a654736237a9..8fec41e57178 100644
1478 +--- a/drivers/net/ethernet/freescale/dpaa/Kconfig
1479 ++++ b/drivers/net/ethernet/freescale/dpaa/Kconfig
1480 +@@ -2,6 +2,7 @@ menuconfig FSL_DPAA_ETH
1481 + tristate "DPAA Ethernet"
1482 + depends on FSL_DPAA && FSL_FMAN
1483 + select PHYLIB
1484 ++ select FIXED_PHY
1485 + select FSL_FMAN_MAC
1486 + ---help---
1487 + Data Path Acceleration Architecture Ethernet driver,
1488 +diff --git a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
1489 +index 4b21ae27a9fd..6683409fbd4a 100644
1490 +--- a/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
1491 ++++ b/drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
1492 +@@ -2796,7 +2796,7 @@ static int dpaa_eth_probe(struct platform_device *pdev)
1493 + }
1494 +
1495 + /* Do this here, so we can be verbose early */
1496 +- SET_NETDEV_DEV(net_dev, dev);
1497 ++ SET_NETDEV_DEV(net_dev, dev->parent);
1498 + dev_set_drvdata(dev, net_dev);
1499 +
1500 + priv = netdev_priv(net_dev);
1501 +diff --git a/drivers/net/ethernet/mellanox/mlx4/fw.c b/drivers/net/ethernet/mellanox/mlx4/fw.c
1502 +index 75213046563c..04ebce738db9 100644
1503 +--- a/drivers/net/ethernet/mellanox/mlx4/fw.c
1504 ++++ b/drivers/net/ethernet/mellanox/mlx4/fw.c
1505 +@@ -2731,7 +2731,7 @@ void mlx4_opreq_action(struct work_struct *work)
1506 + if (err) {
1507 + mlx4_err(dev, "Failed to retrieve required operation: %d\n",
1508 + err);
1509 +- return;
1510 ++ goto out;
1511 + }
1512 + MLX4_GET(modifier, outbox, GET_OP_REQ_MODIFIER_OFFSET);
1513 + MLX4_GET(token, outbox, GET_OP_REQ_TOKEN_OFFSET);
1514 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
1515 +index 300456684728..a686082762df 100644
1516 +--- a/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
1517 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/cmd.c
1518 +@@ -835,6 +835,7 @@ static void cmd_work_handler(struct work_struct *work)
1519 + int alloc_ret;
1520 + int cmd_mode;
1521 +
1522 ++ complete(&ent->handling);
1523 + sem = ent->page_queue ? &cmd->pages_sem : &cmd->sem;
1524 + down(sem);
1525 + if (!ent->page_queue) {
1526 +@@ -953,6 +954,11 @@ static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent)
1527 + struct mlx5_cmd *cmd = &dev->cmd;
1528 + int err;
1529 +
1530 ++ if (!wait_for_completion_timeout(&ent->handling, timeout) &&
1531 ++ cancel_work_sync(&ent->work)) {
1532 ++ ent->ret = -ECANCELED;
1533 ++ goto out_err;
1534 ++ }
1535 + if (cmd->mode == CMD_MODE_POLLING || ent->polling) {
1536 + wait_for_completion(&ent->done);
1537 + } else if (!wait_for_completion_timeout(&ent->done, timeout)) {
1538 +@@ -960,12 +966,17 @@ static int wait_func(struct mlx5_core_dev *dev, struct mlx5_cmd_work_ent *ent)
1539 + mlx5_cmd_comp_handler(dev, 1UL << ent->idx, true);
1540 + }
1541 +
1542 ++out_err:
1543 + err = ent->ret;
1544 +
1545 + if (err == -ETIMEDOUT) {
1546 + mlx5_core_warn(dev, "%s(0x%x) timeout. Will cause a leak of a command resource\n",
1547 + mlx5_command_str(msg_to_opcode(ent->in)),
1548 + msg_to_opcode(ent->in));
1549 ++ } else if (err == -ECANCELED) {
1550 ++ mlx5_core_warn(dev, "%s(0x%x) canceled on out of queue timeout.\n",
1551 ++ mlx5_command_str(msg_to_opcode(ent->in)),
1552 ++ msg_to_opcode(ent->in));
1553 + }
1554 + mlx5_core_dbg(dev, "err %d, delivery status %s(%d)\n",
1555 + err, deliv_status_to_str(ent->status), ent->status);
1556 +@@ -1001,6 +1012,7 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in,
1557 + ent->token = token;
1558 + ent->polling = force_polling;
1559 +
1560 ++ init_completion(&ent->handling);
1561 + if (!callback)
1562 + init_completion(&ent->done);
1563 +
1564 +@@ -1020,6 +1032,8 @@ static int mlx5_cmd_invoke(struct mlx5_core_dev *dev, struct mlx5_cmd_msg *in,
1565 + err = wait_func(dev, ent);
1566 + if (err == -ETIMEDOUT)
1567 + goto out;
1568 ++ if (err == -ECANCELED)
1569 ++ goto out_free;
1570 +
1571 + ds = ent->ts2 - ent->ts1;
1572 + op = MLX5_GET(mbox_in, in->first.data, opcode);
1573 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
1574 +index 73dce92c41c4..52d3989bb8e2 100644
1575 +--- a/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
1576 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
1577 +@@ -595,8 +595,9 @@ bool mlx5e_poll_tx_cq(struct mlx5e_cq *cq, int napi_budget)
1578 + void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq)
1579 + {
1580 + struct mlx5e_tx_wqe_info *wi;
1581 ++ u32 nbytes = 0;
1582 ++ u16 ci, npkts = 0;
1583 + struct sk_buff *skb;
1584 +- u16 ci;
1585 + int i;
1586 +
1587 + while (sq->cc != sq->pc) {
1588 +@@ -617,8 +618,11 @@ void mlx5e_free_txqsq_descs(struct mlx5e_txqsq *sq)
1589 + }
1590 +
1591 + dev_kfree_skb_any(skb);
1592 ++ npkts++;
1593 ++ nbytes += wi->num_bytes;
1594 + sq->cc += wi->num_wqebbs;
1595 + }
1596 ++ netdev_tx_completed_queue(sq->txq, npkts, nbytes);
1597 + }
1598 +
1599 + #ifdef CONFIG_MLX5_CORE_IPOIB
1600 +diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
1601 +index b16e0f45d28c..2f6c3353055d 100644
1602 +--- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
1603 ++++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c
1604 +@@ -364,6 +364,12 @@ static void del_sw_ns(struct fs_node *node)
1605 +
1606 + static void del_sw_prio(struct fs_node *node)
1607 + {
1608 ++ struct mlx5_flow_root_namespace *root_ns;
1609 ++ struct mlx5_flow_namespace *ns;
1610 ++
1611 ++ fs_get_obj(ns, node);
1612 ++ root_ns = container_of(ns, struct mlx5_flow_root_namespace, ns);
1613 ++ mutex_destroy(&root_ns->chain_lock);
1614 + kfree(node);
1615 + }
1616 +
1617 +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
1618 +index 5df9b25cab27..1019c9efedea 100644
1619 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
1620 ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
1621 +@@ -3126,6 +3126,7 @@ static void mlxsw_sp_ports_remove(struct mlxsw_sp *mlxsw_sp)
1622 + mlxsw_sp_port_remove(mlxsw_sp, i);
1623 + kfree(mlxsw_sp->port_to_module);
1624 + kfree(mlxsw_sp->ports);
1625 ++ mlxsw_sp->ports = NULL;
1626 + }
1627 +
1628 + static int mlxsw_sp_ports_create(struct mlxsw_sp *mlxsw_sp)
1629 +@@ -3174,6 +3175,7 @@ err_port_module_info_get:
1630 + kfree(mlxsw_sp->port_to_module);
1631 + err_port_to_module_alloc:
1632 + kfree(mlxsw_sp->ports);
1633 ++ mlxsw_sp->ports = NULL;
1634 + return err;
1635 + }
1636 +
1637 +@@ -3228,6 +3230,14 @@ static void mlxsw_sp_port_unsplit_create(struct mlxsw_sp *mlxsw_sp,
1638 + }
1639 + }
1640 +
1641 ++static struct mlxsw_sp_port *
1642 ++mlxsw_sp_port_get_by_local_port(struct mlxsw_sp *mlxsw_sp, u8 local_port)
1643 ++{
1644 ++ if (mlxsw_sp->ports && mlxsw_sp->ports[local_port])
1645 ++ return mlxsw_sp->ports[local_port];
1646 ++ return NULL;
1647 ++}
1648 ++
1649 + static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port,
1650 + unsigned int count,
1651 + struct netlink_ext_ack *extack)
1652 +@@ -3238,7 +3248,7 @@ static int mlxsw_sp_port_split(struct mlxsw_core *mlxsw_core, u8 local_port,
1653 + int i;
1654 + int err;
1655 +
1656 +- mlxsw_sp_port = mlxsw_sp->ports[local_port];
1657 ++ mlxsw_sp_port = mlxsw_sp_port_get_by_local_port(mlxsw_sp, local_port);
1658 + if (!mlxsw_sp_port) {
1659 + dev_err(mlxsw_sp->bus_info->dev, "Port number \"%d\" does not exist\n",
1660 + local_port);
1661 +@@ -3305,7 +3315,7 @@ static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port,
1662 + unsigned int count;
1663 + int i;
1664 +
1665 +- mlxsw_sp_port = mlxsw_sp->ports[local_port];
1666 ++ mlxsw_sp_port = mlxsw_sp_port_get_by_local_port(mlxsw_sp, local_port);
1667 + if (!mlxsw_sp_port) {
1668 + dev_err(mlxsw_sp->bus_info->dev, "Port number \"%d\" does not exist\n",
1669 + local_port);
1670 +diff --git a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
1671 +index 2d4f213e154d..b22c190e001d 100644
1672 +--- a/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
1673 ++++ b/drivers/net/ethernet/mellanox/mlxsw/switchx2.c
1674 +@@ -1289,6 +1289,7 @@ static void mlxsw_sx_ports_remove(struct mlxsw_sx *mlxsw_sx)
1675 + if (mlxsw_sx_port_created(mlxsw_sx, i))
1676 + mlxsw_sx_port_remove(mlxsw_sx, i);
1677 + kfree(mlxsw_sx->ports);
1678 ++ mlxsw_sx->ports = NULL;
1679 + }
1680 +
1681 + static int mlxsw_sx_ports_create(struct mlxsw_sx *mlxsw_sx)
1682 +@@ -1323,6 +1324,7 @@ err_port_module_info_get:
1683 + if (mlxsw_sx_port_created(mlxsw_sx, i))
1684 + mlxsw_sx_port_remove(mlxsw_sx, i);
1685 + kfree(mlxsw_sx->ports);
1686 ++ mlxsw_sx->ports = NULL;
1687 + return err;
1688 + }
1689 +
1690 +@@ -1406,6 +1408,12 @@ static int mlxsw_sx_port_type_set(struct mlxsw_core *mlxsw_core, u8 local_port,
1691 + u8 module, width;
1692 + int err;
1693 +
1694 ++ if (!mlxsw_sx->ports || !mlxsw_sx->ports[local_port]) {
1695 ++ dev_err(mlxsw_sx->bus_info->dev, "Port number \"%d\" does not exist\n",
1696 ++ local_port);
1697 ++ return -EINVAL;
1698 ++ }
1699 ++
1700 + if (new_type == DEVLINK_PORT_TYPE_AUTO)
1701 + return -EOPNOTSUPP;
1702 +
1703 +diff --git a/drivers/net/ethernet/microchip/encx24j600.c b/drivers/net/ethernet/microchip/encx24j600.c
1704 +index f831238d9793..84b6ad76f5bc 100644
1705 +--- a/drivers/net/ethernet/microchip/encx24j600.c
1706 ++++ b/drivers/net/ethernet/microchip/encx24j600.c
1707 +@@ -1075,7 +1075,7 @@ static int encx24j600_spi_probe(struct spi_device *spi)
1708 + if (unlikely(ret)) {
1709 + netif_err(priv, probe, ndev, "Error %d initializing card encx24j600 card\n",
1710 + ret);
1711 +- goto out_free;
1712 ++ goto out_stop;
1713 + }
1714 +
1715 + eidled = encx24j600_read_reg(priv, EIDLED);
1716 +@@ -1093,6 +1093,8 @@ static int encx24j600_spi_probe(struct spi_device *spi)
1717 +
1718 + out_unregister:
1719 + unregister_netdev(priv->ndev);
1720 ++out_stop:
1721 ++ kthread_stop(priv->kworker_task);
1722 + out_free:
1723 + free_netdev(ndev);
1724 +
1725 +@@ -1105,6 +1107,7 @@ static int encx24j600_spi_remove(struct spi_device *spi)
1726 + struct encx24j600_priv *priv = dev_get_drvdata(&spi->dev);
1727 +
1728 + unregister_netdev(priv->ndev);
1729 ++ kthread_stop(priv->kworker_task);
1730 +
1731 + free_netdev(priv->ndev);
1732 +
1733 +diff --git a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
1734 +index a79d84f99102..6ed8294f7df8 100644
1735 +--- a/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
1736 ++++ b/drivers/net/ethernet/qlogic/qlcnic/qlcnic_83xx_hw.c
1737 +@@ -3651,7 +3651,7 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
1738 + ahw->diag_cnt = 0;
1739 + ret = qlcnic_alloc_mbx_args(&cmd, adapter, QLCNIC_CMD_INTRPT_TEST);
1740 + if (ret)
1741 +- goto fail_diag_irq;
1742 ++ goto fail_mbx_args;
1743 +
1744 + if (adapter->flags & QLCNIC_MSIX_ENABLED)
1745 + intrpt_id = ahw->intr_tbl[0].id;
1746 +@@ -3681,6 +3681,8 @@ int qlcnic_83xx_interrupt_test(struct net_device *netdev)
1747 +
1748 + done:
1749 + qlcnic_free_mbx_args(&cmd);
1750 ++
1751 ++fail_mbx_args:
1752 + qlcnic_83xx_diag_free_res(netdev, drv_sds_rings);
1753 +
1754 + fail_diag_irq:
1755 +diff --git a/drivers/net/ethernet/sun/cassini.c b/drivers/net/ethernet/sun/cassini.c
1756 +index 7ec4eb74fe21..d323dd9daccb 100644
1757 +--- a/drivers/net/ethernet/sun/cassini.c
1758 ++++ b/drivers/net/ethernet/sun/cassini.c
1759 +@@ -4971,7 +4971,7 @@ static int cas_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
1760 + cas_cacheline_size)) {
1761 + dev_err(&pdev->dev, "Could not set PCI cache "
1762 + "line size\n");
1763 +- goto err_write_cacheline;
1764 ++ goto err_out_free_res;
1765 + }
1766 + }
1767 + #endif
1768 +@@ -5144,7 +5144,6 @@ err_out_iounmap:
1769 + err_out_free_res:
1770 + pci_release_regions(pdev);
1771 +
1772 +-err_write_cacheline:
1773 + /* Try to restore it in case the error occurred after we
1774 + * set it.
1775 + */
1776 +diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
1777 +index c3cf9ae6d1df..1de97b69ce4e 100644
1778 +--- a/drivers/net/usb/cdc_ether.c
1779 ++++ b/drivers/net/usb/cdc_ether.c
1780 +@@ -821,14 +821,21 @@ static const struct usb_device_id products[] = {
1781 + .driver_info = 0,
1782 + },
1783 +
1784 +-/* Microsoft Surface 3 dock (based on Realtek RTL8153) */
1785 ++/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153) */
1786 + {
1787 + USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x07c6, USB_CLASS_COMM,
1788 + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
1789 + .driver_info = 0,
1790 + },
1791 +
1792 +- /* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */
1793 ++/* Microsoft Surface Ethernet Adapter (based on Realtek RTL8153B) */
1794 ++{
1795 ++ USB_DEVICE_AND_INTERFACE_INFO(MICROSOFT_VENDOR_ID, 0x0927, USB_CLASS_COMM,
1796 ++ USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
1797 ++ .driver_info = 0,
1798 ++},
1799 ++
1800 ++/* TP-LINK UE300 USB 3.0 Ethernet Adapters (based on Realtek RTL8153) */
1801 + {
1802 + USB_DEVICE_AND_INTERFACE_INFO(TPLINK_VENDOR_ID, 0x0601, USB_CLASS_COMM,
1803 + USB_CDC_SUBCLASS_ETHERNET, USB_CDC_PROTO_NONE),
1804 +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
1805 +index 0639178cb009..1b1ec4197830 100644
1806 +--- a/drivers/net/usb/r8152.c
1807 ++++ b/drivers/net/usb/r8152.c
1808 +@@ -5344,6 +5344,7 @@ static const struct usb_device_id rtl8152_table[] = {
1809 + {REALTEK_USB_DEVICE(VENDOR_ID_REALTEK, 0x8153)},
1810 + {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07ab)},
1811 + {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x07c6)},
1812 ++ {REALTEK_USB_DEVICE(VENDOR_ID_MICROSOFT, 0x0927)},
1813 + {REALTEK_USB_DEVICE(VENDOR_ID_SAMSUNG, 0xa101)},
1814 + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x304f)},
1815 + {REALTEK_USB_DEVICE(VENDOR_ID_LENOVO, 0x3062)},
1816 +diff --git a/drivers/usb/dwc3/dwc3-pci.c b/drivers/usb/dwc3/dwc3-pci.c
1817 +index edf7984707b7..b2fd505938a0 100644
1818 +--- a/drivers/usb/dwc3/dwc3-pci.c
1819 ++++ b/drivers/usb/dwc3/dwc3-pci.c
1820 +@@ -112,6 +112,7 @@ static const struct property_entry dwc3_pci_intel_properties[] = {
1821 +
1822 + static const struct property_entry dwc3_pci_mrfld_properties[] = {
1823 + PROPERTY_ENTRY_STRING("dr_mode", "otg"),
1824 ++ PROPERTY_ENTRY_STRING("linux,extcon-name", "mrfld_bcove_pwrsrc"),
1825 + PROPERTY_ENTRY_BOOL("linux,sysdev_is_parent"),
1826 + {}
1827 + };
1828 +diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
1829 +index 37ca0e669bd8..25d417ad9000 100644
1830 +--- a/drivers/usb/gadget/legacy/inode.c
1831 ++++ b/drivers/usb/gadget/legacy/inode.c
1832 +@@ -1360,7 +1360,6 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1833 +
1834 + req->buf = dev->rbuf;
1835 + req->context = NULL;
1836 +- value = -EOPNOTSUPP;
1837 + switch (ctrl->bRequest) {
1838 +
1839 + case USB_REQ_GET_DESCRIPTOR:
1840 +@@ -1783,7 +1782,7 @@ static ssize_t
1841 + dev_config (struct file *fd, const char __user *buf, size_t len, loff_t *ptr)
1842 + {
1843 + struct dev_data *dev = fd->private_data;
1844 +- ssize_t value = len, length = len;
1845 ++ ssize_t value, length = len;
1846 + unsigned total;
1847 + u32 tag;
1848 + char *kbuf;
1849 +diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c
1850 +index e7fd0b5b9234..975dd0dbc252 100644
1851 +--- a/fs/binfmt_elf.c
1852 ++++ b/fs/binfmt_elf.c
1853 +@@ -1766,7 +1766,7 @@ static int fill_thread_core_info(struct elf_thread_core_info *t,
1854 + (!regset->active || regset->active(t->task, regset) > 0)) {
1855 + int ret;
1856 + size_t size = regset_size(t->task, regset);
1857 +- void *data = kmalloc(size, GFP_KERNEL);
1858 ++ void *data = kzalloc(size, GFP_KERNEL);
1859 + if (unlikely(!data))
1860 + return 0;
1861 + ret = regset->get(t->task, regset,
1862 +diff --git a/fs/cachefiles/rdwr.c b/fs/cachefiles/rdwr.c
1863 +index 8a577409d030..f822ac9e3cb0 100644
1864 +--- a/fs/cachefiles/rdwr.c
1865 ++++ b/fs/cachefiles/rdwr.c
1866 +@@ -64,9 +64,9 @@ static int cachefiles_read_waiter(wait_queue_entry_t *wait, unsigned mode,
1867 + object = container_of(op->op.object, struct cachefiles_object, fscache);
1868 + spin_lock(&object->work_lock);
1869 + list_add_tail(&monitor->op_link, &op->to_do);
1870 ++ fscache_enqueue_retrieval(op);
1871 + spin_unlock(&object->work_lock);
1872 +
1873 +- fscache_enqueue_retrieval(op);
1874 + fscache_put_retrieval(op);
1875 + return 0;
1876 + }
1877 +diff --git a/fs/cifs/file.c b/fs/cifs/file.c
1878 +index cfb0d91289ec..128cbd69911b 100644
1879 +--- a/fs/cifs/file.c
1880 ++++ b/fs/cifs/file.c
1881 +@@ -3532,7 +3532,7 @@ cifs_read(struct file *file, char *read_data, size_t read_size, loff_t *offset)
1882 + * than it negotiated since it will refuse the read
1883 + * then.
1884 + */
1885 +- if ((tcon->ses) && !(tcon->ses->capabilities &
1886 ++ if (!(tcon->ses->capabilities &
1887 + tcon->ses->server->vals->cap_large_files)) {
1888 + current_read_size = min_t(uint,
1889 + current_read_size, CIFSMaxBufSize);
1890 +diff --git a/fs/gfs2/quota.c b/fs/gfs2/quota.c
1891 +index 0efae7a0ee80..dd0f9bc13164 100644
1892 +--- a/fs/gfs2/quota.c
1893 ++++ b/fs/gfs2/quota.c
1894 +@@ -1043,8 +1043,7 @@ int gfs2_quota_lock(struct gfs2_inode *ip, kuid_t uid, kgid_t gid)
1895 + u32 x;
1896 + int error = 0;
1897 +
1898 +- if (capable(CAP_SYS_RESOURCE) ||
1899 +- sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
1900 ++ if (sdp->sd_args.ar_quota != GFS2_QUOTA_ON)
1901 + return 0;
1902 +
1903 + error = gfs2_quota_hold(ip, uid, gid);
1904 +diff --git a/fs/gfs2/quota.h b/fs/gfs2/quota.h
1905 +index 836f29480be6..e3a6e2404d11 100644
1906 +--- a/fs/gfs2/quota.h
1907 ++++ b/fs/gfs2/quota.h
1908 +@@ -47,7 +47,8 @@ static inline int gfs2_quota_lock_check(struct gfs2_inode *ip,
1909 + int ret;
1910 +
1911 + ap->allowed = UINT_MAX; /* Assume we are permitted a whole lot */
1912 +- if (sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
1913 ++ if (capable(CAP_SYS_RESOURCE) ||
1914 ++ sdp->sd_args.ar_quota == GFS2_QUOTA_OFF)
1915 + return 0;
1916 + ret = gfs2_quota_lock(ip, NO_UID_QUOTA_CHANGE, NO_GID_QUOTA_CHANGE);
1917 + if (ret)
1918 +diff --git a/include/asm-generic/topology.h b/include/asm-generic/topology.h
1919 +index 238873739550..5aa8705df87e 100644
1920 +--- a/include/asm-generic/topology.h
1921 ++++ b/include/asm-generic/topology.h
1922 +@@ -48,7 +48,7 @@
1923 + #ifdef CONFIG_NEED_MULTIPLE_NODES
1924 + #define cpumask_of_node(node) ((node) == 0 ? cpu_online_mask : cpu_none_mask)
1925 + #else
1926 +- #define cpumask_of_node(node) ((void)node, cpu_online_mask)
1927 ++ #define cpumask_of_node(node) ((void)(node), cpu_online_mask)
1928 + #endif
1929 + #endif
1930 + #ifndef pcibus_to_node
1931 +diff --git a/include/linux/mlx5/driver.h b/include/linux/mlx5/driver.h
1932 +index ae64fced188d..dc89a964c1f3 100644
1933 +--- a/include/linux/mlx5/driver.h
1934 ++++ b/include/linux/mlx5/driver.h
1935 +@@ -902,6 +902,7 @@ struct mlx5_cmd_work_ent {
1936 + struct delayed_work cb_timeout_work;
1937 + void *context;
1938 + int idx;
1939 ++ struct completion handling;
1940 + struct completion done;
1941 + struct mlx5_cmd *cmd;
1942 + struct work_struct work;
1943 +diff --git a/include/linux/mm.h b/include/linux/mm.h
1944 +index 45f10f5896b7..b1092046ebef 100644
1945 +--- a/include/linux/mm.h
1946 ++++ b/include/linux/mm.h
1947 +@@ -602,6 +602,11 @@ static inline void *kvcalloc(size_t n, size_t size, gfp_t flags)
1948 +
1949 + extern void kvfree(const void *addr);
1950 +
1951 ++/*
1952 ++ * Mapcount of compound page as a whole, does not include mapped sub-pages.
1953 ++ *
1954 ++ * Must be called only for compound pages or any their tail sub-pages.
1955 ++ */
1956 + static inline int compound_mapcount(struct page *page)
1957 + {
1958 + VM_BUG_ON_PAGE(!PageCompound(page), page);
1959 +@@ -621,10 +626,16 @@ static inline void page_mapcount_reset(struct page *page)
1960 +
1961 + int __page_mapcount(struct page *page);
1962 +
1963 ++/*
1964 ++ * Mapcount of 0-order page; when compound sub-page, includes
1965 ++ * compound_mapcount().
1966 ++ *
1967 ++ * Result is undefined for pages which cannot be mapped into userspace.
1968 ++ * For example SLAB or special types of pages. See function page_has_type().
1969 ++ * They use this place in struct page differently.
1970 ++ */
1971 + static inline int page_mapcount(struct page *page)
1972 + {
1973 +- VM_BUG_ON_PAGE(PageSlab(page), page);
1974 +-
1975 + if (unlikely(PageCompound(page)))
1976 + return __page_mapcount(page);
1977 + return atomic_read(&page->_mapcount) + 1;
1978 +diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h
1979 +index 833a5b2255ea..ade993809ebc 100644
1980 +--- a/include/linux/netfilter/nf_conntrack_pptp.h
1981 ++++ b/include/linux/netfilter/nf_conntrack_pptp.h
1982 +@@ -5,7 +5,7 @@
1983 +
1984 + #include <linux/netfilter/nf_conntrack_common.h>
1985 +
1986 +-extern const char *const pptp_msg_name[];
1987 ++const char *pptp_msg_name(u_int16_t msg);
1988 +
1989 + /* state of the control session */
1990 + enum pptp_ctrlsess_state {
1991 +diff --git a/include/net/act_api.h b/include/net/act_api.h
1992 +index 0c82d7ea6ee1..c48b750de2fc 100644
1993 +--- a/include/net/act_api.h
1994 ++++ b/include/net/act_api.h
1995 +@@ -67,7 +67,8 @@ static inline void tcf_tm_dump(struct tcf_t *dtm, const struct tcf_t *stm)
1996 + {
1997 + dtm->install = jiffies_to_clock_t(jiffies - stm->install);
1998 + dtm->lastuse = jiffies_to_clock_t(jiffies - stm->lastuse);
1999 +- dtm->firstuse = jiffies_to_clock_t(jiffies - stm->firstuse);
2000 ++ dtm->firstuse = stm->firstuse ?
2001 ++ jiffies_to_clock_t(jiffies - stm->firstuse) : 0;
2002 + dtm->expires = jiffies_to_clock_t(stm->expires);
2003 + }
2004 +
2005 +diff --git a/include/rdma/uverbs_std_types.h b/include/rdma/uverbs_std_types.h
2006 +index 3b00231cc084..62f851569936 100644
2007 +--- a/include/rdma/uverbs_std_types.h
2008 ++++ b/include/rdma/uverbs_std_types.h
2009 +@@ -95,7 +95,7 @@ struct ib_uobject *__uobj_get_destroy(const struct uverbs_api_object *obj,
2010 +
2011 + static inline void uobj_put_destroy(struct ib_uobject *uobj)
2012 + {
2013 +- rdma_lookup_put_uobject(uobj, UVERBS_LOOKUP_WRITE);
2014 ++ rdma_lookup_put_uobject(uobj, UVERBS_LOOKUP_DESTROY);
2015 + }
2016 +
2017 + static inline void uobj_put_read(struct ib_uobject *uobj)
2018 +diff --git a/include/uapi/linux/xfrm.h b/include/uapi/linux/xfrm.h
2019 +index 5f3b9fec7b5f..ff7cfdc6cb44 100644
2020 +--- a/include/uapi/linux/xfrm.h
2021 ++++ b/include/uapi/linux/xfrm.h
2022 +@@ -304,7 +304,7 @@ enum xfrm_attr_type_t {
2023 + XFRMA_PROTO, /* __u8 */
2024 + XFRMA_ADDRESS_FILTER, /* struct xfrm_address_filter */
2025 + XFRMA_PAD,
2026 +- XFRMA_OFFLOAD_DEV, /* struct xfrm_state_offload */
2027 ++ XFRMA_OFFLOAD_DEV, /* struct xfrm_user_offload */
2028 + XFRMA_SET_MARK, /* __u32 */
2029 + XFRMA_SET_MARK_MASK, /* __u32 */
2030 + XFRMA_IF_ID, /* __u32 */
2031 +diff --git a/mm/vmalloc.c b/mm/vmalloc.c
2032 +index 11d0f0b6ec79..1817871b0239 100644
2033 +--- a/mm/vmalloc.c
2034 ++++ b/mm/vmalloc.c
2035 +@@ -1510,7 +1510,7 @@ static void __vunmap(const void *addr, int deallocate_pages)
2036 + addr))
2037 + return;
2038 +
2039 +- area = find_vmap_area((unsigned long)addr)->vm;
2040 ++ area = find_vm_area(addr);
2041 + if (unlikely(!area)) {
2042 + WARN(1, KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n",
2043 + addr);
2044 +diff --git a/net/ax25/af_ax25.c b/net/ax25/af_ax25.c
2045 +index 44ec492f3dc2..5c7a513bbaaa 100644
2046 +--- a/net/ax25/af_ax25.c
2047 ++++ b/net/ax25/af_ax25.c
2048 +@@ -638,8 +638,10 @@ static int ax25_setsockopt(struct socket *sock, int level, int optname,
2049 + break;
2050 +
2051 + case SO_BINDTODEVICE:
2052 +- if (optlen > IFNAMSIZ)
2053 +- optlen = IFNAMSIZ;
2054 ++ if (optlen > IFNAMSIZ - 1)
2055 ++ optlen = IFNAMSIZ - 1;
2056 ++
2057 ++ memset(devname, 0, sizeof(devname));
2058 +
2059 + if (copy_from_user(devname, optval, optlen)) {
2060 + res = -EFAULT;
2061 +diff --git a/net/bridge/netfilter/nft_reject_bridge.c b/net/bridge/netfilter/nft_reject_bridge.c
2062 +index 419e8edf23ba..c9ec46f5313f 100644
2063 +--- a/net/bridge/netfilter/nft_reject_bridge.c
2064 ++++ b/net/bridge/netfilter/nft_reject_bridge.c
2065 +@@ -34,6 +34,12 @@ static void nft_reject_br_push_etherhdr(struct sk_buff *oldskb,
2066 + ether_addr_copy(eth->h_dest, eth_hdr(oldskb)->h_source);
2067 + eth->h_proto = eth_hdr(oldskb)->h_proto;
2068 + skb_pull(nskb, ETH_HLEN);
2069 ++
2070 ++ if (skb_vlan_tag_present(oldskb)) {
2071 ++ u16 vid = skb_vlan_tag_get(oldskb);
2072 ++
2073 ++ __vlan_hwaccel_put_tag(nskb, oldskb->vlan_proto, vid);
2074 ++ }
2075 + }
2076 +
2077 + static int nft_bridge_iphdr_validate(struct sk_buff *skb)
2078 +diff --git a/net/ceph/osd_client.c b/net/ceph/osd_client.c
2079 +index 76c41a84550e..b8c4aea42917 100644
2080 +--- a/net/ceph/osd_client.c
2081 ++++ b/net/ceph/osd_client.c
2082 +@@ -3540,7 +3540,9 @@ static void handle_reply(struct ceph_osd *osd, struct ceph_msg *msg)
2083 + * supported.
2084 + */
2085 + req->r_t.target_oloc.pool = m.redirect.oloc.pool;
2086 +- req->r_flags |= CEPH_OSD_FLAG_REDIRECTED;
2087 ++ req->r_flags |= CEPH_OSD_FLAG_REDIRECTED |
2088 ++ CEPH_OSD_FLAG_IGNORE_OVERLAY |
2089 ++ CEPH_OSD_FLAG_IGNORE_CACHE;
2090 + req->r_tid = 0;
2091 + __submit_request(req, false);
2092 + goto out_unlock_osdc;
2093 +diff --git a/net/core/dev.c b/net/core/dev.c
2094 +index 9ccc14200b80..50498a75c04b 100644
2095 +--- a/net/core/dev.c
2096 ++++ b/net/core/dev.c
2097 +@@ -4778,11 +4778,12 @@ static inline int nf_ingress(struct sk_buff *skb, struct packet_type **pt_prev,
2098 + return 0;
2099 + }
2100 +
2101 +-static int __netif_receive_skb_core(struct sk_buff *skb, bool pfmemalloc,
2102 ++static int __netif_receive_skb_core(struct sk_buff **pskb, bool pfmemalloc,
2103 + struct packet_type **ppt_prev)
2104 + {
2105 + struct packet_type *ptype, *pt_prev;
2106 + rx_handler_func_t *rx_handler;
2107 ++ struct sk_buff *skb = *pskb;
2108 + struct net_device *orig_dev;
2109 + bool deliver_exact = false;
2110 + int ret = NET_RX_DROP;
2111 +@@ -4813,8 +4814,10 @@ another_round:
2112 + ret2 = do_xdp_generic(rcu_dereference(skb->dev->xdp_prog), skb);
2113 + preempt_enable();
2114 +
2115 +- if (ret2 != XDP_PASS)
2116 +- return NET_RX_DROP;
2117 ++ if (ret2 != XDP_PASS) {
2118 ++ ret = NET_RX_DROP;
2119 ++ goto out;
2120 ++ }
2121 + skb_reset_mac_len(skb);
2122 + }
2123 +
2124 +@@ -4936,6 +4939,13 @@ drop:
2125 + }
2126 +
2127 + out:
2128 ++ /* The invariant here is that if *ppt_prev is not NULL
2129 ++ * then skb should also be non-NULL.
2130 ++ *
2131 ++ * Apparently *ppt_prev assignment above holds this invariant due to
2132 ++ * skb dereferencing near it.
2133 ++ */
2134 ++ *pskb = skb;
2135 + return ret;
2136 + }
2137 +
2138 +@@ -4945,7 +4955,7 @@ static int __netif_receive_skb_one_core(struct sk_buff *skb, bool pfmemalloc)
2139 + struct packet_type *pt_prev = NULL;
2140 + int ret;
2141 +
2142 +- ret = __netif_receive_skb_core(skb, pfmemalloc, &pt_prev);
2143 ++ ret = __netif_receive_skb_core(&skb, pfmemalloc, &pt_prev);
2144 + if (pt_prev)
2145 + ret = pt_prev->func(skb, skb->dev, pt_prev, orig_dev);
2146 + return ret;
2147 +@@ -5021,7 +5031,7 @@ static void __netif_receive_skb_list_core(struct list_head *head, bool pfmemallo
2148 + struct packet_type *pt_prev = NULL;
2149 +
2150 + skb_list_del_init(skb);
2151 +- __netif_receive_skb_core(skb, pfmemalloc, &pt_prev);
2152 ++ __netif_receive_skb_core(&skb, pfmemalloc, &pt_prev);
2153 + if (!pt_prev)
2154 + continue;
2155 + if (pt_curr != pt_prev || od_curr != orig_dev) {
2156 +diff --git a/net/dsa/tag_mtk.c b/net/dsa/tag_mtk.c
2157 +index 11535bc70743..6574425ad94c 100644
2158 +--- a/net/dsa/tag_mtk.c
2159 ++++ b/net/dsa/tag_mtk.c
2160 +@@ -22,6 +22,7 @@
2161 + #define MTK_HDR_XMIT_TAGGED_TPID_8100 1
2162 + #define MTK_HDR_RECV_SOURCE_PORT_MASK GENMASK(2, 0)
2163 + #define MTK_HDR_XMIT_DP_BIT_MASK GENMASK(5, 0)
2164 ++#define MTK_HDR_XMIT_SA_DIS BIT(6)
2165 +
2166 + static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,
2167 + struct net_device *dev)
2168 +@@ -29,6 +30,9 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,
2169 + struct dsa_port *dp = dsa_slave_to_port(dev);
2170 + u8 *mtk_tag;
2171 + bool is_vlan_skb = true;
2172 ++ unsigned char *dest = eth_hdr(skb)->h_dest;
2173 ++ bool is_multicast_skb = is_multicast_ether_addr(dest) &&
2174 ++ !is_broadcast_ether_addr(dest);
2175 +
2176 + /* Build the special tag after the MAC Source Address. If VLAN header
2177 + * is present, it's required that VLAN header and special tag is
2178 +@@ -54,6 +58,10 @@ static struct sk_buff *mtk_tag_xmit(struct sk_buff *skb,
2179 + MTK_HDR_XMIT_UNTAGGED;
2180 + mtk_tag[1] = (1 << dp->index) & MTK_HDR_XMIT_DP_BIT_MASK;
2181 +
2182 ++ /* Disable SA learning for multicast frames */
2183 ++ if (unlikely(is_multicast_skb))
2184 ++ mtk_tag[1] |= MTK_HDR_XMIT_SA_DIS;
2185 ++
2186 + /* Tag control information is kept for 802.1Q */
2187 + if (!is_vlan_skb) {
2188 + mtk_tag[2] = 0;
2189 +@@ -68,6 +76,9 @@ static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
2190 + {
2191 + int port;
2192 + __be16 *phdr, hdr;
2193 ++ unsigned char *dest = eth_hdr(skb)->h_dest;
2194 ++ bool is_multicast_skb = is_multicast_ether_addr(dest) &&
2195 ++ !is_broadcast_ether_addr(dest);
2196 +
2197 + if (unlikely(!pskb_may_pull(skb, MTK_HDR_LEN)))
2198 + return NULL;
2199 +@@ -93,6 +104,10 @@ static struct sk_buff *mtk_tag_rcv(struct sk_buff *skb, struct net_device *dev,
2200 + if (!skb->dev)
2201 + return NULL;
2202 +
2203 ++ /* Only unicast or broadcast frames are offloaded */
2204 ++ if (likely(!is_multicast_skb))
2205 ++ skb->offload_fwd_mark = 1;
2206 ++
2207 + return skb;
2208 + }
2209 +
2210 +diff --git a/net/ipv4/inet_connection_sock.c b/net/ipv4/inet_connection_sock.c
2211 +index 34bd6230e9f4..ddbe58f0d597 100644
2212 +--- a/net/ipv4/inet_connection_sock.c
2213 ++++ b/net/ipv4/inet_connection_sock.c
2214 +@@ -28,17 +28,19 @@
2215 + #include <net/addrconf.h>
2216 +
2217 + #if IS_ENABLED(CONFIG_IPV6)
2218 +-/* match_wildcard == true: IPV6_ADDR_ANY equals to any IPv6 addresses if IPv6
2219 +- * only, and any IPv4 addresses if not IPv6 only
2220 +- * match_wildcard == false: addresses must be exactly the same, i.e.
2221 +- * IPV6_ADDR_ANY only equals to IPV6_ADDR_ANY,
2222 +- * and 0.0.0.0 equals to 0.0.0.0 only
2223 ++/* match_sk*_wildcard == true: IPV6_ADDR_ANY equals to any IPv6 addresses
2224 ++ * if IPv6 only, and any IPv4 addresses
2225 ++ * if not IPv6 only
2226 ++ * match_sk*_wildcard == false: addresses must be exactly the same, i.e.
2227 ++ * IPV6_ADDR_ANY only equals to IPV6_ADDR_ANY,
2228 ++ * and 0.0.0.0 equals to 0.0.0.0 only
2229 + */
2230 + static bool ipv6_rcv_saddr_equal(const struct in6_addr *sk1_rcv_saddr6,
2231 + const struct in6_addr *sk2_rcv_saddr6,
2232 + __be32 sk1_rcv_saddr, __be32 sk2_rcv_saddr,
2233 + bool sk1_ipv6only, bool sk2_ipv6only,
2234 +- bool match_wildcard)
2235 ++ bool match_sk1_wildcard,
2236 ++ bool match_sk2_wildcard)
2237 + {
2238 + int addr_type = ipv6_addr_type(sk1_rcv_saddr6);
2239 + int addr_type2 = sk2_rcv_saddr6 ? ipv6_addr_type(sk2_rcv_saddr6) : IPV6_ADDR_MAPPED;
2240 +@@ -48,8 +50,8 @@ static bool ipv6_rcv_saddr_equal(const struct in6_addr *sk1_rcv_saddr6,
2241 + if (!sk2_ipv6only) {
2242 + if (sk1_rcv_saddr == sk2_rcv_saddr)
2243 + return true;
2244 +- if (!sk1_rcv_saddr || !sk2_rcv_saddr)
2245 +- return match_wildcard;
2246 ++ return (match_sk1_wildcard && !sk1_rcv_saddr) ||
2247 ++ (match_sk2_wildcard && !sk2_rcv_saddr);
2248 + }
2249 + return false;
2250 + }
2251 +@@ -57,11 +59,11 @@ static bool ipv6_rcv_saddr_equal(const struct in6_addr *sk1_rcv_saddr6,
2252 + if (addr_type == IPV6_ADDR_ANY && addr_type2 == IPV6_ADDR_ANY)
2253 + return true;
2254 +
2255 +- if (addr_type2 == IPV6_ADDR_ANY && match_wildcard &&
2256 ++ if (addr_type2 == IPV6_ADDR_ANY && match_sk2_wildcard &&
2257 + !(sk2_ipv6only && addr_type == IPV6_ADDR_MAPPED))
2258 + return true;
2259 +
2260 +- if (addr_type == IPV6_ADDR_ANY && match_wildcard &&
2261 ++ if (addr_type == IPV6_ADDR_ANY && match_sk1_wildcard &&
2262 + !(sk1_ipv6only && addr_type2 == IPV6_ADDR_MAPPED))
2263 + return true;
2264 +
2265 +@@ -73,18 +75,19 @@ static bool ipv6_rcv_saddr_equal(const struct in6_addr *sk1_rcv_saddr6,
2266 + }
2267 + #endif
2268 +
2269 +-/* match_wildcard == true: 0.0.0.0 equals to any IPv4 addresses
2270 +- * match_wildcard == false: addresses must be exactly the same, i.e.
2271 +- * 0.0.0.0 only equals to 0.0.0.0
2272 ++/* match_sk*_wildcard == true: 0.0.0.0 equals to any IPv4 addresses
2273 ++ * match_sk*_wildcard == false: addresses must be exactly the same, i.e.
2274 ++ * 0.0.0.0 only equals to 0.0.0.0
2275 + */
2276 + static bool ipv4_rcv_saddr_equal(__be32 sk1_rcv_saddr, __be32 sk2_rcv_saddr,
2277 +- bool sk2_ipv6only, bool match_wildcard)
2278 ++ bool sk2_ipv6only, bool match_sk1_wildcard,
2279 ++ bool match_sk2_wildcard)
2280 + {
2281 + if (!sk2_ipv6only) {
2282 + if (sk1_rcv_saddr == sk2_rcv_saddr)
2283 + return true;
2284 +- if (!sk1_rcv_saddr || !sk2_rcv_saddr)
2285 +- return match_wildcard;
2286 ++ return (match_sk1_wildcard && !sk1_rcv_saddr) ||
2287 ++ (match_sk2_wildcard && !sk2_rcv_saddr);
2288 + }
2289 + return false;
2290 + }
2291 +@@ -100,10 +103,12 @@ bool inet_rcv_saddr_equal(const struct sock *sk, const struct sock *sk2,
2292 + sk2->sk_rcv_saddr,
2293 + ipv6_only_sock(sk),
2294 + ipv6_only_sock(sk2),
2295 ++ match_wildcard,
2296 + match_wildcard);
2297 + #endif
2298 + return ipv4_rcv_saddr_equal(sk->sk_rcv_saddr, sk2->sk_rcv_saddr,
2299 +- ipv6_only_sock(sk2), match_wildcard);
2300 ++ ipv6_only_sock(sk2), match_wildcard,
2301 ++ match_wildcard);
2302 + }
2303 + EXPORT_SYMBOL(inet_rcv_saddr_equal);
2304 +
2305 +@@ -274,10 +279,10 @@ static inline int sk_reuseport_match(struct inet_bind_bucket *tb,
2306 + tb->fast_rcv_saddr,
2307 + sk->sk_rcv_saddr,
2308 + tb->fast_ipv6_only,
2309 +- ipv6_only_sock(sk), true);
2310 ++ ipv6_only_sock(sk), true, false);
2311 + #endif
2312 + return ipv4_rcv_saddr_equal(tb->fast_rcv_saddr, sk->sk_rcv_saddr,
2313 +- ipv6_only_sock(sk), true);
2314 ++ ipv6_only_sock(sk), true, false);
2315 + }
2316 +
2317 + /* Obtain a reference to a local port for the given sock,
2318 +diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c
2319 +index d4c4eabd02b6..15c71b08c2df 100644
2320 +--- a/net/ipv4/ip_vti.c
2321 ++++ b/net/ipv4/ip_vti.c
2322 +@@ -50,7 +50,7 @@ static unsigned int vti_net_id __read_mostly;
2323 + static int vti_tunnel_init(struct net_device *dev);
2324 +
2325 + static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi,
2326 +- int encap_type)
2327 ++ int encap_type, bool update_skb_dev)
2328 + {
2329 + struct ip_tunnel *tunnel;
2330 + const struct iphdr *iph = ip_hdr(skb);
2331 +@@ -65,6 +65,9 @@ static int vti_input(struct sk_buff *skb, int nexthdr, __be32 spi,
2332 +
2333 + XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel;
2334 +
2335 ++ if (update_skb_dev)
2336 ++ skb->dev = tunnel->dev;
2337 ++
2338 + return xfrm_input(skb, nexthdr, spi, encap_type);
2339 + }
2340 +
2341 +@@ -74,25 +77,43 @@ drop:
2342 + return 0;
2343 + }
2344 +
2345 +-static int vti_input_ipip(struct sk_buff *skb, int nexthdr, __be32 spi,
2346 +- int encap_type)
2347 ++static int vti_input_proto(struct sk_buff *skb, int nexthdr, __be32 spi,
2348 ++ int encap_type)
2349 + {
2350 +- struct ip_tunnel *tunnel;
2351 ++ return vti_input(skb, nexthdr, spi, encap_type, false);
2352 ++}
2353 ++
2354 ++static int vti_rcv(struct sk_buff *skb, __be32 spi, bool update_skb_dev)
2355 ++{
2356 ++ XFRM_SPI_SKB_CB(skb)->family = AF_INET;
2357 ++ XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr);
2358 ++
2359 ++ return vti_input(skb, ip_hdr(skb)->protocol, spi, 0, update_skb_dev);
2360 ++}
2361 ++
2362 ++static int vti_rcv_proto(struct sk_buff *skb)
2363 ++{
2364 ++ return vti_rcv(skb, 0, false);
2365 ++}
2366 ++
2367 ++static int vti_rcv_tunnel(struct sk_buff *skb)
2368 ++{
2369 ++ struct ip_tunnel_net *itn = net_generic(dev_net(skb->dev), vti_net_id);
2370 + const struct iphdr *iph = ip_hdr(skb);
2371 +- struct net *net = dev_net(skb->dev);
2372 +- struct ip_tunnel_net *itn = net_generic(net, vti_net_id);
2373 ++ struct ip_tunnel *tunnel;
2374 +
2375 + tunnel = ip_tunnel_lookup(itn, skb->dev->ifindex, TUNNEL_NO_KEY,
2376 + iph->saddr, iph->daddr, 0);
2377 + if (tunnel) {
2378 ++ struct tnl_ptk_info tpi = {
2379 ++ .proto = htons(ETH_P_IP),
2380 ++ };
2381 ++
2382 + if (!xfrm4_policy_check(NULL, XFRM_POLICY_IN, skb))
2383 + goto drop;
2384 +-
2385 +- XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = tunnel;
2386 +-
2387 +- skb->dev = tunnel->dev;
2388 +-
2389 +- return xfrm_input(skb, nexthdr, spi, encap_type);
2390 ++ if (iptunnel_pull_header(skb, 0, tpi.proto, false))
2391 ++ goto drop;
2392 ++ return ip_tunnel_rcv(tunnel, skb, &tpi, NULL, false);
2393 + }
2394 +
2395 + return -EINVAL;
2396 +@@ -101,22 +122,6 @@ drop:
2397 + return 0;
2398 + }
2399 +
2400 +-static int vti_rcv(struct sk_buff *skb)
2401 +-{
2402 +- XFRM_SPI_SKB_CB(skb)->family = AF_INET;
2403 +- XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr);
2404 +-
2405 +- return vti_input(skb, ip_hdr(skb)->protocol, 0, 0);
2406 +-}
2407 +-
2408 +-static int vti_rcv_ipip(struct sk_buff *skb)
2409 +-{
2410 +- XFRM_SPI_SKB_CB(skb)->family = AF_INET;
2411 +- XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr);
2412 +-
2413 +- return vti_input_ipip(skb, ip_hdr(skb)->protocol, ip_hdr(skb)->saddr, 0);
2414 +-}
2415 +-
2416 + static int vti_rcv_cb(struct sk_buff *skb, int err)
2417 + {
2418 + unsigned short family;
2419 +@@ -478,31 +483,31 @@ static void __net_init vti_fb_tunnel_init(struct net_device *dev)
2420 + }
2421 +
2422 + static struct xfrm4_protocol vti_esp4_protocol __read_mostly = {
2423 +- .handler = vti_rcv,
2424 +- .input_handler = vti_input,
2425 ++ .handler = vti_rcv_proto,
2426 ++ .input_handler = vti_input_proto,
2427 + .cb_handler = vti_rcv_cb,
2428 + .err_handler = vti4_err,
2429 + .priority = 100,
2430 + };
2431 +
2432 + static struct xfrm4_protocol vti_ah4_protocol __read_mostly = {
2433 +- .handler = vti_rcv,
2434 +- .input_handler = vti_input,
2435 ++ .handler = vti_rcv_proto,
2436 ++ .input_handler = vti_input_proto,
2437 + .cb_handler = vti_rcv_cb,
2438 + .err_handler = vti4_err,
2439 + .priority = 100,
2440 + };
2441 +
2442 + static struct xfrm4_protocol vti_ipcomp4_protocol __read_mostly = {
2443 +- .handler = vti_rcv,
2444 +- .input_handler = vti_input,
2445 ++ .handler = vti_rcv_proto,
2446 ++ .input_handler = vti_input_proto,
2447 + .cb_handler = vti_rcv_cb,
2448 + .err_handler = vti4_err,
2449 + .priority = 100,
2450 + };
2451 +
2452 + static struct xfrm_tunnel ipip_handler __read_mostly = {
2453 +- .handler = vti_rcv_ipip,
2454 ++ .handler = vti_rcv_tunnel,
2455 + .err_handler = vti4_err,
2456 + .priority = 0,
2457 + };
2458 +diff --git a/net/ipv4/ipip.c b/net/ipv4/ipip.c
2459 +index 4368282eb6f8..da2e92380d78 100644
2460 +--- a/net/ipv4/ipip.c
2461 ++++ b/net/ipv4/ipip.c
2462 +@@ -704,7 +704,7 @@ out:
2463 +
2464 + rtnl_link_failed:
2465 + #if IS_ENABLED(CONFIG_MPLS)
2466 +- xfrm4_tunnel_deregister(&mplsip_handler, AF_INET);
2467 ++ xfrm4_tunnel_deregister(&mplsip_handler, AF_MPLS);
2468 + xfrm_tunnel_mplsip_failed:
2469 +
2470 + #endif
2471 +diff --git a/net/ipv4/netfilter/nf_nat_pptp.c b/net/ipv4/netfilter/nf_nat_pptp.c
2472 +index 5d259a12e25f..2518c1ca63ae 100644
2473 +--- a/net/ipv4/netfilter/nf_nat_pptp.c
2474 ++++ b/net/ipv4/netfilter/nf_nat_pptp.c
2475 +@@ -165,8 +165,7 @@ pptp_outbound_pkt(struct sk_buff *skb,
2476 + break;
2477 + default:
2478 + pr_debug("unknown outbound packet 0x%04x:%s\n", msg,
2479 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] :
2480 +- pptp_msg_name[0]);
2481 ++ pptp_msg_name(msg));
2482 + /* fall through */
2483 + case PPTP_SET_LINK_INFO:
2484 + /* only need to NAT in case PAC is behind NAT box */
2485 +@@ -267,9 +266,7 @@ pptp_inbound_pkt(struct sk_buff *skb,
2486 + pcid_off = offsetof(union pptp_ctrl_union, setlink.peersCallID);
2487 + break;
2488 + default:
2489 +- pr_debug("unknown inbound packet %s\n",
2490 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] :
2491 +- pptp_msg_name[0]);
2492 ++ pr_debug("unknown inbound packet %s\n", pptp_msg_name(msg));
2493 + /* fall through */
2494 + case PPTP_START_SESSION_REQUEST:
2495 + case PPTP_START_SESSION_REPLY:
2496 +diff --git a/net/ipv4/route.c b/net/ipv4/route.c
2497 +index 84ddb16f4fc0..f752d22cc8a5 100644
2498 +--- a/net/ipv4/route.c
2499 ++++ b/net/ipv4/route.c
2500 +@@ -484,18 +484,16 @@ u32 ip_idents_reserve(u32 hash, int segs)
2501 + atomic_t *p_id = ip_idents + hash % IP_IDENTS_SZ;
2502 + u32 old = READ_ONCE(*p_tstamp);
2503 + u32 now = (u32)jiffies;
2504 +- u32 new, delta = 0;
2505 ++ u32 delta = 0;
2506 +
2507 + if (old != now && cmpxchg(p_tstamp, old, now) == old)
2508 + delta = prandom_u32_max(now - old);
2509 +
2510 +- /* Do not use atomic_add_return() as it makes UBSAN unhappy */
2511 +- do {
2512 +- old = (u32)atomic_read(p_id);
2513 +- new = old + delta + segs;
2514 +- } while (atomic_cmpxchg(p_id, old, new) != old);
2515 +-
2516 +- return new - segs;
2517 ++ /* If UBSAN reports an error there, please make sure your compiler
2518 ++ * supports -fno-strict-overflow before reporting it that was a bug
2519 ++ * in UBSAN, and it has been fixed in GCC-8.
2520 ++ */
2521 ++ return atomic_add_return(segs + delta, p_id) - segs;
2522 + }
2523 + EXPORT_SYMBOL(ip_idents_reserve);
2524 +
2525 +diff --git a/net/ipv6/esp6_offload.c b/net/ipv6/esp6_offload.c
2526 +index 6177e2171171..eeee64a8a72c 100644
2527 +--- a/net/ipv6/esp6_offload.c
2528 ++++ b/net/ipv6/esp6_offload.c
2529 +@@ -121,9 +121,16 @@ static void esp6_gso_encap(struct xfrm_state *x, struct sk_buff *skb)
2530 + struct ip_esp_hdr *esph;
2531 + struct ipv6hdr *iph = ipv6_hdr(skb);
2532 + struct xfrm_offload *xo = xfrm_offload(skb);
2533 +- int proto = iph->nexthdr;
2534 ++ u8 proto = iph->nexthdr;
2535 +
2536 + skb_push(skb, -skb_network_offset(skb));
2537 ++
2538 ++ if (x->outer_mode->encap == XFRM_MODE_TRANSPORT) {
2539 ++ __be16 frag;
2540 ++
2541 ++ ipv6_skip_exthdr(skb, sizeof(struct ipv6hdr), &proto, &frag);
2542 ++ }
2543 ++
2544 + esph = ip_esp_hdr(skb);
2545 + *skb_mac_header(skb) = IPPROTO_ESP;
2546 +
2547 +diff --git a/net/mac80211/mesh_hwmp.c b/net/mac80211/mesh_hwmp.c
2548 +index 433d136282de..6219b6b0c7e1 100644
2549 +--- a/net/mac80211/mesh_hwmp.c
2550 ++++ b/net/mac80211/mesh_hwmp.c
2551 +@@ -1088,7 +1088,14 @@ void mesh_path_start_discovery(struct ieee80211_sub_if_data *sdata)
2552 + mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->vif.addr, ifmsh->sn,
2553 + target_flags, mpath->dst, mpath->sn, da, 0,
2554 + ttl, lifetime, 0, ifmsh->preq_id++, sdata);
2555 ++
2556 ++ spin_lock_bh(&mpath->state_lock);
2557 ++ if (mpath->flags & MESH_PATH_DELETED) {
2558 ++ spin_unlock_bh(&mpath->state_lock);
2559 ++ goto enddiscovery;
2560 ++ }
2561 + mod_timer(&mpath->timer, jiffies + mpath->discovery_timeout);
2562 ++ spin_unlock_bh(&mpath->state_lock);
2563 +
2564 + enddiscovery:
2565 + rcu_read_unlock();
2566 +diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c
2567 +index 8da228da53ae..993ce04e6ea0 100644
2568 +--- a/net/netfilter/ipset/ip_set_list_set.c
2569 ++++ b/net/netfilter/ipset/ip_set_list_set.c
2570 +@@ -63,7 +63,7 @@ list_set_ktest(struct ip_set *set, const struct sk_buff *skb,
2571 + /* Don't lookup sub-counters at all */
2572 + opt->cmdflags &= ~IPSET_FLAG_MATCH_COUNTERS;
2573 + if (opt->cmdflags & IPSET_FLAG_SKIP_SUBCOUNTER_UPDATE)
2574 +- opt->cmdflags &= ~IPSET_FLAG_SKIP_COUNTER_UPDATE;
2575 ++ opt->cmdflags |= IPSET_FLAG_SKIP_COUNTER_UPDATE;
2576 + list_for_each_entry_rcu(e, &map->members, list) {
2577 + ret = ip_set_test(e->id, skb, par, opt);
2578 + if (ret <= 0)
2579 +diff --git a/net/netfilter/nf_conntrack_pptp.c b/net/netfilter/nf_conntrack_pptp.c
2580 +index 11562f2a08bb..203107ce2455 100644
2581 +--- a/net/netfilter/nf_conntrack_pptp.c
2582 ++++ b/net/netfilter/nf_conntrack_pptp.c
2583 +@@ -71,24 +71,32 @@ EXPORT_SYMBOL_GPL(nf_nat_pptp_hook_expectfn);
2584 +
2585 + #if defined(DEBUG) || defined(CONFIG_DYNAMIC_DEBUG)
2586 + /* PptpControlMessageType names */
2587 +-const char *const pptp_msg_name[] = {
2588 +- "UNKNOWN_MESSAGE",
2589 +- "START_SESSION_REQUEST",
2590 +- "START_SESSION_REPLY",
2591 +- "STOP_SESSION_REQUEST",
2592 +- "STOP_SESSION_REPLY",
2593 +- "ECHO_REQUEST",
2594 +- "ECHO_REPLY",
2595 +- "OUT_CALL_REQUEST",
2596 +- "OUT_CALL_REPLY",
2597 +- "IN_CALL_REQUEST",
2598 +- "IN_CALL_REPLY",
2599 +- "IN_CALL_CONNECT",
2600 +- "CALL_CLEAR_REQUEST",
2601 +- "CALL_DISCONNECT_NOTIFY",
2602 +- "WAN_ERROR_NOTIFY",
2603 +- "SET_LINK_INFO"
2604 ++static const char *const pptp_msg_name_array[PPTP_MSG_MAX + 1] = {
2605 ++ [0] = "UNKNOWN_MESSAGE",
2606 ++ [PPTP_START_SESSION_REQUEST] = "START_SESSION_REQUEST",
2607 ++ [PPTP_START_SESSION_REPLY] = "START_SESSION_REPLY",
2608 ++ [PPTP_STOP_SESSION_REQUEST] = "STOP_SESSION_REQUEST",
2609 ++ [PPTP_STOP_SESSION_REPLY] = "STOP_SESSION_REPLY",
2610 ++ [PPTP_ECHO_REQUEST] = "ECHO_REQUEST",
2611 ++ [PPTP_ECHO_REPLY] = "ECHO_REPLY",
2612 ++ [PPTP_OUT_CALL_REQUEST] = "OUT_CALL_REQUEST",
2613 ++ [PPTP_OUT_CALL_REPLY] = "OUT_CALL_REPLY",
2614 ++ [PPTP_IN_CALL_REQUEST] = "IN_CALL_REQUEST",
2615 ++ [PPTP_IN_CALL_REPLY] = "IN_CALL_REPLY",
2616 ++ [PPTP_IN_CALL_CONNECT] = "IN_CALL_CONNECT",
2617 ++ [PPTP_CALL_CLEAR_REQUEST] = "CALL_CLEAR_REQUEST",
2618 ++ [PPTP_CALL_DISCONNECT_NOTIFY] = "CALL_DISCONNECT_NOTIFY",
2619 ++ [PPTP_WAN_ERROR_NOTIFY] = "WAN_ERROR_NOTIFY",
2620 ++ [PPTP_SET_LINK_INFO] = "SET_LINK_INFO"
2621 + };
2622 ++
2623 ++const char *pptp_msg_name(u_int16_t msg)
2624 ++{
2625 ++ if (msg > PPTP_MSG_MAX)
2626 ++ return pptp_msg_name_array[0];
2627 ++
2628 ++ return pptp_msg_name_array[msg];
2629 ++}
2630 + EXPORT_SYMBOL(pptp_msg_name);
2631 + #endif
2632 +
2633 +@@ -275,7 +283,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2634 + typeof(nf_nat_pptp_hook_inbound) nf_nat_pptp_inbound;
2635 +
2636 + msg = ntohs(ctlh->messageType);
2637 +- pr_debug("inbound control message %s\n", pptp_msg_name[msg]);
2638 ++ pr_debug("inbound control message %s\n", pptp_msg_name(msg));
2639 +
2640 + switch (msg) {
2641 + case PPTP_START_SESSION_REPLY:
2642 +@@ -310,7 +318,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2643 + pcid = pptpReq->ocack.peersCallID;
2644 + if (info->pns_call_id != pcid)
2645 + goto invalid;
2646 +- pr_debug("%s, CID=%X, PCID=%X\n", pptp_msg_name[msg],
2647 ++ pr_debug("%s, CID=%X, PCID=%X\n", pptp_msg_name(msg),
2648 + ntohs(cid), ntohs(pcid));
2649 +
2650 + if (pptpReq->ocack.resultCode == PPTP_OUTCALL_CONNECT) {
2651 +@@ -327,7 +335,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2652 + goto invalid;
2653 +
2654 + cid = pptpReq->icreq.callID;
2655 +- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
2656 ++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid));
2657 + info->cstate = PPTP_CALL_IN_REQ;
2658 + info->pac_call_id = cid;
2659 + break;
2660 +@@ -346,7 +354,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2661 + if (info->pns_call_id != pcid)
2662 + goto invalid;
2663 +
2664 +- pr_debug("%s, PCID=%X\n", pptp_msg_name[msg], ntohs(pcid));
2665 ++ pr_debug("%s, PCID=%X\n", pptp_msg_name(msg), ntohs(pcid));
2666 + info->cstate = PPTP_CALL_IN_CONF;
2667 +
2668 + /* we expect a GRE connection from PAC to PNS */
2669 +@@ -356,7 +364,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2670 + case PPTP_CALL_DISCONNECT_NOTIFY:
2671 + /* server confirms disconnect */
2672 + cid = pptpReq->disc.callID;
2673 +- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
2674 ++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid));
2675 + info->cstate = PPTP_CALL_NONE;
2676 +
2677 + /* untrack this call id, unexpect GRE packets */
2678 +@@ -383,7 +391,7 @@ pptp_inbound_pkt(struct sk_buff *skb, unsigned int protoff,
2679 + invalid:
2680 + pr_debug("invalid %s: type=%d cid=%u pcid=%u "
2681 + "cstate=%d sstate=%d pns_cid=%u pac_cid=%u\n",
2682 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] : pptp_msg_name[0],
2683 ++ pptp_msg_name(msg),
2684 + msg, ntohs(cid), ntohs(pcid), info->cstate, info->sstate,
2685 + ntohs(info->pns_call_id), ntohs(info->pac_call_id));
2686 + return NF_ACCEPT;
2687 +@@ -403,7 +411,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
2688 + typeof(nf_nat_pptp_hook_outbound) nf_nat_pptp_outbound;
2689 +
2690 + msg = ntohs(ctlh->messageType);
2691 +- pr_debug("outbound control message %s\n", pptp_msg_name[msg]);
2692 ++ pr_debug("outbound control message %s\n", pptp_msg_name(msg));
2693 +
2694 + switch (msg) {
2695 + case PPTP_START_SESSION_REQUEST:
2696 +@@ -425,7 +433,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
2697 + info->cstate = PPTP_CALL_OUT_REQ;
2698 + /* track PNS call id */
2699 + cid = pptpReq->ocreq.callID;
2700 +- pr_debug("%s, CID=%X\n", pptp_msg_name[msg], ntohs(cid));
2701 ++ pr_debug("%s, CID=%X\n", pptp_msg_name(msg), ntohs(cid));
2702 + info->pns_call_id = cid;
2703 + break;
2704 +
2705 +@@ -439,7 +447,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
2706 + pcid = pptpReq->icack.peersCallID;
2707 + if (info->pac_call_id != pcid)
2708 + goto invalid;
2709 +- pr_debug("%s, CID=%X PCID=%X\n", pptp_msg_name[msg],
2710 ++ pr_debug("%s, CID=%X PCID=%X\n", pptp_msg_name(msg),
2711 + ntohs(cid), ntohs(pcid));
2712 +
2713 + if (pptpReq->icack.resultCode == PPTP_INCALL_ACCEPT) {
2714 +@@ -479,7 +487,7 @@ pptp_outbound_pkt(struct sk_buff *skb, unsigned int protoff,
2715 + invalid:
2716 + pr_debug("invalid %s: type=%d cid=%u pcid=%u "
2717 + "cstate=%d sstate=%d pns_cid=%u pac_cid=%u\n",
2718 +- msg <= PPTP_MSG_MAX ? pptp_msg_name[msg] : pptp_msg_name[0],
2719 ++ pptp_msg_name(msg),
2720 + msg, ntohs(cid), ntohs(pcid), info->cstate, info->sstate,
2721 + ntohs(info->pns_call_id), ntohs(info->pac_call_id));
2722 + return NF_ACCEPT;
2723 +diff --git a/net/netfilter/nfnetlink_cthelper.c b/net/netfilter/nfnetlink_cthelper.c
2724 +index 66154dafa305..ddcb1b607474 100644
2725 +--- a/net/netfilter/nfnetlink_cthelper.c
2726 ++++ b/net/netfilter/nfnetlink_cthelper.c
2727 +@@ -106,7 +106,7 @@ nfnl_cthelper_from_nlattr(struct nlattr *attr, struct nf_conn *ct)
2728 + if (help->helper->data_len == 0)
2729 + return -EINVAL;
2730 +
2731 +- nla_memcpy(help->data, nla_data(attr), sizeof(help->data));
2732 ++ nla_memcpy(help->data, attr, sizeof(help->data));
2733 + return 0;
2734 + }
2735 +
2736 +@@ -242,6 +242,7 @@ nfnl_cthelper_create(const struct nlattr * const tb[],
2737 + ret = -ENOMEM;
2738 + goto err2;
2739 + }
2740 ++ helper->data_len = size;
2741 +
2742 + helper->flags |= NF_CT_HELPER_F_USERSPACE;
2743 + memcpy(&helper->tuple, tuple, sizeof(struct nf_conntrack_tuple));
2744 +diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c
2745 +index 518327dccb3c..9605979a349e 100644
2746 +--- a/net/qrtr/qrtr.c
2747 ++++ b/net/qrtr/qrtr.c
2748 +@@ -718,7 +718,7 @@ static int qrtr_bcast_enqueue(struct qrtr_node *node, struct sk_buff *skb,
2749 + }
2750 + mutex_unlock(&qrtr_node_lock);
2751 +
2752 +- qrtr_local_enqueue(node, skb, type, from, to);
2753 ++ qrtr_local_enqueue(NULL, skb, type, from, to);
2754 +
2755 + return 0;
2756 + }
2757 +diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
2758 +index 0234a64b3b19..567517e44811 100644
2759 +--- a/net/sctp/sm_sideeffect.c
2760 ++++ b/net/sctp/sm_sideeffect.c
2761 +@@ -1537,9 +1537,17 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
2762 + timeout = asoc->timeouts[cmd->obj.to];
2763 + BUG_ON(!timeout);
2764 +
2765 +- timer->expires = jiffies + timeout;
2766 +- sctp_association_hold(asoc);
2767 +- add_timer(timer);
2768 ++ /*
2769 ++ * SCTP has a hard time with timer starts. Because we process
2770 ++ * timer starts as side effects, it can be hard to tell if we
2771 ++ * have already started a timer or not, which leads to BUG
2772 ++ * halts when we call add_timer. So here, instead of just starting
2773 ++ * a timer, if the timer is already started, and just mod
2774 ++ * the timer with the shorter of the two expiration times
2775 ++ */
2776 ++ if (!timer_pending(timer))
2777 ++ sctp_association_hold(asoc);
2778 ++ timer_reduce(timer, jiffies + timeout);
2779 + break;
2780 +
2781 + case SCTP_CMD_TIMER_RESTART:
2782 +diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c
2783 +index c437ae93b5a9..a3033b74df54 100644
2784 +--- a/net/sctp/sm_statefuns.c
2785 ++++ b/net/sctp/sm_statefuns.c
2786 +@@ -1871,12 +1871,13 @@ static enum sctp_disposition sctp_sf_do_dupcook_a(
2787 + /* Update the content of current association. */
2788 + sctp_add_cmd_sf(commands, SCTP_CMD_UPDATE_ASSOC, SCTP_ASOC(new_asoc));
2789 + sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, SCTP_ULPEVENT(ev));
2790 +- if (sctp_state(asoc, SHUTDOWN_PENDING) &&
2791 ++ if ((sctp_state(asoc, SHUTDOWN_PENDING) ||
2792 ++ sctp_state(asoc, SHUTDOWN_SENT)) &&
2793 + (sctp_sstate(asoc->base.sk, CLOSING) ||
2794 + sock_flag(asoc->base.sk, SOCK_DEAD))) {
2795 +- /* if were currently in SHUTDOWN_PENDING, but the socket
2796 +- * has been closed by user, don't transition to ESTABLISHED.
2797 +- * Instead trigger SHUTDOWN bundled with COOKIE_ACK.
2798 ++ /* If the socket has been closed by user, don't
2799 ++ * transition to ESTABLISHED. Instead trigger SHUTDOWN
2800 ++ * bundled with COOKIE_ACK.
2801 + */
2802 + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY, SCTP_CHUNK(repl));
2803 + return sctp_sf_do_9_2_start_shutdown(net, ep, asoc,
2804 +diff --git a/net/xdp/xdp_umem.c b/net/xdp/xdp_umem.c
2805 +index 706fad12f22c..b87e63cb55be 100644
2806 +--- a/net/xdp/xdp_umem.c
2807 ++++ b/net/xdp/xdp_umem.c
2808 +@@ -258,8 +258,8 @@ static int xdp_umem_account_pages(struct xdp_umem *umem)
2809 + static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
2810 + {
2811 + u32 chunk_size = mr->chunk_size, headroom = mr->headroom;
2812 ++ u64 npgs, addr = mr->addr, size = mr->len;
2813 + unsigned int chunks, chunks_per_page;
2814 +- u64 addr = mr->addr, size = mr->len;
2815 + int err, i;
2816 +
2817 + if (chunk_size < XDP_UMEM_MIN_CHUNK_SIZE || chunk_size > PAGE_SIZE) {
2818 +@@ -285,6 +285,10 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
2819 + if ((addr + size) < addr)
2820 + return -EINVAL;
2821 +
2822 ++ npgs = div_u64(size, PAGE_SIZE);
2823 ++ if (npgs > U32_MAX)
2824 ++ return -EINVAL;
2825 ++
2826 + chunks = (unsigned int)div_u64(size, chunk_size);
2827 + if (chunks == 0)
2828 + return -EINVAL;
2829 +@@ -303,7 +307,7 @@ static int xdp_umem_reg(struct xdp_umem *umem, struct xdp_umem_reg *mr)
2830 + umem->props.size = size;
2831 + umem->headroom = headroom;
2832 + umem->chunk_size_nohr = chunk_size - headroom;
2833 +- umem->npgs = size / PAGE_SIZE;
2834 ++ umem->npgs = (u32)npgs;
2835 + umem->pgs = NULL;
2836 + umem->user = NULL;
2837 + INIT_LIST_HEAD(&umem->xsk_list);
2838 +diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c
2839 +index 82b0a99ee1f4..0ee13d12782f 100644
2840 +--- a/net/xfrm/xfrm_input.c
2841 ++++ b/net/xfrm/xfrm_input.c
2842 +@@ -407,7 +407,7 @@ resume:
2843 + dev_put(skb->dev);
2844 +
2845 + spin_lock(&x->lock);
2846 +- if (nexthdr <= 0) {
2847 ++ if (nexthdr < 0) {
2848 + if (nexthdr == -EBADMSG) {
2849 + xfrm_audit_state_icvfail(x, skb,
2850 + x->type->proto);
2851 +diff --git a/net/xfrm/xfrm_interface.c b/net/xfrm/xfrm_interface.c
2852 +index 317fe9c92932..6f00f88adab9 100644
2853 +--- a/net/xfrm/xfrm_interface.c
2854 ++++ b/net/xfrm/xfrm_interface.c
2855 +@@ -780,7 +780,28 @@ static void __net_exit xfrmi_exit_net(struct net *net)
2856 + rtnl_unlock();
2857 + }
2858 +
2859 ++static void __net_exit xfrmi_exit_batch_net(struct list_head *net_exit_list)
2860 ++{
2861 ++ struct net *net;
2862 ++ LIST_HEAD(list);
2863 ++
2864 ++ rtnl_lock();
2865 ++ list_for_each_entry(net, net_exit_list, exit_list) {
2866 ++ struct xfrmi_net *xfrmn = net_generic(net, xfrmi_net_id);
2867 ++ struct xfrm_if __rcu **xip;
2868 ++ struct xfrm_if *xi;
2869 ++
2870 ++ for (xip = &xfrmn->xfrmi[0];
2871 ++ (xi = rtnl_dereference(*xip)) != NULL;
2872 ++ xip = &xi->next)
2873 ++ unregister_netdevice_queue(xi->dev, &list);
2874 ++ }
2875 ++ unregister_netdevice_many(&list);
2876 ++ rtnl_unlock();
2877 ++}
2878 ++
2879 + static struct pernet_operations xfrmi_net_ops = {
2880 ++ .exit_batch = xfrmi_exit_batch_net,
2881 + .init = xfrmi_init_net,
2882 + .exit = xfrmi_exit_net,
2883 + .id = &xfrmi_net_id,
2884 +diff --git a/net/xfrm/xfrm_output.c b/net/xfrm/xfrm_output.c
2885 +index 6d20fbcde000..c46162887b94 100644
2886 +--- a/net/xfrm/xfrm_output.c
2887 ++++ b/net/xfrm/xfrm_output.c
2888 +@@ -235,18 +235,20 @@ int xfrm_output(struct sock *sk, struct sk_buff *skb)
2889 + xfrm_state_hold(x);
2890 +
2891 + if (skb_is_gso(skb)) {
2892 +- skb_shinfo(skb)->gso_type |= SKB_GSO_ESP;
2893 ++ if (skb->inner_protocol)
2894 ++ return xfrm_output_gso(net, sk, skb);
2895 +
2896 +- return xfrm_output2(net, sk, skb);
2897 ++ skb_shinfo(skb)->gso_type |= SKB_GSO_ESP;
2898 ++ goto out;
2899 + }
2900 +
2901 + if (x->xso.dev && x->xso.dev->features & NETIF_F_HW_ESP_TX_CSUM)
2902 + goto out;
2903 ++ } else {
2904 ++ if (skb_is_gso(skb))
2905 ++ return xfrm_output_gso(net, sk, skb);
2906 + }
2907 +
2908 +- if (skb_is_gso(skb))
2909 +- return xfrm_output_gso(net, sk, skb);
2910 +-
2911 + if (skb->ip_summed == CHECKSUM_PARTIAL) {
2912 + err = skb_checksum_help(skb);
2913 + if (err) {
2914 +@@ -283,7 +285,8 @@ void xfrm_local_error(struct sk_buff *skb, int mtu)
2915 +
2916 + if (skb->protocol == htons(ETH_P_IP))
2917 + proto = AF_INET;
2918 +- else if (skb->protocol == htons(ETH_P_IPV6))
2919 ++ else if (skb->protocol == htons(ETH_P_IPV6) &&
2920 ++ skb->sk->sk_family == AF_INET6)
2921 + proto = AF_INET6;
2922 + else
2923 + return;
2924 +diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
2925 +index b30c074160e3..939f3adf075a 100644
2926 +--- a/net/xfrm/xfrm_policy.c
2927 ++++ b/net/xfrm/xfrm_policy.c
2928 +@@ -730,12 +730,7 @@ static void xfrm_policy_requeue(struct xfrm_policy *old,
2929 + static bool xfrm_policy_mark_match(struct xfrm_policy *policy,
2930 + struct xfrm_policy *pol)
2931 + {
2932 +- u32 mark = policy->mark.v & policy->mark.m;
2933 +-
2934 +- if (policy->mark.v == pol->mark.v && policy->mark.m == pol->mark.m)
2935 +- return true;
2936 +-
2937 +- if ((mark & pol->mark.m) == pol->mark.v &&
2938 ++ if (policy->mark.v == pol->mark.v &&
2939 + policy->priority == pol->priority)
2940 + return true;
2941 +
2942 +diff --git a/samples/bpf/lwt_len_hist_user.c b/samples/bpf/lwt_len_hist_user.c
2943 +index 587b68b1f8dd..430a4b7e353e 100644
2944 +--- a/samples/bpf/lwt_len_hist_user.c
2945 ++++ b/samples/bpf/lwt_len_hist_user.c
2946 +@@ -15,8 +15,6 @@
2947 + #define MAX_INDEX 64
2948 + #define MAX_STARS 38
2949 +
2950 +-char bpf_log_buf[BPF_LOG_BUF_SIZE];
2951 +-
2952 + static void stars(char *str, long val, long max, int width)
2953 + {
2954 + int i;
2955 +diff --git a/security/commoncap.c b/security/commoncap.c
2956 +index 3023b4ad38a7..f86557a8e43f 100644
2957 +--- a/security/commoncap.c
2958 ++++ b/security/commoncap.c
2959 +@@ -819,6 +819,7 @@ int cap_bprm_set_creds(struct linux_binprm *bprm)
2960 + int ret;
2961 + kuid_t root_uid;
2962 +
2963 ++ new->cap_ambient = old->cap_ambient;
2964 + if (WARN_ON(!cap_ambient_invariant_ok(old)))
2965 + return -EPERM;
2966 +
2967 +diff --git a/sound/core/hwdep.c b/sound/core/hwdep.c
2968 +index 26e71cf05f1e..600ab2eb1b50 100644
2969 +--- a/sound/core/hwdep.c
2970 ++++ b/sound/core/hwdep.c
2971 +@@ -231,12 +231,12 @@ static int snd_hwdep_dsp_load(struct snd_hwdep *hw,
2972 + if (info.index >= 32)
2973 + return -EINVAL;
2974 + /* check whether the dsp was already loaded */
2975 +- if (hw->dsp_loaded & (1 << info.index))
2976 ++ if (hw->dsp_loaded & (1u << info.index))
2977 + return -EBUSY;
2978 + err = hw->ops.dsp_load(hw, &info);
2979 + if (err < 0)
2980 + return err;
2981 +- hw->dsp_loaded |= (1 << info.index);
2982 ++ hw->dsp_loaded |= (1u << info.index);
2983 + return 0;
2984 + }
2985 +
2986 +diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
2987 +index 09a37d4c81ec..b06f7d52faad 100644
2988 +--- a/sound/pci/hda/patch_realtek.c
2989 ++++ b/sound/pci/hda/patch_realtek.c
2990 +@@ -387,6 +387,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec)
2991 + case 0x10ec0282:
2992 + case 0x10ec0283:
2993 + case 0x10ec0286:
2994 ++ case 0x10ec0287:
2995 + case 0x10ec0288:
2996 + case 0x10ec0285:
2997 + case 0x10ec0298:
2998 +@@ -5152,18 +5153,9 @@ static void alc_fixup_tpt470_dock(struct hda_codec *codec,
2999 + { 0x19, 0x21a11010 }, /* dock mic */
3000 + { }
3001 + };
3002 +- /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
3003 +- * the speaker output becomes too low by some reason on Thinkpads with
3004 +- * ALC298 codec
3005 +- */
3006 +- static hda_nid_t preferred_pairs[] = {
3007 +- 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
3008 +- 0
3009 +- };
3010 + struct alc_spec *spec = codec->spec;
3011 +
3012 + if (action == HDA_FIXUP_ACT_PRE_PROBE) {
3013 +- spec->gen.preferred_dacs = preferred_pairs;
3014 + spec->parse_flags = HDA_PINCFG_NO_HP_FIXUP;
3015 + snd_hda_apply_pincfgs(codec, pincfgs);
3016 + } else if (action == HDA_FIXUP_ACT_INIT) {
3017 +@@ -5176,6 +5168,23 @@ static void alc_fixup_tpt470_dock(struct hda_codec *codec,
3018 + }
3019 + }
3020 +
3021 ++static void alc_fixup_tpt470_dacs(struct hda_codec *codec,
3022 ++ const struct hda_fixup *fix, int action)
3023 ++{
3024 ++ /* Assure the speaker pin to be coupled with DAC NID 0x03; otherwise
3025 ++ * the speaker output becomes too low by some reason on Thinkpads with
3026 ++ * ALC298 codec
3027 ++ */
3028 ++ static hda_nid_t preferred_pairs[] = {
3029 ++ 0x14, 0x03, 0x17, 0x02, 0x21, 0x02,
3030 ++ 0
3031 ++ };
3032 ++ struct alc_spec *spec = codec->spec;
3033 ++
3034 ++ if (action == HDA_FIXUP_ACT_PRE_PROBE)
3035 ++ spec->gen.preferred_dacs = preferred_pairs;
3036 ++}
3037 ++
3038 + static void alc_shutup_dell_xps13(struct hda_codec *codec)
3039 + {
3040 + struct alc_spec *spec = codec->spec;
3041 +@@ -5708,6 +5717,7 @@ enum {
3042 + ALC700_FIXUP_INTEL_REFERENCE,
3043 + ALC274_FIXUP_DELL_BIND_DACS,
3044 + ALC274_FIXUP_DELL_AIO_LINEOUT_VERB,
3045 ++ ALC298_FIXUP_TPT470_DOCK_FIX,
3046 + ALC298_FIXUP_TPT470_DOCK,
3047 + ALC255_FIXUP_DUMMY_LINEOUT_VERB,
3048 + ALC255_FIXUP_DELL_HEADSET_MIC,
3049 +@@ -6605,12 +6615,18 @@ static const struct hda_fixup alc269_fixups[] = {
3050 + .chained = true,
3051 + .chain_id = ALC274_FIXUP_DELL_BIND_DACS
3052 + },
3053 +- [ALC298_FIXUP_TPT470_DOCK] = {
3054 ++ [ALC298_FIXUP_TPT470_DOCK_FIX] = {
3055 + .type = HDA_FIXUP_FUNC,
3056 + .v.func = alc_fixup_tpt470_dock,
3057 + .chained = true,
3058 + .chain_id = ALC293_FIXUP_LENOVO_SPK_NOISE
3059 + },
3060 ++ [ALC298_FIXUP_TPT470_DOCK] = {
3061 ++ .type = HDA_FIXUP_FUNC,
3062 ++ .v.func = alc_fixup_tpt470_dacs,
3063 ++ .chained = true,
3064 ++ .chain_id = ALC298_FIXUP_TPT470_DOCK_FIX
3065 ++ },
3066 + [ALC255_FIXUP_DUMMY_LINEOUT_VERB] = {
3067 + .type = HDA_FIXUP_PINS,
3068 + .v.pins = (const struct hda_pintbl[]) {
3069 +@@ -7173,6 +7189,7 @@ static const struct hda_model_fixup alc269_fixup_models[] = {
3070 + {.id = ALC292_FIXUP_TPT440_DOCK, .name = "tpt440-dock"},
3071 + {.id = ALC292_FIXUP_TPT440, .name = "tpt440"},
3072 + {.id = ALC292_FIXUP_TPT460, .name = "tpt460"},
3073 ++ {.id = ALC298_FIXUP_TPT470_DOCK_FIX, .name = "tpt470-dock-fix"},
3074 + {.id = ALC298_FIXUP_TPT470_DOCK, .name = "tpt470-dock"},
3075 + {.id = ALC233_FIXUP_LENOVO_MULTI_CODECS, .name = "dual-codecs"},
3076 + {.id = ALC700_FIXUP_INTEL_REFERENCE, .name = "alc700-ref"},
3077 +@@ -7824,6 +7841,7 @@ static int patch_alc269(struct hda_codec *codec)
3078 + case 0x10ec0215:
3079 + case 0x10ec0245:
3080 + case 0x10ec0285:
3081 ++ case 0x10ec0287:
3082 + case 0x10ec0289:
3083 + spec->codec_variant = ALC269_TYPE_ALC215;
3084 + spec->shutup = alc225_shutup;
3085 +@@ -8962,6 +8980,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = {
3086 + HDA_CODEC_ENTRY(0x10ec0284, "ALC284", patch_alc269),
3087 + HDA_CODEC_ENTRY(0x10ec0285, "ALC285", patch_alc269),
3088 + HDA_CODEC_ENTRY(0x10ec0286, "ALC286", patch_alc269),
3089 ++ HDA_CODEC_ENTRY(0x10ec0287, "ALC287", patch_alc269),
3090 + HDA_CODEC_ENTRY(0x10ec0288, "ALC288", patch_alc269),
3091 + HDA_CODEC_ENTRY(0x10ec0289, "ALC289", patch_alc269),
3092 + HDA_CODEC_ENTRY(0x10ec0290, "ALC290", patch_alc269),
3093 +diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
3094 +index 7a5c665cf4e4..8a0211131fc6 100644
3095 +--- a/sound/usb/mixer.c
3096 ++++ b/sound/usb/mixer.c
3097 +@@ -1186,6 +1186,14 @@ static void volume_control_quirks(struct usb_mixer_elem_info *cval,
3098 + cval->res = 384;
3099 + }
3100 + break;
3101 ++ case USB_ID(0x0495, 0x3042): /* ESS Technology Asus USB DAC */
3102 ++ if ((strstr(kctl->id.name, "Playback Volume") != NULL) ||
3103 ++ strstr(kctl->id.name, "Capture Volume") != NULL) {
3104 ++ cval->min >>= 8;
3105 ++ cval->max = 0;
3106 ++ cval->res = 1;
3107 ++ }
3108 ++ break;
3109 + }
3110 + }
3111 +
3112 +diff --git a/sound/usb/mixer_maps.c b/sound/usb/mixer_maps.c
3113 +index 1689e4f242df..10323e6f7f97 100644
3114 +--- a/sound/usb/mixer_maps.c
3115 ++++ b/sound/usb/mixer_maps.c
3116 +@@ -401,6 +401,21 @@ static const struct usbmix_connector_map trx40_mobo_connector_map[] = {
3117 + {}
3118 + };
3119 +
3120 ++/* Rear panel + front mic on Gigabyte TRX40 Aorus Master with ALC1220-VB */
3121 ++static const struct usbmix_name_map aorus_master_alc1220vb_map[] = {
3122 ++ { 17, NULL }, /* OT, IEC958?, disabled */
3123 ++ { 19, NULL, 12 }, /* FU, Input Gain Pad - broken response, disabled */
3124 ++ { 16, "Line Out" }, /* OT */
3125 ++ { 22, "Line Out Playback" }, /* FU */
3126 ++ { 7, "Line" }, /* IT */
3127 ++ { 19, "Line Capture" }, /* FU */
3128 ++ { 8, "Mic" }, /* IT */
3129 ++ { 20, "Mic Capture" }, /* FU */
3130 ++ { 9, "Front Mic" }, /* IT */
3131 ++ { 21, "Front Mic Capture" }, /* FU */
3132 ++ {}
3133 ++};
3134 ++
3135 + /*
3136 + * Control map entries
3137 + */
3138 +@@ -520,6 +535,10 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
3139 + .id = USB_ID(0x05a7, 0x1020),
3140 + .map = bose_companion5_map,
3141 + },
3142 ++ { /* Gigabyte TRX40 Aorus Master (rear panel + front mic) */
3143 ++ .id = USB_ID(0x0414, 0xa001),
3144 ++ .map = aorus_master_alc1220vb_map,
3145 ++ },
3146 + { /* Gigabyte TRX40 Aorus Pro WiFi */
3147 + .id = USB_ID(0x0414, 0xa002),
3148 + .map = trx40_mobo_map,
3149 +@@ -543,6 +562,11 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
3150 + .map = trx40_mobo_map,
3151 + .connector_map = trx40_mobo_connector_map,
3152 + },
3153 ++ { /* Asrock TRX40 Creator */
3154 ++ .id = USB_ID(0x26ce, 0x0a01),
3155 ++ .map = trx40_mobo_map,
3156 ++ .connector_map = trx40_mobo_connector_map,
3157 ++ },
3158 + { 0 } /* terminator */
3159 + };
3160 +
3161 +diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
3162 +index 774aeedde071..b798eae0a785 100644
3163 +--- a/sound/usb/quirks-table.h
3164 ++++ b/sound/usb/quirks-table.h
3165 +@@ -3412,6 +3412,32 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"),
3166 + ALC1220_VB_DESKTOP(0x0414, 0xa002), /* Gigabyte TRX40 Aorus Pro WiFi */
3167 + ALC1220_VB_DESKTOP(0x0db0, 0x0d64), /* MSI TRX40 Creator */
3168 + ALC1220_VB_DESKTOP(0x0db0, 0x543d), /* MSI TRX40 */
3169 ++ALC1220_VB_DESKTOP(0x26ce, 0x0a01), /* Asrock TRX40 Creator */
3170 + #undef ALC1220_VB_DESKTOP
3171 +
3172 ++/* Two entries for Gigabyte TRX40 Aorus Master:
3173 ++ * TRX40 Aorus Master has two USB-audio devices, one for the front headphone
3174 ++ * with ESS SABRE9218 DAC chip, while another for the rest I/O (the rear
3175 ++ * panel and the front mic) with Realtek ALC1220-VB.
3176 ++ * Here we provide two distinct names for making UCM profiles easier.
3177 ++ */
3178 ++{
3179 ++ USB_DEVICE(0x0414, 0xa000),
3180 ++ .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
3181 ++ .vendor_name = "Gigabyte",
3182 ++ .product_name = "Aorus Master Front Headphone",
3183 ++ .profile_name = "Gigabyte-Aorus-Master-Front-Headphone",
3184 ++ .ifnum = QUIRK_NO_INTERFACE
3185 ++ }
3186 ++},
3187 ++{
3188 ++ USB_DEVICE(0x0414, 0xa001),
3189 ++ .driver_info = (unsigned long) & (const struct snd_usb_audio_quirk) {
3190 ++ .vendor_name = "Gigabyte",
3191 ++ .product_name = "Aorus Master Main Audio",
3192 ++ .profile_name = "Gigabyte-Aorus-Master-Main-Audio",
3193 ++ .ifnum = QUIRK_NO_INTERFACE
3194 ++ }
3195 ++},
3196 ++
3197 + #undef USB_DEVICE_VENDOR_SPEC