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: Sun, 12 Jan 2020 15:00:26
Message-Id: 1578841201.cab08459b025d6855858e1f44b879ffc446a00e9.mpagano@gentoo
1 commit: cab08459b025d6855858e1f44b879ffc446a00e9
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Sun Jan 12 15:00:01 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Sun Jan 12 15:00:01 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=cab08459
7
8 Linux patch 4.19.95
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1094_linux-4.19.95.patch | 2671 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2675 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index a11cb8a..ca89dab 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -415,6 +415,10 @@ Patch: 1093_linux-4.19.94.patch
21 From: https://www.kernel.org
22 Desc: Linux 4.19.94
23
24 +Patch: 1094_linux-4.19.95.patch
25 +From: https://www.kernel.org
26 +Desc: Linux 4.19.95
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/1094_linux-4.19.95.patch b/1094_linux-4.19.95.patch
33 new file mode 100644
34 index 0000000..2b45c5e
35 --- /dev/null
36 +++ b/1094_linux-4.19.95.patch
37 @@ -0,0 +1,2671 @@
38 +diff --git a/Makefile b/Makefile
39 +index 3c892a77194f..386ab98e2f58 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 = 94
47 ++SUBLEVEL = 95
48 + EXTRAVERSION =
49 + NAME = "People's Front"
50 +
51 +diff --git a/arch/arm/boot/dts/am437x-gp-evm.dts b/arch/arm/boot/dts/am437x-gp-evm.dts
52 +index 5b97c20c5ed4..8a17eca2bc97 100644
53 +--- a/arch/arm/boot/dts/am437x-gp-evm.dts
54 ++++ b/arch/arm/boot/dts/am437x-gp-evm.dts
55 +@@ -83,7 +83,7 @@
56 + };
57 +
58 + lcd0: display {
59 +- compatible = "osddisplays,osd057T0559-34ts", "panel-dpi";
60 ++ compatible = "osddisplays,osd070t1718-19ts", "panel-dpi";
61 + label = "lcd";
62 +
63 + backlight = <&lcd_bl>;
64 +diff --git a/arch/arm/boot/dts/am43x-epos-evm.dts b/arch/arm/boot/dts/am43x-epos-evm.dts
65 +index 6502d3397653..12735cf9674b 100644
66 +--- a/arch/arm/boot/dts/am43x-epos-evm.dts
67 ++++ b/arch/arm/boot/dts/am43x-epos-evm.dts
68 +@@ -45,7 +45,7 @@
69 + };
70 +
71 + lcd0: display {
72 +- compatible = "osddisplays,osd057T0559-34ts", "panel-dpi";
73 ++ compatible = "osddisplays,osd070t1718-19ts", "panel-dpi";
74 + label = "lcd";
75 +
76 + backlight = <&lcd_bl>;
77 +diff --git a/arch/arm/boot/dts/bcm-cygnus.dtsi b/arch/arm/boot/dts/bcm-cygnus.dtsi
78 +index 253df7170a4e..887a60c317e9 100644
79 +--- a/arch/arm/boot/dts/bcm-cygnus.dtsi
80 ++++ b/arch/arm/boot/dts/bcm-cygnus.dtsi
81 +@@ -169,8 +169,8 @@
82 + mdio: mdio@18002000 {
83 + compatible = "brcm,iproc-mdio";
84 + reg = <0x18002000 0x8>;
85 +- #size-cells = <1>;
86 +- #address-cells = <0>;
87 ++ #size-cells = <0>;
88 ++ #address-cells = <1>;
89 + status = "disabled";
90 +
91 + gphy0: ethernet-phy@0 {
92 +diff --git a/arch/arm/boot/dts/bcm283x.dtsi b/arch/arm/boot/dts/bcm283x.dtsi
93 +index 31b29646b14c..c9322a56300d 100644
94 +--- a/arch/arm/boot/dts/bcm283x.dtsi
95 ++++ b/arch/arm/boot/dts/bcm283x.dtsi
96 +@@ -39,7 +39,7 @@
97 +
98 + trips {
99 + cpu-crit {
100 +- temperature = <80000>;
101 ++ temperature = <90000>;
102 + hysteresis = <0>;
103 + type = "critical";
104 + };
105 +diff --git a/arch/arm/boot/dts/bcm5301x.dtsi b/arch/arm/boot/dts/bcm5301x.dtsi
106 +index bc607d11eef8..a678fb7c9e3b 100644
107 +--- a/arch/arm/boot/dts/bcm5301x.dtsi
108 ++++ b/arch/arm/boot/dts/bcm5301x.dtsi
109 +@@ -350,8 +350,8 @@
110 + mdio: mdio@18003000 {
111 + compatible = "brcm,iproc-mdio";
112 + reg = <0x18003000 0x8>;
113 +- #size-cells = <1>;
114 +- #address-cells = <0>;
115 ++ #size-cells = <0>;
116 ++ #address-cells = <1>;
117 + };
118 +
119 + mdio-bus-mux {
120 +diff --git a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
121 +index 818021126559..695303435003 100644
122 +--- a/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
123 ++++ b/arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
124 +@@ -175,7 +175,7 @@
125 + flash0: n25q256a@0 {
126 + #address-cells = <1>;
127 + #size-cells = <1>;
128 +- compatible = "micron,n25q256a";
129 ++ compatible = "micron,n25q256a", "jedec,spi-nor";
130 + spi-max-frequency = <29000000>;
131 + reg = <0>;
132 + };
133 +diff --git a/arch/arm/boot/dts/imx6ul.dtsi b/arch/arm/boot/dts/imx6ul.dtsi
134 +index 50834a43e5fb..adecd6e08468 100644
135 +--- a/arch/arm/boot/dts/imx6ul.dtsi
136 ++++ b/arch/arm/boot/dts/imx6ul.dtsi
137 +@@ -87,6 +87,8 @@
138 + "pll1_sys";
139 + arm-supply = <&reg_arm>;
140 + soc-supply = <&reg_soc>;
141 ++ nvmem-cells = <&cpu_speed_grade>;
142 ++ nvmem-cell-names = "speed_grade";
143 + };
144 + };
145 +
146 +@@ -930,6 +932,10 @@
147 + tempmon_temp_grade: temp-grade@20 {
148 + reg = <0x20 4>;
149 + };
150 ++
151 ++ cpu_speed_grade: speed-grade@10 {
152 ++ reg = <0x10 4>;
153 ++ };
154 + };
155 +
156 + lcdif: lcdif@21c8000 {
157 +diff --git a/arch/arm/mach-vexpress/spc.c b/arch/arm/mach-vexpress/spc.c
158 +index 0f5381d13494..55bbbc3b328f 100644
159 +--- a/arch/arm/mach-vexpress/spc.c
160 ++++ b/arch/arm/mach-vexpress/spc.c
161 +@@ -551,8 +551,9 @@ static struct clk *ve_spc_clk_register(struct device *cpu_dev)
162 +
163 + static int __init ve_spc_clk_init(void)
164 + {
165 +- int cpu;
166 ++ int cpu, cluster;
167 + struct clk *clk;
168 ++ bool init_opp_table[MAX_CLUSTERS] = { false };
169 +
170 + if (!info)
171 + return 0; /* Continue only if SPC is initialised */
172 +@@ -578,8 +579,17 @@ static int __init ve_spc_clk_init(void)
173 + continue;
174 + }
175 +
176 ++ cluster = topology_physical_package_id(cpu_dev->id);
177 ++ if (init_opp_table[cluster])
178 ++ continue;
179 ++
180 + if (ve_init_opp_table(cpu_dev))
181 + pr_warn("failed to initialise cpu%d opp table\n", cpu);
182 ++ else if (dev_pm_opp_set_sharing_cpus(cpu_dev,
183 ++ topology_core_cpumask(cpu_dev->id)))
184 ++ pr_warn("failed to mark OPPs shared for cpu%d\n", cpu);
185 ++ else
186 ++ init_opp_table[cluster] = true;
187 + }
188 +
189 + platform_device_register_simple("vexpress-spc-cpufreq", -1, NULL, 0);
190 +diff --git a/arch/mips/net/ebpf_jit.c b/arch/mips/net/ebpf_jit.c
191 +index 9bda82ed75eb..3832c4628608 100644
192 +--- a/arch/mips/net/ebpf_jit.c
193 ++++ b/arch/mips/net/ebpf_jit.c
194 +@@ -586,6 +586,7 @@ static void emit_const_to_reg(struct jit_ctx *ctx, int dst, u64 value)
195 + static int emit_bpf_tail_call(struct jit_ctx *ctx, int this_idx)
196 + {
197 + int off, b_off;
198 ++ int tcc_reg;
199 +
200 + ctx->flags |= EBPF_SEEN_TC;
201 + /*
202 +@@ -598,14 +599,14 @@ static int emit_bpf_tail_call(struct jit_ctx *ctx, int this_idx)
203 + b_off = b_imm(this_idx + 1, ctx);
204 + emit_instr(ctx, bne, MIPS_R_AT, MIPS_R_ZERO, b_off);
205 + /*
206 +- * if (--TCC < 0)
207 ++ * if (TCC-- < 0)
208 + * goto out;
209 + */
210 + /* Delay slot */
211 +- emit_instr(ctx, daddiu, MIPS_R_T5,
212 +- (ctx->flags & EBPF_TCC_IN_V1) ? MIPS_R_V1 : MIPS_R_S4, -1);
213 ++ tcc_reg = (ctx->flags & EBPF_TCC_IN_V1) ? MIPS_R_V1 : MIPS_R_S4;
214 ++ emit_instr(ctx, daddiu, MIPS_R_T5, tcc_reg, -1);
215 + b_off = b_imm(this_idx + 1, ctx);
216 +- emit_instr(ctx, bltz, MIPS_R_T5, b_off);
217 ++ emit_instr(ctx, bltz, tcc_reg, b_off);
218 + /*
219 + * prog = array->ptrs[index];
220 + * if (prog == NULL)
221 +diff --git a/arch/parisc/include/asm/cmpxchg.h b/arch/parisc/include/asm/cmpxchg.h
222 +index f627c37dad9c..ab5c215cf46c 100644
223 +--- a/arch/parisc/include/asm/cmpxchg.h
224 ++++ b/arch/parisc/include/asm/cmpxchg.h
225 +@@ -44,8 +44,14 @@ __xchg(unsigned long x, __volatile__ void *ptr, int size)
226 + ** if (((unsigned long)p & 0xf) == 0)
227 + ** return __ldcw(p);
228 + */
229 +-#define xchg(ptr, x) \
230 +- ((__typeof__(*(ptr)))__xchg((unsigned long)(x), (ptr), sizeof(*(ptr))))
231 ++#define xchg(ptr, x) \
232 ++({ \
233 ++ __typeof__(*(ptr)) __ret; \
234 ++ __typeof__(*(ptr)) _x_ = (x); \
235 ++ __ret = (__typeof__(*(ptr))) \
236 ++ __xchg((unsigned long)_x_, (ptr), sizeof(*(ptr))); \
237 ++ __ret; \
238 ++})
239 +
240 + /* bug catcher for when unsupported size is used - won't link */
241 + extern void __cmpxchg_called_with_bad_pointer(void);
242 +diff --git a/arch/parisc/kernel/drivers.c b/arch/parisc/kernel/drivers.c
243 +index 5eb979d04b90..a1a5e4c59e6b 100644
244 +--- a/arch/parisc/kernel/drivers.c
245 ++++ b/arch/parisc/kernel/drivers.c
246 +@@ -789,7 +789,7 @@ EXPORT_SYMBOL(device_to_hwpath);
247 + static void walk_native_bus(unsigned long io_io_low, unsigned long io_io_high,
248 + struct device *parent);
249 +
250 +-static void walk_lower_bus(struct parisc_device *dev)
251 ++static void __init walk_lower_bus(struct parisc_device *dev)
252 + {
253 + unsigned long io_io_low, io_io_high;
254 +
255 +diff --git a/arch/powerpc/include/asm/spinlock.h b/arch/powerpc/include/asm/spinlock.h
256 +index 685c72310f5d..3198dde87d4d 100644
257 +--- a/arch/powerpc/include/asm/spinlock.h
258 ++++ b/arch/powerpc/include/asm/spinlock.h
259 +@@ -19,6 +19,7 @@
260 + *
261 + * (the type definitions are in asm/spinlock_types.h)
262 + */
263 ++#include <linux/jump_label.h>
264 + #include <linux/irqflags.h>
265 + #ifdef CONFIG_PPC64
266 + #include <asm/paca.h>
267 +@@ -53,10 +54,12 @@
268 + #endif
269 +
270 + #ifdef CONFIG_PPC_PSERIES
271 ++DECLARE_STATIC_KEY_FALSE(shared_processor);
272 ++
273 + #define vcpu_is_preempted vcpu_is_preempted
274 + static inline bool vcpu_is_preempted(int cpu)
275 + {
276 +- if (!firmware_has_feature(FW_FEATURE_SPLPAR))
277 ++ if (!static_branch_unlikely(&shared_processor))
278 + return false;
279 + return !!(be32_to_cpu(lppaca_of(cpu).yield_count) & 1);
280 + }
281 +diff --git a/arch/powerpc/mm/mem.c b/arch/powerpc/mm/mem.c
282 +index 04ccb274a620..9a6afd9f3f9b 100644
283 +--- a/arch/powerpc/mm/mem.c
284 ++++ b/arch/powerpc/mm/mem.c
285 +@@ -344,6 +344,14 @@ void __init mem_init(void)
286 + BUILD_BUG_ON(MMU_PAGE_COUNT > 16);
287 +
288 + #ifdef CONFIG_SWIOTLB
289 ++ /*
290 ++ * Some platforms (e.g. 85xx) limit DMA-able memory way below
291 ++ * 4G. We force memblock to bottom-up mode to ensure that the
292 ++ * memory allocated in swiotlb_init() is DMA-able.
293 ++ * As it's the last memblock allocation, no need to reset it
294 ++ * back to to-down.
295 ++ */
296 ++ memblock_set_bottom_up(true);
297 + swiotlb_init(0);
298 + #endif
299 +
300 +diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c
301 +index 67f49159ea70..c2d318d1df02 100644
302 +--- a/arch/powerpc/platforms/pseries/setup.c
303 ++++ b/arch/powerpc/platforms/pseries/setup.c
304 +@@ -75,6 +75,9 @@
305 + #include "pseries.h"
306 + #include "../../../../drivers/pci/pci.h"
307 +
308 ++DEFINE_STATIC_KEY_FALSE(shared_processor);
309 ++EXPORT_SYMBOL_GPL(shared_processor);
310 ++
311 + int CMO_PrPSP = -1;
312 + int CMO_SecPSP = -1;
313 + unsigned long CMO_PageSize = (ASM_CONST(1) << IOMMU_PAGE_SHIFT_4K);
314 +@@ -761,6 +764,10 @@ static void __init pSeries_setup_arch(void)
315 +
316 + if (firmware_has_feature(FW_FEATURE_LPAR)) {
317 + vpa_init(boot_cpuid);
318 ++
319 ++ if (lppaca_shared_proc(get_lppaca()))
320 ++ static_branch_enable(&shared_processor);
321 ++
322 + ppc_md.power_save = pseries_lpar_idle;
323 + ppc_md.enable_pmcs = pseries_lpar_enable_pmcs;
324 + #ifdef CONFIG_PCI_IOV
325 +diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
326 +index ce6a3f75065b..fdccb7689bb9 100644
327 +--- a/arch/s390/purgatory/Makefile
328 ++++ b/arch/s390/purgatory/Makefile
329 +@@ -13,8 +13,10 @@ $(obj)/sha256.o: $(srctree)/lib/sha256.c FORCE
330 + $(obj)/mem.o: $(srctree)/arch/s390/lib/mem.S FORCE
331 + $(call if_changed_rule,as_o_S)
332 +
333 +-$(obj)/string.o: $(srctree)/arch/s390/lib/string.c FORCE
334 +- $(call if_changed_rule,cc_o_c)
335 ++KCOV_INSTRUMENT := n
336 ++GCOV_PROFILE := n
337 ++UBSAN_SANITIZE := n
338 ++KASAN_SANITIZE := n
339 +
340 + LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib
341 + LDFLAGS_purgatory.ro += -z nodefaultlib
342 +diff --git a/arch/s390/purgatory/string.c b/arch/s390/purgatory/string.c
343 +new file mode 100644
344 +index 000000000000..c98c22a72db7
345 +--- /dev/null
346 ++++ b/arch/s390/purgatory/string.c
347 +@@ -0,0 +1,3 @@
348 ++// SPDX-License-Identifier: GPL-2.0
349 ++#define __HAVE_ARCH_MEMCMP /* arch function */
350 ++#include "../lib/string.c"
351 +diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
352 +index c9625bff4328..429389489eed 100644
353 +--- a/arch/x86/events/core.c
354 ++++ b/arch/x86/events/core.c
355 +@@ -375,7 +375,7 @@ int x86_add_exclusive(unsigned int what)
356 + * LBR and BTS are still mutually exclusive.
357 + */
358 + if (x86_pmu.lbr_pt_coexist && what == x86_lbr_exclusive_pt)
359 +- return 0;
360 ++ goto out;
361 +
362 + if (!atomic_inc_not_zero(&x86_pmu.lbr_exclusive[what])) {
363 + mutex_lock(&pmc_reserve_mutex);
364 +@@ -387,6 +387,7 @@ int x86_add_exclusive(unsigned int what)
365 + mutex_unlock(&pmc_reserve_mutex);
366 + }
367 +
368 ++out:
369 + atomic_inc(&active_events);
370 + return 0;
371 +
372 +@@ -397,11 +398,15 @@ fail_unlock:
373 +
374 + void x86_del_exclusive(unsigned int what)
375 + {
376 ++ atomic_dec(&active_events);
377 ++
378 ++ /*
379 ++ * See the comment in x86_add_exclusive().
380 ++ */
381 + if (x86_pmu.lbr_pt_coexist && what == x86_lbr_exclusive_pt)
382 + return;
383 +
384 + atomic_dec(&x86_pmu.lbr_exclusive[what]);
385 +- atomic_dec(&active_events);
386 + }
387 +
388 + int x86_setup_perfctr(struct perf_event *event)
389 +diff --git a/arch/x86/platform/efi/quirks.c b/arch/x86/platform/efi/quirks.c
390 +index 844d31cb8a0c..c9873c9168ad 100644
391 +--- a/arch/x86/platform/efi/quirks.c
392 ++++ b/arch/x86/platform/efi/quirks.c
393 +@@ -259,10 +259,6 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
394 + return;
395 + }
396 +
397 +- /* No need to reserve regions that will never be freed. */
398 +- if (md.attribute & EFI_MEMORY_RUNTIME)
399 +- return;
400 +-
401 + size += addr % EFI_PAGE_SIZE;
402 + size = round_up(size, EFI_PAGE_SIZE);
403 + addr = round_down(addr, EFI_PAGE_SIZE);
404 +@@ -292,6 +288,8 @@ void __init efi_arch_mem_reserve(phys_addr_t addr, u64 size)
405 + early_memunmap(new, new_size);
406 +
407 + efi_memmap_install(new_phys, num_entries);
408 ++ e820__range_update(addr, size, E820_TYPE_RAM, E820_TYPE_RESERVED);
409 ++ e820__update_table(e820_table);
410 + }
411 +
412 + /*
413 +diff --git a/block/blk-map.c b/block/blk-map.c
414 +index db9373bd31ac..9d8627acc2f5 100644
415 +--- a/block/blk-map.c
416 ++++ b/block/blk-map.c
417 +@@ -145,7 +145,7 @@ int blk_rq_map_user_iov(struct request_queue *q, struct request *rq,
418 + return 0;
419 +
420 + unmap_rq:
421 +- __blk_rq_unmap_user(bio);
422 ++ blk_rq_unmap_user(bio);
423 + fail:
424 + rq->bio = NULL;
425 + return ret;
426 +diff --git a/drivers/cpufreq/imx6q-cpufreq.c b/drivers/cpufreq/imx6q-cpufreq.c
427 +index f4880a4f865b..d8c3595e9023 100644
428 +--- a/drivers/cpufreq/imx6q-cpufreq.c
429 ++++ b/drivers/cpufreq/imx6q-cpufreq.c
430 +@@ -12,6 +12,7 @@
431 + #include <linux/cpu_cooling.h>
432 + #include <linux/err.h>
433 + #include <linux/module.h>
434 ++#include <linux/nvmem-consumer.h>
435 + #include <linux/of.h>
436 + #include <linux/of_address.h>
437 + #include <linux/pm_opp.h>
438 +@@ -295,20 +296,32 @@ put_node:
439 + #define OCOTP_CFG3_6ULL_SPEED_792MHZ 0x2
440 + #define OCOTP_CFG3_6ULL_SPEED_900MHZ 0x3
441 +
442 +-static void imx6ul_opp_check_speed_grading(struct device *dev)
443 ++static int imx6ul_opp_check_speed_grading(struct device *dev)
444 + {
445 +- struct device_node *np;
446 +- void __iomem *base;
447 + u32 val;
448 ++ int ret = 0;
449 +
450 +- np = of_find_compatible_node(NULL, NULL, "fsl,imx6ul-ocotp");
451 +- if (!np)
452 +- return;
453 ++ if (of_find_property(dev->of_node, "nvmem-cells", NULL)) {
454 ++ ret = nvmem_cell_read_u32(dev, "speed_grade", &val);
455 ++ if (ret)
456 ++ return ret;
457 ++ } else {
458 ++ struct device_node *np;
459 ++ void __iomem *base;
460 ++
461 ++ np = of_find_compatible_node(NULL, NULL, "fsl,imx6ul-ocotp");
462 ++ if (!np)
463 ++ return -ENOENT;
464 ++
465 ++ base = of_iomap(np, 0);
466 ++ of_node_put(np);
467 ++ if (!base) {
468 ++ dev_err(dev, "failed to map ocotp\n");
469 ++ return -EFAULT;
470 ++ }
471 +
472 +- base = of_iomap(np, 0);
473 +- if (!base) {
474 +- dev_err(dev, "failed to map ocotp\n");
475 +- goto put_node;
476 ++ val = readl_relaxed(base + OCOTP_CFG3);
477 ++ iounmap(base);
478 + }
479 +
480 + /*
481 +@@ -319,7 +332,6 @@ static void imx6ul_opp_check_speed_grading(struct device *dev)
482 + * 2b'11: 900000000Hz on i.MX6ULL only;
483 + * We need to set the max speed of ARM according to fuse map.
484 + */
485 +- val = readl_relaxed(base + OCOTP_CFG3);
486 + val >>= OCOTP_CFG3_SPEED_SHIFT;
487 + val &= 0x3;
488 +
489 +@@ -339,9 +351,7 @@ static void imx6ul_opp_check_speed_grading(struct device *dev)
490 + dev_warn(dev, "failed to disable 900MHz OPP\n");
491 + }
492 +
493 +- iounmap(base);
494 +-put_node:
495 +- of_node_put(np);
496 ++ return ret;
497 + }
498 +
499 + static int imx6q_cpufreq_probe(struct platform_device *pdev)
500 +@@ -399,10 +409,18 @@ static int imx6q_cpufreq_probe(struct platform_device *pdev)
501 + }
502 +
503 + if (of_machine_is_compatible("fsl,imx6ul") ||
504 +- of_machine_is_compatible("fsl,imx6ull"))
505 +- imx6ul_opp_check_speed_grading(cpu_dev);
506 +- else
507 ++ of_machine_is_compatible("fsl,imx6ull")) {
508 ++ ret = imx6ul_opp_check_speed_grading(cpu_dev);
509 ++ if (ret == -EPROBE_DEFER)
510 ++ return ret;
511 ++ if (ret) {
512 ++ dev_err(cpu_dev, "failed to read ocotp: %d\n",
513 ++ ret);
514 ++ return ret;
515 ++ }
516 ++ } else {
517 + imx6q_opp_check_speed_grading(cpu_dev);
518 ++ }
519 +
520 + /* Because we have added the OPPs here, we must free them */
521 + free_opp = true;
522 +diff --git a/drivers/firmware/efi/libstub/gop.c b/drivers/firmware/efi/libstub/gop.c
523 +index 24c461dea7af..fd8053f9556e 100644
524 +--- a/drivers/firmware/efi/libstub/gop.c
525 ++++ b/drivers/firmware/efi/libstub/gop.c
526 +@@ -85,30 +85,6 @@ setup_pixel_info(struct screen_info *si, u32 pixels_per_scan_line,
527 + }
528 + }
529 +
530 +-static efi_status_t
531 +-__gop_query32(efi_system_table_t *sys_table_arg,
532 +- struct efi_graphics_output_protocol_32 *gop32,
533 +- struct efi_graphics_output_mode_info **info,
534 +- unsigned long *size, u64 *fb_base)
535 +-{
536 +- struct efi_graphics_output_protocol_mode_32 *mode;
537 +- efi_graphics_output_protocol_query_mode query_mode;
538 +- efi_status_t status;
539 +- unsigned long m;
540 +-
541 +- m = gop32->mode;
542 +- mode = (struct efi_graphics_output_protocol_mode_32 *)m;
543 +- query_mode = (void *)(unsigned long)gop32->query_mode;
544 +-
545 +- status = __efi_call_early(query_mode, (void *)gop32, mode->mode, size,
546 +- info);
547 +- if (status != EFI_SUCCESS)
548 +- return status;
549 +-
550 +- *fb_base = mode->frame_buffer_base;
551 +- return status;
552 +-}
553 +-
554 + static efi_status_t
555 + setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si,
556 + efi_guid_t *proto, unsigned long size, void **gop_handle)
557 +@@ -121,7 +97,7 @@ setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si,
558 + u64 fb_base;
559 + struct efi_pixel_bitmask pixel_info;
560 + int pixel_format;
561 +- efi_status_t status = EFI_NOT_FOUND;
562 ++ efi_status_t status;
563 + u32 *handles = (u32 *)(unsigned long)gop_handle;
564 + int i;
565 +
566 +@@ -130,6 +106,7 @@ setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si,
567 +
568 + nr_gops = size / sizeof(u32);
569 + for (i = 0; i < nr_gops; i++) {
570 ++ struct efi_graphics_output_protocol_mode_32 *mode;
571 + struct efi_graphics_output_mode_info *info = NULL;
572 + efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID;
573 + bool conout_found = false;
574 +@@ -147,9 +124,11 @@ setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si,
575 + if (status == EFI_SUCCESS)
576 + conout_found = true;
577 +
578 +- status = __gop_query32(sys_table_arg, gop32, &info, &size,
579 +- &current_fb_base);
580 +- if (status == EFI_SUCCESS && (!first_gop || conout_found) &&
581 ++ mode = (void *)(unsigned long)gop32->mode;
582 ++ info = (void *)(unsigned long)mode->info;
583 ++ current_fb_base = mode->frame_buffer_base;
584 ++
585 ++ if ((!first_gop || conout_found) &&
586 + info->pixel_format != PIXEL_BLT_ONLY) {
587 + /*
588 + * Systems that use the UEFI Console Splitter may
589 +@@ -177,7 +156,7 @@ setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si,
590 +
591 + /* Did we find any GOPs? */
592 + if (!first_gop)
593 +- goto out;
594 ++ return EFI_NOT_FOUND;
595 +
596 + /* EFI framebuffer */
597 + si->orig_video_isVGA = VIDEO_TYPE_EFI;
598 +@@ -199,32 +178,8 @@ setup_gop32(efi_system_table_t *sys_table_arg, struct screen_info *si,
599 + si->lfb_size = si->lfb_linelength * si->lfb_height;
600 +
601 + si->capabilities |= VIDEO_CAPABILITY_SKIP_QUIRKS;
602 +-out:
603 +- return status;
604 +-}
605 +-
606 +-static efi_status_t
607 +-__gop_query64(efi_system_table_t *sys_table_arg,
608 +- struct efi_graphics_output_protocol_64 *gop64,
609 +- struct efi_graphics_output_mode_info **info,
610 +- unsigned long *size, u64 *fb_base)
611 +-{
612 +- struct efi_graphics_output_protocol_mode_64 *mode;
613 +- efi_graphics_output_protocol_query_mode query_mode;
614 +- efi_status_t status;
615 +- unsigned long m;
616 +-
617 +- m = gop64->mode;
618 +- mode = (struct efi_graphics_output_protocol_mode_64 *)m;
619 +- query_mode = (void *)(unsigned long)gop64->query_mode;
620 +-
621 +- status = __efi_call_early(query_mode, (void *)gop64, mode->mode, size,
622 +- info);
623 +- if (status != EFI_SUCCESS)
624 +- return status;
625 +
626 +- *fb_base = mode->frame_buffer_base;
627 +- return status;
628 ++ return EFI_SUCCESS;
629 + }
630 +
631 + static efi_status_t
632 +@@ -239,7 +194,7 @@ setup_gop64(efi_system_table_t *sys_table_arg, struct screen_info *si,
633 + u64 fb_base;
634 + struct efi_pixel_bitmask pixel_info;
635 + int pixel_format;
636 +- efi_status_t status = EFI_NOT_FOUND;
637 ++ efi_status_t status;
638 + u64 *handles = (u64 *)(unsigned long)gop_handle;
639 + int i;
640 +
641 +@@ -248,6 +203,7 @@ setup_gop64(efi_system_table_t *sys_table_arg, struct screen_info *si,
642 +
643 + nr_gops = size / sizeof(u64);
644 + for (i = 0; i < nr_gops; i++) {
645 ++ struct efi_graphics_output_protocol_mode_64 *mode;
646 + struct efi_graphics_output_mode_info *info = NULL;
647 + efi_guid_t conout_proto = EFI_CONSOLE_OUT_DEVICE_GUID;
648 + bool conout_found = false;
649 +@@ -265,9 +221,11 @@ setup_gop64(efi_system_table_t *sys_table_arg, struct screen_info *si,
650 + if (status == EFI_SUCCESS)
651 + conout_found = true;
652 +
653 +- status = __gop_query64(sys_table_arg, gop64, &info, &size,
654 +- &current_fb_base);
655 +- if (status == EFI_SUCCESS && (!first_gop || conout_found) &&
656 ++ mode = (void *)(unsigned long)gop64->mode;
657 ++ info = (void *)(unsigned long)mode->info;
658 ++ current_fb_base = mode->frame_buffer_base;
659 ++
660 ++ if ((!first_gop || conout_found) &&
661 + info->pixel_format != PIXEL_BLT_ONLY) {
662 + /*
663 + * Systems that use the UEFI Console Splitter may
664 +@@ -295,7 +253,7 @@ setup_gop64(efi_system_table_t *sys_table_arg, struct screen_info *si,
665 +
666 + /* Did we find any GOPs? */
667 + if (!first_gop)
668 +- goto out;
669 ++ return EFI_NOT_FOUND;
670 +
671 + /* EFI framebuffer */
672 + si->orig_video_isVGA = VIDEO_TYPE_EFI;
673 +@@ -317,8 +275,8 @@ setup_gop64(efi_system_table_t *sys_table_arg, struct screen_info *si,
674 + si->lfb_size = si->lfb_linelength * si->lfb_height;
675 +
676 + si->capabilities |= VIDEO_CAPABILITY_SKIP_QUIRKS;
677 +-out:
678 +- return status;
679 ++
680 ++ return EFI_SUCCESS;
681 + }
682 +
683 + /*
684 +diff --git a/drivers/gpu/drm/exynos/exynos_drm_gsc.c b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
685 +index 7ba414b52faa..d71188b982cb 100644
686 +--- a/drivers/gpu/drm/exynos/exynos_drm_gsc.c
687 ++++ b/drivers/gpu/drm/exynos/exynos_drm_gsc.c
688 +@@ -1292,6 +1292,7 @@ static int gsc_remove(struct platform_device *pdev)
689 + {
690 + struct device *dev = &pdev->dev;
691 +
692 ++ component_del(dev, &gsc_component_ops);
693 + pm_runtime_dont_use_autosuspend(dev);
694 + pm_runtime_disable(dev);
695 +
696 +diff --git a/drivers/iommu/iova.c b/drivers/iommu/iova.c
697 +index da4516fbf542..34c058c24b9d 100644
698 +--- a/drivers/iommu/iova.c
699 ++++ b/drivers/iommu/iova.c
700 +@@ -236,7 +236,7 @@ static DEFINE_MUTEX(iova_cache_mutex);
701 +
702 + struct iova *alloc_iova_mem(void)
703 + {
704 +- return kmem_cache_alloc(iova_cache, GFP_ATOMIC);
705 ++ return kmem_cache_zalloc(iova_cache, GFP_ATOMIC);
706 + }
707 + EXPORT_SYMBOL(alloc_iova_mem);
708 +
709 +diff --git a/drivers/net/dsa/mv88e6xxx/global1.c b/drivers/net/dsa/mv88e6xxx/global1.c
710 +index 38e399e0f30e..8298d6743c57 100644
711 +--- a/drivers/net/dsa/mv88e6xxx/global1.c
712 ++++ b/drivers/net/dsa/mv88e6xxx/global1.c
713 +@@ -371,6 +371,11 @@ int mv88e6390_g1_set_cpu_port(struct mv88e6xxx_chip *chip, int port)
714 + {
715 + u16 ptr = MV88E6390_G1_MONITOR_MGMT_CTL_PTR_CPU_DEST;
716 +
717 ++ /* Use the default high priority for management frames sent to
718 ++ * the CPU.
719 ++ */
720 ++ port |= MV88E6390_G1_MONITOR_MGMT_CTL_PTR_CPU_DEST_MGMTPRI;
721 ++
722 + return mv88e6390_g1_monitor_write(chip, ptr, port);
723 + }
724 +
725 +diff --git a/drivers/net/dsa/mv88e6xxx/global1.h b/drivers/net/dsa/mv88e6xxx/global1.h
726 +index bef01331266f..70b870c7cf1d 100644
727 +--- a/drivers/net/dsa/mv88e6xxx/global1.h
728 ++++ b/drivers/net/dsa/mv88e6xxx/global1.h
729 +@@ -197,6 +197,7 @@
730 + #define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_INGRESS_DEST 0x2000
731 + #define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_EGRESS_DEST 0x2100
732 + #define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_CPU_DEST 0x3000
733 ++#define MV88E6390_G1_MONITOR_MGMT_CTL_PTR_CPU_DEST_MGMTPRI 0x00e0
734 + #define MV88E6390_G1_MONITOR_MGMT_CTL_DATA_MASK 0x00ff
735 +
736 + /* Offset 0x1C: Global Control 2 */
737 +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
738 +index ee5159ef837e..df5e8c2e8eaf 100644
739 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
740 ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_cmn.h
741 +@@ -1113,7 +1113,7 @@ static inline u8 bnx2x_get_path_func_num(struct bnx2x *bp)
742 + for (i = 0; i < E1H_FUNC_MAX / 2; i++) {
743 + u32 func_config =
744 + MF_CFG_RD(bp,
745 +- func_mf_config[BP_PORT(bp) + 2 * i].
746 ++ func_mf_config[BP_PATH(bp) + 2 * i].
747 + config);
748 + func_num +=
749 + ((func_config & FUNC_MF_CFG_FUNC_HIDE) ? 0 : 1);
750 +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
751 +index af57568c922e..df4f77ad95c4 100644
752 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
753 ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
754 +@@ -9995,10 +9995,18 @@ static void bnx2x_recovery_failed(struct bnx2x *bp)
755 + */
756 + static void bnx2x_parity_recover(struct bnx2x *bp)
757 + {
758 +- bool global = false;
759 + u32 error_recovered, error_unrecovered;
760 +- bool is_parity;
761 ++ bool is_parity, global = false;
762 ++#ifdef CONFIG_BNX2X_SRIOV
763 ++ int vf_idx;
764 ++
765 ++ for (vf_idx = 0; vf_idx < bp->requested_nr_virtfn; vf_idx++) {
766 ++ struct bnx2x_virtf *vf = BP_VF(bp, vf_idx);
767 +
768 ++ if (vf)
769 ++ vf->state = VF_LOST;
770 ++ }
771 ++#endif
772 + DP(NETIF_MSG_HW, "Handling parity\n");
773 + while (1) {
774 + switch (bp->recovery_state) {
775 +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
776 +index eb814c65152f..4dc34de1a09a 100644
777 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
778 ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.h
779 +@@ -139,6 +139,7 @@ struct bnx2x_virtf {
780 + #define VF_ACQUIRED 1 /* VF acquired, but not initialized */
781 + #define VF_ENABLED 2 /* VF Enabled */
782 + #define VF_RESET 3 /* VF FLR'd, pending cleanup */
783 ++#define VF_LOST 4 /* Recovery while VFs are loaded */
784 +
785 + bool flr_clnup_stage; /* true during flr cleanup */
786 + bool malicious; /* true if FW indicated so, until FLR */
787 +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
788 +index 8e0a317b31f7..152758a45150 100644
789 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
790 ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_vfpf.c
791 +@@ -2114,6 +2114,18 @@ static void bnx2x_vf_mbx_request(struct bnx2x *bp, struct bnx2x_virtf *vf,
792 + {
793 + int i;
794 +
795 ++ if (vf->state == VF_LOST) {
796 ++ /* Just ack the FW and return if VFs are lost
797 ++ * in case of parity error. VFs are supposed to be timedout
798 ++ * on waiting for PF response.
799 ++ */
800 ++ DP(BNX2X_MSG_IOV,
801 ++ "VF 0x%x lost, not handling the request\n", vf->abs_vfid);
802 ++
803 ++ storm_memset_vf_mbx_ack(bp, vf->abs_vfid);
804 ++ return;
805 ++ }
806 ++
807 + /* check if tlv type is known */
808 + if (bnx2x_tlv_supported(mbx->first_tlv.tl.type)) {
809 + /* Lock the per vf op mutex and note the locker's identity.
810 +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
811 +index 2240c23b0a4c..0a409ba4012a 100644
812 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
813 ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.c
814 +@@ -2778,8 +2778,15 @@ static int bnxt_hwrm_dbg_dma_data(struct bnxt *bp, void *msg, int msg_len,
815 + }
816 + }
817 +
818 +- if (info->dest_buf)
819 +- memcpy(info->dest_buf + off, dma_buf, len);
820 ++ if (info->dest_buf) {
821 ++ if ((info->seg_start + off + len) <=
822 ++ BNXT_COREDUMP_BUF_LEN(info->buf_len)) {
823 ++ memcpy(info->dest_buf + off, dma_buf, len);
824 ++ } else {
825 ++ rc = -ENOBUFS;
826 ++ break;
827 ++ }
828 ++ }
829 +
830 + if (cmn_req->req_type ==
831 + cpu_to_le16(HWRM_DBG_COREDUMP_RETRIEVE))
832 +@@ -2833,7 +2840,7 @@ static int bnxt_hwrm_dbg_coredump_initiate(struct bnxt *bp, u16 component_id,
833 +
834 + static int bnxt_hwrm_dbg_coredump_retrieve(struct bnxt *bp, u16 component_id,
835 + u16 segment_id, u32 *seg_len,
836 +- void *buf, u32 offset)
837 ++ void *buf, u32 buf_len, u32 offset)
838 + {
839 + struct hwrm_dbg_coredump_retrieve_input req = {0};
840 + struct bnxt_hwrm_dbg_dma_info info = {NULL};
841 +@@ -2848,8 +2855,11 @@ static int bnxt_hwrm_dbg_coredump_retrieve(struct bnxt *bp, u16 component_id,
842 + seq_no);
843 + info.data_len_off = offsetof(struct hwrm_dbg_coredump_retrieve_output,
844 + data_len);
845 +- if (buf)
846 ++ if (buf) {
847 + info.dest_buf = buf + offset;
848 ++ info.buf_len = buf_len;
849 ++ info.seg_start = offset;
850 ++ }
851 +
852 + rc = bnxt_hwrm_dbg_dma_data(bp, &req, sizeof(req), &info);
853 + if (!rc)
854 +@@ -2939,14 +2949,17 @@ bnxt_fill_coredump_record(struct bnxt *bp, struct bnxt_coredump_record *record,
855 + static int bnxt_get_coredump(struct bnxt *bp, void *buf, u32 *dump_len)
856 + {
857 + u32 ver_get_resp_len = sizeof(struct hwrm_ver_get_output);
858 ++ u32 offset = 0, seg_hdr_len, seg_record_len, buf_len = 0;
859 + struct coredump_segment_record *seg_record = NULL;
860 +- u32 offset = 0, seg_hdr_len, seg_record_len;
861 + struct bnxt_coredump_segment_hdr seg_hdr;
862 + struct bnxt_coredump coredump = {NULL};
863 + time64_t start_time;
864 + u16 start_utc;
865 + int rc = 0, i;
866 +
867 ++ if (buf)
868 ++ buf_len = *dump_len;
869 ++
870 + start_time = ktime_get_real_seconds();
871 + start_utc = sys_tz.tz_minuteswest * 60;
872 + seg_hdr_len = sizeof(seg_hdr);
873 +@@ -2979,6 +2992,12 @@ static int bnxt_get_coredump(struct bnxt *bp, void *buf, u32 *dump_len)
874 + u32 duration = 0, seg_len = 0;
875 + unsigned long start, end;
876 +
877 ++ if (buf && ((offset + seg_hdr_len) >
878 ++ BNXT_COREDUMP_BUF_LEN(buf_len))) {
879 ++ rc = -ENOBUFS;
880 ++ goto err;
881 ++ }
882 ++
883 + start = jiffies;
884 +
885 + rc = bnxt_hwrm_dbg_coredump_initiate(bp, comp_id, seg_id);
886 +@@ -2991,9 +3010,11 @@ static int bnxt_get_coredump(struct bnxt *bp, void *buf, u32 *dump_len)
887 +
888 + /* Write segment data into the buffer */
889 + rc = bnxt_hwrm_dbg_coredump_retrieve(bp, comp_id, seg_id,
890 +- &seg_len, buf,
891 ++ &seg_len, buf, buf_len,
892 + offset + seg_hdr_len);
893 +- if (rc)
894 ++ if (rc && rc == -ENOBUFS)
895 ++ goto err;
896 ++ else if (rc)
897 + netdev_err(bp->dev,
898 + "Failed to retrieve coredump for seg = %d\n",
899 + seg_record->segment_id);
900 +@@ -3023,7 +3044,8 @@ err:
901 + rc);
902 + kfree(coredump.data);
903 + *dump_len += sizeof(struct bnxt_coredump_record);
904 +-
905 ++ if (rc == -ENOBUFS)
906 ++ netdev_err(bp->dev, "Firmware returned large coredump buffer");
907 + return rc;
908 + }
909 +
910 +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
911 +index b5b65b3f8534..3998f6e809a9 100644
912 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
913 ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_ethtool.h
914 +@@ -31,6 +31,8 @@ struct bnxt_coredump {
915 + u16 total_segs;
916 + };
917 +
918 ++#define BNXT_COREDUMP_BUF_LEN(len) ((len) - sizeof(struct bnxt_coredump_record))
919 ++
920 + struct bnxt_hwrm_dbg_dma_info {
921 + void *dest_buf;
922 + int dest_buf_size;
923 +@@ -38,6 +40,8 @@ struct bnxt_hwrm_dbg_dma_info {
924 + u16 seq_off;
925 + u16 data_len_off;
926 + u16 segs;
927 ++ u32 seg_start;
928 ++ u32 buf_len;
929 + };
930 +
931 + struct hwrm_dbg_cmn_input {
932 +diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
933 +index b429b726b987..d320e9afab88 100644
934 +--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
935 ++++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
936 +@@ -3035,6 +3035,9 @@ static int sge_queue_entries(const struct adapter *adap)
937 + int tot_uld_entries = 0;
938 + int i;
939 +
940 ++ if (!is_uld(adap))
941 ++ goto lld_only;
942 ++
943 + mutex_lock(&uld_mutex);
944 + for (i = 0; i < CXGB4_TX_MAX; i++)
945 + tot_uld_entries += sge_qinfo_uld_txq_entries(adap, i);
946 +@@ -3045,6 +3048,7 @@ static int sge_queue_entries(const struct adapter *adap)
947 + }
948 + mutex_unlock(&uld_mutex);
949 +
950 ++lld_only:
951 + return DIV_ROUND_UP(adap->sge.ethqsets, 4) +
952 + tot_uld_entries +
953 + DIV_ROUND_UP(MAX_CTRL_QUEUES, 4) + 1;
954 +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
955 +index bdf53cf350f6..720514b5c006 100644
956 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
957 ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
958 +@@ -650,6 +650,13 @@ mlxsw_sp_qdisc_prio_graft(struct mlxsw_sp_port *mlxsw_sp_port,
959 + mlxsw_sp_port->tclass_qdiscs[tclass_num].handle == p->child_handle)
960 + return 0;
961 +
962 ++ if (!p->child_handle) {
963 ++ /* This is an invisible FIFO replacing the original Qdisc.
964 ++ * Ignore it--the original Qdisc's destroy will follow.
965 ++ */
966 ++ return 0;
967 ++ }
968 ++
969 + /* See if the grafted qdisc is already offloaded on any tclass. If so,
970 + * unoffload it.
971 + */
972 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
973 +index fea286e14add..ef13a462c36d 100644
974 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
975 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c
976 +@@ -946,6 +946,9 @@ static int sun8i_dwmac_set_syscon(struct stmmac_priv *priv)
977 + /* default */
978 + break;
979 + case PHY_INTERFACE_MODE_RGMII:
980 ++ case PHY_INTERFACE_MODE_RGMII_ID:
981 ++ case PHY_INTERFACE_MODE_RGMII_RXID:
982 ++ case PHY_INTERFACE_MODE_RGMII_TXID:
983 + reg |= SYSCON_EPIT | SYSCON_ETCS_INT_GMII;
984 + break;
985 + case PHY_INTERFACE_MODE_RMII:
986 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
987 +index 62ccbd47c1db..fc1fa0f9f338 100644
988 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
989 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sunxi.c
990 +@@ -53,7 +53,7 @@ static int sun7i_gmac_init(struct platform_device *pdev, void *priv)
991 + * rate, which then uses the auto-reparenting feature of the
992 + * clock driver, and enabling/disabling the clock.
993 + */
994 +- if (gmac->interface == PHY_INTERFACE_MODE_RGMII) {
995 ++ if (phy_interface_mode_is_rgmii(gmac->interface)) {
996 + clk_set_rate(gmac->tx_clk, SUN7I_GMAC_GMII_RGMII_RATE);
997 + clk_prepare_enable(gmac->tx_clk);
998 + gmac->clk_enabled = 1;
999 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
1000 +index 0a80fa25afe3..209745294751 100644
1001 +--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
1002 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2.h
1003 +@@ -169,6 +169,8 @@
1004 + #define XGMAC_DMA_CH_RX_CONTROL(x) (0x00003108 + (0x80 * (x)))
1005 + #define XGMAC_RxPBL GENMASK(21, 16)
1006 + #define XGMAC_RxPBL_SHIFT 16
1007 ++#define XGMAC_RBSZ GENMASK(14, 1)
1008 ++#define XGMAC_RBSZ_SHIFT 1
1009 + #define XGMAC_RXST BIT(0)
1010 + #define XGMAC_DMA_CH_TxDESC_LADDR(x) (0x00003114 + (0x80 * (x)))
1011 + #define XGMAC_DMA_CH_RxDESC_LADDR(x) (0x0000311c + (0x80 * (x)))
1012 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
1013 +index 1c3930527444..27942c53b567 100644
1014 +--- a/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
1015 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwxgmac2_dma.c
1016 +@@ -379,7 +379,8 @@ static void dwxgmac2_set_bfsize(void __iomem *ioaddr, int bfsize, u32 chan)
1017 + u32 value;
1018 +
1019 + value = readl(ioaddr + XGMAC_DMA_CH_RX_CONTROL(chan));
1020 +- value |= bfsize << 1;
1021 ++ value &= ~XGMAC_RBSZ;
1022 ++ value |= bfsize << XGMAC_RBSZ_SHIFT;
1023 + writel(value, ioaddr + XGMAC_DMA_CH_RX_CONTROL(chan));
1024 + }
1025 +
1026 +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
1027 +index 014fe93ed2d8..7ee0e46539c0 100644
1028 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
1029 ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
1030 +@@ -54,7 +54,7 @@
1031 + #include "dwxgmac2.h"
1032 + #include "hwif.h"
1033 +
1034 +-#define STMMAC_ALIGN(x) __ALIGN_KERNEL(x, SMP_CACHE_BYTES)
1035 ++#define STMMAC_ALIGN(x) ALIGN(ALIGN(x, SMP_CACHE_BYTES), 16)
1036 + #define TSO_MAX_BUFF_SIZE (SZ_16K - 1)
1037 +
1038 + /* Module parameters */
1039 +@@ -2997,6 +2997,7 @@ static netdev_tx_t stmmac_tso_xmit(struct sk_buff *skb, struct net_device *dev)
1040 +
1041 + tx_q->tx_tail_addr = tx_q->dma_tx_phy + (tx_q->cur_tx * sizeof(*desc));
1042 + stmmac_set_tx_tail_ptr(priv, priv->ioaddr, tx_q->tx_tail_addr, queue);
1043 ++ stmmac_tx_timer_arm(priv, queue);
1044 +
1045 + return NETDEV_TX_OK;
1046 +
1047 +@@ -3210,6 +3211,7 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)
1048 +
1049 + tx_q->tx_tail_addr = tx_q->dma_tx_phy + (tx_q->cur_tx * sizeof(*desc));
1050 + stmmac_set_tx_tail_ptr(priv, priv->ioaddr, tx_q->tx_tail_addr, queue);
1051 ++ stmmac_tx_timer_arm(priv, queue);
1052 +
1053 + return NETDEV_TX_OK;
1054 +
1055 +@@ -3604,12 +3606,24 @@ static void stmmac_set_rx_mode(struct net_device *dev)
1056 + static int stmmac_change_mtu(struct net_device *dev, int new_mtu)
1057 + {
1058 + struct stmmac_priv *priv = netdev_priv(dev);
1059 ++ int txfifosz = priv->plat->tx_fifo_size;
1060 ++
1061 ++ if (txfifosz == 0)
1062 ++ txfifosz = priv->dma_cap.tx_fifo_size;
1063 ++
1064 ++ txfifosz /= priv->plat->tx_queues_to_use;
1065 +
1066 + if (netif_running(dev)) {
1067 + netdev_err(priv->dev, "must be stopped to change its MTU\n");
1068 + return -EBUSY;
1069 + }
1070 +
1071 ++ new_mtu = STMMAC_ALIGN(new_mtu);
1072 ++
1073 ++ /* If condition true, FIFO is too small or MTU too large */
1074 ++ if ((txfifosz < new_mtu) || (new_mtu > BUF_SIZE_16KiB))
1075 ++ return -EINVAL;
1076 ++
1077 + dev->mtu = new_mtu;
1078 +
1079 + netdev_update_features(dev);
1080 +diff --git a/drivers/net/gtp.c b/drivers/net/gtp.c
1081 +index 494f00b9c5ef..6571cac6e786 100644
1082 +--- a/drivers/net/gtp.c
1083 ++++ b/drivers/net/gtp.c
1084 +@@ -818,7 +818,7 @@ static struct sock *gtp_encap_enable_socket(int fd, int type,
1085 + lock_sock(sock->sk);
1086 + if (sock->sk->sk_user_data) {
1087 + sk = ERR_PTR(-EBUSY);
1088 +- goto out_sock;
1089 ++ goto out_rel_sock;
1090 + }
1091 +
1092 + sk = sock->sk;
1093 +@@ -831,8 +831,9 @@ static struct sock *gtp_encap_enable_socket(int fd, int type,
1094 +
1095 + setup_udp_tunnel_sock(sock_net(sock->sk), sock, &tuncfg);
1096 +
1097 +-out_sock:
1098 ++out_rel_sock:
1099 + release_sock(sock->sk);
1100 ++out_sock:
1101 + sockfd_put(sock);
1102 + return sk;
1103 + }
1104 +diff --git a/drivers/net/hyperv/hyperv_net.h b/drivers/net/hyperv/hyperv_net.h
1105 +index 31d8d83c25ac..50709c76b672 100644
1106 +--- a/drivers/net/hyperv/hyperv_net.h
1107 ++++ b/drivers/net/hyperv/hyperv_net.h
1108 +@@ -181,7 +181,6 @@ struct rndis_device {
1109 +
1110 + u8 hw_mac_adr[ETH_ALEN];
1111 + u8 rss_key[NETVSC_HASH_KEYLEN];
1112 +- u16 rx_table[ITAB_NUM];
1113 + };
1114 +
1115 +
1116 +@@ -933,6 +932,8 @@ struct net_device_context {
1117 +
1118 + u32 tx_table[VRSS_SEND_TAB_SIZE];
1119 +
1120 ++ u16 rx_table[ITAB_NUM];
1121 ++
1122 + /* Ethtool settings */
1123 + u8 duplex;
1124 + u32 speed;
1125 +diff --git a/drivers/net/hyperv/netvsc_drv.c b/drivers/net/hyperv/netvsc_drv.c
1126 +index b7a71c203aa3..1f9f7fcdb0eb 100644
1127 +--- a/drivers/net/hyperv/netvsc_drv.c
1128 ++++ b/drivers/net/hyperv/netvsc_drv.c
1129 +@@ -1688,7 +1688,7 @@ static int netvsc_get_rxfh(struct net_device *dev, u32 *indir, u8 *key,
1130 + rndis_dev = ndev->extension;
1131 + if (indir) {
1132 + for (i = 0; i < ITAB_NUM; i++)
1133 +- indir[i] = rndis_dev->rx_table[i];
1134 ++ indir[i] = ndc->rx_table[i];
1135 + }
1136 +
1137 + if (key)
1138 +@@ -1718,7 +1718,7 @@ static int netvsc_set_rxfh(struct net_device *dev, const u32 *indir,
1139 + return -EINVAL;
1140 +
1141 + for (i = 0; i < ITAB_NUM; i++)
1142 +- rndis_dev->rx_table[i] = indir[i];
1143 ++ ndc->rx_table[i] = indir[i];
1144 + }
1145 +
1146 + if (!key) {
1147 +diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
1148 +index 53c6039bffb6..f47e36ac42a7 100644
1149 +--- a/drivers/net/hyperv/rndis_filter.c
1150 ++++ b/drivers/net/hyperv/rndis_filter.c
1151 +@@ -719,6 +719,7 @@ static int rndis_set_rss_param_msg(struct rndis_device *rdev,
1152 + const u8 *rss_key, u16 flag)
1153 + {
1154 + struct net_device *ndev = rdev->ndev;
1155 ++ struct net_device_context *ndc = netdev_priv(ndev);
1156 + struct rndis_request *request;
1157 + struct rndis_set_request *set;
1158 + struct rndis_set_complete *set_complete;
1159 +@@ -758,7 +759,7 @@ static int rndis_set_rss_param_msg(struct rndis_device *rdev,
1160 + /* Set indirection table entries */
1161 + itab = (u32 *)(rssp + 1);
1162 + for (i = 0; i < ITAB_NUM; i++)
1163 +- itab[i] = rdev->rx_table[i];
1164 ++ itab[i] = ndc->rx_table[i];
1165 +
1166 + /* Set hask key values */
1167 + keyp = (u8 *)((unsigned long)rssp + rssp->hashkey_offset);
1168 +@@ -1244,6 +1245,7 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
1169 + struct netvsc_device_info *device_info)
1170 + {
1171 + struct net_device *net = hv_get_drvdata(dev);
1172 ++ struct net_device_context *ndc = netdev_priv(net);
1173 + struct netvsc_device *net_device;
1174 + struct rndis_device *rndis_device;
1175 + struct ndis_recv_scale_cap rsscap;
1176 +@@ -1330,9 +1332,11 @@ struct netvsc_device *rndis_filter_device_add(struct hv_device *dev,
1177 + /* We will use the given number of channels if available. */
1178 + net_device->num_chn = min(net_device->max_chn, device_info->num_chn);
1179 +
1180 +- for (i = 0; i < ITAB_NUM; i++)
1181 +- rndis_device->rx_table[i] = ethtool_rxfh_indir_default(
1182 ++ if (!netif_is_rxfh_configured(net)) {
1183 ++ for (i = 0; i < ITAB_NUM; i++)
1184 ++ ndc->rx_table[i] = ethtool_rxfh_indir_default(
1185 + i, net_device->num_chn);
1186 ++ }
1187 +
1188 + atomic_set(&net_device->open_chn, 1);
1189 + vmbus_set_sc_create_callback(dev->channel, netvsc_sc_open);
1190 +diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
1191 +index 78789dfbe29e..41c0a3b55bfb 100644
1192 +--- a/drivers/net/macvlan.c
1193 ++++ b/drivers/net/macvlan.c
1194 +@@ -263,7 +263,7 @@ static void macvlan_broadcast(struct sk_buff *skb,
1195 + struct net_device *src,
1196 + enum macvlan_mode mode)
1197 + {
1198 +- const struct ethhdr *eth = eth_hdr(skb);
1199 ++ const struct ethhdr *eth = skb_eth_hdr(skb);
1200 + const struct macvlan_dev *vlan;
1201 + struct sk_buff *nskb;
1202 + unsigned int i;
1203 +diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
1204 +index 6dd24a1ca10d..42715520c070 100644
1205 +--- a/drivers/net/usb/lan78xx.c
1206 ++++ b/drivers/net/usb/lan78xx.c
1207 +@@ -522,7 +522,7 @@ static int lan78xx_read_stats(struct lan78xx_net *dev,
1208 + }
1209 + } else {
1210 + netdev_warn(dev->net,
1211 +- "Failed to read stat ret = 0x%x", ret);
1212 ++ "Failed to read stat ret = %d", ret);
1213 + }
1214 +
1215 + kfree(stats);
1216 +@@ -2736,11 +2736,6 @@ static int lan78xx_stop(struct net_device *net)
1217 + return 0;
1218 + }
1219 +
1220 +-static int lan78xx_linearize(struct sk_buff *skb)
1221 +-{
1222 +- return skb_linearize(skb);
1223 +-}
1224 +-
1225 + static struct sk_buff *lan78xx_tx_prep(struct lan78xx_net *dev,
1226 + struct sk_buff *skb, gfp_t flags)
1227 + {
1228 +@@ -2751,8 +2746,10 @@ static struct sk_buff *lan78xx_tx_prep(struct lan78xx_net *dev,
1229 + return NULL;
1230 + }
1231 +
1232 +- if (lan78xx_linearize(skb) < 0)
1233 ++ if (skb_linearize(skb)) {
1234 ++ dev_kfree_skb_any(skb);
1235 + return NULL;
1236 ++ }
1237 +
1238 + tx_cmd_a = (u32)(skb->len & TX_CMD_A_LEN_MASK_) | TX_CMD_A_FCS_;
1239 +
1240 +diff --git a/drivers/net/vxlan.c b/drivers/net/vxlan.c
1241 +index d8a56df3933f..613f36681853 100644
1242 +--- a/drivers/net/vxlan.c
1243 ++++ b/drivers/net/vxlan.c
1244 +@@ -2217,7 +2217,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
1245 + ndst = &rt->dst;
1246 + skb_tunnel_check_pmtu(skb, ndst, VXLAN_HEADROOM);
1247 +
1248 +- tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
1249 ++ tos = ip_tunnel_ecn_encap(RT_TOS(tos), old_iph, skb);
1250 + ttl = ttl ? : ip4_dst_hoplimit(&rt->dst);
1251 + err = vxlan_build_skb(skb, ndst, sizeof(struct iphdr),
1252 + vni, md, flags, udp_sum);
1253 +@@ -2254,7 +2254,7 @@ static void vxlan_xmit_one(struct sk_buff *skb, struct net_device *dev,
1254 +
1255 + skb_tunnel_check_pmtu(skb, ndst, VXLAN6_HEADROOM);
1256 +
1257 +- tos = ip_tunnel_ecn_encap(tos, old_iph, skb);
1258 ++ tos = ip_tunnel_ecn_encap(RT_TOS(tos), old_iph, skb);
1259 + ttl = ttl ? : ip6_dst_hoplimit(ndst);
1260 + skb_scrub_packet(skb, xnet);
1261 + err = vxlan_build_skb(skb, ndst, sizeof(struct ipv6hdr),
1262 +diff --git a/drivers/net/wireless/marvell/mwifiex/tdls.c b/drivers/net/wireless/marvell/mwifiex/tdls.c
1263 +index 27779d7317fd..6058c48d56dc 100644
1264 +--- a/drivers/net/wireless/marvell/mwifiex/tdls.c
1265 ++++ b/drivers/net/wireless/marvell/mwifiex/tdls.c
1266 +@@ -956,59 +956,117 @@ void mwifiex_process_tdls_action_frame(struct mwifiex_private *priv,
1267 +
1268 + switch (*pos) {
1269 + case WLAN_EID_SUPP_RATES:
1270 ++ if (pos[1] > 32)
1271 ++ return;
1272 + sta_ptr->tdls_cap.rates_len = pos[1];
1273 + for (i = 0; i < pos[1]; i++)
1274 + sta_ptr->tdls_cap.rates[i] = pos[i + 2];
1275 + break;
1276 +
1277 + case WLAN_EID_EXT_SUPP_RATES:
1278 ++ if (pos[1] > 32)
1279 ++ return;
1280 + basic = sta_ptr->tdls_cap.rates_len;
1281 ++ if (pos[1] > 32 - basic)
1282 ++ return;
1283 + for (i = 0; i < pos[1]; i++)
1284 + sta_ptr->tdls_cap.rates[basic + i] = pos[i + 2];
1285 + sta_ptr->tdls_cap.rates_len += pos[1];
1286 + break;
1287 + case WLAN_EID_HT_CAPABILITY:
1288 +- memcpy((u8 *)&sta_ptr->tdls_cap.ht_capb, pos,
1289 ++ if (pos > end - sizeof(struct ieee80211_ht_cap) - 2)
1290 ++ return;
1291 ++ if (pos[1] != sizeof(struct ieee80211_ht_cap))
1292 ++ return;
1293 ++ /* copy the ie's value into ht_capb*/
1294 ++ memcpy((u8 *)&sta_ptr->tdls_cap.ht_capb, pos + 2,
1295 + sizeof(struct ieee80211_ht_cap));
1296 + sta_ptr->is_11n_enabled = 1;
1297 + break;
1298 + case WLAN_EID_HT_OPERATION:
1299 +- memcpy(&sta_ptr->tdls_cap.ht_oper, pos,
1300 ++ if (pos > end -
1301 ++ sizeof(struct ieee80211_ht_operation) - 2)
1302 ++ return;
1303 ++ if (pos[1] != sizeof(struct ieee80211_ht_operation))
1304 ++ return;
1305 ++ /* copy the ie's value into ht_oper*/
1306 ++ memcpy(&sta_ptr->tdls_cap.ht_oper, pos + 2,
1307 + sizeof(struct ieee80211_ht_operation));
1308 + break;
1309 + case WLAN_EID_BSS_COEX_2040:
1310 ++ if (pos > end - 3)
1311 ++ return;
1312 ++ if (pos[1] != 1)
1313 ++ return;
1314 + sta_ptr->tdls_cap.coex_2040 = pos[2];
1315 + break;
1316 + case WLAN_EID_EXT_CAPABILITY:
1317 ++ if (pos > end - sizeof(struct ieee_types_header))
1318 ++ return;
1319 ++ if (pos[1] < sizeof(struct ieee_types_header))
1320 ++ return;
1321 ++ if (pos[1] > 8)
1322 ++ return;
1323 + memcpy((u8 *)&sta_ptr->tdls_cap.extcap, pos,
1324 + sizeof(struct ieee_types_header) +
1325 + min_t(u8, pos[1], 8));
1326 + break;
1327 + case WLAN_EID_RSN:
1328 ++ if (pos > end - sizeof(struct ieee_types_header))
1329 ++ return;
1330 ++ if (pos[1] < sizeof(struct ieee_types_header))
1331 ++ return;
1332 ++ if (pos[1] > IEEE_MAX_IE_SIZE -
1333 ++ sizeof(struct ieee_types_header))
1334 ++ return;
1335 + memcpy((u8 *)&sta_ptr->tdls_cap.rsn_ie, pos,
1336 + sizeof(struct ieee_types_header) +
1337 + min_t(u8, pos[1], IEEE_MAX_IE_SIZE -
1338 + sizeof(struct ieee_types_header)));
1339 + break;
1340 + case WLAN_EID_QOS_CAPA:
1341 ++ if (pos > end - 3)
1342 ++ return;
1343 ++ if (pos[1] != 1)
1344 ++ return;
1345 + sta_ptr->tdls_cap.qos_info = pos[2];
1346 + break;
1347 + case WLAN_EID_VHT_OPERATION:
1348 +- if (priv->adapter->is_hw_11ac_capable)
1349 +- memcpy(&sta_ptr->tdls_cap.vhtoper, pos,
1350 ++ if (priv->adapter->is_hw_11ac_capable) {
1351 ++ if (pos > end -
1352 ++ sizeof(struct ieee80211_vht_operation) - 2)
1353 ++ return;
1354 ++ if (pos[1] !=
1355 ++ sizeof(struct ieee80211_vht_operation))
1356 ++ return;
1357 ++ /* copy the ie's value into vhtoper*/
1358 ++ memcpy(&sta_ptr->tdls_cap.vhtoper, pos + 2,
1359 + sizeof(struct ieee80211_vht_operation));
1360 ++ }
1361 + break;
1362 + case WLAN_EID_VHT_CAPABILITY:
1363 + if (priv->adapter->is_hw_11ac_capable) {
1364 +- memcpy((u8 *)&sta_ptr->tdls_cap.vhtcap, pos,
1365 ++ if (pos > end -
1366 ++ sizeof(struct ieee80211_vht_cap) - 2)
1367 ++ return;
1368 ++ if (pos[1] != sizeof(struct ieee80211_vht_cap))
1369 ++ return;
1370 ++ /* copy the ie's value into vhtcap*/
1371 ++ memcpy((u8 *)&sta_ptr->tdls_cap.vhtcap, pos + 2,
1372 + sizeof(struct ieee80211_vht_cap));
1373 + sta_ptr->is_11ac_enabled = 1;
1374 + }
1375 + break;
1376 + case WLAN_EID_AID:
1377 +- if (priv->adapter->is_hw_11ac_capable)
1378 ++ if (priv->adapter->is_hw_11ac_capable) {
1379 ++ if (pos > end - 4)
1380 ++ return;
1381 ++ if (pos[1] != 2)
1382 ++ return;
1383 + sta_ptr->tdls_cap.aid =
1384 + get_unaligned_le16((pos + 2));
1385 ++ }
1386 ++ break;
1387 + default:
1388 + break;
1389 + }
1390 +diff --git a/drivers/pci/switch/switchtec.c b/drivers/pci/switch/switchtec.c
1391 +index 72db2e0ebced..5aaa4ce04ec3 100644
1392 +--- a/drivers/pci/switch/switchtec.c
1393 ++++ b/drivers/pci/switch/switchtec.c
1394 +@@ -13,7 +13,7 @@
1395 + #include <linux/uaccess.h>
1396 + #include <linux/poll.h>
1397 + #include <linux/wait.h>
1398 +-
1399 ++#include <linux/io-64-nonatomic-lo-hi.h>
1400 + #include <linux/nospec.h>
1401 +
1402 + MODULE_DESCRIPTION("Microsemi Switchtec(tm) PCIe Management Driver");
1403 +@@ -633,7 +633,7 @@ static int ioctl_event_summary(struct switchtec_dev *stdev,
1404 + u32 reg;
1405 +
1406 + s.global = ioread32(&stdev->mmio_sw_event->global_summary);
1407 +- s.part_bitmap = ioread32(&stdev->mmio_sw_event->part_event_bitmap);
1408 ++ s.part_bitmap = readq(&stdev->mmio_sw_event->part_event_bitmap);
1409 + s.local_part = ioread32(&stdev->mmio_part_cfg->part_event_summary);
1410 +
1411 + for (i = 0; i < stdev->partition_count; i++) {
1412 +diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c
1413 +index f312764660e6..4bab758d14b1 100644
1414 +--- a/drivers/regulator/core.c
1415 ++++ b/drivers/regulator/core.c
1416 +@@ -1724,8 +1724,8 @@ struct regulator *_regulator_get(struct device *dev, const char *id,
1417 + regulator = create_regulator(rdev, dev, id);
1418 + if (regulator == NULL) {
1419 + regulator = ERR_PTR(-ENOMEM);
1420 +- put_device(&rdev->dev);
1421 + module_put(rdev->owner);
1422 ++ put_device(&rdev->dev);
1423 + return regulator;
1424 + }
1425 +
1426 +@@ -1851,13 +1851,13 @@ static void _regulator_put(struct regulator *regulator)
1427 +
1428 + rdev->open_count--;
1429 + rdev->exclusive = 0;
1430 +- put_device(&rdev->dev);
1431 + regulator_unlock(rdev);
1432 +
1433 + kfree_const(regulator->supply_name);
1434 + kfree(regulator);
1435 +
1436 + module_put(rdev->owner);
1437 ++ put_device(&rdev->dev);
1438 + }
1439 +
1440 + /**
1441 +diff --git a/drivers/regulator/rn5t618-regulator.c b/drivers/regulator/rn5t618-regulator.c
1442 +index 790a4a73ea2c..40b74648bd31 100644
1443 +--- a/drivers/regulator/rn5t618-regulator.c
1444 ++++ b/drivers/regulator/rn5t618-regulator.c
1445 +@@ -154,6 +154,7 @@ static struct platform_driver rn5t618_regulator_driver = {
1446 +
1447 + module_platform_driver(rn5t618_regulator_driver);
1448 +
1449 ++MODULE_ALIAS("platform:rn5t618-regulator");
1450 + MODULE_AUTHOR("Beniamino Galvani <b.galvani@×××××.com>");
1451 + MODULE_DESCRIPTION("RN5T618 regulator driver");
1452 + MODULE_LICENSE("GPL v2");
1453 +diff --git a/drivers/s390/block/dasd_eckd.c b/drivers/s390/block/dasd_eckd.c
1454 +index f89f9d02e788..a2e34c853ca9 100644
1455 +--- a/drivers/s390/block/dasd_eckd.c
1456 ++++ b/drivers/s390/block/dasd_eckd.c
1457 +@@ -1135,7 +1135,8 @@ static u32 get_fcx_max_data(struct dasd_device *device)
1458 + {
1459 + struct dasd_eckd_private *private = device->private;
1460 + int fcx_in_css, fcx_in_gneq, fcx_in_features;
1461 +- int tpm, mdc;
1462 ++ unsigned int mdc;
1463 ++ int tpm;
1464 +
1465 + if (dasd_nofcx)
1466 + return 0;
1467 +@@ -1149,7 +1150,7 @@ static u32 get_fcx_max_data(struct dasd_device *device)
1468 + return 0;
1469 +
1470 + mdc = ccw_device_get_mdc(device->cdev, 0);
1471 +- if (mdc < 0) {
1472 ++ if (mdc == 0) {
1473 + dev_warn(&device->cdev->dev, "Detecting the maximum supported data size for zHPF requests failed\n");
1474 + return 0;
1475 + } else {
1476 +@@ -1160,12 +1161,12 @@ static u32 get_fcx_max_data(struct dasd_device *device)
1477 + static int verify_fcx_max_data(struct dasd_device *device, __u8 lpm)
1478 + {
1479 + struct dasd_eckd_private *private = device->private;
1480 +- int mdc;
1481 ++ unsigned int mdc;
1482 + u32 fcx_max_data;
1483 +
1484 + if (private->fcx_max_data) {
1485 + mdc = ccw_device_get_mdc(device->cdev, lpm);
1486 +- if ((mdc < 0)) {
1487 ++ if (mdc == 0) {
1488 + dev_warn(&device->cdev->dev,
1489 + "Detecting the maximum data size for zHPF "
1490 + "requests failed (rc=%d) for a new path %x\n",
1491 +@@ -1769,7 +1770,7 @@ out_err2:
1492 + dasd_free_block(device->block);
1493 + device->block = NULL;
1494 + out_err1:
1495 +- kfree(private->conf_data);
1496 ++ dasd_eckd_clear_conf_data(device);
1497 + kfree(device->private);
1498 + device->private = NULL;
1499 + return rc;
1500 +@@ -1778,7 +1779,6 @@ out_err1:
1501 + static void dasd_eckd_uncheck_device(struct dasd_device *device)
1502 + {
1503 + struct dasd_eckd_private *private = device->private;
1504 +- int i;
1505 +
1506 + if (!private)
1507 + return;
1508 +@@ -1788,21 +1788,7 @@ static void dasd_eckd_uncheck_device(struct dasd_device *device)
1509 + private->sneq = NULL;
1510 + private->vdsneq = NULL;
1511 + private->gneq = NULL;
1512 +- private->conf_len = 0;
1513 +- for (i = 0; i < 8; i++) {
1514 +- kfree(device->path[i].conf_data);
1515 +- if ((__u8 *)device->path[i].conf_data ==
1516 +- private->conf_data) {
1517 +- private->conf_data = NULL;
1518 +- private->conf_len = 0;
1519 +- }
1520 +- device->path[i].conf_data = NULL;
1521 +- device->path[i].cssid = 0;
1522 +- device->path[i].ssid = 0;
1523 +- device->path[i].chpid = 0;
1524 +- }
1525 +- kfree(private->conf_data);
1526 +- private->conf_data = NULL;
1527 ++ dasd_eckd_clear_conf_data(device);
1528 + }
1529 +
1530 + static struct dasd_ccw_req *
1531 +diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
1532 +index 4435ae0b3027..f0cae1973f78 100644
1533 +--- a/drivers/s390/cio/device_ops.c
1534 ++++ b/drivers/s390/cio/device_ops.c
1535 +@@ -624,7 +624,7 @@ EXPORT_SYMBOL(ccw_device_tm_start_timeout);
1536 + * @mask: mask of paths to use
1537 + *
1538 + * Return the number of 64K-bytes blocks all paths at least support
1539 +- * for a transport command. Return values <= 0 indicate failures.
1540 ++ * for a transport command. Return value 0 indicates failure.
1541 + */
1542 + int ccw_device_get_mdc(struct ccw_device *cdev, u8 mask)
1543 + {
1544 +diff --git a/drivers/spi/spi-cavium-thunderx.c b/drivers/spi/spi-cavium-thunderx.c
1545 +index 877937706240..828fbbebc3c4 100644
1546 +--- a/drivers/spi/spi-cavium-thunderx.c
1547 ++++ b/drivers/spi/spi-cavium-thunderx.c
1548 +@@ -81,6 +81,7 @@ static int thunderx_spi_probe(struct pci_dev *pdev,
1549 +
1550 + error:
1551 + clk_disable_unprepare(p->clk);
1552 ++ pci_release_regions(pdev);
1553 + spi_master_put(master);
1554 + return ret;
1555 + }
1556 +@@ -95,6 +96,7 @@ static void thunderx_spi_remove(struct pci_dev *pdev)
1557 + return;
1558 +
1559 + clk_disable_unprepare(p->clk);
1560 ++ pci_release_regions(pdev);
1561 + /* Put everything in a known state. */
1562 + writeq(0, p->register_base + OCTEON_SPI_CFG(p));
1563 + }
1564 +diff --git a/drivers/spi/spi-ti-qspi.c b/drivers/spi/spi-ti-qspi.c
1565 +index b9fb6493cd6b..95c28abaa027 100644
1566 +--- a/drivers/spi/spi-ti-qspi.c
1567 ++++ b/drivers/spi/spi-ti-qspi.c
1568 +@@ -69,6 +69,7 @@ struct ti_qspi {
1569 + u32 dc;
1570 +
1571 + bool mmap_enabled;
1572 ++ int current_cs;
1573 + };
1574 +
1575 + #define QSPI_PID (0x0)
1576 +@@ -494,6 +495,7 @@ static void ti_qspi_enable_memory_map(struct spi_device *spi)
1577 + MEM_CS_EN(spi->chip_select));
1578 + }
1579 + qspi->mmap_enabled = true;
1580 ++ qspi->current_cs = spi->chip_select;
1581 + }
1582 +
1583 + static void ti_qspi_disable_memory_map(struct spi_device *spi)
1584 +@@ -505,6 +507,7 @@ static void ti_qspi_disable_memory_map(struct spi_device *spi)
1585 + regmap_update_bits(qspi->ctrl_base, qspi->ctrl_reg,
1586 + MEM_CS_MASK, 0);
1587 + qspi->mmap_enabled = false;
1588 ++ qspi->current_cs = -1;
1589 + }
1590 +
1591 + static void ti_qspi_setup_mmap_read(struct spi_device *spi, u8 opcode,
1592 +@@ -550,7 +553,7 @@ static int ti_qspi_exec_mem_op(struct spi_mem *mem,
1593 +
1594 + mutex_lock(&qspi->list_lock);
1595 +
1596 +- if (!qspi->mmap_enabled)
1597 ++ if (!qspi->mmap_enabled || qspi->current_cs != mem->spi->chip_select)
1598 + ti_qspi_enable_memory_map(mem->spi);
1599 + ti_qspi_setup_mmap_read(mem->spi, op->cmd.opcode, op->data.buswidth,
1600 + op->addr.nbytes, op->dummy.nbytes);
1601 +@@ -807,6 +810,7 @@ no_dma:
1602 + }
1603 + }
1604 + qspi->mmap_enabled = false;
1605 ++ qspi->current_cs = -1;
1606 +
1607 + ret = devm_spi_register_master(&pdev->dev, master);
1608 + if (!ret)
1609 +diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
1610 +index 1eb72be75fb7..9fa70894179c 100644
1611 +--- a/drivers/usb/core/config.c
1612 ++++ b/drivers/usb/core/config.c
1613 +@@ -203,9 +203,58 @@ static const unsigned short super_speed_maxpacket_maxes[4] = {
1614 + [USB_ENDPOINT_XFER_INT] = 1024,
1615 + };
1616 +
1617 +-static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
1618 +- int asnum, struct usb_host_interface *ifp, int num_ep,
1619 +- unsigned char *buffer, int size)
1620 ++static bool endpoint_is_duplicate(struct usb_endpoint_descriptor *e1,
1621 ++ struct usb_endpoint_descriptor *e2)
1622 ++{
1623 ++ if (e1->bEndpointAddress == e2->bEndpointAddress)
1624 ++ return true;
1625 ++
1626 ++ if (usb_endpoint_xfer_control(e1) || usb_endpoint_xfer_control(e2)) {
1627 ++ if (usb_endpoint_num(e1) == usb_endpoint_num(e2))
1628 ++ return true;
1629 ++ }
1630 ++
1631 ++ return false;
1632 ++}
1633 ++
1634 ++/*
1635 ++ * Check for duplicate endpoint addresses in other interfaces and in the
1636 ++ * altsetting currently being parsed.
1637 ++ */
1638 ++static bool config_endpoint_is_duplicate(struct usb_host_config *config,
1639 ++ int inum, int asnum, struct usb_endpoint_descriptor *d)
1640 ++{
1641 ++ struct usb_endpoint_descriptor *epd;
1642 ++ struct usb_interface_cache *intfc;
1643 ++ struct usb_host_interface *alt;
1644 ++ int i, j, k;
1645 ++
1646 ++ for (i = 0; i < config->desc.bNumInterfaces; ++i) {
1647 ++ intfc = config->intf_cache[i];
1648 ++
1649 ++ for (j = 0; j < intfc->num_altsetting; ++j) {
1650 ++ alt = &intfc->altsetting[j];
1651 ++
1652 ++ if (alt->desc.bInterfaceNumber == inum &&
1653 ++ alt->desc.bAlternateSetting != asnum)
1654 ++ continue;
1655 ++
1656 ++ for (k = 0; k < alt->desc.bNumEndpoints; ++k) {
1657 ++ epd = &alt->endpoint[k].desc;
1658 ++
1659 ++ if (endpoint_is_duplicate(epd, d))
1660 ++ return true;
1661 ++ }
1662 ++ }
1663 ++ }
1664 ++
1665 ++ return false;
1666 ++}
1667 ++
1668 ++static int usb_parse_endpoint(struct device *ddev, int cfgno,
1669 ++ struct usb_host_config *config, int inum, int asnum,
1670 ++ struct usb_host_interface *ifp, int num_ep,
1671 ++ unsigned char *buffer, int size)
1672 + {
1673 + unsigned char *buffer0 = buffer;
1674 + struct usb_endpoint_descriptor *d;
1675 +@@ -242,13 +291,10 @@ static int usb_parse_endpoint(struct device *ddev, int cfgno, int inum,
1676 + goto skip_to_next_endpoint_or_interface_descriptor;
1677 +
1678 + /* Check for duplicate endpoint addresses */
1679 +- for (i = 0; i < ifp->desc.bNumEndpoints; ++i) {
1680 +- if (ifp->endpoint[i].desc.bEndpointAddress ==
1681 +- d->bEndpointAddress) {
1682 +- dev_warn(ddev, "config %d interface %d altsetting %d has a duplicate endpoint with address 0x%X, skipping\n",
1683 +- cfgno, inum, asnum, d->bEndpointAddress);
1684 +- goto skip_to_next_endpoint_or_interface_descriptor;
1685 +- }
1686 ++ if (config_endpoint_is_duplicate(config, inum, asnum, d)) {
1687 ++ dev_warn(ddev, "config %d interface %d altsetting %d has a duplicate endpoint with address 0x%X, skipping\n",
1688 ++ cfgno, inum, asnum, d->bEndpointAddress);
1689 ++ goto skip_to_next_endpoint_or_interface_descriptor;
1690 + }
1691 +
1692 + endpoint = &ifp->endpoint[ifp->desc.bNumEndpoints];
1693 +@@ -522,8 +568,8 @@ static int usb_parse_interface(struct device *ddev, int cfgno,
1694 + if (((struct usb_descriptor_header *) buffer)->bDescriptorType
1695 + == USB_DT_INTERFACE)
1696 + break;
1697 +- retval = usb_parse_endpoint(ddev, cfgno, inum, asnum, alt,
1698 +- num_ep, buffer, size);
1699 ++ retval = usb_parse_endpoint(ddev, cfgno, config, inum, asnum,
1700 ++ alt, num_ep, buffer, size);
1701 + if (retval < 0)
1702 + return retval;
1703 + ++n;
1704 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
1705 +index b33ec768404b..adc8e3a0138f 100644
1706 +--- a/drivers/usb/core/hub.c
1707 ++++ b/drivers/usb/core/hub.c
1708 +@@ -2657,7 +2657,7 @@ static unsigned hub_is_wusb(struct usb_hub *hub)
1709 + #define SET_ADDRESS_TRIES 2
1710 + #define GET_DESCRIPTOR_TRIES 2
1711 + #define SET_CONFIG_TRIES (2 * (use_both_schemes + 1))
1712 +-#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)scheme)
1713 ++#define USE_NEW_SCHEME(i, scheme) ((i) / 2 == (int)(scheme))
1714 +
1715 + #define HUB_ROOT_RESET_TIME 60 /* times are in msec */
1716 + #define HUB_SHORT_RESET_TIME 10
1717 +diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
1718 +index 3a24230bb89a..a6e682a000fc 100644
1719 +--- a/drivers/usb/dwc3/gadget.c
1720 ++++ b/drivers/usb/dwc3/gadget.c
1721 +@@ -2271,6 +2271,13 @@ static int dwc3_gadget_ep_reclaim_trb_linear(struct dwc3_ep *dep,
1722 +
1723 + static bool dwc3_gadget_ep_request_completed(struct dwc3_request *req)
1724 + {
1725 ++ /*
1726 ++ * For OUT direction, host may send less than the setup
1727 ++ * length. Return true for all OUT requests.
1728 ++ */
1729 ++ if (!req->direction)
1730 ++ return true;
1731 ++
1732 + return req->request.actual == req->request.length;
1733 + }
1734 +
1735 +diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c
1736 +index 1505e554d245..d0248c58dcb6 100644
1737 +--- a/drivers/usb/gadget/udc/dummy_hcd.c
1738 ++++ b/drivers/usb/gadget/udc/dummy_hcd.c
1739 +@@ -1335,7 +1335,7 @@ static int dummy_perform_transfer(struct urb *urb, struct dummy_request *req,
1740 + u32 this_sg;
1741 + bool next_sg;
1742 +
1743 +- to_host = usb_pipein(urb->pipe);
1744 ++ to_host = usb_urb_dir_in(urb);
1745 + rbuf = req->req.buf + req->req.actual;
1746 +
1747 + if (!urb->num_sgs) {
1748 +@@ -1423,7 +1423,7 @@ top:
1749 +
1750 + /* FIXME update emulated data toggle too */
1751 +
1752 +- to_host = usb_pipein(urb->pipe);
1753 ++ to_host = usb_urb_dir_in(urb);
1754 + if (unlikely(len == 0))
1755 + is_short = 1;
1756 + else {
1757 +@@ -1844,7 +1844,7 @@ restart:
1758 +
1759 + /* find the gadget's ep for this request (if configured) */
1760 + address = usb_pipeendpoint (urb->pipe);
1761 +- if (usb_pipein(urb->pipe))
1762 ++ if (usb_urb_dir_in(urb))
1763 + address |= USB_DIR_IN;
1764 + ep = find_endpoint(dum, address);
1765 + if (!ep) {
1766 +@@ -2399,7 +2399,7 @@ static inline ssize_t show_urb(char *buf, size_t size, struct urb *urb)
1767 + s = "?";
1768 + break;
1769 + } s; }),
1770 +- ep, ep ? (usb_pipein(urb->pipe) ? "in" : "out") : "",
1771 ++ ep, ep ? (usb_urb_dir_in(urb) ? "in" : "out") : "",
1772 + ({ char *s; \
1773 + switch (usb_pipetype(urb->pipe)) { \
1774 + case PIPE_CONTROL: \
1775 +@@ -2739,7 +2739,7 @@ static struct platform_driver dummy_hcd_driver = {
1776 + };
1777 +
1778 + /*-------------------------------------------------------------------------*/
1779 +-#define MAX_NUM_UDC 2
1780 ++#define MAX_NUM_UDC 32
1781 + static struct platform_device *the_udc_pdev[MAX_NUM_UDC];
1782 + static struct platform_device *the_hcd_pdev[MAX_NUM_UDC];
1783 +
1784 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1785 +index 2905274e3626..553adab174bf 100644
1786 +--- a/drivers/usb/serial/option.c
1787 ++++ b/drivers/usb/serial/option.c
1788 +@@ -1172,6 +1172,8 @@ static const struct usb_device_id option_ids[] = {
1789 + .driver_info = NCTRL(0) | RSVD(3) },
1790 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1102, 0xff), /* Telit ME910 (ECM) */
1791 + .driver_info = NCTRL(0) },
1792 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x110a, 0xff), /* Telit ME910G1 */
1793 ++ .driver_info = NCTRL(0) | RSVD(3) },
1794 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910),
1795 + .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1796 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_LE910_USBCFG4),
1797 +diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
1798 +index cdd6d5021000..7916f711daf5 100644
1799 +--- a/fs/btrfs/qgroup.c
1800 ++++ b/fs/btrfs/qgroup.c
1801 +@@ -2862,12 +2862,12 @@ qgroup_rescan_init(struct btrfs_fs_info *fs_info, u64 progress_objectid,
1802 + if (!(fs_info->qgroup_flags &
1803 + BTRFS_QGROUP_STATUS_FLAG_RESCAN)) {
1804 + btrfs_warn(fs_info,
1805 +- "qgroup rescan init failed, qgroup is not enabled");
1806 ++ "qgroup rescan init failed, qgroup rescan is not queued");
1807 + ret = -EINVAL;
1808 + } else if (!(fs_info->qgroup_flags &
1809 + BTRFS_QGROUP_STATUS_FLAG_ON)) {
1810 + btrfs_warn(fs_info,
1811 +- "qgroup rescan init failed, qgroup rescan is not queued");
1812 ++ "qgroup rescan init failed, qgroup is not enabled");
1813 + ret = -EINVAL;
1814 + }
1815 +
1816 +diff --git a/fs/drop_caches.c b/fs/drop_caches.c
1817 +index d31b6c72b476..dc1a1d5d825b 100644
1818 +--- a/fs/drop_caches.c
1819 ++++ b/fs/drop_caches.c
1820 +@@ -35,11 +35,11 @@ static void drop_pagecache_sb(struct super_block *sb, void *unused)
1821 + spin_unlock(&inode->i_lock);
1822 + spin_unlock(&sb->s_inode_list_lock);
1823 +
1824 +- cond_resched();
1825 + invalidate_mapping_pages(inode->i_mapping, 0, -1);
1826 + iput(toput_inode);
1827 + toput_inode = inode;
1828 +
1829 ++ cond_resched();
1830 + spin_lock(&sb->s_inode_list_lock);
1831 + }
1832 + spin_unlock(&sb->s_inode_list_lock);
1833 +diff --git a/fs/inode.c b/fs/inode.c
1834 +index 5c63693326bb..9c50521c9fe4 100644
1835 +--- a/fs/inode.c
1836 ++++ b/fs/inode.c
1837 +@@ -660,6 +660,7 @@ int invalidate_inodes(struct super_block *sb, bool kill_dirty)
1838 + struct inode *inode, *next;
1839 + LIST_HEAD(dispose);
1840 +
1841 ++again:
1842 + spin_lock(&sb->s_inode_list_lock);
1843 + list_for_each_entry_safe(inode, next, &sb->s_inodes, i_sb_list) {
1844 + spin_lock(&inode->i_lock);
1845 +@@ -682,6 +683,12 @@ int invalidate_inodes(struct super_block *sb, bool kill_dirty)
1846 + inode_lru_list_del(inode);
1847 + spin_unlock(&inode->i_lock);
1848 + list_add(&inode->i_lru, &dispose);
1849 ++ if (need_resched()) {
1850 ++ spin_unlock(&sb->s_inode_list_lock);
1851 ++ cond_resched();
1852 ++ dispose_list(&dispose);
1853 ++ goto again;
1854 ++ }
1855 + }
1856 + spin_unlock(&sb->s_inode_list_lock);
1857 +
1858 +diff --git a/fs/notify/fsnotify.c b/fs/notify/fsnotify.c
1859 +index 170a733454f7..e8ee4263d7b2 100644
1860 +--- a/fs/notify/fsnotify.c
1861 ++++ b/fs/notify/fsnotify.c
1862 +@@ -90,6 +90,7 @@ void fsnotify_unmount_inodes(struct super_block *sb)
1863 +
1864 + iput_inode = inode;
1865 +
1866 ++ cond_resched();
1867 + spin_lock(&sb->s_inode_list_lock);
1868 + }
1869 + spin_unlock(&sb->s_inode_list_lock);
1870 +diff --git a/fs/quota/dquot.c b/fs/quota/dquot.c
1871 +index 154f175066b3..1d1d393f4208 100644
1872 +--- a/fs/quota/dquot.c
1873 ++++ b/fs/quota/dquot.c
1874 +@@ -980,6 +980,7 @@ static int add_dquot_ref(struct super_block *sb, int type)
1875 + * later.
1876 + */
1877 + old_inode = inode;
1878 ++ cond_resched();
1879 + spin_lock(&sb->s_inode_list_lock);
1880 + }
1881 + spin_unlock(&sb->s_inode_list_lock);
1882 +diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
1883 +index 548fd535fd02..d433f5e292c9 100644
1884 +--- a/include/linux/if_ether.h
1885 ++++ b/include/linux/if_ether.h
1886 +@@ -28,6 +28,14 @@ static inline struct ethhdr *eth_hdr(const struct sk_buff *skb)
1887 + return (struct ethhdr *)skb_mac_header(skb);
1888 + }
1889 +
1890 ++/* Prefer this version in TX path, instead of
1891 ++ * skb_reset_mac_header() + eth_hdr()
1892 ++ */
1893 ++static inline struct ethhdr *skb_eth_hdr(const struct sk_buff *skb)
1894 ++{
1895 ++ return (struct ethhdr *)skb->data;
1896 ++}
1897 ++
1898 + static inline struct ethhdr *inner_eth_hdr(const struct sk_buff *skb)
1899 + {
1900 + return (struct ethhdr *)skb_inner_mac_header(skb);
1901 +diff --git a/include/uapi/linux/netfilter/xt_sctp.h b/include/uapi/linux/netfilter/xt_sctp.h
1902 +index 4bc6d1a08781..b4d804a9fccb 100644
1903 +--- a/include/uapi/linux/netfilter/xt_sctp.h
1904 ++++ b/include/uapi/linux/netfilter/xt_sctp.h
1905 +@@ -41,19 +41,19 @@ struct xt_sctp_info {
1906 + #define SCTP_CHUNKMAP_SET(chunkmap, type) \
1907 + do { \
1908 + (chunkmap)[type / bytes(__u32)] |= \
1909 +- 1 << (type % bytes(__u32)); \
1910 ++ 1u << (type % bytes(__u32)); \
1911 + } while (0)
1912 +
1913 + #define SCTP_CHUNKMAP_CLEAR(chunkmap, type) \
1914 + do { \
1915 + (chunkmap)[type / bytes(__u32)] &= \
1916 +- ~(1 << (type % bytes(__u32))); \
1917 ++ ~(1u << (type % bytes(__u32))); \
1918 + } while (0)
1919 +
1920 + #define SCTP_CHUNKMAP_IS_SET(chunkmap, type) \
1921 + ({ \
1922 + ((chunkmap)[type / bytes (__u32)] & \
1923 +- (1 << (type % bytes (__u32)))) ? 1: 0; \
1924 ++ (1u << (type % bytes (__u32)))) ? 1: 0; \
1925 + })
1926 +
1927 + #define SCTP_CHUNKMAP_RESET(chunkmap) \
1928 +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
1929 +index 1dff5f7323cc..9e72b2f8c3dd 100644
1930 +--- a/kernel/bpf/verifier.c
1931 ++++ b/kernel/bpf/verifier.c
1932 +@@ -4272,6 +4272,7 @@ static bool may_access_skb(enum bpf_prog_type type)
1933 + static int check_ld_abs(struct bpf_verifier_env *env, struct bpf_insn *insn)
1934 + {
1935 + struct bpf_reg_state *regs = cur_regs(env);
1936 ++ static const int ctx_reg = BPF_REG_6;
1937 + u8 mode = BPF_MODE(insn->code);
1938 + int i, err;
1939 +
1940 +@@ -4305,11 +4306,11 @@ static int check_ld_abs(struct bpf_verifier_env *env, struct bpf_insn *insn)
1941 + }
1942 +
1943 + /* check whether implicit source operand (register R6) is readable */
1944 +- err = check_reg_arg(env, BPF_REG_6, SRC_OP);
1945 ++ err = check_reg_arg(env, ctx_reg, SRC_OP);
1946 + if (err)
1947 + return err;
1948 +
1949 +- if (regs[BPF_REG_6].type != PTR_TO_CTX) {
1950 ++ if (regs[ctx_reg].type != PTR_TO_CTX) {
1951 + verbose(env,
1952 + "at the time of BPF_LD_ABS|IND R6 != pointer to skb\n");
1953 + return -EINVAL;
1954 +@@ -4322,6 +4323,10 @@ static int check_ld_abs(struct bpf_verifier_env *env, struct bpf_insn *insn)
1955 + return err;
1956 + }
1957 +
1958 ++ err = check_ctx_reg(env, &regs[ctx_reg], ctx_reg);
1959 ++ if (err < 0)
1960 ++ return err;
1961 ++
1962 + /* reset caller saved regs to unreadable */
1963 + for (i = 0; i < CALLER_SAVED_REGS; i++) {
1964 + mark_reg_not_init(env, regs, caller_saved[i]);
1965 +diff --git a/kernel/locking/spinlock_debug.c b/kernel/locking/spinlock_debug.c
1966 +index 9aa0fccd5d43..03595c29c566 100644
1967 +--- a/kernel/locking/spinlock_debug.c
1968 ++++ b/kernel/locking/spinlock_debug.c
1969 +@@ -51,19 +51,19 @@ EXPORT_SYMBOL(__rwlock_init);
1970 +
1971 + static void spin_dump(raw_spinlock_t *lock, const char *msg)
1972 + {
1973 +- struct task_struct *owner = NULL;
1974 ++ struct task_struct *owner = READ_ONCE(lock->owner);
1975 +
1976 +- if (lock->owner && lock->owner != SPINLOCK_OWNER_INIT)
1977 +- owner = lock->owner;
1978 ++ if (owner == SPINLOCK_OWNER_INIT)
1979 ++ owner = NULL;
1980 + printk(KERN_EMERG "BUG: spinlock %s on CPU#%d, %s/%d\n",
1981 + msg, raw_smp_processor_id(),
1982 + current->comm, task_pid_nr(current));
1983 + printk(KERN_EMERG " lock: %pS, .magic: %08x, .owner: %s/%d, "
1984 + ".owner_cpu: %d\n",
1985 +- lock, lock->magic,
1986 ++ lock, READ_ONCE(lock->magic),
1987 + owner ? owner->comm : "<none>",
1988 + owner ? task_pid_nr(owner) : -1,
1989 +- lock->owner_cpu);
1990 ++ READ_ONCE(lock->owner_cpu));
1991 + dump_stack();
1992 + }
1993 +
1994 +@@ -80,16 +80,16 @@ static void spin_bug(raw_spinlock_t *lock, const char *msg)
1995 + static inline void
1996 + debug_spin_lock_before(raw_spinlock_t *lock)
1997 + {
1998 +- SPIN_BUG_ON(lock->magic != SPINLOCK_MAGIC, lock, "bad magic");
1999 +- SPIN_BUG_ON(lock->owner == current, lock, "recursion");
2000 +- SPIN_BUG_ON(lock->owner_cpu == raw_smp_processor_id(),
2001 ++ SPIN_BUG_ON(READ_ONCE(lock->magic) != SPINLOCK_MAGIC, lock, "bad magic");
2002 ++ SPIN_BUG_ON(READ_ONCE(lock->owner) == current, lock, "recursion");
2003 ++ SPIN_BUG_ON(READ_ONCE(lock->owner_cpu) == raw_smp_processor_id(),
2004 + lock, "cpu recursion");
2005 + }
2006 +
2007 + static inline void debug_spin_lock_after(raw_spinlock_t *lock)
2008 + {
2009 +- lock->owner_cpu = raw_smp_processor_id();
2010 +- lock->owner = current;
2011 ++ WRITE_ONCE(lock->owner_cpu, raw_smp_processor_id());
2012 ++ WRITE_ONCE(lock->owner, current);
2013 + }
2014 +
2015 + static inline void debug_spin_unlock(raw_spinlock_t *lock)
2016 +@@ -99,8 +99,8 @@ static inline void debug_spin_unlock(raw_spinlock_t *lock)
2017 + SPIN_BUG_ON(lock->owner != current, lock, "wrong owner");
2018 + SPIN_BUG_ON(lock->owner_cpu != raw_smp_processor_id(),
2019 + lock, "wrong CPU");
2020 +- lock->owner = SPINLOCK_OWNER_INIT;
2021 +- lock->owner_cpu = -1;
2022 ++ WRITE_ONCE(lock->owner, SPINLOCK_OWNER_INIT);
2023 ++ WRITE_ONCE(lock->owner_cpu, -1);
2024 + }
2025 +
2026 + /*
2027 +@@ -183,8 +183,8 @@ static inline void debug_write_lock_before(rwlock_t *lock)
2028 +
2029 + static inline void debug_write_lock_after(rwlock_t *lock)
2030 + {
2031 +- lock->owner_cpu = raw_smp_processor_id();
2032 +- lock->owner = current;
2033 ++ WRITE_ONCE(lock->owner_cpu, raw_smp_processor_id());
2034 ++ WRITE_ONCE(lock->owner, current);
2035 + }
2036 +
2037 + static inline void debug_write_unlock(rwlock_t *lock)
2038 +@@ -193,8 +193,8 @@ static inline void debug_write_unlock(rwlock_t *lock)
2039 + RWLOCK_BUG_ON(lock->owner != current, lock, "wrong owner");
2040 + RWLOCK_BUG_ON(lock->owner_cpu != raw_smp_processor_id(),
2041 + lock, "wrong CPU");
2042 +- lock->owner = SPINLOCK_OWNER_INIT;
2043 +- lock->owner_cpu = -1;
2044 ++ WRITE_ONCE(lock->owner, SPINLOCK_OWNER_INIT);
2045 ++ WRITE_ONCE(lock->owner_cpu, -1);
2046 + }
2047 +
2048 + void do_raw_write_lock(rwlock_t *lock)
2049 +diff --git a/net/8021q/vlan.h b/net/8021q/vlan.h
2050 +index 44df1c3df02d..e9cd8ef2a245 100644
2051 +--- a/net/8021q/vlan.h
2052 ++++ b/net/8021q/vlan.h
2053 +@@ -114,6 +114,7 @@ int vlan_check_real_dev(struct net_device *real_dev,
2054 + void vlan_setup(struct net_device *dev);
2055 + int register_vlan_dev(struct net_device *dev, struct netlink_ext_ack *extack);
2056 + void unregister_vlan_dev(struct net_device *dev, struct list_head *head);
2057 ++void vlan_dev_uninit(struct net_device *dev);
2058 + bool vlan_dev_inherit_address(struct net_device *dev,
2059 + struct net_device *real_dev);
2060 +
2061 +diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c
2062 +index fce3b7eebffb..84ef83772114 100644
2063 +--- a/net/8021q/vlan_dev.c
2064 ++++ b/net/8021q/vlan_dev.c
2065 +@@ -612,7 +612,8 @@ static int vlan_dev_init(struct net_device *dev)
2066 + return 0;
2067 + }
2068 +
2069 +-static void vlan_dev_uninit(struct net_device *dev)
2070 ++/* Note: this function might be called multiple times for the same device. */
2071 ++void vlan_dev_uninit(struct net_device *dev)
2072 + {
2073 + struct vlan_priority_tci_mapping *pm;
2074 + struct vlan_dev_priv *vlan = vlan_dev_priv(dev);
2075 +diff --git a/net/8021q/vlan_netlink.c b/net/8021q/vlan_netlink.c
2076 +index 9b60c1e399e2..74042b9d7f73 100644
2077 +--- a/net/8021q/vlan_netlink.c
2078 ++++ b/net/8021q/vlan_netlink.c
2079 +@@ -110,11 +110,13 @@ static int vlan_changelink(struct net_device *dev, struct nlattr *tb[],
2080 + struct ifla_vlan_flags *flags;
2081 + struct ifla_vlan_qos_mapping *m;
2082 + struct nlattr *attr;
2083 +- int rem;
2084 ++ int rem, err;
2085 +
2086 + if (data[IFLA_VLAN_FLAGS]) {
2087 + flags = nla_data(data[IFLA_VLAN_FLAGS]);
2088 +- vlan_dev_change_flags(dev, flags->flags, flags->mask);
2089 ++ err = vlan_dev_change_flags(dev, flags->flags, flags->mask);
2090 ++ if (err)
2091 ++ return err;
2092 + }
2093 + if (data[IFLA_VLAN_INGRESS_QOS]) {
2094 + nla_for_each_nested(attr, data[IFLA_VLAN_INGRESS_QOS], rem) {
2095 +@@ -125,7 +127,9 @@ static int vlan_changelink(struct net_device *dev, struct nlattr *tb[],
2096 + if (data[IFLA_VLAN_EGRESS_QOS]) {
2097 + nla_for_each_nested(attr, data[IFLA_VLAN_EGRESS_QOS], rem) {
2098 + m = nla_data(attr);
2099 +- vlan_dev_set_egress_priority(dev, m->from, m->to);
2100 ++ err = vlan_dev_set_egress_priority(dev, m->from, m->to);
2101 ++ if (err)
2102 ++ return err;
2103 + }
2104 + }
2105 + return 0;
2106 +@@ -181,10 +185,11 @@ static int vlan_newlink(struct net *src_net, struct net_device *dev,
2107 + return -EINVAL;
2108 +
2109 + err = vlan_changelink(dev, tb, data, extack);
2110 +- if (err < 0)
2111 +- return err;
2112 +-
2113 +- return register_vlan_dev(dev, extack);
2114 ++ if (!err)
2115 ++ err = register_vlan_dev(dev, extack);
2116 ++ if (err)
2117 ++ vlan_dev_uninit(dev);
2118 ++ return err;
2119 + }
2120 +
2121 + static inline size_t vlan_qos_map_size(unsigned int n)
2122 +diff --git a/net/core/filter.c b/net/core/filter.c
2123 +index e6fa88506c00..91b950261975 100644
2124 +--- a/net/core/filter.c
2125 ++++ b/net/core/filter.c
2126 +@@ -2007,6 +2007,7 @@ static inline int __bpf_tx_skb(struct net_device *dev, struct sk_buff *skb)
2127 + }
2128 +
2129 + skb->dev = dev;
2130 ++ skb->tstamp = 0;
2131 +
2132 + __this_cpu_inc(xmit_recursion);
2133 + ret = dev_queue_xmit(skb);
2134 +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
2135 +index 3a08ee81cbc3..578b65e6e65b 100644
2136 +--- a/net/ipv4/tcp_input.c
2137 ++++ b/net/ipv4/tcp_input.c
2138 +@@ -1716,8 +1716,11 @@ tcp_sacktag_write_queue(struct sock *sk, const struct sk_buff *ack_skb,
2139 + }
2140 +
2141 + /* Ignore very old stuff early */
2142 +- if (!after(sp[used_sacks].end_seq, prior_snd_una))
2143 ++ if (!after(sp[used_sacks].end_seq, prior_snd_una)) {
2144 ++ if (i == 0)
2145 ++ first_sack_index = -1;
2146 + continue;
2147 ++ }
2148 +
2149 + used_sacks++;
2150 + }
2151 +diff --git a/net/llc/llc_station.c b/net/llc/llc_station.c
2152 +index 204a8351efff..c29170e767a8 100644
2153 +--- a/net/llc/llc_station.c
2154 ++++ b/net/llc/llc_station.c
2155 +@@ -32,7 +32,7 @@ static int llc_stat_ev_rx_null_dsap_xid_c(struct sk_buff *skb)
2156 + return LLC_PDU_IS_CMD(pdu) && /* command PDU */
2157 + LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
2158 + LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_XID &&
2159 +- !pdu->dsap ? 0 : 1; /* NULL DSAP value */
2160 ++ !pdu->dsap; /* NULL DSAP value */
2161 + }
2162 +
2163 + static int llc_stat_ev_rx_null_dsap_test_c(struct sk_buff *skb)
2164 +@@ -42,7 +42,7 @@ static int llc_stat_ev_rx_null_dsap_test_c(struct sk_buff *skb)
2165 + return LLC_PDU_IS_CMD(pdu) && /* command PDU */
2166 + LLC_PDU_TYPE_IS_U(pdu) && /* U type PDU */
2167 + LLC_U_PDU_CMD(pdu) == LLC_1_PDU_CMD_TEST &&
2168 +- !pdu->dsap ? 0 : 1; /* NULL DSAP */
2169 ++ !pdu->dsap; /* NULL DSAP */
2170 + }
2171 +
2172 + static int llc_station_ac_send_xid_r(struct sk_buff *skb)
2173 +diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c
2174 +index 47e5a076522d..7ba9ea55816a 100644
2175 +--- a/net/netfilter/nf_conntrack_netlink.c
2176 ++++ b/net/netfilter/nf_conntrack_netlink.c
2177 +@@ -3576,6 +3576,9 @@ static void __net_exit ctnetlink_net_exit_batch(struct list_head *net_exit_list)
2178 +
2179 + list_for_each_entry(net, net_exit_list, exit_list)
2180 + ctnetlink_net_exit(net);
2181 ++
2182 ++ /* wait for other cpus until they are done with ctnl_notifiers */
2183 ++ synchronize_rcu();
2184 + }
2185 +
2186 + static struct pernet_operations ctnetlink_net_ops = {
2187 +diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
2188 +index 0e1b1f7f4745..4711a8b56f32 100644
2189 +--- a/net/netfilter/nf_tables_api.c
2190 ++++ b/net/netfilter/nf_tables_api.c
2191 +@@ -4117,8 +4117,10 @@ static int nft_get_set_elem(struct nft_ctx *ctx, struct nft_set *set,
2192 + return err;
2193 +
2194 + err = -EINVAL;
2195 +- if (desc.type != NFT_DATA_VALUE || desc.len != set->klen)
2196 ++ if (desc.type != NFT_DATA_VALUE || desc.len != set->klen) {
2197 ++ nft_data_release(&elem.key.val, desc.type);
2198 + return err;
2199 ++ }
2200 +
2201 + priv = set->ops->get(ctx->net, set, &elem, flags);
2202 + if (IS_ERR(priv))
2203 +@@ -4351,14 +4353,20 @@ static int nft_add_set_elem(struct nft_ctx *ctx, struct nft_set *set,
2204 + if (nla[NFTA_SET_ELEM_DATA] == NULL &&
2205 + !(flags & NFT_SET_ELEM_INTERVAL_END))
2206 + return -EINVAL;
2207 +- if (nla[NFTA_SET_ELEM_DATA] != NULL &&
2208 +- flags & NFT_SET_ELEM_INTERVAL_END)
2209 +- return -EINVAL;
2210 + } else {
2211 + if (nla[NFTA_SET_ELEM_DATA] != NULL)
2212 + return -EINVAL;
2213 + }
2214 +
2215 ++ if ((flags & NFT_SET_ELEM_INTERVAL_END) &&
2216 ++ (nla[NFTA_SET_ELEM_DATA] ||
2217 ++ nla[NFTA_SET_ELEM_OBJREF] ||
2218 ++ nla[NFTA_SET_ELEM_TIMEOUT] ||
2219 ++ nla[NFTA_SET_ELEM_EXPIRATION] ||
2220 ++ nla[NFTA_SET_ELEM_USERDATA] ||
2221 ++ nla[NFTA_SET_ELEM_EXPR]))
2222 ++ return -EINVAL;
2223 ++
2224 + timeout = 0;
2225 + if (nla[NFTA_SET_ELEM_TIMEOUT] != NULL) {
2226 + if (!(set->flags & NFT_SET_TIMEOUT))
2227 +diff --git a/net/netfilter/nft_bitwise.c b/net/netfilter/nft_bitwise.c
2228 +index fff8073e2a56..058ee84ea531 100644
2229 +--- a/net/netfilter/nft_bitwise.c
2230 ++++ b/net/netfilter/nft_bitwise.c
2231 +@@ -83,7 +83,7 @@ static int nft_bitwise_init(const struct nft_ctx *ctx,
2232 + tb[NFTA_BITWISE_MASK]);
2233 + if (err < 0)
2234 + return err;
2235 +- if (d1.len != priv->len) {
2236 ++ if (d1.type != NFT_DATA_VALUE || d1.len != priv->len) {
2237 + err = -EINVAL;
2238 + goto err1;
2239 + }
2240 +@@ -92,7 +92,7 @@ static int nft_bitwise_init(const struct nft_ctx *ctx,
2241 + tb[NFTA_BITWISE_XOR]);
2242 + if (err < 0)
2243 + goto err1;
2244 +- if (d2.len != priv->len) {
2245 ++ if (d2.type != NFT_DATA_VALUE || d2.len != priv->len) {
2246 + err = -EINVAL;
2247 + goto err2;
2248 + }
2249 +diff --git a/net/netfilter/nft_cmp.c b/net/netfilter/nft_cmp.c
2250 +index 79d48c1d06f4..7007045c0849 100644
2251 +--- a/net/netfilter/nft_cmp.c
2252 ++++ b/net/netfilter/nft_cmp.c
2253 +@@ -82,6 +82,12 @@ static int nft_cmp_init(const struct nft_ctx *ctx, const struct nft_expr *expr,
2254 + if (err < 0)
2255 + return err;
2256 +
2257 ++ if (desc.type != NFT_DATA_VALUE) {
2258 ++ err = -EINVAL;
2259 ++ nft_data_release(&priv->data, desc.type);
2260 ++ return err;
2261 ++ }
2262 ++
2263 + priv->sreg = nft_parse_register(tb[NFTA_CMP_SREG]);
2264 + err = nft_validate_register_load(priv->sreg, desc.len);
2265 + if (err < 0)
2266 +diff --git a/net/netfilter/nft_range.c b/net/netfilter/nft_range.c
2267 +index cedb96c3619f..2e1d2ec2f52a 100644
2268 +--- a/net/netfilter/nft_range.c
2269 ++++ b/net/netfilter/nft_range.c
2270 +@@ -70,11 +70,21 @@ static int nft_range_init(const struct nft_ctx *ctx, const struct nft_expr *expr
2271 + if (err < 0)
2272 + return err;
2273 +
2274 ++ if (desc_from.type != NFT_DATA_VALUE) {
2275 ++ err = -EINVAL;
2276 ++ goto err1;
2277 ++ }
2278 ++
2279 + err = nft_data_init(NULL, &priv->data_to, sizeof(priv->data_to),
2280 + &desc_to, tb[NFTA_RANGE_TO_DATA]);
2281 + if (err < 0)
2282 + goto err1;
2283 +
2284 ++ if (desc_to.type != NFT_DATA_VALUE) {
2285 ++ err = -EINVAL;
2286 ++ goto err2;
2287 ++ }
2288 ++
2289 + if (desc_from.len != desc_to.len) {
2290 + err = -EINVAL;
2291 + goto err2;
2292 +diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
2293 +index b3e75f9cb686..0221510328d4 100644
2294 +--- a/net/netfilter/nft_set_rbtree.c
2295 ++++ b/net/netfilter/nft_set_rbtree.c
2296 +@@ -77,8 +77,13 @@ static bool __nft_rbtree_lookup(const struct net *net, const struct nft_set *set
2297 + parent = rcu_dereference_raw(parent->rb_left);
2298 + continue;
2299 + }
2300 +- if (nft_rbtree_interval_end(rbe))
2301 +- goto out;
2302 ++ if (nft_rbtree_interval_end(rbe)) {
2303 ++ if (nft_set_is_anonymous(set))
2304 ++ return false;
2305 ++ parent = rcu_dereference_raw(parent->rb_left);
2306 ++ interval = NULL;
2307 ++ continue;
2308 ++ }
2309 +
2310 + *ext = &rbe->ext;
2311 + return true;
2312 +@@ -91,7 +96,7 @@ static bool __nft_rbtree_lookup(const struct net *net, const struct nft_set *set
2313 + *ext = &interval->ext;
2314 + return true;
2315 + }
2316 +-out:
2317 ++
2318 + return false;
2319 + }
2320 +
2321 +@@ -139,8 +144,10 @@ static bool __nft_rbtree_get(const struct net *net, const struct nft_set *set,
2322 + } else if (d > 0) {
2323 + parent = rcu_dereference_raw(parent->rb_right);
2324 + } else {
2325 +- if (!nft_set_elem_active(&rbe->ext, genmask))
2326 ++ if (!nft_set_elem_active(&rbe->ext, genmask)) {
2327 + parent = rcu_dereference_raw(parent->rb_left);
2328 ++ continue;
2329 ++ }
2330 +
2331 + if (!nft_set_ext_exists(&rbe->ext, NFT_SET_EXT_FLAGS) ||
2332 + (*nft_set_ext_flags(&rbe->ext) & NFT_SET_ELEM_INTERVAL_END) ==
2333 +@@ -148,7 +155,11 @@ static bool __nft_rbtree_get(const struct net *net, const struct nft_set *set,
2334 + *elem = rbe;
2335 + return true;
2336 + }
2337 +- return false;
2338 ++
2339 ++ if (nft_rbtree_interval_end(rbe))
2340 ++ interval = NULL;
2341 ++
2342 ++ parent = rcu_dereference_raw(parent->rb_left);
2343 + }
2344 + }
2345 +
2346 +diff --git a/net/rfkill/core.c b/net/rfkill/core.c
2347 +index 7fbc8314f626..d6467cbf5c4f 100644
2348 +--- a/net/rfkill/core.c
2349 ++++ b/net/rfkill/core.c
2350 +@@ -1014,10 +1014,13 @@ static void rfkill_sync_work(struct work_struct *work)
2351 + int __must_check rfkill_register(struct rfkill *rfkill)
2352 + {
2353 + static unsigned long rfkill_no;
2354 +- struct device *dev = &rfkill->dev;
2355 ++ struct device *dev;
2356 + int error;
2357 +
2358 +- BUG_ON(!rfkill);
2359 ++ if (!rfkill)
2360 ++ return -EINVAL;
2361 ++
2362 ++ dev = &rfkill->dev;
2363 +
2364 + mutex_lock(&rfkill_global_mutex);
2365 +
2366 +diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
2367 +index e4cf72b0675e..824e3c37e5dd 100644
2368 +--- a/net/sched/sch_cake.c
2369 ++++ b/net/sched/sch_cake.c
2370 +@@ -1758,7 +1758,7 @@ static s32 cake_enqueue(struct sk_buff *skb, struct Qdisc *sch,
2371 + q->avg_window_begin));
2372 + u64 b = q->avg_window_bytes * (u64)NSEC_PER_SEC;
2373 +
2374 +- do_div(b, window_interval);
2375 ++ b = div64_u64(b, window_interval);
2376 + q->avg_peak_bandwidth =
2377 + cake_ewma(q->avg_peak_bandwidth, b,
2378 + b > q->avg_peak_bandwidth ? 2 : 8);
2379 +diff --git a/net/sched/sch_fq.c b/net/sched/sch_fq.c
2380 +index 4808713c73b9..1ee2b77f607b 100644
2381 +--- a/net/sched/sch_fq.c
2382 ++++ b/net/sched/sch_fq.c
2383 +@@ -735,10 +735,12 @@ static int fq_change(struct Qdisc *sch, struct nlattr *opt,
2384 + if (tb[TCA_FQ_QUANTUM]) {
2385 + u32 quantum = nla_get_u32(tb[TCA_FQ_QUANTUM]);
2386 +
2387 +- if (quantum > 0)
2388 ++ if (quantum > 0 && quantum <= (1 << 20)) {
2389 + q->quantum = quantum;
2390 +- else
2391 ++ } else {
2392 ++ NL_SET_ERR_MSG_MOD(extack, "invalid quantum");
2393 + err = -EINVAL;
2394 ++ }
2395 + }
2396 +
2397 + if (tb[TCA_FQ_INITIAL_QUANTUM])
2398 +diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
2399 +index 5672abede0cc..1cbbd8c31405 100644
2400 +--- a/net/sched/sch_prio.c
2401 ++++ b/net/sched/sch_prio.c
2402 +@@ -314,8 +314,14 @@ static int prio_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
2403 + bool any_qdisc_is_offloaded;
2404 + int err;
2405 +
2406 +- if (new == NULL)
2407 +- new = &noop_qdisc;
2408 ++ if (!new) {
2409 ++ new = qdisc_create_dflt(sch->dev_queue, &pfifo_qdisc_ops,
2410 ++ TC_H_MAKE(sch->handle, arg), extack);
2411 ++ if (!new)
2412 ++ new = &noop_qdisc;
2413 ++ else
2414 ++ qdisc_hash_add(new, true);
2415 ++ }
2416 +
2417 + *old = qdisc_replace(sch, new, &q->queues[band]);
2418 +
2419 +diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
2420 +index de8a82bc6b42..0234a64b3b19 100644
2421 +--- a/net/sctp/sm_sideeffect.c
2422 ++++ b/net/sctp/sm_sideeffect.c
2423 +@@ -1373,8 +1373,10 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
2424 + /* Generate an INIT ACK chunk. */
2425 + new_obj = sctp_make_init_ack(asoc, chunk, GFP_ATOMIC,
2426 + 0);
2427 +- if (!new_obj)
2428 +- goto nomem;
2429 ++ if (!new_obj) {
2430 ++ error = -ENOMEM;
2431 ++ break;
2432 ++ }
2433 +
2434 + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
2435 + SCTP_CHUNK(new_obj));
2436 +@@ -1396,7 +1398,8 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
2437 + if (!new_obj) {
2438 + if (cmd->obj.chunk)
2439 + sctp_chunk_free(cmd->obj.chunk);
2440 +- goto nomem;
2441 ++ error = -ENOMEM;
2442 ++ break;
2443 + }
2444 + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
2445 + SCTP_CHUNK(new_obj));
2446 +@@ -1443,8 +1446,10 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
2447 +
2448 + /* Generate a SHUTDOWN chunk. */
2449 + new_obj = sctp_make_shutdown(asoc, chunk);
2450 +- if (!new_obj)
2451 +- goto nomem;
2452 ++ if (!new_obj) {
2453 ++ error = -ENOMEM;
2454 ++ break;
2455 ++ }
2456 + sctp_add_cmd_sf(commands, SCTP_CMD_REPLY,
2457 + SCTP_CHUNK(new_obj));
2458 + break;
2459 +@@ -1780,11 +1785,17 @@ static int sctp_cmd_interpreter(enum sctp_event event_type,
2460 + break;
2461 + }
2462 +
2463 +- if (error)
2464 ++ if (error) {
2465 ++ cmd = sctp_next_cmd(commands);
2466 ++ while (cmd) {
2467 ++ if (cmd->verb == SCTP_CMD_REPLY)
2468 ++ sctp_chunk_free(cmd->obj.chunk);
2469 ++ cmd = sctp_next_cmd(commands);
2470 ++ }
2471 + break;
2472 ++ }
2473 + }
2474 +
2475 +-out:
2476 + /* If this is in response to a received chunk, wait until
2477 + * we are done with the packet to open the queue so that we don't
2478 + * send multiple packets in response to a single request.
2479 +@@ -1799,7 +1810,4 @@ out:
2480 + sp->data_ready_signalled = 0;
2481 +
2482 + return error;
2483 +-nomem:
2484 +- error = -ENOMEM;
2485 +- goto out;
2486 + }
2487 +diff --git a/samples/bpf/syscall_tp_kern.c b/samples/bpf/syscall_tp_kern.c
2488 +index 9149c524d279..8833aacb9c8c 100644
2489 +--- a/samples/bpf/syscall_tp_kern.c
2490 ++++ b/samples/bpf/syscall_tp_kern.c
2491 +@@ -50,13 +50,27 @@ static __always_inline void count(void *map)
2492 + SEC("tracepoint/syscalls/sys_enter_open")
2493 + int trace_enter_open(struct syscalls_enter_open_args *ctx)
2494 + {
2495 +- count((void *)&enter_open_map);
2496 ++ count(&enter_open_map);
2497 ++ return 0;
2498 ++}
2499 ++
2500 ++SEC("tracepoint/syscalls/sys_enter_openat")
2501 ++int trace_enter_open_at(struct syscalls_enter_open_args *ctx)
2502 ++{
2503 ++ count(&enter_open_map);
2504 + return 0;
2505 + }
2506 +
2507 + SEC("tracepoint/syscalls/sys_exit_open")
2508 + int trace_enter_exit(struct syscalls_exit_open_args *ctx)
2509 + {
2510 +- count((void *)&exit_open_map);
2511 ++ count(&exit_open_map);
2512 ++ return 0;
2513 ++}
2514 ++
2515 ++SEC("tracepoint/syscalls/sys_exit_openat")
2516 ++int trace_enter_exit_at(struct syscalls_exit_open_args *ctx)
2517 ++{
2518 ++ count(&exit_open_map);
2519 + return 0;
2520 + }
2521 +diff --git a/samples/bpf/trace_event_user.c b/samples/bpf/trace_event_user.c
2522 +index d08046ab81f0..d33022447d6b 100644
2523 +--- a/samples/bpf/trace_event_user.c
2524 ++++ b/samples/bpf/trace_event_user.c
2525 +@@ -35,9 +35,9 @@ static void print_ksym(__u64 addr)
2526 + return;
2527 + sym = ksym_search(addr);
2528 + printf("%s;", sym->name);
2529 +- if (!strcmp(sym->name, "sys_read"))
2530 ++ if (!strstr(sym->name, "sys_read"))
2531 + sys_read_seen = true;
2532 +- else if (!strcmp(sym->name, "sys_write"))
2533 ++ else if (!strstr(sym->name, "sys_write"))
2534 + sys_write_seen = true;
2535 + }
2536 +
2537 +diff --git a/scripts/kconfig/expr.c b/scripts/kconfig/expr.c
2538 +index e1a39e90841d..7e38070ee523 100644
2539 +--- a/scripts/kconfig/expr.c
2540 ++++ b/scripts/kconfig/expr.c
2541 +@@ -252,6 +252,13 @@ static int expr_eq(struct expr *e1, struct expr *e2)
2542 + {
2543 + int res, old_count;
2544 +
2545 ++ /*
2546 ++ * A NULL expr is taken to be yes, but there's also a different way to
2547 ++ * represent yes. expr_is_yes() checks for either representation.
2548 ++ */
2549 ++ if (!e1 || !e2)
2550 ++ return expr_is_yes(e1) && expr_is_yes(e2);
2551 ++
2552 + if (e1->type != e2->type)
2553 + return 0;
2554 + switch (e1->type) {
2555 +diff --git a/sound/soc/codecs/max98090.c b/sound/soc/codecs/max98090.c
2556 +index c3b28b2f4b10..89b6e187ac23 100644
2557 +--- a/sound/soc/codecs/max98090.c
2558 ++++ b/sound/soc/codecs/max98090.c
2559 +@@ -2121,10 +2121,8 @@ static void max98090_pll_det_disable_work(struct work_struct *work)
2560 + M98090_IULK_MASK, 0);
2561 + }
2562 +
2563 +-static void max98090_pll_work(struct work_struct *work)
2564 ++static void max98090_pll_work(struct max98090_priv *max98090)
2565 + {
2566 +- struct max98090_priv *max98090 =
2567 +- container_of(work, struct max98090_priv, pll_work);
2568 + struct snd_soc_component *component = max98090->component;
2569 +
2570 + if (!snd_soc_component_is_active(component))
2571 +@@ -2277,7 +2275,7 @@ static irqreturn_t max98090_interrupt(int irq, void *data)
2572 +
2573 + if (active & M98090_ULK_MASK) {
2574 + dev_dbg(component->dev, "M98090_ULK_MASK\n");
2575 +- schedule_work(&max98090->pll_work);
2576 ++ max98090_pll_work(max98090);
2577 + }
2578 +
2579 + if (active & M98090_JDET_MASK) {
2580 +@@ -2440,7 +2438,6 @@ static int max98090_probe(struct snd_soc_component *component)
2581 + max98090_pll_det_enable_work);
2582 + INIT_WORK(&max98090->pll_det_disable_work,
2583 + max98090_pll_det_disable_work);
2584 +- INIT_WORK(&max98090->pll_work, max98090_pll_work);
2585 +
2586 + /* Enable jack detection */
2587 + snd_soc_component_write(component, M98090_REG_JACK_DETECT,
2588 +@@ -2493,7 +2490,6 @@ static void max98090_remove(struct snd_soc_component *component)
2589 + cancel_delayed_work_sync(&max98090->jack_work);
2590 + cancel_delayed_work_sync(&max98090->pll_det_enable_work);
2591 + cancel_work_sync(&max98090->pll_det_disable_work);
2592 +- cancel_work_sync(&max98090->pll_work);
2593 + max98090->component = NULL;
2594 + }
2595 +
2596 +diff --git a/sound/soc/codecs/max98090.h b/sound/soc/codecs/max98090.h
2597 +index b1572a2d19da..388d2f74674b 100644
2598 +--- a/sound/soc/codecs/max98090.h
2599 ++++ b/sound/soc/codecs/max98090.h
2600 +@@ -1533,7 +1533,6 @@ struct max98090_priv {
2601 + struct delayed_work jack_work;
2602 + struct delayed_work pll_det_enable_work;
2603 + struct work_struct pll_det_disable_work;
2604 +- struct work_struct pll_work;
2605 + struct snd_soc_jack *jack;
2606 + unsigned int dai_fmt;
2607 + int tdm_slots;
2608 +diff --git a/sound/soc/codecs/wm8962.c b/sound/soc/codecs/wm8962.c
2609 +index efd8910b1ff7..dde015fd70a4 100644
2610 +--- a/sound/soc/codecs/wm8962.c
2611 ++++ b/sound/soc/codecs/wm8962.c
2612 +@@ -2792,7 +2792,7 @@ static int fll_factors(struct _fll_div *fll_div, unsigned int Fref,
2613 +
2614 + if (target % Fref == 0) {
2615 + fll_div->theta = 0;
2616 +- fll_div->lambda = 0;
2617 ++ fll_div->lambda = 1;
2618 + } else {
2619 + gcd_fll = gcd(target, fratio * Fref);
2620 +
2621 +@@ -2862,7 +2862,7 @@ static int wm8962_set_fll(struct snd_soc_component *component, int fll_id, int s
2622 + return -EINVAL;
2623 + }
2624 +
2625 +- if (fll_div.theta || fll_div.lambda)
2626 ++ if (fll_div.theta)
2627 + fll1 |= WM8962_FLL_FRAC;
2628 +
2629 + /* Stop the FLL while we reconfigure */
2630 +diff --git a/sound/soc/intel/boards/bytcr_rt5640.c b/sound/soc/intel/boards/bytcr_rt5640.c
2631 +index 6acd5dd599dc..e58240e18b30 100644
2632 +--- a/sound/soc/intel/boards/bytcr_rt5640.c
2633 ++++ b/sound/soc/intel/boards/bytcr_rt5640.c
2634 +@@ -677,13 +677,17 @@ static const struct dmi_system_id byt_rt5640_quirk_table[] = {
2635 + BYT_RT5640_MCLK_EN),
2636 + },
2637 + {
2638 ++ /* Teclast X89 */
2639 + .matches = {
2640 + DMI_MATCH(DMI_BOARD_VENDOR, "TECLAST"),
2641 + DMI_MATCH(DMI_BOARD_NAME, "tPAD"),
2642 + },
2643 + .driver_data = (void *)(BYT_RT5640_IN3_MAP |
2644 +- BYT_RT5640_MCLK_EN |
2645 +- BYT_RT5640_SSP0_AIF1),
2646 ++ BYT_RT5640_JD_SRC_JD1_IN4P |
2647 ++ BYT_RT5640_OVCD_TH_2000UA |
2648 ++ BYT_RT5640_OVCD_SF_1P0 |
2649 ++ BYT_RT5640_SSP0_AIF1 |
2650 ++ BYT_RT5640_MCLK_EN),
2651 + },
2652 + { /* Toshiba Satellite Click Mini L9W-B */
2653 + .matches = {
2654 +diff --git a/sound/soc/soc-topology.c b/sound/soc/soc-topology.c
2655 +index 88a7e860b175..069f38fbf07b 100644
2656 +--- a/sound/soc/soc-topology.c
2657 ++++ b/sound/soc/soc-topology.c
2658 +@@ -1890,6 +1890,7 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg,
2659 + int count = hdr->count;
2660 + int i;
2661 + bool abi_match;
2662 ++ int ret;
2663 +
2664 + if (tplg->pass != SOC_TPLG_PASS_PCM_DAI)
2665 + return 0;
2666 +@@ -1926,7 +1927,12 @@ static int soc_tplg_pcm_elems_load(struct soc_tplg *tplg,
2667 + }
2668 +
2669 + /* create the FE DAIs and DAI links */
2670 +- soc_tplg_pcm_create(tplg, _pcm);
2671 ++ ret = soc_tplg_pcm_create(tplg, _pcm);
2672 ++ if (ret < 0) {
2673 ++ if (!abi_match)
2674 ++ kfree(_pcm);
2675 ++ return ret;
2676 ++ }
2677 +
2678 + /* offset by version-specific struct size and
2679 + * real priv data size
2680 +diff --git a/tools/lib/traceevent/Makefile b/tools/lib/traceevent/Makefile
2681 +index bca0c9e5452c..05f8a0f27121 100644
2682 +--- a/tools/lib/traceevent/Makefile
2683 ++++ b/tools/lib/traceevent/Makefile
2684 +@@ -115,6 +115,7 @@ EVENT_PARSE_VERSION = $(EP_VERSION).$(EP_PATCHLEVEL).$(EP_EXTRAVERSION)
2685 +
2686 + LIB_TARGET = libtraceevent.a libtraceevent.so.$(EVENT_PARSE_VERSION)
2687 + LIB_INSTALL = libtraceevent.a libtraceevent.so*
2688 ++LIB_INSTALL := $(addprefix $(OUTPUT),$(LIB_INSTALL))
2689 +
2690 + INCLUDES = -I. -I $(srctree)/tools/include $(CONFIG_INCLUDES)
2691 +
2692 +diff --git a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
2693 +index ce361b9d62cf..da298f191086 100644
2694 +--- a/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
2695 ++++ b/tools/testing/selftests/ftrace/test.d/kprobe/multiple_kprobes.tc
2696 +@@ -25,9 +25,9 @@ while read i; do
2697 + test $N -eq 256 && break
2698 + done
2699 +
2700 +-L=`wc -l kprobe_events`
2701 +-if [ $L -ne $N ]; then
2702 +- echo "The number of kprobes events ($L) is not $N"
2703 ++L=`cat kprobe_events | wc -l`
2704 ++if [ $L -ne 256 ]; then
2705 ++ echo "The number of kprobes events ($L) is not 256"
2706 + exit_fail
2707 + fi
2708 +