1 |
commit: e28d4e5563aa2663aca05d1fcf1099688142aae7 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Wed Jul 28 12:38:06 2021 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Wed Jul 28 12:38:06 2021 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=e28d4e55 |
7 |
|
8 |
Linux patch 4.14.241 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1240_linux-4.14.241.patch | 2722 +++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 2726 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index f8cd9c6..2161354 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -1003,6 +1003,10 @@ Patch: 1239_linux-4.14.240.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.14.240 |
23 |
|
24 |
+Patch: 1240_linux-4.14.241.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.14.241 |
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/1240_linux-4.14.241.patch b/1240_linux-4.14.241.patch |
33 |
new file mode 100644 |
34 |
index 0000000..d3b6d67 |
35 |
--- /dev/null |
36 |
+++ b/1240_linux-4.14.241.patch |
37 |
@@ -0,0 +1,2722 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index c76ad4490eaf3..439f416c36ff8 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 14 |
46 |
+-SUBLEVEL = 240 |
47 |
++SUBLEVEL = 241 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = Petit Gorille |
50 |
+ |
51 |
+diff --git a/arch/arm/boot/dts/bcm-cygnus.dtsi b/arch/arm/boot/dts/bcm-cygnus.dtsi |
52 |
+index b822952c29f84..79acf9278aca2 100644 |
53 |
+--- a/arch/arm/boot/dts/bcm-cygnus.dtsi |
54 |
++++ b/arch/arm/boot/dts/bcm-cygnus.dtsi |
55 |
+@@ -446,7 +446,7 @@ |
56 |
+ status = "disabled"; |
57 |
+ }; |
58 |
+ |
59 |
+- nand: nand@18046000 { |
60 |
++ nand_controller: nand-controller@18046000 { |
61 |
+ compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1"; |
62 |
+ reg = <0x18046000 0x600>, <0xf8105408 0x600>, |
63 |
+ <0x18046f00 0x20>; |
64 |
+diff --git a/arch/arm/boot/dts/bcm-nsp.dtsi b/arch/arm/boot/dts/bcm-nsp.dtsi |
65 |
+index e975f9cabe84b..3bd3412b29a81 100644 |
66 |
+--- a/arch/arm/boot/dts/bcm-nsp.dtsi |
67 |
++++ b/arch/arm/boot/dts/bcm-nsp.dtsi |
68 |
+@@ -259,7 +259,7 @@ |
69 |
+ dma-coherent; |
70 |
+ }; |
71 |
+ |
72 |
+- nand: nand@26000 { |
73 |
++ nand_controller: nand-controller@26000 { |
74 |
+ compatible = "brcm,nand-iproc", "brcm,brcmnand-v6.1"; |
75 |
+ reg = <0x026000 0x600>, |
76 |
+ <0x11b408 0x600>, |
77 |
+diff --git a/arch/arm/boot/dts/bcm63138.dtsi b/arch/arm/boot/dts/bcm63138.dtsi |
78 |
+index 6df61518776f7..557098f5c8d53 100644 |
79 |
+--- a/arch/arm/boot/dts/bcm63138.dtsi |
80 |
++++ b/arch/arm/boot/dts/bcm63138.dtsi |
81 |
+@@ -175,7 +175,7 @@ |
82 |
+ status = "disabled"; |
83 |
+ }; |
84 |
+ |
85 |
+- nand: nand@2000 { |
86 |
++ nand_controller: nand-controller@2000 { |
87 |
+ #address-cells = <1>; |
88 |
+ #size-cells = <0>; |
89 |
+ compatible = "brcm,nand-bcm63138", "brcm,brcmnand-v7.0", "brcm,brcmnand"; |
90 |
+diff --git a/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts b/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts |
91 |
+index 8006c69a3fdf6..5931c02882839 100644 |
92 |
+--- a/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts |
93 |
++++ b/arch/arm/boot/dts/bcm7445-bcm97445svmb.dts |
94 |
+@@ -14,10 +14,10 @@ |
95 |
+ }; |
96 |
+ }; |
97 |
+ |
98 |
+-&nand { |
99 |
++&nand_controller { |
100 |
+ status = "okay"; |
101 |
+ |
102 |
+- nandcs@1 { |
103 |
++ nand@1 { |
104 |
+ compatible = "brcm,nandcs"; |
105 |
+ reg = <1>; |
106 |
+ nand-ecc-step-size = <512>; |
107 |
+diff --git a/arch/arm/boot/dts/bcm7445.dtsi b/arch/arm/boot/dts/bcm7445.dtsi |
108 |
+index c859aa6f358ca..b06845e92acda 100644 |
109 |
+--- a/arch/arm/boot/dts/bcm7445.dtsi |
110 |
++++ b/arch/arm/boot/dts/bcm7445.dtsi |
111 |
+@@ -150,7 +150,7 @@ |
112 |
+ reg-names = "aon-ctrl", "aon-sram"; |
113 |
+ }; |
114 |
+ |
115 |
+- nand: nand@3e2800 { |
116 |
++ nand_controller: nand-controller@3e2800 { |
117 |
+ status = "disabled"; |
118 |
+ #address-cells = <1>; |
119 |
+ #size-cells = <0>; |
120 |
+diff --git a/arch/arm/boot/dts/bcm911360_entphn.dts b/arch/arm/boot/dts/bcm911360_entphn.dts |
121 |
+index 53f990defd6ae..423a29a46b771 100644 |
122 |
+--- a/arch/arm/boot/dts/bcm911360_entphn.dts |
123 |
++++ b/arch/arm/boot/dts/bcm911360_entphn.dts |
124 |
+@@ -84,8 +84,8 @@ |
125 |
+ status = "okay"; |
126 |
+ }; |
127 |
+ |
128 |
+-&nand { |
129 |
+- nandcs@1 { |
130 |
++&nand_controller { |
131 |
++ nand@1 { |
132 |
+ compatible = "brcm,nandcs"; |
133 |
+ reg = <0>; |
134 |
+ nand-on-flash-bbt; |
135 |
+diff --git a/arch/arm/boot/dts/bcm958300k.dts b/arch/arm/boot/dts/bcm958300k.dts |
136 |
+index b4a1392bd5a6c..dda3e11b711f6 100644 |
137 |
+--- a/arch/arm/boot/dts/bcm958300k.dts |
138 |
++++ b/arch/arm/boot/dts/bcm958300k.dts |
139 |
+@@ -60,8 +60,8 @@ |
140 |
+ status = "okay"; |
141 |
+ }; |
142 |
+ |
143 |
+-&nand { |
144 |
+- nandcs@1 { |
145 |
++&nand_controller { |
146 |
++ nand@1 { |
147 |
+ compatible = "brcm,nandcs"; |
148 |
+ reg = <0>; |
149 |
+ nand-on-flash-bbt; |
150 |
+diff --git a/arch/arm/boot/dts/bcm958305k.dts b/arch/arm/boot/dts/bcm958305k.dts |
151 |
+index 3378683321d3c..ea3c6b88b313b 100644 |
152 |
+--- a/arch/arm/boot/dts/bcm958305k.dts |
153 |
++++ b/arch/arm/boot/dts/bcm958305k.dts |
154 |
+@@ -68,8 +68,8 @@ |
155 |
+ status = "okay"; |
156 |
+ }; |
157 |
+ |
158 |
+-&nand { |
159 |
+- nandcs@1 { |
160 |
++&nand_controller { |
161 |
++ nand@1 { |
162 |
+ compatible = "brcm,nandcs"; |
163 |
+ reg = <0>; |
164 |
+ nand-on-flash-bbt; |
165 |
+diff --git a/arch/arm/boot/dts/bcm958522er.dts b/arch/arm/boot/dts/bcm958522er.dts |
166 |
+index f9dd342cc2ae4..56f9181975b1a 100644 |
167 |
+--- a/arch/arm/boot/dts/bcm958522er.dts |
168 |
++++ b/arch/arm/boot/dts/bcm958522er.dts |
169 |
+@@ -74,8 +74,8 @@ |
170 |
+ status = "okay"; |
171 |
+ }; |
172 |
+ |
173 |
+-&nand { |
174 |
+- nandcs@0 { |
175 |
++&nand_controller { |
176 |
++ nand@0 { |
177 |
+ compatible = "brcm,nandcs"; |
178 |
+ reg = <0>; |
179 |
+ nand-on-flash-bbt; |
180 |
+diff --git a/arch/arm/boot/dts/bcm958525er.dts b/arch/arm/boot/dts/bcm958525er.dts |
181 |
+index 374508a9cfbfb..93a3e23ec7ae4 100644 |
182 |
+--- a/arch/arm/boot/dts/bcm958525er.dts |
183 |
++++ b/arch/arm/boot/dts/bcm958525er.dts |
184 |
+@@ -74,8 +74,8 @@ |
185 |
+ status = "okay"; |
186 |
+ }; |
187 |
+ |
188 |
+-&nand { |
189 |
+- nandcs@0 { |
190 |
++&nand_controller { |
191 |
++ nand@0 { |
192 |
+ compatible = "brcm,nandcs"; |
193 |
+ reg = <0>; |
194 |
+ nand-on-flash-bbt; |
195 |
+diff --git a/arch/arm/boot/dts/bcm958525xmc.dts b/arch/arm/boot/dts/bcm958525xmc.dts |
196 |
+index 403250c5ad8e7..fad974212d8af 100644 |
197 |
+--- a/arch/arm/boot/dts/bcm958525xmc.dts |
198 |
++++ b/arch/arm/boot/dts/bcm958525xmc.dts |
199 |
+@@ -90,8 +90,8 @@ |
200 |
+ }; |
201 |
+ }; |
202 |
+ |
203 |
+-&nand { |
204 |
+- nandcs@0 { |
205 |
++&nand_controller { |
206 |
++ nand@0 { |
207 |
+ compatible = "brcm,nandcs"; |
208 |
+ reg = <0>; |
209 |
+ nand-on-flash-bbt; |
210 |
+diff --git a/arch/arm/boot/dts/bcm958622hr.dts b/arch/arm/boot/dts/bcm958622hr.dts |
211 |
+index fd8b8c689ffe9..26b5ed56b604b 100644 |
212 |
+--- a/arch/arm/boot/dts/bcm958622hr.dts |
213 |
++++ b/arch/arm/boot/dts/bcm958622hr.dts |
214 |
+@@ -78,8 +78,8 @@ |
215 |
+ status = "okay"; |
216 |
+ }; |
217 |
+ |
218 |
+-&nand { |
219 |
+- nandcs@0 { |
220 |
++&nand_controller { |
221 |
++ nand@0 { |
222 |
+ compatible = "brcm,nandcs"; |
223 |
+ reg = <0>; |
224 |
+ nand-on-flash-bbt; |
225 |
+diff --git a/arch/arm/boot/dts/bcm958623hr.dts b/arch/arm/boot/dts/bcm958623hr.dts |
226 |
+index b8bde13de90a5..789fb77e17ade 100644 |
227 |
+--- a/arch/arm/boot/dts/bcm958623hr.dts |
228 |
++++ b/arch/arm/boot/dts/bcm958623hr.dts |
229 |
+@@ -78,8 +78,8 @@ |
230 |
+ status = "okay"; |
231 |
+ }; |
232 |
+ |
233 |
+-&nand { |
234 |
+- nandcs@0 { |
235 |
++&nand_controller { |
236 |
++ nand@0 { |
237 |
+ compatible = "brcm,nandcs"; |
238 |
+ reg = <0>; |
239 |
+ nand-on-flash-bbt; |
240 |
+diff --git a/arch/arm/boot/dts/bcm958625hr.dts b/arch/arm/boot/dts/bcm958625hr.dts |
241 |
+index f0e2008f74901..88d51eb3083d5 100644 |
242 |
+--- a/arch/arm/boot/dts/bcm958625hr.dts |
243 |
++++ b/arch/arm/boot/dts/bcm958625hr.dts |
244 |
+@@ -76,8 +76,8 @@ |
245 |
+ status = "okay"; |
246 |
+ }; |
247 |
+ |
248 |
+-&nand { |
249 |
+- nandcs@0 { |
250 |
++&nand_controller { |
251 |
++ nand@0 { |
252 |
+ compatible = "brcm,nandcs"; |
253 |
+ reg = <0>; |
254 |
+ nand-on-flash-bbt; |
255 |
+diff --git a/arch/arm/boot/dts/bcm958625k.dts b/arch/arm/boot/dts/bcm958625k.dts |
256 |
+index 2cf2392483b2a..22d321e06a319 100644 |
257 |
+--- a/arch/arm/boot/dts/bcm958625k.dts |
258 |
++++ b/arch/arm/boot/dts/bcm958625k.dts |
259 |
+@@ -69,8 +69,8 @@ |
260 |
+ status = "okay"; |
261 |
+ }; |
262 |
+ |
263 |
+-&nand { |
264 |
+- nandcs@0 { |
265 |
++&nand_controller { |
266 |
++ nand@0 { |
267 |
+ compatible = "brcm,nandcs"; |
268 |
+ reg = <0>; |
269 |
+ nand-on-flash-bbt; |
270 |
+diff --git a/arch/arm/boot/dts/bcm963138dvt.dts b/arch/arm/boot/dts/bcm963138dvt.dts |
271 |
+index c61673638fa8a..5445fccec5a54 100644 |
272 |
+--- a/arch/arm/boot/dts/bcm963138dvt.dts |
273 |
++++ b/arch/arm/boot/dts/bcm963138dvt.dts |
274 |
+@@ -30,10 +30,10 @@ |
275 |
+ status = "okay"; |
276 |
+ }; |
277 |
+ |
278 |
+-&nand { |
279 |
++&nand_controller { |
280 |
+ status = "okay"; |
281 |
+ |
282 |
+- nandcs@0 { |
283 |
++ nand@0 { |
284 |
+ compatible = "brcm,nandcs"; |
285 |
+ reg = <0>; |
286 |
+ nand-ecc-strength = <4>; |
287 |
+diff --git a/arch/arm/boot/dts/bcm988312hr.dts b/arch/arm/boot/dts/bcm988312hr.dts |
288 |
+index bce251a685916..b62b91fa942f9 100644 |
289 |
+--- a/arch/arm/boot/dts/bcm988312hr.dts |
290 |
++++ b/arch/arm/boot/dts/bcm988312hr.dts |
291 |
+@@ -78,8 +78,8 @@ |
292 |
+ status = "okay"; |
293 |
+ }; |
294 |
+ |
295 |
+-&nand { |
296 |
+- nandcs@0 { |
297 |
++&nand_controller { |
298 |
++ nand@0 { |
299 |
+ compatible = "brcm,nandcs"; |
300 |
+ reg = <0>; |
301 |
+ nand-on-flash-bbt; |
302 |
+diff --git a/arch/arm/boot/dts/gemini.dtsi b/arch/arm/boot/dts/gemini.dtsi |
303 |
+index b9b07d0895cfa..52c35bf816f0e 100644 |
304 |
+--- a/arch/arm/boot/dts/gemini.dtsi |
305 |
++++ b/arch/arm/boot/dts/gemini.dtsi |
306 |
+@@ -275,6 +275,7 @@ |
307 |
+ clock-names = "PCLK", "PCICLK"; |
308 |
+ pinctrl-names = "default"; |
309 |
+ pinctrl-0 = <&pci_default_pins>; |
310 |
++ device_type = "pci"; |
311 |
+ #address-cells = <3>; |
312 |
+ #size-cells = <2>; |
313 |
+ #interrupt-cells = <1>; |
314 |
+diff --git a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi |
315 |
+index d2c31eae9fef5..cce680a563f7b 100644 |
316 |
+--- a/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi |
317 |
++++ b/arch/arm/boot/dts/imx6qdl-phytec-pfla02.dtsi |
318 |
+@@ -306,8 +306,8 @@ |
319 |
+ fsl,pins = < |
320 |
+ MX6QDL_PAD_EIM_D24__UART3_TX_DATA 0x1b0b1 |
321 |
+ MX6QDL_PAD_EIM_D25__UART3_RX_DATA 0x1b0b1 |
322 |
+- MX6QDL_PAD_EIM_D30__UART3_RTS_B 0x1b0b1 |
323 |
+- MX6QDL_PAD_EIM_D31__UART3_CTS_B 0x1b0b1 |
324 |
++ MX6QDL_PAD_EIM_D31__UART3_RTS_B 0x1b0b1 |
325 |
++ MX6QDL_PAD_EIM_D30__UART3_CTS_B 0x1b0b1 |
326 |
+ >; |
327 |
+ }; |
328 |
+ |
329 |
+@@ -394,6 +394,7 @@ |
330 |
+ &uart3 { |
331 |
+ pinctrl-names = "default"; |
332 |
+ pinctrl-0 = <&pinctrl_uart3>; |
333 |
++ uart-has-rtscts; |
334 |
+ status = "disabled"; |
335 |
+ }; |
336 |
+ |
337 |
+diff --git a/arch/arm/boot/dts/rk3036-kylin.dts b/arch/arm/boot/dts/rk3036-kylin.dts |
338 |
+index fdb1570bc7d31..3371bc921aefd 100644 |
339 |
+--- a/arch/arm/boot/dts/rk3036-kylin.dts |
340 |
++++ b/arch/arm/boot/dts/rk3036-kylin.dts |
341 |
+@@ -424,7 +424,7 @@ |
342 |
+ }; |
343 |
+ }; |
344 |
+ |
345 |
+- sleep { |
346 |
++ suspend { |
347 |
+ global_pwroff: global-pwroff { |
348 |
+ rockchip,pins = <2 7 RK_FUNC_1 &pcfg_pull_none>; |
349 |
+ }; |
350 |
+diff --git a/arch/arm/boot/dts/rk3188.dtsi b/arch/arm/boot/dts/rk3188.dtsi |
351 |
+index 1399bc04ea77f..74eb1dfa2f6cf 100644 |
352 |
+--- a/arch/arm/boot/dts/rk3188.dtsi |
353 |
++++ b/arch/arm/boot/dts/rk3188.dtsi |
354 |
+@@ -110,16 +110,16 @@ |
355 |
+ compatible = "rockchip,rk3188-timer", "rockchip,rk3288-timer"; |
356 |
+ reg = <0x2000e000 0x20>; |
357 |
+ interrupts = <GIC_SPI 46 IRQ_TYPE_LEVEL_HIGH>; |
358 |
+- clocks = <&cru SCLK_TIMER3>, <&cru PCLK_TIMER3>; |
359 |
+- clock-names = "timer", "pclk"; |
360 |
++ clocks = <&cru PCLK_TIMER3>, <&cru SCLK_TIMER3>; |
361 |
++ clock-names = "pclk", "timer"; |
362 |
+ }; |
363 |
+ |
364 |
+ timer6: timer@200380a0 { |
365 |
+ compatible = "rockchip,rk3188-timer", "rockchip,rk3288-timer"; |
366 |
+ reg = <0x200380a0 0x20>; |
367 |
+ interrupts = <GIC_SPI 64 IRQ_TYPE_LEVEL_HIGH>; |
368 |
+- clocks = <&cru SCLK_TIMER6>, <&cru PCLK_TIMER0>; |
369 |
+- clock-names = "timer", "pclk"; |
370 |
++ clocks = <&cru PCLK_TIMER0>, <&cru SCLK_TIMER6>; |
371 |
++ clock-names = "pclk", "timer"; |
372 |
+ }; |
373 |
+ |
374 |
+ i2s0: i2s@1011a000 { |
375 |
+diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi |
376 |
+index 23907d9ce89ad..9adb58930c08a 100644 |
377 |
+--- a/arch/arm/boot/dts/rk3288.dtsi |
378 |
++++ b/arch/arm/boot/dts/rk3288.dtsi |
379 |
+@@ -220,8 +220,8 @@ |
380 |
+ compatible = "rockchip,rk3288-timer"; |
381 |
+ reg = <0x0 0xff810000 0x0 0x20>; |
382 |
+ interrupts = <GIC_SPI 72 IRQ_TYPE_LEVEL_HIGH>; |
383 |
+- clocks = <&xin24m>, <&cru PCLK_TIMER>; |
384 |
+- clock-names = "timer", "pclk"; |
385 |
++ clocks = <&cru PCLK_TIMER>, <&xin24m>; |
386 |
++ clock-names = "pclk", "timer"; |
387 |
+ }; |
388 |
+ |
389 |
+ display-subsystem { |
390 |
+@@ -745,7 +745,7 @@ |
391 |
+ * *_HDMI HDMI |
392 |
+ * *_MIPI_* MIPI |
393 |
+ */ |
394 |
+- pd_vio@RK3288_PD_VIO { |
395 |
++ power-domain@RK3288_PD_VIO { |
396 |
+ reg = <RK3288_PD_VIO>; |
397 |
+ clocks = <&cru ACLK_IEP>, |
398 |
+ <&cru ACLK_ISP>, |
399 |
+@@ -787,7 +787,7 @@ |
400 |
+ * Note: The following 3 are HEVC(H.265) clocks, |
401 |
+ * and on the ACLK_HEVC_NIU (NOC). |
402 |
+ */ |
403 |
+- pd_hevc@RK3288_PD_HEVC { |
404 |
++ power-domain@RK3288_PD_HEVC { |
405 |
+ reg = <RK3288_PD_HEVC>; |
406 |
+ clocks = <&cru ACLK_HEVC>, |
407 |
+ <&cru SCLK_HEVC_CABAC>, |
408 |
+@@ -801,7 +801,7 @@ |
409 |
+ * (video endecoder & decoder) clocks that on the |
410 |
+ * ACLK_VCODEC_NIU and HCLK_VCODEC_NIU (NOC). |
411 |
+ */ |
412 |
+- pd_video@RK3288_PD_VIDEO { |
413 |
++ power-domain@RK3288_PD_VIDEO { |
414 |
+ reg = <RK3288_PD_VIDEO>; |
415 |
+ clocks = <&cru ACLK_VCODEC>, |
416 |
+ <&cru HCLK_VCODEC>; |
417 |
+@@ -812,7 +812,7 @@ |
418 |
+ * Note: ACLK_GPU is the GPU clock, |
419 |
+ * and on the ACLK_GPU_NIU (NOC). |
420 |
+ */ |
421 |
+- pd_gpu@RK3288_PD_GPU { |
422 |
++ power-domain@RK3288_PD_GPU { |
423 |
+ reg = <RK3288_PD_GPU>; |
424 |
+ clocks = <&cru ACLK_GPU>; |
425 |
+ pm_qos = <&qos_gpu_r>, |
426 |
+@@ -1453,7 +1453,7 @@ |
427 |
+ drive-strength = <12>; |
428 |
+ }; |
429 |
+ |
430 |
+- sleep { |
431 |
++ suspend { |
432 |
+ global_pwroff: global-pwroff { |
433 |
+ rockchip,pins = <0 0 RK_FUNC_1 &pcfg_pull_none>; |
434 |
+ }; |
435 |
+diff --git a/arch/arm/boot/dts/stm32f429.dtsi b/arch/arm/boot/dts/stm32f429.dtsi |
436 |
+index 5b36eb114ddc9..d65a03d0da655 100644 |
437 |
+--- a/arch/arm/boot/dts/stm32f429.dtsi |
438 |
++++ b/arch/arm/boot/dts/stm32f429.dtsi |
439 |
+@@ -597,7 +597,7 @@ |
440 |
+ status = "disabled"; |
441 |
+ }; |
442 |
+ |
443 |
+- rcc: rcc@40023810 { |
444 |
++ rcc: rcc@40023800 { |
445 |
+ #reset-cells = <1>; |
446 |
+ #clock-cells = <2>; |
447 |
+ compatible = "st,stm32f42xx-rcc", "st,stm32-rcc"; |
448 |
+diff --git a/arch/arm/mach-imx/suspend-imx53.S b/arch/arm/mach-imx/suspend-imx53.S |
449 |
+index 5ed078ad110aa..f12d24104075b 100644 |
450 |
+--- a/arch/arm/mach-imx/suspend-imx53.S |
451 |
++++ b/arch/arm/mach-imx/suspend-imx53.S |
452 |
+@@ -33,11 +33,11 @@ |
453 |
+ * ^ |
454 |
+ * ^ |
455 |
+ * imx53_suspend code |
456 |
+- * PM_INFO structure(imx53_suspend_info) |
457 |
++ * PM_INFO structure(imx5_cpu_suspend_info) |
458 |
+ * ======================== low address ======================= |
459 |
+ */ |
460 |
+ |
461 |
+-/* Offsets of members of struct imx53_suspend_info */ |
462 |
++/* Offsets of members of struct imx5_cpu_suspend_info */ |
463 |
+ #define SUSPEND_INFO_MX53_M4IF_V_OFFSET 0x0 |
464 |
+ #define SUSPEND_INFO_MX53_IOMUXC_V_OFFSET 0x4 |
465 |
+ #define SUSPEND_INFO_MX53_IO_COUNT_OFFSET 0x8 |
466 |
+diff --git a/arch/arm64/boot/dts/arm/juno-base.dtsi b/arch/arm64/boot/dts/arm/juno-base.dtsi |
467 |
+index 13ee8ffa9bbf4..76902ea7288f5 100644 |
468 |
+--- a/arch/arm64/boot/dts/arm/juno-base.dtsi |
469 |
++++ b/arch/arm64/boot/dts/arm/juno-base.dtsi |
470 |
+@@ -513,13 +513,13 @@ |
471 |
+ clocks { |
472 |
+ compatible = "arm,scpi-clocks"; |
473 |
+ |
474 |
+- scpi_dvfs: scpi-dvfs { |
475 |
++ scpi_dvfs: clocks-0 { |
476 |
+ compatible = "arm,scpi-dvfs-clocks"; |
477 |
+ #clock-cells = <1>; |
478 |
+ clock-indices = <0>, <1>, <2>; |
479 |
+ clock-output-names = "atlclk", "aplclk","gpuclk"; |
480 |
+ }; |
481 |
+- scpi_clk: scpi-clk { |
482 |
++ scpi_clk: clocks-1 { |
483 |
+ compatible = "arm,scpi-variable-clocks"; |
484 |
+ #clock-cells = <1>; |
485 |
+ clock-indices = <3>; |
486 |
+@@ -527,7 +527,7 @@ |
487 |
+ }; |
488 |
+ }; |
489 |
+ |
490 |
+- scpi_devpd: scpi-power-domains { |
491 |
++ scpi_devpd: power-controller { |
492 |
+ compatible = "arm,scpi-power-domains"; |
493 |
+ num-domains = <2>; |
494 |
+ #power-domain-cells = <1>; |
495 |
+diff --git a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi |
496 |
+index 4fb9a0966a84f..4b459167a7462 100644 |
497 |
+--- a/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi |
498 |
++++ b/arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi |
499 |
+@@ -515,7 +515,6 @@ |
500 |
+ clocks = <&clockgen 4 3>; |
501 |
+ clock-names = "dspi"; |
502 |
+ spi-num-chipselects = <5>; |
503 |
+- bus-num = <0>; |
504 |
+ }; |
505 |
+ |
506 |
+ esdhc: esdhc@2140000 { |
507 |
+diff --git a/arch/arm64/boot/dts/rockchip/rk3328.dtsi b/arch/arm64/boot/dts/rockchip/rk3328.dtsi |
508 |
+index 6c3684885fac0..a3fb072f20baf 100644 |
509 |
+--- a/arch/arm64/boot/dts/rockchip/rk3328.dtsi |
510 |
++++ b/arch/arm64/boot/dts/rockchip/rk3328.dtsi |
511 |
+@@ -289,13 +289,13 @@ |
512 |
+ #address-cells = <1>; |
513 |
+ #size-cells = <0>; |
514 |
+ |
515 |
+- pd_hevc@RK3328_PD_HEVC { |
516 |
++ power-domain@RK3328_PD_HEVC { |
517 |
+ reg = <RK3328_PD_HEVC>; |
518 |
+ }; |
519 |
+- pd_video@RK3328_PD_VIDEO { |
520 |
++ power-domain@RK3328_PD_VIDEO { |
521 |
+ reg = <RK3328_PD_VIDEO>; |
522 |
+ }; |
523 |
+- pd_vpu@RK3328_PD_VPU { |
524 |
++ power-domain@RK3328_PD_VPU { |
525 |
+ reg = <RK3328_PD_VPU>; |
526 |
+ }; |
527 |
+ }; |
528 |
+diff --git a/arch/arm64/boot/dts/rockchip/rk3399.dtsi b/arch/arm64/boot/dts/rockchip/rk3399.dtsi |
529 |
+index 721f4b6b262f1..029d4578bca3c 100644 |
530 |
+--- a/arch/arm64/boot/dts/rockchip/rk3399.dtsi |
531 |
++++ b/arch/arm64/boot/dts/rockchip/rk3399.dtsi |
532 |
+@@ -2074,7 +2074,7 @@ |
533 |
+ }; |
534 |
+ }; |
535 |
+ |
536 |
+- sleep { |
537 |
++ suspend { |
538 |
+ ap_pwroff: ap-pwroff { |
539 |
+ rockchip,pins = <1 5 RK_FUNC_1 &pcfg_pull_none>; |
540 |
+ }; |
541 |
+diff --git a/arch/mips/include/asm/pgalloc.h b/arch/mips/include/asm/pgalloc.h |
542 |
+index f800872f867b2..39b9f311c4ef4 100644 |
543 |
+--- a/arch/mips/include/asm/pgalloc.h |
544 |
++++ b/arch/mips/include/asm/pgalloc.h |
545 |
+@@ -93,15 +93,11 @@ do { \ |
546 |
+ |
547 |
+ static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long address) |
548 |
+ { |
549 |
+- pmd_t *pmd = NULL; |
550 |
+- struct page *pg; |
551 |
++ pmd_t *pmd; |
552 |
+ |
553 |
+- pg = alloc_pages(GFP_KERNEL | __GFP_ACCOUNT, PMD_ORDER); |
554 |
+- if (pg) { |
555 |
+- pgtable_pmd_page_ctor(pg); |
556 |
+- pmd = (pmd_t *)page_address(pg); |
557 |
++ pmd = (pmd_t *) __get_free_pages(GFP_KERNEL, PMD_ORDER); |
558 |
++ if (pmd) |
559 |
+ pmd_init((unsigned long)pmd, (unsigned long)invalid_pte_table); |
560 |
+- } |
561 |
+ return pmd; |
562 |
+ } |
563 |
+ |
564 |
+diff --git a/arch/powerpc/kvm/book3s_rtas.c b/arch/powerpc/kvm/book3s_rtas.c |
565 |
+index 8f2355138f80b..a56c56aa829c1 100644 |
566 |
+--- a/arch/powerpc/kvm/book3s_rtas.c |
567 |
++++ b/arch/powerpc/kvm/book3s_rtas.c |
568 |
+@@ -243,6 +243,17 @@ int kvmppc_rtas_hcall(struct kvm_vcpu *vcpu) |
569 |
+ * value so we can restore it on the way out. |
570 |
+ */ |
571 |
+ orig_rets = args.rets; |
572 |
++ if (be32_to_cpu(args.nargs) >= ARRAY_SIZE(args.args)) { |
573 |
++ /* |
574 |
++ * Don't overflow our args array: ensure there is room for |
575 |
++ * at least rets[0] (even if the call specifies 0 nret). |
576 |
++ * |
577 |
++ * Each handler must then check for the correct nargs and nret |
578 |
++ * values, but they may always return failure in rets[0]. |
579 |
++ */ |
580 |
++ rc = -EINVAL; |
581 |
++ goto fail; |
582 |
++ } |
583 |
+ args.rets = &args.args[be32_to_cpu(args.nargs)]; |
584 |
+ |
585 |
+ mutex_lock(&vcpu->kvm->arch.rtas_token_lock); |
586 |
+@@ -270,9 +281,17 @@ int kvmppc_rtas_hcall(struct kvm_vcpu *vcpu) |
587 |
+ fail: |
588 |
+ /* |
589 |
+ * We only get here if the guest has called RTAS with a bogus |
590 |
+- * args pointer. That means we can't get to the args, and so we |
591 |
+- * can't fail the RTAS call. So fail right out to userspace, |
592 |
+- * which should kill the guest. |
593 |
++ * args pointer or nargs/nret values that would overflow the |
594 |
++ * array. That means we can't get to the args, and so we can't |
595 |
++ * fail the RTAS call. So fail right out to userspace, which |
596 |
++ * should kill the guest. |
597 |
++ * |
598 |
++ * SLOF should actually pass the hcall return value from the |
599 |
++ * rtas handler call in r3, so enter_rtas could be modified to |
600 |
++ * return a failure indication in r3 and we could return such |
601 |
++ * errors to the guest rather than failing to host userspace. |
602 |
++ * However old guests that don't test for failure could then |
603 |
++ * continue silently after errors, so for now we won't do this. |
604 |
+ */ |
605 |
+ return rc; |
606 |
+ } |
607 |
+diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h |
608 |
+index cfccc0edd00d7..0c06387f1263f 100644 |
609 |
+--- a/arch/s390/include/asm/ftrace.h |
610 |
++++ b/arch/s390/include/asm/ftrace.h |
611 |
+@@ -20,6 +20,7 @@ void ftrace_caller(void); |
612 |
+ |
613 |
+ extern char ftrace_graph_caller_end; |
614 |
+ extern unsigned long ftrace_plt; |
615 |
++extern void *ftrace_func; |
616 |
+ |
617 |
+ struct dyn_arch_ftrace { }; |
618 |
+ |
619 |
+diff --git a/arch/s390/kernel/ftrace.c b/arch/s390/kernel/ftrace.c |
620 |
+index dc76d813e4207..ef196d79d229b 100644 |
621 |
+--- a/arch/s390/kernel/ftrace.c |
622 |
++++ b/arch/s390/kernel/ftrace.c |
623 |
+@@ -57,6 +57,7 @@ |
624 |
+ * > brasl %r0,ftrace_caller # offset 0 |
625 |
+ */ |
626 |
+ |
627 |
++void *ftrace_func __read_mostly = ftrace_stub; |
628 |
+ unsigned long ftrace_plt; |
629 |
+ |
630 |
+ static inline void ftrace_generate_orig_insn(struct ftrace_insn *insn) |
631 |
+@@ -166,6 +167,7 @@ int ftrace_make_call(struct dyn_ftrace *rec, unsigned long addr) |
632 |
+ |
633 |
+ int ftrace_update_ftrace_func(ftrace_func_t func) |
634 |
+ { |
635 |
++ ftrace_func = func; |
636 |
+ return 0; |
637 |
+ } |
638 |
+ |
639 |
+diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S |
640 |
+index 151f001a90ff7..216c365807a50 100644 |
641 |
+--- a/arch/s390/kernel/mcount.S |
642 |
++++ b/arch/s390/kernel/mcount.S |
643 |
+@@ -60,13 +60,13 @@ ENTRY(ftrace_caller) |
644 |
+ #ifdef CONFIG_HAVE_MARCH_Z196_FEATURES |
645 |
+ aghik %r2,%r0,-MCOUNT_INSN_SIZE |
646 |
+ lgrl %r4,function_trace_op |
647 |
+- lgrl %r1,ftrace_trace_function |
648 |
++ lgrl %r1,ftrace_func |
649 |
+ #else |
650 |
+ lgr %r2,%r0 |
651 |
+ aghi %r2,-MCOUNT_INSN_SIZE |
652 |
+ larl %r4,function_trace_op |
653 |
+ lg %r4,0(%r4) |
654 |
+- larl %r1,ftrace_trace_function |
655 |
++ larl %r1,ftrace_func |
656 |
+ lg %r1,0(%r1) |
657 |
+ #endif |
658 |
+ lgr %r3,%r14 |
659 |
+diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c |
660 |
+index b8bd841048434..bb3710e7ad9c2 100644 |
661 |
+--- a/arch/s390/net/bpf_jit_comp.c |
662 |
++++ b/arch/s390/net/bpf_jit_comp.c |
663 |
+@@ -117,7 +117,7 @@ static inline void reg_set_seen(struct bpf_jit *jit, u32 b1) |
664 |
+ { |
665 |
+ u32 r1 = reg2hex[b1]; |
666 |
+ |
667 |
+- if (!jit->seen_reg[r1] && r1 >= 6 && r1 <= 15) |
668 |
++ if (r1 >= 6 && r1 <= 15 && !jit->seen_reg[r1]) |
669 |
+ jit->seen_reg[r1] = 1; |
670 |
+ } |
671 |
+ |
672 |
+diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c |
673 |
+index bf65e634590b8..bcc886394bac6 100644 |
674 |
+--- a/drivers/dma-buf/sync_file.c |
675 |
++++ b/drivers/dma-buf/sync_file.c |
676 |
+@@ -220,8 +220,8 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a, |
677 |
+ struct sync_file *b) |
678 |
+ { |
679 |
+ struct sync_file *sync_file; |
680 |
+- struct dma_fence **fences, **nfences, **a_fences, **b_fences; |
681 |
+- int i, i_a, i_b, num_fences, a_num_fences, b_num_fences; |
682 |
++ struct dma_fence **fences = NULL, **nfences, **a_fences, **b_fences; |
683 |
++ int i = 0, i_a, i_b, num_fences, a_num_fences, b_num_fences; |
684 |
+ |
685 |
+ sync_file = sync_file_alloc(); |
686 |
+ if (!sync_file) |
687 |
+@@ -245,7 +245,7 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a, |
688 |
+ * If a sync_file can only be created with sync_file_merge |
689 |
+ * and sync_file_create, this is a reasonable assumption. |
690 |
+ */ |
691 |
+- for (i = i_a = i_b = 0; i_a < a_num_fences && i_b < b_num_fences; ) { |
692 |
++ for (i_a = i_b = 0; i_a < a_num_fences && i_b < b_num_fences; ) { |
693 |
+ struct dma_fence *pt_a = a_fences[i_a]; |
694 |
+ struct dma_fence *pt_b = b_fences[i_b]; |
695 |
+ |
696 |
+@@ -286,15 +286,16 @@ static struct sync_file *sync_file_merge(const char *name, struct sync_file *a, |
697 |
+ fences = nfences; |
698 |
+ } |
699 |
+ |
700 |
+- if (sync_file_set_fence(sync_file, fences, i) < 0) { |
701 |
+- kfree(fences); |
702 |
++ if (sync_file_set_fence(sync_file, fences, i) < 0) |
703 |
+ goto err; |
704 |
+- } |
705 |
+ |
706 |
+ strlcpy(sync_file->user_name, name, sizeof(sync_file->user_name)); |
707 |
+ return sync_file; |
708 |
+ |
709 |
+ err: |
710 |
++ while (i) |
711 |
++ dma_fence_put(fences[--i]); |
712 |
++ kfree(fences); |
713 |
+ fput(sync_file->file); |
714 |
+ return NULL; |
715 |
+ |
716 |
+diff --git a/drivers/gpu/drm/drm_ioctl.c b/drivers/gpu/drm/drm_ioctl.c |
717 |
+index 60fc06234d736..ce26e8fea9c20 100644 |
718 |
+--- a/drivers/gpu/drm/drm_ioctl.c |
719 |
++++ b/drivers/gpu/drm/drm_ioctl.c |
720 |
+@@ -776,6 +776,9 @@ long drm_ioctl(struct file *filp, |
721 |
+ if (drm_dev_is_unplugged(dev)) |
722 |
+ return -ENODEV; |
723 |
+ |
724 |
++ if (DRM_IOCTL_TYPE(cmd) != DRM_IOCTL_BASE) |
725 |
++ return -ENOTTY; |
726 |
++ |
727 |
+ is_driver_ioctl = nr >= DRM_COMMAND_BASE && nr < DRM_COMMAND_END; |
728 |
+ |
729 |
+ if (is_driver_ioctl) { |
730 |
+diff --git a/drivers/iio/accel/bma180.c b/drivers/iio/accel/bma180.c |
731 |
+index dabe4717961f9..d266e5614473b 100644 |
732 |
+--- a/drivers/iio/accel/bma180.c |
733 |
++++ b/drivers/iio/accel/bma180.c |
734 |
+@@ -50,7 +50,7 @@ struct bma180_part_info { |
735 |
+ |
736 |
+ u8 int_reset_reg, int_reset_mask; |
737 |
+ u8 sleep_reg, sleep_mask; |
738 |
+- u8 bw_reg, bw_mask; |
739 |
++ u8 bw_reg, bw_mask, bw_offset; |
740 |
+ u8 scale_reg, scale_mask; |
741 |
+ u8 power_reg, power_mask, lowpower_val; |
742 |
+ u8 int_enable_reg, int_enable_mask; |
743 |
+@@ -106,6 +106,7 @@ struct bma180_part_info { |
744 |
+ |
745 |
+ #define BMA250_RANGE_MASK GENMASK(3, 0) /* Range of accel values */ |
746 |
+ #define BMA250_BW_MASK GENMASK(4, 0) /* Accel bandwidth */ |
747 |
++#define BMA250_BW_OFFSET 8 |
748 |
+ #define BMA250_SUSPEND_MASK BIT(7) /* chip will sleep */ |
749 |
+ #define BMA250_LOWPOWER_MASK BIT(6) |
750 |
+ #define BMA250_DATA_INTEN_MASK BIT(4) |
751 |
+@@ -243,7 +244,8 @@ static int bma180_set_bw(struct bma180_data *data, int val) |
752 |
+ for (i = 0; i < data->part_info->num_bw; ++i) { |
753 |
+ if (data->part_info->bw_table[i] == val) { |
754 |
+ ret = bma180_set_bits(data, data->part_info->bw_reg, |
755 |
+- data->part_info->bw_mask, i); |
756 |
++ data->part_info->bw_mask, |
757 |
++ i + data->part_info->bw_offset); |
758 |
+ if (ret) { |
759 |
+ dev_err(&data->client->dev, |
760 |
+ "failed to set bandwidth\n"); |
761 |
+@@ -626,32 +628,53 @@ static const struct iio_chan_spec bma250_channels[] = { |
762 |
+ |
763 |
+ static const struct bma180_part_info bma180_part_info[] = { |
764 |
+ [BMA180] = { |
765 |
+- bma180_channels, ARRAY_SIZE(bma180_channels), |
766 |
+- bma180_scale_table, ARRAY_SIZE(bma180_scale_table), |
767 |
+- bma180_bw_table, ARRAY_SIZE(bma180_bw_table), |
768 |
+- BMA180_CTRL_REG0, BMA180_RESET_INT, |
769 |
+- BMA180_CTRL_REG0, BMA180_SLEEP, |
770 |
+- BMA180_BW_TCS, BMA180_BW, |
771 |
+- BMA180_OFFSET_LSB1, BMA180_RANGE, |
772 |
+- BMA180_TCO_Z, BMA180_MODE_CONFIG, BMA180_LOW_POWER, |
773 |
+- BMA180_CTRL_REG3, BMA180_NEW_DATA_INT, |
774 |
+- BMA180_RESET, |
775 |
+- bma180_chip_config, |
776 |
+- bma180_chip_disable, |
777 |
++ .channels = bma180_channels, |
778 |
++ .num_channels = ARRAY_SIZE(bma180_channels), |
779 |
++ .scale_table = bma180_scale_table, |
780 |
++ .num_scales = ARRAY_SIZE(bma180_scale_table), |
781 |
++ .bw_table = bma180_bw_table, |
782 |
++ .num_bw = ARRAY_SIZE(bma180_bw_table), |
783 |
++ .int_reset_reg = BMA180_CTRL_REG0, |
784 |
++ .int_reset_mask = BMA180_RESET_INT, |
785 |
++ .sleep_reg = BMA180_CTRL_REG0, |
786 |
++ .sleep_mask = BMA180_SLEEP, |
787 |
++ .bw_reg = BMA180_BW_TCS, |
788 |
++ .bw_mask = BMA180_BW, |
789 |
++ .scale_reg = BMA180_OFFSET_LSB1, |
790 |
++ .scale_mask = BMA180_RANGE, |
791 |
++ .power_reg = BMA180_TCO_Z, |
792 |
++ .power_mask = BMA180_MODE_CONFIG, |
793 |
++ .lowpower_val = BMA180_LOW_POWER, |
794 |
++ .int_enable_reg = BMA180_CTRL_REG3, |
795 |
++ .int_enable_mask = BMA180_NEW_DATA_INT, |
796 |
++ .softreset_reg = BMA180_RESET, |
797 |
++ .chip_config = bma180_chip_config, |
798 |
++ .chip_disable = bma180_chip_disable, |
799 |
+ }, |
800 |
+ [BMA250] = { |
801 |
+- bma250_channels, ARRAY_SIZE(bma250_channels), |
802 |
+- bma250_scale_table, ARRAY_SIZE(bma250_scale_table), |
803 |
+- bma250_bw_table, ARRAY_SIZE(bma250_bw_table), |
804 |
+- BMA250_INT_RESET_REG, BMA250_INT_RESET_MASK, |
805 |
+- BMA250_POWER_REG, BMA250_SUSPEND_MASK, |
806 |
+- BMA250_BW_REG, BMA250_BW_MASK, |
807 |
+- BMA250_RANGE_REG, BMA250_RANGE_MASK, |
808 |
+- BMA250_POWER_REG, BMA250_LOWPOWER_MASK, 1, |
809 |
+- BMA250_INT_ENABLE_REG, BMA250_DATA_INTEN_MASK, |
810 |
+- BMA250_RESET_REG, |
811 |
+- bma250_chip_config, |
812 |
+- bma250_chip_disable, |
813 |
++ .channels = bma250_channels, |
814 |
++ .num_channels = ARRAY_SIZE(bma250_channels), |
815 |
++ .scale_table = bma250_scale_table, |
816 |
++ .num_scales = ARRAY_SIZE(bma250_scale_table), |
817 |
++ .bw_table = bma250_bw_table, |
818 |
++ .num_bw = ARRAY_SIZE(bma250_bw_table), |
819 |
++ .int_reset_reg = BMA250_INT_RESET_REG, |
820 |
++ .int_reset_mask = BMA250_INT_RESET_MASK, |
821 |
++ .sleep_reg = BMA250_POWER_REG, |
822 |
++ .sleep_mask = BMA250_SUSPEND_MASK, |
823 |
++ .bw_reg = BMA250_BW_REG, |
824 |
++ .bw_mask = BMA250_BW_MASK, |
825 |
++ .bw_offset = BMA250_BW_OFFSET, |
826 |
++ .scale_reg = BMA250_RANGE_REG, |
827 |
++ .scale_mask = BMA250_RANGE_MASK, |
828 |
++ .power_reg = BMA250_POWER_REG, |
829 |
++ .power_mask = BMA250_LOWPOWER_MASK, |
830 |
++ .lowpower_val = 1, |
831 |
++ .int_enable_reg = BMA250_INT_ENABLE_REG, |
832 |
++ .int_enable_mask = BMA250_DATA_INTEN_MASK, |
833 |
++ .softreset_reg = BMA250_RESET_REG, |
834 |
++ .chip_config = bma250_chip_config, |
835 |
++ .chip_disable = bma250_chip_disable, |
836 |
+ }, |
837 |
+ }; |
838 |
+ |
839 |
+diff --git a/drivers/media/pci/ngene/ngene-core.c b/drivers/media/pci/ngene/ngene-core.c |
840 |
+index 8c92cb7f7e72f..96d0cbffa77ca 100644 |
841 |
+--- a/drivers/media/pci/ngene/ngene-core.c |
842 |
++++ b/drivers/media/pci/ngene/ngene-core.c |
843 |
+@@ -398,7 +398,7 @@ static int ngene_command_config_free_buf(struct ngene *dev, u8 *config) |
844 |
+ |
845 |
+ com.cmd.hdr.Opcode = CMD_CONFIGURE_FREE_BUFFER; |
846 |
+ com.cmd.hdr.Length = 6; |
847 |
+- memcpy(&com.cmd.ConfigureBuffers.config, config, 6); |
848 |
++ memcpy(&com.cmd.ConfigureFreeBuffers.config, config, 6); |
849 |
+ com.in_len = 6; |
850 |
+ com.out_len = 0; |
851 |
+ |
852 |
+diff --git a/drivers/media/pci/ngene/ngene.h b/drivers/media/pci/ngene/ngene.h |
853 |
+index 7c7cd217333d8..af063be3dc4eb 100644 |
854 |
+--- a/drivers/media/pci/ngene/ngene.h |
855 |
++++ b/drivers/media/pci/ngene/ngene.h |
856 |
+@@ -403,12 +403,14 @@ enum _BUFFER_CONFIGS { |
857 |
+ |
858 |
+ struct FW_CONFIGURE_FREE_BUFFERS { |
859 |
+ struct FW_HEADER hdr; |
860 |
+- u8 UVI1_BufferLength; |
861 |
+- u8 UVI2_BufferLength; |
862 |
+- u8 TVO_BufferLength; |
863 |
+- u8 AUD1_BufferLength; |
864 |
+- u8 AUD2_BufferLength; |
865 |
+- u8 TVA_BufferLength; |
866 |
++ struct { |
867 |
++ u8 UVI1_BufferLength; |
868 |
++ u8 UVI2_BufferLength; |
869 |
++ u8 TVO_BufferLength; |
870 |
++ u8 AUD1_BufferLength; |
871 |
++ u8 AUD2_BufferLength; |
872 |
++ u8 TVA_BufferLength; |
873 |
++ } __packed config; |
874 |
+ } __attribute__ ((__packed__)); |
875 |
+ |
876 |
+ struct FW_CONFIGURE_UART { |
877 |
+diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
878 |
+index ce89c43ced8a8..23ff3ec666cdd 100644 |
879 |
+--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
880 |
++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
881 |
+@@ -1158,7 +1158,8 @@ static void bcmgenet_power_up(struct bcmgenet_priv *priv, |
882 |
+ |
883 |
+ switch (mode) { |
884 |
+ case GENET_POWER_PASSIVE: |
885 |
+- reg &= ~(EXT_PWR_DOWN_DLL | EXT_PWR_DOWN_BIAS); |
886 |
++ reg &= ~(EXT_PWR_DOWN_DLL | EXT_PWR_DOWN_BIAS | |
887 |
++ EXT_ENERGY_DET_MASK); |
888 |
+ if (GENET_IS_V5(priv)) { |
889 |
+ reg &= ~(EXT_PWR_DOWN_PHY_EN | |
890 |
+ EXT_PWR_DOWN_PHY_RD | |
891 |
+@@ -2789,15 +2790,21 @@ static void bcmgenet_set_hw_addr(struct bcmgenet_priv *priv, |
892 |
+ /* Returns a reusable dma control register value */ |
893 |
+ static u32 bcmgenet_dma_disable(struct bcmgenet_priv *priv) |
894 |
+ { |
895 |
++ unsigned int i; |
896 |
+ u32 reg; |
897 |
+ u32 dma_ctrl; |
898 |
+ |
899 |
+ /* disable DMA */ |
900 |
+ dma_ctrl = 1 << (DESC_INDEX + DMA_RING_BUF_EN_SHIFT) | DMA_EN; |
901 |
++ for (i = 0; i < priv->hw_params->tx_queues; i++) |
902 |
++ dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT)); |
903 |
+ reg = bcmgenet_tdma_readl(priv, DMA_CTRL); |
904 |
+ reg &= ~dma_ctrl; |
905 |
+ bcmgenet_tdma_writel(priv, reg, DMA_CTRL); |
906 |
+ |
907 |
++ dma_ctrl = 1 << (DESC_INDEX + DMA_RING_BUF_EN_SHIFT) | DMA_EN; |
908 |
++ for (i = 0; i < priv->hw_params->rx_queues; i++) |
909 |
++ dma_ctrl |= (1 << (i + DMA_RING_BUF_EN_SHIFT)); |
910 |
+ reg = bcmgenet_rdma_readl(priv, DMA_CTRL); |
911 |
+ reg &= ~dma_ctrl; |
912 |
+ bcmgenet_rdma_writel(priv, reg, DMA_CTRL); |
913 |
+@@ -2907,12 +2914,6 @@ static int bcmgenet_open(struct net_device *dev) |
914 |
+ |
915 |
+ bcmgenet_set_hw_addr(priv, dev->dev_addr); |
916 |
+ |
917 |
+- if (priv->internal_phy) { |
918 |
+- reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT); |
919 |
+- reg |= EXT_ENERGY_DET_MASK; |
920 |
+- bcmgenet_ext_writel(priv, reg, EXT_EXT_PWR_MGMT); |
921 |
+- } |
922 |
+- |
923 |
+ /* Disable RX/TX DMA and flush TX queues */ |
924 |
+ dma_ctrl = bcmgenet_dma_disable(priv); |
925 |
+ |
926 |
+@@ -3670,7 +3671,6 @@ static int bcmgenet_resume(struct device *d) |
927 |
+ struct bcmgenet_priv *priv = netdev_priv(dev); |
928 |
+ unsigned long dma_ctrl; |
929 |
+ int ret; |
930 |
+- u32 reg; |
931 |
+ |
932 |
+ if (!netif_running(dev)) |
933 |
+ return 0; |
934 |
+@@ -3706,12 +3706,6 @@ static int bcmgenet_resume(struct device *d) |
935 |
+ |
936 |
+ bcmgenet_set_hw_addr(priv, dev->dev_addr); |
937 |
+ |
938 |
+- if (priv->internal_phy) { |
939 |
+- reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT); |
940 |
+- reg |= EXT_ENERGY_DET_MASK; |
941 |
+- bcmgenet_ext_writel(priv, reg, EXT_EXT_PWR_MGMT); |
942 |
+- } |
943 |
+- |
944 |
+ if (priv->wolopts) |
945 |
+ bcmgenet_power_up(priv, GENET_POWER_WOL_MAGIC); |
946 |
+ |
947 |
+diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c |
948 |
+index 2fbd027f0148f..26c57f3edb881 100644 |
949 |
+--- a/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c |
950 |
++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet_wol.c |
951 |
+@@ -166,12 +166,6 @@ int bcmgenet_wol_power_down_cfg(struct bcmgenet_priv *priv, |
952 |
+ reg |= CMD_RX_EN; |
953 |
+ bcmgenet_umac_writel(priv, reg, UMAC_CMD); |
954 |
+ |
955 |
+- if (priv->hw_params->flags & GENET_HAS_EXT) { |
956 |
+- reg = bcmgenet_ext_readl(priv, EXT_EXT_PWR_MGMT); |
957 |
+- reg &= ~EXT_ENERGY_DET_MASK; |
958 |
+- bcmgenet_ext_writel(priv, reg, EXT_EXT_PWR_MGMT); |
959 |
+- } |
960 |
+- |
961 |
+ return 0; |
962 |
+ } |
963 |
+ |
964 |
+diff --git a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c |
965 |
+index 30f0e54f658e9..4248ba307b66a 100644 |
966 |
+--- a/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c |
967 |
++++ b/drivers/net/ethernet/cavium/liquidio/cn23xx_pf_device.c |
968 |
+@@ -420,7 +420,7 @@ static int cn23xx_pf_setup_global_input_regs(struct octeon_device *oct) |
969 |
+ * bits 32:47 indicate the PVF num. |
970 |
+ */ |
971 |
+ for (q_no = 0; q_no < ern; q_no++) { |
972 |
+- reg_val = oct->pcie_port << CN23XX_PKT_INPUT_CTL_MAC_NUM_POS; |
973 |
++ reg_val = (u64)oct->pcie_port << CN23XX_PKT_INPUT_CTL_MAC_NUM_POS; |
974 |
+ |
975 |
+ /* for VF assigned queues. */ |
976 |
+ if (q_no < oct->sriov_info.pf_srn) { |
977 |
+diff --git a/drivers/net/ethernet/intel/e1000e/netdev.c b/drivers/net/ethernet/intel/e1000e/netdev.c |
978 |
+index f50d0da8fefeb..116914de603e1 100644 |
979 |
+--- a/drivers/net/ethernet/intel/e1000e/netdev.c |
980 |
++++ b/drivers/net/ethernet/intel/e1000e/netdev.c |
981 |
+@@ -7392,6 +7392,7 @@ err_flashmap: |
982 |
+ err_ioremap: |
983 |
+ free_netdev(netdev); |
984 |
+ err_alloc_etherdev: |
985 |
++ pci_disable_pcie_error_reporting(pdev); |
986 |
+ pci_release_mem_regions(pdev); |
987 |
+ err_pci_reg: |
988 |
+ err_dma: |
989 |
+diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c |
990 |
+index 63784576ae8b3..6b71fc19ab385 100644 |
991 |
+--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c |
992 |
++++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c |
993 |
+@@ -2095,6 +2095,7 @@ err_sw_init: |
994 |
+ err_ioremap: |
995 |
+ free_netdev(netdev); |
996 |
+ err_alloc_netdev: |
997 |
++ pci_disable_pcie_error_reporting(pdev); |
998 |
+ pci_release_mem_regions(pdev); |
999 |
+ err_pci_reg: |
1000 |
+ err_dma: |
1001 |
+diff --git a/drivers/net/ethernet/intel/i40evf/i40evf_main.c b/drivers/net/ethernet/intel/i40evf/i40evf_main.c |
1002 |
+index 1b5d204c57c14..ad2dd5b747b23 100644 |
1003 |
+--- a/drivers/net/ethernet/intel/i40evf/i40evf_main.c |
1004 |
++++ b/drivers/net/ethernet/intel/i40evf/i40evf_main.c |
1005 |
+@@ -2924,6 +2924,7 @@ static int i40evf_probe(struct pci_dev *pdev, const struct pci_device_id *ent) |
1006 |
+ err_ioremap: |
1007 |
+ free_netdev(netdev); |
1008 |
+ err_alloc_etherdev: |
1009 |
++ pci_disable_pcie_error_reporting(pdev); |
1010 |
+ pci_release_regions(pdev); |
1011 |
+ err_pci_reg: |
1012 |
+ err_dma: |
1013 |
+diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c |
1014 |
+index 50fa0401c7014..6bd30d51dafc1 100644 |
1015 |
+--- a/drivers/net/ethernet/intel/igb/igb_main.c |
1016 |
++++ b/drivers/net/ethernet/intel/igb/igb_main.c |
1017 |
+@@ -949,6 +949,7 @@ static void igb_configure_msix(struct igb_adapter *adapter) |
1018 |
+ **/ |
1019 |
+ static int igb_request_msix(struct igb_adapter *adapter) |
1020 |
+ { |
1021 |
++ unsigned int num_q_vectors = adapter->num_q_vectors; |
1022 |
+ struct net_device *netdev = adapter->netdev; |
1023 |
+ int i, err = 0, vector = 0, free_vector = 0; |
1024 |
+ |
1025 |
+@@ -957,7 +958,13 @@ static int igb_request_msix(struct igb_adapter *adapter) |
1026 |
+ if (err) |
1027 |
+ goto err_out; |
1028 |
+ |
1029 |
+- for (i = 0; i < adapter->num_q_vectors; i++) { |
1030 |
++ if (num_q_vectors > MAX_Q_VECTORS) { |
1031 |
++ num_q_vectors = MAX_Q_VECTORS; |
1032 |
++ dev_warn(&adapter->pdev->dev, |
1033 |
++ "The number of queue vectors (%d) is higher than max allowed (%d)\n", |
1034 |
++ adapter->num_q_vectors, MAX_Q_VECTORS); |
1035 |
++ } |
1036 |
++ for (i = 0; i < num_q_vectors; i++) { |
1037 |
+ struct igb_q_vector *q_vector = adapter->q_vector[i]; |
1038 |
+ |
1039 |
+ vector++; |
1040 |
+@@ -2784,6 +2791,7 @@ err_sw_init: |
1041 |
+ err_ioremap: |
1042 |
+ free_netdev(netdev); |
1043 |
+ err_alloc_etherdev: |
1044 |
++ pci_disable_pcie_error_reporting(pdev); |
1045 |
+ pci_release_mem_regions(pdev); |
1046 |
+ err_pci_reg: |
1047 |
+ err_dma: |
1048 |
+@@ -3962,6 +3970,8 @@ static void igb_clean_tx_ring(struct igb_ring *tx_ring) |
1049 |
+ DMA_TO_DEVICE); |
1050 |
+ } |
1051 |
+ |
1052 |
++ tx_buffer->next_to_watch = NULL; |
1053 |
++ |
1054 |
+ /* move us one more past the eop_desc for start of next pkt */ |
1055 |
+ tx_buffer++; |
1056 |
+ i++; |
1057 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1058 |
+index e9205c8935310..ac9835e616025 100644 |
1059 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1060 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1061 |
+@@ -1872,7 +1872,8 @@ static void ixgbe_dma_sync_frag(struct ixgbe_ring *rx_ring, |
1062 |
+ struct sk_buff *skb) |
1063 |
+ { |
1064 |
+ if (ring_uses_build_skb(rx_ring)) { |
1065 |
+- unsigned long offset = (unsigned long)(skb->data) & ~PAGE_MASK; |
1066 |
++ unsigned long mask = (unsigned long)ixgbe_rx_pg_size(rx_ring) - 1; |
1067 |
++ unsigned long offset = (unsigned long)(skb->data) & mask; |
1068 |
+ |
1069 |
+ dma_sync_single_range_for_cpu(rx_ring->dev, |
1070 |
+ IXGBE_CB(skb)->dma, |
1071 |
+@@ -10572,6 +10573,7 @@ err_ioremap: |
1072 |
+ disable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state); |
1073 |
+ free_netdev(netdev); |
1074 |
+ err_alloc_etherdev: |
1075 |
++ pci_disable_pcie_error_reporting(pdev); |
1076 |
+ pci_release_mem_regions(pdev); |
1077 |
+ err_pci_reg: |
1078 |
+ err_dma: |
1079 |
+diff --git a/drivers/net/ethernet/moxa/moxart_ether.c b/drivers/net/ethernet/moxa/moxart_ether.c |
1080 |
+index beb730ff5d421..d126efd21e432 100644 |
1081 |
+--- a/drivers/net/ethernet/moxa/moxart_ether.c |
1082 |
++++ b/drivers/net/ethernet/moxa/moxart_ether.c |
1083 |
+@@ -538,10 +538,8 @@ static int moxart_mac_probe(struct platform_device *pdev) |
1084 |
+ SET_NETDEV_DEV(ndev, &pdev->dev); |
1085 |
+ |
1086 |
+ ret = register_netdev(ndev); |
1087 |
+- if (ret) { |
1088 |
+- free_netdev(ndev); |
1089 |
++ if (ret) |
1090 |
+ goto init_fail; |
1091 |
+- } |
1092 |
+ |
1093 |
+ netdev_dbg(ndev, "%s: IRQ=%d address=%pM\n", |
1094 |
+ __func__, ndev->irq, ndev->dev_addr); |
1095 |
+diff --git a/drivers/net/ethernet/qualcomm/emac/emac.c b/drivers/net/ethernet/qualcomm/emac/emac.c |
1096 |
+index 5ab83751a471f..cae570f1d7e12 100644 |
1097 |
+--- a/drivers/net/ethernet/qualcomm/emac/emac.c |
1098 |
++++ b/drivers/net/ethernet/qualcomm/emac/emac.c |
1099 |
+@@ -765,12 +765,13 @@ static int emac_remove(struct platform_device *pdev) |
1100 |
+ |
1101 |
+ put_device(&adpt->phydev->mdio.dev); |
1102 |
+ mdiobus_unregister(adpt->mii_bus); |
1103 |
+- free_netdev(netdev); |
1104 |
+ |
1105 |
+ if (adpt->phy.digital) |
1106 |
+ iounmap(adpt->phy.digital); |
1107 |
+ iounmap(adpt->phy.base); |
1108 |
+ |
1109 |
++ free_netdev(netdev); |
1110 |
++ |
1111 |
+ return 0; |
1112 |
+ } |
1113 |
+ |
1114 |
+diff --git a/drivers/net/ethernet/ti/tlan.c b/drivers/net/ethernet/ti/tlan.c |
1115 |
+index 5ffc55f8fa757..1ce2947eaf2bb 100644 |
1116 |
+--- a/drivers/net/ethernet/ti/tlan.c |
1117 |
++++ b/drivers/net/ethernet/ti/tlan.c |
1118 |
+@@ -313,9 +313,8 @@ static void tlan_remove_one(struct pci_dev *pdev) |
1119 |
+ pci_release_regions(pdev); |
1120 |
+ #endif |
1121 |
+ |
1122 |
+- free_netdev(dev); |
1123 |
+- |
1124 |
+ cancel_work_sync(&priv->tlan_tqueue); |
1125 |
++ free_netdev(dev); |
1126 |
+ } |
1127 |
+ |
1128 |
+ static void tlan_start(struct net_device *dev) |
1129 |
+diff --git a/drivers/reset/reset-ti-syscon.c b/drivers/reset/reset-ti-syscon.c |
1130 |
+index 99520b0a1329b..3d375747c4e61 100644 |
1131 |
+--- a/drivers/reset/reset-ti-syscon.c |
1132 |
++++ b/drivers/reset/reset-ti-syscon.c |
1133 |
+@@ -58,8 +58,8 @@ struct ti_syscon_reset_data { |
1134 |
+ unsigned int nr_controls; |
1135 |
+ }; |
1136 |
+ |
1137 |
+-#define to_ti_syscon_reset_data(rcdev) \ |
1138 |
+- container_of(rcdev, struct ti_syscon_reset_data, rcdev) |
1139 |
++#define to_ti_syscon_reset_data(_rcdev) \ |
1140 |
++ container_of(_rcdev, struct ti_syscon_reset_data, rcdev) |
1141 |
+ |
1142 |
+ /** |
1143 |
+ * ti_syscon_reset_assert() - assert device reset |
1144 |
+diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c |
1145 |
+index 182fdd00e290d..ecd61573dd315 100644 |
1146 |
+--- a/drivers/rtc/rtc-max77686.c |
1147 |
++++ b/drivers/rtc/rtc-max77686.c |
1148 |
+@@ -718,8 +718,8 @@ static int max77686_init_rtc_regmap(struct max77686_rtc_info *info) |
1149 |
+ |
1150 |
+ add_rtc_irq: |
1151 |
+ ret = regmap_add_irq_chip(info->rtc_regmap, info->rtc_irq, |
1152 |
+- IRQF_TRIGGER_FALLING | IRQF_ONESHOT | |
1153 |
+- IRQF_SHARED, 0, info->drv_data->rtc_irq_chip, |
1154 |
++ IRQF_ONESHOT | IRQF_SHARED, |
1155 |
++ 0, info->drv_data->rtc_irq_chip, |
1156 |
+ &info->rtc_irq_data); |
1157 |
+ if (ret < 0) { |
1158 |
+ dev_err(info->dev, "Failed to add RTC irq chip: %d\n", ret); |
1159 |
+diff --git a/drivers/scsi/aic7xxx/aic7xxx_core.c b/drivers/scsi/aic7xxx/aic7xxx_core.c |
1160 |
+index fdbb0a3dc9b4f..6929aa13adc3b 100644 |
1161 |
+--- a/drivers/scsi/aic7xxx/aic7xxx_core.c |
1162 |
++++ b/drivers/scsi/aic7xxx/aic7xxx_core.c |
1163 |
+@@ -500,7 +500,7 @@ ahc_inq(struct ahc_softc *ahc, u_int port) |
1164 |
+ return ((ahc_inb(ahc, port)) |
1165 |
+ | (ahc_inb(ahc, port+1) << 8) |
1166 |
+ | (ahc_inb(ahc, port+2) << 16) |
1167 |
+- | (ahc_inb(ahc, port+3) << 24) |
1168 |
++ | (((uint64_t)ahc_inb(ahc, port+3)) << 24) |
1169 |
+ | (((uint64_t)ahc_inb(ahc, port+4)) << 32) |
1170 |
+ | (((uint64_t)ahc_inb(ahc, port+5)) << 40) |
1171 |
+ | (((uint64_t)ahc_inb(ahc, port+6)) << 48) |
1172 |
+diff --git a/drivers/scsi/libfc/fc_rport.c b/drivers/scsi/libfc/fc_rport.c |
1173 |
+index 669cf3553a77d..ef2fa6b10a9c3 100644 |
1174 |
+--- a/drivers/scsi/libfc/fc_rport.c |
1175 |
++++ b/drivers/scsi/libfc/fc_rport.c |
1176 |
+@@ -1174,6 +1174,7 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp, |
1177 |
+ resp_code = (pp->spp.spp_flags & FC_SPP_RESP_MASK); |
1178 |
+ FC_RPORT_DBG(rdata, "PRLI spp_flags = 0x%x spp_type 0x%x\n", |
1179 |
+ pp->spp.spp_flags, pp->spp.spp_type); |
1180 |
++ |
1181 |
+ rdata->spp_type = pp->spp.spp_type; |
1182 |
+ if (resp_code != FC_SPP_RESP_ACK) { |
1183 |
+ if (resp_code == FC_SPP_RESP_CONF) |
1184 |
+@@ -1194,11 +1195,13 @@ static void fc_rport_prli_resp(struct fc_seq *sp, struct fc_frame *fp, |
1185 |
+ /* |
1186 |
+ * Call prli provider if we should act as a target |
1187 |
+ */ |
1188 |
+- prov = fc_passive_prov[rdata->spp_type]; |
1189 |
+- if (prov) { |
1190 |
+- memset(&temp_spp, 0, sizeof(temp_spp)); |
1191 |
+- prov->prli(rdata, pp->prli.prli_spp_len, |
1192 |
+- &pp->spp, &temp_spp); |
1193 |
++ if (rdata->spp_type < FC_FC4_PROV_SIZE) { |
1194 |
++ prov = fc_passive_prov[rdata->spp_type]; |
1195 |
++ if (prov) { |
1196 |
++ memset(&temp_spp, 0, sizeof(temp_spp)); |
1197 |
++ prov->prli(rdata, pp->prli.prli_spp_len, |
1198 |
++ &pp->spp, &temp_spp); |
1199 |
++ } |
1200 |
+ } |
1201 |
+ /* |
1202 |
+ * Check if the image pair could be established |
1203 |
+diff --git a/drivers/scsi/scsi_transport_iscsi.c b/drivers/scsi/scsi_transport_iscsi.c |
1204 |
+index 95c61fb4b81b2..064c941e54834 100644 |
1205 |
+--- a/drivers/scsi/scsi_transport_iscsi.c |
1206 |
++++ b/drivers/scsi/scsi_transport_iscsi.c |
1207 |
+@@ -427,39 +427,10 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj, |
1208 |
+ struct device *dev = container_of(kobj, struct device, kobj); |
1209 |
+ struct iscsi_iface *iface = iscsi_dev_to_iface(dev); |
1210 |
+ struct iscsi_transport *t = iface->transport; |
1211 |
+- int param; |
1212 |
+- int param_type; |
1213 |
++ int param = -1; |
1214 |
+ |
1215 |
+ if (attr == &dev_attr_iface_enabled.attr) |
1216 |
+ param = ISCSI_NET_PARAM_IFACE_ENABLE; |
1217 |
+- else if (attr == &dev_attr_iface_vlan_id.attr) |
1218 |
+- param = ISCSI_NET_PARAM_VLAN_ID; |
1219 |
+- else if (attr == &dev_attr_iface_vlan_priority.attr) |
1220 |
+- param = ISCSI_NET_PARAM_VLAN_PRIORITY; |
1221 |
+- else if (attr == &dev_attr_iface_vlan_enabled.attr) |
1222 |
+- param = ISCSI_NET_PARAM_VLAN_ENABLED; |
1223 |
+- else if (attr == &dev_attr_iface_mtu.attr) |
1224 |
+- param = ISCSI_NET_PARAM_MTU; |
1225 |
+- else if (attr == &dev_attr_iface_port.attr) |
1226 |
+- param = ISCSI_NET_PARAM_PORT; |
1227 |
+- else if (attr == &dev_attr_iface_ipaddress_state.attr) |
1228 |
+- param = ISCSI_NET_PARAM_IPADDR_STATE; |
1229 |
+- else if (attr == &dev_attr_iface_delayed_ack_en.attr) |
1230 |
+- param = ISCSI_NET_PARAM_DELAYED_ACK_EN; |
1231 |
+- else if (attr == &dev_attr_iface_tcp_nagle_disable.attr) |
1232 |
+- param = ISCSI_NET_PARAM_TCP_NAGLE_DISABLE; |
1233 |
+- else if (attr == &dev_attr_iface_tcp_wsf_disable.attr) |
1234 |
+- param = ISCSI_NET_PARAM_TCP_WSF_DISABLE; |
1235 |
+- else if (attr == &dev_attr_iface_tcp_wsf.attr) |
1236 |
+- param = ISCSI_NET_PARAM_TCP_WSF; |
1237 |
+- else if (attr == &dev_attr_iface_tcp_timer_scale.attr) |
1238 |
+- param = ISCSI_NET_PARAM_TCP_TIMER_SCALE; |
1239 |
+- else if (attr == &dev_attr_iface_tcp_timestamp_en.attr) |
1240 |
+- param = ISCSI_NET_PARAM_TCP_TIMESTAMP_EN; |
1241 |
+- else if (attr == &dev_attr_iface_cache_id.attr) |
1242 |
+- param = ISCSI_NET_PARAM_CACHE_ID; |
1243 |
+- else if (attr == &dev_attr_iface_redirect_en.attr) |
1244 |
+- param = ISCSI_NET_PARAM_REDIRECT_EN; |
1245 |
+ else if (attr == &dev_attr_iface_def_taskmgmt_tmo.attr) |
1246 |
+ param = ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO; |
1247 |
+ else if (attr == &dev_attr_iface_header_digest.attr) |
1248 |
+@@ -496,6 +467,38 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj, |
1249 |
+ param = ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN; |
1250 |
+ else if (attr == &dev_attr_iface_initiator_name.attr) |
1251 |
+ param = ISCSI_IFACE_PARAM_INITIATOR_NAME; |
1252 |
++ |
1253 |
++ if (param != -1) |
1254 |
++ return t->attr_is_visible(ISCSI_IFACE_PARAM, param); |
1255 |
++ |
1256 |
++ if (attr == &dev_attr_iface_vlan_id.attr) |
1257 |
++ param = ISCSI_NET_PARAM_VLAN_ID; |
1258 |
++ else if (attr == &dev_attr_iface_vlan_priority.attr) |
1259 |
++ param = ISCSI_NET_PARAM_VLAN_PRIORITY; |
1260 |
++ else if (attr == &dev_attr_iface_vlan_enabled.attr) |
1261 |
++ param = ISCSI_NET_PARAM_VLAN_ENABLED; |
1262 |
++ else if (attr == &dev_attr_iface_mtu.attr) |
1263 |
++ param = ISCSI_NET_PARAM_MTU; |
1264 |
++ else if (attr == &dev_attr_iface_port.attr) |
1265 |
++ param = ISCSI_NET_PARAM_PORT; |
1266 |
++ else if (attr == &dev_attr_iface_ipaddress_state.attr) |
1267 |
++ param = ISCSI_NET_PARAM_IPADDR_STATE; |
1268 |
++ else if (attr == &dev_attr_iface_delayed_ack_en.attr) |
1269 |
++ param = ISCSI_NET_PARAM_DELAYED_ACK_EN; |
1270 |
++ else if (attr == &dev_attr_iface_tcp_nagle_disable.attr) |
1271 |
++ param = ISCSI_NET_PARAM_TCP_NAGLE_DISABLE; |
1272 |
++ else if (attr == &dev_attr_iface_tcp_wsf_disable.attr) |
1273 |
++ param = ISCSI_NET_PARAM_TCP_WSF_DISABLE; |
1274 |
++ else if (attr == &dev_attr_iface_tcp_wsf.attr) |
1275 |
++ param = ISCSI_NET_PARAM_TCP_WSF; |
1276 |
++ else if (attr == &dev_attr_iface_tcp_timer_scale.attr) |
1277 |
++ param = ISCSI_NET_PARAM_TCP_TIMER_SCALE; |
1278 |
++ else if (attr == &dev_attr_iface_tcp_timestamp_en.attr) |
1279 |
++ param = ISCSI_NET_PARAM_TCP_TIMESTAMP_EN; |
1280 |
++ else if (attr == &dev_attr_iface_cache_id.attr) |
1281 |
++ param = ISCSI_NET_PARAM_CACHE_ID; |
1282 |
++ else if (attr == &dev_attr_iface_redirect_en.attr) |
1283 |
++ param = ISCSI_NET_PARAM_REDIRECT_EN; |
1284 |
+ else if (iface->iface_type == ISCSI_IFACE_TYPE_IPV4) { |
1285 |
+ if (attr == &dev_attr_ipv4_iface_ipaddress.attr) |
1286 |
+ param = ISCSI_NET_PARAM_IPV4_ADDR; |
1287 |
+@@ -586,32 +589,7 @@ static umode_t iscsi_iface_attr_is_visible(struct kobject *kobj, |
1288 |
+ return 0; |
1289 |
+ } |
1290 |
+ |
1291 |
+- switch (param) { |
1292 |
+- case ISCSI_IFACE_PARAM_DEF_TASKMGMT_TMO: |
1293 |
+- case ISCSI_IFACE_PARAM_HDRDGST_EN: |
1294 |
+- case ISCSI_IFACE_PARAM_DATADGST_EN: |
1295 |
+- case ISCSI_IFACE_PARAM_IMM_DATA_EN: |
1296 |
+- case ISCSI_IFACE_PARAM_INITIAL_R2T_EN: |
1297 |
+- case ISCSI_IFACE_PARAM_DATASEQ_INORDER_EN: |
1298 |
+- case ISCSI_IFACE_PARAM_PDU_INORDER_EN: |
1299 |
+- case ISCSI_IFACE_PARAM_ERL: |
1300 |
+- case ISCSI_IFACE_PARAM_MAX_RECV_DLENGTH: |
1301 |
+- case ISCSI_IFACE_PARAM_FIRST_BURST: |
1302 |
+- case ISCSI_IFACE_PARAM_MAX_R2T: |
1303 |
+- case ISCSI_IFACE_PARAM_MAX_BURST: |
1304 |
+- case ISCSI_IFACE_PARAM_CHAP_AUTH_EN: |
1305 |
+- case ISCSI_IFACE_PARAM_BIDI_CHAP_EN: |
1306 |
+- case ISCSI_IFACE_PARAM_DISCOVERY_AUTH_OPTIONAL: |
1307 |
+- case ISCSI_IFACE_PARAM_DISCOVERY_LOGOUT_EN: |
1308 |
+- case ISCSI_IFACE_PARAM_STRICT_LOGIN_COMP_EN: |
1309 |
+- case ISCSI_IFACE_PARAM_INITIATOR_NAME: |
1310 |
+- param_type = ISCSI_IFACE_PARAM; |
1311 |
+- break; |
1312 |
+- default: |
1313 |
+- param_type = ISCSI_NET_PARAM; |
1314 |
+- } |
1315 |
+- |
1316 |
+- return t->attr_is_visible(param_type, param); |
1317 |
++ return t->attr_is_visible(ISCSI_NET_PARAM, param); |
1318 |
+ } |
1319 |
+ |
1320 |
+ static struct attribute *iscsi_iface_attrs[] = { |
1321 |
+diff --git a/drivers/spi/spi-cadence.c b/drivers/spi/spi-cadence.c |
1322 |
+index 9ed5f0010e445..d9aeb9efa7aa8 100644 |
1323 |
+--- a/drivers/spi/spi-cadence.c |
1324 |
++++ b/drivers/spi/spi-cadence.c |
1325 |
+@@ -585,6 +585,12 @@ static int cdns_spi_probe(struct platform_device *pdev) |
1326 |
+ goto clk_dis_apb; |
1327 |
+ } |
1328 |
+ |
1329 |
++ pm_runtime_use_autosuspend(&pdev->dev); |
1330 |
++ pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT); |
1331 |
++ pm_runtime_get_noresume(&pdev->dev); |
1332 |
++ pm_runtime_set_active(&pdev->dev); |
1333 |
++ pm_runtime_enable(&pdev->dev); |
1334 |
++ |
1335 |
+ ret = of_property_read_u32(pdev->dev.of_node, "num-cs", &num_cs); |
1336 |
+ if (ret < 0) |
1337 |
+ master->num_chipselect = CDNS_SPI_DEFAULT_NUM_CS; |
1338 |
+@@ -599,11 +605,6 @@ static int cdns_spi_probe(struct platform_device *pdev) |
1339 |
+ /* SPI controller initializations */ |
1340 |
+ cdns_spi_init_hw(xspi); |
1341 |
+ |
1342 |
+- pm_runtime_set_active(&pdev->dev); |
1343 |
+- pm_runtime_enable(&pdev->dev); |
1344 |
+- pm_runtime_use_autosuspend(&pdev->dev); |
1345 |
+- pm_runtime_set_autosuspend_delay(&pdev->dev, SPI_AUTOSUSPEND_TIMEOUT); |
1346 |
+- |
1347 |
+ irq = platform_get_irq(pdev, 0); |
1348 |
+ if (irq <= 0) { |
1349 |
+ ret = -ENXIO; |
1350 |
+@@ -636,6 +637,9 @@ static int cdns_spi_probe(struct platform_device *pdev) |
1351 |
+ |
1352 |
+ master->bits_per_word_mask = SPI_BPW_MASK(8); |
1353 |
+ |
1354 |
++ pm_runtime_mark_last_busy(&pdev->dev); |
1355 |
++ pm_runtime_put_autosuspend(&pdev->dev); |
1356 |
++ |
1357 |
+ ret = spi_register_master(master); |
1358 |
+ if (ret) { |
1359 |
+ dev_err(&pdev->dev, "spi_register_master failed\n"); |
1360 |
+diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c |
1361 |
+index befabddf897a4..ed114f00a6d11 100644 |
1362 |
+--- a/drivers/spi/spi-fsl-dspi.c |
1363 |
++++ b/drivers/spi/spi-fsl-dspi.c |
1364 |
+@@ -1057,11 +1057,13 @@ static int dspi_probe(struct platform_device *pdev) |
1365 |
+ ret = spi_register_master(master); |
1366 |
+ if (ret != 0) { |
1367 |
+ dev_err(&pdev->dev, "Problem registering DSPI master\n"); |
1368 |
+- goto out_free_irq; |
1369 |
++ goto out_release_dma; |
1370 |
+ } |
1371 |
+ |
1372 |
+ return ret; |
1373 |
+ |
1374 |
++out_release_dma: |
1375 |
++ dspi_release_dma(dspi); |
1376 |
+ out_free_irq: |
1377 |
+ if (dspi->irq) |
1378 |
+ free_irq(dspi->irq, dspi); |
1379 |
+diff --git a/drivers/spi/spi-mt65xx.c b/drivers/spi/spi-mt65xx.c |
1380 |
+index da28c52c9da19..e2b171057b3b3 100644 |
1381 |
+--- a/drivers/spi/spi-mt65xx.c |
1382 |
++++ b/drivers/spi/spi-mt65xx.c |
1383 |
+@@ -392,13 +392,23 @@ static int mtk_spi_fifo_transfer(struct spi_master *master, |
1384 |
+ mtk_spi_setup_packet(master); |
1385 |
+ |
1386 |
+ cnt = xfer->len / 4; |
1387 |
+- iowrite32_rep(mdata->base + SPI_TX_DATA_REG, xfer->tx_buf, cnt); |
1388 |
++ if (xfer->tx_buf) |
1389 |
++ iowrite32_rep(mdata->base + SPI_TX_DATA_REG, xfer->tx_buf, cnt); |
1390 |
++ |
1391 |
++ if (xfer->rx_buf) |
1392 |
++ ioread32_rep(mdata->base + SPI_RX_DATA_REG, xfer->rx_buf, cnt); |
1393 |
+ |
1394 |
+ remainder = xfer->len % 4; |
1395 |
+ if (remainder > 0) { |
1396 |
+ reg_val = 0; |
1397 |
+- memcpy(®_val, xfer->tx_buf + (cnt * 4), remainder); |
1398 |
+- writel(reg_val, mdata->base + SPI_TX_DATA_REG); |
1399 |
++ if (xfer->tx_buf) { |
1400 |
++ memcpy(®_val, xfer->tx_buf + (cnt * 4), remainder); |
1401 |
++ writel(reg_val, mdata->base + SPI_TX_DATA_REG); |
1402 |
++ } |
1403 |
++ if (xfer->rx_buf) { |
1404 |
++ reg_val = readl(mdata->base + SPI_RX_DATA_REG); |
1405 |
++ memcpy(xfer->rx_buf + (cnt * 4), ®_val, remainder); |
1406 |
++ } |
1407 |
+ } |
1408 |
+ |
1409 |
+ mtk_spi_enable_transfer(master); |
1410 |
+diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c |
1411 |
+index 750a04ed0e93a..bf05701f78b3a 100644 |
1412 |
+--- a/drivers/target/target_core_sbc.c |
1413 |
++++ b/drivers/target/target_core_sbc.c |
1414 |
+@@ -38,7 +38,7 @@ |
1415 |
+ #include "target_core_alua.h" |
1416 |
+ |
1417 |
+ static sense_reason_t |
1418 |
+-sbc_check_prot(struct se_device *, struct se_cmd *, unsigned char *, u32, bool); |
1419 |
++sbc_check_prot(struct se_device *, struct se_cmd *, unsigned char, u32, bool); |
1420 |
+ static sense_reason_t sbc_execute_unmap(struct se_cmd *cmd); |
1421 |
+ |
1422 |
+ static sense_reason_t |
1423 |
+@@ -292,14 +292,14 @@ static inline unsigned long long transport_lba_64_ext(unsigned char *cdb) |
1424 |
+ } |
1425 |
+ |
1426 |
+ static sense_reason_t |
1427 |
+-sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *ops) |
1428 |
++sbc_setup_write_same(struct se_cmd *cmd, unsigned char flags, struct sbc_ops *ops) |
1429 |
+ { |
1430 |
+ struct se_device *dev = cmd->se_dev; |
1431 |
+ sector_t end_lba = dev->transport->get_blocks(dev) + 1; |
1432 |
+ unsigned int sectors = sbc_get_write_same_sectors(cmd); |
1433 |
+ sense_reason_t ret; |
1434 |
+ |
1435 |
+- if ((flags[0] & 0x04) || (flags[0] & 0x02)) { |
1436 |
++ if ((flags & 0x04) || (flags & 0x02)) { |
1437 |
+ pr_err("WRITE_SAME PBDATA and LBDATA" |
1438 |
+ " bits not supported for Block Discard" |
1439 |
+ " Emulation\n"); |
1440 |
+@@ -321,7 +321,7 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *o |
1441 |
+ } |
1442 |
+ |
1443 |
+ /* We always have ANC_SUP == 0 so setting ANCHOR is always an error */ |
1444 |
+- if (flags[0] & 0x10) { |
1445 |
++ if (flags & 0x10) { |
1446 |
+ pr_warn("WRITE SAME with ANCHOR not supported\n"); |
1447 |
+ return TCM_INVALID_CDB_FIELD; |
1448 |
+ } |
1449 |
+@@ -329,7 +329,7 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *o |
1450 |
+ * Special case for WRITE_SAME w/ UNMAP=1 that ends up getting |
1451 |
+ * translated into block discard requests within backend code. |
1452 |
+ */ |
1453 |
+- if (flags[0] & 0x08) { |
1454 |
++ if (flags & 0x08) { |
1455 |
+ if (!ops->execute_unmap) |
1456 |
+ return TCM_UNSUPPORTED_SCSI_OPCODE; |
1457 |
+ |
1458 |
+@@ -344,7 +344,7 @@ sbc_setup_write_same(struct se_cmd *cmd, unsigned char *flags, struct sbc_ops *o |
1459 |
+ if (!ops->execute_write_same) |
1460 |
+ return TCM_UNSUPPORTED_SCSI_OPCODE; |
1461 |
+ |
1462 |
+- ret = sbc_check_prot(dev, cmd, &cmd->t_task_cdb[0], sectors, true); |
1463 |
++ ret = sbc_check_prot(dev, cmd, flags >> 5, sectors, true); |
1464 |
+ if (ret) |
1465 |
+ return ret; |
1466 |
+ |
1467 |
+@@ -702,10 +702,9 @@ sbc_set_prot_op_checks(u8 protect, bool fabric_prot, enum target_prot_type prot_ |
1468 |
+ } |
1469 |
+ |
1470 |
+ static sense_reason_t |
1471 |
+-sbc_check_prot(struct se_device *dev, struct se_cmd *cmd, unsigned char *cdb, |
1472 |
++sbc_check_prot(struct se_device *dev, struct se_cmd *cmd, unsigned char protect, |
1473 |
+ u32 sectors, bool is_write) |
1474 |
+ { |
1475 |
+- u8 protect = cdb[1] >> 5; |
1476 |
+ int sp_ops = cmd->se_sess->sup_prot_ops; |
1477 |
+ int pi_prot_type = dev->dev_attrib.pi_prot_type; |
1478 |
+ bool fabric_prot = false; |
1479 |
+@@ -753,7 +752,7 @@ sbc_check_prot(struct se_device *dev, struct se_cmd *cmd, unsigned char *cdb, |
1480 |
+ /* Fallthrough */ |
1481 |
+ default: |
1482 |
+ pr_err("Unable to determine pi_prot_type for CDB: 0x%02x " |
1483 |
+- "PROTECT: 0x%02x\n", cdb[0], protect); |
1484 |
++ "PROTECT: 0x%02x\n", cmd->t_task_cdb[0], protect); |
1485 |
+ return TCM_INVALID_CDB_FIELD; |
1486 |
+ } |
1487 |
+ |
1488 |
+@@ -828,7 +827,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) |
1489 |
+ if (sbc_check_dpofua(dev, cmd, cdb)) |
1490 |
+ return TCM_INVALID_CDB_FIELD; |
1491 |
+ |
1492 |
+- ret = sbc_check_prot(dev, cmd, cdb, sectors, false); |
1493 |
++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, false); |
1494 |
+ if (ret) |
1495 |
+ return ret; |
1496 |
+ |
1497 |
+@@ -842,7 +841,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) |
1498 |
+ if (sbc_check_dpofua(dev, cmd, cdb)) |
1499 |
+ return TCM_INVALID_CDB_FIELD; |
1500 |
+ |
1501 |
+- ret = sbc_check_prot(dev, cmd, cdb, sectors, false); |
1502 |
++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, false); |
1503 |
+ if (ret) |
1504 |
+ return ret; |
1505 |
+ |
1506 |
+@@ -856,7 +855,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) |
1507 |
+ if (sbc_check_dpofua(dev, cmd, cdb)) |
1508 |
+ return TCM_INVALID_CDB_FIELD; |
1509 |
+ |
1510 |
+- ret = sbc_check_prot(dev, cmd, cdb, sectors, false); |
1511 |
++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, false); |
1512 |
+ if (ret) |
1513 |
+ return ret; |
1514 |
+ |
1515 |
+@@ -877,7 +876,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) |
1516 |
+ if (sbc_check_dpofua(dev, cmd, cdb)) |
1517 |
+ return TCM_INVALID_CDB_FIELD; |
1518 |
+ |
1519 |
+- ret = sbc_check_prot(dev, cmd, cdb, sectors, true); |
1520 |
++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, true); |
1521 |
+ if (ret) |
1522 |
+ return ret; |
1523 |
+ |
1524 |
+@@ -891,7 +890,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) |
1525 |
+ if (sbc_check_dpofua(dev, cmd, cdb)) |
1526 |
+ return TCM_INVALID_CDB_FIELD; |
1527 |
+ |
1528 |
+- ret = sbc_check_prot(dev, cmd, cdb, sectors, true); |
1529 |
++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, true); |
1530 |
+ if (ret) |
1531 |
+ return ret; |
1532 |
+ |
1533 |
+@@ -906,7 +905,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) |
1534 |
+ if (sbc_check_dpofua(dev, cmd, cdb)) |
1535 |
+ return TCM_INVALID_CDB_FIELD; |
1536 |
+ |
1537 |
+- ret = sbc_check_prot(dev, cmd, cdb, sectors, true); |
1538 |
++ ret = sbc_check_prot(dev, cmd, cdb[1] >> 5, sectors, true); |
1539 |
+ if (ret) |
1540 |
+ return ret; |
1541 |
+ |
1542 |
+@@ -965,7 +964,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) |
1543 |
+ size = sbc_get_size(cmd, 1); |
1544 |
+ cmd->t_task_lba = get_unaligned_be64(&cdb[12]); |
1545 |
+ |
1546 |
+- ret = sbc_setup_write_same(cmd, &cdb[10], ops); |
1547 |
++ ret = sbc_setup_write_same(cmd, cdb[10], ops); |
1548 |
+ if (ret) |
1549 |
+ return ret; |
1550 |
+ break; |
1551 |
+@@ -1063,7 +1062,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) |
1552 |
+ size = sbc_get_size(cmd, 1); |
1553 |
+ cmd->t_task_lba = get_unaligned_be64(&cdb[2]); |
1554 |
+ |
1555 |
+- ret = sbc_setup_write_same(cmd, &cdb[1], ops); |
1556 |
++ ret = sbc_setup_write_same(cmd, cdb[1], ops); |
1557 |
+ if (ret) |
1558 |
+ return ret; |
1559 |
+ break; |
1560 |
+@@ -1081,7 +1080,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops) |
1561 |
+ * Follow sbcr26 with WRITE_SAME (10) and check for the existence |
1562 |
+ * of byte 1 bit 3 UNMAP instead of original reserved field |
1563 |
+ */ |
1564 |
+- ret = sbc_setup_write_same(cmd, &cdb[1], ops); |
1565 |
++ ret = sbc_setup_write_same(cmd, cdb[1], ops); |
1566 |
+ if (ret) |
1567 |
+ return ret; |
1568 |
+ break; |
1569 |
+diff --git a/drivers/thermal/thermal_core.c b/drivers/thermal/thermal_core.c |
1570 |
+index fcefafe7df484..2db83b555e594 100644 |
1571 |
+--- a/drivers/thermal/thermal_core.c |
1572 |
++++ b/drivers/thermal/thermal_core.c |
1573 |
+@@ -1304,7 +1304,7 @@ free_tz: |
1574 |
+ EXPORT_SYMBOL_GPL(thermal_zone_device_register); |
1575 |
+ |
1576 |
+ /** |
1577 |
+- * thermal_device_unregister - removes the registered thermal zone device |
1578 |
++ * thermal_zone_device_unregister - removes the registered thermal zone device |
1579 |
+ * @tz: the thermal zone device to remove |
1580 |
+ */ |
1581 |
+ void thermal_zone_device_unregister(struct thermal_zone_device *tz) |
1582 |
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c |
1583 |
+index 276a63ae510e6..6c555a50646a6 100644 |
1584 |
+--- a/drivers/usb/core/hub.c |
1585 |
++++ b/drivers/usb/core/hub.c |
1586 |
+@@ -3903,6 +3903,47 @@ static int usb_set_lpm_timeout(struct usb_device *udev, |
1587 |
+ return 0; |
1588 |
+ } |
1589 |
+ |
1590 |
++/* |
1591 |
++ * Don't allow device intiated U1/U2 if the system exit latency + one bus |
1592 |
++ * interval is greater than the minimum service interval of any active |
1593 |
++ * periodic endpoint. See USB 3.2 section 9.4.9 |
1594 |
++ */ |
1595 |
++static bool usb_device_may_initiate_lpm(struct usb_device *udev, |
1596 |
++ enum usb3_link_state state) |
1597 |
++{ |
1598 |
++ unsigned int sel; /* us */ |
1599 |
++ int i, j; |
1600 |
++ |
1601 |
++ if (state == USB3_LPM_U1) |
1602 |
++ sel = DIV_ROUND_UP(udev->u1_params.sel, 1000); |
1603 |
++ else if (state == USB3_LPM_U2) |
1604 |
++ sel = DIV_ROUND_UP(udev->u2_params.sel, 1000); |
1605 |
++ else |
1606 |
++ return false; |
1607 |
++ |
1608 |
++ for (i = 0; i < udev->actconfig->desc.bNumInterfaces; i++) { |
1609 |
++ struct usb_interface *intf; |
1610 |
++ struct usb_endpoint_descriptor *desc; |
1611 |
++ unsigned int interval; |
1612 |
++ |
1613 |
++ intf = udev->actconfig->interface[i]; |
1614 |
++ if (!intf) |
1615 |
++ continue; |
1616 |
++ |
1617 |
++ for (j = 0; j < intf->cur_altsetting->desc.bNumEndpoints; j++) { |
1618 |
++ desc = &intf->cur_altsetting->endpoint[j].desc; |
1619 |
++ |
1620 |
++ if (usb_endpoint_xfer_int(desc) || |
1621 |
++ usb_endpoint_xfer_isoc(desc)) { |
1622 |
++ interval = (1 << (desc->bInterval - 1)) * 125; |
1623 |
++ if (sel + 125 > interval) |
1624 |
++ return false; |
1625 |
++ } |
1626 |
++ } |
1627 |
++ } |
1628 |
++ return true; |
1629 |
++} |
1630 |
++ |
1631 |
+ /* |
1632 |
+ * Enable the hub-initiated U1/U2 idle timeouts, and enable device-initiated |
1633 |
+ * U1/U2 entry. |
1634 |
+@@ -3975,20 +4016,23 @@ static void usb_enable_link_state(struct usb_hcd *hcd, struct usb_device *udev, |
1635 |
+ * U1/U2_ENABLE |
1636 |
+ */ |
1637 |
+ if (udev->actconfig && |
1638 |
+- usb_set_device_initiated_lpm(udev, state, true) == 0) { |
1639 |
+- if (state == USB3_LPM_U1) |
1640 |
+- udev->usb3_lpm_u1_enabled = 1; |
1641 |
+- else if (state == USB3_LPM_U2) |
1642 |
+- udev->usb3_lpm_u2_enabled = 1; |
1643 |
+- } else { |
1644 |
+- /* Don't request U1/U2 entry if the device |
1645 |
+- * cannot transition to U1/U2. |
1646 |
+- */ |
1647 |
+- usb_set_lpm_timeout(udev, state, 0); |
1648 |
+- hcd->driver->disable_usb3_lpm_timeout(hcd, udev, state); |
1649 |
++ usb_device_may_initiate_lpm(udev, state)) { |
1650 |
++ if (usb_set_device_initiated_lpm(udev, state, true)) { |
1651 |
++ /* |
1652 |
++ * Request to enable device initiated U1/U2 failed, |
1653 |
++ * better to turn off lpm in this case. |
1654 |
++ */ |
1655 |
++ usb_set_lpm_timeout(udev, state, 0); |
1656 |
++ hcd->driver->disable_usb3_lpm_timeout(hcd, udev, state); |
1657 |
++ return; |
1658 |
++ } |
1659 |
+ } |
1660 |
+-} |
1661 |
+ |
1662 |
++ if (state == USB3_LPM_U1) |
1663 |
++ udev->usb3_lpm_u1_enabled = 1; |
1664 |
++ else if (state == USB3_LPM_U2) |
1665 |
++ udev->usb3_lpm_u2_enabled = 1; |
1666 |
++} |
1667 |
+ /* |
1668 |
+ * Disable the hub-initiated U1/U2 idle timeouts, and disable device-initiated |
1669 |
+ * U1/U2 entry. |
1670 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
1671 |
+index 3dfd584a1ef3d..2ca6ed207e26e 100644 |
1672 |
+--- a/drivers/usb/core/quirks.c |
1673 |
++++ b/drivers/usb/core/quirks.c |
1674 |
+@@ -325,10 +325,6 @@ static const struct usb_device_id usb_quirk_list[] = { |
1675 |
+ /* DJI CineSSD */ |
1676 |
+ { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM }, |
1677 |
+ |
1678 |
+- /* Fibocom L850-GL LTE Modem */ |
1679 |
+- { USB_DEVICE(0x2cb7, 0x0007), .driver_info = |
1680 |
+- USB_QUIRK_IGNORE_REMOTE_WAKEUP }, |
1681 |
+- |
1682 |
+ /* INTEL VALUE SSD */ |
1683 |
+ { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME }, |
1684 |
+ |
1685 |
+diff --git a/drivers/usb/dwc2/gadget.c b/drivers/usb/dwc2/gadget.c |
1686 |
+index 6790c0a181235..f1edc5727000c 100644 |
1687 |
+--- a/drivers/usb/dwc2/gadget.c |
1688 |
++++ b/drivers/usb/dwc2/gadget.c |
1689 |
+@@ -2702,12 +2702,14 @@ static void dwc2_hsotg_complete_in(struct dwc2_hsotg *hsotg, |
1690 |
+ return; |
1691 |
+ } |
1692 |
+ |
1693 |
+- /* Zlp for all endpoints, for ep0 only in DATA IN stage */ |
1694 |
++ /* Zlp for all endpoints in non DDMA, for ep0 only in DATA IN stage */ |
1695 |
+ if (hs_ep->send_zlp) { |
1696 |
+- dwc2_hsotg_program_zlp(hsotg, hs_ep); |
1697 |
+ hs_ep->send_zlp = 0; |
1698 |
+- /* transfer will be completed on next complete interrupt */ |
1699 |
+- return; |
1700 |
++ if (!using_desc_dma(hsotg)) { |
1701 |
++ dwc2_hsotg_program_zlp(hsotg, hs_ep); |
1702 |
++ /* transfer will be completed on next complete interrupt */ |
1703 |
++ return; |
1704 |
++ } |
1705 |
+ } |
1706 |
+ |
1707 |
+ if (hs_ep->index == 0 && hsotg->ep0_state == DWC2_EP0_DATA_IN) { |
1708 |
+diff --git a/drivers/usb/host/max3421-hcd.c b/drivers/usb/host/max3421-hcd.c |
1709 |
+index 0ece9a9341e54..1c047f28c88e4 100644 |
1710 |
+--- a/drivers/usb/host/max3421-hcd.c |
1711 |
++++ b/drivers/usb/host/max3421-hcd.c |
1712 |
+@@ -149,8 +149,6 @@ struct max3421_hcd { |
1713 |
+ */ |
1714 |
+ struct urb *curr_urb; |
1715 |
+ enum scheduling_pass sched_pass; |
1716 |
+- struct usb_device *loaded_dev; /* dev that's loaded into the chip */ |
1717 |
+- int loaded_epnum; /* epnum whose toggles are loaded */ |
1718 |
+ int urb_done; /* > 0 -> no errors, < 0: errno */ |
1719 |
+ size_t curr_len; |
1720 |
+ u8 hien; |
1721 |
+@@ -488,39 +486,17 @@ max3421_set_speed(struct usb_hcd *hcd, struct usb_device *dev) |
1722 |
+ * Caller must NOT hold HCD spinlock. |
1723 |
+ */ |
1724 |
+ static void |
1725 |
+-max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum, |
1726 |
+- int force_toggles) |
1727 |
++max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum) |
1728 |
+ { |
1729 |
+- struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); |
1730 |
+- int old_epnum, same_ep, rcvtog, sndtog; |
1731 |
+- struct usb_device *old_dev; |
1732 |
++ int rcvtog, sndtog; |
1733 |
+ u8 hctl; |
1734 |
+ |
1735 |
+- old_dev = max3421_hcd->loaded_dev; |
1736 |
+- old_epnum = max3421_hcd->loaded_epnum; |
1737 |
+- |
1738 |
+- same_ep = (dev == old_dev && epnum == old_epnum); |
1739 |
+- if (same_ep && !force_toggles) |
1740 |
+- return; |
1741 |
+- |
1742 |
+- if (old_dev && !same_ep) { |
1743 |
+- /* save the old end-points toggles: */ |
1744 |
+- u8 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL); |
1745 |
+- |
1746 |
+- rcvtog = (hrsl >> MAX3421_HRSL_RCVTOGRD_BIT) & 1; |
1747 |
+- sndtog = (hrsl >> MAX3421_HRSL_SNDTOGRD_BIT) & 1; |
1748 |
+- |
1749 |
+- /* no locking: HCD (i.e., we) own toggles, don't we? */ |
1750 |
+- usb_settoggle(old_dev, old_epnum, 0, rcvtog); |
1751 |
+- usb_settoggle(old_dev, old_epnum, 1, sndtog); |
1752 |
+- } |
1753 |
+ /* setup new endpoint's toggle bits: */ |
1754 |
+ rcvtog = usb_gettoggle(dev, epnum, 0); |
1755 |
+ sndtog = usb_gettoggle(dev, epnum, 1); |
1756 |
+ hctl = (BIT(rcvtog + MAX3421_HCTL_RCVTOG0_BIT) | |
1757 |
+ BIT(sndtog + MAX3421_HCTL_SNDTOG0_BIT)); |
1758 |
+ |
1759 |
+- max3421_hcd->loaded_epnum = epnum; |
1760 |
+ spi_wr8(hcd, MAX3421_REG_HCTL, hctl); |
1761 |
+ |
1762 |
+ /* |
1763 |
+@@ -528,7 +504,6 @@ max3421_set_address(struct usb_hcd *hcd, struct usb_device *dev, int epnum, |
1764 |
+ * address-assignment so it's best to just always load the |
1765 |
+ * address whenever the end-point changed/was forced. |
1766 |
+ */ |
1767 |
+- max3421_hcd->loaded_dev = dev; |
1768 |
+ spi_wr8(hcd, MAX3421_REG_PERADDR, dev->devnum); |
1769 |
+ } |
1770 |
+ |
1771 |
+@@ -663,7 +638,7 @@ max3421_select_and_start_urb(struct usb_hcd *hcd) |
1772 |
+ struct max3421_hcd *max3421_hcd = hcd_to_max3421(hcd); |
1773 |
+ struct urb *urb, *curr_urb = NULL; |
1774 |
+ struct max3421_ep *max3421_ep; |
1775 |
+- int epnum, force_toggles = 0; |
1776 |
++ int epnum; |
1777 |
+ struct usb_host_endpoint *ep; |
1778 |
+ struct list_head *pos; |
1779 |
+ unsigned long flags; |
1780 |
+@@ -773,7 +748,6 @@ done: |
1781 |
+ usb_settoggle(urb->dev, epnum, 0, 1); |
1782 |
+ usb_settoggle(urb->dev, epnum, 1, 1); |
1783 |
+ max3421_ep->pkt_state = PKT_STATE_SETUP; |
1784 |
+- force_toggles = 1; |
1785 |
+ } else |
1786 |
+ max3421_ep->pkt_state = PKT_STATE_TRANSFER; |
1787 |
+ } |
1788 |
+@@ -781,7 +755,7 @@ done: |
1789 |
+ spin_unlock_irqrestore(&max3421_hcd->lock, flags); |
1790 |
+ |
1791 |
+ max3421_ep->last_active = max3421_hcd->frame_number; |
1792 |
+- max3421_set_address(hcd, urb->dev, epnum, force_toggles); |
1793 |
++ max3421_set_address(hcd, urb->dev, epnum); |
1794 |
+ max3421_set_speed(hcd, urb->dev); |
1795 |
+ max3421_next_transfer(hcd, 0); |
1796 |
+ return 1; |
1797 |
+@@ -1376,6 +1350,16 @@ max3421_urb_done(struct usb_hcd *hcd) |
1798 |
+ status = 0; |
1799 |
+ urb = max3421_hcd->curr_urb; |
1800 |
+ if (urb) { |
1801 |
++ /* save the old end-points toggles: */ |
1802 |
++ u8 hrsl = spi_rd8(hcd, MAX3421_REG_HRSL); |
1803 |
++ int rcvtog = (hrsl >> MAX3421_HRSL_RCVTOGRD_BIT) & 1; |
1804 |
++ int sndtog = (hrsl >> MAX3421_HRSL_SNDTOGRD_BIT) & 1; |
1805 |
++ int epnum = usb_endpoint_num(&urb->ep->desc); |
1806 |
++ |
1807 |
++ /* no locking: HCD (i.e., we) own toggles, don't we? */ |
1808 |
++ usb_settoggle(urb->dev, epnum, 0, rcvtog); |
1809 |
++ usb_settoggle(urb->dev, epnum, 1, sndtog); |
1810 |
++ |
1811 |
+ max3421_hcd->curr_urb = NULL; |
1812 |
+ spin_lock_irqsave(&max3421_hcd->lock, flags); |
1813 |
+ usb_hcd_unlink_urb_from_ep(hcd, urb); |
1814 |
+diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c |
1815 |
+index 7f1685a545142..65a930b3722eb 100644 |
1816 |
+--- a/drivers/usb/host/xhci-hub.c |
1817 |
++++ b/drivers/usb/host/xhci-hub.c |
1818 |
+@@ -1450,11 +1450,12 @@ int xhci_hub_status_data(struct usb_hcd *hcd, char *buf) |
1819 |
+ * Inform the usbcore about resume-in-progress by returning |
1820 |
+ * a non-zero value even if there are no status changes. |
1821 |
+ */ |
1822 |
++ spin_lock_irqsave(&xhci->lock, flags); |
1823 |
++ |
1824 |
+ status = bus_state->resuming_ports; |
1825 |
+ |
1826 |
+ mask = PORT_CSC | PORT_PEC | PORT_OCC | PORT_PLC | PORT_WRC | PORT_CEC; |
1827 |
+ |
1828 |
+- spin_lock_irqsave(&xhci->lock, flags); |
1829 |
+ /* For each port, did anything change? If so, set that bit in buf. */ |
1830 |
+ for (i = 0; i < max_ports; i++) { |
1831 |
+ temp = readl(port_array[i]); |
1832 |
+diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c |
1833 |
+index 748d4c69cb28a..420ad7dc4fe8b 100644 |
1834 |
+--- a/drivers/usb/host/xhci-ring.c |
1835 |
++++ b/drivers/usb/host/xhci-ring.c |
1836 |
+@@ -444,6 +444,26 @@ static void ring_doorbell_for_active_rings(struct xhci_hcd *xhci, |
1837 |
+ } |
1838 |
+ } |
1839 |
+ |
1840 |
++static struct xhci_virt_ep *xhci_get_virt_ep(struct xhci_hcd *xhci, |
1841 |
++ unsigned int slot_id, |
1842 |
++ unsigned int ep_index) |
1843 |
++{ |
1844 |
++ if (slot_id == 0 || slot_id >= MAX_HC_SLOTS) { |
1845 |
++ xhci_warn(xhci, "Invalid slot_id %u\n", slot_id); |
1846 |
++ return NULL; |
1847 |
++ } |
1848 |
++ if (ep_index >= EP_CTX_PER_DEV) { |
1849 |
++ xhci_warn(xhci, "Invalid endpoint index %u\n", ep_index); |
1850 |
++ return NULL; |
1851 |
++ } |
1852 |
++ if (!xhci->devs[slot_id]) { |
1853 |
++ xhci_warn(xhci, "No xhci virt device for slot_id %u\n", slot_id); |
1854 |
++ return NULL; |
1855 |
++ } |
1856 |
++ |
1857 |
++ return &xhci->devs[slot_id]->eps[ep_index]; |
1858 |
++} |
1859 |
++ |
1860 |
+ /* Get the right ring for the given slot_id, ep_index and stream_id. |
1861 |
+ * If the endpoint supports streams, boundary check the URB's stream ID. |
1862 |
+ * If the endpoint doesn't support streams, return the singular endpoint ring. |
1863 |
+@@ -454,7 +474,10 @@ struct xhci_ring *xhci_triad_to_transfer_ring(struct xhci_hcd *xhci, |
1864 |
+ { |
1865 |
+ struct xhci_virt_ep *ep; |
1866 |
+ |
1867 |
+- ep = &xhci->devs[slot_id]->eps[ep_index]; |
1868 |
++ ep = xhci_get_virt_ep(xhci, slot_id, ep_index); |
1869 |
++ if (!ep) |
1870 |
++ return NULL; |
1871 |
++ |
1872 |
+ /* Common case: no streams */ |
1873 |
+ if (!(ep->ep_state & EP_HAS_STREAMS)) |
1874 |
+ return ep->ring; |
1875 |
+@@ -729,11 +752,14 @@ static void xhci_handle_cmd_stop_ep(struct xhci_hcd *xhci, int slot_id, |
1876 |
+ memset(&deq_state, 0, sizeof(deq_state)); |
1877 |
+ ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); |
1878 |
+ |
1879 |
++ ep = xhci_get_virt_ep(xhci, slot_id, ep_index); |
1880 |
++ if (!ep) |
1881 |
++ return; |
1882 |
++ |
1883 |
+ vdev = xhci->devs[slot_id]; |
1884 |
+ ep_ctx = xhci_get_ep_ctx(xhci, vdev->out_ctx, ep_index); |
1885 |
+ trace_xhci_handle_cmd_stop_ep(ep_ctx); |
1886 |
+ |
1887 |
+- ep = &xhci->devs[slot_id]->eps[ep_index]; |
1888 |
+ last_unlinked_td = list_last_entry(&ep->cancelled_td_list, |
1889 |
+ struct xhci_td, cancelled_td_list); |
1890 |
+ |
1891 |
+@@ -1057,9 +1083,11 @@ static void xhci_handle_cmd_set_deq(struct xhci_hcd *xhci, int slot_id, |
1892 |
+ |
1893 |
+ ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); |
1894 |
+ stream_id = TRB_TO_STREAM_ID(le32_to_cpu(trb->generic.field[2])); |
1895 |
+- dev = xhci->devs[slot_id]; |
1896 |
+- ep = &dev->eps[ep_index]; |
1897 |
++ ep = xhci_get_virt_ep(xhci, slot_id, ep_index); |
1898 |
++ if (!ep) |
1899 |
++ return; |
1900 |
+ |
1901 |
++ dev = xhci->devs[slot_id]; |
1902 |
+ ep_ring = xhci_stream_id_to_ring(dev, ep_index, stream_id); |
1903 |
+ if (!ep_ring) { |
1904 |
+ xhci_warn(xhci, "WARN Set TR deq ptr command for freed stream ID %u\n", |
1905 |
+@@ -1132,9 +1160,9 @@ static void xhci_handle_cmd_set_deq(struct xhci_hcd *xhci, int slot_id, |
1906 |
+ } |
1907 |
+ |
1908 |
+ cleanup: |
1909 |
+- dev->eps[ep_index].ep_state &= ~SET_DEQ_PENDING; |
1910 |
+- dev->eps[ep_index].queued_deq_seg = NULL; |
1911 |
+- dev->eps[ep_index].queued_deq_ptr = NULL; |
1912 |
++ ep->ep_state &= ~SET_DEQ_PENDING; |
1913 |
++ ep->queued_deq_seg = NULL; |
1914 |
++ ep->queued_deq_ptr = NULL; |
1915 |
+ /* Restart any rings with pending URBs */ |
1916 |
+ ring_doorbell_for_active_rings(xhci, slot_id, ep_index); |
1917 |
+ } |
1918 |
+@@ -1143,10 +1171,15 @@ static void xhci_handle_cmd_reset_ep(struct xhci_hcd *xhci, int slot_id, |
1919 |
+ union xhci_trb *trb, u32 cmd_comp_code) |
1920 |
+ { |
1921 |
+ struct xhci_virt_device *vdev; |
1922 |
++ struct xhci_virt_ep *ep; |
1923 |
+ struct xhci_ep_ctx *ep_ctx; |
1924 |
+ unsigned int ep_index; |
1925 |
+ |
1926 |
+ ep_index = TRB_TO_EP_INDEX(le32_to_cpu(trb->generic.field[3])); |
1927 |
++ ep = xhci_get_virt_ep(xhci, slot_id, ep_index); |
1928 |
++ if (!ep) |
1929 |
++ return; |
1930 |
++ |
1931 |
+ vdev = xhci->devs[slot_id]; |
1932 |
+ ep_ctx = xhci_get_ep_ctx(xhci, vdev->out_ctx, ep_index); |
1933 |
+ trace_xhci_handle_cmd_reset_ep(ep_ctx); |
1934 |
+@@ -1176,7 +1209,7 @@ static void xhci_handle_cmd_reset_ep(struct xhci_hcd *xhci, int slot_id, |
1935 |
+ xhci_ring_cmd_db(xhci); |
1936 |
+ } else { |
1937 |
+ /* Clear our internal halted state */ |
1938 |
+- xhci->devs[slot_id]->eps[ep_index].ep_state &= ~EP_HALTED; |
1939 |
++ ep->ep_state &= ~EP_HALTED; |
1940 |
+ } |
1941 |
+ } |
1942 |
+ |
1943 |
+@@ -2352,14 +2385,13 @@ static int handle_tx_event(struct xhci_hcd *xhci, |
1944 |
+ trb_comp_code = GET_COMP_CODE(le32_to_cpu(event->transfer_len)); |
1945 |
+ ep_trb_dma = le64_to_cpu(event->buffer); |
1946 |
+ |
1947 |
+- xdev = xhci->devs[slot_id]; |
1948 |
+- if (!xdev) { |
1949 |
+- xhci_err(xhci, "ERROR Transfer event pointed to bad slot %u\n", |
1950 |
+- slot_id); |
1951 |
++ ep = xhci_get_virt_ep(xhci, slot_id, ep_index); |
1952 |
++ if (!ep) { |
1953 |
++ xhci_err(xhci, "ERROR Invalid Transfer event\n"); |
1954 |
+ goto err_out; |
1955 |
+ } |
1956 |
+ |
1957 |
+- ep = &xdev->eps[ep_index]; |
1958 |
++ xdev = xhci->devs[slot_id]; |
1959 |
+ ep_ring = xhci_dma_to_transfer_ring(ep, ep_trb_dma); |
1960 |
+ ep_ctx = xhci_get_ep_ctx(xhci, xdev->out_ctx, ep_index); |
1961 |
+ |
1962 |
+diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h |
1963 |
+index 8b52a7773bc84..300506de0c7a1 100644 |
1964 |
+--- a/drivers/usb/host/xhci.h |
1965 |
++++ b/drivers/usb/host/xhci.h |
1966 |
+@@ -991,6 +991,7 @@ struct xhci_interval_bw_table { |
1967 |
+ unsigned int ss_bw_out; |
1968 |
+ }; |
1969 |
+ |
1970 |
++#define EP_CTX_PER_DEV 31 |
1971 |
+ |
1972 |
+ struct xhci_virt_device { |
1973 |
+ struct usb_device *udev; |
1974 |
+@@ -1005,7 +1006,7 @@ struct xhci_virt_device { |
1975 |
+ struct xhci_container_ctx *out_ctx; |
1976 |
+ /* Used for addressing devices and configuration changes */ |
1977 |
+ struct xhci_container_ctx *in_ctx; |
1978 |
+- struct xhci_virt_ep eps[31]; |
1979 |
++ struct xhci_virt_ep eps[EP_CTX_PER_DEV]; |
1980 |
+ u8 fake_port; |
1981 |
+ u8 real_port; |
1982 |
+ struct xhci_interval_bw_table *bw_table; |
1983 |
+diff --git a/drivers/usb/renesas_usbhs/fifo.c b/drivers/usb/renesas_usbhs/fifo.c |
1984 |
+index 3637d5edab741..e22aaed652ac6 100644 |
1985 |
+--- a/drivers/usb/renesas_usbhs/fifo.c |
1986 |
++++ b/drivers/usb/renesas_usbhs/fifo.c |
1987 |
+@@ -112,6 +112,8 @@ static struct dma_chan *usbhsf_dma_chan_get(struct usbhs_fifo *fifo, |
1988 |
+ #define usbhsf_dma_map(p) __usbhsf_dma_map_ctrl(p, 1) |
1989 |
+ #define usbhsf_dma_unmap(p) __usbhsf_dma_map_ctrl(p, 0) |
1990 |
+ static int __usbhsf_dma_map_ctrl(struct usbhs_pkt *pkt, int map); |
1991 |
++static void usbhsf_tx_irq_ctrl(struct usbhs_pipe *pipe, int enable); |
1992 |
++static void usbhsf_rx_irq_ctrl(struct usbhs_pipe *pipe, int enable); |
1993 |
+ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt) |
1994 |
+ { |
1995 |
+ struct usbhs_priv *priv = usbhs_pipe_to_priv(pipe); |
1996 |
+@@ -135,6 +137,11 @@ struct usbhs_pkt *usbhs_pkt_pop(struct usbhs_pipe *pipe, struct usbhs_pkt *pkt) |
1997 |
+ dmaengine_terminate_all(chan); |
1998 |
+ usbhsf_fifo_clear(pipe, fifo); |
1999 |
+ usbhsf_dma_unmap(pkt); |
2000 |
++ } else { |
2001 |
++ if (usbhs_pipe_is_dir_in(pipe)) |
2002 |
++ usbhsf_rx_irq_ctrl(pipe, 0); |
2003 |
++ else |
2004 |
++ usbhsf_tx_irq_ctrl(pipe, 0); |
2005 |
+ } |
2006 |
+ |
2007 |
+ usbhs_pipe_running(pipe, 0); |
2008 |
+diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c |
2009 |
+index e15947392f1b5..dd34ea3ef14e7 100644 |
2010 |
+--- a/drivers/usb/serial/cp210x.c |
2011 |
++++ b/drivers/usb/serial/cp210x.c |
2012 |
+@@ -159,6 +159,7 @@ static const struct usb_device_id id_table[] = { |
2013 |
+ { USB_DEVICE(0x10C4, 0x89A4) }, /* CESINEL FTBC Flexible Thyristor Bridge Controller */ |
2014 |
+ { USB_DEVICE(0x10C4, 0x89FB) }, /* Qivicon ZigBee USB Radio Stick */ |
2015 |
+ { USB_DEVICE(0x10C4, 0x8A2A) }, /* HubZ dual ZigBee and Z-Wave dongle */ |
2016 |
++ { USB_DEVICE(0x10C4, 0x8A5B) }, /* CEL EM3588 ZigBee USB Stick */ |
2017 |
+ { USB_DEVICE(0x10C4, 0x8A5E) }, /* CEL EM3588 ZigBee USB Stick Long Range */ |
2018 |
+ { USB_DEVICE(0x10C4, 0x8B34) }, /* Qivicon ZigBee USB Radio Stick */ |
2019 |
+ { USB_DEVICE(0x10C4, 0xEA60) }, /* Silicon Labs factory default */ |
2020 |
+@@ -206,8 +207,8 @@ static const struct usb_device_id id_table[] = { |
2021 |
+ { USB_DEVICE(0x1901, 0x0194) }, /* GE Healthcare Remote Alarm Box */ |
2022 |
+ { USB_DEVICE(0x1901, 0x0195) }, /* GE B850/B650/B450 CP2104 DP UART interface */ |
2023 |
+ { USB_DEVICE(0x1901, 0x0196) }, /* GE B850 CP2105 DP UART interface */ |
2024 |
+- { USB_DEVICE(0x1901, 0x0197) }, /* GE CS1000 Display serial interface */ |
2025 |
+- { USB_DEVICE(0x1901, 0x0198) }, /* GE CS1000 M.2 Key E serial interface */ |
2026 |
++ { USB_DEVICE(0x1901, 0x0197) }, /* GE CS1000 M.2 Key E serial interface */ |
2027 |
++ { USB_DEVICE(0x1901, 0x0198) }, /* GE CS1000 Display serial interface */ |
2028 |
+ { USB_DEVICE(0x199B, 0xBA30) }, /* LORD WSDA-200-USB */ |
2029 |
+ { USB_DEVICE(0x19CF, 0x3000) }, /* Parrot NMEA GPS Flight Recorder */ |
2030 |
+ { USB_DEVICE(0x1ADB, 0x0001) }, /* Schweitzer Engineering C662 Cable */ |
2031 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
2032 |
+index ea8288e40fd9f..fa9e3a2ddd01a 100644 |
2033 |
+--- a/drivers/usb/serial/option.c |
2034 |
++++ b/drivers/usb/serial/option.c |
2035 |
+@@ -241,6 +241,7 @@ static void option_instat_callback(struct urb *urb); |
2036 |
+ #define QUECTEL_PRODUCT_UC15 0x9090 |
2037 |
+ /* These u-blox products use Qualcomm's vendor ID */ |
2038 |
+ #define UBLOX_PRODUCT_R410M 0x90b2 |
2039 |
++#define UBLOX_PRODUCT_R6XX 0x90fa |
2040 |
+ /* These Yuga products use Qualcomm's vendor ID */ |
2041 |
+ #define YUGA_PRODUCT_CLM920_NC5 0x9625 |
2042 |
+ |
2043 |
+@@ -1104,6 +1105,8 @@ static const struct usb_device_id option_ids[] = { |
2044 |
+ /* u-blox products using Qualcomm vendor ID */ |
2045 |
+ { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R410M), |
2046 |
+ .driver_info = RSVD(1) | RSVD(3) }, |
2047 |
++ { USB_DEVICE(QUALCOMM_VENDOR_ID, UBLOX_PRODUCT_R6XX), |
2048 |
++ .driver_info = RSVD(3) }, |
2049 |
+ /* Quectel products using Quectel vendor ID */ |
2050 |
+ { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC21, 0xff, 0xff, 0xff), |
2051 |
+ .driver_info = NUMEP2 }, |
2052 |
+diff --git a/drivers/usb/storage/unusual_uas.h b/drivers/usb/storage/unusual_uas.h |
2053 |
+index 5705201e5707c..6f57fb0614fe3 100644 |
2054 |
+--- a/drivers/usb/storage/unusual_uas.h |
2055 |
++++ b/drivers/usb/storage/unusual_uas.h |
2056 |
+@@ -58,6 +58,13 @@ UNUSUAL_DEV(0x059f, 0x105f, 0x0000, 0x9999, |
2057 |
+ USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
2058 |
+ US_FL_NO_REPORT_OPCODES | US_FL_NO_SAME), |
2059 |
+ |
2060 |
++/* Reported-by: Julian Sikorski <belegdol@×××××.com> */ |
2061 |
++UNUSUAL_DEV(0x059f, 0x1061, 0x0000, 0x9999, |
2062 |
++ "LaCie", |
2063 |
++ "Rugged USB3-FW", |
2064 |
++ USB_SC_DEVICE, USB_PR_DEVICE, NULL, |
2065 |
++ US_FL_IGNORE_UAS), |
2066 |
++ |
2067 |
+ /* |
2068 |
+ * Apricorn USB3 dongle sometimes returns "USBSUSBSUSBS" in response to SCSI |
2069 |
+ * commands in UAS mode. Observed with the 1.28 firmware; are there others? |
2070 |
+diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c |
2071 |
+index 9769a5db7d5e9..7ca0fafcd5a60 100644 |
2072 |
+--- a/fs/btrfs/inode.c |
2073 |
++++ b/fs/btrfs/inode.c |
2074 |
+@@ -540,7 +540,7 @@ again: |
2075 |
+ * inode has not been flagged as nocompress. This flag can |
2076 |
+ * change at any time if we discover bad compression ratios. |
2077 |
+ */ |
2078 |
+- if (inode_need_compress(inode, start, end)) { |
2079 |
++ if (nr_pages > 1 && inode_need_compress(inode, start, end)) { |
2080 |
+ WARN_ON(pages); |
2081 |
+ pages = kcalloc(nr_pages, sizeof(struct page *), GFP_NOFS); |
2082 |
+ if (!pages) { |
2083 |
+diff --git a/fs/proc/base.c b/fs/proc/base.c |
2084 |
+index 005d4cb2347ef..5f68454cf421c 100644 |
2085 |
+--- a/fs/proc/base.c |
2086 |
++++ b/fs/proc/base.c |
2087 |
+@@ -841,7 +841,7 @@ static ssize_t mem_rw(struct file *file, char __user *buf, |
2088 |
+ flags = FOLL_FORCE | (write ? FOLL_WRITE : 0); |
2089 |
+ |
2090 |
+ while (count > 0) { |
2091 |
+- int this_len = min_t(int, count, PAGE_SIZE); |
2092 |
++ size_t this_len = min_t(size_t, count, PAGE_SIZE); |
2093 |
+ |
2094 |
+ if (write && copy_from_user(page, buf, this_len)) { |
2095 |
+ copied = -EFAULT; |
2096 |
+diff --git a/include/drm/drm_ioctl.h b/include/drm/drm_ioctl.h |
2097 |
+index add42809642ae..d9df199333fd3 100644 |
2098 |
+--- a/include/drm/drm_ioctl.h |
2099 |
++++ b/include/drm/drm_ioctl.h |
2100 |
+@@ -68,6 +68,7 @@ typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, |
2101 |
+ unsigned long arg); |
2102 |
+ |
2103 |
+ #define DRM_IOCTL_NR(n) _IOC_NR(n) |
2104 |
++#define DRM_IOCTL_TYPE(n) _IOC_TYPE(n) |
2105 |
+ #define DRM_MAJOR 226 |
2106 |
+ |
2107 |
+ /** |
2108 |
+diff --git a/include/net/dst_metadata.h b/include/net/dst_metadata.h |
2109 |
+index 91bc7bdf6bf54..0b3c2aaed3c82 100644 |
2110 |
+--- a/include/net/dst_metadata.h |
2111 |
++++ b/include/net/dst_metadata.h |
2112 |
+@@ -44,7 +44,9 @@ static inline struct ip_tunnel_info *skb_tunnel_info(struct sk_buff *skb) |
2113 |
+ return &md_dst->u.tun_info; |
2114 |
+ |
2115 |
+ dst = skb_dst(skb); |
2116 |
+- if (dst && dst->lwtstate) |
2117 |
++ if (dst && dst->lwtstate && |
2118 |
++ (dst->lwtstate->type == LWTUNNEL_ENCAP_IP || |
2119 |
++ dst->lwtstate->type == LWTUNNEL_ENCAP_IP6)) |
2120 |
+ return lwt_tun_info(dst->lwtstate); |
2121 |
+ |
2122 |
+ return NULL; |
2123 |
+diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h |
2124 |
+index 9f7f81117434b..34139bc9a8538 100644 |
2125 |
+--- a/include/net/ip6_route.h |
2126 |
++++ b/include/net/ip6_route.h |
2127 |
+@@ -214,7 +214,7 @@ static inline bool ipv6_anycast_destination(const struct dst_entry *dst, |
2128 |
+ int ip6_fragment(struct net *net, struct sock *sk, struct sk_buff *skb, |
2129 |
+ int (*output)(struct net *, struct sock *, struct sk_buff *)); |
2130 |
+ |
2131 |
+-static inline int ip6_skb_dst_mtu(struct sk_buff *skb) |
2132 |
++static inline unsigned int ip6_skb_dst_mtu(struct sk_buff *skb) |
2133 |
+ { |
2134 |
+ struct ipv6_pinfo *np = skb->sk && !dev_recursion_level() ? |
2135 |
+ inet6_sk(skb->sk) : NULL; |
2136 |
+diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c |
2137 |
+index 37ac76dce9089..3ff60230710c9 100644 |
2138 |
+--- a/kernel/sched/fair.c |
2139 |
++++ b/kernel/sched/fair.c |
2140 |
+@@ -4464,7 +4464,7 @@ static const u64 cfs_bandwidth_slack_period = 5 * NSEC_PER_MSEC; |
2141 |
+ static int runtime_refresh_within(struct cfs_bandwidth *cfs_b, u64 min_expire) |
2142 |
+ { |
2143 |
+ struct hrtimer *refresh_timer = &cfs_b->period_timer; |
2144 |
+- u64 remaining; |
2145 |
++ s64 remaining; |
2146 |
+ |
2147 |
+ /* if the call-back is running a quota refresh is already occurring */ |
2148 |
+ if (hrtimer_callback_running(refresh_timer)) |
2149 |
+@@ -4472,7 +4472,7 @@ static int runtime_refresh_within(struct cfs_bandwidth *cfs_b, u64 min_expire) |
2150 |
+ |
2151 |
+ /* is a quota refresh about to occur? */ |
2152 |
+ remaining = ktime_to_ns(hrtimer_expires_remaining(refresh_timer)); |
2153 |
+- if (remaining < min_expire) |
2154 |
++ if (remaining < (s64)min_expire) |
2155 |
+ return 1; |
2156 |
+ |
2157 |
+ return 0; |
2158 |
+diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c |
2159 |
+index d929c0afbacca..359f44cee08ac 100644 |
2160 |
+--- a/kernel/trace/ring_buffer.c |
2161 |
++++ b/kernel/trace/ring_buffer.c |
2162 |
+@@ -3054,10 +3054,30 @@ static bool rb_per_cpu_empty(struct ring_buffer_per_cpu *cpu_buffer) |
2163 |
+ if (unlikely(!head)) |
2164 |
+ return true; |
2165 |
+ |
2166 |
+- return reader->read == rb_page_commit(reader) && |
2167 |
+- (commit == reader || |
2168 |
+- (commit == head && |
2169 |
+- head->read == rb_page_commit(commit))); |
2170 |
++ /* Reader should exhaust content in reader page */ |
2171 |
++ if (reader->read != rb_page_commit(reader)) |
2172 |
++ return false; |
2173 |
++ |
2174 |
++ /* |
2175 |
++ * If writers are committing on the reader page, knowing all |
2176 |
++ * committed content has been read, the ring buffer is empty. |
2177 |
++ */ |
2178 |
++ if (commit == reader) |
2179 |
++ return true; |
2180 |
++ |
2181 |
++ /* |
2182 |
++ * If writers are committing on a page other than reader page |
2183 |
++ * and head page, there should always be content to read. |
2184 |
++ */ |
2185 |
++ if (commit != head) |
2186 |
++ return false; |
2187 |
++ |
2188 |
++ /* |
2189 |
++ * Writers are committing on the head page, we just need |
2190 |
++ * to care about there're committed data, and the reader will |
2191 |
++ * swap reader page with head page when it is to read data. |
2192 |
++ */ |
2193 |
++ return rb_page_commit(commit) == 0; |
2194 |
+ } |
2195 |
+ |
2196 |
+ /** |
2197 |
+diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c |
2198 |
+index d9156eabddb88..9a36592cf20f1 100644 |
2199 |
+--- a/net/bridge/br_if.c |
2200 |
++++ b/net/bridge/br_if.c |
2201 |
+@@ -485,7 +485,7 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) |
2202 |
+ struct net_bridge_port *p; |
2203 |
+ int err = 0; |
2204 |
+ unsigned br_hr, dev_hr; |
2205 |
+- bool changed_addr; |
2206 |
++ bool changed_addr, fdb_synced = false; |
2207 |
+ |
2208 |
+ /* Don't allow bridging non-ethernet like devices, or DSA-enabled |
2209 |
+ * master network devices since the bridge layer rx_handler prevents |
2210 |
+@@ -555,6 +555,19 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) |
2211 |
+ list_add_rcu(&p->list, &br->port_list); |
2212 |
+ |
2213 |
+ nbp_update_port_count(br); |
2214 |
++ if (!br_promisc_port(p) && (p->dev->priv_flags & IFF_UNICAST_FLT)) { |
2215 |
++ /* When updating the port count we also update all ports' |
2216 |
++ * promiscuous mode. |
2217 |
++ * A port leaving promiscuous mode normally gets the bridge's |
2218 |
++ * fdb synced to the unicast filter (if supported), however, |
2219 |
++ * `br_port_clear_promisc` does not distinguish between |
2220 |
++ * non-promiscuous ports and *new* ports, so we need to |
2221 |
++ * sync explicitly here. |
2222 |
++ */ |
2223 |
++ fdb_synced = br_fdb_sync_static(br, p) == 0; |
2224 |
++ if (!fdb_synced) |
2225 |
++ netdev_err(dev, "failed to sync bridge static fdb addresses to this port\n"); |
2226 |
++ } |
2227 |
+ |
2228 |
+ netdev_update_features(br->dev); |
2229 |
+ |
2230 |
+@@ -595,6 +608,8 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) |
2231 |
+ return 0; |
2232 |
+ |
2233 |
+ err7: |
2234 |
++ if (fdb_synced) |
2235 |
++ br_fdb_unsync_static(br, p); |
2236 |
+ list_del_rcu(&p->list); |
2237 |
+ br_fdb_delete_by_port(br, p, 0, 1); |
2238 |
+ nbp_update_port_count(br); |
2239 |
+diff --git a/net/caif/caif_socket.c b/net/caif/caif_socket.c |
2240 |
+index df936d2f58bdd..c44ade1b18335 100644 |
2241 |
+--- a/net/caif/caif_socket.c |
2242 |
++++ b/net/caif/caif_socket.c |
2243 |
+@@ -539,7 +539,8 @@ static int caif_seqpkt_sendmsg(struct socket *sock, struct msghdr *msg, |
2244 |
+ goto err; |
2245 |
+ |
2246 |
+ ret = -EINVAL; |
2247 |
+- if (unlikely(msg->msg_iter.iov->iov_base == NULL)) |
2248 |
++ if (unlikely(msg->msg_iter.nr_segs == 0) || |
2249 |
++ unlikely(msg->msg_iter.iov->iov_base == NULL)) |
2250 |
+ goto err; |
2251 |
+ noblock = msg->msg_flags & MSG_DONTWAIT; |
2252 |
+ |
2253 |
+diff --git a/net/decnet/af_decnet.c b/net/decnet/af_decnet.c |
2254 |
+index 8dbfcd3886339..9c7b8ff4556a7 100644 |
2255 |
+--- a/net/decnet/af_decnet.c |
2256 |
++++ b/net/decnet/af_decnet.c |
2257 |
+@@ -824,7 +824,7 @@ static int dn_auto_bind(struct socket *sock) |
2258 |
+ static int dn_confirm_accept(struct sock *sk, long *timeo, gfp_t allocation) |
2259 |
+ { |
2260 |
+ struct dn_scp *scp = DN_SK(sk); |
2261 |
+- DEFINE_WAIT(wait); |
2262 |
++ DEFINE_WAIT_FUNC(wait, woken_wake_function); |
2263 |
+ int err; |
2264 |
+ |
2265 |
+ if (scp->state != DN_CR) |
2266 |
+@@ -834,11 +834,11 @@ static int dn_confirm_accept(struct sock *sk, long *timeo, gfp_t allocation) |
2267 |
+ scp->segsize_loc = dst_metric_advmss(__sk_dst_get(sk)); |
2268 |
+ dn_send_conn_conf(sk, allocation); |
2269 |
+ |
2270 |
+- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
2271 |
++ add_wait_queue(sk_sleep(sk), &wait); |
2272 |
+ for(;;) { |
2273 |
+ release_sock(sk); |
2274 |
+ if (scp->state == DN_CC) |
2275 |
+- *timeo = schedule_timeout(*timeo); |
2276 |
++ *timeo = wait_woken(&wait, TASK_INTERRUPTIBLE, *timeo); |
2277 |
+ lock_sock(sk); |
2278 |
+ err = 0; |
2279 |
+ if (scp->state == DN_RUN) |
2280 |
+@@ -852,9 +852,8 @@ static int dn_confirm_accept(struct sock *sk, long *timeo, gfp_t allocation) |
2281 |
+ err = -EAGAIN; |
2282 |
+ if (!*timeo) |
2283 |
+ break; |
2284 |
+- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
2285 |
+ } |
2286 |
+- finish_wait(sk_sleep(sk), &wait); |
2287 |
++ remove_wait_queue(sk_sleep(sk), &wait); |
2288 |
+ if (err == 0) { |
2289 |
+ sk->sk_socket->state = SS_CONNECTED; |
2290 |
+ } else if (scp->state != DN_CC) { |
2291 |
+@@ -866,7 +865,7 @@ static int dn_confirm_accept(struct sock *sk, long *timeo, gfp_t allocation) |
2292 |
+ static int dn_wait_run(struct sock *sk, long *timeo) |
2293 |
+ { |
2294 |
+ struct dn_scp *scp = DN_SK(sk); |
2295 |
+- DEFINE_WAIT(wait); |
2296 |
++ DEFINE_WAIT_FUNC(wait, woken_wake_function); |
2297 |
+ int err = 0; |
2298 |
+ |
2299 |
+ if (scp->state == DN_RUN) |
2300 |
+@@ -875,11 +874,11 @@ static int dn_wait_run(struct sock *sk, long *timeo) |
2301 |
+ if (!*timeo) |
2302 |
+ return -EALREADY; |
2303 |
+ |
2304 |
+- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
2305 |
++ add_wait_queue(sk_sleep(sk), &wait); |
2306 |
+ for(;;) { |
2307 |
+ release_sock(sk); |
2308 |
+ if (scp->state == DN_CI || scp->state == DN_CC) |
2309 |
+- *timeo = schedule_timeout(*timeo); |
2310 |
++ *timeo = wait_woken(&wait, TASK_INTERRUPTIBLE, *timeo); |
2311 |
+ lock_sock(sk); |
2312 |
+ err = 0; |
2313 |
+ if (scp->state == DN_RUN) |
2314 |
+@@ -893,9 +892,8 @@ static int dn_wait_run(struct sock *sk, long *timeo) |
2315 |
+ err = -ETIMEDOUT; |
2316 |
+ if (!*timeo) |
2317 |
+ break; |
2318 |
+- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
2319 |
+ } |
2320 |
+- finish_wait(sk_sleep(sk), &wait); |
2321 |
++ remove_wait_queue(sk_sleep(sk), &wait); |
2322 |
+ out: |
2323 |
+ if (err == 0) { |
2324 |
+ sk->sk_socket->state = SS_CONNECTED; |
2325 |
+@@ -1040,16 +1038,16 @@ static void dn_user_copy(struct sk_buff *skb, struct optdata_dn *opt) |
2326 |
+ |
2327 |
+ static struct sk_buff *dn_wait_for_connect(struct sock *sk, long *timeo) |
2328 |
+ { |
2329 |
+- DEFINE_WAIT(wait); |
2330 |
++ DEFINE_WAIT_FUNC(wait, woken_wake_function); |
2331 |
+ struct sk_buff *skb = NULL; |
2332 |
+ int err = 0; |
2333 |
+ |
2334 |
+- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
2335 |
++ add_wait_queue(sk_sleep(sk), &wait); |
2336 |
+ for(;;) { |
2337 |
+ release_sock(sk); |
2338 |
+ skb = skb_dequeue(&sk->sk_receive_queue); |
2339 |
+ if (skb == NULL) { |
2340 |
+- *timeo = schedule_timeout(*timeo); |
2341 |
++ *timeo = wait_woken(&wait, TASK_INTERRUPTIBLE, *timeo); |
2342 |
+ skb = skb_dequeue(&sk->sk_receive_queue); |
2343 |
+ } |
2344 |
+ lock_sock(sk); |
2345 |
+@@ -1064,9 +1062,8 @@ static struct sk_buff *dn_wait_for_connect(struct sock *sk, long *timeo) |
2346 |
+ err = -EAGAIN; |
2347 |
+ if (!*timeo) |
2348 |
+ break; |
2349 |
+- prepare_to_wait(sk_sleep(sk), &wait, TASK_INTERRUPTIBLE); |
2350 |
+ } |
2351 |
+- finish_wait(sk_sleep(sk), &wait); |
2352 |
++ remove_wait_queue(sk_sleep(sk), &wait); |
2353 |
+ |
2354 |
+ return skb == NULL ? ERR_PTR(err) : skb; |
2355 |
+ } |
2356 |
+diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c |
2357 |
+index d01c34e95016f..146a137ee7ef6 100644 |
2358 |
+--- a/net/ipv4/tcp_ipv4.c |
2359 |
++++ b/net/ipv4/tcp_ipv4.c |
2360 |
+@@ -285,7 +285,7 @@ void tcp_v4_mtu_reduced(struct sock *sk) |
2361 |
+ |
2362 |
+ if ((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) |
2363 |
+ return; |
2364 |
+- mtu = tcp_sk(sk)->mtu_info; |
2365 |
++ mtu = READ_ONCE(tcp_sk(sk)->mtu_info); |
2366 |
+ dst = inet_csk_update_pmtu(sk, mtu); |
2367 |
+ if (!dst) |
2368 |
+ return; |
2369 |
+@@ -453,7 +453,7 @@ void tcp_v4_err(struct sk_buff *icmp_skb, u32 info) |
2370 |
+ if (sk->sk_state == TCP_LISTEN) |
2371 |
+ goto out; |
2372 |
+ |
2373 |
+- tp->mtu_info = info; |
2374 |
++ WRITE_ONCE(tp->mtu_info, info); |
2375 |
+ if (!sock_owned_by_user(sk)) { |
2376 |
+ tcp_v4_mtu_reduced(sk); |
2377 |
+ } else { |
2378 |
+diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c |
2379 |
+index 90827c386b5bc..99ab936a9cd30 100644 |
2380 |
+--- a/net/ipv4/tcp_output.c |
2381 |
++++ b/net/ipv4/tcp_output.c |
2382 |
+@@ -1470,6 +1470,7 @@ int tcp_mtu_to_mss(struct sock *sk, int pmtu) |
2383 |
+ return __tcp_mtu_to_mss(sk, pmtu) - |
2384 |
+ (tcp_sk(sk)->tcp_header_len - sizeof(struct tcphdr)); |
2385 |
+ } |
2386 |
++EXPORT_SYMBOL(tcp_mtu_to_mss); |
2387 |
+ |
2388 |
+ /* Inverse of above */ |
2389 |
+ int tcp_mss_to_mtu(struct sock *sk, int mss) |
2390 |
+diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c |
2391 |
+index 037958ccc9f57..0f0772c48bf08 100644 |
2392 |
+--- a/net/ipv6/tcp_ipv6.c |
2393 |
++++ b/net/ipv6/tcp_ipv6.c |
2394 |
+@@ -319,11 +319,20 @@ failure: |
2395 |
+ static void tcp_v6_mtu_reduced(struct sock *sk) |
2396 |
+ { |
2397 |
+ struct dst_entry *dst; |
2398 |
++ u32 mtu; |
2399 |
+ |
2400 |
+ if ((1 << sk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) |
2401 |
+ return; |
2402 |
+ |
2403 |
+- dst = inet6_csk_update_pmtu(sk, tcp_sk(sk)->mtu_info); |
2404 |
++ mtu = READ_ONCE(tcp_sk(sk)->mtu_info); |
2405 |
++ |
2406 |
++ /* Drop requests trying to increase our current mss. |
2407 |
++ * Check done in __ip6_rt_update_pmtu() is too late. |
2408 |
++ */ |
2409 |
++ if (tcp_mtu_to_mss(sk, mtu) >= tcp_sk(sk)->mss_cache) |
2410 |
++ return; |
2411 |
++ |
2412 |
++ dst = inet6_csk_update_pmtu(sk, mtu); |
2413 |
+ if (!dst) |
2414 |
+ return; |
2415 |
+ |
2416 |
+@@ -402,6 +411,8 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
2417 |
+ } |
2418 |
+ |
2419 |
+ if (type == ICMPV6_PKT_TOOBIG) { |
2420 |
++ u32 mtu = ntohl(info); |
2421 |
++ |
2422 |
+ /* We are not interested in TCP_LISTEN and open_requests |
2423 |
+ * (SYN-ACKs send out by Linux are always <576bytes so |
2424 |
+ * they should go through unfragmented). |
2425 |
+@@ -412,7 +423,11 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt, |
2426 |
+ if (!ip6_sk_accept_pmtu(sk)) |
2427 |
+ goto out; |
2428 |
+ |
2429 |
+- tp->mtu_info = ntohl(info); |
2430 |
++ if (mtu < IPV6_MIN_MTU) |
2431 |
++ goto out; |
2432 |
++ |
2433 |
++ WRITE_ONCE(tp->mtu_info, mtu); |
2434 |
++ |
2435 |
+ if (!sock_owned_by_user(sk)) |
2436 |
+ tcp_v6_mtu_reduced(sk); |
2437 |
+ else if (!test_and_set_bit(TCP_MTU_REDUCED_DEFERRED, |
2438 |
+@@ -486,7 +501,8 @@ static int tcp_v6_send_synack(const struct sock *sk, struct dst_entry *dst, |
2439 |
+ opt = ireq->ipv6_opt; |
2440 |
+ if (!opt) |
2441 |
+ opt = rcu_dereference(np->opt); |
2442 |
+- err = ip6_xmit(sk, skb, fl6, sk->sk_mark, opt, np->tclass); |
2443 |
++ err = ip6_xmit(sk, skb, fl6, skb->mark ? : sk->sk_mark, opt, |
2444 |
++ np->tclass); |
2445 |
+ rcu_read_unlock(); |
2446 |
+ err = net_xmit_eval(err); |
2447 |
+ } |
2448 |
+diff --git a/net/ipv6/xfrm6_output.c b/net/ipv6/xfrm6_output.c |
2449 |
+index aff901be53539..276280d1e3dae 100644 |
2450 |
+--- a/net/ipv6/xfrm6_output.c |
2451 |
++++ b/net/ipv6/xfrm6_output.c |
2452 |
+@@ -146,7 +146,7 @@ static int __xfrm6_output(struct net *net, struct sock *sk, struct sk_buff *skb) |
2453 |
+ { |
2454 |
+ struct dst_entry *dst = skb_dst(skb); |
2455 |
+ struct xfrm_state *x = dst->xfrm; |
2456 |
+- int mtu; |
2457 |
++ unsigned int mtu; |
2458 |
+ bool toobig; |
2459 |
+ |
2460 |
+ #ifdef CONFIG_NETFILTER |
2461 |
+diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c |
2462 |
+index a83147f701da4..b084659bd34bc 100644 |
2463 |
+--- a/net/netfilter/nf_conntrack_netlink.c |
2464 |
++++ b/net/netfilter/nf_conntrack_netlink.c |
2465 |
+@@ -196,6 +196,7 @@ static int ctnetlink_dump_helpinfo(struct sk_buff *skb, |
2466 |
+ if (!help) |
2467 |
+ return 0; |
2468 |
+ |
2469 |
++ rcu_read_lock(); |
2470 |
+ helper = rcu_dereference(help->helper); |
2471 |
+ if (!helper) |
2472 |
+ goto out; |
2473 |
+@@ -211,9 +212,11 @@ static int ctnetlink_dump_helpinfo(struct sk_buff *skb, |
2474 |
+ |
2475 |
+ nla_nest_end(skb, nest_helper); |
2476 |
+ out: |
2477 |
++ rcu_read_unlock(); |
2478 |
+ return 0; |
2479 |
+ |
2480 |
+ nla_put_failure: |
2481 |
++ rcu_read_unlock(); |
2482 |
+ return -1; |
2483 |
+ } |
2484 |
+ |
2485 |
+diff --git a/net/netrom/nr_timer.c b/net/netrom/nr_timer.c |
2486 |
+index f0ecaec1ff3da..d1a0b70567432 100644 |
2487 |
+--- a/net/netrom/nr_timer.c |
2488 |
++++ b/net/netrom/nr_timer.c |
2489 |
+@@ -125,11 +125,9 @@ static void nr_heartbeat_expiry(unsigned long param) |
2490 |
+ is accepted() it isn't 'dead' so doesn't get removed. */ |
2491 |
+ if (sock_flag(sk, SOCK_DESTROY) || |
2492 |
+ (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) { |
2493 |
+- sock_hold(sk); |
2494 |
+ bh_unlock_sock(sk); |
2495 |
+ nr_destroy_socket(sk); |
2496 |
+- sock_put(sk); |
2497 |
+- return; |
2498 |
++ goto out; |
2499 |
+ } |
2500 |
+ break; |
2501 |
+ |
2502 |
+@@ -150,6 +148,8 @@ static void nr_heartbeat_expiry(unsigned long param) |
2503 |
+ |
2504 |
+ nr_start_heartbeat(sk); |
2505 |
+ bh_unlock_sock(sk); |
2506 |
++out: |
2507 |
++ sock_put(sk); |
2508 |
+ } |
2509 |
+ |
2510 |
+ static void nr_t2timer_expiry(unsigned long param) |
2511 |
+@@ -163,6 +163,7 @@ static void nr_t2timer_expiry(unsigned long param) |
2512 |
+ nr_enquiry_response(sk); |
2513 |
+ } |
2514 |
+ bh_unlock_sock(sk); |
2515 |
++ sock_put(sk); |
2516 |
+ } |
2517 |
+ |
2518 |
+ static void nr_t4timer_expiry(unsigned long param) |
2519 |
+@@ -172,6 +173,7 @@ static void nr_t4timer_expiry(unsigned long param) |
2520 |
+ bh_lock_sock(sk); |
2521 |
+ nr_sk(sk)->condition &= ~NR_COND_PEER_RX_BUSY; |
2522 |
+ bh_unlock_sock(sk); |
2523 |
++ sock_put(sk); |
2524 |
+ } |
2525 |
+ |
2526 |
+ static void nr_idletimer_expiry(unsigned long param) |
2527 |
+@@ -200,6 +202,7 @@ static void nr_idletimer_expiry(unsigned long param) |
2528 |
+ sock_set_flag(sk, SOCK_DEAD); |
2529 |
+ } |
2530 |
+ bh_unlock_sock(sk); |
2531 |
++ sock_put(sk); |
2532 |
+ } |
2533 |
+ |
2534 |
+ static void nr_t1timer_expiry(unsigned long param) |
2535 |
+@@ -212,8 +215,7 @@ static void nr_t1timer_expiry(unsigned long param) |
2536 |
+ case NR_STATE_1: |
2537 |
+ if (nr->n2count == nr->n2) { |
2538 |
+ nr_disconnect(sk, ETIMEDOUT); |
2539 |
+- bh_unlock_sock(sk); |
2540 |
+- return; |
2541 |
++ goto out; |
2542 |
+ } else { |
2543 |
+ nr->n2count++; |
2544 |
+ nr_write_internal(sk, NR_CONNREQ); |
2545 |
+@@ -223,8 +225,7 @@ static void nr_t1timer_expiry(unsigned long param) |
2546 |
+ case NR_STATE_2: |
2547 |
+ if (nr->n2count == nr->n2) { |
2548 |
+ nr_disconnect(sk, ETIMEDOUT); |
2549 |
+- bh_unlock_sock(sk); |
2550 |
+- return; |
2551 |
++ goto out; |
2552 |
+ } else { |
2553 |
+ nr->n2count++; |
2554 |
+ nr_write_internal(sk, NR_DISCREQ); |
2555 |
+@@ -234,8 +235,7 @@ static void nr_t1timer_expiry(unsigned long param) |
2556 |
+ case NR_STATE_3: |
2557 |
+ if (nr->n2count == nr->n2) { |
2558 |
+ nr_disconnect(sk, ETIMEDOUT); |
2559 |
+- bh_unlock_sock(sk); |
2560 |
+- return; |
2561 |
++ goto out; |
2562 |
+ } else { |
2563 |
+ nr->n2count++; |
2564 |
+ nr_requeue_frames(sk); |
2565 |
+@@ -244,5 +244,7 @@ static void nr_t1timer_expiry(unsigned long param) |
2566 |
+ } |
2567 |
+ |
2568 |
+ nr_start_t1timer(sk); |
2569 |
++out: |
2570 |
+ bh_unlock_sock(sk); |
2571 |
++ sock_put(sk); |
2572 |
+ } |
2573 |
+diff --git a/scripts/mkcompile_h b/scripts/mkcompile_h |
2574 |
+index 959199c3147ec..49f92fffa0984 100755 |
2575 |
+--- a/scripts/mkcompile_h |
2576 |
++++ b/scripts/mkcompile_h |
2577 |
+@@ -83,15 +83,23 @@ UTS_TRUNCATE="cut -b -$UTS_LEN" |
2578 |
+ # Only replace the real compile.h if the new one is different, |
2579 |
+ # in order to preserve the timestamp and avoid unnecessary |
2580 |
+ # recompilations. |
2581 |
+-# We don't consider the file changed if only the date/time changed. |
2582 |
++# We don't consider the file changed if only the date/time changed, |
2583 |
++# unless KBUILD_BUILD_TIMESTAMP was explicitly set (e.g. for |
2584 |
++# reproducible builds with that value referring to a commit timestamp). |
2585 |
+ # A kernel config change will increase the generation number, thus |
2586 |
+ # causing compile.h to be updated (including date/time) due to the |
2587 |
+ # changed comment in the |
2588 |
+ # first line. |
2589 |
+ |
2590 |
++if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; then |
2591 |
++ IGNORE_PATTERN="UTS_VERSION" |
2592 |
++else |
2593 |
++ IGNORE_PATTERN="NOT_A_PATTERN_TO_BE_MATCHED" |
2594 |
++fi |
2595 |
++ |
2596 |
+ if [ -r $TARGET ] && \ |
2597 |
+- grep -v 'UTS_VERSION' $TARGET > .tmpver.1 && \ |
2598 |
+- grep -v 'UTS_VERSION' .tmpcompile > .tmpver.2 && \ |
2599 |
++ grep -v $IGNORE_PATTERN $TARGET > .tmpver.1 && \ |
2600 |
++ grep -v $IGNORE_PATTERN .tmpcompile > .tmpver.2 && \ |
2601 |
+ cmp -s .tmpver.1 .tmpver.2; then |
2602 |
+ rm -f .tmpcompile |
2603 |
+ else |
2604 |
+diff --git a/sound/isa/sb/sb16_csp.c b/sound/isa/sb/sb16_csp.c |
2605 |
+index 69f392cf67b6c..00d059412c8a7 100644 |
2606 |
+--- a/sound/isa/sb/sb16_csp.c |
2607 |
++++ b/sound/isa/sb/sb16_csp.c |
2608 |
+@@ -828,6 +828,7 @@ static int snd_sb_csp_start(struct snd_sb_csp * p, int sample_width, int channel |
2609 |
+ mixR = snd_sbmixer_read(p->chip, SB_DSP4_PCM_DEV + 1); |
2610 |
+ snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV, mixL & 0x7); |
2611 |
+ snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV + 1, mixR & 0x7); |
2612 |
++ spin_unlock_irqrestore(&p->chip->mixer_lock, flags); |
2613 |
+ |
2614 |
+ spin_lock(&p->chip->reg_lock); |
2615 |
+ set_mode_register(p->chip, 0xc0); /* c0 = STOP */ |
2616 |
+@@ -867,6 +868,7 @@ static int snd_sb_csp_start(struct snd_sb_csp * p, int sample_width, int channel |
2617 |
+ spin_unlock(&p->chip->reg_lock); |
2618 |
+ |
2619 |
+ /* restore PCM volume */ |
2620 |
++ spin_lock_irqsave(&p->chip->mixer_lock, flags); |
2621 |
+ snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV, mixL); |
2622 |
+ snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV + 1, mixR); |
2623 |
+ spin_unlock_irqrestore(&p->chip->mixer_lock, flags); |
2624 |
+@@ -892,6 +894,7 @@ static int snd_sb_csp_stop(struct snd_sb_csp * p) |
2625 |
+ mixR = snd_sbmixer_read(p->chip, SB_DSP4_PCM_DEV + 1); |
2626 |
+ snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV, mixL & 0x7); |
2627 |
+ snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV + 1, mixR & 0x7); |
2628 |
++ spin_unlock_irqrestore(&p->chip->mixer_lock, flags); |
2629 |
+ |
2630 |
+ spin_lock(&p->chip->reg_lock); |
2631 |
+ if (p->running & SNDRV_SB_CSP_ST_QSOUND) { |
2632 |
+@@ -906,6 +909,7 @@ static int snd_sb_csp_stop(struct snd_sb_csp * p) |
2633 |
+ spin_unlock(&p->chip->reg_lock); |
2634 |
+ |
2635 |
+ /* restore PCM volume */ |
2636 |
++ spin_lock_irqsave(&p->chip->mixer_lock, flags); |
2637 |
+ snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV, mixL); |
2638 |
+ snd_sbmixer_write(p->chip, SB_DSP4_PCM_DEV + 1, mixR); |
2639 |
+ spin_unlock_irqrestore(&p->chip->mixer_lock, flags); |
2640 |
+diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c |
2641 |
+index 34c22cdf4d5d9..3fc7fd779c271 100644 |
2642 |
+--- a/tools/perf/tests/bpf.c |
2643 |
++++ b/tools/perf/tests/bpf.c |
2644 |
+@@ -1,5 +1,6 @@ |
2645 |
+ #include <errno.h> |
2646 |
+ #include <stdio.h> |
2647 |
++#include <stdlib.h> |
2648 |
+ #include <sys/epoll.h> |
2649 |
+ #include <sys/types.h> |
2650 |
+ #include <sys/stat.h> |
2651 |
+@@ -275,6 +276,7 @@ static int __test__bpf(int idx) |
2652 |
+ } |
2653 |
+ |
2654 |
+ out: |
2655 |
++ free(obj_buf); |
2656 |
+ bpf__clear(); |
2657 |
+ return ret; |
2658 |
+ } |
2659 |
+diff --git a/tools/perf/util/lzma.c b/tools/perf/util/lzma.c |
2660 |
+index 07498eaddc083..bbf4c6bc2c2e6 100644 |
2661 |
+--- a/tools/perf/util/lzma.c |
2662 |
++++ b/tools/perf/util/lzma.c |
2663 |
+@@ -64,7 +64,7 @@ int lzma_decompress_to_file(const char *input, int output_fd) |
2664 |
+ |
2665 |
+ if (ferror(infile)) { |
2666 |
+ pr_err("lzma: read error: %s\n", strerror(errno)); |
2667 |
+- goto err_fclose; |
2668 |
++ goto err_lzma_end; |
2669 |
+ } |
2670 |
+ |
2671 |
+ if (feof(infile)) |
2672 |
+@@ -78,7 +78,7 @@ int lzma_decompress_to_file(const char *input, int output_fd) |
2673 |
+ |
2674 |
+ if (writen(output_fd, buf_out, write_size) != write_size) { |
2675 |
+ pr_err("lzma: write error: %s\n", strerror(errno)); |
2676 |
+- goto err_fclose; |
2677 |
++ goto err_lzma_end; |
2678 |
+ } |
2679 |
+ |
2680 |
+ strm.next_out = buf_out; |
2681 |
+@@ -90,11 +90,13 @@ int lzma_decompress_to_file(const char *input, int output_fd) |
2682 |
+ break; |
2683 |
+ |
2684 |
+ pr_err("lzma: failed %s\n", lzma_strerror(ret)); |
2685 |
+- goto err_fclose; |
2686 |
++ goto err_lzma_end; |
2687 |
+ } |
2688 |
+ } |
2689 |
+ |
2690 |
+ err = 0; |
2691 |
++err_lzma_end: |
2692 |
++ lzma_end(&strm); |
2693 |
+ err_fclose: |
2694 |
+ fclose(infile); |
2695 |
+ return err; |
2696 |
+diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c |
2697 |
+index 9d42a2821ecb9..d7c34feef58ea 100644 |
2698 |
+--- a/tools/perf/util/map.c |
2699 |
++++ b/tools/perf/util/map.c |
2700 |
+@@ -216,6 +216,8 @@ struct map *map__new(struct machine *machine, u64 start, u64 len, |
2701 |
+ if (type != MAP__FUNCTION) |
2702 |
+ dso__set_loaded(dso, map->type); |
2703 |
+ } |
2704 |
++ |
2705 |
++ nsinfo__put(dso->nsinfo); |
2706 |
+ dso->nsinfo = nsi; |
2707 |
+ dso__put(dso); |
2708 |
+ } |
2709 |
+diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c |
2710 |
+index 7c286756c34b2..a0597e417ca33 100644 |
2711 |
+--- a/tools/perf/util/probe-event.c |
2712 |
++++ b/tools/perf/util/probe-event.c |
2713 |
+@@ -197,8 +197,10 @@ struct map *get_target_map(const char *target, struct nsinfo *nsi, bool user) |
2714 |
+ struct map *map; |
2715 |
+ |
2716 |
+ map = dso__new_map(target); |
2717 |
+- if (map && map->dso) |
2718 |
++ if (map && map->dso) { |
2719 |
++ nsinfo__put(map->dso->nsinfo); |
2720 |
+ map->dso->nsinfo = nsinfo__get(nsi); |
2721 |
++ } |
2722 |
+ return map; |
2723 |
+ } else { |
2724 |
+ return kernel_get_module_map(target); |
2725 |
+diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c |
2726 |
+index 6ab9230ce8ee0..4de93df73c4ce 100644 |
2727 |
+--- a/tools/perf/util/probe-file.c |
2728 |
++++ b/tools/perf/util/probe-file.c |
2729 |
+@@ -342,11 +342,11 @@ int probe_file__del_events(int fd, struct strfilter *filter) |
2730 |
+ |
2731 |
+ ret = probe_file__get_events(fd, filter, namelist); |
2732 |
+ if (ret < 0) |
2733 |
+- return ret; |
2734 |
++ goto out; |
2735 |
+ |
2736 |
+ ret = probe_file__del_strlist(fd, namelist); |
2737 |
++out: |
2738 |
+ strlist__delete(namelist); |
2739 |
+- |
2740 |
+ return ret; |
2741 |
+ } |
2742 |
+ |
2743 |
+diff --git a/tools/testing/selftests/vm/userfaultfd.c b/tools/testing/selftests/vm/userfaultfd.c |
2744 |
+index 7b8171e3128a8..16d42b2de424e 100644 |
2745 |
+--- a/tools/testing/selftests/vm/userfaultfd.c |
2746 |
++++ b/tools/testing/selftests/vm/userfaultfd.c |
2747 |
+@@ -129,8 +129,10 @@ static int anon_release_pages(char *rel_area) |
2748 |
+ |
2749 |
+ static void anon_allocate_area(void **alloc_area) |
2750 |
+ { |
2751 |
+- if (posix_memalign(alloc_area, page_size, nr_pages * page_size)) { |
2752 |
+- fprintf(stderr, "out of memory\n"); |
2753 |
++ *alloc_area = mmap(NULL, nr_pages * page_size, PROT_READ | PROT_WRITE, |
2754 |
++ MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); |
2755 |
++ if (*alloc_area == MAP_FAILED) |
2756 |
++ fprintf(stderr, "mmap of anonymous memory failed"); |
2757 |
+ *alloc_area = NULL; |
2758 |
+ } |
2759 |
+ } |