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: Thu, 23 Jan 2020 11:09:54
Message-Id: 1579777773.bc50c812f636e7a351f6b1fba8cef0b99c7886ae.mpagano@gentoo
1 commit: bc50c812f636e7a351f6b1fba8cef0b99c7886ae
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Thu Jan 23 11:09:33 2020 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Thu Jan 23 11:09:33 2020 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=bc50c812
7
8 Linux patch 5.4.14
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1013_linux-5.4.14.patch | 8137 +++++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 8141 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 6df7de3..b9c4fa1 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -95,6 +95,10 @@ Patch: 1012_linux-5.4.13.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.4.13
23
24 +Patch: 1013_linux-5.4.14.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.4.14
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/1013_linux-5.4.14.patch b/1013_linux-5.4.14.patch
33 new file mode 100644
34 index 0000000..beb51d5
35 --- /dev/null
36 +++ b/1013_linux-5.4.14.patch
37 @@ -0,0 +1,8137 @@
38 +diff --git a/Documentation/devicetree/bindings/net/snps,dwmac.yaml b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
39 +index 4845e29411e4..e08cd4c4d568 100644
40 +--- a/Documentation/devicetree/bindings/net/snps,dwmac.yaml
41 ++++ b/Documentation/devicetree/bindings/net/snps,dwmac.yaml
42 +@@ -347,6 +347,7 @@ allOf:
43 + - st,spear600-gmac
44 +
45 + then:
46 ++ properties:
47 + snps,tso:
48 + $ref: /schemas/types.yaml#definitions/flag
49 + description:
50 +diff --git a/Makefile b/Makefile
51 +index d4cf4700ae3f..2b2080d08bb2 100644
52 +--- a/Makefile
53 ++++ b/Makefile
54 +@@ -1,7 +1,7 @@
55 + # SPDX-License-Identifier: GPL-2.0
56 + VERSION = 5
57 + PATCHLEVEL = 4
58 +-SUBLEVEL = 13
59 ++SUBLEVEL = 14
60 + EXTRAVERSION =
61 + NAME = Kleptomaniac Octopus
62 +
63 +diff --git a/arch/arm/boot/dts/am571x-idk.dts b/arch/arm/boot/dts/am571x-idk.dts
64 +index 0aaacea1d887..9d6a872c2b23 100644
65 +--- a/arch/arm/boot/dts/am571x-idk.dts
66 ++++ b/arch/arm/boot/dts/am571x-idk.dts
67 +@@ -167,7 +167,7 @@
68 +
69 + &pcie1_rc {
70 + status = "okay";
71 +- gpios = <&gpio3 23 GPIO_ACTIVE_HIGH>;
72 ++ gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>;
73 + };
74 +
75 + &pcie1_ep {
76 +diff --git a/arch/arm/boot/dts/dra7-l4.dtsi b/arch/arm/boot/dts/dra7-l4.dtsi
77 +index 5cac2dd58241..c3954e34835b 100644
78 +--- a/arch/arm/boot/dts/dra7-l4.dtsi
79 ++++ b/arch/arm/boot/dts/dra7-l4.dtsi
80 +@@ -3059,7 +3059,7 @@
81 +
82 + davinci_mdio: mdio@1000 {
83 + compatible = "ti,cpsw-mdio","ti,davinci_mdio";
84 +- clocks = <&gmac_clkctrl DRA7_GMAC_GMAC_CLKCTRL 0>;
85 ++ clocks = <&gmac_main_clk>;
86 + clock-names = "fck";
87 + #address-cells = <1>;
88 + #size-cells = <0>;
89 +diff --git a/arch/arm/boot/dts/imx6dl-icore-mipi.dts b/arch/arm/boot/dts/imx6dl-icore-mipi.dts
90 +index e43bccb78ab2..d8f3821a0ffd 100644
91 +--- a/arch/arm/boot/dts/imx6dl-icore-mipi.dts
92 ++++ b/arch/arm/boot/dts/imx6dl-icore-mipi.dts
93 +@@ -8,7 +8,7 @@
94 + /dts-v1/;
95 +
96 + #include "imx6dl.dtsi"
97 +-#include "imx6qdl-icore.dtsi"
98 ++#include "imx6qdl-icore-1.5.dtsi"
99 +
100 + / {
101 + model = "Engicam i.CoreM6 DualLite/Solo MIPI Starter Kit";
102 +diff --git a/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts b/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
103 +index 9c61e3be2d9a..1c46df6827f5 100644
104 +--- a/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
105 ++++ b/arch/arm/boot/dts/imx6q-dhcom-pdk2.dts
106 +@@ -55,7 +55,7 @@
107 + #sound-dai-cells = <0>;
108 + clocks = <&clk_ext_audio_codec>;
109 + VDDA-supply = <&reg_3p3v>;
110 +- VDDIO-supply = <&reg_3p3v>;
111 ++ VDDIO-supply = <&sw2_reg>;
112 + };
113 + };
114 +
115 +diff --git a/arch/arm/boot/dts/imx6q-dhcom-som.dtsi b/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
116 +index 387801dde02e..08a2e17e0539 100644
117 +--- a/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
118 ++++ b/arch/arm/boot/dts/imx6q-dhcom-som.dtsi
119 +@@ -206,7 +206,7 @@
120 + };
121 +
122 + rtc@56 {
123 +- compatible = "rv3029c2";
124 ++ compatible = "microcrystal,rv3029";
125 + pinctrl-names = "default";
126 + pinctrl-0 = <&pinctrl_rtc_hw300>;
127 + reg = <0x56>;
128 +diff --git a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
129 +index 71ca76a5e4a5..fe59dde41b64 100644
130 +--- a/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
131 ++++ b/arch/arm/boot/dts/imx6qdl-sabresd.dtsi
132 +@@ -749,10 +749,6 @@
133 + vin-supply = <&vgen5_reg>;
134 + };
135 +
136 +-&reg_vdd3p0 {
137 +- vin-supply = <&sw2_reg>;
138 +-};
139 +-
140 + &reg_vdd2p5 {
141 + vin-supply = <&vgen5_reg>;
142 + };
143 +diff --git a/arch/arm/boot/dts/imx6sl-evk.dts b/arch/arm/boot/dts/imx6sl-evk.dts
144 +index 4829aa682aeb..bc86cfaaa9c2 100644
145 +--- a/arch/arm/boot/dts/imx6sl-evk.dts
146 ++++ b/arch/arm/boot/dts/imx6sl-evk.dts
147 +@@ -584,10 +584,6 @@
148 + vin-supply = <&sw2_reg>;
149 + };
150 +
151 +-&reg_vdd3p0 {
152 +- vin-supply = <&sw2_reg>;
153 +-};
154 +-
155 + &reg_vdd2p5 {
156 + vin-supply = <&sw2_reg>;
157 + };
158 +diff --git a/arch/arm/boot/dts/imx6sll-evk.dts b/arch/arm/boot/dts/imx6sll-evk.dts
159 +index 3e1d32fdf4b8..5ace9e6acf85 100644
160 +--- a/arch/arm/boot/dts/imx6sll-evk.dts
161 ++++ b/arch/arm/boot/dts/imx6sll-evk.dts
162 +@@ -265,10 +265,6 @@
163 + status = "okay";
164 + };
165 +
166 +-&reg_3p0 {
167 +- vin-supply = <&sw2_reg>;
168 +-};
169 +-
170 + &snvs_poweroff {
171 + status = "okay";
172 + };
173 +diff --git a/arch/arm/boot/dts/imx6sx-sdb-reva.dts b/arch/arm/boot/dts/imx6sx-sdb-reva.dts
174 +index f1830ed387a5..91a7548fdb8d 100644
175 +--- a/arch/arm/boot/dts/imx6sx-sdb-reva.dts
176 ++++ b/arch/arm/boot/dts/imx6sx-sdb-reva.dts
177 +@@ -159,10 +159,6 @@
178 + vin-supply = <&vgen6_reg>;
179 + };
180 +
181 +-&reg_vdd3p0 {
182 +- vin-supply = <&sw2_reg>;
183 +-};
184 +-
185 + &reg_vdd2p5 {
186 + vin-supply = <&vgen6_reg>;
187 + };
188 +diff --git a/arch/arm/boot/dts/imx6sx-sdb.dts b/arch/arm/boot/dts/imx6sx-sdb.dts
189 +index a8ee7087af5a..5a63ca615722 100644
190 +--- a/arch/arm/boot/dts/imx6sx-sdb.dts
191 ++++ b/arch/arm/boot/dts/imx6sx-sdb.dts
192 +@@ -141,10 +141,6 @@
193 + vin-supply = <&vgen6_reg>;
194 + };
195 +
196 +-&reg_vdd3p0 {
197 +- vin-supply = <&sw2_reg>;
198 +-};
199 +-
200 + &reg_vdd2p5 {
201 + vin-supply = <&vgen6_reg>;
202 + };
203 +diff --git a/arch/arm/boot/dts/imx6ul-kontron-n6310-s.dts b/arch/arm/boot/dts/imx6ul-kontron-n6310-s.dts
204 +index 0205fd56d975..4e99e6c79a68 100644
205 +--- a/arch/arm/boot/dts/imx6ul-kontron-n6310-s.dts
206 ++++ b/arch/arm/boot/dts/imx6ul-kontron-n6310-s.dts
207 +@@ -157,10 +157,6 @@
208 + status = "okay";
209 + };
210 +
211 +-&snvs_poweroff {
212 +- status = "okay";
213 +-};
214 +-
215 + &uart1 {
216 + pinctrl-names = "default";
217 + pinctrl-0 = <&pinctrl_uart1>;
218 +diff --git a/arch/arm/boot/dts/imx7s-colibri.dtsi b/arch/arm/boot/dts/imx7s-colibri.dtsi
219 +index 1fb1ec5d3d70..6d16e32aed89 100644
220 +--- a/arch/arm/boot/dts/imx7s-colibri.dtsi
221 ++++ b/arch/arm/boot/dts/imx7s-colibri.dtsi
222 +@@ -49,3 +49,7 @@
223 + reg = <0x80000000 0x10000000>;
224 + };
225 + };
226 ++
227 ++&gpmi {
228 ++ status = "okay";
229 ++};
230 +diff --git a/arch/arm/boot/dts/imx7ulp.dtsi b/arch/arm/boot/dts/imx7ulp.dtsi
231 +index 6859a3a83750..3dac6898cdc5 100644
232 +--- a/arch/arm/boot/dts/imx7ulp.dtsi
233 ++++ b/arch/arm/boot/dts/imx7ulp.dtsi
234 +@@ -37,10 +37,10 @@
235 + #address-cells = <1>;
236 + #size-cells = <0>;
237 +
238 +- cpu0: cpu@0 {
239 ++ cpu0: cpu@f00 {
240 + compatible = "arm,cortex-a7";
241 + device_type = "cpu";
242 +- reg = <0>;
243 ++ reg = <0xf00>;
244 + };
245 + };
246 +
247 +diff --git a/arch/arm/boot/dts/meson8.dtsi b/arch/arm/boot/dts/meson8.dtsi
248 +index 5a7e3e5caebe..3c534cd50ee3 100644
249 +--- a/arch/arm/boot/dts/meson8.dtsi
250 ++++ b/arch/arm/boot/dts/meson8.dtsi
251 +@@ -253,7 +253,7 @@
252 + &aobus {
253 + pmu: pmu@e0 {
254 + compatible = "amlogic,meson8-pmu", "syscon";
255 +- reg = <0xe0 0x8>;
256 ++ reg = <0xe0 0x18>;
257 + };
258 +
259 + pinctrl_aobus: pinctrl@84 {
260 +diff --git a/arch/arm/boot/dts/omap4.dtsi b/arch/arm/boot/dts/omap4.dtsi
261 +index 7cc95bc1598b..e5506ab669fc 100644
262 +--- a/arch/arm/boot/dts/omap4.dtsi
263 ++++ b/arch/arm/boot/dts/omap4.dtsi
264 +@@ -330,8 +330,8 @@
265 +
266 + target-module@56000000 {
267 + compatible = "ti,sysc-omap4", "ti,sysc";
268 +- reg = <0x5601fc00 0x4>,
269 +- <0x5601fc10 0x4>;
270 ++ reg = <0x5600fe00 0x4>,
271 ++ <0x5600fe10 0x4>;
272 + reg-names = "rev", "sysc";
273 + ti,sysc-midle = <SYSC_IDLE_FORCE>,
274 + <SYSC_IDLE_NO>,
275 +diff --git a/arch/arm/mach-davinci/Kconfig b/arch/arm/mach-davinci/Kconfig
276 +index dd427bd2768c..02b180ad7245 100644
277 +--- a/arch/arm/mach-davinci/Kconfig
278 ++++ b/arch/arm/mach-davinci/Kconfig
279 +@@ -9,6 +9,7 @@ menuconfig ARCH_DAVINCI
280 + select PM_GENERIC_DOMAINS if PM
281 + select PM_GENERIC_DOMAINS_OF if PM && OF
282 + select REGMAP_MMIO
283 ++ select RESET_CONTROLLER
284 + select HAVE_IDE
285 + select PINCTRL_SINGLE
286 +
287 +diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c
288 +index 1b7cf81ff035..33688e1d9acf 100644
289 +--- a/arch/arm/mach-omap2/pdata-quirks.c
290 ++++ b/arch/arm/mach-omap2/pdata-quirks.c
291 +@@ -368,10 +368,14 @@ static void __init dra7x_evm_mmc_quirk(void)
292 +
293 + static struct clockdomain *ti_sysc_find_one_clockdomain(struct clk *clk)
294 + {
295 ++ struct clk_hw *hw = __clk_get_hw(clk);
296 + struct clockdomain *clkdm = NULL;
297 + struct clk_hw_omap *hwclk;
298 +
299 +- hwclk = to_clk_hw_omap(__clk_get_hw(clk));
300 ++ hwclk = to_clk_hw_omap(hw);
301 ++ if (!omap2_clk_is_hw_omap(hw))
302 ++ return NULL;
303 ++
304 + if (hwclk && hwclk->clkdm_name)
305 + clkdm = clkdm_lookup(hwclk->clkdm_name);
306 +
307 +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts
308 +index 96ab0227e82d..121e6cc4849b 100644
309 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts
310 ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino-emmc.dts
311 +@@ -15,7 +15,7 @@
312 + pinctrl-names = "default";
313 + pinctrl-0 = <&mmc2_pins>;
314 + vmmc-supply = <&reg_dcdc1>;
315 +- vqmmc-supply = <&reg_dcdc1>;
316 ++ vqmmc-supply = <&reg_eldo1>;
317 + bus-width = <8>;
318 + non-removable;
319 + cap-mmc-hw-reset;
320 +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
321 +index 01a9a52edae4..393c1948a495 100644
322 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
323 ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts
324 +@@ -140,7 +140,7 @@
325 + &mmc1 {
326 + pinctrl-names = "default";
327 + pinctrl-0 = <&mmc1_pins>;
328 +- vmmc-supply = <&reg_aldo2>;
329 ++ vmmc-supply = <&reg_dcdc1>;
330 + vqmmc-supply = <&reg_dldo4>;
331 + mmc-pwrseq = <&wifi_pwrseq>;
332 + bus-width = <4>;
333 +diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
334 +index 70f4cce6be43..ba41c1b85887 100644
335 +--- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
336 ++++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi
337 +@@ -142,6 +142,15 @@
338 + clock-output-names = "ext-osc32k";
339 + };
340 +
341 ++ pmu {
342 ++ compatible = "arm,cortex-a53-pmu";
343 ++ interrupts = <GIC_SPI 116 IRQ_TYPE_LEVEL_HIGH>,
344 ++ <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>,
345 ++ <GIC_SPI 118 IRQ_TYPE_LEVEL_HIGH>,
346 ++ <GIC_SPI 119 IRQ_TYPE_LEVEL_HIGH>;
347 ++ interrupt-affinity = <&cpu0>, <&cpu1>, <&cpu2>, <&cpu3>;
348 ++ };
349 ++
350 + psci {
351 + compatible = "arm,psci-0.2";
352 + method = "smc";
353 +diff --git a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
354 +index 144a2c19ac02..d1fc9c2055f4 100644
355 +--- a/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
356 ++++ b/arch/arm64/boot/dts/altera/socfpga_stratix10.dtsi
357 +@@ -61,10 +61,10 @@
358 +
359 + pmu {
360 + compatible = "arm,armv8-pmuv3";
361 +- interrupts = <0 120 8>,
362 +- <0 121 8>,
363 +- <0 122 8>,
364 +- <0 123 8>;
365 ++ interrupts = <0 170 4>,
366 ++ <0 171 4>,
367 ++ <0 172 4>,
368 ++ <0 173 4>;
369 + interrupt-affinity = <&cpu0>,
370 + <&cpu1>,
371 + <&cpu2>,
372 +diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
373 +index 82919b106010..bb4a2acb9970 100644
374 +--- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
375 ++++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi
376 +@@ -1162,7 +1162,7 @@
377 +
378 + toddr_a: audio-controller@100 {
379 + compatible = "amlogic,axg-toddr";
380 +- reg = <0x0 0x100 0x0 0x1c>;
381 ++ reg = <0x0 0x100 0x0 0x2c>;
382 + #sound-dai-cells = <0>;
383 + sound-name-prefix = "TODDR_A";
384 + interrupts = <GIC_SPI 84 IRQ_TYPE_EDGE_RISING>;
385 +@@ -1173,7 +1173,7 @@
386 +
387 + toddr_b: audio-controller@140 {
388 + compatible = "amlogic,axg-toddr";
389 +- reg = <0x0 0x140 0x0 0x1c>;
390 ++ reg = <0x0 0x140 0x0 0x2c>;
391 + #sound-dai-cells = <0>;
392 + sound-name-prefix = "TODDR_B";
393 + interrupts = <GIC_SPI 85 IRQ_TYPE_EDGE_RISING>;
394 +@@ -1184,7 +1184,7 @@
395 +
396 + toddr_c: audio-controller@180 {
397 + compatible = "amlogic,axg-toddr";
398 +- reg = <0x0 0x180 0x0 0x1c>;
399 ++ reg = <0x0 0x180 0x0 0x2c>;
400 + #sound-dai-cells = <0>;
401 + sound-name-prefix = "TODDR_C";
402 + interrupts = <GIC_SPI 86 IRQ_TYPE_EDGE_RISING>;
403 +@@ -1195,7 +1195,7 @@
404 +
405 + frddr_a: audio-controller@1c0 {
406 + compatible = "amlogic,axg-frddr";
407 +- reg = <0x0 0x1c0 0x0 0x1c>;
408 ++ reg = <0x0 0x1c0 0x0 0x2c>;
409 + #sound-dai-cells = <0>;
410 + sound-name-prefix = "FRDDR_A";
411 + interrupts = <GIC_SPI 88 IRQ_TYPE_EDGE_RISING>;
412 +@@ -1206,7 +1206,7 @@
413 +
414 + frddr_b: audio-controller@200 {
415 + compatible = "amlogic,axg-frddr";
416 +- reg = <0x0 0x200 0x0 0x1c>;
417 ++ reg = <0x0 0x200 0x0 0x2c>;
418 + #sound-dai-cells = <0>;
419 + sound-name-prefix = "FRDDR_B";
420 + interrupts = <GIC_SPI 89 IRQ_TYPE_EDGE_RISING>;
421 +@@ -1217,7 +1217,7 @@
422 +
423 + frddr_c: audio-controller@240 {
424 + compatible = "amlogic,axg-frddr";
425 +- reg = <0x0 0x240 0x0 0x1c>;
426 ++ reg = <0x0 0x240 0x0 0x2c>;
427 + #sound-dai-cells = <0>;
428 + sound-name-prefix = "FRDDR_C";
429 + interrupts = <GIC_SPI 90 IRQ_TYPE_EDGE_RISING>;
430 +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
431 +index 3f39e020f74e..0ee8a369c547 100644
432 +--- a/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
433 ++++ b/arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
434 +@@ -1509,7 +1509,7 @@
435 + toddr_a: audio-controller@100 {
436 + compatible = "amlogic,g12a-toddr",
437 + "amlogic,axg-toddr";
438 +- reg = <0x0 0x100 0x0 0x1c>;
439 ++ reg = <0x0 0x100 0x0 0x2c>;
440 + #sound-dai-cells = <0>;
441 + sound-name-prefix = "TODDR_A";
442 + interrupts = <GIC_SPI 148 IRQ_TYPE_EDGE_RISING>;
443 +@@ -1521,7 +1521,7 @@
444 + toddr_b: audio-controller@140 {
445 + compatible = "amlogic,g12a-toddr",
446 + "amlogic,axg-toddr";
447 +- reg = <0x0 0x140 0x0 0x1c>;
448 ++ reg = <0x0 0x140 0x0 0x2c>;
449 + #sound-dai-cells = <0>;
450 + sound-name-prefix = "TODDR_B";
451 + interrupts = <GIC_SPI 149 IRQ_TYPE_EDGE_RISING>;
452 +@@ -1533,7 +1533,7 @@
453 + toddr_c: audio-controller@180 {
454 + compatible = "amlogic,g12a-toddr",
455 + "amlogic,axg-toddr";
456 +- reg = <0x0 0x180 0x0 0x1c>;
457 ++ reg = <0x0 0x180 0x0 0x2c>;
458 + #sound-dai-cells = <0>;
459 + sound-name-prefix = "TODDR_C";
460 + interrupts = <GIC_SPI 150 IRQ_TYPE_EDGE_RISING>;
461 +@@ -1545,7 +1545,7 @@
462 + frddr_a: audio-controller@1c0 {
463 + compatible = "amlogic,g12a-frddr",
464 + "amlogic,axg-frddr";
465 +- reg = <0x0 0x1c0 0x0 0x1c>;
466 ++ reg = <0x0 0x1c0 0x0 0x2c>;
467 + #sound-dai-cells = <0>;
468 + sound-name-prefix = "FRDDR_A";
469 + interrupts = <GIC_SPI 152 IRQ_TYPE_EDGE_RISING>;
470 +@@ -1557,7 +1557,7 @@
471 + frddr_b: audio-controller@200 {
472 + compatible = "amlogic,g12a-frddr",
473 + "amlogic,axg-frddr";
474 +- reg = <0x0 0x200 0x0 0x1c>;
475 ++ reg = <0x0 0x200 0x0 0x2c>;
476 + #sound-dai-cells = <0>;
477 + sound-name-prefix = "FRDDR_B";
478 + interrupts = <GIC_SPI 153 IRQ_TYPE_EDGE_RISING>;
479 +@@ -1569,7 +1569,7 @@
480 + frddr_c: audio-controller@240 {
481 + compatible = "amlogic,g12a-frddr",
482 + "amlogic,axg-frddr";
483 +- reg = <0x0 0x240 0x0 0x1c>;
484 ++ reg = <0x0 0x240 0x0 0x2c>;
485 + #sound-dai-cells = <0>;
486 + sound-name-prefix = "FRDDR_C";
487 + interrupts = <GIC_SPI 154 IRQ_TYPE_EDGE_RISING>;
488 +diff --git a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
489 +index 8d6f316a5c7b..440bc23c7342 100644
490 +--- a/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
491 ++++ b/arch/arm64/boot/dts/amlogic/meson-gxl-s905x-khadas-vim.dts
492 +@@ -33,11 +33,9 @@
493 +
494 + gpio-keys-polled {
495 + compatible = "gpio-keys-polled";
496 +- #address-cells = <1>;
497 +- #size-cells = <0>;
498 + poll-interval = <100>;
499 +
500 +- button@0 {
501 ++ power-button {
502 + label = "power";
503 + linux,code = <KEY_POWER>;
504 + gpios = <&gpio_ao GPIOAO_2 GPIO_ACTIVE_LOW>;
505 +diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi
506 +index 26a039a028b8..8c11660bbe40 100644
507 +--- a/arch/arm64/boot/dts/arm/juno-base.dtsi
508 ++++ b/arch/arm64/boot/dts/arm/juno-base.dtsi
509 +@@ -6,7 +6,6 @@
510 + /*
511 + * Devices shared by all Juno boards
512 + */
513 +- dma-ranges = <0 0 0 0 0x100 0>;
514 +
515 + memtimer: timer@2a810000 {
516 + compatible = "arm,armv7-timer-mem";
517 +diff --git a/arch/arm64/boot/dts/arm/juno-clocks.dtsi b/arch/arm64/boot/dts/arm/juno-clocks.dtsi
518 +index e5e265dfa902..2870b5eeb198 100644
519 +--- a/arch/arm64/boot/dts/arm/juno-clocks.dtsi
520 ++++ b/arch/arm64/boot/dts/arm/juno-clocks.dtsi
521 +@@ -8,10 +8,10 @@
522 + */
523 + / {
524 + /* SoC fixed clocks */
525 +- soc_uartclk: refclk7273800hz {
526 ++ soc_uartclk: refclk7372800hz {
527 + compatible = "fixed-clock";
528 + #clock-cells = <0>;
529 +- clock-frequency = <7273800>;
530 ++ clock-frequency = <7372800>;
531 + clock-output-names = "juno:uartclk";
532 + };
533 +
534 +diff --git a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
535 +index bb960fe2bb64..9589b15693d6 100644
536 +--- a/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
537 ++++ b/arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
538 +@@ -158,7 +158,7 @@
539 + dcfg: syscon@1e00000 {
540 + compatible = "fsl,ls1028a-dcfg", "syscon";
541 + reg = <0x0 0x1e00000 0x0 0x10000>;
542 +- big-endian;
543 ++ little-endian;
544 + };
545 +
546 + rst: syscon@1e60000 {
547 +diff --git a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
548 +index f7a15f3904c2..13137451b438 100644
549 +--- a/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
550 ++++ b/arch/arm64/boot/dts/freescale/imx8mm-evk.dts
551 +@@ -62,6 +62,8 @@
552 +
553 + cpudai: simple-audio-card,cpu {
554 + sound-dai = <&sai3>;
555 ++ dai-tdm-slot-num = <2>;
556 ++ dai-tdm-slot-width = <32>;
557 + };
558 +
559 + simple-audio-card,codec {
560 +diff --git a/arch/arm64/boot/dts/freescale/imx8mm.dtsi b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
561 +index 23c8fad7932b..fde1849d36ca 100644
562 +--- a/arch/arm64/boot/dts/freescale/imx8mm.dtsi
563 ++++ b/arch/arm64/boot/dts/freescale/imx8mm.dtsi
564 +@@ -479,14 +479,18 @@
565 + <&clk IMX8MM_CLK_AUDIO_AHB>,
566 + <&clk IMX8MM_CLK_IPG_AUDIO_ROOT>,
567 + <&clk IMX8MM_SYS_PLL3>,
568 +- <&clk IMX8MM_VIDEO_PLL1>;
569 ++ <&clk IMX8MM_VIDEO_PLL1>,
570 ++ <&clk IMX8MM_AUDIO_PLL1>,
571 ++ <&clk IMX8MM_AUDIO_PLL2>;
572 + assigned-clock-parents = <&clk IMX8MM_SYS_PLL3_OUT>,
573 + <&clk IMX8MM_SYS_PLL1_800M>;
574 + assigned-clock-rates = <0>,
575 + <400000000>,
576 + <400000000>,
577 + <750000000>,
578 +- <594000000>;
579 ++ <594000000>,
580 ++ <393216000>,
581 ++ <361267200>;
582 + };
583 +
584 + src: reset-controller@30390000 {
585 +@@ -741,7 +745,7 @@
586 + reg = <0x30bd0000 0x10000>;
587 + interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>;
588 + clocks = <&clk IMX8MM_CLK_SDMA1_ROOT>,
589 +- <&clk IMX8MM_CLK_SDMA1_ROOT>;
590 ++ <&clk IMX8MM_CLK_AHB>;
591 + clock-names = "ipg", "ahb";
592 + #dma-cells = <3>;
593 + fsl,sdma-ram-script-name = "imx/sdma/sdma-imx7d.bin";
594 +diff --git a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
595 +index 683a11035643..98cfe67b7db7 100644
596 +--- a/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
597 ++++ b/arch/arm64/boot/dts/freescale/imx8mq-librem5-devkit.dts
598 +@@ -421,7 +421,7 @@
599 + pinctrl-names = "default";
600 + pinctrl-0 = <&pinctrl_imu>;
601 + interrupt-parent = <&gpio3>;
602 +- interrupts = <19 IRQ_TYPE_LEVEL_LOW>;
603 ++ interrupts = <19 IRQ_TYPE_LEVEL_HIGH>;
604 + vdd-supply = <&reg_3v3_p>;
605 + vddio-supply = <&reg_3v3_p>;
606 + };
607 +diff --git a/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi b/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi
608 +index 36abc25320a8..d2cb28da3fff 100644
609 +--- a/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi
610 ++++ b/arch/arm64/boot/dts/intel/socfpga_agilex.dtsi
611 +@@ -47,10 +47,10 @@
612 +
613 + pmu {
614 + compatible = "arm,armv8-pmuv3";
615 +- interrupts = <0 120 8>,
616 +- <0 121 8>,
617 +- <0 122 8>,
618 +- <0 123 8>;
619 ++ interrupts = <0 170 4>,
620 ++ <0 171 4>,
621 ++ <0 172 4>,
622 ++ <0 173 4>;
623 + interrupt-affinity = <&cpu0>,
624 + <&cpu1>,
625 + <&cpu2>,
626 +diff --git a/arch/arm64/boot/dts/marvell/armada-ap806-dual.dtsi b/arch/arm64/boot/dts/marvell/armada-ap806-dual.dtsi
627 +index 9024a2d9db07..62ae016ee6aa 100644
628 +--- a/arch/arm64/boot/dts/marvell/armada-ap806-dual.dtsi
629 ++++ b/arch/arm64/boot/dts/marvell/armada-ap806-dual.dtsi
630 +@@ -21,6 +21,7 @@
631 + reg = <0x000>;
632 + enable-method = "psci";
633 + #cooling-cells = <2>;
634 ++ clocks = <&cpu_clk 0>;
635 + };
636 + cpu1: cpu@1 {
637 + device_type = "cpu";
638 +@@ -28,6 +29,7 @@
639 + reg = <0x001>;
640 + enable-method = "psci";
641 + #cooling-cells = <2>;
642 ++ clocks = <&cpu_clk 0>;
643 + };
644 + };
645 + };
646 +diff --git a/arch/arm64/boot/dts/marvell/armada-cp110.dtsi b/arch/arm64/boot/dts/marvell/armada-cp110.dtsi
647 +index d81944902650..8259fc8f86f2 100644
648 +--- a/arch/arm64/boot/dts/marvell/armada-cp110.dtsi
649 ++++ b/arch/arm64/boot/dts/marvell/armada-cp110.dtsi
650 +@@ -438,10 +438,10 @@
651 +
652 + CP110_LABEL(nand_controller): nand@720000 {
653 + /*
654 +- * Due to the limitation of the pins available
655 +- * this controller is only usable on the CPM
656 +- * for A7K and on the CPS for A8K.
657 +- */
658 ++ * Due to the limitation of the pins available
659 ++ * this controller is only usable on the CPM
660 ++ * for A7K and on the CPS for A8K.
661 ++ */
662 + compatible = "marvell,armada-8k-nand-controller",
663 + "marvell,armada370-nand-controller";
664 + reg = <0x720000 0x54>;
665 +diff --git a/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi b/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
666 +index 108667ce4f31..8d15572d18e6 100644
667 +--- a/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
668 ++++ b/arch/arm64/boot/dts/qcom/msm8998-mtp.dtsi
669 +@@ -27,6 +27,66 @@
670 + status = "okay";
671 + };
672 +
673 ++&etf {
674 ++ status = "okay";
675 ++};
676 ++
677 ++&etm1 {
678 ++ status = "okay";
679 ++};
680 ++
681 ++&etm2 {
682 ++ status = "okay";
683 ++};
684 ++
685 ++&etm3 {
686 ++ status = "okay";
687 ++};
688 ++
689 ++&etm4 {
690 ++ status = "okay";
691 ++};
692 ++
693 ++&etm5 {
694 ++ status = "okay";
695 ++};
696 ++
697 ++&etm6 {
698 ++ status = "okay";
699 ++};
700 ++
701 ++&etm7 {
702 ++ status = "okay";
703 ++};
704 ++
705 ++&etm8 {
706 ++ status = "okay";
707 ++};
708 ++
709 ++&etr {
710 ++ status = "okay";
711 ++};
712 ++
713 ++&funnel1 {
714 ++ status = "okay";
715 ++};
716 ++
717 ++&funnel2 {
718 ++ status = "okay";
719 ++};
720 ++
721 ++&funnel3 {
722 ++ status = "okay";
723 ++};
724 ++
725 ++&funnel4 {
726 ++ status = "okay";
727 ++};
728 ++
729 ++&funnel5 {
730 ++ status = "okay";
731 ++};
732 ++
733 + &pm8005_lsid1 {
734 + pm8005-regulators {
735 + compatible = "qcom,pm8005-regulators";
736 +@@ -51,6 +111,10 @@
737 + vdda-phy-dpdm-supply = <&vreg_l24a_3p075>;
738 + };
739 +
740 ++&replicator1 {
741 ++ status = "okay";
742 ++};
743 ++
744 + &rpm_requests {
745 + pm8998-regulators {
746 + compatible = "qcom,rpm-pm8998-regulators";
747 +@@ -249,6 +313,10 @@
748 + pinctrl-1 = <&sdc2_clk_off &sdc2_cmd_off &sdc2_data_off &sdc2_cd_off>;
749 + };
750 +
751 ++&stm {
752 ++ status = "okay";
753 ++};
754 ++
755 + &ufshc {
756 + vcc-supply = <&vreg_l20a_2p95>;
757 + vccq-supply = <&vreg_l26a_1p2>;
758 +diff --git a/arch/arm64/boot/dts/qcom/msm8998.dtsi b/arch/arm64/boot/dts/qcom/msm8998.dtsi
759 +index c6f81431983e..ffb64fc239ee 100644
760 +--- a/arch/arm64/boot/dts/qcom/msm8998.dtsi
761 ++++ b/arch/arm64/boot/dts/qcom/msm8998.dtsi
762 +@@ -998,11 +998,12 @@
763 + #interrupt-cells = <0x2>;
764 + };
765 +
766 +- stm@6002000 {
767 ++ stm: stm@6002000 {
768 + compatible = "arm,coresight-stm", "arm,primecell";
769 + reg = <0x06002000 0x1000>,
770 + <0x16280000 0x180000>;
771 + reg-names = "stm-base", "stm-data-base";
772 ++ status = "disabled";
773 +
774 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
775 + clock-names = "apb_pclk", "atclk";
776 +@@ -1016,9 +1017,10 @@
777 + };
778 + };
779 +
780 +- funnel@6041000 {
781 ++ funnel1: funnel@6041000 {
782 + compatible = "arm,coresight-dynamic-funnel", "arm,primecell";
783 + reg = <0x06041000 0x1000>;
784 ++ status = "disabled";
785 +
786 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
787 + clock-names = "apb_pclk", "atclk";
788 +@@ -1045,9 +1047,10 @@
789 + };
790 + };
791 +
792 +- funnel@6042000 {
793 ++ funnel2: funnel@6042000 {
794 + compatible = "arm,coresight-dynamic-funnel", "arm,primecell";
795 + reg = <0x06042000 0x1000>;
796 ++ status = "disabled";
797 +
798 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
799 + clock-names = "apb_pclk", "atclk";
800 +@@ -1075,9 +1078,10 @@
801 + };
802 + };
803 +
804 +- funnel@6045000 {
805 ++ funnel3: funnel@6045000 {
806 + compatible = "arm,coresight-dynamic-funnel", "arm,primecell";
807 + reg = <0x06045000 0x1000>;
808 ++ status = "disabled";
809 +
810 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
811 + clock-names = "apb_pclk", "atclk";
812 +@@ -1113,9 +1117,10 @@
813 + };
814 + };
815 +
816 +- replicator@6046000 {
817 ++ replicator1: replicator@6046000 {
818 + compatible = "arm,coresight-dynamic-replicator", "arm,primecell";
819 + reg = <0x06046000 0x1000>;
820 ++ status = "disabled";
821 +
822 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
823 + clock-names = "apb_pclk", "atclk";
824 +@@ -1137,9 +1142,10 @@
825 + };
826 + };
827 +
828 +- etf@6047000 {
829 ++ etf: etf@6047000 {
830 + compatible = "arm,coresight-tmc", "arm,primecell";
831 + reg = <0x06047000 0x1000>;
832 ++ status = "disabled";
833 +
834 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
835 + clock-names = "apb_pclk", "atclk";
836 +@@ -1163,9 +1169,10 @@
837 + };
838 + };
839 +
840 +- etr@6048000 {
841 ++ etr: etr@6048000 {
842 + compatible = "arm,coresight-tmc", "arm,primecell";
843 + reg = <0x06048000 0x1000>;
844 ++ status = "disabled";
845 +
846 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
847 + clock-names = "apb_pclk", "atclk";
848 +@@ -1181,9 +1188,10 @@
849 + };
850 + };
851 +
852 +- etm@7840000 {
853 ++ etm1: etm@7840000 {
854 + compatible = "arm,coresight-etm4x", "arm,primecell";
855 + reg = <0x07840000 0x1000>;
856 ++ status = "disabled";
857 +
858 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
859 + clock-names = "apb_pclk", "atclk";
860 +@@ -1200,9 +1208,10 @@
861 + };
862 + };
863 +
864 +- etm@7940000 {
865 ++ etm2: etm@7940000 {
866 + compatible = "arm,coresight-etm4x", "arm,primecell";
867 + reg = <0x07940000 0x1000>;
868 ++ status = "disabled";
869 +
870 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
871 + clock-names = "apb_pclk", "atclk";
872 +@@ -1219,9 +1228,10 @@
873 + };
874 + };
875 +
876 +- etm@7a40000 {
877 ++ etm3: etm@7a40000 {
878 + compatible = "arm,coresight-etm4x", "arm,primecell";
879 + reg = <0x07a40000 0x1000>;
880 ++ status = "disabled";
881 +
882 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
883 + clock-names = "apb_pclk", "atclk";
884 +@@ -1238,9 +1248,10 @@
885 + };
886 + };
887 +
888 +- etm@7b40000 {
889 ++ etm4: etm@7b40000 {
890 + compatible = "arm,coresight-etm4x", "arm,primecell";
891 + reg = <0x07b40000 0x1000>;
892 ++ status = "disabled";
893 +
894 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
895 + clock-names = "apb_pclk", "atclk";
896 +@@ -1257,9 +1268,10 @@
897 + };
898 + };
899 +
900 +- funnel@7b60000 { /* APSS Funnel */
901 ++ funnel4: funnel@7b60000 { /* APSS Funnel */
902 + compatible = "arm,coresight-etm4x", "arm,primecell";
903 + reg = <0x07b60000 0x1000>;
904 ++ status = "disabled";
905 +
906 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
907 + clock-names = "apb_pclk", "atclk";
908 +@@ -1343,9 +1355,10 @@
909 + };
910 + };
911 +
912 +- funnel@7b70000 {
913 ++ funnel5: funnel@7b70000 {
914 + compatible = "arm,coresight-dynamic-funnel", "arm,primecell";
915 + reg = <0x07b70000 0x1000>;
916 ++ status = "disabled";
917 +
918 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
919 + clock-names = "apb_pclk", "atclk";
920 +@@ -1369,9 +1382,10 @@
921 + };
922 + };
923 +
924 +- etm@7c40000 {
925 ++ etm5: etm@7c40000 {
926 + compatible = "arm,coresight-etm4x", "arm,primecell";
927 + reg = <0x07c40000 0x1000>;
928 ++ status = "disabled";
929 +
930 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
931 + clock-names = "apb_pclk", "atclk";
932 +@@ -1385,9 +1399,10 @@
933 + };
934 + };
935 +
936 +- etm@7d40000 {
937 ++ etm6: etm@7d40000 {
938 + compatible = "arm,coresight-etm4x", "arm,primecell";
939 + reg = <0x07d40000 0x1000>;
940 ++ status = "disabled";
941 +
942 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
943 + clock-names = "apb_pclk", "atclk";
944 +@@ -1401,9 +1416,10 @@
945 + };
946 + };
947 +
948 +- etm@7e40000 {
949 ++ etm7: etm@7e40000 {
950 + compatible = "arm,coresight-etm4x", "arm,primecell";
951 + reg = <0x07e40000 0x1000>;
952 ++ status = "disabled";
953 +
954 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
955 + clock-names = "apb_pclk", "atclk";
956 +@@ -1417,9 +1433,10 @@
957 + };
958 + };
959 +
960 +- etm@7f40000 {
961 ++ etm8: etm@7f40000 {
962 + compatible = "arm,coresight-etm4x", "arm,primecell";
963 + reg = <0x07f40000 0x1000>;
964 ++ status = "disabled";
965 +
966 + clocks = <&rpmcc RPM_SMD_QDSS_CLK>, <&rpmcc RPM_SMD_QDSS_A_CLK>;
967 + clock-names = "apb_pclk", "atclk";
968 +diff --git a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
969 +index 34881c0113cb..99a28d64ee62 100644
970 +--- a/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
971 ++++ b/arch/arm64/boot/dts/qcom/sdm845-cheza.dtsi
972 +@@ -165,6 +165,8 @@
973 + /delete-node/ &venus_mem;
974 + /delete-node/ &cdsp_mem;
975 + /delete-node/ &cdsp_pas;
976 ++/delete-node/ &zap_shader;
977 ++/delete-node/ &gpu_mem;
978 +
979 + /* Increase the size from 120 MB to 128 MB */
980 + &mpss_region {
981 +diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
982 +index f406a4340b05..2287354fef86 100644
983 +--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
984 ++++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
985 +@@ -2824,7 +2824,7 @@
986 +
987 + qcom,gmu = <&gmu>;
988 +
989 +- zap-shader {
990 ++ zap_shader: zap-shader {
991 + memory-region = <&gpu_mem>;
992 + };
993 +
994 +diff --git a/arch/arm64/boot/dts/renesas/hihope-common.dtsi b/arch/arm64/boot/dts/renesas/hihope-common.dtsi
995 +index 3e376d29a730..69585d6e3653 100644
996 +--- a/arch/arm64/boot/dts/renesas/hihope-common.dtsi
997 ++++ b/arch/arm64/boot/dts/renesas/hihope-common.dtsi
998 +@@ -86,7 +86,7 @@
999 +
1000 + label = "rcar-sound";
1001 +
1002 +- dais = <&rsnd_port0>;
1003 ++ dais = <&rsnd_port>;
1004 + };
1005 +
1006 + vbus0_usb2: regulator-vbus0-usb2 {
1007 +@@ -191,7 +191,7 @@
1008 + port@2 {
1009 + reg = <2>;
1010 + dw_hdmi0_snd_in: endpoint {
1011 +- remote-endpoint = <&rsnd_endpoint0>;
1012 ++ remote-endpoint = <&rsnd_endpoint>;
1013 + };
1014 + };
1015 + };
1016 +@@ -327,17 +327,15 @@
1017 + /* Single DAI */
1018 + #sound-dai-cells = <0>;
1019 +
1020 +- ports {
1021 +- rsnd_port0: port@0 {
1022 +- rsnd_endpoint0: endpoint {
1023 +- remote-endpoint = <&dw_hdmi0_snd_in>;
1024 ++ rsnd_port: port {
1025 ++ rsnd_endpoint: endpoint {
1026 ++ remote-endpoint = <&dw_hdmi0_snd_in>;
1027 +
1028 +- dai-format = "i2s";
1029 +- bitclock-master = <&rsnd_endpoint0>;
1030 +- frame-master = <&rsnd_endpoint0>;
1031 ++ dai-format = "i2s";
1032 ++ bitclock-master = <&rsnd_endpoint>;
1033 ++ frame-master = <&rsnd_endpoint>;
1034 +
1035 +- playback = <&ssi2>;
1036 +- };
1037 ++ playback = <&ssi2>;
1038 + };
1039 + };
1040 + };
1041 +diff --git a/arch/arm64/boot/dts/renesas/r8a774a1.dtsi b/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
1042 +index 06c7c849c8ab..c2a7ec3fc209 100644
1043 +--- a/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
1044 ++++ b/arch/arm64/boot/dts/renesas/r8a774a1.dtsi
1045 +@@ -1726,17 +1726,6 @@
1046 + "ssi.1", "ssi.0";
1047 + status = "disabled";
1048 +
1049 +- ports {
1050 +- #address-cells = <1>;
1051 +- #size-cells = <0>;
1052 +- port@0 {
1053 +- reg = <0>;
1054 +- };
1055 +- port@1 {
1056 +- reg = <1>;
1057 +- };
1058 +- };
1059 +-
1060 + rcar_sound,ctu {
1061 + ctu00: ctu-0 { };
1062 + ctu01: ctu-1 { };
1063 +diff --git a/arch/arm64/boot/dts/renesas/r8a77970.dtsi b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
1064 +index 0cd3b376635d..4952981bb6ba 100644
1065 +--- a/arch/arm64/boot/dts/renesas/r8a77970.dtsi
1066 ++++ b/arch/arm64/boot/dts/renesas/r8a77970.dtsi
1067 +@@ -652,7 +652,7 @@
1068 + };
1069 +
1070 + pwm3: pwm@e6e33000 {
1071 +- compatible = "renesas,pwm-r8a7790", "renesas,pwm-rcar";
1072 ++ compatible = "renesas,pwm-r8a77970", "renesas,pwm-rcar";
1073 + reg = <0 0xe6e33000 0 8>;
1074 + #pwm-cells = <2>;
1075 + clocks = <&cpg CPG_MOD 523>;
1076 +diff --git a/arch/s390/kernel/setup.c b/arch/s390/kernel/setup.c
1077 +index 3ff291bc63b7..b95e6fa34cc8 100644
1078 +--- a/arch/s390/kernel/setup.c
1079 ++++ b/arch/s390/kernel/setup.c
1080 +@@ -1059,7 +1059,7 @@ static void __init log_component_list(void)
1081 +
1082 + if (!early_ipl_comp_list_addr)
1083 + return;
1084 +- if (ipl_block.hdr.flags & IPL_PL_FLAG_IPLSR)
1085 ++ if (ipl_block.hdr.flags & IPL_PL_FLAG_SIPL)
1086 + pr_info("Linux is running with Secure-IPL enabled\n");
1087 + else
1088 + pr_info("Linux is running with Secure-IPL disabled\n");
1089 +diff --git a/arch/um/drivers/Kconfig b/arch/um/drivers/Kconfig
1090 +index fea5a0d522dc..388096fb45a2 100644
1091 +--- a/arch/um/drivers/Kconfig
1092 ++++ b/arch/um/drivers/Kconfig
1093 +@@ -337,7 +337,7 @@ config UML_NET_SLIRP
1094 + endmenu
1095 +
1096 + config VIRTIO_UML
1097 +- tristate "UML driver for virtio devices"
1098 ++ bool "UML driver for virtio devices"
1099 + select VIRTIO
1100 + help
1101 + This driver provides support for virtio based paravirtual device
1102 +diff --git a/arch/um/drivers/virtio_uml.c b/arch/um/drivers/virtio_uml.c
1103 +index c5643a59a8c7..179b41ad63ba 100644
1104 +--- a/arch/um/drivers/virtio_uml.c
1105 ++++ b/arch/um/drivers/virtio_uml.c
1106 +@@ -4,12 +4,12 @@
1107 + *
1108 + * Copyright(c) 2019 Intel Corporation
1109 + *
1110 +- * This module allows virtio devices to be used over a vhost-user socket.
1111 ++ * This driver allows virtio devices to be used over a vhost-user socket.
1112 + *
1113 + * Guest devices can be instantiated by kernel module or command line
1114 + * parameters. One device will be created for each parameter. Syntax:
1115 + *
1116 +- * [virtio_uml.]device=<socket>:<virtio_id>[:<platform_id>]
1117 ++ * virtio_uml.device=<socket>:<virtio_id>[:<platform_id>]
1118 + * where:
1119 + * <socket> := vhost-user socket path to connect
1120 + * <virtio_id> := virtio device id (as in virtio_ids.h)
1121 +diff --git a/arch/um/os-Linux/main.c b/arch/um/os-Linux/main.c
1122 +index 8014dfac644d..c8a42ecbd7a2 100644
1123 +--- a/arch/um/os-Linux/main.c
1124 ++++ b/arch/um/os-Linux/main.c
1125 +@@ -170,7 +170,7 @@ int __init main(int argc, char **argv, char **envp)
1126 + * that they won't be delivered after the exec, when
1127 + * they are definitely not expected.
1128 + */
1129 +- unblock_signals_trace();
1130 ++ unblock_signals();
1131 +
1132 + os_info("\n");
1133 + /* Reboot */
1134 +diff --git a/arch/x86/boot/compressed/head_64.S b/arch/x86/boot/compressed/head_64.S
1135 +index d98cd483377e..e9a7f7cadb12 100644
1136 +--- a/arch/x86/boot/compressed/head_64.S
1137 ++++ b/arch/x86/boot/compressed/head_64.S
1138 +@@ -244,6 +244,11 @@ ENTRY(efi32_stub_entry)
1139 + leal efi32_config(%ebp), %eax
1140 + movl %eax, efi_config(%ebp)
1141 +
1142 ++ /* Disable paging */
1143 ++ movl %cr0, %eax
1144 ++ btrl $X86_CR0_PG_BIT, %eax
1145 ++ movl %eax, %cr0
1146 ++
1147 + jmp startup_32
1148 + ENDPROC(efi32_stub_entry)
1149 + #endif
1150 +diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c
1151 +index b10a5ec79e48..011644802ce7 100644
1152 +--- a/arch/x86/events/intel/uncore_snbep.c
1153 ++++ b/arch/x86/events/intel/uncore_snbep.c
1154 +@@ -4536,6 +4536,7 @@ static struct uncore_event_desc snr_uncore_imc_freerunning_events[] = {
1155 + INTEL_UNCORE_EVENT_DESC(write, "event=0xff,umask=0x21"),
1156 + INTEL_UNCORE_EVENT_DESC(write.scale, "3.814697266e-6"),
1157 + INTEL_UNCORE_EVENT_DESC(write.unit, "MiB"),
1158 ++ { /* end: all zeroes */ },
1159 + };
1160 +
1161 + static struct intel_uncore_ops snr_uncore_imc_freerunning_ops = {
1162 +diff --git a/arch/x86/kernel/cpu/amd.c b/arch/x86/kernel/cpu/amd.c
1163 +index 90f75e515876..62c30279be77 100644
1164 +--- a/arch/x86/kernel/cpu/amd.c
1165 ++++ b/arch/x86/kernel/cpu/amd.c
1166 +@@ -615,9 +615,9 @@ static void early_detect_mem_encrypt(struct cpuinfo_x86 *c)
1167 + return;
1168 +
1169 + clear_all:
1170 +- clear_cpu_cap(c, X86_FEATURE_SME);
1171 ++ setup_clear_cpu_cap(X86_FEATURE_SME);
1172 + clear_sev:
1173 +- clear_cpu_cap(c, X86_FEATURE_SEV);
1174 ++ setup_clear_cpu_cap(X86_FEATURE_SEV);
1175 + }
1176 + }
1177 +
1178 +diff --git a/arch/x86/kernel/cpu/resctrl/core.c b/arch/x86/kernel/cpu/resctrl/core.c
1179 +index 03eb90d00af0..89049b343c7a 100644
1180 +--- a/arch/x86/kernel/cpu/resctrl/core.c
1181 ++++ b/arch/x86/kernel/cpu/resctrl/core.c
1182 +@@ -618,7 +618,7 @@ static void domain_remove_cpu(int cpu, struct rdt_resource *r)
1183 + if (static_branch_unlikely(&rdt_mon_enable_key))
1184 + rmdir_mondata_subdir_allrdtgrp(r, d->id);
1185 + list_del(&d->list);
1186 +- if (is_mbm_enabled())
1187 ++ if (r->mon_capable && is_mbm_enabled())
1188 + cancel_delayed_work(&d->mbm_over);
1189 + if (is_llc_occupancy_enabled() && has_busy_rmid(r, d)) {
1190 + /*
1191 +diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
1192 +index 2e3b06d6bbc6..dac7209a0708 100644
1193 +--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
1194 ++++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
1195 +@@ -1741,9 +1741,6 @@ static int set_cache_qos_cfg(int level, bool enable)
1196 + struct rdt_domain *d;
1197 + int cpu;
1198 +
1199 +- if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL))
1200 +- return -ENOMEM;
1201 +-
1202 + if (level == RDT_RESOURCE_L3)
1203 + update = l3_qos_cfg_update;
1204 + else if (level == RDT_RESOURCE_L2)
1205 +@@ -1751,6 +1748,9 @@ static int set_cache_qos_cfg(int level, bool enable)
1206 + else
1207 + return -EINVAL;
1208 +
1209 ++ if (!zalloc_cpumask_var(&cpu_mask, GFP_KERNEL))
1210 ++ return -ENOMEM;
1211 ++
1212 + r_l = &rdt_resources_all[level];
1213 + list_for_each_entry(d, &r_l->domains, list) {
1214 + /* Pick one CPU from each domain instance to update MSR */
1215 +diff --git a/block/blk-settings.c b/block/blk-settings.c
1216 +index 5f6dcc7a47bd..c8eda2e7b91e 100644
1217 +--- a/block/blk-settings.c
1218 ++++ b/block/blk-settings.c
1219 +@@ -328,7 +328,7 @@ EXPORT_SYMBOL(blk_queue_max_segment_size);
1220 + * storage device can address. The default of 512 covers most
1221 + * hardware.
1222 + **/
1223 +-void blk_queue_logical_block_size(struct request_queue *q, unsigned short size)
1224 ++void blk_queue_logical_block_size(struct request_queue *q, unsigned int size)
1225 + {
1226 + q->limits.logical_block_size = size;
1227 +
1228 +diff --git a/block/bsg-lib.c b/block/bsg-lib.c
1229 +index 347dda16c2f4..6cbb7926534c 100644
1230 +--- a/block/bsg-lib.c
1231 ++++ b/block/bsg-lib.c
1232 +@@ -266,7 +266,7 @@ static blk_status_t bsg_queue_rq(struct blk_mq_hw_ctx *hctx,
1233 + struct request *req = bd->rq;
1234 + struct bsg_set *bset =
1235 + container_of(q->tag_set, struct bsg_set, tag_set);
1236 +- int sts = BLK_STS_IOERR;
1237 ++ blk_status_t sts = BLK_STS_IOERR;
1238 + int ret;
1239 +
1240 + blk_mq_start_request(req);
1241 +diff --git a/drivers/base/firmware_loader/builtin/Makefile b/drivers/base/firmware_loader/builtin/Makefile
1242 +index 4a66888e7253..5fa7ce3745a0 100644
1243 +--- a/drivers/base/firmware_loader/builtin/Makefile
1244 ++++ b/drivers/base/firmware_loader/builtin/Makefile
1245 +@@ -17,7 +17,7 @@ PROGBITS = $(if $(CONFIG_ARM),%,@)progbits
1246 + filechk_fwbin = \
1247 + echo "/* Generated by $(src)/Makefile */" ;\
1248 + echo " .section .rodata" ;\
1249 +- echo " .p2align $(ASM_ALIGN)" ;\
1250 ++ echo " .p2align 4" ;\
1251 + echo "_fw_$(FWSTR)_bin:" ;\
1252 + echo " .incbin \"$(fwdir)/$(FWNAME)\"" ;\
1253 + echo "_fw_end:" ;\
1254 +diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
1255 +index a74d03913822..c02be06c5299 100644
1256 +--- a/drivers/block/xen-blkfront.c
1257 ++++ b/drivers/block/xen-blkfront.c
1258 +@@ -1113,8 +1113,8 @@ static int xlvbd_alloc_gendisk(blkif_sector_t capacity,
1259 + if (!VDEV_IS_EXTENDED(info->vdevice)) {
1260 + err = xen_translate_vdev(info->vdevice, &minor, &offset);
1261 + if (err)
1262 +- return err;
1263 +- nr_parts = PARTS_PER_DISK;
1264 ++ return err;
1265 ++ nr_parts = PARTS_PER_DISK;
1266 + } else {
1267 + minor = BLKIF_MINOR_EXT(info->vdevice);
1268 + nr_parts = PARTS_PER_EXT_DISK;
1269 +diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
1270 +index 34bd9bf4e68a..abbf281ee337 100644
1271 +--- a/drivers/bus/ti-sysc.c
1272 ++++ b/drivers/bus/ti-sysc.c
1273 +@@ -343,6 +343,12 @@ static int sysc_get_clocks(struct sysc *ddata)
1274 + return -EINVAL;
1275 + }
1276 +
1277 ++ /* Always add a slot for main clocks fck and ick even if unused */
1278 ++ if (!nr_fck)
1279 ++ ddata->nr_clocks++;
1280 ++ if (!nr_ick)
1281 ++ ddata->nr_clocks++;
1282 ++
1283 + ddata->clocks = devm_kcalloc(ddata->dev,
1284 + ddata->nr_clocks, sizeof(*ddata->clocks),
1285 + GFP_KERNEL);
1286 +@@ -421,7 +427,7 @@ static int sysc_enable_opt_clocks(struct sysc *ddata)
1287 + struct clk *clock;
1288 + int i, error;
1289 +
1290 +- if (!ddata->clocks)
1291 ++ if (!ddata->clocks || ddata->nr_clocks < SYSC_OPTFCK0 + 1)
1292 + return 0;
1293 +
1294 + for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) {
1295 +@@ -455,7 +461,7 @@ static void sysc_disable_opt_clocks(struct sysc *ddata)
1296 + struct clk *clock;
1297 + int i;
1298 +
1299 +- if (!ddata->clocks)
1300 ++ if (!ddata->clocks || ddata->nr_clocks < SYSC_OPTFCK0 + 1)
1301 + return;
1302 +
1303 + for (i = SYSC_OPTFCK0; i < SYSC_MAX_CLOCKS; i++) {
1304 +diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
1305 +index 4fc294c2f9e8..67f592fa083a 100644
1306 +--- a/drivers/clk/clk.c
1307 ++++ b/drivers/clk/clk.c
1308 +@@ -3408,11 +3408,17 @@ static int __clk_core_init(struct clk_core *core)
1309 + if (core->flags & CLK_IS_CRITICAL) {
1310 + unsigned long flags;
1311 +
1312 +- clk_core_prepare(core);
1313 ++ ret = clk_core_prepare(core);
1314 ++ if (ret)
1315 ++ goto out;
1316 +
1317 + flags = clk_enable_lock();
1318 +- clk_core_enable(core);
1319 ++ ret = clk_core_enable(core);
1320 + clk_enable_unlock(flags);
1321 ++ if (ret) {
1322 ++ clk_core_unprepare(core);
1323 ++ goto out;
1324 ++ }
1325 + }
1326 +
1327 + clk_core_reparent_orphans_nolock();
1328 +diff --git a/drivers/clk/imx/clk-imx7ulp.c b/drivers/clk/imx/clk-imx7ulp.c
1329 +index a0f650150367..04a3ae979281 100644
1330 +--- a/drivers/clk/imx/clk-imx7ulp.c
1331 ++++ b/drivers/clk/imx/clk-imx7ulp.c
1332 +@@ -24,8 +24,8 @@ static const char * const spll_pfd_sels[] = { "spll_pfd0", "spll_pfd1", "spll_pf
1333 + static const char * const spll_sels[] = { "spll", "spll_pfd_sel", };
1334 + static const char * const apll_pfd_sels[] = { "apll_pfd0", "apll_pfd1", "apll_pfd2", "apll_pfd3", };
1335 + static const char * const apll_sels[] = { "apll", "apll_pfd_sel", };
1336 +-static const char * const scs_sels[] = { "dummy", "sosc", "sirc", "firc", "dummy", "apll_sel", "spll_sel", "upll", };
1337 +-static const char * const ddr_sels[] = { "apll_pfd_sel", "upll", };
1338 ++static const char * const scs_sels[] = { "dummy", "sosc", "sirc", "firc", "dummy", "apll_sel", "spll_sel", "dummy", };
1339 ++static const char * const ddr_sels[] = { "apll_pfd_sel", "dummy", "dummy", "dummy", };
1340 + static const char * const nic_sels[] = { "firc", "ddr_clk", };
1341 + static const char * const periph_plat_sels[] = { "dummy", "nic1_bus_clk", "nic1_clk", "ddr_clk", "apll_pfd2", "apll_pfd1", "apll_pfd0", "upll", };
1342 + static const char * const periph_bus_sels[] = { "dummy", "sosc_bus_clk", "mpll", "firc_bus_clk", "rosc", "nic1_bus_clk", "nic1_clk", "spll_bus_clk", };
1343 +@@ -119,7 +119,7 @@ static void __init imx7ulp_clk_scg1_init(struct device_node *np)
1344 + clks[IMX7ULP_CLK_SYS_SEL] = imx_clk_hw_mux2("scs_sel", base + 0x14, 24, 4, scs_sels, ARRAY_SIZE(scs_sels));
1345 + clks[IMX7ULP_CLK_HSRUN_SYS_SEL] = imx_clk_hw_mux2("hsrun_scs_sel", base + 0x1c, 24, 4, scs_sels, ARRAY_SIZE(scs_sels));
1346 + clks[IMX7ULP_CLK_NIC_SEL] = imx_clk_hw_mux2("nic_sel", base + 0x40, 28, 1, nic_sels, ARRAY_SIZE(nic_sels));
1347 +- clks[IMX7ULP_CLK_DDR_SEL] = imx_clk_hw_mux_flags("ddr_sel", base + 0x30, 24, 1, ddr_sels, ARRAY_SIZE(ddr_sels), CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE);
1348 ++ clks[IMX7ULP_CLK_DDR_SEL] = imx_clk_hw_mux_flags("ddr_sel", base + 0x30, 24, 2, ddr_sels, ARRAY_SIZE(ddr_sels), CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE);
1349 +
1350 + clks[IMX7ULP_CLK_CORE_DIV] = imx_clk_hw_divider_flags("divcore", "scs_sel", base + 0x14, 16, 4, CLK_SET_RATE_PARENT);
1351 + clks[IMX7ULP_CLK_HSRUN_CORE_DIV] = imx_clk_hw_divider_flags("hsrun_divcore", "hsrun_scs_sel", base + 0x1c, 16, 4, CLK_SET_RATE_PARENT);
1352 +diff --git a/drivers/clk/qcom/gcc-sdm845.c b/drivers/clk/qcom/gcc-sdm845.c
1353 +index 95be125c3bdd..56d22dd225c9 100644
1354 +--- a/drivers/clk/qcom/gcc-sdm845.c
1355 ++++ b/drivers/clk/qcom/gcc-sdm845.c
1356 +@@ -3255,6 +3255,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_audio_tbu_gdsc = {
1357 + .name = "hlos1_vote_aggre_noc_mmu_audio_tbu_gdsc",
1358 + },
1359 + .pwrsts = PWRSTS_OFF_ON,
1360 ++ .flags = VOTABLE,
1361 + };
1362 +
1363 + static struct gdsc hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc = {
1364 +@@ -3263,6 +3264,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc = {
1365 + .name = "hlos1_vote_aggre_noc_mmu_pcie_tbu_gdsc",
1366 + },
1367 + .pwrsts = PWRSTS_OFF_ON,
1368 ++ .flags = VOTABLE,
1369 + };
1370 +
1371 + static struct gdsc hlos1_vote_aggre_noc_mmu_tbu1_gdsc = {
1372 +@@ -3271,6 +3273,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_tbu1_gdsc = {
1373 + .name = "hlos1_vote_aggre_noc_mmu_tbu1_gdsc",
1374 + },
1375 + .pwrsts = PWRSTS_OFF_ON,
1376 ++ .flags = VOTABLE,
1377 + };
1378 +
1379 + static struct gdsc hlos1_vote_aggre_noc_mmu_tbu2_gdsc = {
1380 +@@ -3279,6 +3282,7 @@ static struct gdsc hlos1_vote_aggre_noc_mmu_tbu2_gdsc = {
1381 + .name = "hlos1_vote_aggre_noc_mmu_tbu2_gdsc",
1382 + },
1383 + .pwrsts = PWRSTS_OFF_ON,
1384 ++ .flags = VOTABLE,
1385 + };
1386 +
1387 + static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc = {
1388 +@@ -3287,6 +3291,7 @@ static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc = {
1389 + .name = "hlos1_vote_mmnoc_mmu_tbu_hf0_gdsc",
1390 + },
1391 + .pwrsts = PWRSTS_OFF_ON,
1392 ++ .flags = VOTABLE,
1393 + };
1394 +
1395 + static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc = {
1396 +@@ -3295,6 +3300,7 @@ static struct gdsc hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc = {
1397 + .name = "hlos1_vote_mmnoc_mmu_tbu_hf1_gdsc",
1398 + },
1399 + .pwrsts = PWRSTS_OFF_ON,
1400 ++ .flags = VOTABLE,
1401 + };
1402 +
1403 + static struct gdsc hlos1_vote_mmnoc_mmu_tbu_sf_gdsc = {
1404 +@@ -3303,6 +3309,7 @@ static struct gdsc hlos1_vote_mmnoc_mmu_tbu_sf_gdsc = {
1405 + .name = "hlos1_vote_mmnoc_mmu_tbu_sf_gdsc",
1406 + },
1407 + .pwrsts = PWRSTS_OFF_ON,
1408 ++ .flags = VOTABLE,
1409 + };
1410 +
1411 + static struct clk_regmap *gcc_sdm845_clocks[] = {
1412 +diff --git a/drivers/clk/samsung/clk-exynos5420.c b/drivers/clk/samsung/clk-exynos5420.c
1413 +index 3b7601647d7b..27fd274e92f8 100644
1414 +--- a/drivers/clk/samsung/clk-exynos5420.c
1415 ++++ b/drivers/clk/samsung/clk-exynos5420.c
1416 +@@ -12,6 +12,7 @@
1417 + #include <linux/clk-provider.h>
1418 + #include <linux/of.h>
1419 + #include <linux/of_address.h>
1420 ++#include <linux/clk.h>
1421 +
1422 + #include "clk.h"
1423 + #include "clk-cpu.h"
1424 +@@ -1630,6 +1631,13 @@ static void __init exynos5x_clk_init(struct device_node *np,
1425 + exynos5x_subcmus);
1426 + }
1427 +
1428 ++ /*
1429 ++ * Keep top part of G3D clock path enabled permanently to ensure
1430 ++ * that the internal busses get their clock regardless of the
1431 ++ * main G3D clock enablement status.
1432 ++ */
1433 ++ clk_prepare_enable(__clk_lookup("mout_sw_aclk_g3d"));
1434 ++
1435 + samsung_clk_of_add_provider(np, ctx);
1436 + }
1437 +
1438 +diff --git a/drivers/clk/sprd/common.c b/drivers/clk/sprd/common.c
1439 +index 9d56eac43832..7ad5ba26dfba 100644
1440 +--- a/drivers/clk/sprd/common.c
1441 ++++ b/drivers/clk/sprd/common.c
1442 +@@ -46,7 +46,7 @@ int sprd_clk_regmap_init(struct platform_device *pdev,
1443 +
1444 + if (of_find_property(node, "sprd,syscon", NULL)) {
1445 + regmap = syscon_regmap_lookup_by_phandle(node, "sprd,syscon");
1446 +- if (IS_ERR_OR_NULL(regmap)) {
1447 ++ if (IS_ERR(regmap)) {
1448 + pr_err("%s: failed to get syscon regmap\n", __func__);
1449 + return PTR_ERR(regmap);
1450 + }
1451 +diff --git a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
1452 +index 897490800102..23bfe1d12f21 100644
1453 +--- a/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
1454 ++++ b/drivers/clk/sunxi-ng/ccu-sun8i-r40.c
1455 +@@ -761,7 +761,8 @@ static struct ccu_mp outa_clk = {
1456 + .reg = 0x1f0,
1457 + .features = CCU_FEATURE_FIXED_PREDIV,
1458 + .hw.init = CLK_HW_INIT_PARENTS("outa", out_parents,
1459 +- &ccu_mp_ops, 0),
1460 ++ &ccu_mp_ops,
1461 ++ CLK_SET_RATE_PARENT),
1462 + }
1463 + };
1464 +
1465 +@@ -779,7 +780,8 @@ static struct ccu_mp outb_clk = {
1466 + .reg = 0x1f4,
1467 + .features = CCU_FEATURE_FIXED_PREDIV,
1468 + .hw.init = CLK_HW_INIT_PARENTS("outb", out_parents,
1469 +- &ccu_mp_ops, 0),
1470 ++ &ccu_mp_ops,
1471 ++ CLK_SET_RATE_PARENT),
1472 + }
1473 + };
1474 +
1475 +diff --git a/drivers/cpuidle/governors/teo.c b/drivers/cpuidle/governors/teo.c
1476 +index b9b9156618e6..703047434ee1 100644
1477 +--- a/drivers/cpuidle/governors/teo.c
1478 ++++ b/drivers/cpuidle/governors/teo.c
1479 +@@ -194,7 +194,7 @@ static void teo_update(struct cpuidle_driver *drv, struct cpuidle_device *dev)
1480 + * pattern detection.
1481 + */
1482 + cpu_data->intervals[cpu_data->interval_idx++] = measured_us;
1483 +- if (cpu_data->interval_idx > INTERVALS)
1484 ++ if (cpu_data->interval_idx >= INTERVALS)
1485 + cpu_data->interval_idx = 0;
1486 + }
1487 +
1488 +diff --git a/drivers/firmware/efi/earlycon.c b/drivers/firmware/efi/earlycon.c
1489 +index d4077db6dc97..5d4f84781aa0 100644
1490 +--- a/drivers/firmware/efi/earlycon.c
1491 ++++ b/drivers/firmware/efi/earlycon.c
1492 +@@ -17,7 +17,7 @@ static const struct console *earlycon_console __initdata;
1493 + static const struct font_desc *font;
1494 + static u32 efi_x, efi_y;
1495 + static u64 fb_base;
1496 +-static pgprot_t fb_prot;
1497 ++static bool fb_wb;
1498 + static void *efi_fb;
1499 +
1500 + /*
1501 +@@ -33,10 +33,8 @@ static int __init efi_earlycon_remap_fb(void)
1502 + if (!earlycon_console || !(earlycon_console->flags & CON_ENABLED))
1503 + return 0;
1504 +
1505 +- if (pgprot_val(fb_prot) == pgprot_val(PAGE_KERNEL))
1506 +- efi_fb = memremap(fb_base, screen_info.lfb_size, MEMREMAP_WB);
1507 +- else
1508 +- efi_fb = memremap(fb_base, screen_info.lfb_size, MEMREMAP_WC);
1509 ++ efi_fb = memremap(fb_base, screen_info.lfb_size,
1510 ++ fb_wb ? MEMREMAP_WB : MEMREMAP_WC);
1511 +
1512 + return efi_fb ? 0 : -ENOMEM;
1513 + }
1514 +@@ -53,9 +51,12 @@ late_initcall(efi_earlycon_unmap_fb);
1515 +
1516 + static __ref void *efi_earlycon_map(unsigned long start, unsigned long len)
1517 + {
1518 ++ pgprot_t fb_prot;
1519 ++
1520 + if (efi_fb)
1521 + return efi_fb + start;
1522 +
1523 ++ fb_prot = fb_wb ? PAGE_KERNEL : pgprot_writecombine(PAGE_KERNEL);
1524 + return early_memremap_prot(fb_base + start, len, pgprot_val(fb_prot));
1525 + }
1526 +
1527 +@@ -215,10 +216,7 @@ static int __init efi_earlycon_setup(struct earlycon_device *device,
1528 + if (screen_info.capabilities & VIDEO_CAPABILITY_64BIT_BASE)
1529 + fb_base |= (u64)screen_info.ext_lfb_base << 32;
1530 +
1531 +- if (opt && !strcmp(opt, "ram"))
1532 +- fb_prot = PAGE_KERNEL;
1533 +- else
1534 +- fb_prot = pgprot_writecombine(PAGE_KERNEL);
1535 ++ fb_wb = opt && !strcmp(opt, "ram");
1536 +
1537 + si = &screen_info;
1538 + xres = si->lfb_width;
1539 +diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
1540 +index 38e096e6925f..ceb908f7dbe5 100644
1541 +--- a/drivers/gpio/Kconfig
1542 ++++ b/drivers/gpio/Kconfig
1543 +@@ -546,7 +546,6 @@ config GPIO_THUNDERX
1544 + tristate "Cavium ThunderX/OCTEON-TX GPIO"
1545 + depends on ARCH_THUNDER || (64BIT && COMPILE_TEST)
1546 + depends on PCI_MSI
1547 +- select GPIOLIB_IRQCHIP
1548 + select IRQ_DOMAIN_HIERARCHY
1549 + select IRQ_FASTEOI_HIERARCHY_HANDLERS
1550 + help
1551 +diff --git a/drivers/gpio/gpio-thunderx.c b/drivers/gpio/gpio-thunderx.c
1552 +index ddad5c7ea617..715371b5102a 100644
1553 +--- a/drivers/gpio/gpio-thunderx.c
1554 ++++ b/drivers/gpio/gpio-thunderx.c
1555 +@@ -53,6 +53,7 @@ struct thunderx_line {
1556 + struct thunderx_gpio {
1557 + struct gpio_chip chip;
1558 + u8 __iomem *register_base;
1559 ++ struct irq_domain *irqd;
1560 + struct msix_entry *msix_entries; /* per line MSI-X */
1561 + struct thunderx_line *line_entries; /* per line irq info */
1562 + raw_spinlock_t lock;
1563 +@@ -282,60 +283,54 @@ static void thunderx_gpio_set_multiple(struct gpio_chip *chip,
1564 + }
1565 + }
1566 +
1567 +-static void thunderx_gpio_irq_ack(struct irq_data *d)
1568 ++static void thunderx_gpio_irq_ack(struct irq_data *data)
1569 + {
1570 +- struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
1571 +- struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
1572 ++ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
1573 +
1574 + writeq(GPIO_INTR_INTR,
1575 +- txgpio->register_base + intr_reg(irqd_to_hwirq(d)));
1576 ++ txline->txgpio->register_base + intr_reg(txline->line));
1577 + }
1578 +
1579 +-static void thunderx_gpio_irq_mask(struct irq_data *d)
1580 ++static void thunderx_gpio_irq_mask(struct irq_data *data)
1581 + {
1582 +- struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
1583 +- struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
1584 ++ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
1585 +
1586 + writeq(GPIO_INTR_ENA_W1C,
1587 +- txgpio->register_base + intr_reg(irqd_to_hwirq(d)));
1588 ++ txline->txgpio->register_base + intr_reg(txline->line));
1589 + }
1590 +
1591 +-static void thunderx_gpio_irq_mask_ack(struct irq_data *d)
1592 ++static void thunderx_gpio_irq_mask_ack(struct irq_data *data)
1593 + {
1594 +- struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
1595 +- struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
1596 ++ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
1597 +
1598 + writeq(GPIO_INTR_ENA_W1C | GPIO_INTR_INTR,
1599 +- txgpio->register_base + intr_reg(irqd_to_hwirq(d)));
1600 ++ txline->txgpio->register_base + intr_reg(txline->line));
1601 + }
1602 +
1603 +-static void thunderx_gpio_irq_unmask(struct irq_data *d)
1604 ++static void thunderx_gpio_irq_unmask(struct irq_data *data)
1605 + {
1606 +- struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
1607 +- struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
1608 ++ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
1609 +
1610 + writeq(GPIO_INTR_ENA_W1S,
1611 +- txgpio->register_base + intr_reg(irqd_to_hwirq(d)));
1612 ++ txline->txgpio->register_base + intr_reg(txline->line));
1613 + }
1614 +
1615 +-static int thunderx_gpio_irq_set_type(struct irq_data *d,
1616 ++static int thunderx_gpio_irq_set_type(struct irq_data *data,
1617 + unsigned int flow_type)
1618 + {
1619 +- struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
1620 +- struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
1621 +- struct thunderx_line *txline =
1622 +- &txgpio->line_entries[irqd_to_hwirq(d)];
1623 ++ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
1624 ++ struct thunderx_gpio *txgpio = txline->txgpio;
1625 + u64 bit_cfg;
1626 +
1627 +- irqd_set_trigger_type(d, flow_type);
1628 ++ irqd_set_trigger_type(data, flow_type);
1629 +
1630 + bit_cfg = txline->fil_bits | GPIO_BIT_CFG_INT_EN;
1631 +
1632 + if (flow_type & IRQ_TYPE_EDGE_BOTH) {
1633 +- irq_set_handler_locked(d, handle_fasteoi_ack_irq);
1634 ++ irq_set_handler_locked(data, handle_fasteoi_ack_irq);
1635 + bit_cfg |= GPIO_BIT_CFG_INT_TYPE;
1636 + } else {
1637 +- irq_set_handler_locked(d, handle_fasteoi_mask_irq);
1638 ++ irq_set_handler_locked(data, handle_fasteoi_mask_irq);
1639 + }
1640 +
1641 + raw_spin_lock(&txgpio->lock);
1642 +@@ -364,6 +359,33 @@ static void thunderx_gpio_irq_disable(struct irq_data *data)
1643 + irq_chip_disable_parent(data);
1644 + }
1645 +
1646 ++static int thunderx_gpio_irq_request_resources(struct irq_data *data)
1647 ++{
1648 ++ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
1649 ++ struct thunderx_gpio *txgpio = txline->txgpio;
1650 ++ int r;
1651 ++
1652 ++ r = gpiochip_lock_as_irq(&txgpio->chip, txline->line);
1653 ++ if (r)
1654 ++ return r;
1655 ++
1656 ++ r = irq_chip_request_resources_parent(data);
1657 ++ if (r)
1658 ++ gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
1659 ++
1660 ++ return r;
1661 ++}
1662 ++
1663 ++static void thunderx_gpio_irq_release_resources(struct irq_data *data)
1664 ++{
1665 ++ struct thunderx_line *txline = irq_data_get_irq_chip_data(data);
1666 ++ struct thunderx_gpio *txgpio = txline->txgpio;
1667 ++
1668 ++ irq_chip_release_resources_parent(data);
1669 ++
1670 ++ gpiochip_unlock_as_irq(&txgpio->chip, txline->line);
1671 ++}
1672 ++
1673 + /*
1674 + * Interrupts are chained from underlying MSI-X vectors. We have
1675 + * these irq_chip functions to be able to handle level triggering
1676 +@@ -380,24 +402,50 @@ static struct irq_chip thunderx_gpio_irq_chip = {
1677 + .irq_unmask = thunderx_gpio_irq_unmask,
1678 + .irq_eoi = irq_chip_eoi_parent,
1679 + .irq_set_affinity = irq_chip_set_affinity_parent,
1680 ++ .irq_request_resources = thunderx_gpio_irq_request_resources,
1681 ++ .irq_release_resources = thunderx_gpio_irq_release_resources,
1682 + .irq_set_type = thunderx_gpio_irq_set_type,
1683 +
1684 + .flags = IRQCHIP_SET_TYPE_MASKED
1685 + };
1686 +
1687 +-static int thunderx_gpio_child_to_parent_hwirq(struct gpio_chip *gc,
1688 +- unsigned int child,
1689 +- unsigned int child_type,
1690 +- unsigned int *parent,
1691 +- unsigned int *parent_type)
1692 ++static int thunderx_gpio_irq_translate(struct irq_domain *d,
1693 ++ struct irq_fwspec *fwspec,
1694 ++ irq_hw_number_t *hwirq,
1695 ++ unsigned int *type)
1696 + {
1697 +- struct thunderx_gpio *txgpio = gpiochip_get_data(gc);
1698 +-
1699 +- *parent = txgpio->base_msi + (2 * child);
1700 +- *parent_type = IRQ_TYPE_LEVEL_HIGH;
1701 ++ struct thunderx_gpio *txgpio = d->host_data;
1702 ++
1703 ++ if (WARN_ON(fwspec->param_count < 2))
1704 ++ return -EINVAL;
1705 ++ if (fwspec->param[0] >= txgpio->chip.ngpio)
1706 ++ return -EINVAL;
1707 ++ *hwirq = fwspec->param[0];
1708 ++ *type = fwspec->param[1] & IRQ_TYPE_SENSE_MASK;
1709 + return 0;
1710 + }
1711 +
1712 ++static int thunderx_gpio_irq_alloc(struct irq_domain *d, unsigned int virq,
1713 ++ unsigned int nr_irqs, void *arg)
1714 ++{
1715 ++ struct thunderx_line *txline = arg;
1716 ++
1717 ++ return irq_domain_set_hwirq_and_chip(d, virq, txline->line,
1718 ++ &thunderx_gpio_irq_chip, txline);
1719 ++}
1720 ++
1721 ++static const struct irq_domain_ops thunderx_gpio_irqd_ops = {
1722 ++ .alloc = thunderx_gpio_irq_alloc,
1723 ++ .translate = thunderx_gpio_irq_translate
1724 ++};
1725 ++
1726 ++static int thunderx_gpio_to_irq(struct gpio_chip *chip, unsigned int offset)
1727 ++{
1728 ++ struct thunderx_gpio *txgpio = gpiochip_get_data(chip);
1729 ++
1730 ++ return irq_find_mapping(txgpio->irqd, offset);
1731 ++}
1732 ++
1733 + static int thunderx_gpio_probe(struct pci_dev *pdev,
1734 + const struct pci_device_id *id)
1735 + {
1736 +@@ -405,7 +453,6 @@ static int thunderx_gpio_probe(struct pci_dev *pdev,
1737 + struct device *dev = &pdev->dev;
1738 + struct thunderx_gpio *txgpio;
1739 + struct gpio_chip *chip;
1740 +- struct gpio_irq_chip *girq;
1741 + int ngpio, i;
1742 + int err = 0;
1743 +
1744 +@@ -450,8 +497,8 @@ static int thunderx_gpio_probe(struct pci_dev *pdev,
1745 + }
1746 +
1747 + txgpio->msix_entries = devm_kcalloc(dev,
1748 +- ngpio, sizeof(struct msix_entry),
1749 +- GFP_KERNEL);
1750 ++ ngpio, sizeof(struct msix_entry),
1751 ++ GFP_KERNEL);
1752 + if (!txgpio->msix_entries) {
1753 + err = -ENOMEM;
1754 + goto out;
1755 +@@ -492,6 +539,27 @@ static int thunderx_gpio_probe(struct pci_dev *pdev,
1756 + if (err < 0)
1757 + goto out;
1758 +
1759 ++ /*
1760 ++ * Push GPIO specific irqdomain on hierarchy created as a side
1761 ++ * effect of the pci_enable_msix()
1762 ++ */
1763 ++ txgpio->irqd = irq_domain_create_hierarchy(irq_get_irq_data(txgpio->msix_entries[0].vector)->domain,
1764 ++ 0, 0, of_node_to_fwnode(dev->of_node),
1765 ++ &thunderx_gpio_irqd_ops, txgpio);
1766 ++ if (!txgpio->irqd) {
1767 ++ err = -ENOMEM;
1768 ++ goto out;
1769 ++ }
1770 ++
1771 ++ /* Push on irq_data and the domain for each line. */
1772 ++ for (i = 0; i < ngpio; i++) {
1773 ++ err = irq_domain_push_irq(txgpio->irqd,
1774 ++ txgpio->msix_entries[i].vector,
1775 ++ &txgpio->line_entries[i]);
1776 ++ if (err < 0)
1777 ++ dev_err(dev, "irq_domain_push_irq: %d\n", err);
1778 ++ }
1779 ++
1780 + chip->label = KBUILD_MODNAME;
1781 + chip->parent = dev;
1782 + chip->owner = THIS_MODULE;
1783 +@@ -506,28 +574,11 @@ static int thunderx_gpio_probe(struct pci_dev *pdev,
1784 + chip->set = thunderx_gpio_set;
1785 + chip->set_multiple = thunderx_gpio_set_multiple;
1786 + chip->set_config = thunderx_gpio_set_config;
1787 +- girq = &chip->irq;
1788 +- girq->chip = &thunderx_gpio_irq_chip;
1789 +- girq->fwnode = of_node_to_fwnode(dev->of_node);
1790 +- girq->parent_domain =
1791 +- irq_get_irq_data(txgpio->msix_entries[0].vector)->domain;
1792 +- girq->child_to_parent_hwirq = thunderx_gpio_child_to_parent_hwirq;
1793 +- girq->handler = handle_bad_irq;
1794 +- girq->default_type = IRQ_TYPE_NONE;
1795 +-
1796 ++ chip->to_irq = thunderx_gpio_to_irq;
1797 + err = devm_gpiochip_add_data(dev, chip, txgpio);
1798 + if (err)
1799 + goto out;
1800 +
1801 +- /* Push on irq_data and the domain for each line. */
1802 +- for (i = 0; i < ngpio; i++) {
1803 +- err = irq_domain_push_irq(chip->irq.domain,
1804 +- txgpio->msix_entries[i].vector,
1805 +- chip);
1806 +- if (err < 0)
1807 +- dev_err(dev, "irq_domain_push_irq: %d\n", err);
1808 +- }
1809 +-
1810 + dev_info(dev, "ThunderX GPIO: %d lines with base %d.\n",
1811 + ngpio, chip->base);
1812 + return 0;
1813 +@@ -542,10 +593,10 @@ static void thunderx_gpio_remove(struct pci_dev *pdev)
1814 + struct thunderx_gpio *txgpio = pci_get_drvdata(pdev);
1815 +
1816 + for (i = 0; i < txgpio->chip.ngpio; i++)
1817 +- irq_domain_pop_irq(txgpio->chip.irq.domain,
1818 ++ irq_domain_pop_irq(txgpio->irqd,
1819 + txgpio->msix_entries[i].vector);
1820 +
1821 +- irq_domain_remove(txgpio->chip.irq.domain);
1822 ++ irq_domain_remove(txgpio->irqd);
1823 +
1824 + pci_set_drvdata(pdev, NULL);
1825 + }
1826 +diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
1827 +index ab4a0d8545dc..0125ea7c4103 100644
1828 +--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
1829 ++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
1830 +@@ -2923,7 +2923,9 @@ static void gfx_v9_0_init_pg(struct amdgpu_device *adev)
1831 + * And it's needed by gfxoff feature.
1832 + */
1833 + if (adev->gfx.rlc.is_rlc_v2_1) {
1834 +- if (adev->asic_type == CHIP_VEGA12)
1835 ++ if (adev->asic_type == CHIP_VEGA12 ||
1836 ++ (adev->asic_type == CHIP_RAVEN &&
1837 ++ adev->rev_id >= 8))
1838 + gfx_v9_1_init_rlc_save_restore_list(adev);
1839 + gfx_v9_0_enable_save_restore_machine(adev);
1840 + }
1841 +diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
1842 +index 793aa8e8ec9a..c0f1c62c59b4 100644
1843 +--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
1844 ++++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
1845 +@@ -809,8 +809,8 @@ bool dc_link_detect(struct dc_link *link, enum dc_detect_reason reason)
1846 + }
1847 +
1848 + case SIGNAL_TYPE_EDP: {
1849 +- read_edp_current_link_settings_on_detect(link);
1850 + detect_edp_sink_caps(link);
1851 ++ read_edp_current_link_settings_on_detect(link);
1852 + sink_caps.transaction_type =
1853 + DDC_TRANSACTION_TYPE_I2C_OVER_AUX;
1854 + sink_caps.signal = SIGNAL_TYPE_EDP;
1855 +diff --git a/drivers/gpu/drm/i915/selftests/i915_random.h b/drivers/gpu/drm/i915/selftests/i915_random.h
1856 +index 8e1ff9c105b6..22335cee2203 100644
1857 +--- a/drivers/gpu/drm/i915/selftests/i915_random.h
1858 ++++ b/drivers/gpu/drm/i915/selftests/i915_random.h
1859 +@@ -25,6 +25,7 @@
1860 + #ifndef __I915_SELFTESTS_RANDOM_H__
1861 + #define __I915_SELFTESTS_RANDOM_H__
1862 +
1863 ++#include <linux/math64.h>
1864 + #include <linux/random.h>
1865 +
1866 + #include "../i915_selftest.h"
1867 +diff --git a/drivers/hwmon/pmbus/ibm-cffps.c b/drivers/hwmon/pmbus/ibm-cffps.c
1868 +index d44745e498e7..929c909ac27a 100644
1869 +--- a/drivers/hwmon/pmbus/ibm-cffps.c
1870 ++++ b/drivers/hwmon/pmbus/ibm-cffps.c
1871 +@@ -39,9 +39,13 @@
1872 + #define CFFPS_MFR_VAUX_FAULT BIT(6)
1873 + #define CFFPS_MFR_CURRENT_SHARE_WARNING BIT(7)
1874 +
1875 ++/*
1876 ++ * LED off state actually relinquishes LED control to PSU firmware, so it can
1877 ++ * turn on the LED for faults.
1878 ++ */
1879 ++#define CFFPS_LED_OFF 0
1880 + #define CFFPS_LED_BLINK BIT(0)
1881 + #define CFFPS_LED_ON BIT(1)
1882 +-#define CFFPS_LED_OFF BIT(2)
1883 + #define CFFPS_BLINK_RATE_MS 250
1884 +
1885 + enum {
1886 +@@ -292,28 +296,38 @@ static int ibm_cffps_read_word_data(struct i2c_client *client, int page,
1887 + return rc;
1888 + }
1889 +
1890 +-static void ibm_cffps_led_brightness_set(struct led_classdev *led_cdev,
1891 +- enum led_brightness brightness)
1892 ++static int ibm_cffps_led_brightness_set(struct led_classdev *led_cdev,
1893 ++ enum led_brightness brightness)
1894 + {
1895 + int rc;
1896 ++ u8 next_led_state;
1897 + struct ibm_cffps *psu = container_of(led_cdev, struct ibm_cffps, led);
1898 +
1899 + if (brightness == LED_OFF) {
1900 +- psu->led_state = CFFPS_LED_OFF;
1901 ++ next_led_state = CFFPS_LED_OFF;
1902 + } else {
1903 + brightness = LED_FULL;
1904 ++
1905 + if (psu->led_state != CFFPS_LED_BLINK)
1906 +- psu->led_state = CFFPS_LED_ON;
1907 ++ next_led_state = CFFPS_LED_ON;
1908 ++ else
1909 ++ next_led_state = CFFPS_LED_BLINK;
1910 + }
1911 +
1912 ++ dev_dbg(&psu->client->dev, "LED brightness set: %d. Command: %d.\n",
1913 ++ brightness, next_led_state);
1914 ++
1915 + pmbus_set_page(psu->client, 0);
1916 +
1917 + rc = i2c_smbus_write_byte_data(psu->client, CFFPS_SYS_CONFIG_CMD,
1918 +- psu->led_state);
1919 ++ next_led_state);
1920 + if (rc < 0)
1921 +- return;
1922 ++ return rc;
1923 +
1924 ++ psu->led_state = next_led_state;
1925 + led_cdev->brightness = brightness;
1926 ++
1927 ++ return 0;
1928 + }
1929 +
1930 + static int ibm_cffps_led_blink_set(struct led_classdev *led_cdev,
1931 +@@ -323,10 +337,7 @@ static int ibm_cffps_led_blink_set(struct led_classdev *led_cdev,
1932 + int rc;
1933 + struct ibm_cffps *psu = container_of(led_cdev, struct ibm_cffps, led);
1934 +
1935 +- psu->led_state = CFFPS_LED_BLINK;
1936 +-
1937 +- if (led_cdev->brightness == LED_OFF)
1938 +- return 0;
1939 ++ dev_dbg(&psu->client->dev, "LED blink set.\n");
1940 +
1941 + pmbus_set_page(psu->client, 0);
1942 +
1943 +@@ -335,6 +346,8 @@ static int ibm_cffps_led_blink_set(struct led_classdev *led_cdev,
1944 + if (rc < 0)
1945 + return rc;
1946 +
1947 ++ psu->led_state = CFFPS_LED_BLINK;
1948 ++ led_cdev->brightness = LED_FULL;
1949 + *delay_on = CFFPS_BLINK_RATE_MS;
1950 + *delay_off = CFFPS_BLINK_RATE_MS;
1951 +
1952 +@@ -351,7 +364,7 @@ static void ibm_cffps_create_led_class(struct ibm_cffps *psu)
1953 + client->addr);
1954 + psu->led.name = psu->led_name;
1955 + psu->led.max_brightness = LED_FULL;
1956 +- psu->led.brightness_set = ibm_cffps_led_brightness_set;
1957 ++ psu->led.brightness_set_blocking = ibm_cffps_led_brightness_set;
1958 + psu->led.blink_set = ibm_cffps_led_blink_set;
1959 +
1960 + rc = devm_led_classdev_register(dev, &psu->led);
1961 +diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c
1962 +index 38556381f4ca..2f8b8050a223 100644
1963 +--- a/drivers/i2c/busses/i2c-iop3xx.c
1964 ++++ b/drivers/i2c/busses/i2c-iop3xx.c
1965 +@@ -433,13 +433,17 @@ iop3xx_i2c_probe(struct platform_device *pdev)
1966 + adapter_data->gpio_scl = devm_gpiod_get_optional(&pdev->dev,
1967 + "scl",
1968 + GPIOD_ASIS);
1969 +- if (IS_ERR(adapter_data->gpio_scl))
1970 +- return PTR_ERR(adapter_data->gpio_scl);
1971 ++ if (IS_ERR(adapter_data->gpio_scl)) {
1972 ++ ret = PTR_ERR(adapter_data->gpio_scl);
1973 ++ goto free_both;
1974 ++ }
1975 + adapter_data->gpio_sda = devm_gpiod_get_optional(&pdev->dev,
1976 + "sda",
1977 + GPIOD_ASIS);
1978 +- if (IS_ERR(adapter_data->gpio_sda))
1979 +- return PTR_ERR(adapter_data->gpio_sda);
1980 ++ if (IS_ERR(adapter_data->gpio_sda)) {
1981 ++ ret = PTR_ERR(adapter_data->gpio_sda);
1982 ++ goto free_both;
1983 ++ }
1984 +
1985 + res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
1986 + if (!res) {
1987 +diff --git a/drivers/i2c/busses/i2c-tegra.c b/drivers/i2c/busses/i2c-tegra.c
1988 +index c1683f9338b4..dbc43cfec19d 100644
1989 +--- a/drivers/i2c/busses/i2c-tegra.c
1990 ++++ b/drivers/i2c/busses/i2c-tegra.c
1991 +@@ -1608,14 +1608,18 @@ static int tegra_i2c_probe(struct platform_device *pdev)
1992 + }
1993 +
1994 + pm_runtime_enable(&pdev->dev);
1995 +- if (!pm_runtime_enabled(&pdev->dev))
1996 ++ if (!pm_runtime_enabled(&pdev->dev)) {
1997 + ret = tegra_i2c_runtime_resume(&pdev->dev);
1998 +- else
1999 ++ if (ret < 0) {
2000 ++ dev_err(&pdev->dev, "runtime resume failed\n");
2001 ++ goto unprepare_div_clk;
2002 ++ }
2003 ++ } else {
2004 + ret = pm_runtime_get_sync(i2c_dev->dev);
2005 +-
2006 +- if (ret < 0) {
2007 +- dev_err(&pdev->dev, "runtime resume failed\n");
2008 +- goto unprepare_div_clk;
2009 ++ if (ret < 0) {
2010 ++ dev_err(&pdev->dev, "runtime resume failed\n");
2011 ++ goto disable_rpm;
2012 ++ }
2013 + }
2014 +
2015 + if (i2c_dev->is_multimaster_mode) {
2016 +@@ -1623,7 +1627,7 @@ static int tegra_i2c_probe(struct platform_device *pdev)
2017 + if (ret < 0) {
2018 + dev_err(i2c_dev->dev, "div_clk enable failed %d\n",
2019 + ret);
2020 +- goto disable_rpm;
2021 ++ goto put_rpm;
2022 + }
2023 + }
2024 +
2025 +@@ -1671,11 +1675,16 @@ disable_div_clk:
2026 + if (i2c_dev->is_multimaster_mode)
2027 + clk_disable(i2c_dev->div_clk);
2028 +
2029 +-disable_rpm:
2030 +- pm_runtime_disable(&pdev->dev);
2031 +- if (!pm_runtime_status_suspended(&pdev->dev))
2032 ++put_rpm:
2033 ++ if (pm_runtime_enabled(&pdev->dev))
2034 ++ pm_runtime_put_sync(&pdev->dev);
2035 ++ else
2036 + tegra_i2c_runtime_suspend(&pdev->dev);
2037 +
2038 ++disable_rpm:
2039 ++ if (pm_runtime_enabled(&pdev->dev))
2040 ++ pm_runtime_disable(&pdev->dev);
2041 ++
2042 + unprepare_div_clk:
2043 + clk_unprepare(i2c_dev->div_clk);
2044 +
2045 +@@ -1710,9 +1719,14 @@ static int tegra_i2c_remove(struct platform_device *pdev)
2046 + static int __maybe_unused tegra_i2c_suspend(struct device *dev)
2047 + {
2048 + struct tegra_i2c_dev *i2c_dev = dev_get_drvdata(dev);
2049 ++ int err;
2050 +
2051 + i2c_mark_adapter_suspended(&i2c_dev->adapter);
2052 +
2053 ++ err = pm_runtime_force_suspend(dev);
2054 ++ if (err < 0)
2055 ++ return err;
2056 ++
2057 + return 0;
2058 + }
2059 +
2060 +@@ -1733,6 +1747,10 @@ static int __maybe_unused tegra_i2c_resume(struct device *dev)
2061 + if (err)
2062 + return err;
2063 +
2064 ++ err = pm_runtime_force_resume(dev);
2065 ++ if (err < 0)
2066 ++ return err;
2067 ++
2068 + i2c_mark_adapter_resumed(&i2c_dev->adapter);
2069 +
2070 + return 0;
2071 +diff --git a/drivers/iio/adc/ad7124.c b/drivers/iio/adc/ad7124.c
2072 +index 3f03abf100b5..306bf15023a7 100644
2073 +--- a/drivers/iio/adc/ad7124.c
2074 ++++ b/drivers/iio/adc/ad7124.c
2075 +@@ -494,13 +494,11 @@ static int ad7124_of_parse_channel_config(struct iio_dev *indio_dev,
2076 + st->channel_config[channel].buf_negative =
2077 + of_property_read_bool(child, "adi,buffered-negative");
2078 +
2079 +- *chan = ad7124_channel_template;
2080 +- chan->address = channel;
2081 +- chan->scan_index = channel;
2082 +- chan->channel = ain[0];
2083 +- chan->channel2 = ain[1];
2084 +-
2085 +- chan++;
2086 ++ chan[channel] = ad7124_channel_template;
2087 ++ chan[channel].address = channel;
2088 ++ chan[channel].scan_index = channel;
2089 ++ chan[channel].channel = ain[0];
2090 ++ chan[channel].channel2 = ain[1];
2091 + }
2092 +
2093 + return 0;
2094 +diff --git a/drivers/iio/chemical/Kconfig b/drivers/iio/chemical/Kconfig
2095 +index fa4586037bb8..0b91de4df8f4 100644
2096 +--- a/drivers/iio/chemical/Kconfig
2097 ++++ b/drivers/iio/chemical/Kconfig
2098 +@@ -65,6 +65,7 @@ config IAQCORE
2099 + config PMS7003
2100 + tristate "Plantower PMS7003 particulate matter sensor"
2101 + depends on SERIAL_DEV_BUS
2102 ++ select IIO_BUFFER
2103 + select IIO_TRIGGERED_BUFFER
2104 + help
2105 + Say Y here to build support for the Plantower PMS7003 particulate
2106 +diff --git a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
2107 +index 3e0528793d95..057a4b010010 100644
2108 +--- a/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
2109 ++++ b/drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c
2110 +@@ -911,7 +911,8 @@ static int st_lsm6dsx_check_whoami(struct st_lsm6dsx_hw *hw, int id,
2111 +
2112 + for (i = 0; i < ARRAY_SIZE(st_lsm6dsx_sensor_settings); i++) {
2113 + for (j = 0; j < ST_LSM6DSX_MAX_ID; j++) {
2114 +- if (id == st_lsm6dsx_sensor_settings[i].id[j].hw_id)
2115 ++ if (st_lsm6dsx_sensor_settings[i].id[j].name &&
2116 ++ id == st_lsm6dsx_sensor_settings[i].id[j].hw_id)
2117 + break;
2118 + }
2119 + if (j < ST_LSM6DSX_MAX_ID)
2120 +diff --git a/drivers/iio/industrialio-buffer.c b/drivers/iio/industrialio-buffer.c
2121 +index c193d64e5217..112225c0e486 100644
2122 +--- a/drivers/iio/industrialio-buffer.c
2123 ++++ b/drivers/iio/industrialio-buffer.c
2124 +@@ -566,7 +566,7 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev,
2125 + const unsigned long *mask, bool timestamp)
2126 + {
2127 + unsigned bytes = 0;
2128 +- int length, i;
2129 ++ int length, i, largest = 0;
2130 +
2131 + /* How much space will the demuxed element take? */
2132 + for_each_set_bit(i, mask,
2133 +@@ -574,13 +574,17 @@ static int iio_compute_scan_bytes(struct iio_dev *indio_dev,
2134 + length = iio_storage_bytes_for_si(indio_dev, i);
2135 + bytes = ALIGN(bytes, length);
2136 + bytes += length;
2137 ++ largest = max(largest, length);
2138 + }
2139 +
2140 + if (timestamp) {
2141 + length = iio_storage_bytes_for_timestamp(indio_dev);
2142 + bytes = ALIGN(bytes, length);
2143 + bytes += length;
2144 ++ largest = max(largest, length);
2145 + }
2146 ++
2147 ++ bytes = ALIGN(bytes, largest);
2148 + return bytes;
2149 + }
2150 +
2151 +diff --git a/drivers/iio/light/vcnl4000.c b/drivers/iio/light/vcnl4000.c
2152 +index 16dacea9eadf..b0e241aaefb4 100644
2153 +--- a/drivers/iio/light/vcnl4000.c
2154 ++++ b/drivers/iio/light/vcnl4000.c
2155 +@@ -163,7 +163,6 @@ static int vcnl4200_init(struct vcnl4000_data *data)
2156 + if (ret < 0)
2157 + return ret;
2158 +
2159 +- data->al_scale = 24000;
2160 + data->vcnl4200_al.reg = VCNL4200_AL_DATA;
2161 + data->vcnl4200_ps.reg = VCNL4200_PS_DATA;
2162 + switch (id) {
2163 +@@ -172,11 +171,13 @@ static int vcnl4200_init(struct vcnl4000_data *data)
2164 + /* show 54ms in total. */
2165 + data->vcnl4200_al.sampling_rate = ktime_set(0, 54000 * 1000);
2166 + data->vcnl4200_ps.sampling_rate = ktime_set(0, 4200 * 1000);
2167 ++ data->al_scale = 24000;
2168 + break;
2169 + case VCNL4040_PROD_ID:
2170 + /* Integration time is 80ms, add 10ms. */
2171 + data->vcnl4200_al.sampling_rate = ktime_set(0, 100000 * 1000);
2172 + data->vcnl4200_ps.sampling_rate = ktime_set(0, 100000 * 1000);
2173 ++ data->al_scale = 120000;
2174 + break;
2175 + }
2176 + data->vcnl4200_al.last_measurement = ktime_set(0, 0);
2177 +diff --git a/drivers/irqchip/Kconfig b/drivers/irqchip/Kconfig
2178 +index ccbb8973a324..97f9c001d8ff 100644
2179 +--- a/drivers/irqchip/Kconfig
2180 ++++ b/drivers/irqchip/Kconfig
2181 +@@ -483,8 +483,6 @@ config TI_SCI_INTA_IRQCHIP
2182 + If you wish to use interrupt aggregator irq resources managed by the
2183 + TI System Controller, say Y here. Otherwise, say N.
2184 +
2185 +-endmenu
2186 +-
2187 + config SIFIVE_PLIC
2188 + bool "SiFive Platform-Level Interrupt Controller"
2189 + depends on RISCV
2190 +@@ -496,3 +494,5 @@ config SIFIVE_PLIC
2191 + interrupt sources are subordinate to the PLIC.
2192 +
2193 + If you don't know what to do here, say Y.
2194 ++
2195 ++endmenu
2196 +diff --git a/drivers/md/dm-snap-persistent.c b/drivers/md/dm-snap-persistent.c
2197 +index 3c50c4e4da8f..963d3774c93e 100644
2198 +--- a/drivers/md/dm-snap-persistent.c
2199 ++++ b/drivers/md/dm-snap-persistent.c
2200 +@@ -17,7 +17,7 @@
2201 + #include <linux/dm-bufio.h>
2202 +
2203 + #define DM_MSG_PREFIX "persistent snapshot"
2204 +-#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32 /* 16KB */
2205 ++#define DM_CHUNK_SIZE_DEFAULT_SECTORS 32U /* 16KB */
2206 +
2207 + #define DM_PREFETCH_CHUNKS 12
2208 +
2209 +diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
2210 +index b7c20979bd19..322386ff5d22 100644
2211 +--- a/drivers/md/raid0.c
2212 ++++ b/drivers/md/raid0.c
2213 +@@ -87,7 +87,7 @@ static int create_strip_zones(struct mddev *mddev, struct r0conf **private_conf)
2214 + char b[BDEVNAME_SIZE];
2215 + char b2[BDEVNAME_SIZE];
2216 + struct r0conf *conf = kzalloc(sizeof(*conf), GFP_KERNEL);
2217 +- unsigned short blksize = 512;
2218 ++ unsigned blksize = 512;
2219 +
2220 + *private_conf = ERR_PTR(-ENOMEM);
2221 + if (!conf)
2222 +diff --git a/drivers/message/fusion/mptctl.c b/drivers/message/fusion/mptctl.c
2223 +index f9ac22413000..1074b882c57c 100644
2224 +--- a/drivers/message/fusion/mptctl.c
2225 ++++ b/drivers/message/fusion/mptctl.c
2226 +@@ -100,19 +100,19 @@ struct buflist {
2227 + * Function prototypes. Called from OS entry point mptctl_ioctl.
2228 + * arg contents specific to function.
2229 + */
2230 +-static int mptctl_fw_download(unsigned long arg);
2231 +-static int mptctl_getiocinfo(unsigned long arg, unsigned int cmd);
2232 +-static int mptctl_gettargetinfo(unsigned long arg);
2233 +-static int mptctl_readtest(unsigned long arg);
2234 +-static int mptctl_mpt_command(unsigned long arg);
2235 +-static int mptctl_eventquery(unsigned long arg);
2236 +-static int mptctl_eventenable(unsigned long arg);
2237 +-static int mptctl_eventreport(unsigned long arg);
2238 +-static int mptctl_replace_fw(unsigned long arg);
2239 +-
2240 +-static int mptctl_do_reset(unsigned long arg);
2241 +-static int mptctl_hp_hostinfo(unsigned long arg, unsigned int cmd);
2242 +-static int mptctl_hp_targetinfo(unsigned long arg);
2243 ++static int mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg);
2244 ++static int mptctl_getiocinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd);
2245 ++static int mptctl_gettargetinfo(MPT_ADAPTER *iocp, unsigned long arg);
2246 ++static int mptctl_readtest(MPT_ADAPTER *iocp, unsigned long arg);
2247 ++static int mptctl_mpt_command(MPT_ADAPTER *iocp, unsigned long arg);
2248 ++static int mptctl_eventquery(MPT_ADAPTER *iocp, unsigned long arg);
2249 ++static int mptctl_eventenable(MPT_ADAPTER *iocp, unsigned long arg);
2250 ++static int mptctl_eventreport(MPT_ADAPTER *iocp, unsigned long arg);
2251 ++static int mptctl_replace_fw(MPT_ADAPTER *iocp, unsigned long arg);
2252 ++
2253 ++static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg);
2254 ++static int mptctl_hp_hostinfo(MPT_ADAPTER *iocp, unsigned long arg, unsigned int cmd);
2255 ++static int mptctl_hp_targetinfo(MPT_ADAPTER *iocp, unsigned long arg);
2256 +
2257 + static int mptctl_probe(struct pci_dev *, const struct pci_device_id *);
2258 + static void mptctl_remove(struct pci_dev *);
2259 +@@ -123,8 +123,8 @@ static long compat_mpctl_ioctl(struct file *f, unsigned cmd, unsigned long arg);
2260 + /*
2261 + * Private function calls.
2262 + */
2263 +-static int mptctl_do_mpt_command(struct mpt_ioctl_command karg, void __user *mfPtr);
2264 +-static int mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen);
2265 ++static int mptctl_do_mpt_command(MPT_ADAPTER *iocp, struct mpt_ioctl_command karg, void __user *mfPtr);
2266 ++static int mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen);
2267 + static MptSge_t *kbuf_alloc_2_sgl(int bytes, u32 dir, int sge_offset, int *frags,
2268 + struct buflist **blp, dma_addr_t *sglbuf_dma, MPT_ADAPTER *ioc);
2269 + static void kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma,
2270 +@@ -656,19 +656,19 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2271 + * by TM and FW reloads.
2272 + */
2273 + if ((cmd & ~IOCSIZE_MASK) == (MPTIOCINFO & ~IOCSIZE_MASK)) {
2274 +- return mptctl_getiocinfo(arg, _IOC_SIZE(cmd));
2275 ++ return mptctl_getiocinfo(iocp, arg, _IOC_SIZE(cmd));
2276 + } else if (cmd == MPTTARGETINFO) {
2277 +- return mptctl_gettargetinfo(arg);
2278 ++ return mptctl_gettargetinfo(iocp, arg);
2279 + } else if (cmd == MPTTEST) {
2280 +- return mptctl_readtest(arg);
2281 ++ return mptctl_readtest(iocp, arg);
2282 + } else if (cmd == MPTEVENTQUERY) {
2283 +- return mptctl_eventquery(arg);
2284 ++ return mptctl_eventquery(iocp, arg);
2285 + } else if (cmd == MPTEVENTENABLE) {
2286 +- return mptctl_eventenable(arg);
2287 ++ return mptctl_eventenable(iocp, arg);
2288 + } else if (cmd == MPTEVENTREPORT) {
2289 +- return mptctl_eventreport(arg);
2290 ++ return mptctl_eventreport(iocp, arg);
2291 + } else if (cmd == MPTFWREPLACE) {
2292 +- return mptctl_replace_fw(arg);
2293 ++ return mptctl_replace_fw(iocp, arg);
2294 + }
2295 +
2296 + /* All of these commands require an interrupt or
2297 +@@ -678,15 +678,15 @@ __mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2298 + return ret;
2299 +
2300 + if (cmd == MPTFWDOWNLOAD)
2301 +- ret = mptctl_fw_download(arg);
2302 ++ ret = mptctl_fw_download(iocp, arg);
2303 + else if (cmd == MPTCOMMAND)
2304 +- ret = mptctl_mpt_command(arg);
2305 ++ ret = mptctl_mpt_command(iocp, arg);
2306 + else if (cmd == MPTHARDRESET)
2307 +- ret = mptctl_do_reset(arg);
2308 ++ ret = mptctl_do_reset(iocp, arg);
2309 + else if ((cmd & ~IOCSIZE_MASK) == (HP_GETHOSTINFO & ~IOCSIZE_MASK))
2310 +- ret = mptctl_hp_hostinfo(arg, _IOC_SIZE(cmd));
2311 ++ ret = mptctl_hp_hostinfo(iocp, arg, _IOC_SIZE(cmd));
2312 + else if (cmd == HP_GETTARGETINFO)
2313 +- ret = mptctl_hp_targetinfo(arg);
2314 ++ ret = mptctl_hp_targetinfo(iocp, arg);
2315 + else
2316 + ret = -EINVAL;
2317 +
2318 +@@ -705,11 +705,10 @@ mptctl_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
2319 + return ret;
2320 + }
2321 +
2322 +-static int mptctl_do_reset(unsigned long arg)
2323 ++static int mptctl_do_reset(MPT_ADAPTER *iocp, unsigned long arg)
2324 + {
2325 + struct mpt_ioctl_diag_reset __user *urinfo = (void __user *) arg;
2326 + struct mpt_ioctl_diag_reset krinfo;
2327 +- MPT_ADAPTER *iocp;
2328 +
2329 + if (copy_from_user(&krinfo, urinfo, sizeof(struct mpt_ioctl_diag_reset))) {
2330 + printk(KERN_ERR MYNAM "%s@%d::mptctl_do_reset - "
2331 +@@ -718,12 +717,6 @@ static int mptctl_do_reset(unsigned long arg)
2332 + return -EFAULT;
2333 + }
2334 +
2335 +- if (mpt_verify_adapter(krinfo.hdr.iocnum, &iocp) < 0) {
2336 +- printk(KERN_DEBUG MYNAM "%s@%d::mptctl_do_reset - ioc%d not found!\n",
2337 +- __FILE__, __LINE__, krinfo.hdr.iocnum);
2338 +- return -ENODEV; /* (-6) No such device or address */
2339 +- }
2340 +-
2341 + dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "mptctl_do_reset called.\n",
2342 + iocp->name));
2343 +
2344 +@@ -754,7 +747,7 @@ static int mptctl_do_reset(unsigned long arg)
2345 + * -ENOMSG if FW upload returned bad status
2346 + */
2347 + static int
2348 +-mptctl_fw_download(unsigned long arg)
2349 ++mptctl_fw_download(MPT_ADAPTER *iocp, unsigned long arg)
2350 + {
2351 + struct mpt_fw_xfer __user *ufwdl = (void __user *) arg;
2352 + struct mpt_fw_xfer kfwdl;
2353 +@@ -766,7 +759,7 @@ mptctl_fw_download(unsigned long arg)
2354 + return -EFAULT;
2355 + }
2356 +
2357 +- return mptctl_do_fw_download(kfwdl.iocnum, kfwdl.bufp, kfwdl.fwlen);
2358 ++ return mptctl_do_fw_download(iocp, kfwdl.bufp, kfwdl.fwlen);
2359 + }
2360 +
2361 + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
2362 +@@ -784,11 +777,10 @@ mptctl_fw_download(unsigned long arg)
2363 + * -ENOMSG if FW upload returned bad status
2364 + */
2365 + static int
2366 +-mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
2367 ++mptctl_do_fw_download(MPT_ADAPTER *iocp, char __user *ufwbuf, size_t fwlen)
2368 + {
2369 + FWDownload_t *dlmsg;
2370 + MPT_FRAME_HDR *mf;
2371 +- MPT_ADAPTER *iocp;
2372 + FWDownloadTCSGE_t *ptsge;
2373 + MptSge_t *sgl, *sgIn;
2374 + char *sgOut;
2375 +@@ -808,17 +800,10 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
2376 + pFWDownloadReply_t ReplyMsg = NULL;
2377 + unsigned long timeleft;
2378 +
2379 +- if (mpt_verify_adapter(ioc, &iocp) < 0) {
2380 +- printk(KERN_DEBUG MYNAM "ioctl_fwdl - ioc%d not found!\n",
2381 +- ioc);
2382 +- return -ENODEV; /* (-6) No such device or address */
2383 +- } else {
2384 +-
2385 +- /* Valid device. Get a message frame and construct the FW download message.
2386 +- */
2387 +- if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL)
2388 +- return -EAGAIN;
2389 +- }
2390 ++ /* Valid device. Get a message frame and construct the FW download message.
2391 ++ */
2392 ++ if ((mf = mpt_get_msg_frame(mptctl_id, iocp)) == NULL)
2393 ++ return -EAGAIN;
2394 +
2395 + dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT
2396 + "mptctl_do_fwdl called. mptctl_id = %xh.\n", iocp->name, mptctl_id));
2397 +@@ -826,8 +811,6 @@ mptctl_do_fw_download(int ioc, char __user *ufwbuf, size_t fwlen)
2398 + iocp->name, ufwbuf));
2399 + dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.fwlen = %d\n",
2400 + iocp->name, (int)fwlen));
2401 +- dctlprintk(iocp, printk(MYIOC_s_DEBUG_FMT "DbG: kfwdl.ioc = %04xh\n",
2402 +- iocp->name, ioc));
2403 +
2404 + dlmsg = (FWDownload_t*) mf;
2405 + ptsge = (FWDownloadTCSGE_t *) &dlmsg->SGL;
2406 +@@ -1238,13 +1221,11 @@ kfree_sgl(MptSge_t *sgl, dma_addr_t sgl_dma, struct buflist *buflist, MPT_ADAPTE
2407 + * -ENODEV if no such device/adapter
2408 + */
2409 + static int
2410 +-mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
2411 ++mptctl_getiocinfo (MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
2412 + {
2413 + struct mpt_ioctl_iocinfo __user *uarg = (void __user *) arg;
2414 + struct mpt_ioctl_iocinfo *karg;
2415 +- MPT_ADAPTER *ioc;
2416 + struct pci_dev *pdev;
2417 +- int iocnum;
2418 + unsigned int port;
2419 + int cim_rev;
2420 + struct scsi_device *sdev;
2421 +@@ -1272,14 +1253,6 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
2422 + return PTR_ERR(karg);
2423 + }
2424 +
2425 +- if (((iocnum = mpt_verify_adapter(karg->hdr.iocnum, &ioc)) < 0) ||
2426 +- (ioc == NULL)) {
2427 +- printk(KERN_DEBUG MYNAM "%s::mptctl_getiocinfo() @%d - ioc%d not found!\n",
2428 +- __FILE__, __LINE__, iocnum);
2429 +- kfree(karg);
2430 +- return -ENODEV;
2431 +- }
2432 +-
2433 + /* Verify the data transfer size is correct. */
2434 + if (karg->hdr.maxDataSize != data_size) {
2435 + printk(MYIOC_s_ERR_FMT "%s@%d::mptctl_getiocinfo - "
2436 +@@ -1385,15 +1358,13 @@ mptctl_getiocinfo (unsigned long arg, unsigned int data_size)
2437 + * -ENODEV if no such device/adapter
2438 + */
2439 + static int
2440 +-mptctl_gettargetinfo (unsigned long arg)
2441 ++mptctl_gettargetinfo (MPT_ADAPTER *ioc, unsigned long arg)
2442 + {
2443 + struct mpt_ioctl_targetinfo __user *uarg = (void __user *) arg;
2444 + struct mpt_ioctl_targetinfo karg;
2445 +- MPT_ADAPTER *ioc;
2446 + VirtDevice *vdevice;
2447 + char *pmem;
2448 + int *pdata;
2449 +- int iocnum;
2450 + int numDevices = 0;
2451 + int lun;
2452 + int maxWordsLeft;
2453 +@@ -1408,13 +1379,6 @@ mptctl_gettargetinfo (unsigned long arg)
2454 + return -EFAULT;
2455 + }
2456 +
2457 +- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2458 +- (ioc == NULL)) {
2459 +- printk(KERN_DEBUG MYNAM "%s::mptctl_gettargetinfo() @%d - ioc%d not found!\n",
2460 +- __FILE__, __LINE__, iocnum);
2461 +- return -ENODEV;
2462 +- }
2463 +-
2464 + dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_gettargetinfo called.\n",
2465 + ioc->name));
2466 + /* Get the port number and set the maximum number of bytes
2467 +@@ -1510,12 +1474,10 @@ mptctl_gettargetinfo (unsigned long arg)
2468 + * -ENODEV if no such device/adapter
2469 + */
2470 + static int
2471 +-mptctl_readtest (unsigned long arg)
2472 ++mptctl_readtest (MPT_ADAPTER *ioc, unsigned long arg)
2473 + {
2474 + struct mpt_ioctl_test __user *uarg = (void __user *) arg;
2475 + struct mpt_ioctl_test karg;
2476 +- MPT_ADAPTER *ioc;
2477 +- int iocnum;
2478 +
2479 + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_test))) {
2480 + printk(KERN_ERR MYNAM "%s@%d::mptctl_readtest - "
2481 +@@ -1524,13 +1486,6 @@ mptctl_readtest (unsigned long arg)
2482 + return -EFAULT;
2483 + }
2484 +
2485 +- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2486 +- (ioc == NULL)) {
2487 +- printk(KERN_DEBUG MYNAM "%s::mptctl_readtest() @%d - ioc%d not found!\n",
2488 +- __FILE__, __LINE__, iocnum);
2489 +- return -ENODEV;
2490 +- }
2491 +-
2492 + dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_readtest called.\n",
2493 + ioc->name));
2494 + /* Fill in the data and return the structure to the calling
2495 +@@ -1571,12 +1526,10 @@ mptctl_readtest (unsigned long arg)
2496 + * -ENODEV if no such device/adapter
2497 + */
2498 + static int
2499 +-mptctl_eventquery (unsigned long arg)
2500 ++mptctl_eventquery (MPT_ADAPTER *ioc, unsigned long arg)
2501 + {
2502 + struct mpt_ioctl_eventquery __user *uarg = (void __user *) arg;
2503 + struct mpt_ioctl_eventquery karg;
2504 +- MPT_ADAPTER *ioc;
2505 +- int iocnum;
2506 +
2507 + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventquery))) {
2508 + printk(KERN_ERR MYNAM "%s@%d::mptctl_eventquery - "
2509 +@@ -1585,13 +1538,6 @@ mptctl_eventquery (unsigned long arg)
2510 + return -EFAULT;
2511 + }
2512 +
2513 +- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2514 +- (ioc == NULL)) {
2515 +- printk(KERN_DEBUG MYNAM "%s::mptctl_eventquery() @%d - ioc%d not found!\n",
2516 +- __FILE__, __LINE__, iocnum);
2517 +- return -ENODEV;
2518 +- }
2519 +-
2520 + dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventquery called.\n",
2521 + ioc->name));
2522 + karg.eventEntries = MPTCTL_EVENT_LOG_SIZE;
2523 +@@ -1610,12 +1556,10 @@ mptctl_eventquery (unsigned long arg)
2524 +
2525 + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
2526 + static int
2527 +-mptctl_eventenable (unsigned long arg)
2528 ++mptctl_eventenable (MPT_ADAPTER *ioc, unsigned long arg)
2529 + {
2530 + struct mpt_ioctl_eventenable __user *uarg = (void __user *) arg;
2531 + struct mpt_ioctl_eventenable karg;
2532 +- MPT_ADAPTER *ioc;
2533 +- int iocnum;
2534 +
2535 + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventenable))) {
2536 + printk(KERN_ERR MYNAM "%s@%d::mptctl_eventenable - "
2537 +@@ -1624,13 +1568,6 @@ mptctl_eventenable (unsigned long arg)
2538 + return -EFAULT;
2539 + }
2540 +
2541 +- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2542 +- (ioc == NULL)) {
2543 +- printk(KERN_DEBUG MYNAM "%s::mptctl_eventenable() @%d - ioc%d not found!\n",
2544 +- __FILE__, __LINE__, iocnum);
2545 +- return -ENODEV;
2546 +- }
2547 +-
2548 + dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventenable called.\n",
2549 + ioc->name));
2550 + if (ioc->events == NULL) {
2551 +@@ -1658,12 +1595,10 @@ mptctl_eventenable (unsigned long arg)
2552 +
2553 + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
2554 + static int
2555 +-mptctl_eventreport (unsigned long arg)
2556 ++mptctl_eventreport (MPT_ADAPTER *ioc, unsigned long arg)
2557 + {
2558 + struct mpt_ioctl_eventreport __user *uarg = (void __user *) arg;
2559 + struct mpt_ioctl_eventreport karg;
2560 +- MPT_ADAPTER *ioc;
2561 +- int iocnum;
2562 + int numBytes, maxEvents, max;
2563 +
2564 + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_eventreport))) {
2565 +@@ -1673,12 +1608,6 @@ mptctl_eventreport (unsigned long arg)
2566 + return -EFAULT;
2567 + }
2568 +
2569 +- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2570 +- (ioc == NULL)) {
2571 +- printk(KERN_DEBUG MYNAM "%s::mptctl_eventreport() @%d - ioc%d not found!\n",
2572 +- __FILE__, __LINE__, iocnum);
2573 +- return -ENODEV;
2574 +- }
2575 + dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_eventreport called.\n",
2576 + ioc->name));
2577 +
2578 +@@ -1712,12 +1641,10 @@ mptctl_eventreport (unsigned long arg)
2579 +
2580 + /*=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
2581 + static int
2582 +-mptctl_replace_fw (unsigned long arg)
2583 ++mptctl_replace_fw (MPT_ADAPTER *ioc, unsigned long arg)
2584 + {
2585 + struct mpt_ioctl_replace_fw __user *uarg = (void __user *) arg;
2586 + struct mpt_ioctl_replace_fw karg;
2587 +- MPT_ADAPTER *ioc;
2588 +- int iocnum;
2589 + int newFwSize;
2590 +
2591 + if (copy_from_user(&karg, uarg, sizeof(struct mpt_ioctl_replace_fw))) {
2592 +@@ -1727,13 +1654,6 @@ mptctl_replace_fw (unsigned long arg)
2593 + return -EFAULT;
2594 + }
2595 +
2596 +- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2597 +- (ioc == NULL)) {
2598 +- printk(KERN_DEBUG MYNAM "%s::mptctl_replace_fw() @%d - ioc%d not found!\n",
2599 +- __FILE__, __LINE__, iocnum);
2600 +- return -ENODEV;
2601 +- }
2602 +-
2603 + dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_replace_fw called.\n",
2604 + ioc->name));
2605 + /* If caching FW, Free the old FW image
2606 +@@ -1780,12 +1700,10 @@ mptctl_replace_fw (unsigned long arg)
2607 + * -ENOMEM if memory allocation error
2608 + */
2609 + static int
2610 +-mptctl_mpt_command (unsigned long arg)
2611 ++mptctl_mpt_command (MPT_ADAPTER *ioc, unsigned long arg)
2612 + {
2613 + struct mpt_ioctl_command __user *uarg = (void __user *) arg;
2614 + struct mpt_ioctl_command karg;
2615 +- MPT_ADAPTER *ioc;
2616 +- int iocnum;
2617 + int rc;
2618 +
2619 +
2620 +@@ -1796,14 +1714,7 @@ mptctl_mpt_command (unsigned long arg)
2621 + return -EFAULT;
2622 + }
2623 +
2624 +- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2625 +- (ioc == NULL)) {
2626 +- printk(KERN_DEBUG MYNAM "%s::mptctl_mpt_command() @%d - ioc%d not found!\n",
2627 +- __FILE__, __LINE__, iocnum);
2628 +- return -ENODEV;
2629 +- }
2630 +-
2631 +- rc = mptctl_do_mpt_command (karg, &uarg->MF);
2632 ++ rc = mptctl_do_mpt_command (ioc, karg, &uarg->MF);
2633 +
2634 + return rc;
2635 + }
2636 +@@ -1821,9 +1732,8 @@ mptctl_mpt_command (unsigned long arg)
2637 + * -EPERM if SCSI I/O and target is untagged
2638 + */
2639 + static int
2640 +-mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
2641 ++mptctl_do_mpt_command (MPT_ADAPTER *ioc, struct mpt_ioctl_command karg, void __user *mfPtr)
2642 + {
2643 +- MPT_ADAPTER *ioc;
2644 + MPT_FRAME_HDR *mf = NULL;
2645 + MPIHeader_t *hdr;
2646 + char *psge;
2647 +@@ -1832,7 +1742,7 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
2648 + dma_addr_t dma_addr_in;
2649 + dma_addr_t dma_addr_out;
2650 + int sgSize = 0; /* Num SG elements */
2651 +- int iocnum, flagsLength;
2652 ++ int flagsLength;
2653 + int sz, rc = 0;
2654 + int msgContext;
2655 + u16 req_idx;
2656 +@@ -1847,13 +1757,6 @@ mptctl_do_mpt_command (struct mpt_ioctl_command karg, void __user *mfPtr)
2657 + bufIn.kptr = bufOut.kptr = NULL;
2658 + bufIn.len = bufOut.len = 0;
2659 +
2660 +- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2661 +- (ioc == NULL)) {
2662 +- printk(KERN_DEBUG MYNAM "%s::mptctl_do_mpt_command() @%d - ioc%d not found!\n",
2663 +- __FILE__, __LINE__, iocnum);
2664 +- return -ENODEV;
2665 +- }
2666 +-
2667 + spin_lock_irqsave(&ioc->taskmgmt_lock, flags);
2668 + if (ioc->ioc_reset_in_progress) {
2669 + spin_unlock_irqrestore(&ioc->taskmgmt_lock, flags);
2670 +@@ -2418,17 +2321,15 @@ done_free_mem:
2671 + * -ENOMEM if memory allocation error
2672 + */
2673 + static int
2674 +-mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
2675 ++mptctl_hp_hostinfo(MPT_ADAPTER *ioc, unsigned long arg, unsigned int data_size)
2676 + {
2677 + hp_host_info_t __user *uarg = (void __user *) arg;
2678 +- MPT_ADAPTER *ioc;
2679 + struct pci_dev *pdev;
2680 + char *pbuf=NULL;
2681 + dma_addr_t buf_dma;
2682 + hp_host_info_t karg;
2683 + CONFIGPARMS cfg;
2684 + ConfigPageHeader_t hdr;
2685 +- int iocnum;
2686 + int rc, cim_rev;
2687 + ToolboxIstwiReadWriteRequest_t *IstwiRWRequest;
2688 + MPT_FRAME_HDR *mf = NULL;
2689 +@@ -2452,12 +2353,6 @@ mptctl_hp_hostinfo(unsigned long arg, unsigned int data_size)
2690 + return -EFAULT;
2691 + }
2692 +
2693 +- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2694 +- (ioc == NULL)) {
2695 +- printk(KERN_DEBUG MYNAM "%s::mptctl_hp_hostinfo() @%d - ioc%d not found!\n",
2696 +- __FILE__, __LINE__, iocnum);
2697 +- return -ENODEV;
2698 +- }
2699 + dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT ": mptctl_hp_hostinfo called.\n",
2700 + ioc->name));
2701 +
2702 +@@ -2659,15 +2554,13 @@ retry_wait:
2703 + * -ENOMEM if memory allocation error
2704 + */
2705 + static int
2706 +-mptctl_hp_targetinfo(unsigned long arg)
2707 ++mptctl_hp_targetinfo(MPT_ADAPTER *ioc, unsigned long arg)
2708 + {
2709 + hp_target_info_t __user *uarg = (void __user *) arg;
2710 + SCSIDevicePage0_t *pg0_alloc;
2711 + SCSIDevicePage3_t *pg3_alloc;
2712 +- MPT_ADAPTER *ioc;
2713 + MPT_SCSI_HOST *hd = NULL;
2714 + hp_target_info_t karg;
2715 +- int iocnum;
2716 + int data_sz;
2717 + dma_addr_t page_dma;
2718 + CONFIGPARMS cfg;
2719 +@@ -2681,12 +2574,6 @@ mptctl_hp_targetinfo(unsigned long arg)
2720 + return -EFAULT;
2721 + }
2722 +
2723 +- if (((iocnum = mpt_verify_adapter(karg.hdr.iocnum, &ioc)) < 0) ||
2724 +- (ioc == NULL)) {
2725 +- printk(KERN_DEBUG MYNAM "%s::mptctl_hp_targetinfo() @%d - ioc%d not found!\n",
2726 +- __FILE__, __LINE__, iocnum);
2727 +- return -ENODEV;
2728 +- }
2729 + if (karg.hdr.id >= MPT_MAX_FC_DEVICES)
2730 + return -EINVAL;
2731 + dctlprintk(ioc, printk(MYIOC_s_DEBUG_FMT "mptctl_hp_targetinfo called.\n",
2732 +@@ -2854,7 +2741,7 @@ compat_mptfwxfer_ioctl(struct file *filp, unsigned int cmd,
2733 + kfw.fwlen = kfw32.fwlen;
2734 + kfw.bufp = compat_ptr(kfw32.bufp);
2735 +
2736 +- ret = mptctl_do_fw_download(kfw.iocnum, kfw.bufp, kfw.fwlen);
2737 ++ ret = mptctl_do_fw_download(iocp, kfw.bufp, kfw.fwlen);
2738 +
2739 + mutex_unlock(&iocp->ioctl_cmds.mutex);
2740 +
2741 +@@ -2908,7 +2795,7 @@ compat_mpt_command(struct file *filp, unsigned int cmd,
2742 +
2743 + /* Pass new structure to do_mpt_command
2744 + */
2745 +- ret = mptctl_do_mpt_command (karg, &uarg->MF);
2746 ++ ret = mptctl_do_mpt_command (iocp, karg, &uarg->MF);
2747 +
2748 + mutex_unlock(&iocp->ioctl_cmds.mutex);
2749 +
2750 +diff --git a/drivers/mtd/chips/cfi_cmdset_0002.c b/drivers/mtd/chips/cfi_cmdset_0002.c
2751 +index cf8c8be40a9c..a4f2d8cdca12 100644
2752 +--- a/drivers/mtd/chips/cfi_cmdset_0002.c
2753 ++++ b/drivers/mtd/chips/cfi_cmdset_0002.c
2754 +@@ -123,19 +123,23 @@ static int cfi_use_status_reg(struct cfi_private *cfi)
2755 + (extp->SoftwareFeatures & poll_mask) == CFI_POLL_STATUS_REG;
2756 + }
2757 +
2758 +-static void cfi_check_err_status(struct map_info *map, struct flchip *chip,
2759 +- unsigned long adr)
2760 ++static int cfi_check_err_status(struct map_info *map, struct flchip *chip,
2761 ++ unsigned long adr)
2762 + {
2763 + struct cfi_private *cfi = map->fldrv_priv;
2764 + map_word status;
2765 +
2766 + if (!cfi_use_status_reg(cfi))
2767 +- return;
2768 ++ return 0;
2769 +
2770 + cfi_send_gen_cmd(0x70, cfi->addr_unlock1, chip->start, map, cfi,
2771 + cfi->device_type, NULL);
2772 + status = map_read(map, adr);
2773 +
2774 ++ /* The error bits are invalid while the chip's busy */
2775 ++ if (!map_word_bitsset(map, status, CMD(CFI_SR_DRB)))
2776 ++ return 0;
2777 ++
2778 + if (map_word_bitsset(map, status, CMD(0x3a))) {
2779 + unsigned long chipstatus = MERGESTATUS(status);
2780 +
2781 +@@ -151,7 +155,12 @@ static void cfi_check_err_status(struct map_info *map, struct flchip *chip,
2782 + if (chipstatus & CFI_SR_SLSB)
2783 + pr_err("%s sector write protected, status %lx\n",
2784 + map->name, chipstatus);
2785 ++
2786 ++ /* Erase/Program status bits are set on the operation failure */
2787 ++ if (chipstatus & (CFI_SR_ESB | CFI_SR_PSB))
2788 ++ return 1;
2789 + }
2790 ++ return 0;
2791 + }
2792 +
2793 + /* #define DEBUG_CFI_FEATURES */
2794 +@@ -848,20 +857,16 @@ static int __xipram chip_good(struct map_info *map, struct flchip *chip,
2795 +
2796 + if (cfi_use_status_reg(cfi)) {
2797 + map_word ready = CMD(CFI_SR_DRB);
2798 +- map_word err = CMD(CFI_SR_PSB | CFI_SR_ESB);
2799 ++
2800 + /*
2801 + * For chips that support status register, check device
2802 +- * ready bit and Erase/Program status bit to know if
2803 +- * operation succeeded.
2804 ++ * ready bit
2805 + */
2806 + cfi_send_gen_cmd(0x70, cfi->addr_unlock1, chip->start, map, cfi,
2807 + cfi->device_type, NULL);
2808 + curd = map_read(map, addr);
2809 +
2810 +- if (map_word_andequal(map, curd, ready, ready))
2811 +- return !map_word_bitsset(map, curd, err);
2812 +-
2813 +- return 0;
2814 ++ return map_word_andequal(map, curd, ready, ready);
2815 + }
2816 +
2817 + oldd = map_read(map, addr);
2818 +@@ -1699,8 +1704,11 @@ static int __xipram do_write_oneword_once(struct map_info *map,
2819 + break;
2820 + }
2821 +
2822 +- if (chip_good(map, chip, adr, datum))
2823 ++ if (chip_good(map, chip, adr, datum)) {
2824 ++ if (cfi_check_err_status(map, chip, adr))
2825 ++ ret = -EIO;
2826 + break;
2827 ++ }
2828 +
2829 + /* Latency issues. Drop the lock, wait a while and retry */
2830 + UDELAY(map, chip, adr, 1);
2831 +@@ -1773,7 +1781,6 @@ static int __xipram do_write_oneword_retry(struct map_info *map,
2832 + ret = do_write_oneword_once(map, chip, adr, datum, mode, cfi);
2833 + if (ret) {
2834 + /* reset on all failures. */
2835 +- cfi_check_err_status(map, chip, adr);
2836 + map_write(map, CMD(0xF0), chip->start);
2837 + /* FIXME - should have reset delay before continuing */
2838 +
2839 +@@ -1970,12 +1977,17 @@ static int __xipram do_write_buffer_wait(struct map_info *map,
2840 + */
2841 + if (time_after(jiffies, timeo) &&
2842 + !chip_good(map, chip, adr, datum)) {
2843 ++ pr_err("MTD %s(): software timeout, address:0x%.8lx.\n",
2844 ++ __func__, adr);
2845 + ret = -EIO;
2846 + break;
2847 + }
2848 +
2849 +- if (chip_good(map, chip, adr, datum))
2850 ++ if (chip_good(map, chip, adr, datum)) {
2851 ++ if (cfi_check_err_status(map, chip, adr))
2852 ++ ret = -EIO;
2853 + break;
2854 ++ }
2855 +
2856 + /* Latency issues. Drop the lock, wait a while and retry */
2857 + UDELAY(map, chip, adr, 1);
2858 +@@ -2071,12 +2083,8 @@ static int __xipram do_write_buffer(struct map_info *map, struct flchip *chip,
2859 + chip->word_write_time);
2860 +
2861 + ret = do_write_buffer_wait(map, chip, adr, datum);
2862 +- if (ret) {
2863 +- cfi_check_err_status(map, chip, adr);
2864 ++ if (ret)
2865 + do_write_buffer_reset(map, chip, cfi);
2866 +- pr_err("MTD %s(): software timeout, address:0x%.8lx.\n",
2867 +- __func__, adr);
2868 +- }
2869 +
2870 + xip_enable(map, chip, adr);
2871 +
2872 +@@ -2271,9 +2279,9 @@ retry:
2873 + udelay(1);
2874 + }
2875 +
2876 +- if (!chip_good(map, chip, adr, datum)) {
2877 ++ if (!chip_good(map, chip, adr, datum) ||
2878 ++ cfi_check_err_status(map, chip, adr)) {
2879 + /* reset on all failures. */
2880 +- cfi_check_err_status(map, chip, adr);
2881 + map_write(map, CMD(0xF0), chip->start);
2882 + /* FIXME - should have reset delay before continuing */
2883 +
2884 +@@ -2467,8 +2475,11 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
2885 + chip->erase_suspended = 0;
2886 + }
2887 +
2888 +- if (chip_good(map, chip, adr, map_word_ff(map)))
2889 ++ if (chip_good(map, chip, adr, map_word_ff(map))) {
2890 ++ if (cfi_check_err_status(map, chip, adr))
2891 ++ ret = -EIO;
2892 + break;
2893 ++ }
2894 +
2895 + if (time_after(jiffies, timeo)) {
2896 + printk(KERN_WARNING "MTD %s(): software timeout\n",
2897 +@@ -2483,7 +2494,6 @@ static int __xipram do_erase_chip(struct map_info *map, struct flchip *chip)
2898 + /* Did we succeed? */
2899 + if (ret) {
2900 + /* reset on all failures. */
2901 +- cfi_check_err_status(map, chip, adr);
2902 + map_write(map, CMD(0xF0), chip->start);
2903 + /* FIXME - should have reset delay before continuing */
2904 +
2905 +@@ -2564,8 +2574,11 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
2906 + chip->erase_suspended = 0;
2907 + }
2908 +
2909 +- if (chip_good(map, chip, adr, map_word_ff(map)))
2910 ++ if (chip_good(map, chip, adr, map_word_ff(map))) {
2911 ++ if (cfi_check_err_status(map, chip, adr))
2912 ++ ret = -EIO;
2913 + break;
2914 ++ }
2915 +
2916 + if (time_after(jiffies, timeo)) {
2917 + printk(KERN_WARNING "MTD %s(): software timeout\n",
2918 +@@ -2580,7 +2593,6 @@ static int __xipram do_erase_oneblock(struct map_info *map, struct flchip *chip,
2919 + /* Did we succeed? */
2920 + if (ret) {
2921 + /* reset on all failures. */
2922 +- cfi_check_err_status(map, chip, adr);
2923 + map_write(map, CMD(0xF0), chip->start);
2924 + /* FIXME - should have reset delay before continuing */
2925 +
2926 +diff --git a/drivers/mtd/devices/mchp23k256.c b/drivers/mtd/devices/mchp23k256.c
2927 +index b20d02b4f830..77c872fd3d83 100644
2928 +--- a/drivers/mtd/devices/mchp23k256.c
2929 ++++ b/drivers/mtd/devices/mchp23k256.c
2930 +@@ -64,15 +64,17 @@ static int mchp23k256_write(struct mtd_info *mtd, loff_t to, size_t len,
2931 + struct spi_transfer transfer[2] = {};
2932 + struct spi_message message;
2933 + unsigned char command[MAX_CMD_SIZE];
2934 +- int ret;
2935 ++ int ret, cmd_len;
2936 +
2937 + spi_message_init(&message);
2938 +
2939 ++ cmd_len = mchp23k256_cmdsz(flash);
2940 ++
2941 + command[0] = MCHP23K256_CMD_WRITE;
2942 + mchp23k256_addr2cmd(flash, to, command);
2943 +
2944 + transfer[0].tx_buf = command;
2945 +- transfer[0].len = mchp23k256_cmdsz(flash);
2946 ++ transfer[0].len = cmd_len;
2947 + spi_message_add_tail(&transfer[0], &message);
2948 +
2949 + transfer[1].tx_buf = buf;
2950 +@@ -88,8 +90,8 @@ static int mchp23k256_write(struct mtd_info *mtd, loff_t to, size_t len,
2951 + if (ret)
2952 + return ret;
2953 +
2954 +- if (retlen && message.actual_length > sizeof(command))
2955 +- *retlen += message.actual_length - sizeof(command);
2956 ++ if (retlen && message.actual_length > cmd_len)
2957 ++ *retlen += message.actual_length - cmd_len;
2958 +
2959 + return 0;
2960 + }
2961 +@@ -101,16 +103,18 @@ static int mchp23k256_read(struct mtd_info *mtd, loff_t from, size_t len,
2962 + struct spi_transfer transfer[2] = {};
2963 + struct spi_message message;
2964 + unsigned char command[MAX_CMD_SIZE];
2965 +- int ret;
2966 ++ int ret, cmd_len;
2967 +
2968 + spi_message_init(&message);
2969 +
2970 ++ cmd_len = mchp23k256_cmdsz(flash);
2971 ++
2972 + memset(&transfer, 0, sizeof(transfer));
2973 + command[0] = MCHP23K256_CMD_READ;
2974 + mchp23k256_addr2cmd(flash, from, command);
2975 +
2976 + transfer[0].tx_buf = command;
2977 +- transfer[0].len = mchp23k256_cmdsz(flash);
2978 ++ transfer[0].len = cmd_len;
2979 + spi_message_add_tail(&transfer[0], &message);
2980 +
2981 + transfer[1].rx_buf = buf;
2982 +@@ -126,8 +130,8 @@ static int mchp23k256_read(struct mtd_info *mtd, loff_t from, size_t len,
2983 + if (ret)
2984 + return ret;
2985 +
2986 +- if (retlen && message.actual_length > sizeof(command))
2987 +- *retlen += message.actual_length - sizeof(command);
2988 ++ if (retlen && message.actual_length > cmd_len)
2989 ++ *retlen += message.actual_length - cmd_len;
2990 +
2991 + return 0;
2992 + }
2993 +diff --git a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
2994 +index 334fe3130285..b9d5d55a5edb 100644
2995 +--- a/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
2996 ++++ b/drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c
2997 +@@ -148,6 +148,10 @@ static int gpmi_init(struct gpmi_nand_data *this)
2998 + struct resources *r = &this->resources;
2999 + int ret;
3000 +
3001 ++ ret = pm_runtime_get_sync(this->dev);
3002 ++ if (ret < 0)
3003 ++ return ret;
3004 ++
3005 + ret = gpmi_reset_block(r->gpmi_regs, false);
3006 + if (ret)
3007 + goto err_out;
3008 +@@ -179,8 +183,9 @@ static int gpmi_init(struct gpmi_nand_data *this)
3009 + */
3010 + writel(BM_GPMI_CTRL1_DECOUPLE_CS, r->gpmi_regs + HW_GPMI_CTRL1_SET);
3011 +
3012 +- return 0;
3013 + err_out:
3014 ++ pm_runtime_mark_last_busy(this->dev);
3015 ++ pm_runtime_put_autosuspend(this->dev);
3016 + return ret;
3017 + }
3018 +
3019 +@@ -2722,6 +2727,10 @@ static int gpmi_pm_resume(struct device *dev)
3020 + return ret;
3021 + }
3022 +
3023 ++ /* Set flag to get timing setup restored for next exec_op */
3024 ++ if (this->hw.clk_rate)
3025 ++ this->hw.must_apply_timings = true;
3026 ++
3027 + /* re-init the BCH registers */
3028 + ret = bch_set_geometry(this);
3029 + if (ret) {
3030 +diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c
3031 +index 1548e0f7f5f4..309c808351ac 100644
3032 +--- a/drivers/mtd/spi-nor/spi-nor.c
3033 ++++ b/drivers/mtd/spi-nor/spi-nor.c
3034 +@@ -4544,9 +4544,7 @@ static void spi_nor_info_init_params(struct spi_nor *nor)
3035 +
3036 + static void spansion_post_sfdp_fixups(struct spi_nor *nor)
3037 + {
3038 +- struct mtd_info *mtd = &nor->mtd;
3039 +-
3040 +- if (mtd->size <= SZ_16M)
3041 ++ if (nor->params.size <= SZ_16M)
3042 + return;
3043 +
3044 + nor->flags |= SNOR_F_4B_OPCODES;
3045 +diff --git a/drivers/net/dsa/bcm_sf2.c b/drivers/net/dsa/bcm_sf2.c
3046 +index 69fc13046ac7..47b21096b577 100644
3047 +--- a/drivers/net/dsa/bcm_sf2.c
3048 ++++ b/drivers/net/dsa/bcm_sf2.c
3049 +@@ -68,7 +68,7 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port)
3050 +
3051 + /* Force link status for IMP port */
3052 + reg = core_readl(priv, offset);
3053 +- reg |= (MII_SW_OR | LINK_STS);
3054 ++ reg |= (MII_SW_OR | LINK_STS | GMII_SPEED_UP_2G);
3055 + core_writel(priv, reg, offset);
3056 +
3057 + /* Enable Broadcast, Multicast, Unicast forwarding to IMP port */
3058 +diff --git a/drivers/net/dsa/sja1105/sja1105_main.c b/drivers/net/dsa/sja1105/sja1105_main.c
3059 +index 7763221286d4..3b51e87a3714 100644
3060 +--- a/drivers/net/dsa/sja1105/sja1105_main.c
3061 ++++ b/drivers/net/dsa/sja1105/sja1105_main.c
3062 +@@ -619,7 +619,7 @@ static int sja1105_parse_ports_node(struct sja1105_private *priv,
3063 + struct device *dev = &priv->spidev->dev;
3064 + struct device_node *child;
3065 +
3066 +- for_each_child_of_node(ports_node, child) {
3067 ++ for_each_available_child_of_node(ports_node, child) {
3068 + struct device_node *phy_node;
3069 + int phy_mode;
3070 + u32 index;
3071 +diff --git a/drivers/net/ethernet/broadcom/bcmsysport.c b/drivers/net/ethernet/broadcom/bcmsysport.c
3072 +index a977a459bd20..b4c664957266 100644
3073 +--- a/drivers/net/ethernet/broadcom/bcmsysport.c
3074 ++++ b/drivers/net/ethernet/broadcom/bcmsysport.c
3075 +@@ -2323,7 +2323,7 @@ static int bcm_sysport_map_queues(struct notifier_block *nb,
3076 + ring->switch_queue = qp;
3077 + ring->switch_port = port;
3078 + ring->inspect = true;
3079 +- priv->ring_map[q + port * num_tx_queues] = ring;
3080 ++ priv->ring_map[qp + port * num_tx_queues] = ring;
3081 + qp++;
3082 + }
3083 +
3084 +@@ -2338,7 +2338,7 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb,
3085 + struct net_device *slave_dev;
3086 + unsigned int num_tx_queues;
3087 + struct net_device *dev;
3088 +- unsigned int q, port;
3089 ++ unsigned int q, qp, port;
3090 +
3091 + priv = container_of(nb, struct bcm_sysport_priv, dsa_notifier);
3092 + if (priv->netdev != info->master)
3093 +@@ -2364,7 +2364,8 @@ static int bcm_sysport_unmap_queues(struct notifier_block *nb,
3094 + continue;
3095 +
3096 + ring->inspect = false;
3097 +- priv->ring_map[q + port * num_tx_queues] = NULL;
3098 ++ qp = ring->switch_queue;
3099 ++ priv->ring_map[qp + port * num_tx_queues] = NULL;
3100 + }
3101 +
3102 + return 0;
3103 +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
3104 +index 5c75b061243f..cf292f7c3d3c 100644
3105 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c
3106 ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c
3107 +@@ -10991,11 +10991,23 @@ static bool bnxt_fltr_match(struct bnxt_ntuple_filter *f1,
3108 + struct flow_keys *keys1 = &f1->fkeys;
3109 + struct flow_keys *keys2 = &f2->fkeys;
3110 +
3111 +- if (keys1->addrs.v4addrs.src == keys2->addrs.v4addrs.src &&
3112 +- keys1->addrs.v4addrs.dst == keys2->addrs.v4addrs.dst &&
3113 +- keys1->ports.ports == keys2->ports.ports &&
3114 +- keys1->basic.ip_proto == keys2->basic.ip_proto &&
3115 +- keys1->basic.n_proto == keys2->basic.n_proto &&
3116 ++ if (keys1->basic.n_proto != keys2->basic.n_proto ||
3117 ++ keys1->basic.ip_proto != keys2->basic.ip_proto)
3118 ++ return false;
3119 ++
3120 ++ if (keys1->basic.n_proto == htons(ETH_P_IP)) {
3121 ++ if (keys1->addrs.v4addrs.src != keys2->addrs.v4addrs.src ||
3122 ++ keys1->addrs.v4addrs.dst != keys2->addrs.v4addrs.dst)
3123 ++ return false;
3124 ++ } else {
3125 ++ if (memcmp(&keys1->addrs.v6addrs.src, &keys2->addrs.v6addrs.src,
3126 ++ sizeof(keys1->addrs.v6addrs.src)) ||
3127 ++ memcmp(&keys1->addrs.v6addrs.dst, &keys2->addrs.v6addrs.dst,
3128 ++ sizeof(keys1->addrs.v6addrs.dst)))
3129 ++ return false;
3130 ++ }
3131 ++
3132 ++ if (keys1->ports.ports == keys2->ports.ports &&
3133 + keys1->control.flags == keys2->control.flags &&
3134 + ether_addr_equal(f1->src_mac_addr, f2->src_mac_addr) &&
3135 + ether_addr_equal(f1->dst_mac_addr, f2->dst_mac_addr))
3136 +@@ -11287,7 +11299,7 @@ int bnxt_get_port_parent_id(struct net_device *dev,
3137 + return -EOPNOTSUPP;
3138 +
3139 + /* The PF and it's VF-reps only support the switchdev framework */
3140 +- if (!BNXT_PF(bp))
3141 ++ if (!BNXT_PF(bp) || !(bp->flags & BNXT_FLAG_DSN_VALID))
3142 + return -EOPNOTSUPP;
3143 +
3144 + ppid->id_len = sizeof(bp->switch_id);
3145 +@@ -11679,6 +11691,7 @@ static int bnxt_pcie_dsn_get(struct bnxt *bp, u8 dsn[])
3146 + put_unaligned_le32(dw, &dsn[0]);
3147 + pci_read_config_dword(pdev, pos + 4, &dw);
3148 + put_unaligned_le32(dw, &dsn[4]);
3149 ++ bp->flags |= BNXT_FLAG_DSN_VALID;
3150 + return 0;
3151 + }
3152 +
3153 +@@ -11790,9 +11803,7 @@ static int bnxt_init_one(struct pci_dev *pdev, const struct pci_device_id *ent)
3154 +
3155 + if (BNXT_PF(bp)) {
3156 + /* Read the adapter's DSN to use as the eswitch switch_id */
3157 +- rc = bnxt_pcie_dsn_get(bp, bp->switch_id);
3158 +- if (rc)
3159 +- goto init_err_pci_clean;
3160 ++ bnxt_pcie_dsn_get(bp, bp->switch_id);
3161 + }
3162 +
3163 + /* MTU range: 60 - FW defined max */
3164 +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.h b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
3165 +index dc26e3ace43f..2e6ad53fdc75 100644
3166 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.h
3167 ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.h
3168 +@@ -1510,6 +1510,7 @@ struct bnxt {
3169 + #define BNXT_FLAG_NO_AGG_RINGS 0x20000
3170 + #define BNXT_FLAG_RX_PAGE_MODE 0x40000
3171 + #define BNXT_FLAG_MULTI_HOST 0x100000
3172 ++ #define BNXT_FLAG_DSN_VALID 0x200000
3173 + #define BNXT_FLAG_DOUBLE_DB 0x400000
3174 + #define BNXT_FLAG_CHIP_NITRO_A0 0x1000000
3175 + #define BNXT_FLAG_DIM 0x2000000
3176 +@@ -1904,9 +1905,6 @@ static inline bool bnxt_cfa_hwrm_message(u16 req_type)
3177 + case HWRM_CFA_ENCAP_RECORD_FREE:
3178 + case HWRM_CFA_DECAP_FILTER_ALLOC:
3179 + case HWRM_CFA_DECAP_FILTER_FREE:
3180 +- case HWRM_CFA_NTUPLE_FILTER_ALLOC:
3181 +- case HWRM_CFA_NTUPLE_FILTER_FREE:
3182 +- case HWRM_CFA_NTUPLE_FILTER_CFG:
3183 + case HWRM_CFA_EM_FLOW_ALLOC:
3184 + case HWRM_CFA_EM_FLOW_FREE:
3185 + case HWRM_CFA_EM_FLOW_CFG:
3186 +diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
3187 +index f9bf7d7250ab..b010b34cdaf8 100644
3188 +--- a/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
3189 ++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt_vfr.c
3190 +@@ -398,6 +398,9 @@ static int bnxt_vf_reps_create(struct bnxt *bp)
3191 + struct net_device *dev;
3192 + int rc, i;
3193 +
3194 ++ if (!(bp->flags & BNXT_FLAG_DSN_VALID))
3195 ++ return -ENODEV;
3196 ++
3197 + bp->vf_reps = kcalloc(num_vfs, sizeof(vf_rep), GFP_KERNEL);
3198 + if (!bp->vf_reps)
3199 + return -ENOMEM;
3200 +diff --git a/drivers/net/ethernet/hisilicon/hns/hns_enet.c b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
3201 +index 14ab20491fd0..eb69e5c81a4d 100644
3202 +--- a/drivers/net/ethernet/hisilicon/hns/hns_enet.c
3203 ++++ b/drivers/net/ethernet/hisilicon/hns/hns_enet.c
3204 +@@ -565,7 +565,6 @@ static int hns_nic_poll_rx_skb(struct hns_nic_ring_data *ring_data,
3205 + skb = *out_skb = napi_alloc_skb(&ring_data->napi,
3206 + HNS_RX_HEAD_SIZE);
3207 + if (unlikely(!skb)) {
3208 +- netdev_err(ndev, "alloc rx skb fail\n");
3209 + ring->stats.sw_err_cnt++;
3210 + return -ENOMEM;
3211 + }
3212 +@@ -1056,7 +1055,6 @@ static int hns_nic_common_poll(struct napi_struct *napi, int budget)
3213 + container_of(napi, struct hns_nic_ring_data, napi);
3214 + struct hnae_ring *ring = ring_data->ring;
3215 +
3216 +-try_again:
3217 + clean_complete += ring_data->poll_one(
3218 + ring_data, budget - clean_complete,
3219 + ring_data->ex_process);
3220 +@@ -1066,7 +1064,7 @@ try_again:
3221 + napi_complete(napi);
3222 + ring->q->handle->dev->ops->toggle_ring_irq(ring, 0);
3223 + } else {
3224 +- goto try_again;
3225 ++ return budget;
3226 + }
3227 + }
3228 +
3229 +diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
3230 +index 84d8816c8681..0c8d2269bc46 100644
3231 +--- a/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
3232 ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
3233 +@@ -54,6 +54,8 @@ MODULE_PARM_DESC(debug, " Network interface message level setting");
3234 + #define HNS3_INNER_VLAN_TAG 1
3235 + #define HNS3_OUTER_VLAN_TAG 2
3236 +
3237 ++#define HNS3_MIN_TX_LEN 33U
3238 ++
3239 + /* hns3_pci_tbl - PCI Device ID Table
3240 + *
3241 + * Last entry must be all 0s
3242 +@@ -1329,6 +1331,10 @@ netdev_tx_t hns3_nic_net_xmit(struct sk_buff *skb, struct net_device *netdev)
3243 + int ret;
3244 + int i;
3245 +
3246 ++ /* Hardware can only handle short frames above 32 bytes */
3247 ++ if (skb_put_padto(skb, HNS3_MIN_TX_LEN))
3248 ++ return NETDEV_TX_OK;
3249 ++
3250 + /* Prefetch the data used later */
3251 + prefetch(skb->data);
3252 +
3253 +diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c
3254 +index 4960c9c3e773..a8dd0228b678 100644
3255 +--- a/drivers/net/ethernet/intel/i40e/i40e_main.c
3256 ++++ b/drivers/net/ethernet/intel/i40e/i40e_main.c
3257 +@@ -7168,6 +7168,7 @@ static int i40e_setup_macvlans(struct i40e_vsi *vsi, u16 macvlan_cnt, u16 qcnt,
3258 + ch->num_queue_pairs = qcnt;
3259 + if (!i40e_setup_channel(pf, vsi, ch)) {
3260 + ret = -EINVAL;
3261 ++ kfree(ch);
3262 + goto err_free;
3263 + }
3264 + ch->parent_vsi = vsi;
3265 +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
3266 +index 3ec18fb0d479..a806c6190bb1 100644
3267 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
3268 ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum.c
3269 +@@ -812,23 +812,17 @@ static netdev_tx_t mlxsw_sp_port_xmit(struct sk_buff *skb,
3270 + u64 len;
3271 + int err;
3272 +
3273 ++ if (skb_cow_head(skb, MLXSW_TXHDR_LEN)) {
3274 ++ this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
3275 ++ dev_kfree_skb_any(skb);
3276 ++ return NETDEV_TX_OK;
3277 ++ }
3278 ++
3279 + memset(skb->cb, 0, sizeof(struct mlxsw_skb_cb));
3280 +
3281 + if (mlxsw_core_skb_transmit_busy(mlxsw_sp->core, &tx_info))
3282 + return NETDEV_TX_BUSY;
3283 +
3284 +- if (unlikely(skb_headroom(skb) < MLXSW_TXHDR_LEN)) {
3285 +- struct sk_buff *skb_orig = skb;
3286 +-
3287 +- skb = skb_realloc_headroom(skb, MLXSW_TXHDR_LEN);
3288 +- if (!skb) {
3289 +- this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
3290 +- dev_kfree_skb_any(skb_orig);
3291 +- return NETDEV_TX_OK;
3292 +- }
3293 +- dev_consume_skb_any(skb_orig);
3294 +- }
3295 +-
3296 + if (eth_skb_pad(skb)) {
3297 + this_cpu_inc(mlxsw_sp_port->pcpu_stats->tx_dropped);
3298 + return NETDEV_TX_OK;
3299 +@@ -1167,6 +1161,9 @@ static void update_stats_cache(struct work_struct *work)
3300 + periodic_hw_stats.update_dw.work);
3301 +
3302 + if (!netif_carrier_ok(mlxsw_sp_port->dev))
3303 ++ /* Note: mlxsw_sp_port_down_wipe_counters() clears the cache as
3304 ++ * necessary when port goes down.
3305 ++ */
3306 + goto out;
3307 +
3308 + mlxsw_sp_port_get_hw_stats(mlxsw_sp_port->dev,
3309 +@@ -4176,6 +4173,15 @@ static int mlxsw_sp_port_unsplit(struct mlxsw_core *mlxsw_core, u8 local_port,
3310 + return 0;
3311 + }
3312 +
3313 ++static void
3314 ++mlxsw_sp_port_down_wipe_counters(struct mlxsw_sp_port *mlxsw_sp_port)
3315 ++{
3316 ++ int i;
3317 ++
3318 ++ for (i = 0; i < TC_MAX_QUEUE; i++)
3319 ++ mlxsw_sp_port->periodic_hw_stats.xstats.backlog[i] = 0;
3320 ++}
3321 ++
3322 + static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg,
3323 + char *pude_pl, void *priv)
3324 + {
3325 +@@ -4197,6 +4203,7 @@ static void mlxsw_sp_pude_event_func(const struct mlxsw_reg_info *reg,
3326 + } else {
3327 + netdev_info(mlxsw_sp_port->dev, "link down\n");
3328 + netif_carrier_off(mlxsw_sp_port->dev);
3329 ++ mlxsw_sp_port_down_wipe_counters(mlxsw_sp_port);
3330 + }
3331 + }
3332 +
3333 +diff --git a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
3334 +index 720514b5c006..dc63583c4948 100644
3335 +--- a/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
3336 ++++ b/drivers/net/ethernet/mellanox/mlxsw/spectrum_qdisc.c
3337 +@@ -195,6 +195,20 @@ mlxsw_sp_qdisc_get_xstats(struct mlxsw_sp_port *mlxsw_sp_port,
3338 + return -EOPNOTSUPP;
3339 + }
3340 +
3341 ++static u64
3342 ++mlxsw_sp_xstats_backlog(struct mlxsw_sp_port_xstats *xstats, int tclass_num)
3343 ++{
3344 ++ return xstats->backlog[tclass_num] +
3345 ++ xstats->backlog[tclass_num + 8];
3346 ++}
3347 ++
3348 ++static u64
3349 ++mlxsw_sp_xstats_tail_drop(struct mlxsw_sp_port_xstats *xstats, int tclass_num)
3350 ++{
3351 ++ return xstats->tail_drop[tclass_num] +
3352 ++ xstats->tail_drop[tclass_num + 8];
3353 ++}
3354 ++
3355 + static void
3356 + mlxsw_sp_qdisc_bstats_per_priority_get(struct mlxsw_sp_port_xstats *xstats,
3357 + u8 prio_bitmap, u64 *tx_packets,
3358 +@@ -269,7 +283,7 @@ mlxsw_sp_setup_tc_qdisc_red_clean_stats(struct mlxsw_sp_port *mlxsw_sp_port,
3359 + &stats_base->tx_bytes);
3360 + red_base->prob_mark = xstats->ecn;
3361 + red_base->prob_drop = xstats->wred_drop[tclass_num];
3362 +- red_base->pdrop = xstats->tail_drop[tclass_num];
3363 ++ red_base->pdrop = mlxsw_sp_xstats_tail_drop(xstats, tclass_num);
3364 +
3365 + stats_base->overlimits = red_base->prob_drop + red_base->prob_mark;
3366 + stats_base->drops = red_base->prob_drop + red_base->pdrop;
3367 +@@ -369,7 +383,8 @@ mlxsw_sp_qdisc_get_red_xstats(struct mlxsw_sp_port *mlxsw_sp_port,
3368 +
3369 + early_drops = xstats->wred_drop[tclass_num] - xstats_base->prob_drop;
3370 + marks = xstats->ecn - xstats_base->prob_mark;
3371 +- pdrops = xstats->tail_drop[tclass_num] - xstats_base->pdrop;
3372 ++ pdrops = mlxsw_sp_xstats_tail_drop(xstats, tclass_num) -
3373 ++ xstats_base->pdrop;
3374 +
3375 + res->pdrop += pdrops;
3376 + res->prob_drop += early_drops;
3377 +@@ -402,9 +417,10 @@ mlxsw_sp_qdisc_get_red_stats(struct mlxsw_sp_port *mlxsw_sp_port,
3378 +
3379 + overlimits = xstats->wred_drop[tclass_num] + xstats->ecn -
3380 + stats_base->overlimits;
3381 +- drops = xstats->wred_drop[tclass_num] + xstats->tail_drop[tclass_num] -
3382 ++ drops = xstats->wred_drop[tclass_num] +
3383 ++ mlxsw_sp_xstats_tail_drop(xstats, tclass_num) -
3384 + stats_base->drops;
3385 +- backlog = xstats->backlog[tclass_num];
3386 ++ backlog = mlxsw_sp_xstats_backlog(xstats, tclass_num);
3387 +
3388 + _bstats_update(stats_ptr->bstats, tx_bytes, tx_packets);
3389 + stats_ptr->qstats->overlimits += overlimits;
3390 +@@ -575,9 +591,9 @@ mlxsw_sp_qdisc_get_prio_stats(struct mlxsw_sp_port *mlxsw_sp_port,
3391 + tx_packets = stats->tx_packets - stats_base->tx_packets;
3392 +
3393 + for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
3394 +- drops += xstats->tail_drop[i];
3395 ++ drops += mlxsw_sp_xstats_tail_drop(xstats, i);
3396 + drops += xstats->wred_drop[i];
3397 +- backlog += xstats->backlog[i];
3398 ++ backlog += mlxsw_sp_xstats_backlog(xstats, i);
3399 + }
3400 + drops = drops - stats_base->drops;
3401 +
3402 +@@ -613,7 +629,7 @@ mlxsw_sp_setup_tc_qdisc_prio_clean_stats(struct mlxsw_sp_port *mlxsw_sp_port,
3403 +
3404 + stats_base->drops = 0;
3405 + for (i = 0; i < IEEE_8021QAZ_MAX_TCS; i++) {
3406 +- stats_base->drops += xstats->tail_drop[i];
3407 ++ stats_base->drops += mlxsw_sp_xstats_tail_drop(xstats, i);
3408 + stats_base->drops += xstats->wred_drop[i];
3409 + }
3410 +
3411 +diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
3412 +index 7ba35a0bdb29..8aa1b1bda96d 100644
3413 +--- a/drivers/net/ethernet/renesas/sh_eth.c
3414 ++++ b/drivers/net/ethernet/renesas/sh_eth.c
3415 +@@ -2204,24 +2204,28 @@ static size_t __sh_eth_get_regs(struct net_device *ndev, u32 *buf)
3416 + if (cd->tsu) {
3417 + add_tsu_reg(ARSTR);
3418 + add_tsu_reg(TSU_CTRST);
3419 +- add_tsu_reg(TSU_FWEN0);
3420 +- add_tsu_reg(TSU_FWEN1);
3421 +- add_tsu_reg(TSU_FCM);
3422 +- add_tsu_reg(TSU_BSYSL0);
3423 +- add_tsu_reg(TSU_BSYSL1);
3424 +- add_tsu_reg(TSU_PRISL0);
3425 +- add_tsu_reg(TSU_PRISL1);
3426 +- add_tsu_reg(TSU_FWSL0);
3427 +- add_tsu_reg(TSU_FWSL1);
3428 ++ if (cd->dual_port) {
3429 ++ add_tsu_reg(TSU_FWEN0);
3430 ++ add_tsu_reg(TSU_FWEN1);
3431 ++ add_tsu_reg(TSU_FCM);
3432 ++ add_tsu_reg(TSU_BSYSL0);
3433 ++ add_tsu_reg(TSU_BSYSL1);
3434 ++ add_tsu_reg(TSU_PRISL0);
3435 ++ add_tsu_reg(TSU_PRISL1);
3436 ++ add_tsu_reg(TSU_FWSL0);
3437 ++ add_tsu_reg(TSU_FWSL1);
3438 ++ }
3439 + add_tsu_reg(TSU_FWSLC);
3440 +- add_tsu_reg(TSU_QTAGM0);
3441 +- add_tsu_reg(TSU_QTAGM1);
3442 +- add_tsu_reg(TSU_FWSR);
3443 +- add_tsu_reg(TSU_FWINMK);
3444 +- add_tsu_reg(TSU_ADQT0);
3445 +- add_tsu_reg(TSU_ADQT1);
3446 +- add_tsu_reg(TSU_VTAG0);
3447 +- add_tsu_reg(TSU_VTAG1);
3448 ++ if (cd->dual_port) {
3449 ++ add_tsu_reg(TSU_QTAGM0);
3450 ++ add_tsu_reg(TSU_QTAGM1);
3451 ++ add_tsu_reg(TSU_FWSR);
3452 ++ add_tsu_reg(TSU_FWINMK);
3453 ++ add_tsu_reg(TSU_ADQT0);
3454 ++ add_tsu_reg(TSU_ADQT1);
3455 ++ add_tsu_reg(TSU_VTAG0);
3456 ++ add_tsu_reg(TSU_VTAG1);
3457 ++ }
3458 + add_tsu_reg(TSU_ADSBSY);
3459 + add_tsu_reg(TSU_TEN);
3460 + add_tsu_reg(TSU_POST1);
3461 +diff --git a/drivers/net/ethernet/socionext/sni_ave.c b/drivers/net/ethernet/socionext/sni_ave.c
3462 +index 6e984d5a729f..38d39c4b5ac8 100644
3463 +--- a/drivers/net/ethernet/socionext/sni_ave.c
3464 ++++ b/drivers/net/ethernet/socionext/sni_ave.c
3465 +@@ -424,16 +424,22 @@ static void ave_ethtool_get_wol(struct net_device *ndev,
3466 + phy_ethtool_get_wol(ndev->phydev, wol);
3467 + }
3468 +
3469 +-static int ave_ethtool_set_wol(struct net_device *ndev,
3470 +- struct ethtool_wolinfo *wol)
3471 ++static int __ave_ethtool_set_wol(struct net_device *ndev,
3472 ++ struct ethtool_wolinfo *wol)
3473 + {
3474 +- int ret;
3475 +-
3476 + if (!ndev->phydev ||
3477 + (wol->wolopts & (WAKE_ARP | WAKE_MAGICSECURE)))
3478 + return -EOPNOTSUPP;
3479 +
3480 +- ret = phy_ethtool_set_wol(ndev->phydev, wol);
3481 ++ return phy_ethtool_set_wol(ndev->phydev, wol);
3482 ++}
3483 ++
3484 ++static int ave_ethtool_set_wol(struct net_device *ndev,
3485 ++ struct ethtool_wolinfo *wol)
3486 ++{
3487 ++ int ret;
3488 ++
3489 ++ ret = __ave_ethtool_set_wol(ndev, wol);
3490 + if (!ret)
3491 + device_set_wakeup_enable(&ndev->dev, !!wol->wolopts);
3492 +
3493 +@@ -1216,7 +1222,7 @@ static int ave_init(struct net_device *ndev)
3494 +
3495 + /* set wol initial state disabled */
3496 + wol.wolopts = 0;
3497 +- ave_ethtool_set_wol(ndev, &wol);
3498 ++ __ave_ethtool_set_wol(ndev, &wol);
3499 +
3500 + if (!phy_interface_is_rgmii(phydev))
3501 + phy_set_max_speed(phydev, SPEED_100);
3502 +@@ -1768,7 +1774,7 @@ static int ave_resume(struct device *dev)
3503 +
3504 + ave_ethtool_get_wol(ndev, &wol);
3505 + wol.wolopts = priv->wolopts;
3506 +- ave_ethtool_set_wol(ndev, &wol);
3507 ++ __ave_ethtool_set_wol(ndev, &wol);
3508 +
3509 + if (ndev->phydev) {
3510 + ret = phy_resume(ndev->phydev);
3511 +diff --git a/drivers/net/ethernet/stmicro/stmmac/common.h b/drivers/net/ethernet/stmicro/stmmac/common.h
3512 +index 912bbb6515b2..bc82cdf36cc3 100644
3513 +--- a/drivers/net/ethernet/stmicro/stmmac/common.h
3514 ++++ b/drivers/net/ethernet/stmicro/stmmac/common.h
3515 +@@ -364,9 +364,8 @@ struct dma_features {
3516 + unsigned int arpoffsel;
3517 + };
3518 +
3519 +-/* GMAC TX FIFO is 8K, Rx FIFO is 16K */
3520 +-#define BUF_SIZE_16KiB 16384
3521 +-/* RX Buffer size must be < 8191 and multiple of 4/8/16 bytes */
3522 ++/* RX Buffer size must be multiple of 4/8/16 bytes */
3523 ++#define BUF_SIZE_16KiB 16368
3524 + #define BUF_SIZE_8KiB 8188
3525 + #define BUF_SIZE_4KiB 4096
3526 + #define BUF_SIZE_2KiB 2048
3527 +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
3528 +index 903c5d8a226e..1b3520d0e59e 100644
3529 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
3530 ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
3531 +@@ -1108,7 +1108,9 @@ static int stmmac_set_bfsize(int mtu, int bufsize)
3532 + {
3533 + int ret = bufsize;
3534 +
3535 +- if (mtu >= BUF_SIZE_4KiB)
3536 ++ if (mtu >= BUF_SIZE_8KiB)
3537 ++ ret = BUF_SIZE_16KiB;
3538 ++ else if (mtu >= BUF_SIZE_4KiB)
3539 + ret = BUF_SIZE_8KiB;
3540 + else if (mtu >= BUF_SIZE_2KiB)
3541 + ret = BUF_SIZE_4KiB;
3542 +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
3543 +index a0513deab1a0..ba03a2d77434 100644
3544 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
3545 ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_selftests.c
3546 +@@ -80,7 +80,7 @@ static struct sk_buff *stmmac_test_get_udp_skb(struct stmmac_priv *priv,
3547 + if (attr->max_size && (attr->max_size > size))
3548 + size = attr->max_size;
3549 +
3550 +- skb = netdev_alloc_skb_ip_align(priv->dev, size);
3551 ++ skb = netdev_alloc_skb(priv->dev, size);
3552 + if (!skb)
3553 + return NULL;
3554 +
3555 +@@ -244,6 +244,8 @@ static int stmmac_test_loopback_validate(struct sk_buff *skb,
3556 + struct net_device *orig_ndev)
3557 + {
3558 + struct stmmac_test_priv *tpriv = pt->af_packet_priv;
3559 ++ unsigned char *src = tpriv->packet->src;
3560 ++ unsigned char *dst = tpriv->packet->dst;
3561 + struct stmmachdr *shdr;
3562 + struct ethhdr *ehdr;
3563 + struct udphdr *uhdr;
3564 +@@ -260,15 +262,15 @@ static int stmmac_test_loopback_validate(struct sk_buff *skb,
3565 + goto out;
3566 +
3567 + ehdr = (struct ethhdr *)skb_mac_header(skb);
3568 +- if (tpriv->packet->dst) {
3569 +- if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst))
3570 ++ if (dst) {
3571 ++ if (!ether_addr_equal_unaligned(ehdr->h_dest, dst))
3572 + goto out;
3573 + }
3574 + if (tpriv->packet->sarc) {
3575 +- if (!ether_addr_equal(ehdr->h_source, ehdr->h_dest))
3576 ++ if (!ether_addr_equal_unaligned(ehdr->h_source, ehdr->h_dest))
3577 + goto out;
3578 +- } else if (tpriv->packet->src) {
3579 +- if (!ether_addr_equal(ehdr->h_source, tpriv->packet->src))
3580 ++ } else if (src) {
3581 ++ if (!ether_addr_equal_unaligned(ehdr->h_source, src))
3582 + goto out;
3583 + }
3584 +
3585 +@@ -714,7 +716,7 @@ static int stmmac_test_flowctrl_validate(struct sk_buff *skb,
3586 + struct ethhdr *ehdr;
3587 +
3588 + ehdr = (struct ethhdr *)skb_mac_header(skb);
3589 +- if (!ether_addr_equal(ehdr->h_source, orig_ndev->dev_addr))
3590 ++ if (!ether_addr_equal_unaligned(ehdr->h_source, orig_ndev->dev_addr))
3591 + goto out;
3592 + if (ehdr->h_proto != htons(ETH_P_PAUSE))
3593 + goto out;
3594 +@@ -851,12 +853,16 @@ static int stmmac_test_vlan_validate(struct sk_buff *skb,
3595 + if (tpriv->vlan_id) {
3596 + if (skb->vlan_proto != htons(proto))
3597 + goto out;
3598 +- if (skb->vlan_tci != tpriv->vlan_id)
3599 ++ if (skb->vlan_tci != tpriv->vlan_id) {
3600 ++ /* Means filter did not work. */
3601 ++ tpriv->ok = false;
3602 ++ complete(&tpriv->comp);
3603 + goto out;
3604 ++ }
3605 + }
3606 +
3607 + ehdr = (struct ethhdr *)skb_mac_header(skb);
3608 +- if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->dst))
3609 ++ if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->dst))
3610 + goto out;
3611 +
3612 + ihdr = ip_hdr(skb);
3613 +@@ -1291,16 +1297,19 @@ static int __stmmac_test_l3filt(struct stmmac_priv *priv, u32 dst, u32 src,
3614 + struct stmmac_packet_attrs attr = { };
3615 + struct flow_dissector *dissector;
3616 + struct flow_cls_offload *cls;
3617 ++ int ret, old_enable = 0;
3618 + struct flow_rule *rule;
3619 +- int ret;
3620 +
3621 + if (!tc_can_offload(priv->dev))
3622 + return -EOPNOTSUPP;
3623 + if (!priv->dma_cap.l3l4fnum)
3624 + return -EOPNOTSUPP;
3625 +- if (priv->rss.enable)
3626 ++ if (priv->rss.enable) {
3627 ++ old_enable = priv->rss.enable;
3628 ++ priv->rss.enable = false;
3629 + stmmac_rss_configure(priv, priv->hw, NULL,
3630 + priv->plat->rx_queues_to_use);
3631 ++ }
3632 +
3633 + dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);
3634 + if (!dissector) {
3635 +@@ -1367,7 +1376,8 @@ cleanup_cls:
3636 + cleanup_dissector:
3637 + kfree(dissector);
3638 + cleanup_rss:
3639 +- if (priv->rss.enable) {
3640 ++ if (old_enable) {
3641 ++ priv->rss.enable = old_enable;
3642 + stmmac_rss_configure(priv, priv->hw, &priv->rss,
3643 + priv->plat->rx_queues_to_use);
3644 + }
3645 +@@ -1412,16 +1422,19 @@ static int __stmmac_test_l4filt(struct stmmac_priv *priv, u32 dst, u32 src,
3646 + struct stmmac_packet_attrs attr = { };
3647 + struct flow_dissector *dissector;
3648 + struct flow_cls_offload *cls;
3649 ++ int ret, old_enable = 0;
3650 + struct flow_rule *rule;
3651 +- int ret;
3652 +
3653 + if (!tc_can_offload(priv->dev))
3654 + return -EOPNOTSUPP;
3655 + if (!priv->dma_cap.l3l4fnum)
3656 + return -EOPNOTSUPP;
3657 +- if (priv->rss.enable)
3658 ++ if (priv->rss.enable) {
3659 ++ old_enable = priv->rss.enable;
3660 ++ priv->rss.enable = false;
3661 + stmmac_rss_configure(priv, priv->hw, NULL,
3662 + priv->plat->rx_queues_to_use);
3663 ++ }
3664 +
3665 + dissector = kzalloc(sizeof(*dissector), GFP_KERNEL);
3666 + if (!dissector) {
3667 +@@ -1493,7 +1506,8 @@ cleanup_cls:
3668 + cleanup_dissector:
3669 + kfree(dissector);
3670 + cleanup_rss:
3671 +- if (priv->rss.enable) {
3672 ++ if (old_enable) {
3673 ++ priv->rss.enable = old_enable;
3674 + stmmac_rss_configure(priv, priv->hw, &priv->rss,
3675 + priv->plat->rx_queues_to_use);
3676 + }
3677 +@@ -1546,7 +1560,7 @@ static int stmmac_test_arp_validate(struct sk_buff *skb,
3678 + struct arphdr *ahdr;
3679 +
3680 + ehdr = (struct ethhdr *)skb_mac_header(skb);
3681 +- if (!ether_addr_equal(ehdr->h_dest, tpriv->packet->src))
3682 ++ if (!ether_addr_equal_unaligned(ehdr->h_dest, tpriv->packet->src))
3683 + goto out;
3684 +
3685 + ahdr = arp_hdr(skb);
3686 +diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
3687 +index f9a9a9d82233..1d135b02ea02 100644
3688 +--- a/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
3689 ++++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_tc.c
3690 +@@ -579,6 +579,10 @@ static int tc_setup_cls(struct stmmac_priv *priv,
3691 + {
3692 + int ret = 0;
3693 +
3694 ++ /* When RSS is enabled, the filtering will be bypassed */
3695 ++ if (priv->rss.enable)
3696 ++ return -EBUSY;
3697 ++
3698 + switch (cls->command) {
3699 + case FLOW_CLS_REPLACE:
3700 + ret = tc_add_flow(priv, cls);
3701 +diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c
3702 +index f81e58267a6e..b9e44bb22289 100644
3703 +--- a/drivers/net/hyperv/rndis_filter.c
3704 ++++ b/drivers/net/hyperv/rndis_filter.c
3705 +@@ -1436,8 +1436,6 @@ void rndis_filter_device_remove(struct hv_device *dev,
3706 + /* Halt and release the rndis device */
3707 + rndis_filter_halt_device(net_dev, rndis_dev);
3708 +
3709 +- net_dev->extension = NULL;
3710 +-
3711 + netvsc_device_remove(dev);
3712 + }
3713 +
3714 +diff --git a/drivers/net/macvlan.c b/drivers/net/macvlan.c
3715 +index 747c0542a53c..c5bf61565726 100644
3716 +--- a/drivers/net/macvlan.c
3717 ++++ b/drivers/net/macvlan.c
3718 +@@ -259,7 +259,7 @@ static void macvlan_broadcast(struct sk_buff *skb,
3719 + struct net_device *src,
3720 + enum macvlan_mode mode)
3721 + {
3722 +- const struct ethhdr *eth = skb_eth_hdr(skb);
3723 ++ const struct ethhdr *eth = eth_hdr(skb);
3724 + const struct macvlan_dev *vlan;
3725 + struct sk_buff *nskb;
3726 + unsigned int i;
3727 +@@ -513,10 +513,11 @@ static int macvlan_queue_xmit(struct sk_buff *skb, struct net_device *dev)
3728 + const struct macvlan_dev *dest;
3729 +
3730 + if (vlan->mode == MACVLAN_MODE_BRIDGE) {
3731 +- const struct ethhdr *eth = (void *)skb->data;
3732 ++ const struct ethhdr *eth = skb_eth_hdr(skb);
3733 +
3734 + /* send to other bridge ports directly */
3735 + if (is_multicast_ether_addr(eth->h_dest)) {
3736 ++ skb_reset_mac_header(skb);
3737 + macvlan_broadcast(skb, port, dev, MACVLAN_MODE_BRIDGE);
3738 + goto xmit_world;
3739 + }
3740 +diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c
3741 +index cf4455bbf888..52e80434e45e 100644
3742 +--- a/drivers/net/phy/dp83867.c
3743 ++++ b/drivers/net/phy/dp83867.c
3744 +@@ -80,6 +80,7 @@
3745 + #define DP83867_PHYCR_FIFO_DEPTH_MAX 0x03
3746 + #define DP83867_PHYCR_FIFO_DEPTH_MASK GENMASK(15, 14)
3747 + #define DP83867_PHYCR_RESERVED_MASK BIT(11)
3748 ++#define DP83867_PHYCR_FORCE_LINK_GOOD BIT(10)
3749 +
3750 + /* RGMIIDCTL bits */
3751 + #define DP83867_RGMII_TX_CLK_DELAY_MAX 0xf
3752 +@@ -454,7 +455,12 @@ static int dp83867_phy_reset(struct phy_device *phydev)
3753 +
3754 + usleep_range(10, 20);
3755 +
3756 +- return 0;
3757 ++ /* After reset FORCE_LINK_GOOD bit is set. Although the
3758 ++ * default value should be unset. Disable FORCE_LINK_GOOD
3759 ++ * for the phy to work properly.
3760 ++ */
3761 ++ return phy_modify(phydev, MII_DP83867_PHYCTRL,
3762 ++ DP83867_PHYCR_FORCE_LINK_GOOD, 0);
3763 + }
3764 +
3765 + static struct phy_driver dp83867_driver[] = {
3766 +diff --git a/drivers/net/usb/lan78xx.c b/drivers/net/usb/lan78xx.c
3767 +index 3e5f2f7a155e..c232f1612083 100644
3768 +--- a/drivers/net/usb/lan78xx.c
3769 ++++ b/drivers/net/usb/lan78xx.c
3770 +@@ -3750,6 +3750,7 @@ static int lan78xx_probe(struct usb_interface *intf,
3771 +
3772 + /* MTU range: 68 - 9000 */
3773 + netdev->max_mtu = MAX_SINGLE_PACKET_SIZE;
3774 ++ netif_set_gso_max_size(netdev, MAX_SINGLE_PACKET_SIZE - MAX_HEADER);
3775 +
3776 + dev->ep_blkin = (intf->cur_altsetting)->endpoint + 0;
3777 + dev->ep_blkout = (intf->cur_altsetting)->endpoint + 1;
3778 +diff --git a/drivers/net/usb/r8152.c b/drivers/net/usb/r8152.c
3779 +index b2507c59ba8b..9e4b7a400284 100644
3780 +--- a/drivers/net/usb/r8152.c
3781 ++++ b/drivers/net/usb/r8152.c
3782 +@@ -5587,6 +5587,9 @@ static int rtl8152_probe(struct usb_interface *intf,
3783 + return -ENODEV;
3784 + }
3785 +
3786 ++ if (intf->cur_altsetting->desc.bNumEndpoints < 3)
3787 ++ return -ENODEV;
3788 ++
3789 + usb_reset_device(udev);
3790 + netdev = alloc_etherdev(sizeof(struct r8152));
3791 + if (!netdev) {
3792 +diff --git a/drivers/net/wan/fsl_ucc_hdlc.c b/drivers/net/wan/fsl_ucc_hdlc.c
3793 +index ca0f3be2b6bf..aef7de225783 100644
3794 +--- a/drivers/net/wan/fsl_ucc_hdlc.c
3795 ++++ b/drivers/net/wan/fsl_ucc_hdlc.c
3796 +@@ -73,7 +73,7 @@ static struct ucc_tdm_info utdm_primary_info = {
3797 + },
3798 + };
3799 +
3800 +-static struct ucc_tdm_info utdm_info[MAX_HDLC_NUM];
3801 ++static struct ucc_tdm_info utdm_info[UCC_MAX_NUM];
3802 +
3803 + static int uhdlc_init(struct ucc_hdlc_private *priv)
3804 + {
3805 +diff --git a/drivers/net/wireless/realtek/rtw88/phy.c b/drivers/net/wireless/realtek/rtw88/phy.c
3806 +index d3d3f40de75e..47d199d2e7dc 100644
3807 +--- a/drivers/net/wireless/realtek/rtw88/phy.c
3808 ++++ b/drivers/net/wireless/realtek/rtw88/phy.c
3809 +@@ -118,7 +118,7 @@ static void rtw_phy_cck_pd_init(struct rtw_dev *rtwdev)
3810 +
3811 + for (i = 0; i <= RTW_CHANNEL_WIDTH_40; i++) {
3812 + for (j = 0; j < RTW_RF_PATH_MAX; j++)
3813 +- dm_info->cck_pd_lv[i][j] = 0;
3814 ++ dm_info->cck_pd_lv[i][j] = CCK_PD_LV0;
3815 + }
3816 +
3817 + dm_info->cck_fa_avg = CCK_FA_AVG_RESET;
3818 +@@ -461,7 +461,6 @@ static void rtw_phy_dpk_track(struct rtw_dev *rtwdev)
3819 + chip->ops->dpk_track(rtwdev);
3820 + }
3821 +
3822 +-#define CCK_PD_LV_MAX 5
3823 + #define CCK_PD_FA_LV1_MIN 1000
3824 + #define CCK_PD_FA_LV0_MAX 500
3825 +
3826 +@@ -471,10 +470,10 @@ static u8 rtw_phy_cck_pd_lv_unlink(struct rtw_dev *rtwdev)
3827 + u32 cck_fa_avg = dm_info->cck_fa_avg;
3828 +
3829 + if (cck_fa_avg > CCK_PD_FA_LV1_MIN)
3830 +- return 1;
3831 ++ return CCK_PD_LV1;
3832 +
3833 + if (cck_fa_avg < CCK_PD_FA_LV0_MAX)
3834 +- return 0;
3835 ++ return CCK_PD_LV0;
3836 +
3837 + return CCK_PD_LV_MAX;
3838 + }
3839 +@@ -494,15 +493,15 @@ static u8 rtw_phy_cck_pd_lv_link(struct rtw_dev *rtwdev)
3840 + u32 cck_fa_avg = dm_info->cck_fa_avg;
3841 +
3842 + if (igi > CCK_PD_IGI_LV4_VAL && rssi > CCK_PD_RSSI_LV4_VAL)
3843 +- return 4;
3844 ++ return CCK_PD_LV4;
3845 + if (igi > CCK_PD_IGI_LV3_VAL && rssi > CCK_PD_RSSI_LV3_VAL)
3846 +- return 3;
3847 ++ return CCK_PD_LV3;
3848 + if (igi > CCK_PD_IGI_LV2_VAL || rssi > CCK_PD_RSSI_LV2_VAL)
3849 +- return 2;
3850 ++ return CCK_PD_LV2;
3851 + if (cck_fa_avg > CCK_PD_FA_LV1_MIN)
3852 +- return 1;
3853 ++ return CCK_PD_LV1;
3854 + if (cck_fa_avg < CCK_PD_FA_LV0_MAX)
3855 +- return 0;
3856 ++ return CCK_PD_LV0;
3857 +
3858 + return CCK_PD_LV_MAX;
3859 + }
3860 +diff --git a/drivers/net/wireless/realtek/rtw88/phy.h b/drivers/net/wireless/realtek/rtw88/phy.h
3861 +index e79b084628e7..33a5eb9637c0 100644
3862 +--- a/drivers/net/wireless/realtek/rtw88/phy.h
3863 ++++ b/drivers/net/wireless/realtek/rtw88/phy.h
3864 +@@ -125,6 +125,15 @@ rtw_get_tx_power_params(struct rtw_dev *rtwdev, u8 path,
3865 + u8 rate, u8 bw, u8 ch, u8 regd,
3866 + struct rtw_power_params *pwr_param);
3867 +
3868 ++enum rtw_phy_cck_pd_lv {
3869 ++ CCK_PD_LV0,
3870 ++ CCK_PD_LV1,
3871 ++ CCK_PD_LV2,
3872 ++ CCK_PD_LV3,
3873 ++ CCK_PD_LV4,
3874 ++ CCK_PD_LV_MAX,
3875 ++};
3876 ++
3877 + #define MASKBYTE0 0xff
3878 + #define MASKBYTE1 0xff00
3879 + #define MASKBYTE2 0xff0000
3880 +diff --git a/drivers/net/wireless/realtek/rtw88/rtw8822c.c b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
3881 +index c2f6cd76a658..de0505a6a365 100644
3882 +--- a/drivers/net/wireless/realtek/rtw88/rtw8822c.c
3883 ++++ b/drivers/net/wireless/realtek/rtw88/rtw8822c.c
3884 +@@ -3168,8 +3168,8 @@ rtw8822c_phy_cck_pd_set_reg(struct rtw_dev *rtwdev,
3885 + static void rtw8822c_phy_cck_pd_set(struct rtw_dev *rtwdev, u8 new_lvl)
3886 + {
3887 + struct rtw_dm_info *dm_info = &rtwdev->dm_info;
3888 +- s8 pd_lvl[4] = {2, 4, 6, 8};
3889 +- s8 cs_lvl[4] = {2, 2, 2, 4};
3890 ++ s8 pd_lvl[CCK_PD_LV_MAX] = {0, 2, 4, 6, 8};
3891 ++ s8 cs_lvl[CCK_PD_LV_MAX] = {0, 2, 2, 2, 4};
3892 + u8 cur_lvl;
3893 + u8 nrx, bw;
3894 +
3895 +diff --git a/drivers/net/wireless/st/cw1200/fwio.c b/drivers/net/wireless/st/cw1200/fwio.c
3896 +index 6574e78e05ea..2a03dc533b6a 100644
3897 +--- a/drivers/net/wireless/st/cw1200/fwio.c
3898 ++++ b/drivers/net/wireless/st/cw1200/fwio.c
3899 +@@ -320,12 +320,12 @@ int cw1200_load_firmware(struct cw1200_common *priv)
3900 + goto out;
3901 + }
3902 +
3903 +- priv->hw_type = cw1200_get_hw_type(val32, &major_revision);
3904 +- if (priv->hw_type < 0) {
3905 ++ ret = cw1200_get_hw_type(val32, &major_revision);
3906 ++ if (ret < 0) {
3907 + pr_err("Can't deduce hardware type.\n");
3908 +- ret = -ENOTSUPP;
3909 + goto out;
3910 + }
3911 ++ priv->hw_type = ret;
3912 +
3913 + /* Set DPLL Reg value, and read back to confirm writes work */
3914 + ret = cw1200_reg_write_32(priv, ST90TDS_TSET_GEN_R_W_REG_ID,
3915 +diff --git a/drivers/nfc/pn533/usb.c b/drivers/nfc/pn533/usb.c
3916 +index e897e4d768ef..d7a355d05368 100644
3917 +--- a/drivers/nfc/pn533/usb.c
3918 ++++ b/drivers/nfc/pn533/usb.c
3919 +@@ -391,7 +391,7 @@ static int pn533_acr122_poweron_rdr(struct pn533_usb_phy *phy)
3920 + cmd, sizeof(cmd), false);
3921 +
3922 + rc = usb_bulk_msg(phy->udev, phy->out_urb->pipe, buffer, sizeof(cmd),
3923 +- &transferred, 0);
3924 ++ &transferred, 5000);
3925 + kfree(buffer);
3926 + if (rc || (transferred != sizeof(cmd))) {
3927 + nfc_err(&phy->udev->dev,
3928 +diff --git a/drivers/ptp/ptp_clock.c b/drivers/ptp/ptp_clock.c
3929 +index 61fafe0374ce..b84f16bbd6f2 100644
3930 +--- a/drivers/ptp/ptp_clock.c
3931 ++++ b/drivers/ptp/ptp_clock.c
3932 +@@ -170,6 +170,7 @@ static void ptp_clock_release(struct device *dev)
3933 + {
3934 + struct ptp_clock *ptp = container_of(dev, struct ptp_clock, dev);
3935 +
3936 ++ ptp_cleanup_pin_groups(ptp);
3937 + mutex_destroy(&ptp->tsevq_mux);
3938 + mutex_destroy(&ptp->pincfg_mux);
3939 + ida_simple_remove(&ptp_clocks_map, ptp->index);
3940 +@@ -302,9 +303,8 @@ int ptp_clock_unregister(struct ptp_clock *ptp)
3941 + if (ptp->pps_source)
3942 + pps_unregister_source(ptp->pps_source);
3943 +
3944 +- ptp_cleanup_pin_groups(ptp);
3945 +-
3946 + posix_clock_unregister(&ptp->clock);
3947 ++
3948 + return 0;
3949 + }
3950 + EXPORT_SYMBOL(ptp_clock_unregister);
3951 +diff --git a/drivers/reset/core.c b/drivers/reset/core.c
3952 +index f343bd814d32..76c0dc7f165d 100644
3953 +--- a/drivers/reset/core.c
3954 ++++ b/drivers/reset/core.c
3955 +@@ -861,8 +861,7 @@ static int of_reset_control_get_count(struct device_node *node)
3956 + * @acquired: only one reset control may be acquired for a given controller
3957 + * and ID
3958 + *
3959 +- * Returns pointer to allocated reset_control_array on success or
3960 +- * error on failure
3961 ++ * Returns pointer to allocated reset_control on success or error on failure
3962 + */
3963 + struct reset_control *
3964 + of_reset_control_array_get(struct device_node *np, bool shared, bool optional,
3965 +@@ -915,8 +914,7 @@ EXPORT_SYMBOL_GPL(of_reset_control_array_get);
3966 + * that just have to be asserted or deasserted, without any
3967 + * requirements on the order.
3968 + *
3969 +- * Returns pointer to allocated reset_control_array on success or
3970 +- * error on failure
3971 ++ * Returns pointer to allocated reset_control on success or error on failure
3972 + */
3973 + struct reset_control *
3974 + devm_reset_control_array_get(struct device *dev, bool shared, bool optional)
3975 +diff --git a/drivers/s390/crypto/zcrypt_ccamisc.c b/drivers/s390/crypto/zcrypt_ccamisc.c
3976 +index c1db64a2db21..110fe9d0cb91 100644
3977 +--- a/drivers/s390/crypto/zcrypt_ccamisc.c
3978 ++++ b/drivers/s390/crypto/zcrypt_ccamisc.c
3979 +@@ -1037,8 +1037,8 @@ static int _ip_cprb_helper(u16 cardnr, u16 domain,
3980 + prepparm = (struct iprepparm *) prepcblk->rpl_parmb;
3981 +
3982 + /* do some plausibility checks on the key block */
3983 +- if (prepparm->kb.len < 120 + 5 * sizeof(uint16_t) ||
3984 +- prepparm->kb.len > 136 + 5 * sizeof(uint16_t)) {
3985 ++ if (prepparm->kb.len < 120 + 3 * sizeof(uint16_t) ||
3986 ++ prepparm->kb.len > 136 + 3 * sizeof(uint16_t)) {
3987 + DEBUG_ERR("%s reply with invalid or unknown key block\n",
3988 + __func__);
3989 + rc = -EIO;
3990 +diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
3991 +index c5fa5f3b00e9..0b28d44d3573 100644
3992 +--- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
3993 ++++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
3994 +@@ -915,12 +915,12 @@ void bnx2i_free_hba(struct bnx2i_hba *hba)
3995 + INIT_LIST_HEAD(&hba->ep_ofld_list);
3996 + INIT_LIST_HEAD(&hba->ep_active_list);
3997 + INIT_LIST_HEAD(&hba->ep_destroy_list);
3998 +- pci_dev_put(hba->pcidev);
3999 +
4000 + if (hba->regview) {
4001 + pci_iounmap(hba->pcidev, hba->regview);
4002 + hba->regview = NULL;
4003 + }
4004 ++ pci_dev_put(hba->pcidev);
4005 + bnx2i_free_mp_bdt(hba);
4006 + bnx2i_release_free_cid_que(hba);
4007 + iscsi_host_free(shost);
4008 +diff --git a/drivers/scsi/esas2r/esas2r_flash.c b/drivers/scsi/esas2r/esas2r_flash.c
4009 +index 7bd376d95ed5..b02ac389e6c6 100644
4010 +--- a/drivers/scsi/esas2r/esas2r_flash.c
4011 ++++ b/drivers/scsi/esas2r/esas2r_flash.c
4012 +@@ -1197,6 +1197,7 @@ bool esas2r_nvram_read_direct(struct esas2r_adapter *a)
4013 + if (!esas2r_read_flash_block(a, a->nvram, FLS_OFFSET_NVR,
4014 + sizeof(struct esas2r_sas_nvram))) {
4015 + esas2r_hdebug("NVRAM read failed, using defaults");
4016 ++ up(&a->nvram_semaphore);
4017 + return false;
4018 + }
4019 +
4020 +diff --git a/drivers/scsi/fnic/vnic_dev.c b/drivers/scsi/fnic/vnic_dev.c
4021 +index 78af9cc2009b..522636e94628 100644
4022 +--- a/drivers/scsi/fnic/vnic_dev.c
4023 ++++ b/drivers/scsi/fnic/vnic_dev.c
4024 +@@ -688,26 +688,26 @@ int vnic_dev_soft_reset_done(struct vnic_dev *vdev, int *done)
4025 +
4026 + int vnic_dev_hang_notify(struct vnic_dev *vdev)
4027 + {
4028 +- u64 a0, a1;
4029 ++ u64 a0 = 0, a1 = 0;
4030 + int wait = 1000;
4031 + return vnic_dev_cmd(vdev, CMD_HANG_NOTIFY, &a0, &a1, wait);
4032 + }
4033 +
4034 + int vnic_dev_mac_addr(struct vnic_dev *vdev, u8 *mac_addr)
4035 + {
4036 +- u64 a0, a1;
4037 ++ u64 a[2] = {};
4038 + int wait = 1000;
4039 + int err, i;
4040 +
4041 + for (i = 0; i < ETH_ALEN; i++)
4042 + mac_addr[i] = 0;
4043 +
4044 +- err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a0, &a1, wait);
4045 ++ err = vnic_dev_cmd(vdev, CMD_MAC_ADDR, &a[0], &a[1], wait);
4046 + if (err)
4047 + return err;
4048 +
4049 + for (i = 0; i < ETH_ALEN; i++)
4050 +- mac_addr[i] = ((u8 *)&a0)[i];
4051 ++ mac_addr[i] = ((u8 *)&a)[i];
4052 +
4053 + return 0;
4054 + }
4055 +@@ -732,30 +732,30 @@ void vnic_dev_packet_filter(struct vnic_dev *vdev, int directed, int multicast,
4056 +
4057 + void vnic_dev_add_addr(struct vnic_dev *vdev, u8 *addr)
4058 + {
4059 +- u64 a0 = 0, a1 = 0;
4060 ++ u64 a[2] = {};
4061 + int wait = 1000;
4062 + int err;
4063 + int i;
4064 +
4065 + for (i = 0; i < ETH_ALEN; i++)
4066 +- ((u8 *)&a0)[i] = addr[i];
4067 ++ ((u8 *)&a)[i] = addr[i];
4068 +
4069 +- err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a0, &a1, wait);
4070 ++ err = vnic_dev_cmd(vdev, CMD_ADDR_ADD, &a[0], &a[1], wait);
4071 + if (err)
4072 + pr_err("Can't add addr [%pM], %d\n", addr, err);
4073 + }
4074 +
4075 + void vnic_dev_del_addr(struct vnic_dev *vdev, u8 *addr)
4076 + {
4077 +- u64 a0 = 0, a1 = 0;
4078 ++ u64 a[2] = {};
4079 + int wait = 1000;
4080 + int err;
4081 + int i;
4082 +
4083 + for (i = 0; i < ETH_ALEN; i++)
4084 +- ((u8 *)&a0)[i] = addr[i];
4085 ++ ((u8 *)&a)[i] = addr[i];
4086 +
4087 +- err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a0, &a1, wait);
4088 ++ err = vnic_dev_cmd(vdev, CMD_ADDR_DEL, &a[0], &a[1], wait);
4089 + if (err)
4090 + pr_err("Can't del addr [%pM], %d\n", addr, err);
4091 + }
4092 +diff --git a/drivers/scsi/hisi_sas/hisi_sas_main.c b/drivers/scsi/hisi_sas/hisi_sas_main.c
4093 +index 633effb09c9c..849335d76cf6 100644
4094 +--- a/drivers/scsi/hisi_sas/hisi_sas_main.c
4095 ++++ b/drivers/scsi/hisi_sas/hisi_sas_main.c
4096 +@@ -3719,9 +3719,6 @@ static int hisi_sas_debugfs_alloc(struct hisi_hba *hisi_hba)
4097 + int p, c, d;
4098 + size_t sz;
4099 +
4100 +- hisi_hba->debugfs_dump_dentry =
4101 +- debugfs_create_dir("dump", hisi_hba->debugfs_dir);
4102 +-
4103 + sz = hw->debugfs_reg_array[DEBUGFS_GLOBAL]->count * 4;
4104 + hisi_hba->debugfs_regs[DEBUGFS_GLOBAL] =
4105 + devm_kmalloc(dev, sz, GFP_KERNEL);
4106 +diff --git a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
4107 +index ef32ee12f606..723f51c822af 100644
4108 +--- a/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
4109 ++++ b/drivers/scsi/hisi_sas/hisi_sas_v3_hw.c
4110 +@@ -3022,11 +3022,6 @@ static int debugfs_set_bist_v3_hw(struct hisi_hba *hisi_hba, bool enable)
4111 + hisi_sas_phy_write32(hisi_hba, phy_id,
4112 + SAS_PHY_BIST_CTRL, reg_val);
4113 +
4114 +- mdelay(100);
4115 +- reg_val |= (CFG_RX_BIST_EN_MSK | CFG_TX_BIST_EN_MSK);
4116 +- hisi_sas_phy_write32(hisi_hba, phy_id,
4117 +- SAS_PHY_BIST_CTRL, reg_val);
4118 +-
4119 + /* set the bist init value */
4120 + hisi_sas_phy_write32(hisi_hba, phy_id,
4121 + SAS_PHY_BIST_CODE,
4122 +@@ -3035,6 +3030,11 @@ static int debugfs_set_bist_v3_hw(struct hisi_hba *hisi_hba, bool enable)
4123 + SAS_PHY_BIST_CODE1,
4124 + SAS_PHY_BIST_CODE1_INIT);
4125 +
4126 ++ mdelay(100);
4127 ++ reg_val |= (CFG_RX_BIST_EN_MSK | CFG_TX_BIST_EN_MSK);
4128 ++ hisi_sas_phy_write32(hisi_hba, phy_id,
4129 ++ SAS_PHY_BIST_CTRL, reg_val);
4130 ++
4131 + /* clear error bit */
4132 + mdelay(100);
4133 + hisi_sas_phy_read32(hisi_hba, phy_id, SAS_BIST_ERR_CNT);
4134 +@@ -3423,6 +3423,7 @@ static int hisi_sas_v3_resume(struct pci_dev *pdev)
4135 + if (rc) {
4136 + scsi_remove_host(shost);
4137 + pci_disable_device(pdev);
4138 ++ return rc;
4139 + }
4140 + hisi_hba->hw->phys_init(hisi_hba);
4141 + sas_resume_ha(sha);
4142 +diff --git a/drivers/scsi/lpfc/lpfc_scsi.c b/drivers/scsi/lpfc/lpfc_scsi.c
4143 +index aa82d538a18a..40706cb842fd 100644
4144 +--- a/drivers/scsi/lpfc/lpfc_scsi.c
4145 ++++ b/drivers/scsi/lpfc/lpfc_scsi.c
4146 +@@ -719,7 +719,7 @@ lpfc_get_scsi_buf_s4(struct lpfc_hba *phba, struct lpfc_nodelist *ndlp,
4147 + iocb->ulpLe = 1;
4148 + iocb->ulpClass = CLASS3;
4149 +
4150 +- if (lpfc_ndlp_check_qdepth(phba, ndlp)) {
4151 ++ if (lpfc_ndlp_check_qdepth(phba, ndlp) && lpfc_cmd) {
4152 + atomic_inc(&ndlp->cmd_pending);
4153 + lpfc_cmd->flags |= LPFC_SBUF_BUMP_QDEPTH;
4154 + }
4155 +diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c
4156 +index 8860f41af3ff..e2cec1f6e659 100644
4157 +--- a/drivers/scsi/lpfc/lpfc_sli.c
4158 ++++ b/drivers/scsi/lpfc/lpfc_sli.c
4159 +@@ -20108,6 +20108,13 @@ void lpfc_release_io_buf(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_ncmd,
4160 + lpfc_ncmd->cur_iocbq.wqe_cmpl = NULL;
4161 + lpfc_ncmd->cur_iocbq.iocb_cmpl = NULL;
4162 +
4163 ++ if (phba->cfg_xpsgl && !phba->nvmet_support &&
4164 ++ !list_empty(&lpfc_ncmd->dma_sgl_xtra_list))
4165 ++ lpfc_put_sgl_per_hdwq(phba, lpfc_ncmd);
4166 ++
4167 ++ if (!list_empty(&lpfc_ncmd->dma_cmd_rsp_list))
4168 ++ lpfc_put_cmd_rsp_buf_per_hdwq(phba, lpfc_ncmd);
4169 ++
4170 + if (phba->cfg_xri_rebalancing) {
4171 + if (lpfc_ncmd->expedite) {
4172 + /* Return to expedite pool */
4173 +@@ -20172,13 +20179,6 @@ void lpfc_release_io_buf(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_ncmd,
4174 + spin_unlock_irqrestore(&qp->io_buf_list_put_lock,
4175 + iflag);
4176 + }
4177 +-
4178 +- if (phba->cfg_xpsgl && !phba->nvmet_support &&
4179 +- !list_empty(&lpfc_ncmd->dma_sgl_xtra_list))
4180 +- lpfc_put_sgl_per_hdwq(phba, lpfc_ncmd);
4181 +-
4182 +- if (!list_empty(&lpfc_ncmd->dma_cmd_rsp_list))
4183 +- lpfc_put_cmd_rsp_buf_per_hdwq(phba, lpfc_ncmd);
4184 + }
4185 +
4186 + /**
4187 +@@ -20414,8 +20414,9 @@ lpfc_get_sgl_per_hdwq(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_buf)
4188 + struct sli4_hybrid_sgl *allocated_sgl = NULL;
4189 + struct lpfc_sli4_hdw_queue *hdwq = lpfc_buf->hdwq;
4190 + struct list_head *buf_list = &hdwq->sgl_list;
4191 ++ unsigned long iflags;
4192 +
4193 +- spin_lock_irq(&hdwq->hdwq_lock);
4194 ++ spin_lock_irqsave(&hdwq->hdwq_lock, iflags);
4195 +
4196 + if (likely(!list_empty(buf_list))) {
4197 + /* break off 1 chunk from the sgl_list */
4198 +@@ -20427,9 +20428,9 @@ lpfc_get_sgl_per_hdwq(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_buf)
4199 + }
4200 + } else {
4201 + /* allocate more */
4202 +- spin_unlock_irq(&hdwq->hdwq_lock);
4203 ++ spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
4204 + tmp = kmalloc_node(sizeof(*tmp), GFP_ATOMIC,
4205 +- cpu_to_node(smp_processor_id()));
4206 ++ cpu_to_node(hdwq->io_wq->chann));
4207 + if (!tmp) {
4208 + lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
4209 + "8353 error kmalloc memory for HDWQ "
4210 +@@ -20449,7 +20450,7 @@ lpfc_get_sgl_per_hdwq(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_buf)
4211 + return NULL;
4212 + }
4213 +
4214 +- spin_lock_irq(&hdwq->hdwq_lock);
4215 ++ spin_lock_irqsave(&hdwq->hdwq_lock, iflags);
4216 + list_add_tail(&tmp->list_node, &lpfc_buf->dma_sgl_xtra_list);
4217 + }
4218 +
4219 +@@ -20457,7 +20458,7 @@ lpfc_get_sgl_per_hdwq(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_buf)
4220 + struct sli4_hybrid_sgl,
4221 + list_node);
4222 +
4223 +- spin_unlock_irq(&hdwq->hdwq_lock);
4224 ++ spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
4225 +
4226 + return allocated_sgl;
4227 + }
4228 +@@ -20481,8 +20482,9 @@ lpfc_put_sgl_per_hdwq(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_buf)
4229 + struct sli4_hybrid_sgl *tmp = NULL;
4230 + struct lpfc_sli4_hdw_queue *hdwq = lpfc_buf->hdwq;
4231 + struct list_head *buf_list = &hdwq->sgl_list;
4232 ++ unsigned long iflags;
4233 +
4234 +- spin_lock_irq(&hdwq->hdwq_lock);
4235 ++ spin_lock_irqsave(&hdwq->hdwq_lock, iflags);
4236 +
4237 + if (likely(!list_empty(&lpfc_buf->dma_sgl_xtra_list))) {
4238 + list_for_each_entry_safe(list_entry, tmp,
4239 +@@ -20495,7 +20497,7 @@ lpfc_put_sgl_per_hdwq(struct lpfc_hba *phba, struct lpfc_io_buf *lpfc_buf)
4240 + rc = -EINVAL;
4241 + }
4242 +
4243 +- spin_unlock_irq(&hdwq->hdwq_lock);
4244 ++ spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
4245 + return rc;
4246 + }
4247 +
4248 +@@ -20516,8 +20518,9 @@ lpfc_free_sgl_per_hdwq(struct lpfc_hba *phba,
4249 + struct list_head *buf_list = &hdwq->sgl_list;
4250 + struct sli4_hybrid_sgl *list_entry = NULL;
4251 + struct sli4_hybrid_sgl *tmp = NULL;
4252 ++ unsigned long iflags;
4253 +
4254 +- spin_lock_irq(&hdwq->hdwq_lock);
4255 ++ spin_lock_irqsave(&hdwq->hdwq_lock, iflags);
4256 +
4257 + /* Free sgl pool */
4258 + list_for_each_entry_safe(list_entry, tmp,
4259 +@@ -20529,7 +20532,7 @@ lpfc_free_sgl_per_hdwq(struct lpfc_hba *phba,
4260 + kfree(list_entry);
4261 + }
4262 +
4263 +- spin_unlock_irq(&hdwq->hdwq_lock);
4264 ++ spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
4265 + }
4266 +
4267 + /**
4268 +@@ -20553,8 +20556,9 @@ lpfc_get_cmd_rsp_buf_per_hdwq(struct lpfc_hba *phba,
4269 + struct fcp_cmd_rsp_buf *allocated_buf = NULL;
4270 + struct lpfc_sli4_hdw_queue *hdwq = lpfc_buf->hdwq;
4271 + struct list_head *buf_list = &hdwq->cmd_rsp_buf_list;
4272 ++ unsigned long iflags;
4273 +
4274 +- spin_lock_irq(&hdwq->hdwq_lock);
4275 ++ spin_lock_irqsave(&hdwq->hdwq_lock, iflags);
4276 +
4277 + if (likely(!list_empty(buf_list))) {
4278 + /* break off 1 chunk from the list */
4279 +@@ -20567,9 +20571,9 @@ lpfc_get_cmd_rsp_buf_per_hdwq(struct lpfc_hba *phba,
4280 + }
4281 + } else {
4282 + /* allocate more */
4283 +- spin_unlock_irq(&hdwq->hdwq_lock);
4284 ++ spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
4285 + tmp = kmalloc_node(sizeof(*tmp), GFP_ATOMIC,
4286 +- cpu_to_node(smp_processor_id()));
4287 ++ cpu_to_node(hdwq->io_wq->chann));
4288 + if (!tmp) {
4289 + lpfc_printf_log(phba, KERN_INFO, LOG_SLI,
4290 + "8355 error kmalloc memory for HDWQ "
4291 +@@ -20594,7 +20598,7 @@ lpfc_get_cmd_rsp_buf_per_hdwq(struct lpfc_hba *phba,
4292 + tmp->fcp_rsp = (struct fcp_rsp *)((uint8_t *)tmp->fcp_cmnd +
4293 + sizeof(struct fcp_cmnd));
4294 +
4295 +- spin_lock_irq(&hdwq->hdwq_lock);
4296 ++ spin_lock_irqsave(&hdwq->hdwq_lock, iflags);
4297 + list_add_tail(&tmp->list_node, &lpfc_buf->dma_cmd_rsp_list);
4298 + }
4299 +
4300 +@@ -20602,7 +20606,7 @@ lpfc_get_cmd_rsp_buf_per_hdwq(struct lpfc_hba *phba,
4301 + struct fcp_cmd_rsp_buf,
4302 + list_node);
4303 +
4304 +- spin_unlock_irq(&hdwq->hdwq_lock);
4305 ++ spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
4306 +
4307 + return allocated_buf;
4308 + }
4309 +@@ -20627,8 +20631,9 @@ lpfc_put_cmd_rsp_buf_per_hdwq(struct lpfc_hba *phba,
4310 + struct fcp_cmd_rsp_buf *tmp = NULL;
4311 + struct lpfc_sli4_hdw_queue *hdwq = lpfc_buf->hdwq;
4312 + struct list_head *buf_list = &hdwq->cmd_rsp_buf_list;
4313 ++ unsigned long iflags;
4314 +
4315 +- spin_lock_irq(&hdwq->hdwq_lock);
4316 ++ spin_lock_irqsave(&hdwq->hdwq_lock, iflags);
4317 +
4318 + if (likely(!list_empty(&lpfc_buf->dma_cmd_rsp_list))) {
4319 + list_for_each_entry_safe(list_entry, tmp,
4320 +@@ -20641,7 +20646,7 @@ lpfc_put_cmd_rsp_buf_per_hdwq(struct lpfc_hba *phba,
4321 + rc = -EINVAL;
4322 + }
4323 +
4324 +- spin_unlock_irq(&hdwq->hdwq_lock);
4325 ++ spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
4326 + return rc;
4327 + }
4328 +
4329 +@@ -20662,8 +20667,9 @@ lpfc_free_cmd_rsp_buf_per_hdwq(struct lpfc_hba *phba,
4330 + struct list_head *buf_list = &hdwq->cmd_rsp_buf_list;
4331 + struct fcp_cmd_rsp_buf *list_entry = NULL;
4332 + struct fcp_cmd_rsp_buf *tmp = NULL;
4333 ++ unsigned long iflags;
4334 +
4335 +- spin_lock_irq(&hdwq->hdwq_lock);
4336 ++ spin_lock_irqsave(&hdwq->hdwq_lock, iflags);
4337 +
4338 + /* Free cmd_rsp buf pool */
4339 + list_for_each_entry_safe(list_entry, tmp,
4340 +@@ -20676,5 +20682,5 @@ lpfc_free_cmd_rsp_buf_per_hdwq(struct lpfc_hba *phba,
4341 + kfree(list_entry);
4342 + }
4343 +
4344 +- spin_unlock_irq(&hdwq->hdwq_lock);
4345 ++ spin_unlock_irqrestore(&hdwq->hdwq_lock, iflags);
4346 + }
4347 +diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c
4348 +index 80f276d67c14..9ffaa920fc8f 100644
4349 +--- a/drivers/scsi/qla2xxx/qla_init.c
4350 ++++ b/drivers/scsi/qla2xxx/qla_init.c
4351 +@@ -5891,8 +5891,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
4352 + if (test_bit(LOOP_RESYNC_NEEDED, &vha->dpc_flags))
4353 + break;
4354 +
4355 +- if ((fcport->flags & FCF_FABRIC_DEVICE) == 0 ||
4356 +- (fcport->flags & FCF_LOGIN_NEEDED) == 0)
4357 ++ if ((fcport->flags & FCF_FABRIC_DEVICE) == 0)
4358 + continue;
4359 +
4360 + if (fcport->scan_state == QLA_FCPORT_SCAN) {
4361 +@@ -5915,7 +5914,8 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)
4362 + }
4363 + }
4364 +
4365 +- if (fcport->scan_state == QLA_FCPORT_FOUND)
4366 ++ if (fcport->scan_state == QLA_FCPORT_FOUND &&
4367 ++ (fcport->flags & FCF_LOGIN_NEEDED) != 0)
4368 + qla24xx_fcport_handle_login(vha, fcport);
4369 + }
4370 + return (rval);
4371 +diff --git a/drivers/scsi/qla2xxx/qla_isr.c b/drivers/scsi/qla2xxx/qla_isr.c
4372 +index b3766b1879e3..7c5f2736ebee 100644
4373 +--- a/drivers/scsi/qla2xxx/qla_isr.c
4374 ++++ b/drivers/scsi/qla2xxx/qla_isr.c
4375 +@@ -3625,7 +3625,7 @@ qla2x00_request_irqs(struct qla_hw_data *ha, struct rsp_que *rsp)
4376 + skip_msix:
4377 +
4378 + ql_log(ql_log_info, vha, 0x0037,
4379 +- "Falling back-to MSI mode -%d.\n", ret);
4380 ++ "Falling back-to MSI mode -- ret=%d.\n", ret);
4381 +
4382 + if (!IS_QLA24XX(ha) && !IS_QLA2532(ha) && !IS_QLA8432(ha) &&
4383 + !IS_QLA8001(ha) && !IS_P3P_TYPE(ha) && !IS_QLAFX00(ha) &&
4384 +@@ -3633,13 +3633,13 @@ skip_msix:
4385 + goto skip_msi;
4386 +
4387 + ret = pci_alloc_irq_vectors(ha->pdev, 1, 1, PCI_IRQ_MSI);
4388 +- if (!ret) {
4389 ++ if (ret > 0) {
4390 + ql_dbg(ql_dbg_init, vha, 0x0038,
4391 + "MSI: Enabled.\n");
4392 + ha->flags.msi_enabled = 1;
4393 + } else
4394 + ql_log(ql_log_warn, vha, 0x0039,
4395 +- "Falling back-to INTa mode -- %d.\n", ret);
4396 ++ "Falling back-to INTa mode -- ret=%d.\n", ret);
4397 + skip_msi:
4398 +
4399 + /* Skip INTx on ISP82xx. */
4400 +diff --git a/drivers/scsi/qla4xxx/ql4_mbx.c b/drivers/scsi/qla4xxx/ql4_mbx.c
4401 +index dac9a7013208..02636b4785c5 100644
4402 +--- a/drivers/scsi/qla4xxx/ql4_mbx.c
4403 ++++ b/drivers/scsi/qla4xxx/ql4_mbx.c
4404 +@@ -640,9 +640,6 @@ int qla4xxx_initialize_fw_cb(struct scsi_qla_host * ha)
4405 +
4406 + if (qla4xxx_get_ifcb(ha, &mbox_cmd[0], &mbox_sts[0], init_fw_cb_dma) !=
4407 + QLA_SUCCESS) {
4408 +- dma_free_coherent(&ha->pdev->dev,
4409 +- sizeof(struct addr_ctrl_blk),
4410 +- init_fw_cb, init_fw_cb_dma);
4411 + goto exit_init_fw_cb;
4412 + }
4413 +
4414 +diff --git a/drivers/scsi/scsi_trace.c b/drivers/scsi/scsi_trace.c
4415 +index 07a2425ffa2c..ac35c301c792 100644
4416 +--- a/drivers/scsi/scsi_trace.c
4417 ++++ b/drivers/scsi/scsi_trace.c
4418 +@@ -9,7 +9,7 @@
4419 + #include <trace/events/scsi.h>
4420 +
4421 + #define SERVICE_ACTION16(cdb) (cdb[1] & 0x1f)
4422 +-#define SERVICE_ACTION32(cdb) ((cdb[8] << 8) | cdb[9])
4423 ++#define SERVICE_ACTION32(cdb) (get_unaligned_be16(&cdb[8]))
4424 +
4425 + static const char *
4426 + scsi_trace_misc(struct trace_seq *, unsigned char *, int);
4427 +@@ -39,17 +39,12 @@ static const char *
4428 + scsi_trace_rw10(struct trace_seq *p, unsigned char *cdb, int len)
4429 + {
4430 + const char *ret = trace_seq_buffer_ptr(p);
4431 +- sector_t lba = 0, txlen = 0;
4432 ++ u32 lba, txlen;
4433 +
4434 +- lba |= (cdb[2] << 24);
4435 +- lba |= (cdb[3] << 16);
4436 +- lba |= (cdb[4] << 8);
4437 +- lba |= cdb[5];
4438 +- txlen |= (cdb[7] << 8);
4439 +- txlen |= cdb[8];
4440 ++ lba = get_unaligned_be32(&cdb[2]);
4441 ++ txlen = get_unaligned_be16(&cdb[7]);
4442 +
4443 +- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u",
4444 +- (unsigned long long)lba, (unsigned long long)txlen,
4445 ++ trace_seq_printf(p, "lba=%u txlen=%u protect=%u", lba, txlen,
4446 + cdb[1] >> 5);
4447 +
4448 + if (cdb[0] == WRITE_SAME)
4449 +@@ -64,19 +59,12 @@ static const char *
4450 + scsi_trace_rw12(struct trace_seq *p, unsigned char *cdb, int len)
4451 + {
4452 + const char *ret = trace_seq_buffer_ptr(p);
4453 +- sector_t lba = 0, txlen = 0;
4454 +-
4455 +- lba |= (cdb[2] << 24);
4456 +- lba |= (cdb[3] << 16);
4457 +- lba |= (cdb[4] << 8);
4458 +- lba |= cdb[5];
4459 +- txlen |= (cdb[6] << 24);
4460 +- txlen |= (cdb[7] << 16);
4461 +- txlen |= (cdb[8] << 8);
4462 +- txlen |= cdb[9];
4463 +-
4464 +- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u",
4465 +- (unsigned long long)lba, (unsigned long long)txlen,
4466 ++ u32 lba, txlen;
4467 ++
4468 ++ lba = get_unaligned_be32(&cdb[2]);
4469 ++ txlen = get_unaligned_be32(&cdb[6]);
4470 ++
4471 ++ trace_seq_printf(p, "lba=%u txlen=%u protect=%u", lba, txlen,
4472 + cdb[1] >> 5);
4473 + trace_seq_putc(p, 0);
4474 +
4475 +@@ -87,23 +75,13 @@ static const char *
4476 + scsi_trace_rw16(struct trace_seq *p, unsigned char *cdb, int len)
4477 + {
4478 + const char *ret = trace_seq_buffer_ptr(p);
4479 +- sector_t lba = 0, txlen = 0;
4480 +-
4481 +- lba |= ((u64)cdb[2] << 56);
4482 +- lba |= ((u64)cdb[3] << 48);
4483 +- lba |= ((u64)cdb[4] << 40);
4484 +- lba |= ((u64)cdb[5] << 32);
4485 +- lba |= (cdb[6] << 24);
4486 +- lba |= (cdb[7] << 16);
4487 +- lba |= (cdb[8] << 8);
4488 +- lba |= cdb[9];
4489 +- txlen |= (cdb[10] << 24);
4490 +- txlen |= (cdb[11] << 16);
4491 +- txlen |= (cdb[12] << 8);
4492 +- txlen |= cdb[13];
4493 +-
4494 +- trace_seq_printf(p, "lba=%llu txlen=%llu protect=%u",
4495 +- (unsigned long long)lba, (unsigned long long)txlen,
4496 ++ u64 lba;
4497 ++ u32 txlen;
4498 ++
4499 ++ lba = get_unaligned_be64(&cdb[2]);
4500 ++ txlen = get_unaligned_be32(&cdb[10]);
4501 ++
4502 ++ trace_seq_printf(p, "lba=%llu txlen=%u protect=%u", lba, txlen,
4503 + cdb[1] >> 5);
4504 +
4505 + if (cdb[0] == WRITE_SAME_16)
4506 +@@ -118,8 +96,8 @@ static const char *
4507 + scsi_trace_rw32(struct trace_seq *p, unsigned char *cdb, int len)
4508 + {
4509 + const char *ret = trace_seq_buffer_ptr(p), *cmd;
4510 +- sector_t lba = 0, txlen = 0;
4511 +- u32 ei_lbrt = 0;
4512 ++ u64 lba;
4513 ++ u32 ei_lbrt, txlen;
4514 +
4515 + switch (SERVICE_ACTION32(cdb)) {
4516 + case READ_32:
4517 +@@ -139,26 +117,12 @@ scsi_trace_rw32(struct trace_seq *p, unsigned char *cdb, int len)
4518 + goto out;
4519 + }
4520 +
4521 +- lba |= ((u64)cdb[12] << 56);
4522 +- lba |= ((u64)cdb[13] << 48);
4523 +- lba |= ((u64)cdb[14] << 40);
4524 +- lba |= ((u64)cdb[15] << 32);
4525 +- lba |= (cdb[16] << 24);
4526 +- lba |= (cdb[17] << 16);
4527 +- lba |= (cdb[18] << 8);
4528 +- lba |= cdb[19];
4529 +- ei_lbrt |= (cdb[20] << 24);
4530 +- ei_lbrt |= (cdb[21] << 16);
4531 +- ei_lbrt |= (cdb[22] << 8);
4532 +- ei_lbrt |= cdb[23];
4533 +- txlen |= (cdb[28] << 24);
4534 +- txlen |= (cdb[29] << 16);
4535 +- txlen |= (cdb[30] << 8);
4536 +- txlen |= cdb[31];
4537 +-
4538 +- trace_seq_printf(p, "%s_32 lba=%llu txlen=%llu protect=%u ei_lbrt=%u",
4539 +- cmd, (unsigned long long)lba,
4540 +- (unsigned long long)txlen, cdb[10] >> 5, ei_lbrt);
4541 ++ lba = get_unaligned_be64(&cdb[12]);
4542 ++ ei_lbrt = get_unaligned_be32(&cdb[20]);
4543 ++ txlen = get_unaligned_be32(&cdb[28]);
4544 ++
4545 ++ trace_seq_printf(p, "%s_32 lba=%llu txlen=%u protect=%u ei_lbrt=%u",
4546 ++ cmd, lba, txlen, cdb[10] >> 5, ei_lbrt);
4547 +
4548 + if (SERVICE_ACTION32(cdb) == WRITE_SAME_32)
4549 + trace_seq_printf(p, " unmap=%u", cdb[10] >> 3 & 1);
4550 +@@ -173,7 +137,7 @@ static const char *
4551 + scsi_trace_unmap(struct trace_seq *p, unsigned char *cdb, int len)
4552 + {
4553 + const char *ret = trace_seq_buffer_ptr(p);
4554 +- unsigned int regions = cdb[7] << 8 | cdb[8];
4555 ++ unsigned int regions = get_unaligned_be16(&cdb[7]);
4556 +
4557 + trace_seq_printf(p, "regions=%u", (regions - 8) / 16);
4558 + trace_seq_putc(p, 0);
4559 +@@ -185,8 +149,8 @@ static const char *
4560 + scsi_trace_service_action_in(struct trace_seq *p, unsigned char *cdb, int len)
4561 + {
4562 + const char *ret = trace_seq_buffer_ptr(p), *cmd;
4563 +- sector_t lba = 0;
4564 +- u32 alloc_len = 0;
4565 ++ u64 lba;
4566 ++ u32 alloc_len;
4567 +
4568 + switch (SERVICE_ACTION16(cdb)) {
4569 + case SAI_READ_CAPACITY_16:
4570 +@@ -200,21 +164,10 @@ scsi_trace_service_action_in(struct trace_seq *p, unsigned char *cdb, int len)
4571 + goto out;
4572 + }
4573 +
4574 +- lba |= ((u64)cdb[2] << 56);
4575 +- lba |= ((u64)cdb[3] << 48);
4576 +- lba |= ((u64)cdb[4] << 40);
4577 +- lba |= ((u64)cdb[5] << 32);
4578 +- lba |= (cdb[6] << 24);
4579 +- lba |= (cdb[7] << 16);
4580 +- lba |= (cdb[8] << 8);
4581 +- lba |= cdb[9];
4582 +- alloc_len |= (cdb[10] << 24);
4583 +- alloc_len |= (cdb[11] << 16);
4584 +- alloc_len |= (cdb[12] << 8);
4585 +- alloc_len |= cdb[13];
4586 +-
4587 +- trace_seq_printf(p, "%s lba=%llu alloc_len=%u", cmd,
4588 +- (unsigned long long)lba, alloc_len);
4589 ++ lba = get_unaligned_be64(&cdb[2]);
4590 ++ alloc_len = get_unaligned_be32(&cdb[10]);
4591 ++
4592 ++ trace_seq_printf(p, "%s lba=%llu alloc_len=%u", cmd, lba, alloc_len);
4593 +
4594 + out:
4595 + trace_seq_putc(p, 0);
4596 +diff --git a/drivers/scsi/scsi_transport_sas.c b/drivers/scsi/scsi_transport_sas.c
4597 +index ef138c57e2a6..182fd25c7c43 100644
4598 +--- a/drivers/scsi/scsi_transport_sas.c
4599 ++++ b/drivers/scsi/scsi_transport_sas.c
4600 +@@ -1391,9 +1391,6 @@ static void sas_expander_release(struct device *dev)
4601 + struct sas_rphy *rphy = dev_to_rphy(dev);
4602 + struct sas_expander_device *edev = rphy_to_expander_device(rphy);
4603 +
4604 +- if (rphy->q)
4605 +- blk_cleanup_queue(rphy->q);
4606 +-
4607 + put_device(dev->parent);
4608 + kfree(edev);
4609 + }
4610 +@@ -1403,9 +1400,6 @@ static void sas_end_device_release(struct device *dev)
4611 + struct sas_rphy *rphy = dev_to_rphy(dev);
4612 + struct sas_end_device *edev = rphy_to_end_device(rphy);
4613 +
4614 +- if (rphy->q)
4615 +- blk_cleanup_queue(rphy->q);
4616 +-
4617 + put_device(dev->parent);
4618 + kfree(edev);
4619 + }
4620 +@@ -1634,8 +1628,7 @@ sas_rphy_remove(struct sas_rphy *rphy)
4621 + }
4622 +
4623 + sas_rphy_unlink(rphy);
4624 +- if (rphy->q)
4625 +- bsg_unregister_queue(rphy->q);
4626 ++ bsg_remove_queue(rphy->q);
4627 + transport_remove_device(dev);
4628 + device_del(dev);
4629 + }
4630 +diff --git a/drivers/scsi/storvsc_drv.c b/drivers/scsi/storvsc_drv.c
4631 +index 542d2bac2922..5087ed6afbdc 100644
4632 +--- a/drivers/scsi/storvsc_drv.c
4633 ++++ b/drivers/scsi/storvsc_drv.c
4634 +@@ -1835,9 +1835,11 @@ static int storvsc_probe(struct hv_device *device,
4635 + */
4636 + host->sg_tablesize = (stor_device->max_transfer_bytes >> PAGE_SHIFT);
4637 + /*
4638 ++ * For non-IDE disks, the host supports multiple channels.
4639 + * Set the number of HW queues we are supporting.
4640 + */
4641 +- host->nr_hw_queues = num_present_cpus();
4642 ++ if (!dev_is_ide)
4643 ++ host->nr_hw_queues = num_present_cpus();
4644 +
4645 + /*
4646 + * Set the error handler work queue.
4647 +diff --git a/drivers/soc/amlogic/meson-ee-pwrc.c b/drivers/soc/amlogic/meson-ee-pwrc.c
4648 +index 5823f5b67d16..3f0261d53ad9 100644
4649 +--- a/drivers/soc/amlogic/meson-ee-pwrc.c
4650 ++++ b/drivers/soc/amlogic/meson-ee-pwrc.c
4651 +@@ -323,6 +323,8 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev,
4652 + struct meson_ee_pwrc *pwrc,
4653 + struct meson_ee_pwrc_domain *dom)
4654 + {
4655 ++ int ret;
4656 ++
4657 + dom->pwrc = pwrc;
4658 + dom->num_rstc = dom->desc.reset_names_count;
4659 + dom->num_clks = dom->desc.clk_names_count;
4660 +@@ -368,15 +370,21 @@ static int meson_ee_pwrc_init_domain(struct platform_device *pdev,
4661 + * prepare/enable counters won't be in sync.
4662 + */
4663 + if (dom->num_clks && dom->desc.get_power && !dom->desc.get_power(dom)) {
4664 +- int ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
4665 ++ ret = clk_bulk_prepare_enable(dom->num_clks, dom->clks);
4666 + if (ret)
4667 + return ret;
4668 +
4669 +- pm_genpd_init(&dom->base, &pm_domain_always_on_gov, false);
4670 +- } else
4671 +- pm_genpd_init(&dom->base, NULL,
4672 +- (dom->desc.get_power ?
4673 +- dom->desc.get_power(dom) : true));
4674 ++ ret = pm_genpd_init(&dom->base, &pm_domain_always_on_gov,
4675 ++ false);
4676 ++ if (ret)
4677 ++ return ret;
4678 ++ } else {
4679 ++ ret = pm_genpd_init(&dom->base, NULL,
4680 ++ (dom->desc.get_power ?
4681 ++ dom->desc.get_power(dom) : true));
4682 ++ if (ret)
4683 ++ return ret;
4684 ++ }
4685 +
4686 + return 0;
4687 + }
4688 +@@ -441,9 +449,7 @@ static int meson_ee_pwrc_probe(struct platform_device *pdev)
4689 + pwrc->xlate.domains[i] = &dom->base;
4690 + }
4691 +
4692 +- of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate);
4693 +-
4694 +- return 0;
4695 ++ return of_genpd_add_provider_onecell(pdev->dev.of_node, &pwrc->xlate);
4696 + }
4697 +
4698 + static void meson_ee_pwrc_shutdown(struct platform_device *pdev)
4699 +diff --git a/drivers/staging/comedi/drivers/ni_routes.c b/drivers/staging/comedi/drivers/ni_routes.c
4700 +index eb61494dc2bd..88beb0d6c42b 100644
4701 +--- a/drivers/staging/comedi/drivers/ni_routes.c
4702 ++++ b/drivers/staging/comedi/drivers/ni_routes.c
4703 +@@ -74,9 +74,6 @@ static int ni_find_device_routes(const char *device_family,
4704 + }
4705 + }
4706 +
4707 +- if (!rv)
4708 +- return -ENODATA;
4709 +-
4710 + /* Second, find the set of routes valid for this device. */
4711 + for (i = 0; ni_device_routes_list[i]; ++i) {
4712 + if (memcmp(ni_device_routes_list[i]->device, board_name,
4713 +@@ -86,12 +83,12 @@ static int ni_find_device_routes(const char *device_family,
4714 + }
4715 + }
4716 +
4717 +- if (!dr)
4718 +- return -ENODATA;
4719 +-
4720 + tables->route_values = rv;
4721 + tables->valid_routes = dr;
4722 +
4723 ++ if (!rv || !dr)
4724 ++ return -ENODATA;
4725 ++
4726 + return 0;
4727 + }
4728 +
4729 +@@ -489,6 +486,9 @@ int ni_find_route_source(const u8 src_sel_reg_value, int dest,
4730 + {
4731 + int src;
4732 +
4733 ++ if (!tables->route_values)
4734 ++ return -EINVAL;
4735 ++
4736 + dest = B(dest); /* subtract NI names offset */
4737 + /* ensure we are not going to under/over run the route value table */
4738 + if (dest < 0 || dest >= NI_NUM_NAMES)
4739 +diff --git a/drivers/target/target_core_fabric_lib.c b/drivers/target/target_core_fabric_lib.c
4740 +index 3c79411c4cd0..6b4b354c88aa 100644
4741 +--- a/drivers/target/target_core_fabric_lib.c
4742 ++++ b/drivers/target/target_core_fabric_lib.c
4743 +@@ -118,7 +118,7 @@ static int srp_get_pr_transport_id(
4744 + memset(buf + 8, 0, leading_zero_bytes);
4745 + rc = hex2bin(buf + 8 + leading_zero_bytes, p, count);
4746 + if (rc < 0) {
4747 +- pr_debug("hex2bin failed for %s: %d\n", __func__, rc);
4748 ++ pr_debug("hex2bin failed for %s: %d\n", p, rc);
4749 + return rc;
4750 + }
4751 +
4752 +diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
4753 +index 8b23162e4239..4ac74b354801 100644
4754 +--- a/drivers/usb/core/hub.c
4755 ++++ b/drivers/usb/core/hub.c
4756 +@@ -1191,6 +1191,7 @@ static void hub_activate(struct usb_hub *hub, enum hub_activation_type type)
4757 + * PORT_OVER_CURRENT is not. So check for any of them.
4758 + */
4759 + if (udev || (portstatus & USB_PORT_STAT_CONNECTION) ||
4760 ++ (portchange & USB_PORT_STAT_C_CONNECTION) ||
4761 + (portstatus & USB_PORT_STAT_OVERCURRENT) ||
4762 + (portchange & USB_PORT_STAT_C_OVERCURRENT))
4763 + set_bit(port1, hub->change_bits);
4764 +diff --git a/drivers/usb/serial/ch341.c b/drivers/usb/serial/ch341.c
4765 +index 3bb1fff02bed..955ab97b9b22 100644
4766 +--- a/drivers/usb/serial/ch341.c
4767 ++++ b/drivers/usb/serial/ch341.c
4768 +@@ -589,9 +589,13 @@ static int ch341_tiocmget(struct tty_struct *tty)
4769 + static int ch341_reset_resume(struct usb_serial *serial)
4770 + {
4771 + struct usb_serial_port *port = serial->port[0];
4772 +- struct ch341_private *priv = usb_get_serial_port_data(port);
4773 ++ struct ch341_private *priv;
4774 + int ret;
4775 +
4776 ++ priv = usb_get_serial_port_data(port);
4777 ++ if (!priv)
4778 ++ return 0;
4779 ++
4780 + /* reconfigure ch341 serial port after bus-reset */
4781 + ch341_configure(serial->dev, priv);
4782 +
4783 +diff --git a/drivers/usb/serial/io_edgeport.c b/drivers/usb/serial/io_edgeport.c
4784 +index 9690a5f4b9d6..5737add6a2a4 100644
4785 +--- a/drivers/usb/serial/io_edgeport.c
4786 ++++ b/drivers/usb/serial/io_edgeport.c
4787 +@@ -716,7 +716,7 @@ static void edge_interrupt_callback(struct urb *urb)
4788 + if (txCredits) {
4789 + port = edge_serial->serial->port[portNumber];
4790 + edge_port = usb_get_serial_port_data(port);
4791 +- if (edge_port->open) {
4792 ++ if (edge_port && edge_port->open) {
4793 + spin_lock_irqsave(&edge_port->ep_lock,
4794 + flags);
4795 + edge_port->txCredits += txCredits;
4796 +@@ -1725,7 +1725,8 @@ static void edge_break(struct tty_struct *tty, int break_state)
4797 + static void process_rcvd_data(struct edgeport_serial *edge_serial,
4798 + unsigned char *buffer, __u16 bufferLength)
4799 + {
4800 +- struct device *dev = &edge_serial->serial->dev->dev;
4801 ++ struct usb_serial *serial = edge_serial->serial;
4802 ++ struct device *dev = &serial->dev->dev;
4803 + struct usb_serial_port *port;
4804 + struct edgeport_port *edge_port;
4805 + __u16 lastBufferLength;
4806 +@@ -1821,11 +1822,10 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial,
4807 +
4808 + /* spit this data back into the tty driver if this
4809 + port is open */
4810 +- if (rxLen) {
4811 +- port = edge_serial->serial->port[
4812 +- edge_serial->rxPort];
4813 ++ if (rxLen && edge_serial->rxPort < serial->num_ports) {
4814 ++ port = serial->port[edge_serial->rxPort];
4815 + edge_port = usb_get_serial_port_data(port);
4816 +- if (edge_port->open) {
4817 ++ if (edge_port && edge_port->open) {
4818 + dev_dbg(dev, "%s - Sending %d bytes to TTY for port %d\n",
4819 + __func__, rxLen,
4820 + edge_serial->rxPort);
4821 +@@ -1833,8 +1833,8 @@ static void process_rcvd_data(struct edgeport_serial *edge_serial,
4822 + rxLen);
4823 + edge_port->port->icount.rx += rxLen;
4824 + }
4825 +- buffer += rxLen;
4826 + }
4827 ++ buffer += rxLen;
4828 + break;
4829 +
4830 + case EXPECT_HDR3: /* Expect 3rd byte of status header */
4831 +@@ -1869,6 +1869,8 @@ static void process_rcvd_status(struct edgeport_serial *edge_serial,
4832 + __u8 code = edge_serial->rxStatusCode;
4833 +
4834 + /* switch the port pointer to the one being currently talked about */
4835 ++ if (edge_serial->rxPort >= edge_serial->serial->num_ports)
4836 ++ return;
4837 + port = edge_serial->serial->port[edge_serial->rxPort];
4838 + edge_port = usb_get_serial_port_data(port);
4839 + if (edge_port == NULL) {
4840 +diff --git a/drivers/usb/serial/keyspan.c b/drivers/usb/serial/keyspan.c
4841 +index e66a59ef43a1..aa3dbce22cfb 100644
4842 +--- a/drivers/usb/serial/keyspan.c
4843 ++++ b/drivers/usb/serial/keyspan.c
4844 +@@ -1058,6 +1058,8 @@ static void usa49_glocont_callback(struct urb *urb)
4845 + for (i = 0; i < serial->num_ports; ++i) {
4846 + port = serial->port[i];
4847 + p_priv = usb_get_serial_port_data(port);
4848 ++ if (!p_priv)
4849 ++ continue;
4850 +
4851 + if (p_priv->resend_cont) {
4852 + dev_dbg(&port->dev, "%s - sending setup\n", __func__);
4853 +@@ -1459,6 +1461,8 @@ static void usa67_glocont_callback(struct urb *urb)
4854 + for (i = 0; i < serial->num_ports; ++i) {
4855 + port = serial->port[i];
4856 + p_priv = usb_get_serial_port_data(port);
4857 ++ if (!p_priv)
4858 ++ continue;
4859 +
4860 + if (p_priv->resend_cont) {
4861 + dev_dbg(&port->dev, "%s - sending setup\n", __func__);
4862 +diff --git a/drivers/usb/serial/opticon.c b/drivers/usb/serial/opticon.c
4863 +index cb7aac9cd9e7..ed2b4e6dca38 100644
4864 +--- a/drivers/usb/serial/opticon.c
4865 ++++ b/drivers/usb/serial/opticon.c
4866 +@@ -113,7 +113,7 @@ static int send_control_msg(struct usb_serial_port *port, u8 requesttype,
4867 + retval = usb_control_msg(serial->dev, usb_sndctrlpipe(serial->dev, 0),
4868 + requesttype,
4869 + USB_DIR_OUT|USB_TYPE_VENDOR|USB_RECIP_INTERFACE,
4870 +- 0, 0, buffer, 1, 0);
4871 ++ 0, 0, buffer, 1, USB_CTRL_SET_TIMEOUT);
4872 + kfree(buffer);
4873 +
4874 + if (retval < 0)
4875 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
4876 +index 2d919d0e6e45..084cc2fff3ae 100644
4877 +--- a/drivers/usb/serial/option.c
4878 ++++ b/drivers/usb/serial/option.c
4879 +@@ -248,6 +248,7 @@ static void option_instat_callback(struct urb *urb);
4880 + #define QUECTEL_PRODUCT_BG96 0x0296
4881 + #define QUECTEL_PRODUCT_EP06 0x0306
4882 + #define QUECTEL_PRODUCT_EM12 0x0512
4883 ++#define QUECTEL_PRODUCT_RM500Q 0x0800
4884 +
4885 + #define CMOTECH_VENDOR_ID 0x16d8
4886 + #define CMOTECH_PRODUCT_6001 0x6001
4887 +@@ -1104,6 +1105,11 @@ static const struct usb_device_id option_ids[] = {
4888 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0xff, 0xff),
4889 + .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 },
4890 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM12, 0xff, 0, 0) },
4891 ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x30) },
4892 ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0, 0) },
4893 ++ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500Q, 0xff, 0xff, 0x10),
4894 ++ .driver_info = ZLP },
4895 ++
4896 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6001) },
4897 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_CMU_300) },
4898 + { USB_DEVICE(CMOTECH_VENDOR_ID, CMOTECH_PRODUCT_6003),
4899 +diff --git a/drivers/usb/serial/quatech2.c b/drivers/usb/serial/quatech2.c
4900 +index a62981ca7a73..f93b81a297d6 100644
4901 +--- a/drivers/usb/serial/quatech2.c
4902 ++++ b/drivers/usb/serial/quatech2.c
4903 +@@ -841,7 +841,10 @@ static void qt2_update_msr(struct usb_serial_port *port, unsigned char *ch)
4904 + u8 newMSR = (u8) *ch;
4905 + unsigned long flags;
4906 +
4907 ++ /* May be called from qt2_process_read_urb() for an unbound port. */
4908 + port_priv = usb_get_serial_port_data(port);
4909 ++ if (!port_priv)
4910 ++ return;
4911 +
4912 + spin_lock_irqsave(&port_priv->lock, flags);
4913 + port_priv->shadowMSR = newMSR;
4914 +@@ -869,7 +872,10 @@ static void qt2_update_lsr(struct usb_serial_port *port, unsigned char *ch)
4915 + unsigned long flags;
4916 + u8 newLSR = (u8) *ch;
4917 +
4918 ++ /* May be called from qt2_process_read_urb() for an unbound port. */
4919 + port_priv = usb_get_serial_port_data(port);
4920 ++ if (!port_priv)
4921 ++ return;
4922 +
4923 + if (newLSR & UART_LSR_BI)
4924 + newLSR &= (u8) (UART_LSR_OE | UART_LSR_BI);
4925 +diff --git a/drivers/usb/serial/usb-serial-simple.c b/drivers/usb/serial/usb-serial-simple.c
4926 +index edbbb13d6de6..bd23a7cb1be2 100644
4927 +--- a/drivers/usb/serial/usb-serial-simple.c
4928 ++++ b/drivers/usb/serial/usb-serial-simple.c
4929 +@@ -86,6 +86,8 @@ DEVICE(moto_modem, MOTO_IDS);
4930 + #define MOTOROLA_TETRA_IDS() \
4931 + { USB_DEVICE(0x0cad, 0x9011) }, /* Motorola Solutions TETRA PEI */ \
4932 + { USB_DEVICE(0x0cad, 0x9012) }, /* MTP6550 */ \
4933 ++ { USB_DEVICE(0x0cad, 0x9013) }, /* MTP3xxx */ \
4934 ++ { USB_DEVICE(0x0cad, 0x9015) }, /* MTP85xx */ \
4935 + { USB_DEVICE(0x0cad, 0x9016) } /* TPG2200 */
4936 + DEVICE(motorola_tetra, MOTOROLA_TETRA_IDS);
4937 +
4938 +diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c
4939 +index 8f066bb55d7d..dc7a65b9ec98 100644
4940 +--- a/drivers/usb/serial/usb-serial.c
4941 ++++ b/drivers/usb/serial/usb-serial.c
4942 +@@ -1317,6 +1317,9 @@ static int usb_serial_register(struct usb_serial_driver *driver)
4943 + return -EINVAL;
4944 + }
4945 +
4946 ++ /* Prevent individual ports from being unbound. */
4947 ++ driver->driver.suppress_bind_attrs = true;
4948 ++
4949 + usb_serial_operations_init(driver);
4950 +
4951 + /* Add this device to our list of devices */
4952 +diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
4953 +index 0b2758961b1c..6f0568fb5899 100644
4954 +--- a/fs/btrfs/inode.c
4955 ++++ b/fs/btrfs/inode.c
4956 +@@ -4215,18 +4215,30 @@ out:
4957 + }
4958 +
4959 + static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
4960 +- struct inode *dir, u64 objectid,
4961 +- const char *name, int name_len)
4962 ++ struct inode *dir, struct dentry *dentry)
4963 + {
4964 + struct btrfs_root *root = BTRFS_I(dir)->root;
4965 ++ struct btrfs_inode *inode = BTRFS_I(d_inode(dentry));
4966 + struct btrfs_path *path;
4967 + struct extent_buffer *leaf;
4968 + struct btrfs_dir_item *di;
4969 + struct btrfs_key key;
4970 ++ const char *name = dentry->d_name.name;
4971 ++ int name_len = dentry->d_name.len;
4972 + u64 index;
4973 + int ret;
4974 ++ u64 objectid;
4975 + u64 dir_ino = btrfs_ino(BTRFS_I(dir));
4976 +
4977 ++ if (btrfs_ino(inode) == BTRFS_FIRST_FREE_OBJECTID) {
4978 ++ objectid = inode->root->root_key.objectid;
4979 ++ } else if (btrfs_ino(inode) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) {
4980 ++ objectid = inode->location.objectid;
4981 ++ } else {
4982 ++ WARN_ON(1);
4983 ++ return -EINVAL;
4984 ++ }
4985 ++
4986 + path = btrfs_alloc_path();
4987 + if (!path)
4988 + return -ENOMEM;
4989 +@@ -4248,13 +4260,16 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
4990 + }
4991 + btrfs_release_path(path);
4992 +
4993 +- ret = btrfs_del_root_ref(trans, objectid, root->root_key.objectid,
4994 +- dir_ino, &index, name, name_len);
4995 +- if (ret < 0) {
4996 +- if (ret != -ENOENT) {
4997 +- btrfs_abort_transaction(trans, ret);
4998 +- goto out;
4999 +- }
5000 ++ /*
5001 ++ * This is a placeholder inode for a subvolume we didn't have a
5002 ++ * reference to at the time of the snapshot creation. In the meantime
5003 ++ * we could have renamed the real subvol link into our snapshot, so
5004 ++ * depending on btrfs_del_root_ref to return -ENOENT here is incorret.
5005 ++ * Instead simply lookup the dir_index_item for this entry so we can
5006 ++ * remove it. Otherwise we know we have a ref to the root and we can
5007 ++ * call btrfs_del_root_ref, and it _shouldn't_ fail.
5008 ++ */
5009 ++ if (btrfs_ino(inode) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID) {
5010 + di = btrfs_search_dir_index_item(root, path, dir_ino,
5011 + name, name_len);
5012 + if (IS_ERR_OR_NULL(di)) {
5013 +@@ -4269,8 +4284,16 @@ static int btrfs_unlink_subvol(struct btrfs_trans_handle *trans,
5014 + leaf = path->nodes[0];
5015 + btrfs_item_key_to_cpu(leaf, &key, path->slots[0]);
5016 + index = key.offset;
5017 ++ btrfs_release_path(path);
5018 ++ } else {
5019 ++ ret = btrfs_del_root_ref(trans, objectid,
5020 ++ root->root_key.objectid, dir_ino,
5021 ++ &index, name, name_len);
5022 ++ if (ret) {
5023 ++ btrfs_abort_transaction(trans, ret);
5024 ++ goto out;
5025 ++ }
5026 + }
5027 +- btrfs_release_path(path);
5028 +
5029 + ret = btrfs_delete_delayed_dir_index(trans, BTRFS_I(dir), index);
5030 + if (ret) {
5031 +@@ -4464,8 +4487,7 @@ int btrfs_delete_subvolume(struct inode *dir, struct dentry *dentry)
5032 +
5033 + btrfs_record_snapshot_destroy(trans, BTRFS_I(dir));
5034 +
5035 +- ret = btrfs_unlink_subvol(trans, dir, dest->root_key.objectid,
5036 +- dentry->d_name.name, dentry->d_name.len);
5037 ++ ret = btrfs_unlink_subvol(trans, dir, dentry);
5038 + if (ret) {
5039 + err = ret;
5040 + btrfs_abort_transaction(trans, ret);
5041 +@@ -4560,10 +4582,7 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
5042 + return PTR_ERR(trans);
5043 +
5044 + if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
5045 +- err = btrfs_unlink_subvol(trans, dir,
5046 +- BTRFS_I(inode)->location.objectid,
5047 +- dentry->d_name.name,
5048 +- dentry->d_name.len);
5049 ++ err = btrfs_unlink_subvol(trans, dir, dentry);
5050 + goto out;
5051 + }
5052 +
5053 +@@ -9519,7 +9538,6 @@ static int btrfs_rename_exchange(struct inode *old_dir,
5054 + u64 new_ino = btrfs_ino(BTRFS_I(new_inode));
5055 + u64 old_idx = 0;
5056 + u64 new_idx = 0;
5057 +- u64 root_objectid;
5058 + int ret;
5059 + bool root_log_pinned = false;
5060 + bool dest_log_pinned = false;
5061 +@@ -9625,10 +9643,7 @@ static int btrfs_rename_exchange(struct inode *old_dir,
5062 +
5063 + /* src is a subvolume */
5064 + if (old_ino == BTRFS_FIRST_FREE_OBJECTID) {
5065 +- root_objectid = BTRFS_I(old_inode)->root->root_key.objectid;
5066 +- ret = btrfs_unlink_subvol(trans, old_dir, root_objectid,
5067 +- old_dentry->d_name.name,
5068 +- old_dentry->d_name.len);
5069 ++ ret = btrfs_unlink_subvol(trans, old_dir, old_dentry);
5070 + } else { /* src is an inode */
5071 + ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir),
5072 + BTRFS_I(old_dentry->d_inode),
5073 +@@ -9644,10 +9659,7 @@ static int btrfs_rename_exchange(struct inode *old_dir,
5074 +
5075 + /* dest is a subvolume */
5076 + if (new_ino == BTRFS_FIRST_FREE_OBJECTID) {
5077 +- root_objectid = BTRFS_I(new_inode)->root->root_key.objectid;
5078 +- ret = btrfs_unlink_subvol(trans, new_dir, root_objectid,
5079 +- new_dentry->d_name.name,
5080 +- new_dentry->d_name.len);
5081 ++ ret = btrfs_unlink_subvol(trans, new_dir, new_dentry);
5082 + } else { /* dest is an inode */
5083 + ret = __btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir),
5084 + BTRFS_I(new_dentry->d_inode),
5085 +@@ -9845,7 +9857,6 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
5086 + struct inode *new_inode = d_inode(new_dentry);
5087 + struct inode *old_inode = d_inode(old_dentry);
5088 + u64 index = 0;
5089 +- u64 root_objectid;
5090 + int ret;
5091 + u64 old_ino = btrfs_ino(BTRFS_I(old_inode));
5092 + bool log_pinned = false;
5093 +@@ -9953,10 +9964,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
5094 + BTRFS_I(old_inode), 1);
5095 +
5096 + if (unlikely(old_ino == BTRFS_FIRST_FREE_OBJECTID)) {
5097 +- root_objectid = BTRFS_I(old_inode)->root->root_key.objectid;
5098 +- ret = btrfs_unlink_subvol(trans, old_dir, root_objectid,
5099 +- old_dentry->d_name.name,
5100 +- old_dentry->d_name.len);
5101 ++ ret = btrfs_unlink_subvol(trans, old_dir, old_dentry);
5102 + } else {
5103 + ret = __btrfs_unlink_inode(trans, root, BTRFS_I(old_dir),
5104 + BTRFS_I(d_inode(old_dentry)),
5105 +@@ -9975,10 +9983,7 @@ static int btrfs_rename(struct inode *old_dir, struct dentry *old_dentry,
5106 + new_inode->i_ctime = current_time(new_inode);
5107 + if (unlikely(btrfs_ino(BTRFS_I(new_inode)) ==
5108 + BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
5109 +- root_objectid = BTRFS_I(new_inode)->location.objectid;
5110 +- ret = btrfs_unlink_subvol(trans, new_dir, root_objectid,
5111 +- new_dentry->d_name.name,
5112 +- new_dentry->d_name.len);
5113 ++ ret = btrfs_unlink_subvol(trans, new_dir, new_dentry);
5114 + BUG_ON(new_inode->i_nlink == 0);
5115 + } else {
5116 + ret = btrfs_unlink_inode(trans, dest, BTRFS_I(new_dir),
5117 +diff --git a/fs/btrfs/ioctl.c b/fs/btrfs/ioctl.c
5118 +index 5720e450a46f..8e86b2d700c4 100644
5119 +--- a/fs/btrfs/ioctl.c
5120 ++++ b/fs/btrfs/ioctl.c
5121 +@@ -4254,7 +4254,19 @@ static long btrfs_ioctl_scrub(struct file *file, void __user *arg)
5122 + &sa->progress, sa->flags & BTRFS_SCRUB_READONLY,
5123 + 0);
5124 +
5125 +- if (ret == 0 && copy_to_user(arg, sa, sizeof(*sa)))
5126 ++ /*
5127 ++ * Copy scrub args to user space even if btrfs_scrub_dev() returned an
5128 ++ * error. This is important as it allows user space to know how much
5129 ++ * progress scrub has done. For example, if scrub is canceled we get
5130 ++ * -ECANCELED from btrfs_scrub_dev() and return that error back to user
5131 ++ * space. Later user space can inspect the progress from the structure
5132 ++ * btrfs_ioctl_scrub_args and resume scrub from where it left off
5133 ++ * previously (btrfs-progs does this).
5134 ++ * If we fail to copy the btrfs_ioctl_scrub_args structure to user space
5135 ++ * then return -EFAULT to signal the structure was not copied or it may
5136 ++ * be corrupt and unreliable due to a partial copy.
5137 ++ */
5138 ++ if (copy_to_user(arg, sa, sizeof(*sa)))
5139 + ret = -EFAULT;
5140 +
5141 + if (!(sa->flags & BTRFS_SCRUB_READONLY))
5142 +diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c
5143 +index aeb5f2f3cdd7..50517221638a 100644
5144 +--- a/fs/btrfs/qgroup.c
5145 ++++ b/fs/btrfs/qgroup.c
5146 +@@ -2423,8 +2423,12 @@ int btrfs_qgroup_account_extent(struct btrfs_trans_handle *trans, u64 bytenr,
5147 + u64 nr_old_roots = 0;
5148 + int ret = 0;
5149 +
5150 ++ /*
5151 ++ * If quotas get disabled meanwhile, the resouces need to be freed and
5152 ++ * we can't just exit here.
5153 ++ */
5154 + if (!test_bit(BTRFS_FS_QUOTA_ENABLED, &fs_info->flags))
5155 +- return 0;
5156 ++ goto out_free;
5157 +
5158 + if (new_roots) {
5159 + if (!maybe_fs_roots(new_roots))
5160 +diff --git a/fs/btrfs/relocation.c b/fs/btrfs/relocation.c
5161 +index fd0f4c1696c8..bc1d7f144ace 100644
5162 +--- a/fs/btrfs/relocation.c
5163 ++++ b/fs/btrfs/relocation.c
5164 +@@ -517,6 +517,34 @@ static int update_backref_cache(struct btrfs_trans_handle *trans,
5165 + return 1;
5166 + }
5167 +
5168 ++static bool reloc_root_is_dead(struct btrfs_root *root)
5169 ++{
5170 ++ /*
5171 ++ * Pair with set_bit/clear_bit in clean_dirty_subvols and
5172 ++ * btrfs_update_reloc_root. We need to see the updated bit before
5173 ++ * trying to access reloc_root
5174 ++ */
5175 ++ smp_rmb();
5176 ++ if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state))
5177 ++ return true;
5178 ++ return false;
5179 ++}
5180 ++
5181 ++/*
5182 ++ * Check if this subvolume tree has valid reloc tree.
5183 ++ *
5184 ++ * Reloc tree after swap is considered dead, thus not considered as valid.
5185 ++ * This is enough for most callers, as they don't distinguish dead reloc root
5186 ++ * from no reloc root. But should_ignore_root() below is a special case.
5187 ++ */
5188 ++static bool have_reloc_root(struct btrfs_root *root)
5189 ++{
5190 ++ if (reloc_root_is_dead(root))
5191 ++ return false;
5192 ++ if (!root->reloc_root)
5193 ++ return false;
5194 ++ return true;
5195 ++}
5196 +
5197 + static int should_ignore_root(struct btrfs_root *root)
5198 + {
5199 +@@ -525,6 +553,10 @@ static int should_ignore_root(struct btrfs_root *root)
5200 + if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state))
5201 + return 0;
5202 +
5203 ++ /* This root has been merged with its reloc tree, we can ignore it */
5204 ++ if (reloc_root_is_dead(root))
5205 ++ return 1;
5206 ++
5207 + reloc_root = root->reloc_root;
5208 + if (!reloc_root)
5209 + return 0;
5210 +@@ -1439,7 +1471,7 @@ int btrfs_init_reloc_root(struct btrfs_trans_handle *trans,
5211 + * The subvolume has reloc tree but the swap is finished, no need to
5212 + * create/update the dead reloc tree
5213 + */
5214 +- if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state))
5215 ++ if (reloc_root_is_dead(root))
5216 + return 0;
5217 +
5218 + if (root->reloc_root) {
5219 +@@ -1478,8 +1510,7 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans,
5220 + struct btrfs_root_item *root_item;
5221 + int ret;
5222 +
5223 +- if (test_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state) ||
5224 +- !root->reloc_root)
5225 ++ if (!have_reloc_root(root))
5226 + goto out;
5227 +
5228 + reloc_root = root->reloc_root;
5229 +@@ -1489,6 +1520,11 @@ int btrfs_update_reloc_root(struct btrfs_trans_handle *trans,
5230 + if (fs_info->reloc_ctl->merge_reloc_tree &&
5231 + btrfs_root_refs(root_item) == 0) {
5232 + set_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state);
5233 ++ /*
5234 ++ * Mark the tree as dead before we change reloc_root so
5235 ++ * have_reloc_root will not touch it from now on.
5236 ++ */
5237 ++ smp_wmb();
5238 + __del_reloc_root(reloc_root);
5239 + }
5240 +
5241 +@@ -2202,6 +2238,11 @@ static int clean_dirty_subvols(struct reloc_control *rc)
5242 + if (ret2 < 0 && !ret)
5243 + ret = ret2;
5244 + }
5245 ++ /*
5246 ++ * Need barrier to ensure clear_bit() only happens after
5247 ++ * root->reloc_root = NULL. Pairs with have_reloc_root.
5248 ++ */
5249 ++ smp_wmb();
5250 + clear_bit(BTRFS_ROOT_DEAD_RELOC_TREE, &root->state);
5251 + btrfs_put_fs_root(root);
5252 + } else {
5253 +@@ -4721,7 +4762,7 @@ void btrfs_reloc_pre_snapshot(struct btrfs_pending_snapshot *pending,
5254 + struct btrfs_root *root = pending->root;
5255 + struct reloc_control *rc = root->fs_info->reloc_ctl;
5256 +
5257 +- if (!root->reloc_root || !rc)
5258 ++ if (!rc || !have_reloc_root(root))
5259 + return;
5260 +
5261 + if (!rc->merge_reloc_tree)
5262 +@@ -4755,7 +4796,7 @@ int btrfs_reloc_post_snapshot(struct btrfs_trans_handle *trans,
5263 + struct reloc_control *rc = root->fs_info->reloc_ctl;
5264 + int ret;
5265 +
5266 +- if (!root->reloc_root || !rc)
5267 ++ if (!rc || !have_reloc_root(root))
5268 + return 0;
5269 +
5270 + rc = root->fs_info->reloc_ctl;
5271 +diff --git a/fs/btrfs/root-tree.c b/fs/btrfs/root-tree.c
5272 +index 3b17b647d002..612411c74550 100644
5273 +--- a/fs/btrfs/root-tree.c
5274 ++++ b/fs/btrfs/root-tree.c
5275 +@@ -376,11 +376,13 @@ again:
5276 + leaf = path->nodes[0];
5277 + ref = btrfs_item_ptr(leaf, path->slots[0],
5278 + struct btrfs_root_ref);
5279 +-
5280 +- WARN_ON(btrfs_root_ref_dirid(leaf, ref) != dirid);
5281 +- WARN_ON(btrfs_root_ref_name_len(leaf, ref) != name_len);
5282 + ptr = (unsigned long)(ref + 1);
5283 +- WARN_ON(memcmp_extent_buffer(leaf, name, ptr, name_len));
5284 ++ if ((btrfs_root_ref_dirid(leaf, ref) != dirid) ||
5285 ++ (btrfs_root_ref_name_len(leaf, ref) != name_len) ||
5286 ++ memcmp_extent_buffer(leaf, name, ptr, name_len)) {
5287 ++ err = -ENOENT;
5288 ++ goto out;
5289 ++ }
5290 + *sequence = btrfs_root_ref_sequence(leaf, ref);
5291 +
5292 + ret = btrfs_del_item(trans, tree_root, path);
5293 +diff --git a/fs/btrfs/volumes.c b/fs/btrfs/volumes.c
5294 +index d8d7b1ee83ca..97f1ba7c18b2 100644
5295 +--- a/fs/btrfs/volumes.c
5296 ++++ b/fs/btrfs/volumes.c
5297 +@@ -4066,7 +4066,11 @@ int btrfs_balance(struct btrfs_fs_info *fs_info,
5298 + }
5299 + }
5300 +
5301 +- num_devices = btrfs_num_devices(fs_info);
5302 ++ /*
5303 ++ * rw_devices will not change at the moment, device add/delete/replace
5304 ++ * are excluded by EXCL_OP
5305 ++ */
5306 ++ num_devices = fs_info->fs_devices->rw_devices;
5307 +
5308 + /*
5309 + * SINGLE profile on-disk has no profile bit, but in-memory we have a
5310 +diff --git a/fs/fuse/file.c b/fs/fuse/file.c
5311 +index a63d779eac10..ce715380143c 100644
5312 +--- a/fs/fuse/file.c
5313 ++++ b/fs/fuse/file.c
5314 +@@ -882,6 +882,7 @@ static void fuse_send_readpages(struct fuse_io_args *ia, struct file *file)
5315 + struct fuse_args_pages *ap = &ia->ap;
5316 + loff_t pos = page_offset(ap->pages[0]);
5317 + size_t count = ap->num_pages << PAGE_SHIFT;
5318 ++ ssize_t res;
5319 + int err;
5320 +
5321 + ap->args.out_pages = true;
5322 +@@ -896,7 +897,8 @@ static void fuse_send_readpages(struct fuse_io_args *ia, struct file *file)
5323 + if (!err)
5324 + return;
5325 + } else {
5326 +- err = fuse_simple_request(fc, &ap->args);
5327 ++ res = fuse_simple_request(fc, &ap->args);
5328 ++ err = res < 0 ? res : 0;
5329 + }
5330 + fuse_readpages_end(fc, &ap->args, err);
5331 + }
5332 +diff --git a/fs/io_uring.c b/fs/io_uring.c
5333 +index 709671faaed6..b1c9ad1fb9e1 100644
5334 +--- a/fs/io_uring.c
5335 ++++ b/fs/io_uring.c
5336 +@@ -3716,6 +3716,12 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit,
5337 + wake_up(&ctx->sqo_wait);
5338 + submitted = to_submit;
5339 + } else if (to_submit) {
5340 ++ if (current->mm != ctx->sqo_mm ||
5341 ++ current_cred() != ctx->creds) {
5342 ++ ret = -EPERM;
5343 ++ goto out;
5344 ++ }
5345 ++
5346 + to_submit = min(to_submit, ctx->sq_entries);
5347 +
5348 + mutex_lock(&ctx->uring_lock);
5349 +diff --git a/fs/reiserfs/xattr.c b/fs/reiserfs/xattr.c
5350 +index 62b40df36c98..28b241cd6987 100644
5351 +--- a/fs/reiserfs/xattr.c
5352 ++++ b/fs/reiserfs/xattr.c
5353 +@@ -319,8 +319,12 @@ static int reiserfs_for_each_xattr(struct inode *inode,
5354 + out_dir:
5355 + dput(dir);
5356 + out:
5357 +- /* -ENODATA isn't an error */
5358 +- if (err == -ENODATA)
5359 ++ /*
5360 ++ * -ENODATA: this object doesn't have any xattrs
5361 ++ * -EOPNOTSUPP: this file system doesn't have xattrs enabled on disk.
5362 ++ * Neither are errors
5363 ++ */
5364 ++ if (err == -ENODATA || err == -EOPNOTSUPP)
5365 + err = 0;
5366 + return err;
5367 + }
5368 +diff --git a/include/dt-bindings/reset/amlogic,meson8b-reset.h b/include/dt-bindings/reset/amlogic,meson8b-reset.h
5369 +index c614438bcbdb..fbc524a900da 100644
5370 +--- a/include/dt-bindings/reset/amlogic,meson8b-reset.h
5371 ++++ b/include/dt-bindings/reset/amlogic,meson8b-reset.h
5372 +@@ -46,9 +46,9 @@
5373 + #define RESET_VD_RMEM 64
5374 + #define RESET_AUDIN 65
5375 + #define RESET_DBLK 66
5376 +-#define RESET_PIC_DC 66
5377 +-#define RESET_PSC 66
5378 +-#define RESET_NAND 66
5379 ++#define RESET_PIC_DC 67
5380 ++#define RESET_PSC 68
5381 ++#define RESET_NAND 69
5382 + #define RESET_GE2D 70
5383 + #define RESET_PARSER_REG 71
5384 + #define RESET_PARSER_FETCH 72
5385 +diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
5386 +index f3ea78b0c91c..51ccb4b8770a 100644
5387 +--- a/include/linux/blkdev.h
5388 ++++ b/include/linux/blkdev.h
5389 +@@ -328,6 +328,7 @@ struct queue_limits {
5390 + unsigned int max_sectors;
5391 + unsigned int max_segment_size;
5392 + unsigned int physical_block_size;
5393 ++ unsigned int logical_block_size;
5394 + unsigned int alignment_offset;
5395 + unsigned int io_min;
5396 + unsigned int io_opt;
5397 +@@ -338,7 +339,6 @@ struct queue_limits {
5398 + unsigned int discard_granularity;
5399 + unsigned int discard_alignment;
5400 +
5401 +- unsigned short logical_block_size;
5402 + unsigned short max_segments;
5403 + unsigned short max_integrity_segments;
5404 + unsigned short max_discard_segments;
5405 +@@ -1080,7 +1080,7 @@ extern void blk_queue_max_write_same_sectors(struct request_queue *q,
5406 + unsigned int max_write_same_sectors);
5407 + extern void blk_queue_max_write_zeroes_sectors(struct request_queue *q,
5408 + unsigned int max_write_same_sectors);
5409 +-extern void blk_queue_logical_block_size(struct request_queue *, unsigned short);
5410 ++extern void blk_queue_logical_block_size(struct request_queue *, unsigned int);
5411 + extern void blk_queue_physical_block_size(struct request_queue *, unsigned int);
5412 + extern void blk_queue_alignment_offset(struct request_queue *q,
5413 + unsigned int alignment);
5414 +@@ -1294,7 +1294,7 @@ static inline unsigned int queue_max_segment_size(const struct request_queue *q)
5415 + return q->limits.max_segment_size;
5416 + }
5417 +
5418 +-static inline unsigned short queue_logical_block_size(const struct request_queue *q)
5419 ++static inline unsigned queue_logical_block_size(const struct request_queue *q)
5420 + {
5421 + int retval = 512;
5422 +
5423 +@@ -1304,7 +1304,7 @@ static inline unsigned short queue_logical_block_size(const struct request_queue
5424 + return retval;
5425 + }
5426 +
5427 +-static inline unsigned short bdev_logical_block_size(struct block_device *bdev)
5428 ++static inline unsigned int bdev_logical_block_size(struct block_device *bdev)
5429 + {
5430 + return queue_logical_block_size(bdev_get_queue(bdev));
5431 + }
5432 +diff --git a/include/linux/mm.h b/include/linux/mm.h
5433 +index a2adf95b3f9c..b249d2e033aa 100644
5434 +--- a/include/linux/mm.h
5435 ++++ b/include/linux/mm.h
5436 +@@ -2666,13 +2666,25 @@ static inline bool want_init_on_free(void)
5437 + !page_poisoning_enabled();
5438 + }
5439 +
5440 +-#ifdef CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT
5441 +-DECLARE_STATIC_KEY_TRUE(_debug_pagealloc_enabled);
5442 ++#ifdef CONFIG_DEBUG_PAGEALLOC
5443 ++extern void init_debug_pagealloc(void);
5444 + #else
5445 +-DECLARE_STATIC_KEY_FALSE(_debug_pagealloc_enabled);
5446 ++static inline void init_debug_pagealloc(void) {}
5447 + #endif
5448 ++extern bool _debug_pagealloc_enabled_early;
5449 ++DECLARE_STATIC_KEY_FALSE(_debug_pagealloc_enabled);
5450 +
5451 + static inline bool debug_pagealloc_enabled(void)
5452 ++{
5453 ++ return IS_ENABLED(CONFIG_DEBUG_PAGEALLOC) &&
5454 ++ _debug_pagealloc_enabled_early;
5455 ++}
5456 ++
5457 ++/*
5458 ++ * For use in fast paths after init_debug_pagealloc() has run, or when a
5459 ++ * false negative result is not harmful when called too early.
5460 ++ */
5461 ++static inline bool debug_pagealloc_enabled_static(void)
5462 + {
5463 + if (!IS_ENABLED(CONFIG_DEBUG_PAGEALLOC))
5464 + return false;
5465 +diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
5466 +index bda20282746b..8b5f758942a2 100644
5467 +--- a/include/linux/mmzone.h
5468 ++++ b/include/linux/mmzone.h
5469 +@@ -215,9 +215,8 @@ enum node_stat_item {
5470 + NR_INACTIVE_FILE, /* " " " " " */
5471 + NR_ACTIVE_FILE, /* " " " " " */
5472 + NR_UNEVICTABLE, /* " " " " " */
5473 +- NR_SLAB_RECLAIMABLE, /* Please do not reorder this item */
5474 +- NR_SLAB_UNRECLAIMABLE, /* and this one without looking at
5475 +- * memcg_flush_percpu_vmstats() first. */
5476 ++ NR_SLAB_RECLAIMABLE,
5477 ++ NR_SLAB_UNRECLAIMABLE,
5478 + NR_ISOLATED_ANON, /* Temporary isolated pages from anon lru */
5479 + NR_ISOLATED_FILE, /* Temporary isolated pages from file lru */
5480 + WORKINGSET_NODES,
5481 +diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
5482 +index 76d952aeb0fc..13f09706033a 100644
5483 +--- a/include/linux/netdevice.h
5484 ++++ b/include/linux/netdevice.h
5485 +@@ -1761,7 +1761,7 @@ enum netdev_priv_flags {
5486 + * for hardware timestamping
5487 + * @sfp_bus: attached &struct sfp_bus structure.
5488 + * @qdisc_tx_busylock_key: lockdep class annotating Qdisc->busylock
5489 +- spinlock
5490 ++ * spinlock
5491 + * @qdisc_running_key: lockdep class annotating Qdisc->running seqcount
5492 + * @qdisc_xmit_lock_key: lockdep class annotating
5493 + * netdev_queue->_xmit_lock spinlock
5494 +diff --git a/include/linux/regulator/ab8500.h b/include/linux/regulator/ab8500.h
5495 +index 505e94a6e3e8..3ab1ddf151a2 100644
5496 +--- a/include/linux/regulator/ab8500.h
5497 ++++ b/include/linux/regulator/ab8500.h
5498 +@@ -42,8 +42,6 @@ enum ab8505_regulator_id {
5499 + AB8505_LDO_ANAMIC2,
5500 + AB8505_LDO_AUX8,
5501 + AB8505_LDO_ANA,
5502 +- AB8505_SYSCLKREQ_2,
5503 +- AB8505_SYSCLKREQ_4,
5504 + AB8505_NUM_REGULATORS,
5505 + };
5506 +
5507 +diff --git a/include/linux/skmsg.h b/include/linux/skmsg.h
5508 +index da4caff7efa4..7eb6a8754f19 100644
5509 +--- a/include/linux/skmsg.h
5510 ++++ b/include/linux/skmsg.h
5511 +@@ -354,17 +354,22 @@ static inline void sk_psock_update_proto(struct sock *sk,
5512 + static inline void sk_psock_restore_proto(struct sock *sk,
5513 + struct sk_psock *psock)
5514 + {
5515 +- sk->sk_write_space = psock->saved_write_space;
5516 ++ sk->sk_prot->unhash = psock->saved_unhash;
5517 +
5518 + if (psock->sk_proto) {
5519 + struct inet_connection_sock *icsk = inet_csk(sk);
5520 + bool has_ulp = !!icsk->icsk_ulp_data;
5521 +
5522 +- if (has_ulp)
5523 +- tcp_update_ulp(sk, psock->sk_proto);
5524 +- else
5525 ++ if (has_ulp) {
5526 ++ tcp_update_ulp(sk, psock->sk_proto,
5527 ++ psock->saved_write_space);
5528 ++ } else {
5529 + sk->sk_prot = psock->sk_proto;
5530 ++ sk->sk_write_space = psock->saved_write_space;
5531 ++ }
5532 + psock->sk_proto = NULL;
5533 ++ } else {
5534 ++ sk->sk_write_space = psock->saved_write_space;
5535 + }
5536 + }
5537 +
5538 +diff --git a/include/linux/tnum.h b/include/linux/tnum.h
5539 +index c17af77f3fae..ea627d1ab7e3 100644
5540 +--- a/include/linux/tnum.h
5541 ++++ b/include/linux/tnum.h
5542 +@@ -30,7 +30,7 @@ struct tnum tnum_lshift(struct tnum a, u8 shift);
5543 + /* Shift (rsh) a tnum right (by a fixed shift) */
5544 + struct tnum tnum_rshift(struct tnum a, u8 shift);
5545 + /* Shift (arsh) a tnum right (by a fixed min_shift) */
5546 +-struct tnum tnum_arshift(struct tnum a, u8 min_shift);
5547 ++struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness);
5548 + /* Add two tnums, return @a + @b */
5549 + struct tnum tnum_add(struct tnum a, struct tnum b);
5550 + /* Subtract two tnums, return @a - @b */
5551 +diff --git a/include/net/tcp.h b/include/net/tcp.h
5552 +index b2367cfe0bda..830c89db1245 100644
5553 +--- a/include/net/tcp.h
5554 ++++ b/include/net/tcp.h
5555 +@@ -2132,7 +2132,8 @@ struct tcp_ulp_ops {
5556 + /* initialize ulp */
5557 + int (*init)(struct sock *sk);
5558 + /* update ulp */
5559 +- void (*update)(struct sock *sk, struct proto *p);
5560 ++ void (*update)(struct sock *sk, struct proto *p,
5561 ++ void (*write_space)(struct sock *sk));
5562 + /* cleanup ulp */
5563 + void (*release)(struct sock *sk);
5564 + /* diagnostic */
5565 +@@ -2147,7 +2148,8 @@ void tcp_unregister_ulp(struct tcp_ulp_ops *type);
5566 + int tcp_set_ulp(struct sock *sk, const char *name);
5567 + void tcp_get_available_ulp(char *buf, size_t len);
5568 + void tcp_cleanup_ulp(struct sock *sk);
5569 +-void tcp_update_ulp(struct sock *sk, struct proto *p);
5570 ++void tcp_update_ulp(struct sock *sk, struct proto *p,
5571 ++ void (*write_space)(struct sock *sk));
5572 +
5573 + #define MODULE_ALIAS_TCP_ULP(name) \
5574 + __MODULE_INFO(alias, alias_userspace, name); \
5575 +diff --git a/include/trace/events/huge_memory.h b/include/trace/events/huge_memory.h
5576 +index dd4db334bd63..d82a0f4e824d 100644
5577 +--- a/include/trace/events/huge_memory.h
5578 ++++ b/include/trace/events/huge_memory.h
5579 +@@ -31,7 +31,8 @@
5580 + EM( SCAN_ALLOC_HUGE_PAGE_FAIL, "alloc_huge_page_failed") \
5581 + EM( SCAN_CGROUP_CHARGE_FAIL, "ccgroup_charge_failed") \
5582 + EM( SCAN_EXCEED_SWAP_PTE, "exceed_swap_pte") \
5583 +- EMe(SCAN_TRUNCATED, "truncated") \
5584 ++ EM( SCAN_TRUNCATED, "truncated") \
5585 ++ EMe(SCAN_PAGE_HAS_PRIVATE, "page_has_private") \
5586 +
5587 + #undef EM
5588 + #undef EMe
5589 +diff --git a/init/main.c b/init/main.c
5590 +index 91f6ebb30ef0..c0206c507eba 100644
5591 +--- a/init/main.c
5592 ++++ b/init/main.c
5593 +@@ -553,6 +553,7 @@ static void __init mm_init(void)
5594 + * bigger than MAX_ORDER unless SPARSEMEM.
5595 + */
5596 + page_ext_init_flatmem();
5597 ++ init_debug_pagealloc();
5598 + report_meminit();
5599 + mem_init();
5600 + kmem_cache_init();
5601 +diff --git a/kernel/bpf/tnum.c b/kernel/bpf/tnum.c
5602 +index ca52b9642943..d4f335a9a899 100644
5603 +--- a/kernel/bpf/tnum.c
5604 ++++ b/kernel/bpf/tnum.c
5605 +@@ -44,14 +44,19 @@ struct tnum tnum_rshift(struct tnum a, u8 shift)
5606 + return TNUM(a.value >> shift, a.mask >> shift);
5607 + }
5608 +
5609 +-struct tnum tnum_arshift(struct tnum a, u8 min_shift)
5610 ++struct tnum tnum_arshift(struct tnum a, u8 min_shift, u8 insn_bitness)
5611 + {
5612 + /* if a.value is negative, arithmetic shifting by minimum shift
5613 + * will have larger negative offset compared to more shifting.
5614 + * If a.value is nonnegative, arithmetic shifting by minimum shift
5615 + * will have larger positive offset compare to more shifting.
5616 + */
5617 +- return TNUM((s64)a.value >> min_shift, (s64)a.mask >> min_shift);
5618 ++ if (insn_bitness == 32)
5619 ++ return TNUM((u32)(((s32)a.value) >> min_shift),
5620 ++ (u32)(((s32)a.mask) >> min_shift));
5621 ++ else
5622 ++ return TNUM((s64)a.value >> min_shift,
5623 ++ (s64)a.mask >> min_shift);
5624 + }
5625 +
5626 + struct tnum tnum_add(struct tnum a, struct tnum b)
5627 +diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
5628 +index 9c74c98f6501..b2817d0929b3 100644
5629 +--- a/kernel/bpf/verifier.c
5630 ++++ b/kernel/bpf/verifier.c
5631 +@@ -4824,9 +4824,16 @@ static int adjust_scalar_min_max_vals(struct bpf_verifier_env *env,
5632 + /* Upon reaching here, src_known is true and
5633 + * umax_val is equal to umin_val.
5634 + */
5635 +- dst_reg->smin_value >>= umin_val;
5636 +- dst_reg->smax_value >>= umin_val;
5637 +- dst_reg->var_off = tnum_arshift(dst_reg->var_off, umin_val);
5638 ++ if (insn_bitness == 32) {
5639 ++ dst_reg->smin_value = (u32)(((s32)dst_reg->smin_value) >> umin_val);
5640 ++ dst_reg->smax_value = (u32)(((s32)dst_reg->smax_value) >> umin_val);
5641 ++ } else {
5642 ++ dst_reg->smin_value >>= umin_val;
5643 ++ dst_reg->smax_value >>= umin_val;
5644 ++ }
5645 ++
5646 ++ dst_reg->var_off = tnum_arshift(dst_reg->var_off, umin_val,
5647 ++ insn_bitness);
5648 +
5649 + /* blow away the dst_reg umin_value/umax_value and rely on
5650 + * dst_reg var_off to refine the result.
5651 +diff --git a/kernel/cpu.c b/kernel/cpu.c
5652 +index e2cad3ee2ead..116825437cd6 100644
5653 +--- a/kernel/cpu.c
5654 ++++ b/kernel/cpu.c
5655 +@@ -1909,6 +1909,78 @@ void __cpuhp_remove_state(enum cpuhp_state state, bool invoke)
5656 + }
5657 + EXPORT_SYMBOL(__cpuhp_remove_state);
5658 +
5659 ++#ifdef CONFIG_HOTPLUG_SMT
5660 ++static void cpuhp_offline_cpu_device(unsigned int cpu)
5661 ++{
5662 ++ struct device *dev = get_cpu_device(cpu);
5663 ++
5664 ++ dev->offline = true;
5665 ++ /* Tell user space about the state change */
5666 ++ kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
5667 ++}
5668 ++
5669 ++static void cpuhp_online_cpu_device(unsigned int cpu)
5670 ++{
5671 ++ struct device *dev = get_cpu_device(cpu);
5672 ++
5673 ++ dev->offline = false;
5674 ++ /* Tell user space about the state change */
5675 ++ kobject_uevent(&dev->kobj, KOBJ_ONLINE);
5676 ++}
5677 ++
5678 ++int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
5679 ++{
5680 ++ int cpu, ret = 0;
5681 ++
5682 ++ cpu_maps_update_begin();
5683 ++ for_each_online_cpu(cpu) {
5684 ++ if (topology_is_primary_thread(cpu))
5685 ++ continue;
5686 ++ ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE);
5687 ++ if (ret)
5688 ++ break;
5689 ++ /*
5690 ++ * As this needs to hold the cpu maps lock it's impossible
5691 ++ * to call device_offline() because that ends up calling
5692 ++ * cpu_down() which takes cpu maps lock. cpu maps lock
5693 ++ * needs to be held as this might race against in kernel
5694 ++ * abusers of the hotplug machinery (thermal management).
5695 ++ *
5696 ++ * So nothing would update device:offline state. That would
5697 ++ * leave the sysfs entry stale and prevent onlining after
5698 ++ * smt control has been changed to 'off' again. This is
5699 ++ * called under the sysfs hotplug lock, so it is properly
5700 ++ * serialized against the regular offline usage.
5701 ++ */
5702 ++ cpuhp_offline_cpu_device(cpu);
5703 ++ }
5704 ++ if (!ret)
5705 ++ cpu_smt_control = ctrlval;
5706 ++ cpu_maps_update_done();
5707 ++ return ret;
5708 ++}
5709 ++
5710 ++int cpuhp_smt_enable(void)
5711 ++{
5712 ++ int cpu, ret = 0;
5713 ++
5714 ++ cpu_maps_update_begin();
5715 ++ cpu_smt_control = CPU_SMT_ENABLED;
5716 ++ for_each_present_cpu(cpu) {
5717 ++ /* Skip online CPUs and CPUs on offline nodes */
5718 ++ if (cpu_online(cpu) || !node_online(cpu_to_node(cpu)))
5719 ++ continue;
5720 ++ ret = _cpu_up(cpu, 0, CPUHP_ONLINE);
5721 ++ if (ret)
5722 ++ break;
5723 ++ /* See comment in cpuhp_smt_disable() */
5724 ++ cpuhp_online_cpu_device(cpu);
5725 ++ }
5726 ++ cpu_maps_update_done();
5727 ++ return ret;
5728 ++}
5729 ++#endif
5730 ++
5731 + #if defined(CONFIG_SYSFS) && defined(CONFIG_HOTPLUG_CPU)
5732 + static ssize_t show_cpuhp_state(struct device *dev,
5733 + struct device_attribute *attr, char *buf)
5734 +@@ -2063,77 +2135,6 @@ static const struct attribute_group cpuhp_cpu_root_attr_group = {
5735 +
5736 + #ifdef CONFIG_HOTPLUG_SMT
5737 +
5738 +-static void cpuhp_offline_cpu_device(unsigned int cpu)
5739 +-{
5740 +- struct device *dev = get_cpu_device(cpu);
5741 +-
5742 +- dev->offline = true;
5743 +- /* Tell user space about the state change */
5744 +- kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
5745 +-}
5746 +-
5747 +-static void cpuhp_online_cpu_device(unsigned int cpu)
5748 +-{
5749 +- struct device *dev = get_cpu_device(cpu);
5750 +-
5751 +- dev->offline = false;
5752 +- /* Tell user space about the state change */
5753 +- kobject_uevent(&dev->kobj, KOBJ_ONLINE);
5754 +-}
5755 +-
5756 +-int cpuhp_smt_disable(enum cpuhp_smt_control ctrlval)
5757 +-{
5758 +- int cpu, ret = 0;
5759 +-
5760 +- cpu_maps_update_begin();
5761 +- for_each_online_cpu(cpu) {
5762 +- if (topology_is_primary_thread(cpu))
5763 +- continue;
5764 +- ret = cpu_down_maps_locked(cpu, CPUHP_OFFLINE);
5765 +- if (ret)
5766 +- break;
5767 +- /*
5768 +- * As this needs to hold the cpu maps lock it's impossible
5769 +- * to call device_offline() because that ends up calling
5770 +- * cpu_down() which takes cpu maps lock. cpu maps lock
5771 +- * needs to be held as this might race against in kernel
5772 +- * abusers of the hotplug machinery (thermal management).
5773 +- *
5774 +- * So nothing would update device:offline state. That would
5775 +- * leave the sysfs entry stale and prevent onlining after
5776 +- * smt control has been changed to 'off' again. This is
5777 +- * called under the sysfs hotplug lock, so it is properly
5778 +- * serialized against the regular offline usage.
5779 +- */
5780 +- cpuhp_offline_cpu_device(cpu);
5781 +- }
5782 +- if (!ret)
5783 +- cpu_smt_control = ctrlval;
5784 +- cpu_maps_update_done();
5785 +- return ret;
5786 +-}
5787 +-
5788 +-int cpuhp_smt_enable(void)
5789 +-{
5790 +- int cpu, ret = 0;
5791 +-
5792 +- cpu_maps_update_begin();
5793 +- cpu_smt_control = CPU_SMT_ENABLED;
5794 +- for_each_present_cpu(cpu) {
5795 +- /* Skip online CPUs and CPUs on offline nodes */
5796 +- if (cpu_online(cpu) || !node_online(cpu_to_node(cpu)))
5797 +- continue;
5798 +- ret = _cpu_up(cpu, 0, CPUHP_ONLINE);
5799 +- if (ret)
5800 +- break;
5801 +- /* See comment in cpuhp_smt_disable() */
5802 +- cpuhp_online_cpu_device(cpu);
5803 +- }
5804 +- cpu_maps_update_done();
5805 +- return ret;
5806 +-}
5807 +-
5808 +-
5809 + static ssize_t
5810 + __store_smt_control(struct device *dev, struct device_attribute *attr,
5811 + const char *buf, size_t count)
5812 +diff --git a/kernel/events/core.c b/kernel/events/core.c
5813 +index 8f66a4833ded..6c829e22bad3 100644
5814 +--- a/kernel/events/core.c
5815 ++++ b/kernel/events/core.c
5816 +@@ -11182,8 +11182,10 @@ SYSCALL_DEFINE5(perf_event_open,
5817 + }
5818 + }
5819 +
5820 +- if (event->attr.aux_output && !perf_get_aux_event(event, group_leader))
5821 ++ if (event->attr.aux_output && !perf_get_aux_event(event, group_leader)) {
5822 ++ err = -EINVAL;
5823 + goto err_locked;
5824 ++ }
5825 +
5826 + /*
5827 + * Must be under the same ctx::mutex as perf_install_in_context(),
5828 +diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
5829 +index 233459c03b5a..35d3b6925b1e 100644
5830 +--- a/kernel/locking/lockdep.c
5831 ++++ b/kernel/locking/lockdep.c
5832 +@@ -482,7 +482,7 @@ static struct lock_trace *save_trace(void)
5833 + struct lock_trace *trace, *t2;
5834 + struct hlist_head *hash_head;
5835 + u32 hash;
5836 +- unsigned int max_entries;
5837 ++ int max_entries;
5838 +
5839 + BUILD_BUG_ON_NOT_POWER_OF_2(STACK_TRACE_HASH_SIZE);
5840 + BUILD_BUG_ON(LOCK_TRACE_SIZE_IN_LONGS >= MAX_STACK_TRACE_ENTRIES);
5841 +@@ -490,10 +490,8 @@ static struct lock_trace *save_trace(void)
5842 + trace = (struct lock_trace *)(stack_trace + nr_stack_trace_entries);
5843 + max_entries = MAX_STACK_TRACE_ENTRIES - nr_stack_trace_entries -
5844 + LOCK_TRACE_SIZE_IN_LONGS;
5845 +- trace->nr_entries = stack_trace_save(trace->entries, max_entries, 3);
5846 +
5847 +- if (nr_stack_trace_entries >= MAX_STACK_TRACE_ENTRIES -
5848 +- LOCK_TRACE_SIZE_IN_LONGS - 1) {
5849 ++ if (max_entries <= 0) {
5850 + if (!debug_locks_off_graph_unlock())
5851 + return NULL;
5852 +
5853 +@@ -502,6 +500,7 @@ static struct lock_trace *save_trace(void)
5854 +
5855 + return NULL;
5856 + }
5857 ++ trace->nr_entries = stack_trace_save(trace->entries, max_entries, 3);
5858 +
5859 + hash = jhash(trace->entries, trace->nr_entries *
5860 + sizeof(trace->entries[0]), 0);
5861 +diff --git a/kernel/locking/rwsem.c b/kernel/locking/rwsem.c
5862 +index eef04551eae7..baafa1dd9fcc 100644
5863 +--- a/kernel/locking/rwsem.c
5864 ++++ b/kernel/locking/rwsem.c
5865 +@@ -1226,8 +1226,8 @@ wait:
5866 + * In this case, we attempt to acquire the lock again
5867 + * without sleeping.
5868 + */
5869 +- if ((wstate == WRITER_HANDOFF) &&
5870 +- (rwsem_spin_on_owner(sem, 0) == OWNER_NULL))
5871 ++ if (wstate == WRITER_HANDOFF &&
5872 ++ rwsem_spin_on_owner(sem, RWSEM_NONSPINNABLE) == OWNER_NULL)
5873 + goto trylock_again;
5874 +
5875 + /* Block until there are no active lockers. */
5876 +diff --git a/kernel/ptrace.c b/kernel/ptrace.c
5877 +index cb9ddcc08119..43d6179508d6 100644
5878 +--- a/kernel/ptrace.c
5879 ++++ b/kernel/ptrace.c
5880 +@@ -264,12 +264,17 @@ static int ptrace_check_attach(struct task_struct *child, bool ignore_state)
5881 + return ret;
5882 + }
5883 +
5884 +-static int ptrace_has_cap(struct user_namespace *ns, unsigned int mode)
5885 ++static bool ptrace_has_cap(const struct cred *cred, struct user_namespace *ns,
5886 ++ unsigned int mode)
5887 + {
5888 ++ int ret;
5889 ++
5890 + if (mode & PTRACE_MODE_NOAUDIT)
5891 +- return has_ns_capability_noaudit(current, ns, CAP_SYS_PTRACE);
5892 ++ ret = security_capable(cred, ns, CAP_SYS_PTRACE, CAP_OPT_NOAUDIT);
5893 + else
5894 +- return has_ns_capability(current, ns, CAP_SYS_PTRACE);
5895 ++ ret = security_capable(cred, ns, CAP_SYS_PTRACE, CAP_OPT_NONE);
5896 ++
5897 ++ return ret == 0;
5898 + }
5899 +
5900 + /* Returns 0 on success, -errno on denial. */
5901 +@@ -321,7 +326,7 @@ static int __ptrace_may_access(struct task_struct *task, unsigned int mode)
5902 + gid_eq(caller_gid, tcred->sgid) &&
5903 + gid_eq(caller_gid, tcred->gid))
5904 + goto ok;
5905 +- if (ptrace_has_cap(tcred->user_ns, mode))
5906 ++ if (ptrace_has_cap(cred, tcred->user_ns, mode))
5907 + goto ok;
5908 + rcu_read_unlock();
5909 + return -EPERM;
5910 +@@ -340,7 +345,7 @@ ok:
5911 + mm = task->mm;
5912 + if (mm &&
5913 + ((get_dumpable(mm) != SUID_DUMP_USER) &&
5914 +- !ptrace_has_cap(mm->user_ns, mode)))
5915 ++ !ptrace_has_cap(cred, mm->user_ns, mode)))
5916 + return -EPERM;
5917 +
5918 + return security_ptrace_access_check(task, mode);
5919 +diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
5920 +index 955851748dc3..5c9fcc72460d 100644
5921 +--- a/kernel/time/tick-sched.c
5922 ++++ b/kernel/time/tick-sched.c
5923 +@@ -58,8 +58,9 @@ static void tick_do_update_jiffies64(ktime_t now)
5924 +
5925 + /*
5926 + * Do a quick check without holding jiffies_lock:
5927 ++ * The READ_ONCE() pairs with two updates done later in this function.
5928 + */
5929 +- delta = ktime_sub(now, last_jiffies_update);
5930 ++ delta = ktime_sub(now, READ_ONCE(last_jiffies_update));
5931 + if (delta < tick_period)
5932 + return;
5933 +
5934 +@@ -70,8 +71,9 @@ static void tick_do_update_jiffies64(ktime_t now)
5935 + if (delta >= tick_period) {
5936 +
5937 + delta = ktime_sub(delta, tick_period);
5938 +- last_jiffies_update = ktime_add(last_jiffies_update,
5939 +- tick_period);
5940 ++ /* Pairs with the lockless read in this function. */
5941 ++ WRITE_ONCE(last_jiffies_update,
5942 ++ ktime_add(last_jiffies_update, tick_period));
5943 +
5944 + /* Slow path for long timeouts */
5945 + if (unlikely(delta >= tick_period)) {
5946 +@@ -79,8 +81,10 @@ static void tick_do_update_jiffies64(ktime_t now)
5947 +
5948 + ticks = ktime_divns(delta, incr);
5949 +
5950 +- last_jiffies_update = ktime_add_ns(last_jiffies_update,
5951 +- incr * ticks);
5952 ++ /* Pairs with the lockless read in this function. */
5953 ++ WRITE_ONCE(last_jiffies_update,
5954 ++ ktime_add_ns(last_jiffies_update,
5955 ++ incr * ticks));
5956 + }
5957 + do_timer(++ticks);
5958 +
5959 +diff --git a/mm/huge_memory.c b/mm/huge_memory.c
5960 +index 13cc93785006..1de7f53621a0 100644
5961 +--- a/mm/huge_memory.c
5962 ++++ b/mm/huge_memory.c
5963 +@@ -527,13 +527,13 @@ void prep_transhuge_page(struct page *page)
5964 + set_compound_page_dtor(page, TRANSHUGE_PAGE_DTOR);
5965 + }
5966 +
5967 +-static unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long len,
5968 ++static unsigned long __thp_get_unmapped_area(struct file *filp,
5969 ++ unsigned long addr, unsigned long len,
5970 + loff_t off, unsigned long flags, unsigned long size)
5971 + {
5972 +- unsigned long addr;
5973 + loff_t off_end = off + len;
5974 + loff_t off_align = round_up(off, size);
5975 +- unsigned long len_pad;
5976 ++ unsigned long len_pad, ret;
5977 +
5978 + if (off_end <= off_align || (off_end - off_align) < size)
5979 + return 0;
5980 +@@ -542,30 +542,40 @@ static unsigned long __thp_get_unmapped_area(struct file *filp, unsigned long le
5981 + if (len_pad < len || (off + len_pad) < off)
5982 + return 0;
5983 +
5984 +- addr = current->mm->get_unmapped_area(filp, 0, len_pad,
5985 ++ ret = current->mm->get_unmapped_area(filp, addr, len_pad,
5986 + off >> PAGE_SHIFT, flags);
5987 +- if (IS_ERR_VALUE(addr))
5988 ++
5989 ++ /*
5990 ++ * The failure might be due to length padding. The caller will retry
5991 ++ * without the padding.
5992 ++ */
5993 ++ if (IS_ERR_VALUE(ret))
5994 + return 0;
5995 +
5996 +- addr += (off - addr) & (size - 1);
5997 +- return addr;
5998 ++ /*
5999 ++ * Do not try to align to THP boundary if allocation at the address
6000 ++ * hint succeeds.
6001 ++ */
6002 ++ if (ret == addr)
6003 ++ return addr;
6004 ++
6005 ++ ret += (off - ret) & (size - 1);
6006 ++ return ret;
6007 + }
6008 +
6009 + unsigned long thp_get_unmapped_area(struct file *filp, unsigned long addr,
6010 + unsigned long len, unsigned long pgoff, unsigned long flags)
6011 + {
6012 ++ unsigned long ret;
6013 + loff_t off = (loff_t)pgoff << PAGE_SHIFT;
6014 +
6015 +- if (addr)
6016 +- goto out;
6017 + if (!IS_DAX(filp->f_mapping->host) || !IS_ENABLED(CONFIG_FS_DAX_PMD))
6018 + goto out;
6019 +
6020 +- addr = __thp_get_unmapped_area(filp, len, off, flags, PMD_SIZE);
6021 +- if (addr)
6022 +- return addr;
6023 +-
6024 +- out:
6025 ++ ret = __thp_get_unmapped_area(filp, addr, len, off, flags, PMD_SIZE);
6026 ++ if (ret)
6027 ++ return ret;
6028 ++out:
6029 + return current->mm->get_unmapped_area(filp, addr, len, pgoff, flags);
6030 + }
6031 + EXPORT_SYMBOL_GPL(thp_get_unmapped_area);
6032 +diff --git a/mm/memcontrol.c b/mm/memcontrol.c
6033 +index 46ad252e6d6a..ef4e9eb572a4 100644
6034 +--- a/mm/memcontrol.c
6035 ++++ b/mm/memcontrol.c
6036 +@@ -3404,49 +3404,34 @@ static u64 mem_cgroup_read_u64(struct cgroup_subsys_state *css,
6037 + }
6038 + }
6039 +
6040 +-static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg, bool slab_only)
6041 ++static void memcg_flush_percpu_vmstats(struct mem_cgroup *memcg)
6042 + {
6043 +- unsigned long stat[MEMCG_NR_STAT];
6044 ++ unsigned long stat[MEMCG_NR_STAT] = {0};
6045 + struct mem_cgroup *mi;
6046 + int node, cpu, i;
6047 +- int min_idx, max_idx;
6048 +-
6049 +- if (slab_only) {
6050 +- min_idx = NR_SLAB_RECLAIMABLE;
6051 +- max_idx = NR_SLAB_UNRECLAIMABLE;
6052 +- } else {
6053 +- min_idx = 0;
6054 +- max_idx = MEMCG_NR_STAT;
6055 +- }
6056 +-
6057 +- for (i = min_idx; i < max_idx; i++)
6058 +- stat[i] = 0;
6059 +
6060 + for_each_online_cpu(cpu)
6061 +- for (i = min_idx; i < max_idx; i++)
6062 ++ for (i = 0; i < MEMCG_NR_STAT; i++)
6063 + stat[i] += per_cpu(memcg->vmstats_percpu->stat[i], cpu);
6064 +
6065 + for (mi = memcg; mi; mi = parent_mem_cgroup(mi))
6066 +- for (i = min_idx; i < max_idx; i++)
6067 ++ for (i = 0; i < MEMCG_NR_STAT; i++)
6068 + atomic_long_add(stat[i], &mi->vmstats[i]);
6069 +
6070 +- if (!slab_only)
6071 +- max_idx = NR_VM_NODE_STAT_ITEMS;
6072 +-
6073 + for_each_node(node) {
6074 + struct mem_cgroup_per_node *pn = memcg->nodeinfo[node];
6075 + struct mem_cgroup_per_node *pi;
6076 +
6077 +- for (i = min_idx; i < max_idx; i++)
6078 ++ for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
6079 + stat[i] = 0;
6080 +
6081 + for_each_online_cpu(cpu)
6082 +- for (i = min_idx; i < max_idx; i++)
6083 ++ for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
6084 + stat[i] += per_cpu(
6085 + pn->lruvec_stat_cpu->count[i], cpu);
6086 +
6087 + for (pi = pn; pi; pi = parent_nodeinfo(pi, node))
6088 +- for (i = min_idx; i < max_idx; i++)
6089 ++ for (i = 0; i < NR_VM_NODE_STAT_ITEMS; i++)
6090 + atomic_long_add(stat[i], &pi->lruvec_stat[i]);
6091 + }
6092 + }
6093 +@@ -3520,13 +3505,9 @@ static void memcg_offline_kmem(struct mem_cgroup *memcg)
6094 + parent = root_mem_cgroup;
6095 +
6096 + /*
6097 +- * Deactivate and reparent kmem_caches. Then flush percpu
6098 +- * slab statistics to have precise values at the parent and
6099 +- * all ancestor levels. It's required to keep slab stats
6100 +- * accurate after the reparenting of kmem_caches.
6101 ++ * Deactivate and reparent kmem_caches.
6102 + */
6103 + memcg_deactivate_kmem_caches(memcg, parent);
6104 +- memcg_flush_percpu_vmstats(memcg, true);
6105 +
6106 + kmemcg_id = memcg->kmemcg_id;
6107 + BUG_ON(kmemcg_id < 0);
6108 +@@ -5037,7 +5018,7 @@ static void mem_cgroup_free(struct mem_cgroup *memcg)
6109 + * Flush percpu vmstats and vmevents to guarantee the value correctness
6110 + * on parent's and all ancestor levels.
6111 + */
6112 +- memcg_flush_percpu_vmstats(memcg, false);
6113 ++ memcg_flush_percpu_vmstats(memcg);
6114 + memcg_flush_percpu_vmevents(memcg);
6115 + __mem_cgroup_free(memcg);
6116 + }
6117 +diff --git a/mm/page-writeback.c b/mm/page-writeback.c
6118 +index 50055d2e4ea8..2d658b208319 100644
6119 +--- a/mm/page-writeback.c
6120 ++++ b/mm/page-writeback.c
6121 +@@ -201,11 +201,11 @@ static void wb_min_max_ratio(struct bdi_writeback *wb,
6122 + if (this_bw < tot_bw) {
6123 + if (min) {
6124 + min *= this_bw;
6125 +- do_div(min, tot_bw);
6126 ++ min = div64_ul(min, tot_bw);
6127 + }
6128 + if (max < 100) {
6129 + max *= this_bw;
6130 +- do_div(max, tot_bw);
6131 ++ max = div64_ul(max, tot_bw);
6132 + }
6133 + }
6134 +
6135 +diff --git a/mm/page_alloc.c b/mm/page_alloc.c
6136 +index f391c0c4ed1d..45e39131a716 100644
6137 +--- a/mm/page_alloc.c
6138 ++++ b/mm/page_alloc.c
6139 +@@ -694,34 +694,27 @@ void prep_compound_page(struct page *page, unsigned int order)
6140 + #ifdef CONFIG_DEBUG_PAGEALLOC
6141 + unsigned int _debug_guardpage_minorder;
6142 +
6143 +-#ifdef CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT
6144 +-DEFINE_STATIC_KEY_TRUE(_debug_pagealloc_enabled);
6145 +-#else
6146 ++bool _debug_pagealloc_enabled_early __read_mostly
6147 ++ = IS_ENABLED(CONFIG_DEBUG_PAGEALLOC_ENABLE_DEFAULT);
6148 ++EXPORT_SYMBOL(_debug_pagealloc_enabled_early);
6149 + DEFINE_STATIC_KEY_FALSE(_debug_pagealloc_enabled);
6150 +-#endif
6151 + EXPORT_SYMBOL(_debug_pagealloc_enabled);
6152 +
6153 + DEFINE_STATIC_KEY_FALSE(_debug_guardpage_enabled);
6154 +
6155 + static int __init early_debug_pagealloc(char *buf)
6156 + {
6157 +- bool enable = false;
6158 +-
6159 +- if (kstrtobool(buf, &enable))
6160 +- return -EINVAL;
6161 +-
6162 +- if (enable)
6163 +- static_branch_enable(&_debug_pagealloc_enabled);
6164 +-
6165 +- return 0;
6166 ++ return kstrtobool(buf, &_debug_pagealloc_enabled_early);
6167 + }
6168 + early_param("debug_pagealloc", early_debug_pagealloc);
6169 +
6170 +-static void init_debug_guardpage(void)
6171 ++void init_debug_pagealloc(void)
6172 + {
6173 + if (!debug_pagealloc_enabled())
6174 + return;
6175 +
6176 ++ static_branch_enable(&_debug_pagealloc_enabled);
6177 ++
6178 + if (!debug_guardpage_minorder())
6179 + return;
6180 +
6181 +@@ -1186,7 +1179,7 @@ static __always_inline bool free_pages_prepare(struct page *page,
6182 + */
6183 + arch_free_page(page, order);
6184 +
6185 +- if (debug_pagealloc_enabled())
6186 ++ if (debug_pagealloc_enabled_static())
6187 + kernel_map_pages(page, 1 << order, 0);
6188 +
6189 + kasan_free_nondeferred_pages(page, order);
6190 +@@ -1207,7 +1200,7 @@ static bool free_pcp_prepare(struct page *page)
6191 +
6192 + static bool bulkfree_pcp_prepare(struct page *page)
6193 + {
6194 +- if (debug_pagealloc_enabled())
6195 ++ if (debug_pagealloc_enabled_static())
6196 + return free_pages_check(page);
6197 + else
6198 + return false;
6199 +@@ -1221,7 +1214,7 @@ static bool bulkfree_pcp_prepare(struct page *page)
6200 + */
6201 + static bool free_pcp_prepare(struct page *page)
6202 + {
6203 +- if (debug_pagealloc_enabled())
6204 ++ if (debug_pagealloc_enabled_static())
6205 + return free_pages_prepare(page, 0, true);
6206 + else
6207 + return free_pages_prepare(page, 0, false);
6208 +@@ -1973,10 +1966,6 @@ void __init page_alloc_init_late(void)
6209 +
6210 + for_each_populated_zone(zone)
6211 + set_zone_contiguous(zone);
6212 +-
6213 +-#ifdef CONFIG_DEBUG_PAGEALLOC
6214 +- init_debug_guardpage();
6215 +-#endif
6216 + }
6217 +
6218 + #ifdef CONFIG_CMA
6219 +@@ -2106,7 +2095,7 @@ static inline bool free_pages_prezeroed(void)
6220 + */
6221 + static inline bool check_pcp_refill(struct page *page)
6222 + {
6223 +- if (debug_pagealloc_enabled())
6224 ++ if (debug_pagealloc_enabled_static())
6225 + return check_new_page(page);
6226 + else
6227 + return false;
6228 +@@ -2128,7 +2117,7 @@ static inline bool check_pcp_refill(struct page *page)
6229 + }
6230 + static inline bool check_new_pcp(struct page *page)
6231 + {
6232 +- if (debug_pagealloc_enabled())
6233 ++ if (debug_pagealloc_enabled_static())
6234 + return check_new_page(page);
6235 + else
6236 + return false;
6237 +@@ -2155,7 +2144,7 @@ inline void post_alloc_hook(struct page *page, unsigned int order,
6238 + set_page_refcounted(page);
6239 +
6240 + arch_alloc_page(page, order);
6241 +- if (debug_pagealloc_enabled())
6242 ++ if (debug_pagealloc_enabled_static())
6243 + kernel_map_pages(page, 1 << order, 1);
6244 + kasan_alloc_pages(page, order);
6245 + kernel_poison_pages(page, 1 << order, 1);
6246 +diff --git a/mm/shmem.c b/mm/shmem.c
6247 +index 6074714fdbd4..312e31196720 100644
6248 +--- a/mm/shmem.c
6249 ++++ b/mm/shmem.c
6250 +@@ -2106,9 +2106,10 @@ unsigned long shmem_get_unmapped_area(struct file *file,
6251 + /*
6252 + * Our priority is to support MAP_SHARED mapped hugely;
6253 + * and support MAP_PRIVATE mapped hugely too, until it is COWed.
6254 +- * But if caller specified an address hint, respect that as before.
6255 ++ * But if caller specified an address hint and we allocated area there
6256 ++ * successfully, respect that as before.
6257 + */
6258 +- if (uaddr)
6259 ++ if (uaddr == addr)
6260 + return addr;
6261 +
6262 + if (shmem_huge != SHMEM_HUGE_FORCE) {
6263 +@@ -2142,7 +2143,7 @@ unsigned long shmem_get_unmapped_area(struct file *file,
6264 + if (inflated_len < len)
6265 + return addr;
6266 +
6267 +- inflated_addr = get_area(NULL, 0, inflated_len, 0, flags);
6268 ++ inflated_addr = get_area(NULL, uaddr, inflated_len, 0, flags);
6269 + if (IS_ERR_VALUE(inflated_addr))
6270 + return addr;
6271 + if (inflated_addr & ~PAGE_MASK)
6272 +diff --git a/mm/slab.c b/mm/slab.c
6273 +index 66e5d8032bae..d1d7624cec4a 100644
6274 +--- a/mm/slab.c
6275 ++++ b/mm/slab.c
6276 +@@ -1415,7 +1415,7 @@ static void kmem_rcu_free(struct rcu_head *head)
6277 + #if DEBUG
6278 + static bool is_debug_pagealloc_cache(struct kmem_cache *cachep)
6279 + {
6280 +- if (debug_pagealloc_enabled() && OFF_SLAB(cachep) &&
6281 ++ if (debug_pagealloc_enabled_static() && OFF_SLAB(cachep) &&
6282 + (cachep->size % PAGE_SIZE) == 0)
6283 + return true;
6284 +
6285 +@@ -2007,7 +2007,7 @@ int __kmem_cache_create(struct kmem_cache *cachep, slab_flags_t flags)
6286 + * to check size >= 256. It guarantees that all necessary small
6287 + * sized slab is initialized in current slab initialization sequence.
6288 + */
6289 +- if (debug_pagealloc_enabled() && (flags & SLAB_POISON) &&
6290 ++ if (debug_pagealloc_enabled_static() && (flags & SLAB_POISON) &&
6291 + size >= 256 && cachep->object_size > cache_line_size()) {
6292 + if (size < PAGE_SIZE || size % PAGE_SIZE == 0) {
6293 + size_t tmp_size = ALIGN(size, PAGE_SIZE);
6294 +diff --git a/mm/slab_common.c b/mm/slab_common.c
6295 +index 78402b362df9..ade6c257d4b4 100644
6296 +--- a/mm/slab_common.c
6297 ++++ b/mm/slab_common.c
6298 +@@ -903,7 +903,8 @@ static void flush_memcg_workqueue(struct kmem_cache *s)
6299 + * deactivates the memcg kmem_caches through workqueue. Make sure all
6300 + * previous workitems on workqueue are processed.
6301 + */
6302 +- flush_workqueue(memcg_kmem_cache_wq);
6303 ++ if (likely(memcg_kmem_cache_wq))
6304 ++ flush_workqueue(memcg_kmem_cache_wq);
6305 +
6306 + /*
6307 + * If we're racing with children kmem_cache deactivation, it might
6308 +diff --git a/mm/slub.c b/mm/slub.c
6309 +index e72e802fc569..20d72cb20515 100644
6310 +--- a/mm/slub.c
6311 ++++ b/mm/slub.c
6312 +@@ -290,7 +290,7 @@ static inline void *get_freepointer_safe(struct kmem_cache *s, void *object)
6313 + unsigned long freepointer_addr;
6314 + void *p;
6315 +
6316 +- if (!debug_pagealloc_enabled())
6317 ++ if (!debug_pagealloc_enabled_static())
6318 + return get_freepointer(s, object);
6319 +
6320 + freepointer_addr = (unsigned long)object + s->offset;
6321 +diff --git a/mm/sparse.c b/mm/sparse.c
6322 +index c2c01b6330af..1100fdb9649c 100644
6323 +--- a/mm/sparse.c
6324 ++++ b/mm/sparse.c
6325 +@@ -775,7 +775,14 @@ static void section_deactivate(unsigned long pfn, unsigned long nr_pages,
6326 + if (bitmap_empty(subsection_map, SUBSECTIONS_PER_SECTION)) {
6327 + unsigned long section_nr = pfn_to_section_nr(pfn);
6328 +
6329 +- if (!section_is_early) {
6330 ++ /*
6331 ++ * When removing an early section, the usage map is kept (as the
6332 ++ * usage maps of other sections fall into the same page). It
6333 ++ * will be re-used when re-adding the section - which is then no
6334 ++ * longer an early section. If the usage map is PageReserved, it
6335 ++ * was allocated during boot.
6336 ++ */
6337 ++ if (!PageReserved(virt_to_page(ms->usage))) {
6338 + kfree(ms->usage);
6339 + ms->usage = NULL;
6340 + }
6341 +diff --git a/mm/vmalloc.c b/mm/vmalloc.c
6342 +index a3c70e275f4e..61bdbaf20cde 100644
6343 +--- a/mm/vmalloc.c
6344 ++++ b/mm/vmalloc.c
6345 +@@ -1349,7 +1349,7 @@ static void free_unmap_vmap_area(struct vmap_area *va)
6346 + {
6347 + flush_cache_vunmap(va->va_start, va->va_end);
6348 + unmap_vmap_area(va);
6349 +- if (debug_pagealloc_enabled())
6350 ++ if (debug_pagealloc_enabled_static())
6351 + flush_tlb_kernel_range(va->va_start, va->va_end);
6352 +
6353 + free_vmap_area_noflush(va);
6354 +@@ -1647,7 +1647,7 @@ static void vb_free(const void *addr, unsigned long size)
6355 +
6356 + vunmap_page_range((unsigned long)addr, (unsigned long)addr + size);
6357 +
6358 +- if (debug_pagealloc_enabled())
6359 ++ if (debug_pagealloc_enabled_static())
6360 + flush_tlb_kernel_range((unsigned long)addr,
6361 + (unsigned long)addr + size);
6362 +
6363 +diff --git a/net/batman-adv/distributed-arp-table.c b/net/batman-adv/distributed-arp-table.c
6364 +index b0af3a11d406..ec7bf5a4a9fc 100644
6365 +--- a/net/batman-adv/distributed-arp-table.c
6366 ++++ b/net/batman-adv/distributed-arp-table.c
6367 +@@ -285,6 +285,7 @@ static u32 batadv_hash_dat(const void *data, u32 size)
6368 + u32 hash = 0;
6369 + const struct batadv_dat_entry *dat = data;
6370 + const unsigned char *key;
6371 ++ __be16 vid;
6372 + u32 i;
6373 +
6374 + key = (const unsigned char *)&dat->ip;
6375 +@@ -294,7 +295,8 @@ static u32 batadv_hash_dat(const void *data, u32 size)
6376 + hash ^= (hash >> 6);
6377 + }
6378 +
6379 +- key = (const unsigned char *)&dat->vid;
6380 ++ vid = htons(dat->vid);
6381 ++ key = (__force const unsigned char *)&vid;
6382 + for (i = 0; i < sizeof(dat->vid); i++) {
6383 + hash += key[i];
6384 + hash += (hash << 10);
6385 +diff --git a/net/core/dev.c b/net/core/dev.c
6386 +index 3e11c6bb4dd6..3098c90d60e2 100644
6387 +--- a/net/core/dev.c
6388 ++++ b/net/core/dev.c
6389 +@@ -8953,22 +8953,10 @@ static void netdev_unregister_lockdep_key(struct net_device *dev)
6390 +
6391 + void netdev_update_lockdep_key(struct net_device *dev)
6392 + {
6393 +- struct netdev_queue *queue;
6394 +- int i;
6395 +-
6396 +- lockdep_unregister_key(&dev->qdisc_xmit_lock_key);
6397 + lockdep_unregister_key(&dev->addr_list_lock_key);
6398 +-
6399 +- lockdep_register_key(&dev->qdisc_xmit_lock_key);
6400 + lockdep_register_key(&dev->addr_list_lock_key);
6401 +
6402 + lockdep_set_class(&dev->addr_list_lock, &dev->addr_list_lock_key);
6403 +- for (i = 0; i < dev->num_tx_queues; i++) {
6404 +- queue = netdev_get_tx_queue(dev, i);
6405 +-
6406 +- lockdep_set_class(&queue->_xmit_lock,
6407 +- &dev->qdisc_xmit_lock_key);
6408 +- }
6409 + }
6410 + EXPORT_SYMBOL(netdev_update_lockdep_key);
6411 +
6412 +diff --git a/net/core/devlink.c b/net/core/devlink.c
6413 +index 93905dc7c179..ae614965c8c2 100644
6414 +--- a/net/core/devlink.c
6415 ++++ b/net/core/devlink.c
6416 +@@ -6280,7 +6280,7 @@ static bool devlink_port_type_should_warn(struct devlink_port *devlink_port)
6417 + devlink_port->attrs.flavour != DEVLINK_PORT_FLAVOUR_DSA;
6418 + }
6419 +
6420 +-#define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 30)
6421 ++#define DEVLINK_PORT_TYPE_WARN_TIMEOUT (HZ * 3600)
6422 +
6423 + static void devlink_port_type_warn_schedule(struct devlink_port *devlink_port)
6424 + {
6425 +diff --git a/net/core/filter.c b/net/core/filter.c
6426 +index 2f76461c120d..1a78d64096bb 100644
6427 +--- a/net/core/filter.c
6428 ++++ b/net/core/filter.c
6429 +@@ -2231,10 +2231,10 @@ BPF_CALL_4(bpf_msg_pull_data, struct sk_msg *, msg, u32, start,
6430 + /* First find the starting scatterlist element */
6431 + i = msg->sg.start;
6432 + do {
6433 ++ offset += len;
6434 + len = sk_msg_elem(msg, i)->length;
6435 + if (start < offset + len)
6436 + break;
6437 +- offset += len;
6438 + sk_msg_iter_var_next(i);
6439 + } while (i != msg->sg.end);
6440 +
6441 +@@ -2346,7 +2346,7 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start,
6442 + u32, len, u64, flags)
6443 + {
6444 + struct scatterlist sge, nsge, nnsge, rsge = {0}, *psge;
6445 +- u32 new, i = 0, l, space, copy = 0, offset = 0;
6446 ++ u32 new, i = 0, l = 0, space, copy = 0, offset = 0;
6447 + u8 *raw, *to, *from;
6448 + struct page *page;
6449 +
6450 +@@ -2356,11 +2356,11 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start,
6451 + /* First find the starting scatterlist element */
6452 + i = msg->sg.start;
6453 + do {
6454 ++ offset += l;
6455 + l = sk_msg_elem(msg, i)->length;
6456 +
6457 + if (start < offset + l)
6458 + break;
6459 +- offset += l;
6460 + sk_msg_iter_var_next(i);
6461 + } while (i != msg->sg.end);
6462 +
6463 +@@ -2415,6 +2415,7 @@ BPF_CALL_4(bpf_msg_push_data, struct sk_msg *, msg, u32, start,
6464 +
6465 + sk_msg_iter_var_next(i);
6466 + sg_unmark_end(psge);
6467 ++ sg_unmark_end(&rsge);
6468 + sk_msg_iter_next(msg, end);
6469 + }
6470 +
6471 +@@ -2506,7 +2507,7 @@ static void sk_msg_shift_right(struct sk_msg *msg, int i)
6472 + BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start,
6473 + u32, len, u64, flags)
6474 + {
6475 +- u32 i = 0, l, space, offset = 0;
6476 ++ u32 i = 0, l = 0, space, offset = 0;
6477 + u64 last = start + len;
6478 + int pop;
6479 +
6480 +@@ -2516,11 +2517,11 @@ BPF_CALL_4(bpf_msg_pop_data, struct sk_msg *, msg, u32, start,
6481 + /* First find the starting scatterlist element */
6482 + i = msg->sg.start;
6483 + do {
6484 ++ offset += l;
6485 + l = sk_msg_elem(msg, i)->length;
6486 +
6487 + if (start < offset + l)
6488 + break;
6489 +- offset += l;
6490 + sk_msg_iter_var_next(i);
6491 + } while (i != msg->sg.end);
6492 +
6493 +@@ -5305,8 +5306,7 @@ __bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len,
6494 + if (sk) {
6495 + sk = sk_to_full_sk(sk);
6496 + if (!sk_fullsock(sk)) {
6497 +- if (!sock_flag(sk, SOCK_RCU_FREE))
6498 +- sock_gen_put(sk);
6499 ++ sock_gen_put(sk);
6500 + return NULL;
6501 + }
6502 + }
6503 +@@ -5343,8 +5343,7 @@ bpf_sk_lookup(struct sk_buff *skb, struct bpf_sock_tuple *tuple, u32 len,
6504 + if (sk) {
6505 + sk = sk_to_full_sk(sk);
6506 + if (!sk_fullsock(sk)) {
6507 +- if (!sock_flag(sk, SOCK_RCU_FREE))
6508 +- sock_gen_put(sk);
6509 ++ sock_gen_put(sk);
6510 + return NULL;
6511 + }
6512 + }
6513 +@@ -5411,7 +5410,8 @@ static const struct bpf_func_proto bpf_sk_lookup_udp_proto = {
6514 +
6515 + BPF_CALL_1(bpf_sk_release, struct sock *, sk)
6516 + {
6517 +- if (!sock_flag(sk, SOCK_RCU_FREE))
6518 ++ /* Only full sockets have sk->sk_flags. */
6519 ++ if (!sk_fullsock(sk) || !sock_flag(sk, SOCK_RCU_FREE))
6520 + sock_gen_put(sk);
6521 + return 0;
6522 + }
6523 +diff --git a/net/core/skmsg.c b/net/core/skmsg.c
6524 +index ded2d5227678..3866d7e20c07 100644
6525 +--- a/net/core/skmsg.c
6526 ++++ b/net/core/skmsg.c
6527 +@@ -594,6 +594,8 @@ EXPORT_SYMBOL_GPL(sk_psock_destroy);
6528 +
6529 + void sk_psock_drop(struct sock *sk, struct sk_psock *psock)
6530 + {
6531 ++ sock_owned_by_me(sk);
6532 ++
6533 + sk_psock_cork_free(psock);
6534 + sk_psock_zap_ingress(psock);
6535 +
6536 +diff --git a/net/core/sock_map.c b/net/core/sock_map.c
6537 +index eb114ee419b6..8998e356f423 100644
6538 +--- a/net/core/sock_map.c
6539 ++++ b/net/core/sock_map.c
6540 +@@ -241,8 +241,11 @@ static void sock_map_free(struct bpf_map *map)
6541 + struct sock *sk;
6542 +
6543 + sk = xchg(psk, NULL);
6544 +- if (sk)
6545 ++ if (sk) {
6546 ++ lock_sock(sk);
6547 + sock_map_unref(sk, psk);
6548 ++ release_sock(sk);
6549 ++ }
6550 + }
6551 + raw_spin_unlock_bh(&stab->lock);
6552 + rcu_read_unlock();
6553 +@@ -862,7 +865,9 @@ static void sock_hash_free(struct bpf_map *map)
6554 + raw_spin_lock_bh(&bucket->lock);
6555 + hlist_for_each_entry_safe(elem, node, &bucket->head, node) {
6556 + hlist_del_rcu(&elem->node);
6557 ++ lock_sock(elem->sk);
6558 + sock_map_unref(elem->sk, elem);
6559 ++ release_sock(elem->sk);
6560 + }
6561 + raw_spin_unlock_bh(&bucket->lock);
6562 + }
6563 +diff --git a/net/dsa/tag_gswip.c b/net/dsa/tag_gswip.c
6564 +index b678160bbd66..408d4af390a0 100644
6565 +--- a/net/dsa/tag_gswip.c
6566 ++++ b/net/dsa/tag_gswip.c
6567 +@@ -104,7 +104,7 @@ static struct sk_buff *gswip_tag_rcv(struct sk_buff *skb,
6568 + }
6569 +
6570 + static const struct dsa_device_ops gswip_netdev_ops = {
6571 +- .name = "gwsip",
6572 ++ .name = "gswip",
6573 + .proto = DSA_TAG_PROTO_GSWIP,
6574 + .xmit = gswip_tag_xmit,
6575 + .rcv = gswip_tag_rcv,
6576 +diff --git a/net/dsa/tag_qca.c b/net/dsa/tag_qca.c
6577 +index c95885215525..c8a128c9e5e0 100644
6578 +--- a/net/dsa/tag_qca.c
6579 ++++ b/net/dsa/tag_qca.c
6580 +@@ -33,9 +33,6 @@ static struct sk_buff *qca_tag_xmit(struct sk_buff *skb, struct net_device *dev)
6581 + struct dsa_port *dp = dsa_slave_to_port(dev);
6582 + u16 *phdr, hdr;
6583 +
6584 +- dev->stats.tx_packets++;
6585 +- dev->stats.tx_bytes += skb->len;
6586 +-
6587 + if (skb_cow_head(skb, 0) < 0)
6588 + return NULL;
6589 +
6590 +diff --git a/net/ipv4/netfilter/arp_tables.c b/net/ipv4/netfilter/arp_tables.c
6591 +index 069f72edb264..f1f78a742b36 100644
6592 +--- a/net/ipv4/netfilter/arp_tables.c
6593 ++++ b/net/ipv4/netfilter/arp_tables.c
6594 +@@ -496,12 +496,13 @@ static inline int check_entry_size_and_hooks(struct arpt_entry *e,
6595 + return 0;
6596 + }
6597 +
6598 +-static inline void cleanup_entry(struct arpt_entry *e)
6599 ++static void cleanup_entry(struct arpt_entry *e, struct net *net)
6600 + {
6601 + struct xt_tgdtor_param par;
6602 + struct xt_entry_target *t;
6603 +
6604 + t = arpt_get_target(e);
6605 ++ par.net = net;
6606 + par.target = t->u.kernel.target;
6607 + par.targinfo = t->data;
6608 + par.family = NFPROTO_ARP;
6609 +@@ -584,7 +585,7 @@ static int translate_table(struct net *net,
6610 + xt_entry_foreach(iter, entry0, newinfo->size) {
6611 + if (i-- == 0)
6612 + break;
6613 +- cleanup_entry(iter);
6614 ++ cleanup_entry(iter, net);
6615 + }
6616 + return ret;
6617 + }
6618 +@@ -927,7 +928,7 @@ static int __do_replace(struct net *net, const char *name,
6619 + /* Decrease module usage counts and free resource */
6620 + loc_cpu_old_entry = oldinfo->entries;
6621 + xt_entry_foreach(iter, loc_cpu_old_entry, oldinfo->size)
6622 +- cleanup_entry(iter);
6623 ++ cleanup_entry(iter, net);
6624 +
6625 + xt_free_table_info(oldinfo);
6626 + if (copy_to_user(counters_ptr, counters,
6627 +@@ -990,7 +991,7 @@ static int do_replace(struct net *net, const void __user *user,
6628 +
6629 + free_newinfo_untrans:
6630 + xt_entry_foreach(iter, loc_cpu_entry, newinfo->size)
6631 +- cleanup_entry(iter);
6632 ++ cleanup_entry(iter, net);
6633 + free_newinfo:
6634 + xt_free_table_info(newinfo);
6635 + return ret;
6636 +@@ -1287,7 +1288,7 @@ static int compat_do_replace(struct net *net, void __user *user,
6637 +
6638 + free_newinfo_untrans:
6639 + xt_entry_foreach(iter, loc_cpu_entry, newinfo->size)
6640 +- cleanup_entry(iter);
6641 ++ cleanup_entry(iter, net);
6642 + free_newinfo:
6643 + xt_free_table_info(newinfo);
6644 + return ret;
6645 +@@ -1514,7 +1515,7 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len
6646 + return ret;
6647 + }
6648 +
6649 +-static void __arpt_unregister_table(struct xt_table *table)
6650 ++static void __arpt_unregister_table(struct net *net, struct xt_table *table)
6651 + {
6652 + struct xt_table_info *private;
6653 + void *loc_cpu_entry;
6654 +@@ -1526,7 +1527,7 @@ static void __arpt_unregister_table(struct xt_table *table)
6655 + /* Decrease module usage counts and free resources */
6656 + loc_cpu_entry = private->entries;
6657 + xt_entry_foreach(iter, loc_cpu_entry, private->size)
6658 +- cleanup_entry(iter);
6659 ++ cleanup_entry(iter, net);
6660 + if (private->number > private->initial_entries)
6661 + module_put(table_owner);
6662 + xt_free_table_info(private);
6663 +@@ -1566,7 +1567,7 @@ int arpt_register_table(struct net *net,
6664 +
6665 + ret = nf_register_net_hooks(net, ops, hweight32(table->valid_hooks));
6666 + if (ret != 0) {
6667 +- __arpt_unregister_table(new_table);
6668 ++ __arpt_unregister_table(net, new_table);
6669 + *res = NULL;
6670 + }
6671 +
6672 +@@ -1581,7 +1582,7 @@ void arpt_unregister_table(struct net *net, struct xt_table *table,
6673 + const struct nf_hook_ops *ops)
6674 + {
6675 + nf_unregister_net_hooks(net, ops, hweight32(table->valid_hooks));
6676 +- __arpt_unregister_table(table);
6677 ++ __arpt_unregister_table(net, table);
6678 + }
6679 +
6680 + /* The built-in targets: standard (NULL) and error. */
6681 +diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
6682 +index e537a4b6531b..84115577d3dc 100644
6683 +--- a/net/ipv4/tcp.c
6684 ++++ b/net/ipv4/tcp.c
6685 +@@ -1087,8 +1087,7 @@ do_error:
6686 + goto out;
6687 + out_err:
6688 + /* make sure we wake any epoll edge trigger waiter */
6689 +- if (unlikely(skb_queue_len(&sk->sk_write_queue) == 0 &&
6690 +- err == -EAGAIN)) {
6691 ++ if (unlikely(tcp_rtx_and_write_queues_empty(sk) && err == -EAGAIN)) {
6692 + sk->sk_write_space(sk);
6693 + tcp_chrono_stop(sk, TCP_CHRONO_SNDBUF_LIMITED);
6694 + }
6695 +@@ -1419,8 +1418,7 @@ out_err:
6696 + sock_zerocopy_put_abort(uarg, true);
6697 + err = sk_stream_error(sk, flags, err);
6698 + /* make sure we wake any epoll edge trigger waiter */
6699 +- if (unlikely(skb_queue_len(&sk->sk_write_queue) == 0 &&
6700 +- err == -EAGAIN)) {
6701 ++ if (unlikely(tcp_rtx_and_write_queues_empty(sk) && err == -EAGAIN)) {
6702 + sk->sk_write_space(sk);
6703 + tcp_chrono_stop(sk, TCP_CHRONO_SNDBUF_LIMITED);
6704 + }
6705 +diff --git a/net/ipv4/tcp_bpf.c b/net/ipv4/tcp_bpf.c
6706 +index e38705165ac9..8a01428f80c1 100644
6707 +--- a/net/ipv4/tcp_bpf.c
6708 ++++ b/net/ipv4/tcp_bpf.c
6709 +@@ -121,14 +121,14 @@ int tcp_bpf_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
6710 + struct sk_psock *psock;
6711 + int copied, ret;
6712 +
6713 +- if (unlikely(flags & MSG_ERRQUEUE))
6714 +- return inet_recv_error(sk, msg, len, addr_len);
6715 +- if (!skb_queue_empty(&sk->sk_receive_queue))
6716 +- return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len);
6717 +-
6718 + psock = sk_psock_get(sk);
6719 + if (unlikely(!psock))
6720 + return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len);
6721 ++ if (unlikely(flags & MSG_ERRQUEUE))
6722 ++ return inet_recv_error(sk, msg, len, addr_len);
6723 ++ if (!skb_queue_empty(&sk->sk_receive_queue) &&
6724 ++ sk_psock_queue_empty(psock))
6725 ++ return tcp_recvmsg(sk, msg, len, nonblock, flags, addr_len);
6726 + lock_sock(sk);
6727 + msg_bytes_ready:
6728 + copied = __tcp_bpf_recvmsg(sk, psock, msg, len, flags);
6729 +@@ -139,7 +139,7 @@ msg_bytes_ready:
6730 + timeo = sock_rcvtimeo(sk, nonblock);
6731 + data = tcp_bpf_wait_data(sk, psock, flags, timeo, &err);
6732 + if (data) {
6733 +- if (skb_queue_empty(&sk->sk_receive_queue))
6734 ++ if (!sk_psock_queue_empty(psock))
6735 + goto msg_bytes_ready;
6736 + release_sock(sk);
6737 + sk_psock_put(sk, psock);
6738 +@@ -315,10 +315,7 @@ more_data:
6739 + */
6740 + delta = msg->sg.size;
6741 + psock->eval = sk_psock_msg_verdict(sk, psock, msg);
6742 +- if (msg->sg.size < delta)
6743 +- delta -= msg->sg.size;
6744 +- else
6745 +- delta = 0;
6746 ++ delta -= msg->sg.size;
6747 + }
6748 +
6749 + if (msg->cork_bytes &&
6750 +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
6751 +index 67e44e6717b0..59b78ce2ce2e 100644
6752 +--- a/net/ipv4/tcp_input.c
6753 ++++ b/net/ipv4/tcp_input.c
6754 +@@ -915,9 +915,10 @@ static void tcp_check_sack_reordering(struct sock *sk, const u32 low_seq,
6755 + /* This must be called before lost_out is incremented */
6756 + static void tcp_verify_retransmit_hint(struct tcp_sock *tp, struct sk_buff *skb)
6757 + {
6758 +- if (!tp->retransmit_skb_hint ||
6759 +- before(TCP_SKB_CB(skb)->seq,
6760 +- TCP_SKB_CB(tp->retransmit_skb_hint)->seq))
6761 ++ if ((!tp->retransmit_skb_hint && tp->retrans_out >= tp->lost_out) ||
6762 ++ (tp->retransmit_skb_hint &&
6763 ++ before(TCP_SKB_CB(skb)->seq,
6764 ++ TCP_SKB_CB(tp->retransmit_skb_hint)->seq)))
6765 + tp->retransmit_skb_hint = skb;
6766 + }
6767 +
6768 +diff --git a/net/ipv4/tcp_ulp.c b/net/ipv4/tcp_ulp.c
6769 +index 4849edb62d52..9168645b760e 100644
6770 +--- a/net/ipv4/tcp_ulp.c
6771 ++++ b/net/ipv4/tcp_ulp.c
6772 +@@ -96,17 +96,19 @@ void tcp_get_available_ulp(char *buf, size_t maxlen)
6773 + rcu_read_unlock();
6774 + }
6775 +
6776 +-void tcp_update_ulp(struct sock *sk, struct proto *proto)
6777 ++void tcp_update_ulp(struct sock *sk, struct proto *proto,
6778 ++ void (*write_space)(struct sock *sk))
6779 + {
6780 + struct inet_connection_sock *icsk = inet_csk(sk);
6781 +
6782 + if (!icsk->icsk_ulp_ops) {
6783 ++ sk->sk_write_space = write_space;
6784 + sk->sk_prot = proto;
6785 + return;
6786 + }
6787 +
6788 + if (icsk->icsk_ulp_ops->update)
6789 +- icsk->icsk_ulp_ops->update(sk, proto);
6790 ++ icsk->icsk_ulp_ops->update(sk, proto, write_space);
6791 + }
6792 +
6793 + void tcp_cleanup_ulp(struct sock *sk)
6794 +diff --git a/net/netfilter/ipset/ip_set_bitmap_gen.h b/net/netfilter/ipset/ip_set_bitmap_gen.h
6795 +index 063df74b4647..e1f271a1b2c1 100644
6796 +--- a/net/netfilter/ipset/ip_set_bitmap_gen.h
6797 ++++ b/net/netfilter/ipset/ip_set_bitmap_gen.h
6798 +@@ -60,9 +60,9 @@ mtype_destroy(struct ip_set *set)
6799 + if (SET_WITH_TIMEOUT(set))
6800 + del_timer_sync(&map->gc);
6801 +
6802 +- ip_set_free(map->members);
6803 + if (set->dsize && set->extensions & IPSET_EXT_DESTROY)
6804 + mtype_ext_cleanup(set);
6805 ++ ip_set_free(map->members);
6806 + ip_set_free(map);
6807 +
6808 + set->data = NULL;
6809 +diff --git a/net/netfilter/nf_nat_proto.c b/net/netfilter/nf_nat_proto.c
6810 +index 0a59c14b5177..64eedc17037a 100644
6811 +--- a/net/netfilter/nf_nat_proto.c
6812 ++++ b/net/netfilter/nf_nat_proto.c
6813 +@@ -233,6 +233,19 @@ icmp_manip_pkt(struct sk_buff *skb,
6814 + return false;
6815 +
6816 + hdr = (struct icmphdr *)(skb->data + hdroff);
6817 ++ switch (hdr->type) {
6818 ++ case ICMP_ECHO:
6819 ++ case ICMP_ECHOREPLY:
6820 ++ case ICMP_TIMESTAMP:
6821 ++ case ICMP_TIMESTAMPREPLY:
6822 ++ case ICMP_INFO_REQUEST:
6823 ++ case ICMP_INFO_REPLY:
6824 ++ case ICMP_ADDRESS:
6825 ++ case ICMP_ADDRESSREPLY:
6826 ++ break;
6827 ++ default:
6828 ++ return true;
6829 ++ }
6830 + inet_proto_csum_replace2(&hdr->checksum, skb,
6831 + hdr->un.echo.id, tuple->src.u.icmp.id, false);
6832 + hdr->un.echo.id = tuple->src.u.icmp.id;
6833 +diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
6834 +index 67ca47c7ce54..9fefd0150091 100644
6835 +--- a/net/netfilter/nf_tables_api.c
6836 ++++ b/net/netfilter/nf_tables_api.c
6837 +@@ -22,6 +22,8 @@
6838 + #include <net/net_namespace.h>
6839 + #include <net/sock.h>
6840 +
6841 ++#define NFT_MODULE_AUTOLOAD_LIMIT (MODULE_NAME_LEN - sizeof("nft-expr-255-"))
6842 ++
6843 + static LIST_HEAD(nf_tables_expressions);
6844 + static LIST_HEAD(nf_tables_objects);
6845 + static LIST_HEAD(nf_tables_flowtables);
6846 +@@ -500,33 +502,34 @@ __nf_tables_chain_type_lookup(const struct nlattr *nla, u8 family)
6847 + }
6848 +
6849 + /*
6850 +- * Loading a module requires dropping mutex that guards the
6851 +- * transaction.
6852 +- * We first need to abort any pending transactions as once
6853 +- * mutex is unlocked a different client could start a new
6854 +- * transaction. It must not see any 'future generation'
6855 +- * changes * as these changes will never happen.
6856 ++ * Loading a module requires dropping mutex that guards the transaction.
6857 ++ * A different client might race to start a new transaction meanwhile. Zap the
6858 ++ * list of pending transaction and then restore it once the mutex is grabbed
6859 ++ * again. Users of this function return EAGAIN which implicitly triggers the
6860 ++ * transaction abort path to clean up the list of pending transactions.
6861 + */
6862 + #ifdef CONFIG_MODULES
6863 +-static int __nf_tables_abort(struct net *net);
6864 +-
6865 + static void nft_request_module(struct net *net, const char *fmt, ...)
6866 + {
6867 + char module_name[MODULE_NAME_LEN];
6868 ++ LIST_HEAD(commit_list);
6869 + va_list args;
6870 + int ret;
6871 +
6872 +- __nf_tables_abort(net);
6873 ++ list_splice_init(&net->nft.commit_list, &commit_list);
6874 +
6875 + va_start(args, fmt);
6876 + ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);
6877 + va_end(args);
6878 +- if (WARN(ret >= MODULE_NAME_LEN, "truncated: '%s' (len %d)", module_name, ret))
6879 ++ if (ret >= MODULE_NAME_LEN)
6880 + return;
6881 +
6882 + mutex_unlock(&net->nft.commit_mutex);
6883 + request_module("%s", module_name);
6884 + mutex_lock(&net->nft.commit_mutex);
6885 ++
6886 ++ WARN_ON_ONCE(!list_empty(&net->nft.commit_list));
6887 ++ list_splice(&commit_list, &net->nft.commit_list);
6888 + }
6889 + #endif
6890 +
6891 +@@ -978,12 +981,18 @@ static int nft_flush_table(struct nft_ctx *ctx)
6892 + }
6893 +
6894 + list_for_each_entry_safe(flowtable, nft, &ctx->table->flowtables, list) {
6895 ++ if (!nft_is_active_next(ctx->net, flowtable))
6896 ++ continue;
6897 ++
6898 + err = nft_delflowtable(ctx, flowtable);
6899 + if (err < 0)
6900 + goto out;
6901 + }
6902 +
6903 + list_for_each_entry_safe(obj, ne, &ctx->table->objects, list) {
6904 ++ if (!nft_is_active_next(ctx->net, obj))
6905 ++ continue;
6906 ++
6907 + err = nft_delobj(ctx, obj);
6908 + if (err < 0)
6909 + goto out;
6910 +@@ -1174,7 +1183,8 @@ static const struct nla_policy nft_chain_policy[NFTA_CHAIN_MAX + 1] = {
6911 + .len = NFT_CHAIN_MAXNAMELEN - 1 },
6912 + [NFTA_CHAIN_HOOK] = { .type = NLA_NESTED },
6913 + [NFTA_CHAIN_POLICY] = { .type = NLA_U32 },
6914 +- [NFTA_CHAIN_TYPE] = { .type = NLA_STRING },
6915 ++ [NFTA_CHAIN_TYPE] = { .type = NLA_STRING,
6916 ++ .len = NFT_MODULE_AUTOLOAD_LIMIT },
6917 + [NFTA_CHAIN_COUNTERS] = { .type = NLA_NESTED },
6918 + [NFTA_CHAIN_FLAGS] = { .type = NLA_U32 },
6919 + };
6920 +@@ -2088,7 +2098,8 @@ static const struct nft_expr_type *nft_expr_type_get(struct net *net,
6921 + }
6922 +
6923 + static const struct nla_policy nft_expr_policy[NFTA_EXPR_MAX + 1] = {
6924 +- [NFTA_EXPR_NAME] = { .type = NLA_STRING },
6925 ++ [NFTA_EXPR_NAME] = { .type = NLA_STRING,
6926 ++ .len = NFT_MODULE_AUTOLOAD_LIMIT },
6927 + [NFTA_EXPR_DATA] = { .type = NLA_NESTED },
6928 + };
6929 +
6930 +@@ -3931,7 +3942,8 @@ static const struct nla_policy nft_set_elem_policy[NFTA_SET_ELEM_MAX + 1] = {
6931 + [NFTA_SET_ELEM_USERDATA] = { .type = NLA_BINARY,
6932 + .len = NFT_USERDATA_MAXLEN },
6933 + [NFTA_SET_ELEM_EXPR] = { .type = NLA_NESTED },
6934 +- [NFTA_SET_ELEM_OBJREF] = { .type = NLA_STRING },
6935 ++ [NFTA_SET_ELEM_OBJREF] = { .type = NLA_STRING,
6936 ++ .len = NFT_OBJ_MAXNAMELEN - 1 },
6937 + };
6938 +
6939 + static const struct nla_policy nft_set_elem_list_policy[NFTA_SET_ELEM_LIST_MAX + 1] = {
6940 +diff --git a/net/netfilter/nft_tunnel.c b/net/netfilter/nft_tunnel.c
6941 +index 3d4c2ae605a8..5284fcf16be7 100644
6942 +--- a/net/netfilter/nft_tunnel.c
6943 ++++ b/net/netfilter/nft_tunnel.c
6944 +@@ -76,7 +76,7 @@ static int nft_tunnel_get_init(const struct nft_ctx *ctx,
6945 + struct nft_tunnel *priv = nft_expr_priv(expr);
6946 + u32 len;
6947 +
6948 +- if (!tb[NFTA_TUNNEL_KEY] &&
6949 ++ if (!tb[NFTA_TUNNEL_KEY] ||
6950 + !tb[NFTA_TUNNEL_DREG])
6951 + return -EINVAL;
6952 +
6953 +@@ -266,6 +266,9 @@ static int nft_tunnel_obj_erspan_init(const struct nlattr *attr,
6954 + if (err < 0)
6955 + return err;
6956 +
6957 ++ if (!tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION])
6958 ++ return -EINVAL;
6959 ++
6960 + version = ntohl(nla_get_be32(tb[NFTA_TUNNEL_KEY_ERSPAN_VERSION]));
6961 + switch (version) {
6962 + case ERSPAN_VERSION:
6963 +diff --git a/net/sched/act_ctinfo.c b/net/sched/act_ctinfo.c
6964 +index 0dbcfd1dca7b..f45995a6237a 100644
6965 +--- a/net/sched/act_ctinfo.c
6966 ++++ b/net/sched/act_ctinfo.c
6967 +@@ -360,6 +360,16 @@ static int tcf_ctinfo_search(struct net *net, struct tc_action **a, u32 index)
6968 + return tcf_idr_search(tn, a, index);
6969 + }
6970 +
6971 ++static void tcf_ctinfo_cleanup(struct tc_action *a)
6972 ++{
6973 ++ struct tcf_ctinfo *ci = to_ctinfo(a);
6974 ++ struct tcf_ctinfo_params *cp;
6975 ++
6976 ++ cp = rcu_dereference_protected(ci->params, 1);
6977 ++ if (cp)
6978 ++ kfree_rcu(cp, rcu);
6979 ++}
6980 ++
6981 + static struct tc_action_ops act_ctinfo_ops = {
6982 + .kind = "ctinfo",
6983 + .id = TCA_ID_CTINFO,
6984 +@@ -367,6 +377,7 @@ static struct tc_action_ops act_ctinfo_ops = {
6985 + .act = tcf_ctinfo_act,
6986 + .dump = tcf_ctinfo_dump,
6987 + .init = tcf_ctinfo_init,
6988 ++ .cleanup= tcf_ctinfo_cleanup,
6989 + .walk = tcf_ctinfo_walker,
6990 + .lookup = tcf_ctinfo_search,
6991 + .size = sizeof(struct tcf_ctinfo),
6992 +diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c
6993 +index 3a31e241c647..a0cfb4793c93 100644
6994 +--- a/net/sched/act_ife.c
6995 ++++ b/net/sched/act_ife.c
6996 +@@ -536,6 +536,9 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
6997 + }
6998 +
6999 + ife = to_ife(*a);
7000 ++ if (ret == ACT_P_CREATED)
7001 ++ INIT_LIST_HEAD(&ife->metalist);
7002 ++
7003 + err = tcf_action_check_ctrlact(parm->action, tp, &goto_ch, extack);
7004 + if (err < 0)
7005 + goto release_idr;
7006 +@@ -565,10 +568,6 @@ static int tcf_ife_init(struct net *net, struct nlattr *nla,
7007 + p->eth_type = ife_type;
7008 + }
7009 +
7010 +-
7011 +- if (ret == ACT_P_CREATED)
7012 +- INIT_LIST_HEAD(&ife->metalist);
7013 +-
7014 + if (tb[TCA_IFE_METALST]) {
7015 + err = nla_parse_nested_deprecated(tb2, IFE_META_MAX,
7016 + tb[TCA_IFE_METALST], NULL,
7017 +diff --git a/net/tipc/bcast.c b/net/tipc/bcast.c
7018 +index 6ef1abdd525f..885ecf6ea65a 100644
7019 +--- a/net/tipc/bcast.c
7020 ++++ b/net/tipc/bcast.c
7021 +@@ -305,17 +305,17 @@ static int tipc_rcast_xmit(struct net *net, struct sk_buff_head *pkts,
7022 + * @skb: socket buffer to copy
7023 + * @method: send method to be used
7024 + * @dests: destination nodes for message.
7025 +- * @cong_link_cnt: returns number of encountered congested destination links
7026 + * Returns 0 if success, otherwise errno
7027 + */
7028 + static int tipc_mcast_send_sync(struct net *net, struct sk_buff *skb,
7029 + struct tipc_mc_method *method,
7030 +- struct tipc_nlist *dests,
7031 +- u16 *cong_link_cnt)
7032 ++ struct tipc_nlist *dests)
7033 + {
7034 + struct tipc_msg *hdr, *_hdr;
7035 + struct sk_buff_head tmpq;
7036 + struct sk_buff *_skb;
7037 ++ u16 cong_link_cnt;
7038 ++ int rc = 0;
7039 +
7040 + /* Is a cluster supporting with new capabilities ? */
7041 + if (!(tipc_net(net)->capabilities & TIPC_MCAST_RBCTL))
7042 +@@ -343,18 +343,19 @@ static int tipc_mcast_send_sync(struct net *net, struct sk_buff *skb,
7043 + _hdr = buf_msg(_skb);
7044 + msg_set_size(_hdr, MCAST_H_SIZE);
7045 + msg_set_is_rcast(_hdr, !msg_is_rcast(hdr));
7046 ++ msg_set_errcode(_hdr, TIPC_ERR_NO_PORT);
7047 +
7048 + __skb_queue_head_init(&tmpq);
7049 + __skb_queue_tail(&tmpq, _skb);
7050 + if (method->rcast)
7051 +- tipc_bcast_xmit(net, &tmpq, cong_link_cnt);
7052 ++ rc = tipc_bcast_xmit(net, &tmpq, &cong_link_cnt);
7053 + else
7054 +- tipc_rcast_xmit(net, &tmpq, dests, cong_link_cnt);
7055 ++ rc = tipc_rcast_xmit(net, &tmpq, dests, &cong_link_cnt);
7056 +
7057 + /* This queue should normally be empty by now */
7058 + __skb_queue_purge(&tmpq);
7059 +
7060 +- return 0;
7061 ++ return rc;
7062 + }
7063 +
7064 + /* tipc_mcast_xmit - deliver message to indicated destination nodes
7065 +@@ -396,9 +397,14 @@ int tipc_mcast_xmit(struct net *net, struct sk_buff_head *pkts,
7066 + msg_set_is_rcast(hdr, method->rcast);
7067 +
7068 + /* Switch method ? */
7069 +- if (rcast != method->rcast)
7070 +- tipc_mcast_send_sync(net, skb, method,
7071 +- dests, cong_link_cnt);
7072 ++ if (rcast != method->rcast) {
7073 ++ rc = tipc_mcast_send_sync(net, skb, method, dests);
7074 ++ if (unlikely(rc)) {
7075 ++ pr_err("Unable to send SYN: method %d, rc %d\n",
7076 ++ rcast, rc);
7077 ++ goto exit;
7078 ++ }
7079 ++ }
7080 +
7081 + if (method->rcast)
7082 + rc = tipc_rcast_xmit(net, pkts, dests, cong_link_cnt);
7083 +diff --git a/net/tipc/socket.c b/net/tipc/socket.c
7084 +index 4b92b196cfa6..79d06c21ebe3 100644
7085 +--- a/net/tipc/socket.c
7086 ++++ b/net/tipc/socket.c
7087 +@@ -1306,8 +1306,8 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
7088 + struct tipc_msg *hdr = &tsk->phdr;
7089 + struct tipc_name_seq *seq;
7090 + struct sk_buff_head pkts;
7091 +- u32 dport, dnode = 0;
7092 +- u32 type, inst;
7093 ++ u32 dport = 0, dnode = 0;
7094 ++ u32 type = 0, inst = 0;
7095 + int mtu, rc;
7096 +
7097 + if (unlikely(dlen > TIPC_MAX_USER_MSG_SIZE))
7098 +@@ -1360,23 +1360,11 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
7099 + type = dest->addr.name.name.type;
7100 + inst = dest->addr.name.name.instance;
7101 + dnode = dest->addr.name.domain;
7102 +- msg_set_type(hdr, TIPC_NAMED_MSG);
7103 +- msg_set_hdr_sz(hdr, NAMED_H_SIZE);
7104 +- msg_set_nametype(hdr, type);
7105 +- msg_set_nameinst(hdr, inst);
7106 +- msg_set_lookup_scope(hdr, tipc_node2scope(dnode));
7107 + dport = tipc_nametbl_translate(net, type, inst, &dnode);
7108 +- msg_set_destnode(hdr, dnode);
7109 +- msg_set_destport(hdr, dport);
7110 + if (unlikely(!dport && !dnode))
7111 + return -EHOSTUNREACH;
7112 + } else if (dest->addrtype == TIPC_ADDR_ID) {
7113 + dnode = dest->addr.id.node;
7114 +- msg_set_type(hdr, TIPC_DIRECT_MSG);
7115 +- msg_set_lookup_scope(hdr, 0);
7116 +- msg_set_destnode(hdr, dnode);
7117 +- msg_set_destport(hdr, dest->addr.id.ref);
7118 +- msg_set_hdr_sz(hdr, BASIC_H_SIZE);
7119 + } else {
7120 + return -EINVAL;
7121 + }
7122 +@@ -1387,6 +1375,22 @@ static int __tipc_sendmsg(struct socket *sock, struct msghdr *m, size_t dlen)
7123 + if (unlikely(rc))
7124 + return rc;
7125 +
7126 ++ if (dest->addrtype == TIPC_ADDR_NAME) {
7127 ++ msg_set_type(hdr, TIPC_NAMED_MSG);
7128 ++ msg_set_hdr_sz(hdr, NAMED_H_SIZE);
7129 ++ msg_set_nametype(hdr, type);
7130 ++ msg_set_nameinst(hdr, inst);
7131 ++ msg_set_lookup_scope(hdr, tipc_node2scope(dnode));
7132 ++ msg_set_destnode(hdr, dnode);
7133 ++ msg_set_destport(hdr, dport);
7134 ++ } else { /* TIPC_ADDR_ID */
7135 ++ msg_set_type(hdr, TIPC_DIRECT_MSG);
7136 ++ msg_set_lookup_scope(hdr, 0);
7137 ++ msg_set_destnode(hdr, dnode);
7138 ++ msg_set_destport(hdr, dest->addr.id.ref);
7139 ++ msg_set_hdr_sz(hdr, BASIC_H_SIZE);
7140 ++ }
7141 ++
7142 + __skb_queue_head_init(&pkts);
7143 + mtu = tipc_node_get_mtu(net, dnode, tsk->portid);
7144 + rc = tipc_msg_build(hdr, m, 0, dlen, mtu, &pkts);
7145 +diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
7146 +index 82d0beed8f07..7aba4ee77aba 100644
7147 +--- a/net/tls/tls_main.c
7148 ++++ b/net/tls/tls_main.c
7149 +@@ -798,15 +798,19 @@ out:
7150 + return rc;
7151 + }
7152 +
7153 +-static void tls_update(struct sock *sk, struct proto *p)
7154 ++static void tls_update(struct sock *sk, struct proto *p,
7155 ++ void (*write_space)(struct sock *sk))
7156 + {
7157 + struct tls_context *ctx;
7158 +
7159 + ctx = tls_get_ctx(sk);
7160 +- if (likely(ctx))
7161 ++ if (likely(ctx)) {
7162 ++ ctx->sk_write_space = write_space;
7163 + ctx->sk_proto = p;
7164 +- else
7165 ++ } else {
7166 + sk->sk_prot = p;
7167 ++ sk->sk_write_space = write_space;
7168 ++ }
7169 + }
7170 +
7171 + static int tls_get_info(const struct sock *sk, struct sk_buff *skb)
7172 +diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
7173 +index c70cf30c5492..a80920f261ca 100644
7174 +--- a/net/tls/tls_sw.c
7175 ++++ b/net/tls/tls_sw.c
7176 +@@ -677,12 +677,32 @@ static int tls_push_record(struct sock *sk, int flags,
7177 +
7178 + split_point = msg_pl->apply_bytes;
7179 + split = split_point && split_point < msg_pl->sg.size;
7180 ++ if (unlikely((!split &&
7181 ++ msg_pl->sg.size +
7182 ++ prot->overhead_size > msg_en->sg.size) ||
7183 ++ (split &&
7184 ++ split_point +
7185 ++ prot->overhead_size > msg_en->sg.size))) {
7186 ++ split = true;
7187 ++ split_point = msg_en->sg.size;
7188 ++ }
7189 + if (split) {
7190 + rc = tls_split_open_record(sk, rec, &tmp, msg_pl, msg_en,
7191 + split_point, prot->overhead_size,
7192 + &orig_end);
7193 + if (rc < 0)
7194 + return rc;
7195 ++ /* This can happen if above tls_split_open_record allocates
7196 ++ * a single large encryption buffer instead of two smaller
7197 ++ * ones. In this case adjust pointers and continue without
7198 ++ * split.
7199 ++ */
7200 ++ if (!msg_pl->sg.size) {
7201 ++ tls_merge_open_record(sk, rec, tmp, orig_end);
7202 ++ msg_pl = &rec->msg_plaintext;
7203 ++ msg_en = &rec->msg_encrypted;
7204 ++ split = false;
7205 ++ }
7206 + sk_msg_trim(sk, msg_en, msg_pl->sg.size +
7207 + prot->overhead_size);
7208 + }
7209 +@@ -704,6 +724,12 @@ static int tls_push_record(struct sock *sk, int flags,
7210 + sg_mark_end(sk_msg_elem(msg_pl, i));
7211 + }
7212 +
7213 ++ if (msg_pl->sg.end < msg_pl->sg.start) {
7214 ++ sg_chain(&msg_pl->sg.data[msg_pl->sg.start],
7215 ++ MAX_SKB_FRAGS - msg_pl->sg.start + 1,
7216 ++ msg_pl->sg.data);
7217 ++ }
7218 ++
7219 + i = msg_pl->sg.start;
7220 + sg_chain(rec->sg_aead_in, 2, &msg_pl->sg.data[i]);
7221 +
7222 +@@ -778,10 +804,7 @@ more_data:
7223 + if (psock->eval == __SK_NONE) {
7224 + delta = msg->sg.size;
7225 + psock->eval = sk_psock_msg_verdict(sk, psock, msg);
7226 +- if (delta < msg->sg.size)
7227 +- delta -= msg->sg.size;
7228 +- else
7229 +- delta = 0;
7230 ++ delta -= msg->sg.size;
7231 + }
7232 + if (msg->cork_bytes && msg->cork_bytes > msg->sg.size &&
7233 + !enospc && !full_record) {
7234 +diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c
7235 +index 7b72286922f7..c74646b7a751 100644
7236 +--- a/net/wireless/nl80211.c
7237 ++++ b/net/wireless/nl80211.c
7238 +@@ -10834,6 +10834,7 @@ static int cfg80211_cqm_rssi_update(struct cfg80211_registered_device *rdev,
7239 + if (err)
7240 + return err;
7241 +
7242 ++ cfg80211_sinfo_release_content(&sinfo);
7243 + if (sinfo.filled & BIT_ULL(NL80211_STA_INFO_BEACON_SIGNAL_AVG))
7244 + wdev->cqm_config->last_rssi_event_value =
7245 + (s8) sinfo.rx_beacon_signal_avg;
7246 +@@ -13787,6 +13788,8 @@ static int nl80211_probe_mesh_link(struct sk_buff *skb, struct genl_info *info)
7247 + if (err)
7248 + return err;
7249 +
7250 ++ cfg80211_sinfo_release_content(&sinfo);
7251 ++
7252 + return rdev_probe_mesh_link(rdev, dev, dest, buf, len);
7253 + }
7254 +
7255 +diff --git a/net/wireless/rdev-ops.h b/net/wireless/rdev-ops.h
7256 +index e853a4fe6f97..3dd9515c836b 100644
7257 +--- a/net/wireless/rdev-ops.h
7258 ++++ b/net/wireless/rdev-ops.h
7259 +@@ -538,6 +538,10 @@ static inline int
7260 + rdev_set_wiphy_params(struct cfg80211_registered_device *rdev, u32 changed)
7261 + {
7262 + int ret;
7263 ++
7264 ++ if (!rdev->ops->set_wiphy_params)
7265 ++ return -EOPNOTSUPP;
7266 ++
7267 + trace_rdev_set_wiphy_params(&rdev->wiphy, changed);
7268 + ret = rdev->ops->set_wiphy_params(&rdev->wiphy, changed);
7269 + trace_rdev_return_int(&rdev->wiphy, ret);
7270 +diff --git a/net/wireless/sme.c b/net/wireless/sme.c
7271 +index 7a6c38ddc65a..d32a2ec4d96a 100644
7272 +--- a/net/wireless/sme.c
7273 ++++ b/net/wireless/sme.c
7274 +@@ -1307,14 +1307,14 @@ void cfg80211_autodisconnect_wk(struct work_struct *work)
7275 + if (wdev->conn_owner_nlportid) {
7276 + switch (wdev->iftype) {
7277 + case NL80211_IFTYPE_ADHOC:
7278 +- cfg80211_leave_ibss(rdev, wdev->netdev, false);
7279 ++ __cfg80211_leave_ibss(rdev, wdev->netdev, false);
7280 + break;
7281 + case NL80211_IFTYPE_AP:
7282 + case NL80211_IFTYPE_P2P_GO:
7283 +- cfg80211_stop_ap(rdev, wdev->netdev, false);
7284 ++ __cfg80211_stop_ap(rdev, wdev->netdev, false);
7285 + break;
7286 + case NL80211_IFTYPE_MESH_POINT:
7287 +- cfg80211_leave_mesh(rdev, wdev->netdev);
7288 ++ __cfg80211_leave_mesh(rdev, wdev->netdev);
7289 + break;
7290 + case NL80211_IFTYPE_STATION:
7291 + case NL80211_IFTYPE_P2P_CLIENT:
7292 +diff --git a/net/wireless/util.c b/net/wireless/util.c
7293 +index 5b4ed5bbc542..8481e9ac33da 100644
7294 +--- a/net/wireless/util.c
7295 ++++ b/net/wireless/util.c
7296 +@@ -564,7 +564,7 @@ __frame_add_frag(struct sk_buff *skb, struct page *page,
7297 + struct skb_shared_info *sh = skb_shinfo(skb);
7298 + int page_offset;
7299 +
7300 +- page_ref_inc(page);
7301 ++ get_page(page);
7302 + page_offset = ptr - page_address(page);
7303 + skb_add_rx_frag(skb, sh->nr_frags, page, page_offset, len, size);
7304 + }
7305 +diff --git a/sound/core/seq/seq_timer.c b/sound/core/seq/seq_timer.c
7306 +index 161f3170bd7e..3bc6095df44d 100644
7307 +--- a/sound/core/seq/seq_timer.c
7308 ++++ b/sound/core/seq/seq_timer.c
7309 +@@ -465,15 +465,19 @@ void snd_seq_info_timer_read(struct snd_info_entry *entry,
7310 + q = queueptr(idx);
7311 + if (q == NULL)
7312 + continue;
7313 +- if ((tmr = q->timer) == NULL ||
7314 +- (ti = tmr->timeri) == NULL) {
7315 +- queuefree(q);
7316 +- continue;
7317 +- }
7318 ++ mutex_lock(&q->timer_mutex);
7319 ++ tmr = q->timer;
7320 ++ if (!tmr)
7321 ++ goto unlock;
7322 ++ ti = tmr->timeri;
7323 ++ if (!ti)
7324 ++ goto unlock;
7325 + snd_iprintf(buffer, "Timer for queue %i : %s\n", q->queue, ti->timer->name);
7326 + resolution = snd_timer_resolution(ti) * tmr->ticks;
7327 + snd_iprintf(buffer, " Period time : %lu.%09lu\n", resolution / 1000000000, resolution % 1000000000);
7328 + snd_iprintf(buffer, " Skew : %u / %u\n", tmr->skew, tmr->skew_base);
7329 ++unlock:
7330 ++ mutex_unlock(&q->timer_mutex);
7331 + queuefree(q);
7332 + }
7333 + }
7334 +diff --git a/sound/firewire/dice/dice-extension.c b/sound/firewire/dice/dice-extension.c
7335 +index a63fcbc875ad..02f4a8318e38 100644
7336 +--- a/sound/firewire/dice/dice-extension.c
7337 ++++ b/sound/firewire/dice/dice-extension.c
7338 +@@ -159,8 +159,11 @@ int snd_dice_detect_extension_formats(struct snd_dice *dice)
7339 + int j;
7340 +
7341 + for (j = i + 1; j < 9; ++j) {
7342 +- if (pointers[i * 2] == pointers[j * 2])
7343 ++ if (pointers[i * 2] == pointers[j * 2]) {
7344 ++ // Fallback to limited functionality.
7345 ++ err = -ENXIO;
7346 + goto end;
7347 ++ }
7348 + }
7349 + }
7350 +
7351 +diff --git a/sound/firewire/tascam/amdtp-tascam.c b/sound/firewire/tascam/amdtp-tascam.c
7352 +index e80bb84c43f6..f823a2ab3544 100644
7353 +--- a/sound/firewire/tascam/amdtp-tascam.c
7354 ++++ b/sound/firewire/tascam/amdtp-tascam.c
7355 +@@ -157,14 +157,15 @@ static void read_status_messages(struct amdtp_stream *s,
7356 + if ((before ^ after) & mask) {
7357 + struct snd_firewire_tascam_change *entry =
7358 + &tscm->queue[tscm->push_pos];
7359 ++ unsigned long flag;
7360 +
7361 +- spin_lock_irq(&tscm->lock);
7362 ++ spin_lock_irqsave(&tscm->lock, flag);
7363 + entry->index = index;
7364 + entry->before = before;
7365 + entry->after = after;
7366 + if (++tscm->push_pos >= SND_TSCM_QUEUE_COUNT)
7367 + tscm->push_pos = 0;
7368 +- spin_unlock_irq(&tscm->lock);
7369 ++ spin_unlock_irqrestore(&tscm->lock, flag);
7370 +
7371 + wake_up(&tscm->hwdep_wait);
7372 + }
7373 +diff --git a/sound/soc/codecs/msm8916-wcd-analog.c b/sound/soc/codecs/msm8916-wcd-analog.c
7374 +index e3d311fb510e..84289ebeae87 100644
7375 +--- a/sound/soc/codecs/msm8916-wcd-analog.c
7376 ++++ b/sound/soc/codecs/msm8916-wcd-analog.c
7377 +@@ -391,9 +391,6 @@ static int pm8916_wcd_analog_enable_micbias_int(struct snd_soc_component
7378 +
7379 + switch (event) {
7380 + case SND_SOC_DAPM_PRE_PMU:
7381 +- snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
7382 +- MICB_1_INT_TX2_INT_RBIAS_EN_MASK,
7383 +- MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE);
7384 + snd_soc_component_update_bits(component, reg, MICB_1_EN_PULL_DOWN_EN_MASK, 0);
7385 + snd_soc_component_update_bits(component, CDC_A_MICB_1_EN,
7386 + MICB_1_EN_OPA_STG2_TAIL_CURR_MASK,
7387 +@@ -443,6 +440,14 @@ static int pm8916_wcd_analog_enable_micbias_int1(struct
7388 + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm);
7389 + struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
7390 +
7391 ++ switch (event) {
7392 ++ case SND_SOC_DAPM_PRE_PMU:
7393 ++ snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
7394 ++ MICB_1_INT_TX1_INT_RBIAS_EN_MASK,
7395 ++ MICB_1_INT_TX1_INT_RBIAS_EN_ENABLE);
7396 ++ break;
7397 ++ }
7398 ++
7399 + return pm8916_wcd_analog_enable_micbias_int(component, event, w->reg,
7400 + wcd->micbias1_cap_mode);
7401 + }
7402 +@@ -553,6 +558,11 @@ static int pm8916_wcd_analog_enable_micbias_int2(struct
7403 + struct pm8916_wcd_analog_priv *wcd = snd_soc_component_get_drvdata(component);
7404 +
7405 + switch (event) {
7406 ++ case SND_SOC_DAPM_PRE_PMU:
7407 ++ snd_soc_component_update_bits(component, CDC_A_MICB_1_INT_RBIAS,
7408 ++ MICB_1_INT_TX2_INT_RBIAS_EN_MASK,
7409 ++ MICB_1_INT_TX2_INT_RBIAS_EN_ENABLE);
7410 ++ break;
7411 + case SND_SOC_DAPM_POST_PMU:
7412 + pm8916_mbhc_configure_bias(wcd, true);
7413 + break;
7414 +@@ -888,10 +898,10 @@ static const struct snd_soc_dapm_widget pm8916_wcd_analog_dapm_widgets[] = {
7415 +
7416 + SND_SOC_DAPM_SUPPLY("MIC BIAS External1", CDC_A_MICB_1_EN, 7, 0,
7417 + pm8916_wcd_analog_enable_micbias_ext1,
7418 +- SND_SOC_DAPM_PRE_PMU | SND_SOC_DAPM_POST_PMD),
7419 ++ SND_SOC_DAPM_POST_PMU),
7420 + SND_SOC_DAPM_SUPPLY("MIC BIAS External2", CDC_A_MICB_2_EN, 7, 0,
7421 + pm8916_wcd_analog_enable_micbias_ext2,
7422 +- SND_SOC_DAPM_POST_PMU | SND_SOC_DAPM_POST_PMD),
7423 ++ SND_SOC_DAPM_POST_PMU),
7424 +
7425 + SND_SOC_DAPM_ADC_E("ADC1", NULL, CDC_A_TX_1_EN, 7, 0,
7426 + pm8916_wcd_analog_enable_adc,
7427 +diff --git a/sound/soc/codecs/msm8916-wcd-digital.c b/sound/soc/codecs/msm8916-wcd-digital.c
7428 +index 58b2468fb2a7..09fccacadd6b 100644
7429 +--- a/sound/soc/codecs/msm8916-wcd-digital.c
7430 ++++ b/sound/soc/codecs/msm8916-wcd-digital.c
7431 +@@ -586,6 +586,12 @@ static int msm8916_wcd_digital_enable_interpolator(
7432 + snd_soc_component_write(component, rx_gain_reg[w->shift],
7433 + snd_soc_component_read32(component, rx_gain_reg[w->shift]));
7434 + break;
7435 ++ case SND_SOC_DAPM_POST_PMD:
7436 ++ snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL,
7437 ++ 1 << w->shift, 1 << w->shift);
7438 ++ snd_soc_component_update_bits(component, LPASS_CDC_CLK_RX_RESET_CTL,
7439 ++ 1 << w->shift, 0x0);
7440 ++ break;
7441 + }
7442 + return 0;
7443 + }
7444 +diff --git a/sound/soc/intel/boards/bytcht_es8316.c b/sound/soc/intel/boards/bytcht_es8316.c
7445 +index 46612331f5ea..54e97455d7f6 100644
7446 +--- a/sound/soc/intel/boards/bytcht_es8316.c
7447 ++++ b/sound/soc/intel/boards/bytcht_es8316.c
7448 +@@ -442,7 +442,8 @@ static const struct dmi_system_id byt_cht_es8316_quirk_table[] = {
7449 + DMI_MATCH(DMI_SYS_VENDOR, "IRBIS"),
7450 + DMI_MATCH(DMI_PRODUCT_NAME, "NB41"),
7451 + },
7452 +- .driver_data = (void *)(BYT_CHT_ES8316_INTMIC_IN2_MAP
7453 ++ .driver_data = (void *)(BYT_CHT_ES8316_SSP0
7454 ++ | BYT_CHT_ES8316_INTMIC_IN2_MAP
7455 + | BYT_CHT_ES8316_JD_INVERTED),
7456 + },
7457 + { /* Teclast X98 Plus II */
7458 +diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
7459 +index 3c9a9deec9af..4ecea4913f42 100644
7460 +--- a/sound/soc/stm/stm32_adfsdm.c
7461 ++++ b/sound/soc/stm/stm32_adfsdm.c
7462 +@@ -153,13 +153,13 @@ static const struct snd_soc_component_driver stm32_adfsdm_dai_component = {
7463 + .name = "stm32_dfsdm_audio",
7464 + };
7465 +
7466 +-static void memcpy_32to16(void *dest, const void *src, size_t n)
7467 ++static void stm32_memcpy_32to16(void *dest, const void *src, size_t n)
7468 + {
7469 + unsigned int i = 0;
7470 + u16 *d = (u16 *)dest, *s = (u16 *)src;
7471 +
7472 + s++;
7473 +- for (i = n; i > 0; i--) {
7474 ++ for (i = n >> 1; i > 0; i--) {
7475 + *d++ = *s++;
7476 + s++;
7477 + }
7478 +@@ -186,8 +186,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private)
7479 +
7480 + if ((priv->pos + src_size) > buff_size) {
7481 + if (format == SNDRV_PCM_FORMAT_S16_LE)
7482 +- memcpy_32to16(&pcm_buff[priv->pos], src_buff,
7483 +- buff_size - priv->pos);
7484 ++ stm32_memcpy_32to16(&pcm_buff[priv->pos], src_buff,
7485 ++ buff_size - priv->pos);
7486 + else
7487 + memcpy(&pcm_buff[priv->pos], src_buff,
7488 + buff_size - priv->pos);
7489 +@@ -196,8 +196,8 @@ static int stm32_afsdm_pcm_cb(const void *data, size_t size, void *private)
7490 + }
7491 +
7492 + if (format == SNDRV_PCM_FORMAT_S16_LE)
7493 +- memcpy_32to16(&pcm_buff[priv->pos],
7494 +- &src_buff[src_size - cur_size], cur_size);
7495 ++ stm32_memcpy_32to16(&pcm_buff[priv->pos],
7496 ++ &src_buff[src_size - cur_size], cur_size);
7497 + else
7498 + memcpy(&pcm_buff[priv->pos], &src_buff[src_size - cur_size],
7499 + cur_size);
7500 +diff --git a/sound/soc/stm/stm32_sai_sub.c b/sound/soc/stm/stm32_sai_sub.c
7501 +index 48e629ac2d88..30bcd5d3a32a 100644
7502 +--- a/sound/soc/stm/stm32_sai_sub.c
7503 ++++ b/sound/soc/stm/stm32_sai_sub.c
7504 +@@ -184,6 +184,56 @@ static bool stm32_sai_sub_writeable_reg(struct device *dev, unsigned int reg)
7505 + }
7506 + }
7507 +
7508 ++static int stm32_sai_sub_reg_up(struct stm32_sai_sub_data *sai,
7509 ++ unsigned int reg, unsigned int mask,
7510 ++ unsigned int val)
7511 ++{
7512 ++ int ret;
7513 ++
7514 ++ ret = clk_enable(sai->pdata->pclk);
7515 ++ if (ret < 0)
7516 ++ return ret;
7517 ++
7518 ++ ret = regmap_update_bits(sai->regmap, reg, mask, val);
7519 ++
7520 ++ clk_disable(sai->pdata->pclk);
7521 ++
7522 ++ return ret;
7523 ++}
7524 ++
7525 ++static int stm32_sai_sub_reg_wr(struct stm32_sai_sub_data *sai,
7526 ++ unsigned int reg, unsigned int mask,
7527 ++ unsigned int val)
7528 ++{
7529 ++ int ret;
7530 ++
7531 ++ ret = clk_enable(sai->pdata->pclk);
7532 ++ if (ret < 0)
7533 ++ return ret;
7534 ++
7535 ++ ret = regmap_write_bits(sai->regmap, reg, mask, val);
7536 ++
7537 ++ clk_disable(sai->pdata->pclk);
7538 ++
7539 ++ return ret;
7540 ++}
7541 ++
7542 ++static int stm32_sai_sub_reg_rd(struct stm32_sai_sub_data *sai,
7543 ++ unsigned int reg, unsigned int *val)
7544 ++{
7545 ++ int ret;
7546 ++
7547 ++ ret = clk_enable(sai->pdata->pclk);
7548 ++ if (ret < 0)
7549 ++ return ret;
7550 ++
7551 ++ ret = regmap_read(sai->regmap, reg, val);
7552 ++
7553 ++ clk_disable(sai->pdata->pclk);
7554 ++
7555 ++ return ret;
7556 ++}
7557 ++
7558 + static const struct regmap_config stm32_sai_sub_regmap_config_f4 = {
7559 + .reg_bits = 32,
7560 + .reg_stride = 4,
7561 +@@ -295,7 +345,7 @@ static int stm32_sai_set_clk_div(struct stm32_sai_sub_data *sai,
7562 +
7563 + mask = SAI_XCR1_MCKDIV_MASK(SAI_XCR1_MCKDIV_WIDTH(version));
7564 + cr1 = SAI_XCR1_MCKDIV_SET(div);
7565 +- ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, mask, cr1);
7566 ++ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, mask, cr1);
7567 + if (ret < 0)
7568 + dev_err(&sai->pdev->dev, "Failed to update CR1 register\n");
7569 +
7570 +@@ -372,8 +422,8 @@ static int stm32_sai_mclk_enable(struct clk_hw *hw)
7571 +
7572 + dev_dbg(&sai->pdev->dev, "Enable master clock\n");
7573 +
7574 +- return regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
7575 +- SAI_XCR1_MCKEN, SAI_XCR1_MCKEN);
7576 ++ return stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
7577 ++ SAI_XCR1_MCKEN, SAI_XCR1_MCKEN);
7578 + }
7579 +
7580 + static void stm32_sai_mclk_disable(struct clk_hw *hw)
7581 +@@ -383,7 +433,7 @@ static void stm32_sai_mclk_disable(struct clk_hw *hw)
7582 +
7583 + dev_dbg(&sai->pdev->dev, "Disable master clock\n");
7584 +
7585 +- regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, SAI_XCR1_MCKEN, 0);
7586 ++ stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, SAI_XCR1_MCKEN, 0);
7587 + }
7588 +
7589 + static const struct clk_ops mclk_ops = {
7590 +@@ -446,15 +496,15 @@ static irqreturn_t stm32_sai_isr(int irq, void *devid)
7591 + unsigned int sr, imr, flags;
7592 + snd_pcm_state_t status = SNDRV_PCM_STATE_RUNNING;
7593 +
7594 +- regmap_read(sai->regmap, STM_SAI_IMR_REGX, &imr);
7595 +- regmap_read(sai->regmap, STM_SAI_SR_REGX, &sr);
7596 ++ stm32_sai_sub_reg_rd(sai, STM_SAI_IMR_REGX, &imr);
7597 ++ stm32_sai_sub_reg_rd(sai, STM_SAI_SR_REGX, &sr);
7598 +
7599 + flags = sr & imr;
7600 + if (!flags)
7601 + return IRQ_NONE;
7602 +
7603 +- regmap_write_bits(sai->regmap, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK,
7604 +- SAI_XCLRFR_MASK);
7605 ++ stm32_sai_sub_reg_wr(sai, STM_SAI_CLRFR_REGX, SAI_XCLRFR_MASK,
7606 ++ SAI_XCLRFR_MASK);
7607 +
7608 + if (!sai->substream) {
7609 + dev_err(&pdev->dev, "Device stopped. Spurious IRQ 0x%x\n", sr);
7610 +@@ -503,8 +553,8 @@ static int stm32_sai_set_sysclk(struct snd_soc_dai *cpu_dai,
7611 + int ret;
7612 +
7613 + if (dir == SND_SOC_CLOCK_OUT && sai->sai_mclk) {
7614 +- ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
7615 +- SAI_XCR1_NODIV,
7616 ++ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
7617 ++ SAI_XCR1_NODIV,
7618 + freq ? 0 : SAI_XCR1_NODIV);
7619 + if (ret < 0)
7620 + return ret;
7621 +@@ -583,7 +633,7 @@ static int stm32_sai_set_dai_tdm_slot(struct snd_soc_dai *cpu_dai, u32 tx_mask,
7622 +
7623 + slotr_mask |= SAI_XSLOTR_SLOTEN_MASK;
7624 +
7625 +- regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX, slotr_mask, slotr);
7626 ++ stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX, slotr_mask, slotr);
7627 +
7628 + sai->slot_width = slot_width;
7629 + sai->slots = slots;
7630 +@@ -665,7 +715,7 @@ static int stm32_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
7631 + cr1_mask |= SAI_XCR1_CKSTR;
7632 + frcr_mask |= SAI_XFRCR_FSPOL;
7633 +
7634 +- regmap_update_bits(sai->regmap, STM_SAI_FRCR_REGX, frcr_mask, frcr);
7635 ++ stm32_sai_sub_reg_up(sai, STM_SAI_FRCR_REGX, frcr_mask, frcr);
7636 +
7637 + /* DAI clock master masks */
7638 + switch (fmt & SND_SOC_DAIFMT_MASTER_MASK) {
7639 +@@ -693,7 +743,7 @@ static int stm32_sai_set_dai_fmt(struct snd_soc_dai *cpu_dai, unsigned int fmt)
7640 + cr1_mask |= SAI_XCR1_SLAVE;
7641 +
7642 + conf_update:
7643 +- ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1);
7644 ++ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1);
7645 + if (ret < 0) {
7646 + dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
7647 + return ret;
7648 +@@ -730,12 +780,12 @@ static int stm32_sai_startup(struct snd_pcm_substream *substream,
7649 + }
7650 +
7651 + /* Enable ITs */
7652 +- regmap_write_bits(sai->regmap, STM_SAI_CLRFR_REGX,
7653 +- SAI_XCLRFR_MASK, SAI_XCLRFR_MASK);
7654 ++ stm32_sai_sub_reg_wr(sai, STM_SAI_CLRFR_REGX,
7655 ++ SAI_XCLRFR_MASK, SAI_XCLRFR_MASK);
7656 +
7657 + imr = SAI_XIMR_OVRUDRIE;
7658 + if (STM_SAI_IS_CAPTURE(sai)) {
7659 +- regmap_read(sai->regmap, STM_SAI_CR2_REGX, &cr2);
7660 ++ stm32_sai_sub_reg_rd(sai, STM_SAI_CR2_REGX, &cr2);
7661 + if (cr2 & SAI_XCR2_MUTECNT_MASK)
7662 + imr |= SAI_XIMR_MUTEDETIE;
7663 + }
7664 +@@ -745,8 +795,8 @@ static int stm32_sai_startup(struct snd_pcm_substream *substream,
7665 + else
7666 + imr |= SAI_XIMR_AFSDETIE | SAI_XIMR_LFSDETIE;
7667 +
7668 +- regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX,
7669 +- SAI_XIMR_MASK, imr);
7670 ++ stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX,
7671 ++ SAI_XIMR_MASK, imr);
7672 +
7673 + return 0;
7674 + }
7675 +@@ -763,10 +813,10 @@ static int stm32_sai_set_config(struct snd_soc_dai *cpu_dai,
7676 + * SAI fifo threshold is set to half fifo, to keep enough space
7677 + * for DMA incoming bursts.
7678 + */
7679 +- regmap_write_bits(sai->regmap, STM_SAI_CR2_REGX,
7680 +- SAI_XCR2_FFLUSH | SAI_XCR2_FTH_MASK,
7681 +- SAI_XCR2_FFLUSH |
7682 +- SAI_XCR2_FTH_SET(STM_SAI_FIFO_TH_HALF));
7683 ++ stm32_sai_sub_reg_wr(sai, STM_SAI_CR2_REGX,
7684 ++ SAI_XCR2_FFLUSH | SAI_XCR2_FTH_MASK,
7685 ++ SAI_XCR2_FFLUSH |
7686 ++ SAI_XCR2_FTH_SET(STM_SAI_FIFO_TH_HALF));
7687 +
7688 + /* DS bits in CR1 not set for SPDIF (size forced to 24 bits).*/
7689 + if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) {
7690 +@@ -795,7 +845,7 @@ static int stm32_sai_set_config(struct snd_soc_dai *cpu_dai,
7691 + if ((sai->slots == 2) && (params_channels(params) == 1))
7692 + cr1 |= SAI_XCR1_MONO;
7693 +
7694 +- ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1);
7695 ++ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1);
7696 + if (ret < 0) {
7697 + dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
7698 + return ret;
7699 +@@ -809,7 +859,7 @@ static int stm32_sai_set_slots(struct snd_soc_dai *cpu_dai)
7700 + struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
7701 + int slotr, slot_sz;
7702 +
7703 +- regmap_read(sai->regmap, STM_SAI_SLOTR_REGX, &slotr);
7704 ++ stm32_sai_sub_reg_rd(sai, STM_SAI_SLOTR_REGX, &slotr);
7705 +
7706 + /*
7707 + * If SLOTSZ is set to auto in SLOTR, align slot width on data size
7708 +@@ -831,16 +881,16 @@ static int stm32_sai_set_slots(struct snd_soc_dai *cpu_dai)
7709 + sai->slots = 2;
7710 +
7711 + /* The number of slots in the audio frame is equal to NBSLOT[3:0] + 1*/
7712 +- regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX,
7713 +- SAI_XSLOTR_NBSLOT_MASK,
7714 +- SAI_XSLOTR_NBSLOT_SET((sai->slots - 1)));
7715 ++ stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX,
7716 ++ SAI_XSLOTR_NBSLOT_MASK,
7717 ++ SAI_XSLOTR_NBSLOT_SET((sai->slots - 1)));
7718 +
7719 + /* Set default slots mask if not already set from DT */
7720 + if (!(slotr & SAI_XSLOTR_SLOTEN_MASK)) {
7721 + sai->slot_mask = (1 << sai->slots) - 1;
7722 +- regmap_update_bits(sai->regmap,
7723 +- STM_SAI_SLOTR_REGX, SAI_XSLOTR_SLOTEN_MASK,
7724 +- SAI_XSLOTR_SLOTEN_SET(sai->slot_mask));
7725 ++ stm32_sai_sub_reg_up(sai,
7726 ++ STM_SAI_SLOTR_REGX, SAI_XSLOTR_SLOTEN_MASK,
7727 ++ SAI_XSLOTR_SLOTEN_SET(sai->slot_mask));
7728 + }
7729 +
7730 + dev_dbg(cpu_dai->dev, "Slots %d, slot width %d\n",
7731 +@@ -870,14 +920,14 @@ static void stm32_sai_set_frame(struct snd_soc_dai *cpu_dai)
7732 + dev_dbg(cpu_dai->dev, "Frame length %d, frame active %d\n",
7733 + sai->fs_length, fs_active);
7734 +
7735 +- regmap_update_bits(sai->regmap, STM_SAI_FRCR_REGX, frcr_mask, frcr);
7736 ++ stm32_sai_sub_reg_up(sai, STM_SAI_FRCR_REGX, frcr_mask, frcr);
7737 +
7738 + if ((sai->fmt & SND_SOC_DAIFMT_FORMAT_MASK) == SND_SOC_DAIFMT_LSB) {
7739 + offset = sai->slot_width - sai->data_size;
7740 +
7741 +- regmap_update_bits(sai->regmap, STM_SAI_SLOTR_REGX,
7742 +- SAI_XSLOTR_FBOFF_MASK,
7743 +- SAI_XSLOTR_FBOFF_SET(offset));
7744 ++ stm32_sai_sub_reg_up(sai, STM_SAI_SLOTR_REGX,
7745 ++ SAI_XSLOTR_FBOFF_MASK,
7746 ++ SAI_XSLOTR_FBOFF_SET(offset));
7747 + }
7748 + }
7749 +
7750 +@@ -994,9 +1044,9 @@ static int stm32_sai_configure_clock(struct snd_soc_dai *cpu_dai,
7751 + return -EINVAL;
7752 + }
7753 +
7754 +- regmap_update_bits(sai->regmap,
7755 +- STM_SAI_CR1_REGX,
7756 +- SAI_XCR1_OSR, cr1);
7757 ++ stm32_sai_sub_reg_up(sai,
7758 ++ STM_SAI_CR1_REGX,
7759 ++ SAI_XCR1_OSR, cr1);
7760 +
7761 + div = stm32_sai_get_clk_div(sai, sai_clk_rate,
7762 + sai->mclk_rate);
7763 +@@ -1058,12 +1108,12 @@ static int stm32_sai_trigger(struct snd_pcm_substream *substream, int cmd,
7764 + case SNDRV_PCM_TRIGGER_PAUSE_RELEASE:
7765 + dev_dbg(cpu_dai->dev, "Enable DMA and SAI\n");
7766 +
7767 +- regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
7768 +- SAI_XCR1_DMAEN, SAI_XCR1_DMAEN);
7769 ++ stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
7770 ++ SAI_XCR1_DMAEN, SAI_XCR1_DMAEN);
7771 +
7772 + /* Enable SAI */
7773 +- ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
7774 +- SAI_XCR1_SAIEN, SAI_XCR1_SAIEN);
7775 ++ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
7776 ++ SAI_XCR1_SAIEN, SAI_XCR1_SAIEN);
7777 + if (ret < 0)
7778 + dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
7779 + break;
7780 +@@ -1072,16 +1122,16 @@ static int stm32_sai_trigger(struct snd_pcm_substream *substream, int cmd,
7781 + case SNDRV_PCM_TRIGGER_STOP:
7782 + dev_dbg(cpu_dai->dev, "Disable DMA and SAI\n");
7783 +
7784 +- regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX,
7785 +- SAI_XIMR_MASK, 0);
7786 ++ stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX,
7787 ++ SAI_XIMR_MASK, 0);
7788 +
7789 +- regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
7790 +- SAI_XCR1_SAIEN,
7791 +- (unsigned int)~SAI_XCR1_SAIEN);
7792 ++ stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
7793 ++ SAI_XCR1_SAIEN,
7794 ++ (unsigned int)~SAI_XCR1_SAIEN);
7795 +
7796 +- ret = regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX,
7797 +- SAI_XCR1_DMAEN,
7798 +- (unsigned int)~SAI_XCR1_DMAEN);
7799 ++ ret = stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX,
7800 ++ SAI_XCR1_DMAEN,
7801 ++ (unsigned int)~SAI_XCR1_DMAEN);
7802 + if (ret < 0)
7803 + dev_err(cpu_dai->dev, "Failed to update CR1 register\n");
7804 +
7805 +@@ -1101,7 +1151,7 @@ static void stm32_sai_shutdown(struct snd_pcm_substream *substream,
7806 + struct stm32_sai_sub_data *sai = snd_soc_dai_get_drvdata(cpu_dai);
7807 + unsigned long flags;
7808 +
7809 +- regmap_update_bits(sai->regmap, STM_SAI_IMR_REGX, SAI_XIMR_MASK, 0);
7810 ++ stm32_sai_sub_reg_up(sai, STM_SAI_IMR_REGX, SAI_XIMR_MASK, 0);
7811 +
7812 + clk_disable_unprepare(sai->sai_ck);
7813 +
7814 +@@ -1169,7 +1219,7 @@ static int stm32_sai_dai_probe(struct snd_soc_dai *cpu_dai)
7815 + cr1_mask |= SAI_XCR1_SYNCEN_MASK;
7816 + cr1 |= SAI_XCR1_SYNCEN_SET(sai->sync);
7817 +
7818 +- return regmap_update_bits(sai->regmap, STM_SAI_CR1_REGX, cr1_mask, cr1);
7819 ++ return stm32_sai_sub_reg_up(sai, STM_SAI_CR1_REGX, cr1_mask, cr1);
7820 + }
7821 +
7822 + static const struct snd_soc_dai_ops stm32_sai_pcm_dai_ops = {
7823 +@@ -1322,8 +1372,13 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev,
7824 + if (STM_SAI_HAS_PDM(sai) && STM_SAI_IS_SUB_A(sai))
7825 + sai->regmap_config = &stm32_sai_sub_regmap_config_h7;
7826 +
7827 +- sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev, "sai_ck",
7828 +- base, sai->regmap_config);
7829 ++ /*
7830 ++ * Do not manage peripheral clock through regmap framework as this
7831 ++ * can lead to circular locking issue with sai master clock provider.
7832 ++ * Manage peripheral clock directly in driver instead.
7833 ++ */
7834 ++ sai->regmap = devm_regmap_init_mmio(&pdev->dev, base,
7835 ++ sai->regmap_config);
7836 + if (IS_ERR(sai->regmap)) {
7837 + dev_err(&pdev->dev, "Failed to initialize MMIO\n");
7838 + return PTR_ERR(sai->regmap);
7839 +@@ -1420,6 +1475,10 @@ static int stm32_sai_sub_parse_of(struct platform_device *pdev,
7840 + return PTR_ERR(sai->sai_ck);
7841 + }
7842 +
7843 ++ ret = clk_prepare(sai->pdata->pclk);
7844 ++ if (ret < 0)
7845 ++ return ret;
7846 ++
7847 + if (STM_SAI_IS_F4(sai->pdata))
7848 + return 0;
7849 +
7850 +@@ -1501,22 +1560,48 @@ static int stm32_sai_sub_probe(struct platform_device *pdev)
7851 + return 0;
7852 + }
7853 +
7854 ++static int stm32_sai_sub_remove(struct platform_device *pdev)
7855 ++{
7856 ++ struct stm32_sai_sub_data *sai = dev_get_drvdata(&pdev->dev);
7857 ++
7858 ++ clk_unprepare(sai->pdata->pclk);
7859 ++
7860 ++ return 0;
7861 ++}
7862 ++
7863 + #ifdef CONFIG_PM_SLEEP
7864 + static int stm32_sai_sub_suspend(struct device *dev)
7865 + {
7866 + struct stm32_sai_sub_data *sai = dev_get_drvdata(dev);
7867 ++ int ret;
7868 ++
7869 ++ ret = clk_enable(sai->pdata->pclk);
7870 ++ if (ret < 0)
7871 ++ return ret;
7872 +
7873 + regcache_cache_only(sai->regmap, true);
7874 + regcache_mark_dirty(sai->regmap);
7875 ++
7876 ++ clk_disable(sai->pdata->pclk);
7877 ++
7878 + return 0;
7879 + }
7880 +
7881 + static int stm32_sai_sub_resume(struct device *dev)
7882 + {
7883 + struct stm32_sai_sub_data *sai = dev_get_drvdata(dev);
7884 ++ int ret;
7885 ++
7886 ++ ret = clk_enable(sai->pdata->pclk);
7887 ++ if (ret < 0)
7888 ++ return ret;
7889 +
7890 + regcache_cache_only(sai->regmap, false);
7891 +- return regcache_sync(sai->regmap);
7892 ++ ret = regcache_sync(sai->regmap);
7893 ++
7894 ++ clk_disable(sai->pdata->pclk);
7895 ++
7896 ++ return ret;
7897 + }
7898 + #endif /* CONFIG_PM_SLEEP */
7899 +
7900 +@@ -1531,6 +1616,7 @@ static struct platform_driver stm32_sai_sub_driver = {
7901 + .pm = &stm32_sai_sub_pm_ops,
7902 + },
7903 + .probe = stm32_sai_sub_probe,
7904 ++ .remove = stm32_sai_sub_remove,
7905 + };
7906 +
7907 + module_platform_driver(stm32_sai_sub_driver);
7908 +diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c
7909 +index a04c727dcd19..fa24bd491cf6 100644
7910 +--- a/sound/usb/pcm.c
7911 ++++ b/sound/usb/pcm.c
7912 +@@ -370,7 +370,7 @@ static int set_sync_ep_implicit_fb_quirk(struct snd_usb_substream *subs,
7913 + add_sync_ep_from_ifnum:
7914 + iface = usb_ifnum_to_if(dev, ifnum);
7915 +
7916 +- if (!iface || iface->num_altsetting == 0)
7917 ++ if (!iface || iface->num_altsetting < 2)
7918 + return -EINVAL;
7919 +
7920 + alts = &iface->altsetting[1];
7921 +diff --git a/tools/bpf/bpftool/btf_dumper.c b/tools/bpf/bpftool/btf_dumper.c
7922 +index d66131f69689..397e5716ab6d 100644
7923 +--- a/tools/bpf/bpftool/btf_dumper.c
7924 ++++ b/tools/bpf/bpftool/btf_dumper.c
7925 +@@ -26,7 +26,7 @@ static void btf_dumper_ptr(const void *data, json_writer_t *jw,
7926 + bool is_plain_text)
7927 + {
7928 + if (is_plain_text)
7929 +- jsonw_printf(jw, "%p", data);
7930 ++ jsonw_printf(jw, "%p", *(void **)data);
7931 + else
7932 + jsonw_printf(jw, "%lu", *(unsigned long *)data);
7933 + }
7934 +diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
7935 +index 7accaf8ef689..ea3f0745d7ad 100644
7936 +--- a/tools/perf/builtin-report.c
7937 ++++ b/tools/perf/builtin-report.c
7938 +@@ -1031,6 +1031,7 @@ int cmd_report(int argc, const char **argv)
7939 + struct stat st;
7940 + bool has_br_stack = false;
7941 + int branch_mode = -1;
7942 ++ int last_key = 0;
7943 + bool branch_call_mode = false;
7944 + #define CALLCHAIN_DEFAULT_OPT "graph,0.5,caller,function,percent"
7945 + static const char report_callchain_help[] = "Display call graph (stack chain/backtrace):\n\n"
7946 +@@ -1396,7 +1397,8 @@ repeat:
7947 + sort_order = sort_tmp;
7948 + }
7949 +
7950 +- if (setup_sorting(session->evlist) < 0) {
7951 ++ if ((last_key != K_SWITCH_INPUT_DATA) &&
7952 ++ (setup_sorting(session->evlist) < 0)) {
7953 + if (sort_order)
7954 + parse_options_usage(report_usage, options, "s", 1);
7955 + if (field_order)
7956 +@@ -1475,6 +1477,7 @@ repeat:
7957 + ret = __cmd_report(&report);
7958 + if (ret == K_SWITCH_INPUT_DATA) {
7959 + perf_session__delete(session);
7960 ++ last_key = K_SWITCH_INPUT_DATA;
7961 + goto repeat;
7962 + } else
7963 + ret = 0;
7964 +diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
7965 +index 3983d6ccd14d..da016f398aa8 100644
7966 +--- a/tools/perf/builtin-script.c
7967 ++++ b/tools/perf/builtin-script.c
7968 +@@ -3605,11 +3605,6 @@ int cmd_script(int argc, const char **argv)
7969 + }
7970 + }
7971 +
7972 +- if (script.time_str && reltime) {
7973 +- fprintf(stderr, "Don't combine --reltime with --time\n");
7974 +- return -1;
7975 +- }
7976 +-
7977 + if (itrace_synth_opts.callchain &&
7978 + itrace_synth_opts.callchain_sz > scripting_max_stack)
7979 + scripting_max_stack = itrace_synth_opts.callchain_sz;
7980 +@@ -3869,10 +3864,11 @@ int cmd_script(int argc, const char **argv)
7981 + goto out_delete;
7982 +
7983 + if (script.time_str) {
7984 +- err = perf_time__parse_for_ranges(script.time_str, session,
7985 ++ err = perf_time__parse_for_ranges_reltime(script.time_str, session,
7986 + &script.ptime_range,
7987 + &script.range_size,
7988 +- &script.range_num);
7989 ++ &script.range_num,
7990 ++ reltime);
7991 + if (err < 0)
7992 + goto out_delete;
7993 +
7994 +diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
7995 +index 6a186b668303..479273130794 100644
7996 +--- a/tools/perf/util/hist.h
7997 ++++ b/tools/perf/util/hist.h
7998 +@@ -339,10 +339,10 @@ static inline void perf_hpp__prepend_sort_field(struct perf_hpp_fmt *format)
7999 + list_for_each_entry_safe(format, tmp, &(_list)->sorts, sort_list)
8000 +
8001 + #define hists__for_each_format(hists, format) \
8002 +- perf_hpp_list__for_each_format((hists)->hpp_list, fmt)
8003 ++ perf_hpp_list__for_each_format((hists)->hpp_list, format)
8004 +
8005 + #define hists__for_each_sort_list(hists, format) \
8006 +- perf_hpp_list__for_each_sort_list((hists)->hpp_list, fmt)
8007 ++ perf_hpp_list__for_each_sort_list((hists)->hpp_list, format)
8008 +
8009 + extern struct perf_hpp_fmt perf_hpp__format[];
8010 +
8011 +diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
8012 +index 08cccd86447c..9ecea45da4ca 100644
8013 +--- a/tools/perf/util/probe-finder.c
8014 ++++ b/tools/perf/util/probe-finder.c
8015 +@@ -604,38 +604,26 @@ static int convert_to_trace_point(Dwarf_Die *sp_die, Dwfl_Module *mod,
8016 + const char *function,
8017 + struct probe_trace_point *tp)
8018 + {
8019 +- Dwarf_Addr eaddr, highaddr;
8020 ++ Dwarf_Addr eaddr;
8021 + GElf_Sym sym;
8022 + const char *symbol;
8023 +
8024 + /* Verify the address is correct */
8025 +- if (dwarf_entrypc(sp_die, &eaddr) != 0) {
8026 +- pr_warning("Failed to get entry address of %s\n",
8027 +- dwarf_diename(sp_die));
8028 +- return -ENOENT;
8029 +- }
8030 +- if (dwarf_highpc(sp_die, &highaddr) != 0) {
8031 +- pr_warning("Failed to get end address of %s\n",
8032 +- dwarf_diename(sp_die));
8033 +- return -ENOENT;
8034 +- }
8035 +- if (paddr > highaddr) {
8036 +- pr_warning("Offset specified is greater than size of %s\n",
8037 ++ if (!dwarf_haspc(sp_die, paddr)) {
8038 ++ pr_warning("Specified offset is out of %s\n",
8039 + dwarf_diename(sp_die));
8040 + return -EINVAL;
8041 + }
8042 +
8043 +- symbol = dwarf_diename(sp_die);
8044 ++ /* Try to get actual symbol name from symtab */
8045 ++ symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL);
8046 + if (!symbol) {
8047 +- /* Try to get the symbol name from symtab */
8048 +- symbol = dwfl_module_addrsym(mod, paddr, &sym, NULL);
8049 +- if (!symbol) {
8050 +- pr_warning("Failed to find symbol at 0x%lx\n",
8051 +- (unsigned long)paddr);
8052 +- return -ENOENT;
8053 +- }
8054 +- eaddr = sym.st_value;
8055 ++ pr_warning("Failed to find symbol at 0x%lx\n",
8056 ++ (unsigned long)paddr);
8057 ++ return -ENOENT;
8058 + }
8059 ++ eaddr = sym.st_value;
8060 ++
8061 + tp->offset = (unsigned long)(paddr - eaddr);
8062 + tp->address = (unsigned long)paddr;
8063 + tp->symbol = strdup(symbol);
8064 +diff --git a/tools/perf/util/time-utils.c b/tools/perf/util/time-utils.c
8065 +index 9796a2e43f67..302443921681 100644
8066 +--- a/tools/perf/util/time-utils.c
8067 ++++ b/tools/perf/util/time-utils.c
8068 +@@ -458,10 +458,11 @@ bool perf_time__ranges_skip_sample(struct perf_time_interval *ptime_buf,
8069 + return true;
8070 + }
8071 +
8072 +-int perf_time__parse_for_ranges(const char *time_str,
8073 ++int perf_time__parse_for_ranges_reltime(const char *time_str,
8074 + struct perf_session *session,
8075 + struct perf_time_interval **ranges,
8076 +- int *range_size, int *range_num)
8077 ++ int *range_size, int *range_num,
8078 ++ bool reltime)
8079 + {
8080 + bool has_percent = strchr(time_str, '%');
8081 + struct perf_time_interval *ptime_range;
8082 +@@ -471,7 +472,7 @@ int perf_time__parse_for_ranges(const char *time_str,
8083 + if (!ptime_range)
8084 + return -ENOMEM;
8085 +
8086 +- if (has_percent) {
8087 ++ if (has_percent || reltime) {
8088 + if (session->evlist->first_sample_time == 0 &&
8089 + session->evlist->last_sample_time == 0) {
8090 + pr_err("HINT: no first/last sample time found in perf data.\n"
8091 +@@ -479,7 +480,9 @@ int perf_time__parse_for_ranges(const char *time_str,
8092 + "(if '--buildid-all' is enabled, please set '--timestamp-boundary').\n");
8093 + goto error;
8094 + }
8095 ++ }
8096 +
8097 ++ if (has_percent) {
8098 + num = perf_time__percent_parse_str(
8099 + ptime_range, size,
8100 + time_str,
8101 +@@ -492,6 +495,15 @@ int perf_time__parse_for_ranges(const char *time_str,
8102 + if (num < 0)
8103 + goto error_invalid;
8104 +
8105 ++ if (reltime) {
8106 ++ int i;
8107 ++
8108 ++ for (i = 0; i < num; i++) {
8109 ++ ptime_range[i].start += session->evlist->first_sample_time;
8110 ++ ptime_range[i].end += session->evlist->first_sample_time;
8111 ++ }
8112 ++ }
8113 ++
8114 + *range_size = size;
8115 + *range_num = num;
8116 + *ranges = ptime_range;
8117 +@@ -504,6 +516,15 @@ error:
8118 + return ret;
8119 + }
8120 +
8121 ++int perf_time__parse_for_ranges(const char *time_str,
8122 ++ struct perf_session *session,
8123 ++ struct perf_time_interval **ranges,
8124 ++ int *range_size, int *range_num)
8125 ++{
8126 ++ return perf_time__parse_for_ranges_reltime(time_str, session, ranges,
8127 ++ range_size, range_num, false);
8128 ++}
8129 ++
8130 + int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz)
8131 + {
8132 + u64 sec = timestamp / NSEC_PER_SEC;
8133 +diff --git a/tools/perf/util/time-utils.h b/tools/perf/util/time-utils.h
8134 +index 4f42988eb2f7..1142b0bddd5e 100644
8135 +--- a/tools/perf/util/time-utils.h
8136 ++++ b/tools/perf/util/time-utils.h
8137 +@@ -26,6 +26,11 @@ bool perf_time__ranges_skip_sample(struct perf_time_interval *ptime_buf,
8138 +
8139 + struct perf_session;
8140 +
8141 ++int perf_time__parse_for_ranges_reltime(const char *str, struct perf_session *session,
8142 ++ struct perf_time_interval **ranges,
8143 ++ int *range_size, int *range_num,
8144 ++ bool reltime);
8145 ++
8146 + int perf_time__parse_for_ranges(const char *str, struct perf_session *session,
8147 + struct perf_time_interval **ranges,
8148 + int *range_size, int *range_num);
8149 +diff --git a/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh b/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh
8150 +index 47315fe48d5a..24dd8ed48580 100755
8151 +--- a/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh
8152 ++++ b/tools/testing/selftests/drivers/net/mlxsw/qos_mc_aware.sh
8153 +@@ -232,7 +232,7 @@ test_mc_aware()
8154 + stop_traffic
8155 + local ucth1=${uc_rate[1]}
8156 +
8157 +- start_traffic $h1 own bc bc
8158 ++ start_traffic $h1 192.0.2.65 bc bc
8159 +
8160 + local d0=$(date +%s)
8161 + local t0=$(ethtool_stats_get $h3 rx_octets_prio_0)
8162 +@@ -254,7 +254,11 @@ test_mc_aware()
8163 + ret = 100 * ($ucth1 - $ucth2) / $ucth1
8164 + if (ret > 0) { ret } else { 0 }
8165 + ")
8166 +- check_err $(bc <<< "$deg > 25")
8167 ++
8168 ++ # Minimum shaper of 200Mbps on MC TCs should cause about 20% of
8169 ++ # degradation on 1Gbps link.
8170 ++ check_err $(bc <<< "$deg < 15") "Minimum shaper not in effect"
8171 ++ check_err $(bc <<< "$deg > 25") "MC traffic degrades UC performance too much"
8172 +
8173 + local interval=$((d1 - d0))
8174 + local mc_ir=$(rate $u0 $u1 $interval)