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

Conflicts:

net/xdp/xsk.c
0ebc27a4c67d ("xsk: avoid data corruption on cq descriptor number")
8da7bea7db69 ("xsk: add indirect call for xsk_destruct_skb")
30ed05adca4a ("xsk: use a smaller new lock for shared pool case")
https://lore.kernel.org/20251127105450.4a1665ec@canb.auug.org.au
https://lore.kernel.org/eb4eee14-7e24-4d1b-b312-e9ea738fefee@kernel.org

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

+1942 -1164
+2
.mailmap
··· 691 691 Sachin P Sant <ssant@in.ibm.com> 692 692 Sai Prakash Ranjan <quic_saipraka@quicinc.com> <saiprakash.ranjan@codeaurora.org> 693 693 Sakari Ailus <sakari.ailus@linux.intel.com> <sakari.ailus@iki.fi> 694 + Sam Protsenko <semen.protsenko@linaro.org> 695 + Sam Protsenko <semen.protsenko@linaro.org> <semen.protsenko@globallogic.com> 694 696 Sam Ravnborg <sam@mars.ravnborg.org> 695 697 Sankeerth Billakanti <quic_sbillaka@quicinc.com> <sbillaka@codeaurora.org> 696 698 Santosh Shilimkar <santosh.shilimkar@oracle.org>
+14 -12
Documentation/devicetree/bindings/pinctrl/toshiba,visconti-pinctrl.yaml
··· 50 50 groups: 51 51 description: 52 52 Name of the pin group to use for the functions. 53 - $ref: /schemas/types.yaml#/definitions/string 54 - enum: [i2c0_grp, i2c1_grp, i2c2_grp, i2c3_grp, i2c4_grp, 55 - i2c5_grp, i2c6_grp, i2c7_grp, i2c8_grp, 56 - spi0_grp, spi0_cs0_grp, spi0_cs1_grp, spi0_cs2_grp, 57 - spi1_grp, spi2_grp, spi3_grp, spi4_grp, spi5_grp, spi6_grp, 58 - uart0_grp, uart1_grp, uart2_grp, uart3_grp, 59 - pwm0_gpio4_grp, pwm0_gpio8_grp, pwm0_gpio12_grp, 60 - pwm0_gpio16_grp, pwm1_gpio5_grp, pwm1_gpio9_grp, 61 - pwm1_gpio13_grp, pwm1_gpio17_grp, pwm2_gpio6_grp, 62 - pwm2_gpio10_grp, pwm2_gpio14_grp, pwm2_gpio18_grp, 63 - pwm3_gpio7_grp, pwm3_gpio11_grp, pwm3_gpio15_grp, 64 - pwm3_gpio19_grp, pcmif_out_grp, pcmif_in_grp] 53 + items: 54 + enum: [i2c0_grp, i2c1_grp, i2c2_grp, i2c3_grp, i2c4_grp, 55 + i2c5_grp, i2c6_grp, i2c7_grp, i2c8_grp, 56 + spi0_grp, spi0_cs0_grp, spi0_cs1_grp, spi0_cs2_grp, 57 + spi1_grp, spi2_grp, spi3_grp, spi4_grp, spi5_grp, spi6_grp, 58 + uart0_grp, uart1_grp, uart2_grp, uart3_grp, 59 + pwm0_gpio4_grp, pwm0_gpio8_grp, pwm0_gpio12_grp, 60 + pwm0_gpio16_grp, pwm1_gpio5_grp, pwm1_gpio9_grp, 61 + pwm1_gpio13_grp, pwm1_gpio17_grp, pwm2_gpio6_grp, 62 + pwm2_gpio10_grp, pwm2_gpio14_grp, pwm2_gpio18_grp, 63 + pwm3_gpio7_grp, pwm3_gpio11_grp, pwm3_gpio15_grp, 64 + pwm3_gpio19_grp, pcmif_out_grp, pcmif_in_grp] 65 + minItems: 1 66 + maxItems: 8 65 67 66 68 drive-strength: 67 69 enum: [2, 4, 6, 8, 16, 24, 32]
+1
Documentation/devicetree/bindings/pinctrl/xlnx,versal-pinctrl.yaml
··· 74 74 75 75 '^conf': 76 76 type: object 77 + unevaluatedProperties: false 77 78 description: 78 79 Pinctrl node's client devices use subnodes for pin configurations, 79 80 which in turn use the standard properties below.
+18 -7
Documentation/input/event-codes.rst
··· 400 400 All other axes retain their meaning. A device must not mix 401 401 regular directional axes and accelerometer axes on the same event node. 402 402 403 - INPUT_PROP_HAPTIC_TOUCHPAD 404 - -------------------------- 403 + INPUT_PROP_PRESSUREPAD 404 + ---------------------- 405 405 406 - The INPUT_PROP_HAPTIC_TOUCHPAD property indicates that device: 407 - - supports simple haptic auto and manual triggering 406 + The INPUT_PROP_PRESSUREPAD property indicates that the device provides 407 + simulated haptic feedback (e.g. a vibrator motor situated below the surface) 408 + instead of physical haptic feedback (e.g. a hinge). This property is only set 409 + if the device: 410 + 408 411 - can differentiate between at least 5 fingers 409 412 - uses correct resolution for the X/Y (units and value) 410 - - reports correct force per touch, and correct units for them (newtons or grams) 411 413 - follows the MT protocol type B 412 414 415 + If the simulated haptic feedback is controllable by userspace the device must: 416 + 417 + - support simple haptic auto and manual triggering, and 418 + - report correct force per touch, and correct units for them (newtons or grams), and 419 + - provide the EV_FF FF_HAPTIC force feedback effect. 420 + 413 421 Summing up, such devices follow the MS spec for input devices in 414 - Win8 and Win8.1, and in addition support the Simple haptic controller HID table, 415 - and report correct units for the pressure. 422 + Win8 and Win8.1, and in addition may support the Simple haptic controller HID 423 + table, and report correct units for the pressure. 424 + 425 + Where applicable, this property is set in addition to INPUT_PROP_BUTTONPAD, it 426 + does not replace that property. 416 427 417 428 Guidelines 418 429 ==========
+1
Documentation/wmi/driver-development-guide.rst
··· 54 54 :: 55 55 56 56 static const struct wmi_device_id foo_id_table[] = { 57 + /* Only use uppercase letters! */ 57 58 { "936DA01F-9ABD-4D9D-80C7-02AF85C822A8", NULL }, 58 59 { } 59 60 };
+24 -12
MAINTAINERS
··· 3927 3927 F: include/linux/async_tx.h 3928 3928 3929 3929 AT24 EEPROM DRIVER 3930 - M: Bartosz Golaszewski <brgl@bgdev.pl> 3930 + M: Bartosz Golaszewski <brgl@kernel.org> 3931 3931 L: linux-i2c@vger.kernel.org 3932 3932 S: Maintained 3933 3933 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git ··· 10678 10678 10679 10679 GPIO SUBSYSTEM 10680 10680 M: Linus Walleij <linus.walleij@linaro.org> 10681 - M: Bartosz Golaszewski <brgl@bgdev.pl> 10681 + M: Bartosz Golaszewski <brgl@kernel.org> 10682 10682 L: linux-gpio@vger.kernel.org 10683 10683 S: Maintained 10684 10684 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git ··· 10695 10695 K: devm_gpiod_unhinge 10696 10696 10697 10697 GPIO UAPI 10698 - M: Bartosz Golaszewski <brgl@bgdev.pl> 10698 + M: Bartosz Golaszewski <brgl@kernel.org> 10699 10699 R: Kent Gibson <warthog618@gmail.com> 10700 10700 L: linux-gpio@vger.kernel.org 10701 10701 S: Maintained ··· 13799 13799 F: Documentation/core-api/kho/* 13800 13800 F: include/linux/kexec_handover.h 13801 13801 F: kernel/kexec_handover.c 13802 + F: lib/test_kho.c 13802 13803 F: tools/testing/selftests/kho/ 13803 13804 13804 13805 KEYS-ENCRYPTED ··· 15311 15310 F: include/linux/mfd/max7360.h 15312 15311 15313 15312 MAXIM MAX77650 PMIC MFD DRIVER 15314 - M: Bartosz Golaszewski <brgl@bgdev.pl> 15313 + M: Bartosz Golaszewski <brgl@kernel.org> 15315 15314 L: linux-kernel@vger.kernel.org 15316 15315 S: Maintained 15317 15316 F: Documentation/devicetree/bindings/*/*max77650.yaml ··· 19920 19919 F: include/linux/pci-p2pdma.h 19921 19920 19922 19921 PCI POWER CONTROL 19923 - M: Bartosz Golaszewski <brgl@bgdev.pl> 19922 + M: Bartosz Golaszewski <brgl@kernel.org> 19924 19923 L: linux-pci@vger.kernel.org 19925 19924 S: Maintained 19926 19925 T: git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git ··· 20517 20516 F: kernel/configs/nopm.config 20518 20517 20519 20518 POWER SEQUENCING 20520 - M: Bartosz Golaszewski <brgl@bgdev.pl> 20519 + M: Bartosz Golaszewski <brgl@kernel.org> 20521 20520 L: linux-pm@vger.kernel.org 20522 20521 S: Maintained 20523 20522 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git ··· 21320 21319 F: drivers/tee/qcomtee/ 21321 21320 21322 21321 QUALCOMM TRUST ZONE MEMORY ALLOCATOR 21323 - M: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> 21322 + M: Bartosz Golaszewski <brgl@kernel.org> 21324 21323 L: linux-arm-msm@vger.kernel.org 21325 21324 S: Maintained 21326 21325 F: drivers/firmware/qcom/qcom_tzmem.c ··· 22671 22670 22672 22671 S390 NETWORK DRIVERS 22673 22672 M: Alexandra Winter <wintera@linux.ibm.com> 22674 - R: Aswin Karuvally <aswin@linux.ibm.com> 22673 + M: Aswin Karuvally <aswin@linux.ibm.com> 22675 22674 L: linux-s390@vger.kernel.org 22676 22675 L: netdev@vger.kernel.org 22677 22676 S: Supported ··· 25688 25687 F: drivers/crypto/ti/ 25689 25688 25690 25689 TI DAVINCI MACHINE SUPPORT 25691 - M: Bartosz Golaszewski <brgl@bgdev.pl> 25690 + M: Bartosz Golaszewski <brgl@kernel.org> 25692 25691 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 25693 25692 S: Maintained 25694 25693 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git ··· 27138 27137 F: drivers/char/virtio_console.c 27139 27138 F: include/uapi/linux/virtio_console.h 27140 27139 27141 - VIRTIO CORE AND NET DRIVERS 27140 + VIRTIO CORE 27142 27141 M: "Michael S. Tsirkin" <mst@redhat.com> 27143 27142 M: Jason Wang <jasowang@redhat.com> 27144 27143 R: Xuan Zhuo <xuanzhuo@linux.alibaba.com> ··· 27151 27150 F: Documentation/driver-api/virtio/ 27152 27151 F: drivers/block/virtio_blk.c 27153 27152 F: drivers/crypto/virtio/ 27154 - F: drivers/net/virtio_net.c 27155 27153 F: drivers/vdpa/ 27156 27154 F: drivers/virtio/ 27157 27155 F: include/linux/vdpa.h ··· 27159 27159 F: include/uapi/linux/virtio_*.h 27160 27160 F: net/vmw_vsock/virtio* 27161 27161 F: tools/virtio/ 27162 - F: tools/testing/selftests/drivers/net/virtio_net/ 27163 27162 27164 27163 VIRTIO CRYPTO DRIVER 27165 27164 M: Gonglei <arei.gonglei@huawei.com> ··· 27269 27270 W: https://virtio-mem.gitlab.io/ 27270 27271 F: drivers/virtio/virtio_mem.c 27271 27272 F: include/uapi/linux/virtio_mem.h 27273 + 27274 + VIRTIO NET DRIVER 27275 + M: "Michael S. Tsirkin" <mst@redhat.com> 27276 + M: Jason Wang <jasowang@redhat.com> 27277 + R: Xuan Zhuo <xuanzhuo@linux.alibaba.com> 27278 + R: Eugenio Pérez <eperezma@redhat.com> 27279 + L: netdev@vger.kernel.org 27280 + L: virtualization@lists.linux.dev 27281 + S: Maintained 27282 + F: drivers/net/virtio_net.c 27283 + F: include/linux/virtio_net.h 27284 + F: include/uapi/linux/virtio_net.h 27285 + F: tools/testing/selftests/drivers/net/virtio_net/ 27272 27286 27273 27287 VIRTIO PMEM DRIVER 27274 27288 M: Pankaj Gupta <pankaj.gupta.linux@gmail.com>
+1 -1
Makefile
··· 2 2 VERSION = 6 3 3 PATCHLEVEL = 18 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc6 5 + EXTRAVERSION = -rc7 6 6 NAME = Baby Opossum Posse 7 7 8 8 # *DOCUMENTATION*
-10
arch/arm64/kernel/acpi.c
··· 351 351 * as long as we take care not to create a writable 352 352 * mapping for executable code. 353 353 */ 354 - fallthrough; 355 - 356 - case EFI_ACPI_MEMORY_NVS: 357 - /* 358 - * ACPI NVS marks an area reserved for use by the 359 - * firmware, even after exiting the boot service. 360 - * This may be used by the firmware for sharing dynamic 361 - * tables/data (e.g., ACPI CCEL) with the OS. Map it 362 - * as read-only. 363 - */ 364 354 prot = PAGE_KERNEL_RO; 365 355 break; 366 356
+2
arch/arm64/kernel/proton-pack.c
··· 1032 1032 1033 1033 if (arm64_get_spectre_v2_state() == SPECTRE_VULNERABLE) { 1034 1034 /* No point mitigating Spectre-BHB alone. */ 1035 + } else if (!IS_ENABLED(CONFIG_MITIGATE_SPECTRE_BRANCH_HISTORY)) { 1036 + /* Do nothing */ 1035 1037 } else if (supports_ecbhb(SCOPE_LOCAL_CPU)) { 1036 1038 state = SPECTRE_MITIGATED; 1037 1039 set_bit(BHB_HW, &system_bhb_mitigations);
+21
arch/loongarch/include/asm/cpu.h
··· 55 55 CPU_LAST 56 56 }; 57 57 58 + static inline char *id_to_core_name(unsigned int id) 59 + { 60 + if ((id & PRID_COMP_MASK) != PRID_COMP_LOONGSON) 61 + return "Unknown"; 62 + 63 + switch (id & PRID_SERIES_MASK) { 64 + case PRID_SERIES_LA132: 65 + return "LA132"; 66 + case PRID_SERIES_LA264: 67 + return "LA264"; 68 + case PRID_SERIES_LA364: 69 + return "LA364"; 70 + case PRID_SERIES_LA464: 71 + return "LA464"; 72 + case PRID_SERIES_LA664: 73 + return "LA664"; 74 + default: 75 + return "Unknown"; 76 + } 77 + } 78 + 58 79 #endif /* !__ASSEMBLER__ */ 59 80 60 81 /*
+18 -22
arch/loongarch/include/uapi/asm/ptrace.h
··· 10 10 11 11 #include <linux/types.h> 12 12 13 - #ifndef __KERNEL__ 14 - #include <stdint.h> 15 - #endif 16 - 17 13 /* 18 14 * For PTRACE_{POKE,PEEK}USR. 0 - 31 are GPRs, 19 15 * 32 is syscall's original ARG0, 33 is PC, 34 is BADVADDR. ··· 37 41 } __attribute__((aligned(8))); 38 42 39 43 struct user_fp_state { 40 - uint64_t fpr[32]; 41 - uint64_t fcc; 42 - uint32_t fcsr; 44 + __u64 fpr[32]; 45 + __u64 fcc; 46 + __u32 fcsr; 43 47 }; 44 48 45 49 struct user_lsx_state { 46 50 /* 32 registers, 128 bits width per register. */ 47 - uint64_t vregs[32*2]; 51 + __u64 vregs[32*2]; 48 52 }; 49 53 50 54 struct user_lasx_state { 51 55 /* 32 registers, 256 bits width per register. */ 52 - uint64_t vregs[32*4]; 56 + __u64 vregs[32*4]; 53 57 }; 54 58 55 59 struct user_lbt_state { 56 - uint64_t scr[4]; 57 - uint32_t eflags; 58 - uint32_t ftop; 60 + __u64 scr[4]; 61 + __u32 eflags; 62 + __u32 ftop; 59 63 }; 60 64 61 65 struct user_watch_state { 62 - uint64_t dbg_info; 66 + __u64 dbg_info; 63 67 struct { 64 - uint64_t addr; 65 - uint64_t mask; 66 - uint32_t ctrl; 67 - uint32_t pad; 68 + __u64 addr; 69 + __u64 mask; 70 + __u32 ctrl; 71 + __u32 pad; 68 72 } dbg_regs[8]; 69 73 }; 70 74 71 75 struct user_watch_state_v2 { 72 - uint64_t dbg_info; 76 + __u64 dbg_info; 73 77 struct { 74 - uint64_t addr; 75 - uint64_t mask; 76 - uint32_t ctrl; 77 - uint32_t pad; 78 + __u64 addr; 79 + __u64 mask; 80 + __u32 ctrl; 81 + __u32 pad; 78 82 } dbg_regs[14]; 79 83 }; 80 84
+11 -23
arch/loongarch/kernel/cpu-probe.c
··· 277 277 uint32_t config; 278 278 uint64_t *vendor = (void *)(&cpu_full_name[VENDOR_OFFSET]); 279 279 uint64_t *cpuname = (void *)(&cpu_full_name[CPUNAME_OFFSET]); 280 - const char *core_name = "Unknown"; 280 + const char *core_name = id_to_core_name(c->processor_id); 281 281 282 282 switch (BIT(fls(c->isa_level) - 1)) { 283 283 case LOONGARCH_CPU_ISA_LA32R: ··· 291 291 break; 292 292 } 293 293 294 - switch (c->processor_id & PRID_SERIES_MASK) { 295 - case PRID_SERIES_LA132: 296 - core_name = "LA132"; 297 - break; 298 - case PRID_SERIES_LA264: 299 - core_name = "LA264"; 300 - break; 301 - case PRID_SERIES_LA364: 302 - core_name = "LA364"; 303 - break; 304 - case PRID_SERIES_LA464: 305 - core_name = "LA464"; 306 - break; 307 - case PRID_SERIES_LA664: 308 - core_name = "LA664"; 309 - break; 310 - } 311 - 312 294 pr_info("%s Processor probed (%s Core)\n", __cpu_family[cpu], core_name); 313 295 314 - if (!cpu_has_iocsr) 296 + if (!cpu_has_iocsr) { 297 + __cpu_full_name[cpu] = "Unknown"; 315 298 return; 316 - 317 - if (!__cpu_full_name[cpu]) 318 - __cpu_full_name[cpu] = cpu_full_name; 299 + } 319 300 320 301 *vendor = iocsr_read64(LOONGARCH_IOCSR_VENDOR); 321 302 *cpuname = iocsr_read64(LOONGARCH_IOCSR_CPUNAME); 303 + 304 + if (!__cpu_full_name[cpu]) { 305 + if (((char *)vendor)[0] == 0) 306 + __cpu_full_name[cpu] = "Unknown"; 307 + else 308 + __cpu_full_name[cpu] = cpu_full_name; 309 + } 322 310 323 311 config = iocsr_read32(LOONGARCH_IOCSR_FEATURES); 324 312 if (config & IOCSRF_CSRIPI)
+2
arch/loongarch/kernel/machine_kexec.c
··· 237 237 #ifdef CONFIG_SMP 238 238 crash_smp_send_stop(); 239 239 #endif 240 + machine_kexec_mask_interrupts(); 240 241 cpumask_set_cpu(crashing_cpu, &cpus_in_crash); 241 242 242 243 pr_info("Starting crashdump kernel...\n"); ··· 275 274 276 275 /* We do not want to be bothered. */ 277 276 local_irq_disable(); 277 + machine_kexec_mask_interrupts(); 278 278 279 279 pr_notice("EFI boot flag: 0x%lx\n", efi_boot); 280 280 pr_notice("Command line addr: 0x%lx\n", cmdline_ptr);
+18 -42
arch/loongarch/kernel/numa.c
··· 158 158 159 159 #ifdef CONFIG_ACPI_NUMA 160 160 161 - /* 162 - * add_numamem_region 163 - * 164 - * Add a uasable memory region described by BIOS. The 165 - * routine gets each intersection between BIOS's region 166 - * and node's region, and adds them into node's memblock 167 - * pool. 168 - * 169 - */ 170 - static void __init add_numamem_region(u64 start, u64 end, u32 type) 171 - { 172 - u32 node = pa_to_nid(start); 173 - u64 size = end - start; 174 - static unsigned long num_physpages; 161 + static unsigned long num_physpages; 175 162 176 - if (start >= end) { 177 - pr_debug("Invalid region: %016llx-%016llx\n", start, end); 178 - return; 179 - } 180 - 181 - num_physpages += (size >> PAGE_SHIFT); 182 - pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx Bytes\n", 183 - node, type, start, size); 184 - pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", 185 - start >> PAGE_SHIFT, end >> PAGE_SHIFT, num_physpages); 186 - memblock_set_node(start, size, &memblock.memory, node); 187 - } 188 - 189 - static void __init init_node_memblock(void) 163 + static void __init info_node_memblock(void) 190 164 { 191 165 u32 mem_type; 192 166 u64 mem_end, mem_start, mem_size; ··· 180 206 case EFI_BOOT_SERVICES_DATA: 181 207 case EFI_PERSISTENT_MEMORY: 182 208 case EFI_CONVENTIONAL_MEMORY: 183 - add_numamem_region(mem_start, mem_end, mem_type); 209 + num_physpages += (mem_size >> PAGE_SHIFT); 210 + pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx Bytes\n", 211 + (u32)pa_to_nid(mem_start), mem_type, mem_start, mem_size); 212 + pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", 213 + mem_start >> PAGE_SHIFT, mem_end >> PAGE_SHIFT, num_physpages); 184 214 break; 185 215 case EFI_PAL_CODE: 186 216 case EFI_UNUSABLE_MEMORY: 187 217 case EFI_ACPI_RECLAIM_MEMORY: 188 - add_numamem_region(mem_start, mem_end, mem_type); 218 + num_physpages += (mem_size >> PAGE_SHIFT); 219 + pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx Bytes\n", 220 + (u32)pa_to_nid(mem_start), mem_type, mem_start, mem_size); 221 + pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", 222 + mem_start >> PAGE_SHIFT, mem_end >> PAGE_SHIFT, num_physpages); 189 223 fallthrough; 190 224 case EFI_RESERVED_TYPE: 191 225 case EFI_RUNTIME_SERVICES_CODE: ··· 231 249 for (i = 0; i < NR_CPUS; i++) 232 250 set_cpuid_to_node(i, NUMA_NO_NODE); 233 251 234 - numa_reset_distance(); 235 - nodes_clear(numa_nodes_parsed); 236 - nodes_clear(node_possible_map); 237 - nodes_clear(node_online_map); 238 - WARN_ON(memblock_clear_hotplug(0, PHYS_ADDR_MAX)); 239 - 240 252 /* Parse SRAT and SLIT if provided by firmware. */ 241 - ret = acpi_disabled ? fake_numa_init() : acpi_numa_init(); 253 + if (!acpi_disabled) 254 + ret = numa_memblks_init(acpi_numa_init, false); 255 + else 256 + ret = numa_memblks_init(fake_numa_init, false); 257 + 242 258 if (ret < 0) 243 259 return ret; 244 260 245 - node_possible_map = numa_nodes_parsed; 246 - if (WARN_ON(nodes_empty(node_possible_map))) 247 - return -EINVAL; 248 - 249 - init_node_memblock(); 261 + info_node_memblock(); 250 262 if (!memblock_validate_numa_coverage(SZ_1M)) 251 263 return -EINVAL; 252 264
+2
arch/loongarch/kernel/proc.c
··· 17 17 { 18 18 unsigned long n = (unsigned long) v - 1; 19 19 unsigned int isa = cpu_data[n].isa_level; 20 + unsigned int prid = cpu_data[n].processor_id; 20 21 unsigned int version = cpu_data[n].processor_id & 0xff; 21 22 unsigned int fp_version = cpu_data[n].fpu_vers; 22 23 ··· 38 37 seq_printf(m, "global_id\t\t: %d\n", cpu_data[n].global_id); 39 38 seq_printf(m, "CPU Family\t\t: %s\n", __cpu_family[n]); 40 39 seq_printf(m, "Model Name\t\t: %s\n", __cpu_full_name[n]); 40 + seq_printf(m, "PRID\t\t\t: %s (%08x)\n", id_to_core_name(prid), prid); 41 41 seq_printf(m, "CPU Revision\t\t: 0x%02x\n", version); 42 42 seq_printf(m, "FPU Revision\t\t: 0x%02x\n", fp_version); 43 43 seq_printf(m, "CPU MHz\t\t\t: %llu.%02llu\n",
+3
arch/loongarch/net/bpf_jit.c
··· 1624 1624 /* Direct jump skips 5 NOP instructions */ 1625 1625 else if (is_bpf_text_address((unsigned long)orig_call)) 1626 1626 orig_call += LOONGARCH_BPF_FENTRY_NBYTES; 1627 + /* Module tracing not supported - cause kernel lockups */ 1628 + else if (is_module_text_address((unsigned long)orig_call)) 1629 + return -ENOTSUPP; 1627 1630 1628 1631 if (flags & BPF_TRAMP_F_CALL_ORIG) { 1629 1632 move_addr(ctx, LOONGARCH_GPR_A0, (const u64)im);
+4 -4
arch/loongarch/pci/pci.c
··· 50 50 */ 51 51 lsize = cpu_last_level_cache_line_size(); 52 52 53 - BUG_ON(!lsize); 53 + if (lsize) { 54 + pci_dfl_cache_line_size = lsize >> 2; 54 55 55 - pci_dfl_cache_line_size = lsize >> 2; 56 - 57 - pr_debug("PCI: pci_cache_line_size set to %d bytes\n", lsize); 56 + pr_debug("PCI: pci_cache_line_size set to %d bytes\n", lsize); 57 + } 58 58 59 59 return 0; 60 60 }
+1 -1
arch/mips/boot/dts/econet/en751221.dtsi
··· 18 18 19 19 cpu@0 { 20 20 device_type = "cpu"; 21 - compatible = "mips,mips24KEc"; 21 + compatible = "mips,mips34Kc"; 22 22 reg = <0>; 23 23 }; 24 24 };
+1 -1
arch/mips/kernel/process.c
··· 692 692 /* Space for the VDSO, data page & GIC user page */ 693 693 if (current->thread.abi) { 694 694 top -= PAGE_ALIGN(current->thread.abi->vdso->size); 695 - top -= PAGE_SIZE; 695 + top -= VDSO_NR_PAGES * PAGE_SIZE; 696 696 top -= mips_gic_present() ? PAGE_SIZE : 0; 697 697 698 698 /* Space to randomize the VDSO base */
+64 -38
arch/mips/mm/tlb-r4k.c
··· 15 15 #include <linux/mm.h> 16 16 #include <linux/hugetlb.h> 17 17 #include <linux/export.h> 18 + #include <linux/sort.h> 18 19 19 20 #include <asm/cpu.h> 20 21 #include <asm/cpu-type.h> ··· 509 508 510 509 __setup("ntlb=", set_ntlb); 511 510 512 - /* Initialise all TLB entries with unique values */ 511 + 512 + /* Comparison function for EntryHi VPN fields. */ 513 + static int r4k_vpn_cmp(const void *a, const void *b) 514 + { 515 + long v = *(unsigned long *)a - *(unsigned long *)b; 516 + int s = sizeof(long) > sizeof(int) ? sizeof(long) * 8 - 1: 0; 517 + return s ? (v != 0) | v >> s : v; 518 + } 519 + 520 + /* 521 + * Initialise all TLB entries with unique values that do not clash with 522 + * what we have been handed over and what we'll be using ourselves. 523 + */ 513 524 static void r4k_tlb_uniquify(void) 514 525 { 515 - int entry = num_wired_entries(); 526 + unsigned long tlb_vpns[1 << MIPS_CONF1_TLBS_SIZE]; 527 + int tlbsize = current_cpu_data.tlbsize; 528 + int start = num_wired_entries(); 529 + unsigned long vpn_mask; 530 + int cnt, ent, idx, i; 531 + 532 + vpn_mask = GENMASK(cpu_vmbits - 1, 13); 533 + vpn_mask |= IS_ENABLED(CONFIG_64BIT) ? 3ULL << 62 : 1 << 31; 516 534 517 535 htw_stop(); 536 + 537 + for (i = start, cnt = 0; i < tlbsize; i++, cnt++) { 538 + unsigned long vpn; 539 + 540 + write_c0_index(i); 541 + mtc0_tlbr_hazard(); 542 + tlb_read(); 543 + tlb_read_hazard(); 544 + vpn = read_c0_entryhi(); 545 + vpn &= vpn_mask & PAGE_MASK; 546 + tlb_vpns[cnt] = vpn; 547 + 548 + /* Prevent any large pages from overlapping regular ones. */ 549 + write_c0_pagemask(read_c0_pagemask() & PM_DEFAULT_MASK); 550 + mtc0_tlbw_hazard(); 551 + tlb_write_indexed(); 552 + tlbw_use_hazard(); 553 + } 554 + 555 + sort(tlb_vpns, cnt, sizeof(tlb_vpns[0]), r4k_vpn_cmp, NULL); 556 + 557 + write_c0_pagemask(PM_DEFAULT_MASK); 518 558 write_c0_entrylo0(0); 519 559 write_c0_entrylo1(0); 520 560 521 - while (entry < current_cpu_data.tlbsize) { 522 - unsigned long asid_mask = cpu_asid_mask(&current_cpu_data); 523 - unsigned long asid = 0; 524 - int idx; 561 + idx = 0; 562 + ent = tlbsize; 563 + for (i = start; i < tlbsize; i++) 564 + while (1) { 565 + unsigned long entryhi, vpn; 525 566 526 - /* Skip wired MMID to make ginvt_mmid work */ 527 - if (cpu_has_mmid) 528 - asid = MMID_KERNEL_WIRED + 1; 567 + entryhi = UNIQUE_ENTRYHI(ent); 568 + vpn = entryhi & vpn_mask & PAGE_MASK; 529 569 530 - /* Check for match before using UNIQUE_ENTRYHI */ 531 - do { 532 - if (cpu_has_mmid) { 533 - write_c0_memorymapid(asid); 534 - write_c0_entryhi(UNIQUE_ENTRYHI(entry)); 535 - } else { 536 - write_c0_entryhi(UNIQUE_ENTRYHI(entry) | asid); 537 - } 538 - mtc0_tlbw_hazard(); 539 - tlb_probe(); 540 - tlb_probe_hazard(); 541 - idx = read_c0_index(); 542 - /* No match or match is on current entry */ 543 - if (idx < 0 || idx == entry) 570 + if (idx >= cnt || vpn < tlb_vpns[idx]) { 571 + write_c0_entryhi(entryhi); 572 + write_c0_index(i); 573 + mtc0_tlbw_hazard(); 574 + tlb_write_indexed(); 575 + ent++; 544 576 break; 545 - /* 546 - * If we hit a match, we need to try again with 547 - * a different ASID. 548 - */ 549 - asid++; 550 - } while (asid < asid_mask); 551 - 552 - if (idx >= 0 && idx != entry) 553 - panic("Unable to uniquify TLB entry %d", idx); 554 - 555 - write_c0_index(entry); 556 - mtc0_tlbw_hazard(); 557 - tlb_write_indexed(); 558 - entry++; 559 - } 577 + } else if (vpn == tlb_vpns[idx]) { 578 + ent++; 579 + } else { 580 + idx++; 581 + } 582 + } 560 583 561 584 tlbw_use_hazard(); 562 585 htw_start(); ··· 627 602 628 603 /* From this point on the ARC firmware is dead. */ 629 604 r4k_tlb_uniquify(); 605 + local_flush_tlb_all(); 630 606 631 607 /* Did I tell you that ARC SUCKS? */ 632 608 }
+13 -7
arch/mips/mti-malta/malta-init.c
··· 241 241 #endif 242 242 243 243 /* 244 - * Setup the Malta max (2GB) memory for PCI DMA in host bridge 245 - * in transparent addressing mode. 244 + * Set up memory mapping in host bridge for PCI DMA masters, 245 + * in transparent addressing mode. For EVA use the Malta 246 + * maximum of 2 GiB memory in the alias space at 0x80000000 247 + * as per PHYS_OFFSET. Otherwise use 256 MiB of memory in 248 + * the regular space, avoiding mapping the PCI MMIO window 249 + * for DMA as it seems to confuse the system controller's 250 + * logic, causing PCI MMIO to stop working. 246 251 */ 247 - mask = PHYS_OFFSET | PCI_BASE_ADDRESS_MEM_PREFETCH; 248 - MSC_WRITE(MSC01_PCI_BAR0, mask); 249 - MSC_WRITE(MSC01_PCI_HEAD4, mask); 252 + mask = PHYS_OFFSET ? PHYS_OFFSET : 0xf0000000; 253 + MSC_WRITE(MSC01_PCI_BAR0, 254 + mask | PCI_BASE_ADDRESS_MEM_PREFETCH); 255 + MSC_WRITE(MSC01_PCI_HEAD4, 256 + PHYS_OFFSET | PCI_BASE_ADDRESS_MEM_PREFETCH); 250 257 251 - mask &= MSC01_PCI_BAR0_SIZE_MSK; 252 258 MSC_WRITE(MSC01_PCI_P2SCMSKL, mask); 253 - MSC_WRITE(MSC01_PCI_P2SCMAPL, mask); 259 + MSC_WRITE(MSC01_PCI_P2SCMAPL, PHYS_OFFSET); 254 260 255 261 /* Don't handle target retries indefinitely. */ 256 262 if ((data & MSC01_PCI_CFG_MAXRTRY_MSK) ==
+1 -1
arch/riscv/include/asm/vendorid_list.h
··· 7 7 8 8 #define ANDES_VENDOR_ID 0x31e 9 9 #define MICROCHIP_VENDOR_ID 0x029 10 + #define MIPS_VENDOR_ID 0x127 10 11 #define SIFIVE_VENDOR_ID 0x489 11 12 #define THEAD_VENDOR_ID 0x5b7 12 - #define MIPS_VENDOR_ID 0x722 13 13 14 14 #endif
+5 -1
arch/riscv/kernel/sbi.c
··· 648 648 649 649 void __init sbi_init(void) 650 650 { 651 + bool srst_power_off = false; 651 652 int ret; 652 653 653 - sbi_set_power_off(); 654 654 ret = sbi_get_spec_version(); 655 655 if (ret > 0) 656 656 sbi_spec_version = ret; ··· 683 683 sbi_probe_extension(SBI_EXT_SRST)) { 684 684 pr_info("SBI SRST extension detected\n"); 685 685 register_platform_power_off(sbi_srst_power_off); 686 + srst_power_off = true; 686 687 sbi_srst_reboot_nb.notifier_call = sbi_srst_reboot; 687 688 sbi_srst_reboot_nb.priority = 192; 688 689 register_restart_handler(&sbi_srst_reboot_nb); ··· 703 702 __sbi_send_ipi = __sbi_send_ipi_v01; 704 703 __sbi_rfence = __sbi_rfence_v01; 705 704 } 705 + 706 + if (!srst_power_off) 707 + sbi_set_power_off(); 706 708 }
-2
arch/x86/events/intel/uncore.c
··· 1325 1325 continue; 1326 1326 1327 1327 pmu = &type->pmus[UNCORE_PCI_DEV_IDX(ids->driver_data)]; 1328 - if (!pmu) 1329 - continue; 1330 1328 1331 1329 if (uncore_pci_get_dev_die_info(pci_sub_dev, &die)) 1332 1330 continue;
+41 -23
drivers/acpi/apei/einj-core.c
··· 182 182 183 183 static void __iomem *einj_param; 184 184 static u32 v5param_size; 185 + static u32 v66param_size; 185 186 static bool is_v2; 186 187 187 188 static void einj_exec_ctx_init(struct apei_exec_context *ctx) ··· 284 283 acpi_os_unmap_iomem(p, sizeof(v)); 285 284 } 286 285 286 + static u32 einjv2_init(struct einjv2_extension_struct *e) 287 + { 288 + if (e->revision != 1) { 289 + pr_info("Unknown v2 extension revision %u\n", e->revision); 290 + return 0; 291 + } 292 + if (e->length < sizeof(*e) || e->length > PAGE_SIZE) { 293 + pr_info(FW_BUG "Bad1 v2 extension length %u\n", e->length); 294 + return 0; 295 + } 296 + if ((e->length - sizeof(*e)) % sizeof(e->component_arr[0])) { 297 + pr_info(FW_BUG "Bad2 v2 extension length %u\n", e->length); 298 + return 0; 299 + } 300 + 301 + return (e->length - sizeof(*e)) / sizeof(e->component_arr[0]); 302 + } 303 + 287 304 static void __iomem *einj_get_parameter_address(void) 288 305 { 289 306 int i; ··· 329 310 v5param_size = sizeof(v5param); 330 311 p = acpi_os_map_iomem(pa_v5, sizeof(*p)); 331 312 if (p) { 332 - int offset, len; 333 - 334 313 memcpy_fromio(&v5param, p, v5param_size); 335 314 acpi5 = 1; 336 315 check_vendor_extension(pa_v5, &v5param); 337 - if (is_v2 && available_error_type & ACPI65_EINJV2_SUPP) { 338 - len = v5param.einjv2_struct.length; 339 - offset = offsetof(struct einjv2_extension_struct, component_arr); 340 - max_nr_components = (len - offset) / 341 - sizeof(v5param.einjv2_struct.component_arr[0]); 342 - /* 343 - * The first call to acpi_os_map_iomem above does not include the 344 - * component array, instead it is used to read and calculate maximum 345 - * number of components supported by the system. Below, the mapping 346 - * is expanded to include the component array. 347 - */ 316 + if (available_error_type & ACPI65_EINJV2_SUPP) { 317 + struct einjv2_extension_struct *e; 318 + 319 + e = &v5param.einjv2_struct; 320 + max_nr_components = einjv2_init(e); 321 + 322 + /* remap including einjv2_extension_struct */ 348 323 acpi_os_unmap_iomem(p, v5param_size); 349 - offset = offsetof(struct set_error_type_with_address, einjv2_struct); 350 - v5param_size = offset + struct_size(&v5param.einjv2_struct, 351 - component_arr, max_nr_components); 352 - p = acpi_os_map_iomem(pa_v5, v5param_size); 324 + v66param_size = v5param_size - sizeof(*e) + e->length; 325 + p = acpi_os_map_iomem(pa_v5, v66param_size); 353 326 } 327 + 354 328 return p; 355 329 } 356 330 } ··· 539 527 u64 param3, u64 param4) 540 528 { 541 529 struct apei_exec_context ctx; 530 + u32 param_size = is_v2 ? v66param_size : v5param_size; 542 531 u64 val, trigger_paddr, timeout = FIRMWARE_TIMEOUT; 543 532 int i, rc; 544 533 ··· 552 539 if (acpi5) { 553 540 struct set_error_type_with_address *v5param; 554 541 555 - v5param = kmalloc(v5param_size, GFP_KERNEL); 542 + v5param = kmalloc(param_size, GFP_KERNEL); 556 543 if (!v5param) 557 544 return -ENOMEM; 558 545 559 - memcpy_fromio(v5param, einj_param, v5param_size); 546 + memcpy_fromio(v5param, einj_param, param_size); 560 547 v5param->type = type; 561 548 if (type & ACPI5_VENDOR_BIT) { 562 549 switch (vendor_flags) { ··· 614 601 break; 615 602 } 616 603 } 617 - memcpy_toio(einj_param, v5param, v5param_size); 604 + memcpy_toio(einj_param, v5param, param_size); 618 605 kfree(v5param); 619 606 } else { 620 607 rc = apei_exec_run(&ctx, ACPI_EINJ_SET_ERROR_TYPE); ··· 1145 1132 struct apei_exec_context ctx; 1146 1133 1147 1134 if (einj_param) { 1148 - acpi_size size = (acpi5) ? 1149 - v5param_size : 1150 - sizeof(struct einj_parameter); 1135 + acpi_size size; 1136 + 1137 + if (v66param_size) 1138 + size = v66param_size; 1139 + else if (acpi5) 1140 + size = v5param_size; 1141 + else 1142 + size = sizeof(struct einj_parameter); 1151 1143 1152 1144 acpi_os_unmap_iomem(einj_param, size); 1153 1145 if (vendor_errors.size)
+2 -2
drivers/acpi/arm64/gtdt.c
··· 430 430 continue; 431 431 432 432 pdev = platform_device_register_data(NULL, "gtdt-arm-mmio-timer", 433 - gwdt_count, &atm, 433 + mmio_timer_count, &atm, 434 434 sizeof(atm)); 435 435 if (IS_ERR(pdev)) { 436 - pr_err("Can't register timer %d\n", gwdt_count); 436 + pr_err("Can't register timer %d\n", mmio_timer_count); 437 437 continue; 438 438 } 439 439
+2 -4
drivers/acpi/processor_driver.c
··· 166 166 if (result && !IS_ENABLED(CONFIG_ACPI_CPU_FREQ_PSS)) 167 167 dev_dbg(&device->dev, "CPPC data invalid or not present\n"); 168 168 169 - acpi_processor_power_init(pr); 169 + if (cpuidle_get_driver() == &acpi_idle_driver) 170 + acpi_processor_power_init(pr); 170 171 171 172 acpi_pss_perf_init(pr); 172 173 ··· 263 262 if (result < 0) 264 263 return result; 265 264 266 - acpi_processor_register_idle_driver(); 267 - 268 265 result = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, 269 266 "acpi/cpu-drv:online", 270 267 acpi_soft_cpu_online, NULL); ··· 301 302 302 303 cpuhp_remove_state_nocalls(hp_online); 303 304 cpuhp_remove_state_nocalls(CPUHP_ACPI_CPUDRV_DEAD); 304 - acpi_processor_unregister_idle_driver(); 305 305 driver_unregister(&acpi_processor_driver); 306 306 } 307 307
+48 -71
drivers/acpi/processor_idle.c
··· 51 51 52 52 static DEFINE_PER_CPU(struct cpuidle_device *, acpi_cpuidle_device); 53 53 54 - static struct cpuidle_driver acpi_idle_driver = { 54 + struct cpuidle_driver acpi_idle_driver = { 55 55 .name = "acpi_idle", 56 56 .owner = THIS_MODULE, 57 57 }; ··· 1357 1357 return 0; 1358 1358 } 1359 1359 1360 - void acpi_processor_register_idle_driver(void) 1360 + static int acpi_processor_registered; 1361 + 1362 + int acpi_processor_power_init(struct acpi_processor *pr) 1361 1363 { 1362 - struct acpi_processor *pr; 1363 - int ret = -ENODEV; 1364 - int cpu; 1365 - 1366 - /* 1367 - * Acpi idle driver is used by all possible CPUs. 1368 - * Install the idle handler by the processor power info of one in them. 1369 - * Note that we use previously set idle handler will be used on 1370 - * platforms that only support C1. 1371 - */ 1372 - for_each_cpu(cpu, (struct cpumask *)cpu_possible_mask) { 1373 - pr = per_cpu(processors, cpu); 1374 - if (!pr) 1375 - continue; 1376 - 1377 - ret = acpi_processor_get_power_info(pr); 1378 - if (!ret) { 1379 - pr->flags.power_setup_done = 1; 1380 - acpi_processor_setup_cpuidle_states(pr); 1381 - break; 1382 - } 1383 - } 1384 - 1385 - if (ret) { 1386 - pr_debug("No ACPI power information from any CPUs.\n"); 1387 - return; 1388 - } 1389 - 1390 - ret = cpuidle_register_driver(&acpi_idle_driver); 1391 - if (ret) { 1392 - pr_debug("register %s failed.\n", acpi_idle_driver.name); 1393 - return; 1394 - } 1395 - pr_debug("%s registered with cpuidle.\n", acpi_idle_driver.name); 1396 - } 1397 - 1398 - void acpi_processor_unregister_idle_driver(void) 1399 - { 1400 - cpuidle_unregister_driver(&acpi_idle_driver); 1401 - } 1402 - 1403 - void acpi_processor_power_init(struct acpi_processor *pr) 1404 - { 1364 + int retval; 1405 1365 struct cpuidle_device *dev; 1406 1366 1407 - /* 1408 - * The code below only works if the current cpuidle driver is the ACPI 1409 - * idle driver. 1410 - */ 1411 - if (cpuidle_get_driver() != &acpi_idle_driver) 1412 - return; 1413 - 1414 1367 if (disabled_by_idle_boot_param()) 1415 - return; 1368 + return 0; 1416 1369 1417 1370 acpi_processor_cstate_first_run_checks(); 1418 1371 1419 1372 if (!acpi_processor_get_power_info(pr)) 1420 1373 pr->flags.power_setup_done = 1; 1421 1374 1422 - if (!pr->flags.power) 1423 - return; 1424 - 1425 - dev = kzalloc(sizeof(*dev), GFP_KERNEL); 1426 - if (!dev) 1427 - return; 1428 - 1429 - per_cpu(acpi_cpuidle_device, pr->id) = dev; 1430 - 1431 - acpi_processor_setup_cpuidle_dev(pr, dev); 1432 - 1433 1375 /* 1434 - * Register a cpuidle device for this CPU. The cpuidle driver using 1435 - * this device is expected to be registered. 1376 + * Install the idle handler if processor power management is supported. 1377 + * Note that we use previously set idle handler will be used on 1378 + * platforms that only support C1. 1436 1379 */ 1437 - if (cpuidle_register_device(dev)) { 1438 - per_cpu(acpi_cpuidle_device, pr->id) = NULL; 1439 - kfree(dev); 1380 + if (pr->flags.power) { 1381 + /* Register acpi_idle_driver if not already registered */ 1382 + if (!acpi_processor_registered) { 1383 + acpi_processor_setup_cpuidle_states(pr); 1384 + retval = cpuidle_register_driver(&acpi_idle_driver); 1385 + if (retval) 1386 + return retval; 1387 + pr_debug("%s registered with cpuidle\n", 1388 + acpi_idle_driver.name); 1389 + } 1390 + 1391 + dev = kzalloc(sizeof(*dev), GFP_KERNEL); 1392 + if (!dev) 1393 + return -ENOMEM; 1394 + per_cpu(acpi_cpuidle_device, pr->id) = dev; 1395 + 1396 + acpi_processor_setup_cpuidle_dev(pr, dev); 1397 + 1398 + /* Register per-cpu cpuidle_device. Cpuidle driver 1399 + * must already be registered before registering device 1400 + */ 1401 + retval = cpuidle_register_device(dev); 1402 + if (retval) { 1403 + if (acpi_processor_registered == 0) 1404 + cpuidle_unregister_driver(&acpi_idle_driver); 1405 + 1406 + per_cpu(acpi_cpuidle_device, pr->id) = NULL; 1407 + kfree(dev); 1408 + return retval; 1409 + } 1410 + acpi_processor_registered++; 1440 1411 } 1412 + return 0; 1441 1413 } 1442 1414 1443 - void acpi_processor_power_exit(struct acpi_processor *pr) 1415 + int acpi_processor_power_exit(struct acpi_processor *pr) 1444 1416 { 1445 1417 struct cpuidle_device *dev = per_cpu(acpi_cpuidle_device, pr->id); 1446 1418 1447 1419 if (disabled_by_idle_boot_param()) 1448 - return; 1420 + return 0; 1449 1421 1450 1422 if (pr->flags.power) { 1451 1423 cpuidle_unregister_device(dev); 1424 + acpi_processor_registered--; 1425 + if (acpi_processor_registered == 0) 1426 + cpuidle_unregister_driver(&acpi_idle_driver); 1427 + 1452 1428 kfree(dev); 1453 1429 } 1454 1430 1455 1431 pr->flags.power_setup_done = 0; 1432 + return 0; 1456 1433 } 1457 1434 1458 1435 MODULE_IMPORT_NS("ACPI_PROCESSOR_IDLE");
+10
drivers/ata/libata-core.c
··· 3006 3006 } 3007 3007 3008 3008 dev->n_sectors = ata_id_n_sectors(id); 3009 + if (ata_id_is_locked(id)) { 3010 + /* 3011 + * If Security locked, set capacity to zero to prevent 3012 + * any I/O, e.g. partition scanning, as any I/O to a 3013 + * locked drive will result in user visible errors. 3014 + */ 3015 + ata_dev_info(dev, 3016 + "Security locked, setting capacity to zero\n"); 3017 + dev->n_sectors = 0; 3018 + } 3009 3019 3010 3020 /* get current R/W Multiple count setting */ 3011 3021 if ((dev->id[47] >> 8) == 0x80 && (dev->id[59] & 0x100)) {
+10 -1
drivers/ata/libata-scsi.c
··· 992 992 return; 993 993 } 994 994 995 + if (ata_id_is_locked(dev->id)) { 996 + /* Security locked */ 997 + /* LOGICAL UNIT ACCESS NOT AUTHORIZED */ 998 + ata_scsi_set_sense(dev, cmd, DATA_PROTECT, 0x74, 0x71); 999 + return; 1000 + } 1001 + 995 1002 if (!(qc->flags & ATA_QCFLAG_RTF_FILLED)) { 996 1003 ata_dev_dbg(dev, 997 1004 "Missing result TF: reporting aborted command\n"); ··· 4901 4894 spin_unlock_irqrestore(ap->lock, flags); 4902 4895 if (do_resume) { 4903 4896 ret = scsi_resume_device(sdev); 4904 - if (ret == -EWOULDBLOCK) 4897 + if (ret == -EWOULDBLOCK) { 4898 + scsi_device_put(sdev); 4905 4899 goto unlock_scan; 4900 + } 4906 4901 dev->flags &= ~ATA_DFLAG_RESUMING; 4907 4902 } 4908 4903 ret = scsi_rescan_device(sdev);
+2
drivers/atm/fore200e.c
··· 1374 1374 1375 1375 vcc->dev_data = NULL; 1376 1376 1377 + mutex_lock(&fore200e->rate_mtx); 1377 1378 fore200e->available_cell_rate += vcc->qos.txtp.max_pcr; 1379 + mutex_unlock(&fore200e->rate_mtx); 1378 1380 1379 1381 kfree(fore200e_vcc); 1380 1382 return -EINVAL;
+16 -9
drivers/base/power/main.c
··· 888 888 TRACE_DEVICE(dev); 889 889 TRACE_RESUME(0); 890 890 891 - if (dev->power.syscore || dev->power.direct_complete) 891 + if (dev->power.direct_complete) 892 892 goto Out; 893 893 894 894 if (!dev->power.is_late_suspended) 895 895 goto Out; 896 + 897 + if (dev->power.syscore) 898 + goto Skip; 896 899 897 900 if (!dpm_wait_for_superior(dev, async)) 898 901 goto Out; ··· 929 926 930 927 Skip: 931 928 dev->power.is_late_suspended = false; 929 + pm_runtime_enable(dev); 932 930 933 931 Out: 934 932 TRACE_RESUME(error); 935 933 936 - pm_runtime_enable(dev); 937 934 complete_all(&dev->power.completion); 938 935 939 936 if (error) { ··· 1618 1615 TRACE_DEVICE(dev); 1619 1616 TRACE_SUSPEND(0); 1620 1617 1621 - /* 1622 - * Disable runtime PM for the device without checking if there is a 1623 - * pending resume request for it. 1624 - */ 1625 - __pm_runtime_disable(dev, false); 1626 - 1627 1618 dpm_wait_for_subordinate(dev, async); 1628 1619 1629 1620 if (READ_ONCE(async_error)) ··· 1628 1631 goto Complete; 1629 1632 } 1630 1633 1631 - if (dev->power.syscore || dev->power.direct_complete) 1634 + if (dev->power.direct_complete) 1632 1635 goto Complete; 1636 + 1637 + /* 1638 + * Disable runtime PM for the device without checking if there is a 1639 + * pending resume request for it. 1640 + */ 1641 + __pm_runtime_disable(dev, false); 1642 + 1643 + if (dev->power.syscore) 1644 + goto Skip; 1633 1645 1634 1646 if (dev->pm_domain) { 1635 1647 info = "late power domain "; ··· 1670 1664 WRITE_ONCE(async_error, error); 1671 1665 dpm_save_failed_dev(dev_name(dev)); 1672 1666 pm_dev_err(dev, state, async ? " async late" : " late", error); 1667 + pm_runtime_enable(dev); 1673 1668 goto Complete; 1674 1669 } 1675 1670 dpm_propagate_wakeup_to_parent(dev);
+32 -7
drivers/bluetooth/btusb.c
··· 2711 2711 2712 2712 static void btusb_mtk_claim_iso_intf(struct btusb_data *data) 2713 2713 { 2714 - struct btmtk_data *btmtk_data = hci_get_priv(data->hdev); 2714 + struct btmtk_data *btmtk_data; 2715 2715 int err; 2716 + 2717 + if (!data->hdev) 2718 + return; 2719 + 2720 + btmtk_data = hci_get_priv(data->hdev); 2721 + if (!btmtk_data) 2722 + return; 2723 + 2724 + if (!btmtk_data->isopkt_intf) { 2725 + bt_dev_err(data->hdev, "Can't claim NULL iso interface"); 2726 + return; 2727 + } 2716 2728 2717 2729 /* 2718 2730 * The function usb_driver_claim_interface() is documented to need ··· 2747 2735 2748 2736 static void btusb_mtk_release_iso_intf(struct hci_dev *hdev) 2749 2737 { 2750 - struct btmtk_data *btmtk_data = hci_get_priv(hdev); 2738 + struct btmtk_data *btmtk_data; 2739 + 2740 + if (!hdev) 2741 + return; 2742 + 2743 + btmtk_data = hci_get_priv(hdev); 2744 + if (!btmtk_data) 2745 + return; 2751 2746 2752 2747 if (test_bit(BTMTK_ISOPKT_OVER_INTR, &btmtk_data->flags)) { 2753 2748 usb_kill_anchored_urbs(&btmtk_data->isopkt_anchor); 2754 2749 clear_bit(BTMTK_ISOPKT_RUNNING, &btmtk_data->flags); 2755 2750 2756 - dev_kfree_skb_irq(btmtk_data->isopkt_skb); 2757 - btmtk_data->isopkt_skb = NULL; 2758 - usb_set_intfdata(btmtk_data->isopkt_intf, NULL); 2759 - usb_driver_release_interface(&btusb_driver, 2760 - btmtk_data->isopkt_intf); 2751 + if (btmtk_data->isopkt_skb) { 2752 + dev_kfree_skb_irq(btmtk_data->isopkt_skb); 2753 + btmtk_data->isopkt_skb = NULL; 2754 + } 2755 + 2756 + if (btmtk_data->isopkt_intf) { 2757 + usb_set_intfdata(btmtk_data->isopkt_intf, NULL); 2758 + usb_driver_release_interface(&btusb_driver, 2759 + btmtk_data->isopkt_intf); 2760 + btmtk_data->isopkt_intf = NULL; 2761 + } 2761 2762 } 2762 2763 2763 2764 clear_bit(BTMTK_ISOPKT_OVER_INTR, &btmtk_data->flags);
+2 -2
drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c
··· 121 121 &r_apb0_clk.common.hw, 0x1cc, BIT(0), 0); 122 122 123 123 static SUNXI_CCU_GATE_HW(bus_r_dma_clk, "bus-r-dma", 124 - &r_apb0_clk.common.hw, 0x1dc, BIT(0), 0); 124 + &r_apb0_clk.common.hw, 0x1dc, BIT(0), CLK_IS_CRITICAL); 125 125 static SUNXI_CCU_GATE_HW(bus_r_rtc_clk, "bus-r-rtc", 126 126 &r_apb0_clk.common.hw, 0x20c, BIT(0), 0); 127 127 static SUNXI_CCU_GATE_HW(bus_r_cpucfg_clk, "bus-r-cpucfg", 128 - &r_apb0_clk.common.hw, 0x22c, BIT(0), 0); 128 + &r_apb0_clk.common.hw, 0x22c, BIT(0), CLK_IS_CRITICAL); 129 129 130 130 static struct ccu_common *sun55i_a523_r_ccu_clks[] = { 131 131 &r_ahb_clk.common,
+1 -1
drivers/clk/sunxi-ng/ccu-sun55i-a523.c
··· 300 300 .m = _SUNXI_CCU_DIV(16, 6), 301 301 .sdm = _SUNXI_CCU_SDM(pll_audio0_sdm_table, BIT(24), 302 302 0x178, BIT(31)), 303 - .min_rate = 180000000U, 303 + .min_rate = 90000000U, 304 304 .max_rate = 3000000000U, 305 305 .common = { 306 306 .reg = 0x078,
+7 -2
drivers/gpio/gpiolib-cdev.c
··· 2548 2548 container_of(nb, struct gpio_chardev_data, lineinfo_changed_nb); 2549 2549 struct lineinfo_changed_ctx *ctx; 2550 2550 struct gpio_desc *desc = data; 2551 + struct file *fp; 2551 2552 2552 2553 if (!test_bit(gpio_chip_hwgpio(desc), cdev->watched_lines)) 2554 + return NOTIFY_DONE; 2555 + 2556 + /* Keep the file descriptor alive for the duration of the notification. */ 2557 + fp = get_file_active(&cdev->fp); 2558 + if (!fp) 2559 + /* Chardev file descriptor was or is being released. */ 2553 2560 return NOTIFY_DONE; 2554 2561 2555 2562 /* ··· 2582 2575 /* Keep the GPIO device alive until we emit the event. */ 2583 2576 ctx->gdev = gpio_device_get(desc->gdev); 2584 2577 ctx->cdev = cdev; 2585 - /* Keep the file descriptor alive too. */ 2586 - get_file(ctx->cdev->fp); 2587 2578 2588 2579 INIT_WORK(&ctx->work, lineinfo_changed_func); 2589 2580 queue_work(ctx->gdev->line_state_wq, &ctx->work);
+2 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 3414 3414 (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX || 3415 3415 adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA)) 3416 3416 continue; 3417 - /* skip CG for VCE/UVD, it's handled specially */ 3417 + /* skip CG for VCE/UVD/VPE, it's handled specially */ 3418 3418 if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && 3419 3419 adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE && 3420 3420 adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCN && 3421 + adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VPE && 3421 3422 adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_JPEG && 3422 3423 adev->ip_blocks[i].version->funcs->set_powergating_state) { 3423 3424 /* enable powergating to save power */
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
··· 1372 1372 mem->mem_type == AMDGPU_PL_MMIO_REMAP)) { 1373 1373 flags |= AMDGPU_PTE_SYSTEM; 1374 1374 1375 - if (ttm->caching == ttm_cached) 1375 + if (ttm && ttm->caching == ttm_cached) 1376 1376 flags |= AMDGPU_PTE_SNOOPED; 1377 1377 } 1378 1378
+2 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
··· 2078 2078 struct amdgpu_bo *bo = before->bo_va->base.bo; 2079 2079 2080 2080 amdgpu_vm_it_insert(before, &vm->va); 2081 - if (before->flags & AMDGPU_PTE_PRT_FLAG(adev)) 2081 + if (before->flags & AMDGPU_VM_PAGE_PRT) 2082 2082 amdgpu_vm_prt_get(adev); 2083 2083 2084 2084 if (amdgpu_vm_is_bo_always_valid(vm, bo) && ··· 2093 2093 struct amdgpu_bo *bo = after->bo_va->base.bo; 2094 2094 2095 2095 amdgpu_vm_it_insert(after, &vm->va); 2096 - if (after->flags & AMDGPU_PTE_PRT_FLAG(adev)) 2096 + if (after->flags & AMDGPU_VM_PAGE_PRT) 2097 2097 amdgpu_vm_prt_get(adev); 2098 2098 2099 2099 if (amdgpu_vm_is_bo_always_valid(vm, bo) &&
+2 -2
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
··· 5872 5872 if (flags & AMDGPU_IB_PREEMPTED) 5873 5873 control |= INDIRECT_BUFFER_PRE_RESUME(1); 5874 5874 5875 - if (vmid) 5875 + if (vmid && !ring->adev->gfx.rs64_enable) 5876 5876 gfx_v11_0_ring_emit_de_meta(ring, 5877 - (!amdgpu_sriov_vf(ring->adev) && flags & AMDGPU_IB_PREEMPTED) ? true : false); 5877 + !amdgpu_sriov_vf(ring->adev) && (flags & AMDGPU_IB_PREEMPTED)); 5878 5878 } 5879 5879 5880 5880 amdgpu_ring_write(ring, header);
+1 -1
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
··· 141 141 adev->vcn.supported_reset = 142 142 amdgpu_get_soft_full_reset_mask(&adev->vcn.inst[0].ring_enc[0]); 143 143 144 - if (amdgpu_dpm_reset_vcn_is_supported(adev)) 144 + if (amdgpu_dpm_reset_vcn_is_supported(adev) && !amdgpu_sriov_vf(adev)) 145 145 adev->vcn.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE; 146 146 147 147 return 0;
+3 -1
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
··· 122 122 123 123 switch (amdgpu_ip_version(adev, MP0_HWIP, 0)) { 124 124 case IP_VERSION(13, 0, 12): 125 - if ((adev->psp.sos.fw_version >= 0x00450025) && amdgpu_dpm_reset_vcn_is_supported(adev)) 125 + if ((adev->psp.sos.fw_version >= 0x00450025) && 126 + amdgpu_dpm_reset_vcn_is_supported(adev) && 127 + !amdgpu_sriov_vf(adev)) 126 128 adev->vcn.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE; 127 129 break; 128 130 default:
+138
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 3859 3859 update_subconnector_property(aconnector); 3860 3860 } 3861 3861 3862 + static bool are_sinks_equal(const struct dc_sink *sink1, const struct dc_sink *sink2) 3863 + { 3864 + if (!sink1 || !sink2) 3865 + return false; 3866 + if (sink1->sink_signal != sink2->sink_signal) 3867 + return false; 3868 + 3869 + if (sink1->dc_edid.length != sink2->dc_edid.length) 3870 + return false; 3871 + 3872 + if (memcmp(sink1->dc_edid.raw_edid, sink2->dc_edid.raw_edid, 3873 + sink1->dc_edid.length) != 0) 3874 + return false; 3875 + return true; 3876 + } 3877 + 3878 + 3879 + /** 3880 + * DOC: hdmi_hpd_debounce_work 3881 + * 3882 + * HDMI HPD debounce delay in milliseconds. When an HDMI display toggles HPD 3883 + * (such as during power save transitions), this delay determines how long to 3884 + * wait before processing the HPD event. This allows distinguishing between a 3885 + * physical unplug (>hdmi_hpd_debounce_delay) 3886 + * and a spontaneous RX HPD toggle (<hdmi_hpd_debounce_delay). 3887 + * 3888 + * If the toggle is less than this delay, the driver compares sink capabilities 3889 + * and permits a hotplug event if they changed. 3890 + * 3891 + * The default value of 1500ms was chosen based on experimental testing with 3892 + * various monitors that exhibit spontaneous HPD toggling behavior. 3893 + */ 3894 + static void hdmi_hpd_debounce_work(struct work_struct *work) 3895 + { 3896 + struct amdgpu_dm_connector *aconnector = 3897 + container_of(to_delayed_work(work), struct amdgpu_dm_connector, 3898 + hdmi_hpd_debounce_work); 3899 + struct drm_connector *connector = &aconnector->base; 3900 + struct drm_device *dev = connector->dev; 3901 + struct amdgpu_device *adev = drm_to_adev(dev); 3902 + struct dc *dc = aconnector->dc_link->ctx->dc; 3903 + bool fake_reconnect = false; 3904 + bool reallow_idle = false; 3905 + bool ret = false; 3906 + guard(mutex)(&aconnector->hpd_lock); 3907 + 3908 + /* Re-detect the display */ 3909 + scoped_guard(mutex, &adev->dm.dc_lock) { 3910 + if (dc->caps.ips_support && dc->ctx->dmub_srv->idle_allowed) { 3911 + dc_allow_idle_optimizations(dc, false); 3912 + reallow_idle = true; 3913 + } 3914 + ret = dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD); 3915 + } 3916 + 3917 + if (ret) { 3918 + /* Apply workaround delay for certain panels */ 3919 + apply_delay_after_dpcd_poweroff(adev, aconnector->dc_sink); 3920 + /* Compare sinks to determine if this was a spontaneous HPD toggle */ 3921 + if (are_sinks_equal(aconnector->dc_link->local_sink, aconnector->hdmi_prev_sink)) { 3922 + /* 3923 + * Sinks match - this was a spontaneous HDMI HPD toggle. 3924 + */ 3925 + drm_dbg_kms(dev, "HDMI HPD: Sink unchanged after debounce, internal re-enable\n"); 3926 + fake_reconnect = true; 3927 + } 3928 + 3929 + /* Update connector state */ 3930 + amdgpu_dm_update_connector_after_detect(aconnector); 3931 + 3932 + drm_modeset_lock_all(dev); 3933 + dm_restore_drm_connector_state(dev, connector); 3934 + drm_modeset_unlock_all(dev); 3935 + 3936 + /* Only notify OS if sink actually changed */ 3937 + if (!fake_reconnect && aconnector->base.force == DRM_FORCE_UNSPECIFIED) 3938 + drm_kms_helper_hotplug_event(dev); 3939 + } 3940 + 3941 + /* Release the cached sink reference */ 3942 + if (aconnector->hdmi_prev_sink) { 3943 + dc_sink_release(aconnector->hdmi_prev_sink); 3944 + aconnector->hdmi_prev_sink = NULL; 3945 + } 3946 + 3947 + scoped_guard(mutex, &adev->dm.dc_lock) { 3948 + if (reallow_idle && dc->caps.ips_support) 3949 + dc_allow_idle_optimizations(dc, true); 3950 + } 3951 + } 3952 + 3862 3953 static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector) 3863 3954 { 3864 3955 struct drm_connector *connector = &aconnector->base; ··· 3959 3868 struct dm_connector_state *dm_con_state = to_dm_connector_state(connector->state); 3960 3869 struct dc *dc = aconnector->dc_link->ctx->dc; 3961 3870 bool ret = false; 3871 + bool debounce_required = false; 3962 3872 3963 3873 if (adev->dm.disable_hpd_irq) 3964 3874 return; ··· 3982 3890 if (!dc_link_detect_connection_type(aconnector->dc_link, &new_connection_type)) 3983 3891 drm_err(adev_to_drm(adev), "KMS: Failed to detect connector\n"); 3984 3892 3893 + /* 3894 + * Check for HDMI disconnect with debounce enabled. 3895 + */ 3896 + debounce_required = (aconnector->hdmi_hpd_debounce_delay_ms > 0 && 3897 + dc_is_hdmi_signal(aconnector->dc_link->connector_signal) && 3898 + new_connection_type == dc_connection_none && 3899 + aconnector->dc_link->local_sink != NULL); 3900 + 3985 3901 if (aconnector->base.force && new_connection_type == dc_connection_none) { 3986 3902 emulated_link_detect(aconnector->dc_link); 3987 3903 ··· 3999 3899 4000 3900 if (aconnector->base.force == DRM_FORCE_UNSPECIFIED) 4001 3901 drm_kms_helper_connector_hotplug_event(connector); 3902 + } else if (debounce_required) { 3903 + /* 3904 + * HDMI disconnect detected - schedule delayed work instead of 3905 + * processing immediately. This allows us to coalesce spurious 3906 + * HDMI signals from physical unplugs. 3907 + */ 3908 + drm_dbg_kms(dev, "HDMI HPD: Disconnect detected, scheduling debounce work (%u ms)\n", 3909 + aconnector->hdmi_hpd_debounce_delay_ms); 3910 + 3911 + /* Cache the current sink for later comparison */ 3912 + if (aconnector->hdmi_prev_sink) 3913 + dc_sink_release(aconnector->hdmi_prev_sink); 3914 + aconnector->hdmi_prev_sink = aconnector->dc_link->local_sink; 3915 + if (aconnector->hdmi_prev_sink) 3916 + dc_sink_retain(aconnector->hdmi_prev_sink); 3917 + 3918 + /* Schedule delayed detection. */ 3919 + if (mod_delayed_work(system_wq, 3920 + &aconnector->hdmi_hpd_debounce_work, 3921 + msecs_to_jiffies(aconnector->hdmi_hpd_debounce_delay_ms))) 3922 + drm_dbg_kms(dev, "HDMI HPD: Re-scheduled debounce work\n"); 3923 + 4002 3924 } else { 3925 + 3926 + /* If the aconnector->hdmi_hpd_debounce_work is scheduled, exit early */ 3927 + if (delayed_work_pending(&aconnector->hdmi_hpd_debounce_work)) 3928 + return; 3929 + 4003 3930 scoped_guard(mutex, &adev->dm.dc_lock) { 4004 3931 dc_exit_ips_for_hw_access(dc); 4005 3932 ret = dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD); ··· 7515 7388 if (aconnector->mst_mgr.dev) 7516 7389 drm_dp_mst_topology_mgr_destroy(&aconnector->mst_mgr); 7517 7390 7391 + /* Cancel and flush any pending HDMI HPD debounce work */ 7392 + cancel_delayed_work_sync(&aconnector->hdmi_hpd_debounce_work); 7393 + if (aconnector->hdmi_prev_sink) { 7394 + dc_sink_release(aconnector->hdmi_prev_sink); 7395 + aconnector->hdmi_prev_sink = NULL; 7396 + } 7397 + 7518 7398 if (aconnector->bl_idx != -1) { 7519 7399 backlight_device_unregister(dm->backlight_dev[aconnector->bl_idx]); 7520 7400 dm->backlight_dev[aconnector->bl_idx] = NULL; ··· 8682 8548 memset(&aconnector->vsdb_info, 0, sizeof(aconnector->vsdb_info)); 8683 8549 mutex_init(&aconnector->hpd_lock); 8684 8550 mutex_init(&aconnector->handle_mst_msg_ready); 8551 + 8552 + aconnector->hdmi_hpd_debounce_delay_ms = AMDGPU_DM_HDMI_HPD_DEBOUNCE_MS; 8553 + INIT_DELAYED_WORK(&aconnector->hdmi_hpd_debounce_work, hdmi_hpd_debounce_work); 8554 + aconnector->hdmi_prev_sink = NULL; 8685 8555 8686 8556 /* 8687 8557 * configure support HPD hot plug connector_>polled default value is 0
+6
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
··· 59 59 60 60 #define AMDGPU_HDR_MULT_DEFAULT (0x100000000LL) 61 61 62 + #define AMDGPU_DM_HDMI_HPD_DEBOUNCE_MS 1500 62 63 /* 63 64 #include "include/amdgpu_dal_power_if.h" 64 65 #include "amdgpu_dm_irq.h" ··· 820 819 bool pack_sdp_v1_3; 821 820 enum adaptive_sync_type as_type; 822 821 struct amdgpu_hdmi_vsdb_info vsdb_info; 822 + 823 + /* HDMI HPD debounce support */ 824 + unsigned int hdmi_hpd_debounce_delay_ms; 825 + struct delayed_work hdmi_hpd_debounce_work; 826 + struct dc_sink *hdmi_prev_sink; 823 827 }; 824 828 825 829 static inline void amdgpu_dm_set_mst_status(uint8_t *status,
+23 -36
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
··· 884 884 }; 885 885 886 886 #if defined(CONFIG_DRM_AMD_DC_FP) 887 - static uint16_t get_fec_overhead_multiplier(struct dc_link *dc_link) 887 + static uint64_t kbps_to_pbn(int kbps, bool is_peak_pbn) 888 888 { 889 - u8 link_coding_cap; 890 - uint16_t fec_overhead_multiplier_x1000 = PBN_FEC_OVERHEAD_MULTIPLIER_8B_10B; 889 + uint64_t effective_kbps = (uint64_t)kbps; 891 890 892 - link_coding_cap = dc_link_dp_mst_decide_link_encoding_format(dc_link); 893 - if (link_coding_cap == DP_128b_132b_ENCODING) 894 - fec_overhead_multiplier_x1000 = PBN_FEC_OVERHEAD_MULTIPLIER_128B_132B; 891 + if (is_peak_pbn) { // add 0.6% (1006/1000) overhead into effective kbps 892 + effective_kbps *= 1006; 893 + effective_kbps = div_u64(effective_kbps, 1000); 894 + } 895 895 896 - return fec_overhead_multiplier_x1000; 896 + return (uint64_t) DIV64_U64_ROUND_UP(effective_kbps * 64, (54 * 8 * 1000)); 897 897 } 898 898 899 - static int kbps_to_peak_pbn(int kbps, uint16_t fec_overhead_multiplier_x1000) 899 + static uint32_t pbn_to_kbps(unsigned int pbn, bool with_margin) 900 900 { 901 - u64 peak_kbps = kbps; 901 + uint64_t pbn_effective = (uint64_t)pbn; 902 902 903 - peak_kbps *= 1006; 904 - peak_kbps *= fec_overhead_multiplier_x1000; 905 - peak_kbps = div_u64(peak_kbps, 1000 * 1000); 906 - return (int) DIV64_U64_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000)); 903 + if (with_margin) // deduct 0.6% (994/1000) overhead from effective pbn 904 + pbn_effective *= (1000000 / PEAK_FACTOR_X1000); 905 + else 906 + pbn_effective *= 1000; 907 + 908 + return DIV_U64_ROUND_UP(pbn_effective * 8 * 54, 64); 907 909 } 908 910 909 911 static void set_dsc_configs_from_fairness_vars(struct dsc_mst_fairness_params *params, ··· 976 974 dc_dsc_get_default_config_option(param.sink->ctx->dc, &dsc_options); 977 975 dsc_options.max_target_bpp_limit_override_x16 = drm_connector->display_info.max_dsc_bpp * 16; 978 976 979 - kbps = div_u64((u64)pbn * 994 * 8 * 54, 64); 977 + kbps = pbn_to_kbps(pbn, false); 980 978 dc_dsc_compute_config( 981 979 param.sink->ctx->dc->res_pool->dscs[0], 982 980 &param.sink->dsc_caps.dsc_dec_caps, ··· 1005 1003 int link_timeslots_used; 1006 1004 int fair_pbn_alloc; 1007 1005 int ret = 0; 1008 - uint16_t fec_overhead_multiplier_x1000 = get_fec_overhead_multiplier(dc_link); 1009 1006 1010 1007 for (i = 0; i < count; i++) { 1011 1008 if (vars[i + k].dsc_enabled) { 1012 1009 initial_slack[i] = 1013 - kbps_to_peak_pbn(params[i].bw_range.max_kbps, fec_overhead_multiplier_x1000) - vars[i + k].pbn; 1010 + kbps_to_pbn(params[i].bw_range.max_kbps, false) - vars[i + k].pbn; 1014 1011 bpp_increased[i] = false; 1015 1012 remaining_to_increase += 1; 1016 1013 } else { ··· 1105 1104 int next_index; 1106 1105 int remaining_to_try = 0; 1107 1106 int ret; 1108 - uint16_t fec_overhead_multiplier_x1000 = get_fec_overhead_multiplier(dc_link); 1109 1107 int var_pbn; 1110 1108 1111 1109 for (i = 0; i < count; i++) { ··· 1137 1137 1138 1138 DRM_DEBUG_DRIVER("MST_DSC index #%d, try no compression\n", next_index); 1139 1139 var_pbn = vars[next_index].pbn; 1140 - vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps, fec_overhead_multiplier_x1000); 1140 + vars[next_index].pbn = kbps_to_pbn(params[next_index].bw_range.stream_kbps, true); 1141 1141 ret = drm_dp_atomic_find_time_slots(state, 1142 1142 params[next_index].port->mgr, 1143 1143 params[next_index].port, ··· 1197 1197 int count = 0; 1198 1198 int i, k, ret; 1199 1199 bool debugfs_overwrite = false; 1200 - uint16_t fec_overhead_multiplier_x1000 = get_fec_overhead_multiplier(dc_link); 1201 1200 struct drm_connector_state *new_conn_state; 1202 1201 1203 1202 memset(params, 0, sizeof(params)); ··· 1277 1278 DRM_DEBUG_DRIVER("MST_DSC Try no compression\n"); 1278 1279 for (i = 0; i < count; i++) { 1279 1280 vars[i + k].aconnector = params[i].aconnector; 1280 - vars[i + k].pbn = kbps_to_peak_pbn(params[i].bw_range.stream_kbps, fec_overhead_multiplier_x1000); 1281 + vars[i + k].pbn = kbps_to_pbn(params[i].bw_range.stream_kbps, false); 1281 1282 vars[i + k].dsc_enabled = false; 1282 1283 vars[i + k].bpp_x16 = 0; 1283 1284 ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr, params[i].port, ··· 1299 1300 DRM_DEBUG_DRIVER("MST_DSC Try max compression\n"); 1300 1301 for (i = 0; i < count; i++) { 1301 1302 if (params[i].compression_possible && params[i].clock_force_enable != DSC_CLK_FORCE_DISABLE) { 1302 - vars[i + k].pbn = kbps_to_peak_pbn(params[i].bw_range.min_kbps, fec_overhead_multiplier_x1000); 1303 + vars[i + k].pbn = kbps_to_pbn(params[i].bw_range.min_kbps, false); 1303 1304 vars[i + k].dsc_enabled = true; 1304 1305 vars[i + k].bpp_x16 = params[i].bw_range.min_target_bpp_x16; 1305 1306 ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr, ··· 1307 1308 if (ret < 0) 1308 1309 return ret; 1309 1310 } else { 1310 - vars[i + k].pbn = kbps_to_peak_pbn(params[i].bw_range.stream_kbps, fec_overhead_multiplier_x1000); 1311 + vars[i + k].pbn = kbps_to_pbn(params[i].bw_range.stream_kbps, false); 1311 1312 vars[i + k].dsc_enabled = false; 1312 1313 vars[i + k].bpp_x16 = 0; 1313 1314 ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr, ··· 1762 1763 return ret; 1763 1764 } 1764 1765 1765 - static uint32_t kbps_from_pbn(unsigned int pbn) 1766 - { 1767 - uint64_t kbps = (uint64_t)pbn; 1768 - 1769 - kbps *= (1000000 / PEAK_FACTOR_X1000); 1770 - kbps *= 8; 1771 - kbps *= 54; 1772 - kbps /= 64; 1773 - 1774 - return (uint32_t)kbps; 1775 - } 1776 - 1777 1766 static bool is_dsc_common_config_possible(struct dc_stream_state *stream, 1778 1767 struct dc_dsc_bw_range *bw_range) 1779 1768 { ··· 1860 1873 dc_link_get_highest_encoding_format(stream->link)); 1861 1874 cur_link_settings = stream->link->verified_link_cap; 1862 1875 root_link_bw_in_kbps = dc_link_bandwidth_kbps(aconnector->dc_link, &cur_link_settings); 1863 - virtual_channel_bw_in_kbps = kbps_from_pbn(aconnector->mst_output_port->full_pbn); 1876 + virtual_channel_bw_in_kbps = pbn_to_kbps(aconnector->mst_output_port->full_pbn, true); 1864 1877 1865 1878 /* pick the end to end bw bottleneck */ 1866 1879 end_to_end_bw_in_kbps = min(root_link_bw_in_kbps, virtual_channel_bw_in_kbps); ··· 1913 1926 immediate_upstream_port = aconnector->mst_output_port->parent->port_parent; 1914 1927 1915 1928 if (immediate_upstream_port) { 1916 - virtual_channel_bw_in_kbps = kbps_from_pbn(immediate_upstream_port->full_pbn); 1929 + virtual_channel_bw_in_kbps = pbn_to_kbps(immediate_upstream_port->full_pbn, true); 1917 1930 virtual_channel_bw_in_kbps = min(root_link_bw_in_kbps, virtual_channel_bw_in_kbps); 1918 1931 } else { 1919 1932 /* For topology LCT 1 case - only one mstb*/
+3 -1
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
··· 394 394 display_count = dcn35_get_active_display_cnt_wa(dc, context, &all_active_disps); 395 395 if (new_clocks->dtbclk_en && !new_clocks->ref_dtbclk_khz) 396 396 new_clocks->ref_dtbclk_khz = 600000; 397 + else if (!new_clocks->dtbclk_en && new_clocks->ref_dtbclk_khz > 590000) 398 + new_clocks->ref_dtbclk_khz = 0; 397 399 398 400 /* 399 401 * if it is safe to lower, but we are already in the lower state, we don't have to do anything ··· 437 435 438 436 actual_dtbclk = REG_READ(CLK1_CLK4_CURRENT_CNT); 439 437 440 - if (actual_dtbclk) { 438 + if (actual_dtbclk > 590000) { 441 439 clk_mgr_base->clks.ref_dtbclk_khz = new_clocks->ref_dtbclk_khz; 442 440 clk_mgr_base->clks.dtbclk_en = new_clocks->dtbclk_en; 443 441 }
+1 -1
drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c
··· 1411 1411 __func__, params->otg_inst, params->pixclk_khz, 1412 1412 params->ref_dtbclk_khz, req_dtbclk_khz, phase, modulo); 1413 1413 1414 - } else { 1414 + } else if (!params->ref_dtbclk_khz && !req_dtbclk_khz) { 1415 1415 switch (params->otg_inst) { 1416 1416 case 0: 1417 1417 REG_UPDATE(DCCG_GATE_DISABLE_CNTL5, DTBCLK_P0_GATE_DISABLE, 0);
+8
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
··· 614 614 * DOMAIN11_PGFSM_PWR_STATUS, pwr_status, 615 615 * 1, 1000); 616 616 */ 617 + 618 + /* Force disable cursor on plane powerdown on DPP 5 using dpp_force_disable_cursor */ 619 + if (!power_on) { 620 + struct dpp *dpp5 = hws->ctx->dc->res_pool->dpps[dpp_inst]; 621 + if (dpp5 && dpp5->funcs->dpp_force_disable_cursor) 622 + dpp5->funcs->dpp_force_disable_cursor(dpp5); 623 + } 624 + 617 625 break; 618 626 default: 619 627 BREAK_TO_DEBUGGER();
+2 -2
drivers/gpu/drm/drm_plane.c
··· 210 210 formats_size = sizeof(__u32) * plane->format_count; 211 211 if (WARN_ON(!formats_size)) { 212 212 /* 0 formats are never expected */ 213 - return 0; 213 + return ERR_PTR(-EINVAL); 214 214 } 215 215 216 216 modifiers_size = ··· 226 226 227 227 blob = drm_property_create_blob(dev, blob_size, NULL); 228 228 if (IS_ERR(blob)) 229 - return NULL; 229 + return blob; 230 230 231 231 blob_data = blob->data; 232 232 blob_data->version = FORMAT_BLOB_CURRENT;
+6 -8
drivers/gpu/drm/i915/display/intel_cx0_phy.c
··· 39 39 struct intel_display *display = to_intel_display(encoder); 40 40 enum phy phy = intel_encoder_to_phy(encoder); 41 41 42 - /* PTL doesn't have a PHY connected to PORT B; as such, 43 - * there will never be a case where PTL uses PHY B. 44 - * WCL uses PORT A and B with the C10 PHY. 45 - * Reusing the condition for WCL and extending it for PORT B 46 - * should not cause any issues for PTL. 47 - */ 48 - if (display->platform.pantherlake && phy < PHY_C) 49 - return true; 42 + if (display->platform.pantherlake) { 43 + if (display->platform.pantherlake_wildcatlake) 44 + return phy <= PHY_B; 45 + else 46 + return phy == PHY_A; 47 + } 50 48 51 49 if ((display->platform.lunarlake || display->platform.meteorlake) && phy < PHY_C) 52 50 return true;
+13
drivers/gpu/drm/i915/display/intel_display_device.c
··· 1404 1404 PLATFORM_GROUP(dgfx), 1405 1405 }; 1406 1406 1407 + static const u16 wcl_ids[] = { 1408 + INTEL_WCL_IDS(ID), 1409 + 0 1410 + }; 1411 + 1407 1412 static const struct platform_desc ptl_desc = { 1408 1413 PLATFORM(pantherlake), 1414 + .subplatforms = (const struct subplatform_desc[]) { 1415 + { 1416 + SUBPLATFORM(pantherlake, wildcatlake), 1417 + .pciidlist = wcl_ids, 1418 + }, 1419 + {}, 1420 + } 1409 1421 }; 1410 1422 1411 1423 __diag_pop(); ··· 1494 1482 INTEL_LNL_IDS(INTEL_DISPLAY_DEVICE, &lnl_desc), 1495 1483 INTEL_BMG_IDS(INTEL_DISPLAY_DEVICE, &bmg_desc), 1496 1484 INTEL_PTL_IDS(INTEL_DISPLAY_DEVICE, &ptl_desc), 1485 + INTEL_WCL_IDS(INTEL_DISPLAY_DEVICE, &ptl_desc), 1497 1486 }; 1498 1487 1499 1488 static const struct {
+3 -1
drivers/gpu/drm/i915/display/intel_display_device.h
··· 101 101 /* Display ver 14.1 (based on GMD ID) */ \ 102 102 func(battlemage) \ 103 103 /* Display ver 30 (based on GMD ID) */ \ 104 - func(pantherlake) 104 + func(pantherlake) \ 105 + func(pantherlake_wildcatlake) 106 + 105 107 106 108 #define __MEMBER(name) unsigned long name:1; 107 109 #define __COUNT(x) 1 +
+7 -3
drivers/gpu/drm/i915/display/intel_dmc.c
··· 127 127 #define DISPLAY_VER13_DMC_MAX_FW_SIZE 0x20000 128 128 #define DISPLAY_VER12_DMC_MAX_FW_SIZE ICL_DMC_MAX_FW_SIZE 129 129 130 + #define XE3LPD_3002_DMC_PATH DMC_PATH(xe3lpd_3002) 131 + MODULE_FIRMWARE(XE3LPD_3002_DMC_PATH); 132 + 130 133 #define XE3LPD_DMC_PATH DMC_PATH(xe3lpd) 131 134 MODULE_FIRMWARE(XE3LPD_DMC_PATH); 132 135 ··· 186 183 { 187 184 const char *fw_path = NULL; 188 185 u32 max_fw_size = 0; 189 - 190 - if (DISPLAY_VERx100(display) == 3002 || 191 - DISPLAY_VERx100(display) == 3000) { 186 + if (DISPLAY_VERx100(display) == 3002) { 187 + fw_path = XE3LPD_3002_DMC_PATH; 188 + max_fw_size = XE2LPD_DMC_MAX_FW_SIZE; 189 + } else if (DISPLAY_VERx100(display) == 3000) { 192 190 fw_path = XE3LPD_DMC_PATH; 193 191 max_fw_size = XE2LPD_DMC_MAX_FW_SIZE; 194 192 } else if (DISPLAY_VERx100(display) == 2000) {
+2
drivers/gpu/drm/nouveau/nvkm/falcon/fw.c
··· 159 159 nvkm_memory_unref(&fw->inst); 160 160 nvkm_falcon_fw_dtor_sigs(fw); 161 161 nvkm_firmware_dtor(&fw->fw); 162 + kfree(fw->boot); 163 + fw->boot = NULL; 162 164 } 163 165 164 166 static const struct nvkm_firmware_func
-7
drivers/gpu/drm/radeon/radeon_fence.c
··· 360 360 if (atomic64_read(&rdev->fence_drv[ring].last_seq) >= seq) 361 361 return true; 362 362 363 - if (down_read_trylock(&rdev->exclusive_lock)) { 364 - radeon_fence_process(rdev, ring); 365 - up_read(&rdev->exclusive_lock); 366 - 367 - if (atomic64_read(&rdev->fence_drv[ring].last_seq) >= seq) 368 - return true; 369 - } 370 363 return false; 371 364 } 372 365
+1
drivers/gpu/drm/tegra/dc.c
··· 3148 3148 dc->client.parent = &parent->client; 3149 3149 3150 3150 dev_dbg(dc->dev, "coupled to %s\n", dev_name(companion)); 3151 + put_device(companion); 3151 3152 } 3152 3153 3153 3154 return 0;
-9
drivers/gpu/drm/tegra/dsi.c
··· 913 913 u32 value; 914 914 int err; 915 915 916 - /* If the bootloader enabled DSI it needs to be disabled 917 - * in order for the panel initialization commands to be 918 - * properly sent. 919 - */ 920 - value = tegra_dsi_readl(dsi, DSI_POWER_CONTROL); 921 - 922 - if (value & DSI_POWER_CONTROL_ENABLE) 923 - tegra_dsi_disable(dsi); 924 - 925 916 err = tegra_dsi_prepare(dsi); 926 917 if (err < 0) { 927 918 dev_err(dsi->dev, "failed to prepare: %d\n", err);
+5 -2
drivers/gpu/drm/tegra/uapi.c
··· 114 114 if (err) 115 115 goto put_channel; 116 116 117 - if (supported) 117 + if (supported) { 118 + struct pid *pid = get_task_pid(current, PIDTYPE_TGID); 118 119 context->memory_context = host1x_memory_context_alloc( 119 - host, client->base.dev, get_task_pid(current, PIDTYPE_TGID)); 120 + host, client->base.dev, pid); 121 + put_pid(pid); 122 + } 120 123 121 124 if (IS_ERR(context->memory_context)) { 122 125 if (PTR_ERR(context->memory_context) != -EOPNOTSUPP) {
-1
drivers/gpu/drm/xe/Kconfig
··· 13 13 select TMPFS 14 14 select DRM_BUDDY 15 15 select DRM_CLIENT_SELECTION 16 - select DRM_EXEC 17 16 select DRM_KMS_HELPER 18 17 select DRM_KUNIT_TEST_HELPERS if DRM_XE_KUNIT_TEST != n 19 18 select DRM_PANEL
+1 -1
drivers/gpu/drm/xe/tests/xe_mocs.c
··· 49 49 fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL); 50 50 if (!xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL)) { 51 51 xe_force_wake_put(gt_to_fw(gt), fw_ref); 52 - KUNIT_ASSERT_TRUE_MSG(test, true, "Forcewake Failed.\n"); 52 + KUNIT_FAIL_AND_ABORT(test, "Forcewake Failed.\n"); 53 53 } 54 54 55 55 for (i = 0; i < info->num_mocs_regs; i++) {
+1 -17
drivers/gpu/drm/xe/xe_irq.c
··· 847 847 return 0; 848 848 } 849 849 850 - static irqreturn_t guc2host_irq_handler(int irq, void *arg) 851 - { 852 - struct xe_device *xe = arg; 853 - struct xe_tile *tile; 854 - u8 id; 855 - 856 - if (!atomic_read(&xe->irq.enabled)) 857 - return IRQ_NONE; 858 - 859 - for_each_tile(tile, xe, id) 860 - xe_guc_irq_handler(&tile->primary_gt->uc.guc, 861 - GUC_INTR_GUC2HOST); 862 - 863 - return IRQ_HANDLED; 864 - } 865 - 866 850 static irqreturn_t xe_irq_msix_default_hwe_handler(int irq, void *arg) 867 851 { 868 852 unsigned int tile_id, gt_id; ··· 963 979 u16 msix; 964 980 965 981 msix = GUC2HOST_MSIX; 966 - err = xe_irq_msix_request_irq(xe, guc2host_irq_handler, xe, 982 + err = xe_irq_msix_request_irq(xe, xe_irq_handler(xe), xe, 967 983 DRIVER_NAME "-guc2host", false, &msix); 968 984 if (err) 969 985 return err;
+1
drivers/gpu/drm/xe/xe_pci.c
··· 375 375 INTEL_LNL_IDS(INTEL_VGA_DEVICE, &lnl_desc), 376 376 INTEL_BMG_IDS(INTEL_VGA_DEVICE, &bmg_desc), 377 377 INTEL_PTL_IDS(INTEL_VGA_DEVICE, &ptl_desc), 378 + INTEL_WCL_IDS(INTEL_VGA_DEVICE, &ptl_desc), 378 379 { } 379 380 }; 380 381 MODULE_DEVICE_TABLE(pci, pciidlist);
+4 -2
drivers/gpu/drm/xe/xe_vm.c
··· 3369 3369 op == DRM_XE_VM_BIND_OP_PREFETCH) || 3370 3370 XE_IOCTL_DBG(xe, prefetch_region && 3371 3371 op != DRM_XE_VM_BIND_OP_PREFETCH) || 3372 - XE_IOCTL_DBG(xe, (prefetch_region != DRM_XE_CONSULT_MEM_ADVISE_PREF_LOC && 3373 - !(BIT(prefetch_region) & xe->info.mem_region_mask))) || 3372 + XE_IOCTL_DBG(xe, (prefetch_region != DRM_XE_CONSULT_MEM_ADVISE_PREF_LOC && 3373 + /* Guard against undefined shift in BIT(prefetch_region) */ 3374 + (prefetch_region >= (sizeof(xe->info.mem_region_mask) * 8) || 3375 + !(BIT(prefetch_region) & xe->info.mem_region_mask)))) || 3374 3376 XE_IOCTL_DBG(xe, obj && 3375 3377 op == DRM_XE_VM_BIND_OP_UNMAP) || 3376 3378 XE_IOCTL_DBG(xe, (flags & DRM_XE_VM_BIND_FLAG_MADVISE_AUTORESET) &&
+1 -1
drivers/hid/hid-haptic.c
··· 86 86 if (hi->application == HID_DG_TOUCHPAD) { 87 87 if (haptic->auto_trigger_report && 88 88 haptic->manual_trigger_report) { 89 - __set_bit(INPUT_PROP_HAPTIC_TOUCHPAD, hi->input->propbit); 89 + __set_bit(INPUT_PROP_PRESSUREPAD, hi->input->propbit); 90 90 return 1; 91 91 } 92 92 return 0;
+6
drivers/input/keyboard/cros_ec_keyb.c
··· 261 261 case EC_MKBP_EVENT_KEY_MATRIX: 262 262 pm_wakeup_event(ckdev->dev, 0); 263 263 264 + if (!ckdev->idev) { 265 + dev_warn_once(ckdev->dev, 266 + "Unexpected key matrix event\n"); 267 + return NOTIFY_OK; 268 + } 269 + 264 270 if (ckdev->ec->event_size != ckdev->cols) { 265 271 dev_err(ckdev->dev, 266 272 "Discarded incomplete key matrix event.\n");
+1 -1
drivers/input/keyboard/imx_sc_key.c
··· 158 158 return error; 159 159 } 160 160 161 - error = devm_add_action_or_reset(&pdev->dev, imx_sc_key_action, &priv); 161 + error = devm_add_action_or_reset(&pdev->dev, imx_sc_key_action, priv); 162 162 if (error) 163 163 return error; 164 164
+9
drivers/input/tablet/pegasus_notetaker.c
··· 63 63 #define BUTTON_PRESSED 0xb5 64 64 #define COMMAND_VERSION 0xa9 65 65 66 + /* 1 Status + 1 Color + 2 X + 2 Y = 6 bytes */ 67 + #define NOTETAKER_PACKET_SIZE 6 68 + 66 69 /* in xy data packet */ 67 70 #define BATTERY_NO_REPORT 0x40 68 71 #define BATTERY_LOW 0x41 ··· 314 311 } 315 312 316 313 pegasus->data_len = usb_maxpacket(dev, pipe); 314 + if (pegasus->data_len < NOTETAKER_PACKET_SIZE) { 315 + dev_err(&intf->dev, "packet size is too small (%d)\n", 316 + pegasus->data_len); 317 + error = -EINVAL; 318 + goto err_free_mem; 319 + } 317 320 318 321 pegasus->data = usb_alloc_coherent(dev, pegasus->data_len, GFP_KERNEL, 319 322 &pegasus->data_dma);
+2 -26
drivers/input/touchscreen/goodix.c
··· 796 796 797 797 usleep_range(6000, 10000); /* T4: > 5ms */ 798 798 799 - /* 800 - * Put the reset pin back in to input / high-impedance mode to save 801 - * power. Only do this in the non ACPI case since some ACPI boards 802 - * don't have a pull-up, so there the reset pin must stay active-high. 803 - */ 804 - if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_GPIO) { 805 - error = gpiod_direction_input(ts->gpiod_rst); 806 - if (error) 807 - goto error; 808 - } 809 - 810 799 return 0; 811 800 812 801 error: ··· 946 957 return -EINVAL; 947 958 } 948 959 949 - /* 950 - * Normally we put the reset pin in input / high-impedance mode to save 951 - * power. But some x86/ACPI boards don't have a pull-up, so for the ACPI 952 - * case, leave the pin as is. This results in the pin not being touched 953 - * at all on x86/ACPI boards, except when needed for error-recover. 954 - */ 955 - ts->gpiod_rst_flags = GPIOD_ASIS; 956 - 957 960 return devm_acpi_dev_add_driver_gpios(dev, gpio_mapping); 958 961 } 959 962 #else ··· 969 988 if (!ts->client) 970 989 return -EINVAL; 971 990 dev = &ts->client->dev; 972 - 973 - /* 974 - * By default we request the reset pin as input, leaving it in 975 - * high-impedance when not resetting the controller to save power. 976 - */ 977 - ts->gpiod_rst_flags = GPIOD_IN; 978 991 979 992 ts->avdd28 = devm_regulator_get(dev, "AVDD28"); 980 993 if (IS_ERR(ts->avdd28)) ··· 994 1019 ts->gpiod_int = gpiod; 995 1020 996 1021 /* Get the reset line GPIO pin number */ 997 - gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, ts->gpiod_rst_flags); 1022 + gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, GPIOD_ASIS); 998 1023 if (IS_ERR(gpiod)) 999 1024 return dev_err_probe(dev, PTR_ERR(gpiod), "Failed to get %s GPIO\n", 1000 1025 GOODIX_GPIO_RST_NAME); ··· 1532 1557 static const struct acpi_device_id goodix_acpi_match[] = { 1533 1558 { "GDIX1001", 0 }, 1534 1559 { "GDIX1002", 0 }, 1560 + { "GDIX1003", 0 }, 1535 1561 { "GDX9110", 0 }, 1536 1562 { } 1537 1563 };
-1
drivers/input/touchscreen/goodix.h
··· 88 88 struct gpio_desc *gpiod_rst; 89 89 int gpio_count; 90 90 int gpio_int_idx; 91 - enum gpiod_flags gpiod_rst_flags; 92 91 char id[GOODIX_ID_MAX_LEN + 1]; 93 92 char cfg_name[64]; 94 93 u16 version;
+1 -1
drivers/iommu/iommufd/driver.c
··· 161 161 vevent = &veventq->lost_events_header; 162 162 goto out_set_header; 163 163 } 164 - memcpy(vevent->event_data, event_data, data_len); 165 164 vevent->data_len = data_len; 165 + memcpy(vevent->event_data, event_data, data_len); 166 166 veventq->num_events++; 167 167 168 168 out_set_header:
+3 -1
drivers/iommu/iommufd/iommufd_private.h
··· 614 614 struct iommufd_eventq common; 615 615 struct iommufd_viommu *viommu; 616 616 struct list_head node; /* for iommufd_viommu::veventqs */ 617 - struct iommufd_vevent lost_events_header; 618 617 619 618 enum iommu_veventq_type type; 620 619 unsigned int depth; ··· 621 622 /* Use common.lock for protection */ 622 623 u32 num_events; 623 624 u32 sequence; 625 + 626 + /* Must be last as it ends in a flexible-array member. */ 627 + struct iommufd_vevent lost_events_header; 624 628 }; 625 629 626 630 static inline struct iommufd_veventq *
+1 -1
drivers/md/dm-pcache/Makefile
··· 1 1 dm-pcache-y := dm_pcache.o cache_dev.o segment.o backing_dev.o cache.o cache_gc.o cache_writeback.o cache_segment.o cache_key.o cache_req.o 2 2 3 - obj-m += dm-pcache.o 3 + obj-$(CONFIG_DM_PCACHE) += dm-pcache.o
+2 -2
drivers/md/dm-pcache/cache.c
··· 181 181 { 182 182 struct pcache_cache_info *cache_info = &cache->cache_info; 183 183 184 - cache_info->header.seq = 0; 184 + memset(cache_info, 0, sizeof(*cache_info)); 185 185 cache_info->n_segs = cache->cache_dev->seg_num; 186 186 cache_info_set_gc_percent(cache_info, PCACHE_CACHE_GC_PERCENT_DEFAULT); 187 187 } ··· 411 411 { 412 412 struct pcache_cache *cache = &pcache->cache; 413 413 414 - cache_flush(cache); 414 + pcache_cache_flush(cache); 415 415 416 416 cancel_delayed_work_sync(&cache->gc_work); 417 417 flush_work(&cache->clean_work);
+1 -1
drivers/md/dm-pcache/cache.h
··· 339 339 void cache_seg_set_next_seg(struct pcache_cache_segment *cache_seg, u32 seg_id); 340 340 341 341 /* cache request*/ 342 - int cache_flush(struct pcache_cache *cache); 342 + int pcache_cache_flush(struct pcache_cache *cache); 343 343 void miss_read_end_work_fn(struct work_struct *work); 344 344 int pcache_cache_handle_req(struct pcache_cache *cache, struct pcache_request *pcache_req); 345 345
+3 -3
drivers/md/dm-pcache/cache_req.c
··· 790 790 } 791 791 792 792 /** 793 - * cache_flush - Flush all ksets to persist any pending cache data 793 + * pcache_cache_flush - Flush all ksets to persist any pending cache data 794 794 * @cache: Pointer to the cache structure 795 795 * 796 796 * This function iterates through all ksets associated with the provided `cache` ··· 802 802 * the respective error code, preventing the flush operation from proceeding to 803 803 * subsequent ksets. 804 804 */ 805 - int cache_flush(struct pcache_cache *cache) 805 + int pcache_cache_flush(struct pcache_cache *cache) 806 806 { 807 807 struct pcache_cache_kset *kset; 808 808 int ret; ··· 827 827 struct bio *bio = pcache_req->bio; 828 828 829 829 if (unlikely(bio->bi_opf & REQ_PREFLUSH)) 830 - return cache_flush(cache); 830 + return pcache_cache_flush(cache); 831 831 832 832 if (bio_data_dir(bio) == READ) 833 833 return cache_read(cache, pcache_req);
+1 -1
drivers/md/dm-pcache/pcache_internal.h
··· 99 99 /* Update latest if a more recent sequence is found */ 100 100 if (!latest || pcache_meta_seq_after(meta->seq, seq_latest)) { 101 101 seq_latest = meta->seq; 102 - latest = (void *)header + (i * meta_max_size); 102 + latest = meta_addr; 103 103 } 104 104 } 105 105
+1 -5
drivers/md/dm-verity-fec.c
··· 320 320 if (fio->bufs[n]) 321 321 continue; 322 322 323 - fio->bufs[n] = mempool_alloc(&v->fec->prealloc_pool, GFP_NOWAIT); 324 - if (unlikely(!fio->bufs[n])) { 325 - DMERR("failed to allocate FEC buffer"); 326 - return -ENOMEM; 327 - } 323 + fio->bufs[n] = mempool_alloc(&v->fec->prealloc_pool, GFP_NOIO); 328 324 } 329 325 330 326 /* try to allocate the maximum number of buffers */
+1 -1
drivers/md/dm.c
··· 2005 2005 * linear target or multiple linear targets pointing to the same 2006 2006 * device), we can send the flush with data directly to it. 2007 2007 */ 2008 - if (map->flush_bypasses_map) { 2008 + if (bio->bi_iter.bi_size && map->flush_bypasses_map) { 2009 2009 struct list_head *devices = dm_table_get_devices(map); 2010 2010 if (devices->next == devices->prev) 2011 2011 goto send_preflush_with_data;
+31 -22
drivers/net/can/rcar/rcar_canfd.c
··· 710 710 rcar_canfd_update(val, val, addr); 711 711 } 712 712 713 + static void rcar_canfd_clear_bit_reg(void __iomem *addr, u32 val) 714 + { 715 + rcar_canfd_update(val, 0, addr); 716 + } 717 + 713 718 static void rcar_canfd_update_bit_reg(void __iomem *addr, u32 mask, u32 val) 714 719 { 715 720 rcar_canfd_update(mask, val, addr); ··· 761 756 rcar_canfd_set_bit(gpriv->base, RCANFD_GAFLCFG(w), rnc); 762 757 } 763 758 764 - static void rcar_canfd_set_mode(struct rcar_canfd_global *gpriv) 765 - { 766 - if (gpriv->info->ch_interface_mode) { 767 - u32 ch, val = gpriv->fdmode ? RCANFD_GEN4_FDCFG_FDOE 768 - : RCANFD_GEN4_FDCFG_CLOE; 769 - 770 - for_each_set_bit(ch, &gpriv->channels_mask, 771 - gpriv->info->max_channels) 772 - rcar_canfd_set_bit_reg(&gpriv->fcbase[ch].cfdcfg, val); 773 - } else { 774 - if (gpriv->fdmode) 775 - rcar_canfd_set_bit(gpriv->base, RCANFD_GRMCFG, 776 - RCANFD_GRMCFG_RCMC); 777 - else 778 - rcar_canfd_clear_bit(gpriv->base, RCANFD_GRMCFG, 779 - RCANFD_GRMCFG_RCMC); 780 - } 781 - } 782 - 783 759 static int rcar_canfd_reset_controller(struct rcar_canfd_global *gpriv) 784 760 { 785 761 struct device *dev = &gpriv->pdev->dev; ··· 793 807 /* Reset Global error flags */ 794 808 rcar_canfd_write(gpriv->base, RCANFD_GERFL, 0x0); 795 809 810 + /* Set the controller into appropriate mode */ 811 + if (!gpriv->info->ch_interface_mode) { 812 + if (gpriv->fdmode) 813 + rcar_canfd_set_bit(gpriv->base, RCANFD_GRMCFG, 814 + RCANFD_GRMCFG_RCMC); 815 + else 816 + rcar_canfd_clear_bit(gpriv->base, RCANFD_GRMCFG, 817 + RCANFD_GRMCFG_RCMC); 818 + } 819 + 796 820 /* Transition all Channels to reset mode */ 797 821 for_each_set_bit(ch, &gpriv->channels_mask, gpriv->info->max_channels) { 798 822 rcar_canfd_clear_bit(gpriv->base, ··· 820 824 dev_dbg(dev, "channel %u reset failed\n", ch); 821 825 return err; 822 826 } 823 - } 824 827 825 - /* Set the controller into appropriate mode */ 826 - rcar_canfd_set_mode(gpriv); 828 + /* Set the controller into appropriate mode */ 829 + if (gpriv->info->ch_interface_mode) { 830 + /* Do not set CLOE and FDOE simultaneously */ 831 + if (!gpriv->fdmode) { 832 + rcar_canfd_clear_bit_reg(&gpriv->fcbase[ch].cfdcfg, 833 + RCANFD_GEN4_FDCFG_FDOE); 834 + rcar_canfd_set_bit_reg(&gpriv->fcbase[ch].cfdcfg, 835 + RCANFD_GEN4_FDCFG_CLOE); 836 + } else { 837 + rcar_canfd_clear_bit_reg(&gpriv->fcbase[ch].cfdcfg, 838 + RCANFD_GEN4_FDCFG_FDOE); 839 + rcar_canfd_clear_bit_reg(&gpriv->fcbase[ch].cfdcfg, 840 + RCANFD_GEN4_FDCFG_CLOE); 841 + } 842 + } 843 + } 827 844 828 845 return 0; 829 846 }
+2 -2
drivers/net/can/sja1000/sja1000.c
··· 548 548 if (priv->read_reg(priv, SJA1000_IER) == IRQ_OFF) 549 549 goto out; 550 550 551 - while ((isrc = priv->read_reg(priv, SJA1000_IR)) && 552 - (n < SJA1000_MAX_IRQ)) { 551 + while ((n < SJA1000_MAX_IRQ) && 552 + (isrc = priv->read_reg(priv, SJA1000_IR))) { 553 553 554 554 status = priv->read_reg(priv, SJA1000_SR); 555 555 /* check for absent controller due to hw unplug */
+2 -2
drivers/net/can/sun4i_can.c
··· 657 657 u8 isrc, status; 658 658 int n = 0; 659 659 660 - while ((isrc = readl(priv->base + SUN4I_REG_INT_ADDR)) && 661 - (n < SUN4I_CAN_MAX_IRQ)) { 660 + while ((n < SUN4I_CAN_MAX_IRQ) && 661 + (isrc = readl(priv->base + SUN4I_REG_INT_ADDR))) { 662 662 n++; 663 663 status = readl(priv->base + SUN4I_REG_STA_ADDR); 664 664
+88 -14
drivers/net/can/usb/gs_usb.c
··· 261 261 u8 quirk; 262 262 } __packed; 263 263 264 - struct gs_host_frame { 265 - u32 echo_id; 266 - __le32 can_id; 264 + /* struct gs_host_frame::echo_id == GS_HOST_FRAME_ECHO_ID_RX indicates 265 + * a regular RX'ed CAN frame 266 + */ 267 + #define GS_HOST_FRAME_ECHO_ID_RX 0xffffffff 267 268 268 - u8 can_dlc; 269 - u8 channel; 270 - u8 flags; 271 - u8 reserved; 269 + struct gs_host_frame { 270 + struct_group(header, 271 + u32 echo_id; 272 + __le32 can_id; 273 + 274 + u8 can_dlc; 275 + u8 channel; 276 + u8 flags; 277 + u8 reserved; 278 + ); 272 279 273 280 union { 274 281 DECLARE_FLEX_ARRAY(struct classic_can, classic_can); ··· 575 568 return len; 576 569 } 577 570 571 + static unsigned int 572 + gs_usb_get_minimum_rx_length(const struct gs_can *dev, const struct gs_host_frame *hf, 573 + unsigned int *data_length_p) 574 + { 575 + unsigned int minimum_length, data_length = 0; 576 + 577 + if (hf->flags & GS_CAN_FLAG_FD) { 578 + if (hf->echo_id == GS_HOST_FRAME_ECHO_ID_RX) 579 + data_length = can_fd_dlc2len(hf->can_dlc); 580 + 581 + if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP) 582 + /* timestamp follows data field of max size */ 583 + minimum_length = struct_size(hf, canfd_ts, 1); 584 + else 585 + minimum_length = sizeof(hf->header) + data_length; 586 + } else { 587 + if (hf->echo_id == GS_HOST_FRAME_ECHO_ID_RX && 588 + !(hf->can_id & cpu_to_le32(CAN_RTR_FLAG))) 589 + data_length = can_cc_dlc2len(hf->can_dlc); 590 + 591 + if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP) 592 + /* timestamp follows data field of max size */ 593 + minimum_length = struct_size(hf, classic_can_ts, 1); 594 + else 595 + minimum_length = sizeof(hf->header) + data_length; 596 + } 597 + 598 + *data_length_p = data_length; 599 + return minimum_length; 600 + } 601 + 578 602 static void gs_usb_receive_bulk_callback(struct urb *urb) 579 603 { 580 604 struct gs_usb *parent = urb->context; ··· 614 576 int rc; 615 577 struct net_device_stats *stats; 616 578 struct gs_host_frame *hf = urb->transfer_buffer; 579 + unsigned int minimum_length, data_length; 617 580 struct gs_tx_context *txc; 618 581 struct can_frame *cf; 619 582 struct canfd_frame *cfd; ··· 633 594 return; 634 595 } 635 596 597 + minimum_length = sizeof(hf->header); 598 + if (urb->actual_length < minimum_length) { 599 + dev_err_ratelimited(&parent->udev->dev, 600 + "short read (actual_length=%u, minimum_length=%u)\n", 601 + urb->actual_length, minimum_length); 602 + 603 + goto resubmit_urb; 604 + } 605 + 636 606 /* device reports out of range channel id */ 637 607 if (hf->channel >= parent->channel_cnt) 638 608 goto device_detach; ··· 657 609 if (!netif_running(netdev)) 658 610 goto resubmit_urb; 659 611 660 - if (hf->echo_id == -1) { /* normal rx */ 612 + minimum_length = gs_usb_get_minimum_rx_length(dev, hf, &data_length); 613 + if (urb->actual_length < minimum_length) { 614 + stats->rx_errors++; 615 + stats->rx_length_errors++; 616 + 617 + if (net_ratelimit()) 618 + netdev_err(netdev, 619 + "short read (actual_length=%u, minimum_length=%u)\n", 620 + urb->actual_length, minimum_length); 621 + 622 + goto resubmit_urb; 623 + } 624 + 625 + if (hf->echo_id == GS_HOST_FRAME_ECHO_ID_RX) { /* normal rx */ 661 626 if (hf->flags & GS_CAN_FLAG_FD) { 662 627 skb = alloc_canfd_skb(netdev, &cfd); 663 628 if (!skb) 664 629 return; 665 630 666 631 cfd->can_id = le32_to_cpu(hf->can_id); 667 - cfd->len = can_fd_dlc2len(hf->can_dlc); 632 + cfd->len = data_length; 668 633 if (hf->flags & GS_CAN_FLAG_BRS) 669 634 cfd->flags |= CANFD_BRS; 670 635 if (hf->flags & GS_CAN_FLAG_ESI) 671 636 cfd->flags |= CANFD_ESI; 672 637 673 - memcpy(cfd->data, hf->canfd->data, cfd->len); 638 + memcpy(cfd->data, hf->canfd->data, data_length); 674 639 } else { 675 640 skb = alloc_can_skb(netdev, &cf); 676 641 if (!skb) ··· 692 631 cf->can_id = le32_to_cpu(hf->can_id); 693 632 can_frame_set_cc_len(cf, hf->can_dlc, dev->can.ctrlmode); 694 633 695 - memcpy(cf->data, hf->classic_can->data, 8); 634 + memcpy(cf->data, hf->classic_can->data, data_length); 696 635 697 636 /* ERROR frames tell us information about the controller */ 698 637 if (le32_to_cpu(hf->can_id) & CAN_ERR_FLAG) ··· 748 687 resubmit_urb: 749 688 usb_fill_bulk_urb(urb, parent->udev, 750 689 parent->pipe_in, 751 - hf, dev->parent->hf_size_rx, 690 + hf, parent->hf_size_rx, 752 691 gs_usb_receive_bulk_callback, parent); 753 692 754 693 rc = usb_submit_urb(urb, GFP_ATOMIC); ··· 811 750 struct gs_can *dev = txc->dev; 812 751 struct net_device *netdev = dev->netdev; 813 752 814 - if (urb->status) 815 - netdev_info(netdev, "usb xmit fail %u\n", txc->echo_id); 753 + if (!urb->status) 754 + return; 755 + 756 + if (urb->status != -ESHUTDOWN && net_ratelimit()) 757 + netdev_info(netdev, "failed to xmit URB %u: %pe\n", 758 + txc->echo_id, ERR_PTR(urb->status)); 759 + 760 + netdev->stats.tx_dropped++; 761 + netdev->stats.tx_errors++; 762 + 763 + can_free_echo_skb(netdev, txc->echo_id, NULL); 764 + gs_free_tx_context(txc); 765 + atomic_dec(&dev->active_tx_urbs); 766 + 767 + netif_wake_queue(netdev); 816 768 } 817 769 818 770 static netdev_tx_t gs_can_start_xmit(struct sk_buff *skb,
+2 -2
drivers/net/can/usb/kvaser_usb/kvaser_usb_leaf.c
··· 685 685 * for further details. 686 686 */ 687 687 if (tmp->len == 0) { 688 - pos = round_up(pos, 688 + pos = round_up(pos + 1, 689 689 le16_to_cpu 690 690 (dev->bulk_in->wMaxPacketSize)); 691 691 continue; ··· 1732 1732 * number of events in case of a heavy rx load on the bus. 1733 1733 */ 1734 1734 if (cmd->len == 0) { 1735 - pos = round_up(pos, le16_to_cpu 1735 + pos = round_up(pos + 1, le16_to_cpu 1736 1736 (dev->bulk_in->wMaxPacketSize)); 1737 1737 continue; 1738 1738 }
+15 -16
drivers/net/dsa/microchip/ksz_common.c
··· 2587 2587 2588 2588 irq = irq_find_mapping(dev->ports[port].pirq.domain, 2589 2589 PORT_SRC_PHY_INT); 2590 - if (irq < 0) { 2591 - ret = irq; 2590 + if (!irq) { 2591 + ret = -EINVAL; 2592 2592 goto out; 2593 2593 } 2594 2594 ds->user_mii_bus->irq[phy] = irq; ··· 2952 2952 snprintf(pirq->name, sizeof(pirq->name), "port_irq-%d", p); 2953 2953 2954 2954 pirq->irq_num = irq_find_mapping(dev->girq.domain, p); 2955 - if (pirq->irq_num < 0) 2956 - return pirq->irq_num; 2955 + if (!pirq->irq_num) 2956 + return -EINVAL; 2957 2957 2958 2958 return ksz_irq_common_setup(dev, pirq); 2959 2959 } ··· 3038 3038 dsa_switch_for_each_user_port(dp, dev->ds) { 3039 3039 ret = ksz_pirq_setup(dev, dp->index); 3040 3040 if (ret) 3041 - goto out_girq; 3041 + goto port_release; 3042 3042 3043 3043 if (dev->info->ptp_capable) { 3044 3044 ret = ksz_ptp_irq_setup(ds, dp->index); 3045 3045 if (ret) 3046 - goto out_pirq; 3046 + goto pirq_release; 3047 3047 } 3048 3048 } 3049 3049 } ··· 3053 3053 if (ret) { 3054 3054 dev_err(dev->dev, "Failed to register PTP clock: %d\n", 3055 3055 ret); 3056 - goto out_ptpirq; 3056 + goto port_release; 3057 3057 } 3058 3058 } 3059 3059 ··· 3076 3076 out_ptp_clock_unregister: 3077 3077 if (dev->info->ptp_capable) 3078 3078 ksz_ptp_clock_unregister(ds); 3079 - out_ptpirq: 3080 - if (dev->irq > 0 && dev->info->ptp_capable) 3081 - dsa_switch_for_each_user_port(dp, dev->ds) 3082 - ksz_ptp_irq_free(ds, dp->index); 3083 - out_pirq: 3084 - if (dev->irq > 0) 3085 - dsa_switch_for_each_user_port(dp, dev->ds) 3079 + port_release: 3080 + if (dev->irq > 0) { 3081 + dsa_switch_for_each_user_port_continue_reverse(dp, dev->ds) { 3082 + if (dev->info->ptp_capable) 3083 + ksz_ptp_irq_free(ds, dp->index); 3084 + pirq_release: 3086 3085 ksz_irq_free(&dev->ports[dp->index].pirq); 3087 - out_girq: 3088 - if (dev->irq > 0) 3086 + } 3089 3087 ksz_irq_free(&dev->girq); 3088 + } 3090 3089 3091 3090 return ret; 3092 3091 }
+9 -13
drivers/net/dsa/microchip/ksz_ptp.c
··· 1093 1093 static const char * const name[] = {"pdresp-msg", "xdreq-msg", 1094 1094 "sync-msg"}; 1095 1095 const struct ksz_dev_ops *ops = port->ksz_dev->dev_ops; 1096 + struct ksz_irq *ptpirq = &port->ptpirq; 1096 1097 struct ksz_ptp_irq *ptpmsg_irq; 1097 1098 1098 1099 ptpmsg_irq = &port->ptpmsg_irq[n]; 1100 + ptpmsg_irq->num = irq_create_mapping(ptpirq->domain, n); 1101 + if (!ptpmsg_irq->num) 1102 + return -EINVAL; 1099 1103 1100 1104 ptpmsg_irq->port = port; 1101 1105 ptpmsg_irq->ts_reg = ops->get_port_addr(port->num, ts_reg[n]); 1102 1106 1103 1107 strscpy(ptpmsg_irq->name, name[n]); 1104 - 1105 - ptpmsg_irq->num = irq_find_mapping(port->ptpirq.domain, n); 1106 - if (ptpmsg_irq->num < 0) 1107 - return ptpmsg_irq->num; 1108 1108 1109 1109 return request_threaded_irq(ptpmsg_irq->num, NULL, 1110 1110 ksz_ptp_msg_thread_fn, IRQF_ONESHOT, ··· 1135 1135 if (!ptpirq->domain) 1136 1136 return -ENOMEM; 1137 1137 1138 - for (irq = 0; irq < ptpirq->nirqs; irq++) 1139 - irq_create_mapping(ptpirq->domain, irq); 1140 - 1141 1138 ptpirq->irq_num = irq_find_mapping(port->pirq.domain, PORT_SRC_PTP_INT); 1142 - if (ptpirq->irq_num < 0) { 1143 - ret = ptpirq->irq_num; 1139 + if (!ptpirq->irq_num) { 1140 + ret = -EINVAL; 1144 1141 goto out; 1145 1142 } 1146 1143 ··· 1156 1159 1157 1160 out_ptp_msg: 1158 1161 free_irq(ptpirq->irq_num, ptpirq); 1159 - while (irq--) 1162 + while (irq--) { 1160 1163 free_irq(port->ptpmsg_irq[irq].num, &port->ptpmsg_irq[irq]); 1161 - out: 1162 - for (irq = 0; irq < ptpirq->nirqs; irq++) 1163 1164 irq_dispose_mapping(port->ptpmsg_irq[irq].num); 1164 - 1165 + } 1166 + out: 1165 1167 irq_domain_remove(ptpirq->domain); 1166 1168 1167 1169 return ret;
-7
drivers/net/dsa/sja1105/sja1105_main.c
··· 1302 1302 * table, since this will be used for the clocking setup, and we no 1303 1303 * longer need to store it in the static config (already told hardware 1304 1304 * we want auto during upload phase). 1305 - * Actually for the SGMII port, the MAC is fixed at 1 Gbps and 1306 - * we need to configure the PCS only (if even that). 1307 1305 */ 1308 - if (priv->phy_mode[port] == PHY_INTERFACE_MODE_SGMII) 1309 - speed = priv->info->port_speed[SJA1105_SPEED_1000MBPS]; 1310 - else if (priv->phy_mode[port] == PHY_INTERFACE_MODE_2500BASEX) 1311 - speed = priv->info->port_speed[SJA1105_SPEED_2500MBPS]; 1312 - 1313 1306 mac[port].speed = speed; 1314 1307 1315 1308 return 0;
+22
drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.c
··· 15 15 16 16 #include "aq_hw.h" 17 17 #include "aq_nic.h" 18 + #include "hw_atl/hw_atl_llh.h" 18 19 19 20 void aq_hw_write_reg_bit(struct aq_hw_s *aq_hw, u32 addr, u32 msk, 20 21 u32 shift, u32 val) ··· 80 79 writeq(value, hw->mmio + reg); 81 80 else 82 81 lo_hi_writeq(value, hw->mmio + reg); 82 + } 83 + 84 + int aq_hw_invalidate_descriptor_cache(struct aq_hw_s *hw) 85 + { 86 + int err; 87 + u32 val; 88 + 89 + /* Invalidate Descriptor Cache to prevent writing to the cached 90 + * descriptors and to the data pointer of those descriptors 91 + */ 92 + hw_atl_rdm_rx_dma_desc_cache_init_tgl(hw); 93 + 94 + err = aq_hw_err_from_flags(hw); 95 + if (err) 96 + goto err_exit; 97 + 98 + readx_poll_timeout_atomic(hw_atl_rdm_rx_dma_desc_cache_init_done_get, 99 + hw, val, val == 1, 1000U, 10000U); 100 + 101 + err_exit: 102 + return err; 83 103 } 84 104 85 105 int aq_hw_err_from_flags(struct aq_hw_s *hw)
+1
drivers/net/ethernet/aquantia/atlantic/aq_hw_utils.h
··· 35 35 void aq_hw_write_reg(struct aq_hw_s *hw, u32 reg, u32 value); 36 36 u64 aq_hw_read_reg64(struct aq_hw_s *hw, u32 reg); 37 37 void aq_hw_write_reg64(struct aq_hw_s *hw, u32 reg, u64 value); 38 + int aq_hw_invalidate_descriptor_cache(struct aq_hw_s *hw); 38 39 int aq_hw_err_from_flags(struct aq_hw_s *hw); 39 40 int aq_hw_num_tcs(struct aq_hw_s *hw); 40 41 int aq_hw_q_per_tc(struct aq_hw_s *hw);
+5
drivers/net/ethernet/aquantia/atlantic/aq_ring.c
··· 547 547 548 548 if (!buff->is_eop) { 549 549 unsigned int frag_cnt = 0U; 550 + 551 + /* There will be an extra fragment */ 552 + if (buff->len > AQ_CFG_RX_HDR_SIZE) 553 + frag_cnt++; 554 + 550 555 buff_ = buff; 551 556 do { 552 557 bool is_rsc_completed = true;
+1 -18
drivers/net/ethernet/aquantia/atlantic/hw_atl/hw_atl_b0.c
··· 1198 1198 1199 1199 static int hw_atl_b0_hw_stop(struct aq_hw_s *self) 1200 1200 { 1201 - int err; 1202 - u32 val; 1203 - 1204 1201 hw_atl_b0_hw_irq_disable(self, HW_ATL_B0_INT_MASK); 1205 1202 1206 - /* Invalidate Descriptor Cache to prevent writing to the cached 1207 - * descriptors and to the data pointer of those descriptors 1208 - */ 1209 - hw_atl_rdm_rx_dma_desc_cache_init_tgl(self); 1210 - 1211 - err = aq_hw_err_from_flags(self); 1212 - 1213 - if (err) 1214 - goto err_exit; 1215 - 1216 - readx_poll_timeout_atomic(hw_atl_rdm_rx_dma_desc_cache_init_done_get, 1217 - self, val, val == 1, 1000U, 10000U); 1218 - 1219 - err_exit: 1220 - return err; 1203 + return aq_hw_invalidate_descriptor_cache(self); 1221 1204 } 1222 1205 1223 1206 int hw_atl_b0_hw_ring_tx_stop(struct aq_hw_s *self, struct aq_ring_s *ring)
+1 -1
drivers/net/ethernet/aquantia/atlantic/hw_atl2/hw_atl2.c
··· 759 759 { 760 760 hw_atl_b0_hw_irq_disable(self, HW_ATL2_INT_MASK); 761 761 762 - return 0; 762 + return aq_hw_invalidate_descriptor_cache(self); 763 763 } 764 764 765 765 static struct aq_stats_s *hw_atl2_utils_get_hw_stats(struct aq_hw_s *self)
+1
drivers/net/ethernet/freescale/fec.h
··· 661 661 unsigned int reload_period; 662 662 int pps_enable; 663 663 unsigned int next_counter; 664 + bool perout_enable; 664 665 struct hrtimer perout_timer; 665 666 u64 perout_stime; 666 667
+52 -12
drivers/net/ethernet/freescale/fec_ptp.c
··· 128 128 129 129 spin_lock_irqsave(&fep->tmreg_lock, flags); 130 130 131 + if (fep->perout_enable) { 132 + spin_unlock_irqrestore(&fep->tmreg_lock, flags); 133 + dev_err(&fep->pdev->dev, "PEROUT is running"); 134 + return -EBUSY; 135 + } 136 + 131 137 if (fep->pps_enable == enable) { 132 138 spin_unlock_irqrestore(&fep->tmreg_lock, flags); 133 139 return 0; ··· 249 243 * the FEC_TCCR register in time and missed the start time. 250 244 */ 251 245 if (fep->perout_stime < curr_time + 100 * NSEC_PER_MSEC) { 246 + fep->perout_enable = false; 252 247 dev_err(&fep->pdev->dev, "Current time is too close to the start time!\n"); 253 248 spin_unlock_irqrestore(&fep->tmreg_lock, flags); 254 249 return -1; ··· 504 497 { 505 498 unsigned long flags; 506 499 500 + hrtimer_cancel(&fep->perout_timer); 501 + 507 502 spin_lock_irqsave(&fep->tmreg_lock, flags); 503 + fep->perout_enable = false; 508 504 writel(0, fep->hwp + FEC_TCSR(channel)); 509 505 spin_unlock_irqrestore(&fep->tmreg_lock, flags); 510 506 ··· 539 529 540 530 return ret; 541 531 } else if (rq->type == PTP_CLK_REQ_PEROUT) { 532 + u32 reload_period; 533 + 542 534 /* Reject requests with unsupported flags */ 543 535 if (rq->perout.flags) 544 536 return -EOPNOTSUPP; ··· 560 548 return -EOPNOTSUPP; 561 549 } 562 550 563 - fep->reload_period = div_u64(period_ns, 2); 564 - if (on && fep->reload_period) { 551 + reload_period = div_u64(period_ns, 2); 552 + if (on && reload_period) { 553 + u64 perout_stime; 554 + 565 555 /* Convert 1588 timestamp to ns*/ 566 556 start_time.tv_sec = rq->perout.start.sec; 567 557 start_time.tv_nsec = rq->perout.start.nsec; 568 - fep->perout_stime = timespec64_to_ns(&start_time); 558 + perout_stime = timespec64_to_ns(&start_time); 569 559 570 560 mutex_lock(&fep->ptp_clk_mutex); 571 561 if (!fep->ptp_clk_on) { ··· 576 562 return -EOPNOTSUPP; 577 563 } 578 564 spin_lock_irqsave(&fep->tmreg_lock, flags); 565 + 566 + if (fep->pps_enable) { 567 + dev_err(&fep->pdev->dev, "PPS is running"); 568 + ret = -EBUSY; 569 + goto unlock; 570 + } 571 + 572 + if (fep->perout_enable) { 573 + dev_err(&fep->pdev->dev, 574 + "PEROUT has been enabled\n"); 575 + ret = -EBUSY; 576 + goto unlock; 577 + } 578 + 579 579 /* Read current timestamp */ 580 580 curr_time = timecounter_read(&fep->tc); 581 + if (perout_stime <= curr_time) { 582 + dev_err(&fep->pdev->dev, 583 + "Start time must be greater than current time\n"); 584 + ret = -EINVAL; 585 + goto unlock; 586 + } 587 + 588 + /* Calculate time difference */ 589 + delta = perout_stime - curr_time; 590 + fep->reload_period = reload_period; 591 + fep->perout_stime = perout_stime; 592 + fep->perout_enable = true; 593 + 594 + unlock: 581 595 spin_unlock_irqrestore(&fep->tmreg_lock, flags); 582 596 mutex_unlock(&fep->ptp_clk_mutex); 583 597 584 - /* Calculate time difference */ 585 - delta = fep->perout_stime - curr_time; 586 - 587 - if (fep->perout_stime <= curr_time) { 588 - dev_err(&fep->pdev->dev, "Start time must larger than current time!\n"); 589 - return -EINVAL; 590 - } 598 + if (ret) 599 + return ret; 591 600 592 601 /* Because the timer counter of FEC only has 31-bits, correspondingly, 593 602 * the time comparison register FEC_TCCR also only low 31 bits can be ··· 718 681 fep->next_counter = (fep->next_counter + fep->reload_period) & 719 682 fep->cc.mask; 720 683 721 - event.type = PTP_CLOCK_PPS; 722 - ptp_clock_event(fep->ptp_clock, &event); 684 + if (fep->pps_enable) { 685 + event.type = PTP_CLOCK_PPS; 686 + ptp_clock_event(fep->ptp_clock, &event); 687 + } 688 + 723 689 return IRQ_HANDLED; 724 690 } 725 691
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en_dcbnl.c
··· 627 627 MLX5E_100MB); 628 628 max_bw_value[i] = max_bw_value[i] ? max_bw_value[i] : 1; 629 629 max_bw_unit[i] = MLX5_100_MBPS_UNIT; 630 - } else if (max_bw_value[i] <= upper_limit_gbps) { 630 + } else if (maxrate->tc_maxrate[i] <= upper_limit_gbps) { 631 631 max_bw_value[i] = div_u64(maxrate->tc_maxrate[i], 632 632 MLX5E_1GB); 633 633 max_bw_unit[i] = MLX5_GBPS_UNIT;
+1 -1
drivers/net/ethernet/meta/fbnic/fbnic_fw.c
··· 201 201 return -ENODEV; 202 202 203 203 /* Fill all but 1 unused descriptors in the Rx queue. */ 204 - count = (head - tail - 1) % FBNIC_IPC_MBX_DESC_LEN; 204 + count = (head - tail - 1) & (FBNIC_IPC_MBX_DESC_LEN - 1); 205 205 while (!err && count--) { 206 206 struct fbnic_tlv_msg *msg; 207 207
+4 -1
drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0+ 2 2 3 3 #include <linux/ptp_classify.h> 4 + #include <linux/units.h> 4 5 5 6 #include "lan966x_main.h" 6 7 #include "vcap_api.h" 7 8 #include "vcap_api_client.h" 9 + 10 + #define LAN9X66_CLOCK_RATE 165617754 8 11 9 12 #define LAN966X_MAX_PTP_ID 512 10 13 ··· 1129 1126 u32 lan966x_ptp_get_period_ps(void) 1130 1127 { 1131 1128 /* This represents the system clock period in picoseconds */ 1132 - return 15125; 1129 + return PICO / LAN9X66_CLOCK_RATE; 1133 1130 }
+14 -5
drivers/net/ethernet/realtek/r8169_main.c
··· 1520 1520 1521 1521 static void rtl_set_d3_pll_down(struct rtl8169_private *tp, bool enable) 1522 1522 { 1523 - if (tp->mac_version >= RTL_GIGA_MAC_VER_25 && 1524 - tp->mac_version != RTL_GIGA_MAC_VER_28 && 1525 - tp->mac_version != RTL_GIGA_MAC_VER_31 && 1526 - tp->mac_version != RTL_GIGA_MAC_VER_38) 1527 - r8169_mod_reg8_cond(tp, PMCH, D3_NO_PLL_DOWN, !enable); 1523 + switch (tp->mac_version) { 1524 + case RTL_GIGA_MAC_VER_02 ... RTL_GIGA_MAC_VER_24: 1525 + case RTL_GIGA_MAC_VER_28: 1526 + case RTL_GIGA_MAC_VER_31: 1527 + case RTL_GIGA_MAC_VER_38: 1528 + break; 1529 + case RTL_GIGA_MAC_VER_80: 1530 + r8169_mod_reg8_cond(tp, PMCH, D3_NO_PLL_DOWN, true); 1531 + break; 1532 + default: 1533 + r8169_mod_reg8_cond(tp, PMCH, D3HOT_NO_PLL_DOWN, true); 1534 + r8169_mod_reg8_cond(tp, PMCH, D3COLD_NO_PLL_DOWN, !enable); 1535 + break; 1536 + } 1528 1537 } 1529 1538 1530 1539 static void rtl_reset_packet_filter(struct rtl8169_private *tp)
+3 -1
drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c
··· 1521 1521 1522 1522 skb = priv->rxq[qnum]->rx_skbuff[entry]; 1523 1523 1524 - if (unlikely(!skb)) 1524 + if (unlikely(!skb)) { 1525 1525 netdev_err(priv->dev, "rx descriptor is not consistent\n"); 1526 + break; 1527 + } 1526 1528 1527 1529 prefetch(skb->data - NET_IP_ALIGN); 1528 1530 priv->rxq[qnum]->rx_skbuff[entry] = NULL;
+12 -8
drivers/net/phy/mxl-gpy.c
··· 582 582 /* Interface mode is fixed for USXGMII and integrated PHY */ 583 583 if (phydev->interface == PHY_INTERFACE_MODE_USXGMII || 584 584 phydev->interface == PHY_INTERFACE_MODE_INTERNAL) 585 - return -EINVAL; 585 + return 0; 586 586 587 587 /* Automatically switch SERDES interface between SGMII and 2500-BaseX 588 588 * according to speed. Disable ANEG in 2500-BaseX mode. ··· 620 620 break; 621 621 } 622 622 623 - if (phydev->speed == SPEED_2500 || phydev->speed == SPEED_1000) { 624 - ret = genphy_read_master_slave(phydev); 625 - if (ret < 0) 626 - return ret; 627 - } 628 - 629 - return gpy_update_mdix(phydev); 623 + return 0; 630 624 } 631 625 632 626 static int gpy_read_status(struct phy_device *phydev) ··· 673 679 674 680 if (phydev->link) { 675 681 ret = gpy_update_interface(phydev); 682 + if (ret < 0) 683 + return ret; 684 + 685 + if (phydev->speed == SPEED_2500 || phydev->speed == SPEED_1000) { 686 + ret = genphy_read_master_slave(phydev); 687 + if (ret < 0) 688 + return ret; 689 + } 690 + 691 + ret = gpy_update_mdix(phydev); 676 692 if (ret < 0) 677 693 return ret; 678 694 }
+15 -8
drivers/net/team/team_core.c
··· 1134 1134 return -EPERM; 1135 1135 } 1136 1136 1137 - err = team_dev_type_check_change(dev, port_dev); 1138 - if (err) 1139 - return err; 1140 - 1141 1137 if (port_dev->flags & IFF_UP) { 1142 1138 NL_SET_ERR_MSG(extack, "Device is up. Set it down before adding it as a team port"); 1143 1139 netdev_err(dev, "Device %s is up. Set it down before adding it as a team port\n", ··· 1151 1155 INIT_LIST_HEAD(&port->qom_list); 1152 1156 1153 1157 port->orig.mtu = port_dev->mtu; 1154 - err = dev_set_mtu(port_dev, dev->mtu); 1155 - if (err) { 1156 - netdev_dbg(dev, "Error %d calling dev_set_mtu\n", err); 1157 - goto err_set_mtu; 1158 + /* 1159 + * MTU assignment will be handled in team_dev_type_check_change 1160 + * if dev and port_dev are of different types 1161 + */ 1162 + if (dev->type == port_dev->type) { 1163 + err = dev_set_mtu(port_dev, dev->mtu); 1164 + if (err) { 1165 + netdev_dbg(dev, "Error %d calling dev_set_mtu\n", err); 1166 + goto err_set_mtu; 1167 + } 1158 1168 } 1159 1169 1160 1170 memcpy(port->orig.dev_addr, port_dev->dev_addr, port_dev->addr_len); ··· 1235 1233 } 1236 1234 } 1237 1235 1236 + err = team_dev_type_check_change(dev, port_dev); 1237 + if (err) 1238 + goto err_set_dev_type; 1239 + 1238 1240 if (dev->flags & IFF_UP) { 1239 1241 netif_addr_lock_bh(dev); 1240 1242 dev_uc_sync_multiple(port_dev, dev); ··· 1257 1251 1258 1252 return 0; 1259 1253 1254 + err_set_dev_type: 1260 1255 err_set_slave_promisc: 1261 1256 __team_option_inst_del_port(team, port); 1262 1257
+1 -1
drivers/net/tun_vnet.h
··· 244 244 245 245 if (virtio_net_hdr_tnl_from_skb(skb, tnl_hdr, has_tnl_offload, 246 246 tun_vnet_is_little_endian(flags), 247 - vlan_hlen)) { 247 + vlan_hlen, true)) { 248 248 struct virtio_net_hdr_v1 *hdr = &tnl_hdr->hash_hdr.hdr; 249 249 struct skb_shared_info *sinfo = skb_shinfo(skb); 250 250
+3 -4
drivers/net/veth.c
··· 975 975 976 976 if (stats.xdp_redirect > 0) 977 977 xdp_do_flush(); 978 + if (stats.xdp_tx > 0) 979 + veth_xdp_flush(rq, &bq); 980 + xdp_clear_return_frame_no_direct(); 978 981 979 982 if (done < budget && napi_complete_done(napi, done)) { 980 983 /* Write rx_notify_masked before reading ptr_ring */ ··· 989 986 } 990 987 } 991 988 } 992 - 993 - if (stats.xdp_tx > 0) 994 - veth_xdp_flush(rq, &bq); 995 - xdp_clear_return_frame_no_direct(); 996 989 997 990 /* Release backpressure per NAPI poll */ 998 991 smp_rmb(); /* Paired with netif_tx_stop_queue set_bit */
+2 -1
drivers/net/virtio_net.c
··· 3344 3344 hdr = &skb_vnet_common_hdr(skb)->tnl_hdr; 3345 3345 3346 3346 if (virtio_net_hdr_tnl_from_skb(skb, hdr, vi->tx_tnl, 3347 - virtio_is_little_endian(vi->vdev), 0)) 3347 + virtio_is_little_endian(vi->vdev), 0, 3348 + false)) 3348 3349 return -EPROTO; 3349 3350 3350 3351 if (vi->mergeable_rx_bufs)
+1 -1
drivers/net/wwan/mhi_wwan_mbim.c
··· 98 98 static int mhi_mbim_get_link_mux_id(struct mhi_controller *cntrl) 99 99 { 100 100 if (strcmp(cntrl->name, "foxconn-dw5934e") == 0 || 101 - strcmp(cntrl->name, "foxconn-t99w515") == 0) 101 + strcmp(cntrl->name, "foxconn-t99w640") == 0) 102 102 return WDS_BIND_MUX_DATA_PORT_MUX_ID; 103 103 104 104 return 0;
+2 -1
drivers/nvme/host/core.c
··· 4901 4901 */ 4902 4902 nvme_stop_keep_alive(ctrl); 4903 4903 blk_mq_destroy_queue(ctrl->admin_q); 4904 - blk_put_queue(ctrl->admin_q); 4905 4904 if (ctrl->ops->flags & NVME_F_FABRICS) { 4906 4905 blk_mq_destroy_queue(ctrl->fabrics_q); 4907 4906 blk_put_queue(ctrl->fabrics_q); ··· 5044 5045 container_of(dev, struct nvme_ctrl, ctrl_device); 5045 5046 struct nvme_subsystem *subsys = ctrl->subsys; 5046 5047 5048 + if (ctrl->admin_q) 5049 + blk_put_queue(ctrl->admin_q); 5047 5050 if (!subsys || ctrl->instance != subsys->instance) 5048 5051 ida_free(&nvme_instance_ida, ctrl->instance); 5049 5052 nvme_free_cels(ctrl);
+8 -7
drivers/nvme/host/fc.c
··· 2355 2355 container_of(ref, struct nvme_fc_ctrl, ref); 2356 2356 unsigned long flags; 2357 2357 2358 - if (ctrl->ctrl.tagset) 2359 - nvme_remove_io_tag_set(&ctrl->ctrl); 2360 - 2361 2358 /* remove from rport list */ 2362 2359 spin_lock_irqsave(&ctrl->rport->lock, flags); 2363 2360 list_del(&ctrl->ctrl_list); 2364 2361 spin_unlock_irqrestore(&ctrl->rport->lock, flags); 2365 - 2366 - nvme_unquiesce_admin_queue(&ctrl->ctrl); 2367 - nvme_remove_admin_tag_set(&ctrl->ctrl); 2368 2362 2369 2363 kfree(ctrl->queues); 2370 2364 ··· 3253 3259 { 3254 3260 struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl); 3255 3261 3256 - cancel_work_sync(&ctrl->ioerr_work); 3257 3262 cancel_delayed_work_sync(&ctrl->connect_work); 3263 + 3258 3264 /* 3259 3265 * kill the association on the link side. this will block 3260 3266 * waiting for io to terminate 3261 3267 */ 3262 3268 nvme_fc_delete_association(ctrl); 3269 + cancel_work_sync(&ctrl->ioerr_work); 3270 + 3271 + if (ctrl->ctrl.tagset) 3272 + nvme_remove_io_tag_set(&ctrl->ctrl); 3273 + 3274 + nvme_unquiesce_admin_queue(&ctrl->ctrl); 3275 + nvme_remove_admin_tag_set(&ctrl->ctrl); 3263 3276 } 3264 3277 3265 3278 static void
+1 -1
drivers/nvme/host/multipath.c
··· 793 793 return; 794 794 } 795 795 nvme_add_ns_head_cdev(head); 796 - kblockd_schedule_work(&head->partition_scan_work); 796 + queue_work(nvme_wq, &head->partition_scan_work); 797 797 } 798 798 799 799 nvme_mpath_add_sysfs_link(ns->head);
+2 -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], sc_c = ctrl->concat ? 1 : 0; 301 + u8 buf[4]; 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 - *buf = sc_c; 370 + *buf = req->sq->sc_c; 371 371 ret = crypto_shash_update(shash, buf, 1); 372 372 if (ret) 373 373 goto out;
+1
drivers/nvme/target/fabrics-cmd-auth.c
··· 43 43 data->auth_protocol[0].dhchap.halen, 44 44 data->auth_protocol[0].dhchap.dhlen); 45 45 req->sq->dhchap_tid = le16_to_cpu(data->t_id); 46 + req->sq->sc_c = data->sc_c; 46 47 if (data->sc_c != NVME_AUTH_SECP_NOSC) { 47 48 if (!IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS)) 48 49 return NVME_AUTH_DHCHAP_FAILURE_CONCAT_MISMATCH;
+1
drivers/nvme/target/nvmet.h
··· 159 159 bool authenticated; 160 160 struct delayed_work auth_expired_work; 161 161 u16 dhchap_tid; 162 + u8 sc_c; 162 163 u8 dhchap_status; 163 164 u8 dhchap_step; 164 165 u8 *dhchap_c1;
+1 -1
drivers/perf/riscv_pmu_sbi.c
··· 1109 1109 /* compute hardware counter index */ 1110 1110 hidx = info->csr - CSR_CYCLE; 1111 1111 1112 - /* check if the corresponding bit is set in sscountovf or overflow mask in shmem */ 1112 + /* check if the corresponding bit is set in scountovf or overflow mask in shmem */ 1113 1113 if (!(overflow & BIT(hidx))) 1114 1114 continue; 1115 1115
+18 -3
drivers/pinctrl/cirrus/pinctrl-cs42l43.c
··· 532 532 return ret; 533 533 } 534 534 535 + static void cs42l43_fwnode_put(void *data) 536 + { 537 + fwnode_handle_put(data); 538 + } 539 + 535 540 static int cs42l43_pin_probe(struct platform_device *pdev) 536 541 { 537 542 struct cs42l43 *cs42l43 = dev_get_drvdata(pdev->dev.parent); ··· 568 563 priv->gpio_chip.ngpio = CS42L43_NUM_GPIOS; 569 564 570 565 if (is_of_node(fwnode)) { 571 - fwnode = fwnode_get_named_child_node(fwnode, "pinctrl"); 566 + struct fwnode_handle *child; 572 567 573 - if (fwnode && !fwnode->dev) 574 - fwnode->dev = priv->dev; 568 + child = fwnode_get_named_child_node(fwnode, "pinctrl"); 569 + if (child) { 570 + ret = devm_add_action_or_reset(&pdev->dev, 571 + cs42l43_fwnode_put, child); 572 + if (ret) { 573 + fwnode_handle_put(child); 574 + return ret; 575 + } 576 + if (!child->dev) 577 + child->dev = priv->dev; 578 + fwnode = child; 579 + } 575 580 } 576 581 577 582 priv->gpio_chip.fwnode = fwnode;
+1 -3
drivers/pinctrl/mediatek/pinctrl-mt8189.c
··· 1642 1642 }; 1643 1643 1644 1644 static const char * const mt8189_pinctrl_register_base_names[] = { 1645 - "gpio_base", "iocfg_bm0_base", "iocfg_bm1_base", "iocfg_bm2_base", "iocfg_lm_base", 1646 - "iocfg_lt0_base", "iocfg_lt1_base", "iocfg_rb0_base", "iocfg_rb1_base", 1647 - "iocfg_rt_base" 1645 + "base", "lm", "rb0", "rb1", "bm0", "bm1", "bm2", "lt0", "lt1", "rt", 1648 1646 }; 1649 1647 1650 1648 static const struct mtk_eint_hw mt8189_eint_hw = {
+2 -4
drivers/pinctrl/mediatek/pinctrl-mt8196.c
··· 1801 1801 }; 1802 1802 1803 1803 static const char * const mt8196_pinctrl_register_base_names[] = { 1804 - "iocfg0", "iocfg_rt", "iocfg_rm1", "iocfg_rm2", 1805 - "iocfg_rb", "iocfg_bm1", "iocfg_bm2", "iocfg_bm3", 1806 - "iocfg_lt", "iocfg_lm1", "iocfg_lm2", "iocfg_lb1", 1807 - "iocfg_lb2", "iocfg_tm1", "iocfg_tm2", "iocfg_tm3", 1804 + "base", "rt", "rm1", "rm2", "rb", "bm1", "bm2", "bm3", 1805 + "lt", "lm1", "lm2", "lb1", "lb2", "tm1", "tm2", "tm3", 1808 1806 }; 1809 1807 1810 1808 static const struct mtk_eint_hw mt8196_eint_hw = {
+2 -1
drivers/pinctrl/nxp/pinctrl-s32cc.c
··· 392 392 393 393 gpio_pin->pin_id = offset; 394 394 gpio_pin->config = config; 395 + INIT_LIST_HEAD(&gpio_pin->list); 395 396 396 397 spin_lock_irqsave(&ipctl->gpio_configs_lock, flags); 397 398 list_add(&gpio_pin->list, &ipctl->gpio_configs); ··· 952 951 spin_lock_init(&ipctl->gpio_configs_lock); 953 952 954 953 s32_pinctrl_desc = 955 - devm_kmalloc(&pdev->dev, sizeof(*s32_pinctrl_desc), GFP_KERNEL); 954 + devm_kzalloc(&pdev->dev, sizeof(*s32_pinctrl_desc), GFP_KERNEL); 956 955 if (!s32_pinctrl_desc) 957 956 return -ENOMEM; 958 957
+1 -1
drivers/pinctrl/qcom/pinctrl-msm.c
··· 189 189 */ 190 190 if (d && i != gpio_func && 191 191 !test_and_set_bit(d->hwirq, pctrl->disabled_for_mux)) 192 - disable_irq(irq); 192 + disable_irq_nosync(irq); 193 193 194 194 raw_spin_lock_irqsave(&pctrl->lock, flags); 195 195
+1
drivers/pinctrl/realtek/Kconfig
··· 6 6 default y 7 7 select PINMUX 8 8 select GENERIC_PINCONF 9 + select REGMAP_MMIO 9 10 10 11 config PINCTRL_RTD1619B 11 12 tristate "Realtek DHC 1619B pin controller driver"
+10 -6
drivers/platform/arm64/lenovo-thinkpad-t14s.c
··· 120 120 if (ret < 0) 121 121 return ret; 122 122 123 + fsleep(10000); 123 124 return 0; 124 125 } 125 126 ··· 158 157 159 158 out: 160 159 i2c_unlock_bus(client->adapter, I2C_LOCK_SEGMENT); 160 + fsleep(10000); 161 161 return ret; 162 162 } 163 163 ··· 192 190 ret = __i2c_transfer(client->adapter, &response, 1); 193 191 if (ret < 0) 194 192 goto out; 193 + 194 + fsleep(10000); 195 195 196 196 ret = 0; 197 197 ··· 561 557 return dev_err_probe(dev, PTR_ERR(ec->regmap), 562 558 "Failed to init regmap\n"); 563 559 564 - ret = devm_request_threaded_irq(dev, client->irq, NULL, 565 - t14s_ec_irq_handler, 566 - IRQF_ONESHOT, dev_name(dev), ec); 567 - if (ret < 0) 568 - return dev_err_probe(dev, ret, "Failed to get IRQ\n"); 569 - 570 560 ret = t14s_leds_probe(ec); 571 561 if (ret < 0) 572 562 return ret; ··· 576 578 ret = t14s_input_probe(ec); 577 579 if (ret < 0) 578 580 return ret; 581 + 582 + ret = devm_request_threaded_irq(dev, client->irq, NULL, 583 + t14s_ec_irq_handler, 584 + IRQF_ONESHOT, dev_name(dev), ec); 585 + if (ret < 0) 586 + return dev_err_probe(dev, ret, "Failed to get IRQ\n"); 579 587 580 588 /* 581 589 * Disable wakeup support by default, because the driver currently does
+1
drivers/platform/x86/Kconfig
··· 545 545 config MSI_WMI_PLATFORM 546 546 tristate "MSI WMI Platform features" 547 547 depends on ACPI_WMI 548 + depends on DMI 548 549 depends on HWMON 549 550 help 550 551 Say Y here if you want to have support for WMI-based platform features
+4
drivers/platform/x86/acer-wmi.c
··· 102 102 103 103 enum acer_wmi_event_ids { 104 104 WMID_HOTKEY_EVENT = 0x1, 105 + WMID_BACKLIGHT_EVENT = 0x4, 105 106 WMID_ACCEL_OR_KBD_DOCK_EVENT = 0x5, 106 107 WMID_GAMING_TURBO_KEY_EVENT = 0x7, 107 108 WMID_AC_EVENT = 0x8, ··· 2369 2368 } 2370 2369 sparse_keymap_report_event(acer_wmi_input_dev, scancode, 1, true); 2371 2370 } 2371 + break; 2372 + case WMID_BACKLIGHT_EVENT: 2373 + /* Already handled by acpi-video */ 2372 2374 break; 2373 2375 case WMID_ACCEL_OR_KBD_DOCK_EVENT: 2374 2376 acer_gsensor_event();
+25
drivers/platform/x86/amd/pmc/pmc-quirks.c
··· 122 122 DMI_MATCH(DMI_PRODUCT_NAME, "21A1"), 123 123 } 124 124 }, 125 + { 126 + .ident = "ROG Xbox Ally RC73YA", 127 + .driver_data = &quirk_spurious_8042, 128 + .matches = { 129 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), 130 + DMI_MATCH(DMI_BOARD_NAME, "RC73YA"), 131 + } 132 + }, 125 133 /* https://bugzilla.kernel.org/show_bug.cgi?id=218024 */ 126 134 { 127 135 .ident = "V14 G4 AMN", ··· 210 202 .matches = { 211 203 DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 212 204 DMI_MATCH(DMI_PRODUCT_NAME, "82ND"), 205 + } 206 + }, 207 + /* https://gitlab.freedesktop.org/drm/amd/-/issues/4618 */ 208 + { 209 + .ident = "Lenovo Legion Go 2", 210 + .driver_data = &quirk_s2idle_bug, 211 + .matches = { 212 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 213 + DMI_MATCH(DMI_PRODUCT_NAME, "83N0"), 214 + } 215 + }, 216 + { 217 + .ident = "Lenovo Legion Go 2", 218 + .driver_data = &quirk_s2idle_bug, 219 + .matches = { 220 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 221 + DMI_MATCH(DMI_PRODUCT_NAME, "83N1"), 213 222 } 214 223 }, 215 224 /* https://gitlab.freedesktop.org/drm/amd/-/issues/2684 */
+3
drivers/platform/x86/amd/pmc/pmc.c
··· 106 106 switch (dev->cpu_id) { 107 107 case AMD_CPU_ID_PCO: 108 108 case AMD_CPU_ID_RN: 109 + case AMD_CPU_ID_VG: 109 110 case AMD_CPU_ID_YC: 110 111 case AMD_CPU_ID_CB: 111 112 dev->num_ips = 12; ··· 518 517 case AMD_CPU_ID_PCO: 519 518 return MSG_OS_HINT_PCO; 520 519 case AMD_CPU_ID_RN: 520 + case AMD_CPU_ID_VG: 521 521 case AMD_CPU_ID_YC: 522 522 case AMD_CPU_ID_CB: 523 523 case AMD_CPU_ID_PS: ··· 719 717 { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_RV) }, 720 718 { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_SP) }, 721 719 { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_SHP) }, 720 + { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_VG) }, 722 721 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M20H_ROOT) }, 723 722 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M60H_ROOT) }, 724 723 { }
+1
drivers/platform/x86/amd/pmc/pmc.h
··· 156 156 #define AMD_CPU_ID_RN 0x1630 157 157 #define AMD_CPU_ID_PCO AMD_CPU_ID_RV 158 158 #define AMD_CPU_ID_CZN AMD_CPU_ID_RN 159 + #define AMD_CPU_ID_VG 0x1645 159 160 #define AMD_CPU_ID_YC 0x14B5 160 161 #define AMD_CPU_ID_CB 0x14D8 161 162 #define AMD_CPU_ID_PS 0x14E8
+28 -84
drivers/platform/x86/dell/alienware-wmi-wmax.c
··· 90 90 91 91 static const struct dmi_system_id awcc_dmi_table[] __initconst = { 92 92 { 93 + .ident = "Alienware 16 Aurora", 94 + .matches = { 95 + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 96 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware 16 Aurora"), 97 + }, 98 + .driver_data = &g_series_quirks, 99 + }, 100 + { 93 101 .ident = "Alienware Area-51m", 94 102 .matches = { 95 103 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), ··· 106 98 .driver_data = &generic_quirks, 107 99 }, 108 100 { 109 - .ident = "Alienware Area-51m R2", 101 + .ident = "Alienware m15", 110 102 .matches = { 111 103 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 112 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware Area-51m R2"), 104 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m15"), 113 105 }, 114 106 .driver_data = &generic_quirks, 115 107 }, 116 108 { 117 - .ident = "Alienware m15 R5", 109 + .ident = "Alienware m16 R1 AMD", 118 110 .matches = { 119 111 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 120 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m15 R5"), 121 - }, 122 - .driver_data = &generic_quirks, 123 - }, 124 - { 125 - .ident = "Alienware m15 R7", 126 - .matches = { 127 - DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 128 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m15 R7"), 112 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m16 R1 AMD"), 129 113 }, 130 114 .driver_data = &generic_quirks, 131 115 }, ··· 130 130 .driver_data = &g_series_quirks, 131 131 }, 132 132 { 133 - .ident = "Alienware m16 R1 AMD", 134 - .matches = { 135 - DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 136 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m16 R1 AMD"), 137 - }, 138 - .driver_data = &generic_quirks, 139 - }, 140 - { 141 133 .ident = "Alienware m16 R2", 142 134 .matches = { 143 135 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), ··· 138 146 .driver_data = &generic_quirks, 139 147 }, 140 148 { 141 - .ident = "Alienware m17 R5", 149 + .ident = "Alienware m17", 142 150 .matches = { 143 151 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 144 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"), 152 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17"), 145 153 }, 146 154 .driver_data = &generic_quirks, 147 155 }, 148 156 { 149 - .ident = "Alienware m18 R2", 157 + .ident = "Alienware m18", 150 158 .matches = { 151 159 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 152 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18 R2"), 160 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18"), 153 161 }, 154 162 .driver_data = &generic_quirks, 155 163 }, 156 164 { 157 - .ident = "Alienware x15 R1", 165 + .ident = "Alienware x15", 158 166 .matches = { 159 167 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 160 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15 R1"), 168 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15"), 161 169 }, 162 170 .driver_data = &generic_quirks, 163 171 }, 164 172 { 165 - .ident = "Alienware x15 R2", 173 + .ident = "Alienware x17", 166 174 .matches = { 167 175 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 168 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15 R2"), 176 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x17"), 169 177 }, 170 178 .driver_data = &generic_quirks, 171 179 }, 172 180 { 173 - .ident = "Alienware x17 R2", 174 - .matches = { 175 - DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 176 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x17 R2"), 177 - }, 178 - .driver_data = &generic_quirks, 179 - }, 180 - { 181 - .ident = "Dell Inc. G15 5510", 181 + .ident = "Dell Inc. G15", 182 182 .matches = { 183 183 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 184 - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5510"), 184 + DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15"), 185 185 }, 186 186 .driver_data = &g_series_quirks, 187 187 }, 188 188 { 189 - .ident = "Dell Inc. G15 5511", 189 + .ident = "Dell Inc. G16", 190 190 .matches = { 191 191 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 192 - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5511"), 192 + DMI_MATCH(DMI_PRODUCT_NAME, "Dell G16"), 193 193 }, 194 194 .driver_data = &g_series_quirks, 195 195 }, 196 196 { 197 - .ident = "Dell Inc. G15 5515", 197 + .ident = "Dell Inc. G3", 198 198 .matches = { 199 199 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 200 - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"), 200 + DMI_MATCH(DMI_PRODUCT_NAME, "G3"), 201 201 }, 202 202 .driver_data = &g_series_quirks, 203 203 }, 204 204 { 205 - .ident = "Dell Inc. G15 5530", 205 + .ident = "Dell Inc. G5", 206 206 .matches = { 207 207 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 208 - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5530"), 209 - }, 210 - .driver_data = &g_series_quirks, 211 - }, 212 - { 213 - .ident = "Dell Inc. G16 7630", 214 - .matches = { 215 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 216 - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G16 7630"), 217 - }, 218 - .driver_data = &g_series_quirks, 219 - }, 220 - { 221 - .ident = "Dell Inc. G3 3500", 222 - .matches = { 223 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 224 - DMI_MATCH(DMI_PRODUCT_NAME, "G3 3500"), 225 - }, 226 - .driver_data = &g_series_quirks, 227 - }, 228 - { 229 - .ident = "Dell Inc. G3 3590", 230 - .matches = { 231 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 232 - DMI_MATCH(DMI_PRODUCT_NAME, "G3 3590"), 233 - }, 234 - .driver_data = &g_series_quirks, 235 - }, 236 - { 237 - .ident = "Dell Inc. G5 5500", 238 - .matches = { 239 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 240 - DMI_MATCH(DMI_PRODUCT_NAME, "G5 5500"), 241 - }, 242 - .driver_data = &g_series_quirks, 243 - }, 244 - { 245 - .ident = "Dell Inc. G5 5505", 246 - .matches = { 247 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 248 - DMI_MATCH(DMI_PRODUCT_NAME, "G5 5505"), 208 + DMI_MATCH(DMI_PRODUCT_NAME, "G5"), 249 209 }, 250 210 .driver_data = &g_series_quirks, 251 211 },
+4 -2
drivers/platform/x86/hp/hp-wmi.c
··· 92 92 "8A25" 93 93 }; 94 94 95 - /* DMI Board names of Victus 16-r1000 and Victus 16-s1000 laptops */ 95 + /* DMI Board names of Victus 16-r and Victus 16-s laptops */ 96 96 static const char * const victus_s_thermal_profile_boards[] = { 97 - "8C99", "8C9C" 97 + "8BBE", "8BD4", "8BD5", 98 + "8C78", "8C99", "8C9C", 99 + "8D41", 98 100 }; 99 101 100 102 enum hp_wmi_radio {
+4
drivers/platform/x86/huawei-wmi.c
··· 81 81 { KE_KEY, 0x289, { KEY_WLAN } }, 82 82 // Huawei |M| key 83 83 { KE_KEY, 0x28a, { KEY_CONFIG } }, 84 + // HONOR YOYO key 85 + { KE_KEY, 0x28b, { KEY_NOTIFICATION_CENTER } }, 86 + // HONOR print screen 87 + { KE_KEY, 0x28e, { KEY_PRINT } }, 84 88 // Keyboard backlit 85 89 { KE_IGNORE, 0x293, { KEY_KBDILLUMTOGGLE } }, 86 90 { KE_IGNORE, 0x294, { KEY_KBDILLUMUP } },
+1
drivers/platform/x86/intel/hid.c
··· 55 55 { "INTC10CB" }, 56 56 { "INTC10CC" }, 57 57 { "INTC10F1" }, 58 + { "INTC10F2" }, 58 59 { } 59 60 }; 60 61 MODULE_DEVICE_TABLE(acpi, intel_hid_ids);
+1 -1
drivers/platform/x86/intel/punit_ipc.c
··· 250 250 } else { 251 251 ret = devm_request_irq(&pdev->dev, irq, intel_punit_ioc, 252 252 IRQF_NO_SUSPEND, "intel_punit_ipc", 253 - &punit_ipcdev); 253 + punit_ipcdev); 254 254 if (ret) { 255 255 dev_err(&pdev->dev, "Failed to request irq: %d\n", irq); 256 256 return ret;
+2 -2
drivers/platform/x86/intel/speed_select_if/isst_if_mmio.c
··· 108 108 109 109 ret = pci_read_config_dword(pdev, 0xD0, &mmio_base); 110 110 if (ret) 111 - return ret; 111 + return pcibios_err_to_errno(ret); 112 112 113 113 ret = pci_read_config_dword(pdev, 0xFC, &pcu_base); 114 114 if (ret) 115 - return ret; 115 + return pcibios_err_to_errno(ret); 116 116 117 117 pcu_base &= GENMASK(10, 0); 118 118 base_addr = (u64)mmio_base << 23 | (u64) pcu_base << 12;
+5 -4
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h
··· 40 40 * @agent_type_mask: Bit mask of all hardware agents for this domain 41 41 * @uncore_attr_group: Attribute group storage 42 42 * @max_freq_khz_kobj_attr: Storage for kobject attribute max_freq_khz 43 - * @mix_freq_khz_kobj_attr: Storage for kobject attribute min_freq_khz 43 + * @min_freq_khz_kobj_attr: Storage for kobject attribute min_freq_khz 44 44 * @initial_max_freq_khz_kobj_attr: Storage for kobject attribute initial_max_freq_khz 45 45 * @initial_min_freq_khz_kobj_attr: Storage for kobject attribute initial_min_freq_khz 46 46 * @current_freq_khz_kobj_attr: Storage for kobject attribute current_freq_khz ··· 48 48 * @fabric_cluster_id_kobj_attr: Storage for kobject attribute fabric_cluster_id 49 49 * @package_id_kobj_attr: Storage for kobject attribute package_id 50 50 * @elc_low_threshold_percent_kobj_attr: 51 - Storage for kobject attribute elc_low_threshold_percent 51 + * Storage for kobject attribute elc_low_threshold_percent 52 52 * @elc_high_threshold_percent_kobj_attr: 53 - Storage for kobject attribute elc_high_threshold_percent 53 + * Storage for kobject attribute elc_high_threshold_percent 54 54 * @elc_high_threshold_enable_kobj_attr: 55 - Storage for kobject attribute elc_high_threshold_enable 55 + * Storage for kobject attribute elc_high_threshold_enable 56 56 * @elc_floor_freq_khz_kobj_attr: Storage for kobject attribute elc_floor_freq_khz 57 57 * @agent_types_kobj_attr: Storage for kobject attribute agent_type 58 + * @die_id_kobj_attr: Attribute storage for die_id information 58 59 * @uncore_attrs: Attribute storage for group creation 59 60 * 60 61 * This structure is used to encapsulate all data related to uncore sysfs
+4
drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c
··· 256 256 X86_MATCH_VFM(INTEL_ARROWLAKE, NULL), 257 257 X86_MATCH_VFM(INTEL_ARROWLAKE_H, NULL), 258 258 X86_MATCH_VFM(INTEL_LUNARLAKE_M, NULL), 259 + X86_MATCH_VFM(INTEL_PANTHERLAKE_L, NULL), 260 + X86_MATCH_VFM(INTEL_WILDCATLAKE_L, NULL), 261 + X86_MATCH_VFM(INTEL_NOVALAKE, NULL), 262 + X86_MATCH_VFM(INTEL_NOVALAKE_L, NULL), 259 263 {} 260 264 }; 261 265 MODULE_DEVICE_TABLE(x86cpu, intel_uncore_cpu_ids);
+41 -2
drivers/platform/x86/msi-wmi-platform.c
··· 14 14 #include <linux/debugfs.h> 15 15 #include <linux/device.h> 16 16 #include <linux/device/driver.h> 17 + #include <linux/dmi.h> 17 18 #include <linux/errno.h> 18 19 #include <linux/hwmon.h> 19 20 #include <linux/kernel.h> ··· 29 28 30 29 #define DRIVER_NAME "msi-wmi-platform" 31 30 32 - #define MSI_PLATFORM_GUID "ABBC0F6E-8EA1-11d1-00A0-C90629100000" 31 + #define MSI_PLATFORM_GUID "ABBC0F6E-8EA1-11D1-00A0-C90629100000" 33 32 34 33 #define MSI_WMI_PLATFORM_INTERFACE_VERSION 2 35 34 ··· 449 448 .probe = msi_wmi_platform_probe, 450 449 .no_singleton = true, 451 450 }; 452 - module_wmi_driver(msi_wmi_platform_driver); 451 + 452 + /* 453 + * MSI reused the WMI GUID from the WMI-ACPI sample code provided by Microsoft, 454 + * so other manufacturers might use it as well for their WMI-ACPI implementations. 455 + */ 456 + static const struct dmi_system_id msi_wmi_platform_whitelist[] __initconst = { 457 + { 458 + .matches = { 459 + DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT"), 460 + }, 461 + }, 462 + { 463 + .matches = { 464 + DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), 465 + }, 466 + }, 467 + { } 468 + }; 469 + 470 + static int __init msi_wmi_platform_module_init(void) 471 + { 472 + if (!dmi_check_system(msi_wmi_platform_whitelist)) { 473 + if (!force) 474 + return -ENODEV; 475 + 476 + pr_warn("Ignoring DMI whitelist\n"); 477 + } 478 + 479 + return wmi_driver_register(&msi_wmi_platform_driver); 480 + } 481 + 482 + static void __exit msi_wmi_platform_module_exit(void) 483 + { 484 + wmi_driver_unregister(&msi_wmi_platform_driver); 485 + } 486 + 487 + module_init(msi_wmi_platform_module_init); 488 + module_exit(msi_wmi_platform_module_exit); 489 + 453 490 454 491 MODULE_AUTHOR("Armin Wolf <W_Armin@gmx.de>"); 455 492 MODULE_DESCRIPTION("MSI WMI platform features");
+6 -4
drivers/power/supply/intel_dc_ti_battery.c
··· 127 127 static int dc_ti_battery_get_voltage_and_current_now(struct power_supply *psy, int *volt, int *curr) 128 128 { 129 129 struct dc_ti_battery_chip *chip = power_supply_get_drvdata(psy); 130 - s64 cnt_start_usec, now_usec, sleep_usec; 130 + ktime_t ktime; 131 + s64 sleep_usec; 131 132 unsigned int reg_val; 132 133 s32 acc, smpl_ctr; 133 134 int ret; ··· 142 141 if (ret) 143 142 goto out_err; 144 143 145 - cnt_start_usec = ktime_get_ns() / NSEC_PER_USEC; 144 + ktime = ktime_get(); 146 145 147 146 /* Read Vbat, convert IIO mV to power-supply ųV */ 148 147 ret = iio_read_channel_processed_scale(chip->vbat_channel, volt, 1000); 149 148 if (ret < 0) 150 149 goto out_err; 151 150 151 + ktime = ktime_sub(ktime_get(), ktime); 152 + 152 153 /* Sleep at least 3 sample-times + slack to get 3+ CC samples */ 153 - now_usec = ktime_get_ns() / NSEC_PER_USEC; 154 - sleep_usec = 3 * SMPL_INTVL_US + SLEEP_SLACK_US - (now_usec - cnt_start_usec); 154 + sleep_usec = 3 * SMPL_INTVL_US + SLEEP_SLACK_US - ktime_to_us(ktime); 155 155 if (sleep_usec > 0 && sleep_usec < 1000000) 156 156 usleep_range(sleep_usec, sleep_usec + SLEEP_SLACK_US); 157 157
+9 -1
drivers/scsi/sg.c
··· 2208 2208 write_lock_irqsave(&sfp->rq_list_lock, iflags); 2209 2209 while (!list_empty(&sfp->rq_list)) { 2210 2210 srp = list_first_entry(&sfp->rq_list, Sg_request, entry); 2211 - sg_finish_rem_req(srp); 2212 2211 list_del(&srp->entry); 2212 + write_unlock_irqrestore(&sfp->rq_list_lock, iflags); 2213 + 2214 + sg_finish_rem_req(srp); 2215 + /* 2216 + * sg_rq_end_io() uses srp->parentfp. Hence, only clear 2217 + * srp->parentfp after blk_mq_free_request() has been called. 2218 + */ 2213 2219 srp->parentfp = NULL; 2220 + 2221 + write_lock_irqsave(&sfp->rq_list_lock, iflags); 2214 2222 } 2215 2223 write_unlock_irqrestore(&sfp->rq_list_lock, iflags); 2216 2224
+3
drivers/target/loopback/tcm_loop.c
··· 894 894 struct tcm_loop_tpg, tl_se_tpg); 895 895 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; 896 896 897 + if (!tl_hba->sh) 898 + return -ENODEV; 899 + 897 900 return snprintf(page, PAGE_SIZE, "%d:0:%d\n", 898 901 tl_hba->sh->host_no, tl_tpg->tl_tpgt); 899 902 }
+32 -21
drivers/vhost/net.c
··· 592 592 static int vhost_net_tx_get_vq_desc(struct vhost_net *net, 593 593 struct vhost_net_virtqueue *tnvq, 594 594 unsigned int *out_num, unsigned int *in_num, 595 - struct msghdr *msghdr, bool *busyloop_intr) 595 + struct msghdr *msghdr, bool *busyloop_intr, 596 + unsigned int *ndesc) 596 597 { 597 598 struct vhost_net_virtqueue *rnvq = &net->vqs[VHOST_NET_VQ_RX]; 598 599 struct vhost_virtqueue *rvq = &rnvq->vq; 599 600 struct vhost_virtqueue *tvq = &tnvq->vq; 600 601 601 - int r = vhost_get_vq_desc(tvq, tvq->iov, ARRAY_SIZE(tvq->iov), 602 - out_num, in_num, NULL, NULL); 602 + int r = vhost_get_vq_desc_n(tvq, tvq->iov, ARRAY_SIZE(tvq->iov), 603 + out_num, in_num, NULL, NULL, ndesc); 603 604 604 605 if (r == tvq->num && tvq->busyloop_timeout) { 605 606 /* Flush batched packets first */ ··· 611 610 612 611 vhost_net_busy_poll(net, rvq, tvq, busyloop_intr, false); 613 612 614 - r = vhost_get_vq_desc(tvq, tvq->iov, ARRAY_SIZE(tvq->iov), 615 - out_num, in_num, NULL, NULL); 613 + r = vhost_get_vq_desc_n(tvq, tvq->iov, ARRAY_SIZE(tvq->iov), 614 + out_num, in_num, NULL, NULL, ndesc); 616 615 } 617 616 618 617 return r; ··· 643 642 struct vhost_net_virtqueue *nvq, 644 643 struct msghdr *msg, 645 644 unsigned int *out, unsigned int *in, 646 - size_t *len, bool *busyloop_intr) 645 + size_t *len, bool *busyloop_intr, 646 + unsigned int *ndesc) 647 647 { 648 648 struct vhost_virtqueue *vq = &nvq->vq; 649 649 int ret; 650 650 651 - ret = vhost_net_tx_get_vq_desc(net, nvq, out, in, msg, busyloop_intr); 651 + ret = vhost_net_tx_get_vq_desc(net, nvq, out, in, msg, 652 + busyloop_intr, ndesc); 652 653 653 654 if (ret < 0 || ret == vq->num) 654 655 return ret; ··· 769 766 int sent_pkts = 0; 770 767 bool sock_can_batch = (sock->sk->sk_sndbuf == INT_MAX); 771 768 bool in_order = vhost_has_feature(vq, VIRTIO_F_IN_ORDER); 769 + unsigned int ndesc = 0; 772 770 773 771 do { 774 772 bool busyloop_intr = false; ··· 778 774 vhost_tx_batch(net, nvq, sock, &msg); 779 775 780 776 head = get_tx_bufs(net, nvq, &msg, &out, &in, &len, 781 - &busyloop_intr); 777 + &busyloop_intr, &ndesc); 782 778 /* On error, stop handling until the next kick. */ 783 779 if (unlikely(head < 0)) 784 780 break; ··· 810 806 goto done; 811 807 } else if (unlikely(err != -ENOSPC)) { 812 808 vhost_tx_batch(net, nvq, sock, &msg); 813 - vhost_discard_vq_desc(vq, 1); 809 + vhost_discard_vq_desc(vq, 1, ndesc); 814 810 vhost_net_enable_vq(net, vq); 815 811 break; 816 812 } ··· 833 829 err = sock->ops->sendmsg(sock, &msg, len); 834 830 if (unlikely(err < 0)) { 835 831 if (err == -EAGAIN || err == -ENOMEM || err == -ENOBUFS) { 836 - vhost_discard_vq_desc(vq, 1); 832 + vhost_discard_vq_desc(vq, 1, ndesc); 837 833 vhost_net_enable_vq(net, vq); 838 834 break; 839 835 } ··· 872 868 int err; 873 869 struct vhost_net_ubuf_ref *ubufs; 874 870 struct ubuf_info_msgzc *ubuf; 871 + unsigned int ndesc = 0; 875 872 bool zcopy_used; 876 873 int sent_pkts = 0; 877 874 ··· 884 879 885 880 busyloop_intr = false; 886 881 head = get_tx_bufs(net, nvq, &msg, &out, &in, &len, 887 - &busyloop_intr); 882 + &busyloop_intr, &ndesc); 888 883 /* On error, stop handling until the next kick. */ 889 884 if (unlikely(head < 0)) 890 885 break; ··· 946 941 vq->heads[ubuf->desc].len = VHOST_DMA_DONE_LEN; 947 942 } 948 943 if (retry) { 949 - vhost_discard_vq_desc(vq, 1); 944 + vhost_discard_vq_desc(vq, 1, ndesc); 950 945 vhost_net_enable_vq(net, vq); 951 946 break; 952 947 } ··· 1050 1045 unsigned *iovcount, 1051 1046 struct vhost_log *log, 1052 1047 unsigned *log_num, 1053 - unsigned int quota) 1048 + unsigned int quota, 1049 + unsigned int *ndesc) 1054 1050 { 1055 1051 struct vhost_virtqueue *vq = &nvq->vq; 1056 1052 bool in_order = vhost_has_feature(vq, VIRTIO_F_IN_ORDER); 1057 - unsigned int out, in; 1053 + unsigned int out, in, desc_num, n = 0; 1058 1054 int seg = 0; 1059 1055 int headcount = 0; 1060 1056 unsigned d; ··· 1070 1064 r = -ENOBUFS; 1071 1065 goto err; 1072 1066 } 1073 - r = vhost_get_vq_desc(vq, vq->iov + seg, 1074 - ARRAY_SIZE(vq->iov) - seg, &out, 1075 - &in, log, log_num); 1067 + r = vhost_get_vq_desc_n(vq, vq->iov + seg, 1068 + ARRAY_SIZE(vq->iov) - seg, &out, 1069 + &in, log, log_num, &desc_num); 1076 1070 if (unlikely(r < 0)) 1077 1071 goto err; 1078 1072 ··· 1099 1093 ++headcount; 1100 1094 datalen -= len; 1101 1095 seg += in; 1096 + n += desc_num; 1102 1097 } 1103 1098 1104 1099 *iovcount = seg; ··· 1120 1113 nheads[0] = headcount; 1121 1114 } 1122 1115 1116 + *ndesc = n; 1117 + 1123 1118 return headcount; 1124 1119 err: 1125 - vhost_discard_vq_desc(vq, headcount); 1120 + vhost_discard_vq_desc(vq, headcount, n); 1126 1121 return r; 1127 1122 } 1128 1123 ··· 1160 1151 struct iov_iter fixup; 1161 1152 __virtio16 num_buffers; 1162 1153 int recv_pkts = 0; 1154 + unsigned int ndesc; 1163 1155 1164 1156 mutex_lock_nested(&vq->mutex, VHOST_NET_VQ_RX); 1165 1157 sock = vhost_vq_get_backend(vq); ··· 1192 1182 headcount = get_rx_bufs(nvq, vq->heads + count, 1193 1183 vq->nheads + count, 1194 1184 vhost_len, &in, vq_log, &log, 1195 - likely(mergeable) ? UIO_MAXIOV : 1); 1185 + likely(mergeable) ? UIO_MAXIOV : 1, 1186 + &ndesc); 1196 1187 /* On error, stop handling until the next kick. */ 1197 1188 if (unlikely(headcount < 0)) 1198 1189 goto out; ··· 1239 1228 if (unlikely(err != sock_len)) { 1240 1229 pr_debug("Discarded rx packet: " 1241 1230 " len %d, expected %zd\n", err, sock_len); 1242 - vhost_discard_vq_desc(vq, headcount); 1231 + vhost_discard_vq_desc(vq, headcount, ndesc); 1243 1232 continue; 1244 1233 } 1245 1234 /* Supply virtio_net_hdr if VHOST_NET_F_VIRTIO_NET_HDR */ ··· 1263 1252 copy_to_iter(&num_buffers, sizeof num_buffers, 1264 1253 &fixup) != sizeof num_buffers) { 1265 1254 vq_err(vq, "Failed num_buffers write"); 1266 - vhost_discard_vq_desc(vq, headcount); 1255 + vhost_discard_vq_desc(vq, headcount, ndesc); 1267 1256 goto out; 1268 1257 } 1269 1258 nvq->done_idx += headcount;
+62 -14
drivers/vhost/vhost.c
··· 2792 2792 return 0; 2793 2793 } 2794 2794 2795 - /* This looks in the virtqueue and for the first available buffer, and converts 2796 - * it to an iovec for convenient access. Since descriptors consist of some 2797 - * number of output then some number of input descriptors, it's actually two 2798 - * iovecs, but we pack them into one and note how many of each there were. 2795 + /** 2796 + * vhost_get_vq_desc_n - Fetch the next available descriptor chain and build iovecs 2797 + * @vq: target virtqueue 2798 + * @iov: array that receives the scatter/gather segments 2799 + * @iov_size: capacity of @iov in elements 2800 + * @out_num: the number of output segments 2801 + * @in_num: the number of input segments 2802 + * @log: optional array to record addr/len for each writable segment; NULL if unused 2803 + * @log_num: optional output; number of entries written to @log when provided 2804 + * @ndesc: optional output; number of descriptors consumed from the available ring 2805 + * (useful for rollback via vhost_discard_vq_desc) 2799 2806 * 2800 - * This function returns the descriptor number found, or vq->num (which is 2801 - * never a valid descriptor number) if none was found. A negative code is 2802 - * returned on error. */ 2803 - int vhost_get_vq_desc(struct vhost_virtqueue *vq, 2804 - struct iovec iov[], unsigned int iov_size, 2805 - unsigned int *out_num, unsigned int *in_num, 2806 - struct vhost_log *log, unsigned int *log_num) 2807 + * Extracts one available descriptor chain from @vq and translates guest addresses 2808 + * into host iovecs. 2809 + * 2810 + * On success, advances @vq->last_avail_idx by 1 and @vq->next_avail_head by the 2811 + * number of descriptors consumed (also stored via @ndesc when non-NULL). 2812 + * 2813 + * Return: 2814 + * - head index in [0, @vq->num) on success; 2815 + * - @vq->num if no descriptor is currently available; 2816 + * - negative errno on failure 2817 + */ 2818 + int vhost_get_vq_desc_n(struct vhost_virtqueue *vq, 2819 + struct iovec iov[], unsigned int iov_size, 2820 + unsigned int *out_num, unsigned int *in_num, 2821 + struct vhost_log *log, unsigned int *log_num, 2822 + unsigned int *ndesc) 2807 2823 { 2808 2824 bool in_order = vhost_has_feature(vq, VIRTIO_F_IN_ORDER); 2809 2825 struct vring_desc desc; ··· 2937 2921 vq->last_avail_idx++; 2938 2922 vq->next_avail_head += c; 2939 2923 2924 + if (ndesc) 2925 + *ndesc = c; 2926 + 2940 2927 /* Assume notifications from guest are disabled at this point, 2941 2928 * if they aren't we would need to update avail_event index. */ 2942 2929 BUG_ON(!(vq->used_flags & VRING_USED_F_NO_NOTIFY)); 2943 2930 return head; 2944 2931 } 2932 + EXPORT_SYMBOL_GPL(vhost_get_vq_desc_n); 2933 + 2934 + /* This looks in the virtqueue and for the first available buffer, and converts 2935 + * it to an iovec for convenient access. Since descriptors consist of some 2936 + * number of output then some number of input descriptors, it's actually two 2937 + * iovecs, but we pack them into one and note how many of each there were. 2938 + * 2939 + * This function returns the descriptor number found, or vq->num (which is 2940 + * never a valid descriptor number) if none was found. A negative code is 2941 + * returned on error. 2942 + */ 2943 + int vhost_get_vq_desc(struct vhost_virtqueue *vq, 2944 + struct iovec iov[], unsigned int iov_size, 2945 + unsigned int *out_num, unsigned int *in_num, 2946 + struct vhost_log *log, unsigned int *log_num) 2947 + { 2948 + return vhost_get_vq_desc_n(vq, iov, iov_size, out_num, in_num, 2949 + log, log_num, NULL); 2950 + } 2945 2951 EXPORT_SYMBOL_GPL(vhost_get_vq_desc); 2946 2952 2947 - /* Reverse the effect of vhost_get_vq_desc. Useful for error handling. */ 2948 - void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int n) 2953 + /** 2954 + * vhost_discard_vq_desc - Reverse the effect of vhost_get_vq_desc_n() 2955 + * @vq: target virtqueue 2956 + * @nbufs: number of buffers to roll back 2957 + * @ndesc: number of descriptors to roll back 2958 + * 2959 + * Rewinds the internal consumer cursors after a failed attempt to use buffers 2960 + * returned by vhost_get_vq_desc_n(). 2961 + */ 2962 + void vhost_discard_vq_desc(struct vhost_virtqueue *vq, int nbufs, 2963 + unsigned int ndesc) 2949 2964 { 2950 - vq->last_avail_idx -= n; 2965 + vq->next_avail_head -= ndesc; 2966 + vq->last_avail_idx -= nbufs; 2951 2967 } 2952 2968 EXPORT_SYMBOL_GPL(vhost_discard_vq_desc); 2953 2969
+9 -1
drivers/vhost/vhost.h
··· 230 230 struct iovec iov[], unsigned int iov_size, 231 231 unsigned int *out_num, unsigned int *in_num, 232 232 struct vhost_log *log, unsigned int *log_num); 233 - void vhost_discard_vq_desc(struct vhost_virtqueue *, int n); 233 + 234 + int vhost_get_vq_desc_n(struct vhost_virtqueue *vq, 235 + struct iovec iov[], unsigned int iov_size, 236 + unsigned int *out_num, unsigned int *in_num, 237 + struct vhost_log *log, unsigned int *log_num, 238 + unsigned int *ndesc); 239 + 240 + void vhost_discard_vq_desc(struct vhost_virtqueue *, int nbuf, 241 + unsigned int ndesc); 234 242 235 243 bool vhost_vq_work_queue(struct vhost_virtqueue *vq, struct vhost_work *work); 236 244 bool vhost_vq_has_work(struct vhost_virtqueue *vq);
+38 -3
fs/smb/client/cached_dir.c
··· 16 16 static void free_cached_dir(struct cached_fid *cfid); 17 17 static void smb2_close_cached_fid(struct kref *ref); 18 18 static void cfids_laundromat_worker(struct work_struct *work); 19 + static void close_cached_dir_locked(struct cached_fid *cfid); 19 20 20 21 struct cached_dir_dentry { 21 22 struct list_head entry; ··· 389 388 * lease. Release one here, and the second below. 390 389 */ 391 390 cfid->has_lease = false; 392 - close_cached_dir(cfid); 391 + close_cached_dir_locked(cfid); 393 392 } 394 393 spin_unlock(&cfids->cfid_list_lock); 395 394 ··· 481 480 spin_lock(&cfid->cfids->cfid_list_lock); 482 481 if (cfid->has_lease) { 483 482 cfid->has_lease = false; 484 - close_cached_dir(cfid); 483 + close_cached_dir_locked(cfid); 485 484 } 486 485 spin_unlock(&cfid->cfids->cfid_list_lock); 487 486 close_cached_dir(cfid); 488 487 } 489 488 490 - 489 + /** 490 + * close_cached_dir - drop a reference of a cached dir 491 + * 492 + * The release function will be called with cfid_list_lock held to remove the 493 + * cached dirs from the list before any other thread can take another @cfid 494 + * ref. Must not be called with cfid_list_lock held; use 495 + * close_cached_dir_locked() called instead. 496 + * 497 + * @cfid: cached dir 498 + */ 491 499 void close_cached_dir(struct cached_fid *cfid) 492 500 { 501 + lockdep_assert_not_held(&cfid->cfids->cfid_list_lock); 493 502 kref_put_lock(&cfid->refcount, smb2_close_cached_fid, &cfid->cfids->cfid_list_lock); 503 + } 504 + 505 + /** 506 + * close_cached_dir_locked - put a reference of a cached dir with 507 + * cfid_list_lock held 508 + * 509 + * Calling close_cached_dir() with cfid_list_lock held has the potential effect 510 + * of causing a deadlock if the invariant of refcount >= 2 is false. 511 + * 512 + * This function is used in paths that hold cfid_list_lock and expect at least 513 + * two references. If that invariant is violated, WARNs and returns without 514 + * dropping a reference; the final put must still go through 515 + * close_cached_dir(). 516 + * 517 + * @cfid: cached dir 518 + */ 519 + static void close_cached_dir_locked(struct cached_fid *cfid) 520 + { 521 + lockdep_assert_held(&cfid->cfids->cfid_list_lock); 522 + 523 + if (WARN_ON(kref_read(&cfid->refcount) < 2)) 524 + return; 525 + 526 + kref_put(&cfid->refcount, smb2_close_cached_fid); 494 527 } 495 528 496 529 /*
+22
fs/smb/client/cifssmb.c
··· 1363 1363 if (rdata->result == -ENODATA) { 1364 1364 rdata->result = 0; 1365 1365 __set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags); 1366 + trace_smb3_read_err(rdata->rreq->debug_id, 1367 + rdata->subreq.debug_index, 1368 + rdata->xid, 1369 + rdata->req->cfile->fid.persistent_fid, 1370 + tcon->tid, tcon->ses->Suid, 1371 + rdata->subreq.start + rdata->subreq.transferred, 1372 + rdata->subreq.len - rdata->subreq.transferred, 1373 + rdata->result); 1366 1374 } else { 1367 1375 size_t trans = rdata->subreq.transferred + rdata->got_bytes; 1368 1376 if (trans < rdata->subreq.len && ··· 1382 1374 } 1383 1375 if (rdata->got_bytes) 1384 1376 __set_bit(NETFS_SREQ_MADE_PROGRESS, &rdata->subreq.flags); 1377 + trace_smb3_read_done(rdata->rreq->debug_id, 1378 + rdata->subreq.debug_index, 1379 + rdata->xid, 1380 + rdata->req->cfile->fid.persistent_fid, 1381 + tcon->tid, tcon->ses->Suid, 1382 + rdata->subreq.start + rdata->subreq.transferred, 1383 + rdata->got_bytes); 1385 1384 } 1386 1385 1387 1386 trace_smb3_rw_credits(rreq_debug_id, subreq_debug_index, rdata->credits.value, ··· 1459 1444 rdata->iov[0].iov_len = 4; 1460 1445 rdata->iov[1].iov_base = (char *)smb + 4; 1461 1446 rdata->iov[1].iov_len = get_rfc1002_length(smb); 1447 + 1448 + trace_smb3_read_enter(rdata->rreq->debug_id, 1449 + rdata->subreq.debug_index, 1450 + rdata->xid, 1451 + rdata->req->cfile->fid.netfid, 1452 + tcon->tid, tcon->ses->Suid, 1453 + rdata->subreq.start, rdata->subreq.len); 1462 1454 1463 1455 rc = cifs_call_async(tcon->ses->server, &rqst, cifs_readv_receive, 1464 1456 cifs_readv_callback, NULL, rdata, 0, NULL);
+1
fs/smb/client/connect.c
··· 4451 4451 4452 4452 out: 4453 4453 kfree(ctx->username); 4454 + kfree(ctx->domainname); 4454 4455 kfree_sensitive(ctx->password); 4455 4456 kfree(origin_fullpath); 4456 4457 kfree(ctx);
+4
fs/smb/client/fs_context.c
··· 1834 1834 ctx->password = NULL; 1835 1835 kfree_sensitive(ctx->password2); 1836 1836 ctx->password2 = NULL; 1837 + kfree(ctx->source); 1838 + ctx->source = NULL; 1839 + kfree(fc->source); 1840 + fc->source = NULL; 1837 1841 return -EINVAL; 1838 1842 } 1839 1843
+28 -6
include/acpi/processor.h
··· 417 417 #endif /* CONFIG_ACPI_CPU_FREQ_PSS */ 418 418 419 419 /* in processor_idle.c */ 420 + extern struct cpuidle_driver acpi_idle_driver; 420 421 #ifdef CONFIG_ACPI_PROCESSOR_IDLE 421 - void acpi_processor_power_init(struct acpi_processor *pr); 422 - void acpi_processor_power_exit(struct acpi_processor *pr); 422 + int acpi_processor_power_init(struct acpi_processor *pr); 423 + int acpi_processor_power_exit(struct acpi_processor *pr); 423 424 int acpi_processor_power_state_has_changed(struct acpi_processor *pr); 424 425 int acpi_processor_hotplug(struct acpi_processor *pr); 425 - void acpi_processor_register_idle_driver(void); 426 - void acpi_processor_unregister_idle_driver(void); 427 - int acpi_processor_ffh_lpi_probe(unsigned int cpu); 428 - int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi); 426 + #else 427 + static inline int acpi_processor_power_init(struct acpi_processor *pr) 428 + { 429 + return -ENODEV; 430 + } 431 + 432 + static inline int acpi_processor_power_exit(struct acpi_processor *pr) 433 + { 434 + return -ENODEV; 435 + } 436 + 437 + static inline int acpi_processor_power_state_has_changed(struct acpi_processor *pr) 438 + { 439 + return -ENODEV; 440 + } 441 + 442 + static inline int acpi_processor_hotplug(struct acpi_processor *pr) 443 + { 444 + return -ENODEV; 445 + } 429 446 #endif /* CONFIG_ACPI_PROCESSOR_IDLE */ 430 447 431 448 /* in processor_thermal.c */ ··· 464 447 return; 465 448 } 466 449 #endif /* CONFIG_CPU_FREQ */ 450 + 451 + #ifdef CONFIG_ACPI_PROCESSOR_IDLE 452 + extern int acpi_processor_ffh_lpi_probe(unsigned int cpu); 453 + extern int acpi_processor_ffh_lpi_enter(struct acpi_lpi_state *lpi); 454 + #endif 467 455 468 456 void acpi_processor_init_invariance_cppc(void); 469 457
+4 -1
include/drm/intel/pciids.h
··· 877 877 MACRO__(0xB08F, ## __VA_ARGS__), \ 878 878 MACRO__(0xB090, ## __VA_ARGS__), \ 879 879 MACRO__(0xB0A0, ## __VA_ARGS__), \ 880 - MACRO__(0xB0B0, ## __VA_ARGS__), \ 880 + MACRO__(0xB0B0, ## __VA_ARGS__) 881 + 882 + /* WCL */ 883 + #define INTEL_WCL_IDS(MACRO__, ...) \ 881 884 MACRO__(0xFD80, ## __VA_ARGS__), \ 882 885 MACRO__(0xFD81, ## __VA_ARGS__) 883 886
+1
include/linux/ata.h
··· 566 566 #define ata_id_has_ncq(id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8)) 567 567 #define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) 568 568 #define ata_id_removable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) 569 + #define ata_id_is_locked(id) (((id)[ATA_ID_DLF] & 0x7) == 0x7) 569 570 #define ata_id_has_atapi_AN(id) \ 570 571 ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ 571 572 ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \
+4 -3
include/linux/virtio_net.h
··· 384 384 struct virtio_net_hdr_v1_hash_tunnel *vhdr, 385 385 bool tnl_hdr_negotiated, 386 386 bool little_endian, 387 - int vlan_hlen) 387 + int vlan_hlen, 388 + bool has_data_valid) 388 389 { 389 390 struct virtio_net_hdr *hdr = (struct virtio_net_hdr *)vhdr; 390 391 unsigned int inner_nh, outer_th; ··· 395 394 tnl_gso_type = skb_shinfo(skb)->gso_type & (SKB_GSO_UDP_TUNNEL | 396 395 SKB_GSO_UDP_TUNNEL_CSUM); 397 396 if (!tnl_gso_type) 398 - return virtio_net_hdr_from_skb(skb, hdr, little_endian, false, 399 - vlan_hlen); 397 + return virtio_net_hdr_from_skb(skb, hdr, little_endian, 398 + has_data_valid, vlan_hlen); 400 399 401 400 /* Tunnel support not negotiated but skb ask for it. */ 402 401 if (!tnl_hdr_negotiated)
+14 -7
include/net/bluetooth/hci_core.h
··· 749 749 750 750 __u8 remote_cap; 751 751 __u8 remote_auth; 752 - __u8 remote_id; 753 752 754 753 unsigned int sent; 755 754 ··· 856 857 /* ----- HCI interface to upper protocols ----- */ 857 858 int l2cap_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr); 858 859 int l2cap_disconn_ind(struct hci_conn *hcon); 859 - void l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags); 860 + int l2cap_recv_acldata(struct hci_dev *hdev, u16 handle, struct sk_buff *skb, 861 + u16 flags); 860 862 861 863 #if IS_ENABLED(CONFIG_BT_BREDR) 862 864 int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags); 863 - void sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb); 865 + int sco_recv_scodata(struct hci_dev *hdev, u16 handle, struct sk_buff *skb); 864 866 #else 865 867 static inline int sco_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, 866 868 __u8 *flags) ··· 869 869 return 0; 870 870 } 871 871 872 - static inline void sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb) 872 + static inline int sco_recv_scodata(struct hci_dev *hdev, u16 handle, 873 + struct sk_buff *skb) 873 874 { 875 + kfree_skb(skb); 876 + return -ENOENT; 874 877 } 875 878 #endif 876 879 877 880 #if IS_ENABLED(CONFIG_BT_LE) 878 881 int iso_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 *flags); 879 - void iso_recv(struct hci_conn *hcon, struct sk_buff *skb, u16 flags); 882 + int iso_recv(struct hci_dev *hdev, u16 handle, struct sk_buff *skb, 883 + u16 flags); 880 884 #else 881 885 static inline int iso_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, 882 886 __u8 *flags) 883 887 { 884 888 return 0; 885 889 } 886 - static inline void iso_recv(struct hci_conn *hcon, struct sk_buff *skb, 887 - u16 flags) 890 + 891 + static inline int iso_recv(struct hci_dev *hdev, u16 handle, 892 + struct sk_buff *skb, u16 flags) 888 893 { 894 + kfree_skb(skb); 895 + return -ENOENT; 889 896 } 890 897 #endif 891 898
+2
include/net/pkt_cls.h
··· 536 536 case TCF_LAYER_NETWORK: 537 537 return skb_network_header(skb); 538 538 case TCF_LAYER_TRANSPORT: 539 + if (!skb_transport_header_was_set(skb)) 540 + break; 539 541 return skb_transport_header(skb); 540 542 } 541 543
+1 -1
include/uapi/linux/input-event-codes.h
··· 27 27 #define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ 28 28 #define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ 29 29 #define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */ 30 - #define INPUT_PROP_HAPTIC_TOUCHPAD 0x07 /* is a haptic touchpad */ 30 + #define INPUT_PROP_PRESSUREPAD 0x07 /* pressure triggers clicks */ 31 31 32 32 #define INPUT_PROP_MAX 0x1f 33 33 #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
+27 -23
include/uapi/linux/isst_if.h
··· 52 52 /** 53 53 * struct isst_if_cpu_maps - structure for CPU map IOCTL 54 54 * @cmd_count: Number of CPU mapping command in cpu_map[] 55 - * @cpu_map[]: Holds one or more CPU map data structure 55 + * @cpu_map: Holds one or more CPU map data structure 56 56 * 57 57 * This structure used with ioctl ISST_IF_GET_PHY_ID to send 58 58 * one or more CPU mapping commands. Here IOCTL return value indicates ··· 82 82 83 83 /** 84 84 * struct isst_if_io_regs - structure for IO register commands 85 - * @cmd_count: Number of io reg commands in io_reg[] 86 - * @io_reg[]: Holds one or more io_reg command structure 85 + * @req_count: Number of io reg commands in io_reg[] 86 + * @io_reg: Holds one or more io_reg command structure 87 87 * 88 88 * This structure used with ioctl ISST_IF_IO_CMD to send 89 89 * one or more read/write commands to PUNIT. Here IOCTL return value ··· 120 120 /** 121 121 * struct isst_if_mbox_cmds - structure for mailbox commands 122 122 * @cmd_count: Number of mailbox commands in mbox_cmd[] 123 - * @mbox_cmd[]: Holds one or more mbox commands 123 + * @mbox_cmd: Holds one or more mbox commands 124 124 * 125 125 * This structure used with ioctl ISST_IF_MBOX_COMMAND to send 126 126 * one or more mailbox commands to PUNIT. Here IOCTL return value ··· 152 152 /** 153 153 * struct isst_if_msr_cmds - structure for msr commands 154 154 * @cmd_count: Number of mailbox commands in msr_cmd[] 155 - * @msr_cmd[]: Holds one or more msr commands 155 + * @msr_cmd: Holds one or more msr commands 156 156 * 157 157 * This structure used with ioctl ISST_IF_MSR_COMMAND to send 158 158 * one or more MSR commands. IOCTL return value indicates number of ··· 167 167 * struct isst_core_power - Structure to get/set core_power feature 168 168 * @get_set: 0: Get, 1: Set 169 169 * @socket_id: Socket/package id 170 - * @power_domain: Power Domain id 170 + * @power_domain_id: Power Domain id 171 171 * @enable: Feature enable status 172 + * @supported: Power domain supports SST_CP interface 172 173 * @priority_type: Priority type for the feature (ordered/proportional) 173 174 * 174 175 * Structure to get/set core_power feature state using IOCTL ··· 188 187 * struct isst_clos_param - Structure to get/set clos praram 189 188 * @get_set: 0: Get, 1: Set 190 189 * @socket_id: Socket/package id 191 - * @power_domain: Power Domain id 192 - * clos: Clos ID for the parameters 193 - * min_freq_mhz: Minimum frequency in MHz 194 - * max_freq_mhz: Maximum frequency in MHz 195 - * prop_prio: Proportional priority from 0-15 190 + * @power_domain_id: Power Domain id 191 + * @clos: Clos ID for the parameters 192 + * @min_freq_mhz: Minimum frequency in MHz 193 + * @max_freq_mhz: Maximum frequency in MHz 194 + * @prop_prio: Proportional priority from 0-15 196 195 * 197 196 * Structure to get/set per clos property using IOCTL 198 197 * ISST_IF_CLOS_PARAM. ··· 210 209 /** 211 210 * struct isst_if_clos_assoc - Structure to assign clos to a CPU 212 211 * @socket_id: Socket/package id 213 - * @power_domain: Power Domain id 212 + * @power_domain_id: Power Domain id 214 213 * @logical_cpu: CPU number 215 214 * @clos: Clos ID to assign to the logical CPU 216 215 * ··· 229 228 * @get_set: Request is for get or set 230 229 * @punit_cpu_map: Set to 1 if the CPU number is punit numbering not 231 230 * Linux CPU number 231 + * @assoc_info: CLOS data for this CPU 232 232 * 233 233 * Structure used to get/set associate CPUs to clos using IOCTL 234 234 * ISST_IF_CLOS_ASSOC. ··· 259 257 /** 260 258 * struct isst_perf_level_info - Structure to get information on SST-PP levels 261 259 * @socket_id: Socket/package id 262 - * @power_domain: Power Domain id 260 + * @power_domain_id: Power Domain id 263 261 * @logical_cpu: CPU number 264 262 * @clos: Clos ID to assign to the logical CPU 265 263 * @max_level: Maximum performance level supported by the platform ··· 269 267 * @feature_state: SST-BF and SST-TF (enabled/disabled) status at current level 270 268 * @locked: SST-PP performance level change is locked/unlocked 271 269 * @enabled: SST-PP feature is enabled or not 272 - * @sst-tf_support: SST-TF support status at this level 273 - * @sst-bf_support: SST-BF support status at this level 270 + * @sst_tf_support: SST-TF support status at this level 271 + * @sst_bf_support: SST-BF support status at this level 274 272 * 275 273 * Structure to get SST-PP details using IOCTL ISST_IF_PERF_LEVELS. 276 274 */ ··· 291 289 /** 292 290 * struct isst_perf_level_control - Structure to set SST-PP level 293 291 * @socket_id: Socket/package id 294 - * @power_domain: Power Domain id 292 + * @power_domain_id: Power Domain id 295 293 * @level: level to set 296 294 * 297 295 * Structure used change SST-PP level using IOCTL ISST_IF_PERF_SET_LEVEL. ··· 305 303 /** 306 304 * struct isst_perf_feature_control - Structure to activate SST-BF/SST-TF 307 305 * @socket_id: Socket/package id 308 - * @power_domain: Power Domain id 306 + * @power_domain_id: Power Domain id 309 307 * @feature: bit 0 = SST-BF state, bit 1 = SST-TF state 310 308 * 311 309 * Structure used to enable SST-BF/SST-TF using IOCTL ISST_IF_PERF_SET_FEATURE. ··· 322 320 /** 323 321 * struct isst_perf_level_data_info - Structure to get SST-PP level details 324 322 * @socket_id: Socket/package id 325 - * @power_domain: Power Domain id 323 + * @power_domain_id: Power Domain id 326 324 * @level: SST-PP level for which caller wants to get information 327 325 * @tdp_ratio: TDP Ratio 328 326 * @base_freq_mhz: Base frequency in MHz ··· 343 341 * @pm_fabric_freq_mhz: Fabric (Uncore) minimum frequency 344 342 * @max_buckets: Maximum trl buckets 345 343 * @max_trl_levels: Maximum trl levels 346 - * @bucket_core_counts[TRL_MAX_BUCKETS]: Number of cores per bucket 347 - * @trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS]: maximum frequency 344 + * @bucket_core_counts: Number of cores per bucket 345 + * @trl_freq_mhz: maximum frequency 348 346 * for a bucket and trl level 349 347 * 350 348 * Structure used to get information on frequencies and TDP for a SST-PP ··· 404 402 /** 405 403 * struct isst_perf_level_cpu_mask - Structure to get SST-PP level CPU mask 406 404 * @socket_id: Socket/package id 407 - * @power_domain: Power Domain id 405 + * @power_domain_id: Power Domain id 408 406 * @level: SST-PP level for which caller wants to get information 409 407 * @punit_cpu_map: Set to 1 if the CPU number is punit numbering not 410 408 * Linux CPU number. If 0 CPU buffer is copied to user space ··· 432 430 /** 433 431 * struct isst_base_freq_info - Structure to get SST-BF frequencies 434 432 * @socket_id: Socket/package id 435 - * @power_domain: Power Domain id 433 + * @power_domain_id: Power Domain id 436 434 * @level: SST-PP level for which caller wants to get information 437 435 * @high_base_freq_mhz: High priority CPU base frequency 438 436 * @low_base_freq_mhz: Low priority CPU base frequency ··· 455 453 /** 456 454 * struct isst_turbo_freq_info - Structure to get SST-TF frequencies 457 455 * @socket_id: Socket/package id 458 - * @power_domain: Power Domain id 456 + * @power_domain_id: Power Domain id 459 457 * @level: SST-PP level for which caller wants to get information 460 458 * @max_clip_freqs: Maximum number of low priority core clipping frequencies 459 + * @max_buckets: Maximum trl buckets 460 + * @max_trl_levels: Maximum trl levels 461 461 * @lp_clip_freq_mhz: Clip frequencies per trl level 462 462 * @bucket_core_counts: Maximum number of cores for a bucket 463 463 * @trl_freq_mhz: Frequencies per trl level for each bucket
+1 -1
io_uring/cmd_net.c
··· 127 127 128 128 if (!unlikely(skb_queue_empty(&list))) { 129 129 scoped_guard(spinlock_irqsave, &q->lock) 130 - skb_queue_splice(q, &list); 130 + skb_queue_splice(&list, q); 131 131 } 132 132 return -EAGAIN; 133 133 }
+1 -1
kernel/events/core.c
··· 11901 11901 11902 11902 static void cpu_clock_event_del(struct perf_event *event, int flags) 11903 11903 { 11904 - cpu_clock_event_stop(event, flags); 11904 + cpu_clock_event_stop(event, PERF_EF_UPDATE); 11905 11905 } 11906 11906 11907 11907 static void cpu_clock_event_read(struct perf_event *event)
+4 -1
kernel/sched/ext.c
··· 4479 4479 goto err_free_gdsqs; 4480 4480 4481 4481 sch->helper = kthread_run_worker(0, "sched_ext_helper"); 4482 - if (!sch->helper) 4482 + if (IS_ERR(sch->helper)) { 4483 + ret = PTR_ERR(sch->helper); 4483 4484 goto err_free_pcpu; 4485 + } 4486 + 4484 4487 sched_set_fifo(sch->helper->task); 4485 4488 4486 4489 atomic_set(&sch->exit_kind, SCX_EXIT_NONE);
+5 -6
kernel/time/tick-sched.c
··· 1152 1152 return false; 1153 1153 } 1154 1154 1155 - if (ratelimit >= 10) 1156 - return false; 1157 - 1158 1155 /* On RT, softirq handling may be waiting on some lock */ 1159 1156 if (local_bh_blocked()) 1160 1157 return false; 1161 1158 1162 - pr_warn("NOHZ tick-stop error: local softirq work is pending, handler #%02x!!!\n", 1163 - pending); 1164 - ratelimit++; 1159 + if (ratelimit < 10) { 1160 + pr_warn("NOHZ tick-stop error: local softirq work is pending, handler #%02x!!!\n", 1161 + pending); 1162 + ratelimit++; 1163 + } 1165 1164 1166 1165 return true; 1167 1166 }
+12 -9
kernel/time/timekeeping.c
··· 3060 3060 static int __init tk_aux_sysfs_init(void) 3061 3061 { 3062 3062 struct kobject *auxo, *tko = kobject_create_and_add("time", kernel_kobj); 3063 + int ret = -ENOMEM; 3063 3064 3064 3065 if (!tko) 3065 - return -ENOMEM; 3066 + return ret; 3066 3067 3067 3068 auxo = kobject_create_and_add("aux_clocks", tko); 3068 - if (!auxo) { 3069 - kobject_put(tko); 3070 - return -ENOMEM; 3071 - } 3069 + if (!auxo) 3070 + goto err_clean; 3072 3071 3073 3072 for (int i = 0; i < MAX_AUX_CLOCKS; i++) { 3074 3073 char id[2] = { [0] = '0' + i, }; 3075 3074 struct kobject *clk = kobject_create_and_add(id, auxo); 3076 3075 3077 3076 if (!clk) 3078 - return -ENOMEM; 3077 + goto err_clean; 3079 3078 3080 - int ret = sysfs_create_group(clk, &aux_clock_enable_attr_group); 3081 - 3079 + ret = sysfs_create_group(clk, &aux_clock_enable_attr_group); 3082 3080 if (ret) 3083 - return ret; 3081 + goto err_clean; 3084 3082 } 3085 3083 return 0; 3084 + 3085 + err_clean: 3086 + kobject_put(auxo); 3087 + kobject_put(tko); 3088 + return ret; 3086 3089 } 3087 3090 late_initcall(tk_aux_sysfs_init); 3088 3091
+4 -3
kernel/time/timer.c
··· 1458 1458 1459 1459 base = lock_timer_base(timer, &flags); 1460 1460 1461 - if (base->running_timer != timer) 1461 + if (base->running_timer != timer) { 1462 1462 ret = detach_if_pending(timer, base, true); 1463 - if (shutdown) 1464 - timer->function = NULL; 1463 + if (shutdown) 1464 + timer->function = NULL; 1465 + } 1465 1466 1466 1467 raw_spin_unlock_irqrestore(&base->lock, flags); 1467 1468
+10
kernel/trace/trace.c
··· 8781 8781 put_snapshot_map(iter->tr); 8782 8782 } 8783 8783 8784 + static int tracing_buffers_may_split(struct vm_area_struct *vma, unsigned long addr) 8785 + { 8786 + /* 8787 + * Trace buffer mappings require the complete buffer including 8788 + * the meta page. Partial mappings are not supported. 8789 + */ 8790 + return -EINVAL; 8791 + } 8792 + 8784 8793 static const struct vm_operations_struct tracing_buffers_vmops = { 8785 8794 .close = tracing_buffers_mmap_close, 8795 + .may_split = tracing_buffers_may_split, 8786 8796 }; 8787 8797 8788 8798 static int tracing_buffers_mmap(struct file *filp, struct vm_area_struct *vma)
+1 -2
lib/Kconfig.debug
··· 445 445 default 2048 if GCC_PLUGIN_LATENT_ENTROPY 446 446 default 2048 if PARISC 447 447 default 1536 if (!64BIT && XTENSA) 448 - default 1280 if KASAN && !64BIT 449 - default 1024 if !64BIT 448 + default 1280 if !64BIT 450 449 default 2048 if 64BIT 451 450 help 452 451 Tell the compiler to warn at build time for stack frames larger than this.
+1
lib/crypto/tests/sha256_kunit.c
··· 68 68 rand_bytes(data1_buf, max_data_len); 69 69 rand_bytes(data2_buf, max_data_len); 70 70 rand_bytes(salt, sizeof(salt)); 71 + memset(ctx, 0, sizeof(*ctx)); 71 72 72 73 for (size_t i = 0; i < 500; i++) { 73 74 size_t salt_len = rand_length(sizeof(salt));
+14 -13
mm/filemap.c
··· 3682 3682 struct folio *folio, unsigned long start, 3683 3683 unsigned long addr, unsigned int nr_pages, 3684 3684 unsigned long *rss, unsigned short *mmap_miss, 3685 - bool can_map_large) 3685 + pgoff_t file_end) 3686 3686 { 3687 + struct address_space *mapping = folio->mapping; 3687 3688 unsigned int ref_from_caller = 1; 3688 3689 vm_fault_t ret = 0; 3689 3690 struct page *page = folio_page(folio, start); ··· 3693 3692 unsigned long addr0; 3694 3693 3695 3694 /* 3696 - * Map the large folio fully where possible. 3695 + * Map the large folio fully where possible: 3697 3696 * 3698 - * The folio must not cross VMA or page table boundary. 3697 + * - The folio is fully within size of the file or belong 3698 + * to shmem/tmpfs; 3699 + * - The folio doesn't cross VMA boundary; 3700 + * - The folio doesn't cross page table boundary; 3699 3701 */ 3700 3702 addr0 = addr - start * PAGE_SIZE; 3701 - if (can_map_large && folio_within_vma(folio, vmf->vma) && 3703 + if ((file_end >= folio_next_index(folio) || shmem_mapping(mapping)) && 3704 + folio_within_vma(folio, vmf->vma) && 3702 3705 (addr0 & PMD_MASK) == ((addr0 + folio_size(folio) - 1) & PMD_MASK)) { 3703 3706 vmf->pte -= start; 3704 3707 page -= start; ··· 3817 3812 unsigned long rss = 0; 3818 3813 unsigned int nr_pages = 0, folio_type; 3819 3814 unsigned short mmap_miss = 0, mmap_miss_saved; 3820 - bool can_map_large; 3821 3815 3822 3816 rcu_read_lock(); 3823 3817 folio = next_uptodate_folio(&xas, mapping, end_pgoff); ··· 3827 3823 end_pgoff = min(end_pgoff, file_end); 3828 3824 3829 3825 /* 3830 - * Do not allow to map with PTEs beyond i_size and with PMD 3831 - * across i_size to preserve SIGBUS semantics. 3826 + * Do not allow to map with PMD across i_size to preserve 3827 + * SIGBUS semantics. 3832 3828 * 3833 3829 * Make an exception for shmem/tmpfs that for long time 3834 3830 * intentionally mapped with PMDs across i_size. 3835 3831 */ 3836 - can_map_large = shmem_mapping(mapping) || 3837 - file_end >= folio_next_index(folio); 3838 - 3839 - if (can_map_large && filemap_map_pmd(vmf, folio, start_pgoff)) { 3832 + if ((file_end >= folio_next_index(folio) || shmem_mapping(mapping)) && 3833 + filemap_map_pmd(vmf, folio, start_pgoff)) { 3840 3834 ret = VM_FAULT_NOPAGE; 3841 3835 goto out; 3842 3836 } ··· 3863 3861 else 3864 3862 ret |= filemap_map_folio_range(vmf, folio, 3865 3863 xas.xa_index - folio->index, addr, 3866 - nr_pages, &rss, &mmap_miss, 3867 - can_map_large); 3864 + nr_pages, &rss, &mmap_miss, file_end); 3868 3865 3869 3866 folio_unlock(folio); 3870 3867 } while ((folio = next_uptodate_folio(&xas, mapping, end_pgoff)) != NULL);
+10 -12
mm/huge_memory.c
··· 3619 3619 if (folio != page_folio(split_at) || folio != page_folio(lock_at)) 3620 3620 return -EINVAL; 3621 3621 3622 + /* 3623 + * Folios that just got truncated cannot get split. Signal to the 3624 + * caller that there was a race. 3625 + * 3626 + * TODO: this will also currently refuse shmem folios that are in the 3627 + * swapcache. 3628 + */ 3629 + if (!is_anon && !folio->mapping) 3630 + return -EBUSY; 3631 + 3622 3632 if (new_order >= folio_order(folio)) 3623 3633 return -EINVAL; 3624 3634 ··· 3669 3659 gfp_t gfp; 3670 3660 3671 3661 mapping = folio->mapping; 3672 - 3673 - /* Truncated ? */ 3674 - /* 3675 - * TODO: add support for large shmem folio in swap cache. 3676 - * When shmem is in swap cache, mapping is NULL and 3677 - * folio_test_swapcache() is true. 3678 - */ 3679 - if (!mapping) { 3680 - ret = -EBUSY; 3681 - goto out; 3682 - } 3683 - 3684 3662 min_order = mapping_min_folio_order(folio->mapping); 3685 3663 if (new_order < min_order) { 3686 3664 ret = -EINVAL;
+27
mm/memfd.c
··· 96 96 NULL, 97 97 gfp_mask); 98 98 if (folio) { 99 + u32 hash; 100 + 101 + /* 102 + * Zero the folio to prevent information leaks to userspace. 103 + * Use folio_zero_user() which is optimized for huge/gigantic 104 + * pages. Pass 0 as addr_hint since this is not a faulting path 105 + * and we don't have a user virtual address yet. 106 + */ 107 + folio_zero_user(folio, 0); 108 + 109 + /* 110 + * Mark the folio uptodate before adding to page cache, 111 + * as required by filemap.c and other hugetlb paths. 112 + */ 113 + __folio_mark_uptodate(folio); 114 + 115 + /* 116 + * Serialize hugepage allocation and instantiation to prevent 117 + * races with concurrent allocations, as required by all other 118 + * callers of hugetlb_add_to_page_cache(). 119 + */ 120 + hash = hugetlb_fault_mutex_hash(memfd->f_mapping, idx); 121 + mutex_lock(&hugetlb_fault_mutex_table[hash]); 122 + 99 123 err = hugetlb_add_to_page_cache(folio, 100 124 memfd->f_mapping, 101 125 idx); 126 + 127 + mutex_unlock(&hugetlb_fault_mutex_table[hash]); 128 + 102 129 if (err) { 103 130 folio_put(folio); 104 131 goto err_unresv;
+26 -6
mm/mempool.c
··· 68 68 } else if (pool->free == mempool_free_pages) { 69 69 /* Mempools backed by page allocator */ 70 70 int order = (int)(long)pool->pool_data; 71 - void *addr = kmap_local_page((struct page *)element); 72 71 73 - __check_element(pool, addr, 1UL << (PAGE_SHIFT + order)); 74 - kunmap_local(addr); 72 + #ifdef CONFIG_HIGHMEM 73 + for (int i = 0; i < (1 << order); i++) { 74 + struct page *page = (struct page *)element; 75 + void *addr = kmap_local_page(page + i); 76 + 77 + __check_element(pool, addr, PAGE_SIZE); 78 + kunmap_local(addr); 79 + } 80 + #else 81 + void *addr = page_address((struct page *)element); 82 + 83 + __check_element(pool, addr, PAGE_SIZE << order); 84 + #endif 75 85 } 76 86 } 77 87 ··· 107 97 } else if (pool->alloc == mempool_alloc_pages) { 108 98 /* Mempools backed by page allocator */ 109 99 int order = (int)(long)pool->pool_data; 110 - void *addr = kmap_local_page((struct page *)element); 111 100 112 - __poison_element(addr, 1UL << (PAGE_SHIFT + order)); 113 - kunmap_local(addr); 101 + #ifdef CONFIG_HIGHMEM 102 + for (int i = 0; i < (1 << order); i++) { 103 + struct page *page = (struct page *)element; 104 + void *addr = kmap_local_page(page + i); 105 + 106 + __poison_element(addr, PAGE_SIZE); 107 + kunmap_local(addr); 108 + } 109 + #else 110 + void *addr = page_address((struct page *)element); 111 + 112 + __poison_element(addr, PAGE_SIZE << order); 113 + #endif 114 114 } 115 115 } 116 116 #else /* CONFIG_SLUB_DEBUG_ON */
+1
mm/mmap_lock.c
··· 241 241 if (PTR_ERR(vma) == -EAGAIN) { 242 242 count_vm_vma_lock_event(VMA_LOCK_MISS); 243 243 /* The area was replaced with another one */ 244 + mas_set(&mas, address); 244 245 goto retry; 245 246 } 246 247
+1 -3
mm/swapfile.c
··· 2005 2005 local_lock(&percpu_swap_cluster.lock); 2006 2006 offset = cluster_alloc_swap_entry(si, 0, 1); 2007 2007 local_unlock(&percpu_swap_cluster.lock); 2008 - if (offset) { 2008 + if (offset) 2009 2009 entry = swp_entry(si->type, offset); 2010 - atomic_long_dec(&nr_swap_pages); 2011 - } 2012 2010 } 2013 2011 put_swap_device(si); 2014 2012 }
+1 -1
net/atm/common.c
··· 881 881 out_atmsvc_exit: 882 882 atmsvc_exit(); 883 883 out_atmpvc_exit: 884 - atmsvc_exit(); 884 + atmpvc_exit(); 885 885 out_unregister_vcc_proto: 886 886 proto_unregister(&vcc_proto); 887 887 goto out;
+37 -52
net/bluetooth/hci_core.c
··· 3832 3832 static void hci_acldata_packet(struct hci_dev *hdev, struct sk_buff *skb) 3833 3833 { 3834 3834 struct hci_acl_hdr *hdr; 3835 - struct hci_conn *conn; 3836 3835 __u16 handle, flags; 3836 + int err; 3837 3837 3838 3838 hdr = skb_pull_data(skb, sizeof(*hdr)); 3839 3839 if (!hdr) { 3840 3840 bt_dev_err(hdev, "ACL packet too small"); 3841 - goto drop; 3841 + kfree_skb(skb); 3842 + return; 3842 3843 } 3843 3844 3844 3845 handle = __le16_to_cpu(hdr->handle); ··· 3851 3850 3852 3851 hdev->stat.acl_rx++; 3853 3852 3854 - hci_dev_lock(hdev); 3855 - conn = hci_conn_hash_lookup_handle(hdev, handle); 3856 - hci_dev_unlock(hdev); 3857 - 3858 - if (conn) { 3859 - hci_conn_enter_active_mode(conn, BT_POWER_FORCE_ACTIVE_OFF); 3860 - 3861 - /* Send to upper protocol */ 3862 - l2cap_recv_acldata(conn, skb, flags); 3863 - return; 3864 - } else { 3853 + err = l2cap_recv_acldata(hdev, handle, skb, flags); 3854 + if (err == -ENOENT) 3865 3855 bt_dev_err(hdev, "ACL packet for unknown connection handle %d", 3866 3856 handle); 3867 - } 3868 - 3869 - drop: 3870 - kfree_skb(skb); 3857 + else if (err) 3858 + bt_dev_dbg(hdev, "ACL packet recv for handle %d failed: %d", 3859 + handle, err); 3871 3860 } 3872 3861 3873 3862 /* SCO data packet */ 3874 3863 static void hci_scodata_packet(struct hci_dev *hdev, struct sk_buff *skb) 3875 3864 { 3876 3865 struct hci_sco_hdr *hdr; 3877 - struct hci_conn *conn; 3878 3866 __u16 handle, flags; 3867 + int err; 3879 3868 3880 3869 hdr = skb_pull_data(skb, sizeof(*hdr)); 3881 3870 if (!hdr) { 3882 3871 bt_dev_err(hdev, "SCO packet too small"); 3883 - goto drop; 3872 + kfree_skb(skb); 3873 + return; 3884 3874 } 3885 3875 3886 3876 handle = __le16_to_cpu(hdr->handle); ··· 3883 3891 3884 3892 hdev->stat.sco_rx++; 3885 3893 3886 - hci_dev_lock(hdev); 3887 - conn = hci_conn_hash_lookup_handle(hdev, handle); 3888 - hci_dev_unlock(hdev); 3894 + hci_skb_pkt_status(skb) = flags & 0x03; 3889 3895 3890 - if (conn) { 3891 - /* Send to upper protocol */ 3892 - hci_skb_pkt_status(skb) = flags & 0x03; 3893 - sco_recv_scodata(conn, skb); 3894 - return; 3895 - } else { 3896 + err = sco_recv_scodata(hdev, handle, skb); 3897 + if (err == -ENOENT) 3896 3898 bt_dev_err_ratelimited(hdev, "SCO packet for unknown connection handle %d", 3897 3899 handle); 3898 - } 3899 - 3900 - drop: 3901 - kfree_skb(skb); 3900 + else if (err) 3901 + bt_dev_dbg(hdev, "SCO packet recv for handle %d failed: %d", 3902 + handle, err); 3902 3903 } 3903 3904 3904 3905 static void hci_isodata_packet(struct hci_dev *hdev, struct sk_buff *skb) 3905 3906 { 3906 3907 struct hci_iso_hdr *hdr; 3907 - struct hci_conn *conn; 3908 3908 __u16 handle, flags; 3909 + int err; 3909 3910 3910 3911 hdr = skb_pull_data(skb, sizeof(*hdr)); 3911 3912 if (!hdr) { 3912 3913 bt_dev_err(hdev, "ISO packet too small"); 3913 - goto drop; 3914 + kfree_skb(skb); 3915 + return; 3914 3916 } 3915 3917 3916 3918 handle = __le16_to_cpu(hdr->handle); ··· 3914 3928 bt_dev_dbg(hdev, "len %d handle 0x%4.4x flags 0x%4.4x", skb->len, 3915 3929 handle, flags); 3916 3930 3917 - hci_dev_lock(hdev); 3918 - conn = hci_conn_hash_lookup_handle(hdev, handle); 3919 - hci_dev_unlock(hdev); 3920 - 3921 - if (!conn) { 3931 + err = iso_recv(hdev, handle, skb, flags); 3932 + if (err == -ENOENT) 3922 3933 bt_dev_err(hdev, "ISO packet for unknown connection handle %d", 3923 3934 handle); 3924 - goto drop; 3925 - } 3926 - 3927 - /* Send to upper protocol */ 3928 - iso_recv(conn, skb, flags); 3929 - return; 3930 - 3931 - drop: 3932 - kfree_skb(skb); 3935 + else if (err) 3936 + bt_dev_dbg(hdev, "ISO packet recv for handle %d failed: %d", 3937 + handle, err); 3933 3938 } 3934 3939 3935 3940 static bool hci_req_is_complete(struct hci_dev *hdev) ··· 4098 4121 } 4099 4122 } 4100 4123 4101 - static void hci_send_cmd_sync(struct hci_dev *hdev, struct sk_buff *skb) 4124 + static int hci_send_cmd_sync(struct hci_dev *hdev, struct sk_buff *skb) 4102 4125 { 4103 4126 int err; 4104 4127 ··· 4110 4133 if (!hdev->sent_cmd) { 4111 4134 skb_queue_head(&hdev->cmd_q, skb); 4112 4135 queue_work(hdev->workqueue, &hdev->cmd_work); 4113 - return; 4136 + return -EINVAL; 4114 4137 } 4115 4138 4116 4139 if (hci_skb_opcode(skb) != HCI_OP_NOP) { 4117 4140 err = hci_send_frame(hdev, skb); 4118 4141 if (err < 0) { 4119 4142 hci_cmd_sync_cancel_sync(hdev, -err); 4120 - return; 4143 + return err; 4121 4144 } 4122 4145 atomic_dec(&hdev->cmd_cnt); 4146 + } else { 4147 + err = -ENODATA; 4148 + kfree_skb(skb); 4123 4149 } 4124 4150 4125 4151 if (hdev->req_status == HCI_REQ_PEND && ··· 4130 4150 kfree_skb(hdev->req_skb); 4131 4151 hdev->req_skb = skb_clone(hdev->sent_cmd, GFP_KERNEL); 4132 4152 } 4153 + 4154 + return err; 4133 4155 } 4134 4156 4135 4157 static void hci_cmd_work(struct work_struct *work) 4136 4158 { 4137 4159 struct hci_dev *hdev = container_of(work, struct hci_dev, cmd_work); 4138 4160 struct sk_buff *skb; 4161 + int err; 4139 4162 4140 4163 BT_DBG("%s cmd_cnt %d cmd queued %d", hdev->name, 4141 4164 atomic_read(&hdev->cmd_cnt), skb_queue_len(&hdev->cmd_q)); ··· 4149 4166 if (!skb) 4150 4167 return; 4151 4168 4152 - hci_send_cmd_sync(hdev, skb); 4169 + err = hci_send_cmd_sync(hdev, skb); 4170 + if (err) 4171 + return; 4153 4172 4154 4173 rcu_read_lock(); 4155 4174 if (test_bit(HCI_RESET, &hdev->flags) ||
+2
net/bluetooth/hci_sock.c
··· 1311 1311 goto done; 1312 1312 } 1313 1313 1314 + hci_dev_lock(hdev); 1314 1315 mgmt_index_removed(hdev); 1316 + hci_dev_unlock(hdev); 1315 1317 1316 1318 err = hci_dev_open(hdev->id); 1317 1319 if (err) {
+25 -5
net/bluetooth/iso.c
··· 2314 2314 iso_conn_del(hcon, bt_to_errno(reason)); 2315 2315 } 2316 2316 2317 - void iso_recv(struct hci_conn *hcon, struct sk_buff *skb, u16 flags) 2317 + int iso_recv(struct hci_dev *hdev, u16 handle, struct sk_buff *skb, u16 flags) 2318 2318 { 2319 - struct iso_conn *conn = hcon->iso_data; 2319 + struct hci_conn *hcon; 2320 + struct iso_conn *conn; 2320 2321 struct skb_shared_hwtstamps *hwts; 2321 2322 __u16 pb, ts, len, sn; 2322 2323 2323 - if (!conn) 2324 - goto drop; 2324 + hci_dev_lock(hdev); 2325 + 2326 + hcon = hci_conn_hash_lookup_handle(hdev, handle); 2327 + if (!hcon) { 2328 + hci_dev_unlock(hdev); 2329 + kfree_skb(skb); 2330 + return -ENOENT; 2331 + } 2332 + 2333 + conn = iso_conn_hold_unless_zero(hcon->iso_data); 2334 + hcon = NULL; 2335 + 2336 + hci_dev_unlock(hdev); 2337 + 2338 + if (!conn) { 2339 + kfree_skb(skb); 2340 + return -EINVAL; 2341 + } 2325 2342 2326 2343 pb = hci_iso_flags_pb(flags); 2327 2344 ts = hci_iso_flags_ts(flags); ··· 2394 2377 hci_skb_pkt_status(skb) = flags & 0x03; 2395 2378 hci_skb_pkt_seqnum(skb) = sn; 2396 2379 iso_recv_frame(conn, skb); 2397 - return; 2380 + goto done; 2398 2381 } 2399 2382 2400 2383 if (pb == ISO_SINGLE) { ··· 2472 2455 2473 2456 drop: 2474 2457 kfree_skb(skb); 2458 + done: 2459 + iso_conn_put(conn); 2460 + return 0; 2475 2461 } 2476 2462 2477 2463 static struct hci_cb iso_cb = {
+18 -5
net/bluetooth/l2cap_core.c
··· 7510 7510 return c; 7511 7511 } 7512 7512 7513 - void l2cap_recv_acldata(struct hci_conn *hcon, struct sk_buff *skb, u16 flags) 7513 + int l2cap_recv_acldata(struct hci_dev *hdev, u16 handle, 7514 + struct sk_buff *skb, u16 flags) 7514 7515 { 7516 + struct hci_conn *hcon; 7515 7517 struct l2cap_conn *conn; 7516 7518 int len; 7517 7519 7518 - /* Lock hdev to access l2cap_data to avoid race with l2cap_conn_del */ 7519 - hci_dev_lock(hcon->hdev); 7520 + /* Lock hdev for hci_conn, and race on l2cap_data vs. l2cap_conn_del */ 7521 + hci_dev_lock(hdev); 7522 + 7523 + hcon = hci_conn_hash_lookup_handle(hdev, handle); 7524 + if (!hcon) { 7525 + hci_dev_unlock(hdev); 7526 + kfree_skb(skb); 7527 + return -ENOENT; 7528 + } 7529 + 7530 + hci_conn_enter_active_mode(hcon, BT_POWER_FORCE_ACTIVE_OFF); 7520 7531 7521 7532 conn = hcon->l2cap_data; 7522 7533 ··· 7535 7524 conn = l2cap_conn_add(hcon); 7536 7525 7537 7526 conn = l2cap_conn_hold_unless_zero(conn); 7527 + hcon = NULL; 7538 7528 7539 - hci_dev_unlock(hcon->hdev); 7529 + hci_dev_unlock(hdev); 7540 7530 7541 7531 if (!conn) { 7542 7532 kfree_skb(skb); 7543 - return; 7533 + return -EINVAL; 7544 7534 } 7545 7535 7546 7536 BT_DBG("conn %p len %u flags 0x%x", conn, skb->len, flags); ··· 7655 7643 unlock: 7656 7644 mutex_unlock(&conn->lock); 7657 7645 l2cap_conn_put(conn); 7646 + return 0; 7658 7647 } 7659 7648 7660 7649 static struct hci_cb l2cap_cb = {
+26 -9
net/bluetooth/sco.c
··· 1458 1458 sco_conn_del(hcon, bt_to_errno(reason)); 1459 1459 } 1460 1460 1461 - void sco_recv_scodata(struct hci_conn *hcon, struct sk_buff *skb) 1461 + int sco_recv_scodata(struct hci_dev *hdev, u16 handle, struct sk_buff *skb) 1462 1462 { 1463 - struct sco_conn *conn = hcon->sco_data; 1463 + struct hci_conn *hcon; 1464 + struct sco_conn *conn; 1464 1465 1465 - if (!conn) 1466 - goto drop; 1466 + hci_dev_lock(hdev); 1467 + 1468 + hcon = hci_conn_hash_lookup_handle(hdev, handle); 1469 + if (!hcon) { 1470 + hci_dev_unlock(hdev); 1471 + kfree_skb(skb); 1472 + return -ENOENT; 1473 + } 1474 + 1475 + conn = sco_conn_hold_unless_zero(hcon->sco_data); 1476 + hcon = NULL; 1477 + 1478 + hci_dev_unlock(hdev); 1479 + 1480 + if (!conn) { 1481 + kfree_skb(skb); 1482 + return -EINVAL; 1483 + } 1467 1484 1468 1485 BT_DBG("conn %p len %u", conn, skb->len); 1469 1486 1470 - if (skb->len) { 1487 + if (skb->len) 1471 1488 sco_recv_frame(conn, skb); 1472 - return; 1473 - } 1489 + else 1490 + kfree_skb(skb); 1474 1491 1475 - drop: 1476 - kfree_skb(skb); 1492 + sco_conn_put(conn); 1493 + return 0; 1477 1494 } 1478 1495 1479 1496 static struct hci_cb sco_cb = {
+7 -24
net/bluetooth/smp.c
··· 2136 2136 struct smp_chan *smp = chan->data; 2137 2137 struct hci_conn *hcon = conn->hcon; 2138 2138 u8 *pkax, *pkbx, *na, *nb, confirm_hint; 2139 - u32 passkey; 2139 + u32 passkey = 0; 2140 2140 int err; 2141 2141 2142 2142 bt_dev_dbg(hcon->hdev, "conn %p", conn); ··· 2188 2188 smp_send_cmd(conn, SMP_CMD_PAIRING_RANDOM, sizeof(smp->prnd), 2189 2189 smp->prnd); 2190 2190 SMP_ALLOW_CMD(smp, SMP_CMD_DHKEY_CHECK); 2191 - 2192 - /* Only Just-Works pairing requires extra checks */ 2193 - if (smp->method != JUST_WORKS) 2194 - goto mackey_and_ltk; 2195 - 2196 - /* If there already exists long term key in local host, leave 2197 - * the decision to user space since the remote device could 2198 - * be legitimate or malicious. 2199 - */ 2200 - if (hci_find_ltk(hcon->hdev, &hcon->dst, hcon->dst_type, 2201 - hcon->role)) { 2202 - /* Set passkey to 0. The value can be any number since 2203 - * it'll be ignored anyway. 2204 - */ 2205 - passkey = 0; 2206 - confirm_hint = 1; 2207 - goto confirm; 2208 - } 2209 2191 } 2210 2192 2211 2193 mackey_and_ltk: ··· 2208 2226 if (err) 2209 2227 return SMP_UNSPECIFIED; 2210 2228 2211 - confirm_hint = 0; 2212 - 2213 - confirm: 2214 - if (smp->method == JUST_WORKS) 2215 - confirm_hint = 1; 2229 + /* Always require user confirmation for Just-Works pairing to prevent 2230 + * impersonation attacks, or in case of a legitimate device that is 2231 + * repairing use the confirmation as acknowledgment to proceed with the 2232 + * creation of new keys. 2233 + */ 2234 + confirm_hint = smp->method == JUST_WORKS ? 1 : 0; 2216 2235 2217 2236 err = mgmt_user_confirm_request(hcon->hdev, &hcon->dst, hcon->type, 2218 2237 hcon->dst_type, passkey, confirm_hint);
+1
net/mctp/route.c
··· 623 623 624 624 skb->protocol = htons(ETH_P_MCTP); 625 625 skb->pkt_type = PACKET_OUTGOING; 626 + skb->dev = dst->dev->dev; 626 627 627 628 if (skb->len > dst->mtu) { 628 629 kfree_skb(skb);
+17 -2
net/mptcp/protocol.c
··· 2741 2741 } 2742 2742 2743 2743 if (!mptcp_send_head(sk)) 2744 - return; 2744 + goto clear_scheduled; 2745 2745 2746 2746 goto reset_timer; 2747 2747 } ··· 2772 2772 if (__mptcp_check_fallback(msk)) { 2773 2773 spin_unlock_bh(&msk->fallback_lock); 2774 2774 release_sock(ssk); 2775 - return; 2775 + goto clear_scheduled; 2776 2776 } 2777 2777 2778 2778 while (info.sent < info.limit) { ··· 2804 2804 2805 2805 if (!mptcp_rtx_timer_pending(sk)) 2806 2806 mptcp_reset_rtx_timer(sk); 2807 + 2808 + clear_scheduled: 2809 + /* If no rtx data was available or in case of fallback, there 2810 + * could be left-over scheduled subflows; clear them all 2811 + * or later xmit could use bad ones 2812 + */ 2813 + mptcp_for_each_subflow(msk, subflow) 2814 + if (READ_ONCE(subflow->scheduled)) 2815 + mptcp_subflow_set_scheduled(subflow, false); 2807 2816 } 2808 2817 2809 2818 /* schedule the timeout timer for the relevant event: either close timeout ··· 2893 2884 goto unlock; 2894 2885 2895 2886 subflow->send_fastclose = 1; 2887 + 2888 + /* Initialize rcv_mss to TCP_MIN_MSS to avoid division by 0 2889 + * issue in __tcp_select_window(), see tcp_disconnect(). 2890 + */ 2891 + inet_csk(ssk)->icsk_ack.rcv_mss = TCP_MIN_MSS; 2892 + 2896 2893 tcp_send_active_reset(ssk, ssk->sk_allocation, 2897 2894 SK_RST_REASON_TCP_ABORT_ON_CLOSE); 2898 2895 unlock:
+3
net/sched/em_canid.c
··· 99 99 int i; 100 100 const struct can_filter *lp; 101 101 102 + if (!pskb_may_pull(skb, CAN_MTU)) 103 + return 0; 104 + 102 105 can_id = em_canid_get_id(skb); 103 106 104 107 if (can_id & CAN_EFF_FLAG) {
+4 -1
net/sched/em_cmp.c
··· 22 22 struct tcf_pkt_info *info) 23 23 { 24 24 struct tcf_em_cmp *cmp = (struct tcf_em_cmp *) em->data; 25 - unsigned char *ptr = tcf_get_base_ptr(skb, cmp->layer) + cmp->off; 25 + unsigned char *ptr = tcf_get_base_ptr(skb, cmp->layer); 26 26 u32 val = 0; 27 27 28 + if (!ptr) 29 + return 0; 30 + ptr += cmp->off; 28 31 if (!tcf_valid_offset(skb, ptr, cmp->align)) 29 32 return 0; 30 33
+2
net/sched/em_nbyte.c
··· 42 42 struct nbyte_data *nbyte = (struct nbyte_data *) em->data; 43 43 unsigned char *ptr = tcf_get_base_ptr(skb, nbyte->hdr.layer); 44 44 45 + if (!ptr) 46 + return 0; 45 47 ptr += nbyte->hdr.off; 46 48 47 49 if (!tcf_valid_offset(skb, ptr, nbyte->hdr.len))
+9 -2
net/sched/em_text.c
··· 29 29 struct tcf_pkt_info *info) 30 30 { 31 31 struct text_match *tm = EM_TEXT_PRIV(m); 32 + unsigned char *ptr; 32 33 int from, to; 33 34 34 - from = tcf_get_base_ptr(skb, tm->from_layer) - skb->data; 35 + ptr = tcf_get_base_ptr(skb, tm->from_layer); 36 + if (!ptr) 37 + return 0; 38 + from = ptr - skb->data; 35 39 from += tm->from_offset; 36 40 37 - to = tcf_get_base_ptr(skb, tm->to_layer) - skb->data; 41 + ptr = tcf_get_base_ptr(skb, tm->to_layer); 42 + if (!ptr) 43 + return 0; 44 + to = ptr - skb->data; 38 45 to += tm->to_offset; 39 46 40 47 return skb_find_text(skb, from, to, tm->config) != UINT_MAX;
+88 -55
net/xdp/xsk.c
··· 36 36 #define TX_BATCH_SIZE 32 37 37 #define MAX_PER_SOCKET_BUDGET 32 38 38 39 - struct xsk_addr_node { 40 - u64 addr; 41 - struct list_head addr_node; 42 - }; 43 - 44 - struct xsk_addr_head { 39 + struct xsk_addrs { 45 40 u32 num_descs; 46 - struct list_head addrs_list; 41 + u64 addrs[MAX_SKB_FRAGS + 1]; 47 42 }; 48 43 49 44 static struct kmem_cache *xsk_tx_generic_cache; 50 - 51 - #define XSKCB(skb) ((struct xsk_addr_head *)((skb)->cb)) 52 45 53 46 void xsk_set_rx_need_wakeup(struct xsk_buff_pool *pool) 54 47 { ··· 550 557 return ret; 551 558 } 552 559 560 + static bool xsk_skb_destructor_is_addr(struct sk_buff *skb) 561 + { 562 + return (uintptr_t)skb_shinfo(skb)->destructor_arg & 0x1UL; 563 + } 564 + 565 + static u64 xsk_skb_destructor_get_addr(struct sk_buff *skb) 566 + { 567 + return (u64)((uintptr_t)skb_shinfo(skb)->destructor_arg & ~0x1UL); 568 + } 569 + 570 + static void xsk_skb_destructor_set_addr(struct sk_buff *skb, u64 addr) 571 + { 572 + skb_shinfo(skb)->destructor_arg = (void *)((uintptr_t)addr | 0x1UL); 573 + } 574 + 575 + static void xsk_inc_num_desc(struct sk_buff *skb) 576 + { 577 + struct xsk_addrs *xsk_addr; 578 + 579 + if (!xsk_skb_destructor_is_addr(skb)) { 580 + xsk_addr = (struct xsk_addrs *)skb_shinfo(skb)->destructor_arg; 581 + xsk_addr->num_descs++; 582 + } 583 + } 584 + 585 + static u32 xsk_get_num_desc(struct sk_buff *skb) 586 + { 587 + struct xsk_addrs *xsk_addr; 588 + 589 + if (xsk_skb_destructor_is_addr(skb)) 590 + return 1; 591 + 592 + xsk_addr = (struct xsk_addrs *)skb_shinfo(skb)->destructor_arg; 593 + 594 + return xsk_addr->num_descs; 595 + } 596 + 553 597 static void xsk_cq_submit_addr_locked(struct xsk_buff_pool *pool, 554 598 struct sk_buff *skb) 555 599 { 556 - struct xsk_addr_node *pos, *tmp; 600 + u32 num_descs = xsk_get_num_desc(skb); 601 + struct xsk_addrs *xsk_addr; 557 602 u32 descs_processed = 0; 558 603 unsigned long flags; 559 - u32 idx; 604 + u32 idx, i; 560 605 561 606 spin_lock_irqsave(&pool->cq_prod_lock, flags); 562 607 idx = xskq_get_prod(pool->cq); 563 608 564 - xskq_prod_write_addr(pool->cq, idx, 565 - (u64)(uintptr_t)skb_shinfo(skb)->destructor_arg); 566 - descs_processed++; 609 + if (unlikely(num_descs > 1)) { 610 + xsk_addr = (struct xsk_addrs *)skb_shinfo(skb)->destructor_arg; 567 611 568 - if (unlikely(XSKCB(skb)->num_descs > 1)) { 569 - list_for_each_entry_safe(pos, tmp, &XSKCB(skb)->addrs_list, addr_node) { 612 + for (i = 0; i < num_descs; i++) { 570 613 xskq_prod_write_addr(pool->cq, idx + descs_processed, 571 - pos->addr); 614 + xsk_addr->addrs[i]); 572 615 descs_processed++; 573 - list_del(&pos->addr_node); 574 - kmem_cache_free(xsk_tx_generic_cache, pos); 575 616 } 617 + kmem_cache_free(xsk_tx_generic_cache, xsk_addr); 618 + } else { 619 + xskq_prod_write_addr(pool->cq, idx, 620 + xsk_skb_destructor_get_addr(skb)); 621 + descs_processed++; 576 622 } 577 623 xskq_prod_submit_n(pool->cq, descs_processed); 578 624 spin_unlock_irqrestore(&pool->cq_prod_lock, flags); ··· 622 590 spin_lock(&pool->cq_cached_prod_lock); 623 591 xskq_prod_cancel_n(pool->cq, n); 624 592 spin_unlock(&pool->cq_cached_prod_lock); 625 - } 626 - 627 - static void xsk_inc_num_desc(struct sk_buff *skb) 628 - { 629 - XSKCB(skb)->num_descs++; 630 - } 631 - 632 - static u32 xsk_get_num_desc(struct sk_buff *skb) 633 - { 634 - return XSKCB(skb)->num_descs; 635 593 } 636 594 637 595 INDIRECT_CALLABLE_SCOPE ··· 641 619 static void xsk_skb_init_misc(struct sk_buff *skb, struct xdp_sock *xs, 642 620 u64 addr) 643 621 { 644 - BUILD_BUG_ON(sizeof(struct xsk_addr_head) > sizeof(skb->cb)); 645 - INIT_LIST_HEAD(&XSKCB(skb)->addrs_list); 646 622 skb->dev = xs->dev; 647 623 skb->priority = READ_ONCE(xs->sk.sk_priority); 648 624 skb->mark = READ_ONCE(xs->sk.sk_mark); 649 - XSKCB(skb)->num_descs = 0; 650 625 skb->destructor = xsk_destruct_skb; 651 - skb_shinfo(skb)->destructor_arg = (void *)(uintptr_t)addr; 626 + xsk_skb_destructor_set_addr(skb, addr); 652 627 } 653 628 654 629 static void xsk_consume_skb(struct sk_buff *skb) 655 630 { 656 631 struct xdp_sock *xs = xdp_sk(skb->sk); 657 632 u32 num_descs = xsk_get_num_desc(skb); 658 - struct xsk_addr_node *pos, *tmp; 633 + struct xsk_addrs *xsk_addr; 659 634 660 635 if (unlikely(num_descs > 1)) { 661 - list_for_each_entry_safe(pos, tmp, &XSKCB(skb)->addrs_list, addr_node) { 662 - list_del(&pos->addr_node); 663 - kmem_cache_free(xsk_tx_generic_cache, pos); 664 - } 636 + xsk_addr = (struct xsk_addrs *)skb_shinfo(skb)->destructor_arg; 637 + kmem_cache_free(xsk_tx_generic_cache, xsk_addr); 665 638 } 666 639 667 640 skb->destructor = sock_wfree; ··· 716 699 { 717 700 struct xsk_buff_pool *pool = xs->pool; 718 701 u32 hr, len, ts, offset, copy, copied; 719 - struct xsk_addr_node *xsk_addr; 720 702 struct sk_buff *skb = xs->skb; 721 703 struct page *page; 722 704 void *buffer; ··· 741 725 return ERR_PTR(err); 742 726 } 743 727 } else { 744 - xsk_addr = kmem_cache_zalloc(xsk_tx_generic_cache, GFP_KERNEL); 745 - if (!xsk_addr) 746 - return ERR_PTR(-ENOMEM); 728 + struct xsk_addrs *xsk_addr; 729 + 730 + if (xsk_skb_destructor_is_addr(skb)) { 731 + xsk_addr = kmem_cache_zalloc(xsk_tx_generic_cache, 732 + GFP_KERNEL); 733 + if (!xsk_addr) 734 + return ERR_PTR(-ENOMEM); 735 + 736 + xsk_addr->num_descs = 1; 737 + xsk_addr->addrs[0] = xsk_skb_destructor_get_addr(skb); 738 + skb_shinfo(skb)->destructor_arg = (void *)xsk_addr; 739 + } else { 740 + xsk_addr = (struct xsk_addrs *)skb_shinfo(skb)->destructor_arg; 741 + } 747 742 748 743 /* in case of -EOVERFLOW that could happen below, 749 744 * xsk_consume_skb() will release this node as whole skb 750 745 * would be dropped, which implies freeing all list elements 751 746 */ 752 - xsk_addr->addr = desc->addr; 753 - list_add_tail(&xsk_addr->addr_node, &XSKCB(skb)->addrs_list); 747 + xsk_addr->addrs[xsk_addr->num_descs] = desc->addr; 754 748 } 755 749 756 750 len = desc->len; ··· 837 811 } 838 812 } else { 839 813 int nr_frags = skb_shinfo(skb)->nr_frags; 840 - struct xsk_addr_node *xsk_addr; 814 + struct xsk_addrs *xsk_addr; 841 815 struct page *page; 842 816 u8 *vaddr; 817 + 818 + if (xsk_skb_destructor_is_addr(skb)) { 819 + xsk_addr = kmem_cache_zalloc(xsk_tx_generic_cache, 820 + GFP_KERNEL); 821 + if (!xsk_addr) { 822 + err = -ENOMEM; 823 + goto free_err; 824 + } 825 + 826 + xsk_addr->num_descs = 1; 827 + xsk_addr->addrs[0] = xsk_skb_destructor_get_addr(skb); 828 + skb_shinfo(skb)->destructor_arg = (void *)xsk_addr; 829 + } else { 830 + xsk_addr = (struct xsk_addrs *)skb_shinfo(skb)->destructor_arg; 831 + } 843 832 844 833 if (unlikely(nr_frags == (MAX_SKB_FRAGS - 1) && xp_mb_desc(desc))) { 845 834 err = -EOVERFLOW; ··· 867 826 goto free_err; 868 827 } 869 828 870 - xsk_addr = kmem_cache_zalloc(xsk_tx_generic_cache, GFP_KERNEL); 871 - if (!xsk_addr) { 872 - __free_page(page); 873 - err = -ENOMEM; 874 - goto free_err; 875 - } 876 - 877 829 vaddr = kmap_local_page(page); 878 830 memcpy(vaddr, buffer, len); 879 831 kunmap_local(vaddr); ··· 874 840 skb_add_rx_frag(skb, nr_frags, page, 0, len, PAGE_SIZE); 875 841 refcount_add(PAGE_SIZE, &xs->sk.sk_wmem_alloc); 876 842 877 - xsk_addr->addr = desc->addr; 878 - list_add_tail(&xsk_addr->addr_node, &XSKCB(skb)->addrs_list); 843 + xsk_addr->addrs[xsk_addr->num_descs] = desc->addr; 879 844 } 880 845 } 881 846 ··· 1935 1902 goto out_pernet; 1936 1903 1937 1904 xsk_tx_generic_cache = kmem_cache_create("xsk_generic_xmit_cache", 1938 - sizeof(struct xsk_addr_node), 1905 + sizeof(struct xsk_addrs), 1939 1906 0, SLAB_HWCACHE_ALIGN, NULL); 1940 1907 if (!xsk_tx_generic_cache) { 1941 1908 err = -ENOMEM;
+6
samples/vfs/test-statx.c
··· 19 19 #include <time.h> 20 20 #include <sys/syscall.h> 21 21 #include <sys/types.h> 22 + 23 + // Work around glibc header silliness 24 + #undef AT_RENAME_NOREPLACE 25 + #undef AT_RENAME_EXCHANGE 26 + #undef AT_RENAME_WHITEOUT 27 + 22 28 #include <linux/stat.h> 23 29 #include <linux/fcntl.h> 24 30 #define statx foo
+6
samples/watch_queue/watch_test.c
··· 16 16 #include <errno.h> 17 17 #include <sys/ioctl.h> 18 18 #include <limits.h> 19 + 20 + // Work around glibc header silliness 21 + #undef AT_RENAME_NOREPLACE 22 + #undef AT_RENAME_EXCHANGE 23 + #undef AT_RENAME_WHITEOUT 24 + 19 25 #include <linux/watch_queue.h> 20 26 #include <linux/unistd.h> 21 27 #include <linux/keyctl.h>
+128 -123
security/selinux/hooks.c
··· 210 210 */ 211 211 static void cred_init_security(void) 212 212 { 213 - struct task_security_struct *tsec; 213 + struct cred_security_struct *crsec; 214 214 215 215 /* NOTE: the lsm framework zeros out the buffer on allocation */ 216 216 217 - tsec = selinux_cred(unrcu_pointer(current->real_cred)); 218 - tsec->osid = tsec->sid = tsec->avdcache.sid = SECINITSID_KERNEL; 217 + crsec = selinux_cred(unrcu_pointer(current->real_cred)); 218 + crsec->osid = crsec->sid = SECINITSID_KERNEL; 219 219 } 220 220 221 221 /* ··· 223 223 */ 224 224 static inline u32 cred_sid(const struct cred *cred) 225 225 { 226 - const struct task_security_struct *tsec; 226 + const struct cred_security_struct *crsec; 227 227 228 - tsec = selinux_cred(cred); 229 - return tsec->sid; 228 + crsec = selinux_cred(cred); 229 + return crsec->sid; 230 230 } 231 231 232 232 static void __ad_net_init(struct common_audit_data *ad, ··· 437 437 struct superblock_security_struct *sbsec, 438 438 const struct cred *cred) 439 439 { 440 - const struct task_security_struct *tsec = selinux_cred(cred); 440 + const struct cred_security_struct *crsec = selinux_cred(cred); 441 441 int rc; 442 442 443 - rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, 443 + rc = avc_has_perm(crsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, 444 444 FILESYSTEM__RELABELFROM, NULL); 445 445 if (rc) 446 446 return rc; 447 447 448 - rc = avc_has_perm(tsec->sid, sid, SECCLASS_FILESYSTEM, 448 + rc = avc_has_perm(crsec->sid, sid, SECCLASS_FILESYSTEM, 449 449 FILESYSTEM__RELABELTO, NULL); 450 450 return rc; 451 451 } ··· 454 454 struct superblock_security_struct *sbsec, 455 455 const struct cred *cred) 456 456 { 457 - const struct task_security_struct *tsec = selinux_cred(cred); 457 + const struct cred_security_struct *crsec = selinux_cred(cred); 458 458 int rc; 459 - rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, 459 + rc = avc_has_perm(crsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, 460 460 FILESYSTEM__RELABELFROM, NULL); 461 461 if (rc) 462 462 return rc; ··· 1788 1788 * Determine the label for an inode that might be unioned. 1789 1789 */ 1790 1790 static int 1791 - selinux_determine_inode_label(const struct task_security_struct *tsec, 1791 + selinux_determine_inode_label(const struct cred_security_struct *crsec, 1792 1792 struct inode *dir, 1793 1793 const struct qstr *name, u16 tclass, 1794 1794 u32 *_new_isid) ··· 1800 1800 (sbsec->behavior == SECURITY_FS_USE_MNTPOINT)) { 1801 1801 *_new_isid = sbsec->mntpoint_sid; 1802 1802 } else if ((sbsec->flags & SBLABEL_MNT) && 1803 - tsec->create_sid) { 1804 - *_new_isid = tsec->create_sid; 1803 + crsec->create_sid) { 1804 + *_new_isid = crsec->create_sid; 1805 1805 } else { 1806 1806 const struct inode_security_struct *dsec = inode_security(dir); 1807 - return security_transition_sid(tsec->sid, 1807 + return security_transition_sid(crsec->sid, 1808 1808 dsec->sid, tclass, 1809 1809 name, _new_isid); 1810 1810 } ··· 1817 1817 struct dentry *dentry, 1818 1818 u16 tclass) 1819 1819 { 1820 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 1820 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 1821 1821 struct inode_security_struct *dsec; 1822 1822 struct superblock_security_struct *sbsec; 1823 1823 u32 sid, newsid; ··· 1827 1827 dsec = inode_security(dir); 1828 1828 sbsec = selinux_superblock(dir->i_sb); 1829 1829 1830 - sid = tsec->sid; 1830 + sid = crsec->sid; 1831 1831 1832 1832 ad.type = LSM_AUDIT_DATA_DENTRY; 1833 1833 ad.u.dentry = dentry; ··· 1838 1838 if (rc) 1839 1839 return rc; 1840 1840 1841 - rc = selinux_determine_inode_label(tsec, dir, &dentry->d_name, tclass, 1841 + rc = selinux_determine_inode_label(crsec, dir, &dentry->d_name, tclass, 1842 1842 &newsid); 1843 1843 if (rc) 1844 1844 return rc; ··· 2251 2251 } 2252 2252 2253 2253 static int check_nnp_nosuid(const struct linux_binprm *bprm, 2254 - const struct task_security_struct *old_tsec, 2255 - const struct task_security_struct *new_tsec) 2254 + const struct cred_security_struct *old_crsec, 2255 + const struct cred_security_struct *new_crsec) 2256 2256 { 2257 2257 int nnp = (bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS); 2258 2258 int nosuid = !mnt_may_suid(bprm->file->f_path.mnt); ··· 2262 2262 if (!nnp && !nosuid) 2263 2263 return 0; /* neither NNP nor nosuid */ 2264 2264 2265 - if (new_tsec->sid == old_tsec->sid) 2265 + if (new_crsec->sid == old_crsec->sid) 2266 2266 return 0; /* No change in credentials */ 2267 2267 2268 2268 /* ··· 2277 2277 av |= PROCESS2__NNP_TRANSITION; 2278 2278 if (nosuid) 2279 2279 av |= PROCESS2__NOSUID_TRANSITION; 2280 - rc = avc_has_perm(old_tsec->sid, new_tsec->sid, 2280 + rc = avc_has_perm(old_crsec->sid, new_crsec->sid, 2281 2281 SECCLASS_PROCESS2, av, NULL); 2282 2282 if (!rc) 2283 2283 return 0; ··· 2288 2288 * i.e. SIDs that are guaranteed to only be allowed a subset 2289 2289 * of the permissions of the current SID. 2290 2290 */ 2291 - rc = security_bounded_transition(old_tsec->sid, 2292 - new_tsec->sid); 2291 + rc = security_bounded_transition(old_crsec->sid, 2292 + new_crsec->sid); 2293 2293 if (!rc) 2294 2294 return 0; 2295 2295 ··· 2305 2305 2306 2306 static int selinux_bprm_creds_for_exec(struct linux_binprm *bprm) 2307 2307 { 2308 - const struct task_security_struct *old_tsec; 2309 - struct task_security_struct *new_tsec; 2308 + const struct cred_security_struct *old_crsec; 2309 + struct cred_security_struct *new_crsec; 2310 2310 struct inode_security_struct *isec; 2311 2311 struct common_audit_data ad; 2312 2312 struct inode *inode = file_inode(bprm->file); ··· 2315 2315 /* SELinux context only depends on initial program or script and not 2316 2316 * the script interpreter */ 2317 2317 2318 - old_tsec = selinux_cred(current_cred()); 2319 - new_tsec = selinux_cred(bprm->cred); 2318 + old_crsec = selinux_cred(current_cred()); 2319 + new_crsec = selinux_cred(bprm->cred); 2320 2320 isec = inode_security(inode); 2321 2321 2322 2322 /* Default to the current task SID. */ 2323 - new_tsec->sid = old_tsec->sid; 2324 - new_tsec->osid = old_tsec->sid; 2323 + new_crsec->sid = old_crsec->sid; 2324 + new_crsec->osid = old_crsec->sid; 2325 2325 2326 2326 /* Reset fs, key, and sock SIDs on execve. */ 2327 - new_tsec->create_sid = 0; 2328 - new_tsec->keycreate_sid = 0; 2329 - new_tsec->sockcreate_sid = 0; 2327 + new_crsec->create_sid = 0; 2328 + new_crsec->keycreate_sid = 0; 2329 + new_crsec->sockcreate_sid = 0; 2330 2330 2331 2331 /* 2332 2332 * Before policy is loaded, label any task outside kernel space ··· 2335 2335 * (if the policy chooses to set SECINITSID_INIT != SECINITSID_KERNEL). 2336 2336 */ 2337 2337 if (!selinux_initialized()) { 2338 - new_tsec->sid = SECINITSID_INIT; 2338 + new_crsec->sid = SECINITSID_INIT; 2339 2339 /* also clear the exec_sid just in case */ 2340 - new_tsec->exec_sid = 0; 2340 + new_crsec->exec_sid = 0; 2341 2341 return 0; 2342 2342 } 2343 2343 2344 - if (old_tsec->exec_sid) { 2345 - new_tsec->sid = old_tsec->exec_sid; 2344 + if (old_crsec->exec_sid) { 2345 + new_crsec->sid = old_crsec->exec_sid; 2346 2346 /* Reset exec SID on execve. */ 2347 - new_tsec->exec_sid = 0; 2347 + new_crsec->exec_sid = 0; 2348 2348 2349 2349 /* Fail on NNP or nosuid if not an allowed transition. */ 2350 - rc = check_nnp_nosuid(bprm, old_tsec, new_tsec); 2350 + rc = check_nnp_nosuid(bprm, old_crsec, new_crsec); 2351 2351 if (rc) 2352 2352 return rc; 2353 2353 } else { 2354 2354 /* Check for a default transition on this program. */ 2355 - rc = security_transition_sid(old_tsec->sid, 2355 + rc = security_transition_sid(old_crsec->sid, 2356 2356 isec->sid, SECCLASS_PROCESS, NULL, 2357 - &new_tsec->sid); 2357 + &new_crsec->sid); 2358 2358 if (rc) 2359 2359 return rc; 2360 2360 ··· 2362 2362 * Fallback to old SID on NNP or nosuid if not an allowed 2363 2363 * transition. 2364 2364 */ 2365 - rc = check_nnp_nosuid(bprm, old_tsec, new_tsec); 2365 + rc = check_nnp_nosuid(bprm, old_crsec, new_crsec); 2366 2366 if (rc) 2367 - new_tsec->sid = old_tsec->sid; 2367 + new_crsec->sid = old_crsec->sid; 2368 2368 } 2369 2369 2370 2370 ad.type = LSM_AUDIT_DATA_FILE; 2371 2371 ad.u.file = bprm->file; 2372 2372 2373 - if (new_tsec->sid == old_tsec->sid) { 2374 - rc = avc_has_perm(old_tsec->sid, isec->sid, 2373 + if (new_crsec->sid == old_crsec->sid) { 2374 + rc = avc_has_perm(old_crsec->sid, isec->sid, 2375 2375 SECCLASS_FILE, FILE__EXECUTE_NO_TRANS, &ad); 2376 2376 if (rc) 2377 2377 return rc; 2378 2378 } else { 2379 2379 /* Check permissions for the transition. */ 2380 - rc = avc_has_perm(old_tsec->sid, new_tsec->sid, 2380 + rc = avc_has_perm(old_crsec->sid, new_crsec->sid, 2381 2381 SECCLASS_PROCESS, PROCESS__TRANSITION, &ad); 2382 2382 if (rc) 2383 2383 return rc; 2384 2384 2385 - rc = avc_has_perm(new_tsec->sid, isec->sid, 2385 + rc = avc_has_perm(new_crsec->sid, isec->sid, 2386 2386 SECCLASS_FILE, FILE__ENTRYPOINT, &ad); 2387 2387 if (rc) 2388 2388 return rc; 2389 2389 2390 2390 /* Check for shared state */ 2391 2391 if (bprm->unsafe & LSM_UNSAFE_SHARE) { 2392 - rc = avc_has_perm(old_tsec->sid, new_tsec->sid, 2392 + rc = avc_has_perm(old_crsec->sid, new_crsec->sid, 2393 2393 SECCLASS_PROCESS, PROCESS__SHARE, 2394 2394 NULL); 2395 2395 if (rc) ··· 2401 2401 if (bprm->unsafe & LSM_UNSAFE_PTRACE) { 2402 2402 u32 ptsid = ptrace_parent_sid(); 2403 2403 if (ptsid != 0) { 2404 - rc = avc_has_perm(ptsid, new_tsec->sid, 2404 + rc = avc_has_perm(ptsid, new_crsec->sid, 2405 2405 SECCLASS_PROCESS, 2406 2406 PROCESS__PTRACE, NULL); 2407 2407 if (rc) ··· 2415 2415 /* Enable secure mode for SIDs transitions unless 2416 2416 the noatsecure permission is granted between 2417 2417 the two SIDs, i.e. ahp returns 0. */ 2418 - rc = avc_has_perm(old_tsec->sid, new_tsec->sid, 2418 + rc = avc_has_perm(old_crsec->sid, new_crsec->sid, 2419 2419 SECCLASS_PROCESS, PROCESS__NOATSECURE, 2420 2420 NULL); 2421 2421 bprm->secureexec |= !!rc; ··· 2483 2483 */ 2484 2484 static void selinux_bprm_committing_creds(const struct linux_binprm *bprm) 2485 2485 { 2486 - struct task_security_struct *new_tsec; 2486 + struct cred_security_struct *new_crsec; 2487 2487 struct rlimit *rlim, *initrlim; 2488 2488 int rc, i; 2489 2489 2490 - new_tsec = selinux_cred(bprm->cred); 2491 - if (new_tsec->sid == new_tsec->osid) 2490 + new_crsec = selinux_cred(bprm->cred); 2491 + if (new_crsec->sid == new_crsec->osid) 2492 2492 return; 2493 2493 2494 2494 /* Close files for which the new task SID is not authorized. */ ··· 2507 2507 * higher than the default soft limit for cases where the default is 2508 2508 * lower than the hard limit, e.g. RLIMIT_CORE or RLIMIT_STACK. 2509 2509 */ 2510 - rc = avc_has_perm(new_tsec->osid, new_tsec->sid, SECCLASS_PROCESS, 2510 + rc = avc_has_perm(new_crsec->osid, new_crsec->sid, SECCLASS_PROCESS, 2511 2511 PROCESS__RLIMITINH, NULL); 2512 2512 if (rc) { 2513 2513 /* protect against do_prlimit() */ ··· 2529 2529 */ 2530 2530 static void selinux_bprm_committed_creds(const struct linux_binprm *bprm) 2531 2531 { 2532 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 2532 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 2533 2533 u32 osid, sid; 2534 2534 int rc; 2535 2535 2536 - osid = tsec->osid; 2537 - sid = tsec->sid; 2536 + osid = crsec->osid; 2537 + sid = crsec->sid; 2538 2538 2539 2539 if (sid == osid) 2540 2540 return; ··· 2911 2911 { 2912 2912 u32 newsid; 2913 2913 int rc; 2914 - struct task_security_struct *tsec; 2914 + struct cred_security_struct *crsec; 2915 2915 2916 2916 rc = selinux_determine_inode_label(selinux_cred(old), 2917 2917 d_inode(dentry->d_parent), name, ··· 2920 2920 if (rc) 2921 2921 return rc; 2922 2922 2923 - tsec = selinux_cred(new); 2924 - tsec->create_sid = newsid; 2923 + crsec = selinux_cred(new); 2924 + crsec->create_sid = newsid; 2925 2925 return 0; 2926 2926 } 2927 2927 ··· 2929 2929 const struct qstr *qstr, 2930 2930 struct xattr *xattrs, int *xattr_count) 2931 2931 { 2932 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 2932 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 2933 2933 struct superblock_security_struct *sbsec; 2934 2934 struct xattr *xattr = lsm_get_xattr_slot(xattrs, xattr_count); 2935 2935 u32 newsid, clen; ··· 2939 2939 2940 2940 sbsec = selinux_superblock(dir->i_sb); 2941 2941 2942 - newsid = tsec->create_sid; 2942 + newsid = crsec->create_sid; 2943 2943 newsclass = inode_mode_to_security_class(inode->i_mode); 2944 - rc = selinux_determine_inode_label(tsec, dir, qstr, newsclass, &newsid); 2944 + rc = selinux_determine_inode_label(crsec, dir, qstr, newsclass, &newsid); 2945 2945 if (rc) 2946 2946 return rc; 2947 2947 ··· 3113 3113 static inline void task_avdcache_reset(struct task_security_struct *tsec) 3114 3114 { 3115 3115 memset(&tsec->avdcache.dir, 0, sizeof(tsec->avdcache.dir)); 3116 - tsec->avdcache.sid = tsec->sid; 3116 + tsec->avdcache.sid = current_sid(); 3117 3117 tsec->avdcache.seqno = avc_policy_seqno(); 3118 3118 tsec->avdcache.dir_spot = TSEC_AVDC_DIR_SIZE - 1; 3119 3119 } ··· 3137 3137 if (isec->sclass != SECCLASS_DIR) 3138 3138 return -ENOENT; 3139 3139 3140 - if (unlikely(tsec->sid != tsec->avdcache.sid || 3140 + if (unlikely(current_sid() != tsec->avdcache.sid || 3141 3141 tsec->avdcache.seqno != avc_policy_seqno())) { 3142 3142 task_avdcache_reset(tsec); 3143 3143 return -ENOENT; ··· 3201 3201 { 3202 3202 int mask; 3203 3203 u32 perms; 3204 + u32 sid = current_sid(); 3204 3205 struct task_security_struct *tsec; 3205 3206 struct inode_security_struct *isec; 3206 3207 struct avdc_entry *avdc; ··· 3214 3213 if (!mask) 3215 3214 return 0; 3216 3215 3217 - tsec = selinux_cred(current_cred()); 3218 - if (task_avdcache_permnoaudit(tsec)) 3216 + tsec = selinux_task(current); 3217 + if (task_avdcache_permnoaudit(tsec, sid)) 3219 3218 return 0; 3220 3219 3221 3220 isec = inode_security_rcu(inode, requested & MAY_NOT_BLOCK); ··· 3235 3234 struct av_decision avd; 3236 3235 3237 3236 /* Cache miss. */ 3238 - rc = avc_has_perm_noaudit(tsec->sid, isec->sid, isec->sclass, 3237 + rc = avc_has_perm_noaudit(sid, isec->sid, isec->sclass, 3239 3238 perms, 0, &avd); 3240 3239 audited = avc_audit_required(perms, &avd, rc, 3241 3240 (requested & MAY_ACCESS) ? FILE__AUDIT_ACCESS : 0, ··· 3286 3285 { 3287 3286 struct task_security_struct *tsec; 3288 3287 3289 - tsec = selinux_cred(current_cred()); 3288 + tsec = selinux_task(current); 3290 3289 3291 - if (task_avdcache_permnoaudit(tsec)) 3290 + if (task_avdcache_permnoaudit(tsec, current_sid())) 3292 3291 return 0; 3293 3292 3294 3293 return path_has_perm(current_cred(), path, FILE__GETATTR); ··· 3660 3659 static int selinux_inode_copy_up(struct dentry *src, struct cred **new) 3661 3660 { 3662 3661 struct lsm_prop prop; 3663 - struct task_security_struct *tsec; 3662 + struct cred_security_struct *crsec; 3664 3663 struct cred *new_creds = *new; 3665 3664 3666 3665 if (new_creds == NULL) { ··· 3669 3668 return -ENOMEM; 3670 3669 } 3671 3670 3672 - tsec = selinux_cred(new_creds); 3671 + crsec = selinux_cred(new_creds); 3673 3672 /* Get label from overlay inode and set it in create_sid */ 3674 3673 selinux_inode_getlsmprop(d_inode(src), &prop); 3675 - tsec->create_sid = prop.selinux.secid; 3674 + crsec->create_sid = prop.selinux.secid; 3676 3675 *new = new_creds; 3677 3676 return 0; 3678 3677 } ··· 3698 3697 static int selinux_kernfs_init_security(struct kernfs_node *kn_dir, 3699 3698 struct kernfs_node *kn) 3700 3699 { 3701 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 3700 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 3702 3701 u32 parent_sid, newsid, clen; 3703 3702 int rc; 3704 3703 char *context; ··· 3726 3725 if (rc) 3727 3726 return rc; 3728 3727 3729 - if (tsec->create_sid) { 3730 - newsid = tsec->create_sid; 3728 + if (crsec->create_sid) { 3729 + newsid = crsec->create_sid; 3731 3730 } else { 3732 3731 u16 secclass = inode_mode_to_security_class(kn->mode); 3733 3732 const char *kn_name; ··· 3738 3737 q.name = kn_name; 3739 3738 q.hash_len = hashlen_string(kn_dir, kn_name); 3740 3739 3741 - rc = security_transition_sid(tsec->sid, 3740 + rc = security_transition_sid(crsec->sid, 3742 3741 parent_sid, secclass, &q, 3743 3742 &newsid); 3744 3743 if (rc) ··· 4152 4151 u64 clone_flags) 4153 4152 { 4154 4153 u32 sid = current_sid(); 4154 + struct task_security_struct *old_tsec = selinux_task(current); 4155 + struct task_security_struct *new_tsec = selinux_task(task); 4155 4156 4157 + *new_tsec = *old_tsec; 4156 4158 return avc_has_perm(sid, sid, SECCLASS_PROCESS, PROCESS__FORK, NULL); 4157 4159 } 4158 4160 ··· 4165 4161 static int selinux_cred_prepare(struct cred *new, const struct cred *old, 4166 4162 gfp_t gfp) 4167 4163 { 4168 - const struct task_security_struct *old_tsec = selinux_cred(old); 4169 - struct task_security_struct *tsec = selinux_cred(new); 4164 + const struct cred_security_struct *old_crsec = selinux_cred(old); 4165 + struct cred_security_struct *crsec = selinux_cred(new); 4170 4166 4171 - *tsec = *old_tsec; 4167 + *crsec = *old_crsec; 4172 4168 return 0; 4173 4169 } 4174 4170 ··· 4177 4173 */ 4178 4174 static void selinux_cred_transfer(struct cred *new, const struct cred *old) 4179 4175 { 4180 - const struct task_security_struct *old_tsec = selinux_cred(old); 4181 - struct task_security_struct *tsec = selinux_cred(new); 4176 + const struct cred_security_struct *old_crsec = selinux_cred(old); 4177 + struct cred_security_struct *crsec = selinux_cred(new); 4182 4178 4183 - *tsec = *old_tsec; 4179 + *crsec = *old_crsec; 4184 4180 } 4185 4181 4186 4182 static void selinux_cred_getsecid(const struct cred *c, u32 *secid) ··· 4199 4195 */ 4200 4196 static int selinux_kernel_act_as(struct cred *new, u32 secid) 4201 4197 { 4202 - struct task_security_struct *tsec = selinux_cred(new); 4198 + struct cred_security_struct *crsec = selinux_cred(new); 4203 4199 u32 sid = current_sid(); 4204 4200 int ret; 4205 4201 ··· 4208 4204 KERNEL_SERVICE__USE_AS_OVERRIDE, 4209 4205 NULL); 4210 4206 if (ret == 0) { 4211 - tsec->sid = secid; 4212 - tsec->create_sid = 0; 4213 - tsec->keycreate_sid = 0; 4214 - tsec->sockcreate_sid = 0; 4207 + crsec->sid = secid; 4208 + crsec->create_sid = 0; 4209 + crsec->keycreate_sid = 0; 4210 + crsec->sockcreate_sid = 0; 4215 4211 } 4216 4212 return ret; 4217 4213 } ··· 4223 4219 static int selinux_kernel_create_files_as(struct cred *new, struct inode *inode) 4224 4220 { 4225 4221 struct inode_security_struct *isec = inode_security(inode); 4226 - struct task_security_struct *tsec = selinux_cred(new); 4222 + struct cred_security_struct *crsec = selinux_cred(new); 4227 4223 u32 sid = current_sid(); 4228 4224 int ret; 4229 4225 ··· 4233 4229 NULL); 4234 4230 4235 4231 if (ret == 0) 4236 - tsec->create_sid = isec->sid; 4232 + crsec->create_sid = isec->sid; 4237 4233 return ret; 4238 4234 } 4239 4235 ··· 4748 4744 4749 4745 /* socket security operations */ 4750 4746 4751 - static int socket_sockcreate_sid(const struct task_security_struct *tsec, 4747 + static int socket_sockcreate_sid(const struct cred_security_struct *crsec, 4752 4748 u16 secclass, u32 *socksid) 4753 4749 { 4754 - if (tsec->sockcreate_sid > SECSID_NULL) { 4755 - *socksid = tsec->sockcreate_sid; 4750 + if (crsec->sockcreate_sid > SECSID_NULL) { 4751 + *socksid = crsec->sockcreate_sid; 4756 4752 return 0; 4757 4753 } 4758 4754 4759 - return security_transition_sid(tsec->sid, tsec->sid, 4755 + return security_transition_sid(crsec->sid, crsec->sid, 4760 4756 secclass, NULL, socksid); 4761 4757 } 4762 4758 ··· 4801 4797 static int selinux_socket_create(int family, int type, 4802 4798 int protocol, int kern) 4803 4799 { 4804 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 4800 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 4805 4801 u32 newsid; 4806 4802 u16 secclass; 4807 4803 int rc; ··· 4810 4806 return 0; 4811 4807 4812 4808 secclass = socket_type_to_security_class(family, type, protocol); 4813 - rc = socket_sockcreate_sid(tsec, secclass, &newsid); 4809 + rc = socket_sockcreate_sid(crsec, secclass, &newsid); 4814 4810 if (rc) 4815 4811 return rc; 4816 4812 4817 - return avc_has_perm(tsec->sid, newsid, secclass, SOCKET__CREATE, NULL); 4813 + return avc_has_perm(crsec->sid, newsid, secclass, SOCKET__CREATE, NULL); 4818 4814 } 4819 4815 4820 4816 static int selinux_socket_post_create(struct socket *sock, int family, 4821 4817 int type, int protocol, int kern) 4822 4818 { 4823 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 4819 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 4824 4820 struct inode_security_struct *isec = inode_security_novalidate(SOCK_INODE(sock)); 4825 4821 struct sk_security_struct *sksec; 4826 4822 u16 sclass = socket_type_to_security_class(family, type, protocol); ··· 4828 4824 int err = 0; 4829 4825 4830 4826 if (!kern) { 4831 - err = socket_sockcreate_sid(tsec, sclass, &sid); 4827 + err = socket_sockcreate_sid(crsec, sclass, &sid); 4832 4828 if (err) 4833 4829 return err; 4834 4830 } ··· 6530 6526 static int selinux_lsm_getattr(unsigned int attr, struct task_struct *p, 6531 6527 char **value) 6532 6528 { 6533 - const struct task_security_struct *tsec; 6529 + const struct cred_security_struct *crsec; 6534 6530 int error; 6535 6531 u32 sid; 6536 6532 u32 len; 6537 6533 6538 6534 rcu_read_lock(); 6539 - tsec = selinux_cred(__task_cred(p)); 6535 + crsec = selinux_cred(__task_cred(p)); 6540 6536 if (p != current) { 6541 - error = avc_has_perm(current_sid(), tsec->sid, 6537 + error = avc_has_perm(current_sid(), crsec->sid, 6542 6538 SECCLASS_PROCESS, PROCESS__GETATTR, NULL); 6543 6539 if (error) 6544 6540 goto err_unlock; 6545 6541 } 6546 6542 switch (attr) { 6547 6543 case LSM_ATTR_CURRENT: 6548 - sid = tsec->sid; 6544 + sid = crsec->sid; 6549 6545 break; 6550 6546 case LSM_ATTR_PREV: 6551 - sid = tsec->osid; 6547 + sid = crsec->osid; 6552 6548 break; 6553 6549 case LSM_ATTR_EXEC: 6554 - sid = tsec->exec_sid; 6550 + sid = crsec->exec_sid; 6555 6551 break; 6556 6552 case LSM_ATTR_FSCREATE: 6557 - sid = tsec->create_sid; 6553 + sid = crsec->create_sid; 6558 6554 break; 6559 6555 case LSM_ATTR_KEYCREATE: 6560 - sid = tsec->keycreate_sid; 6556 + sid = crsec->keycreate_sid; 6561 6557 break; 6562 6558 case LSM_ATTR_SOCKCREATE: 6563 - sid = tsec->sockcreate_sid; 6559 + sid = crsec->sockcreate_sid; 6564 6560 break; 6565 6561 default: 6566 6562 error = -EOPNOTSUPP; ··· 6585 6581 6586 6582 static int selinux_lsm_setattr(u64 attr, void *value, size_t size) 6587 6583 { 6588 - struct task_security_struct *tsec; 6584 + struct cred_security_struct *crsec; 6589 6585 struct cred *new; 6590 6586 u32 mysid = current_sid(), sid = 0, ptsid; 6591 6587 int error; ··· 6671 6667 operation. See selinux_bprm_creds_for_exec for the execve 6672 6668 checks and may_create for the file creation checks. The 6673 6669 operation will then fail if the context is not permitted. */ 6674 - tsec = selinux_cred(new); 6670 + crsec = selinux_cred(new); 6675 6671 if (attr == LSM_ATTR_EXEC) { 6676 - tsec->exec_sid = sid; 6672 + crsec->exec_sid = sid; 6677 6673 } else if (attr == LSM_ATTR_FSCREATE) { 6678 - tsec->create_sid = sid; 6674 + crsec->create_sid = sid; 6679 6675 } else if (attr == LSM_ATTR_KEYCREATE) { 6680 6676 if (sid) { 6681 6677 error = avc_has_perm(mysid, sid, ··· 6683 6679 if (error) 6684 6680 goto abort_change; 6685 6681 } 6686 - tsec->keycreate_sid = sid; 6682 + crsec->keycreate_sid = sid; 6687 6683 } else if (attr == LSM_ATTR_SOCKCREATE) { 6688 - tsec->sockcreate_sid = sid; 6684 + crsec->sockcreate_sid = sid; 6689 6685 } else if (attr == LSM_ATTR_CURRENT) { 6690 6686 error = -EINVAL; 6691 6687 if (sid == 0) 6692 6688 goto abort_change; 6693 6689 6694 6690 if (!current_is_single_threaded()) { 6695 - error = security_bounded_transition(tsec->sid, sid); 6691 + error = security_bounded_transition(crsec->sid, sid); 6696 6692 if (error) 6697 6693 goto abort_change; 6698 6694 } 6699 6695 6700 6696 /* Check permissions for the transition. */ 6701 - error = avc_has_perm(tsec->sid, sid, SECCLASS_PROCESS, 6697 + error = avc_has_perm(crsec->sid, sid, SECCLASS_PROCESS, 6702 6698 PROCESS__DYNTRANSITION, NULL); 6703 6699 if (error) 6704 6700 goto abort_change; ··· 6713 6709 goto abort_change; 6714 6710 } 6715 6711 6716 - tsec->sid = sid; 6712 + crsec->sid = sid; 6717 6713 } else { 6718 6714 error = -EINVAL; 6719 6715 goto abort_change; ··· 6880 6876 static int selinux_key_alloc(struct key *k, const struct cred *cred, 6881 6877 unsigned long flags) 6882 6878 { 6883 - const struct task_security_struct *tsec; 6879 + const struct cred_security_struct *crsec; 6884 6880 struct key_security_struct *ksec = selinux_key(k); 6885 6881 6886 - tsec = selinux_cred(cred); 6887 - if (tsec->keycreate_sid) 6888 - ksec->sid = tsec->keycreate_sid; 6882 + crsec = selinux_cred(cred); 6883 + if (crsec->keycreate_sid) 6884 + ksec->sid = crsec->keycreate_sid; 6889 6885 else 6890 - ksec->sid = tsec->sid; 6886 + ksec->sid = crsec->sid; 6891 6887 6892 6888 return 0; 6893 6889 } ··· 7141 7137 #endif 7142 7138 7143 7139 struct lsm_blob_sizes selinux_blob_sizes __ro_after_init = { 7144 - .lbs_cred = sizeof(struct task_security_struct), 7140 + .lbs_cred = sizeof(struct cred_security_struct), 7141 + .lbs_task = sizeof(struct task_security_struct), 7145 7142 .lbs_file = sizeof(struct file_security_struct), 7146 7143 .lbs_inode = sizeof(struct inode_security_struct), 7147 7144 .lbs_ipc = sizeof(struct ipc_security_struct),
+16 -6
security/selinux/include/objsec.h
··· 37 37 bool permissive; /* AVC permissive flag */ 38 38 }; 39 39 40 - struct task_security_struct { 40 + struct cred_security_struct { 41 41 u32 osid; /* SID prior to last execve */ 42 42 u32 sid; /* current SID */ 43 43 u32 exec_sid; /* exec SID */ 44 44 u32 create_sid; /* fscreate SID */ 45 45 u32 keycreate_sid; /* keycreate SID */ 46 46 u32 sockcreate_sid; /* fscreate SID */ 47 + } __randomize_layout; 48 + 49 + struct task_security_struct { 47 50 #define TSEC_AVDC_DIR_SIZE (1 << 2) 48 51 struct { 49 52 u32 sid; /* current SID for cached entries */ ··· 57 54 } avdcache; 58 55 } __randomize_layout; 59 56 60 - static inline bool task_avdcache_permnoaudit(struct task_security_struct *tsec) 57 + static inline bool task_avdcache_permnoaudit(struct task_security_struct *tsec, 58 + u32 sid) 61 59 { 62 60 return (tsec->avdcache.permissive_neveraudit && 63 - tsec->sid == tsec->avdcache.sid && 61 + sid == tsec->avdcache.sid && 64 62 tsec->avdcache.seqno == avc_policy_seqno()); 65 63 } 66 64 ··· 176 172 }; 177 173 178 174 extern struct lsm_blob_sizes selinux_blob_sizes; 179 - static inline struct task_security_struct *selinux_cred(const struct cred *cred) 175 + static inline struct cred_security_struct *selinux_cred(const struct cred *cred) 180 176 { 181 177 return cred->security + selinux_blob_sizes.lbs_cred; 178 + } 179 + 180 + static inline struct task_security_struct * 181 + selinux_task(const struct task_struct *task) 182 + { 183 + return task->security + selinux_blob_sizes.lbs_task; 182 184 } 183 185 184 186 static inline struct file_security_struct *selinux_file(const struct file *file) ··· 217 207 */ 218 208 static inline u32 current_sid(void) 219 209 { 220 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 210 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 221 211 222 - return tsec->sid; 212 + return crsec->sid; 223 213 } 224 214 225 215 static inline struct superblock_security_struct *
+1
sound/hda/codecs/cirrus/cs420x.c
··· 585 585 SND_PCI_QUIRK(0x106b, 0x6c00, "MacMini 7,1", CS4208_MACMINI), 586 586 SND_PCI_QUIRK(0x106b, 0x7100, "MacBookAir 6,1", CS4208_MBA6), 587 587 SND_PCI_QUIRK(0x106b, 0x7200, "MacBookAir 6,2", CS4208_MBA6), 588 + SND_PCI_QUIRK(0x106b, 0x7800, "MacPro 6,1", CS4208_MACMINI), 588 589 SND_PCI_QUIRK(0x106b, 0x7b00, "MacBookPro 12,1", CS4208_MBP11), 589 590 {} /* terminator */ 590 591 };
+2
sound/hda/codecs/realtek/alc269.c
··· 6525 6525 SND_PCI_QUIRK(0x103c, 0x8a4f, "HP Victus 15-fa0xxx (MB 8A4F)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 6526 6526 SND_PCI_QUIRK(0x103c, 0x8a6e, "HP EDNA 360", ALC287_FIXUP_CS35L41_I2C_4), 6527 6527 SND_PCI_QUIRK(0x103c, 0x8a74, "HP ProBook 440 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 6528 + SND_PCI_QUIRK(0x103c, 0x8a75, "HP ProBook 450 G8 Notebook PC", ALC236_FIXUP_HP_GPIO_LED), 6528 6529 SND_PCI_QUIRK(0x103c, 0x8a78, "HP Dev One", ALC285_FIXUP_HP_LIMIT_INT_MIC_BOOST), 6529 6530 SND_PCI_QUIRK(0x103c, 0x8aa0, "HP ProBook 440 G9 (MB 8A9E)", ALC236_FIXUP_HP_GPIO_LED), 6530 6531 SND_PCI_QUIRK(0x103c, 0x8aa3, "HP ProBook 450 G9 (MB 8AA1)", ALC236_FIXUP_HP_GPIO_LED), ··· 6573 6572 SND_PCI_QUIRK(0x103c, 0x8bc8, "HP Victus 15-fa1xxx", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 6574 6573 SND_PCI_QUIRK(0x103c, 0x8bcd, "HP Omen 16-xd0xxx", ALC245_FIXUP_HP_MUTE_LED_V1_COEFBIT), 6575 6574 SND_PCI_QUIRK(0x103c, 0x8bd4, "HP Victus 16-s0xxx (MB 8BD4)", ALC245_FIXUP_HP_MUTE_LED_COEFBIT), 6575 + SND_PCI_QUIRK(0x103c, 0x8bd6, "HP Pavilion Aero Laptop 13z-be200", ALC287_FIXUP_HP_GPIO_LED), 6576 6576 SND_PCI_QUIRK(0x103c, 0x8bdd, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 6577 6577 SND_PCI_QUIRK(0x103c, 0x8bde, "HP Envy 17", ALC287_FIXUP_CS35L41_I2C_2), 6578 6578 SND_PCI_QUIRK(0x103c, 0x8bdf, "HP Envy 15", ALC287_FIXUP_CS35L41_I2C_2),
+4 -4
sound/pci/au88x0/au88x0.c
··· 280 280 281 281 // (5) 282 282 err = pci_read_config_word(pci, PCI_DEVICE_ID, &chip->device); 283 - if (err < 0) 284 - return err; 283 + if (err) 284 + return pcibios_err_to_errno(err); 285 285 err = pci_read_config_word(pci, PCI_VENDOR_ID, &chip->vendor); 286 - if (err < 0) 287 - return err; 286 + if (err) 287 + return pcibios_err_to_errno(err); 288 288 chip->rev = pci->revision; 289 289 #ifdef CHIP_AU8830 290 290 if ((chip->rev) != 0xfe && (chip->rev) != 0xfa) {
+1 -1
sound/usb/mixer.c
··· 921 921 { 922 922 struct uac_clock_source_descriptor *d = p1; 923 923 924 - term->type = UAC3_CLOCK_SOURCE << 16; /* virtual type */ 924 + term->type = UAC2_CLOCK_SOURCE << 16; /* virtual type */ 925 925 term->id = id; 926 926 term->name = d->iClockSource; 927 927 return 0;
+3
sound/usb/quirks.c
··· 2030 2030 case USB_ID(0x249c, 0x9326): /* M2Tech Young MkIII */ 2031 2031 case USB_ID(0x2616, 0x0106): /* PS Audio NuWave DAC */ 2032 2032 case USB_ID(0x2622, 0x0041): /* Audiolab M-DAC+ */ 2033 + case USB_ID(0x2622, 0x0061): /* LEAK Stereo 230 */ 2033 2034 case USB_ID(0x278b, 0x5100): /* Rotel RC-1590 */ 2034 2035 case USB_ID(0x27f7, 0x3002): /* W4S DAC-2v2SE */ 2035 2036 case USB_ID(0x29a2, 0x0086): /* Mutec MC3+ USB */ ··· 2428 2427 QUIRK_FLAG_CTL_MSG_DELAY | QUIRK_FLAG_IFACE_DELAY | 2429 2428 QUIRK_FLAG_DSD_RAW), 2430 2429 VENDOR_FLG(0x25ce, /* Mytek devices */ 2430 + QUIRK_FLAG_DSD_RAW), 2431 + VENDOR_FLG(0x2622, /* IAG Limited devices */ 2431 2432 QUIRK_FLAG_DSD_RAW), 2432 2433 VENDOR_FLG(0x278b, /* Rotel? */ 2433 2434 QUIRK_FLAG_DSD_RAW),
+3 -2
tools/arch/riscv/include/asm/csr.h
··· 167 167 #define VSIP_TO_HVIP_SHIFT (IRQ_VS_SOFT - IRQ_S_SOFT) 168 168 #define VSIP_VALID_MASK ((_AC(1, UL) << IRQ_S_SOFT) | \ 169 169 (_AC(1, UL) << IRQ_S_TIMER) | \ 170 - (_AC(1, UL) << IRQ_S_EXT)) 170 + (_AC(1, UL) << IRQ_S_EXT) | \ 171 + (_AC(1, UL) << IRQ_PMU_OVF)) 171 172 172 173 /* AIA CSR bits */ 173 174 #define TOPI_IID_SHIFT 16 ··· 281 280 #define CSR_HPMCOUNTER30H 0xc9e 282 281 #define CSR_HPMCOUNTER31H 0xc9f 283 282 284 - #define CSR_SSCOUNTOVF 0xda0 283 + #define CSR_SCOUNTOVF 0xda0 285 284 286 285 #define CSR_SSTATUS 0x100 287 286 #define CSR_SIE 0x104
+7 -8
tools/testing/selftests/mm/uffd-unit-tests.c
··· 1758 1758 uffd_test_ops = mem_type->mem_ops; 1759 1759 uffd_test_case_ops = test->test_case_ops; 1760 1760 1761 - if (mem_type->mem_flag & (MEM_HUGETLB_PRIVATE | MEM_HUGETLB)) 1761 + if (mem_type->mem_flag & (MEM_HUGETLB_PRIVATE | MEM_HUGETLB)) { 1762 1762 gopts.page_size = default_huge_page_size(); 1763 - else 1763 + if (gopts.page_size == 0) { 1764 + uffd_test_skip("huge page size is 0, feature missing?"); 1765 + continue; 1766 + } 1767 + } else { 1764 1768 gopts.page_size = psize(); 1769 + } 1765 1770 1766 1771 /* Ensure we have at least 2 pages */ 1767 1772 gopts.nr_pages = MAX(UFFD_TEST_MEM_SIZE, gopts.page_size * 2) ··· 1781 1776 continue; 1782 1777 1783 1778 uffd_test_start("%s on %s", test->name, mem_type->name); 1784 - if ((mem_type->mem_flag == MEM_HUGETLB || 1785 - mem_type->mem_flag == MEM_HUGETLB_PRIVATE) && 1786 - (default_huge_page_size() == 0)) { 1787 - uffd_test_skip("huge page size is 0, feature missing?"); 1788 - continue; 1789 - } 1790 1779 if (!uffd_feature_supported(test)) { 1791 1780 uffd_test_skip("feature missing"); 1792 1781 continue;