1 |
commit: de3f04ded621d007c726847d900eae91be5bc35c |
2 |
Author: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
3 |
AuthorDate: Tue Nov 21 08:34:09 2017 +0000 |
4 |
Commit: Alice Ferrazzi <alicef <AT> gentoo <DOT> org> |
5 |
CommitDate: Tue Nov 21 08:34:09 2017 +0000 |
6 |
URL: https://gitweb.gentoo.org/proj/linux-patches.git/commit/?id=de3f04de |
7 |
|
8 |
linux kernel 4.4.100 |
9 |
|
10 |
0000_README | 4 + |
11 |
1099_linux-4.4.100.patch | 2132 ++++++++++++++++++++++++++++++++++++++++++++++ |
12 |
2 files changed, 2136 insertions(+) |
13 |
|
14 |
diff --git a/0000_README b/0000_README |
15 |
index e8c2522..fb4d48b 100644 |
16 |
--- a/0000_README |
17 |
+++ b/0000_README |
18 |
@@ -439,6 +439,10 @@ Patch: 1098_linux-4.4.99.patch |
19 |
From: http://www.kernel.org |
20 |
Desc: Linux 4.4.99 |
21 |
|
22 |
+Patch: 1099_linux-4.4.100.patch |
23 |
+From: http://www.kernel.org |
24 |
+Desc: Linux 4.4.100 |
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/1099_linux-4.4.100.patch b/1099_linux-4.4.100.patch |
31 |
new file mode 100644 |
32 |
index 0000000..e0c456c |
33 |
--- /dev/null |
34 |
+++ b/1099_linux-4.4.100.patch |
35 |
@@ -0,0 +1,2132 @@ |
36 |
+diff --git a/Makefile b/Makefile |
37 |
+index 0b5d9e20eee2..91dd7832f499 100644 |
38 |
+--- a/Makefile |
39 |
++++ b/Makefile |
40 |
+@@ -1,6 +1,6 @@ |
41 |
+ VERSION = 4 |
42 |
+ PATCHLEVEL = 4 |
43 |
+-SUBLEVEL = 99 |
44 |
++SUBLEVEL = 100 |
45 |
+ EXTRAVERSION = |
46 |
+ NAME = Blurry Fish Butt |
47 |
+ |
48 |
+diff --git a/arch/arm/boot/dts/am33xx.dtsi b/arch/arm/boot/dts/am33xx.dtsi |
49 |
+index d23e2524d694..be9c37e89be1 100644 |
50 |
+--- a/arch/arm/boot/dts/am33xx.dtsi |
51 |
++++ b/arch/arm/boot/dts/am33xx.dtsi |
52 |
+@@ -142,10 +142,11 @@ |
53 |
+ }; |
54 |
+ |
55 |
+ scm_conf: scm_conf@0 { |
56 |
+- compatible = "syscon"; |
57 |
++ compatible = "syscon", "simple-bus"; |
58 |
+ reg = <0x0 0x800>; |
59 |
+ #address-cells = <1>; |
60 |
+ #size-cells = <1>; |
61 |
++ ranges = <0 0 0x800>; |
62 |
+ |
63 |
+ scm_clocks: clocks { |
64 |
+ #address-cells = <1>; |
65 |
+diff --git a/arch/arm/boot/dts/dm814x.dtsi b/arch/arm/boot/dts/dm814x.dtsi |
66 |
+index 7988b42e5764..c226c3d952d8 100644 |
67 |
+--- a/arch/arm/boot/dts/dm814x.dtsi |
68 |
++++ b/arch/arm/boot/dts/dm814x.dtsi |
69 |
+@@ -138,7 +138,7 @@ |
70 |
+ }; |
71 |
+ |
72 |
+ uart1: uart@20000 { |
73 |
+- compatible = "ti,omap3-uart"; |
74 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
75 |
+ ti,hwmods = "uart1"; |
76 |
+ reg = <0x20000 0x2000>; |
77 |
+ clock-frequency = <48000000>; |
78 |
+@@ -148,7 +148,7 @@ |
79 |
+ }; |
80 |
+ |
81 |
+ uart2: uart@22000 { |
82 |
+- compatible = "ti,omap3-uart"; |
83 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
84 |
+ ti,hwmods = "uart2"; |
85 |
+ reg = <0x22000 0x2000>; |
86 |
+ clock-frequency = <48000000>; |
87 |
+@@ -158,7 +158,7 @@ |
88 |
+ }; |
89 |
+ |
90 |
+ uart3: uart@24000 { |
91 |
+- compatible = "ti,omap3-uart"; |
92 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
93 |
+ ti,hwmods = "uart3"; |
94 |
+ reg = <0x24000 0x2000>; |
95 |
+ clock-frequency = <48000000>; |
96 |
+@@ -189,10 +189,11 @@ |
97 |
+ ranges = <0 0x160000 0x16d000>; |
98 |
+ |
99 |
+ scm_conf: scm_conf@0 { |
100 |
+- compatible = "syscon"; |
101 |
++ compatible = "syscon", "simple-bus"; |
102 |
+ reg = <0x0 0x800>; |
103 |
+ #address-cells = <1>; |
104 |
+ #size-cells = <1>; |
105 |
++ ranges = <0 0 0x800>; |
106 |
+ |
107 |
+ scm_clocks: clocks { |
108 |
+ #address-cells = <1>; |
109 |
+diff --git a/arch/arm/boot/dts/dm816x.dtsi b/arch/arm/boot/dts/dm816x.dtsi |
110 |
+index eee636de4cd8..e526928e6e96 100644 |
111 |
+--- a/arch/arm/boot/dts/dm816x.dtsi |
112 |
++++ b/arch/arm/boot/dts/dm816x.dtsi |
113 |
+@@ -347,7 +347,7 @@ |
114 |
+ }; |
115 |
+ |
116 |
+ uart1: uart@48020000 { |
117 |
+- compatible = "ti,omap3-uart"; |
118 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
119 |
+ ti,hwmods = "uart1"; |
120 |
+ reg = <0x48020000 0x2000>; |
121 |
+ clock-frequency = <48000000>; |
122 |
+@@ -357,7 +357,7 @@ |
123 |
+ }; |
124 |
+ |
125 |
+ uart2: uart@48022000 { |
126 |
+- compatible = "ti,omap3-uart"; |
127 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
128 |
+ ti,hwmods = "uart2"; |
129 |
+ reg = <0x48022000 0x2000>; |
130 |
+ clock-frequency = <48000000>; |
131 |
+@@ -367,7 +367,7 @@ |
132 |
+ }; |
133 |
+ |
134 |
+ uart3: uart@48024000 { |
135 |
+- compatible = "ti,omap3-uart"; |
136 |
++ compatible = "ti,am3352-uart", "ti,omap3-uart"; |
137 |
+ ti,hwmods = "uart3"; |
138 |
+ reg = <0x48024000 0x2000>; |
139 |
+ clock-frequency = <48000000>; |
140 |
+diff --git a/arch/arm/crypto/aesbs-glue.c b/arch/arm/crypto/aesbs-glue.c |
141 |
+index 6d685298690e..648d5fac9cbf 100644 |
142 |
+--- a/arch/arm/crypto/aesbs-glue.c |
143 |
++++ b/arch/arm/crypto/aesbs-glue.c |
144 |
+@@ -357,7 +357,7 @@ static struct crypto_alg aesbs_algs[] = { { |
145 |
+ }, { |
146 |
+ .cra_name = "cbc(aes)", |
147 |
+ .cra_driver_name = "cbc-aes-neonbs", |
148 |
+- .cra_priority = 300, |
149 |
++ .cra_priority = 250, |
150 |
+ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC, |
151 |
+ .cra_blocksize = AES_BLOCK_SIZE, |
152 |
+ .cra_ctxsize = sizeof(struct async_helper_ctx), |
153 |
+@@ -377,7 +377,7 @@ static struct crypto_alg aesbs_algs[] = { { |
154 |
+ }, { |
155 |
+ .cra_name = "ctr(aes)", |
156 |
+ .cra_driver_name = "ctr-aes-neonbs", |
157 |
+- .cra_priority = 300, |
158 |
++ .cra_priority = 250, |
159 |
+ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC, |
160 |
+ .cra_blocksize = 1, |
161 |
+ .cra_ctxsize = sizeof(struct async_helper_ctx), |
162 |
+@@ -397,7 +397,7 @@ static struct crypto_alg aesbs_algs[] = { { |
163 |
+ }, { |
164 |
+ .cra_name = "xts(aes)", |
165 |
+ .cra_driver_name = "xts-aes-neonbs", |
166 |
+- .cra_priority = 300, |
167 |
++ .cra_priority = 250, |
168 |
+ .cra_flags = CRYPTO_ALG_TYPE_ABLKCIPHER|CRYPTO_ALG_ASYNC, |
169 |
+ .cra_blocksize = AES_BLOCK_SIZE, |
170 |
+ .cra_ctxsize = sizeof(struct async_helper_ctx), |
171 |
+diff --git a/arch/arm/mach-omap2/pdata-quirks.c b/arch/arm/mach-omap2/pdata-quirks.c |
172 |
+index 58144779dec4..1e6e09841707 100644 |
173 |
+--- a/arch/arm/mach-omap2/pdata-quirks.c |
174 |
++++ b/arch/arm/mach-omap2/pdata-quirks.c |
175 |
+@@ -522,7 +522,6 @@ static void pdata_quirks_check(struct pdata_init *quirks) |
176 |
+ if (of_machine_is_compatible(quirks->compatible)) { |
177 |
+ if (quirks->fn) |
178 |
+ quirks->fn(); |
179 |
+- break; |
180 |
+ } |
181 |
+ quirks++; |
182 |
+ } |
183 |
+diff --git a/arch/arm64/boot/dts/broadcom/ns2.dtsi b/arch/arm64/boot/dts/broadcom/ns2.dtsi |
184 |
+index 3c92d92278e5..a14a6bb31887 100644 |
185 |
+--- a/arch/arm64/boot/dts/broadcom/ns2.dtsi |
186 |
++++ b/arch/arm64/boot/dts/broadcom/ns2.dtsi |
187 |
+@@ -30,6 +30,8 @@ |
188 |
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
189 |
+ */ |
190 |
+ |
191 |
++/memreserve/ 0x81000000 0x00200000; |
192 |
++ |
193 |
+ #include <dt-bindings/interrupt-controller/arm-gic.h> |
194 |
+ |
195 |
+ /memreserve/ 0x84b00000 0x00000008; |
196 |
+diff --git a/arch/mips/include/asm/asm.h b/arch/mips/include/asm/asm.h |
197 |
+index 7c26b28bf252..859cf7048347 100644 |
198 |
+--- a/arch/mips/include/asm/asm.h |
199 |
++++ b/arch/mips/include/asm/asm.h |
200 |
+@@ -54,7 +54,8 @@ |
201 |
+ .align 2; \ |
202 |
+ .type symbol, @function; \ |
203 |
+ .ent symbol, 0; \ |
204 |
+-symbol: .frame sp, 0, ra |
205 |
++symbol: .frame sp, 0, ra; \ |
206 |
++ .insn |
207 |
+ |
208 |
+ /* |
209 |
+ * NESTED - declare nested routine entry point |
210 |
+@@ -63,8 +64,9 @@ symbol: .frame sp, 0, ra |
211 |
+ .globl symbol; \ |
212 |
+ .align 2; \ |
213 |
+ .type symbol, @function; \ |
214 |
+- .ent symbol, 0; \ |
215 |
+-symbol: .frame sp, framesize, rpc |
216 |
++ .ent symbol, 0; \ |
217 |
++symbol: .frame sp, framesize, rpc; \ |
218 |
++ .insn |
219 |
+ |
220 |
+ /* |
221 |
+ * END - mark end of function |
222 |
+@@ -86,7 +88,7 @@ symbol: |
223 |
+ #define FEXPORT(symbol) \ |
224 |
+ .globl symbol; \ |
225 |
+ .type symbol, @function; \ |
226 |
+-symbol: |
227 |
++symbol: .insn |
228 |
+ |
229 |
+ /* |
230 |
+ * ABS - export absolute symbol |
231 |
+diff --git a/arch/mips/kernel/setup.c b/arch/mips/kernel/setup.c |
232 |
+index 8acae316f26b..4f9f1ae49213 100644 |
233 |
+--- a/arch/mips/kernel/setup.c |
234 |
++++ b/arch/mips/kernel/setup.c |
235 |
+@@ -152,6 +152,35 @@ void __init detect_memory_region(phys_addr_t start, phys_addr_t sz_min, phys_add |
236 |
+ add_memory_region(start, size, BOOT_MEM_RAM); |
237 |
+ } |
238 |
+ |
239 |
++bool __init memory_region_available(phys_addr_t start, phys_addr_t size) |
240 |
++{ |
241 |
++ int i; |
242 |
++ bool in_ram = false, free = true; |
243 |
++ |
244 |
++ for (i = 0; i < boot_mem_map.nr_map; i++) { |
245 |
++ phys_addr_t start_, end_; |
246 |
++ |
247 |
++ start_ = boot_mem_map.map[i].addr; |
248 |
++ end_ = boot_mem_map.map[i].addr + boot_mem_map.map[i].size; |
249 |
++ |
250 |
++ switch (boot_mem_map.map[i].type) { |
251 |
++ case BOOT_MEM_RAM: |
252 |
++ if (start >= start_ && start + size <= end_) |
253 |
++ in_ram = true; |
254 |
++ break; |
255 |
++ case BOOT_MEM_RESERVED: |
256 |
++ if ((start >= start_ && start < end_) || |
257 |
++ (start < start_ && start + size >= start_)) |
258 |
++ free = false; |
259 |
++ break; |
260 |
++ default: |
261 |
++ continue; |
262 |
++ } |
263 |
++ } |
264 |
++ |
265 |
++ return in_ram && free; |
266 |
++} |
267 |
++ |
268 |
+ static void __init print_memory_map(void) |
269 |
+ { |
270 |
+ int i; |
271 |
+@@ -300,11 +329,19 @@ static void __init bootmem_init(void) |
272 |
+ |
273 |
+ #else /* !CONFIG_SGI_IP27 */ |
274 |
+ |
275 |
++static unsigned long __init bootmap_bytes(unsigned long pages) |
276 |
++{ |
277 |
++ unsigned long bytes = DIV_ROUND_UP(pages, 8); |
278 |
++ |
279 |
++ return ALIGN(bytes, sizeof(long)); |
280 |
++} |
281 |
++ |
282 |
+ static void __init bootmem_init(void) |
283 |
+ { |
284 |
+ unsigned long reserved_end; |
285 |
+ unsigned long mapstart = ~0UL; |
286 |
+ unsigned long bootmap_size; |
287 |
++ bool bootmap_valid = false; |
288 |
+ int i; |
289 |
+ |
290 |
+ /* |
291 |
+@@ -385,11 +422,42 @@ static void __init bootmem_init(void) |
292 |
+ #endif |
293 |
+ |
294 |
+ /* |
295 |
+- * Initialize the boot-time allocator with low memory only. |
296 |
++ * check that mapstart doesn't overlap with any of |
297 |
++ * memory regions that have been reserved through eg. DTB |
298 |
+ */ |
299 |
+- bootmap_size = init_bootmem_node(NODE_DATA(0), mapstart, |
300 |
+- min_low_pfn, max_low_pfn); |
301 |
++ bootmap_size = bootmap_bytes(max_low_pfn - min_low_pfn); |
302 |
++ |
303 |
++ bootmap_valid = memory_region_available(PFN_PHYS(mapstart), |
304 |
++ bootmap_size); |
305 |
++ for (i = 0; i < boot_mem_map.nr_map && !bootmap_valid; i++) { |
306 |
++ unsigned long mapstart_addr; |
307 |
++ |
308 |
++ switch (boot_mem_map.map[i].type) { |
309 |
++ case BOOT_MEM_RESERVED: |
310 |
++ mapstart_addr = PFN_ALIGN(boot_mem_map.map[i].addr + |
311 |
++ boot_mem_map.map[i].size); |
312 |
++ if (PHYS_PFN(mapstart_addr) < mapstart) |
313 |
++ break; |
314 |
++ |
315 |
++ bootmap_valid = memory_region_available(mapstart_addr, |
316 |
++ bootmap_size); |
317 |
++ if (bootmap_valid) |
318 |
++ mapstart = PHYS_PFN(mapstart_addr); |
319 |
++ break; |
320 |
++ default: |
321 |
++ break; |
322 |
++ } |
323 |
++ } |
324 |
+ |
325 |
++ if (!bootmap_valid) |
326 |
++ panic("No memory area to place a bootmap bitmap"); |
327 |
++ |
328 |
++ /* |
329 |
++ * Initialize the boot-time allocator with low memory only. |
330 |
++ */ |
331 |
++ if (bootmap_size != init_bootmem_node(NODE_DATA(0), mapstart, |
332 |
++ min_low_pfn, max_low_pfn)) |
333 |
++ panic("Unexpected memory size required for bootmap"); |
334 |
+ |
335 |
+ for (i = 0; i < boot_mem_map.nr_map; i++) { |
336 |
+ unsigned long start, end; |
337 |
+@@ -438,6 +506,10 @@ static void __init bootmem_init(void) |
338 |
+ continue; |
339 |
+ default: |
340 |
+ /* Not usable memory */ |
341 |
++ if (start > min_low_pfn && end < max_low_pfn) |
342 |
++ reserve_bootmem(boot_mem_map.map[i].addr, |
343 |
++ boot_mem_map.map[i].size, |
344 |
++ BOOTMEM_DEFAULT); |
345 |
+ continue; |
346 |
+ } |
347 |
+ |
348 |
+diff --git a/arch/mips/netlogic/common/irq.c b/arch/mips/netlogic/common/irq.c |
349 |
+index 3660dc67d544..f4961bc9a61d 100644 |
350 |
+--- a/arch/mips/netlogic/common/irq.c |
351 |
++++ b/arch/mips/netlogic/common/irq.c |
352 |
+@@ -275,7 +275,7 @@ asmlinkage void plat_irq_dispatch(void) |
353 |
+ do_IRQ(nlm_irq_to_xirq(node, i)); |
354 |
+ } |
355 |
+ |
356 |
+-#ifdef CONFIG_OF |
357 |
++#ifdef CONFIG_CPU_XLP |
358 |
+ static const struct irq_domain_ops xlp_pic_irq_domain_ops = { |
359 |
+ .xlate = irq_domain_xlate_onetwocell, |
360 |
+ }; |
361 |
+@@ -348,7 +348,7 @@ void __init arch_init_irq(void) |
362 |
+ #if defined(CONFIG_CPU_XLR) |
363 |
+ nlm_setup_fmn_irq(); |
364 |
+ #endif |
365 |
+-#if defined(CONFIG_OF) |
366 |
++#ifdef CONFIG_CPU_XLP |
367 |
+ of_irq_init(xlp_pic_irq_ids); |
368 |
+ #endif |
369 |
+ } |
370 |
+diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h |
371 |
+index 19d14ac23ef9..fc3c7e49c8e4 100644 |
372 |
+--- a/arch/x86/include/asm/kvm_emulate.h |
373 |
++++ b/arch/x86/include/asm/kvm_emulate.h |
374 |
+@@ -296,6 +296,7 @@ struct x86_emulate_ctxt { |
375 |
+ |
376 |
+ bool perm_ok; /* do not check permissions if true */ |
377 |
+ bool ud; /* inject an #UD if host doesn't support insn */ |
378 |
++ bool tf; /* TF value before instruction (after for syscall/sysret) */ |
379 |
+ |
380 |
+ bool have_exception; |
381 |
+ struct x86_exception exception; |
382 |
+diff --git a/arch/x86/kvm/emulate.c b/arch/x86/kvm/emulate.c |
383 |
+index 04b2f3cad7ba..684edebb4a0c 100644 |
384 |
+--- a/arch/x86/kvm/emulate.c |
385 |
++++ b/arch/x86/kvm/emulate.c |
386 |
+@@ -2726,6 +2726,7 @@ static int em_syscall(struct x86_emulate_ctxt *ctxt) |
387 |
+ ctxt->eflags &= ~(X86_EFLAGS_VM | X86_EFLAGS_IF); |
388 |
+ } |
389 |
+ |
390 |
++ ctxt->tf = (ctxt->eflags & X86_EFLAGS_TF) != 0; |
391 |
+ return X86EMUL_CONTINUE; |
392 |
+ } |
393 |
+ |
394 |
+diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c |
395 |
+index 8e526c6fd784..3ffd5900da5b 100644 |
396 |
+--- a/arch/x86/kvm/x86.c |
397 |
++++ b/arch/x86/kvm/x86.c |
398 |
+@@ -5095,6 +5095,8 @@ static void init_emulate_ctxt(struct kvm_vcpu *vcpu) |
399 |
+ kvm_x86_ops->get_cs_db_l_bits(vcpu, &cs_db, &cs_l); |
400 |
+ |
401 |
+ ctxt->eflags = kvm_get_rflags(vcpu); |
402 |
++ ctxt->tf = (ctxt->eflags & X86_EFLAGS_TF) != 0; |
403 |
++ |
404 |
+ ctxt->eip = kvm_rip_read(vcpu); |
405 |
+ ctxt->mode = (!is_protmode(vcpu)) ? X86EMUL_MODE_REAL : |
406 |
+ (ctxt->eflags & X86_EFLAGS_VM) ? X86EMUL_MODE_VM86 : |
407 |
+@@ -5315,37 +5317,26 @@ static int kvm_vcpu_check_hw_bp(unsigned long addr, u32 type, u32 dr7, |
408 |
+ return dr6; |
409 |
+ } |
410 |
+ |
411 |
+-static void kvm_vcpu_check_singlestep(struct kvm_vcpu *vcpu, unsigned long rflags, int *r) |
412 |
++static void kvm_vcpu_do_singlestep(struct kvm_vcpu *vcpu, int *r) |
413 |
+ { |
414 |
+ struct kvm_run *kvm_run = vcpu->run; |
415 |
+ |
416 |
+- /* |
417 |
+- * rflags is the old, "raw" value of the flags. The new value has |
418 |
+- * not been saved yet. |
419 |
+- * |
420 |
+- * This is correct even for TF set by the guest, because "the |
421 |
+- * processor will not generate this exception after the instruction |
422 |
+- * that sets the TF flag". |
423 |
+- */ |
424 |
+- if (unlikely(rflags & X86_EFLAGS_TF)) { |
425 |
+- if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) { |
426 |
+- kvm_run->debug.arch.dr6 = DR6_BS | DR6_FIXED_1 | |
427 |
+- DR6_RTM; |
428 |
+- kvm_run->debug.arch.pc = vcpu->arch.singlestep_rip; |
429 |
+- kvm_run->debug.arch.exception = DB_VECTOR; |
430 |
+- kvm_run->exit_reason = KVM_EXIT_DEBUG; |
431 |
+- *r = EMULATE_USER_EXIT; |
432 |
+- } else { |
433 |
+- vcpu->arch.emulate_ctxt.eflags &= ~X86_EFLAGS_TF; |
434 |
+- /* |
435 |
+- * "Certain debug exceptions may clear bit 0-3. The |
436 |
+- * remaining contents of the DR6 register are never |
437 |
+- * cleared by the processor". |
438 |
+- */ |
439 |
+- vcpu->arch.dr6 &= ~15; |
440 |
+- vcpu->arch.dr6 |= DR6_BS | DR6_RTM; |
441 |
+- kvm_queue_exception(vcpu, DB_VECTOR); |
442 |
+- } |
443 |
++ if (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP) { |
444 |
++ kvm_run->debug.arch.dr6 = DR6_BS | DR6_FIXED_1 | DR6_RTM; |
445 |
++ kvm_run->debug.arch.pc = vcpu->arch.singlestep_rip; |
446 |
++ kvm_run->debug.arch.exception = DB_VECTOR; |
447 |
++ kvm_run->exit_reason = KVM_EXIT_DEBUG; |
448 |
++ *r = EMULATE_USER_EXIT; |
449 |
++ } else { |
450 |
++ vcpu->arch.emulate_ctxt.eflags &= ~X86_EFLAGS_TF; |
451 |
++ /* |
452 |
++ * "Certain debug exceptions may clear bit 0-3. The |
453 |
++ * remaining contents of the DR6 register are never |
454 |
++ * cleared by the processor". |
455 |
++ */ |
456 |
++ vcpu->arch.dr6 &= ~15; |
457 |
++ vcpu->arch.dr6 |= DR6_BS | DR6_RTM; |
458 |
++ kvm_queue_exception(vcpu, DB_VECTOR); |
459 |
+ } |
460 |
+ } |
461 |
+ |
462 |
+@@ -5500,8 +5491,9 @@ restart: |
463 |
+ toggle_interruptibility(vcpu, ctxt->interruptibility); |
464 |
+ vcpu->arch.emulate_regs_need_sync_to_vcpu = false; |
465 |
+ kvm_rip_write(vcpu, ctxt->eip); |
466 |
+- if (r == EMULATE_DONE) |
467 |
+- kvm_vcpu_check_singlestep(vcpu, rflags, &r); |
468 |
++ if (r == EMULATE_DONE && |
469 |
++ (ctxt->tf || (vcpu->guest_debug & KVM_GUESTDBG_SINGLESTEP))) |
470 |
++ kvm_vcpu_do_singlestep(vcpu, &r); |
471 |
+ if (!ctxt->have_exception || |
472 |
+ exception_type(ctxt->exception.vector) == EXCPT_TRAP) |
473 |
+ __kvm_set_rflags(vcpu, ctxt->eflags); |
474 |
+diff --git a/crypto/Kconfig b/crypto/Kconfig |
475 |
+index 617bf4a7da56..7240821137fd 100644 |
476 |
+--- a/crypto/Kconfig |
477 |
++++ b/crypto/Kconfig |
478 |
+@@ -343,7 +343,6 @@ config CRYPTO_XTS |
479 |
+ select CRYPTO_BLKCIPHER |
480 |
+ select CRYPTO_MANAGER |
481 |
+ select CRYPTO_GF128MUL |
482 |
+- select CRYPTO_ECB |
483 |
+ help |
484 |
+ XTS: IEEE1619/D16 narrow block cipher use with aes-xts-plain, |
485 |
+ key size 256, 384 or 512 bits. This implementation currently |
486 |
+diff --git a/drivers/ata/Kconfig b/drivers/ata/Kconfig |
487 |
+index 6aaa3f81755b..c2ba811993d4 100644 |
488 |
+--- a/drivers/ata/Kconfig |
489 |
++++ b/drivers/ata/Kconfig |
490 |
+@@ -272,6 +272,7 @@ config SATA_SX4 |
491 |
+ |
492 |
+ config ATA_BMDMA |
493 |
+ bool "ATA BMDMA support" |
494 |
++ depends on HAS_DMA |
495 |
+ default y |
496 |
+ help |
497 |
+ This option adds support for SFF ATA controllers with BMDMA |
498 |
+@@ -318,6 +319,7 @@ config SATA_DWC_VDEBUG |
499 |
+ |
500 |
+ config SATA_HIGHBANK |
501 |
+ tristate "Calxeda Highbank SATA support" |
502 |
++ depends on HAS_DMA |
503 |
+ depends on ARCH_HIGHBANK || COMPILE_TEST |
504 |
+ help |
505 |
+ This option enables support for the Calxeda Highbank SoC's |
506 |
+@@ -327,6 +329,7 @@ config SATA_HIGHBANK |
507 |
+ |
508 |
+ config SATA_MV |
509 |
+ tristate "Marvell SATA support" |
510 |
++ depends on HAS_DMA |
511 |
+ depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \ |
512 |
+ ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST |
513 |
+ select GENERIC_PHY |
514 |
+diff --git a/drivers/block/xen-blkback/blkback.c b/drivers/block/xen-blkback/blkback.c |
515 |
+index 33e23a7a691f..a295ad6a1674 100644 |
516 |
+--- a/drivers/block/xen-blkback/blkback.c |
517 |
++++ b/drivers/block/xen-blkback/blkback.c |
518 |
+@@ -1407,33 +1407,34 @@ static int dispatch_rw_block_io(struct xen_blkif *blkif, |
519 |
+ static void make_response(struct xen_blkif *blkif, u64 id, |
520 |
+ unsigned short op, int st) |
521 |
+ { |
522 |
+- struct blkif_response resp; |
523 |
++ struct blkif_response *resp; |
524 |
+ unsigned long flags; |
525 |
+ union blkif_back_rings *blk_rings = &blkif->blk_rings; |
526 |
+ int notify; |
527 |
+ |
528 |
+- resp.id = id; |
529 |
+- resp.operation = op; |
530 |
+- resp.status = st; |
531 |
+- |
532 |
+ spin_lock_irqsave(&blkif->blk_ring_lock, flags); |
533 |
+ /* Place on the response ring for the relevant domain. */ |
534 |
+ switch (blkif->blk_protocol) { |
535 |
+ case BLKIF_PROTOCOL_NATIVE: |
536 |
+- memcpy(RING_GET_RESPONSE(&blk_rings->native, blk_rings->native.rsp_prod_pvt), |
537 |
+- &resp, sizeof(resp)); |
538 |
++ resp = RING_GET_RESPONSE(&blk_rings->native, |
539 |
++ blk_rings->native.rsp_prod_pvt); |
540 |
+ break; |
541 |
+ case BLKIF_PROTOCOL_X86_32: |
542 |
+- memcpy(RING_GET_RESPONSE(&blk_rings->x86_32, blk_rings->x86_32.rsp_prod_pvt), |
543 |
+- &resp, sizeof(resp)); |
544 |
++ resp = RING_GET_RESPONSE(&blk_rings->x86_32, |
545 |
++ blk_rings->x86_32.rsp_prod_pvt); |
546 |
+ break; |
547 |
+ case BLKIF_PROTOCOL_X86_64: |
548 |
+- memcpy(RING_GET_RESPONSE(&blk_rings->x86_64, blk_rings->x86_64.rsp_prod_pvt), |
549 |
+- &resp, sizeof(resp)); |
550 |
++ resp = RING_GET_RESPONSE(&blk_rings->x86_64, |
551 |
++ blk_rings->x86_64.rsp_prod_pvt); |
552 |
+ break; |
553 |
+ default: |
554 |
+ BUG(); |
555 |
+ } |
556 |
++ |
557 |
++ resp->id = id; |
558 |
++ resp->operation = op; |
559 |
++ resp->status = st; |
560 |
++ |
561 |
+ blk_rings->common.rsp_prod_pvt++; |
562 |
+ RING_PUSH_RESPONSES_AND_CHECK_NOTIFY(&blk_rings->common, notify); |
563 |
+ spin_unlock_irqrestore(&blkif->blk_ring_lock, flags); |
564 |
+diff --git a/drivers/block/xen-blkback/common.h b/drivers/block/xen-blkback/common.h |
565 |
+index c929ae22764c..04cfee719334 100644 |
566 |
+--- a/drivers/block/xen-blkback/common.h |
567 |
++++ b/drivers/block/xen-blkback/common.h |
568 |
+@@ -74,9 +74,8 @@ extern unsigned int xen_blkif_max_ring_order; |
569 |
+ struct blkif_common_request { |
570 |
+ char dummy; |
571 |
+ }; |
572 |
+-struct blkif_common_response { |
573 |
+- char dummy; |
574 |
+-}; |
575 |
++ |
576 |
++/* i386 protocol version */ |
577 |
+ |
578 |
+ struct blkif_x86_32_request_rw { |
579 |
+ uint8_t nr_segments; /* number of segments */ |
580 |
+@@ -128,14 +127,6 @@ struct blkif_x86_32_request { |
581 |
+ } u; |
582 |
+ } __attribute__((__packed__)); |
583 |
+ |
584 |
+-/* i386 protocol version */ |
585 |
+-#pragma pack(push, 4) |
586 |
+-struct blkif_x86_32_response { |
587 |
+- uint64_t id; /* copied from request */ |
588 |
+- uint8_t operation; /* copied from request */ |
589 |
+- int16_t status; /* BLKIF_RSP_??? */ |
590 |
+-}; |
591 |
+-#pragma pack(pop) |
592 |
+ /* x86_64 protocol version */ |
593 |
+ |
594 |
+ struct blkif_x86_64_request_rw { |
595 |
+@@ -192,18 +183,12 @@ struct blkif_x86_64_request { |
596 |
+ } u; |
597 |
+ } __attribute__((__packed__)); |
598 |
+ |
599 |
+-struct blkif_x86_64_response { |
600 |
+- uint64_t __attribute__((__aligned__(8))) id; |
601 |
+- uint8_t operation; /* copied from request */ |
602 |
+- int16_t status; /* BLKIF_RSP_??? */ |
603 |
+-}; |
604 |
+- |
605 |
+ DEFINE_RING_TYPES(blkif_common, struct blkif_common_request, |
606 |
+- struct blkif_common_response); |
607 |
++ struct blkif_response); |
608 |
+ DEFINE_RING_TYPES(blkif_x86_32, struct blkif_x86_32_request, |
609 |
+- struct blkif_x86_32_response); |
610 |
++ struct blkif_response __packed); |
611 |
+ DEFINE_RING_TYPES(blkif_x86_64, struct blkif_x86_64_request, |
612 |
+- struct blkif_x86_64_response); |
613 |
++ struct blkif_response); |
614 |
+ |
615 |
+ union blkif_back_rings { |
616 |
+ struct blkif_back_ring native; |
617 |
+diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c |
618 |
+index 7bb8055bd10c..1ccad79ce77c 100644 |
619 |
+--- a/drivers/bluetooth/btusb.c |
620 |
++++ b/drivers/bluetooth/btusb.c |
621 |
+@@ -2969,6 +2969,12 @@ static int btusb_probe(struct usb_interface *intf, |
622 |
+ if (id->driver_info & BTUSB_QCA_ROME) { |
623 |
+ data->setup_on_usb = btusb_setup_qca; |
624 |
+ hdev->set_bdaddr = btusb_set_bdaddr_ath3012; |
625 |
++ |
626 |
++ /* QCA Rome devices lose their updated firmware over suspend, |
627 |
++ * but the USB hub doesn't notice any status change. |
628 |
++ * Explicitly request a device reset on resume. |
629 |
++ */ |
630 |
++ set_bit(BTUSB_RESET_RESUME, &data->flags); |
631 |
+ } |
632 |
+ |
633 |
+ #ifdef CONFIG_BT_HCIBTUSB_RTL |
634 |
+diff --git a/drivers/dma/dmatest.c b/drivers/dma/dmatest.c |
635 |
+index b8576fd6bd0e..1c7568c0055a 100644 |
636 |
+--- a/drivers/dma/dmatest.c |
637 |
++++ b/drivers/dma/dmatest.c |
638 |
+@@ -634,6 +634,7 @@ static int dmatest_func(void *data) |
639 |
+ * free it this time?" dancing. For now, just |
640 |
+ * leave it dangling. |
641 |
+ */ |
642 |
++ WARN(1, "dmatest: Kernel stack may be corrupted!!\n"); |
643 |
+ dmaengine_unmap_put(um); |
644 |
+ result("test timed out", total_tests, src_off, dst_off, |
645 |
+ len, 0); |
646 |
+diff --git a/drivers/extcon/extcon-palmas.c b/drivers/extcon/extcon-palmas.c |
647 |
+index 93c30a885740..aa2f6bb82b32 100644 |
648 |
+--- a/drivers/extcon/extcon-palmas.c |
649 |
++++ b/drivers/extcon/extcon-palmas.c |
650 |
+@@ -190,6 +190,11 @@ static int palmas_usb_probe(struct platform_device *pdev) |
651 |
+ struct palmas_usb *palmas_usb; |
652 |
+ int status; |
653 |
+ |
654 |
++ if (!palmas) { |
655 |
++ dev_err(&pdev->dev, "failed to get valid parent\n"); |
656 |
++ return -EINVAL; |
657 |
++ } |
658 |
++ |
659 |
+ palmas_usb = devm_kzalloc(&pdev->dev, sizeof(*palmas_usb), GFP_KERNEL); |
660 |
+ if (!palmas_usb) |
661 |
+ return -ENOMEM; |
662 |
+diff --git a/drivers/gpu/drm/mgag200/mgag200_main.c b/drivers/gpu/drm/mgag200/mgag200_main.c |
663 |
+index b1a0f5656175..44df959cbadb 100644 |
664 |
+--- a/drivers/gpu/drm/mgag200/mgag200_main.c |
665 |
++++ b/drivers/gpu/drm/mgag200/mgag200_main.c |
666 |
+@@ -145,6 +145,8 @@ static int mga_vram_init(struct mga_device *mdev) |
667 |
+ } |
668 |
+ |
669 |
+ mem = pci_iomap(mdev->dev->pdev, 0, 0); |
670 |
++ if (!mem) |
671 |
++ return -ENOMEM; |
672 |
+ |
673 |
+ mdev->mc.vram_size = mga_probe_vram(mdev, mem); |
674 |
+ |
675 |
+diff --git a/drivers/gpu/drm/sti/sti_vtg.c b/drivers/gpu/drm/sti/sti_vtg.c |
676 |
+index d56630c60039..117a2f52fb4e 100644 |
677 |
+--- a/drivers/gpu/drm/sti/sti_vtg.c |
678 |
++++ b/drivers/gpu/drm/sti/sti_vtg.c |
679 |
+@@ -346,6 +346,10 @@ static int vtg_probe(struct platform_device *pdev) |
680 |
+ return -ENOMEM; |
681 |
+ } |
682 |
+ vtg->regs = devm_ioremap_nocache(dev, res->start, resource_size(res)); |
683 |
++ if (!vtg->regs) { |
684 |
++ DRM_ERROR("failed to remap I/O memory\n"); |
685 |
++ return -ENOMEM; |
686 |
++ } |
687 |
+ |
688 |
+ np = of_parse_phandle(pdev->dev.of_node, "st,slave", 0); |
689 |
+ if (np) { |
690 |
+diff --git a/drivers/media/rc/imon.c b/drivers/media/rc/imon.c |
691 |
+index eb9e7feb9b13..7a16e9ea041c 100644 |
692 |
+--- a/drivers/media/rc/imon.c |
693 |
++++ b/drivers/media/rc/imon.c |
694 |
+@@ -2419,6 +2419,11 @@ static int imon_probe(struct usb_interface *interface, |
695 |
+ mutex_lock(&driver_lock); |
696 |
+ |
697 |
+ first_if = usb_ifnum_to_if(usbdev, 0); |
698 |
++ if (!first_if) { |
699 |
++ ret = -ENODEV; |
700 |
++ goto fail; |
701 |
++ } |
702 |
++ |
703 |
+ first_if_ctx = usb_get_intfdata(first_if); |
704 |
+ |
705 |
+ if (ifnum == 0) { |
706 |
+diff --git a/drivers/media/usb/dvb-usb/dib0700_devices.c b/drivers/media/usb/dvb-usb/dib0700_devices.c |
707 |
+index 7ed49646a699..7df0707a0455 100644 |
708 |
+--- a/drivers/media/usb/dvb-usb/dib0700_devices.c |
709 |
++++ b/drivers/media/usb/dvb-usb/dib0700_devices.c |
710 |
+@@ -292,7 +292,7 @@ static int stk7700P2_frontend_attach(struct dvb_usb_adapter *adap) |
711 |
+ stk7700d_dib7000p_mt2266_config) |
712 |
+ != 0) { |
713 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
714 |
+- dvb_detach(&state->dib7000p_ops); |
715 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
716 |
+ return -ENODEV; |
717 |
+ } |
718 |
+ } |
719 |
+@@ -326,7 +326,7 @@ static int stk7700d_frontend_attach(struct dvb_usb_adapter *adap) |
720 |
+ stk7700d_dib7000p_mt2266_config) |
721 |
+ != 0) { |
722 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
723 |
+- dvb_detach(&state->dib7000p_ops); |
724 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
725 |
+ return -ENODEV; |
726 |
+ } |
727 |
+ } |
728 |
+@@ -479,7 +479,7 @@ static int stk7700ph_frontend_attach(struct dvb_usb_adapter *adap) |
729 |
+ &stk7700ph_dib7700_xc3028_config) != 0) { |
730 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
731 |
+ __func__); |
732 |
+- dvb_detach(&state->dib7000p_ops); |
733 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
734 |
+ return -ENODEV; |
735 |
+ } |
736 |
+ |
737 |
+@@ -1010,7 +1010,7 @@ static int stk7070p_frontend_attach(struct dvb_usb_adapter *adap) |
738 |
+ &dib7070p_dib7000p_config) != 0) { |
739 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
740 |
+ __func__); |
741 |
+- dvb_detach(&state->dib7000p_ops); |
742 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
743 |
+ return -ENODEV; |
744 |
+ } |
745 |
+ |
746 |
+@@ -1068,7 +1068,7 @@ static int stk7770p_frontend_attach(struct dvb_usb_adapter *adap) |
747 |
+ &dib7770p_dib7000p_config) != 0) { |
748 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
749 |
+ __func__); |
750 |
+- dvb_detach(&state->dib7000p_ops); |
751 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
752 |
+ return -ENODEV; |
753 |
+ } |
754 |
+ |
755 |
+@@ -3036,7 +3036,7 @@ static int nim7090_frontend_attach(struct dvb_usb_adapter *adap) |
756 |
+ |
757 |
+ if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x10, &nim7090_dib7000p_config) != 0) { |
758 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
759 |
+- dvb_detach(&state->dib7000p_ops); |
760 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
761 |
+ return -ENODEV; |
762 |
+ } |
763 |
+ adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, 0x80, &nim7090_dib7000p_config); |
764 |
+@@ -3089,7 +3089,7 @@ static int tfe7090pvr_frontend0_attach(struct dvb_usb_adapter *adap) |
765 |
+ /* initialize IC 0 */ |
766 |
+ if (state->dib7000p_ops.i2c_enumeration(&adap->dev->i2c_adap, 1, 0x20, &tfe7090pvr_dib7000p_config[0]) != 0) { |
767 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
768 |
+- dvb_detach(&state->dib7000p_ops); |
769 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
770 |
+ return -ENODEV; |
771 |
+ } |
772 |
+ |
773 |
+@@ -3119,7 +3119,7 @@ static int tfe7090pvr_frontend1_attach(struct dvb_usb_adapter *adap) |
774 |
+ i2c = state->dib7000p_ops.get_i2c_master(adap->dev->adapter[0].fe_adap[0].fe, DIBX000_I2C_INTERFACE_GPIO_6_7, 1); |
775 |
+ if (state->dib7000p_ops.i2c_enumeration(i2c, 1, 0x10, &tfe7090pvr_dib7000p_config[1]) != 0) { |
776 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", __func__); |
777 |
+- dvb_detach(&state->dib7000p_ops); |
778 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
779 |
+ return -ENODEV; |
780 |
+ } |
781 |
+ |
782 |
+@@ -3194,7 +3194,7 @@ static int tfe7790p_frontend_attach(struct dvb_usb_adapter *adap) |
783 |
+ 1, 0x10, &tfe7790p_dib7000p_config) != 0) { |
784 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
785 |
+ __func__); |
786 |
+- dvb_detach(&state->dib7000p_ops); |
787 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
788 |
+ return -ENODEV; |
789 |
+ } |
790 |
+ adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap, |
791 |
+@@ -3289,7 +3289,7 @@ static int stk7070pd_frontend_attach0(struct dvb_usb_adapter *adap) |
792 |
+ stk7070pd_dib7000p_config) != 0) { |
793 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
794 |
+ __func__); |
795 |
+- dvb_detach(&state->dib7000p_ops); |
796 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
797 |
+ return -ENODEV; |
798 |
+ } |
799 |
+ |
800 |
+@@ -3364,7 +3364,7 @@ static int novatd_frontend_attach(struct dvb_usb_adapter *adap) |
801 |
+ stk7070pd_dib7000p_config) != 0) { |
802 |
+ err("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n", |
803 |
+ __func__); |
804 |
+- dvb_detach(&state->dib7000p_ops); |
805 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
806 |
+ return -ENODEV; |
807 |
+ } |
808 |
+ } |
809 |
+@@ -3600,7 +3600,7 @@ static int pctv340e_frontend_attach(struct dvb_usb_adapter *adap) |
810 |
+ |
811 |
+ if (state->dib7000p_ops.dib7000pc_detection(&adap->dev->i2c_adap) == 0) { |
812 |
+ /* Demodulator not found for some reason? */ |
813 |
+- dvb_detach(&state->dib7000p_ops); |
814 |
++ dvb_detach(state->dib7000p_ops.set_wbd_ref); |
815 |
+ return -ENODEV; |
816 |
+ } |
817 |
+ |
818 |
+diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c |
819 |
+index af09a1b272e6..6a2d1454befe 100644 |
820 |
+--- a/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c |
821 |
++++ b/drivers/net/ethernet/intel/fm10k/fm10k_mbx.c |
822 |
+@@ -2002,9 +2002,10 @@ static void fm10k_sm_mbx_create_reply(struct fm10k_hw *hw, |
823 |
+ * function can also be used to respond to an error as the connection |
824 |
+ * resetting would also be a means of dealing with errors. |
825 |
+ **/ |
826 |
+-static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw, |
827 |
+- struct fm10k_mbx_info *mbx) |
828 |
++static s32 fm10k_sm_mbx_process_reset(struct fm10k_hw *hw, |
829 |
++ struct fm10k_mbx_info *mbx) |
830 |
+ { |
831 |
++ s32 err = 0; |
832 |
+ const enum fm10k_mbx_state state = mbx->state; |
833 |
+ |
834 |
+ switch (state) { |
835 |
+@@ -2017,6 +2018,7 @@ static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw, |
836 |
+ case FM10K_STATE_OPEN: |
837 |
+ /* flush any incomplete work */ |
838 |
+ fm10k_sm_mbx_connect_reset(mbx); |
839 |
++ err = FM10K_ERR_RESET_REQUESTED; |
840 |
+ break; |
841 |
+ case FM10K_STATE_CONNECT: |
842 |
+ /* Update remote value to match local value */ |
843 |
+@@ -2026,6 +2028,8 @@ static void fm10k_sm_mbx_process_reset(struct fm10k_hw *hw, |
844 |
+ } |
845 |
+ |
846 |
+ fm10k_sm_mbx_create_reply(hw, mbx, mbx->tail); |
847 |
++ |
848 |
++ return err; |
849 |
+ } |
850 |
+ |
851 |
+ /** |
852 |
+@@ -2106,7 +2110,7 @@ static s32 fm10k_sm_mbx_process(struct fm10k_hw *hw, |
853 |
+ |
854 |
+ switch (FM10K_MSG_HDR_FIELD_GET(mbx->mbx_hdr, SM_VER)) { |
855 |
+ case 0: |
856 |
+- fm10k_sm_mbx_process_reset(hw, mbx); |
857 |
++ err = fm10k_sm_mbx_process_reset(hw, mbx); |
858 |
+ break; |
859 |
+ case FM10K_SM_MBX_VERSION: |
860 |
+ err = fm10k_sm_mbx_process_version_1(hw, mbx); |
861 |
+diff --git a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c |
862 |
+index 7f3fb51bc37b..06f35700840b 100644 |
863 |
+--- a/drivers/net/ethernet/intel/fm10k/fm10k_pci.c |
864 |
++++ b/drivers/net/ethernet/intel/fm10k/fm10k_pci.c |
865 |
+@@ -1072,6 +1072,7 @@ static irqreturn_t fm10k_msix_mbx_pf(int __always_unused irq, void *data) |
866 |
+ struct fm10k_hw *hw = &interface->hw; |
867 |
+ struct fm10k_mbx_info *mbx = &hw->mbx; |
868 |
+ u32 eicr; |
869 |
++ s32 err = 0; |
870 |
+ |
871 |
+ /* unmask any set bits related to this interrupt */ |
872 |
+ eicr = fm10k_read_reg(hw, FM10K_EICR); |
873 |
+@@ -1087,12 +1088,15 @@ static irqreturn_t fm10k_msix_mbx_pf(int __always_unused irq, void *data) |
874 |
+ |
875 |
+ /* service mailboxes */ |
876 |
+ if (fm10k_mbx_trylock(interface)) { |
877 |
+- mbx->ops.process(hw, mbx); |
878 |
++ err = mbx->ops.process(hw, mbx); |
879 |
+ /* handle VFLRE events */ |
880 |
+ fm10k_iov_event(interface); |
881 |
+ fm10k_mbx_unlock(interface); |
882 |
+ } |
883 |
+ |
884 |
++ if (err == FM10K_ERR_RESET_REQUESTED) |
885 |
++ interface->flags |= FM10K_FLAG_RESET_REQUESTED; |
886 |
++ |
887 |
+ /* if switch toggled state we should reset GLORTs */ |
888 |
+ if (eicr & FM10K_EICR_SWITCHNOTREADY) { |
889 |
+ /* force link down for at least 4 seconds */ |
890 |
+diff --git a/drivers/net/ethernet/intel/igb/e1000_82575.c b/drivers/net/ethernet/intel/igb/e1000_82575.c |
891 |
+index 97bf0c3d5c69..f3f3b95d5512 100644 |
892 |
+--- a/drivers/net/ethernet/intel/igb/e1000_82575.c |
893 |
++++ b/drivers/net/ethernet/intel/igb/e1000_82575.c |
894 |
+@@ -223,6 +223,17 @@ static s32 igb_init_phy_params_82575(struct e1000_hw *hw) |
895 |
+ hw->bus.func = (rd32(E1000_STATUS) & E1000_STATUS_FUNC_MASK) >> |
896 |
+ E1000_STATUS_FUNC_SHIFT; |
897 |
+ |
898 |
++ /* Make sure the PHY is in a good state. Several people have reported |
899 |
++ * firmware leaving the PHY's page select register set to something |
900 |
++ * other than the default of zero, which causes the PHY ID read to |
901 |
++ * access something other than the intended register. |
902 |
++ */ |
903 |
++ ret_val = hw->phy.ops.reset(hw); |
904 |
++ if (ret_val) { |
905 |
++ hw_dbg("Error resetting the PHY.\n"); |
906 |
++ goto out; |
907 |
++ } |
908 |
++ |
909 |
+ /* Set phy->phy_addr and phy->id. */ |
910 |
+ ret_val = igb_get_phy_id_82575(hw); |
911 |
+ if (ret_val) |
912 |
+diff --git a/drivers/net/ethernet/intel/igb/e1000_i210.c b/drivers/net/ethernet/intel/igb/e1000_i210.c |
913 |
+index 29f59c76878a..851225b5dc0f 100644 |
914 |
+--- a/drivers/net/ethernet/intel/igb/e1000_i210.c |
915 |
++++ b/drivers/net/ethernet/intel/igb/e1000_i210.c |
916 |
+@@ -699,9 +699,9 @@ static s32 igb_update_flash_i210(struct e1000_hw *hw) |
917 |
+ |
918 |
+ ret_val = igb_pool_flash_update_done_i210(hw); |
919 |
+ if (ret_val) |
920 |
+- hw_dbg("Flash update complete\n"); |
921 |
+- else |
922 |
+ hw_dbg("Flash update time out\n"); |
923 |
++ else |
924 |
++ hw_dbg("Flash update complete\n"); |
925 |
+ |
926 |
+ out: |
927 |
+ return ret_val; |
928 |
+diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c |
929 |
+index a481ea64e287..ff6e57d788eb 100644 |
930 |
+--- a/drivers/net/ethernet/intel/igb/igb_main.c |
931 |
++++ b/drivers/net/ethernet/intel/igb/igb_main.c |
932 |
+@@ -3172,7 +3172,9 @@ static int __igb_close(struct net_device *netdev, bool suspending) |
933 |
+ |
934 |
+ static int igb_close(struct net_device *netdev) |
935 |
+ { |
936 |
+- return __igb_close(netdev, false); |
937 |
++ if (netif_device_present(netdev)) |
938 |
++ return __igb_close(netdev, false); |
939 |
++ return 0; |
940 |
+ } |
941 |
+ |
942 |
+ /** |
943 |
+@@ -7325,12 +7327,14 @@ static int __igb_shutdown(struct pci_dev *pdev, bool *enable_wake, |
944 |
+ int retval = 0; |
945 |
+ #endif |
946 |
+ |
947 |
++ rtnl_lock(); |
948 |
+ netif_device_detach(netdev); |
949 |
+ |
950 |
+ if (netif_running(netdev)) |
951 |
+ __igb_close(netdev, true); |
952 |
+ |
953 |
+ igb_clear_interrupt_scheme(adapter); |
954 |
++ rtnl_unlock(); |
955 |
+ |
956 |
+ #ifdef CONFIG_PM |
957 |
+ retval = pci_save_state(pdev); |
958 |
+@@ -7450,16 +7454,15 @@ static int igb_resume(struct device *dev) |
959 |
+ |
960 |
+ wr32(E1000_WUS, ~0); |
961 |
+ |
962 |
+- if (netdev->flags & IFF_UP) { |
963 |
+- rtnl_lock(); |
964 |
++ rtnl_lock(); |
965 |
++ if (!err && netif_running(netdev)) |
966 |
+ err = __igb_open(netdev, true); |
967 |
+- rtnl_unlock(); |
968 |
+- if (err) |
969 |
+- return err; |
970 |
+- } |
971 |
+ |
972 |
+- netif_device_attach(netdev); |
973 |
+- return 0; |
974 |
++ if (!err) |
975 |
++ netif_device_attach(netdev); |
976 |
++ rtnl_unlock(); |
977 |
++ |
978 |
++ return err; |
979 |
+ } |
980 |
+ |
981 |
+ static int igb_runtime_idle(struct device *dev) |
982 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c |
983 |
+index f3168bcc7d87..f0de09db8283 100644 |
984 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c |
985 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_lib.c |
986 |
+@@ -307,6 +307,7 @@ static void ixgbe_cache_ring_register(struct ixgbe_adapter *adapter) |
987 |
+ ixgbe_cache_ring_rss(adapter); |
988 |
+ } |
989 |
+ |
990 |
++#define IXGBE_RSS_64Q_MASK 0x3F |
991 |
+ #define IXGBE_RSS_16Q_MASK 0xF |
992 |
+ #define IXGBE_RSS_8Q_MASK 0x7 |
993 |
+ #define IXGBE_RSS_4Q_MASK 0x3 |
994 |
+@@ -602,6 +603,7 @@ static bool ixgbe_set_sriov_queues(struct ixgbe_adapter *adapter) |
995 |
+ **/ |
996 |
+ static bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter) |
997 |
+ { |
998 |
++ struct ixgbe_hw *hw = &adapter->hw; |
999 |
+ struct ixgbe_ring_feature *f; |
1000 |
+ u16 rss_i; |
1001 |
+ |
1002 |
+@@ -610,7 +612,11 @@ static bool ixgbe_set_rss_queues(struct ixgbe_adapter *adapter) |
1003 |
+ rss_i = f->limit; |
1004 |
+ |
1005 |
+ f->indices = rss_i; |
1006 |
+- f->mask = IXGBE_RSS_16Q_MASK; |
1007 |
++ |
1008 |
++ if (hw->mac.type < ixgbe_mac_X550) |
1009 |
++ f->mask = IXGBE_RSS_16Q_MASK; |
1010 |
++ else |
1011 |
++ f->mask = IXGBE_RSS_64Q_MASK; |
1012 |
+ |
1013 |
+ /* disable ATR by default, it will be configured below */ |
1014 |
+ adapter->flags &= ~IXGBE_FLAG_FDIR_HASH_CAPABLE; |
1015 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1016 |
+index cd9b284bc83b..83645d8503d4 100644 |
1017 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1018 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |
1019 |
+@@ -5878,7 +5878,8 @@ static int ixgbe_close(struct net_device *netdev) |
1020 |
+ |
1021 |
+ ixgbe_ptp_stop(adapter); |
1022 |
+ |
1023 |
+- ixgbe_close_suspend(adapter); |
1024 |
++ if (netif_device_present(netdev)) |
1025 |
++ ixgbe_close_suspend(adapter); |
1026 |
+ |
1027 |
+ ixgbe_fdir_filter_exit(adapter); |
1028 |
+ |
1029 |
+@@ -5923,14 +5924,12 @@ static int ixgbe_resume(struct pci_dev *pdev) |
1030 |
+ if (!err && netif_running(netdev)) |
1031 |
+ err = ixgbe_open(netdev); |
1032 |
+ |
1033 |
+- rtnl_unlock(); |
1034 |
+- |
1035 |
+- if (err) |
1036 |
+- return err; |
1037 |
+ |
1038 |
+- netif_device_attach(netdev); |
1039 |
++ if (!err) |
1040 |
++ netif_device_attach(netdev); |
1041 |
++ rtnl_unlock(); |
1042 |
+ |
1043 |
+- return 0; |
1044 |
++ return err; |
1045 |
+ } |
1046 |
+ #endif /* CONFIG_PM */ |
1047 |
+ |
1048 |
+@@ -5945,14 +5944,14 @@ static int __ixgbe_shutdown(struct pci_dev *pdev, bool *enable_wake) |
1049 |
+ int retval = 0; |
1050 |
+ #endif |
1051 |
+ |
1052 |
++ rtnl_lock(); |
1053 |
+ netif_device_detach(netdev); |
1054 |
+ |
1055 |
+- rtnl_lock(); |
1056 |
+ if (netif_running(netdev)) |
1057 |
+ ixgbe_close_suspend(adapter); |
1058 |
+- rtnl_unlock(); |
1059 |
+ |
1060 |
+ ixgbe_clear_interrupt_scheme(adapter); |
1061 |
++ rtnl_unlock(); |
1062 |
+ |
1063 |
+ #ifdef CONFIG_PM |
1064 |
+ retval = pci_save_state(pdev); |
1065 |
+@@ -9221,7 +9220,7 @@ skip_bad_vf_detection: |
1066 |
+ } |
1067 |
+ |
1068 |
+ if (netif_running(netdev)) |
1069 |
+- ixgbe_down(adapter); |
1070 |
++ ixgbe_close_suspend(adapter); |
1071 |
+ |
1072 |
+ if (!test_and_set_bit(__IXGBE_DISABLED, &adapter->state)) |
1073 |
+ pci_disable_device(pdev); |
1074 |
+@@ -9291,10 +9290,12 @@ static void ixgbe_io_resume(struct pci_dev *pdev) |
1075 |
+ } |
1076 |
+ |
1077 |
+ #endif |
1078 |
++ rtnl_lock(); |
1079 |
+ if (netif_running(netdev)) |
1080 |
+- ixgbe_up(adapter); |
1081 |
++ ixgbe_open(netdev); |
1082 |
+ |
1083 |
+ netif_device_attach(netdev); |
1084 |
++ rtnl_unlock(); |
1085 |
+ } |
1086 |
+ |
1087 |
+ static const struct pci_error_handlers ixgbe_err_handler = { |
1088 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c |
1089 |
+index fb8673d63806..48d97cb730d8 100644 |
1090 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c |
1091 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_phy.c |
1092 |
+@@ -113,7 +113,7 @@ static s32 ixgbe_read_i2c_combined_generic_int(struct ixgbe_hw *hw, u8 addr, |
1093 |
+ u16 reg, u16 *val, bool lock) |
1094 |
+ { |
1095 |
+ u32 swfw_mask = hw->phy.phy_semaphore_mask; |
1096 |
+- int max_retry = 10; |
1097 |
++ int max_retry = 3; |
1098 |
+ int retry = 0; |
1099 |
+ u8 csum_byte; |
1100 |
+ u8 high_bits; |
1101 |
+@@ -1764,6 +1764,8 @@ static s32 ixgbe_read_i2c_byte_generic_int(struct ixgbe_hw *hw, u8 byte_offset, |
1102 |
+ u32 swfw_mask = hw->phy.phy_semaphore_mask; |
1103 |
+ bool nack = true; |
1104 |
+ |
1105 |
++ if (hw->mac.type >= ixgbe_mac_X550) |
1106 |
++ max_retry = 3; |
1107 |
+ if (ixgbe_is_sfp_probe(hw, byte_offset, dev_addr)) |
1108 |
+ max_retry = IXGBE_SFP_DETECT_RETRIES; |
1109 |
+ |
1110 |
+diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c |
1111 |
+index ebe0ac950b14..31f864fb30c1 100644 |
1112 |
+--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c |
1113 |
++++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_x550.c |
1114 |
+@@ -1643,8 +1643,6 @@ static s32 ixgbe_setup_kr_speed_x550em(struct ixgbe_hw *hw, |
1115 |
+ return status; |
1116 |
+ |
1117 |
+ reg_val |= IXGBE_KRM_LINK_CTRL_1_TETH_AN_ENABLE; |
1118 |
+- reg_val &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_AN_FEC_REQ | |
1119 |
+- IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_FEC); |
1120 |
+ reg_val &= ~(IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_KR | |
1121 |
+ IXGBE_KRM_LINK_CTRL_1_TETH_AN_CAP_KX); |
1122 |
+ |
1123 |
+diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c |
1124 |
+index 8c408aa2f208..f9343bee1de3 100644 |
1125 |
+--- a/drivers/net/usb/cdc_ether.c |
1126 |
++++ b/drivers/net/usb/cdc_ether.c |
1127 |
+@@ -221,7 +221,7 @@ skip: |
1128 |
+ goto bad_desc; |
1129 |
+ } |
1130 |
+ |
1131 |
+- if (header.usb_cdc_ether_desc) { |
1132 |
++ if (header.usb_cdc_ether_desc && info->ether->wMaxSegmentSize) { |
1133 |
+ dev->hard_mtu = le16_to_cpu(info->ether->wMaxSegmentSize); |
1134 |
+ /* because of Zaurus, we may be ignoring the host |
1135 |
+ * side link address we were given. |
1136 |
+diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c |
1137 |
+index 958af3b1af7f..e325ca3ad565 100644 |
1138 |
+--- a/drivers/net/usb/qmi_wwan.c |
1139 |
++++ b/drivers/net/usb/qmi_wwan.c |
1140 |
+@@ -262,7 +262,7 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf) |
1141 |
+ } |
1142 |
+ |
1143 |
+ /* errors aren't fatal - we can live with the dynamic address */ |
1144 |
+- if (cdc_ether) { |
1145 |
++ if (cdc_ether && cdc_ether->wMaxSegmentSize) { |
1146 |
+ dev->hard_mtu = le16_to_cpu(cdc_ether->wMaxSegmentSize); |
1147 |
+ usbnet_get_ethernet_addr(dev, cdc_ether->iMACAddress); |
1148 |
+ } |
1149 |
+diff --git a/drivers/scsi/lpfc/lpfc_attr.c b/drivers/scsi/lpfc/lpfc_attr.c |
1150 |
+index f6446d759d7f..4639dac64e7f 100644 |
1151 |
+--- a/drivers/scsi/lpfc/lpfc_attr.c |
1152 |
++++ b/drivers/scsi/lpfc/lpfc_attr.c |
1153 |
+@@ -5147,6 +5147,19 @@ lpfc_free_sysfs_attr(struct lpfc_vport *vport) |
1154 |
+ * Dynamic FC Host Attributes Support |
1155 |
+ */ |
1156 |
+ |
1157 |
++/** |
1158 |
++ * lpfc_get_host_symbolic_name - Copy symbolic name into the scsi host |
1159 |
++ * @shost: kernel scsi host pointer. |
1160 |
++ **/ |
1161 |
++static void |
1162 |
++lpfc_get_host_symbolic_name(struct Scsi_Host *shost) |
1163 |
++{ |
1164 |
++ struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; |
1165 |
++ |
1166 |
++ lpfc_vport_symbolic_node_name(vport, fc_host_symbolic_name(shost), |
1167 |
++ sizeof fc_host_symbolic_name(shost)); |
1168 |
++} |
1169 |
++ |
1170 |
+ /** |
1171 |
+ * lpfc_get_host_port_id - Copy the vport DID into the scsi host port id |
1172 |
+ * @shost: kernel scsi host pointer. |
1173 |
+@@ -5684,6 +5697,8 @@ struct fc_function_template lpfc_transport_functions = { |
1174 |
+ .show_host_supported_fc4s = 1, |
1175 |
+ .show_host_supported_speeds = 1, |
1176 |
+ .show_host_maxframe_size = 1, |
1177 |
++ |
1178 |
++ .get_host_symbolic_name = lpfc_get_host_symbolic_name, |
1179 |
+ .show_host_symbolic_name = 1, |
1180 |
+ |
1181 |
+ /* dynamic attributes the driver supports */ |
1182 |
+@@ -5751,6 +5766,8 @@ struct fc_function_template lpfc_vport_transport_functions = { |
1183 |
+ .show_host_supported_fc4s = 1, |
1184 |
+ .show_host_supported_speeds = 1, |
1185 |
+ .show_host_maxframe_size = 1, |
1186 |
++ |
1187 |
++ .get_host_symbolic_name = lpfc_get_host_symbolic_name, |
1188 |
+ .show_host_symbolic_name = 1, |
1189 |
+ |
1190 |
+ /* dynamic attributes the driver supports */ |
1191 |
+diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c |
1192 |
+index c74f74ab981c..d278362448ca 100644 |
1193 |
+--- a/drivers/scsi/lpfc/lpfc_els.c |
1194 |
++++ b/drivers/scsi/lpfc/lpfc_els.c |
1195 |
+@@ -1982,6 +1982,9 @@ lpfc_issue_els_plogi(struct lpfc_vport *vport, uint32_t did, uint8_t retry) |
1196 |
+ if (sp->cmn.fcphHigh < FC_PH3) |
1197 |
+ sp->cmn.fcphHigh = FC_PH3; |
1198 |
+ |
1199 |
++ sp->cmn.valid_vendor_ver_level = 0; |
1200 |
++ memset(sp->vendorVersion, 0, sizeof(sp->vendorVersion)); |
1201 |
++ |
1202 |
+ lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_CMD, |
1203 |
+ "Issue PLOGI: did:x%x", |
1204 |
+ did, 0, 0); |
1205 |
+@@ -3966,6 +3969,9 @@ lpfc_els_rsp_acc(struct lpfc_vport *vport, uint32_t flag, |
1206 |
+ } else { |
1207 |
+ memcpy(pcmd, &vport->fc_sparam, |
1208 |
+ sizeof(struct serv_parm)); |
1209 |
++ |
1210 |
++ sp->cmn.valid_vendor_ver_level = 0; |
1211 |
++ memset(sp->vendorVersion, 0, sizeof(sp->vendorVersion)); |
1212 |
+ } |
1213 |
+ |
1214 |
+ lpfc_debugfs_disc_trc(vport, LPFC_DISC_TRC_ELS_RSP, |
1215 |
+diff --git a/drivers/scsi/lpfc/lpfc_hw.h b/drivers/scsi/lpfc/lpfc_hw.h |
1216 |
+index 2cce88e967ce..a8ad97300177 100644 |
1217 |
+--- a/drivers/scsi/lpfc/lpfc_hw.h |
1218 |
++++ b/drivers/scsi/lpfc/lpfc_hw.h |
1219 |
+@@ -360,6 +360,12 @@ struct csp { |
1220 |
+ * Word 1 Bit 30 in PLOGI request is random offset |
1221 |
+ */ |
1222 |
+ #define virtual_fabric_support randomOffset /* Word 1, bit 30 */ |
1223 |
++/* |
1224 |
++ * Word 1 Bit 29 in common service parameter is overloaded. |
1225 |
++ * Word 1 Bit 29 in FLOGI response is multiple NPort assignment |
1226 |
++ * Word 1 Bit 29 in FLOGI/PLOGI request is Valid Vendor Version Level |
1227 |
++ */ |
1228 |
++#define valid_vendor_ver_level response_multiple_NPort /* Word 1, bit 29 */ |
1229 |
+ #ifdef __BIG_ENDIAN_BITFIELD |
1230 |
+ uint16_t request_multiple_Nport:1; /* FC Word 1, bit 31 */ |
1231 |
+ uint16_t randomOffset:1; /* FC Word 1, bit 30 */ |
1232 |
+diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c |
1233 |
+index 38e90d9c2ced..8379fbbc60db 100644 |
1234 |
+--- a/drivers/scsi/lpfc/lpfc_sli.c |
1235 |
++++ b/drivers/scsi/lpfc/lpfc_sli.c |
1236 |
+@@ -118,6 +118,8 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, union lpfc_wqe *wqe) |
1237 |
+ if (q->phba->sli3_options & LPFC_SLI4_PHWQ_ENABLED) |
1238 |
+ bf_set(wqe_wqid, &wqe->generic.wqe_com, q->queue_id); |
1239 |
+ lpfc_sli_pcimem_bcopy(wqe, temp_wqe, q->entry_size); |
1240 |
++ /* ensure WQE bcopy flushed before doorbell write */ |
1241 |
++ wmb(); |
1242 |
+ |
1243 |
+ /* Update the host index before invoking device */ |
1244 |
+ host_index = q->host_index; |
1245 |
+@@ -9805,6 +9807,7 @@ lpfc_sli_abort_iotag_issue(struct lpfc_hba *phba, struct lpfc_sli_ring *pring, |
1246 |
+ iabt->ulpCommand = CMD_CLOSE_XRI_CN; |
1247 |
+ |
1248 |
+ abtsiocbp->iocb_cmpl = lpfc_sli_abort_els_cmpl; |
1249 |
++ abtsiocbp->vport = vport; |
1250 |
+ |
1251 |
+ lpfc_printf_vlog(vport, KERN_INFO, LOG_SLI, |
1252 |
+ "0339 Abort xri x%x, original iotag x%x, " |
1253 |
+diff --git a/drivers/scsi/lpfc/lpfc_vport.c b/drivers/scsi/lpfc/lpfc_vport.c |
1254 |
+index 769012663a8f..861c57bc4520 100644 |
1255 |
+--- a/drivers/scsi/lpfc/lpfc_vport.c |
1256 |
++++ b/drivers/scsi/lpfc/lpfc_vport.c |
1257 |
+@@ -528,6 +528,12 @@ enable_vport(struct fc_vport *fc_vport) |
1258 |
+ |
1259 |
+ spin_lock_irq(shost->host_lock); |
1260 |
+ vport->load_flag |= FC_LOADING; |
1261 |
++ if (vport->fc_flag & FC_VPORT_NEEDS_INIT_VPI) { |
1262 |
++ spin_unlock_irq(shost->host_lock); |
1263 |
++ lpfc_issue_init_vpi(vport); |
1264 |
++ goto out; |
1265 |
++ } |
1266 |
++ |
1267 |
+ vport->fc_flag |= FC_VPORT_NEEDS_REG_VPI; |
1268 |
+ spin_unlock_irq(shost->host_lock); |
1269 |
+ |
1270 |
+@@ -548,6 +554,8 @@ enable_vport(struct fc_vport *fc_vport) |
1271 |
+ } else { |
1272 |
+ lpfc_vport_set_state(vport, FC_VPORT_FAILED); |
1273 |
+ } |
1274 |
++ |
1275 |
++out: |
1276 |
+ lpfc_printf_vlog(vport, KERN_ERR, LOG_VPORT, |
1277 |
+ "1827 Vport Enabled.\n"); |
1278 |
+ return VPORT_OK; |
1279 |
+diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c |
1280 |
+index 4f38d008bfb4..4b82c3765e01 100644 |
1281 |
+--- a/drivers/scsi/ufs/ufs-qcom.c |
1282 |
++++ b/drivers/scsi/ufs/ufs-qcom.c |
1283 |
+@@ -1552,6 +1552,7 @@ static const struct of_device_id ufs_qcom_of_match[] = { |
1284 |
+ { .compatible = "qcom,ufshc"}, |
1285 |
+ {}, |
1286 |
+ }; |
1287 |
++MODULE_DEVICE_TABLE(of, ufs_qcom_of_match); |
1288 |
+ |
1289 |
+ static const struct dev_pm_ops ufs_qcom_pm_ops = { |
1290 |
+ .suspend = ufshcd_pltfrm_suspend, |
1291 |
+diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c |
1292 |
+index 85cd2564c157..0c2482ec7d21 100644 |
1293 |
+--- a/drivers/scsi/ufs/ufshcd.c |
1294 |
++++ b/drivers/scsi/ufs/ufshcd.c |
1295 |
+@@ -3340,18 +3340,25 @@ out: |
1296 |
+ } |
1297 |
+ |
1298 |
+ /** |
1299 |
+- * ufshcd_force_reset_auto_bkops - force enable of auto bkops |
1300 |
++ * ufshcd_force_reset_auto_bkops - force reset auto bkops state |
1301 |
+ * @hba: per adapter instance |
1302 |
+ * |
1303 |
+ * After a device reset the device may toggle the BKOPS_EN flag |
1304 |
+ * to default value. The s/w tracking variables should be updated |
1305 |
+- * as well. Do this by forcing enable of auto bkops. |
1306 |
++ * as well. This function would change the auto-bkops state based on |
1307 |
++ * UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND. |
1308 |
+ */ |
1309 |
+-static void ufshcd_force_reset_auto_bkops(struct ufs_hba *hba) |
1310 |
++static void ufshcd_force_reset_auto_bkops(struct ufs_hba *hba) |
1311 |
+ { |
1312 |
+- hba->auto_bkops_enabled = false; |
1313 |
+- hba->ee_ctrl_mask |= MASK_EE_URGENT_BKOPS; |
1314 |
+- ufshcd_enable_auto_bkops(hba); |
1315 |
++ if (ufshcd_keep_autobkops_enabled_except_suspend(hba)) { |
1316 |
++ hba->auto_bkops_enabled = false; |
1317 |
++ hba->ee_ctrl_mask |= MASK_EE_URGENT_BKOPS; |
1318 |
++ ufshcd_enable_auto_bkops(hba); |
1319 |
++ } else { |
1320 |
++ hba->auto_bkops_enabled = true; |
1321 |
++ hba->ee_ctrl_mask &= ~MASK_EE_URGENT_BKOPS; |
1322 |
++ ufshcd_disable_auto_bkops(hba); |
1323 |
++ } |
1324 |
+ } |
1325 |
+ |
1326 |
+ static inline int ufshcd_get_bkops_status(struct ufs_hba *hba, u32 *status) |
1327 |
+@@ -5149,11 +5156,15 @@ static int ufshcd_resume(struct ufs_hba *hba, enum ufs_pm_op pm_op) |
1328 |
+ goto set_old_link_state; |
1329 |
+ } |
1330 |
+ |
1331 |
+- /* |
1332 |
+- * If BKOPs operations are urgently needed at this moment then |
1333 |
+- * keep auto-bkops enabled or else disable it. |
1334 |
+- */ |
1335 |
+- ufshcd_urgent_bkops(hba); |
1336 |
++ if (ufshcd_keep_autobkops_enabled_except_suspend(hba)) |
1337 |
++ ufshcd_enable_auto_bkops(hba); |
1338 |
++ else |
1339 |
++ /* |
1340 |
++ * If BKOPs operations are urgently needed at this moment then |
1341 |
++ * keep auto-bkops enabled or else disable it. |
1342 |
++ */ |
1343 |
++ ufshcd_urgent_bkops(hba); |
1344 |
++ |
1345 |
+ hba->clk_gating.is_suspended = false; |
1346 |
+ |
1347 |
+ if (ufshcd_is_clkscaling_enabled(hba)) |
1348 |
+diff --git a/drivers/scsi/ufs/ufshcd.h b/drivers/scsi/ufs/ufshcd.h |
1349 |
+index 2570d9477b37..bb02100ab2dc 100644 |
1350 |
+--- a/drivers/scsi/ufs/ufshcd.h |
1351 |
++++ b/drivers/scsi/ufs/ufshcd.h |
1352 |
+@@ -528,6 +528,14 @@ struct ufs_hba { |
1353 |
+ * CAUTION: Enabling this might reduce overall UFS throughput. |
1354 |
+ */ |
1355 |
+ #define UFSHCD_CAP_INTR_AGGR (1 << 4) |
1356 |
++ /* |
1357 |
++ * This capability allows the device auto-bkops to be always enabled |
1358 |
++ * except during suspend (both runtime and suspend). |
1359 |
++ * Enabling this capability means that device will always be allowed |
1360 |
++ * to do background operation when it's active but it might degrade |
1361 |
++ * the performance of ongoing read/write operations. |
1362 |
++ */ |
1363 |
++#define UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND (1 << 5) |
1364 |
+ |
1365 |
+ struct devfreq *devfreq; |
1366 |
+ struct ufs_clk_scaling clk_scaling; |
1367 |
+@@ -623,6 +631,11 @@ static inline void *ufshcd_get_variant(struct ufs_hba *hba) |
1368 |
+ BUG_ON(!hba); |
1369 |
+ return hba->priv; |
1370 |
+ } |
1371 |
++static inline bool ufshcd_keep_autobkops_enabled_except_suspend( |
1372 |
++ struct ufs_hba *hba) |
1373 |
++{ |
1374 |
++ return hba->caps & UFSHCD_CAP_KEEP_AUTO_BKOPS_ENABLED_EXCEPT_SUSPEND; |
1375 |
++} |
1376 |
+ |
1377 |
+ extern int ufshcd_runtime_suspend(struct ufs_hba *hba); |
1378 |
+ extern int ufshcd_runtime_resume(struct ufs_hba *hba); |
1379 |
+diff --git a/drivers/staging/rtl8188eu/include/rtw_debug.h b/drivers/staging/rtl8188eu/include/rtw_debug.h |
1380 |
+index 971bf457f32d..e75a386344e4 100644 |
1381 |
+--- a/drivers/staging/rtl8188eu/include/rtw_debug.h |
1382 |
++++ b/drivers/staging/rtl8188eu/include/rtw_debug.h |
1383 |
+@@ -75,7 +75,7 @@ extern u32 GlobalDebugLevel; |
1384 |
+ #define DBG_88E_LEVEL(_level, fmt, arg...) \ |
1385 |
+ do { \ |
1386 |
+ if (_level <= GlobalDebugLevel) \ |
1387 |
+- pr_info(DRIVER_PREFIX"ERROR " fmt, ##arg); \ |
1388 |
++ pr_info(DRIVER_PREFIX fmt, ##arg); \ |
1389 |
+ } while (0) |
1390 |
+ |
1391 |
+ #define DBG_88E(...) \ |
1392 |
+diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c |
1393 |
+index edfc6805e012..2b348439242f 100644 |
1394 |
+--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c |
1395 |
++++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c |
1396 |
+@@ -199,7 +199,7 @@ static inline char *translate_scan(struct _adapter *padapter, |
1397 |
+ iwe.cmd = SIOCGIWMODE; |
1398 |
+ memcpy((u8 *)&cap, r8712_get_capability_from_ie(pnetwork->network.IEs), |
1399 |
+ 2); |
1400 |
+- cap = le16_to_cpu(cap); |
1401 |
++ le16_to_cpus(&cap); |
1402 |
+ if (cap & (WLAN_CAPABILITY_IBSS | WLAN_CAPABILITY_BSS)) { |
1403 |
+ if (cap & WLAN_CAPABILITY_BSS) |
1404 |
+ iwe.u.mode = (u32)IW_MODE_MASTER; |
1405 |
+diff --git a/drivers/usb/core/devio.c b/drivers/usb/core/devio.c |
1406 |
+index 873ba02d59e6..f4c3a37e00ba 100644 |
1407 |
+--- a/drivers/usb/core/devio.c |
1408 |
++++ b/drivers/usb/core/devio.c |
1409 |
+@@ -1653,6 +1653,18 @@ static int proc_unlinkurb(struct usb_dev_state *ps, void __user *arg) |
1410 |
+ return 0; |
1411 |
+ } |
1412 |
+ |
1413 |
++static void compute_isochronous_actual_length(struct urb *urb) |
1414 |
++{ |
1415 |
++ unsigned int i; |
1416 |
++ |
1417 |
++ if (urb->number_of_packets > 0) { |
1418 |
++ urb->actual_length = 0; |
1419 |
++ for (i = 0; i < urb->number_of_packets; i++) |
1420 |
++ urb->actual_length += |
1421 |
++ urb->iso_frame_desc[i].actual_length; |
1422 |
++ } |
1423 |
++} |
1424 |
++ |
1425 |
+ static int processcompl(struct async *as, void __user * __user *arg) |
1426 |
+ { |
1427 |
+ struct urb *urb = as->urb; |
1428 |
+@@ -1660,6 +1672,7 @@ static int processcompl(struct async *as, void __user * __user *arg) |
1429 |
+ void __user *addr = as->userurb; |
1430 |
+ unsigned int i; |
1431 |
+ |
1432 |
++ compute_isochronous_actual_length(urb); |
1433 |
+ if (as->userbuffer && urb->actual_length) { |
1434 |
+ if (copy_urb_data_to_user(as->userbuffer, urb)) |
1435 |
+ goto err_out; |
1436 |
+@@ -1829,6 +1842,7 @@ static int processcompl_compat(struct async *as, void __user * __user *arg) |
1437 |
+ void __user *addr = as->userurb; |
1438 |
+ unsigned int i; |
1439 |
+ |
1440 |
++ compute_isochronous_actual_length(urb); |
1441 |
+ if (as->userbuffer && urb->actual_length) { |
1442 |
+ if (copy_urb_data_to_user(as->userbuffer, urb)) |
1443 |
+ return -EFAULT; |
1444 |
+diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c |
1445 |
+index a6aaf2f193a4..37c418e581fb 100644 |
1446 |
+--- a/drivers/usb/core/quirks.c |
1447 |
++++ b/drivers/usb/core/quirks.c |
1448 |
+@@ -221,6 +221,9 @@ static const struct usb_device_id usb_quirk_list[] = { |
1449 |
+ /* Corsair Strafe RGB */ |
1450 |
+ { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT }, |
1451 |
+ |
1452 |
++ /* Corsair K70 LUX */ |
1453 |
++ { USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT }, |
1454 |
++ |
1455 |
+ /* MIDI keyboard WORLDE MINI */ |
1456 |
+ { USB_DEVICE(0x1c75, 0x0204), .driver_info = |
1457 |
+ USB_QUIRK_CONFIG_INTF_STRINGS }, |
1458 |
+diff --git a/drivers/usb/serial/garmin_gps.c b/drivers/usb/serial/garmin_gps.c |
1459 |
+index 37d0e8cc7af6..2220c1b9df10 100644 |
1460 |
+--- a/drivers/usb/serial/garmin_gps.c |
1461 |
++++ b/drivers/usb/serial/garmin_gps.c |
1462 |
+@@ -138,6 +138,7 @@ struct garmin_data { |
1463 |
+ __u8 privpkt[4*6]; |
1464 |
+ spinlock_t lock; |
1465 |
+ struct list_head pktlist; |
1466 |
++ struct usb_anchor write_urbs; |
1467 |
+ }; |
1468 |
+ |
1469 |
+ |
1470 |
+@@ -906,13 +907,19 @@ static int garmin_init_session(struct usb_serial_port *port) |
1471 |
+ sizeof(GARMIN_START_SESSION_REQ), 0); |
1472 |
+ |
1473 |
+ if (status < 0) |
1474 |
+- break; |
1475 |
++ goto err_kill_urbs; |
1476 |
+ } |
1477 |
+ |
1478 |
+ if (status > 0) |
1479 |
+ status = 0; |
1480 |
+ } |
1481 |
+ |
1482 |
++ return status; |
1483 |
++ |
1484 |
++err_kill_urbs: |
1485 |
++ usb_kill_anchored_urbs(&garmin_data_p->write_urbs); |
1486 |
++ usb_kill_urb(port->interrupt_in_urb); |
1487 |
++ |
1488 |
+ return status; |
1489 |
+ } |
1490 |
+ |
1491 |
+@@ -931,7 +938,6 @@ static int garmin_open(struct tty_struct *tty, struct usb_serial_port *port) |
1492 |
+ spin_unlock_irqrestore(&garmin_data_p->lock, flags); |
1493 |
+ |
1494 |
+ /* shutdown any bulk reads that might be going on */ |
1495 |
+- usb_kill_urb(port->write_urb); |
1496 |
+ usb_kill_urb(port->read_urb); |
1497 |
+ |
1498 |
+ if (garmin_data_p->state == STATE_RESET) |
1499 |
+@@ -954,7 +960,7 @@ static void garmin_close(struct usb_serial_port *port) |
1500 |
+ |
1501 |
+ /* shutdown our urbs */ |
1502 |
+ usb_kill_urb(port->read_urb); |
1503 |
+- usb_kill_urb(port->write_urb); |
1504 |
++ usb_kill_anchored_urbs(&garmin_data_p->write_urbs); |
1505 |
+ |
1506 |
+ /* keep reset state so we know that we must start a new session */ |
1507 |
+ if (garmin_data_p->state != STATE_RESET) |
1508 |
+@@ -1038,12 +1044,14 @@ static int garmin_write_bulk(struct usb_serial_port *port, |
1509 |
+ } |
1510 |
+ |
1511 |
+ /* send it down the pipe */ |
1512 |
++ usb_anchor_urb(urb, &garmin_data_p->write_urbs); |
1513 |
+ status = usb_submit_urb(urb, GFP_ATOMIC); |
1514 |
+ if (status) { |
1515 |
+ dev_err(&port->dev, |
1516 |
+ "%s - usb_submit_urb(write bulk) failed with status = %d\n", |
1517 |
+ __func__, status); |
1518 |
+ count = status; |
1519 |
++ usb_unanchor_urb(urb); |
1520 |
+ kfree(buffer); |
1521 |
+ } |
1522 |
+ |
1523 |
+@@ -1402,9 +1410,16 @@ static int garmin_port_probe(struct usb_serial_port *port) |
1524 |
+ garmin_data_p->state = 0; |
1525 |
+ garmin_data_p->flags = 0; |
1526 |
+ garmin_data_p->count = 0; |
1527 |
++ init_usb_anchor(&garmin_data_p->write_urbs); |
1528 |
+ usb_set_serial_port_data(port, garmin_data_p); |
1529 |
+ |
1530 |
+ status = garmin_init_session(port); |
1531 |
++ if (status) |
1532 |
++ goto err_free; |
1533 |
++ |
1534 |
++ return 0; |
1535 |
++err_free: |
1536 |
++ kfree(garmin_data_p); |
1537 |
+ |
1538 |
+ return status; |
1539 |
+ } |
1540 |
+@@ -1414,6 +1429,7 @@ static int garmin_port_remove(struct usb_serial_port *port) |
1541 |
+ { |
1542 |
+ struct garmin_data *garmin_data_p = usb_get_serial_port_data(port); |
1543 |
+ |
1544 |
++ usb_kill_anchored_urbs(&garmin_data_p->write_urbs); |
1545 |
+ usb_kill_urb(port->interrupt_in_urb); |
1546 |
+ del_timer_sync(&garmin_data_p->timer); |
1547 |
+ kfree(garmin_data_p); |
1548 |
+diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c |
1549 |
+index e1c1e329c877..4516291df1b8 100644 |
1550 |
+--- a/drivers/usb/serial/qcserial.c |
1551 |
++++ b/drivers/usb/serial/qcserial.c |
1552 |
+@@ -148,6 +148,7 @@ static const struct usb_device_id id_table[] = { |
1553 |
+ {DEVICE_SWI(0x1199, 0x68a2)}, /* Sierra Wireless MC7710 */ |
1554 |
+ {DEVICE_SWI(0x1199, 0x68c0)}, /* Sierra Wireless MC7304/MC7354 */ |
1555 |
+ {DEVICE_SWI(0x1199, 0x901c)}, /* Sierra Wireless EM7700 */ |
1556 |
++ {DEVICE_SWI(0x1199, 0x901e)}, /* Sierra Wireless EM7355 QDL */ |
1557 |
+ {DEVICE_SWI(0x1199, 0x901f)}, /* Sierra Wireless EM7355 */ |
1558 |
+ {DEVICE_SWI(0x1199, 0x9040)}, /* Sierra Wireless Modem */ |
1559 |
+ {DEVICE_SWI(0x1199, 0x9041)}, /* Sierra Wireless MC7305/MC7355 */ |
1560 |
+diff --git a/drivers/video/backlight/adp5520_bl.c b/drivers/video/backlight/adp5520_bl.c |
1561 |
+index dd88ba1d71ce..35373e2065b2 100644 |
1562 |
+--- a/drivers/video/backlight/adp5520_bl.c |
1563 |
++++ b/drivers/video/backlight/adp5520_bl.c |
1564 |
+@@ -332,10 +332,18 @@ static int adp5520_bl_probe(struct platform_device *pdev) |
1565 |
+ } |
1566 |
+ |
1567 |
+ platform_set_drvdata(pdev, bl); |
1568 |
+- ret |= adp5520_bl_setup(bl); |
1569 |
++ ret = adp5520_bl_setup(bl); |
1570 |
++ if (ret) { |
1571 |
++ dev_err(&pdev->dev, "failed to setup\n"); |
1572 |
++ if (data->pdata->en_ambl_sens) |
1573 |
++ sysfs_remove_group(&bl->dev.kobj, |
1574 |
++ &adp5520_bl_attr_group); |
1575 |
++ return ret; |
1576 |
++ } |
1577 |
++ |
1578 |
+ backlight_update_status(bl); |
1579 |
+ |
1580 |
+- return ret; |
1581 |
++ return 0; |
1582 |
+ } |
1583 |
+ |
1584 |
+ static int adp5520_bl_remove(struct platform_device *pdev) |
1585 |
+diff --git a/drivers/video/backlight/lcd.c b/drivers/video/backlight/lcd.c |
1586 |
+index 7de847df224f..4b40c6a4d441 100644 |
1587 |
+--- a/drivers/video/backlight/lcd.c |
1588 |
++++ b/drivers/video/backlight/lcd.c |
1589 |
+@@ -226,6 +226,8 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent, |
1590 |
+ dev_set_name(&new_ld->dev, "%s", name); |
1591 |
+ dev_set_drvdata(&new_ld->dev, devdata); |
1592 |
+ |
1593 |
++ new_ld->ops = ops; |
1594 |
++ |
1595 |
+ rc = device_register(&new_ld->dev); |
1596 |
+ if (rc) { |
1597 |
+ put_device(&new_ld->dev); |
1598 |
+@@ -238,8 +240,6 @@ struct lcd_device *lcd_device_register(const char *name, struct device *parent, |
1599 |
+ return ERR_PTR(rc); |
1600 |
+ } |
1601 |
+ |
1602 |
+- new_ld->ops = ops; |
1603 |
+- |
1604 |
+ return new_ld; |
1605 |
+ } |
1606 |
+ EXPORT_SYMBOL(lcd_device_register); |
1607 |
+diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c |
1608 |
+index 194a6baa4283..4df1cb19a243 100644 |
1609 |
+--- a/fs/ext4/inode.c |
1610 |
++++ b/fs/ext4/inode.c |
1611 |
+@@ -658,6 +658,20 @@ has_zeroout: |
1612 |
+ ret = check_block_validity(inode, map); |
1613 |
+ if (ret != 0) |
1614 |
+ return ret; |
1615 |
++ |
1616 |
++ /* |
1617 |
++ * Inodes with freshly allocated blocks where contents will be |
1618 |
++ * visible after transaction commit must be on transaction's |
1619 |
++ * ordered data list. |
1620 |
++ */ |
1621 |
++ if (map->m_flags & EXT4_MAP_NEW && |
1622 |
++ !(map->m_flags & EXT4_MAP_UNWRITTEN) && |
1623 |
++ !IS_NOQUOTA(inode) && |
1624 |
++ ext4_should_order_data(inode)) { |
1625 |
++ ret = ext4_jbd2_file_inode(handle, inode); |
1626 |
++ if (ret) |
1627 |
++ return ret; |
1628 |
++ } |
1629 |
+ } |
1630 |
+ return retval; |
1631 |
+ } |
1632 |
+@@ -1152,15 +1166,6 @@ static int ext4_write_end(struct file *file, |
1633 |
+ int i_size_changed = 0; |
1634 |
+ |
1635 |
+ trace_ext4_write_end(inode, pos, len, copied); |
1636 |
+- if (ext4_test_inode_state(inode, EXT4_STATE_ORDERED_MODE)) { |
1637 |
+- ret = ext4_jbd2_file_inode(handle, inode); |
1638 |
+- if (ret) { |
1639 |
+- unlock_page(page); |
1640 |
+- page_cache_release(page); |
1641 |
+- goto errout; |
1642 |
+- } |
1643 |
+- } |
1644 |
+- |
1645 |
+ if (ext4_has_inline_data(inode)) { |
1646 |
+ ret = ext4_write_inline_data_end(inode, pos, len, |
1647 |
+ copied, page); |
1648 |
+diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h |
1649 |
+index 4b4b056a6eb0..5148150cc80b 100644 |
1650 |
+--- a/include/asm-generic/memory_model.h |
1651 |
++++ b/include/asm-generic/memory_model.h |
1652 |
+@@ -1,6 +1,8 @@ |
1653 |
+ #ifndef __ASM_MEMORY_MODEL_H |
1654 |
+ #define __ASM_MEMORY_MODEL_H |
1655 |
+ |
1656 |
++#include <linux/pfn.h> |
1657 |
++ |
1658 |
+ #ifndef __ASSEMBLY__ |
1659 |
+ |
1660 |
+ #if defined(CONFIG_FLATMEM) |
1661 |
+@@ -72,7 +74,7 @@ |
1662 |
+ /* |
1663 |
+ * Convert a physical address to a Page Frame Number and back |
1664 |
+ */ |
1665 |
+-#define __phys_to_pfn(paddr) ((unsigned long)((paddr) >> PAGE_SHIFT)) |
1666 |
++#define __phys_to_pfn(paddr) PHYS_PFN(paddr) |
1667 |
+ #define __pfn_to_phys(pfn) PFN_PHYS(pfn) |
1668 |
+ |
1669 |
+ #define page_to_pfn __page_to_pfn |
1670 |
+diff --git a/include/dt-bindings/pinctrl/omap.h b/include/dt-bindings/pinctrl/omap.h |
1671 |
+index 13949259705a..0d4fe32b3ae2 100644 |
1672 |
+--- a/include/dt-bindings/pinctrl/omap.h |
1673 |
++++ b/include/dt-bindings/pinctrl/omap.h |
1674 |
+@@ -45,8 +45,8 @@ |
1675 |
+ #define PIN_OFF_NONE 0 |
1676 |
+ #define PIN_OFF_OUTPUT_HIGH (OFF_EN | OFFOUT_EN | OFFOUT_VAL) |
1677 |
+ #define PIN_OFF_OUTPUT_LOW (OFF_EN | OFFOUT_EN) |
1678 |
+-#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFF_PULL_EN | OFF_PULL_UP) |
1679 |
+-#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN) |
1680 |
++#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFFOUT_EN | OFF_PULL_EN | OFF_PULL_UP) |
1681 |
++#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFFOUT_EN | OFF_PULL_EN) |
1682 |
+ #define PIN_OFF_WAKEUPENABLE WAKEUP_EN |
1683 |
+ |
1684 |
+ /* |
1685 |
+diff --git a/include/linux/pfn.h b/include/linux/pfn.h |
1686 |
+index 7646637221f3..97f3e88aead4 100644 |
1687 |
+--- a/include/linux/pfn.h |
1688 |
++++ b/include/linux/pfn.h |
1689 |
+@@ -9,5 +9,6 @@ |
1690 |
+ #define PFN_UP(x) (((x) + PAGE_SIZE-1) >> PAGE_SHIFT) |
1691 |
+ #define PFN_DOWN(x) ((x) >> PAGE_SHIFT) |
1692 |
+ #define PFN_PHYS(x) ((phys_addr_t)(x) << PAGE_SHIFT) |
1693 |
++#define PHYS_PFN(x) ((unsigned long)((x) >> PAGE_SHIFT)) |
1694 |
+ |
1695 |
+ #endif |
1696 |
+diff --git a/include/uapi/linux/rds.h b/include/uapi/linux/rds.h |
1697 |
+index 7af20a136429..804c9b2bfce3 100644 |
1698 |
+--- a/include/uapi/linux/rds.h |
1699 |
++++ b/include/uapi/linux/rds.h |
1700 |
+@@ -104,8 +104,8 @@ |
1701 |
+ #define RDS_INFO_LAST 10010 |
1702 |
+ |
1703 |
+ struct rds_info_counter { |
1704 |
+- uint8_t name[32]; |
1705 |
+- uint64_t value; |
1706 |
++ __u8 name[32]; |
1707 |
++ __u64 value; |
1708 |
+ } __attribute__((packed)); |
1709 |
+ |
1710 |
+ #define RDS_INFO_CONNECTION_FLAG_SENDING 0x01 |
1711 |
+@@ -115,35 +115,35 @@ struct rds_info_counter { |
1712 |
+ #define TRANSNAMSIZ 16 |
1713 |
+ |
1714 |
+ struct rds_info_connection { |
1715 |
+- uint64_t next_tx_seq; |
1716 |
+- uint64_t next_rx_seq; |
1717 |
++ __u64 next_tx_seq; |
1718 |
++ __u64 next_rx_seq; |
1719 |
+ __be32 laddr; |
1720 |
+ __be32 faddr; |
1721 |
+- uint8_t transport[TRANSNAMSIZ]; /* null term ascii */ |
1722 |
+- uint8_t flags; |
1723 |
++ __u8 transport[TRANSNAMSIZ]; /* null term ascii */ |
1724 |
++ __u8 flags; |
1725 |
+ } __attribute__((packed)); |
1726 |
+ |
1727 |
+ #define RDS_INFO_MESSAGE_FLAG_ACK 0x01 |
1728 |
+ #define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02 |
1729 |
+ |
1730 |
+ struct rds_info_message { |
1731 |
+- uint64_t seq; |
1732 |
+- uint32_t len; |
1733 |
++ __u64 seq; |
1734 |
++ __u32 len; |
1735 |
+ __be32 laddr; |
1736 |
+ __be32 faddr; |
1737 |
+ __be16 lport; |
1738 |
+ __be16 fport; |
1739 |
+- uint8_t flags; |
1740 |
++ __u8 flags; |
1741 |
+ } __attribute__((packed)); |
1742 |
+ |
1743 |
+ struct rds_info_socket { |
1744 |
+- uint32_t sndbuf; |
1745 |
++ __u32 sndbuf; |
1746 |
+ __be32 bound_addr; |
1747 |
+ __be32 connected_addr; |
1748 |
+ __be16 bound_port; |
1749 |
+ __be16 connected_port; |
1750 |
+- uint32_t rcvbuf; |
1751 |
+- uint64_t inum; |
1752 |
++ __u32 rcvbuf; |
1753 |
++ __u64 inum; |
1754 |
+ } __attribute__((packed)); |
1755 |
+ |
1756 |
+ struct rds_info_tcp_socket { |
1757 |
+@@ -151,25 +151,25 @@ struct rds_info_tcp_socket { |
1758 |
+ __be16 local_port; |
1759 |
+ __be32 peer_addr; |
1760 |
+ __be16 peer_port; |
1761 |
+- uint64_t hdr_rem; |
1762 |
+- uint64_t data_rem; |
1763 |
+- uint32_t last_sent_nxt; |
1764 |
+- uint32_t last_expected_una; |
1765 |
+- uint32_t last_seen_una; |
1766 |
++ __u64 hdr_rem; |
1767 |
++ __u64 data_rem; |
1768 |
++ __u32 last_sent_nxt; |
1769 |
++ __u32 last_expected_una; |
1770 |
++ __u32 last_seen_una; |
1771 |
+ } __attribute__((packed)); |
1772 |
+ |
1773 |
+ #define RDS_IB_GID_LEN 16 |
1774 |
+ struct rds_info_rdma_connection { |
1775 |
+ __be32 src_addr; |
1776 |
+ __be32 dst_addr; |
1777 |
+- uint8_t src_gid[RDS_IB_GID_LEN]; |
1778 |
+- uint8_t dst_gid[RDS_IB_GID_LEN]; |
1779 |
++ __u8 src_gid[RDS_IB_GID_LEN]; |
1780 |
++ __u8 dst_gid[RDS_IB_GID_LEN]; |
1781 |
+ |
1782 |
+- uint32_t max_send_wr; |
1783 |
+- uint32_t max_recv_wr; |
1784 |
+- uint32_t max_send_sge; |
1785 |
+- uint32_t rdma_mr_max; |
1786 |
+- uint32_t rdma_mr_size; |
1787 |
++ __u32 max_send_wr; |
1788 |
++ __u32 max_recv_wr; |
1789 |
++ __u32 max_send_sge; |
1790 |
++ __u32 rdma_mr_max; |
1791 |
++ __u32 rdma_mr_size; |
1792 |
+ }; |
1793 |
+ |
1794 |
+ /* |
1795 |
+@@ -210,70 +210,70 @@ struct rds_info_rdma_connection { |
1796 |
+ * (so that the application does not have to worry about |
1797 |
+ * alignment). |
1798 |
+ */ |
1799 |
+-typedef uint64_t rds_rdma_cookie_t; |
1800 |
++typedef __u64 rds_rdma_cookie_t; |
1801 |
+ |
1802 |
+ struct rds_iovec { |
1803 |
+- uint64_t addr; |
1804 |
+- uint64_t bytes; |
1805 |
++ __u64 addr; |
1806 |
++ __u64 bytes; |
1807 |
+ }; |
1808 |
+ |
1809 |
+ struct rds_get_mr_args { |
1810 |
+ struct rds_iovec vec; |
1811 |
+- uint64_t cookie_addr; |
1812 |
+- uint64_t flags; |
1813 |
++ __u64 cookie_addr; |
1814 |
++ __u64 flags; |
1815 |
+ }; |
1816 |
+ |
1817 |
+ struct rds_get_mr_for_dest_args { |
1818 |
+ struct __kernel_sockaddr_storage dest_addr; |
1819 |
+ struct rds_iovec vec; |
1820 |
+- uint64_t cookie_addr; |
1821 |
+- uint64_t flags; |
1822 |
++ __u64 cookie_addr; |
1823 |
++ __u64 flags; |
1824 |
+ }; |
1825 |
+ |
1826 |
+ struct rds_free_mr_args { |
1827 |
+ rds_rdma_cookie_t cookie; |
1828 |
+- uint64_t flags; |
1829 |
++ __u64 flags; |
1830 |
+ }; |
1831 |
+ |
1832 |
+ struct rds_rdma_args { |
1833 |
+ rds_rdma_cookie_t cookie; |
1834 |
+ struct rds_iovec remote_vec; |
1835 |
+- uint64_t local_vec_addr; |
1836 |
+- uint64_t nr_local; |
1837 |
+- uint64_t flags; |
1838 |
+- uint64_t user_token; |
1839 |
++ __u64 local_vec_addr; |
1840 |
++ __u64 nr_local; |
1841 |
++ __u64 flags; |
1842 |
++ __u64 user_token; |
1843 |
+ }; |
1844 |
+ |
1845 |
+ struct rds_atomic_args { |
1846 |
+ rds_rdma_cookie_t cookie; |
1847 |
+- uint64_t local_addr; |
1848 |
+- uint64_t remote_addr; |
1849 |
++ __u64 local_addr; |
1850 |
++ __u64 remote_addr; |
1851 |
+ union { |
1852 |
+ struct { |
1853 |
+- uint64_t compare; |
1854 |
+- uint64_t swap; |
1855 |
++ __u64 compare; |
1856 |
++ __u64 swap; |
1857 |
+ } cswp; |
1858 |
+ struct { |
1859 |
+- uint64_t add; |
1860 |
++ __u64 add; |
1861 |
+ } fadd; |
1862 |
+ struct { |
1863 |
+- uint64_t compare; |
1864 |
+- uint64_t swap; |
1865 |
+- uint64_t compare_mask; |
1866 |
+- uint64_t swap_mask; |
1867 |
++ __u64 compare; |
1868 |
++ __u64 swap; |
1869 |
++ __u64 compare_mask; |
1870 |
++ __u64 swap_mask; |
1871 |
+ } m_cswp; |
1872 |
+ struct { |
1873 |
+- uint64_t add; |
1874 |
+- uint64_t nocarry_mask; |
1875 |
++ __u64 add; |
1876 |
++ __u64 nocarry_mask; |
1877 |
+ } m_fadd; |
1878 |
+ }; |
1879 |
+- uint64_t flags; |
1880 |
+- uint64_t user_token; |
1881 |
++ __u64 flags; |
1882 |
++ __u64 user_token; |
1883 |
+ }; |
1884 |
+ |
1885 |
+ struct rds_rdma_notify { |
1886 |
+- uint64_t user_token; |
1887 |
+- int32_t status; |
1888 |
++ __u64 user_token; |
1889 |
++ __s32 status; |
1890 |
+ }; |
1891 |
+ |
1892 |
+ #define RDS_RDMA_SUCCESS 0 |
1893 |
+diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c |
1894 |
+index 70dc6dcf8649..eb759f5008b8 100644 |
1895 |
+--- a/kernel/bpf/verifier.c |
1896 |
++++ b/kernel/bpf/verifier.c |
1897 |
+@@ -313,7 +313,8 @@ static const char *const bpf_jmp_string[16] = { |
1898 |
+ [BPF_EXIT >> 4] = "exit", |
1899 |
+ }; |
1900 |
+ |
1901 |
+-static void print_bpf_insn(struct bpf_insn *insn) |
1902 |
++static void print_bpf_insn(const struct verifier_env *env, |
1903 |
++ const struct bpf_insn *insn) |
1904 |
+ { |
1905 |
+ u8 class = BPF_CLASS(insn->code); |
1906 |
+ |
1907 |
+@@ -377,9 +378,19 @@ static void print_bpf_insn(struct bpf_insn *insn) |
1908 |
+ insn->code, |
1909 |
+ bpf_ldst_string[BPF_SIZE(insn->code) >> 3], |
1910 |
+ insn->src_reg, insn->imm); |
1911 |
+- } else if (BPF_MODE(insn->code) == BPF_IMM) { |
1912 |
+- verbose("(%02x) r%d = 0x%x\n", |
1913 |
+- insn->code, insn->dst_reg, insn->imm); |
1914 |
++ } else if (BPF_MODE(insn->code) == BPF_IMM && |
1915 |
++ BPF_SIZE(insn->code) == BPF_DW) { |
1916 |
++ /* At this point, we already made sure that the second |
1917 |
++ * part of the ldimm64 insn is accessible. |
1918 |
++ */ |
1919 |
++ u64 imm = ((u64)(insn + 1)->imm << 32) | (u32)insn->imm; |
1920 |
++ bool map_ptr = insn->src_reg == BPF_PSEUDO_MAP_FD; |
1921 |
++ |
1922 |
++ if (map_ptr && !env->allow_ptr_leaks) |
1923 |
++ imm = 0; |
1924 |
++ |
1925 |
++ verbose("(%02x) r%d = 0x%llx\n", insn->code, |
1926 |
++ insn->dst_reg, (unsigned long long)imm); |
1927 |
+ } else { |
1928 |
+ verbose("BUG_ld_%02x\n", insn->code); |
1929 |
+ return; |
1930 |
+@@ -1764,7 +1775,7 @@ static int do_check(struct verifier_env *env) |
1931 |
+ |
1932 |
+ if (log_level) { |
1933 |
+ verbose("%d: ", insn_idx); |
1934 |
+- print_bpf_insn(insn); |
1935 |
++ print_bpf_insn(env, insn); |
1936 |
+ } |
1937 |
+ |
1938 |
+ if (class == BPF_ALU || class == BPF_ALU64) { |
1939 |
+diff --git a/net/sctp/socket.c b/net/sctp/socket.c |
1940 |
+index 73eec73ff733..7f0f689b8d2b 100644 |
1941 |
+--- a/net/sctp/socket.c |
1942 |
++++ b/net/sctp/socket.c |
1943 |
+@@ -4453,6 +4453,10 @@ int sctp_do_peeloff(struct sock *sk, sctp_assoc_t id, struct socket **sockp) |
1944 |
+ struct socket *sock; |
1945 |
+ int err = 0; |
1946 |
+ |
1947 |
++ /* Do not peel off from one netns to another one. */ |
1948 |
++ if (!net_eq(current->nsproxy->net_ns, sock_net(sk))) |
1949 |
++ return -EINVAL; |
1950 |
++ |
1951 |
+ if (!asoc) |
1952 |
+ return -EINVAL; |
1953 |
+ |
1954 |
+diff --git a/sound/drivers/vx/vx_pcm.c b/sound/drivers/vx/vx_pcm.c |
1955 |
+index 11467272089e..ea7b377f0378 100644 |
1956 |
+--- a/sound/drivers/vx/vx_pcm.c |
1957 |
++++ b/sound/drivers/vx/vx_pcm.c |
1958 |
+@@ -1015,7 +1015,7 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream |
1959 |
+ int size, space, count; |
1960 |
+ struct snd_pcm_runtime *runtime = subs->runtime; |
1961 |
+ |
1962 |
+- if (! pipe->prepared || (chip->chip_status & VX_STAT_IS_STALE)) |
1963 |
++ if (!pipe->running || (chip->chip_status & VX_STAT_IS_STALE)) |
1964 |
+ return; |
1965 |
+ |
1966 |
+ size = runtime->buffer_size - snd_pcm_capture_avail(runtime); |
1967 |
+@@ -1048,8 +1048,10 @@ static void vx_pcm_capture_update(struct vx_core *chip, struct snd_pcm_substream |
1968 |
+ /* ok, let's accelerate! */ |
1969 |
+ int align = pipe->align * 3; |
1970 |
+ space = (count / align) * align; |
1971 |
+- vx_pseudo_dma_read(chip, runtime, pipe, space); |
1972 |
+- count -= space; |
1973 |
++ if (space > 0) { |
1974 |
++ vx_pseudo_dma_read(chip, runtime, pipe, space); |
1975 |
++ count -= space; |
1976 |
++ } |
1977 |
+ } |
1978 |
+ /* read the rest of bytes */ |
1979 |
+ while (count > 0) { |
1980 |
+diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c |
1981 |
+index a83688f8672e..af0962307b7f 100644 |
1982 |
+--- a/sound/pci/hda/patch_realtek.c |
1983 |
++++ b/sound/pci/hda/patch_realtek.c |
1984 |
+@@ -338,6 +338,7 @@ static void alc_fill_eapd_coef(struct hda_codec *codec) |
1985 |
+ case 0x10ec0288: |
1986 |
+ case 0x10ec0295: |
1987 |
+ case 0x10ec0298: |
1988 |
++ case 0x10ec0299: |
1989 |
+ alc_update_coef_idx(codec, 0x10, 1<<9, 0); |
1990 |
+ break; |
1991 |
+ case 0x10ec0285: |
1992 |
+@@ -914,6 +915,7 @@ static struct alc_codec_rename_pci_table rename_pci_tbl[] = { |
1993 |
+ { 0x10ec0256, 0x1028, 0, "ALC3246" }, |
1994 |
+ { 0x10ec0225, 0x1028, 0, "ALC3253" }, |
1995 |
+ { 0x10ec0295, 0x1028, 0, "ALC3254" }, |
1996 |
++ { 0x10ec0299, 0x1028, 0, "ALC3271" }, |
1997 |
+ { 0x10ec0670, 0x1025, 0, "ALC669X" }, |
1998 |
+ { 0x10ec0676, 0x1025, 0, "ALC679X" }, |
1999 |
+ { 0x10ec0282, 0x1043, 0, "ALC3229" }, |
2000 |
+@@ -3721,6 +3723,7 @@ static void alc_headset_mode_unplugged(struct hda_codec *codec) |
2001 |
+ break; |
2002 |
+ case 0x10ec0225: |
2003 |
+ case 0x10ec0295: |
2004 |
++ case 0x10ec0299: |
2005 |
+ alc_process_coef_fw(codec, coef0225); |
2006 |
+ break; |
2007 |
+ } |
2008 |
+@@ -3823,6 +3826,7 @@ static void alc_headset_mode_mic_in(struct hda_codec *codec, hda_nid_t hp_pin, |
2009 |
+ break; |
2010 |
+ case 0x10ec0225: |
2011 |
+ case 0x10ec0295: |
2012 |
++ case 0x10ec0299: |
2013 |
+ alc_update_coef_idx(codec, 0x45, 0x3f<<10, 0x31<<10); |
2014 |
+ snd_hda_set_pin_ctl_cache(codec, hp_pin, 0); |
2015 |
+ alc_process_coef_fw(codec, coef0225); |
2016 |
+@@ -3881,6 +3885,7 @@ static void alc_headset_mode_default(struct hda_codec *codec) |
2017 |
+ switch (codec->core.vendor_id) { |
2018 |
+ case 0x10ec0225: |
2019 |
+ case 0x10ec0295: |
2020 |
++ case 0x10ec0299: |
2021 |
+ alc_process_coef_fw(codec, coef0225); |
2022 |
+ break; |
2023 |
+ case 0x10ec0236: |
2024 |
+@@ -3995,6 +4000,7 @@ static void alc_headset_mode_ctia(struct hda_codec *codec) |
2025 |
+ break; |
2026 |
+ case 0x10ec0225: |
2027 |
+ case 0x10ec0295: |
2028 |
++ case 0x10ec0299: |
2029 |
+ alc_process_coef_fw(codec, coef0225); |
2030 |
+ break; |
2031 |
+ } |
2032 |
+@@ -4086,6 +4092,7 @@ static void alc_headset_mode_omtp(struct hda_codec *codec) |
2033 |
+ break; |
2034 |
+ case 0x10ec0225: |
2035 |
+ case 0x10ec0295: |
2036 |
++ case 0x10ec0299: |
2037 |
+ alc_process_coef_fw(codec, coef0225); |
2038 |
+ break; |
2039 |
+ } |
2040 |
+@@ -4171,6 +4178,7 @@ static void alc_determine_headset_type(struct hda_codec *codec) |
2041 |
+ break; |
2042 |
+ case 0x10ec0225: |
2043 |
+ case 0x10ec0295: |
2044 |
++ case 0x10ec0299: |
2045 |
+ alc_process_coef_fw(codec, coef0225); |
2046 |
+ msleep(800); |
2047 |
+ val = alc_read_coef_idx(codec, 0x46); |
2048 |
+@@ -6233,6 +6241,7 @@ static int patch_alc269(struct hda_codec *codec) |
2049 |
+ break; |
2050 |
+ case 0x10ec0225: |
2051 |
+ case 0x10ec0295: |
2052 |
++ case 0x10ec0299: |
2053 |
+ spec->codec_variant = ALC269_TYPE_ALC225; |
2054 |
+ break; |
2055 |
+ case 0x10ec0234: |
2056 |
+@@ -7191,6 +7200,7 @@ static const struct hda_device_id snd_hda_id_realtek[] = { |
2057 |
+ HDA_CODEC_ENTRY(0x10ec0294, "ALC294", patch_alc269), |
2058 |
+ HDA_CODEC_ENTRY(0x10ec0295, "ALC295", patch_alc269), |
2059 |
+ HDA_CODEC_ENTRY(0x10ec0298, "ALC298", patch_alc269), |
2060 |
++ HDA_CODEC_ENTRY(0x10ec0299, "ALC299", patch_alc269), |
2061 |
+ HDA_CODEC_REV_ENTRY(0x10ec0861, 0x100340, "ALC660", patch_alc861), |
2062 |
+ HDA_CODEC_ENTRY(0x10ec0660, "ALC660-VD", patch_alc861vd), |
2063 |
+ HDA_CODEC_ENTRY(0x10ec0861, "ALC861", patch_alc861), |
2064 |
+diff --git a/sound/pci/vx222/vx222_ops.c b/sound/pci/vx222/vx222_ops.c |
2065 |
+index af83b3b38052..8e457ea27f89 100644 |
2066 |
+--- a/sound/pci/vx222/vx222_ops.c |
2067 |
++++ b/sound/pci/vx222/vx222_ops.c |
2068 |
+@@ -269,12 +269,12 @@ static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2069 |
+ |
2070 |
+ /* Transfer using pseudo-dma. |
2071 |
+ */ |
2072 |
+- if (offset + count > pipe->buffer_bytes) { |
2073 |
++ if (offset + count >= pipe->buffer_bytes) { |
2074 |
+ int length = pipe->buffer_bytes - offset; |
2075 |
+ count -= length; |
2076 |
+ length >>= 2; /* in 32bit words */ |
2077 |
+ /* Transfer using pseudo-dma. */ |
2078 |
+- while (length-- > 0) { |
2079 |
++ for (; length > 0; length--) { |
2080 |
+ outl(cpu_to_le32(*addr), port); |
2081 |
+ addr++; |
2082 |
+ } |
2083 |
+@@ -284,7 +284,7 @@ static void vx2_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2084 |
+ pipe->hw_ptr += count; |
2085 |
+ count >>= 2; /* in 32bit words */ |
2086 |
+ /* Transfer using pseudo-dma. */ |
2087 |
+- while (count-- > 0) { |
2088 |
++ for (; count > 0; count--) { |
2089 |
+ outl(cpu_to_le32(*addr), port); |
2090 |
+ addr++; |
2091 |
+ } |
2092 |
+@@ -307,12 +307,12 @@ static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2093 |
+ vx2_setup_pseudo_dma(chip, 0); |
2094 |
+ /* Transfer using pseudo-dma. |
2095 |
+ */ |
2096 |
+- if (offset + count > pipe->buffer_bytes) { |
2097 |
++ if (offset + count >= pipe->buffer_bytes) { |
2098 |
+ int length = pipe->buffer_bytes - offset; |
2099 |
+ count -= length; |
2100 |
+ length >>= 2; /* in 32bit words */ |
2101 |
+ /* Transfer using pseudo-dma. */ |
2102 |
+- while (length-- > 0) |
2103 |
++ for (; length > 0; length--) |
2104 |
+ *addr++ = le32_to_cpu(inl(port)); |
2105 |
+ addr = (u32 *)runtime->dma_area; |
2106 |
+ pipe->hw_ptr = 0; |
2107 |
+@@ -320,7 +320,7 @@ static void vx2_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2108 |
+ pipe->hw_ptr += count; |
2109 |
+ count >>= 2; /* in 32bit words */ |
2110 |
+ /* Transfer using pseudo-dma. */ |
2111 |
+- while (count-- > 0) |
2112 |
++ for (; count > 0; count--) |
2113 |
+ *addr++ = le32_to_cpu(inl(port)); |
2114 |
+ |
2115 |
+ vx2_release_pseudo_dma(chip); |
2116 |
+diff --git a/sound/pcmcia/vx/vxp_ops.c b/sound/pcmcia/vx/vxp_ops.c |
2117 |
+index 281972913c32..56aa1ba73ccc 100644 |
2118 |
+--- a/sound/pcmcia/vx/vxp_ops.c |
2119 |
++++ b/sound/pcmcia/vx/vxp_ops.c |
2120 |
+@@ -369,12 +369,12 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2121 |
+ unsigned short *addr = (unsigned short *)(runtime->dma_area + offset); |
2122 |
+ |
2123 |
+ vx_setup_pseudo_dma(chip, 1); |
2124 |
+- if (offset + count > pipe->buffer_bytes) { |
2125 |
++ if (offset + count >= pipe->buffer_bytes) { |
2126 |
+ int length = pipe->buffer_bytes - offset; |
2127 |
+ count -= length; |
2128 |
+ length >>= 1; /* in 16bit words */ |
2129 |
+ /* Transfer using pseudo-dma. */ |
2130 |
+- while (length-- > 0) { |
2131 |
++ for (; length > 0; length--) { |
2132 |
+ outw(cpu_to_le16(*addr), port); |
2133 |
+ addr++; |
2134 |
+ } |
2135 |
+@@ -384,7 +384,7 @@ static void vxp_dma_write(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2136 |
+ pipe->hw_ptr += count; |
2137 |
+ count >>= 1; /* in 16bit words */ |
2138 |
+ /* Transfer using pseudo-dma. */ |
2139 |
+- while (count-- > 0) { |
2140 |
++ for (; count > 0; count--) { |
2141 |
+ outw(cpu_to_le16(*addr), port); |
2142 |
+ addr++; |
2143 |
+ } |
2144 |
+@@ -411,12 +411,12 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2145 |
+ if (snd_BUG_ON(count % 2)) |
2146 |
+ return; |
2147 |
+ vx_setup_pseudo_dma(chip, 0); |
2148 |
+- if (offset + count > pipe->buffer_bytes) { |
2149 |
++ if (offset + count >= pipe->buffer_bytes) { |
2150 |
+ int length = pipe->buffer_bytes - offset; |
2151 |
+ count -= length; |
2152 |
+ length >>= 1; /* in 16bit words */ |
2153 |
+ /* Transfer using pseudo-dma. */ |
2154 |
+- while (length-- > 0) |
2155 |
++ for (; length > 0; length--) |
2156 |
+ *addr++ = le16_to_cpu(inw(port)); |
2157 |
+ addr = (unsigned short *)runtime->dma_area; |
2158 |
+ pipe->hw_ptr = 0; |
2159 |
+@@ -424,7 +424,7 @@ static void vxp_dma_read(struct vx_core *chip, struct snd_pcm_runtime *runtime, |
2160 |
+ pipe->hw_ptr += count; |
2161 |
+ count >>= 1; /* in 16bit words */ |
2162 |
+ /* Transfer using pseudo-dma. */ |
2163 |
+- while (count-- > 1) |
2164 |
++ for (; count > 1; count--) |
2165 |
+ *addr++ = le16_to_cpu(inw(port)); |
2166 |
+ /* Disable DMA */ |
2167 |
+ pchip->regDIALOG &= ~VXP_DLG_DMAREAD_SEL_MASK; |