Magellan Linux

Contents of /trunk/kernel26-alx/patches-3.10/0131-3.10.32-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2672 - (show annotations) (download)
Tue Jul 21 16:46:35 2015 UTC (8 years, 9 months ago) by niro
File size: 68405 byte(s)
-3.10.84-alx-r1
1 diff --git a/Makefile b/Makefile
2 index 56b93edbbe4e..aab192446f50 100644
3 --- a/Makefile
4 +++ b/Makefile
5 @@ -1,6 +1,6 @@
6 VERSION = 3
7 PATCHLEVEL = 10
8 -SUBLEVEL = 31
9 +SUBLEVEL = 32
10 EXTRAVERSION =
11 NAME = TOSSUG Baby Fish
12
13 diff --git a/arch/s390/kernel/head64.S b/arch/s390/kernel/head64.S
14 index b9e25ae2579c..d7c00507568a 100644
15 --- a/arch/s390/kernel/head64.S
16 +++ b/arch/s390/kernel/head64.S
17 @@ -59,7 +59,7 @@ ENTRY(startup_continue)
18 .quad 0 # cr12: tracing off
19 .quad 0 # cr13: home space segment table
20 .quad 0xc0000000 # cr14: machine check handling off
21 - .quad 0 # cr15: linkage stack operations
22 + .quad .Llinkage_stack # cr15: linkage stack operations
23 .Lpcmsk:.quad 0x0000000180000000
24 .L4malign:.quad 0xffffffffffc00000
25 .Lscan2g:.quad 0x80000000 + 0x20000 - 8 # 2GB + 128K - 8
26 @@ -67,12 +67,15 @@ ENTRY(startup_continue)
27 .Lparmaddr:
28 .quad PARMAREA
29 .align 64
30 -.Lduct: .long 0,0,0,0,.Lduald,0,0,0
31 +.Lduct: .long 0,.Laste,.Laste,0,.Lduald,0,0,0
32 .long 0,0,0,0,0,0,0,0
33 +.Laste: .quad 0,0xffffffffffffffff,0,0,0,0,0,0
34 .align 128
35 .Lduald:.rept 8
36 .long 0x80000000,0,0,0 # invalid access-list entries
37 .endr
38 +.Llinkage_stack:
39 + .long 0,0,0x89000000,0,0,0,0x8a000000,0
40
41 ENTRY(_ehead)
42
43 diff --git a/arch/s390/mm/page-states.c b/arch/s390/mm/page-states.c
44 index a90d45e9dfb0..27c50f4d90cb 100644
45 --- a/arch/s390/mm/page-states.c
46 +++ b/arch/s390/mm/page-states.c
47 @@ -12,6 +12,8 @@
48 #include <linux/mm.h>
49 #include <linux/gfp.h>
50 #include <linux/init.h>
51 +#include <asm/setup.h>
52 +#include <asm/ipl.h>
53
54 #define ESSA_SET_STABLE 1
55 #define ESSA_SET_UNUSED 2
56 @@ -41,6 +43,14 @@ void __init cmma_init(void)
57
58 if (!cmma_flag)
59 return;
60 + /*
61 + * Disable CMM for dump, otherwise the tprot based memory
62 + * detection can fail because of unstable pages.
63 + */
64 + if (OLDMEM_BASE || ipl_info.type == IPL_TYPE_FCP_DUMP) {
65 + cmma_flag = 0;
66 + return;
67 + }
68 asm volatile(
69 " .insn rrf,0xb9ab0000,%1,%1,0,0\n"
70 "0: la %0,0\n"
71 diff --git a/arch/x86/include/asm/xen/page.h b/arch/x86/include/asm/xen/page.h
72 index 6aef9fbc09b7..b913915e8e63 100644
73 --- a/arch/x86/include/asm/xen/page.h
74 +++ b/arch/x86/include/asm/xen/page.h
75 @@ -79,30 +79,38 @@ static inline int phys_to_machine_mapping_valid(unsigned long pfn)
76 return get_phys_to_machine(pfn) != INVALID_P2M_ENTRY;
77 }
78
79 -static inline unsigned long mfn_to_pfn(unsigned long mfn)
80 +static inline unsigned long mfn_to_pfn_no_overrides(unsigned long mfn)
81 {
82 unsigned long pfn;
83 - int ret = 0;
84 + int ret;
85
86 if (xen_feature(XENFEAT_auto_translated_physmap))
87 return mfn;
88
89 - if (unlikely(mfn >= machine_to_phys_nr)) {
90 - pfn = ~0;
91 - goto try_override;
92 - }
93 - pfn = 0;
94 + if (unlikely(mfn >= machine_to_phys_nr))
95 + return ~0;
96 +
97 /*
98 * The array access can fail (e.g., device space beyond end of RAM).
99 * In such cases it doesn't matter what we return (we return garbage),
100 * but we must handle the fault without crashing!
101 */
102 ret = __get_user(pfn, &machine_to_phys_mapping[mfn]);
103 -try_override:
104 - /* ret might be < 0 if there are no entries in the m2p for mfn */
105 if (ret < 0)
106 - pfn = ~0;
107 - else if (get_phys_to_machine(pfn) != mfn)
108 + return ~0;
109 +
110 + return pfn;
111 +}
112 +
113 +static inline unsigned long mfn_to_pfn(unsigned long mfn)
114 +{
115 + unsigned long pfn;
116 +
117 + if (xen_feature(XENFEAT_auto_translated_physmap))
118 + return mfn;
119 +
120 + pfn = mfn_to_pfn_no_overrides(mfn);
121 + if (get_phys_to_machine(pfn) != mfn) {
122 /*
123 * If this appears to be a foreign mfn (because the pfn
124 * doesn't map back to the mfn), then check the local override
125 @@ -111,6 +119,7 @@ try_override:
126 * m2p_find_override_pfn returns ~0 if it doesn't find anything.
127 */
128 pfn = m2p_find_override_pfn(mfn, ~0);
129 + }
130
131 /*
132 * pfn is ~0 if there are no entries in the m2p for mfn or if the
133 diff --git a/arch/x86/kernel/cpu/common.c b/arch/x86/kernel/cpu/common.c
134 index 22018f70a671..deeb48d9459b 100644
135 --- a/arch/x86/kernel/cpu/common.c
136 +++ b/arch/x86/kernel/cpu/common.c
137 @@ -284,8 +284,13 @@ static __always_inline void setup_smap(struct cpuinfo_x86 *c)
138 raw_local_save_flags(eflags);
139 BUG_ON(eflags & X86_EFLAGS_AC);
140
141 - if (cpu_has(c, X86_FEATURE_SMAP))
142 + if (cpu_has(c, X86_FEATURE_SMAP)) {
143 +#ifdef CONFIG_X86_SMAP
144 set_in_cr4(X86_CR4_SMAP);
145 +#else
146 + clear_in_cr4(X86_CR4_SMAP);
147 +#endif
148 + }
149 }
150
151 /*
152 diff --git a/arch/x86/kernel/ftrace.c b/arch/x86/kernel/ftrace.c
153 index d4bdd253fea7..e6253195a301 100644
154 --- a/arch/x86/kernel/ftrace.c
155 +++ b/arch/x86/kernel/ftrace.c
156 @@ -77,8 +77,7 @@ within(unsigned long addr, unsigned long start, unsigned long end)
157 return addr >= start && addr < end;
158 }
159
160 -static int
161 -do_ftrace_mod_code(unsigned long ip, const void *new_code)
162 +static unsigned long text_ip_addr(unsigned long ip)
163 {
164 /*
165 * On x86_64, kernel text mappings are mapped read-only with
166 @@ -91,7 +90,7 @@ do_ftrace_mod_code(unsigned long ip, const void *new_code)
167 if (within(ip, (unsigned long)_text, (unsigned long)_etext))
168 ip = (unsigned long)__va(__pa_symbol(ip));
169
170 - return probe_kernel_write((void *)ip, new_code, MCOUNT_INSN_SIZE);
171 + return ip;
172 }
173
174 static const unsigned char *ftrace_nop_replace(void)
175 @@ -123,8 +122,10 @@ ftrace_modify_code_direct(unsigned long ip, unsigned const char *old_code,
176 if (memcmp(replaced, old_code, MCOUNT_INSN_SIZE) != 0)
177 return -EINVAL;
178
179 + ip = text_ip_addr(ip);
180 +
181 /* replace the text with the new text */
182 - if (do_ftrace_mod_code(ip, new_code))
183 + if (probe_kernel_write((void *)ip, new_code, MCOUNT_INSN_SIZE))
184 return -EPERM;
185
186 sync_core();
187 @@ -221,37 +222,51 @@ int ftrace_modify_call(struct dyn_ftrace *rec, unsigned long old_addr,
188 return -EINVAL;
189 }
190
191 -int ftrace_update_ftrace_func(ftrace_func_t func)
192 +static unsigned long ftrace_update_func;
193 +
194 +static int update_ftrace_func(unsigned long ip, void *new)
195 {
196 - unsigned long ip = (unsigned long)(&ftrace_call);
197 - unsigned char old[MCOUNT_INSN_SIZE], *new;
198 + unsigned char old[MCOUNT_INSN_SIZE];
199 int ret;
200
201 - memcpy(old, &ftrace_call, MCOUNT_INSN_SIZE);
202 - new = ftrace_call_replace(ip, (unsigned long)func);
203 + memcpy(old, (void *)ip, MCOUNT_INSN_SIZE);
204 +
205 + ftrace_update_func = ip;
206 + /* Make sure the breakpoints see the ftrace_update_func update */
207 + smp_wmb();
208
209 /* See comment above by declaration of modifying_ftrace_code */
210 atomic_inc(&modifying_ftrace_code);
211
212 ret = ftrace_modify_code(ip, old, new);
213
214 + atomic_dec(&modifying_ftrace_code);
215 +
216 + return ret;
217 +}
218 +
219 +int ftrace_update_ftrace_func(ftrace_func_t func)
220 +{
221 + unsigned long ip = (unsigned long)(&ftrace_call);
222 + unsigned char *new;
223 + int ret;
224 +
225 + new = ftrace_call_replace(ip, (unsigned long)func);
226 + ret = update_ftrace_func(ip, new);
227 +
228 /* Also update the regs callback function */
229 if (!ret) {
230 ip = (unsigned long)(&ftrace_regs_call);
231 - memcpy(old, &ftrace_regs_call, MCOUNT_INSN_SIZE);
232 new = ftrace_call_replace(ip, (unsigned long)func);
233 - ret = ftrace_modify_code(ip, old, new);
234 + ret = update_ftrace_func(ip, new);
235 }
236
237 - atomic_dec(&modifying_ftrace_code);
238 -
239 return ret;
240 }
241
242 static int is_ftrace_caller(unsigned long ip)
243 {
244 - if (ip == (unsigned long)(&ftrace_call) ||
245 - ip == (unsigned long)(&ftrace_regs_call))
246 + if (ip == ftrace_update_func)
247 return 1;
248
249 return 0;
250 @@ -677,45 +692,41 @@ int __init ftrace_dyn_arch_init(void *data)
251 #ifdef CONFIG_DYNAMIC_FTRACE
252 extern void ftrace_graph_call(void);
253
254 -static int ftrace_mod_jmp(unsigned long ip,
255 - int old_offset, int new_offset)
256 +static unsigned char *ftrace_jmp_replace(unsigned long ip, unsigned long addr)
257 {
258 - unsigned char code[MCOUNT_INSN_SIZE];
259 + static union ftrace_code_union calc;
260
261 - if (probe_kernel_read(code, (void *)ip, MCOUNT_INSN_SIZE))
262 - return -EFAULT;
263 + /* Jmp not a call (ignore the .e8) */
264 + calc.e8 = 0xe9;
265 + calc.offset = ftrace_calc_offset(ip + MCOUNT_INSN_SIZE, addr);
266
267 - if (code[0] != 0xe9 || old_offset != *(int *)(&code[1]))
268 - return -EINVAL;
269 + /*
270 + * ftrace external locks synchronize the access to the static variable.
271 + */
272 + return calc.code;
273 +}
274
275 - *(int *)(&code[1]) = new_offset;
276 +static int ftrace_mod_jmp(unsigned long ip, void *func)
277 +{
278 + unsigned char *new;
279
280 - if (do_ftrace_mod_code(ip, &code))
281 - return -EPERM;
282 + new = ftrace_jmp_replace(ip, (unsigned long)func);
283
284 - return 0;
285 + return update_ftrace_func(ip, new);
286 }
287
288 int ftrace_enable_ftrace_graph_caller(void)
289 {
290 unsigned long ip = (unsigned long)(&ftrace_graph_call);
291 - int old_offset, new_offset;
292
293 - old_offset = (unsigned long)(&ftrace_stub) - (ip + MCOUNT_INSN_SIZE);
294 - new_offset = (unsigned long)(&ftrace_graph_caller) - (ip + MCOUNT_INSN_SIZE);
295 -
296 - return ftrace_mod_jmp(ip, old_offset, new_offset);
297 + return ftrace_mod_jmp(ip, &ftrace_graph_caller);
298 }
299
300 int ftrace_disable_ftrace_graph_caller(void)
301 {
302 unsigned long ip = (unsigned long)(&ftrace_graph_call);
303 - int old_offset, new_offset;
304 -
305 - old_offset = (unsigned long)(&ftrace_graph_caller) - (ip + MCOUNT_INSN_SIZE);
306 - new_offset = (unsigned long)(&ftrace_stub) - (ip + MCOUNT_INSN_SIZE);
307
308 - return ftrace_mod_jmp(ip, old_offset, new_offset);
309 + return ftrace_mod_jmp(ip, &ftrace_stub);
310 }
311
312 #endif /* !CONFIG_DYNAMIC_FTRACE */
313 diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
314 index 654be4ae3047..c1e9e4cbbd76 100644
315 --- a/arch/x86/mm/fault.c
316 +++ b/arch/x86/mm/fault.c
317 @@ -989,6 +989,12 @@ static int fault_in_kernel_space(unsigned long address)
318
319 static inline bool smap_violation(int error_code, struct pt_regs *regs)
320 {
321 + if (!IS_ENABLED(CONFIG_X86_SMAP))
322 + return false;
323 +
324 + if (!static_cpu_has(X86_FEATURE_SMAP))
325 + return false;
326 +
327 if (error_code & PF_USER)
328 return false;
329
330 @@ -1091,11 +1097,9 @@ __do_page_fault(struct pt_regs *regs, unsigned long error_code)
331 if (unlikely(error_code & PF_RSVD))
332 pgtable_bad(regs, error_code, address);
333
334 - if (static_cpu_has(X86_FEATURE_SMAP)) {
335 - if (unlikely(smap_violation(error_code, regs))) {
336 - bad_area_nosemaphore(regs, error_code, address);
337 - return;
338 - }
339 + if (unlikely(smap_violation(error_code, regs))) {
340 + bad_area_nosemaphore(regs, error_code, address);
341 + return;
342 }
343
344 perf_sw_event(PERF_COUNT_SW_PAGE_FAULTS, 1, regs, address);
345 diff --git a/arch/x86/xen/p2m.c b/arch/x86/xen/p2m.c
346 index 95fb2aa5927e..156344448d19 100644
347 --- a/arch/x86/xen/p2m.c
348 +++ b/arch/x86/xen/p2m.c
349 @@ -878,7 +878,6 @@ int m2p_add_override(unsigned long mfn, struct page *page,
350 unsigned long uninitialized_var(address);
351 unsigned level;
352 pte_t *ptep = NULL;
353 - int ret = 0;
354
355 pfn = page_to_pfn(page);
356 if (!PageHighMem(page)) {
357 @@ -925,8 +924,8 @@ int m2p_add_override(unsigned long mfn, struct page *page,
358 * frontend pages while they are being shared with the backend,
359 * because mfn_to_pfn (that ends up being called by GUPF) will
360 * return the backend pfn rather than the frontend pfn. */
361 - ret = __get_user(pfn, &machine_to_phys_mapping[mfn]);
362 - if (ret == 0 && get_phys_to_machine(pfn) == mfn)
363 + pfn = mfn_to_pfn_no_overrides(mfn);
364 + if (get_phys_to_machine(pfn) == mfn)
365 set_phys_to_machine(pfn, FOREIGN_FRAME(mfn));
366
367 return 0;
368 @@ -941,7 +940,6 @@ int m2p_remove_override(struct page *page,
369 unsigned long uninitialized_var(address);
370 unsigned level;
371 pte_t *ptep = NULL;
372 - int ret = 0;
373
374 pfn = page_to_pfn(page);
375 mfn = get_phys_to_machine(pfn);
376 @@ -1019,8 +1017,8 @@ int m2p_remove_override(struct page *page,
377 * the original pfn causes mfn_to_pfn(mfn) to return the frontend
378 * pfn again. */
379 mfn &= ~FOREIGN_FRAME_BIT;
380 - ret = __get_user(pfn, &machine_to_phys_mapping[mfn]);
381 - if (ret == 0 && get_phys_to_machine(pfn) == FOREIGN_FRAME(mfn) &&
382 + pfn = mfn_to_pfn_no_overrides(mfn);
383 + if (get_phys_to_machine(pfn) == FOREIGN_FRAME(mfn) &&
384 m2p_find_override(mfn) == NULL)
385 set_phys_to_machine(pfn, mfn);
386
387 diff --git a/arch/x86/xen/smp.c b/arch/x86/xen/smp.c
388 index a1e58e19d0cc..570c9a5c4d3f 100644
389 --- a/arch/x86/xen/smp.c
390 +++ b/arch/x86/xen/smp.c
391 @@ -245,6 +245,15 @@ static void __init xen_smp_prepare_boot_cpu(void)
392 old memory can be recycled */
393 make_lowmem_page_readwrite(xen_initial_gdt);
394
395 +#ifdef CONFIG_X86_32
396 + /*
397 + * Xen starts us with XEN_FLAT_RING1_DS, but linux code
398 + * expects __USER_DS
399 + */
400 + loadsegment(ds, __USER_DS);
401 + loadsegment(es, __USER_DS);
402 +#endif
403 +
404 xen_filter_cpu_maps();
405 xen_setup_vcpu_info_placement();
406 }
407 diff --git a/block/blk-lib.c b/block/blk-lib.c
408 index d6f50d572565..9a32f5868fb9 100644
409 --- a/block/blk-lib.c
410 +++ b/block/blk-lib.c
411 @@ -121,6 +121,14 @@ int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
412
413 atomic_inc(&bb.done);
414 submit_bio(type, bio);
415 +
416 + /*
417 + * We can loop for a long time in here, if someone does
418 + * full device discards (like mkfs). Be nice and allow
419 + * us to schedule out to avoid softlocking if preempt
420 + * is disabled.
421 + */
422 + cond_resched();
423 }
424 blk_finish_plug(&plug);
425
426 diff --git a/block/blk.h b/block/blk.h
427 index e837b8f619b7..b3bdeb36f361 100644
428 --- a/block/blk.h
429 +++ b/block/blk.h
430 @@ -96,7 +96,7 @@ static inline struct request *__elv_next_request(struct request_queue *q)
431 q->flush_queue_delayed = 1;
432 return NULL;
433 }
434 - if (unlikely(blk_queue_dying(q)) ||
435 + if (unlikely(blk_queue_bypass(q)) ||
436 !q->elevator->type->ops.elevator_dispatch_fn(q, 0))
437 return NULL;
438 }
439 diff --git a/drivers/block/xen-blkfront.c b/drivers/block/xen-blkfront.c
440 index 69b45fc97276..1735b0d17e29 100644
441 --- a/drivers/block/xen-blkfront.c
442 +++ b/drivers/block/xen-blkfront.c
443 @@ -1518,13 +1518,16 @@ static void blkback_changed(struct xenbus_device *dev,
444 case XenbusStateReconfiguring:
445 case XenbusStateReconfigured:
446 case XenbusStateUnknown:
447 - case XenbusStateClosed:
448 break;
449
450 case XenbusStateConnected:
451 blkfront_connect(info);
452 break;
453
454 + case XenbusStateClosed:
455 + if (dev->state == XenbusStateClosed)
456 + break;
457 + /* Missed the backend's Closing state -- fallthrough */
458 case XenbusStateClosing:
459 blkfront_closing(info);
460 break;
461 diff --git a/drivers/char/raw.c b/drivers/char/raw.c
462 index f3223aac4df1..6e8d65e9b1d3 100644
463 --- a/drivers/char/raw.c
464 +++ b/drivers/char/raw.c
465 @@ -190,7 +190,7 @@ static int bind_get(int number, dev_t *dev)
466 struct raw_device_data *rawdev;
467 struct block_device *bdev;
468
469 - if (number <= 0 || number >= MAX_RAW_MINORS)
470 + if (number <= 0 || number >= max_raw_minors)
471 return -EINVAL;
472
473 rawdev = &raw_devices[number];
474 diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c
475 index 89e109022d78..a9d98cdd11f4 100644
476 --- a/drivers/edac/edac_mc.c
477 +++ b/drivers/edac/edac_mc.c
478 @@ -559,7 +559,8 @@ static void edac_mc_workq_function(struct work_struct *work_req)
479 *
480 * called with the mem_ctls_mutex held
481 */
482 -static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec)
483 +static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec,
484 + bool init)
485 {
486 edac_dbg(0, "\n");
487
488 @@ -567,7 +568,9 @@ static void edac_mc_workq_setup(struct mem_ctl_info *mci, unsigned msec)
489 if (mci->op_state != OP_RUNNING_POLL)
490 return;
491
492 - INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function);
493 + if (init)
494 + INIT_DELAYED_WORK(&mci->work, edac_mc_workq_function);
495 +
496 mod_delayed_work(edac_workqueue, &mci->work, msecs_to_jiffies(msec));
497 }
498
499 @@ -601,7 +604,7 @@ static void edac_mc_workq_teardown(struct mem_ctl_info *mci)
500 * user space has updated our poll period value, need to
501 * reset our workq delays
502 */
503 -void edac_mc_reset_delay_period(int value)
504 +void edac_mc_reset_delay_period(unsigned long value)
505 {
506 struct mem_ctl_info *mci;
507 struct list_head *item;
508 @@ -611,7 +614,7 @@ void edac_mc_reset_delay_period(int value)
509 list_for_each(item, &mc_devices) {
510 mci = list_entry(item, struct mem_ctl_info, link);
511
512 - edac_mc_workq_setup(mci, (unsigned long) value);
513 + edac_mc_workq_setup(mci, value, false);
514 }
515
516 mutex_unlock(&mem_ctls_mutex);
517 @@ -782,7 +785,7 @@ int edac_mc_add_mc(struct mem_ctl_info *mci)
518 /* This instance is NOW RUNNING */
519 mci->op_state = OP_RUNNING_POLL;
520
521 - edac_mc_workq_setup(mci, edac_mc_get_poll_msec());
522 + edac_mc_workq_setup(mci, edac_mc_get_poll_msec(), true);
523 } else {
524 mci->op_state = OP_RUNNING_INTERRUPT;
525 }
526 diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
527 index c4d700a577d2..88cd940ece63 100644
528 --- a/drivers/edac/edac_mc_sysfs.c
529 +++ b/drivers/edac/edac_mc_sysfs.c
530 @@ -52,16 +52,20 @@ int edac_mc_get_poll_msec(void)
531
532 static int edac_set_poll_msec(const char *val, struct kernel_param *kp)
533 {
534 - long l;
535 + unsigned long l;
536 int ret;
537
538 if (!val)
539 return -EINVAL;
540
541 - ret = strict_strtol(val, 0, &l);
542 - if (ret == -EINVAL || ((int)l != l))
543 + ret = kstrtoul(val, 0, &l);
544 + if (ret)
545 + return ret;
546 +
547 + if (l < 1000)
548 return -EINVAL;
549 - *((int *)kp->arg) = l;
550 +
551 + *((unsigned long *)kp->arg) = l;
552
553 /* notify edac_mc engine to reset the poll period */
554 edac_mc_reset_delay_period(l);
555 diff --git a/drivers/edac/edac_module.h b/drivers/edac/edac_module.h
556 index 3d139c6e7fe3..f2118bfcf8df 100644
557 --- a/drivers/edac/edac_module.h
558 +++ b/drivers/edac/edac_module.h
559 @@ -52,7 +52,7 @@ extern void edac_device_workq_setup(struct edac_device_ctl_info *edac_dev,
560 extern void edac_device_workq_teardown(struct edac_device_ctl_info *edac_dev);
561 extern void edac_device_reset_delay_period(struct edac_device_ctl_info
562 *edac_dev, unsigned long value);
563 -extern void edac_mc_reset_delay_period(int value);
564 +extern void edac_mc_reset_delay_period(unsigned long value);
565
566 extern void *edac_align_ptr(void **p, unsigned size, int n_elems);
567
568 diff --git a/drivers/gpu/drm/radeon/r600.c b/drivers/gpu/drm/radeon/r600.c
569 index 1b8c3707bf42..4cf21ec1abe3 100644
570 --- a/drivers/gpu/drm/radeon/r600.c
571 +++ b/drivers/gpu/drm/radeon/r600.c
572 @@ -4509,6 +4509,10 @@ restart_ih:
573 break;
574 }
575 break;
576 + case 124: /* UVD */
577 + DRM_DEBUG("IH: UVD int: 0x%08x\n", src_data);
578 + radeon_fence_process(rdev, R600_RING_TYPE_UVD_INDEX);
579 + break;
580 case 176: /* CP_INT in ring buffer */
581 case 177: /* CP_INT in IB1 */
582 case 178: /* CP_INT in IB2 */
583 diff --git a/drivers/gpu/drm/radeon/si.c b/drivers/gpu/drm/radeon/si.c
584 index 3cf38ff09e70..03add5d5542e 100644
585 --- a/drivers/gpu/drm/radeon/si.c
586 +++ b/drivers/gpu/drm/radeon/si.c
587 @@ -5159,6 +5159,10 @@ restart_ih:
588 break;
589 }
590 break;
591 + case 124: /* UVD */
592 + DRM_DEBUG("IH: UVD int: 0x%08x\n", src_data);
593 + radeon_fence_process(rdev, R600_RING_TYPE_UVD_INDEX);
594 + break;
595 case 146:
596 case 147:
597 dev_err(rdev->dev, "GPU fault detected: %d 0x%08x\n", src_id, src_data);
598 diff --git a/drivers/hv/connection.c b/drivers/hv/connection.c
599 index 253a74ba245c..d4fac934b220 100644
600 --- a/drivers/hv/connection.c
601 +++ b/drivers/hv/connection.c
602 @@ -67,7 +67,6 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
603 int ret = 0;
604 struct vmbus_channel_initiate_contact *msg;
605 unsigned long flags;
606 - int t;
607
608 init_completion(&msginfo->waitevent);
609
610 @@ -102,15 +101,7 @@ static int vmbus_negotiate_version(struct vmbus_channel_msginfo *msginfo,
611 }
612
613 /* Wait for the connection response */
614 - t = wait_for_completion_timeout(&msginfo->waitevent, 5*HZ);
615 - if (t == 0) {
616 - spin_lock_irqsave(&vmbus_connection.channelmsg_lock,
617 - flags);
618 - list_del(&msginfo->msglistentry);
619 - spin_unlock_irqrestore(&vmbus_connection.channelmsg_lock,
620 - flags);
621 - return -ETIMEDOUT;
622 - }
623 + wait_for_completion(&msginfo->waitevent);
624
625 spin_lock_irqsave(&vmbus_connection.channelmsg_lock, flags);
626 list_del(&msginfo->msglistentry);
627 diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c
628 index d6d640a733d5..9297164a23a5 100644
629 --- a/drivers/hwmon/ntc_thermistor.c
630 +++ b/drivers/hwmon/ntc_thermistor.c
631 @@ -145,7 +145,7 @@ struct ntc_data {
632 static int ntc_adc_iio_read(struct ntc_thermistor_platform_data *pdata)
633 {
634 struct iio_channel *channel = pdata->chan;
635 - unsigned int result;
636 + s64 result;
637 int val, ret;
638
639 ret = iio_read_channel_raw(channel, &val);
640 @@ -155,10 +155,10 @@ static int ntc_adc_iio_read(struct ntc_thermistor_platform_data *pdata)
641 }
642
643 /* unit: mV */
644 - result = pdata->pullup_uv * val;
645 + result = pdata->pullup_uv * (s64) val;
646 result >>= 12;
647
648 - return result;
649 + return (int)result;
650 }
651
652 static const struct of_device_id ntc_match[] = {
653 diff --git a/drivers/iio/imu/adis16400.h b/drivers/iio/imu/adis16400.h
654 index 2f8f9d632386..0916bf6b6c31 100644
655 --- a/drivers/iio/imu/adis16400.h
656 +++ b/drivers/iio/imu/adis16400.h
657 @@ -189,6 +189,7 @@ enum {
658 ADIS16300_SCAN_INCLI_X,
659 ADIS16300_SCAN_INCLI_Y,
660 ADIS16400_SCAN_ADC,
661 + ADIS16400_SCAN_TIMESTAMP,
662 };
663
664 #ifdef CONFIG_IIO_BUFFER
665 diff --git a/drivers/iio/imu/adis16400_core.c b/drivers/iio/imu/adis16400_core.c
666 index e58c529aacdf..d6ece2d17dec 100644
667 --- a/drivers/iio/imu/adis16400_core.c
668 +++ b/drivers/iio/imu/adis16400_core.c
669 @@ -632,7 +632,7 @@ static const struct iio_chan_spec adis16400_channels[] = {
670 ADIS16400_MAGN_CHAN(Z, ADIS16400_ZMAGN_OUT, 14),
671 ADIS16400_TEMP_CHAN(ADIS16400_TEMP_OUT, 12),
672 ADIS16400_AUX_ADC_CHAN(ADIS16400_AUX_ADC, 12),
673 - IIO_CHAN_SOFT_TIMESTAMP(12)
674 + IIO_CHAN_SOFT_TIMESTAMP(ADIS16400_SCAN_TIMESTAMP),
675 };
676
677 static const struct iio_chan_spec adis16448_channels[] = {
678 @@ -659,7 +659,7 @@ static const struct iio_chan_spec adis16448_channels[] = {
679 },
680 },
681 ADIS16400_TEMP_CHAN(ADIS16448_TEMP_OUT, 12),
682 - IIO_CHAN_SOFT_TIMESTAMP(11)
683 + IIO_CHAN_SOFT_TIMESTAMP(ADIS16400_SCAN_TIMESTAMP),
684 };
685
686 static const struct iio_chan_spec adis16350_channels[] = {
687 @@ -677,7 +677,7 @@ static const struct iio_chan_spec adis16350_channels[] = {
688 ADIS16400_MOD_TEMP_CHAN(X, ADIS16350_XTEMP_OUT, 12),
689 ADIS16400_MOD_TEMP_CHAN(Y, ADIS16350_YTEMP_OUT, 12),
690 ADIS16400_MOD_TEMP_CHAN(Z, ADIS16350_ZTEMP_OUT, 12),
691 - IIO_CHAN_SOFT_TIMESTAMP(11)
692 + IIO_CHAN_SOFT_TIMESTAMP(ADIS16400_SCAN_TIMESTAMP),
693 };
694
695 static const struct iio_chan_spec adis16300_channels[] = {
696 @@ -690,7 +690,7 @@ static const struct iio_chan_spec adis16300_channels[] = {
697 ADIS16400_AUX_ADC_CHAN(ADIS16300_AUX_ADC, 12),
698 ADIS16400_INCLI_CHAN(X, ADIS16300_PITCH_OUT, 13),
699 ADIS16400_INCLI_CHAN(Y, ADIS16300_ROLL_OUT, 13),
700 - IIO_CHAN_SOFT_TIMESTAMP(14)
701 + IIO_CHAN_SOFT_TIMESTAMP(ADIS16400_SCAN_TIMESTAMP),
702 };
703
704 static const struct iio_chan_spec adis16334_channels[] = {
705 @@ -701,7 +701,7 @@ static const struct iio_chan_spec adis16334_channels[] = {
706 ADIS16400_ACCEL_CHAN(Y, ADIS16400_YACCL_OUT, 14),
707 ADIS16400_ACCEL_CHAN(Z, ADIS16400_ZACCL_OUT, 14),
708 ADIS16400_TEMP_CHAN(ADIS16350_XTEMP_OUT, 12),
709 - IIO_CHAN_SOFT_TIMESTAMP(8)
710 + IIO_CHAN_SOFT_TIMESTAMP(ADIS16400_SCAN_TIMESTAMP),
711 };
712
713 static struct attribute *adis16400_attributes[] = {
714 diff --git a/drivers/infiniband/hw/qib/qib_iba7322.c b/drivers/infiniband/hw/qib/qib_iba7322.c
715 index bd8cb0f89ef1..14103ffb4839 100644
716 --- a/drivers/infiniband/hw/qib/qib_iba7322.c
717 +++ b/drivers/infiniband/hw/qib/qib_iba7322.c
718 @@ -2287,6 +2287,11 @@ static int qib_7322_bringup_serdes(struct qib_pportdata *ppd)
719 qib_write_kreg_port(ppd, krp_ibcctrl_a, ppd->cpspec->ibcctrl_a);
720 qib_write_kreg(dd, kr_scratch, 0ULL);
721
722 + /* ensure previous Tx parameters are not still forced */
723 + qib_write_kreg_port(ppd, krp_tx_deemph_override,
724 + SYM_MASK(IBSD_TX_DEEMPHASIS_OVERRIDE_0,
725 + reset_tx_deemphasis_override));
726 +
727 if (qib_compat_ddr_negotiate) {
728 ppd->cpspec->ibdeltainprog = 1;
729 ppd->cpspec->ibsymsnap = read_7322_creg32_port(ppd,
730 diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
731 index afaa5d425e9a..e73740b55aea 100644
732 --- a/drivers/md/raid1.c
733 +++ b/drivers/md/raid1.c
734 @@ -1854,11 +1854,15 @@ static int process_checks(struct r1bio *r1_bio)
735 for (i = 0; i < conf->raid_disks * 2; i++) {
736 int j;
737 int size;
738 + int uptodate;
739 struct bio *b = r1_bio->bios[i];
740 if (b->bi_end_io != end_sync_read)
741 continue;
742 - /* fixup the bio for reuse */
743 + /* fixup the bio for reuse, but preserve BIO_UPTODATE */
744 + uptodate = test_bit(BIO_UPTODATE, &b->bi_flags);
745 bio_reset(b);
746 + if (!uptodate)
747 + clear_bit(BIO_UPTODATE, &b->bi_flags);
748 b->bi_vcnt = vcnt;
749 b->bi_size = r1_bio->sectors << 9;
750 b->bi_sector = r1_bio->sector +
751 @@ -1891,11 +1895,14 @@ static int process_checks(struct r1bio *r1_bio)
752 int j;
753 struct bio *pbio = r1_bio->bios[primary];
754 struct bio *sbio = r1_bio->bios[i];
755 + int uptodate = test_bit(BIO_UPTODATE, &sbio->bi_flags);
756
757 if (sbio->bi_end_io != end_sync_read)
758 continue;
759 + /* Now we can 'fixup' the BIO_UPTODATE flag */
760 + set_bit(BIO_UPTODATE, &sbio->bi_flags);
761
762 - if (test_bit(BIO_UPTODATE, &sbio->bi_flags)) {
763 + if (uptodate) {
764 for (j = vcnt; j-- ; ) {
765 struct page *p, *s;
766 p = pbio->bi_io_vec[j].bv_page;
767 @@ -1910,7 +1917,7 @@ static int process_checks(struct r1bio *r1_bio)
768 if (j >= 0)
769 atomic64_add(r1_bio->sectors, &mddev->resync_mismatches);
770 if (j < 0 || (test_bit(MD_RECOVERY_CHECK, &mddev->recovery)
771 - && test_bit(BIO_UPTODATE, &sbio->bi_flags))) {
772 + && uptodate)) {
773 /* No need to write to this device. */
774 sbio->bi_end_io = NULL;
775 rdev_dec_pending(conf->mirrors[i].rdev, mddev);
776 diff --git a/drivers/md/raid5.c b/drivers/md/raid5.c
777 index 740e3f42bef8..5e3c25d4562c 100644
778 --- a/drivers/md/raid5.c
779 +++ b/drivers/md/raid5.c
780 @@ -5037,23 +5037,43 @@ raid5_size(struct mddev *mddev, sector_t sectors, int raid_disks)
781 return sectors * (raid_disks - conf->max_degraded);
782 }
783
784 +static void free_scratch_buffer(struct r5conf *conf, struct raid5_percpu *percpu)
785 +{
786 + safe_put_page(percpu->spare_page);
787 + kfree(percpu->scribble);
788 + percpu->spare_page = NULL;
789 + percpu->scribble = NULL;
790 +}
791 +
792 +static int alloc_scratch_buffer(struct r5conf *conf, struct raid5_percpu *percpu)
793 +{
794 + if (conf->level == 6 && !percpu->spare_page)
795 + percpu->spare_page = alloc_page(GFP_KERNEL);
796 + if (!percpu->scribble)
797 + percpu->scribble = kmalloc(conf->scribble_len, GFP_KERNEL);
798 +
799 + if (!percpu->scribble || (conf->level == 6 && !percpu->spare_page)) {
800 + free_scratch_buffer(conf, percpu);
801 + return -ENOMEM;
802 + }
803 +
804 + return 0;
805 +}
806 +
807 static void raid5_free_percpu(struct r5conf *conf)
808 {
809 - struct raid5_percpu *percpu;
810 unsigned long cpu;
811
812 if (!conf->percpu)
813 return;
814
815 - get_online_cpus();
816 - for_each_possible_cpu(cpu) {
817 - percpu = per_cpu_ptr(conf->percpu, cpu);
818 - safe_put_page(percpu->spare_page);
819 - kfree(percpu->scribble);
820 - }
821 #ifdef CONFIG_HOTPLUG_CPU
822 unregister_cpu_notifier(&conf->cpu_notify);
823 #endif
824 +
825 + get_online_cpus();
826 + for_each_possible_cpu(cpu)
827 + free_scratch_buffer(conf, per_cpu_ptr(conf->percpu, cpu));
828 put_online_cpus();
829
830 free_percpu(conf->percpu);
831 @@ -5079,15 +5099,7 @@ static int raid456_cpu_notify(struct notifier_block *nfb, unsigned long action,
832 switch (action) {
833 case CPU_UP_PREPARE:
834 case CPU_UP_PREPARE_FROZEN:
835 - if (conf->level == 6 && !percpu->spare_page)
836 - percpu->spare_page = alloc_page(GFP_KERNEL);
837 - if (!percpu->scribble)
838 - percpu->scribble = kmalloc(conf->scribble_len, GFP_KERNEL);
839 -
840 - if (!percpu->scribble ||
841 - (conf->level == 6 && !percpu->spare_page)) {
842 - safe_put_page(percpu->spare_page);
843 - kfree(percpu->scribble);
844 + if (alloc_scratch_buffer(conf, percpu)) {
845 pr_err("%s: failed memory allocation for cpu%ld\n",
846 __func__, cpu);
847 return notifier_from_errno(-ENOMEM);
848 @@ -5095,10 +5107,7 @@ static int raid456_cpu_notify(struct notifier_block *nfb, unsigned long action,
849 break;
850 case CPU_DEAD:
851 case CPU_DEAD_FROZEN:
852 - safe_put_page(percpu->spare_page);
853 - kfree(percpu->scribble);
854 - percpu->spare_page = NULL;
855 - percpu->scribble = NULL;
856 + free_scratch_buffer(conf, per_cpu_ptr(conf->percpu, cpu));
857 break;
858 default:
859 break;
860 @@ -5110,40 +5119,29 @@ static int raid456_cpu_notify(struct notifier_block *nfb, unsigned long action,
861 static int raid5_alloc_percpu(struct r5conf *conf)
862 {
863 unsigned long cpu;
864 - struct page *spare_page;
865 - struct raid5_percpu __percpu *allcpus;
866 - void *scribble;
867 - int err;
868 + int err = 0;
869
870 - allcpus = alloc_percpu(struct raid5_percpu);
871 - if (!allcpus)
872 + conf->percpu = alloc_percpu(struct raid5_percpu);
873 + if (!conf->percpu)
874 return -ENOMEM;
875 - conf->percpu = allcpus;
876 +
877 +#ifdef CONFIG_HOTPLUG_CPU
878 + conf->cpu_notify.notifier_call = raid456_cpu_notify;
879 + conf->cpu_notify.priority = 0;
880 + err = register_cpu_notifier(&conf->cpu_notify);
881 + if (err)
882 + return err;
883 +#endif
884
885 get_online_cpus();
886 - err = 0;
887 for_each_present_cpu(cpu) {
888 - if (conf->level == 6) {
889 - spare_page = alloc_page(GFP_KERNEL);
890 - if (!spare_page) {
891 - err = -ENOMEM;
892 - break;
893 - }
894 - per_cpu_ptr(conf->percpu, cpu)->spare_page = spare_page;
895 - }
896 - scribble = kmalloc(conf->scribble_len, GFP_KERNEL);
897 - if (!scribble) {
898 - err = -ENOMEM;
899 + err = alloc_scratch_buffer(conf, per_cpu_ptr(conf->percpu, cpu));
900 + if (err) {
901 + pr_err("%s: failed memory allocation for cpu%ld\n",
902 + __func__, cpu);
903 break;
904 }
905 - per_cpu_ptr(conf->percpu, cpu)->scribble = scribble;
906 }
907 -#ifdef CONFIG_HOTPLUG_CPU
908 - conf->cpu_notify.notifier_call = raid456_cpu_notify;
909 - conf->cpu_notify.priority = 0;
910 - if (err == 0)
911 - err = register_cpu_notifier(&conf->cpu_notify);
912 -#endif
913 put_online_cpus();
914
915 return err;
916 diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c
917 index e310ca6ed1a3..957fb36c7eb3 100644
918 --- a/drivers/misc/mei/client.c
919 +++ b/drivers/misc/mei/client.c
920 @@ -799,7 +799,6 @@ void mei_cl_all_disconnect(struct mei_device *dev)
921 list_for_each_entry_safe(cl, next, &dev->file_list, link) {
922 cl->state = MEI_FILE_DISCONNECTED;
923 cl->mei_flow_ctrl_creds = 0;
924 - cl->read_cb = NULL;
925 cl->timer_count = 0;
926 }
927 }
928 @@ -829,8 +828,16 @@ void mei_cl_all_read_wakeup(struct mei_device *dev)
929 void mei_cl_all_write_clear(struct mei_device *dev)
930 {
931 struct mei_cl_cb *cb, *next;
932 + struct list_head *list;
933
934 - list_for_each_entry_safe(cb, next, &dev->write_list.list, list) {
935 + list = &dev->write_list.list;
936 + list_for_each_entry_safe(cb, next, list, list) {
937 + list_del(&cb->list);
938 + mei_io_cb_free(cb);
939 + }
940 +
941 + list = &dev->write_waiting_list.list;
942 + list_for_each_entry_safe(cb, next, list, list) {
943 list_del(&cb->list);
944 mei_io_cb_free(cb);
945 }
946 diff --git a/drivers/net/wireless/ath/ar5523/ar5523.c b/drivers/net/wireless/ath/ar5523/ar5523.c
947 index 17d7fece35d2..57fc06e0f434 100644
948 --- a/drivers/net/wireless/ath/ar5523/ar5523.c
949 +++ b/drivers/net/wireless/ath/ar5523/ar5523.c
950 @@ -1764,7 +1764,7 @@ static struct usb_device_id ar5523_id_table[] = {
951 AR5523_DEVICE_UX(0x2001, 0x3a04), /* Dlink / DWLAG122 */
952 AR5523_DEVICE_UG(0x1690, 0x0712), /* Gigaset / AR5523 */
953 AR5523_DEVICE_UG(0x1690, 0x0710), /* Gigaset / SMCWUSBTG */
954 - AR5523_DEVICE_UG(0x129b, 0x160c), /* Gigaset / USB stick 108
955 + AR5523_DEVICE_UG(0x129b, 0x160b), /* Gigaset / USB stick 108
956 (CyberTAN Technology) */
957 AR5523_DEVICE_UG(0x16ab, 0x7801), /* Globalsun / AR5523_1 */
958 AR5523_DEVICE_UX(0x16ab, 0x7811), /* Globalsun / AR5523_2 */
959 diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
960 index 21e7edc7207c..04b3822ef93a 100644
961 --- a/drivers/net/wireless/ath/ath9k/htc_drv_main.c
962 +++ b/drivers/net/wireless/ath/ath9k/htc_drv_main.c
963 @@ -1331,21 +1331,22 @@ static void ath9k_htc_sta_rc_update(struct ieee80211_hw *hw,
964 struct ath_common *common = ath9k_hw_common(priv->ah);
965 struct ath9k_htc_target_rate trate;
966
967 + if (!(changed & IEEE80211_RC_SUPP_RATES_CHANGED))
968 + return;
969 +
970 mutex_lock(&priv->mutex);
971 ath9k_htc_ps_wakeup(priv);
972
973 - if (changed & IEEE80211_RC_SUPP_RATES_CHANGED) {
974 - memset(&trate, 0, sizeof(struct ath9k_htc_target_rate));
975 - ath9k_htc_setup_rate(priv, sta, &trate);
976 - if (!ath9k_htc_send_rate_cmd(priv, &trate))
977 - ath_dbg(common, CONFIG,
978 - "Supported rates for sta: %pM updated, rate caps: 0x%X\n",
979 - sta->addr, be32_to_cpu(trate.capflags));
980 - else
981 - ath_dbg(common, CONFIG,
982 - "Unable to update supported rates for sta: %pM\n",
983 - sta->addr);
984 - }
985 + memset(&trate, 0, sizeof(struct ath9k_htc_target_rate));
986 + ath9k_htc_setup_rate(priv, sta, &trate);
987 + if (!ath9k_htc_send_rate_cmd(priv, &trate))
988 + ath_dbg(common, CONFIG,
989 + "Supported rates for sta: %pM updated, rate caps: 0x%X\n",
990 + sta->addr, be32_to_cpu(trate.capflags));
991 + else
992 + ath_dbg(common, CONFIG,
993 + "Unable to update supported rates for sta: %pM\n",
994 + sta->addr);
995
996 ath9k_htc_ps_restore(priv);
997 mutex_unlock(&priv->mutex);
998 diff --git a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
999 index 6199a0a597a6..a7cf535216c9 100644
1000 --- a/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
1001 +++ b/drivers/net/wireless/iwlwifi/iwl-nvm-parse.c
1002 @@ -180,6 +180,11 @@ static int iwl_init_channel_map(struct device *dev, const struct iwl_cfg *cfg,
1003
1004 for (ch_idx = 0; ch_idx < IWL_NUM_CHANNELS; ch_idx++) {
1005 ch_flags = __le16_to_cpup(nvm_ch_flags + ch_idx);
1006 +
1007 + if (ch_idx >= NUM_2GHZ_CHANNELS &&
1008 + !data->sku_cap_band_52GHz_enable)
1009 + ch_flags &= ~NVM_CHANNEL_VALID;
1010 +
1011 if (!(ch_flags & NVM_CHANNEL_VALID)) {
1012 IWL_DEBUG_EEPROM(dev,
1013 "Ch. %d Flags %x [%sGHz] - No traffic\n",
1014 diff --git a/drivers/net/wireless/iwlwifi/mvm/scan.c b/drivers/net/wireless/iwlwifi/mvm/scan.c
1015 index 8e1f6c095a9e..b987dfb879df 100644
1016 --- a/drivers/net/wireless/iwlwifi/mvm/scan.c
1017 +++ b/drivers/net/wireless/iwlwifi/mvm/scan.c
1018 @@ -313,7 +313,8 @@ int iwl_mvm_scan_request(struct iwl_mvm *mvm,
1019
1020 iwl_mvm_scan_fill_ssids(cmd, req);
1021
1022 - cmd->tx_cmd.tx_flags = cpu_to_le32(TX_CMD_FLG_SEQ_CTL);
1023 + cmd->tx_cmd.tx_flags = cpu_to_le32(TX_CMD_FLG_SEQ_CTL |
1024 + TX_CMD_FLG_BT_DIS);
1025 cmd->tx_cmd.sta_id = mvm->aux_sta.sta_id;
1026 cmd->tx_cmd.life_time = cpu_to_le32(TX_CMD_LIFE_TIME_INFINITE);
1027 cmd->tx_cmd.rate_n_flags =
1028 diff --git a/drivers/net/wireless/iwlwifi/mvm/utils.c b/drivers/net/wireless/iwlwifi/mvm/utils.c
1029 index 687b34e387ac..0d9e08160fec 100644
1030 --- a/drivers/net/wireless/iwlwifi/mvm/utils.c
1031 +++ b/drivers/net/wireless/iwlwifi/mvm/utils.c
1032 @@ -401,6 +401,8 @@ void iwl_mvm_dump_nic_error_log(struct iwl_mvm *mvm)
1033 mvm->status, table.valid);
1034 }
1035
1036 + IWL_ERR(mvm, "Loaded firmware version: %s\n", mvm->fw->fw_version);
1037 +
1038 trace_iwlwifi_dev_ucode_error(trans->dev, table.error_id, table.tsf_low,
1039 table.data1, table.data2, table.data3,
1040 table.blink1, table.blink2, table.ilink1,
1041 diff --git a/drivers/of/address.c b/drivers/of/address.c
1042 index 9e69b4f0d204..00bc55cc821c 100644
1043 --- a/drivers/of/address.c
1044 +++ b/drivers/of/address.c
1045 @@ -99,11 +99,12 @@ static unsigned int of_bus_default_get_flags(const __be32 *addr)
1046 static int of_bus_pci_match(struct device_node *np)
1047 {
1048 /*
1049 + * "pciex" is PCI Express
1050 * "vci" is for the /chaos bridge on 1st-gen PCI powermacs
1051 * "ht" is hypertransport
1052 */
1053 - return !strcmp(np->type, "pci") || !strcmp(np->type, "vci") ||
1054 - !strcmp(np->type, "ht");
1055 + return !strcmp(np->type, "pci") || !strcmp(np->type, "pciex") ||
1056 + !strcmp(np->type, "vci") || !strcmp(np->type, "ht");
1057 }
1058
1059 static void of_bus_pci_count_cells(struct device_node *np,
1060 diff --git a/drivers/power/max17040_battery.c b/drivers/power/max17040_battery.c
1061 index c7ff6d67f158..0fbac861080d 100644
1062 --- a/drivers/power/max17040_battery.c
1063 +++ b/drivers/power/max17040_battery.c
1064 @@ -148,7 +148,7 @@ static void max17040_get_online(struct i2c_client *client)
1065 {
1066 struct max17040_chip *chip = i2c_get_clientdata(client);
1067
1068 - if (chip->pdata->battery_online)
1069 + if (chip->pdata && chip->pdata->battery_online)
1070 chip->online = chip->pdata->battery_online();
1071 else
1072 chip->online = 1;
1073 @@ -158,7 +158,8 @@ static void max17040_get_status(struct i2c_client *client)
1074 {
1075 struct max17040_chip *chip = i2c_get_clientdata(client);
1076
1077 - if (!chip->pdata->charger_online || !chip->pdata->charger_enable) {
1078 + if (!chip->pdata || !chip->pdata->charger_online
1079 + || !chip->pdata->charger_enable) {
1080 chip->status = POWER_SUPPLY_STATUS_UNKNOWN;
1081 return;
1082 }
1083 diff --git a/drivers/spi/spi.c b/drivers/spi/spi.c
1084 index ca99ac9295cf..32b7bb111eb6 100644
1085 --- a/drivers/spi/spi.c
1086 +++ b/drivers/spi/spi.c
1087 @@ -584,9 +584,7 @@ static void spi_pump_messages(struct kthread_work *work)
1088 ret = master->transfer_one_message(master, master->cur_msg);
1089 if (ret) {
1090 dev_err(&master->dev,
1091 - "failed to transfer one message from queue: %d\n", ret);
1092 - master->cur_msg->status = ret;
1093 - spi_finalize_current_message(master);
1094 + "failed to transfer one message from queue\n");
1095 return;
1096 }
1097 }
1098 diff --git a/drivers/staging/comedi/drivers/adv_pci1710.c b/drivers/staging/comedi/drivers/adv_pci1710.c
1099 index f847bbc175e7..acb66a9513cf 100644
1100 --- a/drivers/staging/comedi/drivers/adv_pci1710.c
1101 +++ b/drivers/staging/comedi/drivers/adv_pci1710.c
1102 @@ -489,6 +489,7 @@ static int pci171x_insn_write_ao(struct comedi_device *dev,
1103 struct comedi_insn *insn, unsigned int *data)
1104 {
1105 struct pci1710_private *devpriv = dev->private;
1106 + unsigned int val;
1107 int n, chan, range, ofs;
1108
1109 chan = CR_CHAN(insn->chanspec);
1110 @@ -504,11 +505,14 @@ static int pci171x_insn_write_ao(struct comedi_device *dev,
1111 outw(devpriv->da_ranges, dev->iobase + PCI171x_DAREF);
1112 ofs = PCI171x_DA1;
1113 }
1114 + val = devpriv->ao_data[chan];
1115
1116 - for (n = 0; n < insn->n; n++)
1117 - outw(data[n], dev->iobase + ofs);
1118 + for (n = 0; n < insn->n; n++) {
1119 + val = data[n];
1120 + outw(val, dev->iobase + ofs);
1121 + }
1122
1123 - devpriv->ao_data[chan] = data[n];
1124 + devpriv->ao_data[chan] = val;
1125
1126 return n;
1127
1128 @@ -678,6 +682,7 @@ static int pci1720_insn_write_ao(struct comedi_device *dev,
1129 struct comedi_insn *insn, unsigned int *data)
1130 {
1131 struct pci1710_private *devpriv = dev->private;
1132 + unsigned int val;
1133 int n, rangereg, chan;
1134
1135 chan = CR_CHAN(insn->chanspec);
1136 @@ -687,13 +692,15 @@ static int pci1720_insn_write_ao(struct comedi_device *dev,
1137 outb(rangereg, dev->iobase + PCI1720_RANGE);
1138 devpriv->da_ranges = rangereg;
1139 }
1140 + val = devpriv->ao_data[chan];
1141
1142 for (n = 0; n < insn->n; n++) {
1143 - outw(data[n], dev->iobase + PCI1720_DA0 + (chan << 1));
1144 + val = data[n];
1145 + outw(val, dev->iobase + PCI1720_DA0 + (chan << 1));
1146 outb(0, dev->iobase + PCI1720_SYNCOUT); /* update outputs */
1147 }
1148
1149 - devpriv->ao_data[chan] = data[n];
1150 + devpriv->ao_data[chan] = val;
1151
1152 return n;
1153 }
1154 diff --git a/drivers/staging/iio/adc/ad799x_core.c b/drivers/staging/iio/adc/ad799x_core.c
1155 index 8dc97b36e05a..b0cb2de93050 100644
1156 --- a/drivers/staging/iio/adc/ad799x_core.c
1157 +++ b/drivers/staging/iio/adc/ad799x_core.c
1158 @@ -644,7 +644,8 @@ static int ad799x_probe(struct i2c_client *client,
1159 return 0;
1160
1161 error_free_irq:
1162 - free_irq(client->irq, indio_dev);
1163 + if (client->irq > 0)
1164 + free_irq(client->irq, indio_dev);
1165 error_cleanup_ring:
1166 ad799x_ring_cleanup(indio_dev);
1167 error_disable_reg:
1168 diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
1169 index 642239015b46..3ee7217e25b2 100644
1170 --- a/drivers/tty/n_gsm.c
1171 +++ b/drivers/tty/n_gsm.c
1172 @@ -1089,6 +1089,7 @@ static void gsm_control_modem(struct gsm_mux *gsm, u8 *data, int clen)
1173 {
1174 unsigned int addr = 0;
1175 unsigned int modem = 0;
1176 + unsigned int brk = 0;
1177 struct gsm_dlci *dlci;
1178 int len = clen;
1179 u8 *dp = data;
1180 @@ -1115,6 +1116,16 @@ static void gsm_control_modem(struct gsm_mux *gsm, u8 *data, int clen)
1181 if (len == 0)
1182 return;
1183 }
1184 + len--;
1185 + if (len > 0) {
1186 + while (gsm_read_ea(&brk, *dp++) == 0) {
1187 + len--;
1188 + if (len == 0)
1189 + return;
1190 + }
1191 + modem <<= 7;
1192 + modem |= (brk & 0x7f);
1193 + }
1194 tty = tty_port_tty_get(&dlci->port);
1195 gsm_process_modem(tty, dlci, modem, clen);
1196 if (tty) {
1197 diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
1198 index 740202d8a5c4..0d1b3757cfb6 100644
1199 --- a/drivers/tty/vt/vt.c
1200 +++ b/drivers/tty/vt/vt.c
1201 @@ -1164,6 +1164,8 @@ static void csi_J(struct vc_data *vc, int vpar)
1202 scr_memsetw(vc->vc_screenbuf, vc->vc_video_erase_char,
1203 vc->vc_screenbuf_size >> 1);
1204 set_origin(vc);
1205 + if (CON_IS_VISIBLE(vc))
1206 + update_screen(vc);
1207 /* fall through */
1208 case 2: /* erase whole display */
1209 count = vc->vc_cols * vc->vc_rows;
1210 diff --git a/drivers/usb/core/hcd.c b/drivers/usb/core/hcd.c
1211 index d3aa353908aa..d53547d2e4c7 100644
1212 --- a/drivers/usb/core/hcd.c
1213 +++ b/drivers/usb/core/hcd.c
1214 @@ -1010,7 +1010,6 @@ static int register_root_hub(struct usb_hcd *hcd)
1215 dev_name(&usb_dev->dev), retval);
1216 return retval;
1217 }
1218 - usb_dev->lpm_capable = usb_device_supports_lpm(usb_dev);
1219 }
1220
1221 retval = usb_new_device (usb_dev);
1222 diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
1223 index e604645a1290..3a2eb4cc8959 100644
1224 --- a/drivers/usb/core/hub.c
1225 +++ b/drivers/usb/core/hub.c
1226 @@ -135,7 +135,7 @@ struct usb_hub *usb_hub_to_struct_hub(struct usb_device *hdev)
1227 return usb_get_intfdata(hdev->actconfig->interface[0]);
1228 }
1229
1230 -int usb_device_supports_lpm(struct usb_device *udev)
1231 +static int usb_device_supports_lpm(struct usb_device *udev)
1232 {
1233 /* USB 2.1 (and greater) devices indicate LPM support through
1234 * their USB 2.0 Extended Capabilities BOS descriptor.
1235 @@ -156,11 +156,6 @@ int usb_device_supports_lpm(struct usb_device *udev)
1236 "Power management will be impacted.\n");
1237 return 0;
1238 }
1239 -
1240 - /* udev is root hub */
1241 - if (!udev->parent)
1242 - return 1;
1243 -
1244 if (udev->parent->lpm_capable)
1245 return 1;
1246
1247 diff --git a/drivers/usb/core/usb.h b/drivers/usb/core/usb.h
1248 index c49383669cd8..823857767a16 100644
1249 --- a/drivers/usb/core/usb.h
1250 +++ b/drivers/usb/core/usb.h
1251 @@ -35,7 +35,6 @@ extern int usb_get_device_descriptor(struct usb_device *dev,
1252 unsigned int size);
1253 extern int usb_get_bos_descriptor(struct usb_device *dev);
1254 extern void usb_release_bos_descriptor(struct usb_device *dev);
1255 -extern int usb_device_supports_lpm(struct usb_device *udev);
1256 extern char *usb_cache_string(struct usb_device *udev, int index);
1257 extern int usb_set_configuration(struct usb_device *dev, int configuration);
1258 extern int usb_choose_configuration(struct usb_device *udev);
1259 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1260 index 089248c1d597..b7446a69d2a9 100644
1261 --- a/drivers/usb/serial/ftdi_sio.c
1262 +++ b/drivers/usb/serial/ftdi_sio.c
1263 @@ -155,6 +155,7 @@ static struct usb_device_id id_table_combined [] = {
1264 { USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) },
1265 { USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) },
1266 { USB_DEVICE(FTDI_VID, FTDI_NXTCAM_PID) },
1267 + { USB_DEVICE(FTDI_VID, FTDI_EV3CON_PID) },
1268 { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_0_PID) },
1269 { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_1_PID) },
1270 { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_2_PID) },
1271 @@ -194,6 +195,8 @@ static struct usb_device_id id_table_combined [] = {
1272 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_IOBOARD_PID) },
1273 { USB_DEVICE(INTERBIOMETRICS_VID, INTERBIOMETRICS_MINI_IOBOARD_PID) },
1274 { USB_DEVICE(FTDI_VID, FTDI_SPROG_II) },
1275 + { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_LP101_PID) },
1276 + { USB_DEVICE(FTDI_VID, FTDI_TAGSYS_P200X_PID) },
1277 { USB_DEVICE(FTDI_VID, FTDI_LENZ_LIUSB_PID) },
1278 { USB_DEVICE(FTDI_VID, FTDI_XF_632_PID) },
1279 { USB_DEVICE(FTDI_VID, FTDI_XF_634_PID) },
1280 diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1281 index a7019d1e3058..1e2d369df86e 100644
1282 --- a/drivers/usb/serial/ftdi_sio_ids.h
1283 +++ b/drivers/usb/serial/ftdi_sio_ids.h
1284 @@ -50,6 +50,7 @@
1285 #define TI_XDS100V2_PID 0xa6d0
1286
1287 #define FTDI_NXTCAM_PID 0xABB8 /* NXTCam for Mindstorms NXT */
1288 +#define FTDI_EV3CON_PID 0xABB9 /* Mindstorms EV3 Console Adapter */
1289
1290 /* US Interface Navigator (http://www.usinterface.com/) */
1291 #define FTDI_USINT_CAT_PID 0xb810 /* Navigator CAT and 2nd PTT lines */
1292 @@ -363,6 +364,12 @@
1293 /* Sprog II (Andrew Crosland's SprogII DCC interface) */
1294 #define FTDI_SPROG_II 0xF0C8
1295
1296 +/*
1297 + * Two of the Tagsys RFID Readers
1298 + */
1299 +#define FTDI_TAGSYS_LP101_PID 0xF0E9 /* Tagsys L-P101 RFID*/
1300 +#define FTDI_TAGSYS_P200X_PID 0xF0EE /* Tagsys Medio P200x RFID*/
1301 +
1302 /* an infrared receiver for user access control with IR tags */
1303 #define FTDI_PIEGROUP_PID 0xF208 /* Product Id */
1304
1305 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1306 index 5c86f57e4afa..216d20affba8 100644
1307 --- a/drivers/usb/serial/option.c
1308 +++ b/drivers/usb/serial/option.c
1309 @@ -1362,7 +1362,8 @@ static const struct usb_device_id option_ids[] = {
1310 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1267, 0xff, 0xff, 0xff) },
1311 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1268, 0xff, 0xff, 0xff) },
1312 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1269, 0xff, 0xff, 0xff) },
1313 - { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff) },
1314 + { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1270, 0xff, 0xff, 0xff),
1315 + .driver_info = (kernel_ulong_t)&net_intf5_blacklist },
1316 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1271, 0xff, 0xff, 0xff) },
1317 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1272, 0xff, 0xff, 0xff) },
1318 { USB_DEVICE_AND_INTERFACE_INFO(ZTE_VENDOR_ID, 0x1273, 0xff, 0xff, 0xff) },
1319 diff --git a/drivers/usb/serial/qcserial.c b/drivers/usb/serial/qcserial.c
1320 index c65437cfd4a2..968a40201e5f 100644
1321 --- a/drivers/usb/serial/qcserial.c
1322 +++ b/drivers/usb/serial/qcserial.c
1323 @@ -139,6 +139,9 @@ static const struct usb_device_id id_table[] = {
1324 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 0)}, /* Sierra Wireless EM7700 Device Management */
1325 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 2)}, /* Sierra Wireless EM7700 NMEA */
1326 {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x901c, 3)}, /* Sierra Wireless EM7700 Modem */
1327 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 0)}, /* Netgear AirCard 340U Device Management */
1328 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 2)}, /* Netgear AirCard 340U NMEA */
1329 + {USB_DEVICE_INTERFACE_NUMBER(0x1199, 0x9051, 3)}, /* Netgear AirCard 340U Modem */
1330
1331 { } /* Terminating entry */
1332 };
1333 diff --git a/drivers/usb/storage/Kconfig b/drivers/usb/storage/Kconfig
1334 index 8470e1b114f2..1dd0604d1911 100644
1335 --- a/drivers/usb/storage/Kconfig
1336 +++ b/drivers/usb/storage/Kconfig
1337 @@ -18,7 +18,9 @@ config USB_STORAGE
1338
1339 This option depends on 'SCSI' support being enabled, but you
1340 probably also need 'SCSI device support: SCSI disk support'
1341 - (BLK_DEV_SD) for most USB storage devices.
1342 + (BLK_DEV_SD) for most USB storage devices. Some devices also
1343 + will require 'Probe all LUNs on each SCSI device'
1344 + (SCSI_MULTI_LUN).
1345
1346 To compile this driver as a module, choose M here: the
1347 module will be called usb-storage.
1348 diff --git a/drivers/usb/storage/scsiglue.c b/drivers/usb/storage/scsiglue.c
1349 index 5db153260827..bb7bf198caab 100644
1350 --- a/drivers/usb/storage/scsiglue.c
1351 +++ b/drivers/usb/storage/scsiglue.c
1352 @@ -78,6 +78,8 @@ static const char* host_info(struct Scsi_Host *host)
1353
1354 static int slave_alloc (struct scsi_device *sdev)
1355 {
1356 + struct us_data *us = host_to_us(sdev->host);
1357 +
1358 /*
1359 * Set the INQUIRY transfer length to 36. We don't use any of
1360 * the extra data and many devices choke if asked for more or
1361 @@ -102,6 +104,10 @@ static int slave_alloc (struct scsi_device *sdev)
1362 */
1363 blk_queue_update_dma_alignment(sdev->request_queue, (512 - 1));
1364
1365 + /* Tell the SCSI layer if we know there is more than one LUN */
1366 + if (us->protocol == USB_PR_BULK && us->max_lun > 0)
1367 + sdev->sdev_bflags |= BLIST_FORCELUN;
1368 +
1369 return 0;
1370 }
1371
1372 diff --git a/drivers/usb/storage/unusual_cypress.h b/drivers/usb/storage/unusual_cypress.h
1373 index 65a6a75066a8..82e8ed0324e3 100644
1374 --- a/drivers/usb/storage/unusual_cypress.h
1375 +++ b/drivers/usb/storage/unusual_cypress.h
1376 @@ -31,7 +31,7 @@ UNUSUAL_DEV( 0x04b4, 0x6831, 0x0000, 0x9999,
1377 "Cypress ISD-300LP",
1378 USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),
1379
1380 -UNUSUAL_DEV( 0x14cd, 0x6116, 0x0000, 0x0219,
1381 +UNUSUAL_DEV( 0x14cd, 0x6116, 0x0160, 0x0160,
1382 "Super Top",
1383 "USB 2.0 SATA BRIDGE",
1384 USB_SC_CYP_ATACB, USB_PR_DEVICE, NULL, 0),
1385 diff --git a/drivers/usb/storage/unusual_devs.h b/drivers/usb/storage/unusual_devs.h
1386 index ad06255c2ade..adbeb255616a 100644
1387 --- a/drivers/usb/storage/unusual_devs.h
1388 +++ b/drivers/usb/storage/unusual_devs.h
1389 @@ -1455,6 +1455,13 @@ UNUSUAL_DEV( 0x0f88, 0x042e, 0x0100, 0x0100,
1390 USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1391 US_FL_FIX_CAPACITY ),
1392
1393 +/* Reported by Moritz Moeller-Herrmann <moritz-kernel@moeller-herrmann.de> */
1394 +UNUSUAL_DEV( 0x0fca, 0x8004, 0x0201, 0x0201,
1395 + "Research In Motion",
1396 + "BlackBerry Bold 9000",
1397 + USB_SC_DEVICE, USB_PR_DEVICE, NULL,
1398 + US_FL_MAX_SECTORS_64 ),
1399 +
1400 /* Reported by Michael Stattmann <michael@stattmann.com> */
1401 UNUSUAL_DEV( 0x0fce, 0xd008, 0x0000, 0x0000,
1402 "Sony Ericsson",
1403 diff --git a/drivers/vme/bridges/vme_ca91cx42.c b/drivers/vme/bridges/vme_ca91cx42.c
1404 index 64bfea314429..8ca1030675a6 100644
1405 --- a/drivers/vme/bridges/vme_ca91cx42.c
1406 +++ b/drivers/vme/bridges/vme_ca91cx42.c
1407 @@ -880,7 +880,7 @@ static ssize_t ca91cx42_master_read(struct vme_master_resource *image,
1408 if (done == count)
1409 goto out;
1410 }
1411 - if ((uintptr_t)addr & 0x2) {
1412 + if ((uintptr_t)(addr + done) & 0x2) {
1413 if ((count - done) < 2) {
1414 *(u8 *)(buf + done) = ioread8(addr + done);
1415 done += 1;
1416 @@ -934,7 +934,7 @@ static ssize_t ca91cx42_master_write(struct vme_master_resource *image,
1417 if (done == count)
1418 goto out;
1419 }
1420 - if ((uintptr_t)addr & 0x2) {
1421 + if ((uintptr_t)(addr + done) & 0x2) {
1422 if ((count - done) < 2) {
1423 iowrite8(*(u8 *)(buf + done), addr + done);
1424 done += 1;
1425 diff --git a/drivers/vme/bridges/vme_tsi148.c b/drivers/vme/bridges/vme_tsi148.c
1426 index 9c1aa4dc39c9..63424060b04f 100644
1427 --- a/drivers/vme/bridges/vme_tsi148.c
1428 +++ b/drivers/vme/bridges/vme_tsi148.c
1429 @@ -1283,7 +1283,7 @@ static ssize_t tsi148_master_read(struct vme_master_resource *image, void *buf,
1430 if (done == count)
1431 goto out;
1432 }
1433 - if ((uintptr_t)addr & 0x2) {
1434 + if ((uintptr_t)(addr + done) & 0x2) {
1435 if ((count - done) < 2) {
1436 *(u8 *)(buf + done) = ioread8(addr + done);
1437 done += 1;
1438 @@ -1365,7 +1365,7 @@ static ssize_t tsi148_master_write(struct vme_master_resource *image, void *buf,
1439 if (done == count)
1440 goto out;
1441 }
1442 - if ((uintptr_t)addr & 0x2) {
1443 + if ((uintptr_t)(addr + done) & 0x2) {
1444 if ((count - done) < 2) {
1445 iowrite8(*(u8 *)(buf + done), addr + done);
1446 done += 1;
1447 diff --git a/fs/bio-integrity.c b/fs/bio-integrity.c
1448 index 45e944fe52a6..8dccf73025b3 100644
1449 --- a/fs/bio-integrity.c
1450 +++ b/fs/bio-integrity.c
1451 @@ -114,6 +114,14 @@ void bio_integrity_free(struct bio *bio)
1452 }
1453 EXPORT_SYMBOL(bio_integrity_free);
1454
1455 +static inline unsigned int bip_integrity_vecs(struct bio_integrity_payload *bip)
1456 +{
1457 + if (bip->bip_slab == BIO_POOL_NONE)
1458 + return BIP_INLINE_VECS;
1459 +
1460 + return bvec_nr_vecs(bip->bip_slab);
1461 +}
1462 +
1463 /**
1464 * bio_integrity_add_page - Attach integrity metadata
1465 * @bio: bio to update
1466 @@ -129,7 +137,7 @@ int bio_integrity_add_page(struct bio *bio, struct page *page,
1467 struct bio_integrity_payload *bip = bio->bi_integrity;
1468 struct bio_vec *iv;
1469
1470 - if (bip->bip_vcnt >= bvec_nr_vecs(bip->bip_slab)) {
1471 + if (bip->bip_vcnt >= bip_integrity_vecs(bip)) {
1472 printk(KERN_ERR "%s: bip_vec full\n", __func__);
1473 return 0;
1474 }
1475 diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c
1476 index 51f5e0ee7237..494b68349667 100644
1477 --- a/fs/cifs/cifsacl.c
1478 +++ b/fs/cifs/cifsacl.c
1479 @@ -1027,15 +1027,30 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode,
1480 __u32 secdesclen = 0;
1481 struct cifs_ntsd *pntsd = NULL; /* acl obtained from server */
1482 struct cifs_ntsd *pnntsd = NULL; /* modified acl to be sent to server */
1483 + struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb);
1484 + struct tcon_link *tlink = cifs_sb_tlink(cifs_sb);
1485 + struct cifs_tcon *tcon;
1486 +
1487 + if (IS_ERR(tlink))
1488 + return PTR_ERR(tlink);
1489 + tcon = tlink_tcon(tlink);
1490
1491 cifs_dbg(NOISY, "set ACL from mode for %s\n", path);
1492
1493 /* Get the security descriptor */
1494 - pntsd = get_cifs_acl(CIFS_SB(inode->i_sb), inode, path, &secdesclen);
1495 +
1496 + if (tcon->ses->server->ops->get_acl == NULL) {
1497 + cifs_put_tlink(tlink);
1498 + return -EOPNOTSUPP;
1499 + }
1500 +
1501 + pntsd = tcon->ses->server->ops->get_acl(cifs_sb, inode, path,
1502 + &secdesclen);
1503 if (IS_ERR(pntsd)) {
1504 rc = PTR_ERR(pntsd);
1505 cifs_dbg(VFS, "%s: error %d getting sec desc\n", __func__, rc);
1506 - goto out;
1507 + cifs_put_tlink(tlink);
1508 + return rc;
1509 }
1510
1511 /*
1512 @@ -1048,6 +1063,7 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode,
1513 pnntsd = kmalloc(secdesclen, GFP_KERNEL);
1514 if (!pnntsd) {
1515 kfree(pntsd);
1516 + cifs_put_tlink(tlink);
1517 return -ENOMEM;
1518 }
1519
1520 @@ -1056,14 +1072,18 @@ id_mode_to_cifs_acl(struct inode *inode, const char *path, __u64 nmode,
1521
1522 cifs_dbg(NOISY, "build_sec_desc rc: %d\n", rc);
1523
1524 + if (tcon->ses->server->ops->set_acl == NULL)
1525 + rc = -EOPNOTSUPP;
1526 +
1527 if (!rc) {
1528 /* Set the security descriptor */
1529 - rc = set_cifs_acl(pnntsd, secdesclen, inode, path, aclflag);
1530 + rc = tcon->ses->server->ops->set_acl(pnntsd, secdesclen, inode,
1531 + path, aclflag);
1532 cifs_dbg(NOISY, "set_cifs_acl rc: %d\n", rc);
1533 }
1534 + cifs_put_tlink(tlink);
1535
1536 kfree(pnntsd);
1537 kfree(pntsd);
1538 -out:
1539 return rc;
1540 }
1541 diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h
1542 index ea3a0b3018a5..e2c2d96491fa 100644
1543 --- a/fs/cifs/cifsglob.h
1544 +++ b/fs/cifs/cifsglob.h
1545 @@ -370,6 +370,16 @@ struct smb_version_operations {
1546 void (*new_lease_key)(struct cifs_fid *fid);
1547 int (*calc_signature)(struct smb_rqst *rqst,
1548 struct TCP_Server_Info *server);
1549 + ssize_t (*query_all_EAs)(const unsigned int, struct cifs_tcon *,
1550 + const unsigned char *, const unsigned char *, char *,
1551 + size_t, const struct nls_table *, int);
1552 + int (*set_EA)(const unsigned int, struct cifs_tcon *, const char *,
1553 + const char *, const void *, const __u16,
1554 + const struct nls_table *, int);
1555 + struct cifs_ntsd * (*get_acl)(struct cifs_sb_info *, struct inode *,
1556 + const char *, u32 *);
1557 + int (*set_acl)(struct cifs_ntsd *, __u32, struct inode *, const char *,
1558 + int);
1559 };
1560
1561 struct smb_version_values {
1562 diff --git a/fs/cifs/inode.c b/fs/cifs/inode.c
1563 index 449b6cf09b09..9d463501348f 100644
1564 --- a/fs/cifs/inode.c
1565 +++ b/fs/cifs/inode.c
1566 @@ -490,10 +490,15 @@ static int cifs_sfu_mode(struct cifs_fattr *fattr, const unsigned char *path,
1567 return PTR_ERR(tlink);
1568 tcon = tlink_tcon(tlink);
1569
1570 - rc = CIFSSMBQAllEAs(xid, tcon, path, "SETFILEBITS",
1571 - ea_value, 4 /* size of buf */, cifs_sb->local_nls,
1572 - cifs_sb->mnt_cifs_flags &
1573 - CIFS_MOUNT_MAP_SPECIAL_CHR);
1574 + if (tcon->ses->server->ops->query_all_EAs == NULL) {
1575 + cifs_put_tlink(tlink);
1576 + return -EOPNOTSUPP;
1577 + }
1578 +
1579 + rc = tcon->ses->server->ops->query_all_EAs(xid, tcon, path,
1580 + "SETFILEBITS", ea_value, 4 /* size of buf */,
1581 + cifs_sb->local_nls,
1582 + cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
1583 cifs_put_tlink(tlink);
1584 if (rc < 0)
1585 return (int)rc;
1586 diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c
1587 index 3efdb9d5c0b8..4885a40f3210 100644
1588 --- a/fs/cifs/smb1ops.c
1589 +++ b/fs/cifs/smb1ops.c
1590 @@ -948,6 +948,14 @@ struct smb_version_operations smb1_operations = {
1591 .mand_lock = cifs_mand_lock,
1592 .mand_unlock_range = cifs_unlock_range,
1593 .push_mand_locks = cifs_push_mandatory_locks,
1594 +#ifdef CONFIG_CIFS_XATTR
1595 + .query_all_EAs = CIFSSMBQAllEAs,
1596 + .set_EA = CIFSSMBSetEA,
1597 +#endif /* CIFS_XATTR */
1598 +#ifdef CONFIG_CIFS_ACL
1599 + .get_acl = get_cifs_acl,
1600 + .set_acl = set_cifs_acl,
1601 +#endif /* CIFS_ACL */
1602 };
1603
1604 struct smb_version_values smb1_values = {
1605 diff --git a/fs/cifs/xattr.c b/fs/cifs/xattr.c
1606 index 09afda4cc58e..5ac836a86b18 100644
1607 --- a/fs/cifs/xattr.c
1608 +++ b/fs/cifs/xattr.c
1609 @@ -82,9 +82,11 @@ int cifs_removexattr(struct dentry *direntry, const char *ea_name)
1610 goto remove_ea_exit;
1611
1612 ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */
1613 - rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, NULL,
1614 - (__u16)0, cifs_sb->local_nls,
1615 - cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
1616 + if (pTcon->ses->server->ops->set_EA)
1617 + rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
1618 + full_path, ea_name, NULL, (__u16)0,
1619 + cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
1620 + CIFS_MOUNT_MAP_SPECIAL_CHR);
1621 }
1622 remove_ea_exit:
1623 kfree(full_path);
1624 @@ -149,18 +151,22 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
1625 cifs_dbg(FYI, "attempt to set cifs inode metadata\n");
1626
1627 ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */
1628 - rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
1629 - (__u16)value_size, cifs_sb->local_nls,
1630 - cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
1631 + if (pTcon->ses->server->ops->set_EA)
1632 + rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
1633 + full_path, ea_name, ea_value, (__u16)value_size,
1634 + cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
1635 + CIFS_MOUNT_MAP_SPECIAL_CHR);
1636 } else if (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN)
1637 == 0) {
1638 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
1639 goto set_ea_exit;
1640
1641 ea_name += XATTR_OS2_PREFIX_LEN; /* skip past os2. prefix */
1642 - rc = CIFSSMBSetEA(xid, pTcon, full_path, ea_name, ea_value,
1643 - (__u16)value_size, cifs_sb->local_nls,
1644 - cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
1645 + if (pTcon->ses->server->ops->set_EA)
1646 + rc = pTcon->ses->server->ops->set_EA(xid, pTcon,
1647 + full_path, ea_name, ea_value, (__u16)value_size,
1648 + cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
1649 + CIFS_MOUNT_MAP_SPECIAL_CHR);
1650 } else if (strncmp(ea_name, CIFS_XATTR_CIFS_ACL,
1651 strlen(CIFS_XATTR_CIFS_ACL)) == 0) {
1652 #ifdef CONFIG_CIFS_ACL
1653 @@ -170,8 +176,12 @@ int cifs_setxattr(struct dentry *direntry, const char *ea_name,
1654 rc = -ENOMEM;
1655 } else {
1656 memcpy(pacl, ea_value, value_size);
1657 - rc = set_cifs_acl(pacl, value_size,
1658 - direntry->d_inode, full_path, CIFS_ACL_DACL);
1659 + if (pTcon->ses->server->ops->set_acl)
1660 + rc = pTcon->ses->server->ops->set_acl(pacl,
1661 + value_size, direntry->d_inode,
1662 + full_path, CIFS_ACL_DACL);
1663 + else
1664 + rc = -EOPNOTSUPP;
1665 if (rc == 0) /* force revalidate of the inode */
1666 CIFS_I(direntry->d_inode)->time = 0;
1667 kfree(pacl);
1668 @@ -272,17 +282,21 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
1669 /* revalidate/getattr then populate from inode */
1670 } /* BB add else when above is implemented */
1671 ea_name += XATTR_USER_PREFIX_LEN; /* skip past user. prefix */
1672 - rc = CIFSSMBQAllEAs(xid, pTcon, full_path, ea_name, ea_value,
1673 - buf_size, cifs_sb->local_nls,
1674 - cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
1675 + if (pTcon->ses->server->ops->query_all_EAs)
1676 + rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon,
1677 + full_path, ea_name, ea_value, buf_size,
1678 + cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
1679 + CIFS_MOUNT_MAP_SPECIAL_CHR);
1680 } else if (strncmp(ea_name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN) == 0) {
1681 if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_XATTR)
1682 goto get_ea_exit;
1683
1684 ea_name += XATTR_OS2_PREFIX_LEN; /* skip past os2. prefix */
1685 - rc = CIFSSMBQAllEAs(xid, pTcon, full_path, ea_name, ea_value,
1686 - buf_size, cifs_sb->local_nls,
1687 - cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MAP_SPECIAL_CHR);
1688 + if (pTcon->ses->server->ops->query_all_EAs)
1689 + rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon,
1690 + full_path, ea_name, ea_value, buf_size,
1691 + cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
1692 + CIFS_MOUNT_MAP_SPECIAL_CHR);
1693 } else if (strncmp(ea_name, POSIX_ACL_XATTR_ACCESS,
1694 strlen(POSIX_ACL_XATTR_ACCESS)) == 0) {
1695 #ifdef CONFIG_CIFS_POSIX
1696 @@ -313,8 +327,11 @@ ssize_t cifs_getxattr(struct dentry *direntry, const char *ea_name,
1697 u32 acllen;
1698 struct cifs_ntsd *pacl;
1699
1700 - pacl = get_cifs_acl(cifs_sb, direntry->d_inode,
1701 - full_path, &acllen);
1702 + if (pTcon->ses->server->ops->get_acl == NULL)
1703 + goto get_ea_exit; /* rc already EOPNOTSUPP */
1704 +
1705 + pacl = pTcon->ses->server->ops->get_acl(cifs_sb,
1706 + direntry->d_inode, full_path, &acllen);
1707 if (IS_ERR(pacl)) {
1708 rc = PTR_ERR(pacl);
1709 cifs_dbg(VFS, "%s: error %zd getting sec desc\n",
1710 @@ -400,11 +417,12 @@ ssize_t cifs_listxattr(struct dentry *direntry, char *data, size_t buf_size)
1711 /* if proc/fs/cifs/streamstoxattr is set then
1712 search server for EAs or streams to
1713 returns as xattrs */
1714 - rc = CIFSSMBQAllEAs(xid, pTcon, full_path, NULL, data,
1715 - buf_size, cifs_sb->local_nls,
1716 - cifs_sb->mnt_cifs_flags &
1717 - CIFS_MOUNT_MAP_SPECIAL_CHR);
1718
1719 + if (pTcon->ses->server->ops->query_all_EAs)
1720 + rc = pTcon->ses->server->ops->query_all_EAs(xid, pTcon,
1721 + full_path, NULL, data, buf_size,
1722 + cifs_sb->local_nls, cifs_sb->mnt_cifs_flags &
1723 + CIFS_MOUNT_MAP_SPECIAL_CHR);
1724 list_ea_exit:
1725 kfree(full_path);
1726 free_xid(xid);
1727 diff --git a/fs/file.c b/fs/file.c
1728 index 4a78f981557a..9de20265a78c 100644
1729 --- a/fs/file.c
1730 +++ b/fs/file.c
1731 @@ -34,7 +34,7 @@ static void *alloc_fdmem(size_t size)
1732 * vmalloc() if the allocation size will be considered "large" by the VM.
1733 */
1734 if (size <= (PAGE_SIZE << PAGE_ALLOC_COSTLY_ORDER)) {
1735 - void *data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN);
1736 + void *data = kmalloc(size, GFP_KERNEL|__GFP_NOWARN|__GFP_NORETRY);
1737 if (data != NULL)
1738 return data;
1739 }
1740 diff --git a/fs/lockd/svclock.c b/fs/lockd/svclock.c
1741 index 8ebd3f551e0c..ffc4045fc62e 100644
1742 --- a/fs/lockd/svclock.c
1743 +++ b/fs/lockd/svclock.c
1744 @@ -767,6 +767,7 @@ nlmsvc_grant_blocked(struct nlm_block *block)
1745 struct nlm_file *file = block->b_file;
1746 struct nlm_lock *lock = &block->b_call->a_args.lock;
1747 int error;
1748 + loff_t fl_start, fl_end;
1749
1750 dprintk("lockd: grant blocked lock %p\n", block);
1751
1752 @@ -784,9 +785,16 @@ nlmsvc_grant_blocked(struct nlm_block *block)
1753 }
1754
1755 /* Try the lock operation again */
1756 + /* vfs_lock_file() can mangle fl_start and fl_end, but we need
1757 + * them unchanged for the GRANT_MSG
1758 + */
1759 lock->fl.fl_flags |= FL_SLEEP;
1760 + fl_start = lock->fl.fl_start;
1761 + fl_end = lock->fl.fl_end;
1762 error = vfs_lock_file(file->f_file, F_SETLK, &lock->fl, NULL);
1763 lock->fl.fl_flags &= ~FL_SLEEP;
1764 + lock->fl.fl_start = fl_start;
1765 + lock->fl.fl_end = fl_end;
1766
1767 switch (error) {
1768 case 0:
1769 diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h
1770 index ded429966c1f..2507fd2a1eb4 100644
1771 --- a/include/linux/compiler-gcc4.h
1772 +++ b/include/linux/compiler-gcc4.h
1773 @@ -75,11 +75,7 @@
1774 *
1775 * (asm goto is automatically volatile - the naming reflects this.)
1776 */
1777 -#if GCC_VERSION <= 40801
1778 -# define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
1779 -#else
1780 -# define asm_volatile_goto(x...) do { asm goto(x); } while (0)
1781 -#endif
1782 +#define asm_volatile_goto(x...) do { asm goto(x); asm (""); } while (0)
1783
1784 #ifdef CONFIG_ARCH_USE_BUILTIN_BSWAP
1785 #if GCC_VERSION >= 40400
1786 diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c
1787 index 192a302d6cfd..8ab8e9390297 100644
1788 --- a/kernel/irq/irqdesc.c
1789 +++ b/kernel/irq/irqdesc.c
1790 @@ -274,6 +274,7 @@ struct irq_desc *irq_to_desc(unsigned int irq)
1791 {
1792 return (irq < NR_IRQS) ? irq_desc + irq : NULL;
1793 }
1794 +EXPORT_SYMBOL(irq_to_desc);
1795
1796 static void free_desc(unsigned int irq)
1797 {
1798 diff --git a/kernel/time/jiffies.c b/kernel/time/jiffies.c
1799 index 7a925ba456fb..a6a5bf53e86d 100644
1800 --- a/kernel/time/jiffies.c
1801 +++ b/kernel/time/jiffies.c
1802 @@ -51,7 +51,13 @@
1803 * HZ shrinks, so values greater than 8 overflow 32bits when
1804 * HZ=100.
1805 */
1806 +#if HZ < 34
1807 +#define JIFFIES_SHIFT 6
1808 +#elif HZ < 67
1809 +#define JIFFIES_SHIFT 7
1810 +#else
1811 #define JIFFIES_SHIFT 8
1812 +#endif
1813
1814 static cycle_t jiffies_read(struct clocksource *cs)
1815 {
1816 diff --git a/kernel/time/tick-broadcast.c b/kernel/time/tick-broadcast.c
1817 index 52d4827cf2d4..f681da32a2ff 100644
1818 --- a/kernel/time/tick-broadcast.c
1819 +++ b/kernel/time/tick-broadcast.c
1820 @@ -745,6 +745,7 @@ out:
1821 static void tick_broadcast_clear_oneshot(int cpu)
1822 {
1823 cpumask_clear_cpu(cpu, tick_broadcast_oneshot_mask);
1824 + cpumask_clear_cpu(cpu, tick_broadcast_pending_mask);
1825 }
1826
1827 static void tick_broadcast_init_next_event(struct cpumask *mask,
1828 diff --git a/kernel/trace/ring_buffer.c b/kernel/trace/ring_buffer.c
1829 index e444ff88f0a4..fd12cc56371f 100644
1830 --- a/kernel/trace/ring_buffer.c
1831 +++ b/kernel/trace/ring_buffer.c
1832 @@ -2396,6 +2396,13 @@ __rb_reserve_next(struct ring_buffer_per_cpu *cpu_buffer,
1833 write &= RB_WRITE_MASK;
1834 tail = write - length;
1835
1836 + /*
1837 + * If this is the first commit on the page, then it has the same
1838 + * timestamp as the page itself.
1839 + */
1840 + if (!tail)
1841 + delta = 0;
1842 +
1843 /* See if we shot pass the end of this buffer page */
1844 if (unlikely(write > BUF_PAGE_SIZE))
1845 return rb_move_tail(cpu_buffer, length, tail,
1846 diff --git a/mm/memory-failure.c b/mm/memory-failure.c
1847 index f2a591d87d00..e386beefc994 100644
1848 --- a/mm/memory-failure.c
1849 +++ b/mm/memory-failure.c
1850 @@ -943,8 +943,10 @@ static int hwpoison_user_mappings(struct page *p, unsigned long pfn,
1851 * to it. Similarly, page lock is shifted.
1852 */
1853 if (hpage != p) {
1854 - put_page(hpage);
1855 - get_page(p);
1856 + if (!(flags & MF_COUNT_INCREASED)) {
1857 + put_page(hpage);
1858 + get_page(p);
1859 + }
1860 lock_page(p);
1861 unlock_page(hpage);
1862 *hpagep = p;
1863 diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
1864 index 18687f1fca75..e922bf3f422c 100644
1865 --- a/net/mac80211/cfg.c
1866 +++ b/net/mac80211/cfg.c
1867 @@ -975,8 +975,10 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
1868 IEEE80211_P2P_OPPPS_ENABLE_BIT;
1869
1870 err = ieee80211_assign_beacon(sdata, &params->beacon);
1871 - if (err < 0)
1872 + if (err < 0) {
1873 + ieee80211_vif_release_channel(sdata);
1874 return err;
1875 + }
1876 changed |= err;
1877
1878 err = drv_start_ap(sdata->local, sdata);
1879 @@ -985,6 +987,7 @@ static int ieee80211_start_ap(struct wiphy *wiphy, struct net_device *dev,
1880 if (old)
1881 kfree_rcu(old, rcu_head);
1882 RCU_INIT_POINTER(sdata->u.ap.beacon, NULL);
1883 + ieee80211_vif_release_channel(sdata);
1884 return err;
1885 }
1886
1887 @@ -2476,6 +2479,24 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
1888 INIT_DELAYED_WORK(&roc->work, ieee80211_sw_roc_work);
1889 INIT_LIST_HEAD(&roc->dependents);
1890
1891 + /*
1892 + * cookie is either the roc cookie (for normal roc)
1893 + * or the SKB (for mgmt TX)
1894 + */
1895 + if (!txskb) {
1896 + /* local->mtx protects this */
1897 + local->roc_cookie_counter++;
1898 + roc->cookie = local->roc_cookie_counter;
1899 + /* wow, you wrapped 64 bits ... more likely a bug */
1900 + if (WARN_ON(roc->cookie == 0)) {
1901 + roc->cookie = 1;
1902 + local->roc_cookie_counter++;
1903 + }
1904 + *cookie = roc->cookie;
1905 + } else {
1906 + *cookie = (unsigned long)txskb;
1907 + }
1908 +
1909 /* if there's one pending or we're scanning, queue this one */
1910 if (!list_empty(&local->roc_list) ||
1911 local->scanning || local->radar_detect_enabled)
1912 @@ -2610,24 +2631,6 @@ static int ieee80211_start_roc_work(struct ieee80211_local *local,
1913 if (!queued)
1914 list_add_tail(&roc->list, &local->roc_list);
1915
1916 - /*
1917 - * cookie is either the roc cookie (for normal roc)
1918 - * or the SKB (for mgmt TX)
1919 - */
1920 - if (!txskb) {
1921 - /* local->mtx protects this */
1922 - local->roc_cookie_counter++;
1923 - roc->cookie = local->roc_cookie_counter;
1924 - /* wow, you wrapped 64 bits ... more likely a bug */
1925 - if (WARN_ON(roc->cookie == 0)) {
1926 - roc->cookie = 1;
1927 - local->roc_cookie_counter++;
1928 - }
1929 - *cookie = roc->cookie;
1930 - } else {
1931 - *cookie = (unsigned long)txskb;
1932 - }
1933 -
1934 return 0;
1935 }
1936
1937 diff --git a/net/mac80211/tx.c b/net/mac80211/tx.c
1938 index cc65cdddb047..fe9d6e7b904b 100644
1939 --- a/net/mac80211/tx.c
1940 +++ b/net/mac80211/tx.c
1941 @@ -854,7 +854,7 @@ static int ieee80211_fragment(struct ieee80211_tx_data *tx,
1942 }
1943
1944 /* adjust first fragment's length */
1945 - skb->len = hdrlen + per_fragm;
1946 + skb_trim(skb, hdrlen + per_fragm);
1947 return 0;
1948 }
1949
1950 diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
1951 index 45f9a3377dcd..4319a3824727 100644
1952 --- a/scripts/mod/file2alias.c
1953 +++ b/scripts/mod/file2alias.c
1954 @@ -208,8 +208,8 @@ static void do_usb_entry(void *symval,
1955 range_lo < 0x9 ? "[%X-9" : "[%X",
1956 range_lo);
1957 sprintf(alias + strlen(alias),
1958 - range_hi > 0xA ? "a-%X]" : "%X]",
1959 - range_lo);
1960 + range_hi > 0xA ? "A-%X]" : "%X]",
1961 + range_hi);
1962 }
1963 }
1964 if (bcdDevice_initial_digits < (sizeof(bcdDevice_lo) * 2 - 1))
1965 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1966 index 87a03aca1b2e..e0bdcb3ecf0e 100644
1967 --- a/sound/pci/hda/patch_realtek.c
1968 +++ b/sound/pci/hda/patch_realtek.c
1969 @@ -3700,6 +3700,7 @@ static const struct snd_pci_quirk alc269_fixup_tbl[] = {
1970 SND_PCI_QUIRK(0x1043, 0x8398, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
1971 SND_PCI_QUIRK(0x1043, 0x83ce, "ASUS P1005", ALC269_FIXUP_STEREO_DMIC),
1972 SND_PCI_QUIRK(0x1043, 0x8516, "ASUS X101CH", ALC269_FIXUP_ASUS_X101),
1973 + SND_PCI_QUIRK(0x104d, 0x90b5, "Sony VAIO Pro 11", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
1974 SND_PCI_QUIRK(0x104d, 0x90b6, "Sony VAIO Pro 13", ALC286_FIXUP_SONY_MIC_NO_PRESENCE),
1975 SND_PCI_QUIRK(0x104d, 0x9073, "Sony VAIO", ALC275_FIXUP_SONY_VAIO_GPIO2),
1976 SND_PCI_QUIRK(0x104d, 0x907b, "Sony VAIO", ALC275_FIXUP_SONY_HWEQ),
1977 diff --git a/virt/kvm/coalesced_mmio.c b/virt/kvm/coalesced_mmio.c
1978 index 88b2fe3ddf42..00d86427af0f 100644
1979 --- a/virt/kvm/coalesced_mmio.c
1980 +++ b/virt/kvm/coalesced_mmio.c
1981 @@ -154,17 +154,13 @@ int kvm_vm_ioctl_register_coalesced_mmio(struct kvm *kvm,
1982 list_add_tail(&dev->list, &kvm->coalesced_zones);
1983 mutex_unlock(&kvm->slots_lock);
1984
1985 - return ret;
1986 + return 0;
1987
1988 out_free_dev:
1989 mutex_unlock(&kvm->slots_lock);
1990 -
1991 kfree(dev);
1992
1993 - if (dev == NULL)
1994 - return -ENXIO;
1995 -
1996 - return 0;
1997 + return ret;
1998 }
1999
2000 int kvm_vm_ioctl_unregister_coalesced_mmio(struct kvm *kvm,