Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.4 commit in: /
Date: Wed, 22 Dec 2021 14:06:26
Message-Id: 1640181968.c267aa3e43d90cb318844229333ae06cd918a712.mpagano@gentoo
1 commit: c267aa3e43d90cb318844229333ae06cd918a712
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Wed Dec 22 14:06:08 2021 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Wed Dec 22 14:06:08 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=c267aa3e
7
8 Linux patch 5.4.168
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1167_linux-5.4.168.patch | 2322 ++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 2326 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 03c7ef31..e5039e81 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -711,6 +711,10 @@ Patch: 1166_linux-5.4.167.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.4.167
23
24 +Patch: 1167_linux-5.4.168.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.4.168
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/1167_linux-5.4.168.patch b/1167_linux-5.4.168.patch
33 new file mode 100644
34 index 00000000..529751cb
35 --- /dev/null
36 +++ b/1167_linux-5.4.168.patch
37 @@ -0,0 +1,2322 @@
38 +diff --git a/Makefile b/Makefile
39 +index 1045f7fc08503..c23f5b17d239f 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 5
45 + PATCHLEVEL = 4
46 +-SUBLEVEL = 167
47 ++SUBLEVEL = 168
48 + EXTRAVERSION =
49 + NAME = Kleptomaniac Octopus
50 +
51 +diff --git a/arch/arm/boot/dts/imx6ull-pinfunc.h b/arch/arm/boot/dts/imx6ull-pinfunc.h
52 +index eb025a9d47592..7328d4ef8559f 100644
53 +--- a/arch/arm/boot/dts/imx6ull-pinfunc.h
54 ++++ b/arch/arm/boot/dts/imx6ull-pinfunc.h
55 +@@ -82,6 +82,6 @@
56 + #define MX6ULL_PAD_CSI_DATA04__ESAI_TX_FS 0x01F4 0x0480 0x0000 0x9 0x0
57 + #define MX6ULL_PAD_CSI_DATA05__ESAI_TX_CLK 0x01F8 0x0484 0x0000 0x9 0x0
58 + #define MX6ULL_PAD_CSI_DATA06__ESAI_TX5_RX0 0x01FC 0x0488 0x0000 0x9 0x0
59 +-#define MX6ULL_PAD_CSI_DATA07__ESAI_T0 0x0200 0x048C 0x0000 0x9 0x0
60 ++#define MX6ULL_PAD_CSI_DATA07__ESAI_TX0 0x0200 0x048C 0x0000 0x9 0x0
61 +
62 + #endif /* __DTS_IMX6ULL_PINFUNC_H */
63 +diff --git a/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts b/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts
64 +index b4c0a76a4d1af..4c2fcfcc7baed 100644
65 +--- a/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts
66 ++++ b/arch/arm/boot/dts/socfpga_arria10_socdk_qspi.dts
67 +@@ -12,7 +12,7 @@
68 + flash0: n25q00@0 {
69 + #address-cells = <1>;
70 + #size-cells = <1>;
71 +- compatible = "n25q00aa";
72 ++ compatible = "micron,mt25qu02g", "jedec,spi-nor";
73 + reg = <0>;
74 + spi-max-frequency = <100000000>;
75 +
76 +diff --git a/arch/arm/boot/dts/socfpga_arria5_socdk.dts b/arch/arm/boot/dts/socfpga_arria5_socdk.dts
77 +index 90e676e7019f2..1b02d46496a85 100644
78 +--- a/arch/arm/boot/dts/socfpga_arria5_socdk.dts
79 ++++ b/arch/arm/boot/dts/socfpga_arria5_socdk.dts
80 +@@ -119,7 +119,7 @@
81 + flash: flash@0 {
82 + #address-cells = <1>;
83 + #size-cells = <1>;
84 +- compatible = "n25q256a";
85 ++ compatible = "micron,n25q256a", "jedec,spi-nor";
86 + reg = <0>;
87 + spi-max-frequency = <100000000>;
88 +
89 +diff --git a/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts b/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
90 +index 6f138b2b26163..51bb436784e24 100644
91 +--- a/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
92 ++++ b/arch/arm/boot/dts/socfpga_cyclone5_socdk.dts
93 +@@ -124,7 +124,7 @@
94 + flash0: n25q00@0 {
95 + #address-cells = <1>;
96 + #size-cells = <1>;
97 +- compatible = "n25q00";
98 ++ compatible = "micron,mt25qu02g", "jedec,spi-nor";
99 + reg = <0>; /* chip select */
100 + spi-max-frequency = <100000000>;
101 +
102 +diff --git a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
103 +index c155ff02eb6e0..cae9ddd5ed38b 100644
104 +--- a/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
105 ++++ b/arch/arm/boot/dts/socfpga_cyclone5_sockit.dts
106 +@@ -169,7 +169,7 @@
107 + flash: flash@0 {
108 + #address-cells = <1>;
109 + #size-cells = <1>;
110 +- compatible = "n25q00";
111 ++ compatible = "micron,mt25qu02g", "jedec,spi-nor";
112 + reg = <0>;
113 + spi-max-frequency = <100000000>;
114 +
115 +diff --git a/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts b/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts
116 +index 8d5d3996f6f27..ca18b959e6559 100644
117 +--- a/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts
118 ++++ b/arch/arm/boot/dts/socfpga_cyclone5_socrates.dts
119 +@@ -80,7 +80,7 @@
120 + flash: flash@0 {
121 + #address-cells = <1>;
122 + #size-cells = <1>;
123 +- compatible = "n25q256a";
124 ++ compatible = "micron,n25q256a", "jedec,spi-nor";
125 + reg = <0>;
126 + spi-max-frequency = <100000000>;
127 + m25p,fast-read;
128 +diff --git a/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts b/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts
129 +index 99a71757cdf46..3f7aa7bf0863a 100644
130 +--- a/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts
131 ++++ b/arch/arm/boot/dts/socfpga_cyclone5_sodia.dts
132 +@@ -116,7 +116,7 @@
133 + flash0: n25q512a@0 {
134 + #address-cells = <1>;
135 + #size-cells = <1>;
136 +- compatible = "n25q512a";
137 ++ compatible = "micron,n25q512a", "jedec,spi-nor";
138 + reg = <0>;
139 + spi-max-frequency = <100000000>;
140 +
141 +diff --git a/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts b/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts
142 +index a060718758b67..25874e1b9c829 100644
143 +--- a/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts
144 ++++ b/arch/arm/boot/dts/socfpga_cyclone5_vining_fpga.dts
145 +@@ -224,7 +224,7 @@
146 + n25q128@0 {
147 + #address-cells = <1>;
148 + #size-cells = <1>;
149 +- compatible = "n25q128";
150 ++ compatible = "micron,n25q128", "jedec,spi-nor";
151 + reg = <0>; /* chip select */
152 + spi-max-frequency = <100000000>;
153 + m25p,fast-read;
154 +@@ -241,7 +241,7 @@
155 + n25q00@1 {
156 + #address-cells = <1>;
157 + #size-cells = <1>;
158 +- compatible = "n25q00";
159 ++ compatible = "micron,mt25qu02g", "jedec,spi-nor";
160 + reg = <1>; /* chip select */
161 + spi-max-frequency = <100000000>;
162 + m25p,fast-read;
163 +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
164 +index e87a04477440e..292ca70c512b5 100644
165 +--- a/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
166 ++++ b/arch/arm64/boot/dts/rockchip/rk3399-khadas-edge.dtsi
167 +@@ -685,7 +685,6 @@
168 + &sdhci {
169 + bus-width = <8>;
170 + mmc-hs400-1_8v;
171 +- mmc-hs400-enhanced-strobe;
172 + non-removable;
173 + status = "okay";
174 + };
175 +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
176 +index 73be38a537960..a72e77c261ef3 100644
177 +--- a/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
178 ++++ b/arch/arm64/boot/dts/rockchip/rk3399-leez-p710.dts
179 +@@ -49,7 +49,7 @@
180 + regulator-boot-on;
181 + regulator-min-microvolt = <3300000>;
182 + regulator-max-microvolt = <3300000>;
183 +- vim-supply = <&vcc3v3_sys>;
184 ++ vin-supply = <&vcc3v3_sys>;
185 + };
186 +
187 + vcc3v3_sys: vcc3v3-sys {
188 +diff --git a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
189 +index 1ae1ebd4efdd0..da3b031d4befa 100644
190 +--- a/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
191 ++++ b/arch/arm64/boot/dts/rockchip/rk3399-rock-pi-4.dts
192 +@@ -452,7 +452,7 @@
193 + status = "okay";
194 +
195 + bt656-supply = <&vcc_3v0>;
196 +- audio-supply = <&vcc_3v0>;
197 ++ audio-supply = <&vcc1v8_codec>;
198 + sdmmc-supply = <&vcc_sdio>;
199 + gpio1830-supply = <&vcc_3v0>;
200 + };
201 +diff --git a/arch/s390/kernel/machine_kexec_file.c b/arch/s390/kernel/machine_kexec_file.c
202 +index e7435f3a3d2d2..76cd09879eaf4 100644
203 +--- a/arch/s390/kernel/machine_kexec_file.c
204 ++++ b/arch/s390/kernel/machine_kexec_file.c
205 +@@ -277,6 +277,7 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
206 + {
207 + Elf_Rela *relas;
208 + int i, r_type;
209 ++ int ret;
210 +
211 + relas = (void *)pi->ehdr + relsec->sh_offset;
212 +
213 +@@ -311,7 +312,11 @@ int arch_kexec_apply_relocations_add(struct purgatory_info *pi,
214 + addr = section->sh_addr + relas[i].r_offset;
215 +
216 + r_type = ELF64_R_TYPE(relas[i].r_info);
217 +- arch_kexec_do_relocs(r_type, loc, val, addr);
218 ++ ret = arch_kexec_do_relocs(r_type, loc, val, addr);
219 ++ if (ret) {
220 ++ pr_err("Unknown rela relocation: %d\n", r_type);
221 ++ return -ENOEXEC;
222 ++ }
223 + }
224 + return 0;
225 + }
226 +diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
227 +index 464efedc778b0..2b247014ba452 100644
228 +--- a/drivers/ata/libata-scsi.c
229 ++++ b/drivers/ata/libata-scsi.c
230 +@@ -3164,8 +3164,19 @@ static unsigned int ata_scsi_pass_thru(struct ata_queued_cmd *qc)
231 + goto invalid_fld;
232 + }
233 +
234 +- if (ata_is_ncq(tf->protocol) && (cdb[2 + cdb_offset] & 0x3) == 0)
235 +- tf->protocol = ATA_PROT_NCQ_NODATA;
236 ++ if ((cdb[2 + cdb_offset] & 0x3) == 0) {
237 ++ /*
238 ++ * When T_LENGTH is zero (No data is transferred), dir should
239 ++ * be DMA_NONE.
240 ++ */
241 ++ if (scmd->sc_data_direction != DMA_NONE) {
242 ++ fp = 2 + cdb_offset;
243 ++ goto invalid_fld;
244 ++ }
245 ++
246 ++ if (ata_is_ncq(tf->protocol))
247 ++ tf->protocol = ATA_PROT_NCQ_NODATA;
248 ++ }
249 +
250 + /* enable LBA */
251 + tf->flags |= ATA_TFLAG_LBA;
252 +diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
253 +index baf10b73675e2..774af5ce70dad 100644
254 +--- a/drivers/block/xen-blkfront.c
255 ++++ b/drivers/block/xen-blkfront.c
256 +@@ -1565,9 +1565,12 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
257 + unsigned long flags;
258 + struct blkfront_ring_info *rinfo = (struct blkfront_ring_info *)dev_id;
259 + struct blkfront_info *info = rinfo->dev_info;
260 ++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS;
261 +
262 +- if (unlikely(info->connected != BLKIF_STATE_CONNECTED))
263 ++ if (unlikely(info->connected != BLKIF_STATE_CONNECTED)) {
264 ++ xen_irq_lateeoi(irq, XEN_EOI_FLAG_SPURIOUS);
265 + return IRQ_HANDLED;
266 ++ }
267 +
268 + spin_lock_irqsave(&rinfo->ring_lock, flags);
269 + again:
270 +@@ -1583,6 +1586,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
271 + unsigned long id;
272 + unsigned int op;
273 +
274 ++ eoiflag = 0;
275 ++
276 + RING_COPY_RESPONSE(&rinfo->ring, i, &bret);
277 + id = bret.id;
278 +
279 +@@ -1698,6 +1703,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
280 +
281 + spin_unlock_irqrestore(&rinfo->ring_lock, flags);
282 +
283 ++ xen_irq_lateeoi(irq, eoiflag);
284 ++
285 + return IRQ_HANDLED;
286 +
287 + err:
288 +@@ -1705,6 +1712,8 @@ static irqreturn_t blkif_interrupt(int irq, void *dev_id)
289 +
290 + spin_unlock_irqrestore(&rinfo->ring_lock, flags);
291 +
292 ++ /* No EOI in order to avoid further interrupts. */
293 ++
294 + pr_alert("%s disabled for further use\n", info->gd->disk_name);
295 + return IRQ_HANDLED;
296 + }
297 +@@ -1744,8 +1753,8 @@ static int setup_blkring(struct xenbus_device *dev,
298 + if (err)
299 + goto fail;
300 +
301 +- err = bind_evtchn_to_irqhandler(rinfo->evtchn, blkif_interrupt, 0,
302 +- "blkif", rinfo);
303 ++ err = bind_evtchn_to_irqhandler_lateeoi(rinfo->evtchn, blkif_interrupt,
304 ++ 0, "blkif", rinfo);
305 + if (err <= 0) {
306 + xenbus_dev_fatal(dev, err,
307 + "bind_evtchn_to_irqhandler failed");
308 +diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
309 +index 6ff87cd867121..e4e1b4e94a67b 100644
310 +--- a/drivers/clk/clk.c
311 ++++ b/drivers/clk/clk.c
312 +@@ -3299,6 +3299,14 @@ static int __clk_core_init(struct clk_core *core)
313 +
314 + clk_prepare_lock();
315 +
316 ++ /*
317 ++ * Set hw->core after grabbing the prepare_lock to synchronize with
318 ++ * callers of clk_core_fill_parent_index() where we treat hw->core
319 ++ * being NULL as the clk not being registered yet. This is crucial so
320 ++ * that clks aren't parented until their parent is fully registered.
321 ++ */
322 ++ core->hw->core = core;
323 ++
324 + ret = clk_pm_runtime_get(core);
325 + if (ret)
326 + goto unlock;
327 +@@ -3452,8 +3460,10 @@ static int __clk_core_init(struct clk_core *core)
328 + out:
329 + clk_pm_runtime_put(core);
330 + unlock:
331 +- if (ret)
332 ++ if (ret) {
333 + hlist_del_init(&core->child_node);
334 ++ core->hw->core = NULL;
335 ++ }
336 +
337 + clk_prepare_unlock();
338 +
339 +@@ -3699,7 +3709,6 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw)
340 + core->num_parents = init->num_parents;
341 + core->min_rate = 0;
342 + core->max_rate = ULONG_MAX;
343 +- hw->core = core;
344 +
345 + ret = clk_core_populate_parent_map(core, init);
346 + if (ret)
347 +@@ -3717,7 +3726,7 @@ __clk_register(struct device *dev, struct device_node *np, struct clk_hw *hw)
348 + goto fail_create_clk;
349 + }
350 +
351 +- clk_core_link_consumer(hw->core, hw->clk);
352 ++ clk_core_link_consumer(core, hw->clk);
353 +
354 + ret = __clk_core_init(core);
355 + if (!ret)
356 +diff --git a/drivers/dma/st_fdma.c b/drivers/dma/st_fdma.c
357 +index 67087dbe2f9fa..f7393c19a1ba3 100644
358 +--- a/drivers/dma/st_fdma.c
359 ++++ b/drivers/dma/st_fdma.c
360 +@@ -873,4 +873,4 @@ MODULE_LICENSE("GPL v2");
361 + MODULE_DESCRIPTION("STMicroelectronics FDMA engine driver");
362 + MODULE_AUTHOR("Ludovic.barre <Ludovic.barre@××.com>");
363 + MODULE_AUTHOR("Peter Griffin <peter.griffin@××××××.org>");
364 +-MODULE_ALIAS("platform: " DRIVER_NAME);
365 ++MODULE_ALIAS("platform:" DRIVER_NAME);
366 +diff --git a/drivers/firmware/scpi_pm_domain.c b/drivers/firmware/scpi_pm_domain.c
367 +index 51201600d789b..800673910b511 100644
368 +--- a/drivers/firmware/scpi_pm_domain.c
369 ++++ b/drivers/firmware/scpi_pm_domain.c
370 +@@ -16,7 +16,6 @@ struct scpi_pm_domain {
371 + struct generic_pm_domain genpd;
372 + struct scpi_ops *ops;
373 + u32 domain;
374 +- char name[30];
375 + };
376 +
377 + /*
378 +@@ -110,8 +109,13 @@ static int scpi_pm_domain_probe(struct platform_device *pdev)
379 +
380 + scpi_pd->domain = i;
381 + scpi_pd->ops = scpi_ops;
382 +- sprintf(scpi_pd->name, "%pOFn.%d", np, i);
383 +- scpi_pd->genpd.name = scpi_pd->name;
384 ++ scpi_pd->genpd.name = devm_kasprintf(dev, GFP_KERNEL,
385 ++ "%pOFn.%d", np, i);
386 ++ if (!scpi_pd->genpd.name) {
387 ++ dev_err(dev, "Failed to allocate genpd name:%pOFn.%d\n",
388 ++ np, i);
389 ++ continue;
390 ++ }
391 + scpi_pd->genpd.power_off = scpi_pd_power_off;
392 + scpi_pd->genpd.power_on = scpi_pd_power_on;
393 +
394 +diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
395 +index 06cdc22b5501d..5906a8951a6c6 100644
396 +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
397 ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
398 +@@ -2906,8 +2906,8 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev)
399 + AMD_PG_SUPPORT_CP |
400 + AMD_PG_SUPPORT_GDS |
401 + AMD_PG_SUPPORT_RLC_SMU_HS)) {
402 +- WREG32(mmRLC_JUMP_TABLE_RESTORE,
403 +- adev->gfx.rlc.cp_table_gpu_addr >> 8);
404 ++ WREG32_SOC15(GC, 0, mmRLC_JUMP_TABLE_RESTORE,
405 ++ adev->gfx.rlc.cp_table_gpu_addr >> 8);
406 + gfx_v9_0_init_gfx_power_gating(adev);
407 + }
408 + }
409 +diff --git a/drivers/iio/adc/stm32-adc.c b/drivers/iio/adc/stm32-adc.c
410 +index 94fde39d9ff7a..d1bbd2b197fc6 100644
411 +--- a/drivers/iio/adc/stm32-adc.c
412 ++++ b/drivers/iio/adc/stm32-adc.c
413 +@@ -933,6 +933,7 @@ pwr_dwn:
414 +
415 + static void stm32h7_adc_unprepare(struct stm32_adc *adc)
416 + {
417 ++ stm32_adc_writel(adc, STM32H7_ADC_PCSEL, 0);
418 + stm32h7_adc_disable(adc);
419 + stm32h7_adc_enter_pwr_down(adc);
420 + }
421 +diff --git a/drivers/input/touchscreen/of_touchscreen.c b/drivers/input/touchscreen/of_touchscreen.c
422 +index e16ec4c7043a4..2962c3747adc3 100644
423 +--- a/drivers/input/touchscreen/of_touchscreen.c
424 ++++ b/drivers/input/touchscreen/of_touchscreen.c
425 +@@ -81,8 +81,8 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
426 + touchscreen_get_prop_u32(dev, "touchscreen-size-x",
427 + input_abs_get_max(input,
428 + axis) + 1,
429 +- &maximum) |
430 +- touchscreen_get_prop_u32(dev, "touchscreen-fuzz-x",
431 ++ &maximum);
432 ++ data_present |= touchscreen_get_prop_u32(dev, "touchscreen-fuzz-x",
433 + input_abs_get_fuzz(input, axis),
434 + &fuzz);
435 + if (data_present)
436 +@@ -95,8 +95,8 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
437 + touchscreen_get_prop_u32(dev, "touchscreen-size-y",
438 + input_abs_get_max(input,
439 + axis) + 1,
440 +- &maximum) |
441 +- touchscreen_get_prop_u32(dev, "touchscreen-fuzz-y",
442 ++ &maximum);
443 ++ data_present |= touchscreen_get_prop_u32(dev, "touchscreen-fuzz-y",
444 + input_abs_get_fuzz(input, axis),
445 + &fuzz);
446 + if (data_present)
447 +@@ -106,11 +106,11 @@ void touchscreen_parse_properties(struct input_dev *input, bool multitouch,
448 + data_present = touchscreen_get_prop_u32(dev,
449 + "touchscreen-max-pressure",
450 + input_abs_get_max(input, axis),
451 +- &maximum) |
452 +- touchscreen_get_prop_u32(dev,
453 +- "touchscreen-fuzz-pressure",
454 +- input_abs_get_fuzz(input, axis),
455 +- &fuzz);
456 ++ &maximum);
457 ++ data_present |= touchscreen_get_prop_u32(dev,
458 ++ "touchscreen-fuzz-pressure",
459 ++ input_abs_get_fuzz(input, axis),
460 ++ &fuzz);
461 + if (data_present)
462 + touchscreen_set_params(input, axis, 0, maximum, fuzz);
463 +
464 +diff --git a/drivers/md/persistent-data/dm-btree-remove.c b/drivers/md/persistent-data/dm-btree-remove.c
465 +index 9e4d1212f4c16..63f2baed3c8a6 100644
466 +--- a/drivers/md/persistent-data/dm-btree-remove.c
467 ++++ b/drivers/md/persistent-data/dm-btree-remove.c
468 +@@ -423,9 +423,9 @@ static int rebalance_children(struct shadow_spine *s,
469 +
470 + memcpy(n, dm_block_data(child),
471 + dm_bm_block_size(dm_tm_get_bm(info->tm)));
472 +- dm_tm_unlock(info->tm, child);
473 +
474 + dm_tm_dec(info->tm, dm_block_location(child));
475 ++ dm_tm_unlock(info->tm, child);
476 + return 0;
477 + }
478 +
479 +diff --git a/drivers/media/usb/dvb-usb-v2/mxl111sf.c b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
480 +index 55b4ae7037a4e..5fbce81b64c77 100644
481 +--- a/drivers/media/usb/dvb-usb-v2/mxl111sf.c
482 ++++ b/drivers/media/usb/dvb-usb-v2/mxl111sf.c
483 +@@ -931,8 +931,6 @@ static int mxl111sf_init(struct dvb_usb_device *d)
484 + .len = sizeof(eeprom), .buf = eeprom },
485 + };
486 +
487 +- mutex_init(&state->msg_lock);
488 +-
489 + ret = get_chip_info(state);
490 + if (mxl_fail(ret))
491 + pr_err("failed to get chip info during probe");
492 +@@ -1074,6 +1072,14 @@ static int mxl111sf_get_stream_config_dvbt(struct dvb_frontend *fe,
493 + return 0;
494 + }
495 +
496 ++static int mxl111sf_probe(struct dvb_usb_device *dev)
497 ++{
498 ++ struct mxl111sf_state *state = d_to_priv(dev);
499 ++
500 ++ mutex_init(&state->msg_lock);
501 ++ return 0;
502 ++}
503 ++
504 + static struct dvb_usb_device_properties mxl111sf_props_dvbt = {
505 + .driver_name = KBUILD_MODNAME,
506 + .owner = THIS_MODULE,
507 +@@ -1083,6 +1089,7 @@ static struct dvb_usb_device_properties mxl111sf_props_dvbt = {
508 + .generic_bulk_ctrl_endpoint = 0x02,
509 + .generic_bulk_ctrl_endpoint_response = 0x81,
510 +
511 ++ .probe = mxl111sf_probe,
512 + .i2c_algo = &mxl111sf_i2c_algo,
513 + .frontend_attach = mxl111sf_frontend_attach_dvbt,
514 + .tuner_attach = mxl111sf_attach_tuner,
515 +@@ -1124,6 +1131,7 @@ static struct dvb_usb_device_properties mxl111sf_props_atsc = {
516 + .generic_bulk_ctrl_endpoint = 0x02,
517 + .generic_bulk_ctrl_endpoint_response = 0x81,
518 +
519 ++ .probe = mxl111sf_probe,
520 + .i2c_algo = &mxl111sf_i2c_algo,
521 + .frontend_attach = mxl111sf_frontend_attach_atsc,
522 + .tuner_attach = mxl111sf_attach_tuner,
523 +@@ -1165,6 +1173,7 @@ static struct dvb_usb_device_properties mxl111sf_props_mh = {
524 + .generic_bulk_ctrl_endpoint = 0x02,
525 + .generic_bulk_ctrl_endpoint_response = 0x81,
526 +
527 ++ .probe = mxl111sf_probe,
528 + .i2c_algo = &mxl111sf_i2c_algo,
529 + .frontend_attach = mxl111sf_frontend_attach_mh,
530 + .tuner_attach = mxl111sf_attach_tuner,
531 +@@ -1233,6 +1242,7 @@ static struct dvb_usb_device_properties mxl111sf_props_atsc_mh = {
532 + .generic_bulk_ctrl_endpoint = 0x02,
533 + .generic_bulk_ctrl_endpoint_response = 0x81,
534 +
535 ++ .probe = mxl111sf_probe,
536 + .i2c_algo = &mxl111sf_i2c_algo,
537 + .frontend_attach = mxl111sf_frontend_attach_atsc_mh,
538 + .tuner_attach = mxl111sf_attach_tuner,
539 +@@ -1311,6 +1321,7 @@ static struct dvb_usb_device_properties mxl111sf_props_mercury = {
540 + .generic_bulk_ctrl_endpoint = 0x02,
541 + .generic_bulk_ctrl_endpoint_response = 0x81,
542 +
543 ++ .probe = mxl111sf_probe,
544 + .i2c_algo = &mxl111sf_i2c_algo,
545 + .frontend_attach = mxl111sf_frontend_attach_mercury,
546 + .tuner_attach = mxl111sf_attach_tuner,
547 +@@ -1381,6 +1392,7 @@ static struct dvb_usb_device_properties mxl111sf_props_mercury_mh = {
548 + .generic_bulk_ctrl_endpoint = 0x02,
549 + .generic_bulk_ctrl_endpoint_response = 0x81,
550 +
551 ++ .probe = mxl111sf_probe,
552 + .i2c_algo = &mxl111sf_i2c_algo,
553 + .frontend_attach = mxl111sf_frontend_attach_mercury_mh,
554 + .tuner_attach = mxl111sf_attach_tuner,
555 +diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
556 +index 470d12e308814..5a2094a281e15 100644
557 +--- a/drivers/net/ethernet/broadcom/bcmsysport.c
558 ++++ b/drivers/net/ethernet/broadcom/bcmsysport.c
559 +@@ -1277,11 +1277,11 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
560 + struct bcm_sysport_priv *priv = netdev_priv(dev);
561 + struct device *kdev = &priv->pdev->dev;
562 + struct bcm_sysport_tx_ring *ring;
563 ++ unsigned long flags, desc_flags;
564 + struct bcm_sysport_cb *cb;
565 + struct netdev_queue *txq;
566 + u32 len_status, addr_lo;
567 + unsigned int skb_len;
568 +- unsigned long flags;
569 + dma_addr_t mapping;
570 + u16 queue;
571 + int ret;
572 +@@ -1339,8 +1339,10 @@ static netdev_tx_t bcm_sysport_xmit(struct sk_buff *skb,
573 + ring->desc_count--;
574 +
575 + /* Ports are latched, so write upper address first */
576 ++ spin_lock_irqsave(&priv->desc_lock, desc_flags);
577 + tdma_writel(priv, len_status, TDMA_WRITE_PORT_HI(ring->index));
578 + tdma_writel(priv, addr_lo, TDMA_WRITE_PORT_LO(ring->index));
579 ++ spin_unlock_irqrestore(&priv->desc_lock, desc_flags);
580 +
581 + /* Check ring space and update SW control flow */
582 + if (ring->desc_count == 0)
583 +@@ -1970,6 +1972,7 @@ static int bcm_sysport_open(struct net_device *dev)
584 + }
585 +
586 + /* Initialize both hardware and software ring */
587 ++ spin_lock_init(&priv->desc_lock);
588 + for (i = 0; i < dev->num_tx_queues; i++) {
589 + ret = bcm_sysport_init_tx_ring(priv, i);
590 + if (ret) {
591 +diff --git a/drivers/net/ethernet/broadcom/bcmsysport.h b/drivers/net/ethernet/broadcom/bcmsysport.h
592 +index 6d80735fbc7f4..57336ca3f4277 100644
593 +--- a/drivers/net/ethernet/broadcom/bcmsysport.h
594 ++++ b/drivers/net/ethernet/broadcom/bcmsysport.h
595 +@@ -742,6 +742,7 @@ struct bcm_sysport_priv {
596 + int wol_irq;
597 +
598 + /* Transmit rings */
599 ++ spinlock_t desc_lock;
600 + struct bcm_sysport_tx_ring *tx_rings;
601 +
602 + /* Receive queue */
603 +diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
604 +index c11244a9b7e69..3df25b231ab5c 100644
605 +--- a/drivers/net/ethernet/intel/igb/igb_main.c
606 ++++ b/drivers/net/ethernet/intel/igb/igb_main.c
607 +@@ -7374,6 +7374,20 @@ static int igb_set_vf_mac_filter(struct igb_adapter *adapter, const int vf,
608 + struct vf_mac_filter *entry = NULL;
609 + int ret = 0;
610 +
611 ++ if ((vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) &&
612 ++ !vf_data->trusted) {
613 ++ dev_warn(&pdev->dev,
614 ++ "VF %d requested MAC filter but is administratively denied\n",
615 ++ vf);
616 ++ return -EINVAL;
617 ++ }
618 ++ if (!is_valid_ether_addr(addr)) {
619 ++ dev_warn(&pdev->dev,
620 ++ "VF %d attempted to set invalid MAC filter\n",
621 ++ vf);
622 ++ return -EINVAL;
623 ++ }
624 ++
625 + switch (info) {
626 + case E1000_VF_MAC_FILTER_CLR:
627 + /* remove all unicast MAC filters related to the current VF */
628 +@@ -7387,20 +7401,6 @@ static int igb_set_vf_mac_filter(struct igb_adapter *adapter, const int vf,
629 + }
630 + break;
631 + case E1000_VF_MAC_FILTER_ADD:
632 +- if ((vf_data->flags & IGB_VF_FLAG_PF_SET_MAC) &&
633 +- !vf_data->trusted) {
634 +- dev_warn(&pdev->dev,
635 +- "VF %d requested MAC filter but is administratively denied\n",
636 +- vf);
637 +- return -EINVAL;
638 +- }
639 +- if (!is_valid_ether_addr(addr)) {
640 +- dev_warn(&pdev->dev,
641 +- "VF %d attempted to set invalid MAC filter\n",
642 +- vf);
643 +- return -EINVAL;
644 +- }
645 +-
646 + /* try to find empty slot in the list */
647 + list_for_each(pos, &adapter->vf_macs.l) {
648 + entry = list_entry(pos, struct vf_mac_filter, l);
649 +diff --git a/drivers/net/ethernet/intel/igbvf/netdev.c b/drivers/net/ethernet/intel/igbvf/netdev.c
650 +index 77cb2ab7dab40..1082e49ea0560 100644
651 +--- a/drivers/net/ethernet/intel/igbvf/netdev.c
652 ++++ b/drivers/net/ethernet/intel/igbvf/netdev.c
653 +@@ -2887,6 +2887,7 @@ static int igbvf_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
654 + return 0;
655 +
656 + err_hw_init:
657 ++ netif_napi_del(&adapter->rx_ring->napi);
658 + kfree(adapter->tx_ring);
659 + kfree(adapter->rx_ring);
660 + err_sw_init:
661 +diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
662 +index 9c42f741ed5ef..74728c0a44a81 100644
663 +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
664 ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c
665 +@@ -3405,6 +3405,9 @@ static s32 ixgbe_reset_hw_X550em(struct ixgbe_hw *hw)
666 + /* flush pending Tx transactions */
667 + ixgbe_clear_tx_pending(hw);
668 +
669 ++ /* set MDIO speed before talking to the PHY in case it's the 1st time */
670 ++ ixgbe_set_mdio_speed(hw);
671 ++
672 + /* PHY ops must be identified and initialized prior to reset */
673 + status = hw->phy.ops.init(hw);
674 + if (status == IXGBE_ERR_SFP_NOT_SUPPORTED ||
675 +diff --git a/drivers/net/netdevsim/bpf.c b/drivers/net/netdevsim/bpf.c
676 +index 2b74425822ab1..e0a4acc6144bf 100644
677 +--- a/drivers/net/netdevsim/bpf.c
678 ++++ b/drivers/net/netdevsim/bpf.c
679 +@@ -510,6 +510,7 @@ nsim_bpf_map_alloc(struct netdevsim *ns, struct bpf_offloaded_map *offmap)
680 + goto err_free;
681 + key = nmap->entry[i].key;
682 + *key = i;
683 ++ memset(nmap->entry[i].value, 0, offmap->map.value_size);
684 + }
685 + }
686 +
687 +diff --git a/drivers/net/wireless/marvell/mwifiex/cmdevt.c b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
688 +index e8788c35a453d..ec04515bd9dfa 100644
689 +--- a/drivers/net/wireless/marvell/mwifiex/cmdevt.c
690 ++++ b/drivers/net/wireless/marvell/mwifiex/cmdevt.c
691 +@@ -322,9 +322,9 @@ static int mwifiex_dnld_sleep_confirm_cmd(struct mwifiex_adapter *adapter)
692 +
693 + adapter->seq_num++;
694 + sleep_cfm_buf->seq_num =
695 +- cpu_to_le16((HostCmd_SET_SEQ_NO_BSS_INFO
696 ++ cpu_to_le16(HostCmd_SET_SEQ_NO_BSS_INFO
697 + (adapter->seq_num, priv->bss_num,
698 +- priv->bss_type)));
699 ++ priv->bss_type));
700 +
701 + mwifiex_dbg(adapter, CMD,
702 + "cmd: DNLD_CMD: %#x, act %#x, len %d, seqno %#x\n",
703 +diff --git a/drivers/net/wireless/marvell/mwifiex/fw.h b/drivers/net/wireless/marvell/mwifiex/fw.h
704 +index 8b9d0809daf62..076ea1c4b921d 100644
705 +--- a/drivers/net/wireless/marvell/mwifiex/fw.h
706 ++++ b/drivers/net/wireless/marvell/mwifiex/fw.h
707 +@@ -512,10 +512,10 @@ enum mwifiex_channel_flags {
708 +
709 + #define RF_ANTENNA_AUTO 0xFFFF
710 +
711 +-#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) { \
712 +- (((seq) & 0x00ff) | \
713 +- (((num) & 0x000f) << 8)) | \
714 +- (((type) & 0x000f) << 12); }
715 ++#define HostCmd_SET_SEQ_NO_BSS_INFO(seq, num, type) \
716 ++ ((((seq) & 0x00ff) | \
717 ++ (((num) & 0x000f) << 8)) | \
718 ++ (((type) & 0x000f) << 12))
719 +
720 + #define HostCmd_GET_SEQ_NO(seq) \
721 + ((seq) & HostCmd_SEQ_NUM_MASK)
722 +diff --git a/drivers/net/xen-netback/common.h b/drivers/net/xen-netback/common.h
723 +index 32fe131ba366d..f7e746f1c9fb3 100644
724 +--- a/drivers/net/xen-netback/common.h
725 ++++ b/drivers/net/xen-netback/common.h
726 +@@ -203,6 +203,7 @@ struct xenvif_queue { /* Per-queue data for xenvif */
727 + unsigned int rx_queue_max;
728 + unsigned int rx_queue_len;
729 + unsigned long last_rx_time;
730 ++ unsigned int rx_slots_needed;
731 + bool stalled;
732 +
733 + struct xenvif_copy_state rx_copy;
734 +diff --git a/drivers/net/xen-netback/rx.c b/drivers/net/xen-netback/rx.c
735 +index 48e2006f96ce6..7f68067c01745 100644
736 +--- a/drivers/net/xen-netback/rx.c
737 ++++ b/drivers/net/xen-netback/rx.c
738 +@@ -33,28 +33,36 @@
739 + #include <xen/xen.h>
740 + #include <xen/events.h>
741 +
742 +-static bool xenvif_rx_ring_slots_available(struct xenvif_queue *queue)
743 ++/*
744 ++ * Update the needed ring page slots for the first SKB queued.
745 ++ * Note that any call sequence outside the RX thread calling this function
746 ++ * needs to wake up the RX thread via a call of xenvif_kick_thread()
747 ++ * afterwards in order to avoid a race with putting the thread to sleep.
748 ++ */
749 ++static void xenvif_update_needed_slots(struct xenvif_queue *queue,
750 ++ const struct sk_buff *skb)
751 + {
752 +- RING_IDX prod, cons;
753 +- struct sk_buff *skb;
754 +- int needed;
755 +- unsigned long flags;
756 +-
757 +- spin_lock_irqsave(&queue->rx_queue.lock, flags);
758 ++ unsigned int needed = 0;
759 +
760 +- skb = skb_peek(&queue->rx_queue);
761 +- if (!skb) {
762 +- spin_unlock_irqrestore(&queue->rx_queue.lock, flags);
763 +- return false;
764 ++ if (skb) {
765 ++ needed = DIV_ROUND_UP(skb->len, XEN_PAGE_SIZE);
766 ++ if (skb_is_gso(skb))
767 ++ needed++;
768 ++ if (skb->sw_hash)
769 ++ needed++;
770 + }
771 +
772 +- needed = DIV_ROUND_UP(skb->len, XEN_PAGE_SIZE);
773 +- if (skb_is_gso(skb))
774 +- needed++;
775 +- if (skb->sw_hash)
776 +- needed++;
777 ++ WRITE_ONCE(queue->rx_slots_needed, needed);
778 ++}
779 +
780 +- spin_unlock_irqrestore(&queue->rx_queue.lock, flags);
781 ++static bool xenvif_rx_ring_slots_available(struct xenvif_queue *queue)
782 ++{
783 ++ RING_IDX prod, cons;
784 ++ unsigned int needed;
785 ++
786 ++ needed = READ_ONCE(queue->rx_slots_needed);
787 ++ if (!needed)
788 ++ return false;
789 +
790 + do {
791 + prod = queue->rx.sring->req_prod;
792 +@@ -80,13 +88,19 @@ void xenvif_rx_queue_tail(struct xenvif_queue *queue, struct sk_buff *skb)
793 +
794 + spin_lock_irqsave(&queue->rx_queue.lock, flags);
795 +
796 +- __skb_queue_tail(&queue->rx_queue, skb);
797 +-
798 +- queue->rx_queue_len += skb->len;
799 +- if (queue->rx_queue_len > queue->rx_queue_max) {
800 ++ if (queue->rx_queue_len >= queue->rx_queue_max) {
801 + struct net_device *dev = queue->vif->dev;
802 +
803 + netif_tx_stop_queue(netdev_get_tx_queue(dev, queue->id));
804 ++ kfree_skb(skb);
805 ++ queue->vif->dev->stats.rx_dropped++;
806 ++ } else {
807 ++ if (skb_queue_empty(&queue->rx_queue))
808 ++ xenvif_update_needed_slots(queue, skb);
809 ++
810 ++ __skb_queue_tail(&queue->rx_queue, skb);
811 ++
812 ++ queue->rx_queue_len += skb->len;
813 + }
814 +
815 + spin_unlock_irqrestore(&queue->rx_queue.lock, flags);
816 +@@ -100,6 +114,8 @@ static struct sk_buff *xenvif_rx_dequeue(struct xenvif_queue *queue)
817 +
818 + skb = __skb_dequeue(&queue->rx_queue);
819 + if (skb) {
820 ++ xenvif_update_needed_slots(queue, skb_peek(&queue->rx_queue));
821 ++
822 + queue->rx_queue_len -= skb->len;
823 + if (queue->rx_queue_len < queue->rx_queue_max) {
824 + struct netdev_queue *txq;
825 +@@ -134,6 +150,7 @@ static void xenvif_rx_queue_drop_expired(struct xenvif_queue *queue)
826 + break;
827 + xenvif_rx_dequeue(queue);
828 + kfree_skb(skb);
829 ++ queue->vif->dev->stats.rx_dropped++;
830 + }
831 + }
832 +
833 +@@ -474,27 +491,31 @@ void xenvif_rx_action(struct xenvif_queue *queue)
834 + xenvif_rx_copy_flush(queue);
835 + }
836 +
837 +-static bool xenvif_rx_queue_stalled(struct xenvif_queue *queue)
838 ++static RING_IDX xenvif_rx_queue_slots(const struct xenvif_queue *queue)
839 + {
840 + RING_IDX prod, cons;
841 +
842 + prod = queue->rx.sring->req_prod;
843 + cons = queue->rx.req_cons;
844 +
845 ++ return prod - cons;
846 ++}
847 ++
848 ++static bool xenvif_rx_queue_stalled(const struct xenvif_queue *queue)
849 ++{
850 ++ unsigned int needed = READ_ONCE(queue->rx_slots_needed);
851 ++
852 + return !queue->stalled &&
853 +- prod - cons < 1 &&
854 ++ xenvif_rx_queue_slots(queue) < needed &&
855 + time_after(jiffies,
856 + queue->last_rx_time + queue->vif->stall_timeout);
857 + }
858 +
859 + static bool xenvif_rx_queue_ready(struct xenvif_queue *queue)
860 + {
861 +- RING_IDX prod, cons;
862 +-
863 +- prod = queue->rx.sring->req_prod;
864 +- cons = queue->rx.req_cons;
865 ++ unsigned int needed = READ_ONCE(queue->rx_slots_needed);
866 +
867 +- return queue->stalled && prod - cons >= 1;
868 ++ return queue->stalled && xenvif_rx_queue_slots(queue) >= needed;
869 + }
870 +
871 + bool xenvif_have_rx_work(struct xenvif_queue *queue, bool test_kthread)
872 +diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
873 +index d6f44343213cc..d2b3381f71825 100644
874 +--- a/drivers/net/xen-netfront.c
875 ++++ b/drivers/net/xen-netfront.c
876 +@@ -142,6 +142,9 @@ struct netfront_queue {
877 + struct sk_buff *rx_skbs[NET_RX_RING_SIZE];
878 + grant_ref_t gref_rx_head;
879 + grant_ref_t grant_rx_ref[NET_RX_RING_SIZE];
880 ++
881 ++ unsigned int rx_rsp_unconsumed;
882 ++ spinlock_t rx_cons_lock;
883 + };
884 +
885 + struct netfront_info {
886 +@@ -364,12 +367,13 @@ static int xennet_open(struct net_device *dev)
887 + return 0;
888 + }
889 +
890 +-static void xennet_tx_buf_gc(struct netfront_queue *queue)
891 ++static bool xennet_tx_buf_gc(struct netfront_queue *queue)
892 + {
893 + RING_IDX cons, prod;
894 + unsigned short id;
895 + struct sk_buff *skb;
896 + bool more_to_do;
897 ++ bool work_done = false;
898 + const struct device *dev = &queue->info->netdev->dev;
899 +
900 + BUG_ON(!netif_carrier_ok(queue->info->netdev));
901 +@@ -386,6 +390,8 @@ static void xennet_tx_buf_gc(struct netfront_queue *queue)
902 + for (cons = queue->tx.rsp_cons; cons != prod; cons++) {
903 + struct xen_netif_tx_response txrsp;
904 +
905 ++ work_done = true;
906 ++
907 + RING_COPY_RESPONSE(&queue->tx, cons, &txrsp);
908 + if (txrsp.status == XEN_NETIF_RSP_NULL)
909 + continue;
910 +@@ -429,11 +435,13 @@ static void xennet_tx_buf_gc(struct netfront_queue *queue)
911 +
912 + xennet_maybe_wake_tx(queue);
913 +
914 +- return;
915 ++ return work_done;
916 +
917 + err:
918 + queue->info->broken = true;
919 + dev_alert(dev, "Disabled for further use\n");
920 ++
921 ++ return work_done;
922 + }
923 +
924 + struct xennet_gnttab_make_txreq {
925 +@@ -753,6 +761,16 @@ static int xennet_close(struct net_device *dev)
926 + return 0;
927 + }
928 +
929 ++static void xennet_set_rx_rsp_cons(struct netfront_queue *queue, RING_IDX val)
930 ++{
931 ++ unsigned long flags;
932 ++
933 ++ spin_lock_irqsave(&queue->rx_cons_lock, flags);
934 ++ queue->rx.rsp_cons = val;
935 ++ queue->rx_rsp_unconsumed = RING_HAS_UNCONSUMED_RESPONSES(&queue->rx);
936 ++ spin_unlock_irqrestore(&queue->rx_cons_lock, flags);
937 ++}
938 ++
939 + static void xennet_move_rx_slot(struct netfront_queue *queue, struct sk_buff *skb,
940 + grant_ref_t ref)
941 + {
942 +@@ -804,7 +822,7 @@ static int xennet_get_extras(struct netfront_queue *queue,
943 + xennet_move_rx_slot(queue, skb, ref);
944 + } while (extra.flags & XEN_NETIF_EXTRA_FLAG_MORE);
945 +
946 +- queue->rx.rsp_cons = cons;
947 ++ xennet_set_rx_rsp_cons(queue, cons);
948 + return err;
949 + }
950 +
951 +@@ -884,7 +902,7 @@ next:
952 + }
953 +
954 + if (unlikely(err))
955 +- queue->rx.rsp_cons = cons + slots;
956 ++ xennet_set_rx_rsp_cons(queue, cons + slots);
957 +
958 + return err;
959 + }
960 +@@ -938,7 +956,8 @@ static int xennet_fill_frags(struct netfront_queue *queue,
961 + __pskb_pull_tail(skb, pull_to - skb_headlen(skb));
962 + }
963 + if (unlikely(skb_shinfo(skb)->nr_frags >= MAX_SKB_FRAGS)) {
964 +- queue->rx.rsp_cons = ++cons + skb_queue_len(list);
965 ++ xennet_set_rx_rsp_cons(queue,
966 ++ ++cons + skb_queue_len(list));
967 + kfree_skb(nskb);
968 + return -ENOENT;
969 + }
970 +@@ -951,7 +970,7 @@ static int xennet_fill_frags(struct netfront_queue *queue,
971 + kfree_skb(nskb);
972 + }
973 +
974 +- queue->rx.rsp_cons = cons;
975 ++ xennet_set_rx_rsp_cons(queue, cons);
976 +
977 + return 0;
978 + }
979 +@@ -1072,7 +1091,9 @@ err:
980 +
981 + if (unlikely(xennet_set_skb_gso(skb, gso))) {
982 + __skb_queue_head(&tmpq, skb);
983 +- queue->rx.rsp_cons += skb_queue_len(&tmpq);
984 ++ xennet_set_rx_rsp_cons(queue,
985 ++ queue->rx.rsp_cons +
986 ++ skb_queue_len(&tmpq));
987 + goto err;
988 + }
989 + }
990 +@@ -1096,7 +1117,8 @@ err:
991 +
992 + __skb_queue_tail(&rxq, skb);
993 +
994 +- i = ++queue->rx.rsp_cons;
995 ++ i = queue->rx.rsp_cons + 1;
996 ++ xennet_set_rx_rsp_cons(queue, i);
997 + work_done++;
998 + }
999 +
1000 +@@ -1258,40 +1280,79 @@ static int xennet_set_features(struct net_device *dev,
1001 + return 0;
1002 + }
1003 +
1004 +-static irqreturn_t xennet_tx_interrupt(int irq, void *dev_id)
1005 ++static bool xennet_handle_tx(struct netfront_queue *queue, unsigned int *eoi)
1006 + {
1007 +- struct netfront_queue *queue = dev_id;
1008 + unsigned long flags;
1009 +
1010 +- if (queue->info->broken)
1011 +- return IRQ_HANDLED;
1012 ++ if (unlikely(queue->info->broken))
1013 ++ return false;
1014 +
1015 + spin_lock_irqsave(&queue->tx_lock, flags);
1016 +- xennet_tx_buf_gc(queue);
1017 ++ if (xennet_tx_buf_gc(queue))
1018 ++ *eoi = 0;
1019 + spin_unlock_irqrestore(&queue->tx_lock, flags);
1020 +
1021 ++ return true;
1022 ++}
1023 ++
1024 ++static irqreturn_t xennet_tx_interrupt(int irq, void *dev_id)
1025 ++{
1026 ++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS;
1027 ++
1028 ++ if (likely(xennet_handle_tx(dev_id, &eoiflag)))
1029 ++ xen_irq_lateeoi(irq, eoiflag);
1030 ++
1031 + return IRQ_HANDLED;
1032 + }
1033 +
1034 +-static irqreturn_t xennet_rx_interrupt(int irq, void *dev_id)
1035 ++static bool xennet_handle_rx(struct netfront_queue *queue, unsigned int *eoi)
1036 + {
1037 +- struct netfront_queue *queue = dev_id;
1038 +- struct net_device *dev = queue->info->netdev;
1039 ++ unsigned int work_queued;
1040 ++ unsigned long flags;
1041 +
1042 +- if (queue->info->broken)
1043 +- return IRQ_HANDLED;
1044 ++ if (unlikely(queue->info->broken))
1045 ++ return false;
1046 ++
1047 ++ spin_lock_irqsave(&queue->rx_cons_lock, flags);
1048 ++ work_queued = RING_HAS_UNCONSUMED_RESPONSES(&queue->rx);
1049 ++ if (work_queued > queue->rx_rsp_unconsumed) {
1050 ++ queue->rx_rsp_unconsumed = work_queued;
1051 ++ *eoi = 0;
1052 ++ } else if (unlikely(work_queued < queue->rx_rsp_unconsumed)) {
1053 ++ const struct device *dev = &queue->info->netdev->dev;
1054 ++
1055 ++ spin_unlock_irqrestore(&queue->rx_cons_lock, flags);
1056 ++ dev_alert(dev, "RX producer index going backwards\n");
1057 ++ dev_alert(dev, "Disabled for further use\n");
1058 ++ queue->info->broken = true;
1059 ++ return false;
1060 ++ }
1061 ++ spin_unlock_irqrestore(&queue->rx_cons_lock, flags);
1062 +
1063 +- if (likely(netif_carrier_ok(dev) &&
1064 +- RING_HAS_UNCONSUMED_RESPONSES(&queue->rx)))
1065 ++ if (likely(netif_carrier_ok(queue->info->netdev) && work_queued))
1066 + napi_schedule(&queue->napi);
1067 +
1068 ++ return true;
1069 ++}
1070 ++
1071 ++static irqreturn_t xennet_rx_interrupt(int irq, void *dev_id)
1072 ++{
1073 ++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS;
1074 ++
1075 ++ if (likely(xennet_handle_rx(dev_id, &eoiflag)))
1076 ++ xen_irq_lateeoi(irq, eoiflag);
1077 ++
1078 + return IRQ_HANDLED;
1079 + }
1080 +
1081 + static irqreturn_t xennet_interrupt(int irq, void *dev_id)
1082 + {
1083 +- xennet_tx_interrupt(irq, dev_id);
1084 +- xennet_rx_interrupt(irq, dev_id);
1085 ++ unsigned int eoiflag = XEN_EOI_FLAG_SPURIOUS;
1086 ++
1087 ++ if (xennet_handle_tx(dev_id, &eoiflag) &&
1088 ++ xennet_handle_rx(dev_id, &eoiflag))
1089 ++ xen_irq_lateeoi(irq, eoiflag);
1090 ++
1091 + return IRQ_HANDLED;
1092 + }
1093 +
1094 +@@ -1525,9 +1586,10 @@ static int setup_netfront_single(struct netfront_queue *queue)
1095 + if (err < 0)
1096 + goto fail;
1097 +
1098 +- err = bind_evtchn_to_irqhandler(queue->tx_evtchn,
1099 +- xennet_interrupt,
1100 +- 0, queue->info->netdev->name, queue);
1101 ++ err = bind_evtchn_to_irqhandler_lateeoi(queue->tx_evtchn,
1102 ++ xennet_interrupt, 0,
1103 ++ queue->info->netdev->name,
1104 ++ queue);
1105 + if (err < 0)
1106 + goto bind_fail;
1107 + queue->rx_evtchn = queue->tx_evtchn;
1108 +@@ -1555,18 +1617,18 @@ static int setup_netfront_split(struct netfront_queue *queue)
1109 +
1110 + snprintf(queue->tx_irq_name, sizeof(queue->tx_irq_name),
1111 + "%s-tx", queue->name);
1112 +- err = bind_evtchn_to_irqhandler(queue->tx_evtchn,
1113 +- xennet_tx_interrupt,
1114 +- 0, queue->tx_irq_name, queue);
1115 ++ err = bind_evtchn_to_irqhandler_lateeoi(queue->tx_evtchn,
1116 ++ xennet_tx_interrupt, 0,
1117 ++ queue->tx_irq_name, queue);
1118 + if (err < 0)
1119 + goto bind_tx_fail;
1120 + queue->tx_irq = err;
1121 +
1122 + snprintf(queue->rx_irq_name, sizeof(queue->rx_irq_name),
1123 + "%s-rx", queue->name);
1124 +- err = bind_evtchn_to_irqhandler(queue->rx_evtchn,
1125 +- xennet_rx_interrupt,
1126 +- 0, queue->rx_irq_name, queue);
1127 ++ err = bind_evtchn_to_irqhandler_lateeoi(queue->rx_evtchn,
1128 ++ xennet_rx_interrupt, 0,
1129 ++ queue->rx_irq_name, queue);
1130 + if (err < 0)
1131 + goto bind_rx_fail;
1132 + queue->rx_irq = err;
1133 +@@ -1668,6 +1730,7 @@ static int xennet_init_queue(struct netfront_queue *queue)
1134 +
1135 + spin_lock_init(&queue->tx_lock);
1136 + spin_lock_init(&queue->rx_lock);
1137 ++ spin_lock_init(&queue->rx_cons_lock);
1138 +
1139 + timer_setup(&queue->rx_refill_timer, rx_refill_timeout, 0);
1140 +
1141 +diff --git a/drivers/pci/msi.c b/drivers/pci/msi.c
1142 +index d0cc6c0d74d6b..7dc10c2b4785d 100644
1143 +--- a/drivers/pci/msi.c
1144 ++++ b/drivers/pci/msi.c
1145 +@@ -827,9 +827,6 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
1146 + goto out_disable;
1147 + }
1148 +
1149 +- /* Ensure that all table entries are masked. */
1150 +- msix_mask_all(base, tsize);
1151 +-
1152 + ret = msix_setup_entries(dev, base, entries, nvec, affd);
1153 + if (ret)
1154 + goto out_disable;
1155 +@@ -852,6 +849,16 @@ static int msix_capability_init(struct pci_dev *dev, struct msix_entry *entries,
1156 + /* Set MSI-X enabled bits and unmask the function */
1157 + pci_intx_for_msi(dev, 0);
1158 + dev->msix_enabled = 1;
1159 ++
1160 ++ /*
1161 ++ * Ensure that all table entries are masked to prevent
1162 ++ * stale entries from firing in a crash kernel.
1163 ++ *
1164 ++ * Done late to deal with a broken Marvell NVME device
1165 ++ * which takes the MSI-X mask bits into account even
1166 ++ * when MSI-X is disabled, which prevents MSI delivery.
1167 ++ */
1168 ++ msix_mask_all(base, tsize);
1169 + pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL, 0);
1170 +
1171 + pcibios_free_irq(dev);
1172 +@@ -878,7 +885,7 @@ out_free:
1173 + free_msi_irqs(dev);
1174 +
1175 + out_disable:
1176 +- pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_ENABLE, 0);
1177 ++ pci_msix_clear_and_set_ctrl(dev, PCI_MSIX_FLAGS_MASKALL | PCI_MSIX_FLAGS_ENABLE, 0);
1178 +
1179 + return ret;
1180 + }
1181 +diff --git a/drivers/scsi/scsi_debug.c b/drivers/scsi/scsi_debug.c
1182 +index 44181a2cbf18d..408166bd20f33 100644
1183 +--- a/drivers/scsi/scsi_debug.c
1184 ++++ b/drivers/scsi/scsi_debug.c
1185 +@@ -2296,11 +2296,11 @@ static int resp_mode_select(struct scsi_cmnd *scp,
1186 + __func__, param_len, res);
1187 + md_len = mselect6 ? (arr[0] + 1) : (get_unaligned_be16(arr + 0) + 2);
1188 + bd_len = mselect6 ? arr[3] : get_unaligned_be16(arr + 6);
1189 +- if (md_len > 2) {
1190 ++ off = bd_len + (mselect6 ? 4 : 8);
1191 ++ if (md_len > 2 || off >= res) {
1192 + mk_sense_invalid_fld(scp, SDEB_IN_DATA, 0, -1);
1193 + return check_condition_result;
1194 + }
1195 +- off = bd_len + (mselect6 ? 4 : 8);
1196 + mpage = arr[off] & 0x3f;
1197 + ps = !!(arr[off] & 0x80);
1198 + if (ps) {
1199 +diff --git a/drivers/soc/tegra/fuse/fuse-tegra.c b/drivers/soc/tegra/fuse/fuse-tegra.c
1200 +index 3eb44e65b3261..1a54bac512b69 100644
1201 +--- a/drivers/soc/tegra/fuse/fuse-tegra.c
1202 ++++ b/drivers/soc/tegra/fuse/fuse-tegra.c
1203 +@@ -172,7 +172,7 @@ static struct platform_driver tegra_fuse_driver = {
1204 + };
1205 + builtin_platform_driver(tegra_fuse_driver);
1206 +
1207 +-bool __init tegra_fuse_read_spare(unsigned int spare)
1208 ++u32 __init tegra_fuse_read_spare(unsigned int spare)
1209 + {
1210 + unsigned int offset = fuse->soc->info->spare + spare * 4;
1211 +
1212 +diff --git a/drivers/soc/tegra/fuse/fuse.h b/drivers/soc/tegra/fuse/fuse.h
1213 +index 7230cb3305033..6996cfc7cbca3 100644
1214 +--- a/drivers/soc/tegra/fuse/fuse.h
1215 ++++ b/drivers/soc/tegra/fuse/fuse.h
1216 +@@ -53,7 +53,7 @@ struct tegra_fuse {
1217 + void tegra_init_revision(void);
1218 + void tegra_init_apbmisc(void);
1219 +
1220 +-bool __init tegra_fuse_read_spare(unsigned int spare);
1221 ++u32 __init tegra_fuse_read_spare(unsigned int spare);
1222 + u32 __init tegra_fuse_read_early(unsigned int offset);
1223 +
1224 + #ifdef CONFIG_ARCH_TEGRA_2x_SOC
1225 +diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
1226 +index 15da02aeee948..2d2d04c071401 100644
1227 +--- a/drivers/tty/hvc/hvc_xen.c
1228 ++++ b/drivers/tty/hvc/hvc_xen.c
1229 +@@ -37,6 +37,8 @@ struct xencons_info {
1230 + struct xenbus_device *xbdev;
1231 + struct xencons_interface *intf;
1232 + unsigned int evtchn;
1233 ++ XENCONS_RING_IDX out_cons;
1234 ++ unsigned int out_cons_same;
1235 + struct hvc_struct *hvc;
1236 + int irq;
1237 + int vtermno;
1238 +@@ -138,6 +140,8 @@ static int domU_read_console(uint32_t vtermno, char *buf, int len)
1239 + XENCONS_RING_IDX cons, prod;
1240 + int recv = 0;
1241 + struct xencons_info *xencons = vtermno_to_xencons(vtermno);
1242 ++ unsigned int eoiflag = 0;
1243 ++
1244 + if (xencons == NULL)
1245 + return -EINVAL;
1246 + intf = xencons->intf;
1247 +@@ -157,7 +161,27 @@ static int domU_read_console(uint32_t vtermno, char *buf, int len)
1248 + mb(); /* read ring before consuming */
1249 + intf->in_cons = cons;
1250 +
1251 +- notify_daemon(xencons);
1252 ++ /*
1253 ++ * When to mark interrupt having been spurious:
1254 ++ * - there was no new data to be read, and
1255 ++ * - the backend did not consume some output bytes, and
1256 ++ * - the previous round with no read data didn't see consumed bytes
1257 ++ * (we might have a race with an interrupt being in flight while
1258 ++ * updating xencons->out_cons, so account for that by allowing one
1259 ++ * round without any visible reason)
1260 ++ */
1261 ++ if (intf->out_cons != xencons->out_cons) {
1262 ++ xencons->out_cons = intf->out_cons;
1263 ++ xencons->out_cons_same = 0;
1264 ++ }
1265 ++ if (recv) {
1266 ++ notify_daemon(xencons);
1267 ++ } else if (xencons->out_cons_same++ > 1) {
1268 ++ eoiflag = XEN_EOI_FLAG_SPURIOUS;
1269 ++ }
1270 ++
1271 ++ xen_irq_lateeoi(xencons->irq, eoiflag);
1272 ++
1273 + return recv;
1274 + }
1275 +
1276 +@@ -386,7 +410,7 @@ static int xencons_connect_backend(struct xenbus_device *dev,
1277 + if (ret)
1278 + return ret;
1279 + info->evtchn = evtchn;
1280 +- irq = bind_evtchn_to_irq(evtchn);
1281 ++ irq = bind_interdomain_evtchn_to_irq_lateeoi(dev->otherend_id, evtchn);
1282 + if (irq < 0)
1283 + return irq;
1284 + info->irq = irq;
1285 +@@ -550,7 +574,7 @@ static int __init xen_hvc_init(void)
1286 + return r;
1287 +
1288 + info = vtermno_to_xencons(HVC_COOKIE);
1289 +- info->irq = bind_evtchn_to_irq(info->evtchn);
1290 ++ info->irq = bind_evtchn_to_irq_lateeoi(info->evtchn);
1291 + }
1292 + if (info->irq < 0)
1293 + info->irq = 0; /* NO_IRQ */
1294 +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
1295 +index e170c5b4d6f0c..a118c44c70e1e 100644
1296 +--- a/drivers/usb/core/quirks.c
1297 ++++ b/drivers/usb/core/quirks.c
1298 +@@ -435,6 +435,9 @@ static const struct usb_device_id usb_quirk_list[] = {
1299 + { USB_DEVICE(0x1532, 0x0116), .driver_info =
1300 + USB_QUIRK_LINEAR_UFRAME_INTR_BINTERVAL },
1301 +
1302 ++ /* Lenovo USB-C to Ethernet Adapter RTL8153-04 */
1303 ++ { USB_DEVICE(0x17ef, 0x720c), .driver_info = USB_QUIRK_NO_LPM },
1304 ++
1305 + /* Lenovo Powered USB-C Travel Hub (4X90S92381, RTL8153 GigE) */
1306 + { USB_DEVICE(0x17ef, 0x721e), .driver_info = USB_QUIRK_NO_LPM },
1307 +
1308 +diff --git a/drivers/usb/gadget/composite.c b/drivers/usb/gadget/composite.c
1309 +index d2980e30f3417..c5acf5c39fb18 100644
1310 +--- a/drivers/usb/gadget/composite.c
1311 ++++ b/drivers/usb/gadget/composite.c
1312 +@@ -1649,14 +1649,14 @@ composite_setup(struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1313 + u8 endp;
1314 +
1315 + if (w_length > USB_COMP_EP0_BUFSIZ) {
1316 +- if (ctrl->bRequestType == USB_DIR_OUT) {
1317 +- goto done;
1318 +- } else {
1319 ++ if (ctrl->bRequestType & USB_DIR_IN) {
1320 + /* Cast away the const, we are going to overwrite on purpose. */
1321 + __le16 *temp = (__le16 *)&ctrl->wLength;
1322 +
1323 + *temp = cpu_to_le16(USB_COMP_EP0_BUFSIZ);
1324 + w_length = USB_COMP_EP0_BUFSIZ;
1325 ++ } else {
1326 ++ goto done;
1327 + }
1328 + }
1329 +
1330 +diff --git a/drivers/usb/gadget/legacy/dbgp.c b/drivers/usb/gadget/legacy/dbgp.c
1331 +index 355bc7dab9d5f..6bcbad3825802 100644
1332 +--- a/drivers/usb/gadget/legacy/dbgp.c
1333 ++++ b/drivers/usb/gadget/legacy/dbgp.c
1334 +@@ -346,14 +346,14 @@ static int dbgp_setup(struct usb_gadget *gadget,
1335 + u16 len = 0;
1336 +
1337 + if (length > DBGP_REQ_LEN) {
1338 +- if (ctrl->bRequestType == USB_DIR_OUT) {
1339 +- return err;
1340 +- } else {
1341 ++ if (ctrl->bRequestType & USB_DIR_IN) {
1342 + /* Cast away the const, we are going to overwrite on purpose. */
1343 + __le16 *temp = (__le16 *)&ctrl->wLength;
1344 +
1345 + *temp = cpu_to_le16(DBGP_REQ_LEN);
1346 + length = DBGP_REQ_LEN;
1347 ++ } else {
1348 ++ return err;
1349 + }
1350 + }
1351 +
1352 +diff --git a/drivers/usb/gadget/legacy/inode.c b/drivers/usb/gadget/legacy/inode.c
1353 +index f0aff79f544c3..5f1e15172403e 100644
1354 +--- a/drivers/usb/gadget/legacy/inode.c
1355 ++++ b/drivers/usb/gadget/legacy/inode.c
1356 +@@ -1336,14 +1336,14 @@ gadgetfs_setup (struct usb_gadget *gadget, const struct usb_ctrlrequest *ctrl)
1357 + u16 w_length = le16_to_cpu(ctrl->wLength);
1358 +
1359 + if (w_length > RBUF_SIZE) {
1360 +- if (ctrl->bRequestType == USB_DIR_OUT) {
1361 +- return value;
1362 +- } else {
1363 ++ if (ctrl->bRequestType & USB_DIR_IN) {
1364 + /* Cast away the const, we are going to overwrite on purpose. */
1365 + __le16 *temp = (__le16 *)&ctrl->wLength;
1366 +
1367 + *temp = cpu_to_le16(RBUF_SIZE);
1368 + w_length = RBUF_SIZE;
1369 ++ } else {
1370 ++ return value;
1371 + }
1372 + }
1373 +
1374 +diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
1375 +index beee3543950fe..ded05c39e4d1c 100644
1376 +--- a/drivers/usb/host/xhci-pci.c
1377 ++++ b/drivers/usb/host/xhci-pci.c
1378 +@@ -65,6 +65,8 @@
1379 + #define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_4 0x161e
1380 + #define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_5 0x15d6
1381 + #define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_6 0x15d7
1382 ++#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_7 0x161c
1383 ++#define PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_8 0x161f
1384 +
1385 + #define PCI_DEVICE_ID_ASMEDIA_1042_XHCI 0x1042
1386 + #define PCI_DEVICE_ID_ASMEDIA_1042A_XHCI 0x1142
1387 +@@ -303,7 +305,9 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
1388 + pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_3 ||
1389 + pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_4 ||
1390 + pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_5 ||
1391 +- pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_6))
1392 ++ pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_6 ||
1393 ++ pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_7 ||
1394 ++ pdev->device == PCI_DEVICE_ID_AMD_YELLOW_CARP_XHCI_8))
1395 + xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
1396 +
1397 + if (xhci->quirks & XHCI_RESET_ON_RESUME)
1398 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
1399 +index 004b6598706b1..50f289b124d0d 100644
1400 +--- a/drivers/usb/serial/cp210x.c
1401 ++++ b/drivers/usb/serial/cp210x.c
1402 +@@ -1552,6 +1552,8 @@ static int cp2105_gpioconf_init(struct usb_serial *serial)
1403 +
1404 + /* 2 banks of GPIO - One for the pins taken from each serial port */
1405 + if (intf_num == 0) {
1406 ++ priv->gc.ngpio = 2;
1407 ++
1408 + if (mode.eci == CP210X_PIN_MODE_MODEM) {
1409 + /* mark all GPIOs of this interface as reserved */
1410 + priv->gpio_altfunc = 0xff;
1411 +@@ -1562,8 +1564,9 @@ static int cp2105_gpioconf_init(struct usb_serial *serial)
1412 + priv->gpio_pushpull = (u8)((le16_to_cpu(config.gpio_mode) &
1413 + CP210X_ECI_GPIO_MODE_MASK) >>
1414 + CP210X_ECI_GPIO_MODE_OFFSET);
1415 +- priv->gc.ngpio = 2;
1416 + } else if (intf_num == 1) {
1417 ++ priv->gc.ngpio = 3;
1418 ++
1419 + if (mode.sci == CP210X_PIN_MODE_MODEM) {
1420 + /* mark all GPIOs of this interface as reserved */
1421 + priv->gpio_altfunc = 0xff;
1422 +@@ -1574,7 +1577,6 @@ static int cp2105_gpioconf_init(struct usb_serial *serial)
1423 + priv->gpio_pushpull = (u8)((le16_to_cpu(config.gpio_mode) &
1424 + CP210X_SCI_GPIO_MODE_MASK) >>
1425 + CP210X_SCI_GPIO_MODE_OFFSET);
1426 +- priv->gc.ngpio = 3;
1427 + } else {
1428 + return -ENODEV;
1429 + }
1430 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1431 +index 74203ed5479fa..2397d83434931 100644
1432 +--- a/drivers/usb/serial/option.c
1433 ++++ b/drivers/usb/serial/option.c
1434 +@@ -1219,6 +1219,14 @@ static const struct usb_device_id option_ids[] = {
1435 + .driver_info = NCTRL(2) | RSVD(3) },
1436 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1063, 0xff), /* Telit LN920 (ECM) */
1437 + .driver_info = NCTRL(0) | RSVD(1) },
1438 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1070, 0xff), /* Telit FN990 (rmnet) */
1439 ++ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
1440 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1071, 0xff), /* Telit FN990 (MBIM) */
1441 ++ .driver_info = NCTRL(0) | RSVD(1) },
1442 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1072, 0xff), /* Telit FN990 (RNDIS) */
1443 ++ .driver_info = NCTRL(2) | RSVD(3) },
1444 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1073, 0xff), /* Telit FN990 (ECM) */
1445 ++ .driver_info = NCTRL(0) | RSVD(1) },
1446 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
1447 + .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
1448 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
1449 +diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c
1450 +index e442d400dbb2e..deb72fd7ec504 100644
1451 +--- a/drivers/virtio/virtio_ring.c
1452 ++++ b/drivers/virtio/virtio_ring.c
1453 +@@ -263,7 +263,7 @@ size_t virtio_max_dma_size(struct virtio_device *vdev)
1454 + size_t max_segment_size = SIZE_MAX;
1455 +
1456 + if (vring_use_dma_api(vdev))
1457 +- max_segment_size = dma_max_mapping_size(&vdev->dev);
1458 ++ max_segment_size = dma_max_mapping_size(vdev->dev.parent);
1459 +
1460 + return max_segment_size;
1461 + }
1462 +diff --git a/fs/fuse/dir.c b/fs/fuse/dir.c
1463 +index 60378f3baaae1..34487bf1d7914 100644
1464 +--- a/fs/fuse/dir.c
1465 ++++ b/fs/fuse/dir.c
1466 +@@ -1032,7 +1032,7 @@ int fuse_reverse_inval_entry(struct super_block *sb, u64 parent_nodeid,
1467 + if (!parent)
1468 + return -ENOENT;
1469 +
1470 +- inode_lock(parent);
1471 ++ inode_lock_nested(parent, I_MUTEX_PARENT);
1472 + if (!S_ISDIR(parent->i_mode))
1473 + goto unlock;
1474 +
1475 +diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
1476 +index 3283cc2a4e42c..a48fcd4180c74 100644
1477 +--- a/fs/nfsd/nfs4state.c
1478 ++++ b/fs/nfsd/nfs4state.c
1479 +@@ -1041,6 +1041,11 @@ hash_delegation_locked(struct nfs4_delegation *dp, struct nfs4_file *fp)
1480 + return 0;
1481 + }
1482 +
1483 ++static bool delegation_hashed(struct nfs4_delegation *dp)
1484 ++{
1485 ++ return !(list_empty(&dp->dl_perfile));
1486 ++}
1487 ++
1488 + static bool
1489 + unhash_delegation_locked(struct nfs4_delegation *dp)
1490 + {
1491 +@@ -1048,7 +1053,7 @@ unhash_delegation_locked(struct nfs4_delegation *dp)
1492 +
1493 + lockdep_assert_held(&state_lock);
1494 +
1495 +- if (list_empty(&dp->dl_perfile))
1496 ++ if (!delegation_hashed(dp))
1497 + return false;
1498 +
1499 + dp->dl_stid.sc_type = NFS4_CLOSED_DELEG_STID;
1500 +@@ -4406,7 +4411,7 @@ static void nfsd4_cb_recall_prepare(struct nfsd4_callback *cb)
1501 + * queued for a lease break. Don't queue it again.
1502 + */
1503 + spin_lock(&state_lock);
1504 +- if (dp->dl_time == 0) {
1505 ++ if (delegation_hashed(dp) && dp->dl_time == 0) {
1506 + dp->dl_time = get_seconds();
1507 + list_add_tail(&dp->dl_recall_lru, &nn->del_recall_lru);
1508 + }
1509 +diff --git a/fs/overlayfs/dir.c b/fs/overlayfs/dir.c
1510 +index 876de87f604cd..8c89eaea1583d 100644
1511 +--- a/fs/overlayfs/dir.c
1512 ++++ b/fs/overlayfs/dir.c
1513 +@@ -113,8 +113,7 @@ kill_whiteout:
1514 + goto out;
1515 + }
1516 +
1517 +-static int ovl_mkdir_real(struct inode *dir, struct dentry **newdentry,
1518 +- umode_t mode)
1519 ++int ovl_mkdir_real(struct inode *dir, struct dentry **newdentry, umode_t mode)
1520 + {
1521 + int err;
1522 + struct dentry *d, *dentry = *newdentry;
1523 +diff --git a/fs/overlayfs/overlayfs.h b/fs/overlayfs/overlayfs.h
1524 +index 6934bcf030f0b..a8e9da5f01eb5 100644
1525 +--- a/fs/overlayfs/overlayfs.h
1526 ++++ b/fs/overlayfs/overlayfs.h
1527 +@@ -409,6 +409,7 @@ struct ovl_cattr {
1528 +
1529 + #define OVL_CATTR(m) (&(struct ovl_cattr) { .mode = (m) })
1530 +
1531 ++int ovl_mkdir_real(struct inode *dir, struct dentry **newdentry, umode_t mode);
1532 + struct dentry *ovl_create_real(struct inode *dir, struct dentry *newdentry,
1533 + struct ovl_cattr *attr);
1534 + int ovl_cleanup(struct inode *dir, struct dentry *dentry);
1535 +diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
1536 +index f036d7544d4a6..f5cf0938f298d 100644
1537 +--- a/fs/overlayfs/super.c
1538 ++++ b/fs/overlayfs/super.c
1539 +@@ -650,10 +650,14 @@ retry:
1540 + goto retry;
1541 + }
1542 +
1543 +- work = ovl_create_real(dir, work, OVL_CATTR(attr.ia_mode));
1544 +- err = PTR_ERR(work);
1545 +- if (IS_ERR(work))
1546 +- goto out_err;
1547 ++ err = ovl_mkdir_real(dir, &work, attr.ia_mode);
1548 ++ if (err)
1549 ++ goto out_dput;
1550 ++
1551 ++ /* Weird filesystem returning with hashed negative (kernfs)? */
1552 ++ err = -EINVAL;
1553 ++ if (d_really_is_negative(work))
1554 ++ goto out_dput;
1555 +
1556 + /*
1557 + * Try to remove POSIX ACL xattrs from workdir. We are good if:
1558 +diff --git a/include/net/tc_act/tc_tunnel_key.h b/include/net/tc_act/tc_tunnel_key.h
1559 +index 0689d9bcdf841..f6a0f09ccc5f9 100644
1560 +--- a/include/net/tc_act/tc_tunnel_key.h
1561 ++++ b/include/net/tc_act/tc_tunnel_key.h
1562 +@@ -52,7 +52,10 @@ static inline struct ip_tunnel_info *tcf_tunnel_info(const struct tc_action *a)
1563 + {
1564 + #ifdef CONFIG_NET_CLS_ACT
1565 + struct tcf_tunnel_key *t = to_tunnel_key(a);
1566 +- struct tcf_tunnel_key_params *params = rtnl_dereference(t->params);
1567 ++ struct tcf_tunnel_key_params *params;
1568 ++
1569 ++ params = rcu_dereference_protected(t->params,
1570 ++ lockdep_is_held(&a->tcfa_lock));
1571 +
1572 + return &params->tcft_enc_metadata->u.tun_info;
1573 + #else
1574 +@@ -69,7 +72,7 @@ tcf_tunnel_info_copy(const struct tc_action *a)
1575 + if (tun) {
1576 + size_t tun_size = sizeof(*tun) + tun->options_len;
1577 + struct ip_tunnel_info *tun_copy = kmemdup(tun, tun_size,
1578 +- GFP_KERNEL);
1579 ++ GFP_ATOMIC);
1580 +
1581 + return tun_copy;
1582 + }
1583 +diff --git a/kernel/audit.c b/kernel/audit.c
1584 +index 05ae208ad4423..d67fce9e3f8b8 100644
1585 +--- a/kernel/audit.c
1586 ++++ b/kernel/audit.c
1587 +@@ -712,7 +712,7 @@ static int kauditd_send_queue(struct sock *sk, u32 portid,
1588 + {
1589 + int rc = 0;
1590 + struct sk_buff *skb;
1591 +- static unsigned int failed = 0;
1592 ++ unsigned int failed = 0;
1593 +
1594 + /* NOTE: kauditd_thread takes care of all our locking, we just use
1595 + * the netlink info passed to us (e.g. sk and portid) */
1596 +@@ -729,32 +729,30 @@ static int kauditd_send_queue(struct sock *sk, u32 portid,
1597 + continue;
1598 + }
1599 +
1600 ++retry:
1601 + /* grab an extra skb reference in case of error */
1602 + skb_get(skb);
1603 + rc = netlink_unicast(sk, skb, portid, 0);
1604 + if (rc < 0) {
1605 +- /* fatal failure for our queue flush attempt? */
1606 ++ /* send failed - try a few times unless fatal error */
1607 + if (++failed >= retry_limit ||
1608 + rc == -ECONNREFUSED || rc == -EPERM) {
1609 +- /* yes - error processing for the queue */
1610 + sk = NULL;
1611 + if (err_hook)
1612 + (*err_hook)(skb);
1613 +- if (!skb_hook)
1614 +- goto out;
1615 +- /* keep processing with the skb_hook */
1616 ++ if (rc == -EAGAIN)
1617 ++ rc = 0;
1618 ++ /* continue to drain the queue */
1619 + continue;
1620 + } else
1621 +- /* no - requeue to preserve ordering */
1622 +- skb_queue_head(queue, skb);
1623 ++ goto retry;
1624 + } else {
1625 +- /* it worked - drop the extra reference and continue */
1626 ++ /* skb sent - drop the extra reference and continue */
1627 + consume_skb(skb);
1628 + failed = 0;
1629 + }
1630 + }
1631 +
1632 +-out:
1633 + return (rc >= 0 ? 0 : rc);
1634 + }
1635 +
1636 +@@ -1557,7 +1555,8 @@ static int __net_init audit_net_init(struct net *net)
1637 + audit_panic("cannot initialize netlink socket in namespace");
1638 + return -ENOMEM;
1639 + }
1640 +- aunet->sk->sk_sndtimeo = MAX_SCHEDULE_TIMEOUT;
1641 ++ /* limit the timeout in case auditd is blocked/stopped */
1642 ++ aunet->sk->sk_sndtimeo = HZ / 10;
1643 +
1644 + return 0;
1645 + }
1646 +diff --git a/kernel/rcu/tree.c b/kernel/rcu/tree.c
1647 +index 11ae2747701b5..7777c35e0a171 100644
1648 +--- a/kernel/rcu/tree.c
1649 ++++ b/kernel/rcu/tree.c
1650 +@@ -1602,7 +1602,7 @@ static void rcu_gp_fqs(bool first_time)
1651 + struct rcu_node *rnp = rcu_get_root();
1652 +
1653 + WRITE_ONCE(rcu_state.gp_activity, jiffies);
1654 +- rcu_state.n_force_qs++;
1655 ++ WRITE_ONCE(rcu_state.n_force_qs, rcu_state.n_force_qs + 1);
1656 + if (first_time) {
1657 + /* Collect dyntick-idle snapshots. */
1658 + force_qs_rnp(dyntick_save_progress_counter);
1659 +@@ -2207,7 +2207,7 @@ static void rcu_do_batch(struct rcu_data *rdp)
1660 + /* Reset ->qlen_last_fqs_check trigger if enough CBs have drained. */
1661 + if (count == 0 && rdp->qlen_last_fqs_check != 0) {
1662 + rdp->qlen_last_fqs_check = 0;
1663 +- rdp->n_force_qs_snap = rcu_state.n_force_qs;
1664 ++ rdp->n_force_qs_snap = READ_ONCE(rcu_state.n_force_qs);
1665 + } else if (count < rdp->qlen_last_fqs_check - qhimark)
1666 + rdp->qlen_last_fqs_check = count;
1667 +
1668 +@@ -2535,10 +2535,10 @@ static void __call_rcu_core(struct rcu_data *rdp, struct rcu_head *head,
1669 + } else {
1670 + /* Give the grace period a kick. */
1671 + rdp->blimit = DEFAULT_MAX_RCU_BLIMIT;
1672 +- if (rcu_state.n_force_qs == rdp->n_force_qs_snap &&
1673 ++ if (READ_ONCE(rcu_state.n_force_qs) == rdp->n_force_qs_snap &&
1674 + rcu_segcblist_first_pend_cb(&rdp->cblist) != head)
1675 + rcu_force_quiescent_state();
1676 +- rdp->n_force_qs_snap = rcu_state.n_force_qs;
1677 ++ rdp->n_force_qs_snap = READ_ONCE(rcu_state.n_force_qs);
1678 + rdp->qlen_last_fqs_check = rcu_segcblist_n_cbs(&rdp->cblist);
1679 + }
1680 + }
1681 +@@ -3029,7 +3029,7 @@ int rcutree_prepare_cpu(unsigned int cpu)
1682 + /* Set up local state, ensuring consistent view of global state. */
1683 + raw_spin_lock_irqsave_rcu_node(rnp, flags);
1684 + rdp->qlen_last_fqs_check = 0;
1685 +- rdp->n_force_qs_snap = rcu_state.n_force_qs;
1686 ++ rdp->n_force_qs_snap = READ_ONCE(rcu_state.n_force_qs);
1687 + rdp->blimit = blimit;
1688 + if (rcu_segcblist_empty(&rdp->cblist) && /* No early-boot CBs? */
1689 + !rcu_segcblist_is_offloaded(&rdp->cblist))
1690 +diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
1691 +index 4fc2af4367a7b..36ed8bad3909e 100644
1692 +--- a/kernel/time/timekeeping.c
1693 ++++ b/kernel/time/timekeeping.c
1694 +@@ -1236,8 +1236,7 @@ int do_settimeofday64(const struct timespec64 *ts)
1695 + timekeeping_forward_now(tk);
1696 +
1697 + xt = tk_xtime(tk);
1698 +- ts_delta.tv_sec = ts->tv_sec - xt.tv_sec;
1699 +- ts_delta.tv_nsec = ts->tv_nsec - xt.tv_nsec;
1700 ++ ts_delta = timespec64_sub(*ts, xt);
1701 +
1702 + if (timespec64_compare(&tk->wall_to_monotonic, &ts_delta) > 0) {
1703 + ret = -EINVAL;
1704 +diff --git a/net/core/skbuff.c b/net/core/skbuff.c
1705 +index 7dba091bc8617..ac083685214e0 100644
1706 +--- a/net/core/skbuff.c
1707 ++++ b/net/core/skbuff.c
1708 +@@ -768,7 +768,7 @@ void skb_dump(const char *level, const struct sk_buff *skb, bool full_pkt)
1709 + ntohs(skb->protocol), skb->pkt_type, skb->skb_iif);
1710 +
1711 + if (dev)
1712 +- printk("%sdev name=%s feat=0x%pNF\n",
1713 ++ printk("%sdev name=%s feat=%pNF\n",
1714 + level, dev->name, &dev->features);
1715 + if (sk)
1716 + printk("%ssk family=%hu type=%u proto=%u\n",
1717 +diff --git a/net/ipv4/inet_diag.c b/net/ipv4/inet_diag.c
1718 +index 4f71aca156662..f8f79672cc5f3 100644
1719 +--- a/net/ipv4/inet_diag.c
1720 ++++ b/net/ipv4/inet_diag.c
1721 +@@ -200,6 +200,7 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
1722 + r->idiag_state = sk->sk_state;
1723 + r->idiag_timer = 0;
1724 + r->idiag_retrans = 0;
1725 ++ r->idiag_expires = 0;
1726 +
1727 + if (inet_diag_msg_attrs_fill(sk, skb, r, ext, user_ns, net_admin))
1728 + goto errout;
1729 +@@ -240,20 +241,17 @@ int inet_sk_diag_fill(struct sock *sk, struct inet_connection_sock *icsk,
1730 + r->idiag_timer = 1;
1731 + r->idiag_retrans = icsk->icsk_retransmits;
1732 + r->idiag_expires =
1733 +- jiffies_to_msecs(icsk->icsk_timeout - jiffies);
1734 ++ jiffies_delta_to_msecs(icsk->icsk_timeout - jiffies);
1735 + } else if (icsk->icsk_pending == ICSK_TIME_PROBE0) {
1736 + r->idiag_timer = 4;
1737 + r->idiag_retrans = icsk->icsk_probes_out;
1738 + r->idiag_expires =
1739 +- jiffies_to_msecs(icsk->icsk_timeout - jiffies);
1740 ++ jiffies_delta_to_msecs(icsk->icsk_timeout - jiffies);
1741 + } else if (timer_pending(&sk->sk_timer)) {
1742 + r->idiag_timer = 2;
1743 + r->idiag_retrans = icsk->icsk_probes_out;
1744 + r->idiag_expires =
1745 +- jiffies_to_msecs(sk->sk_timer.expires - jiffies);
1746 +- } else {
1747 +- r->idiag_timer = 0;
1748 +- r->idiag_expires = 0;
1749 ++ jiffies_delta_to_msecs(sk->sk_timer.expires - jiffies);
1750 + }
1751 +
1752 + if ((ext & (1 << (INET_DIAG_INFO - 1))) && handler->idiag_info_size) {
1753 +@@ -338,16 +336,13 @@ static int inet_twsk_diag_fill(struct sock *sk,
1754 + r = nlmsg_data(nlh);
1755 + BUG_ON(tw->tw_state != TCP_TIME_WAIT);
1756 +
1757 +- tmo = tw->tw_timer.expires - jiffies;
1758 +- if (tmo < 0)
1759 +- tmo = 0;
1760 +-
1761 + inet_diag_msg_common_fill(r, sk);
1762 + r->idiag_retrans = 0;
1763 +
1764 + r->idiag_state = tw->tw_substate;
1765 + r->idiag_timer = 3;
1766 +- r->idiag_expires = jiffies_to_msecs(tmo);
1767 ++ tmo = tw->tw_timer.expires - jiffies;
1768 ++ r->idiag_expires = jiffies_delta_to_msecs(tmo);
1769 + r->idiag_rqueue = 0;
1770 + r->idiag_wqueue = 0;
1771 + r->idiag_uid = 0;
1772 +@@ -381,7 +376,7 @@ static int inet_req_diag_fill(struct sock *sk, struct sk_buff *skb,
1773 + offsetof(struct sock, sk_cookie));
1774 +
1775 + tmo = inet_reqsk(sk)->rsk_timer.expires - jiffies;
1776 +- r->idiag_expires = (tmo >= 0) ? jiffies_to_msecs(tmo) : 0;
1777 ++ r->idiag_expires = jiffies_delta_to_msecs(tmo);
1778 + r->idiag_rqueue = 0;
1779 + r->idiag_wqueue = 0;
1780 + r->idiag_uid = 0;
1781 +diff --git a/net/ipv6/sit.c b/net/ipv6/sit.c
1782 +index 7f9cae4c49e7e..16e75a996b749 100644
1783 +--- a/net/ipv6/sit.c
1784 ++++ b/net/ipv6/sit.c
1785 +@@ -1876,7 +1876,6 @@ static int __net_init sit_init_net(struct net *net)
1786 + return 0;
1787 +
1788 + err_reg_dev:
1789 +- ipip6_dev_free(sitn->fb_tunnel_dev);
1790 + free_netdev(sitn->fb_tunnel_dev);
1791 + err_alloc_dev:
1792 + return err;
1793 +diff --git a/net/mac80211/agg-rx.c b/net/mac80211/agg-rx.c
1794 +index 4d1c335e06e57..49ec9bfb6c8e6 100644
1795 +--- a/net/mac80211/agg-rx.c
1796 ++++ b/net/mac80211/agg-rx.c
1797 +@@ -9,7 +9,7 @@
1798 + * Copyright 2007, Michael Wu <flamingice@××××××××.net>
1799 + * Copyright 2007-2010, Intel Corporation
1800 + * Copyright(c) 2015-2017 Intel Deutschland GmbH
1801 +- * Copyright (C) 2018 Intel Corporation
1802 ++ * Copyright (C) 2018-2021 Intel Corporation
1803 + */
1804 +
1805 + /**
1806 +@@ -191,7 +191,8 @@ static void ieee80211_add_addbaext(struct ieee80211_sub_if_data *sdata,
1807 + sband = ieee80211_get_sband(sdata);
1808 + if (!sband)
1809 + return;
1810 +- he_cap = ieee80211_get_he_iftype_cap(sband, sdata->vif.type);
1811 ++ he_cap = ieee80211_get_he_iftype_cap(sband,
1812 ++ ieee80211_vif_type_p2p(&sdata->vif));
1813 + if (!he_cap)
1814 + return;
1815 +
1816 +@@ -292,7 +293,8 @@ void ___ieee80211_start_rx_ba_session(struct sta_info *sta,
1817 + goto end;
1818 + }
1819 +
1820 +- if (!sta->sta.ht_cap.ht_supported) {
1821 ++ if (!sta->sta.ht_cap.ht_supported &&
1822 ++ sta->sdata->vif.bss_conf.chandef.chan->band != NL80211_BAND_6GHZ) {
1823 + ht_dbg(sta->sdata,
1824 + "STA %pM erroneously requests BA session on tid %d w/o QoS\n",
1825 + sta->sta.addr, tid);
1826 +diff --git a/net/mac80211/agg-tx.c b/net/mac80211/agg-tx.c
1827 +index b11883d268759..f140c2b94b2c6 100644
1828 +--- a/net/mac80211/agg-tx.c
1829 ++++ b/net/mac80211/agg-tx.c
1830 +@@ -9,7 +9,7 @@
1831 + * Copyright 2007, Michael Wu <flamingice@××××××××.net>
1832 + * Copyright 2007-2010, Intel Corporation
1833 + * Copyright(c) 2015-2017 Intel Deutschland GmbH
1834 +- * Copyright (C) 2018 - 2019 Intel Corporation
1835 ++ * Copyright (C) 2018 - 2021 Intel Corporation
1836 + */
1837 +
1838 + #include <linux/ieee80211.h>
1839 +@@ -106,7 +106,7 @@ static void ieee80211_send_addba_request(struct ieee80211_sub_if_data *sdata,
1840 + mgmt->u.action.u.addba_req.start_seq_num =
1841 + cpu_to_le16(start_seq_num << 4);
1842 +
1843 +- ieee80211_tx_skb(sdata, skb);
1844 ++ ieee80211_tx_skb_tid(sdata, skb, tid);
1845 + }
1846 +
1847 + void ieee80211_send_bar(struct ieee80211_vif *vif, u8 *ra, u16 tid, u16 ssn)
1848 +@@ -213,6 +213,8 @@ ieee80211_agg_start_txq(struct sta_info *sta, int tid, bool enable)
1849 + struct ieee80211_txq *txq = sta->sta.txq[tid];
1850 + struct txq_info *txqi;
1851 +
1852 ++ lockdep_assert_held(&sta->ampdu_mlme.mtx);
1853 ++
1854 + if (!txq)
1855 + return;
1856 +
1857 +@@ -290,7 +292,6 @@ static void ieee80211_remove_tid_tx(struct sta_info *sta, int tid)
1858 + ieee80211_assign_tid_tx(sta, tid, NULL);
1859 +
1860 + ieee80211_agg_splice_finish(sta->sdata, tid);
1861 +- ieee80211_agg_start_txq(sta, tid, false);
1862 +
1863 + kfree_rcu(tid_tx, rcu_head);
1864 + }
1865 +@@ -448,6 +449,42 @@ static void sta_addba_resp_timer_expired(struct timer_list *t)
1866 + ieee80211_stop_tx_ba_session(&sta->sta, tid);
1867 + }
1868 +
1869 ++static void ieee80211_send_addba_with_timeout(struct sta_info *sta,
1870 ++ struct tid_ampdu_tx *tid_tx)
1871 ++{
1872 ++ struct ieee80211_sub_if_data *sdata = sta->sdata;
1873 ++ struct ieee80211_local *local = sta->local;
1874 ++ u8 tid = tid_tx->tid;
1875 ++ u16 buf_size;
1876 ++
1877 ++ /* activate the timer for the recipient's addBA response */
1878 ++ mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL);
1879 ++ ht_dbg(sdata, "activated addBA response timer on %pM tid %d\n",
1880 ++ sta->sta.addr, tid);
1881 ++
1882 ++ spin_lock_bh(&sta->lock);
1883 ++ sta->ampdu_mlme.last_addba_req_time[tid] = jiffies;
1884 ++ sta->ampdu_mlme.addba_req_num[tid]++;
1885 ++ spin_unlock_bh(&sta->lock);
1886 ++
1887 ++ if (sta->sta.he_cap.has_he) {
1888 ++ buf_size = local->hw.max_tx_aggregation_subframes;
1889 ++ } else {
1890 ++ /*
1891 ++ * We really should use what the driver told us it will
1892 ++ * transmit as the maximum, but certain APs (e.g. the
1893 ++ * LinkSys WRT120N with FW v1.0.07 build 002 Jun 18 2012)
1894 ++ * will crash when we use a lower number.
1895 ++ */
1896 ++ buf_size = IEEE80211_MAX_AMPDU_BUF_HT;
1897 ++ }
1898 ++
1899 ++ /* send AddBA request */
1900 ++ ieee80211_send_addba_request(sdata, sta->sta.addr, tid,
1901 ++ tid_tx->dialog_token, tid_tx->ssn,
1902 ++ buf_size, tid_tx->timeout);
1903 ++}
1904 ++
1905 + void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
1906 + {
1907 + struct tid_ampdu_tx *tid_tx;
1908 +@@ -462,7 +499,6 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
1909 + .timeout = 0,
1910 + };
1911 + int ret;
1912 +- u16 buf_size;
1913 +
1914 + tid_tx = rcu_dereference_protected_tid_tx(sta, tid);
1915 +
1916 +@@ -485,6 +521,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
1917 +
1918 + params.ssn = sta->tid_seq[tid] >> 4;
1919 + ret = drv_ampdu_action(local, sdata, &params);
1920 ++ tid_tx->ssn = params.ssn;
1921 + if (ret) {
1922 + ht_dbg(sdata,
1923 + "BA request denied - HW unavailable for %pM tid %d\n",
1924 +@@ -501,32 +538,7 @@ void ieee80211_tx_ba_session_handle_start(struct sta_info *sta, int tid)
1925 + return;
1926 + }
1927 +
1928 +- /* activate the timer for the recipient's addBA response */
1929 +- mod_timer(&tid_tx->addba_resp_timer, jiffies + ADDBA_RESP_INTERVAL);
1930 +- ht_dbg(sdata, "activated addBA response timer on %pM tid %d\n",
1931 +- sta->sta.addr, tid);
1932 +-
1933 +- spin_lock_bh(&sta->lock);
1934 +- sta->ampdu_mlme.last_addba_req_time[tid] = jiffies;
1935 +- sta->ampdu_mlme.addba_req_num[tid]++;
1936 +- spin_unlock_bh(&sta->lock);
1937 +-
1938 +- if (sta->sta.he_cap.has_he) {
1939 +- buf_size = local->hw.max_tx_aggregation_subframes;
1940 +- } else {
1941 +- /*
1942 +- * We really should use what the driver told us it will
1943 +- * transmit as the maximum, but certain APs (e.g. the
1944 +- * LinkSys WRT120N with FW v1.0.07 build 002 Jun 18 2012)
1945 +- * will crash when we use a lower number.
1946 +- */
1947 +- buf_size = IEEE80211_MAX_AMPDU_BUF_HT;
1948 +- }
1949 +-
1950 +- /* send AddBA request */
1951 +- ieee80211_send_addba_request(sdata, sta->sta.addr, tid,
1952 +- tid_tx->dialog_token, params.ssn,
1953 +- buf_size, tid_tx->timeout);
1954 ++ ieee80211_send_addba_with_timeout(sta, tid_tx);
1955 + }
1956 +
1957 + /*
1958 +@@ -571,7 +583,8 @@ int ieee80211_start_tx_ba_session(struct ieee80211_sta *pubsta, u16 tid,
1959 + "Requested to start BA session on reserved tid=%d", tid))
1960 + return -EINVAL;
1961 +
1962 +- if (!pubsta->ht_cap.ht_supported)
1963 ++ if (!pubsta->ht_cap.ht_supported &&
1964 ++ sta->sdata->vif.bss_conf.chandef.chan->band != NL80211_BAND_6GHZ)
1965 + return -EINVAL;
1966 +
1967 + if (WARN_ON_ONCE(!local->ops->ampdu_action))
1968 +@@ -860,6 +873,7 @@ void ieee80211_stop_tx_ba_cb(struct sta_info *sta, int tid,
1969 + {
1970 + struct ieee80211_sub_if_data *sdata = sta->sdata;
1971 + bool send_delba = false;
1972 ++ bool start_txq = false;
1973 +
1974 + ht_dbg(sdata, "Stopping Tx BA session for %pM tid %d\n",
1975 + sta->sta.addr, tid);
1976 +@@ -877,10 +891,14 @@ void ieee80211_stop_tx_ba_cb(struct sta_info *sta, int tid,
1977 + send_delba = true;
1978 +
1979 + ieee80211_remove_tid_tx(sta, tid);
1980 ++ start_txq = true;
1981 +
1982 + unlock_sta:
1983 + spin_unlock_bh(&sta->lock);
1984 +
1985 ++ if (start_txq)
1986 ++ ieee80211_agg_start_txq(sta, tid, false);
1987 ++
1988 + if (send_delba)
1989 + ieee80211_send_delba(sdata, sta->sta.addr, tid,
1990 + WLAN_BACK_INITIATOR, WLAN_REASON_QSTA_NOT_USE);
1991 +diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
1992 +index 2c9b3eb8b6525..f4c7e0af896b1 100644
1993 +--- a/net/mac80211/driver-ops.h
1994 ++++ b/net/mac80211/driver-ops.h
1995 +@@ -1202,8 +1202,11 @@ static inline void drv_wake_tx_queue(struct ieee80211_local *local,
1996 + {
1997 + struct ieee80211_sub_if_data *sdata = vif_to_sdata(txq->txq.vif);
1998 +
1999 +- if (local->in_reconfig)
2000 ++ /* In reconfig don't transmit now, but mark for waking later */
2001 ++ if (local->in_reconfig) {
2002 ++ set_bit(IEEE80211_TXQ_STOP_NETIF_TX, &txq->flags);
2003 + return;
2004 ++ }
2005 +
2006 + if (!check_sdata_in_driver(sdata))
2007 + return;
2008 +diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c
2009 +index ccaf2389ccc1d..5c727af01143f 100644
2010 +--- a/net/mac80211/mlme.c
2011 ++++ b/net/mac80211/mlme.c
2012 +@@ -2418,11 +2418,18 @@ static void ieee80211_sta_tx_wmm_ac_notify(struct ieee80211_sub_if_data *sdata,
2013 + u16 tx_time)
2014 + {
2015 + struct ieee80211_if_managed *ifmgd = &sdata->u.mgd;
2016 +- u16 tid = ieee80211_get_tid(hdr);
2017 +- int ac = ieee80211_ac_from_tid(tid);
2018 +- struct ieee80211_sta_tx_tspec *tx_tspec = &ifmgd->tx_tspec[ac];
2019 ++ u16 tid;
2020 ++ int ac;
2021 ++ struct ieee80211_sta_tx_tspec *tx_tspec;
2022 + unsigned long now = jiffies;
2023 +
2024 ++ if (!ieee80211_is_data_qos(hdr->frame_control))
2025 ++ return;
2026 ++
2027 ++ tid = ieee80211_get_tid(hdr);
2028 ++ ac = ieee80211_ac_from_tid(tid);
2029 ++ tx_tspec = &ifmgd->tx_tspec[ac];
2030 ++
2031 + if (likely(!tx_tspec->admitted_time))
2032 + return;
2033 +
2034 +diff --git a/net/mac80211/sta_info.h b/net/mac80211/sta_info.h
2035 +index 2eb73be9b9865..be0df78d4a799 100644
2036 +--- a/net/mac80211/sta_info.h
2037 ++++ b/net/mac80211/sta_info.h
2038 +@@ -180,6 +180,7 @@ struct tid_ampdu_tx {
2039 + u8 stop_initiator;
2040 + bool tx_stop;
2041 + u16 buf_size;
2042 ++ u16 ssn;
2043 +
2044 + u16 failed_bar_ssn;
2045 + bool bar_pending;
2046 +diff --git a/net/mac80211/util.c b/net/mac80211/util.c
2047 +index decd46b383938..c1c117fdf3184 100644
2048 +--- a/net/mac80211/util.c
2049 ++++ b/net/mac80211/util.c
2050 +@@ -1227,6 +1227,8 @@ _ieee802_11_parse_elems_crc(const u8 *start, size_t len, bool action,
2051 + elems->max_idle_period_ie = (void *)pos;
2052 + break;
2053 + case WLAN_EID_EXTENSION:
2054 ++ if (!elen)
2055 ++ break;
2056 + if (pos[0] == WLAN_EID_EXT_HE_MU_EDCA &&
2057 + elen >= (sizeof(*elems->mu_edca_param_set) + 1)) {
2058 + elems->mu_edca_param_set = (void *)&pos[1];
2059 +diff --git a/net/packet/af_packet.c b/net/packet/af_packet.c
2060 +index 0ffbf3d17911a..6062bd5bf132b 100644
2061 +--- a/net/packet/af_packet.c
2062 ++++ b/net/packet/af_packet.c
2063 +@@ -4453,9 +4453,10 @@ static int packet_set_ring(struct sock *sk, union tpacket_req_u *req_u,
2064 + }
2065 +
2066 + out_free_pg_vec:
2067 +- bitmap_free(rx_owner_map);
2068 +- if (pg_vec)
2069 ++ if (pg_vec) {
2070 ++ bitmap_free(rx_owner_map);
2071 + free_pg_vec(pg_vec, order, req->tp_block_nr);
2072 ++ }
2073 + out:
2074 + return err;
2075 + }
2076 +diff --git a/net/rds/connection.c b/net/rds/connection.c
2077 +index c85bd6340eaa7..92ff40e7a66cf 100644
2078 +--- a/net/rds/connection.c
2079 ++++ b/net/rds/connection.c
2080 +@@ -253,6 +253,7 @@ static struct rds_connection *__rds_conn_create(struct net *net,
2081 + * should end up here, but if it
2082 + * does, reset/destroy the connection.
2083 + */
2084 ++ kfree(conn->c_path);
2085 + kmem_cache_free(rds_conn_slab, conn);
2086 + conn = ERR_PTR(-EOPNOTSUPP);
2087 + goto out;
2088 +diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c
2089 +index 74450b0f69fc5..214f4efdd9920 100644
2090 +--- a/net/sched/act_sample.c
2091 ++++ b/net/sched/act_sample.c
2092 +@@ -265,14 +265,12 @@ tcf_sample_get_group(const struct tc_action *a,
2093 + struct tcf_sample *s = to_sample(a);
2094 + struct psample_group *group;
2095 +
2096 +- spin_lock_bh(&s->tcf_lock);
2097 + group = rcu_dereference_protected(s->psample_group,
2098 + lockdep_is_held(&s->tcf_lock));
2099 + if (group) {
2100 + psample_group_take(group);
2101 + *destructor = tcf_psample_group_put;
2102 + }
2103 +- spin_unlock_bh(&s->tcf_lock);
2104 +
2105 + return group;
2106 + }
2107 +diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c
2108 +index 7f20fd37e01e0..a4c61205462ac 100644
2109 +--- a/net/sched/cls_api.c
2110 ++++ b/net/sched/cls_api.c
2111 +@@ -3436,7 +3436,7 @@ static void tcf_sample_get_group(struct flow_action_entry *entry,
2112 + int tc_setup_flow_action(struct flow_action *flow_action,
2113 + const struct tcf_exts *exts, bool rtnl_held)
2114 + {
2115 +- const struct tc_action *act;
2116 ++ struct tc_action *act;
2117 + int i, j, k, err = 0;
2118 +
2119 + if (!exts)
2120 +@@ -3450,6 +3450,7 @@ int tc_setup_flow_action(struct flow_action *flow_action,
2121 + struct flow_action_entry *entry;
2122 +
2123 + entry = &flow_action->entries[j];
2124 ++ spin_lock_bh(&act->tcfa_lock);
2125 + if (is_tcf_gact_ok(act)) {
2126 + entry->id = FLOW_ACTION_ACCEPT;
2127 + } else if (is_tcf_gact_shot(act)) {
2128 +@@ -3490,13 +3491,13 @@ int tc_setup_flow_action(struct flow_action *flow_action,
2129 + break;
2130 + default:
2131 + err = -EOPNOTSUPP;
2132 +- goto err_out;
2133 ++ goto err_out_locked;
2134 + }
2135 + } else if (is_tcf_tunnel_set(act)) {
2136 + entry->id = FLOW_ACTION_TUNNEL_ENCAP;
2137 + err = tcf_tunnel_encap_get_tunnel(entry, act);
2138 + if (err)
2139 +- goto err_out;
2140 ++ goto err_out_locked;
2141 + } else if (is_tcf_tunnel_release(act)) {
2142 + entry->id = FLOW_ACTION_TUNNEL_DECAP;
2143 + } else if (is_tcf_pedit(act)) {
2144 +@@ -3510,7 +3511,7 @@ int tc_setup_flow_action(struct flow_action *flow_action,
2145 + break;
2146 + default:
2147 + err = -EOPNOTSUPP;
2148 +- goto err_out;
2149 ++ goto err_out_locked;
2150 + }
2151 + entry->mangle.htype = tcf_pedit_htype(act, k);
2152 + entry->mangle.mask = tcf_pedit_mask(act, k);
2153 +@@ -3561,15 +3562,17 @@ int tc_setup_flow_action(struct flow_action *flow_action,
2154 + entry->mpls_mangle.ttl = tcf_mpls_ttl(act);
2155 + break;
2156 + default:
2157 +- goto err_out;
2158 ++ err = -EOPNOTSUPP;
2159 ++ goto err_out_locked;
2160 + }
2161 + } else if (is_tcf_skbedit_ptype(act)) {
2162 + entry->id = FLOW_ACTION_PTYPE;
2163 + entry->ptype = tcf_skbedit_ptype(act);
2164 + } else {
2165 + err = -EOPNOTSUPP;
2166 +- goto err_out;
2167 ++ goto err_out_locked;
2168 + }
2169 ++ spin_unlock_bh(&act->tcfa_lock);
2170 +
2171 + if (!is_tcf_pedit(act))
2172 + j++;
2173 +@@ -3583,6 +3586,9 @@ err_out:
2174 + tc_cleanup_flow_action(flow_action);
2175 +
2176 + return err;
2177 ++err_out_locked:
2178 ++ spin_unlock_bh(&act->tcfa_lock);
2179 ++ goto err_out;
2180 + }
2181 + EXPORT_SYMBOL(tc_setup_flow_action);
2182 +
2183 +diff --git a/net/sched/sch_cake.c b/net/sched/sch_cake.c
2184 +index e8eebe40e0ae9..0eb4d4a568f77 100644
2185 +--- a/net/sched/sch_cake.c
2186 ++++ b/net/sched/sch_cake.c
2187 +@@ -2724,7 +2724,7 @@ static int cake_init(struct Qdisc *sch, struct nlattr *opt,
2188 + q->tins = kvcalloc(CAKE_MAX_TINS, sizeof(struct cake_tin_data),
2189 + GFP_KERNEL);
2190 + if (!q->tins)
2191 +- goto nomem;
2192 ++ return -ENOMEM;
2193 +
2194 + for (i = 0; i < CAKE_MAX_TINS; i++) {
2195 + struct cake_tin_data *b = q->tins + i;
2196 +@@ -2754,10 +2754,6 @@ static int cake_init(struct Qdisc *sch, struct nlattr *opt,
2197 + q->min_netlen = ~0;
2198 + q->min_adjlen = ~0;
2199 + return 0;
2200 +-
2201 +-nomem:
2202 +- cake_destroy(sch);
2203 +- return -ENOMEM;
2204 + }
2205 +
2206 + static int cake_dump(struct Qdisc *sch, struct sk_buff *skb)
2207 +diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
2208 +index fa3b20e5f4608..06684ac346abd 100644
2209 +--- a/net/smc/af_smc.c
2210 ++++ b/net/smc/af_smc.c
2211 +@@ -183,7 +183,9 @@ static int smc_release(struct socket *sock)
2212 + /* cleanup for a dangling non-blocking connect */
2213 + if (smc->connect_nonblock && sk->sk_state == SMC_INIT)
2214 + tcp_abort(smc->clcsock->sk, ECONNABORTED);
2215 +- flush_work(&smc->connect_work);
2216 ++
2217 ++ if (cancel_work_sync(&smc->connect_work))
2218 ++ sock_put(&smc->sk); /* sock_hold in smc_connect for passive closing */
2219 +
2220 + if (sk->sk_state == SMC_LISTEN)
2221 + /* smc_close_non_accepted() is called and acquires
2222 +diff --git a/scripts/recordmcount.pl b/scripts/recordmcount.pl
2223 +index f459ae883a0a6..a4ca050815aba 100755
2224 +--- a/scripts/recordmcount.pl
2225 ++++ b/scripts/recordmcount.pl
2226 +@@ -252,7 +252,7 @@ if ($arch eq "x86_64") {
2227 +
2228 + } elsif ($arch eq "s390" && $bits == 64) {
2229 + if ($cc =~ /-DCC_USING_HOTPATCH/) {
2230 +- $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*brcl\\s*0,[0-9a-f]+ <([^\+]*)>\$";
2231 ++ $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*c0 04 00 00 00 00\\s*(bcrl\\s*0,|jgnop\\s*)[0-9a-f]+ <([^\+]*)>\$";
2232 + $mcount_adjust = 0;
2233 + } else {
2234 + $mcount_regex = "^\\s*([0-9a-fA-F]+):\\s*R_390_(PC|PLT)32DBL\\s+_mcount\\+0x2\$";
2235 +diff --git a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
2236 +index 231d79e57774e..cfe75536d8a55 100644
2237 +--- a/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
2238 ++++ b/tools/testing/selftests/kvm/kvm_create_max_vcpus.c
2239 +@@ -12,6 +12,7 @@
2240 + #include <stdio.h>
2241 + #include <stdlib.h>
2242 + #include <string.h>
2243 ++#include <sys/resource.h>
2244 +
2245 + #include "test_util.h"
2246 +
2247 +@@ -43,10 +44,39 @@ int main(int argc, char *argv[])
2248 + {
2249 + int kvm_max_vcpu_id = kvm_check_cap(KVM_CAP_MAX_VCPU_ID);
2250 + int kvm_max_vcpus = kvm_check_cap(KVM_CAP_MAX_VCPUS);
2251 ++ /*
2252 ++ * Number of file descriptors reqired, KVM_CAP_MAX_VCPUS for vCPU fds +
2253 ++ * an arbitrary number for everything else.
2254 ++ */
2255 ++ int nr_fds_wanted = kvm_max_vcpus + 100;
2256 ++ struct rlimit rl;
2257 +
2258 + printf("KVM_CAP_MAX_VCPU_ID: %d\n", kvm_max_vcpu_id);
2259 + printf("KVM_CAP_MAX_VCPUS: %d\n", kvm_max_vcpus);
2260 +
2261 ++ /*
2262 ++ * Check that we're allowed to open nr_fds_wanted file descriptors and
2263 ++ * try raising the limits if needed.
2264 ++ */
2265 ++ TEST_ASSERT(!getrlimit(RLIMIT_NOFILE, &rl), "getrlimit() failed!");
2266 ++
2267 ++ if (rl.rlim_cur < nr_fds_wanted) {
2268 ++ rl.rlim_cur = nr_fds_wanted;
2269 ++ if (rl.rlim_max < nr_fds_wanted) {
2270 ++ int old_rlim_max = rl.rlim_max;
2271 ++ rl.rlim_max = nr_fds_wanted;
2272 ++
2273 ++ int r = setrlimit(RLIMIT_NOFILE, &rl);
2274 ++ if (r < 0) {
2275 ++ printf("RLIMIT_NOFILE hard limit is too low (%d, wanted %d)\n",
2276 ++ old_rlim_max, nr_fds_wanted);
2277 ++ exit(KSFT_SKIP);
2278 ++ }
2279 ++ } else {
2280 ++ TEST_ASSERT(!setrlimit(RLIMIT_NOFILE, &rl), "setrlimit() failed!");
2281 ++ }
2282 ++ }
2283 ++
2284 + /*
2285 + * Upstream KVM prior to 4.8 does not support KVM_CAP_MAX_VCPU_ID.
2286 + * Userspace is supposed to use KVM_CAP_MAX_VCPUS as the maximum ID
2287 +diff --git a/tools/testing/selftests/net/fcnal-test.sh b/tools/testing/selftests/net/fcnal-test.sh
2288 +index 782a8da5d9500..157822331954d 100755
2289 +--- a/tools/testing/selftests/net/fcnal-test.sh
2290 ++++ b/tools/testing/selftests/net/fcnal-test.sh
2291 +@@ -1491,8 +1491,9 @@ ipv4_addr_bind_vrf()
2292 + for a in ${NSA_IP} ${VRF_IP}
2293 + do
2294 + log_start
2295 ++ show_hint "Socket not bound to VRF, but address is in VRF"
2296 + run_cmd nettest -s -R -P icmp -l ${a} -b
2297 +- log_test_addr ${a} $? 0 "Raw socket bind to local address"
2298 ++ log_test_addr ${a} $? 1 "Raw socket bind to local address"
2299 +
2300 + log_start
2301 + run_cmd nettest -s -R -P icmp -l ${a} -d ${NSA_DEV} -b
2302 +@@ -1884,7 +1885,7 @@ ipv6_ping_vrf()
2303 + log_start
2304 + show_hint "Fails since VRF device does not support linklocal or multicast"
2305 + run_cmd ${ping6} -c1 -w1 ${a}
2306 +- log_test_addr ${a} $? 2 "ping out, VRF bind"
2307 ++ log_test_addr ${a} $? 1 "ping out, VRF bind"
2308 + done
2309 +
2310 + for a in ${NSB_IP6} ${NSB_LO_IP6} ${NSB_LINKIP6}%${NSA_DEV} ${MCAST}%${NSA_DEV}
2311 +@@ -2890,11 +2891,14 @@ ipv6_addr_bind_novrf()
2312 + run_cmd nettest -6 -s -l ${a} -d ${NSA_DEV} -t1 -b
2313 + log_test_addr ${a} $? 0 "TCP socket bind to local address after device bind"
2314 +
2315 ++ # Sadly, the kernel allows binding a socket to a device and then
2316 ++ # binding to an address not on the device. So this test passes
2317 ++ # when it really should not
2318 + a=${NSA_LO_IP6}
2319 + log_start
2320 +- show_hint "Should fail with 'Cannot assign requested address'"
2321 +- run_cmd nettest -6 -s -l ${a} -d ${NSA_DEV} -t1 -b
2322 +- log_test_addr ${a} $? 1 "TCP socket bind to out of scope local address"
2323 ++ show_hint "Tecnically should fail since address is not on device but kernel allows"
2324 ++ run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
2325 ++ log_test_addr ${a} $? 0 "TCP socket bind to out of scope local address"
2326 + }
2327 +
2328 + ipv6_addr_bind_vrf()
2329 +@@ -2935,10 +2939,15 @@ ipv6_addr_bind_vrf()
2330 + run_cmd nettest -6 -s -l ${a} -d ${NSA_DEV} -t1 -b
2331 + log_test_addr ${a} $? 0 "TCP socket bind to local address with device bind"
2332 +
2333 ++ # Sadly, the kernel allows binding a socket to a device and then
2334 ++ # binding to an address not on the device. The only restriction
2335 ++ # is that the address is valid in the L3 domain. So this test
2336 ++ # passes when it really should not
2337 + a=${VRF_IP6}
2338 + log_start
2339 +- run_cmd nettest -6 -s -l ${a} -d ${NSA_DEV} -t1 -b
2340 +- log_test_addr ${a} $? 1 "TCP socket bind to VRF address with device bind"
2341 ++ show_hint "Tecnically should fail since address is not on device but kernel allows"
2342 ++ run_cmd nettest -6 -s -l ${a} -I ${NSA_DEV} -t1 -b
2343 ++ log_test_addr ${a} $? 0 "TCP socket bind to VRF address with device bind"
2344 +
2345 + a=${NSA_LO_IP6}
2346 + log_start
2347 +diff --git a/tools/testing/selftests/net/forwarding/forwarding.config.sample b/tools/testing/selftests/net/forwarding/forwarding.config.sample
2348 +index e2adb533c8fcb..e71c61ee4cc67 100644
2349 +--- a/tools/testing/selftests/net/forwarding/forwarding.config.sample
2350 ++++ b/tools/testing/selftests/net/forwarding/forwarding.config.sample
2351 +@@ -13,6 +13,8 @@ NETIFS[p5]=veth4
2352 + NETIFS[p6]=veth5
2353 + NETIFS[p7]=veth6
2354 + NETIFS[p8]=veth7
2355 ++NETIFS[p9]=veth8
2356 ++NETIFS[p10]=veth9
2357 +
2358 + ##############################################################################
2359 + # Defines