Magellan Linux

Contents of /trunk/kernel-magellan/patches-3.6/0108-3.6.9-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1982 - (show annotations) (download)
Tue Dec 4 09:18:25 2012 UTC (11 years, 4 months ago) by niro
File size: 58062 byte(s)
-linux-3.6.9
1 diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
2 index 12d3952e..32bc56b 100755
3 --- a/Documentation/dvb/get_dvb_firmware
4 +++ b/Documentation/dvb/get_dvb_firmware
5 @@ -116,7 +116,7 @@ sub tda10045 {
6
7 sub tda10046 {
8 my $sourcefile = "TT_PCI_2.19h_28_11_2006.zip";
9 - my $url = "http://www.tt-download.com/download/updates/219/$sourcefile";
10 + my $url = "http://technotrend.com.ua/download/software/219/$sourcefile";
11 my $hash = "6a7e1e2f2644b162ff0502367553c72d";
12 my $outfile = "dvb-fe-tda10046.fw";
13 my $tmpdir = tempdir(DIR => "/tmp", CLEANUP => 1);
14 diff --git a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c
15 index fd49aed..5dede04 100644
16 --- a/arch/parisc/kernel/signal32.c
17 +++ b/arch/parisc/kernel/signal32.c
18 @@ -65,7 +65,8 @@ put_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
19 {
20 compat_sigset_t s;
21
22 - if (sz != sizeof *set) panic("put_sigset32()");
23 + if (sz != sizeof *set)
24 + return -EINVAL;
25 sigset_64to32(&s, set);
26
27 return copy_to_user(up, &s, sizeof s);
28 @@ -77,7 +78,8 @@ get_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
29 compat_sigset_t s;
30 int r;
31
32 - if (sz != sizeof *set) panic("put_sigset32()");
33 + if (sz != sizeof *set)
34 + return -EINVAL;
35
36 if ((r = copy_from_user(&s, up, sz)) == 0) {
37 sigset_32to64(set, &s);
38 diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
39 index 7426e40..f76c108 100644
40 --- a/arch/parisc/kernel/sys_parisc.c
41 +++ b/arch/parisc/kernel/sys_parisc.c
42 @@ -73,6 +73,8 @@ static unsigned long get_shared_area(struct address_space *mapping,
43 struct vm_area_struct *vma;
44 int offset = mapping ? get_offset(mapping) : 0;
45
46 + offset = (offset + (pgoff << PAGE_SHIFT)) & 0x3FF000;
47 +
48 addr = DCACHE_ALIGN(addr - offset) + offset;
49
50 for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {
51 diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
52 index baf92cd..041e28d 100644
53 --- a/arch/powerpc/platforms/pseries/eeh_driver.c
54 +++ b/arch/powerpc/platforms/pseries/eeh_driver.c
55 @@ -25,6 +25,7 @@
56 #include <linux/delay.h>
57 #include <linux/interrupt.h>
58 #include <linux/irq.h>
59 +#include <linux/module.h>
60 #include <linux/pci.h>
61 #include <asm/eeh.h>
62 #include <asm/eeh_event.h>
63 @@ -47,6 +48,41 @@ static inline const char *eeh_pcid_name(struct pci_dev *pdev)
64 return "";
65 }
66
67 +/**
68 + * eeh_pcid_get - Get the PCI device driver
69 + * @pdev: PCI device
70 + *
71 + * The function is used to retrieve the PCI device driver for
72 + * the indicated PCI device. Besides, we will increase the reference
73 + * of the PCI device driver to prevent that being unloaded on
74 + * the fly. Otherwise, kernel crash would be seen.
75 + */
76 +static inline struct pci_driver *eeh_pcid_get(struct pci_dev *pdev)
77 +{
78 + if (!pdev || !pdev->driver)
79 + return NULL;
80 +
81 + if (!try_module_get(pdev->driver->driver.owner))
82 + return NULL;
83 +
84 + return pdev->driver;
85 +}
86 +
87 +/**
88 + * eeh_pcid_put - Dereference on the PCI device driver
89 + * @pdev: PCI device
90 + *
91 + * The function is called to do dereference on the PCI device
92 + * driver of the indicated PCI device.
93 + */
94 +static inline void eeh_pcid_put(struct pci_dev *pdev)
95 +{
96 + if (!pdev || !pdev->driver)
97 + return;
98 +
99 + module_put(pdev->driver->driver.owner);
100 +}
101 +
102 #if 0
103 static void print_device_node_tree(struct pci_dn *pdn, int dent)
104 {
105 @@ -126,18 +162,20 @@ static void eeh_enable_irq(struct pci_dev *dev)
106 static int eeh_report_error(struct pci_dev *dev, void *userdata)
107 {
108 enum pci_ers_result rc, *res = userdata;
109 - struct pci_driver *driver = dev->driver;
110 + struct pci_driver *driver;
111
112 dev->error_state = pci_channel_io_frozen;
113
114 - if (!driver)
115 - return 0;
116 + driver = eeh_pcid_get(dev);
117 + if (!driver) return 0;
118
119 eeh_disable_irq(dev);
120
121 if (!driver->err_handler ||
122 - !driver->err_handler->error_detected)
123 + !driver->err_handler->error_detected) {
124 + eeh_pcid_put(dev);
125 return 0;
126 + }
127
128 rc = driver->err_handler->error_detected(dev, pci_channel_io_frozen);
129
130 @@ -145,6 +183,7 @@ static int eeh_report_error(struct pci_dev *dev, void *userdata)
131 if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
132 if (*res == PCI_ERS_RESULT_NONE) *res = rc;
133
134 + eeh_pcid_put(dev);
135 return 0;
136 }
137
138 @@ -160,12 +199,16 @@ static int eeh_report_error(struct pci_dev *dev, void *userdata)
139 static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
140 {
141 enum pci_ers_result rc, *res = userdata;
142 - struct pci_driver *driver = dev->driver;
143 + struct pci_driver *driver;
144 +
145 + driver = eeh_pcid_get(dev);
146 + if (!driver) return 0;
147
148 - if (!driver ||
149 - !driver->err_handler ||
150 - !driver->err_handler->mmio_enabled)
151 + if (!driver->err_handler ||
152 + !driver->err_handler->mmio_enabled) {
153 + eeh_pcid_put(dev);
154 return 0;
155 + }
156
157 rc = driver->err_handler->mmio_enabled(dev);
158
159 @@ -173,6 +216,7 @@ static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
160 if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
161 if (*res == PCI_ERS_RESULT_NONE) *res = rc;
162
163 + eeh_pcid_put(dev);
164 return 0;
165 }
166
167 @@ -189,18 +233,20 @@ static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
168 static int eeh_report_reset(struct pci_dev *dev, void *userdata)
169 {
170 enum pci_ers_result rc, *res = userdata;
171 - struct pci_driver *driver = dev->driver;
172 -
173 - if (!driver)
174 - return 0;
175 + struct pci_driver *driver;
176
177 dev->error_state = pci_channel_io_normal;
178
179 + driver = eeh_pcid_get(dev);
180 + if (!driver) return 0;
181 +
182 eeh_enable_irq(dev);
183
184 if (!driver->err_handler ||
185 - !driver->err_handler->slot_reset)
186 + !driver->err_handler->slot_reset) {
187 + eeh_pcid_put(dev);
188 return 0;
189 + }
190
191 rc = driver->err_handler->slot_reset(dev);
192 if ((*res == PCI_ERS_RESULT_NONE) ||
193 @@ -208,6 +254,7 @@ static int eeh_report_reset(struct pci_dev *dev, void *userdata)
194 if (*res == PCI_ERS_RESULT_DISCONNECT &&
195 rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
196
197 + eeh_pcid_put(dev);
198 return 0;
199 }
200
201 @@ -222,21 +269,24 @@ static int eeh_report_reset(struct pci_dev *dev, void *userdata)
202 */
203 static int eeh_report_resume(struct pci_dev *dev, void *userdata)
204 {
205 - struct pci_driver *driver = dev->driver;
206 + struct pci_driver *driver;
207
208 dev->error_state = pci_channel_io_normal;
209
210 - if (!driver)
211 - return 0;
212 + driver = eeh_pcid_get(dev);
213 + if (!driver) return 0;
214
215 eeh_enable_irq(dev);
216
217 if (!driver->err_handler ||
218 - !driver->err_handler->resume)
219 + !driver->err_handler->resume) {
220 + eeh_pcid_put(dev);
221 return 0;
222 + }
223
224 driver->err_handler->resume(dev);
225
226 + eeh_pcid_put(dev);
227 return 0;
228 }
229
230 @@ -250,21 +300,24 @@ static int eeh_report_resume(struct pci_dev *dev, void *userdata)
231 */
232 static int eeh_report_failure(struct pci_dev *dev, void *userdata)
233 {
234 - struct pci_driver *driver = dev->driver;
235 + struct pci_driver *driver;
236
237 dev->error_state = pci_channel_io_perm_failure;
238
239 - if (!driver)
240 - return 0;
241 + driver = eeh_pcid_get(dev);
242 + if (!driver) return 0;
243
244 eeh_disable_irq(dev);
245
246 if (!driver->err_handler ||
247 - !driver->err_handler->error_detected)
248 + !driver->err_handler->error_detected) {
249 + eeh_pcid_put(dev);
250 return 0;
251 + }
252
253 driver->err_handler->error_detected(dev, pci_channel_io_perm_failure);
254
255 + eeh_pcid_put(dev);
256 return 0;
257 }
258
259 diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
260 index 867de2f..689e1ba 100644
261 --- a/arch/sparc/kernel/signal_64.c
262 +++ b/arch/sparc/kernel/signal_64.c
263 @@ -295,9 +295,7 @@ void do_rt_sigreturn(struct pt_regs *regs)
264 err |= restore_fpu_state(regs, fpu_save);
265
266 err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t));
267 - err |= do_sigaltstack(&sf->stack, NULL, (unsigned long)sf);
268 -
269 - if (err)
270 + if (err || do_sigaltstack(&sf->stack, NULL, (unsigned long)sf) == -EFAULT)
271 goto segv;
272
273 err |= __get_user(rwin_save, &sf->rwin_save);
274 diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
275 index b3e0227..90201aa 100644
276 --- a/arch/x86/boot/compressed/eboot.c
277 +++ b/arch/x86/boot/compressed/eboot.c
278 @@ -12,6 +12,8 @@
279 #include <asm/setup.h>
280 #include <asm/desc.h>
281
282 +#undef memcpy /* Use memcpy from misc.c */
283 +
284 #include "eboot.h"
285
286 static efi_system_table_t *sys_table;
287 diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
288 index dcfde52..19f16eb 100644
289 --- a/arch/x86/include/asm/ptrace.h
290 +++ b/arch/x86/include/asm/ptrace.h
291 @@ -205,21 +205,14 @@ static inline bool user_64bit_mode(struct pt_regs *regs)
292 }
293 #endif
294
295 -/*
296 - * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode
297 - * when it traps. The previous stack will be directly underneath the saved
298 - * registers, and 'sp/ss' won't even have been saved. Thus the '&regs->sp'.
299 - *
300 - * This is valid only for kernel mode traps.
301 - */
302 -static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
303 -{
304 #ifdef CONFIG_X86_32
305 - return (unsigned long)(&regs->sp);
306 +extern unsigned long kernel_stack_pointer(struct pt_regs *regs);
307 #else
308 +static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
309 +{
310 return regs->sp;
311 -#endif
312 }
313 +#endif
314
315 #define GET_IP(regs) ((regs)->ip)
316 #define GET_FP(regs) ((regs)->bp)
317 diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
318 index 82746f9..5d8cf0d 100644
319 --- a/arch/x86/kernel/microcode_amd.c
320 +++ b/arch/x86/kernel/microcode_amd.c
321 @@ -97,6 +97,7 @@ static unsigned int verify_ucode_size(int cpu, u32 patch_size,
322 #define F1XH_MPB_MAX_SIZE 2048
323 #define F14H_MPB_MAX_SIZE 1824
324 #define F15H_MPB_MAX_SIZE 4096
325 +#define F16H_MPB_MAX_SIZE 3458
326
327 switch (c->x86) {
328 case 0x14:
329 @@ -105,6 +106,9 @@ static unsigned int verify_ucode_size(int cpu, u32 patch_size,
330 case 0x15:
331 max_size = F15H_MPB_MAX_SIZE;
332 break;
333 + case 0x16:
334 + max_size = F16H_MPB_MAX_SIZE;
335 + break;
336 default:
337 max_size = F1XH_MPB_MAX_SIZE;
338 break;
339 diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
340 index c4c6a5c..9ee1787 100644
341 --- a/arch/x86/kernel/ptrace.c
342 +++ b/arch/x86/kernel/ptrace.c
343 @@ -21,6 +21,7 @@
344 #include <linux/signal.h>
345 #include <linux/perf_event.h>
346 #include <linux/hw_breakpoint.h>
347 +#include <linux/module.h>
348
349 #include <asm/uaccess.h>
350 #include <asm/pgtable.h>
351 @@ -165,6 +166,35 @@ static inline bool invalid_selector(u16 value)
352
353 #define FLAG_MASK FLAG_MASK_32
354
355 +/*
356 + * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode
357 + * when it traps. The previous stack will be directly underneath the saved
358 + * registers, and 'sp/ss' won't even have been saved. Thus the '&regs->sp'.
359 + *
360 + * Now, if the stack is empty, '&regs->sp' is out of range. In this
361 + * case we try to take the previous stack. To always return a non-null
362 + * stack pointer we fall back to regs as stack if no previous stack
363 + * exists.
364 + *
365 + * This is valid only for kernel mode traps.
366 + */
367 +unsigned long kernel_stack_pointer(struct pt_regs *regs)
368 +{
369 + unsigned long context = (unsigned long)regs & ~(THREAD_SIZE - 1);
370 + unsigned long sp = (unsigned long)&regs->sp;
371 + struct thread_info *tinfo;
372 +
373 + if (context == (sp & ~(THREAD_SIZE - 1)))
374 + return sp;
375 +
376 + tinfo = (struct thread_info *)context;
377 + if (tinfo->previous_esp)
378 + return tinfo->previous_esp;
379 +
380 + return (unsigned long)regs;
381 +}
382 +EXPORT_SYMBOL_GPL(kernel_stack_pointer);
383 +
384 static unsigned long *pt_regs_access(struct pt_regs *regs, unsigned long regno)
385 {
386 BUILD_BUG_ON(offsetof(struct pt_regs, bx) != 0);
387 diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
388 index a10e460..58fc514 100644
389 --- a/arch/x86/kvm/cpuid.h
390 +++ b/arch/x86/kvm/cpuid.h
391 @@ -24,6 +24,9 @@ static inline bool guest_cpuid_has_xsave(struct kvm_vcpu *vcpu)
392 {
393 struct kvm_cpuid_entry2 *best;
394
395 + if (!static_cpu_has(X86_FEATURE_XSAVE))
396 + return 0;
397 +
398 best = kvm_find_cpuid_entry(vcpu, 1, 0);
399 return best && (best->ecx & bit(X86_FEATURE_XSAVE));
400 }
401 diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
402 index 2966c84..a201790 100644
403 --- a/arch/x86/kvm/x86.c
404 +++ b/arch/x86/kvm/x86.c
405 @@ -5762,6 +5762,9 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
406 int pending_vec, max_bits, idx;
407 struct desc_ptr dt;
408
409 + if (!guest_cpuid_has_xsave(vcpu) && (sregs->cr4 & X86_CR4_OSXSAVE))
410 + return -EINVAL;
411 +
412 dt.size = sregs->idt.limit;
413 dt.address = sregs->idt.base;
414 kvm_x86_ops->set_idt(vcpu, &dt);
415 diff --git a/block/blk-exec.c b/block/blk-exec.c
416 index 8b6dc5b..f71eac3 100644
417 --- a/block/blk-exec.c
418 +++ b/block/blk-exec.c
419 @@ -52,11 +52,17 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
420 rq_end_io_fn *done)
421 {
422 int where = at_head ? ELEVATOR_INSERT_FRONT : ELEVATOR_INSERT_BACK;
423 + bool is_pm_resume;
424
425 WARN_ON(irqs_disabled());
426
427 rq->rq_disk = bd_disk;
428 rq->end_io = done;
429 + /*
430 + * need to check this before __blk_run_queue(), because rq can
431 + * be freed before that returns.
432 + */
433 + is_pm_resume = rq->cmd_type == REQ_TYPE_PM_RESUME;
434
435 spin_lock_irq(q->queue_lock);
436
437 @@ -71,7 +77,7 @@ void blk_execute_rq_nowait(struct request_queue *q, struct gendisk *bd_disk,
438 __elv_add_request(q, rq, where);
439 __blk_run_queue(q);
440 /* the queue is stopped so it won't be run */
441 - if (rq->cmd_type == REQ_TYPE_PM_RESUME)
442 + if (is_pm_resume)
443 q->request_fn(q);
444 spin_unlock_irq(q->queue_lock);
445 }
446 diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
447 index 44a4256..08608de 100644
448 --- a/drivers/ata/sata_svw.c
449 +++ b/drivers/ata/sata_svw.c
450 @@ -142,6 +142,39 @@ static int k2_sata_scr_write(struct ata_link *link,
451 return 0;
452 }
453
454 +static int k2_sata_softreset(struct ata_link *link,
455 + unsigned int *class, unsigned long deadline)
456 +{
457 + u8 dmactl;
458 + void __iomem *mmio = link->ap->ioaddr.bmdma_addr;
459 +
460 + dmactl = readb(mmio + ATA_DMA_CMD);
461 +
462 + /* Clear the start bit */
463 + if (dmactl & ATA_DMA_START) {
464 + dmactl &= ~ATA_DMA_START;
465 + writeb(dmactl, mmio + ATA_DMA_CMD);
466 + }
467 +
468 + return ata_sff_softreset(link, class, deadline);
469 +}
470 +
471 +static int k2_sata_hardreset(struct ata_link *link,
472 + unsigned int *class, unsigned long deadline)
473 +{
474 + u8 dmactl;
475 + void __iomem *mmio = link->ap->ioaddr.bmdma_addr;
476 +
477 + dmactl = readb(mmio + ATA_DMA_CMD);
478 +
479 + /* Clear the start bit */
480 + if (dmactl & ATA_DMA_START) {
481 + dmactl &= ~ATA_DMA_START;
482 + writeb(dmactl, mmio + ATA_DMA_CMD);
483 + }
484 +
485 + return sata_sff_hardreset(link, class, deadline);
486 +}
487
488 static void k2_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
489 {
490 @@ -346,6 +379,8 @@ static struct scsi_host_template k2_sata_sht = {
491
492 static struct ata_port_operations k2_sata_ops = {
493 .inherits = &ata_bmdma_port_ops,
494 + .softreset = k2_sata_softreset,
495 + .hardreset = k2_sata_hardreset,
496 .sff_tf_load = k2_sata_tf_load,
497 .sff_tf_read = k2_sata_tf_read,
498 .sff_check_status = k2_stat_check_status,
499 diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
500 index 74a67e0..fbbd4ed 100644
501 --- a/drivers/base/power/qos.c
502 +++ b/drivers/base/power/qos.c
503 @@ -451,7 +451,7 @@ int dev_pm_qos_add_ancestor_request(struct device *dev,
504 if (ancestor)
505 error = dev_pm_qos_add_request(ancestor, req, value);
506
507 - if (error)
508 + if (error < 0)
509 req->dev = NULL;
510
511 return error;
512 diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c
513 index bd2f33e..bc6b64f 100644
514 --- a/drivers/gpu/drm/radeon/radeon_agp.c
515 +++ b/drivers/gpu/drm/radeon/radeon_agp.c
516 @@ -70,9 +70,12 @@ static struct radeon_agpmode_quirk radeon_agpmode_quirk_list[] = {
517 /* Intel 82830 830 Chipset Host Bridge / Mobility M6 LY Needs AGPMode 2 (fdo #17360)*/
518 { PCI_VENDOR_ID_INTEL, 0x3575, PCI_VENDOR_ID_ATI, 0x4c59,
519 PCI_VENDOR_ID_DELL, 0x00e3, 2},
520 - /* Intel 82852/82855 host bridge / Mobility FireGL 9000 R250 Needs AGPMode 1 (lp #296617) */
521 + /* Intel 82852/82855 host bridge / Mobility FireGL 9000 RV250 Needs AGPMode 1 (lp #296617) */
522 { PCI_VENDOR_ID_INTEL, 0x3580, PCI_VENDOR_ID_ATI, 0x4c66,
523 PCI_VENDOR_ID_DELL, 0x0149, 1},
524 + /* Intel 82855PM host bridge / Mobility FireGL 9000 RV250 Needs AGPMode 1 for suspend/resume */
525 + { PCI_VENDOR_ID_INTEL, 0x3340, PCI_VENDOR_ID_ATI, 0x4c66,
526 + PCI_VENDOR_ID_IBM, 0x0531, 1},
527 /* Intel 82852/82855 host bridge / Mobility 9600 M10 RV350 Needs AGPMode 1 (deb #467460) */
528 { PCI_VENDOR_ID_INTEL, 0x3580, PCI_VENDOR_ID_ATI, 0x4e50,
529 0x1025, 0x0061, 1},
530 diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
531 index 1dcb76f..ab8ce9f 100644
532 --- a/drivers/hid/hid-ids.h
533 +++ b/drivers/hid/hid-ids.h
534 @@ -296,6 +296,9 @@
535 #define USB_VENDOR_ID_EZKEY 0x0518
536 #define USB_DEVICE_ID_BTC_8193 0x0002
537
538 +#define USB_VENDOR_ID_FREESCALE 0x15A2
539 +#define USB_DEVICE_ID_FREESCALE_MX28 0x004F
540 +
541 #define USB_VENDOR_ID_FRUCTEL 0x25B6
542 #define USB_DEVICE_ID_GAMETEL_MT_MODE 0x0002
543
544 diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
545 index 991e85c..8865fa3 100644
546 --- a/drivers/hid/usbhid/hid-quirks.c
547 +++ b/drivers/hid/usbhid/hid-quirks.c
548 @@ -70,6 +70,7 @@ static const struct hid_blacklist {
549 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_AXIS_295, HID_QUIRK_NOGET },
550 { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET },
551 { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET },
552 + { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET },
553 { USB_VENDOR_ID_MGE, USB_DEVICE_ID_MGE_UPS, HID_QUIRK_NOGET },
554 { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN, HID_QUIRK_NO_INIT_REPORTS },
555 { USB_VENDOR_ID_PIXART, USB_DEVICE_ID_PIXART_OPTICAL_TOUCH_SCREEN1, HID_QUIRK_NO_INIT_REPORTS },
556 diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
557 index 5275887..c44950d 100644
558 --- a/drivers/isdn/gigaset/bas-gigaset.c
559 +++ b/drivers/isdn/gigaset/bas-gigaset.c
560 @@ -617,7 +617,13 @@ static void int_in_work(struct work_struct *work)
561 if (rc == 0)
562 /* success, resubmit interrupt read URB */
563 rc = usb_submit_urb(urb, GFP_ATOMIC);
564 - if (rc != 0 && rc != -ENODEV) {
565 +
566 + switch (rc) {
567 + case 0: /* success */
568 + case -ENODEV: /* device gone */
569 + case -EINVAL: /* URB already resubmitted, or terminal badness */
570 + break;
571 + default: /* failure: try to recover by resetting the device */
572 dev_err(cs->dev, "clear halt failed: %s\n", get_usb_rcmsg(rc));
573 rc = usb_lock_device_for_reset(ucs->udev, ucs->interface);
574 if (rc == 0) {
575 @@ -2442,7 +2448,9 @@ static void gigaset_disconnect(struct usb_interface *interface)
576 }
577
578 /* gigaset_suspend
579 - * This function is called before the USB connection is suspended.
580 + * This function is called before the USB connection is suspended
581 + * or before the USB device is reset.
582 + * In the latter case, message == PMSG_ON.
583 */
584 static int gigaset_suspend(struct usb_interface *intf, pm_message_t message)
585 {
586 @@ -2498,7 +2506,12 @@ static int gigaset_suspend(struct usb_interface *intf, pm_message_t message)
587 del_timer_sync(&ucs->timer_atrdy);
588 del_timer_sync(&ucs->timer_cmd_in);
589 del_timer_sync(&ucs->timer_int_in);
590 - cancel_work_sync(&ucs->int_in_wq);
591 +
592 + /* don't try to cancel int_in_wq from within reset as it
593 + * might be the one requesting the reset
594 + */
595 + if (message.event != PM_EVENT_ON)
596 + cancel_work_sync(&ucs->int_in_wq);
597
598 gig_dbg(DEBUG_SUSPEND, "suspend complete");
599 return 0;
600 diff --git a/drivers/md/dm.c b/drivers/md/dm.c
601 index 67ffa39..4256200 100644
602 --- a/drivers/md/dm.c
603 +++ b/drivers/md/dm.c
604 @@ -754,8 +754,14 @@ static void rq_completed(struct mapped_device *md, int rw, int run_queue)
605 if (!md_in_flight(md))
606 wake_up(&md->wait);
607
608 + /*
609 + * Run this off this callpath, as drivers could invoke end_io while
610 + * inside their request_fn (and holding the queue lock). Calling
611 + * back into ->request_fn() could deadlock attempting to grab the
612 + * queue lock again.
613 + */
614 if (run_queue)
615 - blk_run_queue(md->queue);
616 + blk_run_queue_async(md->queue);
617
618 /*
619 * dm_put() must be at the end of this function. See the comment above
620 diff --git a/drivers/md/md.c b/drivers/md/md.c
621 index 308e87b..c7b000f 100644
622 --- a/drivers/md/md.c
623 +++ b/drivers/md/md.c
624 @@ -1832,10 +1832,10 @@ retry:
625 memset(bbp, 0xff, PAGE_SIZE);
626
627 for (i = 0 ; i < bb->count ; i++) {
628 - u64 internal_bb = *p++;
629 + u64 internal_bb = p[i];
630 u64 store_bb = ((BB_OFFSET(internal_bb) << 10)
631 | BB_LEN(internal_bb));
632 - *bbp++ = cpu_to_le64(store_bb);
633 + bbp[i] = cpu_to_le64(store_bb);
634 }
635 bb->changed = 0;
636 if (read_seqretry(&bb->lock, seq))
637 @@ -7907,9 +7907,9 @@ int md_is_badblock(struct badblocks *bb, sector_t s, int sectors,
638 sector_t *first_bad, int *bad_sectors)
639 {
640 int hi;
641 - int lo = 0;
642 + int lo;
643 u64 *p = bb->page;
644 - int rv = 0;
645 + int rv;
646 sector_t target = s + sectors;
647 unsigned seq;
648
649 @@ -7924,7 +7924,8 @@ int md_is_badblock(struct badblocks *bb, sector_t s, int sectors,
650
651 retry:
652 seq = read_seqbegin(&bb->lock);
653 -
654 + lo = 0;
655 + rv = 0;
656 hi = bb->count;
657
658 /* Binary search between lo and hi for 'target'
659 diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
660 index a48c215..c52d893 100644
661 --- a/drivers/md/raid10.c
662 +++ b/drivers/md/raid10.c
663 @@ -499,7 +499,7 @@ static void raid10_end_write_request(struct bio *bio, int error)
664 */
665 one_write_done(r10_bio);
666 if (dec_rdev)
667 - rdev_dec_pending(conf->mirrors[dev].rdev, conf->mddev);
668 + rdev_dec_pending(rdev, conf->mddev);
669 }
670
671 /*
672 @@ -1287,18 +1287,21 @@ retry_write:
673 blocked_rdev = rrdev;
674 break;
675 }
676 + if (rdev && (test_bit(Faulty, &rdev->flags)
677 + || test_bit(Unmerged, &rdev->flags)))
678 + rdev = NULL;
679 if (rrdev && (test_bit(Faulty, &rrdev->flags)
680 || test_bit(Unmerged, &rrdev->flags)))
681 rrdev = NULL;
682
683 r10_bio->devs[i].bio = NULL;
684 r10_bio->devs[i].repl_bio = NULL;
685 - if (!rdev || test_bit(Faulty, &rdev->flags) ||
686 - test_bit(Unmerged, &rdev->flags)) {
687 +
688 + if (!rdev && !rrdev) {
689 set_bit(R10BIO_Degraded, &r10_bio->state);
690 continue;
691 }
692 - if (test_bit(WriteErrorSeen, &rdev->flags)) {
693 + if (rdev && test_bit(WriteErrorSeen, &rdev->flags)) {
694 sector_t first_bad;
695 sector_t dev_sector = r10_bio->devs[i].addr;
696 int bad_sectors;
697 @@ -1340,8 +1343,10 @@ retry_write:
698 max_sectors = good_sectors;
699 }
700 }
701 - r10_bio->devs[i].bio = bio;
702 - atomic_inc(&rdev->nr_pending);
703 + if (rdev) {
704 + r10_bio->devs[i].bio = bio;
705 + atomic_inc(&rdev->nr_pending);
706 + }
707 if (rrdev) {
708 r10_bio->devs[i].repl_bio = bio;
709 atomic_inc(&rrdev->nr_pending);
710 @@ -1397,58 +1402,57 @@ retry_write:
711 for (i = 0; i < conf->copies; i++) {
712 struct bio *mbio;
713 int d = r10_bio->devs[i].devnum;
714 - if (!r10_bio->devs[i].bio)
715 - continue;
716 -
717 - mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
718 - md_trim_bio(mbio, r10_bio->sector - bio->bi_sector,
719 - max_sectors);
720 - r10_bio->devs[i].bio = mbio;
721 -
722 - mbio->bi_sector = (r10_bio->devs[i].addr+
723 - choose_data_offset(r10_bio,
724 - conf->mirrors[d].rdev));
725 - mbio->bi_bdev = conf->mirrors[d].rdev->bdev;
726 - mbio->bi_end_io = raid10_end_write_request;
727 - mbio->bi_rw = WRITE | do_sync | do_fua;
728 - mbio->bi_private = r10_bio;
729
730 - atomic_inc(&r10_bio->remaining);
731 - spin_lock_irqsave(&conf->device_lock, flags);
732 - bio_list_add(&conf->pending_bio_list, mbio);
733 - conf->pending_count++;
734 - spin_unlock_irqrestore(&conf->device_lock, flags);
735 - if (!mddev_check_plugged(mddev))
736 - md_wakeup_thread(mddev->thread);
737 -
738 - if (!r10_bio->devs[i].repl_bio)
739 - continue;
740 + if (r10_bio->devs[i].bio) {
741 + struct md_rdev *rdev = conf->mirrors[d].rdev;
742 + mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
743 + md_trim_bio(mbio, r10_bio->sector - bio->bi_sector,
744 + max_sectors);
745 + r10_bio->devs[i].bio = mbio;
746 +
747 + mbio->bi_sector = (r10_bio->devs[i].addr +
748 + choose_data_offset(r10_bio, rdev));
749 + mbio->bi_bdev = rdev->bdev;
750 + mbio->bi_end_io = raid10_end_write_request;
751 + mbio->bi_rw = WRITE | do_sync | do_fua;
752 + mbio->bi_private = r10_bio;
753
754 - mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
755 - md_trim_bio(mbio, r10_bio->sector - bio->bi_sector,
756 - max_sectors);
757 - r10_bio->devs[i].repl_bio = mbio;
758 + atomic_inc(&r10_bio->remaining);
759 + spin_lock_irqsave(&conf->device_lock, flags);
760 + bio_list_add(&conf->pending_bio_list, mbio);
761 + conf->pending_count++;
762 + spin_unlock_irqrestore(&conf->device_lock, flags);
763 + if (!mddev_check_plugged(mddev))
764 + md_wakeup_thread(mddev->thread);
765 + }
766
767 - /* We are actively writing to the original device
768 - * so it cannot disappear, so the replacement cannot
769 - * become NULL here
770 - */
771 - mbio->bi_sector = (r10_bio->devs[i].addr +
772 - choose_data_offset(
773 - r10_bio,
774 - conf->mirrors[d].replacement));
775 - mbio->bi_bdev = conf->mirrors[d].replacement->bdev;
776 - mbio->bi_end_io = raid10_end_write_request;
777 - mbio->bi_rw = WRITE | do_sync | do_fua;
778 - mbio->bi_private = r10_bio;
779 + if (r10_bio->devs[i].repl_bio) {
780 + struct md_rdev *rdev = conf->mirrors[d].replacement;
781 + if (rdev == NULL) {
782 + /* Replacement just got moved to main 'rdev' */
783 + smp_mb();
784 + rdev = conf->mirrors[d].rdev;
785 + }
786 + mbio = bio_clone_mddev(bio, GFP_NOIO, mddev);
787 + md_trim_bio(mbio, r10_bio->sector - bio->bi_sector,
788 + max_sectors);
789 + r10_bio->devs[i].repl_bio = mbio;
790 +
791 + mbio->bi_sector = (r10_bio->devs[i].addr +
792 + choose_data_offset(r10_bio, rdev));
793 + mbio->bi_bdev = rdev->bdev;
794 + mbio->bi_end_io = raid10_end_write_request;
795 + mbio->bi_rw = WRITE | do_sync | do_fua;
796 + mbio->bi_private = r10_bio;
797
798 - atomic_inc(&r10_bio->remaining);
799 - spin_lock_irqsave(&conf->device_lock, flags);
800 - bio_list_add(&conf->pending_bio_list, mbio);
801 - conf->pending_count++;
802 - spin_unlock_irqrestore(&conf->device_lock, flags);
803 - if (!mddev_check_plugged(mddev))
804 - md_wakeup_thread(mddev->thread);
805 + atomic_inc(&r10_bio->remaining);
806 + spin_lock_irqsave(&conf->device_lock, flags);
807 + bio_list_add(&conf->pending_bio_list, mbio);
808 + conf->pending_count++;
809 + spin_unlock_irqrestore(&conf->device_lock, flags);
810 + if (!mddev_check_plugged(mddev))
811 + md_wakeup_thread(mddev->thread);
812 + }
813 }
814
815 /* Don't remove the bias on 'remaining' (one_write_done) until
816 diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
817 index a50c205..02b7a4a 100644
818 --- a/drivers/mmc/host/sdhci-s3c.c
819 +++ b/drivers/mmc/host/sdhci-s3c.c
820 @@ -656,7 +656,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
821
822 pm_runtime_disable(&pdev->dev);
823
824 - for (ptr = 0; ptr < 3; ptr++) {
825 + for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
826 if (sc->clk_bus[ptr]) {
827 clk_disable(sc->clk_bus[ptr]);
828 clk_put(sc->clk_bus[ptr]);
829 diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c
830 index 8f52fc8..5a5cd2a 100644
831 --- a/drivers/mtd/devices/slram.c
832 +++ b/drivers/mtd/devices/slram.c
833 @@ -240,7 +240,7 @@ static int parse_cmdline(char *devname, char *szstart, char *szlength)
834
835 if (*(szlength) != '+') {
836 devlength = simple_strtoul(szlength, &buffer, 0);
837 - devlength = handle_unit(devlength, buffer) - devstart;
838 + devlength = handle_unit(devlength, buffer);
839 if (devlength < devstart)
840 goto err_out;
841
842 diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
843 index 64be8f0..d9127e2 100644
844 --- a/drivers/mtd/ofpart.c
845 +++ b/drivers/mtd/ofpart.c
846 @@ -121,7 +121,7 @@ static int parse_ofoldpart_partitions(struct mtd_info *master,
847 nr_parts = plen / sizeof(part[0]);
848
849 *pparts = kzalloc(nr_parts * sizeof(*(*pparts)), GFP_KERNEL);
850 - if (!pparts)
851 + if (!*pparts)
852 return -ENOMEM;
853
854 names = of_get_property(dp, "partition-names", &plen);
855 diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c
856 index 86f26a1..25723d8 100644
857 --- a/drivers/net/can/usb/peak_usb/pcan_usb.c
858 +++ b/drivers/net/can/usb/peak_usb/pcan_usb.c
859 @@ -519,8 +519,10 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n,
860 mc->pdev->dev.can.state = new_state;
861
862 if (status_len & PCAN_USB_STATUSLEN_TIMESTAMP) {
863 + struct skb_shared_hwtstamps *hwts = skb_hwtstamps(skb);
864 +
865 peak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv);
866 - skb->tstamp = timeval_to_ktime(tv);
867 + hwts->hwtstamp = timeval_to_ktime(tv);
868 }
869
870 netif_rx(skb);
871 @@ -605,6 +607,7 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len)
872 struct sk_buff *skb;
873 struct can_frame *cf;
874 struct timeval tv;
875 + struct skb_shared_hwtstamps *hwts;
876
877 skb = alloc_can_skb(mc->netdev, &cf);
878 if (!skb)
879 @@ -652,7 +655,8 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len)
880
881 /* convert timestamp into kernel time */
882 peak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv);
883 - skb->tstamp = timeval_to_ktime(tv);
884 + hwts = skb_hwtstamps(skb);
885 + hwts->hwtstamp = timeval_to_ktime(tv);
886
887 /* push the skb */
888 netif_rx(skb);
889 diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
890 index 629c4ba..c95913a 100644
891 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
892 +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
893 @@ -532,6 +532,7 @@ static int pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if,
894 struct can_frame *can_frame;
895 struct sk_buff *skb;
896 struct timeval tv;
897 + struct skb_shared_hwtstamps *hwts;
898
899 skb = alloc_can_skb(netdev, &can_frame);
900 if (!skb)
901 @@ -549,7 +550,8 @@ static int pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if,
902 memcpy(can_frame->data, rx->data, can_frame->can_dlc);
903
904 peak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(rx->ts32), &tv);
905 - skb->tstamp = timeval_to_ktime(tv);
906 + hwts = skb_hwtstamps(skb);
907 + hwts->hwtstamp = timeval_to_ktime(tv);
908
909 netif_rx(skb);
910 netdev->stats.rx_packets++;
911 @@ -570,6 +572,7 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if,
912 u8 err_mask = 0;
913 struct sk_buff *skb;
914 struct timeval tv;
915 + struct skb_shared_hwtstamps *hwts;
916
917 /* nothing should be sent while in BUS_OFF state */
918 if (dev->can.state == CAN_STATE_BUS_OFF)
919 @@ -664,7 +667,8 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if,
920 dev->can.state = new_state;
921
922 peak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(er->ts32), &tv);
923 - skb->tstamp = timeval_to_ktime(tv);
924 + hwts = skb_hwtstamps(skb);
925 + hwts->hwtstamp = timeval_to_ktime(tv);
926 netif_rx(skb);
927 netdev->stats.rx_packets++;
928 netdev->stats.rx_bytes += can_frame->can_dlc;
929 diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
930 index 90e41db..dbf37e4 100644
931 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
932 +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
933 @@ -70,6 +70,7 @@ static s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw)
934
935 switch (hw->device_id) {
936 case IXGBE_DEV_ID_X540T:
937 + case IXGBE_DEV_ID_X540T1:
938 return 0;
939 case IXGBE_DEV_ID_82599_T3_LOM:
940 return 0;
941 diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
942 index 4326f74..1fff36d 100644
943 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
944 +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
945 @@ -114,6 +114,7 @@ static DEFINE_PCI_DEVICE_TABLE(ixgbe_pci_tbl) = {
946 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_LS), board_82599 },
947 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599EN_SFP), board_82599 },
948 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_SF_QP), board_82599 },
949 + {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540T1), board_X540 },
950 /* required last entry */
951 {0, }
952 };
953 @@ -7010,6 +7011,7 @@ int ixgbe_wol_supported(struct ixgbe_adapter *adapter, u16 device_id,
954 is_wol_supported = 1;
955 break;
956 case IXGBE_DEV_ID_X540T:
957 + case IXGBE_DEV_ID_X540T1:
958 /* check eeprom to see if enabled wol */
959 if ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0_1) ||
960 ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0) &&
961 diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
962 index 400f86a..0722f33 100644
963 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
964 +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
965 @@ -65,6 +65,7 @@
966 #define IXGBE_DEV_ID_82599_LS 0x154F
967 #define IXGBE_DEV_ID_X540T 0x1528
968 #define IXGBE_DEV_ID_82599_SFP_SF_QP 0x154A
969 +#define IXGBE_DEV_ID_X540T1 0x1560
970
971 /* VF Device IDs */
972 #define IXGBE_DEV_ID_82599_VF 0x10ED
973 diff --git a/drivers/net/wireless/iwlwifi/dvm/mac80211.c b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
974 index a5f7bce..7a2cf52 100644
975 --- a/drivers/net/wireless/iwlwifi/dvm/mac80211.c
976 +++ b/drivers/net/wireless/iwlwifi/dvm/mac80211.c
977 @@ -1352,6 +1352,20 @@ static int iwlagn_mac_add_interface(struct ieee80211_hw *hw,
978 vif_priv->ctx = ctx;
979 ctx->vif = vif;
980
981 + /*
982 + * In SNIFFER device type, the firmware reports the FCS to
983 + * the host, rather than snipping it off. Unfortunately,
984 + * mac80211 doesn't (yet) provide a per-packet flag for
985 + * this, so that we have to set the hardware flag based
986 + * on the interfaces added. As the monitor interface can
987 + * only be present by itself, and will be removed before
988 + * other interfaces are added, this is safe.
989 + */
990 + if (vif->type == NL80211_IFTYPE_MONITOR)
991 + priv->hw->flags |= IEEE80211_HW_RX_INCLUDES_FCS;
992 + else
993 + priv->hw->flags &= ~IEEE80211_HW_RX_INCLUDES_FCS;
994 +
995 err = iwl_setup_interface(priv, ctx);
996 if (!err || reset)
997 goto out;
998 diff --git a/drivers/net/wireless/iwlwifi/pcie/tx.c b/drivers/net/wireless/iwlwifi/pcie/tx.c
999 index 6baf8de..b9d6152 100644
1000 --- a/drivers/net/wireless/iwlwifi/pcie/tx.c
1001 +++ b/drivers/net/wireless/iwlwifi/pcie/tx.c
1002 @@ -480,20 +480,12 @@ void iwl_trans_pcie_txq_enable(struct iwl_trans *trans, int txq_id, int fifo,
1003 void iwl_trans_pcie_txq_disable(struct iwl_trans *trans, int txq_id)
1004 {
1005 struct iwl_trans_pcie *trans_pcie = IWL_TRANS_GET_PCIE_TRANS(trans);
1006 - u16 rd_ptr, wr_ptr;
1007 - int n_bd = trans_pcie->txq[txq_id].q.n_bd;
1008
1009 if (!test_and_clear_bit(txq_id, trans_pcie->queue_used)) {
1010 WARN_ONCE(1, "queue %d not used", txq_id);
1011 return;
1012 }
1013
1014 - rd_ptr = iwl_read_prph(trans, SCD_QUEUE_RDPTR(txq_id)) & (n_bd - 1);
1015 - wr_ptr = iwl_read_prph(trans, SCD_QUEUE_WRPTR(txq_id));
1016 -
1017 - WARN_ONCE(rd_ptr != wr_ptr, "queue %d isn't empty: [%d,%d]",
1018 - txq_id, rd_ptr, wr_ptr);
1019 -
1020 iwl_txq_set_inactive(trans, txq_id);
1021 IWL_DEBUG_TX_QUEUES(trans, "Deactivate queue %d\n", txq_id);
1022 }
1023 diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
1024 index 565527a..95382f1 100644
1025 --- a/drivers/net/wireless/mwifiex/cmdevt.c
1026 +++ b/drivers/net/wireless/mwifiex/cmdevt.c
1027 @@ -887,9 +887,6 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
1028 return;
1029 }
1030 cmd_node = adapter->curr_cmd;
1031 - if (cmd_node->wait_q_enabled)
1032 - adapter->cmd_wait_q.status = -ETIMEDOUT;
1033 -
1034 if (cmd_node) {
1035 adapter->dbg.timeout_cmd_id =
1036 adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index];
1037 @@ -935,6 +932,14 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
1038
1039 dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n",
1040 adapter->ps_mode, adapter->ps_state);
1041 +
1042 + if (cmd_node->wait_q_enabled) {
1043 + adapter->cmd_wait_q.status = -ETIMEDOUT;
1044 + wake_up_interruptible(&adapter->cmd_wait_q.wait);
1045 + mwifiex_cancel_pending_ioctl(adapter);
1046 + /* reset cmd_sent flag to unblock new commands */
1047 + adapter->cmd_sent = false;
1048 + }
1049 }
1050 if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING)
1051 mwifiex_init_fw_complete(adapter);
1052 diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
1053 index fc8a9bf..82cf0fa 100644
1054 --- a/drivers/net/wireless/mwifiex/sdio.c
1055 +++ b/drivers/net/wireless/mwifiex/sdio.c
1056 @@ -161,7 +161,6 @@ static int mwifiex_sdio_suspend(struct device *dev)
1057 struct sdio_mmc_card *card;
1058 struct mwifiex_adapter *adapter;
1059 mmc_pm_flag_t pm_flag = 0;
1060 - int hs_actived = 0;
1061 int i;
1062 int ret = 0;
1063
1064 @@ -188,12 +187,14 @@ static int mwifiex_sdio_suspend(struct device *dev)
1065 adapter = card->adapter;
1066
1067 /* Enable the Host Sleep */
1068 - hs_actived = mwifiex_enable_hs(adapter);
1069 - if (hs_actived) {
1070 - pr_debug("cmd: suspend with MMC_PM_KEEP_POWER\n");
1071 - ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
1072 + if (!mwifiex_enable_hs(adapter)) {
1073 + dev_err(adapter->dev, "cmd: failed to suspend\n");
1074 + return -EFAULT;
1075 }
1076
1077 + dev_dbg(adapter->dev, "cmd: suspend with MMC_PM_KEEP_POWER\n");
1078 + ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
1079 +
1080 /* Indicate device suspended */
1081 adapter->is_suspended = true;
1082
1083 diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
1084 index 9970c2b..b7e6607 100644
1085 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
1086 +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
1087 @@ -297,6 +297,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
1088 /*=== Customer ID ===*/
1089 /****** 8188CU ********/
1090 {RTL_USB_DEVICE(0x050d, 0x1102, rtl92cu_hal_cfg)}, /*Belkin - Edimax*/
1091 + {RTL_USB_DEVICE(0x050d, 0x11f2, rtl92cu_hal_cfg)}, /*Belkin - ISY*/
1092 {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/
1093 {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/
1094 {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/
1095 diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
1096 index d606f52..83ba14e 100644
1097 --- a/drivers/nfc/pn533.c
1098 +++ b/drivers/nfc/pn533.c
1099 @@ -1618,11 +1618,14 @@ static void pn533_deactivate_target(struct nfc_dev *nfc_dev,
1100 static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1101 u8 *params, int params_len)
1102 {
1103 - struct pn533_cmd_jump_dep *cmd;
1104 struct pn533_cmd_jump_dep_response *resp;
1105 struct nfc_target nfc_target;
1106 u8 target_gt_len;
1107 int rc;
1108 + struct pn533_cmd_jump_dep *cmd = (struct pn533_cmd_jump_dep *)arg;
1109 + u8 active = cmd->active;
1110 +
1111 + kfree(arg);
1112
1113 if (params_len == -ENOENT) {
1114 nfc_dev_dbg(&dev->interface->dev, "");
1115 @@ -1644,7 +1647,6 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1116 }
1117
1118 resp = (struct pn533_cmd_jump_dep_response *) params;
1119 - cmd = (struct pn533_cmd_jump_dep *) arg;
1120 rc = resp->status & PN533_CMD_RET_MASK;
1121 if (rc != PN533_CMD_RET_SUCCESS) {
1122 nfc_dev_err(&dev->interface->dev,
1123 @@ -1674,7 +1676,7 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1124 if (rc == 0)
1125 rc = nfc_dep_link_is_up(dev->nfc_dev,
1126 dev->nfc_dev->targets[0].idx,
1127 - !cmd->active, NFC_RF_INITIATOR);
1128 + !active, NFC_RF_INITIATOR);
1129
1130 return 0;
1131 }
1132 @@ -1759,12 +1761,8 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, struct nfc_target *target,
1133 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame,
1134 dev->in_maxlen, pn533_in_dep_link_up_complete,
1135 cmd, GFP_KERNEL);
1136 - if (rc)
1137 - goto out;
1138 -
1139 -
1140 -out:
1141 - kfree(cmd);
1142 + if (rc < 0)
1143 + kfree(cmd);
1144
1145 return rc;
1146 }
1147 @@ -2018,8 +2016,12 @@ error:
1148 static int pn533_tm_send_complete(struct pn533 *dev, void *arg,
1149 u8 *params, int params_len)
1150 {
1151 + struct sk_buff *skb_out = arg;
1152 +
1153 nfc_dev_dbg(&dev->interface->dev, "%s", __func__);
1154
1155 + dev_kfree_skb(skb_out);
1156 +
1157 if (params_len < 0) {
1158 nfc_dev_err(&dev->interface->dev,
1159 "Error %d when sending data",
1160 @@ -2057,7 +2059,7 @@ static int pn533_tm_send(struct nfc_dev *nfc_dev, struct sk_buff *skb)
1161
1162 rc = pn533_send_cmd_frame_async(dev, out_frame, dev->in_frame,
1163 dev->in_maxlen, pn533_tm_send_complete,
1164 - NULL, GFP_KERNEL);
1165 + skb, GFP_KERNEL);
1166 if (rc) {
1167 nfc_dev_err(&dev->interface->dev,
1168 "Error %d when trying to send data", rc);
1169 diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
1170 index 7a0431c..94483c9 100644
1171 --- a/drivers/scsi/isci/request.c
1172 +++ b/drivers/scsi/isci/request.c
1173 @@ -1972,7 +1972,7 @@ sci_io_request_frame_handler(struct isci_request *ireq,
1174 frame_index,
1175 (void **)&frame_buffer);
1176
1177 - sci_controller_copy_sata_response(&ireq->stp.req,
1178 + sci_controller_copy_sata_response(&ireq->stp.rsp,
1179 frame_header,
1180 frame_buffer);
1181
1182 diff --git a/fs/ext4/resize.c b/fs/ext4/resize.c
1183 index 101b41c..82e1fde3 100644
1184 --- a/fs/ext4/resize.c
1185 +++ b/fs/ext4/resize.c
1186 @@ -979,8 +979,6 @@ static void update_backups(struct super_block *sb,
1187 goto exit_err;
1188 }
1189
1190 - ext4_superblock_csum_set(sb);
1191 -
1192 while ((group = ext4_list_backups(sb, &three, &five, &seven)) < last) {
1193 struct buffer_head *bh;
1194
1195 diff --git a/fs/fs-writeback.c b/fs/fs-writeback.c
1196 index 5602d73..af321a6 100644
1197 --- a/fs/fs-writeback.c
1198 +++ b/fs/fs-writeback.c
1199 @@ -228,6 +228,8 @@ static void requeue_io(struct inode *inode, struct bdi_writeback *wb)
1200 static void inode_sync_complete(struct inode *inode)
1201 {
1202 inode->i_state &= ~I_SYNC;
1203 + /* If inode is clean an unused, put it into LRU now... */
1204 + inode_add_lru(inode);
1205 /* Waiters must see I_SYNC cleared before being woken up */
1206 smp_mb();
1207 wake_up_bit(&inode->i_state, __I_SYNC);
1208 diff --git a/fs/inode.c b/fs/inode.c
1209 index ac8d904..7c14897 100644
1210 --- a/fs/inode.c
1211 +++ b/fs/inode.c
1212 @@ -408,6 +408,19 @@ static void inode_lru_list_add(struct inode *inode)
1213 spin_unlock(&inode->i_sb->s_inode_lru_lock);
1214 }
1215
1216 +/*
1217 + * Add inode to LRU if needed (inode is unused and clean).
1218 + *
1219 + * Needs inode->i_lock held.
1220 + */
1221 +void inode_add_lru(struct inode *inode)
1222 +{
1223 + if (!(inode->i_state & (I_DIRTY | I_SYNC | I_FREEING | I_WILL_FREE)) &&
1224 + !atomic_read(&inode->i_count) && inode->i_sb->s_flags & MS_ACTIVE)
1225 + inode_lru_list_add(inode);
1226 +}
1227 +
1228 +
1229 static void inode_lru_list_del(struct inode *inode)
1230 {
1231 spin_lock(&inode->i_sb->s_inode_lru_lock);
1232 @@ -1390,8 +1403,7 @@ static void iput_final(struct inode *inode)
1233
1234 if (!drop && (sb->s_flags & MS_ACTIVE)) {
1235 inode->i_state |= I_REFERENCED;
1236 - if (!(inode->i_state & (I_DIRTY|I_SYNC)))
1237 - inode_lru_list_add(inode);
1238 + inode_add_lru(inode);
1239 spin_unlock(&inode->i_lock);
1240 return;
1241 }
1242 diff --git a/fs/internal.h b/fs/internal.h
1243 index 371bcc4..52813bd 100644
1244 --- a/fs/internal.h
1245 +++ b/fs/internal.h
1246 @@ -110,6 +110,7 @@ extern int open_check_o_direct(struct file *f);
1247 * inode.c
1248 */
1249 extern spinlock_t inode_sb_list_lock;
1250 +extern void inode_add_lru(struct inode *inode);
1251
1252 /*
1253 * fs-writeback.c
1254 diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
1255 index 78b7f84..7f5120b 100644
1256 --- a/fs/jbd/transaction.c
1257 +++ b/fs/jbd/transaction.c
1258 @@ -1961,7 +1961,9 @@ retry:
1259 spin_unlock(&journal->j_list_lock);
1260 jbd_unlock_bh_state(bh);
1261 spin_unlock(&journal->j_state_lock);
1262 + unlock_buffer(bh);
1263 log_wait_commit(journal, tid);
1264 + lock_buffer(bh);
1265 goto retry;
1266 }
1267 /*
1268 diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
1269 index db3889b..8608f87 100644
1270 --- a/fs/jffs2/file.c
1271 +++ b/fs/jffs2/file.c
1272 @@ -138,33 +138,39 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
1273 struct page *pg;
1274 struct inode *inode = mapping->host;
1275 struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
1276 + struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
1277 + struct jffs2_raw_inode ri;
1278 + uint32_t alloc_len = 0;
1279 pgoff_t index = pos >> PAGE_CACHE_SHIFT;
1280 uint32_t pageofs = index << PAGE_CACHE_SHIFT;
1281 int ret = 0;
1282
1283 + jffs2_dbg(1, "%s()\n", __func__);
1284 +
1285 + if (pageofs > inode->i_size) {
1286 + ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len,
1287 + ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
1288 + if (ret)
1289 + return ret;
1290 + }
1291 +
1292 + mutex_lock(&f->sem);
1293 pg = grab_cache_page_write_begin(mapping, index, flags);
1294 - if (!pg)
1295 + if (!pg) {
1296 + if (alloc_len)
1297 + jffs2_complete_reservation(c);
1298 + mutex_unlock(&f->sem);
1299 return -ENOMEM;
1300 + }
1301 *pagep = pg;
1302
1303 - jffs2_dbg(1, "%s()\n", __func__);
1304 -
1305 - if (pageofs > inode->i_size) {
1306 + if (alloc_len) {
1307 /* Make new hole frag from old EOF to new page */
1308 - struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
1309 - struct jffs2_raw_inode ri;
1310 struct jffs2_full_dnode *fn;
1311 - uint32_t alloc_len;
1312
1313 jffs2_dbg(1, "Writing new hole frag 0x%x-0x%x between current EOF and new page\n",
1314 (unsigned int)inode->i_size, pageofs);
1315
1316 - ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len,
1317 - ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
1318 - if (ret)
1319 - goto out_page;
1320 -
1321 - mutex_lock(&f->sem);
1322 memset(&ri, 0, sizeof(ri));
1323
1324 ri.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
1325 @@ -191,7 +197,6 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
1326 if (IS_ERR(fn)) {
1327 ret = PTR_ERR(fn);
1328 jffs2_complete_reservation(c);
1329 - mutex_unlock(&f->sem);
1330 goto out_page;
1331 }
1332 ret = jffs2_add_full_dnode_to_inode(c, f, fn);
1333 @@ -206,12 +211,10 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
1334 jffs2_mark_node_obsolete(c, fn->raw);
1335 jffs2_free_full_dnode(fn);
1336 jffs2_complete_reservation(c);
1337 - mutex_unlock(&f->sem);
1338 goto out_page;
1339 }
1340 jffs2_complete_reservation(c);
1341 inode->i_size = pageofs;
1342 - mutex_unlock(&f->sem);
1343 }
1344
1345 /*
1346 @@ -220,18 +223,18 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
1347 * case of a short-copy.
1348 */
1349 if (!PageUptodate(pg)) {
1350 - mutex_lock(&f->sem);
1351 ret = jffs2_do_readpage_nolock(inode, pg);
1352 - mutex_unlock(&f->sem);
1353 if (ret)
1354 goto out_page;
1355 }
1356 + mutex_unlock(&f->sem);
1357 jffs2_dbg(1, "end write_begin(). pg->flags %lx\n", pg->flags);
1358 return ret;
1359
1360 out_page:
1361 unlock_page(pg);
1362 page_cache_release(pg);
1363 + mutex_unlock(&f->sem);
1364 return ret;
1365 }
1366
1367 diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c
1368 index 0b311bc..6a37656 100644
1369 --- a/fs/pstore/ram.c
1370 +++ b/fs/pstore/ram.c
1371 @@ -406,7 +406,7 @@ static int __devinit ramoops_probe(struct platform_device *pdev)
1372 goto fail_init_fprz;
1373
1374 if (!cxt->przs && !cxt->cprz && !cxt->fprz) {
1375 - pr_err("memory size too small, minimum is %lu\n",
1376 + pr_err("memory size too small, minimum is %zu\n",
1377 cxt->console_size + cxt->record_size +
1378 cxt->ftrace_size);
1379 goto fail_cnt;
1380 diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
1381 index af1cbaf..c5c35e6 100644
1382 --- a/include/drm/drm_pciids.h
1383 +++ b/include/drm/drm_pciids.h
1384 @@ -210,6 +210,7 @@
1385 {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1386 {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1387 {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1388 + {0x1002, 0x679B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1389 {0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1390 {0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1391 {0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1392 diff --git a/kernel/futex.c b/kernel/futex.c
1393 index 20ef219..19eb089 100644
1394 --- a/kernel/futex.c
1395 +++ b/kernel/futex.c
1396 @@ -843,6 +843,9 @@ static void wake_futex(struct futex_q *q)
1397 {
1398 struct task_struct *p = q->task;
1399
1400 + if (WARN(q->pi_state || q->rt_waiter, "refusing to wake PI futex\n"))
1401 + return;
1402 +
1403 /*
1404 * We set q->lock_ptr = NULL _before_ we wake up the task. If
1405 * a non-futex wake up happens on another CPU then the task
1406 @@ -1078,6 +1081,10 @@ retry_private:
1407
1408 plist_for_each_entry_safe(this, next, head, list) {
1409 if (match_futex (&this->key, &key1)) {
1410 + if (this->pi_state || this->rt_waiter) {
1411 + ret = -EINVAL;
1412 + goto out_unlock;
1413 + }
1414 wake_futex(this);
1415 if (++ret >= nr_wake)
1416 break;
1417 @@ -1090,6 +1097,10 @@ retry_private:
1418 op_ret = 0;
1419 plist_for_each_entry_safe(this, next, head, list) {
1420 if (match_futex (&this->key, &key2)) {
1421 + if (this->pi_state || this->rt_waiter) {
1422 + ret = -EINVAL;
1423 + goto out_unlock;
1424 + }
1425 wake_futex(this);
1426 if (++op_ret >= nr_wake2)
1427 break;
1428 @@ -1098,6 +1109,7 @@ retry_private:
1429 ret += op_ret;
1430 }
1431
1432 +out_unlock:
1433 double_unlock_hb(hb1, hb2);
1434 out_put_keys:
1435 put_futex_key(&key2);
1436 @@ -1387,9 +1399,13 @@ retry_private:
1437 /*
1438 * FUTEX_WAIT_REQEUE_PI and FUTEX_CMP_REQUEUE_PI should always
1439 * be paired with each other and no other futex ops.
1440 + *
1441 + * We should never be requeueing a futex_q with a pi_state,
1442 + * which is awaiting a futex_unlock_pi().
1443 */
1444 if ((requeue_pi && !this->rt_waiter) ||
1445 - (!requeue_pi && this->rt_waiter)) {
1446 + (!requeue_pi && this->rt_waiter) ||
1447 + this->pi_state) {
1448 ret = -EINVAL;
1449 break;
1450 }
1451 diff --git a/kernel/watchdog.c b/kernel/watchdog.c
1452 index 4b1dfba..775fa0f 100644
1453 --- a/kernel/watchdog.c
1454 +++ b/kernel/watchdog.c
1455 @@ -113,7 +113,7 @@ static unsigned long get_timestamp(int this_cpu)
1456 return cpu_clock(this_cpu) >> 30LL; /* 2^30 ~= 10^9 */
1457 }
1458
1459 -static unsigned long get_sample_period(void)
1460 +static u64 get_sample_period(void)
1461 {
1462 /*
1463 * convert watchdog_thresh from seconds to ns
1464 @@ -122,7 +122,7 @@ static unsigned long get_sample_period(void)
1465 * and hard thresholds) to increment before the
1466 * hardlockup detector generates a warning
1467 */
1468 - return get_softlockup_thresh() * (NSEC_PER_SEC / 5);
1469 + return get_softlockup_thresh() * ((u64)NSEC_PER_SEC / 5);
1470 }
1471
1472 /* Commands for resetting the watchdog */
1473 diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
1474 index 29f9862..280405b 100644
1475 --- a/lib/mpi/longlong.h
1476 +++ b/lib/mpi/longlong.h
1477 @@ -703,7 +703,14 @@ do { \
1478 ************** MIPS *****************
1479 ***************************************/
1480 #if defined(__mips__) && W_TYPE_SIZE == 32
1481 -#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
1482 +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
1483 +#define umul_ppmm(w1, w0, u, v) \
1484 +do { \
1485 + UDItype __ll = (UDItype)(u) * (v); \
1486 + w1 = __ll >> 32; \
1487 + w0 = __ll; \
1488 +} while (0)
1489 +#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
1490 #define umul_ppmm(w1, w0, u, v) \
1491 __asm__ ("multu %2,%3" \
1492 : "=l" ((USItype)(w0)), \
1493 @@ -728,7 +735,15 @@ do { \
1494 ************** MIPS/64 **************
1495 ***************************************/
1496 #if (defined(__mips) && __mips >= 3) && W_TYPE_SIZE == 64
1497 -#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
1498 +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
1499 +#define umul_ppmm(w1, w0, u, v) \
1500 +do { \
1501 + typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \
1502 + __ll_UTItype __ll = (__ll_UTItype)(u) * (v); \
1503 + w1 = __ll >> 64; \
1504 + w0 = __ll; \
1505 +} while (0)
1506 +#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
1507 #define umul_ppmm(w1, w0, u, v) \
1508 __asm__ ("dmultu %2,%3" \
1509 : "=l" ((UDItype)(w0)), \
1510 diff --git a/mm/vmscan.c b/mm/vmscan.c
1511 index a018dfc..40db7d1 100644
1512 --- a/mm/vmscan.c
1513 +++ b/mm/vmscan.c
1514 @@ -2176,9 +2176,12 @@ static bool pfmemalloc_watermark_ok(pg_data_t *pgdat)
1515 * Throttle direct reclaimers if backing storage is backed by the network
1516 * and the PFMEMALLOC reserve for the preferred node is getting dangerously
1517 * depleted. kswapd will continue to make progress and wake the processes
1518 - * when the low watermark is reached
1519 + * when the low watermark is reached.
1520 + *
1521 + * Returns true if a fatal signal was delivered during throttling. If this
1522 + * happens, the page allocator should not consider triggering the OOM killer.
1523 */
1524 -static void throttle_direct_reclaim(gfp_t gfp_mask, struct zonelist *zonelist,
1525 +static bool throttle_direct_reclaim(gfp_t gfp_mask, struct zonelist *zonelist,
1526 nodemask_t *nodemask)
1527 {
1528 struct zone *zone;
1529 @@ -2193,13 +2196,20 @@ static void throttle_direct_reclaim(gfp_t gfp_mask, struct zonelist *zonelist,
1530 * processes to block on log_wait_commit().
1531 */
1532 if (current->flags & PF_KTHREAD)
1533 - return;
1534 + goto out;
1535 +
1536 + /*
1537 + * If a fatal signal is pending, this process should not throttle.
1538 + * It should return quickly so it can exit and free its memory
1539 + */
1540 + if (fatal_signal_pending(current))
1541 + goto out;
1542
1543 /* Check if the pfmemalloc reserves are ok */
1544 first_zones_zonelist(zonelist, high_zoneidx, NULL, &zone);
1545 pgdat = zone->zone_pgdat;
1546 if (pfmemalloc_watermark_ok(pgdat))
1547 - return;
1548 + goto out;
1549
1550 /* Account for the throttling */
1551 count_vm_event(PGSCAN_DIRECT_THROTTLE);
1552 @@ -2215,12 +2225,20 @@ static void throttle_direct_reclaim(gfp_t gfp_mask, struct zonelist *zonelist,
1553 if (!(gfp_mask & __GFP_FS)) {
1554 wait_event_interruptible_timeout(pgdat->pfmemalloc_wait,
1555 pfmemalloc_watermark_ok(pgdat), HZ);
1556 - return;
1557 +
1558 + goto check_pending;
1559 }
1560
1561 /* Throttle until kswapd wakes the process */
1562 wait_event_killable(zone->zone_pgdat->pfmemalloc_wait,
1563 pfmemalloc_watermark_ok(pgdat));
1564 +
1565 +check_pending:
1566 + if (fatal_signal_pending(current))
1567 + return true;
1568 +
1569 +out:
1570 + return false;
1571 }
1572
1573 unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
1574 @@ -2242,13 +2260,12 @@ unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
1575 .gfp_mask = sc.gfp_mask,
1576 };
1577
1578 - throttle_direct_reclaim(gfp_mask, zonelist, nodemask);
1579 -
1580 /*
1581 - * Do not enter reclaim if fatal signal is pending. 1 is returned so
1582 - * that the page allocator does not consider triggering OOM
1583 + * Do not enter reclaim if fatal signal was delivered while throttled.
1584 + * 1 is returned so that the page allocator does not OOM kill at this
1585 + * point.
1586 */
1587 - if (fatal_signal_pending(current))
1588 + if (throttle_direct_reclaim(gfp_mask, zonelist, nodemask))
1589 return 1;
1590
1591 trace_mm_vmscan_direct_reclaim_begin(order,
1592 diff --git a/net/can/bcm.c b/net/can/bcm.c
1593 index 151b773..3910c1f 100644
1594 --- a/net/can/bcm.c
1595 +++ b/net/can/bcm.c
1596 @@ -1084,6 +1084,9 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
1597 op->sk = sk;
1598 op->ifindex = ifindex;
1599
1600 + /* ifindex for timeout events w/o previous frame reception */
1601 + op->rx_ifindex = ifindex;
1602 +
1603 /* initialize uninitialized (kzalloc) structure */
1604 hrtimer_init(&op->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
1605 op->timer.function = bcm_rx_timeout_handler;
1606 diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c
1607 index 7260717..20bb371 100644
1608 --- a/net/core/net-sysfs.c
1609 +++ b/net/core/net-sysfs.c
1610 @@ -417,6 +417,17 @@ static struct attribute_group netstat_group = {
1611 .name = "statistics",
1612 .attrs = netstat_attrs,
1613 };
1614 +
1615 +#if IS_ENABLED(CONFIG_WIRELESS_EXT) || IS_ENABLED(CONFIG_CFG80211)
1616 +static struct attribute *wireless_attrs[] = {
1617 + NULL
1618 +};
1619 +
1620 +static struct attribute_group wireless_group = {
1621 + .name = "wireless",
1622 + .attrs = wireless_attrs,
1623 +};
1624 +#endif
1625 #endif /* CONFIG_SYSFS */
1626
1627 #ifdef CONFIG_RPS
1628 @@ -1397,6 +1408,15 @@ int netdev_register_kobject(struct net_device *net)
1629 groups++;
1630
1631 *groups++ = &netstat_group;
1632 +
1633 +#if IS_ENABLED(CONFIG_WIRELESS_EXT) || IS_ENABLED(CONFIG_CFG80211)
1634 + if (net->ieee80211_ptr)
1635 + *groups++ = &wireless_group;
1636 +#if IS_ENABLED(CONFIG_WIRELESS_EXT)
1637 + else if (net->wireless_handlers)
1638 + *groups++ = &wireless_group;
1639 +#endif
1640 +#endif
1641 #endif /* CONFIG_SYSFS */
1642
1643 error = device_add(dev);
1644 diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
1645 index 327aa07..a5894dd 100644
1646 --- a/net/mac80211/ibss.c
1647 +++ b/net/mac80211/ibss.c
1648 @@ -1117,10 +1117,6 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
1649
1650 mutex_lock(&sdata->u.ibss.mtx);
1651
1652 - sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH;
1653 - memset(sdata->u.ibss.bssid, 0, ETH_ALEN);
1654 - sdata->u.ibss.ssid_len = 0;
1655 -
1656 active_ibss = ieee80211_sta_active_ibss(sdata);
1657
1658 if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) {
1659 @@ -1141,6 +1137,10 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
1660 }
1661 }
1662
1663 + ifibss->state = IEEE80211_IBSS_MLME_SEARCH;
1664 + memset(ifibss->bssid, 0, ETH_ALEN);
1665 + ifibss->ssid_len = 0;
1666 +
1667 sta_info_flush(sdata->local, sdata);
1668
1669 spin_lock_bh(&ifibss->incomplete_lock);
1670 diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c
1671 index 7dd983a..83a3592 100644
1672 --- a/net/nfc/llcp/llcp.c
1673 +++ b/net/nfc/llcp/llcp.c
1674 @@ -1190,7 +1190,7 @@ int nfc_llcp_register_device(struct nfc_dev *ndev)
1675 local->remote_miu = LLCP_DEFAULT_MIU;
1676 local->remote_lto = LLCP_DEFAULT_LTO;
1677
1678 - list_add(&llcp_devices, &local->list);
1679 + list_add(&local->list, &llcp_devices);
1680
1681 return 0;
1682
1683 diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
1684 index 2bb9bee..10fc710 100644
1685 --- a/sound/pci/hda/patch_cirrus.c
1686 +++ b/sound/pci/hda/patch_cirrus.c
1687 @@ -461,6 +461,7 @@ static int parse_output(struct hda_codec *codec)
1688 memcpy(cfg->speaker_pins, cfg->line_out_pins,
1689 sizeof(cfg->speaker_pins));
1690 cfg->line_outs = 0;
1691 + memset(cfg->line_out_pins, 0, sizeof(cfg->line_out_pins));
1692 }
1693
1694 return 0;
1695 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1696 index f6b5995..e1b7061 100644
1697 --- a/sound/pci/hda/patch_realtek.c
1698 +++ b/sound/pci/hda/patch_realtek.c
1699 @@ -4280,6 +4280,7 @@ static void alc_auto_init_std(struct hda_codec *codec)
1700 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
1701
1702 static const struct snd_pci_quirk beep_white_list[] = {
1703 + SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1704 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1705 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1706 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1707 @@ -7089,6 +7090,9 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
1708 { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 },
1709 { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 },
1710 { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 },
1711 + { .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 },
1712 + { .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 },
1713 + { .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 },
1714 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
1715 .patch = patch_alc861 },
1716 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },
1717 diff --git a/sound/usb/midi.c b/sound/usb/midi.c
1718 index c83f614..eeefbce 100644
1719 --- a/sound/usb/midi.c
1720 +++ b/sound/usb/midi.c
1721 @@ -148,6 +148,7 @@ struct snd_usb_midi_out_endpoint {
1722 struct snd_usb_midi_out_endpoint* ep;
1723 struct snd_rawmidi_substream *substream;
1724 int active;
1725 + bool autopm_reference;
1726 uint8_t cable; /* cable number << 4 */
1727 uint8_t state;
1728 #define STATE_UNKNOWN 0
1729 @@ -1076,7 +1077,8 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
1730 return -ENXIO;
1731 }
1732 err = usb_autopm_get_interface(umidi->iface);
1733 - if (err < 0)
1734 + port->autopm_reference = err >= 0;
1735 + if (err < 0 && err != -EACCES)
1736 return -EIO;
1737 substream->runtime->private_data = port;
1738 port->state = STATE_UNKNOWN;
1739 @@ -1087,9 +1089,11 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
1740 static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream)
1741 {
1742 struct snd_usb_midi* umidi = substream->rmidi->private_data;
1743 + struct usbmidi_out_port *port = substream->runtime->private_data;
1744
1745 substream_open(substream, 0);
1746 - usb_autopm_put_interface(umidi->iface);
1747 + if (port->autopm_reference)
1748 + usb_autopm_put_interface(umidi->iface);
1749 return 0;
1750 }
1751