Gentoo Archives: gentoo-commits

From: Mike Pagano <mpagano@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/linux-patches:5.10 commit in: /
Date: Mon, 09 May 2022 10:56:08
Message-Id: 1652093752.133b96e06019d0827355c84ae0f0293ea6799de4.mpagano@gentoo
1 commit: 133b96e06019d0827355c84ae0f0293ea6799de4
2 Author: Mike Pagano <mpagano <AT> gentoo <DOT> org>
3 AuthorDate: Mon May 9 10:55:52 2022 +0000
4 Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org>
5 CommitDate: Mon May 9 10:55:52 2022 +0000
6 URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=133b96e0
7
8 Linux patch 5.10.114
9
10 Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org>
11
12 0000_README | 4 +
13 1113_linux-5.10.114.patch | 4423 +++++++++++++++++++++++++++++++++++++++++++++
14 2 files changed, 4427 insertions(+)
15
16 diff --git a/0000_README b/0000_README
17 index 5c68defb..439eef26 100644
18 --- a/0000_README
19 +++ b/0000_README
20 @@ -495,6 +495,10 @@ Patch: 1112_linux-5.10.113.patch
21 From: http://www.kernel.org
22 Desc: Linux 5.10.113
23
24 +Patch: 1113_linux-5.10.114.patch
25 +From: http://www.kernel.org
26 +Desc: Linux 5.10.114
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/1113_linux-5.10.114.patch b/1113_linux-5.10.114.patch
33 new file mode 100644
34 index 00000000..5551a035
35 --- /dev/null
36 +++ b/1113_linux-5.10.114.patch
37 @@ -0,0 +1,4423 @@
38 +diff --git a/Makefile b/Makefile
39 +index 99bbaa9f54f4c..b76e6d0aa85de 100644
40 +--- a/Makefile
41 ++++ b/Makefile
42 +@@ -1,7 +1,7 @@
43 + # SPDX-License-Identifier: GPL-2.0
44 + VERSION = 5
45 + PATCHLEVEL = 10
46 +-SUBLEVEL = 113
47 ++SUBLEVEL = 114
48 + EXTRAVERSION =
49 + NAME = Dare mighty things
50 +
51 +diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts
52 +index 0d2fac98ce7d2..c8b80f156ec98 100644
53 +--- a/arch/arm/boot/dts/am3517-evm.dts
54 ++++ b/arch/arm/boot/dts/am3517-evm.dts
55 +@@ -161,6 +161,8 @@
56 +
57 + /* HS USB Host PHY on PORT 1 */
58 + hsusb1_phy: hsusb1_phy {
59 ++ pinctrl-names = "default";
60 ++ pinctrl-0 = <&hsusb1_rst_pins>;
61 + compatible = "usb-nop-xceiv";
62 + reset-gpios = <&gpio2 25 GPIO_ACTIVE_LOW>; /* gpio_57 */
63 + #phy-cells = <0>;
64 +@@ -168,7 +170,9 @@
65 + };
66 +
67 + &davinci_emac {
68 +- status = "okay";
69 ++ pinctrl-names = "default";
70 ++ pinctrl-0 = <&ethernet_pins>;
71 ++ status = "okay";
72 + };
73 +
74 + &davinci_mdio {
75 +@@ -193,6 +197,8 @@
76 + };
77 +
78 + &i2c2 {
79 ++ pinctrl-names = "default";
80 ++ pinctrl-0 = <&i2c2_pins>;
81 + clock-frequency = <400000>;
82 + /* User DIP swithes [1:8] / User LEDS [1:2] */
83 + tca6416: gpio@21 {
84 +@@ -205,6 +211,8 @@
85 + };
86 +
87 + &i2c3 {
88 ++ pinctrl-names = "default";
89 ++ pinctrl-0 = <&i2c3_pins>;
90 + clock-frequency = <400000>;
91 + };
92 +
93 +@@ -223,6 +231,8 @@
94 + };
95 +
96 + &usbhshost {
97 ++ pinctrl-names = "default";
98 ++ pinctrl-0 = <&hsusb1_pins>;
99 + port1-mode = "ehci-phy";
100 + };
101 +
102 +@@ -231,8 +241,35 @@
103 + };
104 +
105 + &omap3_pmx_core {
106 +- pinctrl-names = "default";
107 +- pinctrl-0 = <&hsusb1_rst_pins>;
108 ++
109 ++ ethernet_pins: pinmux_ethernet_pins {
110 ++ pinctrl-single,pins = <
111 ++ OMAP3_CORE1_IOPAD(0x21fe, PIN_INPUT | MUX_MODE0) /* rmii_mdio_data */
112 ++ OMAP3_CORE1_IOPAD(0x2200, MUX_MODE0) /* rmii_mdio_clk */
113 ++ OMAP3_CORE1_IOPAD(0x2202, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_rxd0 */
114 ++ OMAP3_CORE1_IOPAD(0x2204, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_rxd1 */
115 ++ OMAP3_CORE1_IOPAD(0x2206, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_crs_dv */
116 ++ OMAP3_CORE1_IOPAD(0x2208, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* rmii_rxer */
117 ++ OMAP3_CORE1_IOPAD(0x220a, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* rmii_txd0 */
118 ++ OMAP3_CORE1_IOPAD(0x220c, PIN_OUTPUT_PULLDOWN | MUX_MODE0) /* rmii_txd1 */
119 ++ OMAP3_CORE1_IOPAD(0x220e, PIN_OUTPUT_PULLDOWN |MUX_MODE0) /* rmii_txen */
120 ++ OMAP3_CORE1_IOPAD(0x2210, PIN_INPUT_PULLDOWN | MUX_MODE0) /* rmii_50mhz_clk */
121 ++ >;
122 ++ };
123 ++
124 ++ i2c2_pins: pinmux_i2c2_pins {
125 ++ pinctrl-single,pins = <
126 ++ OMAP3_CORE1_IOPAD(0x21be, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c2_scl */
127 ++ OMAP3_CORE1_IOPAD(0x21c0, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c2_sda */
128 ++ >;
129 ++ };
130 ++
131 ++ i2c3_pins: pinmux_i2c3_pins {
132 ++ pinctrl-single,pins = <
133 ++ OMAP3_CORE1_IOPAD(0x21c2, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_scl */
134 ++ OMAP3_CORE1_IOPAD(0x21c4, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c3_sda */
135 ++ >;
136 ++ };
137 +
138 + leds_pins: pinmux_leds_pins {
139 + pinctrl-single,pins = <
140 +@@ -300,8 +337,6 @@
141 + };
142 +
143 + &omap3_pmx_core2 {
144 +- pinctrl-names = "default";
145 +- pinctrl-0 = <&hsusb1_pins>;
146 +
147 + hsusb1_pins: pinmux_hsusb1_pins {
148 + pinctrl-single,pins = <
149 +diff --git a/arch/arm/boot/dts/am3517-som.dtsi b/arch/arm/boot/dts/am3517-som.dtsi
150 +index 8b669e2eafec4..f7b680f6c48ad 100644
151 +--- a/arch/arm/boot/dts/am3517-som.dtsi
152 ++++ b/arch/arm/boot/dts/am3517-som.dtsi
153 +@@ -69,6 +69,8 @@
154 + };
155 +
156 + &i2c1 {
157 ++ pinctrl-names = "default";
158 ++ pinctrl-0 = <&i2c1_pins>;
159 + clock-frequency = <400000>;
160 +
161 + s35390a: s35390a@30 {
162 +@@ -179,6 +181,13 @@
163 +
164 + &omap3_pmx_core {
165 +
166 ++ i2c1_pins: pinmux_i2c1_pins {
167 ++ pinctrl-single,pins = <
168 ++ OMAP3_CORE1_IOPAD(0x21ba, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_scl */
169 ++ OMAP3_CORE1_IOPAD(0x21bc, PIN_INPUT_PULLUP | MUX_MODE0) /* i2c1_sda */
170 ++ >;
171 ++ };
172 ++
173 + wl12xx_buffer_pins: pinmux_wl12xx_buffer_pins {
174 + pinctrl-single,pins = <
175 + OMAP3_CORE1_IOPAD(0x2156, PIN_OUTPUT | MUX_MODE4) /* mmc1_dat7.gpio_129 */
176 +diff --git a/arch/arm/boot/dts/at91-sama5d4_xplained.dts b/arch/arm/boot/dts/at91-sama5d4_xplained.dts
177 +index e42dae06b5826..73cb157c4ef54 100644
178 +--- a/arch/arm/boot/dts/at91-sama5d4_xplained.dts
179 ++++ b/arch/arm/boot/dts/at91-sama5d4_xplained.dts
180 +@@ -91,7 +91,7 @@
181 +
182 + spi1: spi@fc018000 {
183 + pinctrl-names = "default";
184 +- pinctrl-0 = <&pinctrl_spi0_cs>;
185 ++ pinctrl-0 = <&pinctrl_spi1_cs>;
186 + cs-gpios = <&pioB 21 0>;
187 + status = "okay";
188 + };
189 +@@ -149,7 +149,7 @@
190 + atmel,pins =
191 + <AT91_PIOE 1 AT91_PERIPH_GPIO AT91_PINCTRL_PULL_UP_DEGLITCH>;
192 + };
193 +- pinctrl_spi0_cs: spi0_cs_default {
194 ++ pinctrl_spi1_cs: spi1_cs_default {
195 + atmel,pins =
196 + <AT91_PIOB 21 AT91_PERIPH_GPIO AT91_PINCTRL_NONE>;
197 + };
198 +diff --git a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
199 +index 87bb39060e8be..ca03685f0f086 100644
200 +--- a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
201 ++++ b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi
202 +@@ -219,6 +219,12 @@
203 + wm8731: wm8731@1b {
204 + compatible = "wm8731";
205 + reg = <0x1b>;
206 ++
207 ++ /* PCK0 at 12MHz */
208 ++ clocks = <&pmc PMC_TYPE_SYSTEM 8>;
209 ++ clock-names = "mclk";
210 ++ assigned-clocks = <&pmc PMC_TYPE_SYSTEM 8>;
211 ++ assigned-clock-rates = <12000000>;
212 + };
213 + };
214 +
215 +diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
216 +index 30fa349f9d054..a696873dc1abe 100644
217 +--- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi
218 ++++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi
219 +@@ -286,6 +286,8 @@
220 + codec: sgtl5000@a {
221 + compatible = "fsl,sgtl5000";
222 + reg = <0x0a>;
223 ++ pinctrl-names = "default";
224 ++ pinctrl-0 = <&pinctrl_sgtl5000>;
225 + clocks = <&clks IMX6QDL_CLK_CKO>;
226 + VDDA-supply = <&reg_module_3v3_audio>;
227 + VDDIO-supply = <&reg_module_3v3>;
228 +@@ -516,8 +518,6 @@
229 + MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x130b0
230 + MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0
231 + MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0
232 +- /* SGTL5000 sys_mclk */
233 +- MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
234 + >;
235 + };
236 +
237 +@@ -810,6 +810,12 @@
238 + >;
239 + };
240 +
241 ++ pinctrl_sgtl5000: sgtl5000grp {
242 ++ fsl,pins = <
243 ++ MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0
244 ++ >;
245 ++ };
246 ++
247 + pinctrl_spdif: spdifgrp {
248 + fsl,pins = <
249 + MX6QDL_PAD_GPIO_16__SPDIF_IN 0x1b0b0
250 +diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi
251 +index 4436556624d67..548cfcc7a01da 100644
252 +--- a/arch/arm/boot/dts/imx6ull-colibri.dtsi
253 ++++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi
254 +@@ -37,7 +37,7 @@
255 +
256 + reg_sd1_vmmc: regulator-sd1-vmmc {
257 + compatible = "regulator-gpio";
258 +- gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>;
259 ++ gpios = <&gpio5 9 GPIO_ACTIVE_HIGH>;
260 + pinctrl-names = "default";
261 + pinctrl-0 = <&pinctrl_snvs_reg_sd>;
262 + regulator-always-on;
263 +diff --git a/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts b/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts
264 +index 2a0a98fe67f06..3240c67e0c392 100644
265 +--- a/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts
266 ++++ b/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts
267 +@@ -11,3 +11,18 @@
268 + model = "LogicPD Zoom OMAP35xx SOM-LV Development Kit";
269 + compatible = "logicpd,dm3730-som-lv-devkit", "ti,omap3430", "ti,omap3";
270 + };
271 ++
272 ++&omap3_pmx_core2 {
273 ++ pinctrl-names = "default";
274 ++ pinctrl-0 = <&hsusb2_2_pins>;
275 ++ hsusb2_2_pins: pinmux_hsusb2_2_pins {
276 ++ pinctrl-single,pins = <
277 ++ OMAP3430_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */
278 ++ OMAP3430_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */
279 ++ OMAP3430_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */
280 ++ OMAP3430_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */
281 ++ OMAP3430_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */
282 ++ OMAP3430_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */
283 ++ >;
284 ++ };
285 ++};
286 +diff --git a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts
287 +index a604d92221a4f..c757f0d7781c1 100644
288 +--- a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts
289 ++++ b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts
290 +@@ -11,3 +11,18 @@
291 + model = "LogicPD Zoom DM3730 SOM-LV Development Kit";
292 + compatible = "logicpd,dm3730-som-lv-devkit", "ti,omap3630", "ti,omap3";
293 + };
294 ++
295 ++&omap3_pmx_core2 {
296 ++ pinctrl-names = "default";
297 ++ pinctrl-0 = <&hsusb2_2_pins>;
298 ++ hsusb2_2_pins: pinmux_hsusb2_2_pins {
299 ++ pinctrl-single,pins = <
300 ++ OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */
301 ++ OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */
302 ++ OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */
303 ++ OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */
304 ++ OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */
305 ++ OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */
306 ++ >;
307 ++ };
308 ++};
309 +diff --git a/arch/arm/boot/dts/logicpd-som-lv.dtsi b/arch/arm/boot/dts/logicpd-som-lv.dtsi
310 +index b56524cc7fe27..55b619c99e24d 100644
311 +--- a/arch/arm/boot/dts/logicpd-som-lv.dtsi
312 ++++ b/arch/arm/boot/dts/logicpd-som-lv.dtsi
313 +@@ -265,21 +265,6 @@
314 + };
315 + };
316 +
317 +-&omap3_pmx_core2 {
318 +- pinctrl-names = "default";
319 +- pinctrl-0 = <&hsusb2_2_pins>;
320 +- hsusb2_2_pins: pinmux_hsusb2_2_pins {
321 +- pinctrl-single,pins = <
322 +- OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */
323 +- OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */
324 +- OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */
325 +- OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */
326 +- OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */
327 +- OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */
328 +- >;
329 +- };
330 +-};
331 +-
332 + &uart2 {
333 + interrupts-extended = <&intc 73 &omap3_pmx_core OMAP3_UART2_RX>;
334 + pinctrl-names = "default";
335 +diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi
336 +index 80c9e5e34136a..cc8a378dd076e 100644
337 +--- a/arch/arm/boot/dts/omap3-gta04.dtsi
338 ++++ b/arch/arm/boot/dts/omap3-gta04.dtsi
339 +@@ -31,6 +31,8 @@
340 + aliases {
341 + display0 = &lcd;
342 + display1 = &tv0;
343 ++ /delete-property/ mmc2;
344 ++ /delete-property/ mmc3;
345 + };
346 +
347 + ldo_3v3: fixedregulator {
348 +diff --git a/arch/arm/mach-exynos/Kconfig b/arch/arm/mach-exynos/Kconfig
349 +index d2d249706ebb3..56314b1c74089 100644
350 +--- a/arch/arm/mach-exynos/Kconfig
351 ++++ b/arch/arm/mach-exynos/Kconfig
352 +@@ -20,7 +20,6 @@ menuconfig ARCH_EXYNOS
353 + select EXYNOS_PMU
354 + select EXYNOS_SROM
355 + select EXYNOS_PM_DOMAINS if PM_GENERIC_DOMAINS
356 +- select GPIOLIB
357 + select HAVE_ARM_ARCH_TIMER if ARCH_EXYNOS5
358 + select HAVE_ARM_SCU if SMP
359 + select HAVE_S3C2410_I2C if I2C
360 +diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c
361 +index 5c3845730dbf5..0b80f8bcd3047 100644
362 +--- a/arch/arm/mach-omap2/omap4-common.c
363 ++++ b/arch/arm/mach-omap2/omap4-common.c
364 +@@ -314,10 +314,12 @@ void __init omap_gic_of_init(void)
365 +
366 + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic");
367 + gic_dist_base_addr = of_iomap(np, 0);
368 ++ of_node_put(np);
369 + WARN_ON(!gic_dist_base_addr);
370 +
371 + np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-twd-timer");
372 + twd_base = of_iomap(np, 0);
373 ++ of_node_put(np);
374 + WARN_ON(!twd_base);
375 +
376 + skip_errata_init:
377 +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi
378 +index d61f43052a344..8e9ad1e51d665 100644
379 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi
380 ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi
381 +@@ -11,26 +11,6 @@
382 + compatible = "operating-points-v2";
383 + opp-shared;
384 +
385 +- opp-100000000 {
386 +- opp-hz = /bits/ 64 <100000000>;
387 +- opp-microvolt = <731000>;
388 +- };
389 +-
390 +- opp-250000000 {
391 +- opp-hz = /bits/ 64 <250000000>;
392 +- opp-microvolt = <731000>;
393 +- };
394 +-
395 +- opp-500000000 {
396 +- opp-hz = /bits/ 64 <500000000>;
397 +- opp-microvolt = <731000>;
398 +- };
399 +-
400 +- opp-667000000 {
401 +- opp-hz = /bits/ 64 <667000000>;
402 +- opp-microvolt = <731000>;
403 +- };
404 +-
405 + opp-1000000000 {
406 + opp-hz = /bits/ 64 <1000000000>;
407 + opp-microvolt = <761000>;
408 +@@ -71,26 +51,6 @@
409 + compatible = "operating-points-v2";
410 + opp-shared;
411 +
412 +- opp-100000000 {
413 +- opp-hz = /bits/ 64 <100000000>;
414 +- opp-microvolt = <731000>;
415 +- };
416 +-
417 +- opp-250000000 {
418 +- opp-hz = /bits/ 64 <250000000>;
419 +- opp-microvolt = <731000>;
420 +- };
421 +-
422 +- opp-500000000 {
423 +- opp-hz = /bits/ 64 <500000000>;
424 +- opp-microvolt = <731000>;
425 +- };
426 +-
427 +- opp-667000000 {
428 +- opp-hz = /bits/ 64 <667000000>;
429 +- opp-microvolt = <731000>;
430 +- };
431 +-
432 + opp-1000000000 {
433 + opp-hz = /bits/ 64 <1000000000>;
434 + opp-microvolt = <731000>;
435 +diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi
436 +index 1e5d0ee5d541b..44c23c984034c 100644
437 +--- a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi
438 ++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi
439 +@@ -11,26 +11,6 @@
440 + compatible = "operating-points-v2";
441 + opp-shared;
442 +
443 +- opp-100000000 {
444 +- opp-hz = /bits/ 64 <100000000>;
445 +- opp-microvolt = <731000>;
446 +- };
447 +-
448 +- opp-250000000 {
449 +- opp-hz = /bits/ 64 <250000000>;
450 +- opp-microvolt = <731000>;
451 +- };
452 +-
453 +- opp-500000000 {
454 +- opp-hz = /bits/ 64 <500000000>;
455 +- opp-microvolt = <731000>;
456 +- };
457 +-
458 +- opp-667000000 {
459 +- opp-hz = /bits/ 64 <667000000>;
460 +- opp-microvolt = <731000>;
461 +- };
462 +-
463 + opp-1000000000 {
464 + opp-hz = /bits/ 64 <1000000000>;
465 + opp-microvolt = <731000>;
466 +@@ -76,26 +56,6 @@
467 + compatible = "operating-points-v2";
468 + opp-shared;
469 +
470 +- opp-100000000 {
471 +- opp-hz = /bits/ 64 <100000000>;
472 +- opp-microvolt = <751000>;
473 +- };
474 +-
475 +- opp-250000000 {
476 +- opp-hz = /bits/ 64 <250000000>;
477 +- opp-microvolt = <751000>;
478 +- };
479 +-
480 +- opp-500000000 {
481 +- opp-hz = /bits/ 64 <500000000>;
482 +- opp-microvolt = <751000>;
483 +- };
484 +-
485 +- opp-667000000 {
486 +- opp-hz = /bits/ 64 <667000000>;
487 +- opp-microvolt = <751000>;
488 +- };
489 +-
490 + opp-1000000000 {
491 + opp-hz = /bits/ 64 <1000000000>;
492 + opp-microvolt = <771000>;
493 +diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
494 +index c309517abae32..defe0b8d4d275 100644
495 +--- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
496 ++++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi
497 +@@ -95,26 +95,6 @@
498 + compatible = "operating-points-v2";
499 + opp-shared;
500 +
501 +- opp-100000000 {
502 +- opp-hz = /bits/ 64 <100000000>;
503 +- opp-microvolt = <730000>;
504 +- };
505 +-
506 +- opp-250000000 {
507 +- opp-hz = /bits/ 64 <250000000>;
508 +- opp-microvolt = <730000>;
509 +- };
510 +-
511 +- opp-500000000 {
512 +- opp-hz = /bits/ 64 <500000000>;
513 +- opp-microvolt = <730000>;
514 +- };
515 +-
516 +- opp-667000000 {
517 +- opp-hz = /bits/ 64 <666666666>;
518 +- opp-microvolt = <750000>;
519 +- };
520 +-
521 + opp-1000000000 {
522 + opp-hz = /bits/ 64 <1000000000>;
523 + opp-microvolt = <770000>;
524 +diff --git a/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts b/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts
525 +index 7dfee715a2c4d..d8ce217c60166 100644
526 +--- a/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts
527 ++++ b/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts
528 +@@ -59,6 +59,10 @@
529 + interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
530 + rohm,reset-snvs-powered;
531 +
532 ++ #clock-cells = <0>;
533 ++ clocks = <&osc_32k 0>;
534 ++ clock-output-names = "clk-32k-out";
535 ++
536 + regulators {
537 + buck1_reg: BUCK1 {
538 + regulator-name = "buck1";
539 +diff --git a/arch/powerpc/perf/Makefile b/arch/powerpc/perf/Makefile
540 +index c02854dea2b20..da9f60ede97b2 100644
541 +--- a/arch/powerpc/perf/Makefile
542 ++++ b/arch/powerpc/perf/Makefile
543 +@@ -5,11 +5,11 @@ ifdef CONFIG_COMPAT
544 + obj-$(CONFIG_PERF_EVENTS) += callchain_32.o
545 + endif
546 +
547 +-obj-$(CONFIG_PPC_PERF_CTRS) += core-book3s.o bhrb.o
548 ++obj-$(CONFIG_PPC_PERF_CTRS) += core-book3s.o
549 + obj64-$(CONFIG_PPC_PERF_CTRS) += ppc970-pmu.o power5-pmu.o \
550 + power5+-pmu.o power6-pmu.o power7-pmu.o \
551 + isa207-common.o power8-pmu.o power9-pmu.o \
552 +- generic-compat-pmu.o power10-pmu.o
553 ++ generic-compat-pmu.o power10-pmu.o bhrb.o
554 + obj32-$(CONFIG_PPC_PERF_CTRS) += mpc7450-pmu.o
555 +
556 + obj-$(CONFIG_PPC_POWERNV) += imc-pmu.o
557 +diff --git a/arch/riscv/kernel/patch.c b/arch/riscv/kernel/patch.c
558 +index 3fe7a5296aa58..1612e11f7bf6d 100644
559 +--- a/arch/riscv/kernel/patch.c
560 ++++ b/arch/riscv/kernel/patch.c
561 +@@ -100,7 +100,7 @@ static int patch_text_cb(void *data)
562 + struct patch_insn *patch = data;
563 + int ret = 0;
564 +
565 +- if (atomic_inc_return(&patch->cpu_count) == 1) {
566 ++ if (atomic_inc_return(&patch->cpu_count) == num_online_cpus()) {
567 + ret =
568 + patch_text_nosync(patch->addr, &patch->insn,
569 + GET_INSN_LENGTH(patch->insn));
570 +diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h
571 +index 2b7cc5397f80d..91a06cef50c1b 100644
572 +--- a/arch/x86/include/asm/microcode.h
573 ++++ b/arch/x86/include/asm/microcode.h
574 +@@ -133,11 +133,13 @@ extern void load_ucode_ap(void);
575 + void reload_early_microcode(void);
576 + extern bool get_builtin_firmware(struct cpio_data *cd, const char *name);
577 + extern bool initrd_gone;
578 ++void microcode_bsp_resume(void);
579 + #else
580 + static inline int __init microcode_init(void) { return 0; };
581 + static inline void __init load_ucode_bsp(void) { }
582 + static inline void load_ucode_ap(void) { }
583 + static inline void reload_early_microcode(void) { }
584 ++static inline void microcode_bsp_resume(void) { }
585 + static inline bool
586 + get_builtin_firmware(struct cpio_data *cd, const char *name) { return false; }
587 + #endif
588 +diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c
589 +index bbbd248fe9132..0b1732b98e719 100644
590 +--- a/arch/x86/kernel/cpu/microcode/core.c
591 ++++ b/arch/x86/kernel/cpu/microcode/core.c
592 +@@ -775,9 +775,9 @@ static struct subsys_interface mc_cpu_interface = {
593 + };
594 +
595 + /**
596 +- * mc_bp_resume - Update boot CPU microcode during resume.
597 ++ * microcode_bsp_resume - Update boot CPU microcode during resume.
598 + */
599 +-static void mc_bp_resume(void)
600 ++void microcode_bsp_resume(void)
601 + {
602 + int cpu = smp_processor_id();
603 + struct ucode_cpu_info *uci = ucode_cpu_info + cpu;
604 +@@ -789,7 +789,7 @@ static void mc_bp_resume(void)
605 + }
606 +
607 + static struct syscore_ops mc_syscore_ops = {
608 +- .resume = mc_bp_resume,
609 ++ .resume = microcode_bsp_resume,
610 + };
611 +
612 + static int mc_cpu_starting(unsigned int cpu)
613 +diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c
614 +index 508c81e97ab10..f1c0befb62df5 100644
615 +--- a/arch/x86/lib/usercopy_64.c
616 ++++ b/arch/x86/lib/usercopy_64.c
617 +@@ -121,7 +121,7 @@ void __memcpy_flushcache(void *_dst, const void *_src, size_t size)
618 +
619 + /* cache copy and flush to align dest */
620 + if (!IS_ALIGNED(dest, 8)) {
621 +- unsigned len = min_t(unsigned, size, ALIGN(dest, 8) - dest);
622 ++ size_t len = min_t(size_t, size, ALIGN(dest, 8) - dest);
623 +
624 + memcpy((void *) dest, (void *) source, len);
625 + clean_cache_range((void *) dest, len);
626 +diff --git a/arch/x86/pci/xen.c b/arch/x86/pci/xen.c
627 +index c552cd2d0632b..326d6d1737338 100644
628 +--- a/arch/x86/pci/xen.c
629 ++++ b/arch/x86/pci/xen.c
630 +@@ -476,7 +476,6 @@ static __init void xen_setup_pci_msi(void)
631 + xen_msi_ops.setup_msi_irqs = xen_setup_msi_irqs;
632 + }
633 + xen_msi_ops.teardown_msi_irqs = xen_pv_teardown_msi_irqs;
634 +- pci_msi_ignore_mask = 1;
635 + } else if (xen_hvm_domain()) {
636 + xen_msi_ops.setup_msi_irqs = xen_hvm_setup_msi_irqs;
637 + xen_msi_ops.teardown_msi_irqs = xen_teardown_msi_irqs;
638 +@@ -490,6 +489,11 @@ static __init void xen_setup_pci_msi(void)
639 + * in allocating the native domain and never use it.
640 + */
641 + x86_init.irqs.create_pci_msi_domain = xen_create_pci_msi_domain;
642 ++ /*
643 ++ * With XEN PIRQ/Eventchannels in use PCI/MSI[-X] masking is solely
644 ++ * controlled by the hypervisor.
645 ++ */
646 ++ pci_msi_ignore_mask = 1;
647 + }
648 +
649 + #else /* CONFIG_PCI_MSI */
650 +diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c
651 +index decebcd8ee1c7..d023c85e3c536 100644
652 +--- a/arch/x86/power/cpu.c
653 ++++ b/arch/x86/power/cpu.c
654 +@@ -25,6 +25,7 @@
655 + #include <asm/cpu.h>
656 + #include <asm/mmu_context.h>
657 + #include <asm/cpu_device_id.h>
658 ++#include <asm/microcode.h>
659 +
660 + #ifdef CONFIG_X86_32
661 + __visible unsigned long saved_context_ebx;
662 +@@ -265,11 +266,18 @@ static void notrace __restore_processor_state(struct saved_context *ctxt)
663 + x86_platform.restore_sched_clock_state();
664 + mtrr_bp_restore();
665 + perf_restore_debug_store();
666 +- msr_restore_context(ctxt);
667 +
668 + c = &cpu_data(smp_processor_id());
669 + if (cpu_has(c, X86_FEATURE_MSR_IA32_FEAT_CTL))
670 + init_ia32_feat_ctl(c);
671 ++
672 ++ microcode_bsp_resume();
673 ++
674 ++ /*
675 ++ * This needs to happen after the microcode has been updated upon resume
676 ++ * because some of the MSRs are "emulated" in microcode.
677 ++ */
678 ++ msr_restore_context(ctxt);
679 + }
680 +
681 + /* Needed by apm.c */
682 +diff --git a/block/blk-iocost.c b/block/blk-iocost.c
683 +index 9af32b44b7173..fb8f959a7f327 100644
684 +--- a/block/blk-iocost.c
685 ++++ b/block/blk-iocost.c
686 +@@ -2257,7 +2257,17 @@ static void ioc_timer_fn(struct timer_list *timer)
687 + iocg->hweight_donating = hwa;
688 + iocg->hweight_after_donation = new_hwi;
689 + list_add(&iocg->surplus_list, &surpluses);
690 +- } else {
691 ++ } else if (!iocg->abs_vdebt) {
692 ++ /*
693 ++ * @iocg doesn't have enough to donate. Reset
694 ++ * its inuse to active.
695 ++ *
696 ++ * Don't reset debtors as their inuse's are
697 ++ * owned by debt handling. This shouldn't affect
698 ++ * donation calculuation in any meaningful way
699 ++ * as @iocg doesn't have a meaningful amount of
700 ++ * share anyway.
701 ++ */
702 + TRACE_IOCG_PATH(inuse_shortage, iocg, &now,
703 + iocg->inuse, iocg->active,
704 + iocg->hweight_inuse, new_hwi);
705 +diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c
706 +index de8587cc119e8..8272a3a002a34 100644
707 +--- a/drivers/base/arch_topology.c
708 ++++ b/drivers/base/arch_topology.c
709 +@@ -515,7 +515,7 @@ void update_siblings_masks(unsigned int cpuid)
710 + for_each_online_cpu(cpu) {
711 + cpu_topo = &cpu_topology[cpu];
712 +
713 +- if (cpuid_topo->llc_id == cpu_topo->llc_id) {
714 ++ if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) {
715 + cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling);
716 + cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling);
717 + }
718 +diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig
719 +index f2548049aa0e9..40c53632512b7 100644
720 +--- a/drivers/block/Kconfig
721 ++++ b/drivers/block/Kconfig
722 +@@ -39,6 +39,22 @@ config BLK_DEV_FD
723 + To compile this driver as a module, choose M here: the
724 + module will be called floppy.
725 +
726 ++config BLK_DEV_FD_RAWCMD
727 ++ bool "Support for raw floppy disk commands (DEPRECATED)"
728 ++ depends on BLK_DEV_FD
729 ++ help
730 ++ If you want to use actual physical floppies and expect to do
731 ++ special low-level hardware accesses to them (access and use
732 ++ non-standard formats, for example), then enable this.
733 ++
734 ++ Note that the code enabled by this option is rarely used and
735 ++ might be unstable or insecure, and distros should not enable it.
736 ++
737 ++ Note: FDRAWCMD is deprecated and will be removed from the kernel
738 ++ in the near future.
739 ++
740 ++ If unsure, say N.
741 ++
742 + config AMIGA_FLOPPY
743 + tristate "Amiga floppy support"
744 + depends on AMIGA
745 +diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c
746 +index aaee15058d181..c9411fe2f0af8 100644
747 +--- a/drivers/block/floppy.c
748 ++++ b/drivers/block/floppy.c
749 +@@ -3069,6 +3069,8 @@ static const char *drive_name(int type, int drive)
750 + return "(null)";
751 + }
752 +
753 ++#ifdef CONFIG_BLK_DEV_FD_RAWCMD
754 ++
755 + /* raw commands */
756 + static void raw_cmd_done(int flag)
757 + {
758 +@@ -3273,6 +3275,35 @@ static int raw_cmd_ioctl(int cmd, void __user *param)
759 + return ret;
760 + }
761 +
762 ++static int floppy_raw_cmd_ioctl(int type, int drive, int cmd,
763 ++ void __user *param)
764 ++{
765 ++ int ret;
766 ++
767 ++ pr_warn_once("Note: FDRAWCMD is deprecated and will be removed from the kernel in the near future.\n");
768 ++
769 ++ if (type)
770 ++ return -EINVAL;
771 ++ if (lock_fdc(drive))
772 ++ return -EINTR;
773 ++ set_floppy(drive);
774 ++ ret = raw_cmd_ioctl(cmd, param);
775 ++ if (ret == -EINTR)
776 ++ return -EINTR;
777 ++ process_fd_request();
778 ++ return ret;
779 ++}
780 ++
781 ++#else /* CONFIG_BLK_DEV_FD_RAWCMD */
782 ++
783 ++static int floppy_raw_cmd_ioctl(int type, int drive, int cmd,
784 ++ void __user *param)
785 ++{
786 ++ return -EOPNOTSUPP;
787 ++}
788 ++
789 ++#endif
790 ++
791 + static int invalidate_drive(struct block_device *bdev)
792 + {
793 + /* invalidate the buffer track to force a reread */
794 +@@ -3461,7 +3492,6 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
795 + {
796 + int drive = (long)bdev->bd_disk->private_data;
797 + int type = ITYPE(drive_state[drive].fd_device);
798 +- int i;
799 + int ret;
800 + int size;
801 + union inparam {
802 +@@ -3612,16 +3642,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int
803 + outparam = &write_errors[drive];
804 + break;
805 + case FDRAWCMD:
806 +- if (type)
807 +- return -EINVAL;
808 +- if (lock_fdc(drive))
809 +- return -EINTR;
810 +- set_floppy(drive);
811 +- i = raw_cmd_ioctl(cmd, (void __user *)param);
812 +- if (i == -EINTR)
813 +- return -EINTR;
814 +- process_fd_request();
815 +- return i;
816 ++ return floppy_raw_cmd_ioctl(type, drive, cmd, (void __user *)param);
817 + case FDTWADDLE:
818 + if (lock_fdc(drive))
819 + return -EINTR;
820 +diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c
821 +index 1bb00a959c67f..9b1a5e62417cb 100644
822 +--- a/drivers/bus/sunxi-rsb.c
823 ++++ b/drivers/bus/sunxi-rsb.c
824 +@@ -224,6 +224,8 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb,
825 +
826 + dev_dbg(&rdev->dev, "device %s registered\n", dev_name(&rdev->dev));
827 +
828 ++ return rdev;
829 ++
830 + err_device_add:
831 + put_device(&rdev->dev);
832 +
833 +diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
834 +index 18f0650c5d405..ac559c2620335 100644
835 +--- a/drivers/bus/ti-sysc.c
836 ++++ b/drivers/bus/ti-sysc.c
837 +@@ -3130,13 +3130,27 @@ static int sysc_check_disabled_devices(struct sysc *ddata)
838 + */
839 + static int sysc_check_active_timer(struct sysc *ddata)
840 + {
841 ++ int error;
842 ++
843 + if (ddata->cap->type != TI_SYSC_OMAP2_TIMER &&
844 + ddata->cap->type != TI_SYSC_OMAP4_TIMER)
845 + return 0;
846 +
847 ++ /*
848 ++ * Quirk for omap3 beagleboard revision A to B4 to use gpt12.
849 ++ * Revision C and later are fixed with commit 23885389dbbb ("ARM:
850 ++ * dts: Fix timer regression for beagleboard revision c"). This all
851 ++ * can be dropped if we stop supporting old beagleboard revisions
852 ++ * A to B4 at some point.
853 ++ */
854 ++ if (sysc_soc->soc == SOC_3430)
855 ++ error = -ENXIO;
856 ++ else
857 ++ error = -EBUSY;
858 ++
859 + if ((ddata->cfg.quirks & SYSC_QUIRK_NO_RESET_ON_INIT) &&
860 + (ddata->cfg.quirks & SYSC_QUIRK_NO_IDLE))
861 +- return -ENXIO;
862 ++ return error;
863 +
864 + return 0;
865 + }
866 +diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-sun9i-mmc.c
867 +index 542b31d6e96dd..636bcf2439ef2 100644
868 +--- a/drivers/clk/sunxi/clk-sun9i-mmc.c
869 ++++ b/drivers/clk/sunxi/clk-sun9i-mmc.c
870 +@@ -109,6 +109,8 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev)
871 + spin_lock_init(&data->lock);
872 +
873 + r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
874 ++ if (!r)
875 ++ return -EINVAL;
876 + /* one clock/reset pair per word */
877 + count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH);
878 + data->membase = devm_ioremap_resource(&pdev->dev, r);
879 +diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
880 +index 2deed8d8773fa..75e1bf3a08f7c 100644
881 +--- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c
882 ++++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c
883 +@@ -98,8 +98,10 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev)
884 + return -ENOMEM;
885 +
886 + ret = sun50i_cpufreq_get_efuse(&speed);
887 +- if (ret)
888 ++ if (ret) {
889 ++ kfree(opp_tables);
890 + return ret;
891 ++ }
892 +
893 + snprintf(name, MAX_NAME_LEN, "speed%d", speed);
894 +
895 +diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
896 +index 2645ebc63a14d..195b7e02dc4b0 100644
897 +--- a/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
898 ++++ b/drivers/gpu/drm/amd/amdkfd/kfd_device_queue_manager.c
899 +@@ -138,19 +138,33 @@ void program_sh_mem_settings(struct device_queue_manager *dqm,
900 + }
901 +
902 + static void increment_queue_count(struct device_queue_manager *dqm,
903 +- enum kfd_queue_type type)
904 ++ struct qcm_process_device *qpd,
905 ++ struct queue *q)
906 + {
907 + dqm->active_queue_count++;
908 +- if (type == KFD_QUEUE_TYPE_COMPUTE || type == KFD_QUEUE_TYPE_DIQ)
909 ++ if (q->properties.type == KFD_QUEUE_TYPE_COMPUTE ||
910 ++ q->properties.type == KFD_QUEUE_TYPE_DIQ)
911 + dqm->active_cp_queue_count++;
912 ++
913 ++ if (q->properties.is_gws) {
914 ++ dqm->gws_queue_count++;
915 ++ qpd->mapped_gws_queue = true;
916 ++ }
917 + }
918 +
919 + static void decrement_queue_count(struct device_queue_manager *dqm,
920 +- enum kfd_queue_type type)
921 ++ struct qcm_process_device *qpd,
922 ++ struct queue *q)
923 + {
924 + dqm->active_queue_count--;
925 +- if (type == KFD_QUEUE_TYPE_COMPUTE || type == KFD_QUEUE_TYPE_DIQ)
926 ++ if (q->properties.type == KFD_QUEUE_TYPE_COMPUTE ||
927 ++ q->properties.type == KFD_QUEUE_TYPE_DIQ)
928 + dqm->active_cp_queue_count--;
929 ++
930 ++ if (q->properties.is_gws) {
931 ++ dqm->gws_queue_count--;
932 ++ qpd->mapped_gws_queue = false;
933 ++ }
934 + }
935 +
936 + static int allocate_doorbell(struct qcm_process_device *qpd, struct queue *q)
937 +@@ -377,7 +391,7 @@ add_queue_to_list:
938 + list_add(&q->list, &qpd->queues_list);
939 + qpd->queue_count++;
940 + if (q->properties.is_active)
941 +- increment_queue_count(dqm, q->properties.type);
942 ++ increment_queue_count(dqm, qpd, q);
943 +
944 + /*
945 + * Unconditionally increment this counter, regardless of the queue's
946 +@@ -502,13 +516,8 @@ static int destroy_queue_nocpsch_locked(struct device_queue_manager *dqm,
947 + deallocate_vmid(dqm, qpd, q);
948 + }
949 + qpd->queue_count--;
950 +- if (q->properties.is_active) {
951 +- decrement_queue_count(dqm, q->properties.type);
952 +- if (q->properties.is_gws) {
953 +- dqm->gws_queue_count--;
954 +- qpd->mapped_gws_queue = false;
955 +- }
956 +- }
957 ++ if (q->properties.is_active)
958 ++ decrement_queue_count(dqm, qpd, q);
959 +
960 + return retval;
961 + }
962 +@@ -598,12 +607,11 @@ static int update_queue(struct device_queue_manager *dqm, struct queue *q)
963 + * dqm->active_queue_count to determine whether a new runlist must be
964 + * uploaded.
965 + */
966 +- if (q->properties.is_active && !prev_active)
967 +- increment_queue_count(dqm, q->properties.type);
968 +- else if (!q->properties.is_active && prev_active)
969 +- decrement_queue_count(dqm, q->properties.type);
970 +-
971 +- if (q->gws && !q->properties.is_gws) {
972 ++ if (q->properties.is_active && !prev_active) {
973 ++ increment_queue_count(dqm, &pdd->qpd, q);
974 ++ } else if (!q->properties.is_active && prev_active) {
975 ++ decrement_queue_count(dqm, &pdd->qpd, q);
976 ++ } else if (q->gws && !q->properties.is_gws) {
977 + if (q->properties.is_active) {
978 + dqm->gws_queue_count++;
979 + pdd->qpd.mapped_gws_queue = true;
980 +@@ -665,11 +673,7 @@ static int evict_process_queues_nocpsch(struct device_queue_manager *dqm,
981 + mqd_mgr = dqm->mqd_mgrs[get_mqd_type_from_queue_type(
982 + q->properties.type)];
983 + q->properties.is_active = false;
984 +- decrement_queue_count(dqm, q->properties.type);
985 +- if (q->properties.is_gws) {
986 +- dqm->gws_queue_count--;
987 +- qpd->mapped_gws_queue = false;
988 +- }
989 ++ decrement_queue_count(dqm, qpd, q);
990 +
991 + if (WARN_ONCE(!dqm->sched_running, "Evict when stopped\n"))
992 + continue;
993 +@@ -713,7 +717,7 @@ static int evict_process_queues_cpsch(struct device_queue_manager *dqm,
994 + continue;
995 +
996 + q->properties.is_active = false;
997 +- decrement_queue_count(dqm, q->properties.type);
998 ++ decrement_queue_count(dqm, qpd, q);
999 + }
1000 + pdd->last_evict_timestamp = get_jiffies_64();
1001 + retval = execute_queues_cpsch(dqm,
1002 +@@ -784,11 +788,7 @@ static int restore_process_queues_nocpsch(struct device_queue_manager *dqm,
1003 + mqd_mgr = dqm->mqd_mgrs[get_mqd_type_from_queue_type(
1004 + q->properties.type)];
1005 + q->properties.is_active = true;
1006 +- increment_queue_count(dqm, q->properties.type);
1007 +- if (q->properties.is_gws) {
1008 +- dqm->gws_queue_count++;
1009 +- qpd->mapped_gws_queue = true;
1010 +- }
1011 ++ increment_queue_count(dqm, qpd, q);
1012 +
1013 + if (WARN_ONCE(!dqm->sched_running, "Restore when stopped\n"))
1014 + continue;
1015 +@@ -846,7 +846,7 @@ static int restore_process_queues_cpsch(struct device_queue_manager *dqm,
1016 + continue;
1017 +
1018 + q->properties.is_active = true;
1019 +- increment_queue_count(dqm, q->properties.type);
1020 ++ increment_queue_count(dqm, &pdd->qpd, q);
1021 + }
1022 + retval = execute_queues_cpsch(dqm,
1023 + KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0);
1024 +@@ -1247,7 +1247,7 @@ static int create_kernel_queue_cpsch(struct device_queue_manager *dqm,
1025 + dqm->total_queue_count);
1026 +
1027 + list_add(&kq->list, &qpd->priv_queue_list);
1028 +- increment_queue_count(dqm, kq->queue->properties.type);
1029 ++ increment_queue_count(dqm, qpd, kq->queue);
1030 + qpd->is_debug = true;
1031 + execute_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0);
1032 + dqm_unlock(dqm);
1033 +@@ -1261,7 +1261,7 @@ static void destroy_kernel_queue_cpsch(struct device_queue_manager *dqm,
1034 + {
1035 + dqm_lock(dqm);
1036 + list_del(&kq->list);
1037 +- decrement_queue_count(dqm, kq->queue->properties.type);
1038 ++ decrement_queue_count(dqm, qpd, kq->queue);
1039 + qpd->is_debug = false;
1040 + execute_queues_cpsch(dqm, KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES, 0);
1041 + /*
1042 +@@ -1328,7 +1328,7 @@ static int create_queue_cpsch(struct device_queue_manager *dqm, struct queue *q,
1043 + qpd->queue_count++;
1044 +
1045 + if (q->properties.is_active) {
1046 +- increment_queue_count(dqm, q->properties.type);
1047 ++ increment_queue_count(dqm, qpd, q);
1048 +
1049 + execute_queues_cpsch(dqm,
1050 + KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0);
1051 +@@ -1513,15 +1513,11 @@ static int destroy_queue_cpsch(struct device_queue_manager *dqm,
1052 + list_del(&q->list);
1053 + qpd->queue_count--;
1054 + if (q->properties.is_active) {
1055 +- decrement_queue_count(dqm, q->properties.type);
1056 ++ decrement_queue_count(dqm, qpd, q);
1057 + retval = execute_queues_cpsch(dqm,
1058 + KFD_UNMAP_QUEUES_FILTER_DYNAMIC_QUEUES, 0);
1059 + if (retval == -ETIME)
1060 + qpd->reset_wavefronts = true;
1061 +- if (q->properties.is_gws) {
1062 +- dqm->gws_queue_count--;
1063 +- qpd->mapped_gws_queue = false;
1064 +- }
1065 + }
1066 +
1067 + /*
1068 +@@ -1732,7 +1728,7 @@ static int process_termination_cpsch(struct device_queue_manager *dqm,
1069 + /* Clean all kernel queues */
1070 + list_for_each_entry_safe(kq, kq_next, &qpd->priv_queue_list, list) {
1071 + list_del(&kq->list);
1072 +- decrement_queue_count(dqm, kq->queue->properties.type);
1073 ++ decrement_queue_count(dqm, qpd, kq->queue);
1074 + qpd->is_debug = false;
1075 + dqm->total_queue_count--;
1076 + filter = KFD_UNMAP_QUEUES_FILTER_ALL_QUEUES;
1077 +@@ -1745,13 +1741,8 @@ static int process_termination_cpsch(struct device_queue_manager *dqm,
1078 + else if (q->properties.type == KFD_QUEUE_TYPE_SDMA_XGMI)
1079 + deallocate_sdma_queue(dqm, q);
1080 +
1081 +- if (q->properties.is_active) {
1082 +- decrement_queue_count(dqm, q->properties.type);
1083 +- if (q->properties.is_gws) {
1084 +- dqm->gws_queue_count--;
1085 +- qpd->mapped_gws_queue = false;
1086 +- }
1087 +- }
1088 ++ if (q->properties.is_active)
1089 ++ decrement_queue_count(dqm, qpd, q);
1090 +
1091 + dqm->total_queue_count--;
1092 + }
1093 +diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
1094 +index 7ed4d7c8734f0..01c4e8753294b 100644
1095 +--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
1096 ++++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
1097 +@@ -1267,6 +1267,7 @@ static struct clock_source *dcn21_clock_source_create(
1098 + return &clk_src->base;
1099 + }
1100 +
1101 ++ kfree(clk_src);
1102 + BREAK_TO_DEBUGGER();
1103 + return NULL;
1104 + }
1105 +diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
1106 +index 12488996a7f4f..f1ab26307db6f 100644
1107 +--- a/drivers/gpu/drm/i915/i915_reg.h
1108 ++++ b/drivers/gpu/drm/i915/i915_reg.h
1109 +@@ -7202,7 +7202,7 @@ enum {
1110 + #define _SEL_FETCH_PLANE_BASE_6_A 0x70940
1111 + #define _SEL_FETCH_PLANE_BASE_7_A 0x70960
1112 + #define _SEL_FETCH_PLANE_BASE_CUR_A 0x70880
1113 +-#define _SEL_FETCH_PLANE_BASE_1_B 0x70990
1114 ++#define _SEL_FETCH_PLANE_BASE_1_B 0x71890
1115 +
1116 + #define _SEL_FETCH_PLANE_BASE_A(plane) _PICK(plane, \
1117 + _SEL_FETCH_PLANE_BASE_1_A, \
1118 +diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c
1119 +index e86886ca5ee41..b168eb14c2465 100644
1120 +--- a/drivers/iio/dac/ad5446.c
1121 ++++ b/drivers/iio/dac/ad5446.c
1122 +@@ -178,7 +178,7 @@ static int ad5446_read_raw(struct iio_dev *indio_dev,
1123 +
1124 + switch (m) {
1125 + case IIO_CHAN_INFO_RAW:
1126 +- *val = st->cached_val;
1127 ++ *val = st->cached_val >> chan->scan_type.shift;
1128 + return IIO_VAL_INT;
1129 + case IIO_CHAN_INFO_SCALE:
1130 + *val = st->vref_mv;
1131 +diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c
1132 +index 0405e92b9e8c3..987264410278c 100644
1133 +--- a/drivers/iio/dac/ad5592r-base.c
1134 ++++ b/drivers/iio/dac/ad5592r-base.c
1135 +@@ -523,7 +523,7 @@ static int ad5592r_alloc_channels(struct iio_dev *iio_dev)
1136 + if (!ret)
1137 + st->channel_modes[reg] = tmp;
1138 +
1139 +- fwnode_property_read_u32(child, "adi,off-state", &tmp);
1140 ++ ret = fwnode_property_read_u32(child, "adi,off-state", &tmp);
1141 + if (!ret)
1142 + st->channel_offstate[reg] = tmp;
1143 + }
1144 +diff --git a/drivers/iio/imu/bmi160/bmi160_core.c b/drivers/iio/imu/bmi160/bmi160_core.c
1145 +index 82f03a4dc47a7..5fd61889f5931 100644
1146 +--- a/drivers/iio/imu/bmi160/bmi160_core.c
1147 ++++ b/drivers/iio/imu/bmi160/bmi160_core.c
1148 +@@ -731,7 +731,7 @@ static int bmi160_chip_init(struct bmi160_data *data, bool use_spi)
1149 +
1150 + ret = regmap_write(data->regmap, BMI160_REG_CMD, BMI160_CMD_SOFTRESET);
1151 + if (ret)
1152 +- return ret;
1153 ++ goto disable_regulator;
1154 +
1155 + usleep_range(BMI160_SOFTRESET_USLEEP, BMI160_SOFTRESET_USLEEP + 1);
1156 +
1157 +@@ -742,29 +742,37 @@ static int bmi160_chip_init(struct bmi160_data *data, bool use_spi)
1158 + if (use_spi) {
1159 + ret = regmap_read(data->regmap, BMI160_REG_DUMMY, &val);
1160 + if (ret)
1161 +- return ret;
1162 ++ goto disable_regulator;
1163 + }
1164 +
1165 + ret = regmap_read(data->regmap, BMI160_REG_CHIP_ID, &val);
1166 + if (ret) {
1167 + dev_err(dev, "Error reading chip id\n");
1168 +- return ret;
1169 ++ goto disable_regulator;
1170 + }
1171 + if (val != BMI160_CHIP_ID_VAL) {
1172 + dev_err(dev, "Wrong chip id, got %x expected %x\n",
1173 + val, BMI160_CHIP_ID_VAL);
1174 +- return -ENODEV;
1175 ++ ret = -ENODEV;
1176 ++ goto disable_regulator;
1177 + }
1178 +
1179 + ret = bmi160_set_mode(data, BMI160_ACCEL, true);
1180 + if (ret)
1181 +- return ret;
1182 ++ goto disable_regulator;
1183 +
1184 + ret = bmi160_set_mode(data, BMI160_GYRO, true);
1185 + if (ret)
1186 +- return ret;
1187 ++ goto disable_accel;
1188 +
1189 + return 0;
1190 ++
1191 ++disable_accel:
1192 ++ bmi160_set_mode(data, BMI160_ACCEL, false);
1193 ++
1194 ++disable_regulator:
1195 ++ regulator_bulk_disable(ARRAY_SIZE(data->supplies), data->supplies);
1196 ++ return ret;
1197 + }
1198 +
1199 + static int bmi160_data_rdy_trigger_set_state(struct iio_trigger *trig,
1200 +diff --git a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
1201 +index 85b1934cec60e..53891010a91de 100644
1202 +--- a/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
1203 ++++ b/drivers/iio/imu/inv_icm42600/inv_icm42600_i2c.c
1204 +@@ -18,12 +18,15 @@ static int inv_icm42600_i2c_bus_setup(struct inv_icm42600_state *st)
1205 + unsigned int mask, val;
1206 + int ret;
1207 +
1208 +- /* setup interface registers */
1209 +- ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG6,
1210 +- INV_ICM42600_INTF_CONFIG6_MASK,
1211 +- INV_ICM42600_INTF_CONFIG6_I3C_EN);
1212 +- if (ret)
1213 +- return ret;
1214 ++ /*
1215 ++ * setup interface registers
1216 ++ * This register write to REG_INTF_CONFIG6 enables a spike filter that
1217 ++ * is impacting the line and can prevent the I2C ACK to be seen by the
1218 ++ * controller. So we don't test the return value.
1219 ++ */
1220 ++ regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG6,
1221 ++ INV_ICM42600_INTF_CONFIG6_MASK,
1222 ++ INV_ICM42600_INTF_CONFIG6_I3C_EN);
1223 +
1224 + ret = regmap_update_bits(st->map, INV_ICM42600_REG_INTF_CONFIG4,
1225 + INV_ICM42600_INTF_CONFIG4_I3C_BUS_ONLY, 0);
1226 +diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c
1227 +index d988b6ac36593..3774e5975f770 100644
1228 +--- a/drivers/iio/magnetometer/ak8975.c
1229 ++++ b/drivers/iio/magnetometer/ak8975.c
1230 +@@ -389,6 +389,7 @@ static int ak8975_power_on(const struct ak8975_data *data)
1231 + if (ret) {
1232 + dev_warn(&data->client->dev,
1233 + "Failed to enable specified Vid supply\n");
1234 ++ regulator_disable(data->vdd);
1235 + return ret;
1236 + }
1237 +
1238 +diff --git a/drivers/lightnvm/Kconfig b/drivers/lightnvm/Kconfig
1239 +index 4c2ce210c1237..95b09148167e8 100644
1240 +--- a/drivers/lightnvm/Kconfig
1241 ++++ b/drivers/lightnvm/Kconfig
1242 +@@ -5,7 +5,7 @@
1243 +
1244 + menuconfig NVM
1245 + bool "Open-Channel SSD target support"
1246 +- depends on BLOCK
1247 ++ depends on BLOCK && BROKEN
1248 + help
1249 + Say Y here to get to enable Open-channel SSDs.
1250 +
1251 +diff --git a/drivers/memory/renesas-rpc-if.c b/drivers/memory/renesas-rpc-if.c
1252 +index 781af51e3f793..1dfb81dea9611 100644
1253 +--- a/drivers/memory/renesas-rpc-if.c
1254 ++++ b/drivers/memory/renesas-rpc-if.c
1255 +@@ -163,25 +163,39 @@ static const struct regmap_access_table rpcif_volatile_table = {
1256 +
1257 +
1258 + /*
1259 +- * Custom accessor functions to ensure SMRDR0 and SMWDR0 are always accessed
1260 +- * with proper width. Requires SMENR_SPIDE to be correctly set before!
1261 ++ * Custom accessor functions to ensure SM[RW]DR[01] are always accessed with
1262 ++ * proper width. Requires rpcif.xfer_size to be correctly set before!
1263 + */
1264 + static int rpcif_reg_read(void *context, unsigned int reg, unsigned int *val)
1265 + {
1266 + struct rpcif *rpc = context;
1267 +
1268 +- if (reg == RPCIF_SMRDR0 || reg == RPCIF_SMWDR0) {
1269 +- u32 spide = readl(rpc->base + RPCIF_SMENR) & RPCIF_SMENR_SPIDE(0xF);
1270 +-
1271 +- if (spide == 0x8) {
1272 ++ switch (reg) {
1273 ++ case RPCIF_SMRDR0:
1274 ++ case RPCIF_SMWDR0:
1275 ++ switch (rpc->xfer_size) {
1276 ++ case 1:
1277 + *val = readb(rpc->base + reg);
1278 + return 0;
1279 +- } else if (spide == 0xC) {
1280 ++
1281 ++ case 2:
1282 + *val = readw(rpc->base + reg);
1283 + return 0;
1284 +- } else if (spide != 0xF) {
1285 ++
1286 ++ case 4:
1287 ++ case 8:
1288 ++ *val = readl(rpc->base + reg);
1289 ++ return 0;
1290 ++
1291 ++ default:
1292 + return -EILSEQ;
1293 + }
1294 ++
1295 ++ case RPCIF_SMRDR1:
1296 ++ case RPCIF_SMWDR1:
1297 ++ if (rpc->xfer_size != 8)
1298 ++ return -EILSEQ;
1299 ++ break;
1300 + }
1301 +
1302 + *val = readl(rpc->base + reg);
1303 +@@ -193,18 +207,34 @@ static int rpcif_reg_write(void *context, unsigned int reg, unsigned int val)
1304 + {
1305 + struct rpcif *rpc = context;
1306 +
1307 +- if (reg == RPCIF_SMRDR0 || reg == RPCIF_SMWDR0) {
1308 +- u32 spide = readl(rpc->base + RPCIF_SMENR) & RPCIF_SMENR_SPIDE(0xF);
1309 +-
1310 +- if (spide == 0x8) {
1311 ++ switch (reg) {
1312 ++ case RPCIF_SMWDR0:
1313 ++ switch (rpc->xfer_size) {
1314 ++ case 1:
1315 + writeb(val, rpc->base + reg);
1316 + return 0;
1317 +- } else if (spide == 0xC) {
1318 ++
1319 ++ case 2:
1320 + writew(val, rpc->base + reg);
1321 + return 0;
1322 +- } else if (spide != 0xF) {
1323 ++
1324 ++ case 4:
1325 ++ case 8:
1326 ++ writel(val, rpc->base + reg);
1327 ++ return 0;
1328 ++
1329 ++ default:
1330 + return -EILSEQ;
1331 + }
1332 ++
1333 ++ case RPCIF_SMWDR1:
1334 ++ if (rpc->xfer_size != 8)
1335 ++ return -EILSEQ;
1336 ++ break;
1337 ++
1338 ++ case RPCIF_SMRDR0:
1339 ++ case RPCIF_SMRDR1:
1340 ++ return -EPERM;
1341 + }
1342 +
1343 + writel(val, rpc->base + reg);
1344 +@@ -455,6 +485,7 @@ int rpcif_manual_xfer(struct rpcif *rpc)
1345 +
1346 + smenr |= RPCIF_SMENR_SPIDE(rpcif_bits_set(rpc, nbytes));
1347 + regmap_write(rpc->regmap, RPCIF_SMENR, smenr);
1348 ++ rpc->xfer_size = nbytes;
1349 +
1350 + memcpy(data, rpc->buffer + pos, nbytes);
1351 + if (nbytes == 8) {
1352 +@@ -519,6 +550,7 @@ int rpcif_manual_xfer(struct rpcif *rpc)
1353 + regmap_write(rpc->regmap, RPCIF_SMENR, smenr);
1354 + regmap_write(rpc->regmap, RPCIF_SMCR,
1355 + rpc->smcr | RPCIF_SMCR_SPIE);
1356 ++ rpc->xfer_size = nbytes;
1357 + ret = wait_msg_xfer_end(rpc);
1358 + if (ret)
1359 + goto err_out;
1360 +diff --git a/drivers/mtd/nand/raw/mtk_ecc.c b/drivers/mtd/nand/raw/mtk_ecc.c
1361 +index 75f1fa3d4d35c..c115e03ede889 100644
1362 +--- a/drivers/mtd/nand/raw/mtk_ecc.c
1363 ++++ b/drivers/mtd/nand/raw/mtk_ecc.c
1364 +@@ -43,6 +43,7 @@
1365 +
1366 + struct mtk_ecc_caps {
1367 + u32 err_mask;
1368 ++ u32 err_shift;
1369 + const u8 *ecc_strength;
1370 + const u32 *ecc_regs;
1371 + u8 num_ecc_strength;
1372 +@@ -76,7 +77,7 @@ static const u8 ecc_strength_mt2712[] = {
1373 + };
1374 +
1375 + static const u8 ecc_strength_mt7622[] = {
1376 +- 4, 6, 8, 10, 12, 14, 16
1377 ++ 4, 6, 8, 10, 12
1378 + };
1379 +
1380 + enum mtk_ecc_regs {
1381 +@@ -221,7 +222,7 @@ void mtk_ecc_get_stats(struct mtk_ecc *ecc, struct mtk_ecc_stats *stats,
1382 + for (i = 0; i < sectors; i++) {
1383 + offset = (i >> 2) << 2;
1384 + err = readl(ecc->regs + ECC_DECENUM0 + offset);
1385 +- err = err >> ((i % 4) * 8);
1386 ++ err = err >> ((i % 4) * ecc->caps->err_shift);
1387 + err &= ecc->caps->err_mask;
1388 + if (err == ecc->caps->err_mask) {
1389 + /* uncorrectable errors */
1390 +@@ -449,6 +450,7 @@ EXPORT_SYMBOL(mtk_ecc_get_parity_bits);
1391 +
1392 + static const struct mtk_ecc_caps mtk_ecc_caps_mt2701 = {
1393 + .err_mask = 0x3f,
1394 ++ .err_shift = 8,
1395 + .ecc_strength = ecc_strength_mt2701,
1396 + .ecc_regs = mt2701_ecc_regs,
1397 + .num_ecc_strength = 20,
1398 +@@ -459,6 +461,7 @@ static const struct mtk_ecc_caps mtk_ecc_caps_mt2701 = {
1399 +
1400 + static const struct mtk_ecc_caps mtk_ecc_caps_mt2712 = {
1401 + .err_mask = 0x7f,
1402 ++ .err_shift = 8,
1403 + .ecc_strength = ecc_strength_mt2712,
1404 + .ecc_regs = mt2712_ecc_regs,
1405 + .num_ecc_strength = 23,
1406 +@@ -468,10 +471,11 @@ static const struct mtk_ecc_caps mtk_ecc_caps_mt2712 = {
1407 + };
1408 +
1409 + static const struct mtk_ecc_caps mtk_ecc_caps_mt7622 = {
1410 +- .err_mask = 0x3f,
1411 ++ .err_mask = 0x1f,
1412 ++ .err_shift = 5,
1413 + .ecc_strength = ecc_strength_mt7622,
1414 + .ecc_regs = mt7622_ecc_regs,
1415 +- .num_ecc_strength = 7,
1416 ++ .num_ecc_strength = 5,
1417 + .ecc_mode_shift = 4,
1418 + .parity_bits = 13,
1419 + .pg_irq_sel = 0,
1420 +diff --git a/drivers/mtd/nand/raw/sh_flctl.c b/drivers/mtd/nand/raw/sh_flctl.c
1421 +index 13df4bdf792af..8f89e2d3d817f 100644
1422 +--- a/drivers/mtd/nand/raw/sh_flctl.c
1423 ++++ b/drivers/mtd/nand/raw/sh_flctl.c
1424 +@@ -384,7 +384,8 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,
1425 + dma_addr_t dma_addr;
1426 + dma_cookie_t cookie;
1427 + uint32_t reg;
1428 +- int ret;
1429 ++ int ret = 0;
1430 ++ unsigned long time_left;
1431 +
1432 + if (dir == DMA_FROM_DEVICE) {
1433 + chan = flctl->chan_fifo0_rx;
1434 +@@ -425,13 +426,14 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf,
1435 + goto out;
1436 + }
1437 +
1438 +- ret =
1439 ++ time_left =
1440 + wait_for_completion_timeout(&flctl->dma_complete,
1441 + msecs_to_jiffies(3000));
1442 +
1443 +- if (ret <= 0) {
1444 ++ if (time_left == 0) {
1445 + dmaengine_terminate_all(chan);
1446 + dev_err(&flctl->pdev->dev, "wait_for_completion_timeout\n");
1447 ++ ret = -ETIMEDOUT;
1448 + }
1449 +
1450 + out:
1451 +@@ -441,7 +443,7 @@ out:
1452 +
1453 + dma_unmap_single(chan->device->dev, dma_addr, len, dir);
1454 +
1455 +- /* ret > 0 is success */
1456 ++ /* ret == 0 is success */
1457 + return ret;
1458 + }
1459 +
1460 +@@ -465,7 +467,7 @@ static void read_fiforeg(struct sh_flctl *flctl, int rlen, int offset)
1461 +
1462 + /* initiate DMA transfer */
1463 + if (flctl->chan_fifo0_rx && rlen >= 32 &&
1464 +- flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE) > 0)
1465 ++ !flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE))
1466 + goto convert; /* DMA success */
1467 +
1468 + /* do polling transfer */
1469 +@@ -524,7 +526,7 @@ static void write_ec_fiforeg(struct sh_flctl *flctl, int rlen,
1470 +
1471 + /* initiate DMA transfer */
1472 + if (flctl->chan_fifo0_tx && rlen >= 32 &&
1473 +- flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE) > 0)
1474 ++ !flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE))
1475 + return; /* DMA success */
1476 +
1477 + /* do polling transfer */
1478 +diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c
1479 +index 80ef7ea779545..4abae06499a96 100644
1480 +--- a/drivers/net/dsa/lantiq_gswip.c
1481 ++++ b/drivers/net/dsa/lantiq_gswip.c
1482 +@@ -1629,9 +1629,6 @@ static void gswip_phylink_mac_config(struct dsa_switch *ds, int port,
1483 + break;
1484 + case PHY_INTERFACE_MODE_RMII:
1485 + miicfg |= GSWIP_MII_CFG_MODE_RMIIM;
1486 +-
1487 +- /* Configure the RMII clock as output: */
1488 +- miicfg |= GSWIP_MII_CFG_RMII_CLK;
1489 + break;
1490 + case PHY_INTERFACE_MODE_RGMII:
1491 + case PHY_INTERFACE_MODE_RGMII_ID:
1492 +diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
1493 +index 6333471916be1..afb6d3ee1f564 100644
1494 +--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
1495 ++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
1496 +@@ -14213,10 +14213,6 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp)
1497 +
1498 + /* Stop Tx */
1499 + bnx2x_tx_disable(bp);
1500 +- /* Delete all NAPI objects */
1501 +- bnx2x_del_all_napi(bp);
1502 +- if (CNIC_LOADED(bp))
1503 +- bnx2x_del_all_napi_cnic(bp);
1504 + netdev_reset_tc(bp->dev);
1505 +
1506 + del_timer_sync(&bp->timer);
1507 +@@ -14321,6 +14317,11 @@ static pci_ers_result_t bnx2x_io_slot_reset(struct pci_dev *pdev)
1508 + bnx2x_drain_tx_queues(bp);
1509 + bnx2x_send_unload_req(bp, UNLOAD_RECOVERY);
1510 + bnx2x_netif_stop(bp, 1);
1511 ++ bnx2x_del_all_napi(bp);
1512 ++
1513 ++ if (CNIC_LOADED(bp))
1514 ++ bnx2x_del_all_napi_cnic(bp);
1515 ++
1516 + bnx2x_free_irq(bp);
1517 +
1518 + /* Report UNLOAD_DONE to MCP */
1519 +diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
1520 +index a2062144d7ca1..9ffdaa84ba124 100644
1521 +--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c
1522 ++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c
1523 +@@ -1987,6 +1987,11 @@ static struct sk_buff *bcmgenet_add_tsb(struct net_device *dev,
1524 + return skb;
1525 + }
1526 +
1527 ++static void bcmgenet_hide_tsb(struct sk_buff *skb)
1528 ++{
1529 ++ __skb_pull(skb, sizeof(struct status_64));
1530 ++}
1531 ++
1532 + static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
1533 + {
1534 + struct bcmgenet_priv *priv = netdev_priv(dev);
1535 +@@ -2093,6 +2098,8 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev)
1536 + }
1537 +
1538 + GENET_CB(skb)->last_cb = tx_cb_ptr;
1539 ++
1540 ++ bcmgenet_hide_tsb(skb);
1541 + skb_tx_timestamp(skb);
1542 +
1543 + /* Decrement total BD count and advance our write pointer */
1544 +diff --git a/drivers/net/ethernet/freescale/fec_main.c b/drivers/net/ethernet/freescale/fec_main.c
1545 +index 166bc3f3b34cc..d8bdaf2e5365c 100644
1546 +--- a/drivers/net/ethernet/freescale/fec_main.c
1547 ++++ b/drivers/net/ethernet/freescale/fec_main.c
1548 +@@ -3529,7 +3529,7 @@ static int fec_enet_init_stop_mode(struct fec_enet_private *fep,
1549 + ARRAY_SIZE(out_val));
1550 + if (ret) {
1551 + dev_dbg(&fep->pdev->dev, "no stop mode property\n");
1552 +- return ret;
1553 ++ goto out;
1554 + }
1555 +
1556 + fep->stop_gpr.gpr = syscon_node_to_regmap(gpr_np);
1557 +diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
1558 +index 5d39967672561..51b7b46f2f309 100644
1559 +--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
1560 ++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
1561 +@@ -91,6 +91,13 @@ static int hclge_send_mbx_msg(struct hclge_vport *vport, u8 *msg, u16 msg_len,
1562 + enum hclge_cmd_status status;
1563 + struct hclge_desc desc;
1564 +
1565 ++ if (msg_len > HCLGE_MBX_MAX_MSG_SIZE) {
1566 ++ dev_err(&hdev->pdev->dev,
1567 ++ "msg data length(=%u) exceeds maximum(=%u)\n",
1568 ++ msg_len, HCLGE_MBX_MAX_MSG_SIZE);
1569 ++ return -EMSGSIZE;
1570 ++ }
1571 ++
1572 + resp_pf_to_vf = (struct hclge_mbx_pf_to_vf_cmd *)desc.data;
1573 +
1574 + hclge_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_MBX_PF_TO_VF, false);
1575 +@@ -173,7 +180,7 @@ static int hclge_get_ring_chain_from_mbx(
1576 + ring_num = req->msg.ring_num;
1577 +
1578 + if (ring_num > HCLGE_MBX_MAX_RING_CHAIN_PARAM_NUM)
1579 +- return -ENOMEM;
1580 ++ return -EINVAL;
1581 +
1582 + for (i = 0; i < ring_num; i++) {
1583 + if (req->msg.param[i].tqp_index >= vport->nic.kinfo.rss_size) {
1584 +@@ -577,9 +584,9 @@ static int hclge_set_vf_mtu(struct hclge_vport *vport,
1585 + return hclge_set_vport_mtu(vport, mtu);
1586 + }
1587 +
1588 +-static void hclge_get_queue_id_in_pf(struct hclge_vport *vport,
1589 +- struct hclge_mbx_vf_to_pf_cmd *mbx_req,
1590 +- struct hclge_respond_to_vf_msg *resp_msg)
1591 ++static int hclge_get_queue_id_in_pf(struct hclge_vport *vport,
1592 ++ struct hclge_mbx_vf_to_pf_cmd *mbx_req,
1593 ++ struct hclge_respond_to_vf_msg *resp_msg)
1594 + {
1595 + struct hnae3_handle *handle = &vport->nic;
1596 + struct hclge_dev *hdev = vport->back;
1597 +@@ -589,17 +596,18 @@ static void hclge_get_queue_id_in_pf(struct hclge_vport *vport,
1598 + if (queue_id >= handle->kinfo.num_tqps) {
1599 + dev_err(&hdev->pdev->dev, "Invalid queue id(%u) from VF %u\n",
1600 + queue_id, mbx_req->mbx_src_vfid);
1601 +- return;
1602 ++ return -EINVAL;
1603 + }
1604 +
1605 + qid_in_pf = hclge_covert_handle_qid_global(&vport->nic, queue_id);
1606 + memcpy(resp_msg->data, &qid_in_pf, sizeof(qid_in_pf));
1607 + resp_msg->len = sizeof(qid_in_pf);
1608 ++ return 0;
1609 + }
1610 +
1611 +-static void hclge_get_rss_key(struct hclge_vport *vport,
1612 +- struct hclge_mbx_vf_to_pf_cmd *mbx_req,
1613 +- struct hclge_respond_to_vf_msg *resp_msg)
1614 ++static int hclge_get_rss_key(struct hclge_vport *vport,
1615 ++ struct hclge_mbx_vf_to_pf_cmd *mbx_req,
1616 ++ struct hclge_respond_to_vf_msg *resp_msg)
1617 + {
1618 + #define HCLGE_RSS_MBX_RESP_LEN 8
1619 + struct hclge_dev *hdev = vport->back;
1620 +@@ -615,13 +623,14 @@ static void hclge_get_rss_key(struct hclge_vport *vport,
1621 + dev_warn(&hdev->pdev->dev,
1622 + "failed to get the rss hash key, the index(%u) invalid !\n",
1623 + index);
1624 +- return;
1625 ++ return -EINVAL;
1626 + }
1627 +
1628 + memcpy(resp_msg->data,
1629 + &hdev->vport[0].rss_hash_key[index * HCLGE_RSS_MBX_RESP_LEN],
1630 + HCLGE_RSS_MBX_RESP_LEN);
1631 + resp_msg->len = HCLGE_RSS_MBX_RESP_LEN;
1632 ++ return 0;
1633 + }
1634 +
1635 + static void hclge_link_fail_parse(struct hclge_dev *hdev, u8 link_fail_code)
1636 +@@ -800,10 +809,10 @@ void hclge_mbx_handler(struct hclge_dev *hdev)
1637 + "VF fail(%d) to set mtu\n", ret);
1638 + break;
1639 + case HCLGE_MBX_GET_QID_IN_PF:
1640 +- hclge_get_queue_id_in_pf(vport, req, &resp_msg);
1641 ++ ret = hclge_get_queue_id_in_pf(vport, req, &resp_msg);
1642 + break;
1643 + case HCLGE_MBX_GET_RSS_KEY:
1644 +- hclge_get_rss_key(vport, req, &resp_msg);
1645 ++ ret = hclge_get_rss_key(vport, req, &resp_msg);
1646 + break;
1647 + case HCLGE_MBX_GET_LINK_MODE:
1648 + hclge_get_link_mode(vport, req);
1649 +diff --git a/drivers/net/ethernet/ibm/ibmvnic.c b/drivers/net/ethernet/ibm/ibmvnic.c
1650 +index 95bee3d915934..61fb2a092451b 100644
1651 +--- a/drivers/net/ethernet/ibm/ibmvnic.c
1652 ++++ b/drivers/net/ethernet/ibm/ibmvnic.c
1653 +@@ -117,7 +117,7 @@ struct ibmvnic_stat {
1654 +
1655 + #define IBMVNIC_STAT_OFF(stat) (offsetof(struct ibmvnic_adapter, stats) + \
1656 + offsetof(struct ibmvnic_statistics, stat))
1657 +-#define IBMVNIC_GET_STAT(a, off) (*((u64 *)(((unsigned long)(a)) + off)))
1658 ++#define IBMVNIC_GET_STAT(a, off) (*((u64 *)(((unsigned long)(a)) + (off))))
1659 +
1660 + static const struct ibmvnic_stat ibmvnic_stats[] = {
1661 + {"rx_packets", IBMVNIC_STAT_OFF(rx_packets)},
1662 +@@ -2063,14 +2063,14 @@ static int do_reset(struct ibmvnic_adapter *adapter,
1663 + rc = reset_tx_pools(adapter);
1664 + if (rc) {
1665 + netdev_dbg(adapter->netdev, "reset tx pools failed (%d)\n",
1666 +- rc);
1667 ++ rc);
1668 + goto out;
1669 + }
1670 +
1671 + rc = reset_rx_pools(adapter);
1672 + if (rc) {
1673 + netdev_dbg(adapter->netdev, "reset rx pools failed (%d)\n",
1674 +- rc);
1675 ++ rc);
1676 + goto out;
1677 + }
1678 + }
1679 +@@ -2331,7 +2331,8 @@ static int ibmvnic_reset(struct ibmvnic_adapter *adapter,
1680 +
1681 + if (adapter->state == VNIC_PROBING) {
1682 + netdev_warn(netdev, "Adapter reset during probe\n");
1683 +- ret = adapter->init_done_rc = EAGAIN;
1684 ++ adapter->init_done_rc = EAGAIN;
1685 ++ ret = EAGAIN;
1686 + goto err;
1687 + }
1688 +
1689 +@@ -2665,13 +2666,8 @@ static void ibmvnic_get_ringparam(struct net_device *netdev,
1690 + {
1691 + struct ibmvnic_adapter *adapter = netdev_priv(netdev);
1692 +
1693 +- if (adapter->priv_flags & IBMVNIC_USE_SERVER_MAXES) {
1694 +- ring->rx_max_pending = adapter->max_rx_add_entries_per_subcrq;
1695 +- ring->tx_max_pending = adapter->max_tx_entries_per_subcrq;
1696 +- } else {
1697 +- ring->rx_max_pending = IBMVNIC_MAX_QUEUE_SZ;
1698 +- ring->tx_max_pending = IBMVNIC_MAX_QUEUE_SZ;
1699 +- }
1700 ++ ring->rx_max_pending = adapter->max_rx_add_entries_per_subcrq;
1701 ++ ring->tx_max_pending = adapter->max_tx_entries_per_subcrq;
1702 + ring->rx_mini_max_pending = 0;
1703 + ring->rx_jumbo_max_pending = 0;
1704 + ring->rx_pending = adapter->req_rx_add_entries_per_subcrq;
1705 +@@ -2684,23 +2680,21 @@ static int ibmvnic_set_ringparam(struct net_device *netdev,
1706 + struct ethtool_ringparam *ring)
1707 + {
1708 + struct ibmvnic_adapter *adapter = netdev_priv(netdev);
1709 +- int ret;
1710 +
1711 +- ret = 0;
1712 ++ if (ring->rx_pending > adapter->max_rx_add_entries_per_subcrq ||
1713 ++ ring->tx_pending > adapter->max_tx_entries_per_subcrq) {
1714 ++ netdev_err(netdev, "Invalid request.\n");
1715 ++ netdev_err(netdev, "Max tx buffers = %llu\n",
1716 ++ adapter->max_rx_add_entries_per_subcrq);
1717 ++ netdev_err(netdev, "Max rx buffers = %llu\n",
1718 ++ adapter->max_tx_entries_per_subcrq);
1719 ++ return -EINVAL;
1720 ++ }
1721 ++
1722 + adapter->desired.rx_entries = ring->rx_pending;
1723 + adapter->desired.tx_entries = ring->tx_pending;
1724 +
1725 +- ret = wait_for_reset(adapter);
1726 +-
1727 +- if (!ret &&
1728 +- (adapter->req_rx_add_entries_per_subcrq != ring->rx_pending ||
1729 +- adapter->req_tx_entries_per_subcrq != ring->tx_pending))
1730 +- netdev_info(netdev,
1731 +- "Could not match full ringsize request. Requested: RX %d, TX %d; Allowed: RX %llu, TX %llu\n",
1732 +- ring->rx_pending, ring->tx_pending,
1733 +- adapter->req_rx_add_entries_per_subcrq,
1734 +- adapter->req_tx_entries_per_subcrq);
1735 +- return ret;
1736 ++ return wait_for_reset(adapter);
1737 + }
1738 +
1739 + static void ibmvnic_get_channels(struct net_device *netdev,
1740 +@@ -2708,14 +2702,8 @@ static void ibmvnic_get_channels(struct net_device *netdev,
1741 + {
1742 + struct ibmvnic_adapter *adapter = netdev_priv(netdev);
1743 +
1744 +- if (adapter->priv_flags & IBMVNIC_USE_SERVER_MAXES) {
1745 +- channels->max_rx = adapter->max_rx_queues;
1746 +- channels->max_tx = adapter->max_tx_queues;
1747 +- } else {
1748 +- channels->max_rx = IBMVNIC_MAX_QUEUES;
1749 +- channels->max_tx = IBMVNIC_MAX_QUEUES;
1750 +- }
1751 +-
1752 ++ channels->max_rx = adapter->max_rx_queues;
1753 ++ channels->max_tx = adapter->max_tx_queues;
1754 + channels->max_other = 0;
1755 + channels->max_combined = 0;
1756 + channels->rx_count = adapter->req_rx_queues;
1757 +@@ -2728,23 +2716,11 @@ static int ibmvnic_set_channels(struct net_device *netdev,
1758 + struct ethtool_channels *channels)
1759 + {
1760 + struct ibmvnic_adapter *adapter = netdev_priv(netdev);
1761 +- int ret;
1762 +
1763 +- ret = 0;
1764 + adapter->desired.rx_queues = channels->rx_count;
1765 + adapter->desired.tx_queues = channels->tx_count;
1766 +
1767 +- ret = wait_for_reset(adapter);
1768 +-
1769 +- if (!ret &&
1770 +- (adapter->req_rx_queues != channels->rx_count ||
1771 +- adapter->req_tx_queues != channels->tx_count))
1772 +- netdev_info(netdev,
1773 +- "Could not match full channels request. Requested: RX %d, TX %d; Allowed: RX %llu, TX %llu\n",
1774 +- channels->rx_count, channels->tx_count,
1775 +- adapter->req_rx_queues, adapter->req_tx_queues);
1776 +- return ret;
1777 +-
1778 ++ return wait_for_reset(adapter);
1779 + }
1780 +
1781 + static void ibmvnic_get_strings(struct net_device *dev, u32 stringset, u8 *data)
1782 +@@ -2752,43 +2728,32 @@ static void ibmvnic_get_strings(struct net_device *dev, u32 stringset, u8 *data)
1783 + struct ibmvnic_adapter *adapter = netdev_priv(dev);
1784 + int i;
1785 +
1786 +- switch (stringset) {
1787 +- case ETH_SS_STATS:
1788 +- for (i = 0; i < ARRAY_SIZE(ibmvnic_stats);
1789 +- i++, data += ETH_GSTRING_LEN)
1790 +- memcpy(data, ibmvnic_stats[i].name, ETH_GSTRING_LEN);
1791 ++ if (stringset != ETH_SS_STATS)
1792 ++ return;
1793 +
1794 +- for (i = 0; i < adapter->req_tx_queues; i++) {
1795 +- snprintf(data, ETH_GSTRING_LEN, "tx%d_packets", i);
1796 +- data += ETH_GSTRING_LEN;
1797 ++ for (i = 0; i < ARRAY_SIZE(ibmvnic_stats); i++, data += ETH_GSTRING_LEN)
1798 ++ memcpy(data, ibmvnic_stats[i].name, ETH_GSTRING_LEN);
1799 +
1800 +- snprintf(data, ETH_GSTRING_LEN, "tx%d_bytes", i);
1801 +- data += ETH_GSTRING_LEN;
1802 ++ for (i = 0; i < adapter->req_tx_queues; i++) {
1803 ++ snprintf(data, ETH_GSTRING_LEN, "tx%d_packets", i);
1804 ++ data += ETH_GSTRING_LEN;
1805 +
1806 +- snprintf(data, ETH_GSTRING_LEN,
1807 +- "tx%d_dropped_packets", i);
1808 +- data += ETH_GSTRING_LEN;
1809 +- }
1810 ++ snprintf(data, ETH_GSTRING_LEN, "tx%d_bytes", i);
1811 ++ data += ETH_GSTRING_LEN;
1812 +
1813 +- for (i = 0; i < adapter->req_rx_queues; i++) {
1814 +- snprintf(data, ETH_GSTRING_LEN, "rx%d_packets", i);
1815 +- data += ETH_GSTRING_LEN;
1816 ++ snprintf(data, ETH_GSTRING_LEN, "tx%d_dropped_packets", i);
1817 ++ data += ETH_GSTRING_LEN;
1818 ++ }
1819 +
1820 +- snprintf(data, ETH_GSTRING_LEN, "rx%d_bytes", i);
1821 +- data += ETH_GSTRING_LEN;
1822 ++ for (i = 0; i < adapter->req_rx_queues; i++) {
1823 ++ snprintf(data, ETH_GSTRING_LEN, "rx%d_packets", i);
1824 ++ data += ETH_GSTRING_LEN;
1825 +
1826 +- snprintf(data, ETH_GSTRING_LEN, "rx%d_interrupts", i);
1827 +- data += ETH_GSTRING_LEN;
1828 +- }
1829 +- break;
1830 ++ snprintf(data, ETH_GSTRING_LEN, "rx%d_bytes", i);
1831 ++ data += ETH_GSTRING_LEN;
1832 +
1833 +- case ETH_SS_PRIV_FLAGS:
1834 +- for (i = 0; i < ARRAY_SIZE(ibmvnic_priv_flags); i++)
1835 +- strcpy(data + i * ETH_GSTRING_LEN,
1836 +- ibmvnic_priv_flags[i]);
1837 +- break;
1838 +- default:
1839 +- return;
1840 ++ snprintf(data, ETH_GSTRING_LEN, "rx%d_interrupts", i);
1841 ++ data += ETH_GSTRING_LEN;
1842 + }
1843 + }
1844 +
1845 +@@ -2801,8 +2766,6 @@ static int ibmvnic_get_sset_count(struct net_device *dev, int sset)
1846 + return ARRAY_SIZE(ibmvnic_stats) +
1847 + adapter->req_tx_queues * NUM_TX_STATS +
1848 + adapter->req_rx_queues * NUM_RX_STATS;
1849 +- case ETH_SS_PRIV_FLAGS:
1850 +- return ARRAY_SIZE(ibmvnic_priv_flags);
1851 + default:
1852 + return -EOPNOTSUPP;
1853 + }
1854 +@@ -2833,8 +2796,8 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev,
1855 + return;
1856 +
1857 + for (i = 0; i < ARRAY_SIZE(ibmvnic_stats); i++)
1858 +- data[i] = be64_to_cpu(IBMVNIC_GET_STAT(adapter,
1859 +- ibmvnic_stats[i].offset));
1860 ++ data[i] = be64_to_cpu(IBMVNIC_GET_STAT
1861 ++ (adapter, ibmvnic_stats[i].offset));
1862 +
1863 + for (j = 0; j < adapter->req_tx_queues; j++) {
1864 + data[i] = adapter->tx_stats_buffers[j].packets;
1865 +@@ -2855,25 +2818,6 @@ static void ibmvnic_get_ethtool_stats(struct net_device *dev,
1866 + }
1867 + }
1868 +
1869 +-static u32 ibmvnic_get_priv_flags(struct net_device *netdev)
1870 +-{
1871 +- struct ibmvnic_adapter *adapter = netdev_priv(netdev);
1872 +-
1873 +- return adapter->priv_flags;
1874 +-}
1875 +-
1876 +-static int ibmvnic_set_priv_flags(struct net_device *netdev, u32 flags)
1877 +-{
1878 +- struct ibmvnic_adapter *adapter = netdev_priv(netdev);
1879 +- bool which_maxes = !!(flags & IBMVNIC_USE_SERVER_MAXES);
1880 +-
1881 +- if (which_maxes)
1882 +- adapter->priv_flags |= IBMVNIC_USE_SERVER_MAXES;
1883 +- else
1884 +- adapter->priv_flags &= ~IBMVNIC_USE_SERVER_MAXES;
1885 +-
1886 +- return 0;
1887 +-}
1888 + static const struct ethtool_ops ibmvnic_ethtool_ops = {
1889 + .get_drvinfo = ibmvnic_get_drvinfo,
1890 + .get_msglevel = ibmvnic_get_msglevel,
1891 +@@ -2887,8 +2831,6 @@ static const struct ethtool_ops ibmvnic_ethtool_ops = {
1892 + .get_sset_count = ibmvnic_get_sset_count,
1893 + .get_ethtool_stats = ibmvnic_get_ethtool_stats,
1894 + .get_link_ksettings = ibmvnic_get_link_ksettings,
1895 +- .get_priv_flags = ibmvnic_get_priv_flags,
1896 +- .set_priv_flags = ibmvnic_set_priv_flags,
1897 + };
1898 +
1899 + /* Routines for managing CRQs/sCRQs */
1900 +@@ -3119,7 +3061,7 @@ static int enable_scrq_irq(struct ibmvnic_adapter *adapter,
1901 + /* H_EOI would fail with rc = H_FUNCTION when running
1902 + * in XIVE mode which is expected, but not an error.
1903 + */
1904 +- if (rc && (rc != H_FUNCTION))
1905 ++ if (rc && rc != H_FUNCTION)
1906 + dev_err(dev, "H_EOI FAILED irq 0x%llx. rc=%ld\n",
1907 + val, rc);
1908 + }
1909 +diff --git a/drivers/net/ethernet/ibm/ibmvnic.h b/drivers/net/ethernet/ibm/ibmvnic.h
1910 +index b27211063c643..2eb9a4d5533ab 100644
1911 +--- a/drivers/net/ethernet/ibm/ibmvnic.h
1912 ++++ b/drivers/net/ethernet/ibm/ibmvnic.h
1913 +@@ -41,11 +41,6 @@
1914 +
1915 + #define IBMVNIC_RESET_DELAY 100
1916 +
1917 +-static const char ibmvnic_priv_flags[][ETH_GSTRING_LEN] = {
1918 +-#define IBMVNIC_USE_SERVER_MAXES 0x1
1919 +- "use-server-maxes"
1920 +-};
1921 +-
1922 + struct ibmvnic_login_buffer {
1923 + __be32 len;
1924 + __be32 version;
1925 +@@ -974,7 +969,6 @@ struct ibmvnic_adapter {
1926 + struct ibmvnic_control_ip_offload_buffer ip_offload_ctrl;
1927 + dma_addr_t ip_offload_ctrl_tok;
1928 + u32 msg_enable;
1929 +- u32 priv_flags;
1930 +
1931 + /* Vital Product Data (VPD) */
1932 + struct ibmvnic_vpd *vpd;
1933 +diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
1934 +index 54d47265a7ac1..319620856cba1 100644
1935 +--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
1936 ++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c
1937 +@@ -903,7 +903,8 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf)
1938 + /* Tx IPsec offload doesn't seem to work on this
1939 + * device, so block these requests for now.
1940 + */
1941 +- if (!(sam->flags & XFRM_OFFLOAD_INBOUND)) {
1942 ++ sam->flags = sam->flags & ~XFRM_OFFLOAD_IPV6;
1943 ++ if (sam->flags != XFRM_OFFLOAD_INBOUND) {
1944 + err = -EOPNOTSUPP;
1945 + goto err_out;
1946 + }
1947 +diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
1948 +index 8bb0106cb7ea3..142bf912011e2 100644
1949 +--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
1950 ++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c
1951 +@@ -65,8 +65,9 @@ static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed)
1952 + struct phy_device *phy_dev = ndev->phydev;
1953 + u32 val;
1954 +
1955 +- writew(SGMII_ADAPTER_DISABLE,
1956 +- sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG);
1957 ++ if (sgmii_adapter_base)
1958 ++ writew(SGMII_ADAPTER_DISABLE,
1959 ++ sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG);
1960 +
1961 + if (splitter_base) {
1962 + val = readl(splitter_base + EMAC_SPLITTER_CTRL_REG);
1963 +@@ -88,10 +89,11 @@ static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed)
1964 + writel(val, splitter_base + EMAC_SPLITTER_CTRL_REG);
1965 + }
1966 +
1967 +- writew(SGMII_ADAPTER_ENABLE,
1968 +- sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG);
1969 +- if (phy_dev)
1970 ++ if (phy_dev && sgmii_adapter_base) {
1971 ++ writew(SGMII_ADAPTER_ENABLE,
1972 ++ sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG);
1973 + tse_pcs_fix_mac_speed(&dwmac->pcs, phy_dev, speed);
1974 ++ }
1975 + }
1976 +
1977 + static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *dev)
1978 +diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c
1979 +index 22010384c4a33..b9646b369f8e7 100644
1980 +--- a/drivers/net/hippi/rrunner.c
1981 ++++ b/drivers/net/hippi/rrunner.c
1982 +@@ -1353,7 +1353,9 @@ static int rr_close(struct net_device *dev)
1983 +
1984 + rrpriv->fw_running = 0;
1985 +
1986 ++ spin_unlock_irqrestore(&rrpriv->lock, flags);
1987 + del_timer_sync(&rrpriv->timer);
1988 ++ spin_lock_irqsave(&rrpriv->lock, flags);
1989 +
1990 + writel(0, &regs->TxPi);
1991 + writel(0, &regs->IpRxPi);
1992 +diff --git a/drivers/net/phy/marvell10g.c b/drivers/net/phy/marvell10g.c
1993 +index b1bb9b8e1e4ed..2b64318efdba6 100644
1994 +--- a/drivers/net/phy/marvell10g.c
1995 ++++ b/drivers/net/phy/marvell10g.c
1996 +@@ -650,7 +650,7 @@ static int mv3310_read_status_copper(struct phy_device *phydev)
1997 +
1998 + cssr1 = phy_read_mmd(phydev, MDIO_MMD_PCS, MV_PCS_CSSR1);
1999 + if (cssr1 < 0)
2000 +- return val;
2001 ++ return cssr1;
2002 +
2003 + /* If the link settings are not resolved, mark the link down */
2004 + if (!(cssr1 & MV_PCS_CSSR1_RESOLVED)) {
2005 +diff --git a/drivers/net/wireguard/device.c b/drivers/net/wireguard/device.c
2006 +index e189eb95678d8..e0693cd965ec4 100644
2007 +--- a/drivers/net/wireguard/device.c
2008 ++++ b/drivers/net/wireguard/device.c
2009 +@@ -19,6 +19,7 @@
2010 + #include <linux/if_arp.h>
2011 + #include <linux/icmp.h>
2012 + #include <linux/suspend.h>
2013 ++#include <net/dst_metadata.h>
2014 + #include <net/icmp.h>
2015 + #include <net/rtnetlink.h>
2016 + #include <net/ip_tunnels.h>
2017 +@@ -152,7 +153,7 @@ static netdev_tx_t wg_xmit(struct sk_buff *skb, struct net_device *dev)
2018 + goto err_peer;
2019 + }
2020 +
2021 +- mtu = skb_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
2022 ++ mtu = skb_valid_dst(skb) ? dst_mtu(skb_dst(skb)) : dev->mtu;
2023 +
2024 + __skb_queue_head_init(&packets);
2025 + if (!skb_is_gso(skb)) {
2026 +diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c
2027 +index 5172971f4c360..3cd4d51c247c3 100644
2028 +--- a/drivers/phy/motorola/phy-mapphone-mdm6600.c
2029 ++++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c
2030 +@@ -629,7 +629,8 @@ idle:
2031 + cleanup:
2032 + if (error < 0)
2033 + phy_mdm6600_device_power_off(ddata);
2034 +-
2035 ++ pm_runtime_disable(ddata->dev);
2036 ++ pm_runtime_dont_use_autosuspend(ddata->dev);
2037 + return error;
2038 + }
2039 +
2040 +diff --git a/drivers/phy/samsung/phy-exynos5250-sata.c b/drivers/phy/samsung/phy-exynos5250-sata.c
2041 +index 4dd7324d91b26..ea46576404b8e 100644
2042 +--- a/drivers/phy/samsung/phy-exynos5250-sata.c
2043 ++++ b/drivers/phy/samsung/phy-exynos5250-sata.c
2044 +@@ -190,6 +190,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
2045 + return -EINVAL;
2046 +
2047 + sata_phy->client = of_find_i2c_device_by_node(node);
2048 ++ of_node_put(node);
2049 + if (!sata_phy->client)
2050 + return -EPROBE_DEFER;
2051 +
2052 +@@ -198,20 +199,21 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
2053 + sata_phy->phyclk = devm_clk_get(dev, "sata_phyctrl");
2054 + if (IS_ERR(sata_phy->phyclk)) {
2055 + dev_err(dev, "failed to get clk for PHY\n");
2056 +- return PTR_ERR(sata_phy->phyclk);
2057 ++ ret = PTR_ERR(sata_phy->phyclk);
2058 ++ goto put_dev;
2059 + }
2060 +
2061 + ret = clk_prepare_enable(sata_phy->phyclk);
2062 + if (ret < 0) {
2063 + dev_err(dev, "failed to enable source clk\n");
2064 +- return ret;
2065 ++ goto put_dev;
2066 + }
2067 +
2068 + sata_phy->phy = devm_phy_create(dev, NULL, &exynos_sata_phy_ops);
2069 + if (IS_ERR(sata_phy->phy)) {
2070 +- clk_disable_unprepare(sata_phy->phyclk);
2071 + dev_err(dev, "failed to create PHY\n");
2072 +- return PTR_ERR(sata_phy->phy);
2073 ++ ret = PTR_ERR(sata_phy->phy);
2074 ++ goto clk_disable;
2075 + }
2076 +
2077 + phy_set_drvdata(sata_phy->phy, sata_phy);
2078 +@@ -219,11 +221,18 @@ static int exynos_sata_phy_probe(struct platform_device *pdev)
2079 + phy_provider = devm_of_phy_provider_register(dev,
2080 + of_phy_simple_xlate);
2081 + if (IS_ERR(phy_provider)) {
2082 +- clk_disable_unprepare(sata_phy->phyclk);
2083 +- return PTR_ERR(phy_provider);
2084 ++ ret = PTR_ERR(phy_provider);
2085 ++ goto clk_disable;
2086 + }
2087 +
2088 + return 0;
2089 ++
2090 ++clk_disable:
2091 ++ clk_disable_unprepare(sata_phy->phyclk);
2092 ++put_dev:
2093 ++ put_device(&sata_phy->client->dev);
2094 ++
2095 ++ return ret;
2096 + }
2097 +
2098 + static const struct of_device_id exynos_sata_phy_of_match[] = {
2099 +diff --git a/drivers/phy/ti/phy-am654-serdes.c b/drivers/phy/ti/phy-am654-serdes.c
2100 +index 2ff56ce77b307..21c0088f5ca9e 100644
2101 +--- a/drivers/phy/ti/phy-am654-serdes.c
2102 ++++ b/drivers/phy/ti/phy-am654-serdes.c
2103 +@@ -838,7 +838,7 @@ static int serdes_am654_probe(struct platform_device *pdev)
2104 +
2105 + clk_err:
2106 + of_clk_del_provider(node);
2107 +-
2108 ++ pm_runtime_disable(dev);
2109 + return ret;
2110 + }
2111 +
2112 +diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c
2113 +index 4fec90d2624ff..f77ac041d8368 100644
2114 +--- a/drivers/phy/ti/phy-omap-usb2.c
2115 ++++ b/drivers/phy/ti/phy-omap-usb2.c
2116 +@@ -215,7 +215,7 @@ static int omap_usb2_enable_clocks(struct omap_usb *phy)
2117 + return 0;
2118 +
2119 + err1:
2120 +- clk_disable(phy->wkupclk);
2121 ++ clk_disable_unprepare(phy->wkupclk);
2122 +
2123 + err0:
2124 + return ret;
2125 +diff --git a/drivers/pinctrl/mediatek/Kconfig b/drivers/pinctrl/mediatek/Kconfig
2126 +index eef17f2286694..4ed41d361589b 100644
2127 +--- a/drivers/pinctrl/mediatek/Kconfig
2128 ++++ b/drivers/pinctrl/mediatek/Kconfig
2129 +@@ -30,6 +30,7 @@ config PINCTRL_MTK_MOORE
2130 + select GENERIC_PINMUX_FUNCTIONS
2131 + select GPIOLIB
2132 + select OF_GPIO
2133 ++ select EINT_MTK
2134 + select PINCTRL_MTK_V2
2135 +
2136 + config PINCTRL_MTK_PARIS
2137 +diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c
2138 +index ec761ba2a2da8..989a37fb402d1 100644
2139 +--- a/drivers/pinctrl/pinctrl-pistachio.c
2140 ++++ b/drivers/pinctrl/pinctrl-pistachio.c
2141 +@@ -1374,10 +1374,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl)
2142 + }
2143 +
2144 + irq = irq_of_parse_and_map(child, 0);
2145 +- if (irq < 0) {
2146 +- dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq);
2147 ++ if (!irq) {
2148 ++ dev_err(pctl->dev, "No IRQ for bank %u\n", i);
2149 + of_node_put(child);
2150 +- ret = irq;
2151 ++ ret = -EINVAL;
2152 + goto err;
2153 + }
2154 +
2155 +diff --git a/drivers/pinctrl/pinctrl-rockchip.c b/drivers/pinctrl/pinctrl-rockchip.c
2156 +index 9df48e0cf4cb4..07b1204174bf1 100644
2157 +--- a/drivers/pinctrl/pinctrl-rockchip.c
2158 ++++ b/drivers/pinctrl/pinctrl-rockchip.c
2159 +@@ -663,95 +663,110 @@ static struct rockchip_mux_recalced_data rk3128_mux_recalced_data[] = {
2160 +
2161 + static struct rockchip_mux_recalced_data rk3308_mux_recalced_data[] = {
2162 + {
2163 ++ /* gpio1b6_sel */
2164 + .num = 1,
2165 + .pin = 14,
2166 + .reg = 0x28,
2167 + .bit = 12,
2168 + .mask = 0xf
2169 + }, {
2170 ++ /* gpio1b7_sel */
2171 + .num = 1,
2172 + .pin = 15,
2173 + .reg = 0x2c,
2174 + .bit = 0,
2175 + .mask = 0x3
2176 + }, {
2177 ++ /* gpio1c2_sel */
2178 + .num = 1,
2179 + .pin = 18,
2180 + .reg = 0x30,
2181 + .bit = 4,
2182 + .mask = 0xf
2183 + }, {
2184 ++ /* gpio1c3_sel */
2185 + .num = 1,
2186 + .pin = 19,
2187 + .reg = 0x30,
2188 + .bit = 8,
2189 + .mask = 0xf
2190 + }, {
2191 ++ /* gpio1c4_sel */
2192 + .num = 1,
2193 + .pin = 20,
2194 + .reg = 0x30,
2195 + .bit = 12,
2196 + .mask = 0xf
2197 + }, {
2198 ++ /* gpio1c5_sel */
2199 + .num = 1,
2200 + .pin = 21,
2201 + .reg = 0x34,
2202 + .bit = 0,
2203 + .mask = 0xf
2204 + }, {
2205 ++ /* gpio1c6_sel */
2206 + .num = 1,
2207 + .pin = 22,
2208 + .reg = 0x34,
2209 + .bit = 4,
2210 + .mask = 0xf
2211 + }, {
2212 ++ /* gpio1c7_sel */
2213 + .num = 1,
2214 + .pin = 23,
2215 + .reg = 0x34,
2216 + .bit = 8,
2217 + .mask = 0xf
2218 + }, {
2219 ++ /* gpio3b4_sel */
2220 + .num = 3,
2221 + .pin = 12,
2222 + .reg = 0x68,
2223 + .bit = 8,
2224 + .mask = 0xf
2225 + }, {
2226 ++ /* gpio3b5_sel */
2227 + .num = 3,
2228 + .pin = 13,
2229 + .reg = 0x68,
2230 + .bit = 12,
2231 + .mask = 0xf
2232 + }, {
2233 ++ /* gpio2a2_sel */
2234 + .num = 2,
2235 + .pin = 2,
2236 +- .reg = 0x608,
2237 +- .bit = 0,
2238 +- .mask = 0x7
2239 ++ .reg = 0x40,
2240 ++ .bit = 4,
2241 ++ .mask = 0x3
2242 + }, {
2243 ++ /* gpio2a3_sel */
2244 + .num = 2,
2245 + .pin = 3,
2246 +- .reg = 0x608,
2247 +- .bit = 4,
2248 +- .mask = 0x7
2249 ++ .reg = 0x40,
2250 ++ .bit = 6,
2251 ++ .mask = 0x3
2252 + }, {
2253 ++ /* gpio2c0_sel */
2254 + .num = 2,
2255 + .pin = 16,
2256 +- .reg = 0x610,
2257 +- .bit = 8,
2258 +- .mask = 0x7
2259 ++ .reg = 0x50,
2260 ++ .bit = 0,
2261 ++ .mask = 0x3
2262 + }, {
2263 ++ /* gpio3b2_sel */
2264 + .num = 3,
2265 + .pin = 10,
2266 +- .reg = 0x610,
2267 +- .bit = 0,
2268 +- .mask = 0x7
2269 ++ .reg = 0x68,
2270 ++ .bit = 4,
2271 ++ .mask = 0x3
2272 + }, {
2273 ++ /* gpio3b3_sel */
2274 + .num = 3,
2275 + .pin = 11,
2276 +- .reg = 0x610,
2277 +- .bit = 4,
2278 +- .mask = 0x7
2279 ++ .reg = 0x68,
2280 ++ .bit = 6,
2281 ++ .mask = 0x3
2282 + },
2283 + };
2284 +
2285 +diff --git a/drivers/pinctrl/samsung/Kconfig b/drivers/pinctrl/samsung/Kconfig
2286 +index dfd805e768624..7b0576f71376e 100644
2287 +--- a/drivers/pinctrl/samsung/Kconfig
2288 ++++ b/drivers/pinctrl/samsung/Kconfig
2289 +@@ -4,14 +4,13 @@
2290 + #
2291 + config PINCTRL_SAMSUNG
2292 + bool
2293 +- depends on OF_GPIO
2294 ++ select GPIOLIB
2295 + select PINMUX
2296 + select PINCONF
2297 +
2298 + config PINCTRL_EXYNOS
2299 + bool "Pinctrl common driver part for Samsung Exynos SoCs"
2300 +- depends on OF_GPIO
2301 +- depends on ARCH_EXYNOS || ARCH_S5PV210 || COMPILE_TEST
2302 ++ depends on ARCH_EXYNOS || ARCH_S5PV210 || (COMPILE_TEST && OF)
2303 + select PINCTRL_SAMSUNG
2304 + select PINCTRL_EXYNOS_ARM if ARM && (ARCH_EXYNOS || ARCH_S5PV210)
2305 + select PINCTRL_EXYNOS_ARM64 if ARM64 && ARCH_EXYNOS
2306 +@@ -26,12 +25,10 @@ config PINCTRL_EXYNOS_ARM64
2307 +
2308 + config PINCTRL_S3C24XX
2309 + bool "Samsung S3C24XX SoC pinctrl driver"
2310 +- depends on OF_GPIO
2311 +- depends on ARCH_S3C24XX || COMPILE_TEST
2312 ++ depends on ARCH_S3C24XX || (COMPILE_TEST && OF)
2313 + select PINCTRL_SAMSUNG
2314 +
2315 + config PINCTRL_S3C64XX
2316 + bool "Samsung S3C64XX SoC pinctrl driver"
2317 +- depends on OF_GPIO
2318 +- depends on ARCH_S3C64XX || COMPILE_TEST
2319 ++ depends on ARCH_S3C64XX || (COMPILE_TEST && OF)
2320 + select PINCTRL_SAMSUNG
2321 +diff --git a/drivers/pinctrl/stm32/pinctrl-stm32.c b/drivers/pinctrl/stm32/pinctrl-stm32.c
2322 +index e13723bb2be41..b017dd400c460 100644
2323 +--- a/drivers/pinctrl/stm32/pinctrl-stm32.c
2324 ++++ b/drivers/pinctrl/stm32/pinctrl-stm32.c
2325 +@@ -225,6 +225,13 @@ static void stm32_gpio_free(struct gpio_chip *chip, unsigned offset)
2326 + pinctrl_gpio_free(chip->base + offset);
2327 + }
2328 +
2329 ++static int stm32_gpio_get_noclk(struct gpio_chip *chip, unsigned int offset)
2330 ++{
2331 ++ struct stm32_gpio_bank *bank = gpiochip_get_data(chip);
2332 ++
2333 ++ return !!(readl_relaxed(bank->base + STM32_GPIO_IDR) & BIT(offset));
2334 ++}
2335 ++
2336 + static int stm32_gpio_get(struct gpio_chip *chip, unsigned offset)
2337 + {
2338 + struct stm32_gpio_bank *bank = gpiochip_get_data(chip);
2339 +@@ -232,7 +239,7 @@ static int stm32_gpio_get(struct gpio_chip *chip, unsigned offset)
2340 +
2341 + clk_enable(bank->clk);
2342 +
2343 +- ret = !!(readl_relaxed(bank->base + STM32_GPIO_IDR) & BIT(offset));
2344 ++ ret = stm32_gpio_get_noclk(chip, offset);
2345 +
2346 + clk_disable(bank->clk);
2347 +
2348 +@@ -311,8 +318,12 @@ static void stm32_gpio_irq_trigger(struct irq_data *d)
2349 + struct stm32_gpio_bank *bank = d->domain->host_data;
2350 + int level;
2351 +
2352 ++ /* Do not access the GPIO if this is not LEVEL triggered IRQ. */
2353 ++ if (!(bank->irq_type[d->hwirq] & IRQ_TYPE_LEVEL_MASK))
2354 ++ return;
2355 ++
2356 + /* If level interrupt type then retrig */
2357 +- level = stm32_gpio_get(&bank->gpio_chip, d->hwirq);
2358 ++ level = stm32_gpio_get_noclk(&bank->gpio_chip, d->hwirq);
2359 + if ((level == 0 && bank->irq_type[d->hwirq] == IRQ_TYPE_LEVEL_LOW) ||
2360 + (level == 1 && bank->irq_type[d->hwirq] == IRQ_TYPE_LEVEL_HIGH))
2361 + irq_chip_retrigger_hierarchy(d);
2362 +@@ -354,6 +365,7 @@ static int stm32_gpio_irq_request_resources(struct irq_data *irq_data)
2363 + {
2364 + struct stm32_gpio_bank *bank = irq_data->domain->host_data;
2365 + struct stm32_pinctrl *pctl = dev_get_drvdata(bank->gpio_chip.parent);
2366 ++ unsigned long flags;
2367 + int ret;
2368 +
2369 + ret = stm32_gpio_direction_input(&bank->gpio_chip, irq_data->hwirq);
2370 +@@ -367,6 +379,10 @@ static int stm32_gpio_irq_request_resources(struct irq_data *irq_data)
2371 + return ret;
2372 + }
2373 +
2374 ++ flags = irqd_get_trigger_type(irq_data);
2375 ++ if (flags & IRQ_TYPE_LEVEL_MASK)
2376 ++ clk_enable(bank->clk);
2377 ++
2378 + return 0;
2379 + }
2380 +
2381 +@@ -374,6 +390,9 @@ static void stm32_gpio_irq_release_resources(struct irq_data *irq_data)
2382 + {
2383 + struct stm32_gpio_bank *bank = irq_data->domain->host_data;
2384 +
2385 ++ if (bank->irq_type[irq_data->hwirq] & IRQ_TYPE_LEVEL_MASK)
2386 ++ clk_disable(bank->clk);
2387 ++
2388 + gpiochip_unlock_as_irq(&bank->gpio_chip, irq_data->hwirq);
2389 + }
2390 +
2391 +diff --git a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
2392 +index 72a26867c2092..28913867cd4bc 100644
2393 +--- a/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
2394 ++++ b/drivers/thermal/intel/int340x_thermal/int3400_thermal.c
2395 +@@ -67,7 +67,7 @@ static int evaluate_odvp(struct int3400_thermal_priv *priv);
2396 + struct odvp_attr {
2397 + int odvp;
2398 + struct int3400_thermal_priv *priv;
2399 +- struct kobj_attribute attr;
2400 ++ struct device_attribute attr;
2401 + };
2402 +
2403 + static ssize_t data_vault_read(struct file *file, struct kobject *kobj,
2404 +@@ -269,7 +269,7 @@ static int int3400_thermal_run_osc(acpi_handle handle,
2405 + return result;
2406 + }
2407 +
2408 +-static ssize_t odvp_show(struct kobject *kobj, struct kobj_attribute *attr,
2409 ++static ssize_t odvp_show(struct device *dev, struct device_attribute *attr,
2410 + char *buf)
2411 + {
2412 + struct odvp_attr *odvp_attr;
2413 +diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
2414 +index 05562b3cca451..aafc3bb60e52a 100644
2415 +--- a/drivers/tty/n_gsm.c
2416 ++++ b/drivers/tty/n_gsm.c
2417 +@@ -72,6 +72,8 @@ module_param(debug, int, 0600);
2418 + */
2419 + #define MAX_MRU 1500
2420 + #define MAX_MTU 1500
2421 ++/* SOF, ADDR, CTRL, LEN1, LEN2, ..., FCS, EOF */
2422 ++#define PROT_OVERHEAD 7
2423 + #define GSM_NET_TX_TIMEOUT (HZ*10)
2424 +
2425 + /**
2426 +@@ -230,6 +232,7 @@ struct gsm_mux {
2427 + int initiator; /* Did we initiate connection */
2428 + bool dead; /* Has the mux been shut down */
2429 + struct gsm_dlci *dlci[NUM_DLCI];
2430 ++ int old_c_iflag; /* termios c_iflag value before attach */
2431 + bool constipated; /* Asked by remote to shut up */
2432 +
2433 + spinlock_t tx_lock;
2434 +@@ -818,7 +821,7 @@ static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci)
2435 + break;
2436 + case 2: /* Unstructed with modem bits.
2437 + Always one byte as we never send inline break data */
2438 +- *dp++ = gsm_encode_modem(dlci);
2439 ++ *dp++ = (gsm_encode_modem(dlci) << 1) | EA;
2440 + break;
2441 + }
2442 + WARN_ON(kfifo_out_locked(&dlci->fifo, dp , len, &dlci->lock) != len);
2443 +@@ -1295,11 +1298,12 @@ static void gsm_control_response(struct gsm_mux *gsm, unsigned int command,
2444 +
2445 + static void gsm_control_transmit(struct gsm_mux *gsm, struct gsm_control *ctrl)
2446 + {
2447 +- struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 1, gsm->ftype);
2448 ++ struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 2, gsm->ftype);
2449 + if (msg == NULL)
2450 + return;
2451 +- msg->data[0] = (ctrl->cmd << 1) | 2 | EA; /* command */
2452 +- memcpy(msg->data + 1, ctrl->data, ctrl->len);
2453 ++ msg->data[0] = (ctrl->cmd << 1) | CR | EA; /* command */
2454 ++ msg->data[1] = (ctrl->len << 1) | EA;
2455 ++ memcpy(msg->data + 2, ctrl->data, ctrl->len);
2456 + gsm_data_queue(gsm->dlci[0], msg);
2457 + }
2458 +
2459 +@@ -1322,7 +1326,6 @@ static void gsm_control_retransmit(struct timer_list *t)
2460 + spin_lock_irqsave(&gsm->control_lock, flags);
2461 + ctrl = gsm->pending_cmd;
2462 + if (ctrl) {
2463 +- gsm->cretries--;
2464 + if (gsm->cretries == 0) {
2465 + gsm->pending_cmd = NULL;
2466 + ctrl->error = -ETIMEDOUT;
2467 +@@ -1331,6 +1334,7 @@ static void gsm_control_retransmit(struct timer_list *t)
2468 + wake_up(&gsm->event);
2469 + return;
2470 + }
2471 ++ gsm->cretries--;
2472 + gsm_control_transmit(gsm, ctrl);
2473 + mod_timer(&gsm->t2_timer, jiffies + gsm->t2 * HZ / 100);
2474 + }
2475 +@@ -1371,7 +1375,7 @@ retry:
2476 +
2477 + /* If DLCI0 is in ADM mode skip retries, it won't respond */
2478 + if (gsm->dlci[0]->mode == DLCI_MODE_ADM)
2479 +- gsm->cretries = 1;
2480 ++ gsm->cretries = 0;
2481 + else
2482 + gsm->cretries = gsm->n2;
2483 +
2484 +@@ -1419,13 +1423,17 @@ static int gsm_control_wait(struct gsm_mux *gsm, struct gsm_control *control)
2485 +
2486 + static void gsm_dlci_close(struct gsm_dlci *dlci)
2487 + {
2488 ++ unsigned long flags;
2489 ++
2490 + del_timer(&dlci->t1);
2491 + if (debug & 8)
2492 + pr_debug("DLCI %d goes closed.\n", dlci->addr);
2493 + dlci->state = DLCI_CLOSED;
2494 + if (dlci->addr != 0) {
2495 + tty_port_tty_hangup(&dlci->port, false);
2496 ++ spin_lock_irqsave(&dlci->lock, flags);
2497 + kfifo_reset(&dlci->fifo);
2498 ++ spin_unlock_irqrestore(&dlci->lock, flags);
2499 + /* Ensure that gsmtty_open() can return. */
2500 + tty_port_set_initialized(&dlci->port, 0);
2501 + wake_up_interruptible(&dlci->port.open_wait);
2502 +@@ -1810,7 +1818,6 @@ static void gsm_queue(struct gsm_mux *gsm)
2503 + gsm_response(gsm, address, UA);
2504 + gsm_dlci_close(dlci);
2505 + break;
2506 +- case UA:
2507 + case UA|PF:
2508 + if (cr == 0 || dlci == NULL)
2509 + break;
2510 +@@ -1954,6 +1961,16 @@ static void gsm0_receive(struct gsm_mux *gsm, unsigned char c)
2511 +
2512 + static void gsm1_receive(struct gsm_mux *gsm, unsigned char c)
2513 + {
2514 ++ /* handle XON/XOFF */
2515 ++ if ((c & ISO_IEC_646_MASK) == XON) {
2516 ++ gsm->constipated = true;
2517 ++ return;
2518 ++ } else if ((c & ISO_IEC_646_MASK) == XOFF) {
2519 ++ gsm->constipated = false;
2520 ++ /* Kick the link in case it is idling */
2521 ++ gsm_data_kick(gsm, NULL);
2522 ++ return;
2523 ++ }
2524 + if (c == GSM1_SOF) {
2525 + /* EOF is only valid in frame if we have got to the data state
2526 + and received at least one byte (the FCS) */
2527 +@@ -1968,7 +1985,8 @@ static void gsm1_receive(struct gsm_mux *gsm, unsigned char c)
2528 + }
2529 + /* Any partial frame was a runt so go back to start */
2530 + if (gsm->state != GSM_START) {
2531 +- gsm->malformed++;
2532 ++ if (gsm->state != GSM_SEARCH)
2533 ++ gsm->malformed++;
2534 + gsm->state = GSM_START;
2535 + }
2536 + /* A SOF in GSM_START means we are still reading idling or
2537 +@@ -2040,74 +2058,43 @@ static void gsm_error(struct gsm_mux *gsm,
2538 + gsm->io_error++;
2539 + }
2540 +
2541 +-static int gsm_disconnect(struct gsm_mux *gsm)
2542 +-{
2543 +- struct gsm_dlci *dlci = gsm->dlci[0];
2544 +- struct gsm_control *gc;
2545 +-
2546 +- if (!dlci)
2547 +- return 0;
2548 +-
2549 +- /* In theory disconnecting DLCI 0 is sufficient but for some
2550 +- modems this is apparently not the case. */
2551 +- gc = gsm_control_send(gsm, CMD_CLD, NULL, 0);
2552 +- if (gc)
2553 +- gsm_control_wait(gsm, gc);
2554 +-
2555 +- del_timer_sync(&gsm->t2_timer);
2556 +- /* Now we are sure T2 has stopped */
2557 +-
2558 +- gsm_dlci_begin_close(dlci);
2559 +- wait_event_interruptible(gsm->event,
2560 +- dlci->state == DLCI_CLOSED);
2561 +-
2562 +- if (signal_pending(current))
2563 +- return -EINTR;
2564 +-
2565 +- return 0;
2566 +-}
2567 +-
2568 + /**
2569 + * gsm_cleanup_mux - generic GSM protocol cleanup
2570 + * @gsm: our mux
2571 ++ * @disc: disconnect link?
2572 + *
2573 + * Clean up the bits of the mux which are the same for all framing
2574 + * protocols. Remove the mux from the mux table, stop all the timers
2575 + * and then shut down each device hanging up the channels as we go.
2576 + */
2577 +
2578 +-static void gsm_cleanup_mux(struct gsm_mux *gsm)
2579 ++static void gsm_cleanup_mux(struct gsm_mux *gsm, bool disc)
2580 + {
2581 + int i;
2582 + struct gsm_dlci *dlci = gsm->dlci[0];
2583 + struct gsm_msg *txq, *ntxq;
2584 +
2585 + gsm->dead = true;
2586 ++ mutex_lock(&gsm->mutex);
2587 +
2588 +- spin_lock(&gsm_mux_lock);
2589 +- for (i = 0; i < MAX_MUX; i++) {
2590 +- if (gsm_mux[i] == gsm) {
2591 +- gsm_mux[i] = NULL;
2592 +- break;
2593 ++ if (dlci) {
2594 ++ if (disc && dlci->state != DLCI_CLOSED) {
2595 ++ gsm_dlci_begin_close(dlci);
2596 ++ wait_event(gsm->event, dlci->state == DLCI_CLOSED);
2597 + }
2598 ++ dlci->dead = true;
2599 + }
2600 +- spin_unlock(&gsm_mux_lock);
2601 +- /* open failed before registering => nothing to do */
2602 +- if (i == MAX_MUX)
2603 +- return;
2604 +
2605 ++ /* Finish outstanding timers, making sure they are done */
2606 + del_timer_sync(&gsm->t2_timer);
2607 +- /* Now we are sure T2 has stopped */
2608 +- if (dlci)
2609 +- dlci->dead = true;
2610 +
2611 +- /* Free up any link layer users */
2612 +- mutex_lock(&gsm->mutex);
2613 +- for (i = 0; i < NUM_DLCI; i++)
2614 ++ /* Free up any link layer users and finally the control channel */
2615 ++ for (i = NUM_DLCI - 1; i >= 0; i--)
2616 + if (gsm->dlci[i])
2617 + gsm_dlci_release(gsm->dlci[i]);
2618 + mutex_unlock(&gsm->mutex);
2619 + /* Now wipe the queues */
2620 ++ tty_ldisc_flush(gsm->tty);
2621 + list_for_each_entry_safe(txq, ntxq, &gsm->tx_list, list)
2622 + kfree(txq);
2623 + INIT_LIST_HEAD(&gsm->tx_list);
2624 +@@ -2125,7 +2112,6 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm)
2625 + static int gsm_activate_mux(struct gsm_mux *gsm)
2626 + {
2627 + struct gsm_dlci *dlci;
2628 +- int i = 0;
2629 +
2630 + timer_setup(&gsm->t2_timer, gsm_control_retransmit, 0);
2631 + init_waitqueue_head(&gsm->event);
2632 +@@ -2137,18 +2123,6 @@ static int gsm_activate_mux(struct gsm_mux *gsm)
2633 + else
2634 + gsm->receive = gsm1_receive;
2635 +
2636 +- spin_lock(&gsm_mux_lock);
2637 +- for (i = 0; i < MAX_MUX; i++) {
2638 +- if (gsm_mux[i] == NULL) {
2639 +- gsm->num = i;
2640 +- gsm_mux[i] = gsm;
2641 +- break;
2642 +- }
2643 +- }
2644 +- spin_unlock(&gsm_mux_lock);
2645 +- if (i == MAX_MUX)
2646 +- return -EBUSY;
2647 +-
2648 + dlci = gsm_dlci_alloc(gsm, 0);
2649 + if (dlci == NULL)
2650 + return -ENOMEM;
2651 +@@ -2164,6 +2138,15 @@ static int gsm_activate_mux(struct gsm_mux *gsm)
2652 + */
2653 + static void gsm_free_mux(struct gsm_mux *gsm)
2654 + {
2655 ++ int i;
2656 ++
2657 ++ for (i = 0; i < MAX_MUX; i++) {
2658 ++ if (gsm == gsm_mux[i]) {
2659 ++ gsm_mux[i] = NULL;
2660 ++ break;
2661 ++ }
2662 ++ }
2663 ++ mutex_destroy(&gsm->mutex);
2664 + kfree(gsm->txframe);
2665 + kfree(gsm->buf);
2666 + kfree(gsm);
2667 +@@ -2183,12 +2166,20 @@ static void gsm_free_muxr(struct kref *ref)
2668 +
2669 + static inline void mux_get(struct gsm_mux *gsm)
2670 + {
2671 ++ unsigned long flags;
2672 ++
2673 ++ spin_lock_irqsave(&gsm_mux_lock, flags);
2674 + kref_get(&gsm->ref);
2675 ++ spin_unlock_irqrestore(&gsm_mux_lock, flags);
2676 + }
2677 +
2678 + static inline void mux_put(struct gsm_mux *gsm)
2679 + {
2680 ++ unsigned long flags;
2681 ++
2682 ++ spin_lock_irqsave(&gsm_mux_lock, flags);
2683 + kref_put(&gsm->ref, gsm_free_muxr);
2684 ++ spin_unlock_irqrestore(&gsm_mux_lock, flags);
2685 + }
2686 +
2687 + static inline unsigned int mux_num_to_base(struct gsm_mux *gsm)
2688 +@@ -2209,6 +2200,7 @@ static inline unsigned int mux_line_to_num(unsigned int line)
2689 +
2690 + static struct gsm_mux *gsm_alloc_mux(void)
2691 + {
2692 ++ int i;
2693 + struct gsm_mux *gsm = kzalloc(sizeof(struct gsm_mux), GFP_KERNEL);
2694 + if (gsm == NULL)
2695 + return NULL;
2696 +@@ -2217,7 +2209,7 @@ static struct gsm_mux *gsm_alloc_mux(void)
2697 + kfree(gsm);
2698 + return NULL;
2699 + }
2700 +- gsm->txframe = kmalloc(2 * MAX_MRU + 2, GFP_KERNEL);
2701 ++ gsm->txframe = kmalloc(2 * (MAX_MTU + PROT_OVERHEAD - 1), GFP_KERNEL);
2702 + if (gsm->txframe == NULL) {
2703 + kfree(gsm->buf);
2704 + kfree(gsm);
2705 +@@ -2238,6 +2230,26 @@ static struct gsm_mux *gsm_alloc_mux(void)
2706 + gsm->mtu = 64;
2707 + gsm->dead = true; /* Avoid early tty opens */
2708 +
2709 ++ /* Store the instance to the mux array or abort if no space is
2710 ++ * available.
2711 ++ */
2712 ++ spin_lock(&gsm_mux_lock);
2713 ++ for (i = 0; i < MAX_MUX; i++) {
2714 ++ if (!gsm_mux[i]) {
2715 ++ gsm_mux[i] = gsm;
2716 ++ gsm->num = i;
2717 ++ break;
2718 ++ }
2719 ++ }
2720 ++ spin_unlock(&gsm_mux_lock);
2721 ++ if (i == MAX_MUX) {
2722 ++ mutex_destroy(&gsm->mutex);
2723 ++ kfree(gsm->txframe);
2724 ++ kfree(gsm->buf);
2725 ++ kfree(gsm);
2726 ++ return NULL;
2727 ++ }
2728 ++
2729 + return gsm;
2730 + }
2731 +
2732 +@@ -2273,7 +2285,7 @@ static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c)
2733 + /* Check the MRU/MTU range looks sane */
2734 + if (c->mru > MAX_MRU || c->mtu > MAX_MTU || c->mru < 8 || c->mtu < 8)
2735 + return -EINVAL;
2736 +- if (c->n2 < 3)
2737 ++ if (c->n2 > 255)
2738 + return -EINVAL;
2739 + if (c->encapsulation > 1) /* Basic, advanced, no I */
2740 + return -EINVAL;
2741 +@@ -2304,19 +2316,11 @@ static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c)
2742 +
2743 + /*
2744 + * Close down what is needed, restart and initiate the new
2745 +- * configuration
2746 ++ * configuration. On the first time there is no DLCI[0]
2747 ++ * and closing or cleaning up is not necessary.
2748 + */
2749 +-
2750 +- if (need_close || need_restart) {
2751 +- int ret;
2752 +-
2753 +- ret = gsm_disconnect(gsm);
2754 +-
2755 +- if (ret)
2756 +- return ret;
2757 +- }
2758 +- if (need_restart)
2759 +- gsm_cleanup_mux(gsm);
2760 ++ if (need_close || need_restart)
2761 ++ gsm_cleanup_mux(gsm, true);
2762 +
2763 + gsm->initiator = c->initiator;
2764 + gsm->mru = c->mru;
2765 +@@ -2385,6 +2389,9 @@ static int gsmld_attach_gsm(struct tty_struct *tty, struct gsm_mux *gsm)
2766 + int ret, i;
2767 +
2768 + gsm->tty = tty_kref_get(tty);
2769 ++ /* Turn off tty XON/XOFF handling to handle it explicitly. */
2770 ++ gsm->old_c_iflag = tty->termios.c_iflag;
2771 ++ tty->termios.c_iflag &= (IXON | IXOFF);
2772 + ret = gsm_activate_mux(gsm);
2773 + if (ret != 0)
2774 + tty_kref_put(gsm->tty);
2775 +@@ -2425,7 +2432,8 @@ static void gsmld_detach_gsm(struct tty_struct *tty, struct gsm_mux *gsm)
2776 + WARN_ON(tty != gsm->tty);
2777 + for (i = 1; i < NUM_DLCI; i++)
2778 + tty_unregister_device(gsm_tty_driver, base + i);
2779 +- gsm_cleanup_mux(gsm);
2780 ++ /* Restore tty XON/XOFF handling. */
2781 ++ gsm->tty->termios.c_iflag = gsm->old_c_iflag;
2782 + tty_kref_put(gsm->tty);
2783 + gsm->tty = NULL;
2784 + }
2785 +@@ -2493,6 +2501,12 @@ static void gsmld_close(struct tty_struct *tty)
2786 + {
2787 + struct gsm_mux *gsm = tty->disc_data;
2788 +
2789 ++ /* The ldisc locks and closes the port before calling our close. This
2790 ++ * means we have no way to do a proper disconnect. We will not bother
2791 ++ * to do one.
2792 ++ */
2793 ++ gsm_cleanup_mux(gsm, false);
2794 ++
2795 + gsmld_detach_gsm(tty, gsm);
2796 +
2797 + gsmld_flush_buffer(tty);
2798 +@@ -2531,7 +2545,7 @@ static int gsmld_open(struct tty_struct *tty)
2799 +
2800 + ret = gsmld_attach_gsm(tty, gsm);
2801 + if (ret != 0) {
2802 +- gsm_cleanup_mux(gsm);
2803 ++ gsm_cleanup_mux(gsm, false);
2804 + mux_put(gsm);
2805 + }
2806 + return ret;
2807 +@@ -2888,19 +2902,17 @@ static struct tty_ldisc_ops tty_ldisc_packet = {
2808 +
2809 + static int gsmtty_modem_update(struct gsm_dlci *dlci, u8 brk)
2810 + {
2811 +- u8 modembits[5];
2812 ++ u8 modembits[3];
2813 + struct gsm_control *ctrl;
2814 + int len = 2;
2815 +
2816 +- if (brk)
2817 ++ modembits[0] = (dlci->addr << 2) | 2 | EA; /* DLCI, Valid, EA */
2818 ++ modembits[1] = (gsm_encode_modem(dlci) << 1) | EA;
2819 ++ if (brk) {
2820 ++ modembits[2] = (brk << 4) | 2 | EA; /* Length, Break, EA */
2821 + len++;
2822 +-
2823 +- modembits[0] = len << 1 | EA; /* Data bytes */
2824 +- modembits[1] = dlci->addr << 2 | 3; /* DLCI, EA, 1 */
2825 +- modembits[2] = gsm_encode_modem(dlci) << 1 | EA;
2826 +- if (brk)
2827 +- modembits[3] = brk << 4 | 2 | EA; /* Valid, EA */
2828 +- ctrl = gsm_control_send(dlci->gsm, CMD_MSC, modembits, len + 1);
2829 ++ }
2830 ++ ctrl = gsm_control_send(dlci->gsm, CMD_MSC, modembits, len);
2831 + if (ctrl == NULL)
2832 + return -ENOMEM;
2833 + return gsm_control_wait(dlci->gsm, ctrl);
2834 +@@ -3085,13 +3097,17 @@ static int gsmtty_chars_in_buffer(struct tty_struct *tty)
2835 + static void gsmtty_flush_buffer(struct tty_struct *tty)
2836 + {
2837 + struct gsm_dlci *dlci = tty->driver_data;
2838 ++ unsigned long flags;
2839 ++
2840 + if (dlci->state == DLCI_CLOSED)
2841 + return;
2842 + /* Caution needed: If we implement reliable transport classes
2843 + then the data being transmitted can't simply be junked once
2844 + it has first hit the stack. Until then we can just blow it
2845 + away */
2846 ++ spin_lock_irqsave(&dlci->lock, flags);
2847 + kfifo_reset(&dlci->fifo);
2848 ++ spin_unlock_irqrestore(&dlci->lock, flags);
2849 + /* Need to unhook this DLCI from the transmit queue logic */
2850 + }
2851 +
2852 +diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c
2853 +index 3a985e953b8e9..da2373787f853 100644
2854 +--- a/drivers/tty/serial/8250/8250_pci.c
2855 ++++ b/drivers/tty/serial/8250/8250_pci.c
2856 +@@ -2940,7 +2940,7 @@ enum pci_board_num_t {
2857 + pbn_panacom2,
2858 + pbn_panacom4,
2859 + pbn_plx_romulus,
2860 +- pbn_endrun_2_4000000,
2861 ++ pbn_endrun_2_3906250,
2862 + pbn_oxsemi,
2863 + pbn_oxsemi_1_4000000,
2864 + pbn_oxsemi_2_4000000,
2865 +@@ -3468,10 +3468,10 @@ static struct pciserial_board pci_boards[] = {
2866 + * signal now many ports are available
2867 + * 2 port 952 Uart support
2868 + */
2869 +- [pbn_endrun_2_4000000] = {
2870 ++ [pbn_endrun_2_3906250] = {
2871 + .flags = FL_BASE0,
2872 + .num_ports = 2,
2873 +- .base_baud = 4000000,
2874 ++ .base_baud = 3906250,
2875 + .uart_offset = 0x200,
2876 + .first_offset = 0x1000,
2877 + },
2878 +@@ -4386,7 +4386,7 @@ static const struct pci_device_id serial_pci_tbl[] = {
2879 + */
2880 + { PCI_VENDOR_ID_ENDRUN, PCI_DEVICE_ID_ENDRUN_1588,
2881 + PCI_ANY_ID, PCI_ANY_ID, 0, 0,
2882 +- pbn_endrun_2_4000000 },
2883 ++ pbn_endrun_2_3906250 },
2884 + /*
2885 + * Quatech cards. These actually have configurable clocks but for
2886 + * now we just use the default.
2887 +diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c
2888 +index 3055353514e1d..e0fa24f0f732d 100644
2889 +--- a/drivers/tty/serial/8250/8250_port.c
2890 ++++ b/drivers/tty/serial/8250/8250_port.c
2891 +@@ -3311,7 +3311,7 @@ static void serial8250_console_restore(struct uart_8250_port *up)
2892 +
2893 + serial8250_set_divisor(port, baud, quot, frac);
2894 + serial_port_out(port, UART_LCR, up->lcr);
2895 +- serial8250_out_MCR(up, UART_MCR_DTR | UART_MCR_RTS);
2896 ++ serial8250_out_MCR(up, up->mcr | UART_MCR_DTR | UART_MCR_RTS);
2897 + }
2898 +
2899 + /*
2900 +diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c
2901 +index 93cd8ad57f385..bfbca711bbf9b 100644
2902 +--- a/drivers/tty/serial/imx.c
2903 ++++ b/drivers/tty/serial/imx.c
2904 +@@ -1470,7 +1470,7 @@ static int imx_uart_startup(struct uart_port *port)
2905 + imx_uart_writel(sport, ucr1, UCR1);
2906 +
2907 + ucr4 = imx_uart_readl(sport, UCR4) & ~(UCR4_OREN | UCR4_INVR);
2908 +- if (!sport->dma_is_enabled)
2909 ++ if (!dma_is_inited)
2910 + ucr4 |= UCR4_OREN;
2911 + if (sport->inverted_rx)
2912 + ucr4 |= UCR4_INVR;
2913 +diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c
2914 +index e111622944139..d5056cc34974a 100644
2915 +--- a/drivers/usb/cdns3/gadget.c
2916 ++++ b/drivers/usb/cdns3/gadget.c
2917 +@@ -2697,6 +2697,7 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)
2918 + struct usb_request *request;
2919 + struct cdns3_request *priv_req;
2920 + struct cdns3_trb *trb = NULL;
2921 ++ struct cdns3_trb trb_tmp;
2922 + int ret;
2923 + int val;
2924 +
2925 +@@ -2706,8 +2707,10 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)
2926 + if (request) {
2927 + priv_req = to_cdns3_request(request);
2928 + trb = priv_req->trb;
2929 +- if (trb)
2930 ++ if (trb) {
2931 ++ trb_tmp = *trb;
2932 + trb->control = trb->control ^ cpu_to_le32(TRB_CYCLE);
2933 ++ }
2934 + }
2935 +
2936 + writel(EP_CMD_CSTALL | EP_CMD_EPRST, &priv_dev->regs->ep_cmd);
2937 +@@ -2722,7 +2725,7 @@ int __cdns3_gadget_ep_clear_halt(struct cdns3_endpoint *priv_ep)
2938 +
2939 + if (request) {
2940 + if (trb)
2941 +- trb->control = trb->control ^ cpu_to_le32(TRB_CYCLE);
2942 ++ *trb = trb_tmp;
2943 +
2944 + cdns3_rearm_transfer(priv_ep, 1);
2945 + }
2946 +diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
2947 +index baf80e2ac7d8e..7e5fd6afd9f45 100644
2948 +--- a/drivers/usb/core/quirks.c
2949 ++++ b/drivers/usb/core/quirks.c
2950 +@@ -404,6 +404,9 @@ static const struct usb_device_id usb_quirk_list[] = {
2951 + { USB_DEVICE(0x0b05, 0x17e0), .driver_info =
2952 + USB_QUIRK_IGNORE_REMOTE_WAKEUP },
2953 +
2954 ++ /* Realtek Semiconductor Corp. Mass Storage Device (Multicard Reader)*/
2955 ++ { USB_DEVICE(0x0bda, 0x0151), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
2956 ++
2957 + /* Realtek hub in Dell WD19 (Type-C) */
2958 + { USB_DEVICE(0x0bda, 0x0487), .driver_info = USB_QUIRK_NO_LPM },
2959 + { USB_DEVICE(0x0bda, 0x5487), .driver_info = USB_QUIRK_RESET_RESUME },
2960 +@@ -508,6 +511,9 @@ static const struct usb_device_id usb_quirk_list[] = {
2961 + /* DJI CineSSD */
2962 + { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM },
2963 +
2964 ++ /* VCOM device */
2965 ++ { USB_DEVICE(0x4296, 0x7570), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
2966 ++
2967 + /* INTEL VALUE SSD */
2968 + { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME },
2969 +
2970 +diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
2971 +index 1580d51aea4f7..d97da7cef8679 100644
2972 +--- a/drivers/usb/dwc3/core.c
2973 ++++ b/drivers/usb/dwc3/core.c
2974 +@@ -275,7 +275,8 @@ static int dwc3_core_soft_reset(struct dwc3 *dwc)
2975 +
2976 + reg = dwc3_readl(dwc->regs, DWC3_DCTL);
2977 + reg |= DWC3_DCTL_CSFTRST;
2978 +- dwc3_writel(dwc->regs, DWC3_DCTL, reg);
2979 ++ reg &= ~DWC3_DCTL_RUN_STOP;
2980 ++ dwc3_gadget_dctl_write_safe(dwc, reg);
2981 +
2982 + /*
2983 + * For DWC_usb31 controller 1.90a and later, the DCTL.CSFRST bit
2984 +@@ -1277,10 +1278,10 @@ static void dwc3_get_properties(struct dwc3 *dwc)
2985 + u8 lpm_nyet_threshold;
2986 + u8 tx_de_emphasis;
2987 + u8 hird_threshold;
2988 +- u8 rx_thr_num_pkt_prd;
2989 +- u8 rx_max_burst_prd;
2990 +- u8 tx_thr_num_pkt_prd;
2991 +- u8 tx_max_burst_prd;
2992 ++ u8 rx_thr_num_pkt_prd = 0;
2993 ++ u8 rx_max_burst_prd = 0;
2994 ++ u8 tx_thr_num_pkt_prd = 0;
2995 ++ u8 tx_max_burst_prd = 0;
2996 +
2997 + /* default to highest possible threshold */
2998 + lpm_nyet_threshold = 0xf;
2999 +diff --git a/drivers/usb/dwc3/drd.c b/drivers/usb/dwc3/drd.c
3000 +index 3e1c1aacf002b..0a96f44ccca78 100644
3001 +--- a/drivers/usb/dwc3/drd.c
3002 ++++ b/drivers/usb/dwc3/drd.c
3003 +@@ -568,16 +568,15 @@ int dwc3_drd_init(struct dwc3 *dwc)
3004 + {
3005 + int ret, irq;
3006 +
3007 ++ if (ROLE_SWITCH &&
3008 ++ device_property_read_bool(dwc->dev, "usb-role-switch"))
3009 ++ return dwc3_setup_role_switch(dwc);
3010 ++
3011 + dwc->edev = dwc3_get_extcon(dwc);
3012 + if (IS_ERR(dwc->edev))
3013 + return PTR_ERR(dwc->edev);
3014 +
3015 +- if (ROLE_SWITCH &&
3016 +- device_property_read_bool(dwc->dev, "usb-role-switch")) {
3017 +- ret = dwc3_setup_role_switch(dwc);
3018 +- if (ret < 0)
3019 +- return ret;
3020 +- } else if (dwc->edev) {
3021 ++ if (dwc->edev) {
3022 + dwc->edev_nb.notifier_call = dwc3_drd_notifier;
3023 + ret = extcon_register_notifier(dwc->edev, EXTCON_USB_HOST,
3024 + &dwc->edev_nb);
3025 +diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c
3026 +index b68fe48ac5792..1f0503dc96eed 100644
3027 +--- a/drivers/usb/dwc3/gadget.c
3028 ++++ b/drivers/usb/dwc3/gadget.c
3029 +@@ -2859,6 +2859,7 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep,
3030 + const struct dwc3_event_depevt *event,
3031 + struct dwc3_request *req, int status)
3032 + {
3033 ++ int request_status;
3034 + int ret;
3035 +
3036 + if (req->request.num_mapped_sgs)
3037 +@@ -2879,7 +2880,35 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep,
3038 + req->needs_extra_trb = false;
3039 + }
3040 +
3041 +- dwc3_gadget_giveback(dep, req, status);
3042 ++ /*
3043 ++ * The event status only reflects the status of the TRB with IOC set.
3044 ++ * For the requests that don't set interrupt on completion, the driver
3045 ++ * needs to check and return the status of the completed TRBs associated
3046 ++ * with the request. Use the status of the last TRB of the request.
3047 ++ */
3048 ++ if (req->request.no_interrupt) {
3049 ++ struct dwc3_trb *trb;
3050 ++
3051 ++ trb = dwc3_ep_prev_trb(dep, dep->trb_dequeue);
3052 ++ switch (DWC3_TRB_SIZE_TRBSTS(trb->size)) {
3053 ++ case DWC3_TRBSTS_MISSED_ISOC:
3054 ++ /* Isoc endpoint only */
3055 ++ request_status = -EXDEV;
3056 ++ break;
3057 ++ case DWC3_TRB_STS_XFER_IN_PROG:
3058 ++ /* Applicable when End Transfer with ForceRM=0 */
3059 ++ case DWC3_TRBSTS_SETUP_PENDING:
3060 ++ /* Control endpoint only */
3061 ++ case DWC3_TRBSTS_OK:
3062 ++ default:
3063 ++ request_status = 0;
3064 ++ break;
3065 ++ }
3066 ++ } else {
3067 ++ request_status = status;
3068 ++ }
3069 ++
3070 ++ dwc3_gadget_giveback(dep, req, request_status);
3071 +
3072 + out:
3073 + return ret;
3074 +diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c
3075 +index 9b7fa53d6642b..d51ea1c052f24 100644
3076 +--- a/drivers/usb/gadget/configfs.c
3077 ++++ b/drivers/usb/gadget/configfs.c
3078 +@@ -1443,6 +1443,8 @@ static void configfs_composite_unbind(struct usb_gadget *gadget)
3079 + usb_ep_autoconfig_reset(cdev->gadget);
3080 + spin_lock_irqsave(&gi->spinlock, flags);
3081 + cdev->gadget = NULL;
3082 ++ cdev->deactivations = 0;
3083 ++ gadget->deactivated = false;
3084 + set_gadget_data(gadget, NULL);
3085 + spin_unlock_irqrestore(&gi->spinlock, flags);
3086 + }
3087 +diff --git a/drivers/usb/gadget/function/uvc_queue.c b/drivers/usb/gadget/function/uvc_queue.c
3088 +index 61e2c94cc0b0c..cab1e30462c24 100644
3089 +--- a/drivers/usb/gadget/function/uvc_queue.c
3090 ++++ b/drivers/usb/gadget/function/uvc_queue.c
3091 +@@ -242,6 +242,8 @@ void uvcg_queue_cancel(struct uvc_video_queue *queue, int disconnect)
3092 + buf->state = UVC_BUF_STATE_ERROR;
3093 + vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_ERROR);
3094 + }
3095 ++ queue->buf_used = 0;
3096 ++
3097 + /* This must be protected by the irqlock spinlock to avoid race
3098 + * conditions between uvc_queue_buffer and the disconnection event that
3099 + * could result in an interruptible wait in uvc_dequeue_buffer. Do not
3100 +diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c
3101 +index 460a8a86e3111..1eb3b5deb940e 100644
3102 +--- a/drivers/usb/host/xhci-hub.c
3103 ++++ b/drivers/usb/host/xhci-hub.c
3104 +@@ -1348,7 +1348,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
3105 + }
3106 + spin_unlock_irqrestore(&xhci->lock, flags);
3107 + if (!wait_for_completion_timeout(&bus_state->u3exit_done[wIndex],
3108 +- msecs_to_jiffies(100)))
3109 ++ msecs_to_jiffies(500)))
3110 + xhci_dbg(xhci, "missing U0 port change event for port %d-%d\n",
3111 + hcd->self.busnum, wIndex + 1);
3112 + spin_lock_irqsave(&xhci->lock, flags);
3113 +diff --git a/drivers/usb/host/xhci-pci.c b/drivers/usb/host/xhci-pci.c
3114 +index dafb58f05c9fb..48e2c04741891 100644
3115 +--- a/drivers/usb/host/xhci-pci.c
3116 ++++ b/drivers/usb/host/xhci-pci.c
3117 +@@ -59,6 +59,7 @@
3118 + #define PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI 0x9a13
3119 + #define PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI 0x1138
3120 + #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI 0x461e
3121 ++#define PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI 0x51ed
3122 +
3123 + #define PCI_DEVICE_ID_AMD_PROMONTORYA_4 0x43b9
3124 + #define PCI_DEVICE_ID_AMD_PROMONTORYA_3 0x43ba
3125 +@@ -261,7 +262,8 @@ static void xhci_pci_quirks(struct device *dev, struct xhci_hcd *xhci)
3126 + pdev->device == PCI_DEVICE_ID_INTEL_ICE_LAKE_XHCI ||
3127 + pdev->device == PCI_DEVICE_ID_INTEL_TIGER_LAKE_XHCI ||
3128 + pdev->device == PCI_DEVICE_ID_INTEL_MAPLE_RIDGE_XHCI ||
3129 +- pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI))
3130 ++ pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_XHCI ||
3131 ++ pdev->device == PCI_DEVICE_ID_INTEL_ALDER_LAKE_PCH_XHCI))
3132 + xhci->quirks |= XHCI_DEFAULT_PM_RUNTIME_ALLOW;
3133 +
3134 + if (pdev->vendor == PCI_VENDOR_ID_ETRON &&
3135 +diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c
3136 +index 76389c0dda8bc..fa3a7ac15f825 100644
3137 +--- a/drivers/usb/host/xhci-ring.c
3138 ++++ b/drivers/usb/host/xhci-ring.c
3139 +@@ -2969,6 +2969,8 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd)
3140 + if (event_loop++ < TRBS_PER_SEGMENT / 2)
3141 + continue;
3142 + xhci_update_erst_dequeue(xhci, event_ring_deq);
3143 ++ event_ring_deq = xhci->event_ring->dequeue;
3144 ++
3145 + event_loop = 0;
3146 + }
3147 +
3148 +diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
3149 +index 95effd28179b4..a1ed5e0d06128 100644
3150 +--- a/drivers/usb/host/xhci.c
3151 ++++ b/drivers/usb/host/xhci.c
3152 +@@ -779,6 +779,17 @@ void xhci_shutdown(struct usb_hcd *hcd)
3153 + if (xhci->quirks & XHCI_SPURIOUS_REBOOT)
3154 + usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev));
3155 +
3156 ++ /* Don't poll the roothubs after shutdown. */
3157 ++ xhci_dbg(xhci, "%s: stopping usb%d port polling.\n",
3158 ++ __func__, hcd->self.busnum);
3159 ++ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags);
3160 ++ del_timer_sync(&hcd->rh_timer);
3161 ++
3162 ++ if (xhci->shared_hcd) {
3163 ++ clear_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags);
3164 ++ del_timer_sync(&xhci->shared_hcd->rh_timer);
3165 ++ }
3166 ++
3167 + spin_lock_irq(&xhci->lock);
3168 + xhci_halt(xhci);
3169 + /* Workaround for spurious wakeups at shutdown with HSW */
3170 +diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c
3171 +index 748139d262633..0be8efcda15d5 100644
3172 +--- a/drivers/usb/misc/uss720.c
3173 ++++ b/drivers/usb/misc/uss720.c
3174 +@@ -71,6 +71,7 @@ static void destroy_priv(struct kref *kref)
3175 +
3176 + dev_dbg(&priv->usbdev->dev, "destroying priv datastructure\n");
3177 + usb_put_dev(priv->usbdev);
3178 ++ priv->usbdev = NULL;
3179 + kfree(priv);
3180 + }
3181 +
3182 +@@ -736,7 +737,6 @@ static int uss720_probe(struct usb_interface *intf,
3183 + parport_announce_port(pp);
3184 +
3185 + usb_set_intfdata(intf, pp);
3186 +- usb_put_dev(usbdev);
3187 + return 0;
3188 +
3189 + probe_abort:
3190 +@@ -754,7 +754,6 @@ static void uss720_disconnect(struct usb_interface *intf)
3191 + usb_set_intfdata(intf, NULL);
3192 + if (pp) {
3193 + priv = pp->private_data;
3194 +- priv->usbdev = NULL;
3195 + priv->pp = NULL;
3196 + dev_dbg(&intf->dev, "parport_remove_port\n");
3197 + parport_remove_port(pp);
3198 +diff --git a/drivers/usb/mtu3/mtu3_dr.c b/drivers/usb/mtu3/mtu3_dr.c
3199 +index 04f666e857312..16731324e5d8a 100644
3200 +--- a/drivers/usb/mtu3/mtu3_dr.c
3201 ++++ b/drivers/usb/mtu3/mtu3_dr.c
3202 +@@ -41,10 +41,8 @@ static char *mailbox_state_string(enum mtu3_vbus_id_state state)
3203 +
3204 + static void toggle_opstate(struct ssusb_mtk *ssusb)
3205 + {
3206 +- if (!ssusb->otg_switch.is_u3_drd) {
3207 +- mtu3_setbits(ssusb->mac_base, U3D_DEVICE_CONTROL, DC_SESSION);
3208 +- mtu3_setbits(ssusb->mac_base, U3D_POWER_MANAGEMENT, SOFT_CONN);
3209 +- }
3210 ++ mtu3_setbits(ssusb->mac_base, U3D_DEVICE_CONTROL, DC_SESSION);
3211 ++ mtu3_setbits(ssusb->mac_base, U3D_POWER_MANAGEMENT, SOFT_CONN);
3212 + }
3213 +
3214 + /* only port0 supports dual-role mode */
3215 +diff --git a/drivers/usb/phy/phy-generic.c b/drivers/usb/phy/phy-generic.c
3216 +index 661a229c105dd..34b9f81401871 100644
3217 +--- a/drivers/usb/phy/phy-generic.c
3218 ++++ b/drivers/usb/phy/phy-generic.c
3219 +@@ -268,6 +268,13 @@ int usb_phy_gen_create_phy(struct device *dev, struct usb_phy_generic *nop)
3220 + return -EPROBE_DEFER;
3221 + }
3222 +
3223 ++ nop->vbus_draw = devm_regulator_get_exclusive(dev, "vbus");
3224 ++ if (PTR_ERR(nop->vbus_draw) == -ENODEV)
3225 ++ nop->vbus_draw = NULL;
3226 ++ if (IS_ERR(nop->vbus_draw))
3227 ++ return dev_err_probe(dev, PTR_ERR(nop->vbus_draw),
3228 ++ "could not get vbus regulator\n");
3229 ++
3230 + nop->dev = dev;
3231 + nop->phy.dev = nop->dev;
3232 + nop->phy.label = "nop-xceiv";
3233 +diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
3234 +index 7ac668023da87..067b206bd2527 100644
3235 +--- a/drivers/usb/serial/cp210x.c
3236 ++++ b/drivers/usb/serial/cp210x.c
3237 +@@ -198,6 +198,8 @@ static const struct usb_device_id id_table[] = {
3238 + { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */
3239 + { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */
3240 + { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */
3241 ++ { USB_DEVICE(0x17A8, 0x0101) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Int Ant) */
3242 ++ { USB_DEVICE(0x17A8, 0x0102) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Ext Ant) */
3243 + { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */
3244 + { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
3245 + { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
3246 +diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
3247 +index b878f4c87fee8..f14a090ce6b62 100644
3248 +--- a/drivers/usb/serial/option.c
3249 ++++ b/drivers/usb/serial/option.c
3250 +@@ -432,6 +432,8 @@ static void option_instat_callback(struct urb *urb);
3251 + #define CINTERION_PRODUCT_CLS8 0x00b0
3252 + #define CINTERION_PRODUCT_MV31_MBIM 0x00b3
3253 + #define CINTERION_PRODUCT_MV31_RMNET 0x00b7
3254 ++#define CINTERION_PRODUCT_MV32_WA 0x00f1
3255 ++#define CINTERION_PRODUCT_MV32_WB 0x00f2
3256 +
3257 + /* Olivetti products */
3258 + #define OLIVETTI_VENDOR_ID 0x0b3c
3259 +@@ -1217,6 +1219,10 @@ static const struct usb_device_id option_ids[] = {
3260 + .driver_info = NCTRL(0) | RSVD(1) },
3261 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1056, 0xff), /* Telit FD980 */
3262 + .driver_info = NCTRL(2) | RSVD(3) },
3263 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1057, 0xff), /* Telit FN980 */
3264 ++ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
3265 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1058, 0xff), /* Telit FN980 (PCIe) */
3266 ++ .driver_info = NCTRL(0) | RSVD(1) },
3267 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1060, 0xff), /* Telit LN920 (rmnet) */
3268 + .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) },
3269 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1061, 0xff), /* Telit LN920 (MBIM) */
3270 +@@ -1233,6 +1239,8 @@ static const struct usb_device_id option_ids[] = {
3271 + .driver_info = NCTRL(2) | RSVD(3) },
3272 + { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1073, 0xff), /* Telit FN990 (ECM) */
3273 + .driver_info = NCTRL(0) | RSVD(1) },
3274 ++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1075, 0xff), /* Telit FN990 (PCIe) */
3275 ++ .driver_info = RSVD(0) },
3276 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910),
3277 + .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) },
3278 + { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM),
3279 +@@ -1969,6 +1977,10 @@ static const struct usb_device_id option_ids[] = {
3280 + .driver_info = RSVD(3)},
3281 + { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_RMNET, 0xff),
3282 + .driver_info = RSVD(0)},
3283 ++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WA, 0xff),
3284 ++ .driver_info = RSVD(3)},
3285 ++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WB, 0xff),
3286 ++ .driver_info = RSVD(3)},
3287 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100),
3288 + .driver_info = RSVD(4) },
3289 + { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120),
3290 +diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c
3291 +index ca3bd58f2025a..5576cfa50bc80 100644
3292 +--- a/drivers/usb/serial/whiteheat.c
3293 ++++ b/drivers/usb/serial/whiteheat.c
3294 +@@ -599,9 +599,8 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command,
3295 + switch (command) {
3296 + case WHITEHEAT_GET_DTR_RTS:
3297 + info = usb_get_serial_port_data(port);
3298 +- memcpy(&info->mcr, command_info->result_buffer,
3299 +- sizeof(struct whiteheat_dr_info));
3300 +- break;
3301 ++ info->mcr = command_info->result_buffer[0];
3302 ++ break;
3303 + }
3304 + }
3305 + exit:
3306 +diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c
3307 +index 3bfa8005ae65d..dfda8f5487c09 100644
3308 +--- a/drivers/usb/typec/ucsi/ucsi.c
3309 ++++ b/drivers/usb/typec/ucsi/ucsi.c
3310 +@@ -928,6 +928,8 @@ static int ucsi_dr_swap(struct typec_port *port, enum typec_data_role role)
3311 + role == TYPEC_HOST))
3312 + goto out_unlock;
3313 +
3314 ++ reinit_completion(&con->complete);
3315 ++
3316 + command = UCSI_SET_UOR | UCSI_CONNECTOR_NUMBER(con->num);
3317 + command |= UCSI_SET_UOR_ROLE(role);
3318 + command |= UCSI_SET_UOR_ACCEPT_ROLE_SWAPS;
3319 +@@ -935,14 +937,18 @@ static int ucsi_dr_swap(struct typec_port *port, enum typec_data_role role)
3320 + if (ret < 0)
3321 + goto out_unlock;
3322 +
3323 ++ mutex_unlock(&con->lock);
3324 ++
3325 + if (!wait_for_completion_timeout(&con->complete,
3326 +- msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS)))
3327 +- ret = -ETIMEDOUT;
3328 ++ msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS)))
3329 ++ return -ETIMEDOUT;
3330 ++
3331 ++ return 0;
3332 +
3333 + out_unlock:
3334 + mutex_unlock(&con->lock);
3335 +
3336 +- return ret < 0 ? ret : 0;
3337 ++ return ret;
3338 + }
3339 +
3340 + static int ucsi_pr_swap(struct typec_port *port, enum typec_role role)
3341 +@@ -964,6 +970,8 @@ static int ucsi_pr_swap(struct typec_port *port, enum typec_role role)
3342 + if (cur_role == role)
3343 + goto out_unlock;
3344 +
3345 ++ reinit_completion(&con->complete);
3346 ++
3347 + command = UCSI_SET_PDR | UCSI_CONNECTOR_NUMBER(con->num);
3348 + command |= UCSI_SET_PDR_ROLE(role);
3349 + command |= UCSI_SET_PDR_ACCEPT_ROLE_SWAPS;
3350 +@@ -971,11 +979,13 @@ static int ucsi_pr_swap(struct typec_port *port, enum typec_role role)
3351 + if (ret < 0)
3352 + goto out_unlock;
3353 +
3354 ++ mutex_unlock(&con->lock);
3355 ++
3356 + if (!wait_for_completion_timeout(&con->complete,
3357 +- msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS))) {
3358 +- ret = -ETIMEDOUT;
3359 +- goto out_unlock;
3360 +- }
3361 ++ msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS)))
3362 ++ return -ETIMEDOUT;
3363 ++
3364 ++ mutex_lock(&con->lock);
3365 +
3366 + /* Something has gone wrong while swapping the role */
3367 + if (UCSI_CONSTAT_PWR_OPMODE(con->status.flags) !=
3368 +diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c
3369 +index 90f48b71fd8f7..d9eec1b60e665 100644
3370 +--- a/drivers/video/fbdev/udlfb.c
3371 ++++ b/drivers/video/fbdev/udlfb.c
3372 +@@ -1649,8 +1649,9 @@ static int dlfb_usb_probe(struct usb_interface *intf,
3373 + const struct device_attribute *attr;
3374 + struct dlfb_data *dlfb;
3375 + struct fb_info *info;
3376 +- int retval = -ENOMEM;
3377 ++ int retval;
3378 + struct usb_device *usbdev = interface_to_usbdev(intf);
3379 ++ struct usb_endpoint_descriptor *out;
3380 +
3381 + /* usb initialization */
3382 + dlfb = kzalloc(sizeof(*dlfb), GFP_KERNEL);
3383 +@@ -1664,6 +1665,12 @@ static int dlfb_usb_probe(struct usb_interface *intf,
3384 + dlfb->udev = usb_get_dev(usbdev);
3385 + usb_set_intfdata(intf, dlfb);
3386 +
3387 ++ retval = usb_find_common_endpoints(intf->cur_altsetting, NULL, &out, NULL, NULL);
3388 ++ if (retval) {
3389 ++ dev_err(&intf->dev, "Device should have at lease 1 bulk endpoint!\n");
3390 ++ goto error;
3391 ++ }
3392 ++
3393 + dev_dbg(&intf->dev, "console enable=%d\n", console);
3394 + dev_dbg(&intf->dev, "fb_defio enable=%d\n", fb_defio);
3395 + dev_dbg(&intf->dev, "shadow enable=%d\n", shadow);
3396 +@@ -1673,6 +1680,7 @@ static int dlfb_usb_probe(struct usb_interface *intf,
3397 + if (!dlfb_parse_vendor_descriptor(dlfb, intf)) {
3398 + dev_err(&intf->dev,
3399 + "firmware not recognized, incompatible device?\n");
3400 ++ retval = -ENODEV;
3401 + goto error;
3402 + }
3403 +
3404 +@@ -1686,8 +1694,10 @@ static int dlfb_usb_probe(struct usb_interface *intf,
3405 +
3406 + /* allocates framebuffer driver structure, not framebuffer memory */
3407 + info = framebuffer_alloc(0, &dlfb->udev->dev);
3408 +- if (!info)
3409 ++ if (!info) {
3410 ++ retval = -ENOMEM;
3411 + goto error;
3412 ++ }
3413 +
3414 + dlfb->info = info;
3415 + info->par = dlfb;
3416 +diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
3417 +index 0e8f484031da9..c758ff41b6386 100644
3418 +--- a/fs/cifs/smb2ops.c
3419 ++++ b/fs/cifs/smb2ops.c
3420 +@@ -1744,9 +1744,17 @@ smb2_copychunk_range(const unsigned int xid,
3421 + int chunks_copied = 0;
3422 + bool chunk_sizes_updated = false;
3423 + ssize_t bytes_written, total_bytes_written = 0;
3424 ++ struct inode *inode;
3425 +
3426 + pcchunk = kmalloc(sizeof(struct copychunk_ioctl), GFP_KERNEL);
3427 +
3428 ++ /*
3429 ++ * We need to flush all unwritten data before we can send the
3430 ++ * copychunk ioctl to the server.
3431 ++ */
3432 ++ inode = d_inode(trgtfile->dentry);
3433 ++ filemap_write_and_wait(inode->i_mapping);
3434 ++
3435 + if (pcchunk == NULL)
3436 + return -ENOMEM;
3437 +
3438 +diff --git a/fs/ext4/super.c b/fs/ext4/super.c
3439 +index 5e6c034583176..3e26edeca8c73 100644
3440 +--- a/fs/ext4/super.c
3441 ++++ b/fs/ext4/super.c
3442 +@@ -1176,18 +1176,23 @@ static void ext4_put_super(struct super_block *sb)
3443 + int aborted = 0;
3444 + int i, err;
3445 +
3446 +- ext4_unregister_li_request(sb);
3447 +- ext4_quota_off_umount(sb);
3448 +-
3449 +- destroy_workqueue(sbi->rsv_conversion_wq);
3450 +-
3451 + /*
3452 + * Unregister sysfs before destroying jbd2 journal.
3453 + * Since we could still access attr_journal_task attribute via sysfs
3454 + * path which could have sbi->s_journal->j_task as NULL
3455 ++ * Unregister sysfs before flush sbi->s_error_work.
3456 ++ * Since user may read /proc/fs/ext4/xx/mb_groups during umount, If
3457 ++ * read metadata verify failed then will queue error work.
3458 ++ * flush_stashed_error_work will call start_this_handle may trigger
3459 ++ * BUG_ON.
3460 + */
3461 + ext4_unregister_sysfs(sb);
3462 +
3463 ++ ext4_unregister_li_request(sb);
3464 ++ ext4_quota_off_umount(sb);
3465 ++
3466 ++ destroy_workqueue(sbi->rsv_conversion_wq);
3467 ++
3468 + if (sbi->s_journal) {
3469 + aborted = is_journal_aborted(sbi->s_journal);
3470 + err = jbd2_journal_destroy(sbi->s_journal);
3471 +diff --git a/fs/zonefs/super.c b/fs/zonefs/super.c
3472 +index e60759d8bb5fb..08ab5d1e3a3e8 100644
3473 +--- a/fs/zonefs/super.c
3474 ++++ b/fs/zonefs/super.c
3475 +@@ -32,6 +32,17 @@ static inline int zonefs_zone_mgmt(struct inode *inode,
3476 +
3477 + lockdep_assert_held(&zi->i_truncate_mutex);
3478 +
3479 ++ /*
3480 ++ * With ZNS drives, closing an explicitly open zone that has not been
3481 ++ * written will change the zone state to "closed", that is, the zone
3482 ++ * will remain active. Since this can then cause failure of explicit
3483 ++ * open operation on other zones if the drive active zone resources
3484 ++ * are exceeded, make sure that the zone does not remain active by
3485 ++ * resetting it.
3486 ++ */
3487 ++ if (op == REQ_OP_ZONE_CLOSE && !zi->i_wpoffset)
3488 ++ op = REQ_OP_ZONE_RESET;
3489 ++
3490 + ret = blkdev_zone_mgmt(inode->i_sb->s_bdev, op, zi->i_zsector,
3491 + zi->i_zone_size >> SECTOR_SHIFT, GFP_NOFS);
3492 + if (ret) {
3493 +@@ -1152,6 +1163,7 @@ static struct inode *zonefs_alloc_inode(struct super_block *sb)
3494 + mutex_init(&zi->i_truncate_mutex);
3495 + init_rwsem(&zi->i_mmap_sem);
3496 + zi->i_wr_refcnt = 0;
3497 ++ zi->i_flags = 0;
3498 +
3499 + return &zi->i_vnode;
3500 + }
3501 +@@ -1306,12 +1318,13 @@ static void zonefs_init_dir_inode(struct inode *parent, struct inode *inode,
3502 + inc_nlink(parent);
3503 + }
3504 +
3505 +-static void zonefs_init_file_inode(struct inode *inode, struct blk_zone *zone,
3506 +- enum zonefs_ztype type)
3507 ++static int zonefs_init_file_inode(struct inode *inode, struct blk_zone *zone,
3508 ++ enum zonefs_ztype type)
3509 + {
3510 + struct super_block *sb = inode->i_sb;
3511 + struct zonefs_sb_info *sbi = ZONEFS_SB(sb);
3512 + struct zonefs_inode_info *zi = ZONEFS_I(inode);
3513 ++ int ret = 0;
3514 +
3515 + inode->i_ino = zone->start >> sbi->s_zone_sectors_shift;
3516 + inode->i_mode = S_IFREG | sbi->s_perm;
3517 +@@ -1336,6 +1349,22 @@ static void zonefs_init_file_inode(struct inode *inode, struct blk_zone *zone,
3518 + sb->s_maxbytes = max(zi->i_max_size, sb->s_maxbytes);
3519 + sbi->s_blocks += zi->i_max_size >> sb->s_blocksize_bits;
3520 + sbi->s_used_blocks += zi->i_wpoffset >> sb->s_blocksize_bits;
3521 ++
3522 ++ /*
3523 ++ * For sequential zones, make sure that any open zone is closed first
3524 ++ * to ensure that the initial number of open zones is 0, in sync with
3525 ++ * the open zone accounting done when the mount option
3526 ++ * ZONEFS_MNTOPT_EXPLICIT_OPEN is used.
3527 ++ */
3528 ++ if (type == ZONEFS_ZTYPE_SEQ &&
3529 ++ (zone->cond == BLK_ZONE_COND_IMP_OPEN ||
3530 ++ zone->cond == BLK_ZONE_COND_EXP_OPEN)) {
3531 ++ mutex_lock(&zi->i_truncate_mutex);
3532 ++ ret = zonefs_zone_mgmt(inode, REQ_OP_ZONE_CLOSE);
3533 ++ mutex_unlock(&zi->i_truncate_mutex);
3534 ++ }
3535 ++
3536 ++ return ret;
3537 + }
3538 +
3539 + static struct dentry *zonefs_create_inode(struct dentry *parent,
3540 +@@ -1345,6 +1374,7 @@ static struct dentry *zonefs_create_inode(struct dentry *parent,
3541 + struct inode *dir = d_inode(parent);
3542 + struct dentry *dentry;
3543 + struct inode *inode;
3544 ++ int ret;
3545 +
3546 + dentry = d_alloc_name(parent, name);
3547 + if (!dentry)
3548 +@@ -1355,10 +1385,16 @@ static struct dentry *zonefs_create_inode(struct dentry *parent,
3549 + goto dput;
3550 +
3551 + inode->i_ctime = inode->i_mtime = inode->i_atime = dir->i_ctime;
3552 +- if (zone)
3553 +- zonefs_init_file_inode(inode, zone, type);
3554 +- else
3555 ++ if (zone) {
3556 ++ ret = zonefs_init_file_inode(inode, zone, type);
3557 ++ if (ret) {
3558 ++ iput(inode);
3559 ++ goto dput;
3560 ++ }
3561 ++ } else {
3562 + zonefs_init_dir_inode(dir, inode, type);
3563 ++ }
3564 ++
3565 + d_add(dentry, inode);
3566 + dir->i_size++;
3567 +
3568 +diff --git a/include/linux/kernel.h b/include/linux/kernel.h
3569 +index 2f05e9128201c..f5392d96d6886 100644
3570 +--- a/include/linux/kernel.h
3571 ++++ b/include/linux/kernel.h
3572 +@@ -635,7 +635,7 @@ static inline char *hex_byte_pack_upper(char *buf, u8 byte)
3573 + return buf;
3574 + }
3575 +
3576 +-extern int hex_to_bin(char ch);
3577 ++extern int hex_to_bin(unsigned char ch);
3578 + extern int __must_check hex2bin(u8 *dst, const char *src, size_t count);
3579 + extern char *bin2hex(char *dst, const void *src, size_t count);
3580 +
3581 +diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
3582 +index 157357ec14419..fc41fecfe44f9 100644
3583 +--- a/include/linux/mtd/mtd.h
3584 ++++ b/include/linux/mtd/mtd.h
3585 +@@ -388,10 +388,8 @@ struct mtd_info {
3586 + /* List of partitions attached to this MTD device */
3587 + struct list_head partitions;
3588 +
3589 +- union {
3590 +- struct mtd_part part;
3591 +- struct mtd_master master;
3592 +- };
3593 ++ struct mtd_part part;
3594 ++ struct mtd_master master;
3595 + };
3596 +
3597 + static inline struct mtd_info *mtd_get_master(struct mtd_info *mtd)
3598 +diff --git a/include/memory/renesas-rpc-if.h b/include/memory/renesas-rpc-if.h
3599 +index aceb2c360d3fa..0e3dac0302196 100644
3600 +--- a/include/memory/renesas-rpc-if.h
3601 ++++ b/include/memory/renesas-rpc-if.h
3602 +@@ -65,6 +65,7 @@ struct rpcif {
3603 + size_t size;
3604 + enum rpcif_data_dir dir;
3605 + u8 bus_size;
3606 ++ u8 xfer_size;
3607 + void *buffer;
3608 + u32 xferlen;
3609 + u32 smcr;
3610 +diff --git a/include/net/ip6_tunnel.h b/include/net/ip6_tunnel.h
3611 +index 028eaea1c8544..42d50856fcf24 100644
3612 +--- a/include/net/ip6_tunnel.h
3613 ++++ b/include/net/ip6_tunnel.h
3614 +@@ -57,7 +57,7 @@ struct ip6_tnl {
3615 +
3616 + /* These fields used only by GRE */
3617 + __u32 i_seqno; /* The last seen seqno */
3618 +- __u32 o_seqno; /* The last output seqno */
3619 ++ atomic_t o_seqno; /* The last output seqno */
3620 + int hlen; /* tun_hlen + encap_hlen */
3621 + int tun_hlen; /* Precalculated header length */
3622 + int encap_hlen; /* Encap header length (FOU,GUE) */
3623 +diff --git a/include/net/ip_tunnels.h b/include/net/ip_tunnels.h
3624 +index 61620677b0347..c3e55a9ae5857 100644
3625 +--- a/include/net/ip_tunnels.h
3626 ++++ b/include/net/ip_tunnels.h
3627 +@@ -113,7 +113,7 @@ struct ip_tunnel {
3628 +
3629 + /* These four fields used only by GRE */
3630 + u32 i_seqno; /* The last seen seqno */
3631 +- u32 o_seqno; /* The last output seqno */
3632 ++ atomic_t o_seqno; /* The last output seqno */
3633 + int tun_hlen; /* Precalculated header length */
3634 +
3635 + /* These four fields used only by ERSPAN */
3636 +diff --git a/include/net/tcp.h b/include/net/tcp.h
3637 +index 334b8d1b54429..2a28e09255735 100644
3638 +--- a/include/net/tcp.h
3639 ++++ b/include/net/tcp.h
3640 +@@ -460,6 +460,7 @@ int __cookie_v4_check(const struct iphdr *iph, const struct tcphdr *th,
3641 + u32 cookie);
3642 + struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb);
3643 + struct request_sock *cookie_tcp_reqsk_alloc(const struct request_sock_ops *ops,
3644 ++ const struct tcp_request_sock_ops *af_ops,
3645 + struct sock *sk, struct sk_buff *skb);
3646 + #ifdef CONFIG_SYN_COOKIES
3647 +
3648 +@@ -598,6 +599,7 @@ void tcp_synack_rtt_meas(struct sock *sk, struct request_sock *req);
3649 + void tcp_reset(struct sock *sk);
3650 + void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp, struct sk_buff *skb);
3651 + void tcp_fin(struct sock *sk);
3652 ++void tcp_check_space(struct sock *sk);
3653 +
3654 + /* tcp_timer.c */
3655 + void tcp_init_xmit_timers(struct sock *);
3656 +@@ -1041,6 +1043,7 @@ struct rate_sample {
3657 + int losses; /* number of packets marked lost upon ACK */
3658 + u32 acked_sacked; /* number of packets newly (S)ACKed upon ACK */
3659 + u32 prior_in_flight; /* in flight before this ACK */
3660 ++ u32 last_end_seq; /* end_seq of most recently ACKed packet */
3661 + bool is_app_limited; /* is sample from packet with bubble in pipe? */
3662 + bool is_retrans; /* is sample from retransmission? */
3663 + bool is_ack_delayed; /* is this (likely) a delayed ACK? */
3664 +@@ -1151,6 +1154,11 @@ void tcp_rate_gen(struct sock *sk, u32 delivered, u32 lost,
3665 + bool is_sack_reneg, struct rate_sample *rs);
3666 + void tcp_rate_check_app_limited(struct sock *sk);
3667 +
3668 ++static inline bool tcp_skb_sent_after(u64 t1, u64 t2, u32 seq1, u32 seq2)
3669 ++{
3670 ++ return t1 > t2 || (t1 == t2 && after(seq1, seq2));
3671 ++}
3672 ++
3673 + /* These functions determine how the current flow behaves in respect of SACK
3674 + * handling. SACK is negotiated with the peer, and therefore it can vary
3675 + * between different flows.
3676 +diff --git a/lib/hexdump.c b/lib/hexdump.c
3677 +index 9301578f98e8c..06833d404398d 100644
3678 +--- a/lib/hexdump.c
3679 ++++ b/lib/hexdump.c
3680 +@@ -22,15 +22,33 @@ EXPORT_SYMBOL(hex_asc_upper);
3681 + *
3682 + * hex_to_bin() converts one hex digit to its actual value or -1 in case of bad
3683 + * input.
3684 ++ *
3685 ++ * This function is used to load cryptographic keys, so it is coded in such a
3686 ++ * way that there are no conditions or memory accesses that depend on data.
3687 ++ *
3688 ++ * Explanation of the logic:
3689 ++ * (ch - '9' - 1) is negative if ch <= '9'
3690 ++ * ('0' - 1 - ch) is negative if ch >= '0'
3691 ++ * we "and" these two values, so the result is negative if ch is in the range
3692 ++ * '0' ... '9'
3693 ++ * we are only interested in the sign, so we do a shift ">> 8"; note that right
3694 ++ * shift of a negative value is implementation-defined, so we cast the
3695 ++ * value to (unsigned) before the shift --- we have 0xffffff if ch is in
3696 ++ * the range '0' ... '9', 0 otherwise
3697 ++ * we "and" this value with (ch - '0' + 1) --- we have a value 1 ... 10 if ch is
3698 ++ * in the range '0' ... '9', 0 otherwise
3699 ++ * we add this value to -1 --- we have a value 0 ... 9 if ch is in the range '0'
3700 ++ * ... '9', -1 otherwise
3701 ++ * the next line is similar to the previous one, but we need to decode both
3702 ++ * uppercase and lowercase letters, so we use (ch & 0xdf), which converts
3703 ++ * lowercase to uppercase
3704 + */
3705 +-int hex_to_bin(char ch)
3706 ++int hex_to_bin(unsigned char ch)
3707 + {
3708 +- if ((ch >= '0') && (ch <= '9'))
3709 +- return ch - '0';
3710 +- ch = tolower(ch);
3711 +- if ((ch >= 'a') && (ch <= 'f'))
3712 +- return ch - 'a' + 10;
3713 +- return -1;
3714 ++ unsigned char cu = ch & 0xdf;
3715 ++ return -1 +
3716 ++ ((ch - '0' + 1) & (unsigned)((ch - '9' - 1) & ('0' - 1 - ch)) >> 8) +
3717 ++ ((cu - 'A' + 11) & (unsigned)((cu - 'F' - 1) & ('A' - 1 - cu)) >> 8);
3718 + }
3719 + EXPORT_SYMBOL(hex_to_bin);
3720 +
3721 +@@ -45,10 +63,13 @@ EXPORT_SYMBOL(hex_to_bin);
3722 + int hex2bin(u8 *dst, const char *src, size_t count)
3723 + {
3724 + while (count--) {
3725 +- int hi = hex_to_bin(*src++);
3726 +- int lo = hex_to_bin(*src++);
3727 ++ int hi, lo;
3728 +
3729 +- if ((hi < 0) || (lo < 0))
3730 ++ hi = hex_to_bin(*src++);
3731 ++ if (unlikely(hi < 0))
3732 ++ return -EINVAL;
3733 ++ lo = hex_to_bin(*src++);
3734 ++ if (unlikely(lo < 0))
3735 + return -EINVAL;
3736 +
3737 + *dst++ = (hi << 4) | lo;
3738 +diff --git a/mm/kasan/quarantine.c b/mm/kasan/quarantine.c
3739 +index 0e3f8494628f6..622193846b6b5 100644
3740 +--- a/mm/kasan/quarantine.c
3741 ++++ b/mm/kasan/quarantine.c
3742 +@@ -299,6 +299,13 @@ static void per_cpu_remove_cache(void *arg)
3743 + struct qlist_head *q;
3744 +
3745 + q = this_cpu_ptr(&cpu_quarantine);
3746 ++ /*
3747 ++ * Ensure the ordering between the writing to q->offline and
3748 ++ * per_cpu_remove_cache. Prevent cpu_quarantine from being corrupted
3749 ++ * by interrupt.
3750 ++ */
3751 ++ if (READ_ONCE(q->offline))
3752 ++ return;
3753 + qlist_move_cache(q, &to_free, cache);
3754 + qlist_free_all(&to_free, cache);
3755 + }
3756 +diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c
3757 +index 2f7940bcf7151..3fd207fe1284a 100644
3758 +--- a/net/core/lwt_bpf.c
3759 ++++ b/net/core/lwt_bpf.c
3760 +@@ -158,10 +158,8 @@ static int bpf_output(struct net *net, struct sock *sk, struct sk_buff *skb)
3761 + return dst->lwtstate->orig_output(net, sk, skb);
3762 + }
3763 +
3764 +-static int xmit_check_hhlen(struct sk_buff *skb)
3765 ++static int xmit_check_hhlen(struct sk_buff *skb, int hh_len)
3766 + {
3767 +- int hh_len = skb_dst(skb)->dev->hard_header_len;
3768 +-
3769 + if (skb_headroom(skb) < hh_len) {
3770 + int nhead = HH_DATA_ALIGN(hh_len - skb_headroom(skb));
3771 +
3772 +@@ -273,6 +271,7 @@ static int bpf_xmit(struct sk_buff *skb)
3773 +
3774 + bpf = bpf_lwt_lwtunnel(dst->lwtstate);
3775 + if (bpf->xmit.prog) {
3776 ++ int hh_len = dst->dev->hard_header_len;
3777 + __be16 proto = skb->protocol;
3778 + int ret;
3779 +
3780 +@@ -290,7 +289,7 @@ static int bpf_xmit(struct sk_buff *skb)
3781 + /* If the header was expanded, headroom might be too
3782 + * small for L2 header to come, expand as needed.
3783 + */
3784 +- ret = xmit_check_hhlen(skb);
3785 ++ ret = xmit_check_hhlen(skb, hh_len);
3786 + if (unlikely(ret))
3787 + return ret;
3788 +
3789 +diff --git a/net/dsa/port.c b/net/dsa/port.c
3790 +index 73569c9af3cc0..c9d552c4c358c 100644
3791 +--- a/net/dsa/port.c
3792 ++++ b/net/dsa/port.c
3793 +@@ -721,8 +721,10 @@ int dsa_port_link_register_of(struct dsa_port *dp)
3794 + if (ds->ops->phylink_mac_link_down)
3795 + ds->ops->phylink_mac_link_down(ds, port,
3796 + MLO_AN_FIXED, PHY_INTERFACE_MODE_NA);
3797 ++ of_node_put(phy_np);
3798 + return dsa_port_phylink_register(dp);
3799 + }
3800 ++ of_node_put(phy_np);
3801 + return 0;
3802 + }
3803 +
3804 +diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c
3805 +index e4504dd510c6d..2a80038575d27 100644
3806 +--- a/net/ipv4/ip_gre.c
3807 ++++ b/net/ipv4/ip_gre.c
3808 +@@ -454,14 +454,12 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev,
3809 + __be16 proto)
3810 + {
3811 + struct ip_tunnel *tunnel = netdev_priv(dev);
3812 +-
3813 +- if (tunnel->parms.o_flags & TUNNEL_SEQ)
3814 +- tunnel->o_seqno++;
3815 ++ __be16 flags = tunnel->parms.o_flags;
3816 +
3817 + /* Push GRE header. */
3818 + gre_build_header(skb, tunnel->tun_hlen,
3819 +- tunnel->parms.o_flags, proto, tunnel->parms.o_key,
3820 +- htonl(tunnel->o_seqno));
3821 ++ flags, proto, tunnel->parms.o_key,
3822 ++ (flags & TUNNEL_SEQ) ? htonl(atomic_fetch_inc(&tunnel->o_seqno)) : 0);
3823 +
3824 + ip_tunnel_xmit(skb, dev, tnl_params, tnl_params->protocol);
3825 + }
3826 +@@ -499,7 +497,7 @@ static void gre_fb_xmit(struct sk_buff *skb, struct net_device *dev,
3827 + (TUNNEL_CSUM | TUNNEL_KEY | TUNNEL_SEQ);
3828 + gre_build_header(skb, tunnel_hlen, flags, proto,
3829 + tunnel_id_to_key32(tun_info->key.tun_id),
3830 +- (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) : 0);
3831 ++ (flags & TUNNEL_SEQ) ? htonl(atomic_fetch_inc(&tunnel->o_seqno)) : 0);
3832 +
3833 + ip_md_tunnel_xmit(skb, dev, IPPROTO_GRE, tunnel_hlen);
3834 +
3835 +@@ -576,7 +574,7 @@ static void erspan_fb_xmit(struct sk_buff *skb, struct net_device *dev)
3836 + }
3837 +
3838 + gre_build_header(skb, 8, TUNNEL_SEQ,
3839 +- proto, 0, htonl(tunnel->o_seqno++));
3840 ++ proto, 0, htonl(atomic_fetch_inc(&tunnel->o_seqno)));
3841 +
3842 + ip_md_tunnel_xmit(skb, dev, IPPROTO_GRE, tunnel_hlen);
3843 +
3844 +diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c
3845 +index 00dc3f943c80b..0b616094e7947 100644
3846 +--- a/net/ipv4/syncookies.c
3847 ++++ b/net/ipv4/syncookies.c
3848 +@@ -283,6 +283,7 @@ bool cookie_ecn_ok(const struct tcp_options_received *tcp_opt,
3849 + EXPORT_SYMBOL(cookie_ecn_ok);
3850 +
3851 + struct request_sock *cookie_tcp_reqsk_alloc(const struct request_sock_ops *ops,
3852 ++ const struct tcp_request_sock_ops *af_ops,
3853 + struct sock *sk,
3854 + struct sk_buff *skb)
3855 + {
3856 +@@ -299,6 +300,10 @@ struct request_sock *cookie_tcp_reqsk_alloc(const struct request_sock_ops *ops,
3857 + return NULL;
3858 +
3859 + treq = tcp_rsk(req);
3860 ++
3861 ++ /* treq->af_specific might be used to perform TCP_MD5 lookup */
3862 ++ treq->af_specific = af_ops;
3863 ++
3864 + treq->syn_tos = TCP_SKB_CB(skb)->ip_dsfield;
3865 + #if IS_ENABLED(CONFIG_MPTCP)
3866 + treq->is_mptcp = sk_is_mptcp(sk);
3867 +@@ -366,7 +371,8 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb)
3868 + goto out;
3869 +
3870 + ret = NULL;
3871 +- req = cookie_tcp_reqsk_alloc(&tcp_request_sock_ops, sk, skb);
3872 ++ req = cookie_tcp_reqsk_alloc(&tcp_request_sock_ops,
3873 ++ &tcp_request_sock_ipv4_ops, sk, skb);
3874 + if (!req)
3875 + goto out;
3876 +
3877 +diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
3878 +index 12dd08af12b5e..2e267b2e33e5a 100644
3879 +--- a/net/ipv4/tcp_input.c
3880 ++++ b/net/ipv4/tcp_input.c
3881 +@@ -3814,7 +3814,8 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag)
3882 + tcp_process_tlp_ack(sk, ack, flag);
3883 +
3884 + if (tcp_ack_is_dubious(sk, flag)) {
3885 +- if (!(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP))) {
3886 ++ if (!(flag & (FLAG_SND_UNA_ADVANCED |
3887 ++ FLAG_NOT_DUP | FLAG_DSACKING_ACK))) {
3888 + num_dupack = 1;
3889 + /* Consider if pure acks were aggregated in tcp_add_backlog() */
3890 + if (!(flag & FLAG_DATA))
3891 +@@ -5370,7 +5371,17 @@ static void tcp_new_space(struct sock *sk)
3892 + sk->sk_write_space(sk);
3893 + }
3894 +
3895 +-static void tcp_check_space(struct sock *sk)
3896 ++/* Caller made space either from:
3897 ++ * 1) Freeing skbs in rtx queues (after tp->snd_una has advanced)
3898 ++ * 2) Sent skbs from output queue (and thus advancing tp->snd_nxt)
3899 ++ *
3900 ++ * We might be able to generate EPOLLOUT to the application if:
3901 ++ * 1) Space consumed in output/rtx queues is below sk->sk_sndbuf/2
3902 ++ * 2) notsent amount (tp->write_seq - tp->snd_nxt) became
3903 ++ * small enough that tcp_stream_memory_free() decides it
3904 ++ * is time to generate EPOLLOUT.
3905 ++ */
3906 ++void tcp_check_space(struct sock *sk)
3907 + {
3908 + /* pairs with tcp_poll() */
3909 + smp_mb();
3910 +diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c
3911 +index f0f67b25c97ab..62f5ef9e6f938 100644
3912 +--- a/net/ipv4/tcp_minisocks.c
3913 ++++ b/net/ipv4/tcp_minisocks.c
3914 +@@ -538,7 +538,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk,
3915 + newtp->tsoffset = treq->ts_off;
3916 + #ifdef CONFIG_TCP_MD5SIG
3917 + newtp->md5sig_info = NULL; /*XXX*/
3918 +- if (newtp->af_specific->md5_lookup(sk, newsk))
3919 ++ if (treq->af_specific->req_md5_lookup(sk, req_to_sk(req)))
3920 + newtp->tcp_header_len += TCPOLEN_MD5SIG_ALIGNED;
3921 + #endif
3922 + if (skb->len >= TCP_MSS_DEFAULT + newtp->tcp_header_len)
3923 +diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
3924 +index ce9987e6ff252..e37ad0b3645c9 100644
3925 +--- a/net/ipv4/tcp_output.c
3926 ++++ b/net/ipv4/tcp_output.c
3927 +@@ -82,6 +82,7 @@ static void tcp_event_new_data_sent(struct sock *sk, struct sk_buff *skb)
3928 +
3929 + NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPORIGDATASENT,
3930 + tcp_skb_pcount(skb));
3931 ++ tcp_check_space(sk);
3932 + }
3933 +
3934 + /* SND.NXT, if window was not shrunk or the amount of shrunk was less than one
3935 +diff --git a/net/ipv4/tcp_rate.c b/net/ipv4/tcp_rate.c
3936 +index 0de6935659635..6ab197928abbc 100644
3937 +--- a/net/ipv4/tcp_rate.c
3938 ++++ b/net/ipv4/tcp_rate.c
3939 +@@ -73,26 +73,31 @@ void tcp_rate_skb_sent(struct sock *sk, struct sk_buff *skb)
3940 + *
3941 + * If an ACK (s)acks multiple skbs (e.g., stretched-acks), this function is
3942 + * called multiple times. We favor the information from the most recently
3943 +- * sent skb, i.e., the skb with the highest prior_delivered count.
3944 ++ * sent skb, i.e., the skb with the most recently sent time and the highest
3945 ++ * sequence.
3946 + */
3947 + void tcp_rate_skb_delivered(struct sock *sk, struct sk_buff *skb,
3948 + struct rate_sample *rs)
3949 + {
3950 + struct tcp_sock *tp = tcp_sk(sk);
3951 + struct tcp_skb_cb *scb = TCP_SKB_CB(skb);
3952 ++ u64 tx_tstamp;
3953 +
3954 + if (!scb->tx.delivered_mstamp)
3955 + return;
3956 +
3957 ++ tx_tstamp = tcp_skb_timestamp_us(skb);
3958 + if (!rs->prior_delivered ||
3959 +- after(scb->tx.delivered, rs->prior_delivered)) {
3960 ++ tcp_skb_sent_after(tx_tstamp, tp->first_tx_mstamp,
3961 ++ scb->end_seq, rs->last_end_seq)) {
3962 + rs->prior_delivered = scb->tx.delivered;
3963 + rs->prior_mstamp = scb->tx.delivered_mstamp;
3964 + rs->is_app_limited = scb->tx.is_app_limited;
3965 + rs->is_retrans = scb->sacked & TCPCB_RETRANS;
3966 ++ rs->last_end_seq = scb->end_seq;
3967 +
3968 + /* Record send time of most recently ACKed packet: */
3969 +- tp->first_tx_mstamp = tcp_skb_timestamp_us(skb);
3970 ++ tp->first_tx_mstamp = tx_tstamp;
3971 + /* Find the duration of the "send phase" of this window: */
3972 + rs->interval_us = tcp_stamp_us_delta(tp->first_tx_mstamp,
3973 + scb->tx.first_tx_mstamp);
3974 +diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
3975 +index 1f6c752f13b40..3f88ba6555ab8 100644
3976 +--- a/net/ipv6/ip6_gre.c
3977 ++++ b/net/ipv6/ip6_gre.c
3978 +@@ -724,6 +724,7 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,
3979 + {
3980 + struct ip6_tnl *tunnel = netdev_priv(dev);
3981 + __be16 protocol;
3982 ++ __be16 flags;
3983 +
3984 + if (dev->type == ARPHRD_ETHER)
3985 + IPCB(skb)->flags = 0;
3986 +@@ -739,7 +740,6 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,
3987 + if (tunnel->parms.collect_md) {
3988 + struct ip_tunnel_info *tun_info;
3989 + const struct ip_tunnel_key *key;
3990 +- __be16 flags;
3991 + int tun_hlen;
3992 +
3993 + tun_info = skb_tunnel_info_txcheck(skb);
3994 +@@ -766,19 +766,19 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb,
3995 + gre_build_header(skb, tun_hlen,
3996 + flags, protocol,
3997 + tunnel_id_to_key32(tun_info->key.tun_id),
3998 +- (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++)
3999 ++ (flags & TUNNEL_SEQ) ? htonl(atomic_fetch_inc(&tunnel->o_seqno))
4000 + : 0);
4001 +
4002 + } else {
4003 +- if (tunnel->parms.o_flags & TUNNEL_SEQ)
4004 +- tunnel->o_seqno++;
4005 +-
4006 + if (skb_cow_head(skb, dev->needed_headroom ?: tunnel->hlen))
4007 + return -ENOMEM;
4008 +
4009 +- gre_build_header(skb, tunnel->tun_hlen, tunnel->parms.o_flags,
4010 ++ flags = tunnel->parms.o_flags;
4011 ++
4012 ++ gre_build_header(skb, tunnel->tun_hlen, flags,
4013 + protocol, tunnel->parms.o_key,
4014 +- htonl(tunnel->o_seqno));
4015 ++ (flags & TUNNEL_SEQ) ? htonl(atomic_fetch_inc(&tunnel->o_seqno))
4016 ++ : 0);
4017 + }
4018 +
4019 + return ip6_tnl_xmit(skb, dev, dsfield, fl6, encap_limit, pmtu,
4020 +@@ -1056,7 +1056,7 @@ static netdev_tx_t ip6erspan_tunnel_xmit(struct sk_buff *skb,
4021 + /* Push GRE header. */
4022 + proto = (t->parms.erspan_ver == 1) ? htons(ETH_P_ERSPAN)
4023 + : htons(ETH_P_ERSPAN2);
4024 +- gre_build_header(skb, 8, TUNNEL_SEQ, proto, 0, htonl(t->o_seqno++));
4025 ++ gre_build_header(skb, 8, TUNNEL_SEQ, proto, 0, htonl(atomic_fetch_inc(&t->o_seqno)));
4026 +
4027 + /* TooBig packet may have updated dst->dev's mtu */
4028 + if (!t->parms.collect_md && dst && dst_mtu(dst) > dst->dev->mtu)
4029 +diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c
4030 +index 9b6cae1e49d91..5fa791cf39ca9 100644
4031 +--- a/net/ipv6/syncookies.c
4032 ++++ b/net/ipv6/syncookies.c
4033 +@@ -170,7 +170,8 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
4034 + goto out;
4035 +
4036 + ret = NULL;
4037 +- req = cookie_tcp_reqsk_alloc(&tcp6_request_sock_ops, sk, skb);
4038 ++ req = cookie_tcp_reqsk_alloc(&tcp6_request_sock_ops,
4039 ++ &tcp_request_sock_ipv6_ops, sk, skb);
4040 + if (!req)
4041 + goto out;
4042 +
4043 +diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c
4044 +index 2c467c422dc63..fb67f1ca2495b 100644
4045 +--- a/net/netfilter/ipvs/ip_vs_conn.c
4046 ++++ b/net/netfilter/ipvs/ip_vs_conn.c
4047 +@@ -1495,7 +1495,7 @@ int __init ip_vs_conn_init(void)
4048 + pr_info("Connection hash table configured "
4049 + "(size=%d, memory=%ldKbytes)\n",
4050 + ip_vs_conn_tab_size,
4051 +- (long)(ip_vs_conn_tab_size*sizeof(struct list_head))/1024);
4052 ++ (long)(ip_vs_conn_tab_size*sizeof(*ip_vs_conn_tab))/1024);
4053 + IP_VS_DBG(0, "Each connection entry needs %zd bytes at least\n",
4054 + sizeof(struct ip_vs_conn));
4055 +
4056 +diff --git a/net/netfilter/nft_set_rbtree.c b/net/netfilter/nft_set_rbtree.c
4057 +index 217ab3644c25b..94a5446c5eae8 100644
4058 +--- a/net/netfilter/nft_set_rbtree.c
4059 ++++ b/net/netfilter/nft_set_rbtree.c
4060 +@@ -348,7 +348,11 @@ static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set,
4061 + *ext = &rbe->ext;
4062 + return -EEXIST;
4063 + } else {
4064 +- p = &parent->rb_left;
4065 ++ overlap = false;
4066 ++ if (nft_rbtree_interval_end(rbe))
4067 ++ p = &parent->rb_left;
4068 ++ else
4069 ++ p = &parent->rb_right;
4070 + }
4071 + }
4072 +
4073 +diff --git a/net/netfilter/nft_socket.c b/net/netfilter/nft_socket.c
4074 +index a28aca5124cef..8a0125e966c83 100644
4075 +--- a/net/netfilter/nft_socket.c
4076 ++++ b/net/netfilter/nft_socket.c
4077 +@@ -33,6 +33,32 @@ static void nft_socket_wildcard(const struct nft_pktinfo *pkt,
4078 + }
4079 + }
4080 +
4081 ++static struct sock *nft_socket_do_lookup(const struct nft_pktinfo *pkt)
4082 ++{
4083 ++ const struct net_device *indev = nft_in(pkt);
4084 ++ const struct sk_buff *skb = pkt->skb;
4085 ++ struct sock *sk = NULL;
4086 ++
4087 ++ if (!indev)
4088 ++ return NULL;
4089 ++
4090 ++ switch (nft_pf(pkt)) {
4091 ++ case NFPROTO_IPV4:
4092 ++ sk = nf_sk_lookup_slow_v4(nft_net(pkt), skb, indev);
4093 ++ break;
4094 ++#if IS_ENABLED(CONFIG_NF_TABLES_IPV6)
4095 ++ case NFPROTO_IPV6:
4096 ++ sk = nf_sk_lookup_slow_v6(nft_net(pkt), skb, indev);
4097 ++ break;
4098 ++#endif
4099 ++ default:
4100 ++ WARN_ON_ONCE(1);
4101 ++ break;
4102 ++ }
4103 ++
4104 ++ return sk;
4105 ++}
4106 ++
4107 + static void nft_socket_eval(const struct nft_expr *expr,
4108 + struct nft_regs *regs,
4109 + const struct nft_pktinfo *pkt)
4110 +@@ -46,20 +72,7 @@ static void nft_socket_eval(const struct nft_expr *expr,
4111 + sk = NULL;
4112 +
4113 + if (!sk)
4114 +- switch(nft_pf(pkt)) {
4115 +- case NFPROTO_IPV4:
4116 +- sk = nf_sk_lookup_slow_v4(nft_net(pkt), skb, nft_in(pkt));
4117 +- break;
4118 +-#if IS_ENABLED(CONFIG_NF_TABLES_IPV6)
4119 +- case NFPROTO_IPV6:
4120 +- sk = nf_sk_lookup_slow_v6(nft_net(pkt), skb, nft_in(pkt));
4121 +- break;
4122 +-#endif
4123 +- default:
4124 +- WARN_ON_ONCE(1);
4125 +- regs->verdict.code = NFT_BREAK;
4126 +- return;
4127 +- }
4128 ++ sk = nft_socket_do_lookup(pkt);
4129 +
4130 + if (!sk) {
4131 + regs->verdict.code = NFT_BREAK;
4132 +@@ -150,6 +163,16 @@ static int nft_socket_dump(struct sk_buff *skb,
4133 + return 0;
4134 + }
4135 +
4136 ++static int nft_socket_validate(const struct nft_ctx *ctx,
4137 ++ const struct nft_expr *expr,
4138 ++ const struct nft_data **data)
4139 ++{
4140 ++ return nft_chain_validate_hooks(ctx->chain,
4141 ++ (1 << NF_INET_PRE_ROUTING) |
4142 ++ (1 << NF_INET_LOCAL_IN) |
4143 ++ (1 << NF_INET_LOCAL_OUT));
4144 ++}
4145 ++
4146 + static struct nft_expr_type nft_socket_type;
4147 + static const struct nft_expr_ops nft_socket_ops = {
4148 + .type = &nft_socket_type,
4149 +@@ -157,6 +180,7 @@ static const struct nft_expr_ops nft_socket_ops = {
4150 + .eval = nft_socket_eval,
4151 + .init = nft_socket_init,
4152 + .dump = nft_socket_dump,
4153 ++ .validate = nft_socket_validate,
4154 + };
4155 +
4156 + static struct nft_expr_type nft_socket_type __read_mostly = {
4157 +diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c
4158 +index 0948f14ce221a..d4e5969771f0f 100644
4159 +--- a/net/sctp/sm_sideeffect.c
4160 ++++ b/net/sctp/sm_sideeffect.c
4161 +@@ -458,6 +458,10 @@ void sctp_generate_reconf_event(struct timer_list *t)
4162 + goto out_unlock;
4163 + }
4164 +
4165 ++ /* This happens when the response arrives after the timer is triggered. */
4166 ++ if (!asoc->strreset_chunk)
4167 ++ goto out_unlock;
4168 ++
4169 + error = sctp_do_sm(net, SCTP_EVENT_T_TIMEOUT,
4170 + SCTP_ST_TIMEOUT(SCTP_EVENT_TIMEOUT_RECONF),
4171 + asoc->state, asoc->ep, asoc,
4172 +diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c
4173 +index 1b98f3241150b..35db3260e8d56 100644
4174 +--- a/net/smc/af_smc.c
4175 ++++ b/net/smc/af_smc.c
4176 +@@ -1057,6 +1057,8 @@ static void smc_connect_work(struct work_struct *work)
4177 + smc->sk.sk_state = SMC_CLOSED;
4178 + if (rc == -EPIPE || rc == -EAGAIN)
4179 + smc->sk.sk_err = EPIPE;
4180 ++ else if (rc == -ECONNREFUSED)
4181 ++ smc->sk.sk_err = ECONNREFUSED;
4182 + else if (signal_pending(current))
4183 + smc->sk.sk_err = -sock_intr_errno(timeo);
4184 + sock_put(&smc->sk); /* passive closing */
4185 +diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c
4186 +index f718c7346088f..1f56225a10e3c 100644
4187 +--- a/net/tls/tls_device.c
4188 ++++ b/net/tls/tls_device.c
4189 +@@ -483,11 +483,13 @@ handle_error:
4190 + copy = min_t(size_t, size, (pfrag->size - pfrag->offset));
4191 + copy = min_t(size_t, copy, (max_open_record_len - record->len));
4192 +
4193 +- rc = tls_device_copy_data(page_address(pfrag->page) +
4194 +- pfrag->offset, copy, msg_iter);
4195 +- if (rc)
4196 +- goto handle_error;
4197 +- tls_append_frag(record, pfrag, copy);
4198 ++ if (copy) {
4199 ++ rc = tls_device_copy_data(page_address(pfrag->page) +
4200 ++ pfrag->offset, copy, msg_iter);
4201 ++ if (rc)
4202 ++ goto handle_error;
4203 ++ tls_append_frag(record, pfrag, copy);
4204 ++ }
4205 +
4206 + size -= copy;
4207 + if (!size) {
4208 +diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c
4209 +index 304bf725a6132..24a009d73f1e7 100644
4210 +--- a/sound/soc/codecs/wm8731.c
4211 ++++ b/sound/soc/codecs/wm8731.c
4212 +@@ -602,7 +602,7 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731)
4213 + ret = wm8731_reset(wm8731->regmap);
4214 + if (ret < 0) {
4215 + dev_err(dev, "Failed to issue reset: %d\n", ret);
4216 +- goto err_regulator_enable;
4217 ++ goto err;
4218 + }
4219 +
4220 + /* Clear POWEROFF, keep everything else disabled */
4221 +@@ -619,10 +619,7 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731)
4222 +
4223 + regcache_mark_dirty(wm8731->regmap);
4224 +
4225 +-err_regulator_enable:
4226 +- /* Regulators will be enabled by bias management */
4227 +- regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies);
4228 +-
4229 ++err:
4230 + return ret;
4231 + }
4232 +
4233 +@@ -766,21 +763,27 @@ static int wm8731_i2c_probe(struct i2c_client *i2c,
4234 + ret = PTR_ERR(wm8731->regmap);
4235 + dev_err(&i2c->dev, "Failed to allocate register map: %d\n",
4236 + ret);
4237 +- return ret;
4238 ++ goto err_regulator_enable;
4239 + }
4240 +
4241 + ret = wm8731_hw_init(&i2c->dev, wm8731);
4242 + if (ret != 0)
4243 +- return ret;
4244 ++ goto err_regulator_enable;
4245 +
4246 + ret = devm_snd_soc_register_component(&i2c->dev,
4247 + &soc_component_dev_wm8731, &wm8731_dai, 1);
4248 + if (ret != 0) {
4249 + dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret);
4250 +- return ret;
4251 ++ goto err_regulator_enable;
4252 + }
4253 +
4254 + return 0;
4255 ++
4256 ++err_regulator_enable:
4257 ++ /* Regulators will be enabled by bias management */
4258 ++ regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies);
4259 ++
4260 ++ return ret;
4261 + }
4262 +
4263 + static int wm8731_i2c_remove(struct i2c_client *client)
4264 +diff --git a/sound/soc/intel/common/soc-acpi-intel-tgl-match.c b/sound/soc/intel/common/soc-acpi-intel-tgl-match.c
4265 +index 9f243e60b95c2..15d862cdcd2fe 100644
4266 +--- a/sound/soc/intel/common/soc-acpi-intel-tgl-match.c
4267 ++++ b/sound/soc/intel/common/soc-acpi-intel-tgl-match.c
4268 +@@ -126,13 +126,13 @@ static const struct snd_soc_acpi_adr_device mx8373_1_adr[] = {
4269 + {
4270 + .adr = 0x000123019F837300,
4271 + .num_endpoints = 1,
4272 +- .endpoints = &spk_l_endpoint,
4273 ++ .endpoints = &spk_r_endpoint,
4274 + .name_prefix = "Right"
4275 + },
4276 + {
4277 + .adr = 0x000127019F837300,
4278 + .num_endpoints = 1,
4279 +- .endpoints = &spk_r_endpoint,
4280 ++ .endpoints = &spk_l_endpoint,
4281 + .name_prefix = "Left"
4282 + }
4283 + };
4284 +diff --git a/tools/perf/arch/arm64/util/Build b/tools/perf/arch/arm64/util/Build
4285 +index b53294d74b011..eddaf9bf5729c 100644
4286 +--- a/tools/perf/arch/arm64/util/Build
4287 ++++ b/tools/perf/arch/arm64/util/Build
4288 +@@ -1,5 +1,4 @@
4289 + perf-y += header.o
4290 +-perf-y += machine.o
4291 + perf-y += perf_regs.o
4292 + perf-y += tsc.o
4293 + perf-$(CONFIG_DWARF) += dwarf-regs.o
4294 +diff --git a/tools/perf/arch/arm64/util/machine.c b/tools/perf/arch/arm64/util/machine.c
4295 +deleted file mode 100644
4296 +index d41b27e781d38..0000000000000
4297 +--- a/tools/perf/arch/arm64/util/machine.c
4298 ++++ /dev/null
4299 +@@ -1,27 +0,0 @@
4300 +-// SPDX-License-Identifier: GPL-2.0
4301 +-
4302 +-#include <stdio.h>
4303 +-#include <string.h>
4304 +-#include "debug.h"
4305 +-#include "symbol.h"
4306 +-
4307 +-/* On arm64, kernel text segment start at high memory address,
4308 +- * for example 0xffff 0000 8xxx xxxx. Modules start at a low memory
4309 +- * address, like 0xffff 0000 00ax xxxx. When only samll amount of
4310 +- * memory is used by modules, gap between end of module's text segment
4311 +- * and start of kernel text segment may be reach 2G.
4312 +- * Therefore do not fill this gap and do not assign it to the kernel dso map.
4313 +- */
4314 +-
4315 +-#define SYMBOL_LIMIT (1 << 12) /* 4K */
4316 +-
4317 +-void arch__symbols__fixup_end(struct symbol *p, struct symbol *c)
4318 +-{
4319 +- if ((strchr(p->name, '[') && strchr(c->name, '[') == NULL) ||
4320 +- (strchr(p->name, '[') == NULL && strchr(c->name, '[')))
4321 +- /* Limit range of last symbol in module and kernel */
4322 +- p->end += SYMBOL_LIMIT;
4323 +- else
4324 +- p->end = c->start;
4325 +- pr_debug4("%s sym:%s end:%#lx\n", __func__, p->name, p->end);
4326 +-}
4327 +diff --git a/tools/perf/arch/s390/util/machine.c b/tools/perf/arch/s390/util/machine.c
4328 +index 724efb2d842d7..7219ecdb84234 100644
4329 +--- a/tools/perf/arch/s390/util/machine.c
4330 ++++ b/tools/perf/arch/s390/util/machine.c
4331 +@@ -34,19 +34,3 @@ int arch__fix_module_text_start(u64 *start, u64 *size, const char *name)
4332 +
4333 + return 0;
4334 + }
4335 +-
4336 +-/* On s390 kernel text segment start is located at very low memory addresses,
4337 +- * for example 0x10000. Modules are located at very high memory addresses,
4338 +- * for example 0x3ff xxxx xxxx. The gap between end of kernel text segment
4339 +- * and beginning of first module's text segment is very big.
4340 +- * Therefore do not fill this gap and do not assign it to the kernel dso map.
4341 +- */
4342 +-void arch__symbols__fixup_end(struct symbol *p, struct symbol *c)
4343 +-{
4344 +- if (strchr(p->name, '[') == NULL && strchr(c->name, '['))
4345 +- /* Last kernel symbol mapped to end of page */
4346 +- p->end = roundup(p->end, page_size);
4347 +- else
4348 +- p->end = c->start;
4349 +- pr_debug4("%s sym:%s end:%#lx\n", __func__, p->name, p->end);
4350 +-}
4351 +diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c
4352 +index 7356eb398b32a..94809aed8b447 100644
4353 +--- a/tools/perf/util/symbol-elf.c
4354 ++++ b/tools/perf/util/symbol-elf.c
4355 +@@ -1245,7 +1245,7 @@ int dso__load_sym(struct dso *dso, struct map *map, struct symsrc *syms_ss,
4356 + * For misannotated, zeroed, ASM function sizes.
4357 + */
4358 + if (nr > 0) {
4359 +- symbols__fixup_end(&dso->symbols);
4360 ++ symbols__fixup_end(&dso->symbols, false);
4361 + symbols__fixup_duplicate(&dso->symbols);
4362 + if (kmap) {
4363 + /*
4364 +diff --git a/tools/perf/util/symbol.c b/tools/perf/util/symbol.c
4365 +index 3609da7cce0ab..33954835c8231 100644
4366 +--- a/tools/perf/util/symbol.c
4367 ++++ b/tools/perf/util/symbol.c
4368 +@@ -101,11 +101,6 @@ static int prefix_underscores_count(const char *str)
4369 + return tail - str;
4370 + }
4371 +
4372 +-void __weak arch__symbols__fixup_end(struct symbol *p, struct symbol *c)
4373 +-{
4374 +- p->end = c->start;
4375 +-}
4376 +-
4377 + const char * __weak arch__normalize_symbol_name(const char *name)
4378 + {
4379 + return name;
4380 +@@ -217,7 +212,8 @@ again:
4381 + }
4382 + }
4383 +
4384 +-void symbols__fixup_end(struct rb_root_cached *symbols)
4385 ++/* Update zero-sized symbols using the address of the next symbol */
4386 ++void symbols__fixup_end(struct rb_root_cached *symbols, bool is_kallsyms)
4387 + {
4388 + struct rb_node *nd, *prevnd = rb_first_cached(symbols);
4389 + struct symbol *curr, *prev;
4390 +@@ -231,8 +227,29 @@ void symbols__fixup_end(struct rb_root_cached *symbols)
4391 + prev = curr;
4392 + curr = rb_entry(nd, struct symbol, rb_node);
4393 +
4394 +- if (prev->end == prev->start || prev->end != curr->start)
4395 +- arch__symbols__fixup_end(prev, curr);
4396 ++ /*
4397 ++ * On some architecture kernel text segment start is located at
4398 ++ * some low memory address, while modules are located at high
4399 ++ * memory addresses (or vice versa). The gap between end of
4400 ++ * kernel text segment and beginning of first module's text
4401 ++ * segment is very big. Therefore do not fill this gap and do
4402 ++ * not assign it to the kernel dso map (kallsyms).
4403 ++ *
4404 ++ * In kallsyms, it determines module symbols using '[' character
4405 ++ * like in:
4406 ++ * ffffffffc1937000 T hdmi_driver_init [snd_hda_codec_hdmi]
4407 ++ */
4408 ++ if (prev->end == prev->start) {
4409 ++ /* Last kernel/module symbol mapped to end of page */
4410 ++ if (is_kallsyms && (!strchr(prev->name, '[') !=
4411 ++ !strchr(curr->name, '[')))
4412 ++ prev->end = roundup(prev->end + 4096, 4096);
4413 ++ else
4414 ++ prev->end = curr->start;
4415 ++
4416 ++ pr_debug4("%s sym:%s end:%#" PRIx64 "\n",
4417 ++ __func__, prev->name, prev->end);
4418 ++ }
4419 + }
4420 +
4421 + /* Last entry */
4422 +@@ -1456,7 +1473,7 @@ int __dso__load_kallsyms(struct dso *dso, const char *filename,
4423 + if (kallsyms__delta(kmap, filename, &delta))
4424 + return -1;
4425 +
4426 +- symbols__fixup_end(&dso->symbols);
4427 ++ symbols__fixup_end(&dso->symbols, true);
4428 + symbols__fixup_duplicate(&dso->symbols);
4429 +
4430 + if (dso->kernel == DSO_SPACE__KERNEL_GUEST)
4431 +@@ -1651,7 +1668,7 @@ int dso__load_bfd_symbols(struct dso *dso, const char *debugfile)
4432 + #undef bfd_asymbol_section
4433 + #endif
4434 +
4435 +- symbols__fixup_end(&dso->symbols);
4436 ++ symbols__fixup_end(&dso->symbols, false);
4437 + symbols__fixup_duplicate(&dso->symbols);
4438 + dso->adjust_symbols = 1;
4439 +
4440 +diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h
4441 +index 954d6a049ee23..28721d761d91e 100644
4442 +--- a/tools/perf/util/symbol.h
4443 ++++ b/tools/perf/util/symbol.h
4444 +@@ -192,7 +192,7 @@ void __symbols__insert(struct rb_root_cached *symbols, struct symbol *sym,
4445 + bool kernel);
4446 + void symbols__insert(struct rb_root_cached *symbols, struct symbol *sym);
4447 + void symbols__fixup_duplicate(struct rb_root_cached *symbols);
4448 +-void symbols__fixup_end(struct rb_root_cached *symbols);
4449 ++void symbols__fixup_end(struct rb_root_cached *symbols, bool is_kallsyms);
4450 + void maps__fixup_end(struct maps *maps);
4451 +
4452 + typedef int (*mapfn_t)(u64 start, u64 len, u64 pgoff, void *data);
4453 +@@ -230,7 +230,6 @@ const char *arch__normalize_symbol_name(const char *name);
4454 + #define SYMBOL_A 0
4455 + #define SYMBOL_B 1
4456 +
4457 +-void arch__symbols__fixup_end(struct symbol *p, struct symbol *c);
4458 + int arch__compare_symbol_names(const char *namea, const char *nameb);
4459 + int arch__compare_symbol_names_n(const char *namea, const char *nameb,
4460 + unsigned int n);