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

Merge 6.2-rc8 into usb-next

We need the USB fixes in here for testing.

Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

+1669 -860
+5
Documentation/devicetree/bindings/.gitignore
··· 2 2 *.example.dts 3 3 /processed-schema*.yaml 4 4 /processed-schema*.json 5 + 6 + # 7 + # We don't want to ignore the following even if they are dot-files 8 + # 9 + !.yamllint
+1 -1
Documentation/devicetree/bindings/interrupt-controller/arm,gic-v3.yaml
··· 108 108 109 109 msi-controller: 110 110 description: 111 - Only present if the Message Based Interrupt functionnality is 111 + Only present if the Message Based Interrupt functionality is 112 112 being exposed by the HW, and the mbi-ranges property present. 113 113 114 114 mbi-ranges:
+1 -1
Documentation/networking/device_drivers/ethernet/wangxun/txgbe.rst
··· 16 16 17 17 Support 18 18 ======= 19 - If you got any problem, contact Wangxun support team via support@trustnetic.com 19 + If you got any problem, contact Wangxun support team via nic-support@net-swift.com 20 20 and Cc: netdev.
+7 -6
MAINTAINERS
··· 16120 16120 16121 16121 PCI ENDPOINT SUBSYSTEM 16122 16122 M: Lorenzo Pieralisi <lpieralisi@kernel.org> 16123 - R: Krzysztof Wilczyński <kw@linux.com> 16123 + M: Krzysztof Wilczyński <kw@linux.com> 16124 16124 R: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> 16125 16125 R: Kishon Vijay Abraham I <kishon@kernel.org> 16126 16126 L: linux-pci@vger.kernel.org ··· 16128 16128 Q: https://patchwork.kernel.org/project/linux-pci/list/ 16129 16129 B: https://bugzilla.kernel.org 16130 16130 C: irc://irc.oftc.net/linux-pci 16131 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git 16131 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git 16132 16132 F: Documentation/PCI/endpoint/* 16133 16133 F: Documentation/misc-devices/pci-endpoint-test.rst 16134 16134 F: drivers/misc/pci_endpoint_test.c ··· 16163 16163 Q: https://patchwork.kernel.org/project/linux-pci/list/ 16164 16164 B: https://bugzilla.kernel.org 16165 16165 C: irc://irc.oftc.net/linux-pci 16166 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git 16166 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git 16167 16167 F: Documentation/driver-api/pci/p2pdma.rst 16168 16168 F: drivers/pci/p2pdma.c 16169 16169 F: include/linux/pci-p2pdma.h ··· 16185 16185 16186 16186 PCI NATIVE HOST BRIDGE AND ENDPOINT DRIVERS 16187 16187 M: Lorenzo Pieralisi <lpieralisi@kernel.org> 16188 + M: Krzysztof Wilczyński <kw@linux.com> 16188 16189 R: Rob Herring <robh@kernel.org> 16189 - R: Krzysztof Wilczyński <kw@linux.com> 16190 16190 L: linux-pci@vger.kernel.org 16191 16191 S: Supported 16192 16192 Q: https://patchwork.kernel.org/project/linux-pci/list/ 16193 16193 B: https://bugzilla.kernel.org 16194 16194 C: irc://irc.oftc.net/linux-pci 16195 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/lpieralisi/pci.git 16195 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git 16196 16196 F: Documentation/devicetree/bindings/pci/ 16197 16197 F: drivers/pci/controller/ 16198 16198 F: drivers/pci/pci-bridge-emul.c ··· 16205 16205 Q: https://patchwork.kernel.org/project/linux-pci/list/ 16206 16206 B: https://bugzilla.kernel.org 16207 16207 C: irc://irc.oftc.net/linux-pci 16208 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git 16208 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git 16209 16209 F: Documentation/PCI/ 16210 16210 F: Documentation/devicetree/bindings/pci/ 16211 16211 F: arch/x86/kernel/early-quirks.c ··· 20098 20098 SUPERH 20099 20099 M: Yoshinori Sato <ysato@users.sourceforge.jp> 20100 20100 M: Rich Felker <dalias@libc.org> 20101 + M: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> 20101 20102 L: linux-sh@vger.kernel.org 20102 20103 S: Maintained 20103 20104 Q: http://patchwork.kernel.org/project/linux-sh/list/
+1 -1
Makefile
··· 2 2 VERSION = 6 3 3 PATCHLEVEL = 2 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc7 5 + EXTRAVERSION = -rc8 6 6 NAME = Hurr durr I'ma ninja sloth 7 7 8 8 # *DOCUMENTATION*
+1
arch/arm/boot/dts/rk3288.dtsi
··· 1181 1181 clock-names = "dp", "pclk"; 1182 1182 phys = <&edp_phy>; 1183 1183 phy-names = "dp"; 1184 + power-domains = <&power RK3288_PD_VIO>; 1184 1185 resets = <&cru SRST_EDP>; 1185 1186 reset-names = "dp"; 1186 1187 rockchip,grf = <&grf>;
+1 -1
arch/arm/boot/dts/stihxxx-b2120.dtsi
··· 178 178 tsin-num = <0>; 179 179 serial-not-parallel; 180 180 i2c-bus = <&ssc2>; 181 - reset-gpios = <&pio15 4 GPIO_ACTIVE_HIGH>; 181 + reset-gpios = <&pio15 4 GPIO_ACTIVE_LOW>; 182 182 dvb-card = <STV0367_TDA18212_NIMA_1>; 183 183 }; 184 184 };
+2 -2
arch/arm64/boot/dts/amlogic/meson-axg.dtsi
··· 1886 1886 sd_emmc_b: sd@5000 { 1887 1887 compatible = "amlogic,meson-axg-mmc"; 1888 1888 reg = <0x0 0x5000 0x0 0x800>; 1889 - interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>; 1889 + interrupts = <GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH>; 1890 1890 status = "disabled"; 1891 1891 clocks = <&clkc CLKID_SD_EMMC_B>, 1892 1892 <&clkc CLKID_SD_EMMC_B_CLK0>, ··· 1898 1898 sd_emmc_c: mmc@7000 { 1899 1899 compatible = "amlogic,meson-axg-mmc"; 1900 1900 reg = <0x0 0x7000 0x0 0x800>; 1901 - interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>; 1901 + interrupts = <GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH>; 1902 1902 status = "disabled"; 1903 1903 clocks = <&clkc CLKID_SD_EMMC_C>, 1904 1904 <&clkc CLKID_SD_EMMC_C_CLK0>,
+3 -3
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi
··· 2324 2324 sd_emmc_a: sd@ffe03000 { 2325 2325 compatible = "amlogic,meson-axg-mmc"; 2326 2326 reg = <0x0 0xffe03000 0x0 0x800>; 2327 - interrupts = <GIC_SPI 189 IRQ_TYPE_EDGE_RISING>; 2327 + interrupts = <GIC_SPI 189 IRQ_TYPE_LEVEL_HIGH>; 2328 2328 status = "disabled"; 2329 2329 clocks = <&clkc CLKID_SD_EMMC_A>, 2330 2330 <&clkc CLKID_SD_EMMC_A_CLK0>, ··· 2336 2336 sd_emmc_b: sd@ffe05000 { 2337 2337 compatible = "amlogic,meson-axg-mmc"; 2338 2338 reg = <0x0 0xffe05000 0x0 0x800>; 2339 - interrupts = <GIC_SPI 190 IRQ_TYPE_EDGE_RISING>; 2339 + interrupts = <GIC_SPI 190 IRQ_TYPE_LEVEL_HIGH>; 2340 2340 status = "disabled"; 2341 2341 clocks = <&clkc CLKID_SD_EMMC_B>, 2342 2342 <&clkc CLKID_SD_EMMC_B_CLK0>, ··· 2348 2348 sd_emmc_c: mmc@ffe07000 { 2349 2349 compatible = "amlogic,meson-axg-mmc"; 2350 2350 reg = <0x0 0xffe07000 0x0 0x800>; 2351 - interrupts = <GIC_SPI 191 IRQ_TYPE_EDGE_RISING>; 2351 + interrupts = <GIC_SPI 191 IRQ_TYPE_LEVEL_HIGH>; 2352 2352 status = "disabled"; 2353 2353 clocks = <&clkc CLKID_SD_EMMC_C>, 2354 2354 <&clkc CLKID_SD_EMMC_C_CLK0>,
+3 -3
arch/arm64/boot/dts/amlogic/meson-gx.dtsi
··· 603 603 sd_emmc_a: mmc@70000 { 604 604 compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; 605 605 reg = <0x0 0x70000 0x0 0x800>; 606 - interrupts = <GIC_SPI 216 IRQ_TYPE_EDGE_RISING>; 606 + interrupts = <GIC_SPI 216 IRQ_TYPE_LEVEL_HIGH>; 607 607 status = "disabled"; 608 608 }; 609 609 610 610 sd_emmc_b: mmc@72000 { 611 611 compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; 612 612 reg = <0x0 0x72000 0x0 0x800>; 613 - interrupts = <GIC_SPI 217 IRQ_TYPE_EDGE_RISING>; 613 + interrupts = <GIC_SPI 217 IRQ_TYPE_LEVEL_HIGH>; 614 614 status = "disabled"; 615 615 }; 616 616 617 617 sd_emmc_c: mmc@74000 { 618 618 compatible = "amlogic,meson-gx-mmc", "amlogic,meson-gxbb-mmc"; 619 619 reg = <0x0 0x74000 0x0 0x800>; 620 - interrupts = <GIC_SPI 218 IRQ_TYPE_EDGE_RISING>; 620 + interrupts = <GIC_SPI 218 IRQ_TYPE_LEVEL_HIGH>; 621 621 status = "disabled"; 622 622 }; 623 623 };
+2 -2
arch/arm64/boot/dts/mediatek/mt8195.dtsi
··· 2146 2146 }; 2147 2147 2148 2148 vdosys0: syscon@1c01a000 { 2149 - compatible = "mediatek,mt8195-mmsys", "syscon"; 2149 + compatible = "mediatek,mt8195-vdosys0", "mediatek,mt8195-mmsys", "syscon"; 2150 2150 reg = <0 0x1c01a000 0 0x1000>; 2151 2151 mboxes = <&gce0 0 CMDQ_THR_PRIO_4>; 2152 2152 #clock-cells = <1>; ··· 2292 2292 }; 2293 2293 2294 2294 vdosys1: syscon@1c100000 { 2295 - compatible = "mediatek,mt8195-mmsys", "syscon"; 2295 + compatible = "mediatek,mt8195-vdosys1", "syscon"; 2296 2296 reg = <0 0x1c100000 0 0x1000>; 2297 2297 #clock-cells = <1>; 2298 2298 };
-2
arch/arm64/boot/dts/rockchip/rk3328-roc-cc.dts
··· 96 96 linux,default-trigger = "heartbeat"; 97 97 gpios = <&rk805 1 GPIO_ACTIVE_LOW>; 98 98 default-state = "on"; 99 - mode = <0x23>; 100 99 }; 101 100 102 101 user_led: led-1 { ··· 103 104 linux,default-trigger = "mmc1"; 104 105 gpios = <&rk805 0 GPIO_ACTIVE_LOW>; 105 106 default-state = "off"; 106 - mode = <0x05>; 107 107 }; 108 108 }; 109 109 };
+1 -1
arch/arm64/boot/dts/rockchip/rk3399-op1-opp.dtsi
··· 111 111 }; 112 112 }; 113 113 114 - dmc_opp_table: dmc_opp_table { 114 + dmc_opp_table: opp-table-3 { 115 115 compatible = "operating-points-v2"; 116 116 117 117 opp00 {
+7
arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
··· 104 104 }; 105 105 }; 106 106 107 + &cpu_alert0 { 108 + temperature = <65000>; 109 + }; 110 + &cpu_alert1 { 111 + temperature = <68000>; 112 + }; 113 + 107 114 &cpu_l0 { 108 115 cpu-supply = <&vdd_cpu_l>; 109 116 };
+2 -4
arch/arm64/boot/dts/rockchip/rk3399.dtsi
··· 589 589 clocks = <&cru HCLK_M_CRYPTO0>, <&cru HCLK_S_CRYPTO0>, <&cru SCLK_CRYPTO0>; 590 590 clock-names = "hclk_master", "hclk_slave", "sclk"; 591 591 resets = <&cru SRST_CRYPTO0>, <&cru SRST_CRYPTO0_S>, <&cru SRST_CRYPTO0_M>; 592 - reset-names = "master", "lave", "crypto"; 592 + reset-names = "master", "slave", "crypto-rst"; 593 593 }; 594 594 595 595 crypto1: crypto@ff8b8000 { ··· 599 599 clocks = <&cru HCLK_M_CRYPTO1>, <&cru HCLK_S_CRYPTO1>, <&cru SCLK_CRYPTO1>; 600 600 clock-names = "hclk_master", "hclk_slave", "sclk"; 601 601 resets = <&cru SRST_CRYPTO1>, <&cru SRST_CRYPTO1_S>, <&cru SRST_CRYPTO1_M>; 602 - reset-names = "master", "slave", "crypto"; 602 + reset-names = "master", "slave", "crypto-rst"; 603 603 }; 604 604 605 605 i2c1: i2c@ff110000 { ··· 2241 2241 pcfg_input_pull_up: pcfg-input-pull-up { 2242 2242 input-enable; 2243 2243 bias-pull-up; 2244 - drive-strength = <2>; 2245 2244 }; 2246 2245 2247 2246 pcfg_input_pull_down: pcfg-input-pull-down { 2248 2247 input-enable; 2249 2248 bias-pull-down; 2250 - drive-strength = <2>; 2251 2249 }; 2252 2250 2253 2251 clock {
+11
arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts
··· 353 353 }; 354 354 }; 355 355 356 + &pmu_io_domains { 357 + pmuio2-supply = <&vcc_3v3>; 358 + vccio1-supply = <&vcc_3v3>; 359 + vccio3-supply = <&vcc_3v3>; 360 + vccio4-supply = <&vcca_1v8>; 361 + vccio5-supply = <&vcc_3v3>; 362 + vccio6-supply = <&vcca_1v8>; 363 + vccio7-supply = <&vcc_3v3>; 364 + status = "okay"; 365 + }; 366 + 356 367 &pwm0 { 357 368 status = "okay"; 358 369 };
+3 -2
arch/arm64/boot/dts/rockchip/rk3568-rock-3a.dts
··· 571 571 }; 572 572 573 573 &i2s1_8ch { 574 + pinctrl-names = "default"; 575 + pinctrl-0 = <&i2s1m0_sclktx &i2s1m0_lrcktx &i2s1m0_sdi0 &i2s1m0_sdo0>; 574 576 rockchip,trcm-sync-tx-only; 575 577 status = "okay"; 576 578 }; ··· 732 730 disable-wp; 733 731 pinctrl-names = "default"; 734 732 pinctrl-0 = <&sdmmc0_bus4 &sdmmc0_clk &sdmmc0_cmd &sdmmc0_det>; 735 - sd-uhs-sdr104; 733 + sd-uhs-sdr50; 736 734 vmmc-supply = <&vcc3v3_sd>; 737 735 vqmmc-supply = <&vccio_sd>; 738 736 status = "okay"; 739 737 }; 740 738 741 739 &sdmmc2 { 742 - supports-sdio; 743 740 bus-width = <4>; 744 741 disable-wp; 745 742 cap-sd-highspeed;
+1
arch/arm64/boot/dts/rockchip/rk356x.dtsi
··· 966 966 clock-names = "aclk_mst", "aclk_slv", 967 967 "aclk_dbi", "pclk", "aux"; 968 968 device_type = "pci"; 969 + #interrupt-cells = <1>; 969 970 interrupt-map-mask = <0 0 0 7>; 970 971 interrupt-map = <0 0 0 1 &pcie_intc 0>, 971 972 <0 0 0 2 &pcie_intc 1>,
-1
arch/powerpc/Kconfig
··· 163 163 select ARCH_WANT_IRQS_OFF_ACTIVATE_MM 164 164 select ARCH_WANT_LD_ORPHAN_WARN 165 165 select ARCH_WANTS_MODULES_DATA_IN_VMALLOC if PPC_BOOK3S_32 || PPC_8xx 166 - select ARCH_WANTS_NO_INSTR 167 166 select ARCH_WEAK_RELEASE_ACQUIRE 168 167 select BINFMT_ELF 169 168 select BUILDTIME_TABLE_SORT
+4 -2
arch/powerpc/kernel/interrupt.c
··· 50 50 */ 51 51 static notrace __always_inline bool prep_irq_for_enabled_exit(bool restartable) 52 52 { 53 + bool must_hard_disable = (exit_must_hard_disable() || !restartable); 54 + 53 55 /* This must be done with RI=1 because tracing may touch vmaps */ 54 56 trace_hardirqs_on(); 55 57 56 - if (exit_must_hard_disable() || !restartable) 58 + if (must_hard_disable) 57 59 __hard_EE_RI_disable(); 58 60 59 61 #ifdef CONFIG_PPC64 60 62 /* This pattern matches prep_irq_for_idle */ 61 63 if (unlikely(lazy_irq_pending_nocheck())) { 62 - if (exit_must_hard_disable() || !restartable) { 64 + if (must_hard_disable) { 63 65 local_paca->irq_happened |= PACA_IRQ_HARD_DIS; 64 66 __hard_RI_enable(); 65 67 }
+1
arch/powerpc/kexec/file_load_64.c
··· 26 26 #include <asm/firmware.h> 27 27 #include <asm/kexec_ranges.h> 28 28 #include <asm/crashdump-ppc64.h> 29 + #include <asm/mmzone.h> 29 30 #include <asm/prom.h> 30 31 31 32 struct umem_info {
+4
arch/riscv/include/asm/pgtable.h
··· 721 721 page_table_check_pmd_set(vma->vm_mm, address, pmdp, pmd); 722 722 return __pmd(atomic_long_xchg((atomic_long_t *)pmdp, pmd_val(pmd))); 723 723 } 724 + 725 + #define pmdp_collapse_flush pmdp_collapse_flush 726 + extern pmd_t pmdp_collapse_flush(struct vm_area_struct *vma, 727 + unsigned long address, pmd_t *pmdp); 724 728 #endif /* CONFIG_TRANSPARENT_HUGEPAGE */ 725 729 726 730 /*
+5 -3
arch/riscv/kernel/probes/kprobes.c
··· 65 65 66 66 int __kprobes arch_prepare_kprobe(struct kprobe *p) 67 67 { 68 - unsigned long probe_addr = (unsigned long)p->addr; 68 + u16 *insn = (u16 *)p->addr; 69 69 70 - if (probe_addr & 0x1) 70 + if ((unsigned long)insn & 0x1) 71 71 return -EILSEQ; 72 72 73 73 if (!arch_check_kprobe(p)) 74 74 return -EILSEQ; 75 75 76 76 /* copy instruction */ 77 - p->opcode = *p->addr; 77 + p->opcode = (kprobe_opcode_t)(*insn++); 78 + if (GET_INSN_LENGTH(p->opcode) == 4) 79 + p->opcode |= (kprobe_opcode_t)(*insn) << 16; 78 80 79 81 /* decode instruction */ 80 82 switch (riscv_probe_decode_insn(p->addr, &p->ainsn.api)) {
+2 -1
arch/riscv/kernel/stacktrace.c
··· 32 32 fp = (unsigned long)__builtin_frame_address(0); 33 33 sp = current_stack_pointer; 34 34 pc = (unsigned long)walk_stackframe; 35 + level = -1; 35 36 } else { 36 37 /* task blocked in __switch_to */ 37 38 fp = task->thread.s[0]; ··· 44 43 unsigned long low, high; 45 44 struct stackframe *frame; 46 45 47 - if (unlikely(!__kernel_text_address(pc) || (level++ >= 1 && !fn(arg, pc)))) 46 + if (unlikely(!__kernel_text_address(pc) || (level++ >= 0 && !fn(arg, pc)))) 48 47 break; 49 48 50 49 /* Validate frame pointer */
+3 -1
arch/riscv/mm/cacheflush.c
··· 90 90 if (PageHuge(page)) 91 91 page = compound_head(page); 92 92 93 - if (!test_and_set_bit(PG_dcache_clean, &page->flags)) 93 + if (!test_bit(PG_dcache_clean, &page->flags)) { 94 94 flush_icache_all(); 95 + set_bit(PG_dcache_clean, &page->flags); 96 + } 95 97 } 96 98 #endif /* CONFIG_MMU */ 97 99
+20
arch/riscv/mm/pgtable.c
··· 81 81 } 82 82 83 83 #endif /* CONFIG_HAVE_ARCH_HUGE_VMAP */ 84 + #ifdef CONFIG_TRANSPARENT_HUGEPAGE 85 + pmd_t pmdp_collapse_flush(struct vm_area_struct *vma, 86 + unsigned long address, pmd_t *pmdp) 87 + { 88 + pmd_t pmd = pmdp_huge_get_and_clear(vma->vm_mm, address, pmdp); 89 + 90 + VM_BUG_ON(address & ~HPAGE_PMD_MASK); 91 + VM_BUG_ON(pmd_trans_huge(*pmdp)); 92 + /* 93 + * When leaf PTE entries (regular pages) are collapsed into a leaf 94 + * PMD entry (huge page), a valid non-leaf PTE is converted into a 95 + * valid leaf PTE at the level 1 page table. Since the sfence.vma 96 + * forms that specify an address only apply to leaf PTEs, we need a 97 + * global flush here. collapse_huge_page() assumes these flushes are 98 + * eager, so just do the fence here. 99 + */ 100 + flush_tlb_mm(vma->vm_mm); 101 + return pmd; 102 + } 103 + #endif /* CONFIG_TRANSPARENT_HUGEPAGE */
+2
arch/x86/include/asm/intel-family.h
··· 123 123 #define INTEL_FAM6_METEORLAKE 0xAC 124 124 #define INTEL_FAM6_METEORLAKE_L 0xAA 125 125 126 + #define INTEL_FAM6_LUNARLAKE_M 0xBD 127 + 126 128 /* "Small Core" Processors (Atom/E-Core) */ 127 129 128 130 #define INTEL_FAM6_ATOM_BONNELL 0x1C /* Diamondville, Pineview */
+1 -1
arch/x86/kernel/kprobes/core.c
··· 625 625 /* 1 byte conditional jump */ 626 626 p->ainsn.emulate_op = kprobe_emulate_jcc; 627 627 p->ainsn.jcc.type = opcode & 0xf; 628 - p->ainsn.rel32 = *(char *)insn->immediate.bytes; 628 + p->ainsn.rel32 = insn->immediate.value; 629 629 break; 630 630 case 0x0f: 631 631 opcode = insn->opcode.bytes[1];
+1 -1
drivers/acpi/nfit/core.c
··· 3297 3297 3298 3298 mutex_lock(&acpi_desc->init_mutex); 3299 3299 set_bit(ARS_CANCEL, &acpi_desc->scrub_flags); 3300 - cancel_delayed_work_sync(&acpi_desc->dwork); 3301 3300 mutex_unlock(&acpi_desc->init_mutex); 3301 + cancel_delayed_work_sync(&acpi_desc->dwork); 3302 3302 3303 3303 /* 3304 3304 * Bounce the nvdimm bus lock to make sure any in-flight
+8 -10
drivers/clk/ingenic/jz4760-cgu.c
··· 58 58 unsigned long rate, unsigned long parent_rate, 59 59 unsigned int *pm, unsigned int *pn, unsigned int *pod) 60 60 { 61 - unsigned int m, n, od, m_max = (1 << pll_info->m_bits) - 2; 61 + unsigned int m, n, od, m_max = (1 << pll_info->m_bits) - 1; 62 62 63 63 /* The frequency after the N divider must be between 1 and 50 MHz. */ 64 64 n = parent_rate / (1 * MHZ); ··· 66 66 /* The N divider must be >= 2. */ 67 67 n = clamp_val(n, 2, 1 << pll_info->n_bits); 68 68 69 - for (;; n >>= 1) { 70 - od = (unsigned int)-1; 69 + rate /= MHZ; 70 + parent_rate /= MHZ; 71 71 72 - do { 73 - m = (rate / MHZ) * (1 << ++od) * n / (parent_rate / MHZ); 74 - } while ((m > m_max || m & 1) && (od < 4)); 75 - 76 - if (od < 4 && m >= 4 && m <= m_max) 77 - break; 72 + for (m = m_max; m >= m_max && n >= 2; n--) { 73 + m = rate * n / parent_rate; 74 + od = m & 1; 75 + m <<= od; 78 76 } 79 77 80 78 *pm = m; 81 - *pn = n; 79 + *pn = n + 1; 82 80 *pod = 1 << od; 83 81 } 84 82
+4 -6
drivers/clk/microchip/clk-mpfs-ccc.c
··· 164 164 165 165 for (unsigned int i = 0; i < num_clks; i++) { 166 166 struct mpfs_ccc_out_hw_clock *out_hw = &out_hws[i]; 167 - char *name = devm_kzalloc(dev, 23, GFP_KERNEL); 167 + char *name = devm_kasprintf(dev, GFP_KERNEL, "%s_out%u", parent->name, i); 168 168 169 169 if (!name) 170 170 return -ENOMEM; 171 171 172 - snprintf(name, 23, "%s_out%u", parent->name, i); 173 172 out_hw->divider.hw.init = CLK_HW_INIT_HW(name, &parent->hw, &clk_divider_ops, 0); 174 173 out_hw->divider.reg = data->pll_base[i / MPFS_CCC_OUTPUTS_PER_PLL] + 175 174 out_hw->reg_offset; ··· 200 201 201 202 for (unsigned int i = 0; i < num_clks; i++) { 202 203 struct mpfs_ccc_pll_hw_clock *pll_hw = &pll_hws[i]; 203 - char *name = devm_kzalloc(dev, 18, GFP_KERNEL); 204 204 205 - if (!name) 205 + pll_hw->name = devm_kasprintf(dev, GFP_KERNEL, "ccc%s_pll%u", 206 + strchrnul(dev->of_node->full_name, '@'), i); 207 + if (!pll_hw->name) 206 208 return -ENOMEM; 207 209 208 210 pll_hw->base = data->pll_base[i]; 209 - snprintf(name, 18, "ccc%s_pll%u", strchrnul(dev->of_node->full_name, '@'), i); 210 - pll_hw->name = (const char *)name; 211 211 pll_hw->hw.init = CLK_HW_INIT_PARENTS_DATA_FIXED_SIZE(pll_hw->name, 212 212 pll_hw->parents, 213 213 &mpfs_ccc_pll_ops, 0);
+17 -15
drivers/cpufreq/qcom-cpufreq-hw.c
··· 143 143 return lval * xo_rate; 144 144 } 145 145 146 - /* Get the current frequency of the CPU (after throttling) */ 147 - static unsigned int qcom_cpufreq_hw_get(unsigned int cpu) 148 - { 149 - struct qcom_cpufreq_data *data; 150 - struct cpufreq_policy *policy; 151 - 152 - policy = cpufreq_cpu_get_raw(cpu); 153 - if (!policy) 154 - return 0; 155 - 156 - data = policy->driver_data; 157 - 158 - return qcom_lmh_get_throttle_freq(data) / HZ_PER_KHZ; 159 - } 160 - 161 146 /* Get the frequency requested by the cpufreq core for the CPU */ 162 147 static unsigned int qcom_cpufreq_get_freq(unsigned int cpu) 163 148 { ··· 162 177 index = min(index, LUT_MAX_ENTRIES - 1); 163 178 164 179 return policy->freq_table[index].frequency; 180 + } 181 + 182 + static unsigned int qcom_cpufreq_hw_get(unsigned int cpu) 183 + { 184 + struct qcom_cpufreq_data *data; 185 + struct cpufreq_policy *policy; 186 + 187 + policy = cpufreq_cpu_get_raw(cpu); 188 + if (!policy) 189 + return 0; 190 + 191 + data = policy->driver_data; 192 + 193 + if (data->throttle_irq >= 0) 194 + return qcom_lmh_get_throttle_freq(data) / HZ_PER_KHZ; 195 + 196 + return qcom_cpufreq_get_freq(cpu); 165 197 } 166 198 167 199 static unsigned int qcom_cpufreq_hw_fast_switch(struct cpufreq_policy *policy,
+7 -5
drivers/cxl/core/region.c
··· 131 131 struct cxl_memdev *cxlmd = cxled_to_memdev(cxled); 132 132 struct cxl_port *iter = cxled_to_port(cxled); 133 133 struct cxl_ep *ep; 134 - int rc; 134 + int rc = 0; 135 135 136 136 while (!is_cxl_root(to_cxl_port(iter->dev.parent))) 137 137 iter = to_cxl_port(iter->dev.parent); ··· 143 143 144 144 cxl_rr = cxl_rr_load(iter, cxlr); 145 145 cxld = cxl_rr->decoder; 146 - rc = cxld->reset(cxld); 146 + if (cxld->reset) 147 + rc = cxld->reset(cxld); 147 148 if (rc) 148 149 return rc; 149 150 } ··· 187 186 iter = ep->next, ep = cxl_ep_load(iter, cxlmd)) { 188 187 cxl_rr = cxl_rr_load(iter, cxlr); 189 188 cxld = cxl_rr->decoder; 190 - cxld->reset(cxld); 189 + if (cxld->reset) 190 + cxld->reset(cxld); 191 191 } 192 192 193 193 cxled->cxld.reset(&cxled->cxld); ··· 993 991 int i, distance; 994 992 995 993 /* 996 - * Passthrough ports impose no distance requirements between 994 + * Passthrough decoders impose no distance requirements between 997 995 * peers 998 996 */ 999 - if (port->nr_dports == 1) 997 + if (cxl_rr->nr_targets == 1) 1000 998 distance = 0; 1001 999 else 1002 1000 distance = p->nr_targets / cxl_rr->nr_targets;
+1 -1
drivers/dax/super.c
··· 475 475 /** 476 476 * dax_holder() - obtain the holder of a dax device 477 477 * @dax_dev: a dax_device instance 478 - 478 + * 479 479 * Return: the holder's data which represents the holder if registered, 480 480 * otherwize NULL. 481 481 */
+6 -3
drivers/firmware/efi/libstub/arm64.c
··· 19 19 const u8 *type1_family = efi_get_smbios_string(1, family); 20 20 21 21 /* 22 - * Ampere Altra machines crash in SetTime() if SetVirtualAddressMap() 23 - * has not been called prior. 22 + * Ampere eMAG, Altra, and Altra Max machines crash in SetTime() if 23 + * SetVirtualAddressMap() has not been called prior. 24 24 */ 25 - if (!type1_family || strcmp(type1_family, "Altra")) 25 + if (!type1_family || ( 26 + strcmp(type1_family, "eMAG") && 27 + strcmp(type1_family, "Altra") && 28 + strcmp(type1_family, "Altra Max"))) 26 29 return false; 27 30 28 31 efi_warn("Working around broken SetVirtualAddressMap()\n");
+1
drivers/gpu/drm/amd/amdgpu/amdgpu.h
··· 243 243 244 244 #define AMDGPU_VCNFW_LOG_SIZE (32 * 1024) 245 245 extern int amdgpu_vcnfw_log; 246 + extern int amdgpu_sg_display; 246 247 247 248 #define AMDGPU_VM_MAX_NUM_CTX 4096 248 249 #define AMDGPU_SG_THRESHOLD (256*1024*1024)
+4 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
··· 1220 1220 * next job actually sees the results from the previous one 1221 1221 * before we start executing on the same scheduler ring. 1222 1222 */ 1223 - if (!s_fence || s_fence->sched != sched) 1223 + if (!s_fence || s_fence->sched != sched) { 1224 + dma_fence_put(fence); 1224 1225 continue; 1226 + } 1225 1227 1226 1228 r = amdgpu_sync_fence(&p->gang_leader->explicit_sync, fence); 1229 + dma_fence_put(fence); 1227 1230 if (r) 1228 1231 return r; 1229 1232 }
+11
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 186 186 int amdgpu_smartshift_bias; 187 187 int amdgpu_use_xgmi_p2p = 1; 188 188 int amdgpu_vcnfw_log; 189 + int amdgpu_sg_display = -1; /* auto */ 189 190 190 191 static void amdgpu_drv_delayed_reset_work_handler(struct work_struct *work); 191 192 ··· 931 930 */ 932 931 MODULE_PARM_DESC(vcnfw_log, "Enable vcnfw log(0 = disable (default value), 1 = enable)"); 933 932 module_param_named(vcnfw_log, amdgpu_vcnfw_log, int, 0444); 933 + 934 + /** 935 + * DOC: sg_display (int) 936 + * Disable S/G (scatter/gather) display (i.e., display from system memory). 937 + * This option is only relevant on APUs. Set this option to 0 to disable 938 + * S/G display if you experience flickering or other issues under memory 939 + * pressure and report the issue. 940 + */ 941 + MODULE_PARM_DESC(sg_display, "S/G Display (-1 = auto (default), 0 = disable)"); 942 + module_param_named(sg_display, amdgpu_sg_display, int, 0444); 934 943 935 944 /** 936 945 * DOC: smu_pptable_id (int)
+7 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c
··· 618 618 if (!ring || !ring->fence_drv.initialized) 619 619 continue; 620 620 621 - if (!ring->no_scheduler) 621 + /* 622 + * Notice we check for sched.ops since there's some 623 + * override on the meaning of sched.ready by amdgpu. 624 + * The natural check would be sched.ready, which is 625 + * set as drm_sched_init() finishes... 626 + */ 627 + if (ring->sched.ops) 622 628 drm_sched_fini(&ring->sched); 623 629 624 630 for (j = 0; j <= ring->fence_drv.num_fences_mask; ++j)
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
··· 295 295 #define amdgpu_ring_parse_cs(r, p, job, ib) ((r)->funcs->parse_cs((p), (job), (ib))) 296 296 #define amdgpu_ring_patch_cs_in_place(r, p, job, ib) ((r)->funcs->patch_cs_in_place((p), (job), (ib))) 297 297 #define amdgpu_ring_test_ring(r) (r)->funcs->test_ring((r)) 298 - #define amdgpu_ring_test_ib(r, t) (r)->funcs->test_ib((r), (t)) 298 + #define amdgpu_ring_test_ib(r, t) ((r)->funcs->test_ib ? (r)->funcs->test_ib((r), (t)) : 0) 299 299 #define amdgpu_ring_get_rptr(r) (r)->funcs->get_rptr((r)) 300 300 #define amdgpu_ring_get_wptr(r) (r)->funcs->get_wptr((r)) 301 301 #define amdgpu_ring_set_wptr(r) (r)->funcs->set_wptr((r))
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c
··· 974 974 trace_amdgpu_vm_update_ptes(params, frag_start, upd_end, 975 975 min(nptes, 32u), dst, incr, 976 976 upd_flags, 977 - vm->task_info.pid, 977 + vm->task_info.tgid, 978 978 vm->immediate.fence_context); 979 979 amdgpu_vm_pte_update_flags(params, to_amdgpu_bo_vm(pt), 980 980 cursor.level, pe_start, dst,
-1
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
··· 6877 6877 .emit_gds_switch = gfx_v9_0_ring_emit_gds_switch, 6878 6878 .emit_hdp_flush = gfx_v9_0_ring_emit_hdp_flush, 6879 6879 .test_ring = gfx_v9_0_ring_test_ring, 6880 - .test_ib = gfx_v9_0_ring_test_ib, 6881 6880 .insert_nop = amdgpu_ring_insert_nop, 6882 6881 .pad_ib = amdgpu_ring_generic_pad_ib, 6883 6882 .emit_switch_buffer = gfx_v9_ring_emit_sb,
+3 -1
drivers/gpu/drm/amd/amdgpu/soc21.c
··· 641 641 AMD_CG_SUPPORT_GFX_CGLS | 642 642 AMD_CG_SUPPORT_REPEATER_FGCG | 643 643 AMD_CG_SUPPORT_GFX_MGCG | 644 - AMD_CG_SUPPORT_HDP_SD; 644 + AMD_CG_SUPPORT_HDP_SD | 645 + AMD_CG_SUPPORT_ATHUB_MGCG | 646 + AMD_CG_SUPPORT_ATHUB_LS; 645 647 adev->pg_flags = AMD_PG_SUPPORT_VCN | 646 648 AMD_PG_SUPPORT_VCN_DPG | 647 649 AMD_PG_SUPPORT_JPEG;
+33 -14
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 1184 1184 1185 1185 memset(pa_config, 0, sizeof(*pa_config)); 1186 1186 1187 - logical_addr_low = min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18; 1188 - pt_base = amdgpu_gmc_pd_addr(adev->gart.bo); 1189 - 1190 - if (adev->apu_flags & AMD_APU_IS_RAVEN2) 1191 - /* 1192 - * Raven2 has a HW issue that it is unable to use the vram which 1193 - * is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the 1194 - * workaround that increase system aperture high address (add 1) 1195 - * to get rid of the VM fault and hardware hang. 1196 - */ 1197 - logical_addr_high = max((adev->gmc.fb_end >> 18) + 0x1, adev->gmc.agp_end >> 18); 1198 - else 1199 - logical_addr_high = max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18; 1200 - 1201 1187 agp_base = 0; 1202 1188 agp_bot = adev->gmc.agp_start >> 24; 1203 1189 agp_top = adev->gmc.agp_end >> 24; 1204 1190 1191 + /* AGP aperture is disabled */ 1192 + if (agp_bot == agp_top) { 1193 + logical_addr_low = adev->gmc.vram_start >> 18; 1194 + if (adev->apu_flags & AMD_APU_IS_RAVEN2) 1195 + /* 1196 + * Raven2 has a HW issue that it is unable to use the vram which 1197 + * is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the 1198 + * workaround that increase system aperture high address (add 1) 1199 + * to get rid of the VM fault and hardware hang. 1200 + */ 1201 + logical_addr_high = (adev->gmc.fb_end >> 18) + 0x1; 1202 + else 1203 + logical_addr_high = adev->gmc.vram_end >> 18; 1204 + } else { 1205 + logical_addr_low = min(adev->gmc.fb_start, adev->gmc.agp_start) >> 18; 1206 + if (adev->apu_flags & AMD_APU_IS_RAVEN2) 1207 + /* 1208 + * Raven2 has a HW issue that it is unable to use the vram which 1209 + * is out of MC_VM_SYSTEM_APERTURE_HIGH_ADDR. So here is the 1210 + * workaround that increase system aperture high address (add 1) 1211 + * to get rid of the VM fault and hardware hang. 1212 + */ 1213 + logical_addr_high = max((adev->gmc.fb_end >> 18) + 0x1, adev->gmc.agp_end >> 18); 1214 + else 1215 + logical_addr_high = max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18; 1216 + } 1217 + 1218 + pt_base = amdgpu_gmc_pd_addr(adev->gart.bo); 1205 1219 1206 1220 page_table_start.high_part = (u32)(adev->gmc.gart_start >> 44) & 0xF; 1207 1221 page_table_start.low_part = (u32)(adev->gmc.gart_start >> 12); ··· 1517 1503 case IP_VERSION(3, 0, 1): 1518 1504 case IP_VERSION(3, 1, 2): 1519 1505 case IP_VERSION(3, 1, 3): 1506 + case IP_VERSION(3, 1, 4): 1507 + case IP_VERSION(3, 1, 5): 1520 1508 case IP_VERSION(3, 1, 6): 1521 1509 init_data.flags.gpu_vm_support = true; 1522 1510 break; ··· 1527 1511 } 1528 1512 break; 1529 1513 } 1514 + if (init_data.flags.gpu_vm_support && 1515 + (amdgpu_sg_display == 0)) 1516 + init_data.flags.gpu_vm_support = false; 1530 1517 1531 1518 if (init_data.flags.gpu_vm_support) 1532 1519 adev->mode_info.gpu_vm_support = true;
+1 -1
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
··· 3626 3626 (int)hubp->curs_attr.width || pos_cpy.x 3627 3627 <= (int)hubp->curs_attr.width + 3628 3628 pipe_ctx->plane_state->src_rect.x) { 3629 - pos_cpy.x = temp_x + viewport_width; 3629 + pos_cpy.x = 2 * viewport_width - temp_x; 3630 3630 } 3631 3631 } 3632 3632 } else {
+2
drivers/gpu/drm/amd/pm/amdgpu_pm.c
··· 1991 1991 case IP_VERSION(9, 4, 2): 1992 1992 case IP_VERSION(10, 3, 0): 1993 1993 case IP_VERSION(11, 0, 0): 1994 + case IP_VERSION(11, 0, 1): 1995 + case IP_VERSION(11, 0, 2): 1994 1996 *states = ATTR_STATE_SUPPORTED; 1995 1997 break; 1996 1998 default:
+3 -2
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_0.h
··· 123 123 (1 << FEATURE_DS_FCLK_BIT) | \ 124 124 (1 << FEATURE_DS_LCLK_BIT) | \ 125 125 (1 << FEATURE_DS_DCFCLK_BIT) | \ 126 - (1 << FEATURE_DS_UCLK_BIT)) 126 + (1 << FEATURE_DS_UCLK_BIT) | \ 127 + (1ULL << FEATURE_DS_VCN_BIT)) 127 128 128 129 //For use with feature control messages 129 130 typedef enum { ··· 523 522 TEMP_HOTSPOT_M, 524 523 TEMP_MEM, 525 524 TEMP_VR_GFX, 526 - TEMP_VR_SOC, 527 525 TEMP_VR_MEM0, 528 526 TEMP_VR_MEM1, 527 + TEMP_VR_SOC, 529 528 TEMP_VR_U, 530 529 TEMP_LIQUID0, 531 530 TEMP_LIQUID1,
+15 -14
drivers/gpu/drm/amd/pm/swsmu/inc/pmfw_if/smu13_driver_if_v13_0_7.h
··· 113 113 #define NUM_FEATURES 64 114 114 115 115 #define ALLOWED_FEATURE_CTRL_DEFAULT 0xFFFFFFFFFFFFFFFFULL 116 - #define ALLOWED_FEATURE_CTRL_SCPM (1 << FEATURE_DPM_GFXCLK_BIT) | \ 117 - (1 << FEATURE_DPM_GFX_POWER_OPTIMIZER_BIT) | \ 118 - (1 << FEATURE_DPM_UCLK_BIT) | \ 119 - (1 << FEATURE_DPM_FCLK_BIT) | \ 120 - (1 << FEATURE_DPM_SOCCLK_BIT) | \ 121 - (1 << FEATURE_DPM_MP0CLK_BIT) | \ 122 - (1 << FEATURE_DPM_LINK_BIT) | \ 123 - (1 << FEATURE_DPM_DCN_BIT) | \ 124 - (1 << FEATURE_DS_GFXCLK_BIT) | \ 125 - (1 << FEATURE_DS_SOCCLK_BIT) | \ 126 - (1 << FEATURE_DS_FCLK_BIT) | \ 127 - (1 << FEATURE_DS_LCLK_BIT) | \ 128 - (1 << FEATURE_DS_DCFCLK_BIT) | \ 129 - (1 << FEATURE_DS_UCLK_BIT) 116 + #define ALLOWED_FEATURE_CTRL_SCPM ((1 << FEATURE_DPM_GFXCLK_BIT) | \ 117 + (1 << FEATURE_DPM_GFX_POWER_OPTIMIZER_BIT) | \ 118 + (1 << FEATURE_DPM_UCLK_BIT) | \ 119 + (1 << FEATURE_DPM_FCLK_BIT) | \ 120 + (1 << FEATURE_DPM_SOCCLK_BIT) | \ 121 + (1 << FEATURE_DPM_MP0CLK_BIT) | \ 122 + (1 << FEATURE_DPM_LINK_BIT) | \ 123 + (1 << FEATURE_DPM_DCN_BIT) | \ 124 + (1 << FEATURE_DS_GFXCLK_BIT) | \ 125 + (1 << FEATURE_DS_SOCCLK_BIT) | \ 126 + (1 << FEATURE_DS_FCLK_BIT) | \ 127 + (1 << FEATURE_DS_LCLK_BIT) | \ 128 + (1 << FEATURE_DS_DCFCLK_BIT) | \ 129 + (1 << FEATURE_DS_UCLK_BIT) | \ 130 + (1ULL << FEATURE_DS_VCN_BIT)) 130 131 131 132 //For use with feature control messages 132 133 typedef enum {
+2 -2
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h
··· 28 28 #define SMU13_DRIVER_IF_VERSION_INV 0xFFFFFFFF 29 29 #define SMU13_DRIVER_IF_VERSION_YELLOW_CARP 0x04 30 30 #define SMU13_DRIVER_IF_VERSION_ALDE 0x08 31 - #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0_0 0x34 31 + #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0_0 0x37 32 32 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_4 0x07 33 33 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_5 0x04 34 34 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_0_10 0x32 35 - #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_7 0x35 35 + #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_7 0x37 36 36 #define SMU13_DRIVER_IF_VERSION_SMU_V13_0_10 0x1D 37 37 38 38 #define SMU13_MODE1_RESET_WAIT_TIME_IN_MS 500 //500ms
+6
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
··· 407 407 struct amdgpu_device *adev = smu->adev; 408 408 int ret = 0; 409 409 410 + if (amdgpu_sriov_vf(smu->adev)) 411 + return 0; 412 + 410 413 ret = smu_v13_0_0_get_pptable_from_pmfw(smu, 411 414 &smu_table->power_play_table, 412 415 &smu_table->power_play_table_size); ··· 1259 1256 struct smu_13_0_0_powerplay_table *powerplay_table = 1260 1257 table_context->power_play_table; 1261 1258 PPTable_t *pptable = smu->smu_table.driver_pptable; 1259 + 1260 + if (amdgpu_sriov_vf(smu->adev)) 1261 + return 0; 1262 1262 1263 1263 if (!range) 1264 1264 return -EINVAL;
+1
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c
··· 124 124 MSG_MAP(DFCstateControl, PPSMC_MSG_SetExternalClientDfCstateAllow, 0), 125 125 MSG_MAP(ArmD3, PPSMC_MSG_ArmD3, 0), 126 126 MSG_MAP(AllowGpo, PPSMC_MSG_SetGpoAllow, 0), 127 + MSG_MAP(GetPptLimit, PPSMC_MSG_GetPptLimit, 0), 127 128 }; 128 129 129 130 static struct cmn2asic_mapping smu_v13_0_7_clk_map[SMU_CLK_COUNT] = {
+20 -13
drivers/gpu/drm/drm_client.c
··· 233 233 234 234 static void drm_client_buffer_delete(struct drm_client_buffer *buffer) 235 235 { 236 - struct drm_device *dev = buffer->client->dev; 237 - 238 236 if (buffer->gem) { 239 237 drm_gem_vunmap_unlocked(buffer->gem, &buffer->map); 240 238 drm_gem_object_put(buffer->gem); 241 239 } 242 240 243 - if (buffer->handle) 244 - drm_mode_destroy_dumb(dev, buffer->handle, buffer->client->file); 245 - 246 241 kfree(buffer); 247 242 } 248 243 249 244 static struct drm_client_buffer * 250 - drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, u32 format) 245 + drm_client_buffer_create(struct drm_client_dev *client, u32 width, u32 height, 246 + u32 format, u32 *handle) 251 247 { 252 248 const struct drm_format_info *info = drm_format_info(format); 253 249 struct drm_mode_create_dumb dumb_args = { }; ··· 265 269 if (ret) 266 270 goto err_delete; 267 271 268 - buffer->handle = dumb_args.handle; 269 - buffer->pitch = dumb_args.pitch; 270 - 271 272 obj = drm_gem_object_lookup(client->file, dumb_args.handle); 272 273 if (!obj) { 273 274 ret = -ENOENT; 274 275 goto err_delete; 275 276 } 276 277 278 + buffer->pitch = dumb_args.pitch; 277 279 buffer->gem = obj; 280 + *handle = dumb_args.handle; 278 281 279 282 return buffer; 280 283 ··· 360 365 } 361 366 362 367 static int drm_client_buffer_addfb(struct drm_client_buffer *buffer, 363 - u32 width, u32 height, u32 format) 368 + u32 width, u32 height, u32 format, 369 + u32 handle) 364 370 { 365 371 struct drm_client_dev *client = buffer->client; 366 372 struct drm_mode_fb_cmd fb_req = { }; ··· 373 377 fb_req.depth = info->depth; 374 378 fb_req.width = width; 375 379 fb_req.height = height; 376 - fb_req.handle = buffer->handle; 380 + fb_req.handle = handle; 377 381 fb_req.pitch = buffer->pitch; 378 382 379 383 ret = drm_mode_addfb(client->dev, &fb_req, client->file); ··· 410 414 drm_client_framebuffer_create(struct drm_client_dev *client, u32 width, u32 height, u32 format) 411 415 { 412 416 struct drm_client_buffer *buffer; 417 + u32 handle; 413 418 int ret; 414 419 415 - buffer = drm_client_buffer_create(client, width, height, format); 420 + buffer = drm_client_buffer_create(client, width, height, format, 421 + &handle); 416 422 if (IS_ERR(buffer)) 417 423 return buffer; 418 424 419 - ret = drm_client_buffer_addfb(buffer, width, height, format); 425 + ret = drm_client_buffer_addfb(buffer, width, height, format, handle); 426 + 427 + /* 428 + * The handle is only needed for creating the framebuffer, destroy it 429 + * again to solve a circular dependency should anybody export the GEM 430 + * object as DMA-buf. The framebuffer and our buffer structure are still 431 + * holding references to the GEM object to prevent its destruction. 432 + */ 433 + drm_mode_destroy_dumb(client->dev, handle, client->file); 434 + 420 435 if (ret) { 421 436 drm_client_buffer_delete(buffer); 422 437 return ERR_PTR(ret);
+23 -10
drivers/gpu/drm/i915/display/intel_bios.c
··· 2466 2466 dvo_port); 2467 2467 } 2468 2468 2469 + static enum port 2470 + dsi_dvo_port_to_port(struct drm_i915_private *i915, u8 dvo_port) 2471 + { 2472 + switch (dvo_port) { 2473 + case DVO_PORT_MIPIA: 2474 + return PORT_A; 2475 + case DVO_PORT_MIPIC: 2476 + if (DISPLAY_VER(i915) >= 11) 2477 + return PORT_B; 2478 + else 2479 + return PORT_C; 2480 + default: 2481 + return PORT_NONE; 2482 + } 2483 + } 2484 + 2469 2485 static int parse_bdb_230_dp_max_link_rate(const int vbt_max_link_rate) 2470 2486 { 2471 2487 switch (vbt_max_link_rate) { ··· 3430 3414 3431 3415 dvo_port = child->dvo_port; 3432 3416 3433 - if (dvo_port == DVO_PORT_MIPIA || 3434 - (dvo_port == DVO_PORT_MIPIB && DISPLAY_VER(i915) >= 11) || 3435 - (dvo_port == DVO_PORT_MIPIC && DISPLAY_VER(i915) < 11)) { 3436 - if (port) 3437 - *port = dvo_port - DVO_PORT_MIPIA; 3438 - return true; 3439 - } else if (dvo_port == DVO_PORT_MIPIB || 3440 - dvo_port == DVO_PORT_MIPIC || 3441 - dvo_port == DVO_PORT_MIPID) { 3417 + if (dsi_dvo_port_to_port(i915, dvo_port) == PORT_NONE) { 3442 3418 drm_dbg_kms(&i915->drm, 3443 3419 "VBT has unsupported DSI port %c\n", 3444 3420 port_name(dvo_port - DVO_PORT_MIPIA)); 3421 + continue; 3445 3422 } 3423 + 3424 + if (port) 3425 + *port = dsi_dvo_port_to_port(i915, dvo_port); 3426 + return true; 3446 3427 } 3447 3428 3448 3429 return false; ··· 3524 3511 if (!(child->device_type & DEVICE_TYPE_MIPI_OUTPUT)) 3525 3512 continue; 3526 3513 3527 - if (child->dvo_port - DVO_PORT_MIPIA == encoder->port) { 3514 + if (dsi_dvo_port_to_port(i915, child->dvo_port) == encoder->port) { 3528 3515 if (!devdata->dsc) 3529 3516 return false; 3530 3517
+12
drivers/gpu/drm/i915/display/intel_fbdev.c
··· 328 328 return ret; 329 329 } 330 330 331 + static int intelfb_dirty(struct drm_fb_helper *helper, struct drm_clip_rect *clip) 332 + { 333 + if (!(clip->x1 < clip->x2 && clip->y1 < clip->y2)) 334 + return 0; 335 + 336 + if (helper->fb->funcs->dirty) 337 + return helper->fb->funcs->dirty(helper->fb, NULL, 0, 0, clip, 1); 338 + 339 + return 0; 340 + } 341 + 331 342 static const struct drm_fb_helper_funcs intel_fb_helper_funcs = { 332 343 .fb_probe = intelfb_create, 344 + .fb_dirty = intelfb_dirty, 333 345 }; 334 346 335 347 static void intel_fbdev_destroy(struct intel_fbdev *ifbdev)
+2 -1
drivers/gpu/drm/i915/display/skl_watermark.c
··· 1587 1587 skl_check_wm_level(&wm->wm[level], ddb); 1588 1588 1589 1589 if (icl_need_wm1_wa(i915, plane_id) && 1590 - level == 1 && wm->wm[0].enable) { 1590 + level == 1 && !wm->wm[level].enable && 1591 + wm->wm[0].enable) { 1591 1592 wm->wm[level].blocks = wm->wm[0].blocks; 1592 1593 wm->wm[level].lines = wm->wm[0].lines; 1593 1594 wm->wm[level].ignore_lines = wm->wm[0].ignore_lines;
+7 -7
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
··· 3483 3483 eb.composite_fence : 3484 3484 &eb.requests[0]->fence); 3485 3485 3486 + if (unlikely(eb.gem_context->syncobj)) { 3487 + drm_syncobj_replace_fence(eb.gem_context->syncobj, 3488 + eb.composite_fence ? 3489 + eb.composite_fence : 3490 + &eb.requests[0]->fence); 3491 + } 3492 + 3486 3493 if (out_fence) { 3487 3494 if (err == 0) { 3488 3495 fd_install(out_fence_fd, out_fence->file); ··· 3499 3492 } else { 3500 3493 fput(out_fence->file); 3501 3494 } 3502 - } 3503 - 3504 - if (unlikely(eb.gem_context->syncobj)) { 3505 - drm_syncobj_replace_fence(eb.gem_context->syncobj, 3506 - eb.composite_fence ? 3507 - eb.composite_fence : 3508 - &eb.requests[0]->fence); 3509 3495 } 3510 3496 3511 3497 if (!out_fence && eb.composite_fence)
+1 -1
drivers/gpu/drm/i915/gem/i915_gem_shmem.c
··· 579 579 mapping_set_gfp_mask(mapping, mask); 580 580 GEM_BUG_ON(!(mapping_gfp_mask(mapping) & __GFP_RECLAIM)); 581 581 582 - i915_gem_object_init(obj, &i915_gem_shmem_ops, &lock_class, 0); 582 + i915_gem_object_init(obj, &i915_gem_shmem_ops, &lock_class, flags); 583 583 obj->mem_flags |= I915_BO_FLAG_STRUCT_PAGE; 584 584 obj->write_domain = I915_GEM_DOMAIN_CPU; 585 585 obj->read_domains = I915_GEM_DOMAIN_CPU;
+1 -4
drivers/gpu/drm/virtio/virtgpu_ioctl.c
··· 126 126 void __user *user_bo_handles = NULL; 127 127 struct virtio_gpu_object_array *buflist = NULL; 128 128 struct sync_file *sync_file; 129 - int in_fence_fd = exbuf->fence_fd; 130 129 int out_fence_fd = -1; 131 130 void *buf; 132 131 uint64_t fence_ctx; ··· 151 152 ring_idx = exbuf->ring_idx; 152 153 } 153 154 154 - exbuf->fence_fd = -1; 155 - 156 155 virtio_gpu_create_context(dev, file); 157 156 if (exbuf->flags & VIRTGPU_EXECBUF_FENCE_FD_IN) { 158 157 struct dma_fence *in_fence; 159 158 160 - in_fence = sync_file_get_fence(in_fence_fd); 159 + in_fence = sync_file_get_fence(exbuf->fence_fd); 161 160 162 161 if (!in_fence) 163 162 return -EINVAL;
+11 -2
drivers/hid/amd-sfh-hid/amd_sfh_client.c
··· 227 227 cl_data->num_hid_devices = amd_mp2_get_sensor_num(privdata, &cl_data->sensor_idx[0]); 228 228 if (cl_data->num_hid_devices == 0) 229 229 return -ENODEV; 230 + cl_data->is_any_sensor_enabled = false; 230 231 231 232 INIT_DELAYED_WORK(&cl_data->work, amd_sfh_work); 232 233 INIT_DELAYED_WORK(&cl_data->work_buffer, amd_sfh_work_buffer); ··· 288 287 status = amd_sfh_wait_for_response 289 288 (privdata, cl_data->sensor_idx[i], SENSOR_ENABLED); 290 289 if (status == SENSOR_ENABLED) { 290 + cl_data->is_any_sensor_enabled = true; 291 291 cl_data->sensor_sts[i] = SENSOR_ENABLED; 292 292 rc = amdtp_hid_probe(cl_data->cur_hid_dev, cl_data); 293 293 if (rc) { ··· 303 301 cl_data->sensor_sts[i]); 304 302 goto cleanup; 305 303 } 304 + } else { 305 + cl_data->sensor_sts[i] = SENSOR_DISABLED; 306 + dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n", 307 + cl_data->sensor_idx[i], 308 + get_sensor_name(cl_data->sensor_idx[i]), 309 + cl_data->sensor_sts[i]); 306 310 } 307 311 dev_dbg(dev, "sid 0x%x (%s) status 0x%x\n", 308 312 cl_data->sensor_idx[i], get_sensor_name(cl_data->sensor_idx[i]), 309 313 cl_data->sensor_sts[i]); 310 314 } 311 - if (mp2_ops->discovery_status && mp2_ops->discovery_status(privdata) == 0) { 315 + if (!cl_data->is_any_sensor_enabled || 316 + (mp2_ops->discovery_status && mp2_ops->discovery_status(privdata) == 0)) { 312 317 amd_sfh_hid_client_deinit(privdata); 313 318 for (i = 0; i < cl_data->num_hid_devices; i++) { 314 319 devm_kfree(dev, cl_data->feature_report[i]); 315 320 devm_kfree(dev, in_data->input_report[i]); 316 321 devm_kfree(dev, cl_data->report_descr[i]); 317 322 } 318 - dev_warn(dev, "Failed to discover, sensors not enabled\n"); 323 + dev_warn(dev, "Failed to discover, sensors not enabled is %d\n", cl_data->is_any_sensor_enabled); 319 324 return -EOPNOTSUPP; 320 325 } 321 326 schedule_delayed_work(&cl_data->work_buffer, msecs_to_jiffies(AMD_SFH_IDLE_LOOP));
+1
drivers/hid/amd-sfh-hid/amd_sfh_hid.h
··· 32 32 struct amdtp_cl_data { 33 33 u8 init_done; 34 34 u32 cur_hid_dev; 35 + bool is_any_sensor_enabled; 35 36 u32 hid_dev_count; 36 37 u32 num_hid_devices; 37 38 struct device_info *hid_devices;
+3
drivers/hid/hid-core.c
··· 1202 1202 __u8 *end; 1203 1203 __u8 *next; 1204 1204 int ret; 1205 + int i; 1205 1206 static int (*dispatch_type[])(struct hid_parser *parser, 1206 1207 struct hid_item *item) = { 1207 1208 hid_parser_main, ··· 1253 1252 goto err; 1254 1253 } 1255 1254 device->collection_size = HID_DEFAULT_NUM_COLLECTIONS; 1255 + for (i = 0; i < HID_DEFAULT_NUM_COLLECTIONS; i++) 1256 + device->collection[i].parent_idx = -1; 1256 1257 1257 1258 ret = -EINVAL; 1258 1259 while ((next = fetch_item(start, end, &item)) != NULL) {
+14 -2
drivers/hid/hid-elecom.c
··· 12 12 * Copyright (c) 2017 Alex Manoussakis <amanou@gnu.org> 13 13 * Copyright (c) 2017 Tomasz Kramkowski <tk@the-tk.com> 14 14 * Copyright (c) 2020 YOSHIOKA Takuma <lo48576@hard-wi.red> 15 + * Copyright (c) 2022 Takahiro Fujii <fujii@xaxxi.net> 15 16 */ 16 17 17 18 /* ··· 90 89 case USB_DEVICE_ID_ELECOM_M_DT1URBK: 91 90 case USB_DEVICE_ID_ELECOM_M_DT1DRBK: 92 91 case USB_DEVICE_ID_ELECOM_M_HT1URBK: 93 - case USB_DEVICE_ID_ELECOM_M_HT1DRBK: 92 + case USB_DEVICE_ID_ELECOM_M_HT1DRBK_010D: 94 93 /* 95 94 * Report descriptor format: 96 95 * 12: button bit count ··· 99 98 * 20: button usage maximum 100 99 */ 101 100 mouse_button_fixup(hdev, rdesc, *rsize, 12, 30, 14, 20, 8); 101 + break; 102 + case USB_DEVICE_ID_ELECOM_M_HT1DRBK_011C: 103 + /* 104 + * Report descriptor format: 105 + * 22: button bit count 106 + * 30: padding bit count 107 + * 24: button report size 108 + * 16: button usage maximum 109 + */ 110 + mouse_button_fixup(hdev, rdesc, *rsize, 22, 30, 24, 16, 8); 102 111 break; 103 112 } 104 113 return rdesc; ··· 123 112 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) }, 124 113 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) }, 125 114 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK) }, 126 - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK) }, 115 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK_010D) }, 116 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK_011C) }, 127 117 { } 128 118 }; 129 119 MODULE_DEVICE_TABLE(hid, elecom_devices);
+4 -1
drivers/hid/hid-ids.h
··· 413 413 #define I2C_DEVICE_ID_HP_ENVY_X360_15T_DR100 0x29CF 414 414 #define I2C_DEVICE_ID_HP_ENVY_X360_EU0009NV 0x2CF9 415 415 #define I2C_DEVICE_ID_HP_SPECTRE_X360_15 0x2817 416 + #define I2C_DEVICE_ID_HP_SPECTRE_X360_13_AW0020NG 0x29DF 417 + #define I2C_DEVICE_ID_ASUS_TP420IA_TOUCHSCREEN 0x2BC8 416 418 #define USB_DEVICE_ID_ASUS_UX550VE_TOUCHSCREEN 0x2544 417 419 #define USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN 0x2706 418 420 #define I2C_DEVICE_ID_SURFACE_GO_TOUCHSCREEN 0x261A ··· 430 428 #define USB_DEVICE_ID_ELECOM_M_DT1URBK 0x00fe 431 429 #define USB_DEVICE_ID_ELECOM_M_DT1DRBK 0x00ff 432 430 #define USB_DEVICE_ID_ELECOM_M_HT1URBK 0x010c 433 - #define USB_DEVICE_ID_ELECOM_M_HT1DRBK 0x010d 431 + #define USB_DEVICE_ID_ELECOM_M_HT1DRBK_010D 0x010d 432 + #define USB_DEVICE_ID_ELECOM_M_HT1DRBK_011C 0x011c 434 433 435 434 #define USB_VENDOR_ID_DREAM_CHEEKY 0x1d34 436 435 #define USB_DEVICE_ID_DREAM_CHEEKY_WN 0x0004
+4
drivers/hid/hid-input.c
··· 370 370 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 371 371 USB_DEVICE_ID_LOGITECH_DINOVO_EDGE_KBD), 372 372 HID_BATTERY_QUIRK_IGNORE }, 373 + { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_ASUS_TP420IA_TOUCHSCREEN), 374 + HID_BATTERY_QUIRK_IGNORE }, 373 375 { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550_TOUCHSCREEN), 374 376 HID_BATTERY_QUIRK_IGNORE }, 375 377 { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, USB_DEVICE_ID_ASUS_UX550VE_TOUCHSCREEN), ··· 385 383 { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_ENVY_X360_EU0009NV), 386 384 HID_BATTERY_QUIRK_IGNORE }, 387 385 { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_SPECTRE_X360_15), 386 + HID_BATTERY_QUIRK_IGNORE }, 387 + { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_HP_SPECTRE_X360_13_AW0020NG), 388 388 HID_BATTERY_QUIRK_IGNORE }, 389 389 { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_SURFACE_GO_TOUCHSCREEN), 390 390 HID_BATTERY_QUIRK_IGNORE },
+2 -1
drivers/hid/hid-logitech-hidpp.c
··· 3978 3978 } 3979 3979 3980 3980 hidpp_initialize_battery(hidpp); 3981 - hidpp_initialize_hires_scroll(hidpp); 3981 + if (!hid_is_usb(hidpp->hid_dev)) 3982 + hidpp_initialize_hires_scroll(hidpp); 3982 3983 3983 3984 /* forward current battery state */ 3984 3985 if (hidpp->capabilities & HIDPP_CAPABILITY_HIDPP10_BATTERY) {
+2 -1
drivers/hid/hid-quirks.c
··· 393 393 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) }, 394 394 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) }, 395 395 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK) }, 396 - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK) }, 396 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK_010D) }, 397 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK_011C) }, 397 398 #endif 398 399 #if IS_ENABLED(CONFIG_HID_ELO) 399 400 { HID_USB_DEVICE(USB_VENDOR_ID_ELO, 0x0009) },
+4 -4
drivers/infiniband/core/umem_dmabuf.c
··· 26 26 if (umem_dmabuf->sgt) 27 27 goto wait_fence; 28 28 29 - sgt = dma_buf_map_attachment_unlocked(umem_dmabuf->attach, 30 - DMA_BIDIRECTIONAL); 29 + sgt = dma_buf_map_attachment(umem_dmabuf->attach, 30 + DMA_BIDIRECTIONAL); 31 31 if (IS_ERR(sgt)) 32 32 return PTR_ERR(sgt); 33 33 ··· 103 103 umem_dmabuf->last_sg_trim = 0; 104 104 } 105 105 106 - dma_buf_unmap_attachment_unlocked(umem_dmabuf->attach, umem_dmabuf->sgt, 107 - DMA_BIDIRECTIONAL); 106 + dma_buf_unmap_attachment(umem_dmabuf->attach, umem_dmabuf->sgt, 107 + DMA_BIDIRECTIONAL); 108 108 109 109 umem_dmabuf->sgt = NULL; 110 110 }
+5 -2
drivers/infiniband/hw/hfi1/file_ops.c
··· 1318 1318 addr = arg + offsetof(struct hfi1_tid_info, tidcnt); 1319 1319 if (copy_to_user((void __user *)addr, &tinfo.tidcnt, 1320 1320 sizeof(tinfo.tidcnt))) 1321 - return -EFAULT; 1321 + ret = -EFAULT; 1322 1322 1323 1323 addr = arg + offsetof(struct hfi1_tid_info, length); 1324 - if (copy_to_user((void __user *)addr, &tinfo.length, 1324 + if (!ret && copy_to_user((void __user *)addr, &tinfo.length, 1325 1325 sizeof(tinfo.length))) 1326 1326 ret = -EFAULT; 1327 + 1328 + if (ret) 1329 + hfi1_user_exp_rcv_invalid(fd, &tinfo); 1327 1330 } 1328 1331 1329 1332 return ret;
+2 -7
drivers/infiniband/hw/hfi1/user_exp_rcv.c
··· 160 160 static int pin_rcv_pages(struct hfi1_filedata *fd, struct tid_user_buf *tidbuf) 161 161 { 162 162 int pinned; 163 - unsigned int npages; 163 + unsigned int npages = tidbuf->npages; 164 164 unsigned long vaddr = tidbuf->vaddr; 165 165 struct page **pages = NULL; 166 166 struct hfi1_devdata *dd = fd->uctxt->dd; 167 - 168 - /* Get the number of pages the user buffer spans */ 169 - npages = num_user_pages(vaddr, tidbuf->length); 170 - if (!npages) 171 - return -EINVAL; 172 167 173 168 if (npages > fd->uctxt->expected_count) { 174 169 dd_dev_err(dd, "Expected buffer too big\n"); ··· 191 196 return pinned; 192 197 } 193 198 tidbuf->pages = pages; 194 - tidbuf->npages = npages; 195 199 fd->tid_n_pinned += pinned; 196 200 return pinned; 197 201 } ··· 268 274 mutex_init(&tidbuf->cover_mutex); 269 275 tidbuf->vaddr = tinfo->vaddr; 270 276 tidbuf->length = tinfo->length; 277 + tidbuf->npages = num_user_pages(tidbuf->vaddr, tidbuf->length); 271 278 tidbuf->psets = kcalloc(uctxt->expected_count, sizeof(*tidbuf->psets), 272 279 GFP_KERNEL); 273 280 if (!tidbuf->psets) {
+3
drivers/infiniband/hw/irdma/cm.c
··· 1722 1722 continue; 1723 1723 1724 1724 idev = in_dev_get(ip_dev); 1725 + if (!idev) 1726 + continue; 1727 + 1725 1728 in_dev_for_each_ifa_rtnl(ifa, idev) { 1726 1729 ibdev_dbg(&iwdev->ibdev, 1727 1730 "CM: Allocating child CM Listener forIP=%pI4, vlan_id=%d, MAC=%pM\n",
+1 -1
drivers/infiniband/hw/mana/qp.c
··· 289 289 290 290 /* IB ports start with 1, MANA Ethernet ports start with 0 */ 291 291 port = ucmd.port; 292 - if (ucmd.port > mc->num_ports) 292 + if (port < 1 || port > mc->num_ports) 293 293 return -EINVAL; 294 294 295 295 if (attr->cap.max_send_wr > MAX_SEND_BUFFERS_PER_QUEUE) {
+4 -4
drivers/infiniband/hw/usnic/usnic_uiom.c
··· 276 276 size = pa_end - pa_start + PAGE_SIZE; 277 277 usnic_dbg("va 0x%lx pa %pa size 0x%zx flags 0x%x", 278 278 va_start, &pa_start, size, flags); 279 - err = iommu_map(pd->domain, va_start, pa_start, 280 - size, flags); 279 + err = iommu_map_atomic(pd->domain, va_start, 280 + pa_start, size, flags); 281 281 if (err) { 282 282 usnic_err("Failed to map va 0x%lx pa %pa size 0x%zx with err %d\n", 283 283 va_start, &pa_start, size, err); ··· 293 293 size = pa - pa_start + PAGE_SIZE; 294 294 usnic_dbg("va 0x%lx pa %pa size 0x%zx flags 0x%x\n", 295 295 va_start, &pa_start, size, flags); 296 - err = iommu_map(pd->domain, va_start, pa_start, 297 - size, flags); 296 + err = iommu_map_atomic(pd->domain, va_start, 297 + pa_start, size, flags); 298 298 if (err) { 299 299 usnic_err("Failed to map va 0x%lx pa %pa size 0x%zx with err %d\n", 300 300 va_start, &pa_start, size, err);
+8
drivers/infiniband/ulp/ipoib/ipoib_main.c
··· 2200 2200 rn->attach_mcast = ipoib_mcast_attach; 2201 2201 rn->detach_mcast = ipoib_mcast_detach; 2202 2202 rn->hca = hca; 2203 + 2204 + rc = netif_set_real_num_tx_queues(dev, 1); 2205 + if (rc) 2206 + goto out; 2207 + 2208 + rc = netif_set_real_num_rx_queues(dev, 1); 2209 + if (rc) 2210 + goto out; 2203 2211 } 2204 2212 2205 2213 priv->rn_ops = dev->netdev_ops;
+1 -2
drivers/infiniband/ulp/rtrs/rtrs-srv-sysfs.c
··· 312 312 313 313 if (srv_path->kobj.state_in_sysfs) { 314 314 sysfs_remove_group(&srv_path->kobj, &rtrs_srv_path_attr_group); 315 - kobject_del(&srv_path->kobj); 316 315 kobject_put(&srv_path->kobj); 316 + rtrs_srv_destroy_once_sysfs_root_folders(srv_path); 317 317 } 318 318 319 - rtrs_srv_destroy_once_sysfs_root_folders(srv_path); 320 319 }
+1 -1
drivers/net/bonding/bond_debugfs.c
··· 76 76 77 77 d = debugfs_rename(bonding_debug_root, bond->debug_dir, 78 78 bonding_debug_root, bond->dev->name); 79 - if (d) { 79 + if (!IS_ERR(d)) { 80 80 bond->debug_dir = d; 81 81 } else { 82 82 netdev_warn(bond->dev, "failed to reregister, so just unregister old one\n");
+19 -7
drivers/net/dsa/mt7530.c
··· 1309 1309 if (!priv->ports[port].pvid) 1310 1310 mt7530_rmw(priv, MT7530_PVC_P(port), ACC_FRM_MASK, 1311 1311 MT7530_VLAN_ACC_TAGGED); 1312 - } 1313 1312 1314 - /* Set the port as a user port which is to be able to recognize VID 1315 - * from incoming packets before fetching entry within the VLAN table. 1316 - */ 1317 - mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK | PVC_EG_TAG_MASK, 1318 - VLAN_ATTR(MT7530_VLAN_USER) | 1319 - PVC_EG_TAG(MT7530_VLAN_EG_DISABLED)); 1313 + /* Set the port as a user port which is to be able to recognize 1314 + * VID from incoming packets before fetching entry within the 1315 + * VLAN table. 1316 + */ 1317 + mt7530_rmw(priv, MT7530_PVC_P(port), 1318 + VLAN_ATTR_MASK | PVC_EG_TAG_MASK, 1319 + VLAN_ATTR(MT7530_VLAN_USER) | 1320 + PVC_EG_TAG(MT7530_VLAN_EG_DISABLED)); 1321 + } else { 1322 + /* Also set CPU ports to the "user" VLAN port attribute, to 1323 + * allow VLAN classification, but keep the EG_TAG attribute as 1324 + * "consistent" (i.o.w. don't change its value) for packets 1325 + * received by the switch from the CPU, so that tagged packets 1326 + * are forwarded to user ports as tagged, and untagged as 1327 + * untagged. 1328 + */ 1329 + mt7530_rmw(priv, MT7530_PVC_P(port), VLAN_ATTR_MASK, 1330 + VLAN_ATTR(MT7530_VLAN_USER)); 1331 + } 1320 1332 } 1321 1333 1322 1334 static void
+16 -15
drivers/net/ethernet/cadence/macb_main.c
··· 4627 4627 if (ret) 4628 4628 return dev_err_probe(&pdev->dev, ret, 4629 4629 "failed to init SGMII PHY\n"); 4630 - } 4631 4630 4632 - ret = zynqmp_pm_is_function_supported(PM_IOCTL, IOCTL_SET_GEM_CONFIG); 4633 - if (!ret) { 4634 - u32 pm_info[2]; 4631 + ret = zynqmp_pm_is_function_supported(PM_IOCTL, IOCTL_SET_GEM_CONFIG); 4632 + if (!ret) { 4633 + u32 pm_info[2]; 4635 4634 4636 - ret = of_property_read_u32_array(pdev->dev.of_node, "power-domains", 4637 - pm_info, ARRAY_SIZE(pm_info)); 4638 - if (ret) { 4639 - dev_err(&pdev->dev, "Failed to read power management information\n"); 4640 - goto err_out_phy_exit; 4635 + ret = of_property_read_u32_array(pdev->dev.of_node, "power-domains", 4636 + pm_info, ARRAY_SIZE(pm_info)); 4637 + if (ret) { 4638 + dev_err(&pdev->dev, "Failed to read power management information\n"); 4639 + goto err_out_phy_exit; 4640 + } 4641 + ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_FIXED, 0); 4642 + if (ret) 4643 + goto err_out_phy_exit; 4644 + 4645 + ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1); 4646 + if (ret) 4647 + goto err_out_phy_exit; 4641 4648 } 4642 - ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_FIXED, 0); 4643 - if (ret) 4644 - goto err_out_phy_exit; 4645 4649 4646 - ret = zynqmp_pm_set_gem_config(pm_info[1], GEM_CONFIG_SGMII_MODE, 1); 4647 - if (ret) 4648 - goto err_out_phy_exit; 4649 4650 } 4650 4651 4651 4652 /* Fully reset controller at hardware level if mapped in device tree */
+4 -5
drivers/net/ethernet/intel/ice/ice_common.c
··· 5524 5524 * returned by the firmware is a 16 bit * value, but is indexed 5525 5525 * by [fls(speed) - 1] 5526 5526 */ 5527 - static const u32 ice_aq_to_link_speed[15] = { 5527 + static const u32 ice_aq_to_link_speed[] = { 5528 5528 SPEED_10, /* BIT(0) */ 5529 5529 SPEED_100, 5530 5530 SPEED_1000, ··· 5536 5536 SPEED_40000, 5537 5537 SPEED_50000, 5538 5538 SPEED_100000, /* BIT(10) */ 5539 - 0, 5540 - 0, 5541 - 0, 5542 - 0 /* BIT(14) */ 5543 5539 }; 5544 5540 5545 5541 /** ··· 5546 5550 */ 5547 5551 u32 ice_get_link_speed(u16 index) 5548 5552 { 5553 + if (index >= ARRAY_SIZE(ice_aq_to_link_speed)) 5554 + return 0; 5555 + 5549 5556 return ice_aq_to_link_speed[index]; 5550 5557 }
+1 -1
drivers/net/ethernet/intel/ice/ice_main.c
··· 5541 5541 pr_info("%s\n", ice_driver_string); 5542 5542 pr_info("%s\n", ice_copyright); 5543 5543 5544 - ice_wq = alloc_workqueue("%s", WQ_MEM_RECLAIM, 0, KBUILD_MODNAME); 5544 + ice_wq = alloc_workqueue("%s", 0, 0, KBUILD_MODNAME); 5545 5545 if (!ice_wq) { 5546 5546 pr_err("Failed to create workqueue\n"); 5547 5547 return -ENOMEM;
+1 -1
drivers/net/ethernet/intel/ice/ice_switch.c
··· 5420 5420 */ 5421 5421 status = ice_add_special_words(rinfo, lkup_exts, ice_is_dvm_ena(hw)); 5422 5422 if (status) 5423 - goto err_free_lkup_exts; 5423 + goto err_unroll; 5424 5424 5425 5425 /* Group match words into recipes using preferred recipe grouping 5426 5426 * criteria.
+1 -1
drivers/net/ethernet/intel/ice/ice_tc_lib.c
··· 1681 1681 struct ice_vsi *ch_vsi = NULL; 1682 1682 u16 queue = act->rx_queue; 1683 1683 1684 - if (queue > vsi->num_rxq) { 1684 + if (queue >= vsi->num_rxq) { 1685 1685 NL_SET_ERR_MSG_MOD(fltr->extack, 1686 1686 "Unable to add filter because specified queue is invalid"); 1687 1687 return -EINVAL;
+8 -13
drivers/net/ethernet/intel/ice/ice_vf_mbx.c
··· 39 39 return ice_sq_send_cmd(hw, &hw->mailboxq, &desc, msg, msglen, cd); 40 40 } 41 41 42 - static const u32 ice_legacy_aq_to_vc_speed[15] = { 42 + static const u32 ice_legacy_aq_to_vc_speed[] = { 43 43 VIRTCHNL_LINK_SPEED_100MB, /* BIT(0) */ 44 44 VIRTCHNL_LINK_SPEED_100MB, 45 45 VIRTCHNL_LINK_SPEED_1GB, ··· 51 51 VIRTCHNL_LINK_SPEED_40GB, 52 52 VIRTCHNL_LINK_SPEED_40GB, 53 53 VIRTCHNL_LINK_SPEED_40GB, 54 - VIRTCHNL_LINK_SPEED_UNKNOWN, 55 - VIRTCHNL_LINK_SPEED_UNKNOWN, 56 - VIRTCHNL_LINK_SPEED_UNKNOWN, 57 - VIRTCHNL_LINK_SPEED_UNKNOWN /* BIT(14) */ 58 54 }; 59 55 60 56 /** ··· 67 71 */ 68 72 u32 ice_conv_link_speed_to_virtchnl(bool adv_link_support, u16 link_speed) 69 73 { 70 - u32 speed; 74 + /* convert a BIT() value into an array index */ 75 + u32 index = fls(link_speed) - 1; 71 76 72 - if (adv_link_support) { 73 - /* convert a BIT() value into an array index */ 74 - speed = ice_get_link_speed(fls(link_speed) - 1); 75 - } else { 77 + if (adv_link_support) 78 + return ice_get_link_speed(index); 79 + else if (index < ARRAY_SIZE(ice_legacy_aq_to_vc_speed)) 76 80 /* Virtchnl speeds are not defined for every speed supported in 77 81 * the hardware. To maintain compatibility with older AVF 78 82 * drivers, while reporting the speed the new speed values are 79 83 * resolved to the closest known virtchnl speeds 80 84 */ 81 - speed = ice_legacy_aq_to_vc_speed[fls(link_speed) - 1]; 82 - } 85 + return ice_legacy_aq_to_vc_speed[index]; 83 86 84 - return speed; 87 + return VIRTCHNL_LINK_SPEED_UNKNOWN; 85 88 } 86 89 87 90 /* The mailbox overflow detection algorithm helps to check if there
+15 -1
drivers/net/ethernet/intel/ice/ice_vf_vsi_vlan_ops.c
··· 44 44 45 45 /* outer VLAN ops regardless of port VLAN config */ 46 46 vlan_ops->add_vlan = ice_vsi_add_vlan; 47 - vlan_ops->dis_rx_filtering = ice_vsi_dis_rx_vlan_filtering; 48 47 vlan_ops->ena_tx_filtering = ice_vsi_ena_tx_vlan_filtering; 49 48 vlan_ops->dis_tx_filtering = ice_vsi_dis_tx_vlan_filtering; 50 49 51 50 if (ice_vf_is_port_vlan_ena(vf)) { 52 51 /* setup outer VLAN ops */ 53 52 vlan_ops->set_port_vlan = ice_vsi_set_outer_port_vlan; 53 + /* all Rx traffic should be in the domain of the 54 + * assigned port VLAN, so prevent disabling Rx VLAN 55 + * filtering 56 + */ 57 + vlan_ops->dis_rx_filtering = noop_vlan; 54 58 vlan_ops->ena_rx_filtering = 55 59 ice_vsi_ena_rx_vlan_filtering; 56 60 ··· 67 63 vlan_ops->ena_insertion = ice_vsi_ena_inner_insertion; 68 64 vlan_ops->dis_insertion = ice_vsi_dis_inner_insertion; 69 65 } else { 66 + vlan_ops->dis_rx_filtering = 67 + ice_vsi_dis_rx_vlan_filtering; 68 + 70 69 if (!test_bit(ICE_FLAG_VF_VLAN_PRUNING, pf->flags)) 71 70 vlan_ops->ena_rx_filtering = noop_vlan; 72 71 else ··· 103 96 vlan_ops->set_port_vlan = ice_vsi_set_inner_port_vlan; 104 97 vlan_ops->ena_rx_filtering = 105 98 ice_vsi_ena_rx_vlan_filtering; 99 + /* all Rx traffic should be in the domain of the 100 + * assigned port VLAN, so prevent disabling Rx VLAN 101 + * filtering 102 + */ 103 + vlan_ops->dis_rx_filtering = noop_vlan; 106 104 } else { 105 + vlan_ops->dis_rx_filtering = 106 + ice_vsi_dis_rx_vlan_filtering; 107 107 if (!test_bit(ICE_FLAG_VF_VLAN_PRUNING, pf->flags)) 108 108 vlan_ops->ena_rx_filtering = noop_vlan; 109 109 else
+23 -2
drivers/net/ethernet/intel/igc/igc_main.c
··· 2942 2942 if (tx_buffer->next_to_watch && 2943 2943 time_after(jiffies, tx_buffer->time_stamp + 2944 2944 (adapter->tx_timeout_factor * HZ)) && 2945 - !(rd32(IGC_STATUS) & IGC_STATUS_TXOFF)) { 2945 + !(rd32(IGC_STATUS) & IGC_STATUS_TXOFF) && 2946 + (rd32(IGC_TDH(tx_ring->reg_idx)) != 2947 + readl(tx_ring->tail))) { 2946 2948 /* detected Tx unit hang */ 2947 2949 netdev_err(tx_ring->netdev, 2948 2950 "Detected Tx Unit Hang\n" ··· 5071 5069 } 5072 5070 5073 5071 /** 5072 + * igc_tx_timeout - Respond to a Tx Hang 5073 + * @netdev: network interface device structure 5074 + * @txqueue: queue number that timed out 5075 + **/ 5076 + static void igc_tx_timeout(struct net_device *netdev, 5077 + unsigned int __always_unused txqueue) 5078 + { 5079 + struct igc_adapter *adapter = netdev_priv(netdev); 5080 + struct igc_hw *hw = &adapter->hw; 5081 + 5082 + /* Do the reset outside of interrupt context */ 5083 + adapter->tx_timeout_count++; 5084 + schedule_work(&adapter->reset_task); 5085 + wr32(IGC_EICS, 5086 + (adapter->eims_enable_mask & ~adapter->eims_other)); 5087 + } 5088 + 5089 + /** 5074 5090 * igc_get_stats64 - Get System Network Statistics 5075 5091 * @netdev: network interface device structure 5076 5092 * @stats: rtnl_link_stats64 pointer ··· 5515 5495 case SPEED_100: 5516 5496 case SPEED_1000: 5517 5497 case SPEED_2500: 5518 - adapter->tx_timeout_factor = 7; 5498 + adapter->tx_timeout_factor = 1; 5519 5499 break; 5520 5500 } 5521 5501 ··· 6340 6320 .ndo_set_rx_mode = igc_set_rx_mode, 6341 6321 .ndo_set_mac_address = igc_set_mac, 6342 6322 .ndo_change_mtu = igc_change_mtu, 6323 + .ndo_tx_timeout = igc_tx_timeout, 6343 6324 .ndo_get_stats64 = igc_get_stats64, 6344 6325 .ndo_fix_features = igc_fix_features, 6345 6326 .ndo_set_features = igc_set_features,
+19 -17
drivers/net/ethernet/mediatek/mtk_eth_soc.c
··· 1570 1570 if (IS_ERR(pp)) 1571 1571 return pp; 1572 1572 1573 - err = __xdp_rxq_info_reg(xdp_q, &eth->dummy_dev, eth->rx_napi.napi_id, 1574 - id, PAGE_SIZE); 1573 + err = __xdp_rxq_info_reg(xdp_q, &eth->dummy_dev, id, 1574 + eth->rx_napi.napi_id, PAGE_SIZE); 1575 1575 if (err < 0) 1576 1576 goto err_free_pp; 1577 1577 ··· 1870 1870 1871 1871 while (done < budget) { 1872 1872 unsigned int pktlen, *rxdcsum; 1873 + bool has_hwaccel_tag = false; 1873 1874 struct net_device *netdev; 1875 + u16 vlan_proto, vlan_tci; 1874 1876 dma_addr_t dma_addr; 1875 1877 u32 hash, reason; 1876 1878 int mac = 0; ··· 2012 2010 2013 2011 if (netdev->features & NETIF_F_HW_VLAN_CTAG_RX) { 2014 2012 if (MTK_HAS_CAPS(eth->soc->caps, MTK_NETSYS_V2)) { 2015 - if (trxd.rxd3 & RX_DMA_VTAG_V2) 2016 - __vlan_hwaccel_put_tag(skb, 2017 - htons(RX_DMA_VPID(trxd.rxd4)), 2018 - RX_DMA_VID(trxd.rxd4)); 2013 + if (trxd.rxd3 & RX_DMA_VTAG_V2) { 2014 + vlan_proto = RX_DMA_VPID(trxd.rxd4); 2015 + vlan_tci = RX_DMA_VID(trxd.rxd4); 2016 + has_hwaccel_tag = true; 2017 + } 2019 2018 } else if (trxd.rxd2 & RX_DMA_VTAG) { 2020 - __vlan_hwaccel_put_tag(skb, htons(RX_DMA_VPID(trxd.rxd3)), 2021 - RX_DMA_VID(trxd.rxd3)); 2019 + vlan_proto = RX_DMA_VPID(trxd.rxd3); 2020 + vlan_tci = RX_DMA_VID(trxd.rxd3); 2021 + has_hwaccel_tag = true; 2022 2022 } 2023 2023 } 2024 2024 2025 2025 /* When using VLAN untagging in combination with DSA, the 2026 2026 * hardware treats the MTK special tag as a VLAN and untags it. 2027 2027 */ 2028 - if (skb_vlan_tag_present(skb) && netdev_uses_dsa(netdev)) { 2029 - unsigned int port = ntohs(skb->vlan_proto) & GENMASK(2, 0); 2028 + if (has_hwaccel_tag && netdev_uses_dsa(netdev)) { 2029 + unsigned int port = vlan_proto & GENMASK(2, 0); 2030 2030 2031 2031 if (port < ARRAY_SIZE(eth->dsa_meta) && 2032 2032 eth->dsa_meta[port]) 2033 2033 skb_dst_set_noref(skb, &eth->dsa_meta[port]->dst); 2034 - 2035 - __vlan_hwaccel_clear_tag(skb); 2034 + } else if (has_hwaccel_tag) { 2035 + __vlan_hwaccel_put_tag(skb, htons(vlan_proto), vlan_tci); 2036 2036 } 2037 2037 2038 2038 skb_record_rx_queue(skb, 0); ··· 3115 3111 3116 3112 val |= config; 3117 3113 3118 - if (!i && eth->netdev[0] && netdev_uses_dsa(eth->netdev[0])) 3114 + if (eth->netdev[i] && netdev_uses_dsa(eth->netdev[i])) 3119 3115 val |= MTK_GDMA_SPECIAL_TAG; 3120 3116 3121 3117 mtk_w32(eth, val, MTK_GDMA_FWD_CFG(i)); ··· 3181 3177 struct mtk_eth *eth = mac->hw; 3182 3178 int i, err; 3183 3179 3184 - if ((mtk_uses_dsa(dev) && !eth->prog) && 3185 - !(mac->id == 1 && MTK_HAS_CAPS(eth->soc->caps, MTK_GMAC1_TRGMII))) { 3180 + if (mtk_uses_dsa(dev) && !eth->prog) { 3186 3181 for (i = 0; i < ARRAY_SIZE(eth->dsa_meta); i++) { 3187 3182 struct metadata_dst *md_dst = eth->dsa_meta[i]; 3188 3183 ··· 3198 3195 } 3199 3196 } else { 3200 3197 /* Hardware special tag parsing needs to be disabled if at least 3201 - * one MAC does not use DSA, or the second MAC of the MT7621 and 3202 - * MT7623 SoCs is being used. 3198 + * one MAC does not use DSA. 3203 3199 */ 3204 3200 u32 val = mtk_r32(eth, MTK_CDMP_IG_CTRL); 3205 3201 val &= ~MTK_CDMP_STAG_EN;
+3 -2
drivers/net/ethernet/mellanox/mlx5/core/debugfs.c
··· 245 245 pages = dev->priv.dbg.pages_debugfs; 246 246 247 247 debugfs_create_u32("fw_pages_total", 0400, pages, &dev->priv.fw_pages); 248 - debugfs_create_u32("fw_pages_vfs", 0400, pages, &dev->priv.vfs_pages); 249 - debugfs_create_u32("fw_pages_host_pf", 0400, pages, &dev->priv.host_pf_pages); 248 + debugfs_create_u32("fw_pages_vfs", 0400, pages, &dev->priv.page_counters[MLX5_VF]); 249 + debugfs_create_u32("fw_pages_sfs", 0400, pages, &dev->priv.page_counters[MLX5_SF]); 250 + debugfs_create_u32("fw_pages_host_pf", 0400, pages, &dev->priv.page_counters[MLX5_HOST_PF]); 250 251 debugfs_create_u32("fw_pages_alloc_failed", 0400, pages, &dev->priv.fw_pages_alloc_failed); 251 252 debugfs_create_u32("fw_pages_give_dropped", 0400, pages, &dev->priv.give_pages_dropped); 252 253 debugfs_create_u32("fw_pages_reclaim_discard", 0400, pages,
+2 -1
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
··· 64 64 MLX5_GET(mtrc_cap, out, num_string_trace); 65 65 tracer->str_db.num_string_db = MLX5_GET(mtrc_cap, out, num_string_db); 66 66 tracer->owner = !!MLX5_GET(mtrc_cap, out, trace_owner); 67 + tracer->str_db.loaded = false; 67 68 68 69 for (i = 0; i < tracer->str_db.num_string_db; i++) { 69 70 mtrc_cap_sp = MLX5_ADDR_OF(mtrc_cap, out, string_db_param[i]); ··· 757 756 if (err) 758 757 mlx5_core_warn(dev, "FWTracer: Failed to set tracer configurations %d\n", err); 759 758 759 + tracer->buff.consumer_index = 0; 760 760 return err; 761 761 } 762 762 ··· 822 820 mlx5_core_dbg(tracer->dev, "FWTracer: ownership changed, current=(%d)\n", tracer->owner); 823 821 if (tracer->owner) { 824 822 tracer->owner = false; 825 - tracer->buff.consumer_index = 0; 826 823 return; 827 824 } 828 825
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/ecpf.c
··· 87 87 88 88 mlx5_host_pf_cleanup(dev); 89 89 90 - err = mlx5_wait_for_pages(dev, &dev->priv.host_pf_pages); 90 + err = mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_HOST_PF]); 91 91 if (err) 92 92 mlx5_core_warn(dev, "Timeout reclaiming external host PF pages err(%d)\n", err); 93 93 }
-4
drivers/net/ethernet/mellanox/mlx5/core/en/rep/bridge.c
··· 438 438 439 439 switch (event) { 440 440 case SWITCHDEV_FDB_ADD_TO_BRIDGE: 441 - /* only handle the event on native eswtich of representor */ 442 - if (!mlx5_esw_bridge_is_local(dev, rep, esw)) 443 - break; 444 - 445 441 fdb_info = container_of(info, 446 442 struct switchdev_notifier_fdb_info, 447 443 info);
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c
··· 443 443 444 444 void mlx5e_disable_cvlan_filter(struct mlx5e_flow_steering *fs, bool promisc) 445 445 { 446 - if (fs->vlan->cvlan_filter_disabled) 446 + if (!fs->vlan || fs->vlan->cvlan_filter_disabled) 447 447 return; 448 448 449 449 fs->vlan->cvlan_filter_disabled = true;
+19 -71
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 591 591 rq->ix = c->ix; 592 592 rq->channel = c; 593 593 rq->mdev = mdev; 594 - rq->hw_mtu = MLX5E_SW2HW_MTU(params, params->sw_mtu); 594 + rq->hw_mtu = 595 + MLX5E_SW2HW_MTU(params, params->sw_mtu) - ETH_FCS_LEN * !params->scatter_fcs_en; 595 596 rq->xdpsq = &c->rq_xdpsq; 596 597 rq->stats = &c->priv->channel_stats[c->ix]->rq; 597 598 rq->ptp_cyc2time = mlx5_rq_ts_translator(mdev); ··· 1013 1012 mlx5e_free_rx_descs(rq); 1014 1013 1015 1014 return mlx5e_rq_to_ready(rq, curr_state); 1016 - } 1017 - 1018 - static int mlx5e_modify_rq_scatter_fcs(struct mlx5e_rq *rq, bool enable) 1019 - { 1020 - struct mlx5_core_dev *mdev = rq->mdev; 1021 - 1022 - void *in; 1023 - void *rqc; 1024 - int inlen; 1025 - int err; 1026 - 1027 - inlen = MLX5_ST_SZ_BYTES(modify_rq_in); 1028 - in = kvzalloc(inlen, GFP_KERNEL); 1029 - if (!in) 1030 - return -ENOMEM; 1031 - 1032 - rqc = MLX5_ADDR_OF(modify_rq_in, in, ctx); 1033 - 1034 - MLX5_SET(modify_rq_in, in, rq_state, MLX5_RQC_STATE_RDY); 1035 - MLX5_SET64(modify_rq_in, in, modify_bitmask, 1036 - MLX5_MODIFY_RQ_IN_MODIFY_BITMASK_SCATTER_FCS); 1037 - MLX5_SET(rqc, rqc, scatter_fcs, enable); 1038 - MLX5_SET(rqc, rqc, state, MLX5_RQC_STATE_RDY); 1039 - 1040 - err = mlx5_core_modify_rq(mdev, rq->rqn, in); 1041 - 1042 - kvfree(in); 1043 - 1044 - return err; 1045 1015 } 1046 1016 1047 1017 static int mlx5e_modify_rq_vsd(struct mlx5e_rq *rq, bool vsd) ··· 3286 3314 mlx5e_destroy_tises(priv); 3287 3315 } 3288 3316 3289 - static int mlx5e_modify_channels_scatter_fcs(struct mlx5e_channels *chs, bool enable) 3290 - { 3291 - int err = 0; 3292 - int i; 3293 - 3294 - for (i = 0; i < chs->num; i++) { 3295 - err = mlx5e_modify_rq_scatter_fcs(&chs->c[i]->rq, enable); 3296 - if (err) 3297 - return err; 3298 - } 3299 - 3300 - return 0; 3301 - } 3302 - 3303 3317 static int mlx5e_modify_channels_vsd(struct mlx5e_channels *chs, bool vsd) 3304 3318 { 3305 3319 int err; ··· 3861 3903 return mlx5_set_ports_check(mdev, in, sizeof(in)); 3862 3904 } 3863 3905 3906 + static int mlx5e_set_rx_port_ts_wrap(struct mlx5e_priv *priv, void *ctx) 3907 + { 3908 + struct mlx5_core_dev *mdev = priv->mdev; 3909 + bool enable = *(bool *)ctx; 3910 + 3911 + return mlx5e_set_rx_port_ts(mdev, enable); 3912 + } 3913 + 3864 3914 static int set_feature_rx_fcs(struct net_device *netdev, bool enable) 3865 3915 { 3866 3916 struct mlx5e_priv *priv = netdev_priv(netdev); 3867 3917 struct mlx5e_channels *chs = &priv->channels; 3868 - struct mlx5_core_dev *mdev = priv->mdev; 3918 + struct mlx5e_params new_params; 3869 3919 int err; 3870 3920 3871 3921 mutex_lock(&priv->state_lock); 3872 3922 3873 - if (enable) { 3874 - err = mlx5e_set_rx_port_ts(mdev, false); 3875 - if (err) 3876 - goto out; 3877 - 3878 - chs->params.scatter_fcs_en = true; 3879 - err = mlx5e_modify_channels_scatter_fcs(chs, true); 3880 - if (err) { 3881 - chs->params.scatter_fcs_en = false; 3882 - mlx5e_set_rx_port_ts(mdev, true); 3883 - } 3884 - } else { 3885 - chs->params.scatter_fcs_en = false; 3886 - err = mlx5e_modify_channels_scatter_fcs(chs, false); 3887 - if (err) { 3888 - chs->params.scatter_fcs_en = true; 3889 - goto out; 3890 - } 3891 - err = mlx5e_set_rx_port_ts(mdev, true); 3892 - if (err) { 3893 - mlx5_core_warn(mdev, "Failed to set RX port timestamp %d\n", err); 3894 - err = 0; 3895 - } 3896 - } 3897 - 3898 - out: 3923 + new_params = chs->params; 3924 + new_params.scatter_fcs_en = enable; 3925 + err = mlx5e_safe_switch_params(priv, &new_params, mlx5e_set_rx_port_ts_wrap, 3926 + &new_params.scatter_fcs_en, true); 3899 3927 mutex_unlock(&priv->state_lock); 3900 3928 return err; 3901 3929 } ··· 4017 4073 features &= ~NETIF_F_GRO_HW; 4018 4074 if (netdev->features & NETIF_F_GRO_HW) 4019 4075 netdev_warn(netdev, "Disabling HW_GRO, not supported in switchdev mode\n"); 4076 + 4077 + features &= ~NETIF_F_HW_VLAN_CTAG_FILTER; 4078 + if (netdev->features & NETIF_F_HW_VLAN_CTAG_FILTER) 4079 + netdev_warn(netdev, "Disabling HW_VLAN CTAG FILTERING, not supported in switchdev mode\n"); 4020 4080 4021 4081 return features; 4022 4082 }
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/esw/bridge.c
··· 1715 1715 struct mlx5_esw_bridge *bridge; 1716 1716 1717 1717 port = mlx5_esw_bridge_port_lookup(vport_num, esw_owner_vhca_id, br_offloads); 1718 - if (!port || port->flags & MLX5_ESW_BRIDGE_PORT_FLAG_PEER) 1718 + if (!port) 1719 1719 return; 1720 1720 1721 1721 bridge = port->bridge;
+5 -8
drivers/net/ethernet/mellanox/mlx5/core/ipoib/ethtool.c
··· 189 189 } 190 190 } 191 191 192 - static int mlx5i_get_speed_settings(u16 ib_link_width_oper, u16 ib_proto_oper) 192 + static u32 mlx5i_get_speed_settings(u16 ib_link_width_oper, u16 ib_proto_oper) 193 193 { 194 194 int rate, width; 195 195 196 196 rate = mlx5_ptys_rate_enum_to_int(ib_proto_oper); 197 197 if (rate < 0) 198 - return -EINVAL; 198 + return SPEED_UNKNOWN; 199 199 width = mlx5_ptys_width_enum_to_int(ib_link_width_oper); 200 200 if (width < 0) 201 - return -EINVAL; 201 + return SPEED_UNKNOWN; 202 202 203 203 return rate * width; 204 204 } ··· 221 221 ethtool_link_ksettings_zero_link_mode(link_ksettings, advertising); 222 222 223 223 speed = mlx5i_get_speed_settings(ib_link_width_oper, ib_proto_oper); 224 - if (speed < 0) 225 - return -EINVAL; 224 + link_ksettings->base.speed = speed; 225 + link_ksettings->base.duplex = speed == SPEED_UNKNOWN ? DUPLEX_UNKNOWN : DUPLEX_FULL; 226 226 227 - link_ksettings->base.duplex = DUPLEX_FULL; 228 227 link_ksettings->base.port = PORT_OTHER; 229 228 230 229 link_ksettings->base.autoneg = AUTONEG_DISABLE; 231 - 232 - link_ksettings->base.speed = speed; 233 230 234 231 return 0; 235 232 }
+7 -7
drivers/net/ethernet/mellanox/mlx5/core/main.c
··· 2110 2110 mlx5_core_verify_params(); 2111 2111 mlx5_register_debugfs(); 2112 2112 2113 - err = pci_register_driver(&mlx5_core_driver); 2113 + err = mlx5e_init(); 2114 2114 if (err) 2115 2115 goto err_debug; 2116 2116 ··· 2118 2118 if (err) 2119 2119 goto err_sf; 2120 2120 2121 - err = mlx5e_init(); 2121 + err = pci_register_driver(&mlx5_core_driver); 2122 2122 if (err) 2123 - goto err_en; 2123 + goto err_pci; 2124 2124 2125 2125 return 0; 2126 2126 2127 - err_en: 2127 + err_pci: 2128 2128 mlx5_sf_driver_unregister(); 2129 2129 err_sf: 2130 - pci_unregister_driver(&mlx5_core_driver); 2130 + mlx5e_cleanup(); 2131 2131 err_debug: 2132 2132 mlx5_unregister_debugfs(); 2133 2133 return err; ··· 2135 2135 2136 2136 static void __exit mlx5_cleanup(void) 2137 2137 { 2138 - mlx5e_cleanup(); 2139 - mlx5_sf_driver_unregister(); 2140 2138 pci_unregister_driver(&mlx5_core_driver); 2139 + mlx5_sf_driver_unregister(); 2140 + mlx5e_cleanup(); 2141 2141 mlx5_unregister_debugfs(); 2142 2142 } 2143 2143
+21 -16
drivers/net/ethernet/mellanox/mlx5/core/pagealloc.c
··· 74 74 return (u32)func_id | (ec_function << 16); 75 75 } 76 76 77 + static u16 func_id_to_type(struct mlx5_core_dev *dev, u16 func_id, bool ec_function) 78 + { 79 + if (!func_id) 80 + return mlx5_core_is_ecpf(dev) && !ec_function ? MLX5_HOST_PF : MLX5_PF; 81 + 82 + return func_id <= mlx5_core_max_vfs(dev) ? MLX5_VF : MLX5_SF; 83 + } 84 + 77 85 static struct rb_root *page_root_per_function(struct mlx5_core_dev *dev, u32 function) 78 86 { 79 87 struct rb_root *root; ··· 340 332 u32 out[MLX5_ST_SZ_DW(manage_pages_out)] = {0}; 341 333 int inlen = MLX5_ST_SZ_BYTES(manage_pages_in); 342 334 int notify_fail = event; 335 + u16 func_type; 343 336 u64 addr; 344 337 int err; 345 338 u32 *in; ··· 392 383 goto out_dropped; 393 384 } 394 385 386 + func_type = func_id_to_type(dev, func_id, ec_function); 387 + dev->priv.page_counters[func_type] += npages; 395 388 dev->priv.fw_pages += npages; 396 - if (func_id) 397 - dev->priv.vfs_pages += npages; 398 - else if (mlx5_core_is_ecpf(dev) && !ec_function) 399 - dev->priv.host_pf_pages += npages; 400 389 401 390 mlx5_core_dbg(dev, "npages %d, ec_function %d, func_id 0x%x, err %d\n", 402 391 npages, ec_function, func_id, err); ··· 421 414 struct rb_root *root; 422 415 struct rb_node *p; 423 416 int npages = 0; 417 + u16 func_type; 424 418 425 419 root = xa_load(&dev->priv.page_root_xa, function); 426 420 if (WARN_ON_ONCE(!root)) ··· 436 428 free_fwp(dev, fwp, fwp->free_count); 437 429 } 438 430 431 + func_type = func_id_to_type(dev, func_id, ec_function); 432 + dev->priv.page_counters[func_type] -= npages; 439 433 dev->priv.fw_pages -= npages; 440 - if (func_id) 441 - dev->priv.vfs_pages -= npages; 442 - else if (mlx5_core_is_ecpf(dev) && !ec_function) 443 - dev->priv.host_pf_pages -= npages; 444 434 445 435 mlx5_core_dbg(dev, "npages %d, ec_function %d, func_id 0x%x\n", 446 436 npages, ec_function, func_id); ··· 504 498 int outlen = MLX5_ST_SZ_BYTES(manage_pages_out); 505 499 u32 in[MLX5_ST_SZ_DW(manage_pages_in)] = {}; 506 500 int num_claimed; 501 + u16 func_type; 507 502 u32 *out; 508 503 int err; 509 504 int i; ··· 556 549 if (nclaimed) 557 550 *nclaimed = num_claimed; 558 551 552 + func_type = func_id_to_type(dev, func_id, ec_function); 553 + dev->priv.page_counters[func_type] -= num_claimed; 559 554 dev->priv.fw_pages -= num_claimed; 560 - if (func_id) 561 - dev->priv.vfs_pages -= num_claimed; 562 - else if (mlx5_core_is_ecpf(dev) && !ec_function) 563 - dev->priv.host_pf_pages -= num_claimed; 564 555 565 556 out_free: 566 557 kvfree(out); ··· 711 706 WARN(dev->priv.fw_pages, 712 707 "FW pages counter is %d after reclaiming all pages\n", 713 708 dev->priv.fw_pages); 714 - WARN(dev->priv.vfs_pages, 709 + WARN(dev->priv.page_counters[MLX5_VF], 715 710 "VFs FW pages counter is %d after reclaiming all pages\n", 716 - dev->priv.vfs_pages); 717 - WARN(dev->priv.host_pf_pages, 711 + dev->priv.page_counters[MLX5_VF]); 712 + WARN(dev->priv.page_counters[MLX5_HOST_PF], 718 713 "External host PF FW pages counter is %d after reclaiming all pages\n", 719 - dev->priv.host_pf_pages); 714 + dev->priv.page_counters[MLX5_HOST_PF]); 720 715 721 716 return 0; 722 717 }
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/sriov.c
··· 147 147 148 148 mlx5_eswitch_disable_sriov(dev->priv.eswitch, clear_vf); 149 149 150 - if (mlx5_wait_for_pages(dev, &dev->priv.vfs_pages)) 150 + if (mlx5_wait_for_pages(dev, &dev->priv.page_counters[MLX5_VF])) 151 151 mlx5_core_warn(dev, "timeout reclaiming VFs pages\n"); 152 152 } 153 153
+15 -10
drivers/net/ethernet/mellanox/mlx5/core/steering/dr_rule.c
··· 1138 1138 rule->flow_source)) 1139 1139 return 0; 1140 1140 1141 + mlx5dr_domain_nic_lock(nic_dmn); 1142 + 1141 1143 ret = mlx5dr_matcher_select_builders(matcher, 1142 1144 nic_matcher, 1143 1145 dr_rule_get_ipv(&param->outer), 1144 1146 dr_rule_get_ipv(&param->inner)); 1145 1147 if (ret) 1146 - return ret; 1148 + goto err_unlock; 1147 1149 1148 1150 hw_ste_arr_is_opt = nic_matcher->num_of_builders <= DR_RULE_MAX_STES_OPTIMIZED; 1149 1151 if (likely(hw_ste_arr_is_opt)) { ··· 1154 1152 hw_ste_arr = kzalloc((nic_matcher->num_of_builders + DR_ACTION_MAX_STES) * 1155 1153 DR_STE_SIZE, GFP_KERNEL); 1156 1154 1157 - if (!hw_ste_arr) 1158 - return -ENOMEM; 1155 + if (!hw_ste_arr) { 1156 + ret = -ENOMEM; 1157 + goto err_unlock; 1158 + } 1159 1159 } 1160 - 1161 - mlx5dr_domain_nic_lock(nic_dmn); 1162 1160 1163 1161 ret = mlx5dr_matcher_add_to_tbl_nic(dmn, nic_matcher); 1164 1162 if (ret) ··· 1225 1223 1226 1224 mlx5dr_domain_nic_unlock(nic_dmn); 1227 1225 1228 - goto out; 1226 + if (unlikely(!hw_ste_arr_is_opt)) 1227 + kfree(hw_ste_arr); 1228 + 1229 + return 0; 1229 1230 1230 1231 free_rule: 1231 1232 dr_rule_clean_rule_members(rule, nic_rule); ··· 1243 1238 mlx5dr_matcher_remove_from_tbl_nic(dmn, nic_matcher); 1244 1239 1245 1240 free_hw_ste: 1246 - mlx5dr_domain_nic_unlock(nic_dmn); 1247 - 1248 - out: 1249 - if (unlikely(!hw_ste_arr_is_opt)) 1241 + if (!hw_ste_arr_is_opt) 1250 1242 kfree(hw_ste_arr); 1243 + 1244 + err_unlock: 1245 + mlx5dr_domain_nic_unlock(nic_dmn); 1251 1246 1252 1247 return ret; 1253 1248 }
+2 -2
drivers/net/ethernet/microchip/sparx5/sparx5_ptp.c
··· 633 633 /* Enable master counters */ 634 634 spx5_wr(PTP_PTP_DOM_CFG_PTP_ENA_SET(0x7), sparx5, PTP_PTP_DOM_CFG); 635 635 636 - for (i = 0; i < sparx5->port_count; i++) { 636 + for (i = 0; i < SPX5_PORTS; i++) { 637 637 port = sparx5->ports[i]; 638 638 if (!port) 639 639 continue; ··· 649 649 struct sparx5_port *port; 650 650 int i; 651 651 652 - for (i = 0; i < sparx5->port_count; i++) { 652 + for (i = 0; i < SPX5_PORTS; i++) { 653 653 port = sparx5->ports[i]; 654 654 if (!port) 655 655 continue;
+11 -26
drivers/net/ethernet/microsoft/mana/gdma_main.c
··· 1217 1217 unsigned int max_queues_per_port = num_online_cpus(); 1218 1218 struct gdma_context *gc = pci_get_drvdata(pdev); 1219 1219 struct gdma_irq_context *gic; 1220 - unsigned int max_irqs; 1221 - u16 *cpus; 1222 - cpumask_var_t req_mask; 1220 + unsigned int max_irqs, cpu; 1223 1221 int nvec, irq; 1224 1222 int err, i = 0, j; 1225 1223 ··· 1238 1240 goto free_irq_vector; 1239 1241 } 1240 1242 1241 - if (!zalloc_cpumask_var(&req_mask, GFP_KERNEL)) { 1242 - err = -ENOMEM; 1243 - goto free_irq; 1244 - } 1245 - 1246 - cpus = kcalloc(nvec, sizeof(*cpus), GFP_KERNEL); 1247 - if (!cpus) { 1248 - err = -ENOMEM; 1249 - goto free_mask; 1250 - } 1251 - for (i = 0; i < nvec; i++) 1252 - cpus[i] = cpumask_local_spread(i, gc->numa_node); 1253 - 1254 1243 for (i = 0; i < nvec; i++) { 1255 - cpumask_set_cpu(cpus[i], req_mask); 1256 1244 gic = &gc->irq_contexts[i]; 1257 1245 gic->handler = NULL; 1258 1246 gic->arg = NULL; ··· 1253 1269 irq = pci_irq_vector(pdev, i); 1254 1270 if (irq < 0) { 1255 1271 err = irq; 1256 - goto free_mask; 1272 + goto free_irq; 1257 1273 } 1258 1274 1259 1275 err = request_irq(irq, mana_gd_intr, 0, gic->name, gic); 1260 1276 if (err) 1261 - goto free_mask; 1262 - irq_set_affinity_and_hint(irq, req_mask); 1263 - cpumask_clear(req_mask); 1277 + goto free_irq; 1278 + 1279 + cpu = cpumask_local_spread(i, gc->numa_node); 1280 + irq_set_affinity_and_hint(irq, cpumask_of(cpu)); 1264 1281 } 1265 - free_cpumask_var(req_mask); 1266 - kfree(cpus); 1267 1282 1268 1283 err = mana_gd_alloc_res_map(nvec, &gc->msix_resource); 1269 1284 if (err) ··· 1273 1290 1274 1291 return 0; 1275 1292 1276 - free_mask: 1277 - free_cpumask_var(req_mask); 1278 - kfree(cpus); 1279 1293 free_irq: 1280 1294 for (j = i - 1; j >= 0; j--) { 1281 1295 irq = pci_irq_vector(pdev, j); 1282 1296 gic = &gc->irq_contexts[j]; 1297 + 1298 + irq_update_affinity_hint(irq, NULL); 1283 1299 free_irq(irq, gic); 1284 1300 } 1285 1301 ··· 1306 1324 continue; 1307 1325 1308 1326 gic = &gc->irq_contexts[i]; 1327 + 1328 + /* Need to clear the hint before free_irq */ 1329 + irq_update_affinity_hint(irq, NULL); 1309 1330 free_irq(irq, gic); 1310 1331 } 1311 1332
+12 -12
drivers/net/ethernet/mscc/ocelot_flower.c
··· 605 605 flow_rule_match_control(rule, &match); 606 606 } 607 607 608 + if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { 609 + struct flow_match_vlan match; 610 + 611 + flow_rule_match_vlan(rule, &match); 612 + filter->key_type = OCELOT_VCAP_KEY_ANY; 613 + filter->vlan.vid.value = match.key->vlan_id; 614 + filter->vlan.vid.mask = match.mask->vlan_id; 615 + filter->vlan.pcp.value[0] = match.key->vlan_priority; 616 + filter->vlan.pcp.mask[0] = match.mask->vlan_priority; 617 + match_protocol = false; 618 + } 619 + 608 620 if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_ETH_ADDRS)) { 609 621 struct flow_match_eth_addrs match; 610 622 ··· 746 734 filter->key.ipv4.sport.mask = ntohs(match.mask->src); 747 735 filter->key.ipv4.dport.value = ntohs(match.key->dst); 748 736 filter->key.ipv4.dport.mask = ntohs(match.mask->dst); 749 - match_protocol = false; 750 - } 751 - 752 - if (flow_rule_match_key(rule, FLOW_DISSECTOR_KEY_VLAN)) { 753 - struct flow_match_vlan match; 754 - 755 - flow_rule_match_vlan(rule, &match); 756 - filter->key_type = OCELOT_VCAP_KEY_ANY; 757 - filter->vlan.vid.value = match.key->vlan_id; 758 - filter->vlan.vid.mask = match.mask->vlan_id; 759 - filter->vlan.pcp.value[0] = match.key->vlan_priority; 760 - filter->vlan.pcp.mask[0] = match.mask->vlan_priority; 761 737 match_protocol = false; 762 738 } 763 739
+4 -4
drivers/net/ethernet/mscc/ocelot_ptp.c
··· 335 335 ocelot_populate_ipv6_ptp_event_trap_key(struct ocelot_vcap_filter *trap) 336 336 { 337 337 trap->key_type = OCELOT_VCAP_KEY_IPV6; 338 - trap->key.ipv4.proto.value[0] = IPPROTO_UDP; 339 - trap->key.ipv4.proto.mask[0] = 0xff; 338 + trap->key.ipv6.proto.value[0] = IPPROTO_UDP; 339 + trap->key.ipv6.proto.mask[0] = 0xff; 340 340 trap->key.ipv6.dport.value = PTP_EV_PORT; 341 341 trap->key.ipv6.dport.mask = 0xffff; 342 342 } ··· 355 355 ocelot_populate_ipv6_ptp_general_trap_key(struct ocelot_vcap_filter *trap) 356 356 { 357 357 trap->key_type = OCELOT_VCAP_KEY_IPV6; 358 - trap->key.ipv4.proto.value[0] = IPPROTO_UDP; 359 - trap->key.ipv4.proto.mask[0] = 0xff; 358 + trap->key.ipv6.proto.value[0] = IPPROTO_UDP; 359 + trap->key.ipv6.proto.mask[0] = 0xff; 360 360 trap->key.ipv6.dport.value = PTP_GEN_PORT; 361 361 trap->key.ipv6.dport.mask = 0xffff; 362 362 }
+158 -36
drivers/net/ethernet/netronome/nfp/nfp_net_ethtool.c
··· 293 293 } 294 294 } 295 295 296 - static const u16 nfp_eth_media_table[] = { 297 - [NFP_MEDIA_1000BASE_CX] = ETHTOOL_LINK_MODE_1000baseKX_Full_BIT, 298 - [NFP_MEDIA_1000BASE_KX] = ETHTOOL_LINK_MODE_1000baseKX_Full_BIT, 299 - [NFP_MEDIA_10GBASE_KX4] = ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT, 300 - [NFP_MEDIA_10GBASE_KR] = ETHTOOL_LINK_MODE_10000baseKR_Full_BIT, 301 - [NFP_MEDIA_10GBASE_CX4] = ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT, 302 - [NFP_MEDIA_10GBASE_CR] = ETHTOOL_LINK_MODE_10000baseCR_Full_BIT, 303 - [NFP_MEDIA_10GBASE_SR] = ETHTOOL_LINK_MODE_10000baseSR_Full_BIT, 304 - [NFP_MEDIA_10GBASE_ER] = ETHTOOL_LINK_MODE_10000baseER_Full_BIT, 305 - [NFP_MEDIA_25GBASE_KR] = ETHTOOL_LINK_MODE_25000baseKR_Full_BIT, 306 - [NFP_MEDIA_25GBASE_KR_S] = ETHTOOL_LINK_MODE_25000baseKR_Full_BIT, 307 - [NFP_MEDIA_25GBASE_CR] = ETHTOOL_LINK_MODE_25000baseCR_Full_BIT, 308 - [NFP_MEDIA_25GBASE_CR_S] = ETHTOOL_LINK_MODE_25000baseCR_Full_BIT, 309 - [NFP_MEDIA_25GBASE_SR] = ETHTOOL_LINK_MODE_25000baseSR_Full_BIT, 310 - [NFP_MEDIA_40GBASE_CR4] = ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT, 311 - [NFP_MEDIA_40GBASE_KR4] = ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT, 312 - [NFP_MEDIA_40GBASE_SR4] = ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT, 313 - [NFP_MEDIA_40GBASE_LR4] = ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT, 314 - [NFP_MEDIA_50GBASE_KR] = ETHTOOL_LINK_MODE_50000baseKR_Full_BIT, 315 - [NFP_MEDIA_50GBASE_SR] = ETHTOOL_LINK_MODE_50000baseSR_Full_BIT, 316 - [NFP_MEDIA_50GBASE_CR] = ETHTOOL_LINK_MODE_50000baseCR_Full_BIT, 317 - [NFP_MEDIA_50GBASE_LR] = ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT, 318 - [NFP_MEDIA_50GBASE_ER] = ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT, 319 - [NFP_MEDIA_50GBASE_FR] = ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT, 320 - [NFP_MEDIA_100GBASE_KR4] = ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT, 321 - [NFP_MEDIA_100GBASE_SR4] = ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT, 322 - [NFP_MEDIA_100GBASE_CR4] = ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT, 323 - [NFP_MEDIA_100GBASE_KP4] = ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT, 324 - [NFP_MEDIA_100GBASE_CR10] = ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT, 296 + static const struct nfp_eth_media_link_mode { 297 + u16 ethtool_link_mode; 298 + u16 speed; 299 + } nfp_eth_media_table[NFP_MEDIA_LINK_MODES_NUMBER] = { 300 + [NFP_MEDIA_1000BASE_CX] = { 301 + .ethtool_link_mode = ETHTOOL_LINK_MODE_1000baseKX_Full_BIT, 302 + .speed = NFP_SPEED_1G, 303 + }, 304 + [NFP_MEDIA_1000BASE_KX] = { 305 + .ethtool_link_mode = ETHTOOL_LINK_MODE_1000baseKX_Full_BIT, 306 + .speed = NFP_SPEED_1G, 307 + }, 308 + [NFP_MEDIA_10GBASE_KX4] = { 309 + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT, 310 + .speed = NFP_SPEED_10G, 311 + }, 312 + [NFP_MEDIA_10GBASE_KR] = { 313 + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseKR_Full_BIT, 314 + .speed = NFP_SPEED_10G, 315 + }, 316 + [NFP_MEDIA_10GBASE_CX4] = { 317 + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseKX4_Full_BIT, 318 + .speed = NFP_SPEED_10G, 319 + }, 320 + [NFP_MEDIA_10GBASE_CR] = { 321 + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseCR_Full_BIT, 322 + .speed = NFP_SPEED_10G, 323 + }, 324 + [NFP_MEDIA_10GBASE_SR] = { 325 + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseSR_Full_BIT, 326 + .speed = NFP_SPEED_10G, 327 + }, 328 + [NFP_MEDIA_10GBASE_ER] = { 329 + .ethtool_link_mode = ETHTOOL_LINK_MODE_10000baseER_Full_BIT, 330 + .speed = NFP_SPEED_10G, 331 + }, 332 + [NFP_MEDIA_25GBASE_KR] = { 333 + .ethtool_link_mode = ETHTOOL_LINK_MODE_25000baseKR_Full_BIT, 334 + .speed = NFP_SPEED_25G, 335 + }, 336 + [NFP_MEDIA_25GBASE_KR_S] = { 337 + .ethtool_link_mode = ETHTOOL_LINK_MODE_25000baseKR_Full_BIT, 338 + .speed = NFP_SPEED_25G, 339 + }, 340 + [NFP_MEDIA_25GBASE_CR] = { 341 + .ethtool_link_mode = ETHTOOL_LINK_MODE_25000baseCR_Full_BIT, 342 + .speed = NFP_SPEED_25G, 343 + }, 344 + [NFP_MEDIA_25GBASE_CR_S] = { 345 + .ethtool_link_mode = ETHTOOL_LINK_MODE_25000baseCR_Full_BIT, 346 + .speed = NFP_SPEED_25G, 347 + }, 348 + [NFP_MEDIA_25GBASE_SR] = { 349 + .ethtool_link_mode = ETHTOOL_LINK_MODE_25000baseSR_Full_BIT, 350 + .speed = NFP_SPEED_25G, 351 + }, 352 + [NFP_MEDIA_40GBASE_CR4] = { 353 + .ethtool_link_mode = ETHTOOL_LINK_MODE_40000baseCR4_Full_BIT, 354 + .speed = NFP_SPEED_40G, 355 + }, 356 + [NFP_MEDIA_40GBASE_KR4] = { 357 + .ethtool_link_mode = ETHTOOL_LINK_MODE_40000baseKR4_Full_BIT, 358 + .speed = NFP_SPEED_40G, 359 + }, 360 + [NFP_MEDIA_40GBASE_SR4] = { 361 + .ethtool_link_mode = ETHTOOL_LINK_MODE_40000baseSR4_Full_BIT, 362 + .speed = NFP_SPEED_40G, 363 + }, 364 + [NFP_MEDIA_40GBASE_LR4] = { 365 + .ethtool_link_mode = ETHTOOL_LINK_MODE_40000baseLR4_Full_BIT, 366 + .speed = NFP_SPEED_40G, 367 + }, 368 + [NFP_MEDIA_50GBASE_KR] = { 369 + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseKR_Full_BIT, 370 + .speed = NFP_SPEED_50G, 371 + }, 372 + [NFP_MEDIA_50GBASE_SR] = { 373 + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseSR_Full_BIT, 374 + .speed = NFP_SPEED_50G, 375 + }, 376 + [NFP_MEDIA_50GBASE_CR] = { 377 + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseCR_Full_BIT, 378 + .speed = NFP_SPEED_50G, 379 + }, 380 + [NFP_MEDIA_50GBASE_LR] = { 381 + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT, 382 + .speed = NFP_SPEED_50G, 383 + }, 384 + [NFP_MEDIA_50GBASE_ER] = { 385 + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT, 386 + .speed = NFP_SPEED_50G, 387 + }, 388 + [NFP_MEDIA_50GBASE_FR] = { 389 + .ethtool_link_mode = ETHTOOL_LINK_MODE_50000baseLR_ER_FR_Full_BIT, 390 + .speed = NFP_SPEED_50G, 391 + }, 392 + [NFP_MEDIA_100GBASE_KR4] = { 393 + .ethtool_link_mode = ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT, 394 + .speed = NFP_SPEED_100G, 395 + }, 396 + [NFP_MEDIA_100GBASE_SR4] = { 397 + .ethtool_link_mode = ETHTOOL_LINK_MODE_100000baseSR4_Full_BIT, 398 + .speed = NFP_SPEED_100G, 399 + }, 400 + [NFP_MEDIA_100GBASE_CR4] = { 401 + .ethtool_link_mode = ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT, 402 + .speed = NFP_SPEED_100G, 403 + }, 404 + [NFP_MEDIA_100GBASE_KP4] = { 405 + .ethtool_link_mode = ETHTOOL_LINK_MODE_100000baseKR4_Full_BIT, 406 + .speed = NFP_SPEED_100G, 407 + }, 408 + [NFP_MEDIA_100GBASE_CR10] = { 409 + .ethtool_link_mode = ETHTOOL_LINK_MODE_100000baseCR4_Full_BIT, 410 + .speed = NFP_SPEED_100G, 411 + }, 412 + }; 413 + 414 + static const unsigned int nfp_eth_speed_map[NFP_SUP_SPEED_NUMBER] = { 415 + [NFP_SPEED_1G] = SPEED_1000, 416 + [NFP_SPEED_10G] = SPEED_10000, 417 + [NFP_SPEED_25G] = SPEED_25000, 418 + [NFP_SPEED_40G] = SPEED_40000, 419 + [NFP_SPEED_50G] = SPEED_50000, 420 + [NFP_SPEED_100G] = SPEED_100000, 325 421 }; 326 422 327 423 static void nfp_add_media_link_mode(struct nfp_port *port, ··· 430 334 }; 431 335 struct nfp_cpp *cpp = port->app->cpp; 432 336 433 - if (nfp_eth_read_media(cpp, &ethm)) 337 + if (nfp_eth_read_media(cpp, &ethm)) { 338 + bitmap_fill(port->speed_bitmap, NFP_SUP_SPEED_NUMBER); 434 339 return; 340 + } 341 + 342 + bitmap_zero(port->speed_bitmap, NFP_SUP_SPEED_NUMBER); 435 343 436 344 for (u32 i = 0; i < 2; i++) { 437 345 supported_modes[i] = le64_to_cpu(ethm.supported_modes[i]); ··· 444 344 445 345 for (u32 i = 0; i < NFP_MEDIA_LINK_MODES_NUMBER; i++) { 446 346 if (i < 64) { 447 - if (supported_modes[0] & BIT_ULL(i)) 448 - __set_bit(nfp_eth_media_table[i], 347 + if (supported_modes[0] & BIT_ULL(i)) { 348 + __set_bit(nfp_eth_media_table[i].ethtool_link_mode, 449 349 cmd->link_modes.supported); 350 + __set_bit(nfp_eth_media_table[i].speed, 351 + port->speed_bitmap); 352 + } 450 353 451 354 if (advertised_modes[0] & BIT_ULL(i)) 452 - __set_bit(nfp_eth_media_table[i], 355 + __set_bit(nfp_eth_media_table[i].ethtool_link_mode, 453 356 cmd->link_modes.advertising); 454 357 } else { 455 - if (supported_modes[1] & BIT_ULL(i - 64)) 456 - __set_bit(nfp_eth_media_table[i], 358 + if (supported_modes[1] & BIT_ULL(i - 64)) { 359 + __set_bit(nfp_eth_media_table[i].ethtool_link_mode, 457 360 cmd->link_modes.supported); 361 + __set_bit(nfp_eth_media_table[i].speed, 362 + port->speed_bitmap); 363 + } 458 364 459 365 if (advertised_modes[1] & BIT_ULL(i - 64)) 460 - __set_bit(nfp_eth_media_table[i], 366 + __set_bit(nfp_eth_media_table[i].ethtool_link_mode, 461 367 cmd->link_modes.advertising); 462 368 } 463 369 } ··· 574 468 575 469 if (cmd->base.speed != SPEED_UNKNOWN) { 576 470 u32 speed = cmd->base.speed / eth_port->lanes; 471 + bool is_supported = false; 472 + 473 + for (u32 i = 0; i < NFP_SUP_SPEED_NUMBER; i++) { 474 + if (cmd->base.speed == nfp_eth_speed_map[i] && 475 + test_bit(i, port->speed_bitmap)) { 476 + is_supported = true; 477 + break; 478 + } 479 + } 480 + 481 + if (!is_supported) { 482 + netdev_err(netdev, "Speed %u is not supported.\n", 483 + cmd->base.speed); 484 + err = -EINVAL; 485 + goto err_bad_set; 486 + } 577 487 578 488 if (req_aneg) { 579 489 netdev_err(netdev, "Speed changing is not allowed when working on autoneg mode.\n");
+12
drivers/net/ethernet/netronome/nfp/nfp_port.h
··· 38 38 NFP_PORT_CHANGED = 0, 39 39 }; 40 40 41 + enum { 42 + NFP_SPEED_1G, 43 + NFP_SPEED_10G, 44 + NFP_SPEED_25G, 45 + NFP_SPEED_40G, 46 + NFP_SPEED_50G, 47 + NFP_SPEED_100G, 48 + NFP_SUP_SPEED_NUMBER 49 + }; 50 + 41 51 /** 42 52 * struct nfp_port - structure representing NFP port 43 53 * @netdev: backpointer to associated netdev ··· 62 52 * @eth_forced: for %NFP_PORT_PHYS_PORT port is forced UP or DOWN, don't change 63 53 * @eth_port: for %NFP_PORT_PHYS_PORT translated ETH Table port entry 64 54 * @eth_stats: for %NFP_PORT_PHYS_PORT MAC stats if available 55 + * @speed_bitmap: for %NFP_PORT_PHYS_PORT supported speed bitmap 65 56 * @pf_id: for %NFP_PORT_PF_PORT, %NFP_PORT_VF_PORT ID of the PCI PF (0-3) 66 57 * @vf_id: for %NFP_PORT_VF_PORT ID of the PCI VF within @pf_id 67 58 * @pf_split: for %NFP_PORT_PF_PORT %true if PCI PF has more than one vNIC ··· 89 78 bool eth_forced; 90 79 struct nfp_eth_table_port *eth_port; 91 80 u8 __iomem *eth_stats; 81 + DECLARE_BITMAP(speed_bitmap, NFP_SUP_SPEED_NUMBER); 92 82 }; 93 83 /* NFP_PORT_PF_PORT, NFP_PORT_VF_PORT */ 94 84 struct {
+8 -1
drivers/net/ethernet/pensando/ionic/ionic_dev.c
··· 708 708 q->lif->index, q->name, q->hw_type, q->hw_index, 709 709 q->head_idx, ring_doorbell); 710 710 711 - if (ring_doorbell) 711 + if (ring_doorbell) { 712 712 ionic_dbell_ring(lif->kern_dbpage, q->hw_type, 713 713 q->dbval | q->head_idx); 714 + 715 + q->dbell_jiffies = jiffies; 716 + 717 + if (q_to_qcq(q)->napi_qcq) 718 + mod_timer(&q_to_qcq(q)->napi_qcq->napi_deadline, 719 + jiffies + IONIC_NAPI_DEADLINE); 720 + } 714 721 } 715 722 716 723 static bool ionic_q_is_posted(struct ionic_queue *q, unsigned int pos)
+12
drivers/net/ethernet/pensando/ionic/ionic_dev.h
··· 25 25 #define IONIC_DEV_INFO_REG_COUNT 32 26 26 #define IONIC_DEV_CMD_REG_COUNT 32 27 27 28 + #define IONIC_NAPI_DEADLINE (HZ / 200) /* 5ms */ 29 + #define IONIC_ADMIN_DOORBELL_DEADLINE (HZ / 2) /* 500ms */ 30 + #define IONIC_TX_DOORBELL_DEADLINE (HZ / 100) /* 10ms */ 31 + #define IONIC_RX_MIN_DOORBELL_DEADLINE (HZ / 100) /* 10ms */ 32 + #define IONIC_RX_MAX_DOORBELL_DEADLINE (HZ * 5) /* 5s */ 33 + 28 34 struct ionic_dev_bar { 29 35 void __iomem *vaddr; 30 36 phys_addr_t bus_addr; ··· 222 216 struct ionic_lif *lif; 223 217 struct ionic_desc_info *info; 224 218 u64 dbval; 219 + unsigned long dbell_deadline; 220 + unsigned long dbell_jiffies; 225 221 u16 head_idx; 226 222 u16 tail_idx; 227 223 unsigned int index; ··· 368 360 unsigned int stop_index); 369 361 int ionic_heartbeat_check(struct ionic *ionic); 370 362 bool ionic_is_fw_running(struct ionic_dev *idev); 363 + 364 + bool ionic_adminq_poke_doorbell(struct ionic_queue *q); 365 + bool ionic_txq_poke_doorbell(struct ionic_queue *q); 366 + bool ionic_rxq_poke_doorbell(struct ionic_queue *q); 371 367 372 368 #endif /* _IONIC_DEV_H_ */
+59 -9
drivers/net/ethernet/pensando/ionic/ionic_lif.c
··· 16 16 17 17 #include "ionic.h" 18 18 #include "ionic_bus.h" 19 + #include "ionic_dev.h" 19 20 #include "ionic_lif.h" 20 21 #include "ionic_txrx.h" 21 22 #include "ionic_ethtool.h" ··· 201 200 } 202 201 } 203 202 203 + static void ionic_napi_deadline(struct timer_list *timer) 204 + { 205 + struct ionic_qcq *qcq = container_of(timer, struct ionic_qcq, napi_deadline); 206 + 207 + napi_schedule(&qcq->napi); 208 + } 209 + 204 210 static irqreturn_t ionic_isr(int irq, void *data) 205 211 { 206 212 struct napi_struct *napi = data; ··· 277 269 .oper = IONIC_Q_ENABLE, 278 270 }, 279 271 }; 272 + int ret; 280 273 281 274 idev = &lif->ionic->idev; 282 275 dev = lif->ionic->dev; ··· 285 276 dev_dbg(dev, "q_enable.index %d q_enable.qtype %d\n", 286 277 ctx.cmd.q_control.index, ctx.cmd.q_control.type); 287 278 279 + if (qcq->flags & IONIC_QCQ_F_INTR) 280 + ionic_intr_clean(idev->intr_ctrl, qcq->intr.index); 281 + 282 + ret = ionic_adminq_post_wait(lif, &ctx); 283 + if (ret) 284 + return ret; 285 + 286 + if (qcq->napi.poll) 287 + napi_enable(&qcq->napi); 288 + 288 289 if (qcq->flags & IONIC_QCQ_F_INTR) { 289 290 irq_set_affinity_hint(qcq->intr.vector, 290 291 &qcq->intr.affinity_mask); 291 - napi_enable(&qcq->napi); 292 - ionic_intr_clean(idev->intr_ctrl, qcq->intr.index); 293 292 ionic_intr_mask(idev->intr_ctrl, qcq->intr.index, 294 293 IONIC_INTR_MASK_CLEAR); 295 294 } 296 295 297 - return ionic_adminq_post_wait(lif, &ctx); 296 + return 0; 298 297 } 299 298 300 299 static int ionic_qcq_disable(struct ionic_lif *lif, struct ionic_qcq *qcq, int fw_err) ··· 333 316 synchronize_irq(qcq->intr.vector); 334 317 irq_set_affinity_hint(qcq->intr.vector, NULL); 335 318 napi_disable(&qcq->napi); 319 + del_timer_sync(&qcq->napi_deadline); 336 320 } 337 321 338 322 /* If there was a previous fw communcation error, don't bother with ··· 469 451 470 452 n_qcq->intr.vector = src_qcq->intr.vector; 471 453 n_qcq->intr.index = src_qcq->intr.index; 454 + n_qcq->napi_qcq = src_qcq->napi_qcq; 472 455 } 473 456 474 457 static int ionic_alloc_qcq_interrupt(struct ionic_lif *lif, struct ionic_qcq *qcq) ··· 583 564 } 584 565 585 566 if (flags & IONIC_QCQ_F_NOTIFYQ) { 586 - int q_size, cq_size; 567 + int q_size; 587 568 588 - /* q & cq need to be contiguous in case of notifyq */ 569 + /* q & cq need to be contiguous in NotifyQ, so alloc it all in q 570 + * and don't alloc qc. We leave new->qc_size and new->qc_base 571 + * as 0 to be sure we don't try to free it later. 572 + */ 589 573 q_size = ALIGN(num_descs * desc_size, PAGE_SIZE); 590 - cq_size = ALIGN(num_descs * cq_desc_size, PAGE_SIZE); 591 - 592 - new->q_size = PAGE_SIZE + q_size + cq_size; 574 + new->q_size = PAGE_SIZE + q_size + 575 + ALIGN(num_descs * cq_desc_size, PAGE_SIZE); 593 576 new->q_base = dma_alloc_coherent(dev, new->q_size, 594 577 &new->q_base_pa, GFP_KERNEL); 595 578 if (!new->q_base) { ··· 794 773 dev_dbg(dev, "txq->hw_type %d\n", q->hw_type); 795 774 dev_dbg(dev, "txq->hw_index %d\n", q->hw_index); 796 775 797 - if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) 776 + q->dbell_deadline = IONIC_TX_DOORBELL_DEADLINE; 777 + q->dbell_jiffies = jiffies; 778 + 779 + if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) { 798 780 netif_napi_add(lif->netdev, &qcq->napi, ionic_tx_napi); 781 + qcq->napi_qcq = qcq; 782 + timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0); 783 + } 799 784 800 785 qcq->flags |= IONIC_QCQ_F_INITED; 801 786 ··· 855 828 dev_dbg(dev, "rxq->hw_type %d\n", q->hw_type); 856 829 dev_dbg(dev, "rxq->hw_index %d\n", q->hw_index); 857 830 831 + q->dbell_deadline = IONIC_RX_MIN_DOORBELL_DEADLINE; 832 + q->dbell_jiffies = jiffies; 833 + 858 834 if (test_bit(IONIC_LIF_F_SPLIT_INTR, lif->state)) 859 835 netif_napi_add(lif->netdev, &qcq->napi, ionic_rx_napi); 860 836 else 861 837 netif_napi_add(lif->netdev, &qcq->napi, ionic_txrx_napi); 838 + 839 + qcq->napi_qcq = qcq; 840 + timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0); 862 841 863 842 qcq->flags |= IONIC_QCQ_F_INITED; 864 843 ··· 1183 1150 struct ionic_dev *idev = &lif->ionic->idev; 1184 1151 unsigned long irqflags; 1185 1152 unsigned int flags = 0; 1153 + bool resched = false; 1186 1154 int rx_work = 0; 1187 1155 int tx_work = 0; 1188 1156 int n_work = 0; ··· 1220 1186 credits = n_work + a_work + rx_work + tx_work; 1221 1187 ionic_intr_credits(idev->intr_ctrl, intr->index, credits, flags); 1222 1188 } 1189 + 1190 + if (!a_work && ionic_adminq_poke_doorbell(&lif->adminqcq->q)) 1191 + resched = true; 1192 + if (lif->hwstamp_rxq && !rx_work && ionic_rxq_poke_doorbell(&lif->hwstamp_rxq->q)) 1193 + resched = true; 1194 + if (lif->hwstamp_txq && !tx_work && ionic_txq_poke_doorbell(&lif->hwstamp_txq->q)) 1195 + resched = true; 1196 + if (resched) 1197 + mod_timer(&lif->adminqcq->napi_deadline, 1198 + jiffies + IONIC_NAPI_DEADLINE); 1223 1199 1224 1200 return work_done; 1225 1201 } ··· 3289 3245 dev_dbg(dev, "adminq->hw_type %d\n", q->hw_type); 3290 3246 dev_dbg(dev, "adminq->hw_index %d\n", q->hw_index); 3291 3247 3248 + q->dbell_deadline = IONIC_ADMIN_DOORBELL_DEADLINE; 3249 + q->dbell_jiffies = jiffies; 3250 + 3292 3251 netif_napi_add(lif->netdev, &qcq->napi, ionic_adminq_napi); 3252 + 3253 + qcq->napi_qcq = qcq; 3254 + timer_setup(&qcq->napi_deadline, ionic_napi_deadline, 0); 3293 3255 3294 3256 napi_enable(&qcq->napi); 3295 3257
+2
drivers/net/ethernet/pensando/ionic/ionic_lif.h
··· 74 74 struct ionic_queue q; 75 75 struct ionic_cq cq; 76 76 struct ionic_intr_info intr; 77 + struct timer_list napi_deadline; 77 78 struct napi_struct napi; 78 79 unsigned int flags; 80 + struct ionic_qcq *napi_qcq; 79 81 struct dentry *dentry; 80 82 }; 81 83
+29
drivers/net/ethernet/pensando/ionic/ionic_main.c
··· 289 289 complete_all(&ctx->work); 290 290 } 291 291 292 + bool ionic_adminq_poke_doorbell(struct ionic_queue *q) 293 + { 294 + struct ionic_lif *lif = q->lif; 295 + unsigned long now, then, dif; 296 + unsigned long irqflags; 297 + 298 + spin_lock_irqsave(&lif->adminq_lock, irqflags); 299 + 300 + if (q->tail_idx == q->head_idx) { 301 + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); 302 + return false; 303 + } 304 + 305 + now = READ_ONCE(jiffies); 306 + then = q->dbell_jiffies; 307 + dif = now - then; 308 + 309 + if (dif > q->dbell_deadline) { 310 + ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, 311 + q->dbval | q->head_idx); 312 + 313 + q->dbell_jiffies = now; 314 + } 315 + 316 + spin_unlock_irqrestore(&lif->adminq_lock, irqflags); 317 + 318 + return true; 319 + } 320 + 292 321 int ionic_adminq_post(struct ionic_lif *lif, struct ionic_admin_ctx *ctx) 293 322 { 294 323 struct ionic_desc_info *desc_info;
+85 -2
drivers/net/ethernet/pensando/ionic/ionic_txrx.c
··· 22 22 ionic_q_post(q, ring_dbell, cb_func, cb_arg); 23 23 } 24 24 25 + bool ionic_txq_poke_doorbell(struct ionic_queue *q) 26 + { 27 + unsigned long now, then, dif; 28 + struct netdev_queue *netdev_txq; 29 + struct net_device *netdev; 30 + 31 + netdev = q->lif->netdev; 32 + netdev_txq = netdev_get_tx_queue(netdev, q->index); 33 + 34 + HARD_TX_LOCK(netdev, netdev_txq, smp_processor_id()); 35 + 36 + if (q->tail_idx == q->head_idx) { 37 + HARD_TX_UNLOCK(netdev, netdev_txq); 38 + return false; 39 + } 40 + 41 + now = READ_ONCE(jiffies); 42 + then = q->dbell_jiffies; 43 + dif = now - then; 44 + 45 + if (dif > q->dbell_deadline) { 46 + ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, 47 + q->dbval | q->head_idx); 48 + 49 + q->dbell_jiffies = now; 50 + } 51 + 52 + HARD_TX_UNLOCK(netdev, netdev_txq); 53 + 54 + return true; 55 + } 56 + 57 + bool ionic_rxq_poke_doorbell(struct ionic_queue *q) 58 + { 59 + unsigned long now, then, dif; 60 + 61 + /* no lock, called from rx napi or txrx napi, nothing else can fill */ 62 + 63 + if (q->tail_idx == q->head_idx) 64 + return false; 65 + 66 + now = READ_ONCE(jiffies); 67 + then = q->dbell_jiffies; 68 + dif = now - then; 69 + 70 + if (dif > q->dbell_deadline) { 71 + ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, 72 + q->dbval | q->head_idx); 73 + 74 + q->dbell_jiffies = now; 75 + 76 + dif = 2 * q->dbell_deadline; 77 + if (dif > IONIC_RX_MAX_DOORBELL_DEADLINE) 78 + dif = IONIC_RX_MAX_DOORBELL_DEADLINE; 79 + 80 + q->dbell_deadline = dif; 81 + } 82 + 83 + return true; 84 + } 85 + 25 86 static inline struct netdev_queue *q_to_ndq(struct ionic_queue *q) 26 87 { 27 88 return netdev_get_tx_queue(q->lif->netdev, q->index); ··· 485 424 486 425 ionic_dbell_ring(q->lif->kern_dbpage, q->hw_type, 487 426 q->dbval | q->head_idx); 427 + 428 + q->dbell_deadline = IONIC_RX_MIN_DOORBELL_DEADLINE; 429 + q->dbell_jiffies = jiffies; 430 + 431 + mod_timer(&q_to_qcq(q)->napi_qcq->napi_deadline, 432 + jiffies + IONIC_NAPI_DEADLINE); 488 433 } 489 434 490 435 void ionic_rx_empty(struct ionic_queue *q) ··· 578 511 work_done, flags); 579 512 } 580 513 514 + if (!work_done && ionic_txq_poke_doorbell(&qcq->q)) 515 + mod_timer(&qcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE); 516 + 581 517 return work_done; 582 518 } 583 519 ··· 614 544 work_done, flags); 615 545 } 616 546 547 + if (!work_done && ionic_rxq_poke_doorbell(&qcq->q)) 548 + mod_timer(&qcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE); 549 + 617 550 return work_done; 618 551 } 619 552 620 553 int ionic_txrx_napi(struct napi_struct *napi, int budget) 621 554 { 622 - struct ionic_qcq *qcq = napi_to_qcq(napi); 555 + struct ionic_qcq *rxqcq = napi_to_qcq(napi); 623 556 struct ionic_cq *rxcq = napi_to_cq(napi); 624 557 unsigned int qi = rxcq->bound_q->index; 558 + struct ionic_qcq *txqcq; 625 559 struct ionic_dev *idev; 626 560 struct ionic_lif *lif; 627 561 struct ionic_cq *txcq; 562 + bool resched = false; 628 563 u32 rx_work_done = 0; 629 564 u32 tx_work_done = 0; 630 565 u32 flags = 0; 631 566 632 567 lif = rxcq->bound_q->lif; 633 568 idev = &lif->ionic->idev; 569 + txqcq = lif->txqcqs[qi]; 634 570 txcq = &lif->txqcqs[qi]->cq; 635 571 636 572 tx_work_done = ionic_cq_service(txcq, IONIC_TX_BUDGET_DEFAULT, ··· 648 572 ionic_rx_fill(rxcq->bound_q); 649 573 650 574 if (rx_work_done < budget && napi_complete_done(napi, rx_work_done)) { 651 - ionic_dim_update(qcq, 0); 575 + ionic_dim_update(rxqcq, 0); 652 576 flags |= IONIC_INTR_CRED_UNMASK; 653 577 rxcq->bound_intr->rearm_count++; 654 578 } ··· 658 582 ionic_intr_credits(idev->intr_ctrl, rxcq->bound_intr->index, 659 583 tx_work_done + rx_work_done, flags); 660 584 } 585 + 586 + if (!rx_work_done && ionic_rxq_poke_doorbell(&rxqcq->q)) 587 + resched = true; 588 + if (!tx_work_done && ionic_txq_poke_doorbell(&txqcq->q)) 589 + resched = true; 590 + if (resched) 591 + mod_timer(&rxqcq->napi_deadline, jiffies + IONIC_NAPI_DEADLINE); 661 592 662 593 return rx_work_done; 663 594 }
+1 -1
drivers/net/hyperv/netvsc.c
··· 1034 1034 1035 1035 packet->dma_range = kcalloc(page_count, 1036 1036 sizeof(*packet->dma_range), 1037 - GFP_KERNEL); 1037 + GFP_ATOMIC); 1038 1038 if (!packet->dma_range) 1039 1039 return -ENOMEM; 1040 1040
+2
drivers/net/phy/meson-gxl.c
··· 261 261 .handle_interrupt = meson_gxl_handle_interrupt, 262 262 .suspend = genphy_suspend, 263 263 .resume = genphy_resume, 264 + .read_mmd = genphy_read_mmd_unsupported, 265 + .write_mmd = genphy_write_mmd_unsupported, 264 266 }, { 265 267 PHY_ID_MATCH_EXACT(0x01803301), 266 268 .name = "Meson G12A Internal PHY",
+2 -3
drivers/net/phy/phylink.c
··· 1812 1812 1813 1813 ret = phy_attach_direct(pl->netdev, phy_dev, flags, 1814 1814 pl->link_interface); 1815 - if (ret) { 1816 - phy_device_free(phy_dev); 1815 + phy_device_free(phy_dev); 1816 + if (ret) 1817 1817 return ret; 1818 - } 1819 1818 1820 1819 ret = phylink_bringup_phy(pl, phy_dev, pl->link_config.interface); 1821 1820 if (ret)
+19
drivers/nvdimm/Kconfig
··· 102 102 depends on ENCRYPTED_KEYS 103 103 depends on (LIBNVDIMM=ENCRYPTED_KEYS) || LIBNVDIMM=m 104 104 105 + config NVDIMM_KMSAN 106 + bool 107 + depends on KMSAN 108 + help 109 + KMSAN, and other memory debug facilities, increase the size of 110 + 'struct page' to contain extra metadata. This collides with 111 + the NVDIMM capability to store a potentially 112 + larger-than-"System RAM" size 'struct page' array in a 113 + reservation of persistent memory rather than limited / 114 + precious DRAM. However, that reservation needs to persist for 115 + the life of the given NVDIMM namespace. If you are using KMSAN 116 + to debug an issue unrelated to NVDIMMs or DAX then say N to this 117 + option. Otherwise, say Y but understand that any namespaces 118 + (with the page array stored pmem) created with this build of 119 + the kernel will permanently reserve and strand excess 120 + capacity compared to the CONFIG_KMSAN=n case. 121 + 122 + Select N if unsure. 123 + 105 124 config NVDIMM_TEST_BUILD 106 125 tristate "Build the unit test core" 107 126 depends on m
+1 -1
drivers/nvdimm/nd.h
··· 652 652 struct nd_namespace_common *ndns); 653 653 #if IS_ENABLED(CONFIG_ND_CLAIM) 654 654 /* max struct page size independent of kernel config */ 655 - #define MAX_STRUCT_PAGE_SIZE 128 655 + #define MAX_STRUCT_PAGE_SIZE 64 656 656 int nvdimm_setup_pfn(struct nd_pfn *nd_pfn, struct dev_pagemap *pgmap); 657 657 #else 658 658 static inline int nvdimm_setup_pfn(struct nd_pfn *nd_pfn,
+27 -15
drivers/nvdimm/pfn_devs.c
··· 13 13 #include "pfn.h" 14 14 #include "nd.h" 15 15 16 + static const bool page_struct_override = IS_ENABLED(CONFIG_NVDIMM_KMSAN); 17 + 16 18 static void nd_pfn_release(struct device *dev) 17 19 { 18 20 struct nd_region *nd_region = to_nd_region(dev->parent); ··· 760 758 return -ENXIO; 761 759 } 762 760 763 - /* 764 - * Note, we use 64 here for the standard size of struct page, 765 - * debugging options may cause it to be larger in which case the 766 - * implementation will limit the pfns advertised through 767 - * ->direct_access() to those that are included in the memmap. 768 - */ 769 761 start = nsio->res.start; 770 762 size = resource_size(&nsio->res); 771 763 npfns = PHYS_PFN(size - SZ_8K); ··· 778 782 } 779 783 end_trunc = start + size - ALIGN_DOWN(start + size, align); 780 784 if (nd_pfn->mode == PFN_MODE_PMEM) { 785 + unsigned long page_map_size = MAX_STRUCT_PAGE_SIZE * npfns; 786 + 781 787 /* 782 788 * The altmap should be padded out to the block size used 783 789 * when populating the vmemmap. This *should* be equal to 784 790 * PMD_SIZE for most architectures. 785 791 * 786 - * Also make sure size of struct page is less than 128. We 787 - * want to make sure we use large enough size here so that 788 - * we don't have a dynamic reserve space depending on 789 - * struct page size. But we also want to make sure we notice 790 - * when we end up adding new elements to struct page. 792 + * Also make sure size of struct page is less than 793 + * MAX_STRUCT_PAGE_SIZE. The goal here is compatibility in the 794 + * face of production kernel configurations that reduce the 795 + * 'struct page' size below MAX_STRUCT_PAGE_SIZE. For debug 796 + * kernel configurations that increase the 'struct page' size 797 + * above MAX_STRUCT_PAGE_SIZE, the page_struct_override allows 798 + * for continuing with the capacity that will be wasted when 799 + * reverting to a production kernel configuration. Otherwise, 800 + * those configurations are blocked by default. 791 801 */ 792 - BUILD_BUG_ON(sizeof(struct page) > MAX_STRUCT_PAGE_SIZE); 793 - offset = ALIGN(start + SZ_8K + MAX_STRUCT_PAGE_SIZE * npfns, align) 794 - - start; 802 + if (sizeof(struct page) > MAX_STRUCT_PAGE_SIZE) { 803 + if (page_struct_override) 804 + page_map_size = sizeof(struct page) * npfns; 805 + else { 806 + dev_err(&nd_pfn->dev, 807 + "Memory debug options prevent using pmem for the page map\n"); 808 + return -EINVAL; 809 + } 810 + } 811 + offset = ALIGN(start + SZ_8K + page_map_size, align) - start; 795 812 } else if (nd_pfn->mode == PFN_MODE_RAM) 796 813 offset = ALIGN(start + SZ_8K, align) - start; 797 814 else ··· 827 818 pfn_sb->version_minor = cpu_to_le16(4); 828 819 pfn_sb->end_trunc = cpu_to_le32(end_trunc); 829 820 pfn_sb->align = cpu_to_le32(nd_pfn->align); 830 - pfn_sb->page_struct_size = cpu_to_le16(MAX_STRUCT_PAGE_SIZE); 821 + if (sizeof(struct page) > MAX_STRUCT_PAGE_SIZE && page_struct_override) 822 + pfn_sb->page_struct_size = cpu_to_le16(sizeof(struct page)); 823 + else 824 + pfn_sb->page_struct_size = cpu_to_le16(MAX_STRUCT_PAGE_SIZE); 831 825 pfn_sb->page_size = cpu_to_le32(PAGE_SIZE); 832 826 checksum = nd_sb_checksum((struct nd_gen_sb *) pfn_sb); 833 827 pfn_sb->checksum = cpu_to_le64(checksum);
+1 -1
drivers/nvme/host/auth.c
··· 45 45 int sess_key_len; 46 46 }; 47 47 48 - struct workqueue_struct *nvme_auth_wq; 48 + static struct workqueue_struct *nvme_auth_wq; 49 49 50 50 #define nvme_auth_flags_from_qid(qid) \ 51 51 (qid == 0) ? 0 : BLK_MQ_REQ_NOWAIT | BLK_MQ_REQ_RESERVED
+15 -6
drivers/of/address.c
··· 965 965 } 966 966 967 967 of_dma_range_parser_init(&parser, node); 968 - for_each_of_range(&parser, &range) 968 + for_each_of_range(&parser, &range) { 969 + if (range.cpu_addr == OF_BAD_ADDR) { 970 + pr_err("translation of DMA address(%llx) to CPU address failed node(%pOF)\n", 971 + range.bus_addr, node); 972 + continue; 973 + } 969 974 num_ranges++; 975 + } 976 + 977 + if (!num_ranges) { 978 + ret = -EINVAL; 979 + goto out; 980 + } 970 981 971 982 r = kcalloc(num_ranges + 1, sizeof(*r), GFP_KERNEL); 972 983 if (!r) { ··· 986 975 } 987 976 988 977 /* 989 - * Record all info in the generic DMA ranges array for struct device. 978 + * Record all info in the generic DMA ranges array for struct device, 979 + * returning an error if we don't find any parsable ranges. 990 980 */ 991 981 *map = r; 992 982 of_dma_range_parser_init(&parser, node); 993 983 for_each_of_range(&parser, &range) { 994 984 pr_debug("dma_addr(%llx) cpu_addr(%llx) size(%llx)\n", 995 985 range.bus_addr, range.cpu_addr, range.size); 996 - if (range.cpu_addr == OF_BAD_ADDR) { 997 - pr_err("translation of DMA address(%llx) to CPU address failed node(%pOF)\n", 998 - range.bus_addr, node); 986 + if (range.cpu_addr == OF_BAD_ADDR) 999 987 continue; 1000 - } 1001 988 r->cpu_start = range.cpu_addr; 1002 989 r->dma_start = range.bus_addr; 1003 990 r->size = range.size;
+10 -2
drivers/of/platform.c
··· 525 525 if (IS_ENABLED(CONFIG_PPC)) { 526 526 struct device_node *boot_display = NULL; 527 527 struct platform_device *dev; 528 + int display_number = 0; 528 529 int ret; 529 530 530 531 /* Check if we have a MacOS display without a node spec */ ··· 556 555 if (!of_get_property(node, "linux,opened", NULL) || 557 556 !of_get_property(node, "linux,boot-display", NULL)) 558 557 continue; 559 - dev = of_platform_device_create(node, "of-display", NULL); 558 + dev = of_platform_device_create(node, "of-display.0", NULL); 559 + of_node_put(node); 560 560 if (WARN_ON(!dev)) 561 561 return -ENOMEM; 562 562 boot_display = node; 563 + display_number++; 563 564 break; 564 565 } 565 566 for_each_node_by_type(node, "display") { 567 + char buf[14]; 568 + const char *of_display_format = "of-display.%d"; 569 + 566 570 if (!of_get_property(node, "linux,opened", NULL) || node == boot_display) 567 571 continue; 568 - of_platform_device_create(node, "of-display", NULL); 572 + ret = snprintf(buf, sizeof(buf), of_display_format, display_number++); 573 + if (ret < sizeof(buf)) 574 + of_platform_device_create(node, buf, NULL); 569 575 } 570 576 571 577 } else {
-7
drivers/pci/pci.c
··· 1665 1665 return i; 1666 1666 1667 1667 pci_save_ltr_state(dev); 1668 - pci_save_aspm_l1ss_state(dev); 1669 1668 pci_save_dpc_state(dev); 1670 1669 pci_save_aer_state(dev); 1671 1670 pci_save_ptm_state(dev); ··· 1771 1772 * LTR itself (in the PCIe capability). 1772 1773 */ 1773 1774 pci_restore_ltr_state(dev); 1774 - pci_restore_aspm_l1ss_state(dev); 1775 1775 1776 1776 pci_restore_pcie_state(dev); 1777 1777 pci_restore_pasid_state(dev); ··· 3462 3464 2 * sizeof(u16)); 3463 3465 if (error) 3464 3466 pci_err(dev, "unable to allocate suspend buffer for LTR\n"); 3465 - 3466 - error = pci_add_ext_cap_save_buffer(dev, PCI_EXT_CAP_ID_L1SS, 3467 - 2 * sizeof(u32)); 3468 - if (error) 3469 - pci_err(dev, "unable to allocate suspend buffer for ASPM-L1SS\n"); 3470 3467 3471 3468 pci_allocate_vc_save_buffers(dev); 3472 3469 }
-4
drivers/pci/pci.h
··· 566 566 void pcie_aspm_init_link_state(struct pci_dev *pdev); 567 567 void pcie_aspm_exit_link_state(struct pci_dev *pdev); 568 568 void pcie_aspm_powersave_config_link(struct pci_dev *pdev); 569 - void pci_save_aspm_l1ss_state(struct pci_dev *dev); 570 - void pci_restore_aspm_l1ss_state(struct pci_dev *dev); 571 569 #else 572 570 static inline void pcie_aspm_init_link_state(struct pci_dev *pdev) { } 573 571 static inline void pcie_aspm_exit_link_state(struct pci_dev *pdev) { } 574 572 static inline void pcie_aspm_powersave_config_link(struct pci_dev *pdev) { } 575 - static inline void pci_save_aspm_l1ss_state(struct pci_dev *dev) { } 576 - static inline void pci_restore_aspm_l1ss_state(struct pci_dev *dev) { } 577 573 #endif 578 574 579 575 #ifdef CONFIG_PCIE_ECRC
+33 -76
drivers/pci/pcie/aspm.c
··· 470 470 pci_write_config_dword(pdev, pos, val); 471 471 } 472 472 473 - static void aspm_program_l1ss(struct pci_dev *dev, u32 ctl1, u32 ctl2) 474 - { 475 - u16 l1ss = dev->l1ss; 476 - u32 l1_2_enable; 477 - 478 - /* 479 - * Per PCIe r6.0, sec 5.5.4, T_POWER_ON in PCI_L1SS_CTL2 must be 480 - * programmed prior to setting the L1.2 enable bits in PCI_L1SS_CTL1. 481 - */ 482 - pci_write_config_dword(dev, l1ss + PCI_L1SS_CTL2, ctl2); 483 - 484 - /* 485 - * In addition, Common_Mode_Restore_Time and LTR_L1.2_THRESHOLD in 486 - * PCI_L1SS_CTL1 must be programmed *before* setting the L1.2 487 - * enable bits, even though they're all in PCI_L1SS_CTL1. 488 - */ 489 - l1_2_enable = ctl1 & PCI_L1SS_CTL1_L1_2_MASK; 490 - ctl1 &= ~PCI_L1SS_CTL1_L1_2_MASK; 491 - 492 - pci_write_config_dword(dev, l1ss + PCI_L1SS_CTL1, ctl1); 493 - if (l1_2_enable) 494 - pci_write_config_dword(dev, l1ss + PCI_L1SS_CTL1, 495 - ctl1 | l1_2_enable); 496 - } 497 - 498 473 /* Calculate L1.2 PM substate timing parameters */ 499 474 static void aspm_calc_l1ss_info(struct pcie_link_state *link, 500 475 u32 parent_l1ss_cap, u32 child_l1ss_cap) ··· 479 504 u32 t_common_mode, t_power_on, l1_2_threshold, scale, value; 480 505 u32 ctl1 = 0, ctl2 = 0; 481 506 u32 pctl1, pctl2, cctl1, cctl2; 507 + u32 pl1_2_enables, cl1_2_enables; 482 508 483 509 if (!(link->aspm_support & ASPM_STATE_L1_2_MASK)) 484 510 return; ··· 528 552 ctl2 == pctl2 && ctl2 == cctl2) 529 553 return; 530 554 531 - pctl1 &= ~(PCI_L1SS_CTL1_CM_RESTORE_TIME | 532 - PCI_L1SS_CTL1_LTR_L12_TH_VALUE | 533 - PCI_L1SS_CTL1_LTR_L12_TH_SCALE); 534 - pctl1 |= (ctl1 & (PCI_L1SS_CTL1_CM_RESTORE_TIME | 535 - PCI_L1SS_CTL1_LTR_L12_TH_VALUE | 536 - PCI_L1SS_CTL1_LTR_L12_TH_SCALE)); 537 - aspm_program_l1ss(parent, pctl1, ctl2); 555 + /* Disable L1.2 while updating. See PCIe r5.0, sec 5.5.4, 7.8.3.3 */ 556 + pl1_2_enables = pctl1 & PCI_L1SS_CTL1_L1_2_MASK; 557 + cl1_2_enables = cctl1 & PCI_L1SS_CTL1_L1_2_MASK; 538 558 539 - cctl1 &= ~(PCI_L1SS_CTL1_CM_RESTORE_TIME | 540 - PCI_L1SS_CTL1_LTR_L12_TH_VALUE | 541 - PCI_L1SS_CTL1_LTR_L12_TH_SCALE); 542 - cctl1 |= (ctl1 & (PCI_L1SS_CTL1_CM_RESTORE_TIME | 543 - PCI_L1SS_CTL1_LTR_L12_TH_VALUE | 544 - PCI_L1SS_CTL1_LTR_L12_TH_SCALE)); 545 - aspm_program_l1ss(child, cctl1, ctl2); 559 + if (pl1_2_enables || cl1_2_enables) { 560 + pci_clear_and_set_dword(child, child->l1ss + PCI_L1SS_CTL1, 561 + PCI_L1SS_CTL1_L1_2_MASK, 0); 562 + pci_clear_and_set_dword(parent, parent->l1ss + PCI_L1SS_CTL1, 563 + PCI_L1SS_CTL1_L1_2_MASK, 0); 564 + } 565 + 566 + /* Program T_POWER_ON times in both ports */ 567 + pci_write_config_dword(parent, parent->l1ss + PCI_L1SS_CTL2, ctl2); 568 + pci_write_config_dword(child, child->l1ss + PCI_L1SS_CTL2, ctl2); 569 + 570 + /* Program Common_Mode_Restore_Time in upstream device */ 571 + pci_clear_and_set_dword(parent, parent->l1ss + PCI_L1SS_CTL1, 572 + PCI_L1SS_CTL1_CM_RESTORE_TIME, ctl1); 573 + 574 + /* Program LTR_L1.2_THRESHOLD time in both ports */ 575 + pci_clear_and_set_dword(parent, parent->l1ss + PCI_L1SS_CTL1, 576 + PCI_L1SS_CTL1_LTR_L12_TH_VALUE | 577 + PCI_L1SS_CTL1_LTR_L12_TH_SCALE, ctl1); 578 + pci_clear_and_set_dword(child, child->l1ss + PCI_L1SS_CTL1, 579 + PCI_L1SS_CTL1_LTR_L12_TH_VALUE | 580 + PCI_L1SS_CTL1_LTR_L12_TH_SCALE, ctl1); 581 + 582 + if (pl1_2_enables || cl1_2_enables) { 583 + pci_clear_and_set_dword(parent, parent->l1ss + PCI_L1SS_CTL1, 0, 584 + pl1_2_enables); 585 + pci_clear_and_set_dword(child, child->l1ss + PCI_L1SS_CTL1, 0, 586 + cl1_2_enables); 587 + } 546 588 } 547 589 548 590 static void aspm_l1ss_init(struct pcie_link_state *link) ··· 749 755 PCI_L1SS_CTL1_L1SS_MASK, val); 750 756 pci_clear_and_set_dword(child, child->l1ss + PCI_L1SS_CTL1, 751 757 PCI_L1SS_CTL1_L1SS_MASK, val); 752 - } 753 - 754 - void pci_save_aspm_l1ss_state(struct pci_dev *dev) 755 - { 756 - struct pci_cap_saved_state *save_state; 757 - u16 l1ss = dev->l1ss; 758 - u32 *cap; 759 - 760 - if (!l1ss) 761 - return; 762 - 763 - save_state = pci_find_saved_ext_cap(dev, PCI_EXT_CAP_ID_L1SS); 764 - if (!save_state) 765 - return; 766 - 767 - cap = (u32 *)&save_state->cap.data[0]; 768 - pci_read_config_dword(dev, l1ss + PCI_L1SS_CTL2, cap++); 769 - pci_read_config_dword(dev, l1ss + PCI_L1SS_CTL1, cap++); 770 - } 771 - 772 - void pci_restore_aspm_l1ss_state(struct pci_dev *dev) 773 - { 774 - struct pci_cap_saved_state *save_state; 775 - u32 *cap, ctl1, ctl2; 776 - u16 l1ss = dev->l1ss; 777 - 778 - if (!l1ss) 779 - return; 780 - 781 - save_state = pci_find_saved_ext_cap(dev, PCI_EXT_CAP_ID_L1SS); 782 - if (!save_state) 783 - return; 784 - 785 - cap = (u32 *)&save_state->cap.data[0]; 786 - ctl2 = *cap++; 787 - ctl1 = *cap; 788 - aspm_program_l1ss(dev, ctl1, ctl2); 789 758 } 790 759 791 760 static void pcie_config_aspm_dev(struct pci_dev *pdev, u32 val)
+11 -2
drivers/pinctrl/aspeed/pinctrl-aspeed.c
··· 93 93 static int aspeed_sig_expr_disable(struct aspeed_pinmux_data *ctx, 94 94 const struct aspeed_sig_expr *expr) 95 95 { 96 + int ret; 97 + 96 98 pr_debug("Disabling signal %s for %s\n", expr->signal, 97 99 expr->function); 98 100 99 - return aspeed_sig_expr_set(ctx, expr, false); 101 + ret = aspeed_sig_expr_eval(ctx, expr, true); 102 + if (ret < 0) 103 + return ret; 104 + 105 + if (ret) 106 + return aspeed_sig_expr_set(ctx, expr, false); 107 + 108 + return 0; 100 109 } 101 110 102 111 /** ··· 123 114 int ret = 0; 124 115 125 116 if (!exprs) 126 - return true; 117 + return -EINVAL; 127 118 128 119 while (*exprs && !ret) { 129 120 ret = aspeed_sig_expr_disable(ctx, *exprs);
+13 -3
drivers/pinctrl/intel/pinctrl-intel.c
··· 1709 1709 EXPORT_SYMBOL_GPL(intel_pinctrl_get_soc_data); 1710 1710 1711 1711 #ifdef CONFIG_PM_SLEEP 1712 + static bool __intel_gpio_is_direct_irq(u32 value) 1713 + { 1714 + return (value & PADCFG0_GPIROUTIOXAPIC) && (value & PADCFG0_GPIOTXDIS) && 1715 + (__intel_gpio_get_gpio_mode(value) == PADCFG0_PMODE_GPIO); 1716 + } 1717 + 1712 1718 static bool intel_pinctrl_should_save(struct intel_pinctrl *pctrl, unsigned int pin) 1713 1719 { 1714 1720 const struct pin_desc *pd = pin_desc_get(pctrl->pctldev, pin); ··· 1748 1742 * See https://bugzilla.kernel.org/show_bug.cgi?id=214749. 1749 1743 */ 1750 1744 value = readl(intel_get_padcfg(pctrl, pin, PADCFG0)); 1751 - if ((value & PADCFG0_GPIROUTIOXAPIC) && (value & PADCFG0_GPIOTXDIS) && 1752 - (__intel_gpio_get_gpio_mode(value) == PADCFG0_PMODE_GPIO)) 1745 + if (__intel_gpio_is_direct_irq(value)) 1753 1746 return true; 1754 1747 1755 1748 return false; ··· 1878 1873 for (i = 0; i < pctrl->soc->npins; i++) { 1879 1874 const struct pinctrl_pin_desc *desc = &pctrl->soc->pins[i]; 1880 1875 1881 - if (!intel_pinctrl_should_save(pctrl, desc->number)) 1876 + if (!(intel_pinctrl_should_save(pctrl, desc->number) || 1877 + /* 1878 + * If the firmware mangled the register contents too much, 1879 + * check the saved value for the Direct IRQ mode. 1880 + */ 1881 + __intel_gpio_is_direct_irq(pads[i].padcfg0))) 1882 1882 continue; 1883 1883 1884 1884 intel_restore_padcfg(pctrl, desc->number, PADCFG0, pads[i].padcfg0);
+2 -2
drivers/pinctrl/mediatek/pinctrl-mt8195.c
··· 659 659 PIN_FIELD_BASE(10, 10, 4, 0x010, 0x10, 9, 3), 660 660 PIN_FIELD_BASE(11, 11, 4, 0x000, 0x10, 24, 3), 661 661 PIN_FIELD_BASE(12, 12, 4, 0x010, 0x10, 12, 3), 662 - PIN_FIELD_BASE(13, 13, 4, 0x010, 0x10, 27, 3), 662 + PIN_FIELD_BASE(13, 13, 4, 0x000, 0x10, 27, 3), 663 663 PIN_FIELD_BASE(14, 14, 4, 0x010, 0x10, 15, 3), 664 664 PIN_FIELD_BASE(15, 15, 4, 0x010, 0x10, 0, 3), 665 665 PIN_FIELD_BASE(16, 16, 4, 0x010, 0x10, 18, 3), ··· 708 708 PIN_FIELD_BASE(78, 78, 3, 0x000, 0x10, 15, 3), 709 709 PIN_FIELD_BASE(79, 79, 3, 0x000, 0x10, 18, 3), 710 710 PIN_FIELD_BASE(80, 80, 3, 0x000, 0x10, 21, 3), 711 - PIN_FIELD_BASE(81, 81, 3, 0x000, 0x10, 28, 3), 711 + PIN_FIELD_BASE(81, 81, 3, 0x000, 0x10, 24, 3), 712 712 PIN_FIELD_BASE(82, 82, 3, 0x000, 0x10, 27, 3), 713 713 PIN_FIELD_BASE(83, 83, 3, 0x010, 0x10, 0, 3), 714 714 PIN_FIELD_BASE(84, 84, 3, 0x010, 0x10, 3, 3),
+1
drivers/pinctrl/pinctrl-amd.c
··· 365 365 366 366 } else { 367 367 debounce_enable = " ∅"; 368 + time = 0; 368 369 } 369 370 snprintf(debounce_value, sizeof(debounce_value), "%u", time * unit); 370 371 seq_printf(s, "debounce %s (🕑 %sus)| ", debounce_enable, debounce_value);
+2
drivers/pinctrl/pinctrl-single.c
··· 372 372 if (!pcs->fmask) 373 373 return 0; 374 374 function = pinmux_generic_get_function(pctldev, fselector); 375 + if (!function) 376 + return -EINVAL; 375 377 func = function->data; 376 378 if (!func) 377 379 return -EINVAL;
+1 -1
drivers/pinctrl/qcom/pinctrl-sm8450-lpass-lpi.c
··· 105 105 static const char * const swr_tx_clk_groups[] = { "gpio0" }; 106 106 static const char * const swr_tx_data_groups[] = { "gpio1", "gpio2", "gpio14" }; 107 107 static const char * const swr_rx_clk_groups[] = { "gpio3" }; 108 - static const char * const swr_rx_data_groups[] = { "gpio4", "gpio5", "gpio15" }; 108 + static const char * const swr_rx_data_groups[] = { "gpio4", "gpio5" }; 109 109 static const char * const dmic1_clk_groups[] = { "gpio6" }; 110 110 static const char * const dmic1_data_groups[] = { "gpio7" }; 111 111 static const char * const dmic2_clk_groups[] = { "gpio8" };
+1 -1
drivers/spi/spi-dw-core.c
··· 366 366 * will be adjusted at the final stage of the IRQ-based SPI transfer 367 367 * execution so not to lose the leftover of the incoming data. 368 368 */ 369 - level = min_t(u16, dws->fifo_len / 2, dws->tx_len); 369 + level = min_t(unsigned int, dws->fifo_len / 2, dws->tx_len); 370 370 dw_writel(dws, DW_SPI_TXFTLR, level); 371 371 dw_writel(dws, DW_SPI_RXFTLR, level - 1); 372 372
+16 -6
drivers/spi/spidev.c
··· 90 90 /*-------------------------------------------------------------------------*/ 91 91 92 92 static ssize_t 93 + spidev_sync_unlocked(struct spi_device *spi, struct spi_message *message) 94 + { 95 + ssize_t status; 96 + 97 + status = spi_sync(spi, message); 98 + if (status == 0) 99 + status = message->actual_length; 100 + 101 + return status; 102 + } 103 + 104 + static ssize_t 93 105 spidev_sync(struct spidev_data *spidev, struct spi_message *message) 94 106 { 95 - int status; 107 + ssize_t status; 96 108 struct spi_device *spi; 97 109 98 110 mutex_lock(&spidev->spi_lock); ··· 113 101 if (spi == NULL) 114 102 status = -ESHUTDOWN; 115 103 else 116 - status = spi_sync(spi, message); 117 - 118 - if (status == 0) 119 - status = message->actual_length; 104 + status = spidev_sync_unlocked(spi, message); 120 105 121 106 mutex_unlock(&spidev->spi_lock); 107 + 122 108 return status; 123 109 } 124 110 ··· 304 294 spi_message_add_tail(k_tmp, &msg); 305 295 } 306 296 307 - status = spidev_sync(spidev, &msg); 297 + status = spidev_sync_unlocked(spidev->spi, &msg); 308 298 if (status < 0) 309 299 goto done; 310 300
+3
drivers/usb/core/quirks.c
··· 526 526 /* DJI CineSSD */ 527 527 { USB_DEVICE(0x2ca3, 0x0031), .driver_info = USB_QUIRK_NO_LPM }, 528 528 529 + /* Alcor Link AK9563 SC Reader used in 2022 Lenovo ThinkPads */ 530 + { USB_DEVICE(0x2ce3, 0x9563), .driver_info = USB_QUIRK_NO_LPM }, 531 + 529 532 /* DELL USB GEN2 */ 530 533 { USB_DEVICE(0x413c, 0xb062), .driver_info = USB_QUIRK_NO_LPM | USB_QUIRK_RESET_RESUME }, 531 534
+4
drivers/usb/gadget/function/u_ether.c
··· 798 798 net->max_mtu = GETHER_MAX_MTU_SIZE; 799 799 800 800 dev->gadget = g; 801 + SET_NETDEV_DEV(net, &g->dev); 801 802 SET_NETDEV_DEVTYPE(net, &gadget_type); 802 803 803 804 status = register_netdev(net); ··· 873 872 struct usb_gadget *g; 874 873 int status; 875 874 875 + if (!net->dev.parent) 876 + return -EINVAL; 876 877 dev = netdev_priv(net); 877 878 g = dev->gadget; 878 879 ··· 905 902 906 903 dev = netdev_priv(net); 907 904 dev->gadget = g; 905 + SET_NETDEV_DEV(net, &g->dev); 908 906 } 909 907 EXPORT_SYMBOL_GPL(gether_set_gadget); 910 908
+4 -4
drivers/usb/typec/altmodes/displayport.c
··· 547 547 /* FIXME: Port can only be DFP_U. */ 548 548 549 549 /* Make sure we have compatiple pin configurations */ 550 - if (!(DP_CAP_DFP_D_PIN_ASSIGN(port->vdo) & 551 - DP_CAP_UFP_D_PIN_ASSIGN(alt->vdo)) && 552 - !(DP_CAP_UFP_D_PIN_ASSIGN(port->vdo) & 553 - DP_CAP_DFP_D_PIN_ASSIGN(alt->vdo))) 550 + if (!(DP_CAP_PIN_ASSIGN_DFP_D(port->vdo) & 551 + DP_CAP_PIN_ASSIGN_UFP_D(alt->vdo)) && 552 + !(DP_CAP_PIN_ASSIGN_UFP_D(port->vdo) & 553 + DP_CAP_PIN_ASSIGN_DFP_D(alt->vdo))) 554 554 return -ENODEV; 555 555 556 556 ret = sysfs_create_group(&alt->dev.kobj, &dp_altmode_group);
+42 -39
drivers/video/fbdev/nvidia/nvidia.c
··· 1197 1197 return nvidiafb_check_var(&info->var, info); 1198 1198 } 1199 1199 1200 - static u32 nvidia_get_chipset(struct fb_info *info) 1200 + static u32 nvidia_get_chipset(struct pci_dev *pci_dev, 1201 + volatile u32 __iomem *REGS) 1201 1202 { 1202 - struct nvidia_par *par = info->par; 1203 - u32 id = (par->pci_dev->vendor << 16) | par->pci_dev->device; 1203 + u32 id = (pci_dev->vendor << 16) | pci_dev->device; 1204 1204 1205 1205 printk(KERN_INFO PFX "Device ID: %x \n", id); 1206 1206 1207 1207 if ((id & 0xfff0) == 0x00f0 || 1208 1208 (id & 0xfff0) == 0x02e0) { 1209 1209 /* pci-e */ 1210 - id = NV_RD32(par->REGS, 0x1800); 1210 + id = NV_RD32(REGS, 0x1800); 1211 1211 1212 1212 if ((id & 0x0000ffff) == 0x000010DE) 1213 1213 id = 0x10DE0000 | (id >> 16); ··· 1220 1220 return id; 1221 1221 } 1222 1222 1223 - static u32 nvidia_get_arch(struct fb_info *info) 1223 + static u32 nvidia_get_arch(u32 Chipset) 1224 1224 { 1225 - struct nvidia_par *par = info->par; 1226 1225 u32 arch = 0; 1227 1226 1228 - switch (par->Chipset & 0x0ff0) { 1227 + switch (Chipset & 0x0ff0) { 1229 1228 case 0x0100: /* GeForce 256 */ 1230 1229 case 0x0110: /* GeForce2 MX */ 1231 1230 case 0x0150: /* GeForce2 */ ··· 1277 1278 struct fb_info *info; 1278 1279 unsigned short cmd; 1279 1280 int ret; 1281 + volatile u32 __iomem *REGS; 1282 + int Chipset; 1283 + u32 Architecture; 1280 1284 1281 1285 NVTRACE_ENTER(); 1282 1286 assert(pd != NULL); 1283 1287 1288 + if (pci_enable_device(pd)) { 1289 + printk(KERN_ERR PFX "cannot enable PCI device\n"); 1290 + return -ENODEV; 1291 + } 1292 + 1293 + /* enable IO and mem if not already done */ 1294 + pci_read_config_word(pd, PCI_COMMAND, &cmd); 1295 + cmd |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY); 1296 + pci_write_config_word(pd, PCI_COMMAND, cmd); 1297 + 1298 + nvidiafb_fix.mmio_start = pci_resource_start(pd, 0); 1299 + nvidiafb_fix.mmio_len = pci_resource_len(pd, 0); 1300 + 1301 + REGS = ioremap(nvidiafb_fix.mmio_start, nvidiafb_fix.mmio_len); 1302 + if (!REGS) { 1303 + printk(KERN_ERR PFX "cannot ioremap MMIO base\n"); 1304 + return -ENODEV; 1305 + } 1306 + 1307 + Chipset = nvidia_get_chipset(pd, REGS); 1308 + Architecture = nvidia_get_arch(Chipset); 1309 + if (Architecture == 0) { 1310 + printk(KERN_ERR PFX "unknown NV_ARCH\n"); 1311 + goto err_out; 1312 + } 1313 + 1284 1314 ret = aperture_remove_conflicting_pci_devices(pd, "nvidiafb"); 1285 1315 if (ret) 1286 - return ret; 1316 + goto err_out; 1287 1317 1288 1318 info = framebuffer_alloc(sizeof(struct nvidia_par), &pd->dev); 1289 - 1290 1319 if (!info) 1291 1320 goto err_out; 1292 1321 ··· 1324 1297 1325 1298 if (info->pixmap.addr == NULL) 1326 1299 goto err_out_kfree; 1327 - 1328 - if (pci_enable_device(pd)) { 1329 - printk(KERN_ERR PFX "cannot enable PCI device\n"); 1330 - goto err_out_enable; 1331 - } 1332 1300 1333 1301 if (pci_request_regions(pd, "nvidiafb")) { 1334 1302 printk(KERN_ERR PFX "cannot request PCI regions\n"); ··· 1340 1318 par->paneltweak = paneltweak; 1341 1319 par->reverse_i2c = reverse_i2c; 1342 1320 1343 - /* enable IO and mem if not already done */ 1344 - pci_read_config_word(pd, PCI_COMMAND, &cmd); 1345 - cmd |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY); 1346 - pci_write_config_word(pd, PCI_COMMAND, cmd); 1347 - 1348 - nvidiafb_fix.mmio_start = pci_resource_start(pd, 0); 1349 1321 nvidiafb_fix.smem_start = pci_resource_start(pd, 1); 1350 - nvidiafb_fix.mmio_len = pci_resource_len(pd, 0); 1351 1322 1352 - par->REGS = ioremap(nvidiafb_fix.mmio_start, nvidiafb_fix.mmio_len); 1323 + par->REGS = REGS; 1353 1324 1354 - if (!par->REGS) { 1355 - printk(KERN_ERR PFX "cannot ioremap MMIO base\n"); 1356 - goto err_out_free_base0; 1357 - } 1358 - 1359 - par->Chipset = nvidia_get_chipset(info); 1360 - par->Architecture = nvidia_get_arch(info); 1361 - 1362 - if (par->Architecture == 0) { 1363 - printk(KERN_ERR PFX "unknown NV_ARCH\n"); 1364 - goto err_out_arch; 1365 - } 1325 + par->Chipset = Chipset; 1326 + par->Architecture = Architecture; 1366 1327 1367 1328 sprintf(nvidiafb_fix.id, "NV%x", (pd->device & 0x0ff0) >> 4); 1368 1329 1369 1330 if (NVCommonSetup(info)) 1370 - goto err_out_arch; 1331 + goto err_out_free_base0; 1371 1332 1372 1333 par->FbAddress = nvidiafb_fix.smem_start; 1373 1334 par->FbMapSize = par->RamAmountKBytes * 1024; ··· 1406 1401 goto err_out_iounmap_fb; 1407 1402 } 1408 1403 1409 - 1410 1404 printk(KERN_INFO PFX 1411 1405 "PCI nVidia %s framebuffer (%dMB @ 0x%lX)\n", 1412 1406 info->fix.id, ··· 1419 1415 err_out_free_base1: 1420 1416 fb_destroy_modedb(info->monspecs.modedb); 1421 1417 nvidia_delete_i2c_busses(par); 1422 - err_out_arch: 1423 - iounmap(par->REGS); 1424 - err_out_free_base0: 1418 + err_out_free_base0: 1425 1419 pci_release_regions(pd); 1426 1420 err_out_enable: 1427 1421 kfree(info->pixmap.addr); 1428 1422 err_out_kfree: 1429 1423 framebuffer_release(info); 1430 1424 err_out: 1425 + iounmap(REGS); 1431 1426 return -ENODEV; 1432 1427 } 1433 1428
+2
fs/btrfs/extent_io.c
··· 3826 3826 lockend = round_up(start + len, inode->root->fs_info->sectorsize); 3827 3827 prev_extent_end = lockstart; 3828 3828 3829 + btrfs_inode_lock(inode, BTRFS_ILOCK_SHARED); 3829 3830 lock_extent(&inode->io_tree, lockstart, lockend, &cached_state); 3830 3831 3831 3832 ret = fiemap_find_last_extent_offset(inode, path, &last_extent_end); ··· 4020 4019 4021 4020 out_unlock: 4022 4021 unlock_extent(&inode->io_tree, lockstart, lockend, &cached_state); 4022 + btrfs_inode_unlock(inode, BTRFS_ILOCK_SHARED); 4023 4023 out: 4024 4024 free_extent_state(delalloc_cached_state); 4025 4025 btrfs_free_backref_share_ctx(backref_ctx);
+11 -3
fs/btrfs/raid56.c
··· 1426 1426 u32 bio_size = 0; 1427 1427 struct bio_vec *bvec; 1428 1428 struct bvec_iter_all iter_all; 1429 + int i; 1429 1430 1430 1431 bio_for_each_segment_all(bvec, bio, iter_all) 1431 1432 bio_size += bvec->bv_len; 1432 1433 1433 - bitmap_set(rbio->error_bitmap, total_sector_nr, 1434 - bio_size >> rbio->bioc->fs_info->sectorsize_bits); 1434 + /* 1435 + * Since we can have multiple bios touching the error_bitmap, we cannot 1436 + * call bitmap_set() without protection. 1437 + * 1438 + * Instead use set_bit() for each bit, as set_bit() itself is atomic. 1439 + */ 1440 + for (i = total_sector_nr; i < total_sector_nr + 1441 + (bio_size >> rbio->bioc->fs_info->sectorsize_bits); i++) 1442 + set_bit(i, rbio->error_bitmap); 1435 1443 } 1436 1444 1437 1445 /* Verify the data sectors at read time. */ ··· 1894 1886 sector->uptodate = 1; 1895 1887 } 1896 1888 if (failb >= 0) { 1897 - ret = verify_one_sector(rbio, faila, sector_nr); 1889 + ret = verify_one_sector(rbio, failb, sector_nr); 1898 1890 if (ret < 0) 1899 1891 goto cleanup; 1900 1892
+3 -3
fs/btrfs/send.c
··· 8073 8073 /* 8074 8074 * Check that we don't overflow at later allocations, we request 8075 8075 * clone_sources_count + 1 items, and compare to unsigned long inside 8076 - * access_ok. 8076 + * access_ok. Also set an upper limit for allocation size so this can't 8077 + * easily exhaust memory. Max number of clone sources is about 200K. 8077 8078 */ 8078 - if (arg->clone_sources_count > 8079 - ULONG_MAX / sizeof(struct clone_root) - 1) { 8079 + if (arg->clone_sources_count > SZ_8M / sizeof(struct clone_root)) { 8080 8080 ret = -EINVAL; 8081 8081 goto out; 8082 8082 }
+17 -6
fs/btrfs/tree-log.c
··· 3576 3576 } 3577 3577 3578 3578 static int flush_dir_items_batch(struct btrfs_trans_handle *trans, 3579 - struct btrfs_root *log, 3579 + struct btrfs_inode *inode, 3580 3580 struct extent_buffer *src, 3581 3581 struct btrfs_path *dst_path, 3582 3582 int start_slot, 3583 3583 int count) 3584 3584 { 3585 + struct btrfs_root *log = inode->root->log_root; 3585 3586 char *ins_data = NULL; 3586 3587 struct btrfs_item_batch batch; 3587 3588 struct extent_buffer *dst; 3588 3589 unsigned long src_offset; 3589 3590 unsigned long dst_offset; 3591 + u64 last_index; 3590 3592 struct btrfs_key key; 3591 3593 u32 item_size; 3592 3594 int ret; ··· 3646 3644 src_offset = btrfs_item_ptr_offset(src, start_slot + count - 1); 3647 3645 copy_extent_buffer(dst, src, dst_offset, src_offset, batch.total_data_size); 3648 3646 btrfs_release_path(dst_path); 3647 + 3648 + last_index = batch.keys[count - 1].offset; 3649 + ASSERT(last_index > inode->last_dir_index_offset); 3650 + 3651 + /* 3652 + * If for some unexpected reason the last item's index is not greater 3653 + * than the last index we logged, warn and return an error to fallback 3654 + * to a transaction commit. 3655 + */ 3656 + if (WARN_ON(last_index <= inode->last_dir_index_offset)) 3657 + ret = -EUCLEAN; 3658 + else 3659 + inode->last_dir_index_offset = last_index; 3649 3660 out: 3650 3661 kfree(ins_data); 3651 3662 ··· 3708 3693 } 3709 3694 3710 3695 di = btrfs_item_ptr(src, i, struct btrfs_dir_item); 3711 - ctx->last_dir_item_offset = key.offset; 3712 3696 3713 3697 /* 3714 3698 * Skip ranges of items that consist only of dir item keys created ··· 3770 3756 if (batch_size > 0) { 3771 3757 int ret; 3772 3758 3773 - ret = flush_dir_items_batch(trans, log, src, dst_path, 3759 + ret = flush_dir_items_batch(trans, inode, src, dst_path, 3774 3760 batch_start, batch_size); 3775 3761 if (ret < 0) 3776 3762 return ret; ··· 4058 4044 4059 4045 min_key = BTRFS_DIR_START_INDEX; 4060 4046 max_key = 0; 4061 - ctx->last_dir_item_offset = inode->last_dir_index_offset; 4062 4047 4063 4048 while (1) { 4064 4049 ret = log_dir_items(trans, inode, path, dst_path, ··· 4068 4055 break; 4069 4056 min_key = max_key + 1; 4070 4057 } 4071 - 4072 - inode->last_dir_index_offset = ctx->last_dir_item_offset; 4073 4058 4074 4059 return 0; 4075 4060 }
-2
fs/btrfs/tree-log.h
··· 24 24 bool logging_new_delayed_dentries; 25 25 /* Indicate if the inode being logged was logged before. */ 26 26 bool logged_before; 27 - /* Tracks the last logged dir item/index key offset. */ 28 - u64 last_dir_item_offset; 29 27 struct inode *inode; 30 28 struct list_head list; 31 29 /* Only used for fast fsyncs. */
+20 -2
fs/btrfs/volumes.c
··· 403 403 static void free_fs_devices(struct btrfs_fs_devices *fs_devices) 404 404 { 405 405 struct btrfs_device *device; 406 + 406 407 WARN_ON(fs_devices->opened); 407 408 while (!list_empty(&fs_devices->devices)) { 408 409 device = list_entry(fs_devices->devices.next, ··· 1182 1181 1183 1182 mutex_lock(&uuid_mutex); 1184 1183 close_fs_devices(fs_devices); 1185 - if (!fs_devices->opened) 1184 + if (!fs_devices->opened) { 1186 1185 list_splice_init(&fs_devices->seed_list, &list); 1186 + 1187 + /* 1188 + * If the struct btrfs_fs_devices is not assembled with any 1189 + * other device, it can be re-initialized during the next mount 1190 + * without the needing device-scan step. Therefore, it can be 1191 + * fully freed. 1192 + */ 1193 + if (fs_devices->num_devices == 1) { 1194 + list_del(&fs_devices->fs_list); 1195 + free_fs_devices(fs_devices); 1196 + } 1197 + } 1198 + 1187 1199 1188 1200 list_for_each_entry_safe(fs_devices, tmp, &list, seed_list) { 1189 1201 close_fs_devices(fs_devices); ··· 1614 1600 if (ret < 0) 1615 1601 goto out; 1616 1602 1617 - while (1) { 1603 + while (search_start < search_end) { 1618 1604 l = path->nodes[0]; 1619 1605 slot = path->slots[0]; 1620 1606 if (slot >= btrfs_header_nritems(l)) { ··· 1636 1622 1637 1623 if (key.type != BTRFS_DEV_EXTENT_KEY) 1638 1624 goto next; 1625 + 1626 + if (key.offset > search_end) 1627 + break; 1639 1628 1640 1629 if (key.offset > search_start) { 1641 1630 hole_size = key.offset - search_start; ··· 1700 1683 else 1701 1684 ret = 0; 1702 1685 1686 + ASSERT(max_hole_start + max_hole_size <= search_end); 1703 1687 out: 1704 1688 btrfs_free_path(path); 1705 1689 *start = max_hole_start;
+1 -1
fs/btrfs/zlib.c
··· 63 63 64 64 workspacesize = max(zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL), 65 65 zlib_inflate_workspacesize()); 66 - workspace->strm.workspace = kvmalloc(workspacesize, GFP_KERNEL); 66 + workspace->strm.workspace = kvzalloc(workspacesize, GFP_KERNEL); 67 67 workspace->level = level; 68 68 workspace->buf = NULL; 69 69 /*
+6
fs/ceph/mds_client.c
··· 3685 3685 break; 3686 3686 3687 3687 case CEPH_SESSION_FLUSHMSG: 3688 + /* flush cap releases */ 3689 + spin_lock(&session->s_cap_lock); 3690 + if (session->s_num_cap_releases) 3691 + ceph_flush_cap_releases(mdsc, session); 3692 + spin_unlock(&session->s_cap_lock); 3693 + 3688 3694 send_flushmsg_ack(mdsc, session, seq); 3689 3695 break; 3690 3696
+2 -2
fs/cifs/file.c
··· 3889 3889 rdata->got_bytes += result; 3890 3890 } 3891 3891 3892 - return rdata->got_bytes > 0 && result != -ECONNABORTED ? 3892 + return result != -ECONNABORTED && rdata->got_bytes > 0 ? 3893 3893 rdata->got_bytes : result; 3894 3894 } 3895 3895 ··· 4665 4665 rdata->got_bytes += result; 4666 4666 } 4667 4667 4668 - return rdata->got_bytes > 0 && result != -ECONNABORTED ? 4668 + return result != -ECONNABORTED && rdata->got_bytes > 0 ? 4669 4669 rdata->got_bytes : result; 4670 4670 } 4671 4671
+24 -24
fs/coredump.c
··· 838 838 } 839 839 } 840 840 841 + int dump_emit(struct coredump_params *cprm, const void *addr, int nr) 842 + { 843 + if (cprm->to_skip) { 844 + if (!__dump_skip(cprm, cprm->to_skip)) 845 + return 0; 846 + cprm->to_skip = 0; 847 + } 848 + return __dump_emit(cprm, addr, nr); 849 + } 850 + EXPORT_SYMBOL(dump_emit); 851 + 852 + void dump_skip_to(struct coredump_params *cprm, unsigned long pos) 853 + { 854 + cprm->to_skip = pos - cprm->pos; 855 + } 856 + EXPORT_SYMBOL(dump_skip_to); 857 + 858 + void dump_skip(struct coredump_params *cprm, size_t nr) 859 + { 860 + cprm->to_skip += nr; 861 + } 862 + EXPORT_SYMBOL(dump_skip); 863 + 864 + #ifdef CONFIG_ELF_CORE 841 865 static int dump_emit_page(struct coredump_params *cprm, struct page *page) 842 866 { 843 867 struct bio_vec bvec = { ··· 895 871 return 1; 896 872 } 897 873 898 - int dump_emit(struct coredump_params *cprm, const void *addr, int nr) 899 - { 900 - if (cprm->to_skip) { 901 - if (!__dump_skip(cprm, cprm->to_skip)) 902 - return 0; 903 - cprm->to_skip = 0; 904 - } 905 - return __dump_emit(cprm, addr, nr); 906 - } 907 - EXPORT_SYMBOL(dump_emit); 908 - 909 - void dump_skip_to(struct coredump_params *cprm, unsigned long pos) 910 - { 911 - cprm->to_skip = pos - cprm->pos; 912 - } 913 - EXPORT_SYMBOL(dump_skip_to); 914 - 915 - void dump_skip(struct coredump_params *cprm, size_t nr) 916 - { 917 - cprm->to_skip += nr; 918 - } 919 - EXPORT_SYMBOL(dump_skip); 920 - 921 - #ifdef CONFIG_ELF_CORE 922 874 int dump_user_range(struct coredump_params *cprm, unsigned long start, 923 875 unsigned long len) 924 876 {
-5
include/drm/drm_client.h
··· 127 127 struct drm_client_dev *client; 128 128 129 129 /** 130 - * @handle: Buffer handle 131 - */ 132 - u32 handle; 133 - 134 - /** 135 130 * @pitch: Buffer pitch 136 131 */ 137 132 u32 pitch;
+10 -3
include/linux/mlx5/driver.h
··· 573 573 struct dentry *lag_debugfs; 574 574 }; 575 575 576 + enum mlx5_func_type { 577 + MLX5_PF, 578 + MLX5_VF, 579 + MLX5_SF, 580 + MLX5_HOST_PF, 581 + MLX5_FUNC_TYPE_NUM, 582 + }; 583 + 576 584 struct mlx5_ft_pool; 577 585 struct mlx5_priv { 578 586 /* IRQ table valid only for real pci devices PF or VF */ ··· 591 583 struct mlx5_nb pg_nb; 592 584 struct workqueue_struct *pg_wq; 593 585 struct xarray page_root_xa; 594 - u32 fw_pages; 595 586 atomic_t reg_pages; 596 587 struct list_head free_list; 597 - u32 vfs_pages; 598 - u32 host_pf_pages; 588 + u32 fw_pages; 589 + u32 page_counters[MLX5_FUNC_TYPE_NUM]; 599 590 u32 fw_pages_alloc_failed; 600 591 u32 give_pages_dropped; 601 592 u32 reclaim_pages_discard;
+1
include/linux/trace_events.h
··· 270 270 const int align; 271 271 const int is_signed; 272 272 const int filter_type; 273 + const int len; 273 274 }; 274 275 int (*define_fields)(struct trace_event_call *); 275 276 };
+2 -1
include/trace/stages/stage4_event_fields.h
··· 26 26 #define __array(_type, _item, _len) { \ 27 27 .type = #_type"["__stringify(_len)"]", .name = #_item, \ 28 28 .size = sizeof(_type[_len]), .align = ALIGN_STRUCTFIELD(_type), \ 29 - .is_signed = is_signed_type(_type), .filter_type = FILTER_OTHER }, 29 + .is_signed = is_signed_type(_type), .filter_type = FILTER_OTHER,\ 30 + .len = _len }, 30 31 31 32 #undef __dynamic_array 32 33 #define __dynamic_array(_type, _item, _len) { \
+1
include/uapi/drm/virtgpu_drm.h
··· 64 64 __u32 pad; 65 65 }; 66 66 67 + /* fence_fd is modified on success if VIRTGPU_EXECBUF_FENCE_FD_OUT flag is set. */ 67 68 struct drm_virtgpu_execbuffer { 68 69 __u32 flags; 69 70 __u32 size;
+1
include/uapi/linux/ip.h
··· 18 18 #ifndef _UAPI_LINUX_IP_H 19 19 #define _UAPI_LINUX_IP_H 20 20 #include <linux/types.h> 21 + #include <linux/stddef.h> 21 22 #include <asm/byteorder.h> 22 23 23 24 #define IPTOS_TOS_MASK 0x1E
+1
include/uapi/linux/ipv6.h
··· 4 4 5 5 #include <linux/libc-compat.h> 6 6 #include <linux/types.h> 7 + #include <linux/stddef.h> 7 8 #include <linux/in6.h> 8 9 #include <asm/byteorder.h> 9 10
+36 -9
kernel/cgroup/cpuset.c
··· 1205 1205 /** 1206 1206 * update_tasks_cpumask - Update the cpumasks of tasks in the cpuset. 1207 1207 * @cs: the cpuset in which each task's cpus_allowed mask needs to be changed 1208 + * @new_cpus: the temp variable for the new effective_cpus mask 1208 1209 * 1209 1210 * Iterate through each task of @cs updating its cpus_allowed to the 1210 1211 * effective cpuset's. As this function is called with cpuset_rwsem held, 1211 1212 * cpuset membership stays stable. 1212 1213 */ 1213 - static void update_tasks_cpumask(struct cpuset *cs) 1214 + static void update_tasks_cpumask(struct cpuset *cs, struct cpumask *new_cpus) 1214 1215 { 1215 1216 struct css_task_iter it; 1216 1217 struct task_struct *task; ··· 1225 1224 if (top_cs && (task->flags & PF_KTHREAD) && 1226 1225 kthread_is_per_cpu(task)) 1227 1226 continue; 1228 - set_cpus_allowed_ptr(task, cs->effective_cpus); 1227 + 1228 + cpumask_and(new_cpus, cs->effective_cpus, 1229 + task_cpu_possible_mask(task)); 1230 + set_cpus_allowed_ptr(task, new_cpus); 1229 1231 } 1230 1232 css_task_iter_end(&it); 1231 1233 } ··· 1513 1509 spin_unlock_irq(&callback_lock); 1514 1510 1515 1511 if (adding || deleting) 1516 - update_tasks_cpumask(parent); 1512 + update_tasks_cpumask(parent, tmp->new_cpus); 1517 1513 1518 1514 /* 1519 1515 * Set or clear CS_SCHED_LOAD_BALANCE when partcmd_update, if necessary. ··· 1665 1661 WARN_ON(!is_in_v2_mode() && 1666 1662 !cpumask_equal(cp->cpus_allowed, cp->effective_cpus)); 1667 1663 1668 - update_tasks_cpumask(cp); 1664 + update_tasks_cpumask(cp, tmp->new_cpus); 1669 1665 1670 1666 /* 1671 1667 * On legacy hierarchy, if the effective cpumask of any non- ··· 2313 2309 } 2314 2310 } 2315 2311 2316 - update_tasks_cpumask(parent); 2312 + update_tasks_cpumask(parent, tmpmask.new_cpus); 2317 2313 2318 2314 if (parent->child_ecpus_count) 2319 2315 update_sibling_cpumasks(parent, cs, &tmpmask); ··· 3352 3348 * as the tasks will be migrated to an ancestor. 3353 3349 */ 3354 3350 if (cpus_updated && !cpumask_empty(cs->cpus_allowed)) 3355 - update_tasks_cpumask(cs); 3351 + update_tasks_cpumask(cs, new_cpus); 3356 3352 if (mems_updated && !nodes_empty(cs->mems_allowed)) 3357 3353 update_tasks_nodemask(cs); 3358 3354 ··· 3389 3385 spin_unlock_irq(&callback_lock); 3390 3386 3391 3387 if (cpus_updated) 3392 - update_tasks_cpumask(cs); 3388 + update_tasks_cpumask(cs, new_cpus); 3393 3389 if (mems_updated) 3394 3390 update_tasks_nodemask(cs); 3395 3391 } ··· 3696 3692 * Description: Returns the cpumask_var_t cpus_allowed of the cpuset 3697 3693 * attached to the specified @tsk. Guaranteed to return some non-empty 3698 3694 * subset of cpu_online_mask, even if this means going outside the 3699 - * tasks cpuset. 3695 + * tasks cpuset, except when the task is in the top cpuset. 3700 3696 **/ 3701 3697 3702 3698 void cpuset_cpus_allowed(struct task_struct *tsk, struct cpumask *pmask) 3703 3699 { 3704 3700 unsigned long flags; 3701 + struct cpuset *cs; 3705 3702 3706 3703 spin_lock_irqsave(&callback_lock, flags); 3707 - guarantee_online_cpus(tsk, pmask); 3704 + rcu_read_lock(); 3705 + 3706 + cs = task_cs(tsk); 3707 + if (cs != &top_cpuset) 3708 + guarantee_online_cpus(tsk, pmask); 3709 + /* 3710 + * Tasks in the top cpuset won't get update to their cpumasks 3711 + * when a hotplug online/offline event happens. So we include all 3712 + * offline cpus in the allowed cpu list. 3713 + */ 3714 + if ((cs == &top_cpuset) || cpumask_empty(pmask)) { 3715 + const struct cpumask *possible_mask = task_cpu_possible_mask(tsk); 3716 + 3717 + /* 3718 + * We first exclude cpus allocated to partitions. If there is no 3719 + * allowable online cpu left, we fall back to all possible cpus. 3720 + */ 3721 + cpumask_andnot(pmask, possible_mask, top_cpuset.subparts_cpus); 3722 + if (!cpumask_intersects(pmask, cpu_online_mask)) 3723 + cpumask_copy(pmask, possible_mask); 3724 + } 3725 + 3726 + rcu_read_unlock(); 3708 3727 spin_unlock_irqrestore(&callback_lock, flags); 3709 3728 } 3710 3729
+3 -2
kernel/locking/rtmutex.c
··· 901 901 * then we need to wake the new top waiter up to try 902 902 * to get the lock. 903 903 */ 904 - if (prerequeue_top_waiter != rt_mutex_top_waiter(lock)) 905 - wake_up_state(waiter->task, waiter->wake_state); 904 + top_waiter = rt_mutex_top_waiter(lock); 905 + if (prerequeue_top_waiter != top_waiter) 906 + wake_up_state(top_waiter->task, top_waiter->wake_state); 906 907 raw_spin_unlock_irq(&lock->wait_lock); 907 908 return 0; 908 909 }
-3
kernel/trace/trace.c
··· 9148 9148 if (val > 100) 9149 9149 return -EINVAL; 9150 9150 9151 - if (!val) 9152 - val = 1; 9153 - 9154 9151 tr->buffer_percent = val; 9155 9152 9156 9153 (*ppos)++;
+1
kernel/trace/trace.h
··· 1282 1282 int offset; 1283 1283 int size; 1284 1284 int is_signed; 1285 + int len; 1285 1286 }; 1286 1287 1287 1288 struct prog_entry;
+30 -9
kernel/trace/trace_events.c
··· 114 114 115 115 static int __trace_define_field(struct list_head *head, const char *type, 116 116 const char *name, int offset, int size, 117 - int is_signed, int filter_type) 117 + int is_signed, int filter_type, int len) 118 118 { 119 119 struct ftrace_event_field *field; 120 120 ··· 133 133 field->offset = offset; 134 134 field->size = size; 135 135 field->is_signed = is_signed; 136 + field->len = len; 136 137 137 138 list_add(&field->link, head); 138 139 ··· 151 150 152 151 head = trace_get_fields(call); 153 152 return __trace_define_field(head, type, name, offset, size, 154 - is_signed, filter_type); 153 + is_signed, filter_type, 0); 155 154 } 156 155 EXPORT_SYMBOL_GPL(trace_define_field); 156 + 157 + int trace_define_field_ext(struct trace_event_call *call, const char *type, 158 + const char *name, int offset, int size, int is_signed, 159 + int filter_type, int len) 160 + { 161 + struct list_head *head; 162 + 163 + if (WARN_ON(!call->class)) 164 + return 0; 165 + 166 + head = trace_get_fields(call); 167 + return __trace_define_field(head, type, name, offset, size, 168 + is_signed, filter_type, len); 169 + } 157 170 158 171 #define __generic_field(type, item, filter_type) \ 159 172 ret = __trace_define_field(&ftrace_generic_fields, #type, \ 160 173 #item, 0, 0, is_signed_type(type), \ 161 - filter_type); \ 174 + filter_type, 0); \ 162 175 if (ret) \ 163 176 return ret; 164 177 ··· 181 166 "common_" #item, \ 182 167 offsetof(typeof(ent), item), \ 183 168 sizeof(ent.item), \ 184 - is_signed_type(type), FILTER_OTHER); \ 169 + is_signed_type(type), FILTER_OTHER, 0); \ 185 170 if (ret) \ 186 171 return ret; 187 172 ··· 1603 1588 seq_printf(m, "\tfield:%s %s;\toffset:%u;\tsize:%u;\tsigned:%d;\n", 1604 1589 field->type, field->name, field->offset, 1605 1590 field->size, !!field->is_signed); 1606 - else 1607 - seq_printf(m, "\tfield:%.*s %s%s;\toffset:%u;\tsize:%u;\tsigned:%d;\n", 1591 + else if (field->len) 1592 + seq_printf(m, "\tfield:%.*s %s[%d];\toffset:%u;\tsize:%u;\tsigned:%d;\n", 1608 1593 (int)(array_descriptor - field->type), 1609 1594 field->type, field->name, 1610 - array_descriptor, field->offset, 1595 + field->len, field->offset, 1611 1596 field->size, !!field->is_signed); 1597 + else 1598 + seq_printf(m, "\tfield:%.*s %s[];\toffset:%u;\tsize:%u;\tsigned:%d;\n", 1599 + (int)(array_descriptor - field->type), 1600 + field->type, field->name, 1601 + field->offset, field->size, !!field->is_signed); 1612 1602 1613 1603 return 0; 1614 1604 } ··· 2399 2379 } 2400 2380 2401 2381 offset = ALIGN(offset, field->align); 2402 - ret = trace_define_field(call, field->type, field->name, 2382 + ret = trace_define_field_ext(call, field->type, field->name, 2403 2383 offset, field->size, 2404 - field->is_signed, field->filter_type); 2384 + field->is_signed, field->filter_type, 2385 + field->len); 2405 2386 if (WARN_ON_ONCE(ret)) { 2406 2387 pr_err("error code is %d\n", ret); 2407 2388 break;
+2 -1
kernel/trace/trace_export.c
··· 111 111 #define __array(_type, _item, _len) { \ 112 112 .type = #_type"["__stringify(_len)"]", .name = #_item, \ 113 113 .size = sizeof(_type[_len]), .align = __alignof__(_type), \ 114 - is_signed_type(_type), .filter_type = FILTER_OTHER }, 114 + is_signed_type(_type), .filter_type = FILTER_OTHER, \ 115 + .len = _len }, 115 116 116 117 #undef __array_desc 117 118 #define __array_desc(_type, _container, _item, _len) __array(_type, _item, _len)
+1 -7
mm/memblock.c
··· 1640 1640 end = PFN_DOWN(base + size); 1641 1641 1642 1642 for (; cursor < end; cursor++) { 1643 - /* 1644 - * Reserved pages are always initialized by the end of 1645 - * memblock_free_all() (by memmap_init() and, if deferred 1646 - * initialization is enabled, memmap_init_reserved_pages()), so 1647 - * these pages can be released directly to the buddy allocator. 1648 - */ 1649 - __free_pages_core(pfn_to_page(cursor), 0); 1643 + memblock_free_pages(pfn_to_page(cursor), cursor, 0); 1650 1644 totalram_pages_inc(); 1651 1645 } 1652 1646 }
+4 -1
mm/page_alloc.c
··· 5631 5631 */ 5632 5632 void __free_pages(struct page *page, unsigned int order) 5633 5633 { 5634 + /* get PageHead before we drop reference */ 5635 + int head = PageHead(page); 5636 + 5634 5637 if (put_page_testzero(page)) 5635 5638 free_the_page(page, order); 5636 - else if (!PageHead(page)) 5639 + else if (!head) 5637 5640 while (order-- > 0) 5638 5641 free_the_page(page + (1 << order), order); 5639 5642 }
+40
net/can/j1939/address-claim.c
··· 165 165 * leaving this function. 166 166 */ 167 167 ecu = j1939_ecu_get_by_name_locked(priv, name); 168 + 169 + if (ecu && ecu->addr == skcb->addr.sa) { 170 + /* The ISO 11783-5 standard, in "4.5.2 - Address claim 171 + * requirements", states: 172 + * d) No CF shall begin, or resume, transmission on the 173 + * network until 250 ms after it has successfully claimed 174 + * an address except when responding to a request for 175 + * address-claimed. 176 + * 177 + * But "Figure 6" and "Figure 7" in "4.5.4.2 - Address-claim 178 + * prioritization" show that the CF begins the transmission 179 + * after 250 ms from the first AC (address-claimed) message 180 + * even if it sends another AC message during that time window 181 + * to resolve the address contention with another CF. 182 + * 183 + * As stated in "4.4.2.3 - Address-claimed message": 184 + * In order to successfully claim an address, the CF sending 185 + * an address claimed message shall not receive a contending 186 + * claim from another CF for at least 250 ms. 187 + * 188 + * As stated in "4.4.3.2 - NAME management (NM) message": 189 + * 1) A commanding CF can 190 + * d) request that a CF with a specified NAME transmit 191 + * the address-claimed message with its current NAME. 192 + * 2) A target CF shall 193 + * d) send an address-claimed message in response to a 194 + * request for a matching NAME 195 + * 196 + * Taking the above arguments into account, the 250 ms wait is 197 + * requested only during network initialization. 198 + * 199 + * Do not restart the timer on AC message if both the NAME and 200 + * the address match and so if the address has already been 201 + * claimed (timer has expired) or the AC message has been sent 202 + * to resolve the contention with another CF (timer is still 203 + * running). 204 + */ 205 + goto out_ecu_put; 206 + } 207 + 168 208 if (!ecu && j1939_address_is_unicast(skcb->addr.sa)) 169 209 ecu = j1939_ecu_create_locked(priv, name); 170 210
+6 -3
net/core/devlink.c
··· 9979 9979 goto err_xa_alloc; 9980 9980 9981 9981 devlink->netdevice_nb.notifier_call = devlink_netdevice_event; 9982 - ret = register_netdevice_notifier_net(net, &devlink->netdevice_nb); 9982 + ret = register_netdevice_notifier(&devlink->netdevice_nb); 9983 9983 if (ret) 9984 9984 goto err_register_netdevice_notifier; 9985 9985 ··· 10171 10171 xa_destroy(&devlink->snapshot_ids); 10172 10172 xa_destroy(&devlink->ports); 10173 10173 10174 - WARN_ON_ONCE(unregister_netdevice_notifier_net(devlink_net(devlink), 10175 - &devlink->netdevice_nb)); 10174 + WARN_ON_ONCE(unregister_netdevice_notifier(&devlink->netdevice_nb)); 10176 10175 10177 10176 xa_erase(&devlinks, devlink->index); 10178 10177 ··· 10502 10503 break; 10503 10504 case NETDEV_REGISTER: 10504 10505 case NETDEV_CHANGENAME: 10506 + if (devlink_net(devlink) != dev_net(netdev)) 10507 + return NOTIFY_OK; 10505 10508 /* Set the netdev on top of previously set type. Note this 10506 10509 * event happens also during net namespace change so here 10507 10510 * we take into account netdev pointer appearing in this ··· 10513 10512 netdev); 10514 10513 break; 10515 10514 case NETDEV_UNREGISTER: 10515 + if (devlink_net(devlink) != dev_net(netdev)) 10516 + return NOTIFY_OK; 10516 10517 /* Clear netdev pointer, but not the type. This event happens 10517 10518 * also during net namespace change so we need to clear 10518 10519 * pointer to netdev that is going to another net namespace.
+15 -3
net/core/neighbour.c
··· 269 269 (n->nud_state == NUD_NOARP) || 270 270 (tbl->is_multicast && 271 271 tbl->is_multicast(n->primary_key)) || 272 - time_after(tref, n->updated)) 272 + !time_in_range(n->updated, tref, jiffies)) 273 273 remove = true; 274 274 write_unlock(&n->lock); 275 275 ··· 289 289 290 290 static void neigh_add_timer(struct neighbour *n, unsigned long when) 291 291 { 292 + /* Use safe distance from the jiffies - LONG_MAX point while timer 293 + * is running in DELAY/PROBE state but still show to user space 294 + * large times in the past. 295 + */ 296 + unsigned long mint = jiffies - (LONG_MAX - 86400 * HZ); 297 + 292 298 neigh_hold(n); 299 + if (!time_in_range(n->confirmed, mint, jiffies)) 300 + n->confirmed = mint; 301 + if (time_before(n->used, n->confirmed)) 302 + n->used = n->confirmed; 293 303 if (unlikely(mod_timer(&n->timer, when))) { 294 304 printk("NEIGH: BUG, double timer add, state is %x\n", 295 305 n->nud_state); ··· 1011 1001 goto next_elt; 1012 1002 } 1013 1003 1014 - if (time_before(n->used, n->confirmed)) 1004 + if (time_before(n->used, n->confirmed) && 1005 + time_is_before_eq_jiffies(n->confirmed)) 1015 1006 n->used = n->confirmed; 1016 1007 1017 1008 if (refcount_read(&n->refcnt) == 1 && 1018 1009 (state == NUD_FAILED || 1019 - time_after(jiffies, n->used + NEIGH_VAR(n->parms, GC_STALETIME)))) { 1010 + !time_in_range_open(jiffies, n->used, 1011 + n->used + NEIGH_VAR(n->parms, GC_STALETIME)))) { 1020 1012 *np = n->next; 1021 1013 neigh_mark_dead(n); 1022 1014 write_unlock(&n->lock);
+2 -1
net/core/sock.c
··· 1531 1531 ret = -EINVAL; 1532 1532 break; 1533 1533 } 1534 + if ((u8)val == SOCK_TXREHASH_DEFAULT) 1535 + val = READ_ONCE(sock_net(sk)->core.sysctl_txrehash); 1534 1536 /* Paired with READ_ONCE() in tcp_rtx_synack() */ 1535 1537 WRITE_ONCE(sk->sk_txrehash, (u8)val); 1536 1538 break; ··· 3453 3451 sk->sk_pacing_rate = ~0UL; 3454 3452 WRITE_ONCE(sk->sk_pacing_shift, 10); 3455 3453 sk->sk_incoming_cpu = -1; 3456 - sk->sk_txrehash = SOCK_TXREHASH_DEFAULT; 3457 3454 3458 3455 sk_rx_queue_clear(sk); 3459 3456 /*
+1
net/ipv4/af_inet.c
··· 347 347 sk->sk_destruct = inet_sock_destruct; 348 348 sk->sk_protocol = protocol; 349 349 sk->sk_backlog_rcv = sk->sk_prot->backlog_rcv; 350 + sk->sk_txrehash = READ_ONCE(net->core.sysctl_txrehash); 350 351 351 352 inet->uc_ttl = -1; 352 353 inet->mc_loop = 1;
-3
net/ipv4/inet_connection_sock.c
··· 1225 1225 sk->sk_ack_backlog = 0; 1226 1226 inet_csk_delack_init(sk); 1227 1227 1228 - if (sk->sk_txrehash == SOCK_TXREHASH_DEFAULT) 1229 - sk->sk_txrehash = READ_ONCE(sock_net(sk)->core.sysctl_txrehash); 1230 - 1231 1228 /* There is race window here: we announce ourselves listening, 1232 1229 * but this transition is still not validated by get_port(). 1233 1230 * It is OK, because this socket enters to hash table only
+1
net/ipv6/af_inet6.c
··· 222 222 np->pmtudisc = IPV6_PMTUDISC_WANT; 223 223 np->repflow = net->ipv6.sysctl.flowlabel_reflect & FLOWLABEL_REFLECT_ESTABLISHED; 224 224 sk->sk_ipv6only = net->ipv6.sysctl.bindv6only; 225 + sk->sk_txrehash = READ_ONCE(net->core.sysctl_txrehash); 225 226 226 227 /* Init the ipv4 part of the socket since we can have sockets 227 228 * using v6 API for ipv4.
+6 -4
net/mptcp/pm_netlink.c
··· 998 998 { 999 999 int addrlen = sizeof(struct sockaddr_in); 1000 1000 struct sockaddr_storage addr; 1001 - struct mptcp_sock *msk; 1002 1001 struct socket *ssock; 1002 + struct sock *newsk; 1003 1003 int backlog = 1024; 1004 1004 int err; 1005 1005 ··· 1008 1008 if (err) 1009 1009 return err; 1010 1010 1011 - msk = mptcp_sk(entry->lsk->sk); 1012 - if (!msk) 1011 + newsk = entry->lsk->sk; 1012 + if (!newsk) 1013 1013 return -EINVAL; 1014 1014 1015 - ssock = __mptcp_nmpc_socket(msk); 1015 + lock_sock(newsk); 1016 + ssock = __mptcp_nmpc_socket(mptcp_sk(newsk)); 1017 + release_sock(newsk); 1016 1018 if (!ssock) 1017 1019 return -EINVAL; 1018 1020
+9
net/mptcp/protocol.c
··· 2897 2897 struct mptcp_subflow_context *subflow; 2898 2898 struct mptcp_sock *msk = mptcp_sk(sk); 2899 2899 bool do_cancel_work = false; 2900 + int subflows_alive = 0; 2900 2901 2901 2902 sk->sk_shutdown = SHUTDOWN_MASK; 2902 2903 ··· 2923 2922 struct sock *ssk = mptcp_subflow_tcp_sock(subflow); 2924 2923 bool slow = lock_sock_fast_nested(ssk); 2925 2924 2925 + subflows_alive += ssk->sk_state != TCP_CLOSE; 2926 + 2926 2927 /* since the close timeout takes precedence on the fail one, 2927 2928 * cancel the latter 2928 2929 */ ··· 2939 2936 unlock_sock_fast(ssk, slow); 2940 2937 } 2941 2938 sock_orphan(sk); 2939 + 2940 + /* all the subflows are closed, only timeout can change the msk 2941 + * state, let's not keep resources busy for no reasons 2942 + */ 2943 + if (subflows_alive == 0) 2944 + inet_sk_state_store(sk, TCP_CLOSE); 2942 2945 2943 2946 sock_hold(sk); 2944 2947 pr_debug("msk=%p state=%d", sk, sk->sk_state);
+9 -2
net/mptcp/sockopt.c
··· 760 760 static int mptcp_setsockopt_first_sf_only(struct mptcp_sock *msk, int level, int optname, 761 761 sockptr_t optval, unsigned int optlen) 762 762 { 763 + struct sock *sk = (struct sock *)msk; 763 764 struct socket *sock; 765 + int ret = -EINVAL; 764 766 765 767 /* Limit to first subflow, before the connection establishment */ 768 + lock_sock(sk); 766 769 sock = __mptcp_nmpc_socket(msk); 767 770 if (!sock) 768 - return -EINVAL; 771 + goto unlock; 769 772 770 - return tcp_setsockopt(sock->sk, level, optname, optval, optlen); 773 + ret = tcp_setsockopt(sock->sk, level, optname, optval, optlen); 774 + 775 + unlock: 776 + release_sock(sk); 777 + return ret; 771 778 } 772 779 773 780 static int mptcp_setsockopt_sol_tcp(struct mptcp_sock *msk, int optname,
+10 -2
net/mptcp/subflow.c
··· 1399 1399 mptcp_for_each_subflow(msk, subflow) { 1400 1400 struct sock *ssk = mptcp_subflow_tcp_sock(subflow); 1401 1401 int err = sock_error(ssk); 1402 + int ssk_state; 1402 1403 1403 1404 if (!err) 1404 1405 continue; ··· 1410 1409 if (sk->sk_state != TCP_SYN_SENT && !__mptcp_check_fallback(msk)) 1411 1410 continue; 1412 1411 1413 - inet_sk_state_store(sk, inet_sk_state_load(ssk)); 1412 + /* We need to propagate only transition to CLOSE state. 1413 + * Orphaned socket will see such state change via 1414 + * subflow_sched_work_if_closed() and that path will properly 1415 + * destroy the msk as needed. 1416 + */ 1417 + ssk_state = inet_sk_state_load(ssk); 1418 + if (ssk_state == TCP_CLOSE && !sock_flag(sk, SOCK_DEAD)) 1419 + inet_sk_state_store(sk, ssk_state); 1414 1420 sk->sk_err = -err; 1415 1421 1416 1422 /* This barrier is coupled with smp_rmb() in mptcp_poll() */ ··· 1687 1679 if (err) 1688 1680 return err; 1689 1681 1690 - lock_sock(sf->sk); 1682 + lock_sock_nested(sf->sk, SINGLE_DEPTH_NESTING); 1691 1683 1692 1684 /* the newly created socket has to be in the same cgroup as its parent */ 1693 1685 mptcp_attach_cgroup(sk, sf->sk);
+3 -3
net/rds/message.c
··· 104 104 spin_lock_irqsave(&q->lock, flags); 105 105 head = &q->zcookie_head; 106 106 if (!list_empty(head)) { 107 - info = list_entry(head, struct rds_msg_zcopy_info, 108 - rs_zcookie_next); 109 - if (info && rds_zcookie_add(info, cookie)) { 107 + info = list_first_entry(head, struct rds_msg_zcopy_info, 108 + rs_zcookie_next); 109 + if (rds_zcookie_add(info, cookie)) { 110 110 spin_unlock_irqrestore(&q->lock, flags); 111 111 kfree(rds_info_from_znotifier(znotif)); 112 112 /* caller invokes rds_wake_sk_sleep() */
+1 -1
net/sched/sch_htb.c
··· 433 433 while (m) { 434 434 unsigned int prio = ffz(~m); 435 435 436 - if (WARN_ON_ONCE(prio > ARRAY_SIZE(p->inner.clprio))) 436 + if (WARN_ON_ONCE(prio >= ARRAY_SIZE(p->inner.clprio))) 437 437 break; 438 438 m &= ~(1 << prio); 439 439
+3 -1
net/xfrm/xfrm_compat.c
··· 5 5 * Based on code and translator idea by: Florian Westphal <fw@strlen.de> 6 6 */ 7 7 #include <linux/compat.h> 8 + #include <linux/nospec.h> 8 9 #include <linux/xfrm.h> 9 10 #include <net/xfrm.h> 10 11 ··· 303 302 nla_for_each_attr(nla, attrs, len, remaining) { 304 303 int err; 305 304 306 - switch (type) { 305 + switch (nlh_src->nlmsg_type) { 307 306 case XFRM_MSG_NEWSPDINFO: 308 307 err = xfrm_nla_cpy(dst, nla, nla_len(nla)); 309 308 break; ··· 438 437 NL_SET_ERR_MSG(extack, "Bad attribute"); 439 438 return -EOPNOTSUPP; 440 439 } 440 + type = array_index_nospec(type, XFRMA_MAX + 1); 441 441 if (nla_len(nla) < compat_policy[type].len) { 442 442 NL_SET_ERR_MSG(extack, "Attribute bad length"); 443 443 return -EOPNOTSUPP;
+1 -2
net/xfrm/xfrm_input.c
··· 279 279 goto out; 280 280 281 281 if (x->props.flags & XFRM_STATE_DECAP_DSCP) 282 - ipv6_copy_dscp(ipv6_get_dsfield(ipv6_hdr(skb)), 283 - ipipv6_hdr(skb)); 282 + ipv6_copy_dscp(XFRM_MODE_SKB_CB(skb)->tos, ipipv6_hdr(skb)); 284 283 if (!(x->props.flags & XFRM_STATE_NOECN)) 285 284 ipip6_ecn_decapsulate(skb); 286 285
+50 -4
net/xfrm/xfrm_interface_core.c
··· 310 310 skb->mark = 0; 311 311 } 312 312 313 + static int xfrmi_input(struct sk_buff *skb, int nexthdr, __be32 spi, 314 + int encap_type, unsigned short family) 315 + { 316 + struct sec_path *sp; 317 + 318 + sp = skb_sec_path(skb); 319 + if (sp && (sp->len || sp->olen) && 320 + !xfrm_policy_check(NULL, XFRM_POLICY_IN, skb, family)) 321 + goto discard; 322 + 323 + XFRM_SPI_SKB_CB(skb)->family = family; 324 + if (family == AF_INET) { 325 + XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct iphdr, daddr); 326 + XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip4 = NULL; 327 + } else { 328 + XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct ipv6hdr, daddr); 329 + XFRM_TUNNEL_SKB_CB(skb)->tunnel.ip6 = NULL; 330 + } 331 + 332 + return xfrm_input(skb, nexthdr, spi, encap_type); 333 + discard: 334 + kfree_skb(skb); 335 + return 0; 336 + } 337 + 338 + static int xfrmi4_rcv(struct sk_buff *skb) 339 + { 340 + return xfrmi_input(skb, ip_hdr(skb)->protocol, 0, 0, AF_INET); 341 + } 342 + 343 + static int xfrmi6_rcv(struct sk_buff *skb) 344 + { 345 + return xfrmi_input(skb, skb_network_header(skb)[IP6CB(skb)->nhoff], 346 + 0, 0, AF_INET6); 347 + } 348 + 349 + static int xfrmi4_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) 350 + { 351 + return xfrmi_input(skb, nexthdr, spi, encap_type, AF_INET); 352 + } 353 + 354 + static int xfrmi6_input(struct sk_buff *skb, int nexthdr, __be32 spi, int encap_type) 355 + { 356 + return xfrmi_input(skb, nexthdr, spi, encap_type, AF_INET6); 357 + } 358 + 313 359 static int xfrmi_rcv_cb(struct sk_buff *skb, int err) 314 360 { 315 361 const struct xfrm_mode *inner_mode; ··· 991 945 }; 992 946 993 947 static struct xfrm6_protocol xfrmi_esp6_protocol __read_mostly = { 994 - .handler = xfrm6_rcv, 995 - .input_handler = xfrm_input, 948 + .handler = xfrmi6_rcv, 949 + .input_handler = xfrmi6_input, 996 950 .cb_handler = xfrmi_rcv_cb, 997 951 .err_handler = xfrmi6_err, 998 952 .priority = 10, ··· 1042 996 #endif 1043 997 1044 998 static struct xfrm4_protocol xfrmi_esp4_protocol __read_mostly = { 1045 - .handler = xfrm4_rcv, 1046 - .input_handler = xfrm_input, 999 + .handler = xfrmi4_rcv, 1000 + .input_handler = xfrmi4_input, 1047 1001 .cb_handler = xfrmi_rcv_cb, 1048 1002 .err_handler = xfrmi4_err, 1049 1003 .priority = 10,
+10 -4
net/xfrm/xfrm_policy.c
··· 336 336 } 337 337 if (xp->lft.hard_use_expires_seconds) { 338 338 time64_t tmo = xp->lft.hard_use_expires_seconds + 339 - (xp->curlft.use_time ? : xp->curlft.add_time) - now; 339 + (READ_ONCE(xp->curlft.use_time) ? : xp->curlft.add_time) - now; 340 340 if (tmo <= 0) 341 341 goto expired; 342 342 if (tmo < next) ··· 354 354 } 355 355 if (xp->lft.soft_use_expires_seconds) { 356 356 time64_t tmo = xp->lft.soft_use_expires_seconds + 357 - (xp->curlft.use_time ? : xp->curlft.add_time) - now; 357 + (READ_ONCE(xp->curlft.use_time) ? : xp->curlft.add_time) - now; 358 358 if (tmo <= 0) { 359 359 warn = 1; 360 360 tmo = XFRM_KM_TIMEOUT; ··· 3661 3661 return 1; 3662 3662 } 3663 3663 3664 - pol->curlft.use_time = ktime_get_real_seconds(); 3664 + /* This lockless write can happen from different cpus. */ 3665 + WRITE_ONCE(pol->curlft.use_time, ktime_get_real_seconds()); 3665 3666 3666 3667 pols[0] = pol; 3667 3668 npols++; ··· 3677 3676 xfrm_pol_put(pols[0]); 3678 3677 return 0; 3679 3678 } 3680 - pols[1]->curlft.use_time = ktime_get_real_seconds(); 3679 + /* This write can happen from different cpus. */ 3680 + WRITE_ONCE(pols[1]->curlft.use_time, 3681 + ktime_get_real_seconds()); 3681 3682 npols++; 3682 3683 } 3683 3684 } ··· 3744 3741 XFRM_INC_STATS(net, LINUX_MIB_XFRMINTMPLMISMATCH); 3745 3742 goto reject; 3746 3743 } 3744 + 3745 + if (if_id) 3746 + secpath_reset(skb); 3747 3747 3748 3748 xfrm_pols_put(pols, npols); 3749 3749 return 1;
+9 -9
net/xfrm/xfrm_state.c
··· 577 577 if (x->km.state == XFRM_STATE_EXPIRED) 578 578 goto expired; 579 579 if (x->lft.hard_add_expires_seconds) { 580 - long tmo = x->lft.hard_add_expires_seconds + 580 + time64_t tmo = x->lft.hard_add_expires_seconds + 581 581 x->curlft.add_time - now; 582 582 if (tmo <= 0) { 583 583 if (x->xflags & XFRM_SOFT_EXPIRE) { ··· 594 594 next = tmo; 595 595 } 596 596 if (x->lft.hard_use_expires_seconds) { 597 - long tmo = x->lft.hard_use_expires_seconds + 598 - (x->curlft.use_time ? : now) - now; 597 + time64_t tmo = x->lft.hard_use_expires_seconds + 598 + (READ_ONCE(x->curlft.use_time) ? : now) - now; 599 599 if (tmo <= 0) 600 600 goto expired; 601 601 if (tmo < next) ··· 604 604 if (x->km.dying) 605 605 goto resched; 606 606 if (x->lft.soft_add_expires_seconds) { 607 - long tmo = x->lft.soft_add_expires_seconds + 607 + time64_t tmo = x->lft.soft_add_expires_seconds + 608 608 x->curlft.add_time - now; 609 609 if (tmo <= 0) { 610 610 warn = 1; ··· 616 616 } 617 617 } 618 618 if (x->lft.soft_use_expires_seconds) { 619 - long tmo = x->lft.soft_use_expires_seconds + 620 - (x->curlft.use_time ? : now) - now; 619 + time64_t tmo = x->lft.soft_use_expires_seconds + 620 + (READ_ONCE(x->curlft.use_time) ? : now) - now; 621 621 if (tmo <= 0) 622 622 warn = 1; 623 623 else if (tmo < next) ··· 1906 1906 1907 1907 hrtimer_start(&x1->mtimer, ktime_set(1, 0), 1908 1908 HRTIMER_MODE_REL_SOFT); 1909 - if (x1->curlft.use_time) 1909 + if (READ_ONCE(x1->curlft.use_time)) 1910 1910 xfrm_state_check_expire(x1); 1911 1911 1912 1912 if (x->props.smark.m || x->props.smark.v || x->if_id) { ··· 1940 1940 { 1941 1941 xfrm_dev_state_update_curlft(x); 1942 1942 1943 - if (!x->curlft.use_time) 1944 - x->curlft.use_time = ktime_get_real_seconds(); 1943 + if (!READ_ONCE(x->curlft.use_time)) 1944 + WRITE_ONCE(x->curlft.use_time, ktime_get_real_seconds()); 1945 1945 1946 1946 if (x->curlft.bytes >= x->lft.hard_byte_limit || 1947 1947 x->curlft.packets >= x->lft.hard_packet_limit) {
+9
sound/pci/hda/patch_realtek.c
··· 9423 9423 SND_PCI_QUIRK(0x103c, 0x89c3, "Zbook Studio G9", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 9424 9424 SND_PCI_QUIRK(0x103c, 0x89c6, "Zbook Fury 17 G9", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9425 9425 SND_PCI_QUIRK(0x103c, 0x89ca, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9426 + SND_PCI_QUIRK(0x103c, 0x89d3, "HP EliteBook 645 G9 (MB 89D2)", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9426 9427 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 9427 9428 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED), 9428 9429 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED), ··· 9434 9433 SND_PCI_QUIRK(0x103c, 0x8ad2, "HP EliteBook 860 16 inch G9 Notebook PC", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9435 9434 SND_PCI_QUIRK(0x103c, 0x8b5d, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9436 9435 SND_PCI_QUIRK(0x103c, 0x8b5e, "HP", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 9436 + SND_PCI_QUIRK(0x103c, 0x8b7a, "HP", ALC236_FIXUP_HP_GPIO_LED), 9437 + SND_PCI_QUIRK(0x103c, 0x8b7d, "HP", ALC236_FIXUP_HP_GPIO_LED), 9438 + SND_PCI_QUIRK(0x103c, 0x8b8a, "HP", ALC236_FIXUP_HP_GPIO_LED), 9439 + SND_PCI_QUIRK(0x103c, 0x8b8b, "HP", ALC236_FIXUP_HP_GPIO_LED), 9440 + SND_PCI_QUIRK(0x103c, 0x8b8d, "HP", ALC236_FIXUP_HP_GPIO_LED), 9437 9441 SND_PCI_QUIRK(0x103c, 0x8b92, "HP", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 9438 9442 SND_PCI_QUIRK(0x103c, 0x8bf0, "HP", ALC236_FIXUP_HP_GPIO_LED), 9439 9443 SND_PCI_QUIRK(0x1043, 0x103e, "ASUS X540SA", ALC256_FIXUP_ASUS_MIC), ··· 9486 9480 SND_PCI_QUIRK(0x1043, 0x1d4e, "ASUS TM420", ALC256_FIXUP_ASUS_HPE), 9487 9481 SND_PCI_QUIRK(0x1043, 0x1e02, "ASUS UX3402", ALC245_FIXUP_CS35L41_SPI_2), 9488 9482 SND_PCI_QUIRK(0x1043, 0x1e11, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA502), 9483 + SND_PCI_QUIRK(0x1043, 0x1e12, "ASUS UM3402", ALC287_FIXUP_CS35L41_I2C_2), 9489 9484 SND_PCI_QUIRK(0x1043, 0x1e51, "ASUS Zephyrus M15", ALC294_FIXUP_ASUS_GU502_PINS), 9490 9485 SND_PCI_QUIRK(0x1043, 0x1e5e, "ASUS ROG Strix G513", ALC294_FIXUP_ASUS_G513_PINS), 9491 9486 SND_PCI_QUIRK(0x1043, 0x1e8e, "ASUS Zephyrus G15", ALC289_FIXUP_ASUS_GA401), ··· 9530 9523 SND_PCI_QUIRK(0x144d, 0xc812, "Samsung Notebook Pen S (NT950SBE-X58)", ALC298_FIXUP_SAMSUNG_AMP), 9531 9524 SND_PCI_QUIRK(0x144d, 0xc830, "Samsung Galaxy Book Ion (NT950XCJ-X716A)", ALC298_FIXUP_SAMSUNG_AMP), 9532 9525 SND_PCI_QUIRK(0x144d, 0xc832, "Samsung Galaxy Book Flex Alpha (NP730QCJ)", ALC256_FIXUP_SAMSUNG_HEADPHONE_VERY_QUIET), 9526 + SND_PCI_QUIRK(0x144d, 0xca03, "Samsung Galaxy Book2 Pro 360 (NP930QED)", ALC298_FIXUP_SAMSUNG_AMP), 9533 9527 SND_PCI_QUIRK(0x1458, 0xfa53, "Gigabyte BXBT-2807", ALC283_FIXUP_HEADSET_MIC), 9534 9528 SND_PCI_QUIRK(0x1462, 0xb120, "MSI Cubi MS-B120", ALC283_FIXUP_HEADSET_MIC), 9535 9529 SND_PCI_QUIRK(0x1462, 0xb171, "Cubi N 8GL (MS-B171)", ALC283_FIXUP_HEADSET_MIC), ··· 9709 9701 SND_PCI_QUIRK(0x1b7d, 0xa831, "Ordissimo EVE2 ", ALC269VB_FIXUP_ORDISSIMO_EVE2), /* Also known as Malata PC-B1303 */ 9710 9702 SND_PCI_QUIRK(0x1c06, 0x2013, "Lemote A1802", ALC269_FIXUP_LEMOTE_A1802), 9711 9703 SND_PCI_QUIRK(0x1c06, 0x2015, "Lemote A190X", ALC269_FIXUP_LEMOTE_A190X), 9704 + SND_PCI_QUIRK(0x1c6c, 0x1251, "Positivo N14KP6-TG", ALC288_FIXUP_DELL1_MIC_NO_PRESENCE), 9712 9705 SND_PCI_QUIRK(0x1d05, 0x1132, "TongFang PHxTxX1", ALC256_FIXUP_SET_COEF_DEFAULTS), 9713 9706 SND_PCI_QUIRK(0x1d05, 0x1096, "TongFang GMxMRxx", ALC269_FIXUP_NO_SHUTUP), 9714 9707 SND_PCI_QUIRK(0x1d05, 0x1100, "TongFang GKxNRxx", ALC269_FIXUP_NO_SHUTUP),
+5 -6
sound/pci/lx6464es/lx_core.c
··· 493 493 dev_dbg(chip->card->dev, 494 494 "CMD_08_ASK_BUFFERS: needed %d, freed %d\n", 495 495 *r_needed, *r_freed); 496 - for (i = 0; i < MAX_STREAM_BUFFER; ++i) { 497 - for (i = 0; i != chip->rmh.stat_len; ++i) 498 - dev_dbg(chip->card->dev, 499 - " stat[%d]: %x, %x\n", i, 500 - chip->rmh.stat[i], 501 - chip->rmh.stat[i] & MASK_DATA_SIZE); 496 + for (i = 0; i < MAX_STREAM_BUFFER && i < chip->rmh.stat_len; 497 + ++i) { 498 + dev_dbg(chip->card->dev, " stat[%d]: %x, %x\n", i, 499 + chip->rmh.stat[i], 500 + chip->rmh.stat[i] & MASK_DATA_SIZE); 502 501 } 503 502 } 504 503
+4 -2
sound/soc/codecs/es8326.c
··· 729 729 } 730 730 dev_dbg(component->dev, "jack-pol %x", es8326->jack_pol); 731 731 732 - ret = device_property_read_u8(component->dev, "everest,interrupt-src", &es8326->jack_pol); 732 + ret = device_property_read_u8(component->dev, "everest,interrupt-src", 733 + &es8326->interrupt_src); 733 734 if (ret != 0) { 734 735 dev_dbg(component->dev, "interrupt-src return %d", ret); 735 736 es8326->interrupt_src = ES8326_HP_DET_SRC_PIN9; 736 737 } 737 738 dev_dbg(component->dev, "interrupt-src %x", es8326->interrupt_src); 738 739 739 - ret = device_property_read_u8(component->dev, "everest,interrupt-clk", &es8326->jack_pol); 740 + ret = device_property_read_u8(component->dev, "everest,interrupt-clk", 741 + &es8326->interrupt_clk); 740 742 if (ret != 0) { 741 743 dev_dbg(component->dev, "interrupt-clk return %d", ret); 742 744 es8326->interrupt_clk = 0x45;
+1 -1
sound/soc/codecs/rt715-sdca-sdw.c
··· 167 167 } 168 168 169 169 /* set the timeout values */ 170 - prop->clk_stop_timeout = 20; 170 + prop->clk_stop_timeout = 200; 171 171 172 172 return 0; 173 173 }
+92 -43
sound/soc/codecs/tas5805m.c
··· 154 154 #define TAS5805M_VOLUME_MIN 0 155 155 156 156 struct tas5805m_priv { 157 + struct i2c_client *i2c; 157 158 struct regulator *pvdd; 158 159 struct gpio_desc *gpio_pdn_n; 159 160 ··· 166 165 int vol[2]; 167 166 bool is_powered; 168 167 bool is_muted; 168 + 169 + struct work_struct work; 170 + struct mutex lock; 169 171 }; 170 172 171 173 static void set_dsp_scale(struct regmap *rm, int offset, int vol) ··· 185 181 regmap_bulk_write(rm, offset, v, ARRAY_SIZE(v)); 186 182 } 187 183 188 - static void tas5805m_refresh(struct snd_soc_component *component) 184 + static void tas5805m_refresh(struct tas5805m_priv *tas5805m) 189 185 { 190 - struct tas5805m_priv *tas5805m = 191 - snd_soc_component_get_drvdata(component); 192 186 struct regmap *rm = tas5805m->regmap; 193 187 194 - dev_dbg(component->dev, "refresh: is_muted=%d, vol=%d/%d\n", 188 + dev_dbg(&tas5805m->i2c->dev, "refresh: is_muted=%d, vol=%d/%d\n", 195 189 tas5805m->is_muted, tas5805m->vol[0], tas5805m->vol[1]); 196 190 197 191 regmap_write(rm, REG_PAGE, 0x00); ··· 202 200 */ 203 201 set_dsp_scale(rm, 0x24, tas5805m->vol[0]); 204 202 set_dsp_scale(rm, 0x28, tas5805m->vol[1]); 203 + 204 + regmap_write(rm, REG_PAGE, 0x00); 205 + regmap_write(rm, REG_BOOK, 0x00); 205 206 206 207 /* Set/clear digital soft-mute */ 207 208 regmap_write(rm, REG_DEVICE_CTRL_2, ··· 231 226 struct tas5805m_priv *tas5805m = 232 227 snd_soc_component_get_drvdata(component); 233 228 229 + mutex_lock(&tas5805m->lock); 234 230 ucontrol->value.integer.value[0] = tas5805m->vol[0]; 235 231 ucontrol->value.integer.value[1] = tas5805m->vol[1]; 232 + mutex_unlock(&tas5805m->lock); 233 + 236 234 return 0; 237 235 } 238 236 ··· 251 243 snd_soc_kcontrol_component(kcontrol); 252 244 struct tas5805m_priv *tas5805m = 253 245 snd_soc_component_get_drvdata(component); 246 + int ret = 0; 254 247 255 248 if (!(volume_is_valid(ucontrol->value.integer.value[0]) && 256 249 volume_is_valid(ucontrol->value.integer.value[1]))) 257 250 return -EINVAL; 258 251 252 + mutex_lock(&tas5805m->lock); 259 253 if (tas5805m->vol[0] != ucontrol->value.integer.value[0] || 260 254 tas5805m->vol[1] != ucontrol->value.integer.value[1]) { 261 255 tas5805m->vol[0] = ucontrol->value.integer.value[0]; ··· 266 256 tas5805m->vol[0], tas5805m->vol[1], 267 257 tas5805m->is_powered); 268 258 if (tas5805m->is_powered) 269 - tas5805m_refresh(component); 270 - return 1; 259 + tas5805m_refresh(tas5805m); 260 + ret = 1; 271 261 } 262 + mutex_unlock(&tas5805m->lock); 272 263 273 - return 0; 264 + return ret; 274 265 } 275 266 276 267 static const struct snd_kcontrol_new tas5805m_snd_controls[] = { ··· 305 294 struct snd_soc_component *component = dai->component; 306 295 struct tas5805m_priv *tas5805m = 307 296 snd_soc_component_get_drvdata(component); 308 - struct regmap *rm = tas5805m->regmap; 309 - unsigned int chan, global1, global2; 310 297 311 298 switch (cmd) { 312 299 case SNDRV_PCM_TRIGGER_START: 313 300 case SNDRV_PCM_TRIGGER_RESUME: 314 301 case SNDRV_PCM_TRIGGER_PAUSE_RELEASE: 315 - dev_dbg(component->dev, "DSP startup\n"); 316 - 317 - /* We mustn't issue any I2C transactions until the I2S 318 - * clock is stable. Furthermore, we must allow a 5ms 319 - * delay after the first set of register writes to 320 - * allow the DSP to boot before configuring it. 321 - */ 322 - usleep_range(5000, 10000); 323 - send_cfg(rm, dsp_cfg_preboot, 324 - ARRAY_SIZE(dsp_cfg_preboot)); 325 - usleep_range(5000, 15000); 326 - send_cfg(rm, tas5805m->dsp_cfg_data, 327 - tas5805m->dsp_cfg_len); 328 - 329 - tas5805m->is_powered = true; 330 - tas5805m_refresh(component); 302 + dev_dbg(component->dev, "clock start\n"); 303 + schedule_work(&tas5805m->work); 331 304 break; 332 305 333 306 case SNDRV_PCM_TRIGGER_STOP: 334 307 case SNDRV_PCM_TRIGGER_SUSPEND: 335 308 case SNDRV_PCM_TRIGGER_PAUSE_PUSH: 336 - dev_dbg(component->dev, "DSP shutdown\n"); 337 - 338 - tas5805m->is_powered = false; 339 - 340 - regmap_write(rm, REG_PAGE, 0x00); 341 - regmap_write(rm, REG_BOOK, 0x00); 342 - 343 - regmap_read(rm, REG_CHAN_FAULT, &chan); 344 - regmap_read(rm, REG_GLOBAL_FAULT1, &global1); 345 - regmap_read(rm, REG_GLOBAL_FAULT2, &global2); 346 - 347 - dev_dbg(component->dev, 348 - "fault regs: CHAN=%02x, GLOBAL1=%02x, GLOBAL2=%02x\n", 349 - chan, global1, global2); 350 - 351 - regmap_write(rm, REG_DEVICE_CTRL_2, DCTRL2_MODE_HIZ); 352 309 break; 353 310 354 311 default: 355 312 return -EINVAL; 313 + } 314 + 315 + return 0; 316 + } 317 + 318 + static void do_work(struct work_struct *work) 319 + { 320 + struct tas5805m_priv *tas5805m = 321 + container_of(work, struct tas5805m_priv, work); 322 + struct regmap *rm = tas5805m->regmap; 323 + 324 + dev_dbg(&tas5805m->i2c->dev, "DSP startup\n"); 325 + 326 + mutex_lock(&tas5805m->lock); 327 + /* We mustn't issue any I2C transactions until the I2S 328 + * clock is stable. Furthermore, we must allow a 5ms 329 + * delay after the first set of register writes to 330 + * allow the DSP to boot before configuring it. 331 + */ 332 + usleep_range(5000, 10000); 333 + send_cfg(rm, dsp_cfg_preboot, ARRAY_SIZE(dsp_cfg_preboot)); 334 + usleep_range(5000, 15000); 335 + send_cfg(rm, tas5805m->dsp_cfg_data, tas5805m->dsp_cfg_len); 336 + 337 + tas5805m->is_powered = true; 338 + tas5805m_refresh(tas5805m); 339 + mutex_unlock(&tas5805m->lock); 340 + } 341 + 342 + static int tas5805m_dac_event(struct snd_soc_dapm_widget *w, 343 + struct snd_kcontrol *kcontrol, int event) 344 + { 345 + struct snd_soc_component *component = snd_soc_dapm_to_component(w->dapm); 346 + struct tas5805m_priv *tas5805m = 347 + snd_soc_component_get_drvdata(component); 348 + struct regmap *rm = tas5805m->regmap; 349 + 350 + if (event & SND_SOC_DAPM_PRE_PMD) { 351 + unsigned int chan, global1, global2; 352 + 353 + dev_dbg(component->dev, "DSP shutdown\n"); 354 + cancel_work_sync(&tas5805m->work); 355 + 356 + mutex_lock(&tas5805m->lock); 357 + if (tas5805m->is_powered) { 358 + tas5805m->is_powered = false; 359 + 360 + regmap_write(rm, REG_PAGE, 0x00); 361 + regmap_write(rm, REG_BOOK, 0x00); 362 + 363 + regmap_read(rm, REG_CHAN_FAULT, &chan); 364 + regmap_read(rm, REG_GLOBAL_FAULT1, &global1); 365 + regmap_read(rm, REG_GLOBAL_FAULT2, &global2); 366 + 367 + dev_dbg(component->dev, "fault regs: CHAN=%02x, " 368 + "GLOBAL1=%02x, GLOBAL2=%02x\n", 369 + chan, global1, global2); 370 + 371 + regmap_write(rm, REG_DEVICE_CTRL_2, DCTRL2_MODE_HIZ); 372 + } 373 + mutex_unlock(&tas5805m->lock); 356 374 } 357 375 358 376 return 0; ··· 394 354 395 355 static const struct snd_soc_dapm_widget tas5805m_dapm_widgets[] = { 396 356 SND_SOC_DAPM_AIF_IN("DAC IN", "Playback", 0, SND_SOC_NOPM, 0, 0), 397 - SND_SOC_DAPM_DAC("DAC", NULL, SND_SOC_NOPM, 0, 0), 357 + SND_SOC_DAPM_DAC_E("DAC", NULL, SND_SOC_NOPM, 0, 0, 358 + tas5805m_dac_event, SND_SOC_DAPM_PRE_PMD), 398 359 SND_SOC_DAPM_OUTPUT("OUT") 399 360 }; 400 361 ··· 416 375 struct tas5805m_priv *tas5805m = 417 376 snd_soc_component_get_drvdata(component); 418 377 378 + mutex_lock(&tas5805m->lock); 419 379 dev_dbg(component->dev, "set mute=%d (is_powered=%d)\n", 420 380 mute, tas5805m->is_powered); 381 + 421 382 tas5805m->is_muted = mute; 422 383 if (tas5805m->is_powered) 423 - tas5805m_refresh(component); 384 + tas5805m_refresh(tas5805m); 385 + mutex_unlock(&tas5805m->lock); 424 386 425 387 return 0; 426 388 } ··· 478 434 if (!tas5805m) 479 435 return -ENOMEM; 480 436 437 + tas5805m->i2c = i2c; 481 438 tas5805m->pvdd = devm_regulator_get(dev, "pvdd"); 482 439 if (IS_ERR(tas5805m->pvdd)) { 483 440 dev_err(dev, "failed to get pvdd supply: %ld\n", ··· 552 507 gpiod_set_value(tas5805m->gpio_pdn_n, 1); 553 508 usleep_range(10000, 15000); 554 509 510 + INIT_WORK(&tas5805m->work, do_work); 511 + mutex_init(&tas5805m->lock); 512 + 555 513 /* Don't register through devm. We need to be able to unregister 556 514 * the component prior to deasserting PDN# 557 515 */ ··· 575 527 struct device *dev = &i2c->dev; 576 528 struct tas5805m_priv *tas5805m = dev_get_drvdata(dev); 577 529 530 + cancel_work_sync(&tas5805m->work); 578 531 snd_soc_unregister_component(dev); 579 532 gpiod_set_value(tas5805m->gpio_pdn_n, 0); 580 533 usleep_range(10000, 15000);
+1
sound/soc/fsl/fsl_sai.c
··· 1141 1141 1142 1142 sai->verid.version = val & 1143 1143 (FSL_SAI_VERID_MAJOR_MASK | FSL_SAI_VERID_MINOR_MASK); 1144 + sai->verid.version >>= FSL_SAI_VERID_MINOR_SHIFT; 1144 1145 sai->verid.feature = val & FSL_SAI_VERID_FEATURE_MASK; 1145 1146 1146 1147 ret = regmap_read(sai->regmap, FSL_SAI_PARAM, &val);
+6 -2
sound/soc/soc-topology.c
··· 1401 1401 1402 1402 template.num_kcontrols = le32_to_cpu(w->num_kcontrols); 1403 1403 kc = devm_kcalloc(tplg->dev, le32_to_cpu(w->num_kcontrols), sizeof(*kc), GFP_KERNEL); 1404 - if (!kc) 1404 + if (!kc) { 1405 + ret = -ENOMEM; 1405 1406 goto hdr_err; 1407 + } 1406 1408 1407 1409 kcontrol_type = devm_kcalloc(tplg->dev, le32_to_cpu(w->num_kcontrols), sizeof(unsigned int), 1408 1410 GFP_KERNEL); 1409 - if (!kcontrol_type) 1411 + if (!kcontrol_type) { 1412 + ret = -ENOMEM; 1410 1413 goto hdr_err; 1414 + } 1411 1415 1412 1416 for (i = 0; i < le32_to_cpu(w->num_kcontrols); i++) { 1413 1417 control_hdr = (struct snd_soc_tplg_ctl_hdr *)tplg->pos;
+15 -21
sound/soc/sof/amd/acp.c
··· 318 318 { 319 319 struct snd_sof_dev *sdev = context; 320 320 const struct sof_amd_acp_desc *desc = get_chip_info(sdev->pdata); 321 - unsigned int base = desc->dsp_intr_base; 322 321 unsigned int val, count = ACP_HW_SEM_RETRY_COUNT; 323 322 324 323 val = snd_sof_dsp_read(sdev, ACP_DSP_BAR, desc->ext_intr_stat); ··· 327 328 return IRQ_HANDLED; 328 329 } 329 330 330 - val = snd_sof_dsp_read(sdev, ACP_DSP_BAR, base + DSP_SW_INTR_STAT_OFFSET); 331 - if (val & ACP_DSP_TO_HOST_IRQ) { 332 - while (snd_sof_dsp_read(sdev, ACP_DSP_BAR, desc->hw_semaphore_offset)) { 333 - /* Wait until acquired HW Semaphore lock or timeout */ 334 - count--; 335 - if (!count) { 336 - dev_err(sdev->dev, "%s: Failed to acquire HW lock\n", __func__); 337 - return IRQ_NONE; 338 - } 331 + while (snd_sof_dsp_read(sdev, ACP_DSP_BAR, desc->hw_semaphore_offset)) { 332 + /* Wait until acquired HW Semaphore lock or timeout */ 333 + count--; 334 + if (!count) { 335 + dev_err(sdev->dev, "%s: Failed to acquire HW lock\n", __func__); 336 + return IRQ_NONE; 339 337 } 340 - 341 - sof_ops(sdev)->irq_thread(irq, sdev); 342 - val |= ACP_DSP_TO_HOST_IRQ; 343 - snd_sof_dsp_write(sdev, ACP_DSP_BAR, base + DSP_SW_INTR_STAT_OFFSET, val); 344 - 345 - /* Unlock or Release HW Semaphore */ 346 - snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->hw_semaphore_offset, 0x0); 347 - 348 - return IRQ_HANDLED; 349 338 } 350 339 351 - return IRQ_NONE; 340 + sof_ops(sdev)->irq_thread(irq, sdev); 341 + /* Unlock or Release HW Semaphore */ 342 + snd_sof_dsp_write(sdev, ACP_DSP_BAR, desc->hw_semaphore_offset, 0x0); 343 + 344 + return IRQ_HANDLED; 352 345 }; 353 346 354 347 static irqreturn_t acp_irq_handler(int irq, void *dev_id) ··· 351 360 unsigned int val; 352 361 353 362 val = snd_sof_dsp_read(sdev, ACP_DSP_BAR, base + DSP_SW_INTR_STAT_OFFSET); 354 - if (val) 363 + if (val) { 364 + val |= ACP_DSP_TO_HOST_IRQ; 365 + snd_sof_dsp_write(sdev, ACP_DSP_BAR, base + DSP_SW_INTR_STAT_OFFSET, val); 355 366 return IRQ_WAKE_THREAD; 367 + } 356 368 357 369 return IRQ_NONE; 358 370 }
+3
sound/synth/emux/emux_nrpn.c
··· 349 349 snd_emux_xg_control(struct snd_emux_port *port, struct snd_midi_channel *chan, 350 350 int param) 351 351 { 352 + if (param >= ARRAY_SIZE(chan->control)) 353 + return -EINVAL; 354 + 352 355 return send_converted_effect(xg_effects, ARRAY_SIZE(xg_effects), 353 356 port, chan, param, 354 357 chan->control[param],
-4
tools/testing/memblock/internal.h
··· 15 15 16 16 struct page {}; 17 17 18 - void __free_pages_core(struct page *page, unsigned int order) 19 - { 20 - } 21 - 22 18 void memblock_free_pages(struct page *page, unsigned long pfn, 23 19 unsigned int order) 24 20 {
+1 -1
tools/testing/selftests/drivers/net/ocelot/tc_flower_chains.sh
··· 246 246 bridge vlan add dev $swp2 vid 300 247 247 248 248 tc filter add dev $swp1 ingress chain $(IS1 2) pref 3 \ 249 - protocol 802.1Q flower skip_sw vlan_id 200 \ 249 + protocol 802.1Q flower skip_sw vlan_id 200 src_mac $h1_mac \ 250 250 action vlan modify id 300 \ 251 251 action goto chain $(IS2 0 0) 252 252
+2 -2
tools/testing/selftests/net/forwarding/lib.sh
··· 914 914 local value=$1; shift 915 915 916 916 SYSCTL_ORIG[$key]=$(sysctl -n $key) 917 - sysctl -qw $key=$value 917 + sysctl -qw $key="$value" 918 918 } 919 919 920 920 sysctl_restore() 921 921 { 922 922 local key=$1; shift 923 923 924 - sysctl -qw $key=${SYSCTL_ORIG["$key"]} 924 + sysctl -qw $key="${SYSCTL_ORIG[$key]}" 925 925 } 926 926 927 927 forwarding_enable()
+17 -5
tools/testing/selftests/net/mptcp/mptcp_join.sh
··· 498 498 kill_wait $evts_ns2_pid 499 499 } 500 500 501 + kill_tests_wait() 502 + { 503 + kill -SIGUSR1 $(ip netns pids $ns2) $(ip netns pids $ns1) 504 + wait 505 + } 506 + 501 507 pm_nl_set_limits() 502 508 { 503 509 local ns=$1 ··· 1700 1694 local subflow_nr=$3 1701 1695 local cnt1 1702 1696 local cnt2 1697 + local dump_stats 1703 1698 1704 1699 if [ -n "${need_title}" ]; then 1705 1700 printf "%03u %-36s %s" "${TEST_COUNT}" "${TEST_NAME}" "${msg}" ··· 1718 1711 echo "[ ok ]" 1719 1712 fi 1720 1713 1721 - [ "${dump_stats}" = 1 ] && ( ss -N $ns1 -tOni ; ss -N $ns1 -tOni | grep token; ip -n $ns1 mptcp endpoint ) 1714 + if [ "${dump_stats}" = 1 ]; then 1715 + ss -N $ns1 -tOni 1716 + ss -N $ns1 -tOni | grep token 1717 + ip -n $ns1 mptcp endpoint 1718 + dump_stats 1719 + fi 1722 1720 } 1723 1721 1724 1722 chk_link_usage() ··· 3061 3049 pm_nl_set_limits $ns1 2 2 3062 3050 pm_nl_set_limits $ns2 2 2 3063 3051 pm_nl_add_endpoint $ns1 10.0.2.1 flags signal 3064 - run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow & 3052 + run_tests $ns1 $ns2 10.0.1.1 0 0 0 slow 2>/dev/null & 3065 3053 3066 3054 wait_mpj $ns1 3067 3055 pm_nl_check_endpoint 1 "creation" \ ··· 3074 3062 pm_nl_add_endpoint $ns2 10.0.2.2 flags signal 3075 3063 pm_nl_check_endpoint 0 "modif is allowed" \ 3076 3064 $ns2 10.0.2.2 id 1 flags signal 3077 - wait 3065 + kill_tests_wait 3078 3066 fi 3079 3067 3080 3068 if reset "delete and re-add"; then 3081 3069 pm_nl_set_limits $ns1 1 1 3082 3070 pm_nl_set_limits $ns2 1 1 3083 3071 pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow 3084 - run_tests $ns1 $ns2 10.0.1.1 4 0 0 slow & 3072 + run_tests $ns1 $ns2 10.0.1.1 4 0 0 speed_20 2>/dev/null & 3085 3073 3086 3074 wait_mpj $ns2 3087 3075 pm_nl_del_endpoint $ns2 2 10.0.2.2 ··· 3091 3079 pm_nl_add_endpoint $ns2 10.0.2.2 dev ns2eth2 flags subflow 3092 3080 wait_mpj $ns2 3093 3081 chk_subflow_nr "" "after re-add" 2 3094 - wait 3082 + kill_tests_wait 3095 3083 fi 3096 3084 } 3097 3085
+5 -13
tools/testing/selftests/net/test_vxlan_vnifiltering.sh
··· 293 293 elif [[ -n $vtype && $vtype == "vnifilterg" ]]; then 294 294 # Add per vni group config with 'bridge vni' api 295 295 if [ -n "$group" ]; then 296 - if [ "$family" == "v4" ]; then 297 - if [ $mcast -eq 1 ]; then 298 - bridge -netns hv-$hvid vni add dev $vxlandev vni $tid group $group 299 - else 300 - bridge -netns hv-$hvid vni add dev $vxlandev vni $tid remote $group 301 - fi 302 - else 303 - if [ $mcast -eq 1 ]; then 304 - bridge -netns hv-$hvid vni add dev $vxlandev vni $tid group6 $group 305 - else 306 - bridge -netns hv-$hvid vni add dev $vxlandev vni $tid remote6 $group 307 - fi 308 - fi 296 + if [ $mcast -eq 1 ]; then 297 + bridge -netns hv-$hvid vni add dev $vxlandev vni $tid group $group 298 + else 299 + bridge -netns hv-$hvid vni add dev $vxlandev vni $tid remote $group 300 + fi 309 301 fi 310 302 fi 311 303 done