/[linux-patches]/genpatches-2.6/tags/3.0-30/1031_linux-3.0.32.patch
Gentoo

Contents of /genpatches-2.6/tags/3.0-30/1031_linux-3.0.32.patch

Parent Directory Parent Directory | Revision Log Revision Log


Revision 2206 - (show annotations) (download)
Mon Sep 17 18:58:14 2012 UTC (22 months, 1 week ago) by mpagano
File size: 56705 byte(s)
3.0-30 release
1 diff --git a/Documentation/networking/ip-sysctl.txt b/Documentation/networking/ip-sysctl.txt
2 index bfe9242..7d4ecaa 100644
3 --- a/Documentation/networking/ip-sysctl.txt
4 +++ b/Documentation/networking/ip-sysctl.txt
5 @@ -147,7 +147,7 @@ tcp_adv_win_scale - INTEGER
6 (if tcp_adv_win_scale > 0) or bytes-bytes/2^(-tcp_adv_win_scale),
7 if it is <= 0.
8 Possible values are [-31, 31], inclusive.
9 - Default: 2
10 + Default: 1
11
12 tcp_allowed_congestion_control - STRING
13 Show/set the congestion control choices available to non-privileged
14 @@ -407,7 +407,7 @@ tcp_rmem - vector of 3 INTEGERs: min, default, max
15 net.core.rmem_max. Calling setsockopt() with SO_RCVBUF disables
16 automatic tuning of that socket's receive buffer size, in which
17 case this value is ignored.
18 - Default: between 87380B and 4MB, depending on RAM size.
19 + Default: between 87380B and 6MB, depending on RAM size.
20
21 tcp_sack - BOOLEAN
22 Enable select acknowledgments (SACKS).
23 diff --git a/Makefile b/Makefile
24 index ac9701b..16b9abf 100644
25 --- a/Makefile
26 +++ b/Makefile
27 @@ -1,6 +1,6 @@
28 VERSION = 3
29 PATCHLEVEL = 0
30 -SUBLEVEL = 31
31 +SUBLEVEL = 32
32 EXTRAVERSION =
33 NAME = Sneaky Weasel
34
35 diff --git a/arch/arm/kernel/smp.c b/arch/arm/kernel/smp.c
36 index e7f92a4..fea97f6 100644
37 --- a/arch/arm/kernel/smp.c
38 +++ b/arch/arm/kernel/smp.c
39 @@ -279,8 +279,6 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
40 struct mm_struct *mm = &init_mm;
41 unsigned int cpu = smp_processor_id();
42
43 - printk("CPU%u: Booted secondary processor\n", cpu);
44 -
45 /*
46 * All kernel threads share the same mm context; grab a
47 * reference and switch to it.
48 @@ -292,6 +290,8 @@ asmlinkage void __cpuinit secondary_start_kernel(void)
49 enter_lazy_tlb(mm, current);
50 local_flush_tlb_all();
51
52 + printk("CPU%u: Booted secondary processor\n", cpu);
53 +
54 cpu_init();
55 preempt_disable();
56 trace_hardirqs_off();
57 diff --git a/arch/arm/kernel/sys_arm.c b/arch/arm/kernel/sys_arm.c
58 index 62e7c61..0264ab4 100644
59 --- a/arch/arm/kernel/sys_arm.c
60 +++ b/arch/arm/kernel/sys_arm.c
61 @@ -115,7 +115,7 @@ int kernel_execve(const char *filename,
62 "Ir" (THREAD_START_SP - sizeof(regs)),
63 "r" (&regs),
64 "Ir" (sizeof(regs))
65 - : "r0", "r1", "r2", "r3", "ip", "lr", "memory");
66 + : "r0", "r1", "r2", "r3", "r8", "r9", "ip", "lr", "memory");
67
68 out:
69 return ret;
70 diff --git a/arch/arm/mach-orion5x/mpp.h b/arch/arm/mach-orion5x/mpp.h
71 index eac6897..db70e79 100644
72 --- a/arch/arm/mach-orion5x/mpp.h
73 +++ b/arch/arm/mach-orion5x/mpp.h
74 @@ -65,8 +65,8 @@
75 #define MPP8_GIGE MPP(8, 0x1, 0, 0, 1, 1, 1)
76
77 #define MPP9_UNUSED MPP(9, 0x0, 0, 0, 1, 1, 1)
78 -#define MPP9_GPIO MPP(9, 0x0, 0, 0, 1, 1, 1)
79 -#define MPP9_GIGE MPP(9, 0x1, 1, 1, 1, 1, 1)
80 +#define MPP9_GPIO MPP(9, 0x0, 1, 1, 1, 1, 1)
81 +#define MPP9_GIGE MPP(9, 0x1, 0, 0, 1, 1, 1)
82
83 #define MPP10_UNUSED MPP(10, 0x0, 0, 0, 1, 1, 1)
84 #define MPP10_GPIO MPP(10, 0x0, 1, 1, 1, 1, 1)
85 diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c
86 index bc0e1d8..8799eae 100644
87 --- a/arch/arm/mm/fault.c
88 +++ b/arch/arm/mm/fault.c
89 @@ -266,7 +266,9 @@ good_area:
90 return fault;
91
92 check_stack:
93 - if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr))
94 + /* Don't allow expansion below FIRST_USER_ADDRESS */
95 + if (vma->vm_flags & VM_GROWSDOWN &&
96 + addr >= FIRST_USER_ADDRESS && !expand_stack(vma, addr))
97 goto good_area;
98 out:
99 return fault;
100 diff --git a/arch/ia64/include/asm/unistd.h b/arch/ia64/include/asm/unistd.h
101 index 7c928da..d8de182 100644
102 --- a/arch/ia64/include/asm/unistd.h
103 +++ b/arch/ia64/include/asm/unistd.h
104 @@ -321,11 +321,12 @@
105 #define __NR_syncfs 1329
106 #define __NR_setns 1330
107 #define __NR_sendmmsg 1331
108 +#define __NR_accept4 1334
109
110 #ifdef __KERNEL__
111
112
113 -#define NR_syscalls 308 /* length of syscall table */
114 +#define NR_syscalls 311 /* length of syscall table */
115
116 /*
117 * The following defines stop scripts/checksyscalls.sh from complaining about
118 diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
119 index 97dd2ab..df477f8 100644
120 --- a/arch/ia64/kernel/entry.S
121 +++ b/arch/ia64/kernel/entry.S
122 @@ -1777,6 +1777,9 @@ sys_call_table:
123 data8 sys_syncfs
124 data8 sys_setns // 1330
125 data8 sys_sendmmsg
126 + data8 sys_ni_syscall /* process_vm_readv */
127 + data8 sys_ni_syscall /* process_vm_writev */
128 + data8 sys_accept4
129
130 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
131 #endif /* __IA64_ASM_PARAVIRTUALIZED_NATIVE */
132 diff --git a/arch/sparc/kernel/central.c b/arch/sparc/kernel/central.c
133 index 7eef3f7..f5ddc0b 100644
134 --- a/arch/sparc/kernel/central.c
135 +++ b/arch/sparc/kernel/central.c
136 @@ -268,4 +268,4 @@ static int __init sunfire_init(void)
137 return 0;
138 }
139
140 -subsys_initcall(sunfire_init);
141 +fs_initcall(sunfire_init);
142 diff --git a/arch/sparc/mm/ultra.S b/arch/sparc/mm/ultra.S
143 index b57a594..874162a 100644
144 --- a/arch/sparc/mm/ultra.S
145 +++ b/arch/sparc/mm/ultra.S
146 @@ -495,11 +495,11 @@ xcall_fetch_glob_regs:
147 stx %o7, [%g1 + GR_SNAP_O7]
148 stx %i7, [%g1 + GR_SNAP_I7]
149 /* Don't try this at home kids... */
150 - rdpr %cwp, %g2
151 - sub %g2, 1, %g7
152 + rdpr %cwp, %g3
153 + sub %g3, 1, %g7
154 wrpr %g7, %cwp
155 mov %i7, %g7
156 - wrpr %g2, %cwp
157 + wrpr %g3, %cwp
158 stx %g7, [%g1 + GR_SNAP_RPC]
159 sethi %hi(trap_block), %g7
160 or %g7, %lo(trap_block), %g7
161 diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c
162 index a7869ad..41459d8 100644
163 --- a/arch/tile/kernel/compat_signal.c
164 +++ b/arch/tile/kernel/compat_signal.c
165 @@ -406,19 +406,17 @@ int compat_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info,
166 * Set up registers for signal handler.
167 * Registers that we don't modify keep the value they had from
168 * user-space at the time we took the signal.
169 + * We always pass siginfo and mcontext, regardless of SA_SIGINFO,
170 + * since some things rely on this (e.g. glibc's debug/segfault.c).
171 */
172 regs->pc = ptr_to_compat_reg(ka->sa.sa_handler);
173 regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */
174 regs->sp = ptr_to_compat_reg(frame);
175 regs->lr = restorer;
176 regs->regs[0] = (unsigned long) usig;
177 -
178 - if (ka->sa.sa_flags & SA_SIGINFO) {
179 - /* Need extra arguments, so mark to restore caller-saves. */
180 - regs->regs[1] = ptr_to_compat_reg(&frame->info);
181 - regs->regs[2] = ptr_to_compat_reg(&frame->uc);
182 - regs->flags |= PT_FLAGS_CALLER_SAVES;
183 - }
184 + regs->regs[1] = ptr_to_compat_reg(&frame->info);
185 + regs->regs[2] = ptr_to_compat_reg(&frame->uc);
186 + regs->flags |= PT_FLAGS_CALLER_SAVES;
187
188 /*
189 * Notify any tracer that was single-stepping it.
190 diff --git a/arch/x86/kernel/setup_percpu.c b/arch/x86/kernel/setup_percpu.c
191 index 71f4727..5a98aa2 100644
192 --- a/arch/x86/kernel/setup_percpu.c
193 +++ b/arch/x86/kernel/setup_percpu.c
194 @@ -185,10 +185,22 @@ void __init setup_per_cpu_areas(void)
195 #endif
196 rc = -EINVAL;
197 if (pcpu_chosen_fc != PCPU_FC_PAGE) {
198 - const size_t atom_size = cpu_has_pse ? PMD_SIZE : PAGE_SIZE;
199 const size_t dyn_size = PERCPU_MODULE_RESERVE +
200 PERCPU_DYNAMIC_RESERVE - PERCPU_FIRST_CHUNK_RESERVE;
201 + size_t atom_size;
202
203 + /*
204 + * On 64bit, use PMD_SIZE for atom_size so that embedded
205 + * percpu areas are aligned to PMD. This, in the future,
206 + * can also allow using PMD mappings in vmalloc area. Use
207 + * PAGE_SIZE on 32bit as vmalloc space is highly contended
208 + * and large vmalloc area allocs can easily fail.
209 + */
210 +#ifdef CONFIG_X86_64
211 + atom_size = PMD_SIZE;
212 +#else
213 + atom_size = PAGE_SIZE;
214 +#endif
215 rc = pcpu_embed_first_chunk(PERCPU_FIRST_CHUNK_RESERVE,
216 dyn_size, atom_size,
217 pcpu_cpu_distance,
218 diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
219 index 0fb662a..b50c593 100644
220 --- a/arch/x86/xen/enlighten.c
221 +++ b/arch/x86/xen/enlighten.c
222 @@ -62,6 +62,7 @@
223 #include <asm/reboot.h>
224 #include <asm/stackprotector.h>
225 #include <asm/hypervisor.h>
226 +#include <asm/pci_x86.h>
227
228 #include "xen-ops.h"
229 #include "mmu.h"
230 @@ -1259,8 +1260,10 @@ asmlinkage void __init xen_start_kernel(void)
231 /* Make sure ACS will be enabled */
232 pci_request_acs();
233 }
234 -
235 -
236 +#ifdef CONFIG_PCI
237 + /* PCI BIOS service won't work from a PV guest. */
238 + pci_probe &= ~PCI_PROBE_BIOS;
239 +#endif
240 xen_raw_console_write("about to get started...\n");
241
242 xen_setup_runstate_info(0);
243 diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c
244 index 5f76c0a..d957dce 100644
245 --- a/arch/x86/xen/mmu.c
246 +++ b/arch/x86/xen/mmu.c
247 @@ -320,8 +320,13 @@ static pteval_t pte_mfn_to_pfn(pteval_t val)
248 {
249 if (val & _PAGE_PRESENT) {
250 unsigned long mfn = (val & PTE_PFN_MASK) >> PAGE_SHIFT;
251 + unsigned long pfn = mfn_to_pfn(mfn);
252 +
253 pteval_t flags = val & PTE_FLAGS_MASK;
254 - val = ((pteval_t)mfn_to_pfn(mfn) << PAGE_SHIFT) | flags;
255 + if (unlikely(pfn == ~0))
256 + val = flags & ~_PAGE_PRESENT;
257 + else
258 + val = ((pteval_t)pfn << PAGE_SHIFT) | flags;
259 }
260
261 return val;
262 diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c
263 index 0bd4832..79ddcde 100644
264 --- a/drivers/acpi/sleep.c
265 +++ b/drivers/acpi/sleep.c
266 @@ -422,6 +422,14 @@ static struct dmi_system_id __initdata acpisleep_dmi_table[] = {
267 },
268 {
269 .callback = init_nvs_nosave,
270 + .ident = "Sony Vaio VPCCW29FX",
271 + .matches = {
272 + DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"),
273 + DMI_MATCH(DMI_PRODUCT_NAME, "VPCCW29FX"),
274 + },
275 + },
276 + {
277 + .callback = init_nvs_nosave,
278 .ident = "Averatec AV1020-ED2",
279 .matches = {
280 DMI_MATCH(DMI_SYS_VENDOR, "AVERATEC"),
281 diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig
282 index e0b25de..98caccf 100644
283 --- a/drivers/crypto/Kconfig
284 +++ b/drivers/crypto/Kconfig
285 @@ -173,6 +173,7 @@ config CRYPTO_DEV_MV_CESA
286 select CRYPTO_ALGAPI
287 select CRYPTO_AES
288 select CRYPTO_BLKCIPHER2
289 + select CRYPTO_HASH
290 help
291 This driver allows you to utilize the Cryptographic Engines and
292 Security Accelerator (CESA) which can be found on the Marvell Orion
293 diff --git a/drivers/gpio/Kconfig b/drivers/gpio/Kconfig
294 index 2967002..80ccce9 100644
295 --- a/drivers/gpio/Kconfig
296 +++ b/drivers/gpio/Kconfig
297 @@ -350,18 +350,19 @@ config GPIO_LANGWELL
298 Say Y here to support Intel Langwell/Penwell GPIO.
299
300 config GPIO_PCH
301 - tristate "Intel EG20T PCH / OKI SEMICONDUCTOR ML7223 IOH GPIO"
302 + tristate "Intel EG20T PCH/LAPIS Semiconductor IOH(ML7223/ML7831) GPIO"
303 depends on PCI && X86
304 help
305 This driver is for PCH(Platform controller Hub) GPIO of Intel Topcliff
306 which is an IOH(Input/Output Hub) for x86 embedded processor.
307 This driver can access PCH GPIO device.
308
309 - This driver also can be used for OKI SEMICONDUCTOR IOH(Input/
310 - Output Hub), ML7223.
311 + This driver also can be used for LAPIS Semiconductor IOH(Input/
312 + Output Hub), ML7223 and ML7831.
313 ML7223 IOH is for MP(Media Phone) use.
314 - ML7223 is companion chip for Intel Atom E6xx series.
315 - ML7223 is completely compatible for Intel EG20T PCH.
316 + ML7831 IOH is for general purpose use.
317 + ML7223/ML7831 is companion chip for Intel Atom E6xx series.
318 + ML7223/ML7831 is completely compatible for Intel EG20T PCH.
319
320 config GPIO_ML_IOH
321 tristate "OKI SEMICONDUCTOR ML7213 IOH GPIO support"
322 diff --git a/drivers/gpio/pch_gpio.c b/drivers/gpio/pch_gpio.c
323 index 36919e7..de26978 100644
324 --- a/drivers/gpio/pch_gpio.c
325 +++ b/drivers/gpio/pch_gpio.c
326 @@ -287,6 +287,7 @@ static int pch_gpio_resume(struct pci_dev *pdev)
327 static DEFINE_PCI_DEVICE_TABLE(pch_gpio_pcidev_id) = {
328 { PCI_DEVICE(PCI_VENDOR_ID_INTEL, 0x8803) },
329 { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8014) },
330 + { PCI_DEVICE(PCI_VENDOR_ID_ROHM, 0x8803) },
331 { 0, }
332 };
333 MODULE_DEVICE_TABLE(pci, pch_gpio_pcidev_id);
334 diff --git a/drivers/md/md.c b/drivers/md/md.c
335 index bc83428..a2b3f21 100644
336 --- a/drivers/md/md.c
337 +++ b/drivers/md/md.c
338 @@ -348,6 +348,8 @@ void mddev_suspend(mddev_t *mddev)
339 synchronize_rcu();
340 wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0);
341 mddev->pers->quiesce(mddev, 1);
342 +
343 + del_timer_sync(&mddev->safemode_timer);
344 }
345 EXPORT_SYMBOL_GPL(mddev_suspend);
346
347 diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c
348 index a43ed6c..12b91ae 100644
349 --- a/drivers/media/rc/ene_ir.c
350 +++ b/drivers/media/rc/ene_ir.c
351 @@ -1017,22 +1017,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
352
353 spin_lock_init(&dev->hw_lock);
354
355 - /* claim the resources */
356 - error = -EBUSY;
357 - dev->hw_io = pnp_port_start(pnp_dev, 0);
358 - if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) {
359 - dev->hw_io = -1;
360 - dev->irq = -1;
361 - goto error;
362 - }
363 -
364 - dev->irq = pnp_irq(pnp_dev, 0);
365 - if (request_irq(dev->irq, ene_isr,
366 - IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) {
367 - dev->irq = -1;
368 - goto error;
369 - }
370 -
371 pnp_set_drvdata(pnp_dev, dev);
372 dev->pnp_dev = pnp_dev;
373
374 @@ -1085,6 +1069,22 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id)
375 device_set_wakeup_capable(&pnp_dev->dev, true);
376 device_set_wakeup_enable(&pnp_dev->dev, true);
377
378 + /* claim the resources */
379 + error = -EBUSY;
380 + dev->hw_io = pnp_port_start(pnp_dev, 0);
381 + if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) {
382 + dev->hw_io = -1;
383 + dev->irq = -1;
384 + goto error;
385 + }
386 +
387 + dev->irq = pnp_irq(pnp_dev, 0);
388 + if (request_irq(dev->irq, ene_isr,
389 + IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) {
390 + dev->irq = -1;
391 + goto error;
392 + }
393 +
394 error = rc_register_device(rdev);
395 if (error < 0)
396 goto error;
397 diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c
398 index 7f7079b..4218f73 100644
399 --- a/drivers/media/rc/fintek-cir.c
400 +++ b/drivers/media/rc/fintek-cir.c
401 @@ -504,16 +504,6 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
402
403 spin_lock_init(&fintek->fintek_lock);
404
405 - ret = -EBUSY;
406 - /* now claim resources */
407 - if (!request_region(fintek->cir_addr,
408 - fintek->cir_port_len, FINTEK_DRIVER_NAME))
409 - goto failure;
410 -
411 - if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
412 - FINTEK_DRIVER_NAME, (void *)fintek))
413 - goto failure;
414 -
415 pnp_set_drvdata(pdev, fintek);
416 fintek->pdev = pdev;
417
418 @@ -548,6 +538,16 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id
419 /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */
420 rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD);
421
422 + ret = -EBUSY;
423 + /* now claim resources */
424 + if (!request_region(fintek->cir_addr,
425 + fintek->cir_port_len, FINTEK_DRIVER_NAME))
426 + goto failure;
427 +
428 + if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED,
429 + FINTEK_DRIVER_NAME, (void *)fintek))
430 + goto failure;
431 +
432 ret = rc_register_device(rdev);
433 if (ret)
434 goto failure;
435 diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c
436 index ecd3d02..c5ca091 100644
437 --- a/drivers/media/rc/ite-cir.c
438 +++ b/drivers/media/rc/ite-cir.c
439 @@ -1519,16 +1519,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
440 /* initialize raw event */
441 init_ir_raw_event(&itdev->rawir);
442
443 - ret = -EBUSY;
444 - /* now claim resources */
445 - if (!request_region(itdev->cir_addr,
446 - dev_desc->io_region_size, ITE_DRIVER_NAME))
447 - goto failure;
448 -
449 - if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
450 - ITE_DRIVER_NAME, (void *)itdev))
451 - goto failure;
452 -
453 /* set driver data into the pnp device */
454 pnp_set_drvdata(pdev, itdev);
455 itdev->pdev = pdev;
456 @@ -1604,6 +1594,16 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id
457 rdev->driver_name = ITE_DRIVER_NAME;
458 rdev->map_name = RC_MAP_RC6_MCE;
459
460 + ret = -EBUSY;
461 + /* now claim resources */
462 + if (!request_region(itdev->cir_addr,
463 + dev_desc->io_region_size, ITE_DRIVER_NAME))
464 + goto failure;
465 +
466 + if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED,
467 + ITE_DRIVER_NAME, (void *)itdev))
468 + goto failure;
469 +
470 ret = rc_register_device(rdev);
471 if (ret)
472 goto failure;
473 diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c
474 index 9fd019e..c212276 100644
475 --- a/drivers/media/rc/nuvoton-cir.c
476 +++ b/drivers/media/rc/nuvoton-cir.c
477 @@ -1027,24 +1027,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
478 spin_lock_init(&nvt->nvt_lock);
479 spin_lock_init(&nvt->tx.lock);
480
481 - ret = -EBUSY;
482 - /* now claim resources */
483 - if (!request_region(nvt->cir_addr,
484 - CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
485 - goto failure;
486 -
487 - if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED,
488 - NVT_DRIVER_NAME, (void *)nvt))
489 - goto failure;
490 -
491 - if (!request_region(nvt->cir_wake_addr,
492 - CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
493 - goto failure;
494 -
495 - if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED,
496 - NVT_DRIVER_NAME, (void *)nvt))
497 - goto failure;
498 -
499 pnp_set_drvdata(pdev, nvt);
500 nvt->pdev = pdev;
501
502 @@ -1091,6 +1073,24 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id)
503 rdev->tx_resolution = XYZ;
504 #endif
505
506 + ret = -EBUSY;
507 + /* now claim resources */
508 + if (!request_region(nvt->cir_addr,
509 + CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
510 + goto failure;
511 +
512 + if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED,
513 + NVT_DRIVER_NAME, (void *)nvt))
514 + goto failure;
515 +
516 + if (!request_region(nvt->cir_wake_addr,
517 + CIR_IOREG_LENGTH, NVT_DRIVER_NAME))
518 + goto failure;
519 +
520 + if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED,
521 + NVT_DRIVER_NAME, (void *)nvt))
522 + goto failure;
523 +
524 ret = rc_register_device(rdev);
525 if (ret)
526 goto failure;
527 diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c
528 index 6f03846..9e55a0c 100644
529 --- a/drivers/media/rc/winbond-cir.c
530 +++ b/drivers/media/rc/winbond-cir.c
531 @@ -1003,39 +1003,10 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
532 "(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n",
533 data->wbase, data->ebase, data->sbase, data->irq);
534
535 - if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) {
536 - dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
537 - data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1);
538 - err = -EBUSY;
539 - goto exit_free_data;
540 - }
541 -
542 - if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) {
543 - dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
544 - data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1);
545 - err = -EBUSY;
546 - goto exit_release_wbase;
547 - }
548 -
549 - if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) {
550 - dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
551 - data->sbase, data->sbase + SP_IOMEM_LEN - 1);
552 - err = -EBUSY;
553 - goto exit_release_ebase;
554 - }
555 -
556 - err = request_irq(data->irq, wbcir_irq_handler,
557 - IRQF_DISABLED, DRVNAME, device);
558 - if (err) {
559 - dev_err(dev, "Failed to claim IRQ %u\n", data->irq);
560 - err = -EBUSY;
561 - goto exit_release_sbase;
562 - }
563 -
564 led_trigger_register_simple("cir-tx", &data->txtrigger);
565 if (!data->txtrigger) {
566 err = -ENOMEM;
567 - goto exit_free_irq;
568 + goto exit_free_data;
569 }
570
571 led_trigger_register_simple("cir-rx", &data->rxtrigger);
572 @@ -1074,9 +1045,38 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
573 data->dev->priv = data;
574 data->dev->dev.parent = &device->dev;
575
576 + if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) {
577 + dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
578 + data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1);
579 + err = -EBUSY;
580 + goto exit_free_rc;
581 + }
582 +
583 + if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) {
584 + dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
585 + data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1);
586 + err = -EBUSY;
587 + goto exit_release_wbase;
588 + }
589 +
590 + if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) {
591 + dev_err(dev, "Region 0x%lx-0x%lx already in use!\n",
592 + data->sbase, data->sbase + SP_IOMEM_LEN - 1);
593 + err = -EBUSY;
594 + goto exit_release_ebase;
595 + }
596 +
597 + err = request_irq(data->irq, wbcir_irq_handler,
598 + IRQF_DISABLED, DRVNAME, device);
599 + if (err) {
600 + dev_err(dev, "Failed to claim IRQ %u\n", data->irq);
601 + err = -EBUSY;
602 + goto exit_release_sbase;
603 + }
604 +
605 err = rc_register_device(data->dev);
606 if (err)
607 - goto exit_free_rc;
608 + goto exit_free_irq;
609
610 device_init_wakeup(&device->dev, 1);
611
612 @@ -1084,14 +1084,6 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id)
613
614 return 0;
615
616 -exit_free_rc:
617 - rc_free_device(data->dev);
618 -exit_unregister_led:
619 - led_classdev_unregister(&data->led);
620 -exit_unregister_rxtrigger:
621 - led_trigger_unregister_simple(data->rxtrigger);
622 -exit_unregister_txtrigger:
623 - led_trigger_unregister_simple(data->txtrigger);
624 exit_free_irq:
625 free_irq(data->irq, device);
626 exit_release_sbase:
627 @@ -1100,6 +1092,14 @@ exit_release_ebase:
628 release_region(data->ebase, EHFUNC_IOMEM_LEN);
629 exit_release_wbase:
630 release_region(data->wbase, WAKEUP_IOMEM_LEN);
631 +exit_free_rc:
632 + rc_free_device(data->dev);
633 +exit_unregister_led:
634 + led_classdev_unregister(&data->led);
635 +exit_unregister_rxtrigger:
636 + led_trigger_unregister_simple(data->rxtrigger);
637 +exit_unregister_txtrigger:
638 + led_trigger_unregister_simple(data->txtrigger);
639 exit_free_data:
640 kfree(data);
641 pnp_set_drvdata(device, NULL);
642 diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig
643 index 93359fa..0c3f234 100644
644 --- a/drivers/net/Kconfig
645 +++ b/drivers/net/Kconfig
646 @@ -2543,7 +2543,7 @@ config S6GMAC
647 source "drivers/net/stmmac/Kconfig"
648
649 config PCH_GBE
650 - tristate "Intel EG20T PCH / OKI SEMICONDUCTOR ML7223 IOH GbE"
651 + tristate "Intel EG20T PCH/OKI SEMICONDUCTOR IOH(ML7223/ML7831) GbE"
652 depends on PCI
653 select MII
654 ---help---
655 @@ -2556,10 +2556,11 @@ config PCH_GBE
656 This driver enables Gigabit Ethernet function.
657
658 This driver also can be used for OKI SEMICONDUCTOR IOH(Input/
659 - Output Hub), ML7223.
660 - ML7223 IOH is for MP(Media Phone) use.
661 - ML7223 is companion chip for Intel Atom E6xx series.
662 - ML7223 is completely compatible for Intel EG20T PCH.
663 + Output Hub), ML7223/ML7831.
664 + ML7223 IOH is for MP(Media Phone) use. ML7831 IOH is for general
665 + purpose use.
666 + ML7223/ML7831 is companion chip for Intel Atom E6xx series.
667 + ML7223/ML7831 is completely compatible for Intel EG20T PCH.
668
669 endif # NETDEV_1000
670
671 diff --git a/drivers/net/pch_gbe/pch_gbe_main.c b/drivers/net/pch_gbe/pch_gbe_main.c
672 index eac3c5c..236d00e 100644
673 --- a/drivers/net/pch_gbe/pch_gbe_main.c
674 +++ b/drivers/net/pch_gbe/pch_gbe_main.c
675 @@ -39,6 +39,9 @@ const char pch_driver_version[] = DRV_VERSION;
676 #define PCI_VENDOR_ID_ROHM 0x10db
677 #define PCI_DEVICE_ID_ROHM_ML7223_GBE 0x8013
678
679 +/* Macros for ML7831 */
680 +#define PCI_DEVICE_ID_ROHM_ML7831_GBE 0x8802
681 +
682 #define PCH_GBE_TX_WEIGHT 64
683 #define PCH_GBE_RX_WEIGHT 64
684 #define PCH_GBE_RX_BUFFER_WRITE 16
685 @@ -717,13 +720,6 @@ static void pch_gbe_configure_rx(struct pch_gbe_adapter *adapter)
686 iowrite32(rdba, &hw->reg->RX_DSC_BASE);
687 iowrite32(rdlen, &hw->reg->RX_DSC_SIZE);
688 iowrite32((rdba + rdlen), &hw->reg->RX_DSC_SW_P);
689 -
690 - /* Enables Receive DMA */
691 - rxdma = ioread32(&hw->reg->DMA_CTRL);
692 - rxdma |= PCH_GBE_RX_DMA_EN;
693 - iowrite32(rxdma, &hw->reg->DMA_CTRL);
694 - /* Enables Receive */
695 - iowrite32(PCH_GBE_MRE_MAC_RX_EN, &hw->reg->MAC_RX_EN);
696 }
697
698 /**
699 @@ -1097,6 +1093,19 @@ void pch_gbe_update_stats(struct pch_gbe_adapter *adapter)
700 spin_unlock_irqrestore(&adapter->stats_lock, flags);
701 }
702
703 +static void pch_gbe_start_receive(struct pch_gbe_hw *hw)
704 +{
705 + u32 rxdma;
706 +
707 + /* Enables Receive DMA */
708 + rxdma = ioread32(&hw->reg->DMA_CTRL);
709 + rxdma |= PCH_GBE_RX_DMA_EN;
710 + iowrite32(rxdma, &hw->reg->DMA_CTRL);
711 + /* Enables Receive */
712 + iowrite32(PCH_GBE_MRE_MAC_RX_EN, &hw->reg->MAC_RX_EN);
713 + return;
714 +}
715 +
716 /**
717 * pch_gbe_intr - Interrupt Handler
718 * @irq: Interrupt number
719 @@ -1701,6 +1710,12 @@ int pch_gbe_up(struct pch_gbe_adapter *adapter)
720 struct pch_gbe_rx_ring *rx_ring = adapter->rx_ring;
721 int err;
722
723 + /* Ensure we have a valid MAC */
724 + if (!is_valid_ether_addr(adapter->hw.mac.addr)) {
725 + pr_err("Error: Invalid MAC address\n");
726 + return -EINVAL;
727 + }
728 +
729 /* hardware has been reset, we need to reload some things */
730 pch_gbe_set_multi(netdev);
731
732 @@ -1717,6 +1732,7 @@ int pch_gbe_up(struct pch_gbe_adapter *adapter)
733 pch_gbe_alloc_tx_buffers(adapter, tx_ring);
734 pch_gbe_alloc_rx_buffers(adapter, rx_ring, rx_ring->count);
735 adapter->tx_queue_len = netdev->tx_queue_len;
736 + pch_gbe_start_receive(&adapter->hw);
737
738 mod_timer(&adapter->watchdog_timer, jiffies);
739
740 @@ -2118,7 +2134,7 @@ static int pch_gbe_napi_poll(struct napi_struct *napi, int budget)
741 /* If no Tx and not enough Rx work done,
742 * exit the polling mode
743 */
744 - if ((work_done < budget) || !netif_running(netdev))
745 + if (work_done < budget)
746 poll_end_flag = true;
747 }
748
749 @@ -2392,9 +2408,14 @@ static int pch_gbe_probe(struct pci_dev *pdev,
750
751 memcpy(netdev->dev_addr, adapter->hw.mac.addr, netdev->addr_len);
752 if (!is_valid_ether_addr(netdev->dev_addr)) {
753 - dev_err(&pdev->dev, "Invalid MAC Address\n");
754 - ret = -EIO;
755 - goto err_free_adapter;
756 + /*
757 + * If the MAC is invalid (or just missing), display a warning
758 + * but do not abort setting up the device. pch_gbe_up will
759 + * prevent the interface from being brought up until a valid MAC
760 + * is set.
761 + */
762 + dev_err(&pdev->dev, "Invalid MAC address, "
763 + "interface disabled.\n");
764 }
765 setup_timer(&adapter->watchdog_timer, pch_gbe_watchdog,
766 (unsigned long)adapter);
767 @@ -2452,6 +2473,13 @@ static DEFINE_PCI_DEVICE_TABLE(pch_gbe_pcidev_id) = {
768 .class = (PCI_CLASS_NETWORK_ETHERNET << 8),
769 .class_mask = (0xFFFF00)
770 },
771 + {.vendor = PCI_VENDOR_ID_ROHM,
772 + .device = PCI_DEVICE_ID_ROHM_ML7831_GBE,
773 + .subvendor = PCI_ANY_ID,
774 + .subdevice = PCI_ANY_ID,
775 + .class = (PCI_CLASS_NETWORK_ETHERNET << 8),
776 + .class_mask = (0xFFFF00)
777 + },
778 /* required last entry */
779 {0}
780 };
781 diff --git a/drivers/net/pch_gbe/pch_gbe_param.c b/drivers/net/pch_gbe/pch_gbe_param.c
782 index 5b5d90a..fb74ef9 100644
783 --- a/drivers/net/pch_gbe/pch_gbe_param.c
784 +++ b/drivers/net/pch_gbe/pch_gbe_param.c
785 @@ -320,10 +320,10 @@ static void pch_gbe_check_copper_options(struct pch_gbe_adapter *adapter)
786 pr_debug("AutoNeg specified along with Speed or Duplex, AutoNeg parameter ignored\n");
787 hw->phy.autoneg_advertised = opt.def;
788 } else {
789 - hw->phy.autoneg_advertised = AutoNeg;
790 - pch_gbe_validate_option(
791 - (int *)(&hw->phy.autoneg_advertised),
792 - &opt, adapter);
793 + int tmp = AutoNeg;
794 +
795 + pch_gbe_validate_option(&tmp, &opt, adapter);
796 + hw->phy.autoneg_advertised = tmp;
797 }
798 }
799
800 @@ -494,9 +494,10 @@ void pch_gbe_check_options(struct pch_gbe_adapter *adapter)
801 .arg = { .l = { .nr = (int)ARRAY_SIZE(fc_list),
802 .p = fc_list } }
803 };
804 - hw->mac.fc = FlowControl;
805 - pch_gbe_validate_option((int *)(&hw->mac.fc),
806 - &opt, adapter);
807 + int tmp = FlowControl;
808 +
809 + pch_gbe_validate_option(&tmp, &opt, adapter);
810 + hw->mac.fc = tmp;
811 }
812
813 pch_gbe_check_copper_options(adapter);
814 diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c
815 index 80df3a8..f2e31c8 100644
816 --- a/drivers/net/sky2.c
817 +++ b/drivers/net/sky2.c
818 @@ -2344,8 +2344,13 @@ static struct sk_buff *receive_copy(struct sky2_port *sky2,
819 skb_copy_from_linear_data(re->skb, skb->data, length);
820 skb->ip_summed = re->skb->ip_summed;
821 skb->csum = re->skb->csum;
822 + skb->rxhash = re->skb->rxhash;
823 + skb->vlan_tci = re->skb->vlan_tci;
824 +
825 pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr,
826 length, PCI_DMA_FROMDEVICE);
827 + re->skb->vlan_tci = 0;
828 + re->skb->rxhash = 0;
829 re->skb->ip_summed = CHECKSUM_NONE;
830 skb_put(skb, length);
831 }
832 @@ -2430,9 +2435,6 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
833 struct sk_buff *skb = NULL;
834 u16 count = (status & GMR_FS_LEN) >> 16;
835
836 - if (status & GMR_FS_VLAN)
837 - count -= VLAN_HLEN; /* Account for vlan tag */
838 -
839 netif_printk(sky2, rx_status, KERN_DEBUG, dev,
840 "rx slot %u status 0x%x len %d\n",
841 sky2->rx_next, status, length);
842 @@ -2440,6 +2442,9 @@ static struct sk_buff *sky2_receive(struct net_device *dev,
843 sky2->rx_next = (sky2->rx_next + 1) % sky2->rx_pending;
844 prefetch(sky2->rx_ring + sky2->rx_next);
845
846 + if (vlan_tx_tag_present(re->skb))
847 + count -= VLAN_HLEN; /* Account for vlan tag */
848 +
849 /* This chip has hardware problems that generates bogus status.
850 * So do only marginal checking and expect higher level protocols
851 * to handle crap frames.
852 @@ -2497,11 +2502,8 @@ static inline void sky2_tx_done(struct net_device *dev, u16 last)
853 }
854
855 static inline void sky2_skb_rx(const struct sky2_port *sky2,
856 - u32 status, struct sk_buff *skb)
857 + struct sk_buff *skb)
858 {
859 - if (status & GMR_FS_VLAN)
860 - __vlan_hwaccel_put_tag(skb, be16_to_cpu(sky2->rx_tag));
861 -
862 if (skb->ip_summed == CHECKSUM_NONE)
863 netif_receive_skb(skb);
864 else
865 @@ -2555,6 +2557,14 @@ static void sky2_rx_checksum(struct sky2_port *sky2, u32 status)
866 }
867 }
868
869 +static void sky2_rx_tag(struct sky2_port *sky2, u16 length)
870 +{
871 + struct sk_buff *skb;
872 +
873 + skb = sky2->rx_ring[sky2->rx_next].skb;
874 + __vlan_hwaccel_put_tag(skb, be16_to_cpu(length));
875 +}
876 +
877 static void sky2_rx_hash(struct sky2_port *sky2, u32 status)
878 {
879 struct sk_buff *skb;
880 @@ -2613,8 +2623,7 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
881 }
882
883 skb->protocol = eth_type_trans(skb, dev);
884 -
885 - sky2_skb_rx(sky2, status, skb);
886 + sky2_skb_rx(sky2, skb);
887
888 /* Stop after net poll weight */
889 if (++work_done >= to_do)
890 @@ -2622,11 +2631,11 @@ static int sky2_status_intr(struct sky2_hw *hw, int to_do, u16 idx)
891 break;
892
893 case OP_RXVLAN:
894 - sky2->rx_tag = length;
895 + sky2_rx_tag(sky2, length);
896 break;
897
898 case OP_RXCHKSVLAN:
899 - sky2->rx_tag = length;
900 + sky2_rx_tag(sky2, length);
901 /* fall through */
902 case OP_RXCHKS:
903 if (likely(dev->features & NETIF_F_RXCSUM))
904 diff --git a/drivers/net/sky2.h b/drivers/net/sky2.h
905 index 318c9ae..a79a166 100644
906 --- a/drivers/net/sky2.h
907 +++ b/drivers/net/sky2.h
908 @@ -2236,7 +2236,6 @@ struct sky2_port {
909 u16 rx_pending;
910 u16 rx_data_size;
911 u16 rx_nfrags;
912 - u16 rx_tag;
913
914 struct {
915 unsigned long last;
916 diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c
917 index ab59300..361beb7 100644
918 --- a/drivers/net/sungem.c
919 +++ b/drivers/net/sungem.c
920 @@ -2363,7 +2363,7 @@ static int gem_suspend(struct pci_dev *pdev, pm_message_t state)
921 netif_device_detach(dev);
922
923 /* Switch off MAC, remember WOL setting */
924 - gp->asleep_wol = gp->wake_on_lan;
925 + gp->asleep_wol = !!gp->wake_on_lan;
926 gem_do_stop(dev, gp->asleep_wol);
927 } else
928 gp->asleep_wol = 0;
929 diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
930 index bc8c183..c4ab8a7 100644
931 --- a/drivers/net/tg3.c
932 +++ b/drivers/net/tg3.c
933 @@ -740,8 +740,13 @@ static inline unsigned int tg3_has_work(struct tg3_napi *tnapi)
934 if (sblk->status & SD_STATUS_LINK_CHG)
935 work_exists = 1;
936 }
937 - /* check for RX/TX work to do */
938 - if (sblk->idx[0].tx_consumer != tnapi->tx_cons ||
939 +
940 + /* check for TX work to do */
941 + if (sblk->idx[0].tx_consumer != tnapi->tx_cons)
942 + work_exists = 1;
943 +
944 + /* check for RX work to do */
945 + if (tnapi->rx_rcb_prod_idx &&
946 *(tnapi->rx_rcb_prod_idx) != tnapi->rx_rcb_ptr)
947 work_exists = 1;
948
949 @@ -5216,6 +5221,9 @@ static int tg3_poll_work(struct tg3_napi *tnapi, int work_done, int budget)
950 return work_done;
951 }
952
953 + if (!tnapi->rx_rcb_prod_idx)
954 + return work_done;
955 +
956 /* run RX thread, within the bounds set by NAPI.
957 * All RX "locking" is done by ensuring outside
958 * code synchronizes with tg3->napi.poll()
959 @@ -6626,6 +6634,12 @@ static int tg3_alloc_consistent(struct tg3 *tp)
960 */
961 switch (i) {
962 default:
963 + if (tg3_flag(tp, ENABLE_RSS)) {
964 + tnapi->rx_rcb_prod_idx = NULL;
965 + break;
966 + }
967 + /* Fall through */
968 + case 1:
969 tnapi->rx_rcb_prod_idx = &sblk->idx[0].rx_producer;
970 break;
971 case 2:
972 diff --git a/drivers/net/usb/asix.c b/drivers/net/usb/asix.c
973 index 3e33573..c44e0e4 100644
974 --- a/drivers/net/usb/asix.c
975 +++ b/drivers/net/usb/asix.c
976 @@ -398,7 +398,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
977 u32 packet_len;
978 u32 padbytes = 0xffff0000;
979
980 - padlen = ((skb->len + 4) % 512) ? 0 : 4;
981 + padlen = ((skb->len + 4) & (dev->maxpacket - 1)) ? 0 : 4;
982
983 if ((!skb_cloned(skb)) &&
984 ((headroom + tailroom) >= (4 + padlen))) {
985 @@ -420,7 +420,7 @@ static struct sk_buff *asix_tx_fixup(struct usbnet *dev, struct sk_buff *skb,
986 cpu_to_le32s(&packet_len);
987 skb_copy_to_linear_data(skb, &packet_len, sizeof(packet_len));
988
989 - if ((skb->len % 512) == 0) {
990 + if (padlen) {
991 cpu_to_le32s(&padbytes);
992 memcpy(skb_tail_pointer(skb), &padbytes, sizeof(padbytes));
993 skb_put(skb, sizeof(padbytes));
994 diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c
995 index 13919dd..544c309 100644
996 --- a/drivers/net/usb/cdc_ether.c
997 +++ b/drivers/net/usb/cdc_ether.c
998 @@ -83,6 +83,7 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
999 struct cdc_state *info = (void *) &dev->data;
1000 int status;
1001 int rndis;
1002 + bool android_rndis_quirk = false;
1003 struct usb_driver *driver = driver_of(intf);
1004 struct usb_cdc_mdlm_desc *desc = NULL;
1005 struct usb_cdc_mdlm_detail_desc *detail = NULL;
1006 @@ -195,6 +196,11 @@ int usbnet_generic_cdc_bind(struct usbnet *dev, struct usb_interface *intf)
1007 info->control,
1008 info->u->bSlaveInterface0,
1009 info->data);
1010 + /* fall back to hard-wiring for RNDIS */
1011 + if (rndis) {
1012 + android_rndis_quirk = true;
1013 + goto next_desc;
1014 + }
1015 goto bad_desc;
1016 }
1017 if (info->control != intf) {
1018 @@ -271,11 +277,15 @@ next_desc:
1019 /* Microsoft ActiveSync based and some regular RNDIS devices lack the
1020 * CDC descriptors, so we'll hard-wire the interfaces and not check
1021 * for descriptors.
1022 + *
1023 + * Some Android RNDIS devices have a CDC Union descriptor pointing
1024 + * to non-existing interfaces. Ignore that and attempt the same
1025 + * hard-wired 0 and 1 interfaces.
1026 */
1027 - if (rndis && !info->u) {
1028 + if (rndis && (!info->u || android_rndis_quirk)) {
1029 info->control = usb_ifnum_to_if(dev->udev, 0);
1030 info->data = usb_ifnum_to_if(dev->udev, 1);
1031 - if (!info->control || !info->data) {
1032 + if (!info->control || !info->data || info->control != intf) {
1033 dev_dbg(&intf->dev,
1034 "rndis: master #0/%p slave #1/%p\n",
1035 info->control,
1036 @@ -472,6 +482,7 @@ static const struct driver_info wwan_info = {
1037 /*-------------------------------------------------------------------------*/
1038
1039 #define HUAWEI_VENDOR_ID 0x12D1
1040 +#define NOVATEL_VENDOR_ID 0x1410
1041
1042 static const struct usb_device_id products [] = {
1043 /*
1044 @@ -589,6 +600,21 @@ static const struct usb_device_id products [] = {
1045 * because of bugs/quirks in a given product (like Zaurus, above).
1046 */
1047 {
1048 + /* Novatel USB551L */
1049 + /* This match must come *before* the generic CDC-ETHER match so that
1050 + * we get FLAG_WWAN set on the device, since it's descriptors are
1051 + * generic CDC-ETHER.
1052 + */
1053 + .match_flags = USB_DEVICE_ID_MATCH_VENDOR
1054 + | USB_DEVICE_ID_MATCH_PRODUCT
1055 + | USB_DEVICE_ID_MATCH_INT_INFO,
1056 + .idVendor = NOVATEL_VENDOR_ID,
1057 + .idProduct = 0xB001,
1058 + .bInterfaceClass = USB_CLASS_COMM,
1059 + .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET,
1060 + .bInterfaceProtocol = USB_CDC_PROTO_NONE,
1061 + .driver_info = (unsigned long)&wwan_info,
1062 +}, {
1063 USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET,
1064 USB_CDC_PROTO_NONE),
1065 .driver_info = (unsigned long) &cdc_info,
1066 diff --git a/drivers/net/usb/smsc95xx.c b/drivers/net/usb/smsc95xx.c
1067 index f74f3ce..e5c15bb 100644
1068 --- a/drivers/net/usb/smsc95xx.c
1069 +++ b/drivers/net/usb/smsc95xx.c
1070 @@ -1190,7 +1190,7 @@ static const struct driver_info smsc95xx_info = {
1071 .rx_fixup = smsc95xx_rx_fixup,
1072 .tx_fixup = smsc95xx_tx_fixup,
1073 .status = smsc95xx_status,
1074 - .flags = FLAG_ETHER | FLAG_SEND_ZLP,
1075 + .flags = FLAG_ETHER | FLAG_SEND_ZLP | FLAG_LINK_INTR,
1076 };
1077
1078 static const struct usb_device_id products[] = {
1079 diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c
1080 index 46a6b67..dd225fc 100644
1081 --- a/drivers/net/usb/usbnet.c
1082 +++ b/drivers/net/usb/usbnet.c
1083 @@ -277,17 +277,32 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu)
1084 }
1085 EXPORT_SYMBOL_GPL(usbnet_change_mtu);
1086
1087 +/* The caller must hold list->lock */
1088 +static void __usbnet_queue_skb(struct sk_buff_head *list,
1089 + struct sk_buff *newsk, enum skb_state state)
1090 +{
1091 + struct skb_data *entry = (struct skb_data *) newsk->cb;
1092 +
1093 + __skb_queue_tail(list, newsk);
1094 + entry->state = state;
1095 +}
1096 +
1097 /*-------------------------------------------------------------------------*/
1098
1099 /* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from
1100 * completion callbacks. 2.5 should have fixed those bugs...
1101 */
1102
1103 -static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_head *list)
1104 +static enum skb_state defer_bh(struct usbnet *dev, struct sk_buff *skb,
1105 + struct sk_buff_head *list, enum skb_state state)
1106 {
1107 unsigned long flags;
1108 + enum skb_state old_state;
1109 + struct skb_data *entry = (struct skb_data *) skb->cb;
1110
1111 spin_lock_irqsave(&list->lock, flags);
1112 + old_state = entry->state;
1113 + entry->state = state;
1114 __skb_unlink(skb, list);
1115 spin_unlock(&list->lock);
1116 spin_lock(&dev->done.lock);
1117 @@ -295,6 +310,7 @@ static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_hea
1118 if (dev->done.qlen == 1)
1119 tasklet_schedule(&dev->bh);
1120 spin_unlock_irqrestore(&dev->done.lock, flags);
1121 + return old_state;
1122 }
1123
1124 /* some work can't be done in tasklets, so we use keventd
1125 @@ -335,7 +351,6 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
1126 entry = (struct skb_data *) skb->cb;
1127 entry->urb = urb;
1128 entry->dev = dev;
1129 - entry->state = rx_start;
1130 entry->length = 0;
1131
1132 usb_fill_bulk_urb (urb, dev->udev, dev->in,
1133 @@ -367,7 +382,7 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags)
1134 tasklet_schedule (&dev->bh);
1135 break;
1136 case 0:
1137 - __skb_queue_tail (&dev->rxq, skb);
1138 + __usbnet_queue_skb(&dev->rxq, skb, rx_start);
1139 }
1140 } else {
1141 netif_dbg(dev, ifdown, dev->net, "rx: stopped\n");
1142 @@ -418,16 +433,17 @@ static void rx_complete (struct urb *urb)
1143 struct skb_data *entry = (struct skb_data *) skb->cb;
1144 struct usbnet *dev = entry->dev;
1145 int urb_status = urb->status;
1146 + enum skb_state state;
1147
1148 skb_put (skb, urb->actual_length);
1149 - entry->state = rx_done;
1150 + state = rx_done;
1151 entry->urb = NULL;
1152
1153 switch (urb_status) {
1154 /* success */
1155 case 0:
1156 if (skb->len < dev->net->hard_header_len) {
1157 - entry->state = rx_cleanup;
1158 + state = rx_cleanup;
1159 dev->net->stats.rx_errors++;
1160 dev->net->stats.rx_length_errors++;
1161 netif_dbg(dev, rx_err, dev->net,
1162 @@ -466,7 +482,7 @@ static void rx_complete (struct urb *urb)
1163 "rx throttle %d\n", urb_status);
1164 }
1165 block:
1166 - entry->state = rx_cleanup;
1167 + state = rx_cleanup;
1168 entry->urb = urb;
1169 urb = NULL;
1170 break;
1171 @@ -477,17 +493,18 @@ block:
1172 // FALLTHROUGH
1173
1174 default:
1175 - entry->state = rx_cleanup;
1176 + state = rx_cleanup;
1177 dev->net->stats.rx_errors++;
1178 netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status);
1179 break;
1180 }
1181
1182 - defer_bh(dev, skb, &dev->rxq);
1183 + state = defer_bh(dev, skb, &dev->rxq, state);
1184
1185 if (urb) {
1186 if (netif_running (dev->net) &&
1187 - !test_bit (EVENT_RX_HALT, &dev->flags)) {
1188 + !test_bit (EVENT_RX_HALT, &dev->flags) &&
1189 + state != unlink_start) {
1190 rx_submit (dev, urb, GFP_ATOMIC);
1191 return;
1192 }
1193 @@ -573,16 +590,23 @@ EXPORT_SYMBOL_GPL(usbnet_purge_paused_rxq);
1194 static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q)
1195 {
1196 unsigned long flags;
1197 - struct sk_buff *skb, *skbnext;
1198 + struct sk_buff *skb;
1199 int count = 0;
1200
1201 spin_lock_irqsave (&q->lock, flags);
1202 - skb_queue_walk_safe(q, skb, skbnext) {
1203 + while (!skb_queue_empty(q)) {
1204 struct skb_data *entry;
1205 struct urb *urb;
1206 int retval;
1207
1208 - entry = (struct skb_data *) skb->cb;
1209 + skb_queue_walk(q, skb) {
1210 + entry = (struct skb_data *) skb->cb;
1211 + if (entry->state != unlink_start)
1212 + goto found;
1213 + }
1214 + break;
1215 +found:
1216 + entry->state = unlink_start;
1217 urb = entry->urb;
1218
1219 /*
1220 @@ -1033,8 +1057,7 @@ static void tx_complete (struct urb *urb)
1221 }
1222
1223 usb_autopm_put_interface_async(dev->intf);
1224 - entry->state = tx_done;
1225 - defer_bh(dev, skb, &dev->txq);
1226 + (void) defer_bh(dev, skb, &dev->txq, tx_done);
1227 }
1228
1229 /*-------------------------------------------------------------------------*/
1230 @@ -1087,7 +1110,6 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
1231 entry = (struct skb_data *) skb->cb;
1232 entry->urb = urb;
1233 entry->dev = dev;
1234 - entry->state = tx_start;
1235 entry->length = length;
1236
1237 usb_fill_bulk_urb (urb, dev->udev, dev->out,
1238 @@ -1146,7 +1168,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb,
1239 break;
1240 case 0:
1241 net->trans_start = jiffies;
1242 - __skb_queue_tail (&dev->txq, skb);
1243 + __usbnet_queue_skb(&dev->txq, skb, tx_start);
1244 if (dev->txq.qlen >= TX_QLEN (dev))
1245 netif_stop_queue (net);
1246 }
1247 diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
1248 index bbd182e..35dae41 100644
1249 --- a/drivers/platform/x86/sony-laptop.c
1250 +++ b/drivers/platform/x86/sony-laptop.c
1251 @@ -127,7 +127,7 @@ MODULE_PARM_DESC(minor,
1252 "default is -1 (automatic)");
1253 #endif
1254
1255 -static int kbd_backlight; /* = 1 */
1256 +static int kbd_backlight = 1;
1257 module_param(kbd_backlight, int, 0444);
1258 MODULE_PARM_DESC(kbd_backlight,
1259 "set this to 0 to disable keyboard backlight, "
1260 diff --git a/drivers/regulator/max8997.c b/drivers/regulator/max8997.c
1261 index ad6628c..a8fb668 100644
1262 --- a/drivers/regulator/max8997.c
1263 +++ b/drivers/regulator/max8997.c
1264 @@ -688,7 +688,7 @@ static int max8997_set_voltage_buck(struct regulator_dev *rdev,
1265 }
1266
1267 new_val++;
1268 - } while (desc->min + desc->step + new_val <= desc->max);
1269 + } while (desc->min + desc->step * new_val <= desc->max);
1270
1271 new_idx = tmp_idx;
1272 new_val = tmp_val;
1273 diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
1274 index 56a9f3f..168e67f 100644
1275 --- a/drivers/scsi/hpsa.c
1276 +++ b/drivers/scsi/hpsa.c
1277 @@ -4037,10 +4037,10 @@ static int hpsa_request_irq(struct ctlr_info *h,
1278
1279 if (h->msix_vector || h->msi_vector)
1280 rc = request_irq(h->intr[h->intr_mode], msixhandler,
1281 - IRQF_DISABLED, h->devname, h);
1282 + 0, h->devname, h);
1283 else
1284 rc = request_irq(h->intr[h->intr_mode], intxhandler,
1285 - IRQF_DISABLED, h->devname, h);
1286 + IRQF_SHARED, h->devname, h);
1287 if (rc) {
1288 dev_err(&h->pdev->dev, "unable to get irq %d for %s\n",
1289 h->intr[h->intr_mode], h->devname);
1290 diff --git a/fs/ext3/ialloc.c b/fs/ext3/ialloc.c
1291 index bfc2dc4..0b3da7c 100644
1292 --- a/fs/ext3/ialloc.c
1293 +++ b/fs/ext3/ialloc.c
1294 @@ -561,8 +561,12 @@ got:
1295 if (IS_DIRSYNC(inode))
1296 handle->h_sync = 1;
1297 if (insert_inode_locked(inode) < 0) {
1298 - err = -EINVAL;
1299 - goto fail_drop;
1300 + /*
1301 + * Likely a bitmap corruption causing inode to be allocated
1302 + * twice.
1303 + */
1304 + err = -EIO;
1305 + goto fail;
1306 }
1307 spin_lock(&sbi->s_next_gen_lock);
1308 inode->i_generation = sbi->s_next_generation++;
1309 diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c
1310 index 21bb2f6..412469b 100644
1311 --- a/fs/ext4/ialloc.c
1312 +++ b/fs/ext4/ialloc.c
1313 @@ -1021,8 +1021,12 @@ got:
1314 if (IS_DIRSYNC(inode))
1315 ext4_handle_sync(handle);
1316 if (insert_inode_locked(inode) < 0) {
1317 - err = -EINVAL;
1318 - goto fail_drop;
1319 + /*
1320 + * Likely a bitmap corruption causing inode to be allocated
1321 + * twice.
1322 + */
1323 + err = -EIO;
1324 + goto fail;
1325 }
1326 spin_lock(&sbi->s_next_gen_lock);
1327 inode->i_generation = sbi->s_next_generation++;
1328 diff --git a/fs/ext4/xattr.c b/fs/ext4/xattr.c
1329 index 19fe4e3..c2865cc 100644
1330 --- a/fs/ext4/xattr.c
1331 +++ b/fs/ext4/xattr.c
1332 @@ -487,18 +487,19 @@ ext4_xattr_release_block(handle_t *handle, struct inode *inode,
1333 ext4_free_blocks(handle, inode, bh, 0, 1,
1334 EXT4_FREE_BLOCKS_METADATA |
1335 EXT4_FREE_BLOCKS_FORGET);
1336 + unlock_buffer(bh);
1337 } else {
1338 le32_add_cpu(&BHDR(bh)->h_refcount, -1);
1339 + if (ce)
1340 + mb_cache_entry_release(ce);
1341 + unlock_buffer(bh);
1342 error = ext4_handle_dirty_metadata(handle, inode, bh);
1343 if (IS_SYNC(inode))
1344 ext4_handle_sync(handle);
1345 dquot_free_block(inode, 1);
1346 ea_bdebug(bh, "refcount now=%d; releasing",
1347 le32_to_cpu(BHDR(bh)->h_refcount));
1348 - if (ce)
1349 - mb_cache_entry_release(ce);
1350 }
1351 - unlock_buffer(bh);
1352 out:
1353 ext4_std_error(inode->i_sb, error);
1354 return;
1355 diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c
1356 index 31dce61..4bbd521 100644
1357 --- a/fs/jffs2/gc.c
1358 +++ b/fs/jffs2/gc.c
1359 @@ -225,8 +225,8 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
1360 return 0;
1361
1362 D1(printk(KERN_DEBUG "No progress from erasing blocks; doing GC anyway\n"));
1363 - spin_lock(&c->erase_completion_lock);
1364 mutex_lock(&c->alloc_sem);
1365 + spin_lock(&c->erase_completion_lock);
1366 }
1367
1368 /* First, work out which block we're garbage-collecting */
1369 diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
1370 index 3d67302..30f6548 100644
1371 --- a/fs/nfs/nfs4proc.c
1372 +++ b/fs/nfs/nfs4proc.c
1373 @@ -1771,6 +1771,7 @@ static int _nfs4_do_open(struct inode *dir, struct path *path, fmode_t fmode, in
1374 nfs_setattr_update_inode(state->inode, sattr);
1375 nfs_post_op_update_inode(state->inode, opendata->o_res.f_attr);
1376 }
1377 + nfs_revalidate_inode(server, state->inode);
1378 nfs4_opendata_put(opendata);
1379 nfs4_put_state_owner(sp);
1380 *res = state;
1381 diff --git a/fs/super.c b/fs/super.c
1382 index ab3d672..caf4dfa 100644
1383 --- a/fs/super.c
1384 +++ b/fs/super.c
1385 @@ -1009,6 +1009,8 @@ int freeze_super(struct super_block *sb)
1386 printk(KERN_ERR
1387 "VFS:Filesystem freeze failed\n");
1388 sb->s_frozen = SB_UNFROZEN;
1389 + smp_wmb();
1390 + wake_up(&sb->s_wait_unfrozen);
1391 deactivate_locked_super(sb);
1392 return ret;
1393 }
1394 diff --git a/include/asm-generic/statfs.h b/include/asm-generic/statfs.h
1395 index 0fd28e0..c749af9 100644
1396 --- a/include/asm-generic/statfs.h
1397 +++ b/include/asm-generic/statfs.h
1398 @@ -15,7 +15,7 @@ typedef __kernel_fsid_t fsid_t;
1399 * with a 10' pole.
1400 */
1401 #ifndef __statfs_word
1402 -#if BITS_PER_LONG == 64
1403 +#if __BITS_PER_LONG == 64
1404 #define __statfs_word long
1405 #else
1406 #define __statfs_word __u32
1407 diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
1408 index c6db9fb..bb1fac5 100644
1409 --- a/include/linux/seqlock.h
1410 +++ b/include/linux/seqlock.h
1411 @@ -141,7 +141,7 @@ static inline unsigned __read_seqcount_begin(const seqcount_t *s)
1412 unsigned ret;
1413
1414 repeat:
1415 - ret = s->sequence;
1416 + ret = ACCESS_ONCE(s->sequence);
1417 if (unlikely(ret & 1)) {
1418 cpu_relax();
1419 goto repeat;
1420 diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
1421 index 605b0aa..76f4396 100644
1422 --- a/include/linux/usb/usbnet.h
1423 +++ b/include/linux/usb/usbnet.h
1424 @@ -191,7 +191,8 @@ extern void usbnet_cdc_status(struct usbnet *, struct urb *);
1425 enum skb_state {
1426 illegal = 0,
1427 tx_start, tx_done,
1428 - rx_start, rx_done, rx_cleanup
1429 + rx_start, rx_done, rx_cleanup,
1430 + unlink_start
1431 };
1432
1433 struct skb_data { /* skb->cb is one of these */
1434 diff --git a/init/do_mounts.c b/init/do_mounts.c
1435 index ef6478f..8959eb3 100644
1436 --- a/init/do_mounts.c
1437 +++ b/init/do_mounts.c
1438 @@ -432,7 +432,7 @@ void __init change_floppy(char *fmt, ...)
1439 void __init mount_root(void)
1440 {
1441 #ifdef CONFIG_ROOT_NFS
1442 - if (MAJOR(ROOT_DEV) == UNNAMED_MAJOR) {
1443 + if (ROOT_DEV == Root_NFS) {
1444 if (mount_nfs_root())
1445 return;
1446
1447 diff --git a/kernel/compat.c b/kernel/compat.c
1448 index fc9eb093..3507c93 100644
1449 --- a/kernel/compat.c
1450 +++ b/kernel/compat.c
1451 @@ -318,25 +318,54 @@ asmlinkage long compat_sys_sigpending(compat_old_sigset_t __user *set)
1452
1453 #ifdef __ARCH_WANT_SYS_SIGPROCMASK
1454
1455 -asmlinkage long compat_sys_sigprocmask(int how, compat_old_sigset_t __user *set,
1456 - compat_old_sigset_t __user *oset)
1457 +/*
1458 + * sys_sigprocmask SIG_SETMASK sets the first (compat) word of the
1459 + * blocked set of signals to the supplied signal set
1460 + */
1461 +static inline void compat_sig_setmask(sigset_t *blocked, compat_sigset_word set)
1462 {
1463 - old_sigset_t s;
1464 - long ret;
1465 - mm_segment_t old_fs;
1466 + memcpy(blocked->sig, &set, sizeof(set));
1467 +}
1468
1469 - if (set && get_user(s, set))
1470 - return -EFAULT;
1471 - old_fs = get_fs();
1472 - set_fs(KERNEL_DS);
1473 - ret = sys_sigprocmask(how,
1474 - set ? (old_sigset_t __user *) &s : NULL,
1475 - oset ? (old_sigset_t __user *) &s : NULL);
1476 - set_fs(old_fs);
1477 - if (ret == 0)
1478 - if (oset)
1479 - ret = put_user(s, oset);
1480 - return ret;
1481 +asmlinkage long compat_sys_sigprocmask(int how,
1482 + compat_old_sigset_t __user *nset,
1483 + compat_old_sigset_t __user *oset)
1484 +{
1485 + old_sigset_t old_set, new_set;
1486 + sigset_t new_blocked;
1487 +
1488 + old_set = current->blocked.sig[0];
1489 +
1490 + if (nset) {
1491 + if (get_user(new_set, nset))
1492 + return -EFAULT;
1493 + new_set &= ~(sigmask(SIGKILL) | sigmask(SIGSTOP));
1494 +
1495 + new_blocked = current->blocked;
1496 +
1497 + switch (how) {
1498 + case SIG_BLOCK:
1499 + sigaddsetmask(&new_blocked, new_set);
1500 + break;
1501 + case SIG_UNBLOCK:
1502 + sigdelsetmask(&new_blocked, new_set);
1503 + break;
1504 + case SIG_SETMASK:
1505 + compat_sig_setmask(&new_blocked, new_set);
1506 + break;
1507 + default:
1508 + return -EINVAL;
1509 + }
1510 +
1511 + set_current_blocked(&new_blocked);
1512 + }
1513 +
1514 + if (oset) {
1515 + if (put_user(old_set, oset))
1516 + return -EFAULT;
1517 + }
1518 +
1519 + return 0;
1520 }
1521
1522 #endif
1523 diff --git a/kernel/fork.c b/kernel/fork.c
1524 index a4e453b..4712e3e 100644
1525 --- a/kernel/fork.c
1526 +++ b/kernel/fork.c
1527 @@ -48,6 +48,7 @@
1528 #include <linux/audit.h>
1529 #include <linux/memcontrol.h>
1530 #include <linux/ftrace.h>
1531 +#include <linux/proc_fs.h>
1532 #include <linux/profile.h>
1533 #include <linux/rmap.h>
1534 #include <linux/ksm.h>
1535 @@ -1378,6 +1379,8 @@ bad_fork_cleanup_io:
1536 if (p->io_context)
1537 exit_io_context(p);
1538 bad_fork_cleanup_namespaces:
1539 + if (unlikely(clone_flags & CLONE_NEWPID))
1540 + pid_ns_release_proc(p->nsproxy->pid_ns);
1541 exit_task_namespaces(p);
1542 bad_fork_cleanup_mm:
1543 if (p->mm) {
1544 diff --git a/mm/hugetlb.c b/mm/hugetlb.c
1545 index f7001ac..00b0abb 100644
1546 --- a/mm/hugetlb.c
1547 +++ b/mm/hugetlb.c
1548 @@ -2398,7 +2398,6 @@ retry_avoidcopy:
1549 if (outside_reserve) {
1550 BUG_ON(huge_pte_none(pte));
1551 if (unmap_ref_private(mm, vma, old_page, address)) {
1552 - BUG_ON(page_count(old_page) != 1);
1553 BUG_ON(huge_pte_none(pte));
1554 spin_lock(&mm->page_table_lock);
1555 goto retry_avoidcopy;
1556 diff --git a/mm/memcontrol.c b/mm/memcontrol.c
1557 index 283068f..ffb99b4 100644
1558 --- a/mm/memcontrol.c
1559 +++ b/mm/memcontrol.c
1560 @@ -4605,6 +4605,12 @@ static void mem_cgroup_usage_unregister_event(struct cgroup *cgrp,
1561 swap_buffers:
1562 /* Swap primary and spare array */
1563 thresholds->spare = thresholds->primary;
1564 + /* If all events are unregistered, free the spare array */
1565 + if (!new) {
1566 + kfree(thresholds->spare);
1567 + thresholds->spare = NULL;
1568 + }
1569 +
1570 rcu_assign_pointer(thresholds->primary, new);
1571
1572 /* To be sure that nobody uses thresholds */
1573 diff --git a/mm/nobootmem.c b/mm/nobootmem.c
1574 index 6e93dc7..e39e3ef 100644
1575 --- a/mm/nobootmem.c
1576 +++ b/mm/nobootmem.c
1577 @@ -83,8 +83,7 @@ void __init free_bootmem_late(unsigned long addr, unsigned long size)
1578
1579 static void __init __free_pages_memory(unsigned long start, unsigned long end)
1580 {
1581 - int i;
1582 - unsigned long start_aligned, end_aligned;
1583 + unsigned long i, start_aligned, end_aligned;
1584 int order = ilog2(BITS_PER_LONG);
1585
1586 start_aligned = (start + (BITS_PER_LONG - 1)) & ~(BITS_PER_LONG - 1);
1587 diff --git a/mm/percpu.c b/mm/percpu.c
1588 index 0ae7a09..af0cc7a 100644
1589 --- a/mm/percpu.c
1590 +++ b/mm/percpu.c
1591 @@ -1630,6 +1630,16 @@ int __init pcpu_embed_first_chunk(size_t reserved_size, size_t dyn_size,
1592 areas[group] = ptr;
1593
1594 base = min(ptr, base);
1595 + }
1596 +
1597 + /*
1598 + * Copy data and free unused parts. This should happen after all
1599 + * allocations are complete; otherwise, we may end up with
1600 + * overlapping groups.
1601 + */
1602 + for (group = 0; group < ai->nr_groups; group++) {
1603 + struct pcpu_group_info *gi = &ai->groups[group];
1604 + void *ptr = areas[group];
1605
1606 for (i = 0; i < gi->nr_units; i++, ptr += ai->unit_size) {
1607 if (gi->cpu_map[i] == NR_CPUS) {
1608 diff --git a/net/core/dev.c b/net/core/dev.c
1609 index f134f88..1e77897 100644
1610 --- a/net/core/dev.c
1611 +++ b/net/core/dev.c
1612 @@ -1406,14 +1406,34 @@ EXPORT_SYMBOL(register_netdevice_notifier);
1613 * register_netdevice_notifier(). The notifier is unlinked into the
1614 * kernel structures and may then be reused. A negative errno code
1615 * is returned on a failure.
1616 + *
1617 + * After unregistering unregister and down device events are synthesized
1618 + * for all devices on the device list to the removed notifier to remove
1619 + * the need for special case cleanup code.
1620 */
1621
1622 int unregister_netdevice_notifier(struct notifier_block *nb)
1623 {
1624 + struct net_device *dev;
1625 + struct net *net;
1626 int err;
1627
1628 rtnl_lock();
1629 err = raw_notifier_chain_unregister(&netdev_chain, nb);
1630 + if (err)
1631 + goto unlock;
1632 +
1633 + for_each_net(net) {
1634 + for_each_netdev(net, dev) {
1635 + if (dev->flags & IFF_UP) {
1636 + nb->notifier_call(nb, NETDEV_GOING_DOWN, dev);
1637 + nb->notifier_call(nb, NETDEV_DOWN, dev);
1638 + }
1639 + nb->notifier_call(nb, NETDEV_UNREGISTER, dev);
1640 + nb->notifier_call(nb, NETDEV_UNREGISTER_BATCH, dev);
1641 + }
1642 + }
1643 +unlock:
1644 rtnl_unlock();
1645 return err;
1646 }
1647 diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
1648 index 80b988f..6db041d 100644
1649 --- a/net/ipv4/tcp.c
1650 +++ b/net/ipv4/tcp.c
1651 @@ -850,8 +850,7 @@ new_segment:
1652 wait_for_sndbuf:
1653 set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
1654 wait_for_memory:
1655 - if (copied)
1656 - tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH);
1657 + tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH);
1658
1659 if ((err = sk_stream_wait_memory(sk, &timeo)) != 0)
1660 goto do_error;
1661 @@ -3221,7 +3220,7 @@ void __init tcp_init(void)
1662 {
1663 struct sk_buff *skb = NULL;
1664 unsigned long limit;
1665 - int i, max_share, cnt;
1666 + int i, max_rshare, max_wshare, cnt;
1667 unsigned long jiffy = jiffies;
1668
1669 BUILD_BUG_ON(sizeof(struct tcp_skb_cb) > sizeof(skb->cb));
1670 @@ -3285,15 +3284,16 @@ void __init tcp_init(void)
1671
1672 /* Set per-socket limits to no more than 1/128 the pressure threshold */
1673 limit = ((unsigned long)sysctl_tcp_mem[1]) << (PAGE_SHIFT - 7);
1674 - max_share = min(4UL*1024*1024, limit);
1675 + max_wshare = min(4UL*1024*1024, limit);
1676 + max_rshare = min(6UL*1024*1024, limit);
1677
1678 sysctl_tcp_wmem[0] = SK_MEM_QUANTUM;
1679 sysctl_tcp_wmem[1] = 16*1024;
1680 - sysctl_tcp_wmem[2] = max(64*1024, max_share);
1681 + sysctl_tcp_wmem[2] = max(64*1024, max_wshare);
1682
1683 sysctl_tcp_rmem[0] = SK_MEM_QUANTUM;
1684 sysctl_tcp_rmem[1] = 87380;
1685 - sysctl_tcp_rmem[2] = max(87380, max_share);
1686 + sysctl_tcp_rmem[2] = max(87380, max_rshare);
1687
1688 printk(KERN_INFO "TCP: Hash tables configured "
1689 "(established %u bind %u)\n",
1690 diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
1691 index c3a9f03..7410a8c 100644
1692 --- a/net/ipv4/tcp_input.c
1693 +++ b/net/ipv4/tcp_input.c
1694 @@ -83,7 +83,7 @@ int sysctl_tcp_ecn __read_mostly = 2;
1695 EXPORT_SYMBOL(sysctl_tcp_ecn);
1696 int sysctl_tcp_dsack __read_mostly = 1;
1697 int sysctl_tcp_app_win __read_mostly = 31;
1698 -int sysctl_tcp_adv_win_scale __read_mostly = 2;
1699 +int sysctl_tcp_adv_win_scale __read_mostly = 1;
1700 EXPORT_SYMBOL(sysctl_tcp_adv_win_scale);
1701
1702 int sysctl_tcp_stdurg __read_mostly;
1703 diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c
1704 index 858ca23..ea52d02 100644
1705 --- a/net/l2tp/l2tp_ip.c
1706 +++ b/net/l2tp/l2tp_ip.c
1707 @@ -441,8 +441,9 @@ static int l2tp_ip_sendmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *m
1708
1709 daddr = lip->l2tp_addr.s_addr;
1710 } else {
1711 + rc = -EDESTADDRREQ;
1712 if (sk->sk_state != TCP_ESTABLISHED)
1713 - return -EDESTADDRREQ;
1714 + goto out;
1715
1716 daddr = inet->inet_daddr;
1717 connected = 1;
1718 diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
1719 index 2f68459..945f3dd 100644
1720 --- a/net/sched/sch_netem.c
1721 +++ b/net/sched/sch_netem.c
1722 @@ -350,10 +350,8 @@ static int netem_enqueue(struct sk_buff *skb, struct Qdisc *sch)
1723 if (q->corrupt && q->corrupt >= get_crandom(&q->corrupt_cor)) {
1724 if (!(skb = skb_unshare(skb, GFP_ATOMIC)) ||
1725 (skb->ip_summed == CHECKSUM_PARTIAL &&
1726 - skb_checksum_help(skb))) {
1727 - sch->qstats.drops++;
1728 - return NET_XMIT_DROP;
1729 - }
1730 + skb_checksum_help(skb)))
1731 + return qdisc_drop(skb, sch);
1732
1733 skb->data[net_random() % skb_headlen(skb)] ^= 1<<(net_random() % 8);
1734 }
1735 diff --git a/sound/pci/echoaudio/echoaudio_dsp.c b/sound/pci/echoaudio/echoaudio_dsp.c
1736 index 64417a7..d8c670c 100644
1737 --- a/sound/pci/echoaudio/echoaudio_dsp.c
1738 +++ b/sound/pci/echoaudio/echoaudio_dsp.c
1739 @@ -475,7 +475,7 @@ static int load_firmware(struct echoaudio *chip)
1740 const struct firmware *fw;
1741 int box_type, err;
1742
1743 - if (snd_BUG_ON(!chip->dsp_code_to_load || !chip->comm_page))
1744 + if (snd_BUG_ON(!chip->comm_page))
1745 return -EPERM;
1746
1747 /* See if the ASIC is present and working - only if the DSP is already loaded */
1748 diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c
1749 index 981b6fd..c5c9788 100644
1750 --- a/sound/pci/hda/hda_intel.c
1751 +++ b/sound/pci/hda/hda_intel.c
1752 @@ -702,11 +702,13 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
1753 {
1754 struct azx *chip = bus->private_data;
1755 unsigned long timeout;
1756 + unsigned long loopcounter;
1757 int do_poll = 0;
1758
1759 again:
1760 timeout = jiffies + msecs_to_jiffies(1000);
1761 - for (;;) {
1762 +
1763 + for (loopcounter = 0;; loopcounter++) {
1764 if (chip->polling_mode || do_poll) {
1765 spin_lock_irq(&chip->reg_lock);
1766 azx_update_rirb(chip);
1767 @@ -722,7 +724,7 @@ static unsigned int azx_rirb_get_response(struct hda_bus *bus,
1768 }
1769 if (time_after(jiffies, timeout))
1770 break;
1771 - if (bus->needs_damn_long_delay)
1772 + if (bus->needs_damn_long_delay || loopcounter > 3000)
1773 msleep(2); /* temporary workaround */
1774 else {
1775 udelay(10);

  ViewVC Help
Powered by ViewVC 1.1.20