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

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net

Conflicts:
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
net/ipv4/tcp_metrics.c

Overlapping changes between the "don't create two tcp metrics objects
with the same key" race fix in net and the addition of the destination
address in the lookup key in net-next.

Minor overlapping changes in bnx2x driver.

Signed-off-by: David S. Miller <davem@davemloft.net>

+391 -265
+3
MAINTAINERS
··· 9230 9230 9231 9231 VIRTIO CONSOLE DRIVER 9232 9232 M: Amit Shah <amit.shah@redhat.com> 9233 + L: virtio-dev@lists.oasis-open.org 9233 9234 L: virtualization@lists.linux-foundation.org 9234 9235 S: Maintained 9235 9236 F: drivers/char/virtio_console.c ··· 9240 9239 VIRTIO CORE, NET AND BLOCK DRIVERS 9241 9240 M: Rusty Russell <rusty@rustcorp.com.au> 9242 9241 M: "Michael S. Tsirkin" <mst@redhat.com> 9242 + L: virtio-dev@lists.oasis-open.org 9243 9243 L: virtualization@lists.linux-foundation.org 9244 9244 S: Maintained 9245 9245 F: drivers/virtio/ ··· 9253 9251 VIRTIO HOST (VHOST) 9254 9252 M: "Michael S. Tsirkin" <mst@redhat.com> 9255 9253 L: kvm@vger.kernel.org 9254 + L: virtio-dev@lists.oasis-open.org 9256 9255 L: virtualization@lists.linux-foundation.org 9257 9256 L: netdev@vger.kernel.org 9258 9257 S: Maintained
+1 -1
Makefile
··· 1 1 VERSION = 3 2 2 PATCHLEVEL = 13 3 3 SUBLEVEL = 0 4 - EXTRAVERSION = -rc7 4 + EXTRAVERSION = -rc8 5 5 NAME = One Giant Leap for Frogkind 6 6 7 7 # *DOCUMENTATION*
+1 -1
arch/arm/kernel/devtree.c
··· 171 171 172 172 bool arch_match_cpu_phys_id(int cpu, u64 phys_id) 173 173 { 174 - return (phys_id & MPIDR_HWID_BITMASK) == cpu_logical_map(cpu); 174 + return phys_id == cpu_logical_map(cpu); 175 175 } 176 176 177 177 static const void * __init arch_get_next_mach(const char *const **match)
+1 -1
arch/arm/kernel/perf_event_cpu.c
··· 254 254 static int cpu_pmu_device_probe(struct platform_device *pdev) 255 255 { 256 256 const struct of_device_id *of_id; 257 - int (*init_fn)(struct arm_pmu *); 257 + const int (*init_fn)(struct arm_pmu *); 258 258 struct device_node *node = pdev->dev.of_node; 259 259 struct arm_pmu *pmu; 260 260 int ret = -ENODEV;
+3 -2
arch/arm/kernel/traps.c
··· 431 431 instr2 = __mem_to_opcode_thumb16(instr2); 432 432 instr = __opcode_thumb32_compose(instr, instr2); 433 433 } 434 - } else if (get_user(instr, (u32 __user *)pc)) { 434 + } else { 435 + if (get_user(instr, (u32 __user *)pc)) 436 + goto die_sig; 435 437 instr = __mem_to_opcode_arm(instr); 436 - goto die_sig; 437 438 } 438 439 439 440 if (call_undef_hook(regs, instr) == 0)
+1
arch/arm/mach-highbank/highbank.c
··· 53 53 54 54 static void highbank_l2x0_disable(void) 55 55 { 56 + outer_flush_all(); 56 57 /* Disable PL310 L2 Cache controller */ 57 58 highbank_smc1(0x102, 0x0); 58 59 }
+1
arch/arm/mach-omap2/omap4-common.c
··· 162 162 163 163 static void omap4_l2x0_disable(void) 164 164 { 165 + outer_flush_all(); 165 166 /* Disable PL310 L2 Cache controller */ 166 167 omap_smc1(0x102, 0x0); 167 168 }
+1 -1
arch/arm/mm/init.c
··· 229 229 #ifdef CONFIG_ZONE_DMA 230 230 if (mdesc->dma_zone_size) { 231 231 arm_dma_zone_size = mdesc->dma_zone_size; 232 - arm_dma_limit = __pv_phys_offset + arm_dma_zone_size - 1; 232 + arm_dma_limit = PHYS_OFFSET + arm_dma_zone_size - 1; 233 233 } else 234 234 arm_dma_limit = 0xffffffff; 235 235 arm_dma_pfn_limit = arm_dma_limit >> PAGE_SHIFT;
+3 -3
arch/arm/net/bpf_jit_32.c
··· 641 641 emit(ARM_MUL(r_A, r_A, r_X), ctx); 642 642 break; 643 643 case BPF_S_ALU_DIV_K: 644 - /* current k == reciprocal_value(userspace k) */ 644 + if (k == 1) 645 + break; 645 646 emit_mov_i(r_scratch, k, ctx); 646 - /* A = top 32 bits of the product */ 647 - emit(ARM_UMULL(r_scratch, r_A, r_A, r_scratch), ctx); 647 + emit_udiv(r_A, r_A, r_scratch, ctx); 648 648 break; 649 649 case BPF_S_ALU_DIV_X: 650 650 update_on_xread(ctx);
+1 -1
arch/arm64/include/asm/io.h
··· 229 229 extern void __iounmap(volatile void __iomem *addr); 230 230 extern void __iomem *ioremap_cache(phys_addr_t phys_addr, size_t size); 231 231 232 - #define PROT_DEFAULT (pgprot_default | PTE_DIRTY) 232 + #define PROT_DEFAULT (PTE_TYPE_PAGE | PTE_AF | PTE_DIRTY) 233 233 #define PROT_DEVICE_nGnRE (PROT_DEFAULT | PTE_PXN | PTE_UXN | PTE_ATTRINDX(MT_DEVICE_nGnRE)) 234 234 #define PROT_NORMAL_NC (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL_NC)) 235 235 #define PROT_NORMAL (PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL))
+1 -1
arch/mips/include/asm/cacheops.h
··· 83 83 /* 84 84 * Loongson2-specific cacheops 85 85 */ 86 - #define Hit_Invalidate_I_Loongson23 0x00 86 + #define Hit_Invalidate_I_Loongson2 0x00 87 87 88 88 #endif /* __ASM_CACHEOPS_H */
+25 -24
arch/mips/include/asm/r4kcache.h
··· 165 165 __iflush_prologue 166 166 switch (boot_cpu_type()) { 167 167 case CPU_LOONGSON2: 168 - cache_op(Hit_Invalidate_I_Loongson23, addr); 168 + cache_op(Hit_Invalidate_I_Loongson2, addr); 169 169 break; 170 170 171 171 default: ··· 219 219 { 220 220 switch (boot_cpu_type()) { 221 221 case CPU_LOONGSON2: 222 - protected_cache_op(Hit_Invalidate_I_Loongson23, addr); 222 + protected_cache_op(Hit_Invalidate_I_Loongson2, addr); 223 223 break; 224 224 225 225 default: ··· 357 357 "i" (op)); 358 358 359 359 /* build blast_xxx, blast_xxx_page, blast_xxx_page_indexed */ 360 - #define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize) \ 361 - static inline void blast_##pfx##cache##lsize(void) \ 360 + #define __BUILD_BLAST_CACHE(pfx, desc, indexop, hitop, lsize, extra) \ 361 + static inline void extra##blast_##pfx##cache##lsize(void) \ 362 362 { \ 363 363 unsigned long start = INDEX_BASE; \ 364 364 unsigned long end = start + current_cpu_data.desc.waysize; \ ··· 376 376 __##pfx##flush_epilogue \ 377 377 } \ 378 378 \ 379 - static inline void blast_##pfx##cache##lsize##_page(unsigned long page) \ 379 + static inline void extra##blast_##pfx##cache##lsize##_page(unsigned long page) \ 380 380 { \ 381 381 unsigned long start = page; \ 382 382 unsigned long end = page + PAGE_SIZE; \ ··· 391 391 __##pfx##flush_epilogue \ 392 392 } \ 393 393 \ 394 - static inline void blast_##pfx##cache##lsize##_page_indexed(unsigned long page) \ 394 + static inline void extra##blast_##pfx##cache##lsize##_page_indexed(unsigned long page) \ 395 395 { \ 396 396 unsigned long indexmask = current_cpu_data.desc.waysize - 1; \ 397 397 unsigned long start = INDEX_BASE + (page & indexmask); \ ··· 410 410 __##pfx##flush_epilogue \ 411 411 } 412 412 413 - __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16) 414 - __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16) 415 - __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16) 416 - __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32) 417 - __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32) 418 - __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32) 419 - __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64) 420 - __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64) 421 - __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64) 422 - __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128) 413 + __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 16, ) 414 + __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 16, ) 415 + __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 16, ) 416 + __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 32, ) 417 + __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 32, ) 418 + __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I_Loongson2, 32, loongson2_) 419 + __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 32, ) 420 + __BUILD_BLAST_CACHE(d, dcache, Index_Writeback_Inv_D, Hit_Writeback_Inv_D, 64, ) 421 + __BUILD_BLAST_CACHE(i, icache, Index_Invalidate_I, Hit_Invalidate_I, 64, ) 422 + __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 64, ) 423 + __BUILD_BLAST_CACHE(s, scache, Index_Writeback_Inv_SD, Hit_Writeback_Inv_SD, 128, ) 423 424 424 - __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16) 425 - __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32) 426 - __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16) 427 - __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32) 428 - __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64) 429 - __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128) 425 + __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 16, ) 426 + __BUILD_BLAST_CACHE(inv_d, dcache, Index_Writeback_Inv_D, Hit_Invalidate_D, 32, ) 427 + __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 16, ) 428 + __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 32, ) 429 + __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 64, ) 430 + __BUILD_BLAST_CACHE(inv_s, scache, Index_Writeback_Inv_SD, Hit_Invalidate_SD, 128, ) 430 431 431 432 /* build blast_xxx_range, protected_blast_xxx_range */ 432 433 #define __BUILD_BLAST_CACHE_RANGE(pfx, desc, hitop, prot, extra) \ ··· 453 452 __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, protected_, ) 454 453 __BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, protected_, ) 455 454 __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I, protected_, ) 456 - __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson23, \ 457 - protected_, loongson23_) 455 + __BUILD_BLAST_CACHE_RANGE(i, icache, Hit_Invalidate_I_Loongson2, \ 456 + protected_, loongson2_) 458 457 __BUILD_BLAST_CACHE_RANGE(d, dcache, Hit_Writeback_Inv_D, , ) 459 458 __BUILD_BLAST_CACHE_RANGE(s, scache, Hit_Writeback_Inv_SD, , ) 460 459 /* blast_inv_dcache_range */
+9 -2
arch/mips/mm/c-r4k.c
··· 237 237 r4k_blast_icache_page = (void *)cache_noop; 238 238 else if (ic_lsize == 16) 239 239 r4k_blast_icache_page = blast_icache16_page; 240 + else if (ic_lsize == 32 && current_cpu_type() == CPU_LOONGSON2) 241 + r4k_blast_icache_page = loongson2_blast_icache32_page; 240 242 else if (ic_lsize == 32) 241 243 r4k_blast_icache_page = blast_icache32_page; 242 244 else if (ic_lsize == 64) ··· 263 261 else if (TX49XX_ICACHE_INDEX_INV_WAR) 264 262 r4k_blast_icache_page_indexed = 265 263 tx49_blast_icache32_page_indexed; 264 + else if (current_cpu_type() == CPU_LOONGSON2) 265 + r4k_blast_icache_page_indexed = 266 + loongson2_blast_icache32_page_indexed; 266 267 else 267 268 r4k_blast_icache_page_indexed = 268 269 blast_icache32_page_indexed; ··· 289 284 r4k_blast_icache = blast_r4600_v1_icache32; 290 285 else if (TX49XX_ICACHE_INDEX_INV_WAR) 291 286 r4k_blast_icache = tx49_blast_icache32; 287 + else if (current_cpu_type() == CPU_LOONGSON2) 288 + r4k_blast_icache = loongson2_blast_icache32; 292 289 else 293 290 r4k_blast_icache = blast_icache32; 294 291 } else if (ic_lsize == 64) ··· 587 580 else { 588 581 switch (boot_cpu_type()) { 589 582 case CPU_LOONGSON2: 590 - protected_blast_icache_range(start, end); 583 + protected_loongson2_blast_icache_range(start, end); 591 584 break; 592 585 593 586 default: 594 - protected_loongson23_blast_icache_range(start, end); 587 + protected_blast_icache_range(start, end); 595 588 break; 596 589 } 597 590 }
+1 -1
arch/parisc/include/uapi/asm/socket.h
··· 75 75 76 76 #define SO_BUSY_POLL 0x4027 77 77 78 - #define SO_MAX_PACING_RATE 0x4048 78 + #define SO_MAX_PACING_RATE 0x4028 79 79 80 80 #endif /* _UAPI_ASM_SOCKET_H */
+13 -9
arch/powerpc/kernel/prom_init.c
··· 1986 1986 /* Get the full OF pathname of the stdout device */ 1987 1987 memset(path, 0, 256); 1988 1988 call_prom("instance-to-path", 3, 1, prom.stdout, path, 255); 1989 - stdout_node = call_prom("instance-to-package", 1, 1, prom.stdout); 1990 - val = cpu_to_be32(stdout_node); 1991 - prom_setprop(prom.chosen, "/chosen", "linux,stdout-package", 1992 - &val, sizeof(val)); 1993 1989 prom_printf("OF stdout device is: %s\n", of_stdout_device); 1994 1990 prom_setprop(prom.chosen, "/chosen", "linux,stdout-path", 1995 1991 path, strlen(path) + 1); 1996 1992 1997 - /* If it's a display, note it */ 1998 - memset(type, 0, sizeof(type)); 1999 - prom_getprop(stdout_node, "device_type", type, sizeof(type)); 2000 - if (strcmp(type, "display") == 0) 2001 - prom_setprop(stdout_node, path, "linux,boot-display", NULL, 0); 1993 + /* instance-to-package fails on PA-Semi */ 1994 + stdout_node = call_prom("instance-to-package", 1, 1, prom.stdout); 1995 + if (stdout_node != PROM_ERROR) { 1996 + val = cpu_to_be32(stdout_node); 1997 + prom_setprop(prom.chosen, "/chosen", "linux,stdout-package", 1998 + &val, sizeof(val)); 1999 + 2000 + /* If it's a display, note it */ 2001 + memset(type, 0, sizeof(type)); 2002 + prom_getprop(stdout_node, "device_type", type, sizeof(type)); 2003 + if (strcmp(type, "display") == 0) 2004 + prom_setprop(stdout_node, path, "linux,boot-display", NULL, 0); 2005 + } 2002 2006 } 2003 2007 2004 2008 static int __init prom_find_machine_type(void)
+4 -3
arch/powerpc/net/bpf_jit_comp.c
··· 223 223 } 224 224 PPC_DIVWU(r_A, r_A, r_X); 225 225 break; 226 - case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K); */ 226 + case BPF_S_ALU_DIV_K: /* A /= K */ 227 + if (K == 1) 228 + break; 227 229 PPC_LI32(r_scratch1, K); 228 - /* Top 32 bits of 64bit result -> A */ 229 - PPC_MULHWU(r_A, r_A, r_scratch1); 230 + PPC_DIVWU(r_A, r_A, r_scratch1); 230 231 break; 231 232 case BPF_S_ALU_AND_X: 232 233 ctx->seen |= SEEN_XREG;
+18 -11
arch/s390/net/bpf_jit_comp.c
··· 368 368 EMIT4_PCREL(0xa7840000, (jit->ret0_ip - jit->prg)); 369 369 /* lhi %r4,0 */ 370 370 EMIT4(0xa7480000); 371 - /* dr %r4,%r12 */ 372 - EMIT2(0x1d4c); 371 + /* dlr %r4,%r12 */ 372 + EMIT4(0xb997004c); 373 373 break; 374 - case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K) */ 375 - /* m %r4,<d(K)>(%r13) */ 376 - EMIT4_DISP(0x5c40d000, EMIT_CONST(K)); 377 - /* lr %r5,%r4 */ 378 - EMIT2(0x1854); 374 + case BPF_S_ALU_DIV_K: /* A /= K */ 375 + if (K == 1) 376 + break; 377 + /* lhi %r4,0 */ 378 + EMIT4(0xa7480000); 379 + /* dl %r4,<d(K)>(%r13) */ 380 + EMIT6_DISP(0xe340d000, 0x0097, EMIT_CONST(K)); 379 381 break; 380 382 case BPF_S_ALU_MOD_X: /* A %= X */ 381 383 jit->seen |= SEEN_XREG | SEEN_RET0; ··· 387 385 EMIT4_PCREL(0xa7840000, (jit->ret0_ip - jit->prg)); 388 386 /* lhi %r4,0 */ 389 387 EMIT4(0xa7480000); 390 - /* dr %r4,%r12 */ 391 - EMIT2(0x1d4c); 388 + /* dlr %r4,%r12 */ 389 + EMIT4(0xb997004c); 392 390 /* lr %r5,%r4 */ 393 391 EMIT2(0x1854); 394 392 break; 395 393 case BPF_S_ALU_MOD_K: /* A %= K */ 394 + if (K == 1) { 395 + /* lhi %r5,0 */ 396 + EMIT4(0xa7580000); 397 + break; 398 + } 396 399 /* lhi %r4,0 */ 397 400 EMIT4(0xa7480000); 398 - /* d %r4,<d(K)>(%r13) */ 399 - EMIT4_DISP(0x5d40d000, EMIT_CONST(K)); 401 + /* dl %r4,<d(K)>(%r13) */ 402 + EMIT6_DISP(0xe340d000, 0x0097, EMIT_CONST(K)); 400 403 /* lr %r5,%r4 */ 401 404 EMIT2(0x1854); 402 405 break;
+14 -3
arch/sparc/net/bpf_jit_comp.c
··· 497 497 case BPF_S_ALU_MUL_K: /* A *= K */ 498 498 emit_alu_K(MUL, K); 499 499 break; 500 - case BPF_S_ALU_DIV_K: /* A /= K */ 501 - emit_alu_K(MUL, K); 502 - emit_read_y(r_A); 500 + case BPF_S_ALU_DIV_K: /* A /= K with K != 0*/ 501 + if (K == 1) 502 + break; 503 + emit_write_y(G0); 504 + #ifdef CONFIG_SPARC32 505 + /* The Sparc v8 architecture requires 506 + * three instructions between a %y 507 + * register write and the first use. 508 + */ 509 + emit_nop(); 510 + emit_nop(); 511 + emit_nop(); 512 + #endif 513 + emit_alu_K(DIV, K); 503 514 break; 504 515 case BPF_S_ALU_DIV_X: /* A /= X; */ 505 516 emit_cmpi(r_X, 0);
+7 -6
arch/x86/include/asm/fpu-internal.h
··· 293 293 /* AMD K7/K8 CPUs don't save/restore FDP/FIP/FOP unless an exception 294 294 is pending. Clear the x87 state here by setting it to fixed 295 295 values. "m" is a random variable that should be in L1 */ 296 - alternative_input( 297 - ASM_NOP8 ASM_NOP2, 298 - "emms\n\t" /* clear stack tags */ 299 - "fildl %P[addr]", /* set F?P to defined value */ 300 - X86_FEATURE_FXSAVE_LEAK, 301 - [addr] "m" (tsk->thread.fpu.has_fpu)); 296 + if (unlikely(static_cpu_has(X86_FEATURE_FXSAVE_LEAK))) { 297 + asm volatile( 298 + "fnclex\n\t" 299 + "emms\n\t" 300 + "fildl %P[addr]" /* set F?P to defined value */ 301 + : : [addr] "m" (tsk->thread.fpu.has_fpu)); 302 + } 302 303 303 304 return fpu_restore_checking(&tsk->thread.fpu); 304 305 }
+2 -2
arch/x86/kernel/entry_32.S
··· 1082 1082 pushl $0 /* Pass NULL as regs pointer */ 1083 1083 movl 4*4(%esp), %eax 1084 1084 movl 0x4(%ebp), %edx 1085 - leal function_trace_op, %ecx 1085 + movl function_trace_op, %ecx 1086 1086 subl $MCOUNT_INSN_SIZE, %eax 1087 1087 1088 1088 .globl ftrace_call ··· 1140 1140 movl 12*4(%esp), %eax /* Load ip (1st parameter) */ 1141 1141 subl $MCOUNT_INSN_SIZE, %eax /* Adjust ip */ 1142 1142 movl 0x4(%ebp), %edx /* Load parent ip (2nd parameter) */ 1143 - leal function_trace_op, %ecx /* Save ftrace_pos in 3rd parameter */ 1143 + movl function_trace_op, %ecx /* Save ftrace_pos in 3rd parameter */ 1144 1144 pushl %esp /* Save pt_regs as 4th parameter */ 1145 1145 1146 1146 GLOBAL(ftrace_regs_call)
+1 -1
arch/x86/kernel/entry_64.S
··· 88 88 MCOUNT_SAVE_FRAME \skip 89 89 90 90 /* Load the ftrace_ops into the 3rd parameter */ 91 - leaq function_trace_op, %rdx 91 + movq function_trace_op(%rip), %rdx 92 92 93 93 /* Load ip into the first parameter */ 94 94 movq RIP(%rsp), %rdi
+1 -1
arch/x86/kvm/lapic.c
··· 1355 1355 vcpu->arch.apic_base = value; 1356 1356 1357 1357 /* update jump label if enable bit changes */ 1358 - if ((vcpu->arch.apic_base ^ value) & MSR_IA32_APICBASE_ENABLE) { 1358 + if ((old_value ^ value) & MSR_IA32_APICBASE_ENABLE) { 1359 1359 if (value & MSR_IA32_APICBASE_ENABLE) 1360 1360 static_key_slow_dec_deferred(&apic_hw_disabled); 1361 1361 else
+10 -4
arch/x86/net/bpf_jit_comp.c
··· 359 359 EMIT2(0x89, 0xd0); /* mov %edx,%eax */ 360 360 break; 361 361 case BPF_S_ALU_MOD_K: /* A %= K; */ 362 + if (K == 1) { 363 + CLEAR_A(); 364 + break; 365 + } 362 366 EMIT2(0x31, 0xd2); /* xor %edx,%edx */ 363 367 EMIT1(0xb9);EMIT(K, 4); /* mov imm32,%ecx */ 364 368 EMIT2(0xf7, 0xf1); /* div %ecx */ 365 369 EMIT2(0x89, 0xd0); /* mov %edx,%eax */ 366 370 break; 367 - case BPF_S_ALU_DIV_K: /* A = reciprocal_divide(A, K); */ 368 - EMIT3(0x48, 0x69, 0xc0); /* imul imm32,%rax,%rax */ 369 - EMIT(K, 4); 370 - EMIT4(0x48, 0xc1, 0xe8, 0x20); /* shr $0x20,%rax */ 371 + case BPF_S_ALU_DIV_K: /* A /= K */ 372 + if (K == 1) 373 + break; 374 + EMIT2(0x31, 0xd2); /* xor %edx,%edx */ 375 + EMIT1(0xb9);EMIT(K, 4); /* mov imm32,%ecx */ 376 + EMIT2(0xf7, 0xf1); /* div %ecx */ 371 377 break; 372 378 case BPF_S_ALU_AND_X: 373 379 seen |= SEEN_XREG;
+4 -4
arch/x86/vdso/vclock_gettime.c
··· 178 178 179 179 ts->tv_nsec = 0; 180 180 do { 181 - seq = read_seqcount_begin_no_lockdep(&gtod->seq); 181 + seq = raw_read_seqcount_begin(&gtod->seq); 182 182 mode = gtod->clock.vclock_mode; 183 183 ts->tv_sec = gtod->wall_time_sec; 184 184 ns = gtod->wall_time_snsec; ··· 198 198 199 199 ts->tv_nsec = 0; 200 200 do { 201 - seq = read_seqcount_begin_no_lockdep(&gtod->seq); 201 + seq = raw_read_seqcount_begin(&gtod->seq); 202 202 mode = gtod->clock.vclock_mode; 203 203 ts->tv_sec = gtod->monotonic_time_sec; 204 204 ns = gtod->monotonic_time_snsec; ··· 214 214 { 215 215 unsigned long seq; 216 216 do { 217 - seq = read_seqcount_begin_no_lockdep(&gtod->seq); 217 + seq = raw_read_seqcount_begin(&gtod->seq); 218 218 ts->tv_sec = gtod->wall_time_coarse.tv_sec; 219 219 ts->tv_nsec = gtod->wall_time_coarse.tv_nsec; 220 220 } while (unlikely(read_seqcount_retry(&gtod->seq, seq))); ··· 225 225 { 226 226 unsigned long seq; 227 227 do { 228 - seq = read_seqcount_begin_no_lockdep(&gtod->seq); 228 + seq = raw_read_seqcount_begin(&gtod->seq); 229 229 ts->tv_sec = gtod->monotonic_time_coarse.tv_sec; 230 230 ts->tv_nsec = gtod->monotonic_time_coarse.tv_nsec; 231 231 } while (unlikely(read_seqcount_retry(&gtod->seq, seq)));
+2 -8
drivers/block/null_blk.c
··· 425 425 list_del_init(&nullb->list); 426 426 427 427 del_gendisk(nullb->disk); 428 - if (queue_mode == NULL_Q_MQ) 429 - blk_mq_free_queue(nullb->q); 430 - else 431 - blk_cleanup_queue(nullb->q); 428 + blk_cleanup_queue(nullb->q); 432 429 put_disk(nullb->disk); 433 430 kfree(nullb); 434 431 } ··· 575 578 disk = nullb->disk = alloc_disk_node(1, home_node); 576 579 if (!disk) { 577 580 queue_fail: 578 - if (queue_mode == NULL_Q_MQ) 579 - blk_mq_free_queue(nullb->q); 580 - else 581 - blk_cleanup_queue(nullb->q); 581 + blk_cleanup_queue(nullb->q); 582 582 cleanup_queues(nullb); 583 583 err: 584 584 kfree(nullb);
+13 -8
drivers/clocksource/cadence_ttc_timer.c
··· 67 67 * struct ttc_timer - This definition defines local timer structure 68 68 * 69 69 * @base_addr: Base address of timer 70 + * @freq: Timer input clock frequency 70 71 * @clk: Associated clock source 71 72 * @clk_rate_change_nb Notifier block for clock rate changes 72 73 */ 73 74 struct ttc_timer { 74 75 void __iomem *base_addr; 76 + unsigned long freq; 75 77 struct clk *clk; 76 78 struct notifier_block clk_rate_change_nb; 77 79 }; ··· 198 196 199 197 switch (mode) { 200 198 case CLOCK_EVT_MODE_PERIODIC: 201 - ttc_set_interval(timer, 202 - DIV_ROUND_CLOSEST(clk_get_rate(ttce->ttc.clk), 203 - PRESCALE * HZ)); 199 + ttc_set_interval(timer, DIV_ROUND_CLOSEST(ttce->ttc.freq, 200 + PRESCALE * HZ)); 204 201 break; 205 202 case CLOCK_EVT_MODE_ONESHOT: 206 203 case CLOCK_EVT_MODE_UNUSED: ··· 274 273 return; 275 274 } 276 275 276 + ttccs->ttc.freq = clk_get_rate(ttccs->ttc.clk); 277 + 277 278 ttccs->ttc.clk_rate_change_nb.notifier_call = 278 279 ttc_rate_change_clocksource_cb; 279 280 ttccs->ttc.clk_rate_change_nb.next = NULL; ··· 301 298 __raw_writel(CNT_CNTRL_RESET, 302 299 ttccs->ttc.base_addr + TTC_CNT_CNTRL_OFFSET); 303 300 304 - err = clocksource_register_hz(&ttccs->cs, 305 - clk_get_rate(ttccs->ttc.clk) / PRESCALE); 301 + err = clocksource_register_hz(&ttccs->cs, ttccs->ttc.freq / PRESCALE); 306 302 if (WARN_ON(err)) { 307 303 kfree(ttccs); 308 304 return; 309 305 } 310 306 311 307 ttc_sched_clock_val_reg = base + TTC_COUNT_VAL_OFFSET; 312 - setup_sched_clock(ttc_sched_clock_read, 16, 313 - clk_get_rate(ttccs->ttc.clk) / PRESCALE); 308 + setup_sched_clock(ttc_sched_clock_read, 16, ttccs->ttc.freq / PRESCALE); 314 309 } 315 310 316 311 static int ttc_rate_change_clockevent_cb(struct notifier_block *nb, ··· 334 333 clockevents_update_freq(&ttcce->ce, 335 334 ndata->new_rate / PRESCALE); 336 335 local_irq_restore(flags); 336 + 337 + /* update cached frequency */ 338 + ttc->freq = ndata->new_rate; 337 339 338 340 /* fall through */ 339 341 } ··· 371 367 if (clk_notifier_register(ttcce->ttc.clk, 372 368 &ttcce->ttc.clk_rate_change_nb)) 373 369 pr_warn("Unable to register clock notifier.\n"); 370 + ttcce->ttc.freq = clk_get_rate(ttcce->ttc.clk); 374 371 375 372 ttcce->ttc.base_addr = base; 376 373 ttcce->ce.name = "ttc_clockevent"; ··· 401 396 } 402 397 403 398 clockevents_config_and_register(&ttcce->ce, 404 - clk_get_rate(ttcce->ttc.clk) / PRESCALE, 1, 0xfffe); 399 + ttcce->ttc.freq / PRESCALE, 1, 0xfffe); 405 400 } 406 401 407 402 /**
+1 -1
drivers/gpu/drm/drm_modes.c
··· 1041 1041 /* if equal delete the probed mode */ 1042 1042 mode->status = pmode->status; 1043 1043 /* Merge type bits together */ 1044 - mode->type = pmode->type; 1044 + mode->type |= pmode->type; 1045 1045 list_del(&pmode->head); 1046 1046 drm_mode_destroy(connector->dev, pmode); 1047 1047 break;
+2
drivers/gpu/drm/i915/i915_irq.c
··· 2713 2713 #undef GEN8_IRQ_INIT_NDX 2714 2714 2715 2715 POSTING_READ(GEN8_PCU_IIR); 2716 + 2717 + ibx_irq_preinstall(dev); 2716 2718 } 2717 2719 2718 2720 static void ibx_hpd_irq_setup(struct drm_device *dev)
+7 -1
drivers/gpu/drm/i915/intel_ddi.c
··· 1057 1057 enum pipe pipe; 1058 1058 struct intel_crtc *intel_crtc; 1059 1059 1060 + dev_priv->ddi_plls.spll_refcount = 0; 1061 + dev_priv->ddi_plls.wrpll1_refcount = 0; 1062 + dev_priv->ddi_plls.wrpll2_refcount = 0; 1063 + 1060 1064 for_each_pipe(pipe) { 1061 1065 intel_crtc = 1062 1066 to_intel_crtc(dev_priv->pipe_to_crtc_mapping[pipe]); 1063 1067 1064 - if (!intel_crtc->active) 1068 + if (!intel_crtc->active) { 1069 + intel_crtc->ddi_pll_sel = PORT_CLK_SEL_NONE; 1065 1070 continue; 1071 + } 1066 1072 1067 1073 intel_crtc->ddi_pll_sel = intel_ddi_get_crtc_pll(dev_priv, 1068 1074 pipe);
+2 -2
drivers/gpu/drm/i915/intel_display.c
··· 11053 11053 11054 11054 intel_setup_overlay(dev); 11055 11055 11056 - drm_modeset_lock_all(dev); 11056 + mutex_lock(&dev->mode_config.mutex); 11057 11057 drm_mode_config_reset(dev); 11058 11058 intel_modeset_setup_hw_state(dev, false); 11059 - drm_modeset_unlock_all(dev); 11059 + mutex_unlock(&dev->mode_config.mutex); 11060 11060 } 11061 11061 11062 11062 void intel_modeset_cleanup(struct drm_device *dev)
+1 -1
drivers/gpu/drm/nouveau/core/include/subdev/i2c.h
··· 73 73 int (*identify)(struct nouveau_i2c *, int index, 74 74 const char *what, struct nouveau_i2c_board_info *, 75 75 bool (*match)(struct nouveau_i2c_port *, 76 - struct i2c_board_info *)); 76 + struct i2c_board_info *, void *), void *); 77 77 struct list_head ports; 78 78 }; 79 79
+7
drivers/gpu/drm/nouveau/core/include/subdev/instmem.h
··· 50 50 static inline struct nouveau_instmem * 51 51 nouveau_instmem(void *obj) 52 52 { 53 + /* nv04/nv40 impls need to create objects in their constructor, 54 + * which is before the subdev pointer is valid 55 + */ 56 + if (nv_iclass(obj, NV_SUBDEV_CLASS) && 57 + nv_subidx(obj) == NVDEV_SUBDEV_INSTMEM) 58 + return obj; 59 + 53 60 return (void *)nv_device(obj)->subdev[NVDEV_SUBDEV_INSTMEM]; 54 61 } 55 62
+2 -2
drivers/gpu/drm/nouveau/core/subdev/i2c/base.c
··· 197 197 nouveau_i2c_identify(struct nouveau_i2c *i2c, int index, const char *what, 198 198 struct nouveau_i2c_board_info *info, 199 199 bool (*match)(struct nouveau_i2c_port *, 200 - struct i2c_board_info *)) 200 + struct i2c_board_info *, void *), void *data) 201 201 { 202 202 struct nouveau_i2c_port *port = nouveau_i2c_find(i2c, index); 203 203 int i; ··· 221 221 } 222 222 223 223 if (nv_probe_i2c(port, info[i].dev.addr) && 224 - (!match || match(port, &info[i].dev))) { 224 + (!match || match(port, &info[i].dev, data))) { 225 225 nv_info(i2c, "detected %s: %s\n", what, 226 226 info[i].dev.type); 227 227 return i;
+5 -5
drivers/gpu/drm/nouveau/core/subdev/therm/ic.c
··· 29 29 30 30 static bool 31 31 probe_monitoring_device(struct nouveau_i2c_port *i2c, 32 - struct i2c_board_info *info) 32 + struct i2c_board_info *info, void *data) 33 33 { 34 - struct nouveau_therm_priv *priv = (void *)nouveau_therm(i2c); 34 + struct nouveau_therm_priv *priv = data; 35 35 struct nvbios_therm_sensor *sensor = &priv->bios_sensor; 36 36 struct i2c_client *client; 37 37 ··· 96 96 }; 97 97 98 98 i2c->identify(i2c, NV_I2C_DEFAULT(0), "monitoring device", 99 - board, probe_monitoring_device); 99 + board, probe_monitoring_device, therm); 100 100 if (priv->ic) 101 101 return; 102 102 } ··· 108 108 }; 109 109 110 110 i2c->identify(i2c, NV_I2C_DEFAULT(0), "monitoring device", 111 - board, probe_monitoring_device); 111 + board, probe_monitoring_device, therm); 112 112 if (priv->ic) 113 113 return; 114 114 } ··· 117 117 device. Let's try our static list. 118 118 */ 119 119 i2c->identify(i2c, NV_I2C_DEFAULT(0), "monitoring device", 120 - nv_board_infos, probe_monitoring_device); 120 + nv_board_infos, probe_monitoring_device, therm); 121 121 }
+1 -1
drivers/gpu/drm/nouveau/dispnv04/dfp.c
··· 643 643 get_tmds_slave(encoder)) 644 644 return; 645 645 646 - type = i2c->identify(i2c, 2, "TMDS transmitter", info, NULL); 646 + type = i2c->identify(i2c, 2, "TMDS transmitter", info, NULL, NULL); 647 647 if (type < 0) 648 648 return; 649 649
+1 -1
drivers/gpu/drm/nouveau/dispnv04/tvnv04.c
··· 59 59 struct nouveau_i2c *i2c = nouveau_i2c(drm->device); 60 60 61 61 return i2c->identify(i2c, i2c_index, "TV encoder", 62 - nv04_tv_encoder_info, NULL); 62 + nv04_tv_encoder_info, NULL, NULL); 63 63 } 64 64 65 65
+1 -1
drivers/hwmon/coretemp.c
··· 52 52 53 53 #define BASE_SYSFS_ATTR_NO 2 /* Sysfs Base attr no for coretemp */ 54 54 #define NUM_REAL_CORES 32 /* Number of Real cores per cpu */ 55 - #define CORETEMP_NAME_LENGTH 17 /* String Length of attrs */ 55 + #define CORETEMP_NAME_LENGTH 19 /* String Length of attrs */ 56 56 #define MAX_CORE_ATTRS 4 /* Maximum no of basic attrs */ 57 57 #define TOTAL_ATTRS (MAX_CORE_ATTRS + 1) 58 58 #define MAX_CORE_DATA (NUM_REAL_CORES + BASE_SYSFS_ATTR_NO)
+15 -3
drivers/md/md.c
··· 1077 1077 rdev->raid_disk = -1; 1078 1078 clear_bit(Faulty, &rdev->flags); 1079 1079 clear_bit(In_sync, &rdev->flags); 1080 + clear_bit(Bitmap_sync, &rdev->flags); 1080 1081 clear_bit(WriteMostly, &rdev->flags); 1081 1082 1082 1083 if (mddev->raid_disks == 0) { ··· 1156 1155 */ 1157 1156 if (ev1 < mddev->bitmap->events_cleared) 1158 1157 return 0; 1158 + if (ev1 < mddev->events) 1159 + set_bit(Bitmap_sync, &rdev->flags); 1159 1160 } else { 1160 1161 if (ev1 < mddev->events) 1161 1162 /* just a hot-add of a new device, leave raid_disk at -1 */ ··· 1566 1563 rdev->raid_disk = -1; 1567 1564 clear_bit(Faulty, &rdev->flags); 1568 1565 clear_bit(In_sync, &rdev->flags); 1566 + clear_bit(Bitmap_sync, &rdev->flags); 1569 1567 clear_bit(WriteMostly, &rdev->flags); 1570 1568 1571 1569 if (mddev->raid_disks == 0) { ··· 1649 1645 */ 1650 1646 if (ev1 < mddev->bitmap->events_cleared) 1651 1647 return 0; 1648 + if (ev1 < mddev->events) 1649 + set_bit(Bitmap_sync, &rdev->flags); 1652 1650 } else { 1653 1651 if (ev1 < mddev->events) 1654 1652 /* just a hot-add of a new device, leave raid_disk at -1 */ ··· 2794 2788 else 2795 2789 rdev->saved_raid_disk = -1; 2796 2790 clear_bit(In_sync, &rdev->flags); 2791 + clear_bit(Bitmap_sync, &rdev->flags); 2797 2792 err = rdev->mddev->pers-> 2798 2793 hot_add_disk(rdev->mddev, rdev); 2799 2794 if (err) { ··· 5767 5760 info->raid_disk < mddev->raid_disks) { 5768 5761 rdev->raid_disk = info->raid_disk; 5769 5762 set_bit(In_sync, &rdev->flags); 5763 + clear_bit(Bitmap_sync, &rdev->flags); 5770 5764 } else 5771 5765 rdev->raid_disk = -1; 5772 5766 } else ··· 7714 7706 if (test_bit(Faulty, &rdev->flags)) 7715 7707 continue; 7716 7708 if (mddev->ro && 7717 - rdev->saved_raid_disk < 0) 7709 + ! (rdev->saved_raid_disk >= 0 && 7710 + !test_bit(Bitmap_sync, &rdev->flags))) 7718 7711 continue; 7719 7712 7720 7713 rdev->recovery_offset = 0; ··· 7796 7787 * As we only add devices that are already in-sync, 7797 7788 * we can activate the spares immediately. 7798 7789 */ 7799 - clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 7800 7790 remove_and_add_spares(mddev, NULL); 7801 - mddev->pers->spare_active(mddev); 7791 + /* There is no thread, but we need to call 7792 + * ->spare_active and clear saved_raid_disk 7793 + */ 7794 + md_reap_sync_thread(mddev); 7795 + clear_bit(MD_RECOVERY_NEEDED, &mddev->recovery); 7802 7796 goto unlock; 7803 7797 } 7804 7798
+3
drivers/md/md.h
··· 129 129 enum flag_bits { 130 130 Faulty, /* device is known to have a fault */ 131 131 In_sync, /* device is in_sync with rest of array */ 132 + Bitmap_sync, /* ..actually, not quite In_sync. Need a 133 + * bitmap-based recovery to get fully in sync 134 + */ 132 135 Unmerged, /* device is being added to array and should 133 136 * be considerred for bvec_merge_fn but not 134 137 * yet for actual IO
+1 -2
drivers/md/raid1.c
··· 924 924 conf->next_window_requests++; 925 925 else 926 926 conf->current_window_requests++; 927 - } 928 - if (bio->bi_sector >= conf->start_next_window) 929 927 sector = conf->start_next_window; 928 + } 930 929 } 931 930 932 931 conf->nr_pending++;
+6 -6
drivers/md/raid10.c
··· 1319 1319 /* Could not read all from this device, so we will 1320 1320 * need another r10_bio. 1321 1321 */ 1322 - sectors_handled = (r10_bio->sectors + max_sectors 1322 + sectors_handled = (r10_bio->sector + max_sectors 1323 1323 - bio->bi_sector); 1324 1324 r10_bio->sectors = max_sectors; 1325 1325 spin_lock_irq(&conf->device_lock); ··· 1327 1327 bio->bi_phys_segments = 2; 1328 1328 else 1329 1329 bio->bi_phys_segments++; 1330 - spin_unlock(&conf->device_lock); 1330 + spin_unlock_irq(&conf->device_lock); 1331 1331 /* Cannot call generic_make_request directly 1332 1332 * as that will be queued in __generic_make_request 1333 1333 * and subsequent mempool_alloc might block ··· 3218 3218 if (j == conf->copies) { 3219 3219 /* Cannot recover, so abort the recovery or 3220 3220 * record a bad block */ 3221 - put_buf(r10_bio); 3222 - if (rb2) 3223 - atomic_dec(&rb2->remaining); 3224 - r10_bio = rb2; 3225 3221 if (any_working) { 3226 3222 /* problem is that there are bad blocks 3227 3223 * on other device(s) ··· 3249 3253 mirror->recovery_disabled 3250 3254 = mddev->recovery_disabled; 3251 3255 } 3256 + put_buf(r10_bio); 3257 + if (rb2) 3258 + atomic_dec(&rb2->remaining); 3259 + r10_bio = rb2; 3252 3260 break; 3253 3261 } 3254 3262 }
+4 -3
drivers/md/raid5.c
··· 687 687 } else { 688 688 if (!test_bit(STRIPE_HANDLE, &sh->state)) 689 689 atomic_inc(&conf->active_stripes); 690 - BUG_ON(list_empty(&sh->lru)); 690 + BUG_ON(list_empty(&sh->lru) && 691 + !test_bit(STRIPE_EXPANDING, &sh->state)); 691 692 list_del_init(&sh->lru); 692 693 if (sh->group) { 693 694 sh->group->stripes_cnt--; ··· 3609 3608 */ 3610 3609 set_bit(R5_Insync, &dev->flags); 3611 3610 3612 - if (rdev && test_bit(R5_WriteError, &dev->flags)) { 3611 + if (test_bit(R5_WriteError, &dev->flags)) { 3613 3612 /* This flag does not apply to '.replacement' 3614 3613 * only to .rdev, so make sure to check that*/ 3615 3614 struct md_rdev *rdev2 = rcu_dereference( ··· 3622 3621 } else 3623 3622 clear_bit(R5_WriteError, &dev->flags); 3624 3623 } 3625 - if (rdev && test_bit(R5_MadeGood, &dev->flags)) { 3624 + if (test_bit(R5_MadeGood, &dev->flags)) { 3626 3625 /* This flag does not apply to '.replacement' 3627 3626 * only to .rdev, so make sure to check that*/ 3628 3627 struct md_rdev *rdev2 = rcu_dereference(
+15 -15
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
··· 13083 13083 } 13084 13084 13085 13085 bnx2x_disable_pcie_error_reporting(bp); 13086 + if (remove_netdev) { 13087 + if (bp->regview) 13088 + iounmap(bp->regview); 13086 13089 13087 - if (bp->regview) 13088 - iounmap(bp->regview); 13090 + /* For vfs, doorbells are part of the regview and were unmapped 13091 + * along with it. FW is only loaded by PF. 13092 + */ 13093 + if (IS_PF(bp)) { 13094 + if (bp->doorbells) 13095 + iounmap(bp->doorbells); 13089 13096 13090 - /* for vf doorbells are part of the regview and were unmapped along with 13091 - * it. FW is only loaded by PF. 13092 - */ 13093 - if (IS_PF(bp)) { 13094 - if (bp->doorbells) 13095 - iounmap(bp->doorbells); 13097 + bnx2x_release_firmware(bp); 13098 + } 13099 + bnx2x_free_mem_bp(bp); 13096 13100 13097 - bnx2x_release_firmware(bp); 13098 - } 13099 - bnx2x_free_mem_bp(bp); 13100 - 13101 - if (remove_netdev) 13102 13101 free_netdev(dev); 13103 13102 13104 - if (atomic_read(&pdev->enable_cnt) == 1) 13105 - pci_release_regions(pdev); 13103 + if (atomic_read(&pdev->enable_cnt) == 1) 13104 + pci_release_regions(pdev); 13105 + } 13106 13106 13107 13107 pci_disable_device(pdev); 13108 13108 }
+9 -2
drivers/net/ethernet/emulex/benet/be_main.c
··· 1767 1767 struct be_rx_page_info *page_info = NULL, *prev_page_info = NULL; 1768 1768 struct be_queue_info *rxq = &rxo->q; 1769 1769 struct page *pagep = NULL; 1770 + struct device *dev = &adapter->pdev->dev; 1770 1771 struct be_eth_rx_d *rxd; 1771 1772 u64 page_dmaaddr = 0, frag_dmaaddr; 1772 1773 u32 posted, page_offset = 0; ··· 1780 1779 rx_stats(rxo)->rx_post_fail++; 1781 1780 break; 1782 1781 } 1783 - page_dmaaddr = dma_map_page(&adapter->pdev->dev, pagep, 1784 - 0, adapter->big_page_size, 1782 + page_dmaaddr = dma_map_page(dev, pagep, 0, 1783 + adapter->big_page_size, 1785 1784 DMA_FROM_DEVICE); 1785 + if (dma_mapping_error(dev, page_dmaaddr)) { 1786 + put_page(pagep); 1787 + pagep = NULL; 1788 + rx_stats(rxo)->rx_post_fail++; 1789 + break; 1790 + } 1786 1791 page_info->page_offset = 0; 1787 1792 } else { 1788 1793 get_page(pagep);
+2 -6
drivers/net/ethernet/intel/e1000e/netdev.c
··· 6184 6184 return 0; 6185 6185 } 6186 6186 6187 - #ifdef CONFIG_PM 6187 + #ifdef CONFIG_PM_SLEEP 6188 6188 static int e1000_suspend(struct device *dev) 6189 6189 { 6190 6190 struct pci_dev *pdev = to_pci_dev(dev); ··· 6203 6203 6204 6204 return __e1000_resume(pdev); 6205 6205 } 6206 - #endif /* CONFIG_PM */ 6206 + #endif /* CONFIG_PM_SLEEP */ 6207 6207 6208 6208 #ifdef CONFIG_PM_RUNTIME 6209 6209 static int e1000_runtime_suspend(struct device *dev) ··· 7025 7025 }; 7026 7026 MODULE_DEVICE_TABLE(pci, e1000_pci_tbl); 7027 7027 7028 - #ifdef CONFIG_PM 7029 7028 static const struct dev_pm_ops e1000_pm_ops = { 7030 7029 SET_SYSTEM_SLEEP_PM_OPS(e1000_suspend, e1000_resume) 7031 7030 SET_RUNTIME_PM_OPS(e1000_runtime_suspend, e1000_runtime_resume, 7032 7031 e1000_idle) 7033 7032 }; 7034 - #endif 7035 7033 7036 7034 /* PCI Device API Driver */ 7037 7035 static struct pci_driver e1000_driver = { ··· 7037 7039 .id_table = e1000_pci_tbl, 7038 7040 .probe = e1000_probe, 7039 7041 .remove = e1000_remove, 7040 - #ifdef CONFIG_PM 7041 7042 .driver = { 7042 7043 .pm = &e1000_pm_ops, 7043 7044 }, 7044 - #endif 7045 7045 .shutdown = e1000_shutdown, 7046 7046 .err_handler = &e1000_err_handler 7047 7047 };
+2
drivers/net/ethernet/qlogic/qlge/qlge_main.c
··· 4764 4764 NETIF_F_RXCSUM; 4765 4765 ndev->features = ndev->hw_features; 4766 4766 ndev->vlan_features = ndev->hw_features; 4767 + /* vlan gets same features (except vlan filter) */ 4768 + ndev->vlan_features &= ~NETIF_F_HW_VLAN_CTAG_FILTER; 4767 4769 4768 4770 if (test_bit(QL_DMA64, &qdev->flags)) 4769 4771 ndev->features |= NETIF_F_HIGHDMA;
+1
drivers/net/ethernet/via/via-rhine.c
··· 1618 1618 goto out_unlock; 1619 1619 1620 1620 napi_disable(&rp->napi); 1621 + netif_tx_disable(dev); 1621 1622 spin_lock_bh(&rp->lock); 1622 1623 1623 1624 /* clear all descriptors */
+12
drivers/net/usb/dm9601.c
··· 613 613 USB_DEVICE(0x0a46, 0x9621), /* DM9621A USB to Fast Ethernet Adapter */ 614 614 .driver_info = (unsigned long)&dm9601_info, 615 615 }, 616 + { 617 + USB_DEVICE(0x0a46, 0x9622), /* DM9622 USB to Fast Ethernet Adapter */ 618 + .driver_info = (unsigned long)&dm9601_info, 619 + }, 620 + { 621 + USB_DEVICE(0x0a46, 0x0269), /* DM962OA USB to Fast Ethernet Adapter */ 622 + .driver_info = (unsigned long)&dm9601_info, 623 + }, 624 + { 625 + USB_DEVICE(0x0a46, 0x1269), /* DM9621A USB to Fast Ethernet Adapter */ 626 + .driver_info = (unsigned long)&dm9601_info, 627 + }, 616 628 {}, // END 617 629 }; 618 630
+6 -1
fs/dcache.c
··· 3061 3061 * thus don't need to be hashed. They also don't need a name until a 3062 3062 * user wants to identify the object in /proc/pid/fd/. The little hack 3063 3063 * below allows us to generate a name for these objects on demand: 3064 + * 3065 + * Some pseudo inodes are mountable. When they are mounted 3066 + * path->dentry == path->mnt->mnt_root. In that case don't call d_dname 3067 + * and instead have d_path return the mounted path. 3064 3068 */ 3065 - if (path->dentry->d_op && path->dentry->d_op->d_dname) 3069 + if (path->dentry->d_op && path->dentry->d_op->d_dname && 3070 + (!IS_ROOT(path->dentry) || path->dentry != path->mnt->mnt_root)) 3066 3071 return path->dentry->d_op->d_dname(path->dentry, buf, buflen); 3067 3072 3068 3073 rcu_read_lock();
+9 -6
fs/fs-writeback.c
··· 516 516 } 517 517 WARN_ON(inode->i_state & I_SYNC); 518 518 /* 519 - * Skip inode if it is clean. We don't want to mess with writeback 520 - * lists in this function since flusher thread may be doing for example 521 - * sync in parallel and if we move the inode, it could get skipped. So 522 - * here we make sure inode is on some writeback list and leave it there 523 - * unless we have completely cleaned the inode. 519 + * Skip inode if it is clean and we have no outstanding writeback in 520 + * WB_SYNC_ALL mode. We don't want to mess with writeback lists in this 521 + * function since flusher thread may be doing for example sync in 522 + * parallel and if we move the inode, it could get skipped. So here we 523 + * make sure inode is on some writeback list and leave it there unless 524 + * we have completely cleaned the inode. 524 525 */ 525 - if (!(inode->i_state & I_DIRTY)) 526 + if (!(inode->i_state & I_DIRTY) && 527 + (wbc->sync_mode != WB_SYNC_ALL || 528 + !mapping_tagged(inode->i_mapping, PAGECACHE_TAG_WRITEBACK))) 526 529 goto out; 527 530 inode->i_state |= I_SYNC; 528 531 spin_unlock(&inode->i_lock);
+1 -1
fs/namespace.c
··· 2886 2886 struct inode *inode = child->mnt_mountpoint->d_inode; 2887 2887 if (!S_ISDIR(inode->i_mode)) 2888 2888 goto next; 2889 - if (inode->i_nlink != 2) 2889 + if (inode->i_nlink > 2) 2890 2890 goto next; 2891 2891 } 2892 2892 visible = true;
+6 -4
fs/nilfs2/segment.c
··· 1440 1440 1441 1441 nilfs_clear_logs(&sci->sc_segbufs); 1442 1442 1443 - err = nilfs_segctor_extend_segments(sci, nilfs, nadd); 1444 - if (unlikely(err)) 1445 - return err; 1446 - 1447 1443 if (sci->sc_stage.flags & NILFS_CF_SUFREED) { 1448 1444 err = nilfs_sufile_cancel_freev(nilfs->ns_sufile, 1449 1445 sci->sc_freesegs, 1450 1446 sci->sc_nfreesegs, 1451 1447 NULL); 1452 1448 WARN_ON(err); /* do not happen */ 1449 + sci->sc_stage.flags &= ~NILFS_CF_SUFREED; 1453 1450 } 1451 + 1452 + err = nilfs_segctor_extend_segments(sci, nilfs, nadd); 1453 + if (unlikely(err)) 1454 + return err; 1455 + 1454 1456 nadd = min_t(int, nadd << 1, SC_MAX_SEGDELTA); 1455 1457 sci->sc_stage = prev_stage; 1456 1458 }
+2
include/linux/crash_dump.h
··· 6 6 #include <linux/proc_fs.h> 7 7 #include <linux/elf.h> 8 8 9 + #include <asm/pgtable.h> /* for pgprot_t */ 10 + 9 11 #define ELFCORE_ADDR_MAX (-1ULL) 10 12 #define ELFCORE_ADDR_ERR (-2ULL) 11 13
+1 -1
include/linux/i2c.h
··· 445 445 static inline struct i2c_adapter * 446 446 i2c_parent_is_i2c_adapter(const struct i2c_adapter *adapter) 447 447 { 448 - #if IS_ENABLED(I2C_MUX) 448 + #if IS_ENABLED(CONFIG_I2C_MUX) 449 449 struct device *parent = adapter->dev.parent; 450 450 451 451 if (parent != NULL && parent->type == &i2c_adapter_type)
+19 -8
include/linux/seqlock.h
··· 117 117 } 118 118 119 119 /** 120 - * read_seqcount_begin_no_lockdep - start seq-read critical section w/o lockdep 120 + * raw_read_seqcount_begin - start seq-read critical section w/o lockdep 121 121 * @s: pointer to seqcount_t 122 122 * Returns: count to be passed to read_seqcount_retry 123 123 * 124 - * read_seqcount_begin_no_lockdep opens a read critical section of the given 124 + * raw_read_seqcount_begin opens a read critical section of the given 125 125 * seqcount, but without any lockdep checking. Validity of the critical 126 126 * section is tested by checking read_seqcount_retry function. 127 127 */ 128 - static inline unsigned read_seqcount_begin_no_lockdep(const seqcount_t *s) 128 + static inline unsigned raw_read_seqcount_begin(const seqcount_t *s) 129 129 { 130 130 unsigned ret = __read_seqcount_begin(s); 131 131 smp_rmb(); ··· 144 144 static inline unsigned read_seqcount_begin(const seqcount_t *s) 145 145 { 146 146 seqcount_lockdep_reader_access(s); 147 - return read_seqcount_begin_no_lockdep(s); 147 + return raw_read_seqcount_begin(s); 148 148 } 149 149 150 150 /** ··· 206 206 } 207 207 208 208 209 + 210 + static inline void raw_write_seqcount_begin(seqcount_t *s) 211 + { 212 + s->sequence++; 213 + smp_wmb(); 214 + } 215 + 216 + static inline void raw_write_seqcount_end(seqcount_t *s) 217 + { 218 + smp_wmb(); 219 + s->sequence++; 220 + } 221 + 209 222 /* 210 223 * Sequence counter only version assumes that callers are using their 211 224 * own mutexing. 212 225 */ 213 226 static inline void write_seqcount_begin_nested(seqcount_t *s, int subclass) 214 227 { 215 - s->sequence++; 216 - smp_wmb(); 228 + raw_write_seqcount_begin(s); 217 229 seqcount_acquire(&s->dep_map, subclass, 0, _RET_IP_); 218 230 } 219 231 ··· 237 225 static inline void write_seqcount_end(seqcount_t *s) 238 226 { 239 227 seqcount_release(&s->dep_map, 1, _RET_IP_); 240 - smp_wmb(); 241 - s->sequence++; 228 + raw_write_seqcount_end(s); 242 229 } 243 230 244 231 /**
-1
include/net/if_inet6.h
··· 165 165 struct net_device *dev; 166 166 167 167 struct list_head addr_list; 168 - int valid_ll_addr_cnt; 169 168 170 169 struct ifmcaddr6 *mc_list; 171 170 struct ifmcaddr6 *mc_tomb;
+1 -1
kernel/fork.c
··· 1172 1172 * do not allow it to share a thread group or signal handlers or 1173 1173 * parent with the forking task. 1174 1174 */ 1175 - if (clone_flags & (CLONE_SIGHAND | CLONE_PARENT)) { 1175 + if (clone_flags & CLONE_SIGHAND) { 1176 1176 if ((clone_flags & (CLONE_NEWUSER | CLONE_NEWPID)) || 1177 1177 (task_active_pid_ns(current) != 1178 1178 current->nsproxy->pid_ns_for_children))
+1 -1
kernel/sched/fair.c
··· 3923 3923 { 3924 3924 struct sched_entity *se = tg->se[cpu]; 3925 3925 3926 - if (!tg->parent || !wl) /* the trivial, non-cgroup case */ 3926 + if (!tg->parent) /* the trivial, non-cgroup case */ 3927 3927 return wl; 3928 3928 3929 3929 for_each_sched_entity(se) {
+3 -3
kernel/time/sched_clock.c
··· 74 74 return cd.epoch_ns; 75 75 76 76 do { 77 - seq = read_seqcount_begin(&cd.seq); 77 + seq = raw_read_seqcount_begin(&cd.seq); 78 78 epoch_cyc = cd.epoch_cyc; 79 79 epoch_ns = cd.epoch_ns; 80 80 } while (read_seqcount_retry(&cd.seq, seq)); ··· 99 99 cd.mult, cd.shift); 100 100 101 101 raw_local_irq_save(flags); 102 - write_seqcount_begin(&cd.seq); 102 + raw_write_seqcount_begin(&cd.seq); 103 103 cd.epoch_ns = ns; 104 104 cd.epoch_cyc = cyc; 105 - write_seqcount_end(&cd.seq); 105 + raw_write_seqcount_end(&cd.seq); 106 106 raw_local_irq_restore(flags); 107 107 } 108 108
+2 -2
lib/percpu_counter.c
··· 82 82 unsigned long flags; 83 83 raw_spin_lock_irqsave(&fbc->lock, flags); 84 84 fbc->count += count; 85 + __this_cpu_sub(*fbc->counters, count - amount); 85 86 raw_spin_unlock_irqrestore(&fbc->lock, flags); 86 - __this_cpu_write(*fbc->counters, 0); 87 87 } else { 88 - __this_cpu_write(*fbc->counters, count); 88 + this_cpu_add(*fbc->counters, amount); 89 89 } 90 90 preempt_enable(); 91 91 }
+3 -3
mm/huge_memory.c
··· 1154 1154 new_page = NULL; 1155 1155 1156 1156 if (unlikely(!new_page)) { 1157 - if (is_huge_zero_pmd(orig_pmd)) { 1157 + if (!page) { 1158 1158 ret = do_huge_pmd_wp_zero_page_fallback(mm, vma, 1159 1159 address, pmd, orig_pmd, haddr); 1160 1160 } else { ··· 1181 1181 1182 1182 count_vm_event(THP_FAULT_ALLOC); 1183 1183 1184 - if (is_huge_zero_pmd(orig_pmd)) 1184 + if (!page) 1185 1185 clear_huge_page(new_page, haddr, HPAGE_PMD_NR); 1186 1186 else 1187 1187 copy_user_huge_page(new_page, page, haddr, vma, HPAGE_PMD_NR); ··· 1207 1207 page_add_new_anon_rmap(new_page, vma, haddr); 1208 1208 set_pmd_at(mm, haddr, pmd, entry); 1209 1209 update_mmu_cache_pmd(vma, address, pmd); 1210 - if (is_huge_zero_pmd(orig_pmd)) { 1210 + if (!page) { 1211 1211 add_mm_counter(mm, MM_ANONPAGES, HPAGE_PMD_NR); 1212 1212 put_huge_zero_page(); 1213 1213 } else {
+4 -1
mm/util.c
··· 390 390 { 391 391 struct address_space *mapping = page->mapping; 392 392 393 - VM_BUG_ON(PageSlab(page)); 393 + /* This happens if someone calls flush_dcache_page on slab page */ 394 + if (unlikely(PageSlab(page))) 395 + return NULL; 396 + 394 397 if (unlikely(PageSwapCache(page))) { 395 398 swp_entry_t entry; 396 399
+1 -1
net/batman-adv/main.c
··· 275 275 sizeof(struct batadv_coded_packet)); 276 276 #endif 277 277 278 - return header_len; 278 + return header_len + ETH_HLEN; 279 279 } 280 280 281 281 /**
+2 -28
net/core/filter.c
··· 36 36 #include <asm/uaccess.h> 37 37 #include <asm/unaligned.h> 38 38 #include <linux/filter.h> 39 - #include <linux/reciprocal_div.h> 40 39 #include <linux/ratelimit.h> 41 40 #include <linux/seccomp.h> 42 41 #include <linux/if_vlan.h> ··· 165 166 A /= X; 166 167 continue; 167 168 case BPF_S_ALU_DIV_K: 168 - A = reciprocal_divide(A, K); 169 + A /= K; 169 170 continue; 170 171 case BPF_S_ALU_MOD_X: 171 172 if (X == 0) ··· 552 553 /* Some instructions need special checks */ 553 554 switch (code) { 554 555 case BPF_S_ALU_DIV_K: 555 - /* check for division by zero */ 556 - if (ftest->k == 0) 557 - return -EINVAL; 558 - ftest->k = reciprocal_value(ftest->k); 559 - break; 560 556 case BPF_S_ALU_MOD_K: 561 557 /* check for division by zero */ 562 558 if (ftest->k == 0) ··· 847 853 to->code = decodes[code]; 848 854 to->jt = filt->jt; 849 855 to->jf = filt->jf; 850 - 851 - if (code == BPF_S_ALU_DIV_K) { 852 - /* 853 - * When loaded this rule user gave us X, which was 854 - * translated into R = r(X). Now we calculate the 855 - * RR = r(R) and report it back. If next time this 856 - * value is loaded and RRR = r(RR) is calculated 857 - * then the R == RRR will be true. 858 - * 859 - * One exception. X == 1 translates into R == 0 and 860 - * we can't calculate RR out of it with r(). 861 - */ 862 - 863 - if (filt->k == 0) 864 - to->k = 1; 865 - else 866 - to->k = reciprocal_value(filt->k); 867 - 868 - BUG_ON(reciprocal_value(to->k) != filt->k); 869 - } else 870 - to->k = filt->k; 856 + to->k = filt->k; 871 857 } 872 858 873 859 int sk_get_filter(struct sock *sk, struct sock_filter __user *ubuf, unsigned int len)
+4 -2
net/ieee802154/nl-phy.c
··· 221 221 222 222 if (info->attrs[IEEE802154_ATTR_DEV_TYPE]) { 223 223 type = nla_get_u8(info->attrs[IEEE802154_ATTR_DEV_TYPE]); 224 - if (type >= __IEEE802154_DEV_MAX) 225 - return -EINVAL; 224 + if (type >= __IEEE802154_DEV_MAX) { 225 + rc = -EINVAL; 226 + goto nla_put_failure; 227 + } 226 228 } 227 229 228 230 dev = phy->add_iface(phy, devname, type);
+5 -2
net/ipv4/ipmr.c
··· 157 157 static int ipmr_fib_lookup(struct net *net, struct flowi4 *flp4, 158 158 struct mr_table **mrt) 159 159 { 160 - struct ipmr_result res; 161 - struct fib_lookup_arg arg = { .result = &res, }; 162 160 int err; 161 + struct ipmr_result res; 162 + struct fib_lookup_arg arg = { 163 + .result = &res, 164 + .flags = FIB_LOOKUP_NOREF, 165 + }; 163 166 164 167 err = fib_rules_lookup(net->ipv4.mr_rules_ops, 165 168 flowi4_to_flowi(flp4), 0, &arg);
+33 -19
net/ipv4/tcp_metrics.c
··· 22 22 23 23 int sysctl_tcp_nometrics_save __read_mostly; 24 24 25 + static struct tcp_metrics_block *__tcp_get_metrics(const struct inetpeer_addr *saddr, 26 + const struct inetpeer_addr *daddr, 27 + struct net *net, unsigned int hash); 28 + 25 29 struct tcp_fastopen_metrics { 26 30 u16 mss; 27 31 u16 syn_loss:10; /* Recurring Fast Open SYN losses */ ··· 135 131 } 136 132 } 137 133 134 + #define TCP_METRICS_TIMEOUT (60 * 60 * HZ) 135 + 136 + static void tcpm_check_stamp(struct tcp_metrics_block *tm, struct dst_entry *dst) 137 + { 138 + if (tm && unlikely(time_after(jiffies, tm->tcpm_stamp + TCP_METRICS_TIMEOUT))) 139 + tcpm_suck_dst(tm, dst, false); 140 + } 141 + 142 + #define TCP_METRICS_RECLAIM_DEPTH 5 143 + #define TCP_METRICS_RECLAIM_PTR (struct tcp_metrics_block *) 0x1UL 144 + 138 145 static struct tcp_metrics_block *tcpm_new(struct dst_entry *dst, 139 146 struct inetpeer_addr *saddr, 140 147 struct inetpeer_addr *daddr, 141 - unsigned int hash, 142 - bool reclaim) 148 + unsigned int hash) 143 149 { 144 150 struct tcp_metrics_block *tm; 145 151 struct net *net; 152 + bool reclaim = false; 146 153 147 154 spin_lock_bh(&tcp_metrics_lock); 148 155 net = dev_net(dst->dev); 156 + 157 + /* While waiting for the spin-lock the cache might have been populated 158 + * with this entry and so we have to check again. 159 + */ 160 + tm = __tcp_get_metrics(saddr, daddr, net, hash); 161 + if (tm == TCP_METRICS_RECLAIM_PTR) { 162 + reclaim = true; 163 + tm = NULL; 164 + } 165 + if (tm) { 166 + tcpm_check_stamp(tm, dst); 167 + goto out_unlock; 168 + } 169 + 149 170 if (unlikely(reclaim)) { 150 171 struct tcp_metrics_block *oldest; 151 172 ··· 200 171 spin_unlock_bh(&tcp_metrics_lock); 201 172 return tm; 202 173 } 203 - 204 - #define TCP_METRICS_TIMEOUT (60 * 60 * HZ) 205 - 206 - static void tcpm_check_stamp(struct tcp_metrics_block *tm, struct dst_entry *dst) 207 - { 208 - if (tm && unlikely(time_after(jiffies, tm->tcpm_stamp + TCP_METRICS_TIMEOUT))) 209 - tcpm_suck_dst(tm, dst, false); 210 - } 211 - 212 - #define TCP_METRICS_RECLAIM_DEPTH 5 213 - #define TCP_METRICS_RECLAIM_PTR (struct tcp_metrics_block *) 0x1UL 214 174 215 175 static struct tcp_metrics_block *tcp_get_encode(struct tcp_metrics_block *tm, int depth) 216 176 { ··· 313 295 struct inetpeer_addr saddr, daddr; 314 296 unsigned int hash; 315 297 struct net *net; 316 - bool reclaim; 317 298 318 299 saddr.family = sk->sk_family; 319 300 daddr.family = sk->sk_family; ··· 337 320 hash = hash_32(hash, net->ipv4.tcp_metrics_hash_log); 338 321 339 322 tm = __tcp_get_metrics(&saddr, &daddr, net, hash); 340 - reclaim = false; 341 - if (tm == TCP_METRICS_RECLAIM_PTR) { 342 - reclaim = true; 323 + if (tm == TCP_METRICS_RECLAIM_PTR) 343 324 tm = NULL; 344 - } 345 325 if (!tm && create) 346 - tm = tcpm_new(dst, &saddr, &daddr, hash, reclaim); 326 + tm = tcpm_new(dst, &saddr, &daddr, hash); 347 327 else 348 328 tcpm_check_stamp(tm, dst); 349 329
+17 -21
net/ipv6/addrconf.c
··· 3233 3233 in6_ifa_put(ifp); 3234 3234 } 3235 3235 3236 + /* ifp->idev must be at least read locked */ 3237 + static bool ipv6_lonely_lladdr(struct inet6_ifaddr *ifp) 3238 + { 3239 + struct inet6_ifaddr *ifpiter; 3240 + struct inet6_dev *idev = ifp->idev; 3241 + 3242 + list_for_each_entry(ifpiter, &idev->addr_list, if_list) { 3243 + if (ifp != ifpiter && ifpiter->scope == IFA_LINK && 3244 + (ifpiter->flags & (IFA_F_PERMANENT|IFA_F_TENTATIVE| 3245 + IFA_F_OPTIMISTIC|IFA_F_DADFAILED)) == 3246 + IFA_F_PERMANENT) 3247 + return false; 3248 + } 3249 + return true; 3250 + } 3251 + 3236 3252 static void addrconf_dad_completed(struct inet6_ifaddr *ifp) 3237 3253 { 3238 3254 struct net_device *dev = ifp->idev->dev; ··· 3268 3252 */ 3269 3253 3270 3254 read_lock_bh(&ifp->idev->lock); 3271 - spin_lock(&ifp->lock); 3272 - send_mld = ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL && 3273 - ifp->idev->valid_ll_addr_cnt == 1; 3255 + send_mld = ifp->scope == IFA_LINK && ipv6_lonely_lladdr(ifp); 3274 3256 send_rs = send_mld && 3275 3257 ipv6_accept_ra(ifp->idev) && 3276 3258 ifp->idev->cnf.rtr_solicits > 0 && 3277 3259 (dev->flags&IFF_LOOPBACK) == 0; 3278 - spin_unlock(&ifp->lock); 3279 3260 read_unlock_bh(&ifp->idev->lock); 3280 3261 3281 3262 /* While dad is in progress mld report's source address is in6_addrany. ··· 4611 4598 rtnl_set_sk_err(net, RTNLGRP_IPV6_PREFIX, err); 4612 4599 } 4613 4600 4614 - static void update_valid_ll_addr_cnt(struct inet6_ifaddr *ifp, int count) 4615 - { 4616 - write_lock_bh(&ifp->idev->lock); 4617 - spin_lock(&ifp->lock); 4618 - if (((ifp->flags & (IFA_F_PERMANENT|IFA_F_TENTATIVE|IFA_F_OPTIMISTIC| 4619 - IFA_F_DADFAILED)) == IFA_F_PERMANENT) && 4620 - (ipv6_addr_type(&ifp->addr) & IPV6_ADDR_LINKLOCAL)) 4621 - ifp->idev->valid_ll_addr_cnt += count; 4622 - WARN_ON(ifp->idev->valid_ll_addr_cnt < 0); 4623 - spin_unlock(&ifp->lock); 4624 - write_unlock_bh(&ifp->idev->lock); 4625 - } 4626 - 4627 4601 static void __ipv6_ifa_notify(int event, struct inet6_ifaddr *ifp) 4628 4602 { 4629 4603 struct net *net = dev_net(ifp->idev->dev); ··· 4619 4619 4620 4620 switch (event) { 4621 4621 case RTM_NEWADDR: 4622 - update_valid_ll_addr_cnt(ifp, 1); 4623 - 4624 4622 /* 4625 4623 * If the address was optimistic 4626 4624 * we inserted the route at the start of ··· 4634 4636 ifp->idev->dev, 0, 0); 4635 4637 break; 4636 4638 case RTM_DELADDR: 4637 - update_valid_ll_addr_cnt(ifp, -1); 4638 - 4639 4639 if (ifp->idev->cnf.forwarding) 4640 4640 addrconf_leave_anycast(ifp); 4641 4641 addrconf_leave_solict(ifp->idev, &ifp->addr);
+5 -2
net/ipv6/ip6mr.c
··· 141 141 static int ip6mr_fib_lookup(struct net *net, struct flowi6 *flp6, 142 142 struct mr6_table **mrt) 143 143 { 144 - struct ip6mr_result res; 145 - struct fib_lookup_arg arg = { .result = &res, }; 146 144 int err; 145 + struct ip6mr_result res; 146 + struct fib_lookup_arg arg = { 147 + .result = &res, 148 + .flags = FIB_LOOKUP_NOREF, 149 + }; 147 150 148 151 err = fib_rules_lookup(net->ipv6.mr6_rules_ops, 149 152 flowi6_to_flowi(flp6), 0, &arg);
+3 -4
net/rds/ib_recv.c
··· 421 421 struct rds_ib_refill_cache *cache) 422 422 { 423 423 unsigned long flags; 424 - struct list_head *old; 425 - struct list_head __percpu *chpfirst; 424 + struct list_head *old, *chpfirst; 426 425 427 426 local_irq_save(flags); 428 427 ··· 431 432 else /* put on front */ 432 433 list_add_tail(new_item, chpfirst); 433 434 434 - __this_cpu_write(chpfirst, new_item); 435 + __this_cpu_write(cache->percpu->first, new_item); 435 436 __this_cpu_inc(cache->percpu->count); 436 437 437 438 if (__this_cpu_read(cache->percpu->count) < RDS_IB_RECYCLE_BATCH_COUNT) ··· 451 452 } while (old); 452 453 453 454 454 - __this_cpu_write(chpfirst, NULL); 455 + __this_cpu_write(cache->percpu->first, NULL); 455 456 __this_cpu_write(cache->percpu->count, 0); 456 457 end: 457 458 local_irq_restore(flags);
+18 -2
security/selinux/hooks.c
··· 234 234 return 0; 235 235 } 236 236 237 + static void inode_free_rcu(struct rcu_head *head) 238 + { 239 + struct inode_security_struct *isec; 240 + 241 + isec = container_of(head, struct inode_security_struct, rcu); 242 + kmem_cache_free(sel_inode_cache, isec); 243 + } 244 + 237 245 static void inode_free_security(struct inode *inode) 238 246 { 239 247 struct inode_security_struct *isec = inode->i_security; ··· 252 244 list_del_init(&isec->list); 253 245 spin_unlock(&sbsec->isec_lock); 254 246 255 - inode->i_security = NULL; 256 - kmem_cache_free(sel_inode_cache, isec); 247 + /* 248 + * The inode may still be referenced in a path walk and 249 + * a call to selinux_inode_permission() can be made 250 + * after inode_free_security() is called. Ideally, the VFS 251 + * wouldn't do this, but fixing that is a much harder 252 + * job. For now, simply free the i_security via RCU, and 253 + * leave the current inode->i_security pointer intact. 254 + * The inode will be freed after the RCU grace period too. 255 + */ 256 + call_rcu(&isec->rcu, inode_free_rcu); 257 257 } 258 258 259 259 static int file_alloc_security(struct file *file)
+4 -1
security/selinux/include/objsec.h
··· 38 38 39 39 struct inode_security_struct { 40 40 struct inode *inode; /* back pointer to inode object */ 41 - struct list_head list; /* list of inode_security_struct */ 41 + union { 42 + struct list_head list; /* list of inode_security_struct */ 43 + struct rcu_head rcu; /* for freeing the inode_security_struct */ 44 + }; 42 45 u32 task_sid; /* SID of creating task */ 43 46 u32 sid; /* SID of this object */ 44 47 u16 sclass; /* security class of this object */