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

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

Cross-merge networking fixes after downstream PR (net-6.18-rc5).

Conflicts:

drivers/net/wireless/ath/ath12k/mac.c
9222582ec524 ("Revert "wifi: ath12k: Fix missing station power save configuration"")
6917e268c433 ("wifi: ath12k: Defer vdev bring-up until CSA finalize to avoid stale beacon")
https://lore.kernel.org/11cece9f7e36c12efd732baa5718239b1bf8c950.camel@sipsolutions.net

Adjacent changes:

drivers/net/ethernet/intel/Kconfig
b1d16f7c0063 ("libie: depend on DEBUG_FS when building LIBIE_FWLOG")
93f53db9f9dc ("ice: switch to Page Pool")

Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+2356 -950
+1
.mailmap
··· 644 644 Quentin Monnet <qmo@kernel.org> <quentin.monnet@netronome.com> 645 645 Quentin Monnet <qmo@kernel.org> <quentin@isovalent.com> 646 646 Quentin Perret <qperret@qperret.net> <quentin.perret@arm.com> 647 + Rae Moar <raemoar63@gmail.com> <rmoar@google.com> 647 648 Rafael J. Wysocki <rjw@rjwysocki.net> <rjw@sisk.pl> 648 649 Rajeev Nandan <quic_rajeevny@quicinc.com> <rajeevny@codeaurora.org> 649 650 Rajendra Nayak <quic_rjendra@quicinc.com> <rnayak@codeaurora.org>
+2 -2
Documentation/devicetree/bindings/sound/qcom,pm4125-sdw.yaml
··· 32 32 33 33 $ref: /schemas/types.yaml#/definitions/uint32-array 34 34 minItems: 2 35 - maxItems: 2 35 + maxItems: 4 36 36 items: 37 37 enum: [1, 2, 3, 4] 38 38 ··· 48 48 49 49 $ref: /schemas/types.yaml#/definitions/uint32-array 50 50 minItems: 2 51 - maxItems: 2 51 + maxItems: 5 52 52 items: 53 53 enum: [1, 2, 3, 4, 5] 54 54
+9 -3
MAINTAINERS
··· 4819 4819 F: drivers/net/dsa/bcm_sf2* 4820 4820 F: include/linux/dsa/brcm.h 4821 4821 F: include/linux/platform_data/b53.h 4822 + F: net/dsa/tag_brcm.c 4822 4823 4823 4824 BROADCOM BCM2711/BCM2835 ARM ARCHITECTURE 4824 4825 M: Florian Fainelli <florian.fainelli@broadcom.com> ··· 12522 12521 F: include/linux/net/intel/*/ 12523 12522 12524 12523 INTEL ETHERNET PROTOCOL DRIVER FOR RDMA 12524 + M: Krzysztof Czurylo <krzysztof.czurylo@intel.com> 12525 12525 M: Tatyana Nikolova <tatyana.e.nikolova@intel.com> 12526 12526 L: linux-rdma@vger.kernel.org 12527 12527 S: Supported ··· 12863 12861 K: \bSGX_ 12864 12862 12865 12863 INTEL SKYLAKE INT3472 ACPI DEVICE DRIVER 12866 - M: Daniel Scally <djrscally@gmail.com> 12864 + M: Daniel Scally <dan.scally@ideasonboard.com> 12865 + M: Sakari Ailus <sakari.ailus@linux.intel.com> 12867 12866 S: Maintained 12868 12867 F: drivers/platform/x86/intel/int3472/ 12869 12868 F: include/linux/platform_data/x86/int3472.h ··· 13428 13425 F: scripts/Makefile.kasan 13429 13426 13430 13427 KCONFIG 13428 + M: Nathan Chancellor <nathan@kernel.org> 13429 + M: Nicolas Schier <nsc@kernel.org> 13431 13430 L: linux-kbuild@vger.kernel.org 13432 - S: Orphan 13431 + S: Odd Fixes 13433 13432 Q: https://patchwork.kernel.org/project/linux-kbuild/list/ 13433 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/kbuild/linux.git 13434 13434 F: Documentation/kbuild/kconfig* 13435 13435 F: scripts/Kconfig.include 13436 13436 F: scripts/kconfig/ ··· 13618 13612 KERNEL UNIT TESTING FRAMEWORK (KUnit) 13619 13613 M: Brendan Higgins <brendan.higgins@linux.dev> 13620 13614 M: David Gow <davidgow@google.com> 13621 - R: Rae Moar <rmoar@google.com> 13615 + R: Rae Moar <raemoar63@gmail.com> 13622 13616 L: linux-kselftest@vger.kernel.org 13623 13617 L: kunit-dev@googlegroups.com 13624 13618 S: Maintained
+1 -1
Makefile
··· 2 2 VERSION = 6 3 3 PATCHLEVEL = 18 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc3 5 + EXTRAVERSION = -rc4 6 6 NAME = Baby Opossum Posse 7 7 8 8 # *DOCUMENTATION*
+3 -2
arch/arm64/net/bpf_jit_comp.c
··· 1213 1213 u8 src = bpf2a64[insn->src_reg]; 1214 1214 const u8 tmp = bpf2a64[TMP_REG_1]; 1215 1215 const u8 tmp2 = bpf2a64[TMP_REG_2]; 1216 + const u8 tmp3 = bpf2a64[TMP_REG_3]; 1216 1217 const u8 fp = bpf2a64[BPF_REG_FP]; 1217 1218 const u8 arena_vm_base = bpf2a64[ARENA_VM_START]; 1218 1219 const u8 priv_sp = bpf2a64[PRIVATE_SP]; ··· 1758 1757 case BPF_ST | BPF_PROBE_MEM32 | BPF_W: 1759 1758 case BPF_ST | BPF_PROBE_MEM32 | BPF_DW: 1760 1759 if (BPF_MODE(insn->code) == BPF_PROBE_MEM32) { 1761 - emit(A64_ADD(1, tmp2, dst, arena_vm_base), ctx); 1762 - dst = tmp2; 1760 + emit(A64_ADD(1, tmp3, dst, arena_vm_base), ctx); 1761 + dst = tmp3; 1763 1762 } 1764 1763 if (dst == fp) { 1765 1764 dst_adj = ctx->priv_sp_used ? priv_sp : A64_SP;
+1 -1
arch/loongarch/Makefile
··· 109 109 ifdef CONFIG_RUSTC_HAS_ANNOTATE_TABLEJUMP 110 110 KBUILD_RUSTFLAGS += -Cllvm-args=--loongarch-annotate-tablejump 111 111 else 112 - KBUILD_RUSTFLAGS += -Zno-jump-tables # keep compatibility with older compilers 112 + KBUILD_RUSTFLAGS += $(if $(call rustc-min-version,109300),-Cjump-tables=n,-Zno-jump-tables) # keep compatibility with older compilers 113 113 endif 114 114 ifdef CONFIG_LTO_CLANG 115 115 # The annotate-tablejump option can not be passed to LLVM backend when LTO is enabled.
-1
arch/s390/Kconfig
··· 158 158 select ARCH_WANT_IRQS_OFF_ACTIVATE_MM 159 159 select ARCH_WANT_KERNEL_PMD_MKWRITE 160 160 select ARCH_WANT_LD_ORPHAN_WARN 161 - select ARCH_WANT_OPTIMIZE_HUGETLB_VMEMMAP 162 161 select ARCH_WANTS_THP_SWAP 163 162 select BUILDTIME_TABLE_SORT 164 163 select CLONE_BACKWARDS2
+9 -5
arch/s390/configs/debug_defconfig
··· 101 101 CONFIG_MEMORY_HOTPLUG=y 102 102 CONFIG_MEMORY_HOTREMOVE=y 103 103 CONFIG_KSM=y 104 + CONFIG_PERSISTENT_HUGE_ZERO_FOLIO=y 104 105 CONFIG_TRANSPARENT_HUGEPAGE=y 105 106 CONFIG_CMA_DEBUGFS=y 106 107 CONFIG_CMA_SYSFS=y ··· 124 123 CONFIG_TLS_TOE=y 125 124 CONFIG_XFRM_USER=m 126 125 CONFIG_NET_KEY=m 127 - CONFIG_XDP_SOCKETS=y 128 - CONFIG_XDP_SOCKETS_DIAG=m 129 - CONFIG_DIBS=y 130 - CONFIG_DIBS_LO=y 131 126 CONFIG_SMC=m 132 127 CONFIG_SMC_DIAG=m 128 + CONFIG_DIBS=y 129 + CONFIG_DIBS_LO=y 130 + CONFIG_XDP_SOCKETS=y 131 + CONFIG_XDP_SOCKETS_DIAG=m 133 132 CONFIG_INET=y 134 133 CONFIG_IP_MULTICAST=y 135 134 CONFIG_IP_ADVANCED_ROUTER=y ··· 473 472 CONFIG_SCSI_DH_ALUA=m 474 473 CONFIG_MD=y 475 474 CONFIG_BLK_DEV_MD=y 475 + CONFIG_MD_LLBITMAP=y 476 476 # CONFIG_MD_BITMAP_FILE is not set 477 477 CONFIG_MD_LINEAR=m 478 478 CONFIG_MD_CLUSTER=m ··· 656 654 CONFIG_JFS_SECURITY=y 657 655 CONFIG_JFS_STATISTICS=y 658 656 CONFIG_XFS_FS=y 657 + CONFIG_XFS_SUPPORT_V4=y 658 + CONFIG_XFS_SUPPORT_ASCII_CI=y 659 659 CONFIG_XFS_QUOTA=y 660 660 CONFIG_XFS_POSIX_ACL=y 661 661 CONFIG_XFS_RT=y 662 + # CONFIG_XFS_ONLINE_SCRUB is not set 662 663 CONFIG_XFS_DEBUG=y 663 664 CONFIG_GFS2_FS=m 664 665 CONFIG_GFS2_FS_LOCKING_DLM=y ··· 671 666 CONFIG_BTRFS_DEBUG=y 672 667 CONFIG_BTRFS_ASSERT=y 673 668 CONFIG_NILFS2_FS=m 674 - CONFIG_FS_DAX=y 675 669 CONFIG_EXPORTFS_BLOCK_OPS=y 676 670 CONFIG_FS_ENCRYPTION=y 677 671 CONFIG_FS_VERITY=y
+9 -5
arch/s390/configs/defconfig
··· 94 94 CONFIG_MEMORY_HOTPLUG=y 95 95 CONFIG_MEMORY_HOTREMOVE=y 96 96 CONFIG_KSM=y 97 + CONFIG_PERSISTENT_HUGE_ZERO_FOLIO=y 97 98 CONFIG_TRANSPARENT_HUGEPAGE=y 98 99 CONFIG_CMA_SYSFS=y 99 100 CONFIG_CMA_AREAS=7 ··· 115 114 CONFIG_TLS_TOE=y 116 115 CONFIG_XFRM_USER=m 117 116 CONFIG_NET_KEY=m 118 - CONFIG_XDP_SOCKETS=y 119 - CONFIG_XDP_SOCKETS_DIAG=m 120 - CONFIG_DIBS=y 121 - CONFIG_DIBS_LO=y 122 117 CONFIG_SMC=m 123 118 CONFIG_SMC_DIAG=m 119 + CONFIG_DIBS=y 120 + CONFIG_DIBS_LO=y 121 + CONFIG_XDP_SOCKETS=y 122 + CONFIG_XDP_SOCKETS_DIAG=m 124 123 CONFIG_INET=y 125 124 CONFIG_IP_MULTICAST=y 126 125 CONFIG_IP_ADVANCED_ROUTER=y ··· 463 462 CONFIG_SCSI_DH_ALUA=m 464 463 CONFIG_MD=y 465 464 CONFIG_BLK_DEV_MD=y 465 + CONFIG_MD_LLBITMAP=y 466 466 # CONFIG_MD_BITMAP_FILE is not set 467 467 CONFIG_MD_LINEAR=m 468 468 CONFIG_MD_CLUSTER=m ··· 646 644 CONFIG_JFS_SECURITY=y 647 645 CONFIG_JFS_STATISTICS=y 648 646 CONFIG_XFS_FS=y 647 + CONFIG_XFS_SUPPORT_V4=y 648 + CONFIG_XFS_SUPPORT_ASCII_CI=y 649 649 CONFIG_XFS_QUOTA=y 650 650 CONFIG_XFS_POSIX_ACL=y 651 651 CONFIG_XFS_RT=y 652 + # CONFIG_XFS_ONLINE_SCRUB is not set 652 653 CONFIG_GFS2_FS=m 653 654 CONFIG_GFS2_FS_LOCKING_DLM=y 654 655 CONFIG_OCFS2_FS=m 655 656 CONFIG_BTRFS_FS=y 656 657 CONFIG_BTRFS_FS_POSIX_ACL=y 657 658 CONFIG_NILFS2_FS=m 658 - CONFIG_FS_DAX=y 659 659 CONFIG_EXPORTFS_BLOCK_OPS=y 660 660 CONFIG_FS_ENCRYPTION=y 661 661 CONFIG_FS_VERITY=y
-1
arch/s390/configs/zfcpdump_defconfig
··· 33 33 CONFIG_DEVTMPFS=y 34 34 CONFIG_DEVTMPFS_SAFE=y 35 35 CONFIG_BLK_DEV_RAM=y 36 - # CONFIG_DCSSBLK is not set 37 36 # CONFIG_DASD is not set 38 37 CONFIG_ENCLOSURE_SERVICES=y 39 38 CONFIG_SCSI=y
+34 -18
arch/s390/crypto/phmac_s390.c
··· 169 169 u64 buflen[2]; 170 170 }; 171 171 172 + enum async_op { 173 + OP_NOP = 0, 174 + OP_UPDATE, 175 + OP_FINAL, 176 + OP_FINUP, 177 + }; 178 + 172 179 /* phmac request context */ 173 180 struct phmac_req_ctx { 174 181 struct hash_walk_helper hwh; 175 182 struct kmac_sha2_ctx kmac_ctx; 176 - bool final; 183 + enum async_op async_op; 177 184 }; 178 185 179 186 /* ··· 617 610 * using engine to serialize requests. 618 611 */ 619 612 if (rc == 0 || rc == -EKEYEXPIRED) { 613 + req_ctx->async_op = OP_UPDATE; 620 614 atomic_inc(&tfm_ctx->via_engine_ctr); 621 615 rc = crypto_transfer_hash_request_to_engine(phmac_crypto_engine, req); 622 616 if (rc != -EINPROGRESS) ··· 655 647 * using engine to serialize requests. 656 648 */ 657 649 if (rc == 0 || rc == -EKEYEXPIRED) { 658 - req->nbytes = 0; 659 - req_ctx->final = true; 650 + req_ctx->async_op = OP_FINAL; 660 651 atomic_inc(&tfm_ctx->via_engine_ctr); 661 652 rc = crypto_transfer_hash_request_to_engine(phmac_crypto_engine, req); 662 653 if (rc != -EINPROGRESS) ··· 683 676 if (rc) 684 677 goto out; 685 678 679 + req_ctx->async_op = OP_FINUP; 680 + 686 681 /* Try synchronous operations if no active engine usage */ 687 682 if (!atomic_read(&tfm_ctx->via_engine_ctr)) { 688 683 rc = phmac_kmac_update(req, false); 689 684 if (rc == 0) 690 - req->nbytes = 0; 685 + req_ctx->async_op = OP_FINAL; 691 686 } 692 - if (!rc && !req->nbytes && !atomic_read(&tfm_ctx->via_engine_ctr)) { 687 + if (!rc && req_ctx->async_op == OP_FINAL && 688 + !atomic_read(&tfm_ctx->via_engine_ctr)) { 693 689 rc = phmac_kmac_final(req, false); 694 690 if (rc == 0) 695 691 goto out; ··· 704 694 * using engine to serialize requests. 705 695 */ 706 696 if (rc == 0 || rc == -EKEYEXPIRED) { 707 - req_ctx->final = true; 697 + /* req->async_op has been set to either OP_FINUP or OP_FINAL */ 708 698 atomic_inc(&tfm_ctx->via_engine_ctr); 709 699 rc = crypto_transfer_hash_request_to_engine(phmac_crypto_engine, req); 710 700 if (rc != -EINPROGRESS) ··· 865 855 866 856 /* 867 857 * Three kinds of requests come in here: 868 - * update when req->nbytes > 0 and req_ctx->final is false 869 - * final when req->nbytes = 0 and req_ctx->final is true 870 - * finup when req->nbytes > 0 and req_ctx->final is true 871 - * For update and finup the hwh walk needs to be prepared and 872 - * up to date but the actual nr of bytes in req->nbytes may be 873 - * any non zero number. For final there is no hwh walk needed. 858 + * 1. req->async_op == OP_UPDATE with req->nbytes > 0 859 + * 2. req->async_op == OP_FINUP with req->nbytes > 0 860 + * 3. req->async_op == OP_FINAL 861 + * For update and finup the hwh walk has already been prepared 862 + * by the caller. For final there is no hwh walk needed. 874 863 */ 875 864 876 - if (req->nbytes) { 865 + switch (req_ctx->async_op) { 866 + case OP_UPDATE: 867 + case OP_FINUP: 877 868 rc = phmac_kmac_update(req, true); 878 869 if (rc == -EKEYEXPIRED) { 879 870 /* ··· 891 880 hwh_advance(hwh, rc); 892 881 goto out; 893 882 } 894 - req->nbytes = 0; 895 - } 896 - 897 - if (req_ctx->final) { 883 + if (req_ctx->async_op == OP_UPDATE) 884 + break; 885 + req_ctx->async_op = OP_FINAL; 886 + fallthrough; 887 + case OP_FINAL: 898 888 rc = phmac_kmac_final(req, true); 899 889 if (rc == -EKEYEXPIRED) { 900 890 /* ··· 909 897 cond_resched(); 910 898 return -ENOSPC; 911 899 } 900 + break; 901 + default: 902 + /* unknown/unsupported/unimplemented asynch op */ 903 + return -EOPNOTSUPP; 912 904 } 913 905 914 906 out: 915 - if (rc || req_ctx->final) 907 + if (rc || req_ctx->async_op == OP_FINAL) 916 908 memzero_explicit(kmac_ctx, sizeof(*kmac_ctx)); 917 909 pr_debug("request complete with rc=%d\n", rc); 918 910 local_bh_disable();
-1
arch/s390/include/asm/pci.h
··· 145 145 u8 has_resources : 1; 146 146 u8 is_physfn : 1; 147 147 u8 util_str_avail : 1; 148 - u8 irqs_registered : 1; 149 148 u8 tid_avail : 1; 150 149 u8 rtr_avail : 1; /* Relaxed translation allowed */ 151 150 unsigned int devfn; /* DEVFN part of the RID*/
+7 -12
arch/s390/mm/dump_pagetables.c
··· 291 291 292 292 static int add_marker(unsigned long start, unsigned long end, const char *name) 293 293 { 294 - size_t oldsize, newsize; 294 + struct addr_marker *new; 295 + size_t newsize; 295 296 296 - oldsize = markers_cnt * sizeof(*markers); 297 - newsize = oldsize + 2 * sizeof(*markers); 298 - if (!oldsize) 299 - markers = kvmalloc(newsize, GFP_KERNEL); 300 - else 301 - markers = kvrealloc(markers, newsize, GFP_KERNEL); 302 - if (!markers) 303 - goto error; 297 + newsize = (markers_cnt + 2) * sizeof(*markers); 298 + new = kvrealloc(markers, newsize, GFP_KERNEL); 299 + if (!new) 300 + return -ENOMEM; 301 + markers = new; 304 302 markers[markers_cnt].is_start = 1; 305 303 markers[markers_cnt].start_address = start; 306 304 markers[markers_cnt].size = end - start; ··· 310 312 markers[markers_cnt].name = name; 311 313 markers_cnt++; 312 314 return 0; 313 - error: 314 - markers_cnt = 0; 315 - return -ENOMEM; 316 315 } 317 316 318 317 static int pt_dump_init(void)
+2 -2
arch/s390/pci/pci_event.c
··· 188 188 * is unbound or probed and that userspace can't access its 189 189 * configuration space while we perform recovery. 190 190 */ 191 - pci_dev_lock(pdev); 191 + device_lock(&pdev->dev); 192 192 if (pdev->error_state == pci_channel_io_perm_failure) { 193 193 ers_res = PCI_ERS_RESULT_DISCONNECT; 194 194 goto out_unlock; ··· 257 257 driver->err_handler->resume(pdev); 258 258 pci_uevent_ers(pdev, PCI_ERS_RESULT_RECOVERED); 259 259 out_unlock: 260 - pci_dev_unlock(pdev); 260 + device_unlock(&pdev->dev); 261 261 zpci_report_status(zdev, "recovery", status_str); 262 262 263 263 return ers_res;
+1 -8
arch/s390/pci/pci_irq.c
··· 107 107 else 108 108 rc = zpci_set_airq(zdev); 109 109 110 - if (!rc) 111 - zdev->irqs_registered = 1; 112 - 113 110 return rc; 114 111 } 115 112 ··· 119 122 rc = zpci_clear_directed_irq(zdev); 120 123 else 121 124 rc = zpci_clear_airq(zdev); 122 - 123 - if (!rc) 124 - zdev->irqs_registered = 0; 125 125 126 126 return rc; 127 127 } ··· 421 427 { 422 428 struct zpci_dev *zdev = to_zpci(pdev); 423 429 424 - if (!zdev->irqs_registered) 425 - zpci_set_irq(zdev); 430 + zpci_set_irq(zdev); 426 431 return true; 427 432 } 428 433
+2 -2
arch/x86/Makefile
··· 75 75 # 76 76 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=53383 77 77 # 78 - KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx 78 + KBUILD_CFLAGS += -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -mno-sse4a 79 79 KBUILD_RUSTFLAGS += --target=$(objtree)/scripts/target.json 80 80 KBUILD_RUSTFLAGS += -Ctarget-feature=-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2 81 81 ··· 98 98 # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104816 99 99 # 100 100 KBUILD_CFLAGS += $(call cc-option,-fcf-protection=branch -fno-jump-tables) 101 - KBUILD_RUSTFLAGS += -Zcf-protection=branch -Zno-jump-tables 101 + KBUILD_RUSTFLAGS += -Zcf-protection=branch $(if $(call rustc-min-version,109300),-Cjump-tables=n,-Zno-jump-tables) 102 102 else 103 103 KBUILD_CFLAGS += $(call cc-option,-fcf-protection=none) 104 104 endif
+1
arch/x86/events/intel/core.c
··· 7596 7596 break; 7597 7597 7598 7598 case INTEL_PANTHERLAKE_L: 7599 + case INTEL_WILDCATLAKE_L: 7599 7600 pr_cont("Pantherlake Hybrid events, "); 7600 7601 name = "pantherlake_hybrid"; 7601 7602 goto lnl_common;
+2 -1
arch/x86/events/intel/ds.c
··· 317 317 { 318 318 u64 val; 319 319 320 - WARN_ON_ONCE(hybrid_pmu(event->pmu)->pmu_type == hybrid_big); 320 + WARN_ON_ONCE(is_hybrid() && 321 + hybrid_pmu(event->pmu)->pmu_type == hybrid_big); 321 322 322 323 dse &= PERF_PEBS_DATA_SOURCE_GRT_MASK; 323 324 val = hybrid_var(event->pmu, pebs_data_source)[dse];
+1
arch/x86/events/intel/uncore.c
··· 1895 1895 X86_MATCH_VFM(INTEL_ARROWLAKE_H, &mtl_uncore_init), 1896 1896 X86_MATCH_VFM(INTEL_LUNARLAKE_M, &lnl_uncore_init), 1897 1897 X86_MATCH_VFM(INTEL_PANTHERLAKE_L, &ptl_uncore_init), 1898 + X86_MATCH_VFM(INTEL_WILDCATLAKE_L, &ptl_uncore_init), 1898 1899 X86_MATCH_VFM(INTEL_SAPPHIRERAPIDS_X, &spr_uncore_init), 1899 1900 X86_MATCH_VFM(INTEL_EMERALDRAPIDS_X, &spr_uncore_init), 1900 1901 X86_MATCH_VFM(INTEL_GRANITERAPIDS_X, &gnr_uncore_init),
+3 -3
arch/x86/include/asm/intel-family.h
··· 150 150 151 151 #define INTEL_LUNARLAKE_M IFM(6, 0xBD) /* Lion Cove / Skymont */ 152 152 153 - #define INTEL_PANTHERLAKE_L IFM(6, 0xCC) /* Cougar Cove / Crestmont */ 153 + #define INTEL_PANTHERLAKE_L IFM(6, 0xCC) /* Cougar Cove / Darkmont */ 154 154 155 155 #define INTEL_WILDCATLAKE_L IFM(6, 0xD5) 156 156 157 - #define INTEL_NOVALAKE IFM(18, 0x01) 158 - #define INTEL_NOVALAKE_L IFM(18, 0x03) 157 + #define INTEL_NOVALAKE IFM(18, 0x01) /* Coyote Cove / Arctic Wolf */ 158 + #define INTEL_NOVALAKE_L IFM(18, 0x03) /* Coyote Cove / Arctic Wolf */ 159 159 160 160 /* "Small Core" Processors (Atom/E-Core) */ 161 161
+3
arch/x86/include/asm/page_64.h
··· 43 43 void clear_page_orig(void *page); 44 44 void clear_page_rep(void *page); 45 45 void clear_page_erms(void *page); 46 + KCFI_REFERENCE(clear_page_orig); 47 + KCFI_REFERENCE(clear_page_rep); 48 + KCFI_REFERENCE(clear_page_erms); 46 49 47 50 static inline void clear_page(void *page) 48 51 {
+4
arch/x86/include/asm/runtime-const.h
··· 2 2 #ifndef _ASM_RUNTIME_CONST_H 3 3 #define _ASM_RUNTIME_CONST_H 4 4 5 + #ifdef MODULE 6 + #error "Cannot use runtime-const infrastructure from modules" 7 + #endif 8 + 5 9 #ifdef __ASSEMBLY__ 6 10 7 11 .macro RUNTIME_CONST_PTR sym reg
+5 -5
arch/x86/include/asm/uaccess_64.h
··· 12 12 #include <asm/cpufeatures.h> 13 13 #include <asm/page.h> 14 14 #include <asm/percpu.h> 15 - #include <asm/runtime-const.h> 16 15 17 - /* 18 - * Virtual variable: there's no actual backing store for this, 19 - * it can purely be used as 'runtime_const_ptr(USER_PTR_MAX)' 20 - */ 16 + #ifdef MODULE 17 + #define runtime_const_ptr(sym) (sym) 18 + #else 19 + #include <asm/runtime-const.h> 20 + #endif 21 21 extern unsigned long USER_PTR_MAX; 22 22 23 23 #ifdef CONFIG_ADDRESS_MASKING
+11 -1
arch/x86/kernel/cpu/amd.c
··· 516 516 setup_force_cpu_cap(X86_FEATURE_ZEN5); 517 517 break; 518 518 case 0x50 ... 0x5f: 519 - case 0x90 ... 0xaf: 519 + case 0x80 ... 0xaf: 520 520 case 0xc0 ... 0xcf: 521 521 setup_force_cpu_cap(X86_FEATURE_ZEN6); 522 522 break; ··· 1035 1035 } 1036 1036 } 1037 1037 1038 + static const struct x86_cpu_id zen5_rdseed_microcode[] = { 1039 + ZEN_MODEL_STEP_UCODE(0x1a, 0x02, 0x1, 0x0b00215a), 1040 + ZEN_MODEL_STEP_UCODE(0x1a, 0x11, 0x0, 0x0b101054), 1041 + }; 1042 + 1038 1043 static void init_amd_zen5(struct cpuinfo_x86 *c) 1039 1044 { 1045 + if (!x86_match_min_microcode_rev(zen5_rdseed_microcode)) { 1046 + clear_cpu_cap(c, X86_FEATURE_RDSEED); 1047 + msr_clear_bit(MSR_AMD64_CPUID_FN_7, 18); 1048 + pr_emerg_once("RDSEED32 is broken. Disabling the corresponding CPUID bit.\n"); 1049 + } 1040 1050 } 1041 1051 1042 1052 static void init_amd(struct cpuinfo_x86 *c)
+5 -1
arch/x86/kernel/cpu/common.c
··· 78 78 DEFINE_PER_CPU_READ_MOSTLY(struct cpuinfo_x86, cpu_info); 79 79 EXPORT_PER_CPU_SYMBOL(cpu_info); 80 80 81 + /* Used for modules: built-in code uses runtime constants */ 82 + unsigned long USER_PTR_MAX; 83 + EXPORT_SYMBOL(USER_PTR_MAX); 84 + 81 85 u32 elf_hwcap2 __read_mostly; 82 86 83 87 /* Number of siblings per CPU package */ ··· 2583 2579 alternative_instructions(); 2584 2580 2585 2581 if (IS_ENABLED(CONFIG_X86_64)) { 2586 - unsigned long USER_PTR_MAX = TASK_SIZE_MAX; 2582 + USER_PTR_MAX = TASK_SIZE_MAX; 2587 2583 2588 2584 /* 2589 2585 * Enable this when LAM is gated on LASS support
+19 -1
arch/x86/kernel/cpu/microcode/amd.c
··· 233 233 return true; 234 234 } 235 235 236 + static bool cpu_has_entrysign(void) 237 + { 238 + unsigned int fam = x86_family(bsp_cpuid_1_eax); 239 + unsigned int model = x86_model(bsp_cpuid_1_eax); 240 + 241 + if (fam == 0x17 || fam == 0x19) 242 + return true; 243 + 244 + if (fam == 0x1a) { 245 + if (model <= 0x2f || 246 + (0x40 <= model && model <= 0x4f) || 247 + (0x60 <= model && model <= 0x6f)) 248 + return true; 249 + } 250 + 251 + return false; 252 + } 253 + 236 254 static bool verify_sha256_digest(u32 patch_id, u32 cur_rev, const u8 *data, unsigned int len) 237 255 { 238 256 struct patch_digest *pd = NULL; 239 257 u8 digest[SHA256_DIGEST_SIZE]; 240 258 int i; 241 259 242 - if (x86_family(bsp_cpuid_1_eax) < 0x17) 260 + if (!cpu_has_entrysign()) 243 261 return true; 244 262 245 263 if (!need_sha_check(cur_rev))
+3
arch/x86/kernel/fpu/core.c
··· 825 825 !fpregs_state_valid(fpu, smp_processor_id())) 826 826 os_xrstor_supervisor(fpu->fpstate); 827 827 828 + /* Ensure XFD state is in sync before reloading XSTATE */ 829 + xfd_update_state(fpu->fpstate); 830 + 828 831 /* Reset user states in registers. */ 829 832 restore_fpregs_from_init_fpstate(XFEATURE_MASK_USER_RESTORE); 830 833
+1 -1
arch/x86/net/bpf_jit_comp.c
··· 2701 2701 /* Update cleanup_addr */ 2702 2702 ctx->cleanup_addr = proglen; 2703 2703 if (bpf_prog_was_classic(bpf_prog) && 2704 - !capable(CAP_SYS_ADMIN)) { 2704 + !ns_capable_noaudit(&init_user_ns, CAP_SYS_ADMIN)) { 2705 2705 u8 *ip = image + addrs[i - 1]; 2706 2706 2707 2707 if (emit_spectre_bhb_barrier(&prog, ip, bpf_prog))
+1 -1
block/blk-crypto.c
··· 292 292 } 293 293 294 294 if (!bio_crypt_check_alignment(bio)) { 295 - bio->bi_status = BLK_STS_IOERR; 295 + bio->bi_status = BLK_STS_INVAL; 296 296 goto fail; 297 297 } 298 298
+3
drivers/acpi/acpi_mrrm.c
··· 63 63 if (!mrrm) 64 64 return -ENODEV; 65 65 66 + if (mrrm->header.revision != 1) 67 + return -EINVAL; 68 + 66 69 if (mrrm->flags & ACPI_MRRM_FLAGS_REGION_ASSIGNMENT_OS) 67 70 return -EOPNOTSUPP; 68 71
+3 -1
drivers/acpi/acpi_video.c
··· 1959 1959 struct acpi_video_device *dev; 1960 1960 1961 1961 mutex_lock(&video->device_list_lock); 1962 - list_for_each_entry(dev, &video->video_device_list, entry) 1962 + list_for_each_entry(dev, &video->video_device_list, entry) { 1963 1963 acpi_video_dev_remove_notify_handler(dev); 1964 + cancel_delayed_work_sync(&dev->switch_brightness_work); 1965 + } 1964 1966 mutex_unlock(&video->device_list_lock); 1965 1967 1966 1968 acpi_video_bus_stop_devices(video);
+3 -1
drivers/acpi/button.c
··· 619 619 620 620 input_set_drvdata(input, device); 621 621 error = input_register_device(input); 622 - if (error) 622 + if (error) { 623 + input_free_device(input); 623 624 goto err_remove_fs; 625 + } 624 626 625 627 switch (device->device_type) { 626 628 case ACPI_BUS_TYPE_POWER_BUTTON:
+4 -3
drivers/acpi/fan.h
··· 49 49 }; 50 50 51 51 struct acpi_fan { 52 + acpi_handle handle; 52 53 bool acpi4; 53 54 bool has_fst; 54 55 struct acpi_fan_fif fif; ··· 60 59 struct device_attribute fine_grain_control; 61 60 }; 62 61 63 - int acpi_fan_get_fst(struct acpi_device *device, struct acpi_fan_fst *fst); 62 + int acpi_fan_get_fst(acpi_handle handle, struct acpi_fan_fst *fst); 64 63 int acpi_fan_create_attributes(struct acpi_device *device); 65 64 void acpi_fan_delete_attributes(struct acpi_device *device); 66 65 67 66 #if IS_REACHABLE(CONFIG_HWMON) 68 - int devm_acpi_fan_create_hwmon(struct acpi_device *device); 67 + int devm_acpi_fan_create_hwmon(struct device *dev); 69 68 #else 70 - static inline int devm_acpi_fan_create_hwmon(struct acpi_device *device) { return 0; }; 69 + static inline int devm_acpi_fan_create_hwmon(struct device *dev) { return 0; }; 71 70 #endif 72 71 73 72 #endif
+1 -1
drivers/acpi/fan_attr.c
··· 55 55 struct acpi_fan_fst fst; 56 56 int status; 57 57 58 - status = acpi_fan_get_fst(acpi_dev, &fst); 58 + status = acpi_fan_get_fst(acpi_dev->handle, &fst); 59 59 if (status) 60 60 return status; 61 61
+23 -13
drivers/acpi/fan_core.c
··· 44 44 return 0; 45 45 } 46 46 47 - int acpi_fan_get_fst(struct acpi_device *device, struct acpi_fan_fst *fst) 47 + int acpi_fan_get_fst(acpi_handle handle, struct acpi_fan_fst *fst) 48 48 { 49 49 struct acpi_buffer buffer = { ACPI_ALLOCATE_BUFFER, NULL }; 50 50 union acpi_object *obj; 51 51 acpi_status status; 52 52 int ret = 0; 53 53 54 - status = acpi_evaluate_object(device->handle, "_FST", NULL, &buffer); 55 - if (ACPI_FAILURE(status)) { 56 - dev_err(&device->dev, "Get fan state failed\n"); 57 - return -ENODEV; 58 - } 54 + status = acpi_evaluate_object(handle, "_FST", NULL, &buffer); 55 + if (ACPI_FAILURE(status)) 56 + return -EIO; 59 57 60 58 obj = buffer.pointer; 61 - if (!obj || obj->type != ACPI_TYPE_PACKAGE || 62 - obj->package.count != 3 || 63 - obj->package.elements[1].type != ACPI_TYPE_INTEGER) { 64 - dev_err(&device->dev, "Invalid _FST data\n"); 65 - ret = -EINVAL; 59 + if (!obj) 60 + return -ENODATA; 61 + 62 + if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count != 3) { 63 + ret = -EPROTO; 64 + goto err; 65 + } 66 + 67 + if (obj->package.elements[0].type != ACPI_TYPE_INTEGER || 68 + obj->package.elements[1].type != ACPI_TYPE_INTEGER || 69 + obj->package.elements[2].type != ACPI_TYPE_INTEGER) { 70 + ret = -EPROTO; 66 71 goto err; 67 72 } 68 73 ··· 86 81 struct acpi_fan_fst fst; 87 82 int status, i; 88 83 89 - status = acpi_fan_get_fst(device, &fst); 84 + status = acpi_fan_get_fst(device->handle, &fst); 90 85 if (status) 91 86 return status; 92 87 ··· 316 311 struct acpi_device *device = ACPI_COMPANION(&pdev->dev); 317 312 char *name; 318 313 314 + if (!device) 315 + return -ENODEV; 316 + 319 317 fan = devm_kzalloc(&pdev->dev, sizeof(*fan), GFP_KERNEL); 320 318 if (!fan) { 321 319 dev_err(&device->dev, "No memory for fan\n"); 322 320 return -ENOMEM; 323 321 } 322 + 323 + fan->handle = device->handle; 324 324 device->driver_data = fan; 325 325 platform_set_drvdata(pdev, fan); 326 326 ··· 347 337 } 348 338 349 339 if (fan->has_fst) { 350 - result = devm_acpi_fan_create_hwmon(device); 340 + result = devm_acpi_fan_create_hwmon(&pdev->dev); 351 341 if (result) 352 342 return result; 353 343
+5 -6
drivers/acpi/fan_hwmon.c
··· 93 93 static int acpi_fan_hwmon_read(struct device *dev, enum hwmon_sensor_types type, u32 attr, 94 94 int channel, long *val) 95 95 { 96 - struct acpi_device *adev = to_acpi_device(dev->parent); 97 96 struct acpi_fan *fan = dev_get_drvdata(dev); 98 97 struct acpi_fan_fps *fps; 99 98 struct acpi_fan_fst fst; 100 99 int ret; 101 100 102 - ret = acpi_fan_get_fst(adev, &fst); 101 + ret = acpi_fan_get_fst(fan->handle, &fst); 103 102 if (ret < 0) 104 103 return ret; 105 104 ··· 166 167 .info = acpi_fan_hwmon_info, 167 168 }; 168 169 169 - int devm_acpi_fan_create_hwmon(struct acpi_device *device) 170 + int devm_acpi_fan_create_hwmon(struct device *dev) 170 171 { 171 - struct acpi_fan *fan = acpi_driver_data(device); 172 + struct acpi_fan *fan = dev_get_drvdata(dev); 172 173 struct device *hdev; 173 174 174 - hdev = devm_hwmon_device_register_with_info(&device->dev, "acpi_fan", fan, 175 - &acpi_fan_hwmon_chip_info, NULL); 175 + hdev = devm_hwmon_device_register_with_info(dev, "acpi_fan", fan, &acpi_fan_hwmon_chip_info, 176 + NULL); 176 177 return PTR_ERR_OR_ZERO(hdev); 177 178 }
+1 -1
drivers/acpi/spcr.c
··· 155 155 * Baud Rate field. If this field is zero or not present, Configured 156 156 * Baud Rate is used. 157 157 */ 158 - if (table->precise_baudrate) 158 + if (table->header.revision >= 4 && table->precise_baudrate) 159 159 baud_rate = table->precise_baudrate; 160 160 else switch (table->baud_rate) { 161 161 case 0:
+2 -4
drivers/base/regmap/regmap-slimbus.c
··· 48 48 if (IS_ERR(bus)) 49 49 return ERR_CAST(bus); 50 50 51 - return __regmap_init(&slimbus->dev, bus, &slimbus->dev, config, 52 - lock_key, lock_name); 51 + return __regmap_init(&slimbus->dev, bus, slimbus, config, lock_key, lock_name); 53 52 } 54 53 EXPORT_SYMBOL_GPL(__regmap_init_slimbus); 55 54 ··· 62 63 if (IS_ERR(bus)) 63 64 return ERR_CAST(bus); 64 65 65 - return __devm_regmap_init(&slimbus->dev, bus, &slimbus, config, 66 - lock_key, lock_name); 66 + return __devm_regmap_init(&slimbus->dev, bus, slimbus, config, lock_key, lock_name); 67 67 } 68 68 EXPORT_SYMBOL_GPL(__devm_regmap_init_slimbus); 69 69
+1
drivers/block/null_blk/main.c
··· 1949 1949 .logical_block_size = dev->blocksize, 1950 1950 .physical_block_size = dev->blocksize, 1951 1951 .max_hw_sectors = dev->max_sectors, 1952 + .dma_alignment = dev->blocksize - 1, 1952 1953 }; 1953 1954 1954 1955 struct nullb *nullb;
+3 -1
drivers/bluetooth/btrtl.c
··· 625 625 len += entry->len; 626 626 } 627 627 628 - if (!len) 628 + if (!len) { 629 + kvfree(ptr); 629 630 return -EPERM; 631 + } 630 632 631 633 *_buf = ptr; 632 634 return len;
+5 -2
drivers/cpuidle/governors/menu.c
··· 318 318 319 319 /* 320 320 * Use a physical idle state, not busy polling, unless a timer 321 - * is going to trigger soon enough. 321 + * is going to trigger soon enough or the exit latency of the 322 + * idle state in question is greater than the predicted idle 323 + * duration. 322 324 */ 323 325 if ((drv->states[idx].flags & CPUIDLE_FLAG_POLLING) && 324 - s->target_residency_ns <= data->next_timer_ns) { 326 + s->target_residency_ns <= data->next_timer_ns && 327 + s->exit_latency_ns <= predicted_ns) { 325 328 predicted_ns = s->target_residency_ns; 326 329 idx = i; 327 330 break;
-2
drivers/crypto/aspeed/aspeed-acry.c
··· 787 787 err_engine_rsa_start: 788 788 crypto_engine_exit(acry_dev->crypt_engine_rsa); 789 789 clk_exit: 790 - clk_disable_unprepare(acry_dev->clk); 791 790 792 791 return rc; 793 792 } ··· 798 799 aspeed_acry_unregister(acry_dev); 799 800 crypto_engine_exit(acry_dev->crypt_engine_rsa); 800 801 tasklet_kill(&acry_dev->done_task); 801 - clk_disable_unprepare(acry_dev->clk); 802 802 } 803 803 804 804 MODULE_DEVICE_TABLE(of, aspeed_acry_of_matches);
+1 -1
drivers/dma-buf/dma-fence.c
··· 1141 1141 "RCU protection is required for safe access to returned string"); 1142 1142 1143 1143 if (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags)) 1144 - return fence->ops->get_driver_name(fence); 1144 + return fence->ops->get_timeline_name(fence); 1145 1145 else 1146 1146 return "signaled-timeline"; 1147 1147 }
+1 -1
drivers/edac/versalnet_edac.c
··· 433 433 phys_addr_t pfn; 434 434 int err; 435 435 436 - if (WARN_ON_ONCE(ctl_num > NUM_CONTROLLERS)) 436 + if (WARN_ON_ONCE(ctl_num >= NUM_CONTROLLERS)) 437 437 return; 438 438 439 439 mci = priv->mci[ctl_num];
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + // SPDX-License-Identifier: MIT 2 2 /* 3 3 * Copyright 2025 Advanced Micro Devices, Inc. 4 4 *
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_cper.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 1 + /* SPDX-License-Identifier: MIT */ 2 2 /* 3 3 * Copyright 2025 Advanced Micro Devices, Inc. 4 4 *
+30 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c
··· 322 322 return 0; 323 323 } 324 324 325 + static bool vpe_need_dpm0_at_power_down(struct amdgpu_device *adev) 326 + { 327 + switch (amdgpu_ip_version(adev, VPE_HWIP, 0)) { 328 + case IP_VERSION(6, 1, 1): 329 + return adev->pm.fw_version < 0x0a640500; 330 + default: 331 + return false; 332 + } 333 + } 334 + 335 + static int vpe_get_dpm_level(struct amdgpu_device *adev) 336 + { 337 + struct amdgpu_vpe *vpe = &adev->vpe; 338 + 339 + if (!adev->pm.dpm_enabled) 340 + return 0; 341 + 342 + return RREG32(vpe_get_reg_offset(vpe, 0, vpe->regs.dpm_request_lv)); 343 + } 344 + 325 345 static void vpe_idle_work_handler(struct work_struct *work) 326 346 { 327 347 struct amdgpu_device *adev = ··· 349 329 unsigned int fences = 0; 350 330 351 331 fences += amdgpu_fence_count_emitted(&adev->vpe.ring); 332 + if (fences) 333 + goto reschedule; 352 334 353 - if (fences == 0) 354 - amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VPE, AMD_PG_STATE_GATE); 355 - else 356 - schedule_delayed_work(&adev->vpe.idle_work, VPE_IDLE_TIMEOUT); 335 + if (vpe_need_dpm0_at_power_down(adev) && vpe_get_dpm_level(adev) != 0) 336 + goto reschedule; 337 + 338 + amdgpu_device_ip_set_powergating_state(adev, AMD_IP_BLOCK_TYPE_VPE, AMD_PG_STATE_GATE); 339 + return; 340 + 341 + reschedule: 342 + schedule_delayed_work(&adev->vpe.idle_work, VPE_IDLE_TIMEOUT); 357 343 } 358 344 359 345 static int vpe_common_init(struct amdgpu_vpe *vpe)
+1 -1
drivers/gpu/drm/amd/amdgpu/cyan_skillfish_reg_init.c
··· 1 - // SPDX-License-Identifier: GPL-2.0 1 + // SPDX-License-Identifier: MIT 2 2 /* 3 3 * Copyright 2018 Advanced Micro Devices, Inc. 4 4 *
+18 -3
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crtc.c
··· 248 248 struct vblank_control_work *vblank_work = 249 249 container_of(work, struct vblank_control_work, work); 250 250 struct amdgpu_display_manager *dm = vblank_work->dm; 251 + struct amdgpu_device *adev = drm_to_adev(dm->ddev); 252 + int r; 251 253 252 254 mutex_lock(&dm->dc_lock); 253 255 ··· 279 277 280 278 if (dm->active_vblank_irq_count == 0) { 281 279 dc_post_update_surfaces_to_stream(dm->dc); 280 + 281 + r = amdgpu_dpm_pause_power_profile(adev, true); 282 + if (r) 283 + dev_warn(adev->dev, "failed to set default power profile mode\n"); 284 + 282 285 dc_allow_idle_optimizations(dm->dc, true); 286 + 287 + r = amdgpu_dpm_pause_power_profile(adev, false); 288 + if (r) 289 + dev_warn(adev->dev, "failed to restore the power profile mode\n"); 283 290 } 284 291 285 292 mutex_unlock(&dm->dc_lock); ··· 308 297 int irq_type; 309 298 int rc = 0; 310 299 311 - if (acrtc->otg_inst == -1) 312 - goto skip; 300 + if (enable && !acrtc->base.enabled) { 301 + drm_dbg_vbl(crtc->dev, 302 + "Reject vblank enable on unconfigured CRTC %d (enabled=%d)\n", 303 + acrtc->crtc_id, acrtc->base.enabled); 304 + return -EINVAL; 305 + } 313 306 314 307 irq_type = amdgpu_display_crtc_idx_to_irq_type(adev, acrtc->crtc_id); 315 308 ··· 398 383 return rc; 399 384 } 400 385 #endif 401 - skip: 386 + 402 387 if (amdgpu_in_reset(adev)) 403 388 return 0; 404 389
+1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c
··· 83 83 edid_caps->panel_patch.remove_sink_ext_caps = true; 84 84 break; 85 85 case drm_edid_encode_panel_id('S', 'D', 'C', 0x4154): 86 + case drm_edid_encode_panel_id('S', 'D', 'C', 0x4171): 86 87 drm_dbg_driver(dev, "Disabling VSC on monitor with panel id %X\n", panel_id); 87 88 edid_caps->panel_patch.disable_colorimetry = true; 88 89 break;
-3
drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.c
··· 578 578 dpp_base->ctx->dc->optimized_required = true; 579 579 dpp_base->deferred_reg_writes.bits.disable_blnd_lut = true; 580 580 } 581 - } else { 582 - REG_SET(CM_MEM_PWR_CTRL, 0, 583 - BLNDGAM_MEM_PWR_FORCE, power_on == true ? 0 : 1); 584 581 } 585 582 } 586 583
+1 -1
drivers/gpu/drm/amd/include/amd_cper.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 1 + /* SPDX-License-Identifier: MIT */ 2 2 /* 3 3 * Copyright 2025 Advanced Micro Devices, Inc. 4 4 *
+1 -1
drivers/gpu/drm/amd/include/ivsrcid/vcn/irqsrcs_vcn_5_0.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 1 + /* SPDX-License-Identifier: MIT */ 2 2 3 3 /* 4 4 * Copyright 2024 Advanced Micro Devices, Inc. All rights reserved.
+1 -1
drivers/gpu/drm/amd/pm/powerplay/smumgr/fiji_smumgr.c
··· 2024 2024 table->VoltageResponseTime = 0; 2025 2025 table->PhaseResponseTime = 0; 2026 2026 table->MemoryThermThrottleEnable = 1; 2027 - table->PCIeBootLinkLevel = 0; /* 0:Gen1 1:Gen2 2:Gen3*/ 2027 + table->PCIeBootLinkLevel = (uint8_t) (data->dpm_table.pcie_speed_table.count); 2028 2028 table->PCIeGenInterval = 1; 2029 2029 table->VRConfig = 0; 2030 2030
+1 -1
drivers/gpu/drm/amd/pm/powerplay/smumgr/iceland_smumgr.c
··· 2028 2028 table->VoltageResponseTime = 0; 2029 2029 table->PhaseResponseTime = 0; 2030 2030 table->MemoryThermThrottleEnable = 1; 2031 - table->PCIeBootLinkLevel = 0; 2031 + table->PCIeBootLinkLevel = (uint8_t) (data->dpm_table.pcie_speed_table.count); 2032 2032 table->PCIeGenInterval = 1; 2033 2033 2034 2034 result = iceland_populate_smc_svi2_config(hwmgr, table);
+1 -1
drivers/gpu/drm/amd/pm/swsmu/smu_cmn.c
··· 969 969 table_index); 970 970 uint32_t table_size; 971 971 int ret = 0; 972 - if (!table_data || table_id >= SMU_TABLE_COUNT || table_id < 0) 972 + if (!table_data || table_index >= SMU_TABLE_COUNT || table_id < 0) 973 973 return -EINVAL; 974 974 975 975 table_size = smu_table->tables[table_index].size;
+4 -4
drivers/gpu/drm/ast/ast_drv.h
··· 282 282 __ast_write8(addr, reg + 1, val); 283 283 } 284 284 285 - static inline void __ast_write8_i_masked(void __iomem *addr, u32 reg, u8 index, u8 read_mask, 285 + static inline void __ast_write8_i_masked(void __iomem *addr, u32 reg, u8 index, u8 preserve_mask, 286 286 u8 val) 287 287 { 288 - u8 tmp = __ast_read8_i_masked(addr, reg, index, read_mask); 288 + u8 tmp = __ast_read8_i_masked(addr, reg, index, preserve_mask); 289 289 290 - tmp |= val; 291 - __ast_write8_i(addr, reg, index, tmp); 290 + val &= ~preserve_mask; 291 + __ast_write8_i(addr, reg, index, tmp | val); 292 292 } 293 293 294 294 static inline u32 ast_read32(struct ast_device *ast, u32 reg)
+1 -1
drivers/gpu/drm/ci/gitlab-ci.yml
··· 280 280 GIT_STRATEGY: none 281 281 script: 282 282 # ci-fairy check-commits --junit-xml=check-commits.xml 283 - - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request.xml 283 + # - ci-fairy check-merge-request --require-allow-collaboration --junit-xml=check-merge-request.xml 284 284 - | 285 285 set -eu 286 286 image_tags=(
+6 -2
drivers/gpu/drm/drm_gem_atomic_helper.c
··· 310 310 void __drm_gem_reset_shadow_plane(struct drm_plane *plane, 311 311 struct drm_shadow_plane_state *shadow_plane_state) 312 312 { 313 - __drm_atomic_helper_plane_reset(plane, &shadow_plane_state->base); 314 - drm_format_conv_state_init(&shadow_plane_state->fmtcnv_state); 313 + if (shadow_plane_state) { 314 + __drm_atomic_helper_plane_reset(plane, &shadow_plane_state->base); 315 + drm_format_conv_state_init(&shadow_plane_state->fmtcnv_state); 316 + } else { 317 + __drm_atomic_helper_plane_reset(plane, NULL); 318 + } 315 319 } 316 320 EXPORT_SYMBOL(__drm_gem_reset_shadow_plane); 317 321
+1 -1
drivers/gpu/drm/etnaviv/etnaviv_buffer.c
··· 347 347 u32 link_target, link_dwords; 348 348 bool switch_context = gpu->exec_state != exec_state; 349 349 bool switch_mmu_context = gpu->mmu_context != mmu_context; 350 - unsigned int new_flush_seq = READ_ONCE(gpu->mmu_context->flush_seq); 350 + unsigned int new_flush_seq = READ_ONCE(mmu_context->flush_seq); 351 351 bool need_flush = switch_mmu_context || gpu->flush_seq != new_flush_seq; 352 352 bool has_blt = !!(gpu->identity.minor_features5 & 353 353 chipMinorFeatures5_BLT_ENGINE);
+54 -1
drivers/gpu/drm/i915/display/intel_dmc.c
··· 546 546 REG_FIELD_GET(DMC_EVT_CTL_EVENT_ID_MASK, data) == event_id; 547 547 } 548 548 549 + static bool fixup_dmc_evt(struct intel_display *display, 550 + enum intel_dmc_id dmc_id, 551 + i915_reg_t reg_ctl, u32 *data_ctl, 552 + i915_reg_t reg_htp, u32 *data_htp) 553 + { 554 + if (!is_dmc_evt_ctl_reg(display, dmc_id, reg_ctl)) 555 + return false; 556 + 557 + if (!is_dmc_evt_htp_reg(display, dmc_id, reg_htp)) 558 + return false; 559 + 560 + /* make sure reg_ctl and reg_htp are for the same event */ 561 + if (i915_mmio_reg_offset(reg_ctl) - i915_mmio_reg_offset(DMC_EVT_CTL(display, dmc_id, 0)) != 562 + i915_mmio_reg_offset(reg_htp) - i915_mmio_reg_offset(DMC_EVT_HTP(display, dmc_id, 0))) 563 + return false; 564 + 565 + /* 566 + * On ADL-S the HRR event handler is not restored after DC6. 567 + * Clear it to zero from the beginning to avoid mismatches later. 568 + */ 569 + if (display->platform.alderlake_s && dmc_id == DMC_FW_MAIN && 570 + is_event_handler(display, dmc_id, MAINDMC_EVENT_VBLANK_A, reg_ctl, *data_ctl)) { 571 + *data_ctl = 0; 572 + *data_htp = 0; 573 + return true; 574 + } 575 + 576 + return false; 577 + } 578 + 549 579 static bool disable_dmc_evt(struct intel_display *display, 550 580 enum intel_dmc_id dmc_id, 551 581 i915_reg_t reg, u32 data) ··· 1094 1064 for (i = 0; i < mmio_count; i++) { 1095 1065 dmc_info->mmioaddr[i] = _MMIO(mmioaddr[i]); 1096 1066 dmc_info->mmiodata[i] = mmiodata[i]; 1067 + } 1097 1068 1069 + for (i = 0; i < mmio_count - 1; i++) { 1070 + u32 orig_mmiodata[2] = { 1071 + dmc_info->mmiodata[i], 1072 + dmc_info->mmiodata[i+1], 1073 + }; 1074 + 1075 + if (!fixup_dmc_evt(display, dmc_id, 1076 + dmc_info->mmioaddr[i], &dmc_info->mmiodata[i], 1077 + dmc_info->mmioaddr[i+1], &dmc_info->mmiodata[i+1])) 1078 + continue; 1079 + 1080 + drm_dbg_kms(display->drm, 1081 + " mmio[%d]: 0x%x = 0x%x->0x%x (EVT_CTL)\n", 1082 + i, i915_mmio_reg_offset(dmc_info->mmioaddr[i]), 1083 + orig_mmiodata[0], dmc_info->mmiodata[i]); 1084 + drm_dbg_kms(display->drm, 1085 + " mmio[%d]: 0x%x = 0x%x->0x%x (EVT_HTP)\n", 1086 + i+1, i915_mmio_reg_offset(dmc_info->mmioaddr[i+1]), 1087 + orig_mmiodata[1], dmc_info->mmiodata[i+1]); 1088 + } 1089 + 1090 + for (i = 0; i < mmio_count; i++) { 1098 1091 drm_dbg_kms(display->drm, " mmio[%d]: 0x%x = 0x%x%s%s\n", 1099 - i, mmioaddr[i], mmiodata[i], 1092 + i, i915_mmio_reg_offset(dmc_info->mmioaddr[i]), dmc_info->mmiodata[i], 1100 1093 is_dmc_evt_ctl_reg(display, dmc_id, dmc_info->mmioaddr[i]) ? " (EVT_CTL)" : 1101 1094 is_dmc_evt_htp_reg(display, dmc_id, dmc_info->mmioaddr[i]) ? " (EVT_HTP)" : "", 1102 1095 disable_dmc_evt(display, dmc_id, dmc_info->mmioaddr[i],
+9 -9
drivers/gpu/drm/imx/ipuv3/parallel-display.c
··· 25 25 26 26 struct imx_parallel_display_encoder { 27 27 struct drm_encoder encoder; 28 - struct drm_bridge bridge; 29 - struct imx_parallel_display *pd; 30 28 }; 31 29 32 30 struct imx_parallel_display { 33 31 struct device *dev; 34 32 u32 bus_format; 35 33 struct drm_bridge *next_bridge; 34 + struct drm_bridge bridge; 36 35 }; 37 36 38 37 static inline struct imx_parallel_display *bridge_to_imxpd(struct drm_bridge *b) 39 38 { 40 - return container_of(b, struct imx_parallel_display_encoder, bridge)->pd; 39 + return container_of(b, struct imx_parallel_display, bridge); 41 40 } 42 41 43 42 static const u32 imx_pd_bus_fmts[] = { ··· 194 195 if (IS_ERR(imxpd_encoder)) 195 196 return PTR_ERR(imxpd_encoder); 196 197 197 - imxpd_encoder->pd = imxpd; 198 198 encoder = &imxpd_encoder->encoder; 199 - bridge = &imxpd_encoder->bridge; 199 + bridge = &imxpd->bridge; 200 200 201 201 ret = imx_drm_encoder_parse_of(drm, encoder, imxpd->dev->of_node); 202 202 if (ret) 203 203 return ret; 204 204 205 - bridge->funcs = &imx_pd_bridge_funcs; 206 205 drm_bridge_attach(encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); 207 206 208 207 connector = drm_bridge_connector_init(drm, encoder); ··· 225 228 u32 bus_format = 0; 226 229 const char *fmt; 227 230 228 - imxpd = devm_kzalloc(dev, sizeof(*imxpd), GFP_KERNEL); 229 - if (!imxpd) 230 - return -ENOMEM; 231 + imxpd = devm_drm_bridge_alloc(dev, struct imx_parallel_display, bridge, 232 + &imx_pd_bridge_funcs); 233 + if (IS_ERR(imxpd)) 234 + return PTR_ERR(imxpd); 231 235 232 236 /* port@1 is the output port */ 233 237 imxpd->next_bridge = devm_drm_of_get_bridge(dev, np, 1, 0); ··· 255 257 imxpd->dev = dev; 256 258 257 259 platform_set_drvdata(pdev, imxpd); 260 + 261 + devm_drm_bridge_add(dev, &imxpd->bridge); 258 262 259 263 return component_add(dev, &imx_pd_ops); 260 264 }
-10
drivers/gpu/drm/mediatek/mtk_drm_drv.c
··· 686 686 for (i = 0; i < private->data->mmsys_dev_num; i++) 687 687 private->all_drm_private[i]->drm = NULL; 688 688 err_put_dev: 689 - for (i = 0; i < private->data->mmsys_dev_num; i++) { 690 - /* For device_find_child in mtk_drm_get_all_priv() */ 691 - put_device(private->all_drm_private[i]->dev); 692 - } 693 689 put_device(private->mutex_dev); 694 690 return ret; 695 691 } ··· 693 697 static void mtk_drm_unbind(struct device *dev) 694 698 { 695 699 struct mtk_drm_private *private = dev_get_drvdata(dev); 696 - int i; 697 700 698 701 /* for multi mmsys dev, unregister drm dev in mmsys master */ 699 702 if (private->drm_master) { 700 703 drm_dev_unregister(private->drm); 701 704 mtk_drm_kms_deinit(private->drm); 702 705 drm_dev_put(private->drm); 703 - 704 - for (i = 0; i < private->data->mmsys_dev_num; i++) { 705 - /* For device_find_child in mtk_drm_get_all_priv() */ 706 - put_device(private->all_drm_private[i]->dev); 707 - } 708 706 put_device(private->mutex_dev); 709 707 } 710 708 private->mtk_drm_bound = false;
+4 -1
drivers/gpu/drm/msm/adreno/a6xx_gmu.c
··· 780 780 return true; 781 781 } 782 782 783 + #define NEXT_BLK(blk) \ 784 + ((const struct block_header *)((const char *)(blk) + sizeof(*(blk)) + (blk)->size)) 785 + 783 786 static int a6xx_gmu_fw_load(struct a6xx_gmu *gmu) 784 787 { 785 788 struct a6xx_gpu *a6xx_gpu = container_of(gmu, struct a6xx_gpu, gmu); ··· 814 811 815 812 for (blk = (const struct block_header *) fw_image->data; 816 813 (const u8*) blk < fw_image->data + fw_image->size; 817 - blk = (const struct block_header *) &blk->data[blk->size >> 2]) { 814 + blk = NEXT_BLK(blk)) { 818 815 if (blk->size == 0) 819 816 continue; 820 817
-7
drivers/gpu/drm/msm/adreno/adreno_gpu.c
··· 348 348 return 0; 349 349 } 350 350 351 - static bool 352 - adreno_smmu_has_prr(struct msm_gpu *gpu) 353 - { 354 - struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(&gpu->pdev->dev); 355 - return adreno_smmu && adreno_smmu->set_prr_addr; 356 - } 357 - 358 351 int adreno_get_param(struct msm_gpu *gpu, struct msm_context *ctx, 359 352 uint32_t param, uint64_t *value, uint32_t *len) 360 353 {
+3
drivers/gpu/drm/msm/disp/dpu1/dpu_crtc.c
··· 1545 1545 adjusted_mode_clk = dpu_core_perf_adjusted_mode_clk(mode->clock, 1546 1546 dpu_kms->perf.perf_cfg); 1547 1547 1548 + if (dpu_kms->catalog->caps->has_3d_merge) 1549 + adjusted_mode_clk /= 2; 1550 + 1548 1551 /* 1549 1552 * The given mode, adjusted for the perf clock factor, should not exceed 1550 1553 * the max core clock rate
+2 -2
drivers/gpu/drm/msm/disp/dpu1/dpu_hw_catalog.c
··· 267 267 .base = 0x200, .len = 0xa0,}, \ 268 268 .csc_blk = {.name = "csc", \ 269 269 .base = 0x320, .len = 0x100,}, \ 270 - .format_list = plane_formats_yuv, \ 271 - .num_formats = ARRAY_SIZE(plane_formats_yuv), \ 270 + .format_list = plane_formats, \ 271 + .num_formats = ARRAY_SIZE(plane_formats), \ 272 272 .rotation_cfg = NULL, \ 273 273 } 274 274
+8 -6
drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
··· 500 500 int i; 501 501 502 502 for (i = 0; i < DPU_MAX_PLANES; i++) { 503 + uint32_t w = src_w, h = src_h; 504 + 503 505 if (i == DPU_SSPP_COMP_1_2 || i == DPU_SSPP_COMP_2) { 504 - src_w /= chroma_subsmpl_h; 505 - src_h /= chroma_subsmpl_v; 506 + w /= chroma_subsmpl_h; 507 + h /= chroma_subsmpl_v; 506 508 } 507 509 508 - pixel_ext->num_ext_pxls_top[i] = src_h; 509 - pixel_ext->num_ext_pxls_left[i] = src_w; 510 + pixel_ext->num_ext_pxls_top[i] = h; 511 + pixel_ext->num_ext_pxls_left[i] = w; 510 512 } 511 513 } 512 514 ··· 742 740 * We already have verified scaling against platform limitations. 743 741 * Now check if the SSPP supports scaling at all. 744 742 */ 745 - if (!sblk->scaler_blk.len && 743 + if (!(sblk->scaler_blk.len && pipe->sspp->ops.setup_scaler) && 746 744 ((drm_rect_width(&new_plane_state->src) >> 16 != 747 745 drm_rect_width(&new_plane_state->dst)) || 748 746 (drm_rect_height(&new_plane_state->src) >> 16 != ··· 1280 1278 state, plane_state, 1281 1279 prev_adjacent_plane_state); 1282 1280 if (ret) 1283 - break; 1281 + return ret; 1284 1282 1285 1283 prev_adjacent_plane_state = plane_state; 1286 1284 }
+1 -1
drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c
··· 842 842 843 843 if (!reqs->scale && !reqs->yuv) 844 844 hw_sspp = dpu_rm_try_sspp(rm, global_state, crtc, reqs, SSPP_TYPE_DMA); 845 - if (!hw_sspp && reqs->scale) 845 + if (!hw_sspp && !reqs->yuv) 846 846 hw_sspp = dpu_rm_try_sspp(rm, global_state, crtc, reqs, SSPP_TYPE_RGB); 847 847 if (!hw_sspp) 848 848 hw_sspp = dpu_rm_try_sspp(rm, global_state, crtc, reqs, SSPP_TYPE_VIG);
+3
drivers/gpu/drm/msm/disp/dpu1/dpu_writeback.c
··· 72 72 DPU_ERROR("invalid fb w=%d, maxlinewidth=%u\n", 73 73 fb->width, dpu_wb_conn->maxlinewidth); 74 74 return -EINVAL; 75 + } else if (fb->modifier != DRM_FORMAT_MOD_LINEAR) { 76 + DPU_ERROR("unsupported fb modifier:%#llx\n", fb->modifier); 77 + return -EINVAL; 75 78 } 76 79 77 80 return drm_atomic_helper_check_wb_connector_state(conn_state->connector, conn_state->state);
-1
drivers/gpu/drm/msm/dsi/phy/dsi_phy.h
··· 109 109 struct msm_dsi_dphy_timing timing; 110 110 const struct msm_dsi_phy_cfg *cfg; 111 111 void *tuning_cfg; 112 - void *pll_data; 113 112 114 113 enum msm_dsi_phy_usecase usecase; 115 114 bool regulator_ldo_mode;
+2 -16
drivers/gpu/drm/msm/dsi/phy/dsi_phy_7nm.c
··· 426 426 u32 data; 427 427 428 428 spin_lock_irqsave(&pll->pll_enable_lock, flags); 429 - if (pll->pll_enable_cnt++) { 430 - spin_unlock_irqrestore(&pll->pll_enable_lock, flags); 431 - WARN_ON(pll->pll_enable_cnt == INT_MAX); 432 - return; 433 - } 429 + pll->pll_enable_cnt++; 430 + WARN_ON(pll->pll_enable_cnt == INT_MAX); 434 431 435 432 data = readl(pll->phy->base + REG_DSI_7nm_PHY_CMN_CTRL_0); 436 433 data |= DSI_7nm_PHY_CMN_CTRL_0_PLL_SHUTDOWNB; ··· 873 876 spin_lock_init(&pll_7nm->pll_enable_lock); 874 877 875 878 pll_7nm->phy = phy; 876 - phy->pll_data = pll_7nm; 877 879 878 880 ret = pll_7nm_register(pll_7nm, phy->provided_clocks->hws); 879 881 if (ret) { ··· 961 965 u32 const delay_us = 5; 962 966 u32 const timeout_us = 1000; 963 967 struct msm_dsi_dphy_timing *timing = &phy->timing; 964 - struct dsi_pll_7nm *pll = phy->pll_data; 965 968 void __iomem *base = phy->base; 966 969 bool less_than_1500_mhz; 967 - unsigned long flags; 968 970 u32 vreg_ctrl_0, vreg_ctrl_1, lane_ctrl0; 969 971 u32 glbl_pemph_ctrl_0; 970 972 u32 glbl_str_swi_cal_sel_ctrl, glbl_hstx_str_ctrl_0; ··· 1084 1090 glbl_rescode_bot_ctrl = 0x3c; 1085 1091 } 1086 1092 1087 - spin_lock_irqsave(&pll->pll_enable_lock, flags); 1088 - pll->pll_enable_cnt = 1; 1089 1093 /* de-assert digital and pll power down */ 1090 1094 data = DSI_7nm_PHY_CMN_CTRL_0_DIGTOP_PWRDN_B | 1091 1095 DSI_7nm_PHY_CMN_CTRL_0_PLL_SHUTDOWNB; 1092 1096 writel(data, base + REG_DSI_7nm_PHY_CMN_CTRL_0); 1093 - spin_unlock_irqrestore(&pll->pll_enable_lock, flags); 1094 1097 1095 1098 /* Assert PLL core reset */ 1096 1099 writel(0x00, base + REG_DSI_7nm_PHY_CMN_PLL_CNTRL); ··· 1200 1209 1201 1210 static void dsi_7nm_phy_disable(struct msm_dsi_phy *phy) 1202 1211 { 1203 - struct dsi_pll_7nm *pll = phy->pll_data; 1204 1212 void __iomem *base = phy->base; 1205 - unsigned long flags; 1206 1213 u32 data; 1207 1214 1208 1215 DBG(""); ··· 1227 1238 writel(data, base + REG_DSI_7nm_PHY_CMN_CTRL_0); 1228 1239 writel(0, base + REG_DSI_7nm_PHY_CMN_LANE_CTRL0); 1229 1240 1230 - spin_lock_irqsave(&pll->pll_enable_lock, flags); 1231 - pll->pll_enable_cnt = 0; 1232 1241 /* Turn off all PHY blocks */ 1233 1242 writel(0x00, base + REG_DSI_7nm_PHY_CMN_CTRL_0); 1234 - spin_unlock_irqrestore(&pll->pll_enable_lock, flags); 1235 1243 1236 1244 /* make sure phy is turned off */ 1237 1245 wmb();
+7 -3
drivers/gpu/drm/msm/msm_gem.c
··· 1120 1120 put_pages(obj); 1121 1121 } 1122 1122 1123 - if (obj->resv != &obj->_resv) { 1123 + /* 1124 + * In error paths, we could end up here before msm_gem_new_handle() 1125 + * has changed obj->resv to point to the shared resv. In this case, 1126 + * we don't want to drop a ref to the shared r_obj that we haven't 1127 + * taken yet. 1128 + */ 1129 + if ((msm_obj->flags & MSM_BO_NO_SHARE) && (obj->resv != &obj->_resv)) { 1124 1130 struct drm_gem_object *r_obj = 1125 1131 container_of(obj->resv, struct drm_gem_object, _resv); 1126 - 1127 - WARN_ON(!(msm_obj->flags & MSM_BO_NO_SHARE)); 1128 1132 1129 1133 /* Drop reference we hold to shared resv obj: */ 1130 1134 drm_gem_object_put(r_obj);
+5 -4
drivers/gpu/drm/msm/msm_gem_submit.c
··· 414 414 submit->user_fence, 415 415 DMA_RESV_USAGE_BOOKKEEP, 416 416 DMA_RESV_USAGE_BOOKKEEP); 417 + 418 + last_fence = vm->last_fence; 419 + vm->last_fence = dma_fence_unwrap_merge(submit->user_fence, last_fence); 420 + dma_fence_put(last_fence); 421 + 417 422 return; 418 423 } 419 424 ··· 432 427 dma_resv_add_fence(obj->resv, submit->user_fence, 433 428 DMA_RESV_USAGE_READ); 434 429 } 435 - 436 - last_fence = vm->last_fence; 437 - vm->last_fence = dma_fence_unwrap_merge(submit->user_fence, last_fence); 438 - dma_fence_put(last_fence); 439 430 } 440 431 441 432 static int submit_bo(struct msm_gem_submit *submit, uint32_t idx,
+7 -1
drivers/gpu/drm/msm/msm_gem_vma.c
··· 971 971 lookup_op(struct msm_vm_bind_job *job, const struct drm_msm_vm_bind_op *op) 972 972 { 973 973 struct drm_device *dev = job->vm->drm; 974 + struct msm_drm_private *priv = dev->dev_private; 974 975 int i = job->nr_ops++; 975 976 int ret = 0; 976 977 ··· 1016 1015 default: 1017 1016 ret = UERR(EINVAL, dev, "invalid op: %u\n", op->op); 1018 1017 break; 1018 + } 1019 + 1020 + if ((op->op == MSM_VM_BIND_OP_MAP_NULL) && 1021 + !adreno_smmu_has_prr(priv->gpu)) { 1022 + ret = UERR(EINVAL, dev, "PRR not supported\n"); 1019 1023 } 1020 1024 1021 1025 return ret; ··· 1427 1421 * Maybe we could allow just UNMAP ops? OTOH userspace should just 1428 1422 * immediately close the device file and all will be torn down. 1429 1423 */ 1430 - if (to_msm_vm(ctx->vm)->unusable) 1424 + if (to_msm_vm(msm_context_vm(dev, ctx))->unusable) 1431 1425 return UERR(EPIPE, dev, "context is unusable"); 1432 1426 1433 1427 /*
+11
drivers/gpu/drm/msm/msm_gpu.h
··· 299 299 return container_of(adreno_smmu, struct msm_gpu, adreno_smmu); 300 300 } 301 301 302 + static inline bool 303 + adreno_smmu_has_prr(struct msm_gpu *gpu) 304 + { 305 + struct adreno_smmu_priv *adreno_smmu = dev_get_drvdata(&gpu->pdev->dev); 306 + 307 + if (!adreno_smmu) 308 + return false; 309 + 310 + return adreno_smmu && adreno_smmu->set_prr_addr; 311 + } 312 + 302 313 /* It turns out that all targets use the same ringbuffer size */ 303 314 #define MSM_GPU_RINGBUFFER_SZ SZ_32K 304 315 #define MSM_GPU_RINGBUFFER_BLKSIZE 32
+5
drivers/gpu/drm/msm/msm_iommu.c
··· 338 338 339 339 ret = kmem_cache_alloc_bulk(pt_cache, GFP_KERNEL, p->count, p->pages); 340 340 if (ret != p->count) { 341 + kfree(p->pages); 342 + p->pages = NULL; 341 343 p->count = ret; 342 344 return -ENOMEM; 343 345 } ··· 352 350 { 353 351 struct kmem_cache *pt_cache = get_pt_cache(mmu); 354 352 uint32_t remaining_pt_count = p->count - p->ptr; 353 + 354 + if (!p->pages) 355 + return; 355 356 356 357 if (p->count > 0) 357 358 trace_msm_mmu_prealloc_cleanup(p->count, remaining_pt_count);
+12 -2
drivers/gpu/drm/nouveau/nouveau_sched.c
··· 482 482 return 0; 483 483 } 484 484 485 + static bool 486 + nouveau_sched_job_list_empty(struct nouveau_sched *sched) 487 + { 488 + bool empty; 489 + 490 + spin_lock(&sched->job.list.lock); 491 + empty = list_empty(&sched->job.list.head); 492 + spin_unlock(&sched->job.list.lock); 493 + 494 + return empty; 495 + } 485 496 486 497 static void 487 498 nouveau_sched_fini(struct nouveau_sched *sched) ··· 500 489 struct drm_gpu_scheduler *drm_sched = &sched->base; 501 490 struct drm_sched_entity *entity = &sched->entity; 502 491 503 - rmb(); /* for list_empty to work without lock */ 504 - wait_event(sched->job.wq, list_empty(&sched->job.list.head)); 492 + wait_event(sched->job.wq, nouveau_sched_job_list_empty(sched)); 505 493 506 494 drm_sched_entity_fini(entity); 507 495 drm_sched_fini(drm_sched);
+1 -1
drivers/gpu/drm/panel/panel-kingdisplay-kd097d04.c
··· 359 359 dsi->lanes = 4; 360 360 dsi->format = MIPI_DSI_FMT_RGB888; 361 361 dsi->mode_flags = MIPI_DSI_MODE_VIDEO | MIPI_DSI_MODE_VIDEO_BURST | 362 - MIPI_DSI_MODE_LPM; 362 + MIPI_DSI_MODE_LPM | MIPI_DSI_MODE_NO_EOT_PACKET; 363 363 364 364 kingdisplay = devm_drm_panel_alloc(&dsi->dev, __typeof(*kingdisplay), base, 365 365 &kingdisplay_panel_funcs,
+6 -1
drivers/gpu/drm/panel/panel-sitronix-st7789v.c
··· 249 249 .flags = DRM_MODE_FLAG_PHSYNC | DRM_MODE_FLAG_PVSYNC, 250 250 }; 251 251 252 + /* 253 + * The mode data for this panel has been reverse engineered without access 254 + * to the panel datasheet / manual. Using DRM_MODE_FLAG_PHSYNC like all 255 + * other panels results in garbage data on the display. 256 + */ 252 257 static const struct drm_display_mode t28cp45tn89_mode = { 253 258 .clock = 6008, 254 259 .hdisplay = 240, ··· 266 261 .vtotal = 320 + 8 + 4 + 4, 267 262 .width_mm = 43, 268 263 .height_mm = 57, 269 - .flags = DRM_MODE_FLAG_PVSYNC | DRM_MODE_FLAG_NVSYNC, 264 + .flags = DRM_MODE_FLAG_NHSYNC | DRM_MODE_FLAG_PVSYNC, 270 265 }; 271 266 272 267 static const struct drm_display_mode et028013dma_mode = {
+4 -21
drivers/gpu/drm/radeon/radeon_drv.c
··· 314 314 315 315 ret = pci_enable_device(pdev); 316 316 if (ret) 317 - goto err_free; 317 + return ret; 318 318 319 319 pci_set_drvdata(pdev, ddev); 320 320 321 321 ret = radeon_driver_load_kms(ddev, flags); 322 322 if (ret) 323 - goto err_agp; 323 + goto err; 324 324 325 325 ret = drm_dev_register(ddev, flags); 326 326 if (ret) 327 - goto err_agp; 327 + goto err; 328 328 329 329 if (rdev->mc.real_vram_size <= (8 * 1024 * 1024)) 330 330 format = drm_format_info(DRM_FORMAT_C8); ··· 337 337 338 338 return 0; 339 339 340 - err_agp: 340 + err: 341 341 pci_disable_device(pdev); 342 - err_free: 343 - drm_dev_put(ddev); 344 342 return ret; 345 - } 346 - 347 - static void 348 - radeon_pci_remove(struct pci_dev *pdev) 349 - { 350 - struct drm_device *dev = pci_get_drvdata(pdev); 351 - 352 - drm_put_dev(dev); 353 343 } 354 344 355 345 static void 356 346 radeon_pci_shutdown(struct pci_dev *pdev) 357 347 { 358 - /* if we are running in a VM, make sure the device 359 - * torn down properly on reboot/shutdown 360 - */ 361 - if (radeon_device_is_virtual()) 362 - radeon_pci_remove(pdev); 363 - 364 348 #if defined(CONFIG_PPC64) || defined(CONFIG_MACH_LOONGSON64) 365 349 /* 366 350 * Some adapters need to be suspended before a ··· 597 613 .name = DRIVER_NAME, 598 614 .id_table = pciidlist, 599 615 .probe = radeon_pci_probe, 600 - .remove = radeon_pci_remove, 601 616 .shutdown = radeon_pci_shutdown, 602 617 .driver.pm = &radeon_pm_ops, 603 618 };
-1
drivers/gpu/drm/radeon/radeon_kms.c
··· 84 84 rdev->agp = NULL; 85 85 86 86 done_free: 87 - kfree(rdev); 88 87 dev->dev_private = NULL; 89 88 } 90 89
+4 -2
drivers/gpu/drm/scheduler/sched_entity.c
··· 70 70 entity->guilty = guilty; 71 71 entity->num_sched_list = num_sched_list; 72 72 entity->priority = priority; 73 + entity->last_user = current->group_leader; 73 74 /* 74 75 * It's perfectly valid to initialize an entity without having a valid 75 76 * scheduler attached. It's just not valid to use the scheduler before it ··· 303 302 304 303 /* For a killed process disallow further enqueueing of jobs. */ 305 304 last_user = cmpxchg(&entity->last_user, current->group_leader, NULL); 306 - if ((!last_user || last_user == current->group_leader) && 305 + if (last_user == current->group_leader && 307 306 (current->flags & PF_EXITING) && (current->exit_code == SIGKILL)) 308 307 drm_sched_entity_kill(entity); 309 308 ··· 553 552 drm_sched_rq_remove_entity(entity->rq, entity); 554 553 entity->rq = rq; 555 554 } 556 - spin_unlock(&entity->lock); 557 555 558 556 if (entity->num_sched_list == 1) 559 557 entity->sched_list = NULL; 558 + 559 + spin_unlock(&entity->lock); 560 560 } 561 561 562 562 /**
+12 -7
drivers/gpu/drm/xe/xe_gt.c
··· 813 813 unsigned int fw_ref; 814 814 int err; 815 815 816 - if (xe_device_wedged(gt_to_xe(gt))) 817 - return -ECANCELED; 816 + if (xe_device_wedged(gt_to_xe(gt))) { 817 + err = -ECANCELED; 818 + goto err_pm_put; 819 + } 818 820 819 821 /* We only support GT resets with GuC submission */ 820 - if (!xe_device_uc_enabled(gt_to_xe(gt))) 821 - return -ENODEV; 822 + if (!xe_device_uc_enabled(gt_to_xe(gt))) { 823 + err = -ENODEV; 824 + goto err_pm_put; 825 + } 822 826 823 827 xe_gt_info(gt, "reset started\n"); 824 828 825 829 err = gt_wait_reset_unblock(gt); 826 830 if (!err) 827 831 xe_gt_warn(gt, "reset block failed to get lifted"); 828 - 829 - xe_pm_runtime_get(gt_to_xe(gt)); 830 832 831 833 if (xe_fault_inject_gt_reset()) { 832 834 err = -ECANCELED; ··· 876 874 xe_gt_err(gt, "reset failed (%pe)\n", ERR_PTR(err)); 877 875 878 876 xe_device_declare_wedged(gt_to_xe(gt)); 877 + err_pm_put: 879 878 xe_pm_runtime_put(gt_to_xe(gt)); 880 879 881 880 return err; ··· 898 895 return; 899 896 900 897 xe_gt_info(gt, "reset queued\n"); 901 - queue_work(gt->ordered_wq, &gt->reset.worker); 898 + xe_pm_runtime_get_noresume(gt_to_xe(gt)); 899 + if (!queue_work(gt->ordered_wq, &gt->reset.worker)) 900 + xe_pm_runtime_put(gt_to_xe(gt)); 902 901 } 903 902 904 903 void xe_gt_suspend_prepare(struct xe_gt *gt)
+4 -4
drivers/gpu/drm/xe/xe_validation.h
··· 166 166 */ 167 167 DEFINE_CLASS(xe_validation, struct xe_validation_ctx *, 168 168 if (_T) xe_validation_ctx_fini(_T);, 169 - ({_ret = xe_validation_ctx_init(_ctx, _val, _exec, _flags); 170 - _ret ? NULL : _ctx; }), 169 + ({*_ret = xe_validation_ctx_init(_ctx, _val, _exec, _flags); 170 + *_ret ? NULL : _ctx; }), 171 171 struct xe_validation_ctx *_ctx, struct xe_validation_device *_val, 172 - struct drm_exec *_exec, const struct xe_val_flags _flags, int _ret); 172 + struct drm_exec *_exec, const struct xe_val_flags _flags, int *_ret); 173 173 static inline void *class_xe_validation_lock_ptr(class_xe_validation_t *_T) 174 174 {return *_T; } 175 175 #define class_xe_validation_is_conditional true ··· 186 186 * exhaustive eviction. 187 187 */ 188 188 #define xe_validation_guard(_ctx, _val, _exec, _flags, _ret) \ 189 - scoped_guard(xe_validation, _ctx, _val, _exec, _flags, _ret) \ 189 + scoped_guard(xe_validation, _ctx, _val, _exec, _flags, &_ret) \ 190 190 drm_exec_until_all_locked(_exec) 191 191 192 192 #endif
+1
drivers/infiniband/core/uverbs_std_types_cq.c
··· 206 206 return ret; 207 207 208 208 err_free: 209 + ib_umem_release(umem); 209 210 rdma_restrack_put(&cq->res); 210 211 kfree(cq); 211 212 err_event_file:
+3 -8
drivers/infiniband/hw/bnxt_re/ib_verbs.c
··· 913 913 spin_unlock_irqrestore(&qp->scq->cq_lock, flags); 914 914 } 915 915 916 - static int bnxt_re_destroy_gsi_sqp(struct bnxt_re_qp *qp) 916 + static void bnxt_re_destroy_gsi_sqp(struct bnxt_re_qp *qp) 917 917 { 918 918 struct bnxt_re_qp *gsi_sqp; 919 919 struct bnxt_re_ah *gsi_sah; ··· 933 933 934 934 ibdev_dbg(&rdev->ibdev, "Destroy the shadow QP\n"); 935 935 rc = bnxt_qplib_destroy_qp(&rdev->qplib_res, &gsi_sqp->qplib_qp); 936 - if (rc) { 936 + if (rc) 937 937 ibdev_err(&rdev->ibdev, "Destroy Shadow QP failed"); 938 - goto fail; 939 - } 938 + 940 939 bnxt_qplib_free_qp_res(&rdev->qplib_res, &gsi_sqp->qplib_qp); 941 940 942 941 /* remove from active qp list */ ··· 950 951 rdev->gsi_ctx.gsi_sqp = NULL; 951 952 rdev->gsi_ctx.gsi_sah = NULL; 952 953 rdev->gsi_ctx.sqp_tbl = NULL; 953 - 954 - return 0; 955 - fail: 956 - return rc; 957 954 } 958 955 959 956 static void bnxt_re_del_unique_gid(struct bnxt_re_dev *rdev)
+7 -9
drivers/infiniband/hw/efa/efa_verbs.c
··· 1216 1216 if (umem->length < cq->size) { 1217 1217 ibdev_dbg(&dev->ibdev, "External memory too small\n"); 1218 1218 err = -EINVAL; 1219 - goto err_free_mem; 1219 + goto err_out; 1220 1220 } 1221 1221 1222 1222 if (!ib_umem_is_contiguous(umem)) { 1223 1223 ibdev_dbg(&dev->ibdev, "Non contiguous CQ unsupported\n"); 1224 1224 err = -EINVAL; 1225 - goto err_free_mem; 1225 + goto err_out; 1226 1226 } 1227 1227 1228 1228 cq->cpu_addr = NULL; ··· 1251 1251 1252 1252 err = efa_com_create_cq(&dev->edev, &params, &result); 1253 1253 if (err) 1254 - goto err_free_mem; 1254 + goto err_free_mapped; 1255 1255 1256 1256 resp.db_off = result.db_off; 1257 1257 resp.cq_idx = result.cq_idx; ··· 1299 1299 efa_cq_user_mmap_entries_remove(cq); 1300 1300 err_destroy_cq: 1301 1301 efa_destroy_cq_idx(dev, cq->cq_idx); 1302 - err_free_mem: 1303 - if (umem) 1304 - ib_umem_release(umem); 1305 - else 1306 - efa_free_mapped(dev, cq->cpu_addr, cq->dma_addr, cq->size, DMA_FROM_DEVICE); 1307 - 1302 + err_free_mapped: 1303 + if (!umem) 1304 + efa_free_mapped(dev, cq->cpu_addr, cq->dma_addr, cq->size, 1305 + DMA_FROM_DEVICE); 1308 1306 err_out: 1309 1307 atomic64_inc(&dev->stats.create_cq_err); 1310 1308 return err;
+55 -3
drivers/infiniband/hw/hns/hns_roce_cq.c
··· 30 30 * SOFTWARE. 31 31 */ 32 32 33 + #include <linux/pci.h> 33 34 #include <rdma/ib_umem.h> 34 35 #include <rdma/uverbs_ioctl.h> 35 36 #include "hns_roce_device.h" 36 37 #include "hns_roce_cmd.h" 37 38 #include "hns_roce_hem.h" 38 39 #include "hns_roce_common.h" 40 + 41 + void hns_roce_put_cq_bankid_for_uctx(struct hns_roce_ucontext *uctx) 42 + { 43 + struct hns_roce_dev *hr_dev = to_hr_dev(uctx->ibucontext.device); 44 + struct hns_roce_cq_table *cq_table = &hr_dev->cq_table; 45 + 46 + if (hr_dev->pci_dev->revision < PCI_REVISION_ID_HIP09) 47 + return; 48 + 49 + mutex_lock(&cq_table->bank_mutex); 50 + cq_table->ctx_num[uctx->cq_bank_id]--; 51 + mutex_unlock(&cq_table->bank_mutex); 52 + } 53 + 54 + void hns_roce_get_cq_bankid_for_uctx(struct hns_roce_ucontext *uctx) 55 + { 56 + struct hns_roce_dev *hr_dev = to_hr_dev(uctx->ibucontext.device); 57 + struct hns_roce_cq_table *cq_table = &hr_dev->cq_table; 58 + u32 least_load = cq_table->ctx_num[0]; 59 + u8 bankid = 0; 60 + u8 i; 61 + 62 + if (hr_dev->pci_dev->revision < PCI_REVISION_ID_HIP09) 63 + return; 64 + 65 + mutex_lock(&cq_table->bank_mutex); 66 + for (i = 1; i < HNS_ROCE_CQ_BANK_NUM; i++) { 67 + if (cq_table->ctx_num[i] < least_load) { 68 + least_load = cq_table->ctx_num[i]; 69 + bankid = i; 70 + } 71 + } 72 + cq_table->ctx_num[bankid]++; 73 + mutex_unlock(&cq_table->bank_mutex); 74 + 75 + uctx->cq_bank_id = bankid; 76 + } 39 77 40 78 static u8 get_least_load_bankid_for_cq(struct hns_roce_bank *bank) 41 79 { ··· 93 55 return bankid; 94 56 } 95 57 96 - static int alloc_cqn(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq) 58 + static u8 select_cq_bankid(struct hns_roce_dev *hr_dev, 59 + struct hns_roce_bank *bank, struct ib_udata *udata) 60 + { 61 + struct hns_roce_ucontext *uctx = udata ? 62 + rdma_udata_to_drv_context(udata, struct hns_roce_ucontext, 63 + ibucontext) : NULL; 64 + 65 + if (hr_dev->pci_dev->revision >= PCI_REVISION_ID_HIP09) 66 + return uctx ? uctx->cq_bank_id : 0; 67 + 68 + return get_least_load_bankid_for_cq(bank); 69 + } 70 + 71 + static int alloc_cqn(struct hns_roce_dev *hr_dev, struct hns_roce_cq *hr_cq, 72 + struct ib_udata *udata) 97 73 { 98 74 struct hns_roce_cq_table *cq_table = &hr_dev->cq_table; 99 75 struct hns_roce_bank *bank; ··· 115 63 int id; 116 64 117 65 mutex_lock(&cq_table->bank_mutex); 118 - bankid = get_least_load_bankid_for_cq(cq_table->bank); 66 + bankid = select_cq_bankid(hr_dev, cq_table->bank, udata); 119 67 bank = &cq_table->bank[bankid]; 120 68 121 69 id = ida_alloc_range(&bank->ida, bank->min, bank->max, GFP_KERNEL); ··· 448 396 goto err_cq_buf; 449 397 } 450 398 451 - ret = alloc_cqn(hr_dev, hr_cq); 399 + ret = alloc_cqn(hr_dev, hr_cq, udata); 452 400 if (ret) { 453 401 ibdev_err(ibdev, "failed to alloc CQN, ret = %d.\n", ret); 454 402 goto err_cq_db;
+4
drivers/infiniband/hw/hns/hns_roce_device.h
··· 217 217 struct mutex page_mutex; 218 218 struct hns_user_mmap_entry *db_mmap_entry; 219 219 u32 config; 220 + u8 cq_bank_id; 220 221 }; 221 222 222 223 struct hns_roce_pd { ··· 496 495 struct hns_roce_hem_table table; 497 496 struct hns_roce_bank bank[HNS_ROCE_CQ_BANK_NUM]; 498 497 struct mutex bank_mutex; 498 + u32 ctx_num[HNS_ROCE_CQ_BANK_NUM]; 499 499 }; 500 500 501 501 struct hns_roce_srq_table { ··· 1307 1305 size_t length, 1308 1306 enum hns_roce_mmap_type mmap_type); 1309 1307 bool check_sl_valid(struct hns_roce_dev *hr_dev, u8 sl); 1308 + void hns_roce_put_cq_bankid_for_uctx(struct hns_roce_ucontext *uctx); 1309 + void hns_roce_get_cq_bankid_for_uctx(struct hns_roce_ucontext *uctx); 1310 1310 1311 1311 #endif /* _HNS_ROCE_DEVICE_H */
+8 -4
drivers/infiniband/hw/hns/hns_roce_hw_v2.c
··· 165 165 hr_reg_write(fseg, FRMR_PBL_BUF_PG_SZ, 166 166 to_hr_hw_page_shift(mr->pbl_mtr.hem_cfg.buf_pg_shift)); 167 167 hr_reg_clear(fseg, FRMR_BLK_MODE); 168 + hr_reg_clear(fseg, FRMR_BLOCK_SIZE); 169 + hr_reg_clear(fseg, FRMR_ZBVA); 168 170 } 169 171 170 172 static void set_atomic_seg(const struct ib_send_wr *wr, ··· 340 338 struct hns_roce_qp *qp = to_hr_qp(ibqp); 341 339 int j = 0; 342 340 int i; 343 - 344 - hr_reg_write(rc_sq_wqe, RC_SEND_WQE_MSG_START_SGE_IDX, 345 - (*sge_ind) & (qp->sge.sge_cnt - 1)); 346 341 347 342 hr_reg_write(rc_sq_wqe, RC_SEND_WQE_INLINE, 348 343 !!(wr->send_flags & IB_SEND_INLINE)); ··· 585 586 hr_reg_write(rc_sq_wqe, RC_SEND_WQE_CQE, 586 587 (wr->send_flags & IB_SEND_SIGNALED) ? 1 : 0); 587 588 589 + hr_reg_write(rc_sq_wqe, RC_SEND_WQE_MSG_START_SGE_IDX, 590 + curr_idx & (qp->sge.sge_cnt - 1)); 591 + 588 592 if (wr->opcode == IB_WR_ATOMIC_CMP_AND_SWP || 589 593 wr->opcode == IB_WR_ATOMIC_FETCH_AND_ADD) { 590 594 if (msg_len != ATOMIC_WR_LEN) ··· 735 733 qp->sq.wrid[wqe_idx] = wr->wr_id; 736 734 owner_bit = 737 735 ~(((qp->sq.head + nreq) >> ilog2(qp->sq.wqe_cnt)) & 0x1); 736 + 737 + /* RC and UD share the same DirectWQE field layout */ 738 + ((struct hns_roce_v2_rc_send_wqe *)wqe)->byte_4 = 0; 738 739 739 740 /* Corresponding to the QP type, wqe process separately */ 740 741 if (ibqp->qp_type == IB_QPT_RC) ··· 7052 7047 dev_err(hr_dev->dev, "RoCE Engine init failed!\n"); 7053 7048 goto error_failed_roce_init; 7054 7049 } 7055 - 7056 7050 7057 7051 handle->priv = hr_dev; 7058 7052
+4
drivers/infiniband/hw/hns/hns_roce_main.c
··· 425 425 if (ret) 426 426 goto error_fail_copy_to_udata; 427 427 428 + hns_roce_get_cq_bankid_for_uctx(context); 429 + 428 430 return 0; 429 431 430 432 error_fail_copy_to_udata: ··· 448 446 { 449 447 struct hns_roce_ucontext *context = to_hr_ucontext(ibcontext); 450 448 struct hns_roce_dev *hr_dev = to_hr_dev(ibcontext->device); 449 + 450 + hns_roce_put_cq_bankid_for_uctx(context); 451 451 452 452 if (hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_CQ_RECORD_DB || 453 453 hr_dev->caps.flags & HNS_ROCE_CAP_FLAG_QP_RECORD_DB)
-2
drivers/infiniband/hw/hns/hns_roce_qp.c
··· 662 662 663 663 hr_qp->sq.wqe_shift = ucmd->log_sq_stride; 664 664 hr_qp->sq.wqe_cnt = cnt; 665 - cap->max_send_sge = hr_qp->sq.max_gs; 666 665 667 666 return 0; 668 667 } ··· 743 744 744 745 /* sync the parameters of kernel QP to user's configuration */ 745 746 cap->max_send_wr = cnt; 746 - cap->max_send_sge = hr_qp->sq.max_gs; 747 747 748 748 return 0; 749 749 }
+1 -1
drivers/infiniband/hw/irdma/pble.c
··· 71 71 static void get_sd_pd_idx(struct irdma_hmc_pble_rsrc *pble_rsrc, 72 72 struct sd_pd_idx *idx) 73 73 { 74 - idx->sd_idx = (u32)pble_rsrc->next_fpm_addr / IRDMA_HMC_DIRECT_BP_SIZE; 74 + idx->sd_idx = pble_rsrc->next_fpm_addr / IRDMA_HMC_DIRECT_BP_SIZE; 75 75 idx->pd_idx = (u32)(pble_rsrc->next_fpm_addr / IRDMA_HMC_PAGED_BP_SIZE); 76 76 idx->rel_pd_idx = (idx->pd_idx % IRDMA_HMC_PD_CNT_IN_SD); 77 77 }
+1 -1
drivers/infiniband/hw/irdma/type.h
··· 706 706 u32 vchnl_ver; 707 707 u16 num_vfs; 708 708 u16 hmc_fn_id; 709 - u8 vf_id; 709 + u16 vf_id; 710 710 bool privileged:1; 711 711 bool vchnl_up:1; 712 712 bool ceq_valid:1;
+1
drivers/infiniband/hw/irdma/verbs.c
··· 2503 2503 spin_lock_init(&iwcq->lock); 2504 2504 INIT_LIST_HEAD(&iwcq->resize_list); 2505 2505 INIT_LIST_HEAD(&iwcq->cmpl_generated); 2506 + iwcq->cq_num = cq_num; 2506 2507 info.dev = dev; 2507 2508 ukinfo->cq_size = max(entries, 4); 2508 2509 ukinfo->cq_id = cq_num;
+1 -1
drivers/infiniband/hw/irdma/verbs.h
··· 140 140 struct irdma_cq { 141 141 struct ib_cq ibcq; 142 142 struct irdma_sc_cq sc_cq; 143 - u16 cq_num; 143 + u32 cq_num; 144 144 bool user_mode; 145 145 atomic_t armed; 146 146 enum irdma_cmpl_notify last_notify;
+13 -5
drivers/isdn/hardware/mISDN/hfcsusb.c
··· 1904 1904 mISDN_freebchannel(&hw->bch[1]); 1905 1905 mISDN_freebchannel(&hw->bch[0]); 1906 1906 mISDN_freedchannel(&hw->dch); 1907 - kfree(hw); 1908 1907 return err; 1909 1908 } 1910 1909 1911 1910 static int 1912 1911 hfcsusb_probe(struct usb_interface *intf, const struct usb_device_id *id) 1913 1912 { 1913 + int err; 1914 1914 struct hfcsusb *hw; 1915 1915 struct usb_device *dev = interface_to_usbdev(intf); 1916 1916 struct usb_host_interface *iface = intf->cur_altsetting; ··· 2101 2101 if (!hw->ctrl_urb) { 2102 2102 pr_warn("%s: No memory for control urb\n", 2103 2103 driver_info->vend_name); 2104 - kfree(hw); 2105 - return -ENOMEM; 2104 + err = -ENOMEM; 2105 + goto err_free_hw; 2106 2106 } 2107 2107 2108 2108 pr_info("%s: %s: detected \"%s\" (%s, if=%d alt=%d)\n", 2109 2109 hw->name, __func__, driver_info->vend_name, 2110 2110 conf_str[small_match], ifnum, alt_used); 2111 2111 2112 - if (setup_instance(hw, dev->dev.parent)) 2113 - return -EIO; 2112 + if (setup_instance(hw, dev->dev.parent)) { 2113 + err = -EIO; 2114 + goto err_free_urb; 2115 + } 2114 2116 2115 2117 hw->intf = intf; 2116 2118 usb_set_intfdata(hw->intf, hw); 2117 2119 return 0; 2120 + 2121 + err_free_urb: 2122 + usb_free_urb(hw->ctrl_urb); 2123 + err_free_hw: 2124 + kfree(hw); 2125 + return err; 2118 2126 } 2119 2127 2120 2128 /* function called when an active device is removed */
+5
drivers/media/common/videobuf2/videobuf2-v4l2.c
··· 1010 1010 if (vb2_queue_is_busy(vdev->queue, file)) 1011 1011 return -EBUSY; 1012 1012 1013 + if (vb2_fileio_is_active(vdev->queue)) { 1014 + dprintk(vdev->queue, 1, "file io in progress\n"); 1015 + return -EBUSY; 1016 + } 1017 + 1013 1018 return vb2_core_remove_bufs(vdev->queue, d->index, d->count); 1014 1019 } 1015 1020 EXPORT_SYMBOL_GPL(vb2_ioctl_remove_bufs);
+3 -6
drivers/media/pci/cx18/cx18-driver.c
··· 1136 1136 int video_input; 1137 1137 int fw_retry_count = 3; 1138 1138 struct v4l2_frequency vf; 1139 - struct cx18_open_id fh; 1140 1139 v4l2_std_id std; 1141 - 1142 - fh.cx = cx; 1143 1140 1144 1141 if (test_bit(CX18_F_I_FAILED, &cx->i_flags)) 1145 1142 return -ENXIO; ··· 1217 1220 1218 1221 video_input = cx->active_input; 1219 1222 cx->active_input++; /* Force update of input */ 1220 - cx18_s_input(NULL, &fh, video_input); 1223 + cx18_do_s_input(cx, video_input); 1221 1224 1222 1225 /* Let the VIDIOC_S_STD ioctl do all the work, keeps the code 1223 1226 in one place. */ 1224 1227 cx->std++; /* Force full standard initialization */ 1225 1228 std = (cx->tuner_std == V4L2_STD_ALL) ? V4L2_STD_NTSC_M : cx->tuner_std; 1226 - cx18_s_std(NULL, &fh, std); 1227 - cx18_s_frequency(NULL, &fh, &vf); 1229 + cx18_do_s_std(cx, std); 1230 + cx18_do_s_frequency(cx, &vf); 1228 1231 return 0; 1229 1232 } 1230 1233
+19 -11
drivers/media/pci/cx18/cx18-ioctl.c
··· 521 521 return 0; 522 522 } 523 523 524 - int cx18_s_input(struct file *file, void *fh, unsigned int inp) 524 + int cx18_do_s_input(struct cx18 *cx, unsigned int inp) 525 525 { 526 - struct cx18_open_id *id = file2id(file); 527 - struct cx18 *cx = id->cx; 528 526 v4l2_std_id std = V4L2_STD_ALL; 529 527 const struct cx18_card_video_input *card_input = 530 528 cx->card->video_inputs + inp; ··· 556 558 return 0; 557 559 } 558 560 561 + static int cx18_s_input(struct file *file, void *fh, unsigned int inp) 562 + { 563 + return cx18_do_s_input(file2id(file)->cx, inp); 564 + } 565 + 559 566 static int cx18_g_frequency(struct file *file, void *fh, 560 567 struct v4l2_frequency *vf) 561 568 { ··· 573 570 return 0; 574 571 } 575 572 576 - int cx18_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf) 573 + int cx18_do_s_frequency(struct cx18 *cx, const struct v4l2_frequency *vf) 577 574 { 578 - struct cx18_open_id *id = file2id(file); 579 - struct cx18 *cx = id->cx; 580 - 581 575 if (vf->tuner != 0) 582 576 return -EINVAL; 583 577 ··· 585 585 return 0; 586 586 } 587 587 588 + static int cx18_s_frequency(struct file *file, void *fh, 589 + const struct v4l2_frequency *vf) 590 + { 591 + return cx18_do_s_frequency(file2id(file)->cx, vf); 592 + } 593 + 588 594 static int cx18_g_std(struct file *file, void *fh, v4l2_std_id *std) 589 595 { 590 596 struct cx18 *cx = file2id(file)->cx; ··· 599 593 return 0; 600 594 } 601 595 602 - int cx18_s_std(struct file *file, void *fh, v4l2_std_id std) 596 + int cx18_do_s_std(struct cx18 *cx, v4l2_std_id std) 603 597 { 604 - struct cx18_open_id *id = file2id(file); 605 - struct cx18 *cx = id->cx; 606 - 607 598 if ((std & V4L2_STD_ALL) == 0) 608 599 return -EINVAL; 609 600 ··· 643 640 /* Tuner */ 644 641 cx18_call_all(cx, video, s_std, cx->std); 645 642 return 0; 643 + } 644 + 645 + static int cx18_s_std(struct file *file, void *fh, v4l2_std_id std) 646 + { 647 + return cx18_do_s_std(file2id(file)->cx, std); 646 648 } 647 649 648 650 static int cx18_s_tuner(struct file *file, void *fh, const struct v4l2_tuner *vt)
+5 -3
drivers/media/pci/cx18/cx18-ioctl.h
··· 12 12 void cx18_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal); 13 13 u16 cx18_get_service_set(struct v4l2_sliced_vbi_format *fmt); 14 14 void cx18_set_funcs(struct video_device *vdev); 15 - int cx18_s_std(struct file *file, void *fh, v4l2_std_id std); 16 - int cx18_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf); 17 - int cx18_s_input(struct file *file, void *fh, unsigned int inp); 15 + 16 + struct cx18; 17 + int cx18_do_s_std(struct cx18 *cx, v4l2_std_id std); 18 + int cx18_do_s_frequency(struct cx18 *cx, const struct v4l2_frequency *vf); 19 + int cx18_do_s_input(struct cx18 *cx, unsigned int inp);
+4 -7
drivers/media/pci/ivtv/ivtv-driver.c
··· 1247 1247 1248 1248 int ivtv_init_on_first_open(struct ivtv *itv) 1249 1249 { 1250 - struct v4l2_frequency vf; 1251 1250 /* Needed to call ioctls later */ 1252 - struct ivtv_open_id fh; 1251 + struct ivtv_stream *s = &itv->streams[IVTV_ENC_STREAM_TYPE_MPG]; 1252 + struct v4l2_frequency vf; 1253 1253 int fw_retry_count = 3; 1254 1254 int video_input; 1255 - 1256 - fh.itv = itv; 1257 - fh.type = IVTV_ENC_STREAM_TYPE_MPG; 1258 1255 1259 1256 if (test_bit(IVTV_F_I_FAILED, &itv->i_flags)) 1260 1257 return -ENXIO; ··· 1294 1297 1295 1298 video_input = itv->active_input; 1296 1299 itv->active_input++; /* Force update of input */ 1297 - ivtv_s_input(NULL, &fh, video_input); 1300 + ivtv_do_s_input(itv, video_input); 1298 1301 1299 1302 /* Let the VIDIOC_S_STD ioctl do all the work, keeps the code 1300 1303 in one place. */ 1301 1304 itv->std++; /* Force full standard initialization */ 1302 1305 itv->std_out = itv->std; 1303 - ivtv_s_frequency(NULL, &fh, &vf); 1306 + ivtv_do_s_frequency(s, &vf); 1304 1307 1305 1308 if (itv->card->v4l2_capabilities & V4L2_CAP_VIDEO_OUTPUT) { 1306 1309 /* Turn on the TV-out: ivtv_init_mpeg_decoder() initializes
+17 -5
drivers/media/pci/ivtv/ivtv-ioctl.c
··· 974 974 return 0; 975 975 } 976 976 977 - int ivtv_s_input(struct file *file, void *fh, unsigned int inp) 977 + int ivtv_do_s_input(struct ivtv *itv, unsigned int inp) 978 978 { 979 - struct ivtv *itv = file2id(file)->itv; 980 979 v4l2_std_id std; 981 980 int i; 982 981 ··· 1014 1015 ivtv_unmute(itv); 1015 1016 1016 1017 return 0; 1018 + } 1019 + 1020 + static int ivtv_s_input(struct file *file, void *fh, unsigned int inp) 1021 + { 1022 + return ivtv_do_s_input(file2id(file)->itv, inp); 1017 1023 } 1018 1024 1019 1025 static int ivtv_g_output(struct file *file, void *fh, unsigned int *i) ··· 1069 1065 return 0; 1070 1066 } 1071 1067 1072 - int ivtv_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf) 1068 + int ivtv_do_s_frequency(struct ivtv_stream *s, const struct v4l2_frequency *vf) 1073 1069 { 1074 - struct ivtv *itv = file2id(file)->itv; 1075 - struct ivtv_stream *s = &itv->streams[file2id(file)->type]; 1070 + struct ivtv *itv = s->itv; 1076 1071 1077 1072 if (s->vdev.vfl_dir) 1078 1073 return -ENOTTY; ··· 1083 1080 ivtv_call_all(itv, tuner, s_frequency, vf); 1084 1081 ivtv_unmute(itv); 1085 1082 return 0; 1083 + } 1084 + 1085 + static int ivtv_s_frequency(struct file *file, void *fh, 1086 + const struct v4l2_frequency *vf) 1087 + { 1088 + struct ivtv_open_id *id = file2id(file); 1089 + struct ivtv *itv = id->itv; 1090 + 1091 + return ivtv_do_s_frequency(&itv->streams[id->type], vf); 1086 1092 } 1087 1093 1088 1094 static int ivtv_g_std(struct file *file, void *fh, v4l2_std_id *std)
+4 -2
drivers/media/pci/ivtv/ivtv-ioctl.h
··· 9 9 #ifndef IVTV_IOCTL_H 10 10 #define IVTV_IOCTL_H 11 11 12 + struct ivtv; 13 + 12 14 u16 ivtv_service2vbi(int type); 13 15 void ivtv_expand_service_set(struct v4l2_sliced_vbi_format *fmt, int is_pal); 14 16 u16 ivtv_get_service_set(struct v4l2_sliced_vbi_format *fmt); ··· 19 17 void ivtv_set_funcs(struct video_device *vdev); 20 18 void ivtv_s_std_enc(struct ivtv *itv, v4l2_std_id std); 21 19 void ivtv_s_std_dec(struct ivtv *itv, v4l2_std_id std); 22 - int ivtv_s_frequency(struct file *file, void *fh, const struct v4l2_frequency *vf); 23 - int ivtv_s_input(struct file *file, void *fh, unsigned int inp); 20 + int ivtv_do_s_frequency(struct ivtv_stream *s, const struct v4l2_frequency *vf); 21 + int ivtv_do_s_input(struct ivtv *itv, unsigned int inp); 24 22 25 23 #endif
+14 -1
drivers/media/usb/uvc/uvc_driver.c
··· 167 167 168 168 static struct uvc_streaming *uvc_stream_by_id(struct uvc_device *dev, int id) 169 169 { 170 - struct uvc_streaming *stream; 170 + struct uvc_streaming *stream, *last_stream; 171 + unsigned int count = 0; 171 172 172 173 list_for_each_entry(stream, &dev->streams, list) { 174 + count += 1; 175 + last_stream = stream; 173 176 if (stream->header.bTerminalLink == id) 174 177 return stream; 178 + } 179 + 180 + /* 181 + * If the streaming entity is referenced by an invalid ID, notify the 182 + * user and use heuristics to guess the correct entity. 183 + */ 184 + if (count == 1 && id == UVC_INVALID_ENTITY_ID) { 185 + dev_warn(&dev->intf->dev, 186 + "UVC non compliance: Invalid USB header. The streaming entity has an invalid ID, guessing the correct one."); 187 + return last_stream; 175 188 } 176 189 177 190 return NULL;
+1 -1
drivers/media/v4l2-core/v4l2-subdev.c
··· 2608 2608 int v4l2_subdev_get_privacy_led(struct v4l2_subdev *sd) 2609 2609 { 2610 2610 #if IS_REACHABLE(CONFIG_LEDS_CLASS) 2611 - sd->privacy_led = led_get(sd->dev, "privacy-led"); 2611 + sd->privacy_led = led_get(sd->dev, "privacy"); 2612 2612 if (IS_ERR(sd->privacy_led) && PTR_ERR(sd->privacy_led) != -ENOENT) 2613 2613 return dev_err_probe(sd->dev, PTR_ERR(sd->privacy_led), 2614 2614 "getting privacy LED\n");
+1 -8
drivers/net/bonding/bond_options.c
··· 225 225 { NULL, -1, 0}, 226 226 }; 227 227 228 - static const struct bond_opt_value bond_actor_port_prio_tbl[] = { 229 - { "minval", 0, BOND_VALFLAG_MIN}, 230 - { "maxval", 65535, BOND_VALFLAG_MAX}, 231 - { "default", 255, BOND_VALFLAG_DEFAULT}, 232 - { NULL, -1, 0}, 233 - }; 234 - 235 228 static const struct bond_opt_value bond_ad_user_port_key_tbl[] = { 236 229 { "minval", 0, BOND_VALFLAG_MIN | BOND_VALFLAG_DEFAULT}, 237 230 { "maxval", 1023, BOND_VALFLAG_MAX}, ··· 490 497 .id = BOND_OPT_ACTOR_PORT_PRIO, 491 498 .name = "actor_port_prio", 492 499 .unsuppmodes = BOND_MODE_ALL_EX(BIT(BOND_MODE_8023AD)), 493 - .values = bond_actor_port_prio_tbl, 500 + .flags = BOND_OPTFLAG_RAWVAL, 494 501 .set = bond_option_actor_port_prio_set, 495 502 }, 496 503 [BOND_OPT_AD_ACTOR_SYSTEM] = {
+29 -7
drivers/net/dsa/b53/b53_common.c
··· 371 371 * frames should be flooded or not. 372 372 */ 373 373 b53_read8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, &mgmt); 374 - mgmt |= B53_UC_FWD_EN | B53_MC_FWD_EN | B53_IPMC_FWD_EN; 374 + mgmt |= B53_UC_FWD_EN | B53_MC_FWD_EN | B53_IP_MC; 375 375 b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt); 376 376 } else { 377 377 b53_read8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, &mgmt); 378 - mgmt |= B53_IP_MCAST_25; 378 + mgmt |= B53_IP_MC; 379 379 b53_write8(dev, B53_CTRL_PAGE, B53_IP_MULTICAST_CTRL, mgmt); 380 380 } 381 381 } ··· 1392 1392 else 1393 1393 reg &= ~PORT_OVERRIDE_FULL_DUPLEX; 1394 1394 1395 + reg &= ~(0x3 << GMII_PO_SPEED_S); 1396 + if (is5301x(dev) || is58xx(dev)) 1397 + reg &= ~PORT_OVERRIDE_SPEED_2000M; 1398 + 1395 1399 switch (speed) { 1396 1400 case 2000: 1397 1401 reg |= PORT_OVERRIDE_SPEED_2000M; ··· 1413 1409 dev_err(dev->dev, "unknown speed: %d\n", speed); 1414 1410 return; 1415 1411 } 1412 + 1413 + if (is5325(dev)) 1414 + reg &= ~PORT_OVERRIDE_LP_FLOW_25; 1415 + else 1416 + reg &= ~(PORT_OVERRIDE_RX_FLOW | PORT_OVERRIDE_TX_FLOW); 1416 1417 1417 1418 if (rx_pause) { 1418 1419 if (is5325(dev)) ··· 1622 1613 struct b53_device *dev = dp->ds->priv; 1623 1614 int port = dp->index; 1624 1615 1625 - if (mode == MLO_AN_PHY) 1616 + if (mode == MLO_AN_PHY) { 1617 + if (is63xx(dev) && in_range(port, B53_63XX_RGMII0, 4)) 1618 + b53_force_link(dev, port, false); 1626 1619 return; 1620 + } 1627 1621 1628 1622 if (mode == MLO_AN_FIXED) { 1629 1623 b53_force_link(dev, port, false); ··· 1654 1642 if (mode == MLO_AN_PHY) { 1655 1643 /* Re-negotiate EEE if it was enabled already */ 1656 1644 p->eee_enabled = b53_eee_init(ds, port, phydev); 1645 + 1646 + if (is63xx(dev) && in_range(port, B53_63XX_RGMII0, 4)) { 1647 + b53_force_port_config(dev, port, speed, duplex, 1648 + tx_pause, rx_pause); 1649 + b53_force_link(dev, port, true); 1650 + } 1651 + 1657 1652 return; 1658 1653 } 1659 1654 ··· 2057 2038 do { 2058 2039 b53_read8(dev, B53_ARLIO_PAGE, offset, &reg); 2059 2040 if (!(reg & ARL_SRCH_STDN)) 2060 - return 0; 2041 + return -ENOENT; 2061 2042 2062 2043 if (reg & ARL_SRCH_VLID) 2063 2044 return 0; ··· 2107 2088 int b53_fdb_dump(struct dsa_switch *ds, int port, 2108 2089 dsa_fdb_dump_cb_t *cb, void *data) 2109 2090 { 2091 + unsigned int count = 0, results_per_hit = 1; 2110 2092 struct b53_device *priv = ds->priv; 2111 2093 struct b53_arl_entry results[2]; 2112 - unsigned int count = 0; 2113 2094 u8 offset; 2114 2095 int ret; 2115 2096 u8 reg; 2097 + 2098 + if (priv->num_arl_bins > 2) 2099 + results_per_hit = 2; 2116 2100 2117 2101 mutex_lock(&priv->arl_mutex); 2118 2102 ··· 2138 2116 if (ret) 2139 2117 break; 2140 2118 2141 - if (priv->num_arl_bins > 2) { 2119 + if (results_per_hit == 2) { 2142 2120 b53_arl_search_rd(priv, 1, &results[1]); 2143 2121 ret = b53_fdb_copy(port, &results[1], cb, data); 2144 2122 if (ret) ··· 2148 2126 break; 2149 2127 } 2150 2128 2151 - } while (count++ < b53_max_arl_entries(priv) / 2); 2129 + } while (count++ < b53_max_arl_entries(priv) / results_per_hit); 2152 2130 2153 2131 mutex_unlock(&priv->arl_mutex); 2154 2132
+1 -2
drivers/net/dsa/b53/b53_regs.h
··· 111 111 112 112 /* IP Multicast control (8 bit) */ 113 113 #define B53_IP_MULTICAST_CTRL 0x21 114 - #define B53_IP_MCAST_25 BIT(0) 115 - #define B53_IPMC_FWD_EN BIT(1) 114 + #define B53_IP_MC BIT(0) 116 115 #define B53_UC_FWD_EN BIT(6) 117 116 #define B53_MC_FWD_EN BIT(7) 118 117
+84 -14
drivers/net/dsa/microchip/ksz9477.c
··· 1355 1355 } 1356 1356 } 1357 1357 1358 + #define RESV_MCAST_CNT 8 1359 + 1360 + static u8 reserved_mcast_map[RESV_MCAST_CNT] = { 0, 1, 3, 16, 32, 33, 2, 17 }; 1361 + 1358 1362 int ksz9477_enable_stp_addr(struct ksz_device *dev) 1359 1363 { 1364 + u8 i, ports, update; 1360 1365 const u32 *masks; 1366 + bool override; 1361 1367 u32 data; 1362 1368 int ret; 1363 1369 ··· 1372 1366 /* Enable Reserved multicast table */ 1373 1367 ksz_cfg(dev, REG_SW_LUE_CTRL_0, SW_RESV_MCAST_ENABLE, true); 1374 1368 1375 - /* Set the Override bit for forwarding BPDU packet to CPU */ 1376 - ret = ksz_write32(dev, REG_SW_ALU_VAL_B, 1377 - ALU_V_OVERRIDE | BIT(dev->cpu_port)); 1378 - if (ret < 0) 1379 - return ret; 1369 + /* The reserved multicast address table has 8 entries. Each entry has 1370 + * a default value of which port to forward. It is assumed the host 1371 + * port is the last port in most of the switches, but that is not the 1372 + * case for KSZ9477 or maybe KSZ9897. For LAN937X family the default 1373 + * port is port 5, the first RGMII port. It is okay for LAN9370, a 1374 + * 5-port switch, but may not be correct for the other 8-port 1375 + * versions. It is necessary to update the whole table to forward to 1376 + * the right ports. 1377 + * Furthermore PTP messages can use a reserved multicast address and 1378 + * the host will not receive them if this table is not correct. 1379 + */ 1380 + for (i = 0; i < RESV_MCAST_CNT; i++) { 1381 + data = reserved_mcast_map[i] << 1382 + dev->info->shifts[ALU_STAT_INDEX]; 1383 + data |= ALU_STAT_START | 1384 + masks[ALU_STAT_DIRECT] | 1385 + masks[ALU_RESV_MCAST_ADDR] | 1386 + masks[ALU_STAT_READ]; 1387 + ret = ksz_write32(dev, REG_SW_ALU_STAT_CTRL__4, data); 1388 + if (ret < 0) 1389 + return ret; 1380 1390 1381 - data = ALU_STAT_START | ALU_RESV_MCAST_ADDR | masks[ALU_STAT_WRITE]; 1391 + /* wait to be finished */ 1392 + ret = ksz9477_wait_alu_sta_ready(dev); 1393 + if (ret < 0) 1394 + return ret; 1382 1395 1383 - ret = ksz_write32(dev, REG_SW_ALU_STAT_CTRL__4, data); 1384 - if (ret < 0) 1385 - return ret; 1396 + ret = ksz_read32(dev, REG_SW_ALU_VAL_B, &data); 1397 + if (ret < 0) 1398 + return ret; 1386 1399 1387 - /* wait to be finished */ 1388 - ret = ksz9477_wait_alu_sta_ready(dev); 1389 - if (ret < 0) { 1390 - dev_err(dev->dev, "Failed to update Reserved Multicast table\n"); 1391 - return ret; 1400 + override = false; 1401 + ports = data & dev->port_mask; 1402 + switch (i) { 1403 + case 0: 1404 + case 6: 1405 + /* Change the host port. */ 1406 + update = BIT(dev->cpu_port); 1407 + override = true; 1408 + break; 1409 + case 2: 1410 + /* Change the host port. */ 1411 + update = BIT(dev->cpu_port); 1412 + break; 1413 + case 4: 1414 + case 5: 1415 + case 7: 1416 + /* Skip the host port. */ 1417 + update = dev->port_mask & ~BIT(dev->cpu_port); 1418 + break; 1419 + default: 1420 + update = ports; 1421 + break; 1422 + } 1423 + if (update != ports || override) { 1424 + data &= ~dev->port_mask; 1425 + data |= update; 1426 + /* Set Override bit to receive frame even when port is 1427 + * closed. 1428 + */ 1429 + if (override) 1430 + data |= ALU_V_OVERRIDE; 1431 + ret = ksz_write32(dev, REG_SW_ALU_VAL_B, data); 1432 + if (ret < 0) 1433 + return ret; 1434 + 1435 + data = reserved_mcast_map[i] << 1436 + dev->info->shifts[ALU_STAT_INDEX]; 1437 + data |= ALU_STAT_START | 1438 + masks[ALU_STAT_DIRECT] | 1439 + masks[ALU_RESV_MCAST_ADDR] | 1440 + masks[ALU_STAT_WRITE]; 1441 + ret = ksz_write32(dev, REG_SW_ALU_STAT_CTRL__4, data); 1442 + if (ret < 0) 1443 + return ret; 1444 + 1445 + /* wait to be finished */ 1446 + ret = ksz9477_wait_alu_sta_ready(dev); 1447 + if (ret < 0) 1448 + return ret; 1449 + } 1392 1450 } 1393 1451 1394 1452 return 0;
+1 -2
drivers/net/dsa/microchip/ksz9477_reg.h
··· 2 2 /* 3 3 * Microchip KSZ9477 register definitions 4 4 * 5 - * Copyright (C) 2017-2024 Microchip Technology Inc. 5 + * Copyright (C) 2017-2025 Microchip Technology Inc. 6 6 */ 7 7 8 8 #ifndef __KSZ9477_REGS_H ··· 397 397 398 398 #define ALU_RESV_MCAST_INDEX_M (BIT(6) - 1) 399 399 #define ALU_STAT_START BIT(7) 400 - #define ALU_RESV_MCAST_ADDR BIT(1) 401 400 402 401 #define REG_SW_ALU_VAL_A 0x0420 403 402
+4
drivers/net/dsa/microchip/ksz_common.c
··· 808 808 static const u32 ksz9477_masks[] = { 809 809 [ALU_STAT_WRITE] = 0, 810 810 [ALU_STAT_READ] = 1, 811 + [ALU_STAT_DIRECT] = 0, 812 + [ALU_RESV_MCAST_ADDR] = BIT(1), 811 813 [P_MII_TX_FLOW_CTRL] = BIT(5), 812 814 [P_MII_RX_FLOW_CTRL] = BIT(3), 813 815 }; ··· 837 835 static const u32 lan937x_masks[] = { 838 836 [ALU_STAT_WRITE] = 1, 839 837 [ALU_STAT_READ] = 2, 838 + [ALU_STAT_DIRECT] = BIT(3), 839 + [ALU_RESV_MCAST_ADDR] = BIT(2), 840 840 [P_MII_TX_FLOW_CTRL] = BIT(5), 841 841 [P_MII_RX_FLOW_CTRL] = BIT(3), 842 842 };
+2
drivers/net/dsa/microchip/ksz_common.h
··· 294 294 DYNAMIC_MAC_TABLE_TIMESTAMP, 295 295 ALU_STAT_WRITE, 296 296 ALU_STAT_READ, 297 + ALU_STAT_DIRECT, 298 + ALU_RESV_MCAST_ADDR, 297 299 P_MII_TX_FLOW_CTRL, 298 300 P_MII_RX_FLOW_CTRL, 299 301 };
+5 -1
drivers/net/ethernet/broadcom/bnxt/bnxt.c
··· 12439 12439 return -ENODEV; 12440 12440 } 12441 12441 12442 - static void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset) 12442 + void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset) 12443 12443 { 12444 12444 struct bnxt_hw_resc *hw_resc = &bp->hw_resc; 12445 12445 ··· 16892 16892 if (netif_running(dev)) 16893 16893 netif_close(dev); 16894 16894 16895 + if (bnxt_hwrm_func_drv_unrgtr(bp)) { 16896 + pcie_flr(pdev); 16897 + goto shutdown_exit; 16898 + } 16895 16899 bnxt_ptp_clear(bp); 16896 16900 bnxt_clear_int_mode(bp); 16897 16901 pci_disable_device(pdev);
+2 -1
drivers/net/ethernet/broadcom/bnxt/bnxt.h
··· 2149 2149 static inline void bnxt_bs_trace_check_wrap(struct bnxt_bs_trace_info *bs_trace, 2150 2150 u32 offset) 2151 2151 { 2152 - if (!bs_trace->wrapped && 2152 + if (!bs_trace->wrapped && bs_trace->magic_byte && 2153 2153 *bs_trace->magic_byte != BNXT_TRACE_BUF_MAGIC_BYTE) 2154 2154 bs_trace->wrapped = 1; 2155 2155 bs_trace->last_offset = offset; ··· 2941 2941 int bnxt_update_link(struct bnxt *bp, bool chng_link_state); 2942 2942 int bnxt_hwrm_set_pause(struct bnxt *); 2943 2943 int bnxt_hwrm_set_link_setting(struct bnxt *, bool, bool); 2944 + void bnxt_clear_reservations(struct bnxt *bp, bool fw_reset); 2944 2945 int bnxt_cancel_reservations(struct bnxt *bp, bool fw_reset); 2945 2946 int bnxt_hwrm_alloc_wol_fltr(struct bnxt *bp); 2946 2947 int bnxt_hwrm_free_wol_fltr(struct bnxt *bp);
+3 -2
drivers/net/ethernet/broadcom/bnxt/bnxt_coredump.c
··· 333 333 u32 offset = 0; 334 334 int rc = 0; 335 335 336 + record->max_entries = cpu_to_le32(ctxm->max_entries); 337 + record->entry_size = cpu_to_le32(ctxm->entry_size); 338 + 336 339 rc = bnxt_dbg_hwrm_log_buffer_flush(bp, type, 0, &offset); 337 340 if (rc) 338 341 return; 339 342 340 343 bnxt_bs_trace_check_wrap(bs_trace, offset); 341 - record->max_entries = cpu_to_le32(ctxm->max_entries); 342 - record->entry_size = cpu_to_le32(ctxm->entry_size); 343 344 record->offset = cpu_to_le32(bs_trace->last_offset); 344 345 record->wrapped = bs_trace->wrapped; 345 346 }
+1 -1
drivers/net/ethernet/broadcom/bnxt/bnxt_devlink.c
··· 461 461 rtnl_unlock(); 462 462 break; 463 463 } 464 - bnxt_cancel_reservations(bp, false); 464 + bnxt_clear_reservations(bp, false); 465 465 bnxt_free_ctx_mem(bp, false); 466 466 break; 467 467 }
+2 -2
drivers/net/ethernet/broadcom/bnxt/bnxt_ptp.c
··· 1052 1052 if (ptp->ptp_clock) { 1053 1053 ptp_clock_unregister(ptp->ptp_clock); 1054 1054 ptp->ptp_clock = NULL; 1055 - kfree(ptp->ptp_info.pin_config); 1056 - ptp->ptp_info.pin_config = NULL; 1057 1055 } 1056 + kfree(ptp->ptp_info.pin_config); 1057 + ptp->ptp_info.pin_config = NULL; 1058 1058 } 1059 1059 1060 1060 int bnxt_ptp_init(struct bnxt *bp)
+15
drivers/net/ethernet/google/gve/gve_ptp.c
··· 26 26 return 0; 27 27 } 28 28 29 + static int gve_ptp_gettimex64(struct ptp_clock_info *info, 30 + struct timespec64 *ts, 31 + struct ptp_system_timestamp *sts) 32 + { 33 + return -EOPNOTSUPP; 34 + } 35 + 36 + static int gve_ptp_settime64(struct ptp_clock_info *info, 37 + const struct timespec64 *ts) 38 + { 39 + return -EOPNOTSUPP; 40 + } 41 + 29 42 static long gve_ptp_do_aux_work(struct ptp_clock_info *info) 30 43 { 31 44 const struct gve_ptp *ptp = container_of(info, struct gve_ptp, info); ··· 60 47 static const struct ptp_clock_info gve_ptp_caps = { 61 48 .owner = THIS_MODULE, 62 49 .name = "gve clock", 50 + .gettimex64 = gve_ptp_gettimex64, 51 + .settime64 = gve_ptp_settime64, 63 52 .do_aux_work = gve_ptp_do_aux_work, 64 53 }; 65 54
+2 -2
drivers/net/ethernet/intel/Kconfig
··· 146 146 tristate "Intel(R) 10GbE PCI Express adapters support" 147 147 depends on PCI 148 148 depends on PTP_1588_CLOCK_OPTIONAL 149 - select LIBIE_FWLOG 149 + select LIBIE_FWLOG if DEBUG_FS 150 150 select MDIO 151 151 select NET_DEVLINK 152 152 select PLDMFW ··· 299 299 select LIBETH_XDP 300 300 select LIBIE 301 301 select LIBIE_ADMINQ 302 - select LIBIE_FWLOG 302 + select LIBIE_FWLOG if DEBUG_FS 303 303 select NET_DEVLINK 304 304 select PACKING 305 305 select PLDMFW
-2
drivers/net/ethernet/intel/ixgbe/ixgbe.h
··· 821 821 #ifdef CONFIG_IXGBE_HWMON 822 822 struct hwmon_buff *ixgbe_hwmon_buff; 823 823 #endif /* CONFIG_IXGBE_HWMON */ 824 - #ifdef CONFIG_DEBUG_FS 825 824 struct dentry *ixgbe_dbg_adapter; 826 - #endif /*CONFIG_DEBUG_FS*/ 827 825 828 826 u8 default_up; 829 827 /* Bitmask indicating in use pools */
+2 -4
drivers/net/ethernet/marvell/octeontx2/nic/otx2_common.c
··· 1530 1530 pool->xdp_cnt = numptrs; 1531 1531 pool->xdp = devm_kcalloc(pfvf->dev, 1532 1532 numptrs, sizeof(struct xdp_buff *), GFP_KERNEL); 1533 - if (IS_ERR(pool->xdp)) { 1534 - netdev_err(pfvf->netdev, "Creation of xsk pool failed\n"); 1535 - return PTR_ERR(pool->xdp); 1536 - } 1533 + if (!pool->xdp) 1534 + return -ENOMEM; 1537 1535 } 1538 1536 1539 1537 return 0;
+3
drivers/net/ethernet/mellanox/mlx5/core/en.h
··· 634 634 struct mlx5e_shampo_hd { 635 635 struct mlx5e_frag_page *pages; 636 636 u32 hd_per_wq; 637 + u32 hd_per_page; 637 638 u16 hd_per_wqe; 639 + u8 log_hd_per_page; 640 + u8 log_hd_entry_size; 638 641 unsigned long *bitmap; 639 642 u16 pi; 640 643 u16 ci;
+1 -3
drivers/net/ethernet/mellanox/mlx5/core/en_ethtool.c
··· 2125 2125 if (!size_read) 2126 2126 return i; 2127 2127 2128 - if (size_read == -EINVAL) 2129 - return -EINVAL; 2130 2128 if (size_read < 0) { 2131 2129 NL_SET_ERR_MSG_FMT_MOD( 2132 2130 extack, 2133 2131 "Query module eeprom by page failed, read %u bytes, err %d", 2134 2132 i, size_read); 2135 - return i; 2133 + return size_read; 2136 2134 } 2137 2135 2138 2136 i += size_read;
+19 -5
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 791 791 int node) 792 792 { 793 793 void *wqc = MLX5_ADDR_OF(rqc, rqp->rqc, wq); 794 + u8 log_hd_per_page, log_hd_entry_size; 795 + u16 hd_per_wq, hd_per_wqe; 794 796 u32 hd_pool_size; 795 - u16 hd_per_wq; 796 797 int wq_size; 797 798 int err; 798 799 ··· 816 815 if (err) 817 816 goto err_umr_mkey; 818 817 819 - rq->mpwqe.shampo->hd_per_wqe = 820 - mlx5e_shampo_hd_per_wqe(mdev, params, rqp); 818 + hd_per_wqe = mlx5e_shampo_hd_per_wqe(mdev, params, rqp); 821 819 wq_size = BIT(MLX5_GET(wq, wqc, log_wq_sz)); 822 - hd_pool_size = (rq->mpwqe.shampo->hd_per_wqe * wq_size) / 823 - MLX5E_SHAMPO_WQ_HEADER_PER_PAGE; 820 + 821 + BUILD_BUG_ON(MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE > PAGE_SHIFT); 822 + if (hd_per_wqe >= MLX5E_SHAMPO_WQ_HEADER_PER_PAGE) { 823 + log_hd_per_page = MLX5E_SHAMPO_LOG_WQ_HEADER_PER_PAGE; 824 + log_hd_entry_size = MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE; 825 + } else { 826 + log_hd_per_page = order_base_2(hd_per_wqe); 827 + log_hd_entry_size = order_base_2(PAGE_SIZE / hd_per_wqe); 828 + } 829 + 830 + rq->mpwqe.shampo->hd_per_wqe = hd_per_wqe; 831 + rq->mpwqe.shampo->hd_per_page = BIT(log_hd_per_page); 832 + rq->mpwqe.shampo->log_hd_per_page = log_hd_per_page; 833 + rq->mpwqe.shampo->log_hd_entry_size = log_hd_entry_size; 834 + 835 + hd_pool_size = (hd_per_wqe * wq_size) >> log_hd_per_page; 824 836 825 837 if (netif_rxq_has_unreadable_mp(rq->netdev, rq->ix)) { 826 838 /* Separate page pool for shampo headers */
+39 -33
drivers/net/ethernet/mellanox/mlx5/core/en_rx.c
··· 648 648 umr_wqe->hdr.uctrl.mkey_mask = cpu_to_be64(MLX5_MKEY_MASK_FREE); 649 649 } 650 650 651 - static struct mlx5e_frag_page *mlx5e_shampo_hd_to_frag_page(struct mlx5e_rq *rq, int header_index) 651 + static struct mlx5e_frag_page *mlx5e_shampo_hd_to_frag_page(struct mlx5e_rq *rq, 652 + int header_index) 652 653 { 653 - BUILD_BUG_ON(MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE > PAGE_SHIFT); 654 + struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; 654 655 655 - return &rq->mpwqe.shampo->pages[header_index >> MLX5E_SHAMPO_LOG_WQ_HEADER_PER_PAGE]; 656 + return &shampo->pages[header_index >> shampo->log_hd_per_page]; 656 657 } 657 658 658 - static u64 mlx5e_shampo_hd_offset(int header_index) 659 + static u64 mlx5e_shampo_hd_offset(struct mlx5e_rq *rq, int header_index) 659 660 { 660 - return (header_index & (MLX5E_SHAMPO_WQ_HEADER_PER_PAGE - 1)) << 661 - MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE; 661 + struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; 662 + u32 hd_per_page = shampo->hd_per_page; 663 + 664 + return (header_index & (hd_per_page - 1)) << shampo->log_hd_entry_size; 662 665 } 663 666 664 667 static void mlx5e_free_rx_shampo_hd_entry(struct mlx5e_rq *rq, u16 header_index); ··· 674 671 u16 pi, header_offset, err, wqe_bbs; 675 672 u32 lkey = rq->mdev->mlx5e_res.hw_objs.mkey; 676 673 struct mlx5e_umr_wqe *umr_wqe; 677 - int headroom, i = 0; 674 + int headroom, i; 678 675 679 676 headroom = rq->buff.headroom; 680 677 wqe_bbs = MLX5E_KSM_UMR_WQEBBS(ksm_entries); ··· 682 679 umr_wqe = mlx5_wq_cyc_get_wqe(&sq->wq, pi); 683 680 build_ksm_umr(sq, umr_wqe, shampo->mkey_be, index, ksm_entries); 684 681 685 - WARN_ON_ONCE(ksm_entries & (MLX5E_SHAMPO_WQ_HEADER_PER_PAGE - 1)); 686 - while (i < ksm_entries) { 687 - struct mlx5e_frag_page *frag_page = mlx5e_shampo_hd_to_frag_page(rq, index); 682 + for (i = 0; i < ksm_entries; i++, index++) { 683 + struct mlx5e_frag_page *frag_page; 688 684 u64 addr; 689 685 690 - err = mlx5e_page_alloc_fragmented(rq->hd_page_pool, frag_page); 691 - if (unlikely(err)) 692 - goto err_unmap; 686 + frag_page = mlx5e_shampo_hd_to_frag_page(rq, index); 687 + header_offset = mlx5e_shampo_hd_offset(rq, index); 688 + if (!header_offset) { 689 + err = mlx5e_page_alloc_fragmented(rq->hd_page_pool, 690 + frag_page); 691 + if (err) 692 + goto err_unmap; 693 + } 693 694 694 695 addr = page_pool_get_dma_addr_netmem(frag_page->netmem); 695 - 696 - for (int j = 0; j < MLX5E_SHAMPO_WQ_HEADER_PER_PAGE; j++) { 697 - header_offset = mlx5e_shampo_hd_offset(index++); 698 - 699 - umr_wqe->inline_ksms[i++] = (struct mlx5_ksm) { 700 - .key = cpu_to_be32(lkey), 701 - .va = cpu_to_be64(addr + header_offset + headroom), 702 - }; 703 - } 696 + umr_wqe->inline_ksms[i] = (struct mlx5_ksm) { 697 + .key = cpu_to_be32(lkey), 698 + .va = cpu_to_be64(addr + header_offset + headroom), 699 + }; 704 700 } 705 701 706 702 sq->db.wqe_info[pi] = (struct mlx5e_icosq_wqe_info) { ··· 715 713 return 0; 716 714 717 715 err_unmap: 718 - while (--i) { 716 + while (--i >= 0) { 719 717 --index; 720 - header_offset = mlx5e_shampo_hd_offset(index); 718 + header_offset = mlx5e_shampo_hd_offset(rq, index); 721 719 if (!header_offset) { 722 720 struct mlx5e_frag_page *frag_page = mlx5e_shampo_hd_to_frag_page(rq, index); 723 721 ··· 737 735 struct mlx5e_icosq *sq = rq->icosq; 738 736 int i, err, max_ksm_entries, len; 739 737 740 - max_ksm_entries = ALIGN_DOWN(MLX5E_MAX_KSM_PER_WQE(rq->mdev), 741 - MLX5E_SHAMPO_WQ_HEADER_PER_PAGE); 738 + max_ksm_entries = MLX5E_MAX_KSM_PER_WQE(rq->mdev); 742 739 ksm_entries = bitmap_find_window(shampo->bitmap, 743 740 shampo->hd_per_wqe, 744 741 shampo->hd_per_wq, shampo->pi); 745 - ksm_entries = ALIGN_DOWN(ksm_entries, MLX5E_SHAMPO_WQ_HEADER_PER_PAGE); 742 + ksm_entries = ALIGN_DOWN(ksm_entries, shampo->hd_per_page); 746 743 if (!ksm_entries) 747 744 return 0; 748 745 ··· 859 858 { 860 859 struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; 861 860 862 - if (((header_index + 1) & (MLX5E_SHAMPO_WQ_HEADER_PER_PAGE - 1)) == 0) { 861 + if (((header_index + 1) & (shampo->hd_per_page - 1)) == 0) { 863 862 struct mlx5e_frag_page *frag_page = mlx5e_shampo_hd_to_frag_page(rq, header_index); 864 863 865 864 mlx5e_page_release_fragmented(rq->hd_page_pool, frag_page); ··· 1226 1225 static void *mlx5e_shampo_get_packet_hd(struct mlx5e_rq *rq, u16 header_index) 1227 1226 { 1228 1227 struct mlx5e_frag_page *frag_page = mlx5e_shampo_hd_to_frag_page(rq, header_index); 1229 - u16 head_offset = mlx5e_shampo_hd_offset(header_index) + rq->buff.headroom; 1228 + u16 head_offset = mlx5e_shampo_hd_offset(rq, header_index); 1229 + void *addr = netmem_address(frag_page->netmem); 1230 1230 1231 - return netmem_address(frag_page->netmem) + head_offset; 1231 + return addr + head_offset + rq->buff.headroom; 1232 1232 } 1233 1233 1234 1234 static void mlx5e_shampo_update_ipv4_udp_hdr(struct mlx5e_rq *rq, struct iphdr *ipv4) ··· 2269 2267 struct mlx5_cqe64 *cqe, u16 header_index) 2270 2268 { 2271 2269 struct mlx5e_frag_page *frag_page = mlx5e_shampo_hd_to_frag_page(rq, header_index); 2272 - u16 head_offset = mlx5e_shampo_hd_offset(header_index); 2270 + u16 head_offset = mlx5e_shampo_hd_offset(rq, header_index); 2271 + struct mlx5e_shampo_hd *shampo = rq->mpwqe.shampo; 2273 2272 u16 head_size = cqe->shampo.header_size; 2274 2273 u16 rx_headroom = rq->buff.headroom; 2275 2274 struct sk_buff *skb = NULL; ··· 2286 2283 data = hdr + rx_headroom; 2287 2284 frag_size = MLX5_SKB_FRAG_SZ(rx_headroom + head_size); 2288 2285 2289 - if (likely(frag_size <= BIT(MLX5E_SHAMPO_LOG_MAX_HEADER_ENTRY_SIZE))) { 2286 + if (likely(frag_size <= BIT(shampo->log_hd_entry_size))) { 2290 2287 /* build SKB around header */ 2291 2288 dma_sync_single_range_for_cpu(rq->pdev, dma_addr, 0, frag_size, rq->buff.map_dir); 2292 2289 net_prefetchw(hdr); ··· 2359 2356 { 2360 2357 int nr_frags = skb_shinfo(skb)->nr_frags; 2361 2358 2362 - return PAGE_SIZE * nr_frags + data_bcnt <= GRO_LEGACY_MAX_SIZE; 2359 + if (PAGE_SIZE >= GRO_LEGACY_MAX_SIZE) 2360 + return skb->len + data_bcnt <= GRO_LEGACY_MAX_SIZE; 2361 + else 2362 + return PAGE_SIZE * nr_frags + data_bcnt <= GRO_LEGACY_MAX_SIZE; 2363 2363 } 2364 2364 2365 2365 static void mlx5e_handle_rx_cqe_mpwrq_shampo(struct mlx5e_rq *rq, struct mlx5_cqe64 *cqe)
+9 -9
drivers/net/ethernet/microchip/lan966x/lan966x_ethtool.c
··· 294 294 { 295 295 int i, j; 296 296 297 - mutex_lock(&lan966x->stats_lock); 297 + spin_lock(&lan966x->stats_lock); 298 298 299 299 for (i = 0; i < lan966x->num_phys_ports; i++) { 300 300 uint idx = i * lan966x->num_stats; ··· 310 310 } 311 311 } 312 312 313 - mutex_unlock(&lan966x->stats_lock); 313 + spin_unlock(&lan966x->stats_lock); 314 314 } 315 315 316 316 static int lan966x_get_sset_count(struct net_device *dev, int sset) ··· 365 365 366 366 idx = port->chip_port * lan966x->num_stats; 367 367 368 - mutex_lock(&lan966x->stats_lock); 368 + spin_lock(&lan966x->stats_lock); 369 369 370 370 mac_stats->FramesTransmittedOK = 371 371 lan966x->stats[idx + SYS_COUNT_TX_UC] + ··· 416 416 lan966x->stats[idx + SYS_COUNT_RX_LONG] + 417 417 lan966x->stats[idx + SYS_COUNT_RX_PMAC_LONG]; 418 418 419 - mutex_unlock(&lan966x->stats_lock); 419 + spin_unlock(&lan966x->stats_lock); 420 420 } 421 421 422 422 static const struct ethtool_rmon_hist_range lan966x_rmon_ranges[] = { ··· 442 442 443 443 idx = port->chip_port * lan966x->num_stats; 444 444 445 - mutex_lock(&lan966x->stats_lock); 445 + spin_lock(&lan966x->stats_lock); 446 446 447 447 rmon_stats->undersize_pkts = 448 448 lan966x->stats[idx + SYS_COUNT_RX_SHORT] + ··· 500 500 lan966x->stats[idx + SYS_COUNT_TX_SZ_1024_1526] + 501 501 lan966x->stats[idx + SYS_COUNT_TX_PMAC_SZ_1024_1526]; 502 502 503 - mutex_unlock(&lan966x->stats_lock); 503 + spin_unlock(&lan966x->stats_lock); 504 504 505 505 *ranges = lan966x_rmon_ranges; 506 506 } ··· 603 603 604 604 idx = port->chip_port * lan966x->num_stats; 605 605 606 - mutex_lock(&lan966x->stats_lock); 606 + spin_lock(&lan966x->stats_lock); 607 607 608 608 stats->rx_bytes = lan966x->stats[idx + SYS_COUNT_RX_OCT] + 609 609 lan966x->stats[idx + SYS_COUNT_RX_PMAC_OCT]; ··· 685 685 686 686 stats->collisions = lan966x->stats[idx + SYS_COUNT_TX_COL]; 687 687 688 - mutex_unlock(&lan966x->stats_lock); 688 + spin_unlock(&lan966x->stats_lock); 689 689 } 690 690 691 691 int lan966x_stats_init(struct lan966x *lan966x) ··· 701 701 return -ENOMEM; 702 702 703 703 /* Init stats worker */ 704 - mutex_init(&lan966x->stats_lock); 704 + spin_lock_init(&lan966x->stats_lock); 705 705 snprintf(queue_name, sizeof(queue_name), "%s-stats", 706 706 dev_name(lan966x->dev)); 707 707 lan966x->stats_queue = create_singlethread_workqueue(queue_name);
-2
drivers/net/ethernet/microchip/lan966x/lan966x_main.c
··· 1261 1261 1262 1262 cancel_delayed_work_sync(&lan966x->stats_work); 1263 1263 destroy_workqueue(lan966x->stats_queue); 1264 - mutex_destroy(&lan966x->stats_lock); 1265 1264 1266 1265 debugfs_remove_recursive(lan966x->debugfs_root); 1267 1266 ··· 1278 1279 1279 1280 cancel_delayed_work_sync(&lan966x->stats_work); 1280 1281 destroy_workqueue(lan966x->stats_queue); 1281 - mutex_destroy(&lan966x->stats_lock); 1282 1282 1283 1283 lan966x_mac_purge_entries(lan966x); 1284 1284 lan966x_mdb_deinit(lan966x);
+2 -2
drivers/net/ethernet/microchip/lan966x/lan966x_main.h
··· 295 295 const struct lan966x_stat_layout *stats_layout; 296 296 u32 num_stats; 297 297 298 - /* workqueue for reading stats */ 299 - struct mutex stats_lock; 298 + /* lock for reading stats */ 299 + spinlock_t stats_lock; 300 300 u64 *stats; 301 301 struct delayed_work stats_work; 302 302 struct workqueue_struct *stats_queue;
+4 -4
drivers/net/ethernet/microchip/lan966x/lan966x_vcap_impl.c
··· 403 403 u32 counter; 404 404 405 405 id = id & 0xff; /* counter limit */ 406 - mutex_lock(&lan966x->stats_lock); 406 + spin_lock(&lan966x->stats_lock); 407 407 lan_wr(SYS_STAT_CFG_STAT_VIEW_SET(id), lan966x, SYS_STAT_CFG); 408 408 counter = lan_rd(lan966x, SYS_CNT(LAN966X_STAT_ESDX_GRN_PKTS)) + 409 409 lan_rd(lan966x, SYS_CNT(LAN966X_STAT_ESDX_YEL_PKTS)); 410 - mutex_unlock(&lan966x->stats_lock); 410 + spin_unlock(&lan966x->stats_lock); 411 411 if (counter) 412 412 admin->cache.counter = counter; 413 413 } ··· 417 417 { 418 418 id = id & 0xff; /* counter limit */ 419 419 420 - mutex_lock(&lan966x->stats_lock); 420 + spin_lock(&lan966x->stats_lock); 421 421 lan_wr(SYS_STAT_CFG_STAT_VIEW_SET(id), lan966x, SYS_STAT_CFG); 422 422 lan_wr(0, lan966x, SYS_CNT(LAN966X_STAT_ESDX_GRN_BYTES)); 423 423 lan_wr(admin->cache.counter, lan966x, 424 424 SYS_CNT(LAN966X_STAT_ESDX_GRN_PKTS)); 425 425 lan_wr(0, lan966x, SYS_CNT(LAN966X_STAT_ESDX_YEL_BYTES)); 426 426 lan_wr(0, lan966x, SYS_CNT(LAN966X_STAT_ESDX_YEL_PKTS)); 427 - mutex_unlock(&lan966x->stats_lock); 427 + spin_unlock(&lan966x->stats_lock); 428 428 } 429 429 430 430 static void lan966x_vcap_cache_write(struct net_device *dev,
+17 -17
drivers/net/ethernet/pensando/ionic/ionic_txrx.c
··· 29 29 30 30 static inline void ionic_txq_post(struct ionic_queue *q, bool ring_dbell) 31 31 { 32 + /* Ensure TX descriptor writes reach memory before NIC reads them. 33 + * Prevents device from fetching stale descriptors. 34 + */ 35 + dma_wmb(); 32 36 ionic_q_post(q, ring_dbell); 33 37 } 34 38 ··· 1448 1444 bool encap; 1449 1445 int err; 1450 1446 1451 - desc_info = &q->tx_info[q->head_idx]; 1452 - 1453 - if (unlikely(ionic_tx_map_skb(q, skb, desc_info))) 1454 - return -EIO; 1455 - 1456 - len = skb->len; 1457 - mss = skb_shinfo(skb)->gso_size; 1458 - outer_csum = (skb_shinfo(skb)->gso_type & (SKB_GSO_GRE | 1459 - SKB_GSO_GRE_CSUM | 1460 - SKB_GSO_IPXIP4 | 1461 - SKB_GSO_IPXIP6 | 1462 - SKB_GSO_UDP_TUNNEL | 1463 - SKB_GSO_UDP_TUNNEL_CSUM)); 1464 1447 has_vlan = !!skb_vlan_tag_present(skb); 1465 1448 vlan_tci = skb_vlan_tag_get(skb); 1466 1449 encap = skb->encapsulation; ··· 1461 1470 err = ionic_tx_tcp_inner_pseudo_csum(skb); 1462 1471 else 1463 1472 err = ionic_tx_tcp_pseudo_csum(skb); 1464 - if (unlikely(err)) { 1465 - /* clean up mapping from ionic_tx_map_skb */ 1466 - ionic_tx_desc_unmap_bufs(q, desc_info); 1473 + if (unlikely(err)) 1467 1474 return err; 1468 - } 1469 1475 1476 + desc_info = &q->tx_info[q->head_idx]; 1477 + if (unlikely(ionic_tx_map_skb(q, skb, desc_info))) 1478 + return -EIO; 1479 + 1480 + len = skb->len; 1481 + mss = skb_shinfo(skb)->gso_size; 1482 + outer_csum = (skb_shinfo(skb)->gso_type & (SKB_GSO_GRE | 1483 + SKB_GSO_GRE_CSUM | 1484 + SKB_GSO_IPXIP4 | 1485 + SKB_GSO_IPXIP6 | 1486 + SKB_GSO_UDP_TUNNEL | 1487 + SKB_GSO_UDP_TUNNEL_CSUM)); 1470 1488 if (encap) 1471 1489 hdrlen = skb_inner_tcp_all_headers(skb); 1472 1490 else
+3
drivers/net/ethernet/spacemit/k1_emac.c
··· 1441 1441 struct emac_priv *priv = netdev_priv(dev); 1442 1442 u8 fc = 0; 1443 1443 1444 + if (!netif_running(dev)) 1445 + return -ENETDOWN; 1446 + 1444 1447 priv->flow_control_autoneg = pause->autoneg; 1445 1448 1446 1449 if (pause->autoneg) {
+7
drivers/net/ethernet/ti/icssg/icssg_config.c
··· 66 66 #define FDB_GEN_CFG1 0x60 67 67 #define SMEM_VLAN_OFFSET 8 68 68 #define SMEM_VLAN_OFFSET_MASK GENMASK(25, 8) 69 + #define FDB_HASH_SIZE_MASK GENMASK(6, 3) 70 + #define FDB_HASH_SIZE_SHIFT 3 71 + #define FDB_HASH_SIZE 3 69 72 70 73 #define FDB_GEN_CFG2 0x64 71 74 #define FDB_VLAN_EN BIT(6) ··· 466 463 /* Set VLAN TABLE address base */ 467 464 regmap_update_bits(prueth->miig_rt, FDB_GEN_CFG1, SMEM_VLAN_OFFSET_MASK, 468 465 addr << SMEM_VLAN_OFFSET); 466 + regmap_update_bits(prueth->miig_rt, FDB_GEN_CFG1, FDB_HASH_SIZE_MASK, 467 + FDB_HASH_SIZE << FDB_HASH_SIZE_SHIFT); 469 468 /* Set enable VLAN aware mode, and FDBs for all PRUs */ 470 469 regmap_write(prueth->miig_rt, FDB_GEN_CFG2, (FDB_PRU0_EN | FDB_PRU1_EN | FDB_HOST_EN)); 471 470 prueth->vlan_tbl = (struct prueth_vlan_tbl __force *)(prueth->shram.va + ··· 489 484 /* Set VLAN TABLE address base */ 490 485 regmap_update_bits(prueth->miig_rt, FDB_GEN_CFG1, SMEM_VLAN_OFFSET_MASK, 491 486 addr << SMEM_VLAN_OFFSET); 487 + regmap_update_bits(prueth->miig_rt, FDB_GEN_CFG1, FDB_HASH_SIZE_MASK, 488 + FDB_HASH_SIZE << FDB_HASH_SIZE_SHIFT); 492 489 /* Set enable VLAN aware mode, and FDBs for all PRUs */ 493 490 regmap_write(prueth->miig_rt, FDB_GEN_CFG2, FDB_EN_ALL); 494 491 prueth->vlan_tbl = (struct prueth_vlan_tbl __force *)(prueth->shram.va +
+5 -5
drivers/net/ethernet/ti/netcp_core.c
··· 1338 1338 1339 1339 tx_pipe->dma_channel = knav_dma_open_channel(dev, 1340 1340 tx_pipe->dma_chan_name, &config); 1341 - if (IS_ERR(tx_pipe->dma_channel)) { 1341 + if (!tx_pipe->dma_channel) { 1342 1342 dev_err(dev, "failed opening tx chan(%s)\n", 1343 1343 tx_pipe->dma_chan_name); 1344 - ret = PTR_ERR(tx_pipe->dma_channel); 1344 + ret = -EINVAL; 1345 1345 goto err; 1346 1346 } 1347 1347 ··· 1359 1359 return 0; 1360 1360 1361 1361 err: 1362 - if (!IS_ERR_OR_NULL(tx_pipe->dma_channel)) 1362 + if (tx_pipe->dma_channel) 1363 1363 knav_dma_close_channel(tx_pipe->dma_channel); 1364 1364 tx_pipe->dma_channel = NULL; 1365 1365 return ret; ··· 1678 1678 1679 1679 netcp->rx_channel = knav_dma_open_channel(netcp->netcp_device->device, 1680 1680 netcp->dma_chan_name, &config); 1681 - if (IS_ERR(netcp->rx_channel)) { 1681 + if (!netcp->rx_channel) { 1682 1682 dev_err(netcp->ndev_dev, "failed opening rx chan(%s\n", 1683 1683 netcp->dma_chan_name); 1684 - ret = PTR_ERR(netcp->rx_channel); 1684 + ret = -EINVAL; 1685 1685 goto fail; 1686 1686 } 1687 1687
+2 -1
drivers/net/ethernet/wangxun/libwx/wx_hw.c
··· 2480 2480 wx->oem_svid = pdev->subsystem_vendor; 2481 2481 wx->oem_ssid = pdev->subsystem_device; 2482 2482 wx->bus.device = PCI_SLOT(pdev->devfn); 2483 - wx->bus.func = PCI_FUNC(pdev->devfn); 2483 + wx->bus.func = FIELD_GET(WX_CFG_PORT_ST_LANID, 2484 + rd32(wx, WX_CFG_PORT_ST)); 2484 2485 2485 2486 if (wx->oem_svid == PCI_VENDOR_ID_WANGXUN || 2486 2487 pdev->is_virtfn) {
+2 -2
drivers/net/ethernet/wangxun/libwx/wx_type.h
··· 102 102 #define WX_CFG_PORT_CTL_DRV_LOAD BIT(3) 103 103 #define WX_CFG_PORT_CTL_QINQ BIT(2) 104 104 #define WX_CFG_PORT_CTL_D_VLAN BIT(0) /* double vlan*/ 105 + #define WX_CFG_PORT_ST 0x14404 106 + #define WX_CFG_PORT_ST_LANID GENMASK(9, 8) 105 107 #define WX_CFG_TAG_TPID(_i) (0x14430 + ((_i) * 4)) 106 108 #define WX_CFG_PORT_CTL_NUM_VT_MASK GENMASK(13, 12) /* number of TVs */ 107 109 ··· 565 563 /* Tx Descriptors needed, worst case */ 566 564 #define TXD_USE_COUNT(S) DIV_ROUND_UP((S), WX_MAX_DATA_PER_TXD) 567 565 #define DESC_NEEDED (MAX_SKB_FRAGS + 4) 568 - 569 - #define WX_CFG_PORT_ST 0x14404 570 566 571 567 /******************* Receive Descriptor bit definitions **********************/ 572 568 #define WX_RXD_STAT_DD BIT(0) /* Done */
+2
drivers/net/mdio/mdio-airoha.c
··· 219 219 priv = bus->priv; 220 220 priv->base_addr = addr; 221 221 priv->regmap = device_node_to_regmap(dev->parent->of_node); 222 + if (IS_ERR(priv->regmap)) 223 + return PTR_ERR(priv->regmap); 222 224 223 225 priv->clk = devm_clk_get_enabled(dev, NULL); 224 226 if (IS_ERR(priv->clk))
+10
drivers/net/netconsole.c
··· 936 936 if (count > MAX_EXTRADATA_VALUE_LEN) 937 937 return -EMSGSIZE; 938 938 939 + mutex_lock(&netconsole_subsys.su_mutex); 939 940 mutex_lock(&dynamic_netconsole_mutex); 940 941 941 942 ret = strscpy(udm->value, buf, sizeof(udm->value)); ··· 950 949 ret = count; 951 950 out_unlock: 952 951 mutex_unlock(&dynamic_netconsole_mutex); 952 + mutex_unlock(&netconsole_subsys.su_mutex); 953 953 return ret; 954 954 } 955 955 ··· 976 974 if (ret) 977 975 return ret; 978 976 977 + mutex_lock(&netconsole_subsys.su_mutex); 979 978 mutex_lock(&dynamic_netconsole_mutex); 980 979 curr = !!(nt->sysdata_fields & SYSDATA_MSGID); 981 980 if (msgid_enabled == curr) ··· 997 994 ret = strnlen(buf, count); 998 995 unlock: 999 996 mutex_unlock(&dynamic_netconsole_mutex); 997 + mutex_unlock(&netconsole_subsys.su_mutex); 1000 998 return ret; 1001 999 } 1002 1000 ··· 1012 1008 if (ret) 1013 1009 return ret; 1014 1010 1011 + mutex_lock(&netconsole_subsys.su_mutex); 1015 1012 mutex_lock(&dynamic_netconsole_mutex); 1016 1013 curr = !!(nt->sysdata_fields & SYSDATA_RELEASE); 1017 1014 if (release_enabled == curr) ··· 1033 1028 ret = strnlen(buf, count); 1034 1029 unlock: 1035 1030 mutex_unlock(&dynamic_netconsole_mutex); 1031 + mutex_unlock(&netconsole_subsys.su_mutex); 1036 1032 return ret; 1037 1033 } 1038 1034 ··· 1048 1042 if (ret) 1049 1043 return ret; 1050 1044 1045 + mutex_lock(&netconsole_subsys.su_mutex); 1051 1046 mutex_lock(&dynamic_netconsole_mutex); 1052 1047 curr = !!(nt->sysdata_fields & SYSDATA_TASKNAME); 1053 1048 if (taskname_enabled == curr) ··· 1069 1062 ret = strnlen(buf, count); 1070 1063 unlock: 1071 1064 mutex_unlock(&dynamic_netconsole_mutex); 1065 + mutex_unlock(&netconsole_subsys.su_mutex); 1072 1066 return ret; 1073 1067 } 1074 1068 ··· 1085 1077 if (ret) 1086 1078 return ret; 1087 1079 1080 + mutex_lock(&netconsole_subsys.su_mutex); 1088 1081 mutex_lock(&dynamic_netconsole_mutex); 1089 1082 curr = !!(nt->sysdata_fields & SYSDATA_CPU_NR); 1090 1083 if (cpu_nr_enabled == curr) ··· 1114 1105 ret = strnlen(buf, count); 1115 1106 unlock: 1116 1107 mutex_unlock(&dynamic_netconsole_mutex); 1108 + mutex_unlock(&netconsole_subsys.su_mutex); 1117 1109 return ret; 1118 1110 } 1119 1111
+163
drivers/net/phy/micrel.c
··· 472 472 u16 rev; 473 473 }; 474 474 475 + struct lanphy_reg_data { 476 + int page; 477 + u16 addr; 478 + u16 val; 479 + }; 480 + 475 481 static const struct kszphy_type lan8814_type = { 476 482 .led_mode_reg = ~LAN8814_LED_CTRL_1, 477 483 .cable_diag_reg = LAN8814_CABLE_DIAG, ··· 2944 2938 #define LAN8814_PAGE_PCS_DIGITAL 2 2945 2939 2946 2940 /** 2941 + * LAN8814_PAGE_EEE - Selects Extended Page 3. 2942 + * 2943 + * This page contains EEE registers 2944 + */ 2945 + #define LAN8814_PAGE_EEE 3 2946 + 2947 + /** 2947 2948 * LAN8814_PAGE_COMMON_REGS - Selects Extended Page 4. 2948 2949 * 2949 2950 * This page contains device-common registers that affect the entire chip. ··· 2967 2954 * rate adaptation FIFOs, and the per-port 1588 TSU block. 2968 2955 */ 2969 2956 #define LAN8814_PAGE_PORT_REGS 5 2957 + 2958 + /** 2959 + * LAN8814_PAGE_POWER_REGS - Selects Extended Page 28. 2960 + * 2961 + * This page contains analog control registers and power mode registers. 2962 + */ 2963 + #define LAN8814_PAGE_POWER_REGS 28 2970 2964 2971 2965 /** 2972 2966 * LAN8814_PAGE_SYSTEM_CTRL - Selects Extended Page 31. ··· 6038 6018 return 0; 6039 6019 } 6040 6020 6021 + #define LAN8814_POWER_MGMT_MODE_3_ANEG_MDI 0x13 6022 + #define LAN8814_POWER_MGMT_MODE_4_ANEG_MDIX 0x14 6023 + #define LAN8814_POWER_MGMT_MODE_5_10BT_MDI 0x15 6024 + #define LAN8814_POWER_MGMT_MODE_6_10BT_MDIX 0x16 6025 + #define LAN8814_POWER_MGMT_MODE_7_100BT_TRAIN 0x17 6026 + #define LAN8814_POWER_MGMT_MODE_8_100BT_MDI 0x18 6027 + #define LAN8814_POWER_MGMT_MODE_9_100BT_EEE_MDI_TX 0x19 6028 + #define LAN8814_POWER_MGMT_MODE_10_100BT_EEE_MDI_RX 0x1a 6029 + #define LAN8814_POWER_MGMT_MODE_11_100BT_MDIX 0x1b 6030 + #define LAN8814_POWER_MGMT_MODE_12_100BT_EEE_MDIX_TX 0x1c 6031 + #define LAN8814_POWER_MGMT_MODE_13_100BT_EEE_MDIX_RX 0x1d 6032 + #define LAN8814_POWER_MGMT_MODE_14_100BTX_EEE_TX_RX 0x1e 6033 + 6034 + #define LAN8814_POWER_MGMT_DLLPD_D BIT(0) 6035 + #define LAN8814_POWER_MGMT_ADCPD_D BIT(1) 6036 + #define LAN8814_POWER_MGMT_PGAPD_D BIT(2) 6037 + #define LAN8814_POWER_MGMT_TXPD_D BIT(3) 6038 + #define LAN8814_POWER_MGMT_DLLPD_C BIT(4) 6039 + #define LAN8814_POWER_MGMT_ADCPD_C BIT(5) 6040 + #define LAN8814_POWER_MGMT_PGAPD_C BIT(6) 6041 + #define LAN8814_POWER_MGMT_TXPD_C BIT(7) 6042 + #define LAN8814_POWER_MGMT_DLLPD_B BIT(8) 6043 + #define LAN8814_POWER_MGMT_ADCPD_B BIT(9) 6044 + #define LAN8814_POWER_MGMT_PGAPD_B BIT(10) 6045 + #define LAN8814_POWER_MGMT_TXPD_B BIT(11) 6046 + #define LAN8814_POWER_MGMT_DLLPD_A BIT(12) 6047 + #define LAN8814_POWER_MGMT_ADCPD_A BIT(13) 6048 + #define LAN8814_POWER_MGMT_PGAPD_A BIT(14) 6049 + #define LAN8814_POWER_MGMT_TXPD_A BIT(15) 6050 + 6051 + #define LAN8814_POWER_MGMT_C_D (LAN8814_POWER_MGMT_DLLPD_D | \ 6052 + LAN8814_POWER_MGMT_ADCPD_D | \ 6053 + LAN8814_POWER_MGMT_PGAPD_D | \ 6054 + LAN8814_POWER_MGMT_DLLPD_C | \ 6055 + LAN8814_POWER_MGMT_ADCPD_C | \ 6056 + LAN8814_POWER_MGMT_PGAPD_C) 6057 + 6058 + #define LAN8814_POWER_MGMT_B_C_D (LAN8814_POWER_MGMT_C_D | \ 6059 + LAN8814_POWER_MGMT_DLLPD_B | \ 6060 + LAN8814_POWER_MGMT_ADCPD_B | \ 6061 + LAN8814_POWER_MGMT_PGAPD_B) 6062 + 6063 + #define LAN8814_POWER_MGMT_VAL1 (LAN8814_POWER_MGMT_C_D | \ 6064 + LAN8814_POWER_MGMT_ADCPD_B | \ 6065 + LAN8814_POWER_MGMT_PGAPD_B | \ 6066 + LAN8814_POWER_MGMT_ADCPD_A | \ 6067 + LAN8814_POWER_MGMT_PGAPD_A) 6068 + 6069 + #define LAN8814_POWER_MGMT_VAL2 LAN8814_POWER_MGMT_C_D 6070 + 6071 + #define LAN8814_POWER_MGMT_VAL3 (LAN8814_POWER_MGMT_C_D | \ 6072 + LAN8814_POWER_MGMT_DLLPD_B | \ 6073 + LAN8814_POWER_MGMT_ADCPD_B | \ 6074 + LAN8814_POWER_MGMT_PGAPD_A) 6075 + 6076 + #define LAN8814_POWER_MGMT_VAL4 (LAN8814_POWER_MGMT_B_C_D | \ 6077 + LAN8814_POWER_MGMT_ADCPD_A | \ 6078 + LAN8814_POWER_MGMT_PGAPD_A) 6079 + 6080 + #define LAN8814_POWER_MGMT_VAL5 LAN8814_POWER_MGMT_B_C_D 6081 + 6082 + #define LAN8814_EEE_WAKE_TX_TIMER 0x0e 6083 + #define LAN8814_EEE_WAKE_TX_TIMER_MAX_VAL 0x1f 6084 + 6085 + static const struct lanphy_reg_data short_center_tap_errata[] = { 6086 + { LAN8814_PAGE_POWER_REGS, 6087 + LAN8814_POWER_MGMT_MODE_3_ANEG_MDI, 6088 + LAN8814_POWER_MGMT_VAL1 }, 6089 + { LAN8814_PAGE_POWER_REGS, 6090 + LAN8814_POWER_MGMT_MODE_4_ANEG_MDIX, 6091 + LAN8814_POWER_MGMT_VAL1 }, 6092 + { LAN8814_PAGE_POWER_REGS, 6093 + LAN8814_POWER_MGMT_MODE_5_10BT_MDI, 6094 + LAN8814_POWER_MGMT_VAL1 }, 6095 + { LAN8814_PAGE_POWER_REGS, 6096 + LAN8814_POWER_MGMT_MODE_6_10BT_MDIX, 6097 + LAN8814_POWER_MGMT_VAL1 }, 6098 + { LAN8814_PAGE_POWER_REGS, 6099 + LAN8814_POWER_MGMT_MODE_7_100BT_TRAIN, 6100 + LAN8814_POWER_MGMT_VAL2 }, 6101 + { LAN8814_PAGE_POWER_REGS, 6102 + LAN8814_POWER_MGMT_MODE_8_100BT_MDI, 6103 + LAN8814_POWER_MGMT_VAL3 }, 6104 + { LAN8814_PAGE_POWER_REGS, 6105 + LAN8814_POWER_MGMT_MODE_9_100BT_EEE_MDI_TX, 6106 + LAN8814_POWER_MGMT_VAL3 }, 6107 + { LAN8814_PAGE_POWER_REGS, 6108 + LAN8814_POWER_MGMT_MODE_10_100BT_EEE_MDI_RX, 6109 + LAN8814_POWER_MGMT_VAL4 }, 6110 + { LAN8814_PAGE_POWER_REGS, 6111 + LAN8814_POWER_MGMT_MODE_11_100BT_MDIX, 6112 + LAN8814_POWER_MGMT_VAL5 }, 6113 + { LAN8814_PAGE_POWER_REGS, 6114 + LAN8814_POWER_MGMT_MODE_12_100BT_EEE_MDIX_TX, 6115 + LAN8814_POWER_MGMT_VAL5 }, 6116 + { LAN8814_PAGE_POWER_REGS, 6117 + LAN8814_POWER_MGMT_MODE_13_100BT_EEE_MDIX_RX, 6118 + LAN8814_POWER_MGMT_VAL4 }, 6119 + { LAN8814_PAGE_POWER_REGS, 6120 + LAN8814_POWER_MGMT_MODE_14_100BTX_EEE_TX_RX, 6121 + LAN8814_POWER_MGMT_VAL4 }, 6122 + }; 6123 + 6124 + static const struct lanphy_reg_data waketx_timer_errata[] = { 6125 + { LAN8814_PAGE_EEE, 6126 + LAN8814_EEE_WAKE_TX_TIMER, 6127 + LAN8814_EEE_WAKE_TX_TIMER_MAX_VAL }, 6128 + }; 6129 + 6130 + static int lanphy_write_reg_data(struct phy_device *phydev, 6131 + const struct lanphy_reg_data *data, 6132 + size_t num) 6133 + { 6134 + int ret = 0; 6135 + 6136 + while (num--) { 6137 + ret = lanphy_write_page_reg(phydev, data->page, data->addr, 6138 + data->val); 6139 + if (ret) 6140 + break; 6141 + } 6142 + 6143 + return ret; 6144 + } 6145 + 6146 + static int lan8842_erratas(struct phy_device *phydev) 6147 + { 6148 + int ret; 6149 + 6150 + ret = lanphy_write_reg_data(phydev, short_center_tap_errata, 6151 + ARRAY_SIZE(short_center_tap_errata)); 6152 + if (ret) 6153 + return ret; 6154 + 6155 + return lanphy_write_reg_data(phydev, waketx_timer_errata, 6156 + ARRAY_SIZE(waketx_timer_errata)); 6157 + } 6158 + 6041 6159 static int lan8842_config_init(struct phy_device *phydev) 6042 6160 { 6043 6161 int ret; ··· 6185 6027 LAN8814_QSGMII_SOFT_RESET, 6186 6028 LAN8814_QSGMII_SOFT_RESET_BIT, 6187 6029 LAN8814_QSGMII_SOFT_RESET_BIT); 6030 + if (ret < 0) 6031 + return ret; 6032 + 6033 + /* Apply the erratas for this device */ 6034 + ret = lan8842_erratas(phydev); 6188 6035 if (ret < 0) 6189 6036 return ret; 6190 6037
+6
drivers/net/usb/qmi_wwan.c
··· 192 192 if (!skbn) 193 193 return 0; 194 194 195 + /* Raw IP packets don't have a MAC header, but other subsystems 196 + * (like xfrm) may still access MAC header offsets, so they must 197 + * be initialized. 198 + */ 199 + skb_reset_mac_header(skbn); 200 + 195 201 switch (skb->data[offset + qmimux_hdr_sz] & 0xf0) { 196 202 case 0x40: 197 203 skbn->protocol = htons(ETH_P_IP);
+25 -15
drivers/net/virtio_net.c
··· 910 910 goto ok; 911 911 } 912 912 913 - /* 914 - * Verify that we can indeed put this data into a skb. 915 - * This is here to handle cases when the device erroneously 916 - * tries to receive more than is possible. This is usually 917 - * the case of a broken device. 918 - */ 919 - if (unlikely(len > MAX_SKB_FRAGS * PAGE_SIZE)) { 920 - net_dbg_ratelimited("%s: too much data\n", skb->dev->name); 921 - dev_kfree_skb(skb); 922 - return NULL; 923 - } 924 913 BUG_ON(offset >= PAGE_SIZE); 925 914 while (len) { 926 915 unsigned int frag_size = min((unsigned)PAGE_SIZE - offset, len); ··· 2101 2112 struct virtnet_rq_stats *stats) 2102 2113 { 2103 2114 struct page *page = buf; 2104 - struct sk_buff *skb = 2105 - page_to_skb(vi, rq, page, 0, len, PAGE_SIZE, 0); 2115 + struct sk_buff *skb; 2106 2116 2117 + /* Make sure that len does not exceed the size allocated in 2118 + * add_recvbuf_big. 2119 + */ 2120 + if (unlikely(len > (vi->big_packets_num_skbfrags + 1) * PAGE_SIZE)) { 2121 + pr_debug("%s: rx error: len %u exceeds allocated size %lu\n", 2122 + dev->name, len, 2123 + (vi->big_packets_num_skbfrags + 1) * PAGE_SIZE); 2124 + goto err; 2125 + } 2126 + 2127 + skb = page_to_skb(vi, rq, page, 0, len, PAGE_SIZE, 0); 2107 2128 u64_stats_add(&stats->bytes, len - vi->hdr_len); 2108 2129 if (unlikely(!skb)) 2109 2130 goto err; ··· 2538 2539 return NULL; 2539 2540 } 2540 2541 2542 + static inline u32 2543 + virtio_net_hash_value(const struct virtio_net_hdr_v1_hash *hdr_hash) 2544 + { 2545 + return __le16_to_cpu(hdr_hash->hash_value_lo) | 2546 + (__le16_to_cpu(hdr_hash->hash_value_hi) << 16); 2547 + } 2548 + 2541 2549 static void virtio_skb_set_hash(const struct virtio_net_hdr_v1_hash *hdr_hash, 2542 2550 struct sk_buff *skb) 2543 2551 { ··· 2571 2565 default: 2572 2566 rss_hash_type = PKT_HASH_TYPE_NONE; 2573 2567 } 2574 - skb_set_hash(skb, __le32_to_cpu(hdr_hash->hash_value), rss_hash_type); 2568 + skb_set_hash(skb, virtio_net_hash_value(hdr_hash), rss_hash_type); 2575 2569 } 2576 2570 2577 2571 static void virtnet_receive_done(struct virtnet_info *vi, struct receive_queue *rq, ··· 3316 3310 bool can_push; 3317 3311 3318 3312 pr_debug("%s: xmit %p %pM\n", vi->dev->name, skb, dest); 3313 + 3314 + /* Make sure it's safe to cast between formats */ 3315 + BUILD_BUG_ON(__alignof__(*hdr) != __alignof__(hdr->hash_hdr)); 3316 + BUILD_BUG_ON(__alignof__(*hdr) != __alignof__(hdr->hash_hdr.hdr)); 3319 3317 3320 3318 can_push = vi->any_header_sg && 3321 3319 !((unsigned long)skb->data & (__alignof__(*hdr) - 1)) && ··· 6760 6750 hash_report = VIRTIO_NET_HASH_REPORT_NONE; 6761 6751 6762 6752 *rss_type = virtnet_xdp_rss_type[hash_report]; 6763 - *hash = __le32_to_cpu(hdr_hash->hash_value); 6753 + *hash = virtio_net_hash_value(hdr_hash); 6764 6754 return 0; 6765 6755 } 6766 6756
+4 -3
drivers/net/wan/framer/pef2256/pef2256.c
··· 648 648 audio_devs[i].id = i; 649 649 } 650 650 651 - ret = mfd_add_devices(pef2256->dev, 0, audio_devs, count, NULL, 0, NULL); 651 + ret = devm_mfd_add_devices(pef2256->dev, 0, audio_devs, count, 652 + NULL, 0, NULL); 652 653 kfree(audio_devs); 653 654 return ret; 654 655 } ··· 823 822 824 823 platform_set_drvdata(pdev, pef2256); 825 824 826 - ret = mfd_add_devices(pef2256->dev, 0, pef2256_devs, 827 - ARRAY_SIZE(pef2256_devs), NULL, 0, NULL); 825 + ret = devm_mfd_add_devices(pef2256->dev, 0, pef2256_devs, 826 + ARRAY_SIZE(pef2256_devs), NULL, 0, NULL); 828 827 if (ret) { 829 828 dev_err(pef2256->dev, "add devices failed (%d)\n", ret); 830 829 return ret;
+20 -19
drivers/net/wireless/ath/ath10k/wmi.c
··· 1764 1764 1765 1765 int ath10k_wmi_wait_for_service_ready(struct ath10k *ar) 1766 1766 { 1767 - unsigned long timeout = jiffies + WMI_SERVICE_READY_TIMEOUT_HZ; 1768 1767 unsigned long time_left, i; 1769 1768 1770 - /* Sometimes the PCI HIF doesn't receive interrupt 1771 - * for the service ready message even if the buffer 1772 - * was completed. PCIe sniffer shows that it's 1773 - * because the corresponding CE ring doesn't fires 1774 - * it. Workaround here by polling CE rings. Since 1775 - * the message could arrive at any time, continue 1776 - * polling until timeout. 1777 - */ 1778 - do { 1769 + time_left = wait_for_completion_timeout(&ar->wmi.service_ready, 1770 + WMI_SERVICE_READY_TIMEOUT_HZ); 1771 + if (!time_left) { 1772 + /* Sometimes the PCI HIF doesn't receive interrupt 1773 + * for the service ready message even if the buffer 1774 + * was completed. PCIe sniffer shows that it's 1775 + * because the corresponding CE ring doesn't fires 1776 + * it. Workaround here by polling CE rings once. 1777 + */ 1778 + ath10k_warn(ar, "failed to receive service ready completion, polling..\n"); 1779 + 1779 1780 for (i = 0; i < CE_COUNT; i++) 1780 1781 ath10k_hif_send_complete_check(ar, i, 1); 1781 1782 1782 - /* The 100 ms granularity is a tradeoff considering scheduler 1783 - * overhead and response latency 1784 - */ 1785 1783 time_left = wait_for_completion_timeout(&ar->wmi.service_ready, 1786 - msecs_to_jiffies(100)); 1787 - if (time_left) 1788 - return 0; 1789 - } while (time_before(jiffies, timeout)); 1784 + WMI_SERVICE_READY_TIMEOUT_HZ); 1785 + if (!time_left) { 1786 + ath10k_warn(ar, "polling timed out\n"); 1787 + return -ETIMEDOUT; 1788 + } 1790 1789 1791 - ath10k_warn(ar, "failed to receive service ready completion\n"); 1792 - return -ETIMEDOUT; 1790 + ath10k_warn(ar, "service ready completion received, continuing normally\n"); 1791 + } 1792 + 1793 + return 0; 1793 1794 } 1794 1795 1795 1796 int ath10k_wmi_wait_for_unified_ready(struct ath10k *ar)
+55 -67
drivers/net/wireless/ath/ath12k/mac.c
··· 4235 4235 return ret; 4236 4236 } 4237 4237 4238 - static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif) 4239 - { 4240 - struct ath12k *ar = arvif->ar; 4241 - struct ieee80211_vif *vif = arvif->ahvif->vif; 4242 - struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf; 4243 - enum wmi_sta_powersave_param param; 4244 - struct ieee80211_bss_conf *info; 4245 - enum wmi_sta_ps_mode psmode; 4246 - int ret; 4247 - int timeout; 4248 - bool enable_ps; 4249 - 4250 - lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); 4251 - 4252 - if (vif->type != NL80211_IFTYPE_STATION) 4253 - return; 4254 - 4255 - enable_ps = arvif->ahvif->ps; 4256 - if (enable_ps) { 4257 - psmode = WMI_STA_PS_MODE_ENABLED; 4258 - param = WMI_STA_PS_PARAM_INACTIVITY_TIME; 4259 - 4260 - timeout = conf->dynamic_ps_timeout; 4261 - if (timeout == 0) { 4262 - info = ath12k_mac_get_link_bss_conf(arvif); 4263 - if (!info) { 4264 - ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n", 4265 - vif->addr, arvif->link_id); 4266 - return; 4267 - } 4268 - 4269 - /* firmware doesn't like 0 */ 4270 - timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000; 4271 - } 4272 - 4273 - ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, 4274 - timeout); 4275 - if (ret) { 4276 - ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n", 4277 - arvif->vdev_id, ret); 4278 - return; 4279 - } 4280 - } else { 4281 - psmode = WMI_STA_PS_MODE_DISABLED; 4282 - } 4283 - 4284 - ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n", 4285 - arvif->vdev_id, psmode ? "enable" : "disable"); 4286 - 4287 - ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode); 4288 - if (ret) 4289 - ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n", 4290 - psmode, arvif->vdev_id, ret); 4291 - } 4292 - 4293 4238 static void ath12k_mac_op_vif_cfg_changed(struct ieee80211_hw *hw, 4294 4239 struct ieee80211_vif *vif, 4295 4240 u64 changed) 4296 4241 { 4297 4242 struct ath12k_vif *ahvif = ath12k_vif_to_ahvif(vif); 4298 4243 unsigned long links = ahvif->links_map; 4299 - struct ieee80211_vif_cfg *vif_cfg; 4300 4244 struct ieee80211_bss_conf *info; 4301 4245 struct ath12k_link_vif *arvif; 4302 4246 struct ieee80211_sta *sta; ··· 4304 4360 } 4305 4361 } 4306 4362 } 4363 + } 4307 4364 4308 - if (changed & BSS_CHANGED_PS) { 4309 - links = ahvif->links_map; 4310 - vif_cfg = &vif->cfg; 4365 + static void ath12k_mac_vif_setup_ps(struct ath12k_link_vif *arvif) 4366 + { 4367 + struct ath12k *ar = arvif->ar; 4368 + struct ieee80211_vif *vif = arvif->ahvif->vif; 4369 + struct ieee80211_conf *conf = &ath12k_ar_to_hw(ar)->conf; 4370 + enum wmi_sta_powersave_param param; 4371 + struct ieee80211_bss_conf *info; 4372 + enum wmi_sta_ps_mode psmode; 4373 + int ret; 4374 + int timeout; 4375 + bool enable_ps; 4311 4376 4312 - for_each_set_bit(link_id, &links, IEEE80211_MLD_MAX_NUM_LINKS) { 4313 - arvif = wiphy_dereference(hw->wiphy, ahvif->link[link_id]); 4314 - if (!arvif || !arvif->ar) 4315 - continue; 4377 + lockdep_assert_wiphy(ath12k_ar_to_hw(ar)->wiphy); 4316 4378 4317 - ar = arvif->ar; 4379 + if (vif->type != NL80211_IFTYPE_STATION) 4380 + return; 4318 4381 4319 - if (ar->ab->hw_params->supports_sta_ps) { 4320 - ahvif->ps = vif_cfg->ps; 4321 - ath12k_mac_vif_setup_ps(arvif); 4382 + enable_ps = arvif->ahvif->ps; 4383 + if (enable_ps) { 4384 + psmode = WMI_STA_PS_MODE_ENABLED; 4385 + param = WMI_STA_PS_PARAM_INACTIVITY_TIME; 4386 + 4387 + timeout = conf->dynamic_ps_timeout; 4388 + if (timeout == 0) { 4389 + info = ath12k_mac_get_link_bss_conf(arvif); 4390 + if (!info) { 4391 + ath12k_warn(ar->ab, "unable to access bss link conf in setup ps for vif %pM link %u\n", 4392 + vif->addr, arvif->link_id); 4393 + return; 4322 4394 } 4395 + 4396 + /* firmware doesn't like 0 */ 4397 + timeout = ieee80211_tu_to_usec(info->beacon_int) / 1000; 4323 4398 } 4399 + 4400 + ret = ath12k_wmi_set_sta_ps_param(ar, arvif->vdev_id, param, 4401 + timeout); 4402 + if (ret) { 4403 + ath12k_warn(ar->ab, "failed to set inactivity time for vdev %d: %i\n", 4404 + arvif->vdev_id, ret); 4405 + return; 4406 + } 4407 + } else { 4408 + psmode = WMI_STA_PS_MODE_DISABLED; 4324 4409 } 4410 + 4411 + ath12k_dbg(ar->ab, ATH12K_DBG_MAC, "mac vdev %d psmode %s\n", 4412 + arvif->vdev_id, psmode ? "enable" : "disable"); 4413 + 4414 + ret = ath12k_wmi_pdev_set_ps_mode(ar, arvif->vdev_id, psmode); 4415 + if (ret) 4416 + ath12k_warn(ar->ab, "failed to set sta power save mode %d for vdev %d: %d\n", 4417 + psmode, arvif->vdev_id, ret); 4325 4418 } 4326 4419 4327 4420 static bool ath12k_mac_supports_tpc(struct ath12k *ar, struct ath12k_vif *ahvif, ··· 4404 4423 { 4405 4424 struct ath12k_vif *ahvif = arvif->ahvif; 4406 4425 struct ieee80211_vif *vif = ath12k_ahvif_to_vif(ahvif); 4426 + struct ieee80211_vif_cfg *vif_cfg = &vif->cfg; 4407 4427 struct ath12k_link_vif *tx_arvif; 4408 4428 struct cfg80211_chan_def def; 4409 4429 u32 param_id, param_value; ··· 4738 4756 } 4739 4757 4740 4758 ath12k_mac_fils_discovery(arvif, info); 4759 + 4760 + if (changed & BSS_CHANGED_PS && 4761 + ar->ab->hw_params->supports_sta_ps) { 4762 + ahvif->ps = vif_cfg->ps; 4763 + ath12k_mac_vif_setup_ps(arvif); 4764 + } 4741 4765 } 4742 4766 4743 4767 static struct ath12k_vif_cache *ath12k_ahvif_get_link_cache(struct ath12k_vif *ahvif,
+4 -3
drivers/net/wireless/virtual/mac80211_hwsim.c
··· 6699 6699 .n_mcgrps = ARRAY_SIZE(hwsim_mcgrps), 6700 6700 }; 6701 6701 6702 - static void remove_user_radios(u32 portid) 6702 + static void remove_user_radios(u32 portid, int netgroup) 6703 6703 { 6704 6704 struct mac80211_hwsim_data *entry, *tmp; 6705 6705 LIST_HEAD(list); 6706 6706 6707 6707 spin_lock_bh(&hwsim_radio_lock); 6708 6708 list_for_each_entry_safe(entry, tmp, &hwsim_radios, list) { 6709 - if (entry->destroy_on_close && entry->portid == portid) { 6709 + if (entry->destroy_on_close && entry->portid == portid && 6710 + entry->netgroup == netgroup) { 6710 6711 list_move(&entry->list, &list); 6711 6712 rhashtable_remove_fast(&hwsim_radios_rht, &entry->rht, 6712 6713 hwsim_rht_params); ··· 6732 6731 if (state != NETLINK_URELEASE) 6733 6732 return NOTIFY_DONE; 6734 6733 6735 - remove_user_radios(notify->portid); 6734 + remove_user_radios(notify->portid, hwsim_net_get_netgroup(notify->net)); 6736 6735 6737 6736 if (notify->portid == hwsim_net_get_wmediumd(notify->net)) { 6738 6737 printk(KERN_INFO "mac80211_hwsim: wmediumd released netlink"
+1
drivers/net/wireless/zydas/zd1211rw/zd_usb.c
··· 791 791 if (urbs) { 792 792 for (i = 0; i < RX_URBS_COUNT; i++) 793 793 free_rx_urb(urbs[i]); 794 + kfree(urbs); 794 795 } 795 796 return r; 796 797 }
+10 -3
drivers/nvme/host/pci.c
··· 1042 1042 return nvme_pci_setup_data_prp(req, &iter); 1043 1043 } 1044 1044 1045 - static blk_status_t nvme_pci_setup_meta_sgls(struct request *req) 1045 + static blk_status_t nvme_pci_setup_meta_iter(struct request *req) 1046 1046 { 1047 1047 struct nvme_queue *nvmeq = req->mq_hctx->driver_data; 1048 1048 unsigned int entries = req->nr_integrity_segments; ··· 1072 1072 * descriptor provides an explicit length, so we're relying on that 1073 1073 * mechanism to catch any misunderstandings between the application and 1074 1074 * device. 1075 + * 1076 + * P2P DMA also needs to use the blk_dma_iter method, so mptr setup 1077 + * leverages this routine when that happens. 1075 1078 */ 1076 - if (entries == 1 && !(nvme_req(req)->flags & NVME_REQ_USERCMD)) { 1079 + if (!nvme_ctrl_meta_sgl_supported(&dev->ctrl) || 1080 + (entries == 1 && !(nvme_req(req)->flags & NVME_REQ_USERCMD))) { 1077 1081 iod->cmd.common.metadata = cpu_to_le64(iter.addr); 1078 1082 iod->meta_total_len = iter.len; 1079 1083 iod->meta_dma = iter.addr; ··· 1118 1114 struct nvme_queue *nvmeq = req->mq_hctx->driver_data; 1119 1115 struct bio_vec bv = rq_integrity_vec(req); 1120 1116 1117 + if (is_pci_p2pdma_page(bv.bv_page)) 1118 + return nvme_pci_setup_meta_iter(req); 1119 + 1121 1120 iod->meta_dma = dma_map_bvec(nvmeq->dev->dev, &bv, rq_dma_dir(req), 0); 1122 1121 if (dma_mapping_error(nvmeq->dev->dev, iod->meta_dma)) 1123 1122 return BLK_STS_IOERR; ··· 1135 1128 1136 1129 if ((iod->cmd.common.flags & NVME_CMD_SGL_METABUF) && 1137 1130 nvme_pci_metadata_use_sgls(req)) 1138 - return nvme_pci_setup_meta_sgls(req); 1131 + return nvme_pci_setup_meta_iter(req); 1139 1132 return nvme_pci_setup_meta_mptr(req); 1140 1133 } 1141 1134
+3 -2
drivers/nvme/target/auth.c
··· 298 298 const char *hash_name; 299 299 u8 *challenge = req->sq->dhchap_c1; 300 300 struct nvme_dhchap_key *transformed_key; 301 - u8 buf[4]; 301 + u8 buf[4], sc_c = ctrl->concat ? 1 : 0; 302 302 int ret; 303 303 304 304 hash_name = nvme_auth_hmac_name(ctrl->shash_id); ··· 367 367 ret = crypto_shash_update(shash, buf, 2); 368 368 if (ret) 369 369 goto out; 370 - memset(buf, 0, 4); 370 + *buf = sc_c; 371 371 ret = crypto_shash_update(shash, buf, 1); 372 372 if (ret) 373 373 goto out; 374 374 ret = crypto_shash_update(shash, "HostHost", 8); 375 375 if (ret) 376 376 goto out; 377 + memset(buf, 0, 4); 377 378 ret = crypto_shash_update(shash, ctrl->hostnqn, strlen(ctrl->hostnqn)); 378 379 if (ret) 379 380 goto out;
+32
drivers/pci/controller/dwc/pcie-qcom.c
··· 247 247 int (*get_resources)(struct qcom_pcie *pcie); 248 248 int (*init)(struct qcom_pcie *pcie); 249 249 int (*post_init)(struct qcom_pcie *pcie); 250 + void (*host_post_init)(struct qcom_pcie *pcie); 250 251 void (*deinit)(struct qcom_pcie *pcie); 251 252 void (*ltssm_enable)(struct qcom_pcie *pcie); 252 253 int (*config_sid)(struct qcom_pcie *pcie); ··· 1039 1038 return 0; 1040 1039 } 1041 1040 1041 + static int qcom_pcie_enable_aspm(struct pci_dev *pdev, void *userdata) 1042 + { 1043 + /* 1044 + * Downstream devices need to be in D0 state before enabling PCI PM 1045 + * substates. 1046 + */ 1047 + pci_set_power_state_locked(pdev, PCI_D0); 1048 + pci_enable_link_state_locked(pdev, PCIE_LINK_STATE_ALL); 1049 + 1050 + return 0; 1051 + } 1052 + 1053 + static void qcom_pcie_host_post_init_2_7_0(struct qcom_pcie *pcie) 1054 + { 1055 + struct dw_pcie_rp *pp = &pcie->pci->pp; 1056 + 1057 + pci_walk_bus(pp->bridge->bus, qcom_pcie_enable_aspm, NULL); 1058 + } 1059 + 1042 1060 static void qcom_pcie_deinit_2_7_0(struct qcom_pcie *pcie) 1043 1061 { 1044 1062 struct qcom_pcie_resources_2_7_0 *res = &pcie->res.v2_7_0; ··· 1332 1312 pcie->cfg->ops->deinit(pcie); 1333 1313 } 1334 1314 1315 + static void qcom_pcie_host_post_init(struct dw_pcie_rp *pp) 1316 + { 1317 + struct dw_pcie *pci = to_dw_pcie_from_pp(pp); 1318 + struct qcom_pcie *pcie = to_qcom_pcie(pci); 1319 + 1320 + if (pcie->cfg->ops->host_post_init) 1321 + pcie->cfg->ops->host_post_init(pcie); 1322 + } 1323 + 1335 1324 static const struct dw_pcie_host_ops qcom_pcie_dw_ops = { 1336 1325 .init = qcom_pcie_host_init, 1337 1326 .deinit = qcom_pcie_host_deinit, 1327 + .post_init = qcom_pcie_host_post_init, 1338 1328 }; 1339 1329 1340 1330 /* Qcom IP rev.: 2.1.0 Synopsys IP rev.: 4.01a */ ··· 1406 1376 .get_resources = qcom_pcie_get_resources_2_7_0, 1407 1377 .init = qcom_pcie_init_2_7_0, 1408 1378 .post_init = qcom_pcie_post_init_2_7_0, 1379 + .host_post_init = qcom_pcie_host_post_init_2_7_0, 1409 1380 .deinit = qcom_pcie_deinit_2_7_0, 1410 1381 .ltssm_enable = qcom_pcie_2_3_2_ltssm_enable, 1411 1382 .config_sid = qcom_pcie_config_sid_1_9_0, ··· 1417 1386 .get_resources = qcom_pcie_get_resources_2_7_0, 1418 1387 .init = qcom_pcie_init_2_7_0, 1419 1388 .post_init = qcom_pcie_post_init_2_7_0, 1389 + .host_post_init = qcom_pcie_host_post_init_2_7_0, 1420 1390 .deinit = qcom_pcie_deinit_2_7_0, 1421 1391 .ltssm_enable = qcom_pcie_2_3_2_ltssm_enable, 1422 1392 };
+1 -1
drivers/pci/setup-bus.c
··· 1604 1604 pbus_size_io(bus, realloc_head ? 0 : additional_io_size, 1605 1605 additional_io_size, realloc_head); 1606 1606 1607 - if (pref) { 1607 + if (pref && (pref->flags & IORESOURCE_PREFETCH)) { 1608 1608 pbus_size_mem(bus, 1609 1609 IORESOURCE_MEM | IORESOURCE_PREFETCH | 1610 1610 (pref->flags & IORESOURCE_MEM_64),
+1 -1
drivers/platform/x86/Kconfig
··· 432 432 depends on INPUT 433 433 help 434 434 This driver provides supports for the wireless buttons found on some AMD, 435 - HP, & Xioami laptops. 435 + HP, & Xiaomi laptops. 436 436 On such systems the driver should load automatically (via ACPI alias). 437 437 438 438 To compile this driver as a module, choose M here: the module will
+12
drivers/platform/x86/dell/dell-wmi-base.c
··· 365 365 /* Backlight brightness change event */ 366 366 { KE_IGNORE, 0x0003, { KEY_RESERVED } }, 367 367 368 + /* 369 + * Electronic privacy screen toggled, extended data gives state, 370 + * separate entries for on/off see handling in dell_wmi_process_key(). 371 + */ 372 + { KE_KEY, 0x000c, { KEY_EPRIVACY_SCREEN_OFF } }, 373 + { KE_KEY, 0x000c, { KEY_EPRIVACY_SCREEN_ON } }, 374 + 368 375 /* Ultra-performance mode switch request */ 369 376 { KE_IGNORE, 0x000d, { KEY_RESERVED } }, 370 377 ··· 442 435 "Dell tablet mode switch", 443 436 SW_TABLET_MODE, !buffer[0]); 444 437 return 1; 438 + } else if (type == 0x0012 && code == 0x000c && remaining > 0) { 439 + /* Eprivacy toggle, switch to "on" key entry for on events */ 440 + if (buffer[0] == 2) 441 + key++; 442 + used = 1; 445 443 } else if (type == 0x0012 && code == 0x000d && remaining > 0) { 446 444 value = (buffer[2] == 2); 447 445 used = 1;
+1 -4
drivers/platform/x86/intel/int3472/clk_and_regulator.c
··· 245 245 if (IS_ERR(regulator->rdev)) 246 246 return PTR_ERR(regulator->rdev); 247 247 248 - int3472->regulators[int3472->n_regulator_gpios].ena_gpio = gpio; 249 248 int3472->n_regulator_gpios++; 250 249 return 0; 251 250 } 252 251 253 252 void skl_int3472_unregister_regulator(struct int3472_discrete_device *int3472) 254 253 { 255 - for (int i = 0; i < int3472->n_regulator_gpios; i++) { 254 + for (int i = 0; i < int3472->n_regulator_gpios; i++) 256 255 regulator_unregister(int3472->regulators[i].rdev); 257 - gpiod_put(int3472->regulators[i].ena_gpio); 258 - } 259 256 }
+1 -1
drivers/platform/x86/intel/int3472/led.c
··· 43 43 44 44 int3472->pled.lookup.provider = int3472->pled.name; 45 45 int3472->pled.lookup.dev_id = int3472->sensor_name; 46 - int3472->pled.lookup.con_id = "privacy-led"; 46 + int3472->pled.lookup.con_id = "privacy"; 47 47 led_add_lookup(&int3472->pled.lookup); 48 48 49 49 return 0;
+4
drivers/ptp/ptp_chardev.c
··· 561 561 return ptp_mask_en_single(pccontext->private_clkdata, argptr); 562 562 563 563 case PTP_SYS_OFFSET_PRECISE_CYCLES: 564 + if (!ptp->has_cycles) 565 + return -EOPNOTSUPP; 564 566 return ptp_sys_offset_precise(ptp, argptr, 565 567 ptp->info->getcrosscycles); 566 568 567 569 case PTP_SYS_OFFSET_EXTENDED_CYCLES: 570 + if (!ptp->has_cycles) 571 + return -EOPNOTSUPP; 568 572 return ptp_sys_offset_extended(ptp, argptr, 569 573 ptp->info->getcyclesx64); 570 574 default:
+2
drivers/regulator/bd718x7-regulator.c
··· 1613 1613 step /= r1; 1614 1614 1615 1615 new[j].min = min; 1616 + new[j].min_sel = desc->linear_ranges[j].min_sel; 1617 + new[j].max_sel = desc->linear_ranges[j].max_sel; 1616 1618 new[j].step = step; 1617 1619 1618 1620 dev_dbg(dev, "%s: old range min %d, step %d\n",
+3 -2
drivers/scsi/hosts.c
··· 611 611 { 612 612 int cnt = 0; 613 613 614 - blk_mq_tagset_busy_iter(&shost->tag_set, 615 - scsi_host_check_in_flight, &cnt); 614 + if (shost->tag_set.ops) 615 + blk_mq_tagset_busy_iter(&shost->tag_set, 616 + scsi_host_check_in_flight, &cnt); 616 617 return cnt; 617 618 } 618 619 EXPORT_SYMBOL(scsi_host_busy);
+2 -2
drivers/scsi/scsi_error.c
··· 554 554 * happened, even if someone else gets the sense data. 555 555 */ 556 556 if (sshdr.asc == 0x28) 557 - scmd->device->ua_new_media_ctr++; 557 + atomic_inc(&sdev->ua_new_media_ctr); 558 558 else if (sshdr.asc == 0x29) 559 - scmd->device->ua_por_ctr++; 559 + atomic_inc(&sdev->ua_por_ctr); 560 560 } 561 561 562 562 if (scsi_sense_is_deferred(&sshdr))
+7 -7
drivers/soc/ti/knav_dma.c
··· 402 402 * @name: slave channel name 403 403 * @config: dma configuration parameters 404 404 * 405 - * Returns pointer to appropriate DMA channel on success or error. 405 + * Return: Pointer to appropriate DMA channel on success or NULL on error. 406 406 */ 407 407 void *knav_dma_open_channel(struct device *dev, const char *name, 408 408 struct knav_dma_cfg *config) ··· 414 414 415 415 if (!kdev) { 416 416 pr_err("keystone-navigator-dma driver not registered\n"); 417 - return (void *)-EINVAL; 417 + return NULL; 418 418 } 419 419 420 420 chan_num = of_channel_match_helper(dev->of_node, name, &instance); 421 421 if (chan_num < 0) { 422 422 dev_err(kdev->dev, "No DMA instance with name %s\n", name); 423 - return (void *)-EINVAL; 423 + return NULL; 424 424 } 425 425 426 426 dev_dbg(kdev->dev, "initializing %s channel %d from DMA %s\n", ··· 431 431 if (config->direction != DMA_MEM_TO_DEV && 432 432 config->direction != DMA_DEV_TO_MEM) { 433 433 dev_err(kdev->dev, "bad direction\n"); 434 - return (void *)-EINVAL; 434 + return NULL; 435 435 } 436 436 437 437 /* Look for correct dma instance */ ··· 443 443 } 444 444 if (!dma) { 445 445 dev_err(kdev->dev, "No DMA instance with name %s\n", instance); 446 - return (void *)-EINVAL; 446 + return NULL; 447 447 } 448 448 449 449 /* Look for correct dma channel from dma instance */ ··· 463 463 if (!chan) { 464 464 dev_err(kdev->dev, "channel %d is not in DMA %s\n", 465 465 chan_num, instance); 466 - return (void *)-EINVAL; 466 + return NULL; 467 467 } 468 468 469 469 if (atomic_read(&chan->ref_count) >= 1) { 470 470 if (!check_config(chan, config)) { 471 471 dev_err(kdev->dev, "channel %d config miss-match\n", 472 472 chan_num); 473 - return (void *)-EINVAL; 473 + return NULL; 474 474 } 475 475 } 476 476
+1
drivers/spi/spi-intel-pci.c
··· 80 80 { PCI_VDEVICE(INTEL, 0x51a4), (unsigned long)&cnl_info }, 81 81 { PCI_VDEVICE(INTEL, 0x54a4), (unsigned long)&cnl_info }, 82 82 { PCI_VDEVICE(INTEL, 0x5794), (unsigned long)&cnl_info }, 83 + { PCI_VDEVICE(INTEL, 0x5825), (unsigned long)&cnl_info }, 83 84 { PCI_VDEVICE(INTEL, 0x7723), (unsigned long)&cnl_info }, 84 85 { PCI_VDEVICE(INTEL, 0x7a24), (unsigned long)&cnl_info }, 85 86 { PCI_VDEVICE(INTEL, 0x7aa4), (unsigned long)&cnl_info },
+17 -11
drivers/ufs/core/ufshcd.c
··· 4282 4282 get, UIC_GET_ATTR_ID(attr_sel), 4283 4283 UFS_UIC_COMMAND_RETRIES - retries); 4284 4284 4285 - if (mib_val && !ret) 4286 - *mib_val = uic_cmd.argument3; 4285 + if (mib_val) 4286 + *mib_val = ret == 0 ? uic_cmd.argument3 : 0; 4287 4287 4288 4288 if (peer && (hba->quirks & UFSHCD_QUIRK_DME_PEER_ACCESS_AUTO_MODE) 4289 4289 && pwr_mode_change) ··· 4999 4999 5000 5000 static int ufshcd_disable_tx_lcc(struct ufs_hba *hba, bool peer) 5001 5001 { 5002 - int tx_lanes = 0, i, err = 0; 5002 + int tx_lanes, i, err = 0; 5003 5003 5004 5004 if (!peer) 5005 5005 ufshcd_dme_get(hba, UIC_ARG_MIB(PA_CONNECTEDTXDATALANES), ··· 6673 6673 hba->saved_uic_err, hba->force_reset, 6674 6674 ufshcd_is_link_broken(hba) ? "; link is broken" : ""); 6675 6675 6676 + /* 6677 + * Use ufshcd_rpm_get_noresume() here to safely perform link recovery 6678 + * even if an error occurs during runtime suspend or runtime resume. 6679 + * This avoids potential deadlocks that could happen if we tried to 6680 + * resume the device while a PM operation is already in progress. 6681 + */ 6682 + ufshcd_rpm_get_noresume(hba); 6683 + if (hba->pm_op_in_progress) { 6684 + ufshcd_link_recovery(hba); 6685 + ufshcd_rpm_put(hba); 6686 + return; 6687 + } 6688 + ufshcd_rpm_put(hba); 6689 + 6676 6690 down(&hba->host_sem); 6677 6691 spin_lock_irqsave(hba->host->host_lock, flags); 6678 6692 if (ufshcd_err_handling_should_stop(hba)) { ··· 6697 6683 return; 6698 6684 } 6699 6685 spin_unlock_irqrestore(hba->host->host_lock, flags); 6700 - 6701 - ufshcd_rpm_get_noresume(hba); 6702 - if (hba->pm_op_in_progress) { 6703 - ufshcd_link_recovery(hba); 6704 - ufshcd_rpm_put(hba); 6705 - return; 6706 - } 6707 - ufshcd_rpm_put(hba); 6708 6686 6709 6687 ufshcd_err_handling_prepare(hba); 6710 6688
+110 -63
drivers/vfio/vfio_iommu_type1.c
··· 38 38 #include <linux/workqueue.h> 39 39 #include <linux/notifier.h> 40 40 #include <linux/mm_inline.h> 41 + #include <linux/overflow.h> 41 42 #include "vfio.h" 42 43 43 44 #define DRIVER_VERSION "0.2" ··· 168 167 { 169 168 struct rb_node *node = iommu->dma_list.rb_node; 170 169 170 + WARN_ON(!size); 171 + 171 172 while (node) { 172 173 struct vfio_dma *dma = rb_entry(node, struct vfio_dma, node); 173 174 174 - if (start + size <= dma->iova) 175 + if (start + size - 1 < dma->iova) 175 176 node = node->rb_left; 176 - else if (start >= dma->iova + dma->size) 177 + else if (start > dma->iova + dma->size - 1) 177 178 node = node->rb_right; 178 179 else 179 180 return dma; ··· 185 182 } 186 183 187 184 static struct rb_node *vfio_find_dma_first_node(struct vfio_iommu *iommu, 188 - dma_addr_t start, u64 size) 185 + dma_addr_t start, 186 + dma_addr_t end) 189 187 { 190 188 struct rb_node *res = NULL; 191 189 struct rb_node *node = iommu->dma_list.rb_node; 192 190 struct vfio_dma *dma_res = NULL; 193 191 192 + WARN_ON(end < start); 193 + 194 194 while (node) { 195 195 struct vfio_dma *dma = rb_entry(node, struct vfio_dma, node); 196 196 197 - if (start < dma->iova + dma->size) { 197 + if (start <= dma->iova + dma->size - 1) { 198 198 res = node; 199 199 dma_res = dma; 200 200 if (start >= dma->iova) ··· 207 201 node = node->rb_right; 208 202 } 209 203 } 210 - if (res && size && dma_res->iova >= start + size) 204 + if (res && dma_res->iova > end) 211 205 res = NULL; 212 206 return res; 213 207 } ··· 217 211 struct rb_node **link = &iommu->dma_list.rb_node, *parent = NULL; 218 212 struct vfio_dma *dma; 219 213 214 + WARN_ON(new->size != 0); 215 + 220 216 while (*link) { 221 217 parent = *link; 222 218 dma = rb_entry(parent, struct vfio_dma, node); 223 219 224 - if (new->iova + new->size <= dma->iova) 220 + if (new->iova <= dma->iova) 225 221 link = &(*link)->rb_left; 226 222 else 227 223 link = &(*link)->rb_right; ··· 903 895 unsigned long remote_vaddr; 904 896 struct vfio_dma *dma; 905 897 bool do_accounting; 898 + dma_addr_t iova_end; 899 + size_t iova_size; 906 900 907 - if (!iommu || !pages) 901 + if (!iommu || !pages || npage <= 0) 908 902 return -EINVAL; 909 903 910 904 /* Supported for v2 version only */ 911 905 if (!iommu->v2) 912 906 return -EACCES; 907 + 908 + if (check_mul_overflow(npage, PAGE_SIZE, &iova_size) || 909 + check_add_overflow(user_iova, iova_size - 1, &iova_end)) 910 + return -EOVERFLOW; 913 911 914 912 mutex_lock(&iommu->lock); 915 913 ··· 1022 1008 { 1023 1009 struct vfio_iommu *iommu = iommu_data; 1024 1010 bool do_accounting; 1011 + dma_addr_t iova_end; 1012 + size_t iova_size; 1025 1013 int i; 1026 1014 1027 1015 /* Supported for v2 version only */ 1028 1016 if (WARN_ON(!iommu->v2)) 1017 + return; 1018 + 1019 + if (WARN_ON(npage <= 0)) 1020 + return; 1021 + 1022 + if (WARN_ON(check_mul_overflow(npage, PAGE_SIZE, &iova_size) || 1023 + check_add_overflow(user_iova, iova_size - 1, &iova_end))) 1029 1024 return; 1030 1025 1031 1026 mutex_lock(&iommu->lock); ··· 1090 1067 #define VFIO_IOMMU_TLB_SYNC_MAX 512 1091 1068 1092 1069 static size_t unmap_unpin_fast(struct vfio_domain *domain, 1093 - struct vfio_dma *dma, dma_addr_t *iova, 1070 + struct vfio_dma *dma, dma_addr_t iova, 1094 1071 size_t len, phys_addr_t phys, long *unlocked, 1095 1072 struct list_head *unmapped_list, 1096 1073 int *unmapped_cnt, ··· 1100 1077 struct vfio_regions *entry = kzalloc(sizeof(*entry), GFP_KERNEL); 1101 1078 1102 1079 if (entry) { 1103 - unmapped = iommu_unmap_fast(domain->domain, *iova, len, 1080 + unmapped = iommu_unmap_fast(domain->domain, iova, len, 1104 1081 iotlb_gather); 1105 1082 1106 1083 if (!unmapped) { 1107 1084 kfree(entry); 1108 1085 } else { 1109 - entry->iova = *iova; 1086 + entry->iova = iova; 1110 1087 entry->phys = phys; 1111 1088 entry->len = unmapped; 1112 1089 list_add_tail(&entry->list, unmapped_list); 1113 1090 1114 - *iova += unmapped; 1115 1091 (*unmapped_cnt)++; 1116 1092 } 1117 1093 } ··· 1129 1107 } 1130 1108 1131 1109 static size_t unmap_unpin_slow(struct vfio_domain *domain, 1132 - struct vfio_dma *dma, dma_addr_t *iova, 1110 + struct vfio_dma *dma, dma_addr_t iova, 1133 1111 size_t len, phys_addr_t phys, 1134 1112 long *unlocked) 1135 1113 { 1136 - size_t unmapped = iommu_unmap(domain->domain, *iova, len); 1114 + size_t unmapped = iommu_unmap(domain->domain, iova, len); 1137 1115 1138 1116 if (unmapped) { 1139 - *unlocked += vfio_unpin_pages_remote(dma, *iova, 1117 + *unlocked += vfio_unpin_pages_remote(dma, iova, 1140 1118 phys >> PAGE_SHIFT, 1141 1119 unmapped >> PAGE_SHIFT, 1142 1120 false); 1143 - *iova += unmapped; 1144 1121 cond_resched(); 1145 1122 } 1146 1123 return unmapped; ··· 1148 1127 static long vfio_unmap_unpin(struct vfio_iommu *iommu, struct vfio_dma *dma, 1149 1128 bool do_accounting) 1150 1129 { 1151 - dma_addr_t iova = dma->iova, end = dma->iova + dma->size; 1152 1130 struct vfio_domain *domain, *d; 1153 1131 LIST_HEAD(unmapped_region_list); 1154 1132 struct iommu_iotlb_gather iotlb_gather; 1155 1133 int unmapped_region_cnt = 0; 1156 1134 long unlocked = 0; 1135 + size_t pos = 0; 1157 1136 1158 1137 if (!dma->size) 1159 1138 return 0; ··· 1177 1156 } 1178 1157 1179 1158 iommu_iotlb_gather_init(&iotlb_gather); 1180 - while (iova < end) { 1159 + while (pos < dma->size) { 1181 1160 size_t unmapped, len; 1182 1161 phys_addr_t phys, next; 1162 + dma_addr_t iova = dma->iova + pos; 1183 1163 1184 1164 phys = iommu_iova_to_phys(domain->domain, iova); 1185 1165 if (WARN_ON(!phys)) { 1186 - iova += PAGE_SIZE; 1166 + pos += PAGE_SIZE; 1187 1167 continue; 1188 1168 } 1189 1169 ··· 1193 1171 * may require hardware cache flushing, try to find the 1194 1172 * largest contiguous physical memory chunk to unmap. 1195 1173 */ 1196 - for (len = PAGE_SIZE; iova + len < end; len += PAGE_SIZE) { 1174 + for (len = PAGE_SIZE; pos + len < dma->size; len += PAGE_SIZE) { 1197 1175 next = iommu_iova_to_phys(domain->domain, iova + len); 1198 1176 if (next != phys + len) 1199 1177 break; ··· 1203 1181 * First, try to use fast unmap/unpin. In case of failure, 1204 1182 * switch to slow unmap/unpin path. 1205 1183 */ 1206 - unmapped = unmap_unpin_fast(domain, dma, &iova, len, phys, 1184 + unmapped = unmap_unpin_fast(domain, dma, iova, len, phys, 1207 1185 &unlocked, &unmapped_region_list, 1208 1186 &unmapped_region_cnt, 1209 1187 &iotlb_gather); 1210 1188 if (!unmapped) { 1211 - unmapped = unmap_unpin_slow(domain, dma, &iova, len, 1189 + unmapped = unmap_unpin_slow(domain, dma, iova, len, 1212 1190 phys, &unlocked); 1213 1191 if (WARN_ON(!unmapped)) 1214 1192 break; 1215 1193 } 1194 + 1195 + pos += unmapped; 1216 1196 } 1217 1197 1218 1198 dma->iommu_mapped = false; ··· 1306 1282 } 1307 1283 1308 1284 static int vfio_iova_dirty_bitmap(u64 __user *bitmap, struct vfio_iommu *iommu, 1309 - dma_addr_t iova, size_t size, size_t pgsize) 1285 + dma_addr_t iova, dma_addr_t iova_end, size_t pgsize) 1310 1286 { 1311 1287 struct vfio_dma *dma; 1312 1288 struct rb_node *n; ··· 1323 1299 if (dma && dma->iova != iova) 1324 1300 return -EINVAL; 1325 1301 1326 - dma = vfio_find_dma(iommu, iova + size - 1, 0); 1327 - if (dma && dma->iova + dma->size != iova + size) 1302 + dma = vfio_find_dma(iommu, iova_end, 1); 1303 + if (dma && dma->iova + dma->size - 1 != iova_end) 1328 1304 return -EINVAL; 1329 1305 1330 1306 for (n = rb_first(&iommu->dma_list); n; n = rb_next(n)) { ··· 1333 1309 if (dma->iova < iova) 1334 1310 continue; 1335 1311 1336 - if (dma->iova > iova + size - 1) 1312 + if (dma->iova > iova_end) 1337 1313 break; 1338 1314 1339 1315 ret = update_user_bitmap(bitmap, iommu, dma, iova, pgsize); ··· 1398 1374 int ret = -EINVAL, retries = 0; 1399 1375 unsigned long pgshift; 1400 1376 dma_addr_t iova = unmap->iova; 1401 - u64 size = unmap->size; 1377 + dma_addr_t iova_end; 1378 + size_t size = unmap->size; 1402 1379 bool unmap_all = unmap->flags & VFIO_DMA_UNMAP_FLAG_ALL; 1403 1380 bool invalidate_vaddr = unmap->flags & VFIO_DMA_UNMAP_FLAG_VADDR; 1404 1381 struct rb_node *n, *first_n; ··· 1412 1387 goto unlock; 1413 1388 } 1414 1389 1390 + if (iova != unmap->iova || size != unmap->size) { 1391 + ret = -EOVERFLOW; 1392 + goto unlock; 1393 + } 1394 + 1415 1395 pgshift = __ffs(iommu->pgsize_bitmap); 1416 1396 pgsize = (size_t)1 << pgshift; 1417 1397 ··· 1426 1396 if (unmap_all) { 1427 1397 if (iova || size) 1428 1398 goto unlock; 1429 - size = U64_MAX; 1430 - } else if (!size || size & (pgsize - 1) || 1431 - iova + size - 1 < iova || size > SIZE_MAX) { 1432 - goto unlock; 1399 + iova_end = ~(dma_addr_t)0; 1400 + } else { 1401 + if (!size || size & (pgsize - 1)) 1402 + goto unlock; 1403 + 1404 + if (check_add_overflow(iova, size - 1, &iova_end)) { 1405 + ret = -EOVERFLOW; 1406 + goto unlock; 1407 + } 1433 1408 } 1434 1409 1435 1410 /* When dirty tracking is enabled, allow only min supported pgsize */ ··· 1481 1446 if (dma && dma->iova != iova) 1482 1447 goto unlock; 1483 1448 1484 - dma = vfio_find_dma(iommu, iova + size - 1, 0); 1485 - if (dma && dma->iova + dma->size != iova + size) 1449 + dma = vfio_find_dma(iommu, iova_end, 1); 1450 + if (dma && dma->iova + dma->size - 1 != iova_end) 1486 1451 goto unlock; 1487 1452 } 1488 1453 1489 1454 ret = 0; 1490 - n = first_n = vfio_find_dma_first_node(iommu, iova, size); 1455 + n = first_n = vfio_find_dma_first_node(iommu, iova, iova_end); 1491 1456 1492 1457 while (n) { 1493 1458 dma = rb_entry(n, struct vfio_dma, node); 1494 - if (dma->iova >= iova + size) 1459 + if (dma->iova > iova_end) 1495 1460 break; 1496 1461 1497 1462 if (!iommu->v2 && iova > dma->iova) ··· 1683 1648 { 1684 1649 bool set_vaddr = map->flags & VFIO_DMA_MAP_FLAG_VADDR; 1685 1650 dma_addr_t iova = map->iova; 1651 + dma_addr_t iova_end; 1686 1652 unsigned long vaddr = map->vaddr; 1653 + unsigned long vaddr_end; 1687 1654 size_t size = map->size; 1688 1655 int ret = 0, prot = 0; 1689 1656 size_t pgsize; ··· 1693 1656 1694 1657 /* Verify that none of our __u64 fields overflow */ 1695 1658 if (map->size != size || map->vaddr != vaddr || map->iova != iova) 1659 + return -EOVERFLOW; 1660 + 1661 + if (!size) 1696 1662 return -EINVAL; 1663 + 1664 + if (check_add_overflow(iova, size - 1, &iova_end) || 1665 + check_add_overflow(vaddr, size - 1, &vaddr_end)) 1666 + return -EOVERFLOW; 1697 1667 1698 1668 /* READ/WRITE from device perspective */ 1699 1669 if (map->flags & VFIO_DMA_MAP_FLAG_WRITE) ··· 1717 1673 1718 1674 WARN_ON((pgsize - 1) & PAGE_MASK); 1719 1675 1720 - if (!size || (size | iova | vaddr) & (pgsize - 1)) { 1721 - ret = -EINVAL; 1722 - goto out_unlock; 1723 - } 1724 - 1725 - /* Don't allow IOVA or virtual address wrap */ 1726 - if (iova + size - 1 < iova || vaddr + size - 1 < vaddr) { 1676 + if ((size | iova | vaddr) & (pgsize - 1)) { 1727 1677 ret = -EINVAL; 1728 1678 goto out_unlock; 1729 1679 } ··· 1748 1710 goto out_unlock; 1749 1711 } 1750 1712 1751 - if (!vfio_iommu_iova_dma_valid(iommu, iova, iova + size - 1)) { 1713 + if (!vfio_iommu_iova_dma_valid(iommu, iova, iova_end)) { 1752 1714 ret = -EINVAL; 1753 1715 goto out_unlock; 1754 1716 } ··· 1821 1783 1822 1784 for (; n; n = rb_next(n)) { 1823 1785 struct vfio_dma *dma; 1824 - dma_addr_t iova; 1786 + size_t pos = 0; 1825 1787 1826 1788 dma = rb_entry(n, struct vfio_dma, node); 1827 - iova = dma->iova; 1828 1789 1829 - while (iova < dma->iova + dma->size) { 1790 + while (pos < dma->size) { 1791 + dma_addr_t iova = dma->iova + pos; 1830 1792 phys_addr_t phys; 1831 1793 size_t size; 1832 1794 ··· 1842 1804 phys = iommu_iova_to_phys(d->domain, iova); 1843 1805 1844 1806 if (WARN_ON(!phys)) { 1845 - iova += PAGE_SIZE; 1807 + pos += PAGE_SIZE; 1846 1808 continue; 1847 1809 } 1848 1810 1849 1811 size = PAGE_SIZE; 1850 1812 p = phys + size; 1851 1813 i = iova + size; 1852 - while (i < dma->iova + dma->size && 1814 + while (pos + size < dma->size && 1853 1815 p == iommu_iova_to_phys(d->domain, i)) { 1854 1816 size += PAGE_SIZE; 1855 1817 p += PAGE_SIZE; ··· 1857 1819 } 1858 1820 } else { 1859 1821 unsigned long pfn; 1860 - unsigned long vaddr = dma->vaddr + 1861 - (iova - dma->iova); 1862 - size_t n = dma->iova + dma->size - iova; 1822 + unsigned long vaddr = dma->vaddr + pos; 1823 + size_t n = dma->size - pos; 1863 1824 long npage; 1864 1825 1865 1826 npage = vfio_pin_pages_remote(dma, vaddr, ··· 1889 1852 goto unwind; 1890 1853 } 1891 1854 1892 - iova += size; 1855 + pos += size; 1893 1856 } 1894 1857 } 1895 1858 ··· 1906 1869 unwind: 1907 1870 for (; n; n = rb_prev(n)) { 1908 1871 struct vfio_dma *dma = rb_entry(n, struct vfio_dma, node); 1909 - dma_addr_t iova; 1872 + size_t pos = 0; 1910 1873 1911 1874 if (dma->iommu_mapped) { 1912 1875 iommu_unmap(domain->domain, dma->iova, dma->size); 1913 1876 continue; 1914 1877 } 1915 1878 1916 - iova = dma->iova; 1917 - while (iova < dma->iova + dma->size) { 1879 + while (pos < dma->size) { 1880 + dma_addr_t iova = dma->iova + pos; 1918 1881 phys_addr_t phys, p; 1919 1882 size_t size; 1920 1883 dma_addr_t i; 1921 1884 1922 1885 phys = iommu_iova_to_phys(domain->domain, iova); 1923 1886 if (!phys) { 1924 - iova += PAGE_SIZE; 1887 + pos += PAGE_SIZE; 1925 1888 continue; 1926 1889 } 1927 1890 1928 1891 size = PAGE_SIZE; 1929 1892 p = phys + size; 1930 1893 i = iova + size; 1931 - while (i < dma->iova + dma->size && 1894 + while (pos + size < dma->size && 1932 1895 p == iommu_iova_to_phys(domain->domain, i)) { 1933 1896 size += PAGE_SIZE; 1934 1897 p += PAGE_SIZE; ··· 3014 2977 struct vfio_iommu_type1_dirty_bitmap_get range; 3015 2978 unsigned long pgshift; 3016 2979 size_t data_size = dirty.argsz - minsz; 3017 - size_t iommu_pgsize; 2980 + size_t size, iommu_pgsize; 2981 + dma_addr_t iova, iova_end; 3018 2982 3019 2983 if (!data_size || data_size < sizeof(range)) 3020 2984 return -EINVAL; ··· 3024 2986 sizeof(range))) 3025 2987 return -EFAULT; 3026 2988 3027 - if (range.iova + range.size < range.iova) 2989 + iova = range.iova; 2990 + size = range.size; 2991 + 2992 + if (iova != range.iova || size != range.size) 2993 + return -EOVERFLOW; 2994 + 2995 + if (!size) 3028 2996 return -EINVAL; 2997 + 2998 + if (check_add_overflow(iova, size - 1, &iova_end)) 2999 + return -EOVERFLOW; 3000 + 3029 3001 if (!access_ok((void __user *)range.bitmap.data, 3030 3002 range.bitmap.size)) 3031 3003 return -EINVAL; 3032 3004 3033 3005 pgshift = __ffs(range.bitmap.pgsize); 3034 - ret = verify_bitmap_size(range.size >> pgshift, 3006 + ret = verify_bitmap_size(size >> pgshift, 3035 3007 range.bitmap.size); 3036 3008 if (ret) 3037 3009 return ret; ··· 3055 3007 ret = -EINVAL; 3056 3008 goto out_unlock; 3057 3009 } 3058 - if (range.iova & (iommu_pgsize - 1)) { 3010 + if (iova & (iommu_pgsize - 1)) { 3059 3011 ret = -EINVAL; 3060 3012 goto out_unlock; 3061 3013 } 3062 - if (!range.size || range.size & (iommu_pgsize - 1)) { 3014 + if (size & (iommu_pgsize - 1)) { 3063 3015 ret = -EINVAL; 3064 3016 goto out_unlock; 3065 3017 } 3066 3018 3067 3019 if (iommu->dirty_page_tracking) 3068 3020 ret = vfio_iova_dirty_bitmap(range.bitmap.data, 3069 - iommu, range.iova, 3070 - range.size, 3021 + iommu, iova, iova_end, 3071 3022 range.bitmap.pgsize); 3072 3023 else 3073 3024 ret = -EINVAL;
+6 -2
drivers/video/fbdev/aty/atyfb_base.c
··· 2614 2614 pr_cont("\n"); 2615 2615 } 2616 2616 #endif 2617 - if (par->pll_ops->init_pll) 2618 - par->pll_ops->init_pll(info, &par->pll); 2617 + if (par->pll_ops->init_pll) { 2618 + ret = par->pll_ops->init_pll(info, &par->pll); 2619 + if (ret) 2620 + return ret; 2621 + } 2622 + 2619 2623 if (par->pll_ops->resume_pll) 2620 2624 par->pll_ops->resume_pll(info, &par->pll); 2621 2625
+12 -4
drivers/video/fbdev/core/bitblit.c
··· 79 79 struct fb_image *image, u8 *buf, u8 *dst) 80 80 { 81 81 u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 82 + unsigned int charcnt = vc->vc_font.charcount; 82 83 u32 idx = vc->vc_font.width >> 3; 83 84 u8 *src; 84 85 85 86 while (cnt--) { 86 - src = vc->vc_font.data + (scr_readw(s++)& 87 - charmask)*cellsize; 87 + u16 ch = scr_readw(s++) & charmask; 88 + 89 + if (ch >= charcnt) 90 + ch = 0; 91 + src = vc->vc_font.data + (unsigned int)ch * cellsize; 88 92 89 93 if (attr) { 90 94 update_attr(buf, src, attr, vc); ··· 116 112 u8 *dst) 117 113 { 118 114 u16 charmask = vc->vc_hi_font_mask ? 0x1ff : 0xff; 115 + unsigned int charcnt = vc->vc_font.charcount; 119 116 u32 shift_low = 0, mod = vc->vc_font.width % 8; 120 117 u32 shift_high = 8; 121 118 u32 idx = vc->vc_font.width >> 3; 122 119 u8 *src; 123 120 124 121 while (cnt--) { 125 - src = vc->vc_font.data + (scr_readw(s++)& 126 - charmask)*cellsize; 122 + u16 ch = scr_readw(s++) & charmask; 123 + 124 + if (ch >= charcnt) 125 + ch = 0; 126 + src = vc->vc_font.data + (unsigned int)ch * cellsize; 127 127 128 128 if (attr) { 129 129 update_attr(buf, src, attr, vc);
+19
drivers/video/fbdev/core/fbcon.c
··· 2810 2810 return found; 2811 2811 } 2812 2812 2813 + static void fbcon_delete_mode(struct fb_videomode *m) 2814 + { 2815 + struct fbcon_display *p; 2816 + 2817 + for (int i = first_fb_vc; i <= last_fb_vc; i++) { 2818 + p = &fb_display[i]; 2819 + if (p->mode == m) 2820 + p->mode = NULL; 2821 + } 2822 + } 2823 + 2824 + void fbcon_delete_modelist(struct list_head *head) 2825 + { 2826 + struct fb_modelist *modelist; 2827 + 2828 + list_for_each_entry(modelist, head, list) 2829 + fbcon_delete_mode(&modelist->mode); 2830 + } 2831 + 2813 2832 #ifdef CONFIG_VT_HW_CONSOLE_BINDING 2814 2833 static void fbcon_unbind(void) 2815 2834 {
+1
drivers/video/fbdev/core/fbmem.c
··· 544 544 fb_info->pixmap.addr = NULL; 545 545 } 546 546 547 + fbcon_delete_modelist(&fb_info->modelist); 547 548 fb_destroy_modelist(&fb_info->modelist); 548 549 registered_fb[fb_info->node] = NULL; 549 550 num_registered_fb--;
+1 -1
drivers/video/fbdev/pvr2fb.c
··· 192 192 193 193 #ifdef CONFIG_PVR2_DMA 194 194 static unsigned int shdma = PVR2_CASCADE_CHAN; 195 - static unsigned int pvr2dma = ONCHIP_NR_DMA_CHANNELS; 195 + static unsigned int pvr2dma = CONFIG_NR_ONCHIP_DMA_CHANNELS; 196 196 #endif 197 197 198 198 static struct fb_videomode pvr2_modedb[] = {
+2
drivers/video/fbdev/valkyriefb.c
··· 329 329 330 330 if (of_address_to_resource(dp, 0, &r)) { 331 331 printk(KERN_ERR "can't find address for valkyrie\n"); 332 + of_node_put(dp); 332 333 return 0; 333 334 } 334 335 335 336 frame_buffer_phys = r.start; 336 337 cmap_regs_phys = r.start + 0x304000; 338 + of_node_put(dp); 337 339 } 338 340 #endif /* ppc (!CONFIG_MAC) */ 339 341
+8
fs/btrfs/extent_io.c
··· 2228 2228 wbc_account_cgroup_owner(wbc, folio, range_len); 2229 2229 folio_unlock(folio); 2230 2230 } 2231 + /* 2232 + * If the fs is already in error status, do not submit any writeback 2233 + * but immediately finish it. 2234 + */ 2235 + if (unlikely(BTRFS_FS_ERROR(fs_info))) { 2236 + btrfs_bio_end_io(bbio, errno_to_blk_status(BTRFS_FS_ERROR(fs_info))); 2237 + return; 2238 + } 2231 2239 btrfs_submit_bbio(bbio, 0); 2232 2240 } 2233 2241
+10
fs/btrfs/file.c
··· 2854 2854 { 2855 2855 struct btrfs_trans_handle *trans; 2856 2856 struct btrfs_root *root = BTRFS_I(inode)->root; 2857 + u64 range_start; 2858 + u64 range_end; 2857 2859 int ret; 2858 2860 int ret2; 2859 2861 2860 2862 if (mode & FALLOC_FL_KEEP_SIZE || end <= i_size_read(inode)) 2861 2863 return 0; 2864 + 2865 + range_start = round_down(i_size_read(inode), root->fs_info->sectorsize); 2866 + range_end = round_up(end, root->fs_info->sectorsize); 2867 + 2868 + ret = btrfs_inode_set_file_extent_range(BTRFS_I(inode), range_start, 2869 + range_end - range_start); 2870 + if (ret) 2871 + return ret; 2862 2872 2863 2873 trans = btrfs_start_transaction(root, 1); 2864 2874 if (IS_ERR(trans))
-1
fs/btrfs/inode.c
··· 6873 6873 BTRFS_I(inode)->dir_index = 0ULL; 6874 6874 inode_inc_iversion(inode); 6875 6875 inode_set_ctime_current(inode); 6876 - set_bit(BTRFS_INODE_COPY_EVERYTHING, &BTRFS_I(inode)->runtime_flags); 6877 6876 6878 6877 ret = btrfs_add_link(trans, BTRFS_I(dir), BTRFS_I(inode), 6879 6878 &fname.disk_name, 1, index);
+3 -1
fs/btrfs/qgroup.c
··· 1539 1539 ASSERT(prealloc); 1540 1540 1541 1541 /* Check the level of src and dst first */ 1542 - if (btrfs_qgroup_level(src) >= btrfs_qgroup_level(dst)) 1542 + if (btrfs_qgroup_level(src) >= btrfs_qgroup_level(dst)) { 1543 + kfree(prealloc); 1543 1544 return -EINVAL; 1545 + } 1544 1546 1545 1547 mutex_lock(&fs_info->qgroup_ioctl_lock); 1546 1548 if (!fs_info->quota_root) {
+3
fs/btrfs/tree-log.c
··· 7910 7910 bool log_pinned = false; 7911 7911 int ret; 7912 7912 7913 + /* The inode has a new name (ref/extref), so make sure we log it. */ 7914 + set_bit(BTRFS_INODE_COPY_EVERYTHING, &inode->runtime_flags); 7915 + 7913 7916 btrfs_init_log_ctx(&ctx, inode); 7914 7917 ctx.logging_new_name = true; 7915 7918
+1 -1
fs/smb/client/cifsfs.c
··· 173 173 MODULE_PARM_DESC(enable_oplocks, "Enable or disable oplocks. Default: y/Y/1"); 174 174 175 175 module_param(enable_gcm_256, bool, 0644); 176 - MODULE_PARM_DESC(enable_gcm_256, "Enable requesting strongest (256 bit) GCM encryption. Default: y/Y/0"); 176 + MODULE_PARM_DESC(enable_gcm_256, "Enable requesting strongest (256 bit) GCM encryption. Default: y/Y/1"); 177 177 178 178 module_param(require_gcm_256, bool, 0644); 179 179 MODULE_PARM_DESC(require_gcm_256, "Require strongest (256 bit) GCM encryption. Default: n/N/0");
+2
fs/smb/client/cifsproto.h
··· 616 616 extern struct TCP_Server_Info * 617 617 cifs_find_tcp_session(struct smb3_fs_context *ctx); 618 618 619 + struct cifs_tcon *cifs_setup_ipc(struct cifs_ses *ses, bool seal); 620 + 619 621 void __cifs_put_smb_ses(struct cifs_ses *ses); 620 622 621 623 extern struct cifs_ses *
+19 -27
fs/smb/client/connect.c
··· 310 310 server->ssocket->flags); 311 311 sock_release(server->ssocket); 312 312 server->ssocket = NULL; 313 + } else if (cifs_rdma_enabled(server)) { 314 + smbd_destroy(server); 313 315 } 314 316 server->sequence_number = 0; 315 317 server->session_estab = false; ··· 339 337 list_del_init(&mid->qhead); 340 338 mid_execute_callback(mid); 341 339 release_mid(mid); 342 - } 343 - 344 - if (cifs_rdma_enabled(server)) { 345 - cifs_server_lock(server); 346 - smbd_destroy(server); 347 - cifs_server_unlock(server); 348 340 } 349 341 } 350 342 ··· 2011 2015 /** 2012 2016 * cifs_setup_ipc - helper to setup the IPC tcon for the session 2013 2017 * @ses: smb session to issue the request on 2014 - * @ctx: the superblock configuration context to use for building the 2015 - * new tree connection for the IPC (interprocess communication RPC) 2018 + * @seal: if encryption is requested 2016 2019 * 2017 2020 * A new IPC connection is made and stored in the session 2018 2021 * tcon_ipc. The IPC tcon has the same lifetime as the session. 2019 2022 */ 2020 - static int 2021 - cifs_setup_ipc(struct cifs_ses *ses, struct smb3_fs_context *ctx) 2023 + struct cifs_tcon *cifs_setup_ipc(struct cifs_ses *ses, bool seal) 2022 2024 { 2023 2025 int rc = 0, xid; 2024 2026 struct cifs_tcon *tcon; 2025 2027 char unc[SERVER_NAME_LENGTH + sizeof("//x/IPC$")] = {0}; 2026 - bool seal = false; 2027 2028 struct TCP_Server_Info *server = ses->server; 2028 2029 2029 2030 /* 2030 2031 * If the mount request that resulted in the creation of the 2031 2032 * session requires encryption, force IPC to be encrypted too. 2032 2033 */ 2033 - if (ctx->seal) { 2034 - if (server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION) 2035 - seal = true; 2036 - else { 2037 - cifs_server_dbg(VFS, 2038 - "IPC: server doesn't support encryption\n"); 2039 - return -EOPNOTSUPP; 2040 - } 2034 + if (seal && !(server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION)) { 2035 + cifs_server_dbg(VFS, "IPC: server doesn't support encryption\n"); 2036 + return ERR_PTR(-EOPNOTSUPP); 2041 2037 } 2042 2038 2043 2039 /* no need to setup directory caching on IPC share, so pass in false */ 2044 2040 tcon = tcon_info_alloc(false, netfs_trace_tcon_ref_new_ipc); 2045 2041 if (tcon == NULL) 2046 - return -ENOMEM; 2042 + return ERR_PTR(-ENOMEM); 2047 2043 2048 2044 spin_lock(&server->srv_lock); 2049 2045 scnprintf(unc, sizeof(unc), "\\\\%s\\IPC$", server->hostname); ··· 2045 2057 tcon->ses = ses; 2046 2058 tcon->ipc = true; 2047 2059 tcon->seal = seal; 2048 - rc = server->ops->tree_connect(xid, ses, unc, tcon, ctx->local_nls); 2060 + rc = server->ops->tree_connect(xid, ses, unc, tcon, ses->local_nls); 2049 2061 free_xid(xid); 2050 2062 2051 2063 if (rc) { 2052 - cifs_server_dbg(VFS, "failed to connect to IPC (rc=%d)\n", rc); 2064 + cifs_server_dbg(VFS | ONCE, "failed to connect to IPC (rc=%d)\n", rc); 2053 2065 tconInfoFree(tcon, netfs_trace_tcon_ref_free_ipc_fail); 2054 - goto out; 2066 + return ERR_PTR(rc); 2055 2067 } 2056 2068 2057 2069 cifs_dbg(FYI, "IPC tcon rc=%d ipc tid=0x%x\n", rc, tcon->tid); ··· 2059 2071 spin_lock(&tcon->tc_lock); 2060 2072 tcon->status = TID_GOOD; 2061 2073 spin_unlock(&tcon->tc_lock); 2062 - ses->tcon_ipc = tcon; 2063 - out: 2064 - return rc; 2074 + return tcon; 2065 2075 } 2066 2076 2067 2077 static struct cifs_ses * ··· 2333 2347 { 2334 2348 struct sockaddr_in6 *addr6 = (struct sockaddr_in6 *)&server->dstaddr; 2335 2349 struct sockaddr_in *addr = (struct sockaddr_in *)&server->dstaddr; 2350 + struct cifs_tcon *ipc; 2336 2351 struct cifs_ses *ses; 2337 2352 unsigned int xid; 2338 2353 int retries = 0; ··· 2512 2525 list_add(&ses->smb_ses_list, &server->smb_ses_list); 2513 2526 spin_unlock(&cifs_tcp_ses_lock); 2514 2527 2515 - cifs_setup_ipc(ses, ctx); 2528 + ipc = cifs_setup_ipc(ses, ctx->seal); 2529 + spin_lock(&cifs_tcp_ses_lock); 2530 + spin_lock(&ses->ses_lock); 2531 + ses->tcon_ipc = !IS_ERR(ipc) ? ipc : NULL; 2532 + spin_unlock(&ses->ses_lock); 2533 + spin_unlock(&cifs_tcp_ses_lock); 2516 2534 2517 2535 free_xid(xid); 2518 2536
+47 -8
fs/smb/client/dfs_cache.c
··· 1120 1120 return match; 1121 1121 } 1122 1122 1123 - static bool is_ses_good(struct cifs_ses *ses) 1123 + static bool is_ses_good(struct cifs_tcon *tcon, struct cifs_ses *ses) 1124 1124 { 1125 1125 struct TCP_Server_Info *server = ses->server; 1126 - struct cifs_tcon *tcon = ses->tcon_ipc; 1126 + struct cifs_tcon *ipc = NULL; 1127 1127 bool ret; 1128 1128 1129 + spin_lock(&cifs_tcp_ses_lock); 1129 1130 spin_lock(&ses->ses_lock); 1130 1131 spin_lock(&ses->chan_lock); 1132 + 1131 1133 ret = !cifs_chan_needs_reconnect(ses, server) && 1132 - ses->ses_status == SES_GOOD && 1133 - !tcon->need_reconnect; 1134 + ses->ses_status == SES_GOOD; 1135 + 1134 1136 spin_unlock(&ses->chan_lock); 1137 + 1138 + if (!ret) 1139 + goto out; 1140 + 1141 + if (likely(ses->tcon_ipc)) { 1142 + if (ses->tcon_ipc->need_reconnect) { 1143 + ret = false; 1144 + goto out; 1145 + } 1146 + } else { 1147 + spin_unlock(&ses->ses_lock); 1148 + spin_unlock(&cifs_tcp_ses_lock); 1149 + 1150 + ipc = cifs_setup_ipc(ses, tcon->seal); 1151 + 1152 + spin_lock(&cifs_tcp_ses_lock); 1153 + spin_lock(&ses->ses_lock); 1154 + if (!IS_ERR(ipc)) { 1155 + if (!ses->tcon_ipc) { 1156 + ses->tcon_ipc = ipc; 1157 + ipc = NULL; 1158 + } 1159 + } else { 1160 + ret = false; 1161 + ipc = NULL; 1162 + } 1163 + } 1164 + 1165 + out: 1135 1166 spin_unlock(&ses->ses_lock); 1167 + spin_unlock(&cifs_tcp_ses_lock); 1168 + if (ipc && server->ops->tree_disconnect) { 1169 + unsigned int xid = get_xid(); 1170 + 1171 + (void)server->ops->tree_disconnect(xid, ipc); 1172 + _free_xid(xid); 1173 + } 1174 + tconInfoFree(ipc, netfs_trace_tcon_ref_free_ipc); 1136 1175 return ret; 1137 1176 } 1138 1177 1139 1178 /* Refresh dfs referral of @ses */ 1140 - static void refresh_ses_referral(struct cifs_ses *ses) 1179 + static void refresh_ses_referral(struct cifs_tcon *tcon, struct cifs_ses *ses) 1141 1180 { 1142 1181 struct cache_entry *ce; 1143 1182 unsigned int xid; ··· 1192 1153 } 1193 1154 1194 1155 ses = CIFS_DFS_ROOT_SES(ses); 1195 - if (!is_ses_good(ses)) { 1156 + if (!is_ses_good(tcon, ses)) { 1196 1157 cifs_dbg(FYI, "%s: skip cache refresh due to disconnected ipc\n", 1197 1158 __func__); 1198 1159 goto out; ··· 1280 1241 up_read(&htable_rw_lock); 1281 1242 1282 1243 ses = CIFS_DFS_ROOT_SES(ses); 1283 - if (!is_ses_good(ses)) { 1244 + if (!is_ses_good(tcon, ses)) { 1284 1245 cifs_dbg(FYI, "%s: skip cache refresh due to disconnected ipc\n", 1285 1246 __func__); 1286 1247 goto out; ··· 1348 1309 tcon = container_of(work, struct cifs_tcon, dfs_cache_work.work); 1349 1310 1350 1311 list_for_each_entry(ses, &tcon->dfs_ses_list, dlist) 1351 - refresh_ses_referral(ses); 1312 + refresh_ses_referral(tcon, ses); 1352 1313 refresh_tcon_referral(tcon, false); 1353 1314 1354 1315 queue_delayed_work(dfscache_wq, &tcon->dfs_cache_work,
+2 -1
fs/smb/client/smb2ops.c
··· 2799 2799 struct cifs_fid fid; 2800 2800 int rc; 2801 2801 __le16 *utf16_path; 2802 - struct cached_fid *cfid = NULL; 2802 + struct cached_fid *cfid; 2803 2803 int retries = 0, cur_sleep = 1; 2804 2804 2805 2805 replay_again: 2806 2806 /* reinitialize for possible replay */ 2807 + cfid = NULL; 2807 2808 flags = CIFS_CP_CREATE_CLOSE_OP; 2808 2809 oplock = SMB2_OPLOCK_LEVEL_NONE; 2809 2810 server = cifs_pick_channel(ses);
+6
fs/xfs/libxfs/xfs_rtgroup.h
··· 50 50 uint8_t *rtg_rsum_cache; 51 51 struct xfs_open_zone *rtg_open_zone; 52 52 }; 53 + 54 + /* 55 + * Count of outstanding GC operations for zoned XFS. Any RTG with a 56 + * non-zero rtg_gccount will not be picked as new GC victim. 57 + */ 58 + atomic_t rtg_gccount; 53 59 }; 54 60 55 61 /*
+8
fs/xfs/xfs_zone_alloc.c
··· 246 246 * If a data write raced with this GC write, keep the existing data in 247 247 * the data fork, mark our newly written GC extent as reclaimable, then 248 248 * move on to the next extent. 249 + * 250 + * Note that this can also happen when racing with operations that do 251 + * not actually invalidate the data, but just move it to a different 252 + * inode (XFS_IOC_EXCHANGE_RANGE), or to a different offset inside the 253 + * inode (FALLOC_FL_COLLAPSE_RANGE / FALLOC_FL_INSERT_RANGE). If the 254 + * data was just moved around, GC fails to free the zone, but the zone 255 + * becomes a GC candidate again as soon as all previous GC I/O has 256 + * finished and these blocks will be moved out eventually. 249 257 */ 250 258 if (old_startblock != NULLFSBLOCK && 251 259 old_startblock != data.br_startblock)
+27
fs/xfs/xfs_zone_gc.c
··· 114 114 /* Open Zone being written to */ 115 115 struct xfs_open_zone *oz; 116 116 117 + struct xfs_rtgroup *victim_rtg; 118 + 117 119 /* Bio used for reads and writes, including the bvec used by it */ 118 120 struct bio_vec bv; 119 121 struct bio bio; /* must be last */ ··· 266 264 iter->rec_count = 0; 267 265 iter->rec_idx = 0; 268 266 iter->victim_rtg = victim_rtg; 267 + atomic_inc(&victim_rtg->rtg_gccount); 269 268 } 270 269 271 270 /* ··· 365 362 366 363 return 0; 367 364 done: 365 + atomic_dec(&iter->victim_rtg->rtg_gccount); 368 366 xfs_rtgroup_rele(iter->victim_rtg); 369 367 iter->victim_rtg = NULL; 370 368 return 0; ··· 454 450 455 451 if (!rtg) 456 452 continue; 453 + 454 + /* 455 + * If the zone is already undergoing GC, don't pick it again. 456 + * 457 + * This prevents us from picking one of the zones for which we 458 + * already submitted GC I/O, but for which the remapping hasn't 459 + * concluded yet. This won't cause data corruption, but 460 + * increases write amplification and slows down GC, so this is 461 + * a bad thing. 462 + */ 463 + if (atomic_read(&rtg->rtg_gccount)) { 464 + xfs_rtgroup_rele(rtg); 465 + continue; 466 + } 457 467 458 468 /* skip zones that are just waiting for a reset */ 459 469 if (rtg_rmap(rtg)->i_used_blocks == 0 || ··· 706 688 chunk->scratch = &data->scratch[data->scratch_idx]; 707 689 chunk->data = data; 708 690 chunk->oz = oz; 691 + chunk->victim_rtg = iter->victim_rtg; 692 + atomic_inc(&chunk->victim_rtg->rtg_group.xg_active_ref); 693 + atomic_inc(&chunk->victim_rtg->rtg_gccount); 709 694 710 695 bio->bi_iter.bi_sector = xfs_rtb_to_daddr(mp, chunk->old_startblock); 711 696 bio->bi_end_io = xfs_zone_gc_end_io; ··· 731 710 xfs_zone_gc_free_chunk( 732 711 struct xfs_gc_bio *chunk) 733 712 { 713 + atomic_dec(&chunk->victim_rtg->rtg_gccount); 714 + xfs_rtgroup_rele(chunk->victim_rtg); 734 715 list_del(&chunk->entry); 735 716 xfs_open_zone_put(chunk->oz); 736 717 xfs_irele(chunk->ip); ··· 792 769 split_chunk->new_daddr = chunk->new_daddr; 793 770 split_chunk->oz = chunk->oz; 794 771 atomic_inc(&chunk->oz->oz_ref); 772 + 773 + split_chunk->victim_rtg = chunk->victim_rtg; 774 + atomic_inc(&chunk->victim_rtg->rtg_group.xg_active_ref); 775 + atomic_inc(&chunk->victim_rtg->rtg_gccount); 795 776 796 777 chunk->offset += split_len; 797 778 chunk->len -= split_len;
+1 -1
include/asm-generic/vmlinux.lds.h
··· 832 832 833 833 /* Required sections not related to debugging. */ 834 834 #define ELF_DETAILS \ 835 - .modinfo : { *(.modinfo) } \ 835 + .modinfo : { *(.modinfo) . = ALIGN(8); } \ 836 836 .comment 0 : { *(.comment) } \ 837 837 .symtab 0 : { *(.symtab) } \ 838 838 .strtab 0 : { *(.strtab) } \
+6 -5
include/linux/blk_types.h
··· 341 341 /* write the zero filled sector many times */ 342 342 REQ_OP_WRITE_ZEROES = (__force blk_opf_t)9, 343 343 /* Open a zone */ 344 - REQ_OP_ZONE_OPEN = (__force blk_opf_t)10, 344 + REQ_OP_ZONE_OPEN = (__force blk_opf_t)11, 345 345 /* Close a zone */ 346 - REQ_OP_ZONE_CLOSE = (__force blk_opf_t)11, 346 + REQ_OP_ZONE_CLOSE = (__force blk_opf_t)13, 347 347 /* Transition a zone to full */ 348 - REQ_OP_ZONE_FINISH = (__force blk_opf_t)13, 348 + REQ_OP_ZONE_FINISH = (__force blk_opf_t)15, 349 349 /* reset a zone write pointer */ 350 - REQ_OP_ZONE_RESET = (__force blk_opf_t)15, 350 + REQ_OP_ZONE_RESET = (__force blk_opf_t)17, 351 351 /* reset all the zone present on the device */ 352 - REQ_OP_ZONE_RESET_ALL = (__force blk_opf_t)17, 352 + REQ_OP_ZONE_RESET_ALL = (__force blk_opf_t)19, 353 353 354 354 /* Driver private requests */ 355 355 REQ_OP_DRV_IN = (__force blk_opf_t)34, ··· 478 478 { 479 479 switch (op & REQ_OP_MASK) { 480 480 case REQ_OP_ZONE_RESET: 481 + case REQ_OP_ZONE_RESET_ALL: 481 482 case REQ_OP_ZONE_OPEN: 482 483 case REQ_OP_ZONE_CLOSE: 483 484 case REQ_OP_ZONE_FINISH:
+2
include/linux/fbcon.h
··· 18 18 void fbcon_resumed(struct fb_info *info); 19 19 int fbcon_mode_deleted(struct fb_info *info, 20 20 struct fb_videomode *mode); 21 + void fbcon_delete_modelist(struct list_head *head); 21 22 void fbcon_new_modelist(struct fb_info *info); 22 23 void fbcon_get_requirement(struct fb_info *info, 23 24 struct fb_blit_caps *caps); ··· 39 38 static inline void fbcon_resumed(struct fb_info *info) {} 40 39 static inline int fbcon_mode_deleted(struct fb_info *info, 41 40 struct fb_videomode *mode) { return 0; } 41 + static inline void fbcon_delete_modelist(struct list_head *head) {} 42 42 static inline void fbcon_new_modelist(struct fb_info *info) {} 43 43 static inline void fbcon_get_requirement(struct fb_info *info, 44 44 struct fb_blit_caps *caps) {}
+12
include/linux/net/intel/libie/fwlog.h
··· 78 78 ); 79 79 }; 80 80 81 + #if IS_ENABLED(CONFIG_LIBIE_FWLOG) 81 82 int libie_fwlog_init(struct libie_fwlog *fwlog, struct libie_fwlog_api *api); 82 83 void libie_fwlog_deinit(struct libie_fwlog *fwlog); 83 84 void libie_fwlog_reregister(struct libie_fwlog *fwlog); 84 85 void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf, u16 len); 86 + #else 87 + static inline int libie_fwlog_init(struct libie_fwlog *fwlog, 88 + struct libie_fwlog_api *api) 89 + { 90 + return -EOPNOTSUPP; 91 + } 92 + static inline void libie_fwlog_deinit(struct libie_fwlog *fwlog) { } 93 + static inline void libie_fwlog_reregister(struct libie_fwlog *fwlog) { } 94 + static inline void libie_get_fwlog_data(struct libie_fwlog *fwlog, u8 *buf, 95 + u16 len) { } 96 + #endif /* CONFIG_LIBIE_FWLOG */ 85 97 #endif /* _LIBIE_FWLOG_H_ */
-1
include/linux/platform_data/x86/int3472.h
··· 100 100 struct regulator_consumer_supply supply_map[GPIO_REGULATOR_SUPPLY_MAP_COUNT * 2]; 101 101 char supply_name_upper[GPIO_SUPPLY_NAME_LENGTH]; 102 102 char regulator_name[GPIO_REGULATOR_NAME_LENGTH]; 103 - struct gpio_desc *ena_gpio; 104 103 struct regulator_dev *rdev; 105 104 struct regulator_desc rdesc; 106 105 };
+1 -1
include/linux/regmap.h
··· 1643 1643 * @status_invert: Inverted status register: cleared bits are active interrupts. 1644 1644 * @status_is_level: Status register is actuall signal level: Xor status 1645 1645 * register with previous value to get active interrupts. 1646 - * @wake_invert: Inverted wake register: cleared bits are wake enabled. 1646 + * @wake_invert: Inverted wake register: cleared bits are wake disabled. 1647 1647 * @type_in_mask: Use the mask registers for controlling irq type. Use this if 1648 1648 * the hardware provides separate bits for rising/falling edge 1649 1649 * or low/high level interrupts and they should be combined into
+2 -2
include/linux/sched.h
··· 2407 2407 * be defined in kernel/sched/core.c. 2408 2408 */ 2409 2409 #ifndef INSTANTIATE_EXPORTED_MIGRATE_DISABLE 2410 - static inline void migrate_disable(void) 2410 + static __always_inline void migrate_disable(void) 2411 2411 { 2412 2412 __migrate_disable(); 2413 2413 } 2414 2414 2415 - static inline void migrate_enable(void) 2415 + static __always_inline void migrate_enable(void) 2416 2416 { 2417 2417 __migrate_enable(); 2418 2418 }
+2 -1
include/linux/virtio_net.h
··· 401 401 if (!tnl_hdr_negotiated) 402 402 return -EINVAL; 403 403 404 - vhdr->hash_hdr.hash_value = 0; 404 + vhdr->hash_hdr.hash_value_lo = 0; 405 + vhdr->hash_hdr.hash_value_hi = 0; 405 406 vhdr->hash_hdr.hash_report = 0; 406 407 vhdr->hash_hdr.padding = 0; 407 408
+1 -1
include/net/bluetooth/mgmt.h
··· 780 780 __u8 ad_type; 781 781 __u8 offset; 782 782 __u8 length; 783 - __u8 value[31]; 783 + __u8 value[HCI_MAX_AD_LENGTH]; 784 784 } __packed; 785 785 786 786 #define MGMT_OP_ADD_ADV_PATTERNS_MONITOR 0x0052
+78
include/net/cfg80211.h
··· 6440 6440 * after wiphy_lock() was called. Therefore, wiphy_cancel_work() can 6441 6441 * use just cancel_work() instead of cancel_work_sync(), it requires 6442 6442 * being in a section protected by wiphy_lock(). 6443 + * 6444 + * Note that these are scheduled with a timer where the accuracy 6445 + * becomes less the longer in the future the scheduled timer is. Use 6446 + * wiphy_hrtimer_work_queue() if the timer must be not be late by more 6447 + * than approximately 10 percent. 6443 6448 */ 6444 6449 void wiphy_delayed_work_queue(struct wiphy *wiphy, 6445 6450 struct wiphy_delayed_work *dwork, ··· 6515 6510 */ 6516 6511 bool wiphy_delayed_work_pending(struct wiphy *wiphy, 6517 6512 struct wiphy_delayed_work *dwork); 6513 + 6514 + struct wiphy_hrtimer_work { 6515 + struct wiphy_work work; 6516 + struct wiphy *wiphy; 6517 + struct hrtimer timer; 6518 + }; 6519 + 6520 + enum hrtimer_restart wiphy_hrtimer_work_timer(struct hrtimer *t); 6521 + 6522 + static inline void wiphy_hrtimer_work_init(struct wiphy_hrtimer_work *hrwork, 6523 + wiphy_work_func_t func) 6524 + { 6525 + hrtimer_setup(&hrwork->timer, wiphy_hrtimer_work_timer, 6526 + CLOCK_BOOTTIME, HRTIMER_MODE_REL); 6527 + wiphy_work_init(&hrwork->work, func); 6528 + } 6529 + 6530 + /** 6531 + * wiphy_hrtimer_work_queue - queue hrtimer work for the wiphy 6532 + * @wiphy: the wiphy to queue for 6533 + * @hrwork: the high resolution timer worker 6534 + * @delay: the delay given as a ktime_t 6535 + * 6536 + * Please refer to wiphy_delayed_work_queue(). The difference is that 6537 + * the hrtimer work uses a high resolution timer for scheduling. This 6538 + * may be needed if timeouts might be scheduled further in the future 6539 + * and the accuracy of the normal timer is not sufficient. 6540 + * 6541 + * Expect a delay of a few milliseconds as the timer is scheduled 6542 + * with some slack and some more time may pass between queueing the 6543 + * work and its start. 6544 + */ 6545 + void wiphy_hrtimer_work_queue(struct wiphy *wiphy, 6546 + struct wiphy_hrtimer_work *hrwork, 6547 + ktime_t delay); 6548 + 6549 + /** 6550 + * wiphy_hrtimer_work_cancel - cancel previously queued hrtimer work 6551 + * @wiphy: the wiphy, for debug purposes 6552 + * @hrtimer: the hrtimer work to cancel 6553 + * 6554 + * Cancel the work *without* waiting for it, this assumes being 6555 + * called under the wiphy mutex acquired by wiphy_lock(). 6556 + */ 6557 + void wiphy_hrtimer_work_cancel(struct wiphy *wiphy, 6558 + struct wiphy_hrtimer_work *hrtimer); 6559 + 6560 + /** 6561 + * wiphy_hrtimer_work_flush - flush previously queued hrtimer work 6562 + * @wiphy: the wiphy, for debug purposes 6563 + * @hrwork: the hrtimer work to flush 6564 + * 6565 + * Flush the work (i.e. run it if pending). This must be called 6566 + * under the wiphy mutex acquired by wiphy_lock(). 6567 + */ 6568 + void wiphy_hrtimer_work_flush(struct wiphy *wiphy, 6569 + struct wiphy_hrtimer_work *hrwork); 6570 + 6571 + /** 6572 + * wiphy_hrtimer_work_pending - Find out whether a wiphy hrtimer 6573 + * work item is currently pending. 6574 + * 6575 + * @wiphy: the wiphy, for debug purposes 6576 + * @hrwork: the hrtimer work in question 6577 + * 6578 + * Return: true if timer is pending, false otherwise 6579 + * 6580 + * Please refer to the wiphy_delayed_work_pending() documentation as 6581 + * this is the equivalent function for hrtimer based delayed work 6582 + * items. 6583 + */ 6584 + bool wiphy_hrtimer_work_pending(struct wiphy *wiphy, 6585 + struct wiphy_hrtimer_work *hrwork); 6518 6586 6519 6587 /** 6520 6588 * enum ieee80211_ap_reg_power - regulatory power for an Access Point
+4 -6
include/scsi/scsi_device.h
··· 252 252 unsigned int queue_stopped; /* request queue is quiesced */ 253 253 bool offline_already; /* Device offline message logged */ 254 254 255 - unsigned int ua_new_media_ctr; /* Counter for New Media UNIT ATTENTIONs */ 256 - unsigned int ua_por_ctr; /* Counter for Power On / Reset UAs */ 255 + atomic_t ua_new_media_ctr; /* Counter for New Media UNIT ATTENTIONs */ 256 + atomic_t ua_por_ctr; /* Counter for Power On / Reset UAs */ 257 257 258 258 atomic_t disk_events_disable_depth; /* disable depth for disk events */ 259 259 ··· 693 693 } 694 694 695 695 /* Macros to access the UNIT ATTENTION counters */ 696 - #define scsi_get_ua_new_media_ctr(sdev) \ 697 - ((const unsigned int)(sdev->ua_new_media_ctr)) 698 - #define scsi_get_ua_por_ctr(sdev) \ 699 - ((const unsigned int)(sdev->ua_por_ctr)) 696 + #define scsi_get_ua_new_media_ctr(sdev) atomic_read(&sdev->ua_new_media_ctr) 697 + #define scsi_get_ua_por_ctr(sdev) atomic_read(&sdev->ua_por_ctr) 700 698 701 699 #define MODULE_ALIAS_SCSI_DEVICE(type) \ 702 700 MODULE_ALIAS("scsi:t-" __stringify(type) "*")
+1 -1
include/uapi/linux/fb.h
··· 319 319 #define FB_VBLANK_HAVE_VCOUNT 0x020 /* the vcount field is valid */ 320 320 #define FB_VBLANK_HAVE_HCOUNT 0x040 /* the hcount field is valid */ 321 321 #define FB_VBLANK_VSYNCING 0x080 /* currently in a vsync */ 322 - #define FB_VBLANK_HAVE_VSYNC 0x100 /* verical syncs can be detected */ 322 + #define FB_VBLANK_HAVE_VSYNC 0x100 /* vertical syncs can be detected */ 323 323 324 324 struct fb_vblank { 325 325 __u32 flags; /* FB_VBLANK flags */
+12
include/uapi/linux/input-event-codes.h
··· 631 631 #define KEY_BRIGHTNESS_MIN 0x250 /* Set Brightness to Minimum */ 632 632 #define KEY_BRIGHTNESS_MAX 0x251 /* Set Brightness to Maximum */ 633 633 634 + /* 635 + * Keycodes for hotkeys toggling the electronic privacy screen found on some 636 + * laptops on/off. Note when the embedded-controller turns on/off the eprivacy 637 + * screen itself then the state should be reported through drm connecter props: 638 + * https://www.kernel.org/doc/html/latest/gpu/drm-kms.html#standard-connector-properties 639 + * Except when implementing the drm connecter properties API is not possible 640 + * because e.g. the firmware does not allow querying the presence and/or status 641 + * of the eprivacy screen at boot. 642 + */ 643 + #define KEY_EPRIVACY_SCREEN_ON 0x252 644 + #define KEY_EPRIVACY_SCREEN_OFF 0x253 645 + 634 646 #define KEY_KBDINPUTASSIST_PREV 0x260 635 647 #define KEY_KBDINPUTASSIST_NEXT 0x261 636 648 #define KEY_KBDINPUTASSIST_PREVGROUP 0x262
+2 -1
include/uapi/linux/virtio_net.h
··· 193 193 194 194 struct virtio_net_hdr_v1_hash { 195 195 struct virtio_net_hdr_v1 hdr; 196 - __le32 hash_value; 196 + __le16 hash_value_lo; 197 + __le16 hash_value_hi; 197 198 #define VIRTIO_NET_HASH_REPORT_NONE 0 198 199 #define VIRTIO_NET_HASH_REPORT_IPv4 1 199 200 #define VIRTIO_NET_HASH_REPORT_TCPv4 2
+2
kernel/bpf/helpers.c
··· 4345 4345 BTF_ID_FLAGS(func, bpf_iter_kmem_cache_destroy, KF_ITER_DESTROY | KF_SLEEPABLE) 4346 4346 BTF_ID_FLAGS(func, bpf_local_irq_save) 4347 4347 BTF_ID_FLAGS(func, bpf_local_irq_restore) 4348 + #ifdef CONFIG_BPF_EVENTS 4348 4349 BTF_ID_FLAGS(func, bpf_probe_read_user_dynptr) 4349 4350 BTF_ID_FLAGS(func, bpf_probe_read_kernel_dynptr) 4350 4351 BTF_ID_FLAGS(func, bpf_probe_read_user_str_dynptr) ··· 4354 4353 BTF_ID_FLAGS(func, bpf_copy_from_user_str_dynptr, KF_SLEEPABLE) 4355 4354 BTF_ID_FLAGS(func, bpf_copy_from_user_task_dynptr, KF_SLEEPABLE | KF_TRUSTED_ARGS) 4356 4355 BTF_ID_FLAGS(func, bpf_copy_from_user_task_str_dynptr, KF_SLEEPABLE | KF_TRUSTED_ARGS) 4356 + #endif 4357 4357 #ifdef CONFIG_DMA_SHARED_BUFFER 4358 4358 BTF_ID_FLAGS(func, bpf_iter_dmabuf_new, KF_ITER_NEW | KF_SLEEPABLE) 4359 4359 BTF_ID_FLAGS(func, bpf_iter_dmabuf_next, KF_ITER_NEXT | KF_RET_NULL | KF_SLEEPABLE)
+2
kernel/bpf/ringbuf.c
··· 216 216 217 217 static void bpf_ringbuf_free(struct bpf_ringbuf *rb) 218 218 { 219 + irq_work_sync(&rb->work); 220 + 219 221 /* copy pages pointer and nr_pages to local variable, as we are going 220 222 * to unmap rb itself with vunmap() below 221 223 */
-4
kernel/power/hibernate.c
··· 706 706 707 707 #ifdef CONFIG_SUSPEND 708 708 if (hibernation_mode == HIBERNATION_SUSPEND) { 709 - pm_restore_gfp_mask(); 710 709 error = suspend_devices_and_enter(mem_sleep_current); 711 710 if (!error) 712 711 goto exit; ··· 745 746 cpu_relax(); 746 747 747 748 exit: 748 - /* Match the pm_restore_gfp_mask() call in hibernate(). */ 749 - pm_restrict_gfp_mask(); 750 - 751 749 /* Restore swap signature. */ 752 750 error = swsusp_unmark(); 753 751 if (error)
+17 -5
kernel/power/main.c
··· 31 31 * held, unless the suspend/hibernate code is guaranteed not to run in parallel 32 32 * with that modification). 33 33 */ 34 + static unsigned int saved_gfp_count; 34 35 static gfp_t saved_gfp_mask; 35 36 36 37 void pm_restore_gfp_mask(void) 37 38 { 38 39 WARN_ON(!mutex_is_locked(&system_transition_mutex)); 39 - if (saved_gfp_mask) { 40 - gfp_allowed_mask = saved_gfp_mask; 41 - saved_gfp_mask = 0; 42 - } 40 + 41 + if (WARN_ON(!saved_gfp_count) || --saved_gfp_count) 42 + return; 43 + 44 + gfp_allowed_mask = saved_gfp_mask; 45 + saved_gfp_mask = 0; 46 + 47 + pm_pr_dbg("GFP mask restored\n"); 43 48 } 44 49 45 50 void pm_restrict_gfp_mask(void) 46 51 { 47 52 WARN_ON(!mutex_is_locked(&system_transition_mutex)); 48 - WARN_ON(saved_gfp_mask); 53 + 54 + if (saved_gfp_count++) { 55 + WARN_ON((saved_gfp_mask & ~(__GFP_IO | __GFP_FS)) != gfp_allowed_mask); 56 + return; 57 + } 58 + 49 59 saved_gfp_mask = gfp_allowed_mask; 50 60 gfp_allowed_mask &= ~(__GFP_IO | __GFP_FS); 61 + 62 + pm_pr_dbg("GFP mask restricted\n"); 51 63 } 52 64 53 65 unsigned int lock_system_sleep(void)
+1
kernel/power/process.c
··· 132 132 if (!pm_freezing) 133 133 static_branch_inc(&freezer_active); 134 134 135 + pm_wakeup_clear(0); 135 136 pm_freezing = true; 136 137 error = try_to_freeze_tasks(true); 137 138 if (!error)
-1
kernel/power/suspend.c
··· 595 595 } 596 596 597 597 pm_pr_dbg("Preparing system for sleep (%s)\n", mem_sleep_labels[state]); 598 - pm_wakeup_clear(0); 599 598 pm_suspend_clear_flags(); 600 599 error = suspend_prepare(state); 601 600 if (error)
+1 -1
lib/Kconfig.kmsan
··· 3 3 bool 4 4 5 5 config HAVE_KMSAN_COMPILER 6 - def_bool CC_IS_CLANG 6 + def_bool $(cc-option,-fsanitize=kernel-memory) 7 7 8 8 config KMSAN 9 9 bool "KMSAN: detector of uninitialized values use"
+1 -1
lib/kunit/kunit-test.c
··· 739 739 740 740 static void test_dev_action(void *priv) 741 741 { 742 - *(void **)priv = (void *)1; 742 + *(long *)priv = 1; 743 743 } 744 744 745 745 static void kunit_device_test(struct kunit *test)
+2 -1
lib/kunit/test.c
··· 745 745 .param_index = ++test.param_index, 746 746 .parent = &test, 747 747 }; 748 - kunit_init_test(&param_test, test_case->name, test_case->log); 748 + kunit_init_test(&param_test, test_case->name, NULL); 749 + param_test.log = test_case->log; 749 750 kunit_run_case_catch_errors(suite, test_case, &param_test); 750 751 751 752 if (param_desc[0] == '\0') {
+2
net/8021q/vlan.c
··· 193 193 vlan_group_set_device(grp, vlan->vlan_proto, vlan_id, dev); 194 194 grp->nr_vlan_devs++; 195 195 196 + netdev_update_features(dev); 197 + 196 198 return 0; 197 199 198 200 out_unregister_netdev:
+7
net/bluetooth/hci_event.c
··· 4218 4218 } 4219 4219 4220 4220 if (i == ARRAY_SIZE(hci_cc_table)) { 4221 + if (!skb->len) { 4222 + bt_dev_err(hdev, "Unexpected cc 0x%4.4x with no status", 4223 + *opcode); 4224 + *status = HCI_ERROR_UNSPECIFIED; 4225 + return; 4226 + } 4227 + 4221 4228 /* Unknown opcode, assume byte 0 contains the status, so 4222 4229 * that e.g. __hci_cmd_sync() properly returns errors 4223 4230 * for vendor specific commands send by HCI drivers.
+3 -3
net/bluetooth/mgmt.c
··· 5395 5395 for (i = 0; i < pattern_count; i++) { 5396 5396 offset = patterns[i].offset; 5397 5397 length = patterns[i].length; 5398 - if (offset >= HCI_MAX_EXT_AD_LENGTH || 5399 - length > HCI_MAX_EXT_AD_LENGTH || 5400 - (offset + length) > HCI_MAX_EXT_AD_LENGTH) 5398 + if (offset >= HCI_MAX_AD_LENGTH || 5399 + length > HCI_MAX_AD_LENGTH || 5400 + (offset + length) > HCI_MAX_AD_LENGTH) 5401 5401 return MGMT_STATUS_INVALID_PARAMS; 5402 5402 5403 5403 p = kmalloc(sizeof(*p), GFP_KERNEL);
+1 -1
net/bridge/br_forward.c
··· 25 25 26 26 vg = nbp_vlan_group_rcu(p); 27 27 return ((p->flags & BR_HAIRPIN_MODE) || skb->dev != p->dev) && 28 - (br_mst_is_enabled(p->br) || p->state == BR_STATE_FORWARDING) && 28 + (br_mst_is_enabled(p) || p->state == BR_STATE_FORWARDING) && 29 29 br_allowed_egress(vg, skb) && nbp_switchdev_allowed_egress(p, skb) && 30 30 !br_skb_isolated(p, skb); 31 31 }
+1
net/bridge/br_if.c
··· 386 386 del_nbp(p); 387 387 } 388 388 389 + br_mst_uninit(br); 389 390 br_recalculate_neigh_suppress_enabled(br); 390 391 391 392 br_fdb_delete_by_port(br, NULL, 0, 1);
+2 -2
net/bridge/br_input.c
··· 94 94 95 95 br = p->br; 96 96 97 - if (br_mst_is_enabled(br)) { 97 + if (br_mst_is_enabled(p)) { 98 98 state = BR_STATE_FORWARDING; 99 99 } else { 100 100 if (p->state == BR_STATE_DISABLED) { ··· 429 429 return RX_HANDLER_PASS; 430 430 431 431 forward: 432 - if (br_mst_is_enabled(p->br)) 432 + if (br_mst_is_enabled(p)) 433 433 goto defer_stp_filtering; 434 434 435 435 switch (p->state) {
+8 -2
net/bridge/br_mst.c
··· 22 22 } 23 23 EXPORT_SYMBOL_GPL(br_mst_enabled); 24 24 25 + void br_mst_uninit(struct net_bridge *br) 26 + { 27 + if (br_opt_get(br, BROPT_MST_ENABLED)) 28 + static_branch_dec(&br_mst_used); 29 + } 30 + 25 31 int br_mst_get_info(const struct net_device *dev, u16 msti, unsigned long *vids) 26 32 { 27 33 const struct net_bridge_vlan_group *vg; ··· 231 225 return err; 232 226 233 227 if (on) 234 - static_branch_enable(&br_mst_used); 228 + static_branch_inc(&br_mst_used); 235 229 else 236 - static_branch_disable(&br_mst_used); 230 + static_branch_dec(&br_mst_used); 237 231 238 232 br_opt_toggle(br, BROPT_MST_ENABLED, on); 239 233 return 0;
+10 -3
net/bridge/br_private.h
··· 1935 1935 /* br_mst.c */ 1936 1936 #ifdef CONFIG_BRIDGE_VLAN_FILTERING 1937 1937 DECLARE_STATIC_KEY_FALSE(br_mst_used); 1938 - static inline bool br_mst_is_enabled(struct net_bridge *br) 1938 + static inline bool br_mst_is_enabled(const struct net_bridge_port *p) 1939 1939 { 1940 + /* check the port's vlan group to avoid racing with port deletion */ 1940 1941 return static_branch_unlikely(&br_mst_used) && 1941 - br_opt_get(br, BROPT_MST_ENABLED); 1942 + br_opt_get(p->br, BROPT_MST_ENABLED) && 1943 + rcu_access_pointer(p->vlgrp); 1942 1944 } 1943 1945 1944 1946 int br_mst_set_state(struct net_bridge_port *p, u16 msti, u8 state, ··· 1954 1952 const struct net_bridge_vlan_group *vg); 1955 1953 int br_mst_process(struct net_bridge_port *p, const struct nlattr *mst_attr, 1956 1954 struct netlink_ext_ack *extack); 1955 + void br_mst_uninit(struct net_bridge *br); 1957 1956 #else 1958 - static inline bool br_mst_is_enabled(struct net_bridge *br) 1957 + static inline bool br_mst_is_enabled(const struct net_bridge_port *p) 1959 1958 { 1960 1959 return false; 1961 1960 } ··· 1989 1986 struct netlink_ext_ack *extack) 1990 1987 { 1991 1988 return -EOPNOTSUPP; 1989 + } 1990 + 1991 + static inline void br_mst_uninit(struct net_bridge *br) 1992 + { 1992 1993 } 1993 1994 #endif 1994 1995
+2 -1
net/core/filter.c
··· 3877 3877 u32 new_len = skb->len + head_room; 3878 3878 int ret; 3879 3879 3880 - if (unlikely(flags || (!skb_is_gso(skb) && new_len > max_len) || 3880 + if (unlikely(flags || (int)head_room < 0 || 3881 + (!skb_is_gso(skb) && new_len > max_len) || 3881 3882 new_len < skb->len)) 3882 3883 return -EINVAL; 3883 3884
+2 -2
net/core/gro_cells.c
··· 60 60 struct sk_buff *skb; 61 61 int work_done = 0; 62 62 63 - __local_lock_nested_bh(&cell->bh_lock); 64 63 while (work_done < budget) { 64 + __local_lock_nested_bh(&cell->bh_lock); 65 65 skb = __skb_dequeue(&cell->napi_skbs); 66 + __local_unlock_nested_bh(&cell->bh_lock); 66 67 if (!skb) 67 68 break; 68 69 napi_gro_receive(napi, skb); ··· 72 71 73 72 if (work_done < budget) 74 73 napi_complete_done(napi, work_done); 75 - __local_unlock_nested_bh(&cell->bh_lock); 76 74 return work_done; 77 75 } 78 76
+2 -5
net/core/netpoll.c
··· 228 228 { 229 229 struct sk_buff_head *skb_pool; 230 230 struct sk_buff *skb; 231 - unsigned long flags; 232 231 233 232 skb_pool = &np->skb_pool; 234 233 235 - spin_lock_irqsave(&skb_pool->lock, flags); 236 - while (skb_pool->qlen < MAX_SKBS) { 234 + while (READ_ONCE(skb_pool->qlen) < MAX_SKBS) { 237 235 skb = alloc_skb(MAX_SKB_SIZE, GFP_ATOMIC); 238 236 if (!skb) 239 237 break; 240 238 241 - __skb_queue_tail(skb_pool, skb); 239 + skb_queue_tail(skb_pool, skb); 242 240 } 243 - spin_unlock_irqrestore(&skb_pool->lock, flags); 244 241 } 245 242 246 243 static void zap_completion_queue(void)
+8 -2
net/dsa/tag_brcm.c
··· 224 224 { 225 225 int len = BRCM_LEG_TAG_LEN; 226 226 int source_port; 227 + __be16 *proto; 227 228 u8 *brcm_tag; 228 229 229 230 if (unlikely(!pskb_may_pull(skb, BRCM_LEG_TAG_LEN + VLAN_HLEN))) 230 231 return NULL; 231 232 232 233 brcm_tag = dsa_etype_header_pos_rx(skb); 234 + proto = (__be16 *)(brcm_tag + BRCM_LEG_TAG_LEN); 233 235 234 236 source_port = brcm_tag[5] & BRCM_LEG_PORT_ID; 235 237 ··· 239 237 if (!skb->dev) 240 238 return NULL; 241 239 242 - /* VLAN tag is added by BCM63xx internal switch */ 243 - if (netdev_uses_dsa(skb->dev)) 240 + /* The internal switch in BCM63XX SoCs always tags on egress on the CPU 241 + * port. We use VID 0 internally for untagged traffic, so strip the tag 242 + * if the TCI field is all 0, and keep it otherwise to also retain 243 + * e.g. 802.1p tagged packets. 244 + */ 245 + if (proto[0] == htons(ETH_P_8021Q) && proto[1] == 0) 244 246 len += VLAN_HLEN; 245 247 246 248 /* Remove Broadcom tag and update checksum */
+1 -1
net/mac80211/chan.c
··· 1290 1290 &link->csa.finalize_work); 1291 1291 break; 1292 1292 case NL80211_IFTYPE_STATION: 1293 - wiphy_delayed_work_queue(sdata->local->hw.wiphy, 1293 + wiphy_hrtimer_work_queue(sdata->local->hw.wiphy, 1294 1294 &link->u.mgd.csa.switch_work, 0); 1295 1295 break; 1296 1296 case NL80211_IFTYPE_UNSPECIFIED:
+4 -4
net/mac80211/ieee80211_i.h
··· 612 612 u8 *assoc_req_ies; 613 613 size_t assoc_req_ies_len; 614 614 615 - struct wiphy_delayed_work ml_reconf_work; 615 + struct wiphy_hrtimer_work ml_reconf_work; 616 616 u16 removed_links; 617 617 618 618 /* TID-to-link mapping support */ 619 - struct wiphy_delayed_work ttlm_work; 619 + struct wiphy_hrtimer_work ttlm_work; 620 620 struct ieee80211_adv_ttlm_info ttlm_info; 621 621 struct wiphy_work teardown_ttlm_work; 622 622 ··· 1017 1017 bool operating_11g_mode; 1018 1018 1019 1019 struct { 1020 - struct wiphy_delayed_work switch_work; 1020 + struct wiphy_hrtimer_work switch_work; 1021 1021 struct cfg80211_chan_def ap_chandef; 1022 1022 struct ieee80211_parsed_tpe tpe; 1023 - unsigned long time; 1023 + ktime_t time; 1024 1024 bool waiting_bcn; 1025 1025 bool ignored_same_chan; 1026 1026 bool blocked_tx;
+2 -2
net/mac80211/link.c
··· 472 472 * from there. 473 473 */ 474 474 if (link->conf->csa_active) 475 - wiphy_delayed_work_queue(local->hw.wiphy, 475 + wiphy_hrtimer_work_queue(local->hw.wiphy, 476 476 &link->u.mgd.csa.switch_work, 477 477 link->u.mgd.csa.time - 478 - jiffies); 478 + ktime_get_boottime()); 479 479 } 480 480 481 481 for_each_set_bit(link_id, &add, IEEE80211_MLD_MAX_NUM_LINKS) {
+26 -26
net/mac80211/mlme.c
··· 45 45 #define IEEE80211_ASSOC_TIMEOUT_SHORT (HZ / 10) 46 46 #define IEEE80211_ASSOC_MAX_TRIES 3 47 47 48 - #define IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS msecs_to_jiffies(100) 48 + #define IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS (100 * USEC_PER_MSEC) 49 49 #define IEEE80211_ADV_TTLM_ST_UNDERFLOW 0xff00 50 50 51 51 #define IEEE80211_NEG_TTLM_REQ_TIMEOUT (HZ / 5) ··· 2604 2604 return; 2605 2605 } 2606 2606 2607 - wiphy_delayed_work_queue(sdata->local->hw.wiphy, 2607 + wiphy_hrtimer_work_queue(sdata->local->hw.wiphy, 2608 2608 &link->u.mgd.csa.switch_work, 0); 2609 2609 } 2610 2610 ··· 2763 2763 .timestamp = timestamp, 2764 2764 .device_timestamp = device_timestamp, 2765 2765 }; 2766 - unsigned long now; 2766 + u32 csa_time_tu; 2767 + ktime_t now; 2767 2768 int res; 2768 2769 2769 2770 lockdep_assert_wiphy(local->hw.wiphy); ··· 2994 2993 csa_ie.mode); 2995 2994 2996 2995 /* we may have to handle timeout for deactivated link in software */ 2997 - now = jiffies; 2998 - link->u.mgd.csa.time = now + 2999 - TU_TO_JIFFIES((max_t(int, csa_ie.count, 1) - 1) * 3000 - link->conf->beacon_int); 2996 + now = ktime_get_boottime(); 2997 + csa_time_tu = (max_t(int, csa_ie.count, 1) - 1) * link->conf->beacon_int; 2998 + link->u.mgd.csa.time = now + us_to_ktime(ieee80211_tu_to_usec(csa_time_tu)); 3001 2999 3002 3000 if (ieee80211_vif_link_active(&sdata->vif, link->link_id) && 3003 3001 local->ops->channel_switch) { ··· 3011 3011 } 3012 3012 3013 3013 /* channel switch handled in software */ 3014 - wiphy_delayed_work_queue(local->hw.wiphy, 3014 + wiphy_hrtimer_work_queue(local->hw.wiphy, 3015 3015 &link->u.mgd.csa.switch_work, 3016 3016 link->u.mgd.csa.time - now); 3017 3017 return; ··· 4252 4252 4253 4253 memset(&sdata->u.mgd.ttlm_info, 0, 4254 4254 sizeof(sdata->u.mgd.ttlm_info)); 4255 - wiphy_delayed_work_cancel(sdata->local->hw.wiphy, &ifmgd->ttlm_work); 4255 + wiphy_hrtimer_work_cancel(sdata->local->hw.wiphy, &ifmgd->ttlm_work); 4256 4256 4257 4257 memset(&sdata->vif.neg_ttlm, 0, sizeof(sdata->vif.neg_ttlm)); 4258 4258 wiphy_delayed_work_cancel(sdata->local->hw.wiphy, 4259 4259 &ifmgd->neg_ttlm_timeout_work); 4260 4260 4261 4261 sdata->u.mgd.removed_links = 0; 4262 - wiphy_delayed_work_cancel(sdata->local->hw.wiphy, 4262 + wiphy_hrtimer_work_cancel(sdata->local->hw.wiphy, 4263 4263 &sdata->u.mgd.ml_reconf_work); 4264 4264 4265 4265 wiphy_work_cancel(sdata->local->hw.wiphy, ··· 6886 6886 /* In case the removal was cancelled, abort it */ 6887 6887 if (sdata->u.mgd.removed_links) { 6888 6888 sdata->u.mgd.removed_links = 0; 6889 - wiphy_delayed_work_cancel(sdata->local->hw.wiphy, 6889 + wiphy_hrtimer_work_cancel(sdata->local->hw.wiphy, 6890 6890 &sdata->u.mgd.ml_reconf_work); 6891 6891 } 6892 6892 return; ··· 6916 6916 } 6917 6917 6918 6918 sdata->u.mgd.removed_links = removed_links; 6919 - wiphy_delayed_work_queue(sdata->local->hw.wiphy, 6919 + wiphy_hrtimer_work_queue(sdata->local->hw.wiphy, 6920 6920 &sdata->u.mgd.ml_reconf_work, 6921 - TU_TO_JIFFIES(delay)); 6921 + us_to_ktime(ieee80211_tu_to_usec(delay))); 6922 6922 } 6923 6923 6924 6924 static int ieee80211_ttlm_set_links(struct ieee80211_sub_if_data *sdata, ··· 7105 7105 /* if a planned TID-to-link mapping was cancelled - 7106 7106 * abort it 7107 7107 */ 7108 - wiphy_delayed_work_cancel(sdata->local->hw.wiphy, 7108 + wiphy_hrtimer_work_cancel(sdata->local->hw.wiphy, 7109 7109 &sdata->u.mgd.ttlm_work); 7110 7110 } else if (sdata->u.mgd.ttlm_info.active) { 7111 7111 /* if no TID-to-link element, set to default mapping in ··· 7140 7140 7141 7141 if (ttlm_info.switch_time) { 7142 7142 u16 beacon_ts_tu, st_tu, delay; 7143 - u32 delay_jiffies; 7143 + u64 delay_usec; 7144 7144 u64 mask; 7145 7145 7146 7146 /* The t2l map switch time is indicated with a partial ··· 7162 7162 if (delay > IEEE80211_ADV_TTLM_ST_UNDERFLOW) 7163 7163 return; 7164 7164 7165 - delay_jiffies = TU_TO_JIFFIES(delay); 7165 + delay_usec = ieee80211_tu_to_usec(delay); 7166 7166 7167 7167 /* Link switching can take time, so schedule it 7168 7168 * 100ms before to be ready on time 7169 7169 */ 7170 - if (delay_jiffies > IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS) 7171 - delay_jiffies -= 7170 + if (delay_usec > IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS) 7171 + delay_usec -= 7172 7172 IEEE80211_ADV_TTLM_SAFETY_BUFFER_MS; 7173 7173 else 7174 - delay_jiffies = 0; 7174 + delay_usec = 0; 7175 7175 7176 7176 sdata->u.mgd.ttlm_info = ttlm_info; 7177 - wiphy_delayed_work_cancel(sdata->local->hw.wiphy, 7177 + wiphy_hrtimer_work_cancel(sdata->local->hw.wiphy, 7178 7178 &sdata->u.mgd.ttlm_work); 7179 - wiphy_delayed_work_queue(sdata->local->hw.wiphy, 7179 + wiphy_hrtimer_work_queue(sdata->local->hw.wiphy, 7180 7180 &sdata->u.mgd.ttlm_work, 7181 - delay_jiffies); 7181 + us_to_ktime(delay_usec)); 7182 7182 return; 7183 7183 } 7184 7184 } ··· 8803 8803 ieee80211_csa_connection_drop_work); 8804 8804 wiphy_delayed_work_init(&ifmgd->tdls_peer_del_work, 8805 8805 ieee80211_tdls_peer_del_work); 8806 - wiphy_delayed_work_init(&ifmgd->ml_reconf_work, 8806 + wiphy_hrtimer_work_init(&ifmgd->ml_reconf_work, 8807 8807 ieee80211_ml_reconf_work); 8808 8808 wiphy_delayed_work_init(&ifmgd->reconf.wk, 8809 8809 ieee80211_ml_sta_reconf_timeout); ··· 8812 8812 timer_setup(&ifmgd->conn_mon_timer, ieee80211_sta_conn_mon_timer, 0); 8813 8813 wiphy_delayed_work_init(&ifmgd->tx_tspec_wk, 8814 8814 ieee80211_sta_handle_tspec_ac_params_wk); 8815 - wiphy_delayed_work_init(&ifmgd->ttlm_work, 8815 + wiphy_hrtimer_work_init(&ifmgd->ttlm_work, 8816 8816 ieee80211_tid_to_link_map_work); 8817 8817 wiphy_delayed_work_init(&ifmgd->neg_ttlm_timeout_work, 8818 8818 ieee80211_neg_ttlm_timeout_work); ··· 8859 8859 else 8860 8860 link->u.mgd.req_smps = IEEE80211_SMPS_OFF; 8861 8861 8862 - wiphy_delayed_work_init(&link->u.mgd.csa.switch_work, 8862 + wiphy_hrtimer_work_init(&link->u.mgd.csa.switch_work, 8863 8863 ieee80211_csa_switch_work); 8864 8864 8865 8865 ieee80211_clear_tpe(&link->conf->tpe); ··· 10074 10074 &link->u.mgd.request_smps_work); 10075 10075 wiphy_work_cancel(link->sdata->local->hw.wiphy, 10076 10076 &link->u.mgd.recalc_smps); 10077 - wiphy_delayed_work_cancel(link->sdata->local->hw.wiphy, 10077 + wiphy_hrtimer_work_cancel(link->sdata->local->hw.wiphy, 10078 10078 &link->u.mgd.csa.switch_work); 10079 10079 } 10080 10080
+17 -6
net/sctp/diag.c
··· 73 73 struct nlattr *attr; 74 74 void *info = NULL; 75 75 76 + rcu_read_lock(); 76 77 list_for_each_entry_rcu(laddr, address_list, list) 77 78 addrcnt++; 79 + rcu_read_unlock(); 78 80 79 81 attr = nla_reserve(skb, INET_DIAG_LOCALS, addrlen * addrcnt); 80 82 if (!attr) 81 83 return -EMSGSIZE; 82 84 83 85 info = nla_data(attr); 86 + rcu_read_lock(); 84 87 list_for_each_entry_rcu(laddr, address_list, list) { 85 88 memcpy(info, &laddr->a, sizeof(laddr->a)); 86 89 memset(info + sizeof(laddr->a), 0, addrlen - sizeof(laddr->a)); 87 90 info += addrlen; 91 + 92 + if (!--addrcnt) 93 + break; 88 94 } 95 + rcu_read_unlock(); 89 96 90 97 return 0; 91 98 } ··· 230 223 bool net_admin; 231 224 }; 232 225 233 - static size_t inet_assoc_attr_size(struct sctp_association *asoc) 226 + static size_t inet_assoc_attr_size(struct sock *sk, 227 + struct sctp_association *asoc) 234 228 { 235 229 int addrlen = sizeof(struct sockaddr_storage); 236 230 int addrcnt = 0; 237 231 struct sctp_sockaddr_entry *laddr; 238 232 239 233 list_for_each_entry_rcu(laddr, &asoc->base.bind_addr.address_list, 240 - list) 234 + list, lockdep_sock_is_held(sk)) 241 235 addrcnt++; 242 236 243 237 return nla_total_size(sizeof(struct sctp_info)) ··· 264 256 if (err) 265 257 return err; 266 258 267 - rep = nlmsg_new(inet_assoc_attr_size(assoc), GFP_KERNEL); 268 - if (!rep) 269 - return -ENOMEM; 270 - 271 259 lock_sock(sk); 260 + 261 + rep = nlmsg_new(inet_assoc_attr_size(sk, assoc), GFP_KERNEL); 262 + if (!rep) { 263 + release_sock(sk); 264 + return -ENOMEM; 265 + } 266 + 272 267 if (ep != assoc->ep) { 273 268 err = -EAGAIN; 274 269 goto out;
+6 -15
net/sctp/transport.c
··· 37 37 /* 1st Level Abstractions. */ 38 38 39 39 /* Initialize a new transport from provided memory. */ 40 - static struct sctp_transport *sctp_transport_init(struct net *net, 41 - struct sctp_transport *peer, 42 - const union sctp_addr *addr, 43 - gfp_t gfp) 40 + static void sctp_transport_init(struct net *net, 41 + struct sctp_transport *peer, 42 + const union sctp_addr *addr, 43 + gfp_t gfp) 44 44 { 45 45 /* Copy in the address. */ 46 46 peer->af_specific = sctp_get_af_specific(addr->sa.sa_family); ··· 83 83 get_random_bytes(&peer->hb_nonce, sizeof(peer->hb_nonce)); 84 84 85 85 refcount_set(&peer->refcnt, 1); 86 - 87 - return peer; 88 86 } 89 87 90 88 /* Allocate and initialize a new transport. */ ··· 94 96 95 97 transport = kzalloc(sizeof(*transport), gfp); 96 98 if (!transport) 97 - goto fail; 99 + return NULL; 98 100 99 - if (!sctp_transport_init(net, transport, addr, gfp)) 100 - goto fail_init; 101 + sctp_transport_init(net, transport, addr, gfp); 101 102 102 103 SCTP_DBG_OBJCNT_INC(transport); 103 104 104 105 return transport; 105 - 106 - fail_init: 107 - kfree(transport); 108 - 109 - fail: 110 - return NULL; 111 106 } 112 107 113 108 /* This transport is no longer needed. Free up if possible, or
+56
net/wireless/core.c
··· 1802 1802 } 1803 1803 EXPORT_SYMBOL_GPL(wiphy_delayed_work_pending); 1804 1804 1805 + enum hrtimer_restart wiphy_hrtimer_work_timer(struct hrtimer *t) 1806 + { 1807 + struct wiphy_hrtimer_work *hrwork = 1808 + container_of(t, struct wiphy_hrtimer_work, timer); 1809 + 1810 + wiphy_work_queue(hrwork->wiphy, &hrwork->work); 1811 + 1812 + return HRTIMER_NORESTART; 1813 + } 1814 + EXPORT_SYMBOL_GPL(wiphy_hrtimer_work_timer); 1815 + 1816 + void wiphy_hrtimer_work_queue(struct wiphy *wiphy, 1817 + struct wiphy_hrtimer_work *hrwork, 1818 + ktime_t delay) 1819 + { 1820 + trace_wiphy_hrtimer_work_queue(wiphy, &hrwork->work, delay); 1821 + 1822 + if (!delay) { 1823 + hrtimer_cancel(&hrwork->timer); 1824 + wiphy_work_queue(wiphy, &hrwork->work); 1825 + return; 1826 + } 1827 + 1828 + hrwork->wiphy = wiphy; 1829 + hrtimer_start_range_ns(&hrwork->timer, delay, 1830 + 1000 * NSEC_PER_USEC, HRTIMER_MODE_REL); 1831 + } 1832 + EXPORT_SYMBOL_GPL(wiphy_hrtimer_work_queue); 1833 + 1834 + void wiphy_hrtimer_work_cancel(struct wiphy *wiphy, 1835 + struct wiphy_hrtimer_work *hrwork) 1836 + { 1837 + lockdep_assert_held(&wiphy->mtx); 1838 + 1839 + hrtimer_cancel(&hrwork->timer); 1840 + wiphy_work_cancel(wiphy, &hrwork->work); 1841 + } 1842 + EXPORT_SYMBOL_GPL(wiphy_hrtimer_work_cancel); 1843 + 1844 + void wiphy_hrtimer_work_flush(struct wiphy *wiphy, 1845 + struct wiphy_hrtimer_work *hrwork) 1846 + { 1847 + lockdep_assert_held(&wiphy->mtx); 1848 + 1849 + hrtimer_cancel(&hrwork->timer); 1850 + wiphy_work_flush(wiphy, &hrwork->work); 1851 + } 1852 + EXPORT_SYMBOL_GPL(wiphy_hrtimer_work_flush); 1853 + 1854 + bool wiphy_hrtimer_work_pending(struct wiphy *wiphy, 1855 + struct wiphy_hrtimer_work *hrwork) 1856 + { 1857 + return hrtimer_is_queued(&hrwork->timer); 1858 + } 1859 + EXPORT_SYMBOL_GPL(wiphy_hrtimer_work_pending); 1860 + 1805 1861 static int __init cfg80211_init(void) 1806 1862 { 1807 1863 int err;
+21
net/wireless/trace.h
··· 304 304 __entry->delay) 305 305 ); 306 306 307 + TRACE_EVENT(wiphy_hrtimer_work_queue, 308 + TP_PROTO(struct wiphy *wiphy, struct wiphy_work *work, 309 + ktime_t delay), 310 + TP_ARGS(wiphy, work, delay), 311 + TP_STRUCT__entry( 312 + WIPHY_ENTRY 313 + __field(void *, instance) 314 + __field(void *, func) 315 + __field(ktime_t, delay) 316 + ), 317 + TP_fast_assign( 318 + WIPHY_ASSIGN; 319 + __entry->instance = work; 320 + __entry->func = work->func; 321 + __entry->delay = delay; 322 + ), 323 + TP_printk(WIPHY_PR_FMT " instance=%p func=%pS delay=%llu", 324 + WIPHY_PR_ARG, __entry->instance, __entry->func, 325 + __entry->delay) 326 + ); 327 + 307 328 TRACE_EVENT(wiphy_work_worker_start, 308 329 TP_PROTO(struct wiphy *wiphy), 309 330 TP_ARGS(wiphy),
+14 -1
rust/Makefile
··· 69 69 # the time being (https://github.com/rust-lang/rust/issues/144521). 70 70 rustdoc_modifiers_workaround := $(if $(call rustc-min-version,108800),-Cunsafe-allow-abi-mismatch=fixed-x18) 71 71 72 + # Similarly, for doctests (https://github.com/rust-lang/rust/issues/146465). 73 + doctests_modifiers_workaround := $(rustdoc_modifiers_workaround)$(if $(call rustc-min-version,109100),$(comma)sanitizer) 74 + 72 75 # `rustc` recognizes `--remap-path-prefix` since 1.26.0, but `rustdoc` only 73 76 # since Rust 1.81.0. Moreover, `rustdoc` ICEs on out-of-tree builds since Rust 74 77 # 1.82.0 (https://github.com/rust-lang/rust/issues/138520). Thus workaround both ··· 130 127 rustdoc-core: $(RUST_LIB_SRC)/core/src/lib.rs rustdoc-clean FORCE 131 128 +$(call if_changed,rustdoc) 132 129 130 + # Even if `rustdoc` targets are not kernel objects, they should still be 131 + # treated as such so that we pass the same flags. Otherwise, for instance, 132 + # `rustdoc` will complain about missing sanitizer flags causing an ABI mismatch. 133 + rustdoc-compiler_builtins: private is-kernel-object := y 133 134 rustdoc-compiler_builtins: $(src)/compiler_builtins.rs rustdoc-core FORCE 134 135 +$(call if_changed,rustdoc) 135 136 137 + rustdoc-ffi: private is-kernel-object := y 136 138 rustdoc-ffi: $(src)/ffi.rs rustdoc-core FORCE 137 139 +$(call if_changed,rustdoc) 138 140 ··· 155 147 rustdoc-macros FORCE 156 148 +$(call if_changed,rustdoc) 157 149 150 + rustdoc-kernel: private is-kernel-object := y 158 151 rustdoc-kernel: private rustc_target_flags = --extern ffi --extern pin_init \ 159 152 --extern build_error --extern macros \ 160 153 --extern bindings --extern uapi ··· 239 230 --extern bindings --extern uapi \ 240 231 --no-run --crate-name kernel -Zunstable-options \ 241 232 --sysroot=/dev/null \ 242 - $(rustdoc_modifiers_workaround) \ 233 + $(doctests_modifiers_workaround) \ 243 234 --test-builder $(objtree)/scripts/rustdoc_test_builder \ 244 235 $< $(rustdoc_test_kernel_quiet); \ 245 236 $(objtree)/scripts/rustdoc_test_gen ··· 531 522 $(obj)/$(libpin_init_internal_name) $(obj)/$(libmacros_name) FORCE 532 523 +$(call if_changed_rule,rustc_library) 533 524 525 + # Even if normally `build_error` is not a kernel object, it should still be 526 + # treated as such so that we pass the same flags. Otherwise, for instance, 527 + # `rustc` will complain about missing sanitizer flags causing an ABI mismatch. 528 + $(obj)/build_error.o: private is-kernel-object := y 534 529 $(obj)/build_error.o: private skip_gendwarfksyms = 1 535 530 $(obj)/build_error.o: $(src)/build_error.rs $(obj)/compiler_builtins.o FORCE 536 531 +$(call if_changed_rule,rustc_library)
+1 -1
rust/kernel/devres.rs
··· 103 103 /// 104 104 /// # Invariants 105 105 /// 106 - /// [`Self::inner`] is guaranteed to be initialized and is always accessed read-only. 106 + /// `Self::inner` is guaranteed to be initialized and is always accessed read-only. 107 107 #[pin_data(PinnedDrop)] 108 108 pub struct Devres<T: Send> { 109 109 dev: ARef<Device>,
+1 -1
rust/kernel/sync/condvar.rs
··· 36 36 /// spuriously. 37 37 /// 38 38 /// Instances of [`CondVar`] need a lock class and to be pinned. The recommended way to create such 39 - /// instances is with the [`pin_init`](crate::pin_init!) and [`new_condvar`] macros. 39 + /// instances is with the [`pin_init`](pin_init::pin_init!) and [`new_condvar`] macros. 40 40 /// 41 41 /// # Examples 42 42 ///
+3
scripts/kconfig/mconf.c
··· 12 12 #include <errno.h> 13 13 #include <fcntl.h> 14 14 #include <limits.h> 15 + #include <locale.h> 15 16 #include <stdarg.h> 16 17 #include <stdlib.h> 17 18 #include <string.h> ··· 931 930 int res; 932 931 933 932 signal(SIGINT, sig_handler); 933 + 934 + setlocale(LC_ALL, ""); 934 935 935 936 if (ac > 1 && strcmp(av[1], "-s") == 0) { 936 937 silent = 1;
+3
scripts/kconfig/nconf.c
··· 7 7 #ifndef _GNU_SOURCE 8 8 #define _GNU_SOURCE 9 9 #endif 10 + #include <locale.h> 10 11 #include <string.h> 11 12 #include <strings.h> 12 13 #include <stdlib.h> ··· 1478 1477 { 1479 1478 int lines, columns; 1480 1479 char *mode; 1480 + 1481 + setlocale(LC_ALL, ""); 1481 1482 1482 1483 if (ac > 1 && strcmp(av[1], "-s") == 0) { 1483 1484 /* Silence conf_read() until the real callback is set up */
+1 -1
scripts/package/install-extmod-build
··· 63 63 # Clear VPATH and srcroot because the source files reside in the output 64 64 # directory. 65 65 # shellcheck disable=SC2016 # $(MAKE) and $(build) will be expanded by Make 66 - "${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC='"${CC}"' VPATH= srcroot=. $(build)='"$(realpath --relative-base=. "${destdir}")"/scripts 66 + "${MAKE}" run-command KBUILD_RUN_COMMAND='+$(MAKE) HOSTCC='"${CC}"' VPATH= srcroot=. $(build)='"$(realpath --relative-to=. "${destdir}")"/scripts 67 67 68 68 rm -f "${destdir}/scripts/Kbuild" 69 69 fi
+14
sound/hda/codecs/realtek/alc269.c
··· 3736 3736 ALC285_FIXUP_ASUS_GA605K_I2C_SPEAKER2_TO_DAC1, 3737 3737 ALC269_FIXUP_POSITIVO_P15X_HEADSET_MIC, 3738 3738 ALC289_FIXUP_ASUS_ZEPHYRUS_DUAL_SPK, 3739 + ALC256_FIXUP_VAIO_RPL_MIC_NO_PRESENCE, 3739 3740 }; 3740 3741 3741 3742 /* A special fixup for Lenovo C940 and Yoga Duet 7; ··· 6173 6172 { 0x1e, 0x90170150 }, /* Internal Speaker */ 6174 6173 { } 6175 6174 }, 6175 + }, 6176 + [ALC256_FIXUP_VAIO_RPL_MIC_NO_PRESENCE] = { 6177 + .type = HDA_FIXUP_PINS, 6178 + .v.pins = (const struct hda_pintbl[]) { 6179 + { 0x19, 0x03a1113c }, /* use as headset mic, without its own jack detect */ 6180 + { 0x1a, 0x22a190a0 }, /* dock mic */ 6181 + { } 6182 + }, 6183 + .chained = true, 6184 + .chain_id = ALC269_FIXUP_LIMIT_INT_MIC_BOOST 6176 6185 } 6177 6186 }; 6178 6187 ··· 6589 6578 SND_PCI_QUIRK(0x103c, 0x8c16, "HP Spectre x360 2-in-1 Laptop 16-aa0xxx", ALC245_FIXUP_HP_SPECTRE_X360_16_AA0XXX), 6590 6579 SND_PCI_QUIRK(0x103c, 0x8c17, "HP Spectre 16", ALC287_FIXUP_CS35L41_I2C_2), 6591 6580 SND_PCI_QUIRK(0x103c, 0x8c21, "HP Pavilion Plus Laptop 14-ey0XXX", ALC245_FIXUP_HP_X360_MUTE_LEDS), 6581 + SND_PCI_QUIRK(0x103c, 0x8c2d, "HP Victus 15-fa1xxx (MB 8C2D)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 6592 6582 SND_PCI_QUIRK(0x103c, 0x8c30, "HP Victus 15-fb1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 6593 6583 SND_PCI_QUIRK(0x103c, 0x8c46, "HP EliteBook 830 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 6594 6584 SND_PCI_QUIRK(0x103c, 0x8c47, "HP EliteBook 840 G11", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), ··· 6971 6959 SND_PCI_QUIRK(0x1558, 0x971d, "Clevo N970T[CDF]", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 6972 6960 SND_PCI_QUIRK(0x1558, 0xa500, "Clevo NL5[03]RU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 6973 6961 SND_PCI_QUIRK(0x1558, 0xa554, "VAIO VJFH52", ALC269_FIXUP_VAIO_VJFH52_MIC_NO_PRESENCE), 6962 + SND_PCI_QUIRK(0x1558, 0xa559, "VAIO RPL", ALC256_FIXUP_VAIO_RPL_MIC_NO_PRESENCE), 6974 6963 SND_PCI_QUIRK(0x1558, 0xa600, "Clevo NL50NU", ALC293_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 6975 6964 SND_PCI_QUIRK(0x1558, 0xa650, "Clevo NP[567]0SN[CD]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), 6976 6965 SND_PCI_QUIRK(0x1558, 0xa671, "Clevo NP70SN[CDE]", ALC256_FIXUP_SYSTEM76_MIC_NO_PRESENCE), ··· 7093 7080 SND_PCI_QUIRK(0x17aa, 0x38a9, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 7094 7081 SND_PCI_QUIRK(0x17aa, 0x38ab, "Thinkbook 16P", ALC287_FIXUP_MG_RTKC_CSAMP_CS35L41_I2C_THINKPAD), 7095 7082 SND_PCI_QUIRK(0x17aa, 0x38b4, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2), 7083 + HDA_CODEC_QUIRK(0x17aa, 0x391c, "Lenovo Yoga 7 2-in-1 14AKP10", ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN), 7096 7084 SND_PCI_QUIRK(0x17aa, 0x38b5, "Legion Slim 7 16IRH8", ALC287_FIXUP_CS35L41_I2C_2), 7097 7085 SND_PCI_QUIRK(0x17aa, 0x38b6, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2), 7098 7086 SND_PCI_QUIRK(0x17aa, 0x38b7, "Legion Slim 7 16APH8", ALC287_FIXUP_CS35L41_I2C_2),
+157
sound/soc/amd/acp/amd-acp70-acpi-match.c
··· 30 30 .group_id = 1 31 31 }; 32 32 33 + static const struct snd_soc_acpi_endpoint spk_2_endpoint = { 34 + .num = 0, 35 + .aggregated = 1, 36 + .group_position = 2, 37 + .group_id = 1 38 + }; 39 + 40 + static const struct snd_soc_acpi_endpoint spk_3_endpoint = { 41 + .num = 0, 42 + .aggregated = 1, 43 + .group_position = 3, 44 + .group_id = 1 45 + }; 46 + 33 47 static const struct snd_soc_acpi_adr_device rt711_rt1316_group_adr[] = { 34 48 { 35 49 .adr = 0x000030025D071101ull, ··· 126 112 } 127 113 }; 128 114 115 + static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = { 116 + { /* Jack Playback Endpoint */ 117 + .num = 0, 118 + .aggregated = 0, 119 + .group_position = 0, 120 + .group_id = 0, 121 + }, 122 + { /* DMIC Capture Endpoint */ 123 + .num = 1, 124 + .aggregated = 0, 125 + .group_position = 0, 126 + .group_id = 0, 127 + }, 128 + { /* Jack Capture Endpoint */ 129 + .num = 2, 130 + .aggregated = 0, 131 + .group_position = 0, 132 + .group_id = 0, 133 + }, 134 + { /* Speaker Playback Endpoint */ 135 + .num = 3, 136 + .aggregated = 0, 137 + .group_position = 0, 138 + .group_id = 0, 139 + }, 140 + }; 141 + 142 + static const struct snd_soc_acpi_adr_device cs42l43_0_adr[] = { 143 + { 144 + .adr = 0x00003001FA424301ull, 145 + .num_endpoints = ARRAY_SIZE(cs42l43_endpoints), 146 + .endpoints = cs42l43_endpoints, 147 + .name_prefix = "cs42l43" 148 + } 149 + }; 150 + 151 + static const struct snd_soc_acpi_adr_device cs42l43_1_cs35l56x4_1_adr[] = { 152 + { 153 + .adr = 0x00013001FA424301ull, 154 + .num_endpoints = ARRAY_SIZE(cs42l43_endpoints), 155 + .endpoints = cs42l43_endpoints, 156 + .name_prefix = "cs42l43" 157 + }, 158 + { 159 + .adr = 0x00013001FA355601ull, 160 + .num_endpoints = 1, 161 + .endpoints = &spk_l_endpoint, 162 + .name_prefix = "AMP1" 163 + }, 164 + { 165 + .adr = 0x00013101FA355601ull, 166 + .num_endpoints = 1, 167 + .endpoints = &spk_r_endpoint, 168 + .name_prefix = "AMP2" 169 + }, 170 + { 171 + .adr = 0x00013201FA355601ull, 172 + .num_endpoints = 1, 173 + .endpoints = &spk_2_endpoint, 174 + .name_prefix = "AMP3" 175 + }, 176 + { 177 + .adr = 0x00013301FA355601ull, 178 + .num_endpoints = 1, 179 + .endpoints = &spk_3_endpoint, 180 + .name_prefix = "AMP4" 181 + }, 182 + }; 183 + 184 + static const struct snd_soc_acpi_adr_device cs35l56x4_1_adr[] = { 185 + { 186 + .adr = 0x00013301FA355601ull, 187 + .num_endpoints = 1, 188 + .endpoints = &spk_l_endpoint, 189 + .name_prefix = "AMP1" 190 + }, 191 + { 192 + .adr = 0x00013201FA355601ull, 193 + .num_endpoints = 1, 194 + .endpoints = &spk_r_endpoint, 195 + .name_prefix = "AMP2" 196 + }, 197 + { 198 + .adr = 0x00013101FA355601ull, 199 + .num_endpoints = 1, 200 + .endpoints = &spk_2_endpoint, 201 + .name_prefix = "AMP3" 202 + }, 203 + { 204 + .adr = 0x00013001FA355601ull, 205 + .num_endpoints = 1, 206 + .endpoints = &spk_3_endpoint, 207 + .name_prefix = "AMP4" 208 + }, 209 + }; 210 + 211 + static const struct snd_soc_acpi_link_adr acp70_cs42l43_l1_cs35l56x4_l1[] = { 212 + { 213 + .mask = BIT(1), 214 + .num_adr = ARRAY_SIZE(cs42l43_1_cs35l56x4_1_adr), 215 + .adr_d = cs42l43_1_cs35l56x4_1_adr, 216 + }, 217 + {} 218 + }; 219 + 220 + static const struct snd_soc_acpi_link_adr acp70_cs42l43_l0_cs35l56x4_l1[] = { 221 + { 222 + .mask = BIT(0), 223 + .num_adr = ARRAY_SIZE(cs42l43_0_adr), 224 + .adr_d = cs42l43_0_adr, 225 + }, 226 + { 227 + .mask = BIT(1), 228 + .num_adr = ARRAY_SIZE(cs35l56x4_1_adr), 229 + .adr_d = cs35l56x4_1_adr, 230 + }, 231 + {} 232 + }; 233 + 234 + static const struct snd_soc_acpi_link_adr acp70_cs35l56x4_l1[] = { 235 + { 236 + .mask = BIT(1), 237 + .num_adr = ARRAY_SIZE(cs35l56x4_1_adr), 238 + .adr_d = cs35l56x4_1_adr, 239 + }, 240 + {} 241 + }; 242 + 129 243 static const struct snd_soc_acpi_link_adr acp70_rt722_only[] = { 130 244 { 131 245 .mask = BIT(0), ··· 291 149 { 292 150 .link_mask = BIT(0) | BIT(1), 293 151 .links = acp70_4_in_1_sdca, 152 + .drv_name = "amd_sdw", 153 + }, 154 + { 155 + .link_mask = BIT(0) | BIT(1), 156 + .links = acp70_cs42l43_l0_cs35l56x4_l1, 157 + .drv_name = "amd_sdw", 158 + }, 159 + { 160 + .link_mask = BIT(1), 161 + .links = acp70_cs42l43_l1_cs35l56x4_l1, 162 + .drv_name = "amd_sdw", 163 + }, 164 + { 165 + .link_mask = BIT(1), 166 + .links = acp70_cs35l56x4_l1, 294 167 .drv_name = "amd_sdw", 295 168 }, 296 169 {},
+1
sound/soc/codecs/cs-amp-lib-test.c
··· 7 7 8 8 #include <kunit/resource.h> 9 9 #include <kunit/test.h> 10 + #include <kunit/test-bug.h> 10 11 #include <kunit/static_stub.h> 11 12 #include <linux/device/faux.h> 12 13 #include <linux/firmware/cirrus/cs_dsp.h>
+1 -1
sound/soc/codecs/cs530x.c
··· 793 793 case CS530X_SYSCLK_SRC_PLL: 794 794 break; 795 795 default: 796 - dev_err(component->dev, "Invalid clock id %d\n", clk_id); 796 + dev_err(component->dev, "Invalid sysclk source: %d\n", source); 797 797 return -EINVAL; 798 798 } 799 799
+4 -2
sound/soc/codecs/max98090.c
··· 1239 1239 SND_SOC_DAPM_SUPPLY("DMIC4_ENA", M98090_REG_DIGITAL_MIC_ENABLE, 1240 1240 M98090_DIGMIC4_SHIFT, 0, max98090_shdn_event, 1241 1241 SND_SOC_DAPM_POST_PMU), 1242 + SND_SOC_DAPM_SUPPLY("DMIC34_HPF", M98090_REG_FILTER_CONFIG, 1243 + M98090_FLT_DMIC34HPF_SHIFT, 0, NULL, 0), 1242 1244 }; 1243 1245 1244 1246 static const struct snd_soc_dapm_route max98090_dapm_routes[] = { ··· 1429 1427 /* DMIC inputs */ 1430 1428 {"DMIC3", NULL, "DMIC3_ENA"}, 1431 1429 {"DMIC4", NULL, "DMIC4_ENA"}, 1432 - {"DMIC3", NULL, "AHPF"}, 1433 - {"DMIC4", NULL, "AHPF"}, 1430 + {"DMIC3", NULL, "DMIC34_HPF"}, 1431 + {"DMIC4", NULL, "DMIC34_HPF"}, 1434 1432 }; 1435 1433 1436 1434 static int max98090_add_widgets(struct snd_soc_component *component)
+4
sound/soc/codecs/rt721-sdca.c
··· 281 281 rt_sdca_index_write(rt721->mbq_regmap, RT721_BOOST_CTRL, 282 282 RT721_BST_4CH_TOP_GATING_CTRL1, 0x002a); 283 283 regmap_write(rt721->regmap, 0x2f58, 0x07); 284 + 285 + regmap_write(rt721->regmap, 0x2f51, 0x00); 286 + rt_sdca_index_write(rt721->mbq_regmap, RT721_HDA_SDCA_FLOAT, 287 + RT721_MISC_CTL, 0x0004); 284 288 } 285 289 286 290 static void rt721_sdca_jack_init(struct rt721_sdca_priv *rt721)
+1
sound/soc/codecs/rt721-sdca.h
··· 137 137 #define RT721_HDA_LEGACY_UAJ_CTL 0x02 138 138 #define RT721_HDA_LEGACY_CTL1 0x05 139 139 #define RT721_HDA_LEGACY_RESET_CTL 0x06 140 + #define RT721_MISC_CTL 0x07 140 141 #define RT721_XU_REL_CTRL 0x0c 141 142 #define RT721_GE_REL_CTRL1 0x0d 142 143 #define RT721_HDA_LEGACY_GPIO_WAKE_EN_CTL 0x0e
+2 -2
sound/soc/fsl/fsl_micfil.c
··· 131 131 .fifos = 8, 132 132 .fifo_depth = 32, 133 133 .dataline = 0xf, 134 - .formats = SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_DSD_U32_BE, 134 + .formats = SNDRV_PCM_FMTBIT_S32_LE | SNDRV_PCM_FMTBIT_DSD_U32_LE, 135 135 .use_edma = true, 136 136 .use_verid = true, 137 137 .volume_sx = false, ··· 823 823 break; 824 824 } 825 825 826 - if (format == SNDRV_PCM_FORMAT_DSD_U32_BE) { 826 + if (format == SNDRV_PCM_FORMAT_DSD_U32_LE) { 827 827 micfil->dec_bypass = true; 828 828 /* 829 829 * According to equation 29 in RM:
+5 -6
sound/soc/fsl/fsl_sai.c
··· 353 353 break; 354 354 case SND_SOC_DAIFMT_PDM: 355 355 val_cr2 |= FSL_SAI_CR2_BCP; 356 - val_cr4 &= ~FSL_SAI_CR4_MF; 357 356 sai->is_pdm_mode = true; 358 357 break; 359 358 case SND_SOC_DAIFMT_RIGHT_J: ··· 637 638 val_cr5 |= FSL_SAI_CR5_WNW(slot_width); 638 639 val_cr5 |= FSL_SAI_CR5_W0W(slot_width); 639 640 640 - if (sai->is_lsb_first || sai->is_pdm_mode) 641 + if (sai->is_lsb_first) 641 642 val_cr5 |= FSL_SAI_CR5_FBT(0); 642 643 else 643 644 val_cr5 |= FSL_SAI_CR5_FBT(word_width - 1); ··· 652 653 val_cr4 |= FSL_SAI_CR4_CHMOD; 653 654 654 655 /* 655 - * For SAI provider mode, when Tx(Rx) sync with Rx(Tx) clock, Rx(Tx) will 656 - * generate bclk and frame clock for Tx(Rx), we should set RCR4(TCR4), 657 - * RCR5(TCR5) for playback(capture), or there will be sync error. 656 + * When Tx(Rx) sync with Rx(Tx) clock, Rx(Tx) will provide bclk and 657 + * frame clock for Tx(Rx). We should set RCR4(TCR4), RCR5(TCR5) 658 + * for playback(capture), or there will be sync error. 658 659 */ 659 660 660 - if (!sai->is_consumer_mode[tx] && fsl_sai_dir_is_synced(sai, adir)) { 661 + if (fsl_sai_dir_is_synced(sai, adir)) { 661 662 regmap_update_bits(sai->regmap, FSL_SAI_xCR4(!tx, ofs), 662 663 FSL_SAI_CR4_SYWD_MASK | FSL_SAI_CR4_FRSZ_MASK | 663 664 FSL_SAI_CR4_CHMOD_MASK,
+3
sound/soc/intel/avs/pcm.c
··· 651 651 652 652 data = snd_soc_dai_get_dma_data(dai, substream); 653 653 654 + disable_work_sync(&data->period_elapsed_work); 654 655 snd_hdac_ext_stream_release(data->host_stream, HDAC_EXT_STREAM_TYPE_HOST); 655 656 avs_dai_shutdown(substream, dai); 656 657 } ··· 755 754 data = snd_soc_dai_get_dma_data(dai, substream); 756 755 host_stream = data->host_stream; 757 756 757 + if (runtime->state == SNDRV_PCM_STATE_XRUN) 758 + hdac_stream(host_stream)->prepared = false; 758 759 if (hdac_stream(host_stream)->prepared) 759 760 return 0; 760 761
+10 -8
sound/soc/intel/avs/probes.c
··· 14 14 #include "debug.h" 15 15 #include "messages.h" 16 16 17 - static int avs_dsp_init_probe(struct avs_dev *adev, union avs_connector_node_id node_id, 18 - size_t buffer_size) 17 + static int avs_dsp_init_probe(struct avs_dev *adev, struct snd_compr_params *params, int bps, 18 + union avs_connector_node_id node_id, size_t buffer_size) 19 19 { 20 20 struct avs_probe_cfg cfg = {{0}}; 21 21 struct avs_module_entry mentry; ··· 27 27 return ret; 28 28 29 29 /* 30 - * Probe module uses no cycles, audio data format and input and output 31 - * frame sizes are unused. It is also not owned by any pipeline. 30 + * Probe module uses no cycles, input and output frame sizes are unused. 31 + * It is also not owned by any pipeline. 32 32 */ 33 33 cfg.base.ibs = 1; 34 34 /* BSS module descriptor is always segment of index=2. */ 35 35 cfg.base.is_pages = mentry.segments[2].flags.length; 36 + cfg.base.audio_fmt.sampling_freq = params->codec.sample_rate; 37 + cfg.base.audio_fmt.bit_depth = bps; 38 + cfg.base.audio_fmt.num_channels = params->codec.ch_out; 39 + cfg.base.audio_fmt.valid_bit_depth = bps; 36 40 cfg.gtw_cfg.node_id = node_id; 37 41 cfg.gtw_cfg.dma_buffer_size = buffer_size; 38 42 ··· 132 128 struct hdac_ext_stream *host_stream = avs_compr_get_host_stream(cstream); 133 129 struct snd_compr_runtime *rtd = cstream->runtime; 134 130 struct avs_dev *adev = to_avs_dev(dai->dev); 135 - /* compr params do not store bit depth, default to S32_LE. */ 136 - snd_pcm_format_t format = SNDRV_PCM_FORMAT_S32_LE; 137 131 unsigned int format_val; 138 132 int bps, ret; 139 133 ··· 144 142 ret = snd_compr_malloc_pages(cstream, rtd->buffer_size); 145 143 if (ret < 0) 146 144 return ret; 147 - bps = snd_pcm_format_physical_width(format); 145 + bps = snd_pcm_format_physical_width(params->codec.format); 148 146 if (bps < 0) 149 147 return bps; 150 148 format_val = snd_hdac_stream_format(params->codec.ch_out, bps, params->codec.sample_rate); ··· 168 166 node_id.vindex = hdac_stream(host_stream)->stream_tag - 1; 169 167 node_id.dma_type = AVS_DMA_HDA_HOST_INPUT; 170 168 171 - ret = avs_dsp_init_probe(adev, node_id, rtd->dma_bytes); 169 + ret = avs_dsp_init_probe(adev, params, bps, node_id, rtd->dma_bytes); 172 170 if (ret < 0) { 173 171 dev_err(dai->dev, "probe init failed: %d\n", ret); 174 172 avs_dsp_enable_d0ix(adev);
-52
sound/soc/intel/common/soc-acpi-intel-ptl-match.c
··· 227 227 }, 228 228 }; 229 229 230 - static const struct snd_soc_acpi_endpoint cs42l43_endpoints[] = { 231 - { /* Jack Playback Endpoint */ 232 - .num = 0, 233 - .aggregated = 0, 234 - .group_position = 0, 235 - .group_id = 0, 236 - }, 237 - { /* DMIC Capture Endpoint */ 238 - .num = 1, 239 - .aggregated = 0, 240 - .group_position = 0, 241 - .group_id = 0, 242 - }, 243 - { /* Jack Capture Endpoint */ 244 - .num = 2, 245 - .aggregated = 0, 246 - .group_position = 0, 247 - .group_id = 0, 248 - }, 249 - { /* Speaker Playback Endpoint */ 250 - .num = 3, 251 - .aggregated = 0, 252 - .group_position = 0, 253 - .group_id = 0, 254 - }, 255 - }; 256 - 257 230 static const struct snd_soc_acpi_adr_device cs42l43_2_adr[] = { 258 231 { 259 232 .adr = 0x00023001fa424301ull, ··· 275 302 .num_endpoints = 1, 276 303 .endpoints = &spk_6_endpoint, 277 304 .name_prefix = "AMP6" 278 - } 279 - }; 280 - 281 - static const struct snd_soc_acpi_adr_device cs42l43_3_adr[] = { 282 - { 283 - .adr = 0x00033001FA424301ull, 284 - .num_endpoints = ARRAY_SIZE(cs42l43_endpoints), 285 - .endpoints = cs42l43_endpoints, 286 - .name_prefix = "cs42l43" 287 305 } 288 306 }; 289 307 ··· 446 482 .mask = BIT(3), 447 483 .num_adr = ARRAY_SIZE(cs35l56_3_3amp_adr), 448 484 .adr_d = cs35l56_3_3amp_adr, 449 - }, 450 - {} 451 - }; 452 - 453 - static const struct snd_soc_acpi_link_adr ptl_cs42l43_l3[] = { 454 - { 455 - .mask = BIT(3), 456 - .num_adr = ARRAY_SIZE(cs42l43_3_adr), 457 - .adr_d = cs42l43_3_adr, 458 485 }, 459 486 {} 460 487 }; ··· 665 710 .links = ptl_rt722_l1, 666 711 .drv_name = "sof_sdw", 667 712 .sof_tplg_filename = "sof-ptl-rt722.tplg", 668 - .get_function_tplg_files = sof_sdw_get_tplg_files, 669 - }, 670 - { 671 - .link_mask = BIT(3), 672 - .links = ptl_cs42l43_l3, 673 - .drv_name = "sof_sdw", 674 - .sof_tplg_filename = "sof-ptl-cs42l43-l3.tplg", 675 713 .get_function_tplg_files = sof_sdw_get_tplg_files, 676 714 }, 677 715 {
-1
sound/soc/mediatek/mt8195/mt8195-afe-pcm.c
··· 3176 3176 3177 3177 static void mt8195_afe_pcm_dev_remove(struct platform_device *pdev) 3178 3178 { 3179 - pm_runtime_disable(&pdev->dev); 3180 3179 if (!pm_runtime_status_suspended(&pdev->dev)) 3181 3180 mt8195_afe_runtime_suspend(&pdev->dev); 3182 3181 }
-1
sound/soc/mediatek/mt8365/mt8365-afe-pcm.c
··· 2238 2238 2239 2239 mt8365_afe_disable_top_cg(afe, MT8365_TOP_CG_AFE); 2240 2240 2241 - pm_runtime_disable(&pdev->dev); 2242 2241 if (!pm_runtime_status_suspended(&pdev->dev)) 2243 2242 mt8365_afe_runtime_suspend(&pdev->dev); 2244 2243 }
+1 -1
sound/soc/qcom/qdsp6/q6asm.c
··· 377 377 378 378 spin_lock_irqsave(&ac->lock, flags); 379 379 port->num_periods = 0; 380 + spin_unlock_irqrestore(&ac->lock, flags); 380 381 kfree(port->buf); 381 382 port->buf = NULL; 382 - spin_unlock_irqrestore(&ac->lock, flags); 383 383 } 384 384 385 385 /**
+12 -13
sound/soc/renesas/rz-ssi.c
··· 85 85 struct snd_pcm_substream *substream; 86 86 int fifo_sample_size; /* sample capacity of SSI FIFO */ 87 87 int dma_buffer_pos; /* The address for the next DMA descriptor */ 88 + int completed_dma_buf_pos; /* The address of the last completed DMA descriptor. */ 88 89 int period_counter; /* for keeping track of periods transferred */ 89 90 int sample_width; 90 91 int buffer_pos; /* current frame position in the buffer */ ··· 216 215 rz_ssi_set_substream(strm, substream); 217 216 strm->sample_width = samples_to_bytes(runtime, 1); 218 217 strm->dma_buffer_pos = 0; 218 + strm->completed_dma_buf_pos = 0; 219 219 strm->period_counter = 0; 220 220 strm->buffer_pos = 0; 221 221 ··· 439 437 snd_pcm_period_elapsed(strm->substream); 440 438 strm->period_counter = current_period; 441 439 } 440 + 441 + strm->completed_dma_buf_pos += runtime->period_size; 442 + if (strm->completed_dma_buf_pos >= runtime->buffer_size) 443 + strm->completed_dma_buf_pos = 0; 442 444 } 443 445 444 446 static int rz_ssi_pio_recv(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm) ··· 784 778 return -ENODEV; 785 779 } 786 780 787 - static int rz_ssi_trigger_resume(struct rz_ssi_priv *ssi) 781 + static int rz_ssi_trigger_resume(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm) 788 782 { 783 + struct snd_pcm_substream *substream = strm->substream; 784 + struct snd_pcm_runtime *runtime = substream->runtime; 789 785 int ret; 786 + 787 + strm->dma_buffer_pos = strm->completed_dma_buf_pos + runtime->period_size; 790 788 791 789 if (rz_ssi_is_stream_running(&ssi->playback) || 792 790 rz_ssi_is_stream_running(&ssi->capture)) ··· 804 794 ssi->hw_params_cache.channels); 805 795 } 806 796 807 - static void rz_ssi_streams_suspend(struct rz_ssi_priv *ssi) 808 - { 809 - if (rz_ssi_is_stream_running(&ssi->playback) || 810 - rz_ssi_is_stream_running(&ssi->capture)) 811 - return; 812 - 813 - ssi->playback.dma_buffer_pos = 0; 814 - ssi->capture.dma_buffer_pos = 0; 815 - } 816 - 817 797 static int rz_ssi_dai_trigger(struct snd_pcm_substream *substream, int cmd, 818 798 struct snd_soc_dai *dai) 819 799 { ··· 813 813 814 814 switch (cmd) { 815 815 case SNDRV_PCM_TRIGGER_RESUME: 816 - ret = rz_ssi_trigger_resume(ssi); 816 + ret = rz_ssi_trigger_resume(ssi, strm); 817 817 if (ret) 818 818 return ret; 819 819 ··· 852 852 853 853 case SNDRV_PCM_TRIGGER_SUSPEND: 854 854 rz_ssi_stop(ssi, strm); 855 - rz_ssi_streams_suspend(ssi); 856 855 break; 857 856 858 857 case SNDRV_PCM_TRIGGER_STOP:
-1
sound/soc/sdw_utils/soc_sdw_utils.c
··· 638 638 { 639 639 .direction = {true, false}, 640 640 .dai_name = "cs42l43-dp6", 641 - .component_name = "cs42l43", 642 641 .dai_type = SOC_SDW_DAI_TYPE_AMP, 643 642 .dailink = {SOC_SDW_AMP_OUT_DAI_ID, SOC_SDW_UNUSED_DAI_ID}, 644 643 .init = asoc_sdw_cs42l43_spk_init,
+20 -17
sound/usb/mixer_s1810c.c
··· 178 178 179 179 pkt_out.fields[SC1810C_STATE_F1_IDX] = SC1810C_SET_STATE_F1; 180 180 pkt_out.fields[SC1810C_STATE_F2_IDX] = SC1810C_SET_STATE_F2; 181 - ret = snd_usb_ctl_msg(dev, usb_rcvctrlpipe(dev, 0), 181 + ret = snd_usb_ctl_msg(dev, usb_sndctrlpipe(dev, 0), 182 182 SC1810C_SET_STATE_REQ, 183 183 SC1810C_SET_STATE_REQTYPE, 184 184 (*seqnum), 0, &pkt_out, sizeof(pkt_out)); ··· 597 597 if (!list_empty(&chip->mixer_list)) 598 598 return 0; 599 599 600 - dev_info(&dev->dev, 601 - "Presonus Studio 1810c, device_setup: %u\n", chip->setup); 602 - if (chip->setup == 1) 603 - dev_info(&dev->dev, "(8out/18in @ 48kHz)\n"); 604 - else if (chip->setup == 2) 605 - dev_info(&dev->dev, "(6out/8in @ 192kHz)\n"); 606 - else 607 - dev_info(&dev->dev, "(8out/14in @ 96kHz)\n"); 608 - 609 600 ret = snd_s1810c_init_mixer_maps(chip); 610 601 if (ret < 0) 611 602 return ret; ··· 625 634 if (ret < 0) 626 635 return ret; 627 636 628 - // The 1824c has a Mono Main switch instead of a 629 - // A/B select switch. 630 - if (mixer->chip->usb_id == USB_ID(0x194f, 0x010d)) { 631 - ret = snd_s1810c_switch_init(mixer, &snd_s1824c_mono_sw); 632 - if (ret < 0) 633 - return ret; 634 - } else if (mixer->chip->usb_id == USB_ID(0x194f, 0x010c)) { 637 + switch (chip->usb_id) { 638 + case USB_ID(0x194f, 0x010c): /* Presonus Studio 1810c */ 639 + dev_info(&dev->dev, 640 + "Presonus Studio 1810c, device_setup: %u\n", chip->setup); 641 + if (chip->setup == 1) 642 + dev_info(&dev->dev, "(8out/18in @ 48kHz)\n"); 643 + else if (chip->setup == 2) 644 + dev_info(&dev->dev, "(6out/8in @ 192kHz)\n"); 645 + else 646 + dev_info(&dev->dev, "(8out/14in @ 96kHz)\n"); 647 + 635 648 ret = snd_s1810c_switch_init(mixer, &snd_s1810c_ab_sw); 636 649 if (ret < 0) 637 650 return ret; 651 + 652 + break; 653 + case USB_ID(0x194f, 0x010d): /* Presonus Studio 1824c */ 654 + ret = snd_s1810c_switch_init(mixer, &snd_s1824c_mono_sw); 655 + if (ret < 0) 656 + return ret; 657 + 658 + break; 638 659 } 639 660 640 661 return ret;
+1 -1
tools/lib/bpf/bpf_tracing.h
··· 311 311 #define __PT_RET_REG regs[31] 312 312 #define __PT_FP_REG __unsupported__ 313 313 #define __PT_RC_REG gpr[3] 314 - #define __PT_SP_REG sp 314 + #define __PT_SP_REG gpr[1] 315 315 #define __PT_IP_REG nip 316 316 317 317 #elif defined(bpf_target_sparc)
+4 -1
tools/objtool/check.c
··· 3516 3516 { 3517 3517 struct instruction *alt_insn = insn->alts ? insn->alts->insn : NULL; 3518 3518 3519 + if (!insn->alt_group) 3520 + return false; 3521 + 3519 3522 /* ANNOTATE_IGNORE_ALTERNATIVE */ 3520 - if (insn->alt_group && insn->alt_group->ignore) 3523 + if (insn->alt_group->ignore) 3521 3524 return true; 3522 3525 3523 3526 /*
+1
tools/testing/selftests/cachestat/.gitignore
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 test_cachestat 3 + tmpshmcstat
+2 -2
tools/testing/selftests/cachestat/test_cachestat.c
··· 226 226 int syscall_ret; 227 227 size_t compute_len = PS * 512; 228 228 struct cachestat_range cs_range = { PS, compute_len }; 229 - char *filename = "tmpshmcstat"; 229 + char *filename = "tmpshmcstat", *map; 230 230 struct cachestat cs; 231 231 bool ret = true; 232 232 int fd; ··· 257 257 } 258 258 break; 259 259 case FILE_MMAP: 260 - char *map = mmap(NULL, filesize, PROT_READ | PROT_WRITE, 260 + map = mmap(NULL, filesize, PROT_READ | PROT_WRITE, 261 261 MAP_SHARED, fd, 0); 262 262 263 263 if (map == MAP_FAILED) {
+4
tools/testing/selftests/drivers/net/netdevsim/Makefile
··· 19 19 udp_tunnel_nic.sh \ 20 20 # end of TEST_PROGS 21 21 22 + TEST_FILES := \ 23 + ethtool-common.sh 24 + # end of TEST_FILES 25 + 22 26 include ../../../lib.mk
+10 -2
tools/testing/selftests/net/gro.c
··· 754 754 static char exthdr_pck[sizeof(buf) + MIN_EXTHDR_SIZE]; 755 755 756 756 create_packet(buf, 0, 0, PAYLOAD_LEN, 0); 757 - add_ipv6_exthdr(buf, exthdr_pck, IPPROTO_HOPOPTS, ext_data1); 757 + add_ipv6_exthdr(buf, exthdr_pck, IPPROTO_DSTOPTS, ext_data1); 758 758 write_packet(fd, exthdr_pck, total_hdr_len + PAYLOAD_LEN + MIN_EXTHDR_SIZE, daddr); 759 759 760 760 create_packet(buf, PAYLOAD_LEN * 1, 0, PAYLOAD_LEN, 0); 761 - add_ipv6_exthdr(buf, exthdr_pck, IPPROTO_HOPOPTS, ext_data2); 761 + add_ipv6_exthdr(buf, exthdr_pck, IPPROTO_DSTOPTS, ext_data2); 762 762 write_packet(fd, exthdr_pck, total_hdr_len + PAYLOAD_LEN + MIN_EXTHDR_SIZE, daddr); 763 763 } 764 764 ··· 989 989 990 990 static void gro_sender(void) 991 991 { 992 + const int fin_delay_us = 100 * 1000; 992 993 static char fin_pkt[MAX_HDR_LEN]; 993 994 struct sockaddr_ll daddr = {}; 994 995 int txfd = -1; ··· 1033 1032 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); 1034 1033 } else if (strcmp(testname, "tcp") == 0) { 1035 1034 send_changed_checksum(txfd, &daddr); 1035 + /* Adding sleep before sending FIN so that it is not 1036 + * received prior to other packets. 1037 + */ 1038 + usleep(fin_delay_us); 1036 1039 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); 1037 1040 1038 1041 send_changed_seq(txfd, &daddr); 1042 + usleep(fin_delay_us); 1039 1043 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); 1040 1044 1041 1045 send_changed_ts(txfd, &daddr); 1046 + usleep(fin_delay_us); 1042 1047 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); 1043 1048 1044 1049 send_diff_opt(txfd, &daddr); 1050 + usleep(fin_delay_us); 1045 1051 write_packet(txfd, fin_pkt, total_hdr_len, &daddr); 1046 1052 } else if (strcmp(testname, "ip") == 0) { 1047 1053 send_changed_ECN(txfd, &daddr);
+23 -4
tools/testing/selftests/vfio/lib/include/vfio_util.h
··· 206 206 void vfio_pci_device_cleanup(struct vfio_pci_device *device); 207 207 void vfio_pci_device_reset(struct vfio_pci_device *device); 208 208 209 - void vfio_pci_dma_map(struct vfio_pci_device *device, 210 - struct vfio_dma_region *region); 211 - void vfio_pci_dma_unmap(struct vfio_pci_device *device, 212 - struct vfio_dma_region *region); 209 + int __vfio_pci_dma_map(struct vfio_pci_device *device, 210 + struct vfio_dma_region *region); 211 + int __vfio_pci_dma_unmap(struct vfio_pci_device *device, 212 + struct vfio_dma_region *region, 213 + u64 *unmapped); 214 + int __vfio_pci_dma_unmap_all(struct vfio_pci_device *device, u64 *unmapped); 215 + 216 + static inline void vfio_pci_dma_map(struct vfio_pci_device *device, 217 + struct vfio_dma_region *region) 218 + { 219 + VFIO_ASSERT_EQ(__vfio_pci_dma_map(device, region), 0); 220 + } 221 + 222 + static inline void vfio_pci_dma_unmap(struct vfio_pci_device *device, 223 + struct vfio_dma_region *region) 224 + { 225 + VFIO_ASSERT_EQ(__vfio_pci_dma_unmap(device, region, NULL), 0); 226 + } 227 + 228 + static inline void vfio_pci_dma_unmap_all(struct vfio_pci_device *device) 229 + { 230 + VFIO_ASSERT_EQ(__vfio_pci_dma_unmap_all(device, NULL), 0); 231 + } 213 232 214 233 void vfio_pci_config_access(struct vfio_pci_device *device, bool write, 215 234 size_t config, size_t size, void *data);
+83 -25
tools/testing/selftests/vfio/lib/vfio_pci_device.c
··· 2 2 #include <dirent.h> 3 3 #include <fcntl.h> 4 4 #include <libgen.h> 5 + #include <stdint.h> 5 6 #include <stdlib.h> 6 7 #include <string.h> 7 8 #include <unistd.h> ··· 142 141 ioctl_assert(device->fd, VFIO_DEVICE_GET_IRQ_INFO, irq_info); 143 142 } 144 143 145 - static void vfio_iommu_dma_map(struct vfio_pci_device *device, 144 + static int vfio_iommu_dma_map(struct vfio_pci_device *device, 146 145 struct vfio_dma_region *region) 147 146 { 148 147 struct vfio_iommu_type1_dma_map args = { ··· 153 152 .size = region->size, 154 153 }; 155 154 156 - ioctl_assert(device->container_fd, VFIO_IOMMU_MAP_DMA, &args); 155 + if (ioctl(device->container_fd, VFIO_IOMMU_MAP_DMA, &args)) 156 + return -errno; 157 + 158 + return 0; 157 159 } 158 160 159 - static void iommufd_dma_map(struct vfio_pci_device *device, 161 + static int iommufd_dma_map(struct vfio_pci_device *device, 160 162 struct vfio_dma_region *region) 161 163 { 162 164 struct iommu_ioas_map args = { ··· 173 169 .ioas_id = device->ioas_id, 174 170 }; 175 171 176 - ioctl_assert(device->iommufd, IOMMU_IOAS_MAP, &args); 172 + if (ioctl(device->iommufd, IOMMU_IOAS_MAP, &args)) 173 + return -errno; 174 + 175 + return 0; 177 176 } 178 177 179 - void vfio_pci_dma_map(struct vfio_pci_device *device, 178 + int __vfio_pci_dma_map(struct vfio_pci_device *device, 180 179 struct vfio_dma_region *region) 181 180 { 181 + int ret; 182 + 182 183 if (device->iommufd) 183 - iommufd_dma_map(device, region); 184 + ret = iommufd_dma_map(device, region); 184 185 else 185 - vfio_iommu_dma_map(device, region); 186 + ret = vfio_iommu_dma_map(device, region); 187 + 188 + if (ret) 189 + return ret; 186 190 187 191 list_add(&region->link, &device->dma_regions); 192 + 193 + return 0; 188 194 } 189 195 190 - static void vfio_iommu_dma_unmap(struct vfio_pci_device *device, 191 - struct vfio_dma_region *region) 196 + static int vfio_iommu_dma_unmap(int fd, u64 iova, u64 size, u32 flags, 197 + u64 *unmapped) 192 198 { 193 199 struct vfio_iommu_type1_dma_unmap args = { 194 200 .argsz = sizeof(args), 195 - .iova = region->iova, 196 - .size = region->size, 201 + .iova = iova, 202 + .size = size, 203 + .flags = flags, 197 204 }; 198 205 199 - ioctl_assert(device->container_fd, VFIO_IOMMU_UNMAP_DMA, &args); 206 + if (ioctl(fd, VFIO_IOMMU_UNMAP_DMA, &args)) 207 + return -errno; 208 + 209 + if (unmapped) 210 + *unmapped = args.size; 211 + 212 + return 0; 200 213 } 201 214 202 - static void iommufd_dma_unmap(struct vfio_pci_device *device, 203 - struct vfio_dma_region *region) 215 + static int iommufd_dma_unmap(int fd, u64 iova, u64 length, u32 ioas_id, 216 + u64 *unmapped) 204 217 { 205 218 struct iommu_ioas_unmap args = { 206 219 .size = sizeof(args), 207 - .iova = region->iova, 208 - .length = region->size, 209 - .ioas_id = device->ioas_id, 220 + .iova = iova, 221 + .length = length, 222 + .ioas_id = ioas_id, 210 223 }; 211 224 212 - ioctl_assert(device->iommufd, IOMMU_IOAS_UNMAP, &args); 225 + if (ioctl(fd, IOMMU_IOAS_UNMAP, &args)) 226 + return -errno; 227 + 228 + if (unmapped) 229 + *unmapped = args.length; 230 + 231 + return 0; 213 232 } 214 233 215 - void vfio_pci_dma_unmap(struct vfio_pci_device *device, 216 - struct vfio_dma_region *region) 234 + int __vfio_pci_dma_unmap(struct vfio_pci_device *device, 235 + struct vfio_dma_region *region, u64 *unmapped) 217 236 { 218 - if (device->iommufd) 219 - iommufd_dma_unmap(device, region); 220 - else 221 - vfio_iommu_dma_unmap(device, region); 237 + int ret; 222 238 223 - list_del(&region->link); 239 + if (device->iommufd) 240 + ret = iommufd_dma_unmap(device->iommufd, region->iova, 241 + region->size, device->ioas_id, 242 + unmapped); 243 + else 244 + ret = vfio_iommu_dma_unmap(device->container_fd, region->iova, 245 + region->size, 0, unmapped); 246 + 247 + if (ret) 248 + return ret; 249 + 250 + list_del_init(&region->link); 251 + 252 + return 0; 253 + } 254 + 255 + int __vfio_pci_dma_unmap_all(struct vfio_pci_device *device, u64 *unmapped) 256 + { 257 + int ret; 258 + struct vfio_dma_region *curr, *next; 259 + 260 + if (device->iommufd) 261 + ret = iommufd_dma_unmap(device->iommufd, 0, UINT64_MAX, 262 + device->ioas_id, unmapped); 263 + else 264 + ret = vfio_iommu_dma_unmap(device->container_fd, 0, 0, 265 + VFIO_DMA_UNMAP_FLAG_ALL, unmapped); 266 + 267 + if (ret) 268 + return ret; 269 + 270 + list_for_each_entry_safe(curr, next, &device->dma_regions, link) 271 + list_del_init(&curr->link); 272 + 273 + return 0; 224 274 } 225 275 226 276 static void vfio_pci_region_get(struct vfio_pci_device *device, int index,
+94 -1
tools/testing/selftests/vfio/vfio_dma_mapping_test.c
··· 112 112 FIXTURE_VARIANT_ADD_ALL_IOMMU_MODES(anonymous_hugetlb_2mb, SZ_2M, MAP_HUGETLB | MAP_HUGE_2MB); 113 113 FIXTURE_VARIANT_ADD_ALL_IOMMU_MODES(anonymous_hugetlb_1gb, SZ_1G, MAP_HUGETLB | MAP_HUGE_1GB); 114 114 115 + #undef FIXTURE_VARIANT_ADD_IOMMU_MODE 116 + 115 117 FIXTURE_SETUP(vfio_dma_mapping_test) 116 118 { 117 119 self->device = vfio_pci_device_init(device_bdf, variant->iommu_mode); ··· 131 129 struct vfio_dma_region region; 132 130 struct iommu_mapping mapping; 133 131 u64 mapping_size = size; 132 + u64 unmapped; 134 133 int rc; 135 134 136 135 region.vaddr = mmap(NULL, size, PROT_READ | PROT_WRITE, flags, -1, 0); ··· 187 184 } 188 185 189 186 unmap: 190 - vfio_pci_dma_unmap(self->device, &region); 187 + rc = __vfio_pci_dma_unmap(self->device, &region, &unmapped); 188 + ASSERT_EQ(rc, 0); 189 + ASSERT_EQ(unmapped, region.size); 191 190 printf("Unmapped IOVA 0x%lx\n", region.iova); 192 191 ASSERT_EQ(INVALID_IOVA, __to_iova(self->device, region.vaddr)); 193 192 ASSERT_NE(0, iommu_mapping_get(device_bdf, region.iova, &mapping)); 194 193 195 194 ASSERT_TRUE(!munmap(region.vaddr, size)); 195 + } 196 + 197 + FIXTURE(vfio_dma_map_limit_test) { 198 + struct vfio_pci_device *device; 199 + struct vfio_dma_region region; 200 + size_t mmap_size; 201 + }; 202 + 203 + FIXTURE_VARIANT(vfio_dma_map_limit_test) { 204 + const char *iommu_mode; 205 + }; 206 + 207 + #define FIXTURE_VARIANT_ADD_IOMMU_MODE(_iommu_mode) \ 208 + FIXTURE_VARIANT_ADD(vfio_dma_map_limit_test, _iommu_mode) { \ 209 + .iommu_mode = #_iommu_mode, \ 210 + } 211 + 212 + FIXTURE_VARIANT_ADD_ALL_IOMMU_MODES(); 213 + 214 + #undef FIXTURE_VARIANT_ADD_IOMMU_MODE 215 + 216 + FIXTURE_SETUP(vfio_dma_map_limit_test) 217 + { 218 + struct vfio_dma_region *region = &self->region; 219 + u64 region_size = getpagesize(); 220 + 221 + /* 222 + * Over-allocate mmap by double the size to provide enough backing vaddr 223 + * for overflow tests 224 + */ 225 + self->mmap_size = 2 * region_size; 226 + 227 + self->device = vfio_pci_device_init(device_bdf, variant->iommu_mode); 228 + region->vaddr = mmap(NULL, self->mmap_size, PROT_READ | PROT_WRITE, 229 + MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); 230 + ASSERT_NE(region->vaddr, MAP_FAILED); 231 + 232 + /* One page prior to the end of address space */ 233 + region->iova = ~(iova_t)0 & ~(region_size - 1); 234 + region->size = region_size; 235 + } 236 + 237 + FIXTURE_TEARDOWN(vfio_dma_map_limit_test) 238 + { 239 + vfio_pci_device_cleanup(self->device); 240 + ASSERT_EQ(munmap(self->region.vaddr, self->mmap_size), 0); 241 + } 242 + 243 + TEST_F(vfio_dma_map_limit_test, unmap_range) 244 + { 245 + struct vfio_dma_region *region = &self->region; 246 + u64 unmapped; 247 + int rc; 248 + 249 + vfio_pci_dma_map(self->device, region); 250 + ASSERT_EQ(region->iova, to_iova(self->device, region->vaddr)); 251 + 252 + rc = __vfio_pci_dma_unmap(self->device, region, &unmapped); 253 + ASSERT_EQ(rc, 0); 254 + ASSERT_EQ(unmapped, region->size); 255 + } 256 + 257 + TEST_F(vfio_dma_map_limit_test, unmap_all) 258 + { 259 + struct vfio_dma_region *region = &self->region; 260 + u64 unmapped; 261 + int rc; 262 + 263 + vfio_pci_dma_map(self->device, region); 264 + ASSERT_EQ(region->iova, to_iova(self->device, region->vaddr)); 265 + 266 + rc = __vfio_pci_dma_unmap_all(self->device, &unmapped); 267 + ASSERT_EQ(rc, 0); 268 + ASSERT_EQ(unmapped, region->size); 269 + } 270 + 271 + TEST_F(vfio_dma_map_limit_test, overflow) 272 + { 273 + struct vfio_dma_region *region = &self->region; 274 + int rc; 275 + 276 + region->size = self->mmap_size; 277 + 278 + rc = __vfio_pci_dma_map(self->device, region); 279 + ASSERT_EQ(rc, -EOVERFLOW); 280 + 281 + rc = __vfio_pci_dma_unmap(self->device, region, NULL); 282 + ASSERT_EQ(rc, -EOVERFLOW); 196 283 } 197 284 198 285 int main(int argc, char *argv[])
+4 -4
tools/testing/selftests/vsock/vmtest.sh
··· 389 389 local rc 390 390 391 391 host_oops_cnt_before=$(dmesg | grep -c -i 'Oops') 392 - host_warn_cnt_before=$(dmesg --level=warn | wc -l) 392 + host_warn_cnt_before=$(dmesg --level=warn | grep -c -i 'vsock') 393 393 vm_oops_cnt_before=$(vm_ssh -- dmesg | grep -c -i 'Oops') 394 - vm_warn_cnt_before=$(vm_ssh -- dmesg --level=warn | wc -l) 394 + vm_warn_cnt_before=$(vm_ssh -- dmesg --level=warn | grep -c -i 'vsock') 395 395 396 396 name=$(echo "${1}" | awk '{ print $1 }') 397 397 eval test_"${name}" ··· 403 403 rc=$KSFT_FAIL 404 404 fi 405 405 406 - host_warn_cnt_after=$(dmesg --level=warn | wc -l) 406 + host_warn_cnt_after=$(dmesg --level=warn | grep -c -i 'vsock') 407 407 if [[ ${host_warn_cnt_after} -gt ${host_warn_cnt_before} ]]; then 408 408 echo "FAIL: kernel warning detected on host" | log_host "${name}" 409 409 rc=$KSFT_FAIL ··· 415 415 rc=$KSFT_FAIL 416 416 fi 417 417 418 - vm_warn_cnt_after=$(vm_ssh -- dmesg --level=warn | wc -l) 418 + vm_warn_cnt_after=$(vm_ssh -- dmesg --level=warn | grep -c -i 'vsock') 419 419 if [[ ${vm_warn_cnt_after} -gt ${vm_warn_cnt_before} ]]; then 420 420 echo "FAIL: kernel warning detected on vm" | log_host "${name}" 421 421 rc=$KSFT_FAIL