Magellan Linux

Contents of /trunk/kernel-alx/patches-3.4/0120-3.4.21-all-fixes.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2110 - (show annotations) (download)
Tue Mar 12 12:15:23 2013 UTC (11 years, 1 month ago) by niro
File size: 53970 byte(s)
-sync with upstream
1 diff --git a/Documentation/dvb/get_dvb_firmware b/Documentation/dvb/get_dvb_firmware
2 index d1d4a17..b361e08 100755
3 --- a/Documentation/dvb/get_dvb_firmware
4 +++ b/Documentation/dvb/get_dvb_firmware
5 @@ -115,7 +115,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/arm/plat-omap/counter_32k.c b/arch/arm/plat-omap/counter_32k.c
15 index 5068fe5..fd433e7 100644
16 --- a/arch/arm/plat-omap/counter_32k.c
17 +++ b/arch/arm/plat-omap/counter_32k.c
18 @@ -50,22 +50,29 @@ static u32 notrace omap_32k_read_sched_clock(void)
19 * nsecs and adds to a monotonically increasing timespec.
20 */
21 static struct timespec persistent_ts;
22 -static cycles_t cycles, last_cycles;
23 +static cycles_t cycles;
24 static unsigned int persistent_mult, persistent_shift;
25 +static DEFINE_SPINLOCK(read_persistent_clock_lock);
26 +
27 void read_persistent_clock(struct timespec *ts)
28 {
29 unsigned long long nsecs;
30 - cycles_t delta;
31 - struct timespec *tsp = &persistent_ts;
32 + cycles_t last_cycles;
33 + unsigned long flags;
34 +
35 + spin_lock_irqsave(&read_persistent_clock_lock, flags);
36
37 last_cycles = cycles;
38 cycles = timer_32k_base ? __raw_readl(timer_32k_base) : 0;
39 - delta = cycles - last_cycles;
40
41 - nsecs = clocksource_cyc2ns(delta, persistent_mult, persistent_shift);
42 + nsecs = clocksource_cyc2ns(cycles - last_cycles,
43 + persistent_mult, persistent_shift);
44 +
45 + timespec_add_ns(&persistent_ts, nsecs);
46 +
47 + *ts = persistent_ts;
48
49 - timespec_add_ns(tsp, nsecs);
50 - *ts = *tsp;
51 + spin_unlock_irqrestore(&read_persistent_clock_lock, flags);
52 }
53
54 int __init omap_init_clocksource_32k(void)
55 diff --git a/arch/parisc/kernel/signal32.c b/arch/parisc/kernel/signal32.c
56 index e141324..d0ea054 100644
57 --- a/arch/parisc/kernel/signal32.c
58 +++ b/arch/parisc/kernel/signal32.c
59 @@ -67,7 +67,8 @@ put_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
60 {
61 compat_sigset_t s;
62
63 - if (sz != sizeof *set) panic("put_sigset32()");
64 + if (sz != sizeof *set)
65 + return -EINVAL;
66 sigset_64to32(&s, set);
67
68 return copy_to_user(up, &s, sizeof s);
69 @@ -79,7 +80,8 @@ get_sigset32(compat_sigset_t __user *up, sigset_t *set, size_t sz)
70 compat_sigset_t s;
71 int r;
72
73 - if (sz != sizeof *set) panic("put_sigset32()");
74 + if (sz != sizeof *set)
75 + return -EINVAL;
76
77 if ((r = copy_from_user(&s, up, sz)) == 0) {
78 sigset_32to64(set, &s);
79 diff --git a/arch/parisc/kernel/sys_parisc.c b/arch/parisc/kernel/sys_parisc.c
80 index c9b9322..7ea75d1 100644
81 --- a/arch/parisc/kernel/sys_parisc.c
82 +++ b/arch/parisc/kernel/sys_parisc.c
83 @@ -73,6 +73,8 @@ static unsigned long get_shared_area(struct address_space *mapping,
84 struct vm_area_struct *vma;
85 int offset = mapping ? get_offset(mapping) : 0;
86
87 + offset = (offset + (pgoff << PAGE_SHIFT)) & 0x3FF000;
88 +
89 addr = DCACHE_ALIGN(addr - offset) + offset;
90
91 for (vma = find_vma(current->mm, addr); ; vma = vma->vm_next) {
92 diff --git a/arch/powerpc/platforms/pseries/eeh_driver.c b/arch/powerpc/platforms/pseries/eeh_driver.c
93 index baf92cd..041e28d 100644
94 --- a/arch/powerpc/platforms/pseries/eeh_driver.c
95 +++ b/arch/powerpc/platforms/pseries/eeh_driver.c
96 @@ -25,6 +25,7 @@
97 #include <linux/delay.h>
98 #include <linux/interrupt.h>
99 #include <linux/irq.h>
100 +#include <linux/module.h>
101 #include <linux/pci.h>
102 #include <asm/eeh.h>
103 #include <asm/eeh_event.h>
104 @@ -47,6 +48,41 @@ static inline const char *eeh_pcid_name(struct pci_dev *pdev)
105 return "";
106 }
107
108 +/**
109 + * eeh_pcid_get - Get the PCI device driver
110 + * @pdev: PCI device
111 + *
112 + * The function is used to retrieve the PCI device driver for
113 + * the indicated PCI device. Besides, we will increase the reference
114 + * of the PCI device driver to prevent that being unloaded on
115 + * the fly. Otherwise, kernel crash would be seen.
116 + */
117 +static inline struct pci_driver *eeh_pcid_get(struct pci_dev *pdev)
118 +{
119 + if (!pdev || !pdev->driver)
120 + return NULL;
121 +
122 + if (!try_module_get(pdev->driver->driver.owner))
123 + return NULL;
124 +
125 + return pdev->driver;
126 +}
127 +
128 +/**
129 + * eeh_pcid_put - Dereference on the PCI device driver
130 + * @pdev: PCI device
131 + *
132 + * The function is called to do dereference on the PCI device
133 + * driver of the indicated PCI device.
134 + */
135 +static inline void eeh_pcid_put(struct pci_dev *pdev)
136 +{
137 + if (!pdev || !pdev->driver)
138 + return;
139 +
140 + module_put(pdev->driver->driver.owner);
141 +}
142 +
143 #if 0
144 static void print_device_node_tree(struct pci_dn *pdn, int dent)
145 {
146 @@ -126,18 +162,20 @@ static void eeh_enable_irq(struct pci_dev *dev)
147 static int eeh_report_error(struct pci_dev *dev, void *userdata)
148 {
149 enum pci_ers_result rc, *res = userdata;
150 - struct pci_driver *driver = dev->driver;
151 + struct pci_driver *driver;
152
153 dev->error_state = pci_channel_io_frozen;
154
155 - if (!driver)
156 - return 0;
157 + driver = eeh_pcid_get(dev);
158 + if (!driver) return 0;
159
160 eeh_disable_irq(dev);
161
162 if (!driver->err_handler ||
163 - !driver->err_handler->error_detected)
164 + !driver->err_handler->error_detected) {
165 + eeh_pcid_put(dev);
166 return 0;
167 + }
168
169 rc = driver->err_handler->error_detected(dev, pci_channel_io_frozen);
170
171 @@ -145,6 +183,7 @@ static int eeh_report_error(struct pci_dev *dev, void *userdata)
172 if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
173 if (*res == PCI_ERS_RESULT_NONE) *res = rc;
174
175 + eeh_pcid_put(dev);
176 return 0;
177 }
178
179 @@ -160,12 +199,16 @@ static int eeh_report_error(struct pci_dev *dev, void *userdata)
180 static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
181 {
182 enum pci_ers_result rc, *res = userdata;
183 - struct pci_driver *driver = dev->driver;
184 + struct pci_driver *driver;
185 +
186 + driver = eeh_pcid_get(dev);
187 + if (!driver) return 0;
188
189 - if (!driver ||
190 - !driver->err_handler ||
191 - !driver->err_handler->mmio_enabled)
192 + if (!driver->err_handler ||
193 + !driver->err_handler->mmio_enabled) {
194 + eeh_pcid_put(dev);
195 return 0;
196 + }
197
198 rc = driver->err_handler->mmio_enabled(dev);
199
200 @@ -173,6 +216,7 @@ static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
201 if (rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
202 if (*res == PCI_ERS_RESULT_NONE) *res = rc;
203
204 + eeh_pcid_put(dev);
205 return 0;
206 }
207
208 @@ -189,18 +233,20 @@ static int eeh_report_mmio_enabled(struct pci_dev *dev, void *userdata)
209 static int eeh_report_reset(struct pci_dev *dev, void *userdata)
210 {
211 enum pci_ers_result rc, *res = userdata;
212 - struct pci_driver *driver = dev->driver;
213 -
214 - if (!driver)
215 - return 0;
216 + struct pci_driver *driver;
217
218 dev->error_state = pci_channel_io_normal;
219
220 + driver = eeh_pcid_get(dev);
221 + if (!driver) return 0;
222 +
223 eeh_enable_irq(dev);
224
225 if (!driver->err_handler ||
226 - !driver->err_handler->slot_reset)
227 + !driver->err_handler->slot_reset) {
228 + eeh_pcid_put(dev);
229 return 0;
230 + }
231
232 rc = driver->err_handler->slot_reset(dev);
233 if ((*res == PCI_ERS_RESULT_NONE) ||
234 @@ -208,6 +254,7 @@ static int eeh_report_reset(struct pci_dev *dev, void *userdata)
235 if (*res == PCI_ERS_RESULT_DISCONNECT &&
236 rc == PCI_ERS_RESULT_NEED_RESET) *res = rc;
237
238 + eeh_pcid_put(dev);
239 return 0;
240 }
241
242 @@ -222,21 +269,24 @@ static int eeh_report_reset(struct pci_dev *dev, void *userdata)
243 */
244 static int eeh_report_resume(struct pci_dev *dev, void *userdata)
245 {
246 - struct pci_driver *driver = dev->driver;
247 + struct pci_driver *driver;
248
249 dev->error_state = pci_channel_io_normal;
250
251 - if (!driver)
252 - return 0;
253 + driver = eeh_pcid_get(dev);
254 + if (!driver) return 0;
255
256 eeh_enable_irq(dev);
257
258 if (!driver->err_handler ||
259 - !driver->err_handler->resume)
260 + !driver->err_handler->resume) {
261 + eeh_pcid_put(dev);
262 return 0;
263 + }
264
265 driver->err_handler->resume(dev);
266
267 + eeh_pcid_put(dev);
268 return 0;
269 }
270
271 @@ -250,21 +300,24 @@ static int eeh_report_resume(struct pci_dev *dev, void *userdata)
272 */
273 static int eeh_report_failure(struct pci_dev *dev, void *userdata)
274 {
275 - struct pci_driver *driver = dev->driver;
276 + struct pci_driver *driver;
277
278 dev->error_state = pci_channel_io_perm_failure;
279
280 - if (!driver)
281 - return 0;
282 + driver = eeh_pcid_get(dev);
283 + if (!driver) return 0;
284
285 eeh_disable_irq(dev);
286
287 if (!driver->err_handler ||
288 - !driver->err_handler->error_detected)
289 + !driver->err_handler->error_detected) {
290 + eeh_pcid_put(dev);
291 return 0;
292 + }
293
294 driver->err_handler->error_detected(dev, pci_channel_io_perm_failure);
295
296 + eeh_pcid_put(dev);
297 return 0;
298 }
299
300 diff --git a/arch/sparc/kernel/signal_64.c b/arch/sparc/kernel/signal_64.c
301 index 48b0f57..40837f0 100644
302 --- a/arch/sparc/kernel/signal_64.c
303 +++ b/arch/sparc/kernel/signal_64.c
304 @@ -309,9 +309,7 @@ void do_rt_sigreturn(struct pt_regs *regs)
305 err |= restore_fpu_state(regs, fpu_save);
306
307 err |= __copy_from_user(&set, &sf->mask, sizeof(sigset_t));
308 - err |= do_sigaltstack(&sf->stack, NULL, (unsigned long)sf);
309 -
310 - if (err)
311 + if (err || do_sigaltstack(&sf->stack, NULL, (unsigned long)sf) == -EFAULT)
312 goto segv;
313
314 err |= __get_user(rwin_save, &sf->rwin_save);
315 diff --git a/arch/x86/boot/compressed/eboot.c b/arch/x86/boot/compressed/eboot.c
316 index 0cdfc0d..8bb9070 100644
317 --- a/arch/x86/boot/compressed/eboot.c
318 +++ b/arch/x86/boot/compressed/eboot.c
319 @@ -12,6 +12,8 @@
320 #include <asm/setup.h>
321 #include <asm/desc.h>
322
323 +#undef memcpy /* Use memcpy from misc.c */
324 +
325 #include "eboot.h"
326
327 static efi_system_table_t *sys_table;
328 diff --git a/arch/x86/include/asm/ptrace.h b/arch/x86/include/asm/ptrace.h
329 index dcfde52..19f16eb 100644
330 --- a/arch/x86/include/asm/ptrace.h
331 +++ b/arch/x86/include/asm/ptrace.h
332 @@ -205,21 +205,14 @@ static inline bool user_64bit_mode(struct pt_regs *regs)
333 }
334 #endif
335
336 -/*
337 - * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode
338 - * when it traps. The previous stack will be directly underneath the saved
339 - * registers, and 'sp/ss' won't even have been saved. Thus the '&regs->sp'.
340 - *
341 - * This is valid only for kernel mode traps.
342 - */
343 -static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
344 -{
345 #ifdef CONFIG_X86_32
346 - return (unsigned long)(&regs->sp);
347 +extern unsigned long kernel_stack_pointer(struct pt_regs *regs);
348 #else
349 +static inline unsigned long kernel_stack_pointer(struct pt_regs *regs)
350 +{
351 return regs->sp;
352 -#endif
353 }
354 +#endif
355
356 #define GET_IP(regs) ((regs)->ip)
357 #define GET_FP(regs) ((regs)->bp)
358 diff --git a/arch/x86/kernel/microcode_amd.c b/arch/x86/kernel/microcode_amd.c
359 index 82746f9..5d8cf0d 100644
360 --- a/arch/x86/kernel/microcode_amd.c
361 +++ b/arch/x86/kernel/microcode_amd.c
362 @@ -97,6 +97,7 @@ static unsigned int verify_ucode_size(int cpu, u32 patch_size,
363 #define F1XH_MPB_MAX_SIZE 2048
364 #define F14H_MPB_MAX_SIZE 1824
365 #define F15H_MPB_MAX_SIZE 4096
366 +#define F16H_MPB_MAX_SIZE 3458
367
368 switch (c->x86) {
369 case 0x14:
370 @@ -105,6 +106,9 @@ static unsigned int verify_ucode_size(int cpu, u32 patch_size,
371 case 0x15:
372 max_size = F15H_MPB_MAX_SIZE;
373 break;
374 + case 0x16:
375 + max_size = F16H_MPB_MAX_SIZE;
376 + break;
377 default:
378 max_size = F1XH_MPB_MAX_SIZE;
379 break;
380 diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c
381 index cf11783..d3e1152 100644
382 --- a/arch/x86/kernel/ptrace.c
383 +++ b/arch/x86/kernel/ptrace.c
384 @@ -165,6 +165,34 @@ static inline bool invalid_selector(u16 value)
385
386 #define FLAG_MASK FLAG_MASK_32
387
388 +/*
389 + * X86_32 CPUs don't save ss and esp if the CPU is already in kernel mode
390 + * when it traps. The previous stack will be directly underneath the saved
391 + * registers, and 'sp/ss' won't even have been saved. Thus the '&regs->sp'.
392 + *
393 + * Now, if the stack is empty, '&regs->sp' is out of range. In this
394 + * case we try to take the previous stack. To always return a non-null
395 + * stack pointer we fall back to regs as stack if no previous stack
396 + * exists.
397 + *
398 + * This is valid only for kernel mode traps.
399 + */
400 +unsigned long kernel_stack_pointer(struct pt_regs *regs)
401 +{
402 + unsigned long context = (unsigned long)regs & ~(THREAD_SIZE - 1);
403 + unsigned long sp = (unsigned long)&regs->sp;
404 + struct thread_info *tinfo;
405 +
406 + if (context == (sp & ~(THREAD_SIZE - 1)))
407 + return sp;
408 +
409 + tinfo = (struct thread_info *)context;
410 + if (tinfo->previous_esp)
411 + return tinfo->previous_esp;
412 +
413 + return (unsigned long)regs;
414 +}
415 +
416 static unsigned long *pt_regs_access(struct pt_regs *regs, unsigned long regno)
417 {
418 BUILD_BUG_ON(offsetof(struct pt_regs, bx) != 0);
419 diff --git a/arch/x86/kvm/cpuid.h b/arch/x86/kvm/cpuid.h
420 index 26d1fb4..638de3e 100644
421 --- a/arch/x86/kvm/cpuid.h
422 +++ b/arch/x86/kvm/cpuid.h
423 @@ -23,6 +23,9 @@ static inline bool guest_cpuid_has_xsave(struct kvm_vcpu *vcpu)
424 {
425 struct kvm_cpuid_entry2 *best;
426
427 + if (!static_cpu_has(X86_FEATURE_XSAVE))
428 + return 0;
429 +
430 best = kvm_find_cpuid_entry(vcpu, 1, 0);
431 return best && (best->ecx & bit(X86_FEATURE_XSAVE));
432 }
433 diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
434 index 185a2b8..e28fb97 100644
435 --- a/arch/x86/kvm/x86.c
436 +++ b/arch/x86/kvm/x86.c
437 @@ -5697,6 +5697,9 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu,
438 int pending_vec, max_bits, idx;
439 struct desc_ptr dt;
440
441 + if (!guest_cpuid_has_xsave(vcpu) && (sregs->cr4 & X86_CR4_OSXSAVE))
442 + return -EINVAL;
443 +
444 dt.size = sregs->idt.limit;
445 dt.address = sregs->idt.base;
446 kvm_x86_ops->set_idt(vcpu, &dt);
447 diff --git a/block/scsi_ioctl.c b/block/scsi_ioctl.c
448 index 260fa80..9a87daa 100644
449 --- a/block/scsi_ioctl.c
450 +++ b/block/scsi_ioctl.c
451 @@ -721,11 +721,14 @@ int scsi_verify_blk_ioctl(struct block_device *bd, unsigned int cmd)
452 break;
453 }
454
455 + if (capable(CAP_SYS_RAWIO))
456 + return 0;
457 +
458 /* In particular, rule out all resets and host-specific ioctls. */
459 printk_ratelimited(KERN_WARNING
460 "%s: sending ioctl %x to a partition!\n", current->comm, cmd);
461
462 - return capable(CAP_SYS_RAWIO) ? 0 : -ENOIOCTLCMD;
463 + return -ENOIOCTLCMD;
464 }
465 EXPORT_SYMBOL(scsi_verify_blk_ioctl);
466
467 diff --git a/drivers/ata/sata_svw.c b/drivers/ata/sata_svw.c
468 index c646118..833607f 100644
469 --- a/drivers/ata/sata_svw.c
470 +++ b/drivers/ata/sata_svw.c
471 @@ -142,6 +142,39 @@ static int k2_sata_scr_write(struct ata_link *link,
472 return 0;
473 }
474
475 +static int k2_sata_softreset(struct ata_link *link,
476 + unsigned int *class, unsigned long deadline)
477 +{
478 + u8 dmactl;
479 + void __iomem *mmio = link->ap->ioaddr.bmdma_addr;
480 +
481 + dmactl = readb(mmio + ATA_DMA_CMD);
482 +
483 + /* Clear the start bit */
484 + if (dmactl & ATA_DMA_START) {
485 + dmactl &= ~ATA_DMA_START;
486 + writeb(dmactl, mmio + ATA_DMA_CMD);
487 + }
488 +
489 + return ata_sff_softreset(link, class, deadline);
490 +}
491 +
492 +static int k2_sata_hardreset(struct ata_link *link,
493 + unsigned int *class, unsigned long deadline)
494 +{
495 + u8 dmactl;
496 + void __iomem *mmio = link->ap->ioaddr.bmdma_addr;
497 +
498 + dmactl = readb(mmio + ATA_DMA_CMD);
499 +
500 + /* Clear the start bit */
501 + if (dmactl & ATA_DMA_START) {
502 + dmactl &= ~ATA_DMA_START;
503 + writeb(dmactl, mmio + ATA_DMA_CMD);
504 + }
505 +
506 + return sata_sff_hardreset(link, class, deadline);
507 +}
508
509 static void k2_sata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf)
510 {
511 @@ -346,6 +379,8 @@ static struct scsi_host_template k2_sata_sht = {
512
513 static struct ata_port_operations k2_sata_ops = {
514 .inherits = &ata_bmdma_port_ops,
515 + .softreset = k2_sata_softreset,
516 + .hardreset = k2_sata_hardreset,
517 .sff_tf_load = k2_sata_tf_load,
518 .sff_tf_read = k2_sata_tf_read,
519 .sff_check_status = k2_stat_check_status,
520 diff --git a/drivers/base/power/qos.c b/drivers/base/power/qos.c
521 index 7185557..c365c93 100644
522 --- a/drivers/base/power/qos.c
523 +++ b/drivers/base/power/qos.c
524 @@ -446,7 +446,7 @@ int dev_pm_qos_add_ancestor_request(struct device *dev,
525 if (ancestor)
526 error = dev_pm_qos_add_request(ancestor, req, value);
527
528 - if (error)
529 + if (error < 0)
530 req->dev = NULL;
531
532 return error;
533 diff --git a/drivers/block/nvme.c b/drivers/block/nvme.c
534 index 38a2d06..9782340 100644
535 --- a/drivers/block/nvme.c
536 +++ b/drivers/block/nvme.c
537 @@ -1153,7 +1153,7 @@ static int nvme_user_admin_cmd(struct nvme_ns *ns,
538 struct nvme_admin_cmd cmd;
539 struct nvme_command c;
540 int status, length;
541 - struct nvme_iod *iod;
542 + struct nvme_iod *uninitialized_var(iod);
543
544 if (!capable(CAP_SYS_ADMIN))
545 return -EACCES;
546 diff --git a/drivers/gpu/drm/radeon/radeon_agp.c b/drivers/gpu/drm/radeon/radeon_agp.c
547 index bd2f33e..bc6b64f 100644
548 --- a/drivers/gpu/drm/radeon/radeon_agp.c
549 +++ b/drivers/gpu/drm/radeon/radeon_agp.c
550 @@ -70,9 +70,12 @@ static struct radeon_agpmode_quirk radeon_agpmode_quirk_list[] = {
551 /* Intel 82830 830 Chipset Host Bridge / Mobility M6 LY Needs AGPMode 2 (fdo #17360)*/
552 { PCI_VENDOR_ID_INTEL, 0x3575, PCI_VENDOR_ID_ATI, 0x4c59,
553 PCI_VENDOR_ID_DELL, 0x00e3, 2},
554 - /* Intel 82852/82855 host bridge / Mobility FireGL 9000 R250 Needs AGPMode 1 (lp #296617) */
555 + /* Intel 82852/82855 host bridge / Mobility FireGL 9000 RV250 Needs AGPMode 1 (lp #296617) */
556 { PCI_VENDOR_ID_INTEL, 0x3580, PCI_VENDOR_ID_ATI, 0x4c66,
557 PCI_VENDOR_ID_DELL, 0x0149, 1},
558 + /* Intel 82855PM host bridge / Mobility FireGL 9000 RV250 Needs AGPMode 1 for suspend/resume */
559 + { PCI_VENDOR_ID_INTEL, 0x3340, PCI_VENDOR_ID_ATI, 0x4c66,
560 + PCI_VENDOR_ID_IBM, 0x0531, 1},
561 /* Intel 82852/82855 host bridge / Mobility 9600 M10 RV350 Needs AGPMode 1 (deb #467460) */
562 { PCI_VENDOR_ID_INTEL, 0x3580, PCI_VENDOR_ID_ATI, 0x4e50,
563 0x1025, 0x0061, 1},
564 diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
565 index afa0802..5e1bf61 100644
566 --- a/drivers/isdn/gigaset/bas-gigaset.c
567 +++ b/drivers/isdn/gigaset/bas-gigaset.c
568 @@ -616,7 +616,13 @@ static void int_in_work(struct work_struct *work)
569 if (rc == 0)
570 /* success, resubmit interrupt read URB */
571 rc = usb_submit_urb(urb, GFP_ATOMIC);
572 - if (rc != 0 && rc != -ENODEV) {
573 +
574 + switch (rc) {
575 + case 0: /* success */
576 + case -ENODEV: /* device gone */
577 + case -EINVAL: /* URB already resubmitted, or terminal badness */
578 + break;
579 + default: /* failure: try to recover by resetting the device */
580 dev_err(cs->dev, "clear halt failed: %s\n", get_usb_rcmsg(rc));
581 rc = usb_lock_device_for_reset(ucs->udev, ucs->interface);
582 if (rc == 0) {
583 @@ -2437,7 +2443,9 @@ static void gigaset_disconnect(struct usb_interface *interface)
584 }
585
586 /* gigaset_suspend
587 - * This function is called before the USB connection is suspended.
588 + * This function is called before the USB connection is suspended
589 + * or before the USB device is reset.
590 + * In the latter case, message == PMSG_ON.
591 */
592 static int gigaset_suspend(struct usb_interface *intf, pm_message_t message)
593 {
594 @@ -2493,7 +2501,12 @@ static int gigaset_suspend(struct usb_interface *intf, pm_message_t message)
595 del_timer_sync(&ucs->timer_atrdy);
596 del_timer_sync(&ucs->timer_cmd_in);
597 del_timer_sync(&ucs->timer_int_in);
598 - cancel_work_sync(&ucs->int_in_wq);
599 +
600 + /* don't try to cancel int_in_wq from within reset as it
601 + * might be the one requesting the reset
602 + */
603 + if (message.event != PM_EVENT_ON)
604 + cancel_work_sync(&ucs->int_in_wq);
605
606 gig_dbg(DEBUG_SUSPEND, "suspend complete");
607 return 0;
608 diff --git a/drivers/leds/leds-lp5521.c b/drivers/leds/leds-lp5521.c
609 index 410a723..2381562 100644
610 --- a/drivers/leds/leds-lp5521.c
611 +++ b/drivers/leds/leds-lp5521.c
612 @@ -193,9 +193,14 @@ static int lp5521_load_program(struct lp5521_engine *eng, const u8 *pattern)
613
614 /* move current engine to direct mode and remember the state */
615 ret = lp5521_set_engine_mode(eng, LP5521_CMD_DIRECT);
616 + if (ret)
617 + return ret;
618 +
619 /* Mode change requires min 500 us delay. 1 - 2 ms with margin */
620 usleep_range(1000, 2000);
621 - ret |= lp5521_read(client, LP5521_REG_OP_MODE, &mode);
622 + ret = lp5521_read(client, LP5521_REG_OP_MODE, &mode);
623 + if (ret)
624 + return ret;
625
626 /* For loading, all the engines to load mode */
627 lp5521_write(client, LP5521_REG_OP_MODE, LP5521_CMD_DIRECT);
628 @@ -211,8 +216,7 @@ static int lp5521_load_program(struct lp5521_engine *eng, const u8 *pattern)
629 LP5521_PROG_MEM_SIZE,
630 pattern);
631
632 - ret |= lp5521_write(client, LP5521_REG_OP_MODE, mode);
633 - return ret;
634 + return lp5521_write(client, LP5521_REG_OP_MODE, mode);
635 }
636
637 static int lp5521_set_led_current(struct lp5521_chip *chip, int led, u8 curr)
638 @@ -785,7 +789,7 @@ static int __devinit lp5521_probe(struct i2c_client *client,
639 * LP5521_REG_ENABLE register will not have any effect - strange!
640 */
641 ret = lp5521_read(client, LP5521_REG_R_CURRENT, &buf);
642 - if (buf != LP5521_REG_R_CURR_DEFAULT) {
643 + if (ret || buf != LP5521_REG_R_CURR_DEFAULT) {
644 dev_err(&client->dev, "error in resetting chip\n");
645 goto fail2;
646 }
647 diff --git a/drivers/md/dm.c b/drivers/md/dm.c
648 index 9ff3019..32370ea 100644
649 --- a/drivers/md/dm.c
650 +++ b/drivers/md/dm.c
651 @@ -754,8 +754,14 @@ static void rq_completed(struct mapped_device *md, int rw, int run_queue)
652 if (!md_in_flight(md))
653 wake_up(&md->wait);
654
655 + /*
656 + * Run this off this callpath, as drivers could invoke end_io while
657 + * inside their request_fn (and holding the queue lock). Calling
658 + * back into ->request_fn() could deadlock attempting to grab the
659 + * queue lock again.
660 + */
661 if (run_queue)
662 - blk_run_queue(md->queue);
663 + blk_run_queue_async(md->queue);
664
665 /*
666 * dm_put() must be at the end of this function. See the comment above
667 diff --git a/drivers/md/md.c b/drivers/md/md.c
668 index 529ce89..0a447a1 100644
669 --- a/drivers/md/md.c
670 +++ b/drivers/md/md.c
671 @@ -1805,10 +1805,10 @@ retry:
672 memset(bbp, 0xff, PAGE_SIZE);
673
674 for (i = 0 ; i < bb->count ; i++) {
675 - u64 internal_bb = *p++;
676 + u64 internal_bb = p[i];
677 u64 store_bb = ((BB_OFFSET(internal_bb) << 10)
678 | BB_LEN(internal_bb));
679 - *bbp++ = cpu_to_le64(store_bb);
680 + bbp[i] = cpu_to_le64(store_bb);
681 }
682 bb->changed = 0;
683 if (read_seqretry(&bb->lock, seq))
684 @@ -7694,9 +7694,9 @@ int md_is_badblock(struct badblocks *bb, sector_t s, int sectors,
685 sector_t *first_bad, int *bad_sectors)
686 {
687 int hi;
688 - int lo = 0;
689 + int lo;
690 u64 *p = bb->page;
691 - int rv = 0;
692 + int rv;
693 sector_t target = s + sectors;
694 unsigned seq;
695
696 @@ -7711,7 +7711,8 @@ int md_is_badblock(struct badblocks *bb, sector_t s, int sectors,
697
698 retry:
699 seq = read_seqbegin(&bb->lock);
700 -
701 + lo = 0;
702 + rv = 0;
703 hi = bb->count;
704
705 /* Binary search between lo and hi for 'target'
706 diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
707 index 4a038cd..a2b5304 100644
708 --- a/drivers/md/raid10.c
709 +++ b/drivers/md/raid10.c
710 @@ -476,7 +476,7 @@ static void raid10_end_write_request(struct bio *bio, int error)
711 */
712 one_write_done(r10_bio);
713 if (dec_rdev)
714 - rdev_dec_pending(conf->mirrors[dev].rdev, conf->mddev);
715 + rdev_dec_pending(rdev, conf->mddev);
716 }
717
718 /*
719 diff --git a/drivers/mmc/host/sdhci-s3c.c b/drivers/mmc/host/sdhci-s3c.c
720 index 55a164f..9e2c558 100644
721 --- a/drivers/mmc/host/sdhci-s3c.c
722 +++ b/drivers/mmc/host/sdhci-s3c.c
723 @@ -656,7 +656,7 @@ static int __devexit sdhci_s3c_remove(struct platform_device *pdev)
724
725 pm_runtime_disable(&pdev->dev);
726
727 - for (ptr = 0; ptr < 3; ptr++) {
728 + for (ptr = 0; ptr < MAX_BUS_CLK; ptr++) {
729 if (sc->clk_bus[ptr]) {
730 clk_disable(sc->clk_bus[ptr]);
731 clk_put(sc->clk_bus[ptr]);
732 diff --git a/drivers/mtd/devices/slram.c b/drivers/mtd/devices/slram.c
733 index 8f52fc8..5a5cd2a 100644
734 --- a/drivers/mtd/devices/slram.c
735 +++ b/drivers/mtd/devices/slram.c
736 @@ -240,7 +240,7 @@ static int parse_cmdline(char *devname, char *szstart, char *szlength)
737
738 if (*(szlength) != '+') {
739 devlength = simple_strtoul(szlength, &buffer, 0);
740 - devlength = handle_unit(devlength, buffer) - devstart;
741 + devlength = handle_unit(devlength, buffer);
742 if (devlength < devstart)
743 goto err_out;
744
745 diff --git a/drivers/mtd/ofpart.c b/drivers/mtd/ofpart.c
746 index 64be8f0..d9127e2 100644
747 --- a/drivers/mtd/ofpart.c
748 +++ b/drivers/mtd/ofpart.c
749 @@ -121,7 +121,7 @@ static int parse_ofoldpart_partitions(struct mtd_info *master,
750 nr_parts = plen / sizeof(part[0]);
751
752 *pparts = kzalloc(nr_parts * sizeof(*(*pparts)), GFP_KERNEL);
753 - if (!pparts)
754 + if (!*pparts)
755 return -ENOMEM;
756
757 names = of_get_property(dp, "partition-names", &plen);
758 diff --git a/drivers/net/can/usb/peak_usb/pcan_usb.c b/drivers/net/can/usb/peak_usb/pcan_usb.c
759 index 86f26a1..25723d8 100644
760 --- a/drivers/net/can/usb/peak_usb/pcan_usb.c
761 +++ b/drivers/net/can/usb/peak_usb/pcan_usb.c
762 @@ -519,8 +519,10 @@ static int pcan_usb_decode_error(struct pcan_usb_msg_context *mc, u8 n,
763 mc->pdev->dev.can.state = new_state;
764
765 if (status_len & PCAN_USB_STATUSLEN_TIMESTAMP) {
766 + struct skb_shared_hwtstamps *hwts = skb_hwtstamps(skb);
767 +
768 peak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv);
769 - skb->tstamp = timeval_to_ktime(tv);
770 + hwts->hwtstamp = timeval_to_ktime(tv);
771 }
772
773 netif_rx(skb);
774 @@ -605,6 +607,7 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len)
775 struct sk_buff *skb;
776 struct can_frame *cf;
777 struct timeval tv;
778 + struct skb_shared_hwtstamps *hwts;
779
780 skb = alloc_can_skb(mc->netdev, &cf);
781 if (!skb)
782 @@ -652,7 +655,8 @@ static int pcan_usb_decode_data(struct pcan_usb_msg_context *mc, u8 status_len)
783
784 /* convert timestamp into kernel time */
785 peak_usb_get_ts_tv(&mc->pdev->time_ref, mc->ts16, &tv);
786 - skb->tstamp = timeval_to_ktime(tv);
787 + hwts = skb_hwtstamps(skb);
788 + hwts->hwtstamp = timeval_to_ktime(tv);
789
790 /* push the skb */
791 netif_rx(skb);
792 diff --git a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
793 index 629c4ba..c95913a 100644
794 --- a/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
795 +++ b/drivers/net/can/usb/peak_usb/pcan_usb_pro.c
796 @@ -532,6 +532,7 @@ static int pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if,
797 struct can_frame *can_frame;
798 struct sk_buff *skb;
799 struct timeval tv;
800 + struct skb_shared_hwtstamps *hwts;
801
802 skb = alloc_can_skb(netdev, &can_frame);
803 if (!skb)
804 @@ -549,7 +550,8 @@ static int pcan_usb_pro_handle_canmsg(struct pcan_usb_pro_interface *usb_if,
805 memcpy(can_frame->data, rx->data, can_frame->can_dlc);
806
807 peak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(rx->ts32), &tv);
808 - skb->tstamp = timeval_to_ktime(tv);
809 + hwts = skb_hwtstamps(skb);
810 + hwts->hwtstamp = timeval_to_ktime(tv);
811
812 netif_rx(skb);
813 netdev->stats.rx_packets++;
814 @@ -570,6 +572,7 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if,
815 u8 err_mask = 0;
816 struct sk_buff *skb;
817 struct timeval tv;
818 + struct skb_shared_hwtstamps *hwts;
819
820 /* nothing should be sent while in BUS_OFF state */
821 if (dev->can.state == CAN_STATE_BUS_OFF)
822 @@ -664,7 +667,8 @@ static int pcan_usb_pro_handle_error(struct pcan_usb_pro_interface *usb_if,
823 dev->can.state = new_state;
824
825 peak_usb_get_ts_tv(&usb_if->time_ref, le32_to_cpu(er->ts32), &tv);
826 - skb->tstamp = timeval_to_ktime(tv);
827 + hwts = skb_hwtstamps(skb);
828 + hwts->hwtstamp = timeval_to_ktime(tv);
829 netif_rx(skb);
830 netdev->stats.rx_packets++;
831 netdev->stats.rx_bytes += can_frame->can_dlc;
832 diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
833 index 49aa41f..ab4d4d2 100644
834 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
835 +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_common.c
836 @@ -3216,6 +3216,7 @@ static s32 ixgbe_device_supports_autoneg_fc(struct ixgbe_hw *hw)
837
838 switch (hw->device_id) {
839 case IXGBE_DEV_ID_X540T:
840 + case IXGBE_DEV_ID_X540T1:
841 return 0;
842 case IXGBE_DEV_ID_82599_T3_LOM:
843 return 0;
844 diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
845 index cfe7d26..6757d6c 100644
846 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
847 +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_ethtool.c
848 @@ -2006,6 +2006,7 @@ static int ixgbe_wol_exclusion(struct ixgbe_adapter *adapter,
849 retval = 0;
850 break;
851 case IXGBE_DEV_ID_X540T:
852 + case IXGBE_DEV_ID_X540T1:
853 /* check eeprom to see if enabled wol */
854 if ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0_1) ||
855 ((wol_cap == IXGBE_DEVICE_CAPS_WOL_PORT0) &&
856 diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
857 index a66c215..6d1f6c5 100644
858 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
859 +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
860 @@ -114,6 +114,7 @@ static DEFINE_PCI_DEVICE_TABLE(ixgbe_pci_tbl) = {
861 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_LS), board_82599 },
862 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599EN_SFP), board_82599 },
863 {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_82599_SFP_SF_QP), board_82599 },
864 + {PCI_VDEVICE(INTEL, IXGBE_DEV_ID_X540T1), board_X540 },
865 /* required last entry */
866 {0, }
867 };
868 @@ -7060,6 +7061,7 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
869 adapter->wol = IXGBE_WUFC_MAG;
870 break;
871 case IXGBE_DEV_ID_X540T:
872 + case IXGBE_DEV_ID_X540T1:
873 /* Check eeprom to see if it is enabled */
874 hw->eeprom.ops.read(hw, 0x2c, &adapter->eeprom_cap);
875 wol_cap = adapter->eeprom_cap & IXGBE_DEVICE_CAPS_WOL_MASK;
876 diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
877 index 8636e83..37eb39c 100644
878 --- a/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
879 +++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_type.h
880 @@ -67,6 +67,7 @@
881 #define IXGBE_DEV_ID_82599_LS 0x154F
882 #define IXGBE_DEV_ID_X540T 0x1528
883 #define IXGBE_DEV_ID_82599_SFP_SF_QP 0x154A
884 +#define IXGBE_DEV_ID_X540T1 0x1560
885
886 /* VF Device IDs */
887 #define IXGBE_DEV_ID_82599_VF 0x10ED
888 diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
889 index 3a6b991..3dd80df 100644
890 --- a/drivers/net/wireless/ipw2x00/ipw2200.c
891 +++ b/drivers/net/wireless/ipw2x00/ipw2200.c
892 @@ -10471,7 +10471,7 @@ static void ipw_handle_promiscuous_tx(struct ipw_priv *priv,
893 } else
894 len = src->len;
895
896 - dst = alloc_skb(len + sizeof(*rt_hdr), GFP_ATOMIC);
897 + dst = alloc_skb(len + sizeof(*rt_hdr) + sizeof(u16)*2, GFP_ATOMIC);
898 if (!dst)
899 continue;
900
901 diff --git a/drivers/net/wireless/iwlwifi/iwl-6000.c b/drivers/net/wireless/iwlwifi/iwl-6000.c
902 index c0cfa4e..2067bdf 100644
903 --- a/drivers/net/wireless/iwlwifi/iwl-6000.c
904 +++ b/drivers/net/wireless/iwlwifi/iwl-6000.c
905 @@ -170,7 +170,7 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
906 * See iwlagn_mac_channel_switch.
907 */
908 struct iwl_rxon_context *ctx = &priv->contexts[IWL_RXON_CTX_BSS];
909 - struct iwl6000_channel_switch_cmd cmd;
910 + struct iwl6000_channel_switch_cmd *cmd;
911 const struct iwl_channel_info *ch_info;
912 u32 switch_time_in_usec, ucode_switch_time;
913 u16 ch;
914 @@ -180,18 +180,25 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
915 struct ieee80211_vif *vif = ctx->vif;
916 struct iwl_host_cmd hcmd = {
917 .id = REPLY_CHANNEL_SWITCH,
918 - .len = { sizeof(cmd), },
919 + .len = { sizeof(*cmd), },
920 .flags = CMD_SYNC,
921 - .data = { &cmd, },
922 + .dataflags[0] = IWL_HCMD_DFL_NOCOPY,
923 };
924 + int err;
925
926 - cmd.band = priv->band == IEEE80211_BAND_2GHZ;
927 + cmd = kzalloc(sizeof(*cmd), GFP_KERNEL);
928 + if (!cmd)
929 + return -ENOMEM;
930 +
931 + hcmd.data[0] = cmd;
932 +
933 + cmd->band = priv->band == IEEE80211_BAND_2GHZ;
934 ch = ch_switch->channel->hw_value;
935 IWL_DEBUG_11H(priv, "channel switch from %u to %u\n",
936 ctx->active.channel, ch);
937 - cmd.channel = cpu_to_le16(ch);
938 - cmd.rxon_flags = ctx->staging.flags;
939 - cmd.rxon_filter_flags = ctx->staging.filter_flags;
940 + cmd->channel = cpu_to_le16(ch);
941 + cmd->rxon_flags = ctx->staging.flags;
942 + cmd->rxon_filter_flags = ctx->staging.filter_flags;
943 switch_count = ch_switch->count;
944 tsf_low = ch_switch->timestamp & 0x0ffffffff;
945 /*
946 @@ -207,30 +214,32 @@ static int iwl6000_hw_channel_switch(struct iwl_priv *priv,
947 switch_count = 0;
948 }
949 if (switch_count <= 1)
950 - cmd.switch_time = cpu_to_le32(priv->ucode_beacon_time);
951 + cmd->switch_time = cpu_to_le32(priv->ucode_beacon_time);
952 else {
953 switch_time_in_usec =
954 vif->bss_conf.beacon_int * switch_count * TIME_UNIT;
955 ucode_switch_time = iwl_usecs_to_beacons(priv,
956 switch_time_in_usec,
957 beacon_interval);
958 - cmd.switch_time = iwl_add_beacon_time(priv,
959 + cmd->switch_time = iwl_add_beacon_time(priv,
960 priv->ucode_beacon_time,
961 ucode_switch_time,
962 beacon_interval);
963 }
964 IWL_DEBUG_11H(priv, "uCode time for the switch is 0x%x\n",
965 - cmd.switch_time);
966 + cmd->switch_time);
967 ch_info = iwl_get_channel_info(priv, priv->band, ch);
968 if (ch_info)
969 - cmd.expect_beacon = is_channel_radar(ch_info);
970 + cmd->expect_beacon = is_channel_radar(ch_info);
971 else {
972 IWL_ERR(priv, "invalid channel switch from %u to %u\n",
973 ctx->active.channel, ch);
974 return -EFAULT;
975 }
976
977 - return iwl_dvm_send_cmd(priv, &hcmd);
978 + err = iwl_dvm_send_cmd(priv, &hcmd);
979 + kfree(cmd);
980 + return err;
981 }
982
983 static struct iwl_lib_ops iwl6000_lib = {
984 diff --git a/drivers/net/wireless/mwifiex/cmdevt.c b/drivers/net/wireless/mwifiex/cmdevt.c
985 index 07f6e00..2977a12 100644
986 --- a/drivers/net/wireless/mwifiex/cmdevt.c
987 +++ b/drivers/net/wireless/mwifiex/cmdevt.c
988 @@ -816,9 +816,6 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
989 return;
990 }
991 cmd_node = adapter->curr_cmd;
992 - if (cmd_node->wait_q_enabled)
993 - adapter->cmd_wait_q.status = -ETIMEDOUT;
994 -
995 if (cmd_node) {
996 adapter->dbg.timeout_cmd_id =
997 adapter->dbg.last_cmd_id[adapter->dbg.last_cmd_index];
998 @@ -864,6 +861,14 @@ mwifiex_cmd_timeout_func(unsigned long function_context)
999
1000 dev_err(adapter->dev, "ps_mode=%d ps_state=%d\n",
1001 adapter->ps_mode, adapter->ps_state);
1002 +
1003 + if (cmd_node->wait_q_enabled) {
1004 + adapter->cmd_wait_q.status = -ETIMEDOUT;
1005 + wake_up_interruptible(&adapter->cmd_wait_q.wait);
1006 + mwifiex_cancel_pending_ioctl(adapter);
1007 + /* reset cmd_sent flag to unblock new commands */
1008 + adapter->cmd_sent = false;
1009 + }
1010 }
1011 if (adapter->hw_status == MWIFIEX_HW_STATUS_INITIALIZING)
1012 mwifiex_init_fw_complete(adapter);
1013 diff --git a/drivers/net/wireless/mwifiex/sdio.c b/drivers/net/wireless/mwifiex/sdio.c
1014 index f8012e2..7d00a87 100644
1015 --- a/drivers/net/wireless/mwifiex/sdio.c
1016 +++ b/drivers/net/wireless/mwifiex/sdio.c
1017 @@ -158,7 +158,6 @@ static int mwifiex_sdio_suspend(struct device *dev)
1018 struct sdio_mmc_card *card;
1019 struct mwifiex_adapter *adapter;
1020 mmc_pm_flag_t pm_flag = 0;
1021 - int hs_actived = 0;
1022 int i;
1023 int ret = 0;
1024
1025 @@ -185,12 +184,14 @@ static int mwifiex_sdio_suspend(struct device *dev)
1026 adapter = card->adapter;
1027
1028 /* Enable the Host Sleep */
1029 - hs_actived = mwifiex_enable_hs(adapter);
1030 - if (hs_actived) {
1031 - pr_debug("cmd: suspend with MMC_PM_KEEP_POWER\n");
1032 - ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
1033 + if (!mwifiex_enable_hs(adapter)) {
1034 + dev_err(adapter->dev, "cmd: failed to suspend\n");
1035 + return -EFAULT;
1036 }
1037
1038 + dev_dbg(adapter->dev, "cmd: suspend with MMC_PM_KEEP_POWER\n");
1039 + ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
1040 +
1041 /* Indicate device suspended */
1042 adapter->is_suspended = true;
1043
1044 diff --git a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
1045 index 5bd4085..61e5768 100644
1046 --- a/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
1047 +++ b/drivers/net/wireless/rtlwifi/rtl8192cu/sw.c
1048 @@ -297,6 +297,7 @@ static struct usb_device_id rtl8192c_usb_ids[] = {
1049 /*=== Customer ID ===*/
1050 /****** 8188CU ********/
1051 {RTL_USB_DEVICE(0x050d, 0x1102, rtl92cu_hal_cfg)}, /*Belkin - Edimax*/
1052 + {RTL_USB_DEVICE(0x050d, 0x11f2, rtl92cu_hal_cfg)}, /*Belkin - ISY*/
1053 {RTL_USB_DEVICE(0x06f8, 0xe033, rtl92cu_hal_cfg)}, /*Hercules - Edimax*/
1054 {RTL_USB_DEVICE(0x07b8, 0x8188, rtl92cu_hal_cfg)}, /*Abocom - Abocom*/
1055 {RTL_USB_DEVICE(0x07b8, 0x8189, rtl92cu_hal_cfg)}, /*Funai - Abocom*/
1056 diff --git a/drivers/net/wireless/rtlwifi/rtl8192se/phy.c b/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
1057 index 4a49992..a2a5c92 100644
1058 --- a/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
1059 +++ b/drivers/net/wireless/rtlwifi/rtl8192se/phy.c
1060 @@ -1247,6 +1247,9 @@ static void _rtl92s_phy_get_txpower_index(struct ieee80211_hw *hw, u8 channel,
1061 /* Read HT 40 OFDM TX power */
1062 ofdmpowerLevel[0] = rtlefuse->txpwrlevel_ht40_2s[0][index];
1063 ofdmpowerLevel[1] = rtlefuse->txpwrlevel_ht40_2s[1][index];
1064 + } else {
1065 + ofdmpowerLevel[0] = 0;
1066 + ofdmpowerLevel[1] = 0;
1067 }
1068 }
1069
1070 diff --git a/drivers/nfc/pn533.c b/drivers/nfc/pn533.c
1071 index cb6204f..692bd1e 100644
1072 --- a/drivers/nfc/pn533.c
1073 +++ b/drivers/nfc/pn533.c
1074 @@ -1278,11 +1278,14 @@ static void pn533_deactivate_target(struct nfc_dev *nfc_dev, u32 target_idx)
1075 static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1076 u8 *params, int params_len)
1077 {
1078 - struct pn533_cmd_jump_dep *cmd;
1079 struct pn533_cmd_jump_dep_response *resp;
1080 struct nfc_target nfc_target;
1081 u8 target_gt_len;
1082 int rc;
1083 + struct pn533_cmd_jump_dep *cmd = (struct pn533_cmd_jump_dep *)arg;
1084 + u8 active = cmd->active;
1085 +
1086 + kfree(arg);
1087
1088 if (params_len == -ENOENT) {
1089 nfc_dev_dbg(&dev->interface->dev, "");
1090 @@ -1304,7 +1307,6 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1091 }
1092
1093 resp = (struct pn533_cmd_jump_dep_response *) params;
1094 - cmd = (struct pn533_cmd_jump_dep *) arg;
1095 rc = resp->status & PN533_CMD_RET_MASK;
1096 if (rc != PN533_CMD_RET_SUCCESS) {
1097 nfc_dev_err(&dev->interface->dev,
1098 @@ -1334,7 +1336,7 @@ static int pn533_in_dep_link_up_complete(struct pn533 *dev, void *arg,
1099 if (rc == 0)
1100 rc = nfc_dep_link_is_up(dev->nfc_dev,
1101 dev->nfc_dev->targets[0].idx,
1102 - !cmd->active, NFC_RF_INITIATOR);
1103 + !active, NFC_RF_INITIATOR);
1104
1105 return 0;
1106 }
1107 @@ -1385,12 +1387,8 @@ static int pn533_dep_link_up(struct nfc_dev *nfc_dev, int target_idx,
1108 rc = pn533_send_cmd_frame_async(dev, dev->out_frame, dev->in_frame,
1109 dev->in_maxlen, pn533_in_dep_link_up_complete,
1110 cmd, GFP_KERNEL);
1111 - if (rc)
1112 - goto out;
1113 -
1114 -
1115 -out:
1116 - kfree(cmd);
1117 + if (rc < 0)
1118 + kfree(cmd);
1119
1120 return rc;
1121 }
1122 diff --git a/drivers/scsi/aha152x.c b/drivers/scsi/aha152x.c
1123 index 19a3694..dd4547b 100644
1124 --- a/drivers/scsi/aha152x.c
1125 +++ b/drivers/scsi/aha152x.c
1126 @@ -2984,8 +2984,8 @@ static int get_command(char *pos, Scsi_Cmnd * ptr)
1127 char *start = pos;
1128 int i;
1129
1130 - SPRINTF("0x%08x: target=%d; lun=%d; cmnd=( ",
1131 - (unsigned int) ptr, ptr->device->id, ptr->device->lun);
1132 + SPRINTF("%p: target=%d; lun=%d; cmnd=( ",
1133 + ptr, ptr->device->id, ptr->device->lun);
1134
1135 for (i = 0; i < COMMAND_SIZE(ptr->cmnd[0]); i++)
1136 SPRINTF("0x%02x ", ptr->cmnd[i]);
1137 diff --git a/drivers/scsi/isci/request.c b/drivers/scsi/isci/request.c
1138 index 2def1e3..05c3fc0 100644
1139 --- a/drivers/scsi/isci/request.c
1140 +++ b/drivers/scsi/isci/request.c
1141 @@ -1970,7 +1970,7 @@ sci_io_request_frame_handler(struct isci_request *ireq,
1142 frame_index,
1143 (void **)&frame_buffer);
1144
1145 - sci_controller_copy_sata_response(&ireq->stp.req,
1146 + sci_controller_copy_sata_response(&ireq->stp.rsp,
1147 frame_header,
1148 frame_buffer);
1149
1150 diff --git a/drivers/scsi/mvsas/mv_sas.c b/drivers/scsi/mvsas/mv_sas.c
1151 index fd3b283..3006ec9 100644
1152 --- a/drivers/scsi/mvsas/mv_sas.c
1153 +++ b/drivers/scsi/mvsas/mv_sas.c
1154 @@ -885,7 +885,6 @@ static int mvs_task_exec(struct sas_task *task, const int num, gfp_t gfp_flags,
1155 struct completion *completion, int is_tmf,
1156 struct mvs_tmf_task *tmf)
1157 {
1158 - struct domain_device *dev = task->dev;
1159 struct mvs_info *mvi = NULL;
1160 u32 rc = 0;
1161 u32 pass = 0;
1162 diff --git a/drivers/usb/serial/mct_u232.c b/drivers/usb/serial/mct_u232.c
1163 index ef4d7ad..d0bf56d 100644
1164 --- a/drivers/usb/serial/mct_u232.c
1165 +++ b/drivers/usb/serial/mct_u232.c
1166 @@ -533,12 +533,14 @@ static void mct_u232_close(struct usb_serial_port *port)
1167 {
1168 dbg("%s port %d", __func__, port->number);
1169
1170 - if (port->serial->dev) {
1171 - /* shutdown our urbs */
1172 - usb_kill_urb(port->write_urb);
1173 - usb_kill_urb(port->read_urb);
1174 - usb_kill_urb(port->interrupt_in_urb);
1175 - }
1176 + /*
1177 + * Must kill the read urb as it is actually an interrupt urb, which
1178 + * generic close thus fails to kill.
1179 + */
1180 + usb_kill_urb(port->read_urb);
1181 + usb_kill_urb(port->interrupt_in_urb);
1182 +
1183 + usb_serial_generic_close(port);
1184 } /* mct_u232_close */
1185
1186
1187 diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c
1188 index 841cabc..ee959a9 100644
1189 --- a/fs/jbd/transaction.c
1190 +++ b/fs/jbd/transaction.c
1191 @@ -1963,7 +1963,9 @@ retry:
1192 spin_unlock(&journal->j_list_lock);
1193 jbd_unlock_bh_state(bh);
1194 spin_unlock(&journal->j_state_lock);
1195 + unlock_buffer(bh);
1196 log_wait_commit(journal, tid);
1197 + lock_buffer(bh);
1198 goto retry;
1199 }
1200 /*
1201 diff --git a/fs/jffs2/file.c b/fs/jffs2/file.c
1202 index db3889b..8608f87 100644
1203 --- a/fs/jffs2/file.c
1204 +++ b/fs/jffs2/file.c
1205 @@ -138,33 +138,39 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
1206 struct page *pg;
1207 struct inode *inode = mapping->host;
1208 struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode);
1209 + struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
1210 + struct jffs2_raw_inode ri;
1211 + uint32_t alloc_len = 0;
1212 pgoff_t index = pos >> PAGE_CACHE_SHIFT;
1213 uint32_t pageofs = index << PAGE_CACHE_SHIFT;
1214 int ret = 0;
1215
1216 + jffs2_dbg(1, "%s()\n", __func__);
1217 +
1218 + if (pageofs > inode->i_size) {
1219 + ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len,
1220 + ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
1221 + if (ret)
1222 + return ret;
1223 + }
1224 +
1225 + mutex_lock(&f->sem);
1226 pg = grab_cache_page_write_begin(mapping, index, flags);
1227 - if (!pg)
1228 + if (!pg) {
1229 + if (alloc_len)
1230 + jffs2_complete_reservation(c);
1231 + mutex_unlock(&f->sem);
1232 return -ENOMEM;
1233 + }
1234 *pagep = pg;
1235
1236 - jffs2_dbg(1, "%s()\n", __func__);
1237 -
1238 - if (pageofs > inode->i_size) {
1239 + if (alloc_len) {
1240 /* Make new hole frag from old EOF to new page */
1241 - struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb);
1242 - struct jffs2_raw_inode ri;
1243 struct jffs2_full_dnode *fn;
1244 - uint32_t alloc_len;
1245
1246 jffs2_dbg(1, "Writing new hole frag 0x%x-0x%x between current EOF and new page\n",
1247 (unsigned int)inode->i_size, pageofs);
1248
1249 - ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len,
1250 - ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE);
1251 - if (ret)
1252 - goto out_page;
1253 -
1254 - mutex_lock(&f->sem);
1255 memset(&ri, 0, sizeof(ri));
1256
1257 ri.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK);
1258 @@ -191,7 +197,6 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
1259 if (IS_ERR(fn)) {
1260 ret = PTR_ERR(fn);
1261 jffs2_complete_reservation(c);
1262 - mutex_unlock(&f->sem);
1263 goto out_page;
1264 }
1265 ret = jffs2_add_full_dnode_to_inode(c, f, fn);
1266 @@ -206,12 +211,10 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
1267 jffs2_mark_node_obsolete(c, fn->raw);
1268 jffs2_free_full_dnode(fn);
1269 jffs2_complete_reservation(c);
1270 - mutex_unlock(&f->sem);
1271 goto out_page;
1272 }
1273 jffs2_complete_reservation(c);
1274 inode->i_size = pageofs;
1275 - mutex_unlock(&f->sem);
1276 }
1277
1278 /*
1279 @@ -220,18 +223,18 @@ static int jffs2_write_begin(struct file *filp, struct address_space *mapping,
1280 * case of a short-copy.
1281 */
1282 if (!PageUptodate(pg)) {
1283 - mutex_lock(&f->sem);
1284 ret = jffs2_do_readpage_nolock(inode, pg);
1285 - mutex_unlock(&f->sem);
1286 if (ret)
1287 goto out_page;
1288 }
1289 + mutex_unlock(&f->sem);
1290 jffs2_dbg(1, "end write_begin(). pg->flags %lx\n", pg->flags);
1291 return ret;
1292
1293 out_page:
1294 unlock_page(pg);
1295 page_cache_release(pg);
1296 + mutex_unlock(&f->sem);
1297 return ret;
1298 }
1299
1300 diff --git a/fs/ubifs/dir.c b/fs/ubifs/dir.c
1301 index ec9f187..8640a12 100644
1302 --- a/fs/ubifs/dir.c
1303 +++ b/fs/ubifs/dir.c
1304 @@ -977,7 +977,7 @@ static int ubifs_rename(struct inode *old_dir, struct dentry *old_dentry,
1305 struct ubifs_budget_req ino_req = { .dirtied_ino = 1,
1306 .dirtied_ino_d = ALIGN(old_inode_ui->data_len, 8) };
1307 struct timespec time;
1308 - unsigned int saved_nlink;
1309 + unsigned int uninitialized_var(saved_nlink);
1310
1311 /*
1312 * Budget request settings: deletion direntry, new direntry, removing
1313 diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
1314 index efc66f2..7207a99 100644
1315 --- a/include/drm/drm_pciids.h
1316 +++ b/include/drm/drm_pciids.h
1317 @@ -214,6 +214,7 @@
1318 {0x1002, 0x6798, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1319 {0x1002, 0x6799, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1320 {0x1002, 0x679A, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1321 + {0x1002, 0x679B, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1322 {0x1002, 0x679E, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1323 {0x1002, 0x679F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TAHITI|RADEON_NEW_MEMMAP}, \
1324 {0x1002, 0x6800, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_PITCAIRN|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
1325 diff --git a/kernel/futex.c b/kernel/futex.c
1326 index 20ef219..19eb089 100644
1327 --- a/kernel/futex.c
1328 +++ b/kernel/futex.c
1329 @@ -843,6 +843,9 @@ static void wake_futex(struct futex_q *q)
1330 {
1331 struct task_struct *p = q->task;
1332
1333 + if (WARN(q->pi_state || q->rt_waiter, "refusing to wake PI futex\n"))
1334 + return;
1335 +
1336 /*
1337 * We set q->lock_ptr = NULL _before_ we wake up the task. If
1338 * a non-futex wake up happens on another CPU then the task
1339 @@ -1078,6 +1081,10 @@ retry_private:
1340
1341 plist_for_each_entry_safe(this, next, head, list) {
1342 if (match_futex (&this->key, &key1)) {
1343 + if (this->pi_state || this->rt_waiter) {
1344 + ret = -EINVAL;
1345 + goto out_unlock;
1346 + }
1347 wake_futex(this);
1348 if (++ret >= nr_wake)
1349 break;
1350 @@ -1090,6 +1097,10 @@ retry_private:
1351 op_ret = 0;
1352 plist_for_each_entry_safe(this, next, head, list) {
1353 if (match_futex (&this->key, &key2)) {
1354 + if (this->pi_state || this->rt_waiter) {
1355 + ret = -EINVAL;
1356 + goto out_unlock;
1357 + }
1358 wake_futex(this);
1359 if (++op_ret >= nr_wake2)
1360 break;
1361 @@ -1098,6 +1109,7 @@ retry_private:
1362 ret += op_ret;
1363 }
1364
1365 +out_unlock:
1366 double_unlock_hb(hb1, hb2);
1367 out_put_keys:
1368 put_futex_key(&key2);
1369 @@ -1387,9 +1399,13 @@ retry_private:
1370 /*
1371 * FUTEX_WAIT_REQEUE_PI and FUTEX_CMP_REQUEUE_PI should always
1372 * be paired with each other and no other futex ops.
1373 + *
1374 + * We should never be requeueing a futex_q with a pi_state,
1375 + * which is awaiting a futex_unlock_pi().
1376 */
1377 if ((requeue_pi && !this->rt_waiter) ||
1378 - (!requeue_pi && this->rt_waiter)) {
1379 + (!requeue_pi && this->rt_waiter) ||
1380 + this->pi_state) {
1381 ret = -EINVAL;
1382 break;
1383 }
1384 diff --git a/kernel/time/timekeeping.c b/kernel/time/timekeeping.c
1385 index 12843e9..eff0b1e 100644
1386 --- a/kernel/time/timekeeping.c
1387 +++ b/kernel/time/timekeeping.c
1388 @@ -1014,7 +1014,7 @@ static cycle_t logarithmic_accumulation(cycle_t offset, int shift)
1389 }
1390
1391 /* Accumulate raw time */
1392 - raw_nsecs = timekeeper.raw_interval << shift;
1393 + raw_nsecs = (u64)timekeeper.raw_interval << shift;
1394 raw_nsecs += timekeeper.raw_time.tv_nsec;
1395 if (raw_nsecs >= NSEC_PER_SEC) {
1396 u64 raw_secs = raw_nsecs;
1397 diff --git a/kernel/watchdog.c b/kernel/watchdog.c
1398 index df30ee0..991aa93 100644
1399 --- a/kernel/watchdog.c
1400 +++ b/kernel/watchdog.c
1401 @@ -112,7 +112,7 @@ static unsigned long get_timestamp(int this_cpu)
1402 return cpu_clock(this_cpu) >> 30LL; /* 2^30 ~= 10^9 */
1403 }
1404
1405 -static unsigned long get_sample_period(void)
1406 +static u64 get_sample_period(void)
1407 {
1408 /*
1409 * convert watchdog_thresh from seconds to ns
1410 @@ -121,7 +121,7 @@ static unsigned long get_sample_period(void)
1411 * and hard thresholds) to increment before the
1412 * hardlockup detector generates a warning
1413 */
1414 - return get_softlockup_thresh() * (NSEC_PER_SEC / 5);
1415 + return get_softlockup_thresh() * ((u64)NSEC_PER_SEC / 5);
1416 }
1417
1418 /* Commands for resetting the watchdog */
1419 diff --git a/lib/mpi/longlong.h b/lib/mpi/longlong.h
1420 index 29f9862..280405b 100644
1421 --- a/lib/mpi/longlong.h
1422 +++ b/lib/mpi/longlong.h
1423 @@ -703,7 +703,14 @@ do { \
1424 ************** MIPS *****************
1425 ***************************************/
1426 #if defined(__mips__) && W_TYPE_SIZE == 32
1427 -#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
1428 +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
1429 +#define umul_ppmm(w1, w0, u, v) \
1430 +do { \
1431 + UDItype __ll = (UDItype)(u) * (v); \
1432 + w1 = __ll >> 32; \
1433 + w0 = __ll; \
1434 +} while (0)
1435 +#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
1436 #define umul_ppmm(w1, w0, u, v) \
1437 __asm__ ("multu %2,%3" \
1438 : "=l" ((USItype)(w0)), \
1439 @@ -728,7 +735,15 @@ do { \
1440 ************** MIPS/64 **************
1441 ***************************************/
1442 #if (defined(__mips) && __mips >= 3) && W_TYPE_SIZE == 64
1443 -#if __GNUC__ > 2 || __GNUC_MINOR__ >= 7
1444 +#if __GNUC__ >= 4 && __GNUC_MINOR__ >= 4
1445 +#define umul_ppmm(w1, w0, u, v) \
1446 +do { \
1447 + typedef unsigned int __ll_UTItype __attribute__((mode(TI))); \
1448 + __ll_UTItype __ll = (__ll_UTItype)(u) * (v); \
1449 + w1 = __ll >> 64; \
1450 + w0 = __ll; \
1451 +} while (0)
1452 +#elif __GNUC__ > 2 || __GNUC_MINOR__ >= 7
1453 #define umul_ppmm(w1, w0, u, v) \
1454 __asm__ ("dmultu %2,%3" \
1455 : "=l" ((UDItype)(w0)), \
1456 diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c
1457 index 627c354..fa07aed 100644
1458 --- a/net/bluetooth/l2cap_core.c
1459 +++ b/net/bluetooth/l2cap_core.c
1460 @@ -2585,12 +2585,14 @@ static void l2cap_conf_rfc_get(struct l2cap_chan *chan, void *rsp, int len)
1461 while (len >= L2CAP_CONF_OPT_SIZE) {
1462 len -= l2cap_get_conf_opt(&rsp, &type, &olen, &val);
1463
1464 - switch (type) {
1465 - case L2CAP_CONF_RFC:
1466 - if (olen == sizeof(rfc))
1467 - memcpy(&rfc, (void *)val, olen);
1468 - goto done;
1469 - }
1470 + if (type != L2CAP_CONF_RFC)
1471 + continue;
1472 +
1473 + if (olen != sizeof(rfc))
1474 + break;
1475 +
1476 + memcpy(&rfc, (void *)val, olen);
1477 + goto done;
1478 }
1479
1480 /* Use sane default values in case a misbehaving remote device
1481 diff --git a/net/can/bcm.c b/net/can/bcm.c
1482 index 151b773..3910c1f 100644
1483 --- a/net/can/bcm.c
1484 +++ b/net/can/bcm.c
1485 @@ -1084,6 +1084,9 @@ static int bcm_rx_setup(struct bcm_msg_head *msg_head, struct msghdr *msg,
1486 op->sk = sk;
1487 op->ifindex = ifindex;
1488
1489 + /* ifindex for timeout events w/o previous frame reception */
1490 + op->rx_ifindex = ifindex;
1491 +
1492 /* initialize uninitialized (kzalloc) structure */
1493 hrtimer_init(&op->timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
1494 op->timer.function = bcm_rx_timeout_handler;
1495 diff --git a/net/mac80211/ibss.c b/net/mac80211/ibss.c
1496 index 4a3666b..7c51bae 100644
1497 --- a/net/mac80211/ibss.c
1498 +++ b/net/mac80211/ibss.c
1499 @@ -1153,10 +1153,6 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
1500
1501 mutex_lock(&sdata->u.ibss.mtx);
1502
1503 - sdata->u.ibss.state = IEEE80211_IBSS_MLME_SEARCH;
1504 - memset(sdata->u.ibss.bssid, 0, ETH_ALEN);
1505 - sdata->u.ibss.ssid_len = 0;
1506 -
1507 active_ibss = ieee80211_sta_active_ibss(sdata);
1508
1509 if (!active_ibss && !is_zero_ether_addr(ifibss->bssid)) {
1510 @@ -1177,6 +1173,10 @@ int ieee80211_ibss_leave(struct ieee80211_sub_if_data *sdata)
1511 }
1512 }
1513
1514 + ifibss->state = IEEE80211_IBSS_MLME_SEARCH;
1515 + memset(ifibss->bssid, 0, ETH_ALEN);
1516 + ifibss->ssid_len = 0;
1517 +
1518 sta_info_flush(sdata->local, sdata);
1519
1520 spin_lock_bh(&ifibss->incomplete_lock);
1521 diff --git a/net/nfc/llcp/llcp.c b/net/nfc/llcp/llcp.c
1522 index 17a578f..c40112c 100644
1523 --- a/net/nfc/llcp/llcp.c
1524 +++ b/net/nfc/llcp/llcp.c
1525 @@ -966,7 +966,7 @@ int nfc_llcp_register_device(struct nfc_dev *ndev)
1526 local->remote_lto = LLCP_DEFAULT_LTO;
1527 local->remote_rw = LLCP_DEFAULT_RW;
1528
1529 - list_add(&llcp_devices, &local->list);
1530 + list_add(&local->list, &llcp_devices);
1531
1532 return 0;
1533
1534 diff --git a/sound/pci/hda/patch_cirrus.c b/sound/pci/hda/patch_cirrus.c
1535 index 057f95a2..3605fbb 100644
1536 --- a/sound/pci/hda/patch_cirrus.c
1537 +++ b/sound/pci/hda/patch_cirrus.c
1538 @@ -460,6 +460,7 @@ static int parse_output(struct hda_codec *codec)
1539 memcpy(cfg->speaker_pins, cfg->line_out_pins,
1540 sizeof(cfg->speaker_pins));
1541 cfg->line_outs = 0;
1542 + memset(cfg->line_out_pins, 0, sizeof(cfg->line_out_pins));
1543 }
1544
1545 return 0;
1546 diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c
1547 index 257fe87..29774e2 100644
1548 --- a/sound/pci/hda/patch_realtek.c
1549 +++ b/sound/pci/hda/patch_realtek.c
1550 @@ -4322,6 +4322,7 @@ static void alc_auto_init_std(struct hda_codec *codec)
1551 ((spec)->beep_amp = HDA_COMPOSE_AMP_VAL(nid, 3, idx, dir))
1552
1553 static const struct snd_pci_quirk beep_white_list[] = {
1554 + SND_PCI_QUIRK(0x1043, 0x103c, "ASUS", 1),
1555 SND_PCI_QUIRK(0x1043, 0x829f, "ASUS", 1),
1556 SND_PCI_QUIRK(0x1043, 0x83ce, "EeePC", 1),
1557 SND_PCI_QUIRK(0x1043, 0x831a, "EeePC", 1),
1558 @@ -7035,6 +7036,9 @@ static const struct hda_codec_preset snd_hda_preset_realtek[] = {
1559 { .id = 0x10ec0276, .name = "ALC276", .patch = patch_alc269 },
1560 { .id = 0x10ec0280, .name = "ALC280", .patch = patch_alc269 },
1561 { .id = 0x10ec0282, .name = "ALC282", .patch = patch_alc269 },
1562 + { .id = 0x10ec0283, .name = "ALC283", .patch = patch_alc269 },
1563 + { .id = 0x10ec0290, .name = "ALC290", .patch = patch_alc269 },
1564 + { .id = 0x10ec0292, .name = "ALC292", .patch = patch_alc269 },
1565 { .id = 0x10ec0861, .rev = 0x100340, .name = "ALC660",
1566 .patch = patch_alc861 },
1567 { .id = 0x10ec0660, .name = "ALC660-VD", .patch = patch_alc861vd },
1568 diff --git a/sound/usb/caiaq/device.c b/sound/usb/caiaq/device.c
1569 index 64aed43..7da0d0a 100644
1570 --- a/sound/usb/caiaq/device.c
1571 +++ b/sound/usb/caiaq/device.c
1572 @@ -485,7 +485,7 @@ static int __devinit snd_probe(struct usb_interface *intf,
1573 const struct usb_device_id *id)
1574 {
1575 int ret;
1576 - struct snd_card *card;
1577 + struct snd_card *card = NULL;
1578 struct usb_device *device = interface_to_usbdev(intf);
1579
1580 ret = create_card(device, intf, &card);
1581 diff --git a/sound/usb/midi.c b/sound/usb/midi.c
1582 index c83f614..eeefbce 100644
1583 --- a/sound/usb/midi.c
1584 +++ b/sound/usb/midi.c
1585 @@ -148,6 +148,7 @@ struct snd_usb_midi_out_endpoint {
1586 struct snd_usb_midi_out_endpoint* ep;
1587 struct snd_rawmidi_substream *substream;
1588 int active;
1589 + bool autopm_reference;
1590 uint8_t cable; /* cable number << 4 */
1591 uint8_t state;
1592 #define STATE_UNKNOWN 0
1593 @@ -1076,7 +1077,8 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
1594 return -ENXIO;
1595 }
1596 err = usb_autopm_get_interface(umidi->iface);
1597 - if (err < 0)
1598 + port->autopm_reference = err >= 0;
1599 + if (err < 0 && err != -EACCES)
1600 return -EIO;
1601 substream->runtime->private_data = port;
1602 port->state = STATE_UNKNOWN;
1603 @@ -1087,9 +1089,11 @@ static int snd_usbmidi_output_open(struct snd_rawmidi_substream *substream)
1604 static int snd_usbmidi_output_close(struct snd_rawmidi_substream *substream)
1605 {
1606 struct snd_usb_midi* umidi = substream->rmidi->private_data;
1607 + struct usbmidi_out_port *port = substream->runtime->private_data;
1608
1609 substream_open(substream, 0);
1610 - usb_autopm_put_interface(umidi->iface);
1611 + if (port->autopm_reference)
1612 + usb_autopm_put_interface(umidi->iface);
1613 return 0;
1614 }
1615