1 |
commit: 5001fb691f5a0cb75ff7bfc439fdcbe1da7fef5c |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu Sep 15 10:30:56 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu Sep 15 10:30:56 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=5001fb69 |
7 |
|
8 |
Linux patch 5.10.143 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1142_linux-5.10.143.patch | 2685 +++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 2689 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 75caafbb..32d72e53 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -611,6 +611,10 @@ Patch: 1141_linux-5.10.142.patch |
21 |
From: http://www.kernel.org |
22 |
Desc: Linux 5.10.142 |
23 |
|
24 |
+Patch: 1142_linux-5.10.143.patch |
25 |
+From: http://www.kernel.org |
26 |
+Desc: Linux 5.10.143 |
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/1142_linux-5.10.143.patch b/1142_linux-5.10.143.patch |
33 |
new file mode 100644 |
34 |
index 00000000..28c57e76 |
35 |
--- /dev/null |
36 |
+++ b/1142_linux-5.10.143.patch |
37 |
@@ -0,0 +1,2685 @@ |
38 |
+diff --git a/Documentation/arm64/silicon-errata.rst b/Documentation/arm64/silicon-errata.rst |
39 |
+index f01eed0ee23ad..22a07c208fee0 100644 |
40 |
+--- a/Documentation/arm64/silicon-errata.rst |
41 |
++++ b/Documentation/arm64/silicon-errata.rst |
42 |
+@@ -92,6 +92,8 @@ stable kernels. |
43 |
+ +----------------+-----------------+-----------------+-----------------------------+ |
44 |
+ | ARM | Cortex-A77 | #1508412 | ARM64_ERRATUM_1508412 | |
45 |
+ +----------------+-----------------+-----------------+-----------------------------+ |
46 |
++| ARM | Cortex-A510 | #2457168 | ARM64_ERRATUM_2457168 | |
47 |
+++----------------+-----------------+-----------------+-----------------------------+ |
48 |
+ | ARM | Neoverse-N1 | #1188873,1418040| ARM64_ERRATUM_1418040 | |
49 |
+ +----------------+-----------------+-----------------+-----------------------------+ |
50 |
+ | ARM | Neoverse-N1 | #1349291 | N/A | |
51 |
+diff --git a/Makefile b/Makefile |
52 |
+index 655fe095459b3..60b2018c26dba 100644 |
53 |
+--- a/Makefile |
54 |
++++ b/Makefile |
55 |
+@@ -1,7 +1,7 @@ |
56 |
+ # SPDX-License-Identifier: GPL-2.0 |
57 |
+ VERSION = 5 |
58 |
+ PATCHLEVEL = 10 |
59 |
+-SUBLEVEL = 142 |
60 |
++SUBLEVEL = 143 |
61 |
+ EXTRAVERSION = |
62 |
+ NAME = Dare mighty things |
63 |
+ |
64 |
+diff --git a/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi b/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi |
65 |
+index a06700e53e4c3..9c8b3eb49ea30 100644 |
66 |
+--- a/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi |
67 |
++++ b/arch/arm/boot/dts/at91-sama5d27_wlsom1.dtsi |
68 |
+@@ -62,8 +62,8 @@ |
69 |
+ regulators { |
70 |
+ vdd_3v3: VDD_IO { |
71 |
+ regulator-name = "VDD_IO"; |
72 |
+- regulator-min-microvolt = <1200000>; |
73 |
+- regulator-max-microvolt = <3700000>; |
74 |
++ regulator-min-microvolt = <3300000>; |
75 |
++ regulator-max-microvolt = <3300000>; |
76 |
+ regulator-initial-mode = <2>; |
77 |
+ regulator-allowed-modes = <2>, <4>; |
78 |
+ regulator-always-on; |
79 |
+@@ -81,8 +81,8 @@ |
80 |
+ |
81 |
+ vddio_ddr: VDD_DDR { |
82 |
+ regulator-name = "VDD_DDR"; |
83 |
+- regulator-min-microvolt = <600000>; |
84 |
+- regulator-max-microvolt = <1850000>; |
85 |
++ regulator-min-microvolt = <1200000>; |
86 |
++ regulator-max-microvolt = <1200000>; |
87 |
+ regulator-initial-mode = <2>; |
88 |
+ regulator-allowed-modes = <2>, <4>; |
89 |
+ regulator-always-on; |
90 |
+@@ -104,8 +104,8 @@ |
91 |
+ |
92 |
+ vdd_core: VDD_CORE { |
93 |
+ regulator-name = "VDD_CORE"; |
94 |
+- regulator-min-microvolt = <600000>; |
95 |
+- regulator-max-microvolt = <1850000>; |
96 |
++ regulator-min-microvolt = <1250000>; |
97 |
++ regulator-max-microvolt = <1250000>; |
98 |
+ regulator-initial-mode = <2>; |
99 |
+ regulator-allowed-modes = <2>, <4>; |
100 |
+ regulator-always-on; |
101 |
+@@ -146,8 +146,8 @@ |
102 |
+ |
103 |
+ LDO1 { |
104 |
+ regulator-name = "LDO1"; |
105 |
+- regulator-min-microvolt = <1200000>; |
106 |
+- regulator-max-microvolt = <3700000>; |
107 |
++ regulator-min-microvolt = <3300000>; |
108 |
++ regulator-max-microvolt = <3300000>; |
109 |
+ regulator-always-on; |
110 |
+ |
111 |
+ regulator-state-standby { |
112 |
+@@ -161,9 +161,8 @@ |
113 |
+ |
114 |
+ LDO2 { |
115 |
+ regulator-name = "LDO2"; |
116 |
+- regulator-min-microvolt = <1200000>; |
117 |
+- regulator-max-microvolt = <3700000>; |
118 |
+- regulator-always-on; |
119 |
++ regulator-min-microvolt = <1800000>; |
120 |
++ regulator-max-microvolt = <3300000>; |
121 |
+ |
122 |
+ regulator-state-standby { |
123 |
+ regulator-on-in-suspend; |
124 |
+diff --git a/arch/arm/boot/dts/at91-sama5d2_icp.dts b/arch/arm/boot/dts/at91-sama5d2_icp.dts |
125 |
+index 634411d13b4aa..00b9e88ff5451 100644 |
126 |
+--- a/arch/arm/boot/dts/at91-sama5d2_icp.dts |
127 |
++++ b/arch/arm/boot/dts/at91-sama5d2_icp.dts |
128 |
+@@ -195,8 +195,8 @@ |
129 |
+ regulators { |
130 |
+ vdd_io_reg: VDD_IO { |
131 |
+ regulator-name = "VDD_IO"; |
132 |
+- regulator-min-microvolt = <1200000>; |
133 |
+- regulator-max-microvolt = <3700000>; |
134 |
++ regulator-min-microvolt = <3300000>; |
135 |
++ regulator-max-microvolt = <3300000>; |
136 |
+ regulator-initial-mode = <2>; |
137 |
+ regulator-allowed-modes = <2>, <4>; |
138 |
+ regulator-always-on; |
139 |
+@@ -214,8 +214,8 @@ |
140 |
+ |
141 |
+ VDD_DDR { |
142 |
+ regulator-name = "VDD_DDR"; |
143 |
+- regulator-min-microvolt = <600000>; |
144 |
+- regulator-max-microvolt = <1850000>; |
145 |
++ regulator-min-microvolt = <1350000>; |
146 |
++ regulator-max-microvolt = <1350000>; |
147 |
+ regulator-initial-mode = <2>; |
148 |
+ regulator-allowed-modes = <2>, <4>; |
149 |
+ regulator-always-on; |
150 |
+@@ -233,8 +233,8 @@ |
151 |
+ |
152 |
+ VDD_CORE { |
153 |
+ regulator-name = "VDD_CORE"; |
154 |
+- regulator-min-microvolt = <600000>; |
155 |
+- regulator-max-microvolt = <1850000>; |
156 |
++ regulator-min-microvolt = <1250000>; |
157 |
++ regulator-max-microvolt = <1250000>; |
158 |
+ regulator-initial-mode = <2>; |
159 |
+ regulator-allowed-modes = <2>, <4>; |
160 |
+ regulator-always-on; |
161 |
+@@ -256,7 +256,6 @@ |
162 |
+ regulator-max-microvolt = <1850000>; |
163 |
+ regulator-initial-mode = <2>; |
164 |
+ regulator-allowed-modes = <2>, <4>; |
165 |
+- regulator-always-on; |
166 |
+ |
167 |
+ regulator-state-standby { |
168 |
+ regulator-on-in-suspend; |
169 |
+@@ -271,8 +270,8 @@ |
170 |
+ |
171 |
+ LDO1 { |
172 |
+ regulator-name = "LDO1"; |
173 |
+- regulator-min-microvolt = <1200000>; |
174 |
+- regulator-max-microvolt = <3700000>; |
175 |
++ regulator-min-microvolt = <2500000>; |
176 |
++ regulator-max-microvolt = <2500000>; |
177 |
+ regulator-always-on; |
178 |
+ |
179 |
+ regulator-state-standby { |
180 |
+@@ -286,8 +285,8 @@ |
181 |
+ |
182 |
+ LDO2 { |
183 |
+ regulator-name = "LDO2"; |
184 |
+- regulator-min-microvolt = <1200000>; |
185 |
+- regulator-max-microvolt = <3700000>; |
186 |
++ regulator-min-microvolt = <3300000>; |
187 |
++ regulator-max-microvolt = <3300000>; |
188 |
+ regulator-always-on; |
189 |
+ |
190 |
+ regulator-state-standby { |
191 |
+diff --git a/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi b/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi |
192 |
+index 92f9977d14822..e9a4115124eb0 100644 |
193 |
+--- a/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi |
194 |
++++ b/arch/arm/boot/dts/imx6qdl-kontron-samx6i.dtsi |
195 |
+@@ -51,16 +51,6 @@ |
196 |
+ vin-supply = <®_3p3v_s5>; |
197 |
+ }; |
198 |
+ |
199 |
+- reg_3p3v_s0: regulator-3p3v-s0 { |
200 |
+- compatible = "regulator-fixed"; |
201 |
+- regulator-name = "V_3V3_S0"; |
202 |
+- regulator-min-microvolt = <3300000>; |
203 |
+- regulator-max-microvolt = <3300000>; |
204 |
+- regulator-always-on; |
205 |
+- regulator-boot-on; |
206 |
+- vin-supply = <®_3p3v_s5>; |
207 |
+- }; |
208 |
+- |
209 |
+ reg_3p3v_s5: regulator-3p3v-s5 { |
210 |
+ compatible = "regulator-fixed"; |
211 |
+ regulator-name = "V_3V3_S5"; |
212 |
+diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig |
213 |
+index 7c7906e9dafda..1116a8d092c01 100644 |
214 |
+--- a/arch/arm64/Kconfig |
215 |
++++ b/arch/arm64/Kconfig |
216 |
+@@ -657,6 +657,24 @@ config ARM64_ERRATUM_1508412 |
217 |
+ |
218 |
+ If unsure, say Y. |
219 |
+ |
220 |
++config ARM64_ERRATUM_2457168 |
221 |
++ bool "Cortex-A510: 2457168: workaround for AMEVCNTR01 incrementing incorrectly" |
222 |
++ depends on ARM64_AMU_EXTN |
223 |
++ default y |
224 |
++ help |
225 |
++ This option adds the workaround for ARM Cortex-A510 erratum 2457168. |
226 |
++ |
227 |
++ The AMU counter AMEVCNTR01 (constant counter) should increment at the same rate |
228 |
++ as the system counter. On affected Cortex-A510 cores AMEVCNTR01 increments |
229 |
++ incorrectly giving a significantly higher output value. |
230 |
++ |
231 |
++ Work around this problem by keeping the reference values of affected counters |
232 |
++ to 0 thus signaling an error case. This effect is the same to firmware disabling |
233 |
++ affected counters, in which case 0 will be returned when reading the disabled |
234 |
++ counters. |
235 |
++ |
236 |
++ If unsure, say Y. |
237 |
++ |
238 |
+ config CAVIUM_ERRATUM_22375 |
239 |
+ bool "Cavium erratum 22375, 24313" |
240 |
+ default y |
241 |
+diff --git a/arch/arm64/include/asm/cpucaps.h b/arch/arm64/include/asm/cpucaps.h |
242 |
+index f42fd0a2e81c8..53030d3c03a2c 100644 |
243 |
+--- a/arch/arm64/include/asm/cpucaps.h |
244 |
++++ b/arch/arm64/include/asm/cpucaps.h |
245 |
+@@ -67,7 +67,8 @@ |
246 |
+ #define ARM64_MTE 57 |
247 |
+ #define ARM64_WORKAROUND_1508412 58 |
248 |
+ #define ARM64_SPECTRE_BHB 59 |
249 |
++#define ARM64_WORKAROUND_2457168 60 |
250 |
+ |
251 |
+-#define ARM64_NCAPS 60 |
252 |
++#define ARM64_NCAPS 61 |
253 |
+ |
254 |
+ #endif /* __ASM_CPUCAPS_H */ |
255 |
+diff --git a/arch/arm64/kernel/cacheinfo.c b/arch/arm64/kernel/cacheinfo.c |
256 |
+index 587543c6c51cb..97c42be71338a 100644 |
257 |
+--- a/arch/arm64/kernel/cacheinfo.c |
258 |
++++ b/arch/arm64/kernel/cacheinfo.c |
259 |
+@@ -45,7 +45,8 @@ static void ci_leaf_init(struct cacheinfo *this_leaf, |
260 |
+ |
261 |
+ int init_cache_level(unsigned int cpu) |
262 |
+ { |
263 |
+- unsigned int ctype, level, leaves, fw_level; |
264 |
++ unsigned int ctype, level, leaves; |
265 |
++ int fw_level; |
266 |
+ struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); |
267 |
+ |
268 |
+ for (level = 1, leaves = 0; level <= MAX_CACHE_LEVEL; level++) { |
269 |
+@@ -63,6 +64,9 @@ int init_cache_level(unsigned int cpu) |
270 |
+ else |
271 |
+ fw_level = acpi_find_last_cache_level(cpu); |
272 |
+ |
273 |
++ if (fw_level < 0) |
274 |
++ return fw_level; |
275 |
++ |
276 |
+ if (level < fw_level) { |
277 |
+ /* |
278 |
+ * some external caches not specified in CLIDR_EL1 |
279 |
+diff --git a/arch/arm64/kernel/cpu_errata.c b/arch/arm64/kernel/cpu_errata.c |
280 |
+index 78263dadd00da..aaacca6fd52f6 100644 |
281 |
+--- a/arch/arm64/kernel/cpu_errata.c |
282 |
++++ b/arch/arm64/kernel/cpu_errata.c |
283 |
+@@ -545,6 +545,15 @@ const struct arm64_cpu_capabilities arm64_errata[] = { |
284 |
+ 0, 0, |
285 |
+ 1, 0), |
286 |
+ }, |
287 |
++#endif |
288 |
++#ifdef CONFIG_ARM64_ERRATUM_2457168 |
289 |
++ { |
290 |
++ .desc = "ARM erratum 2457168", |
291 |
++ .capability = ARM64_WORKAROUND_2457168, |
292 |
++ .type = ARM64_CPUCAP_WEAK_LOCAL_CPU_FEATURE, |
293 |
++ /* Cortex-A510 r0p0-r1p1 */ |
294 |
++ CAP_MIDR_RANGE(MIDR_CORTEX_A510, 0, 0, 1, 1) |
295 |
++ }, |
296 |
+ #endif |
297 |
+ { |
298 |
+ } |
299 |
+diff --git a/arch/arm64/kernel/cpufeature.c b/arch/arm64/kernel/cpufeature.c |
300 |
+index 4087e2d1f39e2..e72c90b826568 100644 |
301 |
+--- a/arch/arm64/kernel/cpufeature.c |
302 |
++++ b/arch/arm64/kernel/cpufeature.c |
303 |
+@@ -1559,7 +1559,10 @@ static void cpu_amu_enable(struct arm64_cpu_capabilities const *cap) |
304 |
+ pr_info("detected CPU%d: Activity Monitors Unit (AMU)\n", |
305 |
+ smp_processor_id()); |
306 |
+ cpumask_set_cpu(smp_processor_id(), &amu_cpus); |
307 |
+- init_cpu_freq_invariance_counters(); |
308 |
++ |
309 |
++ /* 0 reference values signal broken/disabled counters */ |
310 |
++ if (!this_cpu_has_cap(ARM64_WORKAROUND_2457168)) |
311 |
++ init_cpu_freq_invariance_counters(); |
312 |
+ } |
313 |
+ } |
314 |
+ |
315 |
+diff --git a/arch/mips/loongson32/ls1c/board.c b/arch/mips/loongson32/ls1c/board.c |
316 |
+index e9de6da0ce51f..9dcfe9de55b0a 100644 |
317 |
+--- a/arch/mips/loongson32/ls1c/board.c |
318 |
++++ b/arch/mips/loongson32/ls1c/board.c |
319 |
+@@ -15,7 +15,6 @@ static struct platform_device *ls1c_platform_devices[] __initdata = { |
320 |
+ static int __init ls1c_platform_init(void) |
321 |
+ { |
322 |
+ ls1x_serial_set_uartclk(&ls1x_uart_pdev); |
323 |
+- ls1x_rtc_set_extclk(&ls1x_rtc_pdev); |
324 |
+ |
325 |
+ return platform_add_devices(ls1c_platform_devices, |
326 |
+ ARRAY_SIZE(ls1c_platform_devices)); |
327 |
+diff --git a/arch/parisc/kernel/head.S b/arch/parisc/kernel/head.S |
328 |
+index aa93d775c34db..598d0938449da 100644 |
329 |
+--- a/arch/parisc/kernel/head.S |
330 |
++++ b/arch/parisc/kernel/head.S |
331 |
+@@ -22,7 +22,7 @@ |
332 |
+ #include <linux/init.h> |
333 |
+ #include <linux/pgtable.h> |
334 |
+ |
335 |
+- .level PA_ASM_LEVEL |
336 |
++ .level 1.1 |
337 |
+ |
338 |
+ __INITDATA |
339 |
+ ENTRY(boot_args) |
340 |
+@@ -69,6 +69,47 @@ $bss_loop: |
341 |
+ stw,ma %arg2,4(%r1) |
342 |
+ stw,ma %arg3,4(%r1) |
343 |
+ |
344 |
++#if !defined(CONFIG_64BIT) && defined(CONFIG_PA20) |
345 |
++ /* This 32-bit kernel was compiled for PA2.0 CPUs. Check current CPU |
346 |
++ * and halt kernel if we detect a PA1.x CPU. */ |
347 |
++ ldi 32,%r10 |
348 |
++ mtctl %r10,%cr11 |
349 |
++ .level 2.0 |
350 |
++ mfctl,w %cr11,%r10 |
351 |
++ .level 1.1 |
352 |
++ comib,<>,n 0,%r10,$cpu_ok |
353 |
++ |
354 |
++ load32 PA(msg1),%arg0 |
355 |
++ ldi msg1_end-msg1,%arg1 |
356 |
++$iodc_panic: |
357 |
++ copy %arg0, %r10 |
358 |
++ copy %arg1, %r11 |
359 |
++ load32 PA(init_stack),%sp |
360 |
++#define MEM_CONS 0x3A0 |
361 |
++ ldw MEM_CONS+32(%r0),%arg0 // HPA |
362 |
++ ldi ENTRY_IO_COUT,%arg1 |
363 |
++ ldw MEM_CONS+36(%r0),%arg2 // SPA |
364 |
++ ldw MEM_CONS+8(%r0),%arg3 // layers |
365 |
++ load32 PA(__bss_start),%r1 |
366 |
++ stw %r1,-52(%sp) // arg4 |
367 |
++ stw %r0,-56(%sp) // arg5 |
368 |
++ stw %r10,-60(%sp) // arg6 = ptr to text |
369 |
++ stw %r11,-64(%sp) // arg7 = len |
370 |
++ stw %r0,-68(%sp) // arg8 |
371 |
++ load32 PA(.iodc_panic_ret), %rp |
372 |
++ ldw MEM_CONS+40(%r0),%r1 // ENTRY_IODC |
373 |
++ bv,n (%r1) |
374 |
++.iodc_panic_ret: |
375 |
++ b . /* wait endless with ... */ |
376 |
++ or %r10,%r10,%r10 /* qemu idle sleep */ |
377 |
++msg1: .ascii "Can't boot kernel which was built for PA8x00 CPUs on this machine.\r\n" |
378 |
++msg1_end: |
379 |
++ |
380 |
++$cpu_ok: |
381 |
++#endif |
382 |
++ |
383 |
++ .level PA_ASM_LEVEL |
384 |
++ |
385 |
+ /* Initialize startup VM. Just map first 16/32 MB of memory */ |
386 |
+ load32 PA(swapper_pg_dir),%r4 |
387 |
+ mtctl %r4,%cr24 /* Initialize kernel root pointer */ |
388 |
+diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c |
389 |
+index 9d5460f6e0ff1..6f33d62331b1f 100644 |
390 |
+--- a/drivers/block/xen-blkfront.c |
391 |
++++ b/drivers/block/xen-blkfront.c |
392 |
+@@ -1852,6 +1852,12 @@ static void free_info(struct blkfront_info *info) |
393 |
+ kfree(info); |
394 |
+ } |
395 |
+ |
396 |
++/* Enable the persistent grants feature. */ |
397 |
++static bool feature_persistent = true; |
398 |
++module_param(feature_persistent, bool, 0644); |
399 |
++MODULE_PARM_DESC(feature_persistent, |
400 |
++ "Enables the persistent grants feature"); |
401 |
++ |
402 |
+ /* Common code used when first setting up, and when resuming. */ |
403 |
+ static int talk_to_blkback(struct xenbus_device *dev, |
404 |
+ struct blkfront_info *info) |
405 |
+@@ -1943,6 +1949,7 @@ again: |
406 |
+ message = "writing protocol"; |
407 |
+ goto abort_transaction; |
408 |
+ } |
409 |
++ info->feature_persistent_parm = feature_persistent; |
410 |
+ err = xenbus_printf(xbt, dev->nodename, "feature-persistent", "%u", |
411 |
+ info->feature_persistent_parm); |
412 |
+ if (err) |
413 |
+@@ -2019,12 +2026,6 @@ static int negotiate_mq(struct blkfront_info *info) |
414 |
+ return 0; |
415 |
+ } |
416 |
+ |
417 |
+-/* Enable the persistent grants feature. */ |
418 |
+-static bool feature_persistent = true; |
419 |
+-module_param(feature_persistent, bool, 0644); |
420 |
+-MODULE_PARM_DESC(feature_persistent, |
421 |
+- "Enables the persistent grants feature"); |
422 |
+- |
423 |
+ /** |
424 |
+ * Entry point to this code when a new device is created. Allocate the basic |
425 |
+ * structures and the ring buffer for communication with the backend, and |
426 |
+@@ -2394,7 +2395,6 @@ static void blkfront_gather_backend_features(struct blkfront_info *info) |
427 |
+ if (xenbus_read_unsigned(info->xbdev->otherend, "feature-discard", 0)) |
428 |
+ blkfront_setup_discard(info); |
429 |
+ |
430 |
+- info->feature_persistent_parm = feature_persistent; |
431 |
+ if (info->feature_persistent_parm) |
432 |
+ info->feature_persistent = |
433 |
+ !!xenbus_read_unsigned(info->xbdev->otherend, |
434 |
+diff --git a/drivers/firmware/efi/capsule-loader.c b/drivers/firmware/efi/capsule-loader.c |
435 |
+index 4dde8edd53b62..3e8d4b51a8140 100644 |
436 |
+--- a/drivers/firmware/efi/capsule-loader.c |
437 |
++++ b/drivers/firmware/efi/capsule-loader.c |
438 |
+@@ -242,29 +242,6 @@ failed: |
439 |
+ return ret; |
440 |
+ } |
441 |
+ |
442 |
+-/** |
443 |
+- * efi_capsule_flush - called by file close or file flush |
444 |
+- * @file: file pointer |
445 |
+- * @id: not used |
446 |
+- * |
447 |
+- * If a capsule is being partially uploaded then calling this function |
448 |
+- * will be treated as upload termination and will free those completed |
449 |
+- * buffer pages and -ECANCELED will be returned. |
450 |
+- **/ |
451 |
+-static int efi_capsule_flush(struct file *file, fl_owner_t id) |
452 |
+-{ |
453 |
+- int ret = 0; |
454 |
+- struct capsule_info *cap_info = file->private_data; |
455 |
+- |
456 |
+- if (cap_info->index > 0) { |
457 |
+- pr_err("capsule upload not complete\n"); |
458 |
+- efi_free_all_buff_pages(cap_info); |
459 |
+- ret = -ECANCELED; |
460 |
+- } |
461 |
+- |
462 |
+- return ret; |
463 |
+-} |
464 |
+- |
465 |
+ /** |
466 |
+ * efi_capsule_release - called by file close |
467 |
+ * @inode: not used |
468 |
+@@ -277,6 +254,13 @@ static int efi_capsule_release(struct inode *inode, struct file *file) |
469 |
+ { |
470 |
+ struct capsule_info *cap_info = file->private_data; |
471 |
+ |
472 |
++ if (cap_info->index > 0 && |
473 |
++ (cap_info->header.headersize == 0 || |
474 |
++ cap_info->count < cap_info->total_size)) { |
475 |
++ pr_err("capsule upload not complete\n"); |
476 |
++ efi_free_all_buff_pages(cap_info); |
477 |
++ } |
478 |
++ |
479 |
+ kfree(cap_info->pages); |
480 |
+ kfree(cap_info->phys); |
481 |
+ kfree(file->private_data); |
482 |
+@@ -324,7 +308,6 @@ static const struct file_operations efi_capsule_fops = { |
483 |
+ .owner = THIS_MODULE, |
484 |
+ .open = efi_capsule_open, |
485 |
+ .write = efi_capsule_write, |
486 |
+- .flush = efi_capsule_flush, |
487 |
+ .release = efi_capsule_release, |
488 |
+ .llseek = no_llseek, |
489 |
+ }; |
490 |
+diff --git a/drivers/firmware/efi/libstub/Makefile b/drivers/firmware/efi/libstub/Makefile |
491 |
+index a2ae9c3b95793..433e11dab4a87 100644 |
492 |
+--- a/drivers/firmware/efi/libstub/Makefile |
493 |
++++ b/drivers/firmware/efi/libstub/Makefile |
494 |
+@@ -37,6 +37,13 @@ KBUILD_CFLAGS := $(cflags-y) -Os -DDISABLE_BRANCH_PROFILING \ |
495 |
+ $(call cc-option,-fno-addrsig) \ |
496 |
+ -D__DISABLE_EXPORTS |
497 |
+ |
498 |
++# |
499 |
++# struct randomization only makes sense for Linux internal types, which the EFI |
500 |
++# stub code never touches, so let's turn off struct randomization for the stub |
501 |
++# altogether |
502 |
++# |
503 |
++KBUILD_CFLAGS := $(filter-out $(RANDSTRUCT_CFLAGS), $(KBUILD_CFLAGS)) |
504 |
++ |
505 |
+ # remove SCS flags from all objects in this directory |
506 |
+ KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_SCS), $(KBUILD_CFLAGS)) |
507 |
+ |
508 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |
509 |
+index 2f47f81a74a57..ae84d3b582aa5 100644 |
510 |
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |
511 |
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c |
512 |
+@@ -2146,6 +2146,9 @@ static int psp_hw_fini(void *handle) |
513 |
+ psp_rap_terminate(psp); |
514 |
+ psp_dtm_terminate(psp); |
515 |
+ psp_hdcp_terminate(psp); |
516 |
++ |
517 |
++ if (adev->gmc.xgmi.num_physical_nodes > 1) |
518 |
++ psp_xgmi_terminate(psp); |
519 |
+ } |
520 |
+ |
521 |
+ psp_asd_unload(psp); |
522 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c |
523 |
+index 042c85fc528bb..def0b7092438f 100644 |
524 |
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c |
525 |
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c |
526 |
+@@ -622,7 +622,7 @@ int amdgpu_xgmi_remove_device(struct amdgpu_device *adev) |
527 |
+ amdgpu_put_xgmi_hive(hive); |
528 |
+ } |
529 |
+ |
530 |
+- return psp_xgmi_terminate(&adev->psp); |
531 |
++ return 0; |
532 |
+ } |
533 |
+ |
534 |
+ int amdgpu_xgmi_ras_late_init(struct amdgpu_device *adev) |
535 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c |
536 |
+index 405bb3efa2a96..38f4c7474487b 100644 |
537 |
+--- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c |
538 |
++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c |
539 |
+@@ -2570,7 +2570,8 @@ static void gfx_v9_0_constants_init(struct amdgpu_device *adev) |
540 |
+ |
541 |
+ gfx_v9_0_tiling_mode_table_init(adev); |
542 |
+ |
543 |
+- gfx_v9_0_setup_rb(adev); |
544 |
++ if (adev->gfx.num_gfx_rings) |
545 |
++ gfx_v9_0_setup_rb(adev); |
546 |
+ gfx_v9_0_get_cu_info(adev, &adev->gfx.cu_info); |
547 |
+ adev->gfx.config.db_debug2 = RREG32_SOC15(GC, 0, mmDB_DEBUG2); |
548 |
+ |
549 |
+diff --git a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c |
550 |
+index f84701c562bf2..97441f373531f 100644 |
551 |
+--- a/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c |
552 |
++++ b/drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c |
553 |
+@@ -178,6 +178,7 @@ static void mmhub_v1_0_init_cache_regs(struct amdgpu_device *adev) |
554 |
+ tmp = REG_SET_FIELD(tmp, VM_L2_CNTL2, INVALIDATE_L2_CACHE, 1); |
555 |
+ WREG32_SOC15(MMHUB, 0, mmVM_L2_CNTL2, tmp); |
556 |
+ |
557 |
++ tmp = mmVM_L2_CNTL3_DEFAULT; |
558 |
+ if (adev->gmc.translate_further) { |
559 |
+ tmp = REG_SET_FIELD(tmp, VM_L2_CNTL3, BANK_SELECT, 12); |
560 |
+ tmp = REG_SET_FIELD(tmp, VM_L2_CNTL3, |
561 |
+diff --git a/drivers/gpu/drm/drm_gem.c b/drivers/gpu/drm/drm_gem.c |
562 |
+index 5979af230eda0..8b30e8d83fbcf 100644 |
563 |
+--- a/drivers/gpu/drm/drm_gem.c |
564 |
++++ b/drivers/gpu/drm/drm_gem.c |
565 |
+@@ -166,21 +166,6 @@ void drm_gem_private_object_init(struct drm_device *dev, |
566 |
+ } |
567 |
+ EXPORT_SYMBOL(drm_gem_private_object_init); |
568 |
+ |
569 |
+-static void |
570 |
+-drm_gem_remove_prime_handles(struct drm_gem_object *obj, struct drm_file *filp) |
571 |
+-{ |
572 |
+- /* |
573 |
+- * Note: obj->dma_buf can't disappear as long as we still hold a |
574 |
+- * handle reference in obj->handle_count. |
575 |
+- */ |
576 |
+- mutex_lock(&filp->prime.lock); |
577 |
+- if (obj->dma_buf) { |
578 |
+- drm_prime_remove_buf_handle_locked(&filp->prime, |
579 |
+- obj->dma_buf); |
580 |
+- } |
581 |
+- mutex_unlock(&filp->prime.lock); |
582 |
+-} |
583 |
+- |
584 |
+ /** |
585 |
+ * drm_gem_object_handle_free - release resources bound to userspace handles |
586 |
+ * @obj: GEM object to clean up. |
587 |
+@@ -254,7 +239,7 @@ drm_gem_object_release_handle(int id, void *ptr, void *data) |
588 |
+ else if (dev->driver->gem_close_object) |
589 |
+ dev->driver->gem_close_object(obj, file_priv); |
590 |
+ |
591 |
+- drm_gem_remove_prime_handles(obj, file_priv); |
592 |
++ drm_prime_remove_buf_handle(&file_priv->prime, id); |
593 |
+ drm_vma_node_revoke(&obj->vma_node, file_priv); |
594 |
+ |
595 |
+ drm_gem_object_handle_put_unlocked(obj); |
596 |
+diff --git a/drivers/gpu/drm/drm_internal.h b/drivers/gpu/drm/drm_internal.h |
597 |
+index b65865c630b0a..f80e0f28087d1 100644 |
598 |
+--- a/drivers/gpu/drm/drm_internal.h |
599 |
++++ b/drivers/gpu/drm/drm_internal.h |
600 |
+@@ -86,8 +86,8 @@ int drm_prime_fd_to_handle_ioctl(struct drm_device *dev, void *data, |
601 |
+ |
602 |
+ void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv); |
603 |
+ void drm_prime_destroy_file_private(struct drm_prime_file_private *prime_fpriv); |
604 |
+-void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv, |
605 |
+- struct dma_buf *dma_buf); |
606 |
++void drm_prime_remove_buf_handle(struct drm_prime_file_private *prime_fpriv, |
607 |
++ uint32_t handle); |
608 |
+ |
609 |
+ /* drm_drv.c */ |
610 |
+ struct drm_minor *drm_minor_acquire(unsigned int minor_id); |
611 |
+diff --git a/drivers/gpu/drm/drm_prime.c b/drivers/gpu/drm/drm_prime.c |
612 |
+index 9f955f2010c25..825499ea3ff59 100644 |
613 |
+--- a/drivers/gpu/drm/drm_prime.c |
614 |
++++ b/drivers/gpu/drm/drm_prime.c |
615 |
+@@ -187,29 +187,33 @@ static int drm_prime_lookup_buf_handle(struct drm_prime_file_private *prime_fpri |
616 |
+ return -ENOENT; |
617 |
+ } |
618 |
+ |
619 |
+-void drm_prime_remove_buf_handle_locked(struct drm_prime_file_private *prime_fpriv, |
620 |
+- struct dma_buf *dma_buf) |
621 |
++void drm_prime_remove_buf_handle(struct drm_prime_file_private *prime_fpriv, |
622 |
++ uint32_t handle) |
623 |
+ { |
624 |
+ struct rb_node *rb; |
625 |
+ |
626 |
+- rb = prime_fpriv->dmabufs.rb_node; |
627 |
++ mutex_lock(&prime_fpriv->lock); |
628 |
++ |
629 |
++ rb = prime_fpriv->handles.rb_node; |
630 |
+ while (rb) { |
631 |
+ struct drm_prime_member *member; |
632 |
+ |
633 |
+- member = rb_entry(rb, struct drm_prime_member, dmabuf_rb); |
634 |
+- if (member->dma_buf == dma_buf) { |
635 |
++ member = rb_entry(rb, struct drm_prime_member, handle_rb); |
636 |
++ if (member->handle == handle) { |
637 |
+ rb_erase(&member->handle_rb, &prime_fpriv->handles); |
638 |
+ rb_erase(&member->dmabuf_rb, &prime_fpriv->dmabufs); |
639 |
+ |
640 |
+- dma_buf_put(dma_buf); |
641 |
++ dma_buf_put(member->dma_buf); |
642 |
+ kfree(member); |
643 |
+- return; |
644 |
+- } else if (member->dma_buf < dma_buf) { |
645 |
++ break; |
646 |
++ } else if (member->handle < handle) { |
647 |
+ rb = rb->rb_right; |
648 |
+ } else { |
649 |
+ rb = rb->rb_left; |
650 |
+ } |
651 |
+ } |
652 |
++ |
653 |
++ mutex_unlock(&prime_fpriv->lock); |
654 |
+ } |
655 |
+ |
656 |
+ void drm_prime_init_file_private(struct drm_prime_file_private *prime_fpriv) |
657 |
+diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c |
658 |
+index f2c8b56be9ead..261a5e97a0b4a 100644 |
659 |
+--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c |
660 |
++++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c |
661 |
+@@ -163,6 +163,28 @@ intel_dp_link_training_clock_recovery(struct intel_dp *intel_dp) |
662 |
+ intel_dp_compute_rate(intel_dp, intel_dp->link_rate, |
663 |
+ &link_bw, &rate_select); |
664 |
+ |
665 |
++ /* |
666 |
++ * WaEdpLinkRateDataReload |
667 |
++ * |
668 |
++ * Parade PS8461E MUX (used on varius TGL+ laptops) needs |
669 |
++ * to snoop the link rates reported by the sink when we |
670 |
++ * use LINK_RATE_SET in order to operate in jitter cleaning |
671 |
++ * mode (as opposed to redriver mode). Unfortunately it |
672 |
++ * loses track of the snooped link rates when powered down, |
673 |
++ * so we need to make it re-snoop often. Without this high |
674 |
++ * link rates are not stable. |
675 |
++ */ |
676 |
++ if (!link_bw) { |
677 |
++ struct intel_connector *connector = intel_dp->attached_connector; |
678 |
++ __le16 sink_rates[DP_MAX_SUPPORTED_RATES]; |
679 |
++ |
680 |
++ drm_dbg_kms(&i915->drm, "[CONNECTOR:%d:%s] Reloading eDP link rates\n", |
681 |
++ connector->base.base.id, connector->base.name); |
682 |
++ |
683 |
++ drm_dp_dpcd_read(&intel_dp->aux, DP_SUPPORTED_LINK_RATES, |
684 |
++ sink_rates, sizeof(sink_rates)); |
685 |
++ } |
686 |
++ |
687 |
+ if (link_bw) |
688 |
+ drm_dbg_kms(&i915->drm, |
689 |
+ "Using LINK_BW_SET value %02x\n", link_bw); |
690 |
+diff --git a/drivers/gpu/drm/radeon/radeon_device.c b/drivers/gpu/drm/radeon/radeon_device.c |
691 |
+index 266e3cbbd09bd..8287410f471fb 100644 |
692 |
+--- a/drivers/gpu/drm/radeon/radeon_device.c |
693 |
++++ b/drivers/gpu/drm/radeon/radeon_device.c |
694 |
+@@ -1623,6 +1623,9 @@ int radeon_suspend_kms(struct drm_device *dev, bool suspend, |
695 |
+ if (r) { |
696 |
+ /* delay GPU reset to resume */ |
697 |
+ radeon_fence_driver_force_completion(rdev, i); |
698 |
++ } else { |
699 |
++ /* finish executing delayed work */ |
700 |
++ flush_delayed_work(&rdev->fence_drv[i].lockup_work); |
701 |
+ } |
702 |
+ } |
703 |
+ |
704 |
+diff --git a/drivers/hwmon/mr75203.c b/drivers/hwmon/mr75203.c |
705 |
+index 046523d47c29b..41e3d3b54baff 100644 |
706 |
+--- a/drivers/hwmon/mr75203.c |
707 |
++++ b/drivers/hwmon/mr75203.c |
708 |
+@@ -68,8 +68,9 @@ |
709 |
+ |
710 |
+ /* VM Individual Macro Register */ |
711 |
+ #define VM_COM_REG_SIZE 0x200 |
712 |
+-#define VM_SDIF_DONE(n) (VM_COM_REG_SIZE + 0x34 + 0x200 * (n)) |
713 |
+-#define VM_SDIF_DATA(n) (VM_COM_REG_SIZE + 0x40 + 0x200 * (n)) |
714 |
++#define VM_SDIF_DONE(vm) (VM_COM_REG_SIZE + 0x34 + 0x200 * (vm)) |
715 |
++#define VM_SDIF_DATA(vm, ch) \ |
716 |
++ (VM_COM_REG_SIZE + 0x40 + 0x200 * (vm) + 0x4 * (ch)) |
717 |
+ |
718 |
+ /* SDA Slave Register */ |
719 |
+ #define IP_CTRL 0x00 |
720 |
+@@ -115,6 +116,7 @@ struct pvt_device { |
721 |
+ u32 t_num; |
722 |
+ u32 p_num; |
723 |
+ u32 v_num; |
724 |
++ u32 c_num; |
725 |
+ u32 ip_freq; |
726 |
+ u8 *vm_idx; |
727 |
+ }; |
728 |
+@@ -178,14 +180,15 @@ static int pvt_read_in(struct device *dev, u32 attr, int channel, long *val) |
729 |
+ { |
730 |
+ struct pvt_device *pvt = dev_get_drvdata(dev); |
731 |
+ struct regmap *v_map = pvt->v_map; |
732 |
++ u8 vm_idx, ch_idx; |
733 |
+ u32 n, stat; |
734 |
+- u8 vm_idx; |
735 |
+ int ret; |
736 |
+ |
737 |
+- if (channel >= pvt->v_num) |
738 |
++ if (channel >= pvt->v_num * pvt->c_num) |
739 |
+ return -EINVAL; |
740 |
+ |
741 |
+- vm_idx = pvt->vm_idx[channel]; |
742 |
++ vm_idx = pvt->vm_idx[channel / pvt->c_num]; |
743 |
++ ch_idx = channel % pvt->c_num; |
744 |
+ |
745 |
+ switch (attr) { |
746 |
+ case hwmon_in_input: |
747 |
+@@ -196,13 +199,23 @@ static int pvt_read_in(struct device *dev, u32 attr, int channel, long *val) |
748 |
+ if (ret) |
749 |
+ return ret; |
750 |
+ |
751 |
+- ret = regmap_read(v_map, VM_SDIF_DATA(vm_idx), &n); |
752 |
++ ret = regmap_read(v_map, VM_SDIF_DATA(vm_idx, ch_idx), &n); |
753 |
+ if(ret < 0) |
754 |
+ return ret; |
755 |
+ |
756 |
+ n &= SAMPLE_DATA_MSK; |
757 |
+- /* Convert the N bitstream count into voltage */ |
758 |
+- *val = (PVT_N_CONST * n - PVT_R_CONST) >> PVT_CONV_BITS; |
759 |
++ /* |
760 |
++ * Convert the N bitstream count into voltage. |
761 |
++ * To support negative voltage calculation for 64bit machines |
762 |
++ * n must be cast to long, since n and *val differ both in |
763 |
++ * signedness and in size. |
764 |
++ * Division is used instead of right shift, because for signed |
765 |
++ * numbers, the sign bit is used to fill the vacated bit |
766 |
++ * positions, and if the number is negative, 1 is used. |
767 |
++ * BIT(x) may not be used instead of (1 << x) because it's |
768 |
++ * unsigned. |
769 |
++ */ |
770 |
++ *val = (PVT_N_CONST * (long)n - PVT_R_CONST) / (1 << PVT_CONV_BITS); |
771 |
+ |
772 |
+ return 0; |
773 |
+ default: |
774 |
+@@ -385,6 +398,19 @@ static int pvt_init(struct pvt_device *pvt) |
775 |
+ if (ret) |
776 |
+ return ret; |
777 |
+ |
778 |
++ val = (BIT(pvt->c_num) - 1) | VM_CH_INIT | |
779 |
++ IP_POLL << SDIF_ADDR_SFT | SDIF_WRN_W | SDIF_PROG; |
780 |
++ ret = regmap_write(v_map, SDIF_W, val); |
781 |
++ if (ret < 0) |
782 |
++ return ret; |
783 |
++ |
784 |
++ ret = regmap_read_poll_timeout(v_map, SDIF_STAT, |
785 |
++ val, !(val & SDIF_BUSY), |
786 |
++ PVT_POLL_DELAY_US, |
787 |
++ PVT_POLL_TIMEOUT_US); |
788 |
++ if (ret) |
789 |
++ return ret; |
790 |
++ |
791 |
+ val = CFG1_VOL_MEAS_MODE | CFG1_PARALLEL_OUT | |
792 |
+ CFG1_14_BIT | IP_CFG << SDIF_ADDR_SFT | |
793 |
+ SDIF_WRN_W | SDIF_PROG; |
794 |
+@@ -499,8 +525,8 @@ static int pvt_reset_control_deassert(struct device *dev, struct pvt_device *pvt |
795 |
+ |
796 |
+ static int mr75203_probe(struct platform_device *pdev) |
797 |
+ { |
798 |
++ u32 ts_num, vm_num, pd_num, ch_num, val, index, i; |
799 |
+ const struct hwmon_channel_info **pvt_info; |
800 |
+- u32 ts_num, vm_num, pd_num, val, index, i; |
801 |
+ struct device *dev = &pdev->dev; |
802 |
+ u32 *temp_config, *in_config; |
803 |
+ struct device *hwmon_dev; |
804 |
+@@ -541,9 +567,11 @@ static int mr75203_probe(struct platform_device *pdev) |
805 |
+ ts_num = (val & TS_NUM_MSK) >> TS_NUM_SFT; |
806 |
+ pd_num = (val & PD_NUM_MSK) >> PD_NUM_SFT; |
807 |
+ vm_num = (val & VM_NUM_MSK) >> VM_NUM_SFT; |
808 |
++ ch_num = (val & CH_NUM_MSK) >> CH_NUM_SFT; |
809 |
+ pvt->t_num = ts_num; |
810 |
+ pvt->p_num = pd_num; |
811 |
+ pvt->v_num = vm_num; |
812 |
++ pvt->c_num = ch_num; |
813 |
+ val = 0; |
814 |
+ if (ts_num) |
815 |
+ val++; |
816 |
+@@ -580,7 +608,7 @@ static int mr75203_probe(struct platform_device *pdev) |
817 |
+ } |
818 |
+ |
819 |
+ if (vm_num) { |
820 |
+- u32 num = vm_num; |
821 |
++ u32 total_ch; |
822 |
+ |
823 |
+ ret = pvt_get_regmap(pdev, "vm", pvt); |
824 |
+ if (ret) |
825 |
+@@ -594,30 +622,30 @@ static int mr75203_probe(struct platform_device *pdev) |
826 |
+ ret = device_property_read_u8_array(dev, "intel,vm-map", |
827 |
+ pvt->vm_idx, vm_num); |
828 |
+ if (ret) { |
829 |
+- num = 0; |
830 |
++ /* |
831 |
++ * Incase intel,vm-map property is not defined, we |
832 |
++ * assume incremental channel numbers. |
833 |
++ */ |
834 |
++ for (i = 0; i < vm_num; i++) |
835 |
++ pvt->vm_idx[i] = i; |
836 |
+ } else { |
837 |
+ for (i = 0; i < vm_num; i++) |
838 |
+ if (pvt->vm_idx[i] >= vm_num || |
839 |
+ pvt->vm_idx[i] == 0xff) { |
840 |
+- num = i; |
841 |
++ pvt->v_num = i; |
842 |
++ vm_num = i; |
843 |
+ break; |
844 |
+ } |
845 |
+ } |
846 |
+ |
847 |
+- /* |
848 |
+- * Incase intel,vm-map property is not defined, we assume |
849 |
+- * incremental channel numbers. |
850 |
+- */ |
851 |
+- for (i = num; i < vm_num; i++) |
852 |
+- pvt->vm_idx[i] = i; |
853 |
+- |
854 |
+- in_config = devm_kcalloc(dev, num + 1, |
855 |
++ total_ch = ch_num * vm_num; |
856 |
++ in_config = devm_kcalloc(dev, total_ch + 1, |
857 |
+ sizeof(*in_config), GFP_KERNEL); |
858 |
+ if (!in_config) |
859 |
+ return -ENOMEM; |
860 |
+ |
861 |
+- memset32(in_config, HWMON_I_INPUT, num); |
862 |
+- in_config[num] = 0; |
863 |
++ memset32(in_config, HWMON_I_INPUT, total_ch); |
864 |
++ in_config[total_ch] = 0; |
865 |
+ pvt_in.config = in_config; |
866 |
+ |
867 |
+ pvt_info[index++] = &pvt_in; |
868 |
+diff --git a/drivers/infiniband/core/cma.c b/drivers/infiniband/core/cma.c |
869 |
+index 3c40aa50cd60c..b5fa19a033c0a 100644 |
870 |
+--- a/drivers/infiniband/core/cma.c |
871 |
++++ b/drivers/infiniband/core/cma.c |
872 |
+@@ -1722,8 +1722,8 @@ cma_ib_id_from_event(struct ib_cm_id *cm_id, |
873 |
+ } |
874 |
+ |
875 |
+ if (!validate_net_dev(*net_dev, |
876 |
+- (struct sockaddr *)&req->listen_addr_storage, |
877 |
+- (struct sockaddr *)&req->src_addr_storage)) { |
878 |
++ (struct sockaddr *)&req->src_addr_storage, |
879 |
++ (struct sockaddr *)&req->listen_addr_storage)) { |
880 |
+ id_priv = ERR_PTR(-EHOSTUNREACH); |
881 |
+ goto err; |
882 |
+ } |
883 |
+diff --git a/drivers/infiniband/core/umem_odp.c b/drivers/infiniband/core/umem_odp.c |
884 |
+index 323f6cf006824..af4af4789ef27 100644 |
885 |
+--- a/drivers/infiniband/core/umem_odp.c |
886 |
++++ b/drivers/infiniband/core/umem_odp.c |
887 |
+@@ -466,7 +466,7 @@ retry: |
888 |
+ mutex_unlock(&umem_odp->umem_mutex); |
889 |
+ |
890 |
+ out_put_mm: |
891 |
+- mmput(owning_mm); |
892 |
++ mmput_async(owning_mm); |
893 |
+ out_put_task: |
894 |
+ if (owning_process) |
895 |
+ put_task_struct(owning_process); |
896 |
+diff --git a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h |
897 |
+index be7f2fe1e8839..8a92faeb3d237 100644 |
898 |
+--- a/drivers/infiniband/hw/hns/hns_roce_hw_v2.h |
899 |
++++ b/drivers/infiniband/hw/hns/hns_roce_hw_v2.h |
900 |
+@@ -92,7 +92,7 @@ |
901 |
+ |
902 |
+ #define HNS_ROCE_V2_QPC_TIMER_ENTRY_SZ PAGE_SIZE |
903 |
+ #define HNS_ROCE_V2_CQC_TIMER_ENTRY_SZ PAGE_SIZE |
904 |
+-#define HNS_ROCE_V2_PAGE_SIZE_SUPPORTED 0xFFFFF000 |
905 |
++#define HNS_ROCE_V2_PAGE_SIZE_SUPPORTED 0xFFFF000 |
906 |
+ #define HNS_ROCE_V2_MAX_INNER_MTPT_NUM 2 |
907 |
+ #define HNS_ROCE_INVALID_LKEY 0x100 |
908 |
+ #define HNS_ROCE_CMQ_TX_TIMEOUT 30000 |
909 |
+diff --git a/drivers/infiniband/hw/hns/hns_roce_qp.c b/drivers/infiniband/hw/hns/hns_roce_qp.c |
910 |
+index 291e06d631505..6fe98af7741b5 100644 |
911 |
+--- a/drivers/infiniband/hw/hns/hns_roce_qp.c |
912 |
++++ b/drivers/infiniband/hw/hns/hns_roce_qp.c |
913 |
+@@ -386,11 +386,8 @@ static int set_rq_size(struct hns_roce_dev *hr_dev, struct ib_qp_cap *cap, |
914 |
+ |
915 |
+ hr_qp->rq.max_gs = roundup_pow_of_two(max(1U, cap->max_recv_sge)); |
916 |
+ |
917 |
+- if (hr_dev->caps.max_rq_sg <= HNS_ROCE_SGE_IN_WQE) |
918 |
+- hr_qp->rq.wqe_shift = ilog2(hr_dev->caps.max_rq_desc_sz); |
919 |
+- else |
920 |
+- hr_qp->rq.wqe_shift = ilog2(hr_dev->caps.max_rq_desc_sz * |
921 |
+- hr_qp->rq.max_gs); |
922 |
++ hr_qp->rq.wqe_shift = ilog2(hr_dev->caps.max_rq_desc_sz * |
923 |
++ hr_qp->rq.max_gs); |
924 |
+ |
925 |
+ hr_qp->rq.wqe_cnt = cnt; |
926 |
+ if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_RQ_INLINE) |
927 |
+diff --git a/drivers/infiniband/hw/mlx5/mad.c b/drivers/infiniband/hw/mlx5/mad.c |
928 |
+index 9bb9bb058932f..cca7a4a6bd82d 100644 |
929 |
+--- a/drivers/infiniband/hw/mlx5/mad.c |
930 |
++++ b/drivers/infiniband/hw/mlx5/mad.c |
931 |
+@@ -166,6 +166,12 @@ static int process_pma_cmd(struct mlx5_ib_dev *dev, u8 port_num, |
932 |
+ mdev = dev->mdev; |
933 |
+ mdev_port_num = 1; |
934 |
+ } |
935 |
++ if (MLX5_CAP_GEN(dev->mdev, num_ports) == 1) { |
936 |
++ /* set local port to one for Function-Per-Port HCA. */ |
937 |
++ mdev = dev->mdev; |
938 |
++ mdev_port_num = 1; |
939 |
++ } |
940 |
++ |
941 |
+ /* Declaring support of extended counters */ |
942 |
+ if (in_mad->mad_hdr.attr_id == IB_PMA_CLASS_PORT_INFO) { |
943 |
+ struct ib_class_port_info cpi = {}; |
944 |
+diff --git a/drivers/infiniband/sw/siw/siw_qp_tx.c b/drivers/infiniband/sw/siw/siw_qp_tx.c |
945 |
+index 7989c4043db4e..3c3ae5ef29428 100644 |
946 |
+--- a/drivers/infiniband/sw/siw/siw_qp_tx.c |
947 |
++++ b/drivers/infiniband/sw/siw/siw_qp_tx.c |
948 |
+@@ -29,7 +29,7 @@ static struct page *siw_get_pblpage(struct siw_mem *mem, u64 addr, int *idx) |
949 |
+ dma_addr_t paddr = siw_pbl_get_buffer(pbl, offset, NULL, idx); |
950 |
+ |
951 |
+ if (paddr) |
952 |
+- return virt_to_page(paddr); |
953 |
++ return virt_to_page((void *)paddr); |
954 |
+ |
955 |
+ return NULL; |
956 |
+ } |
957 |
+@@ -523,13 +523,23 @@ static int siw_tx_hdt(struct siw_iwarp_tx *c_tx, struct socket *s) |
958 |
+ kunmap(p); |
959 |
+ } |
960 |
+ } else { |
961 |
+- u64 va = sge->laddr + sge_off; |
962 |
++ /* |
963 |
++ * Cast to an uintptr_t to preserve all 64 bits |
964 |
++ * in sge->laddr. |
965 |
++ */ |
966 |
++ uintptr_t va = (uintptr_t)(sge->laddr + sge_off); |
967 |
+ |
968 |
+- page_array[seg] = virt_to_page(va & PAGE_MASK); |
969 |
++ /* |
970 |
++ * virt_to_page() takes a (void *) pointer |
971 |
++ * so cast to a (void *) meaning it will be 64 |
972 |
++ * bits on a 64 bit platform and 32 bits on a |
973 |
++ * 32 bit platform. |
974 |
++ */ |
975 |
++ page_array[seg] = virt_to_page((void *)(va & PAGE_MASK)); |
976 |
+ if (do_crc) |
977 |
+ crypto_shash_update( |
978 |
+ c_tx->mpa_crc_hd, |
979 |
+- (void *)(uintptr_t)va, |
980 |
++ (void *)va, |
981 |
+ plen); |
982 |
+ } |
983 |
+ |
984 |
+diff --git a/drivers/iommu/amd/iommu.c b/drivers/iommu/amd/iommu.c |
985 |
+index 200cf5da5e0ad..f216a86d9c817 100644 |
986 |
+--- a/drivers/iommu/amd/iommu.c |
987 |
++++ b/drivers/iommu/amd/iommu.c |
988 |
+@@ -923,7 +923,8 @@ static void build_completion_wait(struct iommu_cmd *cmd, |
989 |
+ memset(cmd, 0, sizeof(*cmd)); |
990 |
+ cmd->data[0] = lower_32_bits(paddr) | CMD_COMPL_WAIT_STORE_MASK; |
991 |
+ cmd->data[1] = upper_32_bits(paddr); |
992 |
+- cmd->data[2] = data; |
993 |
++ cmd->data[2] = lower_32_bits(data); |
994 |
++ cmd->data[3] = upper_32_bits(data); |
995 |
+ CMD_SET_TYPE(cmd, CMD_COMPL_WAIT); |
996 |
+ } |
997 |
+ |
998 |
+diff --git a/drivers/net/ethernet/intel/i40e/i40e_client.c b/drivers/net/ethernet/intel/i40e/i40e_client.c |
999 |
+index 32f3facbed1a5..b3cb5d1033260 100644 |
1000 |
+--- a/drivers/net/ethernet/intel/i40e/i40e_client.c |
1001 |
++++ b/drivers/net/ethernet/intel/i40e/i40e_client.c |
1002 |
+@@ -178,6 +178,10 @@ void i40e_notify_client_of_netdev_close(struct i40e_vsi *vsi, bool reset) |
1003 |
+ "Cannot locate client instance close routine\n"); |
1004 |
+ return; |
1005 |
+ } |
1006 |
++ if (!test_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state)) { |
1007 |
++ dev_dbg(&pf->pdev->dev, "Client is not open, abort close\n"); |
1008 |
++ return; |
1009 |
++ } |
1010 |
+ cdev->client->ops->close(&cdev->lan_info, cdev->client, reset); |
1011 |
+ clear_bit(__I40E_CLIENT_INSTANCE_OPENED, &cdev->state); |
1012 |
+ i40e_client_release_qvlist(&cdev->lan_info); |
1013 |
+@@ -374,7 +378,6 @@ void i40e_client_subtask(struct i40e_pf *pf) |
1014 |
+ /* Remove failed client instance */ |
1015 |
+ clear_bit(__I40E_CLIENT_INSTANCE_OPENED, |
1016 |
+ &cdev->state); |
1017 |
+- i40e_client_del_instance(pf); |
1018 |
+ return; |
1019 |
+ } |
1020 |
+ } |
1021 |
+diff --git a/drivers/net/ethernet/intel/ice/ice_main.c b/drivers/net/ethernet/intel/ice/ice_main.c |
1022 |
+index 810f2bdb91645..f193709c8efc6 100644 |
1023 |
+--- a/drivers/net/ethernet/intel/ice/ice_main.c |
1024 |
++++ b/drivers/net/ethernet/intel/ice/ice_main.c |
1025 |
+@@ -3404,7 +3404,7 @@ static int ice_init_pf(struct ice_pf *pf) |
1026 |
+ |
1027 |
+ pf->avail_rxqs = bitmap_zalloc(pf->max_pf_rxqs, GFP_KERNEL); |
1028 |
+ if (!pf->avail_rxqs) { |
1029 |
+- devm_kfree(ice_pf_to_dev(pf), pf->avail_txqs); |
1030 |
++ bitmap_free(pf->avail_txqs); |
1031 |
+ pf->avail_txqs = NULL; |
1032 |
+ return -ENOMEM; |
1033 |
+ } |
1034 |
+diff --git a/drivers/net/wireless/intel/iwlegacy/4965-rs.c b/drivers/net/wireless/intel/iwlegacy/4965-rs.c |
1035 |
+index 532e3b91777d9..150805aec4071 100644 |
1036 |
+--- a/drivers/net/wireless/intel/iwlegacy/4965-rs.c |
1037 |
++++ b/drivers/net/wireless/intel/iwlegacy/4965-rs.c |
1038 |
+@@ -2403,7 +2403,7 @@ il4965_rs_fill_link_cmd(struct il_priv *il, struct il_lq_sta *lq_sta, |
1039 |
+ /* Repeat initial/next rate. |
1040 |
+ * For legacy IL_NUMBER_TRY == 1, this loop will not execute. |
1041 |
+ * For HT IL_HT_NUMBER_TRY == 3, this executes twice. */ |
1042 |
+- while (repeat_rate > 0) { |
1043 |
++ while (repeat_rate > 0 && idx < (LINK_QUAL_MAX_RETRY_NUM - 1)) { |
1044 |
+ if (is_legacy(tbl_type.lq_type)) { |
1045 |
+ if (ant_toggle_cnt < NUM_TRY_BEFORE_ANT_TOGGLE) |
1046 |
+ ant_toggle_cnt++; |
1047 |
+@@ -2422,8 +2422,6 @@ il4965_rs_fill_link_cmd(struct il_priv *il, struct il_lq_sta *lq_sta, |
1048 |
+ cpu_to_le32(new_rate); |
1049 |
+ repeat_rate--; |
1050 |
+ idx++; |
1051 |
+- if (idx >= LINK_QUAL_MAX_RETRY_NUM) |
1052 |
+- goto out; |
1053 |
+ } |
1054 |
+ |
1055 |
+ il4965_rs_get_tbl_info_from_mcs(new_rate, lq_sta->band, |
1056 |
+@@ -2468,7 +2466,6 @@ il4965_rs_fill_link_cmd(struct il_priv *il, struct il_lq_sta *lq_sta, |
1057 |
+ repeat_rate--; |
1058 |
+ } |
1059 |
+ |
1060 |
+-out: |
1061 |
+ lq_cmd->agg_params.agg_frame_cnt_limit = LINK_QUAL_AGG_FRAME_LIMIT_DEF; |
1062 |
+ lq_cmd->agg_params.agg_dis_start_th = LINK_QUAL_AGG_DISABLE_START_DEF; |
1063 |
+ |
1064 |
+diff --git a/drivers/net/xen-netback/xenbus.c b/drivers/net/xen-netback/xenbus.c |
1065 |
+index ca261e0fc9c9b..9ee9ce0493fe6 100644 |
1066 |
+--- a/drivers/net/xen-netback/xenbus.c |
1067 |
++++ b/drivers/net/xen-netback/xenbus.c |
1068 |
+@@ -256,7 +256,6 @@ static void backend_disconnect(struct backend_info *be) |
1069 |
+ unsigned int queue_index; |
1070 |
+ |
1071 |
+ xen_unregister_watchers(vif); |
1072 |
+- xenbus_rm(XBT_NIL, be->dev->nodename, "hotplug-status"); |
1073 |
+ #ifdef CONFIG_DEBUG_FS |
1074 |
+ xenvif_debugfs_delif(vif); |
1075 |
+ #endif /* CONFIG_DEBUG_FS */ |
1076 |
+@@ -984,6 +983,7 @@ static int netback_remove(struct xenbus_device *dev) |
1077 |
+ struct backend_info *be = dev_get_drvdata(&dev->dev); |
1078 |
+ |
1079 |
+ unregister_hotplug_status_watch(be); |
1080 |
++ xenbus_rm(XBT_NIL, dev->nodename, "hotplug-status"); |
1081 |
+ if (be->vif) { |
1082 |
+ kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE); |
1083 |
+ backend_disconnect(be); |
1084 |
+diff --git a/drivers/nvme/host/tcp.c b/drivers/nvme/host/tcp.c |
1085 |
+index fe8c27bbc3f20..57df87def8c33 100644 |
1086 |
+--- a/drivers/nvme/host/tcp.c |
1087 |
++++ b/drivers/nvme/host/tcp.c |
1088 |
+@@ -118,7 +118,6 @@ struct nvme_tcp_queue { |
1089 |
+ struct mutex send_mutex; |
1090 |
+ struct llist_head req_list; |
1091 |
+ struct list_head send_list; |
1092 |
+- bool more_requests; |
1093 |
+ |
1094 |
+ /* recv state */ |
1095 |
+ void *pdu; |
1096 |
+@@ -314,7 +313,7 @@ static inline void nvme_tcp_send_all(struct nvme_tcp_queue *queue) |
1097 |
+ static inline bool nvme_tcp_queue_more(struct nvme_tcp_queue *queue) |
1098 |
+ { |
1099 |
+ return !list_empty(&queue->send_list) || |
1100 |
+- !llist_empty(&queue->req_list) || queue->more_requests; |
1101 |
++ !llist_empty(&queue->req_list); |
1102 |
+ } |
1103 |
+ |
1104 |
+ static inline void nvme_tcp_queue_request(struct nvme_tcp_request *req, |
1105 |
+@@ -333,9 +332,7 @@ static inline void nvme_tcp_queue_request(struct nvme_tcp_request *req, |
1106 |
+ */ |
1107 |
+ if (queue->io_cpu == raw_smp_processor_id() && |
1108 |
+ sync && empty && mutex_trylock(&queue->send_mutex)) { |
1109 |
+- queue->more_requests = !last; |
1110 |
+ nvme_tcp_send_all(queue); |
1111 |
+- queue->more_requests = false; |
1112 |
+ mutex_unlock(&queue->send_mutex); |
1113 |
+ } |
1114 |
+ |
1115 |
+@@ -1196,7 +1193,7 @@ static void nvme_tcp_io_work(struct work_struct *w) |
1116 |
+ else if (unlikely(result < 0)) |
1117 |
+ return; |
1118 |
+ |
1119 |
+- if (!pending) |
1120 |
++ if (!pending || !queue->rd_enabled) |
1121 |
+ return; |
1122 |
+ |
1123 |
+ } while (!time_after(jiffies, deadline)); /* quota is exhausted */ |
1124 |
+diff --git a/drivers/nvme/target/core.c b/drivers/nvme/target/core.c |
1125 |
+index 9a8fa2e582d5b..bc88ff2912f56 100644 |
1126 |
+--- a/drivers/nvme/target/core.c |
1127 |
++++ b/drivers/nvme/target/core.c |
1128 |
+@@ -730,6 +730,8 @@ static void nvmet_set_error(struct nvmet_req *req, u16 status) |
1129 |
+ |
1130 |
+ static void __nvmet_req_complete(struct nvmet_req *req, u16 status) |
1131 |
+ { |
1132 |
++ struct nvmet_ns *ns = req->ns; |
1133 |
++ |
1134 |
+ if (!req->sq->sqhd_disabled) |
1135 |
+ nvmet_update_sq_head(req); |
1136 |
+ req->cqe->sq_id = cpu_to_le16(req->sq->qid); |
1137 |
+@@ -740,9 +742,9 @@ static void __nvmet_req_complete(struct nvmet_req *req, u16 status) |
1138 |
+ |
1139 |
+ trace_nvmet_req_complete(req); |
1140 |
+ |
1141 |
+- if (req->ns) |
1142 |
+- nvmet_put_namespace(req->ns); |
1143 |
+ req->ops->queue_response(req); |
1144 |
++ if (ns) |
1145 |
++ nvmet_put_namespace(ns); |
1146 |
+ } |
1147 |
+ |
1148 |
+ void nvmet_req_complete(struct nvmet_req *req, u16 status) |
1149 |
+diff --git a/drivers/parisc/ccio-dma.c b/drivers/parisc/ccio-dma.c |
1150 |
+index b916fab9b1618..ffd5000c23d39 100644 |
1151 |
+--- a/drivers/parisc/ccio-dma.c |
1152 |
++++ b/drivers/parisc/ccio-dma.c |
1153 |
+@@ -1380,15 +1380,17 @@ ccio_init_resource(struct resource *res, char *name, void __iomem *ioaddr) |
1154 |
+ } |
1155 |
+ } |
1156 |
+ |
1157 |
+-static void __init ccio_init_resources(struct ioc *ioc) |
1158 |
++static int __init ccio_init_resources(struct ioc *ioc) |
1159 |
+ { |
1160 |
+ struct resource *res = ioc->mmio_region; |
1161 |
+ char *name = kmalloc(14, GFP_KERNEL); |
1162 |
+- |
1163 |
++ if (unlikely(!name)) |
1164 |
++ return -ENOMEM; |
1165 |
+ snprintf(name, 14, "GSC Bus [%d/]", ioc->hw_path); |
1166 |
+ |
1167 |
+ ccio_init_resource(res, name, &ioc->ioc_regs->io_io_low); |
1168 |
+ ccio_init_resource(res + 1, name, &ioc->ioc_regs->io_io_low_hv); |
1169 |
++ return 0; |
1170 |
+ } |
1171 |
+ |
1172 |
+ static int new_ioc_area(struct resource *res, unsigned long size, |
1173 |
+@@ -1543,7 +1545,10 @@ static int __init ccio_probe(struct parisc_device *dev) |
1174 |
+ return -ENOMEM; |
1175 |
+ } |
1176 |
+ ccio_ioc_init(ioc); |
1177 |
+- ccio_init_resources(ioc); |
1178 |
++ if (ccio_init_resources(ioc)) { |
1179 |
++ kfree(ioc); |
1180 |
++ return -ENOMEM; |
1181 |
++ } |
1182 |
+ hppa_dma_ops = &ccio_ops; |
1183 |
+ |
1184 |
+ hba = kzalloc(sizeof(*hba), GFP_KERNEL); |
1185 |
+diff --git a/drivers/regulator/core.c b/drivers/regulator/core.c |
1186 |
+index 6e3f3511e7ddd..317d701487ecd 100644 |
1187 |
+--- a/drivers/regulator/core.c |
1188 |
++++ b/drivers/regulator/core.c |
1189 |
+@@ -2596,13 +2596,18 @@ static int _regulator_do_enable(struct regulator_dev *rdev) |
1190 |
+ */ |
1191 |
+ static int _regulator_handle_consumer_enable(struct regulator *regulator) |
1192 |
+ { |
1193 |
++ int ret; |
1194 |
+ struct regulator_dev *rdev = regulator->rdev; |
1195 |
+ |
1196 |
+ lockdep_assert_held_once(&rdev->mutex.base); |
1197 |
+ |
1198 |
+ regulator->enable_count++; |
1199 |
+- if (regulator->uA_load && regulator->enable_count == 1) |
1200 |
+- return drms_uA_update(rdev); |
1201 |
++ if (regulator->uA_load && regulator->enable_count == 1) { |
1202 |
++ ret = drms_uA_update(rdev); |
1203 |
++ if (ret) |
1204 |
++ regulator->enable_count--; |
1205 |
++ return ret; |
1206 |
++ } |
1207 |
+ |
1208 |
+ return 0; |
1209 |
+ } |
1210 |
+diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c |
1211 |
+index 134e4ee5dc481..17200b453cbbb 100644 |
1212 |
+--- a/drivers/scsi/lpfc/lpfc_init.c |
1213 |
++++ b/drivers/scsi/lpfc/lpfc_init.c |
1214 |
+@@ -6670,7 +6670,7 @@ lpfc_sli4_driver_resource_setup(struct lpfc_hba *phba) |
1215 |
+ /* Allocate device driver memory */ |
1216 |
+ rc = lpfc_mem_alloc(phba, SGL_ALIGN_SZ); |
1217 |
+ if (rc) |
1218 |
+- return -ENOMEM; |
1219 |
++ goto out_destroy_workqueue; |
1220 |
+ |
1221 |
+ /* IF Type 2 ports get initialized now. */ |
1222 |
+ if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) >= |
1223 |
+@@ -7076,6 +7076,9 @@ out_free_bsmbx: |
1224 |
+ lpfc_destroy_bootstrap_mbox(phba); |
1225 |
+ out_free_mem: |
1226 |
+ lpfc_mem_free(phba); |
1227 |
++out_destroy_workqueue: |
1228 |
++ destroy_workqueue(phba->wq); |
1229 |
++ phba->wq = NULL; |
1230 |
+ return rc; |
1231 |
+ } |
1232 |
+ |
1233 |
+diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c |
1234 |
+index 13022a42fd6f4..7838c7911adde 100644 |
1235 |
+--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c |
1236 |
++++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c |
1237 |
+@@ -5198,7 +5198,6 @@ megasas_alloc_fusion_context(struct megasas_instance *instance) |
1238 |
+ if (!fusion->log_to_span) { |
1239 |
+ dev_err(&instance->pdev->dev, "Failed from %s %d\n", |
1240 |
+ __func__, __LINE__); |
1241 |
+- kfree(instance->ctrl_context); |
1242 |
+ return -ENOMEM; |
1243 |
+ } |
1244 |
+ } |
1245 |
+diff --git a/drivers/scsi/mpt3sas/mpt3sas_scsih.c b/drivers/scsi/mpt3sas/mpt3sas_scsih.c |
1246 |
+index 8418b59b3743b..c3a5978b0efac 100644 |
1247 |
+--- a/drivers/scsi/mpt3sas/mpt3sas_scsih.c |
1248 |
++++ b/drivers/scsi/mpt3sas/mpt3sas_scsih.c |
1249 |
+@@ -3501,6 +3501,7 @@ static struct fw_event_work *dequeue_next_fw_event(struct MPT3SAS_ADAPTER *ioc) |
1250 |
+ fw_event = list_first_entry(&ioc->fw_event_list, |
1251 |
+ struct fw_event_work, list); |
1252 |
+ list_del_init(&fw_event->list); |
1253 |
++ fw_event_work_put(fw_event); |
1254 |
+ } |
1255 |
+ spin_unlock_irqrestore(&ioc->fw_event_lock, flags); |
1256 |
+ |
1257 |
+@@ -3559,7 +3560,6 @@ _scsih_fw_event_cleanup_queue(struct MPT3SAS_ADAPTER *ioc) |
1258 |
+ if (cancel_work_sync(&fw_event->work)) |
1259 |
+ fw_event_work_put(fw_event); |
1260 |
+ |
1261 |
+- fw_event_work_put(fw_event); |
1262 |
+ } |
1263 |
+ ioc->fw_events_cleanup = 0; |
1264 |
+ } |
1265 |
+diff --git a/drivers/scsi/qla2xxx/qla_target.c b/drivers/scsi/qla2xxx/qla_target.c |
1266 |
+index ba823e8eb902b..ecb30c2738b8b 100644 |
1267 |
+--- a/drivers/scsi/qla2xxx/qla_target.c |
1268 |
++++ b/drivers/scsi/qla2xxx/qla_target.c |
1269 |
+@@ -6817,14 +6817,8 @@ qlt_24xx_config_rings(struct scsi_qla_host *vha) |
1270 |
+ |
1271 |
+ if (ha->flags.msix_enabled) { |
1272 |
+ if (IS_QLA83XX(ha) || IS_QLA27XX(ha) || IS_QLA28XX(ha)) { |
1273 |
+- if (IS_QLA2071(ha)) { |
1274 |
+- /* 4 ports Baker: Enable Interrupt Handshake */ |
1275 |
+- icb->msix_atio = 0; |
1276 |
+- icb->firmware_options_2 |= cpu_to_le32(BIT_26); |
1277 |
+- } else { |
1278 |
+- icb->msix_atio = cpu_to_le16(msix->entry); |
1279 |
+- icb->firmware_options_2 &= cpu_to_le32(~BIT_26); |
1280 |
+- } |
1281 |
++ icb->msix_atio = cpu_to_le16(msix->entry); |
1282 |
++ icb->firmware_options_2 &= cpu_to_le32(~BIT_26); |
1283 |
+ ql_dbg(ql_dbg_init, vha, 0xf072, |
1284 |
+ "Registering ICB vector 0x%x for atio que.\n", |
1285 |
+ msix->entry); |
1286 |
+diff --git a/drivers/soc/bcm/brcmstb/pm/pm-arm.c b/drivers/soc/bcm/brcmstb/pm/pm-arm.c |
1287 |
+index c6ec7d95bcfcc..722fd54e537cf 100644 |
1288 |
+--- a/drivers/soc/bcm/brcmstb/pm/pm-arm.c |
1289 |
++++ b/drivers/soc/bcm/brcmstb/pm/pm-arm.c |
1290 |
+@@ -681,13 +681,14 @@ static int brcmstb_pm_probe(struct platform_device *pdev) |
1291 |
+ const struct of_device_id *of_id = NULL; |
1292 |
+ struct device_node *dn; |
1293 |
+ void __iomem *base; |
1294 |
+- int ret, i; |
1295 |
++ int ret, i, s; |
1296 |
+ |
1297 |
+ /* AON ctrl registers */ |
1298 |
+ base = brcmstb_ioremap_match(aon_ctrl_dt_ids, 0, NULL); |
1299 |
+ if (IS_ERR(base)) { |
1300 |
+ pr_err("error mapping AON_CTRL\n"); |
1301 |
+- return PTR_ERR(base); |
1302 |
++ ret = PTR_ERR(base); |
1303 |
++ goto aon_err; |
1304 |
+ } |
1305 |
+ ctrl.aon_ctrl_base = base; |
1306 |
+ |
1307 |
+@@ -697,8 +698,10 @@ static int brcmstb_pm_probe(struct platform_device *pdev) |
1308 |
+ /* Assume standard offset */ |
1309 |
+ ctrl.aon_sram = ctrl.aon_ctrl_base + |
1310 |
+ AON_CTRL_SYSTEM_DATA_RAM_OFS; |
1311 |
++ s = 0; |
1312 |
+ } else { |
1313 |
+ ctrl.aon_sram = base; |
1314 |
++ s = 1; |
1315 |
+ } |
1316 |
+ |
1317 |
+ writel_relaxed(0, ctrl.aon_sram + AON_REG_PANIC); |
1318 |
+@@ -708,7 +711,8 @@ static int brcmstb_pm_probe(struct platform_device *pdev) |
1319 |
+ (const void **)&ddr_phy_data); |
1320 |
+ if (IS_ERR(base)) { |
1321 |
+ pr_err("error mapping DDR PHY\n"); |
1322 |
+- return PTR_ERR(base); |
1323 |
++ ret = PTR_ERR(base); |
1324 |
++ goto ddr_phy_err; |
1325 |
+ } |
1326 |
+ ctrl.support_warm_boot = ddr_phy_data->supports_warm_boot; |
1327 |
+ ctrl.pll_status_offset = ddr_phy_data->pll_status_offset; |
1328 |
+@@ -728,17 +732,20 @@ static int brcmstb_pm_probe(struct platform_device *pdev) |
1329 |
+ for_each_matching_node(dn, ddr_shimphy_dt_ids) { |
1330 |
+ i = ctrl.num_memc; |
1331 |
+ if (i >= MAX_NUM_MEMC) { |
1332 |
++ of_node_put(dn); |
1333 |
+ pr_warn("too many MEMCs (max %d)\n", MAX_NUM_MEMC); |
1334 |
+ break; |
1335 |
+ } |
1336 |
+ |
1337 |
+ base = of_io_request_and_map(dn, 0, dn->full_name); |
1338 |
+ if (IS_ERR(base)) { |
1339 |
++ of_node_put(dn); |
1340 |
+ if (!ctrl.support_warm_boot) |
1341 |
+ break; |
1342 |
+ |
1343 |
+ pr_err("error mapping DDR SHIMPHY %d\n", i); |
1344 |
+- return PTR_ERR(base); |
1345 |
++ ret = PTR_ERR(base); |
1346 |
++ goto ddr_shimphy_err; |
1347 |
+ } |
1348 |
+ ctrl.memcs[i].ddr_shimphy_base = base; |
1349 |
+ ctrl.num_memc++; |
1350 |
+@@ -749,14 +756,18 @@ static int brcmstb_pm_probe(struct platform_device *pdev) |
1351 |
+ for_each_matching_node(dn, brcmstb_memc_of_match) { |
1352 |
+ base = of_iomap(dn, 0); |
1353 |
+ if (!base) { |
1354 |
++ of_node_put(dn); |
1355 |
+ pr_err("error mapping DDR Sequencer %d\n", i); |
1356 |
+- return -ENOMEM; |
1357 |
++ ret = -ENOMEM; |
1358 |
++ goto brcmstb_memc_err; |
1359 |
+ } |
1360 |
+ |
1361 |
+ of_id = of_match_node(brcmstb_memc_of_match, dn); |
1362 |
+ if (!of_id) { |
1363 |
+ iounmap(base); |
1364 |
+- return -EINVAL; |
1365 |
++ of_node_put(dn); |
1366 |
++ ret = -EINVAL; |
1367 |
++ goto brcmstb_memc_err; |
1368 |
+ } |
1369 |
+ |
1370 |
+ ddr_seq_data = of_id->data; |
1371 |
+@@ -776,21 +787,24 @@ static int brcmstb_pm_probe(struct platform_device *pdev) |
1372 |
+ dn = of_find_matching_node(NULL, sram_dt_ids); |
1373 |
+ if (!dn) { |
1374 |
+ pr_err("SRAM not found\n"); |
1375 |
+- return -EINVAL; |
1376 |
++ ret = -EINVAL; |
1377 |
++ goto brcmstb_memc_err; |
1378 |
+ } |
1379 |
+ |
1380 |
+ ret = brcmstb_init_sram(dn); |
1381 |
+ of_node_put(dn); |
1382 |
+ if (ret) { |
1383 |
+ pr_err("error setting up SRAM for PM\n"); |
1384 |
+- return ret; |
1385 |
++ goto brcmstb_memc_err; |
1386 |
+ } |
1387 |
+ |
1388 |
+ ctrl.pdev = pdev; |
1389 |
+ |
1390 |
+ ctrl.s3_params = kmalloc(sizeof(*ctrl.s3_params), GFP_KERNEL); |
1391 |
+- if (!ctrl.s3_params) |
1392 |
+- return -ENOMEM; |
1393 |
++ if (!ctrl.s3_params) { |
1394 |
++ ret = -ENOMEM; |
1395 |
++ goto s3_params_err; |
1396 |
++ } |
1397 |
+ ctrl.s3_params_pa = dma_map_single(&pdev->dev, ctrl.s3_params, |
1398 |
+ sizeof(*ctrl.s3_params), |
1399 |
+ DMA_TO_DEVICE); |
1400 |
+@@ -810,7 +824,21 @@ static int brcmstb_pm_probe(struct platform_device *pdev) |
1401 |
+ |
1402 |
+ out: |
1403 |
+ kfree(ctrl.s3_params); |
1404 |
+- |
1405 |
++s3_params_err: |
1406 |
++ iounmap(ctrl.boot_sram); |
1407 |
++brcmstb_memc_err: |
1408 |
++ for (i--; i >= 0; i--) |
1409 |
++ iounmap(ctrl.memcs[i].ddr_ctrl); |
1410 |
++ddr_shimphy_err: |
1411 |
++ for (i = 0; i < ctrl.num_memc; i++) |
1412 |
++ iounmap(ctrl.memcs[i].ddr_shimphy_base); |
1413 |
++ |
1414 |
++ iounmap(ctrl.memcs[0].ddr_phy_base); |
1415 |
++ddr_phy_err: |
1416 |
++ iounmap(ctrl.aon_ctrl_base); |
1417 |
++ if (s) |
1418 |
++ iounmap(ctrl.aon_sram); |
1419 |
++aon_err: |
1420 |
+ pr_warn("PM: initialization failed with code %d\n", ret); |
1421 |
+ |
1422 |
+ return ret; |
1423 |
+diff --git a/drivers/tee/tee_shm.c b/drivers/tee/tee_shm.c |
1424 |
+index 499fccba3d74b..6fb4400333fb4 100644 |
1425 |
+--- a/drivers/tee/tee_shm.c |
1426 |
++++ b/drivers/tee/tee_shm.c |
1427 |
+@@ -9,6 +9,7 @@ |
1428 |
+ #include <linux/sched.h> |
1429 |
+ #include <linux/slab.h> |
1430 |
+ #include <linux/tee_drv.h> |
1431 |
++#include <linux/uaccess.h> |
1432 |
+ #include <linux/uio.h> |
1433 |
+ #include "tee_private.h" |
1434 |
+ |
1435 |
+diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c |
1436 |
+index cb5ed4155a8d2..c91a3004931f1 100644 |
1437 |
+--- a/drivers/tty/n_gsm.c |
1438 |
++++ b/drivers/tty/n_gsm.c |
1439 |
+@@ -235,7 +235,7 @@ struct gsm_mux { |
1440 |
+ int old_c_iflag; /* termios c_iflag value before attach */ |
1441 |
+ bool constipated; /* Asked by remote to shut up */ |
1442 |
+ |
1443 |
+- spinlock_t tx_lock; |
1444 |
++ struct mutex tx_mutex; |
1445 |
+ unsigned int tx_bytes; /* TX data outstanding */ |
1446 |
+ #define TX_THRESH_HI 8192 |
1447 |
+ #define TX_THRESH_LO 2048 |
1448 |
+@@ -820,15 +820,14 @@ static void __gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) |
1449 |
+ * |
1450 |
+ * Add data to the transmit queue and try and get stuff moving |
1451 |
+ * out of the mux tty if not already doing so. Take the |
1452 |
+- * the gsm tx lock and dlci lock. |
1453 |
++ * the gsm tx mutex and dlci lock. |
1454 |
+ */ |
1455 |
+ |
1456 |
+ static void gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) |
1457 |
+ { |
1458 |
+- unsigned long flags; |
1459 |
+- spin_lock_irqsave(&dlci->gsm->tx_lock, flags); |
1460 |
++ mutex_lock(&dlci->gsm->tx_mutex); |
1461 |
+ __gsm_data_queue(dlci, msg); |
1462 |
+- spin_unlock_irqrestore(&dlci->gsm->tx_lock, flags); |
1463 |
++ mutex_unlock(&dlci->gsm->tx_mutex); |
1464 |
+ } |
1465 |
+ |
1466 |
+ /** |
1467 |
+@@ -840,7 +839,7 @@ static void gsm_data_queue(struct gsm_dlci *dlci, struct gsm_msg *msg) |
1468 |
+ * is data. Keep to the MRU of the mux. This path handles the usual tty |
1469 |
+ * interface which is a byte stream with optional modem data. |
1470 |
+ * |
1471 |
+- * Caller must hold the tx_lock of the mux. |
1472 |
++ * Caller must hold the tx_mutex of the mux. |
1473 |
+ */ |
1474 |
+ |
1475 |
+ static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci) |
1476 |
+@@ -903,7 +902,7 @@ static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci) |
1477 |
+ * is data. Keep to the MRU of the mux. This path handles framed data |
1478 |
+ * queued as skbuffs to the DLCI. |
1479 |
+ * |
1480 |
+- * Caller must hold the tx_lock of the mux. |
1481 |
++ * Caller must hold the tx_mutex of the mux. |
1482 |
+ */ |
1483 |
+ |
1484 |
+ static int gsm_dlci_data_output_framed(struct gsm_mux *gsm, |
1485 |
+@@ -919,7 +918,7 @@ static int gsm_dlci_data_output_framed(struct gsm_mux *gsm, |
1486 |
+ if (dlci->adaption == 4) |
1487 |
+ overhead = 1; |
1488 |
+ |
1489 |
+- /* dlci->skb is locked by tx_lock */ |
1490 |
++ /* dlci->skb is locked by tx_mutex */ |
1491 |
+ if (dlci->skb == NULL) { |
1492 |
+ dlci->skb = skb_dequeue_tail(&dlci->skb_list); |
1493 |
+ if (dlci->skb == NULL) |
1494 |
+@@ -1019,13 +1018,12 @@ static void gsm_dlci_data_sweep(struct gsm_mux *gsm) |
1495 |
+ |
1496 |
+ static void gsm_dlci_data_kick(struct gsm_dlci *dlci) |
1497 |
+ { |
1498 |
+- unsigned long flags; |
1499 |
+ int sweep; |
1500 |
+ |
1501 |
+ if (dlci->constipated) |
1502 |
+ return; |
1503 |
+ |
1504 |
+- spin_lock_irqsave(&dlci->gsm->tx_lock, flags); |
1505 |
++ mutex_lock(&dlci->gsm->tx_mutex); |
1506 |
+ /* If we have nothing running then we need to fire up */ |
1507 |
+ sweep = (dlci->gsm->tx_bytes < TX_THRESH_LO); |
1508 |
+ if (dlci->gsm->tx_bytes == 0) { |
1509 |
+@@ -1036,7 +1034,7 @@ static void gsm_dlci_data_kick(struct gsm_dlci *dlci) |
1510 |
+ } |
1511 |
+ if (sweep) |
1512 |
+ gsm_dlci_data_sweep(dlci->gsm); |
1513 |
+- spin_unlock_irqrestore(&dlci->gsm->tx_lock, flags); |
1514 |
++ mutex_unlock(&dlci->gsm->tx_mutex); |
1515 |
+ } |
1516 |
+ |
1517 |
+ /* |
1518 |
+@@ -1258,7 +1256,6 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command, |
1519 |
+ const u8 *data, int clen) |
1520 |
+ { |
1521 |
+ u8 buf[1]; |
1522 |
+- unsigned long flags; |
1523 |
+ |
1524 |
+ switch (command) { |
1525 |
+ case CMD_CLD: { |
1526 |
+@@ -1280,9 +1277,9 @@ static void gsm_control_message(struct gsm_mux *gsm, unsigned int command, |
1527 |
+ gsm->constipated = false; |
1528 |
+ gsm_control_reply(gsm, CMD_FCON, NULL, 0); |
1529 |
+ /* Kick the link in case it is idling */ |
1530 |
+- spin_lock_irqsave(&gsm->tx_lock, flags); |
1531 |
++ mutex_lock(&gsm->tx_mutex); |
1532 |
+ gsm_data_kick(gsm, NULL); |
1533 |
+- spin_unlock_irqrestore(&gsm->tx_lock, flags); |
1534 |
++ mutex_unlock(&gsm->tx_mutex); |
1535 |
+ break; |
1536 |
+ case CMD_FCOFF: |
1537 |
+ /* Modem wants us to STFU */ |
1538 |
+@@ -2200,11 +2197,6 @@ static int gsm_activate_mux(struct gsm_mux *gsm) |
1539 |
+ { |
1540 |
+ struct gsm_dlci *dlci; |
1541 |
+ |
1542 |
+- timer_setup(&gsm->t2_timer, gsm_control_retransmit, 0); |
1543 |
+- init_waitqueue_head(&gsm->event); |
1544 |
+- spin_lock_init(&gsm->control_lock); |
1545 |
+- spin_lock_init(&gsm->tx_lock); |
1546 |
+- |
1547 |
+ if (gsm->encoding == 0) |
1548 |
+ gsm->receive = gsm0_receive; |
1549 |
+ else |
1550 |
+@@ -2233,6 +2225,7 @@ static void gsm_free_mux(struct gsm_mux *gsm) |
1551 |
+ break; |
1552 |
+ } |
1553 |
+ } |
1554 |
++ mutex_destroy(&gsm->tx_mutex); |
1555 |
+ mutex_destroy(&gsm->mutex); |
1556 |
+ kfree(gsm->txframe); |
1557 |
+ kfree(gsm->buf); |
1558 |
+@@ -2304,8 +2297,12 @@ static struct gsm_mux *gsm_alloc_mux(void) |
1559 |
+ } |
1560 |
+ spin_lock_init(&gsm->lock); |
1561 |
+ mutex_init(&gsm->mutex); |
1562 |
++ mutex_init(&gsm->tx_mutex); |
1563 |
+ kref_init(&gsm->ref); |
1564 |
+ INIT_LIST_HEAD(&gsm->tx_list); |
1565 |
++ timer_setup(&gsm->t2_timer, gsm_control_retransmit, 0); |
1566 |
++ init_waitqueue_head(&gsm->event); |
1567 |
++ spin_lock_init(&gsm->control_lock); |
1568 |
+ |
1569 |
+ gsm->t1 = T1; |
1570 |
+ gsm->t2 = T2; |
1571 |
+@@ -2330,6 +2327,7 @@ static struct gsm_mux *gsm_alloc_mux(void) |
1572 |
+ } |
1573 |
+ spin_unlock(&gsm_mux_lock); |
1574 |
+ if (i == MAX_MUX) { |
1575 |
++ mutex_destroy(&gsm->tx_mutex); |
1576 |
+ mutex_destroy(&gsm->mutex); |
1577 |
+ kfree(gsm->txframe); |
1578 |
+ kfree(gsm->buf); |
1579 |
+@@ -2654,16 +2652,15 @@ static int gsmld_open(struct tty_struct *tty) |
1580 |
+ static void gsmld_write_wakeup(struct tty_struct *tty) |
1581 |
+ { |
1582 |
+ struct gsm_mux *gsm = tty->disc_data; |
1583 |
+- unsigned long flags; |
1584 |
+ |
1585 |
+ /* Queue poll */ |
1586 |
+ clear_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); |
1587 |
+- spin_lock_irqsave(&gsm->tx_lock, flags); |
1588 |
++ mutex_lock(&gsm->tx_mutex); |
1589 |
+ gsm_data_kick(gsm, NULL); |
1590 |
+ if (gsm->tx_bytes < TX_THRESH_LO) { |
1591 |
+ gsm_dlci_data_sweep(gsm); |
1592 |
+ } |
1593 |
+- spin_unlock_irqrestore(&gsm->tx_lock, flags); |
1594 |
++ mutex_unlock(&gsm->tx_mutex); |
1595 |
+ } |
1596 |
+ |
1597 |
+ /** |
1598 |
+@@ -2706,7 +2703,6 @@ static ssize_t gsmld_write(struct tty_struct *tty, struct file *file, |
1599 |
+ const unsigned char *buf, size_t nr) |
1600 |
+ { |
1601 |
+ struct gsm_mux *gsm = tty->disc_data; |
1602 |
+- unsigned long flags; |
1603 |
+ int space; |
1604 |
+ int ret; |
1605 |
+ |
1606 |
+@@ -2714,13 +2710,13 @@ static ssize_t gsmld_write(struct tty_struct *tty, struct file *file, |
1607 |
+ return -ENODEV; |
1608 |
+ |
1609 |
+ ret = -ENOBUFS; |
1610 |
+- spin_lock_irqsave(&gsm->tx_lock, flags); |
1611 |
++ mutex_lock(&gsm->tx_mutex); |
1612 |
+ space = tty_write_room(tty); |
1613 |
+ if (space >= nr) |
1614 |
+ ret = tty->ops->write(tty, buf, nr); |
1615 |
+ else |
1616 |
+ set_bit(TTY_DO_WRITE_WAKEUP, &tty->flags); |
1617 |
+- spin_unlock_irqrestore(&gsm->tx_lock, flags); |
1618 |
++ mutex_unlock(&gsm->tx_mutex); |
1619 |
+ |
1620 |
+ return ret; |
1621 |
+ } |
1622 |
+diff --git a/drivers/video/fbdev/chipsfb.c b/drivers/video/fbdev/chipsfb.c |
1623 |
+index 393894af26f84..2b00a9d554fc0 100644 |
1624 |
+--- a/drivers/video/fbdev/chipsfb.c |
1625 |
++++ b/drivers/video/fbdev/chipsfb.c |
1626 |
+@@ -430,6 +430,7 @@ static int chipsfb_pci_init(struct pci_dev *dp, const struct pci_device_id *ent) |
1627 |
+ err_release_fb: |
1628 |
+ framebuffer_release(p); |
1629 |
+ err_disable: |
1630 |
++ pci_disable_device(dp); |
1631 |
+ err_out: |
1632 |
+ return rc; |
1633 |
+ } |
1634 |
+diff --git a/fs/afs/flock.c b/fs/afs/flock.c |
1635 |
+index cb3054c7843ea..466ad609f2057 100644 |
1636 |
+--- a/fs/afs/flock.c |
1637 |
++++ b/fs/afs/flock.c |
1638 |
+@@ -76,7 +76,7 @@ void afs_lock_op_done(struct afs_call *call) |
1639 |
+ if (call->error == 0) { |
1640 |
+ spin_lock(&vnode->lock); |
1641 |
+ trace_afs_flock_ev(vnode, NULL, afs_flock_timestamp, 0); |
1642 |
+- vnode->locked_at = call->reply_time; |
1643 |
++ vnode->locked_at = call->issue_time; |
1644 |
+ afs_schedule_lock_extension(vnode); |
1645 |
+ spin_unlock(&vnode->lock); |
1646 |
+ } |
1647 |
+diff --git a/fs/afs/fsclient.c b/fs/afs/fsclient.c |
1648 |
+index 1d95ed9dd86e6..0048a32cb040e 100644 |
1649 |
+--- a/fs/afs/fsclient.c |
1650 |
++++ b/fs/afs/fsclient.c |
1651 |
+@@ -130,7 +130,7 @@ bad: |
1652 |
+ |
1653 |
+ static time64_t xdr_decode_expiry(struct afs_call *call, u32 expiry) |
1654 |
+ { |
1655 |
+- return ktime_divns(call->reply_time, NSEC_PER_SEC) + expiry; |
1656 |
++ return ktime_divns(call->issue_time, NSEC_PER_SEC) + expiry; |
1657 |
+ } |
1658 |
+ |
1659 |
+ static void xdr_decode_AFSCallBack(const __be32 **_bp, |
1660 |
+diff --git a/fs/afs/internal.h b/fs/afs/internal.h |
1661 |
+index dc08a3d9b3a8b..637cbe549397c 100644 |
1662 |
+--- a/fs/afs/internal.h |
1663 |
++++ b/fs/afs/internal.h |
1664 |
+@@ -135,7 +135,6 @@ struct afs_call { |
1665 |
+ bool need_attention; /* T if RxRPC poked us */ |
1666 |
+ bool async; /* T if asynchronous */ |
1667 |
+ bool upgrade; /* T to request service upgrade */ |
1668 |
+- bool have_reply_time; /* T if have got reply_time */ |
1669 |
+ bool intr; /* T if interruptible */ |
1670 |
+ bool unmarshalling_error; /* T if an unmarshalling error occurred */ |
1671 |
+ u16 service_id; /* Actual service ID (after upgrade) */ |
1672 |
+@@ -149,7 +148,7 @@ struct afs_call { |
1673 |
+ } __attribute__((packed)); |
1674 |
+ __be64 tmp64; |
1675 |
+ }; |
1676 |
+- ktime_t reply_time; /* Time of first reply packet */ |
1677 |
++ ktime_t issue_time; /* Time of issue of operation */ |
1678 |
+ }; |
1679 |
+ |
1680 |
+ struct afs_call_type { |
1681 |
+diff --git a/fs/afs/rxrpc.c b/fs/afs/rxrpc.c |
1682 |
+index efe0fb3ad8bdc..535d28b44bca3 100644 |
1683 |
+--- a/fs/afs/rxrpc.c |
1684 |
++++ b/fs/afs/rxrpc.c |
1685 |
+@@ -429,6 +429,7 @@ void afs_make_call(struct afs_addr_cursor *ac, struct afs_call *call, gfp_t gfp) |
1686 |
+ if (call->max_lifespan) |
1687 |
+ rxrpc_kernel_set_max_life(call->net->socket, rxcall, |
1688 |
+ call->max_lifespan); |
1689 |
++ call->issue_time = ktime_get_real(); |
1690 |
+ |
1691 |
+ /* send the request */ |
1692 |
+ iov[0].iov_base = call->request; |
1693 |
+@@ -533,12 +534,6 @@ static void afs_deliver_to_call(struct afs_call *call) |
1694 |
+ return; |
1695 |
+ } |
1696 |
+ |
1697 |
+- if (!call->have_reply_time && |
1698 |
+- rxrpc_kernel_get_reply_time(call->net->socket, |
1699 |
+- call->rxcall, |
1700 |
+- &call->reply_time)) |
1701 |
+- call->have_reply_time = true; |
1702 |
+- |
1703 |
+ ret = call->type->deliver(call); |
1704 |
+ state = READ_ONCE(call->state); |
1705 |
+ if (ret == 0 && call->unmarshalling_error) |
1706 |
+diff --git a/fs/afs/yfsclient.c b/fs/afs/yfsclient.c |
1707 |
+index bd787e71a657f..5b2ef5ffd716f 100644 |
1708 |
+--- a/fs/afs/yfsclient.c |
1709 |
++++ b/fs/afs/yfsclient.c |
1710 |
+@@ -239,8 +239,7 @@ static void xdr_decode_YFSCallBack(const __be32 **_bp, |
1711 |
+ struct afs_callback *cb = &scb->callback; |
1712 |
+ ktime_t cb_expiry; |
1713 |
+ |
1714 |
+- cb_expiry = call->reply_time; |
1715 |
+- cb_expiry = ktime_add(cb_expiry, xdr_to_u64(x->expiration_time) * 100); |
1716 |
++ cb_expiry = ktime_add(call->issue_time, xdr_to_u64(x->expiration_time) * 100); |
1717 |
+ cb->expires_at = ktime_divns(cb_expiry, NSEC_PER_SEC); |
1718 |
+ scb->have_cb = true; |
1719 |
+ *_bp += xdr_size(x); |
1720 |
+diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c |
1721 |
+index 2fa3ba354cc96..001c26daacbaa 100644 |
1722 |
+--- a/fs/cifs/smb2file.c |
1723 |
++++ b/fs/cifs/smb2file.c |
1724 |
+@@ -74,7 +74,6 @@ smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms, |
1725 |
+ nr_ioctl_req.Reserved = 0; |
1726 |
+ rc = SMB2_ioctl(xid, oparms->tcon, fid->persistent_fid, |
1727 |
+ fid->volatile_fid, FSCTL_LMR_REQUEST_RESILIENCY, |
1728 |
+- true /* is_fsctl */, |
1729 |
+ (char *)&nr_ioctl_req, sizeof(nr_ioctl_req), |
1730 |
+ CIFSMaxBufSize, NULL, NULL /* no return info */); |
1731 |
+ if (rc == -EOPNOTSUPP) { |
1732 |
+diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c |
1733 |
+index b6d72e3c5ebad..11efd5289ec43 100644 |
1734 |
+--- a/fs/cifs/smb2ops.c |
1735 |
++++ b/fs/cifs/smb2ops.c |
1736 |
+@@ -587,7 +587,7 @@ SMB3_request_interfaces(const unsigned int xid, struct cifs_tcon *tcon) |
1737 |
+ struct cifs_ses *ses = tcon->ses; |
1738 |
+ |
1739 |
+ rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID, |
1740 |
+- FSCTL_QUERY_NETWORK_INTERFACE_INFO, true /* is_fsctl */, |
1741 |
++ FSCTL_QUERY_NETWORK_INTERFACE_INFO, |
1742 |
+ NULL /* no data input */, 0 /* no data input */, |
1743 |
+ CIFSMaxBufSize, (char **)&out_buf, &ret_data_len); |
1744 |
+ if (rc == -EOPNOTSUPP) { |
1745 |
+@@ -1470,9 +1470,8 @@ SMB2_request_res_key(const unsigned int xid, struct cifs_tcon *tcon, |
1746 |
+ struct resume_key_req *res_key; |
1747 |
+ |
1748 |
+ rc = SMB2_ioctl(xid, tcon, persistent_fid, volatile_fid, |
1749 |
+- FSCTL_SRV_REQUEST_RESUME_KEY, true /* is_fsctl */, |
1750 |
+- NULL, 0 /* no input */, CIFSMaxBufSize, |
1751 |
+- (char **)&res_key, &ret_data_len); |
1752 |
++ FSCTL_SRV_REQUEST_RESUME_KEY, NULL, 0 /* no input */, |
1753 |
++ CIFSMaxBufSize, (char **)&res_key, &ret_data_len); |
1754 |
+ |
1755 |
+ if (rc) { |
1756 |
+ cifs_tcon_dbg(VFS, "refcpy ioctl error %d getting resume key\n", rc); |
1757 |
+@@ -1611,7 +1610,7 @@ smb2_ioctl_query_info(const unsigned int xid, |
1758 |
+ rqst[1].rq_nvec = SMB2_IOCTL_IOV_SIZE; |
1759 |
+ |
1760 |
+ rc = SMB2_ioctl_init(tcon, server, &rqst[1], COMPOUND_FID, COMPOUND_FID, |
1761 |
+- qi.info_type, true, buffer, qi.output_buffer_length, |
1762 |
++ qi.info_type, buffer, qi.output_buffer_length, |
1763 |
+ CIFSMaxBufSize - MAX_SMB2_CREATE_RESPONSE_SIZE - |
1764 |
+ MAX_SMB2_CLOSE_RESPONSE_SIZE); |
1765 |
+ free_req1_func = SMB2_ioctl_free; |
1766 |
+@@ -1787,9 +1786,8 @@ smb2_copychunk_range(const unsigned int xid, |
1767 |
+ retbuf = NULL; |
1768 |
+ rc = SMB2_ioctl(xid, tcon, trgtfile->fid.persistent_fid, |
1769 |
+ trgtfile->fid.volatile_fid, FSCTL_SRV_COPYCHUNK_WRITE, |
1770 |
+- true /* is_fsctl */, (char *)pcchunk, |
1771 |
+- sizeof(struct copychunk_ioctl), CIFSMaxBufSize, |
1772 |
+- (char **)&retbuf, &ret_data_len); |
1773 |
++ (char *)pcchunk, sizeof(struct copychunk_ioctl), |
1774 |
++ CIFSMaxBufSize, (char **)&retbuf, &ret_data_len); |
1775 |
+ if (rc == 0) { |
1776 |
+ if (ret_data_len != |
1777 |
+ sizeof(struct copychunk_ioctl_rsp)) { |
1778 |
+@@ -1949,7 +1947,6 @@ static bool smb2_set_sparse(const unsigned int xid, struct cifs_tcon *tcon, |
1779 |
+ |
1780 |
+ rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid, |
1781 |
+ cfile->fid.volatile_fid, FSCTL_SET_SPARSE, |
1782 |
+- true /* is_fctl */, |
1783 |
+ &setsparse, 1, CIFSMaxBufSize, NULL, NULL); |
1784 |
+ if (rc) { |
1785 |
+ tcon->broken_sparse_sup = true; |
1786 |
+@@ -2032,7 +2029,6 @@ smb2_duplicate_extents(const unsigned int xid, |
1787 |
+ rc = SMB2_ioctl(xid, tcon, trgtfile->fid.persistent_fid, |
1788 |
+ trgtfile->fid.volatile_fid, |
1789 |
+ FSCTL_DUPLICATE_EXTENTS_TO_FILE, |
1790 |
+- true /* is_fsctl */, |
1791 |
+ (char *)&dup_ext_buf, |
1792 |
+ sizeof(struct duplicate_extents_to_file), |
1793 |
+ CIFSMaxBufSize, NULL, |
1794 |
+@@ -2067,7 +2063,6 @@ smb3_set_integrity(const unsigned int xid, struct cifs_tcon *tcon, |
1795 |
+ return SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid, |
1796 |
+ cfile->fid.volatile_fid, |
1797 |
+ FSCTL_SET_INTEGRITY_INFORMATION, |
1798 |
+- true /* is_fsctl */, |
1799 |
+ (char *)&integr_info, |
1800 |
+ sizeof(struct fsctl_set_integrity_information_req), |
1801 |
+ CIFSMaxBufSize, NULL, |
1802 |
+@@ -2120,7 +2115,6 @@ smb3_enum_snapshots(const unsigned int xid, struct cifs_tcon *tcon, |
1803 |
+ rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid, |
1804 |
+ cfile->fid.volatile_fid, |
1805 |
+ FSCTL_SRV_ENUMERATE_SNAPSHOTS, |
1806 |
+- true /* is_fsctl */, |
1807 |
+ NULL, 0 /* no input data */, max_response_size, |
1808 |
+ (char **)&retbuf, |
1809 |
+ &ret_data_len); |
1810 |
+@@ -2762,7 +2756,6 @@ smb2_get_dfs_refer(const unsigned int xid, struct cifs_ses *ses, |
1811 |
+ do { |
1812 |
+ rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID, |
1813 |
+ FSCTL_DFS_GET_REFERRALS, |
1814 |
+- true /* is_fsctl */, |
1815 |
+ (char *)dfs_req, dfs_req_size, CIFSMaxBufSize, |
1816 |
+ (char **)&dfs_rsp, &dfs_rsp_size); |
1817 |
+ } while (rc == -EAGAIN); |
1818 |
+@@ -2964,8 +2957,7 @@ smb2_query_symlink(const unsigned int xid, struct cifs_tcon *tcon, |
1819 |
+ |
1820 |
+ rc = SMB2_ioctl_init(tcon, server, |
1821 |
+ &rqst[1], fid.persistent_fid, |
1822 |
+- fid.volatile_fid, FSCTL_GET_REPARSE_POINT, |
1823 |
+- true /* is_fctl */, NULL, 0, |
1824 |
++ fid.volatile_fid, FSCTL_GET_REPARSE_POINT, NULL, 0, |
1825 |
+ CIFSMaxBufSize - |
1826 |
+ MAX_SMB2_CREATE_RESPONSE_SIZE - |
1827 |
+ MAX_SMB2_CLOSE_RESPONSE_SIZE); |
1828 |
+@@ -3145,8 +3137,7 @@ smb2_query_reparse_tag(const unsigned int xid, struct cifs_tcon *tcon, |
1829 |
+ |
1830 |
+ rc = SMB2_ioctl_init(tcon, server, |
1831 |
+ &rqst[1], COMPOUND_FID, |
1832 |
+- COMPOUND_FID, FSCTL_GET_REPARSE_POINT, |
1833 |
+- true /* is_fctl */, NULL, 0, |
1834 |
++ COMPOUND_FID, FSCTL_GET_REPARSE_POINT, NULL, 0, |
1835 |
+ CIFSMaxBufSize - |
1836 |
+ MAX_SMB2_CREATE_RESPONSE_SIZE - |
1837 |
+ MAX_SMB2_CLOSE_RESPONSE_SIZE); |
1838 |
+@@ -3409,7 +3400,7 @@ static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon, |
1839 |
+ fsctl_buf.BeyondFinalZero = cpu_to_le64(offset + len); |
1840 |
+ |
1841 |
+ rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid, |
1842 |
+- cfile->fid.volatile_fid, FSCTL_SET_ZERO_DATA, true, |
1843 |
++ cfile->fid.volatile_fid, FSCTL_SET_ZERO_DATA, |
1844 |
+ (char *)&fsctl_buf, |
1845 |
+ sizeof(struct file_zero_data_information), |
1846 |
+ 0, NULL, NULL); |
1847 |
+@@ -3439,7 +3430,7 @@ static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon, |
1848 |
+ static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon, |
1849 |
+ loff_t offset, loff_t len) |
1850 |
+ { |
1851 |
+- struct inode *inode; |
1852 |
++ struct inode *inode = file_inode(file); |
1853 |
+ struct cifsFileInfo *cfile = file->private_data; |
1854 |
+ struct file_zero_data_information fsctl_buf; |
1855 |
+ long rc; |
1856 |
+@@ -3448,14 +3439,12 @@ static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon, |
1857 |
+ |
1858 |
+ xid = get_xid(); |
1859 |
+ |
1860 |
+- inode = d_inode(cfile->dentry); |
1861 |
+- |
1862 |
++ inode_lock(inode); |
1863 |
+ /* Need to make file sparse, if not already, before freeing range. */ |
1864 |
+ /* Consider adding equivalent for compressed since it could also work */ |
1865 |
+ if (!smb2_set_sparse(xid, tcon, cfile, inode, set_sparse)) { |
1866 |
+ rc = -EOPNOTSUPP; |
1867 |
+- free_xid(xid); |
1868 |
+- return rc; |
1869 |
++ goto out; |
1870 |
+ } |
1871 |
+ |
1872 |
+ /* |
1873 |
+@@ -3471,9 +3460,11 @@ static long smb3_punch_hole(struct file *file, struct cifs_tcon *tcon, |
1874 |
+ |
1875 |
+ rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid, |
1876 |
+ cfile->fid.volatile_fid, FSCTL_SET_ZERO_DATA, |
1877 |
+- true /* is_fctl */, (char *)&fsctl_buf, |
1878 |
++ (char *)&fsctl_buf, |
1879 |
+ sizeof(struct file_zero_data_information), |
1880 |
+ CIFSMaxBufSize, NULL, NULL); |
1881 |
++out: |
1882 |
++ inode_unlock(inode); |
1883 |
+ free_xid(xid); |
1884 |
+ return rc; |
1885 |
+ } |
1886 |
+@@ -3530,7 +3521,7 @@ static int smb3_simple_fallocate_range(unsigned int xid, |
1887 |
+ in_data.length = cpu_to_le64(len); |
1888 |
+ rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid, |
1889 |
+ cfile->fid.volatile_fid, |
1890 |
+- FSCTL_QUERY_ALLOCATED_RANGES, true, |
1891 |
++ FSCTL_QUERY_ALLOCATED_RANGES, |
1892 |
+ (char *)&in_data, sizeof(in_data), |
1893 |
+ 1024 * sizeof(struct file_allocated_range_buffer), |
1894 |
+ (char **)&out_data, &out_data_len); |
1895 |
+@@ -3771,7 +3762,7 @@ static loff_t smb3_llseek(struct file *file, struct cifs_tcon *tcon, loff_t offs |
1896 |
+ |
1897 |
+ rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid, |
1898 |
+ cfile->fid.volatile_fid, |
1899 |
+- FSCTL_QUERY_ALLOCATED_RANGES, true, |
1900 |
++ FSCTL_QUERY_ALLOCATED_RANGES, |
1901 |
+ (char *)&in_data, sizeof(in_data), |
1902 |
+ sizeof(struct file_allocated_range_buffer), |
1903 |
+ (char **)&out_data, &out_data_len); |
1904 |
+@@ -3831,7 +3822,7 @@ static int smb3_fiemap(struct cifs_tcon *tcon, |
1905 |
+ |
1906 |
+ rc = SMB2_ioctl(xid, tcon, cfile->fid.persistent_fid, |
1907 |
+ cfile->fid.volatile_fid, |
1908 |
+- FSCTL_QUERY_ALLOCATED_RANGES, true, |
1909 |
++ FSCTL_QUERY_ALLOCATED_RANGES, |
1910 |
+ (char *)&in_data, sizeof(in_data), |
1911 |
+ 1024 * sizeof(struct file_allocated_range_buffer), |
1912 |
+ (char **)&out_data, &out_data_len); |
1913 |
+diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c |
1914 |
+index 24dd711fa9b95..7ee8abd1f79be 100644 |
1915 |
+--- a/fs/cifs/smb2pdu.c |
1916 |
++++ b/fs/cifs/smb2pdu.c |
1917 |
+@@ -1081,7 +1081,7 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon) |
1918 |
+ } |
1919 |
+ |
1920 |
+ rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID, |
1921 |
+- FSCTL_VALIDATE_NEGOTIATE_INFO, true /* is_fsctl */, |
1922 |
++ FSCTL_VALIDATE_NEGOTIATE_INFO, |
1923 |
+ (char *)pneg_inbuf, inbuflen, CIFSMaxBufSize, |
1924 |
+ (char **)&pneg_rsp, &rsplen); |
1925 |
+ if (rc == -EOPNOTSUPP) { |
1926 |
+@@ -2922,7 +2922,7 @@ int |
1927 |
+ SMB2_ioctl_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, |
1928 |
+ struct smb_rqst *rqst, |
1929 |
+ u64 persistent_fid, u64 volatile_fid, u32 opcode, |
1930 |
+- bool is_fsctl, char *in_data, u32 indatalen, |
1931 |
++ char *in_data, u32 indatalen, |
1932 |
+ __u32 max_response_size) |
1933 |
+ { |
1934 |
+ struct smb2_ioctl_req *req; |
1935 |
+@@ -2997,10 +2997,8 @@ SMB2_ioctl_init(struct cifs_tcon *tcon, struct TCP_Server_Info *server, |
1936 |
+ req->sync_hdr.CreditCharge = |
1937 |
+ cpu_to_le16(DIV_ROUND_UP(max(indatalen, max_response_size), |
1938 |
+ SMB2_MAX_BUFFER_SIZE)); |
1939 |
+- if (is_fsctl) |
1940 |
+- req->Flags = cpu_to_le32(SMB2_0_IOCTL_IS_FSCTL); |
1941 |
+- else |
1942 |
+- req->Flags = 0; |
1943 |
++ /* always an FSCTL (for now) */ |
1944 |
++ req->Flags = cpu_to_le32(SMB2_0_IOCTL_IS_FSCTL); |
1945 |
+ |
1946 |
+ /* validate negotiate request must be signed - see MS-SMB2 3.2.5.5 */ |
1947 |
+ if (opcode == FSCTL_VALIDATE_NEGOTIATE_INFO) |
1948 |
+@@ -3027,9 +3025,9 @@ SMB2_ioctl_free(struct smb_rqst *rqst) |
1949 |
+ */ |
1950 |
+ int |
1951 |
+ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, |
1952 |
+- u64 volatile_fid, u32 opcode, bool is_fsctl, |
1953 |
+- char *in_data, u32 indatalen, u32 max_out_data_len, |
1954 |
+- char **out_data, u32 *plen /* returned data len */) |
1955 |
++ u64 volatile_fid, u32 opcode, char *in_data, u32 indatalen, |
1956 |
++ u32 max_out_data_len, char **out_data, |
1957 |
++ u32 *plen /* returned data len */) |
1958 |
+ { |
1959 |
+ struct smb_rqst rqst; |
1960 |
+ struct smb2_ioctl_rsp *rsp = NULL; |
1961 |
+@@ -3071,7 +3069,7 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid, |
1962 |
+ |
1963 |
+ rc = SMB2_ioctl_init(tcon, server, |
1964 |
+ &rqst, persistent_fid, volatile_fid, opcode, |
1965 |
+- is_fsctl, in_data, indatalen, max_out_data_len); |
1966 |
++ in_data, indatalen, max_out_data_len); |
1967 |
+ if (rc) |
1968 |
+ goto ioctl_exit; |
1969 |
+ |
1970 |
+@@ -3153,7 +3151,7 @@ SMB2_set_compression(const unsigned int xid, struct cifs_tcon *tcon, |
1971 |
+ cpu_to_le16(COMPRESSION_FORMAT_DEFAULT); |
1972 |
+ |
1973 |
+ rc = SMB2_ioctl(xid, tcon, persistent_fid, volatile_fid, |
1974 |
+- FSCTL_SET_COMPRESSION, true /* is_fsctl */, |
1975 |
++ FSCTL_SET_COMPRESSION, |
1976 |
+ (char *)&fsctl_input /* data input */, |
1977 |
+ 2 /* in data len */, CIFSMaxBufSize /* max out data */, |
1978 |
+ &ret_data /* out data */, NULL); |
1979 |
+diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h |
1980 |
+index 4eb0ca84355a6..ed2b4fb012a41 100644 |
1981 |
+--- a/fs/cifs/smb2proto.h |
1982 |
++++ b/fs/cifs/smb2proto.h |
1983 |
+@@ -155,13 +155,13 @@ extern int SMB2_open_init(struct cifs_tcon *tcon, |
1984 |
+ extern void SMB2_open_free(struct smb_rqst *rqst); |
1985 |
+ extern int SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, |
1986 |
+ u64 persistent_fid, u64 volatile_fid, u32 opcode, |
1987 |
+- bool is_fsctl, char *in_data, u32 indatalen, u32 maxoutlen, |
1988 |
++ char *in_data, u32 indatalen, u32 maxoutlen, |
1989 |
+ char **out_data, u32 *plen /* returned data len */); |
1990 |
+ extern int SMB2_ioctl_init(struct cifs_tcon *tcon, |
1991 |
+ struct TCP_Server_Info *server, |
1992 |
+ struct smb_rqst *rqst, |
1993 |
+ u64 persistent_fid, u64 volatile_fid, u32 opcode, |
1994 |
+- bool is_fsctl, char *in_data, u32 indatalen, |
1995 |
++ char *in_data, u32 indatalen, |
1996 |
+ __u32 max_response_size); |
1997 |
+ extern void SMB2_ioctl_free(struct smb_rqst *rqst); |
1998 |
+ extern int SMB2_change_notify(const unsigned int xid, struct cifs_tcon *tcon, |
1999 |
+diff --git a/fs/debugfs/inode.c b/fs/debugfs/inode.c |
2000 |
+index 848e0aaa8da5d..f47f0a7d2c3b9 100644 |
2001 |
+--- a/fs/debugfs/inode.c |
2002 |
++++ b/fs/debugfs/inode.c |
2003 |
+@@ -730,6 +730,28 @@ void debugfs_remove(struct dentry *dentry) |
2004 |
+ } |
2005 |
+ EXPORT_SYMBOL_GPL(debugfs_remove); |
2006 |
+ |
2007 |
++/** |
2008 |
++ * debugfs_lookup_and_remove - lookup a directory or file and recursively remove it |
2009 |
++ * @name: a pointer to a string containing the name of the item to look up. |
2010 |
++ * @parent: a pointer to the parent dentry of the item. |
2011 |
++ * |
2012 |
++ * This is the equlivant of doing something like |
2013 |
++ * debugfs_remove(debugfs_lookup(..)) but with the proper reference counting |
2014 |
++ * handled for the directory being looked up. |
2015 |
++ */ |
2016 |
++void debugfs_lookup_and_remove(const char *name, struct dentry *parent) |
2017 |
++{ |
2018 |
++ struct dentry *dentry; |
2019 |
++ |
2020 |
++ dentry = debugfs_lookup(name, parent); |
2021 |
++ if (!dentry) |
2022 |
++ return; |
2023 |
++ |
2024 |
++ debugfs_remove(dentry); |
2025 |
++ dput(dentry); |
2026 |
++} |
2027 |
++EXPORT_SYMBOL_GPL(debugfs_lookup_and_remove); |
2028 |
++ |
2029 |
+ /** |
2030 |
+ * debugfs_rename - rename a file/directory in the debugfs filesystem |
2031 |
+ * @old_dir: a pointer to the parent dentry for the renamed object. This |
2032 |
+diff --git a/fs/nfsd/vfs.c b/fs/nfsd/vfs.c |
2033 |
+index c852bb5ff2121..a4ae1fcd2ab1e 100644 |
2034 |
+--- a/fs/nfsd/vfs.c |
2035 |
++++ b/fs/nfsd/vfs.c |
2036 |
+@@ -1014,6 +1014,10 @@ nfsd_vfs_write(struct svc_rqst *rqstp, struct svc_fh *fhp, struct nfsd_file *nf, |
2037 |
+ iov_iter_kvec(&iter, WRITE, vec, vlen, *cnt); |
2038 |
+ since = READ_ONCE(file->f_wb_err); |
2039 |
+ if (flags & RWF_SYNC) { |
2040 |
++ if (verf) |
2041 |
++ nfsd_copy_boot_verifier(verf, |
2042 |
++ net_generic(SVC_NET(rqstp), |
2043 |
++ nfsd_net_id)); |
2044 |
+ host_err = vfs_iter_write(file, &iter, &pos, flags); |
2045 |
+ if (host_err < 0) |
2046 |
+ nfsd_reset_boot_verifier(net_generic(SVC_NET(rqstp), |
2047 |
+diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h |
2048 |
+index 20a2ff1c07a1b..e93e3faa82296 100644 |
2049 |
+--- a/include/linux/buffer_head.h |
2050 |
++++ b/include/linux/buffer_head.h |
2051 |
+@@ -136,6 +136,17 @@ BUFFER_FNS(Defer_Completion, defer_completion) |
2052 |
+ |
2053 |
+ static __always_inline void set_buffer_uptodate(struct buffer_head *bh) |
2054 |
+ { |
2055 |
++ /* |
2056 |
++ * If somebody else already set this uptodate, they will |
2057 |
++ * have done the memory barrier, and a reader will thus |
2058 |
++ * see *some* valid buffer state. |
2059 |
++ * |
2060 |
++ * Any other serialization (with IO errors or whatever that |
2061 |
++ * might clear the bit) has to come from other state (eg BH_Lock). |
2062 |
++ */ |
2063 |
++ if (test_bit(BH_Uptodate, &bh->b_state)) |
2064 |
++ return; |
2065 |
++ |
2066 |
+ /* |
2067 |
+ * make it consistent with folio_mark_uptodate |
2068 |
+ * pairs with smp_load_acquire in buffer_uptodate |
2069 |
+diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h |
2070 |
+index d6c4cc9ecc77c..2357109a8901b 100644 |
2071 |
+--- a/include/linux/debugfs.h |
2072 |
++++ b/include/linux/debugfs.h |
2073 |
+@@ -91,6 +91,8 @@ struct dentry *debugfs_create_automount(const char *name, |
2074 |
+ void debugfs_remove(struct dentry *dentry); |
2075 |
+ #define debugfs_remove_recursive debugfs_remove |
2076 |
+ |
2077 |
++void debugfs_lookup_and_remove(const char *name, struct dentry *parent); |
2078 |
++ |
2079 |
+ const struct file_operations *debugfs_real_fops(const struct file *filp); |
2080 |
+ |
2081 |
+ int debugfs_file_get(struct dentry *dentry); |
2082 |
+@@ -220,6 +222,10 @@ static inline void debugfs_remove(struct dentry *dentry) |
2083 |
+ static inline void debugfs_remove_recursive(struct dentry *dentry) |
2084 |
+ { } |
2085 |
+ |
2086 |
++static inline void debugfs_lookup_and_remove(const char *name, |
2087 |
++ struct dentry *parent) |
2088 |
++{ } |
2089 |
++ |
2090 |
+ const struct file_operations *debugfs_real_fops(const struct file *filp); |
2091 |
+ |
2092 |
+ static inline int debugfs_file_get(struct dentry *dentry) |
2093 |
+diff --git a/kernel/cgroup/cgroup.c b/kernel/cgroup/cgroup.c |
2094 |
+index 5046c99deba86..684c16849eff3 100644 |
2095 |
+--- a/kernel/cgroup/cgroup.c |
2096 |
++++ b/kernel/cgroup/cgroup.c |
2097 |
+@@ -2304,6 +2304,47 @@ int task_cgroup_path(struct task_struct *task, char *buf, size_t buflen) |
2098 |
+ } |
2099 |
+ EXPORT_SYMBOL_GPL(task_cgroup_path); |
2100 |
+ |
2101 |
++/** |
2102 |
++ * cgroup_attach_lock - Lock for ->attach() |
2103 |
++ * @lock_threadgroup: whether to down_write cgroup_threadgroup_rwsem |
2104 |
++ * |
2105 |
++ * cgroup migration sometimes needs to stabilize threadgroups against forks and |
2106 |
++ * exits by write-locking cgroup_threadgroup_rwsem. However, some ->attach() |
2107 |
++ * implementations (e.g. cpuset), also need to disable CPU hotplug. |
2108 |
++ * Unfortunately, letting ->attach() operations acquire cpus_read_lock() can |
2109 |
++ * lead to deadlocks. |
2110 |
++ * |
2111 |
++ * Bringing up a CPU may involve creating and destroying tasks which requires |
2112 |
++ * read-locking threadgroup_rwsem, so threadgroup_rwsem nests inside |
2113 |
++ * cpus_read_lock(). If we call an ->attach() which acquires the cpus lock while |
2114 |
++ * write-locking threadgroup_rwsem, the locking order is reversed and we end up |
2115 |
++ * waiting for an on-going CPU hotplug operation which in turn is waiting for |
2116 |
++ * the threadgroup_rwsem to be released to create new tasks. For more details: |
2117 |
++ * |
2118 |
++ * http://lkml.kernel.org/r/20220711174629.uehfmqegcwn2lqzu@wubuntu |
2119 |
++ * |
2120 |
++ * Resolve the situation by always acquiring cpus_read_lock() before optionally |
2121 |
++ * write-locking cgroup_threadgroup_rwsem. This allows ->attach() to assume that |
2122 |
++ * CPU hotplug is disabled on entry. |
2123 |
++ */ |
2124 |
++static void cgroup_attach_lock(bool lock_threadgroup) |
2125 |
++{ |
2126 |
++ cpus_read_lock(); |
2127 |
++ if (lock_threadgroup) |
2128 |
++ percpu_down_write(&cgroup_threadgroup_rwsem); |
2129 |
++} |
2130 |
++ |
2131 |
++/** |
2132 |
++ * cgroup_attach_unlock - Undo cgroup_attach_lock() |
2133 |
++ * @lock_threadgroup: whether to up_write cgroup_threadgroup_rwsem |
2134 |
++ */ |
2135 |
++static void cgroup_attach_unlock(bool lock_threadgroup) |
2136 |
++{ |
2137 |
++ if (lock_threadgroup) |
2138 |
++ percpu_up_write(&cgroup_threadgroup_rwsem); |
2139 |
++ cpus_read_unlock(); |
2140 |
++} |
2141 |
++ |
2142 |
+ /** |
2143 |
+ * cgroup_migrate_add_task - add a migration target task to a migration context |
2144 |
+ * @task: target task |
2145 |
+@@ -2780,8 +2821,7 @@ int cgroup_attach_task(struct cgroup *dst_cgrp, struct task_struct *leader, |
2146 |
+ } |
2147 |
+ |
2148 |
+ struct task_struct *cgroup_procs_write_start(char *buf, bool threadgroup, |
2149 |
+- bool *locked) |
2150 |
+- __acquires(&cgroup_threadgroup_rwsem) |
2151 |
++ bool *threadgroup_locked) |
2152 |
+ { |
2153 |
+ struct task_struct *tsk; |
2154 |
+ pid_t pid; |
2155 |
+@@ -2798,12 +2838,8 @@ struct task_struct *cgroup_procs_write_start(char *buf, bool threadgroup, |
2156 |
+ * Therefore, we can skip the global lock. |
2157 |
+ */ |
2158 |
+ lockdep_assert_held(&cgroup_mutex); |
2159 |
+- if (pid || threadgroup) { |
2160 |
+- percpu_down_write(&cgroup_threadgroup_rwsem); |
2161 |
+- *locked = true; |
2162 |
+- } else { |
2163 |
+- *locked = false; |
2164 |
+- } |
2165 |
++ *threadgroup_locked = pid || threadgroup; |
2166 |
++ cgroup_attach_lock(*threadgroup_locked); |
2167 |
+ |
2168 |
+ rcu_read_lock(); |
2169 |
+ if (pid) { |
2170 |
+@@ -2834,17 +2870,14 @@ struct task_struct *cgroup_procs_write_start(char *buf, bool threadgroup, |
2171 |
+ goto out_unlock_rcu; |
2172 |
+ |
2173 |
+ out_unlock_threadgroup: |
2174 |
+- if (*locked) { |
2175 |
+- percpu_up_write(&cgroup_threadgroup_rwsem); |
2176 |
+- *locked = false; |
2177 |
+- } |
2178 |
++ cgroup_attach_unlock(*threadgroup_locked); |
2179 |
++ *threadgroup_locked = false; |
2180 |
+ out_unlock_rcu: |
2181 |
+ rcu_read_unlock(); |
2182 |
+ return tsk; |
2183 |
+ } |
2184 |
+ |
2185 |
+-void cgroup_procs_write_finish(struct task_struct *task, bool locked) |
2186 |
+- __releases(&cgroup_threadgroup_rwsem) |
2187 |
++void cgroup_procs_write_finish(struct task_struct *task, bool threadgroup_locked) |
2188 |
+ { |
2189 |
+ struct cgroup_subsys *ss; |
2190 |
+ int ssid; |
2191 |
+@@ -2852,8 +2885,8 @@ void cgroup_procs_write_finish(struct task_struct *task, bool locked) |
2192 |
+ /* release reference from cgroup_procs_write_start() */ |
2193 |
+ put_task_struct(task); |
2194 |
+ |
2195 |
+- if (locked) |
2196 |
+- percpu_up_write(&cgroup_threadgroup_rwsem); |
2197 |
++ cgroup_attach_unlock(threadgroup_locked); |
2198 |
++ |
2199 |
+ for_each_subsys(ss, ssid) |
2200 |
+ if (ss->post_attach) |
2201 |
+ ss->post_attach(); |
2202 |
+@@ -2908,12 +2941,11 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) |
2203 |
+ struct cgroup_subsys_state *d_css; |
2204 |
+ struct cgroup *dsct; |
2205 |
+ struct css_set *src_cset; |
2206 |
++ bool has_tasks; |
2207 |
+ int ret; |
2208 |
+ |
2209 |
+ lockdep_assert_held(&cgroup_mutex); |
2210 |
+ |
2211 |
+- percpu_down_write(&cgroup_threadgroup_rwsem); |
2212 |
+- |
2213 |
+ /* look up all csses currently attached to @cgrp's subtree */ |
2214 |
+ spin_lock_irq(&css_set_lock); |
2215 |
+ cgroup_for_each_live_descendant_pre(dsct, d_css, cgrp) { |
2216 |
+@@ -2924,6 +2956,15 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) |
2217 |
+ } |
2218 |
+ spin_unlock_irq(&css_set_lock); |
2219 |
+ |
2220 |
++ /* |
2221 |
++ * We need to write-lock threadgroup_rwsem while migrating tasks. |
2222 |
++ * However, if there are no source csets for @cgrp, changing its |
2223 |
++ * controllers isn't gonna produce any task migrations and the |
2224 |
++ * write-locking can be skipped safely. |
2225 |
++ */ |
2226 |
++ has_tasks = !list_empty(&mgctx.preloaded_src_csets); |
2227 |
++ cgroup_attach_lock(has_tasks); |
2228 |
++ |
2229 |
+ /* NULL dst indicates self on default hierarchy */ |
2230 |
+ ret = cgroup_migrate_prepare_dst(&mgctx); |
2231 |
+ if (ret) |
2232 |
+@@ -2943,7 +2984,7 @@ static int cgroup_update_dfl_csses(struct cgroup *cgrp) |
2233 |
+ ret = cgroup_migrate_execute(&mgctx); |
2234 |
+ out_finish: |
2235 |
+ cgroup_migrate_finish(&mgctx); |
2236 |
+- percpu_up_write(&cgroup_threadgroup_rwsem); |
2237 |
++ cgroup_attach_unlock(has_tasks); |
2238 |
+ return ret; |
2239 |
+ } |
2240 |
+ |
2241 |
+@@ -4799,13 +4840,13 @@ static ssize_t cgroup_procs_write(struct kernfs_open_file *of, |
2242 |
+ struct task_struct *task; |
2243 |
+ const struct cred *saved_cred; |
2244 |
+ ssize_t ret; |
2245 |
+- bool locked; |
2246 |
++ bool threadgroup_locked; |
2247 |
+ |
2248 |
+ dst_cgrp = cgroup_kn_lock_live(of->kn, false); |
2249 |
+ if (!dst_cgrp) |
2250 |
+ return -ENODEV; |
2251 |
+ |
2252 |
+- task = cgroup_procs_write_start(buf, true, &locked); |
2253 |
++ task = cgroup_procs_write_start(buf, true, &threadgroup_locked); |
2254 |
+ ret = PTR_ERR_OR_ZERO(task); |
2255 |
+ if (ret) |
2256 |
+ goto out_unlock; |
2257 |
+@@ -4831,7 +4872,7 @@ static ssize_t cgroup_procs_write(struct kernfs_open_file *of, |
2258 |
+ ret = cgroup_attach_task(dst_cgrp, task, true); |
2259 |
+ |
2260 |
+ out_finish: |
2261 |
+- cgroup_procs_write_finish(task, locked); |
2262 |
++ cgroup_procs_write_finish(task, threadgroup_locked); |
2263 |
+ out_unlock: |
2264 |
+ cgroup_kn_unlock(of->kn); |
2265 |
+ |
2266 |
+diff --git a/kernel/cgroup/cpuset.c b/kernel/cgroup/cpuset.c |
2267 |
+index c51863b63f93a..b7830f1f1f3a5 100644 |
2268 |
+--- a/kernel/cgroup/cpuset.c |
2269 |
++++ b/kernel/cgroup/cpuset.c |
2270 |
+@@ -2212,7 +2212,7 @@ static void cpuset_attach(struct cgroup_taskset *tset) |
2271 |
+ cgroup_taskset_first(tset, &css); |
2272 |
+ cs = css_cs(css); |
2273 |
+ |
2274 |
+- cpus_read_lock(); |
2275 |
++ lockdep_assert_cpus_held(); /* see cgroup_attach_lock() */ |
2276 |
+ percpu_down_write(&cpuset_rwsem); |
2277 |
+ |
2278 |
+ /* prepare for attach */ |
2279 |
+@@ -2268,7 +2268,6 @@ static void cpuset_attach(struct cgroup_taskset *tset) |
2280 |
+ wake_up(&cpuset_attach_wq); |
2281 |
+ |
2282 |
+ percpu_up_write(&cpuset_rwsem); |
2283 |
+- cpus_read_unlock(); |
2284 |
+ } |
2285 |
+ |
2286 |
+ /* The various types of files and directories in a cpuset file system */ |
2287 |
+diff --git a/kernel/dma/swiotlb.c b/kernel/dma/swiotlb.c |
2288 |
+index 274587a57717f..4a9831d01f0ea 100644 |
2289 |
+--- a/kernel/dma/swiotlb.c |
2290 |
++++ b/kernel/dma/swiotlb.c |
2291 |
+@@ -452,7 +452,10 @@ static void swiotlb_bounce(phys_addr_t orig_addr, phys_addr_t tlb_addr, |
2292 |
+ } |
2293 |
+ } |
2294 |
+ |
2295 |
+-#define slot_addr(start, idx) ((start) + ((idx) << IO_TLB_SHIFT)) |
2296 |
++static inline phys_addr_t slot_addr(phys_addr_t start, phys_addr_t idx) |
2297 |
++{ |
2298 |
++ return start + (idx << IO_TLB_SHIFT); |
2299 |
++} |
2300 |
+ |
2301 |
+ /* |
2302 |
+ * Return the offset into a iotlb slot required to keep the device happy. |
2303 |
+diff --git a/kernel/fork.c b/kernel/fork.c |
2304 |
+index a78c0b02edd55..b877480c901f0 100644 |
2305 |
+--- a/kernel/fork.c |
2306 |
++++ b/kernel/fork.c |
2307 |
+@@ -1127,6 +1127,7 @@ void mmput_async(struct mm_struct *mm) |
2308 |
+ schedule_work(&mm->async_put_work); |
2309 |
+ } |
2310 |
+ } |
2311 |
++EXPORT_SYMBOL_GPL(mmput_async); |
2312 |
+ #endif |
2313 |
+ |
2314 |
+ /** |
2315 |
+diff --git a/kernel/kprobes.c b/kernel/kprobes.c |
2316 |
+index a93407da0ae10..dac82a0e7c0b0 100644 |
2317 |
+--- a/kernel/kprobes.c |
2318 |
++++ b/kernel/kprobes.c |
2319 |
+@@ -1642,6 +1642,7 @@ static int check_kprobe_address_safe(struct kprobe *p, |
2320 |
+ /* Ensure it is not in reserved area nor out of text */ |
2321 |
+ if (!(core_kernel_text((unsigned long) p->addr) || |
2322 |
+ is_module_text_address((unsigned long) p->addr)) || |
2323 |
++ in_gate_area_no_mm((unsigned long) p->addr) || |
2324 |
+ within_kprobe_blacklist((unsigned long) p->addr) || |
2325 |
+ jump_label_text_reserved(p->addr, p->addr) || |
2326 |
+ static_call_text_reserved(p->addr, p->addr) || |
2327 |
+diff --git a/mm/kmemleak.c b/mm/kmemleak.c |
2328 |
+index 5bfae0686199e..4801751cb6b6d 100644 |
2329 |
+--- a/mm/kmemleak.c |
2330 |
++++ b/mm/kmemleak.c |
2331 |
+@@ -1123,7 +1123,7 @@ EXPORT_SYMBOL(kmemleak_no_scan); |
2332 |
+ void __ref kmemleak_alloc_phys(phys_addr_t phys, size_t size, int min_count, |
2333 |
+ gfp_t gfp) |
2334 |
+ { |
2335 |
+- if (PHYS_PFN(phys) >= min_low_pfn && PHYS_PFN(phys) < max_low_pfn) |
2336 |
++ if (!IS_ENABLED(CONFIG_HIGHMEM) || PHYS_PFN(phys) < max_low_pfn) |
2337 |
+ kmemleak_alloc(__va(phys), size, min_count, gfp); |
2338 |
+ } |
2339 |
+ EXPORT_SYMBOL(kmemleak_alloc_phys); |
2340 |
+@@ -1137,7 +1137,7 @@ EXPORT_SYMBOL(kmemleak_alloc_phys); |
2341 |
+ */ |
2342 |
+ void __ref kmemleak_free_part_phys(phys_addr_t phys, size_t size) |
2343 |
+ { |
2344 |
+- if (PHYS_PFN(phys) >= min_low_pfn && PHYS_PFN(phys) < max_low_pfn) |
2345 |
++ if (!IS_ENABLED(CONFIG_HIGHMEM) || PHYS_PFN(phys) < max_low_pfn) |
2346 |
+ kmemleak_free_part(__va(phys), size); |
2347 |
+ } |
2348 |
+ EXPORT_SYMBOL(kmemleak_free_part_phys); |
2349 |
+@@ -1149,7 +1149,7 @@ EXPORT_SYMBOL(kmemleak_free_part_phys); |
2350 |
+ */ |
2351 |
+ void __ref kmemleak_not_leak_phys(phys_addr_t phys) |
2352 |
+ { |
2353 |
+- if (PHYS_PFN(phys) >= min_low_pfn && PHYS_PFN(phys) < max_low_pfn) |
2354 |
++ if (!IS_ENABLED(CONFIG_HIGHMEM) || PHYS_PFN(phys) < max_low_pfn) |
2355 |
+ kmemleak_not_leak(__va(phys)); |
2356 |
+ } |
2357 |
+ EXPORT_SYMBOL(kmemleak_not_leak_phys); |
2358 |
+@@ -1161,7 +1161,7 @@ EXPORT_SYMBOL(kmemleak_not_leak_phys); |
2359 |
+ */ |
2360 |
+ void __ref kmemleak_ignore_phys(phys_addr_t phys) |
2361 |
+ { |
2362 |
+- if (PHYS_PFN(phys) >= min_low_pfn && PHYS_PFN(phys) < max_low_pfn) |
2363 |
++ if (!IS_ENABLED(CONFIG_HIGHMEM) || PHYS_PFN(phys) < max_low_pfn) |
2364 |
+ kmemleak_ignore(__va(phys)); |
2365 |
+ } |
2366 |
+ EXPORT_SYMBOL(kmemleak_ignore_phys); |
2367 |
+diff --git a/net/bridge/br_netfilter_hooks.c b/net/bridge/br_netfilter_hooks.c |
2368 |
+index 10a2c7bca7199..a718204c4bfdd 100644 |
2369 |
+--- a/net/bridge/br_netfilter_hooks.c |
2370 |
++++ b/net/bridge/br_netfilter_hooks.c |
2371 |
+@@ -384,6 +384,7 @@ static int br_nf_pre_routing_finish(struct net *net, struct sock *sk, struct sk_ |
2372 |
+ /* - Bridged-and-DNAT'ed traffic doesn't |
2373 |
+ * require ip_forwarding. */ |
2374 |
+ if (rt->dst.dev == dev) { |
2375 |
++ skb_dst_drop(skb); |
2376 |
+ skb_dst_set(skb, &rt->dst); |
2377 |
+ goto bridged_dnat; |
2378 |
+ } |
2379 |
+@@ -413,6 +414,7 @@ bridged_dnat: |
2380 |
+ kfree_skb(skb); |
2381 |
+ return 0; |
2382 |
+ } |
2383 |
++ skb_dst_drop(skb); |
2384 |
+ skb_dst_set_noref(skb, &rt->dst); |
2385 |
+ } |
2386 |
+ |
2387 |
+diff --git a/net/bridge/br_netfilter_ipv6.c b/net/bridge/br_netfilter_ipv6.c |
2388 |
+index e4e0c836c3f51..6b07f30675bb0 100644 |
2389 |
+--- a/net/bridge/br_netfilter_ipv6.c |
2390 |
++++ b/net/bridge/br_netfilter_ipv6.c |
2391 |
+@@ -197,6 +197,7 @@ static int br_nf_pre_routing_finish_ipv6(struct net *net, struct sock *sk, struc |
2392 |
+ kfree_skb(skb); |
2393 |
+ return 0; |
2394 |
+ } |
2395 |
++ skb_dst_drop(skb); |
2396 |
+ skb_dst_set_noref(skb, &rt->dst); |
2397 |
+ } |
2398 |
+ |
2399 |
+diff --git a/net/core/skbuff.c b/net/core/skbuff.c |
2400 |
+index 635cabcf8794f..7bdcdad58dc86 100644 |
2401 |
+--- a/net/core/skbuff.c |
2402 |
++++ b/net/core/skbuff.c |
2403 |
+@@ -3986,9 +3986,8 @@ normal: |
2404 |
+ SKB_GSO_CB(nskb)->csum_start = |
2405 |
+ skb_headroom(nskb) + doffset; |
2406 |
+ } else { |
2407 |
+- skb_copy_bits(head_skb, offset, |
2408 |
+- skb_put(nskb, len), |
2409 |
+- len); |
2410 |
++ if (skb_copy_bits(head_skb, offset, skb_put(nskb, len), len)) |
2411 |
++ goto err; |
2412 |
+ } |
2413 |
+ continue; |
2414 |
+ } |
2415 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
2416 |
+index e62500d6fe0d0..4ecd85b1e806c 100644 |
2417 |
+--- a/net/ipv4/tcp_input.c |
2418 |
++++ b/net/ipv4/tcp_input.c |
2419 |
+@@ -2496,6 +2496,21 @@ static inline bool tcp_may_undo(const struct tcp_sock *tp) |
2420 |
+ return tp->undo_marker && (!tp->undo_retrans || tcp_packet_delayed(tp)); |
2421 |
+ } |
2422 |
+ |
2423 |
++static bool tcp_is_non_sack_preventing_reopen(struct sock *sk) |
2424 |
++{ |
2425 |
++ struct tcp_sock *tp = tcp_sk(sk); |
2426 |
++ |
2427 |
++ if (tp->snd_una == tp->high_seq && tcp_is_reno(tp)) { |
2428 |
++ /* Hold old state until something *above* high_seq |
2429 |
++ * is ACKed. For Reno it is MUST to prevent false |
2430 |
++ * fast retransmits (RFC2582). SACK TCP is safe. */ |
2431 |
++ if (!tcp_any_retrans_done(sk)) |
2432 |
++ tp->retrans_stamp = 0; |
2433 |
++ return true; |
2434 |
++ } |
2435 |
++ return false; |
2436 |
++} |
2437 |
++ |
2438 |
+ /* People celebrate: "We love our President!" */ |
2439 |
+ static bool tcp_try_undo_recovery(struct sock *sk) |
2440 |
+ { |
2441 |
+@@ -2518,14 +2533,8 @@ static bool tcp_try_undo_recovery(struct sock *sk) |
2442 |
+ } else if (tp->rack.reo_wnd_persist) { |
2443 |
+ tp->rack.reo_wnd_persist--; |
2444 |
+ } |
2445 |
+- if (tp->snd_una == tp->high_seq && tcp_is_reno(tp)) { |
2446 |
+- /* Hold old state until something *above* high_seq |
2447 |
+- * is ACKed. For Reno it is MUST to prevent false |
2448 |
+- * fast retransmits (RFC2582). SACK TCP is safe. */ |
2449 |
+- if (!tcp_any_retrans_done(sk)) |
2450 |
+- tp->retrans_stamp = 0; |
2451 |
++ if (tcp_is_non_sack_preventing_reopen(sk)) |
2452 |
+ return true; |
2453 |
+- } |
2454 |
+ tcp_set_ca_state(sk, TCP_CA_Open); |
2455 |
+ tp->is_sack_reneg = 0; |
2456 |
+ return false; |
2457 |
+@@ -2561,6 +2570,8 @@ static bool tcp_try_undo_loss(struct sock *sk, bool frto_undo) |
2458 |
+ NET_INC_STATS(sock_net(sk), |
2459 |
+ LINUX_MIB_TCPSPURIOUSRTOS); |
2460 |
+ inet_csk(sk)->icsk_retransmits = 0; |
2461 |
++ if (tcp_is_non_sack_preventing_reopen(sk)) |
2462 |
++ return true; |
2463 |
+ if (frto_undo || tcp_is_sack(tp)) { |
2464 |
+ tcp_set_ca_state(sk, TCP_CA_Open); |
2465 |
+ tp->is_sack_reneg = 0; |
2466 |
+diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c |
2467 |
+index d2f8138e5a73a..2278c0234c497 100644 |
2468 |
+--- a/net/ipv6/seg6.c |
2469 |
++++ b/net/ipv6/seg6.c |
2470 |
+@@ -135,6 +135,11 @@ static int seg6_genl_sethmac(struct sk_buff *skb, struct genl_info *info) |
2471 |
+ goto out_unlock; |
2472 |
+ } |
2473 |
+ |
2474 |
++ if (slen > nla_len(info->attrs[SEG6_ATTR_SECRET])) { |
2475 |
++ err = -EINVAL; |
2476 |
++ goto out_unlock; |
2477 |
++ } |
2478 |
++ |
2479 |
+ if (hinfo) { |
2480 |
+ err = seg6_hmac_info_del(net, hmackeyid); |
2481 |
+ if (err) |
2482 |
+diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c |
2483 |
+index e40988a2f22fb..26245419ef4a9 100644 |
2484 |
+--- a/net/netfilter/nf_conntrack_irc.c |
2485 |
++++ b/net/netfilter/nf_conntrack_irc.c |
2486 |
+@@ -185,8 +185,9 @@ static int help(struct sk_buff *skb, unsigned int protoff, |
2487 |
+ |
2488 |
+ /* dcc_ip can be the internal OR external (NAT'ed) IP */ |
2489 |
+ tuple = &ct->tuplehash[dir].tuple; |
2490 |
+- if (tuple->src.u3.ip != dcc_ip && |
2491 |
+- tuple->dst.u3.ip != dcc_ip) { |
2492 |
++ if ((tuple->src.u3.ip != dcc_ip && |
2493 |
++ ct->tuplehash[!dir].tuple.dst.u3.ip != dcc_ip) || |
2494 |
++ dcc_port == 0) { |
2495 |
+ net_warn_ratelimited("Forged DCC command from %pI4: %pI4:%u\n", |
2496 |
+ &tuple->src.u3.ip, |
2497 |
+ &dcc_ip, dcc_port); |
2498 |
+diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c |
2499 |
+index 1b039476e4d6a..b8e7e1c5c08a8 100644 |
2500 |
+--- a/net/netfilter/nf_tables_api.c |
2501 |
++++ b/net/netfilter/nf_tables_api.c |
2502 |
+@@ -1971,8 +1971,10 @@ static int nft_basechain_init(struct nft_base_chain *basechain, u8 family, |
2503 |
+ chain->flags |= NFT_CHAIN_BASE | flags; |
2504 |
+ basechain->policy = NF_ACCEPT; |
2505 |
+ if (chain->flags & NFT_CHAIN_HW_OFFLOAD && |
2506 |
+- !nft_chain_offload_support(basechain)) |
2507 |
++ !nft_chain_offload_support(basechain)) { |
2508 |
++ list_splice_init(&basechain->hook_list, &hook->list); |
2509 |
+ return -EOPNOTSUPP; |
2510 |
++ } |
2511 |
+ |
2512 |
+ flow_block_init(&basechain->flow_block); |
2513 |
+ |
2514 |
+diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c |
2515 |
+index f114dc2af5cf3..5345e8eefd33c 100644 |
2516 |
+--- a/net/rxrpc/rxkad.c |
2517 |
++++ b/net/rxrpc/rxkad.c |
2518 |
+@@ -451,7 +451,7 @@ static int rxkad_verify_packet_2(struct rxrpc_call *call, struct sk_buff *skb, |
2519 |
+ * directly into the target buffer. |
2520 |
+ */ |
2521 |
+ sg = _sg; |
2522 |
+- nsg = skb_shinfo(skb)->nr_frags; |
2523 |
++ nsg = skb_shinfo(skb)->nr_frags + 1; |
2524 |
+ if (nsg <= 4) { |
2525 |
+ nsg = 4; |
2526 |
+ } else { |
2527 |
+diff --git a/net/sched/sch_sfb.c b/net/sched/sch_sfb.c |
2528 |
+index da047a37a3bf3..b2724057629f6 100644 |
2529 |
+--- a/net/sched/sch_sfb.c |
2530 |
++++ b/net/sched/sch_sfb.c |
2531 |
+@@ -135,15 +135,15 @@ static void increment_one_qlen(u32 sfbhash, u32 slot, struct sfb_sched_data *q) |
2532 |
+ } |
2533 |
+ } |
2534 |
+ |
2535 |
+-static void increment_qlen(const struct sk_buff *skb, struct sfb_sched_data *q) |
2536 |
++static void increment_qlen(const struct sfb_skb_cb *cb, struct sfb_sched_data *q) |
2537 |
+ { |
2538 |
+ u32 sfbhash; |
2539 |
+ |
2540 |
+- sfbhash = sfb_hash(skb, 0); |
2541 |
++ sfbhash = cb->hashes[0]; |
2542 |
+ if (sfbhash) |
2543 |
+ increment_one_qlen(sfbhash, 0, q); |
2544 |
+ |
2545 |
+- sfbhash = sfb_hash(skb, 1); |
2546 |
++ sfbhash = cb->hashes[1]; |
2547 |
+ if (sfbhash) |
2548 |
+ increment_one_qlen(sfbhash, 1, q); |
2549 |
+ } |
2550 |
+@@ -281,8 +281,10 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch, |
2551 |
+ { |
2552 |
+ |
2553 |
+ struct sfb_sched_data *q = qdisc_priv(sch); |
2554 |
++ unsigned int len = qdisc_pkt_len(skb); |
2555 |
+ struct Qdisc *child = q->qdisc; |
2556 |
+ struct tcf_proto *fl; |
2557 |
++ struct sfb_skb_cb cb; |
2558 |
+ int i; |
2559 |
+ u32 p_min = ~0; |
2560 |
+ u32 minqlen = ~0; |
2561 |
+@@ -399,11 +401,12 @@ static int sfb_enqueue(struct sk_buff *skb, struct Qdisc *sch, |
2562 |
+ } |
2563 |
+ |
2564 |
+ enqueue: |
2565 |
++ memcpy(&cb, sfb_skb_cb(skb), sizeof(cb)); |
2566 |
+ ret = qdisc_enqueue(skb, child, to_free); |
2567 |
+ if (likely(ret == NET_XMIT_SUCCESS)) { |
2568 |
+- qdisc_qstats_backlog_inc(sch, skb); |
2569 |
++ sch->qstats.backlog += len; |
2570 |
+ sch->q.qlen++; |
2571 |
+- increment_qlen(skb, q); |
2572 |
++ increment_qlen(&cb, q); |
2573 |
+ } else if (net_xmit_drop_count(ret)) { |
2574 |
+ q->stats.childdrop++; |
2575 |
+ qdisc_qstats_drop(sch); |
2576 |
+diff --git a/net/tipc/monitor.c b/net/tipc/monitor.c |
2577 |
+index a37190da5a504..1d90f39129ca0 100644 |
2578 |
+--- a/net/tipc/monitor.c |
2579 |
++++ b/net/tipc/monitor.c |
2580 |
+@@ -130,7 +130,7 @@ static void map_set(u64 *up_map, int i, unsigned int v) |
2581 |
+ |
2582 |
+ static int map_get(u64 up_map, int i) |
2583 |
+ { |
2584 |
+- return (up_map & (1 << i)) >> i; |
2585 |
++ return (up_map & (1ULL << i)) >> i; |
2586 |
+ } |
2587 |
+ |
2588 |
+ static struct tipc_peer *peer_prev(struct tipc_peer *peer) |
2589 |
+diff --git a/sound/drivers/aloop.c b/sound/drivers/aloop.c |
2590 |
+index 2c5f7e905ab8f..fb45a32d99cd9 100644 |
2591 |
+--- a/sound/drivers/aloop.c |
2592 |
++++ b/sound/drivers/aloop.c |
2593 |
+@@ -606,17 +606,18 @@ static unsigned int loopback_jiffies_timer_pos_update |
2594 |
+ cable->streams[SNDRV_PCM_STREAM_PLAYBACK]; |
2595 |
+ struct loopback_pcm *dpcm_capt = |
2596 |
+ cable->streams[SNDRV_PCM_STREAM_CAPTURE]; |
2597 |
+- unsigned long delta_play = 0, delta_capt = 0; |
2598 |
++ unsigned long delta_play = 0, delta_capt = 0, cur_jiffies; |
2599 |
+ unsigned int running, count1, count2; |
2600 |
+ |
2601 |
++ cur_jiffies = jiffies; |
2602 |
+ running = cable->running ^ cable->pause; |
2603 |
+ if (running & (1 << SNDRV_PCM_STREAM_PLAYBACK)) { |
2604 |
+- delta_play = jiffies - dpcm_play->last_jiffies; |
2605 |
++ delta_play = cur_jiffies - dpcm_play->last_jiffies; |
2606 |
+ dpcm_play->last_jiffies += delta_play; |
2607 |
+ } |
2608 |
+ |
2609 |
+ if (running & (1 << SNDRV_PCM_STREAM_CAPTURE)) { |
2610 |
+- delta_capt = jiffies - dpcm_capt->last_jiffies; |
2611 |
++ delta_capt = cur_jiffies - dpcm_capt->last_jiffies; |
2612 |
+ dpcm_capt->last_jiffies += delta_capt; |
2613 |
+ } |
2614 |
+ |
2615 |
+diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c |
2616 |
+index b2ddabb994381..8d2c101d66a23 100644 |
2617 |
+--- a/sound/pci/emu10k1/emupcm.c |
2618 |
++++ b/sound/pci/emu10k1/emupcm.c |
2619 |
+@@ -123,7 +123,7 @@ static int snd_emu10k1_pcm_channel_alloc(struct snd_emu10k1_pcm * epcm, int voic |
2620 |
+ epcm->voices[0]->epcm = epcm; |
2621 |
+ if (voices > 1) { |
2622 |
+ for (i = 1; i < voices; i++) { |
2623 |
+- epcm->voices[i] = &epcm->emu->voices[epcm->voices[0]->number + i]; |
2624 |
++ epcm->voices[i] = &epcm->emu->voices[(epcm->voices[0]->number + i) % NUM_G]; |
2625 |
+ epcm->voices[i]->epcm = epcm; |
2626 |
+ } |
2627 |
+ } |
2628 |
+diff --git a/sound/soc/atmel/mchp-spdiftx.c b/sound/soc/atmel/mchp-spdiftx.c |
2629 |
+index 3bd350afb7434..0d2e3fa21519c 100644 |
2630 |
+--- a/sound/soc/atmel/mchp-spdiftx.c |
2631 |
++++ b/sound/soc/atmel/mchp-spdiftx.c |
2632 |
+@@ -196,8 +196,7 @@ struct mchp_spdiftx_dev { |
2633 |
+ struct clk *pclk; |
2634 |
+ struct clk *gclk; |
2635 |
+ unsigned int fmt; |
2636 |
+- const struct mchp_i2s_caps *caps; |
2637 |
+- int gclk_enabled:1; |
2638 |
++ unsigned int gclk_enabled:1; |
2639 |
+ }; |
2640 |
+ |
2641 |
+ static inline int mchp_spdiftx_is_running(struct mchp_spdiftx_dev *dev) |
2642 |
+@@ -766,8 +765,6 @@ static const struct of_device_id mchp_spdiftx_dt_ids[] = { |
2643 |
+ MODULE_DEVICE_TABLE(of, mchp_spdiftx_dt_ids); |
2644 |
+ static int mchp_spdiftx_probe(struct platform_device *pdev) |
2645 |
+ { |
2646 |
+- struct device_node *np = pdev->dev.of_node; |
2647 |
+- const struct of_device_id *match; |
2648 |
+ struct mchp_spdiftx_dev *dev; |
2649 |
+ struct resource *mem; |
2650 |
+ struct regmap *regmap; |
2651 |
+@@ -781,11 +778,6 @@ static int mchp_spdiftx_probe(struct platform_device *pdev) |
2652 |
+ if (!dev) |
2653 |
+ return -ENOMEM; |
2654 |
+ |
2655 |
+- /* Get hardware capabilities. */ |
2656 |
+- match = of_match_node(mchp_spdiftx_dt_ids, np); |
2657 |
+- if (match) |
2658 |
+- dev->caps = match->data; |
2659 |
+- |
2660 |
+ /* Map I/O registers. */ |
2661 |
+ base = devm_platform_get_and_ioremap_resource(pdev, 0, &mem); |
2662 |
+ if (IS_ERR(base)) |
2663 |
+diff --git a/sound/usb/card.c b/sound/usb/card.c |
2664 |
+index a3e06a71cf356..6b172db58a310 100644 |
2665 |
+--- a/sound/usb/card.c |
2666 |
++++ b/sound/usb/card.c |
2667 |
+@@ -667,7 +667,7 @@ static bool check_delayed_register_option(struct snd_usb_audio *chip, int iface) |
2668 |
+ if (delayed_register[i] && |
2669 |
+ sscanf(delayed_register[i], "%x:%x", &id, &inum) == 2 && |
2670 |
+ id == chip->usb_id) |
2671 |
+- return inum != iface; |
2672 |
++ return iface < inum; |
2673 |
+ } |
2674 |
+ |
2675 |
+ return false; |
2676 |
+diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c |
2677 |
+index 6333a2ecb848a..41f5d8242478f 100644 |
2678 |
+--- a/sound/usb/quirks.c |
2679 |
++++ b/sound/usb/quirks.c |
2680 |
+@@ -1911,7 +1911,7 @@ bool snd_usb_registration_quirk(struct snd_usb_audio *chip, int iface) |
2681 |
+ |
2682 |
+ for (q = registration_quirks; q->usb_id; q++) |
2683 |
+ if (chip->usb_id == q->usb_id) |
2684 |
+- return iface != q->interface; |
2685 |
++ return iface < q->interface; |
2686 |
+ |
2687 |
+ /* Register as normal */ |
2688 |
+ return false; |
2689 |
+diff --git a/sound/usb/stream.c b/sound/usb/stream.c |
2690 |
+index 2f6d39c2ba7c8..c4f4585f9b851 100644 |
2691 |
+--- a/sound/usb/stream.c |
2692 |
++++ b/sound/usb/stream.c |
2693 |
+@@ -496,6 +496,10 @@ static int __snd_usb_add_audio_stream(struct snd_usb_audio *chip, |
2694 |
+ return 0; |
2695 |
+ } |
2696 |
+ } |
2697 |
++ |
2698 |
++ if (chip->card->registered) |
2699 |
++ chip->need_delayed_register = true; |
2700 |
++ |
2701 |
+ /* look for an empty stream */ |
2702 |
+ list_for_each_entry(as, &chip->pcm_list, list) { |
2703 |
+ if (as->fmt_type != fp->fmt_type) |
2704 |
+@@ -503,9 +507,6 @@ static int __snd_usb_add_audio_stream(struct snd_usb_audio *chip, |
2705 |
+ subs = &as->substream[stream]; |
2706 |
+ if (subs->ep_num) |
2707 |
+ continue; |
2708 |
+- if (snd_device_get_state(chip->card, as->pcm) != |
2709 |
+- SNDRV_DEV_BUILD) |
2710 |
+- chip->need_delayed_register = true; |
2711 |
+ err = snd_pcm_new_stream(as->pcm, stream, 1); |
2712 |
+ if (err < 0) |
2713 |
+ return err; |
2714 |
+@@ -1106,7 +1107,7 @@ static int __snd_usb_parse_audio_interface(struct snd_usb_audio *chip, |
2715 |
+ * Dallas DS4201 workaround: It presents 5 altsettings, but the last |
2716 |
+ * one misses syncpipe, and does not produce any sound. |
2717 |
+ */ |
2718 |
+- if (chip->usb_id == USB_ID(0x04fa, 0x4201)) |
2719 |
++ if (chip->usb_id == USB_ID(0x04fa, 0x4201) && num >= 4) |
2720 |
+ num = 4; |
2721 |
+ |
2722 |
+ for (i = 0; i < num; i++) { |