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

Configure Feed

Select the types of activity you want to include in your feed.

SDCA Jack Fixups

Merge series from Charles Keepax <ckeepax@opensource.cirrus.com>:

Some fixups to the jack handling, adding some necessary hooks to connect
things with the machine driver. I have split these out from the system
suspend chain as that has been generating a fair amount of discussion
and getting these 3 merged is far more important to get basic
functionality working smoothly. I will do a spin of the system suspend
stuff soon, if either no new comments pop up, or we reach some consensus
on how to proceed.

+3427 -1341
+1
.clang-format
··· 748 748 - 'ynl_attr_for_each_nested' 749 749 - 'ynl_attr_for_each_payload' 750 750 - 'zorro_for_each_dev' 751 + - 'zpci_bus_for_each' 751 752 752 753 IncludeBlocks: Preserve 753 754 IncludeCategories:
+1
CREDITS
··· 1987 1987 D: netfilter: raw table 1988 1988 D: netfilter: iprange match 1989 1989 D: netfilter: new logging interfaces 1990 + D: netfilter: ipset 1990 1991 D: netfilter: various other hacks 1991 1992 S: Tata 1992 1993 S: Hungary
+1 -1
Documentation/admin-guide/blockdev/zoned_loop.rst
··· 134 134 135 135 $ modprobe zloop 136 136 $ mkdir -p /var/local/zloop/0 137 - $ echo "add capacity_mb=2048,zone_size_mb=64,zone_capacity=63MB" > /dev/zloop-control 137 + $ echo "add capacity_mb=2048,zone_size_mb=64,zone_capacity_mb=63" > /dev/zloop-control 138 138 139 139 For the device created (/dev/zloop0), the zone backing files are all created 140 140 under the default base directory (/var/local/zloop)::
+96 -96
Documentation/arch/x86/boot.rst
··· 95 95 The traditional memory map for the kernel loader, used for Image or 96 96 zImage kernels, typically looks like:: 97 97 98 - | | 98 + | | 99 99 0A0000 +------------------------+ 100 - | Reserved for BIOS | Do not use. Reserved for BIOS EBDA. 100 + | Reserved for BIOS | Do not use. Reserved for BIOS EBDA. 101 101 09A000 +------------------------+ 102 - | Command line | 103 - | Stack/heap | For use by the kernel real-mode code. 102 + | Command line | 103 + | Stack/heap | For use by the kernel real-mode code. 104 104 098000 +------------------------+ 105 - | Kernel setup | The kernel real-mode code. 105 + | Kernel setup | The kernel real-mode code. 106 106 090200 +------------------------+ 107 - | Kernel boot sector | The kernel legacy boot sector. 107 + | Kernel boot sector | The kernel legacy boot sector. 108 108 090000 +------------------------+ 109 - | Protected-mode kernel | The bulk of the kernel image. 109 + | Protected-mode kernel | The bulk of the kernel image. 110 110 010000 +------------------------+ 111 - | Boot loader | <- Boot sector entry point 0000:7C00 111 + | Boot loader | <- Boot sector entry point 0000:7C00 112 112 001000 +------------------------+ 113 - | Reserved for MBR/BIOS | 113 + | Reserved for MBR/BIOS | 114 114 000800 +------------------------+ 115 - | Typically used by MBR | 115 + | Typically used by MBR | 116 116 000600 +------------------------+ 117 - | BIOS use only | 117 + | BIOS use only | 118 118 000000 +------------------------+ 119 119 120 120 When using bzImage, the protected-mode kernel was relocated to ··· 142 142 For a modern bzImage kernel with boot protocol version >= 2.02, a 143 143 memory layout like the following is suggested:: 144 144 145 - ~ ~ 146 - | Protected-mode kernel | 145 + ~ ~ 146 + | Protected-mode kernel | 147 147 100000 +------------------------+ 148 - | I/O memory hole | 148 + | I/O memory hole | 149 149 0A0000 +------------------------+ 150 - | Reserved for BIOS | Leave as much as possible unused 151 - ~ ~ 152 - | Command line | (Can also be below the X+10000 mark) 150 + | Reserved for BIOS | Leave as much as possible unused 151 + ~ ~ 152 + | Command line | (Can also be below the X+10000 mark) 153 153 X+10000 +------------------------+ 154 - | Stack/heap | For use by the kernel real-mode code. 154 + | Stack/heap | For use by the kernel real-mode code. 155 155 X+08000 +------------------------+ 156 - | Kernel setup | The kernel real-mode code. 157 - | Kernel boot sector | The kernel legacy boot sector. 156 + | Kernel setup | The kernel real-mode code. 157 + | Kernel boot sector | The kernel legacy boot sector. 158 158 X +------------------------+ 159 - | Boot loader | <- Boot sector entry point 0000:7C00 159 + | Boot loader | <- Boot sector entry point 0000:7C00 160 160 001000 +------------------------+ 161 - | Reserved for MBR/BIOS | 161 + | Reserved for MBR/BIOS | 162 162 000800 +------------------------+ 163 - | Typically used by MBR | 163 + | Typically used by MBR | 164 164 000600 +------------------------+ 165 - | BIOS use only | 165 + | BIOS use only | 166 166 000000 +------------------------+ 167 167 168 168 ... where the address X is as low as the design of the boot loader permits. ··· 433 433 434 434 Assigned boot loader IDs: 435 435 436 - == ======================================= 436 + ==== ======================================= 437 437 0x0 LILO 438 438 (0x00 reserved for pre-2.00 bootloader) 439 439 0x1 Loadlin ··· 456 456 <http://sebastian-plotz.blogspot.de> 457 457 0x12 OVMF UEFI virtualization stack 458 458 0x13 barebox 459 - == ======================================= 459 + ==== ======================================= 460 460 461 461 Please contact <hpa@zytor.com> if you need a bootloader ID value assigned. 462 462 ··· 809 809 as follow:: 810 810 811 811 struct setup_data { 812 - __u64 next; 813 - __u32 type; 814 - __u32 len; 815 - __u8 data[]; 812 + __u64 next; 813 + __u32 type; 814 + __u32 len; 815 + __u8 data[]; 816 816 } 817 - 817 + 818 818 Where, the next is a 64-bit physical pointer to the next node of 819 819 linked list, the next field of the last node is 0; the type is used 820 820 to identify the contents of data; the len is the length of data ··· 835 835 protocol 2.15:: 836 836 837 837 struct setup_indirect { 838 - __u32 type; 839 - __u32 reserved; /* Reserved, must be set to zero. */ 840 - __u64 len; 841 - __u64 addr; 838 + __u32 type; 839 + __u32 reserved; /* Reserved, must be set to zero. */ 840 + __u64 len; 841 + __u64 addr; 842 842 }; 843 843 844 844 The type member is a SETUP_INDIRECT | SETUP_* type. However, it cannot be ··· 850 850 In this case setup_data and setup_indirect will look like this:: 851 851 852 852 struct setup_data { 853 - .next = 0, /* or <addr_of_next_setup_data_struct> */ 854 - .type = SETUP_INDIRECT, 855 - .len = sizeof(setup_indirect), 856 - .data[sizeof(setup_indirect)] = (struct setup_indirect) { 857 - .type = SETUP_INDIRECT | SETUP_E820_EXT, 858 - .reserved = 0, 859 - .len = <len_of_SETUP_E820_EXT_data>, 860 - .addr = <addr_of_SETUP_E820_EXT_data>, 861 - }, 853 + .next = 0, /* or <addr_of_next_setup_data_struct> */ 854 + .type = SETUP_INDIRECT, 855 + .len = sizeof(setup_indirect), 856 + .data[sizeof(setup_indirect)] = (struct setup_indirect) { 857 + .type = SETUP_INDIRECT | SETUP_E820_EXT, 858 + .reserved = 0, 859 + .len = <len_of_SETUP_E820_EXT_data>, 860 + .addr = <addr_of_SETUP_E820_EXT_data>, 861 + }, 862 862 } 863 863 864 864 .. note:: ··· 897 897 The kernel runtime start address is determined by the following algorithm:: 898 898 899 899 if (relocatable_kernel) { 900 - if (load_address < pref_address) 901 - load_address = pref_address; 902 - runtime_start = align_up(load_address, kernel_alignment); 900 + if (load_address < pref_address) 901 + load_address = pref_address; 902 + runtime_start = align_up(load_address, kernel_alignment); 903 903 } else { 904 - runtime_start = pref_address; 904 + runtime_start = pref_address; 905 905 } 906 906 907 907 Hence the necessary memory window location and size can be estimated by ··· 975 975 be prefixed with header/magic and its size, e.g.:: 976 976 977 977 kernel_info: 978 - .ascii "LToP" /* Header, Linux top (structure). */ 979 - .long kernel_info_var_len_data - kernel_info 980 - .long kernel_info_end - kernel_info 981 - .long 0x01234567 /* Some fixed size data for the bootloaders. */ 978 + .ascii "LToP" /* Header, Linux top (structure). */ 979 + .long kernel_info_var_len_data - kernel_info 980 + .long kernel_info_end - kernel_info 981 + .long 0x01234567 /* Some fixed size data for the bootloaders. */ 982 982 kernel_info_var_len_data: 983 983 example_struct: /* Some variable size data for the bootloaders. */ 984 - .ascii "0123" /* Header/Magic. */ 985 - .long example_struct_end - example_struct 986 - .ascii "Struct" 987 - .long 0x89012345 984 + .ascii "0123" /* Header/Magic. */ 985 + .long example_struct_end - example_struct 986 + .ascii "Struct" 987 + .long 0x89012345 988 988 example_struct_end: 989 989 example_strings: /* Some variable size data for the bootloaders. */ 990 - .ascii "ABCD" /* Header/Magic. */ 991 - .long example_strings_end - example_strings 992 - .asciz "String_0" 993 - .asciz "String_1" 990 + .ascii "ABCD" /* Header/Magic. */ 991 + .long example_strings_end - example_strings 992 + .asciz "String_0" 993 + .asciz "String_1" 994 994 example_strings_end: 995 995 kernel_info_end: 996 996 ··· 1132 1132 unsigned long base_ptr; /* base address for real-mode segment */ 1133 1133 1134 1134 if (setup_sects == 0) 1135 - setup_sects = 4; 1135 + setup_sects = 4; 1136 1136 1137 1137 if (protocol >= 0x0200) { 1138 - type_of_loader = <type code>; 1139 - if (loading_initrd) { 1140 - ramdisk_image = <initrd_address>; 1141 - ramdisk_size = <initrd_size>; 1142 - } 1138 + type_of_loader = <type code>; 1139 + if (loading_initrd) { 1140 + ramdisk_image = <initrd_address>; 1141 + ramdisk_size = <initrd_size>; 1142 + } 1143 1143 1144 - if (protocol >= 0x0202 && loadflags & 0x01) 1145 - heap_end = 0xe000; 1146 - else 1147 - heap_end = 0x9800; 1144 + if (protocol >= 0x0202 && loadflags & 0x01) 1145 + heap_end = 0xe000; 1146 + else 1147 + heap_end = 0x9800; 1148 1148 1149 - if (protocol >= 0x0201) { 1150 - heap_end_ptr = heap_end - 0x200; 1151 - loadflags |= 0x80; /* CAN_USE_HEAP */ 1152 - } 1149 + if (protocol >= 0x0201) { 1150 + heap_end_ptr = heap_end - 0x200; 1151 + loadflags |= 0x80; /* CAN_USE_HEAP */ 1152 + } 1153 1153 1154 - if (protocol >= 0x0202) { 1155 - cmd_line_ptr = base_ptr + heap_end; 1156 - strcpy(cmd_line_ptr, cmdline); 1157 - } else { 1158 - cmd_line_magic = 0xA33F; 1159 - cmd_line_offset = heap_end; 1160 - setup_move_size = heap_end + strlen(cmdline) + 1; 1161 - strcpy(base_ptr + cmd_line_offset, cmdline); 1162 - } 1154 + if (protocol >= 0x0202) { 1155 + cmd_line_ptr = base_ptr + heap_end; 1156 + strcpy(cmd_line_ptr, cmdline); 1157 + } else { 1158 + cmd_line_magic = 0xA33F; 1159 + cmd_line_offset = heap_end; 1160 + setup_move_size = heap_end + strlen(cmdline) + 1; 1161 + strcpy(base_ptr + cmd_line_offset, cmdline); 1162 + } 1163 1163 } else { 1164 - /* Very old kernel */ 1164 + /* Very old kernel */ 1165 1165 1166 - heap_end = 0x9800; 1166 + heap_end = 0x9800; 1167 1167 1168 - cmd_line_magic = 0xA33F; 1169 - cmd_line_offset = heap_end; 1168 + cmd_line_magic = 0xA33F; 1169 + cmd_line_offset = heap_end; 1170 1170 1171 - /* A very old kernel MUST have its real-mode code loaded at 0x90000 */ 1172 - if (base_ptr != 0x90000) { 1173 - /* Copy the real-mode kernel */ 1174 - memcpy(0x90000, base_ptr, (setup_sects + 1) * 512); 1175 - base_ptr = 0x90000; /* Relocated */ 1176 - } 1171 + /* A very old kernel MUST have its real-mode code loaded at 0x90000 */ 1172 + if (base_ptr != 0x90000) { 1173 + /* Copy the real-mode kernel */ 1174 + memcpy(0x90000, base_ptr, (setup_sects + 1) * 512); 1175 + base_ptr = 0x90000; /* Relocated */ 1176 + } 1177 1177 1178 - strcpy(0x90000 + cmd_line_offset, cmdline); 1178 + strcpy(0x90000 + cmd_line_offset, cmdline); 1179 1179 1180 - /* It is recommended to clear memory up to the 32K mark */ 1181 - memset(0x90000 + (setup_sects + 1) * 512, 0, (64 - (setup_sects + 1)) * 512); 1180 + /* It is recommended to clear memory up to the 32K mark */ 1181 + memset(0x90000 + (setup_sects + 1) * 512, 0, (64 - (setup_sects + 1)) * 512); 1182 1182 } 1183 1183 1184 1184
+1 -1
Documentation/devicetree/bindings/arm/arm,integrator.yaml
··· 7 7 title: ARM Integrator Boards 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: |+ 13 13 These were the first ARM platforms officially supported by ARM Ltd.
+1 -1
Documentation/devicetree/bindings/arm/arm,realview.yaml
··· 7 7 title: ARM RealView Boards 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: |+ 13 13 The ARM RealView series of reference designs were built to explore the Arm11,
+1 -1
Documentation/devicetree/bindings/arm/arm,scu.yaml
··· 7 7 title: ARM Snoop Control Unit (SCU) 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 As part of the MPCore complex, Cortex-A5 and Cortex-A9 are provided
+1 -1
Documentation/devicetree/bindings/arm/arm,versatile-sysreg.yaml
··· 7 7 title: Arm Versatile system registers 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 This is a system control registers block, providing multiple low level
+1 -1
Documentation/devicetree/bindings/arm/arm,versatile.yaml
··· 7 7 title: ARM Versatile Boards 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: |+ 13 13 The ARM Versatile boards are two variants of ARM926EJ-S evaluation boards
+1 -1
Documentation/devicetree/bindings/arm/arm,vexpress-juno.yaml
··· 8 8 9 9 maintainers: 10 10 - Sudeep Holla <sudeep.holla@arm.com> 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: |+ 14 14 ARM's Versatile Express platform were built as reference designs for exploring
+1 -1
Documentation/devicetree/bindings/arm/gemini.yaml
··· 20 20 Many of the IP blocks used in the SoC comes from Faraday Technology. 21 21 22 22 maintainers: 23 - - Linus Walleij <linus.walleij@linaro.org> 23 + - Linus Walleij <linusw@kernel.org> 24 24 25 25 properties: 26 26 $nodename:
+1 -1
Documentation/devicetree/bindings/arm/intel-ixp4xx.yaml
··· 7 7 title: Intel IXP4xx 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 properties: 13 13 $nodename:
+1 -1
Documentation/devicetree/bindings/arm/ux500.yaml
··· 7 7 title: Ux500 platforms 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 properties: 13 13 $nodename:
+1 -1
Documentation/devicetree/bindings/ata/ata-generic.yaml
··· 7 7 title: Generic Parallel ATA Controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 Generic Parallel ATA controllers supporting PIO modes only.
+1 -1
Documentation/devicetree/bindings/ata/cortina,gemini-sata-bridge.yaml
··· 7 7 title: Cortina Systems Gemini SATA Bridge 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 The Gemini SATA bridge in a SoC-internal PATA to SATA bridge that
+1 -1
Documentation/devicetree/bindings/ata/faraday,ftide010.yaml
··· 7 7 title: Faraday Technology FTIDE010 PATA controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 This controller is the first Faraday IDE interface block, used in the
+1 -1
Documentation/devicetree/bindings/ata/intel,ixp4xx-compact-flash.yaml
··· 7 7 title: Intel IXP4xx CompactFlash Card Controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 The IXP4xx network processors have a CompactFlash interface that presents
+1 -1
Documentation/devicetree/bindings/ata/pata-common.yaml
··· 7 7 title: Common Properties for Parallel AT attachment (PATA) controllers 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 This document defines device tree properties common to most Parallel
+1 -1
Documentation/devicetree/bindings/ata/sata-common.yaml
··· 7 7 title: Common Properties for Serial AT attachment (SATA) controllers 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 This document defines device tree properties common to most Serial
+1 -1
Documentation/devicetree/bindings/auxdisplay/arm,versatile-lcd.yaml
··· 7 7 title: ARM Versatile Character LCD 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 - Rob Herring <robh@kernel.org> 12 12 13 13 description:
-26
Documentation/devicetree/bindings/clock/sprd,sc9860-clk.yaml
··· 114 114 - reg 115 115 properties: 116 116 sprd,syscon: false 117 - - if: 118 - properties: 119 - compatible: 120 - contains: 121 - enum: 122 - - sprd,sc9860-agcp-gate 123 - - sprd,sc9860-aon-gate 124 - - sprd,sc9860-apahb-gate 125 - - sprd,sc9860-apapb-gate 126 - - sprd,sc9860-cam-gate 127 - - sprd,sc9860-disp-gate 128 - - sprd,sc9860-pll 129 - - sprd,sc9860-pmu-gate 130 - - sprd,sc9860-vsp-gate 131 - then: 132 - required: 133 - - sprd,syscon 134 - properties: 135 - reg: false 136 117 137 118 additionalProperties: false 138 119 ··· 122 141 soc { 123 142 #address-cells = <2>; 124 143 #size-cells = <2>; 125 - 126 - pmu-gate { 127 - compatible = "sprd,sc9860-pmu-gate"; 128 - clocks = <&ext_26m>; 129 - #clock-cells = <1>; 130 - sprd,syscon = <&pmu_regs>; 131 - }; 132 144 133 145 clock-controller@20000000 { 134 146 compatible = "sprd,sc9860-ap-clk";
+1 -1
Documentation/devicetree/bindings/clock/stericsson,u8500-clks.yaml
··· 8 8 9 9 maintainers: 10 10 - Ulf Hansson <ulf.hansson@linaro.org> 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: While named "U8500 clocks" these clocks are inside the 14 14 DB8500 digital baseband system-on-chip and its siblings such as
+1 -1
Documentation/devicetree/bindings/crypto/intel,ixp4xx-crypto.yaml
··· 8 8 title: Intel IXP4xx cryptographic engine 9 9 10 10 maintainers: 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: | 14 14 The Intel IXP4xx cryptographic engine makes use of the IXP4xx NPE
+1 -1
Documentation/devicetree/bindings/display/dsi-controller.yaml
··· 7 7 title: Common Properties for DSI Display Panels 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 This document defines device tree properties common to DSI, Display
+1 -1
Documentation/devicetree/bindings/display/faraday,tve200.yaml
··· 7 7 title: Faraday TV Encoder TVE200 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 properties: 13 13 compatible:
+1 -1
Documentation/devicetree/bindings/display/panel/arm,rtsm-display.yaml
··· 7 7 title: Arm RTSM Virtual Platforms Display 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 allOf: 13 13 - $ref: panel-common.yaml#
+1 -1
Documentation/devicetree/bindings/display/panel/arm,versatile-tft-panel.yaml
··· 7 7 title: ARM Versatile TFT Panels 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 These panels are connected to the daughterboards found on the
+1 -1
Documentation/devicetree/bindings/display/panel/ilitek,ili9322.yaml
··· 7 7 title: Ilitek ILI9322 TFT panel driver with SPI control bus 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 This is a driver for 320x240 TFT panels, accepting a variety of input
+1 -1
Documentation/devicetree/bindings/display/panel/novatek,nt35510.yaml
··· 7 7 title: Novatek NT35510-based display panels 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 allOf: 13 13 - $ref: panel-common.yaml#
+1 -1
Documentation/devicetree/bindings/display/panel/samsung,lms380kf01.yaml
··· 11 11 used with internal or external backlight control. 12 12 13 13 maintainers: 14 - - Linus Walleij <linus.walleij@linaro.org> 14 + - Linus Walleij <linusw@kernel.org> 15 15 16 16 allOf: 17 17 - $ref: panel-common.yaml#
+1 -1
Documentation/devicetree/bindings/display/panel/samsung,lms397kf04.yaml
··· 10 10 named DB7430 with a separate backlight controller. 11 11 12 12 maintainers: 13 - - Linus Walleij <linus.walleij@linaro.org> 13 + - Linus Walleij <linusw@kernel.org> 14 14 15 15 allOf: 16 16 - $ref: panel-common.yaml#
+1 -1
Documentation/devicetree/bindings/display/panel/samsung,s6d16d0.yaml
··· 7 7 title: Samsung S6D16D0 4" 864x480 AMOLED panel 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 allOf: 13 13 - $ref: panel-common.yaml#
+1 -1
Documentation/devicetree/bindings/display/panel/sony,acx424akp.yaml
··· 12 12 AKP. 13 13 14 14 maintainers: 15 - - Linus Walleij <linus.walleij@linaro.org> 15 + - Linus Walleij <linusw@kernel.org> 16 16 17 17 allOf: 18 18 - $ref: panel-common.yaml#
+1 -1
Documentation/devicetree/bindings/display/panel/ti,nspire.yaml
··· 7 7 title: Texas Instruments NSPIRE Display Panels 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 allOf: 13 13 - $ref: panel-common.yaml#
+1 -1
Documentation/devicetree/bindings/display/panel/tpo,tpg110.yaml
··· 7 7 title: TPO TPG110 Panel 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 - Thierry Reding <thierry.reding@gmail.com> 12 12 13 13 description: |+
+1 -1
Documentation/devicetree/bindings/display/ste,mcde.yaml
··· 7 7 title: ST-Ericsson Multi Channel Display Engine MCDE 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 properties: 13 13 compatible:
+1 -2
Documentation/devicetree/bindings/display/ti/ti,am65x-dss.yaml
··· 84 84 maxItems: 1 85 85 description: phandle to the associated power domain 86 86 87 - dma-coherent: 88 - type: boolean 87 + dma-coherent: true 89 88 90 89 ports: 91 90 $ref: /schemas/graph.yaml#/properties/ports
+1 -2
Documentation/devicetree/bindings/display/ti/ti,j721e-dss.yaml
··· 103 103 maxItems: 1 104 104 description: phandle to the associated power domain 105 105 106 - dma-coherent: 107 - type: boolean 106 + dma-coherent: true 108 107 109 108 ports: 110 109 $ref: /schemas/graph.yaml#/properties/ports
+1 -1
Documentation/devicetree/bindings/dma/stericsson,dma40.yaml
··· 7 7 title: ST-Ericsson DMA40 DMA Engine 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 allOf: 13 13 - $ref: dma-controller.yaml#
+1 -1
Documentation/devicetree/bindings/extcon/fcs,fsa880.yaml
··· 7 7 title: Fairchild Semiconductor FSA880, FSA9480 and compatibles 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 The FSA880 and FSA9480 are USB port accessory detectors and switches.
+1 -1
Documentation/devicetree/bindings/firmware/intel,ixp4xx-network-processing-engine.yaml
··· 8 8 title: Intel IXP4xx Network Processing Engine 9 9 10 10 maintainers: 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: | 14 14 On the IXP4xx SoCs, the Network Processing Engine (NPE) is a small
+1 -1
Documentation/devicetree/bindings/gnss/brcm,bcm4751.yaml
··· 8 8 9 9 maintainers: 10 10 - Johan Hovold <johan@kernel.org> 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: 14 14 Broadcom GPS chips can be used over the UART or I2C bus. The UART
+1 -1
Documentation/devicetree/bindings/gpio/faraday,ftgpio010.yaml
··· 7 7 title: Faraday Technology FTGPIO010 GPIO Controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 properties: 13 13 compatible:
+1 -1
Documentation/devicetree/bindings/gpio/gpio-consumer-common.yaml
··· 8 8 9 9 maintainers: 10 10 - Bartosz Golaszewski <brgl@bgdev.pl> 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: 14 14 Pay attention to using proper GPIO flag (e.g. GPIO_ACTIVE_LOW) for the GPIOs
+1 -1
Documentation/devicetree/bindings/gpio/gpio-ep9301.yaml
··· 7 7 title: EP93xx GPIO controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 - Bartosz Golaszewski <brgl@bgdev.pl> 12 12 - Nikita Shubin <nikita.shubin@maquefel.me> 13 13
+1 -1
Documentation/devicetree/bindings/gpio/gpio-mmio.yaml
··· 7 7 title: Generic MMIO GPIO 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 - Bartosz Golaszewski <brgl@bgdev.pl> 12 12 13 13 description:
+1 -1
Documentation/devicetree/bindings/gpio/intel,ixp4xx-gpio.yaml
··· 22 22 and this can be enabled by a special flag. 23 23 24 24 maintainers: 25 - - Linus Walleij <linus.walleij@linaro.org> 25 + - Linus Walleij <linusw@kernel.org> 26 26 27 27 properties: 28 28 compatible:
+1 -1
Documentation/devicetree/bindings/gpio/mrvl-gpio.yaml
··· 7 7 title: Marvell PXA GPIO controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 - Bartosz Golaszewski <bgolaszewski@baylibre.com> 12 12 - Rob Herring <robh@kernel.org> 13 13
+1 -1
Documentation/devicetree/bindings/gpio/pl061-gpio.yaml
··· 7 7 title: ARM PL061 GPIO controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 - Rob Herring <robh@kernel.org> 12 12 13 13 # We need a select here so we don't match all nodes with 'arm,primecell'
+1 -1
Documentation/devicetree/bindings/gpio/st,nomadik-gpio.yaml
··· 12 12 with pinctrl-nomadik. 13 13 14 14 maintainers: 15 - - Linus Walleij <linus.walleij@linaro.org> 15 + - Linus Walleij <linusw@kernel.org> 16 16 17 17 properties: 18 18 $nodename:
+1 -1
Documentation/devicetree/bindings/gpio/st,stmpe-gpio.yaml
··· 14 14 GPIO portions of these expanders. 15 15 16 16 maintainers: 17 - - Linus Walleij <linus.walleij@linaro.org> 17 + - Linus Walleij <linusw@kernel.org> 18 18 19 19 properties: 20 20 compatible:
+3 -1
Documentation/devicetree/bindings/gpu/img,powervr-rogue.yaml
··· 20 20 - const: img,img-gx6250 21 21 - const: img,img-rogue 22 22 - items: 23 - - const: renesas,r8a77965-gpu 23 + - enum: 24 + - renesas,r8a77965-gpu 25 + - renesas,r8a779a0-gpu 24 26 - const: img,img-ge7800 25 27 - const: img,img-rogue 26 28 - items:
+1 -1
Documentation/devicetree/bindings/hwmon/ntc-thermistor.yaml
··· 6 6 title: NTC thermistor temperature sensors 7 7 8 8 maintainers: 9 - - Linus Walleij <linus.walleij@linaro.org> 9 + - Linus Walleij <linusw@kernel.org> 10 10 11 11 description: | 12 12 Thermistors with negative temperature coefficient (NTC) are resistors that
+1 -1
Documentation/devicetree/bindings/hwmon/winbond,w83781d.yaml
··· 7 7 title: Winbond W83781 and compatible hardware monitor IC 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 properties: 13 13 compatible:
+1 -1
Documentation/devicetree/bindings/i2c/arm,i2c-versatile.yaml
··· 7 7 title: I2C Controller on ARM Ltd development platforms 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 allOf: 13 13 - $ref: /schemas/i2c/i2c-controller.yaml#
+2
Documentation/devicetree/bindings/i2c/qcom,i2c-cci.yaml
··· 38 38 - qcom,sm8450-cci 39 39 - qcom,sm8550-cci 40 40 - qcom,sm8650-cci 41 + - qcom,sm8750-cci 41 42 - qcom,x1e80100-cci 42 43 - const: qcom,msm8996-cci # CCI v2 43 44 ··· 133 132 enum: 134 133 - qcom,kaanapali-cci 135 134 - qcom,qcm2290-cci 135 + - qcom,sm8750-cci 136 136 then: 137 137 properties: 138 138 clocks:
+7
Documentation/devicetree/bindings/i2c/snps,designware-i2c.yaml
··· 34 34 - const: snps,designware-i2c 35 35 - description: Baikal-T1 SoC System I2C controller 36 36 const: baikal,bt1-sys-i2c 37 + - description: Mobileye EyeQ DesignWare I2C controller 38 + items: 39 + - enum: 40 + - mobileye,eyeq7h-i2c 41 + - const: mobileye,eyeq6lplus-i2c 42 + - const: snps,designware-i2c 37 43 - items: 38 44 - enum: 45 + - mobileye,eyeq6lplus-i2c 39 46 - mscc,ocelot-i2c 40 47 - sophgo,sg2044-i2c 41 48 - thead,th1520-i2c
+1 -1
Documentation/devicetree/bindings/i2c/st,nomadik-i2c.yaml
··· 12 12 DB8500 after the merge of these two companies wireless divisions. 13 13 14 14 maintainers: 15 - - Linus Walleij <linus.walleij@linaro.org> 15 + - Linus Walleij <linusw@kernel.org> 16 16 17 17 # Need a custom select here or 'arm,primecell' will match on lots of nodes 18 18 select:
+1 -1
Documentation/devicetree/bindings/iio/accel/bosch,bma255.yaml
··· 7 7 title: Bosch BMA255 and Similar Accelerometers 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 - Stephan Gerhold <stephan@gerhold.net> 12 12 13 13 description:
+1 -1
Documentation/devicetree/bindings/iio/adc/qcom,pm8018-adc.yaml
··· 7 7 title: Qualcomm's PM8xxx voltage XOADC 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 The Qualcomm PM8xxx PMICs contain a HK/XO ADC (Housekeeping/Crystal
+1 -1
Documentation/devicetree/bindings/iio/gyroscope/invensense,mpu3050.yaml
··· 7 7 title: Invensense MPU-3050 Gyroscope 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 properties: 13 13 compatible:
+1 -1
Documentation/devicetree/bindings/iio/light/capella,cm3605.yaml
··· 8 8 Capella Microsystems CM3605 Ambient Light and Short Distance Proximity Sensor 9 9 10 10 maintainers: 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 - Kevin Tsai <ktsai@capellamicro.com> 13 13 14 14 description: |
+1 -1
Documentation/devicetree/bindings/iio/light/sharp,gp2ap002.yaml
··· 7 7 title: Sharp GP2AP002A00F and GP2AP002S00F proximity and ambient light sensors 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 Proximity and ambient light sensor with IR LED for the proximity
+1 -1
Documentation/devicetree/bindings/iio/magnetometer/asahi-kasei,ak8974.yaml
··· 7 7 title: Asahi Kasei AK8974 magnetometer sensor 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 properties: 13 13 compatible:
+1 -1
Documentation/devicetree/bindings/iio/magnetometer/yamaha,yas530.yaml
··· 7 7 title: Yamaha YAS530 family of magnetometer sensors 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 The Yamaha YAS530 magnetometers is a line of 3-axis magnetometers
+1 -1
Documentation/devicetree/bindings/iio/st,st-sensors.yaml
··· 14 14 15 15 maintainers: 16 16 - Denis Ciocca <denis.ciocca@st.com> 17 - - Linus Walleij <linus.walleij@linaro.org> 17 + - Linus Walleij <linusw@kernel.org> 18 18 19 19 properties: 20 20 compatible:
+1 -1
Documentation/devicetree/bindings/input/atmel,maxtouch.yaml
··· 8 8 9 9 maintainers: 10 10 - Nick Dyer <nick@shmanahar.org> 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: | 14 14 Atmel maXTouch touchscreen or touchpads such as the mXT244
+1 -1
Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma140.yaml
··· 7 7 title: Cypress CY8CTMA140 series touchscreen controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 allOf: 13 13 - $ref: touchscreen.yaml#
+1 -1
Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma340.yaml
··· 12 12 13 13 maintainers: 14 14 - Javier Martinez Canillas <javier@dowhile0.org> 15 - - Linus Walleij <linus.walleij@linaro.org> 15 + - Linus Walleij <linusw@kernel.org> 16 16 17 17 allOf: 18 18 - $ref: touchscreen.yaml#
+1 -1
Documentation/devicetree/bindings/input/touchscreen/melfas,mms114.yaml
··· 7 7 title: Melfas MMS114 family touchscreen controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 allOf: 13 13 - $ref: touchscreen.yaml#
+1 -1
Documentation/devicetree/bindings/input/touchscreen/zinitix,bt400.yaml
··· 12 12 13 13 maintainers: 14 14 - Michael Srba <Michael.Srba@seznam.cz> 15 - - Linus Walleij <linus.walleij@linaro.org> 15 + - Linus Walleij <linusw@kernel.org> 16 16 17 17 allOf: 18 18 - $ref: touchscreen.yaml#
+1 -1
Documentation/devicetree/bindings/interrupt-controller/arm,versatile-fpga-irq.yaml
··· 7 7 title: ARM Versatile FPGA IRQ Controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 One or more FPGA IRQ controllers can be synthesized in an ARM reference board
+1 -1
Documentation/devicetree/bindings/interrupt-controller/faraday,ftintc010.yaml
··· 6 6 title: Faraday Technology FTINTC010 interrupt controller 7 7 8 8 maintainers: 9 - - Linus Walleij <linus.walleij@linaro.org> 9 + - Linus Walleij <linusw@kernel.org> 10 10 11 11 description: 12 12 This interrupt controller is a stock IP block from Faraday Technology found
+1 -1
Documentation/devicetree/bindings/interrupt-controller/intel,ixp4xx-interrupt.yaml
··· 8 8 title: Intel IXP4xx XScale Networking Processors Interrupt Controller 9 9 10 10 maintainers: 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: | 14 14 This interrupt controller is found in the Intel IXP4xx processors.
+1 -1
Documentation/devicetree/bindings/leds/backlight/kinetic,ktd253.yaml
··· 7 7 title: Kinetic Technologies KTD253 and KTD259 one-wire backlight 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 The Kinetic Technologies KTD253 and KTD259 are white LED backlights
+1 -1
Documentation/devicetree/bindings/leds/register-bit-led.yaml
··· 7 7 title: Register Bit LEDs 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: |+ 13 13 Register bit leds are used with syscon multifunctional devices where single
+1 -1
Documentation/devicetree/bindings/leds/regulator-led.yaml
··· 7 7 title: Regulator LEDs 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 Regulator LEDs are powered by a single regulator such that they can
+1 -1
Documentation/devicetree/bindings/leds/richtek,rt8515.yaml
··· 7 7 title: Richtek RT8515 1.5A dual channel LED driver 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 The Richtek RT8515 is a dual channel (two mode) LED driver that
+1 -1
Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion-bus-controller.yaml
··· 12 12 including IXP42x, IXP43x, IXP45x and IXP46x. 13 13 14 14 maintainers: 15 - - Linus Walleij <linus.walleij@linaro.org> 15 + - Linus Walleij <linusw@kernel.org> 16 16 17 17 properties: 18 18 $nodename:
+1 -1
Documentation/devicetree/bindings/memory-controllers/intel,ixp4xx-expansion-peripheral-props.yaml
··· 12 12 including IXP42x, IXP43x, IXP45x and IXP46x. 13 13 14 14 maintainers: 15 - - Linus Walleij <linus.walleij@linaro.org> 15 + - Linus Walleij <linusw@kernel.org> 16 16 17 17 properties: 18 18 intel,ixp4xx-eb-t1:
+1 -1
Documentation/devicetree/bindings/mfd/arm,dev-platforms-syscon.yaml
··· 7 7 title: Arm Ltd Developer Platforms System Controllers 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 The Arm Ltd Integrator, Realview, and Versatile families of developer
+1 -1
Documentation/devicetree/bindings/mfd/st,stmpe.yaml
··· 12 12 peripherals connected to SPI or I2C. 13 13 14 14 maintainers: 15 - - Linus Walleij <linus.walleij@linaro.org> 15 + - Linus Walleij <linusw@kernel.org> 16 16 17 17 allOf: 18 18 - $ref: /schemas/spi/spi-peripheral-props.yaml#
+1 -1
Documentation/devicetree/bindings/mfd/stericsson,ab8500.yaml
··· 7 7 title: ST-Ericsson Analog Baseband AB8500 and AB8505 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 the AB8500 "Analog Baseband" is the mixed-signals integrated circuit
+1 -1
Documentation/devicetree/bindings/mfd/stericsson,db8500-prcmu.yaml
··· 7 7 title: ST-Ericsson DB8500 PRCMU - Power Reset and Control Management Unit 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 The DB8500 Power Reset and Control Management Unit is an XP70 8-bit
+1 -1
Documentation/devicetree/bindings/misc/intel,ixp4xx-ahb-queue-manager.yaml
··· 8 8 title: Intel IXP4xx AHB Queue Manager 9 9 10 10 maintainers: 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: | 14 14 The IXP4xx AHB Queue Manager maintains queues as circular buffers in
+1 -1
Documentation/devicetree/bindings/mmc/arm,pl18x.yaml
··· 7 7 title: ARM PrimeCell MultiMedia Card Interface (MMCI) PL180 and PL181 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 - Ulf Hansson <ulf.hansson@linaro.org> 12 12 13 13 description:
+1 -1
Documentation/devicetree/bindings/mmc/aspeed,sdhci.yaml
··· 41 41 patternProperties: 42 42 "^sdhci@[0-9a-f]+$": 43 43 type: object 44 - $ref: mmc-controller.yaml 44 + $ref: sdhci-common.yaml 45 45 unevaluatedProperties: false 46 46 47 47 properties:
+1 -1
Documentation/devicetree/bindings/mtd/partitions/arm,arm-firmware-suite.yaml
··· 7 7 title: ARM Firmware Suite (AFS) Partitions 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 select: false 13 13
+1 -1
Documentation/devicetree/bindings/mtd/partitions/redboot-fis.yaml
··· 14 14 32 KB in size. 15 15 16 16 maintainers: 17 - - Linus Walleij <linus.walleij@linaro.org> 17 + - Linus Walleij <linusw@kernel.org> 18 18 19 19 select: false 20 20
+1 -1
Documentation/devicetree/bindings/mtd/partitions/seama.yaml
··· 18 18 - $ref: partition.yaml# 19 19 20 20 maintainers: 21 - - Linus Walleij <linus.walleij@linaro.org> 21 + - Linus Walleij <linusw@kernel.org> 22 22 23 23 properties: 24 24 compatible:
+1 -1
Documentation/devicetree/bindings/net/bluetooth/brcm,bluetooth.yaml
··· 7 7 title: Broadcom Bluetooth Chips 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 This binding describes Broadcom UART-attached bluetooth chips.
+1 -1
Documentation/devicetree/bindings/net/cortina,gemini-ethernet.yaml
··· 7 7 title: Cortina Systems Gemini Ethernet Controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 This ethernet controller is found in the Gemini SoC family:
+1 -1
Documentation/devicetree/bindings/net/dsa/micrel,ks8995.yaml
··· 7 7 title: Micrel KS8995 Family DSA Switches 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 The Micrel KS8995 DSA Switches are 100 Mbit switches that were produced in
+1 -1
Documentation/devicetree/bindings/net/dsa/realtek.yaml
··· 10 10 - $ref: dsa.yaml#/$defs/ethernet-ports 11 11 12 12 maintainers: 13 - - Linus Walleij <linus.walleij@linaro.org> 13 + - Linus Walleij <linusw@kernel.org> 14 14 15 15 description: 16 16 Realtek advertises these chips as fast/gigabit switches or unmanaged
+1 -1
Documentation/devicetree/bindings/net/dsa/vitesse,vsc73xx.yaml
··· 7 7 title: Vitesse VSC73xx DSA Switches 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 The Vitesse DSA Switches were produced in the early-to-mid 2000s.
+1 -1
Documentation/devicetree/bindings/net/intel,ixp46x-ptp-timer.yaml
··· 8 8 title: Intel IXP46x PTP Timer (TSYNC) 9 9 10 10 maintainers: 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: | 14 14 The Intel IXP46x PTP timer is known in the manual as IEEE1588 Hardware
+1 -1
Documentation/devicetree/bindings/net/intel,ixp4xx-ethernet.yaml
··· 11 11 - $ref: ethernet-controller.yaml# 12 12 13 13 maintainers: 14 - - Linus Walleij <linus.walleij@linaro.org> 14 + - Linus Walleij <linusw@kernel.org> 15 15 16 16 description: | 17 17 The Intel IXP4xx ethernet makes use of the IXP4xx NPE (Network
+1 -1
Documentation/devicetree/bindings/net/intel,ixp4xx-hss.yaml
··· 8 8 title: Intel IXP4xx V.35 WAN High Speed Serial Link (HSS) 9 9 10 10 maintainers: 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: | 14 14 The Intel IXP4xx HSS makes use of the IXP4xx NPE (Network
+1 -1
Documentation/devicetree/bindings/pci/faraday,ftpci100.yaml
··· 7 7 title: Faraday Technology FTPCI100 PCI Host Bridge 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 This PCI bridge is found inside that Cortina Systems Gemini SoC platform and
+1 -1
Documentation/devicetree/bindings/pci/intel,ixp4xx-pci.yaml
··· 7 7 title: Intel IXP4xx PCI controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: PCI host controller found in the Intel IXP4xx SoC series. 13 13
+1 -1
Documentation/devicetree/bindings/pci/v3,v360epc-pci.yaml
··· 7 7 title: V3 Semiconductor V360 EPC PCI bridge 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 This bridge is found in the ARM Integrator/AP (Application Platform)
+1 -1
Documentation/devicetree/bindings/pinctrl/pincfg-node.yaml
··· 7 7 title: Generic Pin Configuration Node 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: 13 13 Many data items that are represented in a pin configuration node are common
+1 -1
Documentation/devicetree/bindings/pinctrl/pinctrl.yaml
··· 7 7 title: Pin controller device 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 - Rafał Miłecki <rafal@milecki.pl> 12 12 13 13 description: |
+1 -1
Documentation/devicetree/bindings/pinctrl/pinmux-node.yaml
··· 7 7 title: Generic Pin Multiplexing Node 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 The contents of the pin configuration child nodes are defined by the binding
+1 -1
Documentation/devicetree/bindings/power/supply/samsung,battery.yaml
··· 7 7 title: Samsung SDI Batteries 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 Samsung SDI (Samsung Digital Interface) batteries are all different versions
+1 -1
Documentation/devicetree/bindings/rng/intel,ixp46x-rng.yaml
··· 12 12 32 bit random number. 13 13 14 14 maintainers: 15 - - Linus Walleij <linus.walleij@linaro.org> 15 + - Linus Walleij <linusw@kernel.org> 16 16 17 17 properties: 18 18 compatible:
+1 -1
Documentation/devicetree/bindings/rtc/faraday,ftrtc010.yaml
··· 7 7 title: Faraday Technology FTRTC010 Real Time Clock 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 description: | 13 13 This RTC appears in for example the Storlink Gemini family of SoCs.
+1 -1
Documentation/devicetree/bindings/spi/arm,pl022-peripheral-props.yaml
··· 7 7 title: Peripheral-specific properties for Arm PL022 SPI controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 select: false 13 13
+3 -3
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
··· 121 121 num-cs: 122 122 default: 4 123 123 minimum: 1 124 - maximum: 4 124 + maximum: 16 125 125 126 126 dmas: 127 127 items: ··· 153 153 provides an interface to override the native DWC SSI CS control. 154 154 155 155 patternProperties: 156 - "@[0-9a-f]+$": 156 + "@[0-9a-f]$": 157 157 type: object 158 158 additionalProperties: true 159 159 160 160 properties: 161 161 reg: 162 162 minimum: 0 163 - maximum: 3 163 + maximum: 0xf 164 164 165 165 unevaluatedProperties: false 166 166
+1 -1
Documentation/devicetree/bindings/spi/spi-pl022.yaml
··· 7 7 title: ARM PL022 SPI controller 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 12 12 allOf: 13 13 - $ref: spi-controller.yaml#
+1 -1
Documentation/devicetree/bindings/timer/faraday,fttmr010.yaml
··· 8 8 9 9 maintainers: 10 10 - Joel Stanley <joel@jms.id.au> 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: 14 14 This timer is a generic IP block from Faraday Technology, embedded in the
+1 -1
Documentation/devicetree/bindings/timer/intel,ixp4xx-timer.yaml
··· 8 8 title: Intel IXP4xx XScale Networking Processors Timers 9 9 10 10 maintainers: 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: This timer is found in the Intel IXP4xx processors. 14 14
+1 -1
Documentation/devicetree/bindings/timer/st,nomadik-mtu.yaml
··· 8 8 title: ST Microelectronics Nomadik Multi-Timer Unit MTU Timer 9 9 10 10 maintainers: 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 description: This timer is found in the ST Microelectronics Nomadik 14 14 SoCs STn8800, STn8810 and STn8815 as well as in ST-Ericsson DB8500.
+1 -1
Documentation/devicetree/bindings/usb/faraday,fotg210.yaml
··· 8 8 title: Faraday Technology FOTG200 series HS OTG USB 2.0 controller 9 9 10 10 maintainers: 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 allOf: 14 14 - $ref: usb-drd.yaml#
+1 -1
Documentation/devicetree/bindings/usb/intel,ixp4xx-udc.yaml
··· 10 10 Controller with 16 endpoints and a built-in transceiver. 11 11 12 12 maintainers: 13 - - Linus Walleij <linus.walleij@linaro.org> 13 + - Linus Walleij <linusw@kernel.org> 14 14 15 15 properties: 16 16 compatible:
+1 -1
Documentation/devicetree/bindings/watchdog/faraday,ftwdt010.yaml
··· 7 7 title: Faraday Technology FTWDT010 watchdog 8 8 9 9 maintainers: 10 - - Linus Walleij <linus.walleij@linaro.org> 10 + - Linus Walleij <linusw@kernel.org> 11 11 - Corentin Labbe <clabbe@baylibre.com> 12 12 13 13 description: |
+1 -1
Documentation/devicetree/bindings/watchdog/maxim,max63xx.yaml
··· 8 8 9 9 maintainers: 10 10 - Marc Zyngier <maz@kernel.org> 11 - - Linus Walleij <linus.walleij@linaro.org> 11 + - Linus Walleij <linusw@kernel.org> 12 12 13 13 allOf: 14 14 - $ref: watchdog.yaml#
+2 -2
Documentation/hwmon/ds620.rst
··· 7 7 8 8 Prefix: 'ds620' 9 9 10 - Datasheet: Publicly available at the Dallas Semiconductor website 10 + Datasheet: Publicly available at the Analog Devices website 11 11 12 - http://www.dalsemi.com/ 12 + https://www.analog.com/media/en/technical-documentation/data-sheets/DS620.pdf 13 13 14 14 Authors: 15 15 Roland Stigge <stigge@antcom.de>
+1
Documentation/i2c/busses/i2c-i801.rst
··· 52 52 * Intel Panther Lake (SOC) 53 53 * Intel Wildcat Lake (SOC) 54 54 * Intel Diamond Rapids (SOC) 55 + * Intel Nova Lake (PCH) 55 56 56 57 Datasheets: Publicly available at the Intel website 57 58
+6
Documentation/input/event-codes.rst
··· 241 241 emitted only when the selected profile changes, indicating the newly 242 242 selected profile value. 243 243 244 + * ABS_SND_PROFILE: 245 + 246 + - Used to describe the state of a multi-value sound profile switch. 247 + An event is emitted only when the selected profile changes, 248 + indicating the newly selected profile value. 249 + 244 250 * ABS_MT_<name>: 245 251 246 252 - Used to describe multitouch input events. Please see
+1 -1
MAINTAINERS
··· 18028 18028 18029 18029 NETFILTER 18030 18030 M: Pablo Neira Ayuso <pablo@netfilter.org> 18031 - M: Jozsef Kadlecsik <kadlec@netfilter.org> 18032 18031 M: Florian Westphal <fw@strlen.de> 18033 18032 R: Phil Sutter <phil@nwl.cc> 18034 18033 L: netfilter-devel@vger.kernel.org ··· 26463 26464 S: Maintained 26464 26465 Q: https://patchwork.kernel.org/project/linux-trace-kernel/list/ 26465 26466 T: git git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git 26467 + F: Documentation/core-api/tracepoint.rst 26466 26468 F: Documentation/trace/* 26467 26469 F: fs/tracefs/ 26468 26470 F: include/linux/trace*.h
+1 -1
Makefile
··· 2 2 VERSION = 6 3 3 PATCHLEVEL = 19 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc1 5 + EXTRAVERSION = -rc2 6 6 NAME = Baby Opossum Posse 7 7 8 8 # *DOCUMENTATION*
+55
arch/arm64/boot/dts/mediatek/Makefile
··· 19 19 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo 20 20 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtbo 21 21 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo 22 + mt7986a-bananapi-bpi-r3-emmc-nand-dtbs := \ 23 + mt7986a-bananapi-bpi-r3.dtb \ 24 + mt7986a-bananapi-bpi-r3-emmc.dtbo \ 25 + mt7986a-bananapi-bpi-r3-nand.dtbo 26 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc-nand.dtb 27 + mt7986a-bananapi-bpi-r3-emmc-nor-dtbs := \ 28 + mt7986a-bananapi-bpi-r3.dtb \ 29 + mt7986a-bananapi-bpi-r3-emmc.dtbo \ 30 + mt7986a-bananapi-bpi-r3-nor.dtbo 31 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc-nor.dtb 32 + mt7986a-bananapi-bpi-r3-sd-nand-dtbs := \ 33 + mt7986a-bananapi-bpi-r3.dtb \ 34 + mt7986a-bananapi-bpi-r3-sd.dtbo \ 35 + mt7986a-bananapi-bpi-r3-nand.dtbo \ 36 + mt7986a-bananapi-bpi-r3-sata.dtbo 37 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd-nand.dtb 38 + mt7986a-bananapi-bpi-r3-sd-nor-dtbs := \ 39 + mt7986a-bananapi-bpi-r3.dtb \ 40 + mt7986a-bananapi-bpi-r3-sd.dtbo \ 41 + mt7986a-bananapi-bpi-r3-nor.dtbo 42 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd-nor.dtb 22 43 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb 23 44 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb 24 45 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb ··· 52 31 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-emmc.dtbo 53 32 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-sd.dtbo 54 33 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo 34 + mt7988a-bananapi-bpi-r4-emmc-dtbs := \ 35 + mt7988a-bananapi-bpi-r4.dtb \ 36 + mt7988a-bananapi-bpi-r4-emmc.dtbo 37 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtb 38 + mt7988a-bananapi-bpi-r4-sd-dtbs := \ 39 + mt7988a-bananapi-bpi-r4.dtb \ 40 + mt7988a-bananapi-bpi-r4-sd.dtbo 41 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtb 42 + mt7988a-bananapi-bpi-r4-2g5-emmc-dtbs := \ 43 + mt7988a-bananapi-bpi-r4-2g5.dtb \ 44 + mt7988a-bananapi-bpi-r4-emmc.dtbo 45 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5-emmc.dtb 46 + mt7988a-bananapi-bpi-r4-2g5-sd-dtbs := \ 47 + mt7988a-bananapi-bpi-r4-2g5.dtb \ 48 + mt7988a-bananapi-bpi-r4-sd.dtbo 49 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5-sd.dtb 50 + mt7988a-bananapi-bpi-r4-pro-8x-emmc-dtbs := \ 51 + mt7988a-bananapi-bpi-r4-pro-8x.dtb \ 52 + mt7988a-bananapi-bpi-r4-pro-emmc.dtbo 53 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-8x-emmc.dtb 54 + mt7988a-bananapi-bpi-r4-pro-8x-sd-dtbs := \ 55 + mt7988a-bananapi-bpi-r4-pro-8x.dtb \ 56 + mt7988a-bananapi-bpi-r4-pro-sd.dtbo 57 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-8x-sd.dtb 58 + mt7988a-bananapi-bpi-r4-pro-8x-sd-cn15-dtbs := \ 59 + mt7988a-bananapi-bpi-r4-pro-8x-sd.dtb \ 60 + mt7988a-bananapi-bpi-r4-pro-cn15.dtbo 61 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-8x-sd-cn15.dtb 62 + mt7988a-bananapi-bpi-r4-pro-8x-sd-cn18-dtbs := \ 63 + mt7988a-bananapi-bpi-r4-pro-8x-sd.dtb \ 64 + mt7988a-bananapi-bpi-r4-pro-cn18.dtbo 65 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-8x-sd-cn18.dtb 55 66 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb 56 67 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm.dtb 57 68 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm-hana.dtb ··· 166 113 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-kontron-3-5-sbc-i1200.dtb 167 114 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l.dtb 168 115 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l-8-hd-panel.dtbo 116 + mt8395-radxa-nio-12l-8-hd-panel-dtbs := mt8395-radxa-nio-12l.dtb mt8395-radxa-nio-12l-8-hd-panel.dtbo 117 + dtb-$(CONFIG_ARCH_MEDIATEK) += mt8395-radxa-nio-12l-8-hd-panel.dtb 169 118 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8516-pumpkin.dtb 170 119 171 120 # Device tree overlays support
+8 -1
arch/arm64/include/asm/simd.h
··· 48 48 kernel_neon_begin(_T->lock), 49 49 kernel_neon_end(_T->lock)) 50 50 51 - #define scoped_ksimd() scoped_guard(ksimd, &(struct user_fpsimd_state){}) 51 + #define __scoped_ksimd(_label) \ 52 + for (struct user_fpsimd_state __uninitialized __st; \ 53 + true; ({ goto _label; })) \ 54 + if (0) { \ 55 + _label: break; \ 56 + } else scoped_guard(ksimd, &__st) 57 + 58 + #define scoped_ksimd() __scoped_ksimd(__UNIQUE_ID(label)) 52 59 53 60 #endif
+20 -110
arch/arm64/kernel/fpsimd.c
··· 180 180 set_default_vl(ARM64_VEC_SVE, val); 181 181 } 182 182 183 - static u8 *efi_sve_state; 184 - 185 - #else /* ! CONFIG_ARM64_SVE */ 186 - 187 - /* Dummy declaration for code that will be optimised out: */ 188 - extern u8 *efi_sve_state; 189 - 190 183 #endif /* ! CONFIG_ARM64_SVE */ 191 184 192 185 #ifdef CONFIG_ARM64_SME ··· 1088 1095 return 0; 1089 1096 } 1090 1097 1091 - static void __init sve_efi_setup(void) 1092 - { 1093 - int max_vl = 0; 1094 - int i; 1095 - 1096 - if (!IS_ENABLED(CONFIG_EFI)) 1097 - return; 1098 - 1099 - for (i = 0; i < ARRAY_SIZE(vl_info); i++) 1100 - max_vl = max(vl_info[i].max_vl, max_vl); 1101 - 1102 - /* 1103 - * alloc_percpu() warns and prints a backtrace if this goes wrong. 1104 - * This is evidence of a crippled system and we are returning void, 1105 - * so no attempt is made to handle this situation here. 1106 - */ 1107 - if (!sve_vl_valid(max_vl)) 1108 - goto fail; 1109 - 1110 - efi_sve_state = kmalloc(SVE_SIG_REGS_SIZE(sve_vq_from_vl(max_vl)), 1111 - GFP_KERNEL); 1112 - if (!efi_sve_state) 1113 - goto fail; 1114 - 1115 - return; 1116 - 1117 - fail: 1118 - panic("Cannot allocate memory for EFI SVE save/restore"); 1119 - } 1120 - 1121 1098 void cpu_enable_sve(const struct arm64_cpu_capabilities *__always_unused p) 1122 1099 { 1123 1100 write_sysreg(read_sysreg(CPACR_EL1) | CPACR_EL1_ZEN_EL1EN, CPACR_EL1); ··· 1148 1185 if (sve_max_virtualisable_vl() < sve_max_vl()) 1149 1186 pr_warn("%s: unvirtualisable vector lengths present\n", 1150 1187 info->name); 1151 - 1152 - sve_efi_setup(); 1153 1188 } 1154 1189 1155 1190 /* ··· 1908 1947 #ifdef CONFIG_EFI 1909 1948 1910 1949 static struct user_fpsimd_state efi_fpsimd_state; 1911 - static bool efi_fpsimd_state_used; 1912 - static bool efi_sve_state_used; 1913 - static bool efi_sm_state; 1914 1950 1915 1951 /* 1916 1952 * EFI runtime services support functions ··· 1934 1976 if (may_use_simd()) { 1935 1977 kernel_neon_begin(&efi_fpsimd_state); 1936 1978 } else { 1937 - WARN_ON(preemptible()); 1938 - 1939 1979 /* 1940 - * If !efi_sve_state, SVE can't be in use yet and doesn't need 1941 - * preserving: 1980 + * We are running in hardirq or NMI context, and the only 1981 + * legitimate case where this might happen is when EFI pstore 1982 + * is attempting to record the system's dying gasps into EFI 1983 + * variables. This could be due to an oops, a panic or a call 1984 + * to emergency_restart(), and in none of those cases, we can 1985 + * expect the current task to ever return to user space again, 1986 + * or for the kernel to resume any normal execution, for that 1987 + * matter (an oops in hardirq context triggers a panic too). 1988 + * 1989 + * Therefore, there is no point in attempting to preserve any 1990 + * SVE/SME state here. On the off chance that we might have 1991 + * ended up here for a different reason inadvertently, kill the 1992 + * task and preserve/restore the base FP/SIMD state, which 1993 + * might belong to kernel mode FP/SIMD. 1942 1994 */ 1943 - if (system_supports_sve() && efi_sve_state != NULL) { 1944 - bool ffr = true; 1945 - u64 svcr; 1946 - 1947 - efi_sve_state_used = true; 1948 - 1949 - if (system_supports_sme()) { 1950 - svcr = read_sysreg_s(SYS_SVCR); 1951 - 1952 - efi_sm_state = svcr & SVCR_SM_MASK; 1953 - 1954 - /* 1955 - * Unless we have FA64 FFR does not 1956 - * exist in streaming mode. 1957 - */ 1958 - if (!system_supports_fa64()) 1959 - ffr = !(svcr & SVCR_SM_MASK); 1960 - } 1961 - 1962 - sve_save_state(efi_sve_state + sve_ffr_offset(sve_max_vl()), 1963 - &efi_fpsimd_state.fpsr, ffr); 1964 - 1965 - if (system_supports_sme()) 1966 - sysreg_clear_set_s(SYS_SVCR, 1967 - SVCR_SM_MASK, 0); 1968 - 1969 - } else { 1970 - fpsimd_save_state(&efi_fpsimd_state); 1971 - } 1972 - 1973 - efi_fpsimd_state_used = true; 1995 + pr_warn_ratelimited("Calling EFI runtime from %s context\n", 1996 + in_nmi() ? "NMI" : "hardirq"); 1997 + force_signal_inject(SIGKILL, SI_KERNEL, 0, 0); 1998 + fpsimd_save_state(&efi_fpsimd_state); 1974 1999 } 1975 2000 } 1976 2001 ··· 1965 2024 if (!system_supports_fpsimd()) 1966 2025 return; 1967 2026 1968 - if (!efi_fpsimd_state_used) { 2027 + if (may_use_simd()) { 1969 2028 kernel_neon_end(&efi_fpsimd_state); 1970 2029 } else { 1971 - if (system_supports_sve() && efi_sve_state_used) { 1972 - bool ffr = true; 1973 - 1974 - /* 1975 - * Restore streaming mode; EFI calls are 1976 - * normal function calls so should not return in 1977 - * streaming mode. 1978 - */ 1979 - if (system_supports_sme()) { 1980 - if (efi_sm_state) { 1981 - sysreg_clear_set_s(SYS_SVCR, 1982 - 0, 1983 - SVCR_SM_MASK); 1984 - 1985 - /* 1986 - * Unless we have FA64 FFR does not 1987 - * exist in streaming mode. 1988 - */ 1989 - if (!system_supports_fa64()) 1990 - ffr = false; 1991 - } 1992 - } 1993 - 1994 - sve_load_state(efi_sve_state + sve_ffr_offset(sve_max_vl()), 1995 - &efi_fpsimd_state.fpsr, ffr); 1996 - 1997 - efi_sve_state_used = false; 1998 - } else { 1999 - fpsimd_load_state(&efi_fpsimd_state); 2000 - } 2001 - 2002 - efi_fpsimd_state_used = false; 2030 + fpsimd_load_state(&efi_fpsimd_state); 2003 2031 } 2004 2032 } 2005 2033
+1
arch/arm64/kernel/process.c
··· 292 292 current->thread.gcs_base = 0; 293 293 current->thread.gcs_size = 0; 294 294 current->thread.gcs_el0_mode = 0; 295 + current->thread.gcs_el0_locked = 0; 295 296 write_sysreg_s(GCSCRE0_EL1_nTR, SYS_GCSCRE0_EL1); 296 297 write_sysreg_s(0, SYS_GCSPR_EL0); 297 298 }
+16 -17
arch/arm64/mm/mmu.c
··· 767 767 return rodata_full || arm64_kfence_can_set_direct_map() || is_realm_world(); 768 768 } 769 769 770 - static inline bool split_leaf_mapping_possible(void) 771 - { 772 - /* 773 - * !BBML2_NOABORT systems should never run into scenarios where we would 774 - * have to split. So exit early and let calling code detect it and raise 775 - * a warning. 776 - */ 777 - if (!system_supports_bbml2_noabort()) 778 - return false; 779 - return !force_pte_mapping(); 780 - } 781 - 782 770 static DEFINE_MUTEX(pgtable_split_lock); 783 771 784 772 int split_kernel_leaf_mapping(unsigned long start, unsigned long end) ··· 774 786 int ret; 775 787 776 788 /* 777 - * Exit early if the region is within a pte-mapped area or if we can't 778 - * split. For the latter case, the permission change code will raise a 779 - * warning if not already pte-mapped. 789 + * !BBML2_NOABORT systems should not be trying to change permissions on 790 + * anything that is not pte-mapped in the first place. Just return early 791 + * and let the permission change code raise a warning if not already 792 + * pte-mapped. 780 793 */ 781 - if (!split_leaf_mapping_possible() || is_kfence_address((void *)start)) 794 + if (!system_supports_bbml2_noabort()) 795 + return 0; 796 + 797 + /* 798 + * If the region is within a pte-mapped area, there is no need to try to 799 + * split. Additionally, CONFIG_DEBUG_PAGEALLOC and CONFIG_KFENCE may 800 + * change permissions from atomic context so for those cases (which are 801 + * always pte-mapped), we must not go any further because taking the 802 + * mutex below may sleep. 803 + */ 804 + if (force_pte_mapping() || is_kfence_address((void *)start)) 782 805 return 0; 783 806 784 807 /* ··· 1088 1089 int ret; 1089 1090 1090 1091 /* Exit early if we know the linear map is already pte-mapped. */ 1091 - if (!split_leaf_mapping_possible()) 1092 + if (force_pte_mapping()) 1092 1093 return true; 1093 1094 1094 1095 /* Kfence pool is already pte-mapped for the early init case. */
+1 -1
arch/arm64/net/bpf_jit_comp.c
··· 1004 1004 arm64_get_spectre_v2_state() == SPECTRE_VULNERABLE) 1005 1005 return; 1006 1006 1007 - if (capable(CAP_SYS_ADMIN)) 1007 + if (ns_capable_noaudit(&init_user_ns, CAP_SYS_ADMIN)) 1008 1008 return; 1009 1009 1010 1010 if (supports_clearbhb(SCOPE_SYSTEM)) {
+1 -2
arch/mips/alchemy/common/setup.c
··· 94 94 return phys_addr; 95 95 } 96 96 97 - static inline unsigned long io_remap_pfn_range_pfn(unsigned long pfn, 98 - unsigned long size) 97 + unsigned long io_remap_pfn_range_pfn(unsigned long pfn, unsigned long size) 99 98 { 100 99 phys_addr_t phys_addr = fixup_bigphys_addr(pfn << PAGE_SHIFT, size); 101 100
+2 -1
arch/mips/sgi-ip22/ip22-gio.c
··· 372 372 gio_dev->resource.flags = IORESOURCE_MEM; 373 373 gio_dev->irq = irq; 374 374 dev_set_name(&gio_dev->dev, "%d", slotno); 375 - gio_device_register(gio_dev); 375 + if (gio_device_register(gio_dev)) 376 + gio_dev_put(gio_dev); 376 377 } else 377 378 printk(KERN_INFO "GIO: slot %d : Empty\n", slotno); 378 379 }
+1
arch/s390/include/uapi/asm/ipl.h
··· 15 15 #define IPL_PL_FLAG_IPLPS 0x80 16 16 #define IPL_PL_FLAG_SIPL 0x40 17 17 #define IPL_PL_FLAG_IPLSR 0x20 18 + #define IPL_PL_FLAG_SBP 0x10 18 19 19 20 /* IPL Parameter Block header */ 20 21 struct ipl_pb_hdr {
+36 -12
arch/s390/kernel/ipl.c
··· 262 262 sys_##_prefix##_##_name##_show, \ 263 263 sys_##_prefix##_##_name##_store) 264 264 265 + #define DEFINE_IPL_ATTR_BOOTPROG_RW(_prefix, _name, _fmt_out, _fmt_in, _hdr, _value) \ 266 + IPL_ATTR_SHOW_FN(_prefix, _name, _fmt_out, (unsigned long long) _value) \ 267 + static ssize_t sys_##_prefix##_##_name##_store(struct kobject *kobj, \ 268 + struct kobj_attribute *attr, \ 269 + const char *buf, size_t len) \ 270 + { \ 271 + unsigned long long value; \ 272 + if (sscanf(buf, _fmt_in, &value) != 1) \ 273 + return -EINVAL; \ 274 + (_value) = value; \ 275 + (_hdr).flags &= ~IPL_PL_FLAG_SBP; \ 276 + return len; \ 277 + } \ 278 + static struct kobj_attribute sys_##_prefix##_##_name##_attr = \ 279 + __ATTR(_name, 0644, \ 280 + sys_##_prefix##_##_name##_show, \ 281 + sys_##_prefix##_##_name##_store) 282 + 265 283 #define DEFINE_IPL_ATTR_STR_RW(_prefix, _name, _fmt_out, _fmt_in, _value)\ 266 284 IPL_ATTR_SHOW_FN(_prefix, _name, _fmt_out, _value) \ 267 285 static ssize_t sys_##_prefix##_##_name##_store(struct kobject *kobj, \ ··· 836 818 reipl_block_fcp->fcp.wwpn); 837 819 DEFINE_IPL_ATTR_RW(reipl_fcp, lun, "0x%016llx\n", "%llx\n", 838 820 reipl_block_fcp->fcp.lun); 839 - DEFINE_IPL_ATTR_RW(reipl_fcp, bootprog, "%lld\n", "%lld\n", 840 - reipl_block_fcp->fcp.bootprog); 841 821 DEFINE_IPL_ATTR_RW(reipl_fcp, br_lba, "%lld\n", "%lld\n", 842 822 reipl_block_fcp->fcp.br_lba); 843 823 DEFINE_IPL_ATTR_RW(reipl_fcp, device, "0.0.%04llx\n", "0.0.%llx\n", 844 824 reipl_block_fcp->fcp.devno); 825 + DEFINE_IPL_ATTR_BOOTPROG_RW(reipl_fcp, bootprog, "%lld\n", "%lld\n", 826 + reipl_block_fcp->hdr, 827 + reipl_block_fcp->fcp.bootprog); 845 828 846 829 static void reipl_get_ascii_loadparm(char *loadparm, 847 830 struct ipl_parameter_block *ibp) ··· 961 942 reipl_block_nvme->nvme.fid); 962 943 DEFINE_IPL_ATTR_RW(reipl_nvme, nsid, "0x%08llx\n", "%llx\n", 963 944 reipl_block_nvme->nvme.nsid); 964 - DEFINE_IPL_ATTR_RW(reipl_nvme, bootprog, "%lld\n", "%lld\n", 965 - reipl_block_nvme->nvme.bootprog); 966 945 DEFINE_IPL_ATTR_RW(reipl_nvme, br_lba, "%lld\n", "%lld\n", 967 946 reipl_block_nvme->nvme.br_lba); 947 + DEFINE_IPL_ATTR_BOOTPROG_RW(reipl_nvme, bootprog, "%lld\n", "%lld\n", 948 + reipl_block_nvme->hdr, 949 + reipl_block_nvme->nvme.bootprog); 968 950 969 951 static struct attribute *reipl_nvme_attrs[] = { 970 952 &sys_reipl_nvme_fid_attr.attr, ··· 1058 1038 }; 1059 1039 1060 1040 DEFINE_IPL_CCW_ATTR_RW(reipl_eckd, device, reipl_block_eckd->eckd); 1061 - DEFINE_IPL_ATTR_RW(reipl_eckd, bootprog, "%lld\n", "%lld\n", 1062 - reipl_block_eckd->eckd.bootprog); 1041 + DEFINE_IPL_ATTR_BOOTPROG_RW(reipl_eckd, bootprog, "%lld\n", "%lld\n", 1042 + reipl_block_eckd->hdr, 1043 + reipl_block_eckd->eckd.bootprog); 1063 1044 1064 1045 static struct attribute *reipl_eckd_attrs[] = { 1065 1046 &sys_reipl_eckd_device_attr.attr, ··· 1588 1567 dump_block_fcp->fcp.wwpn); 1589 1568 DEFINE_IPL_ATTR_RW(dump_fcp, lun, "0x%016llx\n", "%llx\n", 1590 1569 dump_block_fcp->fcp.lun); 1591 - DEFINE_IPL_ATTR_RW(dump_fcp, bootprog, "%lld\n", "%lld\n", 1592 - dump_block_fcp->fcp.bootprog); 1593 1570 DEFINE_IPL_ATTR_RW(dump_fcp, br_lba, "%lld\n", "%lld\n", 1594 1571 dump_block_fcp->fcp.br_lba); 1595 1572 DEFINE_IPL_ATTR_RW(dump_fcp, device, "0.0.%04llx\n", "0.0.%llx\n", 1596 1573 dump_block_fcp->fcp.devno); 1574 + DEFINE_IPL_ATTR_BOOTPROG_RW(dump_fcp, bootprog, "%lld\n", "%lld\n", 1575 + dump_block_fcp->hdr, 1576 + dump_block_fcp->fcp.bootprog); 1597 1577 1598 1578 DEFINE_IPL_ATTR_SCP_DATA_RW(dump_fcp, dump_block_fcp->hdr, 1599 1579 dump_block_fcp->fcp, ··· 1626 1604 dump_block_nvme->nvme.fid); 1627 1605 DEFINE_IPL_ATTR_RW(dump_nvme, nsid, "0x%08llx\n", "%llx\n", 1628 1606 dump_block_nvme->nvme.nsid); 1629 - DEFINE_IPL_ATTR_RW(dump_nvme, bootprog, "%lld\n", "%llx\n", 1630 - dump_block_nvme->nvme.bootprog); 1631 1607 DEFINE_IPL_ATTR_RW(dump_nvme, br_lba, "%lld\n", "%llx\n", 1632 1608 dump_block_nvme->nvme.br_lba); 1609 + DEFINE_IPL_ATTR_BOOTPROG_RW(dump_nvme, bootprog, "%lld\n", "%llx\n", 1610 + dump_block_nvme->hdr, 1611 + dump_block_nvme->nvme.bootprog); 1633 1612 1634 1613 DEFINE_IPL_ATTR_SCP_DATA_RW(dump_nvme, dump_block_nvme->hdr, 1635 1614 dump_block_nvme->nvme, ··· 1658 1635 1659 1636 /* ECKD dump device attributes */ 1660 1637 DEFINE_IPL_CCW_ATTR_RW(dump_eckd, device, dump_block_eckd->eckd); 1661 - DEFINE_IPL_ATTR_RW(dump_eckd, bootprog, "%lld\n", "%llx\n", 1662 - dump_block_eckd->eckd.bootprog); 1638 + DEFINE_IPL_ATTR_BOOTPROG_RW(dump_eckd, bootprog, "%lld\n", "%llx\n", 1639 + dump_block_eckd->hdr, 1640 + dump_block_eckd->eckd.bootprog); 1663 1641 1664 1642 IPL_ATTR_BR_CHR_SHOW_FN(dump, dump_block_eckd->eckd); 1665 1643 IPL_ATTR_BR_CHR_STORE_FN(dump, dump_block_eckd->eckd);
+2 -16
arch/s390/kernel/stacktrace.c
··· 104 104 struct stack_frame_vdso_wrapper __user *sf_vdso; 105 105 struct stack_frame_user __user *sf; 106 106 unsigned long ip, sp; 107 - bool first = true; 108 107 109 108 if (!current->mm) 110 109 return; ··· 132 133 if (__get_user(ip, &sf->gprs[8])) 133 134 break; 134 135 } 135 - /* Sanity check: ABI requires SP to be 8 byte aligned. */ 136 - if (sp & 0x7) 136 + /* Validate SP and RA (ABI requires SP to be 8 byte aligned). */ 137 + if (sp & 0x7 || ip_invalid(ip)) 137 138 break; 138 - if (ip_invalid(ip)) { 139 - /* 140 - * If the instruction address is invalid, and this 141 - * is the first stack frame, assume r14 has not 142 - * been written to the stack yet. Otherwise exit. 143 - */ 144 - if (!first) 145 - break; 146 - ip = regs->gprs[14]; 147 - if (ip_invalid(ip)) 148 - break; 149 - } 150 139 if (!store_ip(consume_entry, cookie, entry, perf, ip)) 151 140 break; 152 - first = false; 153 141 } 154 142 pagefault_enable(); 155 143 }
+6 -1
arch/s390/pci/pci.c
··· 961 961 } 962 962 963 963 void zpci_release_device(struct kref *kref) 964 + __releases(&zpci_list_lock) 964 965 { 965 966 struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref); 966 967 ··· 1149 1148 1150 1149 int zpci_scan_devices(void) 1151 1150 { 1151 + struct zpci_bus *zbus; 1152 1152 LIST_HEAD(scan_list); 1153 1153 int rc; 1154 1154 ··· 1158 1156 return rc; 1159 1157 1160 1158 zpci_add_devices(&scan_list); 1161 - zpci_bus_scan_busses(); 1159 + zpci_bus_for_each(zbus) { 1160 + zpci_bus_scan_bus(zbus); 1161 + cond_resched(); 1162 + } 1162 1163 return 0; 1163 1164 } 1164 1165
+71 -27
arch/s390/pci/pci_bus.c
··· 153 153 return ret; 154 154 } 155 155 156 - /* zpci_bus_scan_busses - Scan all registered busses 157 - * 158 - * Scan all available zbusses 159 - * 160 - */ 161 - void zpci_bus_scan_busses(void) 162 - { 163 - struct zpci_bus *zbus = NULL; 164 - 165 - mutex_lock(&zbus_list_lock); 166 - list_for_each_entry(zbus, &zbus_list, bus_next) { 167 - zpci_bus_scan_bus(zbus); 168 - cond_resched(); 169 - } 170 - mutex_unlock(&zbus_list_lock); 171 - } 172 - 173 156 static bool zpci_bus_is_multifunction_root(struct zpci_dev *zdev) 174 157 { 175 158 return !s390_pci_no_rid && zdev->rid_available && ··· 205 222 return -ENOMEM; 206 223 } 207 224 208 - static void zpci_bus_release(struct kref *kref) 225 + /** 226 + * zpci_bus_release - Un-initialize resources associated with the zbus and 227 + * free memory 228 + * @kref: refcount * that is part of struct zpci_bus 229 + * 230 + * MUST be called with `zbus_list_lock` held, but the lock is released during 231 + * run of the function. 232 + */ 233 + static inline void zpci_bus_release(struct kref *kref) 234 + __releases(&zbus_list_lock) 209 235 { 210 236 struct zpci_bus *zbus = container_of(kref, struct zpci_bus, kref); 237 + 238 + lockdep_assert_held(&zbus_list_lock); 239 + 240 + list_del(&zbus->bus_next); 241 + mutex_unlock(&zbus_list_lock); 242 + 243 + /* 244 + * At this point no-one should see this object, or be able to get a new 245 + * reference to it. 246 + */ 211 247 212 248 if (zbus->bus) { 213 249 pci_lock_rescan_remove(); ··· 239 237 pci_unlock_rescan_remove(); 240 238 } 241 239 242 - mutex_lock(&zbus_list_lock); 243 - list_del(&zbus->bus_next); 244 - mutex_unlock(&zbus_list_lock); 245 240 zpci_remove_parent_msi_domain(zbus); 246 241 kfree(zbus); 247 242 } 248 243 249 - static void zpci_bus_put(struct zpci_bus *zbus) 244 + static inline void __zpci_bus_get(struct zpci_bus *zbus) 250 245 { 251 - kref_put(&zbus->kref, zpci_bus_release); 246 + lockdep_assert_held(&zbus_list_lock); 247 + kref_get(&zbus->kref); 248 + } 249 + 250 + static inline void zpci_bus_put(struct zpci_bus *zbus) 251 + { 252 + kref_put_mutex(&zbus->kref, zpci_bus_release, &zbus_list_lock); 252 253 } 253 254 254 255 static struct zpci_bus *zpci_bus_get(int topo, bool topo_is_tid) ··· 263 258 if (!zbus->multifunction) 264 259 continue; 265 260 if (topo_is_tid == zbus->topo_is_tid && topo == zbus->topo) { 266 - kref_get(&zbus->kref); 261 + __zpci_bus_get(zbus); 267 262 goto out_unlock; 268 263 } 269 264 } ··· 271 266 out_unlock: 272 267 mutex_unlock(&zbus_list_lock); 273 268 return zbus; 269 + } 270 + 271 + /** 272 + * zpci_bus_get_next - get the next zbus object from given position in the list 273 + * @pos: current position/cursor in the global zbus list 274 + * 275 + * Acquires and releases references as the cursor iterates (might also free/ 276 + * release the cursor). Is tolerant of concurrent operations on the list. 277 + * 278 + * To begin the iteration, set *@pos to %NULL before calling the function. 279 + * 280 + * *@pos is set to %NULL in cases where either the list is empty, or *@pos is 281 + * the last element in the list. 282 + * 283 + * Context: Process context. May sleep. 284 + */ 285 + void zpci_bus_get_next(struct zpci_bus **pos) 286 + { 287 + struct zpci_bus *curp = *pos, *next = NULL; 288 + 289 + mutex_lock(&zbus_list_lock); 290 + if (curp) 291 + next = list_next_entry(curp, bus_next); 292 + else 293 + next = list_first_entry(&zbus_list, typeof(*curp), bus_next); 294 + 295 + if (list_entry_is_head(next, &zbus_list, bus_next)) 296 + next = NULL; 297 + 298 + if (next) 299 + __zpci_bus_get(next); 300 + 301 + *pos = next; 302 + mutex_unlock(&zbus_list_lock); 303 + 304 + /* zpci_bus_put() might drop refcount to 0 and locks zbus_list_lock */ 305 + if (curp) 306 + zpci_bus_put(curp); 274 307 } 275 308 276 309 static struct zpci_bus *zpci_bus_alloc(int topo, bool topo_is_tid) ··· 322 279 zbus->topo = topo; 323 280 zbus->topo_is_tid = topo_is_tid; 324 281 INIT_LIST_HEAD(&zbus->bus_next); 325 - mutex_lock(&zbus_list_lock); 326 - list_add_tail(&zbus->bus_next, &zbus_list); 327 - mutex_unlock(&zbus_list_lock); 328 282 329 283 kref_init(&zbus->kref); 330 284 INIT_LIST_HEAD(&zbus->resources); ··· 330 290 zbus->bus_resource.end = ZPCI_BUS_NR; 331 291 zbus->bus_resource.flags = IORESOURCE_BUS; 332 292 pci_add_resource(&zbus->resources, &zbus->bus_resource); 293 + 294 + mutex_lock(&zbus_list_lock); 295 + list_add_tail(&zbus->bus_next, &zbus_list); 296 + mutex_unlock(&zbus_list_lock); 333 297 334 298 return zbus; 335 299 }
+14 -1
arch/s390/pci/pci_bus.h
··· 15 15 void zpci_bus_device_unregister(struct zpci_dev *zdev); 16 16 17 17 int zpci_bus_scan_bus(struct zpci_bus *zbus); 18 - void zpci_bus_scan_busses(void); 18 + void zpci_bus_get_next(struct zpci_bus **pos); 19 + 20 + /** 21 + * zpci_bus_for_each - iterate over all the registered zbus objects 22 + * @pos: a struct zpci_bus * as cursor 23 + * 24 + * Acquires and releases references as the cursor iterates over the registered 25 + * objects. Is tolerant against concurrent removals of objects. 26 + * 27 + * Context: Process context. May sleep. 28 + */ 29 + #define zpci_bus_for_each(pos) \ 30 + for ((pos) = NULL, zpci_bus_get_next(&(pos)); (pos) != NULL; \ 31 + zpci_bus_get_next(&(pos))) 19 32 20 33 int zpci_bus_scan_device(struct zpci_dev *zdev); 21 34 void zpci_bus_remove_device(struct zpci_dev *zdev, bool set_error);
+1 -1
arch/x86/include/asm/bug.h
··· 15 15 /* 16 16 * Despite that some emulators terminate on UD2, we use it for WARN(). 17 17 */ 18 - #define ASM_UD2 _ASM_BYTES(0x0f, 0x0b) 18 + #define ASM_UD2 __ASM_FORM(ud2) 19 19 #define INSN_UD2 0x0b0f 20 20 #define LEN_UD2 2 21 21
+7
arch/x86/include/asm/irq_remapping.h
··· 87 87 } 88 88 89 89 #endif /* CONFIG_IRQ_REMAP */ 90 + 91 + #ifdef CONFIG_X86_POSTED_MSI 92 + void intel_ack_posted_msi_irq(struct irq_data *irqd); 93 + #else 94 + #define intel_ack_posted_msi_irq NULL 95 + #endif 96 + 90 97 #endif /* __X86_IRQ_REMAPPING_H */
+1 -1
arch/x86/include/asm/irqflags.h
··· 25 25 */ 26 26 asm volatile("# __raw_save_flags\n\t" 27 27 "pushf ; pop %0" 28 - : "=rm" (flags) 28 + : ASM_OUTPUT_RM (flags) 29 29 : /* no input */ 30 30 : "memory"); 31 31
+1 -1
arch/x86/include/asm/uv/bios.h
··· 122 122 struct { 123 123 u32 type:8; /* type of entry */ 124 124 u32 offset:24; /* byte offset from struct start to entry */ 125 - } entry[1]; /* additional entries follow */ 125 + } entry[]; /* additional entries follow */ 126 126 }; 127 127 extern struct uv_systab *uv_systab; 128 128
+1 -1
arch/x86/kernel/cpu/sgx/ioctl.c
··· 242 242 /* 243 243 * If the caller requires measurement of the page as a proof for the content, 244 244 * use EEXTEND to add a measurement for 256 bytes of the page. Repeat this 245 - * operation until the entire page is measured." 245 + * operation until the entire page is measured. 246 246 */ 247 247 static int __sgx_encl_extend(struct sgx_encl *encl, 248 248 struct sgx_epc_page *epc_page)
+2 -2
arch/x86/kernel/fpu/xstate.c
··· 1946 1946 }; 1947 1947 1948 1948 if (!dump_emit(cprm, &xc, sizeof(xc))) 1949 - return 0; 1949 + return -1; 1950 1950 1951 1951 num_records++; 1952 1952 } ··· 1984 1984 return 1; 1985 1985 1986 1986 num_records = dump_xsave_layout_desc(cprm); 1987 - if (!num_records) 1987 + if (num_records < 0) 1988 1988 return 1; 1989 1989 1990 1990 /* Total size should be equal to the number of records */
+23
arch/x86/kernel/irq.c
··· 397 397 398 398 /* Posted Interrupt Descriptors for coalesced MSIs to be posted */ 399 399 DEFINE_PER_CPU_ALIGNED(struct pi_desc, posted_msi_pi_desc); 400 + static DEFINE_PER_CPU_CACHE_HOT(bool, posted_msi_handler_active); 400 401 401 402 void intel_posted_msi_init(void) 402 403 { ··· 413 412 apic_id = this_cpu_read(x86_cpu_to_apicid); 414 413 destination = x2apic_enabled() ? apic_id : apic_id << 8; 415 414 this_cpu_write(posted_msi_pi_desc.ndst, destination); 415 + } 416 + 417 + void intel_ack_posted_msi_irq(struct irq_data *irqd) 418 + { 419 + irq_move_irq(irqd); 420 + 421 + /* 422 + * Handle the rare case that irq_retrigger() raised the actual 423 + * assigned vector on the target CPU, which means that it was not 424 + * invoked via the posted MSI handler below. In that case APIC EOI 425 + * is required as otherwise the ISR entry becomes stale and lower 426 + * priority interrupts are never going to be delivered after that. 427 + * 428 + * If the posted handler invoked the device interrupt handler then 429 + * the EOI would be premature because it would acknowledge the 430 + * posted vector. 431 + */ 432 + if (unlikely(!__this_cpu_read(posted_msi_handler_active))) 433 + apic_eoi(); 416 434 } 417 435 418 436 static __always_inline bool handle_pending_pir(unsigned long *pir, struct pt_regs *regs) ··· 466 446 467 447 pid = this_cpu_ptr(&posted_msi_pi_desc); 468 448 449 + /* Mark the handler active for intel_ack_posted_msi_irq() */ 450 + __this_cpu_write(posted_msi_handler_active, true); 469 451 inc_irq_stat(posted_msi_notification_count); 470 452 irq_enter(); 471 453 ··· 496 474 497 475 apic_eoi(); 498 476 irq_exit(); 477 + __this_cpu_write(posted_msi_handler_active, false); 499 478 set_irq_regs(old_regs); 500 479 } 501 480 #endif /* X86_POSTED_MSI */
+27 -12
arch/x86/kernel/unwind_orc.c
··· 2 2 #include <linux/objtool.h> 3 3 #include <linux/module.h> 4 4 #include <linux/sort.h> 5 + #include <linux/bpf.h> 5 6 #include <asm/ptrace.h> 6 7 #include <asm/stacktrace.h> 7 8 #include <asm/unwind.h> ··· 173 172 } 174 173 #endif 175 174 175 + /* Fake frame pointer entry -- used as a fallback for generated code */ 176 + static struct orc_entry orc_fp_entry = { 177 + .type = ORC_TYPE_CALL, 178 + .sp_reg = ORC_REG_BP, 179 + .sp_offset = 16, 180 + .bp_reg = ORC_REG_PREV_SP, 181 + .bp_offset = -16, 182 + }; 183 + 184 + static struct orc_entry *orc_bpf_find(unsigned long ip) 185 + { 186 + #ifdef CONFIG_BPF_JIT 187 + if (bpf_has_frame_pointer(ip)) 188 + return &orc_fp_entry; 189 + #endif 190 + 191 + return NULL; 192 + } 193 + 176 194 /* 177 195 * If we crash with IP==0, the last successfully executed instruction 178 196 * was probably an indirect function call with a NULL function pointer, ··· 204 184 .sp_reg = ORC_REG_SP, 205 185 .bp_reg = ORC_REG_UNDEFINED, 206 186 .type = ORC_TYPE_CALL 207 - }; 208 - 209 - /* Fake frame pointer entry -- used as a fallback for generated code */ 210 - static struct orc_entry orc_fp_entry = { 211 - .type = ORC_TYPE_CALL, 212 - .sp_reg = ORC_REG_BP, 213 - .sp_offset = 16, 214 - .bp_reg = ORC_REG_PREV_SP, 215 - .bp_offset = -16, 216 187 }; 217 188 218 189 static struct orc_entry *orc_find(unsigned long ip) ··· 246 235 247 236 /* Module lookup: */ 248 237 orc = orc_module_find(ip); 238 + if (orc) 239 + return orc; 240 + 241 + /* BPF lookup: */ 242 + orc = orc_bpf_find(ip); 249 243 if (orc) 250 244 return orc; 251 245 ··· 511 495 if (!orc) { 512 496 /* 513 497 * As a fallback, try to assume this code uses a frame pointer. 514 - * This is useful for generated code, like BPF, which ORC 515 - * doesn't know about. This is just a guess, so the rest of 516 - * the unwind is no longer considered reliable. 498 + * This is just a guess, so the rest of the unwind is no longer 499 + * considered reliable. 517 500 */ 518 501 orc = &orc_fp_entry; 519 502 state->error = true;
+9 -2
arch/x86/kvm/cpuid.c
··· 510 510 int r; 511 511 512 512 /* 513 + * Apply pending runtime CPUID updates to the current CPUID entries to 514 + * avoid false positives due to mismatches on KVM-owned feature flags. 515 + */ 516 + if (vcpu->arch.cpuid_dynamic_bits_dirty) 517 + kvm_update_cpuid_runtime(vcpu); 518 + 519 + /* 513 520 * Swap the existing (old) entries with the incoming (new) entries in 514 521 * order to massage the new entries, e.g. to account for dynamic bits 515 - * that KVM controls, without clobbering the current guest CPUID, which 516 - * KVM needs to preserve in order to unwind on failure. 522 + * that KVM controls, without losing the current guest CPUID, which KVM 523 + * needs to preserve in order to unwind on failure. 517 524 * 518 525 * Similarly, save the vCPU's current cpu_caps so that the capabilities 519 526 * can be updated alongside the CPUID entries when performing runtime
+2 -2
arch/x86/kvm/svm/nested.c
··· 985 985 if (!nested_vmcb_check_save(vcpu) || 986 986 !nested_vmcb_check_controls(vcpu)) { 987 987 vmcb12->control.exit_code = SVM_EXIT_ERR; 988 - vmcb12->control.exit_code_hi = 0; 988 + vmcb12->control.exit_code_hi = -1u; 989 989 vmcb12->control.exit_info_1 = 0; 990 990 vmcb12->control.exit_info_2 = 0; 991 991 goto out; ··· 1018 1018 svm->soft_int_injected = false; 1019 1019 1020 1020 svm->vmcb->control.exit_code = SVM_EXIT_ERR; 1021 - svm->vmcb->control.exit_code_hi = 0; 1021 + svm->vmcb->control.exit_code_hi = -1u; 1022 1022 svm->vmcb->control.exit_info_1 = 0; 1023 1023 svm->vmcb->control.exit_info_2 = 0; 1024 1024
+2
arch/x86/kvm/svm/svm.c
··· 2443 2443 2444 2444 if (cr0 ^ val) { 2445 2445 svm->vmcb->control.exit_code = SVM_EXIT_CR0_SEL_WRITE; 2446 + svm->vmcb->control.exit_code_hi = 0; 2446 2447 ret = (nested_svm_exit_handled(svm) == NESTED_EXIT_DONE); 2447 2448 } 2448 2449 ··· 4618 4617 if (static_cpu_has(X86_FEATURE_NRIPS)) 4619 4618 vmcb->control.next_rip = info->next_rip; 4620 4619 vmcb->control.exit_code = icpt_info.exit_code; 4620 + vmcb->control.exit_code_hi = 0; 4621 4621 vmexit = nested_svm_exit_handled(svm); 4622 4622 4623 4623 ret = (vmexit == NESTED_EXIT_DONE) ? X86EMUL_INTERCEPTED
+4 -3
arch/x86/kvm/svm/svm.h
··· 761 761 762 762 static inline int nested_svm_simple_vmexit(struct vcpu_svm *svm, u32 exit_code) 763 763 { 764 - svm->vmcb->control.exit_code = exit_code; 765 - svm->vmcb->control.exit_info_1 = 0; 766 - svm->vmcb->control.exit_info_2 = 0; 764 + svm->vmcb->control.exit_code = exit_code; 765 + svm->vmcb->control.exit_code_hi = 0; 766 + svm->vmcb->control.exit_info_1 = 0; 767 + svm->vmcb->control.exit_info_2 = 0; 767 768 return nested_svm_vmexit(svm); 768 769 } 769 770
+2 -1
arch/x86/kvm/vmx/nested.c
··· 19 19 #include "trace.h" 20 20 #include "vmx.h" 21 21 #include "smm.h" 22 + #include "x86_ops.h" 22 23 23 24 static bool __read_mostly enable_shadow_vmcs = 1; 24 25 module_param_named(enable_shadow_vmcs, enable_shadow_vmcs, bool, S_IRUGO); ··· 5166 5165 5167 5166 if (vmx->nested.update_vmcs01_apicv_status) { 5168 5167 vmx->nested.update_vmcs01_apicv_status = false; 5169 - kvm_make_request(KVM_REQ_APICV_UPDATE, vcpu); 5168 + vmx_refresh_apicv_exec_ctrl(vcpu); 5170 5169 } 5171 5170 5172 5171 if (vmx->nested.update_vmcs01_hwapic_isr) {
-9
arch/x86/kvm/vmx/vmx.c
··· 6937 6937 * VM-Exit, otherwise L1 with run with a stale SVI. 6938 6938 */ 6939 6939 if (is_guest_mode(vcpu)) { 6940 - /* 6941 - * KVM is supposed to forward intercepted L2 EOIs to L1 if VID 6942 - * is enabled in vmcs12; as above, the EOIs affect L2's vAPIC. 6943 - * Note, userspace can stuff state while L2 is active; assert 6944 - * that VID is disabled if and only if the vCPU is in KVM_RUN 6945 - * to avoid false positives if userspace is setting APIC state. 6946 - */ 6947 - WARN_ON_ONCE(vcpu->wants_to_run && 6948 - nested_cpu_has_vid(get_vmcs12(vcpu))); 6949 6940 to_vmx(vcpu)->nested.update_vmcs01_hwapic_isr = true; 6950 6941 return; 6951 6942 }
+7
arch/x86/kvm/x86.c
··· 10886 10886 * pending. At the same time, KVM_REQ_EVENT may not be set as APICv was 10887 10887 * still active when the interrupt got accepted. Make sure 10888 10888 * kvm_check_and_inject_events() is called to check for that. 10889 + * 10890 + * Update SVI when APICv gets enabled, otherwise SVI won't reflect the 10891 + * highest bit in vISR and the next accelerated EOI in the guest won't 10892 + * be virtualized correctly (the CPU uses SVI to determine which vISR 10893 + * vector to clear). 10889 10894 */ 10890 10895 if (!apic->apicv_active) 10891 10896 kvm_make_request(KVM_REQ_EVENT, vcpu); 10897 + else 10898 + kvm_apic_update_hwapic_isr(vcpu); 10892 10899 10893 10900 out: 10894 10901 preempt_enable();
+12
arch/x86/net/bpf_jit_comp.c
··· 1678 1678 emit_prologue(&prog, image, stack_depth, 1679 1679 bpf_prog_was_classic(bpf_prog), tail_call_reachable, 1680 1680 bpf_is_subprog(bpf_prog), bpf_prog->aux->exception_cb); 1681 + 1682 + bpf_prog->aux->ksym.fp_start = prog - temp; 1683 + 1681 1684 /* Exception callback will clobber callee regs for its own use, and 1682 1685 * restore the original callee regs from main prog's stack frame. 1683 1686 */ ··· 2739 2736 pop_r12(&prog); 2740 2737 } 2741 2738 EMIT1(0xC9); /* leave */ 2739 + bpf_prog->aux->ksym.fp_end = prog - temp; 2740 + 2742 2741 emit_return(&prog, image + addrs[i - 1] + (prog - temp)); 2743 2742 break; 2744 2743 ··· 3330 3325 } 3331 3326 EMIT1(0x55); /* push rbp */ 3332 3327 EMIT3(0x48, 0x89, 0xE5); /* mov rbp, rsp */ 3328 + if (im) 3329 + im->ksym.fp_start = prog - (u8 *)rw_image; 3330 + 3333 3331 if (!is_imm8(stack_size)) { 3334 3332 /* sub rsp, stack_size */ 3335 3333 EMIT3_off32(0x48, 0x81, 0xEC, stack_size); ··· 3470 3462 emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, -8); 3471 3463 3472 3464 emit_ldx(&prog, BPF_DW, BPF_REG_6, BPF_REG_FP, -rbx_off); 3465 + 3473 3466 EMIT1(0xC9); /* leave */ 3467 + if (im) 3468 + im->ksym.fp_end = prog - (u8 *)rw_image; 3469 + 3474 3470 if (flags & BPF_TRAMP_F_SKIP_FRAME) { 3475 3471 /* skip our return address and return to parent */ 3476 3472 EMIT4(0x48, 0x83, 0xC4, 8); /* add rsp, 8 */
+1 -1
arch/x86/xen/enlighten_pv.c
··· 108 108 * calls. 109 109 */ 110 110 DEFINE_PER_CPU(bool, xen_in_preemptible_hcall); 111 - EXPORT_SYMBOL_GPL(xen_in_preemptible_hcall); 111 + EXPORT_PER_CPU_SYMBOL_GPL(xen_in_preemptible_hcall); 112 112 113 113 /* 114 114 * In case of scheduling the flag must be cleared and restored after
+1 -1
block/bfq-iosched.c
··· 7181 7181 7182 7182 blk_stat_disable_accounting(bfqd->queue); 7183 7183 blk_queue_flag_clear(QUEUE_FLAG_DISABLE_WBT_DEF, bfqd->queue); 7184 - set_bit(ELEVATOR_FLAG_ENABLE_WBT_ON_EXIT, &e->flags); 7184 + wbt_enable_default(bfqd->queue->disk); 7185 7185 7186 7186 kfree(bfqd); 7187 7187 }
+9 -5
block/blk-settings.c
··· 161 161 return -EINVAL; 162 162 } 163 163 164 - if (bi->pi_tuple_size > bi->metadata_size) { 165 - pr_warn("pi_tuple_size (%u) exceeds metadata_size (%u)\n", 166 - bi->pi_tuple_size, 167 - bi->metadata_size); 164 + if (bi->pi_offset + bi->pi_tuple_size > bi->metadata_size) { 165 + pr_warn("pi_offset (%u) + pi_tuple_size (%u) exceeds metadata_size (%u)\n", 166 + bi->pi_offset, bi->pi_tuple_size, bi->metadata_size); 168 167 return -EINVAL; 169 168 } 170 169 ··· 193 194 break; 194 195 } 195 196 196 - if (!bi->interval_exp) 197 + if (!bi->interval_exp) { 197 198 bi->interval_exp = ilog2(lim->logical_block_size); 199 + } else if (bi->interval_exp < SECTOR_SHIFT || 200 + bi->interval_exp > ilog2(lim->logical_block_size)) { 201 + pr_warn("invalid interval_exp %u\n", bi->interval_exp); 202 + return -EINVAL; 203 + } 198 204 199 205 /* 200 206 * The PI generation / validation helpers do not expect intervals to
+1 -1
block/blk-sysfs.c
··· 932 932 elevator_set_default(q); 933 933 934 934 blk_queue_flag_set(QUEUE_FLAG_REGISTERED, q); 935 - wbt_enable_default(disk); 935 + wbt_init_enable_default(disk); 936 936 937 937 /* Now everything is ready and send out KOBJ_ADD uevent */ 938 938 kobject_uevent(&disk->queue_kobj, KOBJ_ADD);
+16 -4
block/blk-wbt.c
··· 699 699 /* 700 700 * Enable wbt if defaults are configured that way 701 701 */ 702 - void wbt_enable_default(struct gendisk *disk) 702 + static bool __wbt_enable_default(struct gendisk *disk) 703 703 { 704 704 struct request_queue *q = disk->queue; 705 705 struct rq_qos *rqos; ··· 716 716 if (enable && RQWB(rqos)->enable_state == WBT_STATE_OFF_DEFAULT) 717 717 RQWB(rqos)->enable_state = WBT_STATE_ON_DEFAULT; 718 718 mutex_unlock(&disk->rqos_state_mutex); 719 - return; 719 + return false; 720 720 } 721 721 mutex_unlock(&disk->rqos_state_mutex); 722 722 723 723 /* Queue not registered? Maybe shutting down... */ 724 724 if (!blk_queue_registered(q)) 725 - return; 725 + return false; 726 726 727 727 if (queue_is_mq(q) && enable) 728 - wbt_init(disk); 728 + return true; 729 + return false; 730 + } 731 + 732 + void wbt_enable_default(struct gendisk *disk) 733 + { 734 + __wbt_enable_default(disk); 729 735 } 730 736 EXPORT_SYMBOL_GPL(wbt_enable_default); 737 + 738 + void wbt_init_enable_default(struct gendisk *disk) 739 + { 740 + if (__wbt_enable_default(disk)) 741 + WARN_ON_ONCE(wbt_init(disk)); 742 + } 731 743 732 744 u64 wbt_default_latency_nsec(struct request_queue *q) 733 745 {
+5
block/blk-wbt.h
··· 5 5 #ifdef CONFIG_BLK_WBT 6 6 7 7 int wbt_init(struct gendisk *disk); 8 + void wbt_init_enable_default(struct gendisk *disk); 8 9 void wbt_disable_default(struct gendisk *disk); 9 10 void wbt_enable_default(struct gendisk *disk); 10 11 ··· 16 15 u64 wbt_default_latency_nsec(struct request_queue *); 17 16 18 17 #else 18 + 19 + static inline void wbt_init_enable_default(struct gendisk *disk) 20 + { 21 + } 19 22 20 23 static inline void wbt_disable_default(struct gendisk *disk) 21 24 {
-4
block/elevator.c
··· 633 633 .et = ctx->old->et, 634 634 .data = ctx->old->elevator_data 635 635 }; 636 - bool enable_wbt = test_bit(ELEVATOR_FLAG_ENABLE_WBT_ON_EXIT, 637 - &ctx->old->flags); 638 636 639 637 elv_unregister_queue(q, ctx->old); 640 638 blk_mq_free_sched_res(&res, ctx->old->type, q->tag_set); 641 639 kobject_put(&ctx->old->kobj); 642 - if (enable_wbt) 643 - wbt_enable_default(q->disk); 644 640 } 645 641 if (ctx->new) { 646 642 ret = elv_register_queue(q, ctx->new, !ctx->no_uevent);
-1
block/elevator.h
··· 156 156 157 157 #define ELEVATOR_FLAG_REGISTERED 0 158 158 #define ELEVATOR_FLAG_DYING 1 159 - #define ELEVATOR_FLAG_ENABLE_WBT_ON_EXIT 2 160 159 161 160 /* 162 161 * block elevator interface
+5 -4
block/ioctl.c
··· 442 442 if (copy_from_user(&read_keys, arg, sizeof(read_keys))) 443 443 return -EFAULT; 444 444 445 - keys_info_len = struct_size(keys_info, keys, read_keys.num_keys); 446 - if (keys_info_len == SIZE_MAX) 445 + if (read_keys.num_keys > PR_KEYS_MAX) 447 446 return -EINVAL; 448 447 449 - keys_info = kzalloc(keys_info_len, GFP_KERNEL); 448 + keys_info_len = struct_size(keys_info, keys, read_keys.num_keys); 449 + 450 + keys_info = kvzalloc(keys_info_len, GFP_KERNEL); 450 451 if (!keys_info) 451 452 return -ENOMEM; 452 453 ··· 474 473 if (copy_to_user(arg, &read_keys, sizeof(read_keys))) 475 474 ret = -EFAULT; 476 475 out: 477 - kfree(keys_info); 476 + kvfree(keys_info); 478 477 return ret; 479 478 } 480 479
+6
drivers/accel/amdxdna/aie2_pci.c
··· 17 17 #include <linux/iopoll.h> 18 18 #include <linux/pci.h> 19 19 #include <linux/xarray.h> 20 + #include <asm/hypervisor.h> 20 21 21 22 #include "aie2_msg_priv.h" 22 23 #include "aie2_pci.h" ··· 508 507 const struct firmware *fw; 509 508 unsigned long bars = 0; 510 509 int i, nvec, ret; 510 + 511 + if (!hypervisor_is_type(X86_HYPER_NATIVE)) { 512 + XDNA_ERR(xdna, "Running under hypervisor not supported"); 513 + return -EINVAL; 514 + } 511 515 512 516 ndev = drmm_kzalloc(&xdna->ddev, sizeof(*ndev), GFP_KERNEL); 513 517 if (!ndev)
+1 -1
drivers/acpi/acpi_pcc.c
··· 52 52 struct pcc_data *data; 53 53 struct acpi_pcc_info *ctx = handler_context; 54 54 struct pcc_mbox_chan *pcc_chan; 55 - static acpi_status ret; 55 + acpi_status ret; 56 56 57 57 data = kzalloc(sizeof(*data), GFP_KERNEL); 58 58 if (!data)
+2 -1
drivers/acpi/cppc_acpi.c
··· 1366 1366 /* Are any of the regs PCC ?*/ 1367 1367 if (CPC_IN_PCC(highest_reg) || CPC_IN_PCC(lowest_reg) || 1368 1368 CPC_IN_PCC(lowest_non_linear_reg) || CPC_IN_PCC(nominal_reg) || 1369 - CPC_IN_PCC(low_freq_reg) || CPC_IN_PCC(nom_freq_reg)) { 1369 + CPC_IN_PCC(low_freq_reg) || CPC_IN_PCC(nom_freq_reg) || 1370 + CPC_IN_PCC(guaranteed_reg)) { 1370 1371 if (pcc_ss_id < 0) { 1371 1372 pr_debug("Invalid pcc_ss_id\n"); 1372 1373 return -ENODEV;
+3
drivers/ata/libata-core.c
··· 4143 4143 { "ST3320[68]13AS", "SD1[5-9]", ATA_QUIRK_NONCQ | 4144 4144 ATA_QUIRK_FIRMWARE_WARN }, 4145 4145 4146 + /* Seagate disks with LPM issues */ 4147 + { "ST2000DM008-2FR102", NULL, ATA_QUIRK_NOLPM }, 4148 + 4146 4149 /* drives which fail FPDMA_AA activation (some may freeze afterwards) 4147 4150 the ST disks also have LPM issues */ 4148 4151 { "ST1000LM024 HN-M101MBB", NULL, ATA_QUIRK_BROKEN_FPDMA_AA |
+12 -10
drivers/base/power/runtime.c
··· 1868 1868 */ 1869 1869 void pm_runtime_reinit(struct device *dev) 1870 1870 { 1871 - if (!pm_runtime_enabled(dev)) { 1872 - if (dev->power.runtime_status == RPM_ACTIVE) 1873 - pm_runtime_set_suspended(dev); 1874 - if (dev->power.irq_safe) { 1875 - spin_lock_irq(&dev->power.lock); 1876 - dev->power.irq_safe = 0; 1877 - spin_unlock_irq(&dev->power.lock); 1878 - if (dev->parent) 1879 - pm_runtime_put(dev->parent); 1880 - } 1871 + if (pm_runtime_enabled(dev)) 1872 + return; 1873 + 1874 + if (dev->power.runtime_status == RPM_ACTIVE) 1875 + pm_runtime_set_suspended(dev); 1876 + 1877 + if (dev->power.irq_safe) { 1878 + spin_lock_irq(&dev->power.lock); 1879 + dev->power.irq_safe = 0; 1880 + spin_unlock_irq(&dev->power.lock); 1881 + if (dev->parent) 1882 + pm_runtime_put(dev->parent); 1881 1883 } 1882 1884 /* 1883 1885 * Clear power.needs_force_resume in case it has been set by
+13 -9
drivers/block/loop.c
··· 1082 1082 /* Order wrt reading lo_state in loop_validate_file(). */ 1083 1083 wmb(); 1084 1084 1085 - lo->lo_state = Lo_bound; 1085 + WRITE_ONCE(lo->lo_state, Lo_bound); 1086 1086 if (part_shift) 1087 1087 lo->lo_flags |= LO_FLAGS_PARTSCAN; 1088 1088 partscan = lo->lo_flags & LO_FLAGS_PARTSCAN; ··· 1179 1179 if (!part_shift) 1180 1180 set_bit(GD_SUPPRESS_PART_SCAN, &lo->lo_disk->state); 1181 1181 mutex_lock(&lo->lo_mutex); 1182 - lo->lo_state = Lo_unbound; 1182 + WRITE_ONCE(lo->lo_state, Lo_unbound); 1183 1183 mutex_unlock(&lo->lo_mutex); 1184 1184 1185 1185 /* ··· 1218 1218 1219 1219 lo->lo_flags |= LO_FLAGS_AUTOCLEAR; 1220 1220 if (disk_openers(lo->lo_disk) == 1) 1221 - lo->lo_state = Lo_rundown; 1221 + WRITE_ONCE(lo->lo_state, Lo_rundown); 1222 1222 loop_global_unlock(lo, true); 1223 1223 1224 1224 return 0; ··· 1743 1743 1744 1744 mutex_lock(&lo->lo_mutex); 1745 1745 if (lo->lo_state == Lo_bound && (lo->lo_flags & LO_FLAGS_AUTOCLEAR)) 1746 - lo->lo_state = Lo_rundown; 1746 + WRITE_ONCE(lo->lo_state, Lo_rundown); 1747 1747 1748 1748 need_clear = (lo->lo_state == Lo_rundown); 1749 1749 mutex_unlock(&lo->lo_mutex); ··· 1858 1858 1859 1859 blk_mq_start_request(rq); 1860 1860 1861 - if (lo->lo_state != Lo_bound) 1861 + if (data_race(READ_ONCE(lo->lo_state)) != Lo_bound) 1862 1862 return BLK_STS_IOERR; 1863 1863 1864 1864 switch (req_op(rq)) { ··· 2016 2016 lo->worker_tree = RB_ROOT; 2017 2017 INIT_LIST_HEAD(&lo->idle_worker_list); 2018 2018 timer_setup(&lo->timer, loop_free_idle_workers_timer, TIMER_DEFERRABLE); 2019 - lo->lo_state = Lo_unbound; 2019 + WRITE_ONCE(lo->lo_state, Lo_unbound); 2020 2020 2021 2021 err = mutex_lock_killable(&loop_ctl_mutex); 2022 2022 if (err) ··· 2174 2174 goto mark_visible; 2175 2175 } 2176 2176 /* Mark this loop device as no more bound, but not quite unbound yet */ 2177 - lo->lo_state = Lo_deleting; 2177 + WRITE_ONCE(lo->lo_state, Lo_deleting); 2178 2178 mutex_unlock(&lo->lo_mutex); 2179 2179 2180 2180 loop_remove(lo); ··· 2197 2197 if (ret) 2198 2198 return ret; 2199 2199 idr_for_each_entry(&loop_index_idr, lo, id) { 2200 - /* Hitting a race results in creating a new loop device which is harmless. */ 2201 - if (lo->idr_visible && data_race(lo->lo_state) == Lo_unbound) 2200 + /* 2201 + * Hitting a race results in creating a new loop device 2202 + * which is harmless. 2203 + */ 2204 + if (lo->idr_visible && 2205 + data_race(READ_ONCE(lo->lo_state)) == Lo_unbound) 2202 2206 goto found; 2203 2207 } 2204 2208 mutex_unlock(&loop_ctl_mutex);
+8 -5
drivers/block/rnbd/rnbd-clt.c
··· 1423 1423 goto out_alloc; 1424 1424 } 1425 1425 1426 - ret = ida_alloc_max(&index_ida, (1 << (MINORBITS - RNBD_PART_BITS)) - 1, 1427 - GFP_KERNEL); 1428 - if (ret < 0) { 1426 + dev->clt_device_id = ida_alloc_max(&index_ida, 1427 + (1 << (MINORBITS - RNBD_PART_BITS)) - 1, 1428 + GFP_KERNEL); 1429 + if (dev->clt_device_id < 0) { 1430 + ret = dev->clt_device_id; 1429 1431 pr_err("Failed to initialize device '%s' from session %s, allocating idr failed, err: %d\n", 1430 1432 pathname, sess->sessname, ret); 1431 1433 goto out_queues; ··· 1436 1434 dev->pathname = kstrdup(pathname, GFP_KERNEL); 1437 1435 if (!dev->pathname) { 1438 1436 ret = -ENOMEM; 1439 - goto out_queues; 1437 + goto out_ida; 1440 1438 } 1441 1439 1442 - dev->clt_device_id = ret; 1443 1440 dev->sess = sess; 1444 1441 dev->access_mode = access_mode; 1445 1442 dev->nr_poll_queues = nr_poll_queues; ··· 1454 1453 1455 1454 return dev; 1456 1455 1456 + out_ida: 1457 + ida_free(&index_ida, dev->clt_device_id); 1457 1458 out_queues: 1458 1459 kfree(dev->hw_queues); 1459 1460 out_alloc:
+28 -4
drivers/block/ublk_drv.c
··· 1080 1080 return io_uring_cmd_to_pdu(ioucmd, struct ublk_uring_cmd_pdu); 1081 1081 } 1082 1082 1083 + static void ublk_end_request(struct request *req, blk_status_t error) 1084 + { 1085 + local_bh_disable(); 1086 + blk_mq_end_request(req, error); 1087 + local_bh_enable(); 1088 + } 1089 + 1083 1090 /* todo: handle partial completion */ 1084 1091 static inline void __ublk_complete_rq(struct request *req, struct ublk_io *io, 1085 1092 bool need_map) 1086 1093 { 1087 1094 unsigned int unmapped_bytes; 1088 1095 blk_status_t res = BLK_STS_OK; 1096 + bool requeue; 1089 1097 1090 1098 /* failed read IO if nothing is read */ 1091 1099 if (!io->res && req_op(req) == REQ_OP_READ) ··· 1125 1117 if (unlikely(unmapped_bytes < io->res)) 1126 1118 io->res = unmapped_bytes; 1127 1119 1128 - if (blk_update_request(req, BLK_STS_OK, io->res)) 1120 + /* 1121 + * Run bio->bi_end_io() with softirqs disabled. If the final fput 1122 + * happens off this path, then that will prevent ublk's blkdev_release() 1123 + * from being called on current's task work, see fput() implementation. 1124 + * 1125 + * Otherwise, ublk server may not provide forward progress in case of 1126 + * reading the partition table from bdev_open() with disk->open_mutex 1127 + * held, and causes dead lock as we could already be holding 1128 + * disk->open_mutex here. 1129 + * 1130 + * Preferably we would not be doing IO with a mutex held that is also 1131 + * used for release, but this work-around will suffice for now. 1132 + */ 1133 + local_bh_disable(); 1134 + requeue = blk_update_request(req, BLK_STS_OK, io->res); 1135 + local_bh_enable(); 1136 + if (requeue) 1129 1137 blk_mq_requeue_request(req, true); 1130 1138 else if (likely(!blk_should_fake_timeout(req->q))) 1131 1139 __blk_mq_end_request(req, BLK_STS_OK); 1132 1140 1133 1141 return; 1134 1142 exit: 1135 - blk_mq_end_request(req, res); 1143 + ublk_end_request(req, res); 1136 1144 } 1137 1145 1138 1146 static struct io_uring_cmd *__ublk_prep_compl_io_cmd(struct ublk_io *io, ··· 1188 1164 if (ublk_nosrv_dev_should_queue_io(ubq->dev)) 1189 1165 blk_mq_requeue_request(rq, false); 1190 1166 else 1191 - blk_mq_end_request(rq, BLK_STS_IOERR); 1167 + ublk_end_request(rq, BLK_STS_IOERR); 1192 1168 } 1193 1169 1194 1170 static void ··· 1233 1209 ublk_auto_buf_reg_fallback(ubq, req->tag); 1234 1210 return AUTO_BUF_REG_FALLBACK; 1235 1211 } 1236 - blk_mq_end_request(req, BLK_STS_IOERR); 1212 + ublk_end_request(req, BLK_STS_IOERR); 1237 1213 return AUTO_BUF_REG_FAIL; 1238 1214 } 1239 1215
+4 -4
drivers/block/zloop.c
··· 697 697 struct zloop_cmd *cmd = blk_mq_rq_to_pdu(rq); 698 698 struct zloop_device *zlo = rq->q->queuedata; 699 699 700 - if (zlo->state == Zlo_deleting) 700 + if (data_race(READ_ONCE(zlo->state)) == Zlo_deleting) 701 701 return BLK_STS_IOERR; 702 702 703 703 /* ··· 1002 1002 ret = -ENOMEM; 1003 1003 goto out; 1004 1004 } 1005 - zlo->state = Zlo_creating; 1005 + WRITE_ONCE(zlo->state, Zlo_creating); 1006 1006 1007 1007 ret = mutex_lock_killable(&zloop_ctl_mutex); 1008 1008 if (ret) ··· 1113 1113 } 1114 1114 1115 1115 mutex_lock(&zloop_ctl_mutex); 1116 - zlo->state = Zlo_live; 1116 + WRITE_ONCE(zlo->state, Zlo_live); 1117 1117 mutex_unlock(&zloop_ctl_mutex); 1118 1118 1119 1119 pr_info("zloop: device %d, %u zones of %llu MiB, %u B block size\n", ··· 1177 1177 ret = -EINVAL; 1178 1178 } else { 1179 1179 idr_remove(&zloop_index_idr, zlo->id); 1180 - zlo->state = Zlo_deleting; 1180 + WRITE_ONCE(zlo->state, Zlo_deleting); 1181 1181 } 1182 1182 1183 1183 mutex_unlock(&zloop_ctl_mutex);
+4 -3
drivers/cpufreq/cpufreq-dt-platdev.c
··· 219 219 220 220 static int __init cpufreq_dt_platdev_init(void) 221 221 { 222 - const void *data; 222 + const void *data = NULL; 223 223 224 - data = of_machine_get_match_data(allowlist); 225 - if (data) 224 + if (of_machine_device_match(allowlist)) { 225 + data = of_machine_get_match_data(allowlist); 226 226 goto create_pdev; 227 + } 227 228 228 229 if (cpu0_node_has_opp_v2_prop() && !of_machine_device_match(blocklist)) 229 230 goto create_pdev;
+8 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 6613 6613 struct amdgpu_hive_info *hive = NULL; 6614 6614 int r = 0; 6615 6615 bool need_emergency_restart = false; 6616 + /* save the pasid here as the job may be freed before the end of the reset */ 6617 + int pasid = job ? job->pasid : -EINVAL; 6616 6618 6617 6619 /* 6618 6620 * If it reaches here because of hang/timeout and a RAS error is ··· 6715 6713 if (!r) { 6716 6714 struct amdgpu_task_info *ti = NULL; 6717 6715 6718 - if (job) 6719 - ti = amdgpu_vm_get_task_info_pasid(adev, job->pasid); 6716 + /* 6717 + * The job may already be freed at this point via the sched tdr workqueue so 6718 + * use the cached pasid. 6719 + */ 6720 + if (pasid >= 0) 6721 + ti = amdgpu_vm_get_task_info_pasid(adev, pasid); 6720 6722 6721 6723 drm_dev_wedged_event(adev_to_drm(adev), DRM_WEDGE_RECOVERY_NONE, 6722 6724 ti ? &ti->task : NULL);
+4 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c
··· 33 33 #include <drm/drm_vblank.h> 34 34 35 35 #include <linux/cc_platform.h> 36 + #include <linux/console.h> 36 37 #include <linux/dynamic_debug.h> 37 38 #include <linux/module.h> 38 39 #include <linux/mmu_notifier.h> ··· 2705 2704 struct drm_device *drm_dev = dev_get_drvdata(dev); 2706 2705 2707 2706 /* do not resume device if it's normal hibernation */ 2708 - if (!pm_hibernate_is_recovering() && !pm_hibernation_mode_is_suspend()) 2707 + if (console_suspend_enabled && 2708 + !pm_hibernate_is_recovering() && 2709 + !pm_hibernation_mode_is_suspend()) 2709 2710 return 0; 2710 2711 2711 2712 return amdgpu_device_resume(drm_dev, true);
+1 -1
drivers/gpu/drm/amd/amdkfd/kfd_smi_events.c
··· 312 312 { 313 313 kfd_smi_event_add(pid, node, KFD_SMI_EVENT_QUEUE_RESTORE, 314 314 KFD_EVENT_FMT_QUEUE_RESTORE(ktime_get_boottime_ns(), pid, 315 - node->id, 0)); 315 + node->id, '0')); 316 316 } 317 317 318 318 void kfd_smi_event_queue_restore_rescheduled(struct mm_struct *mm)
+4 -4
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c
··· 1118 1118 if (dc->current_state->res_ctx.pipe_ctx[i].stream_res.audio != NULL) 1119 1119 num_audio++; 1120 1120 } 1121 + if (num_audio >= 1 && clk_mgr->funcs->enable_pme_wa) { 1122 + /*wake AZ from D3 first before access az endpoint*/ 1123 + clk_mgr->funcs->enable_pme_wa(clk_mgr); 1124 + } 1121 1125 1122 1126 pipe_ctx->stream_res.audio->funcs->az_enable(pipe_ctx->stream_res.audio); 1123 - 1124 - if (num_audio >= 1 && clk_mgr->funcs->enable_pme_wa) 1125 - /*this is the first audio. apply the PME w/a in order to wake AZ from D3*/ 1126 - clk_mgr->funcs->enable_pme_wa(clk_mgr); 1127 1127 1128 1128 link_hwss->enable_audio_packet(pipe_ctx); 1129 1129
+4 -4
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c
··· 203 203 NBIO_BASE_INNER(seg) 204 204 205 205 #define NBIO_SR(reg_name)\ 206 - REG_STRUCT.reg_name = NBIO_BASE(regBIF_BX2_ ## reg_name ## _BASE_IDX) + \ 207 - regBIF_BX2_ ## reg_name 206 + REG_STRUCT.reg_name = NBIO_BASE(regBIF_BX1_ ## reg_name ## _BASE_IDX) + \ 207 + regBIF_BX1_ ## reg_name 208 208 209 209 #define NBIO_SR_ARR(reg_name, id)\ 210 - REG_STRUCT[id].reg_name = NBIO_BASE(regBIF_BX2_ ## reg_name ## _BASE_IDX) + \ 211 - regBIF_BX2_ ## reg_name 210 + REG_STRUCT[id].reg_name = NBIO_BASE(regBIF_BX1_ ## reg_name ## _BASE_IDX) + \ 211 + regBIF_BX1_ ## reg_name 212 212 213 213 #define bios_regs_init() \ 214 214 ( \
+4 -4
drivers/gpu/drm/amd/display/dc/resource/dcn351/dcn351_resource.c
··· 183 183 NBIO_BASE_INNER(seg) 184 184 185 185 #define NBIO_SR(reg_name)\ 186 - REG_STRUCT.reg_name = NBIO_BASE(regBIF_BX2_ ## reg_name ## _BASE_IDX) + \ 187 - regBIF_BX2_ ## reg_name 186 + REG_STRUCT.reg_name = NBIO_BASE(regBIF_BX1_ ## reg_name ## _BASE_IDX) + \ 187 + regBIF_BX1_ ## reg_name 188 188 189 189 #define NBIO_SR_ARR(reg_name, id)\ 190 - REG_STRUCT[id].reg_name = NBIO_BASE(regBIF_BX2_ ## reg_name ## _BASE_IDX) + \ 191 - regBIF_BX2_ ## reg_name 190 + REG_STRUCT[id].reg_name = NBIO_BASE(regBIF_BX1_ ## reg_name ## _BASE_IDX) + \ 191 + regBIF_BX1_ ## reg_name 192 192 193 193 #define bios_regs_init() \ 194 194 ( \
+5
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c
··· 1939 1939 dev_err(smu->adev->dev, "Set soft max sclk failed!"); 1940 1940 return ret; 1941 1941 } 1942 + if (smu->gfx_actual_hard_min_freq != smu->gfx_default_hard_min_freq || 1943 + smu->gfx_actual_soft_max_freq != smu->gfx_default_soft_max_freq) 1944 + smu->user_dpm_profile.user_od = true; 1945 + else 1946 + smu->user_dpm_profile.user_od = false; 1942 1947 break; 1943 1948 default: 1944 1949 return -ENOSYS;
+32 -5
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c
··· 1514 1514 1515 1515 smu->gfx_default_hard_min_freq = clk_table->MinGfxClk; 1516 1516 smu->gfx_default_soft_max_freq = clk_table->MaxGfxClk; 1517 - smu->gfx_actual_hard_min_freq = 0; 1518 - smu->gfx_actual_soft_max_freq = 0; 1519 - 1517 + if (smu->gfx_actual_hard_min_freq == 0) 1518 + smu->gfx_actual_hard_min_freq = smu->gfx_default_hard_min_freq; 1519 + if (smu->gfx_actual_soft_max_freq == 0) 1520 + smu->gfx_actual_soft_max_freq = smu->gfx_default_soft_max_freq; 1520 1521 return 0; 1521 1522 } 1522 1523 ··· 1527 1526 1528 1527 smu->gfx_default_hard_min_freq = clk_table->MinGfxClk; 1529 1528 smu->gfx_default_soft_max_freq = clk_table->MaxGfxClk; 1530 - smu->gfx_actual_hard_min_freq = 0; 1531 - smu->gfx_actual_soft_max_freq = 0; 1529 + if (smu->gfx_actual_hard_min_freq == 0) 1530 + smu->gfx_actual_hard_min_freq = smu->gfx_default_hard_min_freq; 1531 + if (smu->gfx_actual_soft_max_freq == 0) 1532 + smu->gfx_actual_soft_max_freq = smu->gfx_default_soft_max_freq; 1532 1533 1533 1534 return 0; 1534 1535 } ··· 1668 1665 return ret; 1669 1666 } 1670 1667 1668 + static int smu_v14_0_0_restore_user_od_settings(struct smu_context *smu) 1669 + { 1670 + int ret; 1671 + 1672 + ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetHardMinGfxClk, 1673 + smu->gfx_actual_hard_min_freq, 1674 + NULL); 1675 + if (ret) { 1676 + dev_err(smu->adev->dev, "Failed to restore hard min sclk!\n"); 1677 + return ret; 1678 + } 1679 + 1680 + ret = smu_cmn_send_smc_msg_with_param(smu, SMU_MSG_SetSoftMaxGfxClk, 1681 + smu->gfx_actual_soft_max_freq, 1682 + NULL); 1683 + if (ret) { 1684 + dev_err(smu->adev->dev, "Failed to restore soft max sclk!\n"); 1685 + return ret; 1686 + } 1687 + 1688 + return 0; 1689 + } 1690 + 1671 1691 static const struct pptable_funcs smu_v14_0_0_ppt_funcs = { 1672 1692 .check_fw_status = smu_v14_0_check_fw_status, 1673 1693 .check_fw_version = smu_v14_0_check_fw_version, ··· 1714 1688 .mode2_reset = smu_v14_0_0_mode2_reset, 1715 1689 .get_dpm_ultimate_freq = smu_v14_0_common_get_dpm_ultimate_freq, 1716 1690 .set_soft_freq_limited_range = smu_v14_0_0_set_soft_freq_limited_range, 1691 + .restore_user_od_settings = smu_v14_0_0_restore_user_od_settings, 1717 1692 .od_edit_dpm_table = smu_v14_0_od_edit_dpm_table, 1718 1693 .print_clk_levels = smu_v14_0_0_print_clk_levels, 1719 1694 .force_clk_levels = smu_v14_0_0_force_clk_levels,
+6 -2
drivers/gpu/drm/drm_gem.c
··· 969 969 if (!obj) 970 970 return -ENOENT; 971 971 972 - if (args->handle == args->new_handle) 973 - return 0; 972 + if (args->handle == args->new_handle) { 973 + ret = 0; 974 + goto out; 975 + } 974 976 975 977 mutex_lock(&file_priv->prime.lock); 976 978 ··· 1004 1002 1005 1003 out_unlock: 1006 1004 mutex_unlock(&file_priv->prime.lock); 1005 + out: 1006 + drm_gem_object_put(obj); 1007 1007 1008 1008 return ret; 1009 1009 }
+1
drivers/gpu/drm/panel/Kconfig
··· 1165 1165 tristate "Visionox RM69299" 1166 1166 depends on OF 1167 1167 depends on DRM_MIPI_DSI 1168 + depends on BACKLIGHT_CLASS_DEVICE 1168 1169 help 1169 1170 Say Y here if you want to enable support for Visionox 1170 1171 RM69299 DSI Video Mode panel.
+2
drivers/gpu/drm/panel/panel-sony-td4353-jdi.c
··· 212 212 if (ret) 213 213 return dev_err_probe(dev, ret, "Failed to get backlight\n"); 214 214 215 + ctx->panel.prepare_prev_first = true; 216 + 215 217 drm_panel_add(&ctx->panel); 216 218 217 219 ret = mipi_dsi_attach(dsi);
+35 -5
drivers/gpu/drm/tests/drm_atomic_state_test.c
··· 156 156 157 157 if (connector) { 158 158 conn_state = drm_atomic_get_connector_state(state, connector); 159 - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, conn_state); 159 + if (IS_ERR(conn_state)) 160 + return PTR_ERR(conn_state); 160 161 161 162 ret = drm_atomic_set_crtc_for_connector(conn_state, crtc); 162 - KUNIT_EXPECT_EQ(test, ret, 0); 163 + if (ret) 164 + return ret; 163 165 } 164 166 165 167 crtc_state = drm_atomic_get_crtc_state(state, crtc); 166 - KUNIT_ASSERT_NOT_ERR_OR_NULL(test, crtc_state); 168 + if (IS_ERR(crtc_state)) 169 + return PTR_ERR(crtc_state); 167 170 168 171 ret = drm_atomic_set_mode_for_crtc(crtc_state, &drm_atomic_test_mode); 169 - KUNIT_EXPECT_EQ(test, ret, 0); 172 + if (ret) 173 + return ret; 170 174 171 175 crtc_state->enable = true; 172 176 crtc_state->active = true; 173 177 174 178 if (connector) { 175 179 ret = drm_atomic_commit(state); 176 - KUNIT_ASSERT_EQ(test, ret, 0); 180 + if (ret) 181 + return ret; 177 182 } else { 178 183 // dummy connector mask 179 184 crtc_state->connector_mask = DRM_TEST_CONN_0; ··· 211 206 drm_modeset_acquire_init(&ctx, 0); 212 207 213 208 // first modeset to enable 209 + retry_set_up: 214 210 ret = set_up_atomic_state(test, priv, old_conn, &ctx); 211 + if (ret == -EDEADLK) { 212 + ret = drm_modeset_backoff(&ctx); 213 + if (!ret) 214 + goto retry_set_up; 215 + } 215 216 KUNIT_ASSERT_EQ(test, ret, 0); 216 217 217 218 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); ··· 288 277 289 278 drm_modeset_acquire_init(&ctx, 0); 290 279 280 + retry_set_up: 291 281 ret = set_up_atomic_state(test, priv, NULL, &ctx); 282 + if (ret == -EDEADLK) { 283 + ret = drm_modeset_backoff(&ctx); 284 + if (!ret) 285 + goto retry_set_up; 286 + } 292 287 KUNIT_ASSERT_EQ(test, ret, 0); 293 288 294 289 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); 295 290 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, state); 296 291 292 + retry: 297 293 crtc_state = drm_atomic_get_crtc_state(state, priv->crtc); 294 + if (PTR_ERR(crtc_state) == -EDEADLK) { 295 + drm_atomic_state_clear(state); 296 + ret = drm_modeset_backoff(&ctx); 297 + if (!ret) 298 + goto retry; 299 + } 298 300 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, crtc_state); 299 301 300 302 crtc_state->encoder_mask = param->encoder_mask; ··· 316 292 crtc_state->mode_changed = true; 317 293 318 294 ret = drm_atomic_helper_check_modeset(drm, state); 295 + if (ret == -EDEADLK) { 296 + drm_atomic_state_clear(state); 297 + ret = drm_modeset_backoff(&ctx); 298 + if (!ret) 299 + goto retry; 300 + } 319 301 KUNIT_ASSERT_EQ(test, ret, param->expected_result); 320 302 321 303 drm_modeset_drop_locks(&ctx);
+143
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
··· 257 257 258 258 drm_modeset_acquire_init(&ctx, 0); 259 259 260 + retry_conn_enable: 260 261 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 261 262 crtc, conn, 262 263 preferred, 263 264 &ctx); 265 + if (ret == -EDEADLK) { 266 + ret = drm_modeset_backoff(&ctx); 267 + if (!ret) 268 + goto retry_conn_enable; 269 + } 264 270 KUNIT_ASSERT_EQ(test, ret, 0); 265 271 266 272 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); ··· 332 326 333 327 drm_modeset_acquire_init(&ctx, 0); 334 328 329 + retry_conn_enable: 335 330 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 336 331 crtc, conn, 337 332 preferred, 338 333 &ctx); 334 + if (ret == -EDEADLK) { 335 + ret = drm_modeset_backoff(&ctx); 336 + if (!ret) 337 + goto retry_conn_enable; 338 + } 339 339 KUNIT_ASSERT_EQ(test, ret, 0); 340 340 341 341 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); ··· 409 397 410 398 drm_modeset_acquire_init(&ctx, 0); 411 399 400 + retry_conn_enable: 412 401 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 413 402 crtc, conn, 414 403 preferred, 415 404 &ctx); 405 + if (ret == -EDEADLK) { 406 + ret = drm_modeset_backoff(&ctx); 407 + if (!ret) 408 + goto retry_conn_enable; 409 + } 416 410 KUNIT_ASSERT_EQ(test, ret, 0); 417 411 418 412 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); ··· 475 457 KUNIT_ASSERT_NOT_NULL(test, mode); 476 458 477 459 crtc = priv->crtc; 460 + 461 + retry_conn_enable: 478 462 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 479 463 crtc, conn, 480 464 mode, 481 465 &ctx); 466 + if (ret == -EDEADLK) { 467 + ret = drm_modeset_backoff(&ctx); 468 + if (!ret) 469 + goto retry_conn_enable; 470 + } 482 471 KUNIT_ASSERT_EQ(test, ret, 0); 483 472 484 473 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); ··· 543 518 544 519 drm_modeset_acquire_init(&ctx, 0); 545 520 521 + retry_conn_enable: 546 522 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 547 523 crtc, conn, 548 524 preferred, 549 525 &ctx); 526 + if (ret == -EDEADLK) { 527 + ret = drm_modeset_backoff(&ctx); 528 + if (!ret) 529 + goto retry_conn_enable; 530 + } 550 531 KUNIT_ASSERT_EQ(test, ret, 0); 551 532 552 533 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); ··· 611 580 KUNIT_ASSERT_NOT_NULL(test, mode); 612 581 613 582 crtc = priv->crtc; 583 + 584 + retry_conn_enable: 614 585 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 615 586 crtc, conn, 616 587 mode, 617 588 &ctx); 589 + if (ret == -EDEADLK) { 590 + ret = drm_modeset_backoff(&ctx); 591 + if (!ret) 592 + goto retry_conn_enable; 593 + } 618 594 KUNIT_ASSERT_EQ(test, ret, 0); 619 595 620 596 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); ··· 681 643 682 644 drm_modeset_acquire_init(&ctx, 0); 683 645 646 + retry_conn_enable: 684 647 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 685 648 crtc, conn, 686 649 preferred, 687 650 &ctx); 651 + if (ret == -EDEADLK) { 652 + ret = drm_modeset_backoff(&ctx); 653 + if (!ret) 654 + goto retry_conn_enable; 655 + } 688 656 KUNIT_ASSERT_EQ(test, ret, 0); 689 657 690 658 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); ··· 749 705 KUNIT_ASSERT_NOT_NULL(test, mode); 750 706 751 707 crtc = priv->crtc; 708 + 709 + retry_conn_enable: 752 710 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 753 711 crtc, conn, 754 712 mode, 755 713 &ctx); 714 + if (ret == -EDEADLK) { 715 + ret = drm_modeset_backoff(&ctx); 716 + if (!ret) 717 + goto retry_conn_enable; 718 + } 756 719 KUNIT_ASSERT_EQ(test, ret, 0); 757 720 758 721 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); ··· 921 870 922 871 drm_modeset_acquire_init(&ctx, 0); 923 872 873 + retry_conn_enable: 924 874 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 925 875 crtc, conn, 926 876 preferred, 927 877 &ctx); 878 + if (ret == -EDEADLK) { 879 + ret = drm_modeset_backoff(&ctx); 880 + if (!ret) 881 + goto retry_conn_enable; 882 + } 928 883 KUNIT_ASSERT_EQ(test, ret, 0); 929 884 930 885 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); ··· 1003 946 1004 947 drm_modeset_acquire_init(&ctx, 0); 1005 948 949 + retry_conn_enable: 1006 950 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1007 951 crtc, conn, 1008 952 preferred, 1009 953 &ctx); 954 + if (ret == -EDEADLK) { 955 + ret = drm_modeset_backoff(&ctx); 956 + if (!ret) 957 + goto retry_conn_enable; 958 + } 1010 959 KUNIT_ASSERT_EQ(test, ret, 0); 1011 960 1012 961 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx); ··· 1085 1022 1086 1023 drm_modeset_acquire_init(&ctx, 0); 1087 1024 1025 + retry_conn_enable: 1088 1026 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1089 1027 crtc, conn, 1090 1028 preferred, 1091 1029 &ctx); 1030 + if (ret == -EDEADLK) { 1031 + ret = drm_modeset_backoff(&ctx); 1032 + if (!ret) 1033 + goto retry_conn_enable; 1034 + } 1092 1035 KUNIT_ASSERT_EQ(test, ret, 0); 1093 1036 1094 1037 conn_state = conn->state; ··· 1138 1069 1139 1070 drm_modeset_acquire_init(&ctx, 0); 1140 1071 1072 + retry_conn_enable: 1141 1073 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1142 1074 crtc, conn, 1143 1075 preferred, 1144 1076 &ctx); 1077 + if (ret == -EDEADLK) { 1078 + ret = drm_modeset_backoff(&ctx); 1079 + if (!ret) 1080 + goto retry_conn_enable; 1081 + } 1145 1082 KUNIT_ASSERT_EQ(test, ret, 0); 1146 1083 1147 1084 conn_state = conn->state; ··· 1193 1118 1194 1119 drm_modeset_acquire_init(&ctx, 0); 1195 1120 1121 + retry_conn_enable: 1196 1122 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1197 1123 crtc, conn, 1198 1124 preferred, 1199 1125 &ctx); 1126 + if (ret == -EDEADLK) { 1127 + ret = drm_modeset_backoff(&ctx); 1128 + if (!ret) 1129 + goto retry_conn_enable; 1130 + } 1200 1131 KUNIT_ASSERT_EQ(test, ret, 0); 1201 1132 1202 1133 conn_state = conn->state; ··· 1248 1167 1249 1168 drm_modeset_acquire_init(&ctx, 0); 1250 1169 1170 + retry_conn_enable: 1251 1171 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1252 1172 crtc, conn, 1253 1173 preferred, 1254 1174 &ctx); 1175 + if (ret == -EDEADLK) { 1176 + ret = drm_modeset_backoff(&ctx); 1177 + if (!ret) 1178 + goto retry_conn_enable; 1179 + } 1255 1180 KUNIT_ASSERT_EQ(test, ret, 0); 1256 1181 1257 1182 conn_state = conn->state; ··· 1305 1218 1306 1219 drm_modeset_acquire_init(&ctx, 0); 1307 1220 1221 + retry_conn_enable: 1308 1222 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1309 1223 crtc, conn, 1310 1224 preferred, 1311 1225 &ctx); 1226 + if (ret == -EDEADLK) { 1227 + ret = drm_modeset_backoff(&ctx); 1228 + if (!ret) 1229 + goto retry_conn_enable; 1230 + } 1312 1231 KUNIT_ASSERT_EQ(test, ret, 0); 1313 1232 1314 1233 /* You shouldn't be doing that at home. */ ··· 1385 1292 1386 1293 drm_modeset_acquire_init(&ctx, 0); 1387 1294 1295 + retry_conn_enable: 1388 1296 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1389 1297 crtc, conn, 1390 1298 preferred, 1391 1299 &ctx); 1300 + if (ret == -EDEADLK) { 1301 + ret = drm_modeset_backoff(&ctx); 1302 + if (!ret) 1303 + goto retry_conn_enable; 1304 + } 1392 1305 KUNIT_EXPECT_EQ(test, ret, 0); 1393 1306 1394 1307 conn_state = conn->state; ··· 1539 1440 1540 1441 drm_modeset_acquire_init(&ctx, 0); 1541 1442 1443 + retry_conn_enable: 1542 1444 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1543 1445 crtc, conn, 1544 1446 preferred, 1545 1447 &ctx); 1448 + if (ret == -EDEADLK) { 1449 + ret = drm_modeset_backoff(&ctx); 1450 + if (!ret) 1451 + goto retry_conn_enable; 1452 + } 1546 1453 KUNIT_EXPECT_EQ(test, ret, 0); 1547 1454 1548 1455 conn_state = conn->state; ··· 1774 1669 drm_modeset_acquire_init(&ctx, 0); 1775 1670 1776 1671 crtc = priv->crtc; 1672 + 1673 + retry_conn_enable: 1777 1674 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1778 1675 crtc, conn, 1779 1676 mode, 1780 1677 &ctx); 1678 + if (ret == -EDEADLK) { 1679 + ret = drm_modeset_backoff(&ctx); 1680 + if (!ret) 1681 + goto retry_conn_enable; 1682 + } 1781 1683 KUNIT_EXPECT_EQ(test, ret, 0); 1782 1684 1783 1685 conn_state = conn->state; ··· 1848 1736 1849 1737 drm_modeset_acquire_init(&ctx, 0); 1850 1738 1739 + retry_conn_enable: 1851 1740 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1852 1741 crtc, conn, 1853 1742 preferred, 1854 1743 &ctx); 1744 + if (ret == -EDEADLK) { 1745 + ret = drm_modeset_backoff(&ctx); 1746 + if (!ret) 1747 + goto retry_conn_enable; 1748 + } 1855 1749 KUNIT_EXPECT_EQ(test, ret, 0); 1856 1750 1857 1751 conn_state = conn->state; ··· 1923 1805 1924 1806 drm_modeset_acquire_init(&ctx, 0); 1925 1807 1808 + retry_conn_enable: 1926 1809 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1927 1810 crtc, conn, 1928 1811 preferred, 1929 1812 &ctx); 1813 + if (ret == -EDEADLK) { 1814 + ret = drm_modeset_backoff(&ctx); 1815 + if (!ret) 1816 + goto retry_conn_enable; 1817 + } 1930 1818 KUNIT_EXPECT_EQ(test, ret, 0); 1931 1819 1932 1820 conn_state = conn->state; ··· 1989 1865 1990 1866 drm_modeset_acquire_init(&ctx, 0); 1991 1867 1868 + retry_conn_enable: 1992 1869 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 1993 1870 crtc, conn, 1994 1871 preferred, 1995 1872 &ctx); 1873 + if (ret == -EDEADLK) { 1874 + ret = drm_modeset_backoff(&ctx); 1875 + if (!ret) 1876 + goto retry_conn_enable; 1877 + } 1996 1878 KUNIT_EXPECT_EQ(test, ret, 0); 1997 1879 1998 1880 conn_state = conn->state; ··· 2057 1927 2058 1928 drm_modeset_acquire_init(&ctx, 0); 2059 1929 1930 + retry_conn_enable: 2060 1931 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 2061 1932 crtc, conn, 2062 1933 preferred, 2063 1934 &ctx); 1935 + if (ret == -EDEADLK) { 1936 + ret = drm_modeset_backoff(&ctx); 1937 + if (!ret) 1938 + goto retry_conn_enable; 1939 + } 2064 1940 KUNIT_EXPECT_EQ(test, ret, 0); 2065 1941 2066 1942 conn_state = conn->state; ··· 2106 1970 2107 1971 drm = &priv->drm; 2108 1972 crtc = priv->crtc; 1973 + 1974 + retry_conn_enable: 2109 1975 ret = drm_kunit_helper_enable_crtc_connector(test, drm, 2110 1976 crtc, conn, 2111 1977 preferred, 2112 1978 &ctx); 1979 + if (ret == -EDEADLK) { 1980 + ret = drm_modeset_backoff(&ctx); 1981 + if (!ret) 1982 + goto retry_conn_enable; 1983 + } 2113 1984 KUNIT_ASSERT_EQ(test, ret, 0); 2114 1985 2115 1986 state = drm_kunit_helper_atomic_state_alloc(test, drm, &ctx);
+4 -11
drivers/gpu/drm/xe/xe_bo.c
··· 1527 1527 * always succeed here, as long as we hold the lru lock. 1528 1528 */ 1529 1529 spin_lock(&ttm_bo->bdev->lru_lock); 1530 - locked = dma_resv_trylock(ttm_bo->base.resv); 1530 + locked = dma_resv_trylock(&ttm_bo->base._resv); 1531 1531 spin_unlock(&ttm_bo->bdev->lru_lock); 1532 1532 xe_assert(xe, locked); 1533 1533 ··· 1547 1547 bo = ttm_to_xe_bo(ttm_bo); 1548 1548 xe_assert(xe_bo_device(bo), !(bo->created && kref_read(&ttm_bo->base.refcount))); 1549 1549 1550 - /* 1551 - * Corner case where TTM fails to allocate memory and this BOs resv 1552 - * still points the VMs resv 1553 - */ 1554 - if (ttm_bo->base.resv != &ttm_bo->base._resv) 1555 - return; 1556 - 1557 1550 if (!xe_ttm_bo_lock_in_destructor(ttm_bo)) 1558 1551 return; 1559 1552 ··· 1556 1563 * TODO: Don't do this for external bos once we scrub them after 1557 1564 * unbind. 1558 1565 */ 1559 - dma_resv_for_each_fence(&cursor, ttm_bo->base.resv, 1566 + dma_resv_for_each_fence(&cursor, &ttm_bo->base._resv, 1560 1567 DMA_RESV_USAGE_BOOKKEEP, fence) { 1561 1568 if (xe_fence_is_xe_preempt(fence) && 1562 1569 !dma_fence_is_signaled(fence)) { 1563 1570 if (!replacement) 1564 1571 replacement = dma_fence_get_stub(); 1565 1572 1566 - dma_resv_replace_fences(ttm_bo->base.resv, 1573 + dma_resv_replace_fences(&ttm_bo->base._resv, 1567 1574 fence->context, 1568 1575 replacement, 1569 1576 DMA_RESV_USAGE_BOOKKEEP); ··· 1571 1578 } 1572 1579 dma_fence_put(replacement); 1573 1580 1574 - dma_resv_unlock(ttm_bo->base.resv); 1581 + dma_resv_unlock(&ttm_bo->base._resv); 1575 1582 } 1576 1583 1577 1584 static void xe_ttm_bo_delete_mem_notify(struct ttm_buffer_object *ttm_bo)
+1 -1
drivers/gpu/drm/xe/xe_device.c
··· 1056 1056 * transient and need to be flushed.. 1057 1057 */ 1058 1058 if (xe_mmio_wait32(&gt->mmio, XE2_TDF_CTRL, TRANSIENT_FLUSH_REQUEST, 0, 1059 - 150, NULL, false)) 1059 + 300, NULL, false)) 1060 1060 xe_gt_err_once(gt, "TD flush timeout\n"); 1061 1061 1062 1062 xe_force_wake_put(gt_to_fw(gt), fw_ref);
+1 -1
drivers/gpu/drm/xe/xe_dma_buf.c
··· 124 124 case XE_PL_TT: 125 125 sgt = drm_prime_pages_to_sg(obj->dev, 126 126 bo->ttm.ttm->pages, 127 - bo->ttm.ttm->num_pages); 127 + obj->size >> PAGE_SHIFT); 128 128 if (IS_ERR(sgt)) 129 129 return sgt; 130 130
+1 -1
drivers/gpu/drm/xe/xe_eu_stall.c
··· 315 315 return -EFAULT; 316 316 317 317 if (XE_IOCTL_DBG(xe, ext.property >= ARRAY_SIZE(xe_set_eu_stall_property_funcs)) || 318 - XE_IOCTL_DBG(xe, ext.pad)) 318 + XE_IOCTL_DBG(xe, !ext.property) || XE_IOCTL_DBG(xe, ext.pad)) 319 319 return -EINVAL; 320 320 321 321 idx = array_index_nospec(ext.property, ARRAY_SIZE(xe_set_eu_stall_property_funcs));
+2 -1
drivers/gpu/drm/xe/xe_exec.c
··· 132 132 133 133 if (XE_IOCTL_DBG(xe, args->extensions) || 134 134 XE_IOCTL_DBG(xe, args->pad[0] || args->pad[1] || args->pad[2]) || 135 - XE_IOCTL_DBG(xe, args->reserved[0] || args->reserved[1])) 135 + XE_IOCTL_DBG(xe, args->reserved[0] || args->reserved[1]) || 136 + XE_IOCTL_DBG(xe, args->num_syncs > DRM_XE_MAX_SYNCS)) 136 137 return -EINVAL; 137 138 138 139 q = xe_exec_queue_lookup(xef, args->exec_queue_id);
+4 -3
drivers/gpu/drm/xe/xe_gt.c
··· 797 797 xe_gt_sriov_pf_init_hw(gt); 798 798 799 799 xe_mocs_init(gt); 800 - err = xe_uc_start(&gt->uc); 801 - if (err) 802 - return err; 803 800 804 801 for_each_hw_engine(hwe, gt, id) 805 802 xe_reg_sr_apply_mmio(&hwe->reg_sr, gt); 806 803 807 804 /* Get CCS mode in sync between sw/hw */ 808 805 xe_gt_apply_ccs_mode(gt); 806 + 807 + err = xe_uc_start(&gt->uc); 808 + if (err) 809 + return err; 809 810 810 811 /* Restore GT freq to expected values */ 811 812 xe_gt_sanitize_freq(gt);
+3 -1
drivers/gpu/drm/xe/xe_gt_freq.c
··· 293 293 return -ENOMEM; 294 294 295 295 err = sysfs_create_files(gt->freq, freq_attrs); 296 - if (err) 296 + if (err) { 297 + kobject_put(gt->freq); 297 298 return err; 299 + } 298 300 299 301 err = devm_add_action_or_reset(xe->drm.dev, freq_fini, gt->freq); 300 302 if (err)
+8
drivers/gpu/drm/xe/xe_gt_idle.c
··· 5 5 6 6 #include <drm/drm_managed.h> 7 7 8 + #include <generated/xe_wa_oob.h> 8 9 #include "xe_force_wake.h" 9 10 #include "xe_device.h" 10 11 #include "xe_gt.h" ··· 17 16 #include "xe_mmio.h" 18 17 #include "xe_pm.h" 19 18 #include "xe_sriov.h" 19 + #include "xe_wa.h" 20 20 21 21 /** 22 22 * DOC: Xe GT Idle ··· 146 144 xe_mmio_write32(mmio, MEDIA_POWERGATE_IDLE_HYSTERESIS, 25); 147 145 xe_mmio_write32(mmio, RENDER_POWERGATE_IDLE_HYSTERESIS, 25); 148 146 } 147 + 148 + if (XE_GT_WA(gt, 14020316580)) 149 + gtidle->powergate_enable &= ~(VDN_HCP_POWERGATE_ENABLE(0) | 150 + VDN_MFXVDENC_POWERGATE_ENABLE(0) | 151 + VDN_HCP_POWERGATE_ENABLE(2) | 152 + VDN_MFXVDENC_POWERGATE_ENABLE(2)); 149 153 150 154 xe_mmio_write32(mmio, POWERGATE_ENABLE, gtidle->powergate_enable); 151 155 xe_force_wake_put(gt_to_fw(gt), fw_ref);
+1 -1
drivers/gpu/drm/xe/xe_gt_sriov_vf.c
··· 733 733 734 734 spin_lock(&gt->sriov.vf.migration.lock); 735 735 736 - if (!gt->sriov.vf.migration.recovery_queued || 736 + if (!gt->sriov.vf.migration.recovery_queued && 737 737 !gt->sriov.vf.migration.recovery_teardown) { 738 738 gt->sriov.vf.migration.recovery_queued = true; 739 739 WRITE_ONCE(gt->sriov.vf.migration.recovery_inprogress, true);
+1 -1
drivers/gpu/drm/xe/xe_gt_throttle.c
··· 140 140 struct throttle_attribute *other_ta = kobj_attribute_to_throttle(kattr); 141 141 142 142 if (other_ta->mask != U32_MAX && reasons & other_ta->mask) 143 - ret += sysfs_emit_at(buff, ret, "%s ", (*pother)->name); 143 + ret += sysfs_emit_at(buff, ret, "%s ", (*pother)->name + strlen("reason_")); 144 144 } 145 145 146 146 if (drm_WARN_ONCE(&xe->drm, !ret, "Unknown reason: %#x\n", reasons))
+28 -7
drivers/gpu/drm/xe/xe_guc_submit.c
··· 717 717 return xe_gt_recovery_pending(guc_to_gt(guc)); 718 718 } 719 719 720 + static inline void relaxed_ms_sleep(unsigned int delay_ms) 721 + { 722 + unsigned long min_us, max_us; 723 + 724 + if (!delay_ms) 725 + return; 726 + 727 + if (delay_ms > 20) { 728 + msleep(delay_ms); 729 + return; 730 + } 731 + 732 + min_us = mul_u32_u32(delay_ms, 1000); 733 + max_us = min_us + 500; 734 + 735 + usleep_range(min_us, max_us); 736 + } 737 + 720 738 static int wq_wait_for_space(struct xe_exec_queue *q, u32 wqi_size) 721 739 { 722 740 struct xe_guc *guc = exec_queue_to_guc(q); 723 741 struct xe_device *xe = guc_to_xe(guc); 724 742 struct iosys_map map = xe_lrc_parallel_map(q->lrc[0]); 725 - unsigned int sleep_period_ms = 1; 743 + unsigned int sleep_period_ms = 1, sleep_total_ms = 0; 726 744 727 745 #define AVAILABLE_SPACE \ 728 746 CIRC_SPACE(q->guc->wqi_tail, q->guc->wqi_head, WQ_SIZE) 729 747 if (wqi_size > AVAILABLE_SPACE && !vf_recovery(guc)) { 730 748 try_again: 731 749 q->guc->wqi_head = parallel_read(xe, map, wq_desc.head); 732 - if (wqi_size > AVAILABLE_SPACE) { 733 - if (sleep_period_ms == 1024) { 750 + if (wqi_size > AVAILABLE_SPACE && !vf_recovery(guc)) { 751 + if (sleep_total_ms > 2000) { 734 752 xe_gt_reset_async(q->gt); 735 753 return -ENODEV; 736 754 } 737 755 738 756 msleep(sleep_period_ms); 739 - sleep_period_ms <<= 1; 757 + sleep_total_ms += sleep_period_ms; 758 + if (sleep_period_ms < 64) 759 + sleep_period_ms <<= 1; 740 760 goto try_again; 741 761 } 742 762 } ··· 1605 1585 since_resume_ms; 1606 1586 1607 1587 if (wait_ms > 0 && q->guc->resume_time) 1608 - msleep(wait_ms); 1588 + relaxed_ms_sleep(wait_ms); 1609 1589 1610 1590 set_exec_queue_suspended(q); 1611 1591 disable_scheduling(q, false); ··· 2273 2253 struct xe_exec_queue *q) 2274 2254 { 2275 2255 struct xe_gpu_scheduler *sched = &q->guc->sched; 2276 - struct xe_sched_job *job = NULL; 2256 + struct xe_sched_job *job = NULL, *__job; 2277 2257 bool restore_replay = false; 2278 2258 2279 - list_for_each_entry(job, &sched->base.pending_list, drm.list) { 2259 + list_for_each_entry(__job, &sched->base.pending_list, drm.list) { 2260 + job = __job; 2280 2261 restore_replay |= job->restore_replay; 2281 2262 if (restore_replay) { 2282 2263 xe_gt_dbg(guc_to_gt(guc), "Replay JOB - guc_id=%d, seqno=%d",
+2 -2
drivers/gpu/drm/xe/xe_heci_gsc.c
··· 223 223 if (xe->heci_gsc.irq < 0) 224 224 return; 225 225 226 - ret = generic_handle_irq(xe->heci_gsc.irq); 226 + ret = generic_handle_irq_safe(xe->heci_gsc.irq); 227 227 if (ret) 228 228 drm_err_ratelimited(&xe->drm, "error handling GSC irq: %d\n", ret); 229 229 } ··· 243 243 if (xe->heci_gsc.irq < 0) 244 244 return; 245 245 246 - ret = generic_handle_irq(xe->heci_gsc.irq); 246 + ret = generic_handle_irq_safe(xe->heci_gsc.irq); 247 247 if (ret) 248 248 drm_err_ratelimited(&xe->drm, "error handling GSC irq: %d\n", ret); 249 249 }
+8 -4
drivers/gpu/drm/xe/xe_oa.c
··· 1105 1105 oag_buf_size_select(stream) | 1106 1106 oag_configure_mmio_trigger(stream, true)); 1107 1107 1108 - xe_mmio_write32(mmio, __oa_regs(stream)->oa_ctx_ctrl, stream->periodic ? 1109 - (OAG_OAGLBCTXCTRL_COUNTER_RESUME | 1108 + xe_mmio_write32(mmio, __oa_regs(stream)->oa_ctx_ctrl, 1109 + OAG_OAGLBCTXCTRL_COUNTER_RESUME | 1110 + (stream->periodic ? 1110 1111 OAG_OAGLBCTXCTRL_TIMER_ENABLE | 1111 1112 REG_FIELD_PREP(OAG_OAGLBCTXCTRL_TIMER_PERIOD_MASK, 1112 - stream->period_exponent)) : 0); 1113 + stream->period_exponent) : 0)); 1113 1114 1114 1115 /* 1115 1116 * Initialize Super Queue Internal Cnt Register ··· 1255 1254 static int xe_oa_set_prop_num_syncs(struct xe_oa *oa, u64 value, 1256 1255 struct xe_oa_open_param *param) 1257 1256 { 1257 + if (XE_IOCTL_DBG(oa->xe, value > DRM_XE_MAX_SYNCS)) 1258 + return -EINVAL; 1259 + 1258 1260 param->num_syncs = value; 1259 1261 return 0; 1260 1262 } ··· 1347 1343 ARRAY_SIZE(xe_oa_set_property_funcs_config)); 1348 1344 1349 1345 if (XE_IOCTL_DBG(oa->xe, ext.property >= ARRAY_SIZE(xe_oa_set_property_funcs_open)) || 1350 - XE_IOCTL_DBG(oa->xe, ext.pad)) 1346 + XE_IOCTL_DBG(oa->xe, !ext.property) || XE_IOCTL_DBG(oa->xe, ext.pad)) 1351 1347 return -EINVAL; 1352 1348 1353 1349 idx = array_index_nospec(ext.property, ARRAY_SIZE(xe_oa_set_property_funcs_open));
+1 -1
drivers/gpu/drm/xe/xe_sriov_vfio.c
··· 21 21 bool xe_sriov_vfio_migration_supported(struct xe_device *xe) 22 22 { 23 23 if (!IS_SRIOV_PF(xe)) 24 - return -EPERM; 24 + return false; 25 25 26 26 return xe_sriov_pf_migration_supported(xe); 27 27 }
+1 -1
drivers/gpu/drm/xe/xe_svm.h
··· 214 214 { 215 215 #if IS_ENABLED(CONFIG_DRM_GPUSVM) 216 216 return drm_gpusvm_init(&vm->svm.gpusvm, "Xe SVM (simple)", &vm->xe->drm, 217 - NULL, NULL, 0, 0, 0, NULL, NULL, 0); 217 + NULL, 0, 0, 0, NULL, NULL, 0); 218 218 #else 219 219 return 0; 220 220 #endif
+7 -1
drivers/gpu/drm/xe/xe_vm.c
··· 1508 1508 INIT_WORK(&vm->destroy_work, vm_destroy_work_func); 1509 1509 1510 1510 INIT_LIST_HEAD(&vm->preempt.exec_queues); 1511 - vm->preempt.min_run_period_ms = 10; /* FIXME: Wire up to uAPI */ 1511 + if (flags & XE_VM_FLAG_FAULT_MODE) 1512 + vm->preempt.min_run_period_ms = 0; 1513 + else 1514 + vm->preempt.min_run_period_ms = 5; 1512 1515 1513 1516 for_each_tile(tile, xe, id) 1514 1517 xe_range_fence_tree_init(&vm->rftree[id]); ··· 3325 3322 return -EINVAL; 3326 3323 3327 3324 if (XE_IOCTL_DBG(xe, args->extensions)) 3325 + return -EINVAL; 3326 + 3327 + if (XE_IOCTL_DBG(xe, args->num_syncs > DRM_XE_MAX_SYNCS)) 3328 3328 return -EINVAL; 3329 3329 3330 3330 if (args->num_binds > 1) {
+1 -1
drivers/gpu/drm/xe/xe_vm_types.h
··· 263 263 * @min_run_period_ms: The minimum run period before preempting 264 264 * an engine again 265 265 */ 266 - s64 min_run_period_ms; 266 + unsigned int min_run_period_ms; 267 267 /** @exec_queues: list of exec queues attached to this VM */ 268 268 struct list_head exec_queues; 269 269 /** @num_exec_queues: number exec queues attached to this VM */
-8
drivers/gpu/drm/xe/xe_wa.c
··· 270 270 XE_RTP_ACTIONS(SET(VDBOX_CGCTL3F1C(0), MFXPIPE_CLKGATE_DIS)), 271 271 XE_RTP_ENTRY_FLAG(FOREACH_ENGINE), 272 272 }, 273 - { XE_RTP_NAME("14020316580"), 274 - XE_RTP_RULES(MEDIA_VERSION(1301)), 275 - XE_RTP_ACTIONS(CLR(POWERGATE_ENABLE, 276 - VDN_HCP_POWERGATE_ENABLE(0) | 277 - VDN_MFXVDENC_POWERGATE_ENABLE(0) | 278 - VDN_HCP_POWERGATE_ENABLE(2) | 279 - VDN_MFXVDENC_POWERGATE_ENABLE(2))), 280 - }, 281 273 { XE_RTP_NAME("14019449301"), 282 274 XE_RTP_RULES(MEDIA_VERSION(1301), ENGINE_CLASS(VIDEO_DECODE)), 283 275 XE_RTP_ACTIONS(SET(VDBOX_CGCTL3F08(0), CG3DDISHRS_CLKGATE_DIS)),
+1
drivers/gpu/drm/xe/xe_wa_oob.rules
··· 76 76 77 77 15015404425_disable PLATFORM(PANTHERLAKE), MEDIA_STEP(B0, FOREVER) 78 78 16026007364 MEDIA_VERSION(3000) 79 + 14020316580 MEDIA_VERSION(1301)
+1
drivers/hid/hid-debug.c
··· 3513 3513 [ABS_DISTANCE] = "Distance", [ABS_TILT_X] = "XTilt", 3514 3514 [ABS_TILT_Y] = "YTilt", [ABS_TOOL_WIDTH] = "ToolWidth", 3515 3515 [ABS_VOLUME] = "Volume", [ABS_PROFILE] = "Profile", 3516 + [ABS_SND_PROFILE] = "SoundProfile", 3516 3517 [ABS_MISC] = "Misc", 3517 3518 [ABS_MT_SLOT] = "MTSlot", 3518 3519 [ABS_MT_TOUCH_MAJOR] = "MTMajor",
+9
drivers/hwmon/dell-smm-hwmon.c
··· 76 76 #define DELL_SMM_NO_TEMP 10 77 77 #define DELL_SMM_NO_FANS 4 78 78 79 + /* limit fan multiplier to avoid overflow */ 80 + #define DELL_SMM_MAX_FAN_MULT (INT_MAX / U16_MAX) 81 + 79 82 struct smm_regs { 80 83 unsigned int eax; 81 84 unsigned int ebx; ··· 1256 1253 data->ops = ops; 1257 1254 /* All options must not be 0 */ 1258 1255 data->i8k_fan_mult = fan_mult ? : I8K_FAN_MULT; 1256 + if (data->i8k_fan_mult > DELL_SMM_MAX_FAN_MULT) { 1257 + dev_err(dev, 1258 + "fan multiplier %u is too large (max %u)\n", 1259 + data->i8k_fan_mult, DELL_SMM_MAX_FAN_MULT); 1260 + return -EINVAL; 1261 + } 1259 1262 data->i8k_fan_max = fan_max ? : I8K_FAN_HIGH; 1260 1263 data->i8k_pwm_mult = DIV_ROUND_UP(255, data->i8k_fan_max); 1261 1264
+7 -2
drivers/hwmon/ibmpex.c
··· 277 277 { 278 278 struct ibmpex_bmc_data *data = dev_get_drvdata(dev); 279 279 280 + if (!data) 281 + return -ENODEV; 282 + 280 283 ibmpex_reset_high_low_data(data); 281 284 282 285 return count; ··· 511 508 { 512 509 int i, j; 513 510 511 + hwmon_device_unregister(data->hwmon_dev); 512 + dev_set_drvdata(data->bmc_device, NULL); 513 + 514 514 device_remove_file(data->bmc_device, 515 515 &sensor_dev_attr_reset_high_low.dev_attr); 516 516 device_remove_file(data->bmc_device, &dev_attr_name.attr); ··· 527 521 } 528 522 529 523 list_del(&data->list); 530 - dev_set_drvdata(data->bmc_device, NULL); 531 - hwmon_device_unregister(data->hwmon_dev); 524 + 532 525 ipmi_destroy_user(data->user); 533 526 kfree(data->sensors); 534 527 kfree(data);
+6 -3
drivers/hwmon/ltc4282.c
··· 1000 1000 case hwmon_in_max: 1001 1001 case hwmon_in_min: 1002 1002 case hwmon_in_enable: 1003 - case hwmon_in_reset_history: 1004 1003 return 0644; 1004 + case hwmon_in_reset_history: 1005 + return 0200; 1005 1006 default: 1006 1007 return 0; 1007 1008 } ··· 1021 1020 return 0444; 1022 1021 case hwmon_curr_max: 1023 1022 case hwmon_curr_min: 1024 - case hwmon_curr_reset_history: 1025 1023 return 0644; 1024 + case hwmon_curr_reset_history: 1025 + return 0200; 1026 1026 default: 1027 1027 return 0; 1028 1028 } ··· 1041 1039 return 0444; 1042 1040 case hwmon_power_max: 1043 1041 case hwmon_power_min: 1044 - case hwmon_power_reset_history: 1045 1042 return 0644; 1043 + case hwmon_power_reset_history: 1044 + return 0200; 1046 1045 default: 1047 1046 return 0; 1048 1047 }
+1 -1
drivers/hwmon/tmp401.c
··· 397 397 ret = regmap_read(data->regmap, TMP401_CONVERSION_RATE, &regval); 398 398 if (ret < 0) 399 399 return ret; 400 - *val = (1 << (7 - regval)) * 125; 400 + *val = (1 << (7 - min(regval, 7))) * 125; 401 401 break; 402 402 case hwmon_chip_temp_reset_history: 403 403 *val = 0;
+1
drivers/i2c/busses/Kconfig
··· 167 167 Panther Lake (SOC) 168 168 Wildcat Lake (SOC) 169 169 Diamond Rapids (SOC) 170 + Nova Lake (PCH) 170 171 171 172 This driver can also be built as a module. If so, the module 172 173 will be called i2c-i801.
+1 -2
drivers/i2c/busses/i2c-bcm-iproc.c
··· 1098 1098 1099 1099 platform_set_drvdata(pdev, iproc_i2c); 1100 1100 iproc_i2c->device = &pdev->dev; 1101 - iproc_i2c->type = 1102 - (enum bcm_iproc_i2c_type)of_device_get_match_data(&pdev->dev); 1101 + iproc_i2c->type = (kernel_ulong_t)of_device_get_match_data(&pdev->dev); 1103 1102 init_completion(&iproc_i2c->done); 1104 1103 1105 1104 iproc_i2c->base = devm_platform_ioremap_resource(pdev, 0);
+3
drivers/i2c/busses/i2c-i801.c
··· 85 85 * Panther Lake-P (SOC) 0xe422 32 hard yes yes yes 86 86 * Wildcat Lake-U (SOC) 0x4d22 32 hard yes yes yes 87 87 * Diamond Rapids (SOC) 0x5827 32 hard yes yes yes 88 + * Nova Lake-S (PCH) 0x6e23 32 hard yes yes yes 88 89 * 89 90 * Features supported by this driver: 90 91 * Software PEC no ··· 246 245 #define PCI_DEVICE_ID_INTEL_BIRCH_STREAM_SMBUS 0x5796 247 246 #define PCI_DEVICE_ID_INTEL_DIAMOND_RAPIDS_SMBUS 0x5827 248 247 #define PCI_DEVICE_ID_INTEL_BROXTON_SMBUS 0x5ad4 248 + #define PCI_DEVICE_ID_INTEL_NOVA_LAKE_S_SMBUS 0x6e23 249 249 #define PCI_DEVICE_ID_INTEL_ARROW_LAKE_H_SMBUS 0x7722 250 250 #define PCI_DEVICE_ID_INTEL_RAPTOR_LAKE_S_SMBUS 0x7a23 251 251 #define PCI_DEVICE_ID_INTEL_ALDER_LAKE_S_SMBUS 0x7aa3 ··· 1063 1061 { PCI_DEVICE_DATA(INTEL, PANTHER_LAKE_H_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, 1064 1062 { PCI_DEVICE_DATA(INTEL, PANTHER_LAKE_P_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, 1065 1063 { PCI_DEVICE_DATA(INTEL, WILDCAT_LAKE_U_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, 1064 + { PCI_DEVICE_DATA(INTEL, NOVA_LAKE_S_SMBUS, FEATURES_ICH5 | FEATURE_TCO_CNL) }, 1066 1065 { 0, } 1067 1066 }; 1068 1067
+1 -1
drivers/i2c/busses/i2c-pxa.c
··· 1266 1266 i2c->use_pio = of_property_read_bool(np, "mrvl,i2c-polling"); 1267 1267 i2c->fast_mode = of_property_read_bool(np, "mrvl,i2c-fast-mode"); 1268 1268 1269 - *i2c_types = (enum pxa_i2c_types)device_get_match_data(&pdev->dev); 1269 + *i2c_types = (kernel_ulong_t)device_get_match_data(&pdev->dev); 1270 1270 1271 1271 return 0; 1272 1272 }
+1 -1
drivers/i2c/busses/i2c-rcar.c
··· 1141 1141 if (IS_ERR(priv->io)) 1142 1142 return PTR_ERR(priv->io); 1143 1143 1144 - priv->devtype = (enum rcar_i2c_type)of_device_get_match_data(dev); 1144 + priv->devtype = (kernel_ulong_t)of_device_get_match_data(dev); 1145 1145 init_waitqueue_head(&priv->wait); 1146 1146 1147 1147 adap = &priv->adap;
+5
drivers/input/joystick/xpad.c
··· 133 133 } xpad_device[] = { 134 134 /* Please keep this list sorted by vendor and product ID. */ 135 135 { 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 }, 136 + { 0x0351, 0x1000, "CRKD LP Blueberry Burst Pro Edition (Xbox)", 0, XTYPE_XBOX360 }, 137 + { 0x0351, 0x2000, "CRKD LP Black Tribal Edition (Xbox) ", 0, XTYPE_XBOX360 }, 136 138 { 0x03eb, 0xff01, "Wooting One (Legacy)", 0, XTYPE_XBOX360 }, 137 139 { 0x03eb, 0xff02, "Wooting Two (Legacy)", 0, XTYPE_XBOX360 }, 138 140 { 0x03f0, 0x038D, "HyperX Clutch", 0, XTYPE_XBOX360 }, /* wired */ ··· 422 420 { 0x3285, 0x0663, "Nacon Evol-X", 0, XTYPE_XBOXONE }, 423 421 { 0x3537, 0x1004, "GameSir T4 Kaleid", 0, XTYPE_XBOX360 }, 424 422 { 0x3537, 0x1010, "GameSir G7 SE", 0, XTYPE_XBOXONE }, 423 + { 0x3651, 0x1000, "CRKD SG", 0, XTYPE_XBOX360 }, 425 424 { 0x366c, 0x0005, "ByoWave Proteus Controller", MAP_SHARE_BUTTON, XTYPE_XBOXONE, FLAG_DELAY_INIT }, 426 425 { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX }, 427 426 { 0x37d7, 0x2501, "Flydigi Apex 5", 0, XTYPE_XBOX360 }, ··· 521 518 */ 522 519 { USB_INTERFACE_INFO('X', 'B', 0) }, /* Xbox USB-IF not-approved class */ 523 520 XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 controller */ 521 + XPAD_XBOX360_VENDOR(0x0351), /* CRKD Controllers */ 524 522 XPAD_XBOX360_VENDOR(0x03eb), /* Wooting Keyboards (Legacy) */ 525 523 XPAD_XBOX360_VENDOR(0x03f0), /* HP HyperX Xbox 360 controllers */ 526 524 XPAD_XBOXONE_VENDOR(0x03f0), /* HP HyperX Xbox One controllers */ ··· 582 578 XPAD_XBOXONE_VENDOR(0x3285), /* Nacon Evol-X */ 583 579 XPAD_XBOX360_VENDOR(0x3537), /* GameSir Controllers */ 584 580 XPAD_XBOXONE_VENDOR(0x3537), /* GameSir Controllers */ 581 + XPAD_XBOX360_VENDOR(0x3651), /* CRKD Controllers */ 585 582 XPAD_XBOXONE_VENDOR(0x366c), /* ByoWave controllers */ 586 583 XPAD_XBOX360_VENDOR(0x37d7), /* Flydigi Controllers */ 587 584 XPAD_XBOX360_VENDOR(0x413d), /* Black Shark Green Ghost Controller */
+7
drivers/input/keyboard/atkbd.c
··· 1937 1937 }, 1938 1938 .callback = atkbd_deactivate_fixup, 1939 1939 }, 1940 + { 1941 + .matches = { 1942 + DMI_MATCH(DMI_SYS_VENDOR, "HONOR"), 1943 + DMI_MATCH(DMI_PRODUCT_NAME, "FMB-P"), 1944 + }, 1945 + .callback = atkbd_deactivate_fixup, 1946 + }, 1940 1947 { } 1941 1948 }; 1942 1949
+4 -1
drivers/input/keyboard/lkkbd.c
··· 670 670 671 671 return 0; 672 672 673 - fail3: serio_close(serio); 673 + fail3: disable_work_sync(&lk->tq); 674 + serio_close(serio); 674 675 fail2: serio_set_drvdata(serio, NULL); 675 676 fail1: input_free_device(input_dev); 676 677 kfree(lk); ··· 684 683 static void lkkbd_disconnect(struct serio *serio) 685 684 { 686 685 struct lkkbd *lk = serio_get_drvdata(serio); 686 + 687 + disable_work_sync(&lk->tq); 687 688 688 689 input_get_device(lk->dev); 689 690 input_unregister_device(lk->dev);
+1
drivers/input/mouse/alps.c
··· 2975 2975 2976 2976 psmouse_reset(psmouse); 2977 2977 timer_shutdown_sync(&priv->timer); 2978 + disable_delayed_work_sync(&priv->dev3_register_work); 2978 2979 if (priv->dev2) 2979 2980 input_unregister_device(priv->dev2); 2980 2981 if (!IS_ERR_OR_NULL(priv->dev3))
+7
drivers/input/serio/i8042-acpipnpio.h
··· 1169 1169 .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 1170 1170 SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1171 1171 }, 1172 + { 1173 + .matches = { 1174 + DMI_MATCH(DMI_BOARD_NAME, "X5KK45xS_X5SP45xS"), 1175 + }, 1176 + .driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS | 1177 + SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP) 1178 + }, 1172 1179 /* 1173 1180 * A lot of modern Clevo barebones have touchpad and/or keyboard issues 1174 1181 * after suspend fixable with the forcenorestore quirk.
+4
drivers/input/touchscreen/apple_z2.c
··· 21 21 #define APPLE_Z2_TOUCH_STARTED 3 22 22 #define APPLE_Z2_TOUCH_MOVED 4 23 23 #define APPLE_Z2_CMD_READ_INTERRUPT_DATA 0xEB 24 + #define APPLE_Z2_REPLY_INTERRUPT_DATA 0xE1 24 25 #define APPLE_Z2_HBPP_CMD_BLOB 0x3001 25 26 #define APPLE_Z2_FW_MAGIC 0x5746325A 26 27 #define LOAD_COMMAND_INIT_PAYLOAD 0 ··· 142 141 error = spi_sync_transfer(z2->spidev, &xfer, 1); 143 142 if (error) 144 143 return error; 144 + 145 + if (z2->rx_buf[0] != APPLE_Z2_REPLY_INTERRUPT_DATA) 146 + return 0; 145 147 146 148 pkt_len = (get_unaligned_le16(z2->rx_buf + 1) + 8) & 0xfffffffc; 147 149
+1 -1
drivers/input/touchscreen/ti_am335x_tsc.c
··· 85 85 wire_order[i] = ts_dev->config_inp[i] & 0x0F; 86 86 if (WARN_ON(analog_line[i] > 7)) 87 87 return -EINVAL; 88 - if (WARN_ON(wire_order[i] > ARRAY_SIZE(config_pins))) 88 + if (WARN_ON(wire_order[i] >= ARRAY_SIZE(config_pins))) 89 89 return -EINVAL; 90 90 } 91 91
+5
drivers/iommu/amd/amd_iommu.h
··· 173 173 bool translation_pre_enabled(struct amd_iommu *iommu); 174 174 int __init add_special_device(u8 type, u8 id, u32 *devid, bool cmd_line); 175 175 176 + int amd_iommu_pdom_id_alloc(void); 177 + int amd_iommu_pdom_id_reserve(u16 id, gfp_t gfp); 178 + void amd_iommu_pdom_id_free(int id); 179 + void amd_iommu_pdom_id_destroy(void); 180 + 176 181 #ifdef CONFIG_DMI 177 182 void amd_iommu_apply_ivrs_quirks(void); 178 183 #else
+21 -3
drivers/iommu/amd/init.c
··· 1136 1136 static bool __reuse_device_table(struct amd_iommu *iommu) 1137 1137 { 1138 1138 struct amd_iommu_pci_seg *pci_seg = iommu->pci_seg; 1139 - u32 lo, hi, old_devtb_size; 1139 + struct dev_table_entry *old_dev_tbl_entry; 1140 + u32 lo, hi, old_devtb_size, devid; 1140 1141 phys_addr_t old_devtb_phys; 1142 + u16 dom_id; 1143 + bool dte_v; 1141 1144 u64 entry; 1142 1145 1143 1146 /* Each IOMMU use separate device table with the same size */ ··· 1174 1171 if (pci_seg->old_dev_tbl_cpy == NULL) { 1175 1172 pr_err("Failed to remap memory for reusing old device table!\n"); 1176 1173 return false; 1174 + } 1175 + 1176 + for (devid = 0; devid <= pci_seg->last_bdf; devid++) { 1177 + old_dev_tbl_entry = &pci_seg->old_dev_tbl_cpy[devid]; 1178 + dte_v = FIELD_GET(DTE_FLAG_V, old_dev_tbl_entry->data[0]); 1179 + dom_id = FIELD_GET(DEV_DOMID_MASK, old_dev_tbl_entry->data[1]); 1180 + 1181 + if (!dte_v || !dom_id) 1182 + continue; 1183 + /* 1184 + * ID reservation can fail with -ENOSPC when there 1185 + * are multiple devices present in the same domain, 1186 + * hence check only for -ENOMEM. 1187 + */ 1188 + if (amd_iommu_pdom_id_reserve(dom_id, GFP_KERNEL) == -ENOMEM) 1189 + return false; 1177 1190 } 1178 1191 1179 1192 return true; ··· 3146 3127 3147 3128 static void __init free_dma_resources(void) 3148 3129 { 3149 - ida_destroy(&pdom_ids); 3150 - 3130 + amd_iommu_pdom_id_destroy(); 3151 3131 free_unity_maps(); 3152 3132 } 3153 3133
+18 -9
drivers/iommu/amd/iommu.c
··· 1811 1811 * contain. 1812 1812 * 1813 1813 ****************************************************************************/ 1814 - 1815 - static int pdom_id_alloc(void) 1814 + int amd_iommu_pdom_id_alloc(void) 1816 1815 { 1817 1816 return ida_alloc_range(&pdom_ids, 1, MAX_DOMAIN_ID - 1, GFP_ATOMIC); 1818 1817 } 1819 1818 1820 - static void pdom_id_free(int id) 1819 + int amd_iommu_pdom_id_reserve(u16 id, gfp_t gfp) 1820 + { 1821 + return ida_alloc_range(&pdom_ids, id, id, gfp); 1822 + } 1823 + 1824 + void amd_iommu_pdom_id_free(int id) 1821 1825 { 1822 1826 ida_free(&pdom_ids, id); 1827 + } 1828 + 1829 + void amd_iommu_pdom_id_destroy(void) 1830 + { 1831 + ida_destroy(&pdom_ids); 1823 1832 } 1824 1833 1825 1834 static void free_gcr3_tbl_level1(u64 *tbl) ··· 1873 1864 gcr3_info->glx = 0; 1874 1865 1875 1866 /* Free per device domain ID */ 1876 - pdom_id_free(gcr3_info->domid); 1867 + amd_iommu_pdom_id_free(gcr3_info->domid); 1877 1868 1878 1869 iommu_free_pages(gcr3_info->gcr3_tbl); 1879 1870 gcr3_info->gcr3_tbl = NULL; ··· 1909 1900 return -EBUSY; 1910 1901 1911 1902 /* Allocate per device domain ID */ 1912 - domid = pdom_id_alloc(); 1903 + domid = amd_iommu_pdom_id_alloc(); 1913 1904 if (domid <= 0) 1914 1905 return -ENOSPC; 1915 1906 gcr3_info->domid = domid; 1916 1907 1917 1908 gcr3_info->gcr3_tbl = iommu_alloc_pages_node_sz(nid, GFP_ATOMIC, SZ_4K); 1918 1909 if (gcr3_info->gcr3_tbl == NULL) { 1919 - pdom_id_free(domid); 1910 + amd_iommu_pdom_id_free(domid); 1920 1911 return -ENOMEM; 1921 1912 } 1922 1913 ··· 2512 2503 if (!domain) 2513 2504 return NULL; 2514 2505 2515 - domid = pdom_id_alloc(); 2506 + domid = amd_iommu_pdom_id_alloc(); 2516 2507 if (domid <= 0) { 2517 2508 kfree(domain); 2518 2509 return NULL; ··· 2811 2802 2812 2803 WARN_ON(!list_empty(&domain->dev_list)); 2813 2804 pt_iommu_deinit(&domain->iommu); 2814 - pdom_id_free(domain->id); 2805 + amd_iommu_pdom_id_free(domain->id); 2815 2806 kfree(domain); 2816 2807 } 2817 2808 ··· 2862 2853 domain->ops = &identity_domain_ops; 2863 2854 domain->owner = &amd_iommu_ops; 2864 2855 2865 - identity_domain.id = pdom_id_alloc(); 2856 + identity_domain.id = amd_iommu_pdom_id_alloc(); 2866 2857 2867 2858 protection_domain_init(&identity_domain); 2868 2859 }
+3
drivers/iommu/generic_pt/iommu_pt.h
··· 372 372 373 373 table_mem = iommu_alloc_pages_node_sz(iommu_table->nid, gfp, 374 374 log2_to_int(lg2sz)); 375 + if (!table_mem) 376 + return ERR_PTR(-ENOMEM); 377 + 375 378 if (pt_feature(common, PT_FEAT_DMA_INCOHERENT) && 376 379 mode == ALLOC_NORMAL) { 377 380 int ret = iommu_pages_start_incoherent(
+4 -4
drivers/iommu/intel/irq_remapping.c
··· 1303 1303 * irq_enter(); 1304 1304 * handle_edge_irq() 1305 1305 * irq_chip_ack_parent() 1306 - * irq_move_irq(); // No EOI 1306 + * intel_ack_posted_msi_irq(); // No EOI 1307 1307 * handle_irq_event() 1308 1308 * driver_handler() 1309 1309 * handle_edge_irq() 1310 1310 * irq_chip_ack_parent() 1311 - * irq_move_irq(); // No EOI 1311 + * intel_ack_posted_msi_irq(); // No EOI 1312 1312 * handle_irq_event() 1313 1313 * driver_handler() 1314 1314 * handle_edge_irq() 1315 1315 * irq_chip_ack_parent() 1316 - * irq_move_irq(); // No EOI 1316 + * intel_ack_posted_msi_irq(); // No EOI 1317 1317 * handle_irq_event() 1318 1318 * driver_handler() 1319 1319 * apic_eoi() ··· 1322 1322 */ 1323 1323 static struct irq_chip intel_ir_chip_post_msi = { 1324 1324 .name = "INTEL-IR-POST", 1325 - .irq_ack = irq_move_irq, 1325 + .irq_ack = intel_ack_posted_msi_irq, 1326 1326 .irq_set_affinity = intel_ir_set_affinity, 1327 1327 .irq_compose_msi_msg = intel_ir_compose_msi_msg, 1328 1328 .irq_set_vcpu_affinity = intel_ir_set_vcpu_affinity,
+5 -1
drivers/iommu/iommufd/io_pagetable.c
··· 495 495 return -EOVERFLOW; 496 496 497 497 start_byte = start - ALIGN_DOWN(start, PAGE_SIZE); 498 - dmabuf = dma_buf_get(fd); 498 + if (IS_ENABLED(CONFIG_DMA_SHARED_BUFFER)) 499 + dmabuf = dma_buf_get(fd); 500 + else 501 + dmabuf = ERR_PTR(-ENXIO); 502 + 499 503 if (!IS_ERR(dmabuf)) { 500 504 pages = iopt_alloc_dmabuf_pages(ictx, dmabuf, start_byte, start, 501 505 length,
+11 -3
drivers/iommu/iommufd/selftest.c
··· 1184 1184 unsigned int mockpt_id, 1185 1185 unsigned long start, size_t length) 1186 1186 { 1187 + unsigned long last; 1187 1188 struct iommufd_ioas *ioas; 1188 1189 int rc; 1190 + 1191 + if (!length) 1192 + return -EINVAL; 1193 + if (check_add_overflow(start, length - 1, &last)) 1194 + return -EOVERFLOW; 1189 1195 1190 1196 ioas = iommufd_get_ioas(ucmd->ictx, mockpt_id); 1191 1197 if (IS_ERR(ioas)) 1192 1198 return PTR_ERR(ioas); 1193 1199 down_write(&ioas->iopt.iova_rwsem); 1194 - rc = iopt_reserve_iova(&ioas->iopt, start, start + length - 1, NULL); 1200 + rc = iopt_reserve_iova(&ioas->iopt, start, last, NULL); 1195 1201 up_write(&ioas->iopt.iova_rwsem); 1196 1202 iommufd_put_object(ucmd->ictx, &ioas->obj); 1197 1203 return rc; ··· 1221 1215 page_size = 1 << __ffs(mock->domain.pgsize_bitmap); 1222 1216 if (iova % page_size || length % page_size || 1223 1217 (uintptr_t)uptr % page_size || 1224 - check_add_overflow((uintptr_t)uptr, (uintptr_t)length, &end)) 1225 - return -EINVAL; 1218 + check_add_overflow((uintptr_t)uptr, (uintptr_t)length, &end)) { 1219 + rc = -EINVAL; 1220 + goto out_put; 1221 + } 1226 1222 1227 1223 for (; length; length -= page_size) { 1228 1224 struct page *pages[1];
+53
drivers/misc/lkdtm/bugs.c
··· 8 8 #include "lkdtm.h" 9 9 #include <linux/cpu.h> 10 10 #include <linux/list.h> 11 + #include <linux/hrtimer.h> 11 12 #include <linux/sched.h> 12 13 #include <linux/sched/signal.h> 13 14 #include <linux/sched/task_stack.h> ··· 101 100 stop_machine(panic_stop_irqoff_fn, &v, cpu_online_mask); 102 101 } 103 102 103 + static bool wait_for_panic; 104 + 105 + static enum hrtimer_restart panic_in_hardirq(struct hrtimer *timer) 106 + { 107 + panic("from hard IRQ context"); 108 + 109 + wait_for_panic = false; 110 + return HRTIMER_NORESTART; 111 + } 112 + 113 + static void lkdtm_PANIC_IN_HARDIRQ(void) 114 + { 115 + struct hrtimer timer; 116 + 117 + wait_for_panic = true; 118 + hrtimer_setup_on_stack(&timer, panic_in_hardirq, 119 + CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); 120 + hrtimer_start(&timer, us_to_ktime(100), HRTIMER_MODE_REL_HARD); 121 + 122 + while (READ_ONCE(wait_for_panic)) 123 + cpu_relax(); 124 + 125 + hrtimer_cancel(&timer); 126 + } 127 + 104 128 static void lkdtm_BUG(void) 105 129 { 106 130 BUG(); 131 + } 132 + 133 + static bool wait_for_bug; 134 + 135 + static enum hrtimer_restart bug_in_hardirq(struct hrtimer *timer) 136 + { 137 + BUG(); 138 + 139 + wait_for_bug = false; 140 + return HRTIMER_NORESTART; 141 + } 142 + 143 + static void lkdtm_BUG_IN_HARDIRQ(void) 144 + { 145 + struct hrtimer timer; 146 + 147 + wait_for_bug = true; 148 + hrtimer_setup_on_stack(&timer, bug_in_hardirq, 149 + CLOCK_MONOTONIC, HRTIMER_MODE_REL_HARD); 150 + hrtimer_start(&timer, us_to_ktime(100), HRTIMER_MODE_REL_HARD); 151 + 152 + while (READ_ONCE(wait_for_bug)) 153 + cpu_relax(); 154 + 155 + hrtimer_cancel(&timer); 107 156 } 108 157 109 158 static int warn_counter; ··· 747 696 static struct crashtype crashtypes[] = { 748 697 CRASHTYPE(PANIC), 749 698 CRASHTYPE(PANIC_STOP_IRQOFF), 699 + CRASHTYPE(PANIC_IN_HARDIRQ), 750 700 CRASHTYPE(BUG), 701 + CRASHTYPE(BUG_IN_HARDIRQ), 751 702 CRASHTYPE(WARNING), 752 703 CRASHTYPE(WARNING_MESSAGE), 753 704 CRASHTYPE(EXCEPTION),
+2 -2
drivers/mmc/host/Kconfig
··· 315 315 316 316 config MMC_SDHCI_ESDHC_IMX 317 317 tristate "SDHCI support for the Freescale eSDHC/uSDHC i.MX controller" 318 - depends on ARCH_MXC || COMPILE_TEST 318 + depends on ARCH_MXC || ARCH_S32 || COMPILE_TEST 319 319 depends on MMC_SDHCI_PLTFM 320 320 depends on OF 321 321 select MMC_SDHCI_IO_ACCESSORS 322 322 select MMC_CQHCI 323 323 help 324 324 This selects the Freescale eSDHC/uSDHC controller support 325 - found on i.MX25, i.MX35 i.MX5x and i.MX6x. 325 + found on i.MX25, i.MX35, i.MX5x, i.MX6x, and S32G. 326 326 327 327 If you have a controller with this interface, say Y or M here. 328 328
+1 -1
drivers/mmc/host/sdhci-of-arasan.c
··· 99 99 #define HIWORD_UPDATE(val, mask, shift) \ 100 100 ((val) << (shift) | (mask) << ((shift) + 16)) 101 101 102 - #define CD_STABLE_TIMEOUT_US 1000000 102 + #define CD_STABLE_TIMEOUT_US 2000000 103 103 #define CD_STABLE_MAX_SLEEP_US 10 104 104 105 105 /**
+2 -5
drivers/net/can/Kconfig
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 3 3 menuconfig CAN_DEV 4 - tristate "CAN Device Drivers" 4 + bool "CAN Device Drivers" 5 5 default y 6 6 depends on CAN 7 7 help ··· 17 17 virtual ones. If you own such devices or plan to use the virtual CAN 18 18 interfaces to develop applications, say Y here. 19 19 20 - To compile as a module, choose M here: the module will be called 21 - can-dev. 22 - 23 - if CAN_DEV 20 + if CAN_DEV && CAN 24 21 25 22 config CAN_VCAN 26 23 tristate "Virtual Local CAN Interface (vcan)"
+1 -1
drivers/net/can/Makefile
··· 7 7 obj-$(CONFIG_CAN_VXCAN) += vxcan.o 8 8 obj-$(CONFIG_CAN_SLCAN) += slcan/ 9 9 10 - obj-y += dev/ 10 + obj-$(CONFIG_CAN_DEV) += dev/ 11 11 obj-y += esd/ 12 12 obj-y += rcar/ 13 13 obj-y += rockchip/
+2 -3
drivers/net/can/dev/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 2 3 - obj-$(CONFIG_CAN_DEV) += can-dev.o 3 + obj-$(CONFIG_CAN) += can-dev.o 4 4 5 - can-dev-y += skb.o 6 - 5 + can-dev-$(CONFIG_CAN_DEV) += skb.o 7 6 can-dev-$(CONFIG_CAN_CALC_BITTIMING) += calc_bittiming.o 8 7 can-dev-$(CONFIG_CAN_NETLINK) += bittiming.o 9 8 can-dev-$(CONFIG_CAN_NETLINK) += dev.o
+1 -1
drivers/net/can/usb/gs_usb.c
··· 1074 1074 usb_free_urb(urb); 1075 1075 out_usb_kill_anchored_urbs: 1076 1076 if (!parent->active_channels) { 1077 - usb_kill_anchored_urbs(&dev->tx_submitted); 1077 + usb_kill_anchored_urbs(&parent->rx_submitted); 1078 1078 1079 1079 if (dev->feature & GS_CAN_FEATURE_HW_TIMESTAMP) 1080 1080 gs_usb_timestamp_stop(parent);
-3
drivers/net/dsa/lantiq/lantiq_gswip.c
··· 444 444 if (!priv) 445 445 return; 446 446 447 - /* disable the switch */ 448 - gswip_disable_switch(priv); 449 - 450 447 dsa_unregister_switch(priv->ds); 451 448 452 449 for (i = 0; i < priv->num_gphy_fw; i++)
-2
drivers/net/dsa/lantiq/lantiq_gswip.h
··· 294 294 u16 version; 295 295 }; 296 296 297 - void gswip_disable_switch(struct gswip_priv *priv); 298 - 299 297 int gswip_probe_common(struct gswip_priv *priv, u32 version); 300 298 301 299 #endif /* __LANTIQ_GSWIP_H */
+10 -9
drivers/net/dsa/lantiq/lantiq_gswip_common.c
··· 752 752 return 0; 753 753 } 754 754 755 + static void gswip_teardown(struct dsa_switch *ds) 756 + { 757 + struct gswip_priv *priv = ds->priv; 758 + 759 + regmap_clear_bits(priv->mdio, GSWIP_MDIO_GLOB, GSWIP_MDIO_GLOB_ENABLE); 760 + } 761 + 755 762 static enum dsa_tag_protocol gswip_get_tag_protocol(struct dsa_switch *ds, 756 763 int port, 757 764 enum dsa_tag_protocol mp) ··· 1636 1629 static const struct dsa_switch_ops gswip_switch_ops = { 1637 1630 .get_tag_protocol = gswip_get_tag_protocol, 1638 1631 .setup = gswip_setup, 1632 + .teardown = gswip_teardown, 1639 1633 .port_setup = gswip_port_setup, 1640 1634 .port_enable = gswip_port_enable, 1641 1635 .port_disable = gswip_port_disable, ··· 1663 1655 .port_hsr_join = dsa_port_simple_hsr_join, 1664 1656 .port_hsr_leave = dsa_port_simple_hsr_leave, 1665 1657 }; 1666 - 1667 - void gswip_disable_switch(struct gswip_priv *priv) 1668 - { 1669 - regmap_clear_bits(priv->mdio, GSWIP_MDIO_GLOB, GSWIP_MDIO_GLOB_ENABLE); 1670 - } 1671 - EXPORT_SYMBOL_GPL(gswip_disable_switch); 1672 1658 1673 1659 static int gswip_validate_cpu_port(struct dsa_switch *ds) 1674 1660 { ··· 1720 1718 1721 1719 err = gswip_validate_cpu_port(priv->ds); 1722 1720 if (err) 1723 - goto disable_switch; 1721 + goto unregister_switch; 1724 1722 1725 1723 dev_info(priv->dev, "probed GSWIP version %lx mod %lx\n", 1726 1724 GSWIP_VERSION_REV(version), GSWIP_VERSION_MOD(version)); 1727 1725 1728 1726 return 0; 1729 1727 1730 - disable_switch: 1731 - gswip_disable_switch(priv); 1728 + unregister_switch: 1732 1729 dsa_unregister_switch(priv->ds); 1733 1730 1734 1731 return err;
+41 -5
drivers/net/dsa/lantiq/mxl-gsw1xx.c
··· 11 11 12 12 #include <linux/bits.h> 13 13 #include <linux/delay.h> 14 + #include <linux/jiffies.h> 14 15 #include <linux/module.h> 15 16 #include <linux/of_device.h> 16 17 #include <linux/of_mdio.h> 17 18 #include <linux/regmap.h> 19 + #include <linux/workqueue.h> 18 20 #include <net/dsa.h> 19 21 20 22 #include "lantiq_gswip.h" ··· 31 29 struct regmap *clk; 32 30 struct regmap *shell; 33 31 struct phylink_pcs pcs; 32 + struct delayed_work clear_raneg; 34 33 phy_interface_t tbi_interface; 35 34 struct gswip_priv gswip; 36 35 }; ··· 148 145 { 149 146 struct gsw1xx_priv *priv = pcs_to_gsw1xx(pcs); 150 147 151 - /* Assert SGMII shell reset */ 148 + cancel_delayed_work_sync(&priv->clear_raneg); 149 + 150 + /* Assert SGMII shell reset (will also clear RANEG bit) */ 152 151 regmap_set_bits(priv->shell, GSW1XX_SHELL_RST_REQ, 153 152 GSW1XX_RST_REQ_SGMII_SHELL); 154 153 ··· 260 255 FIELD_PREP(GSW1XX_SGMII_PHY_RX0_CFG2_FILT_CNT, 261 256 GSW1XX_SGMII_PHY_RX0_CFG2_FILT_CNT_DEF); 262 257 263 - /* TODO: Take care of inverted RX pair once generic property is 258 + /* RX lane seems to be inverted internally, so bit 259 + * GSW1XX_SGMII_PHY_RX0_CFG2_INVERT needs to be set for normal 260 + * (ie. non-inverted) operation. 261 + * 262 + * TODO: Take care of inverted RX pair once generic property is 264 263 * available 265 264 */ 265 + 266 + val |= GSW1XX_SGMII_PHY_RX0_CFG2_INVERT; 266 267 267 268 ret = regmap_write(priv->sgmii, GSW1XX_SGMII_PHY_RX0_CFG2, val); 268 269 if (ret < 0) ··· 433 422 return 0; 434 423 } 435 424 425 + static void gsw1xx_pcs_clear_raneg(struct work_struct *work) 426 + { 427 + struct gsw1xx_priv *priv = 428 + container_of(work, struct gsw1xx_priv, clear_raneg.work); 429 + 430 + regmap_clear_bits(priv->sgmii, GSW1XX_SGMII_TBI_ANEGCTL, 431 + GSW1XX_SGMII_TBI_ANEGCTL_RANEG); 432 + } 433 + 436 434 static void gsw1xx_pcs_an_restart(struct phylink_pcs *pcs) 437 435 { 438 436 struct gsw1xx_priv *priv = pcs_to_gsw1xx(pcs); 439 437 438 + cancel_delayed_work_sync(&priv->clear_raneg); 439 + 440 440 regmap_set_bits(priv->sgmii, GSW1XX_SGMII_TBI_ANEGCTL, 441 441 GSW1XX_SGMII_TBI_ANEGCTL_RANEG); 442 + 443 + /* despite being documented as self-clearing, the RANEG bit 444 + * sometimes remains set, preventing auto-negotiation from happening. 445 + * MaxLinear advises to manually clear the bit after 10ms. 446 + */ 447 + schedule_delayed_work(&priv->clear_raneg, msecs_to_jiffies(10)); 442 448 } 443 449 444 450 static void gsw1xx_pcs_link_up(struct phylink_pcs *pcs, ··· 658 630 if (ret) 659 631 return ret; 660 632 633 + INIT_DELAYED_WORK(&priv->clear_raneg, gsw1xx_pcs_clear_raneg); 634 + 661 635 ret = gswip_probe_common(&priv->gswip, version); 662 636 if (ret) 663 637 return ret; ··· 672 642 static void gsw1xx_remove(struct mdio_device *mdiodev) 673 643 { 674 644 struct gswip_priv *priv = dev_get_drvdata(&mdiodev->dev); 645 + struct gsw1xx_priv *gsw1xx_priv; 675 646 676 647 if (!priv) 677 648 return; 678 649 679 - gswip_disable_switch(priv); 680 - 681 650 dsa_unregister_switch(priv->ds); 651 + 652 + gsw1xx_priv = container_of(priv, struct gsw1xx_priv, gswip); 653 + cancel_delayed_work_sync(&gsw1xx_priv->clear_raneg); 682 654 } 683 655 684 656 static void gsw1xx_shutdown(struct mdio_device *mdiodev) 685 657 { 686 658 struct gswip_priv *priv = dev_get_drvdata(&mdiodev->dev); 659 + struct gsw1xx_priv *gsw1xx_priv; 687 660 688 661 if (!priv) 689 662 return; 690 663 664 + dsa_switch_shutdown(priv->ds); 665 + 691 666 dev_set_drvdata(&mdiodev->dev, NULL); 692 667 693 - gswip_disable_switch(priv); 668 + gsw1xx_priv = container_of(priv, struct gsw1xx_priv, gswip); 669 + cancel_delayed_work_sync(&gsw1xx_priv->clear_raneg); 694 670 } 695 671 696 672 static const struct gswip_hw_info gsw12x_data = {
+3
drivers/net/ethernet/broadcom/b44.c
··· 1790 1790 u32 bmcr; 1791 1791 int r; 1792 1792 1793 + if (bp->flags & B44_FLAG_EXTERNAL_PHY) 1794 + return phy_ethtool_nway_reset(dev); 1795 + 1793 1796 spin_lock_irq(&bp->lock); 1794 1797 b44_readphy(bp, MII_BMCR, &bmcr); 1795 1798 b44_readphy(bp, MII_BMCR, &bmcr);
+1 -2
drivers/net/ethernet/broadcom/bnxt/bnxt_xdp.c
··· 268 268 case XDP_TX: 269 269 rx_buf = &rxr->rx_buf_ring[cons]; 270 270 mapping = rx_buf->mapping - bp->rx_dma_offset; 271 - *event &= BNXT_TX_CMP_EVENT; 272 271 273 272 if (unlikely(xdp_buff_has_frags(xdp))) { 274 273 struct skb_shared_info *sinfo = xdp_get_shared_info_from_buff(xdp); 275 274 276 275 tx_needed += sinfo->nr_frags; 277 - *event = BNXT_AGG_EVENT; 278 276 } 279 277 280 278 if (tx_avail < tx_needed) { ··· 285 287 dma_sync_single_for_device(&pdev->dev, mapping + offset, *len, 286 288 bp->rx_dir); 287 289 290 + *event &= ~BNXT_RX_EVENT; 288 291 *event |= BNXT_TX_EVENT; 289 292 __bnxt_xmit_xdp(bp, txr, mapping + offset, *len, 290 293 NEXT_RX(rxr->rx_prod), xdp);
+2 -1
drivers/net/ethernet/freescale/enetc/enetc.c
··· 1787 1787 int xdp_tx_bd_cnt, i, k; 1788 1788 int xdp_tx_frm_cnt = 0; 1789 1789 1790 - if (unlikely(test_bit(ENETC_TX_DOWN, &priv->flags))) 1790 + if (unlikely(test_bit(ENETC_TX_DOWN, &priv->flags) || 1791 + !netif_carrier_ok(ndev))) 1791 1792 return -ENETDOWN; 1792 1793 1793 1794 enetc_lock_mdio();
+6 -1
drivers/net/ethernet/freescale/fec_main.c
··· 3933 3933 txq->bd.cur = bdp; 3934 3934 3935 3935 /* Trigger transmission start */ 3936 - writel(0, txq->bd.reg_desc_active); 3936 + if (!(fep->quirks & FEC_QUIRK_ERR007885) || 3937 + !readl(txq->bd.reg_desc_active) || 3938 + !readl(txq->bd.reg_desc_active) || 3939 + !readl(txq->bd.reg_desc_active) || 3940 + !readl(txq->bd.reg_desc_active)) 3941 + writel(0, txq->bd.reg_desc_active); 3937 3942 3938 3943 return 0; 3939 3944 }
+10 -7
drivers/net/ethernet/google/gve/gve_main.c
··· 647 647 err = gve_alloc_counter_array(priv); 648 648 if (err) 649 649 goto abort_with_rss_config_cache; 650 - err = gve_init_clock(priv); 651 - if (err) 652 - goto abort_with_counter; 653 650 err = gve_alloc_notify_blocks(priv); 654 651 if (err) 655 - goto abort_with_clock; 652 + goto abort_with_counter; 656 653 err = gve_alloc_stats_report(priv); 657 654 if (err) 658 655 goto abort_with_ntfy_blocks; ··· 680 683 } 681 684 } 682 685 686 + err = gve_init_clock(priv); 687 + if (err) { 688 + dev_err(&priv->pdev->dev, "Failed to init clock"); 689 + goto abort_with_ptype_lut; 690 + } 691 + 683 692 err = gve_init_rss_config(priv, priv->rx_cfg.num_queues); 684 693 if (err) { 685 694 dev_err(&priv->pdev->dev, "Failed to init RSS config"); 686 - goto abort_with_ptype_lut; 695 + goto abort_with_clock; 687 696 } 688 697 689 698 err = gve_adminq_report_stats(priv, priv->stats_report_len, ··· 701 698 gve_set_device_resources_ok(priv); 702 699 return 0; 703 700 701 + abort_with_clock: 702 + gve_teardown_clock(priv); 704 703 abort_with_ptype_lut: 705 704 kvfree(priv->ptype_lut_dqo); 706 705 priv->ptype_lut_dqo = NULL; ··· 710 705 gve_free_stats_report(priv); 711 706 abort_with_ntfy_blocks: 712 707 gve_free_notify_blocks(priv); 713 - abort_with_clock: 714 - gve_teardown_clock(priv); 715 708 abort_with_counter: 716 709 gve_free_counter_array(priv); 717 710 abort_with_rss_config_cache:
+3
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
··· 10555 10555 bool writen_to_tbl = false; 10556 10556 int ret = 0; 10557 10557 10558 + if (vlan_id >= VLAN_N_VID) 10559 + return -EINVAL; 10560 + 10558 10561 /* When device is resetting or reset failed, firmware is unable to 10559 10562 * handle mailbox. Just record the vlan id, and remove it after 10560 10563 * reset finished.
+2 -2
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c
··· 193 193 return -EINVAL; 194 194 195 195 for (i = 0; i < ring_num; i++) { 196 - if (req->msg.param[i].tqp_index >= vport->nic.kinfo.rss_size) { 196 + if (req->msg.param[i].tqp_index >= vport->nic.kinfo.num_tqps) { 197 197 dev_err(&hdev->pdev->dev, "tqp index(%u) is out of range(0-%u)\n", 198 198 req->msg.param[i].tqp_index, 199 - vport->nic.kinfo.rss_size - 1U); 199 + vport->nic.kinfo.num_tqps - 1U); 200 200 return -EINVAL; 201 201 } 202 202 }
+2 -2
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
··· 368 368 new_tqps = kinfo->rss_size * num_tc; 369 369 kinfo->num_tqps = min(new_tqps, hdev->num_tqps); 370 370 371 - kinfo->tqp = devm_kcalloc(&hdev->pdev->dev, kinfo->num_tqps, 371 + kinfo->tqp = devm_kcalloc(&hdev->pdev->dev, hdev->num_tqps, 372 372 sizeof(struct hnae3_queue *), GFP_KERNEL); 373 373 if (!kinfo->tqp) 374 374 return -ENOMEM; 375 375 376 - for (i = 0; i < kinfo->num_tqps; i++) { 376 + for (i = 0; i < hdev->num_tqps; i++) { 377 377 hdev->htqp[i].q.handle = &hdev->nic; 378 378 hdev->htqp[i].q.tqp_index = i; 379 379 kinfo->tqp[i] = &hdev->htqp[i].q;
+5
drivers/net/ethernet/mellanox/mlx5/core/devlink.c
··· 197 197 struct pci_dev *pdev = dev->pdev; 198 198 int ret = 0; 199 199 200 + if (mlx5_fw_reset_in_progress(dev)) { 201 + NL_SET_ERR_MSG_MOD(extack, "Can't reload during firmware reset"); 202 + return -EBUSY; 203 + } 204 + 200 205 if (mlx5_dev_is_lightweight(dev)) { 201 206 if (action != DEVLINK_RELOAD_ACTION_DRIVER_REINIT) 202 207 return -EOPNOTSUPP;
+84 -13
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.c
··· 33 33 #include "lib/eq.h" 34 34 #include "fw_tracer.h" 35 35 #include "fw_tracer_tracepoint.h" 36 + #include <linux/ctype.h> 36 37 37 38 static int mlx5_query_mtrc_caps(struct mlx5_fw_tracer *tracer) 38 39 { ··· 359 358 static const char *REPLACE_64_VAL_PARM = "%x%x"; 360 359 static const char *PARAM_CHAR = "%"; 361 360 361 + static bool mlx5_is_valid_spec(const char *str) 362 + { 363 + /* Parse format specifiers to find the actual type. 364 + * Structure: %[flags][width][.precision][length]type 365 + * Skip flags, width, precision & length. 366 + */ 367 + while (isdigit(*str) || *str == '#' || *str == '.' || *str == 'l') 368 + str++; 369 + 370 + /* Check if it's a valid integer/hex specifier or %%: 371 + * Valid formats: %x, %d, %i, %u, etc. 372 + */ 373 + if (*str != 'x' && *str != 'X' && *str != 'd' && *str != 'i' && 374 + *str != 'u' && *str != 'c' && *str != '%') 375 + return false; 376 + 377 + return true; 378 + } 379 + 380 + static bool mlx5_tracer_validate_params(const char *str) 381 + { 382 + const char *substr = str; 383 + 384 + if (!str) 385 + return false; 386 + 387 + substr = strstr(substr, PARAM_CHAR); 388 + while (substr) { 389 + if (!mlx5_is_valid_spec(substr + 1)) 390 + return false; 391 + 392 + if (*(substr + 1) == '%') 393 + substr = strstr(substr + 2, PARAM_CHAR); 394 + else 395 + substr = strstr(substr + 1, PARAM_CHAR); 396 + 397 + } 398 + 399 + return true; 400 + } 401 + 362 402 static int mlx5_tracer_message_hash(u32 message_id) 363 403 { 364 404 return jhash_1word(message_id, 0) & (MESSAGE_HASH_SIZE - 1); ··· 461 419 char *substr, *pstr = str; 462 420 int num_of_params = 0; 463 421 422 + /* Validate that all parameters are valid before processing */ 423 + if (!mlx5_tracer_validate_params(str)) 424 + return -EINVAL; 425 + 464 426 /* replace %llx with %x%x */ 465 427 substr = strstr(pstr, VAL_PARM); 466 428 while (substr) { ··· 473 427 substr = strstr(pstr, VAL_PARM); 474 428 } 475 429 476 - /* count all the % characters */ 430 + /* count all the % characters, but skip %% (escaped percent) */ 477 431 substr = strstr(str, PARAM_CHAR); 478 432 while (substr) { 479 - num_of_params += 1; 480 - str = substr + 1; 433 + if (*(substr + 1) != '%') { 434 + num_of_params += 1; 435 + str = substr + 1; 436 + } else { 437 + str = substr + 2; 438 + } 481 439 substr = strstr(str, PARAM_CHAR); 482 440 } 483 441 ··· 620 570 { 621 571 char tmp[512]; 622 572 623 - snprintf(tmp, sizeof(tmp), str_frmt->string, 624 - str_frmt->params[0], 625 - str_frmt->params[1], 626 - str_frmt->params[2], 627 - str_frmt->params[3], 628 - str_frmt->params[4], 629 - str_frmt->params[5], 630 - str_frmt->params[6]); 573 + if (str_frmt->invalid_string) 574 + snprintf(tmp, sizeof(tmp), "BAD_FORMAT: %s", str_frmt->string); 575 + else 576 + snprintf(tmp, sizeof(tmp), str_frmt->string, 577 + str_frmt->params[0], 578 + str_frmt->params[1], 579 + str_frmt->params[2], 580 + str_frmt->params[3], 581 + str_frmt->params[4], 582 + str_frmt->params[5], 583 + str_frmt->params[6]); 631 584 632 585 trace_mlx5_fw(dev->tracer, trace_timestamp, str_frmt->lost, 633 586 str_frmt->event_id, tmp); ··· 662 609 return 0; 663 610 } 664 611 612 + static void mlx5_tracer_handle_bad_format_string(struct mlx5_fw_tracer *tracer, 613 + struct tracer_string_format *cur_string) 614 + { 615 + cur_string->invalid_string = true; 616 + list_add_tail(&cur_string->list, &tracer->ready_strings_list); 617 + } 618 + 665 619 static int mlx5_tracer_handle_string_trace(struct mlx5_fw_tracer *tracer, 666 620 struct tracer_event *tracer_event) 667 621 { ··· 679 619 if (!cur_string) 680 620 return mlx5_tracer_handle_raw_string(tracer, tracer_event); 681 621 682 - cur_string->num_of_params = mlx5_tracer_get_num_of_params(cur_string->string); 683 - cur_string->last_param_num = 0; 684 622 cur_string->event_id = tracer_event->event_id; 685 623 cur_string->tmsn = tracer_event->string_event.tmsn; 686 624 cur_string->timestamp = tracer_event->string_event.timestamp; 687 625 cur_string->lost = tracer_event->lost_event; 626 + cur_string->last_param_num = 0; 627 + cur_string->num_of_params = mlx5_tracer_get_num_of_params(cur_string->string); 628 + if (cur_string->num_of_params < 0) { 629 + pr_debug("%s Invalid format string parameters\n", 630 + __func__); 631 + mlx5_tracer_handle_bad_format_string(tracer, cur_string); 632 + return 0; 633 + } 688 634 if (cur_string->num_of_params == 0) /* trace with no params */ 689 635 list_add_tail(&cur_string->list, &tracer->ready_strings_list); 690 636 } else { ··· 699 633 pr_debug("%s Got string event for unknown string tmsn: %d\n", 700 634 __func__, tracer_event->string_event.tmsn); 701 635 return mlx5_tracer_handle_raw_string(tracer, tracer_event); 636 + } 637 + if (cur_string->num_of_params < 0) { 638 + pr_debug("%s string parameter of invalid string, dumping\n", 639 + __func__); 640 + return 0; 702 641 } 703 642 cur_string->last_param_num += 1; 704 643 if (cur_string->last_param_num > TRACER_MAX_PARAMS) {
+1
drivers/net/ethernet/mellanox/mlx5/core/diag/fw_tracer.h
··· 125 125 struct list_head list; 126 126 u32 timestamp; 127 127 bool lost; 128 + bool invalid_string; 128 129 }; 129 130 130 131 enum mlx5_fw_tracer_ownership_state {
+1 -1
drivers/net/ethernet/mellanox/mlx5/core/en.h
··· 69 69 #define MLX5E_METADATA_ETHER_TYPE (0x8CE4) 70 70 #define MLX5E_METADATA_ETHER_LEN 8 71 71 72 - #define MLX5E_ETH_HARD_MTU (ETH_HLEN + PSP_ENCAP_HLEN + PSP_TRL_SIZE + VLAN_HLEN + ETH_FCS_LEN) 72 + #define MLX5E_ETH_HARD_MTU (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN) 73 73 74 74 #define MLX5E_HW2SW_MTU(params, hwmtu) ((hwmtu) - ((params)->hard_mtu)) 75 75 #define MLX5E_SW2HW_MTU(params, swmtu) ((swmtu) + ((params)->hard_mtu))
+5 -3
drivers/net/ethernet/mellanox/mlx5/core/en_accel/ipsec.c
··· 342 342 rt_dst_entry = &rt->dst; 343 343 break; 344 344 case AF_INET6: 345 - rt_dst_entry = ipv6_stub->ipv6_dst_lookup_flow( 346 - dev_net(netdev), NULL, &fl6, NULL); 347 - if (IS_ERR(rt_dst_entry)) 345 + if (!IS_ENABLED(CONFIG_IPV6) || 346 + ip6_dst_lookup(dev_net(netdev), NULL, &rt_dst_entry, &fl6)) 348 347 goto neigh; 349 348 break; 350 349 default: ··· 358 359 359 360 neigh_ha_snapshot(addr, n, netdev); 360 361 ether_addr_copy(dst, addr); 362 + if (attrs->dir == XFRM_DEV_OFFLOAD_OUT && 363 + is_zero_ether_addr(addr)) 364 + neigh_event_send(n, NULL); 361 365 dst_release(rt_dst_entry); 362 366 neigh_release(n); 363 367 return;
-1
drivers/net/ethernet/mellanox/mlx5/core/en_main.c
··· 6825 6825 * is already unregistered before changing to NIC profile. 6826 6826 */ 6827 6827 if (priv->netdev->reg_state == NETREG_REGISTERED) { 6828 - mlx5e_psp_unregister(priv); 6829 6828 unregister_netdev(priv->netdev); 6830 6829 _mlx5e_suspend(adev, false); 6831 6830 } else {
+5 -1
drivers/net/ethernet/mellanox/mlx5/core/en_tx.c
··· 939 939 sq->dma_fifo_cc = dma_fifo_cc; 940 940 sq->cc = sqcc; 941 941 942 - netdev_tx_completed_queue(sq->txq, npkts, nbytes); 942 + /* Do not update BQL for TXQs that got replaced by new active ones, as 943 + * netdev_tx_reset_queue() is called for them in mlx5e_activate_txqsq(). 944 + */ 945 + if (sq == sq->priv->txq2sq[sq->txq_ix]) 946 + netdev_tx_completed_queue(sq->txq, npkts, nbytes); 943 947 } 944 948 945 949 #ifdef CONFIG_MLX5_CORE_IPOIB
+6
drivers/net/ethernet/mellanox/mlx5/core/eswitch_offloads.c
··· 52 52 #include "devlink.h" 53 53 #include "lag/lag.h" 54 54 #include "en/tc/post_meter.h" 55 + #include "fw_reset.h" 55 56 56 57 /* There are two match-all miss flows, one for unicast dst mac and 57 58 * one for multicast. ··· 3991 3990 esw = mlx5_devlink_eswitch_get(devlink); 3992 3991 if (IS_ERR(esw)) 3993 3992 return PTR_ERR(esw); 3993 + 3994 + if (mlx5_fw_reset_in_progress(esw->dev)) { 3995 + NL_SET_ERR_MSG_MOD(extack, "Can't change eswitch mode during firmware reset"); 3996 + return -EBUSY; 3997 + } 3994 3998 3995 3999 if (esw_mode_from_devlink(mode, &mlx5_mode)) 3996 4000 return -EINVAL;
+43 -5
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.c
··· 15 15 MLX5_FW_RESET_FLAGS_DROP_NEW_REQUESTS, 16 16 MLX5_FW_RESET_FLAGS_RELOAD_REQUIRED, 17 17 MLX5_FW_RESET_FLAGS_UNLOAD_EVENT, 18 + MLX5_FW_RESET_FLAGS_RESET_IN_PROGRESS, 18 19 }; 19 20 20 21 struct mlx5_fw_reset { ··· 127 126 int mlx5_fw_reset_query(struct mlx5_core_dev *dev, u8 *reset_level, u8 *reset_type) 128 127 { 129 128 return mlx5_reg_mfrl_query(dev, reset_level, reset_type, NULL, NULL); 129 + } 130 + 131 + bool mlx5_fw_reset_in_progress(struct mlx5_core_dev *dev) 132 + { 133 + struct mlx5_fw_reset *fw_reset = dev->priv.fw_reset; 134 + 135 + if (!fw_reset) 136 + return false; 137 + 138 + return test_bit(MLX5_FW_RESET_FLAGS_RESET_IN_PROGRESS, &fw_reset->reset_flags); 130 139 } 131 140 132 141 static int mlx5_fw_reset_get_reset_method(struct mlx5_core_dev *dev, ··· 254 243 BIT(DEVLINK_RELOAD_ACTION_FW_ACTIVATE)); 255 244 devl_unlock(devlink); 256 245 } 246 + 247 + clear_bit(MLX5_FW_RESET_FLAGS_RESET_IN_PROGRESS, &fw_reset->reset_flags); 257 248 } 258 249 259 250 static void mlx5_stop_sync_reset_poll(struct mlx5_core_dev *dev) ··· 475 462 struct mlx5_fw_reset *fw_reset = container_of(work, struct mlx5_fw_reset, 476 463 reset_request_work); 477 464 struct mlx5_core_dev *dev = fw_reset->dev; 465 + bool nack_request = false; 466 + struct devlink *devlink; 478 467 int err; 479 468 480 469 err = mlx5_fw_reset_get_reset_method(dev, &fw_reset->reset_method); 481 - if (err) 470 + if (err) { 471 + nack_request = true; 482 472 mlx5_core_warn(dev, "Failed reading MFRL, err %d\n", err); 473 + } else if (!mlx5_is_reset_now_capable(dev, fw_reset->reset_method) || 474 + test_bit(MLX5_FW_RESET_FLAGS_NACK_RESET_REQUEST, 475 + &fw_reset->reset_flags)) { 476 + nack_request = true; 477 + } 483 478 484 - if (err || test_bit(MLX5_FW_RESET_FLAGS_NACK_RESET_REQUEST, &fw_reset->reset_flags) || 485 - !mlx5_is_reset_now_capable(dev, fw_reset->reset_method)) { 479 + devlink = priv_to_devlink(dev); 480 + /* For external resets, try to acquire devl_lock. Skip if devlink reset is 481 + * pending (lock already held) 482 + */ 483 + if (nack_request || 484 + (!test_bit(MLX5_FW_RESET_FLAGS_PENDING_COMP, 485 + &fw_reset->reset_flags) && 486 + !devl_trylock(devlink))) { 486 487 err = mlx5_fw_reset_set_reset_sync_nack(dev); 487 488 mlx5_core_warn(dev, "PCI Sync FW Update Reset Nack %s", 488 489 err ? "Failed" : "Sent"); 489 490 return; 490 491 } 492 + 491 493 if (mlx5_sync_reset_set_reset_requested(dev)) 492 - return; 494 + goto unlock; 495 + 496 + set_bit(MLX5_FW_RESET_FLAGS_RESET_IN_PROGRESS, &fw_reset->reset_flags); 493 497 494 498 err = mlx5_fw_reset_set_reset_sync_ack(dev); 495 499 if (err) 496 500 mlx5_core_warn(dev, "PCI Sync FW Update Reset Ack Failed. Error code: %d\n", err); 497 501 else 498 502 mlx5_core_warn(dev, "PCI Sync FW Update Reset Ack. Device reset is expected.\n"); 503 + 504 + unlock: 505 + if (!test_bit(MLX5_FW_RESET_FLAGS_PENDING_COMP, &fw_reset->reset_flags)) 506 + devl_unlock(devlink); 499 507 } 500 508 501 509 static int mlx5_pci_link_toggle(struct mlx5_core_dev *dev, u16 dev_id) ··· 756 722 757 723 if (mlx5_sync_reset_clear_reset_requested(dev, true)) 758 724 return; 725 + 726 + clear_bit(MLX5_FW_RESET_FLAGS_RESET_IN_PROGRESS, &fw_reset->reset_flags); 759 727 mlx5_core_warn(dev, "PCI Sync FW Update Reset Aborted.\n"); 760 728 } 761 729 ··· 794 758 795 759 if (mlx5_sync_reset_clear_reset_requested(dev, true)) 796 760 return; 761 + clear_bit(MLX5_FW_RESET_FLAGS_RESET_IN_PROGRESS, &fw_reset->reset_flags); 797 762 mlx5_core_warn(dev, "PCI Sync FW Update Reset Timeout.\n"); 798 763 } 799 764 ··· 881 844 cancel_work_sync(&fw_reset->reset_reload_work); 882 845 cancel_work_sync(&fw_reset->reset_now_work); 883 846 cancel_work_sync(&fw_reset->reset_abort_work); 884 - cancel_delayed_work(&fw_reset->reset_timeout_work); 847 + if (test_bit(MLX5_FW_RESET_FLAGS_RESET_REQUESTED, &fw_reset->reset_flags)) 848 + mlx5_sync_reset_clear_reset_requested(dev, true); 885 849 } 886 850 887 851 static const struct devlink_param mlx5_fw_reset_devlink_params[] = {
+1
drivers/net/ethernet/mellanox/mlx5/core/fw_reset.h
··· 10 10 int mlx5_fw_reset_set_reset_sync(struct mlx5_core_dev *dev, u8 reset_type_sel, 11 11 struct netlink_ext_ack *extack); 12 12 int mlx5_fw_reset_set_live_patch(struct mlx5_core_dev *dev); 13 + bool mlx5_fw_reset_in_progress(struct mlx5_core_dev *dev); 13 14 14 15 int mlx5_fw_reset_wait_reset_done(struct mlx5_core_dev *dev); 15 16 void mlx5_sync_reset_unload_flow(struct mlx5_core_dev *dev, bool locked);
+1
drivers/net/ethernet/mellanox/mlx5/core/lag/lag.c
··· 1413 1413 static void mlx5_lag_unregister_hca_devcom_comp(struct mlx5_core_dev *dev) 1414 1414 { 1415 1415 mlx5_devcom_unregister_component(dev->priv.hca_devcom_comp); 1416 + dev->priv.hca_devcom_comp = NULL; 1416 1417 } 1417 1418 1418 1419 static int mlx5_lag_register_hca_devcom_comp(struct mlx5_core_dev *dev)
+9 -2
drivers/net/ethernet/mellanox/mlx5/core/lag/mpesw.c
··· 67 67 68 68 static int enable_mpesw(struct mlx5_lag *ldev) 69 69 { 70 - int idx = mlx5_lag_get_dev_index_by_seq(ldev, MLX5_LAG_P1); 71 70 struct mlx5_core_dev *dev0; 72 71 int err; 72 + int idx; 73 73 int i; 74 74 75 - if (idx < 0 || ldev->mode != MLX5_LAG_MODE_NONE) 75 + if (ldev->mode == MLX5_LAG_MODE_MPESW) 76 + return 0; 77 + 78 + if (ldev->mode != MLX5_LAG_MODE_NONE) 79 + return -EINVAL; 80 + 81 + idx = mlx5_lag_get_dev_index_by_seq(ldev, MLX5_LAG_P1); 82 + if (idx < 0) 76 83 return -EINVAL; 77 84 78 85 dev0 = ldev->pf[idx].dev;
+1
drivers/net/ethernet/mellanox/mlx5/core/main.c
··· 2231 2231 2232 2232 mlx5_core_info(dev, "Shutdown was called\n"); 2233 2233 set_bit(MLX5_BREAK_FW_WAIT, &dev->intf_state); 2234 + mlx5_drain_fw_reset(dev); 2234 2235 mlx5_drain_health_wq(dev); 2235 2236 err = mlx5_try_fast_unload(dev); 2236 2237 if (err)
+2
drivers/net/ethernet/mellanox/mlxsw/spectrum_mr.c
··· 440 440 rhashtable_remove_fast(&mr_table->route_ht, 441 441 &mr_orig_route->ht_node, 442 442 mlxsw_sp_mr_route_ht_params); 443 + mutex_lock(&mr_table->route_list_lock); 443 444 list_del(&mr_orig_route->node); 445 + mutex_unlock(&mr_table->route_list_lock); 444 446 mlxsw_sp_mr_route_destroy(mr_table, mr_orig_route); 445 447 } 446 448
+14 -13
drivers/net/ethernet/mellanox/mlxsw/spectrum_router.c
··· 2265 2265 if (!neigh_entry) 2266 2266 return NULL; 2267 2267 2268 + neigh_hold(n); 2268 2269 neigh_entry->key.n = n; 2269 2270 neigh_entry->rif = rif; 2270 2271 INIT_LIST_HEAD(&neigh_entry->nexthop_list); ··· 2275 2274 2276 2275 static void mlxsw_sp_neigh_entry_free(struct mlxsw_sp_neigh_entry *neigh_entry) 2277 2276 { 2277 + neigh_release(neigh_entry->key.n); 2278 2278 kfree(neigh_entry); 2279 2279 } 2280 2280 ··· 2860 2858 if (!net_work) 2861 2859 return NOTIFY_BAD; 2862 2860 2861 + /* Take a reference to ensure the neighbour won't be destructed until 2862 + * we drop the reference in the work item. 2863 + */ 2864 + neigh_clone(n); 2865 + 2863 2866 INIT_WORK(&net_work->work, cb); 2864 2867 net_work->mlxsw_sp = router->mlxsw_sp; 2865 2868 net_work->n = n; ··· 2888 2881 struct net *net; 2889 2882 2890 2883 net = neigh_parms_net(n->parms); 2891 - 2892 - /* Take a reference to ensure the neighbour won't be destructed until we 2893 - * drop the reference in delayed work. 2894 - */ 2895 - neigh_clone(n); 2896 2884 return mlxsw_sp_router_schedule_work(net, router, n, 2897 2885 mlxsw_sp_router_neigh_event_work); 2898 2886 } ··· 4322 4320 if (err) 4323 4321 goto err_neigh_entry_insert; 4324 4322 4323 + neigh_release(old_n); 4324 + 4325 4325 read_lock_bh(&n->lock); 4326 4326 nud_state = n->nud_state; 4327 4327 dead = n->dead; ··· 4332 4328 4333 4329 list_for_each_entry(nh, &neigh_entry->nexthop_list, 4334 4330 neigh_list_node) { 4335 - neigh_release(old_n); 4336 - neigh_clone(n); 4337 4331 __mlxsw_sp_nexthop_neigh_update(nh, !entry_connected); 4338 4332 mlxsw_sp_nexthop_group_refresh(mlxsw_sp, nh->nhgi->nh_grp); 4339 4333 } 4340 - 4341 - neigh_release(n); 4342 4334 4343 4335 return 0; 4344 4336 ··· 4428 4428 } 4429 4429 } 4430 4430 4431 + /* Release the reference taken by neigh_lookup() / neigh_create() since 4432 + * neigh_entry already holds one. 4433 + */ 4434 + neigh_release(n); 4435 + 4431 4436 /* If that is the first nexthop connected to that neigh, add to 4432 4437 * nexthop_neighs_list 4433 4438 */ ··· 4459 4454 struct mlxsw_sp_nexthop *nh) 4460 4455 { 4461 4456 struct mlxsw_sp_neigh_entry *neigh_entry = nh->neigh_entry; 4462 - struct neighbour *n; 4463 4457 4464 4458 if (!neigh_entry) 4465 4459 return; 4466 - n = neigh_entry->key.n; 4467 4460 4468 4461 __mlxsw_sp_nexthop_neigh_update(nh, true); 4469 4462 list_del(&nh->neigh_list_node); ··· 4475 4472 4476 4473 if (!neigh_entry->connected && list_empty(&neigh_entry->nexthop_list)) 4477 4474 mlxsw_sp_neigh_entry_destroy(mlxsw_sp, neigh_entry); 4478 - 4479 - neigh_release(n); 4480 4475 } 4481 4476 4482 4477 static bool mlxsw_sp_ipip_netdev_ul_up(struct net_device *ol_dev)
+1 -4
drivers/net/ethernet/realtek/r8169_main.c
··· 2655 2655 2656 2656 static void rtl_prepare_power_down(struct rtl8169_private *tp) 2657 2657 { 2658 - if (tp->dash_enabled) 2659 - return; 2660 - 2661 2658 if (tp->mac_version == RTL_GIGA_MAC_VER_32 || 2662 2659 tp->mac_version == RTL_GIGA_MAC_VER_33) 2663 2660 rtl_ephy_write(tp, 0x19, 0xff64); ··· 4809 4812 rtl_disable_exit_l1(tp); 4810 4813 rtl_prepare_power_down(tp); 4811 4814 4812 - if (tp->dash_type != RTL_DASH_NONE) 4815 + if (tp->dash_type != RTL_DASH_NONE && !tp->saved_wolopts) 4813 4816 rtl8168_driver_stop(tp); 4814 4817 } 4815 4818
+2 -1
drivers/net/ethernet/ti/Kconfig
··· 209 209 depends on PRU_REMOTEPROC 210 210 depends on NET_SWITCHDEV 211 211 depends on ARCH_K3 && OF && TI_K3_UDMA_GLUE_LAYER 212 + depends on PTP_1588_CLOCK_OPTIONAL 212 213 help 213 214 Support dual Gigabit Ethernet ports over the ICSSG PRU Subsystem. 214 215 This subsystem is available on the AM65 SR1.0 platform. ··· 235 234 depends on PRU_REMOTEPROC 236 235 depends on NET_SWITCHDEV 237 236 select TI_ICSS_IEP 238 - imply PTP_1588_CLOCK 237 + depends on PTP_1588_CLOCK_OPTIONAL 239 238 help 240 239 Some TI SoCs has Programmable Realtime Unit (PRU) cores which can 241 240 support Single or Dual Ethernet ports with the help of firmware code
+3
drivers/net/ipvlan/ipvlan_core.c
··· 737 737 struct ethhdr *eth = eth_hdr(skb); 738 738 rx_handler_result_t ret = RX_HANDLER_PASS; 739 739 740 + if (unlikely(skb->pkt_type == PACKET_LOOPBACK)) 741 + return RX_HANDLER_PASS; 742 + 740 743 if (is_multicast_ether_addr(eth->h_dest)) { 741 744 if (ipvlan_external_frame(skb, port)) { 742 745 struct sk_buff *nskb = skb_clone(skb, GFP_ATOMIC);
+1 -1
drivers/net/phy/marvell-88q2xxx.c
··· 698 698 699 699 switch (attr) { 700 700 case hwmon_temp_max: 701 - clamp_val(val, -75000, 180000); 701 + val = clamp(val, -75000, 180000); 702 702 val = (val / 1000) + 75; 703 703 val = FIELD_PREP(MDIO_MMD_PCS_MV_TEMP_SENSOR3_INT_THRESH_MASK, 704 704 val);
-4
drivers/net/phy/realtek/realtek_main.c
··· 691 691 692 692 static int rtl8211f_config_phy_eee(struct phy_device *phydev) 693 693 { 694 - /* RTL8211FVD has no PHYCR2 register */ 695 - if (phydev->drv->phy_id == RTL_8211FVD_PHYID) 696 - return 0; 697 - 698 694 /* Disable PHY-mode EEE so LPI is passed to the MAC */ 699 695 return phy_modify_paged(phydev, RTL8211F_PHYCR_PAGE, RTL8211F_PHYCR2, 700 696 RTL8211F_PHYCR2_PHY_EEE_ENABLE, 0);
+2
drivers/net/phy/sfp.c
··· 497 497 SFP_QUIRK("ALCATELLUCENT", "3FE46541AA", sfp_quirk_2500basex, 498 498 sfp_fixup_nokia), 499 499 500 + SFP_QUIRK_F("BIDB", "X-ONU-SFPP", sfp_fixup_potron), 501 + 500 502 // FLYPRO SFP-10GT-CS-30M uses Rollball protocol to talk to the PHY. 501 503 SFP_QUIRK_F("FLYPRO", "SFP-10GT-CS-30M", sfp_fixup_rollball), 502 504
+1 -1
drivers/nfc/pn533/usb.c
··· 406 406 if (rc || (transferred != sizeof(cmd))) { 407 407 nfc_err(&phy->udev->dev, 408 408 "Reader power on cmd error %d\n", rc); 409 - return rc; 409 + return rc ?: -EINVAL; 410 410 } 411 411 412 412 rc = usb_submit_urb(phy->in_urb, GFP_KERNEL);
+1 -1
drivers/of/fdt.c
··· 503 503 if (!initial_boot_params) 504 504 return; 505 505 506 - fdt_scan_reserved_mem(); 507 506 fdt_reserve_elfcorehdr(); 507 + fdt_scan_reserved_mem(); 508 508 509 509 /* Process header /memreserve/ fields */ 510 510 for (n = 0; ; n++) {
+18 -6
drivers/powercap/intel_rapl_common.c
··· 2032 2032 return ret; 2033 2033 } 2034 2034 2035 - int rapl_package_add_pmu(struct rapl_package *rp) 2035 + int rapl_package_add_pmu_locked(struct rapl_package *rp) 2036 2036 { 2037 2037 struct rapl_package_pmu_data *data = &rp->pmu_data; 2038 2038 int idx; 2039 2039 2040 2040 if (rp->has_pmu) 2041 2041 return -EEXIST; 2042 - 2043 - guard(cpus_read_lock)(); 2044 2042 2045 2043 for (idx = 0; idx < rp->nr_domains; idx++) { 2046 2044 struct rapl_domain *rd = &rp->domains[idx]; ··· 2089 2091 2090 2092 return rapl_pmu_update(rp); 2091 2093 } 2094 + EXPORT_SYMBOL_GPL(rapl_package_add_pmu_locked); 2095 + 2096 + int rapl_package_add_pmu(struct rapl_package *rp) 2097 + { 2098 + guard(cpus_read_lock)(); 2099 + 2100 + return rapl_package_add_pmu_locked(rp); 2101 + } 2092 2102 EXPORT_SYMBOL_GPL(rapl_package_add_pmu); 2093 2103 2094 - void rapl_package_remove_pmu(struct rapl_package *rp) 2104 + void rapl_package_remove_pmu_locked(struct rapl_package *rp) 2095 2105 { 2096 2106 struct rapl_package *pos; 2097 2107 2098 2108 if (!rp->has_pmu) 2099 2109 return; 2100 - 2101 - guard(cpus_read_lock)(); 2102 2110 2103 2111 list_for_each_entry(pos, &rapl_packages, plist) { 2104 2112 /* PMU is still needed */ ··· 2114 2110 2115 2111 perf_pmu_unregister(&rapl_pmu.pmu); 2116 2112 memset(&rapl_pmu, 0, sizeof(struct rapl_pmu)); 2113 + } 2114 + EXPORT_SYMBOL_GPL(rapl_package_remove_pmu_locked); 2115 + 2116 + void rapl_package_remove_pmu(struct rapl_package *rp) 2117 + { 2118 + guard(cpus_read_lock)(); 2119 + 2120 + rapl_package_remove_pmu_locked(rp); 2117 2121 } 2118 2122 EXPORT_SYMBOL_GPL(rapl_package_remove_pmu); 2119 2123 #endif
+2 -2
drivers/powercap/intel_rapl_msr.c
··· 82 82 if (IS_ERR(rp)) 83 83 return PTR_ERR(rp); 84 84 if (rapl_msr_pmu) 85 - rapl_package_add_pmu(rp); 85 + rapl_package_add_pmu_locked(rp); 86 86 } 87 87 cpumask_set_cpu(cpu, &rp->cpumask); 88 88 return 0; ··· 101 101 lead_cpu = cpumask_first(&rp->cpumask); 102 102 if (lead_cpu >= nr_cpu_ids) { 103 103 if (rapl_msr_pmu) 104 - rapl_package_remove_pmu(rp); 104 + rapl_package_remove_pmu_locked(rp); 105 105 rapl_remove_package_cpuslocked(rp); 106 106 } else if (rp->lead_cpu == cpu) { 107 107 rp->lead_cpu = lead_cpu;
+14 -8
drivers/powercap/powercap_sys.c
··· 68 68 int id; \ 69 69 struct powercap_zone_constraint *pconst;\ 70 70 \ 71 - if (!sscanf(dev_attr->attr.name, "constraint_%d_", &id)) \ 71 + if (sscanf(dev_attr->attr.name, "constraint_%d_", &id) != 1) \ 72 72 return -EINVAL; \ 73 73 if (id >= power_zone->const_id_cnt) \ 74 74 return -EINVAL; \ ··· 93 93 int id; \ 94 94 struct powercap_zone_constraint *pconst;\ 95 95 \ 96 - if (!sscanf(dev_attr->attr.name, "constraint_%d_", &id)) \ 96 + if (sscanf(dev_attr->attr.name, "constraint_%d_", &id) != 1) \ 97 97 return -EINVAL; \ 98 98 if (id >= power_zone->const_id_cnt) \ 99 99 return -EINVAL; \ ··· 162 162 ssize_t len = -ENODATA; 163 163 struct powercap_zone_constraint *pconst; 164 164 165 - if (!sscanf(dev_attr->attr.name, "constraint_%d_", &id)) 165 + if (sscanf(dev_attr->attr.name, "constraint_%d_", &id) != 1) 166 166 return -EINVAL; 167 167 if (id >= power_zone->const_id_cnt) 168 168 return -EINVAL; ··· 625 625 INIT_LIST_HEAD(&control_type->node); 626 626 control_type->dev.class = &powercap_class; 627 627 dev_set_name(&control_type->dev, "%s", name); 628 - result = device_register(&control_type->dev); 629 - if (result) { 630 - put_device(&control_type->dev); 631 - return ERR_PTR(result); 632 - } 633 628 idr_init(&control_type->idr); 634 629 635 630 mutex_lock(&powercap_cntrl_list_lock); 636 631 list_add_tail(&control_type->node, &powercap_cntrl_list); 637 632 mutex_unlock(&powercap_cntrl_list_lock); 633 + 634 + result = device_register(&control_type->dev); 635 + if (result) { 636 + mutex_lock(&powercap_cntrl_list_lock); 637 + list_del(&control_type->node); 638 + mutex_unlock(&powercap_cntrl_list_lock); 639 + 640 + idr_destroy(&control_type->idr); 641 + put_device(&control_type->dev); 642 + return ERR_PTR(result); 643 + } 638 644 639 645 return control_type; 640 646 }
+6 -2
drivers/spi/spi-cadence-quadspi.c
··· 2001 2001 2002 2002 if (cqspi->use_direct_mode) { 2003 2003 ret = cqspi_request_mmap_dma(cqspi); 2004 - if (ret == -EPROBE_DEFER) 2004 + if (ret == -EPROBE_DEFER) { 2005 + dev_err_probe(&pdev->dev, ret, "Failed to request mmap DMA\n"); 2005 2006 goto probe_setup_failed; 2007 + } 2006 2008 } 2007 2009 2008 2010 ret = spi_register_controller(host); ··· 2026 2024 probe_reset_failed: 2027 2025 if (cqspi->is_jh7110) 2028 2026 cqspi_jh7110_disable_clk(pdev, cqspi); 2029 - clk_disable_unprepare(cqspi->clk); 2027 + 2028 + if (pm_runtime_get_sync(&pdev->dev) >= 0) 2029 + clk_disable_unprepare(cqspi->clk); 2030 2030 probe_clk_failed: 2031 2031 return ret; 2032 2032 }
+1 -1
drivers/spi/spi-fsl-spi.c
··· 335 335 if (t->bits_per_word == 16 || t->bits_per_word == 32) 336 336 t->bits_per_word = 8; /* pretend its 8 bits */ 337 337 if (t->bits_per_word == 8 && t->len >= 256 && 338 - (mpc8xxx_spi->flags & SPI_CPM1)) 338 + !(t->len & 1) && (mpc8xxx_spi->flags & SPI_CPM1)) 339 339 t->bits_per_word = 16; 340 340 } 341 341 }
+1
drivers/spi/spi-mpfs.c
··· 577 577 578 578 ret = devm_spi_register_controller(&pdev->dev, host); 579 579 if (ret) { 580 + mpfs_spi_disable_ints(spi); 580 581 mpfs_spi_disable(spi); 581 582 return dev_err_probe(&pdev->dev, ret, 582 583 "unable to register host for SPI controller\n");
+1 -1
drivers/spi/spi-mt65xx.c
··· 1320 1320 1321 1321 ret = devm_request_threaded_irq(dev, irq, mtk_spi_interrupt, 1322 1322 mtk_spi_interrupt_thread, 1323 - IRQF_TRIGGER_NONE, dev_name(dev), host); 1323 + IRQF_ONESHOT, dev_name(dev), host); 1324 1324 if (ret) 1325 1325 return dev_err_probe(dev, ret, "failed to register irq\n"); 1326 1326
+2 -1
drivers/thermal/intel/int340x_thermal/processor_thermal_device_pci.c
··· 503 503 { PCI_DEVICE_DATA(INTEL, WCL_THERMAL, PROC_THERMAL_FEATURE_MSI_SUPPORT | 504 504 PROC_THERMAL_FEATURE_RAPL | PROC_THERMAL_FEATURE_DLVR | 505 505 PROC_THERMAL_FEATURE_DVFS | PROC_THERMAL_FEATURE_WT_HINT | 506 - PROC_THERMAL_FEATURE_POWER_FLOOR | PROC_THERMAL_FEATURE_PTC) }, 506 + PROC_THERMAL_FEATURE_POWER_FLOOR | PROC_THERMAL_FEATURE_PTC | 507 + PROC_THERMAL_FEATURE_SOC_POWER_SLIDER) }, 507 508 { PCI_DEVICE_DATA(INTEL, NVL_H_THERMAL, PROC_THERMAL_FEATURE_RAPL | 508 509 PROC_THERMAL_FEATURE_DLVR | PROC_THERMAL_FEATURE_DVFS | 509 510 PROC_THERMAL_FEATURE_MSI_SUPPORT | PROC_THERMAL_FEATURE_WT_HINT |
+2 -2
drivers/thermal/thermal_core.c
··· 500 500 WRITE_ONCE(trip->hysteresis, hyst); 501 501 thermal_notify_tz_trip_change(tz, trip); 502 502 /* 503 - * If the zone temperature is above or at the trip tmperature, the trip 503 + * If the zone temperature is above or at the trip temperature, the trip 504 504 * is in the trips_reached list and its threshold is equal to its low 505 505 * temperature. It needs to stay in that list, but its threshold needs 506 506 * to be updated and the list ordering may need to be restored. ··· 1043 1043 * @np: a pointer to a device tree node. 1044 1044 * @type: the thermal cooling device type. 1045 1045 * @devdata: device private data. 1046 - * @ops: standard thermal cooling devices callbacks. 1046 + * @ops: standard thermal cooling devices callbacks. 1047 1047 * 1048 1048 * This interface function adds a new thermal cooling device (fan/processor/...) 1049 1049 * to /sys/class/thermal/ folder as cooling_device[0-*]. It tries to bind itself
+2 -1
fs/btrfs/file.c
··· 2019 2019 else 2020 2020 btrfs_delalloc_release_space(inode, data_reserved, page_start, 2021 2021 reserved_space, true); 2022 - extent_changeset_free(data_reserved); 2023 2022 out_noreserve: 2024 2023 if (only_release_metadata) 2025 2024 btrfs_check_nocow_unlock(inode); 2026 2025 2027 2026 sb_end_pagefault(inode->vfs_inode.i_sb); 2027 + 2028 + extent_changeset_free(data_reserved); 2028 2029 2029 2030 if (ret < 0) 2030 2031 return vmf_error(ret);
+1
fs/btrfs/inode.c
··· 256 256 if (ret < 0) { 257 257 btrfs_err_rl(fs_info, "failed to lookup extent item for logical %llu: %d", 258 258 logical, ret); 259 + btrfs_release_path(&path); 259 260 return; 260 261 } 261 262 eb = path.nodes[0];
+4 -23
fs/btrfs/qgroup.c
··· 1243 1243 btrfs_end_transaction(trans); 1244 1244 else if (trans) 1245 1245 ret = btrfs_end_transaction(trans); 1246 - 1247 - /* 1248 - * At this point we either failed at allocating prealloc, or we 1249 - * succeeded and passed the ownership to it to add_qgroup_rb(). In any 1250 - * case, this needs to be NULL or there is something wrong. 1251 - */ 1252 - ASSERT(prealloc == NULL); 1253 - 1246 + kfree(prealloc); 1254 1247 return ret; 1255 1248 } 1256 1249 ··· 1675 1682 ret = btrfs_sysfs_add_one_qgroup(fs_info, qgroup); 1676 1683 out: 1677 1684 mutex_unlock(&fs_info->qgroup_ioctl_lock); 1678 - /* 1679 - * At this point we either failed at allocating prealloc, or we 1680 - * succeeded and passed the ownership to it to add_qgroup_rb(). In any 1681 - * case, this needs to be NULL or there is something wrong. 1682 - */ 1683 - ASSERT(prealloc == NULL); 1685 + kfree(prealloc); 1684 1686 return ret; 1685 1687 } 1686 1688 ··· 3267 3279 struct btrfs_root *quota_root; 3268 3280 struct btrfs_qgroup *srcgroup; 3269 3281 struct btrfs_qgroup *dstgroup; 3270 - struct btrfs_qgroup *prealloc = NULL; 3282 + struct btrfs_qgroup *prealloc; 3271 3283 struct btrfs_qgroup_list **qlist_prealloc = NULL; 3272 3284 bool free_inherit = false; 3273 3285 bool need_rescan = false; ··· 3508 3520 } 3509 3521 if (free_inherit) 3510 3522 kfree(inherit); 3511 - 3512 - /* 3513 - * At this point we either failed at allocating prealloc, or we 3514 - * succeeded and passed the ownership to it to add_qgroup_rb(). In any 3515 - * case, this needs to be NULL or there is something wrong. 3516 - */ 3517 - ASSERT(prealloc == NULL); 3518 - 3523 + kfree(prealloc); 3519 3524 return ret; 3520 3525 } 3521 3526
-1
fs/btrfs/tests/qgroup-tests.c
··· 187 187 ret = btrfs_search_slot(&trans, root, &key, path, -1, 1); 188 188 if (ret) { 189 189 test_err("couldn't find backref %d", ret); 190 - btrfs_free_path(path); 191 190 return ret; 192 191 } 193 192 btrfs_del_item(&trans, root, path);
+38 -8
fs/btrfs/tree-log.c
··· 5865 5865 struct btrfs_inode *curr_inode = start_inode; 5866 5866 int ret = 0; 5867 5867 5868 - /* 5869 - * If we are logging a new name, as part of a link or rename operation, 5870 - * don't bother logging new dentries, as we just want to log the names 5871 - * of an inode and that any new parents exist. 5872 - */ 5873 - if (ctx->logging_new_name) 5874 - return 0; 5875 - 5876 5868 path = btrfs_alloc_path(); 5877 5869 if (!path) 5878 5870 return -ENOMEM; ··· 6043 6051 return ret; 6044 6052 } 6045 6053 6054 + static bool can_log_conflicting_inode(const struct btrfs_trans_handle *trans, 6055 + const struct btrfs_inode *inode) 6056 + { 6057 + if (!S_ISDIR(inode->vfs_inode.i_mode)) 6058 + return true; 6059 + 6060 + if (inode->last_unlink_trans < trans->transid) 6061 + return true; 6062 + 6063 + /* 6064 + * If this is a directory and its unlink_trans is not from a past 6065 + * transaction then we must fallback to a transaction commit in order 6066 + * to avoid getting a directory with 2 hard links after log replay. 6067 + * 6068 + * This happens if a directory A is renamed, moved from one parent 6069 + * directory to another one, a new file is created in the old parent 6070 + * directory with the old name of our directory A, the new file is 6071 + * fsynced, then we moved the new file to some other parent directory 6072 + * and fsync again the new file. This results in a log tree where we 6073 + * logged that directory A existed, with the INODE_REF item for the 6074 + * new location but without having logged its old parent inode, so 6075 + * that on log replay we add a new link for the new location but the 6076 + * old link remains, resulting in a link count of 2. 6077 + */ 6078 + return false; 6079 + } 6080 + 6046 6081 static int add_conflicting_inode(struct btrfs_trans_handle *trans, 6047 6082 struct btrfs_root *root, 6048 6083 struct btrfs_path *path, ··· 6173 6154 return 0; 6174 6155 } 6175 6156 6157 + if (!can_log_conflicting_inode(trans, inode)) { 6158 + btrfs_add_delayed_iput(inode); 6159 + return BTRFS_LOG_FORCE_COMMIT; 6160 + } 6161 + 6176 6162 btrfs_add_delayed_iput(inode); 6177 6163 6178 6164 ino_elem = kmalloc(sizeof(*ino_elem), GFP_NOFS); ··· 6239 6215 inode = btrfs_iget_logging(parent, root); 6240 6216 if (IS_ERR(inode)) { 6241 6217 ret = PTR_ERR(inode); 6218 + break; 6219 + } 6220 + 6221 + if (!can_log_conflicting_inode(trans, inode)) { 6222 + btrfs_add_delayed_iput(inode); 6223 + ret = BTRFS_LOG_FORCE_COMMIT; 6242 6224 break; 6243 6225 } 6244 6226
+1
fs/btrfs/volumes.c
··· 7128 7128 7129 7129 fs_devices->seeding = true; 7130 7130 fs_devices->opened = 1; 7131 + list_add(&fs_devices->seed_list, &fs_info->fs_devices->seed_list); 7131 7132 return fs_devices; 7132 7133 } 7133 7134
+2
fs/file_attr.c
··· 2 2 #include <linux/fs.h> 3 3 #include <linux/security.h> 4 4 #include <linux/fscrypt.h> 5 + #include <linux/fsnotify.h> 5 6 #include <linux/fileattr.h> 6 7 #include <linux/export.h> 7 8 #include <linux/syscalls.h> ··· 299 298 err = inode->i_op->fileattr_set(idmap, dentry, fa); 300 299 if (err) 301 300 goto out; 301 + fsnotify_xattr(dentry); 302 302 } 303 303 304 304 out:
+21 -29
fs/libfs.c
··· 346 346 * User space expects the directory offset value of the replaced 347 347 * (new) directory entry to be unchanged after a rename. 348 348 * 349 - * Returns zero on success, a negative errno value on failure. 349 + * Caller must have grabbed a slot for new_dentry in the maple_tree 350 + * associated with new_dir, even if dentry is negative. 350 351 */ 351 - int simple_offset_rename(struct inode *old_dir, struct dentry *old_dentry, 352 - struct inode *new_dir, struct dentry *new_dentry) 352 + void simple_offset_rename(struct inode *old_dir, struct dentry *old_dentry, 353 + struct inode *new_dir, struct dentry *new_dentry) 353 354 { 354 355 struct offset_ctx *old_ctx = old_dir->i_op->get_offset_ctx(old_dir); 355 356 struct offset_ctx *new_ctx = new_dir->i_op->get_offset_ctx(new_dir); 356 357 long new_offset = dentry2offset(new_dentry); 357 358 358 - simple_offset_remove(old_ctx, old_dentry); 359 + if (WARN_ON(!new_offset)) 360 + return; 359 361 360 - if (new_offset) { 361 - offset_set(new_dentry, 0); 362 - return simple_offset_replace(new_ctx, old_dentry, new_offset); 363 - } 364 - return simple_offset_add(new_ctx, old_dentry); 362 + simple_offset_remove(old_ctx, old_dentry); 363 + offset_set(new_dentry, 0); 364 + WARN_ON(simple_offset_replace(new_ctx, old_dentry, new_offset)); 365 365 } 366 366 367 367 /** ··· 388 388 long new_index = dentry2offset(new_dentry); 389 389 int ret; 390 390 391 - simple_offset_remove(old_ctx, old_dentry); 392 - simple_offset_remove(new_ctx, new_dentry); 391 + if (WARN_ON(!old_index || !new_index)) 392 + return -EINVAL; 393 393 394 - ret = simple_offset_replace(new_ctx, old_dentry, new_index); 395 - if (ret) 396 - goto out_restore; 394 + ret = mtree_store(&new_ctx->mt, new_index, old_dentry, GFP_KERNEL); 395 + if (WARN_ON(ret)) 396 + return ret; 397 397 398 - ret = simple_offset_replace(old_ctx, new_dentry, old_index); 399 - if (ret) { 400 - simple_offset_remove(new_ctx, old_dentry); 401 - goto out_restore; 398 + ret = mtree_store(&old_ctx->mt, old_index, new_dentry, GFP_KERNEL); 399 + if (WARN_ON(ret)) { 400 + mtree_store(&new_ctx->mt, new_index, new_dentry, GFP_KERNEL); 401 + return ret; 402 402 } 403 403 404 - ret = simple_rename_exchange(old_dir, old_dentry, new_dir, new_dentry); 405 - if (ret) { 406 - simple_offset_remove(new_ctx, old_dentry); 407 - simple_offset_remove(old_ctx, new_dentry); 408 - goto out_restore; 409 - } 404 + offset_set(old_dentry, new_index); 405 + offset_set(new_dentry, old_index); 406 + simple_rename_exchange(old_dir, old_dentry, new_dir, new_dentry); 410 407 return 0; 411 - 412 - out_restore: 413 - (void)simple_offset_replace(old_ctx, old_dentry, old_index); 414 - (void)simple_offset_replace(new_ctx, new_dentry, new_index); 415 - return ret; 416 408 } 417 409 418 410 /**
+8 -1
fs/notify/fsnotify.c
··· 270 270 /* 271 271 * Include parent/name in notification either if some notification 272 272 * groups require parent info or the parent is interested in this event. 273 + * The parent interest in ACCESS/MODIFY events does not apply to special 274 + * files, where read/write are not on the filesystem of the parent and 275 + * events can provide an undesirable side-channel for information 276 + * exfiltration. 273 277 */ 274 - parent_interested = mask & p_mask & ALL_FSNOTIFY_EVENTS; 278 + parent_interested = mask & p_mask & ALL_FSNOTIFY_EVENTS && 279 + !(data_type == FSNOTIFY_EVENT_PATH && 280 + d_is_special(dentry) && 281 + (mask & (FS_ACCESS | FS_MODIFY))); 275 282 if (parent_needed || parent_interested) { 276 283 /* When notifying parent, child should be passed as data */ 277 284 WARN_ON_ONCE(inode != fsnotify_data_inode(data, data_type));
+2 -2
fs/smb/client/cifsfs.h
··· 145 145 #endif /* CONFIG_CIFS_NFSD_EXPORT */ 146 146 147 147 /* when changing internal version - update following two lines at same time */ 148 - #define SMB3_PRODUCT_BUILD 57 149 - #define CIFS_VERSION "2.57" 148 + #define SMB3_PRODUCT_BUILD 58 149 + #define CIFS_VERSION "2.58" 150 150 #endif /* _CIFSFS_H */
+1 -1
fs/smb/client/cifspdu.h
··· 12 12 #include <net/sock.h> 13 13 #include <linux/unaligned.h> 14 14 #include "../common/smbfsctl.h" 15 - #include "../common/smb2pdu.h" 15 + #include "../common/smb1pdu.h" 16 16 17 17 #define CIFS_PROT 0 18 18 #define POSIX_PROT (CIFS_PROT+1)
+56
fs/smb/common/smb1pdu.h
··· 1 + /* SPDX-License-Identifier: LGPL-2.1 */ 2 + /* 3 + * 4 + * Copyright (C) International Business Machines Corp., 2002,2009 5 + * 2018 Samsung Electronics Co., Ltd. 6 + * Author(s): Steve French <sfrench@us.ibm.com> 7 + * Namjae Jeon <linkinjeon@kernel.org> 8 + * 9 + */ 10 + 11 + #ifndef _COMMON_SMB1_PDU_H 12 + #define _COMMON_SMB1_PDU_H 13 + 14 + #define SMB1_PROTO_NUMBER cpu_to_le32(0x424d53ff) 15 + 16 + /* 17 + * See MS-CIFS 2.2.3.1 18 + * MS-SMB 2.2.3.1 19 + */ 20 + struct smb_hdr { 21 + __u8 Protocol[4]; 22 + __u8 Command; 23 + union { 24 + struct { 25 + __u8 ErrorClass; 26 + __u8 Reserved; 27 + __le16 Error; 28 + } __packed DosError; 29 + __le32 CifsError; 30 + } __packed Status; 31 + __u8 Flags; 32 + __le16 Flags2; /* note: le */ 33 + __le16 PidHigh; 34 + union { 35 + struct { 36 + __le32 SequenceNumber; /* le */ 37 + __u32 Reserved; /* zero */ 38 + } __packed Sequence; 39 + __u8 SecuritySignature[8]; /* le */ 40 + } __packed Signature; 41 + __u8 pad[2]; 42 + __u16 Tid; 43 + __le16 Pid; 44 + __u16 Uid; 45 + __le16 Mid; 46 + __u8 WordCount; 47 + } __packed; 48 + 49 + /* See MS-CIFS 2.2.4.52.1 */ 50 + typedef struct smb_negotiate_req { 51 + struct smb_hdr hdr; /* wct = 0 */ 52 + __le16 ByteCount; 53 + unsigned char DialectsArray[]; 54 + } __packed SMB_NEGOTIATE_REQ; 55 + 56 + #endif /* _COMMON_SMB1_PDU_H */
+1 -40
fs/smb/common/smb2pdu.h
··· 1293 1293 struct create_context_hdr ccontext; 1294 1294 __u8 Name[8]; 1295 1295 struct durable_reconnect_context_v2 dcontext; 1296 + __u8 Pad[4]; 1296 1297 } __packed; 1297 1298 1298 1299 /* See MS-SMB2 2.2.14.2.12 */ ··· 1986 1985 __le64 LeaseDuration; 1987 1986 } __packed; 1988 1987 1989 - /* 1990 - * See MS-CIFS 2.2.3.1 1991 - * MS-SMB 2.2.3.1 1992 - */ 1993 - struct smb_hdr { 1994 - __u8 Protocol[4]; 1995 - __u8 Command; 1996 - union { 1997 - struct { 1998 - __u8 ErrorClass; 1999 - __u8 Reserved; 2000 - __le16 Error; 2001 - } __packed DosError; 2002 - __le32 CifsError; 2003 - } __packed Status; 2004 - __u8 Flags; 2005 - __le16 Flags2; /* note: le */ 2006 - __le16 PidHigh; 2007 - union { 2008 - struct { 2009 - __le32 SequenceNumber; /* le */ 2010 - __u32 Reserved; /* zero */ 2011 - } __packed Sequence; 2012 - __u8 SecuritySignature[8]; /* le */ 2013 - } __packed Signature; 2014 - __u8 pad[2]; 2015 - __u16 Tid; 2016 - __le16 Pid; 2017 - __u16 Uid; 2018 - __le16 Mid; 2019 - __u8 WordCount; 2020 - } __packed; 2021 - 2022 1988 #define OP_BREAK_STRUCT_SIZE_20 24 2023 1989 #define OP_BREAK_STRUCT_SIZE_21 36 2024 1990 ··· 2089 2121 | WRITE_OWNER | SYNCHRONIZE) 2090 2122 #define SET_MINIMUM_RIGHTS (FILE_READ_EA | FILE_READ_ATTRIBUTES \ 2091 2123 | READ_CONTROL | SYNCHRONIZE) 2092 - 2093 - /* See MS-CIFS 2.2.4.52.1 */ 2094 - typedef struct smb_negotiate_req { 2095 - struct smb_hdr hdr; /* wct = 0 */ 2096 - __le16 ByteCount; 2097 - unsigned char DialectsArray[]; 2098 - } __packed SMB_NEGOTIATE_REQ; 2099 2124 2100 2125 #endif /* _COMMON_SMB2PDU_H */
+12
fs/smb/common/smbdirect/smbdirect_socket.h
··· 133 133 struct smbdirect_socket_parameters parameters; 134 134 135 135 /* 136 + * The state for connect/negotiation 137 + */ 138 + struct { 139 + spinlock_t lock; 140 + struct work_struct work; 141 + } connect; 142 + 143 + /* 136 144 * The state for keepalive and timeout handling 137 145 */ 138 146 struct { ··· 360 352 361 353 INIT_WORK(&sc->disconnect_work, __smbdirect_socket_disabled_work); 362 354 disable_work_sync(&sc->disconnect_work); 355 + 356 + spin_lock_init(&sc->connect.lock); 357 + INIT_WORK(&sc->connect.work, __smbdirect_socket_disabled_work); 358 + disable_work_sync(&sc->connect.work); 363 359 364 360 INIT_WORK(&sc->idle.immediate_work, __smbdirect_socket_disabled_work); 365 361 disable_work_sync(&sc->idle.immediate_work);
-2
fs/smb/common/smbglob.h
··· 11 11 #ifndef _COMMON_SMB_GLOB_H 12 12 #define _COMMON_SMB_GLOB_H 13 13 14 - #define SMB1_PROTO_NUMBER cpu_to_le32(0x424d53ff) 15 - 16 14 struct smb_version_values { 17 15 char *version_string; 18 16 __u16 protocol_id;
+3 -1
fs/smb/server/mgmt/user_session.c
··· 325 325 sess = ksmbd_session_lookup(conn, id); 326 326 if (!sess && conn->binding) 327 327 sess = ksmbd_session_lookup_slowpath(id); 328 - if (sess && sess->state != SMB2_SESSION_VALID) 328 + if (sess && sess->state != SMB2_SESSION_VALID) { 329 + ksmbd_user_session_put(sess); 329 330 sess = NULL; 331 + } 330 332 return sess; 331 333 } 332 334
+2 -2
fs/smb/server/smb2pdu.c
··· 2363 2363 int rc = 0; 2364 2364 unsigned int next = 0; 2365 2365 2366 - if (buf_len < sizeof(struct smb2_ea_info) + eabuf->EaNameLength + 2366 + if (buf_len < sizeof(struct smb2_ea_info) + eabuf->EaNameLength + 1 + 2367 2367 le16_to_cpu(eabuf->EaValueLength)) 2368 2368 return -EINVAL; 2369 2369 ··· 2440 2440 break; 2441 2441 } 2442 2442 2443 - if (buf_len < sizeof(struct smb2_ea_info) + eabuf->EaNameLength + 2443 + if (buf_len < sizeof(struct smb2_ea_info) + eabuf->EaNameLength + 1 + 2444 2444 le16_to_cpu(eabuf->EaValueLength)) { 2445 2445 rc = -EINVAL; 2446 2446 break;
+1
fs/smb/server/smb_common.h
··· 10 10 11 11 #include "glob.h" 12 12 #include "../common/smbglob.h" 13 + #include "../common/smb1pdu.h" 13 14 #include "../common/smb2pdu.h" 14 15 #include "../common/fscc.h" 15 16 #include "smb2pdu.h"
-3
fs/smb/server/smbacl.c
··· 1307 1307 granted |= le32_to_cpu(ace->access_req); 1308 1308 ace = (struct smb_ace *)((char *)ace + le16_to_cpu(ace->size)); 1309 1309 } 1310 - 1311 - if (!pdacl->num_aces) 1312 - granted = GENERIC_ALL_FLAGS; 1313 1310 } 1314 1311 1315 1312 if (!uid)
+146 -29
fs/smb/server/transport_rdma.c
··· 242 242 * disable[_delayed]_work_sync() 243 243 */ 244 244 disable_work(&sc->disconnect_work); 245 + disable_work(&sc->connect.work); 245 246 disable_work(&sc->recv_io.posted.refill_work); 246 247 disable_delayed_work(&sc->idle.timer_work); 247 248 disable_work(&sc->idle.immediate_work); ··· 298 297 * not queued again but here we don't block and avoid 299 298 * disable[_delayed]_work_sync() 300 299 */ 300 + disable_work(&sc->connect.work); 301 301 disable_work(&sc->recv_io.posted.refill_work); 302 302 disable_work(&sc->idle.immediate_work); 303 303 disable_delayed_work(&sc->idle.timer_work); ··· 469 467 */ 470 468 smb_direct_disconnect_wake_up_all(sc); 471 469 470 + disable_work_sync(&sc->connect.work); 472 471 disable_work_sync(&sc->recv_io.posted.refill_work); 473 472 disable_delayed_work_sync(&sc->idle.timer_work); 474 473 disable_work_sync(&sc->idle.immediate_work); ··· 638 635 639 636 switch (sc->recv_io.expected) { 640 637 case SMBDIRECT_EXPECT_NEGOTIATE_REQ: 641 - if (wc->byte_len < sizeof(struct smbdirect_negotiate_req)) { 642 - put_recvmsg(sc, recvmsg); 643 - smb_direct_disconnect_rdma_connection(sc); 644 - return; 645 - } 646 - sc->recv_io.reassembly.full_packet_received = true; 647 - /* 648 - * Some drivers (at least mlx5_ib) might post a 649 - * recv completion before RDMA_CM_EVENT_ESTABLISHED, 650 - * we need to adjust our expectation in that case. 651 - */ 652 - if (!sc->first_error && sc->status == SMBDIRECT_SOCKET_RDMA_CONNECT_RUNNING) 653 - sc->status = SMBDIRECT_SOCKET_NEGOTIATE_NEEDED; 654 - if (SMBDIRECT_CHECK_STATUS_WARN(sc, SMBDIRECT_SOCKET_NEGOTIATE_NEEDED)) { 655 - put_recvmsg(sc, recvmsg); 656 - smb_direct_disconnect_rdma_connection(sc); 657 - return; 658 - } 659 - sc->status = SMBDIRECT_SOCKET_NEGOTIATE_RUNNING; 660 - enqueue_reassembly(sc, recvmsg, 0); 661 - wake_up(&sc->status_wait); 662 - return; 638 + /* see smb_direct_negotiate_recv_done */ 639 + break; 663 640 case SMBDIRECT_EXPECT_DATA_TRANSFER: { 664 641 struct smbdirect_data_transfer *data_transfer = 665 642 (struct smbdirect_data_transfer *)recvmsg->packet; ··· 725 742 smb_direct_disconnect_rdma_connection(sc); 726 743 } 727 744 745 + static void smb_direct_negotiate_recv_work(struct work_struct *work); 746 + 747 + static void smb_direct_negotiate_recv_done(struct ib_cq *cq, struct ib_wc *wc) 748 + { 749 + struct smbdirect_recv_io *recv_io = 750 + container_of(wc->wr_cqe, struct smbdirect_recv_io, cqe); 751 + struct smbdirect_socket *sc = recv_io->socket; 752 + unsigned long flags; 753 + 754 + /* 755 + * reset the common recv_done for later reuse. 756 + */ 757 + recv_io->cqe.done = recv_done; 758 + 759 + if (wc->status != IB_WC_SUCCESS || wc->opcode != IB_WC_RECV) { 760 + put_recvmsg(sc, recv_io); 761 + if (wc->status != IB_WC_WR_FLUSH_ERR) { 762 + pr_err("Negotiate Recv error. status='%s (%d)' opcode=%d\n", 763 + ib_wc_status_msg(wc->status), wc->status, 764 + wc->opcode); 765 + smb_direct_disconnect_rdma_connection(sc); 766 + } 767 + return; 768 + } 769 + 770 + ksmbd_debug(RDMA, "Negotiate Recv completed. status='%s (%d)', opcode=%d\n", 771 + ib_wc_status_msg(wc->status), wc->status, 772 + wc->opcode); 773 + 774 + ib_dma_sync_single_for_cpu(sc->ib.dev, 775 + recv_io->sge.addr, 776 + recv_io->sge.length, 777 + DMA_FROM_DEVICE); 778 + 779 + /* 780 + * This is an internal error! 781 + */ 782 + if (WARN_ON_ONCE(sc->recv_io.expected != SMBDIRECT_EXPECT_NEGOTIATE_REQ)) { 783 + put_recvmsg(sc, recv_io); 784 + smb_direct_disconnect_rdma_connection(sc); 785 + return; 786 + } 787 + 788 + /* 789 + * Don't reset timer to the keepalive interval in 790 + * this will be done in smb_direct_negotiate_recv_work. 791 + */ 792 + 793 + /* 794 + * Only remember the recv_io if it has enough bytes, 795 + * this gives smb_direct_negotiate_recv_work enough 796 + * information in order to disconnect if it was not 797 + * valid. 798 + */ 799 + sc->recv_io.reassembly.full_packet_received = true; 800 + if (wc->byte_len >= sizeof(struct smbdirect_negotiate_req)) 801 + enqueue_reassembly(sc, recv_io, 0); 802 + else 803 + put_recvmsg(sc, recv_io); 804 + 805 + /* 806 + * Some drivers (at least mlx5_ib and irdma in roce mode) 807 + * might post a recv completion before RDMA_CM_EVENT_ESTABLISHED, 808 + * we need to adjust our expectation in that case. 809 + * 810 + * So we defer further processing of the negotiation 811 + * to smb_direct_negotiate_recv_work(). 812 + * 813 + * If we are already in SMBDIRECT_SOCKET_NEGOTIATE_NEEDED 814 + * we queue the work directly otherwise 815 + * smb_direct_cm_handler() will do it, when 816 + * RDMA_CM_EVENT_ESTABLISHED arrived. 817 + */ 818 + spin_lock_irqsave(&sc->connect.lock, flags); 819 + if (!sc->first_error) { 820 + INIT_WORK(&sc->connect.work, smb_direct_negotiate_recv_work); 821 + if (sc->status == SMBDIRECT_SOCKET_NEGOTIATE_NEEDED) 822 + queue_work(sc->workqueue, &sc->connect.work); 823 + } 824 + spin_unlock_irqrestore(&sc->connect.lock, flags); 825 + } 826 + 827 + static void smb_direct_negotiate_recv_work(struct work_struct *work) 828 + { 829 + struct smbdirect_socket *sc = 830 + container_of(work, struct smbdirect_socket, connect.work); 831 + const struct smbdirect_socket_parameters *sp = &sc->parameters; 832 + struct smbdirect_recv_io *recv_io; 833 + 834 + if (sc->first_error) 835 + return; 836 + 837 + ksmbd_debug(RDMA, "Negotiate Recv Work running\n"); 838 + 839 + /* 840 + * Reset timer to the keepalive interval in 841 + * order to trigger our next keepalive message. 842 + */ 843 + sc->idle.keepalive = SMBDIRECT_KEEPALIVE_NONE; 844 + mod_delayed_work(sc->workqueue, &sc->idle.timer_work, 845 + msecs_to_jiffies(sp->keepalive_interval_msec)); 846 + 847 + /* 848 + * If smb_direct_negotiate_recv_done() detected an 849 + * invalid request we want to disconnect. 850 + */ 851 + recv_io = get_first_reassembly(sc); 852 + if (!recv_io) { 853 + smb_direct_disconnect_rdma_connection(sc); 854 + return; 855 + } 856 + 857 + if (SMBDIRECT_CHECK_STATUS_WARN(sc, SMBDIRECT_SOCKET_NEGOTIATE_NEEDED)) { 858 + smb_direct_disconnect_rdma_connection(sc); 859 + return; 860 + } 861 + sc->status = SMBDIRECT_SOCKET_NEGOTIATE_RUNNING; 862 + wake_up(&sc->status_wait); 863 + } 864 + 728 865 static int smb_direct_post_recv(struct smbdirect_socket *sc, 729 866 struct smbdirect_recv_io *recvmsg) 730 867 { ··· 861 758 return ret; 862 759 recvmsg->sge.length = sp->max_recv_size; 863 760 recvmsg->sge.lkey = sc->ib.pd->local_dma_lkey; 864 - recvmsg->cqe.done = recv_done; 865 761 866 762 wr.wr_cqe = &recvmsg->cqe; 867 763 wr.next = NULL; ··· 1834 1732 struct rdma_cm_event *event) 1835 1733 { 1836 1734 struct smbdirect_socket *sc = cm_id->context; 1735 + unsigned long flags; 1837 1736 1838 1737 ksmbd_debug(RDMA, "RDMA CM event. cm_id=%p event=%s (%d)\n", 1839 1738 cm_id, rdma_event_msg(event->event), event->event); ··· 1842 1739 switch (event->event) { 1843 1740 case RDMA_CM_EVENT_ESTABLISHED: { 1844 1741 /* 1845 - * Some drivers (at least mlx5_ib) might post a 1846 - * recv completion before RDMA_CM_EVENT_ESTABLISHED, 1742 + * Some drivers (at least mlx5_ib and irdma in roce mode) 1743 + * might post a recv completion before RDMA_CM_EVENT_ESTABLISHED, 1847 1744 * we need to adjust our expectation in that case. 1848 1745 * 1849 - * As we already started the negotiation, we just 1850 - * ignore RDMA_CM_EVENT_ESTABLISHED here. 1746 + * If smb_direct_negotiate_recv_done was called first 1747 + * it initialized sc->connect.work only for us to 1748 + * start, so that we turned into 1749 + * SMBDIRECT_SOCKET_NEGOTIATE_NEEDED, before 1750 + * smb_direct_negotiate_recv_work() runs. 1751 + * 1752 + * If smb_direct_negotiate_recv_done didn't happen 1753 + * yet. sc->connect.work is still be disabled and 1754 + * queue_work() is a no-op. 1851 1755 */ 1852 - if (!sc->first_error && sc->status > SMBDIRECT_SOCKET_RDMA_CONNECT_RUNNING) 1853 - break; 1854 1756 if (SMBDIRECT_CHECK_STATUS_DISCONNECT(sc, SMBDIRECT_SOCKET_RDMA_CONNECT_RUNNING)) 1855 1757 break; 1856 1758 sc->status = SMBDIRECT_SOCKET_NEGOTIATE_NEEDED; 1759 + spin_lock_irqsave(&sc->connect.lock, flags); 1760 + if (!sc->first_error) 1761 + queue_work(sc->workqueue, &sc->connect.work); 1762 + spin_unlock_irqrestore(&sc->connect.lock, flags); 1857 1763 wake_up(&sc->status_wait); 1858 1764 break; 1859 1765 } ··· 2033 1921 recvmsg = get_free_recvmsg(sc); 2034 1922 if (!recvmsg) 2035 1923 return -ENOMEM; 1924 + recvmsg->cqe.done = smb_direct_negotiate_recv_done; 2036 1925 2037 1926 ret = smb_direct_post_recv(sc, recvmsg); 2038 1927 if (ret) { ··· 2452 2339 2453 2340 static int smb_direct_connect(struct smbdirect_socket *sc) 2454 2341 { 2342 + struct smbdirect_recv_io *recv_io; 2455 2343 int ret; 2456 2344 2457 2345 ret = smb_direct_init_params(sc); ··· 2466 2352 pr_err("Can't init RDMA pool: %d\n", ret); 2467 2353 return ret; 2468 2354 } 2355 + 2356 + list_for_each_entry(recv_io, &sc->recv_io.free.list, list) 2357 + recv_io->cqe.done = recv_done; 2469 2358 2470 2359 ret = smb_direct_create_qpair(sc); 2471 2360 if (ret) {
+1 -1
fs/smb/server/vfs.c
··· 702 702 rd.old_parent = NULL; 703 703 rd.new_parent = new_path.dentry; 704 704 rd.flags = flags; 705 - rd.delegated_inode = NULL, 705 + rd.delegated_inode = NULL; 706 706 err = start_renaming_dentry(&rd, lookup_flags, old_child, &new_last); 707 707 if (err) 708 708 goto out_drop_write;
+15
fs/xfs/libxfs/xfs_sb.c
··· 301 301 sbp->sb_rbmblocks != xfs_expected_rbmblocks(sbp)) 302 302 return false; 303 303 304 + if (xfs_sb_is_v5(sbp) && 305 + (sbp->sb_features_incompat & XFS_SB_FEAT_INCOMPAT_ZONED)) { 306 + uint32_t mod; 307 + 308 + /* 309 + * Zoned RT devices must be aligned to the RT group size, 310 + * because garbage collection assumes that all zones have the 311 + * same size to avoid insane complexity if that weren't the 312 + * case. 313 + */ 314 + div_u64_rem(sbp->sb_rextents, sbp->sb_rgextents, &mod); 315 + if (mod) 316 + return false; 317 + } 318 + 304 319 return true; 305 320 } 306 321
+1 -1
fs/xfs/scrub/attr_repair.c
··· 333 333 .attr_filter = ent->flags & XFS_ATTR_NSP_ONDISK_MASK, 334 334 .namelen = rentry->namelen, 335 335 .name = rentry->name, 336 - .value = ab->value, 337 336 .valuelen = be32_to_cpu(rentry->valuelen), 338 337 }; 339 338 unsigned int namesize; ··· 362 363 error = -EDEADLOCK; 363 364 if (error) 364 365 return error; 366 + args.value = ab->value; 365 367 366 368 /* Look up the remote value and stash it for reconstruction. */ 367 369 error = xfs_attr3_leaf_getvalue(leaf_bp, &args);
+1 -1
fs/xfs/xfs_attr_item.c
··· 737 737 struct xfs_attri_log_item *attrip = ATTRI_ITEM(lip); 738 738 struct xfs_attr_intent *attr; 739 739 struct xfs_mount *mp = lip->li_log->l_mp; 740 - struct xfs_inode *ip; 740 + struct xfs_inode *ip = NULL; 741 741 struct xfs_da_args *args; 742 742 struct xfs_trans *tp; 743 743 struct xfs_trans_res resv;
+1
fs/xfs/xfs_buf_item.c
··· 896 896 map_size = DIV_ROUND_UP(chunks, NBWORD); 897 897 898 898 if (map_size > XFS_BLF_DATAMAP_SIZE) { 899 + xfs_buf_item_free_format(bip); 899 900 kmem_cache_free(xfs_buf_item_cache, bip); 900 901 xfs_err(mp, 901 902 "buffer item dirty bitmap (%u uints) too small to reflect %u bytes!",
+5 -22
fs/xfs/xfs_discard.c
··· 108 108 * list. We plug and chain the bios so that we only need a single completion 109 109 * call to clear all the busy extents once the discards are complete. 110 110 */ 111 - int 111 + void 112 112 xfs_discard_extents( 113 113 struct xfs_mount *mp, 114 114 struct xfs_busy_extents *extents) ··· 116 116 struct xfs_extent_busy *busyp; 117 117 struct bio *bio = NULL; 118 118 struct blk_plug plug; 119 - int error = 0; 120 119 121 120 blk_start_plug(&plug); 122 121 list_for_each_entry(busyp, &extents->extent_list, list) { ··· 125 126 126 127 trace_xfs_discard_extent(xg, busyp->bno, busyp->length); 127 128 128 - error = __blkdev_issue_discard(btp->bt_bdev, 129 + __blkdev_issue_discard(btp->bt_bdev, 129 130 xfs_gbno_to_daddr(xg, busyp->bno), 130 131 XFS_FSB_TO_BB(mp, busyp->length), 131 132 GFP_KERNEL, &bio); 132 - if (error && error != -EOPNOTSUPP) { 133 - xfs_info(mp, 134 - "discard failed for extent [0x%llx,%u], error %d", 135 - (unsigned long long)busyp->bno, 136 - busyp->length, 137 - error); 138 - break; 139 - } 140 133 } 141 134 142 135 if (bio) { ··· 139 148 xfs_discard_endio_work(&extents->endio_work); 140 149 } 141 150 blk_finish_plug(&plug); 142 - 143 - return error; 144 151 } 145 152 146 153 /* ··· 374 385 * list after this function call, as it may have been freed by 375 386 * the time control returns to us. 376 387 */ 377 - error = xfs_discard_extents(pag_mount(pag), extents); 378 - if (error) 379 - break; 388 + xfs_discard_extents(pag_mount(pag), extents); 380 389 381 390 if (xfs_trim_should_stop()) 382 391 break; ··· 483 496 484 497 trace_xfs_discard_rtextent(mp, busyp->bno, busyp->length); 485 498 486 - error = __blkdev_issue_discard(bdev, 499 + __blkdev_issue_discard(bdev, 487 500 xfs_rtb_to_daddr(mp, busyp->bno), 488 501 XFS_FSB_TO_BB(mp, busyp->length), 489 502 GFP_NOFS, &bio); 490 - if (error) 491 - break; 492 503 } 493 504 xfs_discard_free_rtdev_extents(tr); 494 505 ··· 726 741 * list after this function call, as it may have been freed by 727 742 * the time control returns to us. 728 743 */ 729 - error = xfs_discard_extents(rtg_mount(rtg), tr.extents); 730 - if (error) 731 - break; 744 + xfs_discard_extents(rtg_mount(rtg), tr.extents); 732 745 733 746 low = tr.restart_rtx; 734 747 } while (!xfs_trim_should_stop() && low <= high);
+1 -1
fs/xfs/xfs_discard.h
··· 6 6 struct xfs_mount; 7 7 struct xfs_busy_extents; 8 8 9 - int xfs_discard_extents(struct xfs_mount *mp, struct xfs_busy_extents *busy); 9 + void xfs_discard_extents(struct xfs_mount *mp, struct xfs_busy_extents *busy); 10 10 int xfs_ioc_trim(struct xfs_mount *mp, struct fstrim_range __user *fstrim); 11 11 12 12 #endif /* XFS_DISCARD_H */
+48 -10
fs/xfs/xfs_file.c
··· 1241 1241 } 1242 1242 1243 1243 /* 1244 + * For various operations we need to zero up to one block at each end of 1245 + * the affected range. For zoned file systems this will require a space 1246 + * allocation, for which we need a reservation ahead of time. 1247 + */ 1248 + #define XFS_ZONED_ZERO_EDGE_SPACE_RES 2 1249 + 1250 + /* 1251 + * Zero range implements a full zeroing mechanism but is only used in limited 1252 + * situations. It is more efficient to allocate unwritten extents than to 1253 + * perform zeroing here, so use an errortag to randomly force zeroing on DEBUG 1254 + * kernels for added test coverage. 1255 + * 1256 + * On zoned file systems, the error is already injected by 1257 + * xfs_file_zoned_fallocate, which then reserves the additional space needed. 1258 + * We only check for this extra space reservation here. 1259 + */ 1260 + static inline bool 1261 + xfs_falloc_force_zero( 1262 + struct xfs_inode *ip, 1263 + struct xfs_zone_alloc_ctx *ac) 1264 + { 1265 + if (xfs_is_zoned_inode(ip)) { 1266 + if (ac->reserved_blocks > XFS_ZONED_ZERO_EDGE_SPACE_RES) { 1267 + ASSERT(IS_ENABLED(CONFIG_XFS_DEBUG)); 1268 + return true; 1269 + } 1270 + return false; 1271 + } 1272 + return XFS_TEST_ERROR(ip->i_mount, XFS_ERRTAG_FORCE_ZERO_RANGE); 1273 + } 1274 + 1275 + /* 1244 1276 * Punch a hole and prealloc the range. We use a hole punch rather than 1245 1277 * unwritten extent conversion for two reasons: 1246 1278 * ··· 1300 1268 if (error) 1301 1269 return error; 1302 1270 1303 - /* 1304 - * Zero range implements a full zeroing mechanism but is only used in 1305 - * limited situations. It is more efficient to allocate unwritten 1306 - * extents than to perform zeroing here, so use an errortag to randomly 1307 - * force zeroing on DEBUG kernels for added test coverage. 1308 - */ 1309 - if (XFS_TEST_ERROR(ip->i_mount, 1310 - XFS_ERRTAG_FORCE_ZERO_RANGE)) { 1271 + if (xfs_falloc_force_zero(ip, ac)) { 1311 1272 error = xfs_zero_range(ip, offset, len, ac, NULL); 1312 1273 } else { 1313 1274 error = xfs_free_file_space(ip, offset, len, ac); ··· 1448 1423 { 1449 1424 struct xfs_zone_alloc_ctx ac = { }; 1450 1425 struct xfs_inode *ip = XFS_I(file_inode(file)); 1426 + struct xfs_mount *mp = ip->i_mount; 1427 + xfs_filblks_t count_fsb; 1451 1428 int error; 1452 1429 1453 - error = xfs_zoned_space_reserve(ip->i_mount, 2, XFS_ZR_RESERVED, &ac); 1430 + /* 1431 + * If full zeroing is forced by the error injection knob, we need a 1432 + * space reservation that covers the entire range. See the comment in 1433 + * xfs_zoned_write_space_reserve for the rationale for the calculation. 1434 + * Otherwise just reserve space for the two boundary blocks. 1435 + */ 1436 + count_fsb = XFS_ZONED_ZERO_EDGE_SPACE_RES; 1437 + if ((mode & FALLOC_FL_MODE_MASK) == FALLOC_FL_ZERO_RANGE && 1438 + XFS_TEST_ERROR(mp, XFS_ERRTAG_FORCE_ZERO_RANGE)) 1439 + count_fsb += XFS_B_TO_FSB(mp, len) + 1; 1440 + 1441 + error = xfs_zoned_space_reserve(mp, count_fsb, XFS_ZR_RESERVED, &ac); 1454 1442 if (error) 1455 1443 return error; 1456 1444 error = __xfs_file_fallocate(file, mode, offset, len, &ac); 1457 - xfs_zoned_space_unreserve(ip->i_mount, &ac); 1445 + xfs_zoned_space_unreserve(mp, &ac); 1458 1446 return error; 1459 1447 } 1460 1448
+8 -6
fs/xfs/xfs_rtalloc.c
··· 1255 1255 min_logfsbs = min_t(xfs_extlen_t, xfs_log_calc_minimum_size(nmp), 1256 1256 nmp->m_rsumblocks * 2); 1257 1257 1258 - kfree(nmp); 1259 - 1260 1258 trace_xfs_growfs_check_rtgeom(mp, min_logfsbs); 1261 1259 1262 1260 if (min_logfsbs > mp->m_sb.sb_logblocks) 1263 - return -EINVAL; 1261 + goto out_inval; 1264 1262 1265 1263 if (xfs_has_zoned(mp)) { 1266 1264 uint32_t gblocks = mp->m_groups[XG_TYPE_RTG].blocks; ··· 1266 1268 1267 1269 if (rextsize != 1) 1268 1270 return -EINVAL; 1269 - div_u64_rem(mp->m_sb.sb_rblocks, gblocks, &rem); 1271 + div_u64_rem(nmp->m_sb.sb_rblocks, gblocks, &rem); 1270 1272 if (rem) { 1271 1273 xfs_warn(mp, 1272 1274 "new RT volume size (%lld) not aligned to RT group size (%d)", 1273 - mp->m_sb.sb_rblocks, gblocks); 1274 - return -EINVAL; 1275 + nmp->m_sb.sb_rblocks, gblocks); 1276 + goto out_inval; 1275 1277 } 1276 1278 } 1277 1279 1280 + kfree(nmp); 1278 1281 return 0; 1282 + out_inval: 1283 + kfree(nmp); 1284 + return -EINVAL; 1279 1285 } 1280 1286 1281 1287 /*
+15 -15
include/linux/bio.h
··· 46 46 #define bio_data_dir(bio) \ 47 47 (op_is_write(bio_op(bio)) ? WRITE : READ) 48 48 49 + static inline bool bio_flagged(const struct bio *bio, unsigned int bit) 50 + { 51 + return bio->bi_flags & (1U << bit); 52 + } 53 + 54 + static inline void bio_set_flag(struct bio *bio, unsigned int bit) 55 + { 56 + bio->bi_flags |= (1U << bit); 57 + } 58 + 59 + static inline void bio_clear_flag(struct bio *bio, unsigned int bit) 60 + { 61 + bio->bi_flags &= ~(1U << bit); 62 + } 63 + 49 64 /* 50 65 * Check whether this bio carries any data or not. A NULL bio is allowed. 51 66 */ ··· 238 223 smp_mb(); 239 224 } 240 225 atomic_set(&bio->__bi_cnt, count); 241 - } 242 - 243 - static inline bool bio_flagged(struct bio *bio, unsigned int bit) 244 - { 245 - return bio->bi_flags & (1U << bit); 246 - } 247 - 248 - static inline void bio_set_flag(struct bio *bio, unsigned int bit) 249 - { 250 - bio->bi_flags |= (1U << bit); 251 - } 252 - 253 - static inline void bio_clear_flag(struct bio *bio, unsigned int bit) 254 - { 255 - bio->bi_flags &= ~(1U << bit); 256 226 } 257 227 258 228 static inline struct bio_vec *bio_first_bvec_all(struct bio *bio)
+3
include/linux/bpf.h
··· 1283 1283 struct list_head lnode; 1284 1284 struct latch_tree_node tnode; 1285 1285 bool prog; 1286 + u32 fp_start; 1287 + u32 fp_end; 1286 1288 }; 1287 1289 1288 1290 enum bpf_tramp_prog_type { ··· 1513 1511 void bpf_image_ksym_del(struct bpf_ksym *ksym); 1514 1512 void bpf_ksym_add(struct bpf_ksym *ksym); 1515 1513 void bpf_ksym_del(struct bpf_ksym *ksym); 1514 + bool bpf_has_frame_pointer(unsigned long ip); 1516 1515 int bpf_jit_charge_modmem(u32 size); 1517 1516 void bpf_jit_uncharge_modmem(u32 size); 1518 1517 bool bpf_prog_has_trampoline(const struct bpf_prog *prog);
+1
include/linux/compiler-clang.h
··· 145 145 */ 146 146 #define ASM_INPUT_G "ir" 147 147 #define ASM_INPUT_RM "r" 148 + #define ASM_OUTPUT_RM "=r" 148 149 149 150 /* 150 151 * Declare compiler support for __typeof_unqual__() operator.
+2 -1
include/linux/compiler_types.h
··· 548 548 549 549 /* 550 550 * Clang has trouble with constraints with multiple 551 - * alternative behaviors (mainly "g" and "rm"). 551 + * alternative behaviors ("g" , "rm" and "=rm"). 552 552 */ 553 553 #ifndef ASM_INPUT_G 554 554 #define ASM_INPUT_G "g" 555 555 #define ASM_INPUT_RM "rm" 556 + #define ASM_OUTPUT_RM "=rm" 556 557 #endif 557 558 558 559 #ifdef CONFIG_CC_HAS_ASM_INLINE
+1 -1
include/linux/fs.h
··· 3247 3247 void simple_offset_init(struct offset_ctx *octx); 3248 3248 int simple_offset_add(struct offset_ctx *octx, struct dentry *dentry); 3249 3249 void simple_offset_remove(struct offset_ctx *octx, struct dentry *dentry); 3250 - int simple_offset_rename(struct inode *old_dir, struct dentry *old_dentry, 3250 + void simple_offset_rename(struct inode *old_dir, struct dentry *old_dentry, 3251 3251 struct inode *new_dir, struct dentry *new_dentry); 3252 3252 int simple_offset_rename_exchange(struct inode *old_dir, 3253 3253 struct dentry *old_dentry,
+4
include/linux/intel_rapl.h
··· 214 214 215 215 #ifdef CONFIG_PERF_EVENTS 216 216 int rapl_package_add_pmu(struct rapl_package *rp); 217 + int rapl_package_add_pmu_locked(struct rapl_package *rp); 217 218 void rapl_package_remove_pmu(struct rapl_package *rp); 219 + void rapl_package_remove_pmu_locked(struct rapl_package *rp); 218 220 #else 219 221 static inline int rapl_package_add_pmu(struct rapl_package *rp) { return 0; } 222 + static inline int rapl_package_add_pmu_locked(struct rapl_package *rp) { return 0; } 220 223 static inline void rapl_package_remove_pmu(struct rapl_package *rp) { } 224 + static inline void rapl_package_remove_pmu_locked(struct rapl_package *rp) { } 221 225 #endif 222 226 223 227 #endif /* __INTEL_RAPL_H__ */
-1
include/linux/mm_types.h
··· 1631 1631 TLB_LOCAL_MM_SHOOTDOWN, 1632 1632 TLB_REMOTE_SEND_IPI, 1633 1633 TLB_REMOTE_WRONG_CPU, 1634 - NR_TLB_FLUSH_REASONS, 1635 1634 }; 1636 1635 1637 1636 /**
+3 -15
include/net/inet_frag.h
··· 123 123 124 124 int fqdir_init(struct fqdir **fqdirp, struct inet_frags *f, struct net *net); 125 125 126 - static inline void fqdir_pre_exit(struct fqdir *fqdir) 127 - { 128 - /* Prevent creation of new frags. 129 - * Pairs with READ_ONCE() in inet_frag_find(). 130 - */ 131 - WRITE_ONCE(fqdir->high_thresh, 0); 132 - 133 - /* Pairs with READ_ONCE() in inet_frag_kill(), ip_expire() 134 - * and ip6frag_expire_frag_queue(). 135 - */ 136 - WRITE_ONCE(fqdir->dead, true); 137 - } 126 + void fqdir_pre_exit(struct fqdir *fqdir); 138 127 void fqdir_exit(struct fqdir *fqdir); 139 128 140 129 void inet_frag_kill(struct inet_frag_queue *q, int *refs); 141 130 void inet_frag_destroy(struct inet_frag_queue *q); 142 131 struct inet_frag_queue *inet_frag_find(struct fqdir *fqdir, void *key); 143 132 144 - /* Free all skbs in the queue; return the sum of their truesizes. */ 145 - unsigned int inet_frag_rbtree_purge(struct rb_root *root, 146 - enum skb_drop_reason reason); 133 + void inet_frag_queue_flush(struct inet_frag_queue *q, 134 + enum skb_drop_reason reason); 147 135 148 136 static inline void inet_frag_putn(struct inet_frag_queue *q, int refs) 149 137 {
+6 -3
include/net/ipv6_frag.h
··· 69 69 int refs = 1; 70 70 71 71 rcu_read_lock(); 72 - /* Paired with the WRITE_ONCE() in fqdir_pre_exit(). */ 73 - if (READ_ONCE(fq->q.fqdir->dead)) 74 - goto out_rcu_unlock; 75 72 spin_lock(&fq->q.lock); 76 73 77 74 if (fq->q.flags & INET_FRAG_COMPLETE) ··· 76 79 77 80 fq->q.flags |= INET_FRAG_DROP; 78 81 inet_frag_kill(&fq->q, &refs); 82 + 83 + /* Paired with the WRITE_ONCE() in fqdir_pre_exit(). */ 84 + if (READ_ONCE(fq->q.fqdir->dead)) { 85 + inet_frag_queue_flush(&fq->q, 0); 86 + goto out; 87 + } 79 88 80 89 dev = dev_get_by_index_rcu(net, fq->iif); 81 90 if (!dev)
+26 -8
include/net/netfilter/nf_tables.h
··· 1091 1091 __attribute__((aligned(__alignof__(struct nft_rule_dp)))); 1092 1092 }; 1093 1093 1094 + enum nft_chain_types { 1095 + NFT_CHAIN_T_DEFAULT = 0, 1096 + NFT_CHAIN_T_ROUTE, 1097 + NFT_CHAIN_T_NAT, 1098 + NFT_CHAIN_T_MAX 1099 + }; 1100 + 1101 + /** 1102 + * struct nft_chain_validate_state - validation state 1103 + * 1104 + * If a chain is encountered again during table validation it is 1105 + * possible to avoid revalidation provided the calling context is 1106 + * compatible. This structure stores relevant calling context of 1107 + * previous validations. 1108 + * 1109 + * @hook_mask: the hook numbers and locations the chain is linked to 1110 + * @depth: the deepest call chain level the chain is linked to 1111 + */ 1112 + struct nft_chain_validate_state { 1113 + u8 hook_mask[NFT_CHAIN_T_MAX]; 1114 + u8 depth; 1115 + }; 1116 + 1094 1117 /** 1095 1118 * struct nft_chain - nf_tables chain 1096 1119 * ··· 1132 1109 * @udlen: user data length 1133 1110 * @udata: user data in the chain 1134 1111 * @blob_next: rule blob pointer to the next in the chain 1112 + * @vstate: validation state 1135 1113 */ 1136 1114 struct nft_chain { 1137 1115 struct nft_rule_blob __rcu *blob_gen_0; ··· 1152 1128 1153 1129 /* Only used during control plane commit phase: */ 1154 1130 struct nft_rule_blob *blob_next; 1131 + struct nft_chain_validate_state vstate; 1155 1132 }; 1156 1133 1157 - int nft_chain_validate(const struct nft_ctx *ctx, const struct nft_chain *chain); 1134 + int nft_chain_validate(const struct nft_ctx *ctx, struct nft_chain *chain); 1158 1135 int nft_setelem_validate(const struct nft_ctx *ctx, struct nft_set *set, 1159 1136 const struct nft_set_iter *iter, 1160 1137 struct nft_elem_priv *elem_priv); 1161 1138 int nft_set_catchall_validate(const struct nft_ctx *ctx, struct nft_set *set); 1162 1139 int nf_tables_bind_chain(const struct nft_ctx *ctx, struct nft_chain *chain); 1163 1140 void nf_tables_unbind_chain(const struct nft_ctx *ctx, struct nft_chain *chain); 1164 - 1165 - enum nft_chain_types { 1166 - NFT_CHAIN_T_DEFAULT = 0, 1167 - NFT_CHAIN_T_ROUTE, 1168 - NFT_CHAIN_T_NAT, 1169 - NFT_CHAIN_T_MAX 1170 - }; 1171 1141 1172 1142 /** 1173 1143 * struct nft_chain_type - nf_tables chain type info
+32
include/sound/sdca_jack.h
··· 1 + /* SPDX-License-Identifier: GPL-2.0 */ 2 + /* 3 + * The MIPI SDCA specification is available for public downloads at 4 + * https://www.mipi.org/mipi-sdca-v1-0-download 5 + * 6 + * Copyright (C) 2025 Cirrus Logic, Inc. and 7 + * Cirrus Logic International Semiconductor Ltd. 8 + */ 9 + 10 + #ifndef __SDCA_JACK_H__ 11 + #define __SDCA_JACK_H__ 12 + 13 + struct sdca_interrupt; 14 + struct snd_kcontrol; 15 + struct snd_soc_jack; 16 + 17 + /** 18 + * struct jack_state - Jack state structure to keep data between interrupts 19 + * @kctl: Pointer to the ALSA control attached to this jack 20 + * @jack: Pointer to the ASoC jack struct for this jack 21 + */ 22 + struct jack_state { 23 + struct snd_kcontrol *kctl; 24 + struct snd_soc_jack *jack; 25 + }; 26 + 27 + int sdca_jack_alloc_state(struct sdca_interrupt *interrupt); 28 + int sdca_jack_process(struct sdca_interrupt *interrupt); 29 + int sdca_jack_set_jack(struct sdca_interrupt_info *info, struct snd_soc_jack *jack); 30 + int sdca_jack_report(struct sdca_interrupt *interrupt); 31 + 32 + #endif // __SDCA_JACK_H__
+3 -2
include/trace/events/tlb.h
··· 12 12 EM( TLB_FLUSH_ON_TASK_SWITCH, "flush on task switch" ) \ 13 13 EM( TLB_REMOTE_SHOOTDOWN, "remote shootdown" ) \ 14 14 EM( TLB_LOCAL_SHOOTDOWN, "local shootdown" ) \ 15 - EM( TLB_LOCAL_MM_SHOOTDOWN, "local mm shootdown" ) \ 16 - EMe( TLB_REMOTE_SEND_IPI, "remote ipi send" ) 15 + EM( TLB_LOCAL_MM_SHOOTDOWN, "local MM shootdown" ) \ 16 + EM( TLB_REMOTE_SEND_IPI, "remote IPI send" ) \ 17 + EMe( TLB_REMOTE_WRONG_CPU, "remote wrong CPU" ) 17 18 18 19 /* 19 20 * First define the enums in TLB_FLUSH_REASON to be exported to userspace
+1
include/uapi/drm/xe_drm.h
··· 1463 1463 /** @exec_queue_id: Exec queue ID for the batch buffer */ 1464 1464 __u32 exec_queue_id; 1465 1465 1466 + #define DRM_XE_MAX_SYNCS 1024 1466 1467 /** @num_syncs: Amount of struct drm_xe_sync in array. */ 1467 1468 __u32 num_syncs; 1468 1469
+1
include/uapi/linux/energy_model.h
··· 2 2 /* Do not edit directly, auto-generated from: */ 3 3 /* Documentation/netlink/specs/em.yaml */ 4 4 /* YNL-GEN uapi header */ 5 + /* To regenerate run: tools/net/ynl/ynl-regen.sh */ 5 6 6 7 #ifndef _UAPI_LINUX_ENERGY_MODEL_H 7 8 #define _UAPI_LINUX_ENERGY_MODEL_H
+9
include/uapi/linux/input-event-codes.h
··· 891 891 892 892 #define ABS_VOLUME 0x20 893 893 #define ABS_PROFILE 0x21 894 + #define ABS_SND_PROFILE 0x22 894 895 895 896 #define ABS_MISC 0x28 896 897 ··· 1000 999 #define SND_TONE 0x02 1001 1000 #define SND_MAX 0x07 1002 1001 #define SND_CNT (SND_MAX+1) 1002 + 1003 + /* 1004 + * ABS_SND_PROFILE values 1005 + */ 1006 + 1007 + #define SND_PROFILE_SILENT 0x00 1008 + #define SND_PROFILE_VIBRATE 0x01 1009 + #define SND_PROFILE_RING 0x02 1003 1010 1004 1011 #endif
+1
include/uapi/linux/mptcp.h
··· 40 40 #define MPTCP_PM_ADDR_FLAG_FULLMESH _BITUL(3) 41 41 #define MPTCP_PM_ADDR_FLAG_IMPLICIT _BITUL(4) 42 42 #define MPTCP_PM_ADDR_FLAG_LAMINAR _BITUL(5) 43 + #define MPTCP_PM_ADDR_FLAGS_MASK GENMASK(5, 0) 43 44 44 45 struct mptcp_info { 45 46 __u8 mptcpi_subflows;
+2
include/uapi/linux/pr.h
··· 79 79 #define IOC_PR_READ_KEYS _IOWR('p', 206, struct pr_read_keys) 80 80 #define IOC_PR_READ_RESERVATION _IOR('p', 207, struct pr_read_reservation) 81 81 82 + #define PR_KEYS_MAX (1u << 16) 83 + 82 84 #endif /* _UAPI_PR_H */
+1
io_uring/rsrc.c
··· 1059 1059 if (count < imu->len) { 1060 1060 const struct bio_vec *bvec = iter->bvec; 1061 1061 1062 + len += iter->iov_offset; 1062 1063 while (len > bvec->bv_len) { 1063 1064 len -= bvec->bv_len; 1064 1065 bvec++;
+16
kernel/bpf/core.c
··· 760 760 NULL; 761 761 } 762 762 763 + bool bpf_has_frame_pointer(unsigned long ip) 764 + { 765 + struct bpf_ksym *ksym; 766 + unsigned long offset; 767 + 768 + guard(rcu)(); 769 + 770 + ksym = bpf_ksym_find(ip); 771 + if (!ksym || !ksym->fp_start || !ksym->fp_end) 772 + return false; 773 + 774 + offset = ip - ksym->start; 775 + 776 + return offset >= ksym->fp_start && offset < ksym->fp_end; 777 + } 778 + 763 779 const struct exception_table_entry *search_bpf_extables(unsigned long addr) 764 780 { 765 781 const struct exception_table_entry *e = NULL;
+49 -7
kernel/bpf/dmabuf_iter.c
··· 6 6 #include <linux/kernel.h> 7 7 #include <linux/seq_file.h> 8 8 9 + struct dmabuf_iter_priv { 10 + /* 11 + * If this pointer is non-NULL, the buffer's refcount is elevated to 12 + * prevent destruction between stop/start. If reading is not resumed and 13 + * start is never called again, then dmabuf_iter_seq_fini drops the 14 + * reference when the iterator is released. 15 + */ 16 + struct dma_buf *dmabuf; 17 + }; 18 + 9 19 static void *dmabuf_iter_seq_start(struct seq_file *seq, loff_t *pos) 10 20 { 11 - if (*pos) 12 - return NULL; 21 + struct dmabuf_iter_priv *p = seq->private; 22 + 23 + if (*pos) { 24 + struct dma_buf *dmabuf = p->dmabuf; 25 + 26 + if (!dmabuf) 27 + return NULL; 28 + 29 + /* 30 + * Always resume from where we stopped, regardless of the value 31 + * of pos. 32 + */ 33 + p->dmabuf = NULL; 34 + return dmabuf; 35 + } 13 36 14 37 return dma_buf_iter_begin(); 15 38 } ··· 77 54 { 78 55 struct dma_buf *dmabuf = v; 79 56 80 - if (dmabuf) 81 - dma_buf_put(dmabuf); 57 + if (dmabuf) { 58 + struct dmabuf_iter_priv *p = seq->private; 59 + 60 + p->dmabuf = dmabuf; 61 + } 82 62 } 83 63 84 64 static const struct seq_operations dmabuf_iter_seq_ops = { ··· 97 71 seq_puts(seq, "dmabuf iter\n"); 98 72 } 99 73 74 + static int dmabuf_iter_seq_init(void *priv, struct bpf_iter_aux_info *aux) 75 + { 76 + struct dmabuf_iter_priv *p = (struct dmabuf_iter_priv *)priv; 77 + 78 + p->dmabuf = NULL; 79 + return 0; 80 + } 81 + 82 + static void dmabuf_iter_seq_fini(void *priv) 83 + { 84 + struct dmabuf_iter_priv *p = (struct dmabuf_iter_priv *)priv; 85 + 86 + if (p->dmabuf) 87 + dma_buf_put(p->dmabuf); 88 + } 89 + 100 90 static const struct bpf_iter_seq_info dmabuf_iter_seq_info = { 101 91 .seq_ops = &dmabuf_iter_seq_ops, 102 - .init_seq_private = NULL, 103 - .fini_seq_private = NULL, 104 - .seq_priv_size = 0, 92 + .init_seq_private = dmabuf_iter_seq_init, 93 + .fini_seq_private = dmabuf_iter_seq_fini, 94 + .seq_priv_size = sizeof(struct dmabuf_iter_priv), 105 95 }; 106 96 107 97 static struct bpf_iter_reg bpf_dmabuf_reg_info = {
+8 -5
kernel/cgroup/rstat.c
··· 71 71 { 72 72 struct llist_head *lhead; 73 73 struct css_rstat_cpu *rstatc; 74 - struct css_rstat_cpu __percpu *rstatc_pcpu; 75 74 struct llist_node *self; 76 75 77 76 /* ··· 103 104 /* 104 105 * This function can be renentered by irqs and nmis for the same cgroup 105 106 * and may try to insert the same per-cpu lnode into the llist. Note 106 - * that llist_add() does not protect against such scenarios. 107 + * that llist_add() does not protect against such scenarios. In addition 108 + * this same per-cpu lnode can be modified through init_llist_node() 109 + * from css_rstat_flush() running on a different CPU. 107 110 * 108 111 * To protect against such stacked contexts of irqs/nmis, we use the 109 112 * fact that lnode points to itself when not on a list and then use 110 - * this_cpu_cmpxchg() to atomically set to NULL to select the winner 113 + * try_cmpxchg() to atomically set to NULL to select the winner 111 114 * which will call llist_add(). The losers can assume the insertion is 112 115 * successful and the winner will eventually add the per-cpu lnode to 113 116 * the llist. 117 + * 118 + * Please note that we can not use this_cpu_cmpxchg() here as on some 119 + * archs it is not safe against modifications from multiple CPUs. 114 120 */ 115 121 self = &rstatc->lnode; 116 - rstatc_pcpu = css->rstat_cpu; 117 - if (this_cpu_cmpxchg(rstatc_pcpu->lnode.next, self, NULL) != self) 122 + if (!try_cmpxchg(&rstatc->lnode.next, &self, NULL)) 118 123 return; 119 124 120 125 lhead = ss_lhead_cpu(css->ss, cpu);
+1 -1
kernel/irq/manage.c
··· 1414 1414 * Ensure the thread adjusts the affinity once it reaches the 1415 1415 * thread function. 1416 1416 */ 1417 - new->thread_flags = BIT(IRQTF_AFFINITY); 1417 + set_bit(IRQTF_AFFINITY, &new->thread_flags); 1418 1418 1419 1419 return 0; 1420 1420 }
+48 -24
kernel/sched/ext.c
··· 41 41 static bool scx_switching_all; 42 42 DEFINE_STATIC_KEY_FALSE(__scx_switched_all); 43 43 44 + /* 45 + * Tracks whether scx_enable() called scx_bypass(true). Used to balance bypass 46 + * depth on enable failure. Will be removed when bypass depth is moved into the 47 + * sched instance. 48 + */ 49 + static bool scx_bypassed_for_enable; 50 + 44 51 static atomic_long_t scx_nr_rejected = ATOMIC_LONG_INIT(0); 45 52 static atomic_long_t scx_hotplug_seq = ATOMIC_LONG_INIT(0); 46 53 ··· 982 975 __scx_add_event(sch, SCX_EV_REFILL_SLICE_DFL, 1); 983 976 } 984 977 978 + static void local_dsq_post_enq(struct scx_dispatch_q *dsq, struct task_struct *p, 979 + u64 enq_flags) 980 + { 981 + struct rq *rq = container_of(dsq, struct rq, scx.local_dsq); 982 + bool preempt = false; 983 + 984 + /* 985 + * If @rq is in balance, the CPU is already vacant and looking for the 986 + * next task to run. No need to preempt or trigger resched after moving 987 + * @p into its local DSQ. 988 + */ 989 + if (rq->scx.flags & SCX_RQ_IN_BALANCE) 990 + return; 991 + 992 + if ((enq_flags & SCX_ENQ_PREEMPT) && p != rq->curr && 993 + rq->curr->sched_class == &ext_sched_class) { 994 + rq->curr->scx.slice = 0; 995 + preempt = true; 996 + } 997 + 998 + if (preempt || sched_class_above(&ext_sched_class, rq->curr->sched_class)) 999 + resched_curr(rq); 1000 + } 1001 + 985 1002 static void dispatch_enqueue(struct scx_sched *sch, struct scx_dispatch_q *dsq, 986 1003 struct task_struct *p, u64 enq_flags) 987 1004 { ··· 1117 1086 if (enq_flags & SCX_ENQ_CLEAR_OPSS) 1118 1087 atomic_long_set_release(&p->scx.ops_state, SCX_OPSS_NONE); 1119 1088 1120 - if (is_local) { 1121 - struct rq *rq = container_of(dsq, struct rq, scx.local_dsq); 1122 - bool preempt = false; 1123 - 1124 - if ((enq_flags & SCX_ENQ_PREEMPT) && p != rq->curr && 1125 - rq->curr->sched_class == &ext_sched_class) { 1126 - rq->curr->scx.slice = 0; 1127 - preempt = true; 1128 - } 1129 - 1130 - if (preempt || sched_class_above(&ext_sched_class, 1131 - rq->curr->sched_class)) 1132 - resched_curr(rq); 1133 - } else { 1089 + if (is_local) 1090 + local_dsq_post_enq(dsq, p, enq_flags); 1091 + else 1134 1092 raw_spin_unlock(&dsq->lock); 1135 - } 1136 1093 } 1137 1094 1138 1095 static void task_unlink_from_dsq(struct task_struct *p, ··· 1644 1625 1645 1626 dsq_mod_nr(dst_dsq, 1); 1646 1627 p->scx.dsq = dst_dsq; 1628 + 1629 + local_dsq_post_enq(dst_dsq, p, enq_flags); 1647 1630 } 1648 1631 1649 1632 /** ··· 2423 2402 * ops.enqueue() that @p is the only one available for this cpu, 2424 2403 * which should trigger an explicit follow-up scheduling event. 2425 2404 */ 2426 - if (sched_class_above(&ext_sched_class, next->sched_class)) { 2405 + if (next && sched_class_above(&ext_sched_class, next->sched_class)) { 2427 2406 WARN_ON_ONCE(!(sch->ops.flags & SCX_OPS_ENQ_LAST)); 2428 2407 do_enqueue_task(rq, p, SCX_ENQ_LAST, -1); 2429 2408 } else { ··· 2446 2425 do_pick_task_scx(struct rq *rq, struct rq_flags *rf, bool force_scx) 2447 2426 { 2448 2427 struct task_struct *prev = rq->curr; 2449 - bool keep_prev, kick_idle = false; 2428 + bool keep_prev; 2450 2429 struct task_struct *p; 2451 2430 2452 2431 /* see kick_cpus_irq_workfn() */ ··· 2488 2467 refill_task_slice_dfl(rcu_dereference_sched(scx_root), p); 2489 2468 } else { 2490 2469 p = first_local_task(rq); 2491 - if (!p) { 2492 - if (kick_idle) 2493 - scx_kick_cpu(rcu_dereference_sched(scx_root), 2494 - cpu_of(rq), SCX_KICK_IDLE); 2470 + if (!p) 2495 2471 return NULL; 2496 - } 2497 2472 2498 2473 if (unlikely(!p->scx.slice)) { 2499 2474 struct scx_sched *sch = rcu_dereference_sched(scx_root); ··· 3592 3575 int node; 3593 3576 3594 3577 irq_work_sync(&sch->error_irq_work); 3595 - kthread_stop(sch->helper->task); 3578 + kthread_destroy_worker(sch->helper); 3596 3579 3597 3580 free_percpu(sch->pcpu); 3598 3581 ··· 4335 4318 scx_dsp_max_batch = 0; 4336 4319 free_kick_syncs(); 4337 4320 4321 + if (scx_bypassed_for_enable) { 4322 + scx_bypassed_for_enable = false; 4323 + scx_bypass(false); 4324 + } 4325 + 4338 4326 mutex_unlock(&scx_enable_mutex); 4339 4327 4340 4328 WARN_ON_ONCE(scx_set_enable_state(SCX_DISABLED) != SCX_DISABLING); ··· 4808 4786 return sch; 4809 4787 4810 4788 err_stop_helper: 4811 - kthread_stop(sch->helper->task); 4789 + kthread_destroy_worker(sch->helper); 4812 4790 err_free_pcpu: 4813 4791 free_percpu(sch->pcpu); 4814 4792 err_free_gdsqs: ··· 4992 4970 * Init in bypass mode to guarantee forward progress. 4993 4971 */ 4994 4972 scx_bypass(true); 4973 + scx_bypassed_for_enable = true; 4995 4974 4996 4975 for (i = SCX_OPI_NORMAL_BEGIN; i < SCX_OPI_NORMAL_END; i++) 4997 4976 if (((void (**)(void))ops)[i]) ··· 5090 5067 scx_task_iter_stop(&sti); 5091 5068 percpu_up_write(&scx_fork_rwsem); 5092 5069 5070 + scx_bypassed_for_enable = false; 5093 5071 scx_bypass(false); 5094 5072 5095 5073 if (!scx_tryset_enable_state(SCX_ENABLED, SCX_ENABLING)) {
+1 -1
kernel/trace/bpf_trace.c
··· 965 965 .ret_type = RET_INTEGER, 966 966 .arg1_type = ARG_PTR_TO_BTF_ID, 967 967 .arg1_btf_id = &bpf_d_path_btf_ids[0], 968 - .arg2_type = ARG_PTR_TO_MEM, 968 + .arg2_type = ARG_PTR_TO_MEM | MEM_WRITE, 969 969 .arg3_type = ARG_CONST_SIZE_OR_ZERO, 970 970 .allowed = bpf_d_path_allowed, 971 971 };
+5 -2
kernel/trace/ftrace.c
··· 4518 4518 unsigned long direct; 4519 4519 4520 4520 direct = ftrace_find_rec_direct(rec->ip); 4521 - if (direct) 4522 - seq_printf(m, "\n\tdirect-->%pS", (void *)direct); 4521 + if (direct) { 4522 + seq_printf(m, "\n\tdirect%s-->%pS", 4523 + ftrace_is_jmp(direct) ? "(jmp)" : "", 4524 + (void *)ftrace_jmp_get(direct)); 4525 + } 4523 4526 } 4524 4527 } 4525 4528
+1 -1
kernel/trace/trace.c
··· 10507 10507 10508 10508 /* Disable all the flags that were enabled coming in */ 10509 10509 for (i = 0; i < TRACE_FLAGS_MAX_SIZE; i++) { 10510 - if ((1 << i) & ZEROED_TRACE_FLAGS) 10510 + if ((1ULL << i) & ZEROED_TRACE_FLAGS) 10511 10511 set_tracer_flag(tr, 1ULL << i, 0); 10512 10512 } 10513 10513
+2
kernel/trace/trace_events.c
··· 700 700 701 701 #ifdef CONFIG_PERF_EVENTS 702 702 case TRACE_REG_PERF_REGISTER: 703 + if (!call->class->perf_probe) 704 + return -ENODEV; 703 705 return tracepoint_probe_register(call->tp, 704 706 call->class->perf_probe, 705 707 call);
+2
lib/crypto/riscv/.gitignore
··· 1 + # SPDX-License-Identifier: GPL-2.0-only 2 + poly1305-core.S
+1 -1
lib/kunit/Kconfig
··· 28 28 bool "Enable KUnit tests which print BUG stacktraces" 29 29 depends on KUNIT_TEST 30 30 depends on !UML 31 - default y 31 + default !PANIC_ON_OOPS 32 32 help 33 33 Enables fault handling tests for the KUnit framework. These tests may 34 34 trigger a kernel BUG(), and the associated stack trace, even when they
+3 -4
lib/kunit/device.c
··· 106 106 107 107 /* Helper which creates a kunit_device, attaches it to the kunit_bus*/ 108 108 static struct kunit_device *kunit_device_register_internal(struct kunit *test, 109 - const char *name, 110 - const struct device_driver *drv) 109 + const char *name) 111 110 { 112 111 struct kunit_device *kunit_dev; 113 112 int err = -ENOMEM; ··· 149 150 const char *name, 150 151 const struct device_driver *drv) 151 152 { 152 - struct kunit_device *kunit_dev = kunit_device_register_internal(test, name, drv); 153 + struct kunit_device *kunit_dev = kunit_device_register_internal(test, name); 153 154 154 155 if (IS_ERR_OR_NULL(kunit_dev)) 155 156 return ERR_CAST(kunit_dev); ··· 171 172 if (IS_ERR(drv)) 172 173 return ERR_CAST(drv); 173 174 174 - dev = kunit_device_register_internal(test, name, drv); 175 + dev = kunit_device_register_internal(test, name); 175 176 if (IS_ERR(dev)) { 176 177 kunit_release_action(test, driver_unregister_wrapper, (void *)drv); 177 178 return ERR_CAST(dev);
+17 -21
mm/shmem.c
··· 4019 4019 whiteout = d_alloc(old_dentry->d_parent, &old_dentry->d_name); 4020 4020 if (!whiteout) 4021 4021 return -ENOMEM; 4022 - 4023 4022 error = shmem_mknod(idmap, old_dir, whiteout, 4024 4023 S_IFCHR | WHITEOUT_MODE, WHITEOUT_DEV); 4025 4024 dput(whiteout); 4026 - if (error) 4027 - return error; 4028 - 4029 - /* 4030 - * Cheat and hash the whiteout while the old dentry is still in 4031 - * place, instead of playing games with FS_RENAME_DOES_D_MOVE. 4032 - * 4033 - * d_lookup() will consistently find one of them at this point, 4034 - * not sure which one, but that isn't even important. 4035 - */ 4036 - d_rehash(whiteout); 4037 - return 0; 4025 + return error; 4038 4026 } 4039 4027 4040 4028 /* ··· 4038 4050 { 4039 4051 struct inode *inode = d_inode(old_dentry); 4040 4052 int they_are_dirs = S_ISDIR(inode->i_mode); 4053 + bool had_offset = false; 4041 4054 int error; 4042 4055 4043 4056 if (flags & ~(RENAME_NOREPLACE | RENAME_EXCHANGE | RENAME_WHITEOUT)) ··· 4051 4062 if (!simple_empty(new_dentry)) 4052 4063 return -ENOTEMPTY; 4053 4064 4054 - if (flags & RENAME_WHITEOUT) { 4055 - error = shmem_whiteout(idmap, old_dir, old_dentry); 4056 - if (error) 4057 - return error; 4058 - } 4059 - 4060 - error = simple_offset_rename(old_dir, old_dentry, new_dir, new_dentry); 4061 - if (error) 4065 + error = simple_offset_add(shmem_get_offset_ctx(new_dir), new_dentry); 4066 + if (error == -EBUSY) 4067 + had_offset = true; 4068 + else if (unlikely(error)) 4062 4069 return error; 4063 4070 4071 + if (flags & RENAME_WHITEOUT) { 4072 + error = shmem_whiteout(idmap, old_dir, old_dentry); 4073 + if (error) { 4074 + if (!had_offset) 4075 + simple_offset_remove(shmem_get_offset_ctx(new_dir), 4076 + new_dentry); 4077 + return error; 4078 + } 4079 + } 4080 + 4081 + simple_offset_rename(old_dir, old_dentry, new_dir, new_dentry); 4064 4082 if (d_really_is_positive(new_dentry)) { 4065 4083 (void) shmem_unlink(new_dir, new_dentry); 4066 4084 if (they_are_dirs) {
+2
mm/slub.c
··· 6539 6539 6540 6540 guard(preempt)(); 6541 6541 6542 + head = kasan_reset_tag(head); 6543 + 6542 6544 df = this_cpu_ptr(&defer_free_objects); 6543 6545 if (llist_add(head + s->offset, &df->objects)) 6544 6546 irq_work_queue(&df->work);
+8 -1
net/caif/cffrml.c
··· 92 92 len = le16_to_cpu(tmp); 93 93 94 94 /* Subtract for FCS on length if FCS is not used. */ 95 - if (!this->dofcs) 95 + if (!this->dofcs) { 96 + if (len < 2) { 97 + ++cffrml_rcv_error; 98 + pr_err("Invalid frame length (%d)\n", len); 99 + cfpkt_destroy(pkt); 100 + return -EPROTO; 101 + } 96 102 len -= 2; 103 + } 97 104 98 105 if (cfpkt_setlen(pkt, len) < 0) { 99 106 ++cffrml_rcv_error;
-1
net/can/Kconfig
··· 5 5 6 6 menuconfig CAN 7 7 tristate "CAN bus subsystem support" 8 - select CAN_DEV 9 8 help 10 9 Controller Area Network (CAN) is a slow (up to 1Mbit/s) serial 11 10 communications protocol. Development of the CAN bus started in
+6
net/can/j1939/socket.c
··· 482 482 goto out_release_sock; 483 483 } 484 484 485 + if (ndev->reg_state != NETREG_REGISTERED) { 486 + dev_put(ndev); 487 + ret = -ENODEV; 488 + goto out_release_sock; 489 + } 490 + 485 491 can_ml = can_get_ml_priv(ndev); 486 492 if (!can_ml) { 487 493 dev_put(ndev);
+2
net/can/j1939/transport.c
··· 1567 1567 if (active) { 1568 1568 j1939_session_put(active); 1569 1569 ret = -EAGAIN; 1570 + } else if (priv->ndev->reg_state != NETREG_REGISTERED) { 1571 + ret = -ENODEV; 1570 1572 } else { 1571 1573 WARN_ON_ONCE(session->state != J1939_SESSION_NEW); 1572 1574 list_add_tail(&session->active_session_list_entry,
+24 -6
net/ethtool/ioctl.c
··· 2383 2383 return -ENOMEM; 2384 2384 WARN_ON_ONCE(!ret); 2385 2385 2386 - gstrings.len = ret; 2386 + if (gstrings.len && gstrings.len != ret) 2387 + gstrings.len = 0; 2388 + else 2389 + gstrings.len = ret; 2387 2390 2388 2391 if (gstrings.len) { 2389 2392 data = vzalloc(array_size(gstrings.len, ETH_GSTRING_LEN)); ··· 2512 2509 if (copy_from_user(&stats, useraddr, sizeof(stats))) 2513 2510 return -EFAULT; 2514 2511 2515 - stats.n_stats = n_stats; 2512 + if (stats.n_stats && stats.n_stats != n_stats) 2513 + stats.n_stats = 0; 2514 + else 2515 + stats.n_stats = n_stats; 2516 2516 2517 - if (n_stats) { 2518 - data = vzalloc(array_size(n_stats, sizeof(u64))); 2517 + if (stats.n_stats) { 2518 + data = vzalloc(array_size(stats.n_stats, sizeof(u64))); 2519 2519 if (!data) 2520 2520 return -ENOMEM; 2521 2521 ops->get_ethtool_stats(dev, &stats, data); ··· 2530 2524 if (copy_to_user(useraddr, &stats, sizeof(stats))) 2531 2525 goto out; 2532 2526 useraddr += sizeof(stats); 2533 - if (n_stats && copy_to_user(useraddr, data, array_size(n_stats, sizeof(u64)))) 2527 + if (stats.n_stats && 2528 + copy_to_user(useraddr, data, 2529 + array_size(stats.n_stats, sizeof(u64)))) 2534 2530 goto out; 2535 2531 ret = 0; 2536 2532 ··· 2568 2560 return -EOPNOTSUPP; 2569 2561 2570 2562 n_stats = phy_ops->get_sset_count(phydev); 2563 + if (stats->n_stats && stats->n_stats != n_stats) { 2564 + stats->n_stats = 0; 2565 + return 0; 2566 + } 2571 2567 2572 2568 ret = ethtool_vzalloc_stats_array(n_stats, data); 2573 2569 if (ret) ··· 2592 2580 return -EOPNOTSUPP; 2593 2581 2594 2582 n_stats = ops->get_sset_count(dev, ETH_SS_PHY_STATS); 2583 + if (stats->n_stats && stats->n_stats != n_stats) { 2584 + stats->n_stats = 0; 2585 + return 0; 2586 + } 2595 2587 2596 2588 ret = ethtool_vzalloc_stats_array(n_stats, data); 2597 2589 if (ret) ··· 2632 2616 } 2633 2617 2634 2618 useraddr += sizeof(stats); 2635 - if (copy_to_user(useraddr, data, array_size(stats.n_stats, sizeof(u64)))) 2619 + if (stats.n_stats && 2620 + copy_to_user(useraddr, data, 2621 + array_size(stats.n_stats, sizeof(u64)))) 2636 2622 ret = -EFAULT; 2637 2623 2638 2624 out:
+7 -1
net/handshake/request.c
··· 276 276 out_unlock: 277 277 spin_unlock(&hn->hn_lock); 278 278 out_err: 279 + /* Restore original destructor so socket teardown still runs on failure */ 280 + req->hr_sk->sk_destruct = req->hr_odestruct; 279 281 trace_handshake_submit_err(net, req, req->hr_sk, ret); 280 282 handshake_req_destroy(req); 281 283 return ret; ··· 326 324 327 325 hn = handshake_pernet(net); 328 326 if (hn && remove_pending(hn, req)) { 329 - /* Request hadn't been accepted */ 327 + /* Request hadn't been accepted - mark cancelled */ 328 + if (test_and_set_bit(HANDSHAKE_F_REQ_COMPLETED, &req->hr_flags)) { 329 + trace_handshake_cancel_busy(net, req, sk); 330 + return false; 331 + } 330 332 goto out_true; 331 333 } 332 334 if (test_and_set_bit(HANDSHAKE_F_REQ_COMPLETED, &req->hr_flags)) {
+2
net/hsr/hsr_forward.c
··· 205 205 __pskb_copy(frame->skb_prp, 206 206 skb_headroom(frame->skb_prp), 207 207 GFP_ATOMIC); 208 + if (!frame->skb_std) 209 + return NULL; 208 210 } else { 209 211 /* Unexpected */ 210 212 WARN_ONCE(1, "%s:%d: Unexpected frame received (port_src %s)\n",
+51 -4
net/ipv4/inet_fragment.c
··· 218 218 219 219 pure_initcall(inet_frag_wq_init); 220 220 221 + void fqdir_pre_exit(struct fqdir *fqdir) 222 + { 223 + struct inet_frag_queue *fq; 224 + struct rhashtable_iter hti; 225 + 226 + /* Prevent creation of new frags. 227 + * Pairs with READ_ONCE() in inet_frag_find(). 228 + */ 229 + WRITE_ONCE(fqdir->high_thresh, 0); 230 + 231 + /* Pairs with READ_ONCE() in inet_frag_kill(), ip_expire() 232 + * and ip6frag_expire_frag_queue(). 233 + */ 234 + WRITE_ONCE(fqdir->dead, true); 235 + 236 + rhashtable_walk_enter(&fqdir->rhashtable, &hti); 237 + rhashtable_walk_start(&hti); 238 + 239 + while ((fq = rhashtable_walk_next(&hti))) { 240 + if (IS_ERR(fq)) { 241 + if (PTR_ERR(fq) != -EAGAIN) 242 + break; 243 + continue; 244 + } 245 + spin_lock_bh(&fq->lock); 246 + if (!(fq->flags & INET_FRAG_COMPLETE)) 247 + inet_frag_queue_flush(fq, 0); 248 + spin_unlock_bh(&fq->lock); 249 + } 250 + 251 + rhashtable_walk_stop(&hti); 252 + rhashtable_walk_exit(&hti); 253 + } 254 + EXPORT_SYMBOL(fqdir_pre_exit); 255 + 221 256 void fqdir_exit(struct fqdir *fqdir) 222 257 { 223 258 INIT_WORK(&fqdir->destroy_work, fqdir_work_fn); ··· 298 263 kmem_cache_free(f->frags_cachep, q); 299 264 } 300 265 301 - unsigned int inet_frag_rbtree_purge(struct rb_root *root, 302 - enum skb_drop_reason reason) 266 + static unsigned int 267 + inet_frag_rbtree_purge(struct rb_root *root, enum skb_drop_reason reason) 303 268 { 304 269 struct rb_node *p = rb_first(root); 305 270 unsigned int sum = 0; ··· 319 284 } 320 285 return sum; 321 286 } 322 - EXPORT_SYMBOL(inet_frag_rbtree_purge); 287 + 288 + void inet_frag_queue_flush(struct inet_frag_queue *q, 289 + enum skb_drop_reason reason) 290 + { 291 + unsigned int sum; 292 + 293 + reason = reason ?: SKB_DROP_REASON_FRAG_REASM_TIMEOUT; 294 + sum = inet_frag_rbtree_purge(&q->rb_fragments, reason); 295 + sub_frag_mem_limit(q->fqdir, sum); 296 + } 297 + EXPORT_SYMBOL(inet_frag_queue_flush); 323 298 324 299 void inet_frag_destroy(struct inet_frag_queue *q) 325 300 { ··· 372 327 373 328 timer_setup(&q->timer, f->frag_expire, 0); 374 329 spin_lock_init(&q->lock); 375 - /* One reference for the timer, one for the hash table. */ 330 + /* One reference for the timer, one for the hash table. 331 + * We never take any extra references, only decrement this field. 332 + */ 376 333 refcount_set(&q->refcnt, 2); 377 334 378 335 return q;
+9 -13
net/ipv4/ip_fragment.c
··· 134 134 net = qp->q.fqdir->net; 135 135 136 136 rcu_read_lock(); 137 - 138 - /* Paired with WRITE_ONCE() in fqdir_pre_exit(). */ 139 - if (READ_ONCE(qp->q.fqdir->dead)) 140 - goto out_rcu_unlock; 141 - 142 137 spin_lock(&qp->q.lock); 143 138 144 139 if (qp->q.flags & INET_FRAG_COMPLETE) ··· 141 146 142 147 qp->q.flags |= INET_FRAG_DROP; 143 148 inet_frag_kill(&qp->q, &refs); 149 + 150 + /* Paired with WRITE_ONCE() in fqdir_pre_exit(). */ 151 + if (READ_ONCE(qp->q.fqdir->dead)) { 152 + inet_frag_queue_flush(&qp->q, 0); 153 + goto out; 154 + } 155 + 144 156 __IP_INC_STATS(net, IPSTATS_MIB_REASMFAILS); 145 157 __IP_INC_STATS(net, IPSTATS_MIB_REASMTIMEOUT); 146 158 ··· 242 240 243 241 static int ip_frag_reinit(struct ipq *qp) 244 242 { 245 - unsigned int sum_truesize = 0; 246 - 247 - if (!mod_timer(&qp->q.timer, jiffies + qp->q.fqdir->timeout)) { 248 - refcount_inc(&qp->q.refcnt); 243 + if (!mod_timer_pending(&qp->q.timer, jiffies + qp->q.fqdir->timeout)) 249 244 return -ETIMEDOUT; 250 - } 251 245 252 - sum_truesize = inet_frag_rbtree_purge(&qp->q.rb_fragments, 253 - SKB_DROP_REASON_FRAG_TOO_FAR); 254 - sub_frag_mem_limit(qp->q.fqdir, sum_truesize); 246 + inet_frag_queue_flush(&qp->q, SKB_DROP_REASON_FRAG_TOO_FAR); 255 247 256 248 qp->q.flags = 0; 257 249 qp->q.len = 0;
+1 -1
net/mptcp/Kconfig
··· 4 4 depends on INET 5 5 select SKB_EXTENSIONS 6 6 select CRYPTO_LIB_SHA256 7 - select CRYPTO 7 + select CRYPTO_LIB_UTILS 8 8 help 9 9 Multipath TCP (MPTCP) connections send and receive data over multiple 10 10 subflows in order to utilize multiple network paths. Each subflow
+2 -1
net/mptcp/pm_netlink.c
··· 119 119 } 120 120 121 121 if (tb[MPTCP_PM_ADDR_ATTR_FLAGS]) 122 - entry->flags = nla_get_u32(tb[MPTCP_PM_ADDR_ATTR_FLAGS]); 122 + entry->flags = nla_get_u32(tb[MPTCP_PM_ADDR_ATTR_FLAGS]) & 123 + MPTCP_PM_ADDR_FLAGS_MASK; 123 124 124 125 if (tb[MPTCP_PM_ADDR_ATTR_PORT]) 125 126 entry->addr.port = htons(nla_get_u16(tb[MPTCP_PM_ADDR_ATTR_PORT]));
+14 -8
net/mptcp/protocol.c
··· 1623 1623 struct mptcp_sendmsg_info info = { 1624 1624 .flags = flags, 1625 1625 }; 1626 - bool do_check_data_fin = false; 1626 + bool copied = false; 1627 1627 int push_count = 1; 1628 1628 1629 1629 while (mptcp_send_head(sk) && (push_count > 0)) { ··· 1665 1665 push_count--; 1666 1666 continue; 1667 1667 } 1668 - do_check_data_fin = true; 1668 + copied = true; 1669 1669 } 1670 1670 } 1671 1671 } ··· 1674 1674 if (ssk) 1675 1675 mptcp_push_release(ssk, &info); 1676 1676 1677 - /* ensure the rtx timer is running */ 1678 - if (!mptcp_rtx_timer_pending(sk)) 1679 - mptcp_reset_rtx_timer(sk); 1680 - if (do_check_data_fin) 1677 + /* Avoid scheduling the rtx timer if no data has been pushed; the timer 1678 + * will be updated on positive acks by __mptcp_cleanup_una(). 1679 + */ 1680 + if (copied) { 1681 + if (!mptcp_rtx_timer_pending(sk)) 1682 + mptcp_reset_rtx_timer(sk); 1681 1683 mptcp_check_send_data_fin(sk); 1684 + } 1682 1685 } 1683 1686 1684 1687 static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk, bool first) ··· 2769 2766 2770 2767 /* 2771 2768 * make the whole retrans decision, xmit, disallow 2772 - * fallback atomic 2769 + * fallback atomic, note that we can't retrans even 2770 + * when an infinite fallback is in progress, i.e. new 2771 + * subflows are disallowed. 2773 2772 */ 2774 2773 spin_lock_bh(&msk->fallback_lock); 2775 - if (__mptcp_check_fallback(msk)) { 2774 + if (__mptcp_check_fallback(msk) || 2775 + !msk->allow_subflows) { 2776 2776 spin_unlock_bh(&msk->fallback_lock); 2777 2777 release_sock(ssk); 2778 2778 goto clear_scheduled;
+3
net/netfilter/ipvs/ip_vs_xmit.c
··· 408 408 return -1; 409 409 410 410 err_unreach: 411 + if (!skb->dev) 412 + skb->dev = skb_dst(skb)->dev; 413 + 411 414 dst_link_failure(skb); 412 415 return -1; 413 416 }
+14 -11
net/netfilter/nf_conncount.c
··· 172 172 struct nf_conn *found_ct; 173 173 unsigned int collect = 0; 174 174 bool refcounted = false; 175 + int err = 0; 175 176 176 177 if (!get_ct_or_tuple_from_skb(net, skb, l3num, &ct, &tuple, &zone, &refcounted)) 177 178 return -ENOENT; 178 179 179 180 if (ct && nf_ct_is_confirmed(ct)) { 180 - if (refcounted) 181 - nf_ct_put(ct); 182 - return -EEXIST; 181 + err = -EEXIST; 182 + goto out_put; 183 183 } 184 184 185 185 if ((u32)jiffies == list->last_gc) ··· 231 231 } 232 232 233 233 add_new_node: 234 - if (WARN_ON_ONCE(list->count > INT_MAX)) 235 - return -EOVERFLOW; 234 + if (WARN_ON_ONCE(list->count > INT_MAX)) { 235 + err = -EOVERFLOW; 236 + goto out_put; 237 + } 236 238 237 239 conn = kmem_cache_alloc(conncount_conn_cachep, GFP_ATOMIC); 238 - if (conn == NULL) 239 - return -ENOMEM; 240 + if (conn == NULL) { 241 + err = -ENOMEM; 242 + goto out_put; 243 + } 240 244 241 245 conn->tuple = tuple; 242 246 conn->zone = *zone; ··· 253 249 out_put: 254 250 if (refcounted) 255 251 nf_ct_put(ct); 256 - return 0; 252 + return err; 257 253 } 258 254 259 255 int nf_conncount_add_skb(struct net *net, ··· 460 456 461 457 rb_link_node_rcu(&rbconn->node, parent, rbnode); 462 458 rb_insert_color(&rbconn->node, root); 463 - 464 - if (refcounted) 465 - nf_ct_put(ct); 466 459 } 467 460 out_unlock: 461 + if (refcounted) 462 + nf_ct_put(ct); 468 463 spin_unlock_bh(&nf_conncount_locks[hash]); 469 464 return count; 470 465 }
+3
net/netfilter/nf_conntrack_core.c
··· 2487 2487 void nf_conntrack_cleanup_net_list(struct list_head *net_exit_list) 2488 2488 { 2489 2489 struct nf_ct_iter_data iter_data = {}; 2490 + unsigned long start = jiffies; 2490 2491 struct net *net; 2491 2492 int busy; 2492 2493 ··· 2508 2507 busy = 1; 2509 2508 } 2510 2509 if (busy) { 2510 + DEBUG_NET_WARN_ONCE(time_after(jiffies, start + 60 * HZ), 2511 + "conntrack cleanup blocked for 60s"); 2511 2512 schedule(); 2512 2513 goto i_see_dead_people; 2513 2514 }
+3 -1
net/netfilter/nf_flow_table_path.c
··· 250 250 if (nft_dev_fill_forward_path(route, dst, ct, dir, ha, &stack) >= 0) 251 251 nft_dev_path_info(&stack, &info, ha, &ft->data); 252 252 253 + if (info.outdev) 254 + route->tuple[dir].out.ifindex = info.outdev->ifindex; 255 + 253 256 if (!info.indev || !nft_flowtable_find_dev(info.indev, ft)) 254 257 return; 255 258 ··· 272 269 273 270 route->tuple[!dir].in.num_encaps = info.num_encaps; 274 271 route->tuple[!dir].in.ingress_vlans = info.ingress_vlans; 275 - route->tuple[dir].out.ifindex = info.outdev->ifindex; 276 272 277 273 if (info.xmit_type == FLOW_OFFLOAD_XMIT_DIRECT) { 278 274 memcpy(route->tuple[dir].out.h_source, info.h_source, ETH_ALEN);
+1 -13
net/netfilter/nf_nat_core.c
··· 294 294 295 295 ct = nf_ct_tuplehash_to_ctrack(thash); 296 296 297 - /* NB: IP_CT_DIR_ORIGINAL should be impossible because 298 - * nf_nat_used_tuple() handles origin collisions. 299 - * 300 - * Handle remote chance other CPU confirmed its ct right after. 301 - */ 302 - if (thash->tuple.dst.dir != IP_CT_DIR_REPLY) 303 - goto out; 304 - 305 297 /* clashing connection subject to NAT? Retry with new tuple. */ 306 298 if (READ_ONCE(ct->status) & uses_nat) 307 299 goto out; 308 300 309 301 if (nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple, 310 - &ignored_ct->tuplehash[IP_CT_DIR_REPLY].tuple) && 311 - nf_ct_tuple_equal(&ct->tuplehash[IP_CT_DIR_REPLY].tuple, 312 - &ignored_ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple)) { 302 + &ignored_ct->tuplehash[IP_CT_DIR_REPLY].tuple)) 313 303 taken = false; 314 - goto out; 315 - } 316 304 out: 317 305 nf_ct_put(ct); 318 306 return taken;
+67 -17
net/netfilter/nf_tables_api.c
··· 123 123 124 124 table->validate_state = new_validate_state; 125 125 } 126 + 127 + static bool nft_chain_vstate_valid(const struct nft_ctx *ctx, 128 + const struct nft_chain *chain) 129 + { 130 + const struct nft_base_chain *base_chain; 131 + enum nft_chain_types type; 132 + u8 hooknum; 133 + 134 + if (WARN_ON_ONCE(!nft_is_base_chain(ctx->chain))) 135 + return false; 136 + 137 + base_chain = nft_base_chain(ctx->chain); 138 + hooknum = base_chain->ops.hooknum; 139 + type = base_chain->type->type; 140 + 141 + /* chain is already validated for this call depth */ 142 + if (chain->vstate.depth >= ctx->level && 143 + chain->vstate.hook_mask[type] & BIT(hooknum)) 144 + return true; 145 + 146 + return false; 147 + } 148 + 126 149 static void nf_tables_trans_destroy_work(struct work_struct *w); 127 150 128 151 static void nft_trans_gc_work(struct work_struct *work); ··· 4102 4079 nf_tables_rule_destroy(ctx, rule); 4103 4080 } 4104 4081 4082 + static void nft_chain_vstate_update(const struct nft_ctx *ctx, struct nft_chain *chain) 4083 + { 4084 + const struct nft_base_chain *base_chain; 4085 + enum nft_chain_types type; 4086 + u8 hooknum; 4087 + 4088 + /* ctx->chain must hold the calling base chain. */ 4089 + if (WARN_ON_ONCE(!nft_is_base_chain(ctx->chain))) { 4090 + memset(&chain->vstate, 0, sizeof(chain->vstate)); 4091 + return; 4092 + } 4093 + 4094 + base_chain = nft_base_chain(ctx->chain); 4095 + hooknum = base_chain->ops.hooknum; 4096 + type = base_chain->type->type; 4097 + 4098 + BUILD_BUG_ON(BIT(NF_INET_NUMHOOKS) > U8_MAX); 4099 + 4100 + chain->vstate.hook_mask[type] |= BIT(hooknum); 4101 + if (chain->vstate.depth < ctx->level) 4102 + chain->vstate.depth = ctx->level; 4103 + } 4104 + 4105 4105 /** nft_chain_validate - loop detection and hook validation 4106 4106 * 4107 4107 * @ctx: context containing call depth and base chain ··· 4134 4088 * and set lookups until either the jump limit is hit or all reachable 4135 4089 * chains have been validated. 4136 4090 */ 4137 - int nft_chain_validate(const struct nft_ctx *ctx, const struct nft_chain *chain) 4091 + int nft_chain_validate(const struct nft_ctx *ctx, struct nft_chain *chain) 4138 4092 { 4139 4093 struct nft_expr *expr, *last; 4140 4094 struct nft_rule *rule; 4141 4095 int err; 4142 4096 4097 + BUILD_BUG_ON(NFT_JUMP_STACK_SIZE > 255); 4143 4098 if (ctx->level == NFT_JUMP_STACK_SIZE) 4144 4099 return -EMLINK; 4100 + 4101 + if (ctx->level > 0) { 4102 + /* jumps to base chains are not allowed. */ 4103 + if (nft_is_base_chain(chain)) 4104 + return -ELOOP; 4105 + 4106 + if (nft_chain_vstate_valid(ctx, chain)) 4107 + return 0; 4108 + } 4145 4109 4146 4110 list_for_each_entry(rule, &chain->rules, list) { 4147 4111 if (fatal_signal_pending(current)) ··· 4171 4115 if (err < 0) 4172 4116 return err; 4173 4117 } 4118 + 4119 + cond_resched(); 4174 4120 } 4175 4121 4122 + nft_chain_vstate_update(ctx, chain); 4176 4123 return 0; 4177 4124 } 4178 4125 EXPORT_SYMBOL_GPL(nft_chain_validate); ··· 4187 4128 .net = net, 4188 4129 .family = table->family, 4189 4130 }; 4190 - int err; 4131 + int err = 0; 4191 4132 4192 4133 list_for_each_entry(chain, &table->chains, list) { 4193 4134 if (!nft_is_base_chain(chain)) ··· 4196 4137 ctx.chain = chain; 4197 4138 err = nft_chain_validate(&ctx, chain); 4198 4139 if (err < 0) 4199 - return err; 4200 - 4201 - cond_resched(); 4140 + goto err; 4202 4141 } 4203 4142 4204 - return 0; 4143 + err: 4144 + list_for_each_entry(chain, &table->chains, list) 4145 + memset(&chain->vstate, 0, sizeof(chain->vstate)); 4146 + 4147 + return err; 4205 4148 } 4206 4149 4207 4150 int nft_setelem_validate(const struct nft_ctx *ctx, struct nft_set *set, ··· 11737 11676 enum nft_data_types type, 11738 11677 unsigned int len) 11739 11678 { 11740 - int err; 11741 - 11742 11679 switch (reg) { 11743 11680 case NFT_REG_VERDICT: 11744 11681 if (type != NFT_DATA_VERDICT) 11745 11682 return -EINVAL; 11746 - 11747 - if (data != NULL && 11748 - (data->verdict.code == NFT_GOTO || 11749 - data->verdict.code == NFT_JUMP)) { 11750 - err = nft_chain_validate(ctx, data->verdict.chain); 11751 - if (err < 0) 11752 - return err; 11753 - } 11754 - 11755 11683 break; 11756 11684 default: 11757 11685 if (type != NFT_DATA_VALUE)
+3 -1
net/netrom/nr_out.c
··· 43 43 frontlen = skb_headroom(skb); 44 44 45 45 while (skb->len > 0) { 46 - if ((skbn = sock_alloc_send_skb(sk, frontlen + NR_MAX_PACKET_SIZE, 0, &err)) == NULL) 46 + if ((skbn = sock_alloc_send_skb(sk, frontlen + NR_MAX_PACKET_SIZE, 0, &err)) == NULL) { 47 + kfree_skb(skb); 47 48 return; 49 + } 48 50 49 51 skb_reserve(skbn, frontlen); 50 52
+10 -3
net/openvswitch/flow_netlink.c
··· 2802 2802 return err; 2803 2803 } 2804 2804 2805 - static bool validate_push_nsh(const struct nlattr *attr, bool log) 2805 + static bool validate_push_nsh(const struct nlattr *a, bool log) 2806 2806 { 2807 + struct nlattr *nsh_key = nla_data(a); 2807 2808 struct sw_flow_match match; 2808 2809 struct sw_flow_key key; 2809 2810 2811 + /* There must be one and only one NSH header. */ 2812 + if (!nla_ok(nsh_key, nla_len(a)) || 2813 + nla_total_size(nla_len(nsh_key)) != nla_len(a) || 2814 + nla_type(nsh_key) != OVS_KEY_ATTR_NSH) 2815 + return false; 2816 + 2810 2817 ovs_match_init(&match, &key, true, NULL); 2811 - return !nsh_key_put_from_nlattr(attr, &match, false, true, log); 2818 + return !nsh_key_put_from_nlattr(nsh_key, &match, false, true, log); 2812 2819 } 2813 2820 2814 2821 /* Return false if there are any non-masked bits set. ··· 3396 3389 return -EINVAL; 3397 3390 } 3398 3391 mac_proto = MAC_PROTO_NONE; 3399 - if (!validate_push_nsh(nla_data(a), log)) 3392 + if (!validate_push_nsh(a, log)) 3400 3393 return -EINVAL; 3401 3394 break; 3402 3395
+9
net/sched/act_mirred.c
··· 281 281 282 282 want_ingress = tcf_mirred_act_wants_ingress(m_eaction); 283 283 284 + if (dev == skb->dev && want_ingress == at_ingress) { 285 + pr_notice_once("tc mirred: Loop (%s:%s --> %s:%s)\n", 286 + netdev_name(skb->dev), 287 + at_ingress ? "ingress" : "egress", 288 + netdev_name(dev), 289 + want_ingress ? "ingress" : "egress"); 290 + goto err_cant_do; 291 + } 292 + 284 293 /* All mirred/redirected skbs should clear previous ct info */ 285 294 nf_reset_ct(skb_to_send); 286 295 if (want_ingress && !at_ingress) /* drop dst for egress -> ingress */
+5 -1
net/sched/sch_ets.c
··· 652 652 sch_tree_lock(sch); 653 653 654 654 for (i = nbands; i < oldbands; i++) { 655 - if (i >= q->nstrict && q->classes[i].qdisc->q.qlen) 655 + if (cl_is_active(&q->classes[i])) 656 656 list_del_init(&q->classes[i].alist); 657 657 qdisc_purge_queue(q->classes[i].qdisc); 658 658 } ··· 663 663 list_add_tail(&q->classes[i].alist, &q->active); 664 664 q->classes[i].deficit = quanta[i]; 665 665 } 666 + } 667 + for (i = q->nstrict; i < nstrict; i++) { 668 + if (cl_is_active(&q->classes[i])) 669 + list_del_init(&q->classes[i].alist); 666 670 } 667 671 WRITE_ONCE(q->nstrict, nstrict); 668 672 memcpy(q->prio2band, priomap, sizeof(priomap));
+2
net/sctp/ipv6.c
··· 492 492 struct ipv6_pinfo *newnp, *np = inet6_sk(sk); 493 493 struct ipv6_txoptions *opt; 494 494 495 + inet_sk(newsk)->inet_opt = NULL; 496 + 495 497 newnp = inet6_sk(newsk); 496 498 497 499 rcu_read_lock();
+4 -3
net/sctp/socket.c
··· 4863 4863 4864 4864 newsp->pf->to_sk_daddr(&asoc->peer.primary_addr, newsk); 4865 4865 newinet->inet_dport = htons(asoc->peer.port); 4866 - 4867 - newsp->pf->copy_ip_options(sk, newsk); 4868 4866 atomic_set(&newinet->inet_id, get_random_u16()); 4869 4867 4870 4868 inet_set_bit(MC_LOOP, newsk); ··· 4872 4874 4873 4875 #if IS_ENABLED(CONFIG_IPV6) 4874 4876 if (sk->sk_family == AF_INET6) { 4875 - struct ipv6_pinfo *newnp = inet6_sk(newsk); 4877 + struct ipv6_pinfo *newnp; 4876 4878 4877 4879 newinet->pinet6 = &((struct sctp6_sock *)newsk)->inet6; 4878 4880 newinet->ipv6_fl_list = NULL; 4879 4881 4882 + newnp = inet6_sk(newsk); 4880 4883 memcpy(newnp, inet6_sk(sk), sizeof(struct ipv6_pinfo)); 4881 4884 newnp->ipv6_mc_list = NULL; 4882 4885 newnp->ipv6_ac_list = NULL; 4883 4886 } 4884 4887 #endif 4888 + 4889 + newsp->pf->copy_ip_options(sk, newsk); 4885 4890 4886 4891 newsp->do_auto_asconf = 0; 4887 4892 skb_queue_head_init(&newsp->pd_lobby);
+1 -1
net/smc/Kconfig
··· 22 22 23 23 config SMC_HS_CTRL_BPF 24 24 bool "Generic eBPF hook for SMC handshake flow" 25 - depends on SMC && BPF_SYSCALL 25 + depends on SMC && BPF_JIT && BPF_SYSCALL 26 26 default y 27 27 help 28 28 SMC_HS_CTRL_BPF enables support to register generic eBPF hook for SMC
+1 -1
net/unix/garbage.c
··· 199 199 } 200 200 } 201 201 202 - static DEFINE_SPINLOCK(unix_gc_lock); 202 + static __cacheline_aligned_in_smp DEFINE_SPINLOCK(unix_gc_lock); 203 203 204 204 void unix_add_edges(struct scm_fp_list *fpl, struct unix_sock *receiver) 205 205 {
+5 -1
scripts/coccicheck
··· 270 270 271 271 if [ "$COCCI" = "" ] ; then 272 272 for f in `find $srctree/scripts/coccinelle/ -name '*.cocci' -type f | sort`; do 273 - coccinelle $f 273 + if grep -q "virtual[[:space:]]\+$MODE" "$f"; then 274 + coccinelle $f 275 + else 276 + echo "warning: Skipping $f as it does not match mode '$MODE'" 277 + fi 274 278 done 275 279 else 276 280 coccinelle $COCCI
+1 -1
scripts/coccinelle/api/pm_runtime.cocci
··· 109 109 pm_runtime_api << r.pm_runtime_api; 110 110 @@ 111 111 112 - msg = "%s returns < 0 as error. Unecessary IS_ERR_VALUE at line %s" % (pm_runtime_api, p2[0].line) 112 + msg = "%s returns < 0 as error. Unnecessary IS_ERR_VALUE at line %s" % (pm_runtime_api, p2[0].line) 113 113 coccilib.report.print_report(p1[0],msg)
+1 -1
sound/soc/sdca/Makefile
··· 3 3 snd-soc-sdca-y := sdca_functions.o sdca_device.o sdca_function_device.o \ 4 4 sdca_regmap.o sdca_asoc.o sdca_ump.o 5 5 snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_HID) += sdca_hid.o 6 - snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_IRQ) += sdca_interrupts.o 6 + snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_IRQ) += sdca_interrupts.o sdca_jack.o 7 7 snd-soc-sdca-$(CONFIG_SND_SOC_SDCA_FDL) += sdca_fdl.o 8 8 9 9 snd-soc-sdca-class-y := sdca_class.o
+13
sound/soc/sdca/sdca_class_function.c
··· 19 19 #include <sound/sdca_fdl.h> 20 20 #include <sound/sdca_function.h> 21 21 #include <sound/sdca_interrupts.h> 22 + #include <sound/sdca_jack.h> 22 23 #include <sound/sdca_regmap.h> 23 24 #include <sound/sdw.h> 24 25 #include <sound/soc-component.h> ··· 196 195 return sdca_irq_populate(drv->function, component, core->irq_info); 197 196 } 198 197 198 + static int class_function_set_jack(struct snd_soc_component *component, 199 + struct snd_soc_jack *jack, void *d) 200 + { 201 + struct class_function_drv *drv = snd_soc_component_get_drvdata(component); 202 + struct sdca_class_drv *core = drv->core; 203 + 204 + return sdca_jack_set_jack(core->irq_info, jack); 205 + } 206 + 199 207 static const struct snd_soc_component_driver class_function_component_drv = { 200 208 .probe = class_function_component_probe, 201 209 .endianness = 1, ··· 360 350 if (IS_ERR(drv->regmap)) 361 351 return dev_err_probe(dev, PTR_ERR(drv->regmap), 362 352 "failed to create regmap"); 353 + 354 + if (desc->type == SDCA_FUNCTION_TYPE_UAJ) 355 + cmp_drv->set_jack = class_function_set_jack; 363 356 364 357 ret = sdca_asoc_populate_component(dev, drv->function, cmp_drv, 365 358 &dais, &num_dais,
+7 -76
sound/soc/sdca/sdca_interrupts.c
··· 22 22 #include <sound/sdca_function.h> 23 23 #include <sound/sdca_hid.h> 24 24 #include <sound/sdca_interrupts.h> 25 + #include <sound/sdca_jack.h> 25 26 #include <sound/sdca_ump.h> 26 27 #include <sound/soc-component.h> 27 28 #include <sound/soc.h> ··· 156 155 { 157 156 struct sdca_interrupt *interrupt = data; 158 157 struct device *dev = interrupt->dev; 159 - struct snd_soc_component *component = interrupt->component; 160 - struct snd_soc_card *card = component->card; 161 - struct rw_semaphore *rwsem = &card->snd_card->controls_rwsem; 162 - struct snd_kcontrol *kctl = interrupt->priv; 163 - struct snd_ctl_elem_value *ucontrol __free(kfree) = NULL; 164 - struct soc_enum *soc_enum; 165 158 irqreturn_t irqret = IRQ_NONE; 166 - unsigned int reg, val; 167 159 int ret; 168 160 169 161 ret = pm_runtime_get_sync(dev); ··· 165 171 goto error; 166 172 } 167 173 168 - if (!kctl) { 169 - const char *name __free(kfree) = kasprintf(GFP_KERNEL, "%s %s", 170 - interrupt->entity->label, 171 - SDCA_CTL_SELECTED_MODE_NAME); 172 - 173 - if (!name) 174 - goto error; 175 - 176 - kctl = snd_soc_component_get_kcontrol(component, name); 177 - if (!kctl) { 178 - dev_dbg(dev, "control not found: %s\n", name); 179 - goto error; 180 - } 181 - 182 - interrupt->priv = kctl; 183 - } 184 - 185 - soc_enum = (struct soc_enum *)kctl->private_value; 186 - 187 - reg = SDW_SDCA_CTL(interrupt->function->desc->adr, interrupt->entity->id, 188 - interrupt->control->sel, 0); 189 - 190 - ret = regmap_read(interrupt->function_regmap, reg, &val); 191 - if (ret < 0) { 192 - dev_err(dev, "failed to read detected mode: %d\n", ret); 174 + ret = sdca_jack_process(interrupt); 175 + if (ret) 193 176 goto error; 194 - } 195 - 196 - switch (val) { 197 - case SDCA_DETECTED_MODE_DETECTION_IN_PROGRESS: 198 - case SDCA_DETECTED_MODE_JACK_UNKNOWN: 199 - reg = SDW_SDCA_CTL(interrupt->function->desc->adr, 200 - interrupt->entity->id, 201 - SDCA_CTL_GE_SELECTED_MODE, 0); 202 - 203 - /* 204 - * Selected mode is not normally marked as volatile register 205 - * (RW), but here force a read from the hardware. If the 206 - * detected mode is unknown we need to see what the device 207 - * selected as a "safe" option. 208 - */ 209 - regcache_drop_region(interrupt->function_regmap, reg, reg); 210 - 211 - ret = regmap_read(interrupt->function_regmap, reg, &val); 212 - if (ret) { 213 - dev_err(dev, "failed to re-check selected mode: %d\n", ret); 214 - goto error; 215 - } 216 - break; 217 - default: 218 - break; 219 - } 220 - 221 - dev_dbg(dev, "%s: %#x\n", interrupt->name, val); 222 - 223 - ucontrol = kzalloc(sizeof(*ucontrol), GFP_KERNEL); 224 - if (!ucontrol) 225 - goto error; 226 - 227 - ucontrol->value.enumerated.item[0] = snd_soc_enum_val_to_item(soc_enum, val); 228 - 229 - down_write(rwsem); 230 - ret = kctl->put(kctl, ucontrol); 231 - up_write(rwsem); 232 - if (ret < 0) { 233 - dev_err(dev, "failed to update selected mode: %d\n", ret); 234 - goto error; 235 - } 236 - 237 - snd_ctl_notify(card->snd_card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id); 238 177 239 178 irqret = IRQ_HANDLED; 240 179 error: ··· 463 536 handler = function_status_handler; 464 537 break; 465 538 case SDCA_CTL_TYPE_S(GE, DETECTED_MODE): 539 + ret = sdca_jack_alloc_state(interrupt); 540 + if (ret) 541 + return ret; 542 + 466 543 handler = detected_mode_handler; 467 544 break; 468 545 case SDCA_CTL_TYPE_S(XU, FDL_CURRENTOWNER):
+244
sound/soc/sdca/sdca_jack.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + // Copyright (C) 2025 Cirrus Logic, Inc. and 3 + // Cirrus Logic International Semiconductor Ltd. 4 + 5 + /* 6 + * The MIPI SDCA specification is available for public downloads at 7 + * https://www.mipi.org/mipi-sdca-v1-0-download 8 + */ 9 + 10 + #include <linux/cleanup.h> 11 + #include <linux/device.h> 12 + #include <linux/dev_printk.h> 13 + #include <linux/soundwire/sdw.h> 14 + #include <linux/soundwire/sdw_registers.h> 15 + #include <linux/sprintf.h> 16 + #include <linux/regmap.h> 17 + #include <linux/rwsem.h> 18 + #include <sound/asound.h> 19 + #include <sound/control.h> 20 + #include <sound/jack.h> 21 + #include <sound/sdca.h> 22 + #include <sound/sdca_function.h> 23 + #include <sound/sdca_interrupts.h> 24 + #include <sound/sdca_jack.h> 25 + #include <sound/soc-component.h> 26 + #include <sound/soc-jack.h> 27 + #include <sound/soc.h> 28 + 29 + /** 30 + * sdca_jack_process - Process an SDCA jack event 31 + * @interrupt: SDCA interrupt structure 32 + * 33 + * Return: Zero on success or a negative error code. 34 + */ 35 + int sdca_jack_process(struct sdca_interrupt *interrupt) 36 + { 37 + struct device *dev = interrupt->dev; 38 + struct snd_soc_component *component = interrupt->component; 39 + struct snd_soc_card *card = component->card; 40 + struct rw_semaphore *rwsem = &card->snd_card->controls_rwsem; 41 + struct jack_state *state = interrupt->priv; 42 + struct snd_kcontrol *kctl = state->kctl; 43 + struct snd_ctl_elem_value *ucontrol __free(kfree) = NULL; 44 + struct soc_enum *soc_enum; 45 + unsigned int reg, val; 46 + int ret; 47 + 48 + if (!kctl) { 49 + const char *name __free(kfree) = kasprintf(GFP_KERNEL, "%s %s", 50 + interrupt->entity->label, 51 + SDCA_CTL_SELECTED_MODE_NAME); 52 + 53 + if (!name) 54 + return -ENOMEM; 55 + 56 + kctl = snd_soc_component_get_kcontrol(component, name); 57 + if (!kctl) { 58 + dev_dbg(dev, "control not found: %s\n", name); 59 + return -ENOENT; 60 + } 61 + 62 + state->kctl = kctl; 63 + } 64 + 65 + soc_enum = (struct soc_enum *)kctl->private_value; 66 + 67 + reg = SDW_SDCA_CTL(interrupt->function->desc->adr, interrupt->entity->id, 68 + interrupt->control->sel, 0); 69 + 70 + ret = regmap_read(interrupt->function_regmap, reg, &val); 71 + if (ret < 0) { 72 + dev_err(dev, "failed to read detected mode: %d\n", ret); 73 + return ret; 74 + } 75 + 76 + switch (val) { 77 + case SDCA_DETECTED_MODE_DETECTION_IN_PROGRESS: 78 + case SDCA_DETECTED_MODE_JACK_UNKNOWN: 79 + reg = SDW_SDCA_CTL(interrupt->function->desc->adr, 80 + interrupt->entity->id, 81 + SDCA_CTL_GE_SELECTED_MODE, 0); 82 + 83 + /* 84 + * Selected mode is not normally marked as volatile register 85 + * (RW), but here force a read from the hardware. If the 86 + * detected mode is unknown we need to see what the device 87 + * selected as a "safe" option. 88 + */ 89 + regcache_drop_region(interrupt->function_regmap, reg, reg); 90 + 91 + ret = regmap_read(interrupt->function_regmap, reg, &val); 92 + if (ret) { 93 + dev_err(dev, "failed to re-check selected mode: %d\n", ret); 94 + return ret; 95 + } 96 + break; 97 + default: 98 + break; 99 + } 100 + 101 + dev_dbg(dev, "%s: %#x\n", interrupt->name, val); 102 + 103 + ucontrol = kzalloc(sizeof(*ucontrol), GFP_KERNEL); 104 + if (!ucontrol) 105 + return -ENOMEM; 106 + 107 + ucontrol->value.enumerated.item[0] = snd_soc_enum_val_to_item(soc_enum, val); 108 + 109 + down_write(rwsem); 110 + ret = kctl->put(kctl, ucontrol); 111 + up_write(rwsem); 112 + if (ret < 0) { 113 + dev_err(dev, "failed to update selected mode: %d\n", ret); 114 + return ret; 115 + } 116 + 117 + snd_ctl_notify(card->snd_card, SNDRV_CTL_EVENT_MASK_VALUE, &kctl->id); 118 + 119 + return sdca_jack_report(interrupt); 120 + } 121 + EXPORT_SYMBOL_NS_GPL(sdca_jack_process, "SND_SOC_SDCA"); 122 + 123 + /** 124 + * sdca_jack_alloc_state - allocate state for a jack interrupt 125 + * @interrupt: SDCA interrupt structure. 126 + * 127 + * Return: Zero on success or a negative error code. 128 + */ 129 + int sdca_jack_alloc_state(struct sdca_interrupt *interrupt) 130 + { 131 + struct device *dev = interrupt->dev; 132 + struct jack_state *jack_state; 133 + 134 + jack_state = devm_kzalloc(dev, sizeof(*jack_state), GFP_KERNEL); 135 + if (!jack_state) 136 + return -ENOMEM; 137 + 138 + interrupt->priv = jack_state; 139 + 140 + return 0; 141 + } 142 + EXPORT_SYMBOL_NS_GPL(sdca_jack_alloc_state, "SND_SOC_SDCA"); 143 + 144 + /** 145 + * sdca_jack_set_jack - attach an ASoC jack to SDCA 146 + * @info: SDCA interrupt information. 147 + * @jack: ASoC jack to be attached. 148 + * 149 + * Return: Zero on success or a negative error code. 150 + */ 151 + int sdca_jack_set_jack(struct sdca_interrupt_info *info, struct snd_soc_jack *jack) 152 + { 153 + int i, ret; 154 + 155 + guard(mutex)(&info->irq_lock); 156 + 157 + for (i = 0; i < SDCA_MAX_INTERRUPTS; i++) { 158 + struct sdca_interrupt *interrupt = &info->irqs[i]; 159 + struct sdca_control *control = interrupt->control; 160 + struct sdca_entity *entity = interrupt->entity; 161 + struct jack_state *jack_state; 162 + 163 + if (!interrupt->irq) 164 + continue; 165 + 166 + switch (SDCA_CTL_TYPE(entity->type, control->sel)) { 167 + case SDCA_CTL_TYPE_S(GE, DETECTED_MODE): 168 + jack_state = interrupt->priv; 169 + jack_state->jack = jack; 170 + 171 + /* Report initial state in case IRQ was already handled */ 172 + ret = sdca_jack_report(interrupt); 173 + if (ret) 174 + return ret; 175 + break; 176 + default: 177 + break; 178 + } 179 + } 180 + 181 + return 0; 182 + } 183 + EXPORT_SYMBOL_NS_GPL(sdca_jack_set_jack, "SND_SOC_SDCA"); 184 + 185 + int sdca_jack_report(struct sdca_interrupt *interrupt) 186 + { 187 + struct jack_state *jack_state = interrupt->priv; 188 + struct sdca_control_range *range; 189 + enum sdca_terminal_type type; 190 + unsigned int report = 0; 191 + unsigned int reg, val; 192 + int ret; 193 + 194 + reg = SDW_SDCA_CTL(interrupt->function->desc->adr, interrupt->entity->id, 195 + SDCA_CTL_GE_SELECTED_MODE, 0); 196 + 197 + ret = regmap_read(interrupt->function_regmap, reg, &val); 198 + if (ret) { 199 + dev_err(interrupt->dev, "failed to read selected mode: %d\n", ret); 200 + return ret; 201 + } 202 + 203 + range = sdca_selector_find_range(interrupt->dev, interrupt->entity, 204 + SDCA_CTL_GE_SELECTED_MODE, 205 + SDCA_SELECTED_MODE_NCOLS, 0); 206 + if (!range) 207 + return -EINVAL; 208 + 209 + type = sdca_range_search(range, SDCA_SELECTED_MODE_INDEX, 210 + val, SDCA_SELECTED_MODE_TERM_TYPE); 211 + 212 + switch (type) { 213 + case SDCA_TERM_TYPE_LINEIN_STEREO: 214 + case SDCA_TERM_TYPE_LINEIN_FRONT_LR: 215 + case SDCA_TERM_TYPE_LINEIN_CENTER_LFE: 216 + case SDCA_TERM_TYPE_LINEIN_SURROUND_LR: 217 + case SDCA_TERM_TYPE_LINEIN_REAR_LR: 218 + report = SND_JACK_LINEIN; 219 + break; 220 + case SDCA_TERM_TYPE_LINEOUT_STEREO: 221 + case SDCA_TERM_TYPE_LINEOUT_FRONT_LR: 222 + case SDCA_TERM_TYPE_LINEOUT_CENTER_LFE: 223 + case SDCA_TERM_TYPE_LINEOUT_SURROUND_LR: 224 + case SDCA_TERM_TYPE_LINEOUT_REAR_LR: 225 + report = SND_JACK_LINEOUT; 226 + break; 227 + case SDCA_TERM_TYPE_MIC_JACK: 228 + report = SND_JACK_MICROPHONE; 229 + break; 230 + case SDCA_TERM_TYPE_HEADPHONE_JACK: 231 + report = SND_JACK_HEADPHONE; 232 + break; 233 + case SDCA_TERM_TYPE_HEADSET_JACK: 234 + report = SND_JACK_HEADSET; 235 + break; 236 + default: 237 + break; 238 + } 239 + 240 + snd_soc_jack_report(jack_state->jack, report, 0xFFFF); 241 + 242 + return 0; 243 + } 244 + EXPORT_SYMBOL_NS_GPL(sdca_jack_report, "SND_SOC_SDCA");
+2
tools/bpf/bpftool/Makefile
··· 224 224 225 225 $(OUTPUT)%.bpf.o: skeleton/%.bpf.c $(OUTPUT)vmlinux.h $(LIBBPF_BOOTSTRAP) 226 226 $(QUIET_CLANG)$(CLANG) \ 227 + -Wno-microsoft-anon-tag \ 228 + -fms-extensions \ 227 229 -I$(or $(OUTPUT),.) \ 228 230 -I$(srctree)/tools/include/uapi/ \ 229 231 -I$(LIBBPF_BOOTSTRAP_INCLUDE) \
+4 -3
tools/lib/bpf/libbpf.c
··· 8484 8484 struct bpf_object *obj = ctx; 8485 8485 const struct btf_type *t; 8486 8486 struct extern_desc *ext; 8487 - char *res; 8487 + const char *res; 8488 8488 8489 8489 res = strstr(sym_name, ".llvm."); 8490 8490 if (sym_type == 'd' && res) ··· 11818 11818 * 11819 11819 * [0] fb6a421fb615 ("kallsyms: Match symbols exactly with CONFIG_LTO_CLANG") 11820 11820 */ 11821 - char sym_trim[256], *psym_trim = sym_trim, *sym_sfx; 11821 + char sym_trim[256], *psym_trim = sym_trim; 11822 + const char *sym_sfx; 11822 11823 11823 11824 if (!(sym_sfx = strstr(sym_name, ".llvm."))) 11824 11825 return 0; ··· 12402 12401 if (!search_paths[i]) 12403 12402 continue; 12404 12403 for (s = search_paths[i]; s != NULL; s = strchr(s, ':')) { 12405 - char *next_path; 12404 + const char *next_path; 12406 12405 int seg_len; 12407 12406 12408 12407 if (s[0] == ':')
+2
tools/net/ynl/Makefile.deps
··· 13 13 # need the explicit -D matching what's in /usr, to avoid multiple definitions. 14 14 15 15 get_hdr_inc=-D$(1) -include $(UAPI_PATH)/linux/$(2) 16 + get_hdr_inc2=-D$(1) -D$(2) -include $(UAPI_PATH)/linux/$(3) 16 17 17 18 CFLAGS_devlink:=$(call get_hdr_inc,_LINUX_DEVLINK_H_,devlink.h) 18 19 CFLAGS_dpll:=$(call get_hdr_inc,_LINUX_DPLL_H,dpll.h) ··· 49 48 $(call get_hdr_inc,_TC_SKBEDIT_H,tc_act/tc_skbedit.h) \ 50 49 $(call get_hdr_inc,_TC_TUNNEL_KEY_H,tc_act/tc_tunnel_key.h) 51 50 CFLAGS_tcp_metrics:=$(call get_hdr_inc,_LINUX_TCP_METRICS_H,tcp_metrics.h) 51 + CFLAGS_wireguard:=$(call get_hdr_inc2,_LINUX_WIREGUARD_H,_WG_UAPI_WIREGUARD_H,wireguard.h)
+2
tools/testing/selftests/bpf/Makefile
··· 437 437 -I$(abspath $(OUTPUT)/../usr/include) \ 438 438 -std=gnu11 \ 439 439 -fno-strict-aliasing \ 440 + -Wno-microsoft-anon-tag \ 441 + -fms-extensions \ 440 442 -Wno-compare-distinct-pointer-types \ 441 443 -Wno-initializer-overrides \ 442 444 #
+73 -18
tools/testing/selftests/bpf/prog_tests/d_path.c
··· 38 38 return readlink(buf, src.paths[src.cnt++], MAX_PATH_LEN); 39 39 } 40 40 41 + static inline long syscall_close(int fd) 42 + { 43 + return syscall(__NR_close_range, 44 + (unsigned int)fd, 45 + (unsigned int)fd, 46 + 0u); 47 + } 48 + 41 49 static int trigger_fstat_events(pid_t pid) 42 50 { 43 51 int sockfd = -1, procfd = -1, devfd = -1; ··· 112 104 /* sys_close no longer triggers filp_close, but we can 113 105 * call sys_close_range instead which still does 114 106 */ 115 - #define close(fd) syscall(__NR_close_range, fd, fd, 0) 116 - 117 - close(pipefd[0]); 118 - close(pipefd[1]); 119 - close(sockfd); 120 - close(procfd); 121 - close(devfd); 122 - close(localfd); 123 - close(indicatorfd); 124 - 125 - #undef close 107 + syscall_close(pipefd[0]); 108 + syscall_close(pipefd[1]); 109 + syscall_close(sockfd); 110 + syscall_close(procfd); 111 + syscall_close(devfd); 112 + syscall_close(localfd); 113 + syscall_close(indicatorfd); 126 114 return ret; 115 + } 116 + 117 + static void attach_and_load(struct test_d_path **skel) 118 + { 119 + int err; 120 + 121 + *skel = test_d_path__open_and_load(); 122 + if (CHECK(!*skel, "setup", "d_path skeleton failed\n")) 123 + goto cleanup; 124 + 125 + err = test_d_path__attach(*skel); 126 + if (CHECK(err, "setup", "attach failed: %d\n", err)) 127 + goto cleanup; 128 + 129 + (*skel)->bss->my_pid = getpid(); 130 + return; 131 + 132 + cleanup: 133 + test_d_path__destroy(*skel); 134 + *skel = NULL; 127 135 } 128 136 129 137 static void test_d_path_basic(void) ··· 148 124 struct test_d_path *skel; 149 125 int err; 150 126 151 - skel = test_d_path__open_and_load(); 152 - if (CHECK(!skel, "setup", "d_path skeleton failed\n")) 153 - goto cleanup; 154 - 155 - err = test_d_path__attach(skel); 156 - if (CHECK(err, "setup", "attach failed: %d\n", err)) 127 + attach_and_load(&skel); 128 + if (!skel) 157 129 goto cleanup; 158 130 159 131 bss = skel->bss; 160 - bss->my_pid = getpid(); 161 132 162 133 err = trigger_fstat_events(bss->my_pid); 163 134 if (err < 0) ··· 214 195 test_d_path_check_types__destroy(skel); 215 196 } 216 197 198 + /* Check if the verifier correctly generates code for 199 + * accessing the memory modified by d_path helper. 200 + */ 201 + static void test_d_path_mem_access(void) 202 + { 203 + int localfd = -1; 204 + char path_template[] = "/dev/shm/d_path_loadgen.XXXXXX"; 205 + struct test_d_path__bss *bss; 206 + struct test_d_path *skel; 207 + 208 + attach_and_load(&skel); 209 + if (!skel) 210 + goto cleanup; 211 + 212 + bss = skel->bss; 213 + 214 + localfd = mkstemp(path_template); 215 + if (CHECK(localfd < 0, "trigger", "mkstemp failed\n")) 216 + goto cleanup; 217 + 218 + if (CHECK(fallocate(localfd, 0, 0, 1024) < 0, "trigger", "fallocate failed\n")) 219 + goto cleanup; 220 + remove(path_template); 221 + 222 + if (CHECK(!bss->path_match_fallocate, "check", 223 + "failed to read fallocate path")) 224 + goto cleanup; 225 + 226 + cleanup: 227 + syscall_close(localfd); 228 + test_d_path__destroy(skel); 229 + } 230 + 217 231 void test_d_path(void) 218 232 { 219 233 if (test__start_subtest("basic")) ··· 257 205 258 206 if (test__start_subtest("check_alloc_mem")) 259 207 test_d_path_check_types(); 208 + 209 + if (test__start_subtest("check_mem_access")) 210 + test_d_path_mem_access(); 260 211 }
+42 -5
tools/testing/selftests/bpf/prog_tests/dmabuf_iter.c
··· 73 73 return -1; 74 74 } 75 75 76 - static int create_sys_heap_dmabuf(void) 76 + static int create_sys_heap_dmabuf(size_t bytes) 77 77 { 78 - sysheap_test_buffer_size = 20 * getpagesize(); 79 - 80 78 struct dma_heap_allocation_data data = { 81 - .len = sysheap_test_buffer_size, 79 + .len = bytes, 82 80 .fd = 0, 83 81 .fd_flags = O_RDWR | O_CLOEXEC, 84 82 .heap_flags = 0, ··· 108 110 static int create_test_buffers(void) 109 111 { 110 112 udmabuf = create_udmabuf(); 111 - sysheap_dmabuf = create_sys_heap_dmabuf(); 113 + 114 + sysheap_test_buffer_size = 20 * getpagesize(); 115 + sysheap_dmabuf = create_sys_heap_dmabuf(sysheap_test_buffer_size); 112 116 113 117 if (udmabuf < 0 || sysheap_dmabuf < 0) 114 118 return -1; ··· 219 219 close(iter_fd); 220 220 } 221 221 222 + static void subtest_dmabuf_iter_check_lots_of_buffers(struct dmabuf_iter *skel) 223 + { 224 + int iter_fd; 225 + char buf[1024]; 226 + size_t total_bytes_read = 0; 227 + ssize_t bytes_read; 228 + 229 + iter_fd = bpf_iter_create(bpf_link__fd(skel->links.dmabuf_collector)); 230 + if (!ASSERT_OK_FD(iter_fd, "iter_create")) 231 + return; 232 + 233 + while ((bytes_read = read(iter_fd, buf, sizeof(buf))) > 0) 234 + total_bytes_read += bytes_read; 235 + 236 + ASSERT_GT(total_bytes_read, getpagesize(), "total_bytes_read"); 237 + 238 + close(iter_fd); 239 + } 240 + 241 + 222 242 static void subtest_dmabuf_iter_check_open_coded(struct dmabuf_iter *skel, int map_fd) 223 243 { 224 244 LIBBPF_OPTS(bpf_test_run_opts, topts); ··· 295 275 subtest_dmabuf_iter_check_no_infinite_reads(skel); 296 276 if (test__start_subtest("default_iter")) 297 277 subtest_dmabuf_iter_check_default_iter(skel); 278 + if (test__start_subtest("lots_of_buffers")) { 279 + size_t NUM_BUFS = 100; 280 + int buffers[NUM_BUFS]; 281 + int i; 282 + 283 + for (i = 0; i < NUM_BUFS; ++i) { 284 + buffers[i] = create_sys_heap_dmabuf(getpagesize()); 285 + if (!ASSERT_OK_FD(buffers[i], "dmabuf_fd")) 286 + goto cleanup_bufs; 287 + } 288 + 289 + subtest_dmabuf_iter_check_lots_of_buffers(skel); 290 + 291 + cleanup_bufs: 292 + for (--i; i >= 0; --i) 293 + close(buffers[i]); 294 + } 298 295 if (test__start_subtest("open_coded")) 299 296 subtest_dmabuf_iter_check_open_coded(skel, map_fd); 300 297
+23
tools/testing/selftests/bpf/progs/test_d_path.c
··· 17 17 18 18 int called_stat = 0; 19 19 int called_close = 0; 20 + int path_match_fallocate = 0; 20 21 21 22 SEC("fentry/security_inode_getattr") 22 23 int BPF_PROG(prog_stat, struct path *path, struct kstat *stat, ··· 60 59 61 60 rets_close[cnt] = ret; 62 61 cnt_close++; 62 + return 0; 63 + } 64 + 65 + SEC("fentry/vfs_fallocate") 66 + int BPF_PROG(prog_fallocate, struct file *file, int mode, loff_t offset, loff_t len) 67 + { 68 + pid_t pid = bpf_get_current_pid_tgid() >> 32; 69 + int ret = 0; 70 + char path_fallocate[MAX_PATH_LEN] = {}; 71 + 72 + if (pid != my_pid) 73 + return 0; 74 + 75 + ret = bpf_d_path(&file->f_path, 76 + path_fallocate, MAX_PATH_LEN); 77 + if (ret < 0) 78 + return 0; 79 + 80 + if (!path_fallocate[0]) 81 + return 0; 82 + 83 + path_match_fallocate = 1; 63 84 return 0; 64 85 } 65 86
+3 -5
tools/testing/selftests/iommu/iommufd.c
··· 755 755 struct iommu_test_hw_info info; 756 756 uint64_t trailing_bytes; 757 757 } buffer_larger; 758 - struct iommu_test_hw_info_buffer_smaller { 759 - __u32 flags; 760 - } buffer_smaller; 761 758 762 759 if (self->device_id) { 763 760 uint8_t max_pasid = 0; ··· 786 789 * the fields within the size range still gets updated. 787 790 */ 788 791 test_cmd_get_hw_info(self->device_id, 789 - IOMMU_HW_INFO_TYPE_DEFAULT, 790 - &buffer_smaller, sizeof(buffer_smaller)); 792 + IOMMU_HW_INFO_TYPE_DEFAULT, &buffer_exact, 793 + offsetofend(struct iommu_test_hw_info, 794 + flags)); 791 795 test_cmd_get_hw_info_pasid(self->device_id, &max_pasid); 792 796 ASSERT_EQ(0, max_pasid); 793 797 if (variant->pasid_capable) {
+1
tools/testing/selftests/kvm/rseq_test.c
··· 215 215 switch (opt) { 216 216 case 'u': 217 217 skip_sanity_check = true; 218 + break; 218 219 case 'l': 219 220 latency = atoi_paranoid(optarg); 220 221 break;
+15
tools/testing/selftests/kvm/x86/cpuid_test.c
··· 155 155 static void set_cpuid_after_run(struct kvm_vcpu *vcpu) 156 156 { 157 157 struct kvm_cpuid_entry2 *ent; 158 + struct kvm_sregs sregs; 158 159 int rc; 159 160 u32 eax, ebx, x; 160 161 161 162 /* Setting unmodified CPUID is allowed */ 163 + rc = __vcpu_set_cpuid(vcpu); 164 + TEST_ASSERT(!rc, "Setting unmodified CPUID after KVM_RUN failed: %d", rc); 165 + 166 + /* 167 + * Toggle CR4 bits that affect dynamic CPUID feature flags to verify 168 + * setting unmodified CPUID succeeds with runtime CPUID updates. 169 + */ 170 + vcpu_sregs_get(vcpu, &sregs); 171 + if (kvm_cpu_has(X86_FEATURE_XSAVE)) 172 + sregs.cr4 ^= X86_CR4_OSXSAVE; 173 + if (kvm_cpu_has(X86_FEATURE_PKU)) 174 + sregs.cr4 ^= X86_CR4_PKE; 175 + vcpu_sregs_set(vcpu, &sregs); 176 + 162 177 rc = __vcpu_set_cpuid(vcpu); 163 178 TEST_ASSERT(!rc, "Setting unmodified CPUID after KVM_RUN failed: %d", rc); 164 179
+2
tools/testing/selftests/lkdtm/tests.txt
··· 1 1 #PANIC 2 2 #PANIC_STOP_IRQOFF Crashes entire system 3 + #PANIC_IN_HARDIRQ Crashes entire system 3 4 BUG kernel BUG at 5 + #BUG_IN_HARDIRQ Crashes entire system 4 6 WARNING WARNING: 5 7 WARNING_MESSAGE message trigger 6 8 EXCEPTION
+6 -1
tools/testing/selftests/net/af_unix/Makefile
··· 1 - CFLAGS += $(KHDR_INCLUDES) -Wall -Wflex-array-member-not-at-end 1 + top_srcdir := ../../../../.. 2 + include $(top_srcdir)/scripts/Makefile.compiler 3 + 4 + cc-option = $(call __cc-option, $(CC),,$(1),$(2)) 5 + 6 + CFLAGS += $(KHDR_INCLUDES) -Wall $(call cc-option,-Wflex-array-member-not-at-end) 2 7 3 8 TEST_GEN_PROGS := \ 4 9 diag_uid \
+1
tools/testing/selftests/net/forwarding/config
··· 29 29 CONFIG_NET_CLS_BASIC=m 30 30 CONFIG_NET_CLS_FLOWER=m 31 31 CONFIG_NET_CLS_MATCHALL=m 32 + CONFIG_NET_CLS_U32=m 32 33 CONFIG_NET_EMATCH=y 33 34 CONFIG_NET_EMATCH_META=m 34 35 CONFIG_NETFILTER=y
+31 -45
tools/testing/selftests/net/forwarding/vxlan_bridge_1q_mc_ul.sh
··· 138 138 defer tc qdisc del dev "$dev" clsact 139 139 140 140 tc filter add dev "$dev" ingress proto ip pref 104 \ 141 - flower skip_hw ip_proto udp dst_port "$VXPORT" \ 142 - action pass 141 + u32 match ip protocol 0x11 0xff \ 142 + match u16 "$VXPORT" 0xffff at 0x16 \ 143 + match u16 0x0800 0xffff at 0x30 \ 144 + action pass 143 145 defer tc filter del dev "$dev" ingress proto ip pref 104 144 146 145 147 tc filter add dev "$dev" ingress proto ipv6 pref 106 \ 146 - flower skip_hw ip_proto udp dst_port "$VXPORT" \ 147 - action pass 148 + u32 match ip6 protocol 0x11 0xff \ 149 + match u16 "$VXPORT" 0xffff at 0x2a \ 150 + match u16 0x86dd 0xffff at 0x44 \ 151 + match u8 0x11 0xff at 0x4c \ 152 + action pass 148 153 defer tc filter del dev "$dev" ingress proto ipv6 pref 106 149 154 } 150 155 ··· 253 248 } 254 249 export -f vx_create 255 250 256 - vx_wait() 257 - { 258 - # Wait for all the ARP, IGMP etc. noise to settle down so that the 259 - # tunnel is clear for measurements. 260 - sleep 10 261 - } 262 - 263 251 vx10_create() 264 252 { 265 253 vx_create vx10 10 id 1000 "$@" ··· 264 266 vx_create vx20 20 id 2000 "$@" 265 267 } 266 268 export -f vx20_create 267 - 268 - vx10_create_wait() 269 - { 270 - vx10_create "$@" 271 - vx_wait 272 - } 273 - 274 - vx20_create_wait() 275 - { 276 - vx20_create "$@" 277 - vx_wait 278 - } 279 269 280 270 ns_init_common() 281 271 { ··· 540 554 # Install a misleading (S,G) rule to attempt to trick the system into 541 555 # pushing the packets elsewhere. 542 556 adf_install_broken_sg 543 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$swp2" 557 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$swp2" 544 558 do_test 4 10 0 "IPv4 nomcroute" 545 559 } 546 560 ··· 548 562 { 549 563 # Like for IPv4, install a misleading (S,G). 550 564 adf_install_broken_sg 551 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$swp2" 565 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$swp2" 552 566 do_test 6 10 0 "IPv6 nomcroute" 553 567 } 554 568 ··· 567 581 ipv4_mcroute() 568 582 { 569 583 adf_install_sg 570 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 584 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 571 585 do_test 4 10 10 "IPv4 mcroute" 572 586 } 573 587 574 588 ipv6_mcroute() 575 589 { 576 590 adf_install_sg 577 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 591 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 578 592 do_test 6 10 10 "IPv6 mcroute" 579 593 } 580 594 581 595 ipv4_mcroute_rx() 582 596 { 583 597 adf_install_sg 584 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 598 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 585 599 ipv4_do_test_rx 0 "IPv4 mcroute ping" 586 600 } 587 601 588 602 ipv6_mcroute_rx() 589 603 { 590 604 adf_install_sg 591 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 605 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 592 606 ipv6_do_test_rx 0 "IPv6 mcroute ping" 593 607 } 594 608 595 609 ipv4_mcroute_changelink() 596 610 { 597 611 adf_install_sg 598 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" 612 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" 599 613 ip link set dev vx10 type vxlan mcroute 600 614 sleep 1 601 615 do_test 4 10 10 "IPv4 mcroute changelink" ··· 604 618 ipv6_mcroute_changelink() 605 619 { 606 620 adf_install_sg 607 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 621 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 608 622 ip link set dev vx20 type vxlan mcroute 609 623 sleep 1 610 624 do_test 6 10 10 "IPv6 mcroute changelink" ··· 613 627 ipv4_mcroute_starg() 614 628 { 615 629 adf_install_starg 616 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 630 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 617 631 do_test 4 10 10 "IPv4 mcroute (*,G)" 618 632 } 619 633 620 634 ipv6_mcroute_starg() 621 635 { 622 636 adf_install_starg 623 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 637 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 624 638 do_test 6 10 10 "IPv6 mcroute (*,G)" 625 639 } 626 640 627 641 ipv4_mcroute_starg_rx() 628 642 { 629 643 adf_install_starg 630 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 644 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 631 645 ipv4_do_test_rx 0 "IPv4 mcroute (*,G) ping" 632 646 } 633 647 634 648 ipv6_mcroute_starg_rx() 635 649 { 636 650 adf_install_starg 637 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 651 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 638 652 ipv6_do_test_rx 0 "IPv6 mcroute (*,G) ping" 639 653 } 640 654 641 655 ipv4_mcroute_noroute() 642 656 { 643 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 657 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 644 658 do_test 4 0 0 "IPv4 mcroute, no route" 645 659 } 646 660 647 661 ipv6_mcroute_noroute() 648 662 { 649 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 663 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 650 664 do_test 6 0 0 "IPv6 mcroute, no route" 651 665 } 652 666 653 667 ipv4_mcroute_fdb() 654 668 { 655 669 adf_install_sg 656 - vx10_create_wait local 192.0.2.100 dev "$IPMR" mcroute 670 + vx10_create local 192.0.2.100 dev "$IPMR" mcroute 657 671 bridge fdb add dev vx10 \ 658 672 00:00:00:00:00:00 self static dst "$GROUP4" via "$IPMR" 659 673 do_test 4 10 10 "IPv4 mcroute FDB" ··· 662 676 ipv6_mcroute_fdb() 663 677 { 664 678 adf_install_sg 665 - vx20_create_wait local 2001:db8:4::1 dev "$IPMR" mcroute 679 + vx20_create local 2001:db8:4::1 dev "$IPMR" mcroute 666 680 bridge -6 fdb add dev vx20 \ 667 681 00:00:00:00:00:00 self static dst "$GROUP6" via "$IPMR" 668 682 do_test 6 10 10 "IPv6 mcroute FDB" ··· 672 686 ipv4_mcroute_fdb_oif0() 673 687 { 674 688 adf_install_sg 675 - vx10_create_wait local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 689 + vx10_create local 192.0.2.100 group "$GROUP4" dev "$IPMR" mcroute 676 690 bridge fdb del dev vx10 00:00:00:00:00:00 677 691 bridge fdb add dev vx10 00:00:00:00:00:00 self static dst "$GROUP4" 678 692 do_test 4 10 10 "IPv4 mcroute oif=0" ··· 689 703 defer ip -6 route del table local multicast "$GROUP6/128" dev "$IPMR" 690 704 691 705 adf_install_sg 692 - vx20_create_wait local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 706 + vx20_create local 2001:db8:4::1 group "$GROUP6" dev "$IPMR" mcroute 693 707 bridge -6 fdb del dev vx20 00:00:00:00:00:00 694 708 bridge -6 fdb add dev vx20 00:00:00:00:00:00 self static dst "$GROUP6" 695 709 do_test 6 10 10 "IPv6 mcroute oif=0" ··· 702 716 adf_install_sg_sep 703 717 704 718 adf_ip_addr_add lo 192.0.2.120/28 705 - vx10_create_wait local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 719 + vx10_create local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 706 720 bridge fdb del dev vx10 00:00:00:00:00:00 707 721 bridge fdb add dev vx10 00:00:00:00:00:00 self static dst "$GROUP4" 708 722 do_test 4 10 10 "IPv4 mcroute TX!=RX oif=0" ··· 713 727 adf_install_sg_sep_rx lo 714 728 715 729 adf_ip_addr_add lo 192.0.2.120/28 716 - vx10_create_wait local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 730 + vx10_create local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 717 731 bridge fdb del dev vx10 00:00:00:00:00:00 718 732 bridge fdb add dev vx10 00:00:00:00:00:00 self static dst "$GROUP4" 719 733 ipv4_do_test_rx 0 "IPv4 mcroute TX!=RX oif=0 ping" ··· 724 738 adf_install_sg_sep_rx lo 725 739 726 740 adf_ip_addr_add lo 192.0.2.120/28 727 - vx10_create_wait local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 741 + vx10_create local 192.0.2.120 group "$GROUP4" dev "$IPMR" mcroute 728 742 bridge fdb del dev vx10 00:00:00:00:00:00 729 743 bridge fdb add \ 730 744 dev vx10 00:00:00:00:00:00 self static dst "$GROUP4" via lo ··· 736 750 adf_install_sg_sep_rx "X$IPMR" 737 751 738 752 adf_ip_addr_add "X$IPMR" 2001:db8:5::1/64 739 - vx20_create_wait local 2001:db8:5::1 group "$GROUP6" dev "$IPMR" mcroute 753 + vx20_create local 2001:db8:5::1 group "$GROUP6" dev "$IPMR" mcroute 740 754 bridge -6 fdb del dev vx20 00:00:00:00:00:00 741 755 bridge -6 fdb add dev vx20 00:00:00:00:00:00 \ 742 756 self static dst "$GROUP6" via "X$IPMR"
+2 -1
tools/testing/selftests/net/lib.sh
··· 280 280 local selector=${1:-.packets}; shift 281 281 282 282 tc -j -s filter show dev $dev $dir pref $pref \ 283 - | jq ".[1].options.actions[].stats$selector" 283 + | jq ".[] | select(.options.actions) | 284 + .options.actions[].stats$selector" 284 285 } 285 286 286 287 tc_rule_handle_stats_get()
+4 -2
tools/testing/selftests/net/lib/ksft.h
··· 24 24 fd = STDOUT_FILENO; 25 25 } 26 26 27 - write(fd, msg, sizeof(msg)); 27 + if (write(fd, msg, sizeof(msg)) < 0) 28 + perror("write()"); 28 29 if (fd != STDOUT_FILENO) 29 30 close(fd); 30 31 } ··· 49 48 fd = STDIN_FILENO; 50 49 } 51 50 52 - read(fd, &byte, sizeof(byte)); 51 + if (read(fd, &byte, sizeof(byte)) < 0) 52 + perror("read()"); 53 53 if (fd != STDIN_FILENO) 54 54 close(fd); 55 55 }
+4
tools/testing/selftests/net/mptcp/pm_netlink.sh
··· 192 192 flush_endpoint 193 193 check "show_endpoints" "" "flush addrs" 194 194 195 + add_endpoint 10.0.1.1 flags unknown 196 + check "show_endpoints" "$(format_endpoints "1,10.0.1.1")" "ignore unknown flags" 197 + flush_endpoint 198 + 195 199 set_limits 9 1 2>/dev/null 196 200 check "get_limits" "${default_limits}" "rcv addrs above hard limit" 197 201
+11
tools/testing/selftests/net/mptcp/pm_nl_ctl.c
··· 24 24 #define IPPROTO_MPTCP 262 25 25 #endif 26 26 27 + #define MPTCP_PM_ADDR_FLAG_UNKNOWN _BITUL(7) 28 + 27 29 static void syntax(char *argv[]) 28 30 { 29 31 fprintf(stderr, "%s add|ann|rem|csf|dsf|get|set|del|flush|dump|events|listen|accept [<args>]\n", argv[0]); ··· 838 836 flags |= MPTCP_PM_ADDR_FLAG_BACKUP; 839 837 else if (!strcmp(tok, "fullmesh")) 840 838 flags |= MPTCP_PM_ADDR_FLAG_FULLMESH; 839 + else if (!strcmp(tok, "unknown")) 840 + flags |= MPTCP_PM_ADDR_FLAG_UNKNOWN; 841 841 else 842 842 error(1, errno, 843 843 "unknown flag %s", argv[arg]); ··· 1048 1044 if (flags & MPTCP_PM_ADDR_FLAG_IMPLICIT) { 1049 1045 printf("implicit"); 1050 1046 flags &= ~MPTCP_PM_ADDR_FLAG_IMPLICIT; 1047 + if (flags) 1048 + printf(","); 1049 + } 1050 + 1051 + if (flags & MPTCP_PM_ADDR_FLAG_UNKNOWN) { 1052 + printf("unknown"); 1053 + flags &= ~MPTCP_PM_ADDR_FLAG_UNKNOWN; 1051 1054 if (flags) 1052 1055 printf(","); 1053 1056 }
+4 -5
tools/testing/selftests/net/netfilter/conntrack_clash.sh
··· 116 116 # not a failure: clash resolution logic did not trigger. 117 117 # With right timing, xmit completed sequentially and 118 118 # no parallel insertion occurs. 119 - return $ksft_skip 119 + return $ksft_xfail 120 120 } 121 121 122 122 run_clash_test() ··· 133 133 if [ $rv -eq 0 ];then 134 134 echo "PASS: clash resolution test for $daddr:$dport on attempt $i" 135 135 return 0 136 - elif [ $rv -eq $ksft_skip ]; then 136 + elif [ $rv -eq $ksft_xfail ]; then 137 137 softerr=1 138 138 fi 139 139 done 140 140 141 - [ $softerr -eq 1 ] && echo "SKIP: clash resolution for $daddr:$dport did not trigger" 141 + [ $softerr -eq 1 ] && echo "XFAIL: clash resolution for $daddr:$dport did not trigger" 142 142 } 143 143 144 144 ip link add veth0 netns "$nsclient1" type veth peer name veth0 netns "$nsrouter" ··· 167 167 run_clash_test "$nsclient2" "$nsclient2" 127.0.0.1 9001 168 168 169 169 if [ $clash_resolution_active -eq 0 ];then 170 - [ "$ret" -eq 0 ] && ret=$ksft_skip 171 - echo "SKIP: Clash resolution did not trigger" 170 + [ "$ret" -eq 0 ] && ret=$ksft_xfail 172 171 fi 173 172 174 173 exit $ret
+9 -4
tools/testing/selftests/net/netfilter/conntrack_reverse_clash.c
··· 33 33 exit(111); 34 34 } 35 35 36 - static void die_port(uint16_t got, uint16_t want) 36 + static void die_port(const struct sockaddr_in *sin, uint16_t want) 37 37 { 38 - fprintf(stderr, "Port number changed, wanted %d got %d\n", want, ntohs(got)); 38 + uint16_t got = ntohs(sin->sin_port); 39 + char str[INET_ADDRSTRLEN]; 40 + 41 + inet_ntop(AF_INET, &sin->sin_addr, str, sizeof(str)); 42 + 43 + fprintf(stderr, "Port number changed, wanted %d got %d from %s\n", want, got, str); 39 44 exit(1); 40 45 } 41 46 ··· 105 100 die("child recvfrom"); 106 101 107 102 if (peer.sin_port != htons(PORT)) 108 - die_port(peer.sin_port, PORT); 103 + die_port(&peer, PORT); 109 104 } else { 110 105 if (sendto(s2, buf, LEN, 0, (struct sockaddr *)&sa1, sizeof(sa1)) != LEN) 111 106 continue; ··· 114 109 die("parent recvfrom"); 115 110 116 111 if (peer.sin_port != htons((PORT + 1))) 117 - die_port(peer.sin_port, PORT + 1); 112 + die_port(&peer, PORT + 1); 118 113 } 119 114 } 120 115
+2
tools/testing/selftests/net/netfilter/conntrack_reverse_clash.sh
··· 45 45 echo "PASS: No SNAT performed for null bindings" 46 46 else 47 47 echo "ERROR: SNAT performed without any matching snat rule" 48 + ip netns exec "$ns0" conntrack -L 49 + ip netns exec "$ns0" conntrack -S 48 50 exit 1 49 51 fi 50 52
+1 -1
tools/testing/selftests/net/netfilter/packetdrill/conntrack_syn_challenge_ack.pkt
··· 26 26 27 27 +0.01 > R 643160523:643160523(0) win 0 28 28 29 - +0.01 `conntrack -f $NFCT_IP_VERSION -L -p tcp --dport 8080 2>/dev/null | grep UNREPLIED | grep -q SYN_SENT` 29 + +0.1 `conntrack -f $NFCT_IP_VERSION -L -p tcp --dport 8080 2>/dev/null | grep UNREPLIED | grep -q SYN_SENT` 30 30 31 31 // Must go through. 32 32 +0.01 > S 0:0(0) win 65535 <mss 1460,sackOK,TS val 1 ecr 0,nop,wscale 8>
+2 -1
tools/testing/selftests/net/tfo.c
··· 81 81 if (getsockopt(connfd, SOL_SOCKET, SO_INCOMING_NAPI_ID, &opt, &len) < 0) 82 82 error(1, errno, "getsockopt(SO_INCOMING_NAPI_ID)"); 83 83 84 - read(connfd, buf, 64); 84 + if (read(connfd, buf, 64) < 0) 85 + perror("read()"); 85 86 fprintf(outfile, "%d\n", opt); 86 87 87 88 fclose(outfile);
+1 -1
tools/testing/selftests/net/tls.c
··· 2786 2786 TEST_F(tls_err, poll_partial_rec_async) 2787 2787 { 2788 2788 struct pollfd pfd = { }; 2789 + char token = '\0'; 2789 2790 ssize_t rec_len; 2790 2791 char rec[256]; 2791 2792 char buf[128]; 2792 - char token; 2793 2793 int p[2]; 2794 2794 int ret; 2795 2795
+8
tools/testing/selftests/sched_ext/runner.c
··· 46 46 if (!quiet) 47 47 printf("DESCRIPTION: %s\n", test->description); 48 48 printf("OUTPUT:\n"); 49 + 50 + /* 51 + * The tests may fork with the preamble buffered 52 + * in the children's stdout. Flush before the test 53 + * to avoid printing the message multiple times. 54 + */ 55 + fflush(stdout); 56 + fflush(stderr); 49 57 } 50 58 51 59 static const char *status_to_result(enum scx_test_status status)
+46
tools/testing/selftests/tc-testing/tc-tests/actions/mirred.json
··· 1052 1052 "$TC qdisc del dev $DEV1 ingress_block 21 clsact", 1053 1053 "$TC actions flush action mirred" 1054 1054 ] 1055 + }, 1056 + { 1057 + "id": "7eba", 1058 + "name": "Redirect multiport: dummy egress -> dummy egress (Loop)", 1059 + "category": [ 1060 + "filter", 1061 + "mirred" 1062 + ], 1063 + "plugins": { 1064 + "requires": [ 1065 + "nsPlugin" 1066 + ] 1067 + }, 1068 + "setup": [ 1069 + "$IP link set dev $DUMMY up || true", 1070 + "$IP addr add 10.10.10.10/24 dev $DUMMY || true", 1071 + "$TC qdisc add dev $DUMMY handle 1: root drr", 1072 + "$TC filter add dev $DUMMY parent 1: protocol ip prio 10 matchall action mirred egress redirect dev $DUMMY index 1" 1073 + ], 1074 + "cmdUnderTest": "ping -c1 -W0.01 -I $DUMMY 10.10.10.1", 1075 + "expExitCode": "1", 1076 + "verifyCmd": "$TC -j -s actions get action mirred index 1", 1077 + "matchJSON": [ 1078 + { 1079 + "total acts": 0 1080 + }, 1081 + { 1082 + "actions": [ 1083 + { 1084 + "order": 1, 1085 + "kind": "mirred", 1086 + "mirred_action": "redirect", 1087 + "direction": "egress", 1088 + "index": 1, 1089 + "stats": { 1090 + "packets": 1, 1091 + "overlimits": 1 1092 + }, 1093 + "not_in_hw": true 1094 + } 1095 + ] 1096 + } 1097 + ], 1098 + "teardown": [ 1099 + "$TC qdisc del dev $DUMMY root" 1100 + ] 1055 1101 } 1056 1102 ]
+78
tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
··· 1033 1033 "teardown": [ 1034 1034 "$TC qdisc del dev $DUMMY handle 1: root" 1035 1035 ] 1036 + }, 1037 + { 1038 + "id": "6e4f", 1039 + "name": "Try to delete ets drr class' qdisc while still keeping it in the active list", 1040 + "category": [ 1041 + "qdisc", 1042 + "ets", 1043 + "tbf" 1044 + ], 1045 + "plugins": { 1046 + "requires": [ 1047 + "nsPlugin", 1048 + "scapyPlugin" 1049 + ] 1050 + }, 1051 + "setup": [ 1052 + "$IP link set dev $DUMMY up || true", 1053 + "$IP addr add 10.10.11.10/24 dev $DUMMY || true", 1054 + "$TC qdisc add dev $DUMMY root handle 1: ets bands 2 strict 1", 1055 + "$TC qdisc add dev $DUMMY parent 1:2 handle 20: tbf rate 8bit burst 100b latency 1s", 1056 + "$TC filter add dev $DUMMY parent 1: basic classid 1:2", 1057 + "ping -c2 -W0.01 -s 56 -I $DUMMY 10.10.11.11 || true", 1058 + "$TC qdisc change dev $DUMMY root handle 1: ets bands 2 strict 2", 1059 + "$TC qdisc change dev $DUMMY root handle 1: ets bands 1 strict 1" 1060 + ], 1061 + "cmdUnderTest": "ping -c1 -W0.01 -s 56 -I $DUMMY 10.10.11.11", 1062 + "expExitCode": "1", 1063 + "verifyCmd": "$TC -s -j qdisc ls dev $DUMMY root", 1064 + "matchJSON": [ 1065 + { 1066 + "kind": "ets", 1067 + "handle": "1:", 1068 + "bytes": 196, 1069 + "packets": 2 1070 + } 1071 + ], 1072 + "teardown": [ 1073 + "$TC qdisc del dev $DUMMY root handle 1:" 1074 + ] 1075 + }, 1076 + { 1077 + "id": "0b8f", 1078 + "name": "Try to add ets class to the active list twice", 1079 + "category": [ 1080 + "qdisc", 1081 + "ets", 1082 + "tbf" 1083 + ], 1084 + "plugins": { 1085 + "requires": [ 1086 + "nsPlugin", 1087 + "scapyPlugin" 1088 + ] 1089 + }, 1090 + "setup": [ 1091 + "$IP link set dev $DUMMY up || true", 1092 + "$IP addr add 10.10.11.10/24 dev $DUMMY || true", 1093 + "$TC qdisc add dev $DUMMY root handle 1: ets bands 2 strict 1", 1094 + "$TC qdisc add dev $DUMMY parent 1:2 handle 20: tbf rate 8bit burst 100b latency 1s", 1095 + "$TC filter add dev $DUMMY parent 1: basic classid 1:2", 1096 + "ping -c2 -W0.01 -s 56 -I $DUMMY 10.10.11.11 || true", 1097 + "$TC qdisc change dev $DUMMY root handle 1: ets bands 2 strict 2", 1098 + "$TC qdisc change dev $DUMMY root handle 1: ets bands 2 strict 1" 1099 + ], 1100 + "cmdUnderTest": "ping -c1 -W0.01 -s 56 -I $DUMMY 10.10.11.11", 1101 + "expExitCode": "1", 1102 + "verifyCmd": "$TC -s -j qdisc ls dev $DUMMY root", 1103 + "matchJSON": [ 1104 + { 1105 + "kind": "ets", 1106 + "handle": "1:", 1107 + "bytes": 98, 1108 + "packets": 1 1109 + } 1110 + ], 1111 + "teardown": [ 1112 + "$TC qdisc del dev $DUMMY root handle 1:" 1113 + ] 1036 1114 } 1037 1115 ]
+8
tools/testing/selftests/ublk/Makefile
··· 21 21 TEST_PROGS += test_generic_11.sh 22 22 TEST_PROGS += test_generic_12.sh 23 23 TEST_PROGS += test_generic_13.sh 24 + TEST_PROGS += test_generic_14.sh 24 25 25 26 TEST_PROGS += test_null_01.sh 26 27 TEST_PROGS += test_null_02.sh 28 + TEST_PROGS += test_null_03.sh 27 29 TEST_PROGS += test_loop_01.sh 28 30 TEST_PROGS += test_loop_02.sh 29 31 TEST_PROGS += test_loop_03.sh 30 32 TEST_PROGS += test_loop_04.sh 31 33 TEST_PROGS += test_loop_05.sh 34 + TEST_PROGS += test_loop_06.sh 35 + TEST_PROGS += test_loop_07.sh 32 36 TEST_PROGS += test_stripe_01.sh 33 37 TEST_PROGS += test_stripe_02.sh 34 38 TEST_PROGS += test_stripe_03.sh 35 39 TEST_PROGS += test_stripe_04.sh 40 + TEST_PROGS += test_stripe_05.sh 41 + TEST_PROGS += test_stripe_06.sh 36 42 37 43 TEST_PROGS += test_stress_01.sh 38 44 TEST_PROGS += test_stress_02.sh 39 45 TEST_PROGS += test_stress_03.sh 40 46 TEST_PROGS += test_stress_04.sh 41 47 TEST_PROGS += test_stress_05.sh 48 + TEST_PROGS += test_stress_06.sh 49 + TEST_PROGS += test_stress_07.sh 42 50 43 51 TEST_GEN_PROGS_EXTENDED = kublk 44 52
+4 -3
tools/testing/selftests/ublk/file_backed.c
··· 34 34 unsigned zc = ublk_queue_use_zc(q); 35 35 unsigned auto_zc = ublk_queue_use_auto_zc(q); 36 36 enum io_uring_op op = ublk_to_uring_op(iod, zc | auto_zc); 37 + struct ublk_io *io = ublk_get_io(q, tag); 37 38 struct io_uring_sqe *sqe[3]; 38 - void *addr = (zc | auto_zc) ? NULL : (void *)iod->addr; 39 + void *addr = io->buf_addr; 39 40 40 41 if (!zc || auto_zc) { 41 42 ublk_io_alloc_sqes(t, sqe, 1); ··· 57 56 58 57 ublk_io_alloc_sqes(t, sqe, 3); 59 58 60 - io_uring_prep_buf_register(sqe[0], q, tag, q->q_id, ublk_get_io(q, tag)->buf_index); 59 + io_uring_prep_buf_register(sqe[0], q, tag, q->q_id, io->buf_index); 61 60 sqe[0]->flags |= IOSQE_CQE_SKIP_SUCCESS | IOSQE_IO_HARDLINK; 62 61 sqe[0]->user_data = build_user_data(tag, 63 62 ublk_cmd_op_nr(sqe[0]->cmd_op), 0, q->q_id, 1); ··· 69 68 sqe[1]->flags |= IOSQE_FIXED_FILE | IOSQE_IO_HARDLINK; 70 69 sqe[1]->user_data = build_user_data(tag, ublk_op, 0, q->q_id, 1); 71 70 72 - io_uring_prep_buf_unregister(sqe[2], q, tag, q->q_id, ublk_get_io(q, tag)->buf_index); 71 + io_uring_prep_buf_unregister(sqe[2], q, tag, q->q_id, io->buf_index); 73 72 sqe[2]->user_data = build_user_data(tag, ublk_cmd_op_nr(sqe[2]->cmd_op), 0, q->q_id, 1); 74 73 75 74 return 2;
+58 -6
tools/testing/selftests/ublk/kublk.c
··· 596 596 sqe->addr = ublk_auto_buf_reg_to_sqe_addr(&buf); 597 597 } 598 598 599 + /* Copy in pieces to test the buffer offset logic */ 600 + #define UBLK_USER_COPY_LEN 2048 601 + 602 + static void ublk_user_copy(const struct ublk_io *io, __u8 match_ublk_op) 603 + { 604 + const struct ublk_queue *q = ublk_io_to_queue(io); 605 + const struct ublksrv_io_desc *iod = ublk_get_iod(q, io->tag); 606 + __u64 off = ublk_user_copy_offset(q->q_id, io->tag); 607 + __u8 ublk_op = ublksrv_get_op(iod); 608 + __u32 len = iod->nr_sectors << 9; 609 + void *addr = io->buf_addr; 610 + 611 + if (ublk_op != match_ublk_op) 612 + return; 613 + 614 + while (len) { 615 + __u32 copy_len = min(len, UBLK_USER_COPY_LEN); 616 + ssize_t copied; 617 + 618 + if (ublk_op == UBLK_IO_OP_WRITE) 619 + copied = pread(q->ublk_fd, addr, copy_len, off); 620 + else if (ublk_op == UBLK_IO_OP_READ) 621 + copied = pwrite(q->ublk_fd, addr, copy_len, off); 622 + else 623 + assert(0); 624 + assert(copied == (ssize_t)copy_len); 625 + addr += copy_len; 626 + off += copy_len; 627 + len -= copy_len; 628 + } 629 + } 630 + 599 631 int ublk_queue_io_cmd(struct ublk_thread *t, struct ublk_io *io) 600 632 { 601 633 struct ublk_queue *q = ublk_io_to_queue(io); ··· 650 618 651 619 if (io->flags & UBLKS_IO_NEED_GET_DATA) 652 620 cmd_op = UBLK_U_IO_NEED_GET_DATA; 653 - else if (io->flags & UBLKS_IO_NEED_COMMIT_RQ_COMP) 621 + else if (io->flags & UBLKS_IO_NEED_COMMIT_RQ_COMP) { 622 + if (ublk_queue_use_user_copy(q)) 623 + ublk_user_copy(io, UBLK_IO_OP_READ); 624 + 654 625 cmd_op = UBLK_U_IO_COMMIT_AND_FETCH_REQ; 655 - else if (io->flags & UBLKS_IO_NEED_FETCH_RQ) 626 + } else if (io->flags & UBLKS_IO_NEED_FETCH_RQ) 656 627 cmd_op = UBLK_U_IO_FETCH_REQ; 657 628 658 629 if (io_uring_sq_space_left(&t->ring) < 1) ··· 684 649 sqe[0]->rw_flags = 0; 685 650 cmd->tag = io->tag; 686 651 cmd->q_id = q->q_id; 687 - if (!ublk_queue_no_buf(q)) 652 + if (!ublk_queue_no_buf(q) && !ublk_queue_use_user_copy(q)) 688 653 cmd->addr = (__u64) (uintptr_t) io->buf_addr; 689 654 else 690 655 cmd->addr = 0; ··· 786 751 787 752 if (cqe->res == UBLK_IO_RES_OK) { 788 753 assert(tag < q->q_depth); 754 + 755 + if (ublk_queue_use_user_copy(q)) 756 + ublk_user_copy(io, UBLK_IO_OP_WRITE); 757 + 789 758 if (q->tgt_ops->queue_io) 790 759 q->tgt_ops->queue_io(t, q, tag); 791 760 } else if (cqe->res == UBLK_IO_RES_NEED_GET_DATA) { ··· 1546 1507 1547 1508 printf("%s %s -t [null|loop|stripe|fault_inject] [-q nr_queues] [-d depth] [-n dev_id]\n", 1548 1509 exe, recovery ? "recover" : "add"); 1549 - printf("\t[--foreground] [--quiet] [-z] [--auto_zc] [--auto_zc_fallback] [--debug_mask mask] [-r 0|1 ] [-g]\n"); 1510 + printf("\t[--foreground] [--quiet] [-z] [--auto_zc] [--auto_zc_fallback] [--debug_mask mask] [-r 0|1] [-g] [-u]\n"); 1550 1511 printf("\t[-e 0|1 ] [-i 0|1] [--no_ublk_fixed_fd]\n"); 1551 1512 printf("\t[--nthreads threads] [--per_io_tasks]\n"); 1552 1513 printf("\t[target options] [backfile1] [backfile2] ...\n"); ··· 1607 1568 { "get_data", 1, NULL, 'g'}, 1608 1569 { "auto_zc", 0, NULL, 0 }, 1609 1570 { "auto_zc_fallback", 0, NULL, 0 }, 1571 + { "user_copy", 0, NULL, 'u'}, 1610 1572 { "size", 1, NULL, 's'}, 1611 1573 { "nthreads", 1, NULL, 0 }, 1612 1574 { "per_io_tasks", 0, NULL, 0 }, ··· 1633 1593 1634 1594 opterr = 0; 1635 1595 optind = 2; 1636 - while ((opt = getopt_long(argc, argv, "t:n:d:q:r:e:i:s:gaz", 1596 + while ((opt = getopt_long(argc, argv, "t:n:d:q:r:e:i:s:gazu", 1637 1597 longopts, &option_idx)) != -1) { 1638 1598 switch (opt) { 1639 1599 case 'a': ··· 1653 1613 ctx.queue_depth = strtol(optarg, NULL, 10); 1654 1614 break; 1655 1615 case 'z': 1656 - ctx.flags |= UBLK_F_SUPPORT_ZERO_COPY | UBLK_F_USER_COPY; 1616 + ctx.flags |= UBLK_F_SUPPORT_ZERO_COPY; 1657 1617 break; 1658 1618 case 'r': 1659 1619 value = strtol(optarg, NULL, 10); ··· 1672 1632 break; 1673 1633 case 'g': 1674 1634 ctx.flags |= UBLK_F_NEED_GET_DATA; 1635 + break; 1636 + case 'u': 1637 + ctx.flags |= UBLK_F_USER_COPY; 1675 1638 break; 1676 1639 case 's': 1677 1640 ctx.size = strtoull(optarg, NULL, 10); ··· 1726 1683 ublk_err("%s: auto_zc_fallback is set but neither " 1727 1684 "F_AUTO_BUF_REG nor F_SUPPORT_ZERO_COPY is enabled\n", 1728 1685 __func__); 1686 + return -EINVAL; 1687 + } 1688 + 1689 + if (!!(ctx.flags & UBLK_F_NEED_GET_DATA) + 1690 + !!(ctx.flags & UBLK_F_USER_COPY) + 1691 + (ctx.flags & UBLK_F_SUPPORT_ZERO_COPY && !ctx.auto_zc_fallback) + 1692 + (ctx.flags & UBLK_F_AUTO_BUF_REG && !ctx.auto_zc_fallback) + 1693 + ctx.auto_zc_fallback > 1) { 1694 + fprintf(stderr, "too many data copy modes specified\n"); 1729 1695 return -EINVAL; 1730 1696 } 1731 1697
+17 -6
tools/testing/selftests/ublk/kublk.h
··· 208 208 return !!(iod->op_flags & UBLK_IO_F_NEED_REG_BUF); 209 209 } 210 210 211 + static inline __u64 ublk_user_copy_offset(unsigned q_id, unsigned tag) 212 + { 213 + return UBLKSRV_IO_BUF_OFFSET + 214 + ((__u64)q_id << UBLK_QID_OFF | (__u64)tag << UBLK_TAG_OFF); 215 + } 216 + 211 217 static inline int is_target_io(__u64 user_data) 212 218 { 213 219 return (user_data & (1ULL << 63)) != 0; ··· 396 390 return --io->tgt_ios == 0; 397 391 } 398 392 399 - static inline int ublk_queue_use_zc(const struct ublk_queue *q) 393 + static inline bool ublk_queue_use_zc(const struct ublk_queue *q) 400 394 { 401 - return q->flags & UBLK_F_SUPPORT_ZERO_COPY; 395 + return !!(q->flags & UBLK_F_SUPPORT_ZERO_COPY); 402 396 } 403 397 404 - static inline int ublk_queue_use_auto_zc(const struct ublk_queue *q) 398 + static inline bool ublk_queue_use_auto_zc(const struct ublk_queue *q) 405 399 { 406 - return q->flags & UBLK_F_AUTO_BUF_REG; 400 + return !!(q->flags & UBLK_F_AUTO_BUF_REG); 407 401 } 408 402 409 - static inline int ublk_queue_auto_zc_fallback(const struct ublk_queue *q) 403 + static inline bool ublk_queue_auto_zc_fallback(const struct ublk_queue *q) 410 404 { 411 - return q->flags & UBLKS_Q_AUTO_BUF_REG_FALLBACK; 405 + return !!(q->flags & UBLKS_Q_AUTO_BUF_REG_FALLBACK); 406 + } 407 + 408 + static inline bool ublk_queue_use_user_copy(const struct ublk_queue *q) 409 + { 410 + return !!(q->flags & UBLK_F_USER_COPY); 412 411 } 413 412 414 413 static inline int ublk_queue_no_buf(const struct ublk_queue *q)
+1 -1
tools/testing/selftests/ublk/stripe.c
··· 134 134 struct stripe_array *s = alloc_stripe_array(conf, iod); 135 135 struct ublk_io *io = ublk_get_io(q, tag); 136 136 int i, extra = zc ? 2 : 0; 137 - void *base = (zc | auto_zc) ? NULL : (void *)iod->addr; 137 + void *base = io->buf_addr; 138 138 139 139 io->private_data = s; 140 140 calculate_stripe_array(conf, iod, s, base);
+3 -2
tools/testing/selftests/ublk/test_common.sh
··· 333 333 334 334 run_io_and_recover() 335 335 { 336 - local action=$1 336 + local size=$1 337 + local action=$2 337 338 local state 338 339 local dev_id 339 340 340 - shift 1 341 + shift 2 341 342 dev_id=$(_add_ublk_dev "$@") 342 343 _check_add_dev "$TID" $? 343 344
+1 -1
tools/testing/selftests/ublk/test_generic_04.sh
··· 8 8 9 9 ublk_run_recover_test() 10 10 { 11 - run_io_and_recover "kill_daemon" "$@" 11 + run_io_and_recover 256M "kill_daemon" "$@" 12 12 ERR_CODE=$? 13 13 if [ ${ERR_CODE} -ne 0 ]; then 14 14 echo "$TID failure: $*"
+1 -1
tools/testing/selftests/ublk/test_generic_05.sh
··· 8 8 9 9 ublk_run_recover_test() 10 10 { 11 - run_io_and_recover "kill_daemon" "$@" 11 + run_io_and_recover 256M "kill_daemon" "$@" 12 12 ERR_CODE=$? 13 13 if [ ${ERR_CODE} -ne 0 ]; then 14 14 echo "$TID failure: $*"
+1 -1
tools/testing/selftests/ublk/test_generic_11.sh
··· 8 8 9 9 ublk_run_quiesce_recover() 10 10 { 11 - run_io_and_recover "quiesce_dev" "$@" 11 + run_io_and_recover 256M "quiesce_dev" "$@" 12 12 ERR_CODE=$? 13 13 if [ ${ERR_CODE} -ne 0 ]; then 14 14 echo "$TID failure: $*"
+40
tools/testing/selftests/ublk/test_generic_14.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + 4 + . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh 5 + 6 + TID="generic_14" 7 + ERR_CODE=0 8 + 9 + ublk_run_recover_test() 10 + { 11 + run_io_and_recover 256M "kill_daemon" "$@" 12 + ERR_CODE=$? 13 + if [ ${ERR_CODE} -ne 0 ]; then 14 + echo "$TID failure: $*" 15 + _show_result $TID $ERR_CODE 16 + fi 17 + } 18 + 19 + if ! _have_program fio; then 20 + exit "$UBLK_SKIP_CODE" 21 + fi 22 + 23 + _prep_test "recover" "basic recover function verification (user copy)" 24 + 25 + _create_backfile 0 256M 26 + _create_backfile 1 128M 27 + _create_backfile 2 128M 28 + 29 + ublk_run_recover_test -t null -q 2 -r 1 -u & 30 + ublk_run_recover_test -t loop -q 2 -r 1 -u "${UBLK_BACKFILES[0]}" & 31 + ublk_run_recover_test -t stripe -q 2 -r 1 -u "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" & 32 + wait 33 + 34 + ublk_run_recover_test -t null -q 2 -r 1 -u -i 1 & 35 + ublk_run_recover_test -t loop -q 2 -r 1 -u -i 1 "${UBLK_BACKFILES[0]}" & 36 + ublk_run_recover_test -t stripe -q 2 -r 1 -u -i 1 "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" & 37 + wait 38 + 39 + _cleanup_test "recover" 40 + _show_result $TID $ERR_CODE
+25
tools/testing/selftests/ublk/test_loop_06.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + 4 + . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh 5 + 6 + TID="loop_06" 7 + ERR_CODE=0 8 + 9 + if ! _have_program fio; then 10 + exit "$UBLK_SKIP_CODE" 11 + fi 12 + 13 + _prep_test "loop" "write and verify over user copy" 14 + 15 + _create_backfile 0 256M 16 + dev_id=$(_add_ublk_dev -t loop -u "${UBLK_BACKFILES[0]}") 17 + _check_add_dev $TID $? 18 + 19 + # run fio over the ublk disk 20 + _run_fio_verify_io --filename=/dev/ublkb"${dev_id}" --size=256M 21 + ERR_CODE=$? 22 + 23 + _cleanup_test "loop" 24 + 25 + _show_result $TID $ERR_CODE
+21
tools/testing/selftests/ublk/test_loop_07.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + 4 + . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh 5 + 6 + TID="loop_07" 7 + ERR_CODE=0 8 + 9 + _prep_test "loop" "mkfs & mount & umount with user copy" 10 + 11 + _create_backfile 0 256M 12 + 13 + dev_id=$(_add_ublk_dev -t loop -u "${UBLK_BACKFILES[0]}") 14 + _check_add_dev $TID $? 15 + 16 + _mkfs_mount_test /dev/ublkb"${dev_id}" 17 + ERR_CODE=$? 18 + 19 + _cleanup_test "loop" 20 + 21 + _show_result $TID $ERR_CODE
+24
tools/testing/selftests/ublk/test_null_03.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + 4 + . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh 5 + 6 + TID="null_03" 7 + ERR_CODE=0 8 + 9 + if ! _have_program fio; then 10 + exit "$UBLK_SKIP_CODE" 11 + fi 12 + 13 + _prep_test "null" "basic IO test with user copy" 14 + 15 + dev_id=$(_add_ublk_dev -t null -u) 16 + _check_add_dev $TID $? 17 + 18 + # run fio over the two disks 19 + fio --name=job1 --filename=/dev/ublkb"${dev_id}" --ioengine=libaio --rw=readwrite --iodepth=32 --size=256M > /dev/null 2>&1 20 + ERR_CODE=$? 21 + 22 + _cleanup_test "null" 23 + 24 + _show_result $TID $ERR_CODE
+7 -5
tools/testing/selftests/ublk/test_stress_04.sh
··· 31 31 ublk_io_and_kill_daemon 8G -t null -q 4 -z --no_ublk_fixed_fd & 32 32 ublk_io_and_kill_daemon 256M -t loop -q 4 -z --no_ublk_fixed_fd "${UBLK_BACKFILES[0]}" & 33 33 ublk_io_and_kill_daemon 256M -t stripe -q 4 -z "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" & 34 + wait 34 35 35 36 if _have_feature "AUTO_BUF_REG"; then 36 37 ublk_io_and_kill_daemon 8G -t null -q 4 --auto_zc & 37 38 ublk_io_and_kill_daemon 256M -t loop -q 4 --auto_zc "${UBLK_BACKFILES[0]}" & 38 39 ublk_io_and_kill_daemon 256M -t stripe -q 4 --auto_zc --no_ublk_fixed_fd "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" & 39 40 ublk_io_and_kill_daemon 8G -t null -q 4 -z --auto_zc --auto_zc_fallback & 41 + wait 40 42 fi 41 43 42 44 if _have_feature "PER_IO_DAEMON"; then 43 - ublk_io_and_kill_daemon 8G -t null -q 4 --nthreads 8 --per_io_tasks & 44 - ublk_io_and_kill_daemon 256M -t loop -q 4 --nthreads 8 --per_io_tasks "${UBLK_BACKFILES[0]}" & 45 - ublk_io_and_kill_daemon 256M -t stripe -q 4 --nthreads 8 --per_io_tasks "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" & 46 - ublk_io_and_kill_daemon 8G -t null -q 4 --nthreads 8 --per_io_tasks & 45 + ublk_io_and_kill_daemon 8G -t null -q 4 --auto_zc --nthreads 8 --per_io_tasks & 46 + ublk_io_and_kill_daemon 256M -t loop -q 4 --auto_zc --nthreads 8 --per_io_tasks "${UBLK_BACKFILES[0]}" & 47 + ublk_io_and_kill_daemon 256M -t stripe -q 4 --auto_zc --nthreads 8 --per_io_tasks "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" & 48 + ublk_io_and_kill_daemon 8G -t null -q 4 -z --auto_zc --auto_zc_fallback --nthreads 8 --per_io_tasks & 49 + wait 47 50 fi 48 - wait 49 51 50 52 _cleanup_test "stress" 51 53 _show_result $TID $ERR_CODE
+5 -5
tools/testing/selftests/ublk/test_stress_05.sh
··· 58 58 59 59 if _have_feature "ZERO_COPY"; then 60 60 for reissue in $(seq 0 1); do 61 - ublk_io_and_remove 8G -t null -q 4 -g -z -r 1 -i "$reissue" & 62 - ublk_io_and_remove 256M -t loop -q 4 -g -z -r 1 -i "$reissue" "${UBLK_BACKFILES[1]}" & 61 + ublk_io_and_remove 8G -t null -q 4 -z -r 1 -i "$reissue" & 62 + ublk_io_and_remove 256M -t loop -q 4 -z -r 1 -i "$reissue" "${UBLK_BACKFILES[1]}" & 63 63 wait 64 64 done 65 65 fi 66 66 67 67 if _have_feature "AUTO_BUF_REG"; then 68 68 for reissue in $(seq 0 1); do 69 - ublk_io_and_remove 8G -t null -q 4 -g --auto_zc -r 1 -i "$reissue" & 70 - ublk_io_and_remove 256M -t loop -q 4 -g --auto_zc -r 1 -i "$reissue" "${UBLK_BACKFILES[1]}" & 71 - ublk_io_and_remove 8G -t null -q 4 -g -z --auto_zc --auto_zc_fallback -r 1 -i "$reissue" & 69 + ublk_io_and_remove 8G -t null -q 4 --auto_zc -r 1 -i "$reissue" & 70 + ublk_io_and_remove 256M -t loop -q 4 --auto_zc -r 1 -i "$reissue" "${UBLK_BACKFILES[1]}" & 71 + ublk_io_and_remove 8G -t null -q 4 -z --auto_zc --auto_zc_fallback -r 1 -i "$reissue" & 72 72 wait 73 73 done 74 74 fi
+39
tools/testing/selftests/ublk/test_stress_06.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + 4 + . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh 5 + TID="stress_06" 6 + ERR_CODE=0 7 + 8 + ublk_io_and_remove() 9 + { 10 + run_io_and_remove "$@" 11 + ERR_CODE=$? 12 + if [ ${ERR_CODE} -ne 0 ]; then 13 + echo "$TID failure: $*" 14 + _show_result $TID $ERR_CODE 15 + fi 16 + } 17 + 18 + if ! _have_program fio; then 19 + exit "$UBLK_SKIP_CODE" 20 + fi 21 + 22 + _prep_test "stress" "run IO and remove device (user copy)" 23 + 24 + _create_backfile 0 256M 25 + _create_backfile 1 128M 26 + _create_backfile 2 128M 27 + 28 + ublk_io_and_remove 8G -t null -q 4 -u & 29 + ublk_io_and_remove 256M -t loop -q 4 -u "${UBLK_BACKFILES[0]}" & 30 + ublk_io_and_remove 256M -t stripe -q 4 -u "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" & 31 + wait 32 + 33 + ublk_io_and_remove 8G -t null -q 4 -u --nthreads 8 --per_io_tasks & 34 + ublk_io_and_remove 256M -t loop -q 4 -u --nthreads 8 --per_io_tasks "${UBLK_BACKFILES[0]}" & 35 + ublk_io_and_remove 256M -t stripe -q 4 -u --nthreads 8 --per_io_tasks "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" & 36 + wait 37 + 38 + _cleanup_test "stress" 39 + _show_result $TID $ERR_CODE
+39
tools/testing/selftests/ublk/test_stress_07.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + 4 + . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh 5 + TID="stress_07" 6 + ERR_CODE=0 7 + 8 + ublk_io_and_kill_daemon() 9 + { 10 + run_io_and_kill_daemon "$@" 11 + ERR_CODE=$? 12 + if [ ${ERR_CODE} -ne 0 ]; then 13 + echo "$TID failure: $*" 14 + _show_result $TID $ERR_CODE 15 + fi 16 + } 17 + 18 + if ! _have_program fio; then 19 + exit "$UBLK_SKIP_CODE" 20 + fi 21 + 22 + _prep_test "stress" "run IO and kill ublk server (user copy)" 23 + 24 + _create_backfile 0 256M 25 + _create_backfile 1 128M 26 + _create_backfile 2 128M 27 + 28 + ublk_io_and_kill_daemon 8G -t null -q 4 -u --no_ublk_fixed_fd & 29 + ublk_io_and_kill_daemon 256M -t loop -q 4 -u --no_ublk_fixed_fd "${UBLK_BACKFILES[0]}" & 30 + ublk_io_and_kill_daemon 256M -t stripe -q 4 -u "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" & 31 + wait 32 + 33 + ublk_io_and_kill_daemon 8G -t null -q 4 -u --nthreads 8 --per_io_tasks & 34 + ublk_io_and_kill_daemon 256M -t loop -q 4 -u --nthreads 8 --per_io_tasks "${UBLK_BACKFILES[0]}" & 35 + ublk_io_and_kill_daemon 256M -t stripe -q 4 -u --nthreads 8 --per_io_tasks "${UBLK_BACKFILES[1]}" "${UBLK_BACKFILES[2]}" & 36 + wait 37 + 38 + _cleanup_test "stress" 39 + _show_result $TID $ERR_CODE
+26
tools/testing/selftests/ublk/test_stripe_05.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + 4 + . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh 5 + 6 + TID="stripe_05" 7 + ERR_CODE=0 8 + 9 + if ! _have_program fio; then 10 + exit "$UBLK_SKIP_CODE" 11 + fi 12 + 13 + _prep_test "stripe" "write and verify test on user copy" 14 + 15 + _create_backfile 0 256M 16 + _create_backfile 1 256M 17 + 18 + dev_id=$(_add_ublk_dev -t stripe -q 2 -u "${UBLK_BACKFILES[0]}" "${UBLK_BACKFILES[1]}") 19 + _check_add_dev $TID $? 20 + 21 + # run fio over the ublk disk 22 + _run_fio_verify_io --filename=/dev/ublkb"${dev_id}" --size=512M 23 + ERR_CODE=$? 24 + 25 + _cleanup_test "stripe" 26 + _show_result $TID $ERR_CODE
+21
tools/testing/selftests/ublk/test_stripe_06.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + 4 + . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh 5 + 6 + TID="stripe_06" 7 + ERR_CODE=0 8 + 9 + _prep_test "stripe" "mkfs & mount & umount on user copy" 10 + 11 + _create_backfile 0 256M 12 + _create_backfile 1 256M 13 + 14 + dev_id=$(_add_ublk_dev -t stripe -u -q 2 "${UBLK_BACKFILES[0]}" "${UBLK_BACKFILES[1]}") 15 + _check_add_dev $TID $? 16 + 17 + _mkfs_mount_test /dev/ublkb"${dev_id}" 18 + ERR_CODE=$? 19 + 20 + _cleanup_test "stripe" 21 + _show_result $TID $ERR_CODE
+1 -2
tools/testing/selftests/ublk/trace/seq_io.bt
··· 4 4 $3: strlen($2) 5 5 */ 6 6 BEGIN { 7 - @last_rw[$1, str($2)] = 0; 7 + @last_rw[$1, str($2)] = (uint64)0; 8 8 } 9 9 tracepoint:block:block_rq_complete 10 10 { ··· 17 17 } 18 18 @last_rw[$dev, str($2)] = (args.sector + args.nr_sector); 19 19 } 20 - @ios = count(); 21 20 } 22 21 23 22 END {
+16 -1
virt/kvm/kvm_main.c
··· 1749 1749 kvm_free_memslot(kvm, old); 1750 1750 break; 1751 1751 case KVM_MR_MOVE: 1752 + /* 1753 + * Moving a guest_memfd memslot isn't supported, and will never 1754 + * be supported. 1755 + */ 1756 + WARN_ON_ONCE(old->flags & KVM_MEM_GUEST_MEMFD); 1757 + fallthrough; 1752 1758 case KVM_MR_FLAGS_ONLY: 1753 1759 /* 1754 1760 * Free the dirty bitmap as needed; the below check encompasses ··· 1762 1756 */ 1763 1757 if (old->dirty_bitmap && !new->dirty_bitmap) 1764 1758 kvm_destroy_dirty_bitmap(old); 1759 + 1760 + /* 1761 + * Unbind the guest_memfd instance as needed; the @new slot has 1762 + * already created its own binding. TODO: Drop the WARN when 1763 + * dirty logging guest_memfd memslots is supported. Until then, 1764 + * flags-only changes on guest_memfd slots should be impossible. 1765 + */ 1766 + if (WARN_ON_ONCE(old->flags & KVM_MEM_GUEST_MEMFD)) 1767 + kvm_gmem_unbind(old); 1765 1768 1766 1769 /* 1767 1770 * The final quirk. Free the detached, old slot, but only its ··· 2101 2086 return -EINVAL; 2102 2087 if ((mem->userspace_addr != old->userspace_addr) || 2103 2088 (npages != old->npages) || 2104 - ((mem->flags ^ old->flags) & KVM_MEM_READONLY)) 2089 + ((mem->flags ^ old->flags) & (KVM_MEM_READONLY | KVM_MEM_GUEST_MEMFD))) 2105 2090 return -EINVAL; 2106 2091 2107 2092 if (base_gfn != old->base_gfn)