/[linux-patches]/genpatches-2.6/tags/2.6.34-10/1003_linux-2.6.34.4.patch
Gentoo

Contents of /genpatches-2.6/tags/2.6.34-10/1003_linux-2.6.34.4.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1771 - (show annotations) (download)
Tue Aug 31 14:13:10 2010 UTC (4 years, 10 months ago) by mpagano
File size: 69428 byte(s)
2.6.34-10 release
1 diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig
2 index 92622eb..811dedc 100644
3 --- a/arch/arm/Kconfig
4 +++ b/arch/arm/Kconfig
5 @@ -1025,6 +1025,18 @@ config PL310_ERRATA_588369
6 is not correctly implemented in PL310 as clean lines are not
7 invalidated as a result of these operations. Note that this errata
8 uses Texas Instrument's secure monitor api.
9 +
10 +config ARM_ERRATA_720789
11 + bool "ARM errata: TLBIASIDIS and TLBIMVAIS operations can broadcast a faulty ASID"
12 + depends on CPU_V7 && SMP
13 + help
14 + This option enables the workaround for the 720789 Cortex-A9 (prior to
15 + r2p0) erratum. A faulty ASID can be sent to the other CPUs for the
16 + broadcasted CP15 TLB maintenance operations TLBIASIDIS and TLBIMVAIS.
17 + As a consequence of this erratum, some TLB entries which should be
18 + invalidated are not, resulting in an incoherency in the system page
19 + tables. The workaround changes the TLB flushing routines to invalidate
20 + entries regardless of the ASID.
21 endmenu
22
23 source "arch/arm/common/Kconfig"
24 diff --git a/arch/arm/include/asm/tlbflush.h b/arch/arm/include/asm/tlbflush.h
25 index bd863d8..33b546a 100644
26 --- a/arch/arm/include/asm/tlbflush.h
27 +++ b/arch/arm/include/asm/tlbflush.h
28 @@ -378,7 +378,11 @@ static inline void local_flush_tlb_mm(struct mm_struct *mm)
29 if (tlb_flag(TLB_V6_I_ASID))
30 asm("mcr p15, 0, %0, c8, c5, 2" : : "r" (asid) : "cc");
31 if (tlb_flag(TLB_V7_UIS_ASID))
32 +#ifdef CONFIG_ARM_ERRATA_720789
33 + asm("mcr p15, 0, %0, c8, c3, 0" : : "r" (zero) : "cc");
34 +#else
35 asm("mcr p15, 0, %0, c8, c3, 2" : : "r" (asid) : "cc");
36 +#endif
37
38 if (tlb_flag(TLB_BTB)) {
39 /* flush the branch target cache */
40 @@ -424,7 +428,11 @@ local_flush_tlb_page(struct vm_area_struct *vma, unsigned long uaddr)
41 if (tlb_flag(TLB_V6_I_PAGE))
42 asm("mcr p15, 0, %0, c8, c5, 1" : : "r" (uaddr) : "cc");
43 if (tlb_flag(TLB_V7_UIS_PAGE))
44 +#ifdef CONFIG_ARM_ERRATA_720789
45 + asm("mcr p15, 0, %0, c8, c3, 3" : : "r" (uaddr & PAGE_MASK) : "cc");
46 +#else
47 asm("mcr p15, 0, %0, c8, c3, 1" : : "r" (uaddr) : "cc");
48 +#endif
49
50 if (tlb_flag(TLB_BTB)) {
51 /* flush the branch target cache */
52 diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
53 index d37cfa1..f054062 100644
54 --- a/arch/arm/mach-pxa/cm-x300.c
55 +++ b/arch/arm/mach-pxa/cm-x300.c
56 @@ -667,9 +667,10 @@ static void __init cm_x300_init(void)
57 {
58 cm_x300_init_mfp();
59
60 - pxa_set_ffuart_info(NULL);
61 pxa_set_btuart_info(NULL);
62 pxa_set_stuart_info(NULL);
63 + if (cpu_is_pxa300())
64 + pxa_set_ffuart_info(NULL);
65
66 cm_x300_init_da9030();
67 cm_x300_init_dm9000();
68 diff --git a/arch/arm/plat-mxc/include/mach/gpio.h b/arch/arm/plat-mxc/include/mach/gpio.h
69 index 6bd932c..7a0dc5a 100644
70 --- a/arch/arm/plat-mxc/include/mach/gpio.h
71 +++ b/arch/arm/plat-mxc/include/mach/gpio.h
72 @@ -19,6 +19,7 @@
73 #ifndef __ASM_ARCH_MXC_GPIO_H__
74 #define __ASM_ARCH_MXC_GPIO_H__
75
76 +#include <linux/spinlock.h>
77 #include <mach/hardware.h>
78 #include <asm-generic/gpio.h>
79
80 diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
81 index 1a54a3b..7546e2c 100644
82 --- a/arch/powerpc/Makefile
83 +++ b/arch/powerpc/Makefile
84 @@ -158,9 +158,11 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
85 # Default to zImage, override when needed
86 all: zImage
87
88 -BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
89 +# With make 3.82 we cannot mix normal and wildcard targets
90 +BOOT_TARGETS1 := zImage zImage.initrd uImaged
91 +BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
92
93 -PHONY += $(BOOT_TARGETS)
94 +PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
95
96 boot := arch/$(ARCH)/boot
97
98 @@ -175,10 +177,16 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
99 zImage: relocs_check
100 endif
101
102 -$(BOOT_TARGETS): vmlinux
103 +$(BOOT_TARGETS1): vmlinux
104 + $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
105 +$(BOOT_TARGETS2): vmlinux
106 + $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
107 +
108 +
109 +bootwrapper_install:
110 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
111
112 -bootwrapper_install %.dtb:
113 +%.dtb:
114 $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
115
116 define archhelp
117 diff --git a/arch/x86/include/asm/cmpxchg_32.h b/arch/x86/include/asm/cmpxchg_32.h
118 index ffb9bb6..a6d360e 100644
119 --- a/arch/x86/include/asm/cmpxchg_32.h
120 +++ b/arch/x86/include/asm/cmpxchg_32.h
121 @@ -27,20 +27,20 @@ struct __xchg_dummy {
122 switch (size) { \
123 case 1: \
124 asm volatile("xchgb %b0,%1" \
125 - : "=q" (__x) \
126 - : "m" (*__xg(ptr)), "0" (__x) \
127 + : "=q" (__x), "+m" (*__xg(ptr)) \
128 + : "0" (__x) \
129 : "memory"); \
130 break; \
131 case 2: \
132 asm volatile("xchgw %w0,%1" \
133 - : "=r" (__x) \
134 - : "m" (*__xg(ptr)), "0" (__x) \
135 + : "=r" (__x), "+m" (*__xg(ptr)) \
136 + : "0" (__x) \
137 : "memory"); \
138 break; \
139 case 4: \
140 asm volatile("xchgl %0,%1" \
141 - : "=r" (__x) \
142 - : "m" (*__xg(ptr)), "0" (__x) \
143 + : "=r" (__x), "+m" (*__xg(ptr)) \
144 + : "0" (__x) \
145 : "memory"); \
146 break; \
147 default: \
148 @@ -70,14 +70,14 @@ static inline void __set_64bit(unsigned long long *ptr,
149 unsigned int low, unsigned int high)
150 {
151 asm volatile("\n1:\t"
152 - "movl (%0), %%eax\n\t"
153 - "movl 4(%0), %%edx\n\t"
154 - LOCK_PREFIX "cmpxchg8b (%0)\n\t"
155 + "movl (%1), %%eax\n\t"
156 + "movl 4(%1), %%edx\n\t"
157 + LOCK_PREFIX "cmpxchg8b (%1)\n\t"
158 "jnz 1b"
159 - : /* no outputs */
160 - : "D"(ptr),
161 - "b"(low),
162 - "c"(high)
163 + : "=m" (*ptr)
164 + : "D" (ptr),
165 + "b" (low),
166 + "c" (high)
167 : "ax", "dx", "memory");
168 }
169
170 @@ -121,21 +121,21 @@ extern void __cmpxchg_wrong_size(void);
171 __typeof__(*(ptr)) __new = (new); \
172 switch (size) { \
173 case 1: \
174 - asm volatile(lock "cmpxchgb %b1,%2" \
175 - : "=a"(__ret) \
176 - : "q"(__new), "m"(*__xg(ptr)), "0"(__old) \
177 + asm volatile(lock "cmpxchgb %b2,%1" \
178 + : "=a" (__ret), "+m" (*__xg(ptr)) \
179 + : "q" (__new), "0" (__old) \
180 : "memory"); \
181 break; \
182 case 2: \
183 - asm volatile(lock "cmpxchgw %w1,%2" \
184 - : "=a"(__ret) \
185 - : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
186 + asm volatile(lock "cmpxchgw %w2,%1" \
187 + : "=a" (__ret), "+m" (*__xg(ptr)) \
188 + : "r" (__new), "0" (__old) \
189 : "memory"); \
190 break; \
191 case 4: \
192 - asm volatile(lock "cmpxchgl %1,%2" \
193 - : "=a"(__ret) \
194 - : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
195 + asm volatile(lock "cmpxchgl %2,%1" \
196 + : "=a" (__ret), "+m" (*__xg(ptr)) \
197 + : "r" (__new), "0" (__old) \
198 : "memory"); \
199 break; \
200 default: \
201 @@ -180,12 +180,12 @@ static inline unsigned long long __cmpxchg64(volatile void *ptr,
202 unsigned long long new)
203 {
204 unsigned long long prev;
205 - asm volatile(LOCK_PREFIX "cmpxchg8b %3"
206 - : "=A"(prev)
207 - : "b"((unsigned long)new),
208 - "c"((unsigned long)(new >> 32)),
209 - "m"(*__xg(ptr)),
210 - "0"(old)
211 + asm volatile(LOCK_PREFIX "cmpxchg8b %1"
212 + : "=A" (prev),
213 + "+m" (*__xg(ptr))
214 + : "b" ((unsigned long)new),
215 + "c" ((unsigned long)(new >> 32)),
216 + "0" (old)
217 : "memory");
218 return prev;
219 }
220 @@ -195,12 +195,12 @@ static inline unsigned long long __cmpxchg64_local(volatile void *ptr,
221 unsigned long long new)
222 {
223 unsigned long long prev;
224 - asm volatile("cmpxchg8b %3"
225 - : "=A"(prev)
226 - : "b"((unsigned long)new),
227 - "c"((unsigned long)(new >> 32)),
228 - "m"(*__xg(ptr)),
229 - "0"(old)
230 + asm volatile("cmpxchg8b %1"
231 + : "=A" (prev),
232 + "+m" (*__xg(ptr))
233 + : "b" ((unsigned long)new),
234 + "c" ((unsigned long)(new >> 32)),
235 + "0" (old)
236 : "memory");
237 return prev;
238 }
239 diff --git a/arch/x86/include/asm/cmpxchg_64.h b/arch/x86/include/asm/cmpxchg_64.h
240 index 485ae41..b92f147 100644
241 --- a/arch/x86/include/asm/cmpxchg_64.h
242 +++ b/arch/x86/include/asm/cmpxchg_64.h
243 @@ -26,26 +26,26 @@ extern void __cmpxchg_wrong_size(void);
244 switch (size) { \
245 case 1: \
246 asm volatile("xchgb %b0,%1" \
247 - : "=q" (__x) \
248 - : "m" (*__xg(ptr)), "0" (__x) \
249 + : "=q" (__x), "+m" (*__xg(ptr)) \
250 + : "0" (__x) \
251 : "memory"); \
252 break; \
253 case 2: \
254 asm volatile("xchgw %w0,%1" \
255 - : "=r" (__x) \
256 - : "m" (*__xg(ptr)), "0" (__x) \
257 + : "=r" (__x), "+m" (*__xg(ptr)) \
258 + : "0" (__x) \
259 : "memory"); \
260 break; \
261 case 4: \
262 asm volatile("xchgl %k0,%1" \
263 - : "=r" (__x) \
264 - : "m" (*__xg(ptr)), "0" (__x) \
265 + : "=r" (__x), "+m" (*__xg(ptr)) \
266 + : "0" (__x) \
267 : "memory"); \
268 break; \
269 case 8: \
270 asm volatile("xchgq %0,%1" \
271 - : "=r" (__x) \
272 - : "m" (*__xg(ptr)), "0" (__x) \
273 + : "=r" (__x), "+m" (*__xg(ptr)) \
274 + : "0" (__x) \
275 : "memory"); \
276 break; \
277 default: \
278 @@ -71,27 +71,27 @@ extern void __cmpxchg_wrong_size(void);
279 __typeof__(*(ptr)) __new = (new); \
280 switch (size) { \
281 case 1: \
282 - asm volatile(lock "cmpxchgb %b1,%2" \
283 - : "=a"(__ret) \
284 - : "q"(__new), "m"(*__xg(ptr)), "0"(__old) \
285 + asm volatile(lock "cmpxchgb %b2,%1" \
286 + : "=a" (__ret), "+m" (*__xg(ptr)) \
287 + : "q" (__new), "0" (__old) \
288 : "memory"); \
289 break; \
290 case 2: \
291 - asm volatile(lock "cmpxchgw %w1,%2" \
292 - : "=a"(__ret) \
293 - : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
294 + asm volatile(lock "cmpxchgw %w2,%1" \
295 + : "=a" (__ret), "+m" (*__xg(ptr)) \
296 + : "r" (__new), "0" (__old) \
297 : "memory"); \
298 break; \
299 case 4: \
300 - asm volatile(lock "cmpxchgl %k1,%2" \
301 - : "=a"(__ret) \
302 - : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
303 + asm volatile(lock "cmpxchgl %k2,%1" \
304 + : "=a" (__ret), "+m" (*__xg(ptr)) \
305 + : "r" (__new), "0" (__old) \
306 : "memory"); \
307 break; \
308 case 8: \
309 - asm volatile(lock "cmpxchgq %1,%2" \
310 - : "=a"(__ret) \
311 - : "r"(__new), "m"(*__xg(ptr)), "0"(__old) \
312 + asm volatile(lock "cmpxchgq %2,%1" \
313 + : "=a" (__ret), "+m" (*__xg(ptr)) \
314 + : "r" (__new), "0" (__old) \
315 : "memory"); \
316 break; \
317 default: \
318 diff --git a/arch/x86/kernel/cpu/vmware.c b/arch/x86/kernel/cpu/vmware.c
319 index dfdb4db..562d5f0 100644
320 --- a/arch/x86/kernel/cpu/vmware.c
321 +++ b/arch/x86/kernel/cpu/vmware.c
322 @@ -51,7 +51,7 @@ static inline int __vmware_platform(void)
323
324 static unsigned long vmware_get_tsc_khz(void)
325 {
326 - uint64_t tsc_hz;
327 + uint64_t tsc_hz, lpj;
328 uint32_t eax, ebx, ecx, edx;
329
330 VMWARE_PORT(GETHZ, eax, ebx, ecx, edx);
331 @@ -62,6 +62,13 @@ static unsigned long vmware_get_tsc_khz(void)
332 printk(KERN_INFO "TSC freq read from hypervisor : %lu.%03lu MHz\n",
333 (unsigned long) tsc_hz / 1000,
334 (unsigned long) tsc_hz % 1000);
335 +
336 + if (!preset_lpj) {
337 + lpj = ((u64)tsc_hz * 1000);
338 + do_div(lpj, HZ);
339 + preset_lpj = lpj;
340 + }
341 +
342 return tsc_hz;
343 }
344
345 diff --git a/arch/x86/mm/fault.c b/arch/x86/mm/fault.c
346 index f627779..4c4508e 100644
347 --- a/arch/x86/mm/fault.c
348 +++ b/arch/x86/mm/fault.c
349 @@ -802,8 +802,10 @@ do_sigbus(struct pt_regs *regs, unsigned long error_code, unsigned long address,
350 up_read(&mm->mmap_sem);
351
352 /* Kernel mode? Handle exceptions or die: */
353 - if (!(error_code & PF_USER))
354 + if (!(error_code & PF_USER)) {
355 no_context(regs, error_code, address);
356 + return;
357 + }
358
359 /* User-space => ok to do another page fault: */
360 if (is_prefetch(regs, error_code, address))
361 diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c
362 index 5d0e67f..e5d5e2c 100644
363 --- a/arch/x86/mm/kmmio.c
364 +++ b/arch/x86/mm/kmmio.c
365 @@ -45,6 +45,8 @@ struct kmmio_fault_page {
366 * Protected by kmmio_lock, when linked into kmmio_page_table.
367 */
368 int count;
369 +
370 + bool scheduled_for_release;
371 };
372
373 struct kmmio_delayed_release {
374 @@ -398,8 +400,11 @@ static void release_kmmio_fault_page(unsigned long page,
375 BUG_ON(f->count < 0);
376 if (!f->count) {
377 disarm_kmmio_fault_page(f);
378 - f->release_next = *release_list;
379 - *release_list = f;
380 + if (!f->scheduled_for_release) {
381 + f->release_next = *release_list;
382 + *release_list = f;
383 + f->scheduled_for_release = true;
384 + }
385 }
386 }
387
388 @@ -471,8 +476,10 @@ static void remove_kmmio_fault_pages(struct rcu_head *head)
389 prevp = &f->release_next;
390 } else {
391 *prevp = f->release_next;
392 + f->release_next = NULL;
393 + f->scheduled_for_release = false;
394 }
395 - f = f->release_next;
396 + f = *prevp;
397 }
398 spin_unlock_irqrestore(&kmmio_lock, flags);
399
400 @@ -510,6 +517,9 @@ void unregister_kmmio_probe(struct kmmio_probe *p)
401 kmmio_count--;
402 spin_unlock_irqrestore(&kmmio_lock, flags);
403
404 + if (!release_list)
405 + return;
406 +
407 drelease = kmalloc(sizeof(*drelease), GFP_ATOMIC);
408 if (!drelease) {
409 pr_crit("leaking kmmio_fault_page objects.\n");
410 diff --git a/arch/x86/mm/testmmiotrace.c b/arch/x86/mm/testmmiotrace.c
411 index 8565d94..38868ad 100644
412 --- a/arch/x86/mm/testmmiotrace.c
413 +++ b/arch/x86/mm/testmmiotrace.c
414 @@ -90,6 +90,27 @@ static void do_test(unsigned long size)
415 iounmap(p);
416 }
417
418 +/*
419 + * Tests how mmiotrace behaves in face of multiple ioremap / iounmaps in
420 + * a short time. We had a bug in deferred freeing procedure which tried
421 + * to free this region multiple times (ioremap can reuse the same address
422 + * for many mappings).
423 + */
424 +static void do_test_bulk_ioremapping(void)
425 +{
426 + void __iomem *p;
427 + int i;
428 +
429 + for (i = 0; i < 10; ++i) {
430 + p = ioremap_nocache(mmio_address, PAGE_SIZE);
431 + if (p)
432 + iounmap(p);
433 + }
434 +
435 + /* Force freeing. If it will crash we will know why. */
436 + synchronize_rcu();
437 +}
438 +
439 static int __init init(void)
440 {
441 unsigned long size = (read_far) ? (8 << 20) : (16 << 10);
442 @@ -104,6 +125,7 @@ static int __init init(void)
443 "and writing 16 kB of rubbish in there.\n",
444 size >> 10, mmio_address);
445 do_test(size);
446 + do_test_bulk_ioremapping();
447 pr_info("All done.\n");
448 return 0;
449 }
450 diff --git a/arch/x86/pci/acpi.c b/arch/x86/pci/acpi.c
451 index 31930fd..7743fb1 100644
452 --- a/arch/x86/pci/acpi.c
453 +++ b/arch/x86/pci/acpi.c
454 @@ -34,6 +34,15 @@ static const struct dmi_system_id pci_use_crs_table[] __initconst = {
455 DMI_MATCH(DMI_PRODUCT_NAME, "x3800"),
456 },
457 },
458 + /* https://bugzilla.kernel.org/show_bug.cgi?id=16007 */
459 + /* 2006 AMD HT/VIA system with two host bridges */
460 + {
461 + .callback = set_use_crs,
462 + .ident = "ASRock ALiveSATA2-GLAN",
463 + .matches = {
464 + DMI_MATCH(DMI_PRODUCT_NAME, "ALiveSATA2-GLAN"),
465 + },
466 + },
467 {}
468 };
469
470 diff --git a/drivers/ata/ata_piix.c b/drivers/ata/ata_piix.c
471 index 83bc49f..da16f89 100644
472 --- a/drivers/ata/ata_piix.c
473 +++ b/drivers/ata/ata_piix.c
474 @@ -158,6 +158,7 @@ struct piix_map_db {
475 struct piix_host_priv {
476 const int *map;
477 u32 saved_iocfg;
478 + spinlock_t sidpr_lock; /* FIXME: remove once locking in EH is fixed */
479 void __iomem *sidpr;
480 };
481
482 @@ -951,12 +952,15 @@ static int piix_sidpr_scr_read(struct ata_link *link,
483 unsigned int reg, u32 *val)
484 {
485 struct piix_host_priv *hpriv = link->ap->host->private_data;
486 + unsigned long flags;
487
488 if (reg >= ARRAY_SIZE(piix_sidx_map))
489 return -EINVAL;
490
491 + spin_lock_irqsave(&hpriv->sidpr_lock, flags);
492 piix_sidpr_sel(link, reg);
493 *val = ioread32(hpriv->sidpr + PIIX_SIDPR_DATA);
494 + spin_unlock_irqrestore(&hpriv->sidpr_lock, flags);
495 return 0;
496 }
497
498 @@ -964,12 +968,15 @@ static int piix_sidpr_scr_write(struct ata_link *link,
499 unsigned int reg, u32 val)
500 {
501 struct piix_host_priv *hpriv = link->ap->host->private_data;
502 + unsigned long flags;
503
504 if (reg >= ARRAY_SIZE(piix_sidx_map))
505 return -EINVAL;
506
507 + spin_lock_irqsave(&hpriv->sidpr_lock, flags);
508 piix_sidpr_sel(link, reg);
509 iowrite32(val, hpriv->sidpr + PIIX_SIDPR_DATA);
510 + spin_unlock_irqrestore(&hpriv->sidpr_lock, flags);
511 return 0;
512 }
513
514 @@ -1566,6 +1573,7 @@ static int __devinit piix_init_one(struct pci_dev *pdev,
515 hpriv = devm_kzalloc(dev, sizeof(*hpriv), GFP_KERNEL);
516 if (!hpriv)
517 return -ENOMEM;
518 + spin_lock_init(&hpriv->sidpr_lock);
519
520 /* Save IOCFG, this will be used for cable detection, quirk
521 * detection and restoration on detach. This is necessary
522 diff --git a/drivers/atm/solos-pci.c b/drivers/atm/solos-pci.c
523 index ded76c4..3613422 100644
524 --- a/drivers/atm/solos-pci.c
525 +++ b/drivers/atm/solos-pci.c
526 @@ -781,7 +781,8 @@ static struct atm_vcc *find_vcc(struct atm_dev *dev, short vpi, int vci)
527 sk_for_each(s, node, head) {
528 vcc = atm_sk(s);
529 if (vcc->dev == dev && vcc->vci == vci &&
530 - vcc->vpi == vpi && vcc->qos.rxtp.traffic_class != ATM_NONE)
531 + vcc->vpi == vpi && vcc->qos.rxtp.traffic_class != ATM_NONE &&
532 + test_bit(ATM_VF_READY, &vcc->flags))
533 goto out;
534 }
535 vcc = NULL;
536 @@ -907,6 +908,10 @@ static void pclose(struct atm_vcc *vcc)
537 clear_bit(ATM_VF_ADDR, &vcc->flags);
538 clear_bit(ATM_VF_READY, &vcc->flags);
539
540 + /* Hold up vcc_destroy_socket() (our caller) until solos_bh() in the
541 + tasklet has finished processing any incoming packets (and, more to
542 + the point, using the vcc pointer). */
543 + tasklet_unlock_wait(&card->tlet);
544 return;
545 }
546
547 diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
548 index 5d9cc53..6fcb971 100644
549 --- a/drivers/bluetooth/btusb.c
550 +++ b/drivers/bluetooth/btusb.c
551 @@ -59,6 +59,9 @@ static struct usb_device_id btusb_table[] = {
552 /* Generic Bluetooth USB device */
553 { USB_DEVICE_INFO(0xe0, 0x01, 0x01) },
554
555 + /* Apple iMac11,1 */
556 + { USB_DEVICE(0x05ac, 0x8215) },
557 +
558 /* AVM BlueFRITZ! USB v2.0 */
559 { USB_DEVICE(0x057c, 0x3800) },
560
561 diff --git a/drivers/char/nozomi.c b/drivers/char/nozomi.c
562 index a663800..18af923 100644
563 --- a/drivers/char/nozomi.c
564 +++ b/drivers/char/nozomi.c
565 @@ -1611,6 +1611,8 @@ static int ntty_install(struct tty_driver *driver, struct tty_struct *tty)
566 ret = tty_init_termios(tty);
567 if (ret == 0) {
568 tty_driver_kref_get(driver);
569 + tty->count++;
570 + tty->driver_data = port;
571 driver->ttys[tty->index] = tty;
572 }
573 return ret;
574 @@ -1639,7 +1641,7 @@ static int ntty_activate(struct tty_port *tport, struct tty_struct *tty)
575
576 static int ntty_open(struct tty_struct *tty, struct file *filp)
577 {
578 - struct port *port = get_port_by_tty(tty);
579 + struct port *port = tty->driver_data;
580 return tty_port_open(&port->port, tty, filp);
581 }
582
583 diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
584 index 10348d3..d0acfd6 100644
585 --- a/drivers/gpu/drm/drm_edid.c
586 +++ b/drivers/gpu/drm/drm_edid.c
587 @@ -577,8 +577,8 @@ struct drm_display_mode *drm_mode_std(struct drm_device *dev,
588 mode = drm_cvt_mode(dev, hsize, vsize, vrefresh_rate, 0, 0,
589 false);
590 mode->hdisplay = 1366;
591 - mode->vsync_start = mode->vsync_start - 1;
592 - mode->vsync_end = mode->vsync_end - 1;
593 + mode->hsync_start = mode->hsync_start - 1;
594 + mode->hsync_end = mode->hsync_end - 1;
595 return mode;
596 }
597 mode = NULL;
598 diff --git a/drivers/gpu/drm/i915/dvo_tfp410.c b/drivers/gpu/drm/i915/dvo_tfp410.c
599 index c7c391b..ad2e309 100644
600 --- a/drivers/gpu/drm/i915/dvo_tfp410.c
601 +++ b/drivers/gpu/drm/i915/dvo_tfp410.c
602 @@ -216,7 +216,7 @@ static enum drm_connector_status tfp410_detect(struct intel_dvo_device *dvo)
603 uint8_t ctl2;
604
605 if (tfp410_readb(dvo, TFP410_CTL_2, &ctl2)) {
606 - if (ctl2 & TFP410_CTL_2_HTPLG)
607 + if (ctl2 & TFP410_CTL_2_RSEN)
608 ret = connector_status_connected;
609 else
610 ret = connector_status_disconnected;
611 diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
612 index a9ec41d..f3902d3 100644
613 --- a/drivers/gpu/drm/i915/intel_dp.c
614 +++ b/drivers/gpu/drm/i915/intel_dp.c
615 @@ -138,6 +138,12 @@ intel_dp_link_required(struct drm_device *dev,
616 }
617
618 static int
619 +intel_dp_max_data_rate(int max_link_clock, int max_lanes)
620 +{
621 + return (max_link_clock * max_lanes * 8) / 10;
622 +}
623 +
624 +static int
625 intel_dp_mode_valid(struct drm_connector *connector,
626 struct drm_display_mode *mode)
627 {
628 @@ -145,8 +151,11 @@ intel_dp_mode_valid(struct drm_connector *connector,
629 int max_link_clock = intel_dp_link_clock(intel_dp_max_link_bw(intel_encoder));
630 int max_lanes = intel_dp_max_lane_count(intel_encoder);
631
632 - if (intel_dp_link_required(connector->dev, intel_encoder, mode->clock)
633 - > max_link_clock * max_lanes)
634 + /* only refuse the mode on non eDP since we have seen some wierd eDP panels
635 + which are outside spec tolerances but somehow work by magic */
636 + if (!IS_eDP(intel_encoder) &&
637 + (intel_dp_link_required(connector->dev, intel_encoder, mode->clock)
638 + > intel_dp_max_data_rate(max_link_clock, max_lanes)))
639 return MODE_CLOCK_HIGH;
640
641 if (mode->clock < 10000)
642 @@ -498,7 +507,7 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
643
644 for (lane_count = 1; lane_count <= max_lane_count; lane_count <<= 1) {
645 for (clock = 0; clock <= max_clock; clock++) {
646 - int link_avail = intel_dp_link_clock(bws[clock]) * lane_count;
647 + int link_avail = intel_dp_max_data_rate(intel_dp_link_clock(bws[clock]), lane_count);
648
649 if (intel_dp_link_required(encoder->dev, intel_encoder, mode->clock)
650 <= link_avail) {
651 @@ -513,6 +522,18 @@ intel_dp_mode_fixup(struct drm_encoder *encoder, struct drm_display_mode *mode,
652 }
653 }
654 }
655 +
656 + if (IS_eDP(intel_encoder)) {
657 + /* okay we failed just pick the highest */
658 + dp_priv->lane_count = max_lane_count;
659 + dp_priv->link_bw = bws[max_clock];
660 + adjusted_mode->clock = intel_dp_link_clock(dp_priv->link_bw);
661 + DRM_DEBUG_KMS("Force picking display port link bw %02x lane "
662 + "count %d clock %d\n",
663 + dp_priv->link_bw, dp_priv->lane_count,
664 + adjusted_mode->clock);
665 + return true;
666 + }
667 return false;
668 }
669
670 diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c
671 index 64207df..2de76cc 100644
672 --- a/drivers/ide/ide-cd.c
673 +++ b/drivers/ide/ide-cd.c
674 @@ -506,15 +506,22 @@ int ide_cd_queue_pc(ide_drive_t *drive, const unsigned char *cmd,
675 return (flags & REQ_FAILED) ? -EIO : 0;
676 }
677
678 -static void ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd)
679 +/*
680 + * returns true if rq has been completed
681 + */
682 +static bool ide_cd_error_cmd(ide_drive_t *drive, struct ide_cmd *cmd)
683 {
684 unsigned int nr_bytes = cmd->nbytes - cmd->nleft;
685
686 if (cmd->tf_flags & IDE_TFLAG_WRITE)
687 nr_bytes -= cmd->last_xfer_len;
688
689 - if (nr_bytes > 0)
690 + if (nr_bytes > 0) {
691 ide_complete_rq(drive, 0, nr_bytes);
692 + return true;
693 + }
694 +
695 + return false;
696 }
697
698 static ide_startstop_t cdrom_newpc_intr(ide_drive_t *drive)
699 @@ -679,7 +686,8 @@ out_end:
700 }
701
702 if (uptodate == 0 && rq->bio)
703 - ide_cd_error_cmd(drive, cmd);
704 + if (ide_cd_error_cmd(drive, cmd))
705 + return ide_stopped;
706
707 /* make sure it's fully ended */
708 if (blk_fs_request(rq) == 0) {
709 diff --git a/drivers/md/bitmap.c b/drivers/md/bitmap.c
710 index 26ac8aa..dfbc0eb 100644
711 --- a/drivers/md/bitmap.c
712 +++ b/drivers/md/bitmap.c
713 @@ -1351,7 +1351,8 @@ void bitmap_endwrite(struct bitmap *bitmap, sector_t offset, unsigned long secto
714 {
715 if (!bitmap) return;
716 if (behind) {
717 - atomic_dec(&bitmap->behind_writes);
718 + if (atomic_dec_and_test(&bitmap->behind_writes))
719 + wake_up(&bitmap->behind_wait);
720 PRINTK(KERN_DEBUG "dec write-behind count %d/%d\n",
721 atomic_read(&bitmap->behind_writes), bitmap->max_write_behind);
722 }
723 @@ -1675,6 +1676,7 @@ int bitmap_create(mddev_t *mddev)
724 atomic_set(&bitmap->pending_writes, 0);
725 init_waitqueue_head(&bitmap->write_wait);
726 init_waitqueue_head(&bitmap->overflow_wait);
727 + init_waitqueue_head(&bitmap->behind_wait);
728
729 bitmap->mddev = mddev;
730
731 diff --git a/drivers/md/bitmap.h b/drivers/md/bitmap.h
732 index cb821d7..586688c 100644
733 --- a/drivers/md/bitmap.h
734 +++ b/drivers/md/bitmap.h
735 @@ -239,6 +239,7 @@ struct bitmap {
736 atomic_t pending_writes; /* pending writes to the bitmap file */
737 wait_queue_head_t write_wait;
738 wait_queue_head_t overflow_wait;
739 + wait_queue_head_t behind_wait;
740
741 struct sysfs_dirent *sysfs_can_clear;
742 };
743 diff --git a/drivers/md/raid1.c b/drivers/md/raid1.c
744 index 84d3bf0..52c6b5f 100644
745 --- a/drivers/md/raid1.c
746 +++ b/drivers/md/raid1.c
747 @@ -866,6 +866,15 @@ static int make_request(struct request_queue *q, struct bio * bio)
748 }
749 mirror = conf->mirrors + rdisk;
750
751 + if (test_bit(WriteMostly, &mirror->rdev->flags) &&
752 + bitmap) {
753 + /* Reading from a write-mostly device must
754 + * take care not to over-take any writes
755 + * that are 'behind'
756 + */
757 + wait_event(bitmap->behind_wait,
758 + atomic_read(&bitmap->behind_writes) == 0);
759 + }
760 r1_bio->read_disk = rdisk;
761
762 read_bio = bio_clone(bio, GFP_NOIO);
763 @@ -943,10 +952,14 @@ static int make_request(struct request_queue *q, struct bio * bio)
764 set_bit(R1BIO_Degraded, &r1_bio->state);
765 }
766
767 - /* do behind I/O ? */
768 + /* do behind I/O ?
769 + * Not if there are too many, or cannot allocate memory,
770 + * or a reader on WriteMostly is waiting for behind writes
771 + * to flush */
772 if (bitmap &&
773 (atomic_read(&bitmap->behind_writes)
774 < mddev->bitmap_info.max_write_behind) &&
775 + !waitqueue_active(&bitmap->behind_wait) &&
776 (behind_pages = alloc_behind_pages(bio)) != NULL)
777 set_bit(R1BIO_BehindIO, &r1_bio->state);
778
779 @@ -2153,15 +2166,13 @@ static int stop(mddev_t *mddev)
780 {
781 conf_t *conf = mddev->private;
782 struct bitmap *bitmap = mddev->bitmap;
783 - int behind_wait = 0;
784
785 /* wait for behind writes to complete */
786 - while (bitmap && atomic_read(&bitmap->behind_writes) > 0) {
787 - behind_wait++;
788 - printk(KERN_INFO "raid1: behind writes in progress on device %s, waiting to stop (%d)\n", mdname(mddev), behind_wait);
789 - set_current_state(TASK_UNINTERRUPTIBLE);
790 - schedule_timeout(HZ); /* wait a second */
791 + if (bitmap && atomic_read(&bitmap->behind_writes) > 0) {
792 + printk(KERN_INFO "raid1: behind writes in progress on device %s, waiting to stop.\n", mdname(mddev));
793 /* need to kick something here to make sure I/O goes? */
794 + wait_event(bitmap->behind_wait,
795 + atomic_read(&bitmap->behind_writes) == 0);
796 }
797
798 raise_barrier(conf);
799 diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
800 index c819165..07de6da 100644
801 --- a/drivers/md/raid10.c
802 +++ b/drivers/md/raid10.c
803 @@ -825,11 +825,29 @@ static int make_request(struct request_queue *q, struct bio * bio)
804 */
805 bp = bio_split(bio,
806 chunk_sects - (bio->bi_sector & (chunk_sects - 1)) );
807 +
808 + /* Each of these 'make_request' calls will call 'wait_barrier'.
809 + * If the first succeeds but the second blocks due to the resync
810 + * thread raising the barrier, we will deadlock because the
811 + * IO to the underlying device will be queued in generic_make_request
812 + * and will never complete, so will never reduce nr_pending.
813 + * So increment nr_waiting here so no new raise_barriers will
814 + * succeed, and so the second wait_barrier cannot block.
815 + */
816 + spin_lock_irq(&conf->resync_lock);
817 + conf->nr_waiting++;
818 + spin_unlock_irq(&conf->resync_lock);
819 +
820 if (make_request(q, &bp->bio1))
821 generic_make_request(&bp->bio1);
822 if (make_request(q, &bp->bio2))
823 generic_make_request(&bp->bio2);
824
825 + spin_lock_irq(&conf->resync_lock);
826 + conf->nr_waiting--;
827 + wake_up(&conf->wait_barrier);
828 + spin_unlock_irq(&conf->resync_lock);
829 +
830 bio_pair_release(bp);
831 return 0;
832 bad_map:
833 diff --git a/drivers/mtd/nand/plat_nand.c b/drivers/mtd/nand/plat_nand.c
834 index 8d46731..90e143e 100644
835 --- a/drivers/mtd/nand/plat_nand.c
836 +++ b/drivers/mtd/nand/plat_nand.c
837 @@ -91,7 +91,7 @@ static int __devinit plat_nand_probe(struct platform_device *pdev)
838 }
839
840 /* Scan to find existance of the device */
841 - if (nand_scan(&data->mtd, 1)) {
842 + if (nand_scan(&data->mtd, pdata->chip.nr_chips)) {
843 err = -ENXIO;
844 goto out;
845 }
846 diff --git a/drivers/net/smsc911x.c b/drivers/net/smsc911x.c
847 index cbf520d..60581c1 100644
848 --- a/drivers/net/smsc911x.c
849 +++ b/drivers/net/smsc911x.c
850 @@ -84,8 +84,7 @@ struct smsc911x_data {
851 */
852 spinlock_t mac_lock;
853
854 - /* spinlock to ensure 16-bit accesses are serialised.
855 - * unused with a 32-bit bus */
856 + /* spinlock to ensure register accesses are serialised */
857 spinlock_t dev_lock;
858
859 struct phy_device *phy_dev;
860 @@ -118,37 +117,33 @@ struct smsc911x_data {
861 unsigned int hashlo;
862 };
863
864 -/* The 16-bit access functions are significantly slower, due to the locking
865 - * necessary. If your bus hardware can be configured to do this for you
866 - * (in response to a single 32-bit operation from software), you should use
867 - * the 32-bit access functions instead. */
868 -
869 -static inline u32 smsc911x_reg_read(struct smsc911x_data *pdata, u32 reg)
870 +static inline u32 __smsc911x_reg_read(struct smsc911x_data *pdata, u32 reg)
871 {
872 if (pdata->config.flags & SMSC911X_USE_32BIT)
873 return readl(pdata->ioaddr + reg);
874
875 - if (pdata->config.flags & SMSC911X_USE_16BIT) {
876 - u32 data;
877 - unsigned long flags;
878 -
879 - /* these two 16-bit reads must be performed consecutively, so
880 - * must not be interrupted by our own ISR (which would start
881 - * another read operation) */
882 - spin_lock_irqsave(&pdata->dev_lock, flags);
883 - data = ((readw(pdata->ioaddr + reg) & 0xFFFF) |
884 + if (pdata->config.flags & SMSC911X_USE_16BIT)
885 + return ((readw(pdata->ioaddr + reg) & 0xFFFF) |
886 ((readw(pdata->ioaddr + reg + 2) & 0xFFFF) << 16));
887 - spin_unlock_irqrestore(&pdata->dev_lock, flags);
888 -
889 - return data;
890 - }
891
892 BUG();
893 return 0;
894 }
895
896 -static inline void smsc911x_reg_write(struct smsc911x_data *pdata, u32 reg,
897 - u32 val)
898 +static inline u32 smsc911x_reg_read(struct smsc911x_data *pdata, u32 reg)
899 +{
900 + u32 data;
901 + unsigned long flags;
902 +
903 + spin_lock_irqsave(&pdata->dev_lock, flags);
904 + data = __smsc911x_reg_read(pdata, reg);
905 + spin_unlock_irqrestore(&pdata->dev_lock, flags);
906 +
907 + return data;
908 +}
909 +
910 +static inline void __smsc911x_reg_write(struct smsc911x_data *pdata, u32 reg,
911 + u32 val)
912 {
913 if (pdata->config.flags & SMSC911X_USE_32BIT) {
914 writel(val, pdata->ioaddr + reg);
915 @@ -156,44 +151,54 @@ static inline void smsc911x_reg_write(struct smsc911x_data *pdata, u32 reg,
916 }
917
918 if (pdata->config.flags & SMSC911X_USE_16BIT) {
919 - unsigned long flags;
920 -
921 - /* these two 16-bit writes must be performed consecutively, so
922 - * must not be interrupted by our own ISR (which would start
923 - * another read operation) */
924 - spin_lock_irqsave(&pdata->dev_lock, flags);
925 writew(val & 0xFFFF, pdata->ioaddr + reg);
926 writew((val >> 16) & 0xFFFF, pdata->ioaddr + reg + 2);
927 - spin_unlock_irqrestore(&pdata->dev_lock, flags);
928 return;
929 }
930
931 BUG();
932 }
933
934 +static inline void smsc911x_reg_write(struct smsc911x_data *pdata, u32 reg,
935 + u32 val)
936 +{
937 + unsigned long flags;
938 +
939 + spin_lock_irqsave(&pdata->dev_lock, flags);
940 + __smsc911x_reg_write(pdata, reg, val);
941 + spin_unlock_irqrestore(&pdata->dev_lock, flags);
942 +}
943 +
944 /* Writes a packet to the TX_DATA_FIFO */
945 static inline void
946 smsc911x_tx_writefifo(struct smsc911x_data *pdata, unsigned int *buf,
947 unsigned int wordcount)
948 {
949 + unsigned long flags;
950 +
951 + spin_lock_irqsave(&pdata->dev_lock, flags);
952 +
953 if (pdata->config.flags & SMSC911X_SWAP_FIFO) {
954 while (wordcount--)
955 - smsc911x_reg_write(pdata, TX_DATA_FIFO, swab32(*buf++));
956 - return;
957 + __smsc911x_reg_write(pdata, TX_DATA_FIFO,
958 + swab32(*buf++));
959 + goto out;
960 }
961
962 if (pdata->config.flags & SMSC911X_USE_32BIT) {
963 writesl(pdata->ioaddr + TX_DATA_FIFO, buf, wordcount);
964 - return;
965 + goto out;
966 }
967
968 if (pdata->config.flags & SMSC911X_USE_16BIT) {
969 while (wordcount--)
970 - smsc911x_reg_write(pdata, TX_DATA_FIFO, *buf++);
971 - return;
972 + __smsc911x_reg_write(pdata, TX_DATA_FIFO, *buf++);
973 + goto out;
974 }
975
976 BUG();
977 +out:
978 + spin_unlock_irqrestore(&pdata->dev_lock, flags);
979 }
980
981 /* Reads a packet out of the RX_DATA_FIFO */
982 @@ -201,24 +206,31 @@ static inline void
983 smsc911x_rx_readfifo(struct smsc911x_data *pdata, unsigned int *buf,
984 unsigned int wordcount)
985 {
986 + unsigned long flags;
987 +
988 + spin_lock_irqsave(&pdata->dev_lock, flags);
989 +
990 if (pdata->config.flags & SMSC911X_SWAP_FIFO) {
991 while (wordcount--)
992 - *buf++ = swab32(smsc911x_reg_read(pdata, RX_DATA_FIFO));
993 - return;
994 + *buf++ = swab32(__smsc911x_reg_read(pdata,
995 + RX_DATA_FIFO));
996 + goto out;
997 }
998
999 if (pdata->config.flags & SMSC911X_USE_32BIT) {
1000 readsl(pdata->ioaddr + RX_DATA_FIFO, buf, wordcount);
1001 - return;
1002 + goto out;
1003 }
1004
1005 if (pdata->config.flags & SMSC911X_USE_16BIT) {
1006 while (wordcount--)
1007 - *buf++ = smsc911x_reg_read(pdata, RX_DATA_FIFO);
1008 - return;
1009 + *buf++ = __smsc911x_reg_read(pdata, RX_DATA_FIFO);
1010 + goto out;
1011 }
1012
1013 BUG();
1014 +out:
1015 + spin_unlock_irqrestore(&pdata->dev_lock, flags);
1016 }
1017
1018 /* waits for MAC not busy, with timeout. Only called by smsc911x_mac_read
1019 diff --git a/drivers/net/wireless/iwlwifi/iwl-devtrace.h b/drivers/net/wireless/iwlwifi/iwl-devtrace.h
1020 index ae7319b..4cf864c 100644
1021 --- a/drivers/net/wireless/iwlwifi/iwl-devtrace.h
1022 +++ b/drivers/net/wireless/iwlwifi/iwl-devtrace.h
1023 @@ -193,7 +193,7 @@ TRACE_EVENT(iwlwifi_dev_tx,
1024 __entry->framelen = buf0_len + buf1_len;
1025 memcpy(__get_dynamic_array(tfd), tfd, tfdlen);
1026 memcpy(__get_dynamic_array(buf0), buf0, buf0_len);
1027 - memcpy(__get_dynamic_array(buf1), buf1, buf0_len);
1028 + memcpy(__get_dynamic_array(buf1), buf1, buf1_len);
1029 ),
1030 TP_printk("[%p] TX %.2x (%zu bytes)",
1031 __entry->priv,
1032 diff --git a/drivers/net/xen-netfront.c b/drivers/net/xen-netfront.c
1033 index d504e2b..b50fedc 100644
1034 --- a/drivers/net/xen-netfront.c
1035 +++ b/drivers/net/xen-netfront.c
1036 @@ -1621,6 +1621,7 @@ static void backend_changed(struct xenbus_device *dev,
1037 if (xennet_connect(netdev) != 0)
1038 break;
1039 xenbus_switch_state(dev, XenbusStateConnected);
1040 + netif_notify_peers(netdev);
1041 break;
1042
1043 case XenbusStateClosing:
1044 diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
1045 index 2f2d0ec..c582935 100644
1046 --- a/drivers/pci/quirks.c
1047 +++ b/drivers/pci/quirks.c
1048 @@ -2115,6 +2115,7 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disabl
1049 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3336, quirk_disable_all_msi);
1050 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi);
1051 DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3364, quirk_disable_all_msi);
1052 +DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_8380_0, quirk_disable_all_msi);
1053
1054 /* Disable MSI on chipsets that are known to not support it */
1055 static void __devinit quirk_disable_msi(struct pci_dev *dev)
1056 @@ -2390,6 +2391,9 @@ static void __devinit __nv_msi_ht_cap_quirk(struct pci_dev *dev, int all)
1057 int pos;
1058 int found;
1059
1060 + if (!pci_msi_enabled())
1061 + return;
1062 +
1063 /* check if there is HT MSI cap or enabled on this device */
1064 found = ht_check_msi_mapping(dev);
1065
1066 diff --git a/drivers/scsi/ibmvscsi/ibmvfc.c b/drivers/scsi/ibmvscsi/ibmvfc.c
1067 index c2eea71..d18f45c 100644
1068 --- a/drivers/scsi/ibmvscsi/ibmvfc.c
1069 +++ b/drivers/scsi/ibmvscsi/ibmvfc.c
1070 @@ -2245,7 +2245,7 @@ static int ibmvfc_wait_for_ops(struct ibmvfc_host *vhost, void *device,
1071 DECLARE_COMPLETION_ONSTACK(comp);
1072 int wait;
1073 unsigned long flags;
1074 - signed long timeout = init_timeout * HZ;
1075 + signed long timeout = IBMVFC_ABORT_WAIT_TIMEOUT * HZ;
1076
1077 ENTER;
1078 do {
1079 @@ -3013,6 +3013,7 @@ static struct ibmvfc_async_crq *ibmvfc_next_async_crq(struct ibmvfc_host *vhost)
1080 if (crq->valid & 0x80) {
1081 if (++async_crq->cur == async_crq->size)
1082 async_crq->cur = 0;
1083 + rmb();
1084 } else
1085 crq = NULL;
1086
1087 @@ -3035,6 +3036,7 @@ static struct ibmvfc_crq *ibmvfc_next_crq(struct ibmvfc_host *vhost)
1088 if (crq->valid & 0x80) {
1089 if (++queue->cur == queue->size)
1090 queue->cur = 0;
1091 + rmb();
1092 } else
1093 crq = NULL;
1094
1095 @@ -3083,12 +3085,14 @@ static void ibmvfc_tasklet(void *data)
1096 while ((async = ibmvfc_next_async_crq(vhost)) != NULL) {
1097 ibmvfc_handle_async(async, vhost);
1098 async->valid = 0;
1099 + wmb();
1100 }
1101
1102 /* Pull all the valid messages off the CRQ */
1103 while ((crq = ibmvfc_next_crq(vhost)) != NULL) {
1104 ibmvfc_handle_crq(crq, vhost);
1105 crq->valid = 0;
1106 + wmb();
1107 }
1108
1109 vio_enable_interrupts(vdev);
1110 @@ -3096,10 +3100,12 @@ static void ibmvfc_tasklet(void *data)
1111 vio_disable_interrupts(vdev);
1112 ibmvfc_handle_async(async, vhost);
1113 async->valid = 0;
1114 + wmb();
1115 } else if ((crq = ibmvfc_next_crq(vhost)) != NULL) {
1116 vio_disable_interrupts(vdev);
1117 ibmvfc_handle_crq(crq, vhost);
1118 crq->valid = 0;
1119 + wmb();
1120 } else
1121 done = 1;
1122 }
1123 diff --git a/drivers/scsi/ibmvscsi/ibmvfc.h b/drivers/scsi/ibmvscsi/ibmvfc.h
1124 index d25106a..7e97427 100644
1125 --- a/drivers/scsi/ibmvscsi/ibmvfc.h
1126 +++ b/drivers/scsi/ibmvscsi/ibmvfc.h
1127 @@ -38,6 +38,7 @@
1128 #define IBMVFC_ADISC_PLUS_CANCEL_TIMEOUT \
1129 (IBMVFC_ADISC_TIMEOUT + IBMVFC_ADISC_CANCEL_TIMEOUT)
1130 #define IBMVFC_INIT_TIMEOUT 120
1131 +#define IBMVFC_ABORT_WAIT_TIMEOUT 40
1132 #define IBMVFC_MAX_REQUESTS_DEFAULT 100
1133
1134 #define IBMVFC_DEBUG 0
1135 diff --git a/drivers/staging/line6/Kconfig b/drivers/staging/line6/Kconfig
1136 index 7852d4a..bc1ffbe 100644
1137 --- a/drivers/staging/line6/Kconfig
1138 +++ b/drivers/staging/line6/Kconfig
1139 @@ -2,6 +2,7 @@ config LINE6_USB
1140 tristate "Line6 USB support"
1141 depends on USB && SND
1142 select SND_RAWMIDI
1143 + select SND_PCM
1144 help
1145 This is a driver for the guitar amp, cab, and effects modeller
1146 PODxt Pro by Line6 (and similar devices), supporting the
1147 diff --git a/drivers/staging/panel/panel.c b/drivers/staging/panel/panel.c
1148 index 377884f..d1ed0eb 100644
1149 --- a/drivers/staging/panel/panel.c
1150 +++ b/drivers/staging/panel/panel.c
1151 @@ -2180,6 +2180,7 @@ int panel_init(void)
1152 if (pprt) {
1153 parport_release(pprt);
1154 parport_unregister_device(pprt);
1155 + pprt = NULL;
1156 }
1157 parport_unregister_driver(&panel_driver);
1158 printk(KERN_ERR "Panel driver version " PANEL_VERSION
1159 @@ -2229,6 +2230,7 @@ static void __exit panel_cleanup_module(void)
1160 /* TODO: free all input signals */
1161 parport_release(pprt);
1162 parport_unregister_device(pprt);
1163 + pprt = NULL;
1164 }
1165 parport_unregister_driver(&panel_driver);
1166 }
1167 diff --git a/drivers/staging/rt2860/usb_main_dev.c b/drivers/staging/rt2860/usb_main_dev.c
1168 index 2ffd0fe..99ef97a 100644
1169 --- a/drivers/staging/rt2860/usb_main_dev.c
1170 +++ b/drivers/staging/rt2860/usb_main_dev.c
1171 @@ -64,6 +64,7 @@ struct usb_device_id rtusb_usb_id[] = {
1172 {USB_DEVICE(0x14B2, 0x3C07)}, /* AL */
1173 {USB_DEVICE(0x050D, 0x8053)}, /* Belkin */
1174 {USB_DEVICE(0x050D, 0x825B)}, /* Belkin */
1175 + {USB_DEVICE(0x050D, 0x935B)}, /* Belkin F6D4050 v2 */
1176 {USB_DEVICE(0x14B2, 0x3C23)}, /* Airlink */
1177 {USB_DEVICE(0x14B2, 0x3C27)}, /* Airlink */
1178 {USB_DEVICE(0x07AA, 0x002F)}, /* Corega */
1179 diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
1180 index 3e28f92..91ddeba 100644
1181 --- a/drivers/usb/core/hub.c
1182 +++ b/drivers/usb/core/hub.c
1183 @@ -23,6 +23,7 @@
1184 #include <linux/mutex.h>
1185 #include <linux/freezer.h>
1186 #include <linux/pm_runtime.h>
1187 +#include <linux/usb/quirks.h>
1188
1189 #include <asm/uaccess.h>
1190 #include <asm/byteorder.h>
1191 @@ -1790,7 +1791,6 @@ int usb_new_device(struct usb_device *udev)
1192 pm_runtime_set_active(&udev->dev);
1193 pm_runtime_enable(&udev->dev);
1194
1195 - usb_detect_quirks(udev);
1196 err = usb_enumerate_device(udev); /* Read descriptors */
1197 if (err < 0)
1198 goto fail;
1199 @@ -3100,6 +3100,10 @@ static void hub_port_connect_change(struct usb_hub *hub, int port1,
1200 if (status < 0)
1201 goto loop;
1202
1203 + usb_detect_quirks(udev);
1204 + if (udev->quirks & USB_QUIRK_DELAY_INIT)
1205 + msleep(1000);
1206 +
1207 /* consecutive bus-powered hubs aren't reliable; they can
1208 * violate the voltage drop budget. if the new child has
1209 * a "powered" LED, users should notice we didn't enable it
1210 diff --git a/drivers/usb/core/quirks.c b/drivers/usb/core/quirks.c
1211 index df5dda7..efa3482 100644
1212 --- a/drivers/usb/core/quirks.c
1213 +++ b/drivers/usb/core/quirks.c
1214 @@ -38,6 +38,9 @@ static const struct usb_device_id usb_quirk_list[] = {
1215 /* Creative SB Audigy 2 NX */
1216 { USB_DEVICE(0x041e, 0x3020), .driver_info = USB_QUIRK_RESET_RESUME },
1217
1218 + /* Logitech Harmony 700-series */
1219 + { USB_DEVICE(0x046d, 0xc122), .driver_info = USB_QUIRK_DELAY_INIT },
1220 +
1221 /* Philips PSC805 audio device */
1222 { USB_DEVICE(0x0471, 0x0155), .driver_info = USB_QUIRK_RESET_RESUME },
1223
1224 diff --git a/drivers/usb/core/urb.c b/drivers/usb/core/urb.c
1225 index fec46d0..0a4c28b 100644
1226 --- a/drivers/usb/core/urb.c
1227 +++ b/drivers/usb/core/urb.c
1228 @@ -137,6 +137,16 @@ void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor)
1229 }
1230 EXPORT_SYMBOL_GPL(usb_anchor_urb);
1231
1232 +/* Callers must hold anchor->lock */
1233 +static void __usb_unanchor_urb(struct urb *urb, struct usb_anchor *anchor)
1234 +{
1235 + urb->anchor = NULL;
1236 + list_del(&urb->anchor_list);
1237 + usb_put_urb(urb);
1238 + if (list_empty(&anchor->urb_list))
1239 + wake_up(&anchor->wait);
1240 +}
1241 +
1242 /**
1243 * usb_unanchor_urb - unanchors an URB
1244 * @urb: pointer to the urb to anchor
1245 @@ -156,17 +166,14 @@ void usb_unanchor_urb(struct urb *urb)
1246 return;
1247
1248 spin_lock_irqsave(&anchor->lock, flags);
1249 - if (unlikely(anchor != urb->anchor)) {
1250 - /* we've lost the race to another thread */
1251 - spin_unlock_irqrestore(&anchor->lock, flags);
1252 - return;
1253 - }
1254 - urb->anchor = NULL;
1255 - list_del(&urb->anchor_list);
1256 + /*
1257 + * At this point, we could be competing with another thread which
1258 + * has the same intention. To protect the urb from being unanchored
1259 + * twice, only the winner of the race gets the job.
1260 + */
1261 + if (likely(anchor == urb->anchor))
1262 + __usb_unanchor_urb(urb, anchor);
1263 spin_unlock_irqrestore(&anchor->lock, flags);
1264 - usb_put_urb(urb);
1265 - if (list_empty(&anchor->urb_list))
1266 - wake_up(&anchor->wait);
1267 }
1268 EXPORT_SYMBOL_GPL(usb_unanchor_urb);
1269
1270 @@ -750,20 +757,11 @@ EXPORT_SYMBOL_GPL(usb_unpoison_anchored_urbs);
1271 void usb_unlink_anchored_urbs(struct usb_anchor *anchor)
1272 {
1273 struct urb *victim;
1274 - unsigned long flags;
1275
1276 - spin_lock_irqsave(&anchor->lock, flags);
1277 - while (!list_empty(&anchor->urb_list)) {
1278 - victim = list_entry(anchor->urb_list.prev, struct urb,
1279 - anchor_list);
1280 - usb_get_urb(victim);
1281 - spin_unlock_irqrestore(&anchor->lock, flags);
1282 - /* this will unanchor the URB */
1283 + while ((victim = usb_get_from_anchor(anchor)) != NULL) {
1284 usb_unlink_urb(victim);
1285 usb_put_urb(victim);
1286 - spin_lock_irqsave(&anchor->lock, flags);
1287 }
1288 - spin_unlock_irqrestore(&anchor->lock, flags);
1289 }
1290 EXPORT_SYMBOL_GPL(usb_unlink_anchored_urbs);
1291
1292 @@ -800,12 +798,11 @@ struct urb *usb_get_from_anchor(struct usb_anchor *anchor)
1293 victim = list_entry(anchor->urb_list.next, struct urb,
1294 anchor_list);
1295 usb_get_urb(victim);
1296 - spin_unlock_irqrestore(&anchor->lock, flags);
1297 - usb_unanchor_urb(victim);
1298 + __usb_unanchor_urb(victim, anchor);
1299 } else {
1300 - spin_unlock_irqrestore(&anchor->lock, flags);
1301 victim = NULL;
1302 }
1303 + spin_unlock_irqrestore(&anchor->lock, flags);
1304
1305 return victim;
1306 }
1307 @@ -827,12 +824,7 @@ void usb_scuttle_anchored_urbs(struct usb_anchor *anchor)
1308 while (!list_empty(&anchor->urb_list)) {
1309 victim = list_entry(anchor->urb_list.prev, struct urb,
1310 anchor_list);
1311 - usb_get_urb(victim);
1312 - spin_unlock_irqrestore(&anchor->lock, flags);
1313 - /* this may free the URB */
1314 - usb_unanchor_urb(victim);
1315 - usb_put_urb(victim);
1316 - spin_lock_irqsave(&anchor->lock, flags);
1317 + __usb_unanchor_urb(victim, anchor);
1318 }
1319 spin_unlock_irqrestore(&anchor->lock, flags);
1320 }
1321 diff --git a/drivers/usb/host/ehci-pci.c b/drivers/usb/host/ehci-pci.c
1322 index c5f662d..e4ad275 100644
1323 --- a/drivers/usb/host/ehci-pci.c
1324 +++ b/drivers/usb/host/ehci-pci.c
1325 @@ -111,6 +111,7 @@ static int ehci_pci_setup(struct usb_hcd *hcd)
1326 switch (pdev->vendor) {
1327 case PCI_VENDOR_ID_INTEL:
1328 ehci->need_io_watchdog = 0;
1329 + ehci->fs_i_thresh = 1;
1330 if (pdev->device == 0x27cc) {
1331 ehci->broken_periodic = 1;
1332 ehci_info(ehci, "using broken periodic workaround\n");
1333 diff --git a/drivers/usb/host/ehci-sched.c b/drivers/usb/host/ehci-sched.c
1334 index 805ec63..93f58e5 100644
1335 --- a/drivers/usb/host/ehci-sched.c
1336 +++ b/drivers/usb/host/ehci-sched.c
1337 @@ -1400,7 +1400,6 @@ iso_stream_schedule (
1338 int status;
1339 unsigned mod = ehci->periodic_size << 3;
1340 struct ehci_iso_sched *sched = urb->hcpriv;
1341 - struct pci_dev *pdev;
1342
1343 if (sched->span > (mod - SCHEDULE_SLOP)) {
1344 ehci_dbg (ehci, "iso request %p too long\n", urb);
1345 @@ -1427,15 +1426,14 @@ iso_stream_schedule (
1346 * slot in the schedule, implicitly assuming URB_ISO_ASAP.
1347 */
1348 if (likely (!list_empty (&stream->td_list))) {
1349 - pdev = to_pci_dev(ehci_to_hcd(ehci)->self.controller);
1350 start = stream->next_uframe;
1351
1352 /* For high speed devices, allow scheduling within the
1353 - * isochronous scheduling threshold. For full speed devices,
1354 - * don't. (Work around for Intel ICH9 bug.)
1355 + * isochronous scheduling threshold. For full speed devices
1356 + * and Intel PCI-based controllers, don't (work around for
1357 + * Intel ICH9 bug).
1358 */
1359 - if (!stream->highspeed &&
1360 - pdev->vendor == PCI_VENDOR_ID_INTEL)
1361 + if (!stream->highspeed && ehci->fs_i_thresh)
1362 next = now + ehci->i_thresh;
1363 else
1364 next = now;
1365 diff --git a/drivers/usb/host/ehci.h b/drivers/usb/host/ehci.h
1366 index ddf61c3..3c7cf87 100644
1367 --- a/drivers/usb/host/ehci.h
1368 +++ b/drivers/usb/host/ehci.h
1369 @@ -130,6 +130,7 @@ struct ehci_hcd { /* one per controller */
1370 unsigned has_amcc_usb23:1;
1371 unsigned need_io_watchdog:1;
1372 unsigned broken_periodic:1;
1373 + unsigned fs_i_thresh:1; /* Intel iso scheduling */
1374
1375 /* required for usb32 quirk */
1376 #define OHCI_CTRL_HCFS (3 << 6)
1377 diff --git a/drivers/usb/misc/usbtest.c b/drivers/usb/misc/usbtest.c
1378 index a21cce6..55f654f 100644
1379 --- a/drivers/usb/misc/usbtest.c
1380 +++ b/drivers/usb/misc/usbtest.c
1381 @@ -1383,7 +1383,6 @@ static void iso_callback (struct urb *urb)
1382 break;
1383 }
1384 }
1385 - simple_free_urb (urb);
1386
1387 ctx->pending--;
1388 if (ctx->pending == 0) {
1389 @@ -1500,6 +1499,7 @@ test_iso_queue (struct usbtest_dev *dev, struct usbtest_param *param,
1390 }
1391
1392 simple_free_urb (urbs [i]);
1393 + urbs[i] = NULL;
1394 context.pending--;
1395 context.submit_error = 1;
1396 break;
1397 @@ -1509,6 +1509,10 @@ test_iso_queue (struct usbtest_dev *dev, struct usbtest_param *param,
1398
1399 wait_for_completion (&context.done);
1400
1401 + for (i = 0; i < param->sglen; i++) {
1402 + if (urbs[i])
1403 + simple_free_urb(urbs[i]);
1404 + }
1405 /*
1406 * Isochronous transfers are expected to fail sometimes. As an
1407 * arbitrary limit, we will report an error if any submissions
1408 diff --git a/drivers/usb/mon/mon_bin.c b/drivers/usb/mon/mon_bin.c
1409 index 8a7968d..6ee9d76 100644
1410 --- a/drivers/usb/mon/mon_bin.c
1411 +++ b/drivers/usb/mon/mon_bin.c
1412 @@ -1010,7 +1010,7 @@ static int mon_bin_ioctl(struct inode *inode, struct file *file,
1413
1414 mutex_lock(&rp->fetch_lock);
1415 spin_lock_irqsave(&rp->b_lock, flags);
1416 - mon_free_buff(rp->b_vec, size/CHUNK_SIZE);
1417 + mon_free_buff(rp->b_vec, rp->b_size/CHUNK_SIZE);
1418 kfree(rp->b_vec);
1419 rp->b_vec = vec;
1420 rp->b_size = size;
1421 diff --git a/drivers/usb/serial/cp210x.c b/drivers/usb/serial/cp210x.c
1422 index 009e26c..2128d2c 100644
1423 --- a/drivers/usb/serial/cp210x.c
1424 +++ b/drivers/usb/serial/cp210x.c
1425 @@ -128,6 +128,10 @@ static const struct usb_device_id id_table[] = {
1426 { USB_DEVICE(0x1843, 0x0200) }, /* Vaisala USB Instrument Cable */
1427 { USB_DEVICE(0x18EF, 0xE00F) }, /* ELV USB-I2C-Interface */
1428 { USB_DEVICE(0x413C, 0x9500) }, /* DW700 GPS USB interface */
1429 + { USB_DEVICE(0x16DC, 0x0010) }, /* W-IE-NE-R Plein & Baus GmbH PL512 Power Supply */
1430 + { USB_DEVICE(0x16DC, 0x0011) }, /* W-IE-NE-R Plein & Baus GmbH RCM Remote Control for MARATON Power Supply */
1431 + { USB_DEVICE(0x16DC, 0x0012) }, /* W-IE-NE-R Plein & Baus GmbH MPOD Multi Channel Power Supply */
1432 + { USB_DEVICE(0x16DC, 0x0015) }, /* W-IE-NE-R Plein & Baus GmbH CML Control, Monitoring and Data Logger */
1433 { } /* Terminating Entry */
1434 };
1435
1436 diff --git a/drivers/usb/serial/ftdi_sio.c b/drivers/usb/serial/ftdi_sio.c
1437 index 239d327..738383a 100644
1438 --- a/drivers/usb/serial/ftdi_sio.c
1439 +++ b/drivers/usb/serial/ftdi_sio.c
1440 @@ -162,6 +162,9 @@ static struct usb_device_id id_table_combined [] = {
1441 { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_5_PID) },
1442 { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_6_PID) },
1443 { USB_DEVICE(FTDI_VID, FTDI_SCS_DEVICE_7_PID) },
1444 + { USB_DEVICE(FTDI_VID, FTDI_USINT_CAT_PID) },
1445 + { USB_DEVICE(FTDI_VID, FTDI_USINT_WKEY_PID) },
1446 + { USB_DEVICE(FTDI_VID, FTDI_USINT_RS232_PID) },
1447 { USB_DEVICE(FTDI_VID, FTDI_ACTZWAVE_PID) },
1448 { USB_DEVICE(FTDI_VID, FTDI_IRTRANS_PID) },
1449 { USB_DEVICE(FTDI_VID, FTDI_IPLUS_PID) },
1450 @@ -752,6 +755,7 @@ static struct usb_device_id id_table_combined [] = {
1451 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1452 { USB_DEVICE(FTDI_VID, XVERVE_SIGNALYZER_SH4_PID),
1453 .driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
1454 + { USB_DEVICE(FTDI_VID, SEGWAY_RMP200_PID) },
1455 { }, /* Optional parameter entry */
1456 { } /* Terminating entry */
1457 };
1458 diff --git a/drivers/usb/serial/ftdi_sio_ids.h b/drivers/usb/serial/ftdi_sio_ids.h
1459 index 9a9355c..c101821 100644
1460 --- a/drivers/usb/serial/ftdi_sio_ids.h
1461 +++ b/drivers/usb/serial/ftdi_sio_ids.h
1462 @@ -40,6 +40,11 @@
1463
1464 #define FTDI_NXTCAM_PID 0xABB8 /* NXTCam for Mindstorms NXT */
1465
1466 +/* US Interface Navigator (http://www.usinterface.com/) */
1467 +#define FTDI_USINT_CAT_PID 0xb810 /* Navigator CAT and 2nd PTT lines */
1468 +#define FTDI_USINT_WKEY_PID 0xb811 /* Navigator WKEY and FSK lines */
1469 +#define FTDI_USINT_RS232_PID 0xb812 /* Navigator RS232 and CONFIG lines */
1470 +
1471 /* OOCDlink by Joern Kaipf <joernk@web.de>
1472 * (http://www.joernonline.de/dw/doku.php?id=start&idx=projects:oocdlink) */
1473 #define FTDI_OOCDLINK_PID 0xbaf8 /* Amontec JTAGkey */
1474 @@ -1039,3 +1044,8 @@
1475 #define XVERVE_SIGNALYZER_SH2_PID 0xBCA2
1476 #define XVERVE_SIGNALYZER_SH4_PID 0xBCA4
1477
1478 +/*
1479 + * Segway Robotic Mobility Platform USB interface (using VID 0x0403)
1480 + * Submitted by John G. Rogers
1481 + */
1482 +#define SEGWAY_RMP200_PID 0xe729
1483 diff --git a/drivers/usb/serial/option.c b/drivers/usb/serial/option.c
1484 index ee6ecf3..20d1585 100644
1485 --- a/drivers/usb/serial/option.c
1486 +++ b/drivers/usb/serial/option.c
1487 @@ -166,7 +166,10 @@ static int option_resume(struct usb_serial *serial);
1488 #define HUAWEI_PRODUCT_E143D 0x143D
1489 #define HUAWEI_PRODUCT_E143E 0x143E
1490 #define HUAWEI_PRODUCT_E143F 0x143F
1491 +#define HUAWEI_PRODUCT_K4505 0x1464
1492 +#define HUAWEI_PRODUCT_K3765 0x1465
1493 #define HUAWEI_PRODUCT_E14AC 0x14AC
1494 +#define HUAWEI_PRODUCT_ETS1220 0x1803
1495
1496 #define QUANTA_VENDOR_ID 0x0408
1497 #define QUANTA_PRODUCT_Q101 0xEA02
1498 @@ -503,6 +506,9 @@ static const struct usb_device_id option_ids[] = {
1499 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143D, 0xff, 0xff, 0xff) },
1500 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143E, 0xff, 0xff, 0xff) },
1501 { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E143F, 0xff, 0xff, 0xff) },
1502 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4505, 0xff, 0xff, 0xff) },
1503 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K3765, 0xff, 0xff, 0xff) },
1504 + { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_ETS1220, 0xff, 0xff, 0xff) },
1505 { USB_DEVICE(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E14AC) },
1506 { USB_DEVICE(AMOI_VENDOR_ID, AMOI_PRODUCT_9508) },
1507 { USB_DEVICE(NOVATELWIRELESS_VENDOR_ID, NOVATELWIRELESS_PRODUCT_V640) }, /* Novatel Merlin V640/XV620 */
1508 @@ -1046,6 +1052,13 @@ static int option_probe(struct usb_serial *serial,
1509 serial->interface->cur_altsetting->desc.bInterfaceClass != 0xff)
1510 return -ENODEV;
1511
1512 + /* Don't bind network interfaces on Huawei K3765 & K4505 */
1513 + if (serial->dev->descriptor.idVendor == HUAWEI_VENDOR_ID &&
1514 + (serial->dev->descriptor.idProduct == HUAWEI_PRODUCT_K3765 ||
1515 + serial->dev->descriptor.idProduct == HUAWEI_PRODUCT_K4505) &&
1516 + serial->interface->cur_altsetting->desc.bInterfaceNumber == 1)
1517 + return -ENODEV;
1518 +
1519 data = serial->private = kzalloc(sizeof(struct option_intf_private), GFP_KERNEL);
1520 if (!data)
1521 return -ENOMEM;
1522 diff --git a/drivers/video/w100fb.c b/drivers/video/w100fb.c
1523 index e66b8b1..d8b12c3 100644
1524 --- a/drivers/video/w100fb.c
1525 +++ b/drivers/video/w100fb.c
1526 @@ -858,9 +858,9 @@ unsigned long w100fb_gpio_read(int port)
1527 void w100fb_gpio_write(int port, unsigned long value)
1528 {
1529 if (port==W100_GPIO_PORT_A)
1530 - value = writel(value, remapped_regs + mmGPIO_DATA);
1531 + writel(value, remapped_regs + mmGPIO_DATA);
1532 else
1533 - value = writel(value, remapped_regs + mmGPIO_DATA2);
1534 + writel(value, remapped_regs + mmGPIO_DATA2);
1535 }
1536 EXPORT_SYMBOL(w100fb_gpio_read);
1537 EXPORT_SYMBOL(w100fb_gpio_write);
1538 diff --git a/drivers/xen/events.c b/drivers/xen/events.c
1539 index db8f506..28f133a 100644
1540 --- a/drivers/xen/events.c
1541 +++ b/drivers/xen/events.c
1542 @@ -536,6 +536,7 @@ int bind_ipi_to_irqhandler(enum ipi_vector ipi,
1543 if (irq < 0)
1544 return irq;
1545
1546 + irqflags |= IRQF_NO_SUSPEND;
1547 retval = request_irq(irq, handler, irqflags, devname, dev_id);
1548 if (retval != 0) {
1549 unbind_from_irq(irq);
1550 diff --git a/fs/block_dev.c b/fs/block_dev.c
1551 index 6dcee88..d4d19ac 100644
1552 --- a/fs/block_dev.c
1553 +++ b/fs/block_dev.c
1554 @@ -1192,10 +1192,12 @@ static int __blkdev_get(struct block_device *bdev, fmode_t mode, int for_part)
1555 /*
1556 * hooks: /n/, see "layering violations".
1557 */
1558 - ret = devcgroup_inode_permission(bdev->bd_inode, perm);
1559 - if (ret != 0) {
1560 - bdput(bdev);
1561 - return ret;
1562 + if (!for_part) {
1563 + ret = devcgroup_inode_permission(bdev->bd_inode, perm);
1564 + if (ret != 0) {
1565 + bdput(bdev);
1566 + return ret;
1567 + }
1568 }
1569
1570 lock_kernel();
1571 diff --git a/fs/ecryptfs/file.c b/fs/ecryptfs/file.c
1572 index e7440a6..053105d 100644
1573 --- a/fs/ecryptfs/file.c
1574 +++ b/fs/ecryptfs/file.c
1575 @@ -199,7 +199,7 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
1576 "the persistent file for the dentry with name "
1577 "[%s]; rc = [%d]\n", __func__,
1578 ecryptfs_dentry->d_name.name, rc);
1579 - goto out;
1580 + goto out_free;
1581 }
1582 }
1583 if ((ecryptfs_inode_to_private(inode)->lower_file->f_flags & O_RDONLY)
1584 @@ -207,7 +207,7 @@ static int ecryptfs_open(struct inode *inode, struct file *file)
1585 rc = -EPERM;
1586 printk(KERN_WARNING "%s: Lower persistent file is RO; eCryptfs "
1587 "file must hence be opened RO\n", __func__);
1588 - goto out;
1589 + goto out_free;
1590 }
1591 ecryptfs_set_file_lower(
1592 file, ecryptfs_inode_to_private(inode)->lower_file);
1593 @@ -294,12 +294,40 @@ static int ecryptfs_fasync(int fd, struct file *file, int flag)
1594 return rc;
1595 }
1596
1597 -static int ecryptfs_ioctl(struct inode *inode, struct file *file,
1598 - unsigned int cmd, unsigned long arg);
1599 +static long
1600 +ecryptfs_unlocked_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1601 +{
1602 + struct file *lower_file = NULL;
1603 + long rc = -ENOTTY;
1604 +
1605 + if (ecryptfs_file_to_private(file))
1606 + lower_file = ecryptfs_file_to_lower(file);
1607 + if (lower_file && lower_file->f_op && lower_file->f_op->unlocked_ioctl)
1608 + rc = lower_file->f_op->unlocked_ioctl(lower_file, cmd, arg);
1609 + return rc;
1610 +}
1611 +
1612 +#ifdef CONFIG_COMPAT
1613 +static long
1614 +ecryptfs_compat_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
1615 +{
1616 + struct file *lower_file = NULL;
1617 + long rc = -ENOIOCTLCMD;
1618 +
1619 + if (ecryptfs_file_to_private(file))
1620 + lower_file = ecryptfs_file_to_lower(file);
1621 + if (lower_file && lower_file->f_op && lower_file->f_op->compat_ioctl)
1622 + rc = lower_file->f_op->compat_ioctl(lower_file, cmd, arg);
1623 + return rc;
1624 +}
1625 +#endif
1626
1627 const struct file_operations ecryptfs_dir_fops = {
1628 .readdir = ecryptfs_readdir,
1629 - .ioctl = ecryptfs_ioctl,
1630 + .unlocked_ioctl = ecryptfs_unlocked_ioctl,
1631 +#ifdef CONFIG_COMPAT
1632 + .compat_ioctl = ecryptfs_compat_ioctl,
1633 +#endif
1634 .open = ecryptfs_open,
1635 .flush = ecryptfs_flush,
1636 .release = ecryptfs_release,
1637 @@ -315,7 +343,10 @@ const struct file_operations ecryptfs_main_fops = {
1638 .write = do_sync_write,
1639 .aio_write = generic_file_aio_write,
1640 .readdir = ecryptfs_readdir,
1641 - .ioctl = ecryptfs_ioctl,
1642 + .unlocked_ioctl = ecryptfs_unlocked_ioctl,
1643 +#ifdef CONFIG_COMPAT
1644 + .compat_ioctl = ecryptfs_compat_ioctl,
1645 +#endif
1646 .mmap = generic_file_mmap,
1647 .open = ecryptfs_open,
1648 .flush = ecryptfs_flush,
1649 @@ -324,20 +355,3 @@ const struct file_operations ecryptfs_main_fops = {
1650 .fasync = ecryptfs_fasync,
1651 .splice_read = generic_file_splice_read,
1652 };
1653 -
1654 -static int
1655 -ecryptfs_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
1656 - unsigned long arg)
1657 -{
1658 - int rc = 0;
1659 - struct file *lower_file = NULL;
1660 -
1661 - if (ecryptfs_file_to_private(file))
1662 - lower_file = ecryptfs_file_to_lower(file);
1663 - if (lower_file && lower_file->f_op && lower_file->f_op->ioctl)
1664 - rc = lower_file->f_op->ioctl(ecryptfs_inode_to_lower(inode),
1665 - lower_file, cmd, arg);
1666 - else
1667 - rc = -ENOTTY;
1668 - return rc;
1669 -}
1670 diff --git a/fs/ecryptfs/inode.c b/fs/ecryptfs/inode.c
1671 index e2d4418..21801ee 100644
1672 --- a/fs/ecryptfs/inode.c
1673 +++ b/fs/ecryptfs/inode.c
1674 @@ -273,7 +273,7 @@ int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry,
1675 printk(KERN_ERR "%s: Out of memory whilst attempting "
1676 "to allocate ecryptfs_dentry_info struct\n",
1677 __func__);
1678 - goto out_dput;
1679 + goto out_put;
1680 }
1681 ecryptfs_set_dentry_lower(ecryptfs_dentry, lower_dentry);
1682 ecryptfs_set_dentry_lower_mnt(ecryptfs_dentry, lower_mnt);
1683 @@ -348,8 +348,9 @@ int ecryptfs_lookup_and_interpose_lower(struct dentry *ecryptfs_dentry,
1684 out_free_kmem:
1685 kmem_cache_free(ecryptfs_header_cache_2, page_virt);
1686 goto out;
1687 -out_dput:
1688 +out_put:
1689 dput(lower_dentry);
1690 + mntput(lower_mnt);
1691 d_drop(ecryptfs_dentry);
1692 out:
1693 return rc;
1694 diff --git a/fs/jfs/xattr.c b/fs/jfs/xattr.c
1695 index fa96bbb..2d7f165 100644
1696 --- a/fs/jfs/xattr.c
1697 +++ b/fs/jfs/xattr.c
1698 @@ -86,46 +86,25 @@ struct ea_buffer {
1699 #define EA_MALLOC 0x0008
1700
1701
1702 +static int is_known_namespace(const char *name)
1703 +{
1704 + if (strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN) &&
1705 + strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) &&
1706 + strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) &&
1707 + strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN))
1708 + return false;
1709 +
1710 + return true;
1711 +}
1712 +
1713 /*
1714 * These three routines are used to recognize on-disk extended attributes
1715 * that are in a recognized namespace. If the attribute is not recognized,
1716 * "os2." is prepended to the name
1717 */
1718 -static inline int is_os2_xattr(struct jfs_ea *ea)
1719 +static int is_os2_xattr(struct jfs_ea *ea)
1720 {
1721 - /*
1722 - * Check for "system."
1723 - */
1724 - if ((ea->namelen >= XATTR_SYSTEM_PREFIX_LEN) &&
1725 - !strncmp(ea->name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
1726 - return false;
1727 - /*
1728 - * Check for "user."
1729 - */
1730 - if ((ea->namelen >= XATTR_USER_PREFIX_LEN) &&
1731 - !strncmp(ea->name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN))
1732 - return false;
1733 - /*
1734 - * Check for "security."
1735 - */
1736 - if ((ea->namelen >= XATTR_SECURITY_PREFIX_LEN) &&
1737 - !strncmp(ea->name, XATTR_SECURITY_PREFIX,
1738 - XATTR_SECURITY_PREFIX_LEN))
1739 - return false;
1740 - /*
1741 - * Check for "trusted."
1742 - */
1743 - if ((ea->namelen >= XATTR_TRUSTED_PREFIX_LEN) &&
1744 - !strncmp(ea->name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN))
1745 - return false;
1746 - /*
1747 - * Add any other valid namespace prefixes here
1748 - */
1749 -
1750 - /*
1751 - * We assume it's OS/2's flat namespace
1752 - */
1753 - return true;
1754 + return !is_known_namespace(ea->name);
1755 }
1756
1757 static inline int name_size(struct jfs_ea *ea)
1758 @@ -764,13 +743,23 @@ static int can_set_xattr(struct inode *inode, const char *name,
1759 if (!strncmp(name, XATTR_SYSTEM_PREFIX, XATTR_SYSTEM_PREFIX_LEN))
1760 return can_set_system_xattr(inode, name, value, value_len);
1761
1762 + if (!strncmp(name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN)) {
1763 + /*
1764 + * This makes sure that we aren't trying to set an
1765 + * attribute in a different namespace by prefixing it
1766 + * with "os2."
1767 + */
1768 + if (is_known_namespace(name + XATTR_OS2_PREFIX_LEN))
1769 + return -EOPNOTSUPP;
1770 + return 0;
1771 + }
1772 +
1773 /*
1774 * Don't allow setting an attribute in an unknown namespace.
1775 */
1776 if (strncmp(name, XATTR_TRUSTED_PREFIX, XATTR_TRUSTED_PREFIX_LEN) &&
1777 strncmp(name, XATTR_SECURITY_PREFIX, XATTR_SECURITY_PREFIX_LEN) &&
1778 - strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN) &&
1779 - strncmp(name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN))
1780 + strncmp(name, XATTR_USER_PREFIX, XATTR_USER_PREFIX_LEN))
1781 return -EOPNOTSUPP;
1782
1783 return 0;
1784 @@ -952,19 +941,8 @@ ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data,
1785 int xattr_size;
1786 ssize_t size;
1787 int namelen = strlen(name);
1788 - char *os2name = NULL;
1789 char *value;
1790
1791 - if (strncmp(name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN) == 0) {
1792 - os2name = kmalloc(namelen - XATTR_OS2_PREFIX_LEN + 1,
1793 - GFP_KERNEL);
1794 - if (!os2name)
1795 - return -ENOMEM;
1796 - strcpy(os2name, name + XATTR_OS2_PREFIX_LEN);
1797 - name = os2name;
1798 - namelen -= XATTR_OS2_PREFIX_LEN;
1799 - }
1800 -
1801 down_read(&JFS_IP(inode)->xattr_sem);
1802
1803 xattr_size = ea_get(inode, &ea_buf, 0);
1804 @@ -1002,8 +980,6 @@ ssize_t __jfs_getxattr(struct inode *inode, const char *name, void *data,
1805 out:
1806 up_read(&JFS_IP(inode)->xattr_sem);
1807
1808 - kfree(os2name);
1809 -
1810 return size;
1811 }
1812
1813 @@ -1012,6 +988,19 @@ ssize_t jfs_getxattr(struct dentry *dentry, const char *name, void *data,
1814 {
1815 int err;
1816
1817 + if (strncmp(name, XATTR_OS2_PREFIX, XATTR_OS2_PREFIX_LEN) == 0) {
1818 + /*
1819 + * skip past "os2." prefix
1820 + */
1821 + name += XATTR_OS2_PREFIX_LEN;
1822 + /*
1823 + * Don't allow retrieving properly prefixed attributes
1824 + * by prepending them with "os2."
1825 + */
1826 + if (is_known_namespace(name))
1827 + return -EOPNOTSUPP;
1828 + }
1829 +
1830 err = __jfs_getxattr(dentry->d_inode, name, data, buf_size);
1831
1832 return err;
1833 diff --git a/fs/signalfd.c b/fs/signalfd.c
1834 index f329849c..1c5a6ad 100644
1835 --- a/fs/signalfd.c
1836 +++ b/fs/signalfd.c
1837 @@ -88,6 +88,7 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
1838 err |= __put_user(kinfo->si_tid, &uinfo->ssi_tid);
1839 err |= __put_user(kinfo->si_overrun, &uinfo->ssi_overrun);
1840 err |= __put_user((long) kinfo->si_ptr, &uinfo->ssi_ptr);
1841 + err |= __put_user(kinfo->si_int, &uinfo->ssi_int);
1842 break;
1843 case __SI_POLL:
1844 err |= __put_user(kinfo->si_band, &uinfo->ssi_band);
1845 @@ -111,6 +112,7 @@ static int signalfd_copyinfo(struct signalfd_siginfo __user *uinfo,
1846 err |= __put_user(kinfo->si_pid, &uinfo->ssi_pid);
1847 err |= __put_user(kinfo->si_uid, &uinfo->ssi_uid);
1848 err |= __put_user((long) kinfo->si_ptr, &uinfo->ssi_ptr);
1849 + err |= __put_user(kinfo->si_int, &uinfo->ssi_int);
1850 break;
1851 default:
1852 /*
1853 diff --git a/fs/splice.c b/fs/splice.c
1854 index eb602cb..cc617b0 100644
1855 --- a/fs/splice.c
1856 +++ b/fs/splice.c
1857 @@ -366,17 +366,7 @@ __generic_file_splice_read(struct file *in, loff_t *ppos,
1858 * If the page isn't uptodate, we may need to start io on it
1859 */
1860 if (!PageUptodate(page)) {
1861 - /*
1862 - * If in nonblock mode then dont block on waiting
1863 - * for an in-flight io page
1864 - */
1865 - if (flags & SPLICE_F_NONBLOCK) {
1866 - if (!trylock_page(page)) {
1867 - error = -EAGAIN;
1868 - break;
1869 - }
1870 - } else
1871 - lock_page(page);
1872 + lock_page(page);
1873
1874 /*
1875 * Page was truncated, or invalidated by the
1876 diff --git a/include/linux/fs.h b/include/linux/fs.h
1877 index 801b398..e93529d 100644
1878 --- a/include/linux/fs.h
1879 +++ b/include/linux/fs.h
1880 @@ -145,11 +145,11 @@ struct inodes_stat_t {
1881 *
1882 */
1883 #define RW_MASK 1
1884 -#define RWA_MASK 2
1885 +#define RWA_MASK 16
1886 #define READ 0
1887 #define WRITE 1
1888 -#define READA 2 /* read-ahead - don't block if no resources */
1889 -#define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */
1890 +#define READA 16 /* readahead - don't block if no resources */
1891 +#define SWRITE 17 /* for ll_rw_block(), wait for buffer lock */
1892 #define READ_SYNC (READ | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG))
1893 #define READ_META (READ | (1 << BIO_RW_META))
1894 #define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE))
1895 diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
1896 index 75f3f00..01db7a1 100644
1897 --- a/include/linux/interrupt.h
1898 +++ b/include/linux/interrupt.h
1899 @@ -52,16 +52,21 @@
1900 * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished.
1901 * Used by threaded interrupts which need to keep the
1902 * irq line disabled until the threaded handler has been run.
1903 + * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend
1904 + *
1905 */
1906 #define IRQF_DISABLED 0x00000020
1907 #define IRQF_SAMPLE_RANDOM 0x00000040
1908 #define IRQF_SHARED 0x00000080
1909 #define IRQF_PROBE_SHARED 0x00000100
1910 -#define IRQF_TIMER 0x00000200
1911 +#define __IRQF_TIMER 0x00000200
1912 #define IRQF_PERCPU 0x00000400
1913 #define IRQF_NOBALANCING 0x00000800
1914 #define IRQF_IRQPOLL 0x00001000
1915 #define IRQF_ONESHOT 0x00002000
1916 +#define IRQF_NO_SUSPEND 0x00004000
1917 +
1918 +#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND)
1919
1920 /*
1921 * Bits used by threaded handlers:
1922 diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
1923 index fa8b476..4737996 100644
1924 --- a/include/linux/netdevice.h
1925 +++ b/include/linux/netdevice.h
1926 @@ -1661,6 +1661,8 @@ extern void netif_carrier_on(struct net_device *dev);
1927
1928 extern void netif_carrier_off(struct net_device *dev);
1929
1930 +extern void netif_notify_peers(struct net_device *dev);
1931 +
1932 /**
1933 * netif_dormant_on - mark device as dormant.
1934 * @dev: network device
1935 diff --git a/include/linux/notifier.h b/include/linux/notifier.h
1936 index fee6c2f..a4b7f97 100644
1937 --- a/include/linux/notifier.h
1938 +++ b/include/linux/notifier.h
1939 @@ -203,6 +203,7 @@ static inline int notifier_to_errno(int ret)
1940 #define NETDEV_BONDING_NEWTYPE 0x000F
1941 #define NETDEV_POST_INIT 0x0010
1942 #define NETDEV_UNREGISTER_BATCH 0x0011
1943 +#define NETDEV_NOTIFY_PEERS 0x0013
1944
1945 #define SYS_DOWN 0x0001 /* Notify of system down */
1946 #define SYS_RESTART SYS_DOWN
1947 diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
1948 index 0a555dd..8052e00 100644
1949 --- a/include/linux/usb/quirks.h
1950 +++ b/include/linux/usb/quirks.h
1951 @@ -22,4 +22,8 @@
1952 /*device will morph if reset, don't use reset for handling errors */
1953 #define USB_QUIRK_RESET_MORPHS 0x00000010
1954
1955 +/* device needs a pause during initialization, after we read the device
1956 + descriptor */
1957 +#define USB_QUIRK_DELAY_INIT 0x00000040
1958 +
1959 #endif /* __LINUX_USB_QUIRKS_H */
1960 diff --git a/kernel/irq/manage.c b/kernel/irq/manage.c
1961 index 38dc536..26b1b7b 100644
1962 --- a/kernel/irq/manage.c
1963 +++ b/kernel/irq/manage.c
1964 @@ -200,7 +200,7 @@ static inline int setup_affinity(unsigned int irq, struct irq_desc *desc)
1965 void __disable_irq(struct irq_desc *desc, unsigned int irq, bool suspend)
1966 {
1967 if (suspend) {
1968 - if (!desc->action || (desc->action->flags & IRQF_TIMER))
1969 + if (!desc->action || (desc->action->flags & IRQF_NO_SUSPEND))
1970 return;
1971 desc->status |= IRQ_SUSPENDED;
1972 }
1973 diff --git a/mm/memory.c b/mm/memory.c
1974 index cceea05..daa100f 100644
1975 --- a/mm/memory.c
1976 +++ b/mm/memory.c
1977 @@ -2751,6 +2751,26 @@ out_release:
1978 }
1979
1980 /*
1981 + * This is like a special single-page "expand_downwards()",
1982 + * except we must first make sure that 'address-PAGE_SIZE'
1983 + * doesn't hit another vma.
1984 + *
1985 + * The "find_vma()" will do the right thing even if we wrap
1986 + */
1987 +static inline int check_stack_guard_page(struct vm_area_struct *vma, unsigned long address)
1988 +{
1989 + address &= PAGE_MASK;
1990 + if ((vma->vm_flags & VM_GROWSDOWN) && address == vma->vm_start) {
1991 + address -= PAGE_SIZE;
1992 + if (find_vma(vma->vm_mm, address) != vma)
1993 + return -ENOMEM;
1994 +
1995 + expand_stack(vma, address);
1996 + }
1997 + return 0;
1998 +}
1999 +
2000 +/*
2001 * We enter with non-exclusive mmap_sem (to exclude vma changes,
2002 * but allow concurrent faults), and pte mapped but not yet locked.
2003 * We return with mmap_sem still held, but pte unmapped and unlocked.
2004 @@ -2763,6 +2783,11 @@ static int do_anonymous_page(struct mm_struct *mm, struct vm_area_struct *vma,
2005 spinlock_t *ptl;
2006 pte_t entry;
2007
2008 + if (check_stack_guard_page(vma, address) < 0) {
2009 + pte_unmap(page_table);
2010 + return VM_FAULT_SIGBUS;
2011 + }
2012 +
2013 if (!(flags & FAULT_FLAG_WRITE)) {
2014 entry = pte_mkspecial(pfn_pte(my_zero_pfn(address),
2015 vma->vm_page_prot));
2016 diff --git a/mm/swapfile.c b/mm/swapfile.c
2017 index 6cd0a8f..1d3db21 100644
2018 --- a/mm/swapfile.c
2019 +++ b/mm/swapfile.c
2020 @@ -315,8 +315,10 @@ checks:
2021 if (offset > si->highest_bit)
2022 scan_base = offset = si->lowest_bit;
2023
2024 - /* reuse swap entry of cache-only swap if not busy. */
2025 - if (vm_swap_full() && si->swap_map[offset] == SWAP_HAS_CACHE) {
2026 + /* reuse swap entry of cache-only swap if not hibernation. */
2027 + if (vm_swap_full()
2028 + && usage == SWAP_HAS_CACHE
2029 + && si->swap_map[offset] == SWAP_HAS_CACHE) {
2030 int swap_was_freed;
2031 spin_unlock(&swap_lock);
2032 swap_was_freed = __try_to_reclaim_swap(si, offset);
2033 diff --git a/net/ipv4/devinet.c b/net/ipv4/devinet.c
2034 index 90e3d63..c12777f 100644
2035 --- a/net/ipv4/devinet.c
2036 +++ b/net/ipv4/devinet.c
2037 @@ -1081,6 +1081,7 @@ static int inetdev_event(struct notifier_block *this, unsigned long event,
2038 }
2039 ip_mc_up(in_dev);
2040 /* fall through */
2041 + case NETDEV_NOTIFY_PEERS:
2042 case NETDEV_CHANGEADDR:
2043 /* Send gratuitous ARP to notify of link change */
2044 if (IN_DEV_ARP_NOTIFY(in_dev)) {
2045 diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
2046 index ff4dd53..2d7ca9e 100644
2047 --- a/net/sched/sch_generic.c
2048 +++ b/net/sched/sch_generic.c
2049 @@ -325,6 +325,24 @@ void netif_carrier_off(struct net_device *dev)
2050 }
2051 EXPORT_SYMBOL(netif_carrier_off);
2052
2053 +/**
2054 + * netif_notify_peers - notify network peers about existence of @dev
2055 + * @dev: network device
2056 + *
2057 + * Generate traffic such that interested network peers are aware of
2058 + * @dev, such as by generating a gratuitous ARP. This may be used when
2059 + * a device wants to inform the rest of the network about some sort of
2060 + * reconfiguration such as a failover event or virtual machine
2061 + * migration.
2062 + */
2063 +void netif_notify_peers(struct net_device *dev)
2064 +{
2065 + rtnl_lock();
2066 + call_netdevice_notifiers(NETDEV_NOTIFY_PEERS, dev);
2067 + rtnl_unlock();
2068 +}
2069 +EXPORT_SYMBOL(netif_notify_peers);
2070 +
2071 /* "NOOP" scheduler: the best scheduler, recommended for all interfaces
2072 under all circumstances. It is difficult to invent anything faster or
2073 cheaper.

  ViewVC Help
Powered by ViewVC 1.1.20