1 |
commit: 6f107043194e328026b3274be0327224670b1922 |
2 |
Author: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
3 |
AuthorDate: Fri Aug 3 12:25:33 2018 +0000 |
4 |
Commit: Mike Pagano <mpagano <AT> gentoo <DOT> org> |
5 |
CommitDate: Fri Aug 3 12:25:33 2018 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=6f107043 |
7 |
|
8 |
Linux patch 4.9.117 |
9 |
|
10 |
0000_README | 4 + |
11 |
1116_linux-4.9.117.patch | 3610 ++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 3614 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index 320185b..6be74fa 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -507,6 +507,10 @@ Patch: 1115_linux-4.9.116.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.9.116 |
21 |
|
22 |
+Patch: 1116_linux-4.9.117.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.9.117 |
25 |
+ |
26 |
Patch: 1500_XATTR_USER_PREFIX.patch |
27 |
From: https://bugs.gentoo.org/show_bug.cgi?id=470644 |
28 |
Desc: Support for namespace user.pax.* on tmpfs. |
29 |
|
30 |
diff --git a/1116_linux-4.9.117.patch b/1116_linux-4.9.117.patch |
31 |
new file mode 100644 |
32 |
index 0000000..0c2ee0f |
33 |
--- /dev/null |
34 |
+++ b/1116_linux-4.9.117.patch |
35 |
@@ -0,0 +1,3610 @@ |
36 |
+diff --git a/Documentation/devicetree/bindings/net/dsa/qca8k.txt b/Documentation/devicetree/bindings/net/dsa/qca8k.txt |
37 |
+index 9c67ee4890d7..bbcb255c3150 100644 |
38 |
+--- a/Documentation/devicetree/bindings/net/dsa/qca8k.txt |
39 |
++++ b/Documentation/devicetree/bindings/net/dsa/qca8k.txt |
40 |
+@@ -2,7 +2,10 @@ |
41 |
+ |
42 |
+ Required properties: |
43 |
+ |
44 |
+-- compatible: should be "qca,qca8337" |
45 |
++- compatible: should be one of: |
46 |
++ "qca,qca8334" |
47 |
++ "qca,qca8337" |
48 |
++ |
49 |
+ - #size-cells: must be 0 |
50 |
+ - #address-cells: must be 1 |
51 |
+ |
52 |
+@@ -14,6 +17,20 @@ port and PHY id, each subnode describing a port needs to have a valid phandle |
53 |
+ referencing the internal PHY connected to it. The CPU port of this switch is |
54 |
+ always port 0. |
55 |
+ |
56 |
++A CPU port node has the following optional node: |
57 |
++ |
58 |
++- fixed-link : Fixed-link subnode describing a link to a non-MDIO |
59 |
++ managed entity. See |
60 |
++ Documentation/devicetree/bindings/net/fixed-link.txt |
61 |
++ for details. |
62 |
++ |
63 |
++For QCA8K the 'fixed-link' sub-node supports only the following properties: |
64 |
++ |
65 |
++- 'speed' (integer, mandatory), to indicate the link speed. Accepted |
66 |
++ values are 10, 100 and 1000 |
67 |
++- 'full-duplex' (boolean, optional), to indicate that full duplex is |
68 |
++ used. When absent, half duplex is assumed. |
69 |
++ |
70 |
+ Example: |
71 |
+ |
72 |
+ |
73 |
+@@ -53,6 +70,10 @@ Example: |
74 |
+ label = "cpu"; |
75 |
+ ethernet = <&gmac1>; |
76 |
+ phy-mode = "rgmii"; |
77 |
++ fixed-link { |
78 |
++ speed = 1000; |
79 |
++ full-duplex; |
80 |
++ }; |
81 |
+ }; |
82 |
+ |
83 |
+ port@1 { |
84 |
+diff --git a/Documentation/devicetree/bindings/net/meson-dwmac.txt b/Documentation/devicetree/bindings/net/meson-dwmac.txt |
85 |
+index 89e62ddc69ca..da37da0fdd3f 100644 |
86 |
+--- a/Documentation/devicetree/bindings/net/meson-dwmac.txt |
87 |
++++ b/Documentation/devicetree/bindings/net/meson-dwmac.txt |
88 |
+@@ -10,6 +10,7 @@ Required properties on all platforms: |
89 |
+ - "amlogic,meson6-dwmac" |
90 |
+ - "amlogic,meson8b-dwmac" |
91 |
+ - "amlogic,meson-gxbb-dwmac" |
92 |
++ - "amlogic,meson-axg-dwmac" |
93 |
+ Additionally "snps,dwmac" and any applicable more |
94 |
+ detailed version number described in net/stmmac.txt |
95 |
+ should be used. |
96 |
+diff --git a/Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt b/Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt |
97 |
+index fe7fe0b03cfb..1b9881786ce9 100644 |
98 |
+--- a/Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt |
99 |
++++ b/Documentation/devicetree/bindings/pinctrl/meson,pinctrl.txt |
100 |
+@@ -3,8 +3,10 @@ |
101 |
+ Required properties for the root node: |
102 |
+ - compatible: one of "amlogic,meson8-cbus-pinctrl" |
103 |
+ "amlogic,meson8b-cbus-pinctrl" |
104 |
++ "amlogic,meson8m2-cbus-pinctrl" |
105 |
+ "amlogic,meson8-aobus-pinctrl" |
106 |
+ "amlogic,meson8b-aobus-pinctrl" |
107 |
++ "amlogic,meson8m2-aobus-pinctrl" |
108 |
+ "amlogic,meson-gxbb-periphs-pinctrl" |
109 |
+ "amlogic,meson-gxbb-aobus-pinctrl" |
110 |
+ - reg: address and size of registers controlling irq functionality |
111 |
+diff --git a/Makefile b/Makefile |
112 |
+index a6b011778960..773c26c95d98 100644 |
113 |
+--- a/Makefile |
114 |
++++ b/Makefile |
115 |
+@@ -1,6 +1,6 @@ |
116 |
+ VERSION = 4 |
117 |
+ PATCHLEVEL = 9 |
118 |
+-SUBLEVEL = 116 |
119 |
++SUBLEVEL = 117 |
120 |
+ EXTRAVERSION = |
121 |
+ NAME = Roaring Lionus |
122 |
+ |
123 |
+diff --git a/arch/arm/boot/dts/emev2.dtsi b/arch/arm/boot/dts/emev2.dtsi |
124 |
+index cd119400f440..fd6f9ce9206a 100644 |
125 |
+--- a/arch/arm/boot/dts/emev2.dtsi |
126 |
++++ b/arch/arm/boot/dts/emev2.dtsi |
127 |
+@@ -30,13 +30,13 @@ |
128 |
+ #address-cells = <1>; |
129 |
+ #size-cells = <0>; |
130 |
+ |
131 |
+- cpu@0 { |
132 |
++ cpu0: cpu@0 { |
133 |
+ device_type = "cpu"; |
134 |
+ compatible = "arm,cortex-a9"; |
135 |
+ reg = <0>; |
136 |
+ clock-frequency = <533000000>; |
137 |
+ }; |
138 |
+- cpu@1 { |
139 |
++ cpu1: cpu@1 { |
140 |
+ device_type = "cpu"; |
141 |
+ compatible = "arm,cortex-a9"; |
142 |
+ reg = <1>; |
143 |
+@@ -56,6 +56,7 @@ |
144 |
+ compatible = "arm,cortex-a9-pmu"; |
145 |
+ interrupts = <GIC_SPI 120 IRQ_TYPE_LEVEL_HIGH>, |
146 |
+ <GIC_SPI 121 IRQ_TYPE_LEVEL_HIGH>; |
147 |
++ interrupt-affinity = <&cpu0>, <&cpu1>; |
148 |
+ }; |
149 |
+ |
150 |
+ clocks@e0110000 { |
151 |
+diff --git a/arch/arm/boot/dts/sh73a0.dtsi b/arch/arm/boot/dts/sh73a0.dtsi |
152 |
+index 032fe2f14b16..6b0cc225149c 100644 |
153 |
+--- a/arch/arm/boot/dts/sh73a0.dtsi |
154 |
++++ b/arch/arm/boot/dts/sh73a0.dtsi |
155 |
+@@ -22,7 +22,7 @@ |
156 |
+ #address-cells = <1>; |
157 |
+ #size-cells = <0>; |
158 |
+ |
159 |
+- cpu@0 { |
160 |
++ cpu0: cpu@0 { |
161 |
+ device_type = "cpu"; |
162 |
+ compatible = "arm,cortex-a9"; |
163 |
+ reg = <0>; |
164 |
+@@ -30,7 +30,7 @@ |
165 |
+ power-domains = <&pd_a2sl>; |
166 |
+ next-level-cache = <&L2>; |
167 |
+ }; |
168 |
+- cpu@1 { |
169 |
++ cpu1: cpu@1 { |
170 |
+ device_type = "cpu"; |
171 |
+ compatible = "arm,cortex-a9"; |
172 |
+ reg = <1>; |
173 |
+@@ -89,6 +89,7 @@ |
174 |
+ compatible = "arm,cortex-a9-pmu"; |
175 |
+ interrupts = <GIC_SPI 55 IRQ_TYPE_LEVEL_HIGH>, |
176 |
+ <GIC_SPI 56 IRQ_TYPE_LEVEL_HIGH>; |
177 |
++ interrupt-affinity = <&cpu0>, <&cpu1>; |
178 |
+ }; |
179 |
+ |
180 |
+ cmt1: timer@e6138000 { |
181 |
+diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig |
182 |
+index dab2cb0c1f1c..b4c4d823569a 100644 |
183 |
+--- a/arch/arm64/configs/defconfig |
184 |
++++ b/arch/arm64/configs/defconfig |
185 |
+@@ -260,6 +260,8 @@ CONFIG_GPIO_XGENE=y |
186 |
+ CONFIG_GPIO_PCA953X=y |
187 |
+ CONFIG_GPIO_PCA953X_IRQ=y |
188 |
+ CONFIG_GPIO_MAX77620=y |
189 |
++CONFIG_POWER_AVS=y |
190 |
++CONFIG_ROCKCHIP_IODOMAIN=y |
191 |
+ CONFIG_POWER_RESET_MSM=y |
192 |
+ CONFIG_BATTERY_BQ27XXX=y |
193 |
+ CONFIG_POWER_RESET_XGENE=y |
194 |
+diff --git a/arch/arm64/include/asm/cmpxchg.h b/arch/arm64/include/asm/cmpxchg.h |
195 |
+index ae852add053d..0f2e1ab5e166 100644 |
196 |
+--- a/arch/arm64/include/asm/cmpxchg.h |
197 |
++++ b/arch/arm64/include/asm/cmpxchg.h |
198 |
+@@ -229,7 +229,9 @@ static inline void __cmpwait_case_##name(volatile void *ptr, \ |
199 |
+ unsigned long tmp; \ |
200 |
+ \ |
201 |
+ asm volatile( \ |
202 |
+- " ldxr" #sz "\t%" #w "[tmp], %[v]\n" \ |
203 |
++ " sevl\n" \ |
204 |
++ " wfe\n" \ |
205 |
++ " ldxr" #sz "\t%" #w "[tmp], %[v]\n" \ |
206 |
+ " eor %" #w "[tmp], %" #w "[tmp], %" #w "[val]\n" \ |
207 |
+ " cbnz %" #w "[tmp], 1f\n" \ |
208 |
+ " wfe\n" \ |
209 |
+diff --git a/arch/arm64/mm/init.c b/arch/arm64/mm/init.c |
210 |
+index 9b8b477c363d..9d07b421f090 100644 |
211 |
+--- a/arch/arm64/mm/init.c |
212 |
++++ b/arch/arm64/mm/init.c |
213 |
+@@ -468,11 +468,13 @@ void __init mem_init(void) |
214 |
+ BUILD_BUG_ON(TASK_SIZE_32 > TASK_SIZE_64); |
215 |
+ #endif |
216 |
+ |
217 |
++#ifdef CONFIG_SPARSEMEM_VMEMMAP |
218 |
+ /* |
219 |
+ * Make sure we chose the upper bound of sizeof(struct page) |
220 |
+- * correctly. |
221 |
++ * correctly when sizing the VMEMMAP array. |
222 |
+ */ |
223 |
+ BUILD_BUG_ON(sizeof(struct page) > (1 << STRUCT_PAGE_MAX_SHIFT)); |
224 |
++#endif |
225 |
+ |
226 |
+ if (PAGE_SIZE >= 16384 && get_num_physpages() <= 128) { |
227 |
+ extern int sysctl_overcommit_memory; |
228 |
+diff --git a/arch/microblaze/boot/Makefile b/arch/microblaze/boot/Makefile |
229 |
+index 91d2068da1b9..0f3fe6a151dc 100644 |
230 |
+--- a/arch/microblaze/boot/Makefile |
231 |
++++ b/arch/microblaze/boot/Makefile |
232 |
+@@ -21,17 +21,19 @@ $(obj)/linux.bin.gz: $(obj)/linux.bin FORCE |
233 |
+ quiet_cmd_cp = CP $< $@$2 |
234 |
+ cmd_cp = cat $< >$@$2 || (rm -f $@ && echo false) |
235 |
+ |
236 |
+-quiet_cmd_strip = STRIP $@ |
237 |
++quiet_cmd_strip = STRIP $< $@$2 |
238 |
+ cmd_strip = $(STRIP) -K microblaze_start -K _end -K __log_buf \ |
239 |
+- -K _fdt_start vmlinux -o $@ |
240 |
++ -K _fdt_start $< -o $@$2 |
241 |
+ |
242 |
+ UIMAGE_LOADADDR = $(CONFIG_KERNEL_BASE_ADDR) |
243 |
++UIMAGE_IN = $@ |
244 |
++UIMAGE_OUT = $@.ub |
245 |
+ |
246 |
+ $(obj)/simpleImage.%: vmlinux FORCE |
247 |
+ $(call if_changed,cp,.unstrip) |
248 |
+ $(call if_changed,objcopy) |
249 |
+ $(call if_changed,uimage) |
250 |
+- $(call if_changed,strip) |
251 |
+- @echo 'Kernel: $@ is ready' ' (#'`cat .version`')' |
252 |
++ $(call if_changed,strip,.strip) |
253 |
++ @echo 'Kernel: $(UIMAGE_OUT) is ready' ' (#'`cat .version`')' |
254 |
+ |
255 |
+ clean-files += simpleImage.*.unstrip linux.bin.ub dts/*.dtb |
256 |
+diff --git a/arch/powerpc/kernel/eeh_driver.c b/arch/powerpc/kernel/eeh_driver.c |
257 |
+index 27843665da9e..620e08d4eb6e 100644 |
258 |
+--- a/arch/powerpc/kernel/eeh_driver.c |
259 |
++++ b/arch/powerpc/kernel/eeh_driver.c |
260 |
+@@ -450,9 +450,11 @@ static void *eeh_add_virt_device(void *data, void *userdata) |
261 |
+ |
262 |
+ driver = eeh_pcid_get(dev); |
263 |
+ if (driver) { |
264 |
+- eeh_pcid_put(dev); |
265 |
+- if (driver->err_handler) |
266 |
++ if (driver->err_handler) { |
267 |
++ eeh_pcid_put(dev); |
268 |
+ return NULL; |
269 |
++ } |
270 |
++ eeh_pcid_put(dev); |
271 |
+ } |
272 |
+ |
273 |
+ #ifdef CONFIG_PPC_POWERNV |
274 |
+@@ -489,17 +491,19 @@ static void *eeh_rmv_device(void *data, void *userdata) |
275 |
+ if (eeh_dev_removed(edev)) |
276 |
+ return NULL; |
277 |
+ |
278 |
+- driver = eeh_pcid_get(dev); |
279 |
+- if (driver) { |
280 |
+- eeh_pcid_put(dev); |
281 |
+- if (removed && |
282 |
+- eeh_pe_passed(edev->pe)) |
283 |
+- return NULL; |
284 |
+- if (removed && |
285 |
+- driver->err_handler && |
286 |
+- driver->err_handler->error_detected && |
287 |
+- driver->err_handler->slot_reset) |
288 |
++ if (removed) { |
289 |
++ if (eeh_pe_passed(edev->pe)) |
290 |
+ return NULL; |
291 |
++ driver = eeh_pcid_get(dev); |
292 |
++ if (driver) { |
293 |
++ if (driver->err_handler && |
294 |
++ driver->err_handler->error_detected && |
295 |
++ driver->err_handler->slot_reset) { |
296 |
++ eeh_pcid_put(dev); |
297 |
++ return NULL; |
298 |
++ } |
299 |
++ eeh_pcid_put(dev); |
300 |
++ } |
301 |
+ } |
302 |
+ |
303 |
+ /* Remove it from PCI subsystem */ |
304 |
+diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/head_8xx.S |
305 |
+index fb133a163263..2274be535dda 100644 |
306 |
+--- a/arch/powerpc/kernel/head_8xx.S |
307 |
++++ b/arch/powerpc/kernel/head_8xx.S |
308 |
+@@ -769,7 +769,7 @@ start_here: |
309 |
+ tovirt(r6,r6) |
310 |
+ lis r5, abatron_pteptrs@h |
311 |
+ ori r5, r5, abatron_pteptrs@l |
312 |
+- stw r5, 0xf0(r0) /* Must match your Abatron config file */ |
313 |
++ stw r5, 0xf0(0) /* Must match your Abatron config file */ |
314 |
+ tophys(r5,r5) |
315 |
+ stw r6, 0(r5) |
316 |
+ |
317 |
+diff --git a/arch/powerpc/kernel/pci_32.c b/arch/powerpc/kernel/pci_32.c |
318 |
+index 678f87a63645..97b02b8c4f10 100644 |
319 |
+--- a/arch/powerpc/kernel/pci_32.c |
320 |
++++ b/arch/powerpc/kernel/pci_32.c |
321 |
+@@ -11,6 +11,7 @@ |
322 |
+ #include <linux/sched.h> |
323 |
+ #include <linux/errno.h> |
324 |
+ #include <linux/bootmem.h> |
325 |
++#include <linux/syscalls.h> |
326 |
+ #include <linux/irq.h> |
327 |
+ #include <linux/list.h> |
328 |
+ #include <linux/of.h> |
329 |
+diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c |
330 |
+index 48fc28bab544..64c9a91773af 100644 |
331 |
+--- a/arch/powerpc/mm/slb.c |
332 |
++++ b/arch/powerpc/mm/slb.c |
333 |
+@@ -68,14 +68,14 @@ static inline void slb_shadow_update(unsigned long ea, int ssize, |
334 |
+ * updating it. No write barriers are needed here, provided |
335 |
+ * we only update the current CPU's SLB shadow buffer. |
336 |
+ */ |
337 |
+- p->save_area[index].esid = 0; |
338 |
+- p->save_area[index].vsid = cpu_to_be64(mk_vsid_data(ea, ssize, flags)); |
339 |
+- p->save_area[index].esid = cpu_to_be64(mk_esid_data(ea, ssize, index)); |
340 |
++ WRITE_ONCE(p->save_area[index].esid, 0); |
341 |
++ WRITE_ONCE(p->save_area[index].vsid, cpu_to_be64(mk_vsid_data(ea, ssize, flags))); |
342 |
++ WRITE_ONCE(p->save_area[index].esid, cpu_to_be64(mk_esid_data(ea, ssize, index))); |
343 |
+ } |
344 |
+ |
345 |
+ static inline void slb_shadow_clear(enum slb_index index) |
346 |
+ { |
347 |
+- get_slb_shadow()->save_area[index].esid = 0; |
348 |
++ WRITE_ONCE(get_slb_shadow()->save_area[index].esid, 0); |
349 |
+ } |
350 |
+ |
351 |
+ static inline void create_shadowed_slbe(unsigned long ea, int ssize, |
352 |
+diff --git a/arch/powerpc/net/bpf_jit_comp64.c b/arch/powerpc/net/bpf_jit_comp64.c |
353 |
+index be9d968244ad..c0e817f35e69 100644 |
354 |
+--- a/arch/powerpc/net/bpf_jit_comp64.c |
355 |
++++ b/arch/powerpc/net/bpf_jit_comp64.c |
356 |
+@@ -207,25 +207,37 @@ static void bpf_jit_build_epilogue(u32 *image, struct codegen_context *ctx) |
357 |
+ |
358 |
+ static void bpf_jit_emit_func_call(u32 *image, struct codegen_context *ctx, u64 func) |
359 |
+ { |
360 |
++ unsigned int i, ctx_idx = ctx->idx; |
361 |
++ |
362 |
++ /* Load function address into r12 */ |
363 |
++ PPC_LI64(12, func); |
364 |
++ |
365 |
++ /* For bpf-to-bpf function calls, the callee's address is unknown |
366 |
++ * until the last extra pass. As seen above, we use PPC_LI64() to |
367 |
++ * load the callee's address, but this may optimize the number of |
368 |
++ * instructions required based on the nature of the address. |
369 |
++ * |
370 |
++ * Since we don't want the number of instructions emitted to change, |
371 |
++ * we pad the optimized PPC_LI64() call with NOPs to guarantee that |
372 |
++ * we always have a five-instruction sequence, which is the maximum |
373 |
++ * that PPC_LI64() can emit. |
374 |
++ */ |
375 |
++ for (i = ctx->idx - ctx_idx; i < 5; i++) |
376 |
++ PPC_NOP(); |
377 |
++ |
378 |
+ #ifdef PPC64_ELF_ABI_v1 |
379 |
+- /* func points to the function descriptor */ |
380 |
+- PPC_LI64(b2p[TMP_REG_2], func); |
381 |
+- /* Load actual entry point from function descriptor */ |
382 |
+- PPC_BPF_LL(b2p[TMP_REG_1], b2p[TMP_REG_2], 0); |
383 |
+- /* ... and move it to LR */ |
384 |
+- PPC_MTLR(b2p[TMP_REG_1]); |
385 |
+ /* |
386 |
+ * Load TOC from function descriptor at offset 8. |
387 |
+ * We can clobber r2 since we get called through a |
388 |
+ * function pointer (so caller will save/restore r2) |
389 |
+ * and since we don't use a TOC ourself. |
390 |
+ */ |
391 |
+- PPC_BPF_LL(2, b2p[TMP_REG_2], 8); |
392 |
+-#else |
393 |
+- /* We can clobber r12 */ |
394 |
+- PPC_FUNC_ADDR(12, func); |
395 |
+- PPC_MTLR(12); |
396 |
++ PPC_BPF_LL(2, 12, 8); |
397 |
++ /* Load actual entry point from function descriptor */ |
398 |
++ PPC_BPF_LL(12, 12, 0); |
399 |
+ #endif |
400 |
++ |
401 |
++ PPC_MTLR(12); |
402 |
+ PPC_BLRL(); |
403 |
+ } |
404 |
+ |
405 |
+diff --git a/arch/powerpc/platforms/chrp/time.c b/arch/powerpc/platforms/chrp/time.c |
406 |
+index f803f4b8ab6f..8608e358217f 100644 |
407 |
+--- a/arch/powerpc/platforms/chrp/time.c |
408 |
++++ b/arch/powerpc/platforms/chrp/time.c |
409 |
+@@ -27,6 +27,8 @@ |
410 |
+ #include <asm/sections.h> |
411 |
+ #include <asm/time.h> |
412 |
+ |
413 |
++#include <platforms/chrp/chrp.h> |
414 |
++ |
415 |
+ extern spinlock_t rtc_lock; |
416 |
+ |
417 |
+ #define NVRAM_AS0 0x74 |
418 |
+@@ -62,7 +64,7 @@ long __init chrp_time_init(void) |
419 |
+ return 0; |
420 |
+ } |
421 |
+ |
422 |
+-int chrp_cmos_clock_read(int addr) |
423 |
++static int chrp_cmos_clock_read(int addr) |
424 |
+ { |
425 |
+ if (nvram_as1 != 0) |
426 |
+ outb(addr>>8, nvram_as1); |
427 |
+@@ -70,7 +72,7 @@ int chrp_cmos_clock_read(int addr) |
428 |
+ return (inb(nvram_data)); |
429 |
+ } |
430 |
+ |
431 |
+-void chrp_cmos_clock_write(unsigned long val, int addr) |
432 |
++static void chrp_cmos_clock_write(unsigned long val, int addr) |
433 |
+ { |
434 |
+ if (nvram_as1 != 0) |
435 |
+ outb(addr>>8, nvram_as1); |
436 |
+diff --git a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c |
437 |
+index 89c54de88b7a..bf4a125faec6 100644 |
438 |
+--- a/arch/powerpc/platforms/embedded6xx/hlwd-pic.c |
439 |
++++ b/arch/powerpc/platforms/embedded6xx/hlwd-pic.c |
440 |
+@@ -35,6 +35,8 @@ |
441 |
+ */ |
442 |
+ #define HW_BROADWAY_ICR 0x00 |
443 |
+ #define HW_BROADWAY_IMR 0x04 |
444 |
++#define HW_STARLET_ICR 0x08 |
445 |
++#define HW_STARLET_IMR 0x0c |
446 |
+ |
447 |
+ |
448 |
+ /* |
449 |
+@@ -74,6 +76,9 @@ static void hlwd_pic_unmask(struct irq_data *d) |
450 |
+ void __iomem *io_base = irq_data_get_irq_chip_data(d); |
451 |
+ |
452 |
+ setbits32(io_base + HW_BROADWAY_IMR, 1 << irq); |
453 |
++ |
454 |
++ /* Make sure the ARM (aka. Starlet) doesn't handle this interrupt. */ |
455 |
++ clrbits32(io_base + HW_STARLET_IMR, 1 << irq); |
456 |
+ } |
457 |
+ |
458 |
+ |
459 |
+diff --git a/arch/powerpc/platforms/powermac/bootx_init.c b/arch/powerpc/platforms/powermac/bootx_init.c |
460 |
+index c3c9bbb3573a..ba0964c17620 100644 |
461 |
+--- a/arch/powerpc/platforms/powermac/bootx_init.c |
462 |
++++ b/arch/powerpc/platforms/powermac/bootx_init.c |
463 |
+@@ -468,7 +468,7 @@ void __init bootx_init(unsigned long r3, unsigned long r4) |
464 |
+ boot_infos_t *bi = (boot_infos_t *) r4; |
465 |
+ unsigned long hdr; |
466 |
+ unsigned long space; |
467 |
+- unsigned long ptr, x; |
468 |
++ unsigned long ptr; |
469 |
+ char *model; |
470 |
+ unsigned long offset = reloc_offset(); |
471 |
+ |
472 |
+@@ -562,6 +562,8 @@ void __init bootx_init(unsigned long r3, unsigned long r4) |
473 |
+ * MMU switched OFF, so this should not be useful anymore. |
474 |
+ */ |
475 |
+ if (bi->version < 4) { |
476 |
++ unsigned long x __maybe_unused; |
477 |
++ |
478 |
+ bootx_printf("Touching pages...\n"); |
479 |
+ |
480 |
+ /* |
481 |
+diff --git a/arch/powerpc/platforms/powermac/setup.c b/arch/powerpc/platforms/powermac/setup.c |
482 |
+index 6b4e9d181126..4929dd4b165e 100644 |
483 |
+--- a/arch/powerpc/platforms/powermac/setup.c |
484 |
++++ b/arch/powerpc/platforms/powermac/setup.c |
485 |
+@@ -352,6 +352,7 @@ static int pmac_late_init(void) |
486 |
+ } |
487 |
+ machine_late_initcall(powermac, pmac_late_init); |
488 |
+ |
489 |
++void note_bootable_part(dev_t dev, int part, int goodness); |
490 |
+ /* |
491 |
+ * This is __ref because we check for "initializing" before |
492 |
+ * touching any of the __init sensitive things and "initializing" |
493 |
+diff --git a/arch/s390/include/asm/cpu_mf.h b/arch/s390/include/asm/cpu_mf.h |
494 |
+index 03516476127b..ee64e624c511 100644 |
495 |
+--- a/arch/s390/include/asm/cpu_mf.h |
496 |
++++ b/arch/s390/include/asm/cpu_mf.h |
497 |
+@@ -113,7 +113,7 @@ struct hws_basic_entry { |
498 |
+ |
499 |
+ struct hws_diag_entry { |
500 |
+ unsigned int def:16; /* 0-15 Data Entry Format */ |
501 |
+- unsigned int R:14; /* 16-19 and 20-30 reserved */ |
502 |
++ unsigned int R:15; /* 16-19 and 20-30 reserved */ |
503 |
+ unsigned int I:1; /* 31 entry valid or invalid */ |
504 |
+ u8 data[]; /* Machine-dependent sample data */ |
505 |
+ } __packed; |
506 |
+@@ -129,7 +129,9 @@ struct hws_trailer_entry { |
507 |
+ unsigned int f:1; /* 0 - Block Full Indicator */ |
508 |
+ unsigned int a:1; /* 1 - Alert request control */ |
509 |
+ unsigned int t:1; /* 2 - Timestamp format */ |
510 |
+- unsigned long long:61; /* 3 - 63: Reserved */ |
511 |
++ unsigned int :29; /* 3 - 31: Reserved */ |
512 |
++ unsigned int bsdes:16; /* 32-47: size of basic SDE */ |
513 |
++ unsigned int dsdes:16; /* 48-63: size of diagnostic SDE */ |
514 |
+ }; |
515 |
+ unsigned long long flags; /* 0 - 63: All indicators */ |
516 |
+ }; |
517 |
+diff --git a/arch/x86/events/intel/uncore.c b/arch/x86/events/intel/uncore.c |
518 |
+index aec6cc925af8..4f365267b12f 100644 |
519 |
+--- a/arch/x86/events/intel/uncore.c |
520 |
++++ b/arch/x86/events/intel/uncore.c |
521 |
+@@ -212,7 +212,7 @@ void uncore_perf_event_update(struct intel_uncore_box *box, struct perf_event *e |
522 |
+ u64 prev_count, new_count, delta; |
523 |
+ int shift; |
524 |
+ |
525 |
+- if (event->hw.idx >= UNCORE_PMC_IDX_FIXED) |
526 |
++ if (event->hw.idx == UNCORE_PMC_IDX_FIXED) |
527 |
+ shift = 64 - uncore_fixed_ctr_bits(box); |
528 |
+ else |
529 |
+ shift = 64 - uncore_perf_ctr_bits(box); |
530 |
+diff --git a/arch/x86/events/intel/uncore_nhmex.c b/arch/x86/events/intel/uncore_nhmex.c |
531 |
+index cda569332005..83e2188adac4 100644 |
532 |
+--- a/arch/x86/events/intel/uncore_nhmex.c |
533 |
++++ b/arch/x86/events/intel/uncore_nhmex.c |
534 |
+@@ -245,7 +245,7 @@ static void nhmex_uncore_msr_enable_event(struct intel_uncore_box *box, struct p |
535 |
+ { |
536 |
+ struct hw_perf_event *hwc = &event->hw; |
537 |
+ |
538 |
+- if (hwc->idx >= UNCORE_PMC_IDX_FIXED) |
539 |
++ if (hwc->idx == UNCORE_PMC_IDX_FIXED) |
540 |
+ wrmsrl(hwc->config_base, NHMEX_PMON_CTL_EN_BIT0); |
541 |
+ else if (box->pmu->type->event_mask & NHMEX_PMON_CTL_EN_BIT0) |
542 |
+ wrmsrl(hwc->config_base, hwc->config | NHMEX_PMON_CTL_EN_BIT22); |
543 |
+diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c |
544 |
+index a16c06604a56..8a4d6bc8fed0 100644 |
545 |
+--- a/arch/x86/kvm/mmu.c |
546 |
++++ b/arch/x86/kvm/mmu.c |
547 |
+@@ -698,7 +698,7 @@ static int mmu_topup_memory_cache_page(struct kvm_mmu_memory_cache *cache, |
548 |
+ if (cache->nobjs >= min) |
549 |
+ return 0; |
550 |
+ while (cache->nobjs < ARRAY_SIZE(cache->objects)) { |
551 |
+- page = (void *)__get_free_page(GFP_KERNEL); |
552 |
++ page = (void *)__get_free_page(GFP_KERNEL_ACCOUNT); |
553 |
+ if (!page) |
554 |
+ return -ENOMEM; |
555 |
+ cache->objects[cache->nobjs++] = page; |
556 |
+diff --git a/crypto/authenc.c b/crypto/authenc.c |
557 |
+index a7e1ac786c5d..c3180eb6d1ee 100644 |
558 |
+--- a/crypto/authenc.c |
559 |
++++ b/crypto/authenc.c |
560 |
+@@ -108,6 +108,7 @@ static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key, |
561 |
+ CRYPTO_TFM_RES_MASK); |
562 |
+ |
563 |
+ out: |
564 |
++ memzero_explicit(&keys, sizeof(keys)); |
565 |
+ return err; |
566 |
+ |
567 |
+ badkey: |
568 |
+diff --git a/crypto/authencesn.c b/crypto/authencesn.c |
569 |
+index 18c94e1c31d1..49e7e85a23d5 100644 |
570 |
+--- a/crypto/authencesn.c |
571 |
++++ b/crypto/authencesn.c |
572 |
+@@ -90,6 +90,7 @@ static int crypto_authenc_esn_setkey(struct crypto_aead *authenc_esn, const u8 * |
573 |
+ CRYPTO_TFM_RES_MASK); |
574 |
+ |
575 |
+ out: |
576 |
++ memzero_explicit(&keys, sizeof(keys)); |
577 |
+ return err; |
578 |
+ |
579 |
+ badkey: |
580 |
+diff --git a/drivers/acpi/pci_root.c b/drivers/acpi/pci_root.c |
581 |
+index bf601d4df8cf..b66815f35be6 100644 |
582 |
+--- a/drivers/acpi/pci_root.c |
583 |
++++ b/drivers/acpi/pci_root.c |
584 |
+@@ -472,9 +472,11 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm) |
585 |
+ } |
586 |
+ |
587 |
+ control = OSC_PCI_EXPRESS_CAPABILITY_CONTROL |
588 |
+- | OSC_PCI_EXPRESS_NATIVE_HP_CONTROL |
589 |
+ | OSC_PCI_EXPRESS_PME_CONTROL; |
590 |
+ |
591 |
++ if (IS_ENABLED(CONFIG_HOTPLUG_PCI_PCIE)) |
592 |
++ control |= OSC_PCI_EXPRESS_NATIVE_HP_CONTROL; |
593 |
++ |
594 |
+ if (pci_aer_available()) { |
595 |
+ if (aer_acpi_firmware_first()) |
596 |
+ dev_info(&device->dev, |
597 |
+diff --git a/drivers/ata/libata-eh.c b/drivers/ata/libata-eh.c |
598 |
+index 6475a1343483..90c38778bc1f 100644 |
599 |
+--- a/drivers/ata/libata-eh.c |
600 |
++++ b/drivers/ata/libata-eh.c |
601 |
+@@ -2282,12 +2282,16 @@ static void ata_eh_link_autopsy(struct ata_link *link) |
602 |
+ if (qc->err_mask & ~AC_ERR_OTHER) |
603 |
+ qc->err_mask &= ~AC_ERR_OTHER; |
604 |
+ |
605 |
+- /* SENSE_VALID trumps dev/unknown error and revalidation */ |
606 |
++ /* |
607 |
++ * SENSE_VALID trumps dev/unknown error and revalidation. Upper |
608 |
++ * layers will determine whether the command is worth retrying |
609 |
++ * based on the sense data and device class/type. Otherwise, |
610 |
++ * determine directly if the command is worth retrying using its |
611 |
++ * error mask and flags. |
612 |
++ */ |
613 |
+ if (qc->flags & ATA_QCFLAG_SENSE_VALID) |
614 |
+ qc->err_mask &= ~(AC_ERR_DEV | AC_ERR_OTHER); |
615 |
+- |
616 |
+- /* determine whether the command is worth retrying */ |
617 |
+- if (ata_eh_worth_retry(qc)) |
618 |
++ else if (ata_eh_worth_retry(qc)) |
619 |
+ qc->flags |= ATA_QCFLAG_RETRY; |
620 |
+ |
621 |
+ /* accumulate error info */ |
622 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
623 |
+index bff67c5a5fe7..44bccb1afa06 100644 |
624 |
+--- a/drivers/bluetooth/btusb.c |
625 |
++++ b/drivers/bluetooth/btusb.c |
626 |
+@@ -348,6 +348,9 @@ static const struct usb_device_id blacklist_table[] = { |
627 |
+ /* Additional Realtek 8723BU Bluetooth devices */ |
628 |
+ { USB_DEVICE(0x7392, 0xa611), .driver_info = BTUSB_REALTEK }, |
629 |
+ |
630 |
++ /* Additional Realtek 8723DE Bluetooth devices */ |
631 |
++ { USB_DEVICE(0x2ff8, 0xb011), .driver_info = BTUSB_REALTEK }, |
632 |
++ |
633 |
+ /* Additional Realtek 8821AE Bluetooth devices */ |
634 |
+ { USB_DEVICE(0x0b05, 0x17dc), .driver_info = BTUSB_REALTEK }, |
635 |
+ { USB_DEVICE(0x13d3, 0x3414), .driver_info = BTUSB_REALTEK }, |
636 |
+diff --git a/drivers/bluetooth/hci_qca.c b/drivers/bluetooth/hci_qca.c |
637 |
+index 3a8b9aef96a6..0986c324459f 100644 |
638 |
+--- a/drivers/bluetooth/hci_qca.c |
639 |
++++ b/drivers/bluetooth/hci_qca.c |
640 |
+@@ -884,7 +884,7 @@ static int qca_set_baudrate(struct hci_dev *hdev, uint8_t baudrate) |
641 |
+ */ |
642 |
+ set_current_state(TASK_UNINTERRUPTIBLE); |
643 |
+ schedule_timeout(msecs_to_jiffies(BAUDRATE_SETTLE_TIMEOUT_MS)); |
644 |
+- set_current_state(TASK_INTERRUPTIBLE); |
645 |
++ set_current_state(TASK_RUNNING); |
646 |
+ |
647 |
+ return 0; |
648 |
+ } |
649 |
+diff --git a/drivers/bus/arm-ccn.c b/drivers/bus/arm-ccn.c |
650 |
+index 45d7ecc66b22..4e9e9e618c9f 100644 |
651 |
+--- a/drivers/bus/arm-ccn.c |
652 |
++++ b/drivers/bus/arm-ccn.c |
653 |
+@@ -736,7 +736,7 @@ static int arm_ccn_pmu_event_init(struct perf_event *event) |
654 |
+ ccn = pmu_to_arm_ccn(event->pmu); |
655 |
+ |
656 |
+ if (hw->sample_period) { |
657 |
+- dev_warn(ccn->dev, "Sampling not supported!\n"); |
658 |
++ dev_dbg(ccn->dev, "Sampling not supported!\n"); |
659 |
+ return -EOPNOTSUPP; |
660 |
+ } |
661 |
+ |
662 |
+@@ -744,12 +744,12 @@ static int arm_ccn_pmu_event_init(struct perf_event *event) |
663 |
+ event->attr.exclude_kernel || event->attr.exclude_hv || |
664 |
+ event->attr.exclude_idle || event->attr.exclude_host || |
665 |
+ event->attr.exclude_guest) { |
666 |
+- dev_warn(ccn->dev, "Can't exclude execution levels!\n"); |
667 |
++ dev_dbg(ccn->dev, "Can't exclude execution levels!\n"); |
668 |
+ return -EINVAL; |
669 |
+ } |
670 |
+ |
671 |
+ if (event->cpu < 0) { |
672 |
+- dev_warn(ccn->dev, "Can't provide per-task data!\n"); |
673 |
++ dev_dbg(ccn->dev, "Can't provide per-task data!\n"); |
674 |
+ return -EOPNOTSUPP; |
675 |
+ } |
676 |
+ /* |
677 |
+@@ -771,13 +771,13 @@ static int arm_ccn_pmu_event_init(struct perf_event *event) |
678 |
+ switch (type) { |
679 |
+ case CCN_TYPE_MN: |
680 |
+ if (node_xp != ccn->mn_id) { |
681 |
+- dev_warn(ccn->dev, "Invalid MN ID %d!\n", node_xp); |
682 |
++ dev_dbg(ccn->dev, "Invalid MN ID %d!\n", node_xp); |
683 |
+ return -EINVAL; |
684 |
+ } |
685 |
+ break; |
686 |
+ case CCN_TYPE_XP: |
687 |
+ if (node_xp >= ccn->num_xps) { |
688 |
+- dev_warn(ccn->dev, "Invalid XP ID %d!\n", node_xp); |
689 |
++ dev_dbg(ccn->dev, "Invalid XP ID %d!\n", node_xp); |
690 |
+ return -EINVAL; |
691 |
+ } |
692 |
+ break; |
693 |
+@@ -785,11 +785,11 @@ static int arm_ccn_pmu_event_init(struct perf_event *event) |
694 |
+ break; |
695 |
+ default: |
696 |
+ if (node_xp >= ccn->num_nodes) { |
697 |
+- dev_warn(ccn->dev, "Invalid node ID %d!\n", node_xp); |
698 |
++ dev_dbg(ccn->dev, "Invalid node ID %d!\n", node_xp); |
699 |
+ return -EINVAL; |
700 |
+ } |
701 |
+ if (!arm_ccn_pmu_type_eq(type, ccn->node[node_xp].type)) { |
702 |
+- dev_warn(ccn->dev, "Invalid type 0x%x for node %d!\n", |
703 |
++ dev_dbg(ccn->dev, "Invalid type 0x%x for node %d!\n", |
704 |
+ type, node_xp); |
705 |
+ return -EINVAL; |
706 |
+ } |
707 |
+@@ -808,19 +808,19 @@ static int arm_ccn_pmu_event_init(struct perf_event *event) |
708 |
+ if (event_id != e->event) |
709 |
+ continue; |
710 |
+ if (e->num_ports && port >= e->num_ports) { |
711 |
+- dev_warn(ccn->dev, "Invalid port %d for node/XP %d!\n", |
712 |
++ dev_dbg(ccn->dev, "Invalid port %d for node/XP %d!\n", |
713 |
+ port, node_xp); |
714 |
+ return -EINVAL; |
715 |
+ } |
716 |
+ if (e->num_vcs && vc >= e->num_vcs) { |
717 |
+- dev_warn(ccn->dev, "Invalid vc %d for node/XP %d!\n", |
718 |
++ dev_dbg(ccn->dev, "Invalid vc %d for node/XP %d!\n", |
719 |
+ vc, node_xp); |
720 |
+ return -EINVAL; |
721 |
+ } |
722 |
+ valid = 1; |
723 |
+ } |
724 |
+ if (!valid) { |
725 |
+- dev_warn(ccn->dev, "Invalid event 0x%x for node/XP %d!\n", |
726 |
++ dev_dbg(ccn->dev, "Invalid event 0x%x for node/XP %d!\n", |
727 |
+ event_id, node_xp); |
728 |
+ return -EINVAL; |
729 |
+ } |
730 |
+diff --git a/drivers/char/random.c b/drivers/char/random.c |
731 |
+index ddeac4eefd0a..81b65d0e7563 100644 |
732 |
+--- a/drivers/char/random.c |
733 |
++++ b/drivers/char/random.c |
734 |
+@@ -1826,14 +1826,22 @@ static int |
735 |
+ write_pool(struct entropy_store *r, const char __user *buffer, size_t count) |
736 |
+ { |
737 |
+ size_t bytes; |
738 |
+- __u32 buf[16]; |
739 |
++ __u32 t, buf[16]; |
740 |
+ const char __user *p = buffer; |
741 |
+ |
742 |
+ while (count > 0) { |
743 |
++ int b, i = 0; |
744 |
++ |
745 |
+ bytes = min(count, sizeof(buf)); |
746 |
+ if (copy_from_user(&buf, p, bytes)) |
747 |
+ return -EFAULT; |
748 |
+ |
749 |
++ for (b = bytes ; b > 0 ; b -= sizeof(__u32), i++) { |
750 |
++ if (!arch_get_random_int(&t)) |
751 |
++ break; |
752 |
++ buf[i] ^= t; |
753 |
++ } |
754 |
++ |
755 |
+ count -= bytes; |
756 |
+ p += bytes; |
757 |
+ |
758 |
+diff --git a/drivers/edac/altera_edac.c b/drivers/edac/altera_edac.c |
759 |
+index 61262a7a5c3a..b0bd0f64d8f2 100644 |
760 |
+--- a/drivers/edac/altera_edac.c |
761 |
++++ b/drivers/edac/altera_edac.c |
762 |
+@@ -1111,7 +1111,7 @@ static void *ocram_alloc_mem(size_t size, void **other) |
763 |
+ |
764 |
+ static void ocram_free_mem(void *p, size_t size, void *other) |
765 |
+ { |
766 |
+- gen_pool_free((struct gen_pool *)other, (u32)p, size); |
767 |
++ gen_pool_free((struct gen_pool *)other, (unsigned long)p, size); |
768 |
+ } |
769 |
+ |
770 |
+ static const struct edac_device_prv_data ocramecc_data = { |
771 |
+diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c |
772 |
+index 34adde169a78..dd6fff1c98d6 100644 |
773 |
+--- a/drivers/gpu/drm/drm_atomic.c |
774 |
++++ b/drivers/gpu/drm/drm_atomic.c |
775 |
+@@ -1091,7 +1091,9 @@ drm_atomic_set_crtc_for_plane(struct drm_plane_state *plane_state, |
776 |
+ { |
777 |
+ struct drm_plane *plane = plane_state->plane; |
778 |
+ struct drm_crtc_state *crtc_state; |
779 |
+- |
780 |
++ /* Nothing to do for same crtc*/ |
781 |
++ if (plane_state->crtc == crtc) |
782 |
++ return 0; |
783 |
+ if (plane_state->crtc) { |
784 |
+ crtc_state = drm_atomic_get_crtc_state(plane_state->state, |
785 |
+ plane_state->crtc); |
786 |
+diff --git a/drivers/gpu/drm/gma500/psb_intel_drv.h b/drivers/gpu/drm/gma500/psb_intel_drv.h |
787 |
+index 2a3b7c684db2..fbd3fa340c4f 100644 |
788 |
+--- a/drivers/gpu/drm/gma500/psb_intel_drv.h |
789 |
++++ b/drivers/gpu/drm/gma500/psb_intel_drv.h |
790 |
+@@ -255,7 +255,7 @@ extern int intelfb_remove(struct drm_device *dev, |
791 |
+ extern bool psb_intel_lvds_mode_fixup(struct drm_encoder *encoder, |
792 |
+ const struct drm_display_mode *mode, |
793 |
+ struct drm_display_mode *adjusted_mode); |
794 |
+-extern int psb_intel_lvds_mode_valid(struct drm_connector *connector, |
795 |
++extern enum drm_mode_status psb_intel_lvds_mode_valid(struct drm_connector *connector, |
796 |
+ struct drm_display_mode *mode); |
797 |
+ extern int psb_intel_lvds_set_property(struct drm_connector *connector, |
798 |
+ struct drm_property *property, |
799 |
+diff --git a/drivers/gpu/drm/gma500/psb_intel_lvds.c b/drivers/gpu/drm/gma500/psb_intel_lvds.c |
800 |
+index 79e9d3690667..e2c6ba3eded4 100644 |
801 |
+--- a/drivers/gpu/drm/gma500/psb_intel_lvds.c |
802 |
++++ b/drivers/gpu/drm/gma500/psb_intel_lvds.c |
803 |
+@@ -343,7 +343,7 @@ static void psb_intel_lvds_restore(struct drm_connector *connector) |
804 |
+ } |
805 |
+ } |
806 |
+ |
807 |
+-int psb_intel_lvds_mode_valid(struct drm_connector *connector, |
808 |
++enum drm_mode_status psb_intel_lvds_mode_valid(struct drm_connector *connector, |
809 |
+ struct drm_display_mode *mode) |
810 |
+ { |
811 |
+ struct drm_psb_private *dev_priv = connector->dev->dev_private; |
812 |
+diff --git a/drivers/gpu/drm/radeon/radeon_connectors.c b/drivers/gpu/drm/radeon/radeon_connectors.c |
813 |
+index f416f5c2e8e9..c5e1aa5f1d8e 100644 |
814 |
+--- a/drivers/gpu/drm/radeon/radeon_connectors.c |
815 |
++++ b/drivers/gpu/drm/radeon/radeon_connectors.c |
816 |
+@@ -850,7 +850,7 @@ static int radeon_lvds_get_modes(struct drm_connector *connector) |
817 |
+ return ret; |
818 |
+ } |
819 |
+ |
820 |
+-static int radeon_lvds_mode_valid(struct drm_connector *connector, |
821 |
++static enum drm_mode_status radeon_lvds_mode_valid(struct drm_connector *connector, |
822 |
+ struct drm_display_mode *mode) |
823 |
+ { |
824 |
+ struct drm_encoder *encoder = radeon_best_single_encoder(connector); |
825 |
+@@ -1010,7 +1010,7 @@ static int radeon_vga_get_modes(struct drm_connector *connector) |
826 |
+ return ret; |
827 |
+ } |
828 |
+ |
829 |
+-static int radeon_vga_mode_valid(struct drm_connector *connector, |
830 |
++static enum drm_mode_status radeon_vga_mode_valid(struct drm_connector *connector, |
831 |
+ struct drm_display_mode *mode) |
832 |
+ { |
833 |
+ struct drm_device *dev = connector->dev; |
834 |
+@@ -1154,7 +1154,7 @@ static int radeon_tv_get_modes(struct drm_connector *connector) |
835 |
+ return 1; |
836 |
+ } |
837 |
+ |
838 |
+-static int radeon_tv_mode_valid(struct drm_connector *connector, |
839 |
++static enum drm_mode_status radeon_tv_mode_valid(struct drm_connector *connector, |
840 |
+ struct drm_display_mode *mode) |
841 |
+ { |
842 |
+ if ((mode->hdisplay > 1024) || (mode->vdisplay > 768)) |
843 |
+@@ -1496,7 +1496,7 @@ static void radeon_dvi_force(struct drm_connector *connector) |
844 |
+ radeon_connector->use_digital = true; |
845 |
+ } |
846 |
+ |
847 |
+-static int radeon_dvi_mode_valid(struct drm_connector *connector, |
848 |
++static enum drm_mode_status radeon_dvi_mode_valid(struct drm_connector *connector, |
849 |
+ struct drm_display_mode *mode) |
850 |
+ { |
851 |
+ struct drm_device *dev = connector->dev; |
852 |
+@@ -1798,7 +1798,7 @@ out: |
853 |
+ return ret; |
854 |
+ } |
855 |
+ |
856 |
+-static int radeon_dp_mode_valid(struct drm_connector *connector, |
857 |
++static enum drm_mode_status radeon_dp_mode_valid(struct drm_connector *connector, |
858 |
+ struct drm_display_mode *mode) |
859 |
+ { |
860 |
+ struct drm_device *dev = connector->dev; |
861 |
+diff --git a/drivers/hid/hid-plantronics.c b/drivers/hid/hid-plantronics.c |
862 |
+index febb21ee190e..584b10d3fc3d 100644 |
863 |
+--- a/drivers/hid/hid-plantronics.c |
864 |
++++ b/drivers/hid/hid-plantronics.c |
865 |
+@@ -2,7 +2,7 @@ |
866 |
+ * Plantronics USB HID Driver |
867 |
+ * |
868 |
+ * Copyright (c) 2014 JD Cole <jd.cole@×××××××××××.com> |
869 |
+- * Copyright (c) 2015 Terry Junge <terry.junge@×××××××××××.com> |
870 |
++ * Copyright (c) 2015-2018 Terry Junge <terry.junge@×××××××××××.com> |
871 |
+ */ |
872 |
+ |
873 |
+ /* |
874 |
+@@ -48,6 +48,10 @@ static int plantronics_input_mapping(struct hid_device *hdev, |
875 |
+ unsigned short mapped_key; |
876 |
+ unsigned long plt_type = (unsigned long)hid_get_drvdata(hdev); |
877 |
+ |
878 |
++ /* special case for PTT products */ |
879 |
++ if (field->application == HID_GD_JOYSTICK) |
880 |
++ goto defaulted; |
881 |
++ |
882 |
+ /* handle volume up/down mapping */ |
883 |
+ /* non-standard types or multi-HID interfaces - plt_type is PID */ |
884 |
+ if (!(plt_type & HID_USAGE_PAGE)) { |
885 |
+diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c |
886 |
+index 00bce002b357..ce2b80009c19 100644 |
887 |
+--- a/drivers/hid/i2c-hid/i2c-hid.c |
888 |
++++ b/drivers/hid/i2c-hid/i2c-hid.c |
889 |
+@@ -1101,6 +1101,14 @@ static int i2c_hid_probe(struct i2c_client *client, |
890 |
+ pm_runtime_enable(&client->dev); |
891 |
+ device_enable_async_suspend(&client->dev); |
892 |
+ |
893 |
++ /* Make sure there is something at this address */ |
894 |
++ ret = i2c_smbus_read_byte(client); |
895 |
++ if (ret < 0) { |
896 |
++ dev_dbg(&client->dev, "nothing at this address: %d\n", ret); |
897 |
++ ret = -ENXIO; |
898 |
++ goto err_pm; |
899 |
++ } |
900 |
++ |
901 |
+ ret = i2c_hid_fetch_hid_descriptor(ihid); |
902 |
+ if (ret < 0) |
903 |
+ goto err_pm; |
904 |
+diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c |
905 |
+index 2395fe2021c9..3e2ab04201e2 100644 |
906 |
+--- a/drivers/infiniband/core/mad.c |
907 |
++++ b/drivers/infiniband/core/mad.c |
908 |
+@@ -1549,7 +1549,8 @@ static int add_oui_reg_req(struct ib_mad_reg_req *mad_reg_req, |
909 |
+ mad_reg_req->oui, 3)) { |
910 |
+ method = &(*vendor_table)->vendor_class[ |
911 |
+ vclass]->method_table[i]; |
912 |
+- BUG_ON(!*method); |
913 |
++ if (!*method) |
914 |
++ goto error3; |
915 |
+ goto check_in_use; |
916 |
+ } |
917 |
+ } |
918 |
+@@ -1559,10 +1560,12 @@ static int add_oui_reg_req(struct ib_mad_reg_req *mad_reg_req, |
919 |
+ vclass]->oui[i])) { |
920 |
+ method = &(*vendor_table)->vendor_class[ |
921 |
+ vclass]->method_table[i]; |
922 |
+- BUG_ON(*method); |
923 |
+ /* Allocate method table for this OUI */ |
924 |
+- if ((ret = allocate_method_table(method))) |
925 |
+- goto error3; |
926 |
++ if (!*method) { |
927 |
++ ret = allocate_method_table(method); |
928 |
++ if (ret) |
929 |
++ goto error3; |
930 |
++ } |
931 |
+ memcpy((*vendor_table)->vendor_class[vclass]->oui[i], |
932 |
+ mad_reg_req->oui, 3); |
933 |
+ goto check_in_use; |
934 |
+diff --git a/drivers/infiniband/core/ucma.c b/drivers/infiniband/core/ucma.c |
935 |
+index a036d7087ddf..3bef6d4ffe6f 100644 |
936 |
+--- a/drivers/infiniband/core/ucma.c |
937 |
++++ b/drivers/infiniband/core/ucma.c |
938 |
+@@ -218,7 +218,7 @@ static struct ucma_multicast* ucma_alloc_multicast(struct ucma_context *ctx) |
939 |
+ return NULL; |
940 |
+ |
941 |
+ mutex_lock(&mut); |
942 |
+- mc->id = idr_alloc(&multicast_idr, mc, 0, 0, GFP_KERNEL); |
943 |
++ mc->id = idr_alloc(&multicast_idr, NULL, 0, 0, GFP_KERNEL); |
944 |
+ mutex_unlock(&mut); |
945 |
+ if (mc->id < 0) |
946 |
+ goto error; |
947 |
+@@ -1385,6 +1385,10 @@ static ssize_t ucma_process_join(struct ucma_file *file, |
948 |
+ goto err3; |
949 |
+ } |
950 |
+ |
951 |
++ mutex_lock(&mut); |
952 |
++ idr_replace(&multicast_idr, mc, mc->id); |
953 |
++ mutex_unlock(&mut); |
954 |
++ |
955 |
+ mutex_unlock(&file->mut); |
956 |
+ ucma_put_ctx(ctx); |
957 |
+ return 0; |
958 |
+diff --git a/drivers/infiniband/core/uverbs_cmd.c b/drivers/infiniband/core/uverbs_cmd.c |
959 |
+index 4b717cf50d27..6f875bf9cc9d 100644 |
960 |
+--- a/drivers/infiniband/core/uverbs_cmd.c |
961 |
++++ b/drivers/infiniband/core/uverbs_cmd.c |
962 |
+@@ -3725,6 +3725,11 @@ int ib_uverbs_ex_create_flow(struct ib_uverbs_file *file, |
963 |
+ goto err_uobj; |
964 |
+ } |
965 |
+ |
966 |
++ if (qp->qp_type != IB_QPT_UD && qp->qp_type != IB_QPT_RAW_PACKET) { |
967 |
++ err = -EINVAL; |
968 |
++ goto err_put; |
969 |
++ } |
970 |
++ |
971 |
+ flow_attr = kzalloc(sizeof(*flow_attr) + cmd.flow_attr.num_of_specs * |
972 |
+ sizeof(union ib_flow_spec), GFP_KERNEL); |
973 |
+ if (!flow_attr) { |
974 |
+diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c |
975 |
+index 97f6e05cffce..a716482774db 100644 |
976 |
+--- a/drivers/input/mouse/elan_i2c_core.c |
977 |
++++ b/drivers/input/mouse/elan_i2c_core.c |
978 |
+@@ -1251,6 +1251,8 @@ static const struct acpi_device_id elan_acpi_id[] = { |
979 |
+ { "ELAN0611", 0 }, |
980 |
+ { "ELAN0612", 0 }, |
981 |
+ { "ELAN0618", 0 }, |
982 |
++ { "ELAN061D", 0 }, |
983 |
++ { "ELAN0622", 0 }, |
984 |
+ { "ELAN1000", 0 }, |
985 |
+ { } |
986 |
+ }; |
987 |
+diff --git a/drivers/input/serio/i8042-x86ia64io.h b/drivers/input/serio/i8042-x86ia64io.h |
988 |
+index e484ea2dc787..34be09651ee8 100644 |
989 |
+--- a/drivers/input/serio/i8042-x86ia64io.h |
990 |
++++ b/drivers/input/serio/i8042-x86ia64io.h |
991 |
+@@ -527,6 +527,13 @@ static const struct dmi_system_id __initconst i8042_dmi_nomux_table[] = { |
992 |
+ DMI_MATCH(DMI_PRODUCT_NAME, "N24_25BU"), |
993 |
+ }, |
994 |
+ }, |
995 |
++ { |
996 |
++ /* Lenovo LaVie Z */ |
997 |
++ .matches = { |
998 |
++ DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), |
999 |
++ DMI_MATCH(DMI_PRODUCT_VERSION, "Lenovo LaVie Z"), |
1000 |
++ }, |
1001 |
++ }, |
1002 |
+ { } |
1003 |
+ }; |
1004 |
+ |
1005 |
+diff --git a/drivers/md/md.c b/drivers/md/md.c |
1006 |
+index 3bb985679f34..a7a0e3acdb2f 100644 |
1007 |
+--- a/drivers/md/md.c |
1008 |
++++ b/drivers/md/md.c |
1009 |
+@@ -6192,6 +6192,9 @@ static int hot_remove_disk(struct mddev *mddev, dev_t dev) |
1010 |
+ char b[BDEVNAME_SIZE]; |
1011 |
+ struct md_rdev *rdev; |
1012 |
+ |
1013 |
++ if (!mddev->pers) |
1014 |
++ return -ENODEV; |
1015 |
++ |
1016 |
+ rdev = find_rdev(mddev, dev); |
1017 |
+ if (!rdev) |
1018 |
+ return -ENXIO; |
1019 |
+diff --git a/drivers/media/common/siano/smsendian.c b/drivers/media/common/siano/smsendian.c |
1020 |
+index bfe831c10b1c..b95a631f23f9 100644 |
1021 |
+--- a/drivers/media/common/siano/smsendian.c |
1022 |
++++ b/drivers/media/common/siano/smsendian.c |
1023 |
+@@ -35,7 +35,7 @@ void smsendian_handle_tx_message(void *buffer) |
1024 |
+ switch (msg->x_msg_header.msg_type) { |
1025 |
+ case MSG_SMS_DATA_DOWNLOAD_REQ: |
1026 |
+ { |
1027 |
+- msg->msg_data[0] = le32_to_cpu(msg->msg_data[0]); |
1028 |
++ msg->msg_data[0] = le32_to_cpu((__force __le32)(msg->msg_data[0])); |
1029 |
+ break; |
1030 |
+ } |
1031 |
+ |
1032 |
+@@ -44,7 +44,7 @@ void smsendian_handle_tx_message(void *buffer) |
1033 |
+ sizeof(struct sms_msg_hdr))/4; |
1034 |
+ |
1035 |
+ for (i = 0; i < msg_words; i++) |
1036 |
+- msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]); |
1037 |
++ msg->msg_data[i] = le32_to_cpu((__force __le32)msg->msg_data[i]); |
1038 |
+ |
1039 |
+ break; |
1040 |
+ } |
1041 |
+@@ -64,7 +64,7 @@ void smsendian_handle_rx_message(void *buffer) |
1042 |
+ { |
1043 |
+ struct sms_version_res *ver = |
1044 |
+ (struct sms_version_res *) msg; |
1045 |
+- ver->chip_model = le16_to_cpu(ver->chip_model); |
1046 |
++ ver->chip_model = le16_to_cpu((__force __le16)ver->chip_model); |
1047 |
+ break; |
1048 |
+ } |
1049 |
+ |
1050 |
+@@ -81,7 +81,7 @@ void smsendian_handle_rx_message(void *buffer) |
1051 |
+ sizeof(struct sms_msg_hdr))/4; |
1052 |
+ |
1053 |
+ for (i = 0; i < msg_words; i++) |
1054 |
+- msg->msg_data[i] = le32_to_cpu(msg->msg_data[i]); |
1055 |
++ msg->msg_data[i] = le32_to_cpu((__force __le32)msg->msg_data[i]); |
1056 |
+ |
1057 |
+ break; |
1058 |
+ } |
1059 |
+@@ -95,9 +95,9 @@ void smsendian_handle_message_header(void *msg) |
1060 |
+ #ifdef __BIG_ENDIAN |
1061 |
+ struct sms_msg_hdr *phdr = (struct sms_msg_hdr *)msg; |
1062 |
+ |
1063 |
+- phdr->msg_type = le16_to_cpu(phdr->msg_type); |
1064 |
+- phdr->msg_length = le16_to_cpu(phdr->msg_length); |
1065 |
+- phdr->msg_flags = le16_to_cpu(phdr->msg_flags); |
1066 |
++ phdr->msg_type = le16_to_cpu((__force __le16)phdr->msg_type); |
1067 |
++ phdr->msg_length = le16_to_cpu((__force __le16)phdr->msg_length); |
1068 |
++ phdr->msg_flags = le16_to_cpu((__force __le16)phdr->msg_flags); |
1069 |
+ #endif /* __BIG_ENDIAN */ |
1070 |
+ } |
1071 |
+ EXPORT_SYMBOL_GPL(smsendian_handle_message_header); |
1072 |
+diff --git a/drivers/media/i2c/smiapp/smiapp-core.c b/drivers/media/i2c/smiapp/smiapp-core.c |
1073 |
+index 44f8c7e10a35..8ffa13f39a86 100644 |
1074 |
+--- a/drivers/media/i2c/smiapp/smiapp-core.c |
1075 |
++++ b/drivers/media/i2c/smiapp/smiapp-core.c |
1076 |
+@@ -991,7 +991,7 @@ static int smiapp_read_nvm(struct smiapp_sensor *sensor, |
1077 |
+ if (rval) |
1078 |
+ goto out; |
1079 |
+ |
1080 |
+- for (i = 0; i < 1000; i++) { |
1081 |
++ for (i = 1000; i > 0; i--) { |
1082 |
+ rval = smiapp_read( |
1083 |
+ sensor, |
1084 |
+ SMIAPP_REG_U8_DATA_TRANSFER_IF_1_STATUS, &s); |
1085 |
+@@ -1002,11 +1002,10 @@ static int smiapp_read_nvm(struct smiapp_sensor *sensor, |
1086 |
+ if (s & SMIAPP_DATA_TRANSFER_IF_1_STATUS_RD_READY) |
1087 |
+ break; |
1088 |
+ |
1089 |
+- if (--i == 0) { |
1090 |
+- rval = -ETIMEDOUT; |
1091 |
+- goto out; |
1092 |
+- } |
1093 |
+- |
1094 |
++ } |
1095 |
++ if (!i) { |
1096 |
++ rval = -ETIMEDOUT; |
1097 |
++ goto out; |
1098 |
+ } |
1099 |
+ |
1100 |
+ for (i = 0; i < SMIAPP_NVM_PAGE_SIZE; i++) { |
1101 |
+diff --git a/drivers/media/media-device.c b/drivers/media/media-device.c |
1102 |
+index 4462d8c69d57..6f46c59415fe 100644 |
1103 |
+--- a/drivers/media/media-device.c |
1104 |
++++ b/drivers/media/media-device.c |
1105 |
+@@ -58,9 +58,10 @@ static int media_device_close(struct file *filp) |
1106 |
+ return 0; |
1107 |
+ } |
1108 |
+ |
1109 |
+-static int media_device_get_info(struct media_device *dev, |
1110 |
+- struct media_device_info *info) |
1111 |
++static long media_device_get_info(struct media_device *dev, void *arg) |
1112 |
+ { |
1113 |
++ struct media_device_info *info = arg; |
1114 |
++ |
1115 |
+ memset(info, 0, sizeof(*info)); |
1116 |
+ |
1117 |
+ if (dev->driver_name[0]) |
1118 |
+@@ -97,9 +98,9 @@ static struct media_entity *find_entity(struct media_device *mdev, u32 id) |
1119 |
+ return NULL; |
1120 |
+ } |
1121 |
+ |
1122 |
+-static long media_device_enum_entities(struct media_device *mdev, |
1123 |
+- struct media_entity_desc *entd) |
1124 |
++static long media_device_enum_entities(struct media_device *mdev, void *arg) |
1125 |
+ { |
1126 |
++ struct media_entity_desc *entd = arg; |
1127 |
+ struct media_entity *ent; |
1128 |
+ |
1129 |
+ ent = find_entity(mdev, entd->id); |
1130 |
+@@ -150,9 +151,9 @@ static void media_device_kpad_to_upad(const struct media_pad *kpad, |
1131 |
+ upad->flags = kpad->flags; |
1132 |
+ } |
1133 |
+ |
1134 |
+-static long media_device_enum_links(struct media_device *mdev, |
1135 |
+- struct media_links_enum *links) |
1136 |
++static long media_device_enum_links(struct media_device *mdev, void *arg) |
1137 |
+ { |
1138 |
++ struct media_links_enum *links = arg; |
1139 |
+ struct media_entity *entity; |
1140 |
+ |
1141 |
+ entity = find_entity(mdev, links->entity); |
1142 |
+@@ -198,9 +199,9 @@ static long media_device_enum_links(struct media_device *mdev, |
1143 |
+ return 0; |
1144 |
+ } |
1145 |
+ |
1146 |
+-static long media_device_setup_link(struct media_device *mdev, |
1147 |
+- struct media_link_desc *linkd) |
1148 |
++static long media_device_setup_link(struct media_device *mdev, void *arg) |
1149 |
+ { |
1150 |
++ struct media_link_desc *linkd = arg; |
1151 |
+ struct media_link *link = NULL; |
1152 |
+ struct media_entity *source; |
1153 |
+ struct media_entity *sink; |
1154 |
+@@ -226,9 +227,9 @@ static long media_device_setup_link(struct media_device *mdev, |
1155 |
+ return __media_entity_setup_link(link, linkd->flags); |
1156 |
+ } |
1157 |
+ |
1158 |
+-static long media_device_get_topology(struct media_device *mdev, |
1159 |
+- struct media_v2_topology *topo) |
1160 |
++static long media_device_get_topology(struct media_device *mdev, void *arg) |
1161 |
+ { |
1162 |
++ struct media_v2_topology *topo = arg; |
1163 |
+ struct media_entity *entity; |
1164 |
+ struct media_interface *intf; |
1165 |
+ struct media_pad *pad; |
1166 |
+diff --git a/drivers/media/pci/saa7164/saa7164-fw.c b/drivers/media/pci/saa7164/saa7164-fw.c |
1167 |
+index 269e0782c7b6..93d53195e8ca 100644 |
1168 |
+--- a/drivers/media/pci/saa7164/saa7164-fw.c |
1169 |
++++ b/drivers/media/pci/saa7164/saa7164-fw.c |
1170 |
+@@ -430,7 +430,8 @@ int saa7164_downloadfirmware(struct saa7164_dev *dev) |
1171 |
+ __func__, fw->size); |
1172 |
+ |
1173 |
+ if (fw->size != fwlength) { |
1174 |
+- printk(KERN_ERR "xc5000: firmware incorrect size\n"); |
1175 |
++ printk(KERN_ERR "saa7164: firmware incorrect size %zu != %u\n", |
1176 |
++ fw->size, fwlength); |
1177 |
+ ret = -ENOMEM; |
1178 |
+ goto out; |
1179 |
+ } |
1180 |
+diff --git a/drivers/media/pci/tw686x/tw686x-video.c b/drivers/media/pci/tw686x/tw686x-video.c |
1181 |
+index c3fafa97b2d0..0ea8dd44026c 100644 |
1182 |
+--- a/drivers/media/pci/tw686x/tw686x-video.c |
1183 |
++++ b/drivers/media/pci/tw686x/tw686x-video.c |
1184 |
+@@ -1228,7 +1228,8 @@ int tw686x_video_init(struct tw686x_dev *dev) |
1185 |
+ vc->vidq.timestamp_flags = V4L2_BUF_FLAG_TIMESTAMP_MONOTONIC; |
1186 |
+ vc->vidq.min_buffers_needed = 2; |
1187 |
+ vc->vidq.lock = &vc->vb_mutex; |
1188 |
+- vc->vidq.gfp_flags = GFP_DMA32; |
1189 |
++ vc->vidq.gfp_flags = dev->dma_mode != TW686X_DMA_MODE_MEMCPY ? |
1190 |
++ GFP_DMA32 : 0; |
1191 |
+ vc->vidq.dev = &dev->pci_dev->dev; |
1192 |
+ |
1193 |
+ err = vb2_queue_init(&vc->vidq); |
1194 |
+diff --git a/drivers/media/platform/omap3isp/isp.c b/drivers/media/platform/omap3isp/isp.c |
1195 |
+index 0321d84addc7..15a86bb4e61c 100644 |
1196 |
+--- a/drivers/media/platform/omap3isp/isp.c |
1197 |
++++ b/drivers/media/platform/omap3isp/isp.c |
1198 |
+@@ -1941,6 +1941,7 @@ error_csiphy: |
1199 |
+ |
1200 |
+ static void isp_detach_iommu(struct isp_device *isp) |
1201 |
+ { |
1202 |
++ arm_iommu_detach_device(isp->dev); |
1203 |
+ arm_iommu_release_mapping(isp->mapping); |
1204 |
+ isp->mapping = NULL; |
1205 |
+ iommu_group_remove_device(isp->dev); |
1206 |
+@@ -1974,8 +1975,7 @@ static int isp_attach_iommu(struct isp_device *isp) |
1207 |
+ mapping = arm_iommu_create_mapping(&platform_bus_type, SZ_1G, SZ_2G); |
1208 |
+ if (IS_ERR(mapping)) { |
1209 |
+ dev_err(isp->dev, "failed to create ARM IOMMU mapping\n"); |
1210 |
+- ret = PTR_ERR(mapping); |
1211 |
+- goto error; |
1212 |
++ return PTR_ERR(mapping); |
1213 |
+ } |
1214 |
+ |
1215 |
+ isp->mapping = mapping; |
1216 |
+@@ -1990,7 +1990,8 @@ static int isp_attach_iommu(struct isp_device *isp) |
1217 |
+ return 0; |
1218 |
+ |
1219 |
+ error: |
1220 |
+- isp_detach_iommu(isp); |
1221 |
++ arm_iommu_release_mapping(isp->mapping); |
1222 |
++ isp->mapping = NULL; |
1223 |
+ return ret; |
1224 |
+ } |
1225 |
+ |
1226 |
+diff --git a/drivers/media/platform/rcar_jpu.c b/drivers/media/platform/rcar_jpu.c |
1227 |
+index d1746ecc645d..db1110a492e0 100644 |
1228 |
+--- a/drivers/media/platform/rcar_jpu.c |
1229 |
++++ b/drivers/media/platform/rcar_jpu.c |
1230 |
+@@ -1280,7 +1280,7 @@ static int jpu_open(struct file *file) |
1231 |
+ /* ...issue software reset */ |
1232 |
+ ret = jpu_reset(jpu); |
1233 |
+ if (ret) |
1234 |
+- goto device_prepare_rollback; |
1235 |
++ goto jpu_reset_rollback; |
1236 |
+ } |
1237 |
+ |
1238 |
+ jpu->ref_count++; |
1239 |
+@@ -1288,6 +1288,8 @@ static int jpu_open(struct file *file) |
1240 |
+ mutex_unlock(&jpu->mutex); |
1241 |
+ return 0; |
1242 |
+ |
1243 |
++jpu_reset_rollback: |
1244 |
++ clk_disable_unprepare(jpu->clk); |
1245 |
+ device_prepare_rollback: |
1246 |
+ mutex_unlock(&jpu->mutex); |
1247 |
+ v4l_prepare_rollback: |
1248 |
+diff --git a/drivers/media/radio/si470x/radio-si470x-i2c.c b/drivers/media/radio/si470x/radio-si470x-i2c.c |
1249 |
+index ee0470a3196b..f218886c504d 100644 |
1250 |
+--- a/drivers/media/radio/si470x/radio-si470x-i2c.c |
1251 |
++++ b/drivers/media/radio/si470x/radio-si470x-i2c.c |
1252 |
+@@ -96,7 +96,7 @@ MODULE_PARM_DESC(max_rds_errors, "RDS maximum block errors: *1*"); |
1253 |
+ */ |
1254 |
+ int si470x_get_register(struct si470x_device *radio, int regnr) |
1255 |
+ { |
1256 |
+- u16 buf[READ_REG_NUM]; |
1257 |
++ __be16 buf[READ_REG_NUM]; |
1258 |
+ struct i2c_msg msgs[1] = { |
1259 |
+ { |
1260 |
+ .addr = radio->client->addr, |
1261 |
+@@ -121,7 +121,7 @@ int si470x_get_register(struct si470x_device *radio, int regnr) |
1262 |
+ int si470x_set_register(struct si470x_device *radio, int regnr) |
1263 |
+ { |
1264 |
+ int i; |
1265 |
+- u16 buf[WRITE_REG_NUM]; |
1266 |
++ __be16 buf[WRITE_REG_NUM]; |
1267 |
+ struct i2c_msg msgs[1] = { |
1268 |
+ { |
1269 |
+ .addr = radio->client->addr, |
1270 |
+@@ -151,7 +151,7 @@ int si470x_set_register(struct si470x_device *radio, int regnr) |
1271 |
+ static int si470x_get_all_registers(struct si470x_device *radio) |
1272 |
+ { |
1273 |
+ int i; |
1274 |
+- u16 buf[READ_REG_NUM]; |
1275 |
++ __be16 buf[READ_REG_NUM]; |
1276 |
+ struct i2c_msg msgs[1] = { |
1277 |
+ { |
1278 |
+ .addr = radio->client->addr, |
1279 |
+diff --git a/drivers/media/v4l2-core/videobuf2-core.c b/drivers/media/v4l2-core/videobuf2-core.c |
1280 |
+index 4299ce06c25b..b3a9fa75e8e7 100644 |
1281 |
+--- a/drivers/media/v4l2-core/videobuf2-core.c |
1282 |
++++ b/drivers/media/v4l2-core/videobuf2-core.c |
1283 |
+@@ -914,9 +914,12 @@ void vb2_buffer_done(struct vb2_buffer *vb, enum vb2_buffer_state state) |
1284 |
+ dprintk(4, "done processing on buffer %d, state: %d\n", |
1285 |
+ vb->index, state); |
1286 |
+ |
1287 |
+- /* sync buffers */ |
1288 |
+- for (plane = 0; plane < vb->num_planes; ++plane) |
1289 |
+- call_void_memop(vb, finish, vb->planes[plane].mem_priv); |
1290 |
++ if (state != VB2_BUF_STATE_QUEUED && |
1291 |
++ state != VB2_BUF_STATE_REQUEUEING) { |
1292 |
++ /* sync buffers */ |
1293 |
++ for (plane = 0; plane < vb->num_planes; ++plane) |
1294 |
++ call_void_memop(vb, finish, vb->planes[plane].mem_priv); |
1295 |
++ } |
1296 |
+ |
1297 |
+ spin_lock_irqsave(&q->done_lock, flags); |
1298 |
+ if (state == VB2_BUF_STATE_QUEUED || |
1299 |
+diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c |
1300 |
+index a4803ac192bb..1d49a8dd4a37 100644 |
1301 |
+--- a/drivers/memory/tegra/mc.c |
1302 |
++++ b/drivers/memory/tegra/mc.c |
1303 |
+@@ -20,14 +20,6 @@ |
1304 |
+ #include "mc.h" |
1305 |
+ |
1306 |
+ #define MC_INTSTATUS 0x000 |
1307 |
+-#define MC_INT_DECERR_MTS (1 << 16) |
1308 |
+-#define MC_INT_SECERR_SEC (1 << 13) |
1309 |
+-#define MC_INT_DECERR_VPR (1 << 12) |
1310 |
+-#define MC_INT_INVALID_APB_ASID_UPDATE (1 << 11) |
1311 |
+-#define MC_INT_INVALID_SMMU_PAGE (1 << 10) |
1312 |
+-#define MC_INT_ARBITRATION_EMEM (1 << 9) |
1313 |
+-#define MC_INT_SECURITY_VIOLATION (1 << 8) |
1314 |
+-#define MC_INT_DECERR_EMEM (1 << 6) |
1315 |
+ |
1316 |
+ #define MC_INTMASK 0x004 |
1317 |
+ |
1318 |
+@@ -248,12 +240,13 @@ static const char *const error_names[8] = { |
1319 |
+ static irqreturn_t tegra_mc_irq(int irq, void *data) |
1320 |
+ { |
1321 |
+ struct tegra_mc *mc = data; |
1322 |
+- unsigned long status, mask; |
1323 |
++ unsigned long status; |
1324 |
+ unsigned int bit; |
1325 |
+ |
1326 |
+ /* mask all interrupts to avoid flooding */ |
1327 |
+- status = mc_readl(mc, MC_INTSTATUS); |
1328 |
+- mask = mc_readl(mc, MC_INTMASK); |
1329 |
++ status = mc_readl(mc, MC_INTSTATUS) & mc->soc->intmask; |
1330 |
++ if (!status) |
1331 |
++ return IRQ_NONE; |
1332 |
+ |
1333 |
+ for_each_set_bit(bit, &status, 32) { |
1334 |
+ const char *error = status_names[bit] ?: "unknown"; |
1335 |
+@@ -346,7 +339,6 @@ static int tegra_mc_probe(struct platform_device *pdev) |
1336 |
+ const struct of_device_id *match; |
1337 |
+ struct resource *res; |
1338 |
+ struct tegra_mc *mc; |
1339 |
+- u32 value; |
1340 |
+ int err; |
1341 |
+ |
1342 |
+ match = of_match_node(tegra_mc_of_match, pdev->dev.of_node); |
1343 |
+@@ -414,11 +406,7 @@ static int tegra_mc_probe(struct platform_device *pdev) |
1344 |
+ |
1345 |
+ WARN(!mc->soc->client_id_mask, "Missing client ID mask for this SoC\n"); |
1346 |
+ |
1347 |
+- value = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR | |
1348 |
+- MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE | |
1349 |
+- MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM; |
1350 |
+- |
1351 |
+- mc_writel(mc, value, MC_INTMASK); |
1352 |
++ mc_writel(mc, mc->soc->intmask, MC_INTMASK); |
1353 |
+ |
1354 |
+ return 0; |
1355 |
+ } |
1356 |
+diff --git a/drivers/memory/tegra/mc.h b/drivers/memory/tegra/mc.h |
1357 |
+index ddb16676c3af..24e020b4609b 100644 |
1358 |
+--- a/drivers/memory/tegra/mc.h |
1359 |
++++ b/drivers/memory/tegra/mc.h |
1360 |
+@@ -14,6 +14,15 @@ |
1361 |
+ |
1362 |
+ #include <soc/tegra/mc.h> |
1363 |
+ |
1364 |
++#define MC_INT_DECERR_MTS (1 << 16) |
1365 |
++#define MC_INT_SECERR_SEC (1 << 13) |
1366 |
++#define MC_INT_DECERR_VPR (1 << 12) |
1367 |
++#define MC_INT_INVALID_APB_ASID_UPDATE (1 << 11) |
1368 |
++#define MC_INT_INVALID_SMMU_PAGE (1 << 10) |
1369 |
++#define MC_INT_ARBITRATION_EMEM (1 << 9) |
1370 |
++#define MC_INT_SECURITY_VIOLATION (1 << 8) |
1371 |
++#define MC_INT_DECERR_EMEM (1 << 6) |
1372 |
++ |
1373 |
+ static inline u32 mc_readl(struct tegra_mc *mc, unsigned long offset) |
1374 |
+ { |
1375 |
+ return readl(mc->regs + offset); |
1376 |
+diff --git a/drivers/memory/tegra/tegra114.c b/drivers/memory/tegra/tegra114.c |
1377 |
+index ba8fff3d66a6..6d2a5a849d92 100644 |
1378 |
+--- a/drivers/memory/tegra/tegra114.c |
1379 |
++++ b/drivers/memory/tegra/tegra114.c |
1380 |
+@@ -930,4 +930,6 @@ const struct tegra_mc_soc tegra114_mc_soc = { |
1381 |
+ .atom_size = 32, |
1382 |
+ .client_id_mask = 0x7f, |
1383 |
+ .smmu = &tegra114_smmu_soc, |
1384 |
++ .intmask = MC_INT_INVALID_SMMU_PAGE | MC_INT_SECURITY_VIOLATION | |
1385 |
++ MC_INT_DECERR_EMEM, |
1386 |
+ }; |
1387 |
+diff --git a/drivers/memory/tegra/tegra124.c b/drivers/memory/tegra/tegra124.c |
1388 |
+index 5a58e440f4a7..9f68a56f2727 100644 |
1389 |
+--- a/drivers/memory/tegra/tegra124.c |
1390 |
++++ b/drivers/memory/tegra/tegra124.c |
1391 |
+@@ -1020,6 +1020,9 @@ const struct tegra_mc_soc tegra124_mc_soc = { |
1392 |
+ .smmu = &tegra124_smmu_soc, |
1393 |
+ .emem_regs = tegra124_mc_emem_regs, |
1394 |
+ .num_emem_regs = ARRAY_SIZE(tegra124_mc_emem_regs), |
1395 |
++ .intmask = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR | |
1396 |
++ MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE | |
1397 |
++ MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM, |
1398 |
+ }; |
1399 |
+ #endif /* CONFIG_ARCH_TEGRA_124_SOC */ |
1400 |
+ |
1401 |
+@@ -1042,5 +1045,8 @@ const struct tegra_mc_soc tegra132_mc_soc = { |
1402 |
+ .atom_size = 32, |
1403 |
+ .client_id_mask = 0x7f, |
1404 |
+ .smmu = &tegra132_smmu_soc, |
1405 |
++ .intmask = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR | |
1406 |
++ MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE | |
1407 |
++ MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM, |
1408 |
+ }; |
1409 |
+ #endif /* CONFIG_ARCH_TEGRA_132_SOC */ |
1410 |
+diff --git a/drivers/memory/tegra/tegra210.c b/drivers/memory/tegra/tegra210.c |
1411 |
+index 5e144abe4c18..47c78a6d8f00 100644 |
1412 |
+--- a/drivers/memory/tegra/tegra210.c |
1413 |
++++ b/drivers/memory/tegra/tegra210.c |
1414 |
+@@ -1077,4 +1077,7 @@ const struct tegra_mc_soc tegra210_mc_soc = { |
1415 |
+ .atom_size = 64, |
1416 |
+ .client_id_mask = 0xff, |
1417 |
+ .smmu = &tegra210_smmu_soc, |
1418 |
++ .intmask = MC_INT_DECERR_MTS | MC_INT_SECERR_SEC | MC_INT_DECERR_VPR | |
1419 |
++ MC_INT_INVALID_APB_ASID_UPDATE | MC_INT_INVALID_SMMU_PAGE | |
1420 |
++ MC_INT_SECURITY_VIOLATION | MC_INT_DECERR_EMEM, |
1421 |
+ }; |
1422 |
+diff --git a/drivers/memory/tegra/tegra30.c b/drivers/memory/tegra/tegra30.c |
1423 |
+index b44737840e70..d0689428ea1a 100644 |
1424 |
+--- a/drivers/memory/tegra/tegra30.c |
1425 |
++++ b/drivers/memory/tegra/tegra30.c |
1426 |
+@@ -952,4 +952,6 @@ const struct tegra_mc_soc tegra30_mc_soc = { |
1427 |
+ .atom_size = 16, |
1428 |
+ .client_id_mask = 0x7f, |
1429 |
+ .smmu = &tegra30_smmu_soc, |
1430 |
++ .intmask = MC_INT_INVALID_SMMU_PAGE | MC_INT_SECURITY_VIOLATION | |
1431 |
++ MC_INT_DECERR_EMEM, |
1432 |
+ }; |
1433 |
+diff --git a/drivers/mfd/cros_ec.c b/drivers/mfd/cros_ec.c |
1434 |
+index abd83424b498..3e18d2595b6d 100644 |
1435 |
+--- a/drivers/mfd/cros_ec.c |
1436 |
++++ b/drivers/mfd/cros_ec.c |
1437 |
+@@ -86,7 +86,11 @@ int cros_ec_register(struct cros_ec_device *ec_dev) |
1438 |
+ |
1439 |
+ mutex_init(&ec_dev->lock); |
1440 |
+ |
1441 |
+- cros_ec_query_all(ec_dev); |
1442 |
++ err = cros_ec_query_all(ec_dev); |
1443 |
++ if (err) { |
1444 |
++ dev_err(dev, "Cannot identify the EC: error %d\n", err); |
1445 |
++ return err; |
1446 |
++ } |
1447 |
+ |
1448 |
+ if (ec_dev->irq) { |
1449 |
+ err = request_threaded_irq(ec_dev->irq, NULL, ec_irq_thread, |
1450 |
+diff --git a/drivers/mmc/core/pwrseq_simple.c b/drivers/mmc/core/pwrseq_simple.c |
1451 |
+index 1304160de168..8cd9ddf1fab9 100644 |
1452 |
+--- a/drivers/mmc/core/pwrseq_simple.c |
1453 |
++++ b/drivers/mmc/core/pwrseq_simple.c |
1454 |
+@@ -39,14 +39,18 @@ static void mmc_pwrseq_simple_set_gpios_value(struct mmc_pwrseq_simple *pwrseq, |
1455 |
+ struct gpio_descs *reset_gpios = pwrseq->reset_gpios; |
1456 |
+ |
1457 |
+ if (!IS_ERR(reset_gpios)) { |
1458 |
+- int i; |
1459 |
+- int values[reset_gpios->ndescs]; |
1460 |
++ int i, *values; |
1461 |
++ int nvalues = reset_gpios->ndescs; |
1462 |
+ |
1463 |
+- for (i = 0; i < reset_gpios->ndescs; i++) |
1464 |
++ values = kmalloc_array(nvalues, sizeof(int), GFP_KERNEL); |
1465 |
++ if (!values) |
1466 |
++ return; |
1467 |
++ |
1468 |
++ for (i = 0; i < nvalues; i++) |
1469 |
+ values[i] = value; |
1470 |
+ |
1471 |
+- gpiod_set_array_value_cansleep( |
1472 |
+- reset_gpios->ndescs, reset_gpios->desc, values); |
1473 |
++ gpiod_set_array_value_cansleep(nvalues, reset_gpios->desc, values); |
1474 |
++ kfree(values); |
1475 |
+ } |
1476 |
+ } |
1477 |
+ |
1478 |
+diff --git a/drivers/mmc/host/dw_mmc.c b/drivers/mmc/host/dw_mmc.c |
1479 |
+index 1a1501fde010..e10a00d0d44d 100644 |
1480 |
+--- a/drivers/mmc/host/dw_mmc.c |
1481 |
++++ b/drivers/mmc/host/dw_mmc.c |
1482 |
+@@ -1164,6 +1164,8 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit) |
1483 |
+ if (host->state == STATE_WAITING_CMD11_DONE) |
1484 |
+ sdmmc_cmd_bits |= SDMMC_CMD_VOLT_SWITCH; |
1485 |
+ |
1486 |
++ slot->mmc->actual_clock = 0; |
1487 |
++ |
1488 |
+ if (!clock) { |
1489 |
+ mci_writel(host, CLKENA, 0); |
1490 |
+ mci_send_cmd(slot, sdmmc_cmd_bits, 0); |
1491 |
+@@ -1209,6 +1211,8 @@ static void dw_mci_setup_bus(struct dw_mci_slot *slot, bool force_clkinit) |
1492 |
+ |
1493 |
+ /* keep the last clock value that was requested from core */ |
1494 |
+ slot->__clk_old = clock; |
1495 |
++ slot->mmc->actual_clock = div ? ((host->bus_hz / div) >> 1) : |
1496 |
++ host->bus_hz; |
1497 |
+ } |
1498 |
+ |
1499 |
+ host->current_speed = clock; |
1500 |
+diff --git a/drivers/mtd/nand/fsl_ifc_nand.c b/drivers/mtd/nand/fsl_ifc_nand.c |
1501 |
+index 2f6b55229d5b..4c3b986dd74d 100644 |
1502 |
+--- a/drivers/mtd/nand/fsl_ifc_nand.c |
1503 |
++++ b/drivers/mtd/nand/fsl_ifc_nand.c |
1504 |
+@@ -372,9 +372,16 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command, |
1505 |
+ |
1506 |
+ case NAND_CMD_READID: |
1507 |
+ case NAND_CMD_PARAM: { |
1508 |
++ /* |
1509 |
++ * For READID, read 8 bytes that are currently used. |
1510 |
++ * For PARAM, read all 3 copies of 256-bytes pages. |
1511 |
++ */ |
1512 |
++ int len = 8; |
1513 |
+ int timing = IFC_FIR_OP_RB; |
1514 |
+- if (command == NAND_CMD_PARAM) |
1515 |
++ if (command == NAND_CMD_PARAM) { |
1516 |
+ timing = IFC_FIR_OP_RBCD; |
1517 |
++ len = 256 * 3; |
1518 |
++ } |
1519 |
+ |
1520 |
+ ifc_out32((IFC_FIR_OP_CW0 << IFC_NAND_FIR0_OP0_SHIFT) | |
1521 |
+ (IFC_FIR_OP_UA << IFC_NAND_FIR0_OP1_SHIFT) | |
1522 |
+@@ -384,12 +391,8 @@ static void fsl_ifc_cmdfunc(struct mtd_info *mtd, unsigned int command, |
1523 |
+ &ifc->ifc_nand.nand_fcr0); |
1524 |
+ ifc_out32(column, &ifc->ifc_nand.row3); |
1525 |
+ |
1526 |
+- /* |
1527 |
+- * although currently it's 8 bytes for READID, we always read |
1528 |
+- * the maximum 256 bytes(for PARAM) |
1529 |
+- */ |
1530 |
+- ifc_out32(256, &ifc->ifc_nand.nand_fbcr); |
1531 |
+- ifc_nand_ctrl->read_bytes = 256; |
1532 |
++ ifc_out32(len, &ifc->ifc_nand.nand_fbcr); |
1533 |
++ ifc_nand_ctrl->read_bytes = len; |
1534 |
+ |
1535 |
+ set_addr(mtd, 0, 0, 0); |
1536 |
+ fsl_ifc_run_command(mtd); |
1537 |
+diff --git a/drivers/net/dsa/qca8k.c b/drivers/net/dsa/qca8k.c |
1538 |
+index b3df70d07ff6..7f64a76acd37 100644 |
1539 |
+--- a/drivers/net/dsa/qca8k.c |
1540 |
++++ b/drivers/net/dsa/qca8k.c |
1541 |
+@@ -474,7 +474,7 @@ qca8k_set_pad_ctrl(struct qca8k_priv *priv, int port, int mode) |
1542 |
+ static void |
1543 |
+ qca8k_port_set_status(struct qca8k_priv *priv, int port, int enable) |
1544 |
+ { |
1545 |
+- u32 mask = QCA8K_PORT_STATUS_TXMAC; |
1546 |
++ u32 mask = QCA8K_PORT_STATUS_TXMAC | QCA8K_PORT_STATUS_RXMAC; |
1547 |
+ |
1548 |
+ /* Port 0 and 6 have no internal PHY */ |
1549 |
+ if ((port > 0) && (port < 6)) |
1550 |
+@@ -491,6 +491,7 @@ qca8k_setup(struct dsa_switch *ds) |
1551 |
+ { |
1552 |
+ struct qca8k_priv *priv = (struct qca8k_priv *)ds->priv; |
1553 |
+ int ret, i, phy_mode = -1; |
1554 |
++ u32 mask; |
1555 |
+ |
1556 |
+ /* Make sure that port 0 is the cpu port */ |
1557 |
+ if (!dsa_is_cpu_port(ds, 0)) { |
1558 |
+@@ -516,7 +517,10 @@ qca8k_setup(struct dsa_switch *ds) |
1559 |
+ if (ret < 0) |
1560 |
+ return ret; |
1561 |
+ |
1562 |
+- /* Enable CPU Port */ |
1563 |
++ /* Enable CPU Port, force it to maximum bandwidth and full-duplex */ |
1564 |
++ mask = QCA8K_PORT_STATUS_SPEED_1000 | QCA8K_PORT_STATUS_TXFLOW | |
1565 |
++ QCA8K_PORT_STATUS_RXFLOW | QCA8K_PORT_STATUS_DUPLEX; |
1566 |
++ qca8k_write(priv, QCA8K_REG_PORT_STATUS(QCA8K_CPU_PORT), mask); |
1567 |
+ qca8k_reg_set(priv, QCA8K_REG_GLOBAL_FW_CTRL0, |
1568 |
+ QCA8K_GLOBAL_FW_CTRL0_CPU_PORT_EN); |
1569 |
+ qca8k_port_set_status(priv, QCA8K_CPU_PORT, 1); |
1570 |
+@@ -585,6 +589,47 @@ qca8k_setup(struct dsa_switch *ds) |
1571 |
+ return 0; |
1572 |
+ } |
1573 |
+ |
1574 |
++static void |
1575 |
++qca8k_adjust_link(struct dsa_switch *ds, int port, struct phy_device *phy) |
1576 |
++{ |
1577 |
++ struct qca8k_priv *priv = ds->priv; |
1578 |
++ u32 reg; |
1579 |
++ |
1580 |
++ /* Force fixed-link setting for CPU port, skip others. */ |
1581 |
++ if (!phy_is_pseudo_fixed_link(phy)) |
1582 |
++ return; |
1583 |
++ |
1584 |
++ /* Set port speed */ |
1585 |
++ switch (phy->speed) { |
1586 |
++ case 10: |
1587 |
++ reg = QCA8K_PORT_STATUS_SPEED_10; |
1588 |
++ break; |
1589 |
++ case 100: |
1590 |
++ reg = QCA8K_PORT_STATUS_SPEED_100; |
1591 |
++ break; |
1592 |
++ case 1000: |
1593 |
++ reg = QCA8K_PORT_STATUS_SPEED_1000; |
1594 |
++ break; |
1595 |
++ default: |
1596 |
++ dev_dbg(priv->dev, "port%d link speed %dMbps not supported.\n", |
1597 |
++ port, phy->speed); |
1598 |
++ return; |
1599 |
++ } |
1600 |
++ |
1601 |
++ /* Set duplex mode */ |
1602 |
++ if (phy->duplex == DUPLEX_FULL) |
1603 |
++ reg |= QCA8K_PORT_STATUS_DUPLEX; |
1604 |
++ |
1605 |
++ /* Force flow control */ |
1606 |
++ if (dsa_is_cpu_port(ds, port)) |
1607 |
++ reg |= QCA8K_PORT_STATUS_RXFLOW | QCA8K_PORT_STATUS_TXFLOW; |
1608 |
++ |
1609 |
++ /* Force link down before changing MAC options */ |
1610 |
++ qca8k_port_set_status(priv, port, 0); |
1611 |
++ qca8k_write(priv, QCA8K_REG_PORT_STATUS(port), reg); |
1612 |
++ qca8k_port_set_status(priv, port, 1); |
1613 |
++} |
1614 |
++ |
1615 |
+ static int |
1616 |
+ qca8k_phy_read(struct dsa_switch *ds, int phy, int regnum) |
1617 |
+ { |
1618 |
+@@ -914,6 +959,7 @@ qca8k_get_tag_protocol(struct dsa_switch *ds) |
1619 |
+ static struct dsa_switch_ops qca8k_switch_ops = { |
1620 |
+ .get_tag_protocol = qca8k_get_tag_protocol, |
1621 |
+ .setup = qca8k_setup, |
1622 |
++ .adjust_link = qca8k_adjust_link, |
1623 |
+ .get_strings = qca8k_get_strings, |
1624 |
+ .phy_read = qca8k_phy_read, |
1625 |
+ .phy_write = qca8k_phy_write, |
1626 |
+@@ -946,6 +992,7 @@ qca8k_sw_probe(struct mdio_device *mdiodev) |
1627 |
+ return -ENOMEM; |
1628 |
+ |
1629 |
+ priv->bus = mdiodev->bus; |
1630 |
++ priv->dev = &mdiodev->dev; |
1631 |
+ |
1632 |
+ /* read the switches ID register */ |
1633 |
+ id = qca8k_read(priv, QCA8K_REG_MASK_CTRL); |
1634 |
+@@ -1018,6 +1065,7 @@ static SIMPLE_DEV_PM_OPS(qca8k_pm_ops, |
1635 |
+ qca8k_suspend, qca8k_resume); |
1636 |
+ |
1637 |
+ static const struct of_device_id qca8k_of_match[] = { |
1638 |
++ { .compatible = "qca,qca8334" }, |
1639 |
+ { .compatible = "qca,qca8337" }, |
1640 |
+ { /* sentinel */ }, |
1641 |
+ }; |
1642 |
+diff --git a/drivers/net/dsa/qca8k.h b/drivers/net/dsa/qca8k.h |
1643 |
+index 201464719531..9c22bc3210cd 100644 |
1644 |
+--- a/drivers/net/dsa/qca8k.h |
1645 |
++++ b/drivers/net/dsa/qca8k.h |
1646 |
+@@ -51,8 +51,10 @@ |
1647 |
+ #define QCA8K_GOL_MAC_ADDR0 0x60 |
1648 |
+ #define QCA8K_GOL_MAC_ADDR1 0x64 |
1649 |
+ #define QCA8K_REG_PORT_STATUS(_i) (0x07c + (_i) * 4) |
1650 |
+-#define QCA8K_PORT_STATUS_SPEED GENMASK(2, 0) |
1651 |
+-#define QCA8K_PORT_STATUS_SPEED_S 0 |
1652 |
++#define QCA8K_PORT_STATUS_SPEED GENMASK(1, 0) |
1653 |
++#define QCA8K_PORT_STATUS_SPEED_10 0 |
1654 |
++#define QCA8K_PORT_STATUS_SPEED_100 0x1 |
1655 |
++#define QCA8K_PORT_STATUS_SPEED_1000 0x2 |
1656 |
+ #define QCA8K_PORT_STATUS_TXMAC BIT(2) |
1657 |
+ #define QCA8K_PORT_STATUS_RXMAC BIT(3) |
1658 |
+ #define QCA8K_PORT_STATUS_TXFLOW BIT(4) |
1659 |
+@@ -167,6 +169,7 @@ struct qca8k_priv { |
1660 |
+ struct ar8xxx_port_status port_sts[QCA8K_NUM_PORTS]; |
1661 |
+ struct dsa_switch *ds; |
1662 |
+ struct mutex reg_mutex; |
1663 |
++ struct device *dev; |
1664 |
+ }; |
1665 |
+ |
1666 |
+ struct qca8k_mib_desc { |
1667 |
+diff --git a/drivers/net/ethernet/broadcom/bnxt/bnxt.c b/drivers/net/ethernet/broadcom/bnxt/bnxt.c |
1668 |
+index ca57eb56c717..8777c3a4c095 100644 |
1669 |
+--- a/drivers/net/ethernet/broadcom/bnxt/bnxt.c |
1670 |
++++ b/drivers/net/ethernet/broadcom/bnxt/bnxt.c |
1671 |
+@@ -5257,6 +5257,9 @@ static int bnxt_update_link(struct bnxt *bp, bool chng_link_state) |
1672 |
+ } |
1673 |
+ mutex_unlock(&bp->hwrm_cmd_lock); |
1674 |
+ |
1675 |
++ if (!BNXT_SINGLE_PF(bp)) |
1676 |
++ return 0; |
1677 |
++ |
1678 |
+ diff = link_info->support_auto_speeds ^ link_info->advertising; |
1679 |
+ if ((link_info->support_auto_speeds | diff) != |
1680 |
+ link_info->support_auto_speeds) { |
1681 |
+diff --git a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |
1682 |
+index 1499ce2bf9f6..029513294984 100644 |
1683 |
+--- a/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |
1684 |
++++ b/drivers/net/ethernet/intel/ixgbevf/ixgbevf_main.c |
1685 |
+@@ -3729,6 +3729,7 @@ static int ixgbevf_set_mac(struct net_device *netdev, void *p) |
1686 |
+ return -EPERM; |
1687 |
+ |
1688 |
+ ether_addr_copy(hw->mac.addr, addr->sa_data); |
1689 |
++ ether_addr_copy(hw->mac.perm_addr, addr->sa_data); |
1690 |
+ ether_addr_copy(netdev->dev_addr, addr->sa_data); |
1691 |
+ |
1692 |
+ return 0; |
1693 |
+diff --git a/drivers/net/ethernet/ti/cpsw-phy-sel.c b/drivers/net/ethernet/ti/cpsw-phy-sel.c |
1694 |
+index 18013645e76c..0c1adad7415d 100644 |
1695 |
+--- a/drivers/net/ethernet/ti/cpsw-phy-sel.c |
1696 |
++++ b/drivers/net/ethernet/ti/cpsw-phy-sel.c |
1697 |
+@@ -177,12 +177,18 @@ void cpsw_phy_sel(struct device *dev, phy_interface_t phy_mode, int slave) |
1698 |
+ } |
1699 |
+ |
1700 |
+ dev = bus_find_device(&platform_bus_type, NULL, node, match); |
1701 |
+- of_node_put(node); |
1702 |
++ if (!dev) { |
1703 |
++ dev_err(dev, "unable to find platform device for %pOF\n", node); |
1704 |
++ goto out; |
1705 |
++ } |
1706 |
++ |
1707 |
+ priv = dev_get_drvdata(dev); |
1708 |
+ |
1709 |
+ priv->cpsw_phy_sel(priv, phy_mode, slave); |
1710 |
+ |
1711 |
+ put_device(dev); |
1712 |
++out: |
1713 |
++ of_node_put(node); |
1714 |
+ } |
1715 |
+ EXPORT_SYMBOL_GPL(cpsw_phy_sel); |
1716 |
+ |
1717 |
+diff --git a/drivers/net/wireless/ath/regd.h b/drivers/net/wireless/ath/regd.h |
1718 |
+index 565d3075f06e..8553ab44d930 100644 |
1719 |
+--- a/drivers/net/wireless/ath/regd.h |
1720 |
++++ b/drivers/net/wireless/ath/regd.h |
1721 |
+@@ -68,12 +68,14 @@ enum CountryCode { |
1722 |
+ CTRY_AUSTRALIA = 36, |
1723 |
+ CTRY_AUSTRIA = 40, |
1724 |
+ CTRY_AZERBAIJAN = 31, |
1725 |
++ CTRY_BAHAMAS = 44, |
1726 |
+ CTRY_BAHRAIN = 48, |
1727 |
+ CTRY_BANGLADESH = 50, |
1728 |
+ CTRY_BARBADOS = 52, |
1729 |
+ CTRY_BELARUS = 112, |
1730 |
+ CTRY_BELGIUM = 56, |
1731 |
+ CTRY_BELIZE = 84, |
1732 |
++ CTRY_BERMUDA = 60, |
1733 |
+ CTRY_BOLIVIA = 68, |
1734 |
+ CTRY_BOSNIA_HERZ = 70, |
1735 |
+ CTRY_BRAZIL = 76, |
1736 |
+@@ -159,6 +161,7 @@ enum CountryCode { |
1737 |
+ CTRY_ROMANIA = 642, |
1738 |
+ CTRY_RUSSIA = 643, |
1739 |
+ CTRY_SAUDI_ARABIA = 682, |
1740 |
++ CTRY_SERBIA = 688, |
1741 |
+ CTRY_SERBIA_MONTENEGRO = 891, |
1742 |
+ CTRY_SINGAPORE = 702, |
1743 |
+ CTRY_SLOVAKIA = 703, |
1744 |
+@@ -170,11 +173,13 @@ enum CountryCode { |
1745 |
+ CTRY_SWITZERLAND = 756, |
1746 |
+ CTRY_SYRIA = 760, |
1747 |
+ CTRY_TAIWAN = 158, |
1748 |
++ CTRY_TANZANIA = 834, |
1749 |
+ CTRY_THAILAND = 764, |
1750 |
+ CTRY_TRINIDAD_Y_TOBAGO = 780, |
1751 |
+ CTRY_TUNISIA = 788, |
1752 |
+ CTRY_TURKEY = 792, |
1753 |
+ CTRY_UAE = 784, |
1754 |
++ CTRY_UGANDA = 800, |
1755 |
+ CTRY_UKRAINE = 804, |
1756 |
+ CTRY_UNITED_KINGDOM = 826, |
1757 |
+ CTRY_UNITED_STATES = 840, |
1758 |
+diff --git a/drivers/net/wireless/ath/regd_common.h b/drivers/net/wireless/ath/regd_common.h |
1759 |
+index bdd2b4d61f2f..15bbd1e0d912 100644 |
1760 |
+--- a/drivers/net/wireless/ath/regd_common.h |
1761 |
++++ b/drivers/net/wireless/ath/regd_common.h |
1762 |
+@@ -35,6 +35,7 @@ enum EnumRd { |
1763 |
+ FRANCE_RES = 0x31, |
1764 |
+ FCC3_FCCA = 0x3A, |
1765 |
+ FCC3_WORLD = 0x3B, |
1766 |
++ FCC3_ETSIC = 0x3F, |
1767 |
+ |
1768 |
+ ETSI1_WORLD = 0x37, |
1769 |
+ ETSI3_ETSIA = 0x32, |
1770 |
+@@ -44,6 +45,7 @@ enum EnumRd { |
1771 |
+ ETSI4_ETSIC = 0x38, |
1772 |
+ ETSI5_WORLD = 0x39, |
1773 |
+ ETSI6_WORLD = 0x34, |
1774 |
++ ETSI8_WORLD = 0x3D, |
1775 |
+ ETSI_RESERVED = 0x33, |
1776 |
+ |
1777 |
+ MKK1_MKKA = 0x40, |
1778 |
+@@ -59,6 +61,7 @@ enum EnumRd { |
1779 |
+ MKK1_MKKA1 = 0x4A, |
1780 |
+ MKK1_MKKA2 = 0x4B, |
1781 |
+ MKK1_MKKC = 0x4C, |
1782 |
++ APL2_FCCA = 0x4D, |
1783 |
+ |
1784 |
+ APL3_FCCA = 0x50, |
1785 |
+ APL1_WORLD = 0x52, |
1786 |
+@@ -67,6 +70,7 @@ enum EnumRd { |
1787 |
+ APL1_ETSIC = 0x55, |
1788 |
+ APL2_ETSIC = 0x56, |
1789 |
+ APL5_WORLD = 0x58, |
1790 |
++ APL13_WORLD = 0x5A, |
1791 |
+ APL6_WORLD = 0x5B, |
1792 |
+ APL7_FCCA = 0x5C, |
1793 |
+ APL8_WORLD = 0x5D, |
1794 |
+@@ -168,6 +172,7 @@ static struct reg_dmn_pair_mapping regDomainPairs[] = { |
1795 |
+ {FCC2_ETSIC, CTL_FCC, CTL_ETSI}, |
1796 |
+ {FCC3_FCCA, CTL_FCC, CTL_FCC}, |
1797 |
+ {FCC3_WORLD, CTL_FCC, CTL_ETSI}, |
1798 |
++ {FCC3_ETSIC, CTL_FCC, CTL_ETSI}, |
1799 |
+ {FCC4_FCCA, CTL_FCC, CTL_FCC}, |
1800 |
+ {FCC5_FCCA, CTL_FCC, CTL_FCC}, |
1801 |
+ {FCC6_FCCA, CTL_FCC, CTL_FCC}, |
1802 |
+@@ -179,6 +184,7 @@ static struct reg_dmn_pair_mapping regDomainPairs[] = { |
1803 |
+ {ETSI4_WORLD, CTL_ETSI, CTL_ETSI}, |
1804 |
+ {ETSI5_WORLD, CTL_ETSI, CTL_ETSI}, |
1805 |
+ {ETSI6_WORLD, CTL_ETSI, CTL_ETSI}, |
1806 |
++ {ETSI8_WORLD, CTL_ETSI, CTL_ETSI}, |
1807 |
+ |
1808 |
+ /* XXX: For ETSI3_ETSIA, Was NO_CTL meant for the 2 GHz band ? */ |
1809 |
+ {ETSI3_ETSIA, CTL_ETSI, CTL_ETSI}, |
1810 |
+@@ -188,9 +194,11 @@ static struct reg_dmn_pair_mapping regDomainPairs[] = { |
1811 |
+ {FCC1_FCCA, CTL_FCC, CTL_FCC}, |
1812 |
+ {APL1_WORLD, CTL_FCC, CTL_ETSI}, |
1813 |
+ {APL2_WORLD, CTL_FCC, CTL_ETSI}, |
1814 |
++ {APL2_FCCA, CTL_FCC, CTL_FCC}, |
1815 |
+ {APL3_WORLD, CTL_FCC, CTL_ETSI}, |
1816 |
+ {APL4_WORLD, CTL_FCC, CTL_ETSI}, |
1817 |
+ {APL5_WORLD, CTL_FCC, CTL_ETSI}, |
1818 |
++ {APL13_WORLD, CTL_ETSI, CTL_ETSI}, |
1819 |
+ {APL6_WORLD, CTL_ETSI, CTL_ETSI}, |
1820 |
+ {APL8_WORLD, CTL_ETSI, CTL_ETSI}, |
1821 |
+ {APL9_WORLD, CTL_ETSI, CTL_ETSI}, |
1822 |
+@@ -298,6 +306,7 @@ static struct country_code_to_enum_rd allCountries[] = { |
1823 |
+ {CTRY_AUSTRALIA2, FCC6_WORLD, "AU"}, |
1824 |
+ {CTRY_AUSTRIA, ETSI1_WORLD, "AT"}, |
1825 |
+ {CTRY_AZERBAIJAN, ETSI4_WORLD, "AZ"}, |
1826 |
++ {CTRY_BAHAMAS, FCC3_WORLD, "BS"}, |
1827 |
+ {CTRY_BAHRAIN, APL6_WORLD, "BH"}, |
1828 |
+ {CTRY_BANGLADESH, NULL1_WORLD, "BD"}, |
1829 |
+ {CTRY_BARBADOS, FCC2_WORLD, "BB"}, |
1830 |
+@@ -305,6 +314,7 @@ static struct country_code_to_enum_rd allCountries[] = { |
1831 |
+ {CTRY_BELGIUM, ETSI1_WORLD, "BE"}, |
1832 |
+ {CTRY_BELGIUM2, ETSI4_WORLD, "BL"}, |
1833 |
+ {CTRY_BELIZE, APL1_ETSIC, "BZ"}, |
1834 |
++ {CTRY_BERMUDA, FCC3_FCCA, "BM"}, |
1835 |
+ {CTRY_BOLIVIA, APL1_ETSIC, "BO"}, |
1836 |
+ {CTRY_BOSNIA_HERZ, ETSI1_WORLD, "BA"}, |
1837 |
+ {CTRY_BRAZIL, FCC3_WORLD, "BR"}, |
1838 |
+@@ -444,6 +454,7 @@ static struct country_code_to_enum_rd allCountries[] = { |
1839 |
+ {CTRY_ROMANIA, NULL1_WORLD, "RO"}, |
1840 |
+ {CTRY_RUSSIA, NULL1_WORLD, "RU"}, |
1841 |
+ {CTRY_SAUDI_ARABIA, NULL1_WORLD, "SA"}, |
1842 |
++ {CTRY_SERBIA, ETSI1_WORLD, "RS"}, |
1843 |
+ {CTRY_SERBIA_MONTENEGRO, ETSI1_WORLD, "CS"}, |
1844 |
+ {CTRY_SINGAPORE, APL6_WORLD, "SG"}, |
1845 |
+ {CTRY_SLOVAKIA, ETSI1_WORLD, "SK"}, |
1846 |
+@@ -455,10 +466,12 @@ static struct country_code_to_enum_rd allCountries[] = { |
1847 |
+ {CTRY_SWITZERLAND, ETSI1_WORLD, "CH"}, |
1848 |
+ {CTRY_SYRIA, NULL1_WORLD, "SY"}, |
1849 |
+ {CTRY_TAIWAN, APL3_FCCA, "TW"}, |
1850 |
++ {CTRY_TANZANIA, APL1_WORLD, "TZ"}, |
1851 |
+ {CTRY_THAILAND, FCC3_WORLD, "TH"}, |
1852 |
+ {CTRY_TRINIDAD_Y_TOBAGO, FCC3_WORLD, "TT"}, |
1853 |
+ {CTRY_TUNISIA, ETSI3_WORLD, "TN"}, |
1854 |
+ {CTRY_TURKEY, ETSI3_WORLD, "TR"}, |
1855 |
++ {CTRY_UGANDA, FCC3_WORLD, "UG"}, |
1856 |
+ {CTRY_UKRAINE, NULL1_WORLD, "UA"}, |
1857 |
+ {CTRY_UAE, NULL1_WORLD, "AE"}, |
1858 |
+ {CTRY_UNITED_KINGDOM, ETSI1_WORLD, "GB"}, |
1859 |
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c |
1860 |
+index 746f8c9a891d..e69cf0ef9574 100644 |
1861 |
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c |
1862 |
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c |
1863 |
+@@ -1099,6 +1099,7 @@ static const struct sdio_device_id brcmf_sdmmc_ids[] = { |
1864 |
+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43340), |
1865 |
+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43341), |
1866 |
+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43362), |
1867 |
++ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43364), |
1868 |
+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4335_4339), |
1869 |
+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_4339), |
1870 |
+ BRCMF_SDIO_DEVICE(SDIO_DEVICE_ID_BROADCOM_43430), |
1871 |
+diff --git a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c |
1872 |
+index 6fe5546dc773..996a928142ad 100644 |
1873 |
+--- a/drivers/net/wireless/intel/iwlwifi/pcie/rx.c |
1874 |
++++ b/drivers/net/wireless/intel/iwlwifi/pcie/rx.c |
1875 |
+@@ -898,6 +898,8 @@ int iwl_pcie_rx_init(struct iwl_trans *trans) |
1876 |
+ WQ_HIGHPRI | WQ_UNBOUND, 1); |
1877 |
+ INIT_WORK(&rba->rx_alloc, iwl_pcie_rx_allocator_work); |
1878 |
+ |
1879 |
++ cancel_work_sync(&rba->rx_alloc); |
1880 |
++ |
1881 |
+ spin_lock(&rba->lock); |
1882 |
+ atomic_set(&rba->req_pending, 0); |
1883 |
+ atomic_set(&rba->req_ready, 0); |
1884 |
+diff --git a/drivers/net/wireless/marvell/mwifiex/usb.c b/drivers/net/wireless/marvell/mwifiex/usb.c |
1885 |
+index 73eb0846db21..09185a1f7379 100644 |
1886 |
+--- a/drivers/net/wireless/marvell/mwifiex/usb.c |
1887 |
++++ b/drivers/net/wireless/marvell/mwifiex/usb.c |
1888 |
+@@ -624,6 +624,9 @@ static void mwifiex_usb_disconnect(struct usb_interface *intf) |
1889 |
+ MWIFIEX_FUNC_SHUTDOWN); |
1890 |
+ } |
1891 |
+ |
1892 |
++ if (adapter->workqueue) |
1893 |
++ flush_workqueue(adapter->workqueue); |
1894 |
++ |
1895 |
+ mwifiex_usb_free(card); |
1896 |
+ |
1897 |
+ mwifiex_dbg(adapter, FATAL, |
1898 |
+diff --git a/drivers/net/wireless/marvell/mwifiex/util.c b/drivers/net/wireless/marvell/mwifiex/util.c |
1899 |
+index 18fbb96a46e9..d75756c68e16 100644 |
1900 |
+--- a/drivers/net/wireless/marvell/mwifiex/util.c |
1901 |
++++ b/drivers/net/wireless/marvell/mwifiex/util.c |
1902 |
+@@ -723,12 +723,14 @@ void mwifiex_hist_data_set(struct mwifiex_private *priv, u8 rx_rate, s8 snr, |
1903 |
+ s8 nflr) |
1904 |
+ { |
1905 |
+ struct mwifiex_histogram_data *phist_data = priv->hist_data; |
1906 |
++ s8 nf = -nflr; |
1907 |
++ s8 rssi = snr - nflr; |
1908 |
+ |
1909 |
+ atomic_inc(&phist_data->num_samples); |
1910 |
+ atomic_inc(&phist_data->rx_rate[rx_rate]); |
1911 |
+- atomic_inc(&phist_data->snr[snr]); |
1912 |
+- atomic_inc(&phist_data->noise_flr[128 + nflr]); |
1913 |
+- atomic_inc(&phist_data->sig_str[nflr - snr]); |
1914 |
++ atomic_inc(&phist_data->snr[snr + 128]); |
1915 |
++ atomic_inc(&phist_data->noise_flr[nf + 128]); |
1916 |
++ atomic_inc(&phist_data->sig_str[rssi + 128]); |
1917 |
+ } |
1918 |
+ |
1919 |
+ /* function to reset histogram data during init/reset */ |
1920 |
+diff --git a/drivers/net/wireless/rsi/rsi_91x_sdio.c b/drivers/net/wireless/rsi/rsi_91x_sdio.c |
1921 |
+index 8428858204a6..fc895b466ebb 100644 |
1922 |
+--- a/drivers/net/wireless/rsi/rsi_91x_sdio.c |
1923 |
++++ b/drivers/net/wireless/rsi/rsi_91x_sdio.c |
1924 |
+@@ -155,7 +155,6 @@ static void rsi_reset_card(struct sdio_func *pfunction) |
1925 |
+ int err; |
1926 |
+ struct mmc_card *card = pfunction->card; |
1927 |
+ struct mmc_host *host = card->host; |
1928 |
+- s32 bit = (fls(host->ocr_avail) - 1); |
1929 |
+ u8 cmd52_resp; |
1930 |
+ u32 clock, resp, i; |
1931 |
+ u16 rca; |
1932 |
+@@ -175,7 +174,6 @@ static void rsi_reset_card(struct sdio_func *pfunction) |
1933 |
+ msleep(20); |
1934 |
+ |
1935 |
+ /* Initialize the SDIO card */ |
1936 |
+- host->ios.vdd = bit; |
1937 |
+ host->ios.chip_select = MMC_CS_DONTCARE; |
1938 |
+ host->ios.bus_mode = MMC_BUSMODE_OPENDRAIN; |
1939 |
+ host->ios.power_mode = MMC_POWER_UP; |
1940 |
+diff --git a/drivers/net/wireless/ti/wlcore/sdio.c b/drivers/net/wireless/ti/wlcore/sdio.c |
1941 |
+index 47fe7f96a242..6921cb0bf563 100644 |
1942 |
+--- a/drivers/net/wireless/ti/wlcore/sdio.c |
1943 |
++++ b/drivers/net/wireless/ti/wlcore/sdio.c |
1944 |
+@@ -404,6 +404,11 @@ static int wl1271_suspend(struct device *dev) |
1945 |
+ mmc_pm_flag_t sdio_flags; |
1946 |
+ int ret = 0; |
1947 |
+ |
1948 |
++ if (!wl) { |
1949 |
++ dev_err(dev, "no wilink module was probed\n"); |
1950 |
++ goto out; |
1951 |
++ } |
1952 |
++ |
1953 |
+ dev_dbg(dev, "wl1271 suspend. wow_enabled: %d\n", |
1954 |
+ wl->wow_enabled); |
1955 |
+ |
1956 |
+diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c |
1957 |
+index 520050eae836..a5908e4c06cb 100644 |
1958 |
+--- a/drivers/net/xen-netfront.c |
1959 |
++++ b/drivers/net/xen-netfront.c |
1960 |
+@@ -238,7 +238,7 @@ static void rx_refill_timeout(unsigned long data) |
1961 |
+ static int netfront_tx_slot_available(struct netfront_queue *queue) |
1962 |
+ { |
1963 |
+ return (queue->tx.req_prod_pvt - queue->tx.rsp_cons) < |
1964 |
+- (NET_TX_RING_SIZE - MAX_SKB_FRAGS - 2); |
1965 |
++ (NET_TX_RING_SIZE - XEN_NETIF_NR_SLOTS_MIN - 1); |
1966 |
+ } |
1967 |
+ |
1968 |
+ static void xennet_maybe_wake_tx(struct netfront_queue *queue) |
1969 |
+@@ -789,7 +789,7 @@ static int xennet_get_responses(struct netfront_queue *queue, |
1970 |
+ RING_IDX cons = queue->rx.rsp_cons; |
1971 |
+ struct sk_buff *skb = xennet_get_rx_skb(queue, cons); |
1972 |
+ grant_ref_t ref = xennet_get_rx_ref(queue, cons); |
1973 |
+- int max = MAX_SKB_FRAGS + (rx->status <= RX_COPY_THRESHOLD); |
1974 |
++ int max = XEN_NETIF_NR_SLOTS_MIN + (rx->status <= RX_COPY_THRESHOLD); |
1975 |
+ int slots = 1; |
1976 |
+ int err = 0; |
1977 |
+ unsigned long ret; |
1978 |
+diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c |
1979 |
+index 1b4d93e9157e..824e282cd80e 100644 |
1980 |
+--- a/drivers/nvmem/core.c |
1981 |
++++ b/drivers/nvmem/core.c |
1982 |
+@@ -1031,6 +1031,8 @@ static inline void *nvmem_cell_prepare_write_buffer(struct nvmem_cell *cell, |
1983 |
+ |
1984 |
+ /* setup the first byte with lsb bits from nvmem */ |
1985 |
+ rc = nvmem_reg_read(nvmem, cell->offset, &v, 1); |
1986 |
++ if (rc) |
1987 |
++ goto err; |
1988 |
+ *b++ |= GENMASK(bit_offset - 1, 0) & v; |
1989 |
+ |
1990 |
+ /* setup rest of the byte if any */ |
1991 |
+@@ -1049,11 +1051,16 @@ static inline void *nvmem_cell_prepare_write_buffer(struct nvmem_cell *cell, |
1992 |
+ /* setup the last byte with msb bits from nvmem */ |
1993 |
+ rc = nvmem_reg_read(nvmem, |
1994 |
+ cell->offset + cell->bytes - 1, &v, 1); |
1995 |
++ if (rc) |
1996 |
++ goto err; |
1997 |
+ *p |= GENMASK(7, (nbits + bit_offset) % BITS_PER_BYTE) & v; |
1998 |
+ |
1999 |
+ } |
2000 |
+ |
2001 |
+ return buf; |
2002 |
++err: |
2003 |
++ kfree(buf); |
2004 |
++ return ERR_PTR(rc); |
2005 |
+ } |
2006 |
+ |
2007 |
+ /** |
2008 |
+diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c |
2009 |
+index f9f4d1c18eb2..e5d8e2e2bd30 100644 |
2010 |
+--- a/drivers/pci/pci-sysfs.c |
2011 |
++++ b/drivers/pci/pci-sysfs.c |
2012 |
+@@ -180,13 +180,16 @@ static ssize_t enable_store(struct device *dev, struct device_attribute *attr, |
2013 |
+ if (!capable(CAP_SYS_ADMIN)) |
2014 |
+ return -EPERM; |
2015 |
+ |
2016 |
+- if (!val) { |
2017 |
+- if (pci_is_enabled(pdev)) |
2018 |
+- pci_disable_device(pdev); |
2019 |
+- else |
2020 |
+- result = -EIO; |
2021 |
+- } else |
2022 |
++ device_lock(dev); |
2023 |
++ if (dev->driver) |
2024 |
++ result = -EBUSY; |
2025 |
++ else if (val) |
2026 |
+ result = pci_enable_device(pdev); |
2027 |
++ else if (pci_is_enabled(pdev)) |
2028 |
++ pci_disable_device(pdev); |
2029 |
++ else |
2030 |
++ result = -EIO; |
2031 |
++ device_unlock(dev); |
2032 |
+ |
2033 |
+ return result < 0 ? result : count; |
2034 |
+ } |
2035 |
+diff --git a/drivers/pinctrl/pinctrl-at91-pio4.c b/drivers/pinctrl/pinctrl-at91-pio4.c |
2036 |
+index 28bbc1bb9e6c..88ba9c50cc8e 100644 |
2037 |
+--- a/drivers/pinctrl/pinctrl-at91-pio4.c |
2038 |
++++ b/drivers/pinctrl/pinctrl-at91-pio4.c |
2039 |
+@@ -573,8 +573,10 @@ static int atmel_pctl_dt_node_to_map(struct pinctrl_dev *pctldev, |
2040 |
+ for_each_child_of_node(np_config, np) { |
2041 |
+ ret = atmel_pctl_dt_subnode_to_map(pctldev, np, map, |
2042 |
+ &reserved_maps, num_maps); |
2043 |
+- if (ret < 0) |
2044 |
++ if (ret < 0) { |
2045 |
++ of_node_put(np); |
2046 |
+ break; |
2047 |
++ } |
2048 |
+ } |
2049 |
+ } |
2050 |
+ |
2051 |
+diff --git a/drivers/regulator/pfuze100-regulator.c b/drivers/regulator/pfuze100-regulator.c |
2052 |
+index cb18b5c4f2db..86b348740fcd 100644 |
2053 |
+--- a/drivers/regulator/pfuze100-regulator.c |
2054 |
++++ b/drivers/regulator/pfuze100-regulator.c |
2055 |
+@@ -153,6 +153,7 @@ static struct regulator_ops pfuze100_sw_regulator_ops = { |
2056 |
+ static struct regulator_ops pfuze100_swb_regulator_ops = { |
2057 |
+ .enable = regulator_enable_regmap, |
2058 |
+ .disable = regulator_disable_regmap, |
2059 |
++ .is_enabled = regulator_is_enabled_regmap, |
2060 |
+ .list_voltage = regulator_list_voltage_table, |
2061 |
+ .map_voltage = regulator_map_voltage_ascend, |
2062 |
+ .set_voltage_sel = regulator_set_voltage_sel_regmap, |
2063 |
+diff --git a/drivers/rtc/interface.c b/drivers/rtc/interface.c |
2064 |
+index 25cf3069e2e7..4131bfb2cc61 100644 |
2065 |
+--- a/drivers/rtc/interface.c |
2066 |
++++ b/drivers/rtc/interface.c |
2067 |
+@@ -359,6 +359,11 @@ int rtc_set_alarm(struct rtc_device *rtc, struct rtc_wkalrm *alarm) |
2068 |
+ { |
2069 |
+ int err; |
2070 |
+ |
2071 |
++ if (!rtc->ops) |
2072 |
++ return -ENODEV; |
2073 |
++ else if (!rtc->ops->set_alarm) |
2074 |
++ return -EINVAL; |
2075 |
++ |
2076 |
+ err = rtc_valid_tm(&alarm->time); |
2077 |
+ if (err != 0) |
2078 |
+ return err; |
2079 |
+diff --git a/drivers/scsi/3w-9xxx.c b/drivers/scsi/3w-9xxx.c |
2080 |
+index a56a7b243e91..5466246c69b4 100644 |
2081 |
+--- a/drivers/scsi/3w-9xxx.c |
2082 |
++++ b/drivers/scsi/3w-9xxx.c |
2083 |
+@@ -889,6 +889,11 @@ static int twa_chrdev_open(struct inode *inode, struct file *file) |
2084 |
+ unsigned int minor_number; |
2085 |
+ int retval = TW_IOCTL_ERROR_OS_ENODEV; |
2086 |
+ |
2087 |
++ if (!capable(CAP_SYS_ADMIN)) { |
2088 |
++ retval = -EACCES; |
2089 |
++ goto out; |
2090 |
++ } |
2091 |
++ |
2092 |
+ minor_number = iminor(inode); |
2093 |
+ if (minor_number >= twa_device_extension_count) |
2094 |
+ goto out; |
2095 |
+diff --git a/drivers/scsi/3w-xxxx.c b/drivers/scsi/3w-xxxx.c |
2096 |
+index 25aba1613e21..24ac19e31003 100644 |
2097 |
+--- a/drivers/scsi/3w-xxxx.c |
2098 |
++++ b/drivers/scsi/3w-xxxx.c |
2099 |
+@@ -1034,6 +1034,9 @@ static int tw_chrdev_open(struct inode *inode, struct file *file) |
2100 |
+ |
2101 |
+ dprintk(KERN_WARNING "3w-xxxx: tw_ioctl_open()\n"); |
2102 |
+ |
2103 |
++ if (!capable(CAP_SYS_ADMIN)) |
2104 |
++ return -EACCES; |
2105 |
++ |
2106 |
+ minor_number = iminor(inode); |
2107 |
+ if (minor_number >= tw_device_extension_count) |
2108 |
+ return -ENODEV; |
2109 |
+diff --git a/drivers/scsi/megaraid.c b/drivers/scsi/megaraid.c |
2110 |
+index 9d05302a3bcd..19bffe0b2cc0 100644 |
2111 |
+--- a/drivers/scsi/megaraid.c |
2112 |
++++ b/drivers/scsi/megaraid.c |
2113 |
+@@ -4197,6 +4197,9 @@ megaraid_probe_one(struct pci_dev *pdev, const struct pci_device_id *id) |
2114 |
+ int irq, i, j; |
2115 |
+ int error = -ENODEV; |
2116 |
+ |
2117 |
++ if (hba_count >= MAX_CONTROLLERS) |
2118 |
++ goto out; |
2119 |
++ |
2120 |
+ if (pci_enable_device(pdev)) |
2121 |
+ goto out; |
2122 |
+ pci_set_master(pdev); |
2123 |
+diff --git a/drivers/scsi/megaraid/megaraid_sas_fusion.c b/drivers/scsi/megaraid/megaraid_sas_fusion.c |
2124 |
+index a156451553a7..f722a0e6caa4 100644 |
2125 |
+--- a/drivers/scsi/megaraid/megaraid_sas_fusion.c |
2126 |
++++ b/drivers/scsi/megaraid/megaraid_sas_fusion.c |
2127 |
+@@ -2031,6 +2031,9 @@ megasas_build_syspd_fusion(struct megasas_instance *instance, |
2128 |
+ pRAID_Context->timeoutValue = cpu_to_le16(os_timeout_value); |
2129 |
+ pRAID_Context->VirtualDiskTgtId = cpu_to_le16(device_id); |
2130 |
+ } else { |
2131 |
++ if (os_timeout_value) |
2132 |
++ os_timeout_value++; |
2133 |
++ |
2134 |
+ /* system pd Fast Path */ |
2135 |
+ io_request->Function = MPI2_FUNCTION_SCSI_IO_REQUEST; |
2136 |
+ timeout_limit = (scmd->device->type == TYPE_DISK) ? |
2137 |
+diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c |
2138 |
+index a5e30e9449ef..375cede0c534 100644 |
2139 |
+--- a/drivers/scsi/scsi_dh.c |
2140 |
++++ b/drivers/scsi/scsi_dh.c |
2141 |
+@@ -58,7 +58,10 @@ static const struct scsi_dh_blist scsi_dh_blist[] = { |
2142 |
+ {"IBM", "3526", "rdac", }, |
2143 |
+ {"IBM", "3542", "rdac", }, |
2144 |
+ {"IBM", "3552", "rdac", }, |
2145 |
+- {"SGI", "TP9", "rdac", }, |
2146 |
++ {"SGI", "TP9300", "rdac", }, |
2147 |
++ {"SGI", "TP9400", "rdac", }, |
2148 |
++ {"SGI", "TP9500", "rdac", }, |
2149 |
++ {"SGI", "TP9700", "rdac", }, |
2150 |
+ {"SGI", "IS", "rdac", }, |
2151 |
+ {"STK", "OPENstorage", "rdac", }, |
2152 |
+ {"STK", "FLEXLINE 380", "rdac", }, |
2153 |
+diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c |
2154 |
+index 86a3110c6d75..f857086ce2fa 100644 |
2155 |
+--- a/drivers/scsi/ufs/ufshcd.c |
2156 |
++++ b/drivers/scsi/ufs/ufshcd.c |
2157 |
+@@ -4012,6 +4012,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work) |
2158 |
+ hba = container_of(work, struct ufs_hba, eeh_work); |
2159 |
+ |
2160 |
+ pm_runtime_get_sync(hba->dev); |
2161 |
++ scsi_block_requests(hba->host); |
2162 |
+ err = ufshcd_get_ee_status(hba, &status); |
2163 |
+ if (err) { |
2164 |
+ dev_err(hba->dev, "%s: failed to get exception status %d\n", |
2165 |
+@@ -4025,6 +4026,7 @@ static void ufshcd_exception_event_handler(struct work_struct *work) |
2166 |
+ ufshcd_bkops_exception_event_handler(hba); |
2167 |
+ |
2168 |
+ out: |
2169 |
++ scsi_unblock_requests(hba->host); |
2170 |
+ pm_runtime_put_sync(hba->dev); |
2171 |
+ return; |
2172 |
+ } |
2173 |
+diff --git a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |
2174 |
+index ea9a0c21d29d..4ff293129675 100644 |
2175 |
+--- a/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |
2176 |
++++ b/drivers/staging/lustre/lnet/klnds/o2iblnd/o2iblnd_cb.c |
2177 |
+@@ -1299,11 +1299,6 @@ kiblnd_connect_peer(struct kib_peer *peer) |
2178 |
+ goto failed2; |
2179 |
+ } |
2180 |
+ |
2181 |
+- LASSERT(cmid->device); |
2182 |
+- CDEBUG(D_NET, "%s: connection bound to %s:%pI4h:%s\n", |
2183 |
+- libcfs_nid2str(peer->ibp_nid), dev->ibd_ifname, |
2184 |
+- &dev->ibd_ifip, cmid->device->name); |
2185 |
+- |
2186 |
+ return; |
2187 |
+ |
2188 |
+ failed2: |
2189 |
+@@ -3005,8 +3000,19 @@ kiblnd_cm_callback(struct rdma_cm_id *cmid, struct rdma_cm_event *event) |
2190 |
+ } else { |
2191 |
+ rc = rdma_resolve_route( |
2192 |
+ cmid, *kiblnd_tunables.kib_timeout * 1000); |
2193 |
+- if (!rc) |
2194 |
++ if (!rc) { |
2195 |
++ struct kib_net *net = peer->ibp_ni->ni_data; |
2196 |
++ struct kib_dev *dev = net->ibn_dev; |
2197 |
++ |
2198 |
++ CDEBUG(D_NET, "%s: connection bound to "\ |
2199 |
++ "%s:%pI4h:%s\n", |
2200 |
++ libcfs_nid2str(peer->ibp_nid), |
2201 |
++ dev->ibd_ifname, |
2202 |
++ &dev->ibd_ifip, cmid->device->name); |
2203 |
++ |
2204 |
+ return 0; |
2205 |
++ } |
2206 |
++ |
2207 |
+ /* Can't initiate route resolution */ |
2208 |
+ CERROR("Can't resolve route for %s: %d\n", |
2209 |
+ libcfs_nid2str(peer->ibp_nid), rc); |
2210 |
+diff --git a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |
2211 |
+index d18ab3f28c70..9addcdbe9374 100644 |
2212 |
+--- a/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |
2213 |
++++ b/drivers/staging/lustre/lustre/ldlm/ldlm_lock.c |
2214 |
+@@ -1489,8 +1489,10 @@ struct ldlm_lock *ldlm_lock_create(struct ldlm_namespace *ns, |
2215 |
+ return ERR_CAST(res); |
2216 |
+ |
2217 |
+ lock = ldlm_lock_new(res); |
2218 |
+- if (!lock) |
2219 |
++ if (!lock) { |
2220 |
++ ldlm_resource_putref(res); |
2221 |
+ return ERR_PTR(-ENOMEM); |
2222 |
++ } |
2223 |
+ |
2224 |
+ lock->l_req_mode = mode; |
2225 |
+ lock->l_ast_data = data; |
2226 |
+@@ -1533,6 +1535,8 @@ out: |
2227 |
+ return ERR_PTR(rc); |
2228 |
+ } |
2229 |
+ |
2230 |
++ |
2231 |
++ |
2232 |
+ /** |
2233 |
+ * Enqueue (request) a lock. |
2234 |
+ * On the client this is called from ldlm_cli_enqueue_fini |
2235 |
+diff --git a/drivers/staging/lustre/lustre/llite/xattr.c b/drivers/staging/lustre/lustre/llite/xattr.c |
2236 |
+index e070adb7a3cc..57121fd5f050 100644 |
2237 |
+--- a/drivers/staging/lustre/lustre/llite/xattr.c |
2238 |
++++ b/drivers/staging/lustre/lustre/llite/xattr.c |
2239 |
+@@ -103,7 +103,11 @@ ll_xattr_set_common(const struct xattr_handler *handler, |
2240 |
+ __u64 valid; |
2241 |
+ int rc; |
2242 |
+ |
2243 |
+- if (flags == XATTR_REPLACE) { |
2244 |
++ /* When setxattr() is called with a size of 0 the value is |
2245 |
++ * unconditionally replaced by "". When removexattr() is |
2246 |
++ * called we get a NULL value and XATTR_REPLACE for flags. |
2247 |
++ */ |
2248 |
++ if (!value && flags == XATTR_REPLACE) { |
2249 |
+ ll_stats_ops_tally(ll_i2sbi(inode), LPROC_LL_REMOVEXATTR, 1); |
2250 |
+ valid = OBD_MD_FLXATTRRM; |
2251 |
+ } else { |
2252 |
+diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c |
2253 |
+index a45810b43f70..c974cb5fb958 100644 |
2254 |
+--- a/drivers/thermal/samsung/exynos_tmu.c |
2255 |
++++ b/drivers/thermal/samsung/exynos_tmu.c |
2256 |
+@@ -598,6 +598,7 @@ static int exynos5433_tmu_initialize(struct platform_device *pdev) |
2257 |
+ threshold_code = temp_to_code(data, temp); |
2258 |
+ |
2259 |
+ rising_threshold = readl(data->base + rising_reg_offset); |
2260 |
++ rising_threshold &= ~(0xff << j * 8); |
2261 |
+ rising_threshold |= (threshold_code << j * 8); |
2262 |
+ writel(rising_threshold, data->base + rising_reg_offset); |
2263 |
+ |
2264 |
+diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c |
2265 |
+index 510799311099..1fc5d5b82778 100644 |
2266 |
+--- a/drivers/tty/hvc/hvc_opal.c |
2267 |
++++ b/drivers/tty/hvc/hvc_opal.c |
2268 |
+@@ -332,7 +332,6 @@ static void udbg_init_opal_common(void) |
2269 |
+ udbg_putc = udbg_opal_putc; |
2270 |
+ udbg_getc = udbg_opal_getc; |
2271 |
+ udbg_getc_poll = udbg_opal_getc_poll; |
2272 |
+- tb_ticks_per_usec = 0x200; /* Make udelay not suck */ |
2273 |
+ } |
2274 |
+ |
2275 |
+ void __init hvc_opal_init_early(void) |
2276 |
+diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c |
2277 |
+index 2b907385b4a8..171130a9ecc8 100644 |
2278 |
+--- a/drivers/tty/pty.c |
2279 |
++++ b/drivers/tty/pty.c |
2280 |
+@@ -106,16 +106,19 @@ static void pty_unthrottle(struct tty_struct *tty) |
2281 |
+ static int pty_write(struct tty_struct *tty, const unsigned char *buf, int c) |
2282 |
+ { |
2283 |
+ struct tty_struct *to = tty->link; |
2284 |
++ unsigned long flags; |
2285 |
+ |
2286 |
+ if (tty->stopped) |
2287 |
+ return 0; |
2288 |
+ |
2289 |
+ if (c > 0) { |
2290 |
++ spin_lock_irqsave(&to->port->lock, flags); |
2291 |
+ /* Stuff the data into the input queue of the other end */ |
2292 |
+ c = tty_insert_flip_string(to->port, buf, c); |
2293 |
+ /* And shovel */ |
2294 |
+ if (c) |
2295 |
+ tty_flip_buffer_push(to->port); |
2296 |
++ spin_unlock_irqrestore(&to->port->lock, flags); |
2297 |
+ } |
2298 |
+ return c; |
2299 |
+ } |
2300 |
+diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c |
2301 |
+index bdb19db542a4..7aee55244b4a 100644 |
2302 |
+--- a/drivers/usb/core/hub.c |
2303 |
++++ b/drivers/usb/core/hub.c |
2304 |
+@@ -3363,6 +3363,10 @@ static int wait_for_connected(struct usb_device *udev, |
2305 |
+ while (delay_ms < 2000) { |
2306 |
+ if (status || *portstatus & USB_PORT_STAT_CONNECTION) |
2307 |
+ break; |
2308 |
++ if (!port_is_power_on(hub, *portstatus)) { |
2309 |
++ status = -ENODEV; |
2310 |
++ break; |
2311 |
++ } |
2312 |
+ msleep(20); |
2313 |
+ delay_ms += 20; |
2314 |
+ status = hub_port_status(hub, *port1, portstatus, portchange); |
2315 |
+diff --git a/drivers/usb/dwc2/hcd.c b/drivers/usb/dwc2/hcd.c |
2316 |
+index 0a0cf154814b..984d6aae7529 100644 |
2317 |
+--- a/drivers/usb/dwc2/hcd.c |
2318 |
++++ b/drivers/usb/dwc2/hcd.c |
2319 |
+@@ -2544,34 +2544,29 @@ static void dwc2_hc_init_xfer(struct dwc2_hsotg *hsotg, |
2320 |
+ |
2321 |
+ #define DWC2_USB_DMA_ALIGN 4 |
2322 |
+ |
2323 |
+-struct dma_aligned_buffer { |
2324 |
+- void *kmalloc_ptr; |
2325 |
+- void *old_xfer_buffer; |
2326 |
+- u8 data[0]; |
2327 |
+-}; |
2328 |
+- |
2329 |
+ static void dwc2_free_dma_aligned_buffer(struct urb *urb) |
2330 |
+ { |
2331 |
+- struct dma_aligned_buffer *temp; |
2332 |
++ void *stored_xfer_buffer; |
2333 |
+ |
2334 |
+ if (!(urb->transfer_flags & URB_ALIGNED_TEMP_BUFFER)) |
2335 |
+ return; |
2336 |
+ |
2337 |
+- temp = container_of(urb->transfer_buffer, |
2338 |
+- struct dma_aligned_buffer, data); |
2339 |
++ /* Restore urb->transfer_buffer from the end of the allocated area */ |
2340 |
++ memcpy(&stored_xfer_buffer, urb->transfer_buffer + |
2341 |
++ urb->transfer_buffer_length, sizeof(urb->transfer_buffer)); |
2342 |
+ |
2343 |
+ if (usb_urb_dir_in(urb)) |
2344 |
+- memcpy(temp->old_xfer_buffer, temp->data, |
2345 |
++ memcpy(stored_xfer_buffer, urb->transfer_buffer, |
2346 |
+ urb->transfer_buffer_length); |
2347 |
+- urb->transfer_buffer = temp->old_xfer_buffer; |
2348 |
+- kfree(temp->kmalloc_ptr); |
2349 |
++ kfree(urb->transfer_buffer); |
2350 |
++ urb->transfer_buffer = stored_xfer_buffer; |
2351 |
+ |
2352 |
+ urb->transfer_flags &= ~URB_ALIGNED_TEMP_BUFFER; |
2353 |
+ } |
2354 |
+ |
2355 |
+ static int dwc2_alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags) |
2356 |
+ { |
2357 |
+- struct dma_aligned_buffer *temp, *kmalloc_ptr; |
2358 |
++ void *kmalloc_ptr; |
2359 |
+ size_t kmalloc_size; |
2360 |
+ |
2361 |
+ if (urb->num_sgs || urb->sg || |
2362 |
+@@ -2579,22 +2574,29 @@ static int dwc2_alloc_dma_aligned_buffer(struct urb *urb, gfp_t mem_flags) |
2363 |
+ !((uintptr_t)urb->transfer_buffer & (DWC2_USB_DMA_ALIGN - 1))) |
2364 |
+ return 0; |
2365 |
+ |
2366 |
+- /* Allocate a buffer with enough padding for alignment */ |
2367 |
++ /* |
2368 |
++ * Allocate a buffer with enough padding for original transfer_buffer |
2369 |
++ * pointer. This allocation is guaranteed to be aligned properly for |
2370 |
++ * DMA |
2371 |
++ */ |
2372 |
+ kmalloc_size = urb->transfer_buffer_length + |
2373 |
+- sizeof(struct dma_aligned_buffer) + DWC2_USB_DMA_ALIGN - 1; |
2374 |
++ sizeof(urb->transfer_buffer); |
2375 |
+ |
2376 |
+ kmalloc_ptr = kmalloc(kmalloc_size, mem_flags); |
2377 |
+ if (!kmalloc_ptr) |
2378 |
+ return -ENOMEM; |
2379 |
+ |
2380 |
+- /* Position our struct dma_aligned_buffer such that data is aligned */ |
2381 |
+- temp = PTR_ALIGN(kmalloc_ptr + 1, DWC2_USB_DMA_ALIGN) - 1; |
2382 |
+- temp->kmalloc_ptr = kmalloc_ptr; |
2383 |
+- temp->old_xfer_buffer = urb->transfer_buffer; |
2384 |
++ /* |
2385 |
++ * Position value of original urb->transfer_buffer pointer to the end |
2386 |
++ * of allocation for later referencing |
2387 |
++ */ |
2388 |
++ memcpy(kmalloc_ptr + urb->transfer_buffer_length, |
2389 |
++ &urb->transfer_buffer, sizeof(urb->transfer_buffer)); |
2390 |
++ |
2391 |
+ if (usb_urb_dir_out(urb)) |
2392 |
+- memcpy(temp->data, urb->transfer_buffer, |
2393 |
++ memcpy(kmalloc_ptr, urb->transfer_buffer, |
2394 |
+ urb->transfer_buffer_length); |
2395 |
+- urb->transfer_buffer = temp->data; |
2396 |
++ urb->transfer_buffer = kmalloc_ptr; |
2397 |
+ |
2398 |
+ urb->transfer_flags |= URB_ALIGNED_TEMP_BUFFER; |
2399 |
+ |
2400 |
+diff --git a/drivers/vfio/platform/vfio_platform_common.c b/drivers/vfio/platform/vfio_platform_common.c |
2401 |
+index d78142830754..d143d08c4f0f 100644 |
2402 |
+--- a/drivers/vfio/platform/vfio_platform_common.c |
2403 |
++++ b/drivers/vfio/platform/vfio_platform_common.c |
2404 |
+@@ -696,18 +696,23 @@ int vfio_platform_probe_common(struct vfio_platform_device *vdev, |
2405 |
+ group = vfio_iommu_group_get(dev); |
2406 |
+ if (!group) { |
2407 |
+ pr_err("VFIO: No IOMMU group for device %s\n", vdev->name); |
2408 |
+- return -EINVAL; |
2409 |
++ ret = -EINVAL; |
2410 |
++ goto put_reset; |
2411 |
+ } |
2412 |
+ |
2413 |
+ ret = vfio_add_group_dev(dev, &vfio_platform_ops, vdev); |
2414 |
+- if (ret) { |
2415 |
+- vfio_iommu_group_put(group, dev); |
2416 |
+- return ret; |
2417 |
+- } |
2418 |
++ if (ret) |
2419 |
++ goto put_iommu; |
2420 |
+ |
2421 |
+ mutex_init(&vdev->igate); |
2422 |
+ |
2423 |
+ return 0; |
2424 |
++ |
2425 |
++put_iommu: |
2426 |
++ vfio_iommu_group_put(group, dev); |
2427 |
++put_reset: |
2428 |
++ vfio_platform_put_reset(vdev); |
2429 |
++ return ret; |
2430 |
+ } |
2431 |
+ EXPORT_SYMBOL_GPL(vfio_platform_probe_common); |
2432 |
+ |
2433 |
+diff --git a/fs/btrfs/qgroup.c b/fs/btrfs/qgroup.c |
2434 |
+index dfd99867ff4d..9afad8c14220 100644 |
2435 |
+--- a/fs/btrfs/qgroup.c |
2436 |
++++ b/fs/btrfs/qgroup.c |
2437 |
+@@ -2236,6 +2236,21 @@ void assert_qgroups_uptodate(struct btrfs_trans_handle *trans) |
2438 |
+ BUG(); |
2439 |
+ } |
2440 |
+ |
2441 |
++/* |
2442 |
++ * Check if the leaf is the last leaf. Which means all node pointers |
2443 |
++ * are at their last position. |
2444 |
++ */ |
2445 |
++static bool is_last_leaf(struct btrfs_path *path) |
2446 |
++{ |
2447 |
++ int i; |
2448 |
++ |
2449 |
++ for (i = 1; i < BTRFS_MAX_LEVEL && path->nodes[i]; i++) { |
2450 |
++ if (path->slots[i] != btrfs_header_nritems(path->nodes[i]) - 1) |
2451 |
++ return false; |
2452 |
++ } |
2453 |
++ return true; |
2454 |
++} |
2455 |
++ |
2456 |
+ /* |
2457 |
+ * returns < 0 on error, 0 when more leafs are to be scanned. |
2458 |
+ * returns 1 when done. |
2459 |
+@@ -2249,6 +2264,7 @@ qgroup_rescan_leaf(struct btrfs_fs_info *fs_info, struct btrfs_path *path, |
2460 |
+ struct ulist *roots = NULL; |
2461 |
+ struct seq_list tree_mod_seq_elem = SEQ_LIST_INIT(tree_mod_seq_elem); |
2462 |
+ u64 num_bytes; |
2463 |
++ bool done; |
2464 |
+ int slot; |
2465 |
+ int ret; |
2466 |
+ |
2467 |
+@@ -2277,6 +2293,7 @@ qgroup_rescan_leaf(struct btrfs_fs_info *fs_info, struct btrfs_path *path, |
2468 |
+ mutex_unlock(&fs_info->qgroup_rescan_lock); |
2469 |
+ return ret; |
2470 |
+ } |
2471 |
++ done = is_last_leaf(path); |
2472 |
+ |
2473 |
+ btrfs_item_key_to_cpu(path->nodes[0], &found, |
2474 |
+ btrfs_header_nritems(path->nodes[0]) - 1); |
2475 |
+@@ -2323,6 +2340,8 @@ out: |
2476 |
+ } |
2477 |
+ btrfs_put_tree_mod_seq(fs_info, &tree_mod_seq_elem); |
2478 |
+ |
2479 |
++ if (done && !ret) |
2480 |
++ ret = 1; |
2481 |
+ return ret; |
2482 |
+ } |
2483 |
+ |
2484 |
+diff --git a/fs/btrfs/tree-log.c b/fs/btrfs/tree-log.c |
2485 |
+index 44d34923de9c..44966fd00790 100644 |
2486 |
+--- a/fs/btrfs/tree-log.c |
2487 |
++++ b/fs/btrfs/tree-log.c |
2488 |
+@@ -2979,8 +2979,11 @@ out_wake_log_root: |
2489 |
+ mutex_unlock(&log_root_tree->log_mutex); |
2490 |
+ |
2491 |
+ /* |
2492 |
+- * The barrier before waitqueue_active is implied by mutex_unlock |
2493 |
++ * The barrier before waitqueue_active is needed so all the updates |
2494 |
++ * above are seen by the woken threads. It might not be necessary, but |
2495 |
++ * proving that seems to be hard. |
2496 |
+ */ |
2497 |
++ smp_mb(); |
2498 |
+ if (waitqueue_active(&log_root_tree->log_commit_wait[index2])) |
2499 |
+ wake_up(&log_root_tree->log_commit_wait[index2]); |
2500 |
+ out: |
2501 |
+@@ -2991,8 +2994,11 @@ out: |
2502 |
+ mutex_unlock(&root->log_mutex); |
2503 |
+ |
2504 |
+ /* |
2505 |
+- * The barrier before waitqueue_active is implied by mutex_unlock |
2506 |
++ * The barrier before waitqueue_active is needed so all the updates |
2507 |
++ * above are seen by the woken threads. It might not be necessary, but |
2508 |
++ * proving that seems to be hard. |
2509 |
+ */ |
2510 |
++ smp_mb(); |
2511 |
+ if (waitqueue_active(&root->log_commit_wait[index1])) |
2512 |
+ wake_up(&root->log_commit_wait[index1]); |
2513 |
+ return ret; |
2514 |
+diff --git a/fs/crypto/crypto.c b/fs/crypto/crypto.c |
2515 |
+index 73de1446c8d4..1a8962569b5c 100644 |
2516 |
+--- a/fs/crypto/crypto.c |
2517 |
++++ b/fs/crypto/crypto.c |
2518 |
+@@ -517,8 +517,17 @@ EXPORT_SYMBOL(fscrypt_initialize); |
2519 |
+ */ |
2520 |
+ static int __init fscrypt_init(void) |
2521 |
+ { |
2522 |
++ /* |
2523 |
++ * Use an unbound workqueue to allow bios to be decrypted in parallel |
2524 |
++ * even when they happen to complete on the same CPU. This sacrifices |
2525 |
++ * locality, but it's worthwhile since decryption is CPU-intensive. |
2526 |
++ * |
2527 |
++ * Also use a high-priority workqueue to prioritize decryption work, |
2528 |
++ * which blocks reads from completing, over regular application tasks. |
2529 |
++ */ |
2530 |
+ fscrypt_read_workqueue = alloc_workqueue("fscrypt_read_queue", |
2531 |
+- WQ_HIGHPRI, 0); |
2532 |
++ WQ_UNBOUND | WQ_HIGHPRI, |
2533 |
++ num_online_cpus()); |
2534 |
+ if (!fscrypt_read_workqueue) |
2535 |
+ goto fail; |
2536 |
+ |
2537 |
+diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c |
2538 |
+index ad13f07cf0d3..2455fe1446d6 100644 |
2539 |
+--- a/fs/ext4/balloc.c |
2540 |
++++ b/fs/ext4/balloc.c |
2541 |
+@@ -378,6 +378,8 @@ static int ext4_validate_block_bitmap(struct super_block *sb, |
2542 |
+ return -EFSCORRUPTED; |
2543 |
+ |
2544 |
+ ext4_lock_group(sb, block_group); |
2545 |
++ if (buffer_verified(bh)) |
2546 |
++ goto verified; |
2547 |
+ if (unlikely(!ext4_block_bitmap_csum_verify(sb, block_group, |
2548 |
+ desc, bh))) { |
2549 |
+ ext4_unlock_group(sb, block_group); |
2550 |
+@@ -400,6 +402,7 @@ static int ext4_validate_block_bitmap(struct super_block *sb, |
2551 |
+ return -EFSCORRUPTED; |
2552 |
+ } |
2553 |
+ set_buffer_verified(bh); |
2554 |
++verified: |
2555 |
+ ext4_unlock_group(sb, block_group); |
2556 |
+ return 0; |
2557 |
+ } |
2558 |
+diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c |
2559 |
+index 460866b2166d..ffaf66a51de3 100644 |
2560 |
+--- a/fs/ext4/ialloc.c |
2561 |
++++ b/fs/ext4/ialloc.c |
2562 |
+@@ -88,6 +88,8 @@ static int ext4_validate_inode_bitmap(struct super_block *sb, |
2563 |
+ return -EFSCORRUPTED; |
2564 |
+ |
2565 |
+ ext4_lock_group(sb, block_group); |
2566 |
++ if (buffer_verified(bh)) |
2567 |
++ goto verified; |
2568 |
+ blk = ext4_inode_bitmap(sb, desc); |
2569 |
+ if (!ext4_inode_bitmap_csum_verify(sb, block_group, desc, bh, |
2570 |
+ EXT4_INODES_PER_GROUP(sb) / 8)) { |
2571 |
+@@ -105,6 +107,7 @@ static int ext4_validate_inode_bitmap(struct super_block *sb, |
2572 |
+ return -EFSBADCRC; |
2573 |
+ } |
2574 |
+ set_buffer_verified(bh); |
2575 |
++verified: |
2576 |
+ ext4_unlock_group(sb, block_group); |
2577 |
+ return 0; |
2578 |
+ } |
2579 |
+diff --git a/fs/ext4/inline.c b/fs/ext4/inline.c |
2580 |
+index e6ac24de119d..436baf7cdca3 100644 |
2581 |
+--- a/fs/ext4/inline.c |
2582 |
++++ b/fs/ext4/inline.c |
2583 |
+@@ -679,6 +679,10 @@ int ext4_try_to_write_inline_data(struct address_space *mapping, |
2584 |
+ goto convert; |
2585 |
+ } |
2586 |
+ |
2587 |
++ ret = ext4_journal_get_write_access(handle, iloc.bh); |
2588 |
++ if (ret) |
2589 |
++ goto out; |
2590 |
++ |
2591 |
+ flags |= AOP_FLAG_NOFS; |
2592 |
+ |
2593 |
+ page = grab_cache_page_write_begin(mapping, 0, flags); |
2594 |
+@@ -707,7 +711,7 @@ int ext4_try_to_write_inline_data(struct address_space *mapping, |
2595 |
+ out_up_read: |
2596 |
+ up_read(&EXT4_I(inode)->xattr_sem); |
2597 |
+ out: |
2598 |
+- if (handle) |
2599 |
++ if (handle && (ret != 1)) |
2600 |
+ ext4_journal_stop(handle); |
2601 |
+ brelse(iloc.bh); |
2602 |
+ return ret; |
2603 |
+@@ -749,6 +753,7 @@ int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len, |
2604 |
+ |
2605 |
+ ext4_write_unlock_xattr(inode, &no_expand); |
2606 |
+ brelse(iloc.bh); |
2607 |
++ mark_inode_dirty(inode); |
2608 |
+ out: |
2609 |
+ return copied; |
2610 |
+ } |
2611 |
+@@ -895,7 +900,6 @@ retry_journal: |
2612 |
+ goto out; |
2613 |
+ } |
2614 |
+ |
2615 |
+- |
2616 |
+ page = grab_cache_page_write_begin(mapping, 0, flags); |
2617 |
+ if (!page) { |
2618 |
+ ret = -ENOMEM; |
2619 |
+@@ -913,6 +917,9 @@ retry_journal: |
2620 |
+ if (ret < 0) |
2621 |
+ goto out_release_page; |
2622 |
+ } |
2623 |
++ ret = ext4_journal_get_write_access(handle, iloc.bh); |
2624 |
++ if (ret) |
2625 |
++ goto out_release_page; |
2626 |
+ |
2627 |
+ up_read(&EXT4_I(inode)->xattr_sem); |
2628 |
+ *pagep = page; |
2629 |
+@@ -933,7 +940,6 @@ int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos, |
2630 |
+ unsigned len, unsigned copied, |
2631 |
+ struct page *page) |
2632 |
+ { |
2633 |
+- int i_size_changed = 0; |
2634 |
+ int ret; |
2635 |
+ |
2636 |
+ ret = ext4_write_inline_data_end(inode, pos, len, copied, page); |
2637 |
+@@ -951,10 +957,8 @@ int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos, |
2638 |
+ * But it's important to update i_size while still holding page lock: |
2639 |
+ * page writeout could otherwise come in and zero beyond i_size. |
2640 |
+ */ |
2641 |
+- if (pos+copied > inode->i_size) { |
2642 |
++ if (pos+copied > inode->i_size) |
2643 |
+ i_size_write(inode, pos+copied); |
2644 |
+- i_size_changed = 1; |
2645 |
+- } |
2646 |
+ unlock_page(page); |
2647 |
+ put_page(page); |
2648 |
+ |
2649 |
+@@ -964,8 +968,7 @@ int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos, |
2650 |
+ * ordering of page lock and transaction start for journaling |
2651 |
+ * filesystems. |
2652 |
+ */ |
2653 |
+- if (i_size_changed) |
2654 |
+- mark_inode_dirty(inode); |
2655 |
++ mark_inode_dirty(inode); |
2656 |
+ |
2657 |
+ return copied; |
2658 |
+ } |
2659 |
+diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c |
2660 |
+index 5c4c9af4aaf4..f62eca8cbde0 100644 |
2661 |
+--- a/fs/ext4/inode.c |
2662 |
++++ b/fs/ext4/inode.c |
2663 |
+@@ -1318,9 +1318,10 @@ static int ext4_write_end(struct file *file, |
2664 |
+ loff_t old_size = inode->i_size; |
2665 |
+ int ret = 0, ret2; |
2666 |
+ int i_size_changed = 0; |
2667 |
++ int inline_data = ext4_has_inline_data(inode); |
2668 |
+ |
2669 |
+ trace_ext4_write_end(inode, pos, len, copied); |
2670 |
+- if (ext4_has_inline_data(inode)) { |
2671 |
++ if (inline_data) { |
2672 |
+ ret = ext4_write_inline_data_end(inode, pos, len, |
2673 |
+ copied, page); |
2674 |
+ if (ret < 0) { |
2675 |
+@@ -1348,7 +1349,7 @@ static int ext4_write_end(struct file *file, |
2676 |
+ * ordering of page lock and transaction start for journaling |
2677 |
+ * filesystems. |
2678 |
+ */ |
2679 |
+- if (i_size_changed) |
2680 |
++ if (i_size_changed || inline_data) |
2681 |
+ ext4_mark_inode_dirty(handle, inode); |
2682 |
+ |
2683 |
+ if (pos + len > inode->i_size && ext4_can_truncate(inode)) |
2684 |
+@@ -1422,6 +1423,7 @@ static int ext4_journalled_write_end(struct file *file, |
2685 |
+ int partial = 0; |
2686 |
+ unsigned from, to; |
2687 |
+ int size_changed = 0; |
2688 |
++ int inline_data = ext4_has_inline_data(inode); |
2689 |
+ |
2690 |
+ trace_ext4_journalled_write_end(inode, pos, len, copied); |
2691 |
+ from = pos & (PAGE_SIZE - 1); |
2692 |
+@@ -1429,7 +1431,7 @@ static int ext4_journalled_write_end(struct file *file, |
2693 |
+ |
2694 |
+ BUG_ON(!ext4_handle_valid(handle)); |
2695 |
+ |
2696 |
+- if (ext4_has_inline_data(inode)) { |
2697 |
++ if (inline_data) { |
2698 |
+ ret = ext4_write_inline_data_end(inode, pos, len, |
2699 |
+ copied, page); |
2700 |
+ if (ret < 0) { |
2701 |
+@@ -1460,7 +1462,7 @@ static int ext4_journalled_write_end(struct file *file, |
2702 |
+ if (old_size < pos) |
2703 |
+ pagecache_isize_extended(inode, old_size, pos); |
2704 |
+ |
2705 |
+- if (size_changed) { |
2706 |
++ if (size_changed || inline_data) { |
2707 |
+ ret2 = ext4_mark_inode_dirty(handle, inode); |
2708 |
+ if (!ret) |
2709 |
+ ret = ret2; |
2710 |
+@@ -1958,11 +1960,7 @@ static int __ext4_journalled_writepage(struct page *page, |
2711 |
+ } |
2712 |
+ |
2713 |
+ if (inline_data) { |
2714 |
+- BUFFER_TRACE(inode_bh, "get write access"); |
2715 |
+- ret = ext4_journal_get_write_access(handle, inode_bh); |
2716 |
+- |
2717 |
+- err = ext4_handle_dirty_metadata(handle, inode, inode_bh); |
2718 |
+- |
2719 |
++ ret = ext4_mark_inode_dirty(handle, inode); |
2720 |
+ } else { |
2721 |
+ ret = ext4_walk_page_buffers(handle, page_bufs, 0, len, NULL, |
2722 |
+ do_journal_get_write_access); |
2723 |
+diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c |
2724 |
+index 801111e1f8ef..7d0e8d6bf009 100644 |
2725 |
+--- a/fs/f2fs/file.c |
2726 |
++++ b/fs/f2fs/file.c |
2727 |
+@@ -1512,6 +1512,8 @@ static int f2fs_ioc_start_atomic_write(struct file *filp) |
2728 |
+ |
2729 |
+ inode_lock(inode); |
2730 |
+ |
2731 |
++ down_write(&F2FS_I(inode)->dio_rwsem[WRITE]); |
2732 |
++ |
2733 |
+ if (f2fs_is_atomic_file(inode)) |
2734 |
+ goto out; |
2735 |
+ |
2736 |
+@@ -1532,6 +1534,7 @@ static int f2fs_ioc_start_atomic_write(struct file *filp) |
2737 |
+ if (ret) |
2738 |
+ clear_inode_flag(inode, FI_ATOMIC_FILE); |
2739 |
+ out: |
2740 |
++ up_write(&F2FS_I(inode)->dio_rwsem[WRITE]); |
2741 |
+ inode_unlock(inode); |
2742 |
+ mnt_drop_write_file(filp); |
2743 |
+ return ret; |
2744 |
+@@ -1670,9 +1673,11 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg) |
2745 |
+ if (get_user(in, (__u32 __user *)arg)) |
2746 |
+ return -EFAULT; |
2747 |
+ |
2748 |
+- ret = mnt_want_write_file(filp); |
2749 |
+- if (ret) |
2750 |
+- return ret; |
2751 |
++ if (in != F2FS_GOING_DOWN_FULLSYNC) { |
2752 |
++ ret = mnt_want_write_file(filp); |
2753 |
++ if (ret) |
2754 |
++ return ret; |
2755 |
++ } |
2756 |
+ |
2757 |
+ switch (in) { |
2758 |
+ case F2FS_GOING_DOWN_FULLSYNC: |
2759 |
+@@ -1700,7 +1705,8 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg) |
2760 |
+ } |
2761 |
+ f2fs_update_time(sbi, REQ_TIME); |
2762 |
+ out: |
2763 |
+- mnt_drop_write_file(filp); |
2764 |
++ if (in != F2FS_GOING_DOWN_FULLSYNC) |
2765 |
++ mnt_drop_write_file(filp); |
2766 |
+ return ret; |
2767 |
+ } |
2768 |
+ |
2769 |
+diff --git a/fs/f2fs/gc.c b/fs/f2fs/gc.c |
2770 |
+index 17ab23f64bba..ad4dfd29d923 100644 |
2771 |
+--- a/fs/f2fs/gc.c |
2772 |
++++ b/fs/f2fs/gc.c |
2773 |
+@@ -688,9 +688,14 @@ retry: |
2774 |
+ set_cold_data(page); |
2775 |
+ |
2776 |
+ err = do_write_data_page(&fio); |
2777 |
+- if (err == -ENOMEM && is_dirty) { |
2778 |
+- congestion_wait(BLK_RW_ASYNC, HZ/50); |
2779 |
+- goto retry; |
2780 |
++ if (err) { |
2781 |
++ clear_cold_data(page); |
2782 |
++ if (err == -ENOMEM) { |
2783 |
++ congestion_wait(BLK_RW_ASYNC, HZ/50); |
2784 |
++ goto retry; |
2785 |
++ } |
2786 |
++ if (is_dirty) |
2787 |
++ set_page_dirty(page); |
2788 |
+ } |
2789 |
+ |
2790 |
+ clear_cold_data(page); |
2791 |
+diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c |
2792 |
+index e10f61684ea4..35d48ef0573c 100644 |
2793 |
+--- a/fs/f2fs/segment.c |
2794 |
++++ b/fs/f2fs/segment.c |
2795 |
+@@ -207,6 +207,8 @@ static int __revoke_inmem_pages(struct inode *inode, |
2796 |
+ |
2797 |
+ lock_page(page); |
2798 |
+ |
2799 |
++ f2fs_wait_on_page_writeback(page, DATA, true); |
2800 |
++ |
2801 |
+ if (recover) { |
2802 |
+ struct dnode_of_data dn; |
2803 |
+ struct node_info ni; |
2804 |
+@@ -369,6 +371,9 @@ void f2fs_balance_fs(struct f2fs_sb_info *sbi, bool need) |
2805 |
+ |
2806 |
+ void f2fs_balance_fs_bg(struct f2fs_sb_info *sbi) |
2807 |
+ { |
2808 |
++ if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING))) |
2809 |
++ return; |
2810 |
++ |
2811 |
+ /* try to shrink extent cache when there is no enough memory */ |
2812 |
+ if (!available_free_memory(sbi, EXTENT_CACHE)) |
2813 |
+ f2fs_shrink_extent_tree(sbi, EXTENT_CACHE_SHRINK_NUMBER); |
2814 |
+diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c |
2815 |
+index eb20b8767f3c..e627671f0183 100644 |
2816 |
+--- a/fs/f2fs/super.c |
2817 |
++++ b/fs/f2fs/super.c |
2818 |
+@@ -1980,6 +1980,12 @@ static int __init init_f2fs_fs(void) |
2819 |
+ { |
2820 |
+ int err; |
2821 |
+ |
2822 |
++ if (PAGE_SIZE != F2FS_BLKSIZE) { |
2823 |
++ printk("F2FS not supported on PAGE_SIZE(%lu) != %d\n", |
2824 |
++ PAGE_SIZE, F2FS_BLKSIZE); |
2825 |
++ return -EINVAL; |
2826 |
++ } |
2827 |
++ |
2828 |
+ f2fs_build_trace_ios(); |
2829 |
+ |
2830 |
+ err = init_inodecache(); |
2831 |
+diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c |
2832 |
+index 91e017ca7072..cf5fdc25289a 100644 |
2833 |
+--- a/fs/nfs/nfs4proc.c |
2834 |
++++ b/fs/nfs/nfs4proc.c |
2835 |
+@@ -2701,7 +2701,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, |
2836 |
+ if (ret != 0) |
2837 |
+ goto out; |
2838 |
+ |
2839 |
+- state = nfs4_opendata_to_nfs4_state(opendata); |
2840 |
++ state = _nfs4_opendata_to_nfs4_state(opendata); |
2841 |
+ ret = PTR_ERR(state); |
2842 |
+ if (IS_ERR(state)) |
2843 |
+ goto out; |
2844 |
+@@ -2737,6 +2737,7 @@ static int _nfs4_open_and_get_state(struct nfs4_opendata *opendata, |
2845 |
+ nfs4_schedule_stateid_recovery(server, state); |
2846 |
+ } |
2847 |
+ out: |
2848 |
++ nfs4_sequence_free_slot(&opendata->o_res.seq_res); |
2849 |
+ return ret; |
2850 |
+ } |
2851 |
+ |
2852 |
+diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c |
2853 |
+index bdbd9e6d1ace..b16a6c036352 100644 |
2854 |
+--- a/fs/nfsd/nfs4xdr.c |
2855 |
++++ b/fs/nfsd/nfs4xdr.c |
2856 |
+@@ -1536,6 +1536,8 @@ nfsd4_decode_getdeviceinfo(struct nfsd4_compoundargs *argp, |
2857 |
+ gdev->gd_maxcount = be32_to_cpup(p++); |
2858 |
+ num = be32_to_cpup(p++); |
2859 |
+ if (num) { |
2860 |
++ if (num > 1000) |
2861 |
++ goto xdr_error; |
2862 |
+ READ_BUF(4 * num); |
2863 |
+ gdev->gd_notify_types = be32_to_cpup(p++); |
2864 |
+ for (i = 1; i < num; i++) { |
2865 |
+diff --git a/fs/squashfs/cache.c b/fs/squashfs/cache.c |
2866 |
+index 23813c078cc9..0839efa720b3 100644 |
2867 |
+--- a/fs/squashfs/cache.c |
2868 |
++++ b/fs/squashfs/cache.c |
2869 |
+@@ -350,6 +350,9 @@ int squashfs_read_metadata(struct super_block *sb, void *buffer, |
2870 |
+ |
2871 |
+ TRACE("Entered squashfs_read_metadata [%llx:%x]\n", *block, *offset); |
2872 |
+ |
2873 |
++ if (unlikely(length < 0)) |
2874 |
++ return -EIO; |
2875 |
++ |
2876 |
+ while (length) { |
2877 |
+ entry = squashfs_cache_get(sb, msblk->block_cache, *block, 0); |
2878 |
+ if (entry->error) { |
2879 |
+diff --git a/fs/squashfs/file.c b/fs/squashfs/file.c |
2880 |
+index 13d80947bf9e..fcff2e0487fe 100644 |
2881 |
+--- a/fs/squashfs/file.c |
2882 |
++++ b/fs/squashfs/file.c |
2883 |
+@@ -194,7 +194,11 @@ static long long read_indexes(struct super_block *sb, int n, |
2884 |
+ } |
2885 |
+ |
2886 |
+ for (i = 0; i < blocks; i++) { |
2887 |
+- int size = le32_to_cpu(blist[i]); |
2888 |
++ int size = squashfs_block_size(blist[i]); |
2889 |
++ if (size < 0) { |
2890 |
++ err = size; |
2891 |
++ goto failure; |
2892 |
++ } |
2893 |
+ block += SQUASHFS_COMPRESSED_SIZE_BLOCK(size); |
2894 |
+ } |
2895 |
+ n -= blocks; |
2896 |
+@@ -367,7 +371,7 @@ static int read_blocklist(struct inode *inode, int index, u64 *block) |
2897 |
+ sizeof(size)); |
2898 |
+ if (res < 0) |
2899 |
+ return res; |
2900 |
+- return le32_to_cpu(size); |
2901 |
++ return squashfs_block_size(size); |
2902 |
+ } |
2903 |
+ |
2904 |
+ /* Copy data into page cache */ |
2905 |
+diff --git a/fs/squashfs/fragment.c b/fs/squashfs/fragment.c |
2906 |
+index 0ed6edbc5c71..86ad9a4b8c36 100644 |
2907 |
+--- a/fs/squashfs/fragment.c |
2908 |
++++ b/fs/squashfs/fragment.c |
2909 |
+@@ -61,9 +61,7 @@ int squashfs_frag_lookup(struct super_block *sb, unsigned int fragment, |
2910 |
+ return size; |
2911 |
+ |
2912 |
+ *fragment_block = le64_to_cpu(fragment_entry.start_block); |
2913 |
+- size = le32_to_cpu(fragment_entry.size); |
2914 |
+- |
2915 |
+- return size; |
2916 |
++ return squashfs_block_size(fragment_entry.size); |
2917 |
+ } |
2918 |
+ |
2919 |
+ |
2920 |
+diff --git a/fs/squashfs/squashfs_fs.h b/fs/squashfs/squashfs_fs.h |
2921 |
+index 506f4ba5b983..e66486366f02 100644 |
2922 |
+--- a/fs/squashfs/squashfs_fs.h |
2923 |
++++ b/fs/squashfs/squashfs_fs.h |
2924 |
+@@ -129,6 +129,12 @@ |
2925 |
+ |
2926 |
+ #define SQUASHFS_COMPRESSED_BLOCK(B) (!((B) & SQUASHFS_COMPRESSED_BIT_BLOCK)) |
2927 |
+ |
2928 |
++static inline int squashfs_block_size(__le32 raw) |
2929 |
++{ |
2930 |
++ u32 size = le32_to_cpu(raw); |
2931 |
++ return (size >> 25) ? -EIO : size; |
2932 |
++} |
2933 |
++ |
2934 |
+ /* |
2935 |
+ * Inode number ops. Inodes consist of a compressed block number, and an |
2936 |
+ * uncompressed offset within that block |
2937 |
+diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h |
2938 |
+index 2a79882cb68e..2fff10de317d 100644 |
2939 |
+--- a/include/drm/drm_dp_helper.h |
2940 |
++++ b/include/drm/drm_dp_helper.h |
2941 |
+@@ -345,6 +345,7 @@ |
2942 |
+ # define DP_PSR_FRAME_CAPTURE (1 << 3) |
2943 |
+ # define DP_PSR_SELECTIVE_UPDATE (1 << 4) |
2944 |
+ # define DP_PSR_IRQ_HPD_WITH_CRC_ERRORS (1 << 5) |
2945 |
++# define DP_PSR_ENABLE_PSR2 (1 << 6) /* eDP 1.4a */ |
2946 |
+ |
2947 |
+ #define DP_ADAPTER_CTRL 0x1a0 |
2948 |
+ # define DP_ADAPTER_CTRL_FORCE_LOAD_SENSE (1 << 0) |
2949 |
+diff --git a/include/linux/dma-iommu.h b/include/linux/dma-iommu.h |
2950 |
+index 32c589062bd9..f30d23011060 100644 |
2951 |
+--- a/include/linux/dma-iommu.h |
2952 |
++++ b/include/linux/dma-iommu.h |
2953 |
+@@ -17,6 +17,7 @@ |
2954 |
+ #define __DMA_IOMMU_H |
2955 |
+ |
2956 |
+ #ifdef __KERNEL__ |
2957 |
++#include <linux/types.h> |
2958 |
+ #include <asm/errno.h> |
2959 |
+ |
2960 |
+ #ifdef CONFIG_IOMMU_DMA |
2961 |
+diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h |
2962 |
+index d43ef96bf075..3e4d4f4bccd3 100644 |
2963 |
+--- a/include/linux/mmc/sdio_ids.h |
2964 |
++++ b/include/linux/mmc/sdio_ids.h |
2965 |
+@@ -34,6 +34,7 @@ |
2966 |
+ #define SDIO_DEVICE_ID_BROADCOM_4335_4339 0x4335 |
2967 |
+ #define SDIO_DEVICE_ID_BROADCOM_4339 0x4339 |
2968 |
+ #define SDIO_DEVICE_ID_BROADCOM_43362 0xa962 |
2969 |
++#define SDIO_DEVICE_ID_BROADCOM_43364 0xa9a4 |
2970 |
+ #define SDIO_DEVICE_ID_BROADCOM_43430 0xa9a6 |
2971 |
+ #define SDIO_DEVICE_ID_BROADCOM_4345 0x4345 |
2972 |
+ #define SDIO_DEVICE_ID_BROADCOM_4354 0x4354 |
2973 |
+diff --git a/include/linux/netfilter/ipset/ip_set_timeout.h b/include/linux/netfilter/ipset/ip_set_timeout.h |
2974 |
+index 1d6a935c1ac5..8793f5a7b820 100644 |
2975 |
+--- a/include/linux/netfilter/ipset/ip_set_timeout.h |
2976 |
++++ b/include/linux/netfilter/ipset/ip_set_timeout.h |
2977 |
+@@ -65,8 +65,14 @@ ip_set_timeout_set(unsigned long *timeout, u32 value) |
2978 |
+ static inline u32 |
2979 |
+ ip_set_timeout_get(unsigned long *timeout) |
2980 |
+ { |
2981 |
+- return *timeout == IPSET_ELEM_PERMANENT ? 0 : |
2982 |
+- jiffies_to_msecs(*timeout - jiffies)/MSEC_PER_SEC; |
2983 |
++ u32 t; |
2984 |
++ |
2985 |
++ if (*timeout == IPSET_ELEM_PERMANENT) |
2986 |
++ return 0; |
2987 |
++ |
2988 |
++ t = jiffies_to_msecs(*timeout - jiffies)/MSEC_PER_SEC; |
2989 |
++ /* Zero value in userspace means no timeout */ |
2990 |
++ return t == 0 ? 1 : t; |
2991 |
+ } |
2992 |
+ |
2993 |
+ #endif /* __KERNEL__ */ |
2994 |
+diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h |
2995 |
+index 7b16c5322673..eb4f6456521e 100644 |
2996 |
+--- a/include/linux/serial_core.h |
2997 |
++++ b/include/linux/serial_core.h |
2998 |
+@@ -344,7 +344,8 @@ struct earlycon_device { |
2999 |
+ }; |
3000 |
+ |
3001 |
+ struct earlycon_id { |
3002 |
+- char name[16]; |
3003 |
++ char name[15]; |
3004 |
++ char name_term; /* In case compiler didn't '\0' term name */ |
3005 |
+ char compatible[128]; |
3006 |
+ int (*setup)(struct earlycon_device *, const char *options); |
3007 |
+ }; |
3008 |
+diff --git a/include/soc/tegra/mc.h b/include/soc/tegra/mc.h |
3009 |
+index 44202ff897fd..f759e0918037 100644 |
3010 |
+--- a/include/soc/tegra/mc.h |
3011 |
++++ b/include/soc/tegra/mc.h |
3012 |
+@@ -99,6 +99,8 @@ struct tegra_mc_soc { |
3013 |
+ u8 client_id_mask; |
3014 |
+ |
3015 |
+ const struct tegra_smmu_soc *smmu; |
3016 |
++ |
3017 |
++ u32 intmask; |
3018 |
+ }; |
3019 |
+ |
3020 |
+ struct tegra_mc { |
3021 |
+diff --git a/kernel/auditfilter.c b/kernel/auditfilter.c |
3022 |
+index 85d9cac497e4..cd4f41397c7e 100644 |
3023 |
+--- a/kernel/auditfilter.c |
3024 |
++++ b/kernel/auditfilter.c |
3025 |
+@@ -406,7 +406,7 @@ static int audit_field_valid(struct audit_entry *entry, struct audit_field *f) |
3026 |
+ return -EINVAL; |
3027 |
+ break; |
3028 |
+ case AUDIT_EXE: |
3029 |
+- if (f->op != Audit_equal) |
3030 |
++ if (f->op != Audit_not_equal && f->op != Audit_equal) |
3031 |
+ return -EINVAL; |
3032 |
+ if (entry->rule.listnr != AUDIT_FILTER_EXIT) |
3033 |
+ return -EINVAL; |
3034 |
+diff --git a/kernel/auditsc.c b/kernel/auditsc.c |
3035 |
+index 2cd5256dbff7..c2aaf539728f 100644 |
3036 |
+--- a/kernel/auditsc.c |
3037 |
++++ b/kernel/auditsc.c |
3038 |
+@@ -469,6 +469,8 @@ static int audit_filter_rules(struct task_struct *tsk, |
3039 |
+ break; |
3040 |
+ case AUDIT_EXE: |
3041 |
+ result = audit_exe_compare(tsk, rule->exe); |
3042 |
++ if (f->op == Audit_not_equal) |
3043 |
++ result = !result; |
3044 |
+ break; |
3045 |
+ case AUDIT_UID: |
3046 |
+ result = audit_uid_comparator(cred->uid, f->op, f->uid); |
3047 |
+diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c |
3048 |
+index 076e4a0ff95e..dafa2708ce9e 100644 |
3049 |
+--- a/kernel/bpf/verifier.c |
3050 |
++++ b/kernel/bpf/verifier.c |
3051 |
+@@ -3225,7 +3225,7 @@ static int replace_map_fd_with_map_ptr(struct bpf_verifier_env *env) |
3052 |
+ /* hold the map. If the program is rejected by verifier, |
3053 |
+ * the map will be released by release_maps() or it |
3054 |
+ * will be used by the valid program until it's unloaded |
3055 |
+- * and all maps are released in free_bpf_prog_info() |
3056 |
++ * and all maps are released in free_used_maps() |
3057 |
+ */ |
3058 |
+ map = bpf_map_inc(map, false); |
3059 |
+ if (IS_ERR(map)) { |
3060 |
+@@ -3629,7 +3629,7 @@ free_log_buf: |
3061 |
+ vfree(log_buf); |
3062 |
+ if (!env->prog->aux->used_maps) |
3063 |
+ /* if we didn't copy map pointers into bpf_prog_info, release |
3064 |
+- * them now. Otherwise free_bpf_prog_info() will release them. |
3065 |
++ * them now. Otherwise free_used_maps() will release them. |
3066 |
+ */ |
3067 |
+ release_maps(env); |
3068 |
+ *prog = env->prog; |
3069 |
+diff --git a/kernel/kcov.c b/kernel/kcov.c |
3070 |
+index 3883df58aa12..b0ec31493fdc 100644 |
3071 |
+--- a/kernel/kcov.c |
3072 |
++++ b/kernel/kcov.c |
3073 |
+@@ -103,7 +103,8 @@ static void kcov_put(struct kcov *kcov) |
3074 |
+ |
3075 |
+ void kcov_task_init(struct task_struct *t) |
3076 |
+ { |
3077 |
+- t->kcov_mode = KCOV_MODE_DISABLED; |
3078 |
++ WRITE_ONCE(t->kcov_mode, KCOV_MODE_DISABLED); |
3079 |
++ barrier(); |
3080 |
+ t->kcov_size = 0; |
3081 |
+ t->kcov_area = NULL; |
3082 |
+ t->kcov = NULL; |
3083 |
+diff --git a/kernel/kthread.c b/kernel/kthread.c |
3084 |
+index c2c911a106cf..fbc230e41969 100644 |
3085 |
+--- a/kernel/kthread.c |
3086 |
++++ b/kernel/kthread.c |
3087 |
+@@ -290,8 +290,14 @@ static struct task_struct *__kthread_create_on_node(int (*threadfn)(void *data), |
3088 |
+ task = create->result; |
3089 |
+ if (!IS_ERR(task)) { |
3090 |
+ static const struct sched_param param = { .sched_priority = 0 }; |
3091 |
++ char name[TASK_COMM_LEN]; |
3092 |
+ |
3093 |
+- vsnprintf(task->comm, sizeof(task->comm), namefmt, args); |
3094 |
++ /* |
3095 |
++ * task is already visible to other tasks, so updating |
3096 |
++ * COMM must be protected. |
3097 |
++ */ |
3098 |
++ vsnprintf(name, sizeof(name), namefmt, args); |
3099 |
++ set_task_comm(task, name); |
3100 |
+ /* |
3101 |
+ * root may have changed our (kthreadd's) priority or CPU mask. |
3102 |
+ * The kernel thread should not inherit these properties. |
3103 |
+diff --git a/kernel/stop_machine.c b/kernel/stop_machine.c |
3104 |
+index ec9ab2f01489..9b8cd7ebf27b 100644 |
3105 |
+--- a/kernel/stop_machine.c |
3106 |
++++ b/kernel/stop_machine.c |
3107 |
+@@ -36,7 +36,7 @@ struct cpu_stop_done { |
3108 |
+ struct cpu_stopper { |
3109 |
+ struct task_struct *thread; |
3110 |
+ |
3111 |
+- spinlock_t lock; |
3112 |
++ raw_spinlock_t lock; |
3113 |
+ bool enabled; /* is this stopper enabled? */ |
3114 |
+ struct list_head works; /* list of pending works */ |
3115 |
+ |
3116 |
+@@ -78,13 +78,13 @@ static bool cpu_stop_queue_work(unsigned int cpu, struct cpu_stop_work *work) |
3117 |
+ unsigned long flags; |
3118 |
+ bool enabled; |
3119 |
+ |
3120 |
+- spin_lock_irqsave(&stopper->lock, flags); |
3121 |
++ raw_spin_lock_irqsave(&stopper->lock, flags); |
3122 |
+ enabled = stopper->enabled; |
3123 |
+ if (enabled) |
3124 |
+ __cpu_stop_queue_work(stopper, work); |
3125 |
+ else if (work->done) |
3126 |
+ cpu_stop_signal_done(work->done); |
3127 |
+- spin_unlock_irqrestore(&stopper->lock, flags); |
3128 |
++ raw_spin_unlock_irqrestore(&stopper->lock, flags); |
3129 |
+ |
3130 |
+ return enabled; |
3131 |
+ } |
3132 |
+@@ -231,8 +231,8 @@ static int cpu_stop_queue_two_works(int cpu1, struct cpu_stop_work *work1, |
3133 |
+ struct cpu_stopper *stopper2 = per_cpu_ptr(&cpu_stopper, cpu2); |
3134 |
+ int err; |
3135 |
+ retry: |
3136 |
+- spin_lock_irq(&stopper1->lock); |
3137 |
+- spin_lock_nested(&stopper2->lock, SINGLE_DEPTH_NESTING); |
3138 |
++ raw_spin_lock_irq(&stopper1->lock); |
3139 |
++ raw_spin_lock_nested(&stopper2->lock, SINGLE_DEPTH_NESTING); |
3140 |
+ |
3141 |
+ err = -ENOENT; |
3142 |
+ if (!stopper1->enabled || !stopper2->enabled) |
3143 |
+@@ -255,8 +255,8 @@ retry: |
3144 |
+ __cpu_stop_queue_work(stopper1, work1); |
3145 |
+ __cpu_stop_queue_work(stopper2, work2); |
3146 |
+ unlock: |
3147 |
+- spin_unlock(&stopper2->lock); |
3148 |
+- spin_unlock_irq(&stopper1->lock); |
3149 |
++ raw_spin_unlock(&stopper2->lock); |
3150 |
++ raw_spin_unlock_irq(&stopper1->lock); |
3151 |
+ |
3152 |
+ if (unlikely(err == -EDEADLK)) { |
3153 |
+ while (stop_cpus_in_progress) |
3154 |
+@@ -448,9 +448,9 @@ static int cpu_stop_should_run(unsigned int cpu) |
3155 |
+ unsigned long flags; |
3156 |
+ int run; |
3157 |
+ |
3158 |
+- spin_lock_irqsave(&stopper->lock, flags); |
3159 |
++ raw_spin_lock_irqsave(&stopper->lock, flags); |
3160 |
+ run = !list_empty(&stopper->works); |
3161 |
+- spin_unlock_irqrestore(&stopper->lock, flags); |
3162 |
++ raw_spin_unlock_irqrestore(&stopper->lock, flags); |
3163 |
+ return run; |
3164 |
+ } |
3165 |
+ |
3166 |
+@@ -461,13 +461,13 @@ static void cpu_stopper_thread(unsigned int cpu) |
3167 |
+ |
3168 |
+ repeat: |
3169 |
+ work = NULL; |
3170 |
+- spin_lock_irq(&stopper->lock); |
3171 |
++ raw_spin_lock_irq(&stopper->lock); |
3172 |
+ if (!list_empty(&stopper->works)) { |
3173 |
+ work = list_first_entry(&stopper->works, |
3174 |
+ struct cpu_stop_work, list); |
3175 |
+ list_del_init(&work->list); |
3176 |
+ } |
3177 |
+- spin_unlock_irq(&stopper->lock); |
3178 |
++ raw_spin_unlock_irq(&stopper->lock); |
3179 |
+ |
3180 |
+ if (work) { |
3181 |
+ cpu_stop_fn_t fn = work->fn; |
3182 |
+@@ -541,7 +541,7 @@ static int __init cpu_stop_init(void) |
3183 |
+ for_each_possible_cpu(cpu) { |
3184 |
+ struct cpu_stopper *stopper = &per_cpu(cpu_stopper, cpu); |
3185 |
+ |
3186 |
+- spin_lock_init(&stopper->lock); |
3187 |
++ raw_spin_lock_init(&stopper->lock); |
3188 |
+ INIT_LIST_HEAD(&stopper->works); |
3189 |
+ } |
3190 |
+ |
3191 |
+diff --git a/kernel/trace/trace_events_trigger.c b/kernel/trace/trace_events_trigger.c |
3192 |
+index 88f398af57fa..8819944bbcbf 100644 |
3193 |
+--- a/kernel/trace/trace_events_trigger.c |
3194 |
++++ b/kernel/trace/trace_events_trigger.c |
3195 |
+@@ -678,6 +678,8 @@ event_trigger_callback(struct event_command *cmd_ops, |
3196 |
+ goto out_free; |
3197 |
+ |
3198 |
+ out_reg: |
3199 |
++ /* Up the trigger_data count to make sure reg doesn't free it on failure */ |
3200 |
++ event_trigger_init(trigger_ops, trigger_data); |
3201 |
+ ret = cmd_ops->reg(glob, trigger_ops, trigger_data, file); |
3202 |
+ /* |
3203 |
+ * The above returns on success the # of functions enabled, |
3204 |
+@@ -685,11 +687,13 @@ event_trigger_callback(struct event_command *cmd_ops, |
3205 |
+ * Consider no functions a failure too. |
3206 |
+ */ |
3207 |
+ if (!ret) { |
3208 |
++ cmd_ops->unreg(glob, trigger_ops, trigger_data, file); |
3209 |
+ ret = -ENOENT; |
3210 |
+- goto out_free; |
3211 |
+- } else if (ret < 0) |
3212 |
+- goto out_free; |
3213 |
+- ret = 0; |
3214 |
++ } else if (ret > 0) |
3215 |
++ ret = 0; |
3216 |
++ |
3217 |
++ /* Down the counter of trigger_data or free it if not used anymore */ |
3218 |
++ event_trigger_free(trigger_ops, trigger_data); |
3219 |
+ out: |
3220 |
+ return ret; |
3221 |
+ |
3222 |
+@@ -1385,6 +1389,9 @@ int event_enable_trigger_func(struct event_command *cmd_ops, |
3223 |
+ goto out; |
3224 |
+ } |
3225 |
+ |
3226 |
++ /* Up the trigger_data count to make sure nothing frees it on failure */ |
3227 |
++ event_trigger_init(trigger_ops, trigger_data); |
3228 |
++ |
3229 |
+ if (trigger) { |
3230 |
+ number = strsep(&trigger, ":"); |
3231 |
+ |
3232 |
+@@ -1435,6 +1442,7 @@ int event_enable_trigger_func(struct event_command *cmd_ops, |
3233 |
+ goto out_disable; |
3234 |
+ /* Just return zero, not the number of enabled functions */ |
3235 |
+ ret = 0; |
3236 |
++ event_trigger_free(trigger_ops, trigger_data); |
3237 |
+ out: |
3238 |
+ return ret; |
3239 |
+ |
3240 |
+@@ -1445,7 +1453,7 @@ int event_enable_trigger_func(struct event_command *cmd_ops, |
3241 |
+ out_free: |
3242 |
+ if (cmd_ops->set_filter) |
3243 |
+ cmd_ops->set_filter(NULL, trigger_data, NULL); |
3244 |
+- kfree(trigger_data); |
3245 |
++ event_trigger_free(trigger_ops, trigger_data); |
3246 |
+ kfree(enable_data); |
3247 |
+ goto out; |
3248 |
+ } |
3249 |
+diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c |
3250 |
+index ea3ed03fed7e..3b4cd44ad323 100644 |
3251 |
+--- a/kernel/trace/trace_kprobe.c |
3252 |
++++ b/kernel/trace/trace_kprobe.c |
3253 |
+@@ -359,11 +359,10 @@ static struct trace_kprobe *find_trace_kprobe(const char *event, |
3254 |
+ static int |
3255 |
+ enable_trace_kprobe(struct trace_kprobe *tk, struct trace_event_file *file) |
3256 |
+ { |
3257 |
++ struct event_file_link *link = NULL; |
3258 |
+ int ret = 0; |
3259 |
+ |
3260 |
+ if (file) { |
3261 |
+- struct event_file_link *link; |
3262 |
+- |
3263 |
+ link = kmalloc(sizeof(*link), GFP_KERNEL); |
3264 |
+ if (!link) { |
3265 |
+ ret = -ENOMEM; |
3266 |
+@@ -383,6 +382,18 @@ enable_trace_kprobe(struct trace_kprobe *tk, struct trace_event_file *file) |
3267 |
+ else |
3268 |
+ ret = enable_kprobe(&tk->rp.kp); |
3269 |
+ } |
3270 |
++ |
3271 |
++ if (ret) { |
3272 |
++ if (file) { |
3273 |
++ /* Notice the if is true on not WARN() */ |
3274 |
++ if (!WARN_ON_ONCE(!link)) |
3275 |
++ list_del_rcu(&link->list); |
3276 |
++ kfree(link); |
3277 |
++ tk->tp.flags &= ~TP_FLAG_TRACE; |
3278 |
++ } else { |
3279 |
++ tk->tp.flags &= ~TP_FLAG_PROFILE; |
3280 |
++ } |
3281 |
++ } |
3282 |
+ out: |
3283 |
+ return ret; |
3284 |
+ } |
3285 |
+diff --git a/mm/slub.c b/mm/slub.c |
3286 |
+index edc79ca3c6d5..e0ce5dec84ba 100644 |
3287 |
+--- a/mm/slub.c |
3288 |
++++ b/mm/slub.c |
3289 |
+@@ -673,7 +673,7 @@ void object_err(struct kmem_cache *s, struct page *page, |
3290 |
+ print_trailer(s, page, object); |
3291 |
+ } |
3292 |
+ |
3293 |
+-static void slab_err(struct kmem_cache *s, struct page *page, |
3294 |
++static __printf(3, 4) void slab_err(struct kmem_cache *s, struct page *page, |
3295 |
+ const char *fmt, ...) |
3296 |
+ { |
3297 |
+ va_list args; |
3298 |
+diff --git a/mm/vmalloc.c b/mm/vmalloc.c |
3299 |
+index 195de42bea1f..fa598162dbf0 100644 |
3300 |
+--- a/mm/vmalloc.c |
3301 |
++++ b/mm/vmalloc.c |
3302 |
+@@ -1494,7 +1494,7 @@ static void __vunmap(const void *addr, int deallocate_pages) |
3303 |
+ addr)) |
3304 |
+ return; |
3305 |
+ |
3306 |
+- area = remove_vm_area(addr); |
3307 |
++ area = find_vmap_area((unsigned long)addr)->vm; |
3308 |
+ if (unlikely(!area)) { |
3309 |
+ WARN(1, KERN_ERR "Trying to vfree() nonexistent vm area (%p)\n", |
3310 |
+ addr); |
3311 |
+@@ -1504,6 +1504,7 @@ static void __vunmap(const void *addr, int deallocate_pages) |
3312 |
+ debug_check_no_locks_freed(addr, get_vm_area_size(area)); |
3313 |
+ debug_check_no_obj_freed(addr, get_vm_area_size(area)); |
3314 |
+ |
3315 |
++ remove_vm_area(addr); |
3316 |
+ if (deallocate_pages) { |
3317 |
+ int i; |
3318 |
+ |
3319 |
+diff --git a/net/ipv4/ipconfig.c b/net/ipv4/ipconfig.c |
3320 |
+index b23464d9c538..d278b06459ac 100644 |
3321 |
+--- a/net/ipv4/ipconfig.c |
3322 |
++++ b/net/ipv4/ipconfig.c |
3323 |
+@@ -779,6 +779,11 @@ static void __init ic_bootp_init_ext(u8 *e) |
3324 |
+ */ |
3325 |
+ static inline void __init ic_bootp_init(void) |
3326 |
+ { |
3327 |
++ /* Re-initialise all name servers to NONE, in case any were set via the |
3328 |
++ * "ip=" or "nfsaddrs=" kernel command line parameters: any IP addresses |
3329 |
++ * specified there will already have been decoded but are no longer |
3330 |
++ * needed |
3331 |
++ */ |
3332 |
+ ic_nameservers_predef(); |
3333 |
+ |
3334 |
+ dev_add_pack(&bootp_packet_type); |
3335 |
+@@ -1401,6 +1406,13 @@ static int __init ip_auto_config(void) |
3336 |
+ int err; |
3337 |
+ unsigned int i; |
3338 |
+ |
3339 |
++ /* Initialise all name servers to NONE (but only if the "ip=" or |
3340 |
++ * "nfsaddrs=" kernel command line parameters weren't decoded, otherwise |
3341 |
++ * we'll overwrite the IP addresses specified there) |
3342 |
++ */ |
3343 |
++ if (ic_set_manually == 0) |
3344 |
++ ic_nameservers_predef(); |
3345 |
++ |
3346 |
+ #ifdef CONFIG_PROC_FS |
3347 |
+ proc_create("pnp", S_IRUGO, init_net.proc_net, &pnp_seq_fops); |
3348 |
+ #endif /* CONFIG_PROC_FS */ |
3349 |
+@@ -1621,6 +1633,7 @@ static int __init ip_auto_config_setup(char *addrs) |
3350 |
+ return 1; |
3351 |
+ } |
3352 |
+ |
3353 |
++ /* Initialise all name servers to NONE */ |
3354 |
+ ic_nameservers_predef(); |
3355 |
+ |
3356 |
+ /* Parse string for static IP assignment. */ |
3357 |
+diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c |
3358 |
+index 762f31fb5b67..a3fb30f5a1a9 100644 |
3359 |
+--- a/net/netfilter/nf_tables_api.c |
3360 |
++++ b/net/netfilter/nf_tables_api.c |
3361 |
+@@ -2476,12 +2476,13 @@ struct nft_set *nf_tables_set_lookup_byid(const struct net *net, |
3362 |
+ u32 id = ntohl(nla_get_be32(nla)); |
3363 |
+ |
3364 |
+ list_for_each_entry(trans, &net->nft.commit_list, list) { |
3365 |
+- struct nft_set *set = nft_trans_set(trans); |
3366 |
++ if (trans->msg_type == NFT_MSG_NEWSET) { |
3367 |
++ struct nft_set *set = nft_trans_set(trans); |
3368 |
+ |
3369 |
+- if (trans->msg_type == NFT_MSG_NEWSET && |
3370 |
+- id == nft_trans_set_id(trans) && |
3371 |
+- nft_active_genmask(set, genmask)) |
3372 |
+- return set; |
3373 |
++ if (id == nft_trans_set_id(trans) && |
3374 |
++ nft_active_genmask(set, genmask)) |
3375 |
++ return set; |
3376 |
++ } |
3377 |
+ } |
3378 |
+ return ERR_PTR(-ENOENT); |
3379 |
+ } |
3380 |
+diff --git a/security/integrity/ima/ima_main.c b/security/integrity/ima/ima_main.c |
3381 |
+index a71f906b4f7a..9652541c4d43 100644 |
3382 |
+--- a/security/integrity/ima/ima_main.c |
3383 |
++++ b/security/integrity/ima/ima_main.c |
3384 |
+@@ -379,6 +379,7 @@ int ima_read_file(struct file *file, enum kernel_read_file_id read_id) |
3385 |
+ |
3386 |
+ static int read_idmap[READING_MAX_ID] = { |
3387 |
+ [READING_FIRMWARE] = FIRMWARE_CHECK, |
3388 |
++ [READING_FIRMWARE_PREALLOC_BUFFER] = FIRMWARE_CHECK, |
3389 |
+ [READING_MODULE] = MODULE_CHECK, |
3390 |
+ [READING_KEXEC_IMAGE] = KEXEC_KERNEL_CHECK, |
3391 |
+ [READING_KEXEC_INITRAMFS] = KEXEC_INITRAMFS_CHECK, |
3392 |
+diff --git a/sound/pci/emu10k1/emupcm.c b/sound/pci/emu10k1/emupcm.c |
3393 |
+index 37be1e14d756..0d2bb30d9f7e 100644 |
3394 |
+--- a/sound/pci/emu10k1/emupcm.c |
3395 |
++++ b/sound/pci/emu10k1/emupcm.c |
3396 |
+@@ -1850,7 +1850,9 @@ int snd_emu10k1_pcm_efx(struct snd_emu10k1 *emu, int device) |
3397 |
+ if (!kctl) |
3398 |
+ return -ENOMEM; |
3399 |
+ kctl->id.device = device; |
3400 |
+- snd_ctl_add(emu->card, kctl); |
3401 |
++ err = snd_ctl_add(emu->card, kctl); |
3402 |
++ if (err < 0) |
3403 |
++ return err; |
3404 |
+ |
3405 |
+ snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, snd_dma_pci_data(emu->pci), 64*1024, 64*1024); |
3406 |
+ |
3407 |
+diff --git a/sound/pci/emu10k1/memory.c b/sound/pci/emu10k1/memory.c |
3408 |
+index 4f1f69be1865..8c778fa33031 100644 |
3409 |
+--- a/sound/pci/emu10k1/memory.c |
3410 |
++++ b/sound/pci/emu10k1/memory.c |
3411 |
+@@ -237,13 +237,13 @@ __found_pages: |
3412 |
+ static int is_valid_page(struct snd_emu10k1 *emu, dma_addr_t addr) |
3413 |
+ { |
3414 |
+ if (addr & ~emu->dma_mask) { |
3415 |
+- dev_err(emu->card->dev, |
3416 |
++ dev_err_ratelimited(emu->card->dev, |
3417 |
+ "max memory size is 0x%lx (addr = 0x%lx)!!\n", |
3418 |
+ emu->dma_mask, (unsigned long)addr); |
3419 |
+ return 0; |
3420 |
+ } |
3421 |
+ if (addr & (EMUPAGESIZE-1)) { |
3422 |
+- dev_err(emu->card->dev, "page is not aligned\n"); |
3423 |
++ dev_err_ratelimited(emu->card->dev, "page is not aligned\n"); |
3424 |
+ return 0; |
3425 |
+ } |
3426 |
+ return 1; |
3427 |
+@@ -334,7 +334,7 @@ snd_emu10k1_alloc_pages(struct snd_emu10k1 *emu, struct snd_pcm_substream *subst |
3428 |
+ else |
3429 |
+ addr = snd_pcm_sgbuf_get_addr(substream, ofs); |
3430 |
+ if (! is_valid_page(emu, addr)) { |
3431 |
+- dev_err(emu->card->dev, |
3432 |
++ dev_err_ratelimited(emu->card->dev, |
3433 |
+ "emu: failure page = %d\n", idx); |
3434 |
+ mutex_unlock(&hdr->block_mutex); |
3435 |
+ return NULL; |
3436 |
+diff --git a/sound/pci/fm801.c b/sound/pci/fm801.c |
3437 |
+index a178e0d03088..8561f60b4284 100644 |
3438 |
+--- a/sound/pci/fm801.c |
3439 |
++++ b/sound/pci/fm801.c |
3440 |
+@@ -1068,11 +1068,19 @@ static int snd_fm801_mixer(struct fm801 *chip) |
3441 |
+ if ((err = snd_ac97_mixer(chip->ac97_bus, &ac97, &chip->ac97_sec)) < 0) |
3442 |
+ return err; |
3443 |
+ } |
3444 |
+- for (i = 0; i < FM801_CONTROLS; i++) |
3445 |
+- snd_ctl_add(chip->card, snd_ctl_new1(&snd_fm801_controls[i], chip)); |
3446 |
++ for (i = 0; i < FM801_CONTROLS; i++) { |
3447 |
++ err = snd_ctl_add(chip->card, |
3448 |
++ snd_ctl_new1(&snd_fm801_controls[i], chip)); |
3449 |
++ if (err < 0) |
3450 |
++ return err; |
3451 |
++ } |
3452 |
+ if (chip->multichannel) { |
3453 |
+- for (i = 0; i < FM801_CONTROLS_MULTI; i++) |
3454 |
+- snd_ctl_add(chip->card, snd_ctl_new1(&snd_fm801_controls_multi[i], chip)); |
3455 |
++ for (i = 0; i < FM801_CONTROLS_MULTI; i++) { |
3456 |
++ err = snd_ctl_add(chip->card, |
3457 |
++ snd_ctl_new1(&snd_fm801_controls_multi[i], chip)); |
3458 |
++ if (err < 0) |
3459 |
++ return err; |
3460 |
++ } |
3461 |
+ } |
3462 |
+ return 0; |
3463 |
+ } |
3464 |
+diff --git a/sound/pci/hda/patch_ca0132.c b/sound/pci/hda/patch_ca0132.c |
3465 |
+index 9ec4dba8a793..280999961226 100644 |
3466 |
+--- a/sound/pci/hda/patch_ca0132.c |
3467 |
++++ b/sound/pci/hda/patch_ca0132.c |
3468 |
+@@ -38,6 +38,10 @@ |
3469 |
+ /* Enable this to see controls for tuning purpose. */ |
3470 |
+ /*#define ENABLE_TUNING_CONTROLS*/ |
3471 |
+ |
3472 |
++#ifdef ENABLE_TUNING_CONTROLS |
3473 |
++#include <sound/tlv.h> |
3474 |
++#endif |
3475 |
++ |
3476 |
+ #define FLOAT_ZERO 0x00000000 |
3477 |
+ #define FLOAT_ONE 0x3f800000 |
3478 |
+ #define FLOAT_TWO 0x40000000 |
3479 |
+@@ -3067,8 +3071,8 @@ static int equalizer_ctl_put(struct snd_kcontrol *kcontrol, |
3480 |
+ return 1; |
3481 |
+ } |
3482 |
+ |
3483 |
+-static const DECLARE_TLV_DB_SCALE(voice_focus_db_scale, 2000, 100, 0); |
3484 |
+-static const DECLARE_TLV_DB_SCALE(eq_db_scale, -2400, 100, 0); |
3485 |
++static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(voice_focus_db_scale, 2000, 100, 0); |
3486 |
++static const SNDRV_CTL_TLVD_DECLARE_DB_SCALE(eq_db_scale, -2400, 100, 0); |
3487 |
+ |
3488 |
+ static int add_tuning_control(struct hda_codec *codec, |
3489 |
+ hda_nid_t pnid, hda_nid_t nid, |
3490 |
+diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c |
3491 |
+index 80088c98ce27..20680a490897 100644 |
3492 |
+--- a/sound/soc/soc-pcm.c |
3493 |
++++ b/sound/soc/soc-pcm.c |
3494 |
+@@ -1793,8 +1793,10 @@ int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream) |
3495 |
+ continue; |
3496 |
+ |
3497 |
+ if ((be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE) && |
3498 |
+- (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) |
3499 |
+- continue; |
3500 |
++ (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) { |
3501 |
++ soc_pcm_hw_free(be_substream); |
3502 |
++ be->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_FREE; |
3503 |
++ } |
3504 |
+ |
3505 |
+ dev_dbg(be->dev, "ASoC: close BE %s\n", |
3506 |
+ be->dai_link->name); |
3507 |
+diff --git a/sound/usb/pcm.c b/sound/usb/pcm.c |
3508 |
+index c5dfe82beb24..e6ac7b9b4648 100644 |
3509 |
+--- a/sound/usb/pcm.c |
3510 |
++++ b/sound/usb/pcm.c |
3511 |
+@@ -1310,7 +1310,7 @@ static void retire_capture_urb(struct snd_usb_substream *subs, |
3512 |
+ if (bytes % (runtime->sample_bits >> 3) != 0) { |
3513 |
+ int oldbytes = bytes; |
3514 |
+ bytes = frames * stride; |
3515 |
+- dev_warn(&subs->dev->dev, |
3516 |
++ dev_warn_ratelimited(&subs->dev->dev, |
3517 |
+ "Corrected urb data len. %d->%d\n", |
3518 |
+ oldbytes, bytes); |
3519 |
+ } |
3520 |
+diff --git a/tools/perf/util/parse-events.y b/tools/perf/util/parse-events.y |
3521 |
+index 879115f93edc..98a4205a5f8a 100644 |
3522 |
+--- a/tools/perf/util/parse-events.y |
3523 |
++++ b/tools/perf/util/parse-events.y |
3524 |
+@@ -68,6 +68,7 @@ static void inc_group_count(struct list_head *list, |
3525 |
+ %type <num> value_sym |
3526 |
+ %type <head> event_config |
3527 |
+ %type <head> opt_event_config |
3528 |
++%type <head> opt_pmu_config |
3529 |
+ %type <term> event_term |
3530 |
+ %type <head> event_pmu |
3531 |
+ %type <head> event_legacy_symbol |
3532 |
+@@ -219,7 +220,7 @@ event_def: event_pmu | |
3533 |
+ event_bpf_file |
3534 |
+ |
3535 |
+ event_pmu: |
3536 |
+-PE_NAME opt_event_config |
3537 |
++PE_NAME opt_pmu_config |
3538 |
+ { |
3539 |
+ struct parse_events_evlist *data = _data; |
3540 |
+ struct list_head *list; |
3541 |
+@@ -482,6 +483,17 @@ opt_event_config: |
3542 |
+ $$ = NULL; |
3543 |
+ } |
3544 |
+ |
3545 |
++opt_pmu_config: |
3546 |
++'/' event_config '/' |
3547 |
++{ |
3548 |
++ $$ = $2; |
3549 |
++} |
3550 |
++| |
3551 |
++'/' '/' |
3552 |
++{ |
3553 |
++ $$ = NULL; |
3554 |
++} |
3555 |
++ |
3556 |
+ start_terms: event_config |
3557 |
+ { |
3558 |
+ struct parse_events_terms *data = _data; |
3559 |
+diff --git a/tools/testing/selftests/intel_pstate/run.sh b/tools/testing/selftests/intel_pstate/run.sh |
3560 |
+index 7868c106b8b1..b62876f41eca 100755 |
3561 |
+--- a/tools/testing/selftests/intel_pstate/run.sh |
3562 |
++++ b/tools/testing/selftests/intel_pstate/run.sh |
3563 |
+@@ -48,11 +48,12 @@ function run_test () { |
3564 |
+ |
3565 |
+ echo "sleeping for 5 seconds" |
3566 |
+ sleep 5 |
3567 |
+- num_freqs=$(cat /proc/cpuinfo | grep MHz | sort -u | wc -l) |
3568 |
+- if [ $num_freqs -le 2 ]; then |
3569 |
+- cat /proc/cpuinfo | grep MHz | sort -u | tail -1 > /tmp/result.$1 |
3570 |
++ grep MHz /proc/cpuinfo | sort -u > /tmp/result.freqs |
3571 |
++ num_freqs=$(wc -l /tmp/result.freqs | awk ' { print $1 } ') |
3572 |
++ if [ $num_freqs -ge 2 ]; then |
3573 |
++ tail -n 1 /tmp/result.freqs > /tmp/result.$1 |
3574 |
+ else |
3575 |
+- cat /proc/cpuinfo | grep MHz | sort -u > /tmp/result.$1 |
3576 |
++ cp /tmp/result.freqs /tmp/result.$1 |
3577 |
+ fi |
3578 |
+ ./msr 0 >> /tmp/result.$1 |
3579 |
+ |
3580 |
+@@ -82,21 +83,20 @@ _max_freq=$(cpupower frequency-info -l | tail -1 | awk ' { print $2 } ') |
3581 |
+ max_freq=$(($_max_freq / 1000)) |
3582 |
+ |
3583 |
+ |
3584 |
+-for freq in `seq $max_freq -100 $min_freq` |
3585 |
++[ $EVALUATE_ONLY -eq 0 ] && for freq in `seq $max_freq -100 $min_freq` |
3586 |
+ do |
3587 |
+ echo "Setting maximum frequency to $freq" |
3588 |
+ cpupower frequency-set -g powersave --max=${freq}MHz >& /dev/null |
3589 |
+- [ $EVALUATE_ONLY -eq 0 ] && run_test $freq |
3590 |
++ run_test $freq |
3591 |
+ done |
3592 |
+ |
3593 |
+-echo "==============================================================================" |
3594 |
++[ $EVALUATE_ONLY -eq 0 ] && cpupower frequency-set -g powersave --max=${max_freq}MHz >& /dev/null |
3595 |
+ |
3596 |
++echo "==============================================================================" |
3597 |
+ echo "The marketing frequency of the cpu is $mkt_freq MHz" |
3598 |
+ echo "The maximum frequency of the cpu is $max_freq MHz" |
3599 |
+ echo "The minimum frequency of the cpu is $min_freq MHz" |
3600 |
+ |
3601 |
+-cpupower frequency-set -g powersave --max=${max_freq}MHz >& /dev/null |
3602 |
+- |
3603 |
+ # make a pretty table |
3604 |
+ echo "Target Actual Difference MSR(0x199) max_perf_pct" |
3605 |
+ for freq in `seq $max_freq -100 $min_freq` |
3606 |
+@@ -104,10 +104,6 @@ do |
3607 |
+ result_freq=$(cat /tmp/result.${freq} | grep "cpu MHz" | awk ' { print $4 } ' | awk -F "." ' { print $1 } ') |
3608 |
+ msr=$(cat /tmp/result.${freq} | grep "msr" | awk ' { print $3 } ') |
3609 |
+ max_perf_pct=$(cat /tmp/result.${freq} | grep "max_perf_pct" | awk ' { print $2 } ' ) |
3610 |
+- if [ $result_freq -eq $freq ]; then |
3611 |
+- echo " $freq $result_freq 0 $msr $(($max_perf_pct*3300))" |
3612 |
+- else |
3613 |
+- echo " $freq $result_freq $(($result_freq-$freq)) $msr $(($max_perf_pct*$max_freq))" |
3614 |
+- fi |
3615 |
++ echo " $freq $result_freq $(($result_freq-$freq)) $msr $(($max_perf_pct*$max_freq))" |
3616 |
+ done |
3617 |
+ exit 0 |
3618 |
+diff --git a/tools/usb/usbip/src/usbip_detach.c b/tools/usb/usbip/src/usbip_detach.c |
3619 |
+index 9db9d21bb2ec..6a8db858caa5 100644 |
3620 |
+--- a/tools/usb/usbip/src/usbip_detach.c |
3621 |
++++ b/tools/usb/usbip/src/usbip_detach.c |
3622 |
+@@ -43,7 +43,7 @@ void usbip_detach_usage(void) |
3623 |
+ |
3624 |
+ static int detach_port(char *port) |
3625 |
+ { |
3626 |
+- int ret; |
3627 |
++ int ret = 0; |
3628 |
+ uint8_t portnum; |
3629 |
+ char path[PATH_MAX+1]; |
3630 |
+ |
3631 |
+@@ -73,9 +73,12 @@ static int detach_port(char *port) |
3632 |
+ } |
3633 |
+ |
3634 |
+ ret = usbip_vhci_detach_device(portnum); |
3635 |
+- if (ret < 0) |
3636 |
+- return -1; |
3637 |
++ if (ret < 0) { |
3638 |
++ ret = -1; |
3639 |
++ goto call_driver_close; |
3640 |
++ } |
3641 |
+ |
3642 |
++call_driver_close: |
3643 |
+ usbip_vhci_driver_close(); |
3644 |
+ |
3645 |
+ return ret; |