1 |
commit: 0f8e141c362918ddc0725d192fdb37178c036238 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Thu May 12 11:30:44 2022 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Thu May 12 11:30:44 2022 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=0f8e141c |
7 |
|
8 |
Linux patch 4.19.242 |
9 |
|
10 |
Signed-off-by: Mike Pagano <mpagano <AT> gentoo.org> |
11 |
|
12 |
0000_README | 4 + |
13 |
1241_linux-4.19.242.patch | 2699 +++++++++++++++++++++++++++++++++++++++++++++ |
14 |
2 files changed, 2703 insertions(+) |
15 |
|
16 |
diff --git a/0000_README b/0000_README |
17 |
index 467db0c8..2564c5de 100644 |
18 |
--- a/0000_README |
19 |
+++ b/0000_README |
20 |
@@ -1003,6 +1003,10 @@ Patch: 1240_linux-4.19.241.patch |
21 |
From: https://www.kernel.org |
22 |
Desc: Linux 4.19.241 |
23 |
|
24 |
+Patch: 1241_linux-4.19.242.patch |
25 |
+From: https://www.kernel.org |
26 |
+Desc: Linux 4.19.242 |
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/1241_linux-4.19.242.patch b/1241_linux-4.19.242.patch |
33 |
new file mode 100644 |
34 |
index 00000000..4a82ff92 |
35 |
--- /dev/null |
36 |
+++ b/1241_linux-4.19.242.patch |
37 |
@@ -0,0 +1,2699 @@ |
38 |
+diff --git a/Makefile b/Makefile |
39 |
+index 58fb76d1d7d38..c61c1a508ec70 100644 |
40 |
+--- a/Makefile |
41 |
++++ b/Makefile |
42 |
+@@ -1,7 +1,7 @@ |
43 |
+ # SPDX-License-Identifier: GPL-2.0 |
44 |
+ VERSION = 4 |
45 |
+ PATCHLEVEL = 19 |
46 |
+-SUBLEVEL = 241 |
47 |
++SUBLEVEL = 242 |
48 |
+ EXTRAVERSION = |
49 |
+ NAME = "People's Front" |
50 |
+ |
51 |
+diff --git a/arch/arm/boot/dts/imx6qdl-apalis.dtsi b/arch/arm/boot/dts/imx6qdl-apalis.dtsi |
52 |
+index 05f07ea3e8c80..ed783c91b002a 100644 |
53 |
+--- a/arch/arm/boot/dts/imx6qdl-apalis.dtsi |
54 |
++++ b/arch/arm/boot/dts/imx6qdl-apalis.dtsi |
55 |
+@@ -313,6 +313,8 @@ |
56 |
+ codec: sgtl5000@a { |
57 |
+ compatible = "fsl,sgtl5000"; |
58 |
+ reg = <0x0a>; |
59 |
++ pinctrl-names = "default"; |
60 |
++ pinctrl-0 = <&pinctrl_sgtl5000>; |
61 |
+ clocks = <&clks IMX6QDL_CLK_CKO>; |
62 |
+ VDDA-supply = <®_module_3v3_audio>; |
63 |
+ VDDIO-supply = <®_module_3v3>; |
64 |
+@@ -540,8 +542,6 @@ |
65 |
+ MX6QDL_PAD_DISP0_DAT21__AUD4_TXD 0x130b0 |
66 |
+ MX6QDL_PAD_DISP0_DAT22__AUD4_TXFS 0x130b0 |
67 |
+ MX6QDL_PAD_DISP0_DAT23__AUD4_RXD 0x130b0 |
68 |
+- /* SGTL5000 sys_mclk */ |
69 |
+- MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0 |
70 |
+ >; |
71 |
+ }; |
72 |
+ |
73 |
+@@ -807,6 +807,12 @@ |
74 |
+ >; |
75 |
+ }; |
76 |
+ |
77 |
++ pinctrl_sgtl5000: sgtl5000grp { |
78 |
++ fsl,pins = < |
79 |
++ MX6QDL_PAD_GPIO_5__CCM_CLKO1 0x130b0 |
80 |
++ >; |
81 |
++ }; |
82 |
++ |
83 |
+ pinctrl_spdif: spdifgrp { |
84 |
+ fsl,pins = < |
85 |
+ MX6QDL_PAD_GPIO_16__SPDIF_IN 0x1b0b0 |
86 |
+diff --git a/arch/arm/boot/dts/imx6ull-colibri.dtsi b/arch/arm/boot/dts/imx6ull-colibri.dtsi |
87 |
+index 6c63a73846114..4219239f0b584 100644 |
88 |
+--- a/arch/arm/boot/dts/imx6ull-colibri.dtsi |
89 |
++++ b/arch/arm/boot/dts/imx6ull-colibri.dtsi |
90 |
+@@ -37,7 +37,7 @@ |
91 |
+ |
92 |
+ reg_sd1_vmmc: regulator-sd1-vmmc { |
93 |
+ compatible = "regulator-gpio"; |
94 |
+- gpio = <&gpio5 9 GPIO_ACTIVE_HIGH>; |
95 |
++ gpios = <&gpio5 9 GPIO_ACTIVE_HIGH>; |
96 |
+ pinctrl-names = "default"; |
97 |
+ pinctrl-0 = <&pinctrl_snvs_reg_sd>; |
98 |
+ regulator-always-on; |
99 |
+diff --git a/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts b/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts |
100 |
+index 32d0dc371fc34..4cd72b5e612b9 100644 |
101 |
+--- a/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts |
102 |
++++ b/arch/arm/boot/dts/logicpd-som-lv-35xx-devkit.dts |
103 |
+@@ -15,3 +15,18 @@ |
104 |
+ model = "LogicPD Zoom OMAP35xx SOM-LV Development Kit"; |
105 |
+ compatible = "logicpd,dm3730-som-lv-devkit", "ti,omap3"; |
106 |
+ }; |
107 |
++ |
108 |
++&omap3_pmx_core2 { |
109 |
++ pinctrl-names = "default"; |
110 |
++ pinctrl-0 = <&hsusb2_2_pins>; |
111 |
++ hsusb2_2_pins: pinmux_hsusb2_2_pins { |
112 |
++ pinctrl-single,pins = < |
113 |
++ OMAP3430_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */ |
114 |
++ OMAP3430_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */ |
115 |
++ OMAP3430_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */ |
116 |
++ OMAP3430_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */ |
117 |
++ OMAP3430_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */ |
118 |
++ OMAP3430_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */ |
119 |
++ >; |
120 |
++ }; |
121 |
++}; |
122 |
+diff --git a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts |
123 |
+index 24283739526c4..2aca9111c6999 100644 |
124 |
+--- a/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts |
125 |
++++ b/arch/arm/boot/dts/logicpd-som-lv-37xx-devkit.dts |
126 |
+@@ -15,3 +15,18 @@ |
127 |
+ model = "LogicPD Zoom DM3730 SOM-LV Development Kit"; |
128 |
+ compatible = "logicpd,dm3730-som-lv-devkit", "ti,omap3630", "ti,omap3"; |
129 |
+ }; |
130 |
++ |
131 |
++&omap3_pmx_core2 { |
132 |
++ pinctrl-names = "default"; |
133 |
++ pinctrl-0 = <&hsusb2_2_pins>; |
134 |
++ hsusb2_2_pins: pinmux_hsusb2_2_pins { |
135 |
++ pinctrl-single,pins = < |
136 |
++ OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */ |
137 |
++ OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */ |
138 |
++ OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */ |
139 |
++ OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */ |
140 |
++ OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */ |
141 |
++ OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */ |
142 |
++ >; |
143 |
++ }; |
144 |
++}; |
145 |
+diff --git a/arch/arm/boot/dts/logicpd-som-lv.dtsi b/arch/arm/boot/dts/logicpd-som-lv.dtsi |
146 |
+index c5d54c4d37476..499eea86e1022 100644 |
147 |
+--- a/arch/arm/boot/dts/logicpd-som-lv.dtsi |
148 |
++++ b/arch/arm/boot/dts/logicpd-som-lv.dtsi |
149 |
+@@ -269,21 +269,6 @@ |
150 |
+ }; |
151 |
+ }; |
152 |
+ |
153 |
+-&omap3_pmx_core2 { |
154 |
+- pinctrl-names = "default"; |
155 |
+- pinctrl-0 = <&hsusb2_2_pins>; |
156 |
+- hsusb2_2_pins: pinmux_hsusb2_2_pins { |
157 |
+- pinctrl-single,pins = < |
158 |
+- OMAP3630_CORE2_IOPAD(0x25f0, PIN_OUTPUT | MUX_MODE3) /* etk_d10.hsusb2_clk */ |
159 |
+- OMAP3630_CORE2_IOPAD(0x25f2, PIN_OUTPUT | MUX_MODE3) /* etk_d11.hsusb2_stp */ |
160 |
+- OMAP3630_CORE2_IOPAD(0x25f4, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d12.hsusb2_dir */ |
161 |
+- OMAP3630_CORE2_IOPAD(0x25f6, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d13.hsusb2_nxt */ |
162 |
+- OMAP3630_CORE2_IOPAD(0x25f8, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d14.hsusb2_data0 */ |
163 |
+- OMAP3630_CORE2_IOPAD(0x25fa, PIN_INPUT_PULLDOWN | MUX_MODE3) /* etk_d15.hsusb2_data1 */ |
164 |
+- >; |
165 |
+- }; |
166 |
+-}; |
167 |
+- |
168 |
+ &uart2 { |
169 |
+ interrupts-extended = <&intc 73 &omap3_pmx_core OMAP3_UART2_RX>; |
170 |
+ pinctrl-names = "default"; |
171 |
+diff --git a/arch/arm/boot/dts/omap3-gta04.dtsi b/arch/arm/boot/dts/omap3-gta04.dtsi |
172 |
+index a5aed92ab54b1..820bdd5326aba 100644 |
173 |
+--- a/arch/arm/boot/dts/omap3-gta04.dtsi |
174 |
++++ b/arch/arm/boot/dts/omap3-gta04.dtsi |
175 |
+@@ -29,6 +29,8 @@ |
176 |
+ aliases { |
177 |
+ display0 = &lcd; |
178 |
+ display1 = &tv0; |
179 |
++ /delete-property/ mmc2; |
180 |
++ /delete-property/ mmc3; |
181 |
+ }; |
182 |
+ |
183 |
+ /* fixed 26MHz oscillator */ |
184 |
+diff --git a/arch/arm/mach-omap2/omap4-common.c b/arch/arm/mach-omap2/omap4-common.c |
185 |
+index 7074cfd1ff413..79a1e4c51e3d0 100644 |
186 |
+--- a/arch/arm/mach-omap2/omap4-common.c |
187 |
++++ b/arch/arm/mach-omap2/omap4-common.c |
188 |
+@@ -318,10 +318,12 @@ void __init omap_gic_of_init(void) |
189 |
+ |
190 |
+ np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-gic"); |
191 |
+ gic_dist_base_addr = of_iomap(np, 0); |
192 |
++ of_node_put(np); |
193 |
+ WARN_ON(!gic_dist_base_addr); |
194 |
+ |
195 |
+ np = of_find_compatible_node(NULL, NULL, "arm,cortex-a9-twd-timer"); |
196 |
+ twd_base = of_iomap(np, 0); |
197 |
++ of_node_put(np); |
198 |
+ WARN_ON(!twd_base); |
199 |
+ |
200 |
+ skip_errata_init: |
201 |
+diff --git a/arch/mips/include/asm/timex.h b/arch/mips/include/asm/timex.h |
202 |
+index b05bb70a2e46f..8026baf46e729 100644 |
203 |
+--- a/arch/mips/include/asm/timex.h |
204 |
++++ b/arch/mips/include/asm/timex.h |
205 |
+@@ -40,9 +40,9 @@ |
206 |
+ typedef unsigned int cycles_t; |
207 |
+ |
208 |
+ /* |
209 |
+- * On R4000/R4400 before version 5.0 an erratum exists such that if the |
210 |
+- * cycle counter is read in the exact moment that it is matching the |
211 |
+- * compare register, no interrupt will be generated. |
212 |
++ * On R4000/R4400 an erratum exists such that if the cycle counter is |
213 |
++ * read in the exact moment that it is matching the compare register, |
214 |
++ * no interrupt will be generated. |
215 |
+ * |
216 |
+ * There is a suggested workaround and also the erratum can't strike if |
217 |
+ * the compare interrupt isn't being used as the clock source device. |
218 |
+@@ -63,7 +63,7 @@ static inline int can_use_mips_counter(unsigned int prid) |
219 |
+ if (!__builtin_constant_p(cpu_has_counter)) |
220 |
+ asm volatile("" : "=m" (cpu_data[0].options)); |
221 |
+ if (likely(cpu_has_counter && |
222 |
+- prid >= (PRID_IMP_R4000 | PRID_REV_ENCODE_44(5, 0)))) |
223 |
++ prid > (PRID_IMP_R4000 | PRID_REV_ENCODE_44(15, 15)))) |
224 |
+ return 1; |
225 |
+ else |
226 |
+ return 0; |
227 |
+diff --git a/arch/mips/kernel/time.c b/arch/mips/kernel/time.c |
228 |
+index a0d994a4aaa95..ef79b3fc7588d 100644 |
229 |
+--- a/arch/mips/kernel/time.c |
230 |
++++ b/arch/mips/kernel/time.c |
231 |
+@@ -140,15 +140,10 @@ static __init int cpu_has_mfc0_count_bug(void) |
232 |
+ case CPU_R4400MC: |
233 |
+ /* |
234 |
+ * The published errata for the R4400 up to 3.0 say the CPU |
235 |
+- * has the mfc0 from count bug. |
236 |
++ * has the mfc0 from count bug. This seems the last version |
237 |
++ * produced. |
238 |
+ */ |
239 |
+- if ((current_cpu_data.processor_id & 0xff) <= 0x30) |
240 |
+- return 1; |
241 |
+- |
242 |
+- /* |
243 |
+- * we assume newer revisions are ok |
244 |
+- */ |
245 |
+- return 0; |
246 |
++ return 1; |
247 |
+ } |
248 |
+ |
249 |
+ return 0; |
250 |
+diff --git a/arch/parisc/kernel/processor.c b/arch/parisc/kernel/processor.c |
251 |
+index 82bd0d0927ce3..0b0194150b682 100644 |
252 |
+--- a/arch/parisc/kernel/processor.c |
253 |
++++ b/arch/parisc/kernel/processor.c |
254 |
+@@ -423,8 +423,7 @@ show_cpuinfo (struct seq_file *m, void *v) |
255 |
+ } |
256 |
+ seq_printf(m, " (0x%02lx)\n", boot_cpu_data.pdc.capabilities); |
257 |
+ |
258 |
+- seq_printf(m, "model\t\t: %s\n" |
259 |
+- "model name\t: %s\n", |
260 |
++ seq_printf(m, "model\t\t: %s - %s\n", |
261 |
+ boot_cpu_data.pdc.sys_model_name, |
262 |
+ cpuinfo->dev ? |
263 |
+ cpuinfo->dev->name : "Unknown"); |
264 |
+diff --git a/arch/x86/include/asm/microcode.h b/arch/x86/include/asm/microcode.h |
265 |
+index 2b7cc5397f80d..91a06cef50c1b 100644 |
266 |
+--- a/arch/x86/include/asm/microcode.h |
267 |
++++ b/arch/x86/include/asm/microcode.h |
268 |
+@@ -133,11 +133,13 @@ extern void load_ucode_ap(void); |
269 |
+ void reload_early_microcode(void); |
270 |
+ extern bool get_builtin_firmware(struct cpio_data *cd, const char *name); |
271 |
+ extern bool initrd_gone; |
272 |
++void microcode_bsp_resume(void); |
273 |
+ #else |
274 |
+ static inline int __init microcode_init(void) { return 0; }; |
275 |
+ static inline void __init load_ucode_bsp(void) { } |
276 |
+ static inline void load_ucode_ap(void) { } |
277 |
+ static inline void reload_early_microcode(void) { } |
278 |
++static inline void microcode_bsp_resume(void) { } |
279 |
+ static inline bool |
280 |
+ get_builtin_firmware(struct cpio_data *cd, const char *name) { return false; } |
281 |
+ #endif |
282 |
+diff --git a/arch/x86/kernel/cpu/microcode/core.c b/arch/x86/kernel/cpu/microcode/core.c |
283 |
+index eab4de387ce64..985ef98c8ba23 100644 |
284 |
+--- a/arch/x86/kernel/cpu/microcode/core.c |
285 |
++++ b/arch/x86/kernel/cpu/microcode/core.c |
286 |
+@@ -773,9 +773,9 @@ static struct subsys_interface mc_cpu_interface = { |
287 |
+ }; |
288 |
+ |
289 |
+ /** |
290 |
+- * mc_bp_resume - Update boot CPU microcode during resume. |
291 |
++ * microcode_bsp_resume - Update boot CPU microcode during resume. |
292 |
+ */ |
293 |
+-static void mc_bp_resume(void) |
294 |
++void microcode_bsp_resume(void) |
295 |
+ { |
296 |
+ int cpu = smp_processor_id(); |
297 |
+ struct ucode_cpu_info *uci = ucode_cpu_info + cpu; |
298 |
+@@ -787,7 +787,7 @@ static void mc_bp_resume(void) |
299 |
+ } |
300 |
+ |
301 |
+ static struct syscore_ops mc_syscore_ops = { |
302 |
+- .resume = mc_bp_resume, |
303 |
++ .resume = microcode_bsp_resume, |
304 |
+ }; |
305 |
+ |
306 |
+ static int mc_cpu_starting(unsigned int cpu) |
307 |
+diff --git a/arch/x86/kvm/cpuid.c b/arch/x86/kvm/cpuid.c |
308 |
+index 097eef712cdc0..0489ffc3dfe5f 100644 |
309 |
+--- a/arch/x86/kvm/cpuid.c |
310 |
++++ b/arch/x86/kvm/cpuid.c |
311 |
+@@ -532,6 +532,11 @@ static inline int __do_cpuid_ent(struct kvm_cpuid_entry2 *entry, u32 function, |
312 |
+ union cpuid10_eax eax; |
313 |
+ union cpuid10_edx edx; |
314 |
+ |
315 |
++ if (!static_cpu_has(X86_FEATURE_ARCH_PERFMON)) { |
316 |
++ entry->eax = entry->ebx = entry->ecx = entry->edx = 0; |
317 |
++ break; |
318 |
++ } |
319 |
++ |
320 |
+ perf_get_x86_pmu_capability(&cap); |
321 |
+ |
322 |
+ /* |
323 |
+diff --git a/arch/x86/lib/usercopy_64.c b/arch/x86/lib/usercopy_64.c |
324 |
+index 40dbbd8f1fe41..8c6d0fb72b3a1 100644 |
325 |
+--- a/arch/x86/lib/usercopy_64.c |
326 |
++++ b/arch/x86/lib/usercopy_64.c |
327 |
+@@ -161,7 +161,7 @@ void memcpy_flushcache(void *_dst, const void *_src, size_t size) |
328 |
+ |
329 |
+ /* cache copy and flush to align dest */ |
330 |
+ if (!IS_ALIGNED(dest, 8)) { |
331 |
+- unsigned len = min_t(unsigned, size, ALIGN(dest, 8) - dest); |
332 |
++ size_t len = min_t(size_t, size, ALIGN(dest, 8) - dest); |
333 |
+ |
334 |
+ memcpy((void *) dest, (void *) source, len); |
335 |
+ clean_cache_range((void *) dest, len); |
336 |
+diff --git a/arch/x86/power/cpu.c b/arch/x86/power/cpu.c |
337 |
+index e00b8c36ab721..7948249482637 100644 |
338 |
+--- a/arch/x86/power/cpu.c |
339 |
++++ b/arch/x86/power/cpu.c |
340 |
+@@ -26,6 +26,7 @@ |
341 |
+ #include <asm/cpu.h> |
342 |
+ #include <asm/mmu_context.h> |
343 |
+ #include <asm/cpu_device_id.h> |
344 |
++#include <asm/microcode.h> |
345 |
+ |
346 |
+ #ifdef CONFIG_X86_32 |
347 |
+ __visible unsigned long saved_context_ebx; |
348 |
+@@ -268,6 +269,13 @@ static void notrace __restore_processor_state(struct saved_context *ctxt) |
349 |
+ x86_platform.restore_sched_clock_state(); |
350 |
+ mtrr_bp_restore(); |
351 |
+ perf_restore_debug_store(); |
352 |
++ |
353 |
++ microcode_bsp_resume(); |
354 |
++ |
355 |
++ /* |
356 |
++ * This needs to happen after the microcode has been updated upon resume |
357 |
++ * because some of the MSRs are "emulated" in microcode. |
358 |
++ */ |
359 |
+ msr_restore_context(ctxt); |
360 |
+ } |
361 |
+ |
362 |
+diff --git a/drivers/bus/sunxi-rsb.c b/drivers/bus/sunxi-rsb.c |
363 |
+index 2ca2cc56bcef6..b85d013a9185f 100644 |
364 |
+--- a/drivers/bus/sunxi-rsb.c |
365 |
++++ b/drivers/bus/sunxi-rsb.c |
366 |
+@@ -224,6 +224,8 @@ static struct sunxi_rsb_device *sunxi_rsb_device_create(struct sunxi_rsb *rsb, |
367 |
+ |
368 |
+ dev_dbg(&rdev->dev, "device %s registered\n", dev_name(&rdev->dev)); |
369 |
+ |
370 |
++ return rdev; |
371 |
++ |
372 |
+ err_device_add: |
373 |
+ put_device(&rdev->dev); |
374 |
+ |
375 |
+diff --git a/drivers/clk/sunxi/clk-sun9i-mmc.c b/drivers/clk/sunxi/clk-sun9i-mmc.c |
376 |
+index f00d8758ba24f..a706ae9a010a5 100644 |
377 |
+--- a/drivers/clk/sunxi/clk-sun9i-mmc.c |
378 |
++++ b/drivers/clk/sunxi/clk-sun9i-mmc.c |
379 |
+@@ -117,6 +117,8 @@ static int sun9i_a80_mmc_config_clk_probe(struct platform_device *pdev) |
380 |
+ spin_lock_init(&data->lock); |
381 |
+ |
382 |
+ r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
383 |
++ if (!r) |
384 |
++ return -EINVAL; |
385 |
+ /* one clock/reset pair per word */ |
386 |
+ count = DIV_ROUND_UP((resource_size(r)), SUN9I_MMC_WIDTH); |
387 |
+ data->membase = devm_ioremap_resource(&pdev->dev, r); |
388 |
+diff --git a/drivers/firewire/core-card.c b/drivers/firewire/core-card.c |
389 |
+index 57ea7f4641787..11c634125c7df 100644 |
390 |
+--- a/drivers/firewire/core-card.c |
391 |
++++ b/drivers/firewire/core-card.c |
392 |
+@@ -681,6 +681,7 @@ EXPORT_SYMBOL_GPL(fw_card_release); |
393 |
+ void fw_core_remove_card(struct fw_card *card) |
394 |
+ { |
395 |
+ struct fw_card_driver dummy_driver = dummy_driver_template; |
396 |
++ unsigned long flags; |
397 |
+ |
398 |
+ card->driver->update_phy_reg(card, 4, |
399 |
+ PHY_LINK_ACTIVE | PHY_CONTENDER, 0); |
400 |
+@@ -695,7 +696,9 @@ void fw_core_remove_card(struct fw_card *card) |
401 |
+ dummy_driver.stop_iso = card->driver->stop_iso; |
402 |
+ card->driver = &dummy_driver; |
403 |
+ |
404 |
++ spin_lock_irqsave(&card->lock, flags); |
405 |
+ fw_destroy_nodes(card); |
406 |
++ spin_unlock_irqrestore(&card->lock, flags); |
407 |
+ |
408 |
+ /* Wait for all users, especially device workqueue jobs, to finish. */ |
409 |
+ fw_card_put(card); |
410 |
+diff --git a/drivers/firewire/core-cdev.c b/drivers/firewire/core-cdev.c |
411 |
+index d8e185582642b..bf03455b6fc20 100644 |
412 |
+--- a/drivers/firewire/core-cdev.c |
413 |
++++ b/drivers/firewire/core-cdev.c |
414 |
+@@ -1495,6 +1495,7 @@ static void outbound_phy_packet_callback(struct fw_packet *packet, |
415 |
+ { |
416 |
+ struct outbound_phy_packet_event *e = |
417 |
+ container_of(packet, struct outbound_phy_packet_event, p); |
418 |
++ struct client *e_client; |
419 |
+ |
420 |
+ switch (status) { |
421 |
+ /* expected: */ |
422 |
+@@ -1511,9 +1512,10 @@ static void outbound_phy_packet_callback(struct fw_packet *packet, |
423 |
+ } |
424 |
+ e->phy_packet.data[0] = packet->timestamp; |
425 |
+ |
426 |
++ e_client = e->client; |
427 |
+ queue_event(e->client, &e->event, &e->phy_packet, |
428 |
+ sizeof(e->phy_packet) + e->phy_packet.length, NULL, 0); |
429 |
+- client_put(e->client); |
430 |
++ client_put(e_client); |
431 |
+ } |
432 |
+ |
433 |
+ static int ioctl_send_phy_packet(struct client *client, union ioctl_arg *arg) |
434 |
+diff --git a/drivers/firewire/core-topology.c b/drivers/firewire/core-topology.c |
435 |
+index 7db234d3fbdd1..b86d144f36137 100644 |
436 |
+--- a/drivers/firewire/core-topology.c |
437 |
++++ b/drivers/firewire/core-topology.c |
438 |
+@@ -386,16 +386,13 @@ static void report_found_node(struct fw_card *card, |
439 |
+ card->bm_retries = 0; |
440 |
+ } |
441 |
+ |
442 |
++/* Must be called with card->lock held */ |
443 |
+ void fw_destroy_nodes(struct fw_card *card) |
444 |
+ { |
445 |
+- unsigned long flags; |
446 |
+- |
447 |
+- spin_lock_irqsave(&card->lock, flags); |
448 |
+ card->color++; |
449 |
+ if (card->local_node != NULL) |
450 |
+ for_each_fw_node(card, card->local_node, report_lost_node); |
451 |
+ card->local_node = NULL; |
452 |
+- spin_unlock_irqrestore(&card->lock, flags); |
453 |
+ } |
454 |
+ |
455 |
+ static void move_tree(struct fw_node *node0, struct fw_node *node1, int port) |
456 |
+@@ -521,6 +518,8 @@ void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation, |
457 |
+ struct fw_node *local_node; |
458 |
+ unsigned long flags; |
459 |
+ |
460 |
++ spin_lock_irqsave(&card->lock, flags); |
461 |
++ |
462 |
+ /* |
463 |
+ * If the selfID buffer is not the immediate successor of the |
464 |
+ * previously processed one, we cannot reliably compare the |
465 |
+@@ -532,8 +531,6 @@ void fw_core_handle_bus_reset(struct fw_card *card, int node_id, int generation, |
466 |
+ card->bm_retries = 0; |
467 |
+ } |
468 |
+ |
469 |
+- spin_lock_irqsave(&card->lock, flags); |
470 |
+- |
471 |
+ card->broadcast_channel_allocated = card->broadcast_channel_auto_allocated; |
472 |
+ card->node_id = node_id; |
473 |
+ /* |
474 |
+diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c |
475 |
+index 4372f9e4b0dae..ce764bebb88c5 100644 |
476 |
+--- a/drivers/firewire/core-transaction.c |
477 |
++++ b/drivers/firewire/core-transaction.c |
478 |
+@@ -86,24 +86,25 @@ static int try_cancel_split_timeout(struct fw_transaction *t) |
479 |
+ static int close_transaction(struct fw_transaction *transaction, |
480 |
+ struct fw_card *card, int rcode) |
481 |
+ { |
482 |
+- struct fw_transaction *t; |
483 |
++ struct fw_transaction *t = NULL, *iter; |
484 |
+ unsigned long flags; |
485 |
+ |
486 |
+ spin_lock_irqsave(&card->lock, flags); |
487 |
+- list_for_each_entry(t, &card->transaction_list, link) { |
488 |
+- if (t == transaction) { |
489 |
+- if (!try_cancel_split_timeout(t)) { |
490 |
++ list_for_each_entry(iter, &card->transaction_list, link) { |
491 |
++ if (iter == transaction) { |
492 |
++ if (!try_cancel_split_timeout(iter)) { |
493 |
+ spin_unlock_irqrestore(&card->lock, flags); |
494 |
+ goto timed_out; |
495 |
+ } |
496 |
+- list_del_init(&t->link); |
497 |
+- card->tlabel_mask &= ~(1ULL << t->tlabel); |
498 |
++ list_del_init(&iter->link); |
499 |
++ card->tlabel_mask &= ~(1ULL << iter->tlabel); |
500 |
++ t = iter; |
501 |
+ break; |
502 |
+ } |
503 |
+ } |
504 |
+ spin_unlock_irqrestore(&card->lock, flags); |
505 |
+ |
506 |
+- if (&t->link != &card->transaction_list) { |
507 |
++ if (t) { |
508 |
+ t->callback(card, rcode, NULL, 0, t->callback_data); |
509 |
+ return 0; |
510 |
+ } |
511 |
+@@ -938,7 +939,7 @@ EXPORT_SYMBOL(fw_core_handle_request); |
512 |
+ |
513 |
+ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p) |
514 |
+ { |
515 |
+- struct fw_transaction *t; |
516 |
++ struct fw_transaction *t = NULL, *iter; |
517 |
+ unsigned long flags; |
518 |
+ u32 *data; |
519 |
+ size_t data_length; |
520 |
+@@ -950,20 +951,21 @@ void fw_core_handle_response(struct fw_card *card, struct fw_packet *p) |
521 |
+ rcode = HEADER_GET_RCODE(p->header[1]); |
522 |
+ |
523 |
+ spin_lock_irqsave(&card->lock, flags); |
524 |
+- list_for_each_entry(t, &card->transaction_list, link) { |
525 |
+- if (t->node_id == source && t->tlabel == tlabel) { |
526 |
+- if (!try_cancel_split_timeout(t)) { |
527 |
++ list_for_each_entry(iter, &card->transaction_list, link) { |
528 |
++ if (iter->node_id == source && iter->tlabel == tlabel) { |
529 |
++ if (!try_cancel_split_timeout(iter)) { |
530 |
+ spin_unlock_irqrestore(&card->lock, flags); |
531 |
+ goto timed_out; |
532 |
+ } |
533 |
+- list_del_init(&t->link); |
534 |
+- card->tlabel_mask &= ~(1ULL << t->tlabel); |
535 |
++ list_del_init(&iter->link); |
536 |
++ card->tlabel_mask &= ~(1ULL << iter->tlabel); |
537 |
++ t = iter; |
538 |
+ break; |
539 |
+ } |
540 |
+ } |
541 |
+ spin_unlock_irqrestore(&card->lock, flags); |
542 |
+ |
543 |
+- if (&t->link == &card->transaction_list) { |
544 |
++ if (!t) { |
545 |
+ timed_out: |
546 |
+ fw_notice(card, "unsolicited response (source %x, tlabel %x)\n", |
547 |
+ source, tlabel); |
548 |
+diff --git a/drivers/firewire/sbp2.c b/drivers/firewire/sbp2.c |
549 |
+index 6bac03999fd49..d418a71faf0b1 100644 |
550 |
+--- a/drivers/firewire/sbp2.c |
551 |
++++ b/drivers/firewire/sbp2.c |
552 |
+@@ -421,7 +421,7 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request, |
553 |
+ void *payload, size_t length, void *callback_data) |
554 |
+ { |
555 |
+ struct sbp2_logical_unit *lu = callback_data; |
556 |
+- struct sbp2_orb *orb; |
557 |
++ struct sbp2_orb *orb = NULL, *iter; |
558 |
+ struct sbp2_status status; |
559 |
+ unsigned long flags; |
560 |
+ |
561 |
+@@ -446,17 +446,18 @@ static void sbp2_status_write(struct fw_card *card, struct fw_request *request, |
562 |
+ |
563 |
+ /* Lookup the orb corresponding to this status write. */ |
564 |
+ spin_lock_irqsave(&lu->tgt->lock, flags); |
565 |
+- list_for_each_entry(orb, &lu->orb_list, link) { |
566 |
++ list_for_each_entry(iter, &lu->orb_list, link) { |
567 |
+ if (STATUS_GET_ORB_HIGH(status) == 0 && |
568 |
+- STATUS_GET_ORB_LOW(status) == orb->request_bus) { |
569 |
+- orb->rcode = RCODE_COMPLETE; |
570 |
+- list_del(&orb->link); |
571 |
++ STATUS_GET_ORB_LOW(status) == iter->request_bus) { |
572 |
++ iter->rcode = RCODE_COMPLETE; |
573 |
++ list_del(&iter->link); |
574 |
++ orb = iter; |
575 |
+ break; |
576 |
+ } |
577 |
+ } |
578 |
+ spin_unlock_irqrestore(&lu->tgt->lock, flags); |
579 |
+ |
580 |
+- if (&orb->link != &lu->orb_list) { |
581 |
++ if (orb) { |
582 |
+ orb->callback(orb, &status); |
583 |
+ kref_put(&orb->kref, free_orb); /* orb callback reference */ |
584 |
+ } else { |
585 |
+diff --git a/drivers/gpio/gpiolib-of.c b/drivers/gpio/gpiolib-of.c |
586 |
+index e0f149bdf98ff..09999e3e3109e 100644 |
587 |
+--- a/drivers/gpio/gpiolib-of.c |
588 |
++++ b/drivers/gpio/gpiolib-of.c |
589 |
+@@ -525,7 +525,7 @@ static void of_gpiochip_init_valid_mask(struct gpio_chip *chip) |
590 |
+ i, &start); |
591 |
+ of_property_read_u32_index(np, "gpio-reserved-ranges", |
592 |
+ i + 1, &count); |
593 |
+- if (start >= chip->ngpio || start + count >= chip->ngpio) |
594 |
++ if (start >= chip->ngpio || start + count > chip->ngpio) |
595 |
+ continue; |
596 |
+ |
597 |
+ bitmap_clear(chip->valid_mask, start, count); |
598 |
+diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c |
599 |
+index 1c1a435d354bc..56ed771032c2f 100644 |
600 |
+--- a/drivers/gpu/drm/vgem/vgem_drv.c |
601 |
++++ b/drivers/gpu/drm/vgem/vgem_drv.c |
602 |
+@@ -189,9 +189,10 @@ static struct drm_gem_object *vgem_gem_create(struct drm_device *dev, |
603 |
+ return ERR_CAST(obj); |
604 |
+ |
605 |
+ ret = drm_gem_handle_create(file, &obj->base, handle); |
606 |
+- drm_gem_object_put_unlocked(&obj->base); |
607 |
+- if (ret) |
608 |
++ if (ret) { |
609 |
++ drm_gem_object_put_unlocked(&obj->base); |
610 |
+ return ERR_PTR(ret); |
611 |
++ } |
612 |
+ |
613 |
+ return &obj->base; |
614 |
+ } |
615 |
+@@ -214,7 +215,9 @@ static int vgem_gem_dumb_create(struct drm_file *file, struct drm_device *dev, |
616 |
+ args->size = gem_object->size; |
617 |
+ args->pitch = pitch; |
618 |
+ |
619 |
+- DRM_DEBUG_DRIVER("Created object of size %lld\n", size); |
620 |
++ drm_gem_object_put_unlocked(gem_object); |
621 |
++ |
622 |
++ DRM_DEBUG_DRIVER("Created object of size %llu\n", args->size); |
623 |
+ |
624 |
+ return 0; |
625 |
+ } |
626 |
+diff --git a/drivers/hwmon/adt7470.c b/drivers/hwmon/adt7470.c |
627 |
+index 2cd920751441d..6876e3817850d 100644 |
628 |
+--- a/drivers/hwmon/adt7470.c |
629 |
++++ b/drivers/hwmon/adt7470.c |
630 |
+@@ -33,6 +33,7 @@ |
631 |
+ #include <linux/kthread.h> |
632 |
+ #include <linux/slab.h> |
633 |
+ #include <linux/util_macros.h> |
634 |
++#include <linux/sched.h> |
635 |
+ |
636 |
+ /* Addresses to scan */ |
637 |
+ static const unsigned short normal_i2c[] = { 0x2C, 0x2E, 0x2F, I2C_CLIENT_END }; |
638 |
+@@ -273,11 +274,10 @@ static int adt7470_update_thread(void *p) |
639 |
+ adt7470_read_temperatures(client, data); |
640 |
+ mutex_unlock(&data->lock); |
641 |
+ |
642 |
+- set_current_state(TASK_INTERRUPTIBLE); |
643 |
+ if (kthread_should_stop()) |
644 |
+ break; |
645 |
+ |
646 |
+- schedule_timeout(msecs_to_jiffies(data->auto_update_interval)); |
647 |
++ schedule_timeout_interruptible(msecs_to_jiffies(data->auto_update_interval)); |
648 |
+ } |
649 |
+ |
650 |
+ return 0; |
651 |
+diff --git a/drivers/iio/dac/ad5446.c b/drivers/iio/dac/ad5446.c |
652 |
+index f540c0f11c132..1ebeca7e95751 100644 |
653 |
+--- a/drivers/iio/dac/ad5446.c |
654 |
++++ b/drivers/iio/dac/ad5446.c |
655 |
+@@ -171,7 +171,7 @@ static int ad5446_read_raw(struct iio_dev *indio_dev, |
656 |
+ |
657 |
+ switch (m) { |
658 |
+ case IIO_CHAN_INFO_RAW: |
659 |
+- *val = st->cached_val; |
660 |
++ *val = st->cached_val >> chan->scan_type.shift; |
661 |
+ return IIO_VAL_INT; |
662 |
+ case IIO_CHAN_INFO_SCALE: |
663 |
+ *val = st->vref_mv; |
664 |
+diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c |
665 |
+index 7549abd544c0f..8011245a01d77 100644 |
666 |
+--- a/drivers/iio/dac/ad5592r-base.c |
667 |
++++ b/drivers/iio/dac/ad5592r-base.c |
668 |
+@@ -531,7 +531,7 @@ static int ad5592r_alloc_channels(struct ad5592r_state *st) |
669 |
+ if (!ret) |
670 |
+ st->channel_modes[reg] = tmp; |
671 |
+ |
672 |
+- fwnode_property_read_u32(child, "adi,off-state", &tmp); |
673 |
++ ret = fwnode_property_read_u32(child, "adi,off-state", &tmp); |
674 |
+ if (!ret) |
675 |
+ st->channel_offstate[reg] = tmp; |
676 |
+ } |
677 |
+diff --git a/drivers/iio/magnetometer/ak8975.c b/drivers/iio/magnetometer/ak8975.c |
678 |
+index 379aa7f4a8041..3303feb54984a 100644 |
679 |
+--- a/drivers/iio/magnetometer/ak8975.c |
680 |
++++ b/drivers/iio/magnetometer/ak8975.c |
681 |
+@@ -404,6 +404,7 @@ static int ak8975_power_on(const struct ak8975_data *data) |
682 |
+ if (ret) { |
683 |
+ dev_warn(&data->client->dev, |
684 |
+ "Failed to enable specified Vid supply\n"); |
685 |
++ regulator_disable(data->vdd); |
686 |
+ return ret; |
687 |
+ } |
688 |
+ /* |
689 |
+diff --git a/drivers/md/dm.c b/drivers/md/dm.c |
690 |
+index 01bf5bc925d0b..d2ee97cd7d14e 100644 |
691 |
+--- a/drivers/md/dm.c |
692 |
++++ b/drivers/md/dm.c |
693 |
+@@ -631,21 +631,20 @@ static void start_io_acct(struct dm_io *io) |
694 |
+ false, 0, &io->stats_aux); |
695 |
+ } |
696 |
+ |
697 |
+-static void end_io_acct(struct dm_io *io) |
698 |
++static void end_io_acct(struct mapped_device *md, struct bio *bio, |
699 |
++ unsigned long start_time, struct dm_stats_aux *stats_aux) |
700 |
+ { |
701 |
+- struct mapped_device *md = io->md; |
702 |
+- struct bio *bio = io->orig_bio; |
703 |
+- unsigned long duration = jiffies - io->start_time; |
704 |
++ unsigned long duration = jiffies - start_time; |
705 |
+ int pending; |
706 |
+ int rw = bio_data_dir(bio); |
707 |
+ |
708 |
+ generic_end_io_acct(md->queue, bio_op(bio), &dm_disk(md)->part0, |
709 |
+- io->start_time); |
710 |
++ start_time); |
711 |
+ |
712 |
+ if (unlikely(dm_stats_used(&md->stats))) |
713 |
+ dm_stats_account_io(&md->stats, bio_data_dir(bio), |
714 |
+ bio->bi_iter.bi_sector, bio_sectors(bio), |
715 |
+- true, duration, &io->stats_aux); |
716 |
++ true, duration, stats_aux); |
717 |
+ |
718 |
+ /* |
719 |
+ * After this is decremented the bio must not be touched if it is |
720 |
+@@ -872,6 +871,8 @@ static void dec_pending(struct dm_io *io, blk_status_t error) |
721 |
+ blk_status_t io_error; |
722 |
+ struct bio *bio; |
723 |
+ struct mapped_device *md = io->md; |
724 |
++ unsigned long start_time = 0; |
725 |
++ struct dm_stats_aux stats_aux; |
726 |
+ |
727 |
+ /* Push-back supersedes any I/O errors */ |
728 |
+ if (unlikely(error)) { |
729 |
+@@ -898,8 +899,10 @@ static void dec_pending(struct dm_io *io, blk_status_t error) |
730 |
+ |
731 |
+ io_error = io->status; |
732 |
+ bio = io->orig_bio; |
733 |
+- end_io_acct(io); |
734 |
++ start_time = io->start_time; |
735 |
++ stats_aux = io->stats_aux; |
736 |
+ free_io(md, io); |
737 |
++ end_io_acct(md, bio, start_time, &stats_aux); |
738 |
+ |
739 |
+ if (io_error == BLK_STS_DM_REQUEUE) |
740 |
+ return; |
741 |
+@@ -2472,6 +2475,8 @@ static int dm_wait_for_completion(struct mapped_device *md, long task_state) |
742 |
+ } |
743 |
+ finish_wait(&md->wait, &wait); |
744 |
+ |
745 |
++ smp_rmb(); /* paired with atomic_dec_return in end_io_acct */ |
746 |
++ |
747 |
+ return r; |
748 |
+ } |
749 |
+ |
750 |
+diff --git a/drivers/mmc/host/rtsx_pci_sdmmc.c b/drivers/mmc/host/rtsx_pci_sdmmc.c |
751 |
+index c1de8fa50fe8f..98b150c60b428 100644 |
752 |
+--- a/drivers/mmc/host/rtsx_pci_sdmmc.c |
753 |
++++ b/drivers/mmc/host/rtsx_pci_sdmmc.c |
754 |
+@@ -49,10 +49,7 @@ struct realtek_pci_sdmmc { |
755 |
+ bool double_clk; |
756 |
+ bool eject; |
757 |
+ bool initial_mode; |
758 |
+- int power_state; |
759 |
+-#define SDMMC_POWER_ON 1 |
760 |
+-#define SDMMC_POWER_OFF 0 |
761 |
+- |
762 |
++ int prev_power_state; |
763 |
+ int sg_count; |
764 |
+ s32 cookie; |
765 |
+ int cookie_sg_count; |
766 |
+@@ -914,14 +911,21 @@ static int sd_set_bus_width(struct realtek_pci_sdmmc *host, |
767 |
+ return err; |
768 |
+ } |
769 |
+ |
770 |
+-static int sd_power_on(struct realtek_pci_sdmmc *host) |
771 |
++static int sd_power_on(struct realtek_pci_sdmmc *host, unsigned char power_mode) |
772 |
+ { |
773 |
+ struct rtsx_pcr *pcr = host->pcr; |
774 |
+ int err; |
775 |
+ |
776 |
+- if (host->power_state == SDMMC_POWER_ON) |
777 |
++ if (host->prev_power_state == MMC_POWER_ON) |
778 |
+ return 0; |
779 |
+ |
780 |
++ if (host->prev_power_state == MMC_POWER_UP) { |
781 |
++ rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, 0); |
782 |
++ goto finish; |
783 |
++ } |
784 |
++ |
785 |
++ msleep(100); |
786 |
++ |
787 |
+ rtsx_pci_init_cmd(pcr); |
788 |
+ rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SELECT, 0x07, SD_MOD_SEL); |
789 |
+ rtsx_pci_add_cmd(pcr, WRITE_REG_CMD, CARD_SHARE_MODE, |
790 |
+@@ -940,11 +944,17 @@ static int sd_power_on(struct realtek_pci_sdmmc *host) |
791 |
+ if (err < 0) |
792 |
+ return err; |
793 |
+ |
794 |
++ mdelay(1); |
795 |
++ |
796 |
+ err = rtsx_pci_write_register(pcr, CARD_OE, SD_OUTPUT_EN, SD_OUTPUT_EN); |
797 |
+ if (err < 0) |
798 |
+ return err; |
799 |
+ |
800 |
+- host->power_state = SDMMC_POWER_ON; |
801 |
++ /* send at least 74 clocks */ |
802 |
++ rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN, SD_CLK_TOGGLE_EN); |
803 |
++ |
804 |
++finish: |
805 |
++ host->prev_power_state = power_mode; |
806 |
+ return 0; |
807 |
+ } |
808 |
+ |
809 |
+@@ -953,7 +963,7 @@ static int sd_power_off(struct realtek_pci_sdmmc *host) |
810 |
+ struct rtsx_pcr *pcr = host->pcr; |
811 |
+ int err; |
812 |
+ |
813 |
+- host->power_state = SDMMC_POWER_OFF; |
814 |
++ host->prev_power_state = MMC_POWER_OFF; |
815 |
+ |
816 |
+ rtsx_pci_init_cmd(pcr); |
817 |
+ |
818 |
+@@ -979,7 +989,7 @@ static int sd_set_power_mode(struct realtek_pci_sdmmc *host, |
819 |
+ if (power_mode == MMC_POWER_OFF) |
820 |
+ err = sd_power_off(host); |
821 |
+ else |
822 |
+- err = sd_power_on(host); |
823 |
++ err = sd_power_on(host, power_mode); |
824 |
+ |
825 |
+ return err; |
826 |
+ } |
827 |
+@@ -1414,10 +1424,11 @@ static int rtsx_pci_sdmmc_drv_probe(struct platform_device *pdev) |
828 |
+ |
829 |
+ host = mmc_priv(mmc); |
830 |
+ host->pcr = pcr; |
831 |
++ mmc->ios.power_delay_ms = 5; |
832 |
+ host->mmc = mmc; |
833 |
+ host->pdev = pdev; |
834 |
+ host->cookie = -1; |
835 |
+- host->power_state = SDMMC_POWER_OFF; |
836 |
++ host->prev_power_state = MMC_POWER_OFF; |
837 |
+ INIT_WORK(&host->work, sd_request); |
838 |
+ platform_set_drvdata(pdev, host); |
839 |
+ pcr->slots[RTSX_SD_CARD].p_dev = pdev; |
840 |
+diff --git a/drivers/mtd/nand/raw/mtk_ecc.c b/drivers/mtd/nand/raw/mtk_ecc.c |
841 |
+index 6432bd70c3b39..9e4a78a808028 100644 |
842 |
+--- a/drivers/mtd/nand/raw/mtk_ecc.c |
843 |
++++ b/drivers/mtd/nand/raw/mtk_ecc.c |
844 |
+@@ -51,6 +51,7 @@ |
845 |
+ |
846 |
+ struct mtk_ecc_caps { |
847 |
+ u32 err_mask; |
848 |
++ u32 err_shift; |
849 |
+ const u8 *ecc_strength; |
850 |
+ const u32 *ecc_regs; |
851 |
+ u8 num_ecc_strength; |
852 |
+@@ -84,7 +85,7 @@ static const u8 ecc_strength_mt2712[] = { |
853 |
+ }; |
854 |
+ |
855 |
+ static const u8 ecc_strength_mt7622[] = { |
856 |
+- 4, 6, 8, 10, 12, 14, 16 |
857 |
++ 4, 6, 8, 10, 12 |
858 |
+ }; |
859 |
+ |
860 |
+ enum mtk_ecc_regs { |
861 |
+@@ -229,7 +230,7 @@ void mtk_ecc_get_stats(struct mtk_ecc *ecc, struct mtk_ecc_stats *stats, |
862 |
+ for (i = 0; i < sectors; i++) { |
863 |
+ offset = (i >> 2) << 2; |
864 |
+ err = readl(ecc->regs + ECC_DECENUM0 + offset); |
865 |
+- err = err >> ((i % 4) * 8); |
866 |
++ err = err >> ((i % 4) * ecc->caps->err_shift); |
867 |
+ err &= ecc->caps->err_mask; |
868 |
+ if (err == ecc->caps->err_mask) { |
869 |
+ /* uncorrectable errors */ |
870 |
+@@ -453,6 +454,7 @@ EXPORT_SYMBOL(mtk_ecc_get_parity_bits); |
871 |
+ |
872 |
+ static const struct mtk_ecc_caps mtk_ecc_caps_mt2701 = { |
873 |
+ .err_mask = 0x3f, |
874 |
++ .err_shift = 8, |
875 |
+ .ecc_strength = ecc_strength_mt2701, |
876 |
+ .ecc_regs = mt2701_ecc_regs, |
877 |
+ .num_ecc_strength = 20, |
878 |
+@@ -463,6 +465,7 @@ static const struct mtk_ecc_caps mtk_ecc_caps_mt2701 = { |
879 |
+ |
880 |
+ static const struct mtk_ecc_caps mtk_ecc_caps_mt2712 = { |
881 |
+ .err_mask = 0x7f, |
882 |
++ .err_shift = 8, |
883 |
+ .ecc_strength = ecc_strength_mt2712, |
884 |
+ .ecc_regs = mt2712_ecc_regs, |
885 |
+ .num_ecc_strength = 23, |
886 |
+@@ -472,10 +475,11 @@ static const struct mtk_ecc_caps mtk_ecc_caps_mt2712 = { |
887 |
+ }; |
888 |
+ |
889 |
+ static const struct mtk_ecc_caps mtk_ecc_caps_mt7622 = { |
890 |
+- .err_mask = 0x3f, |
891 |
++ .err_mask = 0x1f, |
892 |
++ .err_shift = 5, |
893 |
+ .ecc_strength = ecc_strength_mt7622, |
894 |
+ .ecc_regs = mt7622_ecc_regs, |
895 |
+- .num_ecc_strength = 7, |
896 |
++ .num_ecc_strength = 5, |
897 |
+ .ecc_mode_shift = 4, |
898 |
+ .parity_bits = 13, |
899 |
+ .pg_irq_sel = 0, |
900 |
+diff --git a/drivers/mtd/nand/raw/sh_flctl.c b/drivers/mtd/nand/raw/sh_flctl.c |
901 |
+index 683df1a12989c..07ba149fa9715 100644 |
902 |
+--- a/drivers/mtd/nand/raw/sh_flctl.c |
903 |
++++ b/drivers/mtd/nand/raw/sh_flctl.c |
904 |
+@@ -399,7 +399,8 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf, |
905 |
+ dma_addr_t dma_addr; |
906 |
+ dma_cookie_t cookie; |
907 |
+ uint32_t reg; |
908 |
+- int ret; |
909 |
++ int ret = 0; |
910 |
++ unsigned long time_left; |
911 |
+ |
912 |
+ if (dir == DMA_FROM_DEVICE) { |
913 |
+ chan = flctl->chan_fifo0_rx; |
914 |
+@@ -440,13 +441,14 @@ static int flctl_dma_fifo0_transfer(struct sh_flctl *flctl, unsigned long *buf, |
915 |
+ goto out; |
916 |
+ } |
917 |
+ |
918 |
+- ret = |
919 |
++ time_left = |
920 |
+ wait_for_completion_timeout(&flctl->dma_complete, |
921 |
+ msecs_to_jiffies(3000)); |
922 |
+ |
923 |
+- if (ret <= 0) { |
924 |
++ if (time_left == 0) { |
925 |
+ dmaengine_terminate_all(chan); |
926 |
+ dev_err(&flctl->pdev->dev, "wait_for_completion_timeout\n"); |
927 |
++ ret = -ETIMEDOUT; |
928 |
+ } |
929 |
+ |
930 |
+ out: |
931 |
+@@ -456,7 +458,7 @@ out: |
932 |
+ |
933 |
+ dma_unmap_single(chan->device->dev, dma_addr, len, dir); |
934 |
+ |
935 |
+- /* ret > 0 is success */ |
936 |
++ /* ret == 0 is success */ |
937 |
+ return ret; |
938 |
+ } |
939 |
+ |
940 |
+@@ -480,7 +482,7 @@ static void read_fiforeg(struct sh_flctl *flctl, int rlen, int offset) |
941 |
+ |
942 |
+ /* initiate DMA transfer */ |
943 |
+ if (flctl->chan_fifo0_rx && rlen >= 32 && |
944 |
+- flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE) > 0) |
945 |
++ !flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_FROM_DEVICE)) |
946 |
+ goto convert; /* DMA success */ |
947 |
+ |
948 |
+ /* do polling transfer */ |
949 |
+@@ -539,7 +541,7 @@ static void write_ec_fiforeg(struct sh_flctl *flctl, int rlen, |
950 |
+ |
951 |
+ /* initiate DMA transfer */ |
952 |
+ if (flctl->chan_fifo0_tx && rlen >= 32 && |
953 |
+- flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE) > 0) |
954 |
++ !flctl_dma_fifo0_transfer(flctl, buf, rlen, DMA_TO_DEVICE)) |
955 |
+ return; /* DMA success */ |
956 |
+ |
957 |
+ /* do polling transfer */ |
958 |
+diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c |
959 |
+index 7eec1d9f86a05..5784c34ba46e8 100644 |
960 |
+--- a/drivers/net/can/grcan.c |
961 |
++++ b/drivers/net/can/grcan.c |
962 |
+@@ -252,6 +252,7 @@ struct grcan_device_config { |
963 |
+ struct grcan_priv { |
964 |
+ struct can_priv can; /* must be the first member */ |
965 |
+ struct net_device *dev; |
966 |
++ struct device *ofdev_dev; |
967 |
+ struct napi_struct napi; |
968 |
+ |
969 |
+ struct grcan_registers __iomem *regs; /* ioremap'ed registers */ |
970 |
+@@ -928,7 +929,7 @@ static void grcan_free_dma_buffers(struct net_device *dev) |
971 |
+ struct grcan_priv *priv = netdev_priv(dev); |
972 |
+ struct grcan_dma *dma = &priv->dma; |
973 |
+ |
974 |
+- dma_free_coherent(&dev->dev, dma->base_size, dma->base_buf, |
975 |
++ dma_free_coherent(priv->ofdev_dev, dma->base_size, dma->base_buf, |
976 |
+ dma->base_handle); |
977 |
+ memset(dma, 0, sizeof(*dma)); |
978 |
+ } |
979 |
+@@ -953,7 +954,7 @@ static int grcan_allocate_dma_buffers(struct net_device *dev, |
980 |
+ |
981 |
+ /* Extra GRCAN_BUFFER_ALIGNMENT to allow for alignment */ |
982 |
+ dma->base_size = lsize + ssize + GRCAN_BUFFER_ALIGNMENT; |
983 |
+- dma->base_buf = dma_alloc_coherent(&dev->dev, |
984 |
++ dma->base_buf = dma_alloc_coherent(priv->ofdev_dev, |
985 |
+ dma->base_size, |
986 |
+ &dma->base_handle, |
987 |
+ GFP_KERNEL); |
988 |
+@@ -1117,8 +1118,10 @@ static int grcan_close(struct net_device *dev) |
989 |
+ |
990 |
+ priv->closing = true; |
991 |
+ if (priv->need_txbug_workaround) { |
992 |
++ spin_unlock_irqrestore(&priv->lock, flags); |
993 |
+ del_timer_sync(&priv->hang_timer); |
994 |
+ del_timer_sync(&priv->rr_timer); |
995 |
++ spin_lock_irqsave(&priv->lock, flags); |
996 |
+ } |
997 |
+ netif_stop_queue(dev); |
998 |
+ grcan_stop_hardware(dev); |
999 |
+@@ -1604,6 +1607,7 @@ static int grcan_setup_netdev(struct platform_device *ofdev, |
1000 |
+ memcpy(&priv->config, &grcan_module_config, |
1001 |
+ sizeof(struct grcan_device_config)); |
1002 |
+ priv->dev = dev; |
1003 |
++ priv->ofdev_dev = &ofdev->dev; |
1004 |
+ priv->regs = base; |
1005 |
+ priv->can.bittiming_const = &grcan_bittiming_const; |
1006 |
+ priv->can.do_set_bittiming = grcan_set_bittiming; |
1007 |
+diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |
1008 |
+index df4f77ad95c4a..91ddde4d647c6 100644 |
1009 |
+--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |
1010 |
++++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |
1011 |
+@@ -14297,10 +14297,6 @@ static int bnx2x_eeh_nic_unload(struct bnx2x *bp) |
1012 |
+ |
1013 |
+ /* Stop Tx */ |
1014 |
+ bnx2x_tx_disable(bp); |
1015 |
+- /* Delete all NAPI objects */ |
1016 |
+- bnx2x_del_all_napi(bp); |
1017 |
+- if (CNIC_LOADED(bp)) |
1018 |
+- bnx2x_del_all_napi_cnic(bp); |
1019 |
+ netdev_reset_tc(bp->dev); |
1020 |
+ |
1021 |
+ del_timer_sync(&bp->timer); |
1022 |
+@@ -14405,6 +14401,11 @@ static pci_ers_result_t bnx2x_io_slot_reset(struct pci_dev *pdev) |
1023 |
+ bnx2x_drain_tx_queues(bp); |
1024 |
+ bnx2x_send_unload_req(bp, UNLOAD_RECOVERY); |
1025 |
+ bnx2x_netif_stop(bp, 1); |
1026 |
++ bnx2x_del_all_napi(bp); |
1027 |
++ |
1028 |
++ if (CNIC_LOADED(bp)) |
1029 |
++ bnx2x_del_all_napi_cnic(bp); |
1030 |
++ |
1031 |
+ bnx2x_free_irq(bp); |
1032 |
+ |
1033 |
+ /* Report UNLOAD_DONE to MCP */ |
1034 |
+diff --git a/drivers/net/ethernet/broadcom/genet/bcmgenet.c b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
1035 |
+index d4be107ea4cdf..96ef2dd46c78c 100644 |
1036 |
+--- a/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
1037 |
++++ b/drivers/net/ethernet/broadcom/genet/bcmgenet.c |
1038 |
+@@ -1549,6 +1549,11 @@ static struct sk_buff *bcmgenet_put_tx_csum(struct net_device *dev, |
1039 |
+ return skb; |
1040 |
+ } |
1041 |
+ |
1042 |
++static void bcmgenet_hide_tsb(struct sk_buff *skb) |
1043 |
++{ |
1044 |
++ __skb_pull(skb, sizeof(struct status_64)); |
1045 |
++} |
1046 |
++ |
1047 |
+ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) |
1048 |
+ { |
1049 |
+ struct bcmgenet_priv *priv = netdev_priv(dev); |
1050 |
+@@ -1657,6 +1662,8 @@ static netdev_tx_t bcmgenet_xmit(struct sk_buff *skb, struct net_device *dev) |
1051 |
+ } |
1052 |
+ |
1053 |
+ GENET_CB(skb)->last_cb = tx_cb_ptr; |
1054 |
++ |
1055 |
++ bcmgenet_hide_tsb(skb); |
1056 |
+ skb_tx_timestamp(skb); |
1057 |
+ |
1058 |
+ /* Decrement total BD count and advance our write pointer */ |
1059 |
+diff --git a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |
1060 |
+index 997ca79ed892b..7e49188c3009d 100644 |
1061 |
+--- a/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |
1062 |
++++ b/drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c |
1063 |
+@@ -60,6 +60,13 @@ static int hclge_send_mbx_msg(struct hclge_vport *vport, u8 *msg, u16 msg_len, |
1064 |
+ enum hclge_cmd_status status; |
1065 |
+ struct hclge_desc desc; |
1066 |
+ |
1067 |
++ if (msg_len > HCLGE_MBX_MAX_MSG_SIZE) { |
1068 |
++ dev_err(&hdev->pdev->dev, |
1069 |
++ "msg data length(=%u) exceeds maximum(=%u)\n", |
1070 |
++ msg_len, HCLGE_MBX_MAX_MSG_SIZE); |
1071 |
++ return -EMSGSIZE; |
1072 |
++ } |
1073 |
++ |
1074 |
+ resp_pf_to_vf = (struct hclge_mbx_pf_to_vf_cmd *)desc.data; |
1075 |
+ |
1076 |
+ hclge_cmd_setup_basic_desc(&desc, HCLGEVF_OPC_MBX_PF_TO_VF, false); |
1077 |
+diff --git a/drivers/net/ethernet/smsc/smsc911x.c b/drivers/net/ethernet/smsc/smsc911x.c |
1078 |
+index ae80a223975db..f977fc59dc5ca 100644 |
1079 |
+--- a/drivers/net/ethernet/smsc/smsc911x.c |
1080 |
++++ b/drivers/net/ethernet/smsc/smsc911x.c |
1081 |
+@@ -2446,7 +2446,7 @@ static int smsc911x_drv_probe(struct platform_device *pdev) |
1082 |
+ if (irq == -EPROBE_DEFER) { |
1083 |
+ retval = -EPROBE_DEFER; |
1084 |
+ goto out_0; |
1085 |
+- } else if (irq <= 0) { |
1086 |
++ } else if (irq < 0) { |
1087 |
+ pr_warn("Could not allocate irq resource\n"); |
1088 |
+ retval = -ENODEV; |
1089 |
+ goto out_0; |
1090 |
+diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c |
1091 |
+index 0137cba2cb54b..5e66e73998274 100644 |
1092 |
+--- a/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c |
1093 |
++++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-sun8i.c |
1094 |
+@@ -873,6 +873,7 @@ static int sun8i_dwmac_register_mdio_mux(struct stmmac_priv *priv) |
1095 |
+ |
1096 |
+ ret = mdio_mux_init(priv->device, mdio_mux, mdio_mux_syscon_switch_fn, |
1097 |
+ &gmac->mux_handle, priv, priv->mii); |
1098 |
++ of_node_put(mdio_mux); |
1099 |
+ return ret; |
1100 |
+ } |
1101 |
+ |
1102 |
+diff --git a/drivers/net/ethernet/xilinx/xilinx_emaclite.c b/drivers/net/ethernet/xilinx/xilinx_emaclite.c |
1103 |
+index 23a4f9061072b..4e1504587895a 100644 |
1104 |
+--- a/drivers/net/ethernet/xilinx/xilinx_emaclite.c |
1105 |
++++ b/drivers/net/ethernet/xilinx/xilinx_emaclite.c |
1106 |
+@@ -827,10 +827,10 @@ static int xemaclite_mdio_write(struct mii_bus *bus, int phy_id, int reg, |
1107 |
+ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev) |
1108 |
+ { |
1109 |
+ struct mii_bus *bus; |
1110 |
+- int rc; |
1111 |
+ struct resource res; |
1112 |
+ struct device_node *np = of_get_parent(lp->phy_node); |
1113 |
+ struct device_node *npp; |
1114 |
++ int rc, ret; |
1115 |
+ |
1116 |
+ /* Don't register the MDIO bus if the phy_node or its parent node |
1117 |
+ * can't be found. |
1118 |
+@@ -840,8 +840,14 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev) |
1119 |
+ return -ENODEV; |
1120 |
+ } |
1121 |
+ npp = of_get_parent(np); |
1122 |
+- |
1123 |
+- of_address_to_resource(npp, 0, &res); |
1124 |
++ ret = of_address_to_resource(npp, 0, &res); |
1125 |
++ of_node_put(npp); |
1126 |
++ if (ret) { |
1127 |
++ dev_err(dev, "%s resource error!\n", |
1128 |
++ dev->of_node->full_name); |
1129 |
++ of_node_put(np); |
1130 |
++ return ret; |
1131 |
++ } |
1132 |
+ if (lp->ndev->mem_start != res.start) { |
1133 |
+ struct phy_device *phydev; |
1134 |
+ phydev = of_phy_find_device(lp->phy_node); |
1135 |
+@@ -850,6 +856,7 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev) |
1136 |
+ "MDIO of the phy is not registered yet\n"); |
1137 |
+ else |
1138 |
+ put_device(&phydev->mdio.dev); |
1139 |
++ of_node_put(np); |
1140 |
+ return 0; |
1141 |
+ } |
1142 |
+ |
1143 |
+@@ -862,6 +869,7 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev) |
1144 |
+ bus = mdiobus_alloc(); |
1145 |
+ if (!bus) { |
1146 |
+ dev_err(dev, "Failed to allocate mdiobus\n"); |
1147 |
++ of_node_put(np); |
1148 |
+ return -ENOMEM; |
1149 |
+ } |
1150 |
+ |
1151 |
+@@ -874,6 +882,7 @@ static int xemaclite_mdio_setup(struct net_local *lp, struct device *dev) |
1152 |
+ bus->parent = dev; |
1153 |
+ |
1154 |
+ rc = of_mdiobus_register(bus, np); |
1155 |
++ of_node_put(np); |
1156 |
+ if (rc) { |
1157 |
+ dev_err(dev, "Failed to register mdio bus.\n"); |
1158 |
+ goto err_register; |
1159 |
+diff --git a/drivers/net/hippi/rrunner.c b/drivers/net/hippi/rrunner.c |
1160 |
+index 2a8c33abb363a..a24c55a6c79a1 100644 |
1161 |
+--- a/drivers/net/hippi/rrunner.c |
1162 |
++++ b/drivers/net/hippi/rrunner.c |
1163 |
+@@ -1352,7 +1352,9 @@ static int rr_close(struct net_device *dev) |
1164 |
+ |
1165 |
+ rrpriv->fw_running = 0; |
1166 |
+ |
1167 |
++ spin_unlock_irqrestore(&rrpriv->lock, flags); |
1168 |
+ del_timer_sync(&rrpriv->timer); |
1169 |
++ spin_lock_irqsave(&rrpriv->lock, flags); |
1170 |
+ |
1171 |
+ writel(0, ®s->TxPi); |
1172 |
+ writel(0, ®s->IpRxPi); |
1173 |
+diff --git a/drivers/nfc/nfcmrvl/main.c b/drivers/nfc/nfcmrvl/main.c |
1174 |
+index 529be35ac1782..54d228acc0f5d 100644 |
1175 |
+--- a/drivers/nfc/nfcmrvl/main.c |
1176 |
++++ b/drivers/nfc/nfcmrvl/main.c |
1177 |
+@@ -194,6 +194,7 @@ void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv) |
1178 |
+ { |
1179 |
+ struct nci_dev *ndev = priv->ndev; |
1180 |
+ |
1181 |
++ nci_unregister_device(ndev); |
1182 |
+ if (priv->ndev->nfc_dev->fw_download_in_progress) |
1183 |
+ nfcmrvl_fw_dnld_abort(priv); |
1184 |
+ |
1185 |
+@@ -202,7 +203,6 @@ void nfcmrvl_nci_unregister_dev(struct nfcmrvl_private *priv) |
1186 |
+ if (gpio_is_valid(priv->config.reset_n_io)) |
1187 |
+ gpio_free(priv->config.reset_n_io); |
1188 |
+ |
1189 |
+- nci_unregister_device(ndev); |
1190 |
+ nci_free_device(ndev); |
1191 |
+ kfree(priv); |
1192 |
+ } |
1193 |
+diff --git a/drivers/pci/controller/pci-aardvark.c b/drivers/pci/controller/pci-aardvark.c |
1194 |
+index db778a25bae36..a5bc529e9e826 100644 |
1195 |
+--- a/drivers/pci/controller/pci-aardvark.c |
1196 |
++++ b/drivers/pci/controller/pci-aardvark.c |
1197 |
+@@ -103,6 +103,7 @@ |
1198 |
+ #define PCIE_MSI_ADDR_HIGH_REG (CONTROL_BASE_ADDR + 0x54) |
1199 |
+ #define PCIE_MSI_STATUS_REG (CONTROL_BASE_ADDR + 0x58) |
1200 |
+ #define PCIE_MSI_MASK_REG (CONTROL_BASE_ADDR + 0x5C) |
1201 |
++#define PCIE_MSI_ALL_MASK GENMASK(31, 0) |
1202 |
+ #define PCIE_MSI_PAYLOAD_REG (CONTROL_BASE_ADDR + 0x9C) |
1203 |
+ #define PCIE_MSI_DATA_MASK GENMASK(15, 0) |
1204 |
+ |
1205 |
+@@ -489,6 +490,7 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie) |
1206 |
+ advk_writel(pcie, reg, PCIE_CORE_CTRL2_REG); |
1207 |
+ |
1208 |
+ /* Clear all interrupts */ |
1209 |
++ advk_writel(pcie, PCIE_MSI_ALL_MASK, PCIE_MSI_STATUS_REG); |
1210 |
+ advk_writel(pcie, PCIE_ISR0_ALL_MASK, PCIE_ISR0_REG); |
1211 |
+ advk_writel(pcie, PCIE_ISR1_ALL_MASK, PCIE_ISR1_REG); |
1212 |
+ advk_writel(pcie, PCIE_IRQ_ALL_MASK, HOST_CTRL_INT_STATUS_REG); |
1213 |
+@@ -501,7 +503,7 @@ static void advk_pcie_setup_hw(struct advk_pcie *pcie) |
1214 |
+ advk_writel(pcie, PCIE_ISR1_ALL_MASK, PCIE_ISR1_MASK_REG); |
1215 |
+ |
1216 |
+ /* Unmask all MSI's */ |
1217 |
+- advk_writel(pcie, 0, PCIE_MSI_MASK_REG); |
1218 |
++ advk_writel(pcie, ~(u32)PCIE_MSI_ALL_MASK, PCIE_MSI_MASK_REG); |
1219 |
+ |
1220 |
+ /* Enable summary interrupt for GIC SPI source */ |
1221 |
+ reg = PCIE_IRQ_ALL_MASK & (~PCIE_IRQ_ENABLE_INTS_MASK); |
1222 |
+@@ -1033,23 +1035,19 @@ static void advk_pcie_remove_irq_domain(struct advk_pcie *pcie) |
1223 |
+ static void advk_pcie_handle_msi(struct advk_pcie *pcie) |
1224 |
+ { |
1225 |
+ u32 msi_val, msi_mask, msi_status, msi_idx; |
1226 |
+- u16 msi_data; |
1227 |
++ int virq; |
1228 |
+ |
1229 |
+ msi_mask = advk_readl(pcie, PCIE_MSI_MASK_REG); |
1230 |
+ msi_val = advk_readl(pcie, PCIE_MSI_STATUS_REG); |
1231 |
+- msi_status = msi_val & ~msi_mask; |
1232 |
++ msi_status = msi_val & ((~msi_mask) & PCIE_MSI_ALL_MASK); |
1233 |
+ |
1234 |
+ for (msi_idx = 0; msi_idx < MSI_IRQ_NUM; msi_idx++) { |
1235 |
+ if (!(BIT(msi_idx) & msi_status)) |
1236 |
+ continue; |
1237 |
+ |
1238 |
+- /* |
1239 |
+- * msi_idx contains bits [4:0] of the msi_data and msi_data |
1240 |
+- * contains 16bit MSI interrupt number |
1241 |
+- */ |
1242 |
+ advk_writel(pcie, BIT(msi_idx), PCIE_MSI_STATUS_REG); |
1243 |
+- msi_data = advk_readl(pcie, PCIE_MSI_PAYLOAD_REG) & PCIE_MSI_DATA_MASK; |
1244 |
+- generic_handle_irq(msi_data); |
1245 |
++ virq = irq_find_mapping(pcie->msi_inner_domain, msi_idx); |
1246 |
++ generic_handle_irq(virq); |
1247 |
+ } |
1248 |
+ |
1249 |
+ advk_writel(pcie, PCIE_ISR0_MSI_INT_PENDING, |
1250 |
+diff --git a/drivers/phy/samsung/phy-exynos5250-sata.c b/drivers/phy/samsung/phy-exynos5250-sata.c |
1251 |
+index 60e13afcd9b84..2c39d2fd3cd80 100644 |
1252 |
+--- a/drivers/phy/samsung/phy-exynos5250-sata.c |
1253 |
++++ b/drivers/phy/samsung/phy-exynos5250-sata.c |
1254 |
+@@ -193,6 +193,7 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) |
1255 |
+ return -EINVAL; |
1256 |
+ |
1257 |
+ sata_phy->client = of_find_i2c_device_by_node(node); |
1258 |
++ of_node_put(node); |
1259 |
+ if (!sata_phy->client) |
1260 |
+ return -EPROBE_DEFER; |
1261 |
+ |
1262 |
+@@ -201,20 +202,21 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) |
1263 |
+ sata_phy->phyclk = devm_clk_get(dev, "sata_phyctrl"); |
1264 |
+ if (IS_ERR(sata_phy->phyclk)) { |
1265 |
+ dev_err(dev, "failed to get clk for PHY\n"); |
1266 |
+- return PTR_ERR(sata_phy->phyclk); |
1267 |
++ ret = PTR_ERR(sata_phy->phyclk); |
1268 |
++ goto put_dev; |
1269 |
+ } |
1270 |
+ |
1271 |
+ ret = clk_prepare_enable(sata_phy->phyclk); |
1272 |
+ if (ret < 0) { |
1273 |
+ dev_err(dev, "failed to enable source clk\n"); |
1274 |
+- return ret; |
1275 |
++ goto put_dev; |
1276 |
+ } |
1277 |
+ |
1278 |
+ sata_phy->phy = devm_phy_create(dev, NULL, &exynos_sata_phy_ops); |
1279 |
+ if (IS_ERR(sata_phy->phy)) { |
1280 |
+- clk_disable_unprepare(sata_phy->phyclk); |
1281 |
+ dev_err(dev, "failed to create PHY\n"); |
1282 |
+- return PTR_ERR(sata_phy->phy); |
1283 |
++ ret = PTR_ERR(sata_phy->phy); |
1284 |
++ goto clk_disable; |
1285 |
+ } |
1286 |
+ |
1287 |
+ phy_set_drvdata(sata_phy->phy, sata_phy); |
1288 |
+@@ -222,11 +224,18 @@ static int exynos_sata_phy_probe(struct platform_device *pdev) |
1289 |
+ phy_provider = devm_of_phy_provider_register(dev, |
1290 |
+ of_phy_simple_xlate); |
1291 |
+ if (IS_ERR(phy_provider)) { |
1292 |
+- clk_disable_unprepare(sata_phy->phyclk); |
1293 |
+- return PTR_ERR(phy_provider); |
1294 |
++ ret = PTR_ERR(phy_provider); |
1295 |
++ goto clk_disable; |
1296 |
+ } |
1297 |
+ |
1298 |
+ return 0; |
1299 |
++ |
1300 |
++clk_disable: |
1301 |
++ clk_disable_unprepare(sata_phy->phyclk); |
1302 |
++put_dev: |
1303 |
++ put_device(&sata_phy->client->dev); |
1304 |
++ |
1305 |
++ return ret; |
1306 |
+ } |
1307 |
+ |
1308 |
+ static const struct of_device_id exynos_sata_phy_of_match[] = { |
1309 |
+diff --git a/drivers/pinctrl/pinctrl-pistachio.c b/drivers/pinctrl/pinctrl-pistachio.c |
1310 |
+index 0d7d379e9bb80..fb7340ad15b3b 100644 |
1311 |
+--- a/drivers/pinctrl/pinctrl-pistachio.c |
1312 |
++++ b/drivers/pinctrl/pinctrl-pistachio.c |
1313 |
+@@ -1374,10 +1374,10 @@ static int pistachio_gpio_register(struct pistachio_pinctrl *pctl) |
1314 |
+ } |
1315 |
+ |
1316 |
+ irq = irq_of_parse_and_map(child, 0); |
1317 |
+- if (irq < 0) { |
1318 |
+- dev_err(pctl->dev, "No IRQ for bank %u: %d\n", i, irq); |
1319 |
++ if (!irq) { |
1320 |
++ dev_err(pctl->dev, "No IRQ for bank %u\n", i); |
1321 |
+ of_node_put(child); |
1322 |
+- ret = irq; |
1323 |
++ ret = -EINVAL; |
1324 |
+ goto err; |
1325 |
+ } |
1326 |
+ |
1327 |
+diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c |
1328 |
+index 4d581140b7a47..5d2bb4d95186f 100644 |
1329 |
+--- a/drivers/tty/n_gsm.c |
1330 |
++++ b/drivers/tty/n_gsm.c |
1331 |
+@@ -72,6 +72,8 @@ module_param(debug, int, 0600); |
1332 |
+ */ |
1333 |
+ #define MAX_MRU 1500 |
1334 |
+ #define MAX_MTU 1500 |
1335 |
++/* SOF, ADDR, CTRL, LEN1, LEN2, ..., FCS, EOF */ |
1336 |
++#define PROT_OVERHEAD 7 |
1337 |
+ #define GSM_NET_TX_TIMEOUT (HZ*10) |
1338 |
+ |
1339 |
+ /** |
1340 |
+@@ -823,7 +825,7 @@ static int gsm_dlci_data_output(struct gsm_mux *gsm, struct gsm_dlci *dlci) |
1341 |
+ break; |
1342 |
+ case 2: /* Unstructed with modem bits. |
1343 |
+ Always one byte as we never send inline break data */ |
1344 |
+- *dp++ = gsm_encode_modem(dlci); |
1345 |
++ *dp++ = (gsm_encode_modem(dlci) << 1) | EA; |
1346 |
+ break; |
1347 |
+ } |
1348 |
+ WARN_ON(kfifo_out_locked(dlci->fifo, dp , len, &dlci->lock) != len); |
1349 |
+@@ -1300,11 +1302,12 @@ static void gsm_control_response(struct gsm_mux *gsm, unsigned int command, |
1350 |
+ |
1351 |
+ static void gsm_control_transmit(struct gsm_mux *gsm, struct gsm_control *ctrl) |
1352 |
+ { |
1353 |
+- struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 1, gsm->ftype); |
1354 |
++ struct gsm_msg *msg = gsm_data_alloc(gsm, 0, ctrl->len + 2, gsm->ftype); |
1355 |
+ if (msg == NULL) |
1356 |
+ return; |
1357 |
+- msg->data[0] = (ctrl->cmd << 1) | 2 | EA; /* command */ |
1358 |
+- memcpy(msg->data + 1, ctrl->data, ctrl->len); |
1359 |
++ msg->data[0] = (ctrl->cmd << 1) | CR | EA; /* command */ |
1360 |
++ msg->data[1] = (ctrl->len << 1) | EA; |
1361 |
++ memcpy(msg->data + 2, ctrl->data, ctrl->len); |
1362 |
+ gsm_data_queue(gsm->dlci[0], msg); |
1363 |
+ } |
1364 |
+ |
1365 |
+@@ -1327,7 +1330,6 @@ static void gsm_control_retransmit(struct timer_list *t) |
1366 |
+ spin_lock_irqsave(&gsm->control_lock, flags); |
1367 |
+ ctrl = gsm->pending_cmd; |
1368 |
+ if (ctrl) { |
1369 |
+- gsm->cretries--; |
1370 |
+ if (gsm->cretries == 0) { |
1371 |
+ gsm->pending_cmd = NULL; |
1372 |
+ ctrl->error = -ETIMEDOUT; |
1373 |
+@@ -1336,6 +1338,7 @@ static void gsm_control_retransmit(struct timer_list *t) |
1374 |
+ wake_up(&gsm->event); |
1375 |
+ return; |
1376 |
+ } |
1377 |
++ gsm->cretries--; |
1378 |
+ gsm_control_transmit(gsm, ctrl); |
1379 |
+ mod_timer(&gsm->t2_timer, jiffies + gsm->t2 * HZ / 100); |
1380 |
+ } |
1381 |
+@@ -1376,7 +1379,7 @@ retry: |
1382 |
+ |
1383 |
+ /* If DLCI0 is in ADM mode skip retries, it won't respond */ |
1384 |
+ if (gsm->dlci[0]->mode == DLCI_MODE_ADM) |
1385 |
+- gsm->cretries = 1; |
1386 |
++ gsm->cretries = 0; |
1387 |
+ else |
1388 |
+ gsm->cretries = gsm->n2; |
1389 |
+ |
1390 |
+@@ -1808,7 +1811,6 @@ static void gsm_queue(struct gsm_mux *gsm) |
1391 |
+ gsm_response(gsm, address, UA); |
1392 |
+ gsm_dlci_close(dlci); |
1393 |
+ break; |
1394 |
+- case UA: |
1395 |
+ case UA|PF: |
1396 |
+ if (cr == 0 || dlci == NULL) |
1397 |
+ break; |
1398 |
+@@ -1959,7 +1961,8 @@ static void gsm1_receive(struct gsm_mux *gsm, unsigned char c) |
1399 |
+ } |
1400 |
+ /* Any partial frame was a runt so go back to start */ |
1401 |
+ if (gsm->state != GSM_START) { |
1402 |
+- gsm->malformed++; |
1403 |
++ if (gsm->state != GSM_SEARCH) |
1404 |
++ gsm->malformed++; |
1405 |
+ gsm->state = GSM_START; |
1406 |
+ } |
1407 |
+ /* A SOF in GSM_START means we are still reading idling or |
1408 |
+@@ -2096,6 +2099,7 @@ static void gsm_cleanup_mux(struct gsm_mux *gsm) |
1409 |
+ gsm_dlci_release(gsm->dlci[i]); |
1410 |
+ mutex_unlock(&gsm->mutex); |
1411 |
+ /* Now wipe the queues */ |
1412 |
++ tty_ldisc_flush(gsm->tty); |
1413 |
+ list_for_each_entry_safe(txq, ntxq, &gsm->tx_list, list) |
1414 |
+ kfree(txq); |
1415 |
+ INIT_LIST_HEAD(&gsm->tx_list); |
1416 |
+@@ -2196,7 +2200,7 @@ static struct gsm_mux *gsm_alloc_mux(void) |
1417 |
+ kfree(gsm); |
1418 |
+ return NULL; |
1419 |
+ } |
1420 |
+- gsm->txframe = kmalloc(2 * MAX_MRU + 2, GFP_KERNEL); |
1421 |
++ gsm->txframe = kmalloc(2 * (MAX_MTU + PROT_OVERHEAD - 1), GFP_KERNEL); |
1422 |
+ if (gsm->txframe == NULL) { |
1423 |
+ kfree(gsm->buf); |
1424 |
+ kfree(gsm); |
1425 |
+@@ -2513,7 +2517,7 @@ static int gsmld_config(struct tty_struct *tty, struct gsm_mux *gsm, |
1426 |
+ /* Check the MRU/MTU range looks sane */ |
1427 |
+ if (c->mru > MAX_MRU || c->mtu > MAX_MTU || c->mru < 8 || c->mtu < 8) |
1428 |
+ return -EINVAL; |
1429 |
+- if (c->n2 < 3) |
1430 |
++ if (c->n2 > 255) |
1431 |
+ return -EINVAL; |
1432 |
+ if (c->encapsulation > 1) /* Basic, advanced, no I */ |
1433 |
+ return -EINVAL; |
1434 |
+@@ -2856,19 +2860,17 @@ static struct tty_ldisc_ops tty_ldisc_packet = { |
1435 |
+ |
1436 |
+ static int gsmtty_modem_update(struct gsm_dlci *dlci, u8 brk) |
1437 |
+ { |
1438 |
+- u8 modembits[5]; |
1439 |
++ u8 modembits[3]; |
1440 |
+ struct gsm_control *ctrl; |
1441 |
+ int len = 2; |
1442 |
+ |
1443 |
+- if (brk) |
1444 |
++ modembits[0] = (dlci->addr << 2) | 2 | EA; /* DLCI, Valid, EA */ |
1445 |
++ modembits[1] = (gsm_encode_modem(dlci) << 1) | EA; |
1446 |
++ if (brk) { |
1447 |
++ modembits[2] = (brk << 4) | 2 | EA; /* Length, Break, EA */ |
1448 |
+ len++; |
1449 |
+- |
1450 |
+- modembits[0] = len << 1 | EA; /* Data bytes */ |
1451 |
+- modembits[1] = dlci->addr << 2 | 3; /* DLCI, EA, 1 */ |
1452 |
+- modembits[2] = gsm_encode_modem(dlci) << 1 | EA; |
1453 |
+- if (brk) |
1454 |
+- modembits[3] = brk << 4 | 2 | EA; /* Valid, EA */ |
1455 |
+- ctrl = gsm_control_send(dlci->gsm, CMD_MSC, modembits, len + 1); |
1456 |
++ } |
1457 |
++ ctrl = gsm_control_send(dlci->gsm, CMD_MSC, modembits, len); |
1458 |
+ if (ctrl == NULL) |
1459 |
+ return -ENOMEM; |
1460 |
+ return gsm_control_wait(dlci->gsm, ctrl); |
1461 |
+diff --git a/drivers/tty/serial/8250/8250_pci.c b/drivers/tty/serial/8250/8250_pci.c |
1462 |
+index 173885837e77f..fd9dd800e1a6a 100644 |
1463 |
+--- a/drivers/tty/serial/8250/8250_pci.c |
1464 |
++++ b/drivers/tty/serial/8250/8250_pci.c |
1465 |
+@@ -2656,7 +2656,7 @@ enum pci_board_num_t { |
1466 |
+ pbn_panacom2, |
1467 |
+ pbn_panacom4, |
1468 |
+ pbn_plx_romulus, |
1469 |
+- pbn_endrun_2_4000000, |
1470 |
++ pbn_endrun_2_3906250, |
1471 |
+ pbn_oxsemi, |
1472 |
+ pbn_oxsemi_1_4000000, |
1473 |
+ pbn_oxsemi_2_4000000, |
1474 |
+@@ -3172,10 +3172,10 @@ static struct pciserial_board pci_boards[] = { |
1475 |
+ * signal now many ports are available |
1476 |
+ * 2 port 952 Uart support |
1477 |
+ */ |
1478 |
+- [pbn_endrun_2_4000000] = { |
1479 |
++ [pbn_endrun_2_3906250] = { |
1480 |
+ .flags = FL_BASE0, |
1481 |
+ .num_ports = 2, |
1482 |
+- .base_baud = 4000000, |
1483 |
++ .base_baud = 3906250, |
1484 |
+ .uart_offset = 0x200, |
1485 |
+ .first_offset = 0x1000, |
1486 |
+ }, |
1487 |
+@@ -4028,7 +4028,7 @@ static const struct pci_device_id serial_pci_tbl[] = { |
1488 |
+ */ |
1489 |
+ { PCI_VENDOR_ID_ENDRUN, PCI_DEVICE_ID_ENDRUN_1588, |
1490 |
+ PCI_ANY_ID, PCI_ANY_ID, 0, 0, |
1491 |
+- pbn_endrun_2_4000000 }, |
1492 |
++ pbn_endrun_2_3906250 }, |
1493 |
+ /* |
1494 |
+ * Quatech cards. These actually have configurable clocks but for |
1495 |
+ * now we just use the default. |
1496 |
+diff --git a/drivers/tty/serial/8250/8250_port.c b/drivers/tty/serial/8250/8250_port.c |
1497 |
+index 5ec50ccfbec95..34687c354f5e9 100644 |
1498 |
+--- a/drivers/tty/serial/8250/8250_port.c |
1499 |
++++ b/drivers/tty/serial/8250/8250_port.c |
1500 |
+@@ -3273,7 +3273,7 @@ static void serial8250_console_restore(struct uart_8250_port *up) |
1501 |
+ |
1502 |
+ serial8250_set_divisor(port, baud, quot, frac); |
1503 |
+ serial_port_out(port, UART_LCR, up->lcr); |
1504 |
+- serial8250_out_MCR(up, UART_MCR_DTR | UART_MCR_RTS); |
1505 |
++ serial8250_out_MCR(up, up->mcr | UART_MCR_DTR | UART_MCR_RTS); |
1506 |
+ } |
1507 |
+ |
1508 |
+ /* |
1509 |
+diff --git a/drivers/tty/serial/imx.c b/drivers/tty/serial/imx.c |
1510 |
+index 7a6e26b12bf64..aeda1fe71eeba 100644 |
1511 |
+--- a/drivers/tty/serial/imx.c |
1512 |
++++ b/drivers/tty/serial/imx.c |
1513 |
+@@ -1369,7 +1369,7 @@ static int imx_uart_startup(struct uart_port *port) |
1514 |
+ imx_uart_writel(sport, ucr1, UCR1); |
1515 |
+ |
1516 |
+ ucr4 = imx_uart_readl(sport, UCR4) & ~UCR4_OREN; |
1517 |
+- if (!sport->dma_is_enabled) |
1518 |
++ if (!dma_is_inited) |
1519 |
+ ucr4 |= UCR4_OREN; |
1520 |
+ imx_uart_writel(sport, ucr4, UCR4); |
1521 |
+ |
1522 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
1523 |
+index a118c44c70e1e..d5f233fa6f3b4 100644 |
1524 |
+--- a/drivers/usb/core/quirks.c |
1525 |
++++ b/drivers/usb/core/quirks.c |
1526 |
+@@ -404,6 +404,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1527 |
+ { USB_DEVICE(0x0b05, 0x17e0), .driver_info = |
1528 |
+ USB_QUIRK_IGNORE_REMOTE_WAKEUP }, |
1529 |
+ |
1530 |
++ /* Realtek Semiconductor Corp. Mass Storage Device (Multicard Reader)*/ |
1531 |
++ { USB_DEVICE(0x0bda, 0x0151), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, |
1532 |
++ |
1533 |
+ /* Realtek hub in Dell WD19 (Type-C) */ |
1534 |
+ { USB_DEVICE(0x0bda, 0x0487), .driver_info = USB_QUIRK_NO_LPM }, |
1535 |
+ { USB_DEVICE(0x0bda, 0x5487), .driver_info = USB_QUIRK_RESET_RESUME }, |
1536 |
+@@ -508,6 +511,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1537 |
+ /* DJI CineSSD */ |
1538 |
+ { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM }, |
1539 |
+ |
1540 |
++ /* VCOM device */ |
1541 |
++ { USB_DEVICE(0x4296, 0x7570), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS }, |
1542 |
++ |
1543 |
+ /* INTEL VALUE SSD */ |
1544 |
+ { USB_DEVICE(0x8086, 0xf1a5), .driver_info = USB_QUIRK_RESET_RESUME }, |
1545 |
+ |
1546 |
+diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c |
1547 |
+index 87e38a7534581..984faecdd7ecb 100644 |
1548 |
+--- a/drivers/usb/dwc3/core.c |
1549 |
++++ b/drivers/usb/dwc3/core.c |
1550 |
+@@ -1213,10 +1213,10 @@ static void dwc3_get_properties(struct dwc3 *dwc) |
1551 |
+ u8 lpm_nyet_threshold; |
1552 |
+ u8 tx_de_emphasis; |
1553 |
+ u8 hird_threshold; |
1554 |
+- u8 rx_thr_num_pkt_prd; |
1555 |
+- u8 rx_max_burst_prd; |
1556 |
+- u8 tx_thr_num_pkt_prd; |
1557 |
+- u8 tx_max_burst_prd; |
1558 |
++ u8 rx_thr_num_pkt_prd = 0; |
1559 |
++ u8 rx_max_burst_prd = 0; |
1560 |
++ u8 tx_thr_num_pkt_prd = 0; |
1561 |
++ u8 tx_max_burst_prd = 0; |
1562 |
+ |
1563 |
+ /* default to highest possible threshold */ |
1564 |
+ lpm_nyet_threshold = 0xf; |
1565 |
+diff --git a/drivers/usb/dwc3/gadget.c b/drivers/usb/dwc3/gadget.c |
1566 |
+index 8620ac8e33296..8be95ca95ef97 100644 |
1567 |
+--- a/drivers/usb/dwc3/gadget.c |
1568 |
++++ b/drivers/usb/dwc3/gadget.c |
1569 |
+@@ -2415,6 +2415,7 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep, |
1570 |
+ const struct dwc3_event_depevt *event, |
1571 |
+ struct dwc3_request *req, int status) |
1572 |
+ { |
1573 |
++ int request_status; |
1574 |
+ int ret; |
1575 |
+ |
1576 |
+ if (req->request.num_mapped_sgs) |
1577 |
+@@ -2444,7 +2445,35 @@ static int dwc3_gadget_ep_cleanup_completed_request(struct dwc3_ep *dep, |
1578 |
+ req->needs_extra_trb = false; |
1579 |
+ } |
1580 |
+ |
1581 |
+- dwc3_gadget_giveback(dep, req, status); |
1582 |
++ /* |
1583 |
++ * The event status only reflects the status of the TRB with IOC set. |
1584 |
++ * For the requests that don't set interrupt on completion, the driver |
1585 |
++ * needs to check and return the status of the completed TRBs associated |
1586 |
++ * with the request. Use the status of the last TRB of the request. |
1587 |
++ */ |
1588 |
++ if (req->request.no_interrupt) { |
1589 |
++ struct dwc3_trb *trb; |
1590 |
++ |
1591 |
++ trb = dwc3_ep_prev_trb(dep, dep->trb_dequeue); |
1592 |
++ switch (DWC3_TRB_SIZE_TRBSTS(trb->size)) { |
1593 |
++ case DWC3_TRBSTS_MISSED_ISOC: |
1594 |
++ /* Isoc endpoint only */ |
1595 |
++ request_status = -EXDEV; |
1596 |
++ break; |
1597 |
++ case DWC3_TRB_STS_XFER_IN_PROG: |
1598 |
++ /* Applicable when End Transfer with ForceRM=0 */ |
1599 |
++ case DWC3_TRBSTS_SETUP_PENDING: |
1600 |
++ /* Control endpoint only */ |
1601 |
++ case DWC3_TRBSTS_OK: |
1602 |
++ default: |
1603 |
++ request_status = 0; |
1604 |
++ break; |
1605 |
++ } |
1606 |
++ } else { |
1607 |
++ request_status = status; |
1608 |
++ } |
1609 |
++ |
1610 |
++ dwc3_gadget_giveback(dep, req, request_status); |
1611 |
+ |
1612 |
+ out: |
1613 |
+ return ret; |
1614 |
+diff --git a/drivers/usb/gadget/configfs.c b/drivers/usb/gadget/configfs.c |
1615 |
+index 3d4710cc34bc1..2350e97a1662c 100644 |
1616 |
+--- a/drivers/usb/gadget/configfs.c |
1617 |
++++ b/drivers/usb/gadget/configfs.c |
1618 |
+@@ -1412,6 +1412,8 @@ static void configfs_composite_unbind(struct usb_gadget *gadget) |
1619 |
+ usb_ep_autoconfig_reset(cdev->gadget); |
1620 |
+ spin_lock_irqsave(&gi->spinlock, flags); |
1621 |
+ cdev->gadget = NULL; |
1622 |
++ cdev->deactivations = 0; |
1623 |
++ gadget->deactivated = false; |
1624 |
+ set_gadget_data(gadget, NULL); |
1625 |
+ spin_unlock_irqrestore(&gi->spinlock, flags); |
1626 |
+ } |
1627 |
+diff --git a/drivers/usb/gadget/function/uvc_queue.c b/drivers/usb/gadget/function/uvc_queue.c |
1628 |
+index 9e33d5206d54a..956341528ecaa 100644 |
1629 |
+--- a/drivers/usb/gadget/function/uvc_queue.c |
1630 |
++++ b/drivers/usb/gadget/function/uvc_queue.c |
1631 |
+@@ -242,6 +242,8 @@ void uvcg_queue_cancel(struct uvc_video_queue *queue, int disconnect) |
1632 |
+ buf->state = UVC_BUF_STATE_ERROR; |
1633 |
+ vb2_buffer_done(&buf->buf.vb2_buf, VB2_BUF_STATE_ERROR); |
1634 |
+ } |
1635 |
++ queue->buf_used = 0; |
1636 |
++ |
1637 |
+ /* This must be protected by the irqlock spinlock to avoid race |
1638 |
+ * conditions between uvc_queue_buffer and the disconnection event that |
1639 |
+ * could result in an interruptible wait in uvc_dequeue_buffer. Do not |
1640 |
+diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c |
1641 |
+index f5bd91752f2d2..e18b675fb7afe 100644 |
1642 |
+--- a/drivers/usb/host/xhci-ring.c |
1643 |
++++ b/drivers/usb/host/xhci-ring.c |
1644 |
+@@ -2848,6 +2848,8 @@ irqreturn_t xhci_irq(struct usb_hcd *hcd) |
1645 |
+ if (event_loop++ < TRBS_PER_SEGMENT / 2) |
1646 |
+ continue; |
1647 |
+ xhci_update_erst_dequeue(xhci, event_ring_deq); |
1648 |
++ event_ring_deq = xhci->event_ring->dequeue; |
1649 |
++ |
1650 |
+ event_loop = 0; |
1651 |
+ } |
1652 |
+ |
1653 |
+diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c |
1654 |
+index ab255144e5a70..a9e72fee87a77 100644 |
1655 |
+--- a/drivers/usb/host/xhci.c |
1656 |
++++ b/drivers/usb/host/xhci.c |
1657 |
+@@ -778,6 +778,17 @@ void xhci_shutdown(struct usb_hcd *hcd) |
1658 |
+ if (xhci->quirks & XHCI_SPURIOUS_REBOOT) |
1659 |
+ usb_disable_xhci_ports(to_pci_dev(hcd->self.sysdev)); |
1660 |
+ |
1661 |
++ /* Don't poll the roothubs after shutdown. */ |
1662 |
++ xhci_dbg(xhci, "%s: stopping usb%d port polling.\n", |
1663 |
++ __func__, hcd->self.busnum); |
1664 |
++ clear_bit(HCD_FLAG_POLL_RH, &hcd->flags); |
1665 |
++ del_timer_sync(&hcd->rh_timer); |
1666 |
++ |
1667 |
++ if (xhci->shared_hcd) { |
1668 |
++ clear_bit(HCD_FLAG_POLL_RH, &xhci->shared_hcd->flags); |
1669 |
++ del_timer_sync(&xhci->shared_hcd->rh_timer); |
1670 |
++ } |
1671 |
++ |
1672 |
+ spin_lock_irq(&xhci->lock); |
1673 |
+ xhci_halt(xhci); |
1674 |
+ /* Workaround for spurious wakeups at shutdown with HSW */ |
1675 |
+diff --git a/drivers/usb/misc/uss720.c b/drivers/usb/misc/uss720.c |
1676 |
+index 748139d262633..0be8efcda15d5 100644 |
1677 |
+--- a/drivers/usb/misc/uss720.c |
1678 |
++++ b/drivers/usb/misc/uss720.c |
1679 |
+@@ -71,6 +71,7 @@ static void destroy_priv(struct kref *kref) |
1680 |
+ |
1681 |
+ dev_dbg(&priv->usbdev->dev, "destroying priv datastructure\n"); |
1682 |
+ usb_put_dev(priv->usbdev); |
1683 |
++ priv->usbdev = NULL; |
1684 |
+ kfree(priv); |
1685 |
+ } |
1686 |
+ |
1687 |
+@@ -736,7 +737,6 @@ static int uss720_probe(struct usb_interface *intf, |
1688 |
+ parport_announce_port(pp); |
1689 |
+ |
1690 |
+ usb_set_intfdata(intf, pp); |
1691 |
+- usb_put_dev(usbdev); |
1692 |
+ return 0; |
1693 |
+ |
1694 |
+ probe_abort: |
1695 |
+@@ -754,7 +754,6 @@ static void uss720_disconnect(struct usb_interface *intf) |
1696 |
+ usb_set_intfdata(intf, NULL); |
1697 |
+ if (pp) { |
1698 |
+ priv = pp->private_data; |
1699 |
+- priv->usbdev = NULL; |
1700 |
+ priv->pp = NULL; |
1701 |
+ dev_dbg(&intf->dev, "parport_remove_port\n"); |
1702 |
+ parport_remove_port(pp); |
1703 |
+diff --git a/drivers/usb/mtu3/mtu3_dr.c b/drivers/usb/mtu3/mtu3_dr.c |
1704 |
+index ac60e9c8564e2..edca5d748f41a 100644 |
1705 |
+--- a/drivers/usb/mtu3/mtu3_dr.c |
1706 |
++++ b/drivers/usb/mtu3/mtu3_dr.c |
1707 |
+@@ -30,10 +30,8 @@ enum mtu3_vbus_id_state { |
1708 |
+ |
1709 |
+ static void toggle_opstate(struct ssusb_mtk *ssusb) |
1710 |
+ { |
1711 |
+- if (!ssusb->otg_switch.is_u3_drd) { |
1712 |
+- mtu3_setbits(ssusb->mac_base, U3D_DEVICE_CONTROL, DC_SESSION); |
1713 |
+- mtu3_setbits(ssusb->mac_base, U3D_POWER_MANAGEMENT, SOFT_CONN); |
1714 |
+- } |
1715 |
++ mtu3_setbits(ssusb->mac_base, U3D_DEVICE_CONTROL, DC_SESSION); |
1716 |
++ mtu3_setbits(ssusb->mac_base, U3D_POWER_MANAGEMENT, SOFT_CONN); |
1717 |
+ } |
1718 |
+ |
1719 |
+ /* only port0 supports dual-role mode */ |
1720 |
+diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c |
1721 |
+index 452c508397b7b..95a5c73f3f787 100644 |
1722 |
+--- a/drivers/usb/serial/cp210x.c |
1723 |
++++ b/drivers/usb/serial/cp210x.c |
1724 |
+@@ -195,6 +195,8 @@ static const struct usb_device_id id_table[] = { |
1725 |
+ { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */ |
1726 |
+ { USB_DEVICE(0x17A8, 0x0001) }, /* Kamstrup Optical Eye/3-wire */ |
1727 |
+ { USB_DEVICE(0x17A8, 0x0005) }, /* Kamstrup M-Bus Master MultiPort 250D */ |
1728 |
++ { USB_DEVICE(0x17A8, 0x0101) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Int Ant) */ |
1729 |
++ { USB_DEVICE(0x17A8, 0x0102) }, /* Kamstrup 868 MHz wM-Bus C-Mode Meter Reader (Ext Ant) */ |
1730 |
+ { USB_DEVICE(0x17F4, 0xAAAA) }, /* Wavesense Jazz blood glucose meter */ |
1731 |
+ { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */ |
1732 |
+ { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */ |
1733 |
+diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c |
1734 |
+index 37d3bc24c5cff..cf77ec17ef3f4 100644 |
1735 |
+--- a/drivers/usb/serial/option.c |
1736 |
++++ b/drivers/usb/serial/option.c |
1737 |
+@@ -432,6 +432,8 @@ static void option_instat_callback(struct urb *urb); |
1738 |
+ #define CINTERION_PRODUCT_CLS8 0x00b0 |
1739 |
+ #define CINTERION_PRODUCT_MV31_MBIM 0x00b3 |
1740 |
+ #define CINTERION_PRODUCT_MV31_RMNET 0x00b7 |
1741 |
++#define CINTERION_PRODUCT_MV32_WA 0x00f1 |
1742 |
++#define CINTERION_PRODUCT_MV32_WB 0x00f2 |
1743 |
+ |
1744 |
+ /* Olivetti products */ |
1745 |
+ #define OLIVETTI_VENDOR_ID 0x0b3c |
1746 |
+@@ -1217,6 +1219,10 @@ static const struct usb_device_id option_ids[] = { |
1747 |
+ .driver_info = NCTRL(0) | RSVD(1) }, |
1748 |
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1056, 0xff), /* Telit FD980 */ |
1749 |
+ .driver_info = NCTRL(2) | RSVD(3) }, |
1750 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1057, 0xff), /* Telit FN980 */ |
1751 |
++ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, |
1752 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1058, 0xff), /* Telit FN980 (PCIe) */ |
1753 |
++ .driver_info = NCTRL(0) | RSVD(1) }, |
1754 |
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1060, 0xff), /* Telit LN920 (rmnet) */ |
1755 |
+ .driver_info = NCTRL(0) | RSVD(1) | RSVD(2) }, |
1756 |
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1061, 0xff), /* Telit LN920 (MBIM) */ |
1757 |
+@@ -1233,6 +1239,8 @@ static const struct usb_device_id option_ids[] = { |
1758 |
+ .driver_info = NCTRL(2) | RSVD(3) }, |
1759 |
+ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1073, 0xff), /* Telit FN990 (ECM) */ |
1760 |
+ .driver_info = NCTRL(0) | RSVD(1) }, |
1761 |
++ { USB_DEVICE_INTERFACE_CLASS(TELIT_VENDOR_ID, 0x1075, 0xff), /* Telit FN990 (PCIe) */ |
1762 |
++ .driver_info = RSVD(0) }, |
1763 |
+ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910), |
1764 |
+ .driver_info = NCTRL(0) | RSVD(1) | RSVD(3) }, |
1765 |
+ { USB_DEVICE(TELIT_VENDOR_ID, TELIT_PRODUCT_ME910_DUAL_MODEM), |
1766 |
+@@ -1969,6 +1977,10 @@ static const struct usb_device_id option_ids[] = { |
1767 |
+ .driver_info = RSVD(3)}, |
1768 |
+ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV31_RMNET, 0xff), |
1769 |
+ .driver_info = RSVD(0)}, |
1770 |
++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WA, 0xff), |
1771 |
++ .driver_info = RSVD(3)}, |
1772 |
++ { USB_DEVICE_INTERFACE_CLASS(CINTERION_VENDOR_ID, CINTERION_PRODUCT_MV32_WB, 0xff), |
1773 |
++ .driver_info = RSVD(3)}, |
1774 |
+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD100), |
1775 |
+ .driver_info = RSVD(4) }, |
1776 |
+ { USB_DEVICE(OLIVETTI_VENDOR_ID, OLIVETTI_PRODUCT_OLICARD120), |
1777 |
+diff --git a/drivers/usb/serial/whiteheat.c b/drivers/usb/serial/whiteheat.c |
1778 |
+index 16b275123f10e..40a15c79dd341 100644 |
1779 |
+--- a/drivers/usb/serial/whiteheat.c |
1780 |
++++ b/drivers/usb/serial/whiteheat.c |
1781 |
+@@ -611,9 +611,8 @@ static int firm_send_command(struct usb_serial_port *port, __u8 command, |
1782 |
+ switch (command) { |
1783 |
+ case WHITEHEAT_GET_DTR_RTS: |
1784 |
+ info = usb_get_serial_port_data(port); |
1785 |
+- memcpy(&info->mcr, command_info->result_buffer, |
1786 |
+- sizeof(struct whiteheat_dr_info)); |
1787 |
+- break; |
1788 |
++ info->mcr = command_info->result_buffer[0]; |
1789 |
++ break; |
1790 |
+ } |
1791 |
+ } |
1792 |
+ exit: |
1793 |
+diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c |
1794 |
+index dba14bd8ce799..e00c50ea2eafd 100644 |
1795 |
+--- a/fs/btrfs/tree-log.c |
1796 |
++++ b/fs/btrfs/tree-log.c |
1797 |
+@@ -4906,6 +4906,18 @@ static int btrfs_log_inode(struct btrfs_trans_handle *trans, |
1798 |
+ mutex_lock(&inode->log_mutex); |
1799 |
+ } |
1800 |
+ |
1801 |
++ /* |
1802 |
++ * For symlinks, we must always log their content, which is stored in an |
1803 |
++ * inline extent, otherwise we could end up with an empty symlink after |
1804 |
++ * log replay, which is invalid on linux (symlink(2) returns -ENOENT if |
1805 |
++ * one attempts to create an empty symlink). |
1806 |
++ * We don't need to worry about flushing delalloc, because when we create |
1807 |
++ * the inline extent when the symlink is created (we never have delalloc |
1808 |
++ * for symlinks). |
1809 |
++ */ |
1810 |
++ if (S_ISLNK(inode->vfs_inode.i_mode)) |
1811 |
++ inode_only = LOG_INODE_ALL; |
1812 |
++ |
1813 |
+ /* |
1814 |
+ * a brute force approach to making sure we get the most uptodate |
1815 |
+ * copies of everything. |
1816 |
+@@ -5462,7 +5474,7 @@ process_leaf: |
1817 |
+ } |
1818 |
+ |
1819 |
+ ctx->log_new_dentries = false; |
1820 |
+- if (type == BTRFS_FT_DIR || type == BTRFS_FT_SYMLINK) |
1821 |
++ if (type == BTRFS_FT_DIR) |
1822 |
+ log_mode = LOG_INODE_ALL; |
1823 |
+ ret = btrfs_log_inode(trans, root, BTRFS_I(di_inode), |
1824 |
+ log_mode, 0, LLONG_MAX, ctx); |
1825 |
+diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c |
1826 |
+index 61955a7c838b4..cc34a28aecbcd 100644 |
1827 |
+--- a/fs/cifs/smb2ops.c |
1828 |
++++ b/fs/cifs/smb2ops.c |
1829 |
+@@ -1144,9 +1144,17 @@ smb2_copychunk_range(const unsigned int xid, |
1830 |
+ int chunks_copied = 0; |
1831 |
+ bool chunk_sizes_updated = false; |
1832 |
+ ssize_t bytes_written, total_bytes_written = 0; |
1833 |
++ struct inode *inode; |
1834 |
+ |
1835 |
+ pcchunk = kmalloc(sizeof(struct copychunk_ioctl), GFP_KERNEL); |
1836 |
+ |
1837 |
++ /* |
1838 |
++ * We need to flush all unwritten data before we can send the |
1839 |
++ * copychunk ioctl to the server. |
1840 |
++ */ |
1841 |
++ inode = d_inode(trgtfile->dentry); |
1842 |
++ filemap_write_and_wait(inode->i_mapping); |
1843 |
++ |
1844 |
+ if (pcchunk == NULL) |
1845 |
+ return -ENOMEM; |
1846 |
+ |
1847 |
+diff --git a/include/linux/kernel.h b/include/linux/kernel.h |
1848 |
+index f6f94e54ab966..50733abbe548e 100644 |
1849 |
+--- a/include/linux/kernel.h |
1850 |
++++ b/include/linux/kernel.h |
1851 |
+@@ -631,7 +631,7 @@ static inline char *hex_byte_pack_upper(char *buf, u8 byte) |
1852 |
+ return buf; |
1853 |
+ } |
1854 |
+ |
1855 |
+-extern int hex_to_bin(char ch); |
1856 |
++extern int hex_to_bin(unsigned char ch); |
1857 |
+ extern int __must_check hex2bin(u8 *dst, const char *src, size_t count); |
1858 |
+ extern char *bin2hex(char *dst, const void *src, size_t count); |
1859 |
+ |
1860 |
+diff --git a/include/net/tcp.h b/include/net/tcp.h |
1861 |
+index 3f0d654984cf4..5c5807ed66eef 100644 |
1862 |
+--- a/include/net/tcp.h |
1863 |
++++ b/include/net/tcp.h |
1864 |
+@@ -594,6 +594,7 @@ void tcp_synack_rtt_meas(struct sock *sk, struct request_sock *req); |
1865 |
+ void tcp_reset(struct sock *sk); |
1866 |
+ void tcp_skb_mark_lost_uncond_verify(struct tcp_sock *tp, struct sk_buff *skb); |
1867 |
+ void tcp_fin(struct sock *sk); |
1868 |
++void tcp_check_space(struct sock *sk); |
1869 |
+ |
1870 |
+ /* tcp_timer.c */ |
1871 |
+ void tcp_init_xmit_timers(struct sock *); |
1872 |
+@@ -1938,6 +1939,11 @@ struct tcp_request_sock_ops { |
1873 |
+ enum tcp_synack_type synack_type); |
1874 |
+ }; |
1875 |
+ |
1876 |
++extern const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops; |
1877 |
++#if IS_ENABLED(CONFIG_IPV6) |
1878 |
++extern const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops; |
1879 |
++#endif |
1880 |
++ |
1881 |
+ #ifdef CONFIG_SYN_COOKIES |
1882 |
+ static inline __u32 cookie_init_sequence(const struct tcp_request_sock_ops *ops, |
1883 |
+ const struct sock *sk, struct sk_buff *skb, |
1884 |
+diff --git a/kernel/irq/internals.h b/kernel/irq/internals.h |
1885 |
+index 3f4618510d051..10eccbc846861 100644 |
1886 |
+--- a/kernel/irq/internals.h |
1887 |
++++ b/kernel/irq/internals.h |
1888 |
+@@ -29,12 +29,14 @@ extern struct irqaction chained_action; |
1889 |
+ * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed |
1890 |
+ * IRQTF_AFFINITY - irq thread is requested to adjust affinity |
1891 |
+ * IRQTF_FORCED_THREAD - irq action is force threaded |
1892 |
++ * IRQTF_READY - signals that irq thread is ready |
1893 |
+ */ |
1894 |
+ enum { |
1895 |
+ IRQTF_RUNTHREAD, |
1896 |
+ IRQTF_WARNED, |
1897 |
+ IRQTF_AFFINITY, |
1898 |
+ IRQTF_FORCED_THREAD, |
1899 |
++ IRQTF_READY, |
1900 |
+ }; |
1901 |
+ |
1902 |
+ /* |
1903 |
+diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c |
1904 |
+index 26814a14013cb..3633540b0f160 100644 |
1905 |
+--- a/kernel/irq/irqdesc.c |
1906 |
++++ b/kernel/irq/irqdesc.c |
1907 |
+@@ -404,6 +404,7 @@ static struct irq_desc *alloc_desc(int irq, int node, unsigned int flags, |
1908 |
+ lockdep_set_class(&desc->lock, &irq_desc_lock_class); |
1909 |
+ mutex_init(&desc->request_mutex); |
1910 |
+ init_rcu_head(&desc->rcu); |
1911 |
++ init_waitqueue_head(&desc->wait_for_threads); |
1912 |
+ |
1913 |
+ desc_set_defaults(irq, desc, node, affinity, owner); |
1914 |
+ irqd_set(&desc->irq_data, flags); |
1915 |
+@@ -568,6 +569,7 @@ int __init early_irq_init(void) |
1916 |
+ raw_spin_lock_init(&desc[i].lock); |
1917 |
+ lockdep_set_class(&desc[i].lock, &irq_desc_lock_class); |
1918 |
+ mutex_init(&desc[i].request_mutex); |
1919 |
++ init_waitqueue_head(&desc[i].wait_for_threads); |
1920 |
+ desc_set_defaults(i, &desc[i], node, NULL, NULL); |
1921 |
+ } |
1922 |
+ return arch_early_irq_init(); |
1923 |
+diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c |
1924 |
+index c377dbb869f80..18f3cdbf41fd5 100644 |
1925 |
+--- a/kernel/irq/manage.c |
1926 |
++++ b/kernel/irq/manage.c |
1927 |
+@@ -1063,6 +1063,31 @@ static void irq_wake_secondary(struct irq_desc *desc, struct irqaction *action) |
1928 |
+ raw_spin_unlock_irq(&desc->lock); |
1929 |
+ } |
1930 |
+ |
1931 |
++/* |
1932 |
++ * Internal function to notify that a interrupt thread is ready. |
1933 |
++ */ |
1934 |
++static void irq_thread_set_ready(struct irq_desc *desc, |
1935 |
++ struct irqaction *action) |
1936 |
++{ |
1937 |
++ set_bit(IRQTF_READY, &action->thread_flags); |
1938 |
++ wake_up(&desc->wait_for_threads); |
1939 |
++} |
1940 |
++ |
1941 |
++/* |
1942 |
++ * Internal function to wake up a interrupt thread and wait until it is |
1943 |
++ * ready. |
1944 |
++ */ |
1945 |
++static void wake_up_and_wait_for_irq_thread_ready(struct irq_desc *desc, |
1946 |
++ struct irqaction *action) |
1947 |
++{ |
1948 |
++ if (!action || !action->thread) |
1949 |
++ return; |
1950 |
++ |
1951 |
++ wake_up_process(action->thread); |
1952 |
++ wait_event(desc->wait_for_threads, |
1953 |
++ test_bit(IRQTF_READY, &action->thread_flags)); |
1954 |
++} |
1955 |
++ |
1956 |
+ /* |
1957 |
+ * Interrupt handler thread |
1958 |
+ */ |
1959 |
+@@ -1074,6 +1099,8 @@ static int irq_thread(void *data) |
1960 |
+ irqreturn_t (*handler_fn)(struct irq_desc *desc, |
1961 |
+ struct irqaction *action); |
1962 |
+ |
1963 |
++ irq_thread_set_ready(desc, action); |
1964 |
++ |
1965 |
+ if (force_irqthreads && test_bit(IRQTF_FORCED_THREAD, |
1966 |
+ &action->thread_flags)) |
1967 |
+ handler_fn = irq_forced_thread_fn; |
1968 |
+@@ -1462,8 +1489,6 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) |
1969 |
+ } |
1970 |
+ |
1971 |
+ if (!shared) { |
1972 |
+- init_waitqueue_head(&desc->wait_for_threads); |
1973 |
+- |
1974 |
+ /* Setup the type (level, edge polarity) if configured: */ |
1975 |
+ if (new->flags & IRQF_TRIGGER_MASK) { |
1976 |
+ ret = __irq_set_trigger(desc, |
1977 |
+@@ -1553,14 +1578,8 @@ __setup_irq(unsigned int irq, struct irq_desc *desc, struct irqaction *new) |
1978 |
+ |
1979 |
+ irq_setup_timings(desc, new); |
1980 |
+ |
1981 |
+- /* |
1982 |
+- * Strictly no need to wake it up, but hung_task complains |
1983 |
+- * when no hard interrupt wakes the thread up. |
1984 |
+- */ |
1985 |
+- if (new->thread) |
1986 |
+- wake_up_process(new->thread); |
1987 |
+- if (new->secondary) |
1988 |
+- wake_up_process(new->secondary->thread); |
1989 |
++ wake_up_and_wait_for_irq_thread_ready(desc, new); |
1990 |
++ wake_up_and_wait_for_irq_thread_ready(desc, new->secondary); |
1991 |
+ |
1992 |
+ register_irq_proc(irq, desc); |
1993 |
+ new->dir = NULL; |
1994 |
+diff --git a/lib/hexdump.c b/lib/hexdump.c |
1995 |
+index 81b70ed372096..fa2fab854f74d 100644 |
1996 |
+--- a/lib/hexdump.c |
1997 |
++++ b/lib/hexdump.c |
1998 |
+@@ -25,15 +25,33 @@ EXPORT_SYMBOL(hex_asc_upper); |
1999 |
+ * |
2000 |
+ * hex_to_bin() converts one hex digit to its actual value or -1 in case of bad |
2001 |
+ * input. |
2002 |
++ * |
2003 |
++ * This function is used to load cryptographic keys, so it is coded in such a |
2004 |
++ * way that there are no conditions or memory accesses that depend on data. |
2005 |
++ * |
2006 |
++ * Explanation of the logic: |
2007 |
++ * (ch - '9' - 1) is negative if ch <= '9' |
2008 |
++ * ('0' - 1 - ch) is negative if ch >= '0' |
2009 |
++ * we "and" these two values, so the result is negative if ch is in the range |
2010 |
++ * '0' ... '9' |
2011 |
++ * we are only interested in the sign, so we do a shift ">> 8"; note that right |
2012 |
++ * shift of a negative value is implementation-defined, so we cast the |
2013 |
++ * value to (unsigned) before the shift --- we have 0xffffff if ch is in |
2014 |
++ * the range '0' ... '9', 0 otherwise |
2015 |
++ * we "and" this value with (ch - '0' + 1) --- we have a value 1 ... 10 if ch is |
2016 |
++ * in the range '0' ... '9', 0 otherwise |
2017 |
++ * we add this value to -1 --- we have a value 0 ... 9 if ch is in the range '0' |
2018 |
++ * ... '9', -1 otherwise |
2019 |
++ * the next line is similar to the previous one, but we need to decode both |
2020 |
++ * uppercase and lowercase letters, so we use (ch & 0xdf), which converts |
2021 |
++ * lowercase to uppercase |
2022 |
+ */ |
2023 |
+-int hex_to_bin(char ch) |
2024 |
++int hex_to_bin(unsigned char ch) |
2025 |
+ { |
2026 |
+- if ((ch >= '0') && (ch <= '9')) |
2027 |
+- return ch - '0'; |
2028 |
+- ch = tolower(ch); |
2029 |
+- if ((ch >= 'a') && (ch <= 'f')) |
2030 |
+- return ch - 'a' + 10; |
2031 |
+- return -1; |
2032 |
++ unsigned char cu = ch & 0xdf; |
2033 |
++ return -1 + |
2034 |
++ ((ch - '0' + 1) & (unsigned)((ch - '9' - 1) & ('0' - 1 - ch)) >> 8) + |
2035 |
++ ((cu - 'A' + 11) & (unsigned)((cu - 'F' - 1) & ('A' - 1 - cu)) >> 8); |
2036 |
+ } |
2037 |
+ EXPORT_SYMBOL(hex_to_bin); |
2038 |
+ |
2039 |
+@@ -48,10 +66,13 @@ EXPORT_SYMBOL(hex_to_bin); |
2040 |
+ int hex2bin(u8 *dst, const char *src, size_t count) |
2041 |
+ { |
2042 |
+ while (count--) { |
2043 |
+- int hi = hex_to_bin(*src++); |
2044 |
+- int lo = hex_to_bin(*src++); |
2045 |
++ int hi, lo; |
2046 |
+ |
2047 |
+- if ((hi < 0) || (lo < 0)) |
2048 |
++ hi = hex_to_bin(*src++); |
2049 |
++ if (unlikely(hi < 0)) |
2050 |
++ return -EINVAL; |
2051 |
++ lo = hex_to_bin(*src++); |
2052 |
++ if (unlikely(lo < 0)) |
2053 |
+ return -EINVAL; |
2054 |
+ |
2055 |
+ *dst++ = (hi << 4) | lo; |
2056 |
+diff --git a/mm/page_io.c b/mm/page_io.c |
2057 |
+index 9b646f07f47f1..929e7829e02d1 100644 |
2058 |
+--- a/mm/page_io.c |
2059 |
++++ b/mm/page_io.c |
2060 |
+@@ -71,55 +71,6 @@ void end_swap_bio_write(struct bio *bio) |
2061 |
+ bio_put(bio); |
2062 |
+ } |
2063 |
+ |
2064 |
+-static void swap_slot_free_notify(struct page *page) |
2065 |
+-{ |
2066 |
+- struct swap_info_struct *sis; |
2067 |
+- struct gendisk *disk; |
2068 |
+- swp_entry_t entry; |
2069 |
+- |
2070 |
+- /* |
2071 |
+- * There is no guarantee that the page is in swap cache - the software |
2072 |
+- * suspend code (at least) uses end_swap_bio_read() against a non- |
2073 |
+- * swapcache page. So we must check PG_swapcache before proceeding with |
2074 |
+- * this optimization. |
2075 |
+- */ |
2076 |
+- if (unlikely(!PageSwapCache(page))) |
2077 |
+- return; |
2078 |
+- |
2079 |
+- sis = page_swap_info(page); |
2080 |
+- if (!(sis->flags & SWP_BLKDEV)) |
2081 |
+- return; |
2082 |
+- |
2083 |
+- /* |
2084 |
+- * The swap subsystem performs lazy swap slot freeing, |
2085 |
+- * expecting that the page will be swapped out again. |
2086 |
+- * So we can avoid an unnecessary write if the page |
2087 |
+- * isn't redirtied. |
2088 |
+- * This is good for real swap storage because we can |
2089 |
+- * reduce unnecessary I/O and enhance wear-leveling |
2090 |
+- * if an SSD is used as the as swap device. |
2091 |
+- * But if in-memory swap device (eg zram) is used, |
2092 |
+- * this causes a duplicated copy between uncompressed |
2093 |
+- * data in VM-owned memory and compressed data in |
2094 |
+- * zram-owned memory. So let's free zram-owned memory |
2095 |
+- * and make the VM-owned decompressed page *dirty*, |
2096 |
+- * so the page should be swapped out somewhere again if |
2097 |
+- * we again wish to reclaim it. |
2098 |
+- */ |
2099 |
+- disk = sis->bdev->bd_disk; |
2100 |
+- entry.val = page_private(page); |
2101 |
+- if (disk->fops->swap_slot_free_notify && |
2102 |
+- __swap_count(sis, entry) == 1) { |
2103 |
+- unsigned long offset; |
2104 |
+- |
2105 |
+- offset = swp_offset(entry); |
2106 |
+- |
2107 |
+- SetPageDirty(page); |
2108 |
+- disk->fops->swap_slot_free_notify(sis->bdev, |
2109 |
+- offset); |
2110 |
+- } |
2111 |
+-} |
2112 |
+- |
2113 |
+ static void end_swap_bio_read(struct bio *bio) |
2114 |
+ { |
2115 |
+ struct page *page = bio_first_page_all(bio); |
2116 |
+@@ -135,7 +86,6 @@ static void end_swap_bio_read(struct bio *bio) |
2117 |
+ } |
2118 |
+ |
2119 |
+ SetPageUptodate(page); |
2120 |
+- swap_slot_free_notify(page); |
2121 |
+ out: |
2122 |
+ unlock_page(page); |
2123 |
+ WRITE_ONCE(bio->bi_private, NULL); |
2124 |
+@@ -373,11 +323,6 @@ int swap_readpage(struct page *page, bool synchronous) |
2125 |
+ |
2126 |
+ ret = bdev_read_page(sis->bdev, map_swap_page(page, &sis->bdev), page); |
2127 |
+ if (!ret) { |
2128 |
+- if (trylock_page(page)) { |
2129 |
+- swap_slot_free_notify(page); |
2130 |
+- unlock_page(page); |
2131 |
+- } |
2132 |
+- |
2133 |
+ count_vm_event(PSWPIN); |
2134 |
+ return 0; |
2135 |
+ } |
2136 |
+diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c |
2137 |
+index 15804cfc19a8c..ee179e08dd20c 100644 |
2138 |
+--- a/net/ipv4/igmp.c |
2139 |
++++ b/net/ipv4/igmp.c |
2140 |
+@@ -2416,9 +2416,10 @@ int ip_mc_source(int add, int omode, struct sock *sk, struct |
2141 |
+ newpsl->sl_addr[i] = psl->sl_addr[i]; |
2142 |
+ /* decrease mem now to avoid the memleak warning */ |
2143 |
+ atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc); |
2144 |
+- kfree_rcu(psl, rcu); |
2145 |
+ } |
2146 |
+ rcu_assign_pointer(pmc->sflist, newpsl); |
2147 |
++ if (psl) |
2148 |
++ kfree_rcu(psl, rcu); |
2149 |
+ psl = newpsl; |
2150 |
+ } |
2151 |
+ rv = 1; /* > 0 for insert logic below if sl_count is 0 */ |
2152 |
+@@ -2516,11 +2517,13 @@ int ip_mc_msfilter(struct sock *sk, struct ip_msfilter *msf, int ifindex) |
2153 |
+ psl->sl_count, psl->sl_addr, 0); |
2154 |
+ /* decrease mem now to avoid the memleak warning */ |
2155 |
+ atomic_sub(IP_SFLSIZE(psl->sl_max), &sk->sk_omem_alloc); |
2156 |
+- kfree_rcu(psl, rcu); |
2157 |
+- } else |
2158 |
++ } else { |
2159 |
+ (void) ip_mc_del_src(in_dev, &msf->imsf_multiaddr, pmc->sfmode, |
2160 |
+ 0, NULL, 0); |
2161 |
++ } |
2162 |
+ rcu_assign_pointer(pmc->sflist, newpsl); |
2163 |
++ if (psl) |
2164 |
++ kfree_rcu(psl, rcu); |
2165 |
+ pmc->sfmode = msf->imsf_fmode; |
2166 |
+ err = 0; |
2167 |
+ done: |
2168 |
+diff --git a/net/ipv4/ip_gre.c b/net/ipv4/ip_gre.c |
2169 |
+index 0c431fd4b1200..41d0f9bb51914 100644 |
2170 |
+--- a/net/ipv4/ip_gre.c |
2171 |
++++ b/net/ipv4/ip_gre.c |
2172 |
+@@ -435,14 +435,12 @@ static void __gre_xmit(struct sk_buff *skb, struct net_device *dev, |
2173 |
+ __be16 proto) |
2174 |
+ { |
2175 |
+ struct ip_tunnel *tunnel = netdev_priv(dev); |
2176 |
+- |
2177 |
+- if (tunnel->parms.o_flags & TUNNEL_SEQ) |
2178 |
+- tunnel->o_seqno++; |
2179 |
++ __be16 flags = tunnel->parms.o_flags; |
2180 |
+ |
2181 |
+ /* Push GRE header. */ |
2182 |
+ gre_build_header(skb, tunnel->tun_hlen, |
2183 |
+- tunnel->parms.o_flags, proto, tunnel->parms.o_key, |
2184 |
+- htonl(tunnel->o_seqno)); |
2185 |
++ flags, proto, tunnel->parms.o_key, |
2186 |
++ (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) : 0); |
2187 |
+ |
2188 |
+ ip_tunnel_xmit(skb, dev, tnl_params, tnl_params->protocol); |
2189 |
+ } |
2190 |
+diff --git a/net/ipv4/syncookies.c b/net/ipv4/syncookies.c |
2191 |
+index 1a06850ef3cc5..929f989de1f63 100644 |
2192 |
+--- a/net/ipv4/syncookies.c |
2193 |
++++ b/net/ipv4/syncookies.c |
2194 |
+@@ -337,6 +337,7 @@ struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb) |
2195 |
+ |
2196 |
+ ireq = inet_rsk(req); |
2197 |
+ treq = tcp_rsk(req); |
2198 |
++ treq->af_specific = &tcp_request_sock_ipv4_ops; |
2199 |
+ treq->rcv_isn = ntohl(th->seq) - 1; |
2200 |
+ treq->snt_isn = cookie; |
2201 |
+ treq->ts_off = 0; |
2202 |
+diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c |
2203 |
+index 757e1f60e00db..d71326f3777cb 100644 |
2204 |
+--- a/net/ipv4/tcp_input.c |
2205 |
++++ b/net/ipv4/tcp_input.c |
2206 |
+@@ -5167,7 +5167,17 @@ static void tcp_new_space(struct sock *sk) |
2207 |
+ sk->sk_write_space(sk); |
2208 |
+ } |
2209 |
+ |
2210 |
+-static void tcp_check_space(struct sock *sk) |
2211 |
++/* Caller made space either from: |
2212 |
++ * 1) Freeing skbs in rtx queues (after tp->snd_una has advanced) |
2213 |
++ * 2) Sent skbs from output queue (and thus advancing tp->snd_nxt) |
2214 |
++ * |
2215 |
++ * We might be able to generate EPOLLOUT to the application if: |
2216 |
++ * 1) Space consumed in output/rtx queues is below sk->sk_sndbuf/2 |
2217 |
++ * 2) notsent amount (tp->write_seq - tp->snd_nxt) became |
2218 |
++ * small enough that tcp_stream_memory_free() decides it |
2219 |
++ * is time to generate EPOLLOUT. |
2220 |
++ */ |
2221 |
++void tcp_check_space(struct sock *sk) |
2222 |
+ { |
2223 |
+ if (sock_flag(sk, SOCK_QUEUE_SHRUNK)) { |
2224 |
+ sock_reset_flag(sk, SOCK_QUEUE_SHRUNK); |
2225 |
+diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c |
2226 |
+index c9fc6e3868be3..2719c60f285b0 100644 |
2227 |
+--- a/net/ipv4/tcp_ipv4.c |
2228 |
++++ b/net/ipv4/tcp_ipv4.c |
2229 |
+@@ -1372,7 +1372,7 @@ struct request_sock_ops tcp_request_sock_ops __read_mostly = { |
2230 |
+ .syn_ack_timeout = tcp_syn_ack_timeout, |
2231 |
+ }; |
2232 |
+ |
2233 |
+-static const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = { |
2234 |
++const struct tcp_request_sock_ops tcp_request_sock_ipv4_ops = { |
2235 |
+ .mss_clamp = TCP_MSS_DEFAULT, |
2236 |
+ #ifdef CONFIG_TCP_MD5SIG |
2237 |
+ .req_md5_lookup = tcp_v4_md5_lookup, |
2238 |
+diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c |
2239 |
+index a20b393b45016..c79cb949da66b 100644 |
2240 |
+--- a/net/ipv4/tcp_minisocks.c |
2241 |
++++ b/net/ipv4/tcp_minisocks.c |
2242 |
+@@ -550,7 +550,7 @@ struct sock *tcp_create_openreq_child(const struct sock *sk, |
2243 |
+ newtp->tsoffset = treq->ts_off; |
2244 |
+ #ifdef CONFIG_TCP_MD5SIG |
2245 |
+ newtp->md5sig_info = NULL; /*XXX*/ |
2246 |
+- if (newtp->af_specific->md5_lookup(sk, newsk)) |
2247 |
++ if (treq->af_specific->req_md5_lookup(sk, req_to_sk(req))) |
2248 |
+ newtp->tcp_header_len += TCPOLEN_MD5SIG_ALIGNED; |
2249 |
+ #endif |
2250 |
+ if (skb->len >= TCP_MSS_DEFAULT + newtp->tcp_header_len) |
2251 |
+diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c |
2252 |
+index 97c3b616d594b..8543cd724d543 100644 |
2253 |
+--- a/net/ipv4/tcp_output.c |
2254 |
++++ b/net/ipv4/tcp_output.c |
2255 |
+@@ -69,6 +69,7 @@ static void tcp_event_new_data_sent(struct sock *sk, struct sk_buff *skb) |
2256 |
+ |
2257 |
+ NET_ADD_STATS(sock_net(sk), LINUX_MIB_TCPORIGDATASENT, |
2258 |
+ tcp_skb_pcount(skb)); |
2259 |
++ tcp_check_space(sk); |
2260 |
+ } |
2261 |
+ |
2262 |
+ /* SND.NXT, if window was not shrunk or the amount of shrunk was less than one |
2263 |
+diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c |
2264 |
+index 043e57d08a3e9..4fd6c0929b144 100644 |
2265 |
+--- a/net/ipv6/ip6_gre.c |
2266 |
++++ b/net/ipv6/ip6_gre.c |
2267 |
+@@ -750,6 +750,7 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, |
2268 |
+ struct ip_tunnel_info *tun_info; |
2269 |
+ const struct ip_tunnel_key *key; |
2270 |
+ __be16 flags; |
2271 |
++ int tun_hlen; |
2272 |
+ |
2273 |
+ tun_info = skb_tunnel_info(skb); |
2274 |
+ if (unlikely(!tun_info || |
2275 |
+@@ -767,9 +768,9 @@ static netdev_tx_t __gre6_xmit(struct sk_buff *skb, |
2276 |
+ dsfield = key->tos; |
2277 |
+ flags = key->tun_flags & |
2278 |
+ (TUNNEL_CSUM | TUNNEL_KEY | TUNNEL_SEQ); |
2279 |
+- tunnel->tun_hlen = gre_calc_hlen(flags); |
2280 |
++ tun_hlen = gre_calc_hlen(flags); |
2281 |
+ |
2282 |
+- gre_build_header(skb, tunnel->tun_hlen, |
2283 |
++ gre_build_header(skb, tun_hlen, |
2284 |
+ flags, protocol, |
2285 |
+ tunnel_id_to_key32(tun_info->key.tun_id), |
2286 |
+ (flags & TUNNEL_SEQ) ? htonl(tunnel->o_seqno++) |
2287 |
+diff --git a/net/ipv6/syncookies.c b/net/ipv6/syncookies.c |
2288 |
+index ec61b67a92be0..ca291e342900c 100644 |
2289 |
+--- a/net/ipv6/syncookies.c |
2290 |
++++ b/net/ipv6/syncookies.c |
2291 |
+@@ -181,6 +181,7 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb) |
2292 |
+ |
2293 |
+ ireq = inet_rsk(req); |
2294 |
+ treq = tcp_rsk(req); |
2295 |
++ treq->af_specific = &tcp_request_sock_ipv6_ops; |
2296 |
+ treq->tfo_listener = false; |
2297 |
+ |
2298 |
+ if (security_inet_conn_request(sk, skb, req)) |
2299 |
+diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c |
2300 |
+index c332f75f4e9aa..c9ba827aded26 100644 |
2301 |
+--- a/net/ipv6/tcp_ipv6.c |
2302 |
++++ b/net/ipv6/tcp_ipv6.c |
2303 |
+@@ -789,7 +789,7 @@ struct request_sock_ops tcp6_request_sock_ops __read_mostly = { |
2304 |
+ .syn_ack_timeout = tcp_syn_ack_timeout, |
2305 |
+ }; |
2306 |
+ |
2307 |
+-static const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = { |
2308 |
++const struct tcp_request_sock_ops tcp_request_sock_ipv6_ops = { |
2309 |
+ .mss_clamp = IPV6_MIN_MTU - sizeof(struct tcphdr) - |
2310 |
+ sizeof(struct ipv6hdr), |
2311 |
+ #ifdef CONFIG_TCP_MD5SIG |
2312 |
+diff --git a/net/netfilter/ipvs/ip_vs_conn.c b/net/netfilter/ipvs/ip_vs_conn.c |
2313 |
+index 2780a847701e6..95c35aa639ecf 100644 |
2314 |
+--- a/net/netfilter/ipvs/ip_vs_conn.c |
2315 |
++++ b/net/netfilter/ipvs/ip_vs_conn.c |
2316 |
+@@ -1426,7 +1426,7 @@ int __init ip_vs_conn_init(void) |
2317 |
+ pr_info("Connection hash table configured " |
2318 |
+ "(size=%d, memory=%ldKbytes)\n", |
2319 |
+ ip_vs_conn_tab_size, |
2320 |
+- (long)(ip_vs_conn_tab_size*sizeof(struct list_head))/1024); |
2321 |
++ (long)(ip_vs_conn_tab_size*sizeof(*ip_vs_conn_tab))/1024); |
2322 |
+ IP_VS_DBG(0, "Each connection entry needs %zd bytes at least\n", |
2323 |
+ sizeof(struct ip_vs_conn)); |
2324 |
+ |
2325 |
+diff --git a/net/netfilter/nft_socket.c b/net/netfilter/nft_socket.c |
2326 |
+index 637ce3e8c575c..4026ec38526f6 100644 |
2327 |
+--- a/net/netfilter/nft_socket.c |
2328 |
++++ b/net/netfilter/nft_socket.c |
2329 |
+@@ -14,6 +14,32 @@ struct nft_socket { |
2330 |
+ }; |
2331 |
+ }; |
2332 |
+ |
2333 |
++static struct sock *nft_socket_do_lookup(const struct nft_pktinfo *pkt) |
2334 |
++{ |
2335 |
++ const struct net_device *indev = nft_in(pkt); |
2336 |
++ const struct sk_buff *skb = pkt->skb; |
2337 |
++ struct sock *sk = NULL; |
2338 |
++ |
2339 |
++ if (!indev) |
2340 |
++ return NULL; |
2341 |
++ |
2342 |
++ switch (nft_pf(pkt)) { |
2343 |
++ case NFPROTO_IPV4: |
2344 |
++ sk = nf_sk_lookup_slow_v4(nft_net(pkt), skb, indev); |
2345 |
++ break; |
2346 |
++#if IS_ENABLED(CONFIG_NF_TABLES_IPV6) |
2347 |
++ case NFPROTO_IPV6: |
2348 |
++ sk = nf_sk_lookup_slow_v6(nft_net(pkt), skb, indev); |
2349 |
++ break; |
2350 |
++#endif |
2351 |
++ default: |
2352 |
++ WARN_ON_ONCE(1); |
2353 |
++ break; |
2354 |
++ } |
2355 |
++ |
2356 |
++ return sk; |
2357 |
++} |
2358 |
++ |
2359 |
+ static void nft_socket_eval(const struct nft_expr *expr, |
2360 |
+ struct nft_regs *regs, |
2361 |
+ const struct nft_pktinfo *pkt) |
2362 |
+@@ -27,20 +53,7 @@ static void nft_socket_eval(const struct nft_expr *expr, |
2363 |
+ sk = NULL; |
2364 |
+ |
2365 |
+ if (!sk) |
2366 |
+- switch(nft_pf(pkt)) { |
2367 |
+- case NFPROTO_IPV4: |
2368 |
+- sk = nf_sk_lookup_slow_v4(nft_net(pkt), skb, nft_in(pkt)); |
2369 |
+- break; |
2370 |
+-#if IS_ENABLED(CONFIG_NF_TABLES_IPV6) |
2371 |
+- case NFPROTO_IPV6: |
2372 |
+- sk = nf_sk_lookup_slow_v6(nft_net(pkt), skb, nft_in(pkt)); |
2373 |
+- break; |
2374 |
+-#endif |
2375 |
+- default: |
2376 |
+- WARN_ON_ONCE(1); |
2377 |
+- regs->verdict.code = NFT_BREAK; |
2378 |
+- return; |
2379 |
+- } |
2380 |
++ sk = nft_socket_do_lookup(pkt); |
2381 |
+ |
2382 |
+ if (!sk) { |
2383 |
+ regs->verdict.code = NFT_BREAK; |
2384 |
+@@ -123,6 +136,16 @@ static int nft_socket_dump(struct sk_buff *skb, |
2385 |
+ return 0; |
2386 |
+ } |
2387 |
+ |
2388 |
++static int nft_socket_validate(const struct nft_ctx *ctx, |
2389 |
++ const struct nft_expr *expr, |
2390 |
++ const struct nft_data **data) |
2391 |
++{ |
2392 |
++ return nft_chain_validate_hooks(ctx->chain, |
2393 |
++ (1 << NF_INET_PRE_ROUTING) | |
2394 |
++ (1 << NF_INET_LOCAL_IN) | |
2395 |
++ (1 << NF_INET_LOCAL_OUT)); |
2396 |
++} |
2397 |
++ |
2398 |
+ static struct nft_expr_type nft_socket_type; |
2399 |
+ static const struct nft_expr_ops nft_socket_ops = { |
2400 |
+ .type = &nft_socket_type, |
2401 |
+@@ -130,6 +153,7 @@ static const struct nft_expr_ops nft_socket_ops = { |
2402 |
+ .eval = nft_socket_eval, |
2403 |
+ .init = nft_socket_init, |
2404 |
+ .dump = nft_socket_dump, |
2405 |
++ .validate = nft_socket_validate, |
2406 |
+ }; |
2407 |
+ |
2408 |
+ static struct nft_expr_type nft_socket_type __read_mostly = { |
2409 |
+diff --git a/net/nfc/core.c b/net/nfc/core.c |
2410 |
+index ff646d1758d16..54168bbc07cbf 100644 |
2411 |
+--- a/net/nfc/core.c |
2412 |
++++ b/net/nfc/core.c |
2413 |
+@@ -50,7 +50,7 @@ int nfc_fw_download(struct nfc_dev *dev, const char *firmware_name) |
2414 |
+ |
2415 |
+ device_lock(&dev->dev); |
2416 |
+ |
2417 |
+- if (!device_is_registered(&dev->dev)) { |
2418 |
++ if (dev->shutting_down) { |
2419 |
+ rc = -ENODEV; |
2420 |
+ goto error; |
2421 |
+ } |
2422 |
+@@ -106,7 +106,7 @@ int nfc_dev_up(struct nfc_dev *dev) |
2423 |
+ |
2424 |
+ device_lock(&dev->dev); |
2425 |
+ |
2426 |
+- if (!device_is_registered(&dev->dev)) { |
2427 |
++ if (dev->shutting_down) { |
2428 |
+ rc = -ENODEV; |
2429 |
+ goto error; |
2430 |
+ } |
2431 |
+@@ -154,7 +154,7 @@ int nfc_dev_down(struct nfc_dev *dev) |
2432 |
+ |
2433 |
+ device_lock(&dev->dev); |
2434 |
+ |
2435 |
+- if (!device_is_registered(&dev->dev)) { |
2436 |
++ if (dev->shutting_down) { |
2437 |
+ rc = -ENODEV; |
2438 |
+ goto error; |
2439 |
+ } |
2440 |
+@@ -218,7 +218,7 @@ int nfc_start_poll(struct nfc_dev *dev, u32 im_protocols, u32 tm_protocols) |
2441 |
+ |
2442 |
+ device_lock(&dev->dev); |
2443 |
+ |
2444 |
+- if (!device_is_registered(&dev->dev)) { |
2445 |
++ if (dev->shutting_down) { |
2446 |
+ rc = -ENODEV; |
2447 |
+ goto error; |
2448 |
+ } |
2449 |
+@@ -257,7 +257,7 @@ int nfc_stop_poll(struct nfc_dev *dev) |
2450 |
+ |
2451 |
+ device_lock(&dev->dev); |
2452 |
+ |
2453 |
+- if (!device_is_registered(&dev->dev)) { |
2454 |
++ if (dev->shutting_down) { |
2455 |
+ rc = -ENODEV; |
2456 |
+ goto error; |
2457 |
+ } |
2458 |
+@@ -302,7 +302,7 @@ int nfc_dep_link_up(struct nfc_dev *dev, int target_index, u8 comm_mode) |
2459 |
+ |
2460 |
+ device_lock(&dev->dev); |
2461 |
+ |
2462 |
+- if (!device_is_registered(&dev->dev)) { |
2463 |
++ if (dev->shutting_down) { |
2464 |
+ rc = -ENODEV; |
2465 |
+ goto error; |
2466 |
+ } |
2467 |
+@@ -346,7 +346,7 @@ int nfc_dep_link_down(struct nfc_dev *dev) |
2468 |
+ |
2469 |
+ device_lock(&dev->dev); |
2470 |
+ |
2471 |
+- if (!device_is_registered(&dev->dev)) { |
2472 |
++ if (dev->shutting_down) { |
2473 |
+ rc = -ENODEV; |
2474 |
+ goto error; |
2475 |
+ } |
2476 |
+@@ -412,7 +412,7 @@ int nfc_activate_target(struct nfc_dev *dev, u32 target_idx, u32 protocol) |
2477 |
+ |
2478 |
+ device_lock(&dev->dev); |
2479 |
+ |
2480 |
+- if (!device_is_registered(&dev->dev)) { |
2481 |
++ if (dev->shutting_down) { |
2482 |
+ rc = -ENODEV; |
2483 |
+ goto error; |
2484 |
+ } |
2485 |
+@@ -458,7 +458,7 @@ int nfc_deactivate_target(struct nfc_dev *dev, u32 target_idx, u8 mode) |
2486 |
+ |
2487 |
+ device_lock(&dev->dev); |
2488 |
+ |
2489 |
+- if (!device_is_registered(&dev->dev)) { |
2490 |
++ if (dev->shutting_down) { |
2491 |
+ rc = -ENODEV; |
2492 |
+ goto error; |
2493 |
+ } |
2494 |
+@@ -505,7 +505,7 @@ int nfc_data_exchange(struct nfc_dev *dev, u32 target_idx, struct sk_buff *skb, |
2495 |
+ |
2496 |
+ device_lock(&dev->dev); |
2497 |
+ |
2498 |
+- if (!device_is_registered(&dev->dev)) { |
2499 |
++ if (dev->shutting_down) { |
2500 |
+ rc = -ENODEV; |
2501 |
+ kfree_skb(skb); |
2502 |
+ goto error; |
2503 |
+@@ -562,7 +562,7 @@ int nfc_enable_se(struct nfc_dev *dev, u32 se_idx) |
2504 |
+ |
2505 |
+ device_lock(&dev->dev); |
2506 |
+ |
2507 |
+- if (!device_is_registered(&dev->dev)) { |
2508 |
++ if (dev->shutting_down) { |
2509 |
+ rc = -ENODEV; |
2510 |
+ goto error; |
2511 |
+ } |
2512 |
+@@ -611,7 +611,7 @@ int nfc_disable_se(struct nfc_dev *dev, u32 se_idx) |
2513 |
+ |
2514 |
+ device_lock(&dev->dev); |
2515 |
+ |
2516 |
+- if (!device_is_registered(&dev->dev)) { |
2517 |
++ if (dev->shutting_down) { |
2518 |
+ rc = -ENODEV; |
2519 |
+ goto error; |
2520 |
+ } |
2521 |
+@@ -1139,6 +1139,7 @@ int nfc_register_device(struct nfc_dev *dev) |
2522 |
+ dev->rfkill = NULL; |
2523 |
+ } |
2524 |
+ } |
2525 |
++ dev->shutting_down = false; |
2526 |
+ device_unlock(&dev->dev); |
2527 |
+ |
2528 |
+ rc = nfc_genl_device_added(dev); |
2529 |
+@@ -1171,12 +1172,10 @@ void nfc_unregister_device(struct nfc_dev *dev) |
2530 |
+ rfkill_unregister(dev->rfkill); |
2531 |
+ rfkill_destroy(dev->rfkill); |
2532 |
+ } |
2533 |
++ dev->shutting_down = true; |
2534 |
+ device_unlock(&dev->dev); |
2535 |
+ |
2536 |
+ if (dev->ops->check_presence) { |
2537 |
+- device_lock(&dev->dev); |
2538 |
+- dev->shutting_down = true; |
2539 |
+- device_unlock(&dev->dev); |
2540 |
+ del_timer_sync(&dev->check_pres_timer); |
2541 |
+ cancel_work_sync(&dev->check_pres_work); |
2542 |
+ } |
2543 |
+diff --git a/net/nfc/netlink.c b/net/nfc/netlink.c |
2544 |
+index 0a3120117c13d..39fb01ee92220 100644 |
2545 |
+--- a/net/nfc/netlink.c |
2546 |
++++ b/net/nfc/netlink.c |
2547 |
+@@ -1262,7 +1262,7 @@ int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name, |
2548 |
+ struct sk_buff *msg; |
2549 |
+ void *hdr; |
2550 |
+ |
2551 |
+- msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_KERNEL); |
2552 |
++ msg = nlmsg_new(NLMSG_DEFAULT_SIZE, GFP_ATOMIC); |
2553 |
+ if (!msg) |
2554 |
+ return -ENOMEM; |
2555 |
+ |
2556 |
+@@ -1278,7 +1278,7 @@ int nfc_genl_fw_download_done(struct nfc_dev *dev, const char *firmware_name, |
2557 |
+ |
2558 |
+ genlmsg_end(msg, hdr); |
2559 |
+ |
2560 |
+- genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_KERNEL); |
2561 |
++ genlmsg_multicast(&nfc_genl_family, msg, 0, 0, GFP_ATOMIC); |
2562 |
+ |
2563 |
+ return 0; |
2564 |
+ |
2565 |
+diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c |
2566 |
+index 2a94240eac360..82d96441e64d6 100644 |
2567 |
+--- a/net/sctp/sm_sideeffect.c |
2568 |
++++ b/net/sctp/sm_sideeffect.c |
2569 |
+@@ -473,6 +473,10 @@ void sctp_generate_reconf_event(struct timer_list *t) |
2570 |
+ goto out_unlock; |
2571 |
+ } |
2572 |
+ |
2573 |
++ /* This happens when the response arrives after the timer is triggered. */ |
2574 |
++ if (!asoc->strreset_chunk) |
2575 |
++ goto out_unlock; |
2576 |
++ |
2577 |
+ error = sctp_do_sm(net, SCTP_EVENT_T_TIMEOUT, |
2578 |
+ SCTP_ST_TIMEOUT(SCTP_EVENT_TIMEOUT_RECONF), |
2579 |
+ asoc->state, asoc->ep, asoc, |
2580 |
+diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c |
2581 |
+index 798fbd89ed42f..a0a82d9a59008 100644 |
2582 |
+--- a/net/sunrpc/xprtsock.c |
2583 |
++++ b/net/sunrpc/xprtsock.c |
2584 |
+@@ -2974,9 +2974,6 @@ static struct rpc_xprt *xs_setup_local(struct xprt_create *args) |
2585 |
+ } |
2586 |
+ xprt_set_bound(xprt); |
2587 |
+ xs_format_peer_addresses(xprt, "local", RPCBIND_NETID_LOCAL); |
2588 |
+- ret = ERR_PTR(xs_local_setup_socket(transport)); |
2589 |
+- if (ret) |
2590 |
+- goto out_err; |
2591 |
+ break; |
2592 |
+ default: |
2593 |
+ ret = ERR_PTR(-EAFNOSUPPORT); |
2594 |
+diff --git a/sound/firewire/fireworks/fireworks_hwdep.c b/sound/firewire/fireworks/fireworks_hwdep.c |
2595 |
+index 5cac26ab20b71..e9209f44cb500 100644 |
2596 |
+--- a/sound/firewire/fireworks/fireworks_hwdep.c |
2597 |
++++ b/sound/firewire/fireworks/fireworks_hwdep.c |
2598 |
+@@ -35,6 +35,7 @@ hwdep_read_resp_buf(struct snd_efw *efw, char __user *buf, long remained, |
2599 |
+ type = SNDRV_FIREWIRE_EVENT_EFW_RESPONSE; |
2600 |
+ if (copy_to_user(buf, &type, sizeof(type))) |
2601 |
+ return -EFAULT; |
2602 |
++ count += sizeof(type); |
2603 |
+ remained -= sizeof(type); |
2604 |
+ buf += sizeof(type); |
2605 |
+ |
2606 |
+diff --git a/sound/soc/codecs/wm8731.c b/sound/soc/codecs/wm8731.c |
2607 |
+index 7c8fad865d6b0..3c5c02b034a99 100644 |
2608 |
+--- a/sound/soc/codecs/wm8731.c |
2609 |
++++ b/sound/soc/codecs/wm8731.c |
2610 |
+@@ -604,7 +604,7 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731) |
2611 |
+ ret = wm8731_reset(wm8731->regmap); |
2612 |
+ if (ret < 0) { |
2613 |
+ dev_err(dev, "Failed to issue reset: %d\n", ret); |
2614 |
+- goto err_regulator_enable; |
2615 |
++ goto err; |
2616 |
+ } |
2617 |
+ |
2618 |
+ /* Clear POWEROFF, keep everything else disabled */ |
2619 |
+@@ -621,10 +621,7 @@ static int wm8731_hw_init(struct device *dev, struct wm8731_priv *wm8731) |
2620 |
+ |
2621 |
+ regcache_mark_dirty(wm8731->regmap); |
2622 |
+ |
2623 |
+-err_regulator_enable: |
2624 |
+- /* Regulators will be enabled by bias management */ |
2625 |
+- regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); |
2626 |
+- |
2627 |
++err: |
2628 |
+ return ret; |
2629 |
+ } |
2630 |
+ |
2631 |
+@@ -768,21 +765,27 @@ static int wm8731_i2c_probe(struct i2c_client *i2c, |
2632 |
+ ret = PTR_ERR(wm8731->regmap); |
2633 |
+ dev_err(&i2c->dev, "Failed to allocate register map: %d\n", |
2634 |
+ ret); |
2635 |
+- return ret; |
2636 |
++ goto err_regulator_enable; |
2637 |
+ } |
2638 |
+ |
2639 |
+ ret = wm8731_hw_init(&i2c->dev, wm8731); |
2640 |
+ if (ret != 0) |
2641 |
+- return ret; |
2642 |
++ goto err_regulator_enable; |
2643 |
+ |
2644 |
+ ret = devm_snd_soc_register_component(&i2c->dev, |
2645 |
+ &soc_component_dev_wm8731, &wm8731_dai, 1); |
2646 |
+ if (ret != 0) { |
2647 |
+ dev_err(&i2c->dev, "Failed to register CODEC: %d\n", ret); |
2648 |
+- return ret; |
2649 |
++ goto err_regulator_enable; |
2650 |
+ } |
2651 |
+ |
2652 |
+ return 0; |
2653 |
++ |
2654 |
++err_regulator_enable: |
2655 |
++ /* Regulators will be enabled by bias management */ |
2656 |
++ regulator_bulk_disable(ARRAY_SIZE(wm8731->supplies), wm8731->supplies); |
2657 |
++ |
2658 |
++ return ret; |
2659 |
+ } |
2660 |
+ |
2661 |
+ static int wm8731_i2c_remove(struct i2c_client *client) |
2662 |
+diff --git a/sound/soc/codecs/wm8958-dsp2.c b/sound/soc/codecs/wm8958-dsp2.c |
2663 |
+index f0a409504a13b..91de7ff3a5a8f 100644 |
2664 |
+--- a/sound/soc/codecs/wm8958-dsp2.c |
2665 |
++++ b/sound/soc/codecs/wm8958-dsp2.c |
2666 |
+@@ -537,7 +537,7 @@ static int wm8958_mbc_put(struct snd_kcontrol *kcontrol, |
2667 |
+ |
2668 |
+ wm8958_dsp_apply(component, mbc, wm8994->mbc_ena[mbc]); |
2669 |
+ |
2670 |
+- return 0; |
2671 |
++ return 1; |
2672 |
+ } |
2673 |
+ |
2674 |
+ #define WM8958_MBC_SWITCH(xname, xval) {\ |
2675 |
+@@ -663,7 +663,7 @@ static int wm8958_vss_put(struct snd_kcontrol *kcontrol, |
2676 |
+ |
2677 |
+ wm8958_dsp_apply(component, vss, wm8994->vss_ena[vss]); |
2678 |
+ |
2679 |
+- return 0; |
2680 |
++ return 1; |
2681 |
+ } |
2682 |
+ |
2683 |
+ |
2684 |
+@@ -737,7 +737,7 @@ static int wm8958_hpf_put(struct snd_kcontrol *kcontrol, |
2685 |
+ |
2686 |
+ wm8958_dsp_apply(component, hpf % 3, ucontrol->value.integer.value[0]); |
2687 |
+ |
2688 |
+- return 0; |
2689 |
++ return 1; |
2690 |
+ } |
2691 |
+ |
2692 |
+ #define WM8958_HPF_SWITCH(xname, xval) {\ |
2693 |
+@@ -831,7 +831,7 @@ static int wm8958_enh_eq_put(struct snd_kcontrol *kcontrol, |
2694 |
+ |
2695 |
+ wm8958_dsp_apply(component, eq, ucontrol->value.integer.value[0]); |
2696 |
+ |
2697 |
+- return 0; |
2698 |
++ return 1; |
2699 |
+ } |
2700 |
+ |
2701 |
+ #define WM8958_ENH_EQ_SWITCH(xname, xval) {\ |
2702 |
+diff --git a/sound/soc/soc-generic-dmaengine-pcm.c b/sound/soc/soc-generic-dmaengine-pcm.c |
2703 |
+index 45cce7376191c..232df04ca5866 100644 |
2704 |
+--- a/sound/soc/soc-generic-dmaengine-pcm.c |
2705 |
++++ b/sound/soc/soc-generic-dmaengine-pcm.c |
2706 |
+@@ -91,10 +91,10 @@ static int dmaengine_pcm_hw_params(struct snd_pcm_substream *substream, |
2707 |
+ |
2708 |
+ memset(&slave_config, 0, sizeof(slave_config)); |
2709 |
+ |
2710 |
+- if (pcm->config && pcm->config->prepare_slave_config) |
2711 |
+- prepare_slave_config = pcm->config->prepare_slave_config; |
2712 |
+- else |
2713 |
++ if (!pcm->config) |
2714 |
+ prepare_slave_config = snd_dmaengine_pcm_prepare_slave_config; |
2715 |
++ else |
2716 |
++ prepare_slave_config = pcm->config->prepare_slave_config; |
2717 |
+ |
2718 |
+ if (prepare_slave_config) { |
2719 |
+ ret = prepare_slave_config(substream, params, &slave_config); |
2720 |
+diff --git a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh |
2721 |
+index a3402cd8d5b68..9ff22f28032dd 100755 |
2722 |
+--- a/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh |
2723 |
++++ b/tools/testing/selftests/net/forwarding/mirror_gre_bridge_1q.sh |
2724 |
+@@ -61,9 +61,12 @@ setup_prepare() |
2725 |
+ |
2726 |
+ vrf_prepare |
2727 |
+ mirror_gre_topo_create |
2728 |
++ # Avoid changing br1's PVID while it is operational as a L3 interface. |
2729 |
++ ip link set dev br1 down |
2730 |
+ |
2731 |
+ ip link set dev $swp3 master br1 |
2732 |
+ bridge vlan add dev br1 vid 555 pvid untagged self |
2733 |
++ ip link set dev br1 up |
2734 |
+ ip address add dev br1 192.0.2.129/28 |
2735 |
+ ip address add dev br1 2001:db8:2::1/64 |
2736 |
+ |