1 |
commit: 39fe86bc72de6a2976071057107ace490bacb774 |
2 |
Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 21 09:05:51 2017 +0000 |
4 |
Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 21 09:05:51 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=39fe86bc |
7 |
|
8 |
linux kernel 4.9.64 |
9 |
|
10 |
0000_README | 4 + |
11 |
1063_linux-4.9.64.patch | 2758 +++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 2762 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index 7c70a9e..c8f1c9c 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -295,6 +295,10 @@ Patch: 1062_linux-4.9.63.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.9.63 |
21 |
|
22 |
+Patch: 1063_linux-4.9.64.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.9.64 |
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/1063_linux-4.9.64.patch b/1063_linux-4.9.64.patch |
31 |
new file mode 100644 |
32 |
index 0000000..469d63b |
33 |
--- /dev/null |
34 |
+++ b/1063_linux-4.9.64.patch |
35 |
@@ -0,0 +1,2758 @@ |
36 |
+diff --git a/Documentation/devicetree/bindings/arm/davinci.txt b/Documentation/devicetree/bindings/arm/davinci.txt |
37 |
+index 715622c36260..f0841ce725b5 100644 |
38 |
+--- a/Documentation/devicetree/bindings/arm/davinci.txt |
39 |
++++ b/Documentation/devicetree/bindings/arm/davinci.txt |
40 |
+@@ -13,10 +13,6 @@ EnBW AM1808 based CMC board |
41 |
+ Required root node properties: |
42 |
+ - compatible = "enbw,cmc", "ti,da850; |
43 |
+ |
44 |
+-LEGO MINDSTORMS EV3 (AM1808 based) |
45 |
+-Required root node properties: |
46 |
+- - compatible = "lego,ev3", "ti,da850"; |
47 |
+- |
48 |
+ Generic DaVinci Boards |
49 |
+ ---------------------- |
50 |
+ |
51 |
+diff --git a/Documentation/devicetree/bindings/vendor-prefixes.txt b/Documentation/devicetree/bindings/vendor-prefixes.txt |
52 |
+index f949a22bcd74..bceffffb7502 100644 |
53 |
+--- a/Documentation/devicetree/bindings/vendor-prefixes.txt |
54 |
++++ b/Documentation/devicetree/bindings/vendor-prefixes.txt |
55 |
+@@ -154,7 +154,6 @@ kosagi Sutajio Ko-Usagi PTE Ltd. |
56 |
+ kyo Kyocera Corporation |
57 |
+ lacie LaCie |
58 |
+ lantiq Lantiq Semiconductor |
59 |
+-lego LEGO Systems A/S |
60 |
+ lenovo Lenovo Group Ltd. |
61 |
+ lg LG Corporation |
62 |
+ linux Linux-specific binding |
63 |
+diff --git a/Makefile b/Makefile |
64 |
+index 339d4a85ffba..d29cace0da6d 100644 |
65 |
+--- a/Makefile |
66 |
++++ b/Makefile |
67 |
+@@ -1,6 +1,6 @@ |
68 |
+ VERSION = 4 |
69 |
+ PATCHLEVEL = 9 |
70 |
+-SUBLEVEL = 63 |
71 |
++SUBLEVEL = 64 |
72 |
+ EXTRAVERSION = |
73 |
+ NAME = Roaring Lionus |
74 |
+ |
75 |
+diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi |
76 |
+index 795c1467fa50..a3277e6436d5 100644 |
77 |
+--- a/arch/arm/boot/dts/am33xx.dtsi |
78 |
++++ b/arch/arm/boot/dts/am33xx.dtsi |
79 |
+@@ -143,10 +143,11 @@ |
80 |
+ }; |
81 |
+ |
82 |
+ scm_conf: scm_conf@0 { |
83 |
+- compatible = "syscon"; |
84 |
++ compatible = "syscon", "simple-bus"; |
85 |
+ reg = <0x0 0x800>; |
86 |
+ #address-cells = <1>; |
87 |
+ #size-cells = <1>; |
88 |
++ ranges = <0 0 0x800>; |
89 |
+ |
90 |
+ scm_clocks: clocks { |
91 |
+ #address-cells = <1>; |
92 |
+diff --git a/arch/arm/boot/dts/dm814x.dtsi b/arch/arm/boot/dts/dm814x.dtsi |
93 |
+index d87efab24fa2..ff57a20af9cd 100644 |
94 |
+--- a/arch/arm/boot/dts/dm814x.dtsi |
95 |
++++ b/arch/arm/boot/dts/dm814x.dtsi |
96 |
+@@ -252,7 +252,7 @@ |
97 |
+ }; |
98 |
+ |
99 |
+ uart1: uart@20000 { |
100 |
+- compatible = "ti,omap3-uart"; |
101 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
102 |
+ ti,hwmods = "uart1"; |
103 |
+ reg = <0x20000 0x2000>; |
104 |
+ clock-frequency = <48000000>; |
105 |
+@@ -262,7 +262,7 @@ |
106 |
+ }; |
107 |
+ |
108 |
+ uart2: uart@22000 { |
109 |
+- compatible = "ti,omap3-uart"; |
110 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
111 |
+ ti,hwmods = "uart2"; |
112 |
+ reg = <0x22000 0x2000>; |
113 |
+ clock-frequency = <48000000>; |
114 |
+@@ -272,7 +272,7 @@ |
115 |
+ }; |
116 |
+ |
117 |
+ uart3: uart@24000 { |
118 |
+- compatible = "ti,omap3-uart"; |
119 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
120 |
+ ti,hwmods = "uart3"; |
121 |
+ reg = <0x24000 0x2000>; |
122 |
+ clock-frequency = <48000000>; |
123 |
+@@ -332,10 +332,11 @@ |
124 |
+ ranges = <0 0x140000 0x20000>; |
125 |
+ |
126 |
+ scm_conf: scm_conf@0 { |
127 |
+- compatible = "syscon"; |
128 |
++ compatible = "syscon", "simple-bus"; |
129 |
+ reg = <0x0 0x800>; |
130 |
+ #address-cells = <1>; |
131 |
+ #size-cells = <1>; |
132 |
++ ranges = <0 0 0x800>; |
133 |
+ |
134 |
+ scm_clocks: clocks { |
135 |
+ #address-cells = <1>; |
136 |
+diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi |
137 |
+index cbdfbc4e4a26..62c0a6155360 100644 |
138 |
+--- a/arch/arm/boot/dts/dm816x.dtsi |
139 |
++++ b/arch/arm/boot/dts/dm816x.dtsi |
140 |
+@@ -371,7 +371,7 @@ |
141 |
+ }; |
142 |
+ |
143 |
+ uart1: uart@48020000 { |
144 |
+- compatible = "ti,omap3-uart"; |
145 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
146 |
+ ti,hwmods = "uart1"; |
147 |
+ reg = <0x48020000 0x2000>; |
148 |
+ clock-frequency = <48000000>; |
149 |
+@@ -381,7 +381,7 @@ |
150 |
+ }; |
151 |
+ |
152 |
+ uart2: uart@48022000 { |
153 |
+- compatible = "ti,omap3-uart"; |
154 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
155 |
+ ti,hwmods = "uart2"; |
156 |
+ reg = <0x48022000 0x2000>; |
157 |
+ clock-frequency = <48000000>; |
158 |
+@@ -391,7 +391,7 @@ |
159 |
+ }; |
160 |
+ |
161 |
+ uart3: uart@48024000 { |
162 |
+- compatible = "ti,omap3-uart"; |
163 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
164 |
+ ti,hwmods = "uart3"; |
165 |
+ reg = <0x48024000 0x2000>; |
166 |
+ clock-frequency = <48000000>; |
167 |
+diff --git a/arch/arm/boot/dts/omap5-uevm.dts b/arch/arm/boot/dts/omap5-uevm.dts |
168 |
+index 53d31a87b44b..f3a3e6be79fe 100644 |
169 |
+--- a/arch/arm/boot/dts/omap5-uevm.dts |
170 |
++++ b/arch/arm/boot/dts/omap5-uevm.dts |
171 |
+@@ -18,6 +18,10 @@ |
172 |
+ reg = <0 0x80000000 0 0x7f000000>; /* 2032 MB */ |
173 |
+ }; |
174 |
+ |
175 |
++ aliases { |
176 |
++ ethernet = ðernet; |
177 |
++ }; |
178 |
++ |
179 |
+ leds { |
180 |
+ compatible = "gpio-leds"; |
181 |
+ led1 { |
182 |
+@@ -72,6 +76,23 @@ |
183 |
+ >; |
184 |
+ }; |
185 |
+ |
186 |
++&usbhsehci { |
187 |
++ #address-cells = <1>; |
188 |
++ #size-cells = <0>; |
189 |
++ |
190 |
++ hub@2 { |
191 |
++ compatible = "usb424,3503"; |
192 |
++ reg = <2>; |
193 |
++ #address-cells = <1>; |
194 |
++ #size-cells = <0>; |
195 |
++ }; |
196 |
++ |
197 |
++ ethernet: usbether@3 { |
198 |
++ compatible = "usb424,9730"; |
199 |
++ reg = <3>; |
200 |
++ }; |
201 |
++}; |
202 |
++ |
203 |
+ &wlcore { |
204 |
+ compatible = "ti,wl1837"; |
205 |
+ }; |
206 |
+diff --git a/arch/arm/crypto/aesbs-glue.c b/arch/arm/crypto/aesbs-glue.c |
207 |
+index 0511a6cafe24..5d934a0039d7 100644 |
208 |
+--- a/arch/arm/crypto/aesbs-glue.c |
209 |
++++ b/arch/arm/crypto/aesbs-glue.c |
210 |
+@@ -363,7 +363,7 @@ static struct crypto_alg aesbs_algs[] = { { |
211 |
+ }, { |
212 |
+ .cra_name = "cbc(aes)", |
213 |
+ .cra_driver_name = "cbc-aes-neonbs", |
214 |
+- .cra_priority = 300, |
215 |
++ .cra_priority = 250, |
216 |
+ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC, |
217 |
+ .cra_blocksize = AES_BLOCK_SIZE, |
218 |
+ .cra_ctxsize = sizeof(struct async_helper_ctx), |
219 |
+@@ -383,7 +383,7 @@ static struct crypto_alg aesbs_algs[] = { { |
220 |
+ }, { |
221 |
+ .cra_name = "ctr(aes)", |
222 |
+ .cra_driver_name = "ctr-aes-neonbs", |
223 |
+- .cra_priority = 300, |
224 |
++ .cra_priority = 250, |
225 |
+ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC, |
226 |
+ .cra_blocksize = 1, |
227 |
+ .cra_ctxsize = sizeof(struct async_helper_ctx), |
228 |
+@@ -403,7 +403,7 @@ static struct crypto_alg aesbs_algs[] = { { |
229 |
+ }, { |
230 |
+ .cra_name = "xts(aes)", |
231 |
+ .cra_driver_name = "xts-aes-neonbs", |
232 |
+- .cra_priority = 300, |
233 |
++ .cra_priority = 250, |
234 |
+ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC, |
235 |
+ .cra_blocksize = AES_BLOCK_SIZE, |
236 |
+ .cra_ctxsize = sizeof(struct async_helper_ctx), |
237 |
+diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c |
238 |
+index 05e20aaf68dd..770216baa737 100644 |
239 |
+--- a/arch/arm/mach-omap2/pdata-quirks.c |
240 |
++++ b/arch/arm/mach-omap2/pdata-quirks.c |
241 |
+@@ -600,7 +600,6 @@ static void pdata_quirks_check(struct pdata_init *quirks) |
242 |
+ if (of_machine_is_compatible(quirks->compatible)) { |
243 |
+ if (quirks->fn) |
244 |
+ quirks->fn(); |
245 |
+- break; |
246 |
+ } |
247 |
+ quirks++; |
248 |
+ } |
249 |
+diff --git a/arch/arm64/boot/dts/broadcom/ns2.dtsi b/arch/arm64/boot/dts/broadcom/ns2.dtsi |
250 |
+index d95dc408629a..a16b1b3f9fc6 100644 |
251 |
+--- a/arch/arm64/boot/dts/broadcom/ns2.dtsi |
252 |
++++ b/arch/arm64/boot/dts/broadcom/ns2.dtsi |
253 |
+@@ -30,6 +30,8 @@ |
254 |
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
255 |
+ */ |
256 |
+ |
257 |
++/memreserve/ 0x81000000 0x00200000; |
258 |
++ |
259 |
+ #include <dt-bindings/interrupt-controller/arm-gic.h> |
260 |
+ #include <dt-bindings/clock/bcm-ns2.h> |
261 |
+ |
262 |
+diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h |
263 |
+index 7c26b28bf252..859cf7048347 100644 |
264 |
+--- a/arch/mips/include/asm/asm.h |
265 |
++++ b/arch/mips/include/asm/asm.h |
266 |
+@@ -54,7 +54,8 @@ |
267 |
+ .align 2; \ |
268 |
+ .type symbol, @function; \ |
269 |
+ .ent symbol, 0; \ |
270 |
+-symbol: .frame sp, 0, ra |
271 |
++symbol: .frame sp, 0, ra; \ |
272 |
++ .insn |
273 |
+ |
274 |
+ /* |
275 |
+ * NESTED - declare nested routine entry point |
276 |
+@@ -63,8 +64,9 @@ symbol: .frame sp, 0, ra |
277 |
+ .globl symbol; \ |
278 |
+ .align 2; \ |
279 |
+ .type symbol, @function; \ |
280 |
+- .ent symbol, 0; \ |
281 |
+-symbol: .frame sp, framesize, rpc |
282 |
++ .ent symbol, 0; \ |
283 |
++symbol: .frame sp, framesize, rpc; \ |
284 |
++ .insn |
285 |
+ |
286 |
+ /* |
287 |
+ * END - mark end of function |
288 |
+@@ -86,7 +88,7 @@ symbol: .frame sp, framesize, rpc |
289 |
+ #define FEXPORT(symbol) \ |
290 |
+ .globl symbol; \ |
291 |
+ .type symbol, @function; \ |
292 |
+-symbol: |
293 |
++symbol: .insn |
294 |
+ |
295 |
+ /* |
296 |
+ * ABS - export absolute symbol |
297 |
+diff --git a/arch/mips/include/asm/mips-cm.h b/arch/mips/include/asm/mips-cm.h |
298 |
+index b6845db453a3..163317fd3d7e 100644 |
299 |
+--- a/arch/mips/include/asm/mips-cm.h |
300 |
++++ b/arch/mips/include/asm/mips-cm.h |
301 |
+@@ -187,6 +187,7 @@ BUILD_CM_R_(config, MIPS_CM_GCB_OFS + 0x00) |
302 |
+ BUILD_CM_RW(base, MIPS_CM_GCB_OFS + 0x08) |
303 |
+ BUILD_CM_RW(access, MIPS_CM_GCB_OFS + 0x20) |
304 |
+ BUILD_CM_R_(rev, MIPS_CM_GCB_OFS + 0x30) |
305 |
++BUILD_CM_RW(err_control, MIPS_CM_GCB_OFS + 0x38) |
306 |
+ BUILD_CM_RW(error_mask, MIPS_CM_GCB_OFS + 0x40) |
307 |
+ BUILD_CM_RW(error_cause, MIPS_CM_GCB_OFS + 0x48) |
308 |
+ BUILD_CM_RW(error_addr, MIPS_CM_GCB_OFS + 0x50) |
309 |
+@@ -266,6 +267,12 @@ BUILD_CM_Cx_R_(tcid_8_priority, 0x80) |
310 |
+ #define CM_REV_CM2_5 CM_ENCODE_REV(7, 0) |
311 |
+ #define CM_REV_CM3 CM_ENCODE_REV(8, 0) |
312 |
+ |
313 |
++/* GCR_ERR_CONTROL register fields */ |
314 |
++#define CM_GCR_ERR_CONTROL_L2_ECC_EN_SHF 1 |
315 |
++#define CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK (_ULCAST_(0x1) << 1) |
316 |
++#define CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_SHF 0 |
317 |
++#define CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_MSK (_ULCAST_(0x1) << 0) |
318 |
++ |
319 |
+ /* GCR_ERROR_CAUSE register fields */ |
320 |
+ #define CM_GCR_ERROR_CAUSE_ERRTYPE_SHF 27 |
321 |
+ #define CM_GCR_ERROR_CAUSE_ERRTYPE_MSK (_ULCAST_(0x1f) << 27) |
322 |
+diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c |
323 |
+index f66e5ce505b2..695950361d2a 100644 |
324 |
+--- a/arch/mips/kernel/setup.c |
325 |
++++ b/arch/mips/kernel/setup.c |
326 |
+@@ -153,6 +153,35 @@ void __init detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_add |
327 |
+ add_memory_region(start, size, BOOT_MEM_RAM); |
328 |
+ } |
329 |
+ |
330 |
++bool __init memory_region_available(phys_addr_t start, phys_addr_t size) |
331 |
++{ |
332 |
++ int i; |
333 |
++ bool in_ram = false, free = true; |
334 |
++ |
335 |
++ for (i = 0; i < boot_mem_map.nr_map; i++) { |
336 |
++ phys_addr_t start_, end_; |
337 |
++ |
338 |
++ start_ = boot_mem_map.map[i].addr; |
339 |
++ end_ = boot_mem_map.map[i].addr + boot_mem_map.map[i].size; |
340 |
++ |
341 |
++ switch (boot_mem_map.map[i].type) { |
342 |
++ case BOOT_MEM_RAM: |
343 |
++ if (start >= start_ && start + size <= end_) |
344 |
++ in_ram = true; |
345 |
++ break; |
346 |
++ case BOOT_MEM_RESERVED: |
347 |
++ if ((start >= start_ && start < end_) || |
348 |
++ (start < start_ && start + size >= start_)) |
349 |
++ free = false; |
350 |
++ break; |
351 |
++ default: |
352 |
++ continue; |
353 |
++ } |
354 |
++ } |
355 |
++ |
356 |
++ return in_ram && free; |
357 |
++} |
358 |
++ |
359 |
+ static void __init print_memory_map(void) |
360 |
+ { |
361 |
+ int i; |
362 |
+@@ -332,11 +361,19 @@ static void __init bootmem_init(void) |
363 |
+ |
364 |
+ #else /* !CONFIG_SGI_IP27 */ |
365 |
+ |
366 |
++static unsigned long __init bootmap_bytes(unsigned long pages) |
367 |
++{ |
368 |
++ unsigned long bytes = DIV_ROUND_UP(pages, 8); |
369 |
++ |
370 |
++ return ALIGN(bytes, sizeof(long)); |
371 |
++} |
372 |
++ |
373 |
+ static void __init bootmem_init(void) |
374 |
+ { |
375 |
+ unsigned long reserved_end; |
376 |
+ unsigned long mapstart = ~0UL; |
377 |
+ unsigned long bootmap_size; |
378 |
++ bool bootmap_valid = false; |
379 |
+ int i; |
380 |
+ |
381 |
+ /* |
382 |
+@@ -430,11 +467,42 @@ static void __init bootmem_init(void) |
383 |
+ #endif |
384 |
+ |
385 |
+ /* |
386 |
+- * Initialize the boot-time allocator with low memory only. |
387 |
++ * check that mapstart doesn't overlap with any of |
388 |
++ * memory regions that have been reserved through eg. DTB |
389 |
+ */ |
390 |
+- bootmap_size = init_bootmem_node(NODE_DATA(0), mapstart, |
391 |
+- min_low_pfn, max_low_pfn); |
392 |
++ bootmap_size = bootmap_bytes(max_low_pfn - min_low_pfn); |
393 |
++ |
394 |
++ bootmap_valid = memory_region_available(PFN_PHYS(mapstart), |
395 |
++ bootmap_size); |
396 |
++ for (i = 0; i < boot_mem_map.nr_map && !bootmap_valid; i++) { |
397 |
++ unsigned long mapstart_addr; |
398 |
++ |
399 |
++ switch (boot_mem_map.map[i].type) { |
400 |
++ case BOOT_MEM_RESERVED: |
401 |
++ mapstart_addr = PFN_ALIGN(boot_mem_map.map[i].addr + |
402 |
++ boot_mem_map.map[i].size); |
403 |
++ if (PHYS_PFN(mapstart_addr) < mapstart) |
404 |
++ break; |
405 |
++ |
406 |
++ bootmap_valid = memory_region_available(mapstart_addr, |
407 |
++ bootmap_size); |
408 |
++ if (bootmap_valid) |
409 |
++ mapstart = PHYS_PFN(mapstart_addr); |
410 |
++ break; |
411 |
++ default: |
412 |
++ break; |
413 |
++ } |
414 |
++ } |
415 |
+ |
416 |
++ if (!bootmap_valid) |
417 |
++ panic("No memory area to place a bootmap bitmap"); |
418 |
++ |
419 |
++ /* |
420 |
++ * Initialize the boot-time allocator with low memory only. |
421 |
++ */ |
422 |
++ if (bootmap_size != init_bootmem_node(NODE_DATA(0), mapstart, |
423 |
++ min_low_pfn, max_low_pfn)) |
424 |
++ panic("Unexpected memory size required for bootmap"); |
425 |
+ |
426 |
+ for (i = 0; i < boot_mem_map.nr_map; i++) { |
427 |
+ unsigned long start, end; |
428 |
+@@ -483,6 +551,10 @@ static void __init bootmem_init(void) |
429 |
+ continue; |
430 |
+ default: |
431 |
+ /* Not usable memory */ |
432 |
++ if (start > min_low_pfn && end < max_low_pfn) |
433 |
++ reserve_bootmem(boot_mem_map.map[i].addr, |
434 |
++ boot_mem_map.map[i].size, |
435 |
++ BOOTMEM_DEFAULT); |
436 |
+ continue; |
437 |
+ } |
438 |
+ |
439 |
+diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c |
440 |
+index b0b29cb6f3d8..bb1d9ff1be5c 100644 |
441 |
+--- a/arch/mips/kernel/traps.c |
442 |
++++ b/arch/mips/kernel/traps.c |
443 |
+@@ -51,6 +51,7 @@ |
444 |
+ #include <asm/idle.h> |
445 |
+ #include <asm/mips-cm.h> |
446 |
+ #include <asm/mips-r2-to-r6-emul.h> |
447 |
++#include <asm/mips-cm.h> |
448 |
+ #include <asm/mipsregs.h> |
449 |
+ #include <asm/mipsmtregs.h> |
450 |
+ #include <asm/module.h> |
451 |
+@@ -1646,6 +1647,65 @@ __setup("nol2par", nol2parity); |
452 |
+ */ |
453 |
+ static inline void parity_protection_init(void) |
454 |
+ { |
455 |
++#define ERRCTL_PE 0x80000000 |
456 |
++#define ERRCTL_L2P 0x00800000 |
457 |
++ |
458 |
++ if (mips_cm_revision() >= CM_REV_CM3) { |
459 |
++ ulong gcr_ectl, cp0_ectl; |
460 |
++ |
461 |
++ /* |
462 |
++ * With CM3 systems we need to ensure that the L1 & L2 |
463 |
++ * parity enables are set to the same value, since this |
464 |
++ * is presumed by the hardware engineers. |
465 |
++ * |
466 |
++ * If the user disabled either of L1 or L2 ECC checking, |
467 |
++ * disable both. |
468 |
++ */ |
469 |
++ l1parity &= l2parity; |
470 |
++ l2parity &= l1parity; |
471 |
++ |
472 |
++ /* Probe L1 ECC support */ |
473 |
++ cp0_ectl = read_c0_ecc(); |
474 |
++ write_c0_ecc(cp0_ectl | ERRCTL_PE); |
475 |
++ back_to_back_c0_hazard(); |
476 |
++ cp0_ectl = read_c0_ecc(); |
477 |
++ |
478 |
++ /* Probe L2 ECC support */ |
479 |
++ gcr_ectl = read_gcr_err_control(); |
480 |
++ |
481 |
++ if (!(gcr_ectl & CM_GCR_ERR_CONTROL_L2_ECC_SUPPORT_MSK) || |
482 |
++ !(cp0_ectl & ERRCTL_PE)) { |
483 |
++ /* |
484 |
++ * One of L1 or L2 ECC checking isn't supported, |
485 |
++ * so we cannot enable either. |
486 |
++ */ |
487 |
++ l1parity = l2parity = 0; |
488 |
++ } |
489 |
++ |
490 |
++ /* Configure L1 ECC checking */ |
491 |
++ if (l1parity) |
492 |
++ cp0_ectl |= ERRCTL_PE; |
493 |
++ else |
494 |
++ cp0_ectl &= ~ERRCTL_PE; |
495 |
++ write_c0_ecc(cp0_ectl); |
496 |
++ back_to_back_c0_hazard(); |
497 |
++ WARN_ON(!!(read_c0_ecc() & ERRCTL_PE) != l1parity); |
498 |
++ |
499 |
++ /* Configure L2 ECC checking */ |
500 |
++ if (l2parity) |
501 |
++ gcr_ectl |= CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK; |
502 |
++ else |
503 |
++ gcr_ectl &= ~CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK; |
504 |
++ write_gcr_err_control(gcr_ectl); |
505 |
++ gcr_ectl = read_gcr_err_control(); |
506 |
++ gcr_ectl &= CM_GCR_ERR_CONTROL_L2_ECC_EN_MSK; |
507 |
++ WARN_ON(!!gcr_ectl != l2parity); |
508 |
++ |
509 |
++ pr_info("Cache parity protection %sabled\n", |
510 |
++ l1parity ? "en" : "dis"); |
511 |
++ return; |
512 |
++ } |
513 |
++ |
514 |
+ switch (current_cpu_type()) { |
515 |
+ case CPU_24K: |
516 |
+ case CPU_34K: |
517 |
+@@ -1656,11 +1716,8 @@ static inline void parity_protection_init(void) |
518 |
+ case CPU_PROAPTIV: |
519 |
+ case CPU_P5600: |
520 |
+ case CPU_QEMU_GENERIC: |
521 |
+- case CPU_I6400: |
522 |
+ case CPU_P6600: |
523 |
+ { |
524 |
+-#define ERRCTL_PE 0x80000000 |
525 |
+-#define ERRCTL_L2P 0x00800000 |
526 |
+ unsigned long errctl; |
527 |
+ unsigned int l1parity_present, l2parity_present; |
528 |
+ |
529 |
+diff --git a/arch/mips/netlogic/common/irq.c b/arch/mips/netlogic/common/irq.c |
530 |
+index 3660dc67d544..f4961bc9a61d 100644 |
531 |
+--- a/arch/mips/netlogic/common/irq.c |
532 |
++++ b/arch/mips/netlogic/common/irq.c |
533 |
+@@ -275,7 +275,7 @@ asmlinkage void plat_irq_dispatch(void) |
534 |
+ do_IRQ(nlm_irq_to_xirq(node, i)); |
535 |
+ } |
536 |
+ |
537 |
+-#ifdef CONFIG_OF |
538 |
++#ifdef CONFIG_CPU_XLP |
539 |
+ static const struct irq_domain_ops xlp_pic_irq_domain_ops = { |
540 |
+ .xlate = irq_domain_xlate_onetwocell, |
541 |
+ }; |
542 |
+@@ -348,7 +348,7 @@ void __init arch_init_irq(void) |
543 |
+ #if defined(CONFIG_CPU_XLR) |
544 |
+ nlm_setup_fmn_irq(); |
545 |
+ #endif |
546 |
+-#if defined(CONFIG_OF) |
547 |
++#ifdef CONFIG_CPU_XLP |
548 |
+ of_irq_init(xlp_pic_irq_ids); |
549 |
+ #endif |
550 |
+ } |
551 |
+diff --git a/arch/x86/kernel/apic/apic.c b/arch/x86/kernel/apic/apic.c |
552 |
+index e2ead34da465..c6583efdbdaf 100644 |
553 |
+--- a/arch/x86/kernel/apic/apic.c |
554 |
++++ b/arch/x86/kernel/apic/apic.c |
555 |
+@@ -1863,14 +1863,14 @@ static void __smp_spurious_interrupt(u8 vector) |
556 |
+ "should never happen.\n", vector, smp_processor_id()); |
557 |
+ } |
558 |
+ |
559 |
+-__visible void smp_spurious_interrupt(struct pt_regs *regs) |
560 |
++__visible void __irq_entry smp_spurious_interrupt(struct pt_regs *regs) |
561 |
+ { |
562 |
+ entering_irq(); |
563 |
+ __smp_spurious_interrupt(~regs->orig_ax); |
564 |
+ exiting_irq(); |
565 |
+ } |
566 |
+ |
567 |
+-__visible void smp_trace_spurious_interrupt(struct pt_regs *regs) |
568 |
++__visible void __irq_entry smp_trace_spurious_interrupt(struct pt_regs *regs) |
569 |
+ { |
570 |
+ u8 vector = ~regs->orig_ax; |
571 |
+ |
572 |
+@@ -1921,14 +1921,14 @@ static void __smp_error_interrupt(struct pt_regs *regs) |
573 |
+ |
574 |
+ } |
575 |
+ |
576 |
+-__visible void smp_error_interrupt(struct pt_regs *regs) |
577 |
++__visible void __irq_entry smp_error_interrupt(struct pt_regs *regs) |
578 |
+ { |
579 |
+ entering_irq(); |
580 |
+ __smp_error_interrupt(regs); |
581 |
+ exiting_irq(); |
582 |
+ } |
583 |
+ |
584 |
+-__visible void smp_trace_error_interrupt(struct pt_regs *regs) |
585 |
++__visible void __irq_entry smp_trace_error_interrupt(struct pt_regs *regs) |
586 |
+ { |
587 |
+ entering_irq(); |
588 |
+ trace_error_apic_entry(ERROR_APIC_VECTOR); |
589 |
+diff --git a/arch/x86/kernel/apic/vector.c b/arch/x86/kernel/apic/vector.c |
590 |
+index 5d30c5e42bb1..f3557a1eb562 100644 |
591 |
+--- a/arch/x86/kernel/apic/vector.c |
592 |
++++ b/arch/x86/kernel/apic/vector.c |
593 |
+@@ -559,7 +559,7 @@ void send_cleanup_vector(struct irq_cfg *cfg) |
594 |
+ __send_cleanup_vector(data); |
595 |
+ } |
596 |
+ |
597 |
+-asmlinkage __visible void smp_irq_move_cleanup_interrupt(void) |
598 |
++asmlinkage __visible void __irq_entry smp_irq_move_cleanup_interrupt(void) |
599 |
+ { |
600 |
+ unsigned vector, me; |
601 |
+ |
602 |
+diff --git a/arch/x86/kernel/cpu/mcheck/mce-severity.c b/arch/x86/kernel/cpu/mcheck/mce-severity.c |
603 |
+index 631356c8cca4..f46071cb2c90 100644 |
604 |
+--- a/arch/x86/kernel/cpu/mcheck/mce-severity.c |
605 |
++++ b/arch/x86/kernel/cpu/mcheck/mce-severity.c |
606 |
+@@ -245,6 +245,9 @@ static int mce_severity_amd(struct mce *m, int tolerant, char **msg, bool is_exc |
607 |
+ |
608 |
+ if (m->status & MCI_STATUS_UC) { |
609 |
+ |
610 |
++ if (ctx == IN_KERNEL) |
611 |
++ return MCE_PANIC_SEVERITY; |
612 |
++ |
613 |
+ /* |
614 |
+ * On older systems where overflow_recov flag is not present, we |
615 |
+ * should simply panic if an error overflow occurs. If |
616 |
+@@ -255,10 +258,6 @@ static int mce_severity_amd(struct mce *m, int tolerant, char **msg, bool is_exc |
617 |
+ if (mce_flags.smca) |
618 |
+ return mce_severity_amd_smca(m, ctx); |
619 |
+ |
620 |
+- /* software can try to contain */ |
621 |
+- if (!(m->mcgstatus & MCG_STATUS_RIPV) && (ctx == IN_KERNEL)) |
622 |
+- return MCE_PANIC_SEVERITY; |
623 |
+- |
624 |
+ /* kill current process */ |
625 |
+ return MCE_AR_SEVERITY; |
626 |
+ } else { |
627 |
+diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c |
628 |
+index a5b47c1361a0..39526e1e3132 100644 |
629 |
+--- a/arch/x86/kernel/cpu/mcheck/mce_amd.c |
630 |
++++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c |
631 |
+@@ -593,14 +593,14 @@ static inline void __smp_deferred_error_interrupt(void) |
632 |
+ deferred_error_int_vector(); |
633 |
+ } |
634 |
+ |
635 |
+-asmlinkage __visible void smp_deferred_error_interrupt(void) |
636 |
++asmlinkage __visible void __irq_entry smp_deferred_error_interrupt(void) |
637 |
+ { |
638 |
+ entering_irq(); |
639 |
+ __smp_deferred_error_interrupt(); |
640 |
+ exiting_ack_irq(); |
641 |
+ } |
642 |
+ |
643 |
+-asmlinkage __visible void smp_trace_deferred_error_interrupt(void) |
644 |
++asmlinkage __visible void __irq_entry smp_trace_deferred_error_interrupt(void) |
645 |
+ { |
646 |
+ entering_irq(); |
647 |
+ trace_deferred_error_apic_entry(DEFERRED_ERROR_VECTOR); |
648 |
+diff --git a/arch/x86/kernel/cpu/mcheck/therm_throt.c b/arch/x86/kernel/cpu/mcheck/therm_throt.c |
649 |
+index 6b9dc4d18ccc..c460c91d0c8f 100644 |
650 |
+--- a/arch/x86/kernel/cpu/mcheck/therm_throt.c |
651 |
++++ b/arch/x86/kernel/cpu/mcheck/therm_throt.c |
652 |
+@@ -431,14 +431,16 @@ static inline void __smp_thermal_interrupt(void) |
653 |
+ smp_thermal_vector(); |
654 |
+ } |
655 |
+ |
656 |
+-asmlinkage __visible void smp_thermal_interrupt(struct pt_regs *regs) |
657 |
++asmlinkage __visible void __irq_entry |
658 |
++smp_thermal_interrupt(struct pt_regs *regs) |
659 |
+ { |
660 |
+ entering_irq(); |
661 |
+ __smp_thermal_interrupt(); |
662 |
+ exiting_ack_irq(); |
663 |
+ } |
664 |
+ |
665 |
+-asmlinkage __visible void smp_trace_thermal_interrupt(struct pt_regs *regs) |
666 |
++asmlinkage __visible void __irq_entry |
667 |
++smp_trace_thermal_interrupt(struct pt_regs *regs) |
668 |
+ { |
669 |
+ entering_irq(); |
670 |
+ trace_thermal_apic_entry(THERMAL_APIC_VECTOR); |
671 |
+diff --git a/arch/x86/kernel/cpu/mcheck/threshold.c b/arch/x86/kernel/cpu/mcheck/threshold.c |
672 |
+index fcf9ae9384f4..976042371b4b 100644 |
673 |
+--- a/arch/x86/kernel/cpu/mcheck/threshold.c |
674 |
++++ b/arch/x86/kernel/cpu/mcheck/threshold.c |
675 |
+@@ -24,14 +24,14 @@ static inline void __smp_threshold_interrupt(void) |
676 |
+ mce_threshold_vector(); |
677 |
+ } |
678 |
+ |
679 |
+-asmlinkage __visible void smp_threshold_interrupt(void) |
680 |
++asmlinkage __visible void __irq_entry smp_threshold_interrupt(void) |
681 |
+ { |
682 |
+ entering_irq(); |
683 |
+ __smp_threshold_interrupt(); |
684 |
+ exiting_ack_irq(); |
685 |
+ } |
686 |
+ |
687 |
+-asmlinkage __visible void smp_trace_threshold_interrupt(void) |
688 |
++asmlinkage __visible void __irq_entry smp_trace_threshold_interrupt(void) |
689 |
+ { |
690 |
+ entering_irq(); |
691 |
+ trace_threshold_apic_entry(THRESHOLD_APIC_VECTOR); |
692 |
+diff --git a/arch/x86/kernel/irq.c b/arch/x86/kernel/irq.c |
693 |
+index 9f669fdd2010..8a7ad9fb22c1 100644 |
694 |
+--- a/arch/x86/kernel/irq.c |
695 |
++++ b/arch/x86/kernel/irq.c |
696 |
+@@ -265,7 +265,7 @@ void __smp_x86_platform_ipi(void) |
697 |
+ x86_platform_ipi_callback(); |
698 |
+ } |
699 |
+ |
700 |
+-__visible void smp_x86_platform_ipi(struct pt_regs *regs) |
701 |
++__visible void __irq_entry smp_x86_platform_ipi(struct pt_regs *regs) |
702 |
+ { |
703 |
+ struct pt_regs *old_regs = set_irq_regs(regs); |
704 |
+ |
705 |
+@@ -316,7 +316,7 @@ __visible void smp_kvm_posted_intr_wakeup_ipi(struct pt_regs *regs) |
706 |
+ } |
707 |
+ #endif |
708 |
+ |
709 |
+-__visible void smp_trace_x86_platform_ipi(struct pt_regs *regs) |
710 |
++__visible void __irq_entry smp_trace_x86_platform_ipi(struct pt_regs *regs) |
711 |
+ { |
712 |
+ struct pt_regs *old_regs = set_irq_regs(regs); |
713 |
+ |
714 |
+diff --git a/arch/x86/kernel/irq_work.c b/arch/x86/kernel/irq_work.c |
715 |
+index 3512ba607361..275487872be2 100644 |
716 |
+--- a/arch/x86/kernel/irq_work.c |
717 |
++++ b/arch/x86/kernel/irq_work.c |
718 |
+@@ -9,6 +9,7 @@ |
719 |
+ #include <linux/hardirq.h> |
720 |
+ #include <asm/apic.h> |
721 |
+ #include <asm/trace/irq_vectors.h> |
722 |
++#include <linux/interrupt.h> |
723 |
+ |
724 |
+ static inline void __smp_irq_work_interrupt(void) |
725 |
+ { |
726 |
+@@ -16,14 +17,14 @@ static inline void __smp_irq_work_interrupt(void) |
727 |
+ irq_work_run(); |
728 |
+ } |
729 |
+ |
730 |
+-__visible void smp_irq_work_interrupt(struct pt_regs *regs) |
731 |
++__visible void __irq_entry smp_irq_work_interrupt(struct pt_regs *regs) |
732 |
+ { |
733 |
+ ipi_entering_ack_irq(); |
734 |
+ __smp_irq_work_interrupt(); |
735 |
+ exiting_irq(); |
736 |
+ } |
737 |
+ |
738 |
+-__visible void smp_trace_irq_work_interrupt(struct pt_regs *regs) |
739 |
++__visible void __irq_entry smp_trace_irq_work_interrupt(struct pt_regs *regs) |
740 |
+ { |
741 |
+ ipi_entering_ack_irq(); |
742 |
+ trace_irq_work_entry(IRQ_WORK_VECTOR); |
743 |
+diff --git a/arch/x86/kernel/smp.c b/arch/x86/kernel/smp.c |
744 |
+index c00cb64bc0a1..ca699677e288 100644 |
745 |
+--- a/arch/x86/kernel/smp.c |
746 |
++++ b/arch/x86/kernel/smp.c |
747 |
+@@ -259,7 +259,7 @@ static inline void __smp_reschedule_interrupt(void) |
748 |
+ scheduler_ipi(); |
749 |
+ } |
750 |
+ |
751 |
+-__visible void smp_reschedule_interrupt(struct pt_regs *regs) |
752 |
++__visible void __irq_entry smp_reschedule_interrupt(struct pt_regs *regs) |
753 |
+ { |
754 |
+ irq_enter(); |
755 |
+ ack_APIC_irq(); |
756 |
+@@ -270,7 +270,7 @@ __visible void smp_reschedule_interrupt(struct pt_regs *regs) |
757 |
+ */ |
758 |
+ } |
759 |
+ |
760 |
+-__visible void smp_trace_reschedule_interrupt(struct pt_regs *regs) |
761 |
++__visible void __irq_entry smp_trace_reschedule_interrupt(struct pt_regs *regs) |
762 |
+ { |
763 |
+ /* |
764 |
+ * Need to call irq_enter() before calling the trace point. |
765 |
+@@ -294,14 +294,15 @@ static inline void __smp_call_function_interrupt(void) |
766 |
+ inc_irq_stat(irq_call_count); |
767 |
+ } |
768 |
+ |
769 |
+-__visible void smp_call_function_interrupt(struct pt_regs *regs) |
770 |
++__visible void __irq_entry smp_call_function_interrupt(struct pt_regs *regs) |
771 |
+ { |
772 |
+ ipi_entering_ack_irq(); |
773 |
+ __smp_call_function_interrupt(); |
774 |
+ exiting_irq(); |
775 |
+ } |
776 |
+ |
777 |
+-__visible void smp_trace_call_function_interrupt(struct pt_regs *regs) |
778 |
++__visible void __irq_entry |
779 |
++smp_trace_call_function_interrupt(struct pt_regs *regs) |
780 |
+ { |
781 |
+ ipi_entering_ack_irq(); |
782 |
+ trace_call_function_entry(CALL_FUNCTION_VECTOR); |
783 |
+@@ -316,14 +317,16 @@ static inline void __smp_call_function_single_interrupt(void) |
784 |
+ inc_irq_stat(irq_call_count); |
785 |
+ } |
786 |
+ |
787 |
+-__visible void smp_call_function_single_interrupt(struct pt_regs *regs) |
788 |
++__visible void __irq_entry |
789 |
++smp_call_function_single_interrupt(struct pt_regs *regs) |
790 |
+ { |
791 |
+ ipi_entering_ack_irq(); |
792 |
+ __smp_call_function_single_interrupt(); |
793 |
+ exiting_irq(); |
794 |
+ } |
795 |
+ |
796 |
+-__visible void smp_trace_call_function_single_interrupt(struct pt_regs *regs) |
797 |
++__visible void __irq_entry |
798 |
++smp_trace_call_function_single_interrupt(struct pt_regs *regs) |
799 |
+ { |
800 |
+ ipi_entering_ack_irq(); |
801 |
+ trace_call_function_single_entry(CALL_FUNCTION_SINGLE_VECTOR); |
802 |
+diff --git a/crypto/Kconfig b/crypto/Kconfig |
803 |
+index fa98ad7edb60..84d71482bf08 100644 |
804 |
+--- a/crypto/Kconfig |
805 |
++++ b/crypto/Kconfig |
806 |
+@@ -360,7 +360,6 @@ config CRYPTO_XTS |
807 |
+ select CRYPTO_BLKCIPHER |
808 |
+ select CRYPTO_MANAGER |
809 |
+ select CRYPTO_GF128MUL |
810 |
+- select CRYPTO_ECB |
811 |
+ help |
812 |
+ XTS: IEEE1619/D16 narrow block cipher use with aes-xts-plain, |
813 |
+ key size 256, 384 or 512 bits. This implementation currently |
814 |
+diff --git a/crypto/dh_helper.c b/crypto/dh_helper.c |
815 |
+index 02db76b20d00..14539904416e 100644 |
816 |
+--- a/crypto/dh_helper.c |
817 |
++++ b/crypto/dh_helper.c |
818 |
+@@ -83,6 +83,14 @@ int crypto_dh_decode_key(const char *buf, unsigned int len, struct dh *params) |
819 |
+ if (secret.len != crypto_dh_key_len(params)) |
820 |
+ return -EINVAL; |
821 |
+ |
822 |
++ /* |
823 |
++ * Don't permit the buffer for 'key' or 'g' to be larger than 'p', since |
824 |
++ * some drivers assume otherwise. |
825 |
++ */ |
826 |
++ if (params->key_size > params->p_size || |
827 |
++ params->g_size > params->p_size) |
828 |
++ return -EINVAL; |
829 |
++ |
830 |
+ /* Don't allocate memory. Set pointers to data within |
831 |
+ * the given buffer |
832 |
+ */ |
833 |
+@@ -90,6 +98,14 @@ int crypto_dh_decode_key(const char *buf, unsigned int len, struct dh *params) |
834 |
+ params->p = (void *)(ptr + params->key_size); |
835 |
+ params->g = (void *)(ptr + params->key_size + params->p_size); |
836 |
+ |
837 |
++ /* |
838 |
++ * Don't permit 'p' to be 0. It's not a prime number, and it's subject |
839 |
++ * to corner cases such as 'mod 0' being undefined or |
840 |
++ * crypto_kpp_maxsize() returning 0. |
841 |
++ */ |
842 |
++ if (memchr_inv(params->p, 0, params->p_size) == NULL) |
843 |
++ return -EINVAL; |
844 |
++ |
845 |
+ return 0; |
846 |
+ } |
847 |
+ EXPORT_SYMBOL_GPL(crypto_dh_decode_key); |
848 |
+diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig |
849 |
+index 2c8be74f401d..5d16fc4fa46c 100644 |
850 |
+--- a/drivers/ata/Kconfig |
851 |
++++ b/drivers/ata/Kconfig |
852 |
+@@ -289,6 +289,7 @@ config SATA_SX4 |
853 |
+ |
854 |
+ config ATA_BMDMA |
855 |
+ bool "ATA BMDMA support" |
856 |
++ depends on HAS_DMA |
857 |
+ default y |
858 |
+ help |
859 |
+ This option adds support for SFF ATA controllers with BMDMA |
860 |
+@@ -344,6 +345,7 @@ config SATA_DWC_VDEBUG |
861 |
+ |
862 |
+ config SATA_HIGHBANK |
863 |
+ tristate "Calxeda Highbank SATA support" |
864 |
++ depends on HAS_DMA |
865 |
+ depends on ARCH_HIGHBANK || COMPILE_TEST |
866 |
+ help |
867 |
+ This option enables support for the Calxeda Highbank SoC's |
868 |
+@@ -353,6 +355,7 @@ config SATA_HIGHBANK |
869 |
+ |
870 |
+ config SATA_MV |
871 |
+ tristate "Marvell SATA support" |
872 |
++ depends on HAS_DMA |
873 |
+ depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \ |
874 |
+ ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST |
875 |
+ select GENERIC_PHY |
876 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
877 |
+index 74e677ac8e37..693028659ccc 100644 |
878 |
+--- a/drivers/bluetooth/btusb.c |
879 |
++++ b/drivers/bluetooth/btusb.c |
880 |
+@@ -2925,6 +2925,12 @@ static int btusb_probe(struct usb_interface *intf, |
881 |
+ if (id->driver_info & BTUSB_QCA_ROME) { |
882 |
+ data->setup_on_usb = btusb_setup_qca; |
883 |
+ hdev->set_bdaddr = btusb_set_bdaddr_ath3012; |
884 |
++ |
885 |
++ /* QCA Rome devices lose their updated firmware over suspend, |
886 |
++ * but the USB hub doesn't notice any status change. |
887 |
++ * Explicitly request a device reset on resume. |
888 |
++ */ |
889 |
++ set_bit(BTUSB_RESET_RESUME, &data->flags); |
890 |
+ } |
891 |
+ |
892 |
+ #ifdef CONFIG_BT_HCIBTUSB_RTL |
893 |
+diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c |
894 |
+index 634ba70782de..a128fd2eb187 100644 |
895 |
+--- a/drivers/extcon/extcon-palmas.c |
896 |
++++ b/drivers/extcon/extcon-palmas.c |
897 |
+@@ -190,6 +190,11 @@ static int palmas_usb_probe(struct platform_device *pdev) |
898 |
+ struct palmas_usb *palmas_usb; |
899 |
+ int status; |
900 |
+ |
901 |
++ if (!palmas) { |
902 |
++ dev_err(&pdev->dev, "failed to get valid parent\n"); |
903 |
++ return -EINVAL; |
904 |
++ } |
905 |
++ |
906 |
+ palmas_usb = devm_kzalloc(&pdev->dev, sizeof(*palmas_usb), GFP_KERNEL); |
907 |
+ if (!palmas_usb) |
908 |
+ return -ENOMEM; |
909 |
+diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c |
910 |
+index 7c1e3a7b14e0..d0e367959c91 100644 |
911 |
+--- a/drivers/extcon/extcon.c |
912 |
++++ b/drivers/extcon/extcon.c |
913 |
+@@ -906,35 +906,16 @@ int extcon_register_notifier(struct extcon_dev *edev, unsigned int id, |
914 |
+ unsigned long flags; |
915 |
+ int ret, idx = -EINVAL; |
916 |
+ |
917 |
+- if (!nb) |
918 |
++ if (!edev || !nb) |
919 |
+ return -EINVAL; |
920 |
+ |
921 |
+- if (edev) { |
922 |
+- idx = find_cable_index_by_id(edev, id); |
923 |
+- if (idx < 0) |
924 |
+- return idx; |
925 |
+- |
926 |
+- spin_lock_irqsave(&edev->lock, flags); |
927 |
+- ret = raw_notifier_chain_register(&edev->nh[idx], nb); |
928 |
+- spin_unlock_irqrestore(&edev->lock, flags); |
929 |
+- } else { |
930 |
+- struct extcon_dev *extd; |
931 |
+- |
932 |
+- mutex_lock(&extcon_dev_list_lock); |
933 |
+- list_for_each_entry(extd, &extcon_dev_list, entry) { |
934 |
+- idx = find_cable_index_by_id(extd, id); |
935 |
+- if (idx >= 0) |
936 |
+- break; |
937 |
+- } |
938 |
+- mutex_unlock(&extcon_dev_list_lock); |
939 |
++ idx = find_cable_index_by_id(edev, id); |
940 |
++ if (idx < 0) |
941 |
++ return idx; |
942 |
+ |
943 |
+- if (idx >= 0) { |
944 |
+- edev = extd; |
945 |
+- return extcon_register_notifier(extd, id, nb); |
946 |
+- } else { |
947 |
+- ret = -ENODEV; |
948 |
+- } |
949 |
+- } |
950 |
++ spin_lock_irqsave(&edev->lock, flags); |
951 |
++ ret = raw_notifier_chain_register(&edev->nh[idx], nb); |
952 |
++ spin_unlock_irqrestore(&edev->lock, flags); |
953 |
+ |
954 |
+ return ret; |
955 |
+ } |
956 |
+diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c |
957 |
+index e79cbc25ae3c..fb03e3057485 100644 |
958 |
+--- a/drivers/gpu/drm/mgag200/mgag200_main.c |
959 |
++++ b/drivers/gpu/drm/mgag200/mgag200_main.c |
960 |
+@@ -145,6 +145,8 @@ static int mga_vram_init(struct mga_device *mdev) |
961 |
+ } |
962 |
+ |
963 |
+ mem = pci_iomap(mdev->dev->pdev, 0, 0); |
964 |
++ if (!mem) |
965 |
++ return -ENOMEM; |
966 |
+ |
967 |
+ mdev->mc.vram_size = mga_probe_vram(mdev, mem); |
968 |
+ |
969 |
+diff --git a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c |
970 |
+index 3557a4c7dd7b..270a62348a6e 100644 |
971 |
+--- a/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c |
972 |
++++ b/drivers/gpu/drm/omapdrm/displays/panel-sony-acx565akm.c |
973 |
+@@ -912,6 +912,7 @@ static struct spi_driver acx565akm_driver = { |
974 |
+ |
975 |
+ module_spi_driver(acx565akm_driver); |
976 |
+ |
977 |
++MODULE_ALIAS("spi:sony,acx565akm"); |
978 |
+ MODULE_AUTHOR("Nokia Corporation"); |
979 |
+ MODULE_DESCRIPTION("acx565akm LCD Driver"); |
980 |
+ MODULE_LICENSE("GPL"); |
981 |
+diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c |
982 |
+index a8882bdd0f8b..c3d9c8ae14af 100644 |
983 |
+--- a/drivers/gpu/drm/sti/sti_vtg.c |
984 |
++++ b/drivers/gpu/drm/sti/sti_vtg.c |
985 |
+@@ -429,6 +429,10 @@ static int vtg_probe(struct platform_device *pdev) |
986 |
+ return -ENOMEM; |
987 |
+ } |
988 |
+ vtg->regs = devm_ioremap_nocache(dev, res->start, resource_size(res)); |
989 |
++ if (!vtg->regs) { |
990 |
++ DRM_ERROR("failed to remap I/O memory\n"); |
991 |
++ return -ENOMEM; |
992 |
++ } |
993 |
+ |
994 |
+ np = of_parse_phandle(pdev->dev.of_node, "st,slave", 0); |
995 |
+ if (np) { |
996 |
+diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c |
997 |
+index 2d4b83635018..f072bf28fccd 100644 |
998 |
+--- a/drivers/media/rc/imon.c |
999 |
++++ b/drivers/media/rc/imon.c |
1000 |
+@@ -2412,6 +2412,11 @@ static int imon_probe(struct usb_interface *interface, |
1001 |
+ mutex_lock(&driver_lock); |
1002 |
+ |
1003 |
+ first_if = usb_ifnum_to_if(usbdev, 0); |
1004 |
++ if (!first_if) { |
1005 |
++ ret = -ENODEV; |
1006 |
++ goto fail; |
1007 |
++ } |
1008 |
++ |
1009 |
+ first_if_ctx = usb_get_intfdata(first_if); |
1010 |
+ |
1011 |
+ if (ifnum == 0) { |
1012 |
+diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c |
1013 |
+index ef1b8ee75c57..caa55402052e 100644 |
1014 |
+--- a/drivers/media/usb/dvb-usb/dib0700_devices.c |
1015 |
++++ b/drivers/media/usb/dvb-usb/dib0700_devices.c |
1016 |
+@@ -292,7 +292,7 @@ static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap) |
1017 |
+ stk7700d_dib7000p_mt2266_config) |
1018 |
+ != 0) { |
1019 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
1020 |
+- dvb_detach(&state->dib7000p_ops); |
1021 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1022 |
+ return -ENODEV; |
1023 |
+ } |
1024 |
+ } |
1025 |
+@@ -326,7 +326,7 @@ static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap) |
1026 |
+ stk7700d_dib7000p_mt2266_config) |
1027 |
+ != 0) { |
1028 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
1029 |
+- dvb_detach(&state->dib7000p_ops); |
1030 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1031 |
+ return -ENODEV; |
1032 |
+ } |
1033 |
+ } |
1034 |
+@@ -479,7 +479,7 @@ static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap) |
1035 |
+ &stk7700ph_dib7700_xc3028_config) != 0) { |
1036 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
1037 |
+ __func__); |
1038 |
+- dvb_detach(&state->dib7000p_ops); |
1039 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1040 |
+ return -ENODEV; |
1041 |
+ } |
1042 |
+ |
1043 |
+@@ -1011,7 +1011,7 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) |
1044 |
+ &dib7070p_dib7000p_config) != 0) { |
1045 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
1046 |
+ __func__); |
1047 |
+- dvb_detach(&state->dib7000p_ops); |
1048 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1049 |
+ return -ENODEV; |
1050 |
+ } |
1051 |
+ |
1052 |
+@@ -1069,7 +1069,7 @@ static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap) |
1053 |
+ &dib7770p_dib7000p_config) != 0) { |
1054 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
1055 |
+ __func__); |
1056 |
+- dvb_detach(&state->dib7000p_ops); |
1057 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1058 |
+ return -ENODEV; |
1059 |
+ } |
1060 |
+ |
1061 |
+@@ -3056,7 +3056,7 @@ static int nim7090_frontend_attach(struct dvb_usb_adapter *adap) |
1062 |
+ |
1063 |
+ if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, &nim7090_dib7000p_config) != 0) { |
1064 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
1065 |
+- dvb_detach(&state->dib7000p_ops); |
1066 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1067 |
+ return -ENODEV; |
1068 |
+ } |
1069 |
+ adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x80, &nim7090_dib7000p_config); |
1070 |
+@@ -3109,7 +3109,7 @@ static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter *adap) |
1071 |
+ /* initialize IC 0 */ |
1072 |
+ if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x20, &tfe7090pvr_dib7000p_config[0]) != 0) { |
1073 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
1074 |
+- dvb_detach(&state->dib7000p_ops); |
1075 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1076 |
+ return -ENODEV; |
1077 |
+ } |
1078 |
+ |
1079 |
+@@ -3139,7 +3139,7 @@ static int tfe7090pvr_frontend1_attach(struct dvb_usb_adapter *adap) |
1080 |
+ i2c = state->dib7000p_ops.get_i2c_master(adap->dev->adapter[0].fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_6_7, 1); |
1081 |
+ if (state->dib7000p_ops.i2c_enumeration(i2c, 1, 0x10, &tfe7090pvr_dib7000p_config[1]) != 0) { |
1082 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
1083 |
+- dvb_detach(&state->dib7000p_ops); |
1084 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1085 |
+ return -ENODEV; |
1086 |
+ } |
1087 |
+ |
1088 |
+@@ -3214,7 +3214,7 @@ static int tfe7790p_frontend_attach(struct dvb_usb_adapter *adap) |
1089 |
+ 1, 0x10, &tfe7790p_dib7000p_config) != 0) { |
1090 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
1091 |
+ __func__); |
1092 |
+- dvb_detach(&state->dib7000p_ops); |
1093 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1094 |
+ return -ENODEV; |
1095 |
+ } |
1096 |
+ adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, |
1097 |
+@@ -3309,7 +3309,7 @@ static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap) |
1098 |
+ stk7070pd_dib7000p_config) != 0) { |
1099 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
1100 |
+ __func__); |
1101 |
+- dvb_detach(&state->dib7000p_ops); |
1102 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1103 |
+ return -ENODEV; |
1104 |
+ } |
1105 |
+ |
1106 |
+@@ -3384,7 +3384,7 @@ static int novatd_frontend_attach(struct dvb_usb_adapter *adap) |
1107 |
+ stk7070pd_dib7000p_config) != 0) { |
1108 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
1109 |
+ __func__); |
1110 |
+- dvb_detach(&state->dib7000p_ops); |
1111 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1112 |
+ return -ENODEV; |
1113 |
+ } |
1114 |
+ } |
1115 |
+@@ -3620,7 +3620,7 @@ static int pctv340e_frontend_attach(struct dvb_usb_adapter *adap) |
1116 |
+ |
1117 |
+ if (state->dib7000p_ops.dib7000pc_detection(&adap->dev->i2c_adap) == 0) { |
1118 |
+ /* Demodulator not found for some reason? */ |
1119 |
+- dvb_detach(&state->dib7000p_ops); |
1120 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
1121 |
+ return -ENODEV; |
1122 |
+ } |
1123 |
+ |
1124 |
+diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c |
1125 |
+index c9dfa6564fcf..334088a101c3 100644 |
1126 |
+--- a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c |
1127 |
++++ b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c |
1128 |
+@@ -2011,9 +2011,10 @@ static void fm10k_sm_mbx_create_reply(struct fm10k_hw *hw, |
1129 |
+ * function can also be used to respond to an error as the connection |
1130 |
+ * resetting would also be a means of dealing with errors. |
1131 |
+ **/ |
1132 |
+-static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw, |
1133 |
+- struct fm10k_mbx_info *mbx) |
1134 |
++static s32 fm10k_sm_mbx_process_reset(struct fm10k_hw *hw, |
1135 |
++ struct fm10k_mbx_info *mbx) |
1136 |
+ { |
1137 |
++ s32 err = 0; |
1138 |
+ const enum fm10k_mbx_state state = mbx->state; |
1139 |
+ |
1140 |
+ switch (state) { |
1141 |
+@@ -2026,6 +2027,7 @@ static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw, |
1142 |
+ case FM10K_STATE_OPEN: |
1143 |
+ /* flush any incomplete work */ |
1144 |
+ fm10k_sm_mbx_connect_reset(mbx); |
1145 |
++ err = FM10K_ERR_RESET_REQUESTED; |
1146 |
+ break; |
1147 |
+ case FM10K_STATE_CONNECT: |
1148 |
+ /* Update remote value to match local value */ |
1149 |
+@@ -2035,6 +2037,8 @@ static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw, |
1150 |
+ } |
1151 |
+ |
1152 |
+ fm10k_sm_mbx_create_reply(hw, mbx, mbx->tail); |
1153 |
++ |
1154 |
++ return err; |
1155 |
+ } |
1156 |
+ |
1157 |
+ /** |
1158 |
+@@ -2115,7 +2119,7 @@ static s32 fm10k_sm_mbx_process(struct fm10k_hw *hw, |
1159 |
+ |
1160 |
+ switch (FM10K_MSG_HDR_FIELD_GET(mbx->mbx_hdr, SM_VER)) { |
1161 |
+ case 0: |
1162 |
+- fm10k_sm_mbx_process_reset(hw, mbx); |
1163 |
++ err = fm10k_sm_mbx_process_reset(hw, mbx); |
1164 |
+ break; |
1165 |
+ case FM10K_SM_MBX_VERSION: |
1166 |
+ err = fm10k_sm_mbx_process_version_1(hw, mbx); |
1167 |
+diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c |
1168 |
+index b1a2f8437d59..e372a5823480 100644 |
1169 |
+--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c |
1170 |
++++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c |
1171 |
+@@ -1144,6 +1144,7 @@ static irqreturn_t fm10k_msix_mbx_pf(int __always_unused irq, void *data) |
1172 |
+ struct fm10k_hw *hw = &interface->hw; |
1173 |
+ struct fm10k_mbx_info *mbx = &hw->mbx; |
1174 |
+ u32 eicr; |
1175 |
++ s32 err = 0; |
1176 |
+ |
1177 |
+ /* unmask any set bits related to this interrupt */ |
1178 |
+ eicr = fm10k_read_reg(hw, FM10K_EICR); |
1179 |
+@@ -1159,12 +1160,15 @@ static irqreturn_t fm10k_msix_mbx_pf(int __always_unused irq, void *data) |
1180 |
+ |
1181 |
+ /* service mailboxes */ |
1182 |
+ if (fm10k_mbx_trylock(interface)) { |
1183 |
+- mbx->ops.process(hw, mbx); |
1184 |
++ err = mbx->ops.process(hw, mbx); |
1185 |
+ /* handle VFLRE events */ |
1186 |
+ fm10k_iov_event(interface); |
1187 |
+ fm10k_mbx_unlock(interface); |
1188 |
+ } |
1189 |
+ |
1190 |
++ if (err == FM10K_ERR_RESET_REQUESTED) |
1191 |
++ interface->flags |= FM10K_FLAG_RESET_REQUESTED; |
1192 |
++ |
1193 |
+ /* if switch toggled state we should reset GLORTs */ |
1194 |
+ if (eicr & FM10K_EICR_SWITCHNOTREADY) { |
1195 |
+ /* force link down for at least 4 seconds */ |
1196 |
+diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c |
1197 |
+index 1264a3616acf..4a50870e0fa7 100644 |
1198 |
+--- a/drivers/net/ethernet/intel/igb/e1000_82575.c |
1199 |
++++ b/drivers/net/ethernet/intel/igb/e1000_82575.c |
1200 |
+@@ -245,6 +245,17 @@ static s32 igb_init_phy_params_82575(struct e1000_hw *hw) |
1201 |
+ hw->bus.func = (rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) >> |
1202 |
+ E1000_STATUS_FUNC_SHIFT; |
1203 |
+ |
1204 |
++ /* Make sure the PHY is in a good state. Several people have reported |
1205 |
++ * firmware leaving the PHY's page select register set to something |
1206 |
++ * other than the default of zero, which causes the PHY ID read to |
1207 |
++ * access something other than the intended register. |
1208 |
++ */ |
1209 |
++ ret_val = hw->phy.ops.reset(hw); |
1210 |
++ if (ret_val) { |
1211 |
++ hw_dbg("Error resetting the PHY.\n"); |
1212 |
++ goto out; |
1213 |
++ } |
1214 |
++ |
1215 |
+ /* Set phy->phy_addr and phy->id. */ |
1216 |
+ igb_write_phy_reg_82580(hw, I347AT4_PAGE_SELECT, 0); |
1217 |
+ ret_val = igb_get_phy_id_82575(hw); |
1218 |
+diff --git a/drivers/net/ethernet/intel/igb/e1000_i210.c b/drivers/net/ethernet/intel/igb/e1000_i210.c |
1219 |
+index 8aa798737d4d..07d48f2e3369 100644 |
1220 |
+--- a/drivers/net/ethernet/intel/igb/e1000_i210.c |
1221 |
++++ b/drivers/net/ethernet/intel/igb/e1000_i210.c |
1222 |
+@@ -699,9 +699,9 @@ static s32 igb_update_flash_i210(struct e1000_hw *hw) |
1223 |
+ |
1224 |
+ ret_val = igb_pool_flash_update_done_i210(hw); |
1225 |
+ if (ret_val) |
1226 |
+- hw_dbg("Flash update complete\n"); |
1227 |
+- else |
1228 |
+ hw_dbg("Flash update time out\n"); |
1229 |
++ else |
1230 |
++ hw_dbg("Flash update complete\n"); |
1231 |
+ |
1232 |
+ out: |
1233 |
+ return ret_val; |
1234 |
+diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c |
1235 |
+index 6a62447fe377..c6c2562d9df3 100644 |
1236 |
+--- a/drivers/net/ethernet/intel/igb/igb_main.c |
1237 |
++++ b/drivers/net/ethernet/intel/igb/igb_main.c |
1238 |
+@@ -3271,7 +3271,9 @@ static int __igb_close(struct net_device *netdev, bool suspending) |
1239 |
+ |
1240 |
+ int igb_close(struct net_device *netdev) |
1241 |
+ { |
1242 |
+- return __igb_close(netdev, false); |
1243 |
++ if (netif_device_present(netdev)) |
1244 |
++ return __igb_close(netdev, false); |
1245 |
++ return 0; |
1246 |
+ } |
1247 |
+ |
1248 |
+ /** |
1249 |
+@@ -7548,6 +7550,7 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake, |
1250 |
+ int retval = 0; |
1251 |
+ #endif |
1252 |
+ |
1253 |
++ rtnl_lock(); |
1254 |
+ netif_device_detach(netdev); |
1255 |
+ |
1256 |
+ if (netif_running(netdev)) |
1257 |
+@@ -7556,6 +7559,7 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake, |
1258 |
+ igb_ptp_suspend(adapter); |
1259 |
+ |
1260 |
+ igb_clear_interrupt_scheme(adapter); |
1261 |
++ rtnl_unlock(); |
1262 |
+ |
1263 |
+ #ifdef CONFIG_PM |
1264 |
+ retval = pci_save_state(pdev); |
1265 |
+@@ -7674,16 +7678,15 @@ static int igb_resume(struct device *dev) |
1266 |
+ |
1267 |
+ wr32(E1000_WUS, ~0); |
1268 |
+ |
1269 |
+- if (netdev->flags & IFF_UP) { |
1270 |
+- rtnl_lock(); |
1271 |
++ rtnl_lock(); |
1272 |
++ if (!err && netif_running(netdev)) |
1273 |
+ err = __igb_open(netdev, true); |
1274 |
+- rtnl_unlock(); |
1275 |
+- if (err) |
1276 |
+- return err; |
1277 |
+- } |
1278 |
+ |
1279 |
+- netif_device_attach(netdev); |
1280 |
+- return 0; |
1281 |
++ if (!err) |
1282 |
++ netif_device_attach(netdev); |
1283 |
++ rtnl_unlock(); |
1284 |
++ |
1285 |
++ return err; |
1286 |
+ } |
1287 |
+ |
1288 |
+ static int igb_runtime_idle(struct device *dev) |
1289 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |
1290 |
+index f49f80380aa5..a137e060c185 100644 |
1291 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |
1292 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c |
1293 |
+@@ -199,7 +199,7 @@ static int ixgbe_get_settings(struct net_device *netdev, |
1294 |
+ if (supported_link & IXGBE_LINK_SPEED_100_FULL) |
1295 |
+ ecmd->supported |= ixgbe_isbackplane(hw->phy.media_type) ? |
1296 |
+ SUPPORTED_1000baseKX_Full : |
1297 |
+- SUPPORTED_1000baseT_Full; |
1298 |
++ SUPPORTED_100baseT_Full; |
1299 |
+ |
1300 |
+ /* default advertised speed if phy.autoneg_advertised isn't set */ |
1301 |
+ ecmd->advertising = ecmd->supported; |
1302 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c |
1303 |
+index 15ab337fd7ad..10d29678d65e 100644 |
1304 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c |
1305 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c |
1306 |
+@@ -308,6 +308,7 @@ static void ixgbe_cache_ring_register(struct ixgbe_adapter *adapter) |
1307 |
+ ixgbe_cache_ring_rss(adapter); |
1308 |
+ } |
1309 |
+ |
1310 |
++#define IXGBE_RSS_64Q_MASK 0x3F |
1311 |
+ #define IXGBE_RSS_16Q_MASK 0xF |
1312 |
+ #define IXGBE_RSS_8Q_MASK 0x7 |
1313 |
+ #define IXGBE_RSS_4Q_MASK 0x3 |
1314 |
+@@ -604,6 +605,7 @@ static bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter) |
1315 |
+ **/ |
1316 |
+ static bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter) |
1317 |
+ { |
1318 |
++ struct ixgbe_hw *hw = &adapter->hw; |
1319 |
+ struct ixgbe_ring_feature *f; |
1320 |
+ u16 rss_i; |
1321 |
+ |
1322 |
+@@ -612,7 +614,11 @@ static bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter) |
1323 |
+ rss_i = f->limit; |
1324 |
+ |
1325 |
+ f->indices = rss_i; |
1326 |
+- f->mask = IXGBE_RSS_16Q_MASK; |
1327 |
++ |
1328 |
++ if (hw->mac.type < ixgbe_mac_X550) |
1329 |
++ f->mask = IXGBE_RSS_16Q_MASK; |
1330 |
++ else |
1331 |
++ f->mask = IXGBE_RSS_64Q_MASK; |
1332 |
+ |
1333 |
+ /* disable ATR by default, it will be configured below */ |
1334 |
+ adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; |
1335 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1336 |
+index fee1f2918ead..334eb96ecda3 100644 |
1337 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1338 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1339 |
+@@ -6194,7 +6194,8 @@ int ixgbe_close(struct net_device *netdev) |
1340 |
+ |
1341 |
+ ixgbe_ptp_stop(adapter); |
1342 |
+ |
1343 |
+- ixgbe_close_suspend(adapter); |
1344 |
++ if (netif_device_present(netdev)) |
1345 |
++ ixgbe_close_suspend(adapter); |
1346 |
+ |
1347 |
+ ixgbe_fdir_filter_exit(adapter); |
1348 |
+ |
1349 |
+@@ -6239,14 +6240,12 @@ static int ixgbe_resume(struct pci_dev *pdev) |
1350 |
+ if (!err && netif_running(netdev)) |
1351 |
+ err = ixgbe_open(netdev); |
1352 |
+ |
1353 |
+- rtnl_unlock(); |
1354 |
+- |
1355 |
+- if (err) |
1356 |
+- return err; |
1357 |
+ |
1358 |
+- netif_device_attach(netdev); |
1359 |
++ if (!err) |
1360 |
++ netif_device_attach(netdev); |
1361 |
++ rtnl_unlock(); |
1362 |
+ |
1363 |
+- return 0; |
1364 |
++ return err; |
1365 |
+ } |
1366 |
+ #endif /* CONFIG_PM */ |
1367 |
+ |
1368 |
+@@ -6261,14 +6260,14 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) |
1369 |
+ int retval = 0; |
1370 |
+ #endif |
1371 |
+ |
1372 |
++ rtnl_lock(); |
1373 |
+ netif_device_detach(netdev); |
1374 |
+ |
1375 |
+- rtnl_lock(); |
1376 |
+ if (netif_running(netdev)) |
1377 |
+ ixgbe_close_suspend(adapter); |
1378 |
+- rtnl_unlock(); |
1379 |
+ |
1380 |
+ ixgbe_clear_interrupt_scheme(adapter); |
1381 |
++ rtnl_unlock(); |
1382 |
+ |
1383 |
+ #ifdef CONFIG_PM |
1384 |
+ retval = pci_save_state(pdev); |
1385 |
+@@ -10027,7 +10026,7 @@ static pci_ers_result_t ixgbe_io_error_detected(struct pci_dev *pdev, |
1386 |
+ } |
1387 |
+ |
1388 |
+ if (netif_running(netdev)) |
1389 |
+- ixgbe_down(adapter); |
1390 |
++ ixgbe_close_suspend(adapter); |
1391 |
+ |
1392 |
+ if (!test_and_set_bit(__IXGBE_DISABLED, &adapter->state)) |
1393 |
+ pci_disable_device(pdev); |
1394 |
+@@ -10097,10 +10096,12 @@ static void ixgbe_io_resume(struct pci_dev *pdev) |
1395 |
+ } |
1396 |
+ |
1397 |
+ #endif |
1398 |
++ rtnl_lock(); |
1399 |
+ if (netif_running(netdev)) |
1400 |
+- ixgbe_up(adapter); |
1401 |
++ ixgbe_open(netdev); |
1402 |
+ |
1403 |
+ netif_device_attach(netdev); |
1404 |
++ rtnl_unlock(); |
1405 |
+ } |
1406 |
+ |
1407 |
+ static const struct pci_error_handlers ixgbe_err_handler = { |
1408 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c |
1409 |
+index 021ab9b89c71..b17464e843de 100644 |
1410 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c |
1411 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c |
1412 |
+@@ -113,7 +113,7 @@ static s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, |
1413 |
+ u16 reg, u16 *val, bool lock) |
1414 |
+ { |
1415 |
+ u32 swfw_mask = hw->phy.phy_semaphore_mask; |
1416 |
+- int max_retry = 10; |
1417 |
++ int max_retry = 3; |
1418 |
+ int retry = 0; |
1419 |
+ u8 csum_byte; |
1420 |
+ u8 high_bits; |
1421 |
+@@ -1764,6 +1764,8 @@ static s32 ixgbe_read_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset, |
1422 |
+ u32 swfw_mask = hw->phy.phy_semaphore_mask; |
1423 |
+ bool nack = true; |
1424 |
+ |
1425 |
++ if (hw->mac.type >= ixgbe_mac_X550) |
1426 |
++ max_retry = 3; |
1427 |
+ if (ixgbe_is_sfp_probe(hw, byte_offset, dev_addr)) |
1428 |
+ max_retry = IXGBE_SFP_DETECT_RETRIES; |
1429 |
+ |
1430 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c |
1431 |
+index 7e6b9267ca9d..60f0bf779073 100644 |
1432 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c |
1433 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c |
1434 |
+@@ -1932,8 +1932,6 @@ static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw, |
1435 |
+ return status; |
1436 |
+ |
1437 |
+ reg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_ENABLE; |
1438 |
+- reg_val &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_AN_FEC_REQ | |
1439 |
+- IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_FEC); |
1440 |
+ reg_val &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_KR | |
1441 |
+ IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_KX); |
1442 |
+ |
1443 |
+@@ -1995,12 +1993,11 @@ static s32 ixgbe_setup_kx4_x550em(struct ixgbe_hw *hw) |
1444 |
+ /** |
1445 |
+ * ixgbe_setup_kr_x550em - Configure the KR PHY |
1446 |
+ * @hw: pointer to hardware structure |
1447 |
+- * |
1448 |
+- * Configures the integrated KR PHY for X550EM_x. |
1449 |
+ **/ |
1450 |
+ static s32 ixgbe_setup_kr_x550em(struct ixgbe_hw *hw) |
1451 |
+ { |
1452 |
+- if (hw->mac.type != ixgbe_mac_X550EM_x) |
1453 |
++ /* leave link alone for 2.5G */ |
1454 |
++ if (hw->phy.autoneg_advertised & IXGBE_LINK_SPEED_2_5GB_FULL) |
1455 |
+ return 0; |
1456 |
+ |
1457 |
+ return ixgbe_setup_kr_speed_x550em(hw, hw->phy.autoneg_advertised); |
1458 |
+diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c |
1459 |
+index fc844a1f6c3f..f507d821aba8 100644 |
1460 |
+--- a/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c |
1461 |
++++ b/drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c |
1462 |
+@@ -147,7 +147,6 @@ static struct ieee80211_rate __wl_rates[] = { |
1463 |
+ .band = NL80211_BAND_2GHZ, \ |
1464 |
+ .center_freq = (_freq), \ |
1465 |
+ .hw_value = (_channel), \ |
1466 |
+- .flags = IEEE80211_CHAN_DISABLED, \ |
1467 |
+ .max_antenna_gain = 0, \ |
1468 |
+ .max_power = 30, \ |
1469 |
+ } |
1470 |
+@@ -156,7 +155,6 @@ static struct ieee80211_rate __wl_rates[] = { |
1471 |
+ .band = NL80211_BAND_5GHZ, \ |
1472 |
+ .center_freq = 5000 + (5 * (_channel)), \ |
1473 |
+ .hw_value = (_channel), \ |
1474 |
+- .flags = IEEE80211_CHAN_DISABLED, \ |
1475 |
+ .max_antenna_gain = 0, \ |
1476 |
+ .max_power = 30, \ |
1477 |
+ } |
1478 |
+diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c |
1479 |
+index f62f9dfea984..089056cb8e73 100644 |
1480 |
+--- a/drivers/power/supply/axp288_fuel_gauge.c |
1481 |
++++ b/drivers/power/supply/axp288_fuel_gauge.c |
1482 |
+@@ -29,6 +29,7 @@ |
1483 |
+ #include <linux/iio/consumer.h> |
1484 |
+ #include <linux/debugfs.h> |
1485 |
+ #include <linux/seq_file.h> |
1486 |
++#include <asm/unaligned.h> |
1487 |
+ |
1488 |
+ #define CHRG_STAT_BAT_SAFE_MODE (1 << 3) |
1489 |
+ #define CHRG_STAT_BAT_VALID (1 << 4) |
1490 |
+@@ -73,17 +74,15 @@ |
1491 |
+ #define FG_CNTL_CC_EN (1 << 6) |
1492 |
+ #define FG_CNTL_GAUGE_EN (1 << 7) |
1493 |
+ |
1494 |
++#define FG_15BIT_WORD_VALID (1 << 15) |
1495 |
++#define FG_15BIT_VAL_MASK 0x7fff |
1496 |
++ |
1497 |
+ #define FG_REP_CAP_VALID (1 << 7) |
1498 |
+ #define FG_REP_CAP_VAL_MASK 0x7F |
1499 |
+ |
1500 |
+ #define FG_DES_CAP1_VALID (1 << 7) |
1501 |
+-#define FG_DES_CAP1_VAL_MASK 0x7F |
1502 |
+-#define FG_DES_CAP0_VAL_MASK 0xFF |
1503 |
+ #define FG_DES_CAP_RES_LSB 1456 /* 1.456mAhr */ |
1504 |
+ |
1505 |
+-#define FG_CC_MTR1_VALID (1 << 7) |
1506 |
+-#define FG_CC_MTR1_VAL_MASK 0x7F |
1507 |
+-#define FG_CC_MTR0_VAL_MASK 0xFF |
1508 |
+ #define FG_DES_CC_RES_LSB 1456 /* 1.456mAhr */ |
1509 |
+ |
1510 |
+ #define FG_OCV_CAP_VALID (1 << 7) |
1511 |
+@@ -189,6 +188,44 @@ static int fuel_gauge_reg_writeb(struct axp288_fg_info *info, int reg, u8 val) |
1512 |
+ return ret; |
1513 |
+ } |
1514 |
+ |
1515 |
++static int fuel_gauge_read_15bit_word(struct axp288_fg_info *info, int reg) |
1516 |
++{ |
1517 |
++ unsigned char buf[2]; |
1518 |
++ int ret; |
1519 |
++ |
1520 |
++ ret = regmap_bulk_read(info->regmap, reg, buf, 2); |
1521 |
++ if (ret < 0) { |
1522 |
++ dev_err(&info->pdev->dev, "Error reading reg 0x%02x err: %d\n", |
1523 |
++ reg, ret); |
1524 |
++ return ret; |
1525 |
++ } |
1526 |
++ |
1527 |
++ ret = get_unaligned_be16(buf); |
1528 |
++ if (!(ret & FG_15BIT_WORD_VALID)) { |
1529 |
++ dev_err(&info->pdev->dev, "Error reg 0x%02x contents not valid\n", |
1530 |
++ reg); |
1531 |
++ return -ENXIO; |
1532 |
++ } |
1533 |
++ |
1534 |
++ return ret & FG_15BIT_VAL_MASK; |
1535 |
++} |
1536 |
++ |
1537 |
++static int fuel_gauge_read_12bit_word(struct axp288_fg_info *info, int reg) |
1538 |
++{ |
1539 |
++ unsigned char buf[2]; |
1540 |
++ int ret; |
1541 |
++ |
1542 |
++ ret = regmap_bulk_read(info->regmap, reg, buf, 2); |
1543 |
++ if (ret < 0) { |
1544 |
++ dev_err(&info->pdev->dev, "Error reading reg 0x%02x err: %d\n", |
1545 |
++ reg, ret); |
1546 |
++ return ret; |
1547 |
++ } |
1548 |
++ |
1549 |
++ /* 12-bit data values have upper 8 bits in buf[0], lower 4 in buf[1] */ |
1550 |
++ return (buf[0] << 4) | ((buf[1] >> 4) & 0x0f); |
1551 |
++} |
1552 |
++ |
1553 |
+ static int pmic_read_adc_val(const char *name, int *raw_val, |
1554 |
+ struct axp288_fg_info *info) |
1555 |
+ { |
1556 |
+@@ -249,24 +286,15 @@ static int fuel_gauge_debug_show(struct seq_file *s, void *data) |
1557 |
+ seq_printf(s, " FG_RDC0[%02x] : %02x\n", |
1558 |
+ AXP288_FG_RDC0_REG, |
1559 |
+ fuel_gauge_reg_readb(info, AXP288_FG_RDC0_REG)); |
1560 |
+- seq_printf(s, " FG_OCVH[%02x] : %02x\n", |
1561 |
++ seq_printf(s, " FG_OCV[%02x] : %04x\n", |
1562 |
+ AXP288_FG_OCVH_REG, |
1563 |
+- fuel_gauge_reg_readb(info, AXP288_FG_OCVH_REG)); |
1564 |
+- seq_printf(s, " FG_OCVL[%02x] : %02x\n", |
1565 |
+- AXP288_FG_OCVL_REG, |
1566 |
+- fuel_gauge_reg_readb(info, AXP288_FG_OCVL_REG)); |
1567 |
+- seq_printf(s, "FG_DES_CAP1[%02x] : %02x\n", |
1568 |
++ fuel_gauge_read_12bit_word(info, AXP288_FG_OCVH_REG)); |
1569 |
++ seq_printf(s, " FG_DES_CAP[%02x] : %04x\n", |
1570 |
+ AXP288_FG_DES_CAP1_REG, |
1571 |
+- fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP1_REG)); |
1572 |
+- seq_printf(s, "FG_DES_CAP0[%02x] : %02x\n", |
1573 |
+- AXP288_FG_DES_CAP0_REG, |
1574 |
+- fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP0_REG)); |
1575 |
+- seq_printf(s, " FG_CC_MTR1[%02x] : %02x\n", |
1576 |
++ fuel_gauge_read_15bit_word(info, AXP288_FG_DES_CAP1_REG)); |
1577 |
++ seq_printf(s, " FG_CC_MTR[%02x] : %04x\n", |
1578 |
+ AXP288_FG_CC_MTR1_REG, |
1579 |
+- fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR1_REG)); |
1580 |
+- seq_printf(s, " FG_CC_MTR0[%02x] : %02x\n", |
1581 |
+- AXP288_FG_CC_MTR0_REG, |
1582 |
+- fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR0_REG)); |
1583 |
++ fuel_gauge_read_15bit_word(info, AXP288_FG_CC_MTR1_REG)); |
1584 |
+ seq_printf(s, " FG_OCV_CAP[%02x] : %02x\n", |
1585 |
+ AXP288_FG_OCV_CAP_REG, |
1586 |
+ fuel_gauge_reg_readb(info, AXP288_FG_OCV_CAP_REG)); |
1587 |
+@@ -517,21 +545,12 @@ static int fuel_gauge_get_btemp(struct axp288_fg_info *info, int *btemp) |
1588 |
+ |
1589 |
+ static int fuel_gauge_get_vocv(struct axp288_fg_info *info, int *vocv) |
1590 |
+ { |
1591 |
+- int ret, value; |
1592 |
+- |
1593 |
+- /* 12-bit data value, upper 8 in OCVH, lower 4 in OCVL */ |
1594 |
+- ret = fuel_gauge_reg_readb(info, AXP288_FG_OCVH_REG); |
1595 |
+- if (ret < 0) |
1596 |
+- goto vocv_read_fail; |
1597 |
+- value = ret << 4; |
1598 |
++ int ret; |
1599 |
+ |
1600 |
+- ret = fuel_gauge_reg_readb(info, AXP288_FG_OCVL_REG); |
1601 |
+- if (ret < 0) |
1602 |
+- goto vocv_read_fail; |
1603 |
+- value |= (ret & 0xf); |
1604 |
++ ret = fuel_gauge_read_12bit_word(info, AXP288_FG_OCVH_REG); |
1605 |
++ if (ret >= 0) |
1606 |
++ *vocv = VOLTAGE_FROM_ADC(ret); |
1607 |
+ |
1608 |
+- *vocv = VOLTAGE_FROM_ADC(value); |
1609 |
+-vocv_read_fail: |
1610 |
+ return ret; |
1611 |
+ } |
1612 |
+ |
1613 |
+@@ -663,28 +682,18 @@ static int fuel_gauge_get_property(struct power_supply *ps, |
1614 |
+ val->intval = POWER_SUPPLY_TECHNOLOGY_LION; |
1615 |
+ break; |
1616 |
+ case POWER_SUPPLY_PROP_CHARGE_NOW: |
1617 |
+- ret = fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR1_REG); |
1618 |
++ ret = fuel_gauge_read_15bit_word(info, AXP288_FG_CC_MTR1_REG); |
1619 |
+ if (ret < 0) |
1620 |
+ goto fuel_gauge_read_err; |
1621 |
+ |
1622 |
+- value = (ret & FG_CC_MTR1_VAL_MASK) << 8; |
1623 |
+- ret = fuel_gauge_reg_readb(info, AXP288_FG_CC_MTR0_REG); |
1624 |
+- if (ret < 0) |
1625 |
+- goto fuel_gauge_read_err; |
1626 |
+- value |= (ret & FG_CC_MTR0_VAL_MASK); |
1627 |
+- val->intval = value * FG_DES_CAP_RES_LSB; |
1628 |
++ val->intval = ret * FG_DES_CAP_RES_LSB; |
1629 |
+ break; |
1630 |
+ case POWER_SUPPLY_PROP_CHARGE_FULL: |
1631 |
+- ret = fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP1_REG); |
1632 |
++ ret = fuel_gauge_read_15bit_word(info, AXP288_FG_DES_CAP1_REG); |
1633 |
+ if (ret < 0) |
1634 |
+ goto fuel_gauge_read_err; |
1635 |
+ |
1636 |
+- value = (ret & FG_DES_CAP1_VAL_MASK) << 8; |
1637 |
+- ret = fuel_gauge_reg_readb(info, AXP288_FG_DES_CAP0_REG); |
1638 |
+- if (ret < 0) |
1639 |
+- goto fuel_gauge_read_err; |
1640 |
+- value |= (ret & FG_DES_CAP0_VAL_MASK); |
1641 |
+- val->intval = value * FG_DES_CAP_RES_LSB; |
1642 |
++ val->intval = ret * FG_DES_CAP_RES_LSB; |
1643 |
+ break; |
1644 |
+ case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN: |
1645 |
+ val->intval = PROP_CURR(info->pdata->design_cap); |
1646 |
+diff --git a/drivers/rtc/rtc-rx8010.c b/drivers/rtc/rtc-rx8010.c |
1647 |
+index 7163b91bb773..d08da371912c 100644 |
1648 |
+--- a/drivers/rtc/rtc-rx8010.c |
1649 |
++++ b/drivers/rtc/rtc-rx8010.c |
1650 |
+@@ -63,7 +63,6 @@ struct rx8010_data { |
1651 |
+ struct i2c_client *client; |
1652 |
+ struct rtc_device *rtc; |
1653 |
+ u8 ctrlreg; |
1654 |
+- spinlock_t flags_lock; |
1655 |
+ }; |
1656 |
+ |
1657 |
+ static irqreturn_t rx8010_irq_1_handler(int irq, void *dev_id) |
1658 |
+@@ -72,12 +71,12 @@ static irqreturn_t rx8010_irq_1_handler(int irq, void *dev_id) |
1659 |
+ struct rx8010_data *rx8010 = i2c_get_clientdata(client); |
1660 |
+ int flagreg; |
1661 |
+ |
1662 |
+- spin_lock(&rx8010->flags_lock); |
1663 |
++ mutex_lock(&rx8010->rtc->ops_lock); |
1664 |
+ |
1665 |
+ flagreg = i2c_smbus_read_byte_data(client, RX8010_FLAG); |
1666 |
+ |
1667 |
+ if (flagreg <= 0) { |
1668 |
+- spin_unlock(&rx8010->flags_lock); |
1669 |
++ mutex_unlock(&rx8010->rtc->ops_lock); |
1670 |
+ return IRQ_NONE; |
1671 |
+ } |
1672 |
+ |
1673 |
+@@ -101,7 +100,7 @@ static irqreturn_t rx8010_irq_1_handler(int irq, void *dev_id) |
1674 |
+ |
1675 |
+ i2c_smbus_write_byte_data(client, RX8010_FLAG, flagreg); |
1676 |
+ |
1677 |
+- spin_unlock(&rx8010->flags_lock); |
1678 |
++ mutex_unlock(&rx8010->rtc->ops_lock); |
1679 |
+ return IRQ_HANDLED; |
1680 |
+ } |
1681 |
+ |
1682 |
+@@ -143,7 +142,6 @@ static int rx8010_set_time(struct device *dev, struct rtc_time *dt) |
1683 |
+ u8 date[7]; |
1684 |
+ int ctrl, flagreg; |
1685 |
+ int ret; |
1686 |
+- unsigned long irqflags; |
1687 |
+ |
1688 |
+ if ((dt->tm_year < 100) || (dt->tm_year > 199)) |
1689 |
+ return -EINVAL; |
1690 |
+@@ -181,11 +179,8 @@ static int rx8010_set_time(struct device *dev, struct rtc_time *dt) |
1691 |
+ if (ret < 0) |
1692 |
+ return ret; |
1693 |
+ |
1694 |
+- spin_lock_irqsave(&rx8010->flags_lock, irqflags); |
1695 |
+- |
1696 |
+ flagreg = i2c_smbus_read_byte_data(rx8010->client, RX8010_FLAG); |
1697 |
+ if (flagreg < 0) { |
1698 |
+- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); |
1699 |
+ return flagreg; |
1700 |
+ } |
1701 |
+ |
1702 |
+@@ -193,8 +188,6 @@ static int rx8010_set_time(struct device *dev, struct rtc_time *dt) |
1703 |
+ ret = i2c_smbus_write_byte_data(rx8010->client, RX8010_FLAG, |
1704 |
+ flagreg & ~RX8010_FLAG_VLF); |
1705 |
+ |
1706 |
+- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); |
1707 |
+- |
1708 |
+ return 0; |
1709 |
+ } |
1710 |
+ |
1711 |
+@@ -288,12 +281,9 @@ static int rx8010_set_alarm(struct device *dev, struct rtc_wkalrm *t) |
1712 |
+ u8 alarmvals[3]; |
1713 |
+ int extreg, flagreg; |
1714 |
+ int err; |
1715 |
+- unsigned long irqflags; |
1716 |
+ |
1717 |
+- spin_lock_irqsave(&rx8010->flags_lock, irqflags); |
1718 |
+ flagreg = i2c_smbus_read_byte_data(client, RX8010_FLAG); |
1719 |
+ if (flagreg < 0) { |
1720 |
+- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); |
1721 |
+ return flagreg; |
1722 |
+ } |
1723 |
+ |
1724 |
+@@ -302,14 +292,12 @@ static int rx8010_set_alarm(struct device *dev, struct rtc_wkalrm *t) |
1725 |
+ err = i2c_smbus_write_byte_data(rx8010->client, RX8010_CTRL, |
1726 |
+ rx8010->ctrlreg); |
1727 |
+ if (err < 0) { |
1728 |
+- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); |
1729 |
+ return err; |
1730 |
+ } |
1731 |
+ } |
1732 |
+ |
1733 |
+ flagreg &= ~RX8010_FLAG_AF; |
1734 |
+ err = i2c_smbus_write_byte_data(rx8010->client, RX8010_FLAG, flagreg); |
1735 |
+- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); |
1736 |
+ if (err < 0) |
1737 |
+ return err; |
1738 |
+ |
1739 |
+@@ -404,7 +392,6 @@ static int rx8010_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) |
1740 |
+ struct rx8010_data *rx8010 = dev_get_drvdata(dev); |
1741 |
+ int ret, tmp; |
1742 |
+ int flagreg; |
1743 |
+- unsigned long irqflags; |
1744 |
+ |
1745 |
+ switch (cmd) { |
1746 |
+ case RTC_VL_READ: |
1747 |
+@@ -419,16 +406,13 @@ static int rx8010_ioctl(struct device *dev, unsigned int cmd, unsigned long arg) |
1748 |
+ return 0; |
1749 |
+ |
1750 |
+ case RTC_VL_CLR: |
1751 |
+- spin_lock_irqsave(&rx8010->flags_lock, irqflags); |
1752 |
+ flagreg = i2c_smbus_read_byte_data(rx8010->client, RX8010_FLAG); |
1753 |
+ if (flagreg < 0) { |
1754 |
+- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); |
1755 |
+ return flagreg; |
1756 |
+ } |
1757 |
+ |
1758 |
+ flagreg &= ~RX8010_FLAG_VLF; |
1759 |
+ ret = i2c_smbus_write_byte_data(client, RX8010_FLAG, flagreg); |
1760 |
+- spin_unlock_irqrestore(&rx8010->flags_lock, irqflags); |
1761 |
+ if (ret < 0) |
1762 |
+ return ret; |
1763 |
+ |
1764 |
+@@ -466,8 +450,6 @@ static int rx8010_probe(struct i2c_client *client, |
1765 |
+ rx8010->client = client; |
1766 |
+ i2c_set_clientdata(client, rx8010); |
1767 |
+ |
1768 |
+- spin_lock_init(&rx8010->flags_lock); |
1769 |
+- |
1770 |
+ err = rx8010_init_client(client); |
1771 |
+ if (err) |
1772 |
+ return err; |
1773 |
+diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c |
1774 |
+index f1019908800e..453299095847 100644 |
1775 |
+--- a/drivers/scsi/lpfc/lpfc_attr.c |
1776 |
++++ b/drivers/scsi/lpfc/lpfc_attr.c |
1777 |
+@@ -5130,6 +5130,19 @@ lpfc_free_sysfs_attr(struct lpfc_vport *vport) |
1778 |
+ * Dynamic FC Host Attributes Support |
1779 |
+ */ |
1780 |
+ |
1781 |
++/** |
1782 |
++ * lpfc_get_host_symbolic_name - Copy symbolic name into the scsi host |
1783 |
++ * @shost: kernel scsi host pointer. |
1784 |
++ **/ |
1785 |
++static void |
1786 |
++lpfc_get_host_symbolic_name(struct Scsi_Host *shost) |
1787 |
++{ |
1788 |
++ struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; |
1789 |
++ |
1790 |
++ lpfc_vport_symbolic_node_name(vport, fc_host_symbolic_name(shost), |
1791 |
++ sizeof fc_host_symbolic_name(shost)); |
1792 |
++} |
1793 |
++ |
1794 |
+ /** |
1795 |
+ * lpfc_get_host_port_id - Copy the vport DID into the scsi host port id |
1796 |
+ * @shost: kernel scsi host pointer. |
1797 |
+@@ -5667,6 +5680,8 @@ struct fc_function_template lpfc_transport_functions = { |
1798 |
+ .show_host_supported_fc4s = 1, |
1799 |
+ .show_host_supported_speeds = 1, |
1800 |
+ .show_host_maxframe_size = 1, |
1801 |
++ |
1802 |
++ .get_host_symbolic_name = lpfc_get_host_symbolic_name, |
1803 |
+ .show_host_symbolic_name = 1, |
1804 |
+ |
1805 |
+ /* dynamic attributes the driver supports */ |
1806 |
+@@ -5734,6 +5749,8 @@ struct fc_function_template lpfc_vport_transport_functions = { |
1807 |
+ .show_host_supported_fc4s = 1, |
1808 |
+ .show_host_supported_speeds = 1, |
1809 |
+ .show_host_maxframe_size = 1, |
1810 |
++ |
1811 |
++ .get_host_symbolic_name = lpfc_get_host_symbolic_name, |
1812 |
+ .show_host_symbolic_name = 1, |
1813 |
+ |
1814 |
+ /* dynamic attributes the driver supports */ |
1815 |
+diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c |
1816 |
+index 7b696d108112..4df3cdcf88ce 100644 |
1817 |
+--- a/drivers/scsi/lpfc/lpfc_els.c |
1818 |
++++ b/drivers/scsi/lpfc/lpfc_els.c |
1819 |
+@@ -1999,6 +1999,9 @@ lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry) |
1820 |
+ if (sp->cmn.fcphHigh < FC_PH3) |
1821 |
+ sp->cmn.fcphHigh = FC_PH3; |
1822 |
+ |
1823 |
++ sp->cmn.valid_vendor_ver_level = 0; |
1824 |
++ memset(sp->vendorVersion, 0, sizeof(sp->vendorVersion)); |
1825 |
++ |
1826 |
+ lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, |
1827 |
+ "Issue PLOGI: did:x%x", |
1828 |
+ did, 0, 0); |
1829 |
+@@ -3990,6 +3993,9 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag, |
1830 |
+ } else { |
1831 |
+ memcpy(pcmd, &vport->fc_sparam, |
1832 |
+ sizeof(struct serv_parm)); |
1833 |
++ |
1834 |
++ sp->cmn.valid_vendor_ver_level = 0; |
1835 |
++ memset(sp->vendorVersion, 0, sizeof(sp->vendorVersion)); |
1836 |
+ } |
1837 |
+ |
1838 |
+ lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, |
1839 |
+diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h |
1840 |
+index 822654322e67..3b970d370600 100644 |
1841 |
+--- a/drivers/scsi/lpfc/lpfc_hw.h |
1842 |
++++ b/drivers/scsi/lpfc/lpfc_hw.h |
1843 |
+@@ -360,6 +360,12 @@ struct csp { |
1844 |
+ * Word 1 Bit 30 in PLOGI request is random offset |
1845 |
+ */ |
1846 |
+ #define virtual_fabric_support randomOffset /* Word 1, bit 30 */ |
1847 |
++/* |
1848 |
++ * Word 1 Bit 29 in common service parameter is overloaded. |
1849 |
++ * Word 1 Bit 29 in FLOGI response is multiple NPort assignment |
1850 |
++ * Word 1 Bit 29 in FLOGI/PLOGI request is Valid Vendor Version Level |
1851 |
++ */ |
1852 |
++#define valid_vendor_ver_level response_multiple_NPort /* Word 1, bit 29 */ |
1853 |
+ #ifdef __BIG_ENDIAN_BITFIELD |
1854 |
+ uint16_t request_multiple_Nport:1; /* FC Word 1, bit 31 */ |
1855 |
+ uint16_t randomOffset:1; /* FC Word 1, bit 30 */ |
1856 |
+diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c |
1857 |
+index 2d4f4b58dcfa..8f1df76a77b6 100644 |
1858 |
+--- a/drivers/scsi/lpfc/lpfc_sli.c |
1859 |
++++ b/drivers/scsi/lpfc/lpfc_sli.c |
1860 |
+@@ -119,6 +119,8 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, union lpfc_wqe *wqe) |
1861 |
+ if (q->phba->sli3_options & LPFC_SLI4_PHWQ_ENABLED) |
1862 |
+ bf_set(wqe_wqid, &wqe->generic.wqe_com, q->queue_id); |
1863 |
+ lpfc_sli_pcimem_bcopy(wqe, temp_wqe, q->entry_size); |
1864 |
++ /* ensure WQE bcopy flushed before doorbell write */ |
1865 |
++ wmb(); |
1866 |
+ |
1867 |
+ /* Update the host index before invoking device */ |
1868 |
+ host_index = q->host_index; |
1869 |
+@@ -10004,6 +10006,7 @@ lpfc_sli_abort_iotag_issue(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, |
1870 |
+ iabt->ulpCommand = CMD_CLOSE_XRI_CN; |
1871 |
+ |
1872 |
+ abtsiocbp->iocb_cmpl = lpfc_sli_abort_els_cmpl; |
1873 |
++ abtsiocbp->vport = vport; |
1874 |
+ |
1875 |
+ lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, |
1876 |
+ "0339 Abort xri x%x, original iotag x%x, " |
1877 |
+diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c |
1878 |
+index c27f4b724547..e18bbc66e83b 100644 |
1879 |
+--- a/drivers/scsi/lpfc/lpfc_vport.c |
1880 |
++++ b/drivers/scsi/lpfc/lpfc_vport.c |
1881 |
+@@ -537,6 +537,12 @@ enable_vport(struct fc_vport *fc_vport) |
1882 |
+ |
1883 |
+ spin_lock_irq(shost->host_lock); |
1884 |
+ vport->load_flag |= FC_LOADING; |
1885 |
++ if (vport->fc_flag & FC_VPORT_NEEDS_INIT_VPI) { |
1886 |
++ spin_unlock_irq(shost->host_lock); |
1887 |
++ lpfc_issue_init_vpi(vport); |
1888 |
++ goto out; |
1889 |
++ } |
1890 |
++ |
1891 |
+ vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; |
1892 |
+ spin_unlock_irq(shost->host_lock); |
1893 |
+ |
1894 |
+@@ -557,6 +563,8 @@ enable_vport(struct fc_vport *fc_vport) |
1895 |
+ } else { |
1896 |
+ lpfc_vport_set_state(vport, FC_VPORT_FAILED); |
1897 |
+ } |
1898 |
++ |
1899 |
++out: |
1900 |
+ lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, |
1901 |
+ "1827 Vport Enabled.\n"); |
1902 |
+ return VPORT_OK; |
1903 |
+diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c |
1904 |
+index 462bf42dd19c..51d559214db6 100644 |
1905 |
+--- a/drivers/scsi/ufs/ufs-qcom.c |
1906 |
++++ b/drivers/scsi/ufs/ufs-qcom.c |
1907 |
+@@ -1689,6 +1689,7 @@ static const struct of_device_id ufs_qcom_of_match[] = { |
1908 |
+ { .compatible = "qcom,ufshc"}, |
1909 |
+ {}, |
1910 |
+ }; |
1911 |
++MODULE_DEVICE_TABLE(of, ufs_qcom_of_match); |
1912 |
+ |
1913 |
+ static const struct dev_pm_ops ufs_qcom_pm_ops = { |
1914 |
+ .suspend = ufshcd_pltfrm_suspend, |
1915 |
+diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c |
1916 |
+index edb06e466224..530034bc2d13 100644 |
1917 |
+--- a/drivers/scsi/ufs/ufshcd.c |
1918 |
++++ b/drivers/scsi/ufs/ufshcd.c |
1919 |
+@@ -3781,18 +3781,25 @@ static int ufshcd_disable_auto_bkops(struct ufs_hba *hba) |
1920 |
+ } |
1921 |
+ |
1922 |
+ /** |
1923 |
+- * ufshcd_force_reset_auto_bkops - force enable of auto bkops |
1924 |
++ * ufshcd_force_reset_auto_bkops - force reset auto bkops state |
1925 |
+ * @hba: per adapter instance |
1926 |
+ * |
1927 |
+ * After a device reset the device may toggle the BKOPS_EN flag |
1928 |
+ * to default value. The s/w tracking variables should be updated |
1929 |
+- * as well. Do this by forcing enable of auto bkops. |
1930 |
++ * as well. This function would change the auto-bkops state based on |
1931 |
++ * UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND. |
1932 |
+ */ |
1933 |
+-static void ufshcd_force_reset_auto_bkops(struct ufs_hba *hba) |
1934 |
++static void ufshcd_force_reset_auto_bkops(struct ufs_hba *hba) |
1935 |
+ { |
1936 |
+- hba->auto_bkops_enabled = false; |
1937 |
+- hba->ee_ctrl_mask |= MASK_EE_URGENT_BKOPS; |
1938 |
+- ufshcd_enable_auto_bkops(hba); |
1939 |
++ if (ufshcd_keep_autobkops_enabled_except_suspend(hba)) { |
1940 |
++ hba->auto_bkops_enabled = false; |
1941 |
++ hba->ee_ctrl_mask |= MASK_EE_URGENT_BKOPS; |
1942 |
++ ufshcd_enable_auto_bkops(hba); |
1943 |
++ } else { |
1944 |
++ hba->auto_bkops_enabled = true; |
1945 |
++ hba->ee_ctrl_mask &= ~MASK_EE_URGENT_BKOPS; |
1946 |
++ ufshcd_disable_auto_bkops(hba); |
1947 |
++ } |
1948 |
+ } |
1949 |
+ |
1950 |
+ static inline int ufshcd_get_bkops_status(struct ufs_hba *hba, u32 *status) |
1951 |
+@@ -6138,11 +6145,15 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) |
1952 |
+ goto set_old_link_state; |
1953 |
+ } |
1954 |
+ |
1955 |
+- /* |
1956 |
+- * If BKOPs operations are urgently needed at this moment then |
1957 |
+- * keep auto-bkops enabled or else disable it. |
1958 |
+- */ |
1959 |
+- ufshcd_urgent_bkops(hba); |
1960 |
++ if (ufshcd_keep_autobkops_enabled_except_suspend(hba)) |
1961 |
++ ufshcd_enable_auto_bkops(hba); |
1962 |
++ else |
1963 |
++ /* |
1964 |
++ * If BKOPs operations are urgently needed at this moment then |
1965 |
++ * keep auto-bkops enabled or else disable it. |
1966 |
++ */ |
1967 |
++ ufshcd_urgent_bkops(hba); |
1968 |
++ |
1969 |
+ hba->clk_gating.is_suspended = false; |
1970 |
+ |
1971 |
+ if (ufshcd_is_clkscaling_enabled(hba)) |
1972 |
+diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h |
1973 |
+index 04509827fe64..f2170d5058a8 100644 |
1974 |
+--- a/drivers/scsi/ufs/ufshcd.h |
1975 |
++++ b/drivers/scsi/ufs/ufshcd.h |
1976 |
+@@ -548,6 +548,14 @@ struct ufs_hba { |
1977 |
+ * CAUTION: Enabling this might reduce overall UFS throughput. |
1978 |
+ */ |
1979 |
+ #define UFSHCD_CAP_INTR_AGGR (1 << 4) |
1980 |
++ /* |
1981 |
++ * This capability allows the device auto-bkops to be always enabled |
1982 |
++ * except during suspend (both runtime and suspend). |
1983 |
++ * Enabling this capability means that device will always be allowed |
1984 |
++ * to do background operation when it's active but it might degrade |
1985 |
++ * the performance of ongoing read/write operations. |
1986 |
++ */ |
1987 |
++#define UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND (1 << 5) |
1988 |
+ |
1989 |
+ struct devfreq *devfreq; |
1990 |
+ struct ufs_clk_scaling clk_scaling; |
1991 |
+@@ -645,6 +653,11 @@ static inline void *ufshcd_get_variant(struct ufs_hba *hba) |
1992 |
+ BUG_ON(!hba); |
1993 |
+ return hba->priv; |
1994 |
+ } |
1995 |
++static inline bool ufshcd_keep_autobkops_enabled_except_suspend( |
1996 |
++ struct ufs_hba *hba) |
1997 |
++{ |
1998 |
++ return hba->caps & UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND; |
1999 |
++} |
2000 |
+ |
2001 |
+ extern int ufshcd_runtime_suspend(struct ufs_hba *hba); |
2002 |
+ extern int ufshcd_runtime_resume(struct ufs_hba *hba); |
2003 |
+diff --git a/drivers/staging/greybus/connection.c b/drivers/staging/greybus/connection.c |
2004 |
+index 557075147f2d..1bf0ee403106 100644 |
2005 |
+--- a/drivers/staging/greybus/connection.c |
2006 |
++++ b/drivers/staging/greybus/connection.c |
2007 |
+@@ -357,6 +357,9 @@ static int gb_connection_hd_cport_quiesce(struct gb_connection *connection) |
2008 |
+ size_t peer_space; |
2009 |
+ int ret; |
2010 |
+ |
2011 |
++ if (!hd->driver->cport_quiesce) |
2012 |
++ return 0; |
2013 |
++ |
2014 |
+ peer_space = sizeof(struct gb_operation_msg_hdr) + |
2015 |
+ sizeof(struct gb_cport_shutdown_request); |
2016 |
+ |
2017 |
+@@ -380,6 +383,9 @@ static int gb_connection_hd_cport_clear(struct gb_connection *connection) |
2018 |
+ struct gb_host_device *hd = connection->hd; |
2019 |
+ int ret; |
2020 |
+ |
2021 |
++ if (!hd->driver->cport_clear) |
2022 |
++ return 0; |
2023 |
++ |
2024 |
+ ret = hd->driver->cport_clear(hd, connection->hd_cport_id); |
2025 |
+ if (ret) { |
2026 |
+ dev_err(&hd->dev, "%s: failed to clear host cport: %d\n", |
2027 |
+diff --git a/drivers/staging/greybus/spilib.c b/drivers/staging/greybus/spilib.c |
2028 |
+index e97b19148497..1e7321a1404c 100644 |
2029 |
+--- a/drivers/staging/greybus/spilib.c |
2030 |
++++ b/drivers/staging/greybus/spilib.c |
2031 |
+@@ -544,11 +544,14 @@ int gb_spilib_master_init(struct gb_connection *connection, struct device *dev, |
2032 |
+ |
2033 |
+ return 0; |
2034 |
+ |
2035 |
+-exit_spi_unregister: |
2036 |
+- spi_unregister_master(master); |
2037 |
+ exit_spi_put: |
2038 |
+ spi_master_put(master); |
2039 |
+ |
2040 |
++ return ret; |
2041 |
++ |
2042 |
++exit_spi_unregister: |
2043 |
++ spi_unregister_master(master); |
2044 |
++ |
2045 |
+ return ret; |
2046 |
+ } |
2047 |
+ EXPORT_SYMBOL_GPL(gb_spilib_master_init); |
2048 |
+@@ -558,7 +561,6 @@ void gb_spilib_master_exit(struct gb_connection *connection) |
2049 |
+ struct spi_master *master = gb_connection_get_data(connection); |
2050 |
+ |
2051 |
+ spi_unregister_master(master); |
2052 |
+- spi_master_put(master); |
2053 |
+ } |
2054 |
+ EXPORT_SYMBOL_GPL(gb_spilib_master_exit); |
2055 |
+ |
2056 |
+diff --git a/drivers/staging/rtl8188eu/include/rtw_debug.h b/drivers/staging/rtl8188eu/include/rtw_debug.h |
2057 |
+index 95590a1a7b1b..9cc4b8c7c166 100644 |
2058 |
+--- a/drivers/staging/rtl8188eu/include/rtw_debug.h |
2059 |
++++ b/drivers/staging/rtl8188eu/include/rtw_debug.h |
2060 |
+@@ -70,7 +70,7 @@ extern u32 GlobalDebugLevel; |
2061 |
+ #define DBG_88E_LEVEL(_level, fmt, arg...) \ |
2062 |
+ do { \ |
2063 |
+ if (_level <= GlobalDebugLevel) \ |
2064 |
+- pr_info(DRIVER_PREFIX"ERROR " fmt, ##arg); \ |
2065 |
++ pr_info(DRIVER_PREFIX fmt, ##arg); \ |
2066 |
+ } while (0) |
2067 |
+ |
2068 |
+ #define DBG_88E(...) \ |
2069 |
+diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c |
2070 |
+index 475e7904fe45..2d26f9a30fcf 100644 |
2071 |
+--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c |
2072 |
++++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c |
2073 |
+@@ -199,7 +199,7 @@ static noinline_for_stack char *translate_scan(struct _adapter *padapter, |
2074 |
+ iwe.cmd = SIOCGIWMODE; |
2075 |
+ memcpy((u8 *)&cap, r8712_get_capability_from_ie(pnetwork->network.IEs), |
2076 |
+ 2); |
2077 |
+- cap = le16_to_cpu(cap); |
2078 |
++ le16_to_cpus(&cap); |
2079 |
+ if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_BSS)) { |
2080 |
+ if (cap & WLAN_CAPABILITY_BSS) |
2081 |
+ iwe.u.mode = (u32)IW_MODE_MASTER; |
2082 |
+diff --git a/drivers/staging/wilc1000/linux_wlan.c b/drivers/staging/wilc1000/linux_wlan.c |
2083 |
+index defffa75ae1c..07d6e4824a9d 100644 |
2084 |
+--- a/drivers/staging/wilc1000/linux_wlan.c |
2085 |
++++ b/drivers/staging/wilc1000/linux_wlan.c |
2086 |
+@@ -1001,7 +1001,7 @@ int wilc_mac_xmit(struct sk_buff *skb, struct net_device *ndev) |
2087 |
+ tx_data->skb = skb; |
2088 |
+ |
2089 |
+ eth_h = (struct ethhdr *)(skb->data); |
2090 |
+- if (eth_h->h_proto == 0x8e88) |
2091 |
++ if (eth_h->h_proto == cpu_to_be16(0x8e88)) |
2092 |
+ netdev_dbg(ndev, "EAPOL transmitted\n"); |
2093 |
+ |
2094 |
+ ih = (struct iphdr *)(skb->data + sizeof(struct ethhdr)); |
2095 |
+diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c |
2096 |
+index c8075eb3db26..fa619354c5c5 100644 |
2097 |
+--- a/drivers/usb/core/devio.c |
2098 |
++++ b/drivers/usb/core/devio.c |
2099 |
+@@ -1838,6 +1838,18 @@ static int proc_unlinkurb(struct usb_dev_state *ps, void __user *arg) |
2100 |
+ return 0; |
2101 |
+ } |
2102 |
+ |
2103 |
++static void compute_isochronous_actual_length(struct urb *urb) |
2104 |
++{ |
2105 |
++ unsigned int i; |
2106 |
++ |
2107 |
++ if (urb->number_of_packets > 0) { |
2108 |
++ urb->actual_length = 0; |
2109 |
++ for (i = 0; i < urb->number_of_packets; i++) |
2110 |
++ urb->actual_length += |
2111 |
++ urb->iso_frame_desc[i].actual_length; |
2112 |
++ } |
2113 |
++} |
2114 |
++ |
2115 |
+ static int processcompl(struct async *as, void __user * __user *arg) |
2116 |
+ { |
2117 |
+ struct urb *urb = as->urb; |
2118 |
+@@ -1845,6 +1857,7 @@ static int processcompl(struct async *as, void __user * __user *arg) |
2119 |
+ void __user *addr = as->userurb; |
2120 |
+ unsigned int i; |
2121 |
+ |
2122 |
++ compute_isochronous_actual_length(urb); |
2123 |
+ if (as->userbuffer && urb->actual_length) { |
2124 |
+ if (copy_urb_data_to_user(as->userbuffer, urb)) |
2125 |
+ goto err_out; |
2126 |
+@@ -2019,6 +2032,7 @@ static int processcompl_compat(struct async *as, void __user * __user *arg) |
2127 |
+ void __user *addr = as->userurb; |
2128 |
+ unsigned int i; |
2129 |
+ |
2130 |
++ compute_isochronous_actual_length(urb); |
2131 |
+ if (as->userbuffer && urb->actual_length) { |
2132 |
+ if (copy_urb_data_to_user(as->userbuffer, urb)) |
2133 |
+ return -EFAULT; |
2134 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
2135 |
+index a6aaf2f193a4..37c418e581fb 100644 |
2136 |
+--- a/drivers/usb/core/quirks.c |
2137 |
++++ b/drivers/usb/core/quirks.c |
2138 |
+@@ -221,6 +221,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
2139 |
+ /* Corsair Strafe RGB */ |
2140 |
+ { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT }, |
2141 |
+ |
2142 |
++ /* Corsair K70 LUX */ |
2143 |
++ { USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT }, |
2144 |
++ |
2145 |
+ /* MIDI keyboard WORLDE MINI */ |
2146 |
+ { USB_DEVICE(0x1c75, 0x0204), .driver_info = |
2147 |
+ USB_QUIRK_CONFIG_INTF_STRINGS }, |
2148 |
+diff --git a/drivers/usb/gadget/function/f_fs.c b/drivers/usb/gadget/function/f_fs.c |
2149 |
+index f9c99803a43d..273320fa30ae 100644 |
2150 |
+--- a/drivers/usb/gadget/function/f_fs.c |
2151 |
++++ b/drivers/usb/gadget/function/f_fs.c |
2152 |
+@@ -3698,6 +3698,7 @@ static void ffs_closed(struct ffs_data *ffs) |
2153 |
+ goto done; |
2154 |
+ |
2155 |
+ ffs_obj->desc_ready = false; |
2156 |
++ ffs_obj->ffs_data = NULL; |
2157 |
+ |
2158 |
+ if (test_and_clear_bit(FFS_FL_CALL_CLOSED_CALLBACK, &ffs->flags) && |
2159 |
+ ffs_obj->ffs_closed_callback) |
2160 |
+diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c |
2161 |
+index b2f2e87aed94..91e7e3a166a5 100644 |
2162 |
+--- a/drivers/usb/serial/garmin_gps.c |
2163 |
++++ b/drivers/usb/serial/garmin_gps.c |
2164 |
+@@ -138,6 +138,7 @@ struct garmin_data { |
2165 |
+ __u8 privpkt[4*6]; |
2166 |
+ spinlock_t lock; |
2167 |
+ struct list_head pktlist; |
2168 |
++ struct usb_anchor write_urbs; |
2169 |
+ }; |
2170 |
+ |
2171 |
+ |
2172 |
+@@ -905,13 +906,19 @@ static int garmin_init_session(struct usb_serial_port *port) |
2173 |
+ sizeof(GARMIN_START_SESSION_REQ), 0); |
2174 |
+ |
2175 |
+ if (status < 0) |
2176 |
+- break; |
2177 |
++ goto err_kill_urbs; |
2178 |
+ } |
2179 |
+ |
2180 |
+ if (status > 0) |
2181 |
+ status = 0; |
2182 |
+ } |
2183 |
+ |
2184 |
++ return status; |
2185 |
++ |
2186 |
++err_kill_urbs: |
2187 |
++ usb_kill_anchored_urbs(&garmin_data_p->write_urbs); |
2188 |
++ usb_kill_urb(port->interrupt_in_urb); |
2189 |
++ |
2190 |
+ return status; |
2191 |
+ } |
2192 |
+ |
2193 |
+@@ -930,7 +937,6 @@ static int garmin_open(struct tty_struct *tty, struct usb_serial_port *port) |
2194 |
+ spin_unlock_irqrestore(&garmin_data_p->lock, flags); |
2195 |
+ |
2196 |
+ /* shutdown any bulk reads that might be going on */ |
2197 |
+- usb_kill_urb(port->write_urb); |
2198 |
+ usb_kill_urb(port->read_urb); |
2199 |
+ |
2200 |
+ if (garmin_data_p->state == STATE_RESET) |
2201 |
+@@ -953,7 +959,7 @@ static void garmin_close(struct usb_serial_port *port) |
2202 |
+ |
2203 |
+ /* shutdown our urbs */ |
2204 |
+ usb_kill_urb(port->read_urb); |
2205 |
+- usb_kill_urb(port->write_urb); |
2206 |
++ usb_kill_anchored_urbs(&garmin_data_p->write_urbs); |
2207 |
+ |
2208 |
+ /* keep reset state so we know that we must start a new session */ |
2209 |
+ if (garmin_data_p->state != STATE_RESET) |
2210 |
+@@ -1037,12 +1043,14 @@ static int garmin_write_bulk(struct usb_serial_port *port, |
2211 |
+ } |
2212 |
+ |
2213 |
+ /* send it down the pipe */ |
2214 |
++ usb_anchor_urb(urb, &garmin_data_p->write_urbs); |
2215 |
+ status = usb_submit_urb(urb, GFP_ATOMIC); |
2216 |
+ if (status) { |
2217 |
+ dev_err(&port->dev, |
2218 |
+ "%s - usb_submit_urb(write bulk) failed with status = %d\n", |
2219 |
+ __func__, status); |
2220 |
+ count = status; |
2221 |
++ usb_unanchor_urb(urb); |
2222 |
+ kfree(buffer); |
2223 |
+ } |
2224 |
+ |
2225 |
+@@ -1401,9 +1409,16 @@ static int garmin_port_probe(struct usb_serial_port *port) |
2226 |
+ garmin_data_p->state = 0; |
2227 |
+ garmin_data_p->flags = 0; |
2228 |
+ garmin_data_p->count = 0; |
2229 |
++ init_usb_anchor(&garmin_data_p->write_urbs); |
2230 |
+ usb_set_serial_port_data(port, garmin_data_p); |
2231 |
+ |
2232 |
+ status = garmin_init_session(port); |
2233 |
++ if (status) |
2234 |
++ goto err_free; |
2235 |
++ |
2236 |
++ return 0; |
2237 |
++err_free: |
2238 |
++ kfree(garmin_data_p); |
2239 |
+ |
2240 |
+ return status; |
2241 |
+ } |
2242 |
+@@ -1413,6 +1428,7 @@ static int garmin_port_remove(struct usb_serial_port *port) |
2243 |
+ { |
2244 |
+ struct garmin_data *garmin_data_p = usb_get_serial_port_data(port); |
2245 |
+ |
2246 |
++ usb_kill_anchored_urbs(&garmin_data_p->write_urbs); |
2247 |
+ usb_kill_urb(port->interrupt_in_urb); |
2248 |
+ del_timer_sync(&garmin_data_p->timer); |
2249 |
+ kfree(garmin_data_p); |
2250 |
+diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c |
2251 |
+index e1c1e329c877..4516291df1b8 100644 |
2252 |
+--- a/drivers/usb/serial/qcserial.c |
2253 |
++++ b/drivers/usb/serial/qcserial.c |
2254 |
+@@ -148,6 +148,7 @@ static const struct usb_device_id id_table[] = { |
2255 |
+ {DEVICE_SWI(0x1199, 0x68a2)}, /* Sierra Wireless MC7710 */ |
2256 |
+ {DEVICE_SWI(0x1199, 0x68c0)}, /* Sierra Wireless MC7304/MC7354 */ |
2257 |
+ {DEVICE_SWI(0x1199, 0x901c)}, /* Sierra Wireless EM7700 */ |
2258 |
++ {DEVICE_SWI(0x1199, 0x901e)}, /* Sierra Wireless EM7355 QDL */ |
2259 |
+ {DEVICE_SWI(0x1199, 0x901f)}, /* Sierra Wireless EM7355 */ |
2260 |
+ {DEVICE_SWI(0x1199, 0x9040)}, /* Sierra Wireless Modem */ |
2261 |
+ {DEVICE_SWI(0x1199, 0x9041)}, /* Sierra Wireless MC7305/MC7355 */ |
2262 |
+diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c |
2263 |
+index dd88ba1d71ce..35373e2065b2 100644 |
2264 |
+--- a/drivers/video/backlight/adp5520_bl.c |
2265 |
++++ b/drivers/video/backlight/adp5520_bl.c |
2266 |
+@@ -332,10 +332,18 @@ static int adp5520_bl_probe(struct platform_device *pdev) |
2267 |
+ } |
2268 |
+ |
2269 |
+ platform_set_drvdata(pdev, bl); |
2270 |
+- ret |= adp5520_bl_setup(bl); |
2271 |
++ ret = adp5520_bl_setup(bl); |
2272 |
++ if (ret) { |
2273 |
++ dev_err(&pdev->dev, "failed to setup\n"); |
2274 |
++ if (data->pdata->en_ambl_sens) |
2275 |
++ sysfs_remove_group(&bl->dev.kobj, |
2276 |
++ &adp5520_bl_attr_group); |
2277 |
++ return ret; |
2278 |
++ } |
2279 |
++ |
2280 |
+ backlight_update_status(bl); |
2281 |
+ |
2282 |
+- return ret; |
2283 |
++ return 0; |
2284 |
+ } |
2285 |
+ |
2286 |
+ static int adp5520_bl_remove(struct platform_device *pdev) |
2287 |
+diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c |
2288 |
+index 7de847df224f..4b40c6a4d441 100644 |
2289 |
+--- a/drivers/video/backlight/lcd.c |
2290 |
++++ b/drivers/video/backlight/lcd.c |
2291 |
+@@ -226,6 +226,8 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent, |
2292 |
+ dev_set_name(&new_ld->dev, "%s", name); |
2293 |
+ dev_set_drvdata(&new_ld->dev, devdata); |
2294 |
+ |
2295 |
++ new_ld->ops = ops; |
2296 |
++ |
2297 |
+ rc = device_register(&new_ld->dev); |
2298 |
+ if (rc) { |
2299 |
+ put_device(&new_ld->dev); |
2300 |
+@@ -238,8 +240,6 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent, |
2301 |
+ return ERR_PTR(rc); |
2302 |
+ } |
2303 |
+ |
2304 |
+- new_ld->ops = ops; |
2305 |
+- |
2306 |
+ return new_ld; |
2307 |
+ } |
2308 |
+ EXPORT_SYMBOL(lcd_device_register); |
2309 |
+diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h |
2310 |
+index effadd05695b..fbd6f7202476 100644 |
2311 |
+--- a/include/dt-bindings/pinctrl/omap.h |
2312 |
++++ b/include/dt-bindings/pinctrl/omap.h |
2313 |
+@@ -45,8 +45,8 @@ |
2314 |
+ #define PIN_OFF_NONE 0 |
2315 |
+ #define PIN_OFF_OUTPUT_HIGH (OFF_EN | OFFOUT_EN | OFFOUT_VAL) |
2316 |
+ #define PIN_OFF_OUTPUT_LOW (OFF_EN | OFFOUT_EN) |
2317 |
+-#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFF_PULL_EN | OFF_PULL_UP) |
2318 |
+-#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN) |
2319 |
++#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFFOUT_EN | OFF_PULL_EN | OFF_PULL_UP) |
2320 |
++#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFFOUT_EN | OFF_PULL_EN) |
2321 |
+ #define PIN_OFF_WAKEUPENABLE WAKEUP_EN |
2322 |
+ |
2323 |
+ /* |
2324 |
+diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h |
2325 |
+index 7af20a136429..804c9b2bfce3 100644 |
2326 |
+--- a/include/uapi/linux/rds.h |
2327 |
++++ b/include/uapi/linux/rds.h |
2328 |
+@@ -104,8 +104,8 @@ |
2329 |
+ #define RDS_INFO_LAST 10010 |
2330 |
+ |
2331 |
+ struct rds_info_counter { |
2332 |
+- uint8_t name[32]; |
2333 |
+- uint64_t value; |
2334 |
++ __u8 name[32]; |
2335 |
++ __u64 value; |
2336 |
+ } __attribute__((packed)); |
2337 |
+ |
2338 |
+ #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 |
2339 |
+@@ -115,35 +115,35 @@ struct rds_info_counter { |
2340 |
+ #define TRANSNAMSIZ 16 |
2341 |
+ |
2342 |
+ struct rds_info_connection { |
2343 |
+- uint64_t next_tx_seq; |
2344 |
+- uint64_t next_rx_seq; |
2345 |
++ __u64 next_tx_seq; |
2346 |
++ __u64 next_rx_seq; |
2347 |
+ __be32 laddr; |
2348 |
+ __be32 faddr; |
2349 |
+- uint8_t transport[TRANSNAMSIZ]; /* null term ascii */ |
2350 |
+- uint8_t flags; |
2351 |
++ __u8 transport[TRANSNAMSIZ]; /* null term ascii */ |
2352 |
++ __u8 flags; |
2353 |
+ } __attribute__((packed)); |
2354 |
+ |
2355 |
+ #define RDS_INFO_MESSAGE_FLAG_ACK 0x01 |
2356 |
+ #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 |
2357 |
+ |
2358 |
+ struct rds_info_message { |
2359 |
+- uint64_t seq; |
2360 |
+- uint32_t len; |
2361 |
++ __u64 seq; |
2362 |
++ __u32 len; |
2363 |
+ __be32 laddr; |
2364 |
+ __be32 faddr; |
2365 |
+ __be16 lport; |
2366 |
+ __be16 fport; |
2367 |
+- uint8_t flags; |
2368 |
++ __u8 flags; |
2369 |
+ } __attribute__((packed)); |
2370 |
+ |
2371 |
+ struct rds_info_socket { |
2372 |
+- uint32_t sndbuf; |
2373 |
++ __u32 sndbuf; |
2374 |
+ __be32 bound_addr; |
2375 |
+ __be32 connected_addr; |
2376 |
+ __be16 bound_port; |
2377 |
+ __be16 connected_port; |
2378 |
+- uint32_t rcvbuf; |
2379 |
+- uint64_t inum; |
2380 |
++ __u32 rcvbuf; |
2381 |
++ __u64 inum; |
2382 |
+ } __attribute__((packed)); |
2383 |
+ |
2384 |
+ struct rds_info_tcp_socket { |
2385 |
+@@ -151,25 +151,25 @@ struct rds_info_tcp_socket { |
2386 |
+ __be16 local_port; |
2387 |
+ __be32 peer_addr; |
2388 |
+ __be16 peer_port; |
2389 |
+- uint64_t hdr_rem; |
2390 |
+- uint64_t data_rem; |
2391 |
+- uint32_t last_sent_nxt; |
2392 |
+- uint32_t last_expected_una; |
2393 |
+- uint32_t last_seen_una; |
2394 |
++ __u64 hdr_rem; |
2395 |
++ __u64 data_rem; |
2396 |
++ __u32 last_sent_nxt; |
2397 |
++ __u32 last_expected_una; |
2398 |
++ __u32 last_seen_una; |
2399 |
+ } __attribute__((packed)); |
2400 |
+ |
2401 |
+ #define RDS_IB_GID_LEN 16 |
2402 |
+ struct rds_info_rdma_connection { |
2403 |
+ __be32 src_addr; |
2404 |
+ __be32 dst_addr; |
2405 |
+- uint8_t src_gid[RDS_IB_GID_LEN]; |
2406 |
+- uint8_t dst_gid[RDS_IB_GID_LEN]; |
2407 |
++ __u8 src_gid[RDS_IB_GID_LEN]; |
2408 |
++ __u8 dst_gid[RDS_IB_GID_LEN]; |
2409 |
+ |
2410 |
+- uint32_t max_send_wr; |
2411 |
+- uint32_t max_recv_wr; |
2412 |
+- uint32_t max_send_sge; |
2413 |
+- uint32_t rdma_mr_max; |
2414 |
+- uint32_t rdma_mr_size; |
2415 |
++ __u32 max_send_wr; |
2416 |
++ __u32 max_recv_wr; |
2417 |
++ __u32 max_send_sge; |
2418 |
++ __u32 rdma_mr_max; |
2419 |
++ __u32 rdma_mr_size; |
2420 |
+ }; |
2421 |
+ |
2422 |
+ /* |
2423 |
+@@ -210,70 +210,70 @@ struct rds_info_rdma_connection { |
2424 |
+ * (so that the application does not have to worry about |
2425 |
+ * alignment). |
2426 |
+ */ |
2427 |
+-typedef uint64_t rds_rdma_cookie_t; |
2428 |
++typedef __u64 rds_rdma_cookie_t; |
2429 |
+ |
2430 |
+ struct rds_iovec { |
2431 |
+- uint64_t addr; |
2432 |
+- uint64_t bytes; |
2433 |
++ __u64 addr; |
2434 |
++ __u64 bytes; |
2435 |
+ }; |
2436 |
+ |
2437 |
+ struct rds_get_mr_args { |
2438 |
+ struct rds_iovec vec; |
2439 |
+- uint64_t cookie_addr; |
2440 |
+- uint64_t flags; |
2441 |
++ __u64 cookie_addr; |
2442 |
++ __u64 flags; |
2443 |
+ }; |
2444 |
+ |
2445 |
+ struct rds_get_mr_for_dest_args { |
2446 |
+ struct __kernel_sockaddr_storage dest_addr; |
2447 |
+ struct rds_iovec vec; |
2448 |
+- uint64_t cookie_addr; |
2449 |
+- uint64_t flags; |
2450 |
++ __u64 cookie_addr; |
2451 |
++ __u64 flags; |
2452 |
+ }; |
2453 |
+ |
2454 |
+ struct rds_free_mr_args { |
2455 |
+ rds_rdma_cookie_t cookie; |
2456 |
+- uint64_t flags; |
2457 |
++ __u64 flags; |
2458 |
+ }; |
2459 |
+ |
2460 |
+ struct rds_rdma_args { |
2461 |
+ rds_rdma_cookie_t cookie; |
2462 |
+ struct rds_iovec remote_vec; |
2463 |
+- uint64_t local_vec_addr; |
2464 |
+- uint64_t nr_local; |
2465 |
+- uint64_t flags; |
2466 |
+- uint64_t user_token; |
2467 |
++ __u64 local_vec_addr; |
2468 |
++ __u64 nr_local; |
2469 |
++ __u64 flags; |
2470 |
++ __u64 user_token; |
2471 |
+ }; |
2472 |
+ |
2473 |
+ struct rds_atomic_args { |
2474 |
+ rds_rdma_cookie_t cookie; |
2475 |
+- uint64_t local_addr; |
2476 |
+- uint64_t remote_addr; |
2477 |
++ __u64 local_addr; |
2478 |
++ __u64 remote_addr; |
2479 |
+ union { |
2480 |
+ struct { |
2481 |
+- uint64_t compare; |
2482 |
+- uint64_t swap; |
2483 |
++ __u64 compare; |
2484 |
++ __u64 swap; |
2485 |
+ } cswp; |
2486 |
+ struct { |
2487 |
+- uint64_t add; |
2488 |
++ __u64 add; |
2489 |
+ } fadd; |
2490 |
+ struct { |
2491 |
+- uint64_t compare; |
2492 |
+- uint64_t swap; |
2493 |
+- uint64_t compare_mask; |
2494 |
+- uint64_t swap_mask; |
2495 |
++ __u64 compare; |
2496 |
++ __u64 swap; |
2497 |
++ __u64 compare_mask; |
2498 |
++ __u64 swap_mask; |
2499 |
+ } m_cswp; |
2500 |
+ struct { |
2501 |
+- uint64_t add; |
2502 |
+- uint64_t nocarry_mask; |
2503 |
++ __u64 add; |
2504 |
++ __u64 nocarry_mask; |
2505 |
+ } m_fadd; |
2506 |
+ }; |
2507 |
+- uint64_t flags; |
2508 |
+- uint64_t user_token; |
2509 |
++ __u64 flags; |
2510 |
++ __u64 user_token; |
2511 |
+ }; |
2512 |
+ |
2513 |
+ struct rds_rdma_notify { |
2514 |
+- uint64_t user_token; |
2515 |
+- int32_t status; |
2516 |
++ __u64 user_token; |
2517 |
++ __s32 status; |
2518 |
+ }; |
2519 |
+ |
2520 |
+ #define RDS_RDMA_SUCCESS 0 |
2521 |
+diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c |
2522 |
+index 6b3d27e50317..dd33c785ce16 100644 |
2523 |
+--- a/net/ipv4/tcp.c |
2524 |
++++ b/net/ipv4/tcp.c |
2525 |
+@@ -431,7 +431,7 @@ EXPORT_SYMBOL(tcp_init_sock); |
2526 |
+ |
2527 |
+ static void tcp_tx_timestamp(struct sock *sk, u16 tsflags, struct sk_buff *skb) |
2528 |
+ { |
2529 |
+- if (tsflags) { |
2530 |
++ if (tsflags && skb) { |
2531 |
+ struct skb_shared_info *shinfo = skb_shinfo(skb); |
2532 |
+ struct tcp_skb_cb *tcb = TCP_SKB_CB(skb); |
2533 |
+ |
2534 |
+@@ -966,10 +966,8 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, |
2535 |
+ copied += copy; |
2536 |
+ offset += copy; |
2537 |
+ size -= copy; |
2538 |
+- if (!size) { |
2539 |
+- tcp_tx_timestamp(sk, sk->sk_tsflags, skb); |
2540 |
++ if (!size) |
2541 |
+ goto out; |
2542 |
+- } |
2543 |
+ |
2544 |
+ if (skb->len < size_goal || (flags & MSG_OOB)) |
2545 |
+ continue; |
2546 |
+@@ -995,8 +993,11 @@ static ssize_t do_tcp_sendpages(struct sock *sk, struct page *page, int offset, |
2547 |
+ } |
2548 |
+ |
2549 |
+ out: |
2550 |
+- if (copied && !(flags & MSG_SENDPAGE_NOTLAST)) |
2551 |
+- tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); |
2552 |
++ if (copied) { |
2553 |
++ tcp_tx_timestamp(sk, sk->sk_tsflags, tcp_write_queue_tail(sk)); |
2554 |
++ if (!(flags & MSG_SENDPAGE_NOTLAST)) |
2555 |
++ tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); |
2556 |
++ } |
2557 |
+ return copied; |
2558 |
+ |
2559 |
+ do_error: |
2560 |
+@@ -1289,7 +1290,6 @@ int tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) |
2561 |
+ |
2562 |
+ copied += copy; |
2563 |
+ if (!msg_data_left(msg)) { |
2564 |
+- tcp_tx_timestamp(sk, sockc.tsflags, skb); |
2565 |
+ if (unlikely(flags & MSG_EOR)) |
2566 |
+ TCP_SKB_CB(skb)->eor = 1; |
2567 |
+ goto out; |
2568 |
+@@ -1320,8 +1320,10 @@ int tcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) |
2569 |
+ } |
2570 |
+ |
2571 |
+ out: |
2572 |
+- if (copied) |
2573 |
++ if (copied) { |
2574 |
++ tcp_tx_timestamp(sk, sockc.tsflags, tcp_write_queue_tail(sk)); |
2575 |
+ tcp_push(sk, flags, mss_now, tp->nonagle, size_goal); |
2576 |
++ } |
2577 |
+ out_nopush: |
2578 |
+ release_sock(sk); |
2579 |
+ return copied + copied_syn; |
2580 |
+diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c |
2581 |
+index 11467272089e..ea7b377f0378 100644 |
2582 |
+--- a/sound/drivers/vx/vx_pcm.c |
2583 |
++++ b/sound/drivers/vx/vx_pcm.c |
2584 |
+@@ -1015,7 +1015,7 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream |
2585 |
+ int size, space, count; |
2586 |
+ struct snd_pcm_runtime *runtime = subs->runtime; |
2587 |
+ |
2588 |
+- if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE)) |
2589 |
++ if (!pipe->running || (chip->chip_status & VX_STAT_IS_STALE)) |
2590 |
+ return; |
2591 |
+ |
2592 |
+ size = runtime->buffer_size - snd_pcm_capture_avail(runtime); |
2593 |
+@@ -1048,8 +1048,10 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream |
2594 |
+ /* ok, let's accelerate! */ |
2595 |
+ int align = pipe->align * 3; |
2596 |
+ space = (count / align) * align; |
2597 |
+- vx_pseudo_dma_read(chip, runtime, pipe, space); |
2598 |
+- count -= space; |
2599 |
++ if (space > 0) { |
2600 |
++ vx_pseudo_dma_read(chip, runtime, pipe, space); |
2601 |
++ count -= space; |
2602 |
++ } |
2603 |
+ } |
2604 |
+ /* read the rest of bytes */ |
2605 |
+ while (count > 0) { |
2606 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
2607 |
+index fe1d06d50392..80c40a1b8b65 100644 |
2608 |
+--- a/sound/pci/hda/patch_realtek.c |
2609 |
++++ b/sound/pci/hda/patch_realtek.c |
2610 |
+@@ -338,6 +338,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec) |
2611 |
+ case 0x10ec0288: |
2612 |
+ case 0x10ec0295: |
2613 |
+ case 0x10ec0298: |
2614 |
++ case 0x10ec0299: |
2615 |
+ alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
2616 |
+ break; |
2617 |
+ case 0x10ec0285: |
2618 |
+@@ -914,6 +915,7 @@ static struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
2619 |
+ { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
2620 |
+ { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
2621 |
+ { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
2622 |
++ { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
2623 |
+ { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
2624 |
+ { 0x10ec0676, 0x1025, 0, "ALC679X" }, |
2625 |
+ { 0x10ec0282, 0x1043, 0, "ALC3229" }, |
2626 |
+@@ -3721,6 +3723,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) |
2627 |
+ break; |
2628 |
+ case 0x10ec0225: |
2629 |
+ case 0x10ec0295: |
2630 |
++ case 0x10ec0299: |
2631 |
+ alc_process_coef_fw(codec, coef0225); |
2632 |
+ break; |
2633 |
+ case 0x10ec0867: |
2634 |
+@@ -3829,6 +3832,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, |
2635 |
+ break; |
2636 |
+ case 0x10ec0225: |
2637 |
+ case 0x10ec0295: |
2638 |
++ case 0x10ec0299: |
2639 |
+ alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
2640 |
+ snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
2641 |
+ alc_process_coef_fw(codec, coef0225); |
2642 |
+@@ -3887,6 +3891,7 @@ static void alc_headset_mode_default(struct hda_codec *codec) |
2643 |
+ switch (codec->core.vendor_id) { |
2644 |
+ case 0x10ec0225: |
2645 |
+ case 0x10ec0295: |
2646 |
++ case 0x10ec0299: |
2647 |
+ alc_process_coef_fw(codec, coef0225); |
2648 |
+ break; |
2649 |
+ case 0x10ec0236: |
2650 |
+@@ -4004,6 +4009,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) |
2651 |
+ break; |
2652 |
+ case 0x10ec0225: |
2653 |
+ case 0x10ec0295: |
2654 |
++ case 0x10ec0299: |
2655 |
+ alc_process_coef_fw(codec, coef0225); |
2656 |
+ break; |
2657 |
+ case 0x10ec0867: |
2658 |
+@@ -4098,6 +4104,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) |
2659 |
+ break; |
2660 |
+ case 0x10ec0225: |
2661 |
+ case 0x10ec0295: |
2662 |
++ case 0x10ec0299: |
2663 |
+ alc_process_coef_fw(codec, coef0225); |
2664 |
+ break; |
2665 |
+ } |
2666 |
+@@ -4183,6 +4190,7 @@ static void alc_determine_headset_type(struct hda_codec *codec) |
2667 |
+ break; |
2668 |
+ case 0x10ec0225: |
2669 |
+ case 0x10ec0295: |
2670 |
++ case 0x10ec0299: |
2671 |
+ alc_process_coef_fw(codec, coef0225); |
2672 |
+ msleep(800); |
2673 |
+ val = alc_read_coef_idx(codec, 0x46); |
2674 |
+@@ -6251,6 +6259,7 @@ static int patch_alc269(struct hda_codec *codec) |
2675 |
+ break; |
2676 |
+ case 0x10ec0225: |
2677 |
+ case 0x10ec0295: |
2678 |
++ case 0x10ec0299: |
2679 |
+ spec->codec_variant = ALC269_TYPE_ALC225; |
2680 |
+ break; |
2681 |
+ case 0x10ec0234: |
2682 |
+@@ -7249,6 +7258,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = { |
2683 |
+ HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
2684 |
+ HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
2685 |
+ HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
2686 |
++ HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
2687 |
+ HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
2688 |
+ HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), |
2689 |
+ HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), |
2690 |
+diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c |
2691 |
+index af83b3b38052..8e457ea27f89 100644 |
2692 |
+--- a/sound/pci/vx222/vx222_ops.c |
2693 |
++++ b/sound/pci/vx222/vx222_ops.c |
2694 |
+@@ -269,12 +269,12 @@ static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2695 |
+ |
2696 |
+ /* Transfer using pseudo-dma. |
2697 |
+ */ |
2698 |
+- if (offset + count > pipe->buffer_bytes) { |
2699 |
++ if (offset + count >= pipe->buffer_bytes) { |
2700 |
+ int length = pipe->buffer_bytes - offset; |
2701 |
+ count -= length; |
2702 |
+ length >>= 2; /* in 32bit words */ |
2703 |
+ /* Transfer using pseudo-dma. */ |
2704 |
+- while (length-- > 0) { |
2705 |
++ for (; length > 0; length--) { |
2706 |
+ outl(cpu_to_le32(*addr), port); |
2707 |
+ addr++; |
2708 |
+ } |
2709 |
+@@ -284,7 +284,7 @@ static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2710 |
+ pipe->hw_ptr += count; |
2711 |
+ count >>= 2; /* in 32bit words */ |
2712 |
+ /* Transfer using pseudo-dma. */ |
2713 |
+- while (count-- > 0) { |
2714 |
++ for (; count > 0; count--) { |
2715 |
+ outl(cpu_to_le32(*addr), port); |
2716 |
+ addr++; |
2717 |
+ } |
2718 |
+@@ -307,12 +307,12 @@ static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2719 |
+ vx2_setup_pseudo_dma(chip, 0); |
2720 |
+ /* Transfer using pseudo-dma. |
2721 |
+ */ |
2722 |
+- if (offset + count > pipe->buffer_bytes) { |
2723 |
++ if (offset + count >= pipe->buffer_bytes) { |
2724 |
+ int length = pipe->buffer_bytes - offset; |
2725 |
+ count -= length; |
2726 |
+ length >>= 2; /* in 32bit words */ |
2727 |
+ /* Transfer using pseudo-dma. */ |
2728 |
+- while (length-- > 0) |
2729 |
++ for (; length > 0; length--) |
2730 |
+ *addr++ = le32_to_cpu(inl(port)); |
2731 |
+ addr = (u32 *)runtime->dma_area; |
2732 |
+ pipe->hw_ptr = 0; |
2733 |
+@@ -320,7 +320,7 @@ static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2734 |
+ pipe->hw_ptr += count; |
2735 |
+ count >>= 2; /* in 32bit words */ |
2736 |
+ /* Transfer using pseudo-dma. */ |
2737 |
+- while (count-- > 0) |
2738 |
++ for (; count > 0; count--) |
2739 |
+ *addr++ = le32_to_cpu(inl(port)); |
2740 |
+ |
2741 |
+ vx2_release_pseudo_dma(chip); |
2742 |
+diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c |
2743 |
+index 281972913c32..56aa1ba73ccc 100644 |
2744 |
+--- a/sound/pcmcia/vx/vxp_ops.c |
2745 |
++++ b/sound/pcmcia/vx/vxp_ops.c |
2746 |
+@@ -369,12 +369,12 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2747 |
+ unsigned short *addr = (unsigned short *)(runtime->dma_area + offset); |
2748 |
+ |
2749 |
+ vx_setup_pseudo_dma(chip, 1); |
2750 |
+- if (offset + count > pipe->buffer_bytes) { |
2751 |
++ if (offset + count >= pipe->buffer_bytes) { |
2752 |
+ int length = pipe->buffer_bytes - offset; |
2753 |
+ count -= length; |
2754 |
+ length >>= 1; /* in 16bit words */ |
2755 |
+ /* Transfer using pseudo-dma. */ |
2756 |
+- while (length-- > 0) { |
2757 |
++ for (; length > 0; length--) { |
2758 |
+ outw(cpu_to_le16(*addr), port); |
2759 |
+ addr++; |
2760 |
+ } |
2761 |
+@@ -384,7 +384,7 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2762 |
+ pipe->hw_ptr += count; |
2763 |
+ count >>= 1; /* in 16bit words */ |
2764 |
+ /* Transfer using pseudo-dma. */ |
2765 |
+- while (count-- > 0) { |
2766 |
++ for (; count > 0; count--) { |
2767 |
+ outw(cpu_to_le16(*addr), port); |
2768 |
+ addr++; |
2769 |
+ } |
2770 |
+@@ -411,12 +411,12 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2771 |
+ if (snd_BUG_ON(count % 2)) |
2772 |
+ return; |
2773 |
+ vx_setup_pseudo_dma(chip, 0); |
2774 |
+- if (offset + count > pipe->buffer_bytes) { |
2775 |
++ if (offset + count >= pipe->buffer_bytes) { |
2776 |
+ int length = pipe->buffer_bytes - offset; |
2777 |
+ count -= length; |
2778 |
+ length >>= 1; /* in 16bit words */ |
2779 |
+ /* Transfer using pseudo-dma. */ |
2780 |
+- while (length-- > 0) |
2781 |
++ for (; length > 0; length--) |
2782 |
+ *addr++ = le16_to_cpu(inw(port)); |
2783 |
+ addr = (unsigned short *)runtime->dma_area; |
2784 |
+ pipe->hw_ptr = 0; |
2785 |
+@@ -424,7 +424,7 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2786 |
+ pipe->hw_ptr += count; |
2787 |
+ count >>= 1; /* in 16bit words */ |
2788 |
+ /* Transfer using pseudo-dma. */ |
2789 |
+- while (count-- > 1) |
2790 |
++ for (; count > 1; count--) |
2791 |
+ *addr++ = le16_to_cpu(inw(port)); |
2792 |
+ /* Disable DMA */ |
2793 |
+ pchip->regDIALOG &= ~VXP_DLG_DMAREAD_SEL_MASK; |