diff options
102 files changed, 617 insertions, 288 deletions
| @@ -102,6 +102,7 @@ Leonid I Ananiev <leonid.i.ananiev@intel.com> | |||
| 102 | Linas Vepstas <linas@austin.ibm.com> | 102 | Linas Vepstas <linas@austin.ibm.com> |
| 103 | Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@web.de> | 103 | Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@web.de> |
| 104 | Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@ascom.ch> | 104 | Linus Lüssing <linus.luessing@c0d3.blue> <linus.luessing@ascom.ch> |
| 105 | Maciej W. Rozycki <macro@mips.com> <macro@imgtec.com> | ||
| 105 | Marcin Nowakowski <marcin.nowakowski@mips.com> <marcin.nowakowski@imgtec.com> | 106 | Marcin Nowakowski <marcin.nowakowski@mips.com> <marcin.nowakowski@imgtec.com> |
| 106 | Mark Brown <broonie@sirena.org.uk> | 107 | Mark Brown <broonie@sirena.org.uk> |
| 107 | Martin Kepplinger <martink@posteo.de> <martin.kepplinger@theobroma-systems.com> | 108 | Martin Kepplinger <martink@posteo.de> <martin.kepplinger@theobroma-systems.com> |
| @@ -2113,6 +2113,10 @@ S: J. Obrechtstr 23 | |||
| 2113 | S: NL-5216 GP 's-Hertogenbosch | 2113 | S: NL-5216 GP 's-Hertogenbosch |
| 2114 | S: The Netherlands | 2114 | S: The Netherlands |
| 2115 | 2115 | ||
| 2116 | N: Ashley Lai | ||
| 2117 | E: ashleydlai@gmail.com | ||
| 2118 | D: IBM VTPM driver | ||
| 2119 | |||
| 2116 | N: Savio Lam | 2120 | N: Savio Lam |
| 2117 | E: lam836@cs.cuhk.hk | 2121 | E: lam836@cs.cuhk.hk |
| 2118 | D: Author of the dialog utility, foundation | 2122 | D: Author of the dialog utility, foundation |
| @@ -3333,6 +3337,10 @@ S: Braunschweiger Strasse 79 | |||
| 3333 | S: 31134 Hildesheim | 3337 | S: 31134 Hildesheim |
| 3334 | S: Germany | 3338 | S: Germany |
| 3335 | 3339 | ||
| 3340 | N: Marcel Selhorst | ||
| 3341 | E: tpmdd@selhorst.net | ||
| 3342 | D: TPM driver | ||
| 3343 | |||
| 3336 | N: Darren Senn | 3344 | N: Darren Senn |
| 3337 | E: sinster@darkwater.com | 3345 | E: sinster@darkwater.com |
| 3338 | D: Whatever I notice needs doing (so far: itimers, /proc) | 3346 | D: Whatever I notice needs doing (so far: itimers, /proc) |
| @@ -4128,7 +4136,6 @@ D: MD driver | |||
| 4128 | D: EISA/sysfs subsystem | 4136 | D: EISA/sysfs subsystem |
| 4129 | S: France | 4137 | S: France |
| 4130 | 4138 | ||
| 4131 | |||
| 4132 | # Don't add your name here, unless you really _are_ after Marc | 4139 | # Don't add your name here, unless you really _are_ after Marc |
| 4133 | # alphabetically. Leonard used to be very proud of being the | 4140 | # alphabetically. Leonard used to be very proud of being the |
| 4134 | # last entry, and he'll get positively pissed if he can't even | 4141 | # last entry, and he'll get positively pissed if he can't even |
diff --git a/MAINTAINERS b/MAINTAINERS index a7995c737728..2811a211632c 100644 --- a/MAINTAINERS +++ b/MAINTAINERS | |||
| @@ -10341,7 +10341,6 @@ F: drivers/pci/host/vmd.c | |||
| 10341 | 10341 | ||
| 10342 | PCI DRIVER FOR MICROSEMI SWITCHTEC | 10342 | PCI DRIVER FOR MICROSEMI SWITCHTEC |
| 10343 | M: Kurt Schwemmer <kurt.schwemmer@microsemi.com> | 10343 | M: Kurt Schwemmer <kurt.schwemmer@microsemi.com> |
| 10344 | M: Stephen Bates <stephen.bates@microsemi.com> | ||
| 10345 | M: Logan Gunthorpe <logang@deltatee.com> | 10344 | M: Logan Gunthorpe <logang@deltatee.com> |
| 10346 | L: linux-pci@vger.kernel.org | 10345 | L: linux-pci@vger.kernel.org |
| 10347 | S: Maintained | 10346 | S: Maintained |
| @@ -10406,6 +10405,7 @@ F: drivers/pci/dwc/*keystone* | |||
| 10406 | 10405 | ||
| 10407 | PCI ENDPOINT SUBSYSTEM | 10406 | PCI ENDPOINT SUBSYSTEM |
| 10408 | M: Kishon Vijay Abraham I <kishon@ti.com> | 10407 | M: Kishon Vijay Abraham I <kishon@ti.com> |
| 10408 | M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | ||
| 10409 | L: linux-pci@vger.kernel.org | 10409 | L: linux-pci@vger.kernel.org |
| 10410 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/kishon/pci-endpoint.git | 10410 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/kishon/pci-endpoint.git |
| 10411 | S: Supported | 10411 | S: Supported |
| @@ -10457,6 +10457,15 @@ F: include/linux/pci* | |||
| 10457 | F: arch/x86/pci/ | 10457 | F: arch/x86/pci/ |
| 10458 | F: arch/x86/kernel/quirks.c | 10458 | F: arch/x86/kernel/quirks.c |
| 10459 | 10459 | ||
| 10460 | PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS | ||
| 10461 | M: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com> | ||
| 10462 | L: linux-pci@vger.kernel.org | ||
| 10463 | Q: http://patchwork.ozlabs.org/project/linux-pci/list/ | ||
| 10464 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git/ | ||
| 10465 | S: Supported | ||
| 10466 | F: drivers/pci/host/ | ||
| 10467 | F: drivers/pci/dwc/ | ||
| 10468 | |||
| 10460 | PCIE DRIVER FOR AXIS ARTPEC | 10469 | PCIE DRIVER FOR AXIS ARTPEC |
| 10461 | M: Niklas Cassel <niklas.cassel@axis.com> | 10470 | M: Niklas Cassel <niklas.cassel@axis.com> |
| 10462 | M: Jesper Nilsson <jesper.nilsson@axis.com> | 10471 | M: Jesper Nilsson <jesper.nilsson@axis.com> |
| @@ -10476,7 +10485,6 @@ F: drivers/pci/host/pci-thunder-* | |||
| 10476 | 10485 | ||
| 10477 | PCIE DRIVER FOR HISILICON | 10486 | PCIE DRIVER FOR HISILICON |
| 10478 | M: Zhou Wang <wangzhou1@hisilicon.com> | 10487 | M: Zhou Wang <wangzhou1@hisilicon.com> |
| 10479 | M: Gabriele Paoloni <gabriele.paoloni@huawei.com> | ||
| 10480 | L: linux-pci@vger.kernel.org | 10488 | L: linux-pci@vger.kernel.org |
| 10481 | S: Maintained | 10489 | S: Maintained |
| 10482 | F: Documentation/devicetree/bindings/pci/hisilicon-pcie.txt | 10490 | F: Documentation/devicetree/bindings/pci/hisilicon-pcie.txt |
| @@ -13603,23 +13611,14 @@ F: drivers/platform/x86/toshiba-wmi.c | |||
| 13603 | 13611 | ||
| 13604 | TPM DEVICE DRIVER | 13612 | TPM DEVICE DRIVER |
| 13605 | M: Peter Huewe <peterhuewe@gmx.de> | 13613 | M: Peter Huewe <peterhuewe@gmx.de> |
| 13606 | M: Marcel Selhorst <tpmdd@selhorst.net> | ||
| 13607 | M: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> | 13614 | M: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> |
| 13608 | R: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> | 13615 | R: Jason Gunthorpe <jgunthorpe@obsidianresearch.com> |
| 13609 | W: http://tpmdd.sourceforge.net | 13616 | L: linux-integrity@vger.kernel.org |
| 13610 | L: tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers) | 13617 | Q: https://patchwork.kernel.org/project/linux-integrity/list/ |
| 13611 | Q: https://patchwork.kernel.org/project/tpmdd-devel/list/ | ||
| 13612 | T: git git://git.infradead.org/users/jjs/linux-tpmdd.git | 13618 | T: git git://git.infradead.org/users/jjs/linux-tpmdd.git |
| 13613 | S: Maintained | 13619 | S: Maintained |
| 13614 | F: drivers/char/tpm/ | 13620 | F: drivers/char/tpm/ |
| 13615 | 13621 | ||
| 13616 | TPM IBM_VTPM DEVICE DRIVER | ||
| 13617 | M: Ashley Lai <ashleydlai@gmail.com> | ||
| 13618 | W: http://tpmdd.sourceforge.net | ||
| 13619 | L: tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers) | ||
| 13620 | S: Maintained | ||
| 13621 | F: drivers/char/tpm/tpm_ibmvtpm* | ||
| 13622 | |||
| 13623 | TRACING | 13622 | TRACING |
| 13624 | M: Steven Rostedt <rostedt@goodmis.org> | 13623 | M: Steven Rostedt <rostedt@goodmis.org> |
| 13625 | M: Ingo Molnar <mingo@redhat.com> | 13624 | M: Ingo Molnar <mingo@redhat.com> |
diff --git a/arch/arm/kernel/traps.c b/arch/arm/kernel/traps.c index 948c648fea00..0fcd82f01388 100644 --- a/arch/arm/kernel/traps.c +++ b/arch/arm/kernel/traps.c | |||
| @@ -154,30 +154,26 @@ static void dump_mem(const char *lvl, const char *str, unsigned long bottom, | |||
| 154 | set_fs(fs); | 154 | set_fs(fs); |
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | static void dump_instr(const char *lvl, struct pt_regs *regs) | 157 | static void __dump_instr(const char *lvl, struct pt_regs *regs) |
| 158 | { | 158 | { |
| 159 | unsigned long addr = instruction_pointer(regs); | 159 | unsigned long addr = instruction_pointer(regs); |
| 160 | const int thumb = thumb_mode(regs); | 160 | const int thumb = thumb_mode(regs); |
| 161 | const int width = thumb ? 4 : 8; | 161 | const int width = thumb ? 4 : 8; |
| 162 | mm_segment_t fs; | ||
| 163 | char str[sizeof("00000000 ") * 5 + 2 + 1], *p = str; | 162 | char str[sizeof("00000000 ") * 5 + 2 + 1], *p = str; |
| 164 | int i; | 163 | int i; |
| 165 | 164 | ||
| 166 | /* | 165 | /* |
| 167 | * We need to switch to kernel mode so that we can use __get_user | 166 | * Note that we now dump the code first, just in case the backtrace |
| 168 | * to safely read from kernel space. Note that we now dump the | 167 | * kills us. |
| 169 | * code first, just in case the backtrace kills us. | ||
| 170 | */ | 168 | */ |
| 171 | fs = get_fs(); | ||
| 172 | set_fs(KERNEL_DS); | ||
| 173 | 169 | ||
| 174 | for (i = -4; i < 1 + !!thumb; i++) { | 170 | for (i = -4; i < 1 + !!thumb; i++) { |
| 175 | unsigned int val, bad; | 171 | unsigned int val, bad; |
| 176 | 172 | ||
| 177 | if (thumb) | 173 | if (thumb) |
| 178 | bad = __get_user(val, &((u16 *)addr)[i]); | 174 | bad = get_user(val, &((u16 *)addr)[i]); |
| 179 | else | 175 | else |
| 180 | bad = __get_user(val, &((u32 *)addr)[i]); | 176 | bad = get_user(val, &((u32 *)addr)[i]); |
| 181 | 177 | ||
| 182 | if (!bad) | 178 | if (!bad) |
| 183 | p += sprintf(p, i == 0 ? "(%0*x) " : "%0*x ", | 179 | p += sprintf(p, i == 0 ? "(%0*x) " : "%0*x ", |
| @@ -188,8 +184,20 @@ static void dump_instr(const char *lvl, struct pt_regs *regs) | |||
| 188 | } | 184 | } |
| 189 | } | 185 | } |
| 190 | printk("%sCode: %s\n", lvl, str); | 186 | printk("%sCode: %s\n", lvl, str); |
| 187 | } | ||
| 191 | 188 | ||
| 192 | set_fs(fs); | 189 | static void dump_instr(const char *lvl, struct pt_regs *regs) |
| 190 | { | ||
| 191 | mm_segment_t fs; | ||
| 192 | |||
| 193 | if (!user_mode(regs)) { | ||
| 194 | fs = get_fs(); | ||
| 195 | set_fs(KERNEL_DS); | ||
| 196 | __dump_instr(lvl, regs); | ||
| 197 | set_fs(fs); | ||
| 198 | } else { | ||
| 199 | __dump_instr(lvl, regs); | ||
| 200 | } | ||
| 193 | } | 201 | } |
| 194 | 202 | ||
| 195 | #ifdef CONFIG_ARM_UNWIND | 203 | #ifdef CONFIG_ARM_UNWIND |
diff --git a/arch/mips/ar7/platform.c b/arch/mips/ar7/platform.c index df7acea3747a..4674f1efbe7a 100644 --- a/arch/mips/ar7/platform.c +++ b/arch/mips/ar7/platform.c | |||
| @@ -575,6 +575,7 @@ static int __init ar7_register_uarts(void) | |||
| 575 | uart_port.type = PORT_AR7; | 575 | uart_port.type = PORT_AR7; |
| 576 | uart_port.uartclk = clk_get_rate(bus_clk) / 2; | 576 | uart_port.uartclk = clk_get_rate(bus_clk) / 2; |
| 577 | uart_port.iotype = UPIO_MEM32; | 577 | uart_port.iotype = UPIO_MEM32; |
| 578 | uart_port.flags = UPF_FIXED_TYPE; | ||
| 578 | uart_port.regshift = 2; | 579 | uart_port.regshift = 2; |
| 579 | 580 | ||
| 580 | uart_port.line = 0; | 581 | uart_port.line = 0; |
| @@ -653,6 +654,10 @@ static int __init ar7_register_devices(void) | |||
| 653 | u32 val; | 654 | u32 val; |
| 654 | int res; | 655 | int res; |
| 655 | 656 | ||
| 657 | res = ar7_gpio_init(); | ||
| 658 | if (res) | ||
| 659 | pr_warn("unable to register gpios: %d\n", res); | ||
| 660 | |||
| 656 | res = ar7_register_uarts(); | 661 | res = ar7_register_uarts(); |
| 657 | if (res) | 662 | if (res) |
| 658 | pr_err("unable to setup uart(s): %d\n", res); | 663 | pr_err("unable to setup uart(s): %d\n", res); |
diff --git a/arch/mips/ar7/prom.c b/arch/mips/ar7/prom.c index 4fd83336131a..dd53987a690f 100644 --- a/arch/mips/ar7/prom.c +++ b/arch/mips/ar7/prom.c | |||
| @@ -246,8 +246,6 @@ void __init prom_init(void) | |||
| 246 | ar7_init_cmdline(fw_arg0, (char **)fw_arg1); | 246 | ar7_init_cmdline(fw_arg0, (char **)fw_arg1); |
| 247 | ar7_init_env((struct env_var *)fw_arg2); | 247 | ar7_init_env((struct env_var *)fw_arg2); |
| 248 | console_config(); | 248 | console_config(); |
| 249 | |||
| 250 | ar7_gpio_init(); | ||
| 251 | } | 249 | } |
| 252 | 250 | ||
| 253 | #define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4))) | 251 | #define PORT(offset) (KSEG1ADDR(AR7_REGS_UART0 + (offset * 4))) |
diff --git a/arch/mips/kernel/smp-bmips.c b/arch/mips/kernel/smp-bmips.c index 406072e26752..87dcac2447c8 100644 --- a/arch/mips/kernel/smp-bmips.c +++ b/arch/mips/kernel/smp-bmips.c | |||
| @@ -591,11 +591,11 @@ void __init bmips_cpu_setup(void) | |||
| 591 | 591 | ||
| 592 | /* Flush and enable RAC */ | 592 | /* Flush and enable RAC */ |
| 593 | cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG); | 593 | cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG); |
| 594 | __raw_writel(cfg | 0x100, BMIPS_RAC_CONFIG); | 594 | __raw_writel(cfg | 0x100, cbr + BMIPS_RAC_CONFIG); |
| 595 | __raw_readl(cbr + BMIPS_RAC_CONFIG); | 595 | __raw_readl(cbr + BMIPS_RAC_CONFIG); |
| 596 | 596 | ||
| 597 | cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG); | 597 | cfg = __raw_readl(cbr + BMIPS_RAC_CONFIG); |
| 598 | __raw_writel(cfg | 0xf, BMIPS_RAC_CONFIG); | 598 | __raw_writel(cfg | 0xf, cbr + BMIPS_RAC_CONFIG); |
| 599 | __raw_readl(cbr + BMIPS_RAC_CONFIG); | 599 | __raw_readl(cbr + BMIPS_RAC_CONFIG); |
| 600 | 600 | ||
| 601 | cfg = __raw_readl(cbr + BMIPS_RAC_ADDRESS_RANGE); | 601 | cfg = __raw_readl(cbr + BMIPS_RAC_ADDRESS_RANGE); |
diff --git a/arch/powerpc/kvm/book3s_64_mmu_hv.c b/arch/powerpc/kvm/book3s_64_mmu_hv.c index 7c62967d672c..59247af5fd45 100644 --- a/arch/powerpc/kvm/book3s_64_mmu_hv.c +++ b/arch/powerpc/kvm/book3s_64_mmu_hv.c | |||
| @@ -646,6 +646,16 @@ int kvmppc_book3s_hv_page_fault(struct kvm_run *run, struct kvm_vcpu *vcpu, | |||
| 646 | hnow_v = hpte_new_to_old_v(hnow_v, hnow_r); | 646 | hnow_v = hpte_new_to_old_v(hnow_v, hnow_r); |
| 647 | hnow_r = hpte_new_to_old_r(hnow_r); | 647 | hnow_r = hpte_new_to_old_r(hnow_r); |
| 648 | } | 648 | } |
| 649 | |||
| 650 | /* | ||
| 651 | * If the HPT is being resized, don't update the HPTE, | ||
| 652 | * instead let the guest retry after the resize operation is complete. | ||
| 653 | * The synchronization for hpte_setup_done test vs. set is provided | ||
| 654 | * by the HPTE lock. | ||
| 655 | */ | ||
| 656 | if (!kvm->arch.hpte_setup_done) | ||
| 657 | goto out_unlock; | ||
| 658 | |||
| 649 | if ((hnow_v & ~HPTE_V_HVLOCK) != hpte[0] || hnow_r != hpte[1] || | 659 | if ((hnow_v & ~HPTE_V_HVLOCK) != hpte[0] || hnow_r != hpte[1] || |
| 650 | rev->guest_rpte != hpte[2]) | 660 | rev->guest_rpte != hpte[2]) |
| 651 | /* HPTE has been changed under us; let the guest retry */ | 661 | /* HPTE has been changed under us; let the guest retry */ |
diff --git a/arch/powerpc/kvm/book3s_hv.c b/arch/powerpc/kvm/book3s_hv.c index 73bf1ebfa78f..8d43cf205d34 100644 --- a/arch/powerpc/kvm/book3s_hv.c +++ b/arch/powerpc/kvm/book3s_hv.c | |||
| @@ -2705,11 +2705,14 @@ static noinline void kvmppc_run_core(struct kvmppc_vcore *vc) | |||
| 2705 | * Hard-disable interrupts, and check resched flag and signals. | 2705 | * Hard-disable interrupts, and check resched flag and signals. |
| 2706 | * If we need to reschedule or deliver a signal, clean up | 2706 | * If we need to reschedule or deliver a signal, clean up |
| 2707 | * and return without going into the guest(s). | 2707 | * and return without going into the guest(s). |
| 2708 | * If the hpte_setup_done flag has been cleared, don't go into the | ||
| 2709 | * guest because that means a HPT resize operation is in progress. | ||
| 2708 | */ | 2710 | */ |
| 2709 | local_irq_disable(); | 2711 | local_irq_disable(); |
| 2710 | hard_irq_disable(); | 2712 | hard_irq_disable(); |
| 2711 | if (lazy_irq_pending() || need_resched() || | 2713 | if (lazy_irq_pending() || need_resched() || |
| 2712 | recheck_signals(&core_info)) { | 2714 | recheck_signals(&core_info) || |
| 2715 | (!kvm_is_radix(vc->kvm) && !vc->kvm->arch.hpte_setup_done)) { | ||
| 2713 | local_irq_enable(); | 2716 | local_irq_enable(); |
| 2714 | vc->vcore_state = VCORE_INACTIVE; | 2717 | vc->vcore_state = VCORE_INACTIVE; |
| 2715 | /* Unlock all except the primary vcore */ | 2718 | /* Unlock all except the primary vcore */ |
| @@ -3078,7 +3081,7 @@ out: | |||
| 3078 | 3081 | ||
| 3079 | static int kvmppc_run_vcpu(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) | 3082 | static int kvmppc_run_vcpu(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) |
| 3080 | { | 3083 | { |
| 3081 | int n_ceded, i; | 3084 | int n_ceded, i, r; |
| 3082 | struct kvmppc_vcore *vc; | 3085 | struct kvmppc_vcore *vc; |
| 3083 | struct kvm_vcpu *v; | 3086 | struct kvm_vcpu *v; |
| 3084 | 3087 | ||
| @@ -3132,6 +3135,20 @@ static int kvmppc_run_vcpu(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu) | |||
| 3132 | 3135 | ||
| 3133 | while (vcpu->arch.state == KVMPPC_VCPU_RUNNABLE && | 3136 | while (vcpu->arch.state == KVMPPC_VCPU_RUNNABLE && |
| 3134 | !signal_pending(current)) { | 3137 | !signal_pending(current)) { |
| 3138 | /* See if the HPT and VRMA are ready to go */ | ||
| 3139 | if (!kvm_is_radix(vcpu->kvm) && | ||
| 3140 | !vcpu->kvm->arch.hpte_setup_done) { | ||
| 3141 | spin_unlock(&vc->lock); | ||
| 3142 | r = kvmppc_hv_setup_htab_rma(vcpu); | ||
| 3143 | spin_lock(&vc->lock); | ||
| 3144 | if (r) { | ||
| 3145 | kvm_run->exit_reason = KVM_EXIT_FAIL_ENTRY; | ||
| 3146 | kvm_run->fail_entry.hardware_entry_failure_reason = 0; | ||
| 3147 | vcpu->arch.ret = r; | ||
| 3148 | break; | ||
| 3149 | } | ||
| 3150 | } | ||
| 3151 | |||
| 3135 | if (vc->vcore_state == VCORE_PREEMPT && vc->runner == NULL) | 3152 | if (vc->vcore_state == VCORE_PREEMPT && vc->runner == NULL) |
| 3136 | kvmppc_vcore_end_preempt(vc); | 3153 | kvmppc_vcore_end_preempt(vc); |
| 3137 | 3154 | ||
| @@ -3249,13 +3266,6 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu) | |||
| 3249 | /* Order vcpus_running vs. hpte_setup_done, see kvmppc_alloc_reset_hpt */ | 3266 | /* Order vcpus_running vs. hpte_setup_done, see kvmppc_alloc_reset_hpt */ |
| 3250 | smp_mb(); | 3267 | smp_mb(); |
| 3251 | 3268 | ||
| 3252 | /* On the first time here, set up HTAB and VRMA */ | ||
| 3253 | if (!kvm_is_radix(vcpu->kvm) && !vcpu->kvm->arch.hpte_setup_done) { | ||
| 3254 | r = kvmppc_hv_setup_htab_rma(vcpu); | ||
| 3255 | if (r) | ||
| 3256 | goto out; | ||
| 3257 | } | ||
| 3258 | |||
| 3259 | flush_all_to_thread(current); | 3269 | flush_all_to_thread(current); |
| 3260 | 3270 | ||
| 3261 | /* Save userspace EBB and other register values */ | 3271 | /* Save userspace EBB and other register values */ |
| @@ -3303,7 +3313,6 @@ static int kvmppc_vcpu_run_hv(struct kvm_run *run, struct kvm_vcpu *vcpu) | |||
| 3303 | } | 3313 | } |
| 3304 | mtspr(SPRN_VRSAVE, user_vrsave); | 3314 | mtspr(SPRN_VRSAVE, user_vrsave); |
| 3305 | 3315 | ||
| 3306 | out: | ||
| 3307 | vcpu->arch.state = KVMPPC_VCPU_NOTREADY; | 3316 | vcpu->arch.state = KVMPPC_VCPU_NOTREADY; |
| 3308 | atomic_dec(&vcpu->kvm->arch.vcpus_running); | 3317 | atomic_dec(&vcpu->kvm->arch.vcpus_running); |
| 3309 | return r; | 3318 | return r; |
diff --git a/arch/x86/kernel/cpu/Makefile b/arch/x86/kernel/cpu/Makefile index 236999c54edc..c60922a66385 100644 --- a/arch/x86/kernel/cpu/Makefile +++ b/arch/x86/kernel/cpu/Makefile | |||
| @@ -22,7 +22,7 @@ obj-y += common.o | |||
| 22 | obj-y += rdrand.o | 22 | obj-y += rdrand.o |
| 23 | obj-y += match.o | 23 | obj-y += match.o |
| 24 | obj-y += bugs.o | 24 | obj-y += bugs.o |
| 25 | obj-y += aperfmperf.o | 25 | obj-$(CONFIG_CPU_FREQ) += aperfmperf.o |
| 26 | 26 | ||
| 27 | obj-$(CONFIG_PROC_FS) += proc.o | 27 | obj-$(CONFIG_PROC_FS) += proc.o |
| 28 | obj-$(CONFIG_X86_FEATURE_NAMES) += capflags.o powerflags.o | 28 | obj-$(CONFIG_X86_FEATURE_NAMES) += capflags.o powerflags.o |
diff --git a/arch/x86/kernel/cpu/aperfmperf.c b/arch/x86/kernel/cpu/aperfmperf.c index 957813e0180d..0ee83321a313 100644 --- a/arch/x86/kernel/cpu/aperfmperf.c +++ b/arch/x86/kernel/cpu/aperfmperf.c | |||
| @@ -42,6 +42,10 @@ static void aperfmperf_snapshot_khz(void *dummy) | |||
| 42 | s64 time_delta = ktime_ms_delta(now, s->time); | 42 | s64 time_delta = ktime_ms_delta(now, s->time); |
| 43 | unsigned long flags; | 43 | unsigned long flags; |
| 44 | 44 | ||
| 45 | /* Don't bother re-computing within the cache threshold time. */ | ||
| 46 | if (time_delta < APERFMPERF_CACHE_THRESHOLD_MS) | ||
| 47 | return; | ||
| 48 | |||
| 45 | local_irq_save(flags); | 49 | local_irq_save(flags); |
| 46 | rdmsrl(MSR_IA32_APERF, aperf); | 50 | rdmsrl(MSR_IA32_APERF, aperf); |
| 47 | rdmsrl(MSR_IA32_MPERF, mperf); | 51 | rdmsrl(MSR_IA32_MPERF, mperf); |
| @@ -70,7 +74,6 @@ static void aperfmperf_snapshot_khz(void *dummy) | |||
| 70 | 74 | ||
| 71 | unsigned int arch_freq_get_on_cpu(int cpu) | 75 | unsigned int arch_freq_get_on_cpu(int cpu) |
| 72 | { | 76 | { |
| 73 | s64 time_delta; | ||
| 74 | unsigned int khz; | 77 | unsigned int khz; |
| 75 | 78 | ||
| 76 | if (!cpu_khz) | 79 | if (!cpu_khz) |
| @@ -79,12 +82,6 @@ unsigned int arch_freq_get_on_cpu(int cpu) | |||
| 79 | if (!static_cpu_has(X86_FEATURE_APERFMPERF)) | 82 | if (!static_cpu_has(X86_FEATURE_APERFMPERF)) |
| 80 | return 0; | 83 | return 0; |
| 81 | 84 | ||
| 82 | /* Don't bother re-computing within the cache threshold time. */ | ||
| 83 | time_delta = ktime_ms_delta(ktime_get(), per_cpu(samples.time, cpu)); | ||
| 84 | khz = per_cpu(samples.khz, cpu); | ||
| 85 | if (khz && time_delta < APERFMPERF_CACHE_THRESHOLD_MS) | ||
| 86 | return khz; | ||
| 87 | |||
| 88 | smp_call_function_single(cpu, aperfmperf_snapshot_khz, NULL, 1); | 85 | smp_call_function_single(cpu, aperfmperf_snapshot_khz, NULL, 1); |
| 89 | khz = per_cpu(samples.khz, cpu); | 86 | khz = per_cpu(samples.khz, cpu); |
| 90 | if (khz) | 87 | if (khz) |
diff --git a/arch/x86/kernel/cpu/proc.c b/arch/x86/kernel/cpu/proc.c index 4378a729b933..6b7e17bf0b71 100644 --- a/arch/x86/kernel/cpu/proc.c +++ b/arch/x86/kernel/cpu/proc.c | |||
| @@ -78,11 +78,9 @@ static int show_cpuinfo(struct seq_file *m, void *v) | |||
| 78 | seq_printf(m, "microcode\t: 0x%x\n", c->microcode); | 78 | seq_printf(m, "microcode\t: 0x%x\n", c->microcode); |
| 79 | 79 | ||
| 80 | if (cpu_has(c, X86_FEATURE_TSC)) { | 80 | if (cpu_has(c, X86_FEATURE_TSC)) { |
| 81 | unsigned int freq = arch_freq_get_on_cpu(cpu); | 81 | unsigned int freq = cpufreq_quick_get(cpu); |
| 82 | 82 | ||
| 83 | if (!freq) | 83 | if (!freq) |
| 84 | freq = cpufreq_quick_get(cpu); | ||
| 85 | if (!freq) | ||
| 86 | freq = cpu_khz; | 84 | freq = cpu_khz; |
| 87 | seq_printf(m, "cpu MHz\t\t: %u.%03u\n", | 85 | seq_printf(m, "cpu MHz\t\t: %u.%03u\n", |
| 88 | freq / 1000, (freq % 1000)); | 86 | freq / 1000, (freq % 1000)); |
diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c index 16c5f37933a2..0286327e65fa 100644 --- a/arch/x86/mm/mem_encrypt.c +++ b/arch/x86/mm/mem_encrypt.c | |||
| @@ -40,7 +40,7 @@ static char sme_cmdline_off[] __initdata = "off"; | |||
| 40 | * section is later cleared. | 40 | * section is later cleared. |
| 41 | */ | 41 | */ |
| 42 | u64 sme_me_mask __section(.data) = 0; | 42 | u64 sme_me_mask __section(.data) = 0; |
| 43 | EXPORT_SYMBOL_GPL(sme_me_mask); | 43 | EXPORT_SYMBOL(sme_me_mask); |
| 44 | 44 | ||
| 45 | /* Buffer used for early in-place encryption by BSP, no locking needed */ | 45 | /* Buffer used for early in-place encryption by BSP, no locking needed */ |
| 46 | static char sme_early_buffer[PAGE_SIZE] __aligned(PAGE_SIZE); | 46 | static char sme_early_buffer[PAGE_SIZE] __aligned(PAGE_SIZE); |
diff --git a/drivers/acpi/sleep.c b/drivers/acpi/sleep.c index 6804ddab3052..8082871b409a 100644 --- a/drivers/acpi/sleep.c +++ b/drivers/acpi/sleep.c | |||
| @@ -160,6 +160,14 @@ static int __init init_nvs_nosave(const struct dmi_system_id *d) | |||
| 160 | return 0; | 160 | return 0; |
| 161 | } | 161 | } |
| 162 | 162 | ||
| 163 | static bool acpi_sleep_no_lps0; | ||
| 164 | |||
| 165 | static int __init init_no_lps0(const struct dmi_system_id *d) | ||
| 166 | { | ||
| 167 | acpi_sleep_no_lps0 = true; | ||
| 168 | return 0; | ||
| 169 | } | ||
| 170 | |||
| 163 | static const struct dmi_system_id acpisleep_dmi_table[] __initconst = { | 171 | static const struct dmi_system_id acpisleep_dmi_table[] __initconst = { |
| 164 | { | 172 | { |
| 165 | .callback = init_old_suspend_ordering, | 173 | .callback = init_old_suspend_ordering, |
| @@ -343,6 +351,19 @@ static const struct dmi_system_id acpisleep_dmi_table[] __initconst = { | |||
| 343 | DMI_MATCH(DMI_PRODUCT_NAME, "80E3"), | 351 | DMI_MATCH(DMI_PRODUCT_NAME, "80E3"), |
| 344 | }, | 352 | }, |
| 345 | }, | 353 | }, |
| 354 | /* | ||
| 355 | * https://bugzilla.kernel.org/show_bug.cgi?id=196907 | ||
| 356 | * Some Dell XPS13 9360 cannot do suspend-to-idle using the Low Power | ||
| 357 | * S0 Idle firmware interface. | ||
| 358 | */ | ||
| 359 | { | ||
| 360 | .callback = init_no_lps0, | ||
| 361 | .ident = "Dell XPS13 9360", | ||
| 362 | .matches = { | ||
| 363 | DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), | ||
| 364 | DMI_MATCH(DMI_PRODUCT_NAME, "XPS 13 9360"), | ||
| 365 | }, | ||
| 366 | }, | ||
| 346 | {}, | 367 | {}, |
| 347 | }; | 368 | }; |
| 348 | 369 | ||
| @@ -485,6 +506,7 @@ static void acpi_pm_end(void) | |||
| 485 | } | 506 | } |
| 486 | #else /* !CONFIG_ACPI_SLEEP */ | 507 | #else /* !CONFIG_ACPI_SLEEP */ |
| 487 | #define acpi_target_sleep_state ACPI_STATE_S0 | 508 | #define acpi_target_sleep_state ACPI_STATE_S0 |
| 509 | #define acpi_sleep_no_lps0 (false) | ||
| 488 | static inline void acpi_sleep_dmi_check(void) {} | 510 | static inline void acpi_sleep_dmi_check(void) {} |
| 489 | #endif /* CONFIG_ACPI_SLEEP */ | 511 | #endif /* CONFIG_ACPI_SLEEP */ |
| 490 | 512 | ||
| @@ -863,6 +885,12 @@ static int lps0_device_attach(struct acpi_device *adev, | |||
| 863 | if (lps0_device_handle) | 885 | if (lps0_device_handle) |
| 864 | return 0; | 886 | return 0; |
| 865 | 887 | ||
| 888 | if (acpi_sleep_no_lps0) { | ||
| 889 | acpi_handle_info(adev->handle, | ||
| 890 | "Low Power S0 Idle interface disabled\n"); | ||
| 891 | return 0; | ||
| 892 | } | ||
| 893 | |||
| 866 | if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) | 894 | if (!(acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0)) |
| 867 | return 0; | 895 | return 0; |
| 868 | 896 | ||
diff --git a/drivers/block/rbd.c b/drivers/block/rbd.c index b640ad8a6d20..adc877dfef5c 100644 --- a/drivers/block/rbd.c +++ b/drivers/block/rbd.c | |||
| @@ -2692,7 +2692,7 @@ static int rbd_img_obj_parent_read_full(struct rbd_obj_request *obj_request) | |||
| 2692 | * from the parent. | 2692 | * from the parent. |
| 2693 | */ | 2693 | */ |
| 2694 | page_count = (u32)calc_pages_for(0, length); | 2694 | page_count = (u32)calc_pages_for(0, length); |
| 2695 | pages = ceph_alloc_page_vector(page_count, GFP_KERNEL); | 2695 | pages = ceph_alloc_page_vector(page_count, GFP_NOIO); |
| 2696 | if (IS_ERR(pages)) { | 2696 | if (IS_ERR(pages)) { |
| 2697 | result = PTR_ERR(pages); | 2697 | result = PTR_ERR(pages); |
| 2698 | pages = NULL; | 2698 | pages = NULL; |
| @@ -2827,7 +2827,7 @@ static int rbd_img_obj_exists_submit(struct rbd_obj_request *obj_request) | |||
| 2827 | */ | 2827 | */ |
| 2828 | size = sizeof (__le64) + sizeof (__le32) + sizeof (__le32); | 2828 | size = sizeof (__le64) + sizeof (__le32) + sizeof (__le32); |
| 2829 | page_count = (u32)calc_pages_for(0, size); | 2829 | page_count = (u32)calc_pages_for(0, size); |
| 2830 | pages = ceph_alloc_page_vector(page_count, GFP_KERNEL); | 2830 | pages = ceph_alloc_page_vector(page_count, GFP_NOIO); |
| 2831 | if (IS_ERR(pages)) { | 2831 | if (IS_ERR(pages)) { |
| 2832 | ret = PTR_ERR(pages); | 2832 | ret = PTR_ERR(pages); |
| 2833 | goto fail_stat_request; | 2833 | goto fail_stat_request; |
diff --git a/drivers/gpu/drm/i915/i915_gem_execbuffer.c b/drivers/gpu/drm/i915/i915_gem_execbuffer.c index 4ac454ae54d7..83876a1c8d98 100644 --- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c +++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c | |||
| @@ -2094,6 +2094,11 @@ get_fence_array(struct drm_i915_gem_execbuffer2 *args, | |||
| 2094 | goto err; | 2094 | goto err; |
| 2095 | } | 2095 | } |
| 2096 | 2096 | ||
| 2097 | if (fence.flags & __I915_EXEC_FENCE_UNKNOWN_FLAGS) { | ||
| 2098 | err = -EINVAL; | ||
| 2099 | goto err; | ||
| 2100 | } | ||
| 2101 | |||
| 2097 | syncobj = drm_syncobj_find(file, fence.handle); | 2102 | syncobj = drm_syncobj_find(file, fence.handle); |
| 2098 | if (!syncobj) { | 2103 | if (!syncobj) { |
| 2099 | DRM_DEBUG("Invalid syncobj handle provided\n"); | 2104 | DRM_DEBUG("Invalid syncobj handle provided\n"); |
| @@ -2101,6 +2106,9 @@ get_fence_array(struct drm_i915_gem_execbuffer2 *args, | |||
| 2101 | goto err; | 2106 | goto err; |
| 2102 | } | 2107 | } |
| 2103 | 2108 | ||
| 2109 | BUILD_BUG_ON(~(ARCH_KMALLOC_MINALIGN - 1) & | ||
| 2110 | ~__I915_EXEC_FENCE_UNKNOWN_FLAGS); | ||
| 2111 | |||
| 2104 | fences[n] = ptr_pack_bits(syncobj, fence.flags, 2); | 2112 | fences[n] = ptr_pack_bits(syncobj, fence.flags, 2); |
| 2105 | } | 2113 | } |
| 2106 | 2114 | ||
diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c b/drivers/gpu/drm/i915/i915_gem_gtt.c index e2410eb5d96e..ad524cb0f6fc 100644 --- a/drivers/gpu/drm/i915/i915_gem_gtt.c +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c | |||
| @@ -832,10 +832,14 @@ static void gen8_ppgtt_clear_4lvl(struct i915_address_space *vm, | |||
| 832 | } | 832 | } |
| 833 | } | 833 | } |
| 834 | 834 | ||
| 835 | struct sgt_dma { | 835 | static inline struct sgt_dma { |
| 836 | struct scatterlist *sg; | 836 | struct scatterlist *sg; |
| 837 | dma_addr_t dma, max; | 837 | dma_addr_t dma, max; |
| 838 | }; | 838 | } sgt_dma(struct i915_vma *vma) { |
| 839 | struct scatterlist *sg = vma->pages->sgl; | ||
| 840 | dma_addr_t addr = sg_dma_address(sg); | ||
| 841 | return (struct sgt_dma) { sg, addr, addr + sg->length }; | ||
| 842 | } | ||
| 839 | 843 | ||
| 840 | struct gen8_insert_pte { | 844 | struct gen8_insert_pte { |
| 841 | u16 pml4e; | 845 | u16 pml4e; |
| @@ -916,11 +920,7 @@ static void gen8_ppgtt_insert_3lvl(struct i915_address_space *vm, | |||
| 916 | u32 unused) | 920 | u32 unused) |
| 917 | { | 921 | { |
| 918 | struct i915_hw_ppgtt *ppgtt = i915_vm_to_ppgtt(vm); | 922 | struct i915_hw_ppgtt *ppgtt = i915_vm_to_ppgtt(vm); |
| 919 | struct sgt_dma iter = { | 923 | struct sgt_dma iter = sgt_dma(vma); |
| 920 | .sg = vma->pages->sgl, | ||
| 921 | .dma = sg_dma_address(iter.sg), | ||
| 922 | .max = iter.dma + iter.sg->length, | ||
| 923 | }; | ||
| 924 | struct gen8_insert_pte idx = gen8_insert_pte(vma->node.start); | 924 | struct gen8_insert_pte idx = gen8_insert_pte(vma->node.start); |
| 925 | 925 | ||
| 926 | gen8_ppgtt_insert_pte_entries(ppgtt, &ppgtt->pdp, &iter, &idx, | 926 | gen8_ppgtt_insert_pte_entries(ppgtt, &ppgtt->pdp, &iter, &idx, |
| @@ -933,11 +933,7 @@ static void gen8_ppgtt_insert_4lvl(struct i915_address_space *vm, | |||
| 933 | u32 unused) | 933 | u32 unused) |
| 934 | { | 934 | { |
| 935 | struct i915_hw_ppgtt *ppgtt = i915_vm_to_ppgtt(vm); | 935 | struct i915_hw_ppgtt *ppgtt = i915_vm_to_ppgtt(vm); |
| 936 | struct sgt_dma iter = { | 936 | struct sgt_dma iter = sgt_dma(vma); |
| 937 | .sg = vma->pages->sgl, | ||
| 938 | .dma = sg_dma_address(iter.sg), | ||
| 939 | .max = iter.dma + iter.sg->length, | ||
| 940 | }; | ||
| 941 | struct i915_page_directory_pointer **pdps = ppgtt->pml4.pdps; | 937 | struct i915_page_directory_pointer **pdps = ppgtt->pml4.pdps; |
| 942 | struct gen8_insert_pte idx = gen8_insert_pte(vma->node.start); | 938 | struct gen8_insert_pte idx = gen8_insert_pte(vma->node.start); |
| 943 | 939 | ||
| @@ -1632,13 +1628,10 @@ static void gen6_ppgtt_insert_entries(struct i915_address_space *vm, | |||
| 1632 | unsigned act_pt = first_entry / GEN6_PTES; | 1628 | unsigned act_pt = first_entry / GEN6_PTES; |
| 1633 | unsigned act_pte = first_entry % GEN6_PTES; | 1629 | unsigned act_pte = first_entry % GEN6_PTES; |
| 1634 | const u32 pte_encode = vm->pte_encode(0, cache_level, flags); | 1630 | const u32 pte_encode = vm->pte_encode(0, cache_level, flags); |
| 1635 | struct sgt_dma iter; | 1631 | struct sgt_dma iter = sgt_dma(vma); |
| 1636 | gen6_pte_t *vaddr; | 1632 | gen6_pte_t *vaddr; |
| 1637 | 1633 | ||
| 1638 | vaddr = kmap_atomic_px(ppgtt->pd.page_table[act_pt]); | 1634 | vaddr = kmap_atomic_px(ppgtt->pd.page_table[act_pt]); |
| 1639 | iter.sg = vma->pages->sgl; | ||
| 1640 | iter.dma = sg_dma_address(iter.sg); | ||
| 1641 | iter.max = iter.dma + iter.sg->length; | ||
| 1642 | do { | 1635 | do { |
| 1643 | vaddr[act_pte] = pte_encode | GEN6_PTE_ADDR_ENCODE(iter.dma); | 1636 | vaddr[act_pte] = pte_encode | GEN6_PTE_ADDR_ENCODE(iter.dma); |
| 1644 | 1637 | ||
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c index e84fee3ec4f3..184340d486c3 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | |||
| @@ -721,7 +721,7 @@ static int vmw_driver_load(struct drm_device *dev, unsigned long chipset) | |||
| 721 | * allocation taken by fbdev | 721 | * allocation taken by fbdev |
| 722 | */ | 722 | */ |
| 723 | if (!(dev_priv->capabilities & SVGA_CAP_3D)) | 723 | if (!(dev_priv->capabilities & SVGA_CAP_3D)) |
| 724 | mem_size *= 2; | 724 | mem_size *= 3; |
| 725 | 725 | ||
| 726 | dev_priv->max_mob_pages = mem_size * 1024 / PAGE_SIZE; | 726 | dev_priv->max_mob_pages = mem_size * 1024 / PAGE_SIZE; |
| 727 | dev_priv->prim_bb_mem = | 727 | dev_priv->prim_bb_mem = |
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c index 3bbad22b3748..d6b1c509ae01 100644 --- a/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c +++ b/drivers/gpu/drm/vmwgfx/vmwgfx_fence.c | |||
| @@ -224,7 +224,7 @@ out: | |||
| 224 | return ret; | 224 | return ret; |
| 225 | } | 225 | } |
| 226 | 226 | ||
| 227 | static struct dma_fence_ops vmw_fence_ops = { | 227 | static const struct dma_fence_ops vmw_fence_ops = { |
| 228 | .get_driver_name = vmw_fence_get_driver_name, | 228 | .get_driver_name = vmw_fence_get_driver_name, |
| 229 | .get_timeline_name = vmw_fence_get_timeline_name, | 229 | .get_timeline_name = vmw_fence_get_timeline_name, |
| 230 | .enable_signaling = vmw_fence_enable_signaling, | 230 | .enable_signaling = vmw_fence_enable_signaling, |
diff --git a/drivers/ide/ide-cd.c b/drivers/ide/ide-cd.c index a7355ab3bb22..6ff0be8cbdc9 100644 --- a/drivers/ide/ide-cd.c +++ b/drivers/ide/ide-cd.c | |||
| @@ -867,11 +867,16 @@ static void msf_from_bcd(struct atapi_msf *msf) | |||
| 867 | int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense) | 867 | int cdrom_check_status(ide_drive_t *drive, struct request_sense *sense) |
| 868 | { | 868 | { |
| 869 | struct cdrom_info *info = drive->driver_data; | 869 | struct cdrom_info *info = drive->driver_data; |
| 870 | struct cdrom_device_info *cdi = &info->devinfo; | 870 | struct cdrom_device_info *cdi; |
| 871 | unsigned char cmd[BLK_MAX_CDB]; | 871 | unsigned char cmd[BLK_MAX_CDB]; |
| 872 | 872 | ||
| 873 | ide_debug_log(IDE_DBG_FUNC, "enter"); | 873 | ide_debug_log(IDE_DBG_FUNC, "enter"); |
| 874 | 874 | ||
| 875 | if (!info) | ||
| 876 | return -EIO; | ||
| 877 | |||
| 878 | cdi = &info->devinfo; | ||
| 879 | |||
| 875 | memset(cmd, 0, BLK_MAX_CDB); | 880 | memset(cmd, 0, BLK_MAX_CDB); |
| 876 | cmd[0] = GPCMD_TEST_UNIT_READY; | 881 | cmd[0] = GPCMD_TEST_UNIT_READY; |
| 877 | 882 | ||
diff --git a/drivers/input/mouse/elan_i2c_core.c b/drivers/input/mouse/elan_i2c_core.c index 6d6b092e2da9..d6135900da64 100644 --- a/drivers/input/mouse/elan_i2c_core.c +++ b/drivers/input/mouse/elan_i2c_core.c | |||
| @@ -1258,6 +1258,7 @@ static const struct acpi_device_id elan_acpi_id[] = { | |||
| 1258 | { "ELAN0605", 0 }, | 1258 | { "ELAN0605", 0 }, |
| 1259 | { "ELAN0609", 0 }, | 1259 | { "ELAN0609", 0 }, |
| 1260 | { "ELAN060B", 0 }, | 1260 | { "ELAN060B", 0 }, |
| 1261 | { "ELAN060C", 0 }, | ||
| 1261 | { "ELAN0611", 0 }, | 1262 | { "ELAN0611", 0 }, |
| 1262 | { "ELAN1000", 0 }, | 1263 | { "ELAN1000", 0 }, |
| 1263 | { } | 1264 | { } |
diff --git a/drivers/input/rmi4/rmi_smbus.c b/drivers/input/rmi4/rmi_smbus.c index 225025a0940c..b6ccf39c6a7b 100644 --- a/drivers/input/rmi4/rmi_smbus.c +++ b/drivers/input/rmi4/rmi_smbus.c | |||
| @@ -312,7 +312,7 @@ static int rmi_smb_probe(struct i2c_client *client, | |||
| 312 | rmi_smb->xport.dev = &client->dev; | 312 | rmi_smb->xport.dev = &client->dev; |
| 313 | rmi_smb->xport.pdata = *pdata; | 313 | rmi_smb->xport.pdata = *pdata; |
| 314 | rmi_smb->xport.pdata.irq = client->irq; | 314 | rmi_smb->xport.pdata.irq = client->irq; |
| 315 | rmi_smb->xport.proto_name = "smb2"; | 315 | rmi_smb->xport.proto_name = "smb"; |
| 316 | rmi_smb->xport.ops = &rmi_smb_ops; | 316 | rmi_smb->xport.ops = &rmi_smb_ops; |
| 317 | 317 | ||
| 318 | smbus_version = rmi_smb_get_version(rmi_smb); | 318 | smbus_version = rmi_smb_get_version(rmi_smb); |
| @@ -322,7 +322,7 @@ static int rmi_smb_probe(struct i2c_client *client, | |||
| 322 | rmi_dbg(RMI_DEBUG_XPORT, &client->dev, "Smbus version is %d", | 322 | rmi_dbg(RMI_DEBUG_XPORT, &client->dev, "Smbus version is %d", |
| 323 | smbus_version); | 323 | smbus_version); |
| 324 | 324 | ||
| 325 | if (smbus_version != 2) { | 325 | if (smbus_version != 2 && smbus_version != 3) { |
| 326 | dev_err(&client->dev, "Unrecognized SMB version %d\n", | 326 | dev_err(&client->dev, "Unrecognized SMB version %d\n", |
| 327 | smbus_version); | 327 | smbus_version); |
| 328 | return -ENODEV; | 328 | return -ENODEV; |
diff --git a/drivers/input/touchscreen/tsc200x-core.c b/drivers/input/touchscreen/tsc200x-core.c index 88ea5e1b72ae..abf27578beb1 100644 --- a/drivers/input/touchscreen/tsc200x-core.c +++ b/drivers/input/touchscreen/tsc200x-core.c | |||
| @@ -531,6 +531,7 @@ int tsc200x_probe(struct device *dev, int irq, const struct input_id *tsc_id, | |||
| 531 | 531 | ||
| 532 | input_set_drvdata(input_dev, ts); | 532 | input_set_drvdata(input_dev, ts); |
| 533 | 533 | ||
| 534 | __set_bit(INPUT_PROP_DIRECT, input_dev->propbit); | ||
| 534 | input_set_capability(input_dev, EV_KEY, BTN_TOUCH); | 535 | input_set_capability(input_dev, EV_KEY, BTN_TOUCH); |
| 535 | 536 | ||
| 536 | input_set_abs_params(input_dev, ABS_X, | 537 | input_set_abs_params(input_dev, ABS_X, |
diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c index c99dc59d729b..b2db581131b2 100644 --- a/drivers/net/bonding/bond_main.c +++ b/drivers/net/bonding/bond_main.c | |||
| @@ -2042,6 +2042,7 @@ static int bond_miimon_inspect(struct bonding *bond) | |||
| 2042 | 2042 | ||
| 2043 | bond_for_each_slave_rcu(bond, slave, iter) { | 2043 | bond_for_each_slave_rcu(bond, slave, iter) { |
| 2044 | slave->new_link = BOND_LINK_NOCHANGE; | 2044 | slave->new_link = BOND_LINK_NOCHANGE; |
| 2045 | slave->link_new_state = slave->link; | ||
| 2045 | 2046 | ||
| 2046 | link_state = bond_check_dev_link(bond, slave->dev, 0); | 2047 | link_state = bond_check_dev_link(bond, slave->dev, 0); |
| 2047 | 2048 | ||
| @@ -3253,7 +3254,7 @@ u32 bond_xmit_hash(struct bonding *bond, struct sk_buff *skb) | |||
| 3253 | hash ^= (hash >> 16); | 3254 | hash ^= (hash >> 16); |
| 3254 | hash ^= (hash >> 8); | 3255 | hash ^= (hash >> 8); |
| 3255 | 3256 | ||
| 3256 | return hash; | 3257 | return hash >> 1; |
| 3257 | } | 3258 | } |
| 3258 | 3259 | ||
| 3259 | /*-------------------------- Device entry points ----------------------------*/ | 3260 | /*-------------------------- Device entry points ----------------------------*/ |
diff --git a/drivers/net/can/c_can/c_can_pci.c b/drivers/net/can/c_can/c_can_pci.c index cf7c18947189..d065c0e2d18e 100644 --- a/drivers/net/can/c_can/c_can_pci.c +++ b/drivers/net/can/c_can/c_can_pci.c | |||
| @@ -178,7 +178,6 @@ static int c_can_pci_probe(struct pci_dev *pdev, | |||
| 178 | break; | 178 | break; |
| 179 | case BOSCH_D_CAN: | 179 | case BOSCH_D_CAN: |
| 180 | priv->regs = reg_map_d_can; | 180 | priv->regs = reg_map_d_can; |
| 181 | priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES; | ||
| 182 | break; | 181 | break; |
| 183 | default: | 182 | default: |
| 184 | ret = -EINVAL; | 183 | ret = -EINVAL; |
diff --git a/drivers/net/can/c_can/c_can_platform.c b/drivers/net/can/c_can/c_can_platform.c index 46a746ee80bb..b5145a7f874c 100644 --- a/drivers/net/can/c_can/c_can_platform.c +++ b/drivers/net/can/c_can/c_can_platform.c | |||
| @@ -320,7 +320,6 @@ static int c_can_plat_probe(struct platform_device *pdev) | |||
| 320 | break; | 320 | break; |
| 321 | case BOSCH_D_CAN: | 321 | case BOSCH_D_CAN: |
| 322 | priv->regs = reg_map_d_can; | 322 | priv->regs = reg_map_d_can; |
| 323 | priv->can.ctrlmode_supported |= CAN_CTRLMODE_3_SAMPLES; | ||
| 324 | priv->read_reg = c_can_plat_read_reg_aligned_to_16bit; | 323 | priv->read_reg = c_can_plat_read_reg_aligned_to_16bit; |
| 325 | priv->write_reg = c_can_plat_write_reg_aligned_to_16bit; | 324 | priv->write_reg = c_can_plat_write_reg_aligned_to_16bit; |
| 326 | priv->read_reg32 = d_can_plat_read_reg32; | 325 | priv->read_reg32 = d_can_plat_read_reg32; |
diff --git a/drivers/net/can/ifi_canfd/ifi_canfd.c b/drivers/net/can/ifi_canfd/ifi_canfd.c index 4d1fe8d95042..2772d05ff11c 100644 --- a/drivers/net/can/ifi_canfd/ifi_canfd.c +++ b/drivers/net/can/ifi_canfd/ifi_canfd.c | |||
| @@ -670,9 +670,9 @@ static void ifi_canfd_set_bittiming(struct net_device *ndev) | |||
| 670 | priv->base + IFI_CANFD_FTIME); | 670 | priv->base + IFI_CANFD_FTIME); |
| 671 | 671 | ||
| 672 | /* Configure transmitter delay */ | 672 | /* Configure transmitter delay */ |
| 673 | tdc = (dbt->brp * (dbt->phase_seg1 + 1)) & IFI_CANFD_TDELAY_MASK; | 673 | tdc = dbt->brp * (dbt->prop_seg + dbt->phase_seg1); |
| 674 | writel(IFI_CANFD_TDELAY_EN | IFI_CANFD_TDELAY_ABS | tdc, | 674 | tdc &= IFI_CANFD_TDELAY_MASK; |
| 675 | priv->base + IFI_CANFD_TDELAY); | 675 | writel(IFI_CANFD_TDELAY_EN | tdc, priv->base + IFI_CANFD_TDELAY); |
| 676 | } | 676 | } |
| 677 | 677 | ||
| 678 | static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id, | 678 | static void ifi_canfd_set_filter(struct net_device *ndev, const u32 id, |
diff --git a/drivers/net/can/peak_canfd/peak_pciefd_main.c b/drivers/net/can/peak_canfd/peak_pciefd_main.c index 51c2d182a33a..b4efd711f824 100644 --- a/drivers/net/can/peak_canfd/peak_pciefd_main.c +++ b/drivers/net/can/peak_canfd/peak_pciefd_main.c | |||
| @@ -29,14 +29,19 @@ | |||
| 29 | #include "peak_canfd_user.h" | 29 | #include "peak_canfd_user.h" |
| 30 | 30 | ||
| 31 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); | 31 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); |
| 32 | MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe FD family cards"); | 32 | MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe/M.2 FD family cards"); |
| 33 | MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe FD CAN cards"); | 33 | MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe/M.2 FD CAN cards"); |
| 34 | MODULE_LICENSE("GPL v2"); | 34 | MODULE_LICENSE("GPL v2"); |
| 35 | 35 | ||
| 36 | #define PCIEFD_DRV_NAME "peak_pciefd" | 36 | #define PCIEFD_DRV_NAME "peak_pciefd" |
| 37 | 37 | ||
| 38 | #define PEAK_PCI_VENDOR_ID 0x001c /* The PCI device and vendor IDs */ | 38 | #define PEAK_PCI_VENDOR_ID 0x001c /* The PCI device and vendor IDs */ |
| 39 | #define PEAK_PCIEFD_ID 0x0013 /* for PCIe slot cards */ | 39 | #define PEAK_PCIEFD_ID 0x0013 /* for PCIe slot cards */ |
| 40 | #define PCAN_CPCIEFD_ID 0x0014 /* for Compact-PCI Serial slot cards */ | ||
| 41 | #define PCAN_PCIE104FD_ID 0x0017 /* for PCIe-104 Express slot cards */ | ||
| 42 | #define PCAN_MINIPCIEFD_ID 0x0018 /* for mini-PCIe slot cards */ | ||
| 43 | #define PCAN_PCIEFD_OEM_ID 0x0019 /* for PCIe slot OEM cards */ | ||
| 44 | #define PCAN_M2_ID 0x001a /* for M2 slot cards */ | ||
| 40 | 45 | ||
| 41 | /* PEAK PCIe board access description */ | 46 | /* PEAK PCIe board access description */ |
| 42 | #define PCIEFD_BAR0_SIZE (64 * 1024) | 47 | #define PCIEFD_BAR0_SIZE (64 * 1024) |
| @@ -203,6 +208,11 @@ struct pciefd_board { | |||
| 203 | /* supported device ids. */ | 208 | /* supported device ids. */ |
| 204 | static const struct pci_device_id peak_pciefd_tbl[] = { | 209 | static const struct pci_device_id peak_pciefd_tbl[] = { |
| 205 | {PEAK_PCI_VENDOR_ID, PEAK_PCIEFD_ID, PCI_ANY_ID, PCI_ANY_ID,}, | 210 | {PEAK_PCI_VENDOR_ID, PEAK_PCIEFD_ID, PCI_ANY_ID, PCI_ANY_ID,}, |
| 211 | {PEAK_PCI_VENDOR_ID, PCAN_CPCIEFD_ID, PCI_ANY_ID, PCI_ANY_ID,}, | ||
| 212 | {PEAK_PCI_VENDOR_ID, PCAN_PCIE104FD_ID, PCI_ANY_ID, PCI_ANY_ID,}, | ||
| 213 | {PEAK_PCI_VENDOR_ID, PCAN_MINIPCIEFD_ID, PCI_ANY_ID, PCI_ANY_ID,}, | ||
| 214 | {PEAK_PCI_VENDOR_ID, PCAN_PCIEFD_OEM_ID, PCI_ANY_ID, PCI_ANY_ID,}, | ||
| 215 | {PEAK_PCI_VENDOR_ID, PCAN_M2_ID, PCI_ANY_ID, PCI_ANY_ID,}, | ||
| 206 | {0,} | 216 | {0,} |
| 207 | }; | 217 | }; |
| 208 | 218 | ||
diff --git a/drivers/net/can/sun4i_can.c b/drivers/net/can/sun4i_can.c index b0c80859f746..1ac2090a1721 100644 --- a/drivers/net/can/sun4i_can.c +++ b/drivers/net/can/sun4i_can.c | |||
| @@ -539,6 +539,13 @@ static int sun4i_can_err(struct net_device *dev, u8 isrc, u8 status) | |||
| 539 | } | 539 | } |
| 540 | stats->rx_over_errors++; | 540 | stats->rx_over_errors++; |
| 541 | stats->rx_errors++; | 541 | stats->rx_errors++; |
| 542 | |||
| 543 | /* reset the CAN IP by entering reset mode | ||
| 544 | * ignoring timeout error | ||
| 545 | */ | ||
| 546 | set_reset_mode(dev); | ||
| 547 | set_normal_mode(dev); | ||
| 548 | |||
| 542 | /* clear bit */ | 549 | /* clear bit */ |
| 543 | sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG); | 550 | sun4i_can_write_cmdreg(priv, SUN4I_CMD_CLEAR_OR_FLAG); |
| 544 | } | 551 | } |
| @@ -653,8 +660,9 @@ static irqreturn_t sun4i_can_interrupt(int irq, void *dev_id) | |||
| 653 | netif_wake_queue(dev); | 660 | netif_wake_queue(dev); |
| 654 | can_led_event(dev, CAN_LED_EVENT_TX); | 661 | can_led_event(dev, CAN_LED_EVENT_TX); |
| 655 | } | 662 | } |
| 656 | if (isrc & SUN4I_INT_RBUF_VLD) { | 663 | if ((isrc & SUN4I_INT_RBUF_VLD) && |
| 657 | /* receive interrupt */ | 664 | !(isrc & SUN4I_INT_DATA_OR)) { |
| 665 | /* receive interrupt - don't read if overrun occurred */ | ||
| 658 | while (status & SUN4I_STA_RBUF_RDY) { | 666 | while (status & SUN4I_STA_RBUF_RDY) { |
| 659 | /* RX buffer is not empty */ | 667 | /* RX buffer is not empty */ |
| 660 | sun4i_can_rx(dev); | 668 | sun4i_can_rx(dev); |
diff --git a/drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h b/drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h index f2d623a7aee0..123e2c1b65f5 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h +++ b/drivers/net/ethernet/chelsio/cxgb4/t4fw_version.h | |||
| @@ -37,7 +37,7 @@ | |||
| 37 | 37 | ||
| 38 | #define T4FW_VERSION_MAJOR 0x01 | 38 | #define T4FW_VERSION_MAJOR 0x01 |
| 39 | #define T4FW_VERSION_MINOR 0x10 | 39 | #define T4FW_VERSION_MINOR 0x10 |
| 40 | #define T4FW_VERSION_MICRO 0x2D | 40 | #define T4FW_VERSION_MICRO 0x3F |
| 41 | #define T4FW_VERSION_BUILD 0x00 | 41 | #define T4FW_VERSION_BUILD 0x00 |
| 42 | 42 | ||
| 43 | #define T4FW_MIN_VERSION_MAJOR 0x01 | 43 | #define T4FW_MIN_VERSION_MAJOR 0x01 |
| @@ -46,7 +46,7 @@ | |||
| 46 | 46 | ||
| 47 | #define T5FW_VERSION_MAJOR 0x01 | 47 | #define T5FW_VERSION_MAJOR 0x01 |
| 48 | #define T5FW_VERSION_MINOR 0x10 | 48 | #define T5FW_VERSION_MINOR 0x10 |
| 49 | #define T5FW_VERSION_MICRO 0x2D | 49 | #define T5FW_VERSION_MICRO 0x3F |
| 50 | #define T5FW_VERSION_BUILD 0x00 | 50 | #define T5FW_VERSION_BUILD 0x00 |
| 51 | 51 | ||
| 52 | #define T5FW_MIN_VERSION_MAJOR 0x00 | 52 | #define T5FW_MIN_VERSION_MAJOR 0x00 |
| @@ -55,7 +55,7 @@ | |||
| 55 | 55 | ||
| 56 | #define T6FW_VERSION_MAJOR 0x01 | 56 | #define T6FW_VERSION_MAJOR 0x01 |
| 57 | #define T6FW_VERSION_MINOR 0x10 | 57 | #define T6FW_VERSION_MINOR 0x10 |
| 58 | #define T6FW_VERSION_MICRO 0x2D | 58 | #define T6FW_VERSION_MICRO 0x3F |
| 59 | #define T6FW_VERSION_BUILD 0x00 | 59 | #define T6FW_VERSION_BUILD 0x00 |
| 60 | 60 | ||
| 61 | #define T6FW_MIN_VERSION_MAJOR 0x00 | 61 | #define T6FW_MIN_VERSION_MAJOR 0x00 |
diff --git a/drivers/net/ethernet/marvell/mvpp2.c b/drivers/net/ethernet/marvell/mvpp2.c index a37af5813f33..fcf9ba5eb8d1 100644 --- a/drivers/net/ethernet/marvell/mvpp2.c +++ b/drivers/net/ethernet/marvell/mvpp2.c | |||
| @@ -6747,6 +6747,9 @@ static int mvpp2_irqs_init(struct mvpp2_port *port) | |||
| 6747 | for (i = 0; i < port->nqvecs; i++) { | 6747 | for (i = 0; i < port->nqvecs; i++) { |
| 6748 | struct mvpp2_queue_vector *qv = port->qvecs + i; | 6748 | struct mvpp2_queue_vector *qv = port->qvecs + i; |
| 6749 | 6749 | ||
| 6750 | if (qv->type == MVPP2_QUEUE_VECTOR_PRIVATE) | ||
| 6751 | irq_set_status_flags(qv->irq, IRQ_NO_BALANCING); | ||
| 6752 | |||
| 6750 | err = request_irq(qv->irq, mvpp2_isr, 0, port->dev->name, qv); | 6753 | err = request_irq(qv->irq, mvpp2_isr, 0, port->dev->name, qv); |
| 6751 | if (err) | 6754 | if (err) |
| 6752 | goto err; | 6755 | goto err; |
| @@ -6776,6 +6779,7 @@ static void mvpp2_irqs_deinit(struct mvpp2_port *port) | |||
| 6776 | struct mvpp2_queue_vector *qv = port->qvecs + i; | 6779 | struct mvpp2_queue_vector *qv = port->qvecs + i; |
| 6777 | 6780 | ||
| 6778 | irq_set_affinity_hint(qv->irq, NULL); | 6781 | irq_set_affinity_hint(qv->irq, NULL); |
| 6782 | irq_clear_status_flags(qv->irq, IRQ_NO_BALANCING); | ||
| 6779 | free_irq(qv->irq, qv); | 6783 | free_irq(qv->irq, qv); |
| 6780 | } | 6784 | } |
| 6781 | } | 6785 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/dev.c b/drivers/net/ethernet/mellanox/mlx5/core/dev.c index fc281712869b..17b723218b0c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/dev.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/dev.c | |||
| @@ -93,7 +93,7 @@ static void delayed_event_release(struct mlx5_device_context *dev_ctx, | |||
| 93 | list_splice_init(&priv->waiting_events_list, &temp); | 93 | list_splice_init(&priv->waiting_events_list, &temp); |
| 94 | if (!dev_ctx->context) | 94 | if (!dev_ctx->context) |
| 95 | goto out; | 95 | goto out; |
| 96 | list_for_each_entry_safe(de, n, &priv->waiting_events_list, list) | 96 | list_for_each_entry_safe(de, n, &temp, list) |
| 97 | dev_ctx->intf->event(dev, dev_ctx->context, de->event, de->param); | 97 | dev_ctx->intf->event(dev, dev_ctx->context, de->event, de->param); |
| 98 | 98 | ||
| 99 | out: | 99 | out: |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en.h b/drivers/net/ethernet/mellanox/mlx5/core/en.h index cc13d3dbd366..13b5ef9d8703 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en.h +++ b/drivers/net/ethernet/mellanox/mlx5/core/en.h | |||
| @@ -67,7 +67,7 @@ | |||
| 67 | #define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE 0xa | 67 | #define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE 0xa |
| 68 | #define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xd | 68 | #define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE 0xd |
| 69 | 69 | ||
| 70 | #define MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE_MPW 0x1 | 70 | #define MLX5E_PARAMS_MINIMUM_LOG_RQ_SIZE_MPW 0x2 |
| 71 | #define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE_MPW 0x3 | 71 | #define MLX5E_PARAMS_DEFAULT_LOG_RQ_SIZE_MPW 0x3 |
| 72 | #define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE_MPW 0x6 | 72 | #define MLX5E_PARAMS_MAXIMUM_LOG_RQ_SIZE_MPW 0x6 |
| 73 | 73 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c index 850cdc980ab5..4837045ffba3 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | |||
| @@ -365,21 +365,24 @@ static void mlx5e_execute_l2_action(struct mlx5e_priv *priv, | |||
| 365 | struct mlx5e_l2_hash_node *hn) | 365 | struct mlx5e_l2_hash_node *hn) |
| 366 | { | 366 | { |
| 367 | u8 action = hn->action; | 367 | u8 action = hn->action; |
| 368 | u8 mac_addr[ETH_ALEN]; | ||
| 368 | int l2_err = 0; | 369 | int l2_err = 0; |
| 369 | 370 | ||
| 371 | ether_addr_copy(mac_addr, hn->ai.addr); | ||
| 372 | |||
| 370 | switch (action) { | 373 | switch (action) { |
| 371 | case MLX5E_ACTION_ADD: | 374 | case MLX5E_ACTION_ADD: |
| 372 | mlx5e_add_l2_flow_rule(priv, &hn->ai, MLX5E_FULLMATCH); | 375 | mlx5e_add_l2_flow_rule(priv, &hn->ai, MLX5E_FULLMATCH); |
| 373 | if (!is_multicast_ether_addr(hn->ai.addr)) { | 376 | if (!is_multicast_ether_addr(mac_addr)) { |
| 374 | l2_err = mlx5_mpfs_add_mac(priv->mdev, hn->ai.addr); | 377 | l2_err = mlx5_mpfs_add_mac(priv->mdev, mac_addr); |
| 375 | hn->mpfs = !l2_err; | 378 | hn->mpfs = !l2_err; |
| 376 | } | 379 | } |
| 377 | hn->action = MLX5E_ACTION_NONE; | 380 | hn->action = MLX5E_ACTION_NONE; |
| 378 | break; | 381 | break; |
| 379 | 382 | ||
| 380 | case MLX5E_ACTION_DEL: | 383 | case MLX5E_ACTION_DEL: |
| 381 | if (!is_multicast_ether_addr(hn->ai.addr) && hn->mpfs) | 384 | if (!is_multicast_ether_addr(mac_addr) && hn->mpfs) |
| 382 | l2_err = mlx5_mpfs_del_mac(priv->mdev, hn->ai.addr); | 385 | l2_err = mlx5_mpfs_del_mac(priv->mdev, mac_addr); |
| 383 | mlx5e_del_l2_flow_rule(priv, &hn->ai); | 386 | mlx5e_del_l2_flow_rule(priv, &hn->ai); |
| 384 | mlx5e_del_l2_from_hash(hn); | 387 | mlx5e_del_l2_from_hash(hn); |
| 385 | break; | 388 | break; |
| @@ -387,7 +390,7 @@ static void mlx5e_execute_l2_action(struct mlx5e_priv *priv, | |||
| 387 | 390 | ||
| 388 | if (l2_err) | 391 | if (l2_err) |
| 389 | netdev_warn(priv->netdev, "MPFS, failed to %s mac %pM, err(%d)\n", | 392 | netdev_warn(priv->netdev, "MPFS, failed to %s mac %pM, err(%d)\n", |
| 390 | action == MLX5E_ACTION_ADD ? "add" : "del", hn->ai.addr, l2_err); | 393 | action == MLX5E_ACTION_ADD ? "add" : "del", mac_addr, l2_err); |
| 391 | } | 394 | } |
| 392 | 395 | ||
| 393 | static void mlx5e_sync_netdev_addr(struct mlx5e_priv *priv) | 396 | static void mlx5e_sync_netdev_addr(struct mlx5e_priv *priv) |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c index 15a1687483cc..91b1b0938931 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_rx.c | |||
| @@ -215,22 +215,20 @@ static inline bool mlx5e_rx_cache_get(struct mlx5e_rq *rq, | |||
| 215 | static inline int mlx5e_page_alloc_mapped(struct mlx5e_rq *rq, | 215 | static inline int mlx5e_page_alloc_mapped(struct mlx5e_rq *rq, |
| 216 | struct mlx5e_dma_info *dma_info) | 216 | struct mlx5e_dma_info *dma_info) |
| 217 | { | 217 | { |
| 218 | struct page *page; | ||
| 219 | |||
| 220 | if (mlx5e_rx_cache_get(rq, dma_info)) | 218 | if (mlx5e_rx_cache_get(rq, dma_info)) |
| 221 | return 0; | 219 | return 0; |
| 222 | 220 | ||
| 223 | page = dev_alloc_pages(rq->buff.page_order); | 221 | dma_info->page = dev_alloc_pages(rq->buff.page_order); |
| 224 | if (unlikely(!page)) | 222 | if (unlikely(!dma_info->page)) |
| 225 | return -ENOMEM; | 223 | return -ENOMEM; |
| 226 | 224 | ||
| 227 | dma_info->addr = dma_map_page(rq->pdev, page, 0, | 225 | dma_info->addr = dma_map_page(rq->pdev, dma_info->page, 0, |
| 228 | RQ_PAGE_SIZE(rq), rq->buff.map_dir); | 226 | RQ_PAGE_SIZE(rq), rq->buff.map_dir); |
| 229 | if (unlikely(dma_mapping_error(rq->pdev, dma_info->addr))) { | 227 | if (unlikely(dma_mapping_error(rq->pdev, dma_info->addr))) { |
| 230 | put_page(page); | 228 | put_page(dma_info->page); |
| 229 | dma_info->page = NULL; | ||
| 231 | return -ENOMEM; | 230 | return -ENOMEM; |
| 232 | } | 231 | } |
| 233 | dma_info->page = page; | ||
| 234 | 232 | ||
| 235 | return 0; | 233 | return 0; |
| 236 | } | 234 | } |
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c index e906b754415c..ab92298eafc3 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/en_txrx.c | |||
| @@ -49,7 +49,7 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget) | |||
| 49 | struct mlx5e_channel *c = container_of(napi, struct mlx5e_channel, | 49 | struct mlx5e_channel *c = container_of(napi, struct mlx5e_channel, |
| 50 | napi); | 50 | napi); |
| 51 | bool busy = false; | 51 | bool busy = false; |
| 52 | int work_done; | 52 | int work_done = 0; |
| 53 | int i; | 53 | int i; |
| 54 | 54 | ||
| 55 | for (i = 0; i < c->num_tc; i++) | 55 | for (i = 0; i < c->num_tc; i++) |
| @@ -58,15 +58,17 @@ int mlx5e_napi_poll(struct napi_struct *napi, int budget) | |||
| 58 | if (c->xdp) | 58 | if (c->xdp) |
| 59 | busy |= mlx5e_poll_xdpsq_cq(&c->rq.xdpsq.cq); | 59 | busy |= mlx5e_poll_xdpsq_cq(&c->rq.xdpsq.cq); |
| 60 | 60 | ||
| 61 | work_done = mlx5e_poll_rx_cq(&c->rq.cq, budget); | 61 | if (likely(budget)) { /* budget=0 means: don't poll rx rings */ |
| 62 | busy |= work_done == budget; | 62 | work_done = mlx5e_poll_rx_cq(&c->rq.cq, budget); |
| 63 | busy |= work_done == budget; | ||
| 64 | } | ||
| 63 | 65 | ||
| 64 | busy |= c->rq.post_wqes(&c->rq); | 66 | busy |= c->rq.post_wqes(&c->rq); |
| 65 | 67 | ||
| 66 | if (busy) { | 68 | if (busy) { |
| 67 | if (likely(mlx5e_channel_no_affinity_change(c))) | 69 | if (likely(mlx5e_channel_no_affinity_change(c))) |
| 68 | return budget; | 70 | return budget; |
| 69 | if (work_done == budget) | 71 | if (budget && work_done == budget) |
| 70 | work_done--; | 72 | work_done--; |
| 71 | } | 73 | } |
| 72 | 74 | ||
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/main.c b/drivers/net/ethernet/mellanox/mlx5/core/main.c index 0d2c8dcd6eae..06562c9a6b9c 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/main.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/main.c | |||
| @@ -1482,9 +1482,16 @@ static int mlx5_try_fast_unload(struct mlx5_core_dev *dev) | |||
| 1482 | return -EAGAIN; | 1482 | return -EAGAIN; |
| 1483 | } | 1483 | } |
| 1484 | 1484 | ||
| 1485 | /* Panic tear down fw command will stop the PCI bus communication | ||
| 1486 | * with the HCA, so the health polll is no longer needed. | ||
| 1487 | */ | ||
| 1488 | mlx5_drain_health_wq(dev); | ||
| 1489 | mlx5_stop_health_poll(dev); | ||
| 1490 | |||
| 1485 | ret = mlx5_cmd_force_teardown_hca(dev); | 1491 | ret = mlx5_cmd_force_teardown_hca(dev); |
| 1486 | if (ret) { | 1492 | if (ret) { |
| 1487 | mlx5_core_dbg(dev, "Firmware couldn't do fast unload error: %d\n", ret); | 1493 | mlx5_core_dbg(dev, "Firmware couldn't do fast unload error: %d\n", ret); |
| 1494 | mlx5_start_health_poll(dev); | ||
| 1488 | return ret; | 1495 | return ret; |
| 1489 | } | 1496 | } |
| 1490 | 1497 | ||
diff --git a/drivers/net/usb/asix_devices.c b/drivers/net/usb/asix_devices.c index b2ff88e69a81..3d4f7959dabb 100644 --- a/drivers/net/usb/asix_devices.c +++ b/drivers/net/usb/asix_devices.c | |||
| @@ -626,7 +626,7 @@ static int asix_suspend(struct usb_interface *intf, pm_message_t message) | |||
| 626 | struct usbnet *dev = usb_get_intfdata(intf); | 626 | struct usbnet *dev = usb_get_intfdata(intf); |
| 627 | struct asix_common_private *priv = dev->driver_priv; | 627 | struct asix_common_private *priv = dev->driver_priv; |
| 628 | 628 | ||
| 629 | if (priv->suspend) | 629 | if (priv && priv->suspend) |
| 630 | priv->suspend(dev); | 630 | priv->suspend(dev); |
| 631 | 631 | ||
| 632 | return usbnet_suspend(intf, message); | 632 | return usbnet_suspend(intf, message); |
| @@ -678,7 +678,7 @@ static int asix_resume(struct usb_interface *intf) | |||
| 678 | struct usbnet *dev = usb_get_intfdata(intf); | 678 | struct usbnet *dev = usb_get_intfdata(intf); |
| 679 | struct asix_common_private *priv = dev->driver_priv; | 679 | struct asix_common_private *priv = dev->driver_priv; |
| 680 | 680 | ||
| 681 | if (priv->resume) | 681 | if (priv && priv->resume) |
| 682 | priv->resume(dev); | 682 | priv->resume(dev); |
| 683 | 683 | ||
| 684 | return usbnet_resume(intf); | 684 | return usbnet_resume(intf); |
diff --git a/drivers/net/usb/cdc_ether.c b/drivers/net/usb/cdc_ether.c index 3e7a3ac3a362..05dca3e5c93d 100644 --- a/drivers/net/usb/cdc_ether.c +++ b/drivers/net/usb/cdc_ether.c | |||
| @@ -230,7 +230,7 @@ skip: | |||
| 230 | goto bad_desc; | 230 | goto bad_desc; |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | if (header.usb_cdc_ether_desc) { | 233 | if (header.usb_cdc_ether_desc && info->ether->wMaxSegmentSize) { |
| 234 | dev->hard_mtu = le16_to_cpu(info->ether->wMaxSegmentSize); | 234 | dev->hard_mtu = le16_to_cpu(info->ether->wMaxSegmentSize); |
| 235 | /* because of Zaurus, we may be ignoring the host | 235 | /* because of Zaurus, we may be ignoring the host |
| 236 | * side link address we were given. | 236 | * side link address we were given. |
diff --git a/drivers/net/usb/qmi_wwan.c b/drivers/net/usb/qmi_wwan.c index 8c3733608271..8d4a6f7cba61 100644 --- a/drivers/net/usb/qmi_wwan.c +++ b/drivers/net/usb/qmi_wwan.c | |||
| @@ -499,6 +499,7 @@ static int qmi_wwan_rx_fixup(struct usbnet *dev, struct sk_buff *skb) | |||
| 499 | return 1; | 499 | return 1; |
| 500 | } | 500 | } |
| 501 | if (rawip) { | 501 | if (rawip) { |
| 502 | skb_reset_mac_header(skb); | ||
| 502 | skb->dev = dev->net; /* normally set by eth_type_trans */ | 503 | skb->dev = dev->net; /* normally set by eth_type_trans */ |
| 503 | skb->protocol = proto; | 504 | skb->protocol = proto; |
| 504 | return 1; | 505 | return 1; |
| @@ -681,7 +682,7 @@ static int qmi_wwan_bind(struct usbnet *dev, struct usb_interface *intf) | |||
| 681 | } | 682 | } |
| 682 | 683 | ||
| 683 | /* errors aren't fatal - we can live with the dynamic address */ | 684 | /* errors aren't fatal - we can live with the dynamic address */ |
| 684 | if (cdc_ether) { | 685 | if (cdc_ether && cdc_ether->wMaxSegmentSize) { |
| 685 | dev->hard_mtu = le16_to_cpu(cdc_ether->wMaxSegmentSize); | 686 | dev->hard_mtu = le16_to_cpu(cdc_ether->wMaxSegmentSize); |
| 686 | usbnet_get_ethernet_addr(dev, cdc_ether->iMACAddress); | 687 | usbnet_get_ethernet_addr(dev, cdc_ether->iMACAddress); |
| 687 | } | 688 | } |
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c index ad3ea24f0885..bcc1694cebcd 100644 --- a/drivers/scsi/scsi_lib.c +++ b/drivers/scsi/scsi_lib.c | |||
| @@ -2685,7 +2685,6 @@ scsi_device_set_state(struct scsi_device *sdev, enum scsi_device_state state) | |||
| 2685 | 2685 | ||
| 2686 | } | 2686 | } |
| 2687 | sdev->sdev_state = state; | 2687 | sdev->sdev_state = state; |
| 2688 | sysfs_notify(&sdev->sdev_gendev.kobj, NULL, "state"); | ||
| 2689 | return 0; | 2688 | return 0; |
| 2690 | 2689 | ||
| 2691 | illegal: | 2690 | illegal: |
| @@ -3109,7 +3108,6 @@ int scsi_internal_device_unblock_nowait(struct scsi_device *sdev, | |||
| 3109 | case SDEV_BLOCK: | 3108 | case SDEV_BLOCK: |
| 3110 | case SDEV_TRANSPORT_OFFLINE: | 3109 | case SDEV_TRANSPORT_OFFLINE: |
| 3111 | sdev->sdev_state = new_state; | 3110 | sdev->sdev_state = new_state; |
| 3112 | sysfs_notify(&sdev->sdev_gendev.kobj, NULL, "state"); | ||
| 3113 | break; | 3111 | break; |
| 3114 | case SDEV_CREATED_BLOCK: | 3112 | case SDEV_CREATED_BLOCK: |
| 3115 | if (new_state == SDEV_TRANSPORT_OFFLINE || | 3113 | if (new_state == SDEV_TRANSPORT_OFFLINE || |
| @@ -3117,7 +3115,6 @@ int scsi_internal_device_unblock_nowait(struct scsi_device *sdev, | |||
| 3117 | sdev->sdev_state = new_state; | 3115 | sdev->sdev_state = new_state; |
| 3118 | else | 3116 | else |
| 3119 | sdev->sdev_state = SDEV_CREATED; | 3117 | sdev->sdev_state = SDEV_CREATED; |
| 3120 | sysfs_notify(&sdev->sdev_gendev.kobj, NULL, "state"); | ||
| 3121 | break; | 3118 | break; |
| 3122 | case SDEV_CANCEL: | 3119 | case SDEV_CANCEL: |
| 3123 | case SDEV_OFFLINE: | 3120 | case SDEV_OFFLINE: |
diff --git a/drivers/scsi/scsi_transport_srp.c b/drivers/scsi/scsi_transport_srp.c index 4f6f01cf9968..36f6190931bc 100644 --- a/drivers/scsi/scsi_transport_srp.c +++ b/drivers/scsi/scsi_transport_srp.c | |||
| @@ -556,11 +556,8 @@ int srp_reconnect_rport(struct srp_rport *rport) | |||
| 556 | */ | 556 | */ |
| 557 | shost_for_each_device(sdev, shost) { | 557 | shost_for_each_device(sdev, shost) { |
| 558 | mutex_lock(&sdev->state_mutex); | 558 | mutex_lock(&sdev->state_mutex); |
| 559 | if (sdev->sdev_state == SDEV_OFFLINE) { | 559 | if (sdev->sdev_state == SDEV_OFFLINE) |
| 560 | sdev->sdev_state = SDEV_RUNNING; | 560 | sdev->sdev_state = SDEV_RUNNING; |
| 561 | sysfs_notify(&sdev->sdev_gendev.kobj, | ||
| 562 | NULL, "state"); | ||
| 563 | } | ||
| 564 | mutex_unlock(&sdev->state_mutex); | 561 | mutex_unlock(&sdev->state_mutex); |
| 565 | } | 562 | } |
| 566 | } else if (rport->state == SRP_RPORT_RUNNING) { | 563 | } else if (rport->state == SRP_RPORT_RUNNING) { |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 72299ef00061..d448a4804aea 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -3770,6 +3770,13 @@ static inline void nf_reset_trace(struct sk_buff *skb) | |||
| 3770 | #endif | 3770 | #endif |
| 3771 | } | 3771 | } |
| 3772 | 3772 | ||
| 3773 | static inline void ipvs_reset(struct sk_buff *skb) | ||
| 3774 | { | ||
| 3775 | #if IS_ENABLED(CONFIG_IP_VS) | ||
| 3776 | skb->ipvs_property = 0; | ||
| 3777 | #endif | ||
| 3778 | } | ||
| 3779 | |||
| 3773 | /* Note: This doesn't put any conntrack and bridge info in dst. */ | 3780 | /* Note: This doesn't put any conntrack and bridge info in dst. */ |
| 3774 | static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src, | 3781 | static inline void __nf_copy(struct sk_buff *dst, const struct sk_buff *src, |
| 3775 | bool copy) | 3782 | bool copy) |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 74f91eefeccf..b769ecfcc3bd 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
| @@ -213,6 +213,11 @@ static inline struct ctl_table_header *register_sysctl_paths( | |||
| 213 | return NULL; | 213 | return NULL; |
| 214 | } | 214 | } |
| 215 | 215 | ||
| 216 | static inline struct ctl_table_header *register_sysctl(const char *path, struct ctl_table *table) | ||
| 217 | { | ||
| 218 | return NULL; | ||
| 219 | } | ||
| 220 | |||
| 216 | static inline void unregister_sysctl_table(struct ctl_table_header * table) | 221 | static inline void unregister_sysctl_table(struct ctl_table_header * table) |
| 217 | { | 222 | { |
| 218 | } | 223 | } |
diff --git a/include/net/act_api.h b/include/net/act_api.h index 1e6df0eb058f..a10a3b1813f3 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h | |||
| @@ -14,7 +14,6 @@ | |||
| 14 | struct tcf_idrinfo { | 14 | struct tcf_idrinfo { |
| 15 | spinlock_t lock; | 15 | spinlock_t lock; |
| 16 | struct idr action_idr; | 16 | struct idr action_idr; |
| 17 | struct net *net; | ||
| 18 | }; | 17 | }; |
| 19 | 18 | ||
| 20 | struct tc_action_ops; | 19 | struct tc_action_ops; |
| @@ -106,7 +105,7 @@ struct tc_action_net { | |||
| 106 | 105 | ||
| 107 | static inline | 106 | static inline |
| 108 | int tc_action_net_init(struct tc_action_net *tn, | 107 | int tc_action_net_init(struct tc_action_net *tn, |
| 109 | const struct tc_action_ops *ops, struct net *net) | 108 | const struct tc_action_ops *ops) |
| 110 | { | 109 | { |
| 111 | int err = 0; | 110 | int err = 0; |
| 112 | 111 | ||
| @@ -114,7 +113,6 @@ int tc_action_net_init(struct tc_action_net *tn, | |||
| 114 | if (!tn->idrinfo) | 113 | if (!tn->idrinfo) |
| 115 | return -ENOMEM; | 114 | return -ENOMEM; |
| 116 | tn->ops = ops; | 115 | tn->ops = ops; |
| 117 | tn->idrinfo->net = net; | ||
| 118 | spin_lock_init(&tn->idrinfo->lock); | 116 | spin_lock_init(&tn->idrinfo->lock); |
| 119 | idr_init(&tn->idrinfo->action_idr); | 117 | idr_init(&tn->idrinfo->action_idr); |
| 120 | return err; | 118 | return err; |
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index 70ca2437740e..8826747ef83e 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h | |||
| @@ -94,6 +94,7 @@ struct tcf_exts { | |||
| 94 | __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ | 94 | __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ |
| 95 | int nr_actions; | 95 | int nr_actions; |
| 96 | struct tc_action **actions; | 96 | struct tc_action **actions; |
| 97 | struct net *net; | ||
| 97 | #endif | 98 | #endif |
| 98 | /* Map to export classifier specific extension TLV types to the | 99 | /* Map to export classifier specific extension TLV types to the |
| 99 | * generic extensions API. Unsupported extensions must be set to 0. | 100 | * generic extensions API. Unsupported extensions must be set to 0. |
| @@ -107,6 +108,7 @@ static inline int tcf_exts_init(struct tcf_exts *exts, int action, int police) | |||
| 107 | #ifdef CONFIG_NET_CLS_ACT | 108 | #ifdef CONFIG_NET_CLS_ACT |
| 108 | exts->type = 0; | 109 | exts->type = 0; |
| 109 | exts->nr_actions = 0; | 110 | exts->nr_actions = 0; |
| 111 | exts->net = NULL; | ||
| 110 | exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *), | 112 | exts->actions = kcalloc(TCA_ACT_MAX_PRIO, sizeof(struct tc_action *), |
| 111 | GFP_KERNEL); | 113 | GFP_KERNEL); |
| 112 | if (!exts->actions) | 114 | if (!exts->actions) |
| @@ -117,6 +119,28 @@ static inline int tcf_exts_init(struct tcf_exts *exts, int action, int police) | |||
| 117 | return 0; | 119 | return 0; |
| 118 | } | 120 | } |
| 119 | 121 | ||
| 122 | /* Return false if the netns is being destroyed in cleanup_net(). Callers | ||
| 123 | * need to do cleanup synchronously in this case, otherwise may race with | ||
| 124 | * tc_action_net_exit(). Return true for other cases. | ||
| 125 | */ | ||
| 126 | static inline bool tcf_exts_get_net(struct tcf_exts *exts) | ||
| 127 | { | ||
| 128 | #ifdef CONFIG_NET_CLS_ACT | ||
| 129 | exts->net = maybe_get_net(exts->net); | ||
| 130 | return exts->net != NULL; | ||
| 131 | #else | ||
| 132 | return true; | ||
| 133 | #endif | ||
| 134 | } | ||
| 135 | |||
| 136 | static inline void tcf_exts_put_net(struct tcf_exts *exts) | ||
| 137 | { | ||
| 138 | #ifdef CONFIG_NET_CLS_ACT | ||
| 139 | if (exts->net) | ||
| 140 | put_net(exts->net); | ||
| 141 | #endif | ||
| 142 | } | ||
| 143 | |||
| 120 | static inline void tcf_exts_to_list(const struct tcf_exts *exts, | 144 | static inline void tcf_exts_to_list(const struct tcf_exts *exts, |
| 121 | struct list_head *actions) | 145 | struct list_head *actions) |
| 122 | { | 146 | { |
diff --git a/include/sound/seq_kernel.h b/include/sound/seq_kernel.h index feb58d455560..4b9ee3009aa0 100644 --- a/include/sound/seq_kernel.h +++ b/include/sound/seq_kernel.h | |||
| @@ -49,7 +49,8 @@ typedef union snd_seq_timestamp snd_seq_timestamp_t; | |||
| 49 | #define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS 200 | 49 | #define SNDRV_SEQ_DEFAULT_CLIENT_EVENTS 200 |
| 50 | 50 | ||
| 51 | /* max delivery path length */ | 51 | /* max delivery path length */ |
| 52 | #define SNDRV_SEQ_MAX_HOPS 10 | 52 | /* NOTE: this shouldn't be greater than MAX_LOCKDEP_SUBCLASSES */ |
| 53 | #define SNDRV_SEQ_MAX_HOPS 8 | ||
| 53 | 54 | ||
| 54 | /* max size of event size */ | 55 | /* max size of event size */ |
| 55 | #define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff | 56 | #define SNDRV_SEQ_MAX_EVENT_LEN 0x3fffffff |
diff --git a/include/sound/timer.h b/include/sound/timer.h index c4d76ff056c6..7ae226ab6990 100644 --- a/include/sound/timer.h +++ b/include/sound/timer.h | |||
| @@ -90,6 +90,8 @@ struct snd_timer { | |||
| 90 | struct list_head ack_list_head; | 90 | struct list_head ack_list_head; |
| 91 | struct list_head sack_list_head; /* slow ack list head */ | 91 | struct list_head sack_list_head; /* slow ack list head */ |
| 92 | struct tasklet_struct task_queue; | 92 | struct tasklet_struct task_queue; |
| 93 | int max_instances; /* upper limit of timer instances */ | ||
| 94 | int num_instances; /* current number of timer instances */ | ||
| 93 | }; | 95 | }; |
| 94 | 96 | ||
| 95 | struct snd_timer_instance { | 97 | struct snd_timer_instance { |
diff --git a/include/uapi/drm/i915_drm.h b/include/uapi/drm/i915_drm.h index 6598fb76d2c2..9816590d3ad2 100644 --- a/include/uapi/drm/i915_drm.h +++ b/include/uapi/drm/i915_drm.h | |||
| @@ -829,6 +829,7 @@ struct drm_i915_gem_exec_fence { | |||
| 829 | 829 | ||
| 830 | #define I915_EXEC_FENCE_WAIT (1<<0) | 830 | #define I915_EXEC_FENCE_WAIT (1<<0) |
| 831 | #define I915_EXEC_FENCE_SIGNAL (1<<1) | 831 | #define I915_EXEC_FENCE_SIGNAL (1<<1) |
| 832 | #define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1)) | ||
| 832 | __u32 flags; | 833 | __u32 flags; |
| 833 | }; | 834 | }; |
| 834 | 835 | ||
diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c index 9209d83ecdcf..ba0da243fdd8 100644 --- a/kernel/sched/cpufreq_schedutil.c +++ b/kernel/sched/cpufreq_schedutil.c | |||
| @@ -649,6 +649,7 @@ static int sugov_start(struct cpufreq_policy *policy) | |||
| 649 | struct sugov_cpu *sg_cpu = &per_cpu(sugov_cpu, cpu); | 649 | struct sugov_cpu *sg_cpu = &per_cpu(sugov_cpu, cpu); |
| 650 | 650 | ||
| 651 | memset(sg_cpu, 0, sizeof(*sg_cpu)); | 651 | memset(sg_cpu, 0, sizeof(*sg_cpu)); |
| 652 | sg_cpu->cpu = cpu; | ||
| 652 | sg_cpu->sg_policy = sg_policy; | 653 | sg_cpu->sg_policy = sg_policy; |
| 653 | sg_cpu->flags = SCHED_CPUFREQ_RT; | 654 | sg_cpu->flags = SCHED_CPUFREQ_RT; |
| 654 | sg_cpu->iowait_boost_max = policy->cpuinfo.max_freq; | 655 | sg_cpu->iowait_boost_max = policy->cpuinfo.max_freq; |
| @@ -714,11 +715,6 @@ struct cpufreq_governor *cpufreq_default_governor(void) | |||
| 714 | 715 | ||
| 715 | static int __init sugov_register(void) | 716 | static int __init sugov_register(void) |
| 716 | { | 717 | { |
| 717 | int cpu; | ||
| 718 | |||
| 719 | for_each_possible_cpu(cpu) | ||
| 720 | per_cpu(sugov_cpu, cpu).cpu = cpu; | ||
| 721 | |||
| 722 | return cpufreq_register_governor(&schedutil_gov); | 718 | return cpufreq_register_governor(&schedutil_gov); |
| 723 | } | 719 | } |
| 724 | fs_initcall(sugov_register); | 720 | fs_initcall(sugov_register); |
diff --git a/lib/asn1_decoder.c b/lib/asn1_decoder.c index fef5d2e114be..1ef0cec38d78 100644 --- a/lib/asn1_decoder.c +++ b/lib/asn1_decoder.c | |||
| @@ -228,7 +228,7 @@ next_op: | |||
| 228 | hdr = 2; | 228 | hdr = 2; |
| 229 | 229 | ||
| 230 | /* Extract a tag from the data */ | 230 | /* Extract a tag from the data */ |
| 231 | if (unlikely(dp >= datalen - 1)) | 231 | if (unlikely(datalen - dp < 2)) |
| 232 | goto data_overrun_error; | 232 | goto data_overrun_error; |
| 233 | tag = data[dp++]; | 233 | tag = data[dp++]; |
| 234 | if (unlikely((tag & 0x1f) == ASN1_LONG_TAG)) | 234 | if (unlikely((tag & 0x1f) == ASN1_LONG_TAG)) |
| @@ -274,7 +274,7 @@ next_op: | |||
| 274 | int n = len - 0x80; | 274 | int n = len - 0x80; |
| 275 | if (unlikely(n > 2)) | 275 | if (unlikely(n > 2)) |
| 276 | goto length_too_long; | 276 | goto length_too_long; |
| 277 | if (unlikely(dp >= datalen - n)) | 277 | if (unlikely(n > datalen - dp)) |
| 278 | goto data_overrun_error; | 278 | goto data_overrun_error; |
| 279 | hdr += n; | 279 | hdr += n; |
| 280 | for (len = 0; n > 0; n--) { | 280 | for (len = 0; n > 0; n--) { |
diff --git a/net/8021q/vlan.c b/net/8021q/vlan.c index 9649579b5b9f..4a72ee4e2ae9 100644 --- a/net/8021q/vlan.c +++ b/net/8021q/vlan.c | |||
| @@ -376,6 +376,9 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, | |||
| 376 | dev->name); | 376 | dev->name); |
| 377 | vlan_vid_add(dev, htons(ETH_P_8021Q), 0); | 377 | vlan_vid_add(dev, htons(ETH_P_8021Q), 0); |
| 378 | } | 378 | } |
| 379 | if (event == NETDEV_DOWN && | ||
| 380 | (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER)) | ||
| 381 | vlan_vid_del(dev, htons(ETH_P_8021Q), 0); | ||
| 379 | 382 | ||
| 380 | vlan_info = rtnl_dereference(dev->vlan_info); | 383 | vlan_info = rtnl_dereference(dev->vlan_info); |
| 381 | if (!vlan_info) | 384 | if (!vlan_info) |
| @@ -423,9 +426,6 @@ static int vlan_device_event(struct notifier_block *unused, unsigned long event, | |||
| 423 | struct net_device *tmp; | 426 | struct net_device *tmp; |
| 424 | LIST_HEAD(close_list); | 427 | LIST_HEAD(close_list); |
| 425 | 428 | ||
| 426 | if (dev->features & NETIF_F_HW_VLAN_CTAG_FILTER) | ||
| 427 | vlan_vid_del(dev, htons(ETH_P_8021Q), 0); | ||
| 428 | |||
| 429 | /* Put all VLANs for this dev in the down state too. */ | 429 | /* Put all VLANs for this dev in the down state too. */ |
| 430 | vlan_group_for_each_dev(grp, i, vlandev) { | 430 | vlan_group_for_each_dev(grp, i, vlandev) { |
| 431 | flgs = vlandev->flags; | 431 | flgs = vlandev->flags; |
diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 24656076906d..e140ba49b30a 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c | |||
| @@ -4864,6 +4864,7 @@ void skb_scrub_packet(struct sk_buff *skb, bool xnet) | |||
| 4864 | if (!xnet) | 4864 | if (!xnet) |
| 4865 | return; | 4865 | return; |
| 4866 | 4866 | ||
| 4867 | ipvs_reset(skb); | ||
| 4867 | skb_orphan(skb); | 4868 | skb_orphan(skb); |
| 4868 | skb->mark = 0; | 4869 | skb->mark = 0; |
| 4869 | } | 4870 | } |
diff --git a/net/dsa/switch.c b/net/dsa/switch.c index e6c06aa349a6..1e2929f4290a 100644 --- a/net/dsa/switch.c +++ b/net/dsa/switch.c | |||
| @@ -133,6 +133,8 @@ static int dsa_switch_mdb_add(struct dsa_switch *ds, | |||
| 133 | if (err) | 133 | if (err) |
| 134 | return err; | 134 | return err; |
| 135 | } | 135 | } |
| 136 | |||
| 137 | return 0; | ||
| 136 | } | 138 | } |
| 137 | 139 | ||
| 138 | for_each_set_bit(port, group, ds->num_ports) | 140 | for_each_set_bit(port, group, ds->num_ports) |
| @@ -180,6 +182,8 @@ static int dsa_switch_vlan_add(struct dsa_switch *ds, | |||
| 180 | if (err) | 182 | if (err) |
| 181 | return err; | 183 | return err; |
| 182 | } | 184 | } |
| 185 | |||
| 186 | return 0; | ||
| 183 | } | 187 | } |
| 184 | 188 | ||
| 185 | for_each_set_bit(port, members, ds->num_ports) | 189 | for_each_set_bit(port, members, ds->num_ports) |
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 5a87a00641d3..b6bb3cdfad09 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c | |||
| @@ -115,7 +115,7 @@ int sysctl_tcp_invalid_ratelimit __read_mostly = HZ/2; | |||
| 115 | 115 | ||
| 116 | #define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED) | 116 | #define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED) |
| 117 | #define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED) | 117 | #define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED) |
| 118 | #define FLAG_CA_ALERT (FLAG_DATA_SACKED|FLAG_ECE) | 118 | #define FLAG_CA_ALERT (FLAG_DATA_SACKED|FLAG_ECE|FLAG_DSACKING_ACK) |
| 119 | #define FLAG_FORWARD_PROGRESS (FLAG_ACKED|FLAG_DATA_SACKED) | 119 | #define FLAG_FORWARD_PROGRESS (FLAG_ACKED|FLAG_DATA_SACKED) |
| 120 | 120 | ||
| 121 | #define TCP_REMNANT (TCP_FLAG_FIN|TCP_FLAG_URG|TCP_FLAG_SYN|TCP_FLAG_PSH) | 121 | #define TCP_REMNANT (TCP_FLAG_FIN|TCP_FLAG_URG|TCP_FLAG_SYN|TCP_FLAG_PSH) |
| @@ -2615,7 +2615,6 @@ void tcp_simple_retransmit(struct sock *sk) | |||
| 2615 | struct tcp_sock *tp = tcp_sk(sk); | 2615 | struct tcp_sock *tp = tcp_sk(sk); |
| 2616 | struct sk_buff *skb; | 2616 | struct sk_buff *skb; |
| 2617 | unsigned int mss = tcp_current_mss(sk); | 2617 | unsigned int mss = tcp_current_mss(sk); |
| 2618 | u32 prior_lost = tp->lost_out; | ||
| 2619 | 2618 | ||
| 2620 | tcp_for_write_queue(skb, sk) { | 2619 | tcp_for_write_queue(skb, sk) { |
| 2621 | if (skb == tcp_send_head(sk)) | 2620 | if (skb == tcp_send_head(sk)) |
| @@ -2632,7 +2631,7 @@ void tcp_simple_retransmit(struct sock *sk) | |||
| 2632 | 2631 | ||
| 2633 | tcp_clear_retrans_hints_partial(tp); | 2632 | tcp_clear_retrans_hints_partial(tp); |
| 2634 | 2633 | ||
| 2635 | if (prior_lost == tp->lost_out) | 2634 | if (!tp->lost_out) |
| 2636 | return; | 2635 | return; |
| 2637 | 2636 | ||
| 2638 | if (tcp_is_reno(tp)) | 2637 | if (tcp_is_reno(tp)) |
diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c index 11f69bbf9307..b6a2aa1dcf56 100644 --- a/net/ipv4/tcp_offload.c +++ b/net/ipv4/tcp_offload.c | |||
| @@ -149,11 +149,19 @@ struct sk_buff *tcp_gso_segment(struct sk_buff *skb, | |||
| 149 | * is freed by GSO engine | 149 | * is freed by GSO engine |
| 150 | */ | 150 | */ |
| 151 | if (copy_destructor) { | 151 | if (copy_destructor) { |
| 152 | int delta; | ||
| 153 | |||
| 152 | swap(gso_skb->sk, skb->sk); | 154 | swap(gso_skb->sk, skb->sk); |
| 153 | swap(gso_skb->destructor, skb->destructor); | 155 | swap(gso_skb->destructor, skb->destructor); |
| 154 | sum_truesize += skb->truesize; | 156 | sum_truesize += skb->truesize; |
| 155 | refcount_add(sum_truesize - gso_skb->truesize, | 157 | delta = sum_truesize - gso_skb->truesize; |
| 156 | &skb->sk->sk_wmem_alloc); | 158 | /* In some pathological cases, delta can be negative. |
| 159 | * We need to either use refcount_add() or refcount_sub_and_test() | ||
| 160 | */ | ||
| 161 | if (likely(delta >= 0)) | ||
| 162 | refcount_add(delta, &skb->sk->sk_wmem_alloc); | ||
| 163 | else | ||
| 164 | WARN_ON_ONCE(refcount_sub_and_test(-delta, &skb->sk->sk_wmem_alloc)); | ||
| 157 | } | 165 | } |
| 158 | 166 | ||
| 159 | delta = htonl(oldlen + (skb_tail_pointer(skb) - | 167 | delta = htonl(oldlen + (skb_tail_pointer(skb) - |
diff --git a/net/l2tp/l2tp_ip.c b/net/l2tp/l2tp_ip.c index 4d322c1b7233..e4280b6568b4 100644 --- a/net/l2tp/l2tp_ip.c +++ b/net/l2tp/l2tp_ip.c | |||
| @@ -123,6 +123,7 @@ static int l2tp_ip_recv(struct sk_buff *skb) | |||
| 123 | unsigned char *ptr, *optr; | 123 | unsigned char *ptr, *optr; |
| 124 | struct l2tp_session *session; | 124 | struct l2tp_session *session; |
| 125 | struct l2tp_tunnel *tunnel = NULL; | 125 | struct l2tp_tunnel *tunnel = NULL; |
| 126 | struct iphdr *iph; | ||
| 126 | int length; | 127 | int length; |
| 127 | 128 | ||
| 128 | if (!pskb_may_pull(skb, 4)) | 129 | if (!pskb_may_pull(skb, 4)) |
| @@ -178,24 +179,17 @@ pass_up: | |||
| 178 | goto discard; | 179 | goto discard; |
| 179 | 180 | ||
| 180 | tunnel_id = ntohl(*(__be32 *) &skb->data[4]); | 181 | tunnel_id = ntohl(*(__be32 *) &skb->data[4]); |
| 181 | tunnel = l2tp_tunnel_find(net, tunnel_id); | 182 | iph = (struct iphdr *)skb_network_header(skb); |
| 182 | if (tunnel) { | ||
| 183 | sk = tunnel->sock; | ||
| 184 | sock_hold(sk); | ||
| 185 | } else { | ||
| 186 | struct iphdr *iph = (struct iphdr *) skb_network_header(skb); | ||
| 187 | |||
| 188 | read_lock_bh(&l2tp_ip_lock); | ||
| 189 | sk = __l2tp_ip_bind_lookup(net, iph->daddr, iph->saddr, | ||
| 190 | inet_iif(skb), tunnel_id); | ||
| 191 | if (!sk) { | ||
| 192 | read_unlock_bh(&l2tp_ip_lock); | ||
| 193 | goto discard; | ||
| 194 | } | ||
| 195 | 183 | ||
| 196 | sock_hold(sk); | 184 | read_lock_bh(&l2tp_ip_lock); |
| 185 | sk = __l2tp_ip_bind_lookup(net, iph->daddr, iph->saddr, inet_iif(skb), | ||
| 186 | tunnel_id); | ||
| 187 | if (!sk) { | ||
| 197 | read_unlock_bh(&l2tp_ip_lock); | 188 | read_unlock_bh(&l2tp_ip_lock); |
| 189 | goto discard; | ||
| 198 | } | 190 | } |
| 191 | sock_hold(sk); | ||
| 192 | read_unlock_bh(&l2tp_ip_lock); | ||
| 199 | 193 | ||
| 200 | if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) | 194 | if (!xfrm4_policy_check(sk, XFRM_POLICY_IN, skb)) |
| 201 | goto discard_put; | 195 | goto discard_put; |
diff --git a/net/l2tp/l2tp_ip6.c b/net/l2tp/l2tp_ip6.c index 88b397c30d86..8bcaa975b432 100644 --- a/net/l2tp/l2tp_ip6.c +++ b/net/l2tp/l2tp_ip6.c | |||
| @@ -136,6 +136,7 @@ static int l2tp_ip6_recv(struct sk_buff *skb) | |||
| 136 | unsigned char *ptr, *optr; | 136 | unsigned char *ptr, *optr; |
| 137 | struct l2tp_session *session; | 137 | struct l2tp_session *session; |
| 138 | struct l2tp_tunnel *tunnel = NULL; | 138 | struct l2tp_tunnel *tunnel = NULL; |
| 139 | struct ipv6hdr *iph; | ||
| 139 | int length; | 140 | int length; |
| 140 | 141 | ||
| 141 | if (!pskb_may_pull(skb, 4)) | 142 | if (!pskb_may_pull(skb, 4)) |
| @@ -192,24 +193,17 @@ pass_up: | |||
| 192 | goto discard; | 193 | goto discard; |
| 193 | 194 | ||
| 194 | tunnel_id = ntohl(*(__be32 *) &skb->data[4]); | 195 | tunnel_id = ntohl(*(__be32 *) &skb->data[4]); |
| 195 | tunnel = l2tp_tunnel_find(net, tunnel_id); | 196 | iph = ipv6_hdr(skb); |
| 196 | if (tunnel) { | ||
| 197 | sk = tunnel->sock; | ||
| 198 | sock_hold(sk); | ||
| 199 | } else { | ||
| 200 | struct ipv6hdr *iph = ipv6_hdr(skb); | ||
| 201 | |||
| 202 | read_lock_bh(&l2tp_ip6_lock); | ||
| 203 | sk = __l2tp_ip6_bind_lookup(net, &iph->daddr, &iph->saddr, | ||
| 204 | inet6_iif(skb), tunnel_id); | ||
| 205 | if (!sk) { | ||
| 206 | read_unlock_bh(&l2tp_ip6_lock); | ||
| 207 | goto discard; | ||
| 208 | } | ||
| 209 | 197 | ||
| 210 | sock_hold(sk); | 198 | read_lock_bh(&l2tp_ip6_lock); |
| 199 | sk = __l2tp_ip6_bind_lookup(net, &iph->daddr, &iph->saddr, | ||
| 200 | inet6_iif(skb), tunnel_id); | ||
| 201 | if (!sk) { | ||
| 211 | read_unlock_bh(&l2tp_ip6_lock); | 202 | read_unlock_bh(&l2tp_ip6_lock); |
| 203 | goto discard; | ||
| 212 | } | 204 | } |
| 205 | sock_hold(sk); | ||
| 206 | read_unlock_bh(&l2tp_ip6_lock); | ||
| 213 | 207 | ||
| 214 | if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) | 208 | if (!xfrm6_policy_check(sk, XFRM_POLICY_IN, skb)) |
| 215 | goto discard_put; | 209 | goto discard_put; |
diff --git a/net/qrtr/qrtr.c b/net/qrtr/qrtr.c index c2f5c13550c0..78418f38464a 100644 --- a/net/qrtr/qrtr.c +++ b/net/qrtr/qrtr.c | |||
| @@ -1085,7 +1085,7 @@ static int __init qrtr_proto_init(void) | |||
| 1085 | 1085 | ||
| 1086 | return 0; | 1086 | return 0; |
| 1087 | } | 1087 | } |
| 1088 | module_init(qrtr_proto_init); | 1088 | postcore_initcall(qrtr_proto_init); |
| 1089 | 1089 | ||
| 1090 | static void __exit qrtr_proto_fini(void) | 1090 | static void __exit qrtr_proto_fini(void) |
| 1091 | { | 1091 | { |
diff --git a/net/rds/ib_recv.c b/net/rds/ib_recv.c index 9722bf839d9d..b4e421aa9727 100644 --- a/net/rds/ib_recv.c +++ b/net/rds/ib_recv.c | |||
| @@ -410,14 +410,14 @@ void rds_ib_recv_refill(struct rds_connection *conn, int prefill, gfp_t gfp) | |||
| 410 | break; | 410 | break; |
| 411 | } | 411 | } |
| 412 | 412 | ||
| 413 | /* XXX when can this fail? */ | 413 | rdsdebug("recv %p ibinc %p page %p addr %lu\n", recv, |
| 414 | ret = ib_post_recv(ic->i_cm_id->qp, &recv->r_wr, &failed_wr); | ||
| 415 | rdsdebug("recv %p ibinc %p page %p addr %lu ret %d\n", recv, | ||
| 416 | recv->r_ibinc, sg_page(&recv->r_frag->f_sg), | 414 | recv->r_ibinc, sg_page(&recv->r_frag->f_sg), |
| 417 | (long) ib_sg_dma_address( | 415 | (long) ib_sg_dma_address( |
| 418 | ic->i_cm_id->device, | 416 | ic->i_cm_id->device, |
| 419 | &recv->r_frag->f_sg), | 417 | &recv->r_frag->f_sg)); |
| 420 | ret); | 418 | |
| 419 | /* XXX when can this fail? */ | ||
| 420 | ret = ib_post_recv(ic->i_cm_id->qp, &recv->r_wr, &failed_wr); | ||
| 421 | if (ret) { | 421 | if (ret) { |
| 422 | rds_ib_conn_error(conn, "recv post on " | 422 | rds_ib_conn_error(conn, "recv post on " |
| 423 | "%pI4 returned %d, disconnecting and " | 423 | "%pI4 returned %d, disconnecting and " |
diff --git a/net/sched/act_api.c b/net/sched/act_api.c index ca2ff0b3123f..8f2c63514956 100644 --- a/net/sched/act_api.c +++ b/net/sched/act_api.c | |||
| @@ -78,7 +78,6 @@ static void tcf_idr_remove(struct tcf_idrinfo *idrinfo, struct tc_action *p) | |||
| 78 | spin_lock_bh(&idrinfo->lock); | 78 | spin_lock_bh(&idrinfo->lock); |
| 79 | idr_remove_ext(&idrinfo->action_idr, p->tcfa_index); | 79 | idr_remove_ext(&idrinfo->action_idr, p->tcfa_index); |
| 80 | spin_unlock_bh(&idrinfo->lock); | 80 | spin_unlock_bh(&idrinfo->lock); |
| 81 | put_net(idrinfo->net); | ||
| 82 | gen_kill_estimator(&p->tcfa_rate_est); | 81 | gen_kill_estimator(&p->tcfa_rate_est); |
| 83 | free_tcf(p); | 82 | free_tcf(p); |
| 84 | } | 83 | } |
| @@ -337,7 +336,6 @@ err3: | |||
| 337 | p->idrinfo = idrinfo; | 336 | p->idrinfo = idrinfo; |
| 338 | p->ops = ops; | 337 | p->ops = ops; |
| 339 | INIT_LIST_HEAD(&p->list); | 338 | INIT_LIST_HEAD(&p->list); |
| 340 | get_net(idrinfo->net); | ||
| 341 | *a = p; | 339 | *a = p; |
| 342 | return 0; | 340 | return 0; |
| 343 | } | 341 | } |
diff --git a/net/sched/act_bpf.c b/net/sched/act_bpf.c index 9bce8cc84cbb..c0c707eb2c96 100644 --- a/net/sched/act_bpf.c +++ b/net/sched/act_bpf.c | |||
| @@ -398,7 +398,7 @@ static __net_init int bpf_init_net(struct net *net) | |||
| 398 | { | 398 | { |
| 399 | struct tc_action_net *tn = net_generic(net, bpf_net_id); | 399 | struct tc_action_net *tn = net_generic(net, bpf_net_id); |
| 400 | 400 | ||
| 401 | return tc_action_net_init(tn, &act_bpf_ops, net); | 401 | return tc_action_net_init(tn, &act_bpf_ops); |
| 402 | } | 402 | } |
| 403 | 403 | ||
| 404 | static void __net_exit bpf_exit_net(struct net *net) | 404 | static void __net_exit bpf_exit_net(struct net *net) |
diff --git a/net/sched/act_connmark.c b/net/sched/act_connmark.c index 34e52d01a5dd..10b7a8855a6c 100644 --- a/net/sched/act_connmark.c +++ b/net/sched/act_connmark.c | |||
| @@ -206,7 +206,7 @@ static __net_init int connmark_init_net(struct net *net) | |||
| 206 | { | 206 | { |
| 207 | struct tc_action_net *tn = net_generic(net, connmark_net_id); | 207 | struct tc_action_net *tn = net_generic(net, connmark_net_id); |
| 208 | 208 | ||
| 209 | return tc_action_net_init(tn, &act_connmark_ops, net); | 209 | return tc_action_net_init(tn, &act_connmark_ops); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | static void __net_exit connmark_exit_net(struct net *net) | 212 | static void __net_exit connmark_exit_net(struct net *net) |
diff --git a/net/sched/act_csum.c b/net/sched/act_csum.c index 35171df2ebef..1c40caadcff9 100644 --- a/net/sched/act_csum.c +++ b/net/sched/act_csum.c | |||
| @@ -626,7 +626,7 @@ static __net_init int csum_init_net(struct net *net) | |||
| 626 | { | 626 | { |
| 627 | struct tc_action_net *tn = net_generic(net, csum_net_id); | 627 | struct tc_action_net *tn = net_generic(net, csum_net_id); |
| 628 | 628 | ||
| 629 | return tc_action_net_init(tn, &act_csum_ops, net); | 629 | return tc_action_net_init(tn, &act_csum_ops); |
| 630 | } | 630 | } |
| 631 | 631 | ||
| 632 | static void __net_exit csum_exit_net(struct net *net) | 632 | static void __net_exit csum_exit_net(struct net *net) |
diff --git a/net/sched/act_gact.c b/net/sched/act_gact.c index ef7f7f39d26d..e29a48ef7fc3 100644 --- a/net/sched/act_gact.c +++ b/net/sched/act_gact.c | |||
| @@ -232,7 +232,7 @@ static __net_init int gact_init_net(struct net *net) | |||
| 232 | { | 232 | { |
| 233 | struct tc_action_net *tn = net_generic(net, gact_net_id); | 233 | struct tc_action_net *tn = net_generic(net, gact_net_id); |
| 234 | 234 | ||
| 235 | return tc_action_net_init(tn, &act_gact_ops, net); | 235 | return tc_action_net_init(tn, &act_gact_ops); |
| 236 | } | 236 | } |
| 237 | 237 | ||
| 238 | static void __net_exit gact_exit_net(struct net *net) | 238 | static void __net_exit gact_exit_net(struct net *net) |
diff --git a/net/sched/act_ife.c b/net/sched/act_ife.c index f65e4b5058e0..8ccd35825b6b 100644 --- a/net/sched/act_ife.c +++ b/net/sched/act_ife.c | |||
| @@ -818,7 +818,7 @@ static __net_init int ife_init_net(struct net *net) | |||
| 818 | { | 818 | { |
| 819 | struct tc_action_net *tn = net_generic(net, ife_net_id); | 819 | struct tc_action_net *tn = net_generic(net, ife_net_id); |
| 820 | 820 | ||
| 821 | return tc_action_net_init(tn, &act_ife_ops, net); | 821 | return tc_action_net_init(tn, &act_ife_ops); |
| 822 | } | 822 | } |
| 823 | 823 | ||
| 824 | static void __net_exit ife_exit_net(struct net *net) | 824 | static void __net_exit ife_exit_net(struct net *net) |
diff --git a/net/sched/act_ipt.c b/net/sched/act_ipt.c index dbdf3b2470d5..d9e399a7e3d5 100644 --- a/net/sched/act_ipt.c +++ b/net/sched/act_ipt.c | |||
| @@ -334,7 +334,7 @@ static __net_init int ipt_init_net(struct net *net) | |||
| 334 | { | 334 | { |
| 335 | struct tc_action_net *tn = net_generic(net, ipt_net_id); | 335 | struct tc_action_net *tn = net_generic(net, ipt_net_id); |
| 336 | 336 | ||
| 337 | return tc_action_net_init(tn, &act_ipt_ops, net); | 337 | return tc_action_net_init(tn, &act_ipt_ops); |
| 338 | } | 338 | } |
| 339 | 339 | ||
| 340 | static void __net_exit ipt_exit_net(struct net *net) | 340 | static void __net_exit ipt_exit_net(struct net *net) |
| @@ -384,7 +384,7 @@ static __net_init int xt_init_net(struct net *net) | |||
| 384 | { | 384 | { |
| 385 | struct tc_action_net *tn = net_generic(net, xt_net_id); | 385 | struct tc_action_net *tn = net_generic(net, xt_net_id); |
| 386 | 386 | ||
| 387 | return tc_action_net_init(tn, &act_xt_ops, net); | 387 | return tc_action_net_init(tn, &act_xt_ops); |
| 388 | } | 388 | } |
| 389 | 389 | ||
| 390 | static void __net_exit xt_exit_net(struct net *net) | 390 | static void __net_exit xt_exit_net(struct net *net) |
diff --git a/net/sched/act_mirred.c b/net/sched/act_mirred.c index 84759cfd5a33..416627c66f08 100644 --- a/net/sched/act_mirred.c +++ b/net/sched/act_mirred.c | |||
| @@ -343,7 +343,7 @@ static __net_init int mirred_init_net(struct net *net) | |||
| 343 | { | 343 | { |
| 344 | struct tc_action_net *tn = net_generic(net, mirred_net_id); | 344 | struct tc_action_net *tn = net_generic(net, mirred_net_id); |
| 345 | 345 | ||
| 346 | return tc_action_net_init(tn, &act_mirred_ops, net); | 346 | return tc_action_net_init(tn, &act_mirred_ops); |
| 347 | } | 347 | } |
| 348 | 348 | ||
| 349 | static void __net_exit mirred_exit_net(struct net *net) | 349 | static void __net_exit mirred_exit_net(struct net *net) |
diff --git a/net/sched/act_nat.c b/net/sched/act_nat.c index 7eeaaf9217b6..c365d01b99c8 100644 --- a/net/sched/act_nat.c +++ b/net/sched/act_nat.c | |||
| @@ -307,7 +307,7 @@ static __net_init int nat_init_net(struct net *net) | |||
| 307 | { | 307 | { |
| 308 | struct tc_action_net *tn = net_generic(net, nat_net_id); | 308 | struct tc_action_net *tn = net_generic(net, nat_net_id); |
| 309 | 309 | ||
| 310 | return tc_action_net_init(tn, &act_nat_ops, net); | 310 | return tc_action_net_init(tn, &act_nat_ops); |
| 311 | } | 311 | } |
| 312 | 312 | ||
| 313 | static void __net_exit nat_exit_net(struct net *net) | 313 | static void __net_exit nat_exit_net(struct net *net) |
diff --git a/net/sched/act_pedit.c b/net/sched/act_pedit.c index b3d82c334a5f..491fe5deb09e 100644 --- a/net/sched/act_pedit.c +++ b/net/sched/act_pedit.c | |||
| @@ -450,7 +450,7 @@ static __net_init int pedit_init_net(struct net *net) | |||
| 450 | { | 450 | { |
| 451 | struct tc_action_net *tn = net_generic(net, pedit_net_id); | 451 | struct tc_action_net *tn = net_generic(net, pedit_net_id); |
| 452 | 452 | ||
| 453 | return tc_action_net_init(tn, &act_pedit_ops, net); | 453 | return tc_action_net_init(tn, &act_pedit_ops); |
| 454 | } | 454 | } |
| 455 | 455 | ||
| 456 | static void __net_exit pedit_exit_net(struct net *net) | 456 | static void __net_exit pedit_exit_net(struct net *net) |
diff --git a/net/sched/act_police.c b/net/sched/act_police.c index 9ec42b26e4b9..3bb2ebf9e9ae 100644 --- a/net/sched/act_police.c +++ b/net/sched/act_police.c | |||
| @@ -331,7 +331,7 @@ static __net_init int police_init_net(struct net *net) | |||
| 331 | { | 331 | { |
| 332 | struct tc_action_net *tn = net_generic(net, police_net_id); | 332 | struct tc_action_net *tn = net_generic(net, police_net_id); |
| 333 | 333 | ||
| 334 | return tc_action_net_init(tn, &act_police_ops, net); | 334 | return tc_action_net_init(tn, &act_police_ops); |
| 335 | } | 335 | } |
| 336 | 336 | ||
| 337 | static void __net_exit police_exit_net(struct net *net) | 337 | static void __net_exit police_exit_net(struct net *net) |
diff --git a/net/sched/act_sample.c b/net/sched/act_sample.c index e69a1e3a39bf..8b5abcd2f32f 100644 --- a/net/sched/act_sample.c +++ b/net/sched/act_sample.c | |||
| @@ -240,7 +240,7 @@ static __net_init int sample_init_net(struct net *net) | |||
| 240 | { | 240 | { |
| 241 | struct tc_action_net *tn = net_generic(net, sample_net_id); | 241 | struct tc_action_net *tn = net_generic(net, sample_net_id); |
| 242 | 242 | ||
| 243 | return tc_action_net_init(tn, &act_sample_ops, net); | 243 | return tc_action_net_init(tn, &act_sample_ops); |
| 244 | } | 244 | } |
| 245 | 245 | ||
| 246 | static void __net_exit sample_exit_net(struct net *net) | 246 | static void __net_exit sample_exit_net(struct net *net) |
diff --git a/net/sched/act_simple.c b/net/sched/act_simple.c index a8d0ea95f894..e7b57e5071a3 100644 --- a/net/sched/act_simple.c +++ b/net/sched/act_simple.c | |||
| @@ -201,7 +201,7 @@ static __net_init int simp_init_net(struct net *net) | |||
| 201 | { | 201 | { |
| 202 | struct tc_action_net *tn = net_generic(net, simp_net_id); | 202 | struct tc_action_net *tn = net_generic(net, simp_net_id); |
| 203 | 203 | ||
| 204 | return tc_action_net_init(tn, &act_simp_ops, net); | 204 | return tc_action_net_init(tn, &act_simp_ops); |
| 205 | } | 205 | } |
| 206 | 206 | ||
| 207 | static void __net_exit simp_exit_net(struct net *net) | 207 | static void __net_exit simp_exit_net(struct net *net) |
diff --git a/net/sched/act_skbedit.c b/net/sched/act_skbedit.c index fbac62472e09..59949d61f20d 100644 --- a/net/sched/act_skbedit.c +++ b/net/sched/act_skbedit.c | |||
| @@ -238,7 +238,7 @@ static __net_init int skbedit_init_net(struct net *net) | |||
| 238 | { | 238 | { |
| 239 | struct tc_action_net *tn = net_generic(net, skbedit_net_id); | 239 | struct tc_action_net *tn = net_generic(net, skbedit_net_id); |
| 240 | 240 | ||
| 241 | return tc_action_net_init(tn, &act_skbedit_ops, net); | 241 | return tc_action_net_init(tn, &act_skbedit_ops); |
| 242 | } | 242 | } |
| 243 | 243 | ||
| 244 | static void __net_exit skbedit_exit_net(struct net *net) | 244 | static void __net_exit skbedit_exit_net(struct net *net) |
diff --git a/net/sched/act_skbmod.c b/net/sched/act_skbmod.c index 8e12d8897d2f..b642ad3d39dd 100644 --- a/net/sched/act_skbmod.c +++ b/net/sched/act_skbmod.c | |||
| @@ -263,7 +263,7 @@ static __net_init int skbmod_init_net(struct net *net) | |||
| 263 | { | 263 | { |
| 264 | struct tc_action_net *tn = net_generic(net, skbmod_net_id); | 264 | struct tc_action_net *tn = net_generic(net, skbmod_net_id); |
| 265 | 265 | ||
| 266 | return tc_action_net_init(tn, &act_skbmod_ops, net); | 266 | return tc_action_net_init(tn, &act_skbmod_ops); |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | static void __net_exit skbmod_exit_net(struct net *net) | 269 | static void __net_exit skbmod_exit_net(struct net *net) |
diff --git a/net/sched/act_tunnel_key.c b/net/sched/act_tunnel_key.c index c33faa373cf2..30c96274c638 100644 --- a/net/sched/act_tunnel_key.c +++ b/net/sched/act_tunnel_key.c | |||
| @@ -322,7 +322,7 @@ static __net_init int tunnel_key_init_net(struct net *net) | |||
| 322 | { | 322 | { |
| 323 | struct tc_action_net *tn = net_generic(net, tunnel_key_net_id); | 323 | struct tc_action_net *tn = net_generic(net, tunnel_key_net_id); |
| 324 | 324 | ||
| 325 | return tc_action_net_init(tn, &act_tunnel_key_ops, net); | 325 | return tc_action_net_init(tn, &act_tunnel_key_ops); |
| 326 | } | 326 | } |
| 327 | 327 | ||
| 328 | static void __net_exit tunnel_key_exit_net(struct net *net) | 328 | static void __net_exit tunnel_key_exit_net(struct net *net) |
diff --git a/net/sched/act_vlan.c b/net/sched/act_vlan.c index 115fc33cc6d8..16eb067a8d8f 100644 --- a/net/sched/act_vlan.c +++ b/net/sched/act_vlan.c | |||
| @@ -269,7 +269,7 @@ static __net_init int vlan_init_net(struct net *net) | |||
| 269 | { | 269 | { |
| 270 | struct tc_action_net *tn = net_generic(net, vlan_net_id); | 270 | struct tc_action_net *tn = net_generic(net, vlan_net_id); |
| 271 | 271 | ||
| 272 | return tc_action_net_init(tn, &act_vlan_ops, net); | 272 | return tc_action_net_init(tn, &act_vlan_ops); |
| 273 | } | 273 | } |
| 274 | 274 | ||
| 275 | static void __net_exit vlan_exit_net(struct net *net) | 275 | static void __net_exit vlan_exit_net(struct net *net) |
diff --git a/net/sched/cls_api.c b/net/sched/cls_api.c index b2d310745487..ecbb019efcbd 100644 --- a/net/sched/cls_api.c +++ b/net/sched/cls_api.c | |||
| @@ -927,6 +927,7 @@ int tcf_exts_validate(struct net *net, struct tcf_proto *tp, struct nlattr **tb, | |||
| 927 | exts->actions[i++] = act; | 927 | exts->actions[i++] = act; |
| 928 | exts->nr_actions = i; | 928 | exts->nr_actions = i; |
| 929 | } | 929 | } |
| 930 | exts->net = net; | ||
| 930 | } | 931 | } |
| 931 | #else | 932 | #else |
| 932 | if ((exts->action && tb[exts->action]) || | 933 | if ((exts->action && tb[exts->action]) || |
diff --git a/net/sched/cls_basic.c b/net/sched/cls_basic.c index f177649a2419..e43c56d5b96a 100644 --- a/net/sched/cls_basic.c +++ b/net/sched/cls_basic.c | |||
| @@ -85,16 +85,21 @@ static int basic_init(struct tcf_proto *tp) | |||
| 85 | return 0; | 85 | return 0; |
| 86 | } | 86 | } |
| 87 | 87 | ||
| 88 | static void __basic_delete_filter(struct basic_filter *f) | ||
| 89 | { | ||
| 90 | tcf_exts_destroy(&f->exts); | ||
| 91 | tcf_em_tree_destroy(&f->ematches); | ||
| 92 | tcf_exts_put_net(&f->exts); | ||
| 93 | kfree(f); | ||
| 94 | } | ||
| 95 | |||
| 88 | static void basic_delete_filter_work(struct work_struct *work) | 96 | static void basic_delete_filter_work(struct work_struct *work) |
| 89 | { | 97 | { |
| 90 | struct basic_filter *f = container_of(work, struct basic_filter, work); | 98 | struct basic_filter *f = container_of(work, struct basic_filter, work); |
| 91 | 99 | ||
| 92 | rtnl_lock(); | 100 | rtnl_lock(); |
| 93 | tcf_exts_destroy(&f->exts); | 101 | __basic_delete_filter(f); |
| 94 | tcf_em_tree_destroy(&f->ematches); | ||
| 95 | rtnl_unlock(); | 102 | rtnl_unlock(); |
| 96 | |||
| 97 | kfree(f); | ||
| 98 | } | 103 | } |
| 99 | 104 | ||
| 100 | static void basic_delete_filter(struct rcu_head *head) | 105 | static void basic_delete_filter(struct rcu_head *head) |
| @@ -113,7 +118,10 @@ static void basic_destroy(struct tcf_proto *tp) | |||
| 113 | list_for_each_entry_safe(f, n, &head->flist, link) { | 118 | list_for_each_entry_safe(f, n, &head->flist, link) { |
| 114 | list_del_rcu(&f->link); | 119 | list_del_rcu(&f->link); |
| 115 | tcf_unbind_filter(tp, &f->res); | 120 | tcf_unbind_filter(tp, &f->res); |
| 116 | call_rcu(&f->rcu, basic_delete_filter); | 121 | if (tcf_exts_get_net(&f->exts)) |
| 122 | call_rcu(&f->rcu, basic_delete_filter); | ||
| 123 | else | ||
| 124 | __basic_delete_filter(f); | ||
| 117 | } | 125 | } |
| 118 | kfree_rcu(head, rcu); | 126 | kfree_rcu(head, rcu); |
| 119 | } | 127 | } |
| @@ -125,6 +133,7 @@ static int basic_delete(struct tcf_proto *tp, void *arg, bool *last) | |||
| 125 | 133 | ||
| 126 | list_del_rcu(&f->link); | 134 | list_del_rcu(&f->link); |
| 127 | tcf_unbind_filter(tp, &f->res); | 135 | tcf_unbind_filter(tp, &f->res); |
| 136 | tcf_exts_get_net(&f->exts); | ||
| 128 | call_rcu(&f->rcu, basic_delete_filter); | 137 | call_rcu(&f->rcu, basic_delete_filter); |
| 129 | *last = list_empty(&head->flist); | 138 | *last = list_empty(&head->flist); |
| 130 | return 0; | 139 | return 0; |
| @@ -219,6 +228,7 @@ static int basic_change(struct net *net, struct sk_buff *in_skb, | |||
| 219 | if (fold) { | 228 | if (fold) { |
| 220 | list_replace_rcu(&fold->link, &fnew->link); | 229 | list_replace_rcu(&fold->link, &fnew->link); |
| 221 | tcf_unbind_filter(tp, &fold->res); | 230 | tcf_unbind_filter(tp, &fold->res); |
| 231 | tcf_exts_get_net(&fold->exts); | ||
| 222 | call_rcu(&fold->rcu, basic_delete_filter); | 232 | call_rcu(&fold->rcu, basic_delete_filter); |
| 223 | } else { | 233 | } else { |
| 224 | list_add_rcu(&fnew->link, &head->flist); | 234 | list_add_rcu(&fnew->link, &head->flist); |
diff --git a/net/sched/cls_bpf.c b/net/sched/cls_bpf.c index 037a3ae86829..990eb4d91d54 100644 --- a/net/sched/cls_bpf.c +++ b/net/sched/cls_bpf.c | |||
| @@ -249,6 +249,7 @@ static int cls_bpf_init(struct tcf_proto *tp) | |||
| 249 | static void __cls_bpf_delete_prog(struct cls_bpf_prog *prog) | 249 | static void __cls_bpf_delete_prog(struct cls_bpf_prog *prog) |
| 250 | { | 250 | { |
| 251 | tcf_exts_destroy(&prog->exts); | 251 | tcf_exts_destroy(&prog->exts); |
| 252 | tcf_exts_put_net(&prog->exts); | ||
| 252 | 253 | ||
| 253 | if (cls_bpf_is_ebpf(prog)) | 254 | if (cls_bpf_is_ebpf(prog)) |
| 254 | bpf_prog_put(prog->filter); | 255 | bpf_prog_put(prog->filter); |
| @@ -282,7 +283,10 @@ static void __cls_bpf_delete(struct tcf_proto *tp, struct cls_bpf_prog *prog) | |||
| 282 | cls_bpf_stop_offload(tp, prog); | 283 | cls_bpf_stop_offload(tp, prog); |
| 283 | list_del_rcu(&prog->link); | 284 | list_del_rcu(&prog->link); |
| 284 | tcf_unbind_filter(tp, &prog->res); | 285 | tcf_unbind_filter(tp, &prog->res); |
| 285 | call_rcu(&prog->rcu, cls_bpf_delete_prog_rcu); | 286 | if (tcf_exts_get_net(&prog->exts)) |
| 287 | call_rcu(&prog->rcu, cls_bpf_delete_prog_rcu); | ||
| 288 | else | ||
| 289 | __cls_bpf_delete_prog(prog); | ||
| 286 | } | 290 | } |
| 287 | 291 | ||
| 288 | static int cls_bpf_delete(struct tcf_proto *tp, void *arg, bool *last) | 292 | static int cls_bpf_delete(struct tcf_proto *tp, void *arg, bool *last) |
| @@ -516,6 +520,7 @@ static int cls_bpf_change(struct net *net, struct sk_buff *in_skb, | |||
| 516 | if (oldprog) { | 520 | if (oldprog) { |
| 517 | list_replace_rcu(&oldprog->link, &prog->link); | 521 | list_replace_rcu(&oldprog->link, &prog->link); |
| 518 | tcf_unbind_filter(tp, &oldprog->res); | 522 | tcf_unbind_filter(tp, &oldprog->res); |
| 523 | tcf_exts_get_net(&oldprog->exts); | ||
| 519 | call_rcu(&oldprog->rcu, cls_bpf_delete_prog_rcu); | 524 | call_rcu(&oldprog->rcu, cls_bpf_delete_prog_rcu); |
| 520 | } else { | 525 | } else { |
| 521 | list_add_rcu(&prog->link, &head->plist); | 526 | list_add_rcu(&prog->link, &head->plist); |
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c index a97e069bee89..309d5899265f 100644 --- a/net/sched/cls_cgroup.c +++ b/net/sched/cls_cgroup.c | |||
| @@ -60,15 +60,21 @@ static const struct nla_policy cgroup_policy[TCA_CGROUP_MAX + 1] = { | |||
| 60 | [TCA_CGROUP_EMATCHES] = { .type = NLA_NESTED }, | 60 | [TCA_CGROUP_EMATCHES] = { .type = NLA_NESTED }, |
| 61 | }; | 61 | }; |
| 62 | 62 | ||
| 63 | static void __cls_cgroup_destroy(struct cls_cgroup_head *head) | ||
| 64 | { | ||
| 65 | tcf_exts_destroy(&head->exts); | ||
| 66 | tcf_em_tree_destroy(&head->ematches); | ||
| 67 | tcf_exts_put_net(&head->exts); | ||
| 68 | kfree(head); | ||
| 69 | } | ||
| 70 | |||
| 63 | static void cls_cgroup_destroy_work(struct work_struct *work) | 71 | static void cls_cgroup_destroy_work(struct work_struct *work) |
| 64 | { | 72 | { |
| 65 | struct cls_cgroup_head *head = container_of(work, | 73 | struct cls_cgroup_head *head = container_of(work, |
| 66 | struct cls_cgroup_head, | 74 | struct cls_cgroup_head, |
| 67 | work); | 75 | work); |
| 68 | rtnl_lock(); | 76 | rtnl_lock(); |
| 69 | tcf_exts_destroy(&head->exts); | 77 | __cls_cgroup_destroy(head); |
| 70 | tcf_em_tree_destroy(&head->ematches); | ||
| 71 | kfree(head); | ||
| 72 | rtnl_unlock(); | 78 | rtnl_unlock(); |
| 73 | } | 79 | } |
| 74 | 80 | ||
| @@ -124,8 +130,10 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb, | |||
| 124 | goto errout; | 130 | goto errout; |
| 125 | 131 | ||
| 126 | rcu_assign_pointer(tp->root, new); | 132 | rcu_assign_pointer(tp->root, new); |
| 127 | if (head) | 133 | if (head) { |
| 134 | tcf_exts_get_net(&head->exts); | ||
| 128 | call_rcu(&head->rcu, cls_cgroup_destroy_rcu); | 135 | call_rcu(&head->rcu, cls_cgroup_destroy_rcu); |
| 136 | } | ||
| 129 | return 0; | 137 | return 0; |
| 130 | errout: | 138 | errout: |
| 131 | tcf_exts_destroy(&new->exts); | 139 | tcf_exts_destroy(&new->exts); |
| @@ -138,8 +146,12 @@ static void cls_cgroup_destroy(struct tcf_proto *tp) | |||
| 138 | struct cls_cgroup_head *head = rtnl_dereference(tp->root); | 146 | struct cls_cgroup_head *head = rtnl_dereference(tp->root); |
| 139 | 147 | ||
| 140 | /* Head can still be NULL due to cls_cgroup_init(). */ | 148 | /* Head can still be NULL due to cls_cgroup_init(). */ |
| 141 | if (head) | 149 | if (head) { |
| 142 | call_rcu(&head->rcu, cls_cgroup_destroy_rcu); | 150 | if (tcf_exts_get_net(&head->exts)) |
| 151 | call_rcu(&head->rcu, cls_cgroup_destroy_rcu); | ||
| 152 | else | ||
| 153 | __cls_cgroup_destroy(head); | ||
| 154 | } | ||
| 143 | } | 155 | } |
| 144 | 156 | ||
| 145 | static int cls_cgroup_delete(struct tcf_proto *tp, void *arg, bool *last) | 157 | static int cls_cgroup_delete(struct tcf_proto *tp, void *arg, bool *last) |
diff --git a/net/sched/cls_flow.c b/net/sched/cls_flow.c index 67f3a2af6aab..85f765cff697 100644 --- a/net/sched/cls_flow.c +++ b/net/sched/cls_flow.c | |||
| @@ -372,15 +372,21 @@ static const struct nla_policy flow_policy[TCA_FLOW_MAX + 1] = { | |||
| 372 | [TCA_FLOW_PERTURB] = { .type = NLA_U32 }, | 372 | [TCA_FLOW_PERTURB] = { .type = NLA_U32 }, |
| 373 | }; | 373 | }; |
| 374 | 374 | ||
| 375 | static void flow_destroy_filter_work(struct work_struct *work) | 375 | static void __flow_destroy_filter(struct flow_filter *f) |
| 376 | { | 376 | { |
| 377 | struct flow_filter *f = container_of(work, struct flow_filter, work); | ||
| 378 | |||
| 379 | rtnl_lock(); | ||
| 380 | del_timer_sync(&f->perturb_timer); | 377 | del_timer_sync(&f->perturb_timer); |
| 381 | tcf_exts_destroy(&f->exts); | 378 | tcf_exts_destroy(&f->exts); |
| 382 | tcf_em_tree_destroy(&f->ematches); | 379 | tcf_em_tree_destroy(&f->ematches); |
| 380 | tcf_exts_put_net(&f->exts); | ||
| 383 | kfree(f); | 381 | kfree(f); |
| 382 | } | ||
| 383 | |||
| 384 | static void flow_destroy_filter_work(struct work_struct *work) | ||
| 385 | { | ||
| 386 | struct flow_filter *f = container_of(work, struct flow_filter, work); | ||
| 387 | |||
| 388 | rtnl_lock(); | ||
| 389 | __flow_destroy_filter(f); | ||
| 384 | rtnl_unlock(); | 390 | rtnl_unlock(); |
| 385 | } | 391 | } |
| 386 | 392 | ||
| @@ -552,8 +558,10 @@ static int flow_change(struct net *net, struct sk_buff *in_skb, | |||
| 552 | 558 | ||
| 553 | *arg = fnew; | 559 | *arg = fnew; |
| 554 | 560 | ||
| 555 | if (fold) | 561 | if (fold) { |
| 562 | tcf_exts_get_net(&fold->exts); | ||
| 556 | call_rcu(&fold->rcu, flow_destroy_filter); | 563 | call_rcu(&fold->rcu, flow_destroy_filter); |
| 564 | } | ||
| 557 | return 0; | 565 | return 0; |
| 558 | 566 | ||
| 559 | err2: | 567 | err2: |
| @@ -570,6 +578,7 @@ static int flow_delete(struct tcf_proto *tp, void *arg, bool *last) | |||
| 570 | struct flow_filter *f = arg; | 578 | struct flow_filter *f = arg; |
| 571 | 579 | ||
| 572 | list_del_rcu(&f->list); | 580 | list_del_rcu(&f->list); |
| 581 | tcf_exts_get_net(&f->exts); | ||
| 573 | call_rcu(&f->rcu, flow_destroy_filter); | 582 | call_rcu(&f->rcu, flow_destroy_filter); |
| 574 | *last = list_empty(&head->filters); | 583 | *last = list_empty(&head->filters); |
| 575 | return 0; | 584 | return 0; |
| @@ -594,7 +603,10 @@ static void flow_destroy(struct tcf_proto *tp) | |||
| 594 | 603 | ||
| 595 | list_for_each_entry_safe(f, next, &head->filters, list) { | 604 | list_for_each_entry_safe(f, next, &head->filters, list) { |
| 596 | list_del_rcu(&f->list); | 605 | list_del_rcu(&f->list); |
| 597 | call_rcu(&f->rcu, flow_destroy_filter); | 606 | if (tcf_exts_get_net(&f->exts)) |
| 607 | call_rcu(&f->rcu, flow_destroy_filter); | ||
| 608 | else | ||
| 609 | __flow_destroy_filter(f); | ||
| 598 | } | 610 | } |
| 599 | kfree_rcu(head, rcu); | 611 | kfree_rcu(head, rcu); |
| 600 | } | 612 | } |
diff --git a/net/sched/cls_flower.c b/net/sched/cls_flower.c index 5b5722c8b32c..7a838d1c1c00 100644 --- a/net/sched/cls_flower.c +++ b/net/sched/cls_flower.c | |||
| @@ -218,13 +218,19 @@ static int fl_init(struct tcf_proto *tp) | |||
| 218 | return 0; | 218 | return 0; |
| 219 | } | 219 | } |
| 220 | 220 | ||
| 221 | static void __fl_destroy_filter(struct cls_fl_filter *f) | ||
| 222 | { | ||
| 223 | tcf_exts_destroy(&f->exts); | ||
| 224 | tcf_exts_put_net(&f->exts); | ||
| 225 | kfree(f); | ||
| 226 | } | ||
| 227 | |||
| 221 | static void fl_destroy_filter_work(struct work_struct *work) | 228 | static void fl_destroy_filter_work(struct work_struct *work) |
| 222 | { | 229 | { |
| 223 | struct cls_fl_filter *f = container_of(work, struct cls_fl_filter, work); | 230 | struct cls_fl_filter *f = container_of(work, struct cls_fl_filter, work); |
| 224 | 231 | ||
| 225 | rtnl_lock(); | 232 | rtnl_lock(); |
| 226 | tcf_exts_destroy(&f->exts); | 233 | __fl_destroy_filter(f); |
| 227 | kfree(f); | ||
| 228 | rtnl_unlock(); | 234 | rtnl_unlock(); |
| 229 | } | 235 | } |
| 230 | 236 | ||
| @@ -318,7 +324,10 @@ static void __fl_delete(struct tcf_proto *tp, struct cls_fl_filter *f) | |||
| 318 | if (!tc_skip_hw(f->flags)) | 324 | if (!tc_skip_hw(f->flags)) |
| 319 | fl_hw_destroy_filter(tp, f); | 325 | fl_hw_destroy_filter(tp, f); |
| 320 | tcf_unbind_filter(tp, &f->res); | 326 | tcf_unbind_filter(tp, &f->res); |
| 321 | call_rcu(&f->rcu, fl_destroy_filter); | 327 | if (tcf_exts_get_net(&f->exts)) |
| 328 | call_rcu(&f->rcu, fl_destroy_filter); | ||
| 329 | else | ||
| 330 | __fl_destroy_filter(f); | ||
| 322 | } | 331 | } |
| 323 | 332 | ||
| 324 | static void fl_destroy_sleepable(struct work_struct *work) | 333 | static void fl_destroy_sleepable(struct work_struct *work) |
| @@ -988,6 +997,7 @@ static int fl_change(struct net *net, struct sk_buff *in_skb, | |||
| 988 | idr_replace_ext(&head->handle_idr, fnew, fnew->handle); | 997 | idr_replace_ext(&head->handle_idr, fnew, fnew->handle); |
| 989 | list_replace_rcu(&fold->list, &fnew->list); | 998 | list_replace_rcu(&fold->list, &fnew->list); |
| 990 | tcf_unbind_filter(tp, &fold->res); | 999 | tcf_unbind_filter(tp, &fold->res); |
| 1000 | tcf_exts_get_net(&fold->exts); | ||
| 991 | call_rcu(&fold->rcu, fl_destroy_filter); | 1001 | call_rcu(&fold->rcu, fl_destroy_filter); |
| 992 | } else { | 1002 | } else { |
| 993 | list_add_tail_rcu(&fnew->list, &head->filters); | 1003 | list_add_tail_rcu(&fnew->list, &head->filters); |
diff --git a/net/sched/cls_fw.c b/net/sched/cls_fw.c index 99183b8621ec..7f45e5ab8afc 100644 --- a/net/sched/cls_fw.c +++ b/net/sched/cls_fw.c | |||
| @@ -122,13 +122,19 @@ static int fw_init(struct tcf_proto *tp) | |||
| 122 | return 0; | 122 | return 0; |
| 123 | } | 123 | } |
| 124 | 124 | ||
| 125 | static void __fw_delete_filter(struct fw_filter *f) | ||
| 126 | { | ||
| 127 | tcf_exts_destroy(&f->exts); | ||
| 128 | tcf_exts_put_net(&f->exts); | ||
| 129 | kfree(f); | ||
| 130 | } | ||
| 131 | |||
| 125 | static void fw_delete_filter_work(struct work_struct *work) | 132 | static void fw_delete_filter_work(struct work_struct *work) |
| 126 | { | 133 | { |
| 127 | struct fw_filter *f = container_of(work, struct fw_filter, work); | 134 | struct fw_filter *f = container_of(work, struct fw_filter, work); |
| 128 | 135 | ||
| 129 | rtnl_lock(); | 136 | rtnl_lock(); |
| 130 | tcf_exts_destroy(&f->exts); | 137 | __fw_delete_filter(f); |
| 131 | kfree(f); | ||
| 132 | rtnl_unlock(); | 138 | rtnl_unlock(); |
| 133 | } | 139 | } |
| 134 | 140 | ||
| @@ -154,7 +160,10 @@ static void fw_destroy(struct tcf_proto *tp) | |||
| 154 | RCU_INIT_POINTER(head->ht[h], | 160 | RCU_INIT_POINTER(head->ht[h], |
| 155 | rtnl_dereference(f->next)); | 161 | rtnl_dereference(f->next)); |
| 156 | tcf_unbind_filter(tp, &f->res); | 162 | tcf_unbind_filter(tp, &f->res); |
| 157 | call_rcu(&f->rcu, fw_delete_filter); | 163 | if (tcf_exts_get_net(&f->exts)) |
| 164 | call_rcu(&f->rcu, fw_delete_filter); | ||
| 165 | else | ||
| 166 | __fw_delete_filter(f); | ||
| 158 | } | 167 | } |
| 159 | } | 168 | } |
| 160 | kfree_rcu(head, rcu); | 169 | kfree_rcu(head, rcu); |
| @@ -179,6 +188,7 @@ static int fw_delete(struct tcf_proto *tp, void *arg, bool *last) | |||
| 179 | if (pfp == f) { | 188 | if (pfp == f) { |
| 180 | RCU_INIT_POINTER(*fp, rtnl_dereference(f->next)); | 189 | RCU_INIT_POINTER(*fp, rtnl_dereference(f->next)); |
| 181 | tcf_unbind_filter(tp, &f->res); | 190 | tcf_unbind_filter(tp, &f->res); |
| 191 | tcf_exts_get_net(&f->exts); | ||
| 182 | call_rcu(&f->rcu, fw_delete_filter); | 192 | call_rcu(&f->rcu, fw_delete_filter); |
| 183 | ret = 0; | 193 | ret = 0; |
| 184 | break; | 194 | break; |
| @@ -299,6 +309,7 @@ static int fw_change(struct net *net, struct sk_buff *in_skb, | |||
| 299 | RCU_INIT_POINTER(fnew->next, rtnl_dereference(pfp->next)); | 309 | RCU_INIT_POINTER(fnew->next, rtnl_dereference(pfp->next)); |
| 300 | rcu_assign_pointer(*fp, fnew); | 310 | rcu_assign_pointer(*fp, fnew); |
| 301 | tcf_unbind_filter(tp, &f->res); | 311 | tcf_unbind_filter(tp, &f->res); |
| 312 | tcf_exts_get_net(&f->exts); | ||
| 302 | call_rcu(&f->rcu, fw_delete_filter); | 313 | call_rcu(&f->rcu, fw_delete_filter); |
| 303 | 314 | ||
| 304 | *arg = fnew; | 315 | *arg = fnew; |
diff --git a/net/sched/cls_matchall.c b/net/sched/cls_matchall.c index c33f711b9019..3684153cd8a9 100644 --- a/net/sched/cls_matchall.c +++ b/net/sched/cls_matchall.c | |||
| @@ -44,13 +44,19 @@ static int mall_init(struct tcf_proto *tp) | |||
| 44 | return 0; | 44 | return 0; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | static void __mall_destroy(struct cls_mall_head *head) | ||
| 48 | { | ||
| 49 | tcf_exts_destroy(&head->exts); | ||
| 50 | tcf_exts_put_net(&head->exts); | ||
| 51 | kfree(head); | ||
| 52 | } | ||
| 53 | |||
| 47 | static void mall_destroy_work(struct work_struct *work) | 54 | static void mall_destroy_work(struct work_struct *work) |
| 48 | { | 55 | { |
| 49 | struct cls_mall_head *head = container_of(work, struct cls_mall_head, | 56 | struct cls_mall_head *head = container_of(work, struct cls_mall_head, |
| 50 | work); | 57 | work); |
| 51 | rtnl_lock(); | 58 | rtnl_lock(); |
| 52 | tcf_exts_destroy(&head->exts); | 59 | __mall_destroy(head); |
| 53 | kfree(head); | ||
| 54 | rtnl_unlock(); | 60 | rtnl_unlock(); |
| 55 | } | 61 | } |
| 56 | 62 | ||
| @@ -109,7 +115,10 @@ static void mall_destroy(struct tcf_proto *tp) | |||
| 109 | if (tc_should_offload(dev, head->flags)) | 115 | if (tc_should_offload(dev, head->flags)) |
| 110 | mall_destroy_hw_filter(tp, head, (unsigned long) head); | 116 | mall_destroy_hw_filter(tp, head, (unsigned long) head); |
| 111 | 117 | ||
| 112 | call_rcu(&head->rcu, mall_destroy_rcu); | 118 | if (tcf_exts_get_net(&head->exts)) |
| 119 | call_rcu(&head->rcu, mall_destroy_rcu); | ||
| 120 | else | ||
| 121 | __mall_destroy(head); | ||
| 113 | } | 122 | } |
| 114 | 123 | ||
| 115 | static void *mall_get(struct tcf_proto *tp, u32 handle) | 124 | static void *mall_get(struct tcf_proto *tp, u32 handle) |
diff --git a/net/sched/cls_route.c b/net/sched/cls_route.c index 4b14ccd8b8f2..ac9a5b8825b9 100644 --- a/net/sched/cls_route.c +++ b/net/sched/cls_route.c | |||
| @@ -257,13 +257,19 @@ static int route4_init(struct tcf_proto *tp) | |||
| 257 | return 0; | 257 | return 0; |
| 258 | } | 258 | } |
| 259 | 259 | ||
| 260 | static void __route4_delete_filter(struct route4_filter *f) | ||
| 261 | { | ||
| 262 | tcf_exts_destroy(&f->exts); | ||
| 263 | tcf_exts_put_net(&f->exts); | ||
| 264 | kfree(f); | ||
| 265 | } | ||
| 266 | |||
| 260 | static void route4_delete_filter_work(struct work_struct *work) | 267 | static void route4_delete_filter_work(struct work_struct *work) |
| 261 | { | 268 | { |
| 262 | struct route4_filter *f = container_of(work, struct route4_filter, work); | 269 | struct route4_filter *f = container_of(work, struct route4_filter, work); |
| 263 | 270 | ||
| 264 | rtnl_lock(); | 271 | rtnl_lock(); |
| 265 | tcf_exts_destroy(&f->exts); | 272 | __route4_delete_filter(f); |
| 266 | kfree(f); | ||
| 267 | rtnl_unlock(); | 273 | rtnl_unlock(); |
| 268 | } | 274 | } |
| 269 | 275 | ||
| @@ -297,7 +303,10 @@ static void route4_destroy(struct tcf_proto *tp) | |||
| 297 | next = rtnl_dereference(f->next); | 303 | next = rtnl_dereference(f->next); |
| 298 | RCU_INIT_POINTER(b->ht[h2], next); | 304 | RCU_INIT_POINTER(b->ht[h2], next); |
| 299 | tcf_unbind_filter(tp, &f->res); | 305 | tcf_unbind_filter(tp, &f->res); |
| 300 | call_rcu(&f->rcu, route4_delete_filter); | 306 | if (tcf_exts_get_net(&f->exts)) |
| 307 | call_rcu(&f->rcu, route4_delete_filter); | ||
| 308 | else | ||
| 309 | __route4_delete_filter(f); | ||
| 301 | } | 310 | } |
| 302 | } | 311 | } |
| 303 | RCU_INIT_POINTER(head->table[h1], NULL); | 312 | RCU_INIT_POINTER(head->table[h1], NULL); |
| @@ -338,6 +347,7 @@ static int route4_delete(struct tcf_proto *tp, void *arg, bool *last) | |||
| 338 | 347 | ||
| 339 | /* Delete it */ | 348 | /* Delete it */ |
| 340 | tcf_unbind_filter(tp, &f->res); | 349 | tcf_unbind_filter(tp, &f->res); |
| 350 | tcf_exts_get_net(&f->exts); | ||
| 341 | call_rcu(&f->rcu, route4_delete_filter); | 351 | call_rcu(&f->rcu, route4_delete_filter); |
| 342 | 352 | ||
| 343 | /* Strip RTNL protected tree */ | 353 | /* Strip RTNL protected tree */ |
| @@ -541,6 +551,7 @@ static int route4_change(struct net *net, struct sk_buff *in_skb, | |||
| 541 | *arg = f; | 551 | *arg = f; |
| 542 | if (fold) { | 552 | if (fold) { |
| 543 | tcf_unbind_filter(tp, &fold->res); | 553 | tcf_unbind_filter(tp, &fold->res); |
| 554 | tcf_exts_get_net(&fold->exts); | ||
| 544 | call_rcu(&fold->rcu, route4_delete_filter); | 555 | call_rcu(&fold->rcu, route4_delete_filter); |
| 545 | } | 556 | } |
| 546 | return 0; | 557 | return 0; |
diff --git a/net/sched/cls_rsvp.h b/net/sched/cls_rsvp.h index bdbc541787f8..cf325625c99d 100644 --- a/net/sched/cls_rsvp.h +++ b/net/sched/cls_rsvp.h | |||
| @@ -285,13 +285,19 @@ static int rsvp_init(struct tcf_proto *tp) | |||
| 285 | return -ENOBUFS; | 285 | return -ENOBUFS; |
| 286 | } | 286 | } |
| 287 | 287 | ||
| 288 | static void __rsvp_delete_filter(struct rsvp_filter *f) | ||
| 289 | { | ||
| 290 | tcf_exts_destroy(&f->exts); | ||
| 291 | tcf_exts_put_net(&f->exts); | ||
| 292 | kfree(f); | ||
| 293 | } | ||
| 294 | |||
| 288 | static void rsvp_delete_filter_work(struct work_struct *work) | 295 | static void rsvp_delete_filter_work(struct work_struct *work) |
| 289 | { | 296 | { |
| 290 | struct rsvp_filter *f = container_of(work, struct rsvp_filter, work); | 297 | struct rsvp_filter *f = container_of(work, struct rsvp_filter, work); |
| 291 | 298 | ||
| 292 | rtnl_lock(); | 299 | rtnl_lock(); |
| 293 | tcf_exts_destroy(&f->exts); | 300 | __rsvp_delete_filter(f); |
| 294 | kfree(f); | ||
| 295 | rtnl_unlock(); | 301 | rtnl_unlock(); |
| 296 | } | 302 | } |
| 297 | 303 | ||
| @@ -310,7 +316,10 @@ static void rsvp_delete_filter(struct tcf_proto *tp, struct rsvp_filter *f) | |||
| 310 | * grace period, since converted-to-rcu actions are relying on that | 316 | * grace period, since converted-to-rcu actions are relying on that |
| 311 | * in cleanup() callback | 317 | * in cleanup() callback |
| 312 | */ | 318 | */ |
| 313 | call_rcu(&f->rcu, rsvp_delete_filter_rcu); | 319 | if (tcf_exts_get_net(&f->exts)) |
| 320 | call_rcu(&f->rcu, rsvp_delete_filter_rcu); | ||
| 321 | else | ||
| 322 | __rsvp_delete_filter(f); | ||
| 314 | } | 323 | } |
| 315 | 324 | ||
| 316 | static void rsvp_destroy(struct tcf_proto *tp) | 325 | static void rsvp_destroy(struct tcf_proto *tp) |
diff --git a/net/sched/cls_tcindex.c b/net/sched/cls_tcindex.c index beaa95e09c25..a76937ee0b2d 100644 --- a/net/sched/cls_tcindex.c +++ b/net/sched/cls_tcindex.c | |||
| @@ -139,13 +139,19 @@ static int tcindex_init(struct tcf_proto *tp) | |||
| 139 | return 0; | 139 | return 0; |
| 140 | } | 140 | } |
| 141 | 141 | ||
| 142 | static void __tcindex_destroy_rexts(struct tcindex_filter_result *r) | ||
| 143 | { | ||
| 144 | tcf_exts_destroy(&r->exts); | ||
| 145 | tcf_exts_put_net(&r->exts); | ||
| 146 | } | ||
| 147 | |||
| 142 | static void tcindex_destroy_rexts_work(struct work_struct *work) | 148 | static void tcindex_destroy_rexts_work(struct work_struct *work) |
| 143 | { | 149 | { |
| 144 | struct tcindex_filter_result *r; | 150 | struct tcindex_filter_result *r; |
| 145 | 151 | ||
| 146 | r = container_of(work, struct tcindex_filter_result, work); | 152 | r = container_of(work, struct tcindex_filter_result, work); |
| 147 | rtnl_lock(); | 153 | rtnl_lock(); |
| 148 | tcf_exts_destroy(&r->exts); | 154 | __tcindex_destroy_rexts(r); |
| 149 | rtnl_unlock(); | 155 | rtnl_unlock(); |
| 150 | } | 156 | } |
| 151 | 157 | ||
| @@ -158,14 +164,20 @@ static void tcindex_destroy_rexts(struct rcu_head *head) | |||
| 158 | tcf_queue_work(&r->work); | 164 | tcf_queue_work(&r->work); |
| 159 | } | 165 | } |
| 160 | 166 | ||
| 167 | static void __tcindex_destroy_fexts(struct tcindex_filter *f) | ||
| 168 | { | ||
| 169 | tcf_exts_destroy(&f->result.exts); | ||
| 170 | tcf_exts_put_net(&f->result.exts); | ||
| 171 | kfree(f); | ||
| 172 | } | ||
| 173 | |||
| 161 | static void tcindex_destroy_fexts_work(struct work_struct *work) | 174 | static void tcindex_destroy_fexts_work(struct work_struct *work) |
| 162 | { | 175 | { |
| 163 | struct tcindex_filter *f = container_of(work, struct tcindex_filter, | 176 | struct tcindex_filter *f = container_of(work, struct tcindex_filter, |
| 164 | work); | 177 | work); |
| 165 | 178 | ||
| 166 | rtnl_lock(); | 179 | rtnl_lock(); |
| 167 | tcf_exts_destroy(&f->result.exts); | 180 | __tcindex_destroy_fexts(f); |
| 168 | kfree(f); | ||
| 169 | rtnl_unlock(); | 181 | rtnl_unlock(); |
| 170 | } | 182 | } |
| 171 | 183 | ||
| @@ -210,10 +222,17 @@ found: | |||
| 210 | * grace period, since converted-to-rcu actions are relying on that | 222 | * grace period, since converted-to-rcu actions are relying on that |
| 211 | * in cleanup() callback | 223 | * in cleanup() callback |
| 212 | */ | 224 | */ |
| 213 | if (f) | 225 | if (f) { |
| 214 | call_rcu(&f->rcu, tcindex_destroy_fexts); | 226 | if (tcf_exts_get_net(&f->result.exts)) |
| 215 | else | 227 | call_rcu(&f->rcu, tcindex_destroy_fexts); |
| 216 | call_rcu(&r->rcu, tcindex_destroy_rexts); | 228 | else |
| 229 | __tcindex_destroy_fexts(f); | ||
| 230 | } else { | ||
| 231 | if (tcf_exts_get_net(&r->exts)) | ||
| 232 | call_rcu(&r->rcu, tcindex_destroy_rexts); | ||
| 233 | else | ||
| 234 | __tcindex_destroy_rexts(r); | ||
| 235 | } | ||
| 217 | 236 | ||
| 218 | *last = false; | 237 | *last = false; |
| 219 | return 0; | 238 | return 0; |
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c index dadd1b344497..b58eccb21f03 100644 --- a/net/sched/cls_u32.c +++ b/net/sched/cls_u32.c | |||
| @@ -399,6 +399,7 @@ static int u32_destroy_key(struct tcf_proto *tp, struct tc_u_knode *n, | |||
| 399 | bool free_pf) | 399 | bool free_pf) |
| 400 | { | 400 | { |
| 401 | tcf_exts_destroy(&n->exts); | 401 | tcf_exts_destroy(&n->exts); |
| 402 | tcf_exts_put_net(&n->exts); | ||
| 402 | if (n->ht_down) | 403 | if (n->ht_down) |
| 403 | n->ht_down->refcnt--; | 404 | n->ht_down->refcnt--; |
| 404 | #ifdef CONFIG_CLS_U32_PERF | 405 | #ifdef CONFIG_CLS_U32_PERF |
| @@ -476,6 +477,7 @@ static int u32_delete_key(struct tcf_proto *tp, struct tc_u_knode *key) | |||
| 476 | RCU_INIT_POINTER(*kp, key->next); | 477 | RCU_INIT_POINTER(*kp, key->next); |
| 477 | 478 | ||
| 478 | tcf_unbind_filter(tp, &key->res); | 479 | tcf_unbind_filter(tp, &key->res); |
| 480 | tcf_exts_get_net(&key->exts); | ||
| 479 | call_rcu(&key->rcu, u32_delete_key_freepf_rcu); | 481 | call_rcu(&key->rcu, u32_delete_key_freepf_rcu); |
| 480 | return 0; | 482 | return 0; |
| 481 | } | 483 | } |
| @@ -588,7 +590,10 @@ static void u32_clear_hnode(struct tcf_proto *tp, struct tc_u_hnode *ht) | |||
| 588 | rtnl_dereference(n->next)); | 590 | rtnl_dereference(n->next)); |
| 589 | tcf_unbind_filter(tp, &n->res); | 591 | tcf_unbind_filter(tp, &n->res); |
| 590 | u32_remove_hw_knode(tp, n->handle); | 592 | u32_remove_hw_knode(tp, n->handle); |
| 591 | call_rcu(&n->rcu, u32_delete_key_freepf_rcu); | 593 | if (tcf_exts_get_net(&n->exts)) |
| 594 | call_rcu(&n->rcu, u32_delete_key_freepf_rcu); | ||
| 595 | else | ||
| 596 | u32_destroy_key(n->tp, n, true); | ||
| 592 | } | 597 | } |
| 593 | } | 598 | } |
| 594 | } | 599 | } |
| @@ -949,6 +954,7 @@ static int u32_change(struct net *net, struct sk_buff *in_skb, | |||
| 949 | 954 | ||
| 950 | u32_replace_knode(tp, tp_c, new); | 955 | u32_replace_knode(tp, tp_c, new); |
| 951 | tcf_unbind_filter(tp, &n->res); | 956 | tcf_unbind_filter(tp, &n->res); |
| 957 | tcf_exts_get_net(&n->exts); | ||
| 952 | call_rcu(&n->rcu, u32_delete_key_rcu); | 958 | call_rcu(&n->rcu, u32_delete_key_rcu); |
| 953 | return 0; | 959 | return 0; |
| 954 | } | 960 | } |
diff --git a/net/xfrm/xfrm_input.c b/net/xfrm/xfrm_input.c index 82d20ee34581..347ab31574d5 100644 --- a/net/xfrm/xfrm_input.c +++ b/net/xfrm/xfrm_input.c | |||
| @@ -266,8 +266,6 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) | |||
| 266 | goto lock; | 266 | goto lock; |
| 267 | } | 267 | } |
| 268 | 268 | ||
| 269 | daddr = (xfrm_address_t *)(skb_network_header(skb) + | ||
| 270 | XFRM_SPI_SKB_CB(skb)->daddroff); | ||
| 271 | family = XFRM_SPI_SKB_CB(skb)->family; | 269 | family = XFRM_SPI_SKB_CB(skb)->family; |
| 272 | 270 | ||
| 273 | /* if tunnel is present override skb->mark value with tunnel i_key */ | 271 | /* if tunnel is present override skb->mark value with tunnel i_key */ |
| @@ -294,6 +292,8 @@ int xfrm_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) | |||
| 294 | goto drop; | 292 | goto drop; |
| 295 | } | 293 | } |
| 296 | 294 | ||
| 295 | daddr = (xfrm_address_t *)(skb_network_header(skb) + | ||
| 296 | XFRM_SPI_SKB_CB(skb)->daddroff); | ||
| 297 | do { | 297 | do { |
| 298 | if (skb->sp->len == XFRM_MAX_DEPTH) { | 298 | if (skb->sp->len == XFRM_MAX_DEPTH) { |
| 299 | XFRM_INC_STATS(net, LINUX_MIB_XFRMINBUFFERERROR); | 299 | XFRM_INC_STATS(net, LINUX_MIB_XFRMINBUFFERERROR); |
diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c index 8cafb3c0a4ac..6eb228a70131 100644 --- a/net/xfrm/xfrm_policy.c +++ b/net/xfrm/xfrm_policy.c | |||
| @@ -1361,36 +1361,29 @@ xfrm_tmpl_resolve_one(struct xfrm_policy *policy, const struct flowi *fl, | |||
| 1361 | struct net *net = xp_net(policy); | 1361 | struct net *net = xp_net(policy); |
| 1362 | int nx; | 1362 | int nx; |
| 1363 | int i, error; | 1363 | int i, error; |
| 1364 | xfrm_address_t *daddr = xfrm_flowi_daddr(fl, family); | ||
| 1365 | xfrm_address_t *saddr = xfrm_flowi_saddr(fl, family); | ||
| 1366 | xfrm_address_t tmp; | 1364 | xfrm_address_t tmp; |
| 1367 | 1365 | ||
| 1368 | for (nx = 0, i = 0; i < policy->xfrm_nr; i++) { | 1366 | for (nx = 0, i = 0; i < policy->xfrm_nr; i++) { |
| 1369 | struct xfrm_state *x; | 1367 | struct xfrm_state *x; |
| 1370 | xfrm_address_t *remote = daddr; | 1368 | xfrm_address_t *local; |
| 1371 | xfrm_address_t *local = saddr; | 1369 | xfrm_address_t *remote; |
| 1372 | struct xfrm_tmpl *tmpl = &policy->xfrm_vec[i]; | 1370 | struct xfrm_tmpl *tmpl = &policy->xfrm_vec[i]; |
| 1373 | 1371 | ||
| 1374 | if (tmpl->mode == XFRM_MODE_TUNNEL || | 1372 | remote = &tmpl->id.daddr; |
| 1375 | tmpl->mode == XFRM_MODE_BEET) { | 1373 | local = &tmpl->saddr; |
| 1376 | remote = &tmpl->id.daddr; | 1374 | if (xfrm_addr_any(local, tmpl->encap_family)) { |
| 1377 | local = &tmpl->saddr; | 1375 | error = xfrm_get_saddr(net, fl->flowi_oif, |
| 1378 | if (xfrm_addr_any(local, tmpl->encap_family)) { | 1376 | &tmp, remote, |
| 1379 | error = xfrm_get_saddr(net, fl->flowi_oif, | 1377 | tmpl->encap_family, 0); |
| 1380 | &tmp, remote, | 1378 | if (error) |
| 1381 | tmpl->encap_family, 0); | 1379 | goto fail; |
| 1382 | if (error) | 1380 | local = &tmp; |
| 1383 | goto fail; | ||
| 1384 | local = &tmp; | ||
| 1385 | } | ||
| 1386 | } | 1381 | } |
| 1387 | 1382 | ||
| 1388 | x = xfrm_state_find(remote, local, fl, tmpl, policy, &error, family); | 1383 | x = xfrm_state_find(remote, local, fl, tmpl, policy, &error, family); |
| 1389 | 1384 | ||
| 1390 | if (x && x->km.state == XFRM_STATE_VALID) { | 1385 | if (x && x->km.state == XFRM_STATE_VALID) { |
| 1391 | xfrm[nx++] = x; | 1386 | xfrm[nx++] = x; |
| 1392 | daddr = remote; | ||
| 1393 | saddr = local; | ||
| 1394 | continue; | 1387 | continue; |
| 1395 | } | 1388 | } |
| 1396 | if (x) { | 1389 | if (x) { |
| @@ -1787,19 +1780,23 @@ void xfrm_policy_cache_flush(void) | |||
| 1787 | put_online_cpus(); | 1780 | put_online_cpus(); |
| 1788 | } | 1781 | } |
| 1789 | 1782 | ||
| 1790 | static bool xfrm_pol_dead(struct xfrm_dst *xdst) | 1783 | static bool xfrm_xdst_can_reuse(struct xfrm_dst *xdst, |
| 1784 | struct xfrm_state * const xfrm[], | ||
| 1785 | int num) | ||
| 1791 | { | 1786 | { |
| 1792 | unsigned int num_pols = xdst->num_pols; | 1787 | const struct dst_entry *dst = &xdst->u.dst; |
| 1793 | unsigned int pol_dead = 0, i; | 1788 | int i; |
| 1794 | 1789 | ||
| 1795 | for (i = 0; i < num_pols; i++) | 1790 | if (xdst->num_xfrms != num) |
| 1796 | pol_dead |= xdst->pols[i]->walk.dead; | 1791 | return false; |
| 1797 | 1792 | ||
| 1798 | /* Mark DST_OBSOLETE_DEAD to fail the next xfrm_dst_check() */ | 1793 | for (i = 0; i < num; i++) { |
| 1799 | if (pol_dead) | 1794 | if (!dst || dst->xfrm != xfrm[i]) |
| 1800 | xdst->u.dst.obsolete = DST_OBSOLETE_DEAD; | 1795 | return false; |
| 1796 | dst = dst->child; | ||
| 1797 | } | ||
| 1801 | 1798 | ||
| 1802 | return pol_dead; | 1799 | return xfrm_bundle_ok(xdst); |
| 1803 | } | 1800 | } |
| 1804 | 1801 | ||
| 1805 | static struct xfrm_dst * | 1802 | static struct xfrm_dst * |
| @@ -1813,26 +1810,28 @@ xfrm_resolve_and_create_bundle(struct xfrm_policy **pols, int num_pols, | |||
| 1813 | struct dst_entry *dst; | 1810 | struct dst_entry *dst; |
| 1814 | int err; | 1811 | int err; |
| 1815 | 1812 | ||
| 1813 | /* Try to instantiate a bundle */ | ||
| 1814 | err = xfrm_tmpl_resolve(pols, num_pols, fl, xfrm, family); | ||
| 1815 | if (err <= 0) { | ||
| 1816 | if (err != 0 && err != -EAGAIN) | ||
| 1817 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTPOLERROR); | ||
| 1818 | return ERR_PTR(err); | ||
| 1819 | } | ||
| 1820 | |||
| 1816 | xdst = this_cpu_read(xfrm_last_dst); | 1821 | xdst = this_cpu_read(xfrm_last_dst); |
| 1817 | if (xdst && | 1822 | if (xdst && |
| 1818 | xdst->u.dst.dev == dst_orig->dev && | 1823 | xdst->u.dst.dev == dst_orig->dev && |
| 1819 | xdst->num_pols == num_pols && | 1824 | xdst->num_pols == num_pols && |
| 1820 | !xfrm_pol_dead(xdst) && | ||
| 1821 | memcmp(xdst->pols, pols, | 1825 | memcmp(xdst->pols, pols, |
| 1822 | sizeof(struct xfrm_policy *) * num_pols) == 0 && | 1826 | sizeof(struct xfrm_policy *) * num_pols) == 0 && |
| 1823 | xfrm_bundle_ok(xdst)) { | 1827 | xfrm_xdst_can_reuse(xdst, xfrm, err)) { |
| 1824 | dst_hold(&xdst->u.dst); | 1828 | dst_hold(&xdst->u.dst); |
| 1829 | while (err > 0) | ||
| 1830 | xfrm_state_put(xfrm[--err]); | ||
| 1825 | return xdst; | 1831 | return xdst; |
| 1826 | } | 1832 | } |
| 1827 | 1833 | ||
| 1828 | old = xdst; | 1834 | old = xdst; |
| 1829 | /* Try to instantiate a bundle */ | ||
| 1830 | err = xfrm_tmpl_resolve(pols, num_pols, fl, xfrm, family); | ||
| 1831 | if (err <= 0) { | ||
| 1832 | if (err != 0 && err != -EAGAIN) | ||
| 1833 | XFRM_INC_STATS(net, LINUX_MIB_XFRMOUTPOLERROR); | ||
| 1834 | return ERR_PTR(err); | ||
| 1835 | } | ||
| 1836 | 1835 | ||
| 1837 | dst = xfrm_bundle_create(pols[0], xfrm, err, fl, dst_orig); | 1836 | dst = xfrm_bundle_create(pols[0], xfrm, err, fl, dst_orig); |
| 1838 | if (IS_ERR(dst)) { | 1837 | if (IS_ERR(dst)) { |
diff --git a/security/apparmor/ipc.c b/security/apparmor/ipc.c index 66fb9ede9447..7ca0032e7ba9 100644 --- a/security/apparmor/ipc.c +++ b/security/apparmor/ipc.c | |||
| @@ -128,7 +128,7 @@ static inline int map_signal_num(int sig) | |||
| 128 | return SIGUNKNOWN; | 128 | return SIGUNKNOWN; |
| 129 | else if (sig >= SIGRTMIN) | 129 | else if (sig >= SIGRTMIN) |
| 130 | return sig - SIGRTMIN + 128; /* rt sigs mapped to 128 */ | 130 | return sig - SIGRTMIN + 128; /* rt sigs mapped to 128 */ |
| 131 | else if (sig <= MAXMAPPED_SIG) | 131 | else if (sig < MAXMAPPED_SIG) |
| 132 | return sig_map[sig]; | 132 | return sig_map[sig]; |
| 133 | return SIGUNKNOWN; | 133 | return SIGUNKNOWN; |
| 134 | } | 134 | } |
| @@ -163,7 +163,7 @@ static void audit_signal_cb(struct audit_buffer *ab, void *va) | |||
| 163 | audit_signal_mask(ab, aad(sa)->denied); | 163 | audit_signal_mask(ab, aad(sa)->denied); |
| 164 | } | 164 | } |
| 165 | } | 165 | } |
| 166 | if (aad(sa)->signal <= MAXMAPPED_SIG) | 166 | if (aad(sa)->signal < MAXMAPPED_SIG) |
| 167 | audit_log_format(ab, " signal=%s", sig_names[aad(sa)->signal]); | 167 | audit_log_format(ab, " signal=%s", sig_names[aad(sa)->signal]); |
| 168 | else | 168 | else |
| 169 | audit_log_format(ab, " signal=rtmin+%d", | 169 | audit_log_format(ab, " signal=rtmin+%d", |
diff --git a/sound/core/hrtimer.c b/sound/core/hrtimer.c index 1ac0c423903e..6e47b823bcaa 100644 --- a/sound/core/hrtimer.c +++ b/sound/core/hrtimer.c | |||
| @@ -159,6 +159,7 @@ static int __init snd_hrtimer_init(void) | |||
| 159 | timer->hw = hrtimer_hw; | 159 | timer->hw = hrtimer_hw; |
| 160 | timer->hw.resolution = resolution; | 160 | timer->hw.resolution = resolution; |
| 161 | timer->hw.ticks = NANO_SEC / resolution; | 161 | timer->hw.ticks = NANO_SEC / resolution; |
| 162 | timer->max_instances = 100; /* lower the limit */ | ||
| 162 | 163 | ||
| 163 | err = snd_timer_global_register(timer); | 164 | err = snd_timer_global_register(timer); |
| 164 | if (err < 0) { | 165 | if (err < 0) { |
diff --git a/sound/core/seq/oss/seq_oss_midi.c b/sound/core/seq/oss/seq_oss_midi.c index aaff9ee32695..b30b2139e3f0 100644 --- a/sound/core/seq/oss/seq_oss_midi.c +++ b/sound/core/seq/oss/seq_oss_midi.c | |||
| @@ -612,9 +612,7 @@ send_midi_event(struct seq_oss_devinfo *dp, struct snd_seq_event *ev, struct seq | |||
| 612 | if (!dp->timer->running) | 612 | if (!dp->timer->running) |
| 613 | len = snd_seq_oss_timer_start(dp->timer); | 613 | len = snd_seq_oss_timer_start(dp->timer); |
| 614 | if (ev->type == SNDRV_SEQ_EVENT_SYSEX) { | 614 | if (ev->type == SNDRV_SEQ_EVENT_SYSEX) { |
| 615 | if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) == SNDRV_SEQ_EVENT_LENGTH_VARIABLE) | 615 | snd_seq_oss_readq_sysex(dp->readq, mdev->seq_device, ev); |
| 616 | snd_seq_oss_readq_puts(dp->readq, mdev->seq_device, | ||
| 617 | ev->data.ext.ptr, ev->data.ext.len); | ||
| 618 | } else { | 616 | } else { |
| 619 | len = snd_midi_event_decode(mdev->coder, msg, sizeof(msg), ev); | 617 | len = snd_midi_event_decode(mdev->coder, msg, sizeof(msg), ev); |
| 620 | if (len > 0) | 618 | if (len > 0) |
diff --git a/sound/core/seq/oss/seq_oss_readq.c b/sound/core/seq/oss/seq_oss_readq.c index 046cb586fb2f..06b21226b4e7 100644 --- a/sound/core/seq/oss/seq_oss_readq.c +++ b/sound/core/seq/oss/seq_oss_readq.c | |||
| @@ -118,6 +118,35 @@ snd_seq_oss_readq_puts(struct seq_oss_readq *q, int dev, unsigned char *data, in | |||
| 118 | } | 118 | } |
| 119 | 119 | ||
| 120 | /* | 120 | /* |
| 121 | * put MIDI sysex bytes; the event buffer may be chained, thus it has | ||
| 122 | * to be expanded via snd_seq_dump_var_event(). | ||
| 123 | */ | ||
| 124 | struct readq_sysex_ctx { | ||
| 125 | struct seq_oss_readq *readq; | ||
| 126 | int dev; | ||
| 127 | }; | ||
| 128 | |||
| 129 | static int readq_dump_sysex(void *ptr, void *buf, int count) | ||
| 130 | { | ||
| 131 | struct readq_sysex_ctx *ctx = ptr; | ||
| 132 | |||
| 133 | return snd_seq_oss_readq_puts(ctx->readq, ctx->dev, buf, count); | ||
| 134 | } | ||
| 135 | |||
| 136 | int snd_seq_oss_readq_sysex(struct seq_oss_readq *q, int dev, | ||
| 137 | struct snd_seq_event *ev) | ||
| 138 | { | ||
| 139 | struct readq_sysex_ctx ctx = { | ||
| 140 | .readq = q, | ||
| 141 | .dev = dev | ||
| 142 | }; | ||
| 143 | |||
| 144 | if ((ev->flags & SNDRV_SEQ_EVENT_LENGTH_MASK) != SNDRV_SEQ_EVENT_LENGTH_VARIABLE) | ||
| 145 | return 0; | ||
| 146 | return snd_seq_dump_var_event(ev, readq_dump_sysex, &ctx); | ||
| 147 | } | ||
| 148 | |||
| 149 | /* | ||
| 121 | * copy an event to input queue: | 150 | * copy an event to input queue: |
| 122 | * return zero if enqueued | 151 | * return zero if enqueued |
| 123 | */ | 152 | */ |
diff --git a/sound/core/seq/oss/seq_oss_readq.h b/sound/core/seq/oss/seq_oss_readq.h index f1463f1f449e..8d033ca2d23f 100644 --- a/sound/core/seq/oss/seq_oss_readq.h +++ b/sound/core/seq/oss/seq_oss_readq.h | |||
| @@ -44,6 +44,8 @@ void snd_seq_oss_readq_delete(struct seq_oss_readq *q); | |||
| 44 | void snd_seq_oss_readq_clear(struct seq_oss_readq *readq); | 44 | void snd_seq_oss_readq_clear(struct seq_oss_readq *readq); |
| 45 | unsigned int snd_seq_oss_readq_poll(struct seq_oss_readq *readq, struct file *file, poll_table *wait); | 45 | unsigned int snd_seq_oss_readq_poll(struct seq_oss_readq *readq, struct file *file, poll_table *wait); |
| 46 | int snd_seq_oss_readq_puts(struct seq_oss_readq *readq, int dev, unsigned char *data, int len); | 46 | int snd_seq_oss_readq_puts(struct seq_oss_readq *readq, int dev, unsigned char *data, int len); |
| 47 | int snd_seq_oss_readq_sysex(struct seq_oss_readq *q, int dev, | ||
| 48 | struct snd_seq_event *ev); | ||
| 47 | int snd_seq_oss_readq_put_event(struct seq_oss_readq *readq, union evrec *ev); | 49 | int snd_seq_oss_readq_put_event(struct seq_oss_readq *readq, union evrec *ev); |
| 48 | int snd_seq_oss_readq_put_timestamp(struct seq_oss_readq *readq, unsigned long curt, int seq_mode); | 50 | int snd_seq_oss_readq_put_timestamp(struct seq_oss_readq *readq, unsigned long curt, int seq_mode); |
| 49 | int snd_seq_oss_readq_pick(struct seq_oss_readq *q, union evrec *rec); | 51 | int snd_seq_oss_readq_pick(struct seq_oss_readq *q, union evrec *rec); |
diff --git a/sound/core/timer.c b/sound/core/timer.c index 6cdd04a45962..15e82a656d96 100644 --- a/sound/core/timer.c +++ b/sound/core/timer.c | |||
| @@ -180,7 +180,7 @@ static void snd_timer_request(struct snd_timer_id *tid) | |||
| 180 | * | 180 | * |
| 181 | * call this with register_mutex down. | 181 | * call this with register_mutex down. |
| 182 | */ | 182 | */ |
| 183 | static void snd_timer_check_slave(struct snd_timer_instance *slave) | 183 | static int snd_timer_check_slave(struct snd_timer_instance *slave) |
| 184 | { | 184 | { |
| 185 | struct snd_timer *timer; | 185 | struct snd_timer *timer; |
| 186 | struct snd_timer_instance *master; | 186 | struct snd_timer_instance *master; |
| @@ -190,16 +190,21 @@ static void snd_timer_check_slave(struct snd_timer_instance *slave) | |||
| 190 | list_for_each_entry(master, &timer->open_list_head, open_list) { | 190 | list_for_each_entry(master, &timer->open_list_head, open_list) { |
| 191 | if (slave->slave_class == master->slave_class && | 191 | if (slave->slave_class == master->slave_class && |
| 192 | slave->slave_id == master->slave_id) { | 192 | slave->slave_id == master->slave_id) { |
| 193 | if (master->timer->num_instances >= | ||
| 194 | master->timer->max_instances) | ||
| 195 | return -EBUSY; | ||
| 193 | list_move_tail(&slave->open_list, | 196 | list_move_tail(&slave->open_list, |
| 194 | &master->slave_list_head); | 197 | &master->slave_list_head); |
| 198 | master->timer->num_instances++; | ||
| 195 | spin_lock_irq(&slave_active_lock); | 199 | spin_lock_irq(&slave_active_lock); |
| 196 | slave->master = master; | 200 | slave->master = master; |
| 197 | slave->timer = master->timer; | 201 | slave->timer = master->timer; |
| 198 | spin_unlock_irq(&slave_active_lock); | 202 | spin_unlock_irq(&slave_active_lock); |
| 199 | return; | 203 | return 0; |
| 200 | } | 204 | } |
| 201 | } | 205 | } |
| 202 | } | 206 | } |
| 207 | return 0; | ||
| 203 | } | 208 | } |
| 204 | 209 | ||
| 205 | /* | 210 | /* |
| @@ -208,7 +213,7 @@ static void snd_timer_check_slave(struct snd_timer_instance *slave) | |||
| 208 | * | 213 | * |
| 209 | * call this with register_mutex down. | 214 | * call this with register_mutex down. |
| 210 | */ | 215 | */ |
| 211 | static void snd_timer_check_master(struct snd_timer_instance *master) | 216 | static int snd_timer_check_master(struct snd_timer_instance *master) |
| 212 | { | 217 | { |
| 213 | struct snd_timer_instance *slave, *tmp; | 218 | struct snd_timer_instance *slave, *tmp; |
| 214 | 219 | ||
| @@ -216,7 +221,11 @@ static void snd_timer_check_master(struct snd_timer_instance *master) | |||
| 216 | list_for_each_entry_safe(slave, tmp, &snd_timer_slave_list, open_list) { | 221 | list_for_each_entry_safe(slave, tmp, &snd_timer_slave_list, open_list) { |
| 217 | if (slave->slave_class == master->slave_class && | 222 | if (slave->slave_class == master->slave_class && |
| 218 | slave->slave_id == master->slave_id) { | 223 | slave->slave_id == master->slave_id) { |
| 224 | if (master->timer->num_instances >= | ||
| 225 | master->timer->max_instances) | ||
| 226 | return -EBUSY; | ||
| 219 | list_move_tail(&slave->open_list, &master->slave_list_head); | 227 | list_move_tail(&slave->open_list, &master->slave_list_head); |
| 228 | master->timer->num_instances++; | ||
| 220 | spin_lock_irq(&slave_active_lock); | 229 | spin_lock_irq(&slave_active_lock); |
| 221 | spin_lock(&master->timer->lock); | 230 | spin_lock(&master->timer->lock); |
| 222 | slave->master = master; | 231 | slave->master = master; |
| @@ -228,8 +237,11 @@ static void snd_timer_check_master(struct snd_timer_instance *master) | |||
| 228 | spin_unlock_irq(&slave_active_lock); | 237 | spin_unlock_irq(&slave_active_lock); |
| 229 | } | 238 | } |
| 230 | } | 239 | } |
| 240 | return 0; | ||
| 231 | } | 241 | } |
| 232 | 242 | ||
| 243 | static int snd_timer_close_locked(struct snd_timer_instance *timeri); | ||
| 244 | |||
| 233 | /* | 245 | /* |
| 234 | * open a timer instance | 246 | * open a timer instance |
| 235 | * when opening a master, the slave id must be here given. | 247 | * when opening a master, the slave id must be here given. |
| @@ -240,6 +252,7 @@ int snd_timer_open(struct snd_timer_instance **ti, | |||
| 240 | { | 252 | { |
| 241 | struct snd_timer *timer; | 253 | struct snd_timer *timer; |
| 242 | struct snd_timer_instance *timeri = NULL; | 254 | struct snd_timer_instance *timeri = NULL; |
| 255 | int err; | ||
| 243 | 256 | ||
| 244 | if (tid->dev_class == SNDRV_TIMER_CLASS_SLAVE) { | 257 | if (tid->dev_class == SNDRV_TIMER_CLASS_SLAVE) { |
| 245 | /* open a slave instance */ | 258 | /* open a slave instance */ |
| @@ -259,10 +272,14 @@ int snd_timer_open(struct snd_timer_instance **ti, | |||
| 259 | timeri->slave_id = tid->device; | 272 | timeri->slave_id = tid->device; |
| 260 | timeri->flags |= SNDRV_TIMER_IFLG_SLAVE; | 273 | timeri->flags |= SNDRV_TIMER_IFLG_SLAVE; |
| 261 | list_add_tail(&timeri->open_list, &snd_timer_slave_list); | 274 | list_add_tail(&timeri->open_list, &snd_timer_slave_list); |
| 262 | snd_timer_check_slave(timeri); | 275 | err = snd_timer_check_slave(timeri); |
| 276 | if (err < 0) { | ||
| 277 | snd_timer_close_locked(timeri); | ||
| 278 | timeri = NULL; | ||
| 279 | } | ||
| 263 | mutex_unlock(®ister_mutex); | 280 | mutex_unlock(®ister_mutex); |
| 264 | *ti = timeri; | 281 | *ti = timeri; |
| 265 | return 0; | 282 | return err; |
| 266 | } | 283 | } |
| 267 | 284 | ||
| 268 | /* open a master instance */ | 285 | /* open a master instance */ |
| @@ -288,6 +305,10 @@ int snd_timer_open(struct snd_timer_instance **ti, | |||
| 288 | return -EBUSY; | 305 | return -EBUSY; |
| 289 | } | 306 | } |
| 290 | } | 307 | } |
| 308 | if (timer->num_instances >= timer->max_instances) { | ||
| 309 | mutex_unlock(®ister_mutex); | ||
| 310 | return -EBUSY; | ||
| 311 | } | ||
| 291 | timeri = snd_timer_instance_new(owner, timer); | 312 | timeri = snd_timer_instance_new(owner, timer); |
| 292 | if (!timeri) { | 313 | if (!timeri) { |
| 293 | mutex_unlock(®ister_mutex); | 314 | mutex_unlock(®ister_mutex); |
| @@ -314,25 +335,27 @@ int snd_timer_open(struct snd_timer_instance **ti, | |||
| 314 | } | 335 | } |
| 315 | 336 | ||
| 316 | list_add_tail(&timeri->open_list, &timer->open_list_head); | 337 | list_add_tail(&timeri->open_list, &timer->open_list_head); |
| 317 | snd_timer_check_master(timeri); | 338 | timer->num_instances++; |
| 339 | err = snd_timer_check_master(timeri); | ||
| 340 | if (err < 0) { | ||
| 341 | snd_timer_close_locked(timeri); | ||
| 342 | timeri = NULL; | ||
| 343 | } | ||
| 318 | mutex_unlock(®ister_mutex); | 344 | mutex_unlock(®ister_mutex); |
| 319 | *ti = timeri; | 345 | *ti = timeri; |
| 320 | return 0; | 346 | return err; |
| 321 | } | 347 | } |
| 322 | EXPORT_SYMBOL(snd_timer_open); | 348 | EXPORT_SYMBOL(snd_timer_open); |
| 323 | 349 | ||
| 324 | /* | 350 | /* |
| 325 | * close a timer instance | 351 | * close a timer instance |
| 352 | * call this with register_mutex down. | ||
| 326 | */ | 353 | */ |
| 327 | int snd_timer_close(struct snd_timer_instance *timeri) | 354 | static int snd_timer_close_locked(struct snd_timer_instance *timeri) |
| 328 | { | 355 | { |
| 329 | struct snd_timer *timer = NULL; | 356 | struct snd_timer *timer = NULL; |
| 330 | struct snd_timer_instance *slave, *tmp; | 357 | struct snd_timer_instance *slave, *tmp; |
| 331 | 358 | ||
| 332 | if (snd_BUG_ON(!timeri)) | ||
| 333 | return -ENXIO; | ||
| 334 | |||
| 335 | mutex_lock(®ister_mutex); | ||
| 336 | list_del(&timeri->open_list); | 359 | list_del(&timeri->open_list); |
| 337 | 360 | ||
| 338 | /* force to stop the timer */ | 361 | /* force to stop the timer */ |
| @@ -340,6 +363,7 @@ int snd_timer_close(struct snd_timer_instance *timeri) | |||
| 340 | 363 | ||
| 341 | timer = timeri->timer; | 364 | timer = timeri->timer; |
| 342 | if (timer) { | 365 | if (timer) { |
| 366 | timer->num_instances--; | ||
| 343 | /* wait, until the active callback is finished */ | 367 | /* wait, until the active callback is finished */ |
| 344 | spin_lock_irq(&timer->lock); | 368 | spin_lock_irq(&timer->lock); |
| 345 | while (timeri->flags & SNDRV_TIMER_IFLG_CALLBACK) { | 369 | while (timeri->flags & SNDRV_TIMER_IFLG_CALLBACK) { |
| @@ -355,6 +379,7 @@ int snd_timer_close(struct snd_timer_instance *timeri) | |||
| 355 | list_for_each_entry_safe(slave, tmp, &timeri->slave_list_head, | 379 | list_for_each_entry_safe(slave, tmp, &timeri->slave_list_head, |
| 356 | open_list) { | 380 | open_list) { |
| 357 | list_move_tail(&slave->open_list, &snd_timer_slave_list); | 381 | list_move_tail(&slave->open_list, &snd_timer_slave_list); |
| 382 | timer->num_instances--; | ||
| 358 | slave->master = NULL; | 383 | slave->master = NULL; |
| 359 | slave->timer = NULL; | 384 | slave->timer = NULL; |
| 360 | list_del_init(&slave->ack_list); | 385 | list_del_init(&slave->ack_list); |
| @@ -382,9 +407,24 @@ int snd_timer_close(struct snd_timer_instance *timeri) | |||
| 382 | module_put(timer->module); | 407 | module_put(timer->module); |
| 383 | } | 408 | } |
| 384 | 409 | ||
| 385 | mutex_unlock(®ister_mutex); | ||
| 386 | return 0; | 410 | return 0; |
| 387 | } | 411 | } |
| 412 | |||
| 413 | /* | ||
| 414 | * close a timer instance | ||
| 415 | */ | ||
| 416 | int snd_timer_close(struct snd_timer_instance *timeri) | ||
| 417 | { | ||
| 418 | int err; | ||
| 419 | |||
| 420 | if (snd_BUG_ON(!timeri)) | ||
| 421 | return -ENXIO; | ||
| 422 | |||
| 423 | mutex_lock(®ister_mutex); | ||
| 424 | err = snd_timer_close_locked(timeri); | ||
| 425 | mutex_unlock(®ister_mutex); | ||
| 426 | return err; | ||
| 427 | } | ||
| 388 | EXPORT_SYMBOL(snd_timer_close); | 428 | EXPORT_SYMBOL(snd_timer_close); |
| 389 | 429 | ||
| 390 | unsigned long snd_timer_resolution(struct snd_timer_instance *timeri) | 430 | unsigned long snd_timer_resolution(struct snd_timer_instance *timeri) |
| @@ -856,6 +896,7 @@ int snd_timer_new(struct snd_card *card, char *id, struct snd_timer_id *tid, | |||
| 856 | spin_lock_init(&timer->lock); | 896 | spin_lock_init(&timer->lock); |
| 857 | tasklet_init(&timer->task_queue, snd_timer_tasklet, | 897 | tasklet_init(&timer->task_queue, snd_timer_tasklet, |
| 858 | (unsigned long)timer); | 898 | (unsigned long)timer); |
| 899 | timer->max_instances = 1000; /* default limit per timer */ | ||
| 859 | if (card != NULL) { | 900 | if (card != NULL) { |
| 860 | timer->module = card->module; | 901 | timer->module = card->module; |
| 861 | err = snd_device_new(card, SNDRV_DEV_TIMER, timer, &ops); | 902 | err = snd_device_new(card, SNDRV_DEV_TIMER, timer, &ops); |
diff --git a/sound/pci/hda/patch_realtek.c b/sound/pci/hda/patch_realtek.c index 546d515f3c1f..dce0682c5001 100644 --- a/sound/pci/hda/patch_realtek.c +++ b/sound/pci/hda/patch_realtek.c | |||
| @@ -6544,6 +6544,11 @@ static const struct snd_hda_pin_quirk alc269_pin_fixup_tbl[] = { | |||
| 6544 | {0x14, 0x90170110}, | 6544 | {0x14, 0x90170110}, |
| 6545 | {0x1b, 0x90a70130}, | 6545 | {0x1b, 0x90a70130}, |
| 6546 | {0x21, 0x03211020}), | 6546 | {0x21, 0x03211020}), |
| 6547 | SND_HDA_PIN_QUIRK(0x10ec0274, 0x1028, "Dell", ALC269_FIXUP_DELL1_MIC_NO_PRESENCE, | ||
| 6548 | {0x12, 0xb7a60130}, | ||
| 6549 | {0x13, 0xb8a61140}, | ||
| 6550 | {0x16, 0x90170110}, | ||
| 6551 | {0x21, 0x04211020}), | ||
| 6547 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, | 6552 | SND_HDA_PIN_QUIRK(0x10ec0280, 0x103c, "HP", ALC280_FIXUP_HP_GPIO4, |
| 6548 | {0x12, 0x90a60130}, | 6553 | {0x12, 0x90a60130}, |
| 6549 | {0x14, 0x90170110}, | 6554 | {0x14, 0x90170110}, |
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index 4f5f18f22974..20624320b753 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c | |||
| @@ -1375,6 +1375,7 @@ u64 snd_usb_interface_dsd_format_quirks(struct snd_usb_audio *chip, | |||
| 1375 | case 0x199: | 1375 | case 0x199: |
| 1376 | return SNDRV_PCM_FMTBIT_DSD_U32_LE; | 1376 | return SNDRV_PCM_FMTBIT_DSD_U32_LE; |
| 1377 | case 0x19b: | 1377 | case 0x19b: |
| 1378 | case 0x203: | ||
| 1378 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; | 1379 | return SNDRV_PCM_FMTBIT_DSD_U32_BE; |
| 1379 | default: | 1380 | default: |
| 1380 | break; | 1381 | break; |
diff --git a/tools/include/uapi/drm/i915_drm.h b/tools/include/uapi/drm/i915_drm.h index 6598fb76d2c2..9816590d3ad2 100644 --- a/tools/include/uapi/drm/i915_drm.h +++ b/tools/include/uapi/drm/i915_drm.h | |||
| @@ -829,6 +829,7 @@ struct drm_i915_gem_exec_fence { | |||
| 829 | 829 | ||
| 830 | #define I915_EXEC_FENCE_WAIT (1<<0) | 830 | #define I915_EXEC_FENCE_WAIT (1<<0) |
| 831 | #define I915_EXEC_FENCE_SIGNAL (1<<1) | 831 | #define I915_EXEC_FENCE_SIGNAL (1<<1) |
| 832 | #define __I915_EXEC_FENCE_UNKNOWN_FLAGS (-(I915_EXEC_FENCE_SIGNAL << 1)) | ||
| 832 | __u32 flags; | 833 | __u32 flags; |
| 833 | }; | 834 | }; |
| 834 | 835 | ||
diff --git a/tools/perf/builtin-trace.c b/tools/perf/builtin-trace.c index 771ddab94bb0..d5d7fff1c211 100644 --- a/tools/perf/builtin-trace.c +++ b/tools/perf/builtin-trace.c | |||
| @@ -1138,6 +1138,14 @@ static int trace__symbols_init(struct trace *trace, struct perf_evlist *evlist) | |||
| 1138 | return err; | 1138 | return err; |
| 1139 | } | 1139 | } |
| 1140 | 1140 | ||
| 1141 | static void trace__symbols__exit(struct trace *trace) | ||
| 1142 | { | ||
| 1143 | machine__exit(trace->host); | ||
| 1144 | trace->host = NULL; | ||
| 1145 | |||
| 1146 | symbol__exit(); | ||
| 1147 | } | ||
| 1148 | |||
| 1141 | static int syscall__alloc_arg_fmts(struct syscall *sc, int nr_args) | 1149 | static int syscall__alloc_arg_fmts(struct syscall *sc, int nr_args) |
| 1142 | { | 1150 | { |
| 1143 | int idx; | 1151 | int idx; |
| @@ -2481,6 +2489,8 @@ out_disable: | |||
| 2481 | } | 2489 | } |
| 2482 | 2490 | ||
| 2483 | out_delete_evlist: | 2491 | out_delete_evlist: |
| 2492 | trace__symbols__exit(trace); | ||
| 2493 | |||
| 2484 | perf_evlist__delete(evlist); | 2494 | perf_evlist__delete(evlist); |
| 2485 | trace->evlist = NULL; | 2495 | trace->evlist = NULL; |
| 2486 | trace->live = false; | 2496 | trace->live = false; |
diff --git a/tools/perf/util/parse-events.l b/tools/perf/util/parse-events.l index 6680e4fb7967..025729510525 100644 --- a/tools/perf/util/parse-events.l +++ b/tools/perf/util/parse-events.l | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | %option stack | 5 | %option stack |
| 6 | %option bison-locations | 6 | %option bison-locations |
| 7 | %option yylineno | 7 | %option yylineno |
| 8 | %option reject | ||
| 8 | 9 | ||
| 9 | %{ | 10 | %{ |
| 10 | #include <errno.h> | 11 | #include <errno.h> |
| @@ -339,8 +340,8 @@ r{num_raw_hex} { return raw(yyscanner); } | |||
| 339 | {num_hex} { return value(yyscanner, 16); } | 340 | {num_hex} { return value(yyscanner, 16); } |
| 340 | 341 | ||
| 341 | {modifier_event} { return str(yyscanner, PE_MODIFIER_EVENT); } | 342 | {modifier_event} { return str(yyscanner, PE_MODIFIER_EVENT); } |
| 342 | {bpf_object} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_OBJECT); } | 343 | {bpf_object} { if (!isbpf(yyscanner)) { USER_REJECT }; return str(yyscanner, PE_BPF_OBJECT); } |
| 343 | {bpf_source} { if (!isbpf(yyscanner)) USER_REJECT; return str(yyscanner, PE_BPF_SOURCE); } | 344 | {bpf_source} { if (!isbpf(yyscanner)) { USER_REJECT }; return str(yyscanner, PE_BPF_SOURCE); } |
| 344 | {name} { return pmu_str_check(yyscanner); } | 345 | {name} { return pmu_str_check(yyscanner); } |
| 345 | "/" { BEGIN(config); return '/'; } | 346 | "/" { BEGIN(config); return '/'; } |
| 346 | - { return '-'; } | 347 | - { return '-'; } |
