diff options
120 files changed, 1050 insertions, 543 deletions
diff --git a/Documentation/networking/ipv6.txt b/Documentation/networking/ipv6.txt new file mode 100644 index 000000000000..268e5c103dd8 --- /dev/null +++ b/Documentation/networking/ipv6.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | |||
2 | Options for the ipv6 module are supplied as parameters at load time. | ||
3 | |||
4 | Module options may be given as command line arguments to the insmod | ||
5 | or modprobe command, but are usually specified in either the | ||
6 | /etc/modules.conf or /etc/modprobe.conf configuration file, or in a | ||
7 | distro-specific configuration file. | ||
8 | |||
9 | The available ipv6 module parameters are listed below. If a parameter | ||
10 | is not specified the default value is used. | ||
11 | |||
12 | The parameters are as follows: | ||
13 | |||
14 | disable | ||
15 | |||
16 | Specifies whether to load the IPv6 module, but disable all | ||
17 | its functionality. This might be used when another module | ||
18 | has a dependency on the IPv6 module being loaded, but no | ||
19 | IPv6 addresses or operations are desired. | ||
20 | |||
21 | The possible values and their effects are: | ||
22 | |||
23 | 0 | ||
24 | IPv6 is enabled. | ||
25 | |||
26 | This is the default value. | ||
27 | |||
28 | 1 | ||
29 | IPv6 is disabled. | ||
30 | |||
31 | No IPv6 addresses will be added to interfaces, and | ||
32 | it will not be possible to open an IPv6 socket. | ||
33 | |||
34 | A reboot is required to enable IPv6. | ||
35 | |||
diff --git a/Documentation/scsi/cxgb3i.txt b/Documentation/scsi/cxgb3i.txt index 8141fa01978e..7ac8032ee9b2 100644 --- a/Documentation/scsi/cxgb3i.txt +++ b/Documentation/scsi/cxgb3i.txt | |||
@@ -4,7 +4,7 @@ Introduction | |||
4 | ============ | 4 | ============ |
5 | 5 | ||
6 | The Chelsio T3 ASIC based Adapters (S310, S320, S302, S304, Mezz cards, etc. | 6 | The Chelsio T3 ASIC based Adapters (S310, S320, S302, S304, Mezz cards, etc. |
7 | series of products) supports iSCSI acceleration and iSCSI Direct Data Placement | 7 | series of products) support iSCSI acceleration and iSCSI Direct Data Placement |
8 | (DDP) where the hardware handles the expensive byte touching operations, such | 8 | (DDP) where the hardware handles the expensive byte touching operations, such |
9 | as CRC computation and verification, and direct DMA to the final host memory | 9 | as CRC computation and verification, and direct DMA to the final host memory |
10 | destination: | 10 | destination: |
@@ -31,9 +31,9 @@ destination: | |||
31 | the TCP segments onto the wire. It handles TCP retransmission if | 31 | the TCP segments onto the wire. It handles TCP retransmission if |
32 | needed. | 32 | needed. |
33 | 33 | ||
34 | On receving, S3 h/w recovers the iSCSI PDU by reassembling TCP | 34 | On receiving, S3 h/w recovers the iSCSI PDU by reassembling TCP |
35 | segments, separating the header and data, calculating and verifying | 35 | segments, separating the header and data, calculating and verifying |
36 | the digests, then forwards the header to the host. The payload data, | 36 | the digests, then forwarding the header to the host. The payload data, |
37 | if possible, will be directly placed into the pre-posted host DDP | 37 | if possible, will be directly placed into the pre-posted host DDP |
38 | buffer. Otherwise, the payload data will be sent to the host too. | 38 | buffer. Otherwise, the payload data will be sent to the host too. |
39 | 39 | ||
@@ -68,9 +68,8 @@ The following steps need to be taken to accelerates the open-iscsi initiator: | |||
68 | sure the ip address is unique in the network. | 68 | sure the ip address is unique in the network. |
69 | 69 | ||
70 | 3. edit /etc/iscsi/iscsid.conf | 70 | 3. edit /etc/iscsi/iscsid.conf |
71 | The default setting for MaxRecvDataSegmentLength (131072) is too big, | 71 | The default setting for MaxRecvDataSegmentLength (131072) is too big; |
72 | replace "node.conn[0].iscsi.MaxRecvDataSegmentLength" to be a value no | 72 | replace with a value no bigger than 15360 (for example 8192): |
73 | bigger than 15360 (for example 8192): | ||
74 | 73 | ||
75 | node.conn[0].iscsi.MaxRecvDataSegmentLength = 8192 | 74 | node.conn[0].iscsi.MaxRecvDataSegmentLength = 8192 |
76 | 75 | ||
diff --git a/MAINTAINERS b/MAINTAINERS index e74a133ce271..0d9ea2a4e497 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
@@ -2466,7 +2466,7 @@ S: Maintained | |||
2466 | 2466 | ||
2467 | ISDN SUBSYSTEM | 2467 | ISDN SUBSYSTEM |
2468 | P: Karsten Keil | 2468 | P: Karsten Keil |
2469 | M: kkeil@suse.de | 2469 | M: isdn@linux-pingi.de |
2470 | L: isdn4linux@listserv.isdn4linux.de (subscribers-only) | 2470 | L: isdn4linux@listserv.isdn4linux.de (subscribers-only) |
2471 | W: http://www.isdn4linux.de | 2471 | W: http://www.isdn4linux.de |
2472 | T: git kernel.org:/pub/scm/linux/kernel/kkeil/isdn-2.6.git | 2472 | T: git kernel.org:/pub/scm/linux/kernel/kkeil/isdn-2.6.git |
@@ -1,7 +1,7 @@ | |||
1 | VERSION = 2 | 1 | VERSION = 2 |
2 | PATCHLEVEL = 6 | 2 | PATCHLEVEL = 6 |
3 | SUBLEVEL = 29 | 3 | SUBLEVEL = 29 |
4 | EXTRAVERSION = -rc6 | 4 | EXTRAVERSION = -rc7 |
5 | NAME = Erotic Pickled Herring | 5 | NAME = Erotic Pickled Herring |
6 | 6 | ||
7 | # *DOCUMENTATION* | 7 | # *DOCUMENTATION* |
diff --git a/arch/arm/kernel/setup.c b/arch/arm/kernel/setup.c index 7049815d66d5..68d6494c0389 100644 --- a/arch/arm/kernel/setup.c +++ b/arch/arm/kernel/setup.c | |||
@@ -233,12 +233,13 @@ static void __init cacheid_init(void) | |||
233 | unsigned int cachetype = read_cpuid_cachetype(); | 233 | unsigned int cachetype = read_cpuid_cachetype(); |
234 | unsigned int arch = cpu_architecture(); | 234 | unsigned int arch = cpu_architecture(); |
235 | 235 | ||
236 | if (arch >= CPU_ARCH_ARMv7) { | 236 | if (arch >= CPU_ARCH_ARMv6) { |
237 | cacheid = CACHEID_VIPT_NONALIASING; | 237 | if ((cachetype & (7 << 29)) == 4 << 29) { |
238 | if ((cachetype & (3 << 14)) == 1 << 14) | 238 | /* ARMv7 register format */ |
239 | cacheid |= CACHEID_ASID_TAGGED; | 239 | cacheid = CACHEID_VIPT_NONALIASING; |
240 | } else if (arch >= CPU_ARCH_ARMv6) { | 240 | if ((cachetype & (3 << 14)) == 1 << 14) |
241 | if (cachetype & (1 << 23)) | 241 | cacheid |= CACHEID_ASID_TAGGED; |
242 | } else if (cachetype & (1 << 23)) | ||
242 | cacheid = CACHEID_VIPT_ALIASING; | 243 | cacheid = CACHEID_VIPT_ALIASING; |
243 | else | 244 | else |
244 | cacheid = CACHEID_VIPT_NONALIASING; | 245 | cacheid = CACHEID_VIPT_NONALIASING; |
diff --git a/arch/arm/mach-at91/pm.c b/arch/arm/mach-at91/pm.c index 9bb4f043aa22..7ac812dc055a 100644 --- a/arch/arm/mach-at91/pm.c +++ b/arch/arm/mach-at91/pm.c | |||
@@ -332,7 +332,6 @@ static int at91_pm_enter(suspend_state_t state) | |||
332 | at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR)); | 332 | at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR)); |
333 | 333 | ||
334 | error: | 334 | error: |
335 | sdram_selfrefresh_disable(); | ||
336 | target_state = PM_SUSPEND_ON; | 335 | target_state = PM_SUSPEND_ON; |
337 | at91_irq_resume(); | 336 | at91_irq_resume(); |
338 | at91_gpio_resume(); | 337 | at91_gpio_resume(); |
diff --git a/arch/arm/mach-omap2/board-ldp.c b/arch/arm/mach-omap2/board-ldp.c index f6a13451d1fd..6031e179926b 100644 --- a/arch/arm/mach-omap2/board-ldp.c +++ b/arch/arm/mach-omap2/board-ldp.c | |||
@@ -81,7 +81,7 @@ static inline void __init ldp_init_smc911x(void) | |||
81 | } | 81 | } |
82 | 82 | ||
83 | ldp_smc911x_resources[0].start = cs_mem_base + 0x0; | 83 | ldp_smc911x_resources[0].start = cs_mem_base + 0x0; |
84 | ldp_smc911x_resources[0].end = cs_mem_base + 0xf; | 84 | ldp_smc911x_resources[0].end = cs_mem_base + 0xff; |
85 | udelay(100); | 85 | udelay(100); |
86 | 86 | ||
87 | eth_gpio = LDP_SMC911X_GPIO; | 87 | eth_gpio = LDP_SMC911X_GPIO; |
diff --git a/arch/arm/mm/abort-ev6.S b/arch/arm/mm/abort-ev6.S index 8a7f65ba14b7..94077fbd96b7 100644 --- a/arch/arm/mm/abort-ev6.S +++ b/arch/arm/mm/abort-ev6.S | |||
@@ -23,7 +23,8 @@ ENTRY(v6_early_abort) | |||
23 | #ifdef CONFIG_CPU_32v6K | 23 | #ifdef CONFIG_CPU_32v6K |
24 | clrex | 24 | clrex |
25 | #else | 25 | #else |
26 | strex r0, r1, [sp] @ Clear the exclusive monitor | 26 | sub r1, sp, #4 @ Get unused stack location |
27 | strex r0, r1, [r1] @ Clear the exclusive monitor | ||
27 | #endif | 28 | #endif |
28 | mrc p15, 0, r1, c5, c0, 0 @ get FSR | 29 | mrc p15, 0, r1, c5, c0, 0 @ get FSR |
29 | mrc p15, 0, r0, c6, c0, 0 @ get FAR | 30 | mrc p15, 0, r0, c6, c0, 0 @ get FAR |
diff --git a/arch/arm/plat-s3c64xx/irq-eint.c b/arch/arm/plat-s3c64xx/irq-eint.c index 1f7cc0067f5c..ebb305ce7689 100644 --- a/arch/arm/plat-s3c64xx/irq-eint.c +++ b/arch/arm/plat-s3c64xx/irq-eint.c | |||
@@ -55,7 +55,7 @@ static void s3c_irq_eint_unmask(unsigned int irq) | |||
55 | u32 mask; | 55 | u32 mask; |
56 | 56 | ||
57 | mask = __raw_readl(S3C64XX_EINT0MASK); | 57 | mask = __raw_readl(S3C64XX_EINT0MASK); |
58 | mask |= eint_irq_to_bit(irq); | 58 | mask &= ~eint_irq_to_bit(irq); |
59 | __raw_writel(mask, S3C64XX_EINT0MASK); | 59 | __raw_writel(mask, S3C64XX_EINT0MASK); |
60 | } | 60 | } |
61 | 61 | ||
diff --git a/arch/mips/include/asm/seccomp.h b/arch/mips/include/asm/seccomp.h index 36ed44070256..a6772e9507f5 100644 --- a/arch/mips/include/asm/seccomp.h +++ b/arch/mips/include/asm/seccomp.h | |||
@@ -1,6 +1,5 @@ | |||
1 | #ifndef __ASM_SECCOMP_H | 1 | #ifndef __ASM_SECCOMP_H |
2 | 2 | ||
3 | #include <linux/thread_info.h> | ||
4 | #include <linux/unistd.h> | 3 | #include <linux/unistd.h> |
5 | 4 | ||
6 | #define __NR_seccomp_read __NR_read | 5 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/powerpc/include/asm/compat.h b/arch/powerpc/include/asm/compat.h index d811a8cd7b58..4774c2f92232 100644 --- a/arch/powerpc/include/asm/compat.h +++ b/arch/powerpc/include/asm/compat.h | |||
@@ -210,5 +210,10 @@ struct compat_shmid64_ds { | |||
210 | compat_ulong_t __unused6; | 210 | compat_ulong_t __unused6; |
211 | }; | 211 | }; |
212 | 212 | ||
213 | static inline int is_compat_task(void) | ||
214 | { | ||
215 | return test_thread_flag(TIF_32BIT); | ||
216 | } | ||
217 | |||
213 | #endif /* __KERNEL__ */ | 218 | #endif /* __KERNEL__ */ |
214 | #endif /* _ASM_POWERPC_COMPAT_H */ | 219 | #endif /* _ASM_POWERPC_COMPAT_H */ |
diff --git a/arch/powerpc/include/asm/seccomp.h b/arch/powerpc/include/asm/seccomp.h index 853765eb1f65..00c1d9133cfe 100644 --- a/arch/powerpc/include/asm/seccomp.h +++ b/arch/powerpc/include/asm/seccomp.h | |||
@@ -1,10 +1,6 @@ | |||
1 | #ifndef _ASM_POWERPC_SECCOMP_H | 1 | #ifndef _ASM_POWERPC_SECCOMP_H |
2 | #define _ASM_POWERPC_SECCOMP_H | 2 | #define _ASM_POWERPC_SECCOMP_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | #include <linux/thread_info.h> | ||
6 | #endif | ||
7 | |||
8 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
9 | 5 | ||
10 | #define __NR_seccomp_read __NR_read | 6 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/powerpc/platforms/86xx/gef_sbc610.c b/arch/powerpc/platforms/86xx/gef_sbc610.c index fb371f5ce132..d6b772ba3b8f 100644 --- a/arch/powerpc/platforms/86xx/gef_sbc610.c +++ b/arch/powerpc/platforms/86xx/gef_sbc610.c | |||
@@ -142,6 +142,10 @@ static void __init gef_sbc610_nec_fixup(struct pci_dev *pdev) | |||
142 | { | 142 | { |
143 | unsigned int val; | 143 | unsigned int val; |
144 | 144 | ||
145 | /* Do not do the fixup on other platforms! */ | ||
146 | if (!machine_is(gef_sbc610)) | ||
147 | return; | ||
148 | |||
145 | printk(KERN_INFO "Running NEC uPD720101 Fixup\n"); | 149 | printk(KERN_INFO "Running NEC uPD720101 Fixup\n"); |
146 | 150 | ||
147 | /* Ensure ports 1, 2, 3, 4 & 5 are enabled */ | 151 | /* Ensure ports 1, 2, 3, 4 & 5 are enabled */ |
diff --git a/arch/s390/crypto/aes_s390.c b/arch/s390/crypto/aes_s390.c index c42cd898f68b..6118890c946d 100644 --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c | |||
@@ -556,7 +556,7 @@ static void __exit aes_s390_fini(void) | |||
556 | module_init(aes_s390_init); | 556 | module_init(aes_s390_init); |
557 | module_exit(aes_s390_fini); | 557 | module_exit(aes_s390_fini); |
558 | 558 | ||
559 | MODULE_ALIAS("aes"); | 559 | MODULE_ALIAS("aes-all"); |
560 | 560 | ||
561 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); | 561 | MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); |
562 | MODULE_LICENSE("GPL"); | 562 | MODULE_LICENSE("GPL"); |
diff --git a/arch/sparc/include/asm/compat.h b/arch/sparc/include/asm/compat.h index f260b58f5ce9..0e706257918f 100644 --- a/arch/sparc/include/asm/compat.h +++ b/arch/sparc/include/asm/compat.h | |||
@@ -240,4 +240,9 @@ struct compat_shmid64_ds { | |||
240 | unsigned int __unused2; | 240 | unsigned int __unused2; |
241 | }; | 241 | }; |
242 | 242 | ||
243 | static inline int is_compat_task(void) | ||
244 | { | ||
245 | return test_thread_flag(TIF_32BIT); | ||
246 | } | ||
247 | |||
243 | #endif /* _ASM_SPARC64_COMPAT_H */ | 248 | #endif /* _ASM_SPARC64_COMPAT_H */ |
diff --git a/arch/sparc/include/asm/seccomp.h b/arch/sparc/include/asm/seccomp.h index 7fcd9968192b..adca1bce41d4 100644 --- a/arch/sparc/include/asm/seccomp.h +++ b/arch/sparc/include/asm/seccomp.h | |||
@@ -1,11 +1,5 @@ | |||
1 | #ifndef _ASM_SECCOMP_H | 1 | #ifndef _ASM_SECCOMP_H |
2 | 2 | ||
3 | #include <linux/thread_info.h> /* already defines TIF_32BIT */ | ||
4 | |||
5 | #ifndef TIF_32BIT | ||
6 | #error "unexpected TIF_32BIT on sparc64" | ||
7 | #endif | ||
8 | |||
9 | #include <linux/unistd.h> | 3 | #include <linux/unistd.h> |
10 | 4 | ||
11 | #define __NR_seccomp_read __NR_read | 5 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/x86/include/asm/seccomp_32.h b/arch/x86/include/asm/seccomp_32.h index a6ad87b352c4..b811d6f5780c 100644 --- a/arch/x86/include/asm/seccomp_32.h +++ b/arch/x86/include/asm/seccomp_32.h | |||
@@ -1,12 +1,6 @@ | |||
1 | #ifndef _ASM_X86_SECCOMP_32_H | 1 | #ifndef _ASM_X86_SECCOMP_32_H |
2 | #define _ASM_X86_SECCOMP_32_H | 2 | #define _ASM_X86_SECCOMP_32_H |
3 | 3 | ||
4 | #include <linux/thread_info.h> | ||
5 | |||
6 | #ifdef TIF_32BIT | ||
7 | #error "unexpected TIF_32BIT on i386" | ||
8 | #endif | ||
9 | |||
10 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
11 | 5 | ||
12 | #define __NR_seccomp_read __NR_read | 6 | #define __NR_seccomp_read __NR_read |
diff --git a/arch/x86/include/asm/seccomp_64.h b/arch/x86/include/asm/seccomp_64.h index 4171bb794e9e..84ec1bd161a5 100644 --- a/arch/x86/include/asm/seccomp_64.h +++ b/arch/x86/include/asm/seccomp_64.h | |||
@@ -1,14 +1,6 @@ | |||
1 | #ifndef _ASM_X86_SECCOMP_64_H | 1 | #ifndef _ASM_X86_SECCOMP_64_H |
2 | #define _ASM_X86_SECCOMP_64_H | 2 | #define _ASM_X86_SECCOMP_64_H |
3 | 3 | ||
4 | #include <linux/thread_info.h> | ||
5 | |||
6 | #ifdef TIF_32BIT | ||
7 | #error "unexpected TIF_32BIT on x86_64" | ||
8 | #else | ||
9 | #define TIF_32BIT TIF_IA32 | ||
10 | #endif | ||
11 | |||
12 | #include <linux/unistd.h> | 4 | #include <linux/unistd.h> |
13 | #include <asm/ia32_unistd.h> | 5 | #include <asm/ia32_unistd.h> |
14 | 6 | ||
diff --git a/arch/x86/kernel/ptrace.c b/arch/x86/kernel/ptrace.c index 5a4c23d89892..06ca07f6ad86 100644 --- a/arch/x86/kernel/ptrace.c +++ b/arch/x86/kernel/ptrace.c | |||
@@ -1388,7 +1388,7 @@ void send_sigtrap(struct task_struct *tsk, struct pt_regs *regs, | |||
1388 | #ifdef CONFIG_X86_32 | 1388 | #ifdef CONFIG_X86_32 |
1389 | # define IS_IA32 1 | 1389 | # define IS_IA32 1 |
1390 | #elif defined CONFIG_IA32_EMULATION | 1390 | #elif defined CONFIG_IA32_EMULATION |
1391 | # define IS_IA32 test_thread_flag(TIF_IA32) | 1391 | # define IS_IA32 is_compat_task() |
1392 | #else | 1392 | #else |
1393 | # define IS_IA32 0 | 1393 | # define IS_IA32 0 |
1394 | #endif | 1394 | #endif |
diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index e6d36b490250..b1352250096e 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c | |||
@@ -714,6 +714,8 @@ unsigned long __init_refok init_memory_mapping(unsigned long start, | |||
714 | pos = start_pfn << PAGE_SHIFT; | 714 | pos = start_pfn << PAGE_SHIFT; |
715 | end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT) | 715 | end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT) |
716 | << (PMD_SHIFT - PAGE_SHIFT); | 716 | << (PMD_SHIFT - PAGE_SHIFT); |
717 | if (end_pfn > (end >> PAGE_SHIFT)) | ||
718 | end_pfn = end >> PAGE_SHIFT; | ||
717 | if (start_pfn < end_pfn) { | 719 | if (start_pfn < end_pfn) { |
718 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); | 720 | nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); |
719 | pos = end_pfn << PAGE_SHIFT; | 721 | pos = end_pfn << PAGE_SHIFT; |
diff --git a/arch/x86/mm/iomap_32.c b/arch/x86/mm/iomap_32.c index 6c2b1af16926..04102d42ff42 100644 --- a/arch/x86/mm/iomap_32.c +++ b/arch/x86/mm/iomap_32.c | |||
@@ -20,23 +20,16 @@ | |||
20 | #include <asm/pat.h> | 20 | #include <asm/pat.h> |
21 | #include <linux/module.h> | 21 | #include <linux/module.h> |
22 | 22 | ||
23 | #ifdef CONFIG_X86_PAE | 23 | int is_io_mapping_possible(resource_size_t base, unsigned long size) |
24 | int | ||
25 | is_io_mapping_possible(resource_size_t base, unsigned long size) | ||
26 | { | ||
27 | return 1; | ||
28 | } | ||
29 | #else | ||
30 | int | ||
31 | is_io_mapping_possible(resource_size_t base, unsigned long size) | ||
32 | { | 24 | { |
25 | #ifndef CONFIG_X86_PAE | ||
33 | /* There is no way to map greater than 1 << 32 address without PAE */ | 26 | /* There is no way to map greater than 1 << 32 address without PAE */ |
34 | if (base + size > 0x100000000ULL) | 27 | if (base + size > 0x100000000ULL) |
35 | return 0; | 28 | return 0; |
36 | 29 | #endif | |
37 | return 1; | 30 | return 1; |
38 | } | 31 | } |
39 | #endif | 32 | EXPORT_SYMBOL_GPL(is_io_mapping_possible); |
40 | 33 | ||
41 | /* Map 'pfn' using fixed map 'type' and protections 'prot' | 34 | /* Map 'pfn' using fixed map 'type' and protections 'prot' |
42 | */ | 35 | */ |
diff --git a/arch/x86/mm/kmmio.c b/arch/x86/mm/kmmio.c index 93d82038af4b..9f205030d9aa 100644 --- a/arch/x86/mm/kmmio.c +++ b/arch/x86/mm/kmmio.c | |||
@@ -32,11 +32,14 @@ struct kmmio_fault_page { | |||
32 | struct list_head list; | 32 | struct list_head list; |
33 | struct kmmio_fault_page *release_next; | 33 | struct kmmio_fault_page *release_next; |
34 | unsigned long page; /* location of the fault page */ | 34 | unsigned long page; /* location of the fault page */ |
35 | bool old_presence; /* page presence prior to arming */ | ||
36 | bool armed; | ||
35 | 37 | ||
36 | /* | 38 | /* |
37 | * Number of times this page has been registered as a part | 39 | * Number of times this page has been registered as a part |
38 | * of a probe. If zero, page is disarmed and this may be freed. | 40 | * of a probe. If zero, page is disarmed and this may be freed. |
39 | * Used only by writers (RCU). | 41 | * Used only by writers (RCU) and post_kmmio_handler(). |
42 | * Protected by kmmio_lock, when linked into kmmio_page_table. | ||
40 | */ | 43 | */ |
41 | int count; | 44 | int count; |
42 | }; | 45 | }; |
@@ -105,57 +108,85 @@ static struct kmmio_fault_page *get_kmmio_fault_page(unsigned long page) | |||
105 | return NULL; | 108 | return NULL; |
106 | } | 109 | } |
107 | 110 | ||
108 | static void set_page_present(unsigned long addr, bool present, | 111 | static void set_pmd_presence(pmd_t *pmd, bool present, bool *old) |
109 | unsigned int *pglevel) | 112 | { |
113 | pmdval_t v = pmd_val(*pmd); | ||
114 | *old = !!(v & _PAGE_PRESENT); | ||
115 | v &= ~_PAGE_PRESENT; | ||
116 | if (present) | ||
117 | v |= _PAGE_PRESENT; | ||
118 | set_pmd(pmd, __pmd(v)); | ||
119 | } | ||
120 | |||
121 | static void set_pte_presence(pte_t *pte, bool present, bool *old) | ||
122 | { | ||
123 | pteval_t v = pte_val(*pte); | ||
124 | *old = !!(v & _PAGE_PRESENT); | ||
125 | v &= ~_PAGE_PRESENT; | ||
126 | if (present) | ||
127 | v |= _PAGE_PRESENT; | ||
128 | set_pte_atomic(pte, __pte(v)); | ||
129 | } | ||
130 | |||
131 | static int set_page_presence(unsigned long addr, bool present, bool *old) | ||
110 | { | 132 | { |
111 | pteval_t pteval; | ||
112 | pmdval_t pmdval; | ||
113 | unsigned int level; | 133 | unsigned int level; |
114 | pmd_t *pmd; | ||
115 | pte_t *pte = lookup_address(addr, &level); | 134 | pte_t *pte = lookup_address(addr, &level); |
116 | 135 | ||
117 | if (!pte) { | 136 | if (!pte) { |
118 | pr_err("kmmio: no pte for page 0x%08lx\n", addr); | 137 | pr_err("kmmio: no pte for page 0x%08lx\n", addr); |
119 | return; | 138 | return -1; |
120 | } | 139 | } |
121 | 140 | ||
122 | if (pglevel) | ||
123 | *pglevel = level; | ||
124 | |||
125 | switch (level) { | 141 | switch (level) { |
126 | case PG_LEVEL_2M: | 142 | case PG_LEVEL_2M: |
127 | pmd = (pmd_t *)pte; | 143 | set_pmd_presence((pmd_t *)pte, present, old); |
128 | pmdval = pmd_val(*pmd) & ~_PAGE_PRESENT; | ||
129 | if (present) | ||
130 | pmdval |= _PAGE_PRESENT; | ||
131 | set_pmd(pmd, __pmd(pmdval)); | ||
132 | break; | 144 | break; |
133 | |||
134 | case PG_LEVEL_4K: | 145 | case PG_LEVEL_4K: |
135 | pteval = pte_val(*pte) & ~_PAGE_PRESENT; | 146 | set_pte_presence(pte, present, old); |
136 | if (present) | ||
137 | pteval |= _PAGE_PRESENT; | ||
138 | set_pte_atomic(pte, __pte(pteval)); | ||
139 | break; | 147 | break; |
140 | |||
141 | default: | 148 | default: |
142 | pr_err("kmmio: unexpected page level 0x%x.\n", level); | 149 | pr_err("kmmio: unexpected page level 0x%x.\n", level); |
143 | return; | 150 | return -1; |
144 | } | 151 | } |
145 | 152 | ||
146 | __flush_tlb_one(addr); | 153 | __flush_tlb_one(addr); |
154 | return 0; | ||
147 | } | 155 | } |
148 | 156 | ||
149 | /** Mark the given page as not present. Access to it will trigger a fault. */ | 157 | /* |
150 | static void arm_kmmio_fault_page(unsigned long page, unsigned int *pglevel) | 158 | * Mark the given page as not present. Access to it will trigger a fault. |
159 | * | ||
160 | * Struct kmmio_fault_page is protected by RCU and kmmio_lock, but the | ||
161 | * protection is ignored here. RCU read lock is assumed held, so the struct | ||
162 | * will not disappear unexpectedly. Furthermore, the caller must guarantee, | ||
163 | * that double arming the same virtual address (page) cannot occur. | ||
164 | * | ||
165 | * Double disarming on the other hand is allowed, and may occur when a fault | ||
166 | * and mmiotrace shutdown happen simultaneously. | ||
167 | */ | ||
168 | static int arm_kmmio_fault_page(struct kmmio_fault_page *f) | ||
151 | { | 169 | { |
152 | set_page_present(page & PAGE_MASK, false, pglevel); | 170 | int ret; |
171 | WARN_ONCE(f->armed, KERN_ERR "kmmio page already armed.\n"); | ||
172 | if (f->armed) { | ||
173 | pr_warning("kmmio double-arm: page 0x%08lx, ref %d, old %d\n", | ||
174 | f->page, f->count, f->old_presence); | ||
175 | } | ||
176 | ret = set_page_presence(f->page, false, &f->old_presence); | ||
177 | WARN_ONCE(ret < 0, KERN_ERR "kmmio arming 0x%08lx failed.\n", f->page); | ||
178 | f->armed = true; | ||
179 | return ret; | ||
153 | } | 180 | } |
154 | 181 | ||
155 | /** Mark the given page as present. */ | 182 | /** Restore the given page to saved presence state. */ |
156 | static void disarm_kmmio_fault_page(unsigned long page, unsigned int *pglevel) | 183 | static void disarm_kmmio_fault_page(struct kmmio_fault_page *f) |
157 | { | 184 | { |
158 | set_page_present(page & PAGE_MASK, true, pglevel); | 185 | bool tmp; |
186 | int ret = set_page_presence(f->page, f->old_presence, &tmp); | ||
187 | WARN_ONCE(ret < 0, | ||
188 | KERN_ERR "kmmio disarming 0x%08lx failed.\n", f->page); | ||
189 | f->armed = false; | ||
159 | } | 190 | } |
160 | 191 | ||
161 | /* | 192 | /* |
@@ -202,28 +233,32 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) | |||
202 | 233 | ||
203 | ctx = &get_cpu_var(kmmio_ctx); | 234 | ctx = &get_cpu_var(kmmio_ctx); |
204 | if (ctx->active) { | 235 | if (ctx->active) { |
205 | disarm_kmmio_fault_page(faultpage->page, NULL); | ||
206 | if (addr == ctx->addr) { | 236 | if (addr == ctx->addr) { |
207 | /* | 237 | /* |
208 | * On SMP we sometimes get recursive probe hits on the | 238 | * A second fault on the same page means some other |
209 | * same address. Context is already saved, fall out. | 239 | * condition needs handling by do_page_fault(), the |
240 | * page really not being present is the most common. | ||
210 | */ | 241 | */ |
211 | pr_debug("kmmio: duplicate probe hit on CPU %d, for " | 242 | pr_debug("kmmio: secondary hit for 0x%08lx CPU %d.\n", |
212 | "address 0x%08lx.\n", | 243 | addr, smp_processor_id()); |
213 | smp_processor_id(), addr); | 244 | |
214 | ret = 1; | 245 | if (!faultpage->old_presence) |
215 | goto no_kmmio_ctx; | 246 | pr_info("kmmio: unexpected secondary hit for " |
216 | } | 247 | "address 0x%08lx on CPU %d.\n", addr, |
217 | /* | 248 | smp_processor_id()); |
218 | * Prevent overwriting already in-flight context. | 249 | } else { |
219 | * This should not happen, let's hope disarming at least | 250 | /* |
220 | * prevents a panic. | 251 | * Prevent overwriting already in-flight context. |
221 | */ | 252 | * This should not happen, let's hope disarming at |
222 | pr_emerg("kmmio: recursive probe hit on CPU %d, " | 253 | * least prevents a panic. |
254 | */ | ||
255 | pr_emerg("kmmio: recursive probe hit on CPU %d, " | ||
223 | "for address 0x%08lx. Ignoring.\n", | 256 | "for address 0x%08lx. Ignoring.\n", |
224 | smp_processor_id(), addr); | 257 | smp_processor_id(), addr); |
225 | pr_emerg("kmmio: previous hit was at 0x%08lx.\n", | 258 | pr_emerg("kmmio: previous hit was at 0x%08lx.\n", |
226 | ctx->addr); | 259 | ctx->addr); |
260 | disarm_kmmio_fault_page(faultpage); | ||
261 | } | ||
227 | goto no_kmmio_ctx; | 262 | goto no_kmmio_ctx; |
228 | } | 263 | } |
229 | ctx->active++; | 264 | ctx->active++; |
@@ -244,7 +279,7 @@ int kmmio_handler(struct pt_regs *regs, unsigned long addr) | |||
244 | regs->flags &= ~X86_EFLAGS_IF; | 279 | regs->flags &= ~X86_EFLAGS_IF; |
245 | 280 | ||
246 | /* Now we set present bit in PTE and single step. */ | 281 | /* Now we set present bit in PTE and single step. */ |
247 | disarm_kmmio_fault_page(ctx->fpage->page, NULL); | 282 | disarm_kmmio_fault_page(ctx->fpage); |
248 | 283 | ||
249 | /* | 284 | /* |
250 | * If another cpu accesses the same page while we are stepping, | 285 | * If another cpu accesses the same page while we are stepping, |
@@ -275,7 +310,7 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs) | |||
275 | struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); | 310 | struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); |
276 | 311 | ||
277 | if (!ctx->active) { | 312 | if (!ctx->active) { |
278 | pr_debug("kmmio: spurious debug trap on CPU %d.\n", | 313 | pr_warning("kmmio: spurious debug trap on CPU %d.\n", |
279 | smp_processor_id()); | 314 | smp_processor_id()); |
280 | goto out; | 315 | goto out; |
281 | } | 316 | } |
@@ -283,7 +318,11 @@ static int post_kmmio_handler(unsigned long condition, struct pt_regs *regs) | |||
283 | if (ctx->probe && ctx->probe->post_handler) | 318 | if (ctx->probe && ctx->probe->post_handler) |
284 | ctx->probe->post_handler(ctx->probe, condition, regs); | 319 | ctx->probe->post_handler(ctx->probe, condition, regs); |
285 | 320 | ||
286 | arm_kmmio_fault_page(ctx->fpage->page, NULL); | 321 | /* Prevent racing against release_kmmio_fault_page(). */ |
322 | spin_lock(&kmmio_lock); | ||
323 | if (ctx->fpage->count) | ||
324 | arm_kmmio_fault_page(ctx->fpage); | ||
325 | spin_unlock(&kmmio_lock); | ||
287 | 326 | ||
288 | regs->flags &= ~X86_EFLAGS_TF; | 327 | regs->flags &= ~X86_EFLAGS_TF; |
289 | regs->flags |= ctx->saved_flags; | 328 | regs->flags |= ctx->saved_flags; |
@@ -315,20 +354,24 @@ static int add_kmmio_fault_page(unsigned long page) | |||
315 | f = get_kmmio_fault_page(page); | 354 | f = get_kmmio_fault_page(page); |
316 | if (f) { | 355 | if (f) { |
317 | if (!f->count) | 356 | if (!f->count) |
318 | arm_kmmio_fault_page(f->page, NULL); | 357 | arm_kmmio_fault_page(f); |
319 | f->count++; | 358 | f->count++; |
320 | return 0; | 359 | return 0; |
321 | } | 360 | } |
322 | 361 | ||
323 | f = kmalloc(sizeof(*f), GFP_ATOMIC); | 362 | f = kzalloc(sizeof(*f), GFP_ATOMIC); |
324 | if (!f) | 363 | if (!f) |
325 | return -1; | 364 | return -1; |
326 | 365 | ||
327 | f->count = 1; | 366 | f->count = 1; |
328 | f->page = page; | 367 | f->page = page; |
329 | list_add_rcu(&f->list, kmmio_page_list(f->page)); | ||
330 | 368 | ||
331 | arm_kmmio_fault_page(f->page, NULL); | 369 | if (arm_kmmio_fault_page(f)) { |
370 | kfree(f); | ||
371 | return -1; | ||
372 | } | ||
373 | |||
374 | list_add_rcu(&f->list, kmmio_page_list(f->page)); | ||
332 | 375 | ||
333 | return 0; | 376 | return 0; |
334 | } | 377 | } |
@@ -347,7 +390,7 @@ static void release_kmmio_fault_page(unsigned long page, | |||
347 | f->count--; | 390 | f->count--; |
348 | BUG_ON(f->count < 0); | 391 | BUG_ON(f->count < 0); |
349 | if (!f->count) { | 392 | if (!f->count) { |
350 | disarm_kmmio_fault_page(f->page, NULL); | 393 | disarm_kmmio_fault_page(f); |
351 | f->release_next = *release_list; | 394 | f->release_next = *release_list; |
352 | *release_list = f; | 395 | *release_list = f; |
353 | } | 396 | } |
diff --git a/arch/x86/mm/pat.c b/arch/x86/mm/pat.c index aebbf67a79d0..e0ab173b6974 100644 --- a/arch/x86/mm/pat.c +++ b/arch/x86/mm/pat.c | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/bootmem.h> | 11 | #include <linux/bootmem.h> |
12 | #include <linux/debugfs.h> | 12 | #include <linux/debugfs.h> |
13 | #include <linux/kernel.h> | 13 | #include <linux/kernel.h> |
14 | #include <linux/module.h> | ||
14 | #include <linux/gfp.h> | 15 | #include <linux/gfp.h> |
15 | #include <linux/mm.h> | 16 | #include <linux/mm.h> |
16 | #include <linux/fs.h> | 17 | #include <linux/fs.h> |
@@ -868,6 +869,7 @@ pgprot_t pgprot_writecombine(pgprot_t prot) | |||
868 | else | 869 | else |
869 | return pgprot_noncached(prot); | 870 | return pgprot_noncached(prot); |
870 | } | 871 | } |
872 | EXPORT_SYMBOL_GPL(pgprot_writecombine); | ||
871 | 873 | ||
872 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) | 874 | #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) |
873 | 875 | ||
diff --git a/arch/x86/mm/testmmiotrace.c b/arch/x86/mm/testmmiotrace.c index ab50a8d7402c..427fd1b56df5 100644 --- a/arch/x86/mm/testmmiotrace.c +++ b/arch/x86/mm/testmmiotrace.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Written by Pekka Paalanen, 2008 <pq@iki.fi> | 2 | * Written by Pekka Paalanen, 2008-2009 <pq@iki.fi> |
3 | */ | 3 | */ |
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/io.h> | 5 | #include <linux/io.h> |
@@ -9,35 +9,74 @@ | |||
9 | 9 | ||
10 | static unsigned long mmio_address; | 10 | static unsigned long mmio_address; |
11 | module_param(mmio_address, ulong, 0); | 11 | module_param(mmio_address, ulong, 0); |
12 | MODULE_PARM_DESC(mmio_address, "Start address of the mapping of 16 kB."); | 12 | MODULE_PARM_DESC(mmio_address, " Start address of the mapping of 16 kB " |
13 | "(or 8 MB if read_far is non-zero)."); | ||
14 | |||
15 | static unsigned long read_far = 0x400100; | ||
16 | module_param(read_far, ulong, 0); | ||
17 | MODULE_PARM_DESC(read_far, " Offset of a 32-bit read within 8 MB " | ||
18 | "(default: 0x400100)."); | ||
19 | |||
20 | static unsigned v16(unsigned i) | ||
21 | { | ||
22 | return i * 12 + 7; | ||
23 | } | ||
24 | |||
25 | static unsigned v32(unsigned i) | ||
26 | { | ||
27 | return i * 212371 + 13; | ||
28 | } | ||
13 | 29 | ||
14 | static void do_write_test(void __iomem *p) | 30 | static void do_write_test(void __iomem *p) |
15 | { | 31 | { |
16 | unsigned int i; | 32 | unsigned int i; |
33 | pr_info(MODULE_NAME ": write test.\n"); | ||
17 | mmiotrace_printk("Write test.\n"); | 34 | mmiotrace_printk("Write test.\n"); |
35 | |||
18 | for (i = 0; i < 256; i++) | 36 | for (i = 0; i < 256; i++) |
19 | iowrite8(i, p + i); | 37 | iowrite8(i, p + i); |
38 | |||
20 | for (i = 1024; i < (5 * 1024); i += 2) | 39 | for (i = 1024; i < (5 * 1024); i += 2) |
21 | iowrite16(i * 12 + 7, p + i); | 40 | iowrite16(v16(i), p + i); |
41 | |||
22 | for (i = (5 * 1024); i < (16 * 1024); i += 4) | 42 | for (i = (5 * 1024); i < (16 * 1024); i += 4) |
23 | iowrite32(i * 212371 + 13, p + i); | 43 | iowrite32(v32(i), p + i); |
24 | } | 44 | } |
25 | 45 | ||
26 | static void do_read_test(void __iomem *p) | 46 | static void do_read_test(void __iomem *p) |
27 | { | 47 | { |
28 | unsigned int i; | 48 | unsigned int i; |
49 | unsigned errs[3] = { 0 }; | ||
50 | pr_info(MODULE_NAME ": read test.\n"); | ||
29 | mmiotrace_printk("Read test.\n"); | 51 | mmiotrace_printk("Read test.\n"); |
52 | |||
30 | for (i = 0; i < 256; i++) | 53 | for (i = 0; i < 256; i++) |
31 | ioread8(p + i); | 54 | if (ioread8(p + i) != i) |
55 | ++errs[0]; | ||
56 | |||
32 | for (i = 1024; i < (5 * 1024); i += 2) | 57 | for (i = 1024; i < (5 * 1024); i += 2) |
33 | ioread16(p + i); | 58 | if (ioread16(p + i) != v16(i)) |
59 | ++errs[1]; | ||
60 | |||
34 | for (i = (5 * 1024); i < (16 * 1024); i += 4) | 61 | for (i = (5 * 1024); i < (16 * 1024); i += 4) |
35 | ioread32(p + i); | 62 | if (ioread32(p + i) != v32(i)) |
63 | ++errs[2]; | ||
64 | |||
65 | mmiotrace_printk("Read errors: 8-bit %d, 16-bit %d, 32-bit %d.\n", | ||
66 | errs[0], errs[1], errs[2]); | ||
36 | } | 67 | } |
37 | 68 | ||
38 | static void do_test(void) | 69 | static void do_read_far_test(void __iomem *p) |
39 | { | 70 | { |
40 | void __iomem *p = ioremap_nocache(mmio_address, 0x4000); | 71 | pr_info(MODULE_NAME ": read far test.\n"); |
72 | mmiotrace_printk("Read far test.\n"); | ||
73 | |||
74 | ioread32(p + read_far); | ||
75 | } | ||
76 | |||
77 | static void do_test(unsigned long size) | ||
78 | { | ||
79 | void __iomem *p = ioremap_nocache(mmio_address, size); | ||
41 | if (!p) { | 80 | if (!p) { |
42 | pr_err(MODULE_NAME ": could not ioremap, aborting.\n"); | 81 | pr_err(MODULE_NAME ": could not ioremap, aborting.\n"); |
43 | return; | 82 | return; |
@@ -45,11 +84,15 @@ static void do_test(void) | |||
45 | mmiotrace_printk("ioremap returned %p.\n", p); | 84 | mmiotrace_printk("ioremap returned %p.\n", p); |
46 | do_write_test(p); | 85 | do_write_test(p); |
47 | do_read_test(p); | 86 | do_read_test(p); |
87 | if (read_far && read_far < size - 4) | ||
88 | do_read_far_test(p); | ||
48 | iounmap(p); | 89 | iounmap(p); |
49 | } | 90 | } |
50 | 91 | ||
51 | static int __init init(void) | 92 | static int __init init(void) |
52 | { | 93 | { |
94 | unsigned long size = (read_far) ? (8 << 20) : (16 << 10); | ||
95 | |||
53 | if (mmio_address == 0) { | 96 | if (mmio_address == 0) { |
54 | pr_err(MODULE_NAME ": you have to use the module argument " | 97 | pr_err(MODULE_NAME ": you have to use the module argument " |
55 | "mmio_address.\n"); | 98 | "mmio_address.\n"); |
@@ -58,10 +101,11 @@ static int __init init(void) | |||
58 | return -ENXIO; | 101 | return -ENXIO; |
59 | } | 102 | } |
60 | 103 | ||
61 | pr_warning(MODULE_NAME ": WARNING: mapping 16 kB @ 0x%08lx " | 104 | pr_warning(MODULE_NAME ": WARNING: mapping %lu kB @ 0x%08lx in PCI " |
62 | "in PCI address space, and writing " | 105 | "address space, and writing 16 kB of rubbish in there.\n", |
63 | "rubbish in there.\n", mmio_address); | 106 | size >> 10, mmio_address); |
64 | do_test(); | 107 | do_test(size); |
108 | pr_info(MODULE_NAME ": All done.\n"); | ||
65 | return 0; | 109 | return 0; |
66 | } | 110 | } |
67 | 111 | ||
diff --git a/arch/x86/oprofile/op_model_ppro.c b/arch/x86/oprofile/op_model_ppro.c index e9f80c744cf3..10131fbdaada 100644 --- a/arch/x86/oprofile/op_model_ppro.c +++ b/arch/x86/oprofile/op_model_ppro.c | |||
@@ -78,8 +78,18 @@ static void ppro_setup_ctrs(struct op_msrs const * const msrs) | |||
78 | if (cpu_has_arch_perfmon) { | 78 | if (cpu_has_arch_perfmon) { |
79 | union cpuid10_eax eax; | 79 | union cpuid10_eax eax; |
80 | eax.full = cpuid_eax(0xa); | 80 | eax.full = cpuid_eax(0xa); |
81 | if (counter_width < eax.split.bit_width) | 81 | |
82 | counter_width = eax.split.bit_width; | 82 | /* |
83 | * For Core2 (family 6, model 15), don't reset the | ||
84 | * counter width: | ||
85 | */ | ||
86 | if (!(eax.split.version_id == 0 && | ||
87 | current_cpu_data.x86 == 6 && | ||
88 | current_cpu_data.x86_model == 15)) { | ||
89 | |||
90 | if (counter_width < eax.split.bit_width) | ||
91 | counter_width = eax.split.bit_width; | ||
92 | } | ||
83 | } | 93 | } |
84 | 94 | ||
85 | /* clear all counters */ | 95 | /* clear all counters */ |
diff --git a/crypto/api.c b/crypto/api.c index efe77df6863f..38a2bc02a98c 100644 --- a/crypto/api.c +++ b/crypto/api.c | |||
@@ -215,8 +215,19 @@ struct crypto_alg *crypto_larval_lookup(const char *name, u32 type, u32 mask) | |||
215 | mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD); | 215 | mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD); |
216 | type &= mask; | 216 | type &= mask; |
217 | 217 | ||
218 | alg = try_then_request_module(crypto_alg_lookup(name, type, mask), | 218 | alg = crypto_alg_lookup(name, type, mask); |
219 | name); | 219 | if (!alg) { |
220 | char tmp[CRYPTO_MAX_ALG_NAME]; | ||
221 | |||
222 | request_module(name); | ||
223 | |||
224 | if (!((type ^ CRYPTO_ALG_NEED_FALLBACK) & mask) && | ||
225 | snprintf(tmp, sizeof(tmp), "%s-all", name) < sizeof(tmp)) | ||
226 | request_module(tmp); | ||
227 | |||
228 | alg = crypto_alg_lookup(name, type, mask); | ||
229 | } | ||
230 | |||
220 | if (alg) | 231 | if (alg) |
221 | return crypto_is_larval(alg) ? crypto_larval_wait(alg) : alg; | 232 | return crypto_is_larval(alg) ? crypto_larval_wait(alg) : alg; |
222 | 233 | ||
diff --git a/drivers/block/aoe/aoedev.c b/drivers/block/aoe/aoedev.c index cc250577d405..eeea477d9601 100644 --- a/drivers/block/aoe/aoedev.c +++ b/drivers/block/aoe/aoedev.c | |||
@@ -173,7 +173,7 @@ skbfree(struct sk_buff *skb) | |||
173 | return; | 173 | return; |
174 | while (atomic_read(&skb_shinfo(skb)->dataref) != 1 && i-- > 0) | 174 | while (atomic_read(&skb_shinfo(skb)->dataref) != 1 && i-- > 0) |
175 | msleep(Sms); | 175 | msleep(Sms); |
176 | if (i <= 0) { | 176 | if (i < 0) { |
177 | printk(KERN_ERR | 177 | printk(KERN_ERR |
178 | "aoe: %s holds ref: %s\n", | 178 | "aoe: %s holds ref: %s\n", |
179 | skb->dev ? skb->dev->name : "netif", | 179 | skb->dev ? skb->dev->name : "netif", |
diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 2d637e0fbc03..d9e751be8c5f 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/crypto/ixp4xx_crypto.c | |||
@@ -457,10 +457,12 @@ static int init_ixp_crypto(void) | |||
457 | if (!ctx_pool) { | 457 | if (!ctx_pool) { |
458 | goto err; | 458 | goto err; |
459 | } | 459 | } |
460 | ret = qmgr_request_queue(SEND_QID, NPE_QLEN_TOTAL, 0, 0); | 460 | ret = qmgr_request_queue(SEND_QID, NPE_QLEN_TOTAL, 0, 0, |
461 | "ixp_crypto:out", NULL); | ||
461 | if (ret) | 462 | if (ret) |
462 | goto err; | 463 | goto err; |
463 | ret = qmgr_request_queue(RECV_QID, NPE_QLEN, 0, 0); | 464 | ret = qmgr_request_queue(RECV_QID, NPE_QLEN, 0, 0, |
465 | "ixp_crypto:in", NULL); | ||
464 | if (ret) { | 466 | if (ret) { |
465 | qmgr_release_queue(SEND_QID); | 467 | qmgr_release_queue(SEND_QID); |
466 | goto err; | 468 | goto err; |
diff --git a/drivers/crypto/padlock-aes.c b/drivers/crypto/padlock-aes.c index 856b3cc25583..3f0fdd18255d 100644 --- a/drivers/crypto/padlock-aes.c +++ b/drivers/crypto/padlock-aes.c | |||
@@ -489,4 +489,4 @@ MODULE_DESCRIPTION("VIA PadLock AES algorithm support"); | |||
489 | MODULE_LICENSE("GPL"); | 489 | MODULE_LICENSE("GPL"); |
490 | MODULE_AUTHOR("Michal Ludvig"); | 490 | MODULE_AUTHOR("Michal Ludvig"); |
491 | 491 | ||
492 | MODULE_ALIAS("aes"); | 492 | MODULE_ALIAS("aes-all"); |
diff --git a/drivers/crypto/padlock-sha.c b/drivers/crypto/padlock-sha.c index a7fbadebf623..a2c8e8514b63 100644 --- a/drivers/crypto/padlock-sha.c +++ b/drivers/crypto/padlock-sha.c | |||
@@ -304,7 +304,7 @@ MODULE_DESCRIPTION("VIA PadLock SHA1/SHA256 algorithms support."); | |||
304 | MODULE_LICENSE("GPL"); | 304 | MODULE_LICENSE("GPL"); |
305 | MODULE_AUTHOR("Michal Ludvig"); | 305 | MODULE_AUTHOR("Michal Ludvig"); |
306 | 306 | ||
307 | MODULE_ALIAS("sha1"); | 307 | MODULE_ALIAS("sha1-all"); |
308 | MODULE_ALIAS("sha256"); | 308 | MODULE_ALIAS("sha256-all"); |
309 | MODULE_ALIAS("sha1-padlock"); | 309 | MODULE_ALIAS("sha1-padlock"); |
310 | MODULE_ALIAS("sha256-padlock"); | 310 | MODULE_ALIAS("sha256-padlock"); |
diff --git a/drivers/dma/iop-adma.c b/drivers/dma/iop-adma.c index ea5440dd10dc..647374acba94 100644 --- a/drivers/dma/iop-adma.c +++ b/drivers/dma/iop-adma.c | |||
@@ -1401,7 +1401,7 @@ MODULE_ALIAS("platform:iop-adma"); | |||
1401 | 1401 | ||
1402 | static struct platform_driver iop_adma_driver = { | 1402 | static struct platform_driver iop_adma_driver = { |
1403 | .probe = iop_adma_probe, | 1403 | .probe = iop_adma_probe, |
1404 | .remove = iop_adma_remove, | 1404 | .remove = __devexit_p(iop_adma_remove), |
1405 | .driver = { | 1405 | .driver = { |
1406 | .owner = THIS_MODULE, | 1406 | .owner = THIS_MODULE, |
1407 | .name = "iop-adma", | 1407 | .name = "iop-adma", |
diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c index d35cbd1ff0b3..5d5d5b31867f 100644 --- a/drivers/dma/mv_xor.c +++ b/drivers/dma/mv_xor.c | |||
@@ -1287,7 +1287,7 @@ mv_xor_conf_mbus_windows(struct mv_xor_shared_private *msp, | |||
1287 | 1287 | ||
1288 | static struct platform_driver mv_xor_driver = { | 1288 | static struct platform_driver mv_xor_driver = { |
1289 | .probe = mv_xor_probe, | 1289 | .probe = mv_xor_probe, |
1290 | .remove = mv_xor_remove, | 1290 | .remove = __devexit_p(mv_xor_remove), |
1291 | .driver = { | 1291 | .driver = { |
1292 | .owner = THIS_MODULE, | 1292 | .owner = THIS_MODULE, |
1293 | .name = MV_XOR_NAME, | 1293 | .name = MV_XOR_NAME, |
diff --git a/drivers/gpu/drm/drm_bufs.c b/drivers/gpu/drm/drm_bufs.c index 72c667f9bee1..12715d3c078d 100644 --- a/drivers/gpu/drm/drm_bufs.c +++ b/drivers/gpu/drm/drm_bufs.c | |||
@@ -420,7 +420,7 @@ int drm_rmmap_locked(struct drm_device *dev, drm_local_map_t *map) | |||
420 | dev->sigdata.lock = NULL; | 420 | dev->sigdata.lock = NULL; |
421 | master->lock.hw_lock = NULL; /* SHM removed */ | 421 | master->lock.hw_lock = NULL; /* SHM removed */ |
422 | master->lock.file_priv = NULL; | 422 | master->lock.file_priv = NULL; |
423 | wake_up_interruptible(&master->lock.lock_queue); | 423 | wake_up_interruptible_all(&master->lock.lock_queue); |
424 | } | 424 | } |
425 | break; | 425 | break; |
426 | case _DRM_AGP: | 426 | case _DRM_AGP: |
diff --git a/drivers/gpu/drm/drm_fops.c b/drivers/gpu/drm/drm_fops.c index 6c020fe5431c..f52663ebe016 100644 --- a/drivers/gpu/drm/drm_fops.c +++ b/drivers/gpu/drm/drm_fops.c | |||
@@ -484,6 +484,7 @@ int drm_release(struct inode *inode, struct file *filp) | |||
484 | mutex_lock(&dev->struct_mutex); | 484 | mutex_lock(&dev->struct_mutex); |
485 | 485 | ||
486 | if (file_priv->is_master) { | 486 | if (file_priv->is_master) { |
487 | struct drm_master *master = file_priv->master; | ||
487 | struct drm_file *temp; | 488 | struct drm_file *temp; |
488 | list_for_each_entry(temp, &dev->filelist, lhead) { | 489 | list_for_each_entry(temp, &dev->filelist, lhead) { |
489 | if ((temp->master == file_priv->master) && | 490 | if ((temp->master == file_priv->master) && |
@@ -491,6 +492,19 @@ int drm_release(struct inode *inode, struct file *filp) | |||
491 | temp->authenticated = 0; | 492 | temp->authenticated = 0; |
492 | } | 493 | } |
493 | 494 | ||
495 | /** | ||
496 | * Since the master is disappearing, so is the | ||
497 | * possibility to lock. | ||
498 | */ | ||
499 | |||
500 | if (master->lock.hw_lock) { | ||
501 | if (dev->sigdata.lock == master->lock.hw_lock) | ||
502 | dev->sigdata.lock = NULL; | ||
503 | master->lock.hw_lock = NULL; | ||
504 | master->lock.file_priv = NULL; | ||
505 | wake_up_interruptible_all(&master->lock.lock_queue); | ||
506 | } | ||
507 | |||
494 | if (file_priv->minor->master == file_priv->master) { | 508 | if (file_priv->minor->master == file_priv->master) { |
495 | /* drop the reference held my the minor */ | 509 | /* drop the reference held my the minor */ |
496 | drm_master_put(&file_priv->minor->master); | 510 | drm_master_put(&file_priv->minor->master); |
diff --git a/drivers/gpu/drm/drm_lock.c b/drivers/gpu/drm/drm_lock.c index 46e7b28f0707..e2f70a516c34 100644 --- a/drivers/gpu/drm/drm_lock.c +++ b/drivers/gpu/drm/drm_lock.c | |||
@@ -80,6 +80,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) | |||
80 | __set_current_state(TASK_INTERRUPTIBLE); | 80 | __set_current_state(TASK_INTERRUPTIBLE); |
81 | if (!master->lock.hw_lock) { | 81 | if (!master->lock.hw_lock) { |
82 | /* Device has been unregistered */ | 82 | /* Device has been unregistered */ |
83 | send_sig(SIGTERM, current, 0); | ||
83 | ret = -EINTR; | 84 | ret = -EINTR; |
84 | break; | 85 | break; |
85 | } | 86 | } |
@@ -93,7 +94,7 @@ int drm_lock(struct drm_device *dev, void *data, struct drm_file *file_priv) | |||
93 | /* Contention */ | 94 | /* Contention */ |
94 | schedule(); | 95 | schedule(); |
95 | if (signal_pending(current)) { | 96 | if (signal_pending(current)) { |
96 | ret = -ERESTARTSYS; | 97 | ret = -EINTR; |
97 | break; | 98 | break; |
98 | } | 99 | } |
99 | } | 100 | } |
diff --git a/drivers/gpu/drm/drm_stub.c b/drivers/gpu/drm/drm_stub.c index 46bb923b097c..7c8b15b22bf2 100644 --- a/drivers/gpu/drm/drm_stub.c +++ b/drivers/gpu/drm/drm_stub.c | |||
@@ -146,14 +146,6 @@ static void drm_master_destroy(struct kref *kref) | |||
146 | 146 | ||
147 | drm_ht_remove(&master->magiclist); | 147 | drm_ht_remove(&master->magiclist); |
148 | 148 | ||
149 | if (master->lock.hw_lock) { | ||
150 | if (dev->sigdata.lock == master->lock.hw_lock) | ||
151 | dev->sigdata.lock = NULL; | ||
152 | master->lock.hw_lock = NULL; | ||
153 | master->lock.file_priv = NULL; | ||
154 | wake_up_interruptible(&master->lock.lock_queue); | ||
155 | } | ||
156 | |||
157 | drm_free(master, sizeof(*master), DRM_MEM_DRIVER); | 149 | drm_free(master, sizeof(*master), DRM_MEM_DRIVER); |
158 | } | 150 | } |
159 | 151 | ||
@@ -176,7 +168,7 @@ int drm_setmaster_ioctl(struct drm_device *dev, void *data, | |||
176 | file_priv->minor->master != file_priv->master) { | 168 | file_priv->minor->master != file_priv->master) { |
177 | mutex_lock(&dev->struct_mutex); | 169 | mutex_lock(&dev->struct_mutex); |
178 | file_priv->minor->master = drm_master_get(file_priv->master); | 170 | file_priv->minor->master = drm_master_get(file_priv->master); |
179 | mutex_lock(&dev->struct_mutex); | 171 | mutex_unlock(&dev->struct_mutex); |
180 | } | 172 | } |
181 | 173 | ||
182 | return 0; | 174 | return 0; |
diff --git a/drivers/gpu/drm/i915/i915_irq.c b/drivers/gpu/drm/i915/i915_irq.c index 548ff2c66431..87b6b603469e 100644 --- a/drivers/gpu/drm/i915/i915_irq.c +++ b/drivers/gpu/drm/i915/i915_irq.c | |||
@@ -383,12 +383,13 @@ int i915_irq_emit(struct drm_device *dev, void *data, | |||
383 | drm_i915_irq_emit_t *emit = data; | 383 | drm_i915_irq_emit_t *emit = data; |
384 | int result; | 384 | int result; |
385 | 385 | ||
386 | RING_LOCK_TEST_WITH_RETURN(dev, file_priv); | ||
387 | |||
388 | if (!dev_priv) { | 386 | if (!dev_priv) { |
389 | DRM_ERROR("called with no initialization\n"); | 387 | DRM_ERROR("called with no initialization\n"); |
390 | return -EINVAL; | 388 | return -EINVAL; |
391 | } | 389 | } |
390 | |||
391 | RING_LOCK_TEST_WITH_RETURN(dev, file_priv); | ||
392 | |||
392 | mutex_lock(&dev->struct_mutex); | 393 | mutex_lock(&dev->struct_mutex); |
393 | result = i915_emit_irq(dev); | 394 | result = i915_emit_irq(dev); |
394 | mutex_unlock(&dev->struct_mutex); | 395 | mutex_unlock(&dev->struct_mutex); |
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index eeda276f8f16..7f186bbcb99d 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
@@ -482,7 +482,7 @@ mv64xxx_i2c_map_regs(struct platform_device *pd, | |||
482 | return 0; | 482 | return 0; |
483 | } | 483 | } |
484 | 484 | ||
485 | static void __devexit | 485 | static void |
486 | mv64xxx_i2c_unmap_regs(struct mv64xxx_i2c_data *drv_data) | 486 | mv64xxx_i2c_unmap_regs(struct mv64xxx_i2c_data *drv_data) |
487 | { | 487 | { |
488 | if (drv_data->reg_base) { | 488 | if (drv_data->reg_base) { |
@@ -577,7 +577,7 @@ mv64xxx_i2c_remove(struct platform_device *dev) | |||
577 | 577 | ||
578 | static struct platform_driver mv64xxx_i2c_driver = { | 578 | static struct platform_driver mv64xxx_i2c_driver = { |
579 | .probe = mv64xxx_i2c_probe, | 579 | .probe = mv64xxx_i2c_probe, |
580 | .remove = mv64xxx_i2c_remove, | 580 | .remove = __devexit_p(mv64xxx_i2c_remove), |
581 | .driver = { | 581 | .driver = { |
582 | .owner = THIS_MODULE, | 582 | .owner = THIS_MODULE, |
583 | .name = MV64XXX_I2C_CTLR_NAME, | 583 | .name = MV64XXX_I2C_CTLR_NAME, |
diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index c3c8b9bc40ae..45470f18d7e9 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c | |||
@@ -839,7 +839,7 @@ static void atkbd_disconnect(struct serio *serio) | |||
839 | */ | 839 | */ |
840 | static void atkbd_dell_laptop_keymap_fixup(struct atkbd *atkbd) | 840 | static void atkbd_dell_laptop_keymap_fixup(struct atkbd *atkbd) |
841 | { | 841 | { |
842 | const unsigned int forced_release_keys[] = { | 842 | static const unsigned int forced_release_keys[] = { |
843 | 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93, | 843 | 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93, |
844 | }; | 844 | }; |
845 | int i; | 845 | int i; |
@@ -856,7 +856,7 @@ static void atkbd_dell_laptop_keymap_fixup(struct atkbd *atkbd) | |||
856 | */ | 856 | */ |
857 | static void atkbd_hp_keymap_fixup(struct atkbd *atkbd) | 857 | static void atkbd_hp_keymap_fixup(struct atkbd *atkbd) |
858 | { | 858 | { |
859 | const unsigned int forced_release_keys[] = { | 859 | static const unsigned int forced_release_keys[] = { |
860 | 0x94, | 860 | 0x94, |
861 | }; | 861 | }; |
862 | int i; | 862 | int i; |
diff --git a/drivers/input/keyboard/bf54x-keys.c b/drivers/input/keyboard/bf54x-keys.c index 19284016e0f4..ee855c5202e8 100644 --- a/drivers/input/keyboard/bf54x-keys.c +++ b/drivers/input/keyboard/bf54x-keys.c | |||
@@ -209,8 +209,8 @@ static int __devinit bfin_kpad_probe(struct platform_device *pdev) | |||
209 | goto out; | 209 | goto out; |
210 | } | 210 | } |
211 | 211 | ||
212 | if (!pdata->debounce_time || !pdata->debounce_time > MAX_MULT || | 212 | if (!pdata->debounce_time || pdata->debounce_time > MAX_MULT || |
213 | !pdata->coldrive_time || !pdata->coldrive_time > MAX_MULT) { | 213 | !pdata->coldrive_time || pdata->coldrive_time > MAX_MULT) { |
214 | printk(KERN_ERR DRV_NAME | 214 | printk(KERN_ERR DRV_NAME |
215 | ": Invalid Debounce/Columdrive Time from pdata\n"); | 215 | ": Invalid Debounce/Columdrive Time from pdata\n"); |
216 | bfin_write_KPAD_MSEL(0xFF0); /* Default MSEL */ | 216 | bfin_write_KPAD_MSEL(0xFF0); /* Default MSEL */ |
diff --git a/drivers/input/keyboard/corgikbd.c b/drivers/input/keyboard/corgikbd.c index c8ed065ea0cb..abb04c82c622 100644 --- a/drivers/input/keyboard/corgikbd.c +++ b/drivers/input/keyboard/corgikbd.c | |||
@@ -288,7 +288,7 @@ static int corgikbd_resume(struct platform_device *dev) | |||
288 | #define corgikbd_resume NULL | 288 | #define corgikbd_resume NULL |
289 | #endif | 289 | #endif |
290 | 290 | ||
291 | static int __init corgikbd_probe(struct platform_device *pdev) | 291 | static int __devinit corgikbd_probe(struct platform_device *pdev) |
292 | { | 292 | { |
293 | struct corgikbd *corgikbd; | 293 | struct corgikbd *corgikbd; |
294 | struct input_dev *input_dev; | 294 | struct input_dev *input_dev; |
@@ -368,7 +368,7 @@ static int __init corgikbd_probe(struct platform_device *pdev) | |||
368 | return err; | 368 | return err; |
369 | } | 369 | } |
370 | 370 | ||
371 | static int corgikbd_remove(struct platform_device *pdev) | 371 | static int __devexit corgikbd_remove(struct platform_device *pdev) |
372 | { | 372 | { |
373 | int i; | 373 | int i; |
374 | struct corgikbd *corgikbd = platform_get_drvdata(pdev); | 374 | struct corgikbd *corgikbd = platform_get_drvdata(pdev); |
@@ -388,7 +388,7 @@ static int corgikbd_remove(struct platform_device *pdev) | |||
388 | 388 | ||
389 | static struct platform_driver corgikbd_driver = { | 389 | static struct platform_driver corgikbd_driver = { |
390 | .probe = corgikbd_probe, | 390 | .probe = corgikbd_probe, |
391 | .remove = corgikbd_remove, | 391 | .remove = __devexit_p(corgikbd_remove), |
392 | .suspend = corgikbd_suspend, | 392 | .suspend = corgikbd_suspend, |
393 | .resume = corgikbd_resume, | 393 | .resume = corgikbd_resume, |
394 | .driver = { | 394 | .driver = { |
@@ -397,7 +397,7 @@ static struct platform_driver corgikbd_driver = { | |||
397 | }, | 397 | }, |
398 | }; | 398 | }; |
399 | 399 | ||
400 | static int __devinit corgikbd_init(void) | 400 | static int __init corgikbd_init(void) |
401 | { | 401 | { |
402 | return platform_driver_register(&corgikbd_driver); | 402 | return platform_driver_register(&corgikbd_driver); |
403 | } | 403 | } |
diff --git a/drivers/input/keyboard/omap-keypad.c b/drivers/input/keyboard/omap-keypad.c index 3f3d1198cdb1..058fa8b02c21 100644 --- a/drivers/input/keyboard/omap-keypad.c +++ b/drivers/input/keyboard/omap-keypad.c | |||
@@ -279,7 +279,7 @@ static int omap_kp_resume(struct platform_device *dev) | |||
279 | #define omap_kp_resume NULL | 279 | #define omap_kp_resume NULL |
280 | #endif | 280 | #endif |
281 | 281 | ||
282 | static int __init omap_kp_probe(struct platform_device *pdev) | 282 | static int __devinit omap_kp_probe(struct platform_device *pdev) |
283 | { | 283 | { |
284 | struct omap_kp *omap_kp; | 284 | struct omap_kp *omap_kp; |
285 | struct input_dev *input_dev; | 285 | struct input_dev *input_dev; |
@@ -422,7 +422,7 @@ err1: | |||
422 | return -EINVAL; | 422 | return -EINVAL; |
423 | } | 423 | } |
424 | 424 | ||
425 | static int omap_kp_remove(struct platform_device *pdev) | 425 | static int __devexit omap_kp_remove(struct platform_device *pdev) |
426 | { | 426 | { |
427 | struct omap_kp *omap_kp = platform_get_drvdata(pdev); | 427 | struct omap_kp *omap_kp = platform_get_drvdata(pdev); |
428 | 428 | ||
@@ -454,7 +454,7 @@ static int omap_kp_remove(struct platform_device *pdev) | |||
454 | 454 | ||
455 | static struct platform_driver omap_kp_driver = { | 455 | static struct platform_driver omap_kp_driver = { |
456 | .probe = omap_kp_probe, | 456 | .probe = omap_kp_probe, |
457 | .remove = omap_kp_remove, | 457 | .remove = __devexit_p(omap_kp_remove), |
458 | .suspend = omap_kp_suspend, | 458 | .suspend = omap_kp_suspend, |
459 | .resume = omap_kp_resume, | 459 | .resume = omap_kp_resume, |
460 | .driver = { | 460 | .driver = { |
@@ -463,7 +463,7 @@ static struct platform_driver omap_kp_driver = { | |||
463 | }, | 463 | }, |
464 | }; | 464 | }; |
465 | 465 | ||
466 | static int __devinit omap_kp_init(void) | 466 | static int __init omap_kp_init(void) |
467 | { | 467 | { |
468 | printk(KERN_INFO "OMAP Keypad Driver\n"); | 468 | printk(KERN_INFO "OMAP Keypad Driver\n"); |
469 | return platform_driver_register(&omap_kp_driver); | 469 | return platform_driver_register(&omap_kp_driver); |
diff --git a/drivers/input/keyboard/spitzkbd.c b/drivers/input/keyboard/spitzkbd.c index c48b76a46a58..9d1781a618e9 100644 --- a/drivers/input/keyboard/spitzkbd.c +++ b/drivers/input/keyboard/spitzkbd.c | |||
@@ -343,7 +343,7 @@ static int spitzkbd_resume(struct platform_device *dev) | |||
343 | #define spitzkbd_resume NULL | 343 | #define spitzkbd_resume NULL |
344 | #endif | 344 | #endif |
345 | 345 | ||
346 | static int __init spitzkbd_probe(struct platform_device *dev) | 346 | static int __devinit spitzkbd_probe(struct platform_device *dev) |
347 | { | 347 | { |
348 | struct spitzkbd *spitzkbd; | 348 | struct spitzkbd *spitzkbd; |
349 | struct input_dev *input_dev; | 349 | struct input_dev *input_dev; |
@@ -444,7 +444,7 @@ static int __init spitzkbd_probe(struct platform_device *dev) | |||
444 | return err; | 444 | return err; |
445 | } | 445 | } |
446 | 446 | ||
447 | static int spitzkbd_remove(struct platform_device *dev) | 447 | static int __devexit spitzkbd_remove(struct platform_device *dev) |
448 | { | 448 | { |
449 | int i; | 449 | int i; |
450 | struct spitzkbd *spitzkbd = platform_get_drvdata(dev); | 450 | struct spitzkbd *spitzkbd = platform_get_drvdata(dev); |
@@ -470,7 +470,7 @@ static int spitzkbd_remove(struct platform_device *dev) | |||
470 | 470 | ||
471 | static struct platform_driver spitzkbd_driver = { | 471 | static struct platform_driver spitzkbd_driver = { |
472 | .probe = spitzkbd_probe, | 472 | .probe = spitzkbd_probe, |
473 | .remove = spitzkbd_remove, | 473 | .remove = __devexit_p(spitzkbd_remove), |
474 | .suspend = spitzkbd_suspend, | 474 | .suspend = spitzkbd_suspend, |
475 | .resume = spitzkbd_resume, | 475 | .resume = spitzkbd_resume, |
476 | .driver = { | 476 | .driver = { |
@@ -479,7 +479,7 @@ static struct platform_driver spitzkbd_driver = { | |||
479 | }, | 479 | }, |
480 | }; | 480 | }; |
481 | 481 | ||
482 | static int __devinit spitzkbd_init(void) | 482 | static int __init spitzkbd_init(void) |
483 | { | 483 | { |
484 | return platform_driver_register(&spitzkbd_driver); | 484 | return platform_driver_register(&spitzkbd_driver); |
485 | } | 485 | } |
diff --git a/drivers/input/mouse/Kconfig b/drivers/input/mouse/Kconfig index 093c8c1bca74..9705f3a00a3d 100644 --- a/drivers/input/mouse/Kconfig +++ b/drivers/input/mouse/Kconfig | |||
@@ -70,7 +70,7 @@ config MOUSE_PS2_SYNAPTICS | |||
70 | config MOUSE_PS2_LIFEBOOK | 70 | config MOUSE_PS2_LIFEBOOK |
71 | bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED | 71 | bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED |
72 | default y | 72 | default y |
73 | depends on MOUSE_PS2 | 73 | depends on MOUSE_PS2 && X86 |
74 | help | 74 | help |
75 | Say Y here if you have a Fujitsu B-series Lifebook PS/2 | 75 | Say Y here if you have a Fujitsu B-series Lifebook PS/2 |
76 | TouchScreen connected to your system. | 76 | TouchScreen connected to your system. |
diff --git a/drivers/input/mouse/elantech.c b/drivers/input/mouse/elantech.c index b9a25d57bc5e..6ab0eb1ada1c 100644 --- a/drivers/input/mouse/elantech.c +++ b/drivers/input/mouse/elantech.c | |||
@@ -542,7 +542,7 @@ int elantech_detect(struct psmouse *psmouse, int set_properties) | |||
542 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || | 542 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || |
543 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || | 543 | ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || |
544 | ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) { | 544 | ps2_command(ps2dev, param, PSMOUSE_CMD_GETINFO)) { |
545 | pr_err("elantech.c: sending Elantech magic knock failed.\n"); | 545 | pr_debug("elantech.c: sending Elantech magic knock failed.\n"); |
546 | return -1; | 546 | return -1; |
547 | } | 547 | } |
548 | 548 | ||
@@ -551,8 +551,27 @@ int elantech_detect(struct psmouse *psmouse, int set_properties) | |||
551 | * set of magic numbers | 551 | * set of magic numbers |
552 | */ | 552 | */ |
553 | if (param[0] != 0x3c || param[1] != 0x03 || param[2] != 0xc8) { | 553 | if (param[0] != 0x3c || param[1] != 0x03 || param[2] != 0xc8) { |
554 | pr_info("elantech.c: unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n", | 554 | pr_debug("elantech.c: " |
555 | param[0], param[1], param[2]); | 555 | "unexpected magic knock result 0x%02x, 0x%02x, 0x%02x.\n", |
556 | param[0], param[1], param[2]); | ||
557 | return -1; | ||
558 | } | ||
559 | |||
560 | /* | ||
561 | * Query touchpad's firmware version and see if it reports known | ||
562 | * value to avoid mis-detection. Logitech mice are known to respond | ||
563 | * to Elantech magic knock and there might be more. | ||
564 | */ | ||
565 | if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { | ||
566 | pr_debug("elantech.c: failed to query firmware version.\n"); | ||
567 | return -1; | ||
568 | } | ||
569 | |||
570 | pr_debug("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n", | ||
571 | param[0], param[1], param[2]); | ||
572 | |||
573 | if (param[0] == 0 || param[1] != 0) { | ||
574 | pr_debug("elantech.c: Probably not a real Elantech touchpad. Aborting.\n"); | ||
556 | return -1; | 575 | return -1; |
557 | } | 576 | } |
558 | 577 | ||
@@ -600,8 +619,7 @@ int elantech_init(struct psmouse *psmouse) | |||
600 | int i, error; | 619 | int i, error; |
601 | unsigned char param[3]; | 620 | unsigned char param[3]; |
602 | 621 | ||
603 | etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); | 622 | psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); |
604 | psmouse->private = etd; | ||
605 | if (!etd) | 623 | if (!etd) |
606 | return -1; | 624 | return -1; |
607 | 625 | ||
@@ -610,14 +628,12 @@ int elantech_init(struct psmouse *psmouse) | |||
610 | etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; | 628 | etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; |
611 | 629 | ||
612 | /* | 630 | /* |
613 | * Find out what version hardware this is | 631 | * Do the version query again so we can store the result |
614 | */ | 632 | */ |
615 | if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { | 633 | if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { |
616 | pr_err("elantech.c: failed to query firmware version.\n"); | 634 | pr_err("elantech.c: failed to query firmware version.\n"); |
617 | goto init_fail; | 635 | goto init_fail; |
618 | } | 636 | } |
619 | pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n", | ||
620 | param[0], param[1], param[2]); | ||
621 | etd->fw_version_maj = param[0]; | 637 | etd->fw_version_maj = param[0]; |
622 | etd->fw_version_min = param[2]; | 638 | etd->fw_version_min = param[2]; |
623 | 639 | ||
diff --git a/drivers/input/mouse/pxa930_trkball.c b/drivers/input/mouse/pxa930_trkball.c index d297accf9a7f..1e827ad0afbe 100644 --- a/drivers/input/mouse/pxa930_trkball.c +++ b/drivers/input/mouse/pxa930_trkball.c | |||
@@ -83,7 +83,7 @@ static int write_tbcr(struct pxa930_trkball *trkball, int v) | |||
83 | 83 | ||
84 | __raw_writel(v, trkball->mmio_base + TBCR); | 84 | __raw_writel(v, trkball->mmio_base + TBCR); |
85 | 85 | ||
86 | while (i--) { | 86 | while (--i) { |
87 | if (__raw_readl(trkball->mmio_base + TBCR) == v) | 87 | if (__raw_readl(trkball->mmio_base + TBCR) == v) |
88 | break; | 88 | break; |
89 | msleep(1); | 89 | msleep(1); |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 865fc69e9bc3..f3e4f7b0240d 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -182,11 +182,6 @@ static int synaptics_identify(struct psmouse *psmouse) | |||
182 | 182 | ||
183 | static int synaptics_query_hardware(struct psmouse *psmouse) | 183 | static int synaptics_query_hardware(struct psmouse *psmouse) |
184 | { | 184 | { |
185 | int retries = 0; | ||
186 | |||
187 | while ((retries++ < 3) && psmouse_reset(psmouse)) | ||
188 | /* empty */; | ||
189 | |||
190 | if (synaptics_identify(psmouse)) | 185 | if (synaptics_identify(psmouse)) |
191 | return -1; | 186 | return -1; |
192 | if (synaptics_model_id(psmouse)) | 187 | if (synaptics_model_id(psmouse)) |
@@ -582,6 +577,8 @@ static int synaptics_reconnect(struct psmouse *psmouse) | |||
582 | struct synaptics_data *priv = psmouse->private; | 577 | struct synaptics_data *priv = psmouse->private; |
583 | struct synaptics_data old_priv = *priv; | 578 | struct synaptics_data old_priv = *priv; |
584 | 579 | ||
580 | psmouse_reset(psmouse); | ||
581 | |||
585 | if (synaptics_detect(psmouse, 0)) | 582 | if (synaptics_detect(psmouse, 0)) |
586 | return -1; | 583 | return -1; |
587 | 584 | ||
@@ -640,6 +637,8 @@ int synaptics_init(struct psmouse *psmouse) | |||
640 | if (!priv) | 637 | if (!priv) |
641 | return -1; | 638 | return -1; |
642 | 639 | ||
640 | psmouse_reset(psmouse); | ||
641 | |||
643 | if (synaptics_query_hardware(psmouse)) { | 642 | if (synaptics_query_hardware(psmouse)) { |
644 | printk(KERN_ERR "Unable to query Synaptics hardware.\n"); | 643 | printk(KERN_ERR "Unable to query Synaptics hardware.\n"); |
645 | goto init_fail; | 644 | goto init_fail; |
diff --git a/drivers/input/serio/ambakmi.c b/drivers/input/serio/ambakmi.c index b10ffae7c39b..e29cdc13a199 100644 --- a/drivers/input/serio/ambakmi.c +++ b/drivers/input/serio/ambakmi.c | |||
@@ -57,7 +57,7 @@ static int amba_kmi_write(struct serio *io, unsigned char val) | |||
57 | struct amba_kmi_port *kmi = io->port_data; | 57 | struct amba_kmi_port *kmi = io->port_data; |
58 | unsigned int timeleft = 10000; /* timeout in 100ms */ | 58 | unsigned int timeleft = 10000; /* timeout in 100ms */ |
59 | 59 | ||
60 | while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && timeleft--) | 60 | while ((readb(KMISTAT) & KMISTAT_TXEMPTY) == 0 && --timeleft) |
61 | udelay(10); | 61 | udelay(10); |
62 | 62 | ||
63 | if (timeleft) | 63 | if (timeleft) |
@@ -129,8 +129,8 @@ static int amba_kmi_probe(struct amba_device *dev, void *id) | |||
129 | io->write = amba_kmi_write; | 129 | io->write = amba_kmi_write; |
130 | io->open = amba_kmi_open; | 130 | io->open = amba_kmi_open; |
131 | io->close = amba_kmi_close; | 131 | io->close = amba_kmi_close; |
132 | strlcpy(io->name, dev->dev.bus_id, sizeof(io->name)); | 132 | strlcpy(io->name, dev_name(&dev->dev), sizeof(io->name)); |
133 | strlcpy(io->phys, dev->dev.bus_id, sizeof(io->phys)); | 133 | strlcpy(io->phys, dev_name(&dev->dev), sizeof(io->phys)); |
134 | io->port_data = kmi; | 134 | io->port_data = kmi; |
135 | io->dev.parent = &dev->dev; | 135 | io->dev.parent = &dev->dev; |
136 | 136 | ||
diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index adc3bd6e7f7b..bd0f92d9f40f 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c | |||
@@ -359,7 +359,7 @@ static int __init gscps2_probe(struct parisc_device *dev) | |||
359 | 359 | ||
360 | snprintf(serio->name, sizeof(serio->name), "GSC PS/2 %s", | 360 | snprintf(serio->name, sizeof(serio->name), "GSC PS/2 %s", |
361 | (ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse"); | 361 | (ps2port->id == GSC_ID_KEYBOARD) ? "keyboard" : "mouse"); |
362 | strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys)); | 362 | strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys)); |
363 | serio->id.type = SERIO_8042; | 363 | serio->id.type = SERIO_8042; |
364 | serio->write = gscps2_write; | 364 | serio->write = gscps2_write; |
365 | serio->open = gscps2_open; | 365 | serio->open = gscps2_open; |
diff --git a/drivers/input/serio/sa1111ps2.c b/drivers/input/serio/sa1111ps2.c index 2ad88780a170..57953c0eb82f 100644 --- a/drivers/input/serio/sa1111ps2.c +++ b/drivers/input/serio/sa1111ps2.c | |||
@@ -246,8 +246,8 @@ static int __devinit ps2_probe(struct sa1111_dev *dev) | |||
246 | serio->write = ps2_write; | 246 | serio->write = ps2_write; |
247 | serio->open = ps2_open; | 247 | serio->open = ps2_open; |
248 | serio->close = ps2_close; | 248 | serio->close = ps2_close; |
249 | strlcpy(serio->name, dev->dev.bus_id, sizeof(serio->name)); | 249 | strlcpy(serio->name, dev_name(&dev->dev), sizeof(serio->name)); |
250 | strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys)); | 250 | strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys)); |
251 | serio->port_data = ps2if; | 251 | serio->port_data = ps2if; |
252 | serio->dev.parent = &dev->dev; | 252 | serio->dev.parent = &dev->dev; |
253 | ps2if->io = serio; | 253 | ps2if->io = serio; |
diff --git a/drivers/input/touchscreen/atmel_tsadcc.c b/drivers/input/touchscreen/atmel_tsadcc.c index a89a6a8f05e6..055969e8be13 100644 --- a/drivers/input/touchscreen/atmel_tsadcc.c +++ b/drivers/input/touchscreen/atmel_tsadcc.c | |||
@@ -236,7 +236,7 @@ static int __devinit atmel_tsadcc_probe(struct platform_device *pdev) | |||
236 | ts_dev->bufferedmeasure = 0; | 236 | ts_dev->bufferedmeasure = 0; |
237 | 237 | ||
238 | snprintf(ts_dev->phys, sizeof(ts_dev->phys), | 238 | snprintf(ts_dev->phys, sizeof(ts_dev->phys), |
239 | "%s/input0", pdev->dev.bus_id); | 239 | "%s/input0", dev_name(&pdev->dev)); |
240 | 240 | ||
241 | input_dev->name = "atmel touch screen controller"; | 241 | input_dev->name = "atmel touch screen controller"; |
242 | input_dev->phys = ts_dev->phys; | 242 | input_dev->phys = ts_dev->phys; |
diff --git a/drivers/input/touchscreen/corgi_ts.c b/drivers/input/touchscreen/corgi_ts.c index 65202c9f63ff..3fb51b54fe61 100644 --- a/drivers/input/touchscreen/corgi_ts.c +++ b/drivers/input/touchscreen/corgi_ts.c | |||
@@ -268,7 +268,7 @@ static int corgits_resume(struct platform_device *dev) | |||
268 | #define corgits_resume NULL | 268 | #define corgits_resume NULL |
269 | #endif | 269 | #endif |
270 | 270 | ||
271 | static int __init corgits_probe(struct platform_device *pdev) | 271 | static int __devinit corgits_probe(struct platform_device *pdev) |
272 | { | 272 | { |
273 | struct corgi_ts *corgi_ts; | 273 | struct corgi_ts *corgi_ts; |
274 | struct input_dev *input_dev; | 274 | struct input_dev *input_dev; |
@@ -343,7 +343,7 @@ static int __init corgits_probe(struct platform_device *pdev) | |||
343 | return err; | 343 | return err; |
344 | } | 344 | } |
345 | 345 | ||
346 | static int corgits_remove(struct platform_device *pdev) | 346 | static int __devexit corgits_remove(struct platform_device *pdev) |
347 | { | 347 | { |
348 | struct corgi_ts *corgi_ts = platform_get_drvdata(pdev); | 348 | struct corgi_ts *corgi_ts = platform_get_drvdata(pdev); |
349 | 349 | ||
@@ -352,12 +352,13 @@ static int corgits_remove(struct platform_device *pdev) | |||
352 | corgi_ts->machinfo->put_hsync(); | 352 | corgi_ts->machinfo->put_hsync(); |
353 | input_unregister_device(corgi_ts->input); | 353 | input_unregister_device(corgi_ts->input); |
354 | kfree(corgi_ts); | 354 | kfree(corgi_ts); |
355 | |||
355 | return 0; | 356 | return 0; |
356 | } | 357 | } |
357 | 358 | ||
358 | static struct platform_driver corgits_driver = { | 359 | static struct platform_driver corgits_driver = { |
359 | .probe = corgits_probe, | 360 | .probe = corgits_probe, |
360 | .remove = corgits_remove, | 361 | .remove = __devexit_p(corgits_remove), |
361 | .suspend = corgits_suspend, | 362 | .suspend = corgits_suspend, |
362 | .resume = corgits_resume, | 363 | .resume = corgits_resume, |
363 | .driver = { | 364 | .driver = { |
@@ -366,7 +367,7 @@ static struct platform_driver corgits_driver = { | |||
366 | }, | 367 | }, |
367 | }; | 368 | }; |
368 | 369 | ||
369 | static int __devinit corgits_init(void) | 370 | static int __init corgits_init(void) |
370 | { | 371 | { |
371 | return platform_driver_register(&corgits_driver); | 372 | return platform_driver_register(&corgits_driver); |
372 | } | 373 | } |
diff --git a/drivers/input/touchscreen/tsc2007.c b/drivers/input/touchscreen/tsc2007.c index b75dc2990574..4ab070246892 100644 --- a/drivers/input/touchscreen/tsc2007.c +++ b/drivers/input/touchscreen/tsc2007.c | |||
@@ -289,7 +289,8 @@ static int tsc2007_probe(struct i2c_client *client, | |||
289 | 289 | ||
290 | pdata->init_platform_hw(); | 290 | pdata->init_platform_hw(); |
291 | 291 | ||
292 | snprintf(ts->phys, sizeof(ts->phys), "%s/input0", client->dev.bus_id); | 292 | snprintf(ts->phys, sizeof(ts->phys), |
293 | "%s/input0", dev_name(&client->dev)); | ||
293 | 294 | ||
294 | input_dev->name = "TSC2007 Touchscreen"; | 295 | input_dev->name = "TSC2007 Touchscreen"; |
295 | input_dev->phys = ts->phys; | 296 | input_dev->phys = ts->phys; |
diff --git a/drivers/input/touchscreen/usbtouchscreen.c b/drivers/input/touchscreen/usbtouchscreen.c index 5080b26ba160..fb7cb9bdfbd5 100644 --- a/drivers/input/touchscreen/usbtouchscreen.c +++ b/drivers/input/touchscreen/usbtouchscreen.c | |||
@@ -60,6 +60,10 @@ static int swap_xy; | |||
60 | module_param(swap_xy, bool, 0644); | 60 | module_param(swap_xy, bool, 0644); |
61 | MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped."); | 61 | MODULE_PARM_DESC(swap_xy, "If set X and Y axes are swapped."); |
62 | 62 | ||
63 | static int hwcalib_xy; | ||
64 | module_param(hwcalib_xy, bool, 0644); | ||
65 | MODULE_PARM_DESC(hwcalib_xy, "If set hw-calibrated X/Y are used if available"); | ||
66 | |||
63 | /* device specifc data/functions */ | 67 | /* device specifc data/functions */ |
64 | struct usbtouch_usb; | 68 | struct usbtouch_usb; |
65 | struct usbtouch_device_info { | 69 | struct usbtouch_device_info { |
@@ -118,6 +122,7 @@ enum { | |||
118 | 122 | ||
119 | #define USB_DEVICE_HID_CLASS(vend, prod) \ | 123 | #define USB_DEVICE_HID_CLASS(vend, prod) \ |
120 | .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \ | 124 | .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \ |
125 | | USB_DEVICE_ID_MATCH_INT_PROTOCOL \ | ||
121 | | USB_DEVICE_ID_MATCH_DEVICE, \ | 126 | | USB_DEVICE_ID_MATCH_DEVICE, \ |
122 | .idVendor = (vend), \ | 127 | .idVendor = (vend), \ |
123 | .idProduct = (prod), \ | 128 | .idProduct = (prod), \ |
@@ -260,8 +265,13 @@ static int panjit_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | |||
260 | 265 | ||
261 | static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) | 266 | static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) |
262 | { | 267 | { |
263 | dev->x = (pkt[8] << 8) | pkt[7]; | 268 | if (hwcalib_xy) { |
264 | dev->y = (pkt[10] << 8) | pkt[9]; | 269 | dev->x = (pkt[4] << 8) | pkt[3]; |
270 | dev->y = 0xffff - ((pkt[6] << 8) | pkt[5]); | ||
271 | } else { | ||
272 | dev->x = (pkt[8] << 8) | pkt[7]; | ||
273 | dev->y = (pkt[10] << 8) | pkt[9]; | ||
274 | } | ||
265 | dev->touch = (pkt[2] & 0x40) ? 1 : 0; | 275 | dev->touch = (pkt[2] & 0x40) ? 1 : 0; |
266 | 276 | ||
267 | return 1; | 277 | return 1; |
@@ -294,6 +304,12 @@ static int mtouch_init(struct usbtouch_usb *usbtouch) | |||
294 | return ret; | 304 | return ret; |
295 | } | 305 | } |
296 | 306 | ||
307 | /* Default min/max xy are the raw values, override if using hw-calib */ | ||
308 | if (hwcalib_xy) { | ||
309 | input_set_abs_params(usbtouch->input, ABS_X, 0, 0xffff, 0, 0); | ||
310 | input_set_abs_params(usbtouch->input, ABS_Y, 0, 0xffff, 0, 0); | ||
311 | } | ||
312 | |||
297 | return 0; | 313 | return 0; |
298 | } | 314 | } |
299 | #endif | 315 | #endif |
diff --git a/drivers/media/video/uvc/uvc_status.c b/drivers/media/video/uvc/uvc_status.c index c1e4ae27c613..c705f248da88 100644 --- a/drivers/media/video/uvc/uvc_status.c +++ b/drivers/media/video/uvc/uvc_status.c | |||
@@ -46,8 +46,8 @@ static int uvc_input_init(struct uvc_device *dev) | |||
46 | usb_to_input_id(udev, &input->id); | 46 | usb_to_input_id(udev, &input->id); |
47 | input->dev.parent = &dev->intf->dev; | 47 | input->dev.parent = &dev->intf->dev; |
48 | 48 | ||
49 | set_bit(EV_KEY, input->evbit); | 49 | __set_bit(EV_KEY, input->evbit); |
50 | set_bit(BTN_0, input->keybit); | 50 | __set_bit(KEY_CAMERA, input->keybit); |
51 | 51 | ||
52 | if ((ret = input_register_device(input)) < 0) | 52 | if ((ret = input_register_device(input)) < 0) |
53 | goto error; | 53 | goto error; |
@@ -70,8 +70,10 @@ static void uvc_input_cleanup(struct uvc_device *dev) | |||
70 | static void uvc_input_report_key(struct uvc_device *dev, unsigned int code, | 70 | static void uvc_input_report_key(struct uvc_device *dev, unsigned int code, |
71 | int value) | 71 | int value) |
72 | { | 72 | { |
73 | if (dev->input) | 73 | if (dev->input) { |
74 | input_report_key(dev->input, code, value); | 74 | input_report_key(dev->input, code, value); |
75 | input_sync(dev->input); | ||
76 | } | ||
75 | } | 77 | } |
76 | 78 | ||
77 | #else | 79 | #else |
@@ -96,7 +98,7 @@ static void uvc_event_streaming(struct uvc_device *dev, __u8 *data, int len) | |||
96 | return; | 98 | return; |
97 | uvc_trace(UVC_TRACE_STATUS, "Button (intf %u) %s len %d\n", | 99 | uvc_trace(UVC_TRACE_STATUS, "Button (intf %u) %s len %d\n", |
98 | data[1], data[3] ? "pressed" : "released", len); | 100 | data[1], data[3] ? "pressed" : "released", len); |
99 | uvc_input_report_key(dev, BTN_0, data[3]); | 101 | uvc_input_report_key(dev, KEY_CAMERA, data[3]); |
100 | } else { | 102 | } else { |
101 | uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x " | 103 | uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x " |
102 | "len %d.\n", data[1], data[2], data[3], len); | 104 | "len %d.\n", data[1], data[2], data[3], len); |
diff --git a/drivers/message/fusion/mptbase.c b/drivers/message/fusion/mptbase.c index 96ac88317b8e..ea3aafbbda44 100644 --- a/drivers/message/fusion/mptbase.c +++ b/drivers/message/fusion/mptbase.c | |||
@@ -91,9 +91,9 @@ MODULE_PARM_DESC(mpt_msi_enable_fc, " Enable MSI Support for FC \ | |||
91 | controllers (default=0)"); | 91 | controllers (default=0)"); |
92 | 92 | ||
93 | static int mpt_msi_enable_sas; | 93 | static int mpt_msi_enable_sas; |
94 | module_param(mpt_msi_enable_sas, int, 1); | 94 | module_param(mpt_msi_enable_sas, int, 0); |
95 | MODULE_PARM_DESC(mpt_msi_enable_sas, " Enable MSI Support for SAS \ | 95 | MODULE_PARM_DESC(mpt_msi_enable_sas, " Enable MSI Support for SAS \ |
96 | controllers (default=1)"); | 96 | controllers (default=0)"); |
97 | 97 | ||
98 | 98 | ||
99 | static int mpt_channel_mapping; | 99 | static int mpt_channel_mapping; |
diff --git a/drivers/mmc/host/sdhci-pci.c b/drivers/mmc/host/sdhci-pci.c index 8cff5f5e7f86..406da9a8d453 100644 --- a/drivers/mmc/host/sdhci-pci.c +++ b/drivers/mmc/host/sdhci-pci.c | |||
@@ -107,6 +107,7 @@ static const struct sdhci_pci_fixes sdhci_ene_714 = { | |||
107 | 107 | ||
108 | static const struct sdhci_pci_fixes sdhci_cafe = { | 108 | static const struct sdhci_pci_fixes sdhci_cafe = { |
109 | .quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | | 109 | .quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | |
110 | SDHCI_QUIRK_NO_BUSY_IRQ | | ||
110 | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, | 111 | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, |
111 | }; | 112 | }; |
112 | 113 | ||
diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index f52f3053ed92..accb592764ed 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c | |||
@@ -1291,8 +1291,11 @@ static void sdhci_cmd_irq(struct sdhci_host *host, u32 intmask) | |||
1291 | if (host->cmd->data) | 1291 | if (host->cmd->data) |
1292 | DBG("Cannot wait for busy signal when also " | 1292 | DBG("Cannot wait for busy signal when also " |
1293 | "doing a data transfer"); | 1293 | "doing a data transfer"); |
1294 | else | 1294 | else if (!(host->quirks & SDHCI_QUIRK_NO_BUSY_IRQ)) |
1295 | return; | 1295 | return; |
1296 | |||
1297 | /* The controller does not support the end-of-busy IRQ, | ||
1298 | * fall through and take the SDHCI_INT_RESPONSE */ | ||
1296 | } | 1299 | } |
1297 | 1300 | ||
1298 | if (intmask & SDHCI_INT_RESPONSE) | 1301 | if (intmask & SDHCI_INT_RESPONSE) |
diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index ebb83657e27a..43c37c68d07a 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h | |||
@@ -208,6 +208,8 @@ struct sdhci_host { | |||
208 | #define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<12) | 208 | #define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<12) |
209 | /* Controller has an issue with buffer bits for small transfers */ | 209 | /* Controller has an issue with buffer bits for small transfers */ |
210 | #define SDHCI_QUIRK_BROKEN_SMALL_PIO (1<<13) | 210 | #define SDHCI_QUIRK_BROKEN_SMALL_PIO (1<<13) |
211 | /* Controller does not provide transfer-complete interrupt when not busy */ | ||
212 | #define SDHCI_QUIRK_NO_BUSY_IRQ (1<<14) | ||
211 | 213 | ||
212 | int irq; /* Device IRQ */ | 214 | int irq; /* Device IRQ */ |
213 | void __iomem * ioaddr; /* Mapped address */ | 215 | void __iomem * ioaddr; /* Mapped address */ |
diff --git a/drivers/mtd/nand/orion_nand.c b/drivers/mtd/nand/orion_nand.c index 917cf8d3ae95..c2dfd3ea353d 100644 --- a/drivers/mtd/nand/orion_nand.c +++ b/drivers/mtd/nand/orion_nand.c | |||
@@ -149,7 +149,7 @@ static int __devexit orion_nand_remove(struct platform_device *pdev) | |||
149 | 149 | ||
150 | static struct platform_driver orion_nand_driver = { | 150 | static struct platform_driver orion_nand_driver = { |
151 | .probe = orion_nand_probe, | 151 | .probe = orion_nand_probe, |
152 | .remove = orion_nand_remove, | 152 | .remove = __devexit_p(orion_nand_remove), |
153 | .driver = { | 153 | .driver = { |
154 | .name = "orion_nand", | 154 | .name = "orion_nand", |
155 | .owner = THIS_MODULE, | 155 | .owner = THIS_MODULE, |
diff --git a/drivers/net/arm/Makefile b/drivers/net/arm/Makefile index c69c0cdba4a2..811a3ccd14c1 100644 --- a/drivers/net/arm/Makefile +++ b/drivers/net/arm/Makefile | |||
@@ -4,7 +4,7 @@ | |||
4 | # | 4 | # |
5 | 5 | ||
6 | obj-$(CONFIG_ARM_AM79C961A) += am79c961a.o | 6 | obj-$(CONFIG_ARM_AM79C961A) += am79c961a.o |
7 | obj-$(CONFIG_ARM_ETHERH) += etherh.o ../8390.o | 7 | obj-$(CONFIG_ARM_ETHERH) += etherh.o |
8 | obj-$(CONFIG_ARM_ETHER3) += ether3.o | 8 | obj-$(CONFIG_ARM_ETHER3) += ether3.o |
9 | obj-$(CONFIG_ARM_ETHER1) += ether1.o | 9 | obj-$(CONFIG_ARM_ETHER1) += ether1.o |
10 | obj-$(CONFIG_ARM_AT91_ETHER) += at91_ether.o | 10 | obj-$(CONFIG_ARM_AT91_ETHER) += at91_ether.o |
diff --git a/drivers/net/arm/etherh.c b/drivers/net/arm/etherh.c index 54b52e5b1821..f52f668c49bf 100644 --- a/drivers/net/arm/etherh.c +++ b/drivers/net/arm/etherh.c | |||
@@ -641,15 +641,15 @@ static const struct net_device_ops etherh_netdev_ops = { | |||
641 | .ndo_open = etherh_open, | 641 | .ndo_open = etherh_open, |
642 | .ndo_stop = etherh_close, | 642 | .ndo_stop = etherh_close, |
643 | .ndo_set_config = etherh_set_config, | 643 | .ndo_set_config = etherh_set_config, |
644 | .ndo_start_xmit = ei_start_xmit, | 644 | .ndo_start_xmit = __ei_start_xmit, |
645 | .ndo_tx_timeout = ei_tx_timeout, | 645 | .ndo_tx_timeout = __ei_tx_timeout, |
646 | .ndo_get_stats = ei_get_stats, | 646 | .ndo_get_stats = __ei_get_stats, |
647 | .ndo_set_multicast_list = ei_set_multicast_list, | 647 | .ndo_set_multicast_list = __ei_set_multicast_list, |
648 | .ndo_validate_addr = eth_validate_addr, | 648 | .ndo_validate_addr = eth_validate_addr, |
649 | .ndo_set_mac_address = eth_mac_addr, | 649 | .ndo_set_mac_address = eth_mac_addr, |
650 | .ndo_change_mtu = eth_change_mtu, | 650 | .ndo_change_mtu = eth_change_mtu, |
651 | #ifdef CONFIG_NET_POLL_CONTROLLER | 651 | #ifdef CONFIG_NET_POLL_CONTROLLER |
652 | .ndo_poll_controller = ei_poll, | 652 | .ndo_poll_controller = __ei_poll, |
653 | #endif | 653 | #endif |
654 | }; | 654 | }; |
655 | 655 | ||
diff --git a/drivers/net/arm/ks8695net.c b/drivers/net/arm/ks8695net.c index b39210cf4fb3..35cd264abae7 100644 --- a/drivers/net/arm/ks8695net.c +++ b/drivers/net/arm/ks8695net.c | |||
@@ -560,7 +560,7 @@ ks8695_reset(struct ks8695_priv *ksp) | |||
560 | msleep(1); | 560 | msleep(1); |
561 | } | 561 | } |
562 | 562 | ||
563 | if (reset_timeout == 0) { | 563 | if (reset_timeout < 0) { |
564 | dev_crit(ksp->dev, | 564 | dev_crit(ksp->dev, |
565 | "Timeout waiting for DMA engines to reset\n"); | 565 | "Timeout waiting for DMA engines to reset\n"); |
566 | /* And blithely carry on */ | 566 | /* And blithely carry on */ |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index 2c96b93b12a5..bfe1ed8389ca 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
@@ -4121,7 +4121,7 @@ static int bond_neigh_setup(struct net_device *dev, struct neigh_parms *parms) | |||
4121 | const struct net_device_ops *slave_ops | 4121 | const struct net_device_ops *slave_ops |
4122 | = slave->dev->netdev_ops; | 4122 | = slave->dev->netdev_ops; |
4123 | if (slave_ops->ndo_neigh_setup) | 4123 | if (slave_ops->ndo_neigh_setup) |
4124 | return slave_ops->ndo_neigh_setup(dev, parms); | 4124 | return slave_ops->ndo_neigh_setup(slave->dev, parms); |
4125 | } | 4125 | } |
4126 | return 0; | 4126 | return 0; |
4127 | } | 4127 | } |
diff --git a/drivers/net/fsl_pq_mdio.c b/drivers/net/fsl_pq_mdio.c index c434a156d7a9..b0ce1445d4a8 100644 --- a/drivers/net/fsl_pq_mdio.c +++ b/drivers/net/fsl_pq_mdio.c | |||
@@ -129,7 +129,7 @@ int fsl_pq_mdio_read(struct mii_bus *bus, int mii_id, int regnum) | |||
129 | static int fsl_pq_mdio_reset(struct mii_bus *bus) | 129 | static int fsl_pq_mdio_reset(struct mii_bus *bus) |
130 | { | 130 | { |
131 | struct fsl_pq_mdio __iomem *regs = (void __iomem *)bus->priv; | 131 | struct fsl_pq_mdio __iomem *regs = (void __iomem *)bus->priv; |
132 | unsigned int timeout = PHY_INIT_TIMEOUT; | 132 | int timeout = PHY_INIT_TIMEOUT; |
133 | 133 | ||
134 | mutex_lock(&bus->mdio_lock); | 134 | mutex_lock(&bus->mdio_lock); |
135 | 135 | ||
@@ -145,7 +145,7 @@ static int fsl_pq_mdio_reset(struct mii_bus *bus) | |||
145 | 145 | ||
146 | mutex_unlock(&bus->mdio_lock); | 146 | mutex_unlock(&bus->mdio_lock); |
147 | 147 | ||
148 | if(timeout == 0) { | 148 | if (timeout < 0) { |
149 | printk(KERN_ERR "%s: The MII Bus is stuck!\n", | 149 | printk(KERN_ERR "%s: The MII Bus is stuck!\n", |
150 | bus->name); | 150 | bus->name); |
151 | return -EBUSY; | 151 | return -EBUSY; |
diff --git a/drivers/net/jme.c b/drivers/net/jme.c index 4da81a3602dc..860dcd98a07c 100644 --- a/drivers/net/jme.c +++ b/drivers/net/jme.c | |||
@@ -956,13 +956,14 @@ jme_process_receive(struct jme_adapter *jme, int limit) | |||
956 | goto out_inc; | 956 | goto out_inc; |
957 | 957 | ||
958 | i = atomic_read(&rxring->next_to_clean); | 958 | i = atomic_read(&rxring->next_to_clean); |
959 | while (limit-- > 0) { | 959 | while (limit > 0) { |
960 | rxdesc = rxring->desc; | 960 | rxdesc = rxring->desc; |
961 | rxdesc += i; | 961 | rxdesc += i; |
962 | 962 | ||
963 | if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) || | 963 | if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) || |
964 | !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) | 964 | !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) |
965 | goto out; | 965 | goto out; |
966 | --limit; | ||
966 | 967 | ||
967 | desccnt = rxdesc->descwb.desccnt & RXWBDCNT_DCNT; | 968 | desccnt = rxdesc->descwb.desccnt & RXWBDCNT_DCNT; |
968 | 969 | ||
diff --git a/drivers/net/pcmcia/3c574_cs.c b/drivers/net/pcmcia/3c574_cs.c index e5cb6b1f0ebd..2404a838b1fe 100644 --- a/drivers/net/pcmcia/3c574_cs.c +++ b/drivers/net/pcmcia/3c574_cs.c | |||
@@ -1035,7 +1035,8 @@ static int el3_rx(struct net_device *dev, int worklimit) | |||
1035 | DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", | 1035 | DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", |
1036 | dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RxStatus)); | 1036 | dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RxStatus)); |
1037 | while (!((rx_status = inw(ioaddr + RxStatus)) & 0x8000) && | 1037 | while (!((rx_status = inw(ioaddr + RxStatus)) & 0x8000) && |
1038 | (--worklimit >= 0)) { | 1038 | worklimit > 0) { |
1039 | worklimit--; | ||
1039 | if (rx_status & 0x4000) { /* Error, update stats. */ | 1040 | if (rx_status & 0x4000) { /* Error, update stats. */ |
1040 | short error = rx_status & 0x3800; | 1041 | short error = rx_status & 0x3800; |
1041 | dev->stats.rx_errors++; | 1042 | dev->stats.rx_errors++; |
diff --git a/drivers/net/pcmcia/3c589_cs.c b/drivers/net/pcmcia/3c589_cs.c index 73ecc657999d..1e01b8a6dbf3 100644 --- a/drivers/net/pcmcia/3c589_cs.c +++ b/drivers/net/pcmcia/3c589_cs.c | |||
@@ -857,7 +857,8 @@ static int el3_rx(struct net_device *dev) | |||
857 | DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", | 857 | DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", |
858 | dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RX_STATUS)); | 858 | dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RX_STATUS)); |
859 | while (!((rx_status = inw(ioaddr + RX_STATUS)) & 0x8000) && | 859 | while (!((rx_status = inw(ioaddr + RX_STATUS)) & 0x8000) && |
860 | (--worklimit >= 0)) { | 860 | worklimit > 0) { |
861 | worklimit--; | ||
861 | if (rx_status & 0x4000) { /* Error, update stats. */ | 862 | if (rx_status & 0x4000) { /* Error, update stats. */ |
862 | short error = rx_status & 0x3800; | 863 | short error = rx_status & 0x3800; |
863 | dev->stats.rx_errors++; | 864 | dev->stats.rx_errors++; |
diff --git a/drivers/net/smc911x.h b/drivers/net/smc911x.h index 870b4c33f108..a45952e72018 100644 --- a/drivers/net/smc911x.h +++ b/drivers/net/smc911x.h | |||
@@ -42,6 +42,16 @@ | |||
42 | #define SMC_USE_16BIT 0 | 42 | #define SMC_USE_16BIT 0 |
43 | #define SMC_USE_32BIT 1 | 43 | #define SMC_USE_32BIT 1 |
44 | #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW | 44 | #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW |
45 | #elif defined(CONFIG_ARCH_OMAP34XX) | ||
46 | #define SMC_USE_16BIT 0 | ||
47 | #define SMC_USE_32BIT 1 | ||
48 | #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW | ||
49 | #define SMC_MEM_RESERVED 1 | ||
50 | #elif defined(CONFIG_ARCH_OMAP24XX) | ||
51 | #define SMC_USE_16BIT 0 | ||
52 | #define SMC_USE_32BIT 1 | ||
53 | #define SMC_IRQ_SENSE IRQF_TRIGGER_LOW | ||
54 | #define SMC_MEM_RESERVED 1 | ||
45 | #else | 55 | #else |
46 | /* | 56 | /* |
47 | * Default configuration | 57 | * Default configuration |
@@ -675,6 +685,7 @@ smc_pxa_dma_outsl(struct smc911x_local *lp, u_long physaddr, | |||
675 | #define CHIP_9116 0x0116 | 685 | #define CHIP_9116 0x0116 |
676 | #define CHIP_9117 0x0117 | 686 | #define CHIP_9117 0x0117 |
677 | #define CHIP_9118 0x0118 | 687 | #define CHIP_9118 0x0118 |
688 | #define CHIP_9211 0x9211 | ||
678 | #define CHIP_9215 0x115A | 689 | #define CHIP_9215 0x115A |
679 | #define CHIP_9217 0x117A | 690 | #define CHIP_9217 0x117A |
680 | #define CHIP_9218 0x118A | 691 | #define CHIP_9218 0x118A |
@@ -689,6 +700,7 @@ static const struct chip_id chip_ids[] = { | |||
689 | { CHIP_9116, "LAN9116" }, | 700 | { CHIP_9116, "LAN9116" }, |
690 | { CHIP_9117, "LAN9117" }, | 701 | { CHIP_9117, "LAN9117" }, |
691 | { CHIP_9118, "LAN9118" }, | 702 | { CHIP_9118, "LAN9118" }, |
703 | { CHIP_9211, "LAN9211" }, | ||
692 | { CHIP_9215, "LAN9215" }, | 704 | { CHIP_9215, "LAN9215" }, |
693 | { CHIP_9217, "LAN9217" }, | 705 | { CHIP_9217, "LAN9217" }, |
694 | { CHIP_9218, "LAN9218" }, | 706 | { CHIP_9218, "LAN9218" }, |
diff --git a/drivers/net/sungem.c b/drivers/net/sungem.c index c3e6aa137cdf..64dfa7f5f374 100644 --- a/drivers/net/sungem.c +++ b/drivers/net/sungem.c | |||
@@ -1229,7 +1229,7 @@ static void gem_reset(struct gem *gp) | |||
1229 | break; | 1229 | break; |
1230 | } while (val & (GREG_SWRST_TXRST | GREG_SWRST_RXRST)); | 1230 | } while (val & (GREG_SWRST_TXRST | GREG_SWRST_RXRST)); |
1231 | 1231 | ||
1232 | if (limit <= 0) | 1232 | if (limit < 0) |
1233 | printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name); | 1233 | printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name); |
1234 | 1234 | ||
1235 | if (gp->phy_type == phy_serialink || gp->phy_type == phy_serdes) | 1235 | if (gp->phy_type == phy_serialink || gp->phy_type == phy_serdes) |
diff --git a/drivers/net/tokenring/tmspci.c b/drivers/net/tokenring/tmspci.c index b397e8785d6d..f92fe86fdcae 100644 --- a/drivers/net/tokenring/tmspci.c +++ b/drivers/net/tokenring/tmspci.c | |||
@@ -121,11 +121,6 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic | |||
121 | goto err_out_trdev; | 121 | goto err_out_trdev; |
122 | } | 122 | } |
123 | 123 | ||
124 | ret = request_irq(pdev->irq, tms380tr_interrupt, IRQF_SHARED, | ||
125 | dev->name, dev); | ||
126 | if (ret) | ||
127 | goto err_out_region; | ||
128 | |||
129 | dev->base_addr = pci_ioaddr; | 124 | dev->base_addr = pci_ioaddr; |
130 | dev->irq = pci_irq_line; | 125 | dev->irq = pci_irq_line; |
131 | dev->dma = 0; | 126 | dev->dma = 0; |
@@ -142,7 +137,7 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic | |||
142 | ret = tmsdev_init(dev, &pdev->dev); | 137 | ret = tmsdev_init(dev, &pdev->dev); |
143 | if (ret) { | 138 | if (ret) { |
144 | printk("%s: unable to get memory for dev->priv.\n", dev->name); | 139 | printk("%s: unable to get memory for dev->priv.\n", dev->name); |
145 | goto err_out_irq; | 140 | goto err_out_region; |
146 | } | 141 | } |
147 | 142 | ||
148 | tp = netdev_priv(dev); | 143 | tp = netdev_priv(dev); |
@@ -159,20 +154,25 @@ static int __devinit tms_pci_attach(struct pci_dev *pdev, const struct pci_devic | |||
159 | 154 | ||
160 | dev->netdev_ops = &tms380tr_netdev_ops; | 155 | dev->netdev_ops = &tms380tr_netdev_ops; |
161 | 156 | ||
157 | ret = request_irq(pdev->irq, tms380tr_interrupt, IRQF_SHARED, | ||
158 | dev->name, dev); | ||
159 | if (ret) | ||
160 | goto err_out_tmsdev; | ||
161 | |||
162 | pci_set_drvdata(pdev, dev); | 162 | pci_set_drvdata(pdev, dev); |
163 | SET_NETDEV_DEV(dev, &pdev->dev); | 163 | SET_NETDEV_DEV(dev, &pdev->dev); |
164 | 164 | ||
165 | ret = register_netdev(dev); | 165 | ret = register_netdev(dev); |
166 | if (ret) | 166 | if (ret) |
167 | goto err_out_tmsdev; | 167 | goto err_out_irq; |
168 | 168 | ||
169 | return 0; | 169 | return 0; |
170 | 170 | ||
171 | err_out_irq: | ||
172 | free_irq(pdev->irq, dev); | ||
171 | err_out_tmsdev: | 173 | err_out_tmsdev: |
172 | pci_set_drvdata(pdev, NULL); | 174 | pci_set_drvdata(pdev, NULL); |
173 | tmsdev_term(dev); | 175 | tmsdev_term(dev); |
174 | err_out_irq: | ||
175 | free_irq(pdev->irq, dev); | ||
176 | err_out_region: | 176 | err_out_region: |
177 | release_region(pci_ioaddr, TMS_PCI_IO_EXTENT); | 177 | release_region(pci_ioaddr, TMS_PCI_IO_EXTENT); |
178 | err_out_trdev: | 178 | err_out_trdev: |
diff --git a/drivers/net/usb/dm9601.c b/drivers/net/usb/dm9601.c index 5b67bbf1987e..81682c6defa0 100644 --- a/drivers/net/usb/dm9601.c +++ b/drivers/net/usb/dm9601.c | |||
@@ -635,6 +635,10 @@ static const struct usb_device_id products[] = { | |||
635 | USB_DEVICE(0x0a47, 0x9601), /* Hirose USB-100 */ | 635 | USB_DEVICE(0x0a47, 0x9601), /* Hirose USB-100 */ |
636 | .driver_info = (unsigned long)&dm9601_info, | 636 | .driver_info = (unsigned long)&dm9601_info, |
637 | }, | 637 | }, |
638 | { | ||
639 | USB_DEVICE(0x0fe6, 0x8101), /* DM9601 USB to Fast Ethernet Adapter */ | ||
640 | .driver_info = (unsigned long)&dm9601_info, | ||
641 | }, | ||
638 | {}, // END | 642 | {}, // END |
639 | }; | 643 | }; |
640 | 644 | ||
diff --git a/drivers/scsi/cxgb3i/cxgb3i.h b/drivers/scsi/cxgb3i/cxgb3i.h index fde6e4c634e7..a7cf550b9cca 100644 --- a/drivers/scsi/cxgb3i/cxgb3i.h +++ b/drivers/scsi/cxgb3i/cxgb3i.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/list.h> | 20 | #include <linux/list.h> |
21 | #include <linux/netdevice.h> | 21 | #include <linux/netdevice.h> |
22 | #include <linux/scatterlist.h> | 22 | #include <linux/scatterlist.h> |
23 | #include <linux/skbuff.h> | ||
23 | #include <scsi/libiscsi_tcp.h> | 24 | #include <scsi/libiscsi_tcp.h> |
24 | 25 | ||
25 | /* from cxgb3 LLD */ | 26 | /* from cxgb3 LLD */ |
@@ -113,6 +114,26 @@ struct cxgb3i_endpoint { | |||
113 | struct cxgb3i_conn *cconn; | 114 | struct cxgb3i_conn *cconn; |
114 | }; | 115 | }; |
115 | 116 | ||
117 | /** | ||
118 | * struct cxgb3i_task_data - private iscsi task data | ||
119 | * | ||
120 | * @nr_frags: # of coalesced page frags (from scsi sgl) | ||
121 | * @frags: coalesced page frags (from scsi sgl) | ||
122 | * @skb: tx pdu skb | ||
123 | * @offset: data offset for the next pdu | ||
124 | * @count: max. possible pdu payload | ||
125 | * @sgoffset: offset to the first sg entry for a given offset | ||
126 | */ | ||
127 | #define MAX_PDU_FRAGS ((ULP2_MAX_PDU_PAYLOAD + 512 - 1) / 512) | ||
128 | struct cxgb3i_task_data { | ||
129 | unsigned short nr_frags; | ||
130 | skb_frag_t frags[MAX_PDU_FRAGS]; | ||
131 | struct sk_buff *skb; | ||
132 | unsigned int offset; | ||
133 | unsigned int count; | ||
134 | unsigned int sgoffset; | ||
135 | }; | ||
136 | |||
116 | int cxgb3i_iscsi_init(void); | 137 | int cxgb3i_iscsi_init(void); |
117 | void cxgb3i_iscsi_cleanup(void); | 138 | void cxgb3i_iscsi_cleanup(void); |
118 | 139 | ||
diff --git a/drivers/scsi/cxgb3i/cxgb3i_ddp.c b/drivers/scsi/cxgb3i/cxgb3i_ddp.c index 08f3a09d9233..a83d36e4926f 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_ddp.c +++ b/drivers/scsi/cxgb3i/cxgb3i_ddp.c | |||
@@ -639,10 +639,11 @@ static int ddp_init(struct t3cdev *tdev) | |||
639 | write_unlock(&cxgb3i_ddp_rwlock); | 639 | write_unlock(&cxgb3i_ddp_rwlock); |
640 | 640 | ||
641 | ddp_log_info("nppods %u (0x%x ~ 0x%x), bits %u, mask 0x%x,0x%x " | 641 | ddp_log_info("nppods %u (0x%x ~ 0x%x), bits %u, mask 0x%x,0x%x " |
642 | "pkt %u,%u.\n", | 642 | "pkt %u/%u, %u/%u.\n", |
643 | ppmax, ddp->llimit, ddp->ulimit, ddp->idx_bits, | 643 | ppmax, ddp->llimit, ddp->ulimit, ddp->idx_bits, |
644 | ddp->idx_mask, ddp->rsvd_tag_mask, | 644 | ddp->idx_mask, ddp->rsvd_tag_mask, |
645 | ddp->max_txsz, ddp->max_rxsz); | 645 | ddp->max_txsz, uinfo.max_txsz, |
646 | ddp->max_rxsz, uinfo.max_rxsz); | ||
646 | return 0; | 647 | return 0; |
647 | 648 | ||
648 | free_ddp_map: | 649 | free_ddp_map: |
@@ -654,8 +655,8 @@ free_ddp_map: | |||
654 | * cxgb3i_adapter_ddp_init - initialize the adapter's ddp resource | 655 | * cxgb3i_adapter_ddp_init - initialize the adapter's ddp resource |
655 | * @tdev: t3cdev adapter | 656 | * @tdev: t3cdev adapter |
656 | * @tformat: tag format | 657 | * @tformat: tag format |
657 | * @txsz: max tx pkt size, filled in by this func. | 658 | * @txsz: max tx pdu payload size, filled in by this func. |
658 | * @rxsz: max rx pkt size, filled in by this func. | 659 | * @rxsz: max rx pdu payload size, filled in by this func. |
659 | * initialize the ddp pagepod manager for a given adapter if needed and | 660 | * initialize the ddp pagepod manager for a given adapter if needed and |
660 | * setup the tag format for a given iscsi entity | 661 | * setup the tag format for a given iscsi entity |
661 | */ | 662 | */ |
@@ -685,10 +686,12 @@ int cxgb3i_adapter_ddp_init(struct t3cdev *tdev, | |||
685 | tformat->sw_bits, tformat->rsvd_bits, | 686 | tformat->sw_bits, tformat->rsvd_bits, |
686 | tformat->rsvd_shift, tformat->rsvd_mask); | 687 | tformat->rsvd_shift, tformat->rsvd_mask); |
687 | 688 | ||
688 | *txsz = ddp->max_txsz; | 689 | *txsz = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD, |
689 | *rxsz = ddp->max_rxsz; | 690 | ddp->max_txsz - ISCSI_PDU_NONPAYLOAD_LEN); |
690 | ddp_log_info("ddp max pkt size: %u, %u.\n", | 691 | *rxsz = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD, |
691 | ddp->max_txsz, ddp->max_rxsz); | 692 | ddp->max_rxsz - ISCSI_PDU_NONPAYLOAD_LEN); |
693 | ddp_log_info("max payload size: %u/%u, %u/%u.\n", | ||
694 | *txsz, ddp->max_txsz, *rxsz, ddp->max_rxsz); | ||
692 | return 0; | 695 | return 0; |
693 | } | 696 | } |
694 | EXPORT_SYMBOL_GPL(cxgb3i_adapter_ddp_init); | 697 | EXPORT_SYMBOL_GPL(cxgb3i_adapter_ddp_init); |
diff --git a/drivers/scsi/cxgb3i/cxgb3i_ddp.h b/drivers/scsi/cxgb3i/cxgb3i_ddp.h index f675807cc48f..3faae7831c83 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_ddp.h +++ b/drivers/scsi/cxgb3i/cxgb3i_ddp.h | |||
@@ -87,8 +87,9 @@ struct cxgb3i_ddp_info { | |||
87 | struct sk_buff **gl_skb; | 87 | struct sk_buff **gl_skb; |
88 | }; | 88 | }; |
89 | 89 | ||
90 | #define ISCSI_PDU_NONPAYLOAD_LEN 312 /* bhs(48) + ahs(256) + digest(8) */ | ||
90 | #define ULP2_MAX_PKT_SIZE 16224 | 91 | #define ULP2_MAX_PKT_SIZE 16224 |
91 | #define ULP2_MAX_PDU_PAYLOAD (ULP2_MAX_PKT_SIZE - ISCSI_PDU_NONPAYLOAD_MAX) | 92 | #define ULP2_MAX_PDU_PAYLOAD (ULP2_MAX_PKT_SIZE - ISCSI_PDU_NONPAYLOAD_LEN) |
92 | #define PPOD_PAGES_MAX 4 | 93 | #define PPOD_PAGES_MAX 4 |
93 | #define PPOD_PAGES_SHIFT 2 /* 4 pages per pod */ | 94 | #define PPOD_PAGES_SHIFT 2 /* 4 pages per pod */ |
94 | 95 | ||
diff --git a/drivers/scsi/cxgb3i/cxgb3i_init.c b/drivers/scsi/cxgb3i/cxgb3i_init.c index 091ecb4d9f3d..1ce9f244e46c 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_init.c +++ b/drivers/scsi/cxgb3i/cxgb3i_init.c | |||
@@ -12,8 +12,8 @@ | |||
12 | #include "cxgb3i.h" | 12 | #include "cxgb3i.h" |
13 | 13 | ||
14 | #define DRV_MODULE_NAME "cxgb3i" | 14 | #define DRV_MODULE_NAME "cxgb3i" |
15 | #define DRV_MODULE_VERSION "1.0.0" | 15 | #define DRV_MODULE_VERSION "1.0.1" |
16 | #define DRV_MODULE_RELDATE "Jun. 1, 2008" | 16 | #define DRV_MODULE_RELDATE "Jan. 2009" |
17 | 17 | ||
18 | static char version[] = | 18 | static char version[] = |
19 | "Chelsio S3xx iSCSI Driver " DRV_MODULE_NAME | 19 | "Chelsio S3xx iSCSI Driver " DRV_MODULE_NAME |
diff --git a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c index d83464b9b3f9..fa2a44f37b36 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_iscsi.c +++ b/drivers/scsi/cxgb3i/cxgb3i_iscsi.c | |||
@@ -364,7 +364,8 @@ cxgb3i_session_create(struct iscsi_endpoint *ep, u16 cmds_max, u16 qdepth, | |||
364 | 364 | ||
365 | cls_session = iscsi_session_setup(&cxgb3i_iscsi_transport, shost, | 365 | cls_session = iscsi_session_setup(&cxgb3i_iscsi_transport, shost, |
366 | cmds_max, | 366 | cmds_max, |
367 | sizeof(struct iscsi_tcp_task), | 367 | sizeof(struct iscsi_tcp_task) + |
368 | sizeof(struct cxgb3i_task_data), | ||
368 | initial_cmdsn, ISCSI_MAX_TARGET); | 369 | initial_cmdsn, ISCSI_MAX_TARGET); |
369 | if (!cls_session) | 370 | if (!cls_session) |
370 | return NULL; | 371 | return NULL; |
@@ -402,17 +403,15 @@ static inline int cxgb3i_conn_max_xmit_dlength(struct iscsi_conn *conn) | |||
402 | { | 403 | { |
403 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; | 404 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; |
404 | struct cxgb3i_conn *cconn = tcp_conn->dd_data; | 405 | struct cxgb3i_conn *cconn = tcp_conn->dd_data; |
405 | unsigned int max = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD, | 406 | unsigned int max = max(512 * MAX_SKB_FRAGS, SKB_TX_HEADROOM); |
406 | cconn->hba->snic->tx_max_size - | ||
407 | ISCSI_PDU_NONPAYLOAD_MAX); | ||
408 | 407 | ||
408 | max = min(cconn->hba->snic->tx_max_size, max); | ||
409 | if (conn->max_xmit_dlength) | 409 | if (conn->max_xmit_dlength) |
410 | conn->max_xmit_dlength = min_t(unsigned int, | 410 | conn->max_xmit_dlength = min(conn->max_xmit_dlength, max); |
411 | conn->max_xmit_dlength, max); | ||
412 | else | 411 | else |
413 | conn->max_xmit_dlength = max; | 412 | conn->max_xmit_dlength = max; |
414 | align_pdu_size(conn->max_xmit_dlength); | 413 | align_pdu_size(conn->max_xmit_dlength); |
415 | cxgb3i_log_info("conn 0x%p, max xmit %u.\n", | 414 | cxgb3i_api_debug("conn 0x%p, max xmit %u.\n", |
416 | conn, conn->max_xmit_dlength); | 415 | conn, conn->max_xmit_dlength); |
417 | return 0; | 416 | return 0; |
418 | } | 417 | } |
@@ -427,9 +426,7 @@ static inline int cxgb3i_conn_max_recv_dlength(struct iscsi_conn *conn) | |||
427 | { | 426 | { |
428 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; | 427 | struct iscsi_tcp_conn *tcp_conn = conn->dd_data; |
429 | struct cxgb3i_conn *cconn = tcp_conn->dd_data; | 428 | struct cxgb3i_conn *cconn = tcp_conn->dd_data; |
430 | unsigned int max = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD, | 429 | unsigned int max = cconn->hba->snic->rx_max_size; |
431 | cconn->hba->snic->rx_max_size - | ||
432 | ISCSI_PDU_NONPAYLOAD_MAX); | ||
433 | 430 | ||
434 | align_pdu_size(max); | 431 | align_pdu_size(max); |
435 | if (conn->max_recv_dlength) { | 432 | if (conn->max_recv_dlength) { |
@@ -439,8 +436,7 @@ static inline int cxgb3i_conn_max_recv_dlength(struct iscsi_conn *conn) | |||
439 | conn->max_recv_dlength, max); | 436 | conn->max_recv_dlength, max); |
440 | return -EINVAL; | 437 | return -EINVAL; |
441 | } | 438 | } |
442 | conn->max_recv_dlength = min_t(unsigned int, | 439 | conn->max_recv_dlength = min(conn->max_recv_dlength, max); |
443 | conn->max_recv_dlength, max); | ||
444 | align_pdu_size(conn->max_recv_dlength); | 440 | align_pdu_size(conn->max_recv_dlength); |
445 | } else | 441 | } else |
446 | conn->max_recv_dlength = max; | 442 | conn->max_recv_dlength = max; |
@@ -844,7 +840,7 @@ static struct scsi_host_template cxgb3i_host_template = { | |||
844 | .proc_name = "cxgb3i", | 840 | .proc_name = "cxgb3i", |
845 | .queuecommand = iscsi_queuecommand, | 841 | .queuecommand = iscsi_queuecommand, |
846 | .change_queue_depth = iscsi_change_queue_depth, | 842 | .change_queue_depth = iscsi_change_queue_depth, |
847 | .can_queue = 128 * (ISCSI_DEF_XMIT_CMDS_MAX - 1), | 843 | .can_queue = CXGB3I_SCSI_QDEPTH_DFLT - 1, |
848 | .sg_tablesize = SG_ALL, | 844 | .sg_tablesize = SG_ALL, |
849 | .max_sectors = 0xFFFF, | 845 | .max_sectors = 0xFFFF, |
850 | .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN, | 846 | .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN, |
diff --git a/drivers/scsi/cxgb3i/cxgb3i_offload.c b/drivers/scsi/cxgb3i/cxgb3i_offload.c index a865f1fefe8b..de3b3b614cca 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_offload.c +++ b/drivers/scsi/cxgb3i/cxgb3i_offload.c | |||
@@ -23,19 +23,19 @@ | |||
23 | #include "cxgb3i_ddp.h" | 23 | #include "cxgb3i_ddp.h" |
24 | 24 | ||
25 | #ifdef __DEBUG_C3CN_CONN__ | 25 | #ifdef __DEBUG_C3CN_CONN__ |
26 | #define c3cn_conn_debug cxgb3i_log_info | 26 | #define c3cn_conn_debug cxgb3i_log_debug |
27 | #else | 27 | #else |
28 | #define c3cn_conn_debug(fmt...) | 28 | #define c3cn_conn_debug(fmt...) |
29 | #endif | 29 | #endif |
30 | 30 | ||
31 | #ifdef __DEBUG_C3CN_TX__ | 31 | #ifdef __DEBUG_C3CN_TX__ |
32 | #define c3cn_tx_debug cxgb3i_log_debug | 32 | #define c3cn_tx_debug cxgb3i_log_debug |
33 | #else | 33 | #else |
34 | #define c3cn_tx_debug(fmt...) | 34 | #define c3cn_tx_debug(fmt...) |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #ifdef __DEBUG_C3CN_RX__ | 37 | #ifdef __DEBUG_C3CN_RX__ |
38 | #define c3cn_rx_debug cxgb3i_log_debug | 38 | #define c3cn_rx_debug cxgb3i_log_debug |
39 | #else | 39 | #else |
40 | #define c3cn_rx_debug(fmt...) | 40 | #define c3cn_rx_debug(fmt...) |
41 | #endif | 41 | #endif |
@@ -47,9 +47,9 @@ static int cxgb3_rcv_win = 256 * 1024; | |||
47 | module_param(cxgb3_rcv_win, int, 0644); | 47 | module_param(cxgb3_rcv_win, int, 0644); |
48 | MODULE_PARM_DESC(cxgb3_rcv_win, "TCP receive window in bytes (default=256KB)"); | 48 | MODULE_PARM_DESC(cxgb3_rcv_win, "TCP receive window in bytes (default=256KB)"); |
49 | 49 | ||
50 | static int cxgb3_snd_win = 64 * 1024; | 50 | static int cxgb3_snd_win = 128 * 1024; |
51 | module_param(cxgb3_snd_win, int, 0644); | 51 | module_param(cxgb3_snd_win, int, 0644); |
52 | MODULE_PARM_DESC(cxgb3_snd_win, "TCP send window in bytes (default=64KB)"); | 52 | MODULE_PARM_DESC(cxgb3_snd_win, "TCP send window in bytes (default=128KB)"); |
53 | 53 | ||
54 | static int cxgb3_rx_credit_thres = 10 * 1024; | 54 | static int cxgb3_rx_credit_thres = 10 * 1024; |
55 | module_param(cxgb3_rx_credit_thres, int, 0644); | 55 | module_param(cxgb3_rx_credit_thres, int, 0644); |
@@ -301,8 +301,8 @@ static void act_open_req_arp_failure(struct t3cdev *dev, struct sk_buff *skb) | |||
301 | static void skb_entail(struct s3_conn *c3cn, struct sk_buff *skb, | 301 | static void skb_entail(struct s3_conn *c3cn, struct sk_buff *skb, |
302 | int flags) | 302 | int flags) |
303 | { | 303 | { |
304 | CXGB3_SKB_CB(skb)->seq = c3cn->write_seq; | 304 | skb_tcp_seq(skb) = c3cn->write_seq; |
305 | CXGB3_SKB_CB(skb)->flags = flags; | 305 | skb_flags(skb) = flags; |
306 | __skb_queue_tail(&c3cn->write_queue, skb); | 306 | __skb_queue_tail(&c3cn->write_queue, skb); |
307 | } | 307 | } |
308 | 308 | ||
@@ -457,12 +457,9 @@ static unsigned int wrlen __read_mostly; | |||
457 | * The number of WRs needed for an skb depends on the number of fragments | 457 | * The number of WRs needed for an skb depends on the number of fragments |
458 | * in the skb and whether it has any payload in its main body. This maps the | 458 | * in the skb and whether it has any payload in its main body. This maps the |
459 | * length of the gather list represented by an skb into the # of necessary WRs. | 459 | * length of the gather list represented by an skb into the # of necessary WRs. |
460 | * | 460 | * The extra two fragments are for iscsi bhs and payload padding. |
461 | * The max. length of an skb is controlled by the max pdu size which is ~16K. | ||
462 | * Also, assume the min. fragment length is the sector size (512), then add | ||
463 | * extra fragment counts for iscsi bhs and payload padding. | ||
464 | */ | 461 | */ |
465 | #define SKB_WR_LIST_SIZE (16384/512 + 3) | 462 | #define SKB_WR_LIST_SIZE (MAX_SKB_FRAGS + 2) |
466 | static unsigned int skb_wrs[SKB_WR_LIST_SIZE] __read_mostly; | 463 | static unsigned int skb_wrs[SKB_WR_LIST_SIZE] __read_mostly; |
467 | 464 | ||
468 | static void s3_init_wr_tab(unsigned int wr_len) | 465 | static void s3_init_wr_tab(unsigned int wr_len) |
@@ -485,7 +482,7 @@ static void s3_init_wr_tab(unsigned int wr_len) | |||
485 | 482 | ||
486 | static inline void reset_wr_list(struct s3_conn *c3cn) | 483 | static inline void reset_wr_list(struct s3_conn *c3cn) |
487 | { | 484 | { |
488 | c3cn->wr_pending_head = NULL; | 485 | c3cn->wr_pending_head = c3cn->wr_pending_tail = NULL; |
489 | } | 486 | } |
490 | 487 | ||
491 | /* | 488 | /* |
@@ -496,7 +493,7 @@ static inline void reset_wr_list(struct s3_conn *c3cn) | |||
496 | static inline void enqueue_wr(struct s3_conn *c3cn, | 493 | static inline void enqueue_wr(struct s3_conn *c3cn, |
497 | struct sk_buff *skb) | 494 | struct sk_buff *skb) |
498 | { | 495 | { |
499 | skb_wr_data(skb) = NULL; | 496 | skb_tx_wr_next(skb) = NULL; |
500 | 497 | ||
501 | /* | 498 | /* |
502 | * We want to take an extra reference since both us and the driver | 499 | * We want to take an extra reference since both us and the driver |
@@ -509,10 +506,22 @@ static inline void enqueue_wr(struct s3_conn *c3cn, | |||
509 | if (!c3cn->wr_pending_head) | 506 | if (!c3cn->wr_pending_head) |
510 | c3cn->wr_pending_head = skb; | 507 | c3cn->wr_pending_head = skb; |
511 | else | 508 | else |
512 | skb_wr_data(skb) = skb; | 509 | skb_tx_wr_next(c3cn->wr_pending_tail) = skb; |
513 | c3cn->wr_pending_tail = skb; | 510 | c3cn->wr_pending_tail = skb; |
514 | } | 511 | } |
515 | 512 | ||
513 | static int count_pending_wrs(struct s3_conn *c3cn) | ||
514 | { | ||
515 | int n = 0; | ||
516 | const struct sk_buff *skb = c3cn->wr_pending_head; | ||
517 | |||
518 | while (skb) { | ||
519 | n += skb->csum; | ||
520 | skb = skb_tx_wr_next(skb); | ||
521 | } | ||
522 | return n; | ||
523 | } | ||
524 | |||
516 | static inline struct sk_buff *peek_wr(const struct s3_conn *c3cn) | 525 | static inline struct sk_buff *peek_wr(const struct s3_conn *c3cn) |
517 | { | 526 | { |
518 | return c3cn->wr_pending_head; | 527 | return c3cn->wr_pending_head; |
@@ -529,8 +538,8 @@ static inline struct sk_buff *dequeue_wr(struct s3_conn *c3cn) | |||
529 | 538 | ||
530 | if (likely(skb)) { | 539 | if (likely(skb)) { |
531 | /* Don't bother clearing the tail */ | 540 | /* Don't bother clearing the tail */ |
532 | c3cn->wr_pending_head = skb_wr_data(skb); | 541 | c3cn->wr_pending_head = skb_tx_wr_next(skb); |
533 | skb_wr_data(skb) = NULL; | 542 | skb_tx_wr_next(skb) = NULL; |
534 | } | 543 | } |
535 | return skb; | 544 | return skb; |
536 | } | 545 | } |
@@ -543,13 +552,14 @@ static void purge_wr_queue(struct s3_conn *c3cn) | |||
543 | } | 552 | } |
544 | 553 | ||
545 | static inline void make_tx_data_wr(struct s3_conn *c3cn, struct sk_buff *skb, | 554 | static inline void make_tx_data_wr(struct s3_conn *c3cn, struct sk_buff *skb, |
546 | int len) | 555 | int len, int req_completion) |
547 | { | 556 | { |
548 | struct tx_data_wr *req; | 557 | struct tx_data_wr *req; |
549 | 558 | ||
550 | skb_reset_transport_header(skb); | 559 | skb_reset_transport_header(skb); |
551 | req = (struct tx_data_wr *)__skb_push(skb, sizeof(*req)); | 560 | req = (struct tx_data_wr *)__skb_push(skb, sizeof(*req)); |
552 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)); | 561 | req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA) | |
562 | (req_completion ? F_WR_COMPL : 0)); | ||
553 | req->wr_lo = htonl(V_WR_TID(c3cn->tid)); | 563 | req->wr_lo = htonl(V_WR_TID(c3cn->tid)); |
554 | req->sndseq = htonl(c3cn->snd_nxt); | 564 | req->sndseq = htonl(c3cn->snd_nxt); |
555 | /* len includes the length of any HW ULP additions */ | 565 | /* len includes the length of any HW ULP additions */ |
@@ -592,7 +602,7 @@ static int c3cn_push_tx_frames(struct s3_conn *c3cn, int req_completion) | |||
592 | 602 | ||
593 | if (unlikely(c3cn->state == C3CN_STATE_CONNECTING || | 603 | if (unlikely(c3cn->state == C3CN_STATE_CONNECTING || |
594 | c3cn->state == C3CN_STATE_CLOSE_WAIT_1 || | 604 | c3cn->state == C3CN_STATE_CLOSE_WAIT_1 || |
595 | c3cn->state == C3CN_STATE_ABORTING)) { | 605 | c3cn->state >= C3CN_STATE_ABORTING)) { |
596 | c3cn_tx_debug("c3cn 0x%p, in closing state %u.\n", | 606 | c3cn_tx_debug("c3cn 0x%p, in closing state %u.\n", |
597 | c3cn, c3cn->state); | 607 | c3cn, c3cn->state); |
598 | return 0; | 608 | return 0; |
@@ -615,7 +625,7 @@ static int c3cn_push_tx_frames(struct s3_conn *c3cn, int req_completion) | |||
615 | if (c3cn->wr_avail < wrs_needed) { | 625 | if (c3cn->wr_avail < wrs_needed) { |
616 | c3cn_tx_debug("c3cn 0x%p, skb len %u/%u, frag %u, " | 626 | c3cn_tx_debug("c3cn 0x%p, skb len %u/%u, frag %u, " |
617 | "wr %d < %u.\n", | 627 | "wr %d < %u.\n", |
618 | c3cn, skb->len, skb->datalen, frags, | 628 | c3cn, skb->len, skb->data_len, frags, |
619 | wrs_needed, c3cn->wr_avail); | 629 | wrs_needed, c3cn->wr_avail); |
620 | break; | 630 | break; |
621 | } | 631 | } |
@@ -627,20 +637,24 @@ static int c3cn_push_tx_frames(struct s3_conn *c3cn, int req_completion) | |||
627 | c3cn->wr_unacked += wrs_needed; | 637 | c3cn->wr_unacked += wrs_needed; |
628 | enqueue_wr(c3cn, skb); | 638 | enqueue_wr(c3cn, skb); |
629 | 639 | ||
630 | if (likely(CXGB3_SKB_CB(skb)->flags & C3CB_FLAG_NEED_HDR)) { | 640 | c3cn_tx_debug("c3cn 0x%p, enqueue, skb len %u/%u, frag %u, " |
631 | len += ulp_extra_len(skb); | 641 | "wr %d, left %u, unack %u.\n", |
632 | make_tx_data_wr(c3cn, skb, len); | 642 | c3cn, skb->len, skb->data_len, frags, |
633 | c3cn->snd_nxt += len; | 643 | wrs_needed, c3cn->wr_avail, c3cn->wr_unacked); |
634 | if ((req_completion | 644 | |
635 | && c3cn->wr_unacked == wrs_needed) | ||
636 | || (CXGB3_SKB_CB(skb)->flags & C3CB_FLAG_COMPL) | ||
637 | || c3cn->wr_unacked >= c3cn->wr_max / 2) { | ||
638 | struct work_request_hdr *wr = cplhdr(skb); | ||
639 | 645 | ||
640 | wr->wr_hi |= htonl(F_WR_COMPL); | 646 | if (likely(skb_flags(skb) & C3CB_FLAG_NEED_HDR)) { |
647 | if ((req_completion && | ||
648 | c3cn->wr_unacked == wrs_needed) || | ||
649 | (skb_flags(skb) & C3CB_FLAG_COMPL) || | ||
650 | c3cn->wr_unacked >= c3cn->wr_max / 2) { | ||
651 | req_completion = 1; | ||
641 | c3cn->wr_unacked = 0; | 652 | c3cn->wr_unacked = 0; |
642 | } | 653 | } |
643 | CXGB3_SKB_CB(skb)->flags &= ~C3CB_FLAG_NEED_HDR; | 654 | len += ulp_extra_len(skb); |
655 | make_tx_data_wr(c3cn, skb, len, req_completion); | ||
656 | c3cn->snd_nxt += len; | ||
657 | skb_flags(skb) &= ~C3CB_FLAG_NEED_HDR; | ||
644 | } | 658 | } |
645 | 659 | ||
646 | total_size += skb->truesize; | 660 | total_size += skb->truesize; |
@@ -735,8 +749,11 @@ static void process_act_establish(struct s3_conn *c3cn, struct sk_buff *skb) | |||
735 | if (unlikely(c3cn_flag(c3cn, C3CN_ACTIVE_CLOSE_NEEDED))) | 749 | if (unlikely(c3cn_flag(c3cn, C3CN_ACTIVE_CLOSE_NEEDED))) |
736 | /* upper layer has requested closing */ | 750 | /* upper layer has requested closing */ |
737 | send_abort_req(c3cn); | 751 | send_abort_req(c3cn); |
738 | else if (c3cn_push_tx_frames(c3cn, 1)) | 752 | else { |
753 | if (skb_queue_len(&c3cn->write_queue)) | ||
754 | c3cn_push_tx_frames(c3cn, 1); | ||
739 | cxgb3i_conn_tx_open(c3cn); | 755 | cxgb3i_conn_tx_open(c3cn); |
756 | } | ||
740 | } | 757 | } |
741 | 758 | ||
742 | static int do_act_establish(struct t3cdev *cdev, struct sk_buff *skb, | 759 | static int do_act_establish(struct t3cdev *cdev, struct sk_buff *skb, |
@@ -1082,8 +1099,8 @@ static void process_rx_iscsi_hdr(struct s3_conn *c3cn, struct sk_buff *skb) | |||
1082 | return; | 1099 | return; |
1083 | } | 1100 | } |
1084 | 1101 | ||
1085 | CXGB3_SKB_CB(skb)->seq = ntohl(hdr_cpl->seq); | 1102 | skb_tcp_seq(skb) = ntohl(hdr_cpl->seq); |
1086 | CXGB3_SKB_CB(skb)->flags = 0; | 1103 | skb_flags(skb) = 0; |
1087 | 1104 | ||
1088 | skb_reset_transport_header(skb); | 1105 | skb_reset_transport_header(skb); |
1089 | __skb_pull(skb, sizeof(struct cpl_iscsi_hdr)); | 1106 | __skb_pull(skb, sizeof(struct cpl_iscsi_hdr)); |
@@ -1103,12 +1120,12 @@ static void process_rx_iscsi_hdr(struct s3_conn *c3cn, struct sk_buff *skb) | |||
1103 | goto abort_conn; | 1120 | goto abort_conn; |
1104 | 1121 | ||
1105 | skb_ulp_mode(skb) = ULP2_FLAG_DATA_READY; | 1122 | skb_ulp_mode(skb) = ULP2_FLAG_DATA_READY; |
1106 | skb_ulp_pdulen(skb) = ntohs(ddp_cpl.len); | 1123 | skb_rx_pdulen(skb) = ntohs(ddp_cpl.len); |
1107 | skb_ulp_ddigest(skb) = ntohl(ddp_cpl.ulp_crc); | 1124 | skb_rx_ddigest(skb) = ntohl(ddp_cpl.ulp_crc); |
1108 | status = ntohl(ddp_cpl.ddp_status); | 1125 | status = ntohl(ddp_cpl.ddp_status); |
1109 | 1126 | ||
1110 | c3cn_rx_debug("rx skb 0x%p, len %u, pdulen %u, ddp status 0x%x.\n", | 1127 | c3cn_rx_debug("rx skb 0x%p, len %u, pdulen %u, ddp status 0x%x.\n", |
1111 | skb, skb->len, skb_ulp_pdulen(skb), status); | 1128 | skb, skb->len, skb_rx_pdulen(skb), status); |
1112 | 1129 | ||
1113 | if (status & (1 << RX_DDP_STATUS_HCRC_SHIFT)) | 1130 | if (status & (1 << RX_DDP_STATUS_HCRC_SHIFT)) |
1114 | skb_ulp_mode(skb) |= ULP2_FLAG_HCRC_ERROR; | 1131 | skb_ulp_mode(skb) |= ULP2_FLAG_HCRC_ERROR; |
@@ -1126,7 +1143,7 @@ static void process_rx_iscsi_hdr(struct s3_conn *c3cn, struct sk_buff *skb) | |||
1126 | } else if (status & (1 << RX_DDP_STATUS_DDP_SHIFT)) | 1143 | } else if (status & (1 << RX_DDP_STATUS_DDP_SHIFT)) |
1127 | skb_ulp_mode(skb) |= ULP2_FLAG_DATA_DDPED; | 1144 | skb_ulp_mode(skb) |= ULP2_FLAG_DATA_DDPED; |
1128 | 1145 | ||
1129 | c3cn->rcv_nxt = ntohl(ddp_cpl.seq) + skb_ulp_pdulen(skb); | 1146 | c3cn->rcv_nxt = ntohl(ddp_cpl.seq) + skb_rx_pdulen(skb); |
1130 | __pskb_trim(skb, len); | 1147 | __pskb_trim(skb, len); |
1131 | __skb_queue_tail(&c3cn->receive_queue, skb); | 1148 | __skb_queue_tail(&c3cn->receive_queue, skb); |
1132 | cxgb3i_conn_pdu_ready(c3cn); | 1149 | cxgb3i_conn_pdu_ready(c3cn); |
@@ -1151,12 +1168,27 @@ static int do_iscsi_hdr(struct t3cdev *t3dev, struct sk_buff *skb, void *ctx) | |||
1151 | * Process an acknowledgment of WR completion. Advance snd_una and send the | 1168 | * Process an acknowledgment of WR completion. Advance snd_una and send the |
1152 | * next batch of work requests from the write queue. | 1169 | * next batch of work requests from the write queue. |
1153 | */ | 1170 | */ |
1171 | static void check_wr_invariants(struct s3_conn *c3cn) | ||
1172 | { | ||
1173 | int pending = count_pending_wrs(c3cn); | ||
1174 | |||
1175 | if (unlikely(c3cn->wr_avail + pending != c3cn->wr_max)) | ||
1176 | cxgb3i_log_error("TID %u: credit imbalance: avail %u, " | ||
1177 | "pending %u, total should be %u\n", | ||
1178 | c3cn->tid, c3cn->wr_avail, pending, | ||
1179 | c3cn->wr_max); | ||
1180 | } | ||
1181 | |||
1154 | static void process_wr_ack(struct s3_conn *c3cn, struct sk_buff *skb) | 1182 | static void process_wr_ack(struct s3_conn *c3cn, struct sk_buff *skb) |
1155 | { | 1183 | { |
1156 | struct cpl_wr_ack *hdr = cplhdr(skb); | 1184 | struct cpl_wr_ack *hdr = cplhdr(skb); |
1157 | unsigned int credits = ntohs(hdr->credits); | 1185 | unsigned int credits = ntohs(hdr->credits); |
1158 | u32 snd_una = ntohl(hdr->snd_una); | 1186 | u32 snd_una = ntohl(hdr->snd_una); |
1159 | 1187 | ||
1188 | c3cn_tx_debug("%u WR credits, avail %u, unack %u, TID %u, state %u.\n", | ||
1189 | credits, c3cn->wr_avail, c3cn->wr_unacked, | ||
1190 | c3cn->tid, c3cn->state); | ||
1191 | |||
1160 | c3cn->wr_avail += credits; | 1192 | c3cn->wr_avail += credits; |
1161 | if (c3cn->wr_unacked > c3cn->wr_max - c3cn->wr_avail) | 1193 | if (c3cn->wr_unacked > c3cn->wr_max - c3cn->wr_avail) |
1162 | c3cn->wr_unacked = c3cn->wr_max - c3cn->wr_avail; | 1194 | c3cn->wr_unacked = c3cn->wr_max - c3cn->wr_avail; |
@@ -1171,6 +1203,17 @@ static void process_wr_ack(struct s3_conn *c3cn, struct sk_buff *skb) | |||
1171 | break; | 1203 | break; |
1172 | } | 1204 | } |
1173 | if (unlikely(credits < p->csum)) { | 1205 | if (unlikely(credits < p->csum)) { |
1206 | struct tx_data_wr *w = cplhdr(p); | ||
1207 | cxgb3i_log_error("TID %u got %u WR credits need %u, " | ||
1208 | "len %u, main body %u, frags %u, " | ||
1209 | "seq # %u, ACK una %u, ACK nxt %u, " | ||
1210 | "WR_AVAIL %u, WRs pending %u\n", | ||
1211 | c3cn->tid, credits, p->csum, p->len, | ||
1212 | p->len - p->data_len, | ||
1213 | skb_shinfo(p)->nr_frags, | ||
1214 | ntohl(w->sndseq), snd_una, | ||
1215 | ntohl(hdr->snd_nxt), c3cn->wr_avail, | ||
1216 | count_pending_wrs(c3cn) - credits); | ||
1174 | p->csum -= credits; | 1217 | p->csum -= credits; |
1175 | break; | 1218 | break; |
1176 | } else { | 1219 | } else { |
@@ -1180,15 +1223,24 @@ static void process_wr_ack(struct s3_conn *c3cn, struct sk_buff *skb) | |||
1180 | } | 1223 | } |
1181 | } | 1224 | } |
1182 | 1225 | ||
1183 | if (unlikely(before(snd_una, c3cn->snd_una))) | 1226 | check_wr_invariants(c3cn); |
1227 | |||
1228 | if (unlikely(before(snd_una, c3cn->snd_una))) { | ||
1229 | cxgb3i_log_error("TID %u, unexpected sequence # %u in WR_ACK " | ||
1230 | "snd_una %u\n", | ||
1231 | c3cn->tid, snd_una, c3cn->snd_una); | ||
1184 | goto out_free; | 1232 | goto out_free; |
1233 | } | ||
1185 | 1234 | ||
1186 | if (c3cn->snd_una != snd_una) { | 1235 | if (c3cn->snd_una != snd_una) { |
1187 | c3cn->snd_una = snd_una; | 1236 | c3cn->snd_una = snd_una; |
1188 | dst_confirm(c3cn->dst_cache); | 1237 | dst_confirm(c3cn->dst_cache); |
1189 | } | 1238 | } |
1190 | 1239 | ||
1191 | if (skb_queue_len(&c3cn->write_queue) && c3cn_push_tx_frames(c3cn, 0)) | 1240 | if (skb_queue_len(&c3cn->write_queue)) { |
1241 | if (c3cn_push_tx_frames(c3cn, 0)) | ||
1242 | cxgb3i_conn_tx_open(c3cn); | ||
1243 | } else | ||
1192 | cxgb3i_conn_tx_open(c3cn); | 1244 | cxgb3i_conn_tx_open(c3cn); |
1193 | out_free: | 1245 | out_free: |
1194 | __kfree_skb(skb); | 1246 | __kfree_skb(skb); |
@@ -1452,7 +1504,7 @@ static void init_offload_conn(struct s3_conn *c3cn, | |||
1452 | struct dst_entry *dst) | 1504 | struct dst_entry *dst) |
1453 | { | 1505 | { |
1454 | BUG_ON(c3cn->cdev != cdev); | 1506 | BUG_ON(c3cn->cdev != cdev); |
1455 | c3cn->wr_max = c3cn->wr_avail = T3C_DATA(cdev)->max_wrs; | 1507 | c3cn->wr_max = c3cn->wr_avail = T3C_DATA(cdev)->max_wrs - 1; |
1456 | c3cn->wr_unacked = 0; | 1508 | c3cn->wr_unacked = 0; |
1457 | c3cn->mss_idx = select_mss(c3cn, dst_mtu(dst)); | 1509 | c3cn->mss_idx = select_mss(c3cn, dst_mtu(dst)); |
1458 | 1510 | ||
@@ -1671,9 +1723,17 @@ int cxgb3i_c3cn_send_pdus(struct s3_conn *c3cn, struct sk_buff *skb) | |||
1671 | goto out_err; | 1723 | goto out_err; |
1672 | } | 1724 | } |
1673 | 1725 | ||
1674 | err = -EPIPE; | ||
1675 | if (c3cn->err) { | 1726 | if (c3cn->err) { |
1676 | c3cn_tx_debug("c3cn 0x%p, err %d.\n", c3cn, c3cn->err); | 1727 | c3cn_tx_debug("c3cn 0x%p, err %d.\n", c3cn, c3cn->err); |
1728 | err = -EPIPE; | ||
1729 | goto out_err; | ||
1730 | } | ||
1731 | |||
1732 | if (c3cn->write_seq - c3cn->snd_una >= cxgb3_snd_win) { | ||
1733 | c3cn_tx_debug("c3cn 0x%p, snd %u - %u > %u.\n", | ||
1734 | c3cn, c3cn->write_seq, c3cn->snd_una, | ||
1735 | cxgb3_snd_win); | ||
1736 | err = -EAGAIN; | ||
1677 | goto out_err; | 1737 | goto out_err; |
1678 | } | 1738 | } |
1679 | 1739 | ||
diff --git a/drivers/scsi/cxgb3i/cxgb3i_offload.h b/drivers/scsi/cxgb3i/cxgb3i_offload.h index d23156907ffd..6344b9eb2589 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_offload.h +++ b/drivers/scsi/cxgb3i/cxgb3i_offload.h | |||
@@ -178,25 +178,33 @@ void cxgb3i_c3cn_release(struct s3_conn *); | |||
178 | * @flag: see C3CB_FLAG_* below | 178 | * @flag: see C3CB_FLAG_* below |
179 | * @ulp_mode: ULP mode/submode of sk_buff | 179 | * @ulp_mode: ULP mode/submode of sk_buff |
180 | * @seq: tcp sequence number | 180 | * @seq: tcp sequence number |
181 | * @ddigest: pdu data digest | ||
182 | * @pdulen: recovered pdu length | ||
183 | * @wr_data: scratch area for tx wr | ||
184 | */ | 181 | */ |
182 | struct cxgb3_skb_rx_cb { | ||
183 | __u32 ddigest; /* data digest */ | ||
184 | __u32 pdulen; /* recovered pdu length */ | ||
185 | }; | ||
186 | |||
187 | struct cxgb3_skb_tx_cb { | ||
188 | struct sk_buff *wr_next; /* next wr */ | ||
189 | }; | ||
190 | |||
185 | struct cxgb3_skb_cb { | 191 | struct cxgb3_skb_cb { |
186 | __u8 flags; | 192 | __u8 flags; |
187 | __u8 ulp_mode; | 193 | __u8 ulp_mode; |
188 | __u32 seq; | 194 | __u32 seq; |
189 | __u32 ddigest; | 195 | union { |
190 | __u32 pdulen; | 196 | struct cxgb3_skb_rx_cb rx; |
191 | struct sk_buff *wr_data; | 197 | struct cxgb3_skb_tx_cb tx; |
198 | }; | ||
192 | }; | 199 | }; |
193 | 200 | ||
194 | #define CXGB3_SKB_CB(skb) ((struct cxgb3_skb_cb *)&((skb)->cb[0])) | 201 | #define CXGB3_SKB_CB(skb) ((struct cxgb3_skb_cb *)&((skb)->cb[0])) |
195 | 202 | #define skb_flags(skb) (CXGB3_SKB_CB(skb)->flags) | |
196 | #define skb_ulp_mode(skb) (CXGB3_SKB_CB(skb)->ulp_mode) | 203 | #define skb_ulp_mode(skb) (CXGB3_SKB_CB(skb)->ulp_mode) |
197 | #define skb_ulp_ddigest(skb) (CXGB3_SKB_CB(skb)->ddigest) | 204 | #define skb_tcp_seq(skb) (CXGB3_SKB_CB(skb)->seq) |
198 | #define skb_ulp_pdulen(skb) (CXGB3_SKB_CB(skb)->pdulen) | 205 | #define skb_rx_ddigest(skb) (CXGB3_SKB_CB(skb)->rx.ddigest) |
199 | #define skb_wr_data(skb) (CXGB3_SKB_CB(skb)->wr_data) | 206 | #define skb_rx_pdulen(skb) (CXGB3_SKB_CB(skb)->rx.pdulen) |
207 | #define skb_tx_wr_next(skb) (CXGB3_SKB_CB(skb)->tx.wr_next) | ||
200 | 208 | ||
201 | enum c3cb_flags { | 209 | enum c3cb_flags { |
202 | C3CB_FLAG_NEED_HDR = 1 << 0, /* packet needs a TX_DATA_WR header */ | 210 | C3CB_FLAG_NEED_HDR = 1 << 0, /* packet needs a TX_DATA_WR header */ |
@@ -217,6 +225,7 @@ struct sge_opaque_hdr { | |||
217 | /* for TX: a skb must have a headroom of at least TX_HEADER_LEN bytes */ | 225 | /* for TX: a skb must have a headroom of at least TX_HEADER_LEN bytes */ |
218 | #define TX_HEADER_LEN \ | 226 | #define TX_HEADER_LEN \ |
219 | (sizeof(struct tx_data_wr) + sizeof(struct sge_opaque_hdr)) | 227 | (sizeof(struct tx_data_wr) + sizeof(struct sge_opaque_hdr)) |
228 | #define SKB_TX_HEADROOM SKB_MAX_HEAD(TX_HEADER_LEN) | ||
220 | 229 | ||
221 | /* | 230 | /* |
222 | * get and set private ip for iscsi traffic | 231 | * get and set private ip for iscsi traffic |
diff --git a/drivers/scsi/cxgb3i/cxgb3i_pdu.c b/drivers/scsi/cxgb3i/cxgb3i_pdu.c index ce7ce8c6094c..17115c230d65 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_pdu.c +++ b/drivers/scsi/cxgb3i/cxgb3i_pdu.c | |||
@@ -32,6 +32,10 @@ | |||
32 | #define cxgb3i_tx_debug(fmt...) | 32 | #define cxgb3i_tx_debug(fmt...) |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | /* always allocate rooms for AHS */ | ||
36 | #define SKB_TX_PDU_HEADER_LEN \ | ||
37 | (sizeof(struct iscsi_hdr) + ISCSI_MAX_AHS_SIZE) | ||
38 | static unsigned int skb_extra_headroom; | ||
35 | static struct page *pad_page; | 39 | static struct page *pad_page; |
36 | 40 | ||
37 | /* | 41 | /* |
@@ -146,12 +150,13 @@ static inline void tx_skb_setmode(struct sk_buff *skb, int hcrc, int dcrc) | |||
146 | 150 | ||
147 | void cxgb3i_conn_cleanup_task(struct iscsi_task *task) | 151 | void cxgb3i_conn_cleanup_task(struct iscsi_task *task) |
148 | { | 152 | { |
149 | struct iscsi_tcp_task *tcp_task = task->dd_data; | 153 | struct cxgb3i_task_data *tdata = task->dd_data + |
154 | sizeof(struct iscsi_tcp_task); | ||
150 | 155 | ||
151 | /* never reached the xmit task callout */ | 156 | /* never reached the xmit task callout */ |
152 | if (tcp_task->dd_data) | 157 | if (tdata->skb) |
153 | kfree_skb(tcp_task->dd_data); | 158 | __kfree_skb(tdata->skb); |
154 | tcp_task->dd_data = NULL; | 159 | memset(tdata, 0, sizeof(struct cxgb3i_task_data)); |
155 | 160 | ||
156 | /* MNC - Do we need a check in case this is called but | 161 | /* MNC - Do we need a check in case this is called but |
157 | * cxgb3i_conn_alloc_pdu has never been called on the task */ | 162 | * cxgb3i_conn_alloc_pdu has never been called on the task */ |
@@ -159,28 +164,102 @@ void cxgb3i_conn_cleanup_task(struct iscsi_task *task) | |||
159 | iscsi_tcp_cleanup_task(task); | 164 | iscsi_tcp_cleanup_task(task); |
160 | } | 165 | } |
161 | 166 | ||
162 | /* | 167 | static int sgl_seek_offset(struct scatterlist *sgl, unsigned int sgcnt, |
163 | * We do not support ahs yet | 168 | unsigned int offset, unsigned int *off, |
164 | */ | 169 | struct scatterlist **sgp) |
170 | { | ||
171 | int i; | ||
172 | struct scatterlist *sg; | ||
173 | |||
174 | for_each_sg(sgl, sg, sgcnt, i) { | ||
175 | if (offset < sg->length) { | ||
176 | *off = offset; | ||
177 | *sgp = sg; | ||
178 | return 0; | ||
179 | } | ||
180 | offset -= sg->length; | ||
181 | } | ||
182 | return -EFAULT; | ||
183 | } | ||
184 | |||
185 | static int sgl_read_to_frags(struct scatterlist *sg, unsigned int sgoffset, | ||
186 | unsigned int dlen, skb_frag_t *frags, | ||
187 | int frag_max) | ||
188 | { | ||
189 | unsigned int datalen = dlen; | ||
190 | unsigned int sglen = sg->length - sgoffset; | ||
191 | struct page *page = sg_page(sg); | ||
192 | int i; | ||
193 | |||
194 | i = 0; | ||
195 | do { | ||
196 | unsigned int copy; | ||
197 | |||
198 | if (!sglen) { | ||
199 | sg = sg_next(sg); | ||
200 | if (!sg) { | ||
201 | cxgb3i_log_error("%s, sg NULL, len %u/%u.\n", | ||
202 | __func__, datalen, dlen); | ||
203 | return -EINVAL; | ||
204 | } | ||
205 | sgoffset = 0; | ||
206 | sglen = sg->length; | ||
207 | page = sg_page(sg); | ||
208 | |||
209 | } | ||
210 | copy = min(datalen, sglen); | ||
211 | if (i && page == frags[i - 1].page && | ||
212 | sgoffset + sg->offset == | ||
213 | frags[i - 1].page_offset + frags[i - 1].size) { | ||
214 | frags[i - 1].size += copy; | ||
215 | } else { | ||
216 | if (i >= frag_max) { | ||
217 | cxgb3i_log_error("%s, too many pages %u, " | ||
218 | "dlen %u.\n", __func__, | ||
219 | frag_max, dlen); | ||
220 | return -EINVAL; | ||
221 | } | ||
222 | |||
223 | frags[i].page = page; | ||
224 | frags[i].page_offset = sg->offset + sgoffset; | ||
225 | frags[i].size = copy; | ||
226 | i++; | ||
227 | } | ||
228 | datalen -= copy; | ||
229 | sgoffset += copy; | ||
230 | sglen -= copy; | ||
231 | } while (datalen); | ||
232 | |||
233 | return i; | ||
234 | } | ||
235 | |||
165 | int cxgb3i_conn_alloc_pdu(struct iscsi_task *task, u8 opcode) | 236 | int cxgb3i_conn_alloc_pdu(struct iscsi_task *task, u8 opcode) |
166 | { | 237 | { |
238 | struct iscsi_conn *conn = task->conn; | ||
167 | struct iscsi_tcp_task *tcp_task = task->dd_data; | 239 | struct iscsi_tcp_task *tcp_task = task->dd_data; |
168 | struct sk_buff *skb; | 240 | struct cxgb3i_task_data *tdata = task->dd_data + sizeof(*tcp_task); |
241 | struct scsi_cmnd *sc = task->sc; | ||
242 | int headroom = SKB_TX_PDU_HEADER_LEN; | ||
169 | 243 | ||
244 | tcp_task->dd_data = tdata; | ||
170 | task->hdr = NULL; | 245 | task->hdr = NULL; |
171 | /* always allocate rooms for AHS */ | 246 | |
172 | skb = alloc_skb(sizeof(struct iscsi_hdr) + ISCSI_MAX_AHS_SIZE + | 247 | /* write command, need to send data pdus */ |
173 | TX_HEADER_LEN, GFP_ATOMIC); | 248 | if (skb_extra_headroom && (opcode == ISCSI_OP_SCSI_DATA_OUT || |
174 | if (!skb) | 249 | (opcode == ISCSI_OP_SCSI_CMD && |
250 | (scsi_bidi_cmnd(sc) || sc->sc_data_direction == DMA_TO_DEVICE)))) | ||
251 | headroom += min(skb_extra_headroom, conn->max_xmit_dlength); | ||
252 | |||
253 | tdata->skb = alloc_skb(TX_HEADER_LEN + headroom, GFP_ATOMIC); | ||
254 | if (!tdata->skb) | ||
175 | return -ENOMEM; | 255 | return -ENOMEM; |
256 | skb_reserve(tdata->skb, TX_HEADER_LEN); | ||
176 | 257 | ||
177 | cxgb3i_tx_debug("task 0x%p, opcode 0x%x, skb 0x%p.\n", | 258 | cxgb3i_tx_debug("task 0x%p, opcode 0x%x, skb 0x%p.\n", |
178 | task, opcode, skb); | 259 | task, opcode, tdata->skb); |
179 | 260 | ||
180 | tcp_task->dd_data = skb; | 261 | task->hdr = (struct iscsi_hdr *)tdata->skb->data; |
181 | skb_reserve(skb, TX_HEADER_LEN); | 262 | task->hdr_max = SKB_TX_PDU_HEADER_LEN; |
182 | task->hdr = (struct iscsi_hdr *)skb->data; | ||
183 | task->hdr_max = sizeof(struct iscsi_hdr); | ||
184 | 263 | ||
185 | /* data_out uses scsi_cmd's itt */ | 264 | /* data_out uses scsi_cmd's itt */ |
186 | if (opcode != ISCSI_OP_SCSI_DATA_OUT) | 265 | if (opcode != ISCSI_OP_SCSI_DATA_OUT) |
@@ -192,13 +271,13 @@ int cxgb3i_conn_alloc_pdu(struct iscsi_task *task, u8 opcode) | |||
192 | int cxgb3i_conn_init_pdu(struct iscsi_task *task, unsigned int offset, | 271 | int cxgb3i_conn_init_pdu(struct iscsi_task *task, unsigned int offset, |
193 | unsigned int count) | 272 | unsigned int count) |
194 | { | 273 | { |
195 | struct iscsi_tcp_task *tcp_task = task->dd_data; | ||
196 | struct sk_buff *skb = tcp_task->dd_data; | ||
197 | struct iscsi_conn *conn = task->conn; | 274 | struct iscsi_conn *conn = task->conn; |
198 | struct page *pg; | 275 | struct iscsi_tcp_task *tcp_task = task->dd_data; |
276 | struct cxgb3i_task_data *tdata = tcp_task->dd_data; | ||
277 | struct sk_buff *skb = tdata->skb; | ||
199 | unsigned int datalen = count; | 278 | unsigned int datalen = count; |
200 | int i, padlen = iscsi_padding(count); | 279 | int i, padlen = iscsi_padding(count); |
201 | skb_frag_t *frag; | 280 | struct page *pg; |
202 | 281 | ||
203 | cxgb3i_tx_debug("task 0x%p,0x%p, offset %u, count %u, skb 0x%p.\n", | 282 | cxgb3i_tx_debug("task 0x%p,0x%p, offset %u, count %u, skb 0x%p.\n", |
204 | task, task->sc, offset, count, skb); | 283 | task, task->sc, offset, count, skb); |
@@ -209,90 +288,94 @@ int cxgb3i_conn_init_pdu(struct iscsi_task *task, unsigned int offset, | |||
209 | return 0; | 288 | return 0; |
210 | 289 | ||
211 | if (task->sc) { | 290 | if (task->sc) { |
212 | struct scatterlist *sg; | 291 | struct scsi_data_buffer *sdb = scsi_out(task->sc); |
213 | struct scsi_data_buffer *sdb; | 292 | struct scatterlist *sg = NULL; |
214 | unsigned int sgoffset = offset; | 293 | int err; |
215 | struct page *sgpg; | 294 | |
216 | unsigned int sglen; | 295 | tdata->offset = offset; |
217 | 296 | tdata->count = count; | |
218 | sdb = scsi_out(task->sc); | 297 | err = sgl_seek_offset(sdb->table.sgl, sdb->table.nents, |
219 | sg = sdb->table.sgl; | 298 | tdata->offset, &tdata->sgoffset, &sg); |
220 | 299 | if (err < 0) { | |
221 | for_each_sg(sdb->table.sgl, sg, sdb->table.nents, i) { | 300 | cxgb3i_log_warn("tpdu, sgl %u, bad offset %u/%u.\n", |
222 | cxgb3i_tx_debug("sg %d, page 0x%p, len %u offset %u\n", | 301 | sdb->table.nents, tdata->offset, |
223 | i, sg_page(sg), sg->length, sg->offset); | 302 | sdb->length); |
224 | 303 | return err; | |
225 | if (sgoffset < sg->length) | ||
226 | break; | ||
227 | sgoffset -= sg->length; | ||
228 | } | 304 | } |
229 | sgpg = sg_page(sg); | 305 | err = sgl_read_to_frags(sg, tdata->sgoffset, tdata->count, |
230 | sglen = sg->length - sgoffset; | 306 | tdata->frags, MAX_PDU_FRAGS); |
231 | 307 | if (err < 0) { | |
232 | do { | 308 | cxgb3i_log_warn("tpdu, sgl %u, bad offset %u + %u.\n", |
233 | int j = skb_shinfo(skb)->nr_frags; | 309 | sdb->table.nents, tdata->offset, |
234 | unsigned int copy; | 310 | tdata->count); |
235 | 311 | return err; | |
236 | if (!sglen) { | 312 | } |
237 | sg = sg_next(sg); | 313 | tdata->nr_frags = err; |
238 | sgpg = sg_page(sg); | 314 | |
239 | sgoffset = 0; | 315 | if (tdata->nr_frags > MAX_SKB_FRAGS || |
240 | sglen = sg->length; | 316 | (padlen && tdata->nr_frags == MAX_SKB_FRAGS)) { |
241 | ++i; | 317 | char *dst = skb->data + task->hdr_len; |
318 | skb_frag_t *frag = tdata->frags; | ||
319 | |||
320 | /* data fits in the skb's headroom */ | ||
321 | for (i = 0; i < tdata->nr_frags; i++, frag++) { | ||
322 | char *src = kmap_atomic(frag->page, | ||
323 | KM_SOFTIRQ0); | ||
324 | |||
325 | memcpy(dst, src+frag->page_offset, frag->size); | ||
326 | dst += frag->size; | ||
327 | kunmap_atomic(src, KM_SOFTIRQ0); | ||
242 | } | 328 | } |
243 | copy = min(sglen, datalen); | 329 | if (padlen) { |
244 | if (j && skb_can_coalesce(skb, j, sgpg, | 330 | memset(dst, 0, padlen); |
245 | sg->offset + sgoffset)) { | 331 | padlen = 0; |
246 | skb_shinfo(skb)->frags[j - 1].size += copy; | ||
247 | } else { | ||
248 | get_page(sgpg); | ||
249 | skb_fill_page_desc(skb, j, sgpg, | ||
250 | sg->offset + sgoffset, copy); | ||
251 | } | 332 | } |
252 | sgoffset += copy; | 333 | skb_put(skb, count + padlen); |
253 | sglen -= copy; | 334 | } else { |
254 | datalen -= copy; | 335 | /* data fit into frag_list */ |
255 | } while (datalen); | 336 | for (i = 0; i < tdata->nr_frags; i++) |
337 | get_page(tdata->frags[i].page); | ||
338 | |||
339 | memcpy(skb_shinfo(skb)->frags, tdata->frags, | ||
340 | sizeof(skb_frag_t) * tdata->nr_frags); | ||
341 | skb_shinfo(skb)->nr_frags = tdata->nr_frags; | ||
342 | skb->len += count; | ||
343 | skb->data_len += count; | ||
344 | skb->truesize += count; | ||
345 | } | ||
346 | |||
256 | } else { | 347 | } else { |
257 | pg = virt_to_page(task->data); | 348 | pg = virt_to_page(task->data); |
258 | 349 | ||
259 | while (datalen) { | 350 | get_page(pg); |
260 | i = skb_shinfo(skb)->nr_frags; | 351 | skb_fill_page_desc(skb, 0, pg, offset_in_page(task->data), |
261 | frag = &skb_shinfo(skb)->frags[i]; | 352 | count); |
262 | 353 | skb->len += count; | |
263 | get_page(pg); | 354 | skb->data_len += count; |
264 | frag->page = pg; | 355 | skb->truesize += count; |
265 | frag->page_offset = 0; | ||
266 | frag->size = min((unsigned int)PAGE_SIZE, datalen); | ||
267 | |||
268 | skb_shinfo(skb)->nr_frags++; | ||
269 | datalen -= frag->size; | ||
270 | pg++; | ||
271 | } | ||
272 | } | 356 | } |
273 | 357 | ||
274 | if (padlen) { | 358 | if (padlen) { |
275 | i = skb_shinfo(skb)->nr_frags; | 359 | i = skb_shinfo(skb)->nr_frags; |
276 | frag = &skb_shinfo(skb)->frags[i]; | 360 | get_page(pad_page); |
277 | frag->page = pad_page; | 361 | skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags, pad_page, 0, |
278 | frag->page_offset = 0; | 362 | padlen); |
279 | frag->size = padlen; | 363 | |
280 | skb_shinfo(skb)->nr_frags++; | 364 | skb->data_len += padlen; |
365 | skb->truesize += padlen; | ||
366 | skb->len += padlen; | ||
281 | } | 367 | } |
282 | 368 | ||
283 | datalen = count + padlen; | ||
284 | skb->data_len += datalen; | ||
285 | skb->truesize += datalen; | ||
286 | skb->len += datalen; | ||
287 | return 0; | 369 | return 0; |
288 | } | 370 | } |
289 | 371 | ||
290 | int cxgb3i_conn_xmit_pdu(struct iscsi_task *task) | 372 | int cxgb3i_conn_xmit_pdu(struct iscsi_task *task) |
291 | { | 373 | { |
292 | struct iscsi_tcp_task *tcp_task = task->dd_data; | ||
293 | struct sk_buff *skb = tcp_task->dd_data; | ||
294 | struct iscsi_tcp_conn *tcp_conn = task->conn->dd_data; | 374 | struct iscsi_tcp_conn *tcp_conn = task->conn->dd_data; |
295 | struct cxgb3i_conn *cconn = tcp_conn->dd_data; | 375 | struct cxgb3i_conn *cconn = tcp_conn->dd_data; |
376 | struct iscsi_tcp_task *tcp_task = task->dd_data; | ||
377 | struct cxgb3i_task_data *tdata = tcp_task->dd_data; | ||
378 | struct sk_buff *skb = tdata->skb; | ||
296 | unsigned int datalen; | 379 | unsigned int datalen; |
297 | int err; | 380 | int err; |
298 | 381 | ||
@@ -300,13 +383,14 @@ int cxgb3i_conn_xmit_pdu(struct iscsi_task *task) | |||
300 | return 0; | 383 | return 0; |
301 | 384 | ||
302 | datalen = skb->data_len; | 385 | datalen = skb->data_len; |
303 | tcp_task->dd_data = NULL; | 386 | tdata->skb = NULL; |
304 | err = cxgb3i_c3cn_send_pdus(cconn->cep->c3cn, skb); | 387 | err = cxgb3i_c3cn_send_pdus(cconn->cep->c3cn, skb); |
305 | cxgb3i_tx_debug("task 0x%p, skb 0x%p, len %u/%u, rv %d.\n", | ||
306 | task, skb, skb->len, skb->data_len, err); | ||
307 | if (err > 0) { | 388 | if (err > 0) { |
308 | int pdulen = err; | 389 | int pdulen = err; |
309 | 390 | ||
391 | cxgb3i_tx_debug("task 0x%p, skb 0x%p, len %u/%u, rv %d.\n", | ||
392 | task, skb, skb->len, skb->data_len, err); | ||
393 | |||
310 | if (task->conn->hdrdgst_en) | 394 | if (task->conn->hdrdgst_en) |
311 | pdulen += ISCSI_DIGEST_SIZE; | 395 | pdulen += ISCSI_DIGEST_SIZE; |
312 | if (datalen && task->conn->datadgst_en) | 396 | if (datalen && task->conn->datadgst_en) |
@@ -325,12 +409,14 @@ int cxgb3i_conn_xmit_pdu(struct iscsi_task *task) | |||
325 | return err; | 409 | return err; |
326 | } | 410 | } |
327 | /* reset skb to send when we are called again */ | 411 | /* reset skb to send when we are called again */ |
328 | tcp_task->dd_data = skb; | 412 | tdata->skb = skb; |
329 | return -EAGAIN; | 413 | return -EAGAIN; |
330 | } | 414 | } |
331 | 415 | ||
332 | int cxgb3i_pdu_init(void) | 416 | int cxgb3i_pdu_init(void) |
333 | { | 417 | { |
418 | if (SKB_TX_HEADROOM > (512 * MAX_SKB_FRAGS)) | ||
419 | skb_extra_headroom = SKB_TX_HEADROOM; | ||
334 | pad_page = alloc_page(GFP_KERNEL); | 420 | pad_page = alloc_page(GFP_KERNEL); |
335 | if (!pad_page) | 421 | if (!pad_page) |
336 | return -ENOMEM; | 422 | return -ENOMEM; |
@@ -366,7 +452,9 @@ void cxgb3i_conn_pdu_ready(struct s3_conn *c3cn) | |||
366 | skb = skb_peek(&c3cn->receive_queue); | 452 | skb = skb_peek(&c3cn->receive_queue); |
367 | while (!err && skb) { | 453 | while (!err && skb) { |
368 | __skb_unlink(skb, &c3cn->receive_queue); | 454 | __skb_unlink(skb, &c3cn->receive_queue); |
369 | read += skb_ulp_pdulen(skb); | 455 | read += skb_rx_pdulen(skb); |
456 | cxgb3i_rx_debug("conn 0x%p, cn 0x%p, rx skb 0x%p, pdulen %u.\n", | ||
457 | conn, c3cn, skb, skb_rx_pdulen(skb)); | ||
370 | err = cxgb3i_conn_read_pdu_skb(conn, skb); | 458 | err = cxgb3i_conn_read_pdu_skb(conn, skb); |
371 | __kfree_skb(skb); | 459 | __kfree_skb(skb); |
372 | skb = skb_peek(&c3cn->receive_queue); | 460 | skb = skb_peek(&c3cn->receive_queue); |
@@ -377,6 +465,11 @@ void cxgb3i_conn_pdu_ready(struct s3_conn *c3cn) | |||
377 | cxgb3i_c3cn_rx_credits(c3cn, read); | 465 | cxgb3i_c3cn_rx_credits(c3cn, read); |
378 | } | 466 | } |
379 | conn->rxdata_octets += read; | 467 | conn->rxdata_octets += read; |
468 | |||
469 | if (err) { | ||
470 | cxgb3i_log_info("conn 0x%p rx failed err %d.\n", conn, err); | ||
471 | iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); | ||
472 | } | ||
380 | } | 473 | } |
381 | 474 | ||
382 | void cxgb3i_conn_tx_open(struct s3_conn *c3cn) | 475 | void cxgb3i_conn_tx_open(struct s3_conn *c3cn) |
diff --git a/drivers/scsi/cxgb3i/cxgb3i_pdu.h b/drivers/scsi/cxgb3i/cxgb3i_pdu.h index a3f685cc2362..0770b23d90da 100644 --- a/drivers/scsi/cxgb3i/cxgb3i_pdu.h +++ b/drivers/scsi/cxgb3i/cxgb3i_pdu.h | |||
@@ -53,7 +53,7 @@ struct cpl_rx_data_ddp_norss { | |||
53 | #define ULP2_FLAG_DCRC_ERROR 0x20 | 53 | #define ULP2_FLAG_DCRC_ERROR 0x20 |
54 | #define ULP2_FLAG_PAD_ERROR 0x40 | 54 | #define ULP2_FLAG_PAD_ERROR 0x40 |
55 | 55 | ||
56 | void cxgb3i_conn_closing(struct s3_conn *); | 56 | void cxgb3i_conn_closing(struct s3_conn *c3cn); |
57 | void cxgb3i_conn_pdu_ready(struct s3_conn *c3cn); | 57 | void cxgb3i_conn_pdu_ready(struct s3_conn *c3cn); |
58 | void cxgb3i_conn_tx_open(struct s3_conn *c3cn); | 58 | void cxgb3i_conn_tx_open(struct s3_conn *c3cn); |
59 | #endif | 59 | #endif |
diff --git a/drivers/scsi/hptiop.c b/drivers/scsi/hptiop.c index a48e4990fe12..34be88d7afa5 100644 --- a/drivers/scsi/hptiop.c +++ b/drivers/scsi/hptiop.c | |||
@@ -1251,6 +1251,7 @@ static struct pci_device_id hptiop_id_table[] = { | |||
1251 | { PCI_VDEVICE(TTI, 0x3530), (kernel_ulong_t)&hptiop_itl_ops }, | 1251 | { PCI_VDEVICE(TTI, 0x3530), (kernel_ulong_t)&hptiop_itl_ops }, |
1252 | { PCI_VDEVICE(TTI, 0x3560), (kernel_ulong_t)&hptiop_itl_ops }, | 1252 | { PCI_VDEVICE(TTI, 0x3560), (kernel_ulong_t)&hptiop_itl_ops }, |
1253 | { PCI_VDEVICE(TTI, 0x4322), (kernel_ulong_t)&hptiop_itl_ops }, | 1253 | { PCI_VDEVICE(TTI, 0x4322), (kernel_ulong_t)&hptiop_itl_ops }, |
1254 | { PCI_VDEVICE(TTI, 0x4321), (kernel_ulong_t)&hptiop_itl_ops }, | ||
1254 | { PCI_VDEVICE(TTI, 0x4210), (kernel_ulong_t)&hptiop_itl_ops }, | 1255 | { PCI_VDEVICE(TTI, 0x4210), (kernel_ulong_t)&hptiop_itl_ops }, |
1255 | { PCI_VDEVICE(TTI, 0x4211), (kernel_ulong_t)&hptiop_itl_ops }, | 1256 | { PCI_VDEVICE(TTI, 0x4211), (kernel_ulong_t)&hptiop_itl_ops }, |
1256 | { PCI_VDEVICE(TTI, 0x4310), (kernel_ulong_t)&hptiop_itl_ops }, | 1257 | { PCI_VDEVICE(TTI, 0x4310), (kernel_ulong_t)&hptiop_itl_ops }, |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index 940dc32ff0dc..b82ffd90632e 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
@@ -1040,12 +1040,11 @@ void scsi_io_completion(struct scsi_cmnd *cmd, unsigned int good_bytes) | |||
1040 | action = ACTION_FAIL; | 1040 | action = ACTION_FAIL; |
1041 | break; | 1041 | break; |
1042 | case ABORTED_COMMAND: | 1042 | case ABORTED_COMMAND: |
1043 | action = ACTION_FAIL; | ||
1043 | if (sshdr.asc == 0x10) { /* DIF */ | 1044 | if (sshdr.asc == 0x10) { /* DIF */ |
1044 | description = "Target Data Integrity Failure"; | 1045 | description = "Target Data Integrity Failure"; |
1045 | action = ACTION_FAIL; | ||
1046 | error = -EILSEQ; | 1046 | error = -EILSEQ; |
1047 | } else | 1047 | } |
1048 | action = ACTION_RETRY; | ||
1049 | break; | 1048 | break; |
1050 | case NOT_READY: | 1049 | case NOT_READY: |
1051 | /* If the device is in the process of becoming | 1050 | /* If the device is in the process of becoming |
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c index d57566b8be0a..55310dbc10a6 100644 --- a/drivers/scsi/sd.c +++ b/drivers/scsi/sd.c | |||
@@ -107,6 +107,7 @@ static void scsi_disk_release(struct device *cdev); | |||
107 | static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *); | 107 | static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *); |
108 | static void sd_print_result(struct scsi_disk *, int); | 108 | static void sd_print_result(struct scsi_disk *, int); |
109 | 109 | ||
110 | static DEFINE_SPINLOCK(sd_index_lock); | ||
110 | static DEFINE_IDA(sd_index_ida); | 111 | static DEFINE_IDA(sd_index_ida); |
111 | 112 | ||
112 | /* This semaphore is used to mediate the 0->1 reference get in the | 113 | /* This semaphore is used to mediate the 0->1 reference get in the |
@@ -1914,7 +1915,9 @@ static int sd_probe(struct device *dev) | |||
1914 | if (!ida_pre_get(&sd_index_ida, GFP_KERNEL)) | 1915 | if (!ida_pre_get(&sd_index_ida, GFP_KERNEL)) |
1915 | goto out_put; | 1916 | goto out_put; |
1916 | 1917 | ||
1918 | spin_lock(&sd_index_lock); | ||
1917 | error = ida_get_new(&sd_index_ida, &index); | 1919 | error = ida_get_new(&sd_index_ida, &index); |
1920 | spin_unlock(&sd_index_lock); | ||
1918 | } while (error == -EAGAIN); | 1921 | } while (error == -EAGAIN); |
1919 | 1922 | ||
1920 | if (error) | 1923 | if (error) |
@@ -1936,7 +1939,9 @@ static int sd_probe(struct device *dev) | |||
1936 | return 0; | 1939 | return 0; |
1937 | 1940 | ||
1938 | out_free_index: | 1941 | out_free_index: |
1942 | spin_lock(&sd_index_lock); | ||
1939 | ida_remove(&sd_index_ida, index); | 1943 | ida_remove(&sd_index_ida, index); |
1944 | spin_unlock(&sd_index_lock); | ||
1940 | out_put: | 1945 | out_put: |
1941 | put_disk(gd); | 1946 | put_disk(gd); |
1942 | out_free: | 1947 | out_free: |
@@ -1986,7 +1991,9 @@ static void scsi_disk_release(struct device *dev) | |||
1986 | struct scsi_disk *sdkp = to_scsi_disk(dev); | 1991 | struct scsi_disk *sdkp = to_scsi_disk(dev); |
1987 | struct gendisk *disk = sdkp->disk; | 1992 | struct gendisk *disk = sdkp->disk; |
1988 | 1993 | ||
1994 | spin_lock(&sd_index_lock); | ||
1989 | ida_remove(&sd_index_ida, sdkp->index); | 1995 | ida_remove(&sd_index_ida, sdkp->index); |
1996 | spin_unlock(&sd_index_lock); | ||
1990 | 1997 | ||
1991 | disk->private_data = NULL; | 1998 | disk->private_data = NULL; |
1992 | put_disk(disk); | 1999 | put_disk(disk); |
diff --git a/drivers/video/pxafb.c b/drivers/video/pxafb.c index 48ff701d3a72..2552b9f325ee 100644 --- a/drivers/video/pxafb.c +++ b/drivers/video/pxafb.c | |||
@@ -2230,7 +2230,7 @@ static int __devexit pxafb_remove(struct platform_device *dev) | |||
2230 | 2230 | ||
2231 | static struct platform_driver pxafb_driver = { | 2231 | static struct platform_driver pxafb_driver = { |
2232 | .probe = pxafb_probe, | 2232 | .probe = pxafb_probe, |
2233 | .remove = pxafb_remove, | 2233 | .remove = __devexit_p(pxafb_remove), |
2234 | .suspend = pxafb_suspend, | 2234 | .suspend = pxafb_suspend, |
2235 | .resume = pxafb_resume, | 2235 | .resume = pxafb_resume, |
2236 | .driver = { | 2236 | .driver = { |
diff --git a/fs/Makefile b/fs/Makefile index 38bc735c67ad..dc20db348679 100644 --- a/fs/Makefile +++ b/fs/Makefile | |||
@@ -69,10 +69,12 @@ obj-$(CONFIG_DLM) += dlm/ | |||
69 | # Do not add any filesystems before this line | 69 | # Do not add any filesystems before this line |
70 | obj-$(CONFIG_REISERFS_FS) += reiserfs/ | 70 | obj-$(CONFIG_REISERFS_FS) += reiserfs/ |
71 | obj-$(CONFIG_EXT3_FS) += ext3/ # Before ext2 so root fs can be ext3 | 71 | obj-$(CONFIG_EXT3_FS) += ext3/ # Before ext2 so root fs can be ext3 |
72 | obj-$(CONFIG_EXT4_FS) += ext4/ # Before ext2 so root fs can be ext4 | 72 | obj-$(CONFIG_EXT2_FS) += ext2/ |
73 | # We place ext4 after ext2 so plain ext2 root fs's are mounted using ext2 | ||
74 | # unless explicitly requested by rootfstype | ||
75 | obj-$(CONFIG_EXT4_FS) += ext4/ | ||
73 | obj-$(CONFIG_JBD) += jbd/ | 76 | obj-$(CONFIG_JBD) += jbd/ |
74 | obj-$(CONFIG_JBD2) += jbd2/ | 77 | obj-$(CONFIG_JBD2) += jbd2/ |
75 | obj-$(CONFIG_EXT2_FS) += ext2/ | ||
76 | obj-$(CONFIG_CRAMFS) += cramfs/ | 78 | obj-$(CONFIG_CRAMFS) += cramfs/ |
77 | obj-$(CONFIG_SQUASHFS) += squashfs/ | 79 | obj-$(CONFIG_SQUASHFS) += squashfs/ |
78 | obj-y += ramfs/ | 80 | obj-y += ramfs/ |
diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 9a50b8052dcf..de9459b4cb94 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c | |||
@@ -609,7 +609,9 @@ int ext4_claim_free_blocks(struct ext4_sb_info *sbi, | |||
609 | */ | 609 | */ |
610 | int ext4_should_retry_alloc(struct super_block *sb, int *retries) | 610 | int ext4_should_retry_alloc(struct super_block *sb, int *retries) |
611 | { | 611 | { |
612 | if (!ext4_has_free_blocks(EXT4_SB(sb), 1) || (*retries)++ > 3) | 612 | if (!ext4_has_free_blocks(EXT4_SB(sb), 1) || |
613 | (*retries)++ > 3 || | ||
614 | !EXT4_SB(sb)->s_journal) | ||
613 | return 0; | 615 | return 0; |
614 | 616 | ||
615 | jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id); | 617 | jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id); |
diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c index 51cdd13e1c31..c7fed5b18745 100644 --- a/fs/ext4/inode.c +++ b/fs/ext4/inode.c | |||
@@ -2544,7 +2544,7 @@ retry: | |||
2544 | 2544 | ||
2545 | ext4_journal_stop(handle); | 2545 | ext4_journal_stop(handle); |
2546 | 2546 | ||
2547 | if (mpd.retval == -ENOSPC) { | 2547 | if ((mpd.retval == -ENOSPC) && sbi->s_journal) { |
2548 | /* commit the transaction which would | 2548 | /* commit the transaction which would |
2549 | * free blocks released in the transaction | 2549 | * free blocks released in the transaction |
2550 | * and try again | 2550 | * and try again |
diff --git a/fs/ext4/super.c b/fs/ext4/super.c index a5732c58f676..39d1993cfa13 100644 --- a/fs/ext4/super.c +++ b/fs/ext4/super.c | |||
@@ -3091,7 +3091,6 @@ static int ext4_freeze(struct super_block *sb) | |||
3091 | 3091 | ||
3092 | /* Journal blocked and flushed, clear needs_recovery flag. */ | 3092 | /* Journal blocked and flushed, clear needs_recovery flag. */ |
3093 | EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); | 3093 | EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); |
3094 | ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); | ||
3095 | error = ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); | 3094 | error = ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); |
3096 | if (error) | 3095 | if (error) |
3097 | goto out; | 3096 | goto out; |
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h index cbc2f0cd631b..0adb0f91568c 100644 --- a/include/linux/io-mapping.h +++ b/include/linux/io-mapping.h | |||
@@ -91,8 +91,11 @@ io_mapping_unmap_atomic(void *vaddr) | |||
91 | static inline void * | 91 | static inline void * |
92 | io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) | 92 | io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) |
93 | { | 93 | { |
94 | resource_size_t phys_addr; | ||
95 | |||
94 | BUG_ON(offset >= mapping->size); | 96 | BUG_ON(offset >= mapping->size); |
95 | resource_size_t phys_addr = mapping->base + offset; | 97 | phys_addr = mapping->base + offset; |
98 | |||
96 | return ioremap_wc(phys_addr, PAGE_SIZE); | 99 | return ioremap_wc(phys_addr, PAGE_SIZE); |
97 | } | 100 | } |
98 | 101 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index bd8b4ca85a2a..493b065f76d7 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -1085,6 +1085,7 @@ extern void synchronize_net(void); | |||
1085 | extern int register_netdevice_notifier(struct notifier_block *nb); | 1085 | extern int register_netdevice_notifier(struct notifier_block *nb); |
1086 | extern int unregister_netdevice_notifier(struct notifier_block *nb); | 1086 | extern int unregister_netdevice_notifier(struct notifier_block *nb); |
1087 | extern int init_dummy_netdev(struct net_device *dev); | 1087 | extern int init_dummy_netdev(struct net_device *dev); |
1088 | extern void netdev_resync_ops(struct net_device *dev); | ||
1088 | 1089 | ||
1089 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | 1090 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); |
1090 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); | 1091 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); |
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h index f3f697df1d71..80044a4f3ab9 100644 --- a/include/linux/rcuclassic.h +++ b/include/linux/rcuclassic.h | |||
@@ -181,4 +181,10 @@ extern long rcu_batches_completed_bh(void); | |||
181 | #define rcu_enter_nohz() do { } while (0) | 181 | #define rcu_enter_nohz() do { } while (0) |
182 | #define rcu_exit_nohz() do { } while (0) | 182 | #define rcu_exit_nohz() do { } while (0) |
183 | 183 | ||
184 | /* A context switch is a grace period for rcuclassic. */ | ||
185 | static inline int rcu_blocking_is_gp(void) | ||
186 | { | ||
187 | return num_online_cpus() == 1; | ||
188 | } | ||
189 | |||
184 | #endif /* __LINUX_RCUCLASSIC_H */ | 190 | #endif /* __LINUX_RCUCLASSIC_H */ |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 921340a7b71c..528343e6da51 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -52,6 +52,9 @@ struct rcu_head { | |||
52 | void (*func)(struct rcu_head *head); | 52 | void (*func)(struct rcu_head *head); |
53 | }; | 53 | }; |
54 | 54 | ||
55 | /* Internal to kernel, but needed by rcupreempt.h. */ | ||
56 | extern int rcu_scheduler_active; | ||
57 | |||
55 | #if defined(CONFIG_CLASSIC_RCU) | 58 | #if defined(CONFIG_CLASSIC_RCU) |
56 | #include <linux/rcuclassic.h> | 59 | #include <linux/rcuclassic.h> |
57 | #elif defined(CONFIG_TREE_RCU) | 60 | #elif defined(CONFIG_TREE_RCU) |
@@ -265,6 +268,7 @@ extern void rcu_barrier_sched(void); | |||
265 | 268 | ||
266 | /* Internal to kernel */ | 269 | /* Internal to kernel */ |
267 | extern void rcu_init(void); | 270 | extern void rcu_init(void); |
271 | extern void rcu_scheduler_starting(void); | ||
268 | extern int rcu_needs_cpu(int cpu); | 272 | extern int rcu_needs_cpu(int cpu); |
269 | 273 | ||
270 | #endif /* __LINUX_RCUPDATE_H */ | 274 | #endif /* __LINUX_RCUPDATE_H */ |
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h index 3e05c09b54a2..74304b4538d8 100644 --- a/include/linux/rcupreempt.h +++ b/include/linux/rcupreempt.h | |||
@@ -142,4 +142,19 @@ static inline void rcu_exit_nohz(void) | |||
142 | #define rcu_exit_nohz() do { } while (0) | 142 | #define rcu_exit_nohz() do { } while (0) |
143 | #endif /* CONFIG_NO_HZ */ | 143 | #endif /* CONFIG_NO_HZ */ |
144 | 144 | ||
145 | /* | ||
146 | * A context switch is a grace period for rcupreempt synchronize_rcu() | ||
147 | * only during early boot, before the scheduler has been initialized. | ||
148 | * So, how the heck do we get a context switch? Well, if the caller | ||
149 | * invokes synchronize_rcu(), they are willing to accept a context | ||
150 | * switch, so we simply pretend that one happened. | ||
151 | * | ||
152 | * After boot, there might be a blocked or preempted task in an RCU | ||
153 | * read-side critical section, so we cannot then take the fastpath. | ||
154 | */ | ||
155 | static inline int rcu_blocking_is_gp(void) | ||
156 | { | ||
157 | return num_online_cpus() == 1 && !rcu_scheduler_active; | ||
158 | } | ||
159 | |||
145 | #endif /* __LINUX_RCUPREEMPT_H */ | 160 | #endif /* __LINUX_RCUPREEMPT_H */ |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index d4368b7975c3..a722fb67bb2d 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -326,4 +326,10 @@ static inline void rcu_exit_nohz(void) | |||
326 | } | 326 | } |
327 | #endif /* CONFIG_NO_HZ */ | 327 | #endif /* CONFIG_NO_HZ */ |
328 | 328 | ||
329 | /* A context switch is a grace period for rcutree. */ | ||
330 | static inline int rcu_blocking_is_gp(void) | ||
331 | { | ||
332 | return num_online_cpus() == 1; | ||
333 | } | ||
334 | |||
329 | #endif /* __LINUX_RCUTREE_H */ | 335 | #endif /* __LINUX_RCUTREE_H */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 8981e52c714f..8c216e057c94 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -2291,9 +2291,13 @@ extern long sched_group_rt_runtime(struct task_group *tg); | |||
2291 | extern int sched_group_set_rt_period(struct task_group *tg, | 2291 | extern int sched_group_set_rt_period(struct task_group *tg, |
2292 | long rt_period_us); | 2292 | long rt_period_us); |
2293 | extern long sched_group_rt_period(struct task_group *tg); | 2293 | extern long sched_group_rt_period(struct task_group *tg); |
2294 | extern int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk); | ||
2294 | #endif | 2295 | #endif |
2295 | #endif | 2296 | #endif |
2296 | 2297 | ||
2298 | extern int task_can_switch_user(struct user_struct *up, | ||
2299 | struct task_struct *tsk); | ||
2300 | |||
2297 | #ifdef CONFIG_TASK_XACCT | 2301 | #ifdef CONFIG_TASK_XACCT |
2298 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) | 2302 | static inline void add_rchar(struct task_struct *tsk, ssize_t amt) |
2299 | { | 2303 | { |
diff --git a/init/main.c b/init/main.c index 844209453c02..83697e160b3a 100644 --- a/init/main.c +++ b/init/main.c | |||
@@ -97,7 +97,7 @@ static inline void mark_rodata_ro(void) { } | |||
97 | extern void tc_init(void); | 97 | extern void tc_init(void); |
98 | #endif | 98 | #endif |
99 | 99 | ||
100 | enum system_states system_state; | 100 | enum system_states system_state __read_mostly; |
101 | EXPORT_SYMBOL(system_state); | 101 | EXPORT_SYMBOL(system_state); |
102 | 102 | ||
103 | /* | 103 | /* |
@@ -463,6 +463,7 @@ static noinline void __init_refok rest_init(void) | |||
463 | * at least once to get things moving: | 463 | * at least once to get things moving: |
464 | */ | 464 | */ |
465 | init_idle_bootup_task(current); | 465 | init_idle_bootup_task(current); |
466 | rcu_scheduler_starting(); | ||
466 | preempt_enable_no_resched(); | 467 | preempt_enable_no_resched(); |
467 | schedule(); | 468 | schedule(); |
468 | preempt_disable(); | 469 | preempt_disable(); |
diff --git a/kernel/rcuclassic.c b/kernel/rcuclassic.c index bd5a9003497c..654c640a6b9c 100644 --- a/kernel/rcuclassic.c +++ b/kernel/rcuclassic.c | |||
@@ -679,8 +679,8 @@ int rcu_needs_cpu(int cpu) | |||
679 | void rcu_check_callbacks(int cpu, int user) | 679 | void rcu_check_callbacks(int cpu, int user) |
680 | { | 680 | { |
681 | if (user || | 681 | if (user || |
682 | (idle_cpu(cpu) && !in_softirq() && | 682 | (idle_cpu(cpu) && rcu_scheduler_active && |
683 | hardirq_count() <= (1 << HARDIRQ_SHIFT))) { | 683 | !in_softirq() && hardirq_count() <= (1 << HARDIRQ_SHIFT))) { |
684 | 684 | ||
685 | /* | 685 | /* |
686 | * Get here if this CPU took its interrupt from user | 686 | * Get here if this CPU took its interrupt from user |
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index d92a76a881aa..cae8a059cf47 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c | |||
@@ -44,6 +44,7 @@ | |||
44 | #include <linux/cpu.h> | 44 | #include <linux/cpu.h> |
45 | #include <linux/mutex.h> | 45 | #include <linux/mutex.h> |
46 | #include <linux/module.h> | 46 | #include <linux/module.h> |
47 | #include <linux/kernel_stat.h> | ||
47 | 48 | ||
48 | enum rcu_barrier { | 49 | enum rcu_barrier { |
49 | RCU_BARRIER_STD, | 50 | RCU_BARRIER_STD, |
@@ -55,6 +56,7 @@ static DEFINE_PER_CPU(struct rcu_head, rcu_barrier_head) = {NULL}; | |||
55 | static atomic_t rcu_barrier_cpu_count; | 56 | static atomic_t rcu_barrier_cpu_count; |
56 | static DEFINE_MUTEX(rcu_barrier_mutex); | 57 | static DEFINE_MUTEX(rcu_barrier_mutex); |
57 | static struct completion rcu_barrier_completion; | 58 | static struct completion rcu_barrier_completion; |
59 | int rcu_scheduler_active __read_mostly; | ||
58 | 60 | ||
59 | /* | 61 | /* |
60 | * Awaken the corresponding synchronize_rcu() instance now that a | 62 | * Awaken the corresponding synchronize_rcu() instance now that a |
@@ -80,6 +82,10 @@ void wakeme_after_rcu(struct rcu_head *head) | |||
80 | void synchronize_rcu(void) | 82 | void synchronize_rcu(void) |
81 | { | 83 | { |
82 | struct rcu_synchronize rcu; | 84 | struct rcu_synchronize rcu; |
85 | |||
86 | if (rcu_blocking_is_gp()) | ||
87 | return; | ||
88 | |||
83 | init_completion(&rcu.completion); | 89 | init_completion(&rcu.completion); |
84 | /* Will wake me after RCU finished. */ | 90 | /* Will wake me after RCU finished. */ |
85 | call_rcu(&rcu.head, wakeme_after_rcu); | 91 | call_rcu(&rcu.head, wakeme_after_rcu); |
@@ -175,3 +181,9 @@ void __init rcu_init(void) | |||
175 | __rcu_init(); | 181 | __rcu_init(); |
176 | } | 182 | } |
177 | 183 | ||
184 | void rcu_scheduler_starting(void) | ||
185 | { | ||
186 | WARN_ON(num_online_cpus() != 1); | ||
187 | WARN_ON(nr_context_switches() > 0); | ||
188 | rcu_scheduler_active = 1; | ||
189 | } | ||
diff --git a/kernel/rcupreempt.c b/kernel/rcupreempt.c index 33cfc50781f9..5d59e850fb71 100644 --- a/kernel/rcupreempt.c +++ b/kernel/rcupreempt.c | |||
@@ -1181,6 +1181,9 @@ void __synchronize_sched(void) | |||
1181 | { | 1181 | { |
1182 | struct rcu_synchronize rcu; | 1182 | struct rcu_synchronize rcu; |
1183 | 1183 | ||
1184 | if (num_online_cpus() == 1) | ||
1185 | return; /* blocking is gp if only one CPU! */ | ||
1186 | |||
1184 | init_completion(&rcu.completion); | 1187 | init_completion(&rcu.completion); |
1185 | /* Will wake me after RCU finished. */ | 1188 | /* Will wake me after RCU finished. */ |
1186 | call_rcu_sched(&rcu.head, wakeme_after_rcu); | 1189 | call_rcu_sched(&rcu.head, wakeme_after_rcu); |
diff --git a/kernel/rcutree.c b/kernel/rcutree.c index b2fd602a6f6f..97ce31579ec0 100644 --- a/kernel/rcutree.c +++ b/kernel/rcutree.c | |||
@@ -948,8 +948,8 @@ static void rcu_do_batch(struct rcu_data *rdp) | |||
948 | void rcu_check_callbacks(int cpu, int user) | 948 | void rcu_check_callbacks(int cpu, int user) |
949 | { | 949 | { |
950 | if (user || | 950 | if (user || |
951 | (idle_cpu(cpu) && !in_softirq() && | 951 | (idle_cpu(cpu) && rcu_scheduler_active && |
952 | hardirq_count() <= (1 << HARDIRQ_SHIFT))) { | 952 | !in_softirq() && hardirq_count() <= (1 << HARDIRQ_SHIFT))) { |
953 | 953 | ||
954 | /* | 954 | /* |
955 | * Get here if this CPU took its interrupt from user | 955 | * Get here if this CPU took its interrupt from user |
diff --git a/kernel/sched.c b/kernel/sched.c index 410eec404133..8e2558c2ba67 100644 --- a/kernel/sched.c +++ b/kernel/sched.c | |||
@@ -223,7 +223,7 @@ static void start_rt_bandwidth(struct rt_bandwidth *rt_b) | |||
223 | { | 223 | { |
224 | ktime_t now; | 224 | ktime_t now; |
225 | 225 | ||
226 | if (rt_bandwidth_enabled() && rt_b->rt_runtime == RUNTIME_INF) | 226 | if (!rt_bandwidth_enabled() || rt_b->rt_runtime == RUNTIME_INF) |
227 | return; | 227 | return; |
228 | 228 | ||
229 | if (hrtimer_active(&rt_b->rt_period_timer)) | 229 | if (hrtimer_active(&rt_b->rt_period_timer)) |
@@ -9224,6 +9224,16 @@ static int sched_rt_global_constraints(void) | |||
9224 | 9224 | ||
9225 | return ret; | 9225 | return ret; |
9226 | } | 9226 | } |
9227 | |||
9228 | int sched_rt_can_attach(struct task_group *tg, struct task_struct *tsk) | ||
9229 | { | ||
9230 | /* Don't accept realtime tasks when there is no way for them to run */ | ||
9231 | if (rt_task(tsk) && tg->rt_bandwidth.rt_runtime == 0) | ||
9232 | return 0; | ||
9233 | |||
9234 | return 1; | ||
9235 | } | ||
9236 | |||
9227 | #else /* !CONFIG_RT_GROUP_SCHED */ | 9237 | #else /* !CONFIG_RT_GROUP_SCHED */ |
9228 | static int sched_rt_global_constraints(void) | 9238 | static int sched_rt_global_constraints(void) |
9229 | { | 9239 | { |
@@ -9317,8 +9327,7 @@ cpu_cgroup_can_attach(struct cgroup_subsys *ss, struct cgroup *cgrp, | |||
9317 | struct task_struct *tsk) | 9327 | struct task_struct *tsk) |
9318 | { | 9328 | { |
9319 | #ifdef CONFIG_RT_GROUP_SCHED | 9329 | #ifdef CONFIG_RT_GROUP_SCHED |
9320 | /* Don't accept realtime tasks when there is no way for them to run */ | 9330 | if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk)) |
9321 | if (rt_task(tsk) && cgroup_tg(cgrp)->rt_bandwidth.rt_runtime == 0) | ||
9322 | return -EINVAL; | 9331 | return -EINVAL; |
9323 | #else | 9332 | #else |
9324 | /* We don't support RT-tasks being in separate groups */ | 9333 | /* We don't support RT-tasks being in separate groups */ |
diff --git a/kernel/seccomp.c b/kernel/seccomp.c index ad64fcb731f2..57d4b13b631d 100644 --- a/kernel/seccomp.c +++ b/kernel/seccomp.c | |||
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/seccomp.h> | 9 | #include <linux/seccomp.h> |
10 | #include <linux/sched.h> | 10 | #include <linux/sched.h> |
11 | #include <linux/compat.h> | ||
11 | 12 | ||
12 | /* #define SECCOMP_DEBUG 1 */ | 13 | /* #define SECCOMP_DEBUG 1 */ |
13 | #define NR_SECCOMP_MODES 1 | 14 | #define NR_SECCOMP_MODES 1 |
@@ -22,7 +23,7 @@ static int mode1_syscalls[] = { | |||
22 | 0, /* null terminated */ | 23 | 0, /* null terminated */ |
23 | }; | 24 | }; |
24 | 25 | ||
25 | #ifdef TIF_32BIT | 26 | #ifdef CONFIG_COMPAT |
26 | static int mode1_syscalls_32[] = { | 27 | static int mode1_syscalls_32[] = { |
27 | __NR_seccomp_read_32, __NR_seccomp_write_32, __NR_seccomp_exit_32, __NR_seccomp_sigreturn_32, | 28 | __NR_seccomp_read_32, __NR_seccomp_write_32, __NR_seccomp_exit_32, __NR_seccomp_sigreturn_32, |
28 | 0, /* null terminated */ | 29 | 0, /* null terminated */ |
@@ -37,8 +38,8 @@ void __secure_computing(int this_syscall) | |||
37 | switch (mode) { | 38 | switch (mode) { |
38 | case 1: | 39 | case 1: |
39 | syscall = mode1_syscalls; | 40 | syscall = mode1_syscalls; |
40 | #ifdef TIF_32BIT | 41 | #ifdef CONFIG_COMPAT |
41 | if (test_thread_flag(TIF_32BIT)) | 42 | if (is_compat_task()) |
42 | syscall = mode1_syscalls_32; | 43 | syscall = mode1_syscalls_32; |
43 | #endif | 44 | #endif |
44 | do { | 45 | do { |
diff --git a/kernel/sys.c b/kernel/sys.c index f145c415bc16..37f458e6882a 100644 --- a/kernel/sys.c +++ b/kernel/sys.c | |||
@@ -559,7 +559,7 @@ error: | |||
559 | abort_creds(new); | 559 | abort_creds(new); |
560 | return retval; | 560 | return retval; |
561 | } | 561 | } |
562 | 562 | ||
563 | /* | 563 | /* |
564 | * change the user struct in a credentials set to match the new UID | 564 | * change the user struct in a credentials set to match the new UID |
565 | */ | 565 | */ |
@@ -571,6 +571,11 @@ static int set_user(struct cred *new) | |||
571 | if (!new_user) | 571 | if (!new_user) |
572 | return -EAGAIN; | 572 | return -EAGAIN; |
573 | 573 | ||
574 | if (!task_can_switch_user(new_user, current)) { | ||
575 | free_uid(new_user); | ||
576 | return -EINVAL; | ||
577 | } | ||
578 | |||
574 | if (atomic_read(&new_user->processes) >= | 579 | if (atomic_read(&new_user->processes) >= |
575 | current->signal->rlim[RLIMIT_NPROC].rlim_cur && | 580 | current->signal->rlim[RLIMIT_NPROC].rlim_cur && |
576 | new_user != INIT_USER) { | 581 | new_user != INIT_USER) { |
@@ -631,10 +636,11 @@ SYSCALL_DEFINE2(setreuid, uid_t, ruid, uid_t, euid) | |||
631 | goto error; | 636 | goto error; |
632 | } | 637 | } |
633 | 638 | ||
634 | retval = -EAGAIN; | 639 | if (new->uid != old->uid) { |
635 | if (new->uid != old->uid && set_user(new) < 0) | 640 | retval = set_user(new); |
636 | goto error; | 641 | if (retval < 0) |
637 | 642 | goto error; | |
643 | } | ||
638 | if (ruid != (uid_t) -1 || | 644 | if (ruid != (uid_t) -1 || |
639 | (euid != (uid_t) -1 && euid != old->uid)) | 645 | (euid != (uid_t) -1 && euid != old->uid)) |
640 | new->suid = new->euid; | 646 | new->suid = new->euid; |
@@ -680,9 +686,10 @@ SYSCALL_DEFINE1(setuid, uid_t, uid) | |||
680 | retval = -EPERM; | 686 | retval = -EPERM; |
681 | if (capable(CAP_SETUID)) { | 687 | if (capable(CAP_SETUID)) { |
682 | new->suid = new->uid = uid; | 688 | new->suid = new->uid = uid; |
683 | if (uid != old->uid && set_user(new) < 0) { | 689 | if (uid != old->uid) { |
684 | retval = -EAGAIN; | 690 | retval = set_user(new); |
685 | goto error; | 691 | if (retval < 0) |
692 | goto error; | ||
686 | } | 693 | } |
687 | } else if (uid != old->uid && uid != new->suid) { | 694 | } else if (uid != old->uid && uid != new->suid) { |
688 | goto error; | 695 | goto error; |
@@ -734,11 +741,13 @@ SYSCALL_DEFINE3(setresuid, uid_t, ruid, uid_t, euid, uid_t, suid) | |||
734 | goto error; | 741 | goto error; |
735 | } | 742 | } |
736 | 743 | ||
737 | retval = -EAGAIN; | ||
738 | if (ruid != (uid_t) -1) { | 744 | if (ruid != (uid_t) -1) { |
739 | new->uid = ruid; | 745 | new->uid = ruid; |
740 | if (ruid != old->uid && set_user(new) < 0) | 746 | if (ruid != old->uid) { |
741 | goto error; | 747 | retval = set_user(new); |
748 | if (retval < 0) | ||
749 | goto error; | ||
750 | } | ||
742 | } | 751 | } |
743 | if (euid != (uid_t) -1) | 752 | if (euid != (uid_t) -1) |
744 | new->euid = euid; | 753 | new->euid = euid; |
diff --git a/kernel/user.c b/kernel/user.c index 3551ac742395..6a9b696128c8 100644 --- a/kernel/user.c +++ b/kernel/user.c | |||
@@ -362,6 +362,24 @@ static void free_user(struct user_struct *up, unsigned long flags) | |||
362 | 362 | ||
363 | #endif | 363 | #endif |
364 | 364 | ||
365 | #if defined(CONFIG_RT_GROUP_SCHED) && defined(CONFIG_USER_SCHED) | ||
366 | /* | ||
367 | * We need to check if a setuid can take place. This function should be called | ||
368 | * before successfully completing the setuid. | ||
369 | */ | ||
370 | int task_can_switch_user(struct user_struct *up, struct task_struct *tsk) | ||
371 | { | ||
372 | |||
373 | return sched_rt_can_attach(up->tg, tsk); | ||
374 | |||
375 | } | ||
376 | #else | ||
377 | int task_can_switch_user(struct user_struct *up, struct task_struct *tsk) | ||
378 | { | ||
379 | return 1; | ||
380 | } | ||
381 | #endif | ||
382 | |||
365 | /* | 383 | /* |
366 | * Locate the user_struct for the passed UID. If found, take a ref on it. The | 384 | * Locate the user_struct for the passed UID. If found, take a ref on it. The |
367 | * caller must undo that ref with free_uid(). | 385 | * caller must undo that ref with free_uid(). |
diff --git a/net/802/tr.c b/net/802/tr.c index dab6334b6258..e7eb13084d71 100644 --- a/net/802/tr.c +++ b/net/802/tr.c | |||
@@ -670,3 +670,5 @@ module_init(rif_init); | |||
670 | 670 | ||
671 | EXPORT_SYMBOL(tr_type_trans); | 671 | EXPORT_SYMBOL(tr_type_trans); |
672 | EXPORT_SYMBOL(alloc_trdev); | 672 | EXPORT_SYMBOL(alloc_trdev); |
673 | |||
674 | MODULE_LICENSE("GPL"); | ||
diff --git a/net/8021q/vlan_dev.c b/net/8021q/vlan_dev.c index 4a19acd3a32b..1b34135cf990 100644 --- a/net/8021q/vlan_dev.c +++ b/net/8021q/vlan_dev.c | |||
@@ -553,7 +553,7 @@ static int vlan_dev_neigh_setup(struct net_device *dev, struct neigh_parms *pa) | |||
553 | int err = 0; | 553 | int err = 0; |
554 | 554 | ||
555 | if (netif_device_present(real_dev) && ops->ndo_neigh_setup) | 555 | if (netif_device_present(real_dev) && ops->ndo_neigh_setup) |
556 | err = ops->ndo_neigh_setup(dev, pa); | 556 | err = ops->ndo_neigh_setup(real_dev, pa); |
557 | 557 | ||
558 | return err; | 558 | return err; |
559 | } | 559 | } |
@@ -639,6 +639,7 @@ static int vlan_dev_init(struct net_device *dev) | |||
639 | dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN; | 639 | dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN; |
640 | dev->netdev_ops = &vlan_netdev_ops; | 640 | dev->netdev_ops = &vlan_netdev_ops; |
641 | } | 641 | } |
642 | netdev_resync_ops(dev); | ||
642 | 643 | ||
643 | if (is_vlan_dev(real_dev)) | 644 | if (is_vlan_dev(real_dev)) |
644 | subclass = 1; | 645 | subclass = 1; |
diff --git a/net/core/dev.c b/net/core/dev.c index bcd0c2154bb2..033d7ca28e6e 100644 --- a/net/core/dev.c +++ b/net/core/dev.c | |||
@@ -4336,6 +4336,39 @@ unsigned long netdev_fix_features(unsigned long features, const char *name) | |||
4336 | } | 4336 | } |
4337 | EXPORT_SYMBOL(netdev_fix_features); | 4337 | EXPORT_SYMBOL(netdev_fix_features); |
4338 | 4338 | ||
4339 | /* Some devices need to (re-)set their netdev_ops inside | ||
4340 | * ->init() or similar. If that happens, we have to setup | ||
4341 | * the compat pointers again. | ||
4342 | */ | ||
4343 | void netdev_resync_ops(struct net_device *dev) | ||
4344 | { | ||
4345 | #ifdef CONFIG_COMPAT_NET_DEV_OPS | ||
4346 | const struct net_device_ops *ops = dev->netdev_ops; | ||
4347 | |||
4348 | dev->init = ops->ndo_init; | ||
4349 | dev->uninit = ops->ndo_uninit; | ||
4350 | dev->open = ops->ndo_open; | ||
4351 | dev->change_rx_flags = ops->ndo_change_rx_flags; | ||
4352 | dev->set_rx_mode = ops->ndo_set_rx_mode; | ||
4353 | dev->set_multicast_list = ops->ndo_set_multicast_list; | ||
4354 | dev->set_mac_address = ops->ndo_set_mac_address; | ||
4355 | dev->validate_addr = ops->ndo_validate_addr; | ||
4356 | dev->do_ioctl = ops->ndo_do_ioctl; | ||
4357 | dev->set_config = ops->ndo_set_config; | ||
4358 | dev->change_mtu = ops->ndo_change_mtu; | ||
4359 | dev->neigh_setup = ops->ndo_neigh_setup; | ||
4360 | dev->tx_timeout = ops->ndo_tx_timeout; | ||
4361 | dev->get_stats = ops->ndo_get_stats; | ||
4362 | dev->vlan_rx_register = ops->ndo_vlan_rx_register; | ||
4363 | dev->vlan_rx_add_vid = ops->ndo_vlan_rx_add_vid; | ||
4364 | dev->vlan_rx_kill_vid = ops->ndo_vlan_rx_kill_vid; | ||
4365 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
4366 | dev->poll_controller = ops->ndo_poll_controller; | ||
4367 | #endif | ||
4368 | #endif | ||
4369 | } | ||
4370 | EXPORT_SYMBOL(netdev_resync_ops); | ||
4371 | |||
4339 | /** | 4372 | /** |
4340 | * register_netdevice - register a network device | 4373 | * register_netdevice - register a network device |
4341 | * @dev: device to register | 4374 | * @dev: device to register |
@@ -4380,27 +4413,7 @@ int register_netdevice(struct net_device *dev) | |||
4380 | * This is temporary until all network devices are converted. | 4413 | * This is temporary until all network devices are converted. |
4381 | */ | 4414 | */ |
4382 | if (dev->netdev_ops) { | 4415 | if (dev->netdev_ops) { |
4383 | const struct net_device_ops *ops = dev->netdev_ops; | 4416 | netdev_resync_ops(dev); |
4384 | |||
4385 | dev->init = ops->ndo_init; | ||
4386 | dev->uninit = ops->ndo_uninit; | ||
4387 | dev->open = ops->ndo_open; | ||
4388 | dev->change_rx_flags = ops->ndo_change_rx_flags; | ||
4389 | dev->set_rx_mode = ops->ndo_set_rx_mode; | ||
4390 | dev->set_multicast_list = ops->ndo_set_multicast_list; | ||
4391 | dev->set_mac_address = ops->ndo_set_mac_address; | ||
4392 | dev->validate_addr = ops->ndo_validate_addr; | ||
4393 | dev->do_ioctl = ops->ndo_do_ioctl; | ||
4394 | dev->set_config = ops->ndo_set_config; | ||
4395 | dev->change_mtu = ops->ndo_change_mtu; | ||
4396 | dev->tx_timeout = ops->ndo_tx_timeout; | ||
4397 | dev->get_stats = ops->ndo_get_stats; | ||
4398 | dev->vlan_rx_register = ops->ndo_vlan_rx_register; | ||
4399 | dev->vlan_rx_add_vid = ops->ndo_vlan_rx_add_vid; | ||
4400 | dev->vlan_rx_kill_vid = ops->ndo_vlan_rx_kill_vid; | ||
4401 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
4402 | dev->poll_controller = ops->ndo_poll_controller; | ||
4403 | #endif | ||
4404 | } else { | 4417 | } else { |
4405 | char drivername[64]; | 4418 | char drivername[64]; |
4406 | pr_info("%s (%s): not using net_device_ops yet\n", | 4419 | pr_info("%s (%s): not using net_device_ops yet\n", |
diff --git a/net/core/net-sysfs.c b/net/core/net-sysfs.c index 6ac29a46e23e..484f58750eba 100644 --- a/net/core/net-sysfs.c +++ b/net/core/net-sysfs.c | |||
@@ -77,7 +77,9 @@ static ssize_t netdev_store(struct device *dev, struct device_attribute *attr, | |||
77 | if (endp == buf) | 77 | if (endp == buf) |
78 | goto err; | 78 | goto err; |
79 | 79 | ||
80 | rtnl_lock(); | 80 | if (!rtnl_trylock()) |
81 | return -ERESTARTSYS; | ||
82 | |||
81 | if (dev_isalive(net)) { | 83 | if (dev_isalive(net)) { |
82 | if ((ret = (*set)(net, new)) == 0) | 84 | if ((ret = (*set)(net, new)) == 0) |
83 | ret = len; | 85 | ret = len; |
diff --git a/net/ipv6/addrconf.c b/net/ipv6/addrconf.c index f8f76d6e21cb..e83852ab4dc8 100644 --- a/net/ipv6/addrconf.c +++ b/net/ipv6/addrconf.c | |||
@@ -493,15 +493,17 @@ static void addrconf_forward_change(struct net *net, __s32 newf) | |||
493 | read_unlock(&dev_base_lock); | 493 | read_unlock(&dev_base_lock); |
494 | } | 494 | } |
495 | 495 | ||
496 | static void addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old) | 496 | static int addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old) |
497 | { | 497 | { |
498 | struct net *net; | 498 | struct net *net; |
499 | 499 | ||
500 | net = (struct net *)table->extra2; | 500 | net = (struct net *)table->extra2; |
501 | if (p == &net->ipv6.devconf_dflt->forwarding) | 501 | if (p == &net->ipv6.devconf_dflt->forwarding) |
502 | return; | 502 | return 0; |
503 | |||
504 | if (!rtnl_trylock()) | ||
505 | return -ERESTARTSYS; | ||
503 | 506 | ||
504 | rtnl_lock(); | ||
505 | if (p == &net->ipv6.devconf_all->forwarding) { | 507 | if (p == &net->ipv6.devconf_all->forwarding) { |
506 | __s32 newf = net->ipv6.devconf_all->forwarding; | 508 | __s32 newf = net->ipv6.devconf_all->forwarding; |
507 | net->ipv6.devconf_dflt->forwarding = newf; | 509 | net->ipv6.devconf_dflt->forwarding = newf; |
@@ -512,6 +514,7 @@ static void addrconf_fixup_forwarding(struct ctl_table *table, int *p, int old) | |||
512 | 514 | ||
513 | if (*p) | 515 | if (*p) |
514 | rt6_purge_dflt_routers(net); | 516 | rt6_purge_dflt_routers(net); |
517 | return 1; | ||
515 | } | 518 | } |
516 | #endif | 519 | #endif |
517 | 520 | ||
@@ -2599,9 +2602,6 @@ static int addrconf_ifdown(struct net_device *dev, int how) | |||
2599 | 2602 | ||
2600 | ASSERT_RTNL(); | 2603 | ASSERT_RTNL(); |
2601 | 2604 | ||
2602 | if ((dev->flags & IFF_LOOPBACK) && how == 1) | ||
2603 | how = 0; | ||
2604 | |||
2605 | rt6_ifdown(net, dev); | 2605 | rt6_ifdown(net, dev); |
2606 | neigh_ifdown(&nd_tbl, dev); | 2606 | neigh_ifdown(&nd_tbl, dev); |
2607 | 2607 | ||
@@ -3977,7 +3977,7 @@ int addrconf_sysctl_forward(ctl_table *ctl, int write, struct file * filp, | |||
3977 | ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); | 3977 | ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); |
3978 | 3978 | ||
3979 | if (write) | 3979 | if (write) |
3980 | addrconf_fixup_forwarding(ctl, valp, val); | 3980 | ret = addrconf_fixup_forwarding(ctl, valp, val); |
3981 | return ret; | 3981 | return ret; |
3982 | } | 3982 | } |
3983 | 3983 | ||
@@ -4013,8 +4013,7 @@ static int addrconf_sysctl_forward_strategy(ctl_table *table, | |||
4013 | } | 4013 | } |
4014 | 4014 | ||
4015 | *valp = new; | 4015 | *valp = new; |
4016 | addrconf_fixup_forwarding(table, valp, val); | 4016 | return addrconf_fixup_forwarding(table, valp, val); |
4017 | return 1; | ||
4018 | } | 4017 | } |
4019 | 4018 | ||
4020 | static struct addrconf_sysctl_table | 4019 | static struct addrconf_sysctl_table |
@@ -4440,25 +4439,6 @@ int unregister_inet6addr_notifier(struct notifier_block *nb) | |||
4440 | 4439 | ||
4441 | EXPORT_SYMBOL(unregister_inet6addr_notifier); | 4440 | EXPORT_SYMBOL(unregister_inet6addr_notifier); |
4442 | 4441 | ||
4443 | static void addrconf_net_exit(struct net *net) | ||
4444 | { | ||
4445 | struct net_device *dev; | ||
4446 | |||
4447 | rtnl_lock(); | ||
4448 | /* clean dev list */ | ||
4449 | for_each_netdev(net, dev) { | ||
4450 | if (__in6_dev_get(dev) == NULL) | ||
4451 | continue; | ||
4452 | addrconf_ifdown(dev, 1); | ||
4453 | } | ||
4454 | addrconf_ifdown(net->loopback_dev, 2); | ||
4455 | rtnl_unlock(); | ||
4456 | } | ||
4457 | |||
4458 | static struct pernet_operations addrconf_net_ops = { | ||
4459 | .exit = addrconf_net_exit, | ||
4460 | }; | ||
4461 | |||
4462 | /* | 4442 | /* |
4463 | * Init / cleanup code | 4443 | * Init / cleanup code |
4464 | */ | 4444 | */ |
@@ -4500,10 +4480,6 @@ int __init addrconf_init(void) | |||
4500 | if (err) | 4480 | if (err) |
4501 | goto errlo; | 4481 | goto errlo; |
4502 | 4482 | ||
4503 | err = register_pernet_device(&addrconf_net_ops); | ||
4504 | if (err) | ||
4505 | return err; | ||
4506 | |||
4507 | register_netdevice_notifier(&ipv6_dev_notf); | 4483 | register_netdevice_notifier(&ipv6_dev_notf); |
4508 | 4484 | ||
4509 | addrconf_verify(0); | 4485 | addrconf_verify(0); |
@@ -4533,15 +4509,22 @@ errlo: | |||
4533 | void addrconf_cleanup(void) | 4509 | void addrconf_cleanup(void) |
4534 | { | 4510 | { |
4535 | struct inet6_ifaddr *ifa; | 4511 | struct inet6_ifaddr *ifa; |
4512 | struct net_device *dev; | ||
4536 | int i; | 4513 | int i; |
4537 | 4514 | ||
4538 | unregister_netdevice_notifier(&ipv6_dev_notf); | 4515 | unregister_netdevice_notifier(&ipv6_dev_notf); |
4539 | unregister_pernet_device(&addrconf_net_ops); | ||
4540 | |||
4541 | unregister_pernet_subsys(&addrconf_ops); | 4516 | unregister_pernet_subsys(&addrconf_ops); |
4542 | 4517 | ||
4543 | rtnl_lock(); | 4518 | rtnl_lock(); |
4544 | 4519 | ||
4520 | /* clean dev list */ | ||
4521 | for_each_netdev(&init_net, dev) { | ||
4522 | if (__in6_dev_get(dev) == NULL) | ||
4523 | continue; | ||
4524 | addrconf_ifdown(dev, 1); | ||
4525 | } | ||
4526 | addrconf_ifdown(init_net.loopback_dev, 2); | ||
4527 | |||
4545 | /* | 4528 | /* |
4546 | * Check hash table. | 4529 | * Check hash table. |
4547 | */ | 4530 | */ |
@@ -4562,6 +4545,4 @@ void addrconf_cleanup(void) | |||
4562 | 4545 | ||
4563 | del_timer(&addr_chk_timer); | 4546 | del_timer(&addr_chk_timer); |
4564 | rtnl_unlock(); | 4547 | rtnl_unlock(); |
4565 | |||
4566 | unregister_pernet_subsys(&addrconf_net_ops); | ||
4567 | } | 4548 | } |
diff --git a/net/ipv6/af_inet6.c b/net/ipv6/af_inet6.c index fa2ac7ee662f..57b07da1212a 100644 --- a/net/ipv6/af_inet6.c +++ b/net/ipv6/af_inet6.c | |||
@@ -72,6 +72,10 @@ MODULE_LICENSE("GPL"); | |||
72 | static struct list_head inetsw6[SOCK_MAX]; | 72 | static struct list_head inetsw6[SOCK_MAX]; |
73 | static DEFINE_SPINLOCK(inetsw6_lock); | 73 | static DEFINE_SPINLOCK(inetsw6_lock); |
74 | 74 | ||
75 | static int disable_ipv6 = 0; | ||
76 | module_param_named(disable, disable_ipv6, int, 0); | ||
77 | MODULE_PARM_DESC(disable, "Disable IPv6 such that it is non-functional"); | ||
78 | |||
75 | static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) | 79 | static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) |
76 | { | 80 | { |
77 | const int offset = sk->sk_prot->obj_size - sizeof(struct ipv6_pinfo); | 81 | const int offset = sk->sk_prot->obj_size - sizeof(struct ipv6_pinfo); |
@@ -1001,10 +1005,21 @@ static int __init inet6_init(void) | |||
1001 | { | 1005 | { |
1002 | struct sk_buff *dummy_skb; | 1006 | struct sk_buff *dummy_skb; |
1003 | struct list_head *r; | 1007 | struct list_head *r; |
1004 | int err; | 1008 | int err = 0; |
1005 | 1009 | ||
1006 | BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb)); | 1010 | BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb)); |
1007 | 1011 | ||
1012 | /* Register the socket-side information for inet6_create. */ | ||
1013 | for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r) | ||
1014 | INIT_LIST_HEAD(r); | ||
1015 | |||
1016 | if (disable_ipv6) { | ||
1017 | printk(KERN_INFO | ||
1018 | "IPv6: Loaded, but administratively disabled, " | ||
1019 | "reboot required to enable\n"); | ||
1020 | goto out; | ||
1021 | } | ||
1022 | |||
1008 | err = proto_register(&tcpv6_prot, 1); | 1023 | err = proto_register(&tcpv6_prot, 1); |
1009 | if (err) | 1024 | if (err) |
1010 | goto out; | 1025 | goto out; |
@@ -1022,10 +1037,6 @@ static int __init inet6_init(void) | |||
1022 | goto out_unregister_udplite_proto; | 1037 | goto out_unregister_udplite_proto; |
1023 | 1038 | ||
1024 | 1039 | ||
1025 | /* Register the socket-side information for inet6_create. */ | ||
1026 | for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r) | ||
1027 | INIT_LIST_HEAD(r); | ||
1028 | |||
1029 | /* We MUST register RAW sockets before we create the ICMP6, | 1040 | /* We MUST register RAW sockets before we create the ICMP6, |
1030 | * IGMP6, or NDISC control sockets. | 1041 | * IGMP6, or NDISC control sockets. |
1031 | */ | 1042 | */ |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index e57d700bf6d9..a007dbb4c9f1 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c | |||
@@ -1091,6 +1091,13 @@ out: | |||
1091 | return 0; | 1091 | return 0; |
1092 | } | 1092 | } |
1093 | 1093 | ||
1094 | /** | ||
1095 | * netlink_set_err - report error to broadcast listeners | ||
1096 | * @ssk: the kernel netlink socket, as returned by netlink_kernel_create() | ||
1097 | * @pid: the PID of a process that we want to skip (if any) | ||
1098 | * @groups: the broadcast group that will notice the error | ||
1099 | * @code: error code, must be negative (as usual in kernelspace) | ||
1100 | */ | ||
1094 | void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) | 1101 | void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) |
1095 | { | 1102 | { |
1096 | struct netlink_set_err_data info; | 1103 | struct netlink_set_err_data info; |
@@ -1100,7 +1107,8 @@ void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) | |||
1100 | info.exclude_sk = ssk; | 1107 | info.exclude_sk = ssk; |
1101 | info.pid = pid; | 1108 | info.pid = pid; |
1102 | info.group = group; | 1109 | info.group = group; |
1103 | info.code = code; | 1110 | /* sk->sk_err wants a positive error value */ |
1111 | info.code = -code; | ||
1104 | 1112 | ||
1105 | read_lock(&nl_table_lock); | 1113 | read_lock(&nl_table_lock); |
1106 | 1114 | ||
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 5c72a116b1a4..f8f047b61245 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
@@ -183,13 +183,6 @@ override: | |||
183 | if (R_tab == NULL) | 183 | if (R_tab == NULL) |
184 | goto failure; | 184 | goto failure; |
185 | 185 | ||
186 | if (!est && (ret == ACT_P_CREATED || | ||
187 | !gen_estimator_active(&police->tcf_bstats, | ||
188 | &police->tcf_rate_est))) { | ||
189 | err = -EINVAL; | ||
190 | goto failure; | ||
191 | } | ||
192 | |||
193 | if (parm->peakrate.rate) { | 186 | if (parm->peakrate.rate) { |
194 | P_tab = qdisc_get_rtab(&parm->peakrate, | 187 | P_tab = qdisc_get_rtab(&parm->peakrate, |
195 | tb[TCA_POLICE_PEAKRATE]); | 188 | tb[TCA_POLICE_PEAKRATE]); |
@@ -205,6 +198,12 @@ override: | |||
205 | &police->tcf_lock, est); | 198 | &police->tcf_lock, est); |
206 | if (err) | 199 | if (err) |
207 | goto failure_unlock; | 200 | goto failure_unlock; |
201 | } else if (tb[TCA_POLICE_AVRATE] && | ||
202 | (ret == ACT_P_CREATED || | ||
203 | !gen_estimator_active(&police->tcf_bstats, | ||
204 | &police->tcf_rate_est))) { | ||
205 | err = -EINVAL; | ||
206 | goto failure_unlock; | ||
208 | } | 207 | } |
209 | 208 | ||
210 | /* No failure allowed after this point */ | 209 | /* No failure allowed after this point */ |
diff --git a/net/sctp/protocol.c b/net/sctp/protocol.c index c1e316ee7155..cb198af8887c 100644 --- a/net/sctp/protocol.c +++ b/net/sctp/protocol.c | |||
@@ -692,15 +692,20 @@ static int sctp_inetaddr_event(struct notifier_block *this, unsigned long ev, | |||
692 | static int sctp_ctl_sock_init(void) | 692 | static int sctp_ctl_sock_init(void) |
693 | { | 693 | { |
694 | int err; | 694 | int err; |
695 | sa_family_t family; | 695 | sa_family_t family = PF_INET; |
696 | 696 | ||
697 | if (sctp_get_pf_specific(PF_INET6)) | 697 | if (sctp_get_pf_specific(PF_INET6)) |
698 | family = PF_INET6; | 698 | family = PF_INET6; |
699 | else | ||
700 | family = PF_INET; | ||
701 | 699 | ||
702 | err = inet_ctl_sock_create(&sctp_ctl_sock, family, | 700 | err = inet_ctl_sock_create(&sctp_ctl_sock, family, |
703 | SOCK_SEQPACKET, IPPROTO_SCTP, &init_net); | 701 | SOCK_SEQPACKET, IPPROTO_SCTP, &init_net); |
702 | |||
703 | /* If IPv6 socket could not be created, try the IPv4 socket */ | ||
704 | if (err < 0 && family == PF_INET6) | ||
705 | err = inet_ctl_sock_create(&sctp_ctl_sock, AF_INET, | ||
706 | SOCK_SEQPACKET, IPPROTO_SCTP, | ||
707 | &init_net); | ||
708 | |||
704 | if (err < 0) { | 709 | if (err < 0) { |
705 | printk(KERN_ERR | 710 | printk(KERN_ERR |
706 | "SCTP: Failed to create the SCTP control socket.\n"); | 711 | "SCTP: Failed to create the SCTP control socket.\n"); |
@@ -1297,9 +1302,8 @@ SCTP_STATIC __init int sctp_init(void) | |||
1297 | out: | 1302 | out: |
1298 | return status; | 1303 | return status; |
1299 | err_v6_add_protocol: | 1304 | err_v6_add_protocol: |
1300 | sctp_v6_del_protocol(); | ||
1301 | err_add_protocol: | ||
1302 | sctp_v4_del_protocol(); | 1305 | sctp_v4_del_protocol(); |
1306 | err_add_protocol: | ||
1303 | inet_ctl_sock_destroy(sctp_ctl_sock); | 1307 | inet_ctl_sock_destroy(sctp_ctl_sock); |
1304 | err_ctl_sock_init: | 1308 | err_ctl_sock_init: |
1305 | sctp_v6_protosw_exit(); | 1309 | sctp_v6_protosw_exit(); |
@@ -1310,7 +1314,6 @@ err_protosw_init: | |||
1310 | sctp_v4_pf_exit(); | 1314 | sctp_v4_pf_exit(); |
1311 | sctp_v6_pf_exit(); | 1315 | sctp_v6_pf_exit(); |
1312 | sctp_sysctl_unregister(); | 1316 | sctp_sysctl_unregister(); |
1313 | list_del(&sctp_af_inet.list); | ||
1314 | free_pages((unsigned long)sctp_port_hashtable, | 1317 | free_pages((unsigned long)sctp_port_hashtable, |
1315 | get_order(sctp_port_hashsize * | 1318 | get_order(sctp_port_hashsize * |
1316 | sizeof(struct sctp_bind_hashbucket))); | 1319 | sizeof(struct sctp_bind_hashbucket))); |
@@ -1358,7 +1361,6 @@ SCTP_STATIC __exit void sctp_exit(void) | |||
1358 | sctp_v4_pf_exit(); | 1361 | sctp_v4_pf_exit(); |
1359 | 1362 | ||
1360 | sctp_sysctl_unregister(); | 1363 | sctp_sysctl_unregister(); |
1361 | list_del(&sctp_af_inet.list); | ||
1362 | 1364 | ||
1363 | free_pages((unsigned long)sctp_assoc_hashtable, | 1365 | free_pages((unsigned long)sctp_assoc_hashtable, |
1364 | get_order(sctp_assoc_hashsize * | 1366 | get_order(sctp_assoc_hashsize * |
diff --git a/net/sctp/sm_sideeffect.c b/net/sctp/sm_sideeffect.c index 5385150df296..e2020eb2c8ca 100644 --- a/net/sctp/sm_sideeffect.c +++ b/net/sctp/sm_sideeffect.c | |||
@@ -787,36 +787,48 @@ static void sctp_cmd_process_operr(sctp_cmd_seq_t *cmds, | |||
787 | struct sctp_association *asoc, | 787 | struct sctp_association *asoc, |
788 | struct sctp_chunk *chunk) | 788 | struct sctp_chunk *chunk) |
789 | { | 789 | { |
790 | struct sctp_operr_chunk *operr_chunk; | ||
791 | struct sctp_errhdr *err_hdr; | 790 | struct sctp_errhdr *err_hdr; |
791 | struct sctp_ulpevent *ev; | ||
792 | 792 | ||
793 | operr_chunk = (struct sctp_operr_chunk *)chunk->chunk_hdr; | 793 | while (chunk->chunk_end > chunk->skb->data) { |
794 | err_hdr = &operr_chunk->err_hdr; | 794 | err_hdr = (struct sctp_errhdr *)(chunk->skb->data); |
795 | 795 | ||
796 | switch (err_hdr->cause) { | 796 | ev = sctp_ulpevent_make_remote_error(asoc, chunk, 0, |
797 | case SCTP_ERROR_UNKNOWN_CHUNK: | 797 | GFP_ATOMIC); |
798 | { | 798 | if (!ev) |
799 | struct sctp_chunkhdr *unk_chunk_hdr; | 799 | return; |
800 | 800 | ||
801 | unk_chunk_hdr = (struct sctp_chunkhdr *)err_hdr->variable; | 801 | sctp_ulpq_tail_event(&asoc->ulpq, ev); |
802 | switch (unk_chunk_hdr->type) { | 802 | |
803 | /* ADDIP 4.1 A9) If the peer responds to an ASCONF with an | 803 | switch (err_hdr->cause) { |
804 | * ERROR chunk reporting that it did not recognized the ASCONF | 804 | case SCTP_ERROR_UNKNOWN_CHUNK: |
805 | * chunk type, the sender of the ASCONF MUST NOT send any | 805 | { |
806 | * further ASCONF chunks and MUST stop its T-4 timer. | 806 | sctp_chunkhdr_t *unk_chunk_hdr; |
807 | */ | 807 | |
808 | case SCTP_CID_ASCONF: | 808 | unk_chunk_hdr = (sctp_chunkhdr_t *)err_hdr->variable; |
809 | asoc->peer.asconf_capable = 0; | 809 | switch (unk_chunk_hdr->type) { |
810 | sctp_add_cmd_sf(cmds, SCTP_CMD_TIMER_STOP, | 810 | /* ADDIP 4.1 A9) If the peer responds to an ASCONF with |
811 | * an ERROR chunk reporting that it did not recognized | ||
812 | * the ASCONF chunk type, the sender of the ASCONF MUST | ||
813 | * NOT send any further ASCONF chunks and MUST stop its | ||
814 | * T-4 timer. | ||
815 | */ | ||
816 | case SCTP_CID_ASCONF: | ||
817 | if (asoc->peer.asconf_capable == 0) | ||
818 | break; | ||
819 | |||
820 | asoc->peer.asconf_capable = 0; | ||
821 | sctp_add_cmd_sf(cmds, SCTP_CMD_TIMER_STOP, | ||
811 | SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); | 822 | SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); |
823 | break; | ||
824 | default: | ||
825 | break; | ||
826 | } | ||
812 | break; | 827 | break; |
828 | } | ||
813 | default: | 829 | default: |
814 | break; | 830 | break; |
815 | } | 831 | } |
816 | break; | ||
817 | } | ||
818 | default: | ||
819 | break; | ||
820 | } | 832 | } |
821 | } | 833 | } |
822 | 834 | ||
diff --git a/net/sctp/sm_statefuns.c b/net/sctp/sm_statefuns.c index a907bab0963d..55a61aa69662 100644 --- a/net/sctp/sm_statefuns.c +++ b/net/sctp/sm_statefuns.c | |||
@@ -3165,7 +3165,6 @@ sctp_disposition_t sctp_sf_operr_notify(const struct sctp_endpoint *ep, | |||
3165 | sctp_cmd_seq_t *commands) | 3165 | sctp_cmd_seq_t *commands) |
3166 | { | 3166 | { |
3167 | struct sctp_chunk *chunk = arg; | 3167 | struct sctp_chunk *chunk = arg; |
3168 | struct sctp_ulpevent *ev; | ||
3169 | 3168 | ||
3170 | if (!sctp_vtag_verify(chunk, asoc)) | 3169 | if (!sctp_vtag_verify(chunk, asoc)) |
3171 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); | 3170 | return sctp_sf_pdiscard(ep, asoc, type, arg, commands); |
@@ -3175,21 +3174,10 @@ sctp_disposition_t sctp_sf_operr_notify(const struct sctp_endpoint *ep, | |||
3175 | return sctp_sf_violation_chunklen(ep, asoc, type, arg, | 3174 | return sctp_sf_violation_chunklen(ep, asoc, type, arg, |
3176 | commands); | 3175 | commands); |
3177 | 3176 | ||
3178 | while (chunk->chunk_end > chunk->skb->data) { | 3177 | sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR, |
3179 | ev = sctp_ulpevent_make_remote_error(asoc, chunk, 0, | 3178 | SCTP_CHUNK(chunk)); |
3180 | GFP_ATOMIC); | ||
3181 | if (!ev) | ||
3182 | goto nomem; | ||
3183 | 3179 | ||
3184 | sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, | ||
3185 | SCTP_ULPEVENT(ev)); | ||
3186 | sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR, | ||
3187 | SCTP_CHUNK(chunk)); | ||
3188 | } | ||
3189 | return SCTP_DISPOSITION_CONSUME; | 3180 | return SCTP_DISPOSITION_CONSUME; |
3190 | |||
3191 | nomem: | ||
3192 | return SCTP_DISPOSITION_NOMEM; | ||
3193 | } | 3181 | } |
3194 | 3182 | ||
3195 | /* | 3183 | /* |
diff --git a/security/selinux/netlabel.c b/security/selinux/netlabel.c index 3f4b26647386..350794ab9b42 100644 --- a/security/selinux/netlabel.c +++ b/security/selinux/netlabel.c | |||
@@ -386,11 +386,12 @@ int selinux_netlbl_inode_permission(struct inode *inode, int mask) | |||
386 | if (!S_ISSOCK(inode->i_mode) || | 386 | if (!S_ISSOCK(inode->i_mode) || |
387 | ((mask & (MAY_WRITE | MAY_APPEND)) == 0)) | 387 | ((mask & (MAY_WRITE | MAY_APPEND)) == 0)) |
388 | return 0; | 388 | return 0; |
389 | |||
390 | sock = SOCKET_I(inode); | 389 | sock = SOCKET_I(inode); |
391 | sk = sock->sk; | 390 | sk = sock->sk; |
391 | if (sk == NULL) | ||
392 | return 0; | ||
392 | sksec = sk->sk_security; | 393 | sksec = sk->sk_security; |
393 | if (sksec->nlbl_state != NLBL_REQUIRE) | 394 | if (sksec == NULL || sksec->nlbl_state != NLBL_REQUIRE) |
394 | return 0; | 395 | return 0; |
395 | 396 | ||
396 | local_bh_disable(); | 397 | local_bh_disable(); |
diff --git a/sound/pci/hda/hda_intel.c b/sound/pci/hda/hda_intel.c index c8d9178f47e5..5e909e0da04b 100644 --- a/sound/pci/hda/hda_intel.c +++ b/sound/pci/hda/hda_intel.c | |||
@@ -2095,6 +2095,8 @@ static struct snd_pci_quirk probe_mask_list[] __devinitdata = { | |||
2095 | SND_PCI_QUIRK(0x1028, 0x20ac, "Dell Studio Desktop", 0x01), | 2095 | SND_PCI_QUIRK(0x1028, 0x20ac, "Dell Studio Desktop", 0x01), |
2096 | /* including bogus ALC268 in slot#2 that conflicts with ALC888 */ | 2096 | /* including bogus ALC268 in slot#2 that conflicts with ALC888 */ |
2097 | SND_PCI_QUIRK(0x17c0, 0x4085, "Medion MD96630", 0x01), | 2097 | SND_PCI_QUIRK(0x17c0, 0x4085, "Medion MD96630", 0x01), |
2098 | /* conflict of ALC268 in slot#3 (digital I/O); a temporary fix */ | ||
2099 | SND_PCI_QUIRK(0x1179, 0xff00, "Toshiba laptop", 0x03), | ||
2098 | {} | 2100 | {} |
2099 | }; | 2101 | }; |
2100 | 2102 | ||
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index a680be0d4534..6c26afcb8262 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
@@ -10557,6 +10557,7 @@ static struct snd_pci_quirk alc262_cfg_tbl[] = { | |||
10557 | SND_PCI_QUIRK(0x103c, 0x1309, "HP xw4*00", ALC262_HP_BPC), | 10557 | SND_PCI_QUIRK(0x103c, 0x1309, "HP xw4*00", ALC262_HP_BPC), |
10558 | SND_PCI_QUIRK(0x103c, 0x130a, "HP xw6*00", ALC262_HP_BPC), | 10558 | SND_PCI_QUIRK(0x103c, 0x130a, "HP xw6*00", ALC262_HP_BPC), |
10559 | SND_PCI_QUIRK(0x103c, 0x130b, "HP xw8*00", ALC262_HP_BPC), | 10559 | SND_PCI_QUIRK(0x103c, 0x130b, "HP xw8*00", ALC262_HP_BPC), |
10560 | SND_PCI_QUIRK(0x103c, 0x170b, "HP xw*", ALC262_HP_BPC), | ||
10560 | SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL), | 10561 | SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL), |
10561 | SND_PCI_QUIRK(0x103c, 0x2801, "HP D7000", ALC262_HP_BPC_D7000_WF), | 10562 | SND_PCI_QUIRK(0x103c, 0x2801, "HP D7000", ALC262_HP_BPC_D7000_WF), |
10562 | SND_PCI_QUIRK(0x103c, 0x2802, "HP D7000", ALC262_HP_BPC_D7000_WL), | 10563 | SND_PCI_QUIRK(0x103c, 0x2802, "HP D7000", ALC262_HP_BPC_D7000_WL), |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 8027edf3c8f2..3bc427645da8 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
@@ -4989,7 +4989,7 @@ again: | |||
4989 | case STAC_DELL_M4_3: | 4989 | case STAC_DELL_M4_3: |
4990 | spec->num_dmics = 1; | 4990 | spec->num_dmics = 1; |
4991 | spec->num_smuxes = 0; | 4991 | spec->num_smuxes = 0; |
4992 | spec->num_dmuxes = 0; | 4992 | spec->num_dmuxes = 1; |
4993 | break; | 4993 | break; |
4994 | default: | 4994 | default: |
4995 | spec->num_dmics = STAC92HD71BXX_NUM_DMICS; | 4995 | spec->num_dmics = STAC92HD71BXX_NUM_DMICS; |