1 |
commit: 7aedd27a1f216799c288196924d35eb33df1eb1f |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Mon May 9 10:55:07 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Mon May 9 10:55:07 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=7aedd27a |
7 |
|
8 |
Linux patch 5.4.192 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1191_linux-5.4.192.patch | 2396 ++++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 2400 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index bad996a3..cab1fe9c 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -807,6 +807,10 @@ Patch: 1190_linux-5.4.191.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.4.191 |
23 |
|
24 |
+Patch: 1191_linux-5.4.192.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.4.192 |
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/1191_linux-5.4.192.patch b/1191_linux-5.4.192.patch |
33 |
new file mode 100644 |
34 |
index 00000000..deeec338 |
35 |
--- /dev/null |
36 |
+++ b/1191_linux-5.4.192.patch |
37 |
@@ -0,0 +1,2396 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 365b487e50d7f..968470cf368ee 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 5 |
45 |
+ PATCHLEVEL = 4 |
46 |
+-SUBLEVEL = 191 |
47 |
++SUBLEVEL = 192 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Kleptomaniac Octopus |
50 |
+ |
51 |
+diff --git a/arch/arm/boot/dts/am3517-evm.dts b/arch/arm/boot/dts/am3517-evm.dts |
52 |
+index a1fd3e63e86ec..3db30ce134b95 100644 |
53 |
+--- a/arch/arm/boot/dts/am3517-evm.dts |
54 |
++++ b/arch/arm/boot/dts/am3517-evm.dts |
55 |
+@@ -160,6 +160,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 |
+@@ -167,7 +169,9 @@ |
65 |
+ }; |
66 |
+ |
67 |
+ &davinci_emac { |
68 |
+- status = "okay"; |
69 |
++ pinctrl-names = "default"; |
70 |
++ pinctrl-0 = <ðernet_pins>; |
71 |
++ status = "okay"; |
72 |
+ }; |
73 |
+ |
74 |
+ &davinci_mdio { |
75 |
+@@ -192,6 +196,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 |
+@@ -204,6 +210,8 @@ |
85 |
+ }; |
86 |
+ |
87 |
+ &i2c3 { |
88 |
++ pinctrl-names = "default"; |
89 |
++ pinctrl-0 = <&i2c3_pins>; |
90 |
+ clock-frequency = <400000>; |
91 |
+ }; |
92 |
+ |
93 |
+@@ -222,6 +230,8 @@ |
94 |
+ }; |
95 |
+ |
96 |
+ &usbhshost { |
97 |
++ pinctrl-names = "default"; |
98 |
++ pinctrl-0 = <&hsusb1_pins>; |
99 |
+ port1-mode = "ehci-phy"; |
100 |
+ }; |
101 |
+ |
102 |
+@@ -230,8 +240,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 |
+@@ -299,8 +336,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/at91sam9g20ek_common.dtsi b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi |
177 |
+index bda22700110cd..287566e09a673 100644 |
178 |
+--- a/arch/arm/boot/dts/at91sam9g20ek_common.dtsi |
179 |
++++ b/arch/arm/boot/dts/at91sam9g20ek_common.dtsi |
180 |
+@@ -217,6 +217,12 @@ |
181 |
+ wm8731: wm8731@1b { |
182 |
+ compatible = "wm8731"; |
183 |
+ reg = <0x1b>; |
184 |
++ |
185 |
++ /* PCK0 at 12MHz */ |
186 |
++ clocks = <&pmc PMC_TYPE_SYSTEM 8>; |
187 |
++ clock-names = "mclk"; |
188 |
++ assigned-clocks = <&pmc PMC_TYPE_SYSTEM 8>; |
189 |
++ assigned-clock-rates = <12000000>; |
190 |
+ }; |
191 |
+ }; |
192 |
+ |
193 |
+diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi |
194 |
+index 7c4ad541c3f5e..b165bd6ea53b6 100644 |
195 |
+--- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi |
196 |
++++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi |
197 |
+@@ -314,6 +314,8 @@ |
198 |
+ codec: sgtl5000@a { |
199 |
+ compatible = "fsl,sgtl5000"; |
200 |
+ reg = <0x0a>; |
201 |
++ pinctrl-names = "default"; |
202 |
++ pinctrl-0 = <&pinctrl_sgtl5000>; |
203 |
+ clocks = <&clks IMX6QDL_CLK_CKO>; |
204 |
+ VDDA-supply = <®_module_3v3_audio>; |
205 |
+ VDDIO-supply = <®_module_3v3>; |
206 |
+@@ -543,8 +545,6 @@ |
207 |
+ MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x130b0 |
208 |
+ MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0 |
209 |
+ MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0 |
210 |
+- /* SGTL5000 sys_mclk */ |
211 |
+- MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0 |
212 |
+ >; |
213 |
+ }; |
214 |
+ |
215 |
+@@ -810,6 +810,12 @@ |
216 |
+ >; |
217 |
+ }; |
218 |
+ |
219 |
++ pinctrl_sgtl5000: sgtl5000grp { |
220 |
++ fsl,pins = < |
221 |
++ MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0 |
222 |
++ >; |
223 |
++ }; |
224 |
++ |
225 |
+ pinctrl_spdif: spdifgrp { |
226 |
+ fsl,pins = < |
227 |
+ MX6QDL_PAD_GPIO_16__SPDIF_IN 0x1b0b0 |
228 |
+diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi |
229 |
+index d56728f03c35f..c83323b9ea53c 100644 |
230 |
+--- a/arch/arm/boot/dts/imx6ull-colibri.dtsi |
231 |
++++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi |
232 |
+@@ -37,7 +37,7 @@ |
233 |
+ |
234 |
+ reg_sd1_vmmc: regulator-sd1-vmmc { |
235 |
+ compatible = "regulator-gpio"; |
236 |
+- gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>; |
237 |
++ gpios = <&gpio5 9 GPIO_ACTIVE_HIGH>; |
238 |
+ pinctrl-names = "default"; |
239 |
+ pinctrl-0 = <&pinctrl_snvs_reg_sd>; |
240 |
+ regulator-always-on; |
241 |
+diff --git a/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts b/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts |
242 |
+index f7a841a288654..270e4986b6e64 100644 |
243 |
+--- a/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts |
244 |
++++ b/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts |
245 |
+@@ -11,3 +11,18 @@ |
246 |
+ model = "LogicPD Zoom OMAP35xx SOM-LV Development Kit"; |
247 |
+ compatible = "logicpd,dm3730-som-lv-devkit", "ti,omap3"; |
248 |
+ }; |
249 |
++ |
250 |
++&omap3_pmx_core2 { |
251 |
++ pinctrl-names = "default"; |
252 |
++ pinctrl-0 = <&hsusb2_2_pins>; |
253 |
++ hsusb2_2_pins: pinmux_hsusb2_2_pins { |
254 |
++ pinctrl-single,pins = < |
255 |
++ OMAP3430_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */ |
256 |
++ OMAP3430_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */ |
257 |
++ OMAP3430_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */ |
258 |
++ OMAP3430_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */ |
259 |
++ OMAP3430_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */ |
260 |
++ OMAP3430_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */ |
261 |
++ >; |
262 |
++ }; |
263 |
++}; |
264 |
+diff --git a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts |
265 |
+index a604d92221a4f..c757f0d7781c1 100644 |
266 |
+--- a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts |
267 |
++++ b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts |
268 |
+@@ -11,3 +11,18 @@ |
269 |
+ model = "LogicPD Zoom DM3730 SOM-LV Development Kit"; |
270 |
+ compatible = "logicpd,dm3730-som-lv-devkit", "ti,omap3630", "ti,omap3"; |
271 |
+ }; |
272 |
++ |
273 |
++&omap3_pmx_core2 { |
274 |
++ pinctrl-names = "default"; |
275 |
++ pinctrl-0 = <&hsusb2_2_pins>; |
276 |
++ hsusb2_2_pins: pinmux_hsusb2_2_pins { |
277 |
++ pinctrl-single,pins = < |
278 |
++ OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */ |
279 |
++ OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */ |
280 |
++ OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */ |
281 |
++ OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */ |
282 |
++ OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */ |
283 |
++ OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */ |
284 |
++ >; |
285 |
++ }; |
286 |
++}; |
287 |
+diff --git a/arch/arm/boot/dts/logicpd-som-lv.dtsi b/arch/arm/boot/dts/logicpd-som-lv.dtsi |
288 |
+index b56524cc7fe27..55b619c99e24d 100644 |
289 |
+--- a/arch/arm/boot/dts/logicpd-som-lv.dtsi |
290 |
++++ b/arch/arm/boot/dts/logicpd-som-lv.dtsi |
291 |
+@@ -265,21 +265,6 @@ |
292 |
+ }; |
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 |
+- |
310 |
+ &uart2 { |
311 |
+ interrupts-extended = <&intc 73 &omap3_pmx_core OMAP3_UART2_RX>; |
312 |
+ pinctrl-names = "default"; |
313 |
+diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi |
314 |
+index 186b2af7743e3..089e9f1f442b5 100644 |
315 |
+--- a/arch/arm/boot/dts/omap3-gta04.dtsi |
316 |
++++ b/arch/arm/boot/dts/omap3-gta04.dtsi |
317 |
+@@ -31,6 +31,8 @@ |
318 |
+ aliases { |
319 |
+ display0 = &lcd; |
320 |
+ display1 = &tv0; |
321 |
++ /delete-property/ mmc2; |
322 |
++ /delete-property/ mmc3; |
323 |
+ }; |
324 |
+ |
325 |
+ ldo_3v3: fixedregulator { |
326 |
+diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c |
327 |
+index 5c3845730dbf5..0b80f8bcd3047 100644 |
328 |
+--- a/arch/arm/mach-omap2/omap4-common.c |
329 |
++++ b/arch/arm/mach-omap2/omap4-common.c |
330 |
+@@ -314,10 +314,12 @@ void __init omap_gic_of_init(void) |
331 |
+ |
332 |
+ np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic"); |
333 |
+ gic_dist_base_addr = of_iomap(np, 0); |
334 |
++ of_node_put(np); |
335 |
+ WARN_ON(!gic_dist_base_addr); |
336 |
+ |
337 |
+ np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-twd-timer"); |
338 |
+ twd_base = of_iomap(np, 0); |
339 |
++ of_node_put(np); |
340 |
+ WARN_ON(!twd_base); |
341 |
+ |
342 |
+ skip_errata_init: |
343 |
+diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi |
344 |
+index d61f43052a344..8e9ad1e51d665 100644 |
345 |
+--- a/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi |
346 |
++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-a311d.dtsi |
347 |
+@@ -11,26 +11,6 @@ |
348 |
+ compatible = "operating-points-v2"; |
349 |
+ opp-shared; |
350 |
+ |
351 |
+- opp-100000000 { |
352 |
+- opp-hz = /bits/ 64 <100000000>; |
353 |
+- opp-microvolt = <731000>; |
354 |
+- }; |
355 |
+- |
356 |
+- opp-250000000 { |
357 |
+- opp-hz = /bits/ 64 <250000000>; |
358 |
+- opp-microvolt = <731000>; |
359 |
+- }; |
360 |
+- |
361 |
+- opp-500000000 { |
362 |
+- opp-hz = /bits/ 64 <500000000>; |
363 |
+- opp-microvolt = <731000>; |
364 |
+- }; |
365 |
+- |
366 |
+- opp-667000000 { |
367 |
+- opp-hz = /bits/ 64 <667000000>; |
368 |
+- opp-microvolt = <731000>; |
369 |
+- }; |
370 |
+- |
371 |
+ opp-1000000000 { |
372 |
+ opp-hz = /bits/ 64 <1000000000>; |
373 |
+ opp-microvolt = <761000>; |
374 |
+@@ -71,26 +51,6 @@ |
375 |
+ compatible = "operating-points-v2"; |
376 |
+ opp-shared; |
377 |
+ |
378 |
+- opp-100000000 { |
379 |
+- opp-hz = /bits/ 64 <100000000>; |
380 |
+- opp-microvolt = <731000>; |
381 |
+- }; |
382 |
+- |
383 |
+- opp-250000000 { |
384 |
+- opp-hz = /bits/ 64 <250000000>; |
385 |
+- opp-microvolt = <731000>; |
386 |
+- }; |
387 |
+- |
388 |
+- opp-500000000 { |
389 |
+- opp-hz = /bits/ 64 <500000000>; |
390 |
+- opp-microvolt = <731000>; |
391 |
+- }; |
392 |
+- |
393 |
+- opp-667000000 { |
394 |
+- opp-hz = /bits/ 64 <667000000>; |
395 |
+- opp-microvolt = <731000>; |
396 |
+- }; |
397 |
+- |
398 |
+ opp-1000000000 { |
399 |
+ opp-hz = /bits/ 64 <1000000000>; |
400 |
+ opp-microvolt = <731000>; |
401 |
+diff --git a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi |
402 |
+index 046cc332d07f9..f2543da63c39d 100644 |
403 |
+--- a/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi |
404 |
++++ b/arch/arm64/boot/dts/amlogic/meson-g12b-s922x.dtsi |
405 |
+@@ -11,26 +11,6 @@ |
406 |
+ compatible = "operating-points-v2"; |
407 |
+ opp-shared; |
408 |
+ |
409 |
+- opp-100000000 { |
410 |
+- opp-hz = /bits/ 64 <100000000>; |
411 |
+- opp-microvolt = <731000>; |
412 |
+- }; |
413 |
+- |
414 |
+- opp-250000000 { |
415 |
+- opp-hz = /bits/ 64 <250000000>; |
416 |
+- opp-microvolt = <731000>; |
417 |
+- }; |
418 |
+- |
419 |
+- opp-500000000 { |
420 |
+- opp-hz = /bits/ 64 <500000000>; |
421 |
+- opp-microvolt = <731000>; |
422 |
+- }; |
423 |
+- |
424 |
+- opp-667000000 { |
425 |
+- opp-hz = /bits/ 64 <667000000>; |
426 |
+- opp-microvolt = <731000>; |
427 |
+- }; |
428 |
+- |
429 |
+ opp-1000000000 { |
430 |
+ opp-hz = /bits/ 64 <1000000000>; |
431 |
+ opp-microvolt = <731000>; |
432 |
+@@ -71,26 +51,6 @@ |
433 |
+ compatible = "operating-points-v2"; |
434 |
+ opp-shared; |
435 |
+ |
436 |
+- opp-100000000 { |
437 |
+- opp-hz = /bits/ 64 <100000000>; |
438 |
+- opp-microvolt = <751000>; |
439 |
+- }; |
440 |
+- |
441 |
+- opp-250000000 { |
442 |
+- opp-hz = /bits/ 64 <250000000>; |
443 |
+- opp-microvolt = <751000>; |
444 |
+- }; |
445 |
+- |
446 |
+- opp-500000000 { |
447 |
+- opp-hz = /bits/ 64 <500000000>; |
448 |
+- opp-microvolt = <751000>; |
449 |
+- }; |
450 |
+- |
451 |
+- opp-667000000 { |
452 |
+- opp-hz = /bits/ 64 <667000000>; |
453 |
+- opp-microvolt = <751000>; |
454 |
+- }; |
455 |
+- |
456 |
+ opp-1000000000 { |
457 |
+ opp-hz = /bits/ 64 <1000000000>; |
458 |
+ opp-microvolt = <771000>; |
459 |
+diff --git a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi |
460 |
+index 8ba3555ca3693..dd62a608c805a 100644 |
461 |
+--- a/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi |
462 |
++++ b/arch/arm64/boot/dts/amlogic/meson-sm1.dtsi |
463 |
+@@ -55,26 +55,6 @@ |
464 |
+ compatible = "operating-points-v2"; |
465 |
+ opp-shared; |
466 |
+ |
467 |
+- opp-100000000 { |
468 |
+- opp-hz = /bits/ 64 <100000000>; |
469 |
+- opp-microvolt = <730000>; |
470 |
+- }; |
471 |
+- |
472 |
+- opp-250000000 { |
473 |
+- opp-hz = /bits/ 64 <250000000>; |
474 |
+- opp-microvolt = <730000>; |
475 |
+- }; |
476 |
+- |
477 |
+- opp-500000000 { |
478 |
+- opp-hz = /bits/ 64 <500000000>; |
479 |
+- opp-microvolt = <730000>; |
480 |
+- }; |
481 |
+- |
482 |
+- opp-667000000 { |
483 |
+- opp-hz = /bits/ 64 <666666666>; |
484 |
+- opp-microvolt = <750000>; |
485 |
+- }; |
486 |
+- |
487 |
+ opp-1000000000 { |
488 |
+ opp-hz = /bits/ 64 <1000000000>; |
489 |
+ opp-microvolt = <770000>; |
490 |
+diff --git a/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts b/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts |
491 |
+index 9ad1d43b8ce75..4fa39654b695d 100644 |
492 |
+--- a/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts |
493 |
++++ b/arch/arm64/boot/dts/freescale/imx8mn-ddr4-evk.dts |
494 |
+@@ -213,6 +213,10 @@ |
495 |
+ interrupts = <3 GPIO_ACTIVE_LOW>; |
496 |
+ rohm,reset-snvs-powered; |
497 |
+ |
498 |
++ #clock-cells = <0>; |
499 |
++ clocks = <&osc_32k 0>; |
500 |
++ clock-output-names = "clk-32k-out"; |
501 |
++ |
502 |
+ regulators { |
503 |
+ buck1_reg: BUCK1 { |
504 |
+ regulator-name = "BUCK1"; |
505 |
+diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h |
506 |
+index 2b7cc5397f80d..91a06cef50c1b 100644 |
507 |
+--- a/arch/x86/include/asm/microcode.h |
508 |
++++ b/arch/x86/include/asm/microcode.h |
509 |
+@@ -133,11 +133,13 @@ extern void load_ucode_ap(void); |
510 |
+ void reload_early_microcode(void); |
511 |
+ extern bool get_builtin_firmware(struct cpio_data *cd, const char *name); |
512 |
+ extern bool initrd_gone; |
513 |
++void microcode_bsp_resume(void); |
514 |
+ #else |
515 |
+ static inline int __init microcode_init(void) { return 0; }; |
516 |
+ static inline void __init load_ucode_bsp(void) { } |
517 |
+ static inline void load_ucode_ap(void) { } |
518 |
+ static inline void reload_early_microcode(void) { } |
519 |
++static inline void microcode_bsp_resume(void) { } |
520 |
+ static inline bool |
521 |
+ get_builtin_firmware(struct cpio_data *cd, const char *name) { return false; } |
522 |
+ #endif |
523 |
+diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c |
524 |
+index 4a4198b806b4e..c95a27513a30c 100644 |
525 |
+--- a/arch/x86/kernel/cpu/microcode/core.c |
526 |
++++ b/arch/x86/kernel/cpu/microcode/core.c |
527 |
+@@ -772,9 +772,9 @@ static struct subsys_interface mc_cpu_interface = { |
528 |
+ }; |
529 |
+ |
530 |
+ /** |
531 |
+- * mc_bp_resume - Update boot CPU microcode during resume. |
532 |
++ * microcode_bsp_resume - Update boot CPU microcode during resume. |
533 |
+ */ |
534 |
+-static void mc_bp_resume(void) |
535 |
++void microcode_bsp_resume(void) |
536 |
+ { |
537 |
+ int cpu = smp_processor_id(); |
538 |
+ struct ucode_cpu_info *uci = ucode_cpu_info + cpu; |
539 |
+@@ -786,7 +786,7 @@ static void mc_bp_resume(void) |
540 |
+ } |
541 |
+ |
542 |
+ static struct syscore_ops mc_syscore_ops = { |
543 |
+- .resume = mc_bp_resume, |
544 |
++ .resume = microcode_bsp_resume, |
545 |
+ }; |
546 |
+ |
547 |
+ static int mc_cpu_starting(unsigned int cpu) |
548 |
+diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c |
549 |
+index 1847e993ac63a..f3f7f4cb15a6b 100644 |
550 |
+--- a/arch/x86/lib/usercopy_64.c |
551 |
++++ b/arch/x86/lib/usercopy_64.c |
552 |
+@@ -142,7 +142,7 @@ void __memcpy_flushcache(void *_dst, const void *_src, size_t size) |
553 |
+ |
554 |
+ /* cache copy and flush to align dest */ |
555 |
+ if (!IS_ALIGNED(dest, 8)) { |
556 |
+- unsigned len = min_t(unsigned, size, ALIGN(dest, 8) - dest); |
557 |
++ size_t len = min_t(size_t, size, ALIGN(dest, 8) - dest); |
558 |
+ |
559 |
+ memcpy((void *) dest, (void *) source, len); |
560 |
+ clean_cache_range((void *) dest, len); |
561 |
+diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c |
562 |
+index 1bff0f68f0273..20dd7023132fb 100644 |
563 |
+--- a/arch/x86/power/cpu.c |
564 |
++++ b/arch/x86/power/cpu.c |
565 |
+@@ -25,6 +25,7 @@ |
566 |
+ #include <asm/cpu.h> |
567 |
+ #include <asm/mmu_context.h> |
568 |
+ #include <asm/cpu_device_id.h> |
569 |
++#include <asm/microcode.h> |
570 |
+ |
571 |
+ #ifdef CONFIG_X86_32 |
572 |
+ __visible unsigned long saved_context_ebx; |
573 |
+@@ -263,6 +264,13 @@ static void notrace __restore_processor_state(struct saved_context *ctxt) |
574 |
+ x86_platform.restore_sched_clock_state(); |
575 |
+ mtrr_bp_restore(); |
576 |
+ perf_restore_debug_store(); |
577 |
++ |
578 |
++ microcode_bsp_resume(); |
579 |
++ |
580 |
++ /* |
581 |
++ * This needs to happen after the microcode has been updated upon resume |
582 |
++ * because some of the MSRs are "emulated" in microcode. |
583 |
++ */ |
584 |
+ msr_restore_context(ctxt); |
585 |
+ } |
586 |
+ |
587 |
+diff --git a/drivers/base/arch_topology.c b/drivers/base/arch_topology.c |
588 |
+index d5f64018044b0..503404f3280e3 100644 |
589 |
+--- a/drivers/base/arch_topology.c |
590 |
++++ b/drivers/base/arch_topology.c |
591 |
+@@ -457,7 +457,7 @@ void update_siblings_masks(unsigned int cpuid) |
592 |
+ for_each_online_cpu(cpu) { |
593 |
+ cpu_topo = &cpu_topology[cpu]; |
594 |
+ |
595 |
+- if (cpuid_topo->llc_id == cpu_topo->llc_id) { |
596 |
++ if (cpu_topo->llc_id != -1 && cpuid_topo->llc_id == cpu_topo->llc_id) { |
597 |
+ cpumask_set_cpu(cpu, &cpuid_topo->llc_sibling); |
598 |
+ cpumask_set_cpu(cpuid, &cpu_topo->llc_sibling); |
599 |
+ } |
600 |
+diff --git a/drivers/block/Kconfig b/drivers/block/Kconfig |
601 |
+index 9f6782329a237..8a08cbb958d12 100644 |
602 |
+--- a/drivers/block/Kconfig |
603 |
++++ b/drivers/block/Kconfig |
604 |
+@@ -39,6 +39,22 @@ config BLK_DEV_FD |
605 |
+ To compile this driver as a module, choose M here: the |
606 |
+ module will be called floppy. |
607 |
+ |
608 |
++config BLK_DEV_FD_RAWCMD |
609 |
++ bool "Support for raw floppy disk commands (DEPRECATED)" |
610 |
++ depends on BLK_DEV_FD |
611 |
++ help |
612 |
++ If you want to use actual physical floppies and expect to do |
613 |
++ special low-level hardware accesses to them (access and use |
614 |
++ non-standard formats, for example), then enable this. |
615 |
++ |
616 |
++ Note that the code enabled by this option is rarely used and |
617 |
++ might be unstable or insecure, and distros should not enable it. |
618 |
++ |
619 |
++ Note: FDRAWCMD is deprecated and will be removed from the kernel |
620 |
++ in the near future. |
621 |
++ |
622 |
++ If unsure, say N. |
623 |
++ |
624 |
+ config AMIGA_FLOPPY |
625 |
+ tristate "Amiga floppy support" |
626 |
+ depends on AMIGA |
627 |
+diff --git a/drivers/block/floppy.c b/drivers/block/floppy.c |
628 |
+index 02af4f109e59f..f24e3791e8400 100644 |
629 |
+--- a/drivers/block/floppy.c |
630 |
++++ b/drivers/block/floppy.c |
631 |
+@@ -3012,6 +3012,8 @@ static const char *drive_name(int type, int drive) |
632 |
+ return "(null)"; |
633 |
+ } |
634 |
+ |
635 |
++#ifdef CONFIG_BLK_DEV_FD_RAWCMD |
636 |
++ |
637 |
+ /* raw commands */ |
638 |
+ static void raw_cmd_done(int flag) |
639 |
+ { |
640 |
+@@ -3223,6 +3225,35 @@ static int raw_cmd_ioctl(int cmd, void __user *param) |
641 |
+ return ret; |
642 |
+ } |
643 |
+ |
644 |
++static int floppy_raw_cmd_ioctl(int type, int drive, int cmd, |
645 |
++ void __user *param) |
646 |
++{ |
647 |
++ int ret; |
648 |
++ |
649 |
++ pr_warn_once("Note: FDRAWCMD is deprecated and will be removed from the kernel in the near future.\n"); |
650 |
++ |
651 |
++ if (type) |
652 |
++ return -EINVAL; |
653 |
++ if (lock_fdc(drive)) |
654 |
++ return -EINTR; |
655 |
++ set_floppy(drive); |
656 |
++ ret = raw_cmd_ioctl(cmd, param); |
657 |
++ if (ret == -EINTR) |
658 |
++ return -EINTR; |
659 |
++ process_fd_request(); |
660 |
++ return ret; |
661 |
++} |
662 |
++ |
663 |
++#else /* CONFIG_BLK_DEV_FD_RAWCMD */ |
664 |
++ |
665 |
++static int floppy_raw_cmd_ioctl(int type, int drive, int cmd, |
666 |
++ void __user *param) |
667 |
++{ |
668 |
++ return -EOPNOTSUPP; |
669 |
++} |
670 |
++ |
671 |
++#endif |
672 |
++ |
673 |
+ static int invalidate_drive(struct block_device *bdev) |
674 |
+ { |
675 |
+ /* invalidate the buffer track to force a reread */ |
676 |
+@@ -3410,7 +3441,6 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int |
677 |
+ { |
678 |
+ int drive = (long)bdev->bd_disk->private_data; |
679 |
+ int type = ITYPE(UDRS->fd_device); |
680 |
+- int i; |
681 |
+ int ret; |
682 |
+ int size; |
683 |
+ union inparam { |
684 |
+@@ -3561,16 +3591,7 @@ static int fd_locked_ioctl(struct block_device *bdev, fmode_t mode, unsigned int |
685 |
+ outparam = UDRWE; |
686 |
+ break; |
687 |
+ case FDRAWCMD: |
688 |
+- if (type) |
689 |
+- return -EINVAL; |
690 |
+- if (lock_fdc(drive)) |
691 |
+- return -EINTR; |
692 |
+- set_floppy(drive); |
693 |
+- i = raw_cmd_ioctl(cmd, (void __user *)param); |
694 |
+- if (i == -EINTR) |
695 |
+- return -EINTR; |
696 |
+- process_fd_request(); |
697 |
+- return i; |
698 |
++ return floppy_raw_cmd_ioctl(type, drive, cmd, (void __user *)param); |
699 |
+ case FDTWADDLE: |
700 |
+ if (lock_fdc(drive)) |
701 |
+ return -EINTR; |
702 |
+diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c |
703 |
+index 1bb00a959c67f..9b1a5e62417cb 100644 |
704 |
+--- a/drivers/bus/sunxi-rsb.c |
705 |
++++ b/drivers/bus/sunxi-rsb.c |
706 |
+@@ -224,6 +224,8 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb, |
707 |
+ |
708 |
+ dev_dbg(&rdev->dev, "device %s registered\n", dev_name(&rdev->dev)); |
709 |
+ |
710 |
++ return rdev; |
711 |
++ |
712 |
+ err_device_add: |
713 |
+ put_device(&rdev->dev); |
714 |
+ |
715 |
+diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-sun9i-mmc.c |
716 |
+index 542b31d6e96dd..636bcf2439ef2 100644 |
717 |
+--- a/drivers/clk/sunxi/clk-sun9i-mmc.c |
718 |
++++ b/drivers/clk/sunxi/clk-sun9i-mmc.c |
719 |
+@@ -109,6 +109,8 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev) |
720 |
+ spin_lock_init(&data->lock); |
721 |
+ |
722 |
+ r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
723 |
++ if (!r) |
724 |
++ return -EINVAL; |
725 |
+ /* one clock/reset pair per word */ |
726 |
+ count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH); |
727 |
+ data->membase = devm_ioremap_resource(&pdev->dev, r); |
728 |
+diff --git a/drivers/cpufreq/sun50i-cpufreq-nvmem.c b/drivers/cpufreq/sun50i-cpufreq-nvmem.c |
729 |
+index 2deed8d8773fa..75e1bf3a08f7c 100644 |
730 |
+--- a/drivers/cpufreq/sun50i-cpufreq-nvmem.c |
731 |
++++ b/drivers/cpufreq/sun50i-cpufreq-nvmem.c |
732 |
+@@ -98,8 +98,10 @@ static int sun50i_cpufreq_nvmem_probe(struct platform_device *pdev) |
733 |
+ return -ENOMEM; |
734 |
+ |
735 |
+ ret = sun50i_cpufreq_get_efuse(&speed); |
736 |
+- if (ret) |
737 |
++ if (ret) { |
738 |
++ kfree(opp_tables); |
739 |
+ return ret; |
740 |
++ } |
741 |
+ |
742 |
+ snprintf(name, MAX_NAME_LEN, "speed%d", speed); |
743 |
+ |
744 |
+diff --git a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c |
745 |
+index 11a4c4029a902..acc2c307c871b 100644 |
746 |
+--- a/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c |
747 |
++++ b/drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c |
748 |
+@@ -1140,6 +1140,7 @@ static struct clock_source *dcn21_clock_source_create( |
749 |
+ return &clk_src->base; |
750 |
+ } |
751 |
+ |
752 |
++ kfree(clk_src); |
753 |
+ BREAK_TO_DEBUGGER(); |
754 |
+ return NULL; |
755 |
+ } |
756 |
+diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c |
757 |
+index 1f55cd8abb558..5fbda0431d6ab 100644 |
758 |
+--- a/drivers/iio/dac/ad5446.c |
759 |
++++ b/drivers/iio/dac/ad5446.c |
760 |
+@@ -170,7 +170,7 @@ static int ad5446_read_raw(struct iio_dev *indio_dev, |
761 |
+ |
762 |
+ switch (m) { |
763 |
+ case IIO_CHAN_INFO_RAW: |
764 |
+- *val = st->cached_val; |
765 |
++ *val = st->cached_val >> chan->scan_type.shift; |
766 |
+ return IIO_VAL_INT; |
767 |
+ case IIO_CHAN_INFO_SCALE: |
768 |
+ *val = st->vref_mv; |
769 |
+diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c |
770 |
+index 424922cad1e39..87a51a85a642d 100644 |
771 |
+--- a/drivers/iio/dac/ad5592r-base.c |
772 |
++++ b/drivers/iio/dac/ad5592r-base.c |
773 |
+@@ -530,7 +530,7 @@ static int ad5592r_alloc_channels(struct ad5592r_state *st) |
774 |
+ if (!ret) |
775 |
+ st->channel_modes[reg] = tmp; |
776 |
+ |
777 |
+- fwnode_property_read_u32(child, "adi,off-state", &tmp); |
778 |
++ ret = fwnode_property_read_u32(child, "adi,off-state", &tmp); |
779 |
+ if (!ret) |
780 |
+ st->channel_offstate[reg] = tmp; |
781 |
+ } |
782 |
+diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c |
783 |
+index 82af903a765b2..c54eed3f4edce 100644 |
784 |
+--- a/drivers/iio/magnetometer/ak8975.c |
785 |
++++ b/drivers/iio/magnetometer/ak8975.c |
786 |
+@@ -391,6 +391,7 @@ static int ak8975_power_on(const struct ak8975_data *data) |
787 |
+ if (ret) { |
788 |
+ dev_warn(&data->client->dev, |
789 |
+ "Failed to enable specified Vid supply\n"); |
790 |
++ regulator_disable(data->vdd); |
791 |
+ return ret; |
792 |
+ } |
793 |
+ /* |
794 |
+diff --git a/drivers/lightnvm/Kconfig b/drivers/lightnvm/Kconfig |
795 |
+index 4c2ce210c1237..95b09148167e8 100644 |
796 |
+--- a/drivers/lightnvm/Kconfig |
797 |
++++ b/drivers/lightnvm/Kconfig |
798 |
+@@ -5,7 +5,7 @@ |
799 |
+ |
800 |
+ menuconfig NVM |
801 |
+ bool "Open-Channel SSD target support" |
802 |
+- depends on BLOCK |
803 |
++ depends on BLOCK && BROKEN |
804 |
+ help |
805 |
+ Say Y here to get to enable Open-channel SSDs. |
806 |
+ |
807 |
+diff --git a/drivers/mtd/nand/raw/mtk_ecc.c b/drivers/mtd/nand/raw/mtk_ecc.c |
808 |
+index 74595b644b7cd..57fa7807cd7d3 100644 |
809 |
+--- a/drivers/mtd/nand/raw/mtk_ecc.c |
810 |
++++ b/drivers/mtd/nand/raw/mtk_ecc.c |
811 |
+@@ -43,6 +43,7 @@ |
812 |
+ |
813 |
+ struct mtk_ecc_caps { |
814 |
+ u32 err_mask; |
815 |
++ u32 err_shift; |
816 |
+ const u8 *ecc_strength; |
817 |
+ const u32 *ecc_regs; |
818 |
+ u8 num_ecc_strength; |
819 |
+@@ -76,7 +77,7 @@ static const u8 ecc_strength_mt2712[] = { |
820 |
+ }; |
821 |
+ |
822 |
+ static const u8 ecc_strength_mt7622[] = { |
823 |
+- 4, 6, 8, 10, 12, 14, 16 |
824 |
++ 4, 6, 8, 10, 12 |
825 |
+ }; |
826 |
+ |
827 |
+ enum mtk_ecc_regs { |
828 |
+@@ -221,7 +222,7 @@ void mtk_ecc_get_stats(struct mtk_ecc *ecc, struct mtk_ecc_stats *stats, |
829 |
+ for (i = 0; i < sectors; i++) { |
830 |
+ offset = (i >> 2) << 2; |
831 |
+ err = readl(ecc->regs + ECC_DECENUM0 + offset); |
832 |
+- err = err >> ((i % 4) * 8); |
833 |
++ err = err >> ((i % 4) * ecc->caps->err_shift); |
834 |
+ err &= ecc->caps->err_mask; |
835 |
+ if (err == ecc->caps->err_mask) { |
836 |
+ /* uncorrectable errors */ |
837 |
+@@ -449,6 +450,7 @@ EXPORT_SYMBOL(mtk_ecc_get_parity_bits); |
838 |
+ |
839 |
+ static const struct mtk_ecc_caps mtk_ecc_caps_mt2701 = { |
840 |
+ .err_mask = 0x3f, |
841 |
++ .err_shift = 8, |
842 |
+ .ecc_strength = ecc_strength_mt2701, |
843 |
+ .ecc_regs = mt2701_ecc_regs, |
844 |
+ .num_ecc_strength = 20, |
845 |
+@@ -459,6 +461,7 @@ static const struct mtk_ecc_caps mtk_ecc_caps_mt2701 = { |
846 |
+ |
847 |
+ static const struct mtk_ecc_caps mtk_ecc_caps_mt2712 = { |
848 |
+ .err_mask = 0x7f, |
849 |
++ .err_shift = 8, |
850 |
+ .ecc_strength = ecc_strength_mt2712, |
851 |
+ .ecc_regs = mt2712_ecc_regs, |
852 |
+ .num_ecc_strength = 23, |
853 |
+@@ -468,10 +471,11 @@ static const struct mtk_ecc_caps mtk_ecc_caps_mt2712 = { |
854 |
+ }; |
855 |
+ |
856 |
+ static const struct mtk_ecc_caps mtk_ecc_caps_mt7622 = { |
857 |
+- .err_mask = 0x3f, |
858 |
++ .err_mask = 0x1f, |
859 |
++ .err_shift = 5, |
860 |
+ .ecc_strength = ecc_strength_mt7622, |
861 |
+ .ecc_regs = mt7622_ecc_regs, |
862 |
+- .num_ecc_strength = 7, |
863 |
++ .num_ecc_strength = 5, |
864 |
+ .ecc_mode_shift = 4, |
865 |
+ .parity_bits = 13, |
866 |
+ .pg_irq_sel = 0, |
867 |
+diff --git a/drivers/mtd/nand/raw/sh_flctl.c b/drivers/mtd/nand/raw/sh_flctl.c |
868 |
+index e509c93737c4f..f0e2f2d652829 100644 |
869 |
+--- a/drivers/mtd/nand/raw/sh_flctl.c |
870 |
++++ b/drivers/mtd/nand/raw/sh_flctl.c |
871 |
+@@ -384,7 +384,8 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf, |
872 |
+ dma_addr_t dma_addr; |
873 |
+ dma_cookie_t cookie; |
874 |
+ uint32_t reg; |
875 |
+- int ret; |
876 |
++ int ret = 0; |
877 |
++ unsigned long time_left; |
878 |
+ |
879 |
+ if (dir == DMA_FROM_DEVICE) { |
880 |
+ chan = flctl->chan_fifo0_rx; |
881 |
+@@ -425,13 +426,14 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf, |
882 |
+ goto out; |
883 |
+ } |
884 |
+ |
885 |
+- ret = |
886 |
++ time_left = |
887 |
+ wait_for_completion_timeout(&flctl->dma_complete, |
888 |
+ msecs_to_jiffies(3000)); |
889 |
+ |
890 |
+- if (ret <= 0) { |
891 |
++ if (time_left == 0) { |
892 |
+ dmaengine_terminate_all(chan); |
893 |
+ dev_err(&flctl->pdev->dev, "wait_for_completion_timeout\n"); |
894 |
++ ret = -ETIMEDOUT; |
895 |
+ } |
896 |
+ |
897 |
+ out: |
898 |
+@@ -441,7 +443,7 @@ out: |
899 |
+ |
900 |
+ dma_unmap_single(chan->device->dev, dma_addr, len, dir); |
901 |
+ |
902 |
+- /* ret > 0 is success */ |
903 |
++ /* ret == 0 is success */ |
904 |
+ return ret; |
905 |
+ } |
906 |
+ |
907 |
+@@ -465,7 +467,7 @@ static void read_fiforeg(struct sh_flctl *flctl, int rlen, int offset) |
908 |
+ |
909 |
+ /* initiate DMA transfer */ |
910 |
+ if (flctl->chan_fifo0_rx && rlen >= 32 && |
911 |
+- flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE) > 0) |
912 |
++ !flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE)) |
913 |
+ goto convert; /* DMA success */ |
914 |
+ |
915 |
+ /* do polling transfer */ |
916 |
+@@ -524,7 +526,7 @@ static void write_ec_fiforeg(struct sh_flctl *flctl, int rlen, |
917 |
+ |
918 |
+ /* initiate DMA transfer */ |
919 |
+ if (flctl->chan_fifo0_tx && rlen >= 32 && |
920 |
+- flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE) > 0) |
921 |
++ !flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE)) |
922 |
+ return; /* DMA success */ |
923 |
+ |
924 |
+ /* do polling transfer */ |
925 |
+diff --git a/drivers/net/dsa/lantiq_gswip.c b/drivers/net/dsa/lantiq_gswip.c |
926 |
+index 60e36f46f8abe..0c191d395f8f3 100644 |
927 |
+--- a/drivers/net/dsa/lantiq_gswip.c |
928 |
++++ b/drivers/net/dsa/lantiq_gswip.c |
929 |
+@@ -1607,9 +1607,6 @@ static void gswip_phylink_mac_config(struct dsa_switch *ds, int port, |
930 |
+ break; |
931 |
+ case PHY_INTERFACE_MODE_RMII: |
932 |
+ miicfg |= GSWIP_MII_CFG_MODE_RMIIM; |
933 |
+- |
934 |
+- /* Configure the RMII clock as output: */ |
935 |
+- miicfg |= GSWIP_MII_CFG_RMII_CLK; |
936 |
+ break; |
937 |
+ case PHY_INTERFACE_MODE_RGMII: |
938 |
+ case PHY_INTERFACE_MODE_RGMII_ID: |
939 |
+diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |
940 |
+index cff64e43bdd80..b5f58c62e7d20 100644 |
941 |
+--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |
942 |
++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |
943 |
+@@ -14267,10 +14267,6 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp) |
944 |
+ |
945 |
+ /* Stop Tx */ |
946 |
+ bnx2x_tx_disable(bp); |
947 |
+- /* Delete all NAPI objects */ |
948 |
+- bnx2x_del_all_napi(bp); |
949 |
+- if (CNIC_LOADED(bp)) |
950 |
+- bnx2x_del_all_napi_cnic(bp); |
951 |
+ netdev_reset_tc(bp->dev); |
952 |
+ |
953 |
+ del_timer_sync(&bp->timer); |
954 |
+@@ -14375,6 +14371,11 @@ static pci_ers_result_t bnx2x_io_slot_reset(struct pci_dev *pdev) |
955 |
+ bnx2x_drain_tx_queues(bp); |
956 |
+ bnx2x_send_unload_req(bp, UNLOAD_RECOVERY); |
957 |
+ bnx2x_netif_stop(bp, 1); |
958 |
++ bnx2x_del_all_napi(bp); |
959 |
++ |
960 |
++ if (CNIC_LOADED(bp)) |
961 |
++ bnx2x_del_all_napi_cnic(bp); |
962 |
++ |
963 |
+ bnx2x_free_irq(bp); |
964 |
+ |
965 |
+ /* Report UNLOAD_DONE to MCP */ |
966 |
+diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
967 |
+index 2affdddc12bf6..e03e2bfcc6a10 100644 |
968 |
+--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
969 |
++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
970 |
+@@ -1547,6 +1547,11 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev, |
971 |
+ return skb; |
972 |
+ } |
973 |
+ |
974 |
++static void bcmgenet_hide_tsb(struct sk_buff *skb) |
975 |
++{ |
976 |
++ __skb_pull(skb, sizeof(struct status_64)); |
977 |
++} |
978 |
++ |
979 |
+ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) |
980 |
+ { |
981 |
+ struct bcmgenet_priv *priv = netdev_priv(dev); |
982 |
+@@ -1655,6 +1660,8 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) |
983 |
+ } |
984 |
+ |
985 |
+ GENET_CB(skb)->last_cb = tx_cb_ptr; |
986 |
++ |
987 |
++ bcmgenet_hide_tsb(skb); |
988 |
+ skb_tx_timestamp(skb); |
989 |
+ |
990 |
+ /* Decrement total BD count and advance our write pointer */ |
991 |
+diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |
992 |
+index 23a706a1765a7..410a9bf7bf0ab 100644 |
993 |
+--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |
994 |
++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |
995 |
+@@ -64,6 +64,13 @@ static int hclge_send_mbx_msg(struct hclge_vport *vport, u8 *msg, u16 msg_len, |
996 |
+ enum hclge_cmd_status status; |
997 |
+ struct hclge_desc desc; |
998 |
+ |
999 |
++ if (msg_len > HCLGE_MBX_MAX_MSG_SIZE) { |
1000 |
++ dev_err(&hdev->pdev->dev, |
1001 |
++ "msg data length(=%u) exceeds maximum(=%u)\n", |
1002 |
++ msg_len, HCLGE_MBX_MAX_MSG_SIZE); |
1003 |
++ return -EMSGSIZE; |
1004 |
++ } |
1005 |
++ |
1006 |
+ resp_pf_to_vf = (struct hclge_mbx_pf_to_vf_cmd *)desc.data; |
1007 |
+ |
1008 |
+ hclge_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_MBX_PF_TO_VF, false); |
1009 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c |
1010 |
+index b14b164c9601f..5799b434165e0 100644 |
1011 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c |
1012 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ipsec.c |
1013 |
+@@ -903,7 +903,8 @@ int ixgbe_ipsec_vf_add_sa(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) |
1014 |
+ /* Tx IPsec offload doesn't seem to work on this |
1015 |
+ * device, so block these requests for now. |
1016 |
+ */ |
1017 |
+- if (!(sam->flags & XFRM_OFFLOAD_INBOUND)) { |
1018 |
++ sam->flags = sam->flags & ~XFRM_OFFLOAD_IPV6; |
1019 |
++ if (sam->flags != XFRM_OFFLOAD_INBOUND) { |
1020 |
+ err = -EOPNOTSUPP; |
1021 |
+ goto err_out; |
1022 |
+ } |
1023 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c |
1024 |
+index 72e47621d27c7..934c34e98d55f 100644 |
1025 |
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c |
1026 |
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-socfpga.c |
1027 |
+@@ -65,8 +65,9 @@ static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed) |
1028 |
+ struct phy_device *phy_dev = ndev->phydev; |
1029 |
+ u32 val; |
1030 |
+ |
1031 |
+- writew(SGMII_ADAPTER_DISABLE, |
1032 |
+- sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); |
1033 |
++ if (sgmii_adapter_base) |
1034 |
++ writew(SGMII_ADAPTER_DISABLE, |
1035 |
++ sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); |
1036 |
+ |
1037 |
+ if (splitter_base) { |
1038 |
+ val = readl(splitter_base + EMAC_SPLITTER_CTRL_REG); |
1039 |
+@@ -88,10 +89,11 @@ static void socfpga_dwmac_fix_mac_speed(void *priv, unsigned int speed) |
1040 |
+ writel(val, splitter_base + EMAC_SPLITTER_CTRL_REG); |
1041 |
+ } |
1042 |
+ |
1043 |
+- writew(SGMII_ADAPTER_ENABLE, |
1044 |
+- sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); |
1045 |
+- if (phy_dev) |
1046 |
++ if (phy_dev && sgmii_adapter_base) { |
1047 |
++ writew(SGMII_ADAPTER_ENABLE, |
1048 |
++ sgmii_adapter_base + SGMII_ADAPTER_CTRL_REG); |
1049 |
+ tse_pcs_fix_mac_speed(&dwmac->pcs, phy_dev, speed); |
1050 |
++ } |
1051 |
+ } |
1052 |
+ |
1053 |
+ static int socfpga_dwmac_parse_data(struct socfpga_dwmac *dwmac, struct device *dev) |
1054 |
+diff --git a/drivers/net/hamradio/6pack.c b/drivers/net/hamradio/6pack.c |
1055 |
+index 02d6f3ad9aca8..83dc1c2c3b84b 100644 |
1056 |
+--- a/drivers/net/hamradio/6pack.c |
1057 |
++++ b/drivers/net/hamradio/6pack.c |
1058 |
+@@ -311,7 +311,6 @@ static void sp_setup(struct net_device *dev) |
1059 |
+ { |
1060 |
+ /* Finish setting up the DEVICE info. */ |
1061 |
+ dev->netdev_ops = &sp_netdev_ops; |
1062 |
+- dev->needs_free_netdev = true; |
1063 |
+ dev->mtu = SIXP_MTU; |
1064 |
+ dev->hard_header_len = AX25_MAX_HEADER_LEN; |
1065 |
+ dev->header_ops = &ax25_header_ops; |
1066 |
+@@ -679,9 +678,11 @@ static void sixpack_close(struct tty_struct *tty) |
1067 |
+ del_timer_sync(&sp->tx_t); |
1068 |
+ del_timer_sync(&sp->resync_t); |
1069 |
+ |
1070 |
+- /* Free all 6pack frame buffers. */ |
1071 |
++ /* Free all 6pack frame buffers after unreg. */ |
1072 |
+ kfree(sp->rbuff); |
1073 |
+ kfree(sp->xbuff); |
1074 |
++ |
1075 |
++ free_netdev(sp->dev); |
1076 |
+ } |
1077 |
+ |
1078 |
+ /* Perform I/O control on an active 6pack channel. */ |
1079 |
+diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c |
1080 |
+index a4b3fce69ecd9..6016e182f0089 100644 |
1081 |
+--- a/drivers/net/hippi/rrunner.c |
1082 |
++++ b/drivers/net/hippi/rrunner.c |
1083 |
+@@ -1346,7 +1346,9 @@ static int rr_close(struct net_device *dev) |
1084 |
+ |
1085 |
+ rrpriv->fw_running = 0; |
1086 |
+ |
1087 |
++ spin_unlock_irqrestore(&rrpriv->lock, flags); |
1088 |
+ del_timer_sync(&rrpriv->timer); |
1089 |
++ spin_lock_irqsave(&rrpriv->lock, flags); |
1090 |
+ |
1091 |
+ writel(0, ®s->TxPi); |
1092 |
+ writel(0, ®s->IpRxPi); |
1093 |
+diff --git a/drivers/phy/motorola/phy-mapphone-mdm6600.c b/drivers/phy/motorola/phy-mapphone-mdm6600.c |
1094 |
+index 94a34cf75eb39..39d13f7e4cf33 100644 |
1095 |
+--- a/drivers/phy/motorola/phy-mapphone-mdm6600.c |
1096 |
++++ b/drivers/phy/motorola/phy-mapphone-mdm6600.c |
1097 |
+@@ -628,7 +628,8 @@ idle: |
1098 |
+ cleanup: |
1099 |
+ if (error < 0) |
1100 |
+ phy_mdm6600_device_power_off(ddata); |
1101 |
+- |
1102 |
++ pm_runtime_disable(ddata->dev); |
1103 |
++ pm_runtime_dont_use_autosuspend(ddata->dev); |
1104 |
+ return error; |
1105 |
+ } |
1106 |
+ |
1107 |
+diff --git a/drivers/phy/samsung/phy-exynos5250-sata.c b/drivers/phy/samsung/phy-exynos5250-sata.c |
1108 |
+index 4dd7324d91b26..ea46576404b8e 100644 |
1109 |
+--- a/drivers/phy/samsung/phy-exynos5250-sata.c |
1110 |
++++ b/drivers/phy/samsung/phy-exynos5250-sata.c |
1111 |
+@@ -190,6 +190,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) |
1112 |
+ return -EINVAL; |
1113 |
+ |
1114 |
+ sata_phy->client = of_find_i2c_device_by_node(node); |
1115 |
++ of_node_put(node); |
1116 |
+ if (!sata_phy->client) |
1117 |
+ return -EPROBE_DEFER; |
1118 |
+ |
1119 |
+@@ -198,20 +199,21 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) |
1120 |
+ sata_phy->phyclk = devm_clk_get(dev, "sata_phyctrl"); |
1121 |
+ if (IS_ERR(sata_phy->phyclk)) { |
1122 |
+ dev_err(dev, "failed to get clk for PHY\n"); |
1123 |
+- return PTR_ERR(sata_phy->phyclk); |
1124 |
++ ret = PTR_ERR(sata_phy->phyclk); |
1125 |
++ goto put_dev; |
1126 |
+ } |
1127 |
+ |
1128 |
+ ret = clk_prepare_enable(sata_phy->phyclk); |
1129 |
+ if (ret < 0) { |
1130 |
+ dev_err(dev, "failed to enable source clk\n"); |
1131 |
+- return ret; |
1132 |
++ goto put_dev; |
1133 |
+ } |
1134 |
+ |
1135 |
+ sata_phy->phy = devm_phy_create(dev, NULL, &exynos_sata_phy_ops); |
1136 |
+ if (IS_ERR(sata_phy->phy)) { |
1137 |
+- clk_disable_unprepare(sata_phy->phyclk); |
1138 |
+ dev_err(dev, "failed to create PHY\n"); |
1139 |
+- return PTR_ERR(sata_phy->phy); |
1140 |
++ ret = PTR_ERR(sata_phy->phy); |
1141 |
++ goto clk_disable; |
1142 |
+ } |
1143 |
+ |
1144 |
+ phy_set_drvdata(sata_phy->phy, sata_phy); |
1145 |
+@@ -219,11 +221,18 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) |
1146 |
+ phy_provider = devm_of_phy_provider_register(dev, |
1147 |
+ of_phy_simple_xlate); |
1148 |
+ if (IS_ERR(phy_provider)) { |
1149 |
+- clk_disable_unprepare(sata_phy->phyclk); |
1150 |
+- return PTR_ERR(phy_provider); |
1151 |
++ ret = PTR_ERR(phy_provider); |
1152 |
++ goto clk_disable; |
1153 |
+ } |
1154 |
+ |
1155 |
+ return 0; |
1156 |
++ |
1157 |
++clk_disable: |
1158 |
++ clk_disable_unprepare(sata_phy->phyclk); |
1159 |
++put_dev: |
1160 |
++ put_device(&sata_phy->client->dev); |
1161 |
++ |
1162 |
++ return ret; |
1163 |
+ } |
1164 |
+ |
1165 |
+ static const struct of_device_id exynos_sata_phy_of_match[] = { |
1166 |
+diff --git a/drivers/phy/ti/phy-am654-serdes.c b/drivers/phy/ti/phy-am654-serdes.c |
1167 |
+index 6ef12017ff4e8..96e3426f9293b 100644 |
1168 |
+--- a/drivers/phy/ti/phy-am654-serdes.c |
1169 |
++++ b/drivers/phy/ti/phy-am654-serdes.c |
1170 |
+@@ -641,7 +641,7 @@ static int serdes_am654_probe(struct platform_device *pdev) |
1171 |
+ |
1172 |
+ clk_err: |
1173 |
+ of_clk_del_provider(node); |
1174 |
+- |
1175 |
++ pm_runtime_disable(dev); |
1176 |
+ return ret; |
1177 |
+ } |
1178 |
+ |
1179 |
+diff --git a/drivers/phy/ti/phy-omap-usb2.c b/drivers/phy/ti/phy-omap-usb2.c |
1180 |
+index 3d74629d7423c..471fe2e80f4ea 100644 |
1181 |
+--- a/drivers/phy/ti/phy-omap-usb2.c |
1182 |
++++ b/drivers/phy/ti/phy-omap-usb2.c |
1183 |
+@@ -157,7 +157,7 @@ static int omap_usb2_enable_clocks(struct omap_usb *phy) |
1184 |
+ return 0; |
1185 |
+ |
1186 |
+ err1: |
1187 |
+- clk_disable(phy->wkupclk); |
1188 |
++ clk_disable_unprepare(phy->wkupclk); |
1189 |
+ |
1190 |
+ err0: |
1191 |
+ return ret; |
1192 |
+diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c |
1193 |
+index 379e9a6a6d894..5f381e4c75779 100644 |
1194 |
+--- a/drivers/pinctrl/pinctrl-pistachio.c |
1195 |
++++ b/drivers/pinctrl/pinctrl-pistachio.c |
1196 |
+@@ -1370,10 +1370,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) |
1197 |
+ } |
1198 |
+ |
1199 |
+ irq = irq_of_parse_and_map(child, 0); |
1200 |
+- if (irq < 0) { |
1201 |
+- dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq); |
1202 |
++ if (!irq) { |
1203 |
++ dev_err(pctl->dev, "No IRQ for bank %u\n", i); |
1204 |
+ of_node_put(child); |
1205 |
+- ret = irq; |
1206 |
++ ret = -EINVAL; |
1207 |
+ goto err; |
1208 |
+ } |
1209 |
+ |
1210 |
+diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c |
1211 |
+index f4fe73ce57108..c38f06139ccfa 100644 |
1212 |
+--- a/drivers/tty/n_gsm.c |
1213 |
++++ b/drivers/tty/n_gsm.c |
1214 |
+@@ -72,6 +72,8 @@ module_param(debug, int, 0600); |
1215 |
+ */ |
1216 |
+ #define MAX_MRU 1500 |
1217 |
+ #define MAX_MTU 1500 |
1218 |
++/* SOF, ADDR, CTRL, LEN1, LEN2, ..., FCS, EOF */ |
1219 |
++#define PROT_OVERHEAD 7 |
1220 |
+ #define GSM_NET_TX_TIMEOUT (HZ*10) |
1221 |
+ |
1222 |
+ /** |
1223 |
+@@ -823,7 +825,7 @@ static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci) |
1224 |
+ break; |
1225 |
+ case 2: /* Unstructed with modem bits. |
1226 |
+ Always one byte as we never send inline break data */ |
1227 |
+- *dp++ = gsm_encode_modem(dlci); |
1228 |
++ *dp++ = (gsm_encode_modem(dlci) << 1) | EA; |
1229 |
+ break; |
1230 |
+ } |
1231 |
+ WARN_ON(kfifo_out_locked(dlci->fifo, dp , len, &dlci->lock) != len); |
1232 |
+@@ -1300,11 +1302,12 @@ static void gsm_control_response(struct gsm_mux *gsm, unsigned int command, |
1233 |
+ |
1234 |
+ static void gsm_control_transmit(struct gsm_mux *gsm, struct gsm_control *ctrl) |
1235 |
+ { |
1236 |
+- struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 1, gsm->ftype); |
1237 |
++ struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 2, gsm->ftype); |
1238 |
+ if (msg == NULL) |
1239 |
+ return; |
1240 |
+- msg->data[0] = (ctrl->cmd << 1) | 2 | EA; /* command */ |
1241 |
+- memcpy(msg->data + 1, ctrl->data, ctrl->len); |
1242 |
++ msg->data[0] = (ctrl->cmd << 1) | CR | EA; /* command */ |
1243 |
++ msg->data[1] = (ctrl->len << 1) | EA; |
1244 |
++ memcpy(msg->data + 2, ctrl->data, ctrl->len); |
1245 |
+ gsm_data_queue(gsm->dlci[0], msg); |
1246 |
+ } |
1247 |
+ |
1248 |
+@@ -1327,7 +1330,6 @@ static void gsm_control_retransmit(struct timer_list *t) |
1249 |
+ spin_lock_irqsave(&gsm->control_lock, flags); |
1250 |
+ ctrl = gsm->pending_cmd; |
1251 |
+ if (ctrl) { |
1252 |
+- gsm->cretries--; |
1253 |
+ if (gsm->cretries == 0) { |
1254 |
+ gsm->pending_cmd = NULL; |
1255 |
+ ctrl->error = -ETIMEDOUT; |
1256 |
+@@ -1336,6 +1338,7 @@ static void gsm_control_retransmit(struct timer_list *t) |
1257 |
+ wake_up(&gsm->event); |
1258 |
+ return; |
1259 |
+ } |
1260 |
++ gsm->cretries--; |
1261 |
+ gsm_control_transmit(gsm, ctrl); |
1262 |
+ mod_timer(&gsm->t2_timer, jiffies + gsm->t2 * HZ / 100); |
1263 |
+ } |
1264 |
+@@ -1376,7 +1379,7 @@ retry: |
1265 |
+ |
1266 |
+ /* If DLCI0 is in ADM mode skip retries, it won't respond */ |
1267 |
+ if (gsm->dlci[0]->mode == DLCI_MODE_ADM) |
1268 |
+- gsm->cretries = 1; |
1269 |
++ gsm->cretries = 0; |
1270 |
+ else |
1271 |
+ gsm->cretries = gsm->n2; |
1272 |
+ |
1273 |
+@@ -1810,7 +1813,6 @@ static void gsm_queue(struct gsm_mux *gsm) |
1274 |
+ gsm_response(gsm, address, UA); |
1275 |
+ gsm_dlci_close(dlci); |
1276 |
+ break; |
1277 |
+- case UA: |
1278 |
+ case UA|PF: |
1279 |
+ if (cr == 0 || dlci == NULL) |
1280 |
+ break; |
1281 |
+@@ -1961,7 +1963,8 @@ static void gsm1_receive(struct gsm_mux *gsm, unsigned char c) |
1282 |
+ } |
1283 |
+ /* Any partial frame was a runt so go back to start */ |
1284 |
+ if (gsm->state != GSM_START) { |
1285 |
+- gsm->malformed++; |
1286 |
++ if (gsm->state != GSM_SEARCH) |
1287 |
++ gsm->malformed++; |
1288 |
+ gsm->state = GSM_START; |
1289 |
+ } |
1290 |
+ /* A SOF in GSM_START means we are still reading idling or |
1291 |
+@@ -2098,6 +2101,7 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm) |
1292 |
+ gsm_dlci_release(gsm->dlci[i]); |
1293 |
+ mutex_unlock(&gsm->mutex); |
1294 |
+ /* Now wipe the queues */ |
1295 |
++ tty_ldisc_flush(gsm->tty); |
1296 |
+ list_for_each_entry_safe(txq, ntxq, &gsm->tx_list, list) |
1297 |
+ kfree(txq); |
1298 |
+ INIT_LIST_HEAD(&gsm->tx_list); |
1299 |
+@@ -2208,7 +2212,7 @@ static struct gsm_mux *gsm_alloc_mux(void) |
1300 |
+ kfree(gsm); |
1301 |
+ return NULL; |
1302 |
+ } |
1303 |
+- gsm->txframe = kmalloc(2 * MAX_MRU + 2, GFP_KERNEL); |
1304 |
++ gsm->txframe = kmalloc(2 * (MAX_MTU + PROT_OVERHEAD - 1), GFP_KERNEL); |
1305 |
+ if (gsm->txframe == NULL) { |
1306 |
+ kfree(gsm->buf); |
1307 |
+ kfree(gsm); |
1308 |
+@@ -2264,7 +2268,7 @@ static int gsm_config(struct gsm_mux *gsm, struct gsm_config *c) |
1309 |
+ /* Check the MRU/MTU range looks sane */ |
1310 |
+ if (c->mru > MAX_MRU || c->mtu > MAX_MTU || c->mru < 8 || c->mtu < 8) |
1311 |
+ return -EINVAL; |
1312 |
+- if (c->n2 < 3) |
1313 |
++ if (c->n2 > 255) |
1314 |
+ return -EINVAL; |
1315 |
+ if (c->encapsulation > 1) /* Basic, advanced, no I */ |
1316 |
+ return -EINVAL; |
1317 |
+@@ -2879,19 +2883,17 @@ static struct tty_ldisc_ops tty_ldisc_packet = { |
1318 |
+ |
1319 |
+ static int gsmtty_modem_update(struct gsm_dlci *dlci, u8 brk) |
1320 |
+ { |
1321 |
+- u8 modembits[5]; |
1322 |
++ u8 modembits[3]; |
1323 |
+ struct gsm_control *ctrl; |
1324 |
+ int len = 2; |
1325 |
+ |
1326 |
+- if (brk) |
1327 |
++ modembits[0] = (dlci->addr << 2) | 2 | EA; /* DLCI, Valid, EA */ |
1328 |
++ modembits[1] = (gsm_encode_modem(dlci) << 1) | EA; |
1329 |
++ if (brk) { |
1330 |
++ modembits[2] = (brk << 4) | 2 | EA; /* Length, Break, EA */ |
1331 |
+ len++; |
1332 |
+- |
1333 |
+- modembits[0] = len << 1 | EA; /* Data bytes */ |
1334 |
+- modembits[1] = dlci->addr << 2 | 3; /* DLCI, EA, 1 */ |
1335 |
+- modembits[2] = gsm_encode_modem(dlci) << 1 | EA; |
1336 |
+- if (brk) |
1337 |
+- modembits[3] = brk << 4 | 2 | EA; /* Valid, EA */ |
1338 |
+- ctrl = gsm_control_send(dlci->gsm, CMD_MSC, modembits, len + 1); |
1339 |
++ } |
1340 |
++ ctrl = gsm_control_send(dlci->gsm, CMD_MSC, modembits, len); |
1341 |
+ if (ctrl == NULL) |
1342 |
+ return -ENOMEM; |
1343 |
+ return gsm_control_wait(dlci->gsm, ctrl); |
1344 |
+diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c |
1345 |
+index fd443bc4c2983..92e2ee2785239 100644 |
1346 |
+--- a/drivers/tty/serial/8250/8250_pci.c |
1347 |
++++ b/drivers/tty/serial/8250/8250_pci.c |
1348 |
+@@ -2907,7 +2907,7 @@ enum pci_board_num_t { |
1349 |
+ pbn_panacom2, |
1350 |
+ pbn_panacom4, |
1351 |
+ pbn_plx_romulus, |
1352 |
+- pbn_endrun_2_4000000, |
1353 |
++ pbn_endrun_2_3906250, |
1354 |
+ pbn_oxsemi, |
1355 |
+ pbn_oxsemi_1_4000000, |
1356 |
+ pbn_oxsemi_2_4000000, |
1357 |
+@@ -3434,10 +3434,10 @@ static struct pciserial_board pci_boards[] = { |
1358 |
+ * signal now many ports are available |
1359 |
+ * 2 port 952 Uart support |
1360 |
+ */ |
1361 |
+- [pbn_endrun_2_4000000] = { |
1362 |
++ [pbn_endrun_2_3906250] = { |
1363 |
+ .flags = FL_BASE0, |
1364 |
+ .num_ports = 2, |
1365 |
+- .base_baud = 4000000, |
1366 |
++ .base_baud = 3906250, |
1367 |
+ .uart_offset = 0x200, |
1368 |
+ .first_offset = 0x1000, |
1369 |
+ }, |
1370 |
+@@ -4345,7 +4345,7 @@ static const struct pci_device_id serial_pci_tbl[] = { |
1371 |
+ */ |
1372 |
+ { PCI_VENDOR_ID_ENDRUN, PCI_DEVICE_ID_ENDRUN_1588, |
1373 |
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
1374 |
+- pbn_endrun_2_4000000 }, |
1375 |
++ pbn_endrun_2_3906250 }, |
1376 |
+ /* |
1377 |
+ * Quatech cards. These actually have configurable clocks but for |
1378 |
+ * now we just use the default. |
1379 |
+diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c |
1380 |
+index 87567515591e1..c1891c55897ad 100644 |
1381 |
+--- a/drivers/tty/serial/8250/8250_port.c |
1382 |
++++ b/drivers/tty/serial/8250/8250_port.c |
1383 |
+@@ -3184,7 +3184,7 @@ static void serial8250_console_restore(struct uart_8250_port *up) |
1384 |
+ |
1385 |
+ serial8250_set_divisor(port, baud, quot, frac); |
1386 |
+ serial_port_out(port, UART_LCR, up->lcr); |
1387 |
+- serial8250_out_MCR(up, UART_MCR_DTR | UART_MCR_RTS); |
1388 |
++ serial8250_out_MCR(up, up->mcr | UART_MCR_DTR | UART_MCR_RTS); |
1389 |
+ } |
1390 |
+ |
1391 |
+ /* |
1392 |
+diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c |
1393 |
+index e5ed4ab2b08df..8b41a783b37ee 100644 |
1394 |
+--- a/drivers/tty/serial/imx.c |
1395 |
++++ b/drivers/tty/serial/imx.c |
1396 |
+@@ -1401,7 +1401,7 @@ static int imx_uart_startup(struct uart_port *port) |
1397 |
+ imx_uart_writel(sport, ucr1, UCR1); |
1398 |
+ |
1399 |
+ ucr4 = imx_uart_readl(sport, UCR4) & ~UCR4_OREN; |
1400 |
+- if (!sport->dma_is_enabled) |
1401 |
++ if (!dma_is_inited) |
1402 |
+ ucr4 |= UCR4_OREN; |
1403 |
+ imx_uart_writel(sport, ucr4, UCR4); |
1404 |
+ |
1405 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
1406 |
+index a118c44c70e1e..d5f233fa6f3b4 100644 |
1407 |
+--- a/drivers/usb/core/quirks.c |
1408 |
++++ b/drivers/usb/core/quirks.c |
1409 |
+@@ -404,6 +404,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1410 |
+ { USB_DEVICE(0x0b05, 0x17e0), .driver_info = |
1411 |
+ USB_QUIRK_IGNORE_REMOTE_WAKEUP }, |
1412 |
+ |
1413 |
++ /* Realtek Semiconductor Corp. Mass Storage Device (Multicard Reader)*/ |
1414 |
++ { USB_DEVICE(0x0bda, 0x0151), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, |
1415 |
++ |
1416 |
+ /* Realtek hub in Dell WD19 (Type-C) */ |
1417 |
+ { USB_DEVICE(0x0bda, 0x0487), .driver_info = USB_QUIRK_NO_LPM }, |
1418 |
+ { USB_DEVICE(0x0bda, 0x5487), .driver_info = USB_QUIRK_RESET_RESUME }, |
1419 |
+@@ -508,6 +511,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1420 |
+ /* DJI CineSSD */ |
1421 |
+ { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM }, |
1422 |
+ |
1423 |
++ /* VCOM device */ |
1424 |
++ { USB_DEVICE(0x4296, 0x7570), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, |
1425 |
++ |
1426 |
+ /* INTEL VALUE SSD */ |
1427 |
+ { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME }, |
1428 |
+ |
1429 |
+diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c |
1430 |
+index 2c68ec60d39a3..8cc81f193e9c1 100644 |
1431 |
+--- a/drivers/usb/dwc3/core.c |
1432 |
++++ b/drivers/usb/dwc3/core.c |
1433 |
+@@ -1229,10 +1229,10 @@ static void dwc3_get_properties(struct dwc3 *dwc) |
1434 |
+ u8 lpm_nyet_threshold; |
1435 |
+ u8 tx_de_emphasis; |
1436 |
+ u8 hird_threshold; |
1437 |
+- u8 rx_thr_num_pkt_prd; |
1438 |
+- u8 rx_max_burst_prd; |
1439 |
+- u8 tx_thr_num_pkt_prd; |
1440 |
+- u8 tx_max_burst_prd; |
1441 |
++ u8 rx_thr_num_pkt_prd = 0; |
1442 |
++ u8 rx_max_burst_prd = 0; |
1443 |
++ u8 tx_thr_num_pkt_prd = 0; |
1444 |
++ u8 tx_max_burst_prd = 0; |
1445 |
+ |
1446 |
+ /* default to highest possible threshold */ |
1447 |
+ lpm_nyet_threshold = 0xf; |
1448 |
+diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c |
1449 |
+index a1d8cb69d229d..18a53a3dfac6c 100644 |
1450 |
+--- a/drivers/usb/dwc3/gadget.c |
1451 |
++++ b/drivers/usb/dwc3/gadget.c |
1452 |
+@@ -2728,6 +2728,7 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep, |
1453 |
+ const struct dwc3_event_depevt *event, |
1454 |
+ struct dwc3_request *req, int status) |
1455 |
+ { |
1456 |
++ int request_status; |
1457 |
+ int ret; |
1458 |
+ |
1459 |
+ if (req->request.num_mapped_sgs) |
1460 |
+@@ -2757,7 +2758,35 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep, |
1461 |
+ req->needs_extra_trb = false; |
1462 |
+ } |
1463 |
+ |
1464 |
+- dwc3_gadget_giveback(dep, req, status); |
1465 |
++ /* |
1466 |
++ * The event status only reflects the status of the TRB with IOC set. |
1467 |
++ * For the requests that don't set interrupt on completion, the driver |
1468 |
++ * needs to check and return the status of the completed TRBs associated |
1469 |
++ * with the request. Use the status of the last TRB of the request. |
1470 |
++ */ |
1471 |
++ if (req->request.no_interrupt) { |
1472 |
++ struct dwc3_trb *trb; |
1473 |
++ |
1474 |
++ trb = dwc3_ep_prev_trb(dep, dep->trb_dequeue); |
1475 |
++ switch (DWC3_TRB_SIZE_TRBSTS(trb->size)) { |
1476 |
++ case DWC3_TRBSTS_MISSED_ISOC: |
1477 |
++ /* Isoc endpoint only */ |
1478 |
++ request_status = -EXDEV; |
1479 |
++ break; |
1480 |
++ case DWC3_TRB_STS_XFER_IN_PROG: |
1481 |
++ /* Applicable when End Transfer with ForceRM=0 */ |
1482 |
++ case DWC3_TRBSTS_SETUP_PENDING: |
1483 |
++ /* Control endpoint only */ |
1484 |
++ case DWC3_TRBSTS_OK: |
1485 |
++ default: |
1486 |
++ request_status = 0; |
1487 |
++ break; |
1488 |
++ } |
1489 |
++ } else { |
1490 |
++ request_status = status; |
1491 |
++ } |
1492 |
++ |
1493 |
++ dwc3_gadget_giveback(dep, req, request_status); |
1494 |
+ |
1495 |
+ out: |
1496 |
+ return ret; |
1497 |
+diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c |
1498 |
+index 3d4710cc34bc1..2350e97a1662c 100644 |
1499 |
+--- a/drivers/usb/gadget/configfs.c |
1500 |
++++ b/drivers/usb/gadget/configfs.c |
1501 |
+@@ -1412,6 +1412,8 @@ static void configfs_composite_unbind(struct usb_gadget *gadget) |
1502 |
+ usb_ep_autoconfig_reset(cdev->gadget); |
1503 |
+ spin_lock_irqsave(&gi->spinlock, flags); |
1504 |
+ cdev->gadget = NULL; |
1505 |
++ cdev->deactivations = 0; |
1506 |
++ gadget->deactivated = false; |
1507 |
+ set_gadget_data(gadget, NULL); |
1508 |
+ spin_unlock_irqrestore(&gi->spinlock, flags); |
1509 |
+ } |
1510 |
+diff --git a/drivers/usb/gadget/function/uvc_queue.c b/drivers/usb/gadget/function/uvc_queue.c |
1511 |
+index 61e2c94cc0b0c..cab1e30462c24 100644 |
1512 |
+--- a/drivers/usb/gadget/function/uvc_queue.c |
1513 |
++++ b/drivers/usb/gadget/function/uvc_queue.c |
1514 |
+@@ -242,6 +242,8 @@ void uvcg_queue_cancel(struct uvc_video_queue *queue, int disconnect) |
1515 |
+ buf->state = UVC_BUF_STATE_ERROR; |
1516 |
+ vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_ERROR); |
1517 |
+ } |
1518 |
++ queue->buf_used = 0; |
1519 |
++ |
1520 |
+ /* This must be protected by the irqlock spinlock to avoid race |
1521 |
+ * conditions between uvc_queue_buffer and the disconnection event that |
1522 |
+ * could result in an interruptible wait in uvc_dequeue_buffer. Do not |
1523 |
+diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c |
1524 |
+index db65e1ad00deb..dd46c15c4853f 100644 |
1525 |
+--- a/drivers/usb/host/xhci-hub.c |
1526 |
++++ b/drivers/usb/host/xhci-hub.c |
1527 |
+@@ -1343,7 +1343,7 @@ int xhci_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue, |
1528 |
+ } |
1529 |
+ spin_unlock_irqrestore(&xhci->lock, flags); |
1530 |
+ if (!wait_for_completion_timeout(&bus_state->u3exit_done[wIndex], |
1531 |
+- msecs_to_jiffies(100))) |
1532 |
++ msecs_to_jiffies(500))) |
1533 |
+ xhci_dbg(xhci, "missing U0 port change event for port %d\n", |
1534 |
+ wIndex); |
1535 |
+ spin_lock_irqsave(&xhci->lock, flags); |
1536 |
+diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c |
1537 |
+index 7fa27b4037560..6cedae902adf9 100644 |
1538 |
+--- a/drivers/usb/host/xhci-ring.c |
1539 |
++++ b/drivers/usb/host/xhci-ring.c |
1540 |
+@@ -2932,6 +2932,8 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) |
1541 |
+ if (event_loop++ < TRBS_PER_SEGMENT / 2) |
1542 |
+ continue; |
1543 |
+ xhci_update_erst_dequeue(xhci, event_ring_deq); |
1544 |
++ event_ring_deq = xhci->event_ring->dequeue; |
1545 |
++ |
1546 |
+ event_loop = 0; |
1547 |
+ } |
1548 |
+ |
1549 |
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c |
1550 |
+index 476dc6abd5a21..2f59d447411b5 100644 |
1551 |
+--- a/drivers/usb/host/xhci.c |
1552 |
++++ b/drivers/usb/host/xhci.c |
1553 |
+@@ -779,6 +779,17 @@ void xhci_shutdown(struct usb_hcd *hcd) |
1554 |
+ if (xhci->quirks & XHCI_SPURIOUS_REBOOT) |
1555 |
+ usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev)); |
1556 |
+ |
1557 |
++ /* Don't poll the roothubs after shutdown. */ |
1558 |
++ xhci_dbg(xhci, "%s: stopping usb%d port polling.\n", |
1559 |
++ __func__, hcd->self.busnum); |
1560 |
++ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); |
1561 |
++ del_timer_sync(&hcd->rh_timer); |
1562 |
++ |
1563 |
++ if (xhci->shared_hcd) { |
1564 |
++ clear_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags); |
1565 |
++ del_timer_sync(&xhci->shared_hcd->rh_timer); |
1566 |
++ } |
1567 |
++ |
1568 |
+ spin_lock_irq(&xhci->lock); |
1569 |
+ xhci_halt(xhci); |
1570 |
+ /* Workaround for spurious wakeups at shutdown with HSW */ |
1571 |
+diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c |
1572 |
+index 748139d262633..0be8efcda15d5 100644 |
1573 |
+--- a/drivers/usb/misc/uss720.c |
1574 |
++++ b/drivers/usb/misc/uss720.c |
1575 |
+@@ -71,6 +71,7 @@ static void destroy_priv(struct kref *kref) |
1576 |
+ |
1577 |
+ dev_dbg(&priv->usbdev->dev, "destroying priv datastructure\n"); |
1578 |
+ usb_put_dev(priv->usbdev); |
1579 |
++ priv->usbdev = NULL; |
1580 |
+ kfree(priv); |
1581 |
+ } |
1582 |
+ |
1583 |
+@@ -736,7 +737,6 @@ static int uss720_probe(struct usb_interface *intf, |
1584 |
+ parport_announce_port(pp); |
1585 |
+ |
1586 |
+ usb_set_intfdata(intf, pp); |
1587 |
+- usb_put_dev(usbdev); |
1588 |
+ return 0; |
1589 |
+ |
1590 |
+ probe_abort: |
1591 |
+@@ -754,7 +754,6 @@ static void uss720_disconnect(struct usb_interface *intf) |
1592 |
+ usb_set_intfdata(intf, NULL); |
1593 |
+ if (pp) { |
1594 |
+ priv = pp->private_data; |
1595 |
+- priv->usbdev = NULL; |
1596 |
+ priv->pp = NULL; |
1597 |
+ dev_dbg(&intf->dev, "parport_remove_port\n"); |
1598 |
+ parport_remove_port(pp); |
1599 |
+diff --git a/drivers/usb/mtu3/mtu3_dr.c b/drivers/usb/mtu3/mtu3_dr.c |
1600 |
+index 08e18448e8b82..db30365345e0f 100644 |
1601 |
+--- a/drivers/usb/mtu3/mtu3_dr.c |
1602 |
++++ b/drivers/usb/mtu3/mtu3_dr.c |
1603 |
+@@ -41,10 +41,8 @@ static char *mailbox_state_string(enum mtu3_vbus_id_state state) |
1604 |
+ |
1605 |
+ static void toggle_opstate(struct ssusb_mtk *ssusb) |
1606 |
+ { |
1607 |
+- if (!ssusb->otg_switch.is_u3_drd) { |
1608 |
+- mtu3_setbits(ssusb->mac_base, U3D_DEVICE_CONTROL, DC_SESSION); |
1609 |
+- mtu3_setbits(ssusb->mac_base, U3D_POWER_MANAGEMENT, SOFT_CONN); |
1610 |
+- } |
1611 |
++ mtu3_setbits(ssusb->mac_base, U3D_DEVICE_CONTROL, DC_SESSION); |
1612 |
++ mtu3_setbits(ssusb->mac_base, U3D_POWER_MANAGEMENT, SOFT_CONN); |
1613 |
+ } |
1614 |
+ |
1615 |
+ /* only port0 supports dual-role mode */ |
1616 |
+diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c |
1617 |
+index dfa7c504befe8..d5a1832aa48eb 100644 |
1618 |
+--- a/drivers/usb/serial/cp210x.c |
1619 |
++++ b/drivers/usb/serial/cp210x.c |
1620 |
+@@ -195,6 +195,8 @@ static const struct usb_device_id id_table[] = { |
1621 |
+ { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ |
1622 |
+ { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */ |
1623 |
+ { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */ |
1624 |
++ { USB_DEVICE(0x17A8, 0x0101) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Int Ant) */ |
1625 |
++ { USB_DEVICE(0x17A8, 0x0102) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Ext Ant) */ |
1626 |
+ { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */ |
1627 |
+ { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ |
1628 |
+ { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ |
1629 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
1630 |
+index 839eac04b5e30..fa978412601aa 100644 |
1631 |
+--- a/drivers/usb/serial/option.c |
1632 |
++++ b/drivers/usb/serial/option.c |
1633 |
+@@ -432,6 +432,8 @@ static void option_instat_callback(struct urb *urb); |
1634 |
+ #define CINTERION_PRODUCT_CLS8 0x00b0 |
1635 |
+ #define CINTERION_PRODUCT_MV31_MBIM 0x00b3 |
1636 |
+ #define CINTERION_PRODUCT_MV31_RMNET 0x00b7 |
1637 |
++#define CINTERION_PRODUCT_MV32_WA 0x00f1 |
1638 |
++#define CINTERION_PRODUCT_MV32_WB 0x00f2 |
1639 |
+ |
1640 |
+ /* Olivetti products */ |
1641 |
+ #define OLIVETTI_VENDOR_ID 0x0b3c |
1642 |
+@@ -1217,6 +1219,10 @@ static const struct usb_device_id option_ids[] = { |
1643 |
+ .driver_info = NCTRL(0) | RSVD(1) }, |
1644 |
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1056, 0xff), /* Telit FD980 */ |
1645 |
+ .driver_info = NCTRL(2) | RSVD(3) }, |
1646 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1057, 0xff), /* Telit FN980 */ |
1647 |
++ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, |
1648 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1058, 0xff), /* Telit FN980 (PCIe) */ |
1649 |
++ .driver_info = NCTRL(0) | RSVD(1) }, |
1650 |
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1060, 0xff), /* Telit LN920 (rmnet) */ |
1651 |
+ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, |
1652 |
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1061, 0xff), /* Telit LN920 (MBIM) */ |
1653 |
+@@ -1233,6 +1239,8 @@ static const struct usb_device_id option_ids[] = { |
1654 |
+ .driver_info = NCTRL(2) | RSVD(3) }, |
1655 |
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1073, 0xff), /* Telit FN990 (ECM) */ |
1656 |
+ .driver_info = NCTRL(0) | RSVD(1) }, |
1657 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1075, 0xff), /* Telit FN990 (PCIe) */ |
1658 |
++ .driver_info = RSVD(0) }, |
1659 |
+ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), |
1660 |
+ .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) }, |
1661 |
+ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM), |
1662 |
+@@ -1969,6 +1977,10 @@ static const struct usb_device_id option_ids[] = { |
1663 |
+ .driver_info = RSVD(3)}, |
1664 |
+ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_RMNET, 0xff), |
1665 |
+ .driver_info = RSVD(0)}, |
1666 |
++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WA, 0xff), |
1667 |
++ .driver_info = RSVD(3)}, |
1668 |
++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WB, 0xff), |
1669 |
++ .driver_info = RSVD(3)}, |
1670 |
+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100), |
1671 |
+ .driver_info = RSVD(4) }, |
1672 |
+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120), |
1673 |
+diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c |
1674 |
+index ca3bd58f2025a..5576cfa50bc80 100644 |
1675 |
+--- a/drivers/usb/serial/whiteheat.c |
1676 |
++++ b/drivers/usb/serial/whiteheat.c |
1677 |
+@@ -599,9 +599,8 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command, |
1678 |
+ switch (command) { |
1679 |
+ case WHITEHEAT_GET_DTR_RTS: |
1680 |
+ info = usb_get_serial_port_data(port); |
1681 |
+- memcpy(&info->mcr, command_info->result_buffer, |
1682 |
+- sizeof(struct whiteheat_dr_info)); |
1683 |
+- break; |
1684 |
++ info->mcr = command_info->result_buffer[0]; |
1685 |
++ break; |
1686 |
+ } |
1687 |
+ } |
1688 |
+ exit: |
1689 |
+diff --git a/drivers/usb/typec/ucsi/ucsi.c b/drivers/usb/typec/ucsi/ucsi.c |
1690 |
+index f3934f2d3c443..0268e654cae68 100644 |
1691 |
+--- a/drivers/usb/typec/ucsi/ucsi.c |
1692 |
++++ b/drivers/usb/typec/ucsi/ucsi.c |
1693 |
+@@ -748,14 +748,18 @@ ucsi_dr_swap(const struct typec_capability *cap, enum typec_data_role role) |
1694 |
+ if (ret < 0) |
1695 |
+ goto out_unlock; |
1696 |
+ |
1697 |
++ mutex_unlock(&con->lock); |
1698 |
++ |
1699 |
+ if (!wait_for_completion_timeout(&con->complete, |
1700 |
+- msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS))) |
1701 |
+- ret = -ETIMEDOUT; |
1702 |
++ msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS))) |
1703 |
++ return -ETIMEDOUT; |
1704 |
++ |
1705 |
++ return 0; |
1706 |
+ |
1707 |
+ out_unlock: |
1708 |
+ mutex_unlock(&con->lock); |
1709 |
+ |
1710 |
+- return ret < 0 ? ret : 0; |
1711 |
++ return ret; |
1712 |
+ } |
1713 |
+ |
1714 |
+ static int |
1715 |
+@@ -780,11 +784,13 @@ ucsi_pr_swap(const struct typec_capability *cap, enum typec_role role) |
1716 |
+ if (ret < 0) |
1717 |
+ goto out_unlock; |
1718 |
+ |
1719 |
++ mutex_unlock(&con->lock); |
1720 |
++ |
1721 |
+ if (!wait_for_completion_timeout(&con->complete, |
1722 |
+- msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS))) { |
1723 |
+- ret = -ETIMEDOUT; |
1724 |
+- goto out_unlock; |
1725 |
+- } |
1726 |
++ msecs_to_jiffies(UCSI_SWAP_TIMEOUT_MS))) |
1727 |
++ return -ETIMEDOUT; |
1728 |
++ |
1729 |
++ mutex_lock(&con->lock); |
1730 |
+ |
1731 |
+ /* Something has gone wrong while swapping the role */ |
1732 |
+ if (con->status.pwr_op_mode != UCSI_CONSTAT_PWR_OPMODE_PD) { |
1733 |
+diff --git a/drivers/video/fbdev/udlfb.c b/drivers/video/fbdev/udlfb.c |
1734 |
+index e269b1391e146..8e8af408998ea 100644 |
1735 |
+--- a/drivers/video/fbdev/udlfb.c |
1736 |
++++ b/drivers/video/fbdev/udlfb.c |
1737 |
+@@ -1650,8 +1650,9 @@ static int dlfb_usb_probe(struct usb_interface *intf, |
1738 |
+ const struct device_attribute *attr; |
1739 |
+ struct dlfb_data *dlfb; |
1740 |
+ struct fb_info *info; |
1741 |
+- int retval = -ENOMEM; |
1742 |
++ int retval; |
1743 |
+ struct usb_device *usbdev = interface_to_usbdev(intf); |
1744 |
++ struct usb_endpoint_descriptor *out; |
1745 |
+ |
1746 |
+ /* usb initialization */ |
1747 |
+ dlfb = kzalloc(sizeof(*dlfb), GFP_KERNEL); |
1748 |
+@@ -1665,6 +1666,12 @@ static int dlfb_usb_probe(struct usb_interface *intf, |
1749 |
+ dlfb->udev = usb_get_dev(usbdev); |
1750 |
+ usb_set_intfdata(intf, dlfb); |
1751 |
+ |
1752 |
++ retval = usb_find_common_endpoints(intf->cur_altsetting, NULL, &out, NULL, NULL); |
1753 |
++ if (retval) { |
1754 |
++ dev_err(&intf->dev, "Device should have at lease 1 bulk endpoint!\n"); |
1755 |
++ goto error; |
1756 |
++ } |
1757 |
++ |
1758 |
+ dev_dbg(&intf->dev, "console enable=%d\n", console); |
1759 |
+ dev_dbg(&intf->dev, "fb_defio enable=%d\n", fb_defio); |
1760 |
+ dev_dbg(&intf->dev, "shadow enable=%d\n", shadow); |
1761 |
+@@ -1674,6 +1681,7 @@ static int dlfb_usb_probe(struct usb_interface *intf, |
1762 |
+ if (!dlfb_parse_vendor_descriptor(dlfb, intf)) { |
1763 |
+ dev_err(&intf->dev, |
1764 |
+ "firmware not recognized, incompatible device?\n"); |
1765 |
++ retval = -ENODEV; |
1766 |
+ goto error; |
1767 |
+ } |
1768 |
+ |
1769 |
+@@ -1687,8 +1695,10 @@ static int dlfb_usb_probe(struct usb_interface *intf, |
1770 |
+ |
1771 |
+ /* allocates framebuffer driver structure, not framebuffer memory */ |
1772 |
+ info = framebuffer_alloc(0, &dlfb->udev->dev); |
1773 |
+- if (!info) |
1774 |
++ if (!info) { |
1775 |
++ retval = -ENOMEM; |
1776 |
+ goto error; |
1777 |
++ } |
1778 |
+ |
1779 |
+ dlfb->info = info; |
1780 |
+ info->par = dlfb; |
1781 |
+diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c |
1782 |
+index defee1d208d22..7985fe25850b7 100644 |
1783 |
+--- a/fs/cifs/smb2ops.c |
1784 |
++++ b/fs/cifs/smb2ops.c |
1785 |
+@@ -1643,9 +1643,17 @@ smb2_copychunk_range(const unsigned int xid, |
1786 |
+ int chunks_copied = 0; |
1787 |
+ bool chunk_sizes_updated = false; |
1788 |
+ ssize_t bytes_written, total_bytes_written = 0; |
1789 |
++ struct inode *inode; |
1790 |
+ |
1791 |
+ pcchunk = kmalloc(sizeof(struct copychunk_ioctl), GFP_KERNEL); |
1792 |
+ |
1793 |
++ /* |
1794 |
++ * We need to flush all unwritten data before we can send the |
1795 |
++ * copychunk ioctl to the server. |
1796 |
++ */ |
1797 |
++ inode = d_inode(trgtfile->dentry); |
1798 |
++ filemap_write_and_wait(inode->i_mapping); |
1799 |
++ |
1800 |
+ if (pcchunk == NULL) |
1801 |
+ return -ENOMEM; |
1802 |
+ |
1803 |
+diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c |
1804 |
+index 358398b1fe0c9..7d039ba5ae28b 100644 |
1805 |
+--- a/fs/hugetlbfs/inode.c |
1806 |
++++ b/fs/hugetlbfs/inode.c |
1807 |
+@@ -38,6 +38,7 @@ |
1808 |
+ #include <linux/uio.h> |
1809 |
+ |
1810 |
+ #include <linux/uaccess.h> |
1811 |
++#include <linux/sched/mm.h> |
1812 |
+ |
1813 |
+ static const struct super_operations hugetlbfs_ops; |
1814 |
+ static const struct address_space_operations hugetlbfs_aops; |
1815 |
+@@ -200,6 +201,54 @@ out: |
1816 |
+ */ |
1817 |
+ |
1818 |
+ #ifndef HAVE_ARCH_HUGETLB_UNMAPPED_AREA |
1819 |
++static unsigned long |
1820 |
++hugetlb_get_unmapped_area_bottomup(struct file *file, unsigned long addr, |
1821 |
++ unsigned long len, unsigned long pgoff, unsigned long flags) |
1822 |
++{ |
1823 |
++ struct hstate *h = hstate_file(file); |
1824 |
++ struct vm_unmapped_area_info info; |
1825 |
++ |
1826 |
++ info.flags = 0; |
1827 |
++ info.length = len; |
1828 |
++ info.low_limit = current->mm->mmap_base; |
1829 |
++ info.high_limit = arch_get_mmap_end(addr); |
1830 |
++ info.align_mask = PAGE_MASK & ~huge_page_mask(h); |
1831 |
++ info.align_offset = 0; |
1832 |
++ return vm_unmapped_area(&info); |
1833 |
++} |
1834 |
++ |
1835 |
++static unsigned long |
1836 |
++hugetlb_get_unmapped_area_topdown(struct file *file, unsigned long addr, |
1837 |
++ unsigned long len, unsigned long pgoff, unsigned long flags) |
1838 |
++{ |
1839 |
++ struct hstate *h = hstate_file(file); |
1840 |
++ struct vm_unmapped_area_info info; |
1841 |
++ |
1842 |
++ info.flags = VM_UNMAPPED_AREA_TOPDOWN; |
1843 |
++ info.length = len; |
1844 |
++ info.low_limit = max(PAGE_SIZE, mmap_min_addr); |
1845 |
++ info.high_limit = arch_get_mmap_base(addr, current->mm->mmap_base); |
1846 |
++ info.align_mask = PAGE_MASK & ~huge_page_mask(h); |
1847 |
++ info.align_offset = 0; |
1848 |
++ addr = vm_unmapped_area(&info); |
1849 |
++ |
1850 |
++ /* |
1851 |
++ * A failed mmap() very likely causes application failure, |
1852 |
++ * so fall back to the bottom-up function here. This scenario |
1853 |
++ * can happen with large stack limits and large mmap() |
1854 |
++ * allocations. |
1855 |
++ */ |
1856 |
++ if (unlikely(offset_in_page(addr))) { |
1857 |
++ VM_BUG_ON(addr != -ENOMEM); |
1858 |
++ info.flags = 0; |
1859 |
++ info.low_limit = current->mm->mmap_base; |
1860 |
++ info.high_limit = arch_get_mmap_end(addr); |
1861 |
++ addr = vm_unmapped_area(&info); |
1862 |
++ } |
1863 |
++ |
1864 |
++ return addr; |
1865 |
++} |
1866 |
++ |
1867 |
+ static unsigned long |
1868 |
+ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, |
1869 |
+ unsigned long len, unsigned long pgoff, unsigned long flags) |
1870 |
+@@ -207,7 +256,7 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, |
1871 |
+ struct mm_struct *mm = current->mm; |
1872 |
+ struct vm_area_struct *vma; |
1873 |
+ struct hstate *h = hstate_file(file); |
1874 |
+- struct vm_unmapped_area_info info; |
1875 |
++ const unsigned long mmap_end = arch_get_mmap_end(addr); |
1876 |
+ |
1877 |
+ if (len & ~huge_page_mask(h)) |
1878 |
+ return -EINVAL; |
1879 |
+@@ -223,18 +272,21 @@ hugetlb_get_unmapped_area(struct file *file, unsigned long addr, |
1880 |
+ if (addr) { |
1881 |
+ addr = ALIGN(addr, huge_page_size(h)); |
1882 |
+ vma = find_vma(mm, addr); |
1883 |
+- if (TASK_SIZE - len >= addr && |
1884 |
++ if (mmap_end - len >= addr && |
1885 |
+ (!vma || addr + len <= vm_start_gap(vma))) |
1886 |
+ return addr; |
1887 |
+ } |
1888 |
+ |
1889 |
+- info.flags = 0; |
1890 |
+- info.length = len; |
1891 |
+- info.low_limit = TASK_UNMAPPED_BASE; |
1892 |
+- info.high_limit = TASK_SIZE; |
1893 |
+- info.align_mask = PAGE_MASK & ~huge_page_mask(h); |
1894 |
+- info.align_offset = 0; |
1895 |
+- return vm_unmapped_area(&info); |
1896 |
++ /* |
1897 |
++ * Use mm->get_unmapped_area value as a hint to use topdown routine. |
1898 |
++ * If architectures have special needs, they should define their own |
1899 |
++ * version of hugetlb_get_unmapped_area. |
1900 |
++ */ |
1901 |
++ if (mm->get_unmapped_area == arch_get_unmapped_area_topdown) |
1902 |
++ return hugetlb_get_unmapped_area_topdown(file, addr, len, |
1903 |
++ pgoff, flags); |
1904 |
++ return hugetlb_get_unmapped_area_bottomup(file, addr, len, |
1905 |
++ pgoff, flags); |
1906 |
+ } |
1907 |
+ #endif |
1908 |
+ |
1909 |
+diff --git a/include/linux/kernel.h b/include/linux/kernel.h |
1910 |
+index d83d403dac2ea..77c86a2236daf 100644 |
1911 |
+--- a/include/linux/kernel.h |
1912 |
++++ b/include/linux/kernel.h |
1913 |
+@@ -627,7 +627,7 @@ static inline char *hex_byte_pack_upper(char *buf, u8 byte) |
1914 |
+ return buf; |
1915 |
+ } |
1916 |
+ |
1917 |
+-extern int hex_to_bin(char ch); |
1918 |
++extern int hex_to_bin(unsigned char ch); |
1919 |
+ extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); |
1920 |
+ extern char *bin2hex(char *dst, const void *src, size_t count); |
1921 |
+ |
1922 |
+diff --git a/include/linux/sched/mm.h b/include/linux/sched/mm.h |
1923 |
+index 3a1d899019af0..ab0da04ac9ee7 100644 |
1924 |
+--- a/include/linux/sched/mm.h |
1925 |
++++ b/include/linux/sched/mm.h |
1926 |
+@@ -133,6 +133,14 @@ static inline void mm_update_next_owner(struct mm_struct *mm) |
1927 |
+ #endif /* CONFIG_MEMCG */ |
1928 |
+ |
1929 |
+ #ifdef CONFIG_MMU |
1930 |
++#ifndef arch_get_mmap_end |
1931 |
++#define arch_get_mmap_end(addr) (TASK_SIZE) |
1932 |
++#endif |
1933 |
++ |
1934 |
++#ifndef arch_get_mmap_base |
1935 |
++#define arch_get_mmap_base(addr, base) (base) |
1936 |
++#endif |
1937 |
++ |
1938 |
+ extern void arch_pick_mmap_layout(struct mm_struct *mm, |
1939 |
+ struct rlimit *rlim_stack); |
1940 |
+ extern unsigned long |
1941 |
+diff --git a/include/net/tcp.h b/include/net/tcp.h |
1942 |
+index b914959cd2c67..9237362e56065 100644 |
1943 |
+--- a/include/net/tcp.h |
1944 |
++++ b/include/net/tcp.h |
1945 |
+@@ -603,6 +603,7 @@ void tcp_synack_rtt_meas(struct sock *sk, struct request_sock *req); |
1946 |
+ void tcp_reset(struct sock *sk); |
1947 |
+ void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp, struct sk_buff *skb); |
1948 |
+ void tcp_fin(struct sock *sk); |
1949 |
++void tcp_check_space(struct sock *sk); |
1950 |
+ |
1951 |
+ /* tcp_timer.c */ |
1952 |
+ void tcp_init_xmit_timers(struct sock *); |
1953 |
+@@ -1030,6 +1031,7 @@ struct rate_sample { |
1954 |
+ int losses; /* number of packets marked lost upon ACK */ |
1955 |
+ u32 acked_sacked; /* number of packets newly (S)ACKed upon ACK */ |
1956 |
+ u32 prior_in_flight; /* in flight before this ACK */ |
1957 |
++ u32 last_end_seq; /* end_seq of most recently ACKed packet */ |
1958 |
+ bool is_app_limited; /* is sample from packet with bubble in pipe? */ |
1959 |
+ bool is_retrans; /* is sample from retransmission? */ |
1960 |
+ bool is_ack_delayed; /* is this (likely) a delayed ACK? */ |
1961 |
+@@ -1139,6 +1141,11 @@ void tcp_rate_gen(struct sock *sk, u32 delivered, u32 lost, |
1962 |
+ bool is_sack_reneg, struct rate_sample *rs); |
1963 |
+ void tcp_rate_check_app_limited(struct sock *sk); |
1964 |
+ |
1965 |
++static inline bool tcp_skb_sent_after(u64 t1, u64 t2, u32 seq1, u32 seq2) |
1966 |
++{ |
1967 |
++ return t1 > t2 || (t1 == t2 && after(seq1, seq2)); |
1968 |
++} |
1969 |
++ |
1970 |
+ /* These functions determine how the current flow behaves in respect of SACK |
1971 |
+ * handling. SACK is negotiated with the peer, and therefore it can vary |
1972 |
+ * between different flows. |
1973 |
+diff --git a/lib/hexdump.c b/lib/hexdump.c |
1974 |
+index 147133f8eb2fc..c0a08ddcf94e2 100644 |
1975 |
+--- a/lib/hexdump.c |
1976 |
++++ b/lib/hexdump.c |
1977 |
+@@ -21,15 +21,33 @@ EXPORT_SYMBOL(hex_asc_upper); |
1978 |
+ * |
1979 |
+ * hex_to_bin() converts one hex digit to its actual value or -1 in case of bad |
1980 |
+ * input. |
1981 |
++ * |
1982 |
++ * This function is used to load cryptographic keys, so it is coded in such a |
1983 |
++ * way that there are no conditions or memory accesses that depend on data. |
1984 |
++ * |
1985 |
++ * Explanation of the logic: |
1986 |
++ * (ch - '9' - 1) is negative if ch <= '9' |
1987 |
++ * ('0' - 1 - ch) is negative if ch >= '0' |
1988 |
++ * we "and" these two values, so the result is negative if ch is in the range |
1989 |
++ * '0' ... '9' |
1990 |
++ * we are only interested in the sign, so we do a shift ">> 8"; note that right |
1991 |
++ * shift of a negative value is implementation-defined, so we cast the |
1992 |
++ * value to (unsigned) before the shift --- we have 0xffffff if ch is in |
1993 |
++ * the range '0' ... '9', 0 otherwise |
1994 |
++ * we "and" this value with (ch - '0' + 1) --- we have a value 1 ... 10 if ch is |
1995 |
++ * in the range '0' ... '9', 0 otherwise |
1996 |
++ * we add this value to -1 --- we have a value 0 ... 9 if ch is in the range '0' |
1997 |
++ * ... '9', -1 otherwise |
1998 |
++ * the next line is similar to the previous one, but we need to decode both |
1999 |
++ * uppercase and lowercase letters, so we use (ch & 0xdf), which converts |
2000 |
++ * lowercase to uppercase |
2001 |
+ */ |
2002 |
+-int hex_to_bin(char ch) |
2003 |
++int hex_to_bin(unsigned char ch) |
2004 |
+ { |
2005 |
+- if ((ch >= '0') && (ch <= '9')) |
2006 |
+- return ch - '0'; |
2007 |
+- ch = tolower(ch); |
2008 |
+- if ((ch >= 'a') && (ch <= 'f')) |
2009 |
+- return ch - 'a' + 10; |
2010 |
+- return -1; |
2011 |
++ unsigned char cu = ch & 0xdf; |
2012 |
++ return -1 + |
2013 |
++ ((ch - '0' + 1) & (unsigned)((ch - '9' - 1) & ('0' - 1 - ch)) >> 8) + |
2014 |
++ ((cu - 'A' + 11) & (unsigned)((cu - 'F' - 1) & ('A' - 1 - cu)) >> 8); |
2015 |
+ } |
2016 |
+ EXPORT_SYMBOL(hex_to_bin); |
2017 |
+ |
2018 |
+@@ -44,10 +62,13 @@ EXPORT_SYMBOL(hex_to_bin); |
2019 |
+ int hex2bin(u8 *dst, const char *src, size_t count) |
2020 |
+ { |
2021 |
+ while (count--) { |
2022 |
+- int hi = hex_to_bin(*src++); |
2023 |
+- int lo = hex_to_bin(*src++); |
2024 |
++ int hi, lo; |
2025 |
+ |
2026 |
+- if ((hi < 0) || (lo < 0)) |
2027 |
++ hi = hex_to_bin(*src++); |
2028 |
++ if (unlikely(hi < 0)) |
2029 |
++ return -EINVAL; |
2030 |
++ lo = hex_to_bin(*src++); |
2031 |
++ if (unlikely(lo < 0)) |
2032 |
+ return -EINVAL; |
2033 |
+ |
2034 |
+ *dst++ = (hi << 4) | lo; |
2035 |
+diff --git a/mm/mmap.c b/mm/mmap.c |
2036 |
+index 58cfd5b1e0b16..88e6863677768 100644 |
2037 |
+--- a/mm/mmap.c |
2038 |
++++ b/mm/mmap.c |
2039 |
+@@ -2077,14 +2077,6 @@ found_highest: |
2040 |
+ } |
2041 |
+ |
2042 |
+ |
2043 |
+-#ifndef arch_get_mmap_end |
2044 |
+-#define arch_get_mmap_end(addr) (TASK_SIZE) |
2045 |
+-#endif |
2046 |
+- |
2047 |
+-#ifndef arch_get_mmap_base |
2048 |
+-#define arch_get_mmap_base(addr, base) (base) |
2049 |
+-#endif |
2050 |
+- |
2051 |
+ /* Get an address range which is currently unmapped. |
2052 |
+ * For shmat() with addr=0. |
2053 |
+ * |
2054 |
+diff --git a/net/core/lwt_bpf.c b/net/core/lwt_bpf.c |
2055 |
+index a5502c5aa44e7..bf270b6a99b4f 100644 |
2056 |
+--- a/net/core/lwt_bpf.c |
2057 |
++++ b/net/core/lwt_bpf.c |
2058 |
+@@ -158,10 +158,8 @@ static int bpf_output(struct net *net, struct sock *sk, struct sk_buff *skb) |
2059 |
+ return dst->lwtstate->orig_output(net, sk, skb); |
2060 |
+ } |
2061 |
+ |
2062 |
+-static int xmit_check_hhlen(struct sk_buff *skb) |
2063 |
++static int xmit_check_hhlen(struct sk_buff *skb, int hh_len) |
2064 |
+ { |
2065 |
+- int hh_len = skb_dst(skb)->dev->hard_header_len; |
2066 |
+- |
2067 |
+ if (skb_headroom(skb) < hh_len) { |
2068 |
+ int nhead = HH_DATA_ALIGN(hh_len - skb_headroom(skb)); |
2069 |
+ |
2070 |
+@@ -273,6 +271,7 @@ static int bpf_xmit(struct sk_buff *skb) |
2071 |
+ |
2072 |
+ bpf = bpf_lwt_lwtunnel(dst->lwtstate); |
2073 |
+ if (bpf->xmit.prog) { |
2074 |
++ int hh_len = dst->dev->hard_header_len; |
2075 |
+ __be16 proto = skb->protocol; |
2076 |
+ int ret; |
2077 |
+ |
2078 |
+@@ -290,7 +289,7 @@ static int bpf_xmit(struct sk_buff *skb) |
2079 |
+ /* If the header was expanded, headroom might be too |
2080 |
+ * small for L2 header to come, expand as needed. |
2081 |
+ */ |
2082 |
+- ret = xmit_check_hhlen(skb); |
2083 |
++ ret = xmit_check_hhlen(skb, hh_len); |
2084 |
+ if (unlikely(ret)) |
2085 |
+ return ret; |
2086 |
+ |
2087 |
+diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c |
2088 |
+index f67f1d27f5655..5b38d03f6d79a 100644 |
2089 |
+--- a/net/ipv4/ip_gre.c |
2090 |
++++ b/net/ipv4/ip_gre.c |
2091 |
+@@ -432,14 +432,12 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev, |
2092 |
+ __be16 proto) |
2093 |
+ { |
2094 |
+ struct ip_tunnel *tunnel = netdev_priv(dev); |
2095 |
+- |
2096 |
+- if (tunnel->parms.o_flags & TUNNEL_SEQ) |
2097 |
+- tunnel->o_seqno++; |
2098 |
++ __be16 flags = tunnel->parms.o_flags; |
2099 |
+ |
2100 |
+ /* Push GRE header. */ |
2101 |
+ gre_build_header(skb, tunnel->tun_hlen, |
2102 |
+- tunnel->parms.o_flags, proto, tunnel->parms.o_key, |
2103 |
+- htonl(tunnel->o_seqno)); |
2104 |
++ flags, proto, tunnel->parms.o_key, |
2105 |
++ (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) : 0); |
2106 |
+ |
2107 |
+ ip_tunnel_xmit(skb, dev, tnl_params, tnl_params->protocol); |
2108 |
+ } |
2109 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
2110 |
+index c0fcfa2964686..b0e6fc2c5e108 100644 |
2111 |
+--- a/net/ipv4/tcp_input.c |
2112 |
++++ b/net/ipv4/tcp_input.c |
2113 |
+@@ -3717,7 +3717,8 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) |
2114 |
+ tcp_process_tlp_ack(sk, ack, flag); |
2115 |
+ |
2116 |
+ if (tcp_ack_is_dubious(sk, flag)) { |
2117 |
+- if (!(flag & (FLAG_SND_UNA_ADVANCED | FLAG_NOT_DUP))) { |
2118 |
++ if (!(flag & (FLAG_SND_UNA_ADVANCED | |
2119 |
++ FLAG_NOT_DUP | FLAG_DSACKING_ACK))) { |
2120 |
+ num_dupack = 1; |
2121 |
+ /* Consider if pure acks were aggregated in tcp_add_backlog() */ |
2122 |
+ if (!(flag & FLAG_DATA)) |
2123 |
+@@ -5230,7 +5231,17 @@ static void tcp_new_space(struct sock *sk) |
2124 |
+ sk->sk_write_space(sk); |
2125 |
+ } |
2126 |
+ |
2127 |
+-static void tcp_check_space(struct sock *sk) |
2128 |
++/* Caller made space either from: |
2129 |
++ * 1) Freeing skbs in rtx queues (after tp->snd_una has advanced) |
2130 |
++ * 2) Sent skbs from output queue (and thus advancing tp->snd_nxt) |
2131 |
++ * |
2132 |
++ * We might be able to generate EPOLLOUT to the application if: |
2133 |
++ * 1) Space consumed in output/rtx queues is below sk->sk_sndbuf/2 |
2134 |
++ * 2) notsent amount (tp->write_seq - tp->snd_nxt) became |
2135 |
++ * small enough that tcp_stream_memory_free() decides it |
2136 |
++ * is time to generate EPOLLOUT. |
2137 |
++ */ |
2138 |
++void tcp_check_space(struct sock *sk) |
2139 |
+ { |
2140 |
+ if (sock_flag(sk, SOCK_QUEUE_SHRUNK)) { |
2141 |
+ sock_reset_flag(sk, SOCK_QUEUE_SHRUNK); |
2142 |
+diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c |
2143 |
+index 194743bd3fc10..9b038cb0a43d2 100644 |
2144 |
+--- a/net/ipv4/tcp_minisocks.c |
2145 |
++++ b/net/ipv4/tcp_minisocks.c |
2146 |
+@@ -538,7 +538,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, |
2147 |
+ newtp->tsoffset = treq->ts_off; |
2148 |
+ #ifdef CONFIG_TCP_MD5SIG |
2149 |
+ newtp->md5sig_info = NULL; /*XXX*/ |
2150 |
+- if (newtp->af_specific->md5_lookup(sk, newsk)) |
2151 |
++ if (treq->af_specific->req_md5_lookup(sk, req_to_sk(req))) |
2152 |
+ newtp->tcp_header_len += TCPOLEN_MD5SIG_ALIGNED; |
2153 |
+ #endif |
2154 |
+ if (skb->len >= TCP_MSS_DEFAULT + newtp->tcp_header_len) |
2155 |
+diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c |
2156 |
+index 139e962d1aef3..67493ec6318ad 100644 |
2157 |
+--- a/net/ipv4/tcp_output.c |
2158 |
++++ b/net/ipv4/tcp_output.c |
2159 |
+@@ -81,6 +81,7 @@ static void tcp_event_new_data_sent(struct sock *sk, struct sk_buff *skb) |
2160 |
+ |
2161 |
+ NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPORIGDATASENT, |
2162 |
+ tcp_skb_pcount(skb)); |
2163 |
++ tcp_check_space(sk); |
2164 |
+ } |
2165 |
+ |
2166 |
+ /* SND.NXT, if window was not shrunk or the amount of shrunk was less than one |
2167 |
+diff --git a/net/ipv4/tcp_rate.c b/net/ipv4/tcp_rate.c |
2168 |
+index 0de6935659635..6ab197928abbc 100644 |
2169 |
+--- a/net/ipv4/tcp_rate.c |
2170 |
++++ b/net/ipv4/tcp_rate.c |
2171 |
+@@ -73,26 +73,31 @@ void tcp_rate_skb_sent(struct sock *sk, struct sk_buff *skb) |
2172 |
+ * |
2173 |
+ * If an ACK (s)acks multiple skbs (e.g., stretched-acks), this function is |
2174 |
+ * called multiple times. We favor the information from the most recently |
2175 |
+- * sent skb, i.e., the skb with the highest prior_delivered count. |
2176 |
++ * sent skb, i.e., the skb with the most recently sent time and the highest |
2177 |
++ * sequence. |
2178 |
+ */ |
2179 |
+ void tcp_rate_skb_delivered(struct sock *sk, struct sk_buff *skb, |
2180 |
+ struct rate_sample *rs) |
2181 |
+ { |
2182 |
+ struct tcp_sock *tp = tcp_sk(sk); |
2183 |
+ struct tcp_skb_cb *scb = TCP_SKB_CB(skb); |
2184 |
++ u64 tx_tstamp; |
2185 |
+ |
2186 |
+ if (!scb->tx.delivered_mstamp) |
2187 |
+ return; |
2188 |
+ |
2189 |
++ tx_tstamp = tcp_skb_timestamp_us(skb); |
2190 |
+ if (!rs->prior_delivered || |
2191 |
+- after(scb->tx.delivered, rs->prior_delivered)) { |
2192 |
++ tcp_skb_sent_after(tx_tstamp, tp->first_tx_mstamp, |
2193 |
++ scb->end_seq, rs->last_end_seq)) { |
2194 |
+ rs->prior_delivered = scb->tx.delivered; |
2195 |
+ rs->prior_mstamp = scb->tx.delivered_mstamp; |
2196 |
+ rs->is_app_limited = scb->tx.is_app_limited; |
2197 |
+ rs->is_retrans = scb->sacked & TCPCB_RETRANS; |
2198 |
++ rs->last_end_seq = scb->end_seq; |
2199 |
+ |
2200 |
+ /* Record send time of most recently ACKed packet: */ |
2201 |
+- tp->first_tx_mstamp = tcp_skb_timestamp_us(skb); |
2202 |
++ tp->first_tx_mstamp = tx_tstamp; |
2203 |
+ /* Find the duration of the "send phase" of this window: */ |
2204 |
+ rs->interval_us = tcp_stamp_us_delta(tp->first_tx_mstamp, |
2205 |
+ scb->tx.first_tx_mstamp); |
2206 |
+diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c |
2207 |
+index 5dbc280d43856..e550db28aabb5 100644 |
2208 |
+--- a/net/ipv6/ip6_gre.c |
2209 |
++++ b/net/ipv6/ip6_gre.c |
2210 |
+@@ -730,6 +730,7 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, |
2211 |
+ struct ip_tunnel_info *tun_info; |
2212 |
+ const struct ip_tunnel_key *key; |
2213 |
+ __be16 flags; |
2214 |
++ int tun_hlen; |
2215 |
+ |
2216 |
+ tun_info = skb_tunnel_info(skb); |
2217 |
+ if (unlikely(!tun_info || |
2218 |
+@@ -748,9 +749,9 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, |
2219 |
+ dsfield = key->tos; |
2220 |
+ flags = key->tun_flags & |
2221 |
+ (TUNNEL_CSUM | TUNNEL_KEY | TUNNEL_SEQ); |
2222 |
+- tunnel->tun_hlen = gre_calc_hlen(flags); |
2223 |
++ tun_hlen = gre_calc_hlen(flags); |
2224 |
+ |
2225 |
+- gre_build_header(skb, tunnel->tun_hlen, |
2226 |
++ gre_build_header(skb, tun_hlen, |
2227 |
+ flags, protocol, |
2228 |
+ tunnel_id_to_key32(tun_info->key.tun_id), |
2229 |
+ (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) |
2230 |
+diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c |
2231 |
+index d1524ca4b90ef..a189079a6ea50 100644 |
2232 |
+--- a/net/netfilter/ipvs/ip_vs_conn.c |
2233 |
++++ b/net/netfilter/ipvs/ip_vs_conn.c |
2234 |
+@@ -1421,7 +1421,7 @@ int __init ip_vs_conn_init(void) |
2235 |
+ pr_info("Connection hash table configured " |
2236 |
+ "(size=%d, memory=%ldKbytes)\n", |
2237 |
+ ip_vs_conn_tab_size, |
2238 |
+- (long)(ip_vs_conn_tab_size*sizeof(struct list_head))/1024); |
2239 |
++ (long)(ip_vs_conn_tab_size*sizeof(*ip_vs_conn_tab))/1024); |
2240 |
+ IP_VS_DBG(0, "Each connection entry needs %zd bytes at least\n", |
2241 |
+ sizeof(struct ip_vs_conn)); |
2242 |
+ |
2243 |
+diff --git a/net/netfilter/nft_socket.c b/net/netfilter/nft_socket.c |
2244 |
+index 637ce3e8c575c..4026ec38526f6 100644 |
2245 |
+--- a/net/netfilter/nft_socket.c |
2246 |
++++ b/net/netfilter/nft_socket.c |
2247 |
+@@ -14,6 +14,32 @@ struct nft_socket { |
2248 |
+ }; |
2249 |
+ }; |
2250 |
+ |
2251 |
++static struct sock *nft_socket_do_lookup(const struct nft_pktinfo *pkt) |
2252 |
++{ |
2253 |
++ const struct net_device *indev = nft_in(pkt); |
2254 |
++ const struct sk_buff *skb = pkt->skb; |
2255 |
++ struct sock *sk = NULL; |
2256 |
++ |
2257 |
++ if (!indev) |
2258 |
++ return NULL; |
2259 |
++ |
2260 |
++ switch (nft_pf(pkt)) { |
2261 |
++ case NFPROTO_IPV4: |
2262 |
++ sk = nf_sk_lookup_slow_v4(nft_net(pkt), skb, indev); |
2263 |
++ break; |
2264 |
++#if IS_ENABLED(CONFIG_NF_TABLES_IPV6) |
2265 |
++ case NFPROTO_IPV6: |
2266 |
++ sk = nf_sk_lookup_slow_v6(nft_net(pkt), skb, indev); |
2267 |
++ break; |
2268 |
++#endif |
2269 |
++ default: |
2270 |
++ WARN_ON_ONCE(1); |
2271 |
++ break; |
2272 |
++ } |
2273 |
++ |
2274 |
++ return sk; |
2275 |
++} |
2276 |
++ |
2277 |
+ static void nft_socket_eval(const struct nft_expr *expr, |
2278 |
+ struct nft_regs *regs, |
2279 |
+ const struct nft_pktinfo *pkt) |
2280 |
+@@ -27,20 +53,7 @@ static void nft_socket_eval(const struct nft_expr *expr, |
2281 |
+ sk = NULL; |
2282 |
+ |
2283 |
+ if (!sk) |
2284 |
+- switch(nft_pf(pkt)) { |
2285 |
+- case NFPROTO_IPV4: |
2286 |
+- sk = nf_sk_lookup_slow_v4(nft_net(pkt), skb, nft_in(pkt)); |
2287 |
+- break; |
2288 |
+-#if IS_ENABLED(CONFIG_NF_TABLES_IPV6) |
2289 |
+- case NFPROTO_IPV6: |
2290 |
+- sk = nf_sk_lookup_slow_v6(nft_net(pkt), skb, nft_in(pkt)); |
2291 |
+- break; |
2292 |
+-#endif |
2293 |
+- default: |
2294 |
+- WARN_ON_ONCE(1); |
2295 |
+- regs->verdict.code = NFT_BREAK; |
2296 |
+- return; |
2297 |
+- } |
2298 |
++ sk = nft_socket_do_lookup(pkt); |
2299 |
+ |
2300 |
+ if (!sk) { |
2301 |
+ regs->verdict.code = NFT_BREAK; |
2302 |
+@@ -123,6 +136,16 @@ static int nft_socket_dump(struct sk_buff *skb, |
2303 |
+ return 0; |
2304 |
+ } |
2305 |
+ |
2306 |
++static int nft_socket_validate(const struct nft_ctx *ctx, |
2307 |
++ const struct nft_expr *expr, |
2308 |
++ const struct nft_data **data) |
2309 |
++{ |
2310 |
++ return nft_chain_validate_hooks(ctx->chain, |
2311 |
++ (1 << NF_INET_PRE_ROUTING) | |
2312 |
++ (1 << NF_INET_LOCAL_IN) | |
2313 |
++ (1 << NF_INET_LOCAL_OUT)); |
2314 |
++} |
2315 |
++ |
2316 |
+ static struct nft_expr_type nft_socket_type; |
2317 |
+ static const struct nft_expr_ops nft_socket_ops = { |
2318 |
+ .type = &nft_socket_type, |
2319 |
+@@ -130,6 +153,7 @@ static const struct nft_expr_ops nft_socket_ops = { |
2320 |
+ .eval = nft_socket_eval, |
2321 |
+ .init = nft_socket_init, |
2322 |
+ .dump = nft_socket_dump, |
2323 |
++ .validate = nft_socket_validate, |
2324 |
+ }; |
2325 |
+ |
2326 |
+ static struct nft_expr_type nft_socket_type __read_mostly = { |
2327 |
+diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c |
2328 |
+index 0d225f891b61b..8d32229199b96 100644 |
2329 |
+--- a/net/sctp/sm_sideeffect.c |
2330 |
++++ b/net/sctp/sm_sideeffect.c |
2331 |
+@@ -458,6 +458,10 @@ void sctp_generate_reconf_event(struct timer_list *t) |
2332 |
+ goto out_unlock; |
2333 |
+ } |
2334 |
+ |
2335 |
++ /* This happens when the response arrives after the timer is triggered. */ |
2336 |
++ if (!asoc->strreset_chunk) |
2337 |
++ goto out_unlock; |
2338 |
++ |
2339 |
+ error = sctp_do_sm(net, SCTP_EVENT_T_TIMEOUT, |
2340 |
+ SCTP_ST_TIMEOUT(SCTP_EVENT_TIMEOUT_RECONF), |
2341 |
+ asoc->state, asoc->ep, asoc, |
2342 |
+diff --git a/net/smc/af_smc.c b/net/smc/af_smc.c |
2343 |
+index 5221092cc66d4..a5a8cca46bd5f 100644 |
2344 |
+--- a/net/smc/af_smc.c |
2345 |
++++ b/net/smc/af_smc.c |
2346 |
+@@ -816,6 +816,8 @@ static void smc_connect_work(struct work_struct *work) |
2347 |
+ smc->sk.sk_state = SMC_CLOSED; |
2348 |
+ if (rc == -EPIPE || rc == -EAGAIN) |
2349 |
+ smc->sk.sk_err = EPIPE; |
2350 |
++ else if (rc == -ECONNREFUSED) |
2351 |
++ smc->sk.sk_err = ECONNREFUSED; |
2352 |
+ else if (signal_pending(current)) |
2353 |
+ smc->sk.sk_err = -sock_intr_errno(timeo); |
2354 |
+ sock_put(&smc->sk); /* passive closing */ |
2355 |
+diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c |
2356 |
+index 0f034c3bc37d7..abb93f7343c53 100644 |
2357 |
+--- a/net/tls/tls_device.c |
2358 |
++++ b/net/tls/tls_device.c |
2359 |
+@@ -470,11 +470,13 @@ handle_error: |
2360 |
+ copy = min_t(size_t, size, (pfrag->size - pfrag->offset)); |
2361 |
+ copy = min_t(size_t, copy, (max_open_record_len - record->len)); |
2362 |
+ |
2363 |
+- rc = tls_device_copy_data(page_address(pfrag->page) + |
2364 |
+- pfrag->offset, copy, msg_iter); |
2365 |
+- if (rc) |
2366 |
+- goto handle_error; |
2367 |
+- tls_append_frag(record, pfrag, copy); |
2368 |
++ if (copy) { |
2369 |
++ rc = tls_device_copy_data(page_address(pfrag->page) + |
2370 |
++ pfrag->offset, copy, msg_iter); |
2371 |
++ if (rc) |
2372 |
++ goto handle_error; |
2373 |
++ tls_append_frag(record, pfrag, copy); |
2374 |
++ } |
2375 |
+ |
2376 |
+ size -= copy; |
2377 |
+ if (!size) { |
2378 |
+diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c |
2379 |
+index 6fd1bef848ed9..fa55d79b39b60 100644 |
2380 |
+--- a/sound/soc/codecs/wm8731.c |
2381 |
++++ b/sound/soc/codecs/wm8731.c |
2382 |
+@@ -601,7 +601,7 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731) |
2383 |
+ ret = wm8731_reset(wm8731->regmap); |
2384 |
+ if (ret < 0) { |
2385 |
+ dev_err(dev, "Failed to issue reset: %d\n", ret); |
2386 |
+- goto err_regulator_enable; |
2387 |
++ goto err; |
2388 |
+ } |
2389 |
+ |
2390 |
+ /* Clear POWEROFF, keep everything else disabled */ |
2391 |
+@@ -618,10 +618,7 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731) |
2392 |
+ |
2393 |
+ regcache_mark_dirty(wm8731->regmap); |
2394 |
+ |
2395 |
+-err_regulator_enable: |
2396 |
+- /* Regulators will be enabled by bias management */ |
2397 |
+- regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); |
2398 |
+- |
2399 |
++err: |
2400 |
+ return ret; |
2401 |
+ } |
2402 |
+ |
2403 |
+@@ -765,21 +762,27 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, |
2404 |
+ ret = PTR_ERR(wm8731->regmap); |
2405 |
+ dev_err(&i2c->dev, "Failed to allocate register map: %d\n", |
2406 |
+ ret); |
2407 |
+- return ret; |
2408 |
++ goto err_regulator_enable; |
2409 |
+ } |
2410 |
+ |
2411 |
+ ret = wm8731_hw_init(&i2c->dev, wm8731); |
2412 |
+ if (ret != 0) |
2413 |
+- return ret; |
2414 |
++ goto err_regulator_enable; |
2415 |
+ |
2416 |
+ ret = devm_snd_soc_register_component(&i2c->dev, |
2417 |
+ &soc_component_dev_wm8731, &wm8731_dai, 1); |
2418 |
+ if (ret != 0) { |
2419 |
+ dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); |
2420 |
+- return ret; |
2421 |
++ goto err_regulator_enable; |
2422 |
+ } |
2423 |
+ |
2424 |
+ return 0; |
2425 |
++ |
2426 |
++err_regulator_enable: |
2427 |
++ /* Regulators will be enabled by bias management */ |
2428 |
++ regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); |
2429 |
++ |
2430 |
++ return ret; |
2431 |
+ } |
2432 |
+ |
2433 |
+ static int wm8731_i2c_remove(struct i2c_client *client) |