diff options
author | Jeff Garzik <jgarzik@pobox.com> | 2005-09-16 02:46:15 -0400 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-09-16 02:46:15 -0400 |
commit | c5f977a0d2d6a8f02f32139b5dd129e52073f38f (patch) | |
tree | 82180b8f21992312ad78becf759f21b9110e72ca | |
parent | f3d242e8f2bf12cb45eb35b7d2e69483d1209b13 (diff) | |
parent | 065d9cac98a5406ecd5a1368f8fd38f55739dee9 (diff) |
Merge /spare/repo/linux-2.6/
80 files changed, 311 insertions, 605 deletions
diff --git a/arch/arm/mach-pxa/lubbock.c b/arch/arm/mach-pxa/lubbock.c index 923f6eb774c0..1f38033921e9 100644 --- a/arch/arm/mach-pxa/lubbock.c +++ b/arch/arm/mach-pxa/lubbock.c | |||
@@ -146,6 +146,11 @@ static struct pxa2xx_udc_mach_info udc_info __initdata = { | |||
146 | // no D+ pullup; lubbock can't connect/disconnect in software | 146 | // no D+ pullup; lubbock can't connect/disconnect in software |
147 | }; | 147 | }; |
148 | 148 | ||
149 | static struct platform_device lub_audio_device = { | ||
150 | .name = "pxa2xx-ac97", | ||
151 | .id = -1, | ||
152 | }; | ||
153 | |||
149 | static struct resource sa1111_resources[] = { | 154 | static struct resource sa1111_resources[] = { |
150 | [0] = { | 155 | [0] = { |
151 | .start = 0x10000000, | 156 | .start = 0x10000000, |
@@ -195,6 +200,7 @@ static struct platform_device smc91x_device = { | |||
195 | 200 | ||
196 | static struct platform_device *devices[] __initdata = { | 201 | static struct platform_device *devices[] __initdata = { |
197 | &sa1111_device, | 202 | &sa1111_device, |
203 | &lub_audio_device, | ||
198 | &smc91x_device, | 204 | &smc91x_device, |
199 | }; | 205 | }; |
200 | 206 | ||
diff --git a/arch/i386/Kconfig b/arch/i386/Kconfig index b22f003eaa6d..d2703cda61ea 100644 --- a/arch/i386/Kconfig +++ b/arch/i386/Kconfig | |||
@@ -908,11 +908,6 @@ config IRQBALANCE | |||
908 | The default yes will allow the kernel to do irq load balancing. | 908 | The default yes will allow the kernel to do irq load balancing. |
909 | Saying no will keep the kernel from doing irq load balancing. | 909 | Saying no will keep the kernel from doing irq load balancing. |
910 | 910 | ||
911 | config HAVE_DEC_LOCK | ||
912 | bool | ||
913 | depends on (SMP || PREEMPT) && X86_CMPXCHG | ||
914 | default y | ||
915 | |||
916 | # turning this on wastes a bunch of space. | 911 | # turning this on wastes a bunch of space. |
917 | # Summit needs it only when NUMA is on | 912 | # Summit needs it only when NUMA is on |
918 | config BOOT_IOREMAP | 913 | config BOOT_IOREMAP |
diff --git a/arch/i386/kernel/acpi/earlyquirk.c b/arch/i386/kernel/acpi/earlyquirk.c index 1ae2aeeda18b..f1b9d2a46dab 100644 --- a/arch/i386/kernel/acpi/earlyquirk.c +++ b/arch/i386/kernel/acpi/earlyquirk.c | |||
@@ -7,7 +7,6 @@ | |||
7 | #include <linux/pci.h> | 7 | #include <linux/pci.h> |
8 | #include <asm/pci-direct.h> | 8 | #include <asm/pci-direct.h> |
9 | #include <asm/acpi.h> | 9 | #include <asm/acpi.h> |
10 | #include <asm/apic.h> | ||
11 | 10 | ||
12 | static int __init check_bridge(int vendor, int device) | 11 | static int __init check_bridge(int vendor, int device) |
13 | { | 12 | { |
@@ -16,15 +15,6 @@ static int __init check_bridge(int vendor, int device) | |||
16 | if (vendor == PCI_VENDOR_ID_NVIDIA) { | 15 | if (vendor == PCI_VENDOR_ID_NVIDIA) { |
17 | acpi_skip_timer_override = 1; | 16 | acpi_skip_timer_override = 1; |
18 | } | 17 | } |
19 | #ifdef CONFIG_X86_LOCAL_APIC | ||
20 | /* | ||
21 | * ATI IXP chipsets get double timer interrupts. | ||
22 | * For now just do this for all ATI chipsets. | ||
23 | * FIXME: this needs to be checked for the non ACPI case too. | ||
24 | */ | ||
25 | if (vendor == PCI_VENDOR_ID_ATI) | ||
26 | disable_timer_pin_1 = 1; | ||
27 | #endif | ||
28 | return 0; | 18 | return 0; |
29 | } | 19 | } |
30 | 20 | ||
diff --git a/arch/i386/lib/Makefile b/arch/i386/lib/Makefile index 7b1932d20f96..914933e9ec3d 100644 --- a/arch/i386/lib/Makefile +++ b/arch/i386/lib/Makefile | |||
@@ -7,4 +7,3 @@ lib-y = checksum.o delay.o usercopy.o getuser.o putuser.o memcpy.o strstr.o \ | |||
7 | bitops.o | 7 | bitops.o |
8 | 8 | ||
9 | lib-$(CONFIG_X86_USE_3DNOW) += mmx.o | 9 | lib-$(CONFIG_X86_USE_3DNOW) += mmx.o |
10 | lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o | ||
diff --git a/arch/i386/lib/dec_and_lock.c b/arch/i386/lib/dec_and_lock.c deleted file mode 100644 index 8b81b2524fa6..000000000000 --- a/arch/i386/lib/dec_and_lock.c +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | * x86 version of "atomic_dec_and_lock()" using | ||
3 | * the atomic "cmpxchg" instruction. | ||
4 | * | ||
5 | * (For CPU's lacking cmpxchg, we use the slow | ||
6 | * generic version, and this one never even gets | ||
7 | * compiled). | ||
8 | */ | ||
9 | |||
10 | #include <linux/spinlock.h> | ||
11 | #include <linux/module.h> | ||
12 | #include <asm/atomic.h> | ||
13 | |||
14 | int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) | ||
15 | { | ||
16 | int counter; | ||
17 | int newcount; | ||
18 | |||
19 | repeat: | ||
20 | counter = atomic_read(atomic); | ||
21 | newcount = counter-1; | ||
22 | |||
23 | if (!newcount) | ||
24 | goto slow_path; | ||
25 | |||
26 | asm volatile("lock; cmpxchgl %1,%2" | ||
27 | :"=a" (newcount) | ||
28 | :"r" (newcount), "m" (atomic->counter), "0" (counter)); | ||
29 | |||
30 | /* If the above failed, "eax" will have changed */ | ||
31 | if (newcount != counter) | ||
32 | goto repeat; | ||
33 | return 0; | ||
34 | |||
35 | slow_path: | ||
36 | spin_lock(lock); | ||
37 | if (atomic_dec_and_test(atomic)) | ||
38 | return 1; | ||
39 | spin_unlock(lock); | ||
40 | return 0; | ||
41 | } | ||
42 | EXPORT_SYMBOL(_atomic_dec_and_lock); | ||
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index ed25d66c8d50..945c15a0722b 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -298,11 +298,6 @@ config PREEMPT | |||
298 | 298 | ||
299 | source "mm/Kconfig" | 299 | source "mm/Kconfig" |
300 | 300 | ||
301 | config HAVE_DEC_LOCK | ||
302 | bool | ||
303 | depends on (SMP || PREEMPT) | ||
304 | default y | ||
305 | |||
306 | config IA32_SUPPORT | 301 | config IA32_SUPPORT |
307 | bool "Support for Linux/x86 binaries" | 302 | bool "Support for Linux/x86 binaries" |
308 | help | 303 | help |
diff --git a/arch/ia64/Makefile b/arch/ia64/Makefile index 70f8ed2748d1..67932ad53082 100644 --- a/arch/ia64/Makefile +++ b/arch/ia64/Makefile | |||
@@ -82,17 +82,7 @@ unwcheck: vmlinux | |||
82 | archclean: | 82 | archclean: |
83 | $(Q)$(MAKE) $(clean)=$(boot) | 83 | $(Q)$(MAKE) $(clean)=$(boot) |
84 | 84 | ||
85 | archprepare: include/asm-ia64/.offsets.h.stamp | 85 | CLEAN_FILES += vmlinux.gz bootloader |
86 | |||
87 | include/asm-ia64/.offsets.h.stamp: | ||
88 | mkdir -p include/asm-ia64 | ||
89 | [ -s include/asm-ia64/asm-offsets.h ] \ | ||
90 | || echo "#define IA64_TASK_SIZE 0" > include/asm-ia64/asm-offsets.h | ||
91 | touch $@ | ||
92 | |||
93 | |||
94 | |||
95 | CLEAN_FILES += vmlinux.gz bootloader include/asm-ia64/.offsets.h.stamp | ||
96 | 86 | ||
97 | boot: lib/lib.a vmlinux | 87 | boot: lib/lib.a vmlinux |
98 | $(Q)$(MAKE) $(build)=$(boot) $@ | 88 | $(Q)$(MAKE) $(build)=$(boot) $@ |
diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c index 31de70b7c67f..a7280d9f6c16 100644 --- a/arch/ia64/ia32/binfmt_elf32.c +++ b/arch/ia64/ia32/binfmt_elf32.c | |||
@@ -216,12 +216,6 @@ ia32_setup_arg_pages (struct linux_binprm *bprm, int executable_stack) | |||
216 | if (!mpnt) | 216 | if (!mpnt) |
217 | return -ENOMEM; | 217 | return -ENOMEM; |
218 | 218 | ||
219 | if (security_vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p)) | ||
220 | >> PAGE_SHIFT)) { | ||
221 | kmem_cache_free(vm_area_cachep, mpnt); | ||
222 | return -ENOMEM; | ||
223 | } | ||
224 | |||
225 | memset(mpnt, 0, sizeof(*mpnt)); | 219 | memset(mpnt, 0, sizeof(*mpnt)); |
226 | 220 | ||
227 | down_write(¤t->mm->mmap_sem); | 221 | down_write(¤t->mm->mmap_sem); |
diff --git a/arch/ia64/kernel/asm-offsets.c b/arch/ia64/kernel/asm-offsets.c index f6a234289341..77225659e968 100644 --- a/arch/ia64/kernel/asm-offsets.c +++ b/arch/ia64/kernel/asm-offsets.c | |||
@@ -4,6 +4,7 @@ | |||
4 | * to extract and format the required data. | 4 | * to extract and format the required data. |
5 | */ | 5 | */ |
6 | 6 | ||
7 | #define ASM_OFFSETS_C 1 | ||
7 | #include <linux/config.h> | 8 | #include <linux/config.h> |
8 | 9 | ||
9 | #include <linux/sched.h> | 10 | #include <linux/sched.h> |
diff --git a/arch/ia64/lib/Makefile b/arch/ia64/lib/Makefile index 799407e7726f..cb1af597370b 100644 --- a/arch/ia64/lib/Makefile +++ b/arch/ia64/lib/Makefile | |||
@@ -15,7 +15,6 @@ lib-$(CONFIG_ITANIUM) += copy_page.o copy_user.o memcpy.o | |||
15 | lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o | 15 | lib-$(CONFIG_MCKINLEY) += copy_page_mck.o memcpy_mck.o |
16 | lib-$(CONFIG_PERFMON) += carta_random.o | 16 | lib-$(CONFIG_PERFMON) += carta_random.o |
17 | lib-$(CONFIG_MD_RAID5) += xor.o | 17 | lib-$(CONFIG_MD_RAID5) += xor.o |
18 | lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o | ||
19 | 18 | ||
20 | AFLAGS___divdi3.o = | 19 | AFLAGS___divdi3.o = |
21 | AFLAGS___udivdi3.o = -DUNSIGNED | 20 | AFLAGS___udivdi3.o = -DUNSIGNED |
diff --git a/arch/ia64/lib/dec_and_lock.c b/arch/ia64/lib/dec_and_lock.c deleted file mode 100644 index c7ce92f968f1..000000000000 --- a/arch/ia64/lib/dec_and_lock.c +++ /dev/null | |||
@@ -1,42 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2003 Jerome Marchand, Bull S.A. | ||
3 | * Cleaned up by David Mosberger-Tang <davidm@hpl.hp.com> | ||
4 | * | ||
5 | * This file is released under the GPLv2, or at your option any later version. | ||
6 | * | ||
7 | * ia64 version of "atomic_dec_and_lock()" using the atomic "cmpxchg" instruction. This | ||
8 | * code is an adaptation of the x86 version of "atomic_dec_and_lock()". | ||
9 | */ | ||
10 | |||
11 | #include <linux/compiler.h> | ||
12 | #include <linux/module.h> | ||
13 | #include <linux/spinlock.h> | ||
14 | #include <asm/atomic.h> | ||
15 | |||
16 | /* | ||
17 | * Decrement REFCOUNT and if the count reaches zero, acquire the spinlock. Both of these | ||
18 | * operations have to be done atomically, so that the count doesn't drop to zero without | ||
19 | * acquiring the spinlock first. | ||
20 | */ | ||
21 | int | ||
22 | _atomic_dec_and_lock (atomic_t *refcount, spinlock_t *lock) | ||
23 | { | ||
24 | int old, new; | ||
25 | |||
26 | do { | ||
27 | old = atomic_read(refcount); | ||
28 | new = old - 1; | ||
29 | |||
30 | if (unlikely (old == 1)) { | ||
31 | /* oops, we may be decrementing to zero, do it the slow way... */ | ||
32 | spin_lock(lock); | ||
33 | if (atomic_dec_and_test(refcount)) | ||
34 | return 1; | ||
35 | spin_unlock(lock); | ||
36 | return 0; | ||
37 | } | ||
38 | } while (cmpxchg(&refcount->counter, old, new) != old); | ||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | EXPORT_SYMBOL(_atomic_dec_and_lock); | ||
diff --git a/arch/m32r/Kconfig b/arch/m32r/Kconfig index 1ef3987ebc6a..4d100f3886e1 100644 --- a/arch/m32r/Kconfig +++ b/arch/m32r/Kconfig | |||
@@ -220,11 +220,6 @@ config PREEMPT | |||
220 | Say Y here if you are building a kernel for a desktop, embedded | 220 | Say Y here if you are building a kernel for a desktop, embedded |
221 | or real-time system. Say N if you are unsure. | 221 | or real-time system. Say N if you are unsure. |
222 | 222 | ||
223 | config HAVE_DEC_LOCK | ||
224 | bool | ||
225 | depends on (SMP || PREEMPT) | ||
226 | default n | ||
227 | |||
228 | config SMP | 223 | config SMP |
229 | bool "Symmetric multi-processing support" | 224 | bool "Symmetric multi-processing support" |
230 | ---help--- | 225 | ---help--- |
diff --git a/arch/mips/Kconfig b/arch/mips/Kconfig index 0eb71ac303af..4cd724c05700 100644 --- a/arch/mips/Kconfig +++ b/arch/mips/Kconfig | |||
@@ -1009,10 +1009,6 @@ config GENERIC_CALIBRATE_DELAY | |||
1009 | bool | 1009 | bool |
1010 | default y | 1010 | default y |
1011 | 1011 | ||
1012 | config HAVE_DEC_LOCK | ||
1013 | bool | ||
1014 | default y | ||
1015 | |||
1016 | # | 1012 | # |
1017 | # Select some configuration options automatically based on user selections. | 1013 | # Select some configuration options automatically based on user selections. |
1018 | # | 1014 | # |
diff --git a/arch/mips/kernel/sysirix.c b/arch/mips/kernel/sysirix.c index 4de155699c4f..7ae4af476974 100644 --- a/arch/mips/kernel/sysirix.c +++ b/arch/mips/kernel/sysirix.c | |||
@@ -581,18 +581,13 @@ asmlinkage int irix_brk(unsigned long brk) | |||
581 | } | 581 | } |
582 | 582 | ||
583 | /* | 583 | /* |
584 | * Check if we have enough memory.. | 584 | * Ok, looks good - let it rip. |
585 | */ | 585 | */ |
586 | if (security_vm_enough_memory((newbrk-oldbrk) >> PAGE_SHIFT)) { | 586 | if (do_brk(oldbrk, newbrk-oldbrk) != oldbrk) { |
587 | ret = -ENOMEM; | 587 | ret = -ENOMEM; |
588 | goto out; | 588 | goto out; |
589 | } | 589 | } |
590 | |||
591 | /* | ||
592 | * Ok, looks good - let it rip. | ||
593 | */ | ||
594 | mm->brk = brk; | 590 | mm->brk = brk; |
595 | do_brk(oldbrk, newbrk-oldbrk); | ||
596 | ret = 0; | 591 | ret = 0; |
597 | 592 | ||
598 | out: | 593 | out: |
diff --git a/arch/mips/lib/Makefile b/arch/mips/lib/Makefile index 21b92b9dd013..037303412909 100644 --- a/arch/mips/lib/Makefile +++ b/arch/mips/lib/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for MIPS-specific library files.. | 2 | # Makefile for MIPS-specific library files.. |
3 | # | 3 | # |
4 | 4 | ||
5 | lib-y += csum_partial_copy.o dec_and_lock.o memcpy.o promlib.o \ | 5 | lib-y += csum_partial_copy.o memcpy.o promlib.o \ |
6 | strlen_user.o strncpy_user.o strnlen_user.o | 6 | strlen_user.o strncpy_user.o strnlen_user.o |
7 | 7 | ||
8 | obj-y += iomap.o | 8 | obj-y += iomap.o |
diff --git a/arch/mips/lib/dec_and_lock.c b/arch/mips/lib/dec_and_lock.c deleted file mode 100644 index fd82c84a93b7..000000000000 --- a/arch/mips/lib/dec_and_lock.c +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /* | ||
2 | * MIPS version of atomic_dec_and_lock() using cmpxchg | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #include <linux/module.h> | ||
11 | #include <linux/spinlock.h> | ||
12 | #include <asm/atomic.h> | ||
13 | #include <asm/system.h> | ||
14 | |||
15 | /* | ||
16 | * This is an implementation of the notion of "decrement a | ||
17 | * reference count, and return locked if it decremented to zero". | ||
18 | * | ||
19 | * This implementation can be used on any architecture that | ||
20 | * has a cmpxchg, and where atomic->value is an int holding | ||
21 | * the value of the atomic (i.e. the high bits aren't used | ||
22 | * for a lock or anything like that). | ||
23 | */ | ||
24 | int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) | ||
25 | { | ||
26 | int counter; | ||
27 | int newcount; | ||
28 | |||
29 | for (;;) { | ||
30 | counter = atomic_read(atomic); | ||
31 | newcount = counter - 1; | ||
32 | if (!newcount) | ||
33 | break; /* do it the slow way */ | ||
34 | |||
35 | newcount = cmpxchg(&atomic->counter, counter, newcount); | ||
36 | if (newcount == counter) | ||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | spin_lock(lock); | ||
41 | if (atomic_dec_and_test(atomic)) | ||
42 | return 1; | ||
43 | spin_unlock(lock); | ||
44 | return 0; | ||
45 | } | ||
46 | |||
47 | EXPORT_SYMBOL(_atomic_dec_and_lock); | ||
diff --git a/arch/ppc/Kconfig b/arch/ppc/Kconfig index 347ea284140b..776941c75672 100644 --- a/arch/ppc/Kconfig +++ b/arch/ppc/Kconfig | |||
@@ -26,10 +26,6 @@ config GENERIC_CALIBRATE_DELAY | |||
26 | bool | 26 | bool |
27 | default y | 27 | default y |
28 | 28 | ||
29 | config HAVE_DEC_LOCK | ||
30 | bool | ||
31 | default y | ||
32 | |||
33 | config PPC | 29 | config PPC |
34 | bool | 30 | bool |
35 | default y | 31 | default y |
diff --git a/arch/ppc/lib/Makefile b/arch/ppc/lib/Makefile index f1e1fb4144f0..50358e4ea159 100644 --- a/arch/ppc/lib/Makefile +++ b/arch/ppc/lib/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for ppc-specific library files.. | 2 | # Makefile for ppc-specific library files.. |
3 | # | 3 | # |
4 | 4 | ||
5 | obj-y := checksum.o string.o strcase.o dec_and_lock.o div64.o | 5 | obj-y := checksum.o string.o strcase.o div64.o |
6 | 6 | ||
7 | obj-$(CONFIG_8xx) += rheap.o | 7 | obj-$(CONFIG_8xx) += rheap.o |
8 | obj-$(CONFIG_CPM2) += rheap.o | 8 | obj-$(CONFIG_CPM2) += rheap.o |
diff --git a/arch/ppc/lib/dec_and_lock.c b/arch/ppc/lib/dec_and_lock.c deleted file mode 100644 index b18f0d9a00fc..000000000000 --- a/arch/ppc/lib/dec_and_lock.c +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | #include <linux/module.h> | ||
2 | #include <linux/spinlock.h> | ||
3 | #include <asm/atomic.h> | ||
4 | #include <asm/system.h> | ||
5 | |||
6 | /* | ||
7 | * This is an implementation of the notion of "decrement a | ||
8 | * reference count, and return locked if it decremented to zero". | ||
9 | * | ||
10 | * This implementation can be used on any architecture that | ||
11 | * has a cmpxchg, and where atomic->value is an int holding | ||
12 | * the value of the atomic (i.e. the high bits aren't used | ||
13 | * for a lock or anything like that). | ||
14 | */ | ||
15 | int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) | ||
16 | { | ||
17 | int counter; | ||
18 | int newcount; | ||
19 | |||
20 | for (;;) { | ||
21 | counter = atomic_read(atomic); | ||
22 | newcount = counter - 1; | ||
23 | if (!newcount) | ||
24 | break; /* do it the slow way */ | ||
25 | |||
26 | newcount = cmpxchg(&atomic->counter, counter, newcount); | ||
27 | if (newcount == counter) | ||
28 | return 0; | ||
29 | } | ||
30 | |||
31 | spin_lock(lock); | ||
32 | if (atomic_dec_and_test(atomic)) | ||
33 | return 1; | ||
34 | spin_unlock(lock); | ||
35 | return 0; | ||
36 | } | ||
37 | |||
38 | EXPORT_SYMBOL(_atomic_dec_and_lock); | ||
diff --git a/arch/ppc64/Kconfig b/arch/ppc64/Kconfig index deca68ad644a..c658650af429 100644 --- a/arch/ppc64/Kconfig +++ b/arch/ppc64/Kconfig | |||
@@ -28,10 +28,6 @@ config GENERIC_ISA_DMA | |||
28 | bool | 28 | bool |
29 | default y | 29 | default y |
30 | 30 | ||
31 | config HAVE_DEC_LOCK | ||
32 | bool | ||
33 | default y | ||
34 | |||
35 | config EARLY_PRINTK | 31 | config EARLY_PRINTK |
36 | bool | 32 | bool |
37 | default y | 33 | default y |
diff --git a/arch/ppc64/kernel/head.S b/arch/ppc64/kernel/head.S index 58c314738c99..72c61041151a 100644 --- a/arch/ppc64/kernel/head.S +++ b/arch/ppc64/kernel/head.S | |||
@@ -1649,7 +1649,7 @@ _GLOBAL(__secondary_start) | |||
1649 | ld r3,0(r3) | 1649 | ld r3,0(r3) |
1650 | lwz r3,PLATFORM(r3) /* r3 = platform flags */ | 1650 | lwz r3,PLATFORM(r3) /* r3 = platform flags */ |
1651 | andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ | 1651 | andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ |
1652 | bne 98f | 1652 | beq 98f /* branch if result is 0 */ |
1653 | mfspr r3,PVR | 1653 | mfspr r3,PVR |
1654 | srwi r3,r3,16 | 1654 | srwi r3,r3,16 |
1655 | cmpwi r3,0x37 /* SStar */ | 1655 | cmpwi r3,0x37 /* SStar */ |
@@ -1813,7 +1813,7 @@ _STATIC(start_here_multiplatform) | |||
1813 | ld r3,0(r3) | 1813 | ld r3,0(r3) |
1814 | lwz r3,PLATFORM(r3) /* r3 = platform flags */ | 1814 | lwz r3,PLATFORM(r3) /* r3 = platform flags */ |
1815 | andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ | 1815 | andi. r3,r3,PLATFORM_LPAR /* Test if bit 0 is set (LPAR bit) */ |
1816 | bne 98f | 1816 | beq 98f /* branch if result is 0 */ |
1817 | mfspr r3,PVR | 1817 | mfspr r3,PVR |
1818 | srwi r3,r3,16 | 1818 | srwi r3,r3,16 |
1819 | cmpwi r3,0x37 /* SStar */ | 1819 | cmpwi r3,0x37 /* SStar */ |
@@ -1834,7 +1834,7 @@ _STATIC(start_here_multiplatform) | |||
1834 | lwz r3,PLATFORM(r3) /* r3 = platform flags */ | 1834 | lwz r3,PLATFORM(r3) /* r3 = platform flags */ |
1835 | /* Test if bit 0 is set (LPAR bit) */ | 1835 | /* Test if bit 0 is set (LPAR bit) */ |
1836 | andi. r3,r3,PLATFORM_LPAR | 1836 | andi. r3,r3,PLATFORM_LPAR |
1837 | bne 98f | 1837 | bne 98f /* branch if result is !0 */ |
1838 | LOADADDR(r6,_SDR1) /* Only if NOT LPAR */ | 1838 | LOADADDR(r6,_SDR1) /* Only if NOT LPAR */ |
1839 | sub r6,r6,r26 | 1839 | sub r6,r6,r26 |
1840 | ld r6,0(r6) /* get the value of _SDR1 */ | 1840 | ld r6,0(r6) /* get the value of _SDR1 */ |
diff --git a/arch/ppc64/kernel/vdso.c b/arch/ppc64/kernel/vdso.c index 4777676365fe..efa985f05aca 100644 --- a/arch/ppc64/kernel/vdso.c +++ b/arch/ppc64/kernel/vdso.c | |||
@@ -224,10 +224,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack) | |||
224 | vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); | 224 | vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); |
225 | if (vma == NULL) | 225 | if (vma == NULL) |
226 | return -ENOMEM; | 226 | return -ENOMEM; |
227 | if (security_vm_enough_memory(vdso_pages)) { | 227 | |
228 | kmem_cache_free(vm_area_cachep, vma); | ||
229 | return -ENOMEM; | ||
230 | } | ||
231 | memset(vma, 0, sizeof(*vma)); | 228 | memset(vma, 0, sizeof(*vma)); |
232 | 229 | ||
233 | /* | 230 | /* |
@@ -237,8 +234,10 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack) | |||
237 | */ | 234 | */ |
238 | vdso_base = get_unmapped_area(NULL, vdso_base, | 235 | vdso_base = get_unmapped_area(NULL, vdso_base, |
239 | vdso_pages << PAGE_SHIFT, 0, 0); | 236 | vdso_pages << PAGE_SHIFT, 0, 0); |
240 | if (vdso_base & ~PAGE_MASK) | 237 | if (vdso_base & ~PAGE_MASK) { |
238 | kmem_cache_free(vm_area_cachep, vma); | ||
241 | return (int)vdso_base; | 239 | return (int)vdso_base; |
240 | } | ||
242 | 241 | ||
243 | current->thread.vdso_base = vdso_base; | 242 | current->thread.vdso_base = vdso_base; |
244 | 243 | ||
@@ -266,7 +265,11 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, int executable_stack) | |||
266 | vma->vm_ops = &vdso_vmops; | 265 | vma->vm_ops = &vdso_vmops; |
267 | 266 | ||
268 | down_write(&mm->mmap_sem); | 267 | down_write(&mm->mmap_sem); |
269 | insert_vm_struct(mm, vma); | 268 | if (insert_vm_struct(mm, vma)) { |
269 | up_write(&mm->mmap_sem); | ||
270 | kmem_cache_free(vm_area_cachep, vma); | ||
271 | return -ENOMEM; | ||
272 | } | ||
270 | mm->total_vm += (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; | 273 | mm->total_vm += (vma->vm_end - vma->vm_start) >> PAGE_SHIFT; |
271 | up_write(&mm->mmap_sem); | 274 | up_write(&mm->mmap_sem); |
272 | 275 | ||
diff --git a/arch/ppc64/lib/Makefile b/arch/ppc64/lib/Makefile index 76fbfa9f706f..0b6e967de948 100644 --- a/arch/ppc64/lib/Makefile +++ b/arch/ppc64/lib/Makefile | |||
@@ -2,7 +2,7 @@ | |||
2 | # Makefile for ppc64-specific library files.. | 2 | # Makefile for ppc64-specific library files.. |
3 | # | 3 | # |
4 | 4 | ||
5 | lib-y := checksum.o dec_and_lock.o string.o strcase.o | 5 | lib-y := checksum.o string.o strcase.o |
6 | lib-y += copypage.o memcpy.o copyuser.o usercopy.o | 6 | lib-y += copypage.o memcpy.o copyuser.o usercopy.o |
7 | 7 | ||
8 | # Lock primitives are defined as no-ops in include/linux/spinlock.h | 8 | # Lock primitives are defined as no-ops in include/linux/spinlock.h |
diff --git a/arch/ppc64/lib/dec_and_lock.c b/arch/ppc64/lib/dec_and_lock.c deleted file mode 100644 index 7b9d4da5cf92..000000000000 --- a/arch/ppc64/lib/dec_and_lock.c +++ /dev/null | |||
@@ -1,47 +0,0 @@ | |||
1 | /* | ||
2 | * ppc64 version of atomic_dec_and_lock() using cmpxchg | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version | ||
7 | * 2 of the License, or (at your option) any later version. | ||
8 | */ | ||
9 | |||
10 | #include <linux/module.h> | ||
11 | #include <linux/spinlock.h> | ||
12 | #include <asm/atomic.h> | ||
13 | #include <asm/system.h> | ||
14 | |||
15 | /* | ||
16 | * This is an implementation of the notion of "decrement a | ||
17 | * reference count, and return locked if it decremented to zero". | ||
18 | * | ||
19 | * This implementation can be used on any architecture that | ||
20 | * has a cmpxchg, and where atomic->value is an int holding | ||
21 | * the value of the atomic (i.e. the high bits aren't used | ||
22 | * for a lock or anything like that). | ||
23 | */ | ||
24 | int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) | ||
25 | { | ||
26 | int counter; | ||
27 | int newcount; | ||
28 | |||
29 | for (;;) { | ||
30 | counter = atomic_read(atomic); | ||
31 | newcount = counter - 1; | ||
32 | if (!newcount) | ||
33 | break; /* do it the slow way */ | ||
34 | |||
35 | newcount = cmpxchg(&atomic->counter, counter, newcount); | ||
36 | if (newcount == counter) | ||
37 | return 0; | ||
38 | } | ||
39 | |||
40 | spin_lock(lock); | ||
41 | if (atomic_dec_and_test(atomic)) | ||
42 | return 1; | ||
43 | spin_unlock(lock); | ||
44 | return 0; | ||
45 | } | ||
46 | |||
47 | EXPORT_SYMBOL(_atomic_dec_and_lock); | ||
diff --git a/arch/sparc64/Kconfig.debug b/arch/sparc64/Kconfig.debug index cd8d39fb954d..af0e9411b83e 100644 --- a/arch/sparc64/Kconfig.debug +++ b/arch/sparc64/Kconfig.debug | |||
@@ -33,14 +33,6 @@ config DEBUG_BOOTMEM | |||
33 | depends on DEBUG_KERNEL | 33 | depends on DEBUG_KERNEL |
34 | bool "Debug BOOTMEM initialization" | 34 | bool "Debug BOOTMEM initialization" |
35 | 35 | ||
36 | # We have a custom atomic_dec_and_lock() implementation but it's not | ||
37 | # compatible with spinlock debugging so we need to fall back on | ||
38 | # the generic version in that case. | ||
39 | config HAVE_DEC_LOCK | ||
40 | bool | ||
41 | depends on SMP && !DEBUG_SPINLOCK | ||
42 | default y | ||
43 | |||
44 | config MCOUNT | 36 | config MCOUNT |
45 | bool | 37 | bool |
46 | depends on STACK_DEBUG | 38 | depends on STACK_DEBUG |
diff --git a/arch/sparc64/kernel/sparc64_ksyms.c b/arch/sparc64/kernel/sparc64_ksyms.c index cbb5e59824e5..fb7a5370dbfc 100644 --- a/arch/sparc64/kernel/sparc64_ksyms.c +++ b/arch/sparc64/kernel/sparc64_ksyms.c | |||
@@ -163,9 +163,6 @@ EXPORT_SYMBOL(atomic64_add); | |||
163 | EXPORT_SYMBOL(atomic64_add_ret); | 163 | EXPORT_SYMBOL(atomic64_add_ret); |
164 | EXPORT_SYMBOL(atomic64_sub); | 164 | EXPORT_SYMBOL(atomic64_sub); |
165 | EXPORT_SYMBOL(atomic64_sub_ret); | 165 | EXPORT_SYMBOL(atomic64_sub_ret); |
166 | #ifdef CONFIG_SMP | ||
167 | EXPORT_SYMBOL(_atomic_dec_and_lock); | ||
168 | #endif | ||
169 | 166 | ||
170 | /* Atomic bit operations. */ | 167 | /* Atomic bit operations. */ |
171 | EXPORT_SYMBOL(test_and_set_bit); | 168 | EXPORT_SYMBOL(test_and_set_bit); |
diff --git a/arch/sparc64/lib/Makefile b/arch/sparc64/lib/Makefile index d968aebe83b2..c295806500f7 100644 --- a/arch/sparc64/lib/Makefile +++ b/arch/sparc64/lib/Makefile | |||
@@ -14,6 +14,4 @@ lib-y := PeeCeeI.o copy_page.o clear_page.o strlen.o strncmp.o \ | |||
14 | copy_in_user.o user_fixup.o memmove.o \ | 14 | copy_in_user.o user_fixup.o memmove.o \ |
15 | mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o | 15 | mcount.o ipcsum.o rwsem.o xor.o find_bit.o delay.o |
16 | 16 | ||
17 | lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o | ||
18 | |||
19 | obj-y += iomap.o | 17 | obj-y += iomap.o |
diff --git a/arch/sparc64/lib/dec_and_lock.S b/arch/sparc64/lib/dec_and_lock.S deleted file mode 100644 index 8ee288dd0afc..000000000000 --- a/arch/sparc64/lib/dec_and_lock.S +++ /dev/null | |||
@@ -1,80 +0,0 @@ | |||
1 | /* $Id: dec_and_lock.S,v 1.5 2001/11/18 00:12:56 davem Exp $ | ||
2 | * dec_and_lock.S: Sparc64 version of "atomic_dec_and_lock()" | ||
3 | * using cas and ldstub instructions. | ||
4 | * | ||
5 | * Copyright (C) 2000 David S. Miller (davem@redhat.com) | ||
6 | */ | ||
7 | #include <linux/config.h> | ||
8 | #include <asm/thread_info.h> | ||
9 | |||
10 | .text | ||
11 | .align 64 | ||
12 | |||
13 | /* CAS basically works like this: | ||
14 | * | ||
15 | * void CAS(MEM, REG1, REG2) | ||
16 | * { | ||
17 | * START_ATOMIC(); | ||
18 | * if (*(MEM) == REG1) { | ||
19 | * TMP = *(MEM); | ||
20 | * *(MEM) = REG2; | ||
21 | * REG2 = TMP; | ||
22 | * } else | ||
23 | * REG2 = *(MEM); | ||
24 | * END_ATOMIC(); | ||
25 | * } | ||
26 | */ | ||
27 | |||
28 | .globl _atomic_dec_and_lock | ||
29 | _atomic_dec_and_lock: /* %o0 = counter, %o1 = lock */ | ||
30 | loop1: lduw [%o0], %g2 | ||
31 | subcc %g2, 1, %g7 | ||
32 | be,pn %icc, start_to_zero | ||
33 | nop | ||
34 | nzero: cas [%o0], %g2, %g7 | ||
35 | cmp %g2, %g7 | ||
36 | bne,pn %icc, loop1 | ||
37 | mov 0, %g1 | ||
38 | |||
39 | out: | ||
40 | membar #StoreLoad | #StoreStore | ||
41 | retl | ||
42 | mov %g1, %o0 | ||
43 | start_to_zero: | ||
44 | #ifdef CONFIG_PREEMPT | ||
45 | ldsw [%g6 + TI_PRE_COUNT], %g3 | ||
46 | add %g3, 1, %g3 | ||
47 | stw %g3, [%g6 + TI_PRE_COUNT] | ||
48 | #endif | ||
49 | to_zero: | ||
50 | ldstub [%o1], %g3 | ||
51 | membar #StoreLoad | #StoreStore | ||
52 | brnz,pn %g3, spin_on_lock | ||
53 | nop | ||
54 | loop2: cas [%o0], %g2, %g7 /* ASSERT(g7 == 0) */ | ||
55 | cmp %g2, %g7 | ||
56 | |||
57 | be,pt %icc, out | ||
58 | mov 1, %g1 | ||
59 | lduw [%o0], %g2 | ||
60 | subcc %g2, 1, %g7 | ||
61 | be,pn %icc, loop2 | ||
62 | nop | ||
63 | membar #StoreStore | #LoadStore | ||
64 | stb %g0, [%o1] | ||
65 | #ifdef CONFIG_PREEMPT | ||
66 | ldsw [%g6 + TI_PRE_COUNT], %g3 | ||
67 | sub %g3, 1, %g3 | ||
68 | stw %g3, [%g6 + TI_PRE_COUNT] | ||
69 | #endif | ||
70 | |||
71 | b,pt %xcc, nzero | ||
72 | nop | ||
73 | spin_on_lock: | ||
74 | ldub [%o1], %g3 | ||
75 | membar #LoadLoad | ||
76 | brnz,pt %g3, spin_on_lock | ||
77 | nop | ||
78 | ba,pt %xcc, to_zero | ||
79 | nop | ||
80 | nop | ||
diff --git a/arch/x86_64/Kconfig b/arch/x86_64/Kconfig index e63323e03ea9..0969d570f3b5 100644 --- a/arch/x86_64/Kconfig +++ b/arch/x86_64/Kconfig | |||
@@ -277,11 +277,6 @@ source "mm/Kconfig" | |||
277 | config HAVE_ARCH_EARLY_PFN_TO_NID | 277 | config HAVE_ARCH_EARLY_PFN_TO_NID |
278 | def_bool y | 278 | def_bool y |
279 | 279 | ||
280 | config HAVE_DEC_LOCK | ||
281 | bool | ||
282 | depends on SMP | ||
283 | default y | ||
284 | |||
285 | config NR_CPUS | 280 | config NR_CPUS |
286 | int "Maximum number of CPUs (2-256)" | 281 | int "Maximum number of CPUs (2-256)" |
287 | range 2 256 | 282 | range 2 256 |
diff --git a/arch/x86_64/ia32/ia32_binfmt.c b/arch/x86_64/ia32/ia32_binfmt.c index c8131f342cfc..d9161e395978 100644 --- a/arch/x86_64/ia32/ia32_binfmt.c +++ b/arch/x86_64/ia32/ia32_binfmt.c | |||
@@ -353,11 +353,6 @@ int setup_arg_pages(struct linux_binprm *bprm, unsigned long stack_top, int exec | |||
353 | mpnt = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); | 353 | mpnt = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); |
354 | if (!mpnt) | 354 | if (!mpnt) |
355 | return -ENOMEM; | 355 | return -ENOMEM; |
356 | |||
357 | if (security_vm_enough_memory((IA32_STACK_TOP - (PAGE_MASK & (unsigned long) bprm->p))>>PAGE_SHIFT)) { | ||
358 | kmem_cache_free(vm_area_cachep, mpnt); | ||
359 | return -ENOMEM; | ||
360 | } | ||
361 | 356 | ||
362 | memset(mpnt, 0, sizeof(*mpnt)); | 357 | memset(mpnt, 0, sizeof(*mpnt)); |
363 | 358 | ||
diff --git a/arch/x86_64/ia32/syscall32.c b/arch/x86_64/ia32/syscall32.c index adbc5f8089e9..3a01329473ab 100644 --- a/arch/x86_64/ia32/syscall32.c +++ b/arch/x86_64/ia32/syscall32.c | |||
@@ -52,17 +52,13 @@ int syscall32_setup_pages(struct linux_binprm *bprm, int exstack) | |||
52 | vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); | 52 | vma = kmem_cache_alloc(vm_area_cachep, SLAB_KERNEL); |
53 | if (!vma) | 53 | if (!vma) |
54 | return -ENOMEM; | 54 | return -ENOMEM; |
55 | if (security_vm_enough_memory(npages)) { | ||
56 | kmem_cache_free(vm_area_cachep, vma); | ||
57 | return -ENOMEM; | ||
58 | } | ||
59 | 55 | ||
60 | memset(vma, 0, sizeof(struct vm_area_struct)); | 56 | memset(vma, 0, sizeof(struct vm_area_struct)); |
61 | /* Could randomize here */ | 57 | /* Could randomize here */ |
62 | vma->vm_start = VSYSCALL32_BASE; | 58 | vma->vm_start = VSYSCALL32_BASE; |
63 | vma->vm_end = VSYSCALL32_END; | 59 | vma->vm_end = VSYSCALL32_END; |
64 | /* MAYWRITE to allow gdb to COW and set breakpoints */ | 60 | /* MAYWRITE to allow gdb to COW and set breakpoints */ |
65 | vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYEXEC|VM_MAYWRITE; | 61 | vma->vm_flags = VM_READ|VM_EXEC|VM_MAYREAD|VM_MAYEXEC|VM_MAYWRITE; |
66 | vma->vm_flags |= mm->def_flags; | 62 | vma->vm_flags |= mm->def_flags; |
67 | vma->vm_page_prot = protection_map[vma->vm_flags & 7]; | 63 | vma->vm_page_prot = protection_map[vma->vm_flags & 7]; |
68 | vma->vm_ops = &syscall32_vm_ops; | 64 | vma->vm_ops = &syscall32_vm_ops; |
diff --git a/arch/x86_64/kernel/io_apic.c b/arch/x86_64/kernel/io_apic.c index 522944a000ad..c8eee20cd519 100644 --- a/arch/x86_64/kernel/io_apic.c +++ b/arch/x86_64/kernel/io_apic.c | |||
@@ -299,15 +299,6 @@ void __init check_ioapic(void) | |||
299 | #endif | 299 | #endif |
300 | /* RED-PEN skip them on mptables too? */ | 300 | /* RED-PEN skip them on mptables too? */ |
301 | return; | 301 | return; |
302 | case PCI_VENDOR_ID_ATI: | ||
303 | /* All timer interrupts on atiixp | ||
304 | are doubled. Disable one. */ | ||
305 | if (disable_timer_pin_1 == 0) { | ||
306 | disable_timer_pin_1 = 1; | ||
307 | printk(KERN_INFO | ||
308 | "ATI board detected. Disabling timer pin 1.\n"); | ||
309 | } | ||
310 | return; | ||
311 | } | 302 | } |
312 | 303 | ||
313 | /* No multi-function device? */ | 304 | /* No multi-function device? */ |
diff --git a/arch/x86_64/kernel/x8664_ksyms.c b/arch/x86_64/kernel/x8664_ksyms.c index 68ec03070e5a..fd99ddd009bc 100644 --- a/arch/x86_64/kernel/x8664_ksyms.c +++ b/arch/x86_64/kernel/x8664_ksyms.c | |||
@@ -178,10 +178,6 @@ EXPORT_SYMBOL(rwsem_down_write_failed_thunk); | |||
178 | 178 | ||
179 | EXPORT_SYMBOL(empty_zero_page); | 179 | EXPORT_SYMBOL(empty_zero_page); |
180 | 180 | ||
181 | #ifdef CONFIG_HAVE_DEC_LOCK | ||
182 | EXPORT_SYMBOL(_atomic_dec_and_lock); | ||
183 | #endif | ||
184 | |||
185 | EXPORT_SYMBOL(die_chain); | 181 | EXPORT_SYMBOL(die_chain); |
186 | EXPORT_SYMBOL(register_die_notifier); | 182 | EXPORT_SYMBOL(register_die_notifier); |
187 | 183 | ||
diff --git a/arch/x86_64/lib/Makefile b/arch/x86_64/lib/Makefile index 6b26a1c1e9ff..bba5db6cebd6 100644 --- a/arch/x86_64/lib/Makefile +++ b/arch/x86_64/lib/Makefile | |||
@@ -10,5 +10,3 @@ lib-y := csum-partial.o csum-copy.o csum-wrappers.o delay.o \ | |||
10 | usercopy.o getuser.o putuser.o \ | 10 | usercopy.o getuser.o putuser.o \ |
11 | thunk.o clear_page.o copy_page.o bitstr.o bitops.o | 11 | thunk.o clear_page.o copy_page.o bitstr.o bitops.o |
12 | lib-y += memcpy.o memmove.o memset.o copy_user.o | 12 | lib-y += memcpy.o memmove.o memset.o copy_user.o |
13 | |||
14 | lib-$(CONFIG_HAVE_DEC_LOCK) += dec_and_lock.o | ||
diff --git a/arch/x86_64/lib/dec_and_lock.c b/arch/x86_64/lib/dec_and_lock.c deleted file mode 100644 index ab43394dc775..000000000000 --- a/arch/x86_64/lib/dec_and_lock.c +++ /dev/null | |||
@@ -1,40 +0,0 @@ | |||
1 | /* | ||
2 | * x86 version of "atomic_dec_and_lock()" using | ||
3 | * the atomic "cmpxchg" instruction. | ||
4 | * | ||
5 | * (For CPU's lacking cmpxchg, we use the slow | ||
6 | * generic version, and this one never even gets | ||
7 | * compiled). | ||
8 | */ | ||
9 | |||
10 | #include <linux/spinlock.h> | ||
11 | #include <asm/atomic.h> | ||
12 | |||
13 | int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) | ||
14 | { | ||
15 | int counter; | ||
16 | int newcount; | ||
17 | |||
18 | repeat: | ||
19 | counter = atomic_read(atomic); | ||
20 | newcount = counter-1; | ||
21 | |||
22 | if (!newcount) | ||
23 | goto slow_path; | ||
24 | |||
25 | asm volatile("lock; cmpxchgl %1,%2" | ||
26 | :"=a" (newcount) | ||
27 | :"r" (newcount), "m" (atomic->counter), "0" (counter)); | ||
28 | |||
29 | /* If the above failed, "eax" will have changed */ | ||
30 | if (newcount != counter) | ||
31 | goto repeat; | ||
32 | return 0; | ||
33 | |||
34 | slow_path: | ||
35 | spin_lock(lock); | ||
36 | if (atomic_dec_and_test(atomic)) | ||
37 | return 1; | ||
38 | spin_unlock(lock); | ||
39 | return 0; | ||
40 | } | ||
diff --git a/arch/xtensa/Kconfig b/arch/xtensa/Kconfig index 2b6257bec4c3..7e841aa2a4aa 100644 --- a/arch/xtensa/Kconfig +++ b/arch/xtensa/Kconfig | |||
@@ -26,10 +26,6 @@ config RWSEM_XCHGADD_ALGORITHM | |||
26 | bool | 26 | bool |
27 | default y | 27 | default y |
28 | 28 | ||
29 | config HAVE_DEC_LOCK | ||
30 | bool | ||
31 | default y | ||
32 | |||
33 | config GENERIC_HARDIRQS | 29 | config GENERIC_HARDIRQS |
34 | bool | 30 | bool |
35 | default y | 31 | default y |
diff --git a/drivers/char/hvc_console.c b/drivers/char/hvc_console.c index cddb789902db..f92177634677 100644 --- a/drivers/char/hvc_console.c +++ b/drivers/char/hvc_console.c | |||
@@ -839,9 +839,6 @@ int __init hvc_init(void) | |||
839 | hvc_driver->flags = TTY_DRIVER_REAL_RAW; | 839 | hvc_driver->flags = TTY_DRIVER_REAL_RAW; |
840 | tty_set_operations(hvc_driver, &hvc_ops); | 840 | tty_set_operations(hvc_driver, &hvc_ops); |
841 | 841 | ||
842 | if (tty_register_driver(hvc_driver)) | ||
843 | panic("Couldn't register hvc console driver\n"); | ||
844 | |||
845 | /* Always start the kthread because there can be hotplug vty adapters | 842 | /* Always start the kthread because there can be hotplug vty adapters |
846 | * added later. */ | 843 | * added later. */ |
847 | hvc_task = kthread_run(khvcd, NULL, "khvcd"); | 844 | hvc_task = kthread_run(khvcd, NULL, "khvcd"); |
@@ -851,6 +848,9 @@ int __init hvc_init(void) | |||
851 | return -EIO; | 848 | return -EIO; |
852 | } | 849 | } |
853 | 850 | ||
851 | if (tty_register_driver(hvc_driver)) | ||
852 | panic("Couldn't register hvc console driver\n"); | ||
853 | |||
854 | return 0; | 854 | return 0; |
855 | } | 855 | } |
856 | module_init(hvc_init); | 856 | module_init(hvc_init); |
diff --git a/drivers/char/vt.c b/drivers/char/vt.c index 1e33cb032e07..e91268e86833 100644 --- a/drivers/char/vt.c +++ b/drivers/char/vt.c | |||
@@ -810,13 +810,14 @@ int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines) | |||
810 | * from the top and bottom of cursor position | 810 | * from the top and bottom of cursor position |
811 | */ | 811 | */ |
812 | old_origin += (vc->vc_y - new_rows/2) * old_row_size; | 812 | old_origin += (vc->vc_y - new_rows/2) * old_row_size; |
813 | end = old_origin + new_screen_size; | 813 | end = old_origin + (old_row_size * new_rows); |
814 | } | 814 | } |
815 | } else | 815 | } else |
816 | /* | 816 | /* |
817 | * Cursor near the top, copy contents from the top of buffer | 817 | * Cursor near the top, copy contents from the top of buffer |
818 | */ | 818 | */ |
819 | end = (old_rows > new_rows) ? old_origin + new_screen_size : | 819 | end = (old_rows > new_rows) ? old_origin + |
820 | (old_row_size * new_rows) : | ||
820 | vc->vc_scr_end; | 821 | vc->vc_scr_end; |
821 | 822 | ||
822 | update_attr(vc); | 823 | update_attr(vc); |
diff --git a/drivers/char/watchdog/mpcore_wdt.c b/drivers/char/watchdog/mpcore_wdt.c index c694eee1fb24..75ca84ed4adf 100644 --- a/drivers/char/watchdog/mpcore_wdt.c +++ b/drivers/char/watchdog/mpcore_wdt.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <linux/init.h> | 30 | #include <linux/init.h> |
31 | #include <linux/interrupt.h> | 31 | #include <linux/interrupt.h> |
32 | #include <linux/device.h> | 32 | #include <linux/device.h> |
33 | |||
34 | #include <asm/hardware/arm_twd.h> | ||
33 | #include <asm/uaccess.h> | 35 | #include <asm/uaccess.h> |
34 | 36 | ||
35 | struct mpcore_wdt { | 37 | struct mpcore_wdt { |
diff --git a/drivers/i2c/busses/i2c-pxa.c b/drivers/i2c/busses/i2c-pxa.c index fdf53ce04248..44b595d90a4a 100644 --- a/drivers/i2c/busses/i2c-pxa.c +++ b/drivers/i2c/busses/i2c-pxa.c | |||
@@ -914,19 +914,23 @@ static int i2c_pxa_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num | |||
914 | return ret; | 914 | return ret; |
915 | } | 915 | } |
916 | 916 | ||
917 | static u32 i2c_pxa_functionality(struct i2c_adapter *adap) | ||
918 | { | ||
919 | return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL; | ||
920 | } | ||
921 | |||
917 | static struct i2c_algorithm i2c_pxa_algorithm = { | 922 | static struct i2c_algorithm i2c_pxa_algorithm = { |
918 | .name = "PXA-I2C-Algorithm", | ||
919 | .id = I2C_ALGO_PXA, | ||
920 | .master_xfer = i2c_pxa_xfer, | 923 | .master_xfer = i2c_pxa_xfer, |
924 | .functionality = i2c_pxa_functionality, | ||
921 | }; | 925 | }; |
922 | 926 | ||
923 | static struct pxa_i2c i2c_pxa = { | 927 | static struct pxa_i2c i2c_pxa = { |
924 | .lock = SPIN_LOCK_UNLOCKED, | 928 | .lock = SPIN_LOCK_UNLOCKED, |
925 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER(i2c_pxa.wait), | 929 | .wait = __WAIT_QUEUE_HEAD_INITIALIZER(i2c_pxa.wait), |
926 | .adap = { | 930 | .adap = { |
927 | .name = "pxa2xx-i2c", | 931 | .owner = THIS_MODULE, |
928 | .id = I2C_ALGO_PXA, | ||
929 | .algo = &i2c_pxa_algorithm, | 932 | .algo = &i2c_pxa_algorithm, |
933 | .name = "pxa2xx-i2c", | ||
930 | .retries = 5, | 934 | .retries = 5, |
931 | }, | 935 | }, |
932 | }; | 936 | }; |
diff --git a/drivers/isdn/hisax/sedlbauer_cs.c b/drivers/isdn/hisax/sedlbauer_cs.c index c6b5bf7d2aca..dc334aab433e 100644 --- a/drivers/isdn/hisax/sedlbauer_cs.c +++ b/drivers/isdn/hisax/sedlbauer_cs.c | |||
@@ -611,7 +611,7 @@ static int sedlbauer_event(event_t event, int priority, | |||
611 | } /* sedlbauer_event */ | 611 | } /* sedlbauer_event */ |
612 | 612 | ||
613 | static struct pcmcia_device_id sedlbauer_ids[] = { | 613 | static struct pcmcia_device_id sedlbauer_ids[] = { |
614 | PCMCIA_DEVICE_PROD_ID1234("SEDLBAUER", "speed star II", "V 3.1", "(c) 93 - 98 cb ", 0x81fb79f5, 0xf3612e1d, 0x6b95c78a, 0x50d4149c), | 614 | PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "speed star II", "V 3.1", 0x81fb79f5, 0xf3612e1d, 0x6b95c78a), |
615 | PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", "4D67", 0x81fb79f5, 0xe4e9bc12, 0x397b7e90), | 615 | PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", "4D67", 0x81fb79f5, 0xe4e9bc12, 0x397b7e90), |
616 | PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", "4D98", 0x81fb79f5, 0xe4e9bc12, 0x2e5c7fce), | 616 | PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", "4D98", 0x81fb79f5, 0xe4e9bc12, 0x2e5c7fce), |
617 | PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", " (C) 93-94 VK", 0x81fb79f5, 0xe4e9bc12, 0x8db143fe), | 617 | PCMCIA_DEVICE_PROD_ID123("SEDLBAUER", "ISDN-Adapter", " (C) 93-94 VK", 0x81fb79f5, 0xe4e9bc12, 0x8db143fe), |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 992db89adce7..259d247b7551 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -309,17 +309,25 @@ pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
309 | 309 | ||
310 | pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr); | 310 | pci_read_config_word(dev, pm + PCI_PM_CTRL, &pmcsr); |
311 | 311 | ||
312 | /* If we're in D3, force entire word to 0. | 312 | /* If we're (effectively) in D3, force entire word to 0. |
313 | * This doesn't affect PME_Status, disables PME_En, and | 313 | * This doesn't affect PME_Status, disables PME_En, and |
314 | * sets PowerState to 0. | 314 | * sets PowerState to 0. |
315 | */ | 315 | */ |
316 | if (dev->current_state >= PCI_D3hot) { | 316 | switch (dev->current_state) { |
317 | if (!(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) | 317 | case PCI_UNKNOWN: /* Boot-up */ |
318 | if ((pmcsr & PCI_PM_CTRL_STATE_MASK) == PCI_D3hot | ||
319 | && !(pmcsr & PCI_PM_CTRL_NO_SOFT_RESET)) | ||
318 | need_restore = 1; | 320 | need_restore = 1; |
321 | /* Fall-through: force to D0 */ | ||
322 | case PCI_D3hot: | ||
323 | case PCI_D3cold: | ||
324 | case PCI_POWER_ERROR: | ||
319 | pmcsr = 0; | 325 | pmcsr = 0; |
320 | } else { | 326 | break; |
327 | default: | ||
321 | pmcsr &= ~PCI_PM_CTRL_STATE_MASK; | 328 | pmcsr &= ~PCI_PM_CTRL_STATE_MASK; |
322 | pmcsr |= state; | 329 | pmcsr |= state; |
330 | break; | ||
323 | } | 331 | } |
324 | 332 | ||
325 | /* enter specified state */ | 333 | /* enter specified state */ |
diff --git a/drivers/pcmcia/yenta_socket.c b/drivers/pcmcia/yenta_socket.c index f0997c36c9b7..ba4d78e5b121 100644 --- a/drivers/pcmcia/yenta_socket.c +++ b/drivers/pcmcia/yenta_socket.c | |||
@@ -1045,7 +1045,18 @@ static int __devinit yenta_probe (struct pci_dev *dev, const struct pci_device_i | |||
1045 | { | 1045 | { |
1046 | struct yenta_socket *socket; | 1046 | struct yenta_socket *socket; |
1047 | int ret; | 1047 | int ret; |
1048 | 1048 | ||
1049 | /* | ||
1050 | * If we failed to assign proper bus numbers for this cardbus | ||
1051 | * controller during PCI probe, its subordinate pci_bus is NULL. | ||
1052 | * Bail out if so. | ||
1053 | */ | ||
1054 | if (!dev->subordinate) { | ||
1055 | printk(KERN_ERR "Yenta: no bus associated with %s! " | ||
1056 | "(try 'pci=assign-busses')\n", pci_name(dev)); | ||
1057 | return -ENODEV; | ||
1058 | } | ||
1059 | |||
1049 | socket = kmalloc(sizeof(struct yenta_socket), GFP_KERNEL); | 1060 | socket = kmalloc(sizeof(struct yenta_socket), GFP_KERNEL); |
1050 | if (!socket) | 1061 | if (!socket) |
1051 | return -ENOMEM; | 1062 | return -ENOMEM; |
diff --git a/drivers/scsi/sata_sis.c b/drivers/scsi/sata_sis.c index a63f93186e41..b227e51d12f4 100644 --- a/drivers/scsi/sata_sis.c +++ b/drivers/scsi/sata_sis.c | |||
@@ -161,7 +161,7 @@ static u32 sis_scr_cfg_read (struct ata_port *ap, unsigned int sc_reg) | |||
161 | { | 161 | { |
162 | struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); | 162 | struct pci_dev *pdev = to_pci_dev(ap->host_set->dev); |
163 | unsigned int cfg_addr = get_scr_cfg_addr(ap->port_no, sc_reg, pdev->device); | 163 | unsigned int cfg_addr = get_scr_cfg_addr(ap->port_no, sc_reg, pdev->device); |
164 | u32 val, val2; | 164 | u32 val, val2 = 0; |
165 | u8 pmr; | 165 | u8 pmr; |
166 | 166 | ||
167 | if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */ | 167 | if (sc_reg == SCR_ERROR) /* doesn't exist in PCI cfg space */ |
@@ -289,7 +289,7 @@ static int sis_init_one (struct pci_dev *pdev, const struct pci_device_id *ent) | |||
289 | if (ent->device != 0x182) { | 289 | if (ent->device != 0x182) { |
290 | if ((pmr & SIS_PMR_COMBINED) == 0) { | 290 | if ((pmr & SIS_PMR_COMBINED) == 0) { |
291 | printk(KERN_INFO "sata_sis: Detected SiS 180/181 chipset in SATA mode\n"); | 291 | printk(KERN_INFO "sata_sis: Detected SiS 180/181 chipset in SATA mode\n"); |
292 | port2_start=0x64; | 292 | port2_start = 64; |
293 | } | 293 | } |
294 | else { | 294 | else { |
295 | printk(KERN_INFO "sata_sis: Detected SiS 180/181 chipset in combined mode\n"); | 295 | printk(KERN_INFO "sata_sis: Detected SiS 180/181 chipset in combined mode\n"); |
diff --git a/drivers/serial/21285.c b/drivers/serial/21285.c index aec39fb261ca..b5cf39468d18 100644 --- a/drivers/serial/21285.c +++ b/drivers/serial/21285.c | |||
@@ -463,7 +463,7 @@ static int __init serial21285_console_setup(struct console *co, char *options) | |||
463 | return uart_set_options(port, co, baud, parity, bits, flow); | 463 | return uart_set_options(port, co, baud, parity, bits, flow); |
464 | } | 464 | } |
465 | 465 | ||
466 | extern struct uart_driver serial21285_reg; | 466 | static struct uart_driver serial21285_reg; |
467 | 467 | ||
468 | static struct console serial21285_console = | 468 | static struct console serial21285_console = |
469 | { | 469 | { |
diff --git a/drivers/serial/amba-pl010.c b/drivers/serial/amba-pl010.c index 978e12437e61..679e678c7e6a 100644 --- a/drivers/serial/amba-pl010.c +++ b/drivers/serial/amba-pl010.c | |||
@@ -689,7 +689,7 @@ static int __init pl010_console_setup(struct console *co, char *options) | |||
689 | return uart_set_options(port, co, baud, parity, bits, flow); | 689 | return uart_set_options(port, co, baud, parity, bits, flow); |
690 | } | 690 | } |
691 | 691 | ||
692 | extern struct uart_driver amba_reg; | 692 | static struct uart_driver amba_reg; |
693 | static struct console amba_console = { | 693 | static struct console amba_console = { |
694 | .name = "ttyAM", | 694 | .name = "ttyAM", |
695 | .write = pl010_console_write, | 695 | .write = pl010_console_write, |
diff --git a/drivers/serial/amba-pl011.c b/drivers/serial/amba-pl011.c index 56071309744c..1ff629c74750 100644 --- a/drivers/serial/amba-pl011.c +++ b/drivers/serial/amba-pl011.c | |||
@@ -701,7 +701,7 @@ static int __init pl011_console_setup(struct console *co, char *options) | |||
701 | return uart_set_options(&uap->port, co, baud, parity, bits, flow); | 701 | return uart_set_options(&uap->port, co, baud, parity, bits, flow); |
702 | } | 702 | } |
703 | 703 | ||
704 | extern struct uart_driver amba_reg; | 704 | static struct uart_driver amba_reg; |
705 | static struct console amba_console = { | 705 | static struct console amba_console = { |
706 | .name = "ttyAMA", | 706 | .name = "ttyAMA", |
707 | .write = pl011_console_write, | 707 | .write = pl011_console_write, |
diff --git a/drivers/serial/clps711x.c b/drivers/serial/clps711x.c index d822896b488c..78c1f36ad9b7 100644 --- a/drivers/serial/clps711x.c +++ b/drivers/serial/clps711x.c | |||
@@ -525,7 +525,7 @@ static int __init clps711xuart_console_setup(struct console *co, char *options) | |||
525 | return uart_set_options(port, co, baud, parity, bits, flow); | 525 | return uart_set_options(port, co, baud, parity, bits, flow); |
526 | } | 526 | } |
527 | 527 | ||
528 | extern struct uart_driver clps711x_reg; | 528 | static struct uart_driver clps711x_reg; |
529 | static struct console clps711x_console = { | 529 | static struct console clps711x_console = { |
530 | .name = "ttyCL", | 530 | .name = "ttyCL", |
531 | .write = clps711xuart_console_write, | 531 | .write = clps711xuart_console_write, |
diff --git a/drivers/serial/pxa.c b/drivers/serial/pxa.c index eaa0af835290..672b359b07ce 100644 --- a/drivers/serial/pxa.c +++ b/drivers/serial/pxa.c | |||
@@ -589,8 +589,8 @@ serial_pxa_type(struct uart_port *port) | |||
589 | 589 | ||
590 | #ifdef CONFIG_SERIAL_PXA_CONSOLE | 590 | #ifdef CONFIG_SERIAL_PXA_CONSOLE |
591 | 591 | ||
592 | extern struct uart_pxa_port serial_pxa_ports[]; | 592 | static struct uart_pxa_port serial_pxa_ports[]; |
593 | extern struct uart_driver serial_pxa_reg; | 593 | static struct uart_driver serial_pxa_reg; |
594 | 594 | ||
595 | #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) | 595 | #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE) |
596 | 596 | ||
diff --git a/drivers/serial/sa1100.c b/drivers/serial/sa1100.c index 1225b14f6e9d..dd8aed242357 100644 --- a/drivers/serial/sa1100.c +++ b/drivers/serial/sa1100.c | |||
@@ -799,7 +799,7 @@ sa1100_console_setup(struct console *co, char *options) | |||
799 | return uart_set_options(&sport->port, co, baud, parity, bits, flow); | 799 | return uart_set_options(&sport->port, co, baud, parity, bits, flow); |
800 | } | 800 | } |
801 | 801 | ||
802 | extern struct uart_driver sa1100_reg; | 802 | static struct uart_driver sa1100_reg; |
803 | static struct console sa1100_console = { | 803 | static struct console sa1100_console = { |
804 | .name = "ttySA", | 804 | .name = "ttySA", |
805 | .write = sa1100_console_write, | 805 | .write = sa1100_console_write, |
diff --git a/drivers/serial/serial_lh7a40x.c b/drivers/serial/serial_lh7a40x.c index 8302376800c0..d01dbe5da3b9 100644 --- a/drivers/serial/serial_lh7a40x.c +++ b/drivers/serial/serial_lh7a40x.c | |||
@@ -632,7 +632,7 @@ static int __init lh7a40xuart_console_setup (struct console* co, char* options) | |||
632 | return uart_set_options (port, co, baud, parity, bits, flow); | 632 | return uart_set_options (port, co, baud, parity, bits, flow); |
633 | } | 633 | } |
634 | 634 | ||
635 | extern struct uart_driver lh7a40x_reg; | 635 | static struct uart_driver lh7a40x_reg; |
636 | static struct console lh7a40x_console = { | 636 | static struct console lh7a40x_console = { |
637 | .name = "ttyAM", | 637 | .name = "ttyAM", |
638 | .write = lh7a40xuart_console_write, | 638 | .write = lh7a40xuart_console_write, |
diff --git a/drivers/video/console/vgacon.c b/drivers/video/console/vgacon.c index 0705cd741411..6ef6f7760e47 100644 --- a/drivers/video/console/vgacon.c +++ b/drivers/video/console/vgacon.c | |||
@@ -1020,7 +1020,9 @@ static int vgacon_font_get(struct vc_data *c, struct console_font *font) | |||
1020 | static int vgacon_resize(struct vc_data *c, unsigned int width, | 1020 | static int vgacon_resize(struct vc_data *c, unsigned int width, |
1021 | unsigned int height) | 1021 | unsigned int height) |
1022 | { | 1022 | { |
1023 | if (width % 2 || width > ORIG_VIDEO_COLS || height > ORIG_VIDEO_LINES) | 1023 | if (width % 2 || width > ORIG_VIDEO_COLS || |
1024 | height > (ORIG_VIDEO_LINES * vga_default_font_height)/ | ||
1025 | c->vc_font.height) | ||
1024 | return -EINVAL; | 1026 | return -EINVAL; |
1025 | 1027 | ||
1026 | if (CON_IS_VISIBLE(c) && !vga_is_gfx) /* who knows */ | 1028 | if (CON_IS_VISIBLE(c) && !vga_is_gfx) /* who knows */ |
diff --git a/drivers/video/nvidia/nv_i2c.c b/drivers/video/nvidia/nv_i2c.c index ace484fa61ce..12f2884d3f0b 100644 --- a/drivers/video/nvidia/nv_i2c.c +++ b/drivers/video/nvidia/nv_i2c.c | |||
@@ -209,10 +209,13 @@ int nvidia_probe_i2c_connector(struct fb_info *info, int conn, u8 **out_edid) | |||
209 | 209 | ||
210 | if (!edid && conn == 1) { | 210 | if (!edid && conn == 1) { |
211 | /* try to get from firmware */ | 211 | /* try to get from firmware */ |
212 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); | 212 | const u8 *e = fb_firmware_edid(info->device); |
213 | if (edid) | 213 | |
214 | memcpy(edid, fb_firmware_edid(info->device), | 214 | if (e != NULL) { |
215 | EDID_LENGTH); | 215 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); |
216 | if (edid) | ||
217 | memcpy(edid, e, EDID_LENGTH); | ||
218 | } | ||
216 | } | 219 | } |
217 | 220 | ||
218 | if (out_edid) | 221 | if (out_edid) |
diff --git a/drivers/video/savage/savagefb-i2c.c b/drivers/video/savage/savagefb-i2c.c index 959404ad68f4..3c98457783c4 100644 --- a/drivers/video/savage/savagefb-i2c.c +++ b/drivers/video/savage/savagefb-i2c.c | |||
@@ -274,10 +274,13 @@ int savagefb_probe_i2c_connector(struct fb_info *info, u8 **out_edid) | |||
274 | 274 | ||
275 | if (!edid) { | 275 | if (!edid) { |
276 | /* try to get from firmware */ | 276 | /* try to get from firmware */ |
277 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); | 277 | const u8 *e = fb_firmware_edid(info->device); |
278 | if (edid) | 278 | |
279 | memcpy(edid, fb_firmware_edid(info->device), | 279 | if (e) { |
280 | EDID_LENGTH); | 280 | edid = kmalloc(EDID_LENGTH, GFP_KERNEL); |
281 | if (edid) | ||
282 | memcpy(edid, e, EDID_LENGTH); | ||
283 | } | ||
281 | } | 284 | } |
282 | 285 | ||
283 | if (out_edid) | 286 | if (out_edid) |
diff --git a/drivers/video/savage/savagefb.h b/drivers/video/savage/savagefb.h index d6f94742c9f2..ea17f7e0482c 100644 --- a/drivers/video/savage/savagefb.h +++ b/drivers/video/savage/savagefb.h | |||
@@ -60,8 +60,6 @@ | |||
60 | 60 | ||
61 | #define S3_SAVAGE_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE2000)) | 61 | #define S3_SAVAGE_SERIES(chip) ((chip>=S3_SAVAGE3D) && (chip<=S3_SAVAGE2000)) |
62 | 62 | ||
63 | #define S3_MOBILE_TWISTER_SERIES(chip) ((chip==S3_TWISTER) || (chip == S3_PROSAVAGEDDR)) | ||
64 | |||
65 | /* Chip tags. These are used to group the adapters into | 63 | /* Chip tags. These are used to group the adapters into |
66 | * related families. | 64 | * related families. |
67 | */ | 65 | */ |
@@ -74,8 +72,6 @@ typedef enum { | |||
74 | S3_PROSAVAGE, | 72 | S3_PROSAVAGE, |
75 | S3_SUPERSAVAGE, | 73 | S3_SUPERSAVAGE, |
76 | S3_SAVAGE2000, | 74 | S3_SAVAGE2000, |
77 | S3_PROSAVAGEDDR, | ||
78 | S3_TWISTER, | ||
79 | S3_LAST | 75 | S3_LAST |
80 | } savage_chipset; | 76 | } savage_chipset; |
81 | 77 | ||
diff --git a/drivers/video/savage/savagefb_driver.c b/drivers/video/savage/savagefb_driver.c index b5ca3ef8271f..7c285455c924 100644 --- a/drivers/video/savage/savagefb_driver.c +++ b/drivers/video/savage/savagefb_driver.c | |||
@@ -1773,8 +1773,7 @@ static int __devinit savage_init_hw (struct savagefb_par *par) | |||
1773 | } | 1773 | } |
1774 | } | 1774 | } |
1775 | 1775 | ||
1776 | if (S3_SAVAGE_MOBILE_SERIES(par->chip) || | 1776 | if (S3_SAVAGE_MOBILE_SERIES(par->chip) && !par->crtonly) |
1777 | (S3_MOBILE_TWISTER_SERIES(par->chip) && !par->crtonly)) | ||
1778 | par->display_type = DISP_LCD; | 1777 | par->display_type = DISP_LCD; |
1779 | else if (dvi || (par->chip == S3_SAVAGE4 && par->dvi)) | 1778 | else if (dvi || (par->chip == S3_SAVAGE4 && par->dvi)) |
1780 | par->display_type = DISP_DFP; | 1779 | par->display_type = DISP_DFP; |
@@ -1783,7 +1782,7 @@ static int __devinit savage_init_hw (struct savagefb_par *par) | |||
1783 | 1782 | ||
1784 | /* Check LCD panel parrmation */ | 1783 | /* Check LCD panel parrmation */ |
1785 | 1784 | ||
1786 | if (par->chip == S3_SAVAGE_MX) { | 1785 | if (par->display_type == DISP_LCD) { |
1787 | unsigned char cr6b = VGArCR( 0x6b ); | 1786 | unsigned char cr6b = VGArCR( 0x6b ); |
1788 | 1787 | ||
1789 | int panelX = (VGArSEQ (0x61) + | 1788 | int panelX = (VGArSEQ (0x61) + |
@@ -1922,15 +1921,15 @@ static int __devinit savage_init_fb_info (struct fb_info *info, | |||
1922 | snprintf (info->fix.id, 16, "ProSavageKM"); | 1921 | snprintf (info->fix.id, 16, "ProSavageKM"); |
1923 | break; | 1922 | break; |
1924 | case FB_ACCEL_S3TWISTER_P: | 1923 | case FB_ACCEL_S3TWISTER_P: |
1925 | par->chip = S3_TWISTER; | 1924 | par->chip = S3_PROSAVAGE; |
1926 | snprintf (info->fix.id, 16, "TwisterP"); | 1925 | snprintf (info->fix.id, 16, "TwisterP"); |
1927 | break; | 1926 | break; |
1928 | case FB_ACCEL_S3TWISTER_K: | 1927 | case FB_ACCEL_S3TWISTER_K: |
1929 | par->chip = S3_TWISTER; | 1928 | par->chip = S3_PROSAVAGE; |
1930 | snprintf (info->fix.id, 16, "TwisterK"); | 1929 | snprintf (info->fix.id, 16, "TwisterK"); |
1931 | break; | 1930 | break; |
1932 | case FB_ACCEL_PROSAVAGE_DDR: | 1931 | case FB_ACCEL_PROSAVAGE_DDR: |
1933 | par->chip = S3_PROSAVAGEDDR; | 1932 | par->chip = S3_PROSAVAGE; |
1934 | snprintf (info->fix.id, 16, "ProSavageDDR"); | 1933 | snprintf (info->fix.id, 16, "ProSavageDDR"); |
1935 | break; | 1934 | break; |
1936 | case FB_ACCEL_PROSAVAGE_DDRK: | 1935 | case FB_ACCEL_PROSAVAGE_DDRK: |
diff --git a/fs/compat.c b/fs/compat.c index ac3fb9ed8eea..a719e158e002 100644 --- a/fs/compat.c +++ b/fs/compat.c | |||
@@ -44,6 +44,8 @@ | |||
44 | #include <linux/nfsd/syscall.h> | 44 | #include <linux/nfsd/syscall.h> |
45 | #include <linux/personality.h> | 45 | #include <linux/personality.h> |
46 | #include <linux/rwsem.h> | 46 | #include <linux/rwsem.h> |
47 | #include <linux/acct.h> | ||
48 | #include <linux/mm.h> | ||
47 | 49 | ||
48 | #include <net/sock.h> /* siocdevprivate_ioctl */ | 50 | #include <net/sock.h> /* siocdevprivate_ioctl */ |
49 | 51 | ||
@@ -1487,6 +1489,8 @@ int compat_do_execve(char * filename, | |||
1487 | 1489 | ||
1488 | /* execve success */ | 1490 | /* execve success */ |
1489 | security_bprm_free(bprm); | 1491 | security_bprm_free(bprm); |
1492 | acct_update_integrals(current); | ||
1493 | update_mem_hiwater(current); | ||
1490 | kfree(bprm); | 1494 | kfree(bprm); |
1491 | return retval; | 1495 | return retval; |
1492 | } | 1496 | } |
@@ -421,11 +421,6 @@ int setup_arg_pages(struct linux_binprm *bprm, | |||
421 | if (!mpnt) | 421 | if (!mpnt) |
422 | return -ENOMEM; | 422 | return -ENOMEM; |
423 | 423 | ||
424 | if (security_vm_enough_memory(arg_size >> PAGE_SHIFT)) { | ||
425 | kmem_cache_free(vm_area_cachep, mpnt); | ||
426 | return -ENOMEM; | ||
427 | } | ||
428 | |||
429 | memset(mpnt, 0, sizeof(*mpnt)); | 424 | memset(mpnt, 0, sizeof(*mpnt)); |
430 | 425 | ||
431 | down_write(&mm->mmap_sem); | 426 | down_write(&mm->mmap_sem); |
@@ -745,8 +740,8 @@ static inline int de_thread(struct task_struct *tsk) | |||
745 | } | 740 | } |
746 | 741 | ||
747 | /* | 742 | /* |
748 | * Now there are really no other threads at all, | 743 | * There may be one thread left which is just exiting, |
749 | * so it's safe to stop telling them to kill themselves. | 744 | * but it's safe to stop telling the group to kill themselves. |
750 | */ | 745 | */ |
751 | sig->flags = 0; | 746 | sig->flags = 0; |
752 | 747 | ||
@@ -785,7 +780,6 @@ no_thread_group: | |||
785 | kmem_cache_free(sighand_cachep, oldsighand); | 780 | kmem_cache_free(sighand_cachep, oldsighand); |
786 | } | 781 | } |
787 | 782 | ||
788 | BUG_ON(!thread_group_empty(current)); | ||
789 | BUG_ON(!thread_group_leader(current)); | 783 | BUG_ON(!thread_group_leader(current)); |
790 | return 0; | 784 | return 0; |
791 | } | 785 | } |
@@ -69,13 +69,9 @@ void free_fd_array(struct file **array, int num) | |||
69 | 69 | ||
70 | static void __free_fdtable(struct fdtable *fdt) | 70 | static void __free_fdtable(struct fdtable *fdt) |
71 | { | 71 | { |
72 | int fdset_size, fdarray_size; | 72 | free_fdset(fdt->open_fds, fdt->max_fdset); |
73 | 73 | free_fdset(fdt->close_on_exec, fdt->max_fdset); | |
74 | fdset_size = fdt->max_fdset / 8; | 74 | free_fd_array(fdt->fd, fdt->max_fds); |
75 | fdarray_size = fdt->max_fds * sizeof(struct file *); | ||
76 | free_fdset(fdt->open_fds, fdset_size); | ||
77 | free_fdset(fdt->close_on_exec, fdset_size); | ||
78 | free_fd_array(fdt->fd, fdarray_size); | ||
79 | kfree(fdt); | 75 | kfree(fdt); |
80 | } | 76 | } |
81 | 77 | ||
diff --git a/include/asm-arm/hardware/arm_twd.h b/include/asm-arm/hardware/arm_twd.h new file mode 100644 index 000000000000..131d5b40e072 --- /dev/null +++ b/include/asm-arm/hardware/arm_twd.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef __ASM_HARDWARE_TWD_H | ||
2 | #define __ASM_HARDWARE_TWD_H | ||
3 | |||
4 | #define TWD_TIMER_LOAD 0x00 | ||
5 | #define TWD_TIMER_COUNTER 0x04 | ||
6 | #define TWD_TIMER_CONTROL 0x08 | ||
7 | #define TWD_TIMER_INTSTAT 0x0C | ||
8 | |||
9 | #define TWD_WDOG_LOAD 0x20 | ||
10 | #define TWD_WDOG_COUNTER 0x24 | ||
11 | #define TWD_WDOG_CONTROL 0x28 | ||
12 | #define TWD_WDOG_INTSTAT 0x2C | ||
13 | #define TWD_WDOG_RESETSTAT 0x30 | ||
14 | #define TWD_WDOG_DISABLE 0x34 | ||
15 | |||
16 | #endif | ||
diff --git a/include/asm-ia64/ptrace.h b/include/asm-ia64/ptrace.h index fc544929ac34..a79d1a7ecc77 100644 --- a/include/asm-ia64/ptrace.h +++ b/include/asm-ia64/ptrace.h | |||
@@ -57,7 +57,9 @@ | |||
57 | #include <linux/config.h> | 57 | #include <linux/config.h> |
58 | 58 | ||
59 | #include <asm/fpu.h> | 59 | #include <asm/fpu.h> |
60 | #ifndef ASM_OFFSETS_C | ||
60 | #include <asm/asm-offsets.h> | 61 | #include <asm/asm-offsets.h> |
62 | #endif | ||
61 | 63 | ||
62 | /* | 64 | /* |
63 | * Base-2 logarithm of number of pages to allocate per task structure | 65 | * Base-2 logarithm of number of pages to allocate per task structure |
diff --git a/include/asm-ia64/thread_info.h b/include/asm-ia64/thread_info.h index cf4a950a0f4f..171b2207bde4 100644 --- a/include/asm-ia64/thread_info.h +++ b/include/asm-ia64/thread_info.h | |||
@@ -5,7 +5,9 @@ | |||
5 | #ifndef _ASM_IA64_THREAD_INFO_H | 5 | #ifndef _ASM_IA64_THREAD_INFO_H |
6 | #define _ASM_IA64_THREAD_INFO_H | 6 | #define _ASM_IA64_THREAD_INFO_H |
7 | 7 | ||
8 | #ifndef ASM_OFFSETS_C | ||
8 | #include <asm/asm-offsets.h> | 9 | #include <asm/asm-offsets.h> |
10 | #endif | ||
9 | #include <asm/processor.h> | 11 | #include <asm/processor.h> |
10 | #include <asm/ptrace.h> | 12 | #include <asm/ptrace.h> |
11 | 13 | ||
@@ -51,9 +53,14 @@ struct thread_info { | |||
51 | }, \ | 53 | }, \ |
52 | } | 54 | } |
53 | 55 | ||
56 | #ifndef ASM_OFFSETS_C | ||
54 | /* how to get the thread information struct from C */ | 57 | /* how to get the thread information struct from C */ |
55 | #define current_thread_info() ((struct thread_info *) ((char *) current + IA64_TASK_SIZE)) | 58 | #define current_thread_info() ((struct thread_info *) ((char *) current + IA64_TASK_SIZE)) |
56 | #define alloc_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE)) | 59 | #define alloc_thread_info(tsk) ((struct thread_info *) ((char *) (tsk) + IA64_TASK_SIZE)) |
60 | #else | ||
61 | #define current_thread_info() ((struct thread_info *) 0) | ||
62 | #define alloc_thread_info(tsk) ((struct thread_info *) 0) | ||
63 | #endif | ||
57 | #define free_thread_info(ti) /* nothing */ | 64 | #define free_thread_info(ti) /* nothing */ |
58 | 65 | ||
59 | #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR | 66 | #define __HAVE_ARCH_TASK_STRUCT_ALLOCATOR |
diff --git a/include/asm-ppc/tlbflush.h b/include/asm-ppc/tlbflush.h index 9850f53f54b0..9afee4ffc835 100644 --- a/include/asm-ppc/tlbflush.h +++ b/include/asm-ppc/tlbflush.h | |||
@@ -72,7 +72,7 @@ static inline void flush_tlb_page(struct vm_area_struct *vma, | |||
72 | static inline void flush_tlb_page_nohash(struct vm_area_struct *vma, | 72 | static inline void flush_tlb_page_nohash(struct vm_area_struct *vma, |
73 | unsigned long vmaddr) | 73 | unsigned long vmaddr) |
74 | { _tlbie(vmaddr); } | 74 | { _tlbie(vmaddr); } |
75 | static inline void flush_tlb_range(struct mm_struct *mm, | 75 | static inline void flush_tlb_range(struct vm_area_struct *vma, |
76 | unsigned long start, unsigned long end) | 76 | unsigned long start, unsigned long end) |
77 | { __tlbia(); } | 77 | { __tlbia(); } |
78 | static inline void flush_tlb_kernel_range(unsigned long start, | 78 | static inline void flush_tlb_kernel_range(unsigned long start, |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index 7bbd25970c9e..bdebdc564506 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #define NETLINK_IP6_FW 13 | 20 | #define NETLINK_IP6_FW 13 |
21 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ | 21 | #define NETLINK_DNRTMSG 14 /* DECnet routing messages */ |
22 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ | 22 | #define NETLINK_KOBJECT_UEVENT 15 /* Kernel messages to userspace */ |
23 | #define NETLINK_GENERIC 16 | ||
23 | 24 | ||
24 | #define MAX_LINKS 32 | 25 | #define MAX_LINKS 32 |
25 | 26 | ||
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index f6c1a142286a..72fe3385743c 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1355,7 +1355,7 @@ | |||
1355 | #define PCI_DEVICE_ID_RME_DIGI96 0x3fc0 | 1355 | #define PCI_DEVICE_ID_RME_DIGI96 0x3fc0 |
1356 | #define PCI_DEVICE_ID_RME_DIGI96_8 0x3fc1 | 1356 | #define PCI_DEVICE_ID_RME_DIGI96_8 0x3fc1 |
1357 | #define PCI_DEVICE_ID_RME_DIGI96_8_PRO 0x3fc2 | 1357 | #define PCI_DEVICE_ID_RME_DIGI96_8_PRO 0x3fc2 |
1358 | #define PCI_DEVICE_IDRME__DIGI96_8_PAD_OR_PST 0x3fc3 | 1358 | #define PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST 0x3fc3 |
1359 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL 0x3fc4 | 1359 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL 0x3fc4 |
1360 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5 | 1360 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5 |
1361 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6 | 1361 | #define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6 |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index e426641c519f..06b4235aa016 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -84,6 +84,7 @@ | |||
84 | #define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */ | 84 | #define IP_VS_CONN_F_IN_SEQ 0x0400 /* must do input seq adjust */ |
85 | #define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */ | 85 | #define IP_VS_CONN_F_SEQ_MASK 0x0600 /* in/out sequence mask */ |
86 | #define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */ | 86 | #define IP_VS_CONN_F_NO_CPORT 0x0800 /* no client port set yet */ |
87 | #define IP_VS_CONN_F_TEMPLATE 0x1000 /* template, not connection */ | ||
87 | 88 | ||
88 | /* Move it to better place one day, for now keep it unique */ | 89 | /* Move it to better place one day, for now keep it unique */ |
89 | #define NFC_IPVS_PROPERTY 0x10000 | 90 | #define NFC_IPVS_PROPERTY 0x10000 |
@@ -739,6 +740,8 @@ enum { | |||
739 | 740 | ||
740 | extern struct ip_vs_conn *ip_vs_conn_in_get | 741 | extern struct ip_vs_conn *ip_vs_conn_in_get |
741 | (int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port); | 742 | (int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port); |
743 | extern struct ip_vs_conn *ip_vs_ct_in_get | ||
744 | (int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port); | ||
742 | extern struct ip_vs_conn *ip_vs_conn_out_get | 745 | extern struct ip_vs_conn *ip_vs_conn_out_get |
743 | (int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port); | 746 | (int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port); |
744 | 747 | ||
diff --git a/lib/dec_and_lock.c b/lib/dec_and_lock.c index 2377af057d09..305a9663aee3 100644 --- a/lib/dec_and_lock.c +++ b/lib/dec_and_lock.c | |||
@@ -1,7 +1,41 @@ | |||
1 | #include <linux/module.h> | 1 | #include <linux/module.h> |
2 | #include <linux/spinlock.h> | 2 | #include <linux/spinlock.h> |
3 | #include <asm/atomic.h> | 3 | #include <asm/atomic.h> |
4 | #include <asm/system.h> | ||
4 | 5 | ||
6 | #ifdef __HAVE_ARCH_CMPXCHG | ||
7 | /* | ||
8 | * This is an implementation of the notion of "decrement a | ||
9 | * reference count, and return locked if it decremented to zero". | ||
10 | * | ||
11 | * This implementation can be used on any architecture that | ||
12 | * has a cmpxchg, and where atomic->value is an int holding | ||
13 | * the value of the atomic (i.e. the high bits aren't used | ||
14 | * for a lock or anything like that). | ||
15 | */ | ||
16 | int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) | ||
17 | { | ||
18 | int counter; | ||
19 | int newcount; | ||
20 | |||
21 | for (;;) { | ||
22 | counter = atomic_read(atomic); | ||
23 | newcount = counter - 1; | ||
24 | if (!newcount) | ||
25 | break; /* do it the slow way */ | ||
26 | |||
27 | newcount = cmpxchg(&atomic->counter, counter, newcount); | ||
28 | if (newcount == counter) | ||
29 | return 0; | ||
30 | } | ||
31 | |||
32 | spin_lock(lock); | ||
33 | if (atomic_dec_and_test(atomic)) | ||
34 | return 1; | ||
35 | spin_unlock(lock); | ||
36 | return 0; | ||
37 | } | ||
38 | #else | ||
5 | /* | 39 | /* |
6 | * This is an architecture-neutral, but slow, | 40 | * This is an architecture-neutral, but slow, |
7 | * implementation of the notion of "decrement | 41 | * implementation of the notion of "decrement |
@@ -33,5 +67,6 @@ int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock) | |||
33 | spin_unlock(lock); | 67 | spin_unlock(lock); |
34 | return 0; | 68 | return 0; |
35 | } | 69 | } |
70 | #endif | ||
36 | 71 | ||
37 | EXPORT_SYMBOL(_atomic_dec_and_lock); | 72 | EXPORT_SYMBOL(_atomic_dec_and_lock); |
@@ -1993,6 +1993,9 @@ int insert_vm_struct(struct mm_struct * mm, struct vm_area_struct * vma) | |||
1993 | __vma = find_vma_prepare(mm,vma->vm_start,&prev,&rb_link,&rb_parent); | 1993 | __vma = find_vma_prepare(mm,vma->vm_start,&prev,&rb_link,&rb_parent); |
1994 | if (__vma && __vma->vm_start < vma->vm_end) | 1994 | if (__vma && __vma->vm_start < vma->vm_end) |
1995 | return -ENOMEM; | 1995 | return -ENOMEM; |
1996 | if ((vma->vm_flags & VM_ACCOUNT) && | ||
1997 | security_vm_enough_memory(vma_pages(vma))) | ||
1998 | return -ENOMEM; | ||
1996 | vma_link(mm, vma, prev, rb_link, rb_parent); | 1999 | vma_link(mm, vma, prev, rb_link, rb_parent); |
1997 | return 0; | 2000 | return 0; |
1998 | } | 2001 | } |
@@ -659,7 +659,7 @@ static inline kmem_cache_t *__find_general_cachep(size_t size, | |||
659 | * kmem_cache_create(), or __kmalloc(), before | 659 | * kmem_cache_create(), or __kmalloc(), before |
660 | * the generic caches are initialized. | 660 | * the generic caches are initialized. |
661 | */ | 661 | */ |
662 | BUG_ON(csizep->cs_cachep == NULL); | 662 | BUG_ON(malloc_sizes[INDEX_AC].cs_cachep == NULL); |
663 | #endif | 663 | #endif |
664 | while (size > csizep->cs_size) | 664 | while (size > csizep->cs_size) |
665 | csizep++; | 665 | csizep++; |
diff --git a/net/bridge/br_netfilter.c b/net/bridge/br_netfilter.c index 2d52fee63a8c..d8e36b775125 100644 --- a/net/bridge/br_netfilter.c +++ b/net/bridge/br_netfilter.c | |||
@@ -214,9 +214,11 @@ static int br_nf_pre_routing_finish(struct sk_buff *skb) | |||
214 | .tos = RT_TOS(iph->tos)} }, .proto = 0}; | 214 | .tos = RT_TOS(iph->tos)} }, .proto = 0}; |
215 | 215 | ||
216 | if (!ip_route_output_key(&rt, &fl)) { | 216 | if (!ip_route_output_key(&rt, &fl)) { |
217 | /* Bridged-and-DNAT'ed traffic doesn't | 217 | /* - Bridged-and-DNAT'ed traffic doesn't |
218 | * require ip_forwarding. */ | 218 | * require ip_forwarding. |
219 | if (((struct dst_entry *)rt)->dev == dev) { | 219 | * - Deal with redirected traffic. */ |
220 | if (((struct dst_entry *)rt)->dev == dev || | ||
221 | rt->rt_type == RTN_LOCAL) { | ||
220 | skb->dst = (struct dst_entry *)rt; | 222 | skb->dst = (struct dst_entry *)rt; |
221 | goto bridged_dnat; | 223 | goto bridged_dnat; |
222 | } | 224 | } |
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c index 44607f4767b8..70c44e4c3ceb 100644 --- a/net/ipv4/igmp.c +++ b/net/ipv4/igmp.c | |||
@@ -1603,7 +1603,7 @@ static void ip_mc_clear_src(struct ip_mc_list *pmc) | |||
1603 | } | 1603 | } |
1604 | pmc->sources = NULL; | 1604 | pmc->sources = NULL; |
1605 | pmc->sfmode = MCAST_EXCLUDE; | 1605 | pmc->sfmode = MCAST_EXCLUDE; |
1606 | pmc->sfcount[MCAST_EXCLUDE] = 0; | 1606 | pmc->sfcount[MCAST_INCLUDE] = 0; |
1607 | pmc->sfcount[MCAST_EXCLUDE] = 1; | 1607 | pmc->sfcount[MCAST_EXCLUDE] = 1; |
1608 | } | 1608 | } |
1609 | 1609 | ||
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c index e11952ea17af..f828fa2eb7de 100644 --- a/net/ipv4/ipvs/ip_vs_conn.c +++ b/net/ipv4/ipvs/ip_vs_conn.c | |||
@@ -196,6 +196,7 @@ static inline struct ip_vs_conn *__ip_vs_conn_in_get | |||
196 | list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) { | 196 | list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) { |
197 | if (s_addr==cp->caddr && s_port==cp->cport && | 197 | if (s_addr==cp->caddr && s_port==cp->cport && |
198 | d_port==cp->vport && d_addr==cp->vaddr && | 198 | d_port==cp->vport && d_addr==cp->vaddr && |
199 | ((!s_port) ^ (!(cp->flags & IP_VS_CONN_F_NO_CPORT))) && | ||
199 | protocol==cp->protocol) { | 200 | protocol==cp->protocol) { |
200 | /* HIT */ | 201 | /* HIT */ |
201 | atomic_inc(&cp->refcnt); | 202 | atomic_inc(&cp->refcnt); |
@@ -227,6 +228,40 @@ struct ip_vs_conn *ip_vs_conn_in_get | |||
227 | return cp; | 228 | return cp; |
228 | } | 229 | } |
229 | 230 | ||
231 | /* Get reference to connection template */ | ||
232 | struct ip_vs_conn *ip_vs_ct_in_get | ||
233 | (int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port) | ||
234 | { | ||
235 | unsigned hash; | ||
236 | struct ip_vs_conn *cp; | ||
237 | |||
238 | hash = ip_vs_conn_hashkey(protocol, s_addr, s_port); | ||
239 | |||
240 | ct_read_lock(hash); | ||
241 | |||
242 | list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) { | ||
243 | if (s_addr==cp->caddr && s_port==cp->cport && | ||
244 | d_port==cp->vport && d_addr==cp->vaddr && | ||
245 | cp->flags & IP_VS_CONN_F_TEMPLATE && | ||
246 | protocol==cp->protocol) { | ||
247 | /* HIT */ | ||
248 | atomic_inc(&cp->refcnt); | ||
249 | goto out; | ||
250 | } | ||
251 | } | ||
252 | cp = NULL; | ||
253 | |||
254 | out: | ||
255 | ct_read_unlock(hash); | ||
256 | |||
257 | IP_VS_DBG(7, "template lookup/in %s %u.%u.%u.%u:%d->%u.%u.%u.%u:%d %s\n", | ||
258 | ip_vs_proto_name(protocol), | ||
259 | NIPQUAD(s_addr), ntohs(s_port), | ||
260 | NIPQUAD(d_addr), ntohs(d_port), | ||
261 | cp?"hit":"not hit"); | ||
262 | |||
263 | return cp; | ||
264 | } | ||
230 | 265 | ||
231 | /* | 266 | /* |
232 | * Gets ip_vs_conn associated with supplied parameters in the ip_vs_conn_tab. | 267 | * Gets ip_vs_conn associated with supplied parameters in the ip_vs_conn_tab. |
@@ -367,7 +402,7 @@ ip_vs_bind_dest(struct ip_vs_conn *cp, struct ip_vs_dest *dest) | |||
367 | atomic_read(&dest->refcnt)); | 402 | atomic_read(&dest->refcnt)); |
368 | 403 | ||
369 | /* Update the connection counters */ | 404 | /* Update the connection counters */ |
370 | if (cp->cport || (cp->flags & IP_VS_CONN_F_NO_CPORT)) { | 405 | if (!(cp->flags & IP_VS_CONN_F_TEMPLATE)) { |
371 | /* It is a normal connection, so increase the inactive | 406 | /* It is a normal connection, so increase the inactive |
372 | connection counter because it is in TCP SYNRECV | 407 | connection counter because it is in TCP SYNRECV |
373 | state (inactive) or other protocol inacive state */ | 408 | state (inactive) or other protocol inacive state */ |
@@ -406,7 +441,7 @@ static inline void ip_vs_unbind_dest(struct ip_vs_conn *cp) | |||
406 | atomic_read(&dest->refcnt)); | 441 | atomic_read(&dest->refcnt)); |
407 | 442 | ||
408 | /* Update the connection counters */ | 443 | /* Update the connection counters */ |
409 | if (cp->cport || (cp->flags & IP_VS_CONN_F_NO_CPORT)) { | 444 | if (!(cp->flags & IP_VS_CONN_F_TEMPLATE)) { |
410 | /* It is a normal connection, so decrease the inactconns | 445 | /* It is a normal connection, so decrease the inactconns |
411 | or activeconns counter */ | 446 | or activeconns counter */ |
412 | if (cp->flags & IP_VS_CONN_F_INACTIVE) { | 447 | if (cp->flags & IP_VS_CONN_F_INACTIVE) { |
@@ -467,7 +502,7 @@ int ip_vs_check_template(struct ip_vs_conn *ct) | |||
467 | /* | 502 | /* |
468 | * Invalidate the connection template | 503 | * Invalidate the connection template |
469 | */ | 504 | */ |
470 | if (ct->cport) { | 505 | if (ct->vport != 65535) { |
471 | if (ip_vs_conn_unhash(ct)) { | 506 | if (ip_vs_conn_unhash(ct)) { |
472 | ct->dport = 65535; | 507 | ct->dport = 65535; |
473 | ct->vport = 65535; | 508 | ct->vport = 65535; |
@@ -776,7 +811,7 @@ void ip_vs_random_dropentry(void) | |||
776 | ct_write_lock_bh(hash); | 811 | ct_write_lock_bh(hash); |
777 | 812 | ||
778 | list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) { | 813 | list_for_each_entry(cp, &ip_vs_conn_tab[hash], c_list) { |
779 | if (!cp->cport && !(cp->flags & IP_VS_CONN_F_NO_CPORT)) | 814 | if (cp->flags & IP_VS_CONN_F_TEMPLATE) |
780 | /* connection template */ | 815 | /* connection template */ |
781 | continue; | 816 | continue; |
782 | 817 | ||
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c index 3ac7eeca04ac..981cc3244ef2 100644 --- a/net/ipv4/ipvs/ip_vs_core.c +++ b/net/ipv4/ipvs/ip_vs_core.c | |||
@@ -243,10 +243,10 @@ ip_vs_sched_persist(struct ip_vs_service *svc, | |||
243 | if (ports[1] == svc->port) { | 243 | if (ports[1] == svc->port) { |
244 | /* Check if a template already exists */ | 244 | /* Check if a template already exists */ |
245 | if (svc->port != FTPPORT) | 245 | if (svc->port != FTPPORT) |
246 | ct = ip_vs_conn_in_get(iph->protocol, snet, 0, | 246 | ct = ip_vs_ct_in_get(iph->protocol, snet, 0, |
247 | iph->daddr, ports[1]); | 247 | iph->daddr, ports[1]); |
248 | else | 248 | else |
249 | ct = ip_vs_conn_in_get(iph->protocol, snet, 0, | 249 | ct = ip_vs_ct_in_get(iph->protocol, snet, 0, |
250 | iph->daddr, 0); | 250 | iph->daddr, 0); |
251 | 251 | ||
252 | if (!ct || !ip_vs_check_template(ct)) { | 252 | if (!ct || !ip_vs_check_template(ct)) { |
@@ -272,14 +272,14 @@ ip_vs_sched_persist(struct ip_vs_service *svc, | |||
272 | iph->daddr, | 272 | iph->daddr, |
273 | ports[1], | 273 | ports[1], |
274 | dest->addr, dest->port, | 274 | dest->addr, dest->port, |
275 | 0, | 275 | IP_VS_CONN_F_TEMPLATE, |
276 | dest); | 276 | dest); |
277 | else | 277 | else |
278 | ct = ip_vs_conn_new(iph->protocol, | 278 | ct = ip_vs_conn_new(iph->protocol, |
279 | snet, 0, | 279 | snet, 0, |
280 | iph->daddr, 0, | 280 | iph->daddr, 0, |
281 | dest->addr, 0, | 281 | dest->addr, 0, |
282 | 0, | 282 | IP_VS_CONN_F_TEMPLATE, |
283 | dest); | 283 | dest); |
284 | if (ct == NULL) | 284 | if (ct == NULL) |
285 | return NULL; | 285 | return NULL; |
@@ -298,10 +298,10 @@ ip_vs_sched_persist(struct ip_vs_service *svc, | |||
298 | * port zero template: <protocol,caddr,0,vaddr,0,daddr,0> | 298 | * port zero template: <protocol,caddr,0,vaddr,0,daddr,0> |
299 | */ | 299 | */ |
300 | if (svc->fwmark) | 300 | if (svc->fwmark) |
301 | ct = ip_vs_conn_in_get(IPPROTO_IP, snet, 0, | 301 | ct = ip_vs_ct_in_get(IPPROTO_IP, snet, 0, |
302 | htonl(svc->fwmark), 0); | 302 | htonl(svc->fwmark), 0); |
303 | else | 303 | else |
304 | ct = ip_vs_conn_in_get(iph->protocol, snet, 0, | 304 | ct = ip_vs_ct_in_get(iph->protocol, snet, 0, |
305 | iph->daddr, 0); | 305 | iph->daddr, 0); |
306 | 306 | ||
307 | if (!ct || !ip_vs_check_template(ct)) { | 307 | if (!ct || !ip_vs_check_template(ct)) { |
@@ -326,14 +326,14 @@ ip_vs_sched_persist(struct ip_vs_service *svc, | |||
326 | snet, 0, | 326 | snet, 0, |
327 | htonl(svc->fwmark), 0, | 327 | htonl(svc->fwmark), 0, |
328 | dest->addr, 0, | 328 | dest->addr, 0, |
329 | 0, | 329 | IP_VS_CONN_F_TEMPLATE, |
330 | dest); | 330 | dest); |
331 | else | 331 | else |
332 | ct = ip_vs_conn_new(iph->protocol, | 332 | ct = ip_vs_conn_new(iph->protocol, |
333 | snet, 0, | 333 | snet, 0, |
334 | iph->daddr, 0, | 334 | iph->daddr, 0, |
335 | dest->addr, 0, | 335 | dest->addr, 0, |
336 | 0, | 336 | IP_VS_CONN_F_TEMPLATE, |
337 | dest); | 337 | dest); |
338 | if (ct == NULL) | 338 | if (ct == NULL) |
339 | return NULL; | 339 | return NULL; |
diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c index 574d1f509b46..2e5ced3d8062 100644 --- a/net/ipv4/ipvs/ip_vs_sync.c +++ b/net/ipv4/ipvs/ip_vs_sync.c | |||
@@ -297,16 +297,24 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen) | |||
297 | 297 | ||
298 | p = (char *)buffer + sizeof(struct ip_vs_sync_mesg); | 298 | p = (char *)buffer + sizeof(struct ip_vs_sync_mesg); |
299 | for (i=0; i<m->nr_conns; i++) { | 299 | for (i=0; i<m->nr_conns; i++) { |
300 | unsigned flags; | ||
301 | |||
300 | s = (struct ip_vs_sync_conn *)p; | 302 | s = (struct ip_vs_sync_conn *)p; |
301 | cp = ip_vs_conn_in_get(s->protocol, | 303 | flags = ntohs(s->flags); |
302 | s->caddr, s->cport, | 304 | if (!(flags & IP_VS_CONN_F_TEMPLATE)) |
303 | s->vaddr, s->vport); | 305 | cp = ip_vs_conn_in_get(s->protocol, |
306 | s->caddr, s->cport, | ||
307 | s->vaddr, s->vport); | ||
308 | else | ||
309 | cp = ip_vs_ct_in_get(s->protocol, | ||
310 | s->caddr, s->cport, | ||
311 | s->vaddr, s->vport); | ||
304 | if (!cp) { | 312 | if (!cp) { |
305 | cp = ip_vs_conn_new(s->protocol, | 313 | cp = ip_vs_conn_new(s->protocol, |
306 | s->caddr, s->cport, | 314 | s->caddr, s->cport, |
307 | s->vaddr, s->vport, | 315 | s->vaddr, s->vport, |
308 | s->daddr, s->dport, | 316 | s->daddr, s->dport, |
309 | ntohs(s->flags), NULL); | 317 | flags, NULL); |
310 | if (!cp) { | 318 | if (!cp) { |
311 | IP_VS_ERR("ip_vs_conn_new failed\n"); | 319 | IP_VS_ERR("ip_vs_conn_new failed\n"); |
312 | return; | 320 | return; |
@@ -315,11 +323,11 @@ static void ip_vs_process_message(const char *buffer, const size_t buflen) | |||
315 | } else if (!cp->dest) { | 323 | } else if (!cp->dest) { |
316 | /* it is an entry created by the synchronization */ | 324 | /* it is an entry created by the synchronization */ |
317 | cp->state = ntohs(s->state); | 325 | cp->state = ntohs(s->state); |
318 | cp->flags = ntohs(s->flags) | IP_VS_CONN_F_HASHED; | 326 | cp->flags = flags | IP_VS_CONN_F_HASHED; |
319 | } /* Note that we don't touch its state and flags | 327 | } /* Note that we don't touch its state and flags |
320 | if it is a normal entry. */ | 328 | if it is a normal entry. */ |
321 | 329 | ||
322 | if (ntohs(s->flags) & IP_VS_CONN_F_SEQ_MASK) { | 330 | if (flags & IP_VS_CONN_F_SEQ_MASK) { |
323 | opt = (struct ip_vs_sync_conn_options *)&s[1]; | 331 | opt = (struct ip_vs_sync_conn_options *)&s[1]; |
324 | memcpy(&cp->in_seq, opt, sizeof(*opt)); | 332 | memcpy(&cp->in_seq, opt, sizeof(*opt)); |
325 | p += FULL_CONN_SIZE; | 333 | p += FULL_CONN_SIZE; |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 29222b964951..a7537c7bbd06 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
@@ -979,14 +979,19 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
979 | if (!before(TCP_SKB_CB(skb)->seq, end_seq)) | 979 | if (!before(TCP_SKB_CB(skb)->seq, end_seq)) |
980 | break; | 980 | break; |
981 | 981 | ||
982 | in_sack = !after(start_seq, TCP_SKB_CB(skb)->seq) && | ||
983 | !before(end_seq, TCP_SKB_CB(skb)->end_seq); | ||
984 | |||
982 | pcount = tcp_skb_pcount(skb); | 985 | pcount = tcp_skb_pcount(skb); |
983 | 986 | ||
984 | if (pcount > 1 && | 987 | if (pcount > 1 && !in_sack && |
985 | (after(start_seq, TCP_SKB_CB(skb)->seq) || | 988 | after(TCP_SKB_CB(skb)->end_seq, start_seq)) { |
986 | before(end_seq, TCP_SKB_CB(skb)->end_seq))) { | ||
987 | unsigned int pkt_len; | 989 | unsigned int pkt_len; |
988 | 990 | ||
989 | if (after(start_seq, TCP_SKB_CB(skb)->seq)) | 991 | in_sack = !after(start_seq, |
992 | TCP_SKB_CB(skb)->seq); | ||
993 | |||
994 | if (!in_sack) | ||
990 | pkt_len = (start_seq - | 995 | pkt_len = (start_seq - |
991 | TCP_SKB_CB(skb)->seq); | 996 | TCP_SKB_CB(skb)->seq); |
992 | else | 997 | else |
@@ -999,9 +1004,6 @@ tcp_sacktag_write_queue(struct sock *sk, struct sk_buff *ack_skb, u32 prior_snd_ | |||
999 | 1004 | ||
1000 | fack_count += pcount; | 1005 | fack_count += pcount; |
1001 | 1006 | ||
1002 | in_sack = !after(start_seq, TCP_SKB_CB(skb)->seq) && | ||
1003 | !before(end_seq, TCP_SKB_CB(skb)->end_seq); | ||
1004 | |||
1005 | sacked = TCP_SKB_CB(skb)->sacked; | 1007 | sacked = TCP_SKB_CB(skb)->sacked; |
1006 | 1008 | ||
1007 | /* Account D-SACK for retransmitted packet. */ | 1009 | /* Account D-SACK for retransmitted packet. */ |
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index c10e4435e3b1..b018e31b6530 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
@@ -435,6 +435,8 @@ int tcp_fragment(struct sock *sk, struct sk_buff *skb, u32 len, unsigned int mss | |||
435 | int nsize, old_factor; | 435 | int nsize, old_factor; |
436 | u16 flags; | 436 | u16 flags; |
437 | 437 | ||
438 | BUG_ON(len >= skb->len); | ||
439 | |||
438 | nsize = skb_headlen(skb) - len; | 440 | nsize = skb_headlen(skb) - len; |
439 | if (nsize < 0) | 441 | if (nsize < 0) |
440 | nsize = 0; | 442 | nsize = 0; |
diff --git a/net/ipv6/mcast.c b/net/ipv6/mcast.c index 29fed6e58d0a..519899fb11d5 100644 --- a/net/ipv6/mcast.c +++ b/net/ipv6/mcast.c | |||
@@ -1968,7 +1968,7 @@ static void ip6_mc_clear_src(struct ifmcaddr6 *pmc) | |||
1968 | } | 1968 | } |
1969 | pmc->mca_sources = NULL; | 1969 | pmc->mca_sources = NULL; |
1970 | pmc->mca_sfmode = MCAST_EXCLUDE; | 1970 | pmc->mca_sfmode = MCAST_EXCLUDE; |
1971 | pmc->mca_sfcount[MCAST_EXCLUDE] = 0; | 1971 | pmc->mca_sfcount[MCAST_INCLUDE] = 0; |
1972 | pmc->mca_sfcount[MCAST_EXCLUDE] = 1; | 1972 | pmc->mca_sfcount[MCAST_EXCLUDE] = 1; |
1973 | } | 1973 | } |
1974 | 1974 | ||
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c index 69b146843a20..2b9bf9bd177f 100644 --- a/net/ipv6/udp.c +++ b/net/ipv6/udp.c | |||
@@ -405,9 +405,8 @@ static struct sock *udp_v6_mcast_next(struct sock *sk, | |||
405 | continue; | 405 | continue; |
406 | 406 | ||
407 | if (!ipv6_addr_any(&np->rcv_saddr)) { | 407 | if (!ipv6_addr_any(&np->rcv_saddr)) { |
408 | if (ipv6_addr_equal(&np->rcv_saddr, loc_addr)) | 408 | if (!ipv6_addr_equal(&np->rcv_saddr, loc_addr)) |
409 | return s; | 409 | continue; |
410 | continue; | ||
411 | } | 410 | } |
412 | if(!inet6_mc_check(s, loc_addr, rmt_addr)) | 411 | if(!inet6_mc_check(s, loc_addr, rmt_addr)) |
413 | continue; | 412 | continue; |
diff --git a/sound/pci/rme32.c b/sound/pci/rme32.c index 3daeecb9eb0e..cd313af6ebcf 100644 --- a/sound/pci/rme32.c +++ b/sound/pci/rme32.c | |||
@@ -228,11 +228,11 @@ typedef struct snd_rme32 { | |||
228 | } rme32_t; | 228 | } rme32_t; |
229 | 229 | ||
230 | static struct pci_device_id snd_rme32_ids[] = { | 230 | static struct pci_device_id snd_rme32_ids[] = { |
231 | {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_DIGI32, | 231 | {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32, |
232 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, | 232 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, |
233 | {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_DIGI32_8, | 233 | {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_8, |
234 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, | 234 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, |
235 | {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_DIGI32_PRO, | 235 | {PCI_VENDOR_ID_XILINX_RME, PCI_DEVICE_ID_RME_DIGI32_PRO, |
236 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, | 236 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0,}, |
237 | {0,} | 237 | {0,} |
238 | }; | 238 | }; |
@@ -240,7 +240,7 @@ static struct pci_device_id snd_rme32_ids[] = { | |||
240 | MODULE_DEVICE_TABLE(pci, snd_rme32_ids); | 240 | MODULE_DEVICE_TABLE(pci, snd_rme32_ids); |
241 | 241 | ||
242 | #define RME32_ISWORKING(rme32) ((rme32)->wcreg & RME32_WCR_START) | 242 | #define RME32_ISWORKING(rme32) ((rme32)->wcreg & RME32_WCR_START) |
243 | #define RME32_PRO_WITH_8414(rme32) ((rme32)->pci->device == PCI_DEVICE_ID_DIGI32_PRO && (rme32)->rev == RME32_PRO_REVISION_WITH_8414) | 243 | #define RME32_PRO_WITH_8414(rme32) ((rme32)->pci->device == PCI_DEVICE_ID_RME_DIGI32_PRO && (rme32)->rev == RME32_PRO_REVISION_WITH_8414) |
244 | 244 | ||
245 | static int snd_rme32_playback_prepare(snd_pcm_substream_t * substream); | 245 | static int snd_rme32_playback_prepare(snd_pcm_substream_t * substream); |
246 | 246 | ||
@@ -527,21 +527,21 @@ static int snd_rme32_playback_setrate(rme32_t * rme32, int rate) | |||
527 | RME32_WCR_FREQ_1; | 527 | RME32_WCR_FREQ_1; |
528 | break; | 528 | break; |
529 | case 64000: | 529 | case 64000: |
530 | if (rme32->pci->device != PCI_DEVICE_ID_DIGI32_PRO) | 530 | if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO) |
531 | return -EINVAL; | 531 | return -EINVAL; |
532 | rme32->wcreg |= RME32_WCR_DS_BM; | 532 | rme32->wcreg |= RME32_WCR_DS_BM; |
533 | rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) & | 533 | rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) & |
534 | ~RME32_WCR_FREQ_1; | 534 | ~RME32_WCR_FREQ_1; |
535 | break; | 535 | break; |
536 | case 88200: | 536 | case 88200: |
537 | if (rme32->pci->device != PCI_DEVICE_ID_DIGI32_PRO) | 537 | if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO) |
538 | return -EINVAL; | 538 | return -EINVAL; |
539 | rme32->wcreg |= RME32_WCR_DS_BM; | 539 | rme32->wcreg |= RME32_WCR_DS_BM; |
540 | rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) & | 540 | rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_1) & |
541 | ~RME32_WCR_FREQ_0; | 541 | ~RME32_WCR_FREQ_0; |
542 | break; | 542 | break; |
543 | case 96000: | 543 | case 96000: |
544 | if (rme32->pci->device != PCI_DEVICE_ID_DIGI32_PRO) | 544 | if (rme32->pci->device != PCI_DEVICE_ID_RME_DIGI32_PRO) |
545 | return -EINVAL; | 545 | return -EINVAL; |
546 | rme32->wcreg |= RME32_WCR_DS_BM; | 546 | rme32->wcreg |= RME32_WCR_DS_BM; |
547 | rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) | | 547 | rme32->wcreg = (rme32->wcreg | RME32_WCR_FREQ_0) | |
@@ -881,7 +881,7 @@ static int snd_rme32_playback_spdif_open(snd_pcm_substream_t * substream) | |||
881 | runtime->hw = snd_rme32_spdif_fd_info; | 881 | runtime->hw = snd_rme32_spdif_fd_info; |
882 | else | 882 | else |
883 | runtime->hw = snd_rme32_spdif_info; | 883 | runtime->hw = snd_rme32_spdif_info; |
884 | if (rme32->pci->device == PCI_DEVICE_ID_DIGI32_PRO) { | 884 | if (rme32->pci->device == PCI_DEVICE_ID_RME_DIGI32_PRO) { |
885 | runtime->hw.rates |= SNDRV_PCM_RATE_64000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000; | 885 | runtime->hw.rates |= SNDRV_PCM_RATE_64000 | SNDRV_PCM_RATE_88200 | SNDRV_PCM_RATE_96000; |
886 | runtime->hw.rate_max = 96000; | 886 | runtime->hw.rate_max = 96000; |
887 | } | 887 | } |
@@ -1408,8 +1408,8 @@ static int __devinit snd_rme32_create(rme32_t * rme32) | |||
1408 | } | 1408 | } |
1409 | 1409 | ||
1410 | /* set up ALSA pcm device for ADAT */ | 1410 | /* set up ALSA pcm device for ADAT */ |
1411 | if ((pci->device == PCI_DEVICE_ID_DIGI32) || | 1411 | if ((pci->device == PCI_DEVICE_ID_RME_DIGI32) || |
1412 | (pci->device == PCI_DEVICE_ID_DIGI32_PRO)) { | 1412 | (pci->device == PCI_DEVICE_ID_RME_DIGI32_PRO)) { |
1413 | /* ADAT is not available on DIGI32 and DIGI32 Pro */ | 1413 | /* ADAT is not available on DIGI32 and DIGI32 Pro */ |
1414 | rme32->adat_pcm = NULL; | 1414 | rme32->adat_pcm = NULL; |
1415 | } | 1415 | } |
@@ -1639,11 +1639,11 @@ snd_rme32_info_inputtype_control(snd_kcontrol_t * kcontrol, | |||
1639 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1639 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
1640 | uinfo->count = 1; | 1640 | uinfo->count = 1; |
1641 | switch (rme32->pci->device) { | 1641 | switch (rme32->pci->device) { |
1642 | case PCI_DEVICE_ID_DIGI32: | 1642 | case PCI_DEVICE_ID_RME_DIGI32: |
1643 | case PCI_DEVICE_ID_DIGI32_8: | 1643 | case PCI_DEVICE_ID_RME_DIGI32_8: |
1644 | uinfo->value.enumerated.items = 3; | 1644 | uinfo->value.enumerated.items = 3; |
1645 | break; | 1645 | break; |
1646 | case PCI_DEVICE_ID_DIGI32_PRO: | 1646 | case PCI_DEVICE_ID_RME_DIGI32_PRO: |
1647 | uinfo->value.enumerated.items = 4; | 1647 | uinfo->value.enumerated.items = 4; |
1648 | break; | 1648 | break; |
1649 | default: | 1649 | default: |
@@ -1670,11 +1670,11 @@ snd_rme32_get_inputtype_control(snd_kcontrol_t * kcontrol, | |||
1670 | ucontrol->value.enumerated.item[0] = snd_rme32_getinputtype(rme32); | 1670 | ucontrol->value.enumerated.item[0] = snd_rme32_getinputtype(rme32); |
1671 | 1671 | ||
1672 | switch (rme32->pci->device) { | 1672 | switch (rme32->pci->device) { |
1673 | case PCI_DEVICE_ID_DIGI32: | 1673 | case PCI_DEVICE_ID_RME_DIGI32: |
1674 | case PCI_DEVICE_ID_DIGI32_8: | 1674 | case PCI_DEVICE_ID_RME_DIGI32_8: |
1675 | items = 3; | 1675 | items = 3; |
1676 | break; | 1676 | break; |
1677 | case PCI_DEVICE_ID_DIGI32_PRO: | 1677 | case PCI_DEVICE_ID_RME_DIGI32_PRO: |
1678 | items = 4; | 1678 | items = 4; |
1679 | break; | 1679 | break; |
1680 | default: | 1680 | default: |
@@ -1697,11 +1697,11 @@ snd_rme32_put_inputtype_control(snd_kcontrol_t * kcontrol, | |||
1697 | int change, items = 3; | 1697 | int change, items = 3; |
1698 | 1698 | ||
1699 | switch (rme32->pci->device) { | 1699 | switch (rme32->pci->device) { |
1700 | case PCI_DEVICE_ID_DIGI32: | 1700 | case PCI_DEVICE_ID_RME_DIGI32: |
1701 | case PCI_DEVICE_ID_DIGI32_8: | 1701 | case PCI_DEVICE_ID_RME_DIGI32_8: |
1702 | items = 3; | 1702 | items = 3; |
1703 | break; | 1703 | break; |
1704 | case PCI_DEVICE_ID_DIGI32_PRO: | 1704 | case PCI_DEVICE_ID_RME_DIGI32_PRO: |
1705 | items = 4; | 1705 | items = 4; |
1706 | break; | 1706 | break; |
1707 | default: | 1707 | default: |
@@ -1982,13 +1982,13 @@ snd_rme32_probe(struct pci_dev *pci, const struct pci_device_id *pci_id) | |||
1982 | 1982 | ||
1983 | strcpy(card->driver, "Digi32"); | 1983 | strcpy(card->driver, "Digi32"); |
1984 | switch (rme32->pci->device) { | 1984 | switch (rme32->pci->device) { |
1985 | case PCI_DEVICE_ID_DIGI32: | 1985 | case PCI_DEVICE_ID_RME_DIGI32: |
1986 | strcpy(card->shortname, "RME Digi32"); | 1986 | strcpy(card->shortname, "RME Digi32"); |
1987 | break; | 1987 | break; |
1988 | case PCI_DEVICE_ID_DIGI32_8: | 1988 | case PCI_DEVICE_ID_RME_DIGI32_8: |
1989 | strcpy(card->shortname, "RME Digi32/8"); | 1989 | strcpy(card->shortname, "RME Digi32/8"); |
1990 | break; | 1990 | break; |
1991 | case PCI_DEVICE_ID_DIGI32_PRO: | 1991 | case PCI_DEVICE_ID_RME_DIGI32_PRO: |
1992 | strcpy(card->shortname, "RME Digi32 PRO"); | 1992 | strcpy(card->shortname, "RME Digi32 PRO"); |
1993 | break; | 1993 | break; |
1994 | } | 1994 | } |
diff --git a/sound/pci/rme96.c b/sound/pci/rme96.c index 9983b66dc564..c495cae78dbf 100644 --- a/sound/pci/rme96.c +++ b/sound/pci/rme96.c | |||
@@ -233,13 +233,13 @@ typedef struct snd_rme96 { | |||
233 | } rme96_t; | 233 | } rme96_t; |
234 | 234 | ||
235 | static struct pci_device_id snd_rme96_ids[] = { | 235 | static struct pci_device_id snd_rme96_ids[] = { |
236 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_DIGI96, | 236 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96, |
237 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | 237 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, |
238 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_DIGI96_8, | 238 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8, |
239 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | 239 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, |
240 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_DIGI96_8_PRO, | 240 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PRO, |
241 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | 241 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, |
242 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST, | 242 | { PCI_VENDOR_ID_XILINX, PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST, |
243 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | 243 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, |
244 | { 0, } | 244 | { 0, } |
245 | }; | 245 | }; |
@@ -248,12 +248,12 @@ MODULE_DEVICE_TABLE(pci, snd_rme96_ids); | |||
248 | 248 | ||
249 | #define RME96_ISPLAYING(rme96) ((rme96)->wcreg & RME96_WCR_START) | 249 | #define RME96_ISPLAYING(rme96) ((rme96)->wcreg & RME96_WCR_START) |
250 | #define RME96_ISRECORDING(rme96) ((rme96)->wcreg & RME96_WCR_START_2) | 250 | #define RME96_ISRECORDING(rme96) ((rme96)->wcreg & RME96_WCR_START_2) |
251 | #define RME96_HAS_ANALOG_IN(rme96) ((rme96)->pci->device == PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST) | 251 | #define RME96_HAS_ANALOG_IN(rme96) ((rme96)->pci->device == PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST) |
252 | #define RME96_HAS_ANALOG_OUT(rme96) ((rme96)->pci->device == PCI_DEVICE_ID_DIGI96_8_PRO || \ | 252 | #define RME96_HAS_ANALOG_OUT(rme96) ((rme96)->pci->device == PCI_DEVICE_ID_RME_DIGI96_8_PRO || \ |
253 | (rme96)->pci->device == PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST) | 253 | (rme96)->pci->device == PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST) |
254 | #define RME96_DAC_IS_1852(rme96) (RME96_HAS_ANALOG_OUT(rme96) && (rme96)->rev >= 4) | 254 | #define RME96_DAC_IS_1852(rme96) (RME96_HAS_ANALOG_OUT(rme96) && (rme96)->rev >= 4) |
255 | #define RME96_DAC_IS_1855(rme96) (((rme96)->pci->device == PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST && (rme96)->rev < 4) || \ | 255 | #define RME96_DAC_IS_1855(rme96) (((rme96)->pci->device == PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST && (rme96)->rev < 4) || \ |
256 | ((rme96)->pci->device == PCI_DEVICE_ID_DIGI96_8_PRO && (rme96)->rev == 2)) | 256 | ((rme96)->pci->device == PCI_DEVICE_ID_RME_DIGI96_8_PRO && (rme96)->rev == 2)) |
257 | #define RME96_185X_MAX_OUT(rme96) ((1 << (RME96_DAC_IS_1852(rme96) ? RME96_AD1852_VOL_BITS : RME96_AD1855_VOL_BITS)) - 1) | 257 | #define RME96_185X_MAX_OUT(rme96) ((1 << (RME96_DAC_IS_1852(rme96) ? RME96_AD1852_VOL_BITS : RME96_AD1855_VOL_BITS)) - 1) |
258 | 258 | ||
259 | static int | 259 | static int |
@@ -830,9 +830,9 @@ snd_rme96_setinputtype(rme96_t *rme96, | |||
830 | RME96_WCR_INP_1; | 830 | RME96_WCR_INP_1; |
831 | break; | 831 | break; |
832 | case RME96_INPUT_XLR: | 832 | case RME96_INPUT_XLR: |
833 | if ((rme96->pci->device != PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST && | 833 | if ((rme96->pci->device != PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST && |
834 | rme96->pci->device != PCI_DEVICE_ID_DIGI96_8_PRO) || | 834 | rme96->pci->device != PCI_DEVICE_ID_RME_DIGI96_8_PRO) || |
835 | (rme96->pci->device == PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST && | 835 | (rme96->pci->device == PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST && |
836 | rme96->rev > 4)) | 836 | rme96->rev > 4)) |
837 | { | 837 | { |
838 | /* Only Digi96/8 PRO and Digi96/8 PAD supports XLR */ | 838 | /* Only Digi96/8 PRO and Digi96/8 PAD supports XLR */ |
@@ -1598,7 +1598,7 @@ snd_rme96_create(rme96_t *rme96) | |||
1598 | rme96->spdif_pcm->info_flags = 0; | 1598 | rme96->spdif_pcm->info_flags = 0; |
1599 | 1599 | ||
1600 | /* set up ALSA pcm device for ADAT */ | 1600 | /* set up ALSA pcm device for ADAT */ |
1601 | if (pci->device == PCI_DEVICE_ID_DIGI96) { | 1601 | if (pci->device == PCI_DEVICE_ID_RME_DIGI96) { |
1602 | /* ADAT is not available on the base model */ | 1602 | /* ADAT is not available on the base model */ |
1603 | rme96->adat_pcm = NULL; | 1603 | rme96->adat_pcm = NULL; |
1604 | } else { | 1604 | } else { |
@@ -1858,14 +1858,14 @@ snd_rme96_info_inputtype_control(snd_kcontrol_t *kcontrol, snd_ctl_elem_info_t * | |||
1858 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | 1858 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; |
1859 | uinfo->count = 1; | 1859 | uinfo->count = 1; |
1860 | switch (rme96->pci->device) { | 1860 | switch (rme96->pci->device) { |
1861 | case PCI_DEVICE_ID_DIGI96: | 1861 | case PCI_DEVICE_ID_RME_DIGI96: |
1862 | case PCI_DEVICE_ID_DIGI96_8: | 1862 | case PCI_DEVICE_ID_RME_DIGI96_8: |
1863 | uinfo->value.enumerated.items = 3; | 1863 | uinfo->value.enumerated.items = 3; |
1864 | break; | 1864 | break; |
1865 | case PCI_DEVICE_ID_DIGI96_8_PRO: | 1865 | case PCI_DEVICE_ID_RME_DIGI96_8_PRO: |
1866 | uinfo->value.enumerated.items = 4; | 1866 | uinfo->value.enumerated.items = 4; |
1867 | break; | 1867 | break; |
1868 | case PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST: | 1868 | case PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST: |
1869 | if (rme96->rev > 4) { | 1869 | if (rme96->rev > 4) { |
1870 | /* PST */ | 1870 | /* PST */ |
1871 | uinfo->value.enumerated.items = 4; | 1871 | uinfo->value.enumerated.items = 4; |
@@ -1895,14 +1895,14 @@ snd_rme96_get_inputtype_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1895 | ucontrol->value.enumerated.item[0] = snd_rme96_getinputtype(rme96); | 1895 | ucontrol->value.enumerated.item[0] = snd_rme96_getinputtype(rme96); |
1896 | 1896 | ||
1897 | switch (rme96->pci->device) { | 1897 | switch (rme96->pci->device) { |
1898 | case PCI_DEVICE_ID_DIGI96: | 1898 | case PCI_DEVICE_ID_RME_DIGI96: |
1899 | case PCI_DEVICE_ID_DIGI96_8: | 1899 | case PCI_DEVICE_ID_RME_DIGI96_8: |
1900 | items = 3; | 1900 | items = 3; |
1901 | break; | 1901 | break; |
1902 | case PCI_DEVICE_ID_DIGI96_8_PRO: | 1902 | case PCI_DEVICE_ID_RME_DIGI96_8_PRO: |
1903 | items = 4; | 1903 | items = 4; |
1904 | break; | 1904 | break; |
1905 | case PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST: | 1905 | case PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST: |
1906 | if (rme96->rev > 4) { | 1906 | if (rme96->rev > 4) { |
1907 | /* for handling PST case, (INPUT_ANALOG is moved to INPUT_XLR */ | 1907 | /* for handling PST case, (INPUT_ANALOG is moved to INPUT_XLR */ |
1908 | if (ucontrol->value.enumerated.item[0] == RME96_INPUT_ANALOG) { | 1908 | if (ucontrol->value.enumerated.item[0] == RME96_INPUT_ANALOG) { |
@@ -1932,14 +1932,14 @@ snd_rme96_put_inputtype_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1932 | int change, items = 3; | 1932 | int change, items = 3; |
1933 | 1933 | ||
1934 | switch (rme96->pci->device) { | 1934 | switch (rme96->pci->device) { |
1935 | case PCI_DEVICE_ID_DIGI96: | 1935 | case PCI_DEVICE_ID_RME_DIGI96: |
1936 | case PCI_DEVICE_ID_DIGI96_8: | 1936 | case PCI_DEVICE_ID_RME_DIGI96_8: |
1937 | items = 3; | 1937 | items = 3; |
1938 | break; | 1938 | break; |
1939 | case PCI_DEVICE_ID_DIGI96_8_PRO: | 1939 | case PCI_DEVICE_ID_RME_DIGI96_8_PRO: |
1940 | items = 4; | 1940 | items = 4; |
1941 | break; | 1941 | break; |
1942 | case PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST: | 1942 | case PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST: |
1943 | if (rme96->rev > 4) { | 1943 | if (rme96->rev > 4) { |
1944 | items = 4; | 1944 | items = 4; |
1945 | } else { | 1945 | } else { |
@@ -1953,7 +1953,7 @@ snd_rme96_put_inputtype_control(snd_kcontrol_t * kcontrol, snd_ctl_elem_value_t | |||
1953 | val = ucontrol->value.enumerated.item[0] % items; | 1953 | val = ucontrol->value.enumerated.item[0] % items; |
1954 | 1954 | ||
1955 | /* special case for PST */ | 1955 | /* special case for PST */ |
1956 | if (rme96->pci->device == PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST && rme96->rev > 4) { | 1956 | if (rme96->pci->device == PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST && rme96->rev > 4) { |
1957 | if (val == RME96_INPUT_XLR) { | 1957 | if (val == RME96_INPUT_XLR) { |
1958 | val = RME96_INPUT_ANALOG; | 1958 | val = RME96_INPUT_ANALOG; |
1959 | } | 1959 | } |
@@ -2375,16 +2375,16 @@ snd_rme96_probe(struct pci_dev *pci, | |||
2375 | 2375 | ||
2376 | strcpy(card->driver, "Digi96"); | 2376 | strcpy(card->driver, "Digi96"); |
2377 | switch (rme96->pci->device) { | 2377 | switch (rme96->pci->device) { |
2378 | case PCI_DEVICE_ID_DIGI96: | 2378 | case PCI_DEVICE_ID_RME_DIGI96: |
2379 | strcpy(card->shortname, "RME Digi96"); | 2379 | strcpy(card->shortname, "RME Digi96"); |
2380 | break; | 2380 | break; |
2381 | case PCI_DEVICE_ID_DIGI96_8: | 2381 | case PCI_DEVICE_ID_RME_DIGI96_8: |
2382 | strcpy(card->shortname, "RME Digi96/8"); | 2382 | strcpy(card->shortname, "RME Digi96/8"); |
2383 | break; | 2383 | break; |
2384 | case PCI_DEVICE_ID_DIGI96_8_PRO: | 2384 | case PCI_DEVICE_ID_RME_DIGI96_8_PRO: |
2385 | strcpy(card->shortname, "RME Digi96/8 PRO"); | 2385 | strcpy(card->shortname, "RME Digi96/8 PRO"); |
2386 | break; | 2386 | break; |
2387 | case PCI_DEVICE_ID_DIGI96_8_PAD_OR_PST: | 2387 | case PCI_DEVICE_ID_RME_DIGI96_8_PAD_OR_PST: |
2388 | pci_read_config_byte(rme96->pci, 8, &val); | 2388 | pci_read_config_byte(rme96->pci, 8, &val); |
2389 | if (val < 5) { | 2389 | if (val < 5) { |
2390 | strcpy(card->shortname, "RME Digi96/8 PAD"); | 2390 | strcpy(card->shortname, "RME Digi96/8 PAD"); |