diff options
113 files changed, 764 insertions, 463 deletions
diff --git a/Documentation/feature-removal-schedule.txt b/Documentation/feature-removal-schedule.txt index 03ca210406ed..e4b57756b9f5 100644 --- a/Documentation/feature-removal-schedule.txt +++ b/Documentation/feature-removal-schedule.txt | |||
| @@ -539,3 +539,13 @@ When: 3.6 | |||
| 539 | Why: setitimer is not returning -EFAULT if user pointer is NULL. This | 539 | Why: setitimer is not returning -EFAULT if user pointer is NULL. This |
| 540 | violates the spec. | 540 | violates the spec. |
| 541 | Who: Sasikantha Babu <sasikanth.v19@gmail.com> | 541 | Who: Sasikantha Babu <sasikanth.v19@gmail.com> |
| 542 | |||
| 543 | ---------------------------- | ||
| 544 | |||
| 545 | What: V4L2_CID_HCENTER, V4L2_CID_VCENTER V4L2 controls | ||
| 546 | When: 3.7 | ||
| 547 | Why: The V4L2_CID_VCENTER, V4L2_CID_HCENTER controls have been deprecated | ||
| 548 | for about 4 years and they are not used by any mainline driver. | ||
| 549 | There are newer controls (V4L2_CID_PAN*, V4L2_CID_TILT*) that provide | ||
| 550 | similar functionality. | ||
| 551 | Who: Sylwester Nawrocki <sylvester.nawrocki@gmail.com> | ||
diff --git a/arch/arm/mach-prima2/irq.c b/arch/arm/mach-prima2/irq.c index 37c2de9b6f26..a7b9415d30f8 100644 --- a/arch/arm/mach-prima2/irq.c +++ b/arch/arm/mach-prima2/irq.c | |||
| @@ -42,7 +42,8 @@ sirfsoc_alloc_gc(void __iomem *base, unsigned int irq_start, unsigned int num) | |||
| 42 | static __init void sirfsoc_irq_init(void) | 42 | static __init void sirfsoc_irq_init(void) |
| 43 | { | 43 | { |
| 44 | sirfsoc_alloc_gc(sirfsoc_intc_base, 0, 32); | 44 | sirfsoc_alloc_gc(sirfsoc_intc_base, 0, 32); |
| 45 | sirfsoc_alloc_gc(sirfsoc_intc_base + 4, 32, SIRFSOC_INTENAL_IRQ_END - 32); | 45 | sirfsoc_alloc_gc(sirfsoc_intc_base + 4, 32, |
| 46 | SIRFSOC_INTENAL_IRQ_END + 1 - 32); | ||
| 46 | 47 | ||
| 47 | writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL0); | 48 | writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL0); |
| 48 | writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL1); | 49 | writel_relaxed(0, sirfsoc_intc_base + SIRFSOC_INT_RISC_LEVEL1); |
| @@ -68,7 +69,8 @@ void __init sirfsoc_of_irq_init(void) | |||
| 68 | if (!sirfsoc_intc_base) | 69 | if (!sirfsoc_intc_base) |
| 69 | panic("unable to map intc cpu registers\n"); | 70 | panic("unable to map intc cpu registers\n"); |
| 70 | 71 | ||
| 71 | irq_domain_add_legacy(np, 32, 0, 0, &irq_domain_simple_ops, NULL); | 72 | irq_domain_add_legacy(np, SIRFSOC_INTENAL_IRQ_END + 1, 0, 0, |
| 73 | &irq_domain_simple_ops, NULL); | ||
| 72 | 74 | ||
| 73 | of_node_put(np); | 75 | of_node_put(np); |
| 74 | 76 | ||
diff --git a/arch/arm/mach-tegra/flowctrl.c b/arch/arm/mach-tegra/flowctrl.c index fef66a7486ed..f07488e0bd32 100644 --- a/arch/arm/mach-tegra/flowctrl.c +++ b/arch/arm/mach-tegra/flowctrl.c | |||
| @@ -53,10 +53,10 @@ static void flowctrl_update(u8 offset, u32 value) | |||
| 53 | 53 | ||
| 54 | void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value) | 54 | void flowctrl_write_cpu_csr(unsigned int cpuid, u32 value) |
| 55 | { | 55 | { |
| 56 | return flowctrl_update(flowctrl_offset_halt_cpu[cpuid], value); | 56 | return flowctrl_update(flowctrl_offset_cpu_csr[cpuid], value); |
| 57 | } | 57 | } |
| 58 | 58 | ||
| 59 | void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value) | 59 | void flowctrl_write_cpu_halt(unsigned int cpuid, u32 value) |
| 60 | { | 60 | { |
| 61 | return flowctrl_update(flowctrl_offset_cpu_csr[cpuid], value); | 61 | return flowctrl_update(flowctrl_offset_halt_cpu[cpuid], value); |
| 62 | } | 62 | } |
diff --git a/arch/arm/mm/fault.c b/arch/arm/mm/fault.c index f07467533365..5bb48356d217 100644 --- a/arch/arm/mm/fault.c +++ b/arch/arm/mm/fault.c | |||
| @@ -247,7 +247,9 @@ good_area: | |||
| 247 | return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags); | 247 | return handle_mm_fault(mm, vma, addr & PAGE_MASK, flags); |
| 248 | 248 | ||
| 249 | check_stack: | 249 | check_stack: |
| 250 | if (vma->vm_flags & VM_GROWSDOWN && !expand_stack(vma, addr)) | 250 | /* Don't allow expansion below FIRST_USER_ADDRESS */ |
| 251 | if (vma->vm_flags & VM_GROWSDOWN && | ||
| 252 | addr >= FIRST_USER_ADDRESS && !expand_stack(vma, addr)) | ||
| 251 | goto good_area; | 253 | goto good_area; |
| 252 | out: | 254 | out: |
| 253 | return fault; | 255 | return fault; |
diff --git a/arch/arm/mm/mmu.c b/arch/arm/mm/mmu.c index 2c7cf2f9c837..aa78de8bfdd3 100644 --- a/arch/arm/mm/mmu.c +++ b/arch/arm/mm/mmu.c | |||
| @@ -489,7 +489,8 @@ static void __init build_mem_type_table(void) | |||
| 489 | */ | 489 | */ |
| 490 | for (i = 0; i < ARRAY_SIZE(mem_types); i++) { | 490 | for (i = 0; i < ARRAY_SIZE(mem_types); i++) { |
| 491 | mem_types[i].prot_pte |= PTE_EXT_AF; | 491 | mem_types[i].prot_pte |= PTE_EXT_AF; |
| 492 | mem_types[i].prot_sect |= PMD_SECT_AF; | 492 | if (mem_types[i].prot_sect) |
| 493 | mem_types[i].prot_sect |= PMD_SECT_AF; | ||
| 493 | } | 494 | } |
| 494 | kern_pgprot |= PTE_EXT_AF; | 495 | kern_pgprot |= PTE_EXT_AF; |
| 495 | vecs_pgprot |= PTE_EXT_AF; | 496 | vecs_pgprot |= PTE_EXT_AF; |
diff --git a/arch/arm/vfp/vfpmodule.c b/arch/arm/vfp/vfpmodule.c index bc683b8219b5..b0197b2c857d 100644 --- a/arch/arm/vfp/vfpmodule.c +++ b/arch/arm/vfp/vfpmodule.c | |||
| @@ -11,6 +11,7 @@ | |||
| 11 | #include <linux/types.h> | 11 | #include <linux/types.h> |
| 12 | #include <linux/cpu.h> | 12 | #include <linux/cpu.h> |
| 13 | #include <linux/cpu_pm.h> | 13 | #include <linux/cpu_pm.h> |
| 14 | #include <linux/hardirq.h> | ||
| 14 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
| 15 | #include <linux/notifier.h> | 16 | #include <linux/notifier.h> |
| 16 | #include <linux/signal.h> | 17 | #include <linux/signal.h> |
| @@ -432,7 +433,10 @@ void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs) | |||
| 432 | 433 | ||
| 433 | static void vfp_enable(void *unused) | 434 | static void vfp_enable(void *unused) |
| 434 | { | 435 | { |
| 435 | u32 access = get_copro_access(); | 436 | u32 access; |
| 437 | |||
| 438 | BUG_ON(preemptible()); | ||
| 439 | access = get_copro_access(); | ||
| 436 | 440 | ||
| 437 | /* | 441 | /* |
| 438 | * Enable full access to VFP (cp10 and cp11) | 442 | * Enable full access to VFP (cp10 and cp11) |
| @@ -573,12 +577,6 @@ int vfp_preserve_user_clear_hwstate(struct user_vfp __user *ufp, | |||
| 573 | * entry. | 577 | * entry. |
| 574 | */ | 578 | */ |
| 575 | hwstate->fpscr &= ~(FPSCR_LENGTH_MASK | FPSCR_STRIDE_MASK); | 579 | hwstate->fpscr &= ~(FPSCR_LENGTH_MASK | FPSCR_STRIDE_MASK); |
| 576 | |||
| 577 | /* | ||
| 578 | * Disable VFP in the hwstate so that we can detect if it gets | ||
| 579 | * used. | ||
| 580 | */ | ||
| 581 | hwstate->fpexc &= ~FPEXC_EN; | ||
| 582 | return 0; | 580 | return 0; |
| 583 | } | 581 | } |
| 584 | 582 | ||
| @@ -591,12 +589,8 @@ int vfp_restore_user_hwstate(struct user_vfp __user *ufp, | |||
| 591 | unsigned long fpexc; | 589 | unsigned long fpexc; |
| 592 | int err = 0; | 590 | int err = 0; |
| 593 | 591 | ||
| 594 | /* | 592 | /* Disable VFP to avoid corrupting the new thread state. */ |
| 595 | * If VFP has been used, then disable it to avoid corrupting | 593 | vfp_flush_hwstate(thread); |
| 596 | * the new thread state. | ||
| 597 | */ | ||
| 598 | if (hwstate->fpexc & FPEXC_EN) | ||
| 599 | vfp_flush_hwstate(thread); | ||
| 600 | 594 | ||
| 601 | /* | 595 | /* |
| 602 | * Copy the floating point registers. There can be unused | 596 | * Copy the floating point registers. There can be unused |
| @@ -657,7 +651,7 @@ static int __init vfp_init(void) | |||
| 657 | unsigned int cpu_arch = cpu_architecture(); | 651 | unsigned int cpu_arch = cpu_architecture(); |
| 658 | 652 | ||
| 659 | if (cpu_arch >= CPU_ARCH_ARMv6) | 653 | if (cpu_arch >= CPU_ARCH_ARMv6) |
| 660 | vfp_enable(NULL); | 654 | on_each_cpu(vfp_enable, NULL, 1); |
| 661 | 655 | ||
| 662 | /* | 656 | /* |
| 663 | * First check that there is a VFP that we can use. | 657 | * First check that there is a VFP that we can use. |
| @@ -678,8 +672,6 @@ static int __init vfp_init(void) | |||
| 678 | } else { | 672 | } else { |
| 679 | hotcpu_notifier(vfp_hotplug, 0); | 673 | hotcpu_notifier(vfp_hotplug, 0); |
| 680 | 674 | ||
| 681 | smp_call_function(vfp_enable, NULL, 1); | ||
| 682 | |||
| 683 | VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */ | 675 | VFP_arch = (vfpsid & FPSID_ARCH_MASK) >> FPSID_ARCH_BIT; /* Extract the architecture version */ |
| 684 | printk("implementor %02x architecture %d part %02x variant %x rev %x\n", | 676 | printk("implementor %02x architecture %d part %02x variant %x rev %x\n", |
| 685 | (vfpsid & FPSID_IMPLEMENTER_MASK) >> FPSID_IMPLEMENTER_BIT, | 677 | (vfpsid & FPSID_IMPLEMENTER_MASK) >> FPSID_IMPLEMENTER_BIT, |
diff --git a/arch/frv/include/asm/processor.h b/arch/frv/include/asm/processor.h index 81c2e271d620..9b1a92b73f60 100644 --- a/arch/frv/include/asm/processor.h +++ b/arch/frv/include/asm/processor.h | |||
| @@ -135,10 +135,6 @@ unsigned long get_wchan(struct task_struct *p); | |||
| 135 | #define KSTK_EIP(tsk) ((tsk)->thread.frame0->pc) | 135 | #define KSTK_EIP(tsk) ((tsk)->thread.frame0->pc) |
| 136 | #define KSTK_ESP(tsk) ((tsk)->thread.frame0->sp) | 136 | #define KSTK_ESP(tsk) ((tsk)->thread.frame0->sp) |
| 137 | 137 | ||
| 138 | /* Allocation and freeing of basic task resources. */ | ||
| 139 | extern struct task_struct *alloc_task_struct_node(int node); | ||
| 140 | extern void free_task_struct(struct task_struct *p); | ||
| 141 | |||
| 142 | #define cpu_relax() barrier() | 138 | #define cpu_relax() barrier() |
| 143 | 139 | ||
| 144 | /* data cache prefetch */ | 140 | /* data cache prefetch */ |
diff --git a/arch/mn10300/kernel/smp.c b/arch/mn10300/kernel/smp.c index 910dddf65e44..9cd69ad6aa02 100644 --- a/arch/mn10300/kernel/smp.c +++ b/arch/mn10300/kernel/smp.c | |||
| @@ -24,6 +24,7 @@ | |||
| 24 | #include <linux/sched.h> | 24 | #include <linux/sched.h> |
| 25 | #include <linux/profile.h> | 25 | #include <linux/profile.h> |
| 26 | #include <linux/smp.h> | 26 | #include <linux/smp.h> |
| 27 | #include <linux/cpu.h> | ||
| 27 | #include <asm/tlbflush.h> | 28 | #include <asm/tlbflush.h> |
| 28 | #include <asm/bitops.h> | 29 | #include <asm/bitops.h> |
| 29 | #include <asm/processor.h> | 30 | #include <asm/processor.h> |
| @@ -38,7 +39,6 @@ | |||
| 38 | #include "internal.h" | 39 | #include "internal.h" |
| 39 | 40 | ||
| 40 | #ifdef CONFIG_HOTPLUG_CPU | 41 | #ifdef CONFIG_HOTPLUG_CPU |
| 41 | #include <linux/cpu.h> | ||
| 42 | #include <asm/cacheflush.h> | 42 | #include <asm/cacheflush.h> |
| 43 | 43 | ||
| 44 | static unsigned long sleep_mode[NR_CPUS]; | 44 | static unsigned long sleep_mode[NR_CPUS]; |
| @@ -874,10 +874,13 @@ static void __init smp_online(void) | |||
| 874 | 874 | ||
| 875 | cpu = smp_processor_id(); | 875 | cpu = smp_processor_id(); |
| 876 | 876 | ||
| 877 | local_irq_enable(); | 877 | notify_cpu_starting(cpu); |
| 878 | 878 | ||
| 879 | ipi_call_lock(); | ||
| 879 | set_cpu_online(cpu, true); | 880 | set_cpu_online(cpu, true); |
| 880 | smp_wmb(); | 881 | ipi_call_unlock(); |
| 882 | |||
| 883 | local_irq_enable(); | ||
| 881 | } | 884 | } |
| 882 | 885 | ||
| 883 | /** | 886 | /** |
diff --git a/arch/parisc/kernel/smp.c b/arch/parisc/kernel/smp.c index 0bb1d63907f8..4dc7b7942b4c 100644 --- a/arch/parisc/kernel/smp.c +++ b/arch/parisc/kernel/smp.c | |||
| @@ -31,6 +31,7 @@ | |||
| 31 | #include <linux/delay.h> | 31 | #include <linux/delay.h> |
| 32 | #include <linux/bitops.h> | 32 | #include <linux/bitops.h> |
| 33 | #include <linux/ftrace.h> | 33 | #include <linux/ftrace.h> |
| 34 | #include <linux/cpu.h> | ||
| 34 | 35 | ||
| 35 | #include <linux/atomic.h> | 36 | #include <linux/atomic.h> |
| 36 | #include <asm/current.h> | 37 | #include <asm/current.h> |
| @@ -295,8 +296,13 @@ smp_cpu_init(int cpunum) | |||
| 295 | 296 | ||
| 296 | printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum); | 297 | printk(KERN_CRIT "CPU#%d already initialized!\n", cpunum); |
| 297 | machine_halt(); | 298 | machine_halt(); |
| 298 | } | 299 | } |
| 300 | |||
| 301 | notify_cpu_starting(cpunum); | ||
| 302 | |||
| 303 | ipi_call_lock(); | ||
| 299 | set_cpu_online(cpunum, true); | 304 | set_cpu_online(cpunum, true); |
| 305 | ipi_call_unlock(); | ||
| 300 | 306 | ||
| 301 | /* Initialise the idle task for this CPU */ | 307 | /* Initialise the idle task for this CPU */ |
| 302 | atomic_inc(&init_mm.mm_count); | 308 | atomic_inc(&init_mm.mm_count); |
diff --git a/arch/powerpc/include/asm/kvm_book3s.h b/arch/powerpc/include/asm/kvm_book3s.h index aa795ccef294..fd07f43d6622 100644 --- a/arch/powerpc/include/asm/kvm_book3s.h +++ b/arch/powerpc/include/asm/kvm_book3s.h | |||
| @@ -81,12 +81,13 @@ struct kvmppc_vcpu_book3s { | |||
| 81 | u64 sdr1; | 81 | u64 sdr1; |
| 82 | u64 hior; | 82 | u64 hior; |
| 83 | u64 msr_mask; | 83 | u64 msr_mask; |
| 84 | u64 vsid_next; | ||
| 85 | #ifdef CONFIG_PPC_BOOK3S_32 | 84 | #ifdef CONFIG_PPC_BOOK3S_32 |
| 86 | u32 vsid_pool[VSID_POOL_SIZE]; | 85 | u32 vsid_pool[VSID_POOL_SIZE]; |
| 86 | u32 vsid_next; | ||
| 87 | #else | 87 | #else |
| 88 | u64 vsid_first; | 88 | u64 proto_vsid_first; |
| 89 | u64 vsid_max; | 89 | u64 proto_vsid_max; |
| 90 | u64 proto_vsid_next; | ||
| 90 | #endif | 91 | #endif |
| 91 | int context_id[SID_CONTEXTS]; | 92 | int context_id[SID_CONTEXTS]; |
| 92 | 93 | ||
diff --git a/arch/powerpc/kvm/book3s_64_mmu_host.c b/arch/powerpc/kvm/book3s_64_mmu_host.c index 6f87f39a1ac2..10fc8ec9d2a8 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_host.c +++ b/arch/powerpc/kvm/book3s_64_mmu_host.c | |||
| @@ -194,14 +194,14 @@ static struct kvmppc_sid_map *create_sid_map(struct kvm_vcpu *vcpu, u64 gvsid) | |||
| 194 | backwards_map = !backwards_map; | 194 | backwards_map = !backwards_map; |
| 195 | 195 | ||
| 196 | /* Uh-oh ... out of mappings. Let's flush! */ | 196 | /* Uh-oh ... out of mappings. Let's flush! */ |
| 197 | if (vcpu_book3s->vsid_next == vcpu_book3s->vsid_max) { | 197 | if (vcpu_book3s->proto_vsid_next == vcpu_book3s->proto_vsid_max) { |
| 198 | vcpu_book3s->vsid_next = vcpu_book3s->vsid_first; | 198 | vcpu_book3s->proto_vsid_next = vcpu_book3s->proto_vsid_first; |
| 199 | memset(vcpu_book3s->sid_map, 0, | 199 | memset(vcpu_book3s->sid_map, 0, |
| 200 | sizeof(struct kvmppc_sid_map) * SID_MAP_NUM); | 200 | sizeof(struct kvmppc_sid_map) * SID_MAP_NUM); |
| 201 | kvmppc_mmu_pte_flush(vcpu, 0, 0); | 201 | kvmppc_mmu_pte_flush(vcpu, 0, 0); |
| 202 | kvmppc_mmu_flush_segments(vcpu); | 202 | kvmppc_mmu_flush_segments(vcpu); |
| 203 | } | 203 | } |
| 204 | map->host_vsid = vcpu_book3s->vsid_next++; | 204 | map->host_vsid = vsid_scramble(vcpu_book3s->proto_vsid_next++, 256M); |
| 205 | 205 | ||
| 206 | map->guest_vsid = gvsid; | 206 | map->guest_vsid = gvsid; |
| 207 | map->valid = true; | 207 | map->valid = true; |
| @@ -319,9 +319,10 @@ int kvmppc_mmu_init(struct kvm_vcpu *vcpu) | |||
| 319 | return -1; | 319 | return -1; |
| 320 | vcpu3s->context_id[0] = err; | 320 | vcpu3s->context_id[0] = err; |
| 321 | 321 | ||
| 322 | vcpu3s->vsid_max = ((vcpu3s->context_id[0] + 1) << USER_ESID_BITS) - 1; | 322 | vcpu3s->proto_vsid_max = ((vcpu3s->context_id[0] + 1) |
| 323 | vcpu3s->vsid_first = vcpu3s->context_id[0] << USER_ESID_BITS; | 323 | << USER_ESID_BITS) - 1; |
| 324 | vcpu3s->vsid_next = vcpu3s->vsid_first; | 324 | vcpu3s->proto_vsid_first = vcpu3s->context_id[0] << USER_ESID_BITS; |
| 325 | vcpu3s->proto_vsid_next = vcpu3s->proto_vsid_first; | ||
| 325 | 326 | ||
| 326 | kvmppc_mmu_hpte_init(vcpu); | 327 | kvmppc_mmu_hpte_init(vcpu); |
| 327 | 328 | ||
diff --git a/arch/powerpc/kvm/book3s_hv_rm_mmu.c b/arch/powerpc/kvm/book3s_hv_rm_mmu.c index def880aea63a..cec4daddbf31 100644 --- a/arch/powerpc/kvm/book3s_hv_rm_mmu.c +++ b/arch/powerpc/kvm/book3s_hv_rm_mmu.c | |||
| @@ -463,6 +463,7 @@ long kvmppc_h_bulk_remove(struct kvm_vcpu *vcpu) | |||
| 463 | /* insert R and C bits from PTE */ | 463 | /* insert R and C bits from PTE */ |
| 464 | rcbits = rev->guest_rpte & (HPTE_R_R|HPTE_R_C); | 464 | rcbits = rev->guest_rpte & (HPTE_R_R|HPTE_R_C); |
| 465 | args[j] |= rcbits << (56 - 5); | 465 | args[j] |= rcbits << (56 - 5); |
| 466 | hp[0] = 0; | ||
| 466 | continue; | 467 | continue; |
| 467 | } | 468 | } |
| 468 | 469 | ||
diff --git a/arch/powerpc/kvm/book3s_segment.S b/arch/powerpc/kvm/book3s_segment.S index 0676ae249b9f..6e6e9cef34a8 100644 --- a/arch/powerpc/kvm/book3s_segment.S +++ b/arch/powerpc/kvm/book3s_segment.S | |||
| @@ -197,7 +197,8 @@ kvmppc_interrupt: | |||
| 197 | /* Save guest PC and MSR */ | 197 | /* Save guest PC and MSR */ |
| 198 | #ifdef CONFIG_PPC64 | 198 | #ifdef CONFIG_PPC64 |
| 199 | BEGIN_FTR_SECTION | 199 | BEGIN_FTR_SECTION |
| 200 | andi. r0,r12,0x2 | 200 | andi. r0, r12, 0x2 |
| 201 | cmpwi cr1, r0, 0 | ||
| 201 | beq 1f | 202 | beq 1f |
| 202 | mfspr r3,SPRN_HSRR0 | 203 | mfspr r3,SPRN_HSRR0 |
| 203 | mfspr r4,SPRN_HSRR1 | 204 | mfspr r4,SPRN_HSRR1 |
| @@ -250,6 +251,12 @@ END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) | |||
| 250 | beq ld_last_prev_inst | 251 | beq ld_last_prev_inst |
| 251 | cmpwi r12, BOOK3S_INTERRUPT_ALIGNMENT | 252 | cmpwi r12, BOOK3S_INTERRUPT_ALIGNMENT |
| 252 | beq- ld_last_inst | 253 | beq- ld_last_inst |
| 254 | #ifdef CONFIG_PPC64 | ||
| 255 | BEGIN_FTR_SECTION | ||
| 256 | cmpwi r12, BOOK3S_INTERRUPT_H_EMUL_ASSIST | ||
| 257 | beq- ld_last_inst | ||
| 258 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) | ||
| 259 | #endif | ||
| 253 | 260 | ||
| 254 | b no_ld_last_inst | 261 | b no_ld_last_inst |
| 255 | 262 | ||
| @@ -316,23 +323,17 @@ no_dcbz32_off: | |||
| 316 | * Having set up SRR0/1 with the address where we want | 323 | * Having set up SRR0/1 with the address where we want |
| 317 | * to continue with relocation on (potentially in module | 324 | * to continue with relocation on (potentially in module |
| 318 | * space), we either just go straight there with rfi[d], | 325 | * space), we either just go straight there with rfi[d], |
| 319 | * or we jump to an interrupt handler with bctr if there | 326 | * or we jump to an interrupt handler if there is an |
| 320 | * is an interrupt to be handled first. In the latter | 327 | * interrupt to be handled first. In the latter case, |
| 321 | * case, the rfi[d] at the end of the interrupt handler | 328 | * the rfi[d] at the end of the interrupt handler will |
| 322 | * will get us back to where we want to continue. | 329 | * get us back to where we want to continue. |
| 323 | */ | 330 | */ |
| 324 | 331 | ||
| 325 | cmpwi r12, BOOK3S_INTERRUPT_EXTERNAL | ||
| 326 | beq 1f | ||
| 327 | cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER | ||
| 328 | beq 1f | ||
| 329 | cmpwi r12, BOOK3S_INTERRUPT_PERFMON | ||
| 330 | 1: mtctr r12 | ||
| 331 | |||
| 332 | /* Register usage at this point: | 332 | /* Register usage at this point: |
| 333 | * | 333 | * |
| 334 | * R1 = host R1 | 334 | * R1 = host R1 |
| 335 | * R2 = host R2 | 335 | * R2 = host R2 |
| 336 | * R10 = raw exit handler id | ||
| 336 | * R12 = exit handler id | 337 | * R12 = exit handler id |
| 337 | * R13 = shadow vcpu (32-bit) or PACA (64-bit) | 338 | * R13 = shadow vcpu (32-bit) or PACA (64-bit) |
| 338 | * SVCPU.* = guest * | 339 | * SVCPU.* = guest * |
| @@ -342,12 +343,25 @@ no_dcbz32_off: | |||
| 342 | PPC_LL r6, HSTATE_HOST_MSR(r13) | 343 | PPC_LL r6, HSTATE_HOST_MSR(r13) |
| 343 | PPC_LL r8, HSTATE_VMHANDLER(r13) | 344 | PPC_LL r8, HSTATE_VMHANDLER(r13) |
| 344 | 345 | ||
| 345 | /* Restore host msr -> SRR1 */ | 346 | #ifdef CONFIG_PPC64 |
| 347 | BEGIN_FTR_SECTION | ||
| 348 | beq cr1, 1f | ||
| 349 | mtspr SPRN_HSRR1, r6 | ||
| 350 | mtspr SPRN_HSRR0, r8 | ||
| 351 | END_FTR_SECTION_IFSET(CPU_FTR_HVMODE) | ||
| 352 | #endif | ||
| 353 | 1: /* Restore host msr -> SRR1 */ | ||
| 346 | mtsrr1 r6 | 354 | mtsrr1 r6 |
| 347 | /* Load highmem handler address */ | 355 | /* Load highmem handler address */ |
| 348 | mtsrr0 r8 | 356 | mtsrr0 r8 |
| 349 | 357 | ||
| 350 | /* RFI into the highmem handler, or jump to interrupt handler */ | 358 | /* RFI into the highmem handler, or jump to interrupt handler */ |
| 351 | beqctr | 359 | cmpwi r12, BOOK3S_INTERRUPT_EXTERNAL |
| 360 | beqa BOOK3S_INTERRUPT_EXTERNAL | ||
| 361 | cmpwi r12, BOOK3S_INTERRUPT_DECREMENTER | ||
| 362 | beqa BOOK3S_INTERRUPT_DECREMENTER | ||
| 363 | cmpwi r12, BOOK3S_INTERRUPT_PERFMON | ||
| 364 | beqa BOOK3S_INTERRUPT_PERFMON | ||
| 365 | |||
| 352 | RFI | 366 | RFI |
| 353 | kvmppc_handler_trampoline_exit_end: | 367 | kvmppc_handler_trampoline_exit_end: |
diff --git a/arch/tile/Kconfig b/arch/tile/Kconfig index 96033e2d6845..74239dd77e06 100644 --- a/arch/tile/Kconfig +++ b/arch/tile/Kconfig | |||
| @@ -11,6 +11,7 @@ config TILE | |||
| 11 | select GENERIC_IRQ_PROBE | 11 | select GENERIC_IRQ_PROBE |
| 12 | select GENERIC_PENDING_IRQ if SMP | 12 | select GENERIC_PENDING_IRQ if SMP |
| 13 | select GENERIC_IRQ_SHOW | 13 | select GENERIC_IRQ_SHOW |
| 14 | select HAVE_SYSCALL_WRAPPERS if TILEGX | ||
| 14 | select SYS_HYPERVISOR | 15 | select SYS_HYPERVISOR |
| 15 | select ARCH_HAVE_NMI_SAFE_CMPXCHG | 16 | select ARCH_HAVE_NMI_SAFE_CMPXCHG |
| 16 | 17 | ||
diff --git a/arch/tile/include/asm/thread_info.h b/arch/tile/include/asm/thread_info.h index bc4f562bd459..7594764d8a69 100644 --- a/arch/tile/include/asm/thread_info.h +++ b/arch/tile/include/asm/thread_info.h | |||
| @@ -100,9 +100,14 @@ extern void cpu_idle_on_new_stack(struct thread_info *old_ti, | |||
| 100 | 100 | ||
| 101 | #else /* __ASSEMBLY__ */ | 101 | #else /* __ASSEMBLY__ */ |
| 102 | 102 | ||
| 103 | /* how to get the thread information struct from ASM */ | 103 | /* |
| 104 | * How to get the thread information struct from assembly. | ||
| 105 | * Note that we use different macros since different architectures | ||
| 106 | * have different semantics in their "mm" instruction and we would | ||
| 107 | * like to guarantee that the macro expands to exactly one instruction. | ||
| 108 | */ | ||
| 104 | #ifdef __tilegx__ | 109 | #ifdef __tilegx__ |
| 105 | #define GET_THREAD_INFO(reg) move reg, sp; mm reg, zero, LOG2_THREAD_SIZE, 63 | 110 | #define EXTRACT_THREAD_INFO(reg) mm reg, zero, LOG2_THREAD_SIZE, 63 |
| 106 | #else | 111 | #else |
| 107 | #define GET_THREAD_INFO(reg) mm reg, sp, zero, LOG2_THREAD_SIZE, 31 | 112 | #define GET_THREAD_INFO(reg) mm reg, sp, zero, LOG2_THREAD_SIZE, 31 |
| 108 | #endif | 113 | #endif |
diff --git a/arch/tile/kernel/compat_signal.c b/arch/tile/kernel/compat_signal.c index 77763ccd5a7d..cdef6e5ec022 100644 --- a/arch/tile/kernel/compat_signal.c +++ b/arch/tile/kernel/compat_signal.c | |||
| @@ -403,19 +403,17 @@ int compat_setup_rt_frame(int sig, struct k_sigaction *ka, siginfo_t *info, | |||
| 403 | * Set up registers for signal handler. | 403 | * Set up registers for signal handler. |
| 404 | * Registers that we don't modify keep the value they had from | 404 | * Registers that we don't modify keep the value they had from |
| 405 | * user-space at the time we took the signal. | 405 | * user-space at the time we took the signal. |
| 406 | * We always pass siginfo and mcontext, regardless of SA_SIGINFO, | ||
| 407 | * since some things rely on this (e.g. glibc's debug/segfault.c). | ||
| 406 | */ | 408 | */ |
| 407 | regs->pc = ptr_to_compat_reg(ka->sa.sa_handler); | 409 | regs->pc = ptr_to_compat_reg(ka->sa.sa_handler); |
| 408 | regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */ | 410 | regs->ex1 = PL_ICS_EX1(USER_PL, 1); /* set crit sec in handler */ |
| 409 | regs->sp = ptr_to_compat_reg(frame); | 411 | regs->sp = ptr_to_compat_reg(frame); |
| 410 | regs->lr = restorer; | 412 | regs->lr = restorer; |
| 411 | regs->regs[0] = (unsigned long) usig; | 413 | regs->regs[0] = (unsigned long) usig; |
| 412 | 414 | regs->regs[1] = ptr_to_compat_reg(&frame->info); | |
| 413 | if (ka->sa.sa_flags & SA_SIGINFO) { | 415 | regs->regs[2] = ptr_to_compat_reg(&frame->uc); |
| 414 | /* Need extra arguments, so mark to restore caller-saves. */ | 416 | regs->flags |= PT_FLAGS_CALLER_SAVES; |
| 415 | regs->regs[1] = ptr_to_compat_reg(&frame->info); | ||
| 416 | regs->regs[2] = ptr_to_compat_reg(&frame->uc); | ||
| 417 | regs->flags |= PT_FLAGS_CALLER_SAVES; | ||
| 418 | } | ||
| 419 | 417 | ||
| 420 | /* | 418 | /* |
| 421 | * Notify any tracer that was single-stepping it. | 419 | * Notify any tracer that was single-stepping it. |
diff --git a/arch/tile/kernel/intvec_32.S b/arch/tile/kernel/intvec_32.S index 5d56a1ef5ba5..6943515100f8 100644 --- a/arch/tile/kernel/intvec_32.S +++ b/arch/tile/kernel/intvec_32.S | |||
| @@ -839,6 +839,18 @@ STD_ENTRY(interrupt_return) | |||
| 839 | FEEDBACK_REENTER(interrupt_return) | 839 | FEEDBACK_REENTER(interrupt_return) |
| 840 | 840 | ||
| 841 | /* | 841 | /* |
| 842 | * Use r33 to hold whether we have already loaded the callee-saves | ||
| 843 | * into ptregs. We don't want to do it twice in this loop, since | ||
| 844 | * then we'd clobber whatever changes are made by ptrace, etc. | ||
| 845 | * Get base of stack in r32. | ||
| 846 | */ | ||
| 847 | { | ||
| 848 | GET_THREAD_INFO(r32) | ||
| 849 | movei r33, 0 | ||
| 850 | } | ||
| 851 | |||
| 852 | .Lretry_work_pending: | ||
| 853 | /* | ||
| 842 | * Disable interrupts so as to make sure we don't | 854 | * Disable interrupts so as to make sure we don't |
| 843 | * miss an interrupt that sets any of the thread flags (like | 855 | * miss an interrupt that sets any of the thread flags (like |
| 844 | * need_resched or sigpending) between sampling and the iret. | 856 | * need_resched or sigpending) between sampling and the iret. |
| @@ -848,9 +860,6 @@ STD_ENTRY(interrupt_return) | |||
| 848 | IRQ_DISABLE(r20, r21) | 860 | IRQ_DISABLE(r20, r21) |
| 849 | TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ | 861 | TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ |
| 850 | 862 | ||
| 851 | /* Get base of stack in r32; note r30/31 are used as arguments here. */ | ||
| 852 | GET_THREAD_INFO(r32) | ||
| 853 | |||
| 854 | 863 | ||
| 855 | /* Check to see if there is any work to do before returning to user. */ | 864 | /* Check to see if there is any work to do before returning to user. */ |
| 856 | { | 865 | { |
| @@ -866,16 +875,18 @@ STD_ENTRY(interrupt_return) | |||
| 866 | 875 | ||
| 867 | /* | 876 | /* |
| 868 | * Make sure we have all the registers saved for signal | 877 | * Make sure we have all the registers saved for signal |
| 869 | * handling or single-step. Call out to C code to figure out | 878 | * handling, notify-resume, or single-step. Call out to C |
| 870 | * exactly what we need to do for each flag bit, then if | 879 | * code to figure out exactly what we need to do for each flag bit, |
| 871 | * necessary, reload the flags and recheck. | 880 | * then if necessary, reload the flags and recheck. |
| 872 | */ | 881 | */ |
| 873 | push_extra_callee_saves r0 | ||
| 874 | { | 882 | { |
| 875 | PTREGS_PTR(r0, PTREGS_OFFSET_BASE) | 883 | PTREGS_PTR(r0, PTREGS_OFFSET_BASE) |
| 876 | jal do_work_pending | 884 | bnz r33, 1f |
| 877 | } | 885 | } |
| 878 | bnz r0, .Lresume_userspace | 886 | push_extra_callee_saves r0 |
| 887 | movei r33, 1 | ||
| 888 | 1: jal do_work_pending | ||
| 889 | bnz r0, .Lretry_work_pending | ||
| 879 | 890 | ||
| 880 | /* | 891 | /* |
| 881 | * In the NMI case we | 892 | * In the NMI case we |
| @@ -1180,10 +1191,12 @@ handle_syscall: | |||
| 1180 | add r20, r20, tp | 1191 | add r20, r20, tp |
| 1181 | lw r21, r20 | 1192 | lw r21, r20 |
| 1182 | addi r21, r21, 1 | 1193 | addi r21, r21, 1 |
| 1183 | sw r20, r21 | 1194 | { |
| 1195 | sw r20, r21 | ||
| 1196 | GET_THREAD_INFO(r31) | ||
| 1197 | } | ||
| 1184 | 1198 | ||
| 1185 | /* Trace syscalls, if requested. */ | 1199 | /* Trace syscalls, if requested. */ |
| 1186 | GET_THREAD_INFO(r31) | ||
| 1187 | addi r31, r31, THREAD_INFO_FLAGS_OFFSET | 1200 | addi r31, r31, THREAD_INFO_FLAGS_OFFSET |
| 1188 | lw r30, r31 | 1201 | lw r30, r31 |
| 1189 | andi r30, r30, _TIF_SYSCALL_TRACE | 1202 | andi r30, r30, _TIF_SYSCALL_TRACE |
| @@ -1362,7 +1375,10 @@ handle_ill: | |||
| 1362 | 3: | 1375 | 3: |
| 1363 | /* set PC and continue */ | 1376 | /* set PC and continue */ |
| 1364 | lw r26, r24 | 1377 | lw r26, r24 |
| 1365 | sw r28, r26 | 1378 | { |
| 1379 | sw r28, r26 | ||
| 1380 | GET_THREAD_INFO(r0) | ||
| 1381 | } | ||
| 1366 | 1382 | ||
| 1367 | /* | 1383 | /* |
| 1368 | * Clear TIF_SINGLESTEP to prevent recursion if we execute an ill. | 1384 | * Clear TIF_SINGLESTEP to prevent recursion if we execute an ill. |
| @@ -1370,7 +1386,6 @@ handle_ill: | |||
| 1370 | * need to clear it here and can't really impose on all other arches. | 1386 | * need to clear it here and can't really impose on all other arches. |
| 1371 | * So what's another write between friends? | 1387 | * So what's another write between friends? |
| 1372 | */ | 1388 | */ |
| 1373 | GET_THREAD_INFO(r0) | ||
| 1374 | 1389 | ||
| 1375 | addi r1, r0, THREAD_INFO_FLAGS_OFFSET | 1390 | addi r1, r0, THREAD_INFO_FLAGS_OFFSET |
| 1376 | { | 1391 | { |
diff --git a/arch/tile/kernel/intvec_64.S b/arch/tile/kernel/intvec_64.S index 49d9d6621682..30ae76e50c44 100644 --- a/arch/tile/kernel/intvec_64.S +++ b/arch/tile/kernel/intvec_64.S | |||
| @@ -647,6 +647,20 @@ STD_ENTRY(interrupt_return) | |||
| 647 | FEEDBACK_REENTER(interrupt_return) | 647 | FEEDBACK_REENTER(interrupt_return) |
| 648 | 648 | ||
| 649 | /* | 649 | /* |
| 650 | * Use r33 to hold whether we have already loaded the callee-saves | ||
| 651 | * into ptregs. We don't want to do it twice in this loop, since | ||
| 652 | * then we'd clobber whatever changes are made by ptrace, etc. | ||
| 653 | */ | ||
| 654 | { | ||
| 655 | movei r33, 0 | ||
| 656 | move r32, sp | ||
| 657 | } | ||
| 658 | |||
| 659 | /* Get base of stack in r32. */ | ||
| 660 | EXTRACT_THREAD_INFO(r32) | ||
| 661 | |||
| 662 | .Lretry_work_pending: | ||
| 663 | /* | ||
| 650 | * Disable interrupts so as to make sure we don't | 664 | * Disable interrupts so as to make sure we don't |
| 651 | * miss an interrupt that sets any of the thread flags (like | 665 | * miss an interrupt that sets any of the thread flags (like |
| 652 | * need_resched or sigpending) between sampling and the iret. | 666 | * need_resched or sigpending) between sampling and the iret. |
| @@ -656,9 +670,6 @@ STD_ENTRY(interrupt_return) | |||
| 656 | IRQ_DISABLE(r20, r21) | 670 | IRQ_DISABLE(r20, r21) |
| 657 | TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ | 671 | TRACE_IRQS_OFF /* Note: clobbers registers r0-r29 */ |
| 658 | 672 | ||
| 659 | /* Get base of stack in r32; note r30/31 are used as arguments here. */ | ||
| 660 | GET_THREAD_INFO(r32) | ||
| 661 | |||
| 662 | 673 | ||
| 663 | /* Check to see if there is any work to do before returning to user. */ | 674 | /* Check to see if there is any work to do before returning to user. */ |
| 664 | { | 675 | { |
| @@ -674,16 +685,18 @@ STD_ENTRY(interrupt_return) | |||
| 674 | 685 | ||
| 675 | /* | 686 | /* |
| 676 | * Make sure we have all the registers saved for signal | 687 | * Make sure we have all the registers saved for signal |
| 677 | * handling or single-step. Call out to C code to figure out | 688 | * handling or notify-resume. Call out to C code to figure out |
| 678 | * exactly what we need to do for each flag bit, then if | 689 | * exactly what we need to do for each flag bit, then if |
| 679 | * necessary, reload the flags and recheck. | 690 | * necessary, reload the flags and recheck. |
| 680 | */ | 691 | */ |
| 681 | push_extra_callee_saves r0 | ||
| 682 | { | 692 | { |
| 683 | PTREGS_PTR(r0, PTREGS_OFFSET_BASE) | 693 | PTREGS_PTR(r0, PTREGS_OFFSET_BASE) |
| 684 | jal do_work_pending | 694 | bnez r33, 1f |
| 685 | } | 695 | } |
| 686 | bnez r0, .Lresume_userspace | 696 | push_extra_callee_saves r0 |
| 697 | movei r33, 1 | ||
| 698 | 1: jal do_work_pending | ||
| 699 | bnez r0, .Lretry_work_pending | ||
| 687 | 700 | ||
| 688 | /* | 701 | /* |
| 689 | * In the NMI case we | 702 | * In the NMI case we |
| @@ -968,11 +981,16 @@ handle_syscall: | |||
| 968 | shl16insli r20, r20, hw0(irq_stat + IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET) | 981 | shl16insli r20, r20, hw0(irq_stat + IRQ_CPUSTAT_SYSCALL_COUNT_OFFSET) |
| 969 | add r20, r20, tp | 982 | add r20, r20, tp |
| 970 | ld4s r21, r20 | 983 | ld4s r21, r20 |
| 971 | addi r21, r21, 1 | 984 | { |
| 972 | st4 r20, r21 | 985 | addi r21, r21, 1 |
| 986 | move r31, sp | ||
| 987 | } | ||
| 988 | { | ||
| 989 | st4 r20, r21 | ||
| 990 | EXTRACT_THREAD_INFO(r31) | ||
| 991 | } | ||
| 973 | 992 | ||
| 974 | /* Trace syscalls, if requested. */ | 993 | /* Trace syscalls, if requested. */ |
| 975 | GET_THREAD_INFO(r31) | ||
| 976 | addi r31, r31, THREAD_INFO_FLAGS_OFFSET | 994 | addi r31, r31, THREAD_INFO_FLAGS_OFFSET |
| 977 | ld r30, r31 | 995 | ld r30, r31 |
| 978 | andi r30, r30, _TIF_SYSCALL_TRACE | 996 | andi r30, r30, _TIF_SYSCALL_TRACE |
diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c index 2d5ef617bb39..54e6c64b85cc 100644 --- a/arch/tile/kernel/process.c +++ b/arch/tile/kernel/process.c | |||
| @@ -567,6 +567,10 @@ struct task_struct *__sched _switch_to(struct task_struct *prev, | |||
| 567 | */ | 567 | */ |
| 568 | int do_work_pending(struct pt_regs *regs, u32 thread_info_flags) | 568 | int do_work_pending(struct pt_regs *regs, u32 thread_info_flags) |
| 569 | { | 569 | { |
| 570 | /* If we enter in kernel mode, do nothing and exit the caller loop. */ | ||
| 571 | if (!user_mode(regs)) | ||
| 572 | return 0; | ||
| 573 | |||
| 570 | if (thread_info_flags & _TIF_NEED_RESCHED) { | 574 | if (thread_info_flags & _TIF_NEED_RESCHED) { |
| 571 | schedule(); | 575 | schedule(); |
| 572 | return 1; | 576 | return 1; |
| @@ -589,8 +593,7 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags) | |||
| 589 | return 1; | 593 | return 1; |
| 590 | } | 594 | } |
| 591 | if (thread_info_flags & _TIF_SINGLESTEP) { | 595 | if (thread_info_flags & _TIF_SINGLESTEP) { |
| 592 | if ((regs->ex1 & SPR_EX_CONTEXT_1_1__PL_MASK) == 0) | 596 | single_step_once(regs); |
| 593 | single_step_once(regs); | ||
| 594 | return 0; | 597 | return 0; |
| 595 | } | 598 | } |
| 596 | panic("work_pending: bad flags %#x\n", thread_info_flags); | 599 | panic("work_pending: bad flags %#x\n", thread_info_flags); |
diff --git a/arch/x86/include/asm/kvm_para.h b/arch/x86/include/asm/kvm_para.h index 734c3767cfac..183922e13de1 100644 --- a/arch/x86/include/asm/kvm_para.h +++ b/arch/x86/include/asm/kvm_para.h | |||
| @@ -170,6 +170,9 @@ static inline int kvm_para_available(void) | |||
| 170 | unsigned int eax, ebx, ecx, edx; | 170 | unsigned int eax, ebx, ecx, edx; |
| 171 | char signature[13]; | 171 | char signature[13]; |
| 172 | 172 | ||
| 173 | if (boot_cpu_data.cpuid_level < 0) | ||
| 174 | return 0; /* So we don't blow up on old processors */ | ||
| 175 | |||
| 173 | cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx); | 176 | cpuid(KVM_CPUID_SIGNATURE, &eax, &ebx, &ecx, &edx); |
| 174 | memcpy(signature + 0, &ebx, 4); | 177 | memcpy(signature + 0, &ebx, 4); |
| 175 | memcpy(signature + 4, &ecx, 4); | 178 | memcpy(signature + 4, &ecx, 4); |
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index a415b1f44365..7c439fe4941b 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
| @@ -593,7 +593,7 @@ void __init acpi_set_irq_model_ioapic(void) | |||
| 593 | #ifdef CONFIG_ACPI_HOTPLUG_CPU | 593 | #ifdef CONFIG_ACPI_HOTPLUG_CPU |
| 594 | #include <acpi/processor.h> | 594 | #include <acpi/processor.h> |
| 595 | 595 | ||
| 596 | static void __cpuinitdata acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) | 596 | static void __cpuinit acpi_map_cpu2node(acpi_handle handle, int cpu, int physid) |
| 597 | { | 597 | { |
| 598 | #ifdef CONFIG_ACPI_NUMA | 598 | #ifdef CONFIG_ACPI_NUMA |
| 599 | int nid; | 599 | int nid; |
diff --git a/arch/x86/kernel/cpu/mcheck/mce.c b/arch/x86/kernel/cpu/mcheck/mce.c index d086a09c087d..11c9166c3337 100644 --- a/arch/x86/kernel/cpu/mcheck/mce.c +++ b/arch/x86/kernel/cpu/mcheck/mce.c | |||
| @@ -945,9 +945,10 @@ struct mce_info { | |||
| 945 | atomic_t inuse; | 945 | atomic_t inuse; |
| 946 | struct task_struct *t; | 946 | struct task_struct *t; |
| 947 | __u64 paddr; | 947 | __u64 paddr; |
| 948 | int restartable; | ||
| 948 | } mce_info[MCE_INFO_MAX]; | 949 | } mce_info[MCE_INFO_MAX]; |
| 949 | 950 | ||
| 950 | static void mce_save_info(__u64 addr) | 951 | static void mce_save_info(__u64 addr, int c) |
| 951 | { | 952 | { |
| 952 | struct mce_info *mi; | 953 | struct mce_info *mi; |
| 953 | 954 | ||
| @@ -955,6 +956,7 @@ static void mce_save_info(__u64 addr) | |||
| 955 | if (atomic_cmpxchg(&mi->inuse, 0, 1) == 0) { | 956 | if (atomic_cmpxchg(&mi->inuse, 0, 1) == 0) { |
| 956 | mi->t = current; | 957 | mi->t = current; |
| 957 | mi->paddr = addr; | 958 | mi->paddr = addr; |
| 959 | mi->restartable = c; | ||
| 958 | return; | 960 | return; |
| 959 | } | 961 | } |
| 960 | } | 962 | } |
| @@ -1130,7 +1132,7 @@ void do_machine_check(struct pt_regs *regs, long error_code) | |||
| 1130 | mce_panic("Fatal machine check on current CPU", &m, msg); | 1132 | mce_panic("Fatal machine check on current CPU", &m, msg); |
| 1131 | if (worst == MCE_AR_SEVERITY) { | 1133 | if (worst == MCE_AR_SEVERITY) { |
| 1132 | /* schedule action before return to userland */ | 1134 | /* schedule action before return to userland */ |
| 1133 | mce_save_info(m.addr); | 1135 | mce_save_info(m.addr, m.mcgstatus & MCG_STATUS_RIPV); |
| 1134 | set_thread_flag(TIF_MCE_NOTIFY); | 1136 | set_thread_flag(TIF_MCE_NOTIFY); |
| 1135 | } else if (kill_it) { | 1137 | } else if (kill_it) { |
| 1136 | force_sig(SIGBUS, current); | 1138 | force_sig(SIGBUS, current); |
| @@ -1179,7 +1181,13 @@ void mce_notify_process(void) | |||
| 1179 | 1181 | ||
| 1180 | pr_err("Uncorrected hardware memory error in user-access at %llx", | 1182 | pr_err("Uncorrected hardware memory error in user-access at %llx", |
| 1181 | mi->paddr); | 1183 | mi->paddr); |
| 1182 | if (memory_failure(pfn, MCE_VECTOR, MF_ACTION_REQUIRED) < 0) { | 1184 | /* |
| 1185 | * We must call memory_failure() here even if the current process is | ||
| 1186 | * doomed. We still need to mark the page as poisoned and alert any | ||
| 1187 | * other users of the page. | ||
| 1188 | */ | ||
| 1189 | if (memory_failure(pfn, MCE_VECTOR, MF_ACTION_REQUIRED) < 0 || | ||
| 1190 | mi->restartable == 0) { | ||
| 1183 | pr_err("Memory error not recovered"); | 1191 | pr_err("Memory error not recovered"); |
| 1184 | force_sig(SIGBUS, current); | 1192 | force_sig(SIGBUS, current); |
| 1185 | } | 1193 | } |
diff --git a/arch/x86/kernel/microcode_intel.c b/arch/x86/kernel/microcode_intel.c index 3ca42d0e43a2..0327e2b3c408 100644 --- a/arch/x86/kernel/microcode_intel.c +++ b/arch/x86/kernel/microcode_intel.c | |||
| @@ -147,12 +147,6 @@ static int collect_cpu_info(int cpu_num, struct cpu_signature *csig) | |||
| 147 | 147 | ||
| 148 | memset(csig, 0, sizeof(*csig)); | 148 | memset(csig, 0, sizeof(*csig)); |
| 149 | 149 | ||
| 150 | if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 || | ||
| 151 | cpu_has(c, X86_FEATURE_IA64)) { | ||
| 152 | pr_err("CPU%d not a capable Intel processor\n", cpu_num); | ||
| 153 | return -1; | ||
| 154 | } | ||
| 155 | |||
| 156 | csig->sig = cpuid_eax(0x00000001); | 150 | csig->sig = cpuid_eax(0x00000001); |
| 157 | 151 | ||
| 158 | if ((c->x86_model >= 5) || (c->x86 > 6)) { | 152 | if ((c->x86_model >= 5) || (c->x86 > 6)) { |
| @@ -463,6 +457,14 @@ static struct microcode_ops microcode_intel_ops = { | |||
| 463 | 457 | ||
| 464 | struct microcode_ops * __init init_intel_microcode(void) | 458 | struct microcode_ops * __init init_intel_microcode(void) |
| 465 | { | 459 | { |
| 460 | struct cpuinfo_x86 *c = &cpu_data(0); | ||
| 461 | |||
| 462 | if (c->x86_vendor != X86_VENDOR_INTEL || c->x86 < 6 || | ||
| 463 | cpu_has(c, X86_FEATURE_IA64)) { | ||
| 464 | pr_err("Intel CPU family 0x%x not supported\n", c->x86); | ||
| 465 | return NULL; | ||
| 466 | } | ||
| 467 | |||
| 466 | return µcode_intel_ops; | 468 | return µcode_intel_ops; |
| 467 | } | 469 | } |
| 468 | 470 | ||
diff --git a/block/genhd.c b/block/genhd.c index df9816ede75b..9cf5583c90ff 100644 --- a/block/genhd.c +++ b/block/genhd.c | |||
| @@ -743,7 +743,7 @@ void __init printk_all_partitions(void) | |||
| 743 | struct hd_struct *part; | 743 | struct hd_struct *part; |
| 744 | char name_buf[BDEVNAME_SIZE]; | 744 | char name_buf[BDEVNAME_SIZE]; |
| 745 | char devt_buf[BDEVT_SIZE]; | 745 | char devt_buf[BDEVT_SIZE]; |
| 746 | u8 uuid[PARTITION_META_INFO_UUIDLTH * 2 + 1]; | 746 | char uuid_buf[PARTITION_META_INFO_UUIDLTH * 2 + 5]; |
| 747 | 747 | ||
| 748 | /* | 748 | /* |
| 749 | * Don't show empty devices or things that have been | 749 | * Don't show empty devices or things that have been |
| @@ -762,14 +762,16 @@ void __init printk_all_partitions(void) | |||
| 762 | while ((part = disk_part_iter_next(&piter))) { | 762 | while ((part = disk_part_iter_next(&piter))) { |
| 763 | bool is_part0 = part == &disk->part0; | 763 | bool is_part0 = part == &disk->part0; |
| 764 | 764 | ||
| 765 | uuid[0] = 0; | 765 | uuid_buf[0] = '\0'; |
| 766 | if (part->info) | 766 | if (part->info) |
| 767 | part_unpack_uuid(part->info->uuid, uuid); | 767 | snprintf(uuid_buf, sizeof(uuid_buf), "%pU", |
| 768 | part->info->uuid); | ||
| 768 | 769 | ||
| 769 | printk("%s%s %10llu %s %s", is_part0 ? "" : " ", | 770 | printk("%s%s %10llu %s %s", is_part0 ? "" : " ", |
| 770 | bdevt_str(part_devt(part), devt_buf), | 771 | bdevt_str(part_devt(part), devt_buf), |
| 771 | (unsigned long long)part->nr_sects >> 1, | 772 | (unsigned long long)part->nr_sects >> 1, |
| 772 | disk_name(disk, part->partno, name_buf), uuid); | 773 | disk_name(disk, part->partno, name_buf), |
| 774 | uuid_buf); | ||
| 773 | if (is_part0) { | 775 | if (is_part0) { |
| 774 | if (disk->driverfs_dev != NULL && | 776 | if (disk->driverfs_dev != NULL && |
| 775 | disk->driverfs_dev->driver != NULL) | 777 | disk->driverfs_dev->driver != NULL) |
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c index 3263b68cdfa3..3188da3df8da 100644 --- a/drivers/acpi/bus.c +++ b/drivers/acpi/bus.c | |||
| @@ -250,6 +250,10 @@ static int __acpi_bus_set_power(struct acpi_device *device, int state) | |||
| 250 | return -ENODEV; | 250 | return -ENODEV; |
| 251 | } | 251 | } |
| 252 | 252 | ||
| 253 | /* For D3cold we should execute _PS3, not _PS4. */ | ||
| 254 | if (state == ACPI_STATE_D3_COLD) | ||
| 255 | object_name[3] = '3'; | ||
| 256 | |||
| 253 | /* | 257 | /* |
| 254 | * Transition Power | 258 | * Transition Power |
| 255 | * ---------------- | 259 | * ---------------- |
diff --git a/drivers/acpi/power.c b/drivers/acpi/power.c index 330bb4d75852..0500f719f63e 100644 --- a/drivers/acpi/power.c +++ b/drivers/acpi/power.c | |||
| @@ -660,7 +660,7 @@ int acpi_power_on_resources(struct acpi_device *device, int state) | |||
| 660 | 660 | ||
| 661 | int acpi_power_transition(struct acpi_device *device, int state) | 661 | int acpi_power_transition(struct acpi_device *device, int state) |
| 662 | { | 662 | { |
| 663 | int result; | 663 | int result = 0; |
| 664 | 664 | ||
| 665 | if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3_COLD)) | 665 | if (!device || (state < ACPI_STATE_D0) || (state > ACPI_STATE_D3_COLD)) |
| 666 | return -EINVAL; | 666 | return -EINVAL; |
| @@ -679,8 +679,11 @@ int acpi_power_transition(struct acpi_device *device, int state) | |||
| 679 | * (e.g. so the device doesn't lose power while transitioning). Then, | 679 | * (e.g. so the device doesn't lose power while transitioning). Then, |
| 680 | * we dereference all power resources used in the current list. | 680 | * we dereference all power resources used in the current list. |
| 681 | */ | 681 | */ |
| 682 | result = acpi_power_on_list(&device->power.states[state].resources); | 682 | if (state < ACPI_STATE_D3_COLD) |
| 683 | if (!result) | 683 | result = acpi_power_on_list( |
| 684 | &device->power.states[state].resources); | ||
| 685 | |||
| 686 | if (!result && device->power.state < ACPI_STATE_D3_COLD) | ||
| 684 | acpi_power_off_list( | 687 | acpi_power_off_list( |
| 685 | &device->power.states[device->power.state].resources); | 688 | &device->power.states[device->power.state].resources); |
| 686 | 689 | ||
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 7417267e88fa..85cbfdccc97c 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c | |||
| @@ -908,6 +908,10 @@ static int acpi_bus_get_power_flags(struct acpi_device *device) | |||
| 908 | device->power.states[ACPI_STATE_D3].flags.valid = 1; | 908 | device->power.states[ACPI_STATE_D3].flags.valid = 1; |
| 909 | device->power.states[ACPI_STATE_D3].power = 0; | 909 | device->power.states[ACPI_STATE_D3].power = 0; |
| 910 | 910 | ||
| 911 | /* Set D3cold's explicit_set flag if _PS3 exists. */ | ||
| 912 | if (device->power.states[ACPI_STATE_D3_HOT].flags.explicit_set) | ||
| 913 | device->power.states[ACPI_STATE_D3_COLD].flags.explicit_set = 1; | ||
| 914 | |||
| 911 | acpi_bus_init_power(device); | 915 | acpi_bus_init_power(device); |
| 912 | 916 | ||
| 913 | return 0; | 917 | return 0; |
diff --git a/drivers/block/DAC960.c b/drivers/block/DAC960.c index 8db9089127c5..9a13e889837e 100644 --- a/drivers/block/DAC960.c +++ b/drivers/block/DAC960.c | |||
| @@ -6580,24 +6580,21 @@ static const struct file_operations dac960_user_command_proc_fops = { | |||
| 6580 | 6580 | ||
| 6581 | static void DAC960_CreateProcEntries(DAC960_Controller_T *Controller) | 6581 | static void DAC960_CreateProcEntries(DAC960_Controller_T *Controller) |
| 6582 | { | 6582 | { |
| 6583 | struct proc_dir_entry *StatusProcEntry; | ||
| 6584 | struct proc_dir_entry *ControllerProcEntry; | 6583 | struct proc_dir_entry *ControllerProcEntry; |
| 6585 | struct proc_dir_entry *UserCommandProcEntry; | ||
| 6586 | 6584 | ||
| 6587 | if (DAC960_ProcDirectoryEntry == NULL) { | 6585 | if (DAC960_ProcDirectoryEntry == NULL) { |
| 6588 | DAC960_ProcDirectoryEntry = proc_mkdir("rd", NULL); | 6586 | DAC960_ProcDirectoryEntry = proc_mkdir("rd", NULL); |
| 6589 | StatusProcEntry = proc_create("status", 0, | 6587 | proc_create("status", 0, DAC960_ProcDirectoryEntry, |
| 6590 | DAC960_ProcDirectoryEntry, | 6588 | &dac960_proc_fops); |
| 6591 | &dac960_proc_fops); | ||
| 6592 | } | 6589 | } |
| 6593 | 6590 | ||
| 6594 | sprintf(Controller->ControllerName, "c%d", Controller->ControllerNumber); | 6591 | sprintf(Controller->ControllerName, "c%d", Controller->ControllerNumber); |
| 6595 | ControllerProcEntry = proc_mkdir(Controller->ControllerName, | 6592 | ControllerProcEntry = proc_mkdir(Controller->ControllerName, |
| 6596 | DAC960_ProcDirectoryEntry); | 6593 | DAC960_ProcDirectoryEntry); |
| 6597 | proc_create_data("initial_status", 0, ControllerProcEntry, &dac960_initial_status_proc_fops, Controller); | 6594 | proc_create_data("initial_status", 0, ControllerProcEntry, &dac960_initial_status_proc_fops, Controller); |
| 6598 | proc_create_data("current_status", 0, ControllerProcEntry, &dac960_current_status_proc_fops, Controller); | 6595 | proc_create_data("current_status", 0, ControllerProcEntry, &dac960_current_status_proc_fops, Controller); |
| 6599 | UserCommandProcEntry = proc_create_data("user_command", S_IWUSR | S_IRUSR, ControllerProcEntry, &dac960_user_command_proc_fops, Controller); | 6596 | proc_create_data("user_command", S_IWUSR | S_IRUSR, ControllerProcEntry, &dac960_user_command_proc_fops, Controller); |
| 6600 | Controller->ControllerProcEntry = ControllerProcEntry; | 6597 | Controller->ControllerProcEntry = ControllerProcEntry; |
| 6601 | } | 6598 | } |
| 6602 | 6599 | ||
| 6603 | 6600 | ||
diff --git a/drivers/block/mtip32xx/mtip32xx.c b/drivers/block/mtip32xx/mtip32xx.c index 00f9fc992090..304000c3d433 100644 --- a/drivers/block/mtip32xx/mtip32xx.c +++ b/drivers/block/mtip32xx/mtip32xx.c | |||
| @@ -2510,8 +2510,10 @@ static struct scatterlist *mtip_hw_get_scatterlist(struct driver_data *dd, | |||
| 2510 | up(&dd->port->cmd_slot); | 2510 | up(&dd->port->cmd_slot); |
| 2511 | return NULL; | 2511 | return NULL; |
| 2512 | } | 2512 | } |
| 2513 | if (unlikely(*tag < 0)) | 2513 | if (unlikely(*tag < 0)) { |
| 2514 | up(&dd->port->cmd_slot); | ||
| 2514 | return NULL; | 2515 | return NULL; |
| 2516 | } | ||
| 2515 | 2517 | ||
| 2516 | return dd->port->commands[*tag].sg; | 2518 | return dd->port->commands[*tag].sg; |
| 2517 | } | 2519 | } |
diff --git a/drivers/char/virtio_console.c b/drivers/char/virtio_console.c index ddf86b6500b7..cdf2f5451c76 100644 --- a/drivers/char/virtio_console.c +++ b/drivers/char/virtio_console.c | |||
| @@ -1895,6 +1895,13 @@ static int virtcons_restore(struct virtio_device *vdev) | |||
| 1895 | 1895 | ||
| 1896 | /* Get port open/close status on the host */ | 1896 | /* Get port open/close status on the host */ |
| 1897 | send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 1); | 1897 | send_control_msg(port, VIRTIO_CONSOLE_PORT_READY, 1); |
| 1898 | |||
| 1899 | /* | ||
| 1900 | * If a port was open at the time of suspending, we | ||
| 1901 | * have to let the host know that it's still open. | ||
| 1902 | */ | ||
| 1903 | if (port->guest_connected) | ||
| 1904 | send_control_msg(port, VIRTIO_CONSOLE_PORT_OPEN, 1); | ||
| 1898 | } | 1905 | } |
| 1899 | return 0; | 1906 | return 0; |
| 1900 | } | 1907 | } |
diff --git a/drivers/crypto/Kconfig b/drivers/crypto/Kconfig index ab9abb46d01a..dd414d9350ef 100644 --- a/drivers/crypto/Kconfig +++ b/drivers/crypto/Kconfig | |||
| @@ -164,6 +164,7 @@ config CRYPTO_DEV_MV_CESA | |||
| 164 | select CRYPTO_ALGAPI | 164 | select CRYPTO_ALGAPI |
| 165 | select CRYPTO_AES | 165 | select CRYPTO_AES |
| 166 | select CRYPTO_BLKCIPHER2 | 166 | select CRYPTO_BLKCIPHER2 |
| 167 | select CRYPTO_HASH | ||
| 167 | help | 168 | help |
| 168 | This driver allows you to utilize the Cryptographic Engines and | 169 | This driver allows you to utilize the Cryptographic Engines and |
| 169 | Security Accelerator (CESA) which can be found on the Marvell Orion | 170 | Security Accelerator (CESA) which can be found on the Marvell Orion |
diff --git a/drivers/dma/at_hdmac.c b/drivers/dma/at_hdmac.c index 445fdf811695..bf0d7e4e345b 100644 --- a/drivers/dma/at_hdmac.c +++ b/drivers/dma/at_hdmac.c | |||
| @@ -245,7 +245,9 @@ atc_chain_complete(struct at_dma_chan *atchan, struct at_desc *desc) | |||
| 245 | dev_vdbg(chan2dev(&atchan->chan_common), | 245 | dev_vdbg(chan2dev(&atchan->chan_common), |
| 246 | "descriptor %u complete\n", txd->cookie); | 246 | "descriptor %u complete\n", txd->cookie); |
| 247 | 247 | ||
| 248 | dma_cookie_complete(txd); | 248 | /* mark the descriptor as complete for non cyclic cases only */ |
| 249 | if (!atc_chan_is_cyclic(atchan)) | ||
| 250 | dma_cookie_complete(txd); | ||
| 249 | 251 | ||
| 250 | /* move children to free_list */ | 252 | /* move children to free_list */ |
| 251 | list_splice_init(&desc->tx_list, &atchan->free_list); | 253 | list_splice_init(&desc->tx_list, &atchan->free_list); |
diff --git a/drivers/dma/ep93xx_dma.c b/drivers/dma/ep93xx_dma.c index e6f133b78dc2..f6e9b572b998 100644 --- a/drivers/dma/ep93xx_dma.c +++ b/drivers/dma/ep93xx_dma.c | |||
| @@ -703,7 +703,9 @@ static void ep93xx_dma_tasklet(unsigned long data) | |||
| 703 | desc = ep93xx_dma_get_active(edmac); | 703 | desc = ep93xx_dma_get_active(edmac); |
| 704 | if (desc) { | 704 | if (desc) { |
| 705 | if (desc->complete) { | 705 | if (desc->complete) { |
| 706 | dma_cookie_complete(&desc->txd); | 706 | /* mark descriptor complete for non cyclic case only */ |
| 707 | if (!test_bit(EP93XX_DMA_IS_CYCLIC, &edmac->flags)) | ||
| 708 | dma_cookie_complete(&desc->txd); | ||
| 707 | list_splice_init(&edmac->active, &list); | 709 | list_splice_init(&edmac->active, &list); |
| 708 | } | 710 | } |
| 709 | callback = desc->txd.callback; | 711 | callback = desc->txd.callback; |
diff --git a/drivers/dma/pl330.c b/drivers/dma/pl330.c index 2ee6e23930ad..fa3fb21e60be 100644 --- a/drivers/dma/pl330.c +++ b/drivers/dma/pl330.c | |||
| @@ -2322,7 +2322,8 @@ static void pl330_tasklet(unsigned long data) | |||
| 2322 | /* Pick up ripe tomatoes */ | 2322 | /* Pick up ripe tomatoes */ |
| 2323 | list_for_each_entry_safe(desc, _dt, &pch->work_list, node) | 2323 | list_for_each_entry_safe(desc, _dt, &pch->work_list, node) |
| 2324 | if (desc->status == DONE) { | 2324 | if (desc->status == DONE) { |
| 2325 | dma_cookie_complete(&desc->txd); | 2325 | if (pch->cyclic) |
| 2326 | dma_cookie_complete(&desc->txd); | ||
| 2326 | list_move_tail(&desc->node, &list); | 2327 | list_move_tail(&desc->node, &list); |
| 2327 | } | 2328 | } |
| 2328 | 2329 | ||
diff --git a/drivers/md/dm-thin.c b/drivers/md/dm-thin.c index 2fd87b544a93..eb3d138ff55a 100644 --- a/drivers/md/dm-thin.c +++ b/drivers/md/dm-thin.c | |||
| @@ -1632,6 +1632,21 @@ static int bind_control_target(struct pool *pool, struct dm_target *ti) | |||
| 1632 | pool->low_water_blocks = pt->low_water_blocks; | 1632 | pool->low_water_blocks = pt->low_water_blocks; |
| 1633 | pool->pf = pt->pf; | 1633 | pool->pf = pt->pf; |
| 1634 | 1634 | ||
| 1635 | /* | ||
| 1636 | * If discard_passdown was enabled verify that the data device | ||
| 1637 | * supports discards. Disable discard_passdown if not; otherwise | ||
| 1638 | * -EOPNOTSUPP will be returned. | ||
| 1639 | */ | ||
| 1640 | if (pt->pf.discard_passdown) { | ||
| 1641 | struct request_queue *q = bdev_get_queue(pt->data_dev->bdev); | ||
| 1642 | if (!q || !blk_queue_discard(q)) { | ||
| 1643 | char buf[BDEVNAME_SIZE]; | ||
| 1644 | DMWARN("Discard unsupported by data device (%s): Disabling discard passdown.", | ||
| 1645 | bdevname(pt->data_dev->bdev, buf)); | ||
| 1646 | pool->pf.discard_passdown = 0; | ||
| 1647 | } | ||
| 1648 | } | ||
| 1649 | |||
| 1635 | return 0; | 1650 | return 0; |
| 1636 | } | 1651 | } |
| 1637 | 1652 | ||
| @@ -1988,19 +2003,6 @@ static int pool_ctr(struct dm_target *ti, unsigned argc, char **argv) | |||
| 1988 | goto out_flags_changed; | 2003 | goto out_flags_changed; |
| 1989 | } | 2004 | } |
| 1990 | 2005 | ||
| 1991 | /* | ||
| 1992 | * If discard_passdown was enabled verify that the data device | ||
| 1993 | * supports discards. Disable discard_passdown if not; otherwise | ||
| 1994 | * -EOPNOTSUPP will be returned. | ||
| 1995 | */ | ||
| 1996 | if (pf.discard_passdown) { | ||
| 1997 | struct request_queue *q = bdev_get_queue(data_dev->bdev); | ||
| 1998 | if (!q || !blk_queue_discard(q)) { | ||
| 1999 | DMWARN("Discard unsupported by data device: Disabling discard passdown."); | ||
| 2000 | pf.discard_passdown = 0; | ||
| 2001 | } | ||
| 2002 | } | ||
| 2003 | |||
| 2004 | pt->pool = pool; | 2006 | pt->pool = pool; |
| 2005 | pt->ti = ti; | 2007 | pt->ti = ti; |
| 2006 | pt->metadata_dev = metadata_dev; | 2008 | pt->metadata_dev = metadata_dev; |
| @@ -2385,7 +2387,7 @@ static int pool_status(struct dm_target *ti, status_type_t type, | |||
| 2385 | (unsigned long long)pt->low_water_blocks); | 2387 | (unsigned long long)pt->low_water_blocks); |
| 2386 | 2388 | ||
| 2387 | count = !pool->pf.zero_new_blocks + !pool->pf.discard_enabled + | 2389 | count = !pool->pf.zero_new_blocks + !pool->pf.discard_enabled + |
| 2388 | !pool->pf.discard_passdown; | 2390 | !pt->pf.discard_passdown; |
| 2389 | DMEMIT("%u ", count); | 2391 | DMEMIT("%u ", count); |
| 2390 | 2392 | ||
| 2391 | if (!pool->pf.zero_new_blocks) | 2393 | if (!pool->pf.zero_new_blocks) |
| @@ -2394,7 +2396,7 @@ static int pool_status(struct dm_target *ti, status_type_t type, | |||
| 2394 | if (!pool->pf.discard_enabled) | 2396 | if (!pool->pf.discard_enabled) |
| 2395 | DMEMIT("ignore_discard "); | 2397 | DMEMIT("ignore_discard "); |
| 2396 | 2398 | ||
| 2397 | if (!pool->pf.discard_passdown) | 2399 | if (!pt->pf.discard_passdown) |
| 2398 | DMEMIT("no_discard_passdown "); | 2400 | DMEMIT("no_discard_passdown "); |
| 2399 | 2401 | ||
| 2400 | break; | 2402 | break; |
diff --git a/drivers/md/md.c b/drivers/md/md.c index 477eb2e180c0..01233d855eb2 100644 --- a/drivers/md/md.c +++ b/drivers/md/md.c | |||
| @@ -391,6 +391,8 @@ void mddev_suspend(struct mddev *mddev) | |||
| 391 | synchronize_rcu(); | 391 | synchronize_rcu(); |
| 392 | wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0); | 392 | wait_event(mddev->sb_wait, atomic_read(&mddev->active_io) == 0); |
| 393 | mddev->pers->quiesce(mddev, 1); | 393 | mddev->pers->quiesce(mddev, 1); |
| 394 | |||
| 395 | del_timer_sync(&mddev->safemode_timer); | ||
| 394 | } | 396 | } |
| 395 | EXPORT_SYMBOL_GPL(mddev_suspend); | 397 | EXPORT_SYMBOL_GPL(mddev_suspend); |
| 396 | 398 | ||
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c index c8dbb84d5357..3f91c2e1dfe7 100644 --- a/drivers/md/raid10.c +++ b/drivers/md/raid10.c | |||
| @@ -3164,12 +3164,40 @@ raid10_size(struct mddev *mddev, sector_t sectors, int raid_disks) | |||
| 3164 | return size << conf->chunk_shift; | 3164 | return size << conf->chunk_shift; |
| 3165 | } | 3165 | } |
| 3166 | 3166 | ||
| 3167 | static void calc_sectors(struct r10conf *conf, sector_t size) | ||
| 3168 | { | ||
| 3169 | /* Calculate the number of sectors-per-device that will | ||
| 3170 | * actually be used, and set conf->dev_sectors and | ||
| 3171 | * conf->stride | ||
| 3172 | */ | ||
| 3173 | |||
| 3174 | size = size >> conf->chunk_shift; | ||
| 3175 | sector_div(size, conf->far_copies); | ||
| 3176 | size = size * conf->raid_disks; | ||
| 3177 | sector_div(size, conf->near_copies); | ||
| 3178 | /* 'size' is now the number of chunks in the array */ | ||
| 3179 | /* calculate "used chunks per device" */ | ||
| 3180 | size = size * conf->copies; | ||
| 3181 | |||
| 3182 | /* We need to round up when dividing by raid_disks to | ||
| 3183 | * get the stride size. | ||
| 3184 | */ | ||
| 3185 | size = DIV_ROUND_UP_SECTOR_T(size, conf->raid_disks); | ||
| 3186 | |||
| 3187 | conf->dev_sectors = size << conf->chunk_shift; | ||
| 3188 | |||
| 3189 | if (conf->far_offset) | ||
| 3190 | conf->stride = 1 << conf->chunk_shift; | ||
| 3191 | else { | ||
| 3192 | sector_div(size, conf->far_copies); | ||
| 3193 | conf->stride = size << conf->chunk_shift; | ||
| 3194 | } | ||
| 3195 | } | ||
| 3167 | 3196 | ||
| 3168 | static struct r10conf *setup_conf(struct mddev *mddev) | 3197 | static struct r10conf *setup_conf(struct mddev *mddev) |
| 3169 | { | 3198 | { |
| 3170 | struct r10conf *conf = NULL; | 3199 | struct r10conf *conf = NULL; |
| 3171 | int nc, fc, fo; | 3200 | int nc, fc, fo; |
| 3172 | sector_t stride, size; | ||
| 3173 | int err = -EINVAL; | 3201 | int err = -EINVAL; |
| 3174 | 3202 | ||
| 3175 | if (mddev->new_chunk_sectors < (PAGE_SIZE >> 9) || | 3203 | if (mddev->new_chunk_sectors < (PAGE_SIZE >> 9) || |
| @@ -3219,28 +3247,7 @@ static struct r10conf *setup_conf(struct mddev *mddev) | |||
| 3219 | if (!conf->r10bio_pool) | 3247 | if (!conf->r10bio_pool) |
| 3220 | goto out; | 3248 | goto out; |
| 3221 | 3249 | ||
| 3222 | size = mddev->dev_sectors >> conf->chunk_shift; | 3250 | calc_sectors(conf, mddev->dev_sectors); |
| 3223 | sector_div(size, fc); | ||
| 3224 | size = size * conf->raid_disks; | ||
| 3225 | sector_div(size, nc); | ||
| 3226 | /* 'size' is now the number of chunks in the array */ | ||
| 3227 | /* calculate "used chunks per device" in 'stride' */ | ||
| 3228 | stride = size * conf->copies; | ||
| 3229 | |||
| 3230 | /* We need to round up when dividing by raid_disks to | ||
| 3231 | * get the stride size. | ||
| 3232 | */ | ||
| 3233 | stride += conf->raid_disks - 1; | ||
| 3234 | sector_div(stride, conf->raid_disks); | ||
| 3235 | |||
| 3236 | conf->dev_sectors = stride << conf->chunk_shift; | ||
| 3237 | |||
| 3238 | if (fo) | ||
| 3239 | stride = 1; | ||
| 3240 | else | ||
| 3241 | sector_div(stride, fc); | ||
| 3242 | conf->stride = stride << conf->chunk_shift; | ||
| 3243 | |||
| 3244 | 3251 | ||
| 3245 | spin_lock_init(&conf->device_lock); | 3252 | spin_lock_init(&conf->device_lock); |
| 3246 | INIT_LIST_HEAD(&conf->retry_list); | 3253 | INIT_LIST_HEAD(&conf->retry_list); |
| @@ -3468,7 +3475,8 @@ static int raid10_resize(struct mddev *mddev, sector_t sectors) | |||
| 3468 | mddev->recovery_cp = oldsize; | 3475 | mddev->recovery_cp = oldsize; |
| 3469 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); | 3476 | set_bit(MD_RECOVERY_NEEDED, &mddev->recovery); |
| 3470 | } | 3477 | } |
| 3471 | mddev->dev_sectors = sectors; | 3478 | calc_sectors(conf, sectors); |
| 3479 | mddev->dev_sectors = conf->dev_sectors; | ||
| 3472 | mddev->resync_max_sectors = size; | 3480 | mddev->resync_max_sectors = size; |
| 3473 | return 0; | 3481 | return 0; |
| 3474 | } | 3482 | } |
diff --git a/drivers/media/dvb/dvb-core/dvb_frontend.c b/drivers/media/dvb/dvb-core/dvb_frontend.c index 0f64d7182657..cb888d835a89 100644 --- a/drivers/media/dvb/dvb-core/dvb_frontend.c +++ b/drivers/media/dvb/dvb-core/dvb_frontend.c | |||
| @@ -1921,6 +1921,10 @@ static int dtv_set_frontend(struct dvb_frontend *fe) | |||
| 1921 | } else { | 1921 | } else { |
| 1922 | /* default values */ | 1922 | /* default values */ |
| 1923 | switch (c->delivery_system) { | 1923 | switch (c->delivery_system) { |
| 1924 | case SYS_DVBS: | ||
| 1925 | case SYS_DVBS2: | ||
| 1926 | case SYS_ISDBS: | ||
| 1927 | case SYS_TURBO: | ||
| 1924 | case SYS_DVBC_ANNEX_A: | 1928 | case SYS_DVBC_ANNEX_A: |
| 1925 | case SYS_DVBC_ANNEX_C: | 1929 | case SYS_DVBC_ANNEX_C: |
| 1926 | fepriv->min_delay = HZ / 20; | 1930 | fepriv->min_delay = HZ / 20; |
diff --git a/drivers/media/rc/ene_ir.c b/drivers/media/rc/ene_ir.c index 860c112e0fd2..bef5296173c9 100644 --- a/drivers/media/rc/ene_ir.c +++ b/drivers/media/rc/ene_ir.c | |||
| @@ -1018,22 +1018,6 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
| 1018 | 1018 | ||
| 1019 | spin_lock_init(&dev->hw_lock); | 1019 | spin_lock_init(&dev->hw_lock); |
| 1020 | 1020 | ||
| 1021 | /* claim the resources */ | ||
| 1022 | error = -EBUSY; | ||
| 1023 | dev->hw_io = pnp_port_start(pnp_dev, 0); | ||
| 1024 | if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { | ||
| 1025 | dev->hw_io = -1; | ||
| 1026 | dev->irq = -1; | ||
| 1027 | goto error; | ||
| 1028 | } | ||
| 1029 | |||
| 1030 | dev->irq = pnp_irq(pnp_dev, 0); | ||
| 1031 | if (request_irq(dev->irq, ene_isr, | ||
| 1032 | IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) { | ||
| 1033 | dev->irq = -1; | ||
| 1034 | goto error; | ||
| 1035 | } | ||
| 1036 | |||
| 1037 | pnp_set_drvdata(pnp_dev, dev); | 1021 | pnp_set_drvdata(pnp_dev, dev); |
| 1038 | dev->pnp_dev = pnp_dev; | 1022 | dev->pnp_dev = pnp_dev; |
| 1039 | 1023 | ||
| @@ -1086,6 +1070,22 @@ static int ene_probe(struct pnp_dev *pnp_dev, const struct pnp_device_id *id) | |||
| 1086 | device_set_wakeup_capable(&pnp_dev->dev, true); | 1070 | device_set_wakeup_capable(&pnp_dev->dev, true); |
| 1087 | device_set_wakeup_enable(&pnp_dev->dev, true); | 1071 | device_set_wakeup_enable(&pnp_dev->dev, true); |
| 1088 | 1072 | ||
| 1073 | /* claim the resources */ | ||
| 1074 | error = -EBUSY; | ||
| 1075 | dev->hw_io = pnp_port_start(pnp_dev, 0); | ||
| 1076 | if (!request_region(dev->hw_io, ENE_IO_SIZE, ENE_DRIVER_NAME)) { | ||
| 1077 | dev->hw_io = -1; | ||
| 1078 | dev->irq = -1; | ||
| 1079 | goto error; | ||
| 1080 | } | ||
| 1081 | |||
| 1082 | dev->irq = pnp_irq(pnp_dev, 0); | ||
| 1083 | if (request_irq(dev->irq, ene_isr, | ||
| 1084 | IRQF_SHARED, ENE_DRIVER_NAME, (void *)dev)) { | ||
| 1085 | dev->irq = -1; | ||
| 1086 | goto error; | ||
| 1087 | } | ||
| 1088 | |||
| 1089 | error = rc_register_device(rdev); | 1089 | error = rc_register_device(rdev); |
| 1090 | if (error < 0) | 1090 | if (error < 0) |
| 1091 | goto error; | 1091 | goto error; |
diff --git a/drivers/media/rc/fintek-cir.c b/drivers/media/rc/fintek-cir.c index 392d4be91f8f..4a3a238bcfbc 100644 --- a/drivers/media/rc/fintek-cir.c +++ b/drivers/media/rc/fintek-cir.c | |||
| @@ -197,7 +197,7 @@ static int fintek_hw_detect(struct fintek_dev *fintek) | |||
| 197 | /* | 197 | /* |
| 198 | * Newer reviews of this chipset uses port 8 instead of 5 | 198 | * Newer reviews of this chipset uses port 8 instead of 5 |
| 199 | */ | 199 | */ |
| 200 | if ((chip != 0x0408) || (chip != 0x0804)) | 200 | if ((chip != 0x0408) && (chip != 0x0804)) |
| 201 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2; | 201 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV2; |
| 202 | else | 202 | else |
| 203 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV1; | 203 | fintek->logical_dev_cir = LOGICAL_DEV_CIR_REV1; |
| @@ -514,16 +514,6 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id | |||
| 514 | 514 | ||
| 515 | spin_lock_init(&fintek->fintek_lock); | 515 | spin_lock_init(&fintek->fintek_lock); |
| 516 | 516 | ||
| 517 | ret = -EBUSY; | ||
| 518 | /* now claim resources */ | ||
| 519 | if (!request_region(fintek->cir_addr, | ||
| 520 | fintek->cir_port_len, FINTEK_DRIVER_NAME)) | ||
| 521 | goto failure; | ||
| 522 | |||
| 523 | if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED, | ||
| 524 | FINTEK_DRIVER_NAME, (void *)fintek)) | ||
| 525 | goto failure; | ||
| 526 | |||
| 527 | pnp_set_drvdata(pdev, fintek); | 517 | pnp_set_drvdata(pdev, fintek); |
| 528 | fintek->pdev = pdev; | 518 | fintek->pdev = pdev; |
| 529 | 519 | ||
| @@ -558,6 +548,16 @@ static int fintek_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id | |||
| 558 | /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ | 548 | /* rx resolution is hardwired to 50us atm, 1, 25, 100 also possible */ |
| 559 | rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); | 549 | rdev->rx_resolution = US_TO_NS(CIR_SAMPLE_PERIOD); |
| 560 | 550 | ||
| 551 | ret = -EBUSY; | ||
| 552 | /* now claim resources */ | ||
| 553 | if (!request_region(fintek->cir_addr, | ||
| 554 | fintek->cir_port_len, FINTEK_DRIVER_NAME)) | ||
| 555 | goto failure; | ||
| 556 | |||
| 557 | if (request_irq(fintek->cir_irq, fintek_cir_isr, IRQF_SHARED, | ||
| 558 | FINTEK_DRIVER_NAME, (void *)fintek)) | ||
| 559 | goto failure; | ||
| 560 | |||
| 561 | ret = rc_register_device(rdev); | 561 | ret = rc_register_device(rdev); |
| 562 | if (ret) | 562 | if (ret) |
| 563 | goto failure; | 563 | goto failure; |
diff --git a/drivers/media/rc/ite-cir.c b/drivers/media/rc/ite-cir.c index 682009d76cdf..0e49c99abf68 100644 --- a/drivers/media/rc/ite-cir.c +++ b/drivers/media/rc/ite-cir.c | |||
| @@ -1515,16 +1515,6 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id | |||
| 1515 | /* initialize raw event */ | 1515 | /* initialize raw event */ |
| 1516 | init_ir_raw_event(&itdev->rawir); | 1516 | init_ir_raw_event(&itdev->rawir); |
| 1517 | 1517 | ||
| 1518 | ret = -EBUSY; | ||
| 1519 | /* now claim resources */ | ||
| 1520 | if (!request_region(itdev->cir_addr, | ||
| 1521 | dev_desc->io_region_size, ITE_DRIVER_NAME)) | ||
| 1522 | goto failure; | ||
| 1523 | |||
| 1524 | if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, | ||
| 1525 | ITE_DRIVER_NAME, (void *)itdev)) | ||
| 1526 | goto failure; | ||
| 1527 | |||
| 1528 | /* set driver data into the pnp device */ | 1518 | /* set driver data into the pnp device */ |
| 1529 | pnp_set_drvdata(pdev, itdev); | 1519 | pnp_set_drvdata(pdev, itdev); |
| 1530 | itdev->pdev = pdev; | 1520 | itdev->pdev = pdev; |
| @@ -1600,6 +1590,16 @@ static int ite_probe(struct pnp_dev *pdev, const struct pnp_device_id | |||
| 1600 | rdev->driver_name = ITE_DRIVER_NAME; | 1590 | rdev->driver_name = ITE_DRIVER_NAME; |
| 1601 | rdev->map_name = RC_MAP_RC6_MCE; | 1591 | rdev->map_name = RC_MAP_RC6_MCE; |
| 1602 | 1592 | ||
| 1593 | ret = -EBUSY; | ||
| 1594 | /* now claim resources */ | ||
| 1595 | if (!request_region(itdev->cir_addr, | ||
| 1596 | dev_desc->io_region_size, ITE_DRIVER_NAME)) | ||
| 1597 | goto failure; | ||
| 1598 | |||
| 1599 | if (request_irq(itdev->cir_irq, ite_cir_isr, IRQF_SHARED, | ||
| 1600 | ITE_DRIVER_NAME, (void *)itdev)) | ||
| 1601 | goto failure; | ||
| 1602 | |||
| 1603 | ret = rc_register_device(rdev); | 1603 | ret = rc_register_device(rdev); |
| 1604 | if (ret) | 1604 | if (ret) |
| 1605 | goto failure; | 1605 | goto failure; |
diff --git a/drivers/media/rc/nuvoton-cir.c b/drivers/media/rc/nuvoton-cir.c index 144f3f55d765..8b2c071ac0ab 100644 --- a/drivers/media/rc/nuvoton-cir.c +++ b/drivers/media/rc/nuvoton-cir.c | |||
| @@ -1021,24 +1021,6 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
| 1021 | spin_lock_init(&nvt->nvt_lock); | 1021 | spin_lock_init(&nvt->nvt_lock); |
| 1022 | spin_lock_init(&nvt->tx.lock); | 1022 | spin_lock_init(&nvt->tx.lock); |
| 1023 | 1023 | ||
| 1024 | ret = -EBUSY; | ||
| 1025 | /* now claim resources */ | ||
| 1026 | if (!request_region(nvt->cir_addr, | ||
| 1027 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
| 1028 | goto failure; | ||
| 1029 | |||
| 1030 | if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED, | ||
| 1031 | NVT_DRIVER_NAME, (void *)nvt)) | ||
| 1032 | goto failure; | ||
| 1033 | |||
| 1034 | if (!request_region(nvt->cir_wake_addr, | ||
| 1035 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
| 1036 | goto failure; | ||
| 1037 | |||
| 1038 | if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED, | ||
| 1039 | NVT_DRIVER_NAME, (void *)nvt)) | ||
| 1040 | goto failure; | ||
| 1041 | |||
| 1042 | pnp_set_drvdata(pdev, nvt); | 1024 | pnp_set_drvdata(pdev, nvt); |
| 1043 | nvt->pdev = pdev; | 1025 | nvt->pdev = pdev; |
| 1044 | 1026 | ||
| @@ -1085,6 +1067,24 @@ static int nvt_probe(struct pnp_dev *pdev, const struct pnp_device_id *dev_id) | |||
| 1085 | rdev->tx_resolution = XYZ; | 1067 | rdev->tx_resolution = XYZ; |
| 1086 | #endif | 1068 | #endif |
| 1087 | 1069 | ||
| 1070 | ret = -EBUSY; | ||
| 1071 | /* now claim resources */ | ||
| 1072 | if (!request_region(nvt->cir_addr, | ||
| 1073 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
| 1074 | goto failure; | ||
| 1075 | |||
| 1076 | if (request_irq(nvt->cir_irq, nvt_cir_isr, IRQF_SHARED, | ||
| 1077 | NVT_DRIVER_NAME, (void *)nvt)) | ||
| 1078 | goto failure; | ||
| 1079 | |||
| 1080 | if (!request_region(nvt->cir_wake_addr, | ||
| 1081 | CIR_IOREG_LENGTH, NVT_DRIVER_NAME)) | ||
| 1082 | goto failure; | ||
| 1083 | |||
| 1084 | if (request_irq(nvt->cir_wake_irq, nvt_cir_wake_isr, IRQF_SHARED, | ||
| 1085 | NVT_DRIVER_NAME, (void *)nvt)) | ||
| 1086 | goto failure; | ||
| 1087 | |||
| 1088 | ret = rc_register_device(rdev); | 1088 | ret = rc_register_device(rdev); |
| 1089 | if (ret) | 1089 | if (ret) |
| 1090 | goto failure; | 1090 | goto failure; |
diff --git a/drivers/media/rc/winbond-cir.c b/drivers/media/rc/winbond-cir.c index af526586fa26..342c2c8c1ddf 100644 --- a/drivers/media/rc/winbond-cir.c +++ b/drivers/media/rc/winbond-cir.c | |||
| @@ -991,39 +991,10 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
| 991 | "(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n", | 991 | "(w: 0x%lX, e: 0x%lX, s: 0x%lX, i: %u)\n", |
| 992 | data->wbase, data->ebase, data->sbase, data->irq); | 992 | data->wbase, data->ebase, data->sbase, data->irq); |
| 993 | 993 | ||
| 994 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { | ||
| 995 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
| 996 | data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1); | ||
| 997 | err = -EBUSY; | ||
| 998 | goto exit_free_data; | ||
| 999 | } | ||
| 1000 | |||
| 1001 | if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) { | ||
| 1002 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
| 1003 | data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1); | ||
| 1004 | err = -EBUSY; | ||
| 1005 | goto exit_release_wbase; | ||
| 1006 | } | ||
| 1007 | |||
| 1008 | if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) { | ||
| 1009 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
| 1010 | data->sbase, data->sbase + SP_IOMEM_LEN - 1); | ||
| 1011 | err = -EBUSY; | ||
| 1012 | goto exit_release_ebase; | ||
| 1013 | } | ||
| 1014 | |||
| 1015 | err = request_irq(data->irq, wbcir_irq_handler, | ||
| 1016 | IRQF_DISABLED, DRVNAME, device); | ||
| 1017 | if (err) { | ||
| 1018 | dev_err(dev, "Failed to claim IRQ %u\n", data->irq); | ||
| 1019 | err = -EBUSY; | ||
| 1020 | goto exit_release_sbase; | ||
| 1021 | } | ||
| 1022 | |||
| 1023 | led_trigger_register_simple("cir-tx", &data->txtrigger); | 994 | led_trigger_register_simple("cir-tx", &data->txtrigger); |
| 1024 | if (!data->txtrigger) { | 995 | if (!data->txtrigger) { |
| 1025 | err = -ENOMEM; | 996 | err = -ENOMEM; |
| 1026 | goto exit_free_irq; | 997 | goto exit_free_data; |
| 1027 | } | 998 | } |
| 1028 | 999 | ||
| 1029 | led_trigger_register_simple("cir-rx", &data->rxtrigger); | 1000 | led_trigger_register_simple("cir-rx", &data->rxtrigger); |
| @@ -1062,9 +1033,38 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
| 1062 | data->dev->priv = data; | 1033 | data->dev->priv = data; |
| 1063 | data->dev->dev.parent = &device->dev; | 1034 | data->dev->dev.parent = &device->dev; |
| 1064 | 1035 | ||
| 1036 | if (!request_region(data->wbase, WAKEUP_IOMEM_LEN, DRVNAME)) { | ||
| 1037 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
| 1038 | data->wbase, data->wbase + WAKEUP_IOMEM_LEN - 1); | ||
| 1039 | err = -EBUSY; | ||
| 1040 | goto exit_free_rc; | ||
| 1041 | } | ||
| 1042 | |||
| 1043 | if (!request_region(data->ebase, EHFUNC_IOMEM_LEN, DRVNAME)) { | ||
| 1044 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
| 1045 | data->ebase, data->ebase + EHFUNC_IOMEM_LEN - 1); | ||
| 1046 | err = -EBUSY; | ||
| 1047 | goto exit_release_wbase; | ||
| 1048 | } | ||
| 1049 | |||
| 1050 | if (!request_region(data->sbase, SP_IOMEM_LEN, DRVNAME)) { | ||
| 1051 | dev_err(dev, "Region 0x%lx-0x%lx already in use!\n", | ||
| 1052 | data->sbase, data->sbase + SP_IOMEM_LEN - 1); | ||
| 1053 | err = -EBUSY; | ||
| 1054 | goto exit_release_ebase; | ||
| 1055 | } | ||
| 1056 | |||
| 1057 | err = request_irq(data->irq, wbcir_irq_handler, | ||
| 1058 | IRQF_DISABLED, DRVNAME, device); | ||
| 1059 | if (err) { | ||
| 1060 | dev_err(dev, "Failed to claim IRQ %u\n", data->irq); | ||
| 1061 | err = -EBUSY; | ||
| 1062 | goto exit_release_sbase; | ||
| 1063 | } | ||
| 1064 | |||
| 1065 | err = rc_register_device(data->dev); | 1065 | err = rc_register_device(data->dev); |
| 1066 | if (err) | 1066 | if (err) |
| 1067 | goto exit_free_rc; | 1067 | goto exit_free_irq; |
| 1068 | 1068 | ||
| 1069 | device_init_wakeup(&device->dev, 1); | 1069 | device_init_wakeup(&device->dev, 1); |
| 1070 | 1070 | ||
| @@ -1072,14 +1072,6 @@ wbcir_probe(struct pnp_dev *device, const struct pnp_device_id *dev_id) | |||
| 1072 | 1072 | ||
| 1073 | return 0; | 1073 | return 0; |
| 1074 | 1074 | ||
| 1075 | exit_free_rc: | ||
| 1076 | rc_free_device(data->dev); | ||
| 1077 | exit_unregister_led: | ||
| 1078 | led_classdev_unregister(&data->led); | ||
| 1079 | exit_unregister_rxtrigger: | ||
| 1080 | led_trigger_unregister_simple(data->rxtrigger); | ||
| 1081 | exit_unregister_txtrigger: | ||
| 1082 | led_trigger_unregister_simple(data->txtrigger); | ||
| 1083 | exit_free_irq: | 1075 | exit_free_irq: |
| 1084 | free_irq(data->irq, device); | 1076 | free_irq(data->irq, device); |
| 1085 | exit_release_sbase: | 1077 | exit_release_sbase: |
| @@ -1088,6 +1080,14 @@ exit_release_ebase: | |||
| 1088 | release_region(data->ebase, EHFUNC_IOMEM_LEN); | 1080 | release_region(data->ebase, EHFUNC_IOMEM_LEN); |
| 1089 | exit_release_wbase: | 1081 | exit_release_wbase: |
| 1090 | release_region(data->wbase, WAKEUP_IOMEM_LEN); | 1082 | release_region(data->wbase, WAKEUP_IOMEM_LEN); |
| 1083 | exit_free_rc: | ||
| 1084 | rc_free_device(data->dev); | ||
| 1085 | exit_unregister_led: | ||
| 1086 | led_classdev_unregister(&data->led); | ||
| 1087 | exit_unregister_rxtrigger: | ||
| 1088 | led_trigger_unregister_simple(data->rxtrigger); | ||
| 1089 | exit_unregister_txtrigger: | ||
| 1090 | led_trigger_unregister_simple(data->txtrigger); | ||
| 1091 | exit_free_data: | 1091 | exit_free_data: |
| 1092 | kfree(data); | 1092 | kfree(data); |
| 1093 | pnp_set_drvdata(device, NULL); | 1093 | pnp_set_drvdata(device, NULL); |
diff --git a/drivers/media/video/gspca/sonixj.c b/drivers/media/video/gspca/sonixj.c index db8e5084df06..863c755dd2b7 100644 --- a/drivers/media/video/gspca/sonixj.c +++ b/drivers/media/video/gspca/sonixj.c | |||
| @@ -2923,6 +2923,10 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
| 2923 | * not the JPEG end of frame ('ff d9'). | 2923 | * not the JPEG end of frame ('ff d9'). |
| 2924 | */ | 2924 | */ |
| 2925 | 2925 | ||
| 2926 | /* count the packets and their size */ | ||
| 2927 | sd->npkt++; | ||
| 2928 | sd->pktsz += len; | ||
| 2929 | |||
| 2926 | /*fixme: assumption about the following code: | 2930 | /*fixme: assumption about the following code: |
| 2927 | * - there can be only one marker in a packet | 2931 | * - there can be only one marker in a packet |
| 2928 | */ | 2932 | */ |
| @@ -2945,10 +2949,6 @@ static void sd_pkt_scan(struct gspca_dev *gspca_dev, | |||
| 2945 | data += i; | 2949 | data += i; |
| 2946 | } | 2950 | } |
| 2947 | 2951 | ||
| 2948 | /* count the packets and their size */ | ||
| 2949 | sd->npkt++; | ||
| 2950 | sd->pktsz += len; | ||
| 2951 | |||
| 2952 | /* search backwards if there is a marker in the packet */ | 2952 | /* search backwards if there is a marker in the packet */ |
| 2953 | for (i = len - 1; --i >= 0; ) { | 2953 | for (i = len - 1; --i >= 0; ) { |
| 2954 | if (data[i] != 0xff) { | 2954 | if (data[i] != 0xff) { |
diff --git a/drivers/media/video/marvell-ccic/mmp-driver.c b/drivers/media/video/marvell-ccic/mmp-driver.c index d23552323f45..c4c17fe76c0d 100644 --- a/drivers/media/video/marvell-ccic/mmp-driver.c +++ b/drivers/media/video/marvell-ccic/mmp-driver.c | |||
| @@ -181,7 +181,6 @@ static int mmpcam_probe(struct platform_device *pdev) | |||
| 181 | INIT_LIST_HEAD(&cam->devlist); | 181 | INIT_LIST_HEAD(&cam->devlist); |
| 182 | 182 | ||
| 183 | mcam = &cam->mcam; | 183 | mcam = &cam->mcam; |
| 184 | mcam->platform = MHP_Armada610; | ||
| 185 | mcam->plat_power_up = mmpcam_power_up; | 184 | mcam->plat_power_up = mmpcam_power_up; |
| 186 | mcam->plat_power_down = mmpcam_power_down; | 185 | mcam->plat_power_down = mmpcam_power_down; |
| 187 | mcam->dev = &pdev->dev; | 186 | mcam->dev = &pdev->dev; |
diff --git a/drivers/media/video/s5p-fimc/fimc-capture.c b/drivers/media/video/s5p-fimc/fimc-capture.c index b06efd208328..7e9b2c612b03 100644 --- a/drivers/media/video/s5p-fimc/fimc-capture.c +++ b/drivers/media/video/s5p-fimc/fimc-capture.c | |||
| @@ -246,28 +246,37 @@ int fimc_capture_resume(struct fimc_dev *fimc) | |||
| 246 | 246 | ||
| 247 | } | 247 | } |
| 248 | 248 | ||
| 249 | static unsigned int get_plane_size(struct fimc_frame *fr, unsigned int plane) | 249 | static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, |
| 250 | { | ||
| 251 | if (!fr || plane >= fr->fmt->memplanes) | ||
| 252 | return 0; | ||
| 253 | return fr->f_width * fr->f_height * fr->fmt->depth[plane] / 8; | ||
| 254 | } | ||
| 255 | |||
| 256 | static int queue_setup(struct vb2_queue *vq, const struct v4l2_format *pfmt, | ||
| 257 | unsigned int *num_buffers, unsigned int *num_planes, | 250 | unsigned int *num_buffers, unsigned int *num_planes, |
| 258 | unsigned int sizes[], void *allocators[]) | 251 | unsigned int sizes[], void *allocators[]) |
| 259 | { | 252 | { |
| 253 | const struct v4l2_pix_format_mplane *pixm = NULL; | ||
| 260 | struct fimc_ctx *ctx = vq->drv_priv; | 254 | struct fimc_ctx *ctx = vq->drv_priv; |
| 261 | struct fimc_fmt *fmt = ctx->d_frame.fmt; | 255 | struct fimc_frame *frame = &ctx->d_frame; |
| 256 | struct fimc_fmt *fmt = frame->fmt; | ||
| 257 | unsigned long wh; | ||
| 262 | int i; | 258 | int i; |
| 263 | 259 | ||
| 264 | if (!fmt) | 260 | if (pfmt) { |
| 261 | pixm = &pfmt->fmt.pix_mp; | ||
| 262 | fmt = fimc_find_format(&pixm->pixelformat, NULL, | ||
| 263 | FMT_FLAGS_CAM | FMT_FLAGS_M2M, -1); | ||
| 264 | wh = pixm->width * pixm->height; | ||
| 265 | } else { | ||
| 266 | wh = frame->f_width * frame->f_height; | ||
| 267 | } | ||
| 268 | |||
| 269 | if (fmt == NULL) | ||
| 265 | return -EINVAL; | 270 | return -EINVAL; |
| 266 | 271 | ||
| 267 | *num_planes = fmt->memplanes; | 272 | *num_planes = fmt->memplanes; |
| 268 | 273 | ||
| 269 | for (i = 0; i < fmt->memplanes; i++) { | 274 | for (i = 0; i < fmt->memplanes; i++) { |
| 270 | sizes[i] = get_plane_size(&ctx->d_frame, i); | 275 | unsigned int size = (wh * fmt->depth[i]) / 8; |
| 276 | if (pixm) | ||
| 277 | sizes[i] = max(size, pixm->plane_fmt[i].sizeimage); | ||
| 278 | else | ||
| 279 | sizes[i] = size; | ||
| 271 | allocators[i] = ctx->fimc_dev->alloc_ctx; | 280 | allocators[i] = ctx->fimc_dev->alloc_ctx; |
| 272 | } | 281 | } |
| 273 | 282 | ||
| @@ -1383,7 +1392,7 @@ static int fimc_subdev_set_crop(struct v4l2_subdev *sd, | |||
| 1383 | fimc_capture_try_crop(ctx, r, crop->pad); | 1392 | fimc_capture_try_crop(ctx, r, crop->pad); |
| 1384 | 1393 | ||
| 1385 | if (crop->which == V4L2_SUBDEV_FORMAT_TRY) { | 1394 | if (crop->which == V4L2_SUBDEV_FORMAT_TRY) { |
| 1386 | mutex_lock(&fimc->lock); | 1395 | mutex_unlock(&fimc->lock); |
| 1387 | *v4l2_subdev_get_try_crop(fh, crop->pad) = *r; | 1396 | *v4l2_subdev_get_try_crop(fh, crop->pad) = *r; |
| 1388 | return 0; | 1397 | return 0; |
| 1389 | } | 1398 | } |
diff --git a/drivers/media/video/s5p-fimc/fimc-core.c b/drivers/media/video/s5p-fimc/fimc-core.c index e184e650022a..e09ba7b0076e 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.c +++ b/drivers/media/video/s5p-fimc/fimc-core.c | |||
| @@ -1048,14 +1048,14 @@ static int fimc_m2m_g_fmt_mplane(struct file *file, void *fh, | |||
| 1048 | * @mask: the color flags to match | 1048 | * @mask: the color flags to match |
| 1049 | * @index: offset in the fimc_formats array, ignored if negative | 1049 | * @index: offset in the fimc_formats array, ignored if negative |
| 1050 | */ | 1050 | */ |
| 1051 | struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code, | 1051 | struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code, |
| 1052 | unsigned int mask, int index) | 1052 | unsigned int mask, int index) |
| 1053 | { | 1053 | { |
| 1054 | struct fimc_fmt *fmt, *def_fmt = NULL; | 1054 | struct fimc_fmt *fmt, *def_fmt = NULL; |
| 1055 | unsigned int i; | 1055 | unsigned int i; |
| 1056 | int id = 0; | 1056 | int id = 0; |
| 1057 | 1057 | ||
| 1058 | if (index >= ARRAY_SIZE(fimc_formats)) | 1058 | if (index >= (int)ARRAY_SIZE(fimc_formats)) |
| 1059 | return NULL; | 1059 | return NULL; |
| 1060 | 1060 | ||
| 1061 | for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) { | 1061 | for (i = 0; i < ARRAY_SIZE(fimc_formats); ++i) { |
diff --git a/drivers/media/video/s5p-fimc/fimc-core.h b/drivers/media/video/s5p-fimc/fimc-core.h index a18291e648e2..84fd83550bd7 100644 --- a/drivers/media/video/s5p-fimc/fimc-core.h +++ b/drivers/media/video/s5p-fimc/fimc-core.h | |||
| @@ -718,7 +718,7 @@ void fimc_alpha_ctrl_update(struct fimc_ctx *ctx); | |||
| 718 | int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f); | 718 | int fimc_fill_format(struct fimc_frame *frame, struct v4l2_format *f); |
| 719 | void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, | 719 | void fimc_adjust_mplane_format(struct fimc_fmt *fmt, u32 width, u32 height, |
| 720 | struct v4l2_pix_format_mplane *pix); | 720 | struct v4l2_pix_format_mplane *pix); |
| 721 | struct fimc_fmt *fimc_find_format(u32 *pixelformat, u32 *mbus_code, | 721 | struct fimc_fmt *fimc_find_format(const u32 *pixelformat, const u32 *mbus_code, |
| 722 | unsigned int mask, int index); | 722 | unsigned int mask, int index); |
| 723 | 723 | ||
| 724 | int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh, | 724 | int fimc_check_scaler_ratio(struct fimc_ctx *ctx, int sw, int sh, |
diff --git a/drivers/media/video/soc_camera.c b/drivers/media/video/soc_camera.c index eb25756a07af..aedb970d13f6 100644 --- a/drivers/media/video/soc_camera.c +++ b/drivers/media/video/soc_camera.c | |||
| @@ -530,7 +530,10 @@ static int soc_camera_open(struct file *file) | |||
| 530 | if (icl->reset) | 530 | if (icl->reset) |
| 531 | icl->reset(icd->pdev); | 531 | icl->reset(icd->pdev); |
| 532 | 532 | ||
| 533 | /* Don't mess with the host during probe */ | ||
| 534 | mutex_lock(&ici->host_lock); | ||
| 533 | ret = ici->ops->add(icd); | 535 | ret = ici->ops->add(icd); |
| 536 | mutex_unlock(&ici->host_lock); | ||
| 534 | if (ret < 0) { | 537 | if (ret < 0) { |
| 535 | dev_err(icd->pdev, "Couldn't activate the camera: %d\n", ret); | 538 | dev_err(icd->pdev, "Couldn't activate the camera: %d\n", ret); |
| 536 | goto eiciadd; | 539 | goto eiciadd; |
| @@ -956,7 +959,7 @@ static void scan_add_host(struct soc_camera_host *ici) | |||
| 956 | { | 959 | { |
| 957 | struct soc_camera_device *icd; | 960 | struct soc_camera_device *icd; |
| 958 | 961 | ||
| 959 | mutex_lock(&list_lock); | 962 | mutex_lock(&ici->host_lock); |
| 960 | 963 | ||
| 961 | list_for_each_entry(icd, &devices, list) { | 964 | list_for_each_entry(icd, &devices, list) { |
| 962 | if (icd->iface == ici->nr) { | 965 | if (icd->iface == ici->nr) { |
| @@ -967,7 +970,7 @@ static void scan_add_host(struct soc_camera_host *ici) | |||
| 967 | } | 970 | } |
| 968 | } | 971 | } |
| 969 | 972 | ||
| 970 | mutex_unlock(&list_lock); | 973 | mutex_unlock(&ici->host_lock); |
| 971 | } | 974 | } |
| 972 | 975 | ||
| 973 | #ifdef CONFIG_I2C_BOARDINFO | 976 | #ifdef CONFIG_I2C_BOARDINFO |
| @@ -1313,6 +1316,7 @@ int soc_camera_host_register(struct soc_camera_host *ici) | |||
| 1313 | list_add_tail(&ici->list, &hosts); | 1316 | list_add_tail(&ici->list, &hosts); |
| 1314 | mutex_unlock(&list_lock); | 1317 | mutex_unlock(&list_lock); |
| 1315 | 1318 | ||
| 1319 | mutex_init(&ici->host_lock); | ||
| 1316 | scan_add_host(ici); | 1320 | scan_add_host(ici); |
| 1317 | 1321 | ||
| 1318 | return 0; | 1322 | return 0; |
diff --git a/drivers/media/video/videobuf2-dma-contig.c b/drivers/media/video/videobuf2-dma-contig.c index f17ad98fcc5f..4b7132660a93 100644 --- a/drivers/media/video/videobuf2-dma-contig.c +++ b/drivers/media/video/videobuf2-dma-contig.c | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #include <linux/dma-mapping.h> | 15 | #include <linux/dma-mapping.h> |
| 16 | 16 | ||
| 17 | #include <media/videobuf2-core.h> | 17 | #include <media/videobuf2-core.h> |
| 18 | #include <media/videobuf2-dma-contig.h> | ||
| 18 | #include <media/videobuf2-memops.h> | 19 | #include <media/videobuf2-memops.h> |
| 19 | 20 | ||
| 20 | struct vb2_dc_conf { | 21 | struct vb2_dc_conf { |
| @@ -85,7 +86,7 @@ static void *vb2_dma_contig_vaddr(void *buf_priv) | |||
| 85 | { | 86 | { |
| 86 | struct vb2_dc_buf *buf = buf_priv; | 87 | struct vb2_dc_buf *buf = buf_priv; |
| 87 | if (!buf) | 88 | if (!buf) |
| 88 | return 0; | 89 | return NULL; |
| 89 | 90 | ||
| 90 | return buf->vaddr; | 91 | return buf->vaddr; |
| 91 | } | 92 | } |
diff --git a/drivers/media/video/videobuf2-memops.c b/drivers/media/video/videobuf2-memops.c index c41cb60245d6..504cd4cbe29e 100644 --- a/drivers/media/video/videobuf2-memops.c +++ b/drivers/media/video/videobuf2-memops.c | |||
| @@ -55,6 +55,7 @@ struct vm_area_struct *vb2_get_vma(struct vm_area_struct *vma) | |||
| 55 | 55 | ||
| 56 | return vma_copy; | 56 | return vma_copy; |
| 57 | } | 57 | } |
| 58 | EXPORT_SYMBOL_GPL(vb2_get_vma); | ||
| 58 | 59 | ||
| 59 | /** | 60 | /** |
| 60 | * vb2_put_userptr() - release a userspace virtual memory area | 61 | * vb2_put_userptr() - release a userspace virtual memory area |
diff --git a/drivers/mtd/mtdchar.c b/drivers/mtd/mtdchar.c index 58fc65f5c817..f2f482bec573 100644 --- a/drivers/mtd/mtdchar.c +++ b/drivers/mtd/mtdchar.c | |||
| @@ -376,7 +376,7 @@ static int otp_select_filemode(struct mtd_file_info *mfi, int mode) | |||
| 376 | * Make a fake call to mtd_read_fact_prot_reg() to check if OTP | 376 | * Make a fake call to mtd_read_fact_prot_reg() to check if OTP |
| 377 | * operations are supported. | 377 | * operations are supported. |
| 378 | */ | 378 | */ |
| 379 | if (mtd_read_fact_prot_reg(mtd, -1, -1, &retlen, NULL) == -EOPNOTSUPP) | 379 | if (mtd_read_fact_prot_reg(mtd, -1, 0, &retlen, NULL) == -EOPNOTSUPP) |
| 380 | return -EOPNOTSUPP; | 380 | return -EOPNOTSUPP; |
| 381 | 381 | ||
| 382 | switch (mode) { | 382 | switch (mode) { |
diff --git a/drivers/mtd/nand/ams-delta.c b/drivers/mtd/nand/ams-delta.c index 73416951f4c1..861ca8f7e47d 100644 --- a/drivers/mtd/nand/ams-delta.c +++ b/drivers/mtd/nand/ams-delta.c | |||
| @@ -212,18 +212,17 @@ static int __devinit ams_delta_init(struct platform_device *pdev) | |||
| 212 | /* Link the private data with the MTD structure */ | 212 | /* Link the private data with the MTD structure */ |
| 213 | ams_delta_mtd->priv = this; | 213 | ams_delta_mtd->priv = this; |
| 214 | 214 | ||
| 215 | if (!request_mem_region(res->start, resource_size(res), | 215 | /* |
| 216 | dev_name(&pdev->dev))) { | 216 | * Don't try to request the memory region from here, |
| 217 | dev_err(&pdev->dev, "request_mem_region failed\n"); | 217 | * it should have been already requested from the |
| 218 | err = -EBUSY; | 218 | * gpio-omap driver and requesting it again would fail. |
| 219 | goto out_free; | 219 | */ |
| 220 | } | ||
| 221 | 220 | ||
| 222 | io_base = ioremap(res->start, resource_size(res)); | 221 | io_base = ioremap(res->start, resource_size(res)); |
| 223 | if (io_base == NULL) { | 222 | if (io_base == NULL) { |
| 224 | dev_err(&pdev->dev, "ioremap failed\n"); | 223 | dev_err(&pdev->dev, "ioremap failed\n"); |
| 225 | err = -EIO; | 224 | err = -EIO; |
| 226 | goto out_release_io; | 225 | goto out_free; |
| 227 | } | 226 | } |
| 228 | 227 | ||
| 229 | this->priv = io_base; | 228 | this->priv = io_base; |
| @@ -271,8 +270,6 @@ out_gpio: | |||
| 271 | platform_set_drvdata(pdev, NULL); | 270 | platform_set_drvdata(pdev, NULL); |
| 272 | gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); | 271 | gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); |
| 273 | iounmap(io_base); | 272 | iounmap(io_base); |
| 274 | out_release_io: | ||
| 275 | release_mem_region(res->start, resource_size(res)); | ||
| 276 | out_free: | 273 | out_free: |
| 277 | kfree(ams_delta_mtd); | 274 | kfree(ams_delta_mtd); |
| 278 | out: | 275 | out: |
| @@ -285,7 +282,6 @@ out_free: | |||
| 285 | static int __devexit ams_delta_cleanup(struct platform_device *pdev) | 282 | static int __devexit ams_delta_cleanup(struct platform_device *pdev) |
| 286 | { | 283 | { |
| 287 | void __iomem *io_base = platform_get_drvdata(pdev); | 284 | void __iomem *io_base = platform_get_drvdata(pdev); |
| 288 | struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | ||
| 289 | 285 | ||
| 290 | /* Release resources, unregister device */ | 286 | /* Release resources, unregister device */ |
| 291 | nand_release(ams_delta_mtd); | 287 | nand_release(ams_delta_mtd); |
| @@ -293,7 +289,6 @@ static int __devexit ams_delta_cleanup(struct platform_device *pdev) | |||
| 293 | gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); | 289 | gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); |
| 294 | gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); | 290 | gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); |
| 295 | iounmap(io_base); | 291 | iounmap(io_base); |
| 296 | release_mem_region(res->start, resource_size(res)); | ||
| 297 | 292 | ||
| 298 | /* Free the MTD device structure */ | 293 | /* Free the MTD device structure */ |
| 299 | kfree(ams_delta_mtd); | 294 | kfree(ams_delta_mtd); |
diff --git a/drivers/net/bonding/bond_alb.c b/drivers/net/bonding/bond_alb.c index 9abfde479316..2e1f8066f1a8 100644 --- a/drivers/net/bonding/bond_alb.c +++ b/drivers/net/bonding/bond_alb.c | |||
| @@ -342,26 +342,26 @@ static void rlb_update_entry_from_arp(struct bonding *bond, struct arp_pkt *arp) | |||
| 342 | _unlock_rx_hashtbl_bh(bond); | 342 | _unlock_rx_hashtbl_bh(bond); |
| 343 | } | 343 | } |
| 344 | 344 | ||
| 345 | static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond, | 345 | static int rlb_arp_recv(struct sk_buff *skb, struct bonding *bond, |
| 346 | struct slave *slave) | 346 | struct slave *slave) |
| 347 | { | 347 | { |
| 348 | struct arp_pkt *arp; | 348 | struct arp_pkt *arp; |
| 349 | 349 | ||
| 350 | if (skb->protocol != cpu_to_be16(ETH_P_ARP)) | 350 | if (skb->protocol != cpu_to_be16(ETH_P_ARP)) |
| 351 | return; | 351 | goto out; |
| 352 | 352 | ||
| 353 | arp = (struct arp_pkt *) skb->data; | 353 | arp = (struct arp_pkt *) skb->data; |
| 354 | if (!arp) { | 354 | if (!arp) { |
| 355 | pr_debug("Packet has no ARP data\n"); | 355 | pr_debug("Packet has no ARP data\n"); |
| 356 | return; | 356 | goto out; |
| 357 | } | 357 | } |
| 358 | 358 | ||
| 359 | if (!pskb_may_pull(skb, arp_hdr_len(bond->dev))) | 359 | if (!pskb_may_pull(skb, arp_hdr_len(bond->dev))) |
| 360 | return; | 360 | goto out; |
| 361 | 361 | ||
| 362 | if (skb->len < sizeof(struct arp_pkt)) { | 362 | if (skb->len < sizeof(struct arp_pkt)) { |
| 363 | pr_debug("Packet is too small to be an ARP\n"); | 363 | pr_debug("Packet is too small to be an ARP\n"); |
| 364 | return; | 364 | goto out; |
| 365 | } | 365 | } |
| 366 | 366 | ||
| 367 | if (arp->op_code == htons(ARPOP_REPLY)) { | 367 | if (arp->op_code == htons(ARPOP_REPLY)) { |
| @@ -369,6 +369,8 @@ static void rlb_arp_recv(struct sk_buff *skb, struct bonding *bond, | |||
| 369 | rlb_update_entry_from_arp(bond, arp); | 369 | rlb_update_entry_from_arp(bond, arp); |
| 370 | pr_debug("Server received an ARP Reply from client\n"); | 370 | pr_debug("Server received an ARP Reply from client\n"); |
| 371 | } | 371 | } |
| 372 | out: | ||
| 373 | return RX_HANDLER_ANOTHER; | ||
| 372 | } | 374 | } |
| 373 | 375 | ||
| 374 | /* Caller must hold bond lock for read */ | 376 | /* Caller must hold bond lock for read */ |
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index 9f2bae6616d3..4581aa5ccaba 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h | |||
| @@ -218,7 +218,7 @@ struct bonding { | |||
| 218 | struct slave *primary_slave; | 218 | struct slave *primary_slave; |
| 219 | bool force_primary; | 219 | bool force_primary; |
| 220 | s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ | 220 | s32 slave_cnt; /* never change this value outside the attach/detach wrappers */ |
| 221 | void (*recv_probe)(struct sk_buff *, struct bonding *, | 221 | int (*recv_probe)(struct sk_buff *, struct bonding *, |
| 222 | struct slave *); | 222 | struct slave *); |
| 223 | rwlock_t lock; | 223 | rwlock_t lock; |
| 224 | rwlock_t curr_slave_lock; | 224 | rwlock_t curr_slave_lock; |
diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c index 37caa8885c2a..8d8908d2a9b1 100644 --- a/drivers/net/ethernet/intel/e1000/e1000_main.c +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c | |||
| @@ -493,7 +493,11 @@ out: | |||
| 493 | static void e1000_down_and_stop(struct e1000_adapter *adapter) | 493 | static void e1000_down_and_stop(struct e1000_adapter *adapter) |
| 494 | { | 494 | { |
| 495 | set_bit(__E1000_DOWN, &adapter->flags); | 495 | set_bit(__E1000_DOWN, &adapter->flags); |
| 496 | cancel_work_sync(&adapter->reset_task); | 496 | |
| 497 | /* Only kill reset task if adapter is not resetting */ | ||
| 498 | if (!test_bit(__E1000_RESETTING, &adapter->flags)) | ||
| 499 | cancel_work_sync(&adapter->reset_task); | ||
| 500 | |||
| 497 | cancel_delayed_work_sync(&adapter->watchdog_task); | 501 | cancel_delayed_work_sync(&adapter->watchdog_task); |
| 498 | cancel_delayed_work_sync(&adapter->phy_info_task); | 502 | cancel_delayed_work_sync(&adapter->phy_info_task); |
| 499 | cancel_delayed_work_sync(&adapter->fifo_stall_task); | 503 | cancel_delayed_work_sync(&adapter->fifo_stall_task); |
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h index dd14915f54bb..ba781747d174 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe.h | |||
| @@ -584,7 +584,6 @@ struct pch_gbe_hw_stats { | |||
| 584 | /** | 584 | /** |
| 585 | * struct pch_gbe_adapter - board specific private data structure | 585 | * struct pch_gbe_adapter - board specific private data structure |
| 586 | * @stats_lock: Spinlock structure for status | 586 | * @stats_lock: Spinlock structure for status |
| 587 | * @tx_queue_lock: Spinlock structure for transmit | ||
| 588 | * @ethtool_lock: Spinlock structure for ethtool | 587 | * @ethtool_lock: Spinlock structure for ethtool |
| 589 | * @irq_sem: Semaphore for interrupt | 588 | * @irq_sem: Semaphore for interrupt |
| 590 | * @netdev: Pointer of network device structure | 589 | * @netdev: Pointer of network device structure |
| @@ -609,7 +608,6 @@ struct pch_gbe_hw_stats { | |||
| 609 | 608 | ||
| 610 | struct pch_gbe_adapter { | 609 | struct pch_gbe_adapter { |
| 611 | spinlock_t stats_lock; | 610 | spinlock_t stats_lock; |
| 612 | spinlock_t tx_queue_lock; | ||
| 613 | spinlock_t ethtool_lock; | 611 | spinlock_t ethtool_lock; |
| 614 | atomic_t irq_sem; | 612 | atomic_t irq_sem; |
| 615 | struct net_device *netdev; | 613 | struct net_device *netdev; |
diff --git a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c index 8035e5ff6e06..1e38d502a062 100644 --- a/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c +++ b/drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_main.c | |||
| @@ -640,14 +640,11 @@ static void pch_gbe_mac_set_pause_packet(struct pch_gbe_hw *hw) | |||
| 640 | */ | 640 | */ |
| 641 | static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter) | 641 | static int pch_gbe_alloc_queues(struct pch_gbe_adapter *adapter) |
| 642 | { | 642 | { |
| 643 | int size; | 643 | adapter->tx_ring = kzalloc(sizeof(*adapter->tx_ring), GFP_KERNEL); |
| 644 | |||
| 645 | size = (int)sizeof(struct pch_gbe_tx_ring); | ||
| 646 | adapter->tx_ring = kzalloc(size, GFP_KERNEL); | ||
| 647 | if (!adapter->tx_ring) | 644 | if (!adapter->tx_ring) |
| 648 | return -ENOMEM; | 645 | return -ENOMEM; |
| 649 | size = (int)sizeof(struct pch_gbe_rx_ring); | 646 | |
| 650 | adapter->rx_ring = kzalloc(size, GFP_KERNEL); | 647 | adapter->rx_ring = kzalloc(sizeof(*adapter->rx_ring), GFP_KERNEL); |
| 651 | if (!adapter->rx_ring) { | 648 | if (!adapter->rx_ring) { |
| 652 | kfree(adapter->tx_ring); | 649 | kfree(adapter->tx_ring); |
| 653 | return -ENOMEM; | 650 | return -ENOMEM; |
| @@ -1162,7 +1159,6 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter, | |||
| 1162 | struct sk_buff *tmp_skb; | 1159 | struct sk_buff *tmp_skb; |
| 1163 | unsigned int frame_ctrl; | 1160 | unsigned int frame_ctrl; |
| 1164 | unsigned int ring_num; | 1161 | unsigned int ring_num; |
| 1165 | unsigned long flags; | ||
| 1166 | 1162 | ||
| 1167 | /*-- Set frame control --*/ | 1163 | /*-- Set frame control --*/ |
| 1168 | frame_ctrl = 0; | 1164 | frame_ctrl = 0; |
| @@ -1211,14 +1207,14 @@ static void pch_gbe_tx_queue(struct pch_gbe_adapter *adapter, | |||
| 1211 | } | 1207 | } |
| 1212 | } | 1208 | } |
| 1213 | } | 1209 | } |
| 1214 | spin_lock_irqsave(&tx_ring->tx_lock, flags); | 1210 | |
| 1215 | ring_num = tx_ring->next_to_use; | 1211 | ring_num = tx_ring->next_to_use; |
| 1216 | if (unlikely((ring_num + 1) == tx_ring->count)) | 1212 | if (unlikely((ring_num + 1) == tx_ring->count)) |
| 1217 | tx_ring->next_to_use = 0; | 1213 | tx_ring->next_to_use = 0; |
| 1218 | else | 1214 | else |
| 1219 | tx_ring->next_to_use = ring_num + 1; | 1215 | tx_ring->next_to_use = ring_num + 1; |
| 1220 | 1216 | ||
| 1221 | spin_unlock_irqrestore(&tx_ring->tx_lock, flags); | 1217 | |
| 1222 | buffer_info = &tx_ring->buffer_info[ring_num]; | 1218 | buffer_info = &tx_ring->buffer_info[ring_num]; |
| 1223 | tmp_skb = buffer_info->skb; | 1219 | tmp_skb = buffer_info->skb; |
| 1224 | 1220 | ||
| @@ -1518,7 +1514,7 @@ pch_gbe_alloc_rx_buffers_pool(struct pch_gbe_adapter *adapter, | |||
| 1518 | &rx_ring->rx_buff_pool_logic, | 1514 | &rx_ring->rx_buff_pool_logic, |
| 1519 | GFP_KERNEL); | 1515 | GFP_KERNEL); |
| 1520 | if (!rx_ring->rx_buff_pool) { | 1516 | if (!rx_ring->rx_buff_pool) { |
| 1521 | pr_err("Unable to allocate memory for the receive poll buffer\n"); | 1517 | pr_err("Unable to allocate memory for the receive pool buffer\n"); |
| 1522 | return -ENOMEM; | 1518 | return -ENOMEM; |
| 1523 | } | 1519 | } |
| 1524 | memset(rx_ring->rx_buff_pool, 0, size); | 1520 | memset(rx_ring->rx_buff_pool, 0, size); |
| @@ -1637,15 +1633,17 @@ pch_gbe_clean_tx(struct pch_gbe_adapter *adapter, | |||
| 1637 | pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n", | 1633 | pr_debug("called pch_gbe_unmap_and_free_tx_resource() %d count\n", |
| 1638 | cleaned_count); | 1634 | cleaned_count); |
| 1639 | /* Recover from running out of Tx resources in xmit_frame */ | 1635 | /* Recover from running out of Tx resources in xmit_frame */ |
| 1636 | spin_lock(&tx_ring->tx_lock); | ||
| 1640 | if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) { | 1637 | if (unlikely(cleaned && (netif_queue_stopped(adapter->netdev)))) { |
| 1641 | netif_wake_queue(adapter->netdev); | 1638 | netif_wake_queue(adapter->netdev); |
| 1642 | adapter->stats.tx_restart_count++; | 1639 | adapter->stats.tx_restart_count++; |
| 1643 | pr_debug("Tx wake queue\n"); | 1640 | pr_debug("Tx wake queue\n"); |
| 1644 | } | 1641 | } |
| 1645 | spin_lock(&adapter->tx_queue_lock); | 1642 | |
| 1646 | tx_ring->next_to_clean = i; | 1643 | tx_ring->next_to_clean = i; |
| 1647 | spin_unlock(&adapter->tx_queue_lock); | 1644 | |
| 1648 | pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean); | 1645 | pr_debug("next_to_clean : %d\n", tx_ring->next_to_clean); |
| 1646 | spin_unlock(&tx_ring->tx_lock); | ||
| 1649 | return cleaned; | 1647 | return cleaned; |
| 1650 | } | 1648 | } |
| 1651 | 1649 | ||
| @@ -2037,7 +2035,6 @@ static int pch_gbe_sw_init(struct pch_gbe_adapter *adapter) | |||
| 2037 | return -ENOMEM; | 2035 | return -ENOMEM; |
| 2038 | } | 2036 | } |
| 2039 | spin_lock_init(&adapter->hw.miim_lock); | 2037 | spin_lock_init(&adapter->hw.miim_lock); |
| 2040 | spin_lock_init(&adapter->tx_queue_lock); | ||
| 2041 | spin_lock_init(&adapter->stats_lock); | 2038 | spin_lock_init(&adapter->stats_lock); |
| 2042 | spin_lock_init(&adapter->ethtool_lock); | 2039 | spin_lock_init(&adapter->ethtool_lock); |
| 2043 | atomic_set(&adapter->irq_sem, 0); | 2040 | atomic_set(&adapter->irq_sem, 0); |
| @@ -2142,10 +2139,10 @@ static int pch_gbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev) | |||
| 2142 | tx_ring->next_to_use, tx_ring->next_to_clean); | 2139 | tx_ring->next_to_use, tx_ring->next_to_clean); |
| 2143 | return NETDEV_TX_BUSY; | 2140 | return NETDEV_TX_BUSY; |
| 2144 | } | 2141 | } |
| 2145 | spin_unlock_irqrestore(&tx_ring->tx_lock, flags); | ||
| 2146 | 2142 | ||
| 2147 | /* CRC,ITAG no support */ | 2143 | /* CRC,ITAG no support */ |
| 2148 | pch_gbe_tx_queue(adapter, tx_ring, skb); | 2144 | pch_gbe_tx_queue(adapter, tx_ring, skb); |
| 2145 | spin_unlock_irqrestore(&tx_ring->tx_lock, flags); | ||
| 2149 | return NETDEV_TX_OK; | 2146 | return NETDEV_TX_OK; |
| 2150 | } | 2147 | } |
| 2151 | 2148 | ||
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 00880edba048..425e201f597c 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
| @@ -485,6 +485,7 @@ static const struct driver_info wwan_info = { | |||
| 485 | /*-------------------------------------------------------------------------*/ | 485 | /*-------------------------------------------------------------------------*/ |
| 486 | 486 | ||
| 487 | #define HUAWEI_VENDOR_ID 0x12D1 | 487 | #define HUAWEI_VENDOR_ID 0x12D1 |
| 488 | #define NOVATEL_VENDOR_ID 0x1410 | ||
| 488 | 489 | ||
| 489 | static const struct usb_device_id products [] = { | 490 | static const struct usb_device_id products [] = { |
| 490 | /* | 491 | /* |
| @@ -602,6 +603,21 @@ static const struct usb_device_id products [] = { | |||
| 602 | * because of bugs/quirks in a given product (like Zaurus, above). | 603 | * because of bugs/quirks in a given product (like Zaurus, above). |
| 603 | */ | 604 | */ |
| 604 | { | 605 | { |
| 606 | /* Novatel USB551L */ | ||
| 607 | /* This match must come *before* the generic CDC-ETHER match so that | ||
| 608 | * we get FLAG_WWAN set on the device, since it's descriptors are | ||
| 609 | * generic CDC-ETHER. | ||
| 610 | */ | ||
| 611 | .match_flags = USB_DEVICE_ID_MATCH_VENDOR | ||
| 612 | | USB_DEVICE_ID_MATCH_PRODUCT | ||
| 613 | | USB_DEVICE_ID_MATCH_INT_INFO, | ||
| 614 | .idVendor = NOVATEL_VENDOR_ID, | ||
| 615 | .idProduct = 0xB001, | ||
| 616 | .bInterfaceClass = USB_CLASS_COMM, | ||
| 617 | .bInterfaceSubClass = USB_CDC_SUBCLASS_ETHERNET, | ||
| 618 | .bInterfaceProtocol = USB_CDC_PROTO_NONE, | ||
| 619 | .driver_info = (unsigned long)&wwan_info, | ||
| 620 | }, { | ||
| 605 | USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET, | 621 | USB_INTERFACE_INFO(USB_CLASS_COMM, USB_CDC_SUBCLASS_ETHERNET, |
| 606 | USB_CDC_PROTO_NONE), | 622 | USB_CDC_PROTO_NONE), |
| 607 | .driver_info = (unsigned long) &cdc_info, | 623 | .driver_info = (unsigned long) &cdc_info, |
diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 2d927fb4adf4..b38db48b1ce0 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/usb/usbnet.c | |||
| @@ -282,17 +282,32 @@ int usbnet_change_mtu (struct net_device *net, int new_mtu) | |||
| 282 | } | 282 | } |
| 283 | EXPORT_SYMBOL_GPL(usbnet_change_mtu); | 283 | EXPORT_SYMBOL_GPL(usbnet_change_mtu); |
| 284 | 284 | ||
| 285 | /* The caller must hold list->lock */ | ||
| 286 | static void __usbnet_queue_skb(struct sk_buff_head *list, | ||
| 287 | struct sk_buff *newsk, enum skb_state state) | ||
| 288 | { | ||
| 289 | struct skb_data *entry = (struct skb_data *) newsk->cb; | ||
| 290 | |||
| 291 | __skb_queue_tail(list, newsk); | ||
| 292 | entry->state = state; | ||
| 293 | } | ||
| 294 | |||
| 285 | /*-------------------------------------------------------------------------*/ | 295 | /*-------------------------------------------------------------------------*/ |
| 286 | 296 | ||
| 287 | /* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from | 297 | /* some LK 2.4 HCDs oopsed if we freed or resubmitted urbs from |
| 288 | * completion callbacks. 2.5 should have fixed those bugs... | 298 | * completion callbacks. 2.5 should have fixed those bugs... |
| 289 | */ | 299 | */ |
| 290 | 300 | ||
| 291 | static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_head *list) | 301 | static enum skb_state defer_bh(struct usbnet *dev, struct sk_buff *skb, |
| 302 | struct sk_buff_head *list, enum skb_state state) | ||
| 292 | { | 303 | { |
| 293 | unsigned long flags; | 304 | unsigned long flags; |
| 305 | enum skb_state old_state; | ||
| 306 | struct skb_data *entry = (struct skb_data *) skb->cb; | ||
| 294 | 307 | ||
| 295 | spin_lock_irqsave(&list->lock, flags); | 308 | spin_lock_irqsave(&list->lock, flags); |
| 309 | old_state = entry->state; | ||
| 310 | entry->state = state; | ||
| 296 | __skb_unlink(skb, list); | 311 | __skb_unlink(skb, list); |
| 297 | spin_unlock(&list->lock); | 312 | spin_unlock(&list->lock); |
| 298 | spin_lock(&dev->done.lock); | 313 | spin_lock(&dev->done.lock); |
| @@ -300,6 +315,7 @@ static void defer_bh(struct usbnet *dev, struct sk_buff *skb, struct sk_buff_hea | |||
| 300 | if (dev->done.qlen == 1) | 315 | if (dev->done.qlen == 1) |
| 301 | tasklet_schedule(&dev->bh); | 316 | tasklet_schedule(&dev->bh); |
| 302 | spin_unlock_irqrestore(&dev->done.lock, flags); | 317 | spin_unlock_irqrestore(&dev->done.lock, flags); |
| 318 | return old_state; | ||
| 303 | } | 319 | } |
| 304 | 320 | ||
| 305 | /* some work can't be done in tasklets, so we use keventd | 321 | /* some work can't be done in tasklets, so we use keventd |
| @@ -340,7 +356,6 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
| 340 | entry = (struct skb_data *) skb->cb; | 356 | entry = (struct skb_data *) skb->cb; |
| 341 | entry->urb = urb; | 357 | entry->urb = urb; |
| 342 | entry->dev = dev; | 358 | entry->dev = dev; |
| 343 | entry->state = rx_start; | ||
| 344 | entry->length = 0; | 359 | entry->length = 0; |
| 345 | 360 | ||
| 346 | usb_fill_bulk_urb (urb, dev->udev, dev->in, | 361 | usb_fill_bulk_urb (urb, dev->udev, dev->in, |
| @@ -372,7 +387,7 @@ static int rx_submit (struct usbnet *dev, struct urb *urb, gfp_t flags) | |||
| 372 | tasklet_schedule (&dev->bh); | 387 | tasklet_schedule (&dev->bh); |
| 373 | break; | 388 | break; |
| 374 | case 0: | 389 | case 0: |
| 375 | __skb_queue_tail (&dev->rxq, skb); | 390 | __usbnet_queue_skb(&dev->rxq, skb, rx_start); |
| 376 | } | 391 | } |
| 377 | } else { | 392 | } else { |
| 378 | netif_dbg(dev, ifdown, dev->net, "rx: stopped\n"); | 393 | netif_dbg(dev, ifdown, dev->net, "rx: stopped\n"); |
| @@ -423,16 +438,17 @@ static void rx_complete (struct urb *urb) | |||
| 423 | struct skb_data *entry = (struct skb_data *) skb->cb; | 438 | struct skb_data *entry = (struct skb_data *) skb->cb; |
| 424 | struct usbnet *dev = entry->dev; | 439 | struct usbnet *dev = entry->dev; |
| 425 | int urb_status = urb->status; | 440 | int urb_status = urb->status; |
| 441 | enum skb_state state; | ||
| 426 | 442 | ||
| 427 | skb_put (skb, urb->actual_length); | 443 | skb_put (skb, urb->actual_length); |
| 428 | entry->state = rx_done; | 444 | state = rx_done; |
| 429 | entry->urb = NULL; | 445 | entry->urb = NULL; |
| 430 | 446 | ||
| 431 | switch (urb_status) { | 447 | switch (urb_status) { |
| 432 | /* success */ | 448 | /* success */ |
| 433 | case 0: | 449 | case 0: |
| 434 | if (skb->len < dev->net->hard_header_len) { | 450 | if (skb->len < dev->net->hard_header_len) { |
| 435 | entry->state = rx_cleanup; | 451 | state = rx_cleanup; |
| 436 | dev->net->stats.rx_errors++; | 452 | dev->net->stats.rx_errors++; |
| 437 | dev->net->stats.rx_length_errors++; | 453 | dev->net->stats.rx_length_errors++; |
| 438 | netif_dbg(dev, rx_err, dev->net, | 454 | netif_dbg(dev, rx_err, dev->net, |
| @@ -471,7 +487,7 @@ static void rx_complete (struct urb *urb) | |||
| 471 | "rx throttle %d\n", urb_status); | 487 | "rx throttle %d\n", urb_status); |
| 472 | } | 488 | } |
| 473 | block: | 489 | block: |
| 474 | entry->state = rx_cleanup; | 490 | state = rx_cleanup; |
| 475 | entry->urb = urb; | 491 | entry->urb = urb; |
| 476 | urb = NULL; | 492 | urb = NULL; |
| 477 | break; | 493 | break; |
| @@ -482,17 +498,18 @@ block: | |||
| 482 | // FALLTHROUGH | 498 | // FALLTHROUGH |
| 483 | 499 | ||
| 484 | default: | 500 | default: |
| 485 | entry->state = rx_cleanup; | 501 | state = rx_cleanup; |
| 486 | dev->net->stats.rx_errors++; | 502 | dev->net->stats.rx_errors++; |
| 487 | netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status); | 503 | netif_dbg(dev, rx_err, dev->net, "rx status %d\n", urb_status); |
| 488 | break; | 504 | break; |
| 489 | } | 505 | } |
| 490 | 506 | ||
| 491 | defer_bh(dev, skb, &dev->rxq); | 507 | state = defer_bh(dev, skb, &dev->rxq, state); |
| 492 | 508 | ||
| 493 | if (urb) { | 509 | if (urb) { |
| 494 | if (netif_running (dev->net) && | 510 | if (netif_running (dev->net) && |
| 495 | !test_bit (EVENT_RX_HALT, &dev->flags)) { | 511 | !test_bit (EVENT_RX_HALT, &dev->flags) && |
| 512 | state != unlink_start) { | ||
| 496 | rx_submit (dev, urb, GFP_ATOMIC); | 513 | rx_submit (dev, urb, GFP_ATOMIC); |
| 497 | usb_mark_last_busy(dev->udev); | 514 | usb_mark_last_busy(dev->udev); |
| 498 | return; | 515 | return; |
| @@ -579,16 +596,23 @@ EXPORT_SYMBOL_GPL(usbnet_purge_paused_rxq); | |||
| 579 | static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) | 596 | static int unlink_urbs (struct usbnet *dev, struct sk_buff_head *q) |
| 580 | { | 597 | { |
| 581 | unsigned long flags; | 598 | unsigned long flags; |
| 582 | struct sk_buff *skb, *skbnext; | 599 | struct sk_buff *skb; |
| 583 | int count = 0; | 600 | int count = 0; |
| 584 | 601 | ||
| 585 | spin_lock_irqsave (&q->lock, flags); | 602 | spin_lock_irqsave (&q->lock, flags); |
| 586 | skb_queue_walk_safe(q, skb, skbnext) { | 603 | while (!skb_queue_empty(q)) { |
| 587 | struct skb_data *entry; | 604 | struct skb_data *entry; |
| 588 | struct urb *urb; | 605 | struct urb *urb; |
| 589 | int retval; | 606 | int retval; |
| 590 | 607 | ||
| 591 | entry = (struct skb_data *) skb->cb; | 608 | skb_queue_walk(q, skb) { |
| 609 | entry = (struct skb_data *) skb->cb; | ||
| 610 | if (entry->state != unlink_start) | ||
| 611 | goto found; | ||
| 612 | } | ||
| 613 | break; | ||
| 614 | found: | ||
| 615 | entry->state = unlink_start; | ||
| 592 | urb = entry->urb; | 616 | urb = entry->urb; |
| 593 | 617 | ||
| 594 | /* | 618 | /* |
| @@ -1039,8 +1063,7 @@ static void tx_complete (struct urb *urb) | |||
| 1039 | } | 1063 | } |
| 1040 | 1064 | ||
| 1041 | usb_autopm_put_interface_async(dev->intf); | 1065 | usb_autopm_put_interface_async(dev->intf); |
| 1042 | entry->state = tx_done; | 1066 | (void) defer_bh(dev, skb, &dev->txq, tx_done); |
| 1043 | defer_bh(dev, skb, &dev->txq); | ||
| 1044 | } | 1067 | } |
| 1045 | 1068 | ||
| 1046 | /*-------------------------------------------------------------------------*/ | 1069 | /*-------------------------------------------------------------------------*/ |
| @@ -1096,7 +1119,6 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
| 1096 | entry = (struct skb_data *) skb->cb; | 1119 | entry = (struct skb_data *) skb->cb; |
| 1097 | entry->urb = urb; | 1120 | entry->urb = urb; |
| 1098 | entry->dev = dev; | 1121 | entry->dev = dev; |
| 1099 | entry->state = tx_start; | ||
| 1100 | entry->length = length; | 1122 | entry->length = length; |
| 1101 | 1123 | ||
| 1102 | usb_fill_bulk_urb (urb, dev->udev, dev->out, | 1124 | usb_fill_bulk_urb (urb, dev->udev, dev->out, |
| @@ -1155,7 +1177,7 @@ netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, | |||
| 1155 | break; | 1177 | break; |
| 1156 | case 0: | 1178 | case 0: |
| 1157 | net->trans_start = jiffies; | 1179 | net->trans_start = jiffies; |
| 1158 | __skb_queue_tail (&dev->txq, skb); | 1180 | __usbnet_queue_skb(&dev->txq, skb, tx_start); |
| 1159 | if (dev->txq.qlen >= TX_QLEN (dev)) | 1181 | if (dev->txq.qlen >= TX_QLEN (dev)) |
| 1160 | netif_stop_queue (net); | 1182 | netif_stop_queue (net); |
| 1161 | } | 1183 | } |
diff --git a/drivers/net/virtio_net.c b/drivers/net/virtio_net.c index af8acc85f4bb..cbefe671bcc6 100644 --- a/drivers/net/virtio_net.c +++ b/drivers/net/virtio_net.c | |||
| @@ -492,7 +492,9 @@ static void virtnet_napi_enable(struct virtnet_info *vi) | |||
| 492 | * We synchronize against interrupts via NAPI_STATE_SCHED */ | 492 | * We synchronize against interrupts via NAPI_STATE_SCHED */ |
| 493 | if (napi_schedule_prep(&vi->napi)) { | 493 | if (napi_schedule_prep(&vi->napi)) { |
| 494 | virtqueue_disable_cb(vi->rvq); | 494 | virtqueue_disable_cb(vi->rvq); |
| 495 | local_bh_disable(); | ||
| 495 | __napi_schedule(&vi->napi); | 496 | __napi_schedule(&vi->napi); |
| 497 | local_bh_enable(); | ||
| 496 | } | 498 | } |
| 497 | } | 499 | } |
| 498 | 500 | ||
diff --git a/drivers/net/wireless/rtlwifi/pci.c b/drivers/net/wireless/rtlwifi/pci.c index cc15fdb36060..67f9430ee197 100644 --- a/drivers/net/wireless/rtlwifi/pci.c +++ b/drivers/net/wireless/rtlwifi/pci.c | |||
| @@ -1851,14 +1851,6 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
| 1851 | /*like read eeprom and so on */ | 1851 | /*like read eeprom and so on */ |
| 1852 | rtlpriv->cfg->ops->read_eeprom_info(hw); | 1852 | rtlpriv->cfg->ops->read_eeprom_info(hw); |
| 1853 | 1853 | ||
| 1854 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
| 1855 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
| 1856 | err = -ENODEV; | ||
| 1857 | goto fail3; | ||
| 1858 | } | ||
| 1859 | |||
| 1860 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
| 1861 | |||
| 1862 | /*aspm */ | 1854 | /*aspm */ |
| 1863 | rtl_pci_init_aspm(hw); | 1855 | rtl_pci_init_aspm(hw); |
| 1864 | 1856 | ||
| @@ -1877,6 +1869,14 @@ int __devinit rtl_pci_probe(struct pci_dev *pdev, | |||
| 1877 | goto fail3; | 1869 | goto fail3; |
| 1878 | } | 1870 | } |
| 1879 | 1871 | ||
| 1872 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
| 1873 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
| 1874 | err = -ENODEV; | ||
| 1875 | goto fail3; | ||
| 1876 | } | ||
| 1877 | |||
| 1878 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
| 1879 | |||
| 1880 | err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); | 1880 | err = sysfs_create_group(&pdev->dev.kobj, &rtl_attribute_group); |
| 1881 | if (err) { | 1881 | if (err) { |
| 1882 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, | 1882 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, |
diff --git a/drivers/net/wireless/rtlwifi/usb.c b/drivers/net/wireless/rtlwifi/usb.c index d04dbda13f5a..a6049d7d51b3 100644 --- a/drivers/net/wireless/rtlwifi/usb.c +++ b/drivers/net/wireless/rtlwifi/usb.c | |||
| @@ -971,11 +971,6 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
| 971 | rtlpriv->cfg->ops->read_chip_version(hw); | 971 | rtlpriv->cfg->ops->read_chip_version(hw); |
| 972 | /*like read eeprom and so on */ | 972 | /*like read eeprom and so on */ |
| 973 | rtlpriv->cfg->ops->read_eeprom_info(hw); | 973 | rtlpriv->cfg->ops->read_eeprom_info(hw); |
| 974 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
| 975 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
| 976 | goto error_out; | ||
| 977 | } | ||
| 978 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
| 979 | err = _rtl_usb_init(hw); | 974 | err = _rtl_usb_init(hw); |
| 980 | if (err) | 975 | if (err) |
| 981 | goto error_out; | 976 | goto error_out; |
| @@ -987,6 +982,11 @@ int __devinit rtl_usb_probe(struct usb_interface *intf, | |||
| 987 | "Can't allocate sw for mac80211\n"); | 982 | "Can't allocate sw for mac80211\n"); |
| 988 | goto error_out; | 983 | goto error_out; |
| 989 | } | 984 | } |
| 985 | if (rtlpriv->cfg->ops->init_sw_vars(hw)) { | ||
| 986 | RT_TRACE(rtlpriv, COMP_ERR, DBG_EMERG, "Can't init_sw_vars\n"); | ||
| 987 | goto error_out; | ||
| 988 | } | ||
| 989 | rtlpriv->cfg->ops->init_sw_leds(hw); | ||
| 990 | 990 | ||
| 991 | return 0; | 991 | return 0; |
| 992 | error_out: | 992 | error_out: |
diff --git a/drivers/pci/pci-acpi.c b/drivers/pci/pci-acpi.c index 1929c0c63b75..61e2fefeedab 100644 --- a/drivers/pci/pci-acpi.c +++ b/drivers/pci/pci-acpi.c | |||
| @@ -223,7 +223,7 @@ static int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state) | |||
| 223 | [PCI_D0] = ACPI_STATE_D0, | 223 | [PCI_D0] = ACPI_STATE_D0, |
| 224 | [PCI_D1] = ACPI_STATE_D1, | 224 | [PCI_D1] = ACPI_STATE_D1, |
| 225 | [PCI_D2] = ACPI_STATE_D2, | 225 | [PCI_D2] = ACPI_STATE_D2, |
| 226 | [PCI_D3hot] = ACPI_STATE_D3_HOT, | 226 | [PCI_D3hot] = ACPI_STATE_D3, |
| 227 | [PCI_D3cold] = ACPI_STATE_D3 | 227 | [PCI_D3cold] = ACPI_STATE_D3 |
| 228 | }; | 228 | }; |
| 229 | int error = -EINVAL; | 229 | int error = -EINVAL; |
diff --git a/drivers/ptp/ptp_pch.c b/drivers/ptp/ptp_pch.c index 375eb04c16ea..6fff68020488 100644 --- a/drivers/ptp/ptp_pch.c +++ b/drivers/ptp/ptp_pch.c | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #include <linux/module.h> | 30 | #include <linux/module.h> |
| 31 | #include <linux/pci.h> | 31 | #include <linux/pci.h> |
| 32 | #include <linux/ptp_clock_kernel.h> | 32 | #include <linux/ptp_clock_kernel.h> |
| 33 | #include <linux/slab.h> | ||
| 33 | 34 | ||
| 34 | #define STATION_ADDR_LEN 20 | 35 | #define STATION_ADDR_LEN 20 |
| 35 | #define PCI_DEVICE_ID_PCH_1588 0x8819 | 36 | #define PCI_DEVICE_ID_PCH_1588 0x8819 |
diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c index ee15c68fb519..e756a0df3664 100644 --- a/drivers/remoteproc/remoteproc_core.c +++ b/drivers/remoteproc/remoteproc_core.c | |||
| @@ -354,7 +354,7 @@ static void __rproc_free_vrings(struct rproc_vdev *rvdev, int i) | |||
| 354 | { | 354 | { |
| 355 | struct rproc *rproc = rvdev->rproc; | 355 | struct rproc *rproc = rvdev->rproc; |
| 356 | 356 | ||
| 357 | for (i--; i > 0; i--) { | 357 | for (i--; i >= 0; i--) { |
| 358 | struct rproc_vring *rvring = &rvdev->vring[i]; | 358 | struct rproc_vring *rvring = &rvdev->vring[i]; |
| 359 | int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align)); | 359 | int size = PAGE_ALIGN(vring_size(rvring->len, rvring->align)); |
| 360 | 360 | ||
diff --git a/drivers/rtc/rtc-pl031.c b/drivers/rtc/rtc-pl031.c index 684ef4bbfce4..f027c063fb20 100644 --- a/drivers/rtc/rtc-pl031.c +++ b/drivers/rtc/rtc-pl031.c | |||
| @@ -312,6 +312,7 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) | |||
| 312 | int ret; | 312 | int ret; |
| 313 | struct pl031_local *ldata; | 313 | struct pl031_local *ldata; |
| 314 | struct rtc_class_ops *ops = id->data; | 314 | struct rtc_class_ops *ops = id->data; |
| 315 | unsigned long time; | ||
| 315 | 316 | ||
| 316 | ret = amba_request_regions(adev, NULL); | 317 | ret = amba_request_regions(adev, NULL); |
| 317 | if (ret) | 318 | if (ret) |
| @@ -343,6 +344,23 @@ static int pl031_probe(struct amba_device *adev, const struct amba_id *id) | |||
| 343 | writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN, | 344 | writel(readl(ldata->base + RTC_CR) | RTC_CR_CWEN, |
| 344 | ldata->base + RTC_CR); | 345 | ldata->base + RTC_CR); |
| 345 | 346 | ||
| 347 | /* | ||
| 348 | * On ST PL031 variants, the RTC reset value does not provide correct | ||
| 349 | * weekday for 2000-01-01. Correct the erroneous sunday to saturday. | ||
| 350 | */ | ||
| 351 | if (ldata->hw_designer == AMBA_VENDOR_ST) { | ||
| 352 | if (readl(ldata->base + RTC_YDR) == 0x2000) { | ||
| 353 | time = readl(ldata->base + RTC_DR); | ||
| 354 | if ((time & | ||
| 355 | (RTC_MON_MASK | RTC_MDAY_MASK | RTC_WDAY_MASK)) | ||
| 356 | == 0x02120000) { | ||
| 357 | time = time | (0x7 << RTC_WDAY_SHIFT); | ||
| 358 | writel(0x2000, ldata->base + RTC_YLR); | ||
| 359 | writel(time, ldata->base + RTC_LR); | ||
| 360 | } | ||
| 361 | } | ||
| 362 | } | ||
| 363 | |||
| 346 | ldata->rtc = rtc_device_register("pl031", &adev->dev, ops, | 364 | ldata->rtc = rtc_device_register("pl031", &adev->dev, ops, |
| 347 | THIS_MODULE); | 365 | THIS_MODULE); |
| 348 | if (IS_ERR(ldata->rtc)) { | 366 | if (IS_ERR(ldata->rtc)) { |
diff --git a/drivers/target/target_core_file.c b/drivers/target/target_core_file.c index 7ed58e2df791..f286955331a2 100644 --- a/drivers/target/target_core_file.c +++ b/drivers/target/target_core_file.c | |||
| @@ -169,6 +169,7 @@ static struct se_device *fd_create_virtdevice( | |||
| 169 | inode = file->f_mapping->host; | 169 | inode = file->f_mapping->host; |
| 170 | if (S_ISBLK(inode->i_mode)) { | 170 | if (S_ISBLK(inode->i_mode)) { |
| 171 | struct request_queue *q; | 171 | struct request_queue *q; |
| 172 | unsigned long long dev_size; | ||
| 172 | /* | 173 | /* |
| 173 | * Setup the local scope queue_limits from struct request_queue->limits | 174 | * Setup the local scope queue_limits from struct request_queue->limits |
| 174 | * to pass into transport_add_device_to_core_hba() as struct se_dev_limits. | 175 | * to pass into transport_add_device_to_core_hba() as struct se_dev_limits. |
| @@ -183,13 +184,12 @@ static struct se_device *fd_create_virtdevice( | |||
| 183 | * one (1) logical sector from underlying struct block_device | 184 | * one (1) logical sector from underlying struct block_device |
| 184 | */ | 185 | */ |
| 185 | fd_dev->fd_block_size = bdev_logical_block_size(inode->i_bdev); | 186 | fd_dev->fd_block_size = bdev_logical_block_size(inode->i_bdev); |
| 186 | fd_dev->fd_dev_size = (i_size_read(file->f_mapping->host) - | 187 | dev_size = (i_size_read(file->f_mapping->host) - |
| 187 | fd_dev->fd_block_size); | 188 | fd_dev->fd_block_size); |
| 188 | 189 | ||
| 189 | pr_debug("FILEIO: Using size: %llu bytes from struct" | 190 | pr_debug("FILEIO: Using size: %llu bytes from struct" |
| 190 | " block_device blocks: %llu logical_block_size: %d\n", | 191 | " block_device blocks: %llu logical_block_size: %d\n", |
| 191 | fd_dev->fd_dev_size, | 192 | dev_size, div_u64(dev_size, fd_dev->fd_block_size), |
| 192 | div_u64(fd_dev->fd_dev_size, fd_dev->fd_block_size), | ||
| 193 | fd_dev->fd_block_size); | 193 | fd_dev->fd_block_size); |
| 194 | } else { | 194 | } else { |
| 195 | if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) { | 195 | if (!(fd_dev->fbd_flags & FBDF_HAS_SIZE)) { |
| @@ -605,10 +605,20 @@ static u32 fd_get_device_type(struct se_device *dev) | |||
| 605 | static sector_t fd_get_blocks(struct se_device *dev) | 605 | static sector_t fd_get_blocks(struct se_device *dev) |
| 606 | { | 606 | { |
| 607 | struct fd_dev *fd_dev = dev->dev_ptr; | 607 | struct fd_dev *fd_dev = dev->dev_ptr; |
| 608 | unsigned long long blocks_long = div_u64(fd_dev->fd_dev_size, | 608 | struct file *f = fd_dev->fd_file; |
| 609 | dev->se_sub_dev->se_dev_attrib.block_size); | 609 | struct inode *i = f->f_mapping->host; |
| 610 | unsigned long long dev_size; | ||
| 611 | /* | ||
| 612 | * When using a file that references an underlying struct block_device, | ||
| 613 | * ensure dev_size is always based on the current inode size in order | ||
| 614 | * to handle underlying block_device resize operations. | ||
| 615 | */ | ||
| 616 | if (S_ISBLK(i->i_mode)) | ||
| 617 | dev_size = (i_size_read(i) - fd_dev->fd_block_size); | ||
| 618 | else | ||
| 619 | dev_size = fd_dev->fd_dev_size; | ||
| 610 | 620 | ||
| 611 | return blocks_long; | 621 | return div_u64(dev_size, dev->se_sub_dev->se_dev_attrib.block_size); |
| 612 | } | 622 | } |
| 613 | 623 | ||
| 614 | static struct se_subsystem_api fileio_template = { | 624 | static struct se_subsystem_api fileio_template = { |
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 86f0c3b5d500..c3148b10b4b3 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c | |||
| @@ -220,6 +220,9 @@ int target_scsi2_reservation_release(struct se_task *task) | |||
| 220 | if (dev->dev_reserved_node_acl != sess->se_node_acl) | 220 | if (dev->dev_reserved_node_acl != sess->se_node_acl) |
| 221 | goto out_unlock; | 221 | goto out_unlock; |
| 222 | 222 | ||
| 223 | if (dev->dev_res_bin_isid != sess->sess_bin_isid) | ||
| 224 | goto out_unlock; | ||
| 225 | |||
| 223 | dev->dev_reserved_node_acl = NULL; | 226 | dev->dev_reserved_node_acl = NULL; |
| 224 | dev->dev_flags &= ~DF_SPC2_RESERVATIONS; | 227 | dev->dev_flags &= ~DF_SPC2_RESERVATIONS; |
| 225 | if (dev->dev_flags & DF_SPC2_RESERVATIONS_WITH_ISID) { | 228 | if (dev->dev_flags & DF_SPC2_RESERVATIONS_WITH_ISID) { |
diff --git a/drivers/tty/vt/keyboard.c b/drivers/tty/vt/keyboard.c index 29ca20dbd335..3b0c4e32ed7b 100644 --- a/drivers/tty/vt/keyboard.c +++ b/drivers/tty/vt/keyboard.c | |||
| @@ -2044,7 +2044,7 @@ int vt_do_kdskled(int console, int cmd, unsigned long arg, int perm) | |||
| 2044 | kbd->default_ledflagstate = ((arg >> 4) & 7); | 2044 | kbd->default_ledflagstate = ((arg >> 4) & 7); |
| 2045 | set_leds(); | 2045 | set_leds(); |
| 2046 | spin_unlock_irqrestore(&kbd_event_lock, flags); | 2046 | spin_unlock_irqrestore(&kbd_event_lock, flags); |
| 2047 | break; | 2047 | return 0; |
| 2048 | 2048 | ||
| 2049 | /* the ioctls below only set the lights, not the functions */ | 2049 | /* the ioctls below only set the lights, not the functions */ |
| 2050 | /* for those, see KDGKBLED and KDSKBLED above */ | 2050 | /* for those, see KDGKBLED and KDSKBLED above */ |
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c index c2d05a8279fd..8807fe501d20 100644 --- a/drivers/virtio/virtio_balloon.c +++ b/drivers/virtio/virtio_balloon.c | |||
| @@ -390,6 +390,7 @@ static void __devexit virtballoon_remove(struct virtio_device *vdev) | |||
| 390 | /* There might be pages left in the balloon: free them. */ | 390 | /* There might be pages left in the balloon: free them. */ |
| 391 | while (vb->num_pages) | 391 | while (vb->num_pages) |
| 392 | leak_balloon(vb, vb->num_pages); | 392 | leak_balloon(vb, vb->num_pages); |
| 393 | update_balloon_size(vb); | ||
| 393 | 394 | ||
| 394 | /* Now we reset the device so we can clean up the queues. */ | 395 | /* Now we reset the device so we can clean up the queues. */ |
| 395 | vdev->config->reset(vdev); | 396 | vdev->config->reset(vdev); |
| @@ -505,9 +505,14 @@ EXPORT_SYMBOL(bio_clone); | |||
| 505 | int bio_get_nr_vecs(struct block_device *bdev) | 505 | int bio_get_nr_vecs(struct block_device *bdev) |
| 506 | { | 506 | { |
| 507 | struct request_queue *q = bdev_get_queue(bdev); | 507 | struct request_queue *q = bdev_get_queue(bdev); |
| 508 | return min_t(unsigned, | 508 | int nr_pages; |
| 509 | |||
| 510 | nr_pages = min_t(unsigned, | ||
| 509 | queue_max_segments(q), | 511 | queue_max_segments(q), |
| 510 | queue_max_sectors(q) / (PAGE_SIZE >> 9) + 1); | 512 | queue_max_sectors(q) / (PAGE_SIZE >> 9) + 1); |
| 513 | |||
| 514 | return min_t(unsigned, nr_pages, BIO_MAX_PAGES); | ||
| 515 | |||
| 511 | } | 516 | } |
| 512 | EXPORT_SYMBOL(bio_get_nr_vecs); | 517 | EXPORT_SYMBOL(bio_get_nr_vecs); |
| 513 | 518 | ||
diff --git a/fs/block_dev.c b/fs/block_dev.c index e08f6a20a5bb..ba11c30f302d 100644 --- a/fs/block_dev.c +++ b/fs/block_dev.c | |||
| @@ -70,7 +70,7 @@ static void bdev_inode_switch_bdi(struct inode *inode, | |||
| 70 | spin_unlock(&dst->wb.list_lock); | 70 | spin_unlock(&dst->wb.list_lock); |
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | static sector_t max_block(struct block_device *bdev) | 73 | sector_t blkdev_max_block(struct block_device *bdev) |
| 74 | { | 74 | { |
| 75 | sector_t retval = ~((sector_t)0); | 75 | sector_t retval = ~((sector_t)0); |
| 76 | loff_t sz = i_size_read(bdev->bd_inode); | 76 | loff_t sz = i_size_read(bdev->bd_inode); |
| @@ -163,7 +163,7 @@ static int | |||
| 163 | blkdev_get_block(struct inode *inode, sector_t iblock, | 163 | blkdev_get_block(struct inode *inode, sector_t iblock, |
| 164 | struct buffer_head *bh, int create) | 164 | struct buffer_head *bh, int create) |
| 165 | { | 165 | { |
| 166 | if (iblock >= max_block(I_BDEV(inode))) { | 166 | if (iblock >= blkdev_max_block(I_BDEV(inode))) { |
| 167 | if (create) | 167 | if (create) |
| 168 | return -EIO; | 168 | return -EIO; |
| 169 | 169 | ||
| @@ -185,7 +185,7 @@ static int | |||
| 185 | blkdev_get_blocks(struct inode *inode, sector_t iblock, | 185 | blkdev_get_blocks(struct inode *inode, sector_t iblock, |
| 186 | struct buffer_head *bh, int create) | 186 | struct buffer_head *bh, int create) |
| 187 | { | 187 | { |
| 188 | sector_t end_block = max_block(I_BDEV(inode)); | 188 | sector_t end_block = blkdev_max_block(I_BDEV(inode)); |
| 189 | unsigned long max_blocks = bh->b_size >> inode->i_blkbits; | 189 | unsigned long max_blocks = bh->b_size >> inode->i_blkbits; |
| 190 | 190 | ||
| 191 | if ((iblock + max_blocks) > end_block) { | 191 | if ((iblock + max_blocks) > end_block) { |
diff --git a/fs/buffer.c b/fs/buffer.c index 351e18ea2e53..ad5938ca357c 100644 --- a/fs/buffer.c +++ b/fs/buffer.c | |||
| @@ -921,6 +921,7 @@ init_page_buffers(struct page *page, struct block_device *bdev, | |||
| 921 | struct buffer_head *head = page_buffers(page); | 921 | struct buffer_head *head = page_buffers(page); |
| 922 | struct buffer_head *bh = head; | 922 | struct buffer_head *bh = head; |
| 923 | int uptodate = PageUptodate(page); | 923 | int uptodate = PageUptodate(page); |
| 924 | sector_t end_block = blkdev_max_block(I_BDEV(bdev->bd_inode)); | ||
| 924 | 925 | ||
| 925 | do { | 926 | do { |
| 926 | if (!buffer_mapped(bh)) { | 927 | if (!buffer_mapped(bh)) { |
| @@ -929,7 +930,8 @@ init_page_buffers(struct page *page, struct block_device *bdev, | |||
| 929 | bh->b_blocknr = block; | 930 | bh->b_blocknr = block; |
| 930 | if (uptodate) | 931 | if (uptodate) |
| 931 | set_buffer_uptodate(bh); | 932 | set_buffer_uptodate(bh); |
| 932 | set_buffer_mapped(bh); | 933 | if (block < end_block) |
| 934 | set_buffer_mapped(bh); | ||
| 933 | } | 935 | } |
| 934 | block++; | 936 | block++; |
| 935 | bh = bh->b_this_page; | 937 | bh = bh->b_this_page; |
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 5dcc55197fb3..e0b56d7a19c5 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c | |||
| @@ -164,7 +164,8 @@ static const match_table_t cifs_mount_option_tokens = { | |||
| 164 | { Opt_sign, "sign" }, | 164 | { Opt_sign, "sign" }, |
| 165 | { Opt_seal, "seal" }, | 165 | { Opt_seal, "seal" }, |
| 166 | { Opt_direct, "direct" }, | 166 | { Opt_direct, "direct" }, |
| 167 | { Opt_direct, "forceddirectio" }, | 167 | { Opt_direct, "directio" }, |
| 168 | { Opt_direct, "forcedirectio" }, | ||
| 168 | { Opt_strictcache, "strictcache" }, | 169 | { Opt_strictcache, "strictcache" }, |
| 169 | { Opt_noac, "noac" }, | 170 | { Opt_noac, "noac" }, |
| 170 | { Opt_fsc, "fsc" }, | 171 | { Opt_fsc, "fsc" }, |
diff --git a/fs/jffs2/gc.c b/fs/jffs2/gc.c index ad271c70aa25..5a2dec2b064c 100644 --- a/fs/jffs2/gc.c +++ b/fs/jffs2/gc.c | |||
| @@ -234,8 +234,8 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c) | |||
| 234 | return 0; | 234 | return 0; |
| 235 | 235 | ||
| 236 | jffs2_dbg(1, "No progress from erasing block; doing GC anyway\n"); | 236 | jffs2_dbg(1, "No progress from erasing block; doing GC anyway\n"); |
| 237 | spin_lock(&c->erase_completion_lock); | ||
| 238 | mutex_lock(&c->alloc_sem); | 237 | mutex_lock(&c->alloc_sem); |
| 238 | spin_lock(&c->erase_completion_lock); | ||
| 239 | } | 239 | } |
| 240 | 240 | ||
| 241 | /* First, work out which block we're garbage-collecting */ | 241 | /* First, work out which block we're garbage-collecting */ |
diff --git a/fs/proc/base.c b/fs/proc/base.c index 1c8b280146d7..57b8159f26f3 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
| @@ -1799,10 +1799,15 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
| 1799 | if (task) { | 1799 | if (task) { |
| 1800 | files = get_files_struct(task); | 1800 | files = get_files_struct(task); |
| 1801 | if (files) { | 1801 | if (files) { |
| 1802 | struct file *file; | ||
| 1802 | rcu_read_lock(); | 1803 | rcu_read_lock(); |
| 1803 | if (fcheck_files(files, fd)) { | 1804 | file = fcheck_files(files, fd); |
| 1805 | if (file) { | ||
| 1806 | unsigned i_mode, f_mode = file->f_mode; | ||
| 1807 | |||
| 1804 | rcu_read_unlock(); | 1808 | rcu_read_unlock(); |
| 1805 | put_files_struct(files); | 1809 | put_files_struct(files); |
| 1810 | |||
| 1806 | if (task_dumpable(task)) { | 1811 | if (task_dumpable(task)) { |
| 1807 | rcu_read_lock(); | 1812 | rcu_read_lock(); |
| 1808 | cred = __task_cred(task); | 1813 | cred = __task_cred(task); |
| @@ -1813,7 +1818,14 @@ static int tid_fd_revalidate(struct dentry *dentry, struct nameidata *nd) | |||
| 1813 | inode->i_uid = 0; | 1818 | inode->i_uid = 0; |
| 1814 | inode->i_gid = 0; | 1819 | inode->i_gid = 0; |
| 1815 | } | 1820 | } |
| 1816 | inode->i_mode &= ~(S_ISUID | S_ISGID); | 1821 | |
| 1822 | i_mode = S_IFLNK; | ||
| 1823 | if (f_mode & FMODE_READ) | ||
| 1824 | i_mode |= S_IRUSR | S_IXUSR; | ||
| 1825 | if (f_mode & FMODE_WRITE) | ||
| 1826 | i_mode |= S_IWUSR | S_IXUSR; | ||
| 1827 | inode->i_mode = i_mode; | ||
| 1828 | |||
| 1817 | security_task_to_inode(task, inode); | 1829 | security_task_to_inode(task, inode); |
| 1818 | put_task_struct(task); | 1830 | put_task_struct(task); |
| 1819 | return 1; | 1831 | return 1; |
| @@ -1837,8 +1849,6 @@ static struct dentry *proc_fd_instantiate(struct inode *dir, | |||
| 1837 | struct dentry *dentry, struct task_struct *task, const void *ptr) | 1849 | struct dentry *dentry, struct task_struct *task, const void *ptr) |
| 1838 | { | 1850 | { |
| 1839 | unsigned fd = *(const unsigned *)ptr; | 1851 | unsigned fd = *(const unsigned *)ptr; |
| 1840 | struct file *file; | ||
| 1841 | struct files_struct *files; | ||
| 1842 | struct inode *inode; | 1852 | struct inode *inode; |
| 1843 | struct proc_inode *ei; | 1853 | struct proc_inode *ei; |
| 1844 | struct dentry *error = ERR_PTR(-ENOENT); | 1854 | struct dentry *error = ERR_PTR(-ENOENT); |
| @@ -1848,25 +1858,6 @@ static struct dentry *proc_fd_instantiate(struct inode *dir, | |||
| 1848 | goto out; | 1858 | goto out; |
| 1849 | ei = PROC_I(inode); | 1859 | ei = PROC_I(inode); |
| 1850 | ei->fd = fd; | 1860 | ei->fd = fd; |
| 1851 | files = get_files_struct(task); | ||
| 1852 | if (!files) | ||
| 1853 | goto out_iput; | ||
| 1854 | inode->i_mode = S_IFLNK; | ||
| 1855 | |||
| 1856 | /* | ||
| 1857 | * We are not taking a ref to the file structure, so we must | ||
| 1858 | * hold ->file_lock. | ||
| 1859 | */ | ||
| 1860 | spin_lock(&files->file_lock); | ||
| 1861 | file = fcheck_files(files, fd); | ||
| 1862 | if (!file) | ||
| 1863 | goto out_unlock; | ||
| 1864 | if (file->f_mode & FMODE_READ) | ||
| 1865 | inode->i_mode |= S_IRUSR | S_IXUSR; | ||
| 1866 | if (file->f_mode & FMODE_WRITE) | ||
| 1867 | inode->i_mode |= S_IWUSR | S_IXUSR; | ||
| 1868 | spin_unlock(&files->file_lock); | ||
| 1869 | put_files_struct(files); | ||
| 1870 | 1861 | ||
| 1871 | inode->i_op = &proc_pid_link_inode_operations; | 1862 | inode->i_op = &proc_pid_link_inode_operations; |
| 1872 | inode->i_size = 64; | 1863 | inode->i_size = 64; |
| @@ -1879,12 +1870,6 @@ static struct dentry *proc_fd_instantiate(struct inode *dir, | |||
| 1879 | 1870 | ||
| 1880 | out: | 1871 | out: |
| 1881 | return error; | 1872 | return error; |
| 1882 | out_unlock: | ||
| 1883 | spin_unlock(&files->file_lock); | ||
| 1884 | put_files_struct(files); | ||
| 1885 | out_iput: | ||
| 1886 | iput(inode); | ||
| 1887 | goto out; | ||
| 1888 | } | 1873 | } |
| 1889 | 1874 | ||
| 1890 | static struct dentry *proc_lookupfd_common(struct inode *dir, | 1875 | static struct dentry *proc_lookupfd_common(struct inode *dir, |
| @@ -2177,16 +2162,16 @@ static struct dentry *proc_map_files_lookup(struct inode *dir, | |||
| 2177 | goto out; | 2162 | goto out; |
| 2178 | 2163 | ||
| 2179 | result = ERR_PTR(-EACCES); | 2164 | result = ERR_PTR(-EACCES); |
| 2180 | if (lock_trace(task)) | 2165 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) |
| 2181 | goto out_put_task; | 2166 | goto out_put_task; |
| 2182 | 2167 | ||
| 2183 | result = ERR_PTR(-ENOENT); | 2168 | result = ERR_PTR(-ENOENT); |
| 2184 | if (dname_to_vma_addr(dentry, &vm_start, &vm_end)) | 2169 | if (dname_to_vma_addr(dentry, &vm_start, &vm_end)) |
| 2185 | goto out_unlock; | 2170 | goto out_put_task; |
| 2186 | 2171 | ||
| 2187 | mm = get_task_mm(task); | 2172 | mm = get_task_mm(task); |
| 2188 | if (!mm) | 2173 | if (!mm) |
| 2189 | goto out_unlock; | 2174 | goto out_put_task; |
| 2190 | 2175 | ||
| 2191 | down_read(&mm->mmap_sem); | 2176 | down_read(&mm->mmap_sem); |
| 2192 | vma = find_exact_vma(mm, vm_start, vm_end); | 2177 | vma = find_exact_vma(mm, vm_start, vm_end); |
| @@ -2198,8 +2183,6 @@ static struct dentry *proc_map_files_lookup(struct inode *dir, | |||
| 2198 | out_no_vma: | 2183 | out_no_vma: |
| 2199 | up_read(&mm->mmap_sem); | 2184 | up_read(&mm->mmap_sem); |
| 2200 | mmput(mm); | 2185 | mmput(mm); |
| 2201 | out_unlock: | ||
| 2202 | unlock_trace(task); | ||
| 2203 | out_put_task: | 2186 | out_put_task: |
| 2204 | put_task_struct(task); | 2187 | put_task_struct(task); |
| 2205 | out: | 2188 | out: |
| @@ -2233,7 +2216,7 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 2233 | goto out; | 2216 | goto out; |
| 2234 | 2217 | ||
| 2235 | ret = -EACCES; | 2218 | ret = -EACCES; |
| 2236 | if (lock_trace(task)) | 2219 | if (!ptrace_may_access(task, PTRACE_MODE_READ)) |
| 2237 | goto out_put_task; | 2220 | goto out_put_task; |
| 2238 | 2221 | ||
| 2239 | ret = 0; | 2222 | ret = 0; |
| @@ -2241,12 +2224,12 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 2241 | case 0: | 2224 | case 0: |
| 2242 | ino = inode->i_ino; | 2225 | ino = inode->i_ino; |
| 2243 | if (filldir(dirent, ".", 1, 0, ino, DT_DIR) < 0) | 2226 | if (filldir(dirent, ".", 1, 0, ino, DT_DIR) < 0) |
| 2244 | goto out_unlock; | 2227 | goto out_put_task; |
| 2245 | filp->f_pos++; | 2228 | filp->f_pos++; |
| 2246 | case 1: | 2229 | case 1: |
| 2247 | ino = parent_ino(dentry); | 2230 | ino = parent_ino(dentry); |
| 2248 | if (filldir(dirent, "..", 2, 1, ino, DT_DIR) < 0) | 2231 | if (filldir(dirent, "..", 2, 1, ino, DT_DIR) < 0) |
| 2249 | goto out_unlock; | 2232 | goto out_put_task; |
| 2250 | filp->f_pos++; | 2233 | filp->f_pos++; |
| 2251 | default: | 2234 | default: |
| 2252 | { | 2235 | { |
| @@ -2257,7 +2240,7 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 2257 | 2240 | ||
| 2258 | mm = get_task_mm(task); | 2241 | mm = get_task_mm(task); |
| 2259 | if (!mm) | 2242 | if (!mm) |
| 2260 | goto out_unlock; | 2243 | goto out_put_task; |
| 2261 | down_read(&mm->mmap_sem); | 2244 | down_read(&mm->mmap_sem); |
| 2262 | 2245 | ||
| 2263 | nr_files = 0; | 2246 | nr_files = 0; |
| @@ -2287,7 +2270,7 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 2287 | flex_array_free(fa); | 2270 | flex_array_free(fa); |
| 2288 | up_read(&mm->mmap_sem); | 2271 | up_read(&mm->mmap_sem); |
| 2289 | mmput(mm); | 2272 | mmput(mm); |
| 2290 | goto out_unlock; | 2273 | goto out_put_task; |
| 2291 | } | 2274 | } |
| 2292 | for (i = 0, vma = mm->mmap, pos = 2; vma; | 2275 | for (i = 0, vma = mm->mmap, pos = 2; vma; |
| 2293 | vma = vma->vm_next) { | 2276 | vma = vma->vm_next) { |
| @@ -2332,8 +2315,6 @@ proc_map_files_readdir(struct file *filp, void *dirent, filldir_t filldir) | |||
| 2332 | } | 2315 | } |
| 2333 | } | 2316 | } |
| 2334 | 2317 | ||
| 2335 | out_unlock: | ||
| 2336 | unlock_trace(task); | ||
| 2337 | out_put_task: | 2318 | out_put_task: |
| 2338 | put_task_struct(task); | 2319 | put_task_struct(task); |
| 2339 | out: | 2320 | out: |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 2aa24664a5b5..4d4ac24a263e 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -1,9 +1,10 @@ | |||
| 1 | #ifndef _LINUX_BLKDEV_H | 1 | #ifndef _LINUX_BLKDEV_H |
| 2 | #define _LINUX_BLKDEV_H | 2 | #define _LINUX_BLKDEV_H |
| 3 | 3 | ||
| 4 | #include <linux/sched.h> | ||
| 5 | |||
| 4 | #ifdef CONFIG_BLOCK | 6 | #ifdef CONFIG_BLOCK |
| 5 | 7 | ||
| 6 | #include <linux/sched.h> | ||
| 7 | #include <linux/major.h> | 8 | #include <linux/major.h> |
| 8 | #include <linux/genhd.h> | 9 | #include <linux/genhd.h> |
| 9 | #include <linux/list.h> | 10 | #include <linux/list.h> |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 8de675523e46..25c40b9f848a 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -2051,6 +2051,7 @@ extern void unregister_blkdev(unsigned int, const char *); | |||
| 2051 | extern struct block_device *bdget(dev_t); | 2051 | extern struct block_device *bdget(dev_t); |
| 2052 | extern struct block_device *bdgrab(struct block_device *bdev); | 2052 | extern struct block_device *bdgrab(struct block_device *bdev); |
| 2053 | extern void bd_set_size(struct block_device *, loff_t size); | 2053 | extern void bd_set_size(struct block_device *, loff_t size); |
| 2054 | extern sector_t blkdev_max_block(struct block_device *bdev); | ||
| 2054 | extern void bd_forget(struct inode *inode); | 2055 | extern void bd_forget(struct inode *inode); |
| 2055 | extern void bdput(struct block_device *); | 2056 | extern void bdput(struct block_device *); |
| 2056 | extern void invalidate_bdev(struct block_device *); | 2057 | extern void invalidate_bdev(struct block_device *); |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 5f3f3be5af09..176a939d1547 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -179,6 +179,7 @@ enum { | |||
| 179 | TRACE_EVENT_FL_RECORDED_CMD_BIT, | 179 | TRACE_EVENT_FL_RECORDED_CMD_BIT, |
| 180 | TRACE_EVENT_FL_CAP_ANY_BIT, | 180 | TRACE_EVENT_FL_CAP_ANY_BIT, |
| 181 | TRACE_EVENT_FL_NO_SET_FILTER_BIT, | 181 | TRACE_EVENT_FL_NO_SET_FILTER_BIT, |
| 182 | TRACE_EVENT_FL_IGNORE_ENABLE_BIT, | ||
| 182 | }; | 183 | }; |
| 183 | 184 | ||
| 184 | enum { | 185 | enum { |
| @@ -187,6 +188,7 @@ enum { | |||
| 187 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), | 188 | TRACE_EVENT_FL_RECORDED_CMD = (1 << TRACE_EVENT_FL_RECORDED_CMD_BIT), |
| 188 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), | 189 | TRACE_EVENT_FL_CAP_ANY = (1 << TRACE_EVENT_FL_CAP_ANY_BIT), |
| 189 | TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), | 190 | TRACE_EVENT_FL_NO_SET_FILTER = (1 << TRACE_EVENT_FL_NO_SET_FILTER_BIT), |
| 191 | TRACE_EVENT_FL_IGNORE_ENABLE = (1 << TRACE_EVENT_FL_IGNORE_ENABLE_BIT), | ||
| 190 | }; | 192 | }; |
| 191 | 193 | ||
| 192 | struct ftrace_event_call { | 194 | struct ftrace_event_call { |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index e61d3192448e..017a7fb5a1fc 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -222,12 +222,6 @@ static inline void part_pack_uuid(const u8 *uuid_str, u8 *to) | |||
| 222 | } | 222 | } |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | static inline char *part_unpack_uuid(const u8 *uuid, char *out) | ||
| 226 | { | ||
| 227 | sprintf(out, "%pU", uuid); | ||
| 228 | return out; | ||
| 229 | } | ||
| 230 | |||
| 231 | static inline int disk_max_parts(struct gendisk *disk) | 225 | static inline int disk_max_parts(struct gendisk *disk) |
| 232 | { | 226 | { |
| 233 | if (disk->flags & GENHD_FL_EXT_DEVT) | 227 | if (disk->flags & GENHD_FL_EXT_DEVT) |
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h index 05a5d72680be..230a290e1973 100644 --- a/include/linux/netfilter/ipset/ip_set_ahash.h +++ b/include/linux/netfilter/ipset/ip_set_ahash.h | |||
| @@ -99,6 +99,22 @@ struct ip_set_hash { | |||
| 99 | #endif | 99 | #endif |
| 100 | }; | 100 | }; |
| 101 | 101 | ||
| 102 | static size_t | ||
| 103 | htable_size(u8 hbits) | ||
| 104 | { | ||
| 105 | size_t hsize; | ||
| 106 | |||
| 107 | /* We must fit both into u32 in jhash and size_t */ | ||
| 108 | if (hbits > 31) | ||
| 109 | return 0; | ||
| 110 | hsize = jhash_size(hbits); | ||
| 111 | if ((((size_t)-1) - sizeof(struct htable))/sizeof(struct hbucket) | ||
| 112 | < hsize) | ||
| 113 | return 0; | ||
| 114 | |||
| 115 | return hsize * sizeof(struct hbucket) + sizeof(struct htable); | ||
| 116 | } | ||
| 117 | |||
| 102 | /* Compute htable_bits from the user input parameter hashsize */ | 118 | /* Compute htable_bits from the user input parameter hashsize */ |
| 103 | static u8 | 119 | static u8 |
| 104 | htable_bits(u32 hashsize) | 120 | htable_bits(u32 hashsize) |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 605b0aa8d852..76f439647c4b 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
| @@ -191,7 +191,8 @@ extern void usbnet_cdc_status(struct usbnet *, struct urb *); | |||
| 191 | enum skb_state { | 191 | enum skb_state { |
| 192 | illegal = 0, | 192 | illegal = 0, |
| 193 | tx_start, tx_done, | 193 | tx_start, tx_done, |
| 194 | rx_start, rx_done, rx_cleanup | 194 | rx_start, rx_done, rx_cleanup, |
| 195 | unlink_start | ||
| 195 | }; | 196 | }; |
| 196 | 197 | ||
| 197 | struct skb_data { /* skb->cb is one of these */ | 198 | struct skb_data { /* skb->cb is one of these */ |
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h index b5c2b6cb0d81..cad374bdcf4b 100644 --- a/include/media/soc_camera.h +++ b/include/media/soc_camera.h | |||
| @@ -59,7 +59,8 @@ struct soc_camera_device { | |||
| 59 | struct soc_camera_host { | 59 | struct soc_camera_host { |
| 60 | struct v4l2_device v4l2_dev; | 60 | struct v4l2_device v4l2_dev; |
| 61 | struct list_head list; | 61 | struct list_head list; |
| 62 | unsigned char nr; /* Host number */ | 62 | struct mutex host_lock; /* Protect during probing */ |
| 63 | unsigned char nr; /* Host number */ | ||
| 63 | void *priv; | 64 | void *priv; |
| 64 | const char *drv_name; | 65 | const char *drv_name; |
| 65 | struct soc_camera_host_ops *ops; | 66 | struct soc_camera_host_ops *ops; |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 262ebd1747d4..a65910bda381 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
| @@ -191,6 +191,7 @@ struct bt_sock { | |||
| 191 | struct list_head accept_q; | 191 | struct list_head accept_q; |
| 192 | struct sock *parent; | 192 | struct sock *parent; |
| 193 | u32 defer_setup; | 193 | u32 defer_setup; |
| 194 | bool suspended; | ||
| 194 | }; | 195 | }; |
| 195 | 196 | ||
| 196 | struct bt_sock_list { | 197 | struct bt_sock_list { |
diff --git a/kernel/irq/chip.c b/kernel/irq/chip.c index 6080f6bc8c33..3914c1e03cff 100644 --- a/kernel/irq/chip.c +++ b/kernel/irq/chip.c | |||
| @@ -518,6 +518,7 @@ handle_edge_irq(unsigned int irq, struct irq_desc *desc) | |||
| 518 | out_unlock: | 518 | out_unlock: |
| 519 | raw_spin_unlock(&desc->lock); | 519 | raw_spin_unlock(&desc->lock); |
| 520 | } | 520 | } |
| 521 | EXPORT_SYMBOL(handle_edge_irq); | ||
| 521 | 522 | ||
| 522 | #ifdef CONFIG_IRQ_EDGE_EOI_HANDLER | 523 | #ifdef CONFIG_IRQ_EDGE_EOI_HANDLER |
| 523 | /** | 524 | /** |
diff --git a/kernel/irq/irqdesc.c b/kernel/irq/irqdesc.c index d86e254b95eb..192a302d6cfd 100644 --- a/kernel/irq/irqdesc.c +++ b/kernel/irq/irqdesc.c | |||
| @@ -112,6 +112,7 @@ struct irq_desc *irq_to_desc(unsigned int irq) | |||
| 112 | { | 112 | { |
| 113 | return radix_tree_lookup(&irq_desc_tree, irq); | 113 | return radix_tree_lookup(&irq_desc_tree, irq); |
| 114 | } | 114 | } |
| 115 | EXPORT_SYMBOL(irq_to_desc); | ||
| 115 | 116 | ||
| 116 | static void delete_irq_desc(unsigned int irq) | 117 | static void delete_irq_desc(unsigned int irq) |
| 117 | { | 118 | { |
diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 0533a688ce22..e5212ae294f6 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c | |||
| @@ -6382,6 +6382,8 @@ static int __sdt_alloc(const struct cpumask *cpu_map) | |||
| 6382 | if (!sg) | 6382 | if (!sg) |
| 6383 | return -ENOMEM; | 6383 | return -ENOMEM; |
| 6384 | 6384 | ||
| 6385 | sg->next = sg; | ||
| 6386 | |||
| 6385 | *per_cpu_ptr(sdd->sg, j) = sg; | 6387 | *per_cpu_ptr(sdd->sg, j) = sg; |
| 6386 | 6388 | ||
| 6387 | sgp = kzalloc_node(sizeof(struct sched_group_power), | 6389 | sgp = kzalloc_node(sizeof(struct sched_group_power), |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 079a93ae8a9d..29111da1d100 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
| @@ -294,6 +294,9 @@ static int __ftrace_set_clr_event(const char *match, const char *sub, | |||
| 294 | if (!call->name || !call->class || !call->class->reg) | 294 | if (!call->name || !call->class || !call->class->reg) |
| 295 | continue; | 295 | continue; |
| 296 | 296 | ||
| 297 | if (call->flags & TRACE_EVENT_FL_IGNORE_ENABLE) | ||
| 298 | continue; | ||
| 299 | |||
| 297 | if (match && | 300 | if (match && |
| 298 | strcmp(match, call->name) != 0 && | 301 | strcmp(match, call->name) != 0 && |
| 299 | strcmp(match, call->class->system) != 0) | 302 | strcmp(match, call->class->system) != 0) |
| @@ -1164,7 +1167,7 @@ event_create_dir(struct ftrace_event_call *call, struct dentry *d_events, | |||
| 1164 | return -1; | 1167 | return -1; |
| 1165 | } | 1168 | } |
| 1166 | 1169 | ||
| 1167 | if (call->class->reg) | 1170 | if (call->class->reg && !(call->flags & TRACE_EVENT_FL_IGNORE_ENABLE)) |
| 1168 | trace_create_file("enable", 0644, call->dir, call, | 1171 | trace_create_file("enable", 0644, call->dir, call, |
| 1169 | enable); | 1172 | enable); |
| 1170 | 1173 | ||
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index 3dd15e8bc856..e039906b037d 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
| @@ -180,6 +180,7 @@ struct ftrace_event_call __used event_##call = { \ | |||
| 180 | .event.type = etype, \ | 180 | .event.type = etype, \ |
| 181 | .class = &event_class_ftrace_##call, \ | 181 | .class = &event_class_ftrace_##call, \ |
| 182 | .print_fmt = print, \ | 182 | .print_fmt = print, \ |
| 183 | .flags = TRACE_EVENT_FL_IGNORE_ENABLE, \ | ||
| 183 | }; \ | 184 | }; \ |
| 184 | struct ftrace_event_call __used \ | 185 | struct ftrace_event_call __used \ |
| 185 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call; | 186 | __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call; |
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index b659260c56ad..7685d4a0b3ce 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
| @@ -5481,7 +5481,7 @@ static int mem_cgroup_move_charge_pte_range(pmd_t *pmd, | |||
| 5481 | * part of thp split is not executed yet. | 5481 | * part of thp split is not executed yet. |
| 5482 | */ | 5482 | */ |
| 5483 | if (pmd_trans_huge_lock(pmd, vma) == 1) { | 5483 | if (pmd_trans_huge_lock(pmd, vma) == 1) { |
| 5484 | if (!mc.precharge) { | 5484 | if (mc.precharge < HPAGE_PMD_NR) { |
| 5485 | spin_unlock(&vma->vm_mm->page_table_lock); | 5485 | spin_unlock(&vma->vm_mm->page_table_lock); |
| 5486 | return 0; | 5486 | return 0; |
| 5487 | } | 5487 | } |
| @@ -2040,7 +2040,7 @@ static bool has_cpu_slab(int cpu, void *info) | |||
| 2040 | struct kmem_cache *s = info; | 2040 | struct kmem_cache *s = info; |
| 2041 | struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu); | 2041 | struct kmem_cache_cpu *c = per_cpu_ptr(s->cpu_slab, cpu); |
| 2042 | 2042 | ||
| 2043 | return !!(c->page); | 2043 | return c->page || c->partial; |
| 2044 | } | 2044 | } |
| 2045 | 2045 | ||
| 2046 | static void flush_all(struct kmem_cache *s) | 2046 | static void flush_all(struct kmem_cache *s) |
diff --git a/net/bluetooth/af_bluetooth.c b/net/bluetooth/af_bluetooth.c index 72eb187a5f60..6fb68a9743af 100644 --- a/net/bluetooth/af_bluetooth.c +++ b/net/bluetooth/af_bluetooth.c | |||
| @@ -450,7 +450,7 @@ unsigned int bt_sock_poll(struct file *file, struct socket *sock, poll_table *wa | |||
| 450 | sk->sk_state == BT_CONFIG) | 450 | sk->sk_state == BT_CONFIG) |
| 451 | return mask; | 451 | return mask; |
| 452 | 452 | ||
| 453 | if (sock_writeable(sk)) | 453 | if (!bt_sk(sk)->suspended && sock_writeable(sk)) |
| 454 | mask |= POLLOUT | POLLWRNORM | POLLWRBAND; | 454 | mask |= POLLOUT | POLLWRNORM | POLLWRBAND; |
| 455 | else | 455 | else |
| 456 | set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); | 456 | set_bit(SOCK_ASYNC_NOSPACE, &sk->sk_socket->flags); |
diff --git a/net/bluetooth/hci_core.c b/net/bluetooth/hci_core.c index edfd61addcec..d6dc44cd15b0 100644 --- a/net/bluetooth/hci_core.c +++ b/net/bluetooth/hci_core.c | |||
| @@ -2784,6 +2784,14 @@ static inline void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb) | |||
| 2784 | if (conn) { | 2784 | if (conn) { |
| 2785 | hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF); | 2785 | hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF); |
| 2786 | 2786 | ||
| 2787 | hci_dev_lock(hdev); | ||
| 2788 | if (test_bit(HCI_MGMT, &hdev->dev_flags) && | ||
| 2789 | !test_and_set_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) | ||
| 2790 | mgmt_device_connected(hdev, &conn->dst, conn->type, | ||
| 2791 | conn->dst_type, 0, NULL, 0, | ||
| 2792 | conn->dev_class); | ||
| 2793 | hci_dev_unlock(hdev); | ||
| 2794 | |||
| 2787 | /* Send to upper protocol */ | 2795 | /* Send to upper protocol */ |
| 2788 | l2cap_recv_acldata(conn, skb, flags); | 2796 | l2cap_recv_acldata(conn, skb, flags); |
| 2789 | return; | 2797 | return; |
diff --git a/net/bluetooth/hci_event.c b/net/bluetooth/hci_event.c index 6c065254afc0..1266f78fa8e3 100644 --- a/net/bluetooth/hci_event.c +++ b/net/bluetooth/hci_event.c | |||
| @@ -2039,6 +2039,12 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff * | |||
| 2039 | 2039 | ||
| 2040 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); | 2040 | clear_bit(HCI_CONN_ENCRYPT_PEND, &conn->flags); |
| 2041 | 2041 | ||
| 2042 | if (ev->status && conn->state == BT_CONNECTED) { | ||
| 2043 | hci_acl_disconn(conn, 0x13); | ||
| 2044 | hci_conn_put(conn); | ||
| 2045 | goto unlock; | ||
| 2046 | } | ||
| 2047 | |||
| 2042 | if (conn->state == BT_CONFIG) { | 2048 | if (conn->state == BT_CONFIG) { |
| 2043 | if (!ev->status) | 2049 | if (!ev->status) |
| 2044 | conn->state = BT_CONNECTED; | 2050 | conn->state = BT_CONNECTED; |
| @@ -2049,6 +2055,7 @@ static inline void hci_encrypt_change_evt(struct hci_dev *hdev, struct sk_buff * | |||
| 2049 | hci_encrypt_cfm(conn, ev->status, ev->encrypt); | 2055 | hci_encrypt_cfm(conn, ev->status, ev->encrypt); |
| 2050 | } | 2056 | } |
| 2051 | 2057 | ||
| 2058 | unlock: | ||
| 2052 | hci_dev_unlock(hdev); | 2059 | hci_dev_unlock(hdev); |
| 2053 | } | 2060 | } |
| 2054 | 2061 | ||
| @@ -2102,7 +2109,7 @@ static inline void hci_remote_features_evt(struct hci_dev *hdev, struct sk_buff | |||
| 2102 | goto unlock; | 2109 | goto unlock; |
| 2103 | } | 2110 | } |
| 2104 | 2111 | ||
| 2105 | if (!ev->status) { | 2112 | if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { |
| 2106 | struct hci_cp_remote_name_req cp; | 2113 | struct hci_cp_remote_name_req cp; |
| 2107 | memset(&cp, 0, sizeof(cp)); | 2114 | memset(&cp, 0, sizeof(cp)); |
| 2108 | bacpy(&cp.bdaddr, &conn->dst); | 2115 | bacpy(&cp.bdaddr, &conn->dst); |
| @@ -2871,7 +2878,7 @@ static inline void hci_remote_ext_features_evt(struct hci_dev *hdev, struct sk_b | |||
| 2871 | if (conn->state != BT_CONFIG) | 2878 | if (conn->state != BT_CONFIG) |
| 2872 | goto unlock; | 2879 | goto unlock; |
| 2873 | 2880 | ||
| 2874 | if (!ev->status) { | 2881 | if (!ev->status && !test_bit(HCI_CONN_MGMT_CONNECTED, &conn->flags)) { |
| 2875 | struct hci_cp_remote_name_req cp; | 2882 | struct hci_cp_remote_name_req cp; |
| 2876 | memset(&cp, 0, sizeof(cp)); | 2883 | memset(&cp, 0, sizeof(cp)); |
| 2877 | bacpy(&cp.bdaddr, &conn->dst); | 2884 | bacpy(&cp.bdaddr, &conn->dst); |
diff --git a/net/bluetooth/l2cap_core.c b/net/bluetooth/l2cap_core.c index 94552b33d528..6f9c25b633a6 100644 --- a/net/bluetooth/l2cap_core.c +++ b/net/bluetooth/l2cap_core.c | |||
| @@ -4589,6 +4589,11 @@ int l2cap_security_cfm(struct hci_conn *hcon, u8 status, u8 encrypt) | |||
| 4589 | 4589 | ||
| 4590 | if (!status && (chan->state == BT_CONNECTED || | 4590 | if (!status && (chan->state == BT_CONNECTED || |
| 4591 | chan->state == BT_CONFIG)) { | 4591 | chan->state == BT_CONFIG)) { |
| 4592 | struct sock *sk = chan->sk; | ||
| 4593 | |||
| 4594 | bt_sk(sk)->suspended = false; | ||
| 4595 | sk->sk_state_change(sk); | ||
| 4596 | |||
| 4592 | l2cap_check_encryption(chan, encrypt); | 4597 | l2cap_check_encryption(chan, encrypt); |
| 4593 | l2cap_chan_unlock(chan); | 4598 | l2cap_chan_unlock(chan); |
| 4594 | continue; | 4599 | continue; |
diff --git a/net/bluetooth/l2cap_sock.c b/net/bluetooth/l2cap_sock.c index 29122ed28ea9..04e7c172d49c 100644 --- a/net/bluetooth/l2cap_sock.c +++ b/net/bluetooth/l2cap_sock.c | |||
| @@ -592,10 +592,14 @@ static int l2cap_sock_setsockopt(struct socket *sock, int level, int optname, ch | |||
| 592 | sk->sk_state = BT_CONFIG; | 592 | sk->sk_state = BT_CONFIG; |
| 593 | chan->state = BT_CONFIG; | 593 | chan->state = BT_CONFIG; |
| 594 | 594 | ||
| 595 | /* or for ACL link, under defer_setup time */ | 595 | /* or for ACL link */ |
| 596 | } else if (sk->sk_state == BT_CONNECT2 && | 596 | } else if ((sk->sk_state == BT_CONNECT2 && |
| 597 | bt_sk(sk)->defer_setup) { | 597 | bt_sk(sk)->defer_setup) || |
| 598 | err = l2cap_chan_check_security(chan); | 598 | sk->sk_state == BT_CONNECTED) { |
| 599 | if (!l2cap_chan_check_security(chan)) | ||
| 600 | bt_sk(sk)->suspended = true; | ||
| 601 | else | ||
| 602 | sk->sk_state_change(sk); | ||
| 599 | } else { | 603 | } else { |
| 600 | err = -EINVAL; | 604 | err = -EINVAL; |
| 601 | } | 605 | } |
diff --git a/net/core/pktgen.c b/net/core/pktgen.c index 77a59980b579..b81369b6ddc0 100644 --- a/net/core/pktgen.c +++ b/net/core/pktgen.c | |||
| @@ -3755,13 +3755,13 @@ static void __exit pg_cleanup(void) | |||
| 3755 | { | 3755 | { |
| 3756 | struct pktgen_thread *t; | 3756 | struct pktgen_thread *t; |
| 3757 | struct list_head *q, *n; | 3757 | struct list_head *q, *n; |
| 3758 | struct list_head list; | 3758 | LIST_HEAD(list); |
| 3759 | 3759 | ||
| 3760 | /* Stop all interfaces & threads */ | 3760 | /* Stop all interfaces & threads */ |
| 3761 | pktgen_exiting = true; | 3761 | pktgen_exiting = true; |
| 3762 | 3762 | ||
| 3763 | mutex_lock(&pktgen_thread_lock); | 3763 | mutex_lock(&pktgen_thread_lock); |
| 3764 | list_splice(&list, &pktgen_threads); | 3764 | list_splice_init(&pktgen_threads, &list); |
| 3765 | mutex_unlock(&pktgen_thread_lock); | 3765 | mutex_unlock(&pktgen_thread_lock); |
| 3766 | 3766 | ||
| 3767 | list_for_each_safe(q, n, &list) { | 3767 | list_for_each_safe(q, n, &list) { |
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 1272a88c2a63..6589e11d57b6 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c | |||
| @@ -851,8 +851,7 @@ new_segment: | |||
| 851 | wait_for_sndbuf: | 851 | wait_for_sndbuf: |
| 852 | set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); | 852 | set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); |
| 853 | wait_for_memory: | 853 | wait_for_memory: |
| 854 | if (copied) | 854 | tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH); |
| 855 | tcp_push(sk, flags & ~MSG_MORE, mss_now, TCP_NAGLE_PUSH); | ||
| 856 | 855 | ||
| 857 | if ((err = sk_stream_wait_memory(sk, &timeo)) != 0) | 856 | if ((err = sk_stream_wait_memory(sk, &timeo)) != 0) |
| 858 | goto do_error; | 857 | goto do_error; |
diff --git a/net/netfilter/ipset/ip_set_hash_ip.c b/net/netfilter/ipset/ip_set_hash_ip.c index 5139dea6019e..828ce46cb34b 100644 --- a/net/netfilter/ipset/ip_set_hash_ip.c +++ b/net/netfilter/ipset/ip_set_hash_ip.c | |||
| @@ -364,6 +364,7 @@ hash_ip_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 364 | { | 364 | { |
| 365 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 365 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
| 366 | u8 netmask, hbits; | 366 | u8 netmask, hbits; |
| 367 | size_t hsize; | ||
| 367 | struct ip_set_hash *h; | 368 | struct ip_set_hash *h; |
| 368 | 369 | ||
| 369 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 370 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
| @@ -405,9 +406,12 @@ hash_ip_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 405 | h->timeout = IPSET_NO_TIMEOUT; | 406 | h->timeout = IPSET_NO_TIMEOUT; |
| 406 | 407 | ||
| 407 | hbits = htable_bits(hashsize); | 408 | hbits = htable_bits(hashsize); |
| 408 | h->table = ip_set_alloc( | 409 | hsize = htable_size(hbits); |
| 409 | sizeof(struct htable) | 410 | if (hsize == 0) { |
| 410 | + jhash_size(hbits) * sizeof(struct hbucket)); | 411 | kfree(h); |
| 412 | return -ENOMEM; | ||
| 413 | } | ||
| 414 | h->table = ip_set_alloc(hsize); | ||
| 411 | if (!h->table) { | 415 | if (!h->table) { |
| 412 | kfree(h); | 416 | kfree(h); |
| 413 | return -ENOMEM; | 417 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_ipport.c b/net/netfilter/ipset/ip_set_hash_ipport.c index 9c27e249c171..e8dbb498af8f 100644 --- a/net/netfilter/ipset/ip_set_hash_ipport.c +++ b/net/netfilter/ipset/ip_set_hash_ipport.c | |||
| @@ -449,6 +449,7 @@ hash_ipport_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 449 | struct ip_set_hash *h; | 449 | struct ip_set_hash *h; |
| 450 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 450 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
| 451 | u8 hbits; | 451 | u8 hbits; |
| 452 | size_t hsize; | ||
| 452 | 453 | ||
| 453 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 454 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
| 454 | return -IPSET_ERR_INVALID_FAMILY; | 455 | return -IPSET_ERR_INVALID_FAMILY; |
| @@ -476,9 +477,12 @@ hash_ipport_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 476 | h->timeout = IPSET_NO_TIMEOUT; | 477 | h->timeout = IPSET_NO_TIMEOUT; |
| 477 | 478 | ||
| 478 | hbits = htable_bits(hashsize); | 479 | hbits = htable_bits(hashsize); |
| 479 | h->table = ip_set_alloc( | 480 | hsize = htable_size(hbits); |
| 480 | sizeof(struct htable) | 481 | if (hsize == 0) { |
| 481 | + jhash_size(hbits) * sizeof(struct hbucket)); | 482 | kfree(h); |
| 483 | return -ENOMEM; | ||
| 484 | } | ||
| 485 | h->table = ip_set_alloc(hsize); | ||
| 482 | if (!h->table) { | 486 | if (!h->table) { |
| 483 | kfree(h); | 487 | kfree(h); |
| 484 | return -ENOMEM; | 488 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_ipportip.c b/net/netfilter/ipset/ip_set_hash_ipportip.c index 9134057c0728..52f79d8ef741 100644 --- a/net/netfilter/ipset/ip_set_hash_ipportip.c +++ b/net/netfilter/ipset/ip_set_hash_ipportip.c | |||
| @@ -467,6 +467,7 @@ hash_ipportip_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 467 | struct ip_set_hash *h; | 467 | struct ip_set_hash *h; |
| 468 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 468 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
| 469 | u8 hbits; | 469 | u8 hbits; |
| 470 | size_t hsize; | ||
| 470 | 471 | ||
| 471 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 472 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
| 472 | return -IPSET_ERR_INVALID_FAMILY; | 473 | return -IPSET_ERR_INVALID_FAMILY; |
| @@ -494,9 +495,12 @@ hash_ipportip_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 494 | h->timeout = IPSET_NO_TIMEOUT; | 495 | h->timeout = IPSET_NO_TIMEOUT; |
| 495 | 496 | ||
| 496 | hbits = htable_bits(hashsize); | 497 | hbits = htable_bits(hashsize); |
| 497 | h->table = ip_set_alloc( | 498 | hsize = htable_size(hbits); |
| 498 | sizeof(struct htable) | 499 | if (hsize == 0) { |
| 499 | + jhash_size(hbits) * sizeof(struct hbucket)); | 500 | kfree(h); |
| 501 | return -ENOMEM; | ||
| 502 | } | ||
| 503 | h->table = ip_set_alloc(hsize); | ||
| 500 | if (!h->table) { | 504 | if (!h->table) { |
| 501 | kfree(h); | 505 | kfree(h); |
| 502 | return -ENOMEM; | 506 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_ipportnet.c b/net/netfilter/ipset/ip_set_hash_ipportnet.c index 5d05e6969862..97583f5af745 100644 --- a/net/netfilter/ipset/ip_set_hash_ipportnet.c +++ b/net/netfilter/ipset/ip_set_hash_ipportnet.c | |||
| @@ -616,6 +616,7 @@ hash_ipportnet_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 616 | struct ip_set_hash *h; | 616 | struct ip_set_hash *h; |
| 617 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 617 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
| 618 | u8 hbits; | 618 | u8 hbits; |
| 619 | size_t hsize; | ||
| 619 | 620 | ||
| 620 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 621 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
| 621 | return -IPSET_ERR_INVALID_FAMILY; | 622 | return -IPSET_ERR_INVALID_FAMILY; |
| @@ -645,9 +646,12 @@ hash_ipportnet_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 645 | h->timeout = IPSET_NO_TIMEOUT; | 646 | h->timeout = IPSET_NO_TIMEOUT; |
| 646 | 647 | ||
| 647 | hbits = htable_bits(hashsize); | 648 | hbits = htable_bits(hashsize); |
| 648 | h->table = ip_set_alloc( | 649 | hsize = htable_size(hbits); |
| 649 | sizeof(struct htable) | 650 | if (hsize == 0) { |
| 650 | + jhash_size(hbits) * sizeof(struct hbucket)); | 651 | kfree(h); |
| 652 | return -ENOMEM; | ||
| 653 | } | ||
| 654 | h->table = ip_set_alloc(hsize); | ||
| 651 | if (!h->table) { | 655 | if (!h->table) { |
| 652 | kfree(h); | 656 | kfree(h); |
| 653 | return -ENOMEM; | 657 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_net.c b/net/netfilter/ipset/ip_set_hash_net.c index 7c3d945517cf..1721cdecc9f9 100644 --- a/net/netfilter/ipset/ip_set_hash_net.c +++ b/net/netfilter/ipset/ip_set_hash_net.c | |||
| @@ -460,6 +460,7 @@ hash_net_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 460 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 460 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
| 461 | struct ip_set_hash *h; | 461 | struct ip_set_hash *h; |
| 462 | u8 hbits; | 462 | u8 hbits; |
| 463 | size_t hsize; | ||
| 463 | 464 | ||
| 464 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 465 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
| 465 | return -IPSET_ERR_INVALID_FAMILY; | 466 | return -IPSET_ERR_INVALID_FAMILY; |
| @@ -489,9 +490,12 @@ hash_net_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 489 | h->timeout = IPSET_NO_TIMEOUT; | 490 | h->timeout = IPSET_NO_TIMEOUT; |
| 490 | 491 | ||
| 491 | hbits = htable_bits(hashsize); | 492 | hbits = htable_bits(hashsize); |
| 492 | h->table = ip_set_alloc( | 493 | hsize = htable_size(hbits); |
| 493 | sizeof(struct htable) | 494 | if (hsize == 0) { |
| 494 | + jhash_size(hbits) * sizeof(struct hbucket)); | 495 | kfree(h); |
| 496 | return -ENOMEM; | ||
| 497 | } | ||
| 498 | h->table = ip_set_alloc(hsize); | ||
| 495 | if (!h->table) { | 499 | if (!h->table) { |
| 496 | kfree(h); | 500 | kfree(h); |
| 497 | return -ENOMEM; | 501 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_netiface.c b/net/netfilter/ipset/ip_set_hash_netiface.c index f24037ff4322..33bafc97ca6d 100644 --- a/net/netfilter/ipset/ip_set_hash_netiface.c +++ b/net/netfilter/ipset/ip_set_hash_netiface.c | |||
| @@ -722,6 +722,7 @@ hash_netiface_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 722 | struct ip_set_hash *h; | 722 | struct ip_set_hash *h; |
| 723 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 723 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
| 724 | u8 hbits; | 724 | u8 hbits; |
| 725 | size_t hsize; | ||
| 725 | 726 | ||
| 726 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 727 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
| 727 | return -IPSET_ERR_INVALID_FAMILY; | 728 | return -IPSET_ERR_INVALID_FAMILY; |
| @@ -752,9 +753,12 @@ hash_netiface_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 752 | h->ahash_max = AHASH_MAX_SIZE; | 753 | h->ahash_max = AHASH_MAX_SIZE; |
| 753 | 754 | ||
| 754 | hbits = htable_bits(hashsize); | 755 | hbits = htable_bits(hashsize); |
| 755 | h->table = ip_set_alloc( | 756 | hsize = htable_size(hbits); |
| 756 | sizeof(struct htable) | 757 | if (hsize == 0) { |
| 757 | + jhash_size(hbits) * sizeof(struct hbucket)); | 758 | kfree(h); |
| 759 | return -ENOMEM; | ||
| 760 | } | ||
| 761 | h->table = ip_set_alloc(hsize); | ||
| 758 | if (!h->table) { | 762 | if (!h->table) { |
| 759 | kfree(h); | 763 | kfree(h); |
| 760 | return -ENOMEM; | 764 | return -ENOMEM; |
diff --git a/net/netfilter/ipset/ip_set_hash_netport.c b/net/netfilter/ipset/ip_set_hash_netport.c index ce2e77100b64..3a5e198641d6 100644 --- a/net/netfilter/ipset/ip_set_hash_netport.c +++ b/net/netfilter/ipset/ip_set_hash_netport.c | |||
| @@ -572,6 +572,7 @@ hash_netport_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 572 | struct ip_set_hash *h; | 572 | struct ip_set_hash *h; |
| 573 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; | 573 | u32 hashsize = IPSET_DEFAULT_HASHSIZE, maxelem = IPSET_DEFAULT_MAXELEM; |
| 574 | u8 hbits; | 574 | u8 hbits; |
| 575 | size_t hsize; | ||
| 575 | 576 | ||
| 576 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) | 577 | if (!(set->family == NFPROTO_IPV4 || set->family == NFPROTO_IPV6)) |
| 577 | return -IPSET_ERR_INVALID_FAMILY; | 578 | return -IPSET_ERR_INVALID_FAMILY; |
| @@ -601,9 +602,12 @@ hash_netport_create(struct ip_set *set, struct nlattr *tb[], u32 flags) | |||
| 601 | h->timeout = IPSET_NO_TIMEOUT; | 602 | h->timeout = IPSET_NO_TIMEOUT; |
| 602 | 603 | ||
| 603 | hbits = htable_bits(hashsize); | 604 | hbits = htable_bits(hashsize); |
| 604 | h->table = ip_set_alloc( | 605 | hsize = htable_size(hbits); |
| 605 | sizeof(struct htable) | 606 | if (hsize == 0) { |
| 606 | + jhash_size(hbits) * sizeof(struct hbucket)); | 607 | kfree(h); |
| 608 | return -ENOMEM; | ||
| 609 | } | ||
| 610 | h->table = ip_set_alloc(hsize); | ||
| 607 | if (!h->table) { | 611 | if (!h->table) { |
| 608 | kfree(h); | 612 | kfree(h); |
| 609 | return -ENOMEM; | 613 | return -ENOMEM; |
diff --git a/net/openvswitch/datapath.c b/net/openvswitch/datapath.c index 777716bc80f7..e66341ec455c 100644 --- a/net/openvswitch/datapath.c +++ b/net/openvswitch/datapath.c | |||
| @@ -321,7 +321,7 @@ static int queue_userspace_packet(int dp_ifindex, struct sk_buff *skb, | |||
| 321 | return -ENOMEM; | 321 | return -ENOMEM; |
| 322 | 322 | ||
| 323 | nskb = __vlan_put_tag(nskb, vlan_tx_tag_get(nskb)); | 323 | nskb = __vlan_put_tag(nskb, vlan_tx_tag_get(nskb)); |
| 324 | if (!skb) | 324 | if (!nskb) |
| 325 | return -ENOMEM; | 325 | return -ENOMEM; |
| 326 | 326 | ||
| 327 | nskb->vlan_tci = 0; | 327 | nskb->vlan_tci = 0; |
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c index 4742cac26aa9..2cb1e08f962a 100644 --- a/sound/pci/hda/patch_sigmatel.c +++ b/sound/pci/hda/patch_sigmatel.c | |||
| @@ -4415,9 +4415,9 @@ static int stac92xx_init(struct hda_codec *codec) | |||
| 4415 | def_conf = get_defcfg_connect(def_conf); | 4415 | def_conf = get_defcfg_connect(def_conf); |
| 4416 | /* skip any ports that don't have jacks since presence | 4416 | /* skip any ports that don't have jacks since presence |
| 4417 | * detection is useless */ | 4417 | * detection is useless */ |
| 4418 | if (def_conf != AC_JACK_PORT_COMPLEX) { | 4418 | if (def_conf != AC_JACK_PORT_NONE && |
| 4419 | if (def_conf != AC_JACK_PORT_NONE) | 4419 | !is_jack_detectable(codec, nid)) { |
| 4420 | stac_toggle_power_map(codec, nid, 1); | 4420 | stac_toggle_power_map(codec, nid, 1); |
| 4421 | continue; | 4421 | continue; |
| 4422 | } | 4422 | } |
| 4423 | if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) { | 4423 | if (enable_pin_detect(codec, nid, STAC_PWR_EVENT)) { |
diff --git a/sound/soc/codecs/cs42l73.c b/sound/soc/codecs/cs42l73.c index 07c44b71f096..3686417f5ea5 100644 --- a/sound/soc/codecs/cs42l73.c +++ b/sound/soc/codecs/cs42l73.c | |||
| @@ -568,22 +568,22 @@ static const struct snd_kcontrol_new cs42l73_snd_controls[] = { | |||
| 568 | attn_tlv), | 568 | attn_tlv), |
| 569 | 569 | ||
| 570 | SOC_SINGLE_TLV("SPK-IP Mono Volume", | 570 | SOC_SINGLE_TLV("SPK-IP Mono Volume", |
| 571 | CS42L73_SPKMIPMA, 0, 0x3E, 1, attn_tlv), | 571 | CS42L73_SPKMIPMA, 0, 0x3F, 1, attn_tlv), |
| 572 | SOC_SINGLE_TLV("SPK-XSP Mono Volume", | 572 | SOC_SINGLE_TLV("SPK-XSP Mono Volume", |
| 573 | CS42L73_SPKMXSPA, 0, 0x3E, 1, attn_tlv), | 573 | CS42L73_SPKMXSPA, 0, 0x3F, 1, attn_tlv), |
| 574 | SOC_SINGLE_TLV("SPK-ASP Mono Volume", | 574 | SOC_SINGLE_TLV("SPK-ASP Mono Volume", |
| 575 | CS42L73_SPKMASPA, 0, 0x3E, 1, attn_tlv), | 575 | CS42L73_SPKMASPA, 0, 0x3F, 1, attn_tlv), |
| 576 | SOC_SINGLE_TLV("SPK-VSP Mono Volume", | 576 | SOC_SINGLE_TLV("SPK-VSP Mono Volume", |
| 577 | CS42L73_SPKMVSPMA, 0, 0x3E, 1, attn_tlv), | 577 | CS42L73_SPKMVSPMA, 0, 0x3F, 1, attn_tlv), |
| 578 | 578 | ||
| 579 | SOC_SINGLE_TLV("ESL-IP Mono Volume", | 579 | SOC_SINGLE_TLV("ESL-IP Mono Volume", |
| 580 | CS42L73_ESLMIPMA, 0, 0x3E, 1, attn_tlv), | 580 | CS42L73_ESLMIPMA, 0, 0x3F, 1, attn_tlv), |
| 581 | SOC_SINGLE_TLV("ESL-XSP Mono Volume", | 581 | SOC_SINGLE_TLV("ESL-XSP Mono Volume", |
| 582 | CS42L73_ESLMXSPA, 0, 0x3E, 1, attn_tlv), | 582 | CS42L73_ESLMXSPA, 0, 0x3F, 1, attn_tlv), |
| 583 | SOC_SINGLE_TLV("ESL-ASP Mono Volume", | 583 | SOC_SINGLE_TLV("ESL-ASP Mono Volume", |
| 584 | CS42L73_ESLMASPA, 0, 0x3E, 1, attn_tlv), | 584 | CS42L73_ESLMASPA, 0, 0x3F, 1, attn_tlv), |
| 585 | SOC_SINGLE_TLV("ESL-VSP Mono Volume", | 585 | SOC_SINGLE_TLV("ESL-VSP Mono Volume", |
| 586 | CS42L73_ESLMVSPMA, 0, 0x3E, 1, attn_tlv), | 586 | CS42L73_ESLMVSPMA, 0, 0x3F, 1, attn_tlv), |
| 587 | 587 | ||
| 588 | SOC_ENUM("IP Digital Swap/Mono Select", ip_swap_enum), | 588 | SOC_ENUM("IP Digital Swap/Mono Select", ip_swap_enum), |
| 589 | 589 | ||
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c index 6c1fe3afd4b5..2de12ebe43b5 100644 --- a/sound/soc/codecs/wm8994.c +++ b/sound/soc/codecs/wm8994.c | |||
| @@ -1144,7 +1144,7 @@ static int aif2clk_ev(struct snd_soc_dapm_widget *w, | |||
| 1144 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, | 1144 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, |
| 1145 | WM8994_AIF2DACL_ENA | | 1145 | WM8994_AIF2DACL_ENA | |
| 1146 | WM8994_AIF2DACR_ENA, 0); | 1146 | WM8994_AIF2DACR_ENA, 0); |
| 1147 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_5, | 1147 | snd_soc_update_bits(codec, WM8994_POWER_MANAGEMENT_4, |
| 1148 | WM8994_AIF2ADCL_ENA | | 1148 | WM8994_AIF2ADCL_ENA | |
| 1149 | WM8994_AIF2ADCR_ENA, 0); | 1149 | WM8994_AIF2ADCR_ENA, 0); |
| 1150 | 1150 | ||
diff --git a/tools/perf/Makefile b/tools/perf/Makefile index 9bf3fc759344..92271d32bc30 100644 --- a/tools/perf/Makefile +++ b/tools/perf/Makefile | |||
| @@ -774,10 +774,10 @@ $(OUTPUT)perf.o perf.spec \ | |||
| 774 | # over the general rule for .o | 774 | # over the general rule for .o |
| 775 | 775 | ||
| 776 | $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS | 776 | $(OUTPUT)util/%-flex.o: $(OUTPUT)util/%-flex.c $(OUTPUT)PERF-CFLAGS |
| 777 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $< | 777 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -Iutil/ -w $< |
| 778 | 778 | ||
| 779 | $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS | 779 | $(OUTPUT)util/%-bison.o: $(OUTPUT)util/%-bison.c $(OUTPUT)PERF-CFLAGS |
| 780 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -Wno-redundant-decls -Wno-switch-default -Wno-unused-function $< | 780 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) -DYYENABLE_NLS=0 -DYYLTYPE_IS_TRIVIAL=0 -Iutil/ -w $< |
| 781 | 781 | ||
| 782 | $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS | 782 | $(OUTPUT)%.o: %.c $(OUTPUT)PERF-CFLAGS |
| 783 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< | 783 | $(QUIET_CC)$(CC) -o $@ -c $(ALL_CFLAGS) $< |
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index c941bb640f49..1e5e9b270f5e 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c | |||
| @@ -283,6 +283,8 @@ static int create_perf_stat_counter(struct perf_evsel *evsel, | |||
| 283 | { | 283 | { |
| 284 | struct perf_event_attr *attr = &evsel->attr; | 284 | struct perf_event_attr *attr = &evsel->attr; |
| 285 | struct xyarray *group_fd = NULL; | 285 | struct xyarray *group_fd = NULL; |
| 286 | bool exclude_guest_missing = false; | ||
| 287 | int ret; | ||
| 286 | 288 | ||
| 287 | if (group && evsel != first) | 289 | if (group && evsel != first) |
| 288 | group_fd = first->fd; | 290 | group_fd = first->fd; |
| @@ -293,16 +295,39 @@ static int create_perf_stat_counter(struct perf_evsel *evsel, | |||
| 293 | 295 | ||
| 294 | attr->inherit = !no_inherit; | 296 | attr->inherit = !no_inherit; |
| 295 | 297 | ||
| 296 | if (system_wide) | 298 | retry: |
| 297 | return perf_evsel__open_per_cpu(evsel, evsel_list->cpus, | 299 | if (exclude_guest_missing) |
| 300 | evsel->attr.exclude_guest = evsel->attr.exclude_host = 0; | ||
| 301 | |||
| 302 | if (system_wide) { | ||
| 303 | ret = perf_evsel__open_per_cpu(evsel, evsel_list->cpus, | ||
| 298 | group, group_fd); | 304 | group, group_fd); |
| 305 | if (ret) | ||
| 306 | goto check_ret; | ||
| 307 | return 0; | ||
| 308 | } | ||
| 309 | |||
| 299 | if (!target_pid && !target_tid && (!group || evsel == first)) { | 310 | if (!target_pid && !target_tid && (!group || evsel == first)) { |
| 300 | attr->disabled = 1; | 311 | attr->disabled = 1; |
| 301 | attr->enable_on_exec = 1; | 312 | attr->enable_on_exec = 1; |
| 302 | } | 313 | } |
| 303 | 314 | ||
| 304 | return perf_evsel__open_per_thread(evsel, evsel_list->threads, | 315 | ret = perf_evsel__open_per_thread(evsel, evsel_list->threads, |
| 305 | group, group_fd); | 316 | group, group_fd); |
| 317 | if (!ret) | ||
| 318 | return 0; | ||
| 319 | /* fall through */ | ||
| 320 | check_ret: | ||
| 321 | if (ret && errno == EINVAL) { | ||
| 322 | if (!exclude_guest_missing && | ||
| 323 | (evsel->attr.exclude_guest || evsel->attr.exclude_host)) { | ||
| 324 | pr_debug("Old kernel, cannot exclude " | ||
| 325 | "guest or host samples.\n"); | ||
| 326 | exclude_guest_missing = true; | ||
| 327 | goto retry; | ||
| 328 | } | ||
| 329 | } | ||
| 330 | return ret; | ||
| 306 | } | 331 | } |
| 307 | 332 | ||
| 308 | /* | 333 | /* |
| @@ -463,8 +488,13 @@ static int run_perf_stat(int argc __used, const char **argv) | |||
| 463 | 488 | ||
| 464 | list_for_each_entry(counter, &evsel_list->entries, node) { | 489 | list_for_each_entry(counter, &evsel_list->entries, node) { |
| 465 | if (create_perf_stat_counter(counter, first) < 0) { | 490 | if (create_perf_stat_counter(counter, first) < 0) { |
| 491 | /* | ||
| 492 | * PPC returns ENXIO for HW counters until 2.6.37 | ||
| 493 | * (behavior changed with commit b0a873e). | ||
| 494 | */ | ||
| 466 | if (errno == EINVAL || errno == ENOSYS || | 495 | if (errno == EINVAL || errno == ENOSYS || |
| 467 | errno == ENOENT || errno == EOPNOTSUPP) { | 496 | errno == ENOENT || errno == EOPNOTSUPP || |
| 497 | errno == ENXIO) { | ||
| 468 | if (verbose) | 498 | if (verbose) |
| 469 | ui__warning("%s event is not supported by the kernel.\n", | 499 | ui__warning("%s event is not supported by the kernel.\n", |
| 470 | event_name(counter)); | 500 | event_name(counter)); |
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index 4c7c2d73251f..c0b70c697a36 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c | |||
| @@ -296,7 +296,7 @@ int build_id_cache__add_s(const char *sbuild_id, const char *debugdir, | |||
| 296 | if (mkdir_p(filename, 0755)) | 296 | if (mkdir_p(filename, 0755)) |
| 297 | goto out_free; | 297 | goto out_free; |
| 298 | 298 | ||
| 299 | snprintf(filename + len, sizeof(filename) - len, "/%s", sbuild_id); | 299 | snprintf(filename + len, size - len, "/%s", sbuild_id); |
| 300 | 300 | ||
| 301 | if (access(filename, F_OK)) { | 301 | if (access(filename, F_OK)) { |
| 302 | if (is_kallsyms) { | 302 | if (is_kallsyms) { |
