Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
drivers/net/tokenring/tmspci.c
drivers/net/ucc_geth_mii.c

+1047 -540
+35
Documentation/networking/ipv6.txt
··· 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 +
+5 -6
Documentation/scsi/cxgb3i.txt
··· 4 4 ============ 5 5 6 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 8 (DDP) where the hardware handles the expensive byte touching operations, such 9 9 as CRC computation and verification, and direct DMA to the final host memory 10 10 destination: ··· 31 31 the TCP segments onto the wire. It handles TCP retransmission if 32 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 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 37 if possible, will be directly placed into the pre-posted host DDP 38 38 buffer. Otherwise, the payload data will be sent to the host too. 39 39 ··· 68 68 sure the ip address is unique in the network. 69 69 70 70 3. edit /etc/iscsi/iscsid.conf 71 - The default setting for MaxRecvDataSegmentLength (131072) is too big, 72 - replace "node.conn[0].iscsi.MaxRecvDataSegmentLength" to be a value no 73 - bigger than 15360 (for example 8192): 71 + The default setting for MaxRecvDataSegmentLength (131072) is too big; 72 + replace with a value no bigger than 15360 (for example 8192): 74 73 75 74 node.conn[0].iscsi.MaxRecvDataSegmentLength = 8192 76 75
+1 -1
MAINTAINERS
··· 2466 2466 2467 2467 ISDN SUBSYSTEM 2468 2468 P: Karsten Keil 2469 - M: kkeil@suse.de 2469 + M: isdn@linux-pingi.de 2470 2470 L: isdn4linux@listserv.isdn4linux.de (subscribers-only) 2471 2471 W: http://www.isdn4linux.de 2472 2472 T: git kernel.org:/pub/scm/linux/kernel/kkeil/isdn-2.6.git
+1 -1
Makefile
··· 1 1 VERSION = 2 2 2 PATCHLEVEL = 6 3 3 SUBLEVEL = 29 4 - EXTRAVERSION = -rc6 4 + EXTRAVERSION = -rc7 5 5 NAME = Erotic Pickled Herring 6 6 7 7 # *DOCUMENTATION*
+7 -6
arch/arm/kernel/setup.c
··· 233 233 unsigned int cachetype = read_cpuid_cachetype(); 234 234 unsigned int arch = cpu_architecture(); 235 235 236 - if (arch >= CPU_ARCH_ARMv7) { 237 - cacheid = CACHEID_VIPT_NONALIASING; 238 - if ((cachetype & (3 << 14)) == 1 << 14) 239 - cacheid |= CACHEID_ASID_TAGGED; 240 - } else if (arch >= CPU_ARCH_ARMv6) { 241 - if (cachetype & (1 << 23)) 236 + if (arch >= CPU_ARCH_ARMv6) { 237 + if ((cachetype & (7 << 29)) == 4 << 29) { 238 + /* ARMv7 register format */ 239 + cacheid = CACHEID_VIPT_NONALIASING; 240 + if ((cachetype & (3 << 14)) == 1 << 14) 241 + cacheid |= CACHEID_ASID_TAGGED; 242 + } else if (cachetype & (1 << 23)) 242 243 cacheid = CACHEID_VIPT_ALIASING; 243 244 else 244 245 cacheid = CACHEID_VIPT_NONALIASING;
-1
arch/arm/mach-at91/pm.c
··· 332 332 at91_sys_read(AT91_AIC_IPR) & at91_sys_read(AT91_AIC_IMR)); 333 333 334 334 error: 335 - sdram_selfrefresh_disable(); 336 335 target_state = PM_SUSPEND_ON; 337 336 at91_irq_resume(); 338 337 at91_gpio_resume();
+1 -1
arch/arm/mach-omap2/board-ldp.c
··· 81 81 } 82 82 83 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 85 udelay(100); 86 86 87 87 eth_gpio = LDP_SMC911X_GPIO;
+2 -1
arch/arm/mm/abort-ev6.S
··· 23 23 #ifdef CONFIG_CPU_32v6K 24 24 clrex 25 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 28 #endif 28 29 mrc p15, 0, r1, c5, c0, 0 @ get FSR 29 30 mrc p15, 0, r0, c6, c0, 0 @ get FAR
+1 -1
arch/arm/plat-s3c64xx/irq-eint.c
··· 55 55 u32 mask; 56 56 57 57 mask = __raw_readl(S3C64XX_EINT0MASK); 58 - mask |= eint_irq_to_bit(irq); 58 + mask &= ~eint_irq_to_bit(irq); 59 59 __raw_writel(mask, S3C64XX_EINT0MASK); 60 60 } 61 61
-1
arch/mips/include/asm/seccomp.h
··· 1 1 #ifndef __ASM_SECCOMP_H 2 2 3 - #include <linux/thread_info.h> 4 3 #include <linux/unistd.h> 5 4 6 5 #define __NR_seccomp_read __NR_read
+5
arch/powerpc/include/asm/compat.h
··· 210 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 218 #endif /* __KERNEL__ */ 214 219 #endif /* _ASM_POWERPC_COMPAT_H */
-4
arch/powerpc/include/asm/seccomp.h
··· 1 1 #ifndef _ASM_POWERPC_SECCOMP_H 2 2 #define _ASM_POWERPC_SECCOMP_H 3 3 4 - #ifdef __KERNEL__ 5 - #include <linux/thread_info.h> 6 - #endif 7 - 8 4 #include <linux/unistd.h> 9 5 10 6 #define __NR_seccomp_read __NR_read
+4
arch/powerpc/platforms/86xx/gef_sbc610.c
··· 142 142 { 143 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 149 printk(KERN_INFO "Running NEC uPD720101 Fixup\n"); 146 150 147 151 /* Ensure ports 1, 2, 3, 4 & 5 are enabled */
+1 -1
arch/s390/crypto/aes_s390.c
··· 556 556 module_init(aes_s390_init); 557 557 module_exit(aes_s390_fini); 558 558 559 - MODULE_ALIAS("aes"); 559 + MODULE_ALIAS("aes-all"); 560 560 561 561 MODULE_DESCRIPTION("Rijndael (AES) Cipher Algorithm"); 562 562 MODULE_LICENSE("GPL");
+5
arch/sparc/include/asm/compat.h
··· 240 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 248 #endif /* _ASM_SPARC64_COMPAT_H */
-6
arch/sparc/include/asm/seccomp.h
··· 1 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 3 #include <linux/unistd.h> 10 4 11 5 #define __NR_seccomp_read __NR_read
-6
arch/x86/include/asm/seccomp_32.h
··· 1 1 #ifndef _ASM_X86_SECCOMP_32_H 2 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 4 #include <linux/unistd.h> 11 5 12 6 #define __NR_seccomp_read __NR_read
-8
arch/x86/include/asm/seccomp_64.h
··· 1 1 #ifndef _ASM_X86_SECCOMP_64_H 2 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 4 #include <linux/unistd.h> 13 5 #include <asm/ia32_unistd.h> 14 6
+1 -1
arch/x86/kernel/ptrace.c
··· 1388 1388 #ifdef CONFIG_X86_32 1389 1389 # define IS_IA32 1 1390 1390 #elif defined CONFIG_IA32_EMULATION 1391 - # define IS_IA32 test_thread_flag(TIF_IA32) 1391 + # define IS_IA32 is_compat_task() 1392 1392 #else 1393 1393 # define IS_IA32 0 1394 1394 #endif
+2
arch/x86/mm/init_64.c
··· 714 714 pos = start_pfn << PAGE_SHIFT; 715 715 end_pfn = ((pos + (PMD_SIZE - 1)) >> PMD_SHIFT) 716 716 << (PMD_SHIFT - PAGE_SHIFT); 717 + if (end_pfn > (end >> PAGE_SHIFT)) 718 + end_pfn = end >> PAGE_SHIFT; 717 719 if (start_pfn < end_pfn) { 718 720 nr_range = save_mr(mr, nr_range, start_pfn, end_pfn, 0); 719 721 pos = end_pfn << PAGE_SHIFT;
+4 -11
arch/x86/mm/iomap_32.c
··· 20 20 #include <asm/pat.h> 21 21 #include <linux/module.h> 22 22 23 - #ifdef CONFIG_X86_PAE 24 - int 25 - is_io_mapping_possible(resource_size_t base, unsigned long size) 23 + int is_io_mapping_possible(resource_size_t base, unsigned long size) 26 24 { 27 - return 1; 28 - } 29 - #else 30 - int 31 - is_io_mapping_possible(resource_size_t base, unsigned long size) 32 - { 25 + #ifndef CONFIG_X86_PAE 33 26 /* There is no way to map greater than 1 << 32 address without PAE */ 34 27 if (base + size > 0x100000000ULL) 35 28 return 0; 36 - 29 + #endif 37 30 return 1; 38 31 } 39 - #endif 32 + EXPORT_SYMBOL_GPL(is_io_mapping_possible); 40 33 41 34 /* Map 'pfn' using fixed map 'type' and protections 'prot' 42 35 */
+96 -53
arch/x86/mm/kmmio.c
··· 32 32 struct list_head list; 33 33 struct kmmio_fault_page *release_next; 34 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 39 * Number of times this page has been registered as a part 38 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 44 int count; 42 45 }; ··· 108 105 return NULL; 109 106 } 110 107 111 - static void set_page_present(unsigned long addr, bool present, 112 - unsigned int *pglevel) 108 + static void set_pmd_presence(pmd_t *pmd, bool present, bool *old) 113 109 { 114 - pteval_t pteval; 115 - pmdval_t pmdval; 110 + pmdval_t v = pmd_val(*pmd); 111 + *old = !!(v & _PAGE_PRESENT); 112 + v &= ~_PAGE_PRESENT; 113 + if (present) 114 + v |= _PAGE_PRESENT; 115 + set_pmd(pmd, __pmd(v)); 116 + } 117 + 118 + static void set_pte_presence(pte_t *pte, bool present, bool *old) 119 + { 120 + pteval_t v = pte_val(*pte); 121 + *old = !!(v & _PAGE_PRESENT); 122 + v &= ~_PAGE_PRESENT; 123 + if (present) 124 + v |= _PAGE_PRESENT; 125 + set_pte_atomic(pte, __pte(v)); 126 + } 127 + 128 + static int set_page_presence(unsigned long addr, bool present, bool *old) 129 + { 116 130 unsigned int level; 117 - pmd_t *pmd; 118 131 pte_t *pte = lookup_address(addr, &level); 119 132 120 133 if (!pte) { 121 134 pr_err("kmmio: no pte for page 0x%08lx\n", addr); 122 - return; 135 + return -1; 123 136 } 124 - 125 - if (pglevel) 126 - *pglevel = level; 127 137 128 138 switch (level) { 129 139 case PG_LEVEL_2M: 130 - pmd = (pmd_t *)pte; 131 - pmdval = pmd_val(*pmd) & ~_PAGE_PRESENT; 132 - if (present) 133 - pmdval |= _PAGE_PRESENT; 134 - set_pmd(pmd, __pmd(pmdval)); 140 + set_pmd_presence((pmd_t *)pte, present, old); 135 141 break; 136 - 137 142 case PG_LEVEL_4K: 138 - pteval = pte_val(*pte) & ~_PAGE_PRESENT; 139 - if (present) 140 - pteval |= _PAGE_PRESENT; 141 - set_pte_atomic(pte, __pte(pteval)); 143 + set_pte_presence(pte, present, old); 142 144 break; 143 - 144 145 default: 145 146 pr_err("kmmio: unexpected page level 0x%x.\n", level); 146 - return; 147 + return -1; 147 148 } 148 149 149 150 __flush_tlb_one(addr); 151 + return 0; 150 152 } 151 153 152 - /** Mark the given page as not present. Access to it will trigger a fault. */ 153 - static void arm_kmmio_fault_page(unsigned long page, unsigned int *pglevel) 154 + /* 155 + * Mark the given page as not present. Access to it will trigger a fault. 156 + * 157 + * Struct kmmio_fault_page is protected by RCU and kmmio_lock, but the 158 + * protection is ignored here. RCU read lock is assumed held, so the struct 159 + * will not disappear unexpectedly. Furthermore, the caller must guarantee, 160 + * that double arming the same virtual address (page) cannot occur. 161 + * 162 + * Double disarming on the other hand is allowed, and may occur when a fault 163 + * and mmiotrace shutdown happen simultaneously. 164 + */ 165 + static int arm_kmmio_fault_page(struct kmmio_fault_page *f) 154 166 { 155 - set_page_present(page & PAGE_MASK, false, pglevel); 167 + int ret; 168 + WARN_ONCE(f->armed, KERN_ERR "kmmio page already armed.\n"); 169 + if (f->armed) { 170 + pr_warning("kmmio double-arm: page 0x%08lx, ref %d, old %d\n", 171 + f->page, f->count, f->old_presence); 172 + } 173 + ret = set_page_presence(f->page, false, &f->old_presence); 174 + WARN_ONCE(ret < 0, KERN_ERR "kmmio arming 0x%08lx failed.\n", f->page); 175 + f->armed = true; 176 + return ret; 156 177 } 157 178 158 - /** Mark the given page as present. */ 159 - static void disarm_kmmio_fault_page(unsigned long page, unsigned int *pglevel) 179 + /** Restore the given page to saved presence state. */ 180 + static void disarm_kmmio_fault_page(struct kmmio_fault_page *f) 160 181 { 161 - set_page_present(page & PAGE_MASK, true, pglevel); 182 + bool tmp; 183 + int ret = set_page_presence(f->page, f->old_presence, &tmp); 184 + WARN_ONCE(ret < 0, 185 + KERN_ERR "kmmio disarming 0x%08lx failed.\n", f->page); 186 + f->armed = false; 162 187 } 163 188 164 189 /* ··· 233 202 234 203 ctx = &get_cpu_var(kmmio_ctx); 235 204 if (ctx->active) { 236 - disarm_kmmio_fault_page(faultpage->page, NULL); 237 205 if (addr == ctx->addr) { 238 206 /* 239 - * On SMP we sometimes get recursive probe hits on the 240 - * same address. Context is already saved, fall out. 207 + * A second fault on the same page means some other 208 + * condition needs handling by do_page_fault(), the 209 + * page really not being present is the most common. 241 210 */ 242 - pr_debug("kmmio: duplicate probe hit on CPU %d, for " 243 - "address 0x%08lx.\n", 244 - smp_processor_id(), addr); 245 - ret = 1; 246 - goto no_kmmio_ctx; 247 - } 248 - /* 249 - * Prevent overwriting already in-flight context. 250 - * This should not happen, let's hope disarming at least 251 - * prevents a panic. 252 - */ 253 - pr_emerg("kmmio: recursive probe hit on CPU %d, " 211 + pr_debug("kmmio: secondary hit for 0x%08lx CPU %d.\n", 212 + addr, smp_processor_id()); 213 + 214 + if (!faultpage->old_presence) 215 + pr_info("kmmio: unexpected secondary hit for " 216 + "address 0x%08lx on CPU %d.\n", addr, 217 + smp_processor_id()); 218 + } else { 219 + /* 220 + * Prevent overwriting already in-flight context. 221 + * This should not happen, let's hope disarming at 222 + * least prevents a panic. 223 + */ 224 + pr_emerg("kmmio: recursive probe hit on CPU %d, " 254 225 "for address 0x%08lx. Ignoring.\n", 255 226 smp_processor_id(), addr); 256 - pr_emerg("kmmio: previous hit was at 0x%08lx.\n", 257 - ctx->addr); 227 + pr_emerg("kmmio: previous hit was at 0x%08lx.\n", 228 + ctx->addr); 229 + disarm_kmmio_fault_page(faultpage); 230 + } 258 231 goto no_kmmio_ctx; 259 232 } 260 233 ctx->active++; ··· 279 244 regs->flags &= ~X86_EFLAGS_IF; 280 245 281 246 /* Now we set present bit in PTE and single step. */ 282 - disarm_kmmio_fault_page(ctx->fpage->page, NULL); 247 + disarm_kmmio_fault_page(ctx->fpage); 283 248 284 249 /* 285 250 * If another cpu accesses the same page while we are stepping, ··· 310 275 struct kmmio_context *ctx = &get_cpu_var(kmmio_ctx); 311 276 312 277 if (!ctx->active) { 313 - pr_debug("kmmio: spurious debug trap on CPU %d.\n", 278 + pr_warning("kmmio: spurious debug trap on CPU %d.\n", 314 279 smp_processor_id()); 315 280 goto out; 316 281 } ··· 318 283 if (ctx->probe && ctx->probe->post_handler) 319 284 ctx->probe->post_handler(ctx->probe, condition, regs); 320 285 321 - arm_kmmio_fault_page(ctx->fpage->page, NULL); 286 + /* Prevent racing against release_kmmio_fault_page(). */ 287 + spin_lock(&kmmio_lock); 288 + if (ctx->fpage->count) 289 + arm_kmmio_fault_page(ctx->fpage); 290 + spin_unlock(&kmmio_lock); 322 291 323 292 regs->flags &= ~X86_EFLAGS_TF; 324 293 regs->flags |= ctx->saved_flags; ··· 354 315 f = get_kmmio_fault_page(page); 355 316 if (f) { 356 317 if (!f->count) 357 - arm_kmmio_fault_page(f->page, NULL); 318 + arm_kmmio_fault_page(f); 358 319 f->count++; 359 320 return 0; 360 321 } 361 322 362 - f = kmalloc(sizeof(*f), GFP_ATOMIC); 323 + f = kzalloc(sizeof(*f), GFP_ATOMIC); 363 324 if (!f) 364 325 return -1; 365 326 366 327 f->count = 1; 367 328 f->page = page; 368 - list_add_rcu(&f->list, kmmio_page_list(f->page)); 369 329 370 - arm_kmmio_fault_page(f->page, NULL); 330 + if (arm_kmmio_fault_page(f)) { 331 + kfree(f); 332 + return -1; 333 + } 334 + 335 + list_add_rcu(&f->list, kmmio_page_list(f->page)); 371 336 372 337 return 0; 373 338 } ··· 390 347 f->count--; 391 348 BUG_ON(f->count < 0); 392 349 if (!f->count) { 393 - disarm_kmmio_fault_page(f->page, NULL); 350 + disarm_kmmio_fault_page(f); 394 351 f->release_next = *release_list; 395 352 *release_list = f; 396 353 }
+2
arch/x86/mm/pat.c
··· 11 11 #include <linux/bootmem.h> 12 12 #include <linux/debugfs.h> 13 13 #include <linux/kernel.h> 14 + #include <linux/module.h> 14 15 #include <linux/gfp.h> 15 16 #include <linux/mm.h> 16 17 #include <linux/fs.h> ··· 869 868 else 870 869 return pgprot_noncached(prot); 871 870 } 871 + EXPORT_SYMBOL_GPL(pgprot_writecombine); 872 872 873 873 #if defined(CONFIG_DEBUG_FS) && defined(CONFIG_X86_PAT) 874 874
+57 -13
arch/x86/mm/testmmiotrace.c
··· 1 1 /* 2 - * Written by Pekka Paalanen, 2008 <pq@iki.fi> 2 + * Written by Pekka Paalanen, 2008-2009 <pq@iki.fi> 3 3 */ 4 4 #include <linux/module.h> 5 5 #include <linux/io.h> ··· 9 9 10 10 static unsigned long mmio_address; 11 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 30 static void do_write_test(void __iomem *p) 15 31 { 16 32 unsigned int i; 33 + pr_info(MODULE_NAME ": write test.\n"); 17 34 mmiotrace_printk("Write test.\n"); 35 + 18 36 for (i = 0; i < 256; i++) 19 37 iowrite8(i, p + i); 38 + 20 39 for (i = 1024; i < (5 * 1024); i += 2) 21 - iowrite16(i * 12 + 7, p + i); 40 + iowrite16(v16(i), p + i); 41 + 22 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 46 static void do_read_test(void __iomem *p) 27 47 { 28 48 unsigned int i; 49 + unsigned errs[3] = { 0 }; 50 + pr_info(MODULE_NAME ": read test.\n"); 29 51 mmiotrace_printk("Read test.\n"); 52 + 30 53 for (i = 0; i < 256; i++) 31 - ioread8(p + i); 54 + if (ioread8(p + i) != i) 55 + ++errs[0]; 56 + 32 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 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 80 if (!p) { 42 81 pr_err(MODULE_NAME ": could not ioremap, aborting.\n"); 43 82 return; ··· 84 45 mmiotrace_printk("ioremap returned %p.\n", p); 85 46 do_write_test(p); 86 47 do_read_test(p); 48 + if (read_far && read_far < size - 4) 49 + do_read_far_test(p); 87 50 iounmap(p); 88 51 } 89 52 90 53 static int __init init(void) 91 54 { 55 + unsigned long size = (read_far) ? (8 << 20) : (16 << 10); 56 + 92 57 if (mmio_address == 0) { 93 58 pr_err(MODULE_NAME ": you have to use the module argument " 94 59 "mmio_address.\n"); ··· 101 58 return -ENXIO; 102 59 } 103 60 104 - pr_warning(MODULE_NAME ": WARNING: mapping 16 kB @ 0x%08lx " 105 - "in PCI address space, and writing " 106 - "rubbish in there.\n", mmio_address); 107 - do_test(); 61 + pr_warning(MODULE_NAME ": WARNING: mapping %lu kB @ 0x%08lx in PCI " 62 + "address space, and writing 16 kB of rubbish in there.\n", 63 + size >> 10, mmio_address); 64 + do_test(size); 65 + pr_info(MODULE_NAME ": All done.\n"); 108 66 return 0; 109 67 } 110 68
+12 -2
arch/x86/oprofile/op_model_ppro.c
··· 78 78 if (cpu_has_arch_perfmon) { 79 79 union cpuid10_eax eax; 80 80 eax.full = cpuid_eax(0xa); 81 - if (counter_width < eax.split.bit_width) 82 - counter_width = eax.split.bit_width; 81 + 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 95 /* clear all counters */
+13 -2
crypto/api.c
··· 215 215 mask &= ~(CRYPTO_ALG_LARVAL | CRYPTO_ALG_DEAD); 216 216 type &= mask; 217 217 218 - alg = try_then_request_module(crypto_alg_lookup(name, type, mask), 219 - name); 218 + alg = crypto_alg_lookup(name, type, mask); 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 231 if (alg) 221 232 return crypto_is_larval(alg) ? crypto_larval_wait(alg) : alg; 222 233
+1 -1
drivers/block/aoe/aoedev.c
··· 173 173 return; 174 174 while (atomic_read(&skb_shinfo(skb)->dataref) != 1 && i-- > 0) 175 175 msleep(Sms); 176 - if (i <= 0) { 176 + if (i < 0) { 177 177 printk(KERN_ERR 178 178 "aoe: %s holds ref: %s\n", 179 179 skb->dev ? skb->dev->name : "netif",
+4 -2
drivers/crypto/ixp4xx_crypto.c
··· 457 457 if (!ctx_pool) { 458 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 462 if (ret) 462 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 466 if (ret) { 465 467 qmgr_release_queue(SEND_QID); 466 468 goto err;
+1 -1
drivers/crypto/padlock-aes.c
··· 489 489 MODULE_LICENSE("GPL"); 490 490 MODULE_AUTHOR("Michal Ludvig"); 491 491 492 - MODULE_ALIAS("aes"); 492 + MODULE_ALIAS("aes-all");
+2 -2
drivers/crypto/padlock-sha.c
··· 304 304 MODULE_LICENSE("GPL"); 305 305 MODULE_AUTHOR("Michal Ludvig"); 306 306 307 - MODULE_ALIAS("sha1"); 308 - MODULE_ALIAS("sha256"); 307 + MODULE_ALIAS("sha1-all"); 308 + MODULE_ALIAS("sha256-all"); 309 309 MODULE_ALIAS("sha1-padlock"); 310 310 MODULE_ALIAS("sha256-padlock");
+1 -1
drivers/dma/iop-adma.c
··· 1401 1401 1402 1402 static struct platform_driver iop_adma_driver = { 1403 1403 .probe = iop_adma_probe, 1404 - .remove = iop_adma_remove, 1404 + .remove = __devexit_p(iop_adma_remove), 1405 1405 .driver = { 1406 1406 .owner = THIS_MODULE, 1407 1407 .name = "iop-adma",
+1 -1
drivers/dma/mv_xor.c
··· 1287 1287 1288 1288 static struct platform_driver mv_xor_driver = { 1289 1289 .probe = mv_xor_probe, 1290 - .remove = mv_xor_remove, 1290 + .remove = __devexit_p(mv_xor_remove), 1291 1291 .driver = { 1292 1292 .owner = THIS_MODULE, 1293 1293 .name = MV_XOR_NAME,
+1 -1
drivers/gpu/drm/drm_bufs.c
··· 420 420 dev->sigdata.lock = NULL; 421 421 master->lock.hw_lock = NULL; /* SHM removed */ 422 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 425 break; 426 426 case _DRM_AGP:
+14
drivers/gpu/drm/drm_fops.c
··· 484 484 mutex_lock(&dev->struct_mutex); 485 485 486 486 if (file_priv->is_master) { 487 + struct drm_master *master = file_priv->master; 487 488 struct drm_file *temp; 488 489 list_for_each_entry(temp, &dev->filelist, lhead) { 489 490 if ((temp->master == file_priv->master) && 490 491 (temp != file_priv)) 491 492 temp->authenticated = 0; 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); 492 506 } 493 507 494 508 if (file_priv->minor->master == file_priv->master) {
+2 -1
drivers/gpu/drm/drm_lock.c
··· 80 80 __set_current_state(TASK_INTERRUPTIBLE); 81 81 if (!master->lock.hw_lock) { 82 82 /* Device has been unregistered */ 83 + send_sig(SIGTERM, current, 0); 83 84 ret = -EINTR; 84 85 break; 85 86 } ··· 94 93 /* Contention */ 95 94 schedule(); 96 95 if (signal_pending(current)) { 97 - ret = -ERESTARTSYS; 96 + ret = -EINTR; 98 97 break; 99 98 } 100 99 }
+1 -9
drivers/gpu/drm/drm_stub.c
··· 146 146 147 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 149 drm_free(master, sizeof(*master), DRM_MEM_DRIVER); 158 150 } 159 151 ··· 168 176 file_priv->minor->master != file_priv->master) { 169 177 mutex_lock(&dev->struct_mutex); 170 178 file_priv->minor->master = drm_master_get(file_priv->master); 171 - mutex_lock(&dev->struct_mutex); 179 + mutex_unlock(&dev->struct_mutex); 172 180 } 173 181 174 182 return 0;
+3 -2
drivers/gpu/drm/i915/i915_irq.c
··· 383 383 drm_i915_irq_emit_t *emit = data; 384 384 int result; 385 385 386 - RING_LOCK_TEST_WITH_RETURN(dev, file_priv); 387 - 388 386 if (!dev_priv) { 389 387 DRM_ERROR("called with no initialization\n"); 390 388 return -EINVAL; 391 389 } 390 + 391 + RING_LOCK_TEST_WITH_RETURN(dev, file_priv); 392 + 392 393 mutex_lock(&dev->struct_mutex); 393 394 result = i915_emit_irq(dev); 394 395 mutex_unlock(&dev->struct_mutex);
+2 -2
drivers/i2c/busses/i2c-mv64xxx.c
··· 482 482 return 0; 483 483 } 484 484 485 - static void __devexit 485 + static void 486 486 mv64xxx_i2c_unmap_regs(struct mv64xxx_i2c_data *drv_data) 487 487 { 488 488 if (drv_data->reg_base) { ··· 577 577 578 578 static struct platform_driver mv64xxx_i2c_driver = { 579 579 .probe = mv64xxx_i2c_probe, 580 - .remove = mv64xxx_i2c_remove, 580 + .remove = __devexit_p(mv64xxx_i2c_remove), 581 581 .driver = { 582 582 .owner = THIS_MODULE, 583 583 .name = MV64XXX_I2C_CTLR_NAME,
+2 -2
drivers/input/keyboard/atkbd.c
··· 839 839 */ 840 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 843 0x85, 0x86, 0x87, 0x88, 0x89, 0x8a, 0x8b, 0x8f, 0x93, 844 844 }; 845 845 int i; ··· 856 856 */ 857 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 860 0x94, 861 861 }; 862 862 int i;
+2 -2
drivers/input/keyboard/bf54x-keys.c
··· 209 209 goto out; 210 210 } 211 211 212 - if (!pdata->debounce_time || !pdata->debounce_time > MAX_MULT || 213 - !pdata->coldrive_time || !pdata->coldrive_time > MAX_MULT) { 212 + if (!pdata->debounce_time || pdata->debounce_time > MAX_MULT || 213 + !pdata->coldrive_time || pdata->coldrive_time > MAX_MULT) { 214 214 printk(KERN_ERR DRV_NAME 215 215 ": Invalid Debounce/Columdrive Time from pdata\n"); 216 216 bfin_write_KPAD_MSEL(0xFF0); /* Default MSEL */
+4 -4
drivers/input/keyboard/corgikbd.c
··· 288 288 #define corgikbd_resume NULL 289 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 293 struct corgikbd *corgikbd; 294 294 struct input_dev *input_dev; ··· 368 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 373 int i; 374 374 struct corgikbd *corgikbd = platform_get_drvdata(pdev); ··· 388 388 389 389 static struct platform_driver corgikbd_driver = { 390 390 .probe = corgikbd_probe, 391 - .remove = corgikbd_remove, 391 + .remove = __devexit_p(corgikbd_remove), 392 392 .suspend = corgikbd_suspend, 393 393 .resume = corgikbd_resume, 394 394 .driver = { ··· 397 397 }, 398 398 }; 399 399 400 - static int __devinit corgikbd_init(void) 400 + static int __init corgikbd_init(void) 401 401 { 402 402 return platform_driver_register(&corgikbd_driver); 403 403 }
+4 -4
drivers/input/keyboard/omap-keypad.c
··· 279 279 #define omap_kp_resume NULL 280 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 284 struct omap_kp *omap_kp; 285 285 struct input_dev *input_dev; ··· 422 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 427 struct omap_kp *omap_kp = platform_get_drvdata(pdev); 428 428 ··· 454 454 455 455 static struct platform_driver omap_kp_driver = { 456 456 .probe = omap_kp_probe, 457 - .remove = omap_kp_remove, 457 + .remove = __devexit_p(omap_kp_remove), 458 458 .suspend = omap_kp_suspend, 459 459 .resume = omap_kp_resume, 460 460 .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 468 printk(KERN_INFO "OMAP Keypad Driver\n"); 469 469 return platform_driver_register(&omap_kp_driver);
+4 -4
drivers/input/keyboard/spitzkbd.c
··· 343 343 #define spitzkbd_resume NULL 344 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 348 struct spitzkbd *spitzkbd; 349 349 struct input_dev *input_dev; ··· 444 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 449 int i; 450 450 struct spitzkbd *spitzkbd = platform_get_drvdata(dev); ··· 470 470 471 471 static struct platform_driver spitzkbd_driver = { 472 472 .probe = spitzkbd_probe, 473 - .remove = spitzkbd_remove, 473 + .remove = __devexit_p(spitzkbd_remove), 474 474 .suspend = spitzkbd_suspend, 475 475 .resume = spitzkbd_resume, 476 476 .driver = { ··· 479 479 }, 480 480 }; 481 481 482 - static int __devinit spitzkbd_init(void) 482 + static int __init spitzkbd_init(void) 483 483 { 484 484 return platform_driver_register(&spitzkbd_driver); 485 485 }
+1 -1
drivers/input/mouse/Kconfig
··· 70 70 config MOUSE_PS2_LIFEBOOK 71 71 bool "Fujitsu Lifebook PS/2 mouse protocol extension" if EMBEDDED 72 72 default y 73 - depends on MOUSE_PS2 73 + depends on MOUSE_PS2 && X86 74 74 help 75 75 Say Y here if you have a Fujitsu B-series Lifebook PS/2 76 76 TouchScreen connected to your system.
+24 -8
drivers/input/mouse/elantech.c
··· 542 542 ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || 543 543 ps2_command(ps2dev, NULL, PSMOUSE_CMD_SETSCALE11) || 544 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 546 return -1; 547 547 } 548 548 ··· 551 551 * set of magic numbers 552 552 */ 553 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", 555 - param[0], param[1], param[2]); 554 + pr_debug("elantech.c: " 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 575 return -1; 557 576 } 558 577 ··· 619 600 int i, error; 620 601 unsigned char param[3]; 621 602 622 - etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); 623 - psmouse->private = etd; 603 + psmouse->private = etd = kzalloc(sizeof(struct elantech_data), GFP_KERNEL); 624 604 if (!etd) 625 605 return -1; 626 606 ··· 628 610 etd->parity[i] = etd->parity[i & (i - 1)] ^ 1; 629 611 630 612 /* 631 - * Find out what version hardware this is 613 + * Do the version query again so we can store the result 632 614 */ 633 615 if (synaptics_send_cmd(psmouse, ETP_FW_VERSION_QUERY, param)) { 634 616 pr_err("elantech.c: failed to query firmware version.\n"); 635 617 goto init_fail; 636 618 } 637 - pr_info("elantech.c: Elantech version query result 0x%02x, 0x%02x, 0x%02x.\n", 638 - param[0], param[1], param[2]); 639 619 etd->fw_version_maj = param[0]; 640 620 etd->fw_version_min = param[2]; 641 621
+1 -1
drivers/input/mouse/pxa930_trkball.c
··· 83 83 84 84 __raw_writel(v, trkball->mmio_base + TBCR); 85 85 86 - while (i--) { 86 + while (--i) { 87 87 if (__raw_readl(trkball->mmio_base + TBCR) == v) 88 88 break; 89 89 msleep(1);
+4 -5
drivers/input/mouse/synaptics.c
··· 182 182 183 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 185 if (synaptics_identify(psmouse)) 191 186 return -1; 192 187 if (synaptics_model_id(psmouse)) ··· 577 582 struct synaptics_data *priv = psmouse->private; 578 583 struct synaptics_data old_priv = *priv; 579 584 585 + psmouse_reset(psmouse); 586 + 580 587 if (synaptics_detect(psmouse, 0)) 581 588 return -1; 582 589 ··· 636 639 psmouse->private = priv = kzalloc(sizeof(struct synaptics_data), GFP_KERNEL); 637 640 if (!priv) 638 641 return -1; 642 + 643 + psmouse_reset(psmouse); 639 644 640 645 if (synaptics_query_hardware(psmouse)) { 641 646 printk(KERN_ERR "Unable to query Synaptics hardware.\n");
+3 -3
drivers/input/serio/ambakmi.c
··· 57 57 struct amba_kmi_port *kmi = io->port_data; 58 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 61 udelay(10); 62 62 63 63 if (timeleft) ··· 129 129 io->write = amba_kmi_write; 130 130 io->open = amba_kmi_open; 131 131 io->close = amba_kmi_close; 132 - strlcpy(io->name, dev->dev.bus_id, sizeof(io->name)); 133 - strlcpy(io->phys, dev->dev.bus_id, sizeof(io->phys)); 132 + strlcpy(io->name, dev_name(&dev->dev), sizeof(io->name)); 133 + strlcpy(io->phys, dev_name(&dev->dev), sizeof(io->phys)); 134 134 io->port_data = kmi; 135 135 io->dev.parent = &dev->dev; 136 136
+1 -1
drivers/input/serio/gscps2.c
··· 359 359 360 360 snprintf(serio->name, sizeof(serio->name), "GSC PS/2 %s", 361 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 363 serio->id.type = SERIO_8042; 364 364 serio->write = gscps2_write; 365 365 serio->open = gscps2_open;
+2 -2
drivers/input/serio/sa1111ps2.c
··· 246 246 serio->write = ps2_write; 247 247 serio->open = ps2_open; 248 248 serio->close = ps2_close; 249 - strlcpy(serio->name, dev->dev.bus_id, sizeof(serio->name)); 250 - strlcpy(serio->phys, dev->dev.bus_id, sizeof(serio->phys)); 249 + strlcpy(serio->name, dev_name(&dev->dev), sizeof(serio->name)); 250 + strlcpy(serio->phys, dev_name(&dev->dev), sizeof(serio->phys)); 251 251 serio->port_data = ps2if; 252 252 serio->dev.parent = &dev->dev; 253 253 ps2if->io = serio;
+1 -1
drivers/input/touchscreen/atmel_tsadcc.c
··· 236 236 ts_dev->bufferedmeasure = 0; 237 237 238 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 241 input_dev->name = "atmel touch screen controller"; 242 242 input_dev->phys = ts_dev->phys;
+5 -4
drivers/input/touchscreen/corgi_ts.c
··· 268 268 #define corgits_resume NULL 269 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 273 struct corgi_ts *corgi_ts; 274 274 struct input_dev *input_dev; ··· 343 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 348 struct corgi_ts *corgi_ts = platform_get_drvdata(pdev); 349 349 ··· 352 352 corgi_ts->machinfo->put_hsync(); 353 353 input_unregister_device(corgi_ts->input); 354 354 kfree(corgi_ts); 355 + 355 356 return 0; 356 357 } 357 358 358 359 static struct platform_driver corgits_driver = { 359 360 .probe = corgits_probe, 360 - .remove = corgits_remove, 361 + .remove = __devexit_p(corgits_remove), 361 362 .suspend = corgits_suspend, 362 363 .resume = corgits_resume, 363 364 .driver = { ··· 367 366 }, 368 367 }; 369 368 370 - static int __devinit corgits_init(void) 369 + static int __init corgits_init(void) 371 370 { 372 371 return platform_driver_register(&corgits_driver); 373 372 }
+2 -1
drivers/input/touchscreen/tsc2007.c
··· 289 289 290 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 295 input_dev->name = "TSC2007 Touchscreen"; 295 296 input_dev->phys = ts->phys;
+18 -2
drivers/input/touchscreen/usbtouchscreen.c
··· 60 60 module_param(swap_xy, bool, 0644); 61 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 67 /* device specifc data/functions */ 64 68 struct usbtouch_usb; 65 69 struct usbtouch_device_info { ··· 122 118 123 119 #define USB_DEVICE_HID_CLASS(vend, prod) \ 124 120 .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS \ 121 + | USB_DEVICE_ID_MATCH_INT_PROTOCOL \ 125 122 | USB_DEVICE_ID_MATCH_DEVICE, \ 126 123 .idVendor = (vend), \ 127 124 .idProduct = (prod), \ ··· 265 260 266 261 static int mtouch_read_data(struct usbtouch_usb *dev, unsigned char *pkt) 267 262 { 268 - dev->x = (pkt[8] << 8) | pkt[7]; 269 - dev->y = (pkt[10] << 8) | pkt[9]; 263 + if (hwcalib_xy) { 264 + dev->x = (pkt[4] << 8) | pkt[3]; 265 + dev->y = 0xffff - ((pkt[6] << 8) | pkt[5]); 266 + } else { 267 + dev->x = (pkt[8] << 8) | pkt[7]; 268 + dev->y = (pkt[10] << 8) | pkt[9]; 269 + } 270 270 dev->touch = (pkt[2] & 0x40) ? 1 : 0; 271 271 272 272 return 1; ··· 302 292 break; 303 293 if (ret != -EPIPE) 304 294 return ret; 295 + } 296 + 297 + /* Default min/max xy are the raw values, override if using hw-calib */ 298 + if (hwcalib_xy) { 299 + input_set_abs_params(usbtouch->input, ABS_X, 0, 0xffff, 0, 0); 300 + input_set_abs_params(usbtouch->input, ABS_Y, 0, 0xffff, 0, 0); 305 301 } 306 302 307 303 return 0;
+6 -4
drivers/media/video/uvc/uvc_status.c
··· 46 46 usb_to_input_id(udev, &input->id); 47 47 input->dev.parent = &dev->intf->dev; 48 48 49 - set_bit(EV_KEY, input->evbit); 50 - set_bit(BTN_0, input->keybit); 49 + __set_bit(EV_KEY, input->evbit); 50 + __set_bit(KEY_CAMERA, input->keybit); 51 51 52 52 if ((ret = input_register_device(input)) < 0) 53 53 goto error; ··· 70 70 static void uvc_input_report_key(struct uvc_device *dev, unsigned int code, 71 71 int value) 72 72 { 73 - if (dev->input) 73 + if (dev->input) { 74 74 input_report_key(dev->input, code, value); 75 + input_sync(dev->input); 76 + } 75 77 } 76 78 77 79 #else ··· 98 96 return; 99 97 uvc_trace(UVC_TRACE_STATUS, "Button (intf %u) %s len %d\n", 100 98 data[1], data[3] ? "pressed" : "released", len); 101 - uvc_input_report_key(dev, BTN_0, data[3]); 99 + uvc_input_report_key(dev, KEY_CAMERA, data[3]); 102 100 } else { 103 101 uvc_trace(UVC_TRACE_STATUS, "Stream %u error event %02x %02x " 104 102 "len %d.\n", data[1], data[2], data[3], len);
+2 -2
drivers/message/fusion/mptbase.c
··· 91 91 controllers (default=0)"); 92 92 93 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 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 99 static int mpt_channel_mapping;
+1
drivers/mmc/host/sdhci-pci.c
··· 107 107 108 108 static const struct sdhci_pci_fixes sdhci_cafe = { 109 109 .quirks = SDHCI_QUIRK_NO_SIMULT_VDD_AND_POWER | 110 + SDHCI_QUIRK_NO_BUSY_IRQ | 110 111 SDHCI_QUIRK_BROKEN_TIMEOUT_VAL, 111 112 }; 112 113
+4 -1
drivers/mmc/host/sdhci.c
··· 1291 1291 if (host->cmd->data) 1292 1292 DBG("Cannot wait for busy signal when also " 1293 1293 "doing a data transfer"); 1294 - else 1294 + else if (!(host->quirks & SDHCI_QUIRK_NO_BUSY_IRQ)) 1295 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 1301 if (intmask & SDHCI_INT_RESPONSE)
+2
drivers/mmc/host/sdhci.h
··· 208 208 #define SDHCI_QUIRK_BROKEN_TIMEOUT_VAL (1<<12) 209 209 /* Controller has an issue with buffer bits for small transfers */ 210 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 214 int irq; /* Device IRQ */ 213 215 void __iomem * ioaddr; /* Mapped address */
+1 -1
drivers/mtd/nand/orion_nand.c
··· 149 149 150 150 static struct platform_driver orion_nand_driver = { 151 151 .probe = orion_nand_probe, 152 - .remove = orion_nand_remove, 152 + .remove = __devexit_p(orion_nand_remove), 153 153 .driver = { 154 154 .name = "orion_nand", 155 155 .owner = THIS_MODULE,
+1 -1
drivers/net/arm/Makefile
··· 4 4 # 5 5 6 6 obj-$(CONFIG_ARM_AM79C961A) += am79c961a.o 7 - obj-$(CONFIG_ARM_ETHERH) += etherh.o ../8390.o 7 + obj-$(CONFIG_ARM_ETHERH) += etherh.o 8 8 obj-$(CONFIG_ARM_ETHER3) += ether3.o 9 9 obj-$(CONFIG_ARM_ETHER1) += ether1.o 10 10 obj-$(CONFIG_ARM_AT91_ETHER) += at91_ether.o
+5 -5
drivers/net/arm/etherh.c
··· 641 641 .ndo_open = etherh_open, 642 642 .ndo_stop = etherh_close, 643 643 .ndo_set_config = etherh_set_config, 644 - .ndo_start_xmit = ei_start_xmit, 645 - .ndo_tx_timeout = ei_tx_timeout, 646 - .ndo_get_stats = ei_get_stats, 647 - .ndo_set_multicast_list = ei_set_multicast_list, 644 + .ndo_start_xmit = __ei_start_xmit, 645 + .ndo_tx_timeout = __ei_tx_timeout, 646 + .ndo_get_stats = __ei_get_stats, 647 + .ndo_set_multicast_list = __ei_set_multicast_list, 648 648 .ndo_validate_addr = eth_validate_addr, 649 649 .ndo_set_mac_address = eth_mac_addr, 650 650 .ndo_change_mtu = eth_change_mtu, 651 651 #ifdef CONFIG_NET_POLL_CONTROLLER 652 - .ndo_poll_controller = ei_poll, 652 + .ndo_poll_controller = __ei_poll, 653 653 #endif 654 654 }; 655 655
+1 -1
drivers/net/arm/ks8695net.c
··· 560 560 msleep(1); 561 561 } 562 562 563 - if (reset_timeout == 0) { 563 + if (reset_timeout < 0) { 564 564 dev_crit(ksp->dev, 565 565 "Timeout waiting for DMA engines to reset\n"); 566 566 /* And blithely carry on */
+1 -1
drivers/net/bonding/bond_main.c
··· 4121 4121 const struct net_device_ops *slave_ops 4122 4122 = slave->dev->netdev_ops; 4123 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 4126 return 0; 4127 4127 }
+2 -2
drivers/net/fsl_pq_mdio.c
··· 129 129 static int fsl_pq_mdio_reset(struct mii_bus *bus) 130 130 { 131 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 134 mutex_lock(&bus->mdio_lock); 135 135 ··· 145 145 146 146 mutex_unlock(&bus->mdio_lock); 147 147 148 - if(timeout == 0) { 148 + if (timeout < 0) { 149 149 printk(KERN_ERR "%s: The MII Bus is stuck!\n", 150 150 bus->name); 151 151 return -EBUSY;
+2 -1
drivers/net/jme.c
··· 956 956 goto out_inc; 957 957 958 958 i = atomic_read(&rxring->next_to_clean); 959 - while (limit-- > 0) { 959 + while (limit > 0) { 960 960 rxdesc = rxring->desc; 961 961 rxdesc += i; 962 962 963 963 if ((rxdesc->descwb.flags & cpu_to_le16(RXWBFLAG_OWN)) || 964 964 !(rxdesc->descwb.desccnt & RXWBDCNT_WBCPL)) 965 965 goto out; 966 + --limit; 966 967 967 968 desccnt = rxdesc->descwb.desccnt & RXWBDCNT_DCNT; 968 969
+2 -1
drivers/net/pcmcia/3c574_cs.c
··· 1035 1035 DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", 1036 1036 dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RxStatus)); 1037 1037 while (!((rx_status = inw(ioaddr + RxStatus)) & 0x8000) && 1038 - (--worklimit >= 0)) { 1038 + worklimit > 0) { 1039 + worklimit--; 1039 1040 if (rx_status & 0x4000) { /* Error, update stats. */ 1040 1041 short error = rx_status & 0x3800; 1041 1042 dev->stats.rx_errors++;
+2 -1
drivers/net/pcmcia/3c589_cs.c
··· 857 857 DEBUG(3, "%s: in rx_packet(), status %4.4x, rx_status %4.4x.\n", 858 858 dev->name, inw(ioaddr+EL3_STATUS), inw(ioaddr+RX_STATUS)); 859 859 while (!((rx_status = inw(ioaddr + RX_STATUS)) & 0x8000) && 860 - (--worklimit >= 0)) { 860 + worklimit > 0) { 861 + worklimit--; 861 862 if (rx_status & 0x4000) { /* Error, update stats. */ 862 863 short error = rx_status & 0x3800; 863 864 dev->stats.rx_errors++;
+12
drivers/net/smc911x.h
··· 42 42 #define SMC_USE_16BIT 0 43 43 #define SMC_USE_32BIT 1 44 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 55 #else 46 56 /* 47 57 * Default configuration ··· 685 675 #define CHIP_9116 0x0116 686 676 #define CHIP_9117 0x0117 687 677 #define CHIP_9118 0x0118 678 + #define CHIP_9211 0x9211 688 679 #define CHIP_9215 0x115A 689 680 #define CHIP_9217 0x117A 690 681 #define CHIP_9218 0x118A ··· 700 689 { CHIP_9116, "LAN9116" }, 701 690 { CHIP_9117, "LAN9117" }, 702 691 { CHIP_9118, "LAN9118" }, 692 + { CHIP_9211, "LAN9211" }, 703 693 { CHIP_9215, "LAN9215" }, 704 694 { CHIP_9217, "LAN9217" }, 705 695 { CHIP_9218, "LAN9218" },
+1 -1
drivers/net/sungem.c
··· 1229 1229 break; 1230 1230 } while (val & (GREG_SWRST_TXRST | GREG_SWRST_RXRST)); 1231 1231 1232 - if (limit <= 0) 1232 + if (limit < 0) 1233 1233 printk(KERN_ERR "%s: SW reset is ghetto.\n", gp->dev->name); 1234 1234 1235 1235 if (gp->phy_type == phy_serialink || gp->phy_type == phy_serdes)
+9 -9
drivers/net/tokenring/tmspci.c
··· 121 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 124 dev->base_addr = pci_ioaddr; 130 125 dev->irq = pci_irq_line; 131 126 dev->dma = 0; ··· 137 142 ret = tmsdev_init(dev, &pdev->dev); 138 143 if (ret) { 139 144 printk("%s: unable to get memory for dev->priv.\n", dev->name); 140 - goto err_out_irq; 145 + goto err_out_region; 141 146 } 142 147 143 148 tp = netdev_priv(dev); ··· 154 159 155 160 dev->netdev_ops = &tms380tr_netdev_ops; 156 161 162 + ret = request_irq(pdev->irq, tms380tr_interrupt, IRQF_SHARED, 163 + dev->name, dev); 164 + if (ret) 165 + goto err_out_tmsdev; 166 + 157 167 pci_set_drvdata(pdev, dev); 158 168 SET_NETDEV_DEV(dev, &pdev->dev); 159 169 160 170 ret = register_netdev(dev); 161 171 if (ret) 162 - goto err_out_tmsdev; 172 + goto err_out_irq; 163 173 164 174 return 0; 165 175 176 + err_out_irq: 177 + free_irq(pdev->irq, dev); 166 178 err_out_tmsdev: 167 179 pci_set_drvdata(pdev, NULL); 168 180 tmsdev_term(dev); 169 - err_out_irq: 170 - free_irq(pdev->irq, dev); 171 181 err_out_region: 172 182 release_region(pci_ioaddr, TMS_PCI_IO_EXTENT); 173 183 err_out_trdev:
+4
drivers/net/usb/dm9601.c
··· 635 635 USB_DEVICE(0x0a47, 0x9601), /* Hirose USB-100 */ 636 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 642 {}, // END 639 643 }; 640 644
+21
drivers/scsi/cxgb3i/cxgb3i.h
··· 20 20 #include <linux/list.h> 21 21 #include <linux/netdevice.h> 22 22 #include <linux/scatterlist.h> 23 + #include <linux/skbuff.h> 23 24 #include <scsi/libiscsi_tcp.h> 24 25 25 26 /* from cxgb3 LLD */ ··· 112 111 struct s3_conn *c3cn; 113 112 struct cxgb3i_hba *hba; 114 113 struct cxgb3i_conn *cconn; 114 + }; 115 + 116 + /** 117 + * struct cxgb3i_task_data - private iscsi task data 118 + * 119 + * @nr_frags: # of coalesced page frags (from scsi sgl) 120 + * @frags: coalesced page frags (from scsi sgl) 121 + * @skb: tx pdu skb 122 + * @offset: data offset for the next pdu 123 + * @count: max. possible pdu payload 124 + * @sgoffset: offset to the first sg entry for a given offset 125 + */ 126 + #define MAX_PDU_FRAGS ((ULP2_MAX_PDU_PAYLOAD + 512 - 1) / 512) 127 + struct cxgb3i_task_data { 128 + unsigned short nr_frags; 129 + skb_frag_t frags[MAX_PDU_FRAGS]; 130 + struct sk_buff *skb; 131 + unsigned int offset; 132 + unsigned int count; 133 + unsigned int sgoffset; 115 134 }; 116 135 117 136 int cxgb3i_iscsi_init(void);
+11 -8
drivers/scsi/cxgb3i/cxgb3i_ddp.c
··· 639 639 write_unlock(&cxgb3i_ddp_rwlock); 640 640 641 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 643 ppmax, ddp->llimit, ddp->ulimit, ddp->idx_bits, 644 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 647 return 0; 647 648 648 649 free_ddp_map: ··· 655 654 * cxgb3i_adapter_ddp_init - initialize the adapter's ddp resource 656 655 * @tdev: t3cdev adapter 657 656 * @tformat: tag format 658 - * @txsz: max tx pkt size, filled in by this func. 659 - * @rxsz: max rx pkt size, filled in by this func. 657 + * @txsz: max tx pdu payload size, filled in by this func. 658 + * @rxsz: max rx pdu payload size, filled in by this func. 660 659 * initialize the ddp pagepod manager for a given adapter if needed and 661 660 * setup the tag format for a given iscsi entity 662 661 */ ··· 686 685 tformat->sw_bits, tformat->rsvd_bits, 687 686 tformat->rsvd_shift, tformat->rsvd_mask); 688 687 689 - *txsz = ddp->max_txsz; 690 - *rxsz = ddp->max_rxsz; 691 - ddp_log_info("ddp max pkt size: %u, %u.\n", 692 - ddp->max_txsz, ddp->max_rxsz); 688 + *txsz = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD, 689 + ddp->max_txsz - ISCSI_PDU_NONPAYLOAD_LEN); 690 + *rxsz = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD, 691 + ddp->max_rxsz - ISCSI_PDU_NONPAYLOAD_LEN); 692 + ddp_log_info("max payload size: %u/%u, %u/%u.\n", 693 + *txsz, ddp->max_txsz, *rxsz, ddp->max_rxsz); 693 694 return 0; 694 695 } 695 696 EXPORT_SYMBOL_GPL(cxgb3i_adapter_ddp_init);
+2 -1
drivers/scsi/cxgb3i/cxgb3i_ddp.h
··· 87 87 struct sk_buff **gl_skb; 88 88 }; 89 89 90 + #define ISCSI_PDU_NONPAYLOAD_LEN 312 /* bhs(48) + ahs(256) + digest(8) */ 90 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 93 #define PPOD_PAGES_MAX 4 93 94 #define PPOD_PAGES_SHIFT 2 /* 4 pages per pod */ 94 95
+2 -2
drivers/scsi/cxgb3i/cxgb3i_init.c
··· 12 12 #include "cxgb3i.h" 13 13 14 14 #define DRV_MODULE_NAME "cxgb3i" 15 - #define DRV_MODULE_VERSION "1.0.0" 16 - #define DRV_MODULE_RELDATE "Jun. 1, 2008" 15 + #define DRV_MODULE_VERSION "1.0.1" 16 + #define DRV_MODULE_RELDATE "Jan. 2009" 17 17 18 18 static char version[] = 19 19 "Chelsio S3xx iSCSI Driver " DRV_MODULE_NAME
+9 -13
drivers/scsi/cxgb3i/cxgb3i_iscsi.c
··· 364 364 365 365 cls_session = iscsi_session_setup(&cxgb3i_iscsi_transport, shost, 366 366 cmds_max, 367 - sizeof(struct iscsi_tcp_task), 367 + sizeof(struct iscsi_tcp_task) + 368 + sizeof(struct cxgb3i_task_data), 368 369 initial_cmdsn, ISCSI_MAX_TARGET); 369 370 if (!cls_session) 370 371 return NULL; ··· 403 402 { 404 403 struct iscsi_tcp_conn *tcp_conn = conn->dd_data; 405 404 struct cxgb3i_conn *cconn = tcp_conn->dd_data; 406 - unsigned int max = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD, 407 - cconn->hba->snic->tx_max_size - 408 - ISCSI_PDU_NONPAYLOAD_MAX); 405 + unsigned int max = max(512 * MAX_SKB_FRAGS, SKB_TX_HEADROOM); 409 406 407 + max = min(cconn->hba->snic->tx_max_size, max); 410 408 if (conn->max_xmit_dlength) 411 - conn->max_xmit_dlength = min_t(unsigned int, 412 - conn->max_xmit_dlength, max); 409 + conn->max_xmit_dlength = min(conn->max_xmit_dlength, max); 413 410 else 414 411 conn->max_xmit_dlength = max; 415 412 align_pdu_size(conn->max_xmit_dlength); 416 - cxgb3i_log_info("conn 0x%p, max xmit %u.\n", 413 + cxgb3i_api_debug("conn 0x%p, max xmit %u.\n", 417 414 conn, conn->max_xmit_dlength); 418 415 return 0; 419 416 } ··· 426 427 { 427 428 struct iscsi_tcp_conn *tcp_conn = conn->dd_data; 428 429 struct cxgb3i_conn *cconn = tcp_conn->dd_data; 429 - unsigned int max = min_t(unsigned int, ULP2_MAX_PDU_PAYLOAD, 430 - cconn->hba->snic->rx_max_size - 431 - ISCSI_PDU_NONPAYLOAD_MAX); 430 + unsigned int max = cconn->hba->snic->rx_max_size; 432 431 433 432 align_pdu_size(max); 434 433 if (conn->max_recv_dlength) { ··· 436 439 conn->max_recv_dlength, max); 437 440 return -EINVAL; 438 441 } 439 - conn->max_recv_dlength = min_t(unsigned int, 440 - conn->max_recv_dlength, max); 442 + conn->max_recv_dlength = min(conn->max_recv_dlength, max); 441 443 align_pdu_size(conn->max_recv_dlength); 442 444 } else 443 445 conn->max_recv_dlength = max; ··· 840 844 .proc_name = "cxgb3i", 841 845 .queuecommand = iscsi_queuecommand, 842 846 .change_queue_depth = iscsi_change_queue_depth, 843 - .can_queue = 128 * (ISCSI_DEF_XMIT_CMDS_MAX - 1), 847 + .can_queue = CXGB3I_SCSI_QDEPTH_DFLT - 1, 844 848 .sg_tablesize = SG_ALL, 845 849 .max_sectors = 0xFFFF, 846 850 .cmd_per_lun = ISCSI_DEF_CMD_PER_LUN,
+103 -43
drivers/scsi/cxgb3i/cxgb3i_offload.c
··· 23 23 #include "cxgb3i_ddp.h" 24 24 25 25 #ifdef __DEBUG_C3CN_CONN__ 26 - #define c3cn_conn_debug cxgb3i_log_info 26 + #define c3cn_conn_debug cxgb3i_log_debug 27 27 #else 28 28 #define c3cn_conn_debug(fmt...) 29 29 #endif 30 30 31 31 #ifdef __DEBUG_C3CN_TX__ 32 - #define c3cn_tx_debug cxgb3i_log_debug 32 + #define c3cn_tx_debug cxgb3i_log_debug 33 33 #else 34 34 #define c3cn_tx_debug(fmt...) 35 35 #endif 36 36 37 37 #ifdef __DEBUG_C3CN_RX__ 38 - #define c3cn_rx_debug cxgb3i_log_debug 38 + #define c3cn_rx_debug cxgb3i_log_debug 39 39 #else 40 40 #define c3cn_rx_debug(fmt...) 41 41 #endif ··· 47 47 module_param(cxgb3_rcv_win, int, 0644); 48 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 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 54 static int cxgb3_rx_credit_thres = 10 * 1024; 55 55 module_param(cxgb3_rx_credit_thres, int, 0644); ··· 301 301 static void skb_entail(struct s3_conn *c3cn, struct sk_buff *skb, 302 302 int flags) 303 303 { 304 - CXGB3_SKB_CB(skb)->seq = c3cn->write_seq; 305 - CXGB3_SKB_CB(skb)->flags = flags; 304 + skb_tcp_seq(skb) = c3cn->write_seq; 305 + skb_flags(skb) = flags; 306 306 __skb_queue_tail(&c3cn->write_queue, skb); 307 307 } 308 308 ··· 457 457 * The number of WRs needed for an skb depends on the number of fragments 458 458 * in the skb and whether it has any payload in its main body. This maps the 459 459 * length of the gather list represented by an skb into the # of necessary WRs. 460 - * 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. 460 + * The extra two fragments are 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 463 static unsigned int skb_wrs[SKB_WR_LIST_SIZE] __read_mostly; 467 464 468 465 static void s3_init_wr_tab(unsigned int wr_len) ··· 482 485 483 486 static inline void reset_wr_list(struct s3_conn *c3cn) 484 487 { 485 - c3cn->wr_pending_head = NULL; 488 + c3cn->wr_pending_head = c3cn->wr_pending_tail = NULL; 486 489 } 487 490 488 491 /* ··· 493 496 static inline void enqueue_wr(struct s3_conn *c3cn, 494 497 struct sk_buff *skb) 495 498 { 496 - skb_wr_data(skb) = NULL; 499 + skb_tx_wr_next(skb) = NULL; 497 500 498 501 /* 499 502 * We want to take an extra reference since both us and the driver ··· 506 509 if (!c3cn->wr_pending_head) 507 510 c3cn->wr_pending_head = skb; 508 511 else 509 - skb_wr_data(skb) = skb; 512 + skb_tx_wr_next(c3cn->wr_pending_tail) = skb; 510 513 c3cn->wr_pending_tail = skb; 514 + } 515 + 516 + static int count_pending_wrs(struct s3_conn *c3cn) 517 + { 518 + int n = 0; 519 + const struct sk_buff *skb = c3cn->wr_pending_head; 520 + 521 + while (skb) { 522 + n += skb->csum; 523 + skb = skb_tx_wr_next(skb); 524 + } 525 + return n; 511 526 } 512 527 513 528 static inline struct sk_buff *peek_wr(const struct s3_conn *c3cn) ··· 538 529 539 530 if (likely(skb)) { 540 531 /* Don't bother clearing the tail */ 541 - c3cn->wr_pending_head = skb_wr_data(skb); 542 - skb_wr_data(skb) = NULL; 532 + c3cn->wr_pending_head = skb_tx_wr_next(skb); 533 + skb_tx_wr_next(skb) = NULL; 543 534 } 544 535 return skb; 545 536 } ··· 552 543 } 553 544 554 545 static inline void make_tx_data_wr(struct s3_conn *c3cn, struct sk_buff *skb, 555 - int len) 546 + int len, int req_completion) 556 547 { 557 548 struct tx_data_wr *req; 558 549 559 550 skb_reset_transport_header(skb); 560 551 req = (struct tx_data_wr *)__skb_push(skb, sizeof(*req)); 561 - req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA)); 552 + req->wr_hi = htonl(V_WR_OP(FW_WROPCODE_OFLD_TX_DATA) | 553 + (req_completion ? F_WR_COMPL : 0)); 562 554 req->wr_lo = htonl(V_WR_TID(c3cn->tid)); 563 555 req->sndseq = htonl(c3cn->snd_nxt); 564 556 /* len includes the length of any HW ULP additions */ ··· 602 592 603 593 if (unlikely(c3cn->state == C3CN_STATE_CONNECTING || 604 594 c3cn->state == C3CN_STATE_CLOSE_WAIT_1 || 605 - c3cn->state == C3CN_STATE_ABORTING)) { 595 + c3cn->state >= C3CN_STATE_ABORTING)) { 606 596 c3cn_tx_debug("c3cn 0x%p, in closing state %u.\n", 607 597 c3cn, c3cn->state); 608 598 return 0; ··· 625 615 if (c3cn->wr_avail < wrs_needed) { 626 616 c3cn_tx_debug("c3cn 0x%p, skb len %u/%u, frag %u, " 627 617 "wr %d < %u.\n", 628 - c3cn, skb->len, skb->datalen, frags, 618 + c3cn, skb->len, skb->data_len, frags, 629 619 wrs_needed, c3cn->wr_avail); 630 620 break; 631 621 } ··· 637 627 c3cn->wr_unacked += wrs_needed; 638 628 enqueue_wr(c3cn, skb); 639 629 640 - if (likely(CXGB3_SKB_CB(skb)->flags & C3CB_FLAG_NEED_HDR)) { 641 - len += ulp_extra_len(skb); 642 - make_tx_data_wr(c3cn, skb, len); 643 - c3cn->snd_nxt += len; 644 - if ((req_completion 645 - && c3cn->wr_unacked == wrs_needed) 646 - || (CXGB3_SKB_CB(skb)->flags & C3CB_FLAG_COMPL) 647 - || c3cn->wr_unacked >= c3cn->wr_max / 2) { 648 - struct work_request_hdr *wr = cplhdr(skb); 630 + c3cn_tx_debug("c3cn 0x%p, enqueue, skb len %u/%u, frag %u, " 631 + "wr %d, left %u, unack %u.\n", 632 + c3cn, skb->len, skb->data_len, frags, 633 + wrs_needed, c3cn->wr_avail, c3cn->wr_unacked); 649 634 650 - wr->wr_hi |= htonl(F_WR_COMPL); 635 + 636 + if (likely(skb_flags(skb) & C3CB_FLAG_NEED_HDR)) { 637 + if ((req_completion && 638 + c3cn->wr_unacked == wrs_needed) || 639 + (skb_flags(skb) & C3CB_FLAG_COMPL) || 640 + c3cn->wr_unacked >= c3cn->wr_max / 2) { 641 + req_completion = 1; 651 642 c3cn->wr_unacked = 0; 652 643 } 653 - CXGB3_SKB_CB(skb)->flags &= ~C3CB_FLAG_NEED_HDR; 644 + len += ulp_extra_len(skb); 645 + make_tx_data_wr(c3cn, skb, len, req_completion); 646 + c3cn->snd_nxt += len; 647 + skb_flags(skb) &= ~C3CB_FLAG_NEED_HDR; 654 648 } 655 649 656 650 total_size += skb->truesize; ··· 749 735 if (unlikely(c3cn_flag(c3cn, C3CN_ACTIVE_CLOSE_NEEDED))) 750 736 /* upper layer has requested closing */ 751 737 send_abort_req(c3cn); 752 - else if (c3cn_push_tx_frames(c3cn, 1)) 738 + else { 739 + if (skb_queue_len(&c3cn->write_queue)) 740 + c3cn_push_tx_frames(c3cn, 1); 753 741 cxgb3i_conn_tx_open(c3cn); 742 + } 754 743 } 755 744 756 745 static int do_act_establish(struct t3cdev *cdev, struct sk_buff *skb, ··· 1099 1082 return; 1100 1083 } 1101 1084 1102 - CXGB3_SKB_CB(skb)->seq = ntohl(hdr_cpl->seq); 1103 - CXGB3_SKB_CB(skb)->flags = 0; 1085 + skb_tcp_seq(skb) = ntohl(hdr_cpl->seq); 1086 + skb_flags(skb) = 0; 1104 1087 1105 1088 skb_reset_transport_header(skb); 1106 1089 __skb_pull(skb, sizeof(struct cpl_iscsi_hdr)); ··· 1120 1103 goto abort_conn; 1121 1104 1122 1105 skb_ulp_mode(skb) = ULP2_FLAG_DATA_READY; 1123 - skb_ulp_pdulen(skb) = ntohs(ddp_cpl.len); 1124 - skb_ulp_ddigest(skb) = ntohl(ddp_cpl.ulp_crc); 1106 + skb_rx_pdulen(skb) = ntohs(ddp_cpl.len); 1107 + skb_rx_ddigest(skb) = ntohl(ddp_cpl.ulp_crc); 1125 1108 status = ntohl(ddp_cpl.ddp_status); 1126 1109 1127 1110 c3cn_rx_debug("rx skb 0x%p, len %u, pdulen %u, ddp status 0x%x.\n", 1128 - skb, skb->len, skb_ulp_pdulen(skb), status); 1111 + skb, skb->len, skb_rx_pdulen(skb), status); 1129 1112 1130 1113 if (status & (1 << RX_DDP_STATUS_HCRC_SHIFT)) 1131 1114 skb_ulp_mode(skb) |= ULP2_FLAG_HCRC_ERROR; ··· 1143 1126 } else if (status & (1 << RX_DDP_STATUS_DDP_SHIFT)) 1144 1127 skb_ulp_mode(skb) |= ULP2_FLAG_DATA_DDPED; 1145 1128 1146 - c3cn->rcv_nxt = ntohl(ddp_cpl.seq) + skb_ulp_pdulen(skb); 1129 + c3cn->rcv_nxt = ntohl(ddp_cpl.seq) + skb_rx_pdulen(skb); 1147 1130 __pskb_trim(skb, len); 1148 1131 __skb_queue_tail(&c3cn->receive_queue, skb); 1149 1132 cxgb3i_conn_pdu_ready(c3cn); ··· 1168 1151 * Process an acknowledgment of WR completion. Advance snd_una and send the 1169 1152 * next batch of work requests from the write queue. 1170 1153 */ 1154 + static void check_wr_invariants(struct s3_conn *c3cn) 1155 + { 1156 + int pending = count_pending_wrs(c3cn); 1157 + 1158 + if (unlikely(c3cn->wr_avail + pending != c3cn->wr_max)) 1159 + cxgb3i_log_error("TID %u: credit imbalance: avail %u, " 1160 + "pending %u, total should be %u\n", 1161 + c3cn->tid, c3cn->wr_avail, pending, 1162 + c3cn->wr_max); 1163 + } 1164 + 1171 1165 static void process_wr_ack(struct s3_conn *c3cn, struct sk_buff *skb) 1172 1166 { 1173 1167 struct cpl_wr_ack *hdr = cplhdr(skb); 1174 1168 unsigned int credits = ntohs(hdr->credits); 1175 1169 u32 snd_una = ntohl(hdr->snd_una); 1170 + 1171 + c3cn_tx_debug("%u WR credits, avail %u, unack %u, TID %u, state %u.\n", 1172 + credits, c3cn->wr_avail, c3cn->wr_unacked, 1173 + c3cn->tid, c3cn->state); 1176 1174 1177 1175 c3cn->wr_avail += credits; 1178 1176 if (c3cn->wr_unacked > c3cn->wr_max - c3cn->wr_avail) ··· 1203 1171 break; 1204 1172 } 1205 1173 if (unlikely(credits < p->csum)) { 1174 + struct tx_data_wr *w = cplhdr(p); 1175 + cxgb3i_log_error("TID %u got %u WR credits need %u, " 1176 + "len %u, main body %u, frags %u, " 1177 + "seq # %u, ACK una %u, ACK nxt %u, " 1178 + "WR_AVAIL %u, WRs pending %u\n", 1179 + c3cn->tid, credits, p->csum, p->len, 1180 + p->len - p->data_len, 1181 + skb_shinfo(p)->nr_frags, 1182 + ntohl(w->sndseq), snd_una, 1183 + ntohl(hdr->snd_nxt), c3cn->wr_avail, 1184 + count_pending_wrs(c3cn) - credits); 1206 1185 p->csum -= credits; 1207 1186 break; 1208 1187 } else { ··· 1223 1180 } 1224 1181 } 1225 1182 1226 - if (unlikely(before(snd_una, c3cn->snd_una))) 1183 + check_wr_invariants(c3cn); 1184 + 1185 + if (unlikely(before(snd_una, c3cn->snd_una))) { 1186 + cxgb3i_log_error("TID %u, unexpected sequence # %u in WR_ACK " 1187 + "snd_una %u\n", 1188 + c3cn->tid, snd_una, c3cn->snd_una); 1227 1189 goto out_free; 1190 + } 1228 1191 1229 1192 if (c3cn->snd_una != snd_una) { 1230 1193 c3cn->snd_una = snd_una; 1231 1194 dst_confirm(c3cn->dst_cache); 1232 1195 } 1233 1196 1234 - if (skb_queue_len(&c3cn->write_queue) && c3cn_push_tx_frames(c3cn, 0)) 1197 + if (skb_queue_len(&c3cn->write_queue)) { 1198 + if (c3cn_push_tx_frames(c3cn, 0)) 1199 + cxgb3i_conn_tx_open(c3cn); 1200 + } else 1235 1201 cxgb3i_conn_tx_open(c3cn); 1236 1202 out_free: 1237 1203 __kfree_skb(skb); ··· 1504 1452 struct dst_entry *dst) 1505 1453 { 1506 1454 BUG_ON(c3cn->cdev != cdev); 1507 - c3cn->wr_max = c3cn->wr_avail = T3C_DATA(cdev)->max_wrs; 1455 + c3cn->wr_max = c3cn->wr_avail = T3C_DATA(cdev)->max_wrs - 1; 1508 1456 c3cn->wr_unacked = 0; 1509 1457 c3cn->mss_idx = select_mss(c3cn, dst_mtu(dst)); 1510 1458 ··· 1723 1671 goto out_err; 1724 1672 } 1725 1673 1726 - err = -EPIPE; 1727 1674 if (c3cn->err) { 1728 1675 c3cn_tx_debug("c3cn 0x%p, err %d.\n", c3cn, c3cn->err); 1676 + err = -EPIPE; 1677 + goto out_err; 1678 + } 1679 + 1680 + if (c3cn->write_seq - c3cn->snd_una >= cxgb3_snd_win) { 1681 + c3cn_tx_debug("c3cn 0x%p, snd %u - %u > %u.\n", 1682 + c3cn, c3cn->write_seq, c3cn->snd_una, 1683 + cxgb3_snd_win); 1684 + err = -EAGAIN; 1729 1685 goto out_err; 1730 1686 } 1731 1687
+19 -10
drivers/scsi/cxgb3i/cxgb3i_offload.h
··· 178 178 * @flag: see C3CB_FLAG_* below 179 179 * @ulp_mode: ULP mode/submode of sk_buff 180 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 191 struct cxgb3_skb_cb { 186 192 __u8 flags; 187 193 __u8 ulp_mode; 188 194 __u32 seq; 189 - __u32 ddigest; 190 - __u32 pdulen; 191 - struct sk_buff *wr_data; 195 + union { 196 + struct cxgb3_skb_rx_cb rx; 197 + struct cxgb3_skb_tx_cb tx; 198 + }; 192 199 }; 193 200 194 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 203 #define skb_ulp_mode(skb) (CXGB3_SKB_CB(skb)->ulp_mode) 197 - #define skb_ulp_ddigest(skb) (CXGB3_SKB_CB(skb)->ddigest) 198 - #define skb_ulp_pdulen(skb) (CXGB3_SKB_CB(skb)->pdulen) 199 - #define skb_wr_data(skb) (CXGB3_SKB_CB(skb)->wr_data) 204 + #define skb_tcp_seq(skb) (CXGB3_SKB_CB(skb)->seq) 205 + #define skb_rx_ddigest(skb) (CXGB3_SKB_CB(skb)->rx.ddigest) 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 209 enum c3cb_flags { 202 210 C3CB_FLAG_NEED_HDR = 1 << 0, /* packet needs a TX_DATA_WR header */ ··· 225 217 /* for TX: a skb must have a headroom of at least TX_HEADER_LEN bytes */ 226 218 #define TX_HEADER_LEN \ 227 219 (sizeof(struct tx_data_wr) + sizeof(struct sge_opaque_hdr)) 220 + #define SKB_TX_HEADROOM SKB_MAX_HEAD(TX_HEADER_LEN) 228 221 229 222 /* 230 223 * get and set private ip for iscsi traffic
+181 -88
drivers/scsi/cxgb3i/cxgb3i_pdu.c
··· 32 32 #define cxgb3i_tx_debug(fmt...) 33 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 39 static struct page *pad_page; 36 40 37 41 /* ··· 150 146 151 147 void cxgb3i_conn_cleanup_task(struct iscsi_task *task) 152 148 { 153 - struct iscsi_tcp_task *tcp_task = task->dd_data; 149 + struct cxgb3i_task_data *tdata = task->dd_data + 150 + sizeof(struct iscsi_tcp_task); 154 151 155 152 /* never reached the xmit task callout */ 156 - if (tcp_task->dd_data) 157 - kfree_skb(tcp_task->dd_data); 158 - tcp_task->dd_data = NULL; 153 + if (tdata->skb) 154 + __kfree_skb(tdata->skb); 155 + memset(tdata, 0, sizeof(struct cxgb3i_task_data)); 159 156 160 157 /* MNC - Do we need a check in case this is called but 161 158 * cxgb3i_conn_alloc_pdu has never been called on the task */ ··· 164 159 iscsi_tcp_cleanup_task(task); 165 160 } 166 161 167 - /* 168 - * We do not support ahs yet 169 - */ 162 + static int sgl_seek_offset(struct scatterlist *sgl, unsigned int sgcnt, 163 + unsigned int offset, unsigned int *off, 164 + struct scatterlist **sgp) 165 + { 166 + int i; 167 + struct scatterlist *sg; 168 + 169 + for_each_sg(sgl, sg, sgcnt, i) { 170 + if (offset < sg->length) { 171 + *off = offset; 172 + *sgp = sg; 173 + return 0; 174 + } 175 + offset -= sg->length; 176 + } 177 + return -EFAULT; 178 + } 179 + 180 + static int sgl_read_to_frags(struct scatterlist *sg, unsigned int sgoffset, 181 + unsigned int dlen, skb_frag_t *frags, 182 + int frag_max) 183 + { 184 + unsigned int datalen = dlen; 185 + unsigned int sglen = sg->length - sgoffset; 186 + struct page *page = sg_page(sg); 187 + int i; 188 + 189 + i = 0; 190 + do { 191 + unsigned int copy; 192 + 193 + if (!sglen) { 194 + sg = sg_next(sg); 195 + if (!sg) { 196 + cxgb3i_log_error("%s, sg NULL, len %u/%u.\n", 197 + __func__, datalen, dlen); 198 + return -EINVAL; 199 + } 200 + sgoffset = 0; 201 + sglen = sg->length; 202 + page = sg_page(sg); 203 + 204 + } 205 + copy = min(datalen, sglen); 206 + if (i && page == frags[i - 1].page && 207 + sgoffset + sg->offset == 208 + frags[i - 1].page_offset + frags[i - 1].size) { 209 + frags[i - 1].size += copy; 210 + } else { 211 + if (i >= frag_max) { 212 + cxgb3i_log_error("%s, too many pages %u, " 213 + "dlen %u.\n", __func__, 214 + frag_max, dlen); 215 + return -EINVAL; 216 + } 217 + 218 + frags[i].page = page; 219 + frags[i].page_offset = sg->offset + sgoffset; 220 + frags[i].size = copy; 221 + i++; 222 + } 223 + datalen -= copy; 224 + sgoffset += copy; 225 + sglen -= copy; 226 + } while (datalen); 227 + 228 + return i; 229 + } 230 + 170 231 int cxgb3i_conn_alloc_pdu(struct iscsi_task *task, u8 opcode) 171 232 { 233 + struct iscsi_conn *conn = task->conn; 172 234 struct iscsi_tcp_task *tcp_task = task->dd_data; 173 - struct sk_buff *skb; 235 + struct cxgb3i_task_data *tdata = task->dd_data + sizeof(*tcp_task); 236 + struct scsi_cmnd *sc = task->sc; 237 + int headroom = SKB_TX_PDU_HEADER_LEN; 174 238 239 + tcp_task->dd_data = tdata; 175 240 task->hdr = NULL; 176 - /* always allocate rooms for AHS */ 177 - skb = alloc_skb(sizeof(struct iscsi_hdr) + ISCSI_MAX_AHS_SIZE + 178 - TX_HEADER_LEN, GFP_ATOMIC); 179 - if (!skb) 241 + 242 + /* write command, need to send data pdus */ 243 + if (skb_extra_headroom && (opcode == ISCSI_OP_SCSI_DATA_OUT || 244 + (opcode == ISCSI_OP_SCSI_CMD && 245 + (scsi_bidi_cmnd(sc) || sc->sc_data_direction == DMA_TO_DEVICE)))) 246 + headroom += min(skb_extra_headroom, conn->max_xmit_dlength); 247 + 248 + tdata->skb = alloc_skb(TX_HEADER_LEN + headroom, GFP_ATOMIC); 249 + if (!tdata->skb) 180 250 return -ENOMEM; 251 + skb_reserve(tdata->skb, TX_HEADER_LEN); 181 252 182 253 cxgb3i_tx_debug("task 0x%p, opcode 0x%x, skb 0x%p.\n", 183 - task, opcode, skb); 254 + task, opcode, tdata->skb); 184 255 185 - tcp_task->dd_data = skb; 186 - skb_reserve(skb, TX_HEADER_LEN); 187 - task->hdr = (struct iscsi_hdr *)skb->data; 188 - task->hdr_max = sizeof(struct iscsi_hdr); 256 + task->hdr = (struct iscsi_hdr *)tdata->skb->data; 257 + task->hdr_max = SKB_TX_PDU_HEADER_LEN; 189 258 190 259 /* data_out uses scsi_cmd's itt */ 191 260 if (opcode != ISCSI_OP_SCSI_DATA_OUT) ··· 271 192 int cxgb3i_conn_init_pdu(struct iscsi_task *task, unsigned int offset, 272 193 unsigned int count) 273 194 { 274 - struct iscsi_tcp_task *tcp_task = task->dd_data; 275 - struct sk_buff *skb = tcp_task->dd_data; 276 195 struct iscsi_conn *conn = task->conn; 277 - struct page *pg; 196 + struct iscsi_tcp_task *tcp_task = task->dd_data; 197 + struct cxgb3i_task_data *tdata = tcp_task->dd_data; 198 + struct sk_buff *skb = tdata->skb; 278 199 unsigned int datalen = count; 279 200 int i, padlen = iscsi_padding(count); 280 - skb_frag_t *frag; 201 + struct page *pg; 281 202 282 203 cxgb3i_tx_debug("task 0x%p,0x%p, offset %u, count %u, skb 0x%p.\n", 283 204 task, task->sc, offset, count, skb); ··· 288 209 return 0; 289 210 290 211 if (task->sc) { 291 - struct scatterlist *sg; 292 - struct scsi_data_buffer *sdb; 293 - unsigned int sgoffset = offset; 294 - struct page *sgpg; 295 - unsigned int sglen; 212 + struct scsi_data_buffer *sdb = scsi_out(task->sc); 213 + struct scatterlist *sg = NULL; 214 + int err; 296 215 297 - sdb = scsi_out(task->sc); 298 - sg = sdb->table.sgl; 299 - 300 - for_each_sg(sdb->table.sgl, sg, sdb->table.nents, i) { 301 - cxgb3i_tx_debug("sg %d, page 0x%p, len %u offset %u\n", 302 - i, sg_page(sg), sg->length, sg->offset); 303 - 304 - if (sgoffset < sg->length) 305 - break; 306 - sgoffset -= sg->length; 216 + tdata->offset = offset; 217 + tdata->count = count; 218 + err = sgl_seek_offset(sdb->table.sgl, sdb->table.nents, 219 + tdata->offset, &tdata->sgoffset, &sg); 220 + if (err < 0) { 221 + cxgb3i_log_warn("tpdu, sgl %u, bad offset %u/%u.\n", 222 + sdb->table.nents, tdata->offset, 223 + sdb->length); 224 + return err; 307 225 } 308 - sgpg = sg_page(sg); 309 - sglen = sg->length - sgoffset; 226 + err = sgl_read_to_frags(sg, tdata->sgoffset, tdata->count, 227 + tdata->frags, MAX_PDU_FRAGS); 228 + if (err < 0) { 229 + cxgb3i_log_warn("tpdu, sgl %u, bad offset %u + %u.\n", 230 + sdb->table.nents, tdata->offset, 231 + tdata->count); 232 + return err; 233 + } 234 + tdata->nr_frags = err; 310 235 311 - do { 312 - int j = skb_shinfo(skb)->nr_frags; 313 - unsigned int copy; 236 + if (tdata->nr_frags > MAX_SKB_FRAGS || 237 + (padlen && tdata->nr_frags == MAX_SKB_FRAGS)) { 238 + char *dst = skb->data + task->hdr_len; 239 + skb_frag_t *frag = tdata->frags; 314 240 315 - if (!sglen) { 316 - sg = sg_next(sg); 317 - sgpg = sg_page(sg); 318 - sgoffset = 0; 319 - sglen = sg->length; 320 - ++i; 241 + /* data fits in the skb's headroom */ 242 + for (i = 0; i < tdata->nr_frags; i++, frag++) { 243 + char *src = kmap_atomic(frag->page, 244 + KM_SOFTIRQ0); 245 + 246 + memcpy(dst, src+frag->page_offset, frag->size); 247 + dst += frag->size; 248 + kunmap_atomic(src, KM_SOFTIRQ0); 321 249 } 322 - copy = min(sglen, datalen); 323 - if (j && skb_can_coalesce(skb, j, sgpg, 324 - sg->offset + sgoffset)) { 325 - skb_shinfo(skb)->frags[j - 1].size += copy; 326 - } else { 327 - get_page(sgpg); 328 - skb_fill_page_desc(skb, j, sgpg, 329 - sg->offset + sgoffset, copy); 250 + if (padlen) { 251 + memset(dst, 0, padlen); 252 + padlen = 0; 330 253 } 331 - sgoffset += copy; 332 - sglen -= copy; 333 - datalen -= copy; 334 - } while (datalen); 254 + skb_put(skb, count + padlen); 255 + } else { 256 + /* data fit into frag_list */ 257 + for (i = 0; i < tdata->nr_frags; i++) 258 + get_page(tdata->frags[i].page); 259 + 260 + memcpy(skb_shinfo(skb)->frags, tdata->frags, 261 + sizeof(skb_frag_t) * tdata->nr_frags); 262 + skb_shinfo(skb)->nr_frags = tdata->nr_frags; 263 + skb->len += count; 264 + skb->data_len += count; 265 + skb->truesize += count; 266 + } 267 + 335 268 } else { 336 269 pg = virt_to_page(task->data); 337 270 338 - while (datalen) { 339 - i = skb_shinfo(skb)->nr_frags; 340 - frag = &skb_shinfo(skb)->frags[i]; 341 - 342 - get_page(pg); 343 - frag->page = pg; 344 - frag->page_offset = 0; 345 - frag->size = min((unsigned int)PAGE_SIZE, datalen); 346 - 347 - skb_shinfo(skb)->nr_frags++; 348 - datalen -= frag->size; 349 - pg++; 350 - } 271 + get_page(pg); 272 + skb_fill_page_desc(skb, 0, pg, offset_in_page(task->data), 273 + count); 274 + skb->len += count; 275 + skb->data_len += count; 276 + skb->truesize += count; 351 277 } 352 278 353 279 if (padlen) { 354 280 i = skb_shinfo(skb)->nr_frags; 355 - frag = &skb_shinfo(skb)->frags[i]; 356 - frag->page = pad_page; 357 - frag->page_offset = 0; 358 - frag->size = padlen; 359 - skb_shinfo(skb)->nr_frags++; 281 + get_page(pad_page); 282 + skb_fill_page_desc(skb, skb_shinfo(skb)->nr_frags, pad_page, 0, 283 + padlen); 284 + 285 + skb->data_len += padlen; 286 + skb->truesize += padlen; 287 + skb->len += padlen; 360 288 } 361 289 362 - datalen = count + padlen; 363 - skb->data_len += datalen; 364 - skb->truesize += datalen; 365 - skb->len += datalen; 366 290 return 0; 367 291 } 368 292 369 293 int cxgb3i_conn_xmit_pdu(struct iscsi_task *task) 370 294 { 371 - struct iscsi_tcp_task *tcp_task = task->dd_data; 372 - struct sk_buff *skb = tcp_task->dd_data; 373 295 struct iscsi_tcp_conn *tcp_conn = task->conn->dd_data; 374 296 struct cxgb3i_conn *cconn = tcp_conn->dd_data; 297 + struct iscsi_tcp_task *tcp_task = task->dd_data; 298 + struct cxgb3i_task_data *tdata = tcp_task->dd_data; 299 + struct sk_buff *skb = tdata->skb; 375 300 unsigned int datalen; 376 301 int err; 377 302 ··· 383 300 return 0; 384 301 385 302 datalen = skb->data_len; 386 - tcp_task->dd_data = NULL; 303 + tdata->skb = NULL; 387 304 err = cxgb3i_c3cn_send_pdus(cconn->cep->c3cn, skb); 388 - cxgb3i_tx_debug("task 0x%p, skb 0x%p, len %u/%u, rv %d.\n", 389 - task, skb, skb->len, skb->data_len, err); 390 305 if (err > 0) { 391 306 int pdulen = err; 307 + 308 + cxgb3i_tx_debug("task 0x%p, skb 0x%p, len %u/%u, rv %d.\n", 309 + task, skb, skb->len, skb->data_len, err); 392 310 393 311 if (task->conn->hdrdgst_en) 394 312 pdulen += ISCSI_DIGEST_SIZE; ··· 409 325 return err; 410 326 } 411 327 /* reset skb to send when we are called again */ 412 - tcp_task->dd_data = skb; 328 + tdata->skb = skb; 413 329 return -EAGAIN; 414 330 } 415 331 416 332 int cxgb3i_pdu_init(void) 417 333 { 334 + if (SKB_TX_HEADROOM > (512 * MAX_SKB_FRAGS)) 335 + skb_extra_headroom = SKB_TX_HEADROOM; 418 336 pad_page = alloc_page(GFP_KERNEL); 419 337 if (!pad_page) 420 338 return -ENOMEM; ··· 452 366 skb = skb_peek(&c3cn->receive_queue); 453 367 while (!err && skb) { 454 368 __skb_unlink(skb, &c3cn->receive_queue); 455 - read += skb_ulp_pdulen(skb); 369 + read += skb_rx_pdulen(skb); 370 + cxgb3i_rx_debug("conn 0x%p, cn 0x%p, rx skb 0x%p, pdulen %u.\n", 371 + conn, c3cn, skb, skb_rx_pdulen(skb)); 456 372 err = cxgb3i_conn_read_pdu_skb(conn, skb); 457 373 __kfree_skb(skb); 458 374 skb = skb_peek(&c3cn->receive_queue); ··· 465 377 cxgb3i_c3cn_rx_credits(c3cn, read); 466 378 } 467 379 conn->rxdata_octets += read; 380 + 381 + if (err) { 382 + cxgb3i_log_info("conn 0x%p rx failed err %d.\n", conn, err); 383 + iscsi_conn_failure(conn, ISCSI_ERR_CONN_FAILED); 384 + } 468 385 } 469 386 470 387 void cxgb3i_conn_tx_open(struct s3_conn *c3cn)
+1 -1
drivers/scsi/cxgb3i/cxgb3i_pdu.h
··· 53 53 #define ULP2_FLAG_DCRC_ERROR 0x20 54 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 57 void cxgb3i_conn_pdu_ready(struct s3_conn *c3cn); 58 58 void cxgb3i_conn_tx_open(struct s3_conn *c3cn); 59 59 #endif
+1
drivers/scsi/hptiop.c
··· 1251 1251 { PCI_VDEVICE(TTI, 0x3530), (kernel_ulong_t)&hptiop_itl_ops }, 1252 1252 { PCI_VDEVICE(TTI, 0x3560), (kernel_ulong_t)&hptiop_itl_ops }, 1253 1253 { PCI_VDEVICE(TTI, 0x4322), (kernel_ulong_t)&hptiop_itl_ops }, 1254 + { PCI_VDEVICE(TTI, 0x4321), (kernel_ulong_t)&hptiop_itl_ops }, 1254 1255 { PCI_VDEVICE(TTI, 0x4210), (kernel_ulong_t)&hptiop_itl_ops }, 1255 1256 { PCI_VDEVICE(TTI, 0x4211), (kernel_ulong_t)&hptiop_itl_ops }, 1256 1257 { PCI_VDEVICE(TTI, 0x4310), (kernel_ulong_t)&hptiop_itl_ops },
+2 -3
drivers/scsi/scsi_lib.c
··· 1040 1040 action = ACTION_FAIL; 1041 1041 break; 1042 1042 case ABORTED_COMMAND: 1043 + action = ACTION_FAIL; 1043 1044 if (sshdr.asc == 0x10) { /* DIF */ 1044 1045 description = "Target Data Integrity Failure"; 1045 - action = ACTION_FAIL; 1046 1046 error = -EILSEQ; 1047 - } else 1048 - action = ACTION_RETRY; 1047 + } 1049 1048 break; 1050 1049 case NOT_READY: 1051 1050 /* If the device is in the process of becoming
+7
drivers/scsi/sd.c
··· 107 107 static void sd_print_sense_hdr(struct scsi_disk *, struct scsi_sense_hdr *); 108 108 static void sd_print_result(struct scsi_disk *, int); 109 109 110 + static DEFINE_SPINLOCK(sd_index_lock); 110 111 static DEFINE_IDA(sd_index_ida); 111 112 112 113 /* This semaphore is used to mediate the 0->1 reference get in the ··· 1915 1914 if (!ida_pre_get(&sd_index_ida, GFP_KERNEL)) 1916 1915 goto out_put; 1917 1916 1917 + spin_lock(&sd_index_lock); 1918 1918 error = ida_get_new(&sd_index_ida, &index); 1919 + spin_unlock(&sd_index_lock); 1919 1920 } while (error == -EAGAIN); 1920 1921 1921 1922 if (error) ··· 1939 1936 return 0; 1940 1937 1941 1938 out_free_index: 1939 + spin_lock(&sd_index_lock); 1942 1940 ida_remove(&sd_index_ida, index); 1941 + spin_unlock(&sd_index_lock); 1943 1942 out_put: 1944 1943 put_disk(gd); 1945 1944 out_free: ··· 1991 1986 struct scsi_disk *sdkp = to_scsi_disk(dev); 1992 1987 struct gendisk *disk = sdkp->disk; 1993 1988 1989 + spin_lock(&sd_index_lock); 1994 1990 ida_remove(&sd_index_ida, sdkp->index); 1991 + spin_unlock(&sd_index_lock); 1995 1992 1996 1993 disk->private_data = NULL; 1997 1994 put_disk(disk);
+1 -1
drivers/video/pxafb.c
··· 2230 2230 2231 2231 static struct platform_driver pxafb_driver = { 2232 2232 .probe = pxafb_probe, 2233 - .remove = pxafb_remove, 2233 + .remove = __devexit_p(pxafb_remove), 2234 2234 .suspend = pxafb_suspend, 2235 2235 .resume = pxafb_resume, 2236 2236 .driver = {
+4 -2
fs/Makefile
··· 69 69 # Do not add any filesystems before this line 70 70 obj-$(CONFIG_REISERFS_FS) += reiserfs/ 71 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 76 obj-$(CONFIG_JBD) += jbd/ 74 77 obj-$(CONFIG_JBD2) += jbd2/ 75 - obj-$(CONFIG_EXT2_FS) += ext2/ 76 78 obj-$(CONFIG_CRAMFS) += cramfs/ 77 79 obj-$(CONFIG_SQUASHFS) += squashfs/ 78 80 obj-y += ramfs/
+3 -1
fs/ext4/balloc.c
··· 609 609 */ 610 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 615 return 0; 614 616 615 617 jbd_debug(1, "%s: retrying operation after ENOSPC\n", sb->s_id);
+1 -1
fs/ext4/inode.c
··· 2544 2544 2545 2545 ext4_journal_stop(handle); 2546 2546 2547 - if (mpd.retval == -ENOSPC) { 2547 + if ((mpd.retval == -ENOSPC) && sbi->s_journal) { 2548 2548 /* commit the transaction which would 2549 2549 * free blocks released in the transaction 2550 2550 * and try again
-1
fs/ext4/super.c
··· 3091 3091 3092 3092 /* Journal blocked and flushed, clear needs_recovery flag. */ 3093 3093 EXT4_CLEAR_INCOMPAT_FEATURE(sb, EXT4_FEATURE_INCOMPAT_RECOVER); 3094 - ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); 3095 3094 error = ext4_commit_super(sb, EXT4_SB(sb)->s_es, 1); 3096 3095 if (error) 3097 3096 goto out;
+4 -1
include/linux/io-mapping.h
··· 91 91 static inline void * 92 92 io_mapping_map_wc(struct io_mapping *mapping, unsigned long offset) 93 93 { 94 + resource_size_t phys_addr; 95 + 94 96 BUG_ON(offset >= mapping->size); 95 - resource_size_t phys_addr = mapping->base + offset; 97 + phys_addr = mapping->base + offset; 98 + 96 99 return ioremap_wc(phys_addr, PAGE_SIZE); 97 100 } 98 101
+1
include/linux/netdevice.h
··· 1085 1085 extern int register_netdevice_notifier(struct notifier_block *nb); 1086 1086 extern int unregister_netdevice_notifier(struct notifier_block *nb); 1087 1087 extern int init_dummy_netdev(struct net_device *dev); 1088 + extern void netdev_resync_ops(struct net_device *dev); 1088 1089 1089 1090 extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); 1090 1091 extern struct net_device *dev_get_by_index(struct net *net, int ifindex);
+6
include/linux/rcuclassic.h
··· 181 181 #define rcu_enter_nohz() do { } while (0) 182 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 190 #endif /* __LINUX_RCUCLASSIC_H */
+4
include/linux/rcupdate.h
··· 52 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 58 #if defined(CONFIG_CLASSIC_RCU) 56 59 #include <linux/rcuclassic.h> 57 60 #elif defined(CONFIG_TREE_RCU) ··· 268 265 269 266 /* Internal to kernel */ 270 267 extern void rcu_init(void); 268 + extern void rcu_scheduler_starting(void); 271 269 extern int rcu_needs_cpu(int cpu); 272 270 273 271 #endif /* __LINUX_RCUPDATE_H */
+15
include/linux/rcupreempt.h
··· 142 142 #define rcu_exit_nohz() do { } while (0) 143 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 160 #endif /* __LINUX_RCUPREEMPT_H */
+6
include/linux/rcutree.h
··· 326 326 } 327 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 335 #endif /* __LINUX_RCUTREE_H */
+4
include/linux/sched.h
··· 2291 2291 extern int sched_group_set_rt_period(struct task_group *tg, 2292 2292 long rt_period_us); 2293 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 2295 #endif 2295 2296 #endif 2297 + 2298 + extern int task_can_switch_user(struct user_struct *up, 2299 + struct task_struct *tsk); 2296 2300 2297 2301 #ifdef CONFIG_TASK_XACCT 2298 2302 static inline void add_rchar(struct task_struct *tsk, ssize_t amt)
+2 -1
init/main.c
··· 97 97 extern void tc_init(void); 98 98 #endif 99 99 100 - enum system_states system_state; 100 + enum system_states system_state __read_mostly; 101 101 EXPORT_SYMBOL(system_state); 102 102 103 103 /* ··· 463 463 * at least once to get things moving: 464 464 */ 465 465 init_idle_bootup_task(current); 466 + rcu_scheduler_starting(); 466 467 preempt_enable_no_resched(); 467 468 schedule(); 468 469 preempt_disable();
+2 -2
kernel/rcuclassic.c
··· 679 679 void rcu_check_callbacks(int cpu, int user) 680 680 { 681 681 if (user || 682 - (idle_cpu(cpu) && !in_softirq() && 683 - hardirq_count() <= (1 << HARDIRQ_SHIFT))) { 682 + (idle_cpu(cpu) && rcu_scheduler_active && 683 + !in_softirq() && hardirq_count() <= (1 << HARDIRQ_SHIFT))) { 684 684 685 685 /* 686 686 * Get here if this CPU took its interrupt from user
+12
kernel/rcupdate.c
··· 44 44 #include <linux/cpu.h> 45 45 #include <linux/mutex.h> 46 46 #include <linux/module.h> 47 + #include <linux/kernel_stat.h> 47 48 48 49 enum rcu_barrier { 49 50 RCU_BARRIER_STD, ··· 56 55 static atomic_t rcu_barrier_cpu_count; 57 56 static DEFINE_MUTEX(rcu_barrier_mutex); 58 57 static struct completion rcu_barrier_completion; 58 + int rcu_scheduler_active __read_mostly; 59 59 60 60 /* 61 61 * Awaken the corresponding synchronize_rcu() instance now that a ··· 82 80 void synchronize_rcu(void) 83 81 { 84 82 struct rcu_synchronize rcu; 83 + 84 + if (rcu_blocking_is_gp()) 85 + return; 86 + 85 87 init_completion(&rcu.completion); 86 88 /* Will wake me after RCU finished. */ 87 89 call_rcu(&rcu.head, wakeme_after_rcu); ··· 181 175 __rcu_init(); 182 176 } 183 177 178 + void rcu_scheduler_starting(void) 179 + { 180 + WARN_ON(num_online_cpus() != 1); 181 + WARN_ON(nr_context_switches() > 0); 182 + rcu_scheduler_active = 1; 183 + }
+3
kernel/rcupreempt.c
··· 1181 1181 { 1182 1182 struct rcu_synchronize rcu; 1183 1183 1184 + if (num_online_cpus() == 1) 1185 + return; /* blocking is gp if only one CPU! */ 1186 + 1184 1187 init_completion(&rcu.completion); 1185 1188 /* Will wake me after RCU finished. */ 1186 1189 call_rcu_sched(&rcu.head, wakeme_after_rcu);
+2 -2
kernel/rcutree.c
··· 948 948 void rcu_check_callbacks(int cpu, int user) 949 949 { 950 950 if (user || 951 - (idle_cpu(cpu) && !in_softirq() && 952 - hardirq_count() <= (1 << HARDIRQ_SHIFT))) { 951 + (idle_cpu(cpu) && rcu_scheduler_active && 952 + !in_softirq() && hardirq_count() <= (1 << HARDIRQ_SHIFT))) { 953 953 954 954 /* 955 955 * Get here if this CPU took its interrupt from user
+12 -3
kernel/sched.c
··· 223 223 { 224 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 227 return; 228 228 229 229 if (hrtimer_active(&rt_b->rt_period_timer)) ··· 9224 9224 9225 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 9237 #else /* !CONFIG_RT_GROUP_SCHED */ 9228 9238 static int sched_rt_global_constraints(void) 9229 9239 { ··· 9327 9317 struct task_struct *tsk) 9328 9318 { 9329 9319 #ifdef CONFIG_RT_GROUP_SCHED 9330 - /* Don't accept realtime tasks when there is no way for them to run */ 9331 - if (rt_task(tsk) && cgroup_tg(cgrp)->rt_bandwidth.rt_runtime == 0) 9320 + if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk)) 9332 9321 return -EINVAL; 9333 9322 #else 9334 9323 /* We don't support RT-tasks being in separate groups */
+4 -3
kernel/seccomp.c
··· 8 8 9 9 #include <linux/seccomp.h> 10 10 #include <linux/sched.h> 11 + #include <linux/compat.h> 11 12 12 13 /* #define SECCOMP_DEBUG 1 */ 13 14 #define NR_SECCOMP_MODES 1 ··· 23 22 0, /* null terminated */ 24 23 }; 25 24 26 - #ifdef TIF_32BIT 25 + #ifdef CONFIG_COMPAT 27 26 static int mode1_syscalls_32[] = { 28 27 __NR_seccomp_read_32, __NR_seccomp_write_32, __NR_seccomp_exit_32, __NR_seccomp_sigreturn_32, 29 28 0, /* null terminated */ ··· 38 37 switch (mode) { 39 38 case 1: 40 39 syscall = mode1_syscalls; 41 - #ifdef TIF_32BIT 42 - if (test_thread_flag(TIF_32BIT)) 40 + #ifdef CONFIG_COMPAT 41 + if (is_compat_task()) 43 42 syscall = mode1_syscalls_32; 44 43 #endif 45 44 do {
+20 -11
kernel/sys.c
··· 559 559 abort_creds(new); 560 560 return retval; 561 561 } 562 - 562 + 563 563 /* 564 564 * change the user struct in a credentials set to match the new UID 565 565 */ ··· 570 570 new_user = alloc_uid(current_user_ns(), new->uid); 571 571 if (!new_user) 572 572 return -EAGAIN; 573 + 574 + if (!task_can_switch_user(new_user, current)) { 575 + free_uid(new_user); 576 + return -EINVAL; 577 + } 573 578 574 579 if (atomic_read(&new_user->processes) >= 575 580 current->signal->rlim[RLIMIT_NPROC].rlim_cur && ··· 636 631 goto error; 637 632 } 638 633 639 - retval = -EAGAIN; 640 - if (new->uid != old->uid && set_user(new) < 0) 641 - goto error; 642 - 634 + if (new->uid != old->uid) { 635 + retval = set_user(new); 636 + if (retval < 0) 637 + goto error; 638 + } 643 639 if (ruid != (uid_t) -1 || 644 640 (euid != (uid_t) -1 && euid != old->uid)) 645 641 new->suid = new->euid; ··· 686 680 retval = -EPERM; 687 681 if (capable(CAP_SETUID)) { 688 682 new->suid = new->uid = uid; 689 - if (uid != old->uid && set_user(new) < 0) { 690 - retval = -EAGAIN; 691 - goto error; 683 + if (uid != old->uid) { 684 + retval = set_user(new); 685 + if (retval < 0) 686 + goto error; 692 687 } 693 688 } else if (uid != old->uid && uid != new->suid) { 694 689 goto error; ··· 741 734 goto error; 742 735 } 743 736 744 - retval = -EAGAIN; 745 737 if (ruid != (uid_t) -1) { 746 738 new->uid = ruid; 747 - if (ruid != old->uid && set_user(new) < 0) 748 - goto error; 739 + if (ruid != old->uid) { 740 + retval = set_user(new); 741 + if (retval < 0) 742 + goto error; 743 + } 749 744 } 750 745 if (euid != (uid_t) -1) 751 746 new->euid = euid;
+18
kernel/user.c
··· 362 362 363 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 384 * Locate the user_struct for the passed UID. If found, take a ref on it. The 367 385 * caller must undo that ref with free_uid().
+2
net/802/tr.c
··· 670 670 671 671 EXPORT_SYMBOL(tr_type_trans); 672 672 EXPORT_SYMBOL(alloc_trdev); 673 + 674 + MODULE_LICENSE("GPL");
+2 -1
net/8021q/vlan_dev.c
··· 553 553 int err = 0; 554 554 555 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 558 return err; 559 559 } ··· 639 639 dev->hard_header_len = real_dev->hard_header_len + VLAN_HLEN; 640 640 dev->netdev_ops = &vlan_netdev_ops; 641 641 } 642 + netdev_resync_ops(dev); 642 643 643 644 if (is_vlan_dev(real_dev)) 644 645 subclass = 1;
+34 -21
net/core/dev.c
··· 4336 4336 } 4337 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 4373 * register_netdevice - register a network device 4341 4374 * @dev: device to register ··· 4413 4380 * This is temporary until all network devices are converted. 4414 4381 */ 4415 4382 if (dev->netdev_ops) { 4416 - const struct net_device_ops *ops = dev->netdev_ops; 4417 - 4418 - dev->init = ops->ndo_init; 4419 - dev->uninit = ops->ndo_uninit; 4420 - dev->open = ops->ndo_open; 4421 - dev->change_rx_flags = ops->ndo_change_rx_flags; 4422 - dev->set_rx_mode = ops->ndo_set_rx_mode; 4423 - dev->set_multicast_list = ops->ndo_set_multicast_list; 4424 - dev->set_mac_address = ops->ndo_set_mac_address; 4425 - dev->validate_addr = ops->ndo_validate_addr; 4426 - dev->do_ioctl = ops->ndo_do_ioctl; 4427 - dev->set_config = ops->ndo_set_config; 4428 - dev->change_mtu = ops->ndo_change_mtu; 4429 - dev->tx_timeout = ops->ndo_tx_timeout; 4430 - dev->get_stats = ops->ndo_get_stats; 4431 - dev->vlan_rx_register = ops->ndo_vlan_rx_register; 4432 - dev->vlan_rx_add_vid = ops->ndo_vlan_rx_add_vid; 4433 - dev->vlan_rx_kill_vid = ops->ndo_vlan_rx_kill_vid; 4434 - #ifdef CONFIG_NET_POLL_CONTROLLER 4435 - dev->poll_controller = ops->ndo_poll_controller; 4436 - #endif 4383 + netdev_resync_ops(dev); 4437 4384 } else { 4438 4385 char drivername[64]; 4439 4386 pr_info("%s (%s): not using net_device_ops yet\n",
+3 -1
net/core/net-sysfs.c
··· 77 77 if (endp == buf) 78 78 goto err; 79 79 80 - rtnl_lock(); 80 + if (!rtnl_trylock()) 81 + return -ERESTARTSYS; 82 + 81 83 if (dev_isalive(net)) { 82 84 if ((ret = (*set)(net, new)) == 0) 83 85 ret = len;
+17 -36
net/ipv6/addrconf.c
··· 493 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 498 struct net *net; 499 499 500 500 net = (struct net *)table->extra2; 501 501 if (p == &net->ipv6.devconf_dflt->forwarding) 502 - return; 502 + return 0; 503 503 504 - rtnl_lock(); 504 + if (!rtnl_trylock()) 505 + return -ERESTARTSYS; 506 + 505 507 if (p == &net->ipv6.devconf_all->forwarding) { 506 508 __s32 newf = net->ipv6.devconf_all->forwarding; 507 509 net->ipv6.devconf_dflt->forwarding = newf; ··· 514 512 515 513 if (*p) 516 514 rt6_purge_dflt_routers(net); 515 + return 1; 517 516 } 518 517 #endif 519 518 ··· 2602 2599 2603 2600 ASSERT_RTNL(); 2604 2601 2605 - if ((dev->flags & IFF_LOOPBACK) && how == 1) 2606 - how = 0; 2607 - 2608 2602 rt6_ifdown(net, dev); 2609 2603 neigh_ifdown(&nd_tbl, dev); 2610 2604 ··· 3977 3977 ret = proc_dointvec(ctl, write, filp, buffer, lenp, ppos); 3978 3978 3979 3979 if (write) 3980 - addrconf_fixup_forwarding(ctl, valp, val); 3980 + ret = addrconf_fixup_forwarding(ctl, valp, val); 3981 3981 return ret; 3982 3982 } 3983 3983 ··· 4013 4013 } 4014 4014 4015 4015 *valp = new; 4016 - addrconf_fixup_forwarding(table, valp, val); 4017 - return 1; 4016 + return addrconf_fixup_forwarding(table, valp, val); 4018 4017 } 4019 4018 4020 4019 static struct addrconf_sysctl_table ··· 4439 4440 4440 4441 EXPORT_SYMBOL(unregister_inet6addr_notifier); 4441 4442 4442 - static void addrconf_net_exit(struct net *net) 4443 - { 4444 - struct net_device *dev; 4445 - 4446 - rtnl_lock(); 4447 - /* clean dev list */ 4448 - for_each_netdev(net, dev) { 4449 - if (__in6_dev_get(dev) == NULL) 4450 - continue; 4451 - addrconf_ifdown(dev, 1); 4452 - } 4453 - addrconf_ifdown(net->loopback_dev, 2); 4454 - rtnl_unlock(); 4455 - } 4456 - 4457 - static struct pernet_operations addrconf_net_ops = { 4458 - .exit = addrconf_net_exit, 4459 - }; 4460 - 4461 4443 /* 4462 4444 * Init / cleanup code 4463 4445 */ ··· 4480 4500 if (err) 4481 4501 goto errlo; 4482 4502 4483 - err = register_pernet_device(&addrconf_net_ops); 4484 - if (err) 4485 - return err; 4486 - 4487 4503 register_netdevice_notifier(&ipv6_dev_notf); 4488 4504 4489 4505 addrconf_verify(0); ··· 4509 4533 void addrconf_cleanup(void) 4510 4534 { 4511 4535 struct inet6_ifaddr *ifa; 4536 + struct net_device *dev; 4512 4537 int i; 4513 4538 4514 4539 unregister_netdevice_notifier(&ipv6_dev_notf); 4515 - unregister_pernet_device(&addrconf_net_ops); 4516 - 4517 4540 unregister_pernet_subsys(&addrconf_ops); 4518 4541 4519 4542 rtnl_lock(); 4543 + 4544 + /* clean dev list */ 4545 + for_each_netdev(&init_net, dev) { 4546 + if (__in6_dev_get(dev) == NULL) 4547 + continue; 4548 + addrconf_ifdown(dev, 1); 4549 + } 4550 + addrconf_ifdown(init_net.loopback_dev, 2); 4520 4551 4521 4552 /* 4522 4553 * Check hash table. ··· 4545 4562 4546 4563 del_timer(&addr_chk_timer); 4547 4564 rtnl_unlock(); 4548 - 4549 - unregister_pernet_subsys(&addrconf_net_ops); 4550 4565 }
+16 -5
net/ipv6/af_inet6.c
··· 72 72 static struct list_head inetsw6[SOCK_MAX]; 73 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 79 static __inline__ struct ipv6_pinfo *inet6_sk_generic(struct sock *sk) 76 80 { 77 81 const int offset = sk->sk_prot->obj_size - sizeof(struct ipv6_pinfo); ··· 1005 1001 { 1006 1002 struct sk_buff *dummy_skb; 1007 1003 struct list_head *r; 1008 - int err; 1004 + int err = 0; 1009 1005 1010 1006 BUILD_BUG_ON(sizeof(struct inet6_skb_parm) > sizeof(dummy_skb->cb)); 1007 + 1008 + /* Register the socket-side information for inet6_create. */ 1009 + for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r) 1010 + INIT_LIST_HEAD(r); 1011 + 1012 + if (disable_ipv6) { 1013 + printk(KERN_INFO 1014 + "IPv6: Loaded, but administratively disabled, " 1015 + "reboot required to enable\n"); 1016 + goto out; 1017 + } 1011 1018 1012 1019 err = proto_register(&tcpv6_prot, 1); 1013 1020 if (err) ··· 1036 1021 if (err) 1037 1022 goto out_unregister_udplite_proto; 1038 1023 1039 - 1040 - /* Register the socket-side information for inet6_create. */ 1041 - for(r = &inetsw6[0]; r < &inetsw6[SOCK_MAX]; ++r) 1042 - INIT_LIST_HEAD(r); 1043 1024 1044 1025 /* We MUST register RAW sockets before we create the ICMP6, 1045 1026 * IGMP6, or NDISC control sockets.
+9 -1
net/netlink/af_netlink.c
··· 1091 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 1101 void netlink_set_err(struct sock *ssk, u32 pid, u32 group, int code) 1095 1102 { 1096 1103 struct netlink_set_err_data info; ··· 1107 1100 info.exclude_sk = ssk; 1108 1101 info.pid = pid; 1109 1102 info.group = group; 1110 - info.code = code; 1103 + /* sk->sk_err wants a positive error value */ 1104 + info.code = -code; 1111 1105 1112 1106 read_lock(&nl_table_lock); 1113 1107
+6 -7
net/sched/act_police.c
··· 183 183 if (R_tab == NULL) 184 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 186 if (parm->peakrate.rate) { 194 187 P_tab = qdisc_get_rtab(&parm->peakrate, 195 188 tb[TCA_POLICE_PEAKRATE]); ··· 198 205 &police->tcf_lock, est); 199 206 if (err) 200 207 goto failure_unlock; 208 + } else if (tb[TCA_POLICE_AVRATE] && 209 + (ret == ACT_P_CREATED || 210 + !gen_estimator_active(&police->tcf_bstats, 211 + &police->tcf_rate_est))) { 212 + err = -EINVAL; 213 + goto failure_unlock; 201 214 } 202 215 203 216 /* No failure allowed after this point */
+9 -7
net/sctp/protocol.c
··· 692 692 static int sctp_ctl_sock_init(void) 693 693 { 694 694 int err; 695 - sa_family_t family; 695 + sa_family_t family = PF_INET; 696 696 697 697 if (sctp_get_pf_specific(PF_INET6)) 698 698 family = PF_INET6; 699 - else 700 - family = PF_INET; 701 699 702 700 err = inet_ctl_sock_create(&sctp_ctl_sock, family, 703 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 709 if (err < 0) { 705 710 printk(KERN_ERR 706 711 "SCTP: Failed to create the SCTP control socket.\n"); ··· 1302 1297 out: 1303 1298 return status; 1304 1299 err_v6_add_protocol: 1305 - sctp_v6_del_protocol(); 1306 - err_add_protocol: 1307 1300 sctp_v4_del_protocol(); 1301 + err_add_protocol: 1308 1302 inet_ctl_sock_destroy(sctp_ctl_sock); 1309 1303 err_ctl_sock_init: 1310 1304 sctp_v6_protosw_exit(); ··· 1314 1310 sctp_v4_pf_exit(); 1315 1311 sctp_v6_pf_exit(); 1316 1312 sctp_sysctl_unregister(); 1317 - list_del(&sctp_af_inet.list); 1318 1313 free_pages((unsigned long)sctp_port_hashtable, 1319 1314 get_order(sctp_port_hashsize * 1320 1315 sizeof(struct sctp_bind_hashbucket))); ··· 1361 1358 sctp_v4_pf_exit(); 1362 1359 1363 1360 sctp_sysctl_unregister(); 1364 - list_del(&sctp_af_inet.list); 1365 1361 1366 1362 free_pages((unsigned long)sctp_assoc_hashtable, 1367 1363 get_order(sctp_assoc_hashsize *
+33 -21
net/sctp/sm_sideeffect.c
··· 787 787 struct sctp_association *asoc, 788 788 struct sctp_chunk *chunk) 789 789 { 790 - struct sctp_operr_chunk *operr_chunk; 791 790 struct sctp_errhdr *err_hdr; 791 + struct sctp_ulpevent *ev; 792 792 793 - operr_chunk = (struct sctp_operr_chunk *)chunk->chunk_hdr; 794 - err_hdr = &operr_chunk->err_hdr; 793 + while (chunk->chunk_end > chunk->skb->data) { 794 + err_hdr = (struct sctp_errhdr *)(chunk->skb->data); 795 795 796 - switch (err_hdr->cause) { 797 - case SCTP_ERROR_UNKNOWN_CHUNK: 798 - { 799 - struct sctp_chunkhdr *unk_chunk_hdr; 796 + ev = sctp_ulpevent_make_remote_error(asoc, chunk, 0, 797 + GFP_ATOMIC); 798 + if (!ev) 799 + return; 800 800 801 - unk_chunk_hdr = (struct sctp_chunkhdr *)err_hdr->variable; 802 - switch (unk_chunk_hdr->type) { 803 - /* ADDIP 4.1 A9) If the peer responds to an ASCONF with an 804 - * ERROR chunk reporting that it did not recognized the ASCONF 805 - * chunk type, the sender of the ASCONF MUST NOT send any 806 - * further ASCONF chunks and MUST stop its T-4 timer. 807 - */ 808 - case SCTP_CID_ASCONF: 809 - asoc->peer.asconf_capable = 0; 810 - sctp_add_cmd_sf(cmds, SCTP_CMD_TIMER_STOP, 801 + sctp_ulpq_tail_event(&asoc->ulpq, ev); 802 + 803 + switch (err_hdr->cause) { 804 + case SCTP_ERROR_UNKNOWN_CHUNK: 805 + { 806 + sctp_chunkhdr_t *unk_chunk_hdr; 807 + 808 + unk_chunk_hdr = (sctp_chunkhdr_t *)err_hdr->variable; 809 + switch (unk_chunk_hdr->type) { 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 822 SCTP_TO(SCTP_EVENT_TIMEOUT_T4_RTO)); 823 + break; 824 + default: 825 + break; 826 + } 812 827 break; 828 + } 813 829 default: 814 830 break; 815 831 } 816 - break; 817 - } 818 - default: 819 - break; 820 832 } 821 833 } 822 834
+2 -14
net/sctp/sm_statefuns.c
··· 3165 3165 sctp_cmd_seq_t *commands) 3166 3166 { 3167 3167 struct sctp_chunk *chunk = arg; 3168 - struct sctp_ulpevent *ev; 3169 3168 3170 3169 if (!sctp_vtag_verify(chunk, asoc)) 3171 3170 return sctp_sf_pdiscard(ep, asoc, type, arg, commands); ··· 3174 3175 return sctp_sf_violation_chunklen(ep, asoc, type, arg, 3175 3176 commands); 3176 3177 3177 - while (chunk->chunk_end > chunk->skb->data) { 3178 - ev = sctp_ulpevent_make_remote_error(asoc, chunk, 0, 3179 - GFP_ATOMIC); 3180 - if (!ev) 3181 - goto nomem; 3178 + sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR, 3179 + SCTP_CHUNK(chunk)); 3182 3180 3183 - sctp_add_cmd_sf(commands, SCTP_CMD_EVENT_ULP, 3184 - SCTP_ULPEVENT(ev)); 3185 - sctp_add_cmd_sf(commands, SCTP_CMD_PROCESS_OPERR, 3186 - SCTP_CHUNK(chunk)); 3187 - } 3188 3181 return SCTP_DISPOSITION_CONSUME; 3189 - 3190 - nomem: 3191 - return SCTP_DISPOSITION_NOMEM; 3192 3182 } 3193 3183 3194 3184 /*
+3 -2
security/selinux/netlabel.c
··· 386 386 if (!S_ISSOCK(inode->i_mode) || 387 387 ((mask & (MAY_WRITE | MAY_APPEND)) == 0)) 388 388 return 0; 389 - 390 389 sock = SOCKET_I(inode); 391 390 sk = sock->sk; 391 + if (sk == NULL) 392 + return 0; 392 393 sksec = sk->sk_security; 393 - if (sksec->nlbl_state != NLBL_REQUIRE) 394 + if (sksec == NULL || sksec->nlbl_state != NLBL_REQUIRE) 394 395 return 0; 395 396 396 397 local_bh_disable();
+2
sound/pci/hda/hda_intel.c
··· 2095 2095 SND_PCI_QUIRK(0x1028, 0x20ac, "Dell Studio Desktop", 0x01), 2096 2096 /* including bogus ALC268 in slot#2 that conflicts with ALC888 */ 2097 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
+1
sound/pci/hda/patch_realtek.c
··· 10557 10557 SND_PCI_QUIRK(0x103c, 0x1309, "HP xw4*00", ALC262_HP_BPC), 10558 10558 SND_PCI_QUIRK(0x103c, 0x130a, "HP xw6*00", ALC262_HP_BPC), 10559 10559 SND_PCI_QUIRK(0x103c, 0x130b, "HP xw8*00", ALC262_HP_BPC), 10560 + SND_PCI_QUIRK(0x103c, 0x170b, "HP xw*", ALC262_HP_BPC), 10560 10561 SND_PCI_QUIRK(0x103c, 0x2800, "HP D7000", ALC262_HP_BPC_D7000_WL), 10561 10562 SND_PCI_QUIRK(0x103c, 0x2801, "HP D7000", ALC262_HP_BPC_D7000_WF), 10562 10563 SND_PCI_QUIRK(0x103c, 0x2802, "HP D7000", ALC262_HP_BPC_D7000_WL),
+1 -1
sound/pci/hda/patch_sigmatel.c
··· 4989 4989 case STAC_DELL_M4_3: 4990 4990 spec->num_dmics = 1; 4991 4991 spec->num_smuxes = 0; 4992 - spec->num_dmuxes = 0; 4992 + spec->num_dmuxes = 1; 4993 4993 break; 4994 4994 default: 4995 4995 spec->num_dmics = STAC92HD71BXX_NUM_DMICS;