/[linux-patches]/genpatches-2.6/trunk/3.4/1020_linux-3.4.21.patch
Gentoo

Contents of /genpatches-2.6/trunk/3.4/1020_linux-3.4.21.patch

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.20