diff options
38 files changed, 264 insertions, 193 deletions
diff --git a/Documentation/local_ops.txt b/Documentation/local_ops.txt index 1a45f11e645e..4269a1105b37 100644 --- a/Documentation/local_ops.txt +++ b/Documentation/local_ops.txt | |||
@@ -68,29 +68,6 @@ typedef struct { atomic_long_t a; } local_t; | |||
68 | variable can be read when reading some _other_ cpu's variables. | 68 | variable can be read when reading some _other_ cpu's variables. |
69 | 69 | ||
70 | 70 | ||
71 | * Rules to follow when using local atomic operations | ||
72 | |||
73 | - Variables touched by local ops must be per cpu variables. | ||
74 | - _Only_ the CPU owner of these variables must write to them. | ||
75 | - This CPU can use local ops from any context (process, irq, softirq, nmi, ...) | ||
76 | to update its local_t variables. | ||
77 | - Preemption (or interrupts) must be disabled when using local ops in | ||
78 | process context to make sure the process won't be migrated to a | ||
79 | different CPU between getting the per-cpu variable and doing the | ||
80 | actual local op. | ||
81 | - When using local ops in interrupt context, no special care must be | ||
82 | taken on a mainline kernel, since they will run on the local CPU with | ||
83 | preemption already disabled. I suggest, however, to explicitly | ||
84 | disable preemption anyway to make sure it will still work correctly on | ||
85 | -rt kernels. | ||
86 | - Reading the local cpu variable will provide the current copy of the | ||
87 | variable. | ||
88 | - Reads of these variables can be done from any CPU, because updates to | ||
89 | "long", aligned, variables are always atomic. Since no memory | ||
90 | synchronization is done by the writer CPU, an outdated copy of the | ||
91 | variable can be read when reading some _other_ cpu's variables. | ||
92 | |||
93 | |||
94 | * How to use local atomic operations | 71 | * How to use local atomic operations |
95 | 72 | ||
96 | #include <linux/percpu.h> | 73 | #include <linux/percpu.h> |
diff --git a/arch/alpha/math-emu/math.c b/arch/alpha/math-emu/math.c index ae79dd970b02..58c2669a1dd4 100644 --- a/arch/alpha/math-emu/math.c +++ b/arch/alpha/math-emu/math.c | |||
@@ -225,7 +225,7 @@ alpha_fp_emul (unsigned long pc) | |||
225 | FP_UNPACK_SP(SB, &vb); | 225 | FP_UNPACK_SP(SB, &vb); |
226 | DR_c = DB_c; | 226 | DR_c = DB_c; |
227 | DR_s = DB_s; | 227 | DR_s = DB_s; |
228 | DR_e = DB_e; | 228 | DR_e = DB_e + (1024 - 128); |
229 | DR_f = SB_f << (52 - 23); | 229 | DR_f = SB_f << (52 - 23); |
230 | goto pack_d; | 230 | goto pack_d; |
231 | } | 231 | } |
diff --git a/arch/cris/arch-v10/vmlinux.lds.S b/arch/cris/arch-v10/vmlinux.lds.S index 9859d49d088b..97a7876ed681 100644 --- a/arch/cris/arch-v10/vmlinux.lds.S +++ b/arch/cris/arch-v10/vmlinux.lds.S | |||
@@ -9,7 +9,8 @@ | |||
9 | */ | 9 | */ |
10 | 10 | ||
11 | #include <asm-generic/vmlinux.lds.h> | 11 | #include <asm-generic/vmlinux.lds.h> |
12 | 12 | #include <asm/page.h> | |
13 | |||
13 | jiffies = jiffies_64; | 14 | jiffies = jiffies_64; |
14 | SECTIONS | 15 | SECTIONS |
15 | { | 16 | { |
@@ -23,7 +24,7 @@ SECTIONS | |||
23 | _stext = .; | 24 | _stext = .; |
24 | __stext = .; | 25 | __stext = .; |
25 | .text : { | 26 | .text : { |
26 | *(.text) | 27 | TEXT_TEXT |
27 | SCHED_TEXT | 28 | SCHED_TEXT |
28 | LOCK_TEXT | 29 | LOCK_TEXT |
29 | *(.fixup) | 30 | *(.fixup) |
@@ -49,10 +50,10 @@ SECTIONS | |||
49 | __edata = . ; /* End of data section */ | 50 | __edata = . ; /* End of data section */ |
50 | _edata = . ; | 51 | _edata = . ; |
51 | 52 | ||
52 | . = ALIGN(8192); /* init_task and stack, must be aligned */ | 53 | . = ALIGN(PAGE_SIZE); /* init_task and stack, must be aligned */ |
53 | .data.init_task : { *(.data.init_task) } | 54 | .data.init_task : { *(.data.init_task) } |
54 | 55 | ||
55 | . = ALIGN(8192); /* Init code and data */ | 56 | . = ALIGN(PAGE_SIZE); /* Init code and data */ |
56 | __init_begin = .; | 57 | __init_begin = .; |
57 | .init.text : { | 58 | .init.text : { |
58 | _sinittext = .; | 59 | _sinittext = .; |
@@ -66,13 +67,7 @@ SECTIONS | |||
66 | __setup_end = .; | 67 | __setup_end = .; |
67 | .initcall.init : { | 68 | .initcall.init : { |
68 | __initcall_start = .; | 69 | __initcall_start = .; |
69 | *(.initcall1.init); | 70 | INITCALLS |
70 | *(.initcall2.init); | ||
71 | *(.initcall3.init); | ||
72 | *(.initcall4.init); | ||
73 | *(.initcall5.init); | ||
74 | *(.initcall6.init); | ||
75 | *(.initcall7.init); | ||
76 | __initcall_end = .; | 71 | __initcall_end = .; |
77 | } | 72 | } |
78 | 73 | ||
@@ -88,16 +83,18 @@ SECTIONS | |||
88 | __initramfs_start = .; | 83 | __initramfs_start = .; |
89 | *(.init.ramfs) | 84 | *(.init.ramfs) |
90 | __initramfs_end = .; | 85 | __initramfs_end = .; |
91 | /* We fill to the next page, so we can discard all init | ||
92 | pages without needing to consider what payload might be | ||
93 | appended to the kernel image. */ | ||
94 | FILL (0); | ||
95 | . = ALIGN (8192); | ||
96 | } | 86 | } |
97 | #endif | 87 | #endif |
98 | |||
99 | __vmlinux_end = .; /* last address of the physical file */ | 88 | __vmlinux_end = .; /* last address of the physical file */ |
100 | __init_end = .; | 89 | |
90 | /* | ||
91 | * We fill to the next page, so we can discard all init | ||
92 | * pages without needing to consider what payload might be | ||
93 | * appended to the kernel image. | ||
94 | */ | ||
95 | . = ALIGN(PAGE_SIZE); | ||
96 | |||
97 | __init_end = .; | ||
101 | 98 | ||
102 | __data_end = . ; /* Move to _edata ? */ | 99 | __data_end = . ; /* Move to _edata ? */ |
103 | __bss_start = .; /* BSS */ | 100 | __bss_start = .; /* BSS */ |
diff --git a/arch/sparc64/kernel/sun4v_tlb_miss.S b/arch/sparc64/kernel/sun4v_tlb_miss.S index 9871dbb1ab42..fd9430562e0b 100644 --- a/arch/sparc64/kernel/sun4v_tlb_miss.S +++ b/arch/sparc64/kernel/sun4v_tlb_miss.S | |||
@@ -215,6 +215,7 @@ sun4v_itlb_error: | |||
215 | 215 | ||
216 | 1: ba,pt %xcc, etrap | 216 | 1: ba,pt %xcc, etrap |
217 | 2: or %g7, %lo(2b), %g7 | 217 | 2: or %g7, %lo(2b), %g7 |
218 | mov %l4, %o1 | ||
218 | call sun4v_itlb_error_report | 219 | call sun4v_itlb_error_report |
219 | add %sp, PTREGS_OFF, %o0 | 220 | add %sp, PTREGS_OFF, %o0 |
220 | 221 | ||
@@ -241,6 +242,7 @@ sun4v_dtlb_error: | |||
241 | 242 | ||
242 | 1: ba,pt %xcc, etrap | 243 | 1: ba,pt %xcc, etrap |
243 | 2: or %g7, %lo(2b), %g7 | 244 | 2: or %g7, %lo(2b), %g7 |
245 | mov %l4, %o1 | ||
244 | call sun4v_dtlb_error_report | 246 | call sun4v_dtlb_error_report |
245 | add %sp, PTREGS_OFF, %o0 | 247 | add %sp, PTREGS_OFF, %o0 |
246 | 248 | ||
diff --git a/arch/sparc64/kernel/traps.c b/arch/sparc64/kernel/traps.c index 04998388259f..2b6abf633343 100644 --- a/arch/sparc64/kernel/traps.c +++ b/arch/sparc64/kernel/traps.c | |||
@@ -1950,6 +1950,8 @@ void sun4v_itlb_error_report(struct pt_regs *regs, int tl) | |||
1950 | printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n", | 1950 | printk(KERN_EMERG "SUN4V-ITLB: Error at TPC[%lx], tl %d\n", |
1951 | regs->tpc, tl); | 1951 | regs->tpc, tl); |
1952 | print_symbol(KERN_EMERG "SUN4V-ITLB: TPC<%s>\n", regs->tpc); | 1952 | print_symbol(KERN_EMERG "SUN4V-ITLB: TPC<%s>\n", regs->tpc); |
1953 | printk(KERN_EMERG "SUN4V-ITLB: O7[%lx]\n", regs->u_regs[UREG_I7]); | ||
1954 | print_symbol(KERN_EMERG "SUN4V-ITLB: O7<%s>\n", regs->u_regs[UREG_I7]); | ||
1953 | printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] " | 1955 | printk(KERN_EMERG "SUN4V-ITLB: vaddr[%lx] ctx[%lx] " |
1954 | "pte[%lx] error[%lx]\n", | 1956 | "pte[%lx] error[%lx]\n", |
1955 | sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx, | 1957 | sun4v_err_itlb_vaddr, sun4v_err_itlb_ctx, |
@@ -1971,6 +1973,8 @@ void sun4v_dtlb_error_report(struct pt_regs *regs, int tl) | |||
1971 | printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n", | 1973 | printk(KERN_EMERG "SUN4V-DTLB: Error at TPC[%lx], tl %d\n", |
1972 | regs->tpc, tl); | 1974 | regs->tpc, tl); |
1973 | print_symbol(KERN_EMERG "SUN4V-DTLB: TPC<%s>\n", regs->tpc); | 1975 | print_symbol(KERN_EMERG "SUN4V-DTLB: TPC<%s>\n", regs->tpc); |
1976 | printk(KERN_EMERG "SUN4V-DTLB: O7[%lx]\n", regs->u_regs[UREG_I7]); | ||
1977 | print_symbol(KERN_EMERG "SUN4V-DTLB: O7<%s>\n", regs->u_regs[UREG_I7]); | ||
1974 | printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] " | 1978 | printk(KERN_EMERG "SUN4V-DTLB: vaddr[%lx] ctx[%lx] " |
1975 | "pte[%lx] error[%lx]\n", | 1979 | "pte[%lx] error[%lx]\n", |
1976 | sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx, | 1980 | sun4v_err_dtlb_vaddr, sun4v_err_dtlb_ctx, |
diff --git a/arch/x86/kernel/traps_32.c b/arch/x86/kernel/traps_32.c index c88bbffcaa03..02d1e1e58e81 100644 --- a/arch/x86/kernel/traps_32.c +++ b/arch/x86/kernel/traps_32.c | |||
@@ -541,6 +541,7 @@ fastcall void do_##name(struct pt_regs * regs, long error_code) \ | |||
541 | info.si_errno = 0; \ | 541 | info.si_errno = 0; \ |
542 | info.si_code = sicode; \ | 542 | info.si_code = sicode; \ |
543 | info.si_addr = (void __user *)siaddr; \ | 543 | info.si_addr = (void __user *)siaddr; \ |
544 | trace_hardirqs_fixup(); \ | ||
544 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ | 545 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ |
545 | == NOTIFY_STOP) \ | 546 | == NOTIFY_STOP) \ |
546 | return; \ | 547 | return; \ |
diff --git a/arch/x86/kernel/traps_64.c b/arch/x86/kernel/traps_64.c index d11525ad81b4..cc68b92316cd 100644 --- a/arch/x86/kernel/traps_64.c +++ b/arch/x86/kernel/traps_64.c | |||
@@ -635,6 +635,7 @@ asmlinkage void do_##name(struct pt_regs * regs, long error_code) \ | |||
635 | info.si_errno = 0; \ | 635 | info.si_errno = 0; \ |
636 | info.si_code = sicode; \ | 636 | info.si_code = sicode; \ |
637 | info.si_addr = (void __user *)siaddr; \ | 637 | info.si_addr = (void __user *)siaddr; \ |
638 | trace_hardirqs_fixup(); \ | ||
638 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ | 639 | if (notify_die(DIE_TRAP, str, regs, error_code, trapnr, signr) \ |
639 | == NOTIFY_STOP) \ | 640 | == NOTIFY_STOP) \ |
640 | return; \ | 641 | return; \ |
diff --git a/drivers/cpufreq/cpufreq_conservative.c b/drivers/cpufreq/cpufreq_conservative.c index 1bba99747f5b..5d3a04ba6ad2 100644 --- a/drivers/cpufreq/cpufreq_conservative.c +++ b/drivers/cpufreq/cpufreq_conservative.c | |||
@@ -603,5 +603,9 @@ MODULE_DESCRIPTION ("'cpufreq_conservative' - A dynamic cpufreq governor for " | |||
603 | "optimised for use in a battery environment"); | 603 | "optimised for use in a battery environment"); |
604 | MODULE_LICENSE ("GPL"); | 604 | MODULE_LICENSE ("GPL"); |
605 | 605 | ||
606 | #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_CONSERVATIVE | ||
607 | fs_initcall(cpufreq_gov_dbs_init); | ||
608 | #else | ||
606 | module_init(cpufreq_gov_dbs_init); | 609 | module_init(cpufreq_gov_dbs_init); |
610 | #endif | ||
607 | module_exit(cpufreq_gov_dbs_exit); | 611 | module_exit(cpufreq_gov_dbs_exit); |
diff --git a/drivers/cpufreq/cpufreq_ondemand.c b/drivers/cpufreq/cpufreq_ondemand.c index 369f44595150..d2af20dda382 100644 --- a/drivers/cpufreq/cpufreq_ondemand.c +++ b/drivers/cpufreq/cpufreq_ondemand.c | |||
@@ -610,6 +610,9 @@ MODULE_DESCRIPTION("'cpufreq_ondemand' - A dynamic cpufreq governor for " | |||
610 | "Low Latency Frequency Transition capable processors"); | 610 | "Low Latency Frequency Transition capable processors"); |
611 | MODULE_LICENSE("GPL"); | 611 | MODULE_LICENSE("GPL"); |
612 | 612 | ||
613 | #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_ONDEMAND | ||
614 | fs_initcall(cpufreq_gov_dbs_init); | ||
615 | #else | ||
613 | module_init(cpufreq_gov_dbs_init); | 616 | module_init(cpufreq_gov_dbs_init); |
617 | #endif | ||
614 | module_exit(cpufreq_gov_dbs_exit); | 618 | module_exit(cpufreq_gov_dbs_exit); |
615 | |||
diff --git a/drivers/cpufreq/cpufreq_userspace.c b/drivers/cpufreq/cpufreq_userspace.c index 51bedab6c808..f8cdde4bf6cd 100644 --- a/drivers/cpufreq/cpufreq_userspace.c +++ b/drivers/cpufreq/cpufreq_userspace.c | |||
@@ -231,5 +231,9 @@ MODULE_AUTHOR ("Dominik Brodowski <linux@brodo.de>, Russell King <rmk@arm.linux. | |||
231 | MODULE_DESCRIPTION ("CPUfreq policy governor 'userspace'"); | 231 | MODULE_DESCRIPTION ("CPUfreq policy governor 'userspace'"); |
232 | MODULE_LICENSE ("GPL"); | 232 | MODULE_LICENSE ("GPL"); |
233 | 233 | ||
234 | #ifdef CONFIG_CPU_FREQ_DEFAULT_GOV_USERSPACE | ||
234 | fs_initcall(cpufreq_gov_userspace_init); | 235 | fs_initcall(cpufreq_gov_userspace_init); |
236 | #else | ||
237 | module_init(cpufreq_gov_userspace_init); | ||
238 | #endif | ||
235 | module_exit(cpufreq_gov_userspace_exit); | 239 | module_exit(cpufreq_gov_userspace_exit); |
diff --git a/drivers/input/mouse/alps.c b/drivers/input/mouse/alps.c index 2b5ed119c9a9..b346a3b418ea 100644 --- a/drivers/input/mouse/alps.c +++ b/drivers/input/mouse/alps.c | |||
@@ -54,7 +54,7 @@ static const struct alps_model_info alps_model_data[] = { | |||
54 | { { 0x20, 0x02, 0x0e }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* XXX */ | 54 | { { 0x20, 0x02, 0x0e }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, /* XXX */ |
55 | { { 0x22, 0x02, 0x0a }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, | 55 | { { 0x22, 0x02, 0x0a }, 0xf8, 0xf8, ALPS_PASS | ALPS_DUALPOINT }, |
56 | { { 0x22, 0x02, 0x14 }, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D600 */ | 56 | { { 0x22, 0x02, 0x14 }, 0xff, 0xff, ALPS_PASS | ALPS_DUALPOINT }, /* Dell Latitude D600 */ |
57 | { { 0x73, 0x02, 0x50 }, 0xcf, 0xff, ALPS_FW_BK_1 } /* Dell Vostro 1400 */ | 57 | { { 0x73, 0x02, 0x50 }, 0xcf, 0xcf, ALPS_FW_BK_1 } /* Dell Vostro 1400 */ |
58 | }; | 58 | }; |
59 | 59 | ||
60 | /* | 60 | /* |
diff --git a/drivers/input/mouse/lifebook.c b/drivers/input/mouse/lifebook.c index 9ec57d80186e..df81b0aaa9f8 100644 --- a/drivers/input/mouse/lifebook.c +++ b/drivers/input/mouse/lifebook.c | |||
@@ -225,8 +225,13 @@ static void lifebook_set_resolution(struct psmouse *psmouse, unsigned int resolu | |||
225 | 225 | ||
226 | static void lifebook_disconnect(struct psmouse *psmouse) | 226 | static void lifebook_disconnect(struct psmouse *psmouse) |
227 | { | 227 | { |
228 | struct lifebook_data *priv = psmouse->private; | ||
229 | |||
228 | psmouse_reset(psmouse); | 230 | psmouse_reset(psmouse); |
229 | kfree(psmouse->private); | 231 | if (priv) { |
232 | input_unregister_device(priv->dev2); | ||
233 | kfree(priv); | ||
234 | } | ||
230 | psmouse->private = NULL; | 235 | psmouse->private = NULL; |
231 | } | 236 | } |
232 | 237 | ||
diff --git a/drivers/input/mouse/psmouse-base.c b/drivers/input/mouse/psmouse-base.c index 21a9c0b69a1f..b8628252e10c 100644 --- a/drivers/input/mouse/psmouse-base.c +++ b/drivers/input/mouse/psmouse-base.c | |||
@@ -1247,6 +1247,8 @@ static int psmouse_connect(struct serio *serio, struct serio_driver *drv) | |||
1247 | err_pt_deactivate: | 1247 | err_pt_deactivate: |
1248 | if (parent && parent->pt_deactivate) | 1248 | if (parent && parent->pt_deactivate) |
1249 | parent->pt_deactivate(parent); | 1249 | parent->pt_deactivate(parent); |
1250 | input_unregister_device(psmouse->dev); | ||
1251 | input_dev = NULL; /* so we don't try to free it below */ | ||
1250 | err_protocol_disconnect: | 1252 | err_protocol_disconnect: |
1251 | if (psmouse->disconnect) | 1253 | if (psmouse->disconnect) |
1252 | psmouse->disconnect(psmouse); | 1254 | psmouse->disconnect(psmouse); |
diff --git a/drivers/input/mousedev.c b/drivers/input/mousedev.c index 78c3ea75da2a..be83516c776c 100644 --- a/drivers/input/mousedev.c +++ b/drivers/input/mousedev.c | |||
@@ -1029,6 +1029,15 @@ static const struct input_device_id mousedev_ids[] = { | |||
1029 | BIT_MASK(ABS_PRESSURE) | | 1029 | BIT_MASK(ABS_PRESSURE) | |
1030 | BIT_MASK(ABS_TOOL_WIDTH) }, | 1030 | BIT_MASK(ABS_TOOL_WIDTH) }, |
1031 | }, /* A touchpad */ | 1031 | }, /* A touchpad */ |
1032 | { | ||
1033 | .flags = INPUT_DEVICE_ID_MATCH_EVBIT | | ||
1034 | INPUT_DEVICE_ID_MATCH_KEYBIT | | ||
1035 | INPUT_DEVICE_ID_MATCH_ABSBIT, | ||
1036 | .evbit = { BIT(EV_KEY) | BIT(EV_ABS) | BIT(EV_SYN) }, | ||
1037 | .keybit = { [BIT_WORD(BTN_LEFT)] = BIT_MASK(BTN_LEFT) }, | ||
1038 | .absbit = { BIT_MASK(ABS_X) | BIT_MASK(ABS_Y) }, | ||
1039 | }, /* Mouse-like device with absolute X and Y but ordinary | ||
1040 | clicks, like hp ILO2 High Performance mouse */ | ||
1032 | 1041 | ||
1033 | { }, /* Terminating entry */ | 1042 | { }, /* Terminating entry */ |
1034 | }; | 1043 | }; |
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 19055e7381f8..63f9664a066f 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c | |||
@@ -11,6 +11,7 @@ | |||
11 | * - DMC TSC-10/25 | 11 | * - DMC TSC-10/25 |
12 | * - IRTOUCHSYSTEMS/UNITOP | 12 | * - IRTOUCHSYSTEMS/UNITOP |
13 | * - IdealTEK URTC1000 | 13 | * - IdealTEK URTC1000 |
14 | * - General Touch | ||
14 | * - GoTop Super_Q2/GogoPen/PenPower tablets | 15 | * - GoTop Super_Q2/GogoPen/PenPower tablets |
15 | * | 16 | * |
16 | * Copyright (C) 2004-2007 by Daniel Ritz <daniel.ritz@gmx.ch> | 17 | * Copyright (C) 2004-2007 by Daniel Ritz <daniel.ritz@gmx.ch> |
@@ -50,7 +51,7 @@ | |||
50 | #include <linux/usb/input.h> | 51 | #include <linux/usb/input.h> |
51 | 52 | ||
52 | 53 | ||
53 | #define DRIVER_VERSION "v0.5" | 54 | #define DRIVER_VERSION "v0.6" |
54 | #define DRIVER_AUTHOR "Daniel Ritz <daniel.ritz@gmx.ch>" | 55 | #define DRIVER_AUTHOR "Daniel Ritz <daniel.ritz@gmx.ch>" |
55 | #define DRIVER_DESC "USB Touchscreen Driver" | 56 | #define DRIVER_DESC "USB Touchscreen Driver" |
56 | 57 | ||
@@ -65,17 +66,21 @@ struct usbtouch_device_info { | |||
65 | int min_yc, max_yc; | 66 | int min_yc, max_yc; |
66 | int min_press, max_press; | 67 | int min_press, max_press; |
67 | int rept_size; | 68 | int rept_size; |
68 | int flags; | ||
69 | 69 | ||
70 | void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len); | 70 | void (*process_pkt) (struct usbtouch_usb *usbtouch, unsigned char *pkt, int len); |
71 | |||
72 | /* | ||
73 | * used to get the packet len. possible return values: | ||
74 | * > 0: packet len | ||
75 | * = 0: skip one byte | ||
76 | * < 0: -return value more bytes needed | ||
77 | */ | ||
71 | int (*get_pkt_len) (unsigned char *pkt, int len); | 78 | int (*get_pkt_len) (unsigned char *pkt, int len); |
79 | |||
72 | int (*read_data) (struct usbtouch_usb *usbtouch, unsigned char *pkt); | 80 | int (*read_data) (struct usbtouch_usb *usbtouch, unsigned char *pkt); |
73 | int (*init) (struct usbtouch_usb *usbtouch); | 81 | int (*init) (struct usbtouch_usb *usbtouch); |
74 | }; | 82 | }; |
75 | 83 | ||
76 | #define USBTOUCH_FLG_BUFFER 0x01 | ||
77 | |||
78 | |||
79 | /* a usbtouch device */ | 84 | /* a usbtouch device */ |
80 | struct usbtouch_usb { | 85 | struct usbtouch_usb { |
81 | unsigned char *data; | 86 | unsigned char *data; |
@@ -94,15 +99,6 @@ struct usbtouch_usb { | |||
94 | }; | 99 | }; |
95 | 100 | ||
96 | 101 | ||
97 | #if defined(CONFIG_TOUCHSCREEN_USB_EGALAX) || defined(CONFIG_TOUCHSCREEN_USB_ETURBO) || defined(CONFIG_TOUCHSCREEN_USB_IDEALTEK) | ||
98 | #define MULTI_PACKET | ||
99 | #endif | ||
100 | |||
101 | #ifdef MULTI_PACKET | ||
102 | static void usbtouch_process_multi(struct usbtouch_usb *usbtouch, | ||
103 | unsigned char *pkt, int len); | ||
104 | #endif | ||
105 | |||
106 | /* device types */ | 102 | /* device types */ |
107 | enum { | 103 | enum { |
108 | DEVTPYE_DUMMY = -1, | 104 | DEVTPYE_DUMMY = -1, |
@@ -186,6 +182,10 @@ static struct usb_device_id usbtouch_devices[] = { | |||
186 | 182 | ||
187 | #ifdef CONFIG_TOUCHSCREEN_USB_EGALAX | 183 | #ifdef CONFIG_TOUCHSCREEN_USB_EGALAX |
188 | 184 | ||
185 | #ifndef MULTI_PACKET | ||
186 | #define MULTI_PACKET | ||
187 | #endif | ||
188 | |||
189 | #define EGALAX_PKT_TYPE_MASK 0xFE | 189 | #define EGALAX_PKT_TYPE_MASK 0xFE |
190 | #define EGALAX_PKT_TYPE_REPT 0x80 | 190 | #define EGALAX_PKT_TYPE_REPT 0x80 |
191 | #define EGALAX_PKT_TYPE_DIAG 0x0A | 191 | #define EGALAX_PKT_TYPE_DIAG 0x0A |
@@ -323,6 +323,9 @@ static int itm_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | |||
323 | * eTurboTouch part | 323 | * eTurboTouch part |
324 | */ | 324 | */ |
325 | #ifdef CONFIG_TOUCHSCREEN_USB_ETURBO | 325 | #ifdef CONFIG_TOUCHSCREEN_USB_ETURBO |
326 | #ifndef MULTI_PACKET | ||
327 | #define MULTI_PACKET | ||
328 | #endif | ||
326 | static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | 329 | static int eturbo_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
327 | { | 330 | { |
328 | unsigned int shift; | 331 | unsigned int shift; |
@@ -461,6 +464,9 @@ static int irtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | |||
461 | * IdealTEK URTC1000 Part | 464 | * IdealTEK URTC1000 Part |
462 | */ | 465 | */ |
463 | #ifdef CONFIG_TOUCHSCREEN_USB_IDEALTEK | 466 | #ifdef CONFIG_TOUCHSCREEN_USB_IDEALTEK |
467 | #ifndef MULTI_PACKET | ||
468 | #define MULTI_PACKET | ||
469 | #endif | ||
464 | static int idealtek_get_pkt_len(unsigned char *buf, int len) | 470 | static int idealtek_get_pkt_len(unsigned char *buf, int len) |
465 | { | 471 | { |
466 | if (buf[0] & 0x80) | 472 | if (buf[0] & 0x80) |
@@ -525,6 +531,11 @@ static int gotop_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | |||
525 | /***************************************************************************** | 531 | /***************************************************************************** |
526 | * the different device descriptors | 532 | * the different device descriptors |
527 | */ | 533 | */ |
534 | #ifdef MULTI_PACKET | ||
535 | static void usbtouch_process_multi(struct usbtouch_usb *usbtouch, | ||
536 | unsigned char *pkt, int len); | ||
537 | #endif | ||
538 | |||
528 | static struct usbtouch_device_info usbtouch_dev_info[] = { | 539 | static struct usbtouch_device_info usbtouch_dev_info[] = { |
529 | #ifdef CONFIG_TOUCHSCREEN_USB_EGALAX | 540 | #ifdef CONFIG_TOUCHSCREEN_USB_EGALAX |
530 | [DEVTYPE_EGALAX] = { | 541 | [DEVTYPE_EGALAX] = { |
@@ -533,7 +544,6 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { | |||
533 | .min_yc = 0x0, | 544 | .min_yc = 0x0, |
534 | .max_yc = 0x07ff, | 545 | .max_yc = 0x07ff, |
535 | .rept_size = 16, | 546 | .rept_size = 16, |
536 | .flags = USBTOUCH_FLG_BUFFER, | ||
537 | .process_pkt = usbtouch_process_multi, | 547 | .process_pkt = usbtouch_process_multi, |
538 | .get_pkt_len = egalax_get_pkt_len, | 548 | .get_pkt_len = egalax_get_pkt_len, |
539 | .read_data = egalax_read_data, | 549 | .read_data = egalax_read_data, |
@@ -582,7 +592,6 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { | |||
582 | .min_yc = 0x0, | 592 | .min_yc = 0x0, |
583 | .max_yc = 0x07ff, | 593 | .max_yc = 0x07ff, |
584 | .rept_size = 8, | 594 | .rept_size = 8, |
585 | .flags = USBTOUCH_FLG_BUFFER, | ||
586 | .process_pkt = usbtouch_process_multi, | 595 | .process_pkt = usbtouch_process_multi, |
587 | .get_pkt_len = eturbo_get_pkt_len, | 596 | .get_pkt_len = eturbo_get_pkt_len, |
588 | .read_data = eturbo_read_data, | 597 | .read_data = eturbo_read_data, |
@@ -630,7 +639,6 @@ static struct usbtouch_device_info usbtouch_dev_info[] = { | |||
630 | .min_yc = 0x0, | 639 | .min_yc = 0x0, |
631 | .max_yc = 0x0fff, | 640 | .max_yc = 0x0fff, |
632 | .rept_size = 8, | 641 | .rept_size = 8, |
633 | .flags = USBTOUCH_FLG_BUFFER, | ||
634 | .process_pkt = usbtouch_process_multi, | 642 | .process_pkt = usbtouch_process_multi, |
635 | .get_pkt_len = idealtek_get_pkt_len, | 643 | .get_pkt_len = idealtek_get_pkt_len, |
636 | .read_data = idealtek_read_data, | 644 | .read_data = idealtek_read_data, |
@@ -738,11 +746,14 @@ static void usbtouch_process_multi(struct usbtouch_usb *usbtouch, | |||
738 | pos = 0; | 746 | pos = 0; |
739 | while (pos < buf_len) { | 747 | while (pos < buf_len) { |
740 | /* get packet len */ | 748 | /* get packet len */ |
741 | pkt_len = usbtouch->type->get_pkt_len(buffer + pos, len); | 749 | pkt_len = usbtouch->type->get_pkt_len(buffer + pos, |
750 | buf_len - pos); | ||
742 | 751 | ||
743 | /* unknown packet: drop everything */ | 752 | /* unknown packet: skip one byte */ |
744 | if (unlikely(!pkt_len)) | 753 | if (unlikely(!pkt_len)) { |
745 | goto out_flush_buf; | 754 | pos++; |
755 | continue; | ||
756 | } | ||
746 | 757 | ||
747 | /* full packet: process */ | 758 | /* full packet: process */ |
748 | if (likely((pkt_len > 0) && (pkt_len <= buf_len - pos))) { | 759 | if (likely((pkt_len > 0) && (pkt_len <= buf_len - pos))) { |
@@ -857,7 +868,7 @@ static int usbtouch_probe(struct usb_interface *intf, | |||
857 | if (!usbtouch->data) | 868 | if (!usbtouch->data) |
858 | goto out_free; | 869 | goto out_free; |
859 | 870 | ||
860 | if (type->flags & USBTOUCH_FLG_BUFFER) { | 871 | if (type->get_pkt_len) { |
861 | usbtouch->buffer = kmalloc(type->rept_size, GFP_KERNEL); | 872 | usbtouch->buffer = kmalloc(type->rept_size, GFP_KERNEL); |
862 | if (!usbtouch->buffer) | 873 | if (!usbtouch->buffer) |
863 | goto out_free_buffers; | 874 | goto out_free_buffers; |
diff --git a/drivers/media/video/saa7134/saa7134-core.c b/drivers/media/video/saa7134/saa7134-core.c index 4fd187ac9d70..4f0a9157ecb1 100644 --- a/drivers/media/video/saa7134/saa7134-core.c +++ b/drivers/media/video/saa7134/saa7134-core.c | |||
@@ -1202,9 +1202,8 @@ static int saa7134_suspend(struct pci_dev *pci_dev , pm_message_t state) | |||
1202 | 1202 | ||
1203 | static int saa7134_resume(struct pci_dev *pci_dev) | 1203 | static int saa7134_resume(struct pci_dev *pci_dev) |
1204 | { | 1204 | { |
1205 | |||
1206 | struct saa7134_dev *dev = pci_get_drvdata(pci_dev); | 1205 | struct saa7134_dev *dev = pci_get_drvdata(pci_dev); |
1207 | unsigned int flags; | 1206 | unsigned long flags; |
1208 | 1207 | ||
1209 | pci_restore_state(pci_dev); | 1208 | pci_restore_state(pci_dev); |
1210 | pci_set_power_state(pci_dev, PCI_D0); | 1209 | pci_set_power_state(pci_dev, PCI_D0); |
diff --git a/drivers/net/Kconfig b/drivers/net/Kconfig index 114771a2a133..9ae3166e3162 100644 --- a/drivers/net/Kconfig +++ b/drivers/net/Kconfig | |||
@@ -1976,9 +1976,6 @@ config E1000E | |||
1976 | 1976 | ||
1977 | <http://support.intel.com> | 1977 | <http://support.intel.com> |
1978 | 1978 | ||
1979 | More specific information on configuring the driver is in | ||
1980 | <file:Documentation/networking/e1000e.txt>. | ||
1981 | |||
1982 | To compile this driver as a module, choose M here. The module | 1979 | To compile this driver as a module, choose M here. The module |
1983 | will be called e1000e. | 1980 | will be called e1000e. |
1984 | 1981 | ||
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 25b8dbf6cfd7..b57bc9467dbe 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
@@ -979,7 +979,7 @@ static void alb_swap_mac_addr(struct bonding *bond, struct slave *slave1, struct | |||
979 | /* | 979 | /* |
980 | * Send learning packets after MAC address swap. | 980 | * Send learning packets after MAC address swap. |
981 | * | 981 | * |
982 | * Called with RTNL and bond->lock held for read. | 982 | * Called with RTNL and no other locks |
983 | */ | 983 | */ |
984 | static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1, | 984 | static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1, |
985 | struct slave *slave2) | 985 | struct slave *slave2) |
@@ -987,6 +987,8 @@ static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1, | |||
987 | int slaves_state_differ = (SLAVE_IS_OK(slave1) != SLAVE_IS_OK(slave2)); | 987 | int slaves_state_differ = (SLAVE_IS_OK(slave1) != SLAVE_IS_OK(slave2)); |
988 | struct slave *disabled_slave = NULL; | 988 | struct slave *disabled_slave = NULL; |
989 | 989 | ||
990 | ASSERT_RTNL(); | ||
991 | |||
990 | /* fasten the change in the switch */ | 992 | /* fasten the change in the switch */ |
991 | if (SLAVE_IS_OK(slave1)) { | 993 | if (SLAVE_IS_OK(slave1)) { |
992 | alb_send_learning_packets(slave1, slave1->dev->dev_addr); | 994 | alb_send_learning_packets(slave1, slave1->dev->dev_addr); |
@@ -1031,7 +1033,7 @@ static void alb_fasten_mac_swap(struct bonding *bond, struct slave *slave1, | |||
1031 | * a slave that has @slave's permanet address as its current address. | 1033 | * a slave that has @slave's permanet address as its current address. |
1032 | * We'll make sure that that slave no longer uses @slave's permanent address. | 1034 | * We'll make sure that that slave no longer uses @slave's permanent address. |
1033 | * | 1035 | * |
1034 | * Caller must hold bond lock | 1036 | * Caller must hold RTNL and no other locks |
1035 | */ | 1037 | */ |
1036 | static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *slave) | 1038 | static void alb_change_hw_addr_on_detach(struct bonding *bond, struct slave *slave) |
1037 | { | 1039 | { |
@@ -1542,7 +1544,12 @@ int bond_alb_init_slave(struct bonding *bond, struct slave *slave) | |||
1542 | return 0; | 1544 | return 0; |
1543 | } | 1545 | } |
1544 | 1546 | ||
1545 | /* Caller must hold bond lock for write */ | 1547 | /* |
1548 | * Remove slave from tlb and rlb hash tables, and fix up MAC addresses | ||
1549 | * if necessary. | ||
1550 | * | ||
1551 | * Caller must hold RTNL and no other locks | ||
1552 | */ | ||
1546 | void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave) | 1553 | void bond_alb_deinit_slave(struct bonding *bond, struct slave *slave) |
1547 | { | 1554 | { |
1548 | if (bond->slave_cnt > 1) { | 1555 | if (bond->slave_cnt > 1) { |
@@ -1601,9 +1608,6 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave | |||
1601 | struct slave *swap_slave; | 1608 | struct slave *swap_slave; |
1602 | int i; | 1609 | int i; |
1603 | 1610 | ||
1604 | if (new_slave) | ||
1605 | ASSERT_RTNL(); | ||
1606 | |||
1607 | if (bond->curr_active_slave == new_slave) { | 1611 | if (bond->curr_active_slave == new_slave) { |
1608 | return; | 1612 | return; |
1609 | } | 1613 | } |
@@ -1649,6 +1653,8 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave | |||
1649 | write_unlock_bh(&bond->curr_slave_lock); | 1653 | write_unlock_bh(&bond->curr_slave_lock); |
1650 | read_unlock(&bond->lock); | 1654 | read_unlock(&bond->lock); |
1651 | 1655 | ||
1656 | ASSERT_RTNL(); | ||
1657 | |||
1652 | /* curr_active_slave must be set before calling alb_swap_mac_addr */ | 1658 | /* curr_active_slave must be set before calling alb_swap_mac_addr */ |
1653 | if (swap_slave) { | 1659 | if (swap_slave) { |
1654 | /* swap mac address */ | 1660 | /* swap mac address */ |
@@ -1659,12 +1665,11 @@ void bond_alb_handle_active_change(struct bonding *bond, struct slave *new_slave | |||
1659 | bond->alb_info.rlb_enabled); | 1665 | bond->alb_info.rlb_enabled); |
1660 | } | 1666 | } |
1661 | 1667 | ||
1662 | read_lock(&bond->lock); | ||
1663 | |||
1664 | if (swap_slave) { | 1668 | if (swap_slave) { |
1665 | alb_fasten_mac_swap(bond, swap_slave, new_slave); | 1669 | alb_fasten_mac_swap(bond, swap_slave, new_slave); |
1670 | read_lock(&bond->lock); | ||
1666 | } else { | 1671 | } else { |
1667 | /* fasten bond mac on new current slave */ | 1672 | read_lock(&bond->lock); |
1668 | alb_send_learning_packets(new_slave, bond->dev->dev_addr); | 1673 | alb_send_learning_packets(new_slave, bond->dev->dev_addr); |
1669 | } | 1674 | } |
1670 | 1675 | ||
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index b0b26036266b..49a198206e3d 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -1746,7 +1746,9 @@ int bond_release(struct net_device *bond_dev, struct net_device *slave_dev) | |||
1746 | * has been cleared (if our_slave == old_current), | 1746 | * has been cleared (if our_slave == old_current), |
1747 | * but before a new active slave is selected. | 1747 | * but before a new active slave is selected. |
1748 | */ | 1748 | */ |
1749 | write_unlock_bh(&bond->lock); | ||
1749 | bond_alb_deinit_slave(bond, slave); | 1750 | bond_alb_deinit_slave(bond, slave); |
1751 | write_lock_bh(&bond->lock); | ||
1750 | } | 1752 | } |
1751 | 1753 | ||
1752 | if (oldcurrent == slave) { | 1754 | if (oldcurrent == slave) { |
@@ -1905,6 +1907,12 @@ static int bond_release_all(struct net_device *bond_dev) | |||
1905 | slave_dev = slave->dev; | 1907 | slave_dev = slave->dev; |
1906 | bond_detach_slave(bond, slave); | 1908 | bond_detach_slave(bond, slave); |
1907 | 1909 | ||
1910 | /* now that the slave is detached, unlock and perform | ||
1911 | * all the undo steps that should not be called from | ||
1912 | * within a lock. | ||
1913 | */ | ||
1914 | write_unlock_bh(&bond->lock); | ||
1915 | |||
1908 | if ((bond->params.mode == BOND_MODE_TLB) || | 1916 | if ((bond->params.mode == BOND_MODE_TLB) || |
1909 | (bond->params.mode == BOND_MODE_ALB)) { | 1917 | (bond->params.mode == BOND_MODE_ALB)) { |
1910 | /* must be called only after the slave | 1918 | /* must be called only after the slave |
@@ -1915,12 +1923,6 @@ static int bond_release_all(struct net_device *bond_dev) | |||
1915 | 1923 | ||
1916 | bond_compute_features(bond); | 1924 | bond_compute_features(bond); |
1917 | 1925 | ||
1918 | /* now that the slave is detached, unlock and perform | ||
1919 | * all the undo steps that should not be called from | ||
1920 | * within a lock. | ||
1921 | */ | ||
1922 | write_unlock_bh(&bond->lock); | ||
1923 | |||
1924 | bond_destroy_slave_symlinks(bond_dev, slave_dev); | 1926 | bond_destroy_slave_symlinks(bond_dev, slave_dev); |
1925 | bond_del_vlans_from_slave(bond, slave_dev); | 1927 | bond_del_vlans_from_slave(bond, slave_dev); |
1926 | 1928 | ||
@@ -2384,7 +2386,9 @@ void bond_mii_monitor(struct work_struct *work) | |||
2384 | rtnl_lock(); | 2386 | rtnl_lock(); |
2385 | read_lock(&bond->lock); | 2387 | read_lock(&bond->lock); |
2386 | __bond_mii_monitor(bond, 1); | 2388 | __bond_mii_monitor(bond, 1); |
2387 | rtnl_unlock(); | 2389 | read_unlock(&bond->lock); |
2390 | rtnl_unlock(); /* might sleep, hold no other locks */ | ||
2391 | read_lock(&bond->lock); | ||
2388 | } | 2392 | } |
2389 | 2393 | ||
2390 | delay = ((bond->params.miimon * HZ) / 1000) ? : 1; | 2394 | delay = ((bond->params.miimon * HZ) / 1000) ? : 1; |
@@ -3399,9 +3403,7 @@ static int bond_master_netdev_event(unsigned long event, struct net_device *bond | |||
3399 | case NETDEV_CHANGENAME: | 3403 | case NETDEV_CHANGENAME: |
3400 | return bond_event_changename(event_bond); | 3404 | return bond_event_changename(event_bond); |
3401 | case NETDEV_UNREGISTER: | 3405 | case NETDEV_UNREGISTER: |
3402 | /* | 3406 | bond_release_all(event_bond->dev); |
3403 | * TODO: remove a bond from the list? | ||
3404 | */ | ||
3405 | break; | 3407 | break; |
3406 | default: | 3408 | default: |
3407 | break; | 3409 | break; |
@@ -4540,18 +4542,27 @@ static void bond_free_all(void) | |||
4540 | 4542 | ||
4541 | /* | 4543 | /* |
4542 | * Convert string input module parms. Accept either the | 4544 | * Convert string input module parms. Accept either the |
4543 | * number of the mode or its string name. | 4545 | * number of the mode or its string name. A bit complicated because |
4546 | * some mode names are substrings of other names, and calls from sysfs | ||
4547 | * may have whitespace in the name (trailing newlines, for example). | ||
4544 | */ | 4548 | */ |
4545 | int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl) | 4549 | int bond_parse_parm(const char *buf, struct bond_parm_tbl *tbl) |
4546 | { | 4550 | { |
4547 | int i; | 4551 | int mode = -1, i, rv; |
4552 | char modestr[BOND_MAX_MODENAME_LEN + 1] = { 0, }; | ||
4553 | |||
4554 | rv = sscanf(buf, "%d", &mode); | ||
4555 | if (!rv) { | ||
4556 | rv = sscanf(buf, "%20s", modestr); | ||
4557 | if (!rv) | ||
4558 | return -1; | ||
4559 | } | ||
4548 | 4560 | ||
4549 | for (i = 0; tbl[i].modename; i++) { | 4561 | for (i = 0; tbl[i].modename; i++) { |
4550 | if ((isdigit(*mode_arg) && | 4562 | if (mode == tbl[i].mode) |
4551 | tbl[i].mode == simple_strtol(mode_arg, NULL, 0)) || | 4563 | return tbl[i].mode; |
4552 | (strcmp(mode_arg, tbl[i].modename) == 0)) { | 4564 | if (strcmp(modestr, tbl[i].modename) == 0) |
4553 | return tbl[i].mode; | 4565 | return tbl[i].mode; |
4554 | } | ||
4555 | } | 4566 | } |
4556 | 4567 | ||
4557 | return -1; | 4568 | return -1; |
@@ -4865,9 +4876,22 @@ static struct lock_class_key bonding_netdev_xmit_lock_key; | |||
4865 | int bond_create(char *name, struct bond_params *params, struct bonding **newbond) | 4876 | int bond_create(char *name, struct bond_params *params, struct bonding **newbond) |
4866 | { | 4877 | { |
4867 | struct net_device *bond_dev; | 4878 | struct net_device *bond_dev; |
4879 | struct bonding *bond, *nxt; | ||
4868 | int res; | 4880 | int res; |
4869 | 4881 | ||
4870 | rtnl_lock(); | 4882 | rtnl_lock(); |
4883 | down_write(&bonding_rwsem); | ||
4884 | |||
4885 | /* Check to see if the bond already exists. */ | ||
4886 | list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) | ||
4887 | if (strnicmp(bond->dev->name, name, IFNAMSIZ) == 0) { | ||
4888 | printk(KERN_ERR DRV_NAME | ||
4889 | ": cannot add bond %s; it already exists\n", | ||
4890 | name); | ||
4891 | res = -EPERM; | ||
4892 | goto out_rtnl; | ||
4893 | } | ||
4894 | |||
4871 | bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", | 4895 | bond_dev = alloc_netdev(sizeof(struct bonding), name ? name : "", |
4872 | ether_setup); | 4896 | ether_setup); |
4873 | if (!bond_dev) { | 4897 | if (!bond_dev) { |
@@ -4906,10 +4930,12 @@ int bond_create(char *name, struct bond_params *params, struct bonding **newbond | |||
4906 | 4930 | ||
4907 | netif_carrier_off(bond_dev); | 4931 | netif_carrier_off(bond_dev); |
4908 | 4932 | ||
4933 | up_write(&bonding_rwsem); | ||
4909 | rtnl_unlock(); /* allows sysfs registration of net device */ | 4934 | rtnl_unlock(); /* allows sysfs registration of net device */ |
4910 | res = bond_create_sysfs_entry(bond_dev->priv); | 4935 | res = bond_create_sysfs_entry(bond_dev->priv); |
4911 | if (res < 0) { | 4936 | if (res < 0) { |
4912 | rtnl_lock(); | 4937 | rtnl_lock(); |
4938 | down_write(&bonding_rwsem); | ||
4913 | goto out_bond; | 4939 | goto out_bond; |
4914 | } | 4940 | } |
4915 | 4941 | ||
@@ -4920,6 +4946,7 @@ out_bond: | |||
4920 | out_netdev: | 4946 | out_netdev: |
4921 | free_netdev(bond_dev); | 4947 | free_netdev(bond_dev); |
4922 | out_rtnl: | 4948 | out_rtnl: |
4949 | up_write(&bonding_rwsem); | ||
4923 | rtnl_unlock(); | 4950 | rtnl_unlock(); |
4924 | return res; | 4951 | return res; |
4925 | } | 4952 | } |
@@ -4940,6 +4967,9 @@ static int __init bonding_init(void) | |||
4940 | #ifdef CONFIG_PROC_FS | 4967 | #ifdef CONFIG_PROC_FS |
4941 | bond_create_proc_dir(); | 4968 | bond_create_proc_dir(); |
4942 | #endif | 4969 | #endif |
4970 | |||
4971 | init_rwsem(&bonding_rwsem); | ||
4972 | |||
4943 | for (i = 0; i < max_bonds; i++) { | 4973 | for (i = 0; i < max_bonds; i++) { |
4944 | res = bond_create(NULL, &bonding_defaults, NULL); | 4974 | res = bond_create(NULL, &bonding_defaults, NULL); |
4945 | if (res) | 4975 | if (res) |
diff --git a/drivers/net/bonding/bond_sysfs.c b/drivers/net/bonding/bond_sysfs.c index 11b76b352415..90a1f31e8e63 100644 --- a/drivers/net/bonding/bond_sysfs.c +++ b/drivers/net/bonding/bond_sysfs.c | |||
@@ -109,11 +109,10 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t | |||
109 | { | 109 | { |
110 | char command[IFNAMSIZ + 1] = {0, }; | 110 | char command[IFNAMSIZ + 1] = {0, }; |
111 | char *ifname; | 111 | char *ifname; |
112 | int res = count; | 112 | int rv, res = count; |
113 | struct bonding *bond; | 113 | struct bonding *bond; |
114 | struct bonding *nxt; | 114 | struct bonding *nxt; |
115 | 115 | ||
116 | down_write(&(bonding_rwsem)); | ||
117 | sscanf(buffer, "%16s", command); /* IFNAMSIZ*/ | 116 | sscanf(buffer, "%16s", command); /* IFNAMSIZ*/ |
118 | ifname = command + 1; | 117 | ifname = command + 1; |
119 | if ((strlen(command) <= 1) || | 118 | if ((strlen(command) <= 1) || |
@@ -121,39 +120,28 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t | |||
121 | goto err_no_cmd; | 120 | goto err_no_cmd; |
122 | 121 | ||
123 | if (command[0] == '+') { | 122 | if (command[0] == '+') { |
124 | |||
125 | /* Check to see if the bond already exists. */ | ||
126 | list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) | ||
127 | if (strnicmp(bond->dev->name, ifname, IFNAMSIZ) == 0) { | ||
128 | printk(KERN_ERR DRV_NAME | ||
129 | ": cannot add bond %s; it already exists\n", | ||
130 | ifname); | ||
131 | res = -EPERM; | ||
132 | goto out; | ||
133 | } | ||
134 | |||
135 | printk(KERN_INFO DRV_NAME | 123 | printk(KERN_INFO DRV_NAME |
136 | ": %s is being created...\n", ifname); | 124 | ": %s is being created...\n", ifname); |
137 | if (bond_create(ifname, &bonding_defaults, &bond)) { | 125 | rv = bond_create(ifname, &bonding_defaults, &bond); |
138 | printk(KERN_INFO DRV_NAME | 126 | if (rv) { |
139 | ": %s interface already exists. Bond creation failed.\n", | 127 | printk(KERN_INFO DRV_NAME ": Bond creation failed.\n"); |
140 | ifname); | 128 | res = rv; |
141 | res = -EPERM; | ||
142 | } | 129 | } |
143 | goto out; | 130 | goto out; |
144 | } | 131 | } |
145 | 132 | ||
146 | if (command[0] == '-') { | 133 | if (command[0] == '-') { |
134 | rtnl_lock(); | ||
135 | down_write(&bonding_rwsem); | ||
136 | |||
147 | list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) | 137 | list_for_each_entry_safe(bond, nxt, &bond_dev_list, bond_list) |
148 | if (strnicmp(bond->dev->name, ifname, IFNAMSIZ) == 0) { | 138 | if (strnicmp(bond->dev->name, ifname, IFNAMSIZ) == 0) { |
149 | rtnl_lock(); | ||
150 | /* check the ref count on the bond's kobject. | 139 | /* check the ref count on the bond's kobject. |
151 | * If it's > expected, then there's a file open, | 140 | * If it's > expected, then there's a file open, |
152 | * and we have to fail. | 141 | * and we have to fail. |
153 | */ | 142 | */ |
154 | if (atomic_read(&bond->dev->dev.kobj.kref.refcount) | 143 | if (atomic_read(&bond->dev->dev.kobj.kref.refcount) |
155 | > expected_refcount){ | 144 | > expected_refcount){ |
156 | rtnl_unlock(); | ||
157 | printk(KERN_INFO DRV_NAME | 145 | printk(KERN_INFO DRV_NAME |
158 | ": Unable remove bond %s due to open references.\n", | 146 | ": Unable remove bond %s due to open references.\n", |
159 | ifname); | 147 | ifname); |
@@ -164,6 +152,7 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t | |||
164 | ": %s is being deleted...\n", | 152 | ": %s is being deleted...\n", |
165 | bond->dev->name); | 153 | bond->dev->name); |
166 | bond_destroy(bond); | 154 | bond_destroy(bond); |
155 | up_write(&bonding_rwsem); | ||
167 | rtnl_unlock(); | 156 | rtnl_unlock(); |
168 | goto out; | 157 | goto out; |
169 | } | 158 | } |
@@ -171,6 +160,8 @@ static ssize_t bonding_store_bonds(struct class *cls, const char *buffer, size_t | |||
171 | printk(KERN_ERR DRV_NAME | 160 | printk(KERN_ERR DRV_NAME |
172 | ": unable to delete non-existent bond %s\n", ifname); | 161 | ": unable to delete non-existent bond %s\n", ifname); |
173 | res = -ENODEV; | 162 | res = -ENODEV; |
163 | up_write(&bonding_rwsem); | ||
164 | rtnl_unlock(); | ||
174 | goto out; | 165 | goto out; |
175 | } | 166 | } |
176 | 167 | ||
@@ -183,7 +174,6 @@ err_no_cmd: | |||
183 | * get called forever, which is bad. | 174 | * get called forever, which is bad. |
184 | */ | 175 | */ |
185 | out: | 176 | out: |
186 | up_write(&(bonding_rwsem)); | ||
187 | return res; | 177 | return res; |
188 | } | 178 | } |
189 | /* class attribute for bond_masters file. This ends up in /sys/class/net */ | 179 | /* class attribute for bond_masters file. This ends up in /sys/class/net */ |
@@ -271,6 +261,9 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
271 | 261 | ||
272 | /* Note: We can't hold bond->lock here, as bond_create grabs it. */ | 262 | /* Note: We can't hold bond->lock here, as bond_create grabs it. */ |
273 | 263 | ||
264 | rtnl_lock(); | ||
265 | down_write(&(bonding_rwsem)); | ||
266 | |||
274 | sscanf(buffer, "%16s", command); /* IFNAMSIZ*/ | 267 | sscanf(buffer, "%16s", command); /* IFNAMSIZ*/ |
275 | ifname = command + 1; | 268 | ifname = command + 1; |
276 | if ((strlen(command) <= 1) || | 269 | if ((strlen(command) <= 1) || |
@@ -336,12 +329,10 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
336 | dev->mtu = bond->dev->mtu; | 329 | dev->mtu = bond->dev->mtu; |
337 | } | 330 | } |
338 | } | 331 | } |
339 | rtnl_lock(); | ||
340 | res = bond_enslave(bond->dev, dev); | 332 | res = bond_enslave(bond->dev, dev); |
341 | bond_for_each_slave(bond, slave, i) | 333 | bond_for_each_slave(bond, slave, i) |
342 | if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) | 334 | if (strnicmp(slave->dev->name, ifname, IFNAMSIZ) == 0) |
343 | slave->original_mtu = original_mtu; | 335 | slave->original_mtu = original_mtu; |
344 | rtnl_unlock(); | ||
345 | if (res) { | 336 | if (res) { |
346 | ret = res; | 337 | ret = res; |
347 | } | 338 | } |
@@ -359,12 +350,10 @@ static ssize_t bonding_store_slaves(struct device *d, | |||
359 | if (dev) { | 350 | if (dev) { |
360 | printk(KERN_INFO DRV_NAME ": %s: Removing slave %s\n", | 351 | printk(KERN_INFO DRV_NAME ": %s: Removing slave %s\n", |
361 | bond->dev->name, dev->name); | 352 | bond->dev->name, dev->name); |
362 | rtnl_lock(); | ||
363 | if (bond->setup_by_slave) | 353 | if (bond->setup_by_slave) |
364 | res = bond_release_and_destroy(bond->dev, dev); | 354 | res = bond_release_and_destroy(bond->dev, dev); |
365 | else | 355 | else |
366 | res = bond_release(bond->dev, dev); | 356 | res = bond_release(bond->dev, dev); |
367 | rtnl_unlock(); | ||
368 | if (res) { | 357 | if (res) { |
369 | ret = res; | 358 | ret = res; |
370 | goto out; | 359 | goto out; |
@@ -389,6 +378,8 @@ err_no_cmd: | |||
389 | ret = -EPERM; | 378 | ret = -EPERM; |
390 | 379 | ||
391 | out: | 380 | out: |
381 | up_write(&(bonding_rwsem)); | ||
382 | rtnl_unlock(); | ||
392 | return ret; | 383 | return ret; |
393 | } | 384 | } |
394 | 385 | ||
@@ -423,7 +414,7 @@ static ssize_t bonding_store_mode(struct device *d, | |||
423 | goto out; | 414 | goto out; |
424 | } | 415 | } |
425 | 416 | ||
426 | new_value = bond_parse_parm((char *)buf, bond_mode_tbl); | 417 | new_value = bond_parse_parm(buf, bond_mode_tbl); |
427 | if (new_value < 0) { | 418 | if (new_value < 0) { |
428 | printk(KERN_ERR DRV_NAME | 419 | printk(KERN_ERR DRV_NAME |
429 | ": %s: Ignoring invalid mode value %.*s.\n", | 420 | ": %s: Ignoring invalid mode value %.*s.\n", |
@@ -478,7 +469,7 @@ static ssize_t bonding_store_xmit_hash(struct device *d, | |||
478 | goto out; | 469 | goto out; |
479 | } | 470 | } |
480 | 471 | ||
481 | new_value = bond_parse_parm((char *)buf, xmit_hashtype_tbl); | 472 | new_value = bond_parse_parm(buf, xmit_hashtype_tbl); |
482 | if (new_value < 0) { | 473 | if (new_value < 0) { |
483 | printk(KERN_ERR DRV_NAME | 474 | printk(KERN_ERR DRV_NAME |
484 | ": %s: Ignoring invalid xmit hash policy value %.*s.\n", | 475 | ": %s: Ignoring invalid xmit hash policy value %.*s.\n", |
@@ -518,7 +509,7 @@ static ssize_t bonding_store_arp_validate(struct device *d, | |||
518 | int new_value; | 509 | int new_value; |
519 | struct bonding *bond = to_bond(d); | 510 | struct bonding *bond = to_bond(d); |
520 | 511 | ||
521 | new_value = bond_parse_parm((char *)buf, arp_validate_tbl); | 512 | new_value = bond_parse_parm(buf, arp_validate_tbl); |
522 | if (new_value < 0) { | 513 | if (new_value < 0) { |
523 | printk(KERN_ERR DRV_NAME | 514 | printk(KERN_ERR DRV_NAME |
524 | ": %s: Ignoring invalid arp_validate value %s\n", | 515 | ": %s: Ignoring invalid arp_validate value %s\n", |
@@ -941,7 +932,7 @@ static ssize_t bonding_store_lacp(struct device *d, | |||
941 | goto out; | 932 | goto out; |
942 | } | 933 | } |
943 | 934 | ||
944 | new_value = bond_parse_parm((char *)buf, bond_lacp_tbl); | 935 | new_value = bond_parse_parm(buf, bond_lacp_tbl); |
945 | 936 | ||
946 | if ((new_value == 1) || (new_value == 0)) { | 937 | if ((new_value == 1) || (new_value == 0)) { |
947 | bond->params.lacp_fast = new_value; | 938 | bond->params.lacp_fast = new_value; |
@@ -1075,7 +1066,10 @@ static ssize_t bonding_store_primary(struct device *d, | |||
1075 | struct slave *slave; | 1066 | struct slave *slave; |
1076 | struct bonding *bond = to_bond(d); | 1067 | struct bonding *bond = to_bond(d); |
1077 | 1068 | ||
1078 | write_lock_bh(&bond->lock); | 1069 | rtnl_lock(); |
1070 | read_lock(&bond->lock); | ||
1071 | write_lock_bh(&bond->curr_slave_lock); | ||
1072 | |||
1079 | if (!USES_PRIMARY(bond->params.mode)) { | 1073 | if (!USES_PRIMARY(bond->params.mode)) { |
1080 | printk(KERN_INFO DRV_NAME | 1074 | printk(KERN_INFO DRV_NAME |
1081 | ": %s: Unable to set primary slave; %s is in mode %d\n", | 1075 | ": %s: Unable to set primary slave; %s is in mode %d\n", |
@@ -1109,8 +1103,8 @@ static ssize_t bonding_store_primary(struct device *d, | |||
1109 | } | 1103 | } |
1110 | } | 1104 | } |
1111 | out: | 1105 | out: |
1112 | write_unlock_bh(&bond->lock); | 1106 | write_unlock_bh(&bond->curr_slave_lock); |
1113 | 1107 | read_unlock(&bond->lock); | |
1114 | rtnl_unlock(); | 1108 | rtnl_unlock(); |
1115 | 1109 | ||
1116 | return count; | 1110 | return count; |
@@ -1190,7 +1184,8 @@ static ssize_t bonding_store_active_slave(struct device *d, | |||
1190 | struct bonding *bond = to_bond(d); | 1184 | struct bonding *bond = to_bond(d); |
1191 | 1185 | ||
1192 | rtnl_lock(); | 1186 | rtnl_lock(); |
1193 | write_lock_bh(&bond->lock); | 1187 | read_lock(&bond->lock); |
1188 | write_lock_bh(&bond->curr_slave_lock); | ||
1194 | 1189 | ||
1195 | if (!USES_PRIMARY(bond->params.mode)) { | 1190 | if (!USES_PRIMARY(bond->params.mode)) { |
1196 | printk(KERN_INFO DRV_NAME | 1191 | printk(KERN_INFO DRV_NAME |
@@ -1247,7 +1242,8 @@ static ssize_t bonding_store_active_slave(struct device *d, | |||
1247 | } | 1242 | } |
1248 | } | 1243 | } |
1249 | out: | 1244 | out: |
1250 | write_unlock_bh(&bond->lock); | 1245 | write_unlock_bh(&bond->curr_slave_lock); |
1246 | read_unlock(&bond->lock); | ||
1251 | rtnl_unlock(); | 1247 | rtnl_unlock(); |
1252 | 1248 | ||
1253 | return count; | 1249 | return count; |
@@ -1418,8 +1414,6 @@ int bond_create_sysfs(void) | |||
1418 | int ret = 0; | 1414 | int ret = 0; |
1419 | struct bonding *firstbond; | 1415 | struct bonding *firstbond; |
1420 | 1416 | ||
1421 | init_rwsem(&bonding_rwsem); | ||
1422 | |||
1423 | /* get the netdev class pointer */ | 1417 | /* get the netdev class pointer */ |
1424 | firstbond = container_of(bond_dev_list.next, struct bonding, bond_list); | 1418 | firstbond = container_of(bond_dev_list.next, struct bonding, bond_list); |
1425 | if (!firstbond) | 1419 | if (!firstbond) |
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index e1e4734e23ce..6d83be49899a 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
@@ -141,6 +141,8 @@ struct bond_parm_tbl { | |||
141 | int mode; | 141 | int mode; |
142 | }; | 142 | }; |
143 | 143 | ||
144 | #define BOND_MAX_MODENAME_LEN 20 | ||
145 | |||
144 | struct vlan_entry { | 146 | struct vlan_entry { |
145 | struct list_head vlan_list; | 147 | struct list_head vlan_list; |
146 | __be32 vlan_ip; | 148 | __be32 vlan_ip; |
@@ -314,7 +316,7 @@ void bond_mii_monitor(struct work_struct *); | |||
314 | void bond_loadbalance_arp_mon(struct work_struct *); | 316 | void bond_loadbalance_arp_mon(struct work_struct *); |
315 | void bond_activebackup_arp_mon(struct work_struct *); | 317 | void bond_activebackup_arp_mon(struct work_struct *); |
316 | void bond_set_mode_ops(struct bonding *bond, int mode); | 318 | void bond_set_mode_ops(struct bonding *bond, int mode); |
317 | int bond_parse_parm(char *mode_arg, struct bond_parm_tbl *tbl); | 319 | int bond_parse_parm(const char *mode_arg, struct bond_parm_tbl *tbl); |
318 | void bond_select_active_slave(struct bonding *bond); | 320 | void bond_select_active_slave(struct bonding *bond); |
319 | void bond_change_active_slave(struct bonding *bond, struct slave *new_active); | 321 | void bond_change_active_slave(struct bonding *bond, struct slave *new_active); |
320 | void bond_register_arp(struct bonding *); | 322 | void bond_register_arp(struct bonding *); |
diff --git a/drivers/net/e1000/e1000_main.c b/drivers/net/e1000/e1000_main.c index 13d57b0a88fa..0c9a6f7104d2 100644 --- a/drivers/net/e1000/e1000_main.c +++ b/drivers/net/e1000/e1000_main.c | |||
@@ -3919,7 +3919,7 @@ e1000_clean(struct napi_struct *napi, int budget) | |||
3919 | { | 3919 | { |
3920 | struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); | 3920 | struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); |
3921 | struct net_device *poll_dev = adapter->netdev; | 3921 | struct net_device *poll_dev = adapter->netdev; |
3922 | int work_done = 0; | 3922 | int tx_cleaned = 0, work_done = 0; |
3923 | 3923 | ||
3924 | /* Must NOT use netdev_priv macro here. */ | 3924 | /* Must NOT use netdev_priv macro here. */ |
3925 | adapter = poll_dev->priv; | 3925 | adapter = poll_dev->priv; |
@@ -3929,14 +3929,17 @@ e1000_clean(struct napi_struct *napi, int budget) | |||
3929 | * simultaneously. A failure obtaining the lock means | 3929 | * simultaneously. A failure obtaining the lock means |
3930 | * tx_ring[0] is currently being cleaned anyway. */ | 3930 | * tx_ring[0] is currently being cleaned anyway. */ |
3931 | if (spin_trylock(&adapter->tx_queue_lock)) { | 3931 | if (spin_trylock(&adapter->tx_queue_lock)) { |
3932 | e1000_clean_tx_irq(adapter, | 3932 | tx_cleaned = e1000_clean_tx_irq(adapter, |
3933 | &adapter->tx_ring[0]); | 3933 | &adapter->tx_ring[0]); |
3934 | spin_unlock(&adapter->tx_queue_lock); | 3934 | spin_unlock(&adapter->tx_queue_lock); |
3935 | } | 3935 | } |
3936 | 3936 | ||
3937 | adapter->clean_rx(adapter, &adapter->rx_ring[0], | 3937 | adapter->clean_rx(adapter, &adapter->rx_ring[0], |
3938 | &work_done, budget); | 3938 | &work_done, budget); |
3939 | 3939 | ||
3940 | if (tx_cleaned) | ||
3941 | work_done = budget; | ||
3942 | |||
3940 | /* If budget not fully consumed, exit the polling mode */ | 3943 | /* If budget not fully consumed, exit the polling mode */ |
3941 | if (work_done < budget) { | 3944 | if (work_done < budget) { |
3942 | if (likely(adapter->itr_setting & 3)) | 3945 | if (likely(adapter->itr_setting & 3)) |
diff --git a/drivers/net/e1000e/netdev.c b/drivers/net/e1000e/netdev.c index 4a6fc7453776..2ab3bfbb8a63 100644 --- a/drivers/net/e1000e/netdev.c +++ b/drivers/net/e1000e/netdev.c | |||
@@ -1384,7 +1384,7 @@ static int e1000_clean(struct napi_struct *napi, int budget) | |||
1384 | { | 1384 | { |
1385 | struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); | 1385 | struct e1000_adapter *adapter = container_of(napi, struct e1000_adapter, napi); |
1386 | struct net_device *poll_dev = adapter->netdev; | 1386 | struct net_device *poll_dev = adapter->netdev; |
1387 | int work_done = 0; | 1387 | int tx_cleaned = 0, work_done = 0; |
1388 | 1388 | ||
1389 | /* Must NOT use netdev_priv macro here. */ | 1389 | /* Must NOT use netdev_priv macro here. */ |
1390 | adapter = poll_dev->priv; | 1390 | adapter = poll_dev->priv; |
@@ -1394,12 +1394,15 @@ static int e1000_clean(struct napi_struct *napi, int budget) | |||
1394 | * simultaneously. A failure obtaining the lock means | 1394 | * simultaneously. A failure obtaining the lock means |
1395 | * tx_ring is currently being cleaned anyway. */ | 1395 | * tx_ring is currently being cleaned anyway. */ |
1396 | if (spin_trylock(&adapter->tx_queue_lock)) { | 1396 | if (spin_trylock(&adapter->tx_queue_lock)) { |
1397 | e1000_clean_tx_irq(adapter); | 1397 | tx_cleaned = e1000_clean_tx_irq(adapter); |
1398 | spin_unlock(&adapter->tx_queue_lock); | 1398 | spin_unlock(&adapter->tx_queue_lock); |
1399 | } | 1399 | } |
1400 | 1400 | ||
1401 | adapter->clean_rx(adapter, &work_done, budget); | 1401 | adapter->clean_rx(adapter, &work_done, budget); |
1402 | 1402 | ||
1403 | if (tx_cleaned) | ||
1404 | work_done = budget; | ||
1405 | |||
1403 | /* If budget not fully consumed, exit the polling mode */ | 1406 | /* If budget not fully consumed, exit the polling mode */ |
1404 | if (work_done < budget) { | 1407 | if (work_done < budget) { |
1405 | if (adapter->itr_setting & 3) | 1408 | if (adapter->itr_setting & 3) |
diff --git a/drivers/net/ipg.c b/drivers/net/ipg.c index dbd23bb65d1e..50f0c17451b1 100644 --- a/drivers/net/ipg.c +++ b/drivers/net/ipg.c | |||
@@ -857,21 +857,14 @@ static void init_tfdlist(struct net_device *dev) | |||
857 | static void ipg_nic_txfree(struct net_device *dev) | 857 | static void ipg_nic_txfree(struct net_device *dev) |
858 | { | 858 | { |
859 | struct ipg_nic_private *sp = netdev_priv(dev); | 859 | struct ipg_nic_private *sp = netdev_priv(dev); |
860 | void __iomem *ioaddr = sp->ioaddr; | 860 | unsigned int released, pending, dirty; |
861 | unsigned int curr; | ||
862 | u64 txd_map; | ||
863 | unsigned int released, pending; | ||
864 | |||
865 | txd_map = (u64)sp->txd_map; | ||
866 | curr = ipg_r32(TFD_LIST_PTR_0) - | ||
867 | do_div(txd_map, sizeof(struct ipg_tx)) - 1; | ||
868 | 861 | ||
869 | IPG_DEBUG_MSG("_nic_txfree\n"); | 862 | IPG_DEBUG_MSG("_nic_txfree\n"); |
870 | 863 | ||
871 | pending = sp->tx_current - sp->tx_dirty; | 864 | pending = sp->tx_current - sp->tx_dirty; |
865 | dirty = sp->tx_dirty % IPG_TFDLIST_LENGTH; | ||
872 | 866 | ||
873 | for (released = 0; released < pending; released++) { | 867 | for (released = 0; released < pending; released++) { |
874 | unsigned int dirty = sp->tx_dirty % IPG_TFDLIST_LENGTH; | ||
875 | struct sk_buff *skb = sp->TxBuff[dirty]; | 868 | struct sk_buff *skb = sp->TxBuff[dirty]; |
876 | struct ipg_tx *txfd = sp->txd + dirty; | 869 | struct ipg_tx *txfd = sp->txd + dirty; |
877 | 870 | ||
@@ -882,11 +875,8 @@ static void ipg_nic_txfree(struct net_device *dev) | |||
882 | * If the TFDDone bit is set, free the associated | 875 | * If the TFDDone bit is set, free the associated |
883 | * buffer. | 876 | * buffer. |
884 | */ | 877 | */ |
885 | if (dirty == curr) | 878 | if (!(txfd->tfc & cpu_to_le64(IPG_TFC_TFDDONE))) |
886 | break; | 879 | break; |
887 | |||
888 | /* Setup TFDDONE for compatible issue. */ | ||
889 | txfd->tfc |= cpu_to_le64(IPG_TFC_TFDDONE); | ||
890 | 880 | ||
891 | /* Free the transmit buffer. */ | 881 | /* Free the transmit buffer. */ |
892 | if (skb) { | 882 | if (skb) { |
@@ -898,6 +888,7 @@ static void ipg_nic_txfree(struct net_device *dev) | |||
898 | 888 | ||
899 | sp->TxBuff[dirty] = NULL; | 889 | sp->TxBuff[dirty] = NULL; |
900 | } | 890 | } |
891 | dirty = (dirty + 1) % IPG_TFDLIST_LENGTH; | ||
901 | } | 892 | } |
902 | 893 | ||
903 | sp->tx_dirty += released; | 894 | sp->tx_dirty += released; |
@@ -1630,6 +1621,8 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst) | |||
1630 | #ifdef JUMBO_FRAME | 1621 | #ifdef JUMBO_FRAME |
1631 | ipg_nic_rxrestore(dev); | 1622 | ipg_nic_rxrestore(dev); |
1632 | #endif | 1623 | #endif |
1624 | spin_lock(&sp->lock); | ||
1625 | |||
1633 | /* Get interrupt source information, and acknowledge | 1626 | /* Get interrupt source information, and acknowledge |
1634 | * some (i.e. TxDMAComplete, RxDMAComplete, RxEarly, | 1627 | * some (i.e. TxDMAComplete, RxDMAComplete, RxEarly, |
1635 | * IntRequested, MacControlFrame, LinkEvent) interrupts | 1628 | * IntRequested, MacControlFrame, LinkEvent) interrupts |
@@ -1647,9 +1640,7 @@ static irqreturn_t ipg_interrupt_handler(int irq, void *dev_inst) | |||
1647 | handled = 1; | 1640 | handled = 1; |
1648 | 1641 | ||
1649 | if (unlikely(!netif_running(dev))) | 1642 | if (unlikely(!netif_running(dev))) |
1650 | goto out; | 1643 | goto out_unlock; |
1651 | |||
1652 | spin_lock(&sp->lock); | ||
1653 | 1644 | ||
1654 | /* If RFDListEnd interrupt, restore all used RFDs. */ | 1645 | /* If RFDListEnd interrupt, restore all used RFDs. */ |
1655 | if (status & IPG_IS_RFD_LIST_END) { | 1646 | if (status & IPG_IS_RFD_LIST_END) { |
@@ -1733,9 +1724,9 @@ out_enable: | |||
1733 | ipg_w16(IPG_IE_TX_DMA_COMPLETE | IPG_IE_RX_DMA_COMPLETE | | 1724 | ipg_w16(IPG_IE_TX_DMA_COMPLETE | IPG_IE_RX_DMA_COMPLETE | |
1734 | IPG_IE_HOST_ERROR | IPG_IE_INT_REQUESTED | IPG_IE_TX_COMPLETE | | 1725 | IPG_IE_HOST_ERROR | IPG_IE_INT_REQUESTED | IPG_IE_TX_COMPLETE | |
1735 | IPG_IE_LINK_EVENT | IPG_IE_UPDATE_STATS, INT_ENABLE); | 1726 | IPG_IE_LINK_EVENT | IPG_IE_UPDATE_STATS, INT_ENABLE); |
1736 | 1727 | out_unlock: | |
1737 | spin_unlock(&sp->lock); | 1728 | spin_unlock(&sp->lock); |
1738 | out: | 1729 | |
1739 | return IRQ_RETVAL(handled); | 1730 | return IRQ_RETVAL(handled); |
1740 | } | 1731 | } |
1741 | 1732 | ||
@@ -1943,10 +1934,7 @@ static int ipg_nic_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
1943 | */ | 1934 | */ |
1944 | if (sp->tenmbpsmode) | 1935 | if (sp->tenmbpsmode) |
1945 | txfd->tfc |= cpu_to_le64(IPG_TFC_TXINDICATE); | 1936 | txfd->tfc |= cpu_to_le64(IPG_TFC_TXINDICATE); |
1946 | else if (!((sp->tx_current - sp->tx_dirty + 1) > | 1937 | txfd->tfc |= cpu_to_le64(IPG_TFC_TXDMAINDICATE); |
1947 | IPG_FRAMESBETWEENTXDMACOMPLETES)) { | ||
1948 | txfd->tfc |= cpu_to_le64(IPG_TFC_TXDMAINDICATE); | ||
1949 | } | ||
1950 | /* Based on compilation option, determine if FCS is to be | 1938 | /* Based on compilation option, determine if FCS is to be |
1951 | * appended to transmit frame by IPG. | 1939 | * appended to transmit frame by IPG. |
1952 | */ | 1940 | */ |
@@ -2003,7 +1991,7 @@ static int ipg_nic_hard_start_xmit(struct sk_buff *skb, struct net_device *dev) | |||
2003 | ipg_w32(IPG_DC_TX_DMA_POLL_NOW, DMA_CTRL); | 1991 | ipg_w32(IPG_DC_TX_DMA_POLL_NOW, DMA_CTRL); |
2004 | 1992 | ||
2005 | if (sp->tx_current == (sp->tx_dirty + IPG_TFDLIST_LENGTH)) | 1993 | if (sp->tx_current == (sp->tx_dirty + IPG_TFDLIST_LENGTH)) |
2006 | netif_wake_queue(dev); | 1994 | netif_stop_queue(dev); |
2007 | 1995 | ||
2008 | spin_unlock_irqrestore(&sp->lock, flags); | 1996 | spin_unlock_irqrestore(&sp->lock, flags); |
2009 | 1997 | ||
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c index a56491617661..de3f45e4c5ae 100644 --- a/drivers/net/ixgbe/ixgbe_main.c +++ b/drivers/net/ixgbe/ixgbe_main.c | |||
@@ -1468,13 +1468,16 @@ static int ixgbe_clean(struct napi_struct *napi, int budget) | |||
1468 | struct ixgbe_adapter *adapter = container_of(napi, | 1468 | struct ixgbe_adapter *adapter = container_of(napi, |
1469 | struct ixgbe_adapter, napi); | 1469 | struct ixgbe_adapter, napi); |
1470 | struct net_device *netdev = adapter->netdev; | 1470 | struct net_device *netdev = adapter->netdev; |
1471 | int work_done = 0; | 1471 | int tx_cleaned = 0, work_done = 0; |
1472 | 1472 | ||
1473 | /* In non-MSIX case, there is no multi-Tx/Rx queue */ | 1473 | /* In non-MSIX case, there is no multi-Tx/Rx queue */ |
1474 | ixgbe_clean_tx_irq(adapter, adapter->tx_ring); | 1474 | tx_cleaned = ixgbe_clean_tx_irq(adapter, adapter->tx_ring); |
1475 | ixgbe_clean_rx_irq(adapter, &adapter->rx_ring[0], &work_done, | 1475 | ixgbe_clean_rx_irq(adapter, &adapter->rx_ring[0], &work_done, |
1476 | budget); | 1476 | budget); |
1477 | 1477 | ||
1478 | if (tx_cleaned) | ||
1479 | work_done = budget; | ||
1480 | |||
1478 | /* If budget not fully consumed, exit the polling mode */ | 1481 | /* If budget not fully consumed, exit the polling mode */ |
1479 | if (work_done < budget) { | 1482 | if (work_done < budget) { |
1480 | netif_rx_complete(netdev, napi); | 1483 | netif_rx_complete(netdev, napi); |
diff --git a/drivers/net/niu.c b/drivers/net/niu.c index 3bbcea11329f..5f6beabf2d17 100644 --- a/drivers/net/niu.c +++ b/drivers/net/niu.c | |||
@@ -1319,6 +1319,7 @@ static int link_status_10g(struct niu *np, int *link_up_p) | |||
1319 | 1319 | ||
1320 | static int link_status_1g(struct niu *np, int *link_up_p) | 1320 | static int link_status_1g(struct niu *np, int *link_up_p) |
1321 | { | 1321 | { |
1322 | struct niu_link_config *lp = &np->link_config; | ||
1322 | u16 current_speed, bmsr; | 1323 | u16 current_speed, bmsr; |
1323 | unsigned long flags; | 1324 | unsigned long flags; |
1324 | u8 current_duplex; | 1325 | u8 current_duplex; |
@@ -1386,6 +1387,8 @@ static int link_status_1g(struct niu *np, int *link_up_p) | |||
1386 | link_up = 0; | 1387 | link_up = 0; |
1387 | } | 1388 | } |
1388 | } | 1389 | } |
1390 | lp->active_speed = current_speed; | ||
1391 | lp->active_duplex = current_duplex; | ||
1389 | err = 0; | 1392 | err = 0; |
1390 | 1393 | ||
1391 | out: | 1394 | out: |
diff --git a/drivers/pnp/pnpacpi/rsparser.c b/drivers/pnp/pnpacpi/rsparser.c index f7b8648acbfa..6b9840cce0f4 100644 --- a/drivers/pnp/pnpacpi/rsparser.c +++ b/drivers/pnp/pnpacpi/rsparser.c | |||
@@ -215,6 +215,7 @@ static void pnpacpi_parse_allocated_ioresource(struct pnp_resource_table *res, | |||
215 | } else if (!warned) { | 215 | } else if (!warned) { |
216 | printk(KERN_ERR "pnpacpi: exceeded the max number of IO " | 216 | printk(KERN_ERR "pnpacpi: exceeded the max number of IO " |
217 | "resources: %d \n", PNP_MAX_PORT); | 217 | "resources: %d \n", PNP_MAX_PORT); |
218 | warned = 1; | ||
218 | } | 219 | } |
219 | } | 220 | } |
220 | 221 | ||
@@ -242,6 +243,7 @@ static void pnpacpi_parse_allocated_memresource(struct pnp_resource_table *res, | |||
242 | } else if (!warned) { | 243 | } else if (!warned) { |
243 | printk(KERN_ERR "pnpacpi: exceeded the max number of mem " | 244 | printk(KERN_ERR "pnpacpi: exceeded the max number of mem " |
244 | "resources: %d\n", PNP_MAX_MEM); | 245 | "resources: %d\n", PNP_MAX_MEM); |
246 | warned = 1; | ||
245 | } | 247 | } |
246 | } | 248 | } |
247 | 249 | ||
diff --git a/drivers/video/modedb.c b/drivers/video/modedb.c index 8d81ef019c6c..08d072552233 100644 --- a/drivers/video/modedb.c +++ b/drivers/video/modedb.c | |||
@@ -259,6 +259,10 @@ static const struct fb_videomode modedb[] = { | |||
259 | /* 1366x768, 60 Hz, 47.403 kHz hsync, WXGA 16:9 aspect ratio */ | 259 | /* 1366x768, 60 Hz, 47.403 kHz hsync, WXGA 16:9 aspect ratio */ |
260 | NULL, 60, 1366, 768, 13806, 120, 10, 14, 3, 32, 5, | 260 | NULL, 60, 1366, 768, 13806, 120, 10, 14, 3, 32, 5, |
261 | 0, FB_VMODE_NONINTERLACED | 261 | 0, FB_VMODE_NONINTERLACED |
262 | }, { | ||
263 | /* 1280x800, 60 Hz, 47.403 kHz hsync, WXGA 16:10 aspect ratio */ | ||
264 | NULL, 60, 1280, 800, 12048, 200, 64, 24, 1, 136, 3, | ||
265 | 0, FB_VMODE_NONINTERLACED | ||
262 | }, | 266 | }, |
263 | }; | 267 | }; |
264 | 268 | ||
diff --git a/fs/hfs/btree.c b/fs/hfs/btree.c index 31284c77bba8..110dd3515dc8 100644 --- a/fs/hfs/btree.c +++ b/fs/hfs/btree.c | |||
@@ -61,7 +61,7 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke | |||
61 | mapping = tree->inode->i_mapping; | 61 | mapping = tree->inode->i_mapping; |
62 | page = read_mapping_page(mapping, 0, NULL); | 62 | page = read_mapping_page(mapping, 0, NULL); |
63 | if (IS_ERR(page)) | 63 | if (IS_ERR(page)) |
64 | goto free_tree; | 64 | goto free_inode; |
65 | 65 | ||
66 | /* Load the header */ | 66 | /* Load the header */ |
67 | head = (struct hfs_btree_header_rec *)(kmap(page) + sizeof(struct hfs_bnode_desc)); | 67 | head = (struct hfs_btree_header_rec *)(kmap(page) + sizeof(struct hfs_bnode_desc)); |
@@ -99,11 +99,12 @@ struct hfs_btree *hfs_btree_open(struct super_block *sb, u32 id, btree_keycmp ke | |||
99 | page_cache_release(page); | 99 | page_cache_release(page); |
100 | return tree; | 100 | return tree; |
101 | 101 | ||
102 | fail_page: | 102 | fail_page: |
103 | page_cache_release(page); | 103 | page_cache_release(page); |
104 | free_tree: | 104 | free_inode: |
105 | tree->inode->i_mapping->a_ops = &hfs_aops; | 105 | tree->inode->i_mapping->a_ops = &hfs_aops; |
106 | iput(tree->inode); | 106 | iput(tree->inode); |
107 | free_tree: | ||
107 | kfree(tree); | 108 | kfree(tree); |
108 | return NULL; | 109 | return NULL; |
109 | } | 110 | } |
diff --git a/fs/jbd/transaction.c b/fs/jbd/transaction.c index 08ff6c7028cc..038ed7436199 100644 --- a/fs/jbd/transaction.c +++ b/fs/jbd/transaction.c | |||
@@ -288,10 +288,12 @@ handle_t *journal_start(journal_t *journal, int nblocks) | |||
288 | jbd_free_handle(handle); | 288 | jbd_free_handle(handle); |
289 | current->journal_info = NULL; | 289 | current->journal_info = NULL; |
290 | handle = ERR_PTR(err); | 290 | handle = ERR_PTR(err); |
291 | goto out; | ||
291 | } | 292 | } |
292 | 293 | ||
293 | lock_acquire(&handle->h_lockdep_map, 0, 0, 0, 2, _THIS_IP_); | 294 | lock_acquire(&handle->h_lockdep_map, 0, 0, 0, 2, _THIS_IP_); |
294 | 295 | ||
296 | out: | ||
295 | return handle; | 297 | return handle; |
296 | } | 298 | } |
297 | 299 | ||
diff --git a/fs/sysfs/dir.c b/fs/sysfs/dir.c index 337162935d21..f281cc6584b0 100644 --- a/fs/sysfs/dir.c +++ b/fs/sysfs/dir.c | |||
@@ -678,8 +678,10 @@ static struct dentry * sysfs_lookup(struct inode *dir, struct dentry *dentry, | |||
678 | sd = sysfs_find_dirent(parent_sd, dentry->d_name.name); | 678 | sd = sysfs_find_dirent(parent_sd, dentry->d_name.name); |
679 | 679 | ||
680 | /* no such entry */ | 680 | /* no such entry */ |
681 | if (!sd) | 681 | if (!sd) { |
682 | ret = ERR_PTR(-ENOENT); | ||
682 | goto out_unlock; | 683 | goto out_unlock; |
684 | } | ||
683 | 685 | ||
684 | /* attach dentry and inode */ | 686 | /* attach dentry and inode */ |
685 | inode = sysfs_get_inode(sd); | 687 | inode = sysfs_get_inode(sd); |
@@ -781,6 +783,7 @@ int sysfs_rename_dir(struct kobject * kobj, const char *new_name) | |||
781 | old_dentry = sysfs_get_dentry(sd); | 783 | old_dentry = sysfs_get_dentry(sd); |
782 | if (IS_ERR(old_dentry)) { | 784 | if (IS_ERR(old_dentry)) { |
783 | error = PTR_ERR(old_dentry); | 785 | error = PTR_ERR(old_dentry); |
786 | old_dentry = NULL; | ||
784 | goto out; | 787 | goto out; |
785 | } | 788 | } |
786 | 789 | ||
@@ -848,6 +851,7 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj) | |||
848 | old_dentry = sysfs_get_dentry(sd); | 851 | old_dentry = sysfs_get_dentry(sd); |
849 | if (IS_ERR(old_dentry)) { | 852 | if (IS_ERR(old_dentry)) { |
850 | error = PTR_ERR(old_dentry); | 853 | error = PTR_ERR(old_dentry); |
854 | old_dentry = NULL; | ||
851 | goto out; | 855 | goto out; |
852 | } | 856 | } |
853 | old_parent = old_dentry->d_parent; | 857 | old_parent = old_dentry->d_parent; |
@@ -855,6 +859,7 @@ int sysfs_move_dir(struct kobject *kobj, struct kobject *new_parent_kobj) | |||
855 | new_parent = sysfs_get_dentry(new_parent_sd); | 859 | new_parent = sysfs_get_dentry(new_parent_sd); |
856 | if (IS_ERR(new_parent)) { | 860 | if (IS_ERR(new_parent)) { |
857 | error = PTR_ERR(new_parent); | 861 | error = PTR_ERR(new_parent); |
862 | new_parent = NULL; | ||
858 | goto out; | 863 | goto out; |
859 | } | 864 | } |
860 | 865 | ||
@@ -878,7 +883,6 @@ again: | |||
878 | error = 0; | 883 | error = 0; |
879 | d_add(new_dentry, NULL); | 884 | d_add(new_dentry, NULL); |
880 | d_move(old_dentry, new_dentry); | 885 | d_move(old_dentry, new_dentry); |
881 | dput(new_dentry); | ||
882 | 886 | ||
883 | /* Remove from old parent's list and insert into new parent's list. */ | 887 | /* Remove from old parent's list and insert into new parent's list. */ |
884 | sysfs_unlink_sibling(sd); | 888 | sysfs_unlink_sibling(sd); |
diff --git a/include/asm-cris/page.h b/include/asm-cris/page.h index 0648e3153f81..b84353ef6998 100644 --- a/include/asm-cris/page.h +++ b/include/asm-cris/page.h | |||
@@ -4,14 +4,11 @@ | |||
4 | #ifdef __KERNEL__ | 4 | #ifdef __KERNEL__ |
5 | 5 | ||
6 | #include <asm/arch/page.h> | 6 | #include <asm/arch/page.h> |
7 | #include <linux/const.h> | ||
7 | 8 | ||
8 | /* PAGE_SHIFT determines the page size */ | 9 | /* PAGE_SHIFT determines the page size */ |
9 | #define PAGE_SHIFT 13 | 10 | #define PAGE_SHIFT 13 |
10 | #ifndef __ASSEMBLY__ | 11 | #define PAGE_SIZE (_AC(1, UL) << PAGE_SHIFT) |
11 | #define PAGE_SIZE (1UL << PAGE_SHIFT) | ||
12 | #else | ||
13 | #define PAGE_SIZE (1 << PAGE_SHIFT) | ||
14 | #endif | ||
15 | #define PAGE_MASK (~(PAGE_SIZE-1)) | 12 | #define PAGE_MASK (~(PAGE_SIZE-1)) |
16 | 13 | ||
17 | #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) | 14 | #define clear_page(page) memset((void *)(page), 0, PAGE_SIZE) |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index 7daafdc2514b..7f28c32d9aca 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -149,19 +149,27 @@ struct execute_work { | |||
149 | 149 | ||
150 | extern struct workqueue_struct * | 150 | extern struct workqueue_struct * |
151 | __create_workqueue_key(const char *name, int singlethread, | 151 | __create_workqueue_key(const char *name, int singlethread, |
152 | int freezeable, struct lock_class_key *key); | 152 | int freezeable, struct lock_class_key *key, |
153 | const char *lock_name); | ||
153 | 154 | ||
154 | #ifdef CONFIG_LOCKDEP | 155 | #ifdef CONFIG_LOCKDEP |
155 | #define __create_workqueue(name, singlethread, freezeable) \ | 156 | #define __create_workqueue(name, singlethread, freezeable) \ |
156 | ({ \ | 157 | ({ \ |
157 | static struct lock_class_key __key; \ | 158 | static struct lock_class_key __key; \ |
159 | const char *__lock_name; \ | ||
160 | \ | ||
161 | if (__builtin_constant_p(name)) \ | ||
162 | __lock_name = (name); \ | ||
163 | else \ | ||
164 | __lock_name = #name; \ | ||
158 | \ | 165 | \ |
159 | __create_workqueue_key((name), (singlethread), \ | 166 | __create_workqueue_key((name), (singlethread), \ |
160 | (freezeable), &__key); \ | 167 | (freezeable), &__key, \ |
168 | __lock_name); \ | ||
161 | }) | 169 | }) |
162 | #else | 170 | #else |
163 | #define __create_workqueue(name, singlethread, freezeable) \ | 171 | #define __create_workqueue(name, singlethread, freezeable) \ |
164 | __create_workqueue_key((name), (singlethread), (freezeable), NULL) | 172 | __create_workqueue_key((name), (singlethread), (freezeable), NULL, NULL) |
165 | #endif | 173 | #endif |
166 | 174 | ||
167 | #define create_workqueue(name) __create_workqueue((name), 0, 0) | 175 | #define create_workqueue(name) __create_workqueue((name), 0, 0) |
diff --git a/kernel/kmod.c b/kernel/kmod.c index c6a4f8aebeba..bb7df2a28bd7 100644 --- a/kernel/kmod.c +++ b/kernel/kmod.c | |||
@@ -451,13 +451,11 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, | |||
451 | enum umh_wait wait) | 451 | enum umh_wait wait) |
452 | { | 452 | { |
453 | DECLARE_COMPLETION_ONSTACK(done); | 453 | DECLARE_COMPLETION_ONSTACK(done); |
454 | int retval; | 454 | int retval = 0; |
455 | 455 | ||
456 | helper_lock(); | 456 | helper_lock(); |
457 | if (sub_info->path[0] == '\0') { | 457 | if (sub_info->path[0] == '\0') |
458 | retval = 0; | ||
459 | goto out; | 458 | goto out; |
460 | } | ||
461 | 459 | ||
462 | if (!khelper_wq || usermodehelper_disabled) { | 460 | if (!khelper_wq || usermodehelper_disabled) { |
463 | retval = -EBUSY; | 461 | retval = -EBUSY; |
@@ -468,13 +466,14 @@ int call_usermodehelper_exec(struct subprocess_info *sub_info, | |||
468 | sub_info->wait = wait; | 466 | sub_info->wait = wait; |
469 | 467 | ||
470 | queue_work(khelper_wq, &sub_info->work); | 468 | queue_work(khelper_wq, &sub_info->work); |
471 | if (wait == UMH_NO_WAIT) /* task has freed sub_info */ | 469 | if (wait == UMH_NO_WAIT) /* task has freed sub_info */ |
472 | return 0; | 470 | goto unlock; |
473 | wait_for_completion(&done); | 471 | wait_for_completion(&done); |
474 | retval = sub_info->retval; | 472 | retval = sub_info->retval; |
475 | 473 | ||
476 | out: | 474 | out: |
477 | call_usermodehelper_freeinfo(sub_info); | 475 | call_usermodehelper_freeinfo(sub_info); |
476 | unlock: | ||
478 | helper_unlock(); | 477 | helper_unlock(); |
479 | return retval; | 478 | return retval; |
480 | } | 479 | } |
diff --git a/kernel/lockdep.c b/kernel/lockdep.c index 723bd9f92556..4335f12a27c6 100644 --- a/kernel/lockdep.c +++ b/kernel/lockdep.c | |||
@@ -2943,9 +2943,10 @@ void lockdep_free_key_range(void *start, unsigned long size) | |||
2943 | struct list_head *head; | 2943 | struct list_head *head; |
2944 | unsigned long flags; | 2944 | unsigned long flags; |
2945 | int i; | 2945 | int i; |
2946 | int locked; | ||
2946 | 2947 | ||
2947 | raw_local_irq_save(flags); | 2948 | raw_local_irq_save(flags); |
2948 | graph_lock(); | 2949 | locked = graph_lock(); |
2949 | 2950 | ||
2950 | /* | 2951 | /* |
2951 | * Unhash all classes that were created by this module: | 2952 | * Unhash all classes that were created by this module: |
@@ -2959,7 +2960,8 @@ void lockdep_free_key_range(void *start, unsigned long size) | |||
2959 | zap_class(class); | 2960 | zap_class(class); |
2960 | } | 2961 | } |
2961 | 2962 | ||
2962 | graph_unlock(); | 2963 | if (locked) |
2964 | graph_unlock(); | ||
2963 | raw_local_irq_restore(flags); | 2965 | raw_local_irq_restore(flags); |
2964 | } | 2966 | } |
2965 | 2967 | ||
@@ -2969,6 +2971,7 @@ void lockdep_reset_lock(struct lockdep_map *lock) | |||
2969 | struct list_head *head; | 2971 | struct list_head *head; |
2970 | unsigned long flags; | 2972 | unsigned long flags; |
2971 | int i, j; | 2973 | int i, j; |
2974 | int locked; | ||
2972 | 2975 | ||
2973 | raw_local_irq_save(flags); | 2976 | raw_local_irq_save(flags); |
2974 | 2977 | ||
@@ -2987,7 +2990,7 @@ void lockdep_reset_lock(struct lockdep_map *lock) | |||
2987 | * Debug check: in the end all mapped classes should | 2990 | * Debug check: in the end all mapped classes should |
2988 | * be gone. | 2991 | * be gone. |
2989 | */ | 2992 | */ |
2990 | graph_lock(); | 2993 | locked = graph_lock(); |
2991 | for (i = 0; i < CLASSHASH_SIZE; i++) { | 2994 | for (i = 0; i < CLASSHASH_SIZE; i++) { |
2992 | head = classhash_table + i; | 2995 | head = classhash_table + i; |
2993 | if (list_empty(head)) | 2996 | if (list_empty(head)) |
@@ -3000,7 +3003,8 @@ void lockdep_reset_lock(struct lockdep_map *lock) | |||
3000 | } | 3003 | } |
3001 | } | 3004 | } |
3002 | } | 3005 | } |
3003 | graph_unlock(); | 3006 | if (locked) |
3007 | graph_unlock(); | ||
3004 | 3008 | ||
3005 | out_restore: | 3009 | out_restore: |
3006 | raw_local_irq_restore(flags); | 3010 | raw_local_irq_restore(flags); |
diff --git a/kernel/workqueue.c b/kernel/workqueue.c index 52d5e7c9a8e6..8db0b597509e 100644 --- a/kernel/workqueue.c +++ b/kernel/workqueue.c | |||
@@ -722,7 +722,8 @@ static void start_workqueue_thread(struct cpu_workqueue_struct *cwq, int cpu) | |||
722 | struct workqueue_struct *__create_workqueue_key(const char *name, | 722 | struct workqueue_struct *__create_workqueue_key(const char *name, |
723 | int singlethread, | 723 | int singlethread, |
724 | int freezeable, | 724 | int freezeable, |
725 | struct lock_class_key *key) | 725 | struct lock_class_key *key, |
726 | const char *lock_name) | ||
726 | { | 727 | { |
727 | struct workqueue_struct *wq; | 728 | struct workqueue_struct *wq; |
728 | struct cpu_workqueue_struct *cwq; | 729 | struct cpu_workqueue_struct *cwq; |
@@ -739,7 +740,7 @@ struct workqueue_struct *__create_workqueue_key(const char *name, | |||
739 | } | 740 | } |
740 | 741 | ||
741 | wq->name = name; | 742 | wq->name = name; |
742 | lockdep_init_map(&wq->lockdep_map, name, key, 0); | 743 | lockdep_init_map(&wq->lockdep_map, lock_name, key, 0); |
743 | wq->singlethread = singlethread; | 744 | wq->singlethread = singlethread; |
744 | wq->freezeable = freezeable; | 745 | wq->freezeable = freezeable; |
745 | INIT_LIST_HEAD(&wq->list); | 746 | INIT_LIST_HEAD(&wq->list); |
diff --git a/mm/memory.c b/mm/memory.c index 4bf0b6d0eb2a..6dd1cd88bfb6 100644 --- a/mm/memory.c +++ b/mm/memory.c | |||
@@ -392,6 +392,7 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_ | |||
392 | return NULL; | 392 | return NULL; |
393 | } | 393 | } |
394 | 394 | ||
395 | #ifdef CONFIG_DEBUG_VM | ||
395 | /* | 396 | /* |
396 | * Add some anal sanity checks for now. Eventually, | 397 | * Add some anal sanity checks for now. Eventually, |
397 | * we should just do "return pfn_to_page(pfn)", but | 398 | * we should just do "return pfn_to_page(pfn)", but |
@@ -402,6 +403,7 @@ struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_ | |||
402 | print_bad_pte(vma, pte, addr); | 403 | print_bad_pte(vma, pte, addr); |
403 | return NULL; | 404 | return NULL; |
404 | } | 405 | } |
406 | #endif | ||
405 | 407 | ||
406 | /* | 408 | /* |
407 | * NOTE! We still have PageReserved() pages in the page | 409 | * NOTE! We still have PageReserved() pages in the page |
diff --git a/mm/page_alloc.c b/mm/page_alloc.c index e1028fae3ebb..b2838c24e582 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c | |||
@@ -2566,7 +2566,7 @@ static void __meminit zone_init_free_lists(struct pglist_data *pgdat, | |||
2566 | memmap_init_zone((size), (nid), (zone), (start_pfn), MEMMAP_EARLY) | 2566 | memmap_init_zone((size), (nid), (zone), (start_pfn), MEMMAP_EARLY) |
2567 | #endif | 2567 | #endif |
2568 | 2568 | ||
2569 | static int __devinit zone_batchsize(struct zone *zone) | 2569 | static int zone_batchsize(struct zone *zone) |
2570 | { | 2570 | { |
2571 | int batch; | 2571 | int batch; |
2572 | 2572 | ||