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.

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

Cross-merge networking fixes after downstream PR (net-6.15-rc6).

No conflicts.

Adjacent changes:

net/core/dev.c:
08e9f2d584c4 ("net: Lock netdevices during dev_shutdown")
a82dc19db136 ("net: avoid potential race between netdev_get_by_index_lock() and netns switch")

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

+2716 -1190
+2 -2
Documentation/ABI/testing/sysfs-driver-intel-xe-hwmon
··· 111 111 112 112 What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp2_input 113 113 Date: March 2025 114 - KernelVersion: 6.14 114 + KernelVersion: 6.15 115 115 Contact: intel-xe@lists.freedesktop.org 116 116 Description: RO. Package temperature in millidegree Celsius. 117 117 ··· 119 119 120 120 What: /sys/bus/pci/drivers/xe/.../hwmon/hwmon<i>/temp3_input 121 121 Date: March 2025 122 - KernelVersion: 6.14 122 + KernelVersion: 6.15 123 123 Contact: intel-xe@lists.freedesktop.org 124 124 Description: RO. VRAM temperature in millidegree Celsius. 125 125
+90 -7
Documentation/devicetree/bindings/net/ethernet-controller.yaml
··· 50 50 - rev-rmii 51 51 - moca 52 52 53 - # RX and TX delays are added by the MAC when required 53 + # RX and TX delays are provided by the PCB. See below 54 54 - rgmii 55 55 56 - # RGMII with internal RX and TX delays provided by the PHY, 57 - # the MAC should not add the RX or TX delays in this case 56 + # RX and TX delays are not provided by the PCB. This is the most 57 + # frequent case. See below 58 58 - rgmii-id 59 59 60 - # RGMII with internal RX delay provided by the PHY, the MAC 61 - # should not add an RX delay in this case 60 + # TX delay is provided by the PCB. See below 62 61 - rgmii-rxid 63 62 64 - # RGMII with internal TX delay provided by the PHY, the MAC 65 - # should not add an TX delay in this case 63 + # RX delay is provided by the PCB. See below 66 64 - rgmii-txid 67 65 - rtbi 68 66 - smii ··· 261 263 262 264 additionalProperties: true 263 265 266 + # Informative 267 + # =========== 268 + # 269 + # 'phy-modes' & 'phy-connection-type' properties 'rgmii', 'rgmii-id', 270 + # 'rgmii-rxid', and 'rgmii-txid' are frequently used wrongly by 271 + # developers. This informative section clarifies their usage. 272 + # 273 + # The RGMII specification requires a 2ns delay between the data and 274 + # clock signals on the RGMII bus. How this delay is implemented is not 275 + # specified. 276 + # 277 + # One option is to make the clock traces on the PCB longer than the 278 + # data traces. A sufficiently difference in length can provide the 2ns 279 + # delay. If both the RX and TX delays are implemented in this manner, 280 + # 'rgmii' should be used, so indicating the PCB adds the delays. 281 + # 282 + # If the PCB does not add these delays via extra long traces, 283 + # 'rgmii-id' should be used. Here, 'id' refers to 'internal delay', 284 + # where either the MAC or PHY adds the delay. 285 + # 286 + # If only one of the two delays are implemented via extra long clock 287 + # lines, either 'rgmii-rxid' or 'rgmii-txid' should be used, 288 + # indicating the MAC or PHY should implement one of the delays 289 + # internally, while the PCB implements the other delay. 290 + # 291 + # Device Tree describes hardware, and in this case, it describes the 292 + # PCB between the MAC and the PHY, if the PCB implements delays or 293 + # not. 294 + # 295 + # In practice, very few PCBs make use of extra long clock lines. Hence 296 + # any RGMII phy mode other than 'rgmii-id' is probably wrong, and is 297 + # unlikely to be accepted during review without details provided in 298 + # the commit description and comments in the .dts file. 299 + # 300 + # When the PCB does not implement the delays, the MAC or PHY must. As 301 + # such, this is software configuration, and so not described in Device 302 + # Tree. 303 + # 304 + # The following describes how Linux implements the configuration of 305 + # the MAC and PHY to add these delays when the PCB does not. As stated 306 + # above, developers often get this wrong, and the aim of this section 307 + # is reduce the frequency of these errors by Linux developers. Other 308 + # users of the Device Tree may implement it differently, and still be 309 + # consistent with both the normative and informative description 310 + # above. 311 + # 312 + # By default in Linux, when using phylib/phylink, the MAC is expected 313 + # to read the 'phy-mode' from Device Tree, not implement any delays, 314 + # and pass the value to the PHY. The PHY will then implement delays as 315 + # specified by the 'phy-mode'. The PHY should always be reconfigured 316 + # to implement the needed delays, replacing any setting performed by 317 + # strapping or the bootloader, etc. 318 + # 319 + # Experience to date is that all PHYs which implement RGMII also 320 + # implement the ability to add or not add the needed delays. Hence 321 + # this default is expected to work in all cases. Ignoring this default 322 + # is likely to be questioned by Reviews, and require a strong argument 323 + # to be accepted. 324 + # 325 + # There are a small number of cases where the MAC has hard coded 326 + # delays which cannot be disabled. The 'phy-mode' only describes the 327 + # PCB. The inability to disable the delays in the MAC does not change 328 + # the meaning of 'phy-mode'. It does however mean that a 'phy-mode' of 329 + # 'rgmii' is now invalid, it cannot be supported, since both the PCB 330 + # and the MAC and PHY adding delays cannot result in a functional 331 + # link. Thus the MAC should report a fatal error for any modes which 332 + # cannot be supported. When the MAC implements the delay, it must 333 + # ensure that the PHY does not also implement the same delay. So it 334 + # must modify the phy-mode it passes to the PHY, removing the delay it 335 + # has added. Failure to remove the delay will result in a 336 + # non-functioning link. 337 + # 338 + # Sometimes there is a need to fine tune the delays. Often the MAC or 339 + # PHY can perform this fine tuning. In the MAC node, the Device Tree 340 + # properties 'rx-internal-delay-ps' and 'tx-internal-delay-ps' should 341 + # be used to indicate fine tuning performed by the MAC. The values 342 + # expected here are small. A value of 2000ps, i.e 2ns, and a phy-mode 343 + # of 'rgmii' will not be accepted by Reviewers. 344 + # 345 + # If the PHY is to perform fine tuning, the properties 346 + # 'rx-internal-delay-ps' and 'tx-internal-delay-ps' in the PHY node 347 + # should be used. When the PHY is implementing delays, e.g. 'rgmii-id' 348 + # these properties should have a value near to 2000ps. If the PCB is 349 + # implementing delays, e.g. 'rgmii', a small value can be used to fine 350 + # tune the delay added by the PCB. 264 351 ...
+7 -12
Documentation/devicetree/bindings/spi/snps,dw-apb-ssi.yaml
··· 56 56 enum: 57 57 - snps,dw-apb-ssi 58 58 - snps,dwc-ssi-1.01a 59 - - description: Microsemi Ocelot/Jaguar2 SoC SPI Controller 60 - items: 61 - - enum: 62 - - mscc,ocelot-spi 63 - - mscc,jaguar2-spi 64 - - const: snps,dw-apb-ssi 65 59 - description: Microchip Sparx5 SoC SPI Controller 66 60 const: microchip,sparx5-spi 67 61 - description: Amazon Alpine SPI Controller 68 62 const: amazon,alpine-dw-apb-ssi 69 - - description: Renesas RZ/N1 SPI Controller 63 + - description: Vendor controllers which use snps,dw-apb-ssi as fallback 70 64 items: 71 - - const: renesas,rzn1-spi 65 + - enum: 66 + - mscc,ocelot-spi 67 + - mscc,jaguar2-spi 68 + - renesas,rzn1-spi 69 + - sophgo,sg2042-spi 70 + - thead,th1520-spi 72 71 - const: snps,dw-apb-ssi 73 72 - description: Intel Keem Bay SPI Controller 74 73 const: intel,keembay-ssi ··· 87 88 - renesas,r9a06g032-spi # RZ/N1D 88 89 - renesas,r9a06g033-spi # RZ/N1S 89 90 - const: renesas,rzn1-spi # RZ/N1 90 - - description: T-HEAD TH1520 SoC SPI Controller 91 - items: 92 - - const: thead,th1520-spi 93 - - const: snps,dw-apb-ssi 94 91 95 92 reg: 96 93 minItems: 1
+8
MAINTAINERS
··· 2519 2519 F: arch/arm/boot/dts/nxp/imx/ 2520 2520 F: arch/arm/boot/dts/nxp/mxs/ 2521 2521 F: arch/arm64/boot/dts/freescale/ 2522 + X: Documentation/devicetree/bindings/media/i2c/ 2522 2523 X: arch/arm64/boot/dts/freescale/fsl-* 2523 2524 X: arch/arm64/boot/dts/freescale/qoriq-* 2524 2525 X: drivers/media/i2c/ ··· 8718 8717 R: Yue Hu <zbestahu@gmail.com> 8719 8718 R: Jeffle Xu <jefflexu@linux.alibaba.com> 8720 8719 R: Sandeep Dhavale <dhavale@google.com> 8720 + R: Hongbo Li <lihongbo22@huawei.com> 8721 8721 L: linux-erofs@lists.ozlabs.org 8722 8722 S: Maintained 8723 8723 W: https://erofs.docs.kernel.org ··· 22750 22748 F: Documentation/devicetree/bindings/sound/ 22751 22749 F: Documentation/sound/soc/ 22752 22750 F: include/dt-bindings/sound/ 22751 + F: include/sound/cs-amp-lib.h 22752 + F: include/sound/cs35l* 22753 + F: include/sound/cs4271.h 22754 + F: include/sound/cs42l* 22755 + F: include/sound/madera-pdata.h 22753 22756 F: include/sound/soc* 22754 22757 F: include/sound/sof.h 22755 22758 F: include/sound/sof/ 22759 + F: include/sound/wm*.h 22756 22760 F: include/trace/events/sof*.h 22757 22761 F: include/uapi/sound/asoc.h 22758 22762 F: sound/soc/
+1 -1
Makefile
··· 2 2 VERSION = 6 3 3 PATCHLEVEL = 15 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc4 5 + EXTRAVERSION = -rc5 6 6 NAME = Baby Opossum Posse 7 7 8 8 # *DOCUMENTATION*
+3
arch/arm/boot/dts/nxp/imx/imx6ul-imx6ull-opos6ul.dtsi
··· 40 40 reg = <1>; 41 41 interrupt-parent = <&gpio4>; 42 42 interrupts = <16 IRQ_TYPE_LEVEL_LOW>; 43 + micrel,led-mode = <1>; 44 + clocks = <&clks IMX6UL_CLK_ENET_REF>; 45 + clock-names = "rmii-ref"; 43 46 status = "okay"; 44 47 }; 45 48 };
+11 -11
arch/arm64/boot/dts/arm/morello.dtsi
··· 44 44 next-level-cache = <&l2_0>; 45 45 clocks = <&scmi_dvfs 0>; 46 46 47 - l2_0: l2-cache-0 { 47 + l2_0: l2-cache { 48 48 compatible = "cache"; 49 49 cache-level = <2>; 50 50 /* 8 ways set associative */ ··· 53 53 cache-sets = <2048>; 54 54 cache-unified; 55 55 next-level-cache = <&l3_0>; 56 - 57 - l3_0: l3-cache { 58 - compatible = "cache"; 59 - cache-level = <3>; 60 - cache-size = <0x100000>; 61 - cache-unified; 62 - }; 63 56 }; 64 57 }; 65 58 ··· 71 78 next-level-cache = <&l2_1>; 72 79 clocks = <&scmi_dvfs 0>; 73 80 74 - l2_1: l2-cache-1 { 81 + l2_1: l2-cache { 75 82 compatible = "cache"; 76 83 cache-level = <2>; 77 84 /* 8 ways set associative */ ··· 98 105 next-level-cache = <&l2_2>; 99 106 clocks = <&scmi_dvfs 1>; 100 107 101 - l2_2: l2-cache-2 { 108 + l2_2: l2-cache { 102 109 compatible = "cache"; 103 110 cache-level = <2>; 104 111 /* 8 ways set associative */ ··· 125 132 next-level-cache = <&l2_3>; 126 133 clocks = <&scmi_dvfs 1>; 127 134 128 - l2_3: l2-cache-3 { 135 + l2_3: l2-cache { 129 136 compatible = "cache"; 130 137 cache-level = <2>; 131 138 /* 8 ways set associative */ ··· 135 142 cache-unified; 136 143 next-level-cache = <&l3_0>; 137 144 }; 145 + }; 146 + 147 + l3_0: l3-cache { 148 + compatible = "cache"; 149 + cache-level = <3>; 150 + cache-size = <0x100000>; 151 + cache-unified; 138 152 }; 139 153 }; 140 154
+20 -5
arch/arm64/boot/dts/freescale/imx8mm-verdin.dtsi
··· 144 144 startup-delay-us = <20000>; 145 145 }; 146 146 147 + reg_usdhc2_vqmmc: regulator-usdhc2-vqmmc { 148 + compatible = "regulator-gpio"; 149 + pinctrl-names = "default"; 150 + pinctrl-0 = <&pinctrl_usdhc2_vsel>; 151 + gpios = <&gpio1 4 GPIO_ACTIVE_HIGH>; 152 + regulator-max-microvolt = <3300000>; 153 + regulator-min-microvolt = <1800000>; 154 + states = <1800000 0x1>, 155 + <3300000 0x0>; 156 + regulator-name = "PMIC_USDHC_VSELECT"; 157 + vin-supply = <&reg_nvcc_sd>; 158 + }; 159 + 147 160 reserved-memory { 148 161 #address-cells = <2>; 149 162 #size-cells = <2>; ··· 282 269 "SODIMM_19", 283 270 "", 284 271 "", 285 - "", 272 + "PMIC_USDHC_VSELECT", 286 273 "", 287 274 "", 288 275 "", ··· 798 785 pinctrl-2 = <&pinctrl_usdhc2_200mhz>, <&pinctrl_usdhc2_cd>; 799 786 pinctrl-3 = <&pinctrl_usdhc2_sleep>, <&pinctrl_usdhc2_cd_sleep>; 800 787 vmmc-supply = <&reg_usdhc2_vmmc>; 788 + vqmmc-supply = <&reg_usdhc2_vqmmc>; 801 789 }; 802 790 803 791 &wdog1 { ··· 1220 1206 <MX8MM_IOMUXC_NAND_CLE_GPIO3_IO5 0x6>; /* SODIMM 76 */ 1221 1207 }; 1222 1208 1209 + pinctrl_usdhc2_vsel: usdhc2vselgrp { 1210 + fsl,pins = 1211 + <MX8MM_IOMUXC_GPIO1_IO04_GPIO1_IO4 0x10>; /* PMIC_USDHC_VSELECT */ 1212 + }; 1213 + 1223 1214 /* 1224 1215 * Note: Due to ERR050080 we use discrete external on-module resistors pulling-up to the 1225 1216 * on-module +V3.3_1.8_SD (LDO5) rail and explicitly disable the internal pull-ups here. 1226 1217 */ 1227 1218 pinctrl_usdhc2: usdhc2grp { 1228 1219 fsl,pins = 1229 - <MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x10>, 1230 1220 <MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x90>, /* SODIMM 78 */ 1231 1221 <MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x90>, /* SODIMM 74 */ 1232 1222 <MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x90>, /* SODIMM 80 */ ··· 1241 1223 1242 1224 pinctrl_usdhc2_100mhz: usdhc2-100mhzgrp { 1243 1225 fsl,pins = 1244 - <MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x10>, 1245 1226 <MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x94>, 1246 1227 <MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x94>, 1247 1228 <MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x94>, ··· 1251 1234 1252 1235 pinctrl_usdhc2_200mhz: usdhc2-200mhzgrp { 1253 1236 fsl,pins = 1254 - <MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x10>, 1255 1237 <MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x96>, 1256 1238 <MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x96>, 1257 1239 <MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x96>, ··· 1262 1246 /* Avoid backfeeding with removed card power */ 1263 1247 pinctrl_usdhc2_sleep: usdhc2slpgrp { 1264 1248 fsl,pins = 1265 - <MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT 0x0>, 1266 1249 <MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK 0x0>, 1267 1250 <MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD 0x0>, 1268 1251 <MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0 0x0>,
+26
arch/arm64/boot/dts/freescale/imx8mp-nominal.dtsi
··· 24 24 fsl,operating-mode = "nominal"; 25 25 }; 26 26 27 + &gpu2d { 28 + assigned-clocks = <&clk IMX8MP_CLK_GPU2D_CORE>; 29 + assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_800M>; 30 + assigned-clock-rates = <800000000>; 31 + }; 32 + 33 + &gpu3d { 34 + assigned-clocks = <&clk IMX8MP_CLK_GPU3D_CORE>, 35 + <&clk IMX8MP_CLK_GPU3D_SHADER_CORE>; 36 + assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_800M>, 37 + <&clk IMX8MP_SYS_PLL1_800M>; 38 + assigned-clock-rates = <800000000>, <800000000>; 39 + }; 40 + 27 41 &pgc_hdmimix { 28 42 assigned-clocks = <&clk IMX8MP_CLK_HDMI_AXI>, 29 43 <&clk IMX8MP_CLK_HDMI_APB>; ··· 58 44 assigned-clock-parents = <&clk IMX8MP_SYS_PLL3_OUT>, 59 45 <&clk IMX8MP_SYS_PLL3_OUT>; 60 46 assigned-clock-rates = <600000000>, <300000000>; 47 + }; 48 + 49 + &pgc_mlmix { 50 + assigned-clocks = <&clk IMX8MP_CLK_ML_CORE>, 51 + <&clk IMX8MP_CLK_ML_AXI>, 52 + <&clk IMX8MP_CLK_ML_AHB>; 53 + assigned-clock-parents = <&clk IMX8MP_SYS_PLL1_800M>, 54 + <&clk IMX8MP_SYS_PLL1_800M>, 55 + <&clk IMX8MP_SYS_PLL1_800M>; 56 + assigned-clock-rates = <800000000>, 57 + <800000000>, 58 + <300000000>; 61 59 }; 62 60 63 61 &media_blk_ctrl {
+4 -4
arch/arm64/boot/dts/freescale/imx95.dtsi
··· 1626 1626 reg = <0 0x4c300000 0 0x10000>, 1627 1627 <0 0x60100000 0 0xfe00000>, 1628 1628 <0 0x4c360000 0 0x10000>, 1629 - <0 0x4c340000 0 0x2000>; 1629 + <0 0x4c340000 0 0x4000>; 1630 1630 reg-names = "dbi", "config", "atu", "app"; 1631 1631 ranges = <0x81000000 0x0 0x00000000 0x0 0x6ff00000 0 0x00100000>, 1632 1632 <0x82000000 0x0 0x10000000 0x9 0x10000000 0 0x10000000>; ··· 1673 1673 reg = <0 0x4c300000 0 0x10000>, 1674 1674 <0 0x4c360000 0 0x1000>, 1675 1675 <0 0x4c320000 0 0x1000>, 1676 - <0 0x4c340000 0 0x2000>, 1676 + <0 0x4c340000 0 0x4000>, 1677 1677 <0 0x4c370000 0 0x10000>, 1678 1678 <0x9 0 1 0>; 1679 1679 reg-names = "dbi","atu", "dbi2", "app", "dma", "addr_space"; ··· 1700 1700 reg = <0 0x4c380000 0 0x10000>, 1701 1701 <8 0x80100000 0 0xfe00000>, 1702 1702 <0 0x4c3e0000 0 0x10000>, 1703 - <0 0x4c3c0000 0 0x2000>; 1703 + <0 0x4c3c0000 0 0x4000>; 1704 1704 reg-names = "dbi", "config", "atu", "app"; 1705 1705 ranges = <0x81000000 0 0x00000000 0x8 0x8ff00000 0 0x00100000>, 1706 1706 <0x82000000 0 0x10000000 0xa 0x10000000 0 0x10000000>; ··· 1749 1749 reg = <0 0x4c380000 0 0x10000>, 1750 1750 <0 0x4c3e0000 0 0x1000>, 1751 1751 <0 0x4c3a0000 0 0x1000>, 1752 - <0 0x4c3c0000 0 0x2000>, 1752 + <0 0x4c3c0000 0 0x4000>, 1753 1753 <0 0x4c3f0000 0 0x10000>, 1754 1754 <0xa 0 1 0>; 1755 1755 reg-names = "dbi", "atu", "dbi2", "app", "dma", "addr_space";
+4 -4
arch/arm64/boot/dts/st/stm32mp211.dtsi
··· 116 116 }; 117 117 118 118 intc: interrupt-controller@4ac10000 { 119 - compatible = "arm,cortex-a7-gic"; 119 + compatible = "arm,gic-400"; 120 120 reg = <0x4ac10000 0x0 0x1000>, 121 - <0x4ac20000 0x0 0x2000>, 122 - <0x4ac40000 0x0 0x2000>, 123 - <0x4ac60000 0x0 0x2000>; 121 + <0x4ac20000 0x0 0x20000>, 122 + <0x4ac40000 0x0 0x20000>, 123 + <0x4ac60000 0x0 0x20000>; 124 124 #interrupt-cells = <3>; 125 125 interrupt-controller; 126 126 };
+4 -5
arch/arm64/boot/dts/st/stm32mp231.dtsi
··· 1201 1201 }; 1202 1202 1203 1203 intc: interrupt-controller@4ac10000 { 1204 - compatible = "arm,cortex-a7-gic"; 1204 + compatible = "arm,gic-400"; 1205 1205 reg = <0x4ac10000 0x1000>, 1206 - <0x4ac20000 0x2000>, 1207 - <0x4ac40000 0x2000>, 1208 - <0x4ac60000 0x2000>; 1206 + <0x4ac20000 0x20000>, 1207 + <0x4ac40000 0x20000>, 1208 + <0x4ac60000 0x20000>; 1209 1209 #interrupt-cells = <3>; 1210 - #address-cells = <1>; 1211 1210 interrupt-controller; 1212 1211 }; 1213 1212 };
+4 -5
arch/arm64/boot/dts/st/stm32mp251.dtsi
··· 115 115 }; 116 116 117 117 intc: interrupt-controller@4ac00000 { 118 - compatible = "arm,cortex-a7-gic"; 118 + compatible = "arm,gic-400"; 119 119 #interrupt-cells = <3>; 120 - #address-cells = <1>; 121 120 interrupt-controller; 122 121 reg = <0x0 0x4ac10000 0x0 0x1000>, 123 - <0x0 0x4ac20000 0x0 0x2000>, 124 - <0x0 0x4ac40000 0x0 0x2000>, 125 - <0x0 0x4ac60000 0x0 0x2000>; 122 + <0x0 0x4ac20000 0x0 0x20000>, 123 + <0x0 0x4ac40000 0x0 0x20000>, 124 + <0x0 0x4ac60000 0x0 0x20000>; 126 125 }; 127 126 128 127 psci {
+2
arch/arm64/kernel/proton-pack.c
··· 879 879 static const struct midr_range spectre_bhb_k132_list[] = { 880 880 MIDR_ALL_VERSIONS(MIDR_CORTEX_X3), 881 881 MIDR_ALL_VERSIONS(MIDR_NEOVERSE_V2), 882 + {}, 882 883 }; 883 884 static const struct midr_range spectre_bhb_k38_list[] = { 884 885 MIDR_ALL_VERSIONS(MIDR_CORTEX_A715), 885 886 MIDR_ALL_VERSIONS(MIDR_CORTEX_A720), 887 + {}, 886 888 }; 887 889 static const struct midr_range spectre_bhb_k32_list[] = { 888 890 MIDR_ALL_VERSIONS(MIDR_CORTEX_A78),
+13 -3
arch/parisc/math-emu/driver.c
··· 97 97 98 98 memcpy(regs->fr, frcopy, sizeof regs->fr); 99 99 if (signalcode != 0) { 100 - force_sig_fault(signalcode >> 24, signalcode & 0xffffff, 101 - (void __user *) regs->iaoq[0]); 102 - return -1; 100 + int sig = signalcode >> 24; 101 + 102 + if (sig == SIGFPE) { 103 + /* 104 + * Clear floating point trap bit to avoid trapping 105 + * again on the first floating-point instruction in 106 + * the userspace signal handler. 107 + */ 108 + regs->fr[0] &= ~(1ULL << 38); 109 + } 110 + force_sig_fault(sig, signalcode & 0xffffff, 111 + (void __user *) regs->iaoq[0]); 112 + return -1; 103 113 } 104 114 105 115 return signalcode ? -1 : 0;
+19 -9
arch/s390/configs/debug_defconfig
··· 38 38 CONFIG_CHECKPOINT_RESTORE=y 39 39 CONFIG_SCHED_AUTOGROUP=y 40 40 CONFIG_EXPERT=y 41 - # CONFIG_SYSFS_SYSCALL is not set 42 41 CONFIG_PROFILING=y 43 42 CONFIG_KEXEC=y 44 43 CONFIG_KEXEC_FILE=y ··· 91 92 CONFIG_IOSCHED_BFQ=y 92 93 CONFIG_BINFMT_MISC=m 93 94 CONFIG_ZSWAP=y 94 - CONFIG_ZSMALLOC=y 95 95 CONFIG_ZSMALLOC_STAT=y 96 96 CONFIG_SLAB_BUCKETS=y 97 97 CONFIG_SLUB_STATS=y ··· 393 395 CONFIG_NET_CLS_FLOW=m 394 396 CONFIG_NET_CLS_CGROUP=y 395 397 CONFIG_NET_CLS_BPF=m 398 + CONFIG_NET_CLS_FLOWER=m 399 + CONFIG_NET_CLS_MATCHALL=m 400 + CONFIG_NET_EMATCH=y 396 401 CONFIG_NET_CLS_ACT=y 397 402 CONFIG_NET_ACT_POLICE=m 398 403 CONFIG_NET_ACT_GACT=m ··· 406 405 CONFIG_NET_ACT_SIMP=m 407 406 CONFIG_NET_ACT_SKBEDIT=m 408 407 CONFIG_NET_ACT_CSUM=m 408 + CONFIG_NET_ACT_VLAN=m 409 + CONFIG_NET_ACT_TUNNEL_KEY=m 410 + CONFIG_NET_ACT_CT=m 409 411 CONFIG_NET_ACT_GATE=m 410 412 CONFIG_NET_TC_SKB_EXT=y 411 413 CONFIG_DNS_RESOLVER=y ··· 632 628 CONFIG_VIRTIO_BALLOON=m 633 629 CONFIG_VIRTIO_MEM=m 634 630 CONFIG_VIRTIO_INPUT=y 631 + CONFIG_VDPA=m 632 + CONFIG_VDPA_SIM=m 633 + CONFIG_VDPA_SIM_NET=m 634 + CONFIG_VDPA_SIM_BLOCK=m 635 + CONFIG_VDPA_USER=m 636 + CONFIG_MLX5_VDPA_NET=m 637 + CONFIG_VP_VDPA=m 635 638 CONFIG_VHOST_NET=m 636 639 CONFIG_VHOST_VSOCK=m 640 + CONFIG_VHOST_VDPA=m 637 641 CONFIG_EXT4_FS=y 638 642 CONFIG_EXT4_FS_POSIX_ACL=y 639 643 CONFIG_EXT4_FS_SECURITY=y ··· 666 654 CONFIG_BCACHEFS_FS=y 667 655 CONFIG_BCACHEFS_QUOTA=y 668 656 CONFIG_BCACHEFS_POSIX_ACL=y 669 - CONFIG_FS_DAX=y 670 657 CONFIG_EXPORTFS_BLOCK_OPS=y 671 658 CONFIG_FS_ENCRYPTION=y 672 659 CONFIG_FS_VERITY=y ··· 735 724 CONFIG_DLM=m 736 725 CONFIG_UNICODE=y 737 726 CONFIG_PERSISTENT_KEYRINGS=y 727 + CONFIG_BIG_KEYS=y 738 728 CONFIG_ENCRYPTED_KEYS=m 739 729 CONFIG_KEY_NOTIFICATIONS=y 740 730 CONFIG_SECURITY=y 741 - CONFIG_HARDENED_USERCOPY=y 742 - CONFIG_FORTIFY_SOURCE=y 743 731 CONFIG_SECURITY_SELINUX=y 744 732 CONFIG_SECURITY_SELINUX_BOOTPARAM=y 745 733 CONFIG_SECURITY_LOCKDOWN_LSM=y ··· 751 741 CONFIG_IMA_DEFAULT_HASH_SHA256=y 752 742 CONFIG_IMA_WRITE_POLICY=y 753 743 CONFIG_IMA_APPRAISE=y 744 + CONFIG_FORTIFY_SOURCE=y 745 + CONFIG_HARDENED_USERCOPY=y 754 746 CONFIG_BUG_ON_DATA_CORRUPTION=y 755 747 CONFIG_CRYPTO_USER=m 756 748 # CONFIG_CRYPTO_MANAGER_DISABLE_TESTS is not set ··· 768 756 CONFIG_CRYPTO_ANUBIS=m 769 757 CONFIG_CRYPTO_ARIA=m 770 758 CONFIG_CRYPTO_BLOWFISH=m 771 - CONFIG_CRYPTO_CAMELLIA=m 772 759 CONFIG_CRYPTO_CAST5=m 773 760 CONFIG_CRYPTO_CAST6=m 774 761 CONFIG_CRYPTO_DES=m ··· 812 801 CONFIG_CRYPTO_GHASH_S390=m 813 802 CONFIG_CRYPTO_AES_S390=m 814 803 CONFIG_CRYPTO_DES_S390=m 815 - CONFIG_CRYPTO_CHACHA_S390=m 816 804 CONFIG_CRYPTO_HMAC_S390=m 817 805 CONFIG_ZCRYPT=m 818 806 CONFIG_PKEY=m ··· 822 812 CONFIG_CRYPTO_PAES_S390=m 823 813 CONFIG_CRYPTO_DEV_VIRTIO=m 824 814 CONFIG_SYSTEM_BLACKLIST_KEYRING=y 815 + CONFIG_CRYPTO_KRB5=m 816 + CONFIG_CRYPTO_KRB5_SELFTESTS=y 825 817 CONFIG_CORDIC=m 826 - CONFIG_CRYPTO_LIB_CURVE25519=m 827 - CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m 828 818 CONFIG_RANDOM32_SELFTEST=y 829 819 CONFIG_XZ_DEC_MICROLZMA=y 830 820 CONFIG_DMA_CMA=y
+17 -7
arch/s390/configs/defconfig
··· 36 36 CONFIG_CHECKPOINT_RESTORE=y 37 37 CONFIG_SCHED_AUTOGROUP=y 38 38 CONFIG_EXPERT=y 39 - # CONFIG_SYSFS_SYSCALL is not set 40 39 CONFIG_PROFILING=y 41 40 CONFIG_KEXEC=y 42 41 CONFIG_KEXEC_FILE=y ··· 85 86 CONFIG_IOSCHED_BFQ=y 86 87 CONFIG_BINFMT_MISC=m 87 88 CONFIG_ZSWAP=y 88 - CONFIG_ZSMALLOC=y 89 89 CONFIG_ZSMALLOC_STAT=y 90 90 CONFIG_SLAB_BUCKETS=y 91 91 # CONFIG_COMPAT_BRK is not set ··· 383 385 CONFIG_NET_CLS_FLOW=m 384 386 CONFIG_NET_CLS_CGROUP=y 385 387 CONFIG_NET_CLS_BPF=m 388 + CONFIG_NET_CLS_FLOWER=m 389 + CONFIG_NET_CLS_MATCHALL=m 390 + CONFIG_NET_EMATCH=y 386 391 CONFIG_NET_CLS_ACT=y 387 392 CONFIG_NET_ACT_POLICE=m 388 393 CONFIG_NET_ACT_GACT=m ··· 396 395 CONFIG_NET_ACT_SIMP=m 397 396 CONFIG_NET_ACT_SKBEDIT=m 398 397 CONFIG_NET_ACT_CSUM=m 398 + CONFIG_NET_ACT_VLAN=m 399 + CONFIG_NET_ACT_TUNNEL_KEY=m 400 + CONFIG_NET_ACT_CT=m 399 401 CONFIG_NET_ACT_GATE=m 400 402 CONFIG_NET_TC_SKB_EXT=y 401 403 CONFIG_DNS_RESOLVER=y ··· 622 618 CONFIG_VIRTIO_BALLOON=m 623 619 CONFIG_VIRTIO_MEM=m 624 620 CONFIG_VIRTIO_INPUT=y 621 + CONFIG_VDPA=m 622 + CONFIG_VDPA_SIM=m 623 + CONFIG_VDPA_SIM_NET=m 624 + CONFIG_VDPA_SIM_BLOCK=m 625 + CONFIG_VDPA_USER=m 626 + CONFIG_MLX5_VDPA_NET=m 627 + CONFIG_VP_VDPA=m 625 628 CONFIG_VHOST_NET=m 626 629 CONFIG_VHOST_VSOCK=m 630 + CONFIG_VHOST_VDPA=m 627 631 CONFIG_EXT4_FS=y 628 632 CONFIG_EXT4_FS_POSIX_ACL=y 629 633 CONFIG_EXT4_FS_SECURITY=y ··· 653 641 CONFIG_BCACHEFS_FS=m 654 642 CONFIG_BCACHEFS_QUOTA=y 655 643 CONFIG_BCACHEFS_POSIX_ACL=y 656 - CONFIG_FS_DAX=y 657 644 CONFIG_EXPORTFS_BLOCK_OPS=y 658 645 CONFIG_FS_ENCRYPTION=y 659 646 CONFIG_FS_VERITY=y ··· 722 711 CONFIG_DLM=m 723 712 CONFIG_UNICODE=y 724 713 CONFIG_PERSISTENT_KEYRINGS=y 714 + CONFIG_BIG_KEYS=y 725 715 CONFIG_ENCRYPTED_KEYS=m 726 716 CONFIG_KEY_NOTIFICATIONS=y 727 717 CONFIG_SECURITY=y ··· 754 742 CONFIG_CRYPTO_ANUBIS=m 755 743 CONFIG_CRYPTO_ARIA=m 756 744 CONFIG_CRYPTO_BLOWFISH=m 757 - CONFIG_CRYPTO_CAMELLIA=m 758 745 CONFIG_CRYPTO_CAST5=m 759 746 CONFIG_CRYPTO_CAST6=m 760 747 CONFIG_CRYPTO_DES=m ··· 799 788 CONFIG_CRYPTO_GHASH_S390=m 800 789 CONFIG_CRYPTO_AES_S390=m 801 790 CONFIG_CRYPTO_DES_S390=m 802 - CONFIG_CRYPTO_CHACHA_S390=m 803 791 CONFIG_CRYPTO_HMAC_S390=m 804 792 CONFIG_ZCRYPT=m 805 793 CONFIG_PKEY=m ··· 809 799 CONFIG_CRYPTO_PAES_S390=m 810 800 CONFIG_CRYPTO_DEV_VIRTIO=m 811 801 CONFIG_SYSTEM_BLACKLIST_KEYRING=y 802 + CONFIG_CRYPTO_KRB5=m 803 + CONFIG_CRYPTO_KRB5_SELFTESTS=y 812 804 CONFIG_CORDIC=m 813 805 CONFIG_PRIME_NUMBERS=m 814 - CONFIG_CRYPTO_LIB_CURVE25519=m 815 - CONFIG_CRYPTO_LIB_CHACHA20POLY1305=m 816 806 CONFIG_XZ_DEC_MICROLZMA=y 817 807 CONFIG_DMA_CMA=y 818 808 CONFIG_CMA_SIZE_MBYTES=0
-1
arch/s390/configs/zfcpdump_defconfig
··· 70 70 CONFIG_DEBUG_INFO_DWARF4=y 71 71 CONFIG_DEBUG_FS=y 72 72 CONFIG_PANIC_ON_OOPS=y 73 - # CONFIG_SCHED_DEBUG is not set 74 73 CONFIG_RCU_CPU_STALL_TIMEOUT=60 75 74 # CONFIG_RCU_TRACE is not set 76 75 # CONFIG_FTRACE is not set
+2 -1
arch/s390/kernel/entry.S
··· 602 602 stmg %r0,%r7,__PT_R0(%r11) 603 603 stmg %r8,%r9,__PT_PSW(%r11) 604 604 mvc __PT_R8(64,%r11),0(%r14) 605 - stg %r10,__PT_ORIG_GPR2(%r11) # store last break to orig_gpr2 605 + GET_LC %r2 606 + mvc __PT_ORIG_GPR2(8,%r11),__LC_PGM_LAST_BREAK(%r2) 606 607 xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) 607 608 lgr %r2,%r11 # pass pointer to pt_regs 608 609 jg kernel_stack_invalid
+2
arch/s390/pci/pci_clp.c
··· 428 428 return; 429 429 } 430 430 zdev = zpci_create_device(entry->fid, entry->fh, entry->config_state); 431 + if (IS_ERR(zdev)) 432 + return; 431 433 list_add_tail(&zdev->entry, scan_list); 432 434 } 433 435
+2
arch/um/include/asm/uaccess.h
··· 55 55 goto err_label; \ 56 56 } \ 57 57 *((type *)dst) = get_unaligned((type *)(src)); \ 58 + barrier(); \ 58 59 current->thread.segv_continue = NULL; \ 59 60 } while (0) 60 61 ··· 67 66 if (__faulted) \ 68 67 goto err_label; \ 69 68 put_unaligned(*((type *)src), (type *)(dst)); \ 69 + barrier(); \ 70 70 current->thread.segv_continue = NULL; \ 71 71 } while (0) 72 72
+13 -13
arch/um/kernel/trap.c
··· 225 225 panic("Failed to sync kernel TLBs: %d", err); 226 226 goto out; 227 227 } 228 - else if (current->mm == NULL) { 229 - if (current->pagefault_disabled) { 230 - if (!mc) { 231 - show_regs(container_of(regs, struct pt_regs, regs)); 232 - panic("Segfault with pagefaults disabled but no mcontext"); 233 - } 234 - if (!current->thread.segv_continue) { 235 - show_regs(container_of(regs, struct pt_regs, regs)); 236 - panic("Segfault without recovery target"); 237 - } 238 - mc_set_rip(mc, current->thread.segv_continue); 239 - current->thread.segv_continue = NULL; 240 - goto out; 228 + else if (current->pagefault_disabled) { 229 + if (!mc) { 230 + show_regs(container_of(regs, struct pt_regs, regs)); 231 + panic("Segfault with pagefaults disabled but no mcontext"); 241 232 } 233 + if (!current->thread.segv_continue) { 234 + show_regs(container_of(regs, struct pt_regs, regs)); 235 + panic("Segfault without recovery target"); 236 + } 237 + mc_set_rip(mc, current->thread.segv_continue); 238 + current->thread.segv_continue = NULL; 239 + goto out; 240 + } 241 + else if (current->mm == NULL) { 242 242 show_regs(container_of(regs, struct pt_regs, regs)); 243 243 panic("Segfault with no mm"); 244 244 }
+1 -4
arch/x86/boot/compressed/mem.c
··· 34 34 35 35 void arch_accept_memory(phys_addr_t start, phys_addr_t end) 36 36 { 37 - static bool sevsnp; 38 - 39 37 /* Platform-specific memory-acceptance call goes here */ 40 38 if (early_is_tdx_guest()) { 41 39 if (!tdx_accept_memory(start, end)) 42 40 panic("TDX: Failed to accept memory\n"); 43 - } else if (sevsnp || (sev_get_status() & MSR_AMD64_SEV_SNP_ENABLED)) { 44 - sevsnp = true; 41 + } else if (early_is_sevsnp_guest()) { 45 42 snp_accept_memory(start, end); 46 43 } else { 47 44 error("Cannot accept memory: unknown platform\n");
+40
arch/x86/boot/compressed/sev.c
··· 645 645 646 646 sev_verify_cbit(top_level_pgt); 647 647 } 648 + 649 + bool early_is_sevsnp_guest(void) 650 + { 651 + static bool sevsnp; 652 + 653 + if (sevsnp) 654 + return true; 655 + 656 + if (!(sev_get_status() & MSR_AMD64_SEV_SNP_ENABLED)) 657 + return false; 658 + 659 + sevsnp = true; 660 + 661 + if (!snp_vmpl) { 662 + unsigned int eax, ebx, ecx, edx; 663 + 664 + /* 665 + * CPUID Fn8000_001F_EAX[28] - SVSM support 666 + */ 667 + eax = 0x8000001f; 668 + ecx = 0; 669 + native_cpuid(&eax, &ebx, &ecx, &edx); 670 + if (eax & BIT(28)) { 671 + struct msr m; 672 + 673 + /* Obtain the address of the calling area to use */ 674 + boot_rdmsr(MSR_SVSM_CAA, &m); 675 + boot_svsm_caa = (void *)m.q; 676 + boot_svsm_caa_pa = m.q; 677 + 678 + /* 679 + * The real VMPL level cannot be discovered, but the 680 + * memory acceptance routines make no use of that so 681 + * any non-zero value suffices here. 682 + */ 683 + snp_vmpl = U8_MAX; 684 + } 685 + } 686 + return true; 687 + }
+2
arch/x86/boot/compressed/sev.h
··· 13 13 bool sev_snp_enabled(void); 14 14 void snp_accept_memory(phys_addr_t start, phys_addr_t end); 15 15 u64 sev_get_status(void); 16 + bool early_is_sevsnp_guest(void); 16 17 17 18 #else 18 19 19 20 static inline bool sev_snp_enabled(void) { return false; } 20 21 static inline void snp_accept_memory(phys_addr_t start, phys_addr_t end) { } 21 22 static inline u64 sev_get_status(void) { return 0; } 23 + static inline bool early_is_sevsnp_guest(void) { return false; } 22 24 23 25 #endif 24 26
+1 -1
arch/x86/events/core.c
··· 754 754 } 755 755 } 756 756 757 - static inline int is_x86_event(struct perf_event *event) 757 + int is_x86_event(struct perf_event *event) 758 758 { 759 759 int i; 760 760
+1 -1
arch/x86/events/intel/core.c
··· 4395 4395 arr[pebs_enable] = (struct perf_guest_switch_msr){ 4396 4396 .msr = MSR_IA32_PEBS_ENABLE, 4397 4397 .host = cpuc->pebs_enabled & ~cpuc->intel_ctrl_guest_mask, 4398 - .guest = pebs_mask & ~cpuc->intel_ctrl_host_mask, 4398 + .guest = pebs_mask & ~cpuc->intel_ctrl_host_mask & kvm_pmu->pebs_enable, 4399 4399 }; 4400 4400 4401 4401 if (arr[pebs_enable].host) {
+19 -2
arch/x86/events/intel/ds.c
··· 2379 2379 */ 2380 2380 intel_pmu_save_and_restart_reload(event, count); 2381 2381 } 2382 - } else 2383 - intel_pmu_save_and_restart(event); 2382 + } else { 2383 + /* 2384 + * For a non-precise event, it's possible the 2385 + * counters-snapshotting records a positive value for the 2386 + * overflowed event. Then the HW auto-reload mechanism 2387 + * reset the counter to 0 immediately, because the 2388 + * pebs_event_reset is cleared if the PERF_X86_EVENT_AUTO_RELOAD 2389 + * is not set. The counter backwards may be observed in a 2390 + * PMI handler. 2391 + * 2392 + * Since the event value has been updated when processing the 2393 + * counters-snapshotting record, only needs to set the new 2394 + * period for the counter. 2395 + */ 2396 + if (is_pebs_counter_event_group(event)) 2397 + static_call(x86_pmu_set_period)(event); 2398 + else 2399 + intel_pmu_save_and_restart(event); 2400 + } 2384 2401 } 2385 2402 2386 2403 static __always_inline void
+9 -2
arch/x86/events/perf_event.h
··· 110 110 return is_metric_event(event) || is_slots_event(event); 111 111 } 112 112 113 + int is_x86_event(struct perf_event *event); 114 + 115 + static inline bool check_leader_group(struct perf_event *leader, int flags) 116 + { 117 + return is_x86_event(leader) ? !!(leader->hw.flags & flags) : false; 118 + } 119 + 113 120 static inline bool is_branch_counters_group(struct perf_event *event) 114 121 { 115 - return event->group_leader->hw.flags & PERF_X86_EVENT_BRANCH_COUNTERS; 122 + return check_leader_group(event->group_leader, PERF_X86_EVENT_BRANCH_COUNTERS); 116 123 } 117 124 118 125 static inline bool is_pebs_counter_event_group(struct perf_event *event) 119 126 { 120 - return event->group_leader->hw.flags & PERF_X86_EVENT_PEBS_CNTR; 127 + return check_leader_group(event->group_leader, PERF_X86_EVENT_PEBS_CNTR); 121 128 } 122 129 123 130 struct amd_nb {
+1 -1
arch/x86/um/shared/sysdep/faultinfo_32.h
··· 31 31 32 32 #define ___backtrack_faulted(_faulted) \ 33 33 asm volatile ( \ 34 - "mov $0, %0\n" \ 35 34 "movl $__get_kernel_nofault_faulted_%=,%1\n" \ 35 + "mov $0, %0\n" \ 36 36 "jmp _end_%=\n" \ 37 37 "__get_kernel_nofault_faulted_%=:\n" \ 38 38 "mov $1, %0;" \
+1 -1
arch/x86/um/shared/sysdep/faultinfo_64.h
··· 31 31 32 32 #define ___backtrack_faulted(_faulted) \ 33 33 asm volatile ( \ 34 - "mov $0, %0\n" \ 35 34 "movq $__get_kernel_nofault_faulted_%=,%1\n" \ 35 + "mov $0, %0\n" \ 36 36 "jmp _end_%=\n" \ 37 37 "__get_kernel_nofault_faulted_%=:\n" \ 38 38 "mov $1, %0;" \
+2 -2
drivers/accel/ivpu/ivpu_fw.c
··· 544 544 boot_params->d0i3_entry_vpu_ts); 545 545 ivpu_dbg(vdev, FW_BOOT, "boot_params.system_time_us = %llu\n", 546 546 boot_params->system_time_us); 547 - ivpu_dbg(vdev, FW_BOOT, "boot_params.power_profile = %u\n", 547 + ivpu_dbg(vdev, FW_BOOT, "boot_params.power_profile = 0x%x\n", 548 548 boot_params->power_profile); 549 549 } 550 550 ··· 646 646 boot_params->d0i3_residency_time_us = 0; 647 647 boot_params->d0i3_entry_vpu_ts = 0; 648 648 if (IVPU_WA(disable_d0i2)) 649 - boot_params->power_profile = 1; 649 + boot_params->power_profile |= BIT(1); 650 650 651 651 boot_params->system_time_us = ktime_to_us(ktime_get_real()); 652 652 wmb(); /* Flush WC buffers after writing bootparams */
+1 -1
drivers/accel/ivpu/ivpu_hw_btrs.h
··· 14 14 #define PLL_PROFILING_FREQ_DEFAULT 38400000 15 15 #define PLL_PROFILING_FREQ_HIGH 400000000 16 16 17 - #define DCT_DEFAULT_ACTIVE_PERCENT 15u 17 + #define DCT_DEFAULT_ACTIVE_PERCENT 30u 18 18 #define DCT_PERIOD_US 35300u 19 19 20 20 int ivpu_hw_btrs_info_init(struct ivpu_device *vdev);
+10 -8
drivers/accel/ivpu/ivpu_pm.c
··· 428 428 active_us = (DCT_PERIOD_US * active_percent) / 100; 429 429 inactive_us = DCT_PERIOD_US - active_us; 430 430 431 + vdev->pm->dct_active_percent = active_percent; 432 + 433 + ivpu_dbg(vdev, PM, "DCT requested %u%% (D0: %uus, D0i2: %uus)\n", 434 + active_percent, active_us, inactive_us); 435 + 431 436 ret = ivpu_jsm_dct_enable(vdev, active_us, inactive_us); 432 437 if (ret) { 433 438 ivpu_err_ratelimited(vdev, "Failed to enable DCT: %d\n", ret); 434 439 return ret; 435 440 } 436 441 437 - vdev->pm->dct_active_percent = active_percent; 438 - 439 - ivpu_dbg(vdev, PM, "DCT set to %u%% (D0: %uus, D0i2: %uus)\n", 440 - active_percent, active_us, inactive_us); 441 442 return 0; 442 443 } 443 444 ··· 446 445 { 447 446 int ret; 448 447 448 + vdev->pm->dct_active_percent = 0; 449 + 450 + ivpu_dbg(vdev, PM, "DCT requested to be disabled\n"); 451 + 449 452 ret = ivpu_jsm_dct_disable(vdev); 450 453 if (ret) { 451 454 ivpu_err_ratelimited(vdev, "Failed to disable DCT: %d\n", ret); 452 455 return ret; 453 456 } 454 457 455 - vdev->pm->dct_active_percent = 0; 456 - 457 - ivpu_dbg(vdev, PM, "DCT disabled\n"); 458 458 return 0; 459 459 } 460 460 ··· 468 466 if (ivpu_hw_btrs_dct_get_request(vdev, &enable)) 469 467 return; 470 468 471 - if (vdev->pm->dct_active_percent) 469 + if (enable) 472 470 ret = ivpu_pm_dct_enable(vdev, DCT_DEFAULT_ACTIVE_PERCENT); 473 471 else 474 472 ret = ivpu_pm_dct_disable(vdev);
+43 -19
drivers/block/ublk_drv.c
··· 201 201 static void ublk_stop_dev_unlocked(struct ublk_device *ub); 202 202 static void ublk_abort_queue(struct ublk_device *ub, struct ublk_queue *ubq); 203 203 static inline struct request *__ublk_check_and_get_req(struct ublk_device *ub, 204 - struct ublk_queue *ubq, int tag, size_t offset); 204 + const struct ublk_queue *ubq, int tag, size_t offset); 205 205 static inline unsigned int ublk_req_build_flags(struct request *req); 206 206 static inline struct ublksrv_io_desc *ublk_get_iod(struct ublk_queue *ubq, 207 207 int tag); 208 - static inline bool ublk_dev_is_user_copy(const struct ublk_device *ub) 209 - { 210 - return ub->dev_info.flags & (UBLK_F_USER_COPY | UBLK_F_SUPPORT_ZERO_COPY); 211 - } 212 - 213 208 static inline bool ublk_dev_is_zoned(const struct ublk_device *ub) 214 209 { 215 210 return ub->dev_info.flags & UBLK_F_ZONED; ··· 604 609 ublk_dev_param_zoned_apply(ub); 605 610 } 606 611 612 + static inline bool ublk_support_zero_copy(const struct ublk_queue *ubq) 613 + { 614 + return ubq->flags & UBLK_F_SUPPORT_ZERO_COPY; 615 + } 616 + 607 617 static inline bool ublk_support_user_copy(const struct ublk_queue *ubq) 608 618 { 609 - return ubq->flags & (UBLK_F_USER_COPY | UBLK_F_SUPPORT_ZERO_COPY); 619 + return ubq->flags & UBLK_F_USER_COPY; 610 620 } 611 621 612 622 static inline bool ublk_need_map_io(const struct ublk_queue *ubq) 613 623 { 614 - return !ublk_support_user_copy(ubq); 624 + return !ublk_support_user_copy(ubq) && !ublk_support_zero_copy(ubq); 615 625 } 616 626 617 627 static inline bool ublk_need_req_ref(const struct ublk_queue *ubq) ··· 624 624 /* 625 625 * read()/write() is involved in user copy, so request reference 626 626 * has to be grabbed 627 + * 628 + * for zero copy, request buffer need to be registered to io_uring 629 + * buffer table, so reference is needed 627 630 */ 628 - return ublk_support_user_copy(ubq); 631 + return ublk_support_user_copy(ubq) || ublk_support_zero_copy(ubq); 629 632 } 630 633 631 634 static inline void ublk_init_req_ref(const struct ublk_queue *ubq, ··· 1949 1946 } 1950 1947 1951 1948 static int ublk_register_io_buf(struct io_uring_cmd *cmd, 1952 - struct ublk_queue *ubq, unsigned int tag, 1949 + const struct ublk_queue *ubq, unsigned int tag, 1953 1950 unsigned int index, unsigned int issue_flags) 1954 1951 { 1955 1952 struct ublk_device *ub = cmd->file->private_data; 1953 + const struct ublk_io *io = &ubq->ios[tag]; 1956 1954 struct request *req; 1957 1955 int ret; 1956 + 1957 + if (!ublk_support_zero_copy(ubq)) 1958 + return -EINVAL; 1959 + 1960 + if (!(io->flags & UBLK_IO_FLAG_OWNED_BY_SRV)) 1961 + return -EINVAL; 1958 1962 1959 1963 req = __ublk_check_and_get_req(ub, ubq, tag, 0); 1960 1964 if (!req) ··· 1978 1968 } 1979 1969 1980 1970 static int ublk_unregister_io_buf(struct io_uring_cmd *cmd, 1971 + const struct ublk_queue *ubq, unsigned int tag, 1981 1972 unsigned int index, unsigned int issue_flags) 1982 1973 { 1974 + const struct ublk_io *io = &ubq->ios[tag]; 1975 + 1976 + if (!ublk_support_zero_copy(ubq)) 1977 + return -EINVAL; 1978 + 1979 + if (!(io->flags & UBLK_IO_FLAG_OWNED_BY_SRV)) 1980 + return -EINVAL; 1981 + 1983 1982 return io_buffer_unregister_bvec(cmd, index, issue_flags); 1984 1983 } 1985 1984 ··· 2092 2073 case UBLK_IO_REGISTER_IO_BUF: 2093 2074 return ublk_register_io_buf(cmd, ubq, tag, ub_cmd->addr, issue_flags); 2094 2075 case UBLK_IO_UNREGISTER_IO_BUF: 2095 - return ublk_unregister_io_buf(cmd, ub_cmd->addr, issue_flags); 2076 + return ublk_unregister_io_buf(cmd, ubq, tag, ub_cmd->addr, issue_flags); 2096 2077 case UBLK_IO_FETCH_REQ: 2097 2078 ret = ublk_fetch(cmd, ubq, io, ub_cmd->addr); 2098 2079 if (ret) ··· 2144 2125 } 2145 2126 2146 2127 static inline struct request *__ublk_check_and_get_req(struct ublk_device *ub, 2147 - struct ublk_queue *ubq, int tag, size_t offset) 2128 + const struct ublk_queue *ubq, int tag, size_t offset) 2148 2129 { 2149 2130 struct request *req; 2150 - 2151 - if (!ublk_need_req_ref(ubq)) 2152 - return NULL; 2153 2131 2154 2132 req = blk_mq_tag_to_rq(ub->tag_set.tags[ubq->q_id], tag); 2155 2133 if (!req) ··· 2260 2244 ubq = ublk_get_queue(ub, q_id); 2261 2245 if (!ubq) 2262 2246 return ERR_PTR(-EINVAL); 2247 + 2248 + if (!ublk_support_user_copy(ubq)) 2249 + return ERR_PTR(-EACCES); 2263 2250 2264 2251 if (tag >= ubq->q_depth) 2265 2252 return ERR_PTR(-EINVAL); ··· 2802 2783 ub->dev_info.flags |= UBLK_F_CMD_IOCTL_ENCODE | 2803 2784 UBLK_F_URING_CMD_COMP_IN_TASK; 2804 2785 2805 - /* GET_DATA isn't needed any more with USER_COPY */ 2806 - if (ublk_dev_is_user_copy(ub)) 2786 + /* GET_DATA isn't needed any more with USER_COPY or ZERO COPY */ 2787 + if (ub->dev_info.flags & (UBLK_F_USER_COPY | UBLK_F_SUPPORT_ZERO_COPY)) 2807 2788 ub->dev_info.flags &= ~UBLK_F_NEED_GET_DATA; 2808 2789 2809 - /* Zoned storage support requires user copy feature */ 2790 + /* 2791 + * Zoned storage support requires reuse `ublksrv_io_cmd->addr` for 2792 + * returning write_append_lba, which is only allowed in case of 2793 + * user copy or zero copy 2794 + */ 2810 2795 if (ublk_dev_is_zoned(ub) && 2811 - (!IS_ENABLED(CONFIG_BLK_DEV_ZONED) || !ublk_dev_is_user_copy(ub))) { 2796 + (!IS_ENABLED(CONFIG_BLK_DEV_ZONED) || !(ub->dev_info.flags & 2797 + (UBLK_F_USER_COPY | UBLK_F_SUPPORT_ZERO_COPY)))) { 2812 2798 ret = -EINVAL; 2813 2799 goto out_free_dev_number; 2814 2800 }
+13 -2
drivers/cpufreq/acpi-cpufreq.c
··· 909 909 if (perf->states[0].core_frequency * 1000 != freq_table[0].frequency) 910 910 pr_warn(FW_WARN "P-state 0 is not max freq\n"); 911 911 912 - if (acpi_cpufreq_driver.set_boost) 913 - policy->boost_supported = true; 912 + if (acpi_cpufreq_driver.set_boost) { 913 + if (policy->boost_supported) { 914 + /* 915 + * The firmware may have altered boost state while the 916 + * CPU was offline (for example during a suspend-resume 917 + * cycle). 918 + */ 919 + if (policy->boost_enabled != boost_state(cpu)) 920 + set_boost(policy, policy->boost_enabled); 921 + } else { 922 + policy->boost_supported = true; 923 + } 924 + } 914 925 915 926 return result; 916 927
+14 -8
drivers/cpufreq/cpufreq.c
··· 536 536 EXPORT_SYMBOL_GPL(cpufreq_disable_fast_switch); 537 537 538 538 static unsigned int __resolve_freq(struct cpufreq_policy *policy, 539 - unsigned int target_freq, unsigned int relation) 539 + unsigned int target_freq, 540 + unsigned int min, unsigned int max, 541 + unsigned int relation) 540 542 { 541 543 unsigned int idx; 544 + 545 + target_freq = clamp_val(target_freq, min, max); 542 546 543 547 if (!policy->freq_table) 544 548 return target_freq; 545 549 546 - idx = cpufreq_frequency_table_target(policy, target_freq, relation); 550 + idx = cpufreq_frequency_table_target(policy, target_freq, min, max, relation); 547 551 policy->cached_resolved_idx = idx; 548 552 policy->cached_target_freq = target_freq; 549 553 return policy->freq_table[idx].frequency; ··· 581 577 if (unlikely(min > max)) 582 578 min = max; 583 579 584 - return __resolve_freq(policy, clamp_val(target_freq, min, max), 585 - CPUFREQ_RELATION_LE); 580 + return __resolve_freq(policy, target_freq, min, max, CPUFREQ_RELATION_LE); 586 581 } 587 582 EXPORT_SYMBOL_GPL(cpufreq_driver_resolve_freq); 588 583 ··· 2400 2397 if (cpufreq_disabled()) 2401 2398 return -ENODEV; 2402 2399 2403 - target_freq = clamp_val(target_freq, policy->min, policy->max); 2404 - target_freq = __resolve_freq(policy, target_freq, relation); 2400 + target_freq = __resolve_freq(policy, target_freq, policy->min, 2401 + policy->max, relation); 2405 2402 2406 2403 pr_debug("target for CPU %u: %u kHz, relation %u, requested %u kHz\n", 2407 2404 policy->cpu, target_freq, relation, old_target_freq); ··· 2730 2727 * compiler optimizations around them because they may be accessed 2731 2728 * concurrently by cpufreq_driver_resolve_freq() during the update. 2732 2729 */ 2733 - WRITE_ONCE(policy->max, __resolve_freq(policy, new_data.max, CPUFREQ_RELATION_H)); 2734 - new_data.min = __resolve_freq(policy, new_data.min, CPUFREQ_RELATION_L); 2730 + WRITE_ONCE(policy->max, __resolve_freq(policy, new_data.max, 2731 + new_data.min, new_data.max, 2732 + CPUFREQ_RELATION_H)); 2733 + new_data.min = __resolve_freq(policy, new_data.min, new_data.min, 2734 + new_data.max, CPUFREQ_RELATION_L); 2735 2735 WRITE_ONCE(policy->min, new_data.min > policy->max ? policy->max : new_data.min); 2736 2736 2737 2737 trace_cpu_frequency_limits(policy);
+2 -1
drivers/cpufreq/cpufreq_ondemand.c
··· 76 76 return freq_next; 77 77 } 78 78 79 - index = cpufreq_frequency_table_target(policy, freq_next, relation); 79 + index = cpufreq_frequency_table_target(policy, freq_next, policy->min, 80 + policy->max, relation); 80 81 freq_req = freq_table[index].frequency; 81 82 freq_reduc = freq_req * od_tuners->powersave_bias / 1000; 82 83 freq_avg = freq_req - freq_reduc;
+3 -3
drivers/cpufreq/freq_table.c
··· 115 115 EXPORT_SYMBOL_GPL(cpufreq_generic_frequency_table_verify); 116 116 117 117 int cpufreq_table_index_unsorted(struct cpufreq_policy *policy, 118 - unsigned int target_freq, 119 - unsigned int relation) 118 + unsigned int target_freq, unsigned int min, 119 + unsigned int max, unsigned int relation) 120 120 { 121 121 struct cpufreq_frequency_table optimal = { 122 122 .driver_data = ~0, ··· 147 147 cpufreq_for_each_valid_entry_idx(pos, table, i) { 148 148 freq = pos->frequency; 149 149 150 - if ((freq < policy->min) || (freq > policy->max)) 150 + if (freq < min || freq > max) 151 151 continue; 152 152 if (freq == target_freq) { 153 153 optimal.driver_data = i;
+3
drivers/cpufreq/intel_pstate.c
··· 598 598 { 599 599 u64 misc_en; 600 600 601 + if (!cpu_feature_enabled(X86_FEATURE_IDA)) 602 + return true; 603 + 601 604 rdmsrl(MSR_IA32_MISC_ENABLE, misc_en); 602 605 603 606 return !!(misc_en & MSR_IA32_MISC_ENABLE_TURBO_DISABLE);
+5 -4
drivers/edac/altera_edac.c
··· 99 99 if (status & priv->ecc_stat_ce_mask) { 100 100 regmap_read(drvdata->mc_vbase, priv->ecc_saddr_offset, 101 101 &err_addr); 102 - if (priv->ecc_uecnt_offset) 102 + if (priv->ecc_cecnt_offset) 103 103 regmap_read(drvdata->mc_vbase, priv->ecc_cecnt_offset, 104 104 &err_count); 105 105 edac_mc_handle_error(HW_EVENT_ERR_CORRECTED, mci, err_count, ··· 1005 1005 } 1006 1006 } 1007 1007 1008 - /* Interrupt mode set to every SBERR */ 1009 - regmap_write(ecc_mgr_map, ALTR_A10_ECC_INTMODE_OFST, 1010 - ALTR_A10_ECC_INTMODE); 1011 1008 /* Enable ECC */ 1012 1009 ecc_set_bits(ecc_ctrl_en_mask, (ecc_block_base + 1013 1010 ALTR_A10_ECC_CTRL_OFST)); ··· 2123 2126 "Unable to get syscon altr,sysmgr-syscon\n"); 2124 2127 return PTR_ERR(edac->ecc_mgr_map); 2125 2128 } 2129 + 2130 + /* Set irq mask for DDR SBE to avoid any pending irq before registration */ 2131 + regmap_write(edac->ecc_mgr_map, A10_SYSMGR_ECC_INTMASK_SET_OFST, 2132 + (A10_SYSMGR_ECC_INTMASK_SDMMCB | A10_SYSMGR_ECC_INTMASK_DDR0)); 2126 2133 2127 2134 edac->irq_chip.name = pdev->dev.of_node->name; 2128 2135 edac->irq_chip.irq_mask = a10_eccmgr_irq_mask;
+2
drivers/edac/altera_edac.h
··· 249 249 #define A10_SYSMGR_ECC_INTMASK_SET_OFST 0x94 250 250 #define A10_SYSMGR_ECC_INTMASK_CLR_OFST 0x98 251 251 #define A10_SYSMGR_ECC_INTMASK_OCRAM BIT(1) 252 + #define A10_SYSMGR_ECC_INTMASK_SDMMCB BIT(16) 253 + #define A10_SYSMGR_ECC_INTMASK_DDR0 BIT(17) 252 254 253 255 #define A10_SYSMGR_ECC_INTSTAT_SERR_OFST 0x9C 254 256 #define A10_SYSMGR_ECC_INTSTAT_DERR_OFST 0xA0
+2 -1
drivers/firmware/arm_ffa/driver.c
··· 299 299 import_uuid(&buf->uuid, (u8 *)&rx_buf->uuid); 300 300 } 301 301 302 - ffa_rx_release(); 302 + if (!(flags & PARTITION_INFO_GET_RETURN_COUNT_ONLY)) 303 + ffa_rx_release(); 303 304 304 305 mutex_unlock(&drv_info->rx_lock); 305 306
+3
drivers/firmware/arm_scmi/bus.c
··· 255 255 if (!dev) 256 256 return NULL; 257 257 258 + /* Drop the refcnt bumped implicitly by device_find_child */ 259 + put_device(dev); 260 + 258 261 return to_scmi_dev(dev); 259 262 } 260 263
+8 -5
drivers/firmware/arm_scmi/driver.c
··· 1248 1248 } 1249 1249 1250 1250 static bool scmi_xfer_done_no_timeout(struct scmi_chan_info *cinfo, 1251 - struct scmi_xfer *xfer, ktime_t stop) 1251 + struct scmi_xfer *xfer, ktime_t stop, 1252 + bool *ooo) 1252 1253 { 1253 1254 struct scmi_info *info = handle_to_scmi_info(cinfo->handle); 1254 1255 ··· 1258 1257 * in case of out-of-order receptions of delayed responses 1259 1258 */ 1260 1259 return info->desc->ops->poll_done(cinfo, xfer) || 1261 - try_wait_for_completion(&xfer->done) || 1260 + (*ooo = try_wait_for_completion(&xfer->done)) || 1262 1261 ktime_after(ktime_get(), stop); 1263 1262 } 1264 1263 ··· 1275 1274 * itself to support synchronous commands replies. 1276 1275 */ 1277 1276 if (!desc->sync_cmds_completed_on_ret) { 1277 + bool ooo = false; 1278 + 1278 1279 /* 1279 1280 * Poll on xfer using transport provided .poll_done(); 1280 1281 * assumes no completion interrupt was available. 1281 1282 */ 1282 1283 ktime_t stop = ktime_add_ms(ktime_get(), timeout_ms); 1283 1284 1284 - spin_until_cond(scmi_xfer_done_no_timeout(cinfo, 1285 - xfer, stop)); 1286 - if (ktime_after(ktime_get(), stop)) { 1285 + spin_until_cond(scmi_xfer_done_no_timeout(cinfo, xfer, 1286 + stop, &ooo)); 1287 + if (!ooo && !info->desc->ops->poll_done(cinfo, xfer)) { 1287 1288 dev_err(dev, 1288 1289 "timed out in resp(caller: %pS) - polling\n", 1289 1290 (void *)_RET_IP_);
+1 -4
drivers/firmware/cirrus/Kconfig
··· 6 6 7 7 config FW_CS_DSP_KUNIT_TEST_UTILS 8 8 tristate 9 - depends on KUNIT && REGMAP 10 - select FW_CS_DSP 11 9 12 10 config FW_CS_DSP_KUNIT_TEST 13 11 tristate "KUnit tests for Cirrus Logic cs_dsp" if !KUNIT_ALL_TESTS 14 - depends on KUNIT && REGMAP 12 + depends on KUNIT && REGMAP && FW_CS_DSP 15 13 default KUNIT_ALL_TESTS 16 - select FW_CS_DSP 17 14 select FW_CS_DSP_KUNIT_TEST_UTILS 18 15 help 19 16 This builds KUnit tests for cs_dsp.
+1 -1
drivers/gpu/drm/Kconfig
··· 188 188 bool "Enable refcount backtrace history in the DP MST helpers" 189 189 depends on STACKTRACE_SUPPORT 190 190 select STACKDEPOT 191 - depends on DRM_KMS_HELPER 191 + select DRM_KMS_HELPER 192 192 depends on DEBUG_KERNEL 193 193 depends on EXPERT 194 194 help
+14 -13
drivers/gpu/drm/adp/adp_drv.c
··· 121 121 dma_addr_t mask_iova; 122 122 int be_irq; 123 123 int fe_irq; 124 - spinlock_t irq_lock; 125 124 struct drm_pending_vblank_event *event; 126 125 }; 127 126 ··· 287 288 writel(BIT(0), adp->be + ADBE_BLEND_EN3); 288 289 writel(BIT(0), adp->be + ADBE_BLEND_BYPASS); 289 290 writel(BIT(0), adp->be + ADBE_BLEND_EN4); 291 + drm_crtc_vblank_on(crtc); 290 292 } 291 293 292 294 static void adp_crtc_atomic_disable(struct drm_crtc *crtc, ··· 310 310 struct drm_atomic_state *state) 311 311 { 312 312 u32 frame_num = 1; 313 + unsigned long flags; 313 314 struct adp_drv_private *adp = crtc_to_adp(crtc); 314 315 struct drm_crtc_state *new_state = drm_atomic_get_new_crtc_state(state, crtc); 315 316 u64 new_size = ALIGN(new_state->mode.hdisplay * ··· 331 330 } 332 331 writel(ADBE_FIFO_SYNC | frame_num, adp->be + ADBE_FIFO); 333 332 //FIXME: use adbe flush interrupt 334 - spin_lock_irq(&crtc->dev->event_lock); 335 333 if (crtc->state->event) { 336 - drm_crtc_vblank_get(crtc); 337 - adp->event = crtc->state->event; 334 + struct drm_pending_vblank_event *event = crtc->state->event; 335 + 336 + crtc->state->event = NULL; 337 + spin_lock_irqsave(&crtc->dev->event_lock, flags); 338 + 339 + if (drm_crtc_vblank_get(crtc) != 0) 340 + drm_crtc_send_vblank_event(crtc, event); 341 + else 342 + adp->event = event; 343 + 344 + spin_unlock_irqrestore(&crtc->dev->event_lock, flags); 338 345 } 339 - crtc->state->event = NULL; 340 - spin_unlock_irq(&crtc->dev->event_lock); 341 346 } 342 347 343 348 static const struct drm_crtc_funcs adp_crtc_funcs = { ··· 489 482 u32 int_status; 490 483 u32 int_ctl; 491 484 492 - spin_lock(&adp->irq_lock); 493 - 494 485 int_status = readl(adp->fe + ADP_INT_STATUS); 495 486 if (int_status & ADP_INT_STATUS_VBLANK) { 496 487 drm_crtc_handle_vblank(&adp->crtc); ··· 506 501 507 502 writel(int_status, adp->fe + ADP_INT_STATUS); 508 503 509 - spin_unlock(&adp->irq_lock); 510 504 511 505 return IRQ_HANDLED; 512 506 } ··· 516 512 struct adp_drv_private *adp = to_adp(drm); 517 513 int err; 518 514 519 - adp_disable_vblank(adp); 520 - writel(ADP_CTRL_FIFO_ON | ADP_CTRL_VBLANK_ON, adp->fe + ADP_CTRL); 515 + writel(ADP_CTRL_FIFO_ON, adp->fe + ADP_CTRL); 521 516 522 517 adp->next_bridge = drmm_of_get_bridge(&adp->drm, dev->of_node, 0, 0); 523 518 if (IS_ERR(adp->next_bridge)) { ··· 569 566 adp = devm_drm_dev_alloc(&pdev->dev, &adp_driver, struct adp_drv_private, drm); 570 567 if (IS_ERR(adp)) 571 568 return PTR_ERR(adp); 572 - 573 - spin_lock_init(&adp->irq_lock); 574 569 575 570 dev_set_drvdata(&pdev->dev, &adp->drm); 576 571
+5
drivers/gpu/drm/amd/amdgpu/amdgpu_dma_buf.c
··· 199 199 break; 200 200 201 201 case TTM_PL_VRAM: 202 + /* XGMI-accessible memory should never be DMA-mapped */ 203 + if (WARN_ON(amdgpu_dmabuf_is_xgmi_accessible( 204 + dma_buf_attach_adev(attach), bo))) 205 + return ERR_PTR(-EINVAL); 206 + 202 207 r = amdgpu_vram_mgr_alloc_sgt(adev, bo->tbo.resource, 0, 203 208 bo->tbo.base.size, attach->dev, 204 209 dir, &sgt);
+1 -1
drivers/gpu/drm/amd/amdgpu/nbio_v7_11.c
··· 360 360 *flags |= AMD_CG_SUPPORT_BIF_LS; 361 361 } 362 362 363 - #define MMIO_REG_HOLE_OFFSET (0x80000 - PAGE_SIZE) 363 + #define MMIO_REG_HOLE_OFFSET 0x44000 364 364 365 365 static void nbio_v7_11_set_reg_remap(struct amdgpu_device *adev) 366 366 {
+54
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
··· 503 503 } 504 504 505 505 /** 506 + * vcn_v5_0_1_pause_dpg_mode - VCN pause with dpg mode 507 + * 508 + * @vinst: VCN instance 509 + * @new_state: pause state 510 + * 511 + * Pause dpg mode for VCN block 512 + */ 513 + static int vcn_v5_0_1_pause_dpg_mode(struct amdgpu_vcn_inst *vinst, 514 + struct dpg_pause_state *new_state) 515 + { 516 + struct amdgpu_device *adev = vinst->adev; 517 + uint32_t reg_data = 0; 518 + int vcn_inst; 519 + 520 + vcn_inst = GET_INST(VCN, vinst->inst); 521 + 522 + /* pause/unpause if state is changed */ 523 + if (vinst->pause_state.fw_based != new_state->fw_based) { 524 + DRM_DEV_DEBUG(adev->dev, "dpg pause state changed %d -> %d %s\n", 525 + vinst->pause_state.fw_based, new_state->fw_based, 526 + new_state->fw_based ? "VCN_DPG_STATE__PAUSE" : "VCN_DPG_STATE__UNPAUSE"); 527 + reg_data = RREG32_SOC15(VCN, vcn_inst, regUVD_DPG_PAUSE) & 528 + (~UVD_DPG_PAUSE__NJ_PAUSE_DPG_ACK_MASK); 529 + 530 + if (new_state->fw_based == VCN_DPG_STATE__PAUSE) { 531 + /* pause DPG */ 532 + reg_data |= UVD_DPG_PAUSE__NJ_PAUSE_DPG_REQ_MASK; 533 + WREG32_SOC15(VCN, vcn_inst, regUVD_DPG_PAUSE, reg_data); 534 + 535 + /* wait for ACK */ 536 + SOC15_WAIT_ON_RREG(VCN, vcn_inst, regUVD_DPG_PAUSE, 537 + UVD_DPG_PAUSE__NJ_PAUSE_DPG_ACK_MASK, 538 + UVD_DPG_PAUSE__NJ_PAUSE_DPG_ACK_MASK); 539 + } else { 540 + /* unpause DPG, no need to wait */ 541 + reg_data &= ~UVD_DPG_PAUSE__NJ_PAUSE_DPG_REQ_MASK; 542 + WREG32_SOC15(VCN, vcn_inst, regUVD_DPG_PAUSE, reg_data); 543 + } 544 + vinst->pause_state.fw_based = new_state->fw_based; 545 + } 546 + 547 + return 0; 548 + } 549 + 550 + 551 + /** 506 552 * vcn_v5_0_1_start_dpg_mode - VCN start with dpg mode 507 553 * 508 554 * @vinst: VCN instance ··· 564 518 volatile struct amdgpu_vcn5_fw_shared *fw_shared = 565 519 adev->vcn.inst[inst_idx].fw_shared.cpu_addr; 566 520 struct amdgpu_ring *ring; 521 + struct dpg_pause_state state = {.fw_based = VCN_DPG_STATE__PAUSE}; 567 522 int vcn_inst; 568 523 uint32_t tmp; 569 524 ··· 628 581 629 582 if (indirect) 630 583 amdgpu_vcn_psp_update_sram(adev, inst_idx, AMDGPU_UCODE_ID_VCN0_RAM); 584 + 585 + /* Pause dpg */ 586 + vcn_v5_0_1_pause_dpg_mode(vinst, &state); 631 587 632 588 ring = &adev->vcn.inst[inst_idx].ring_enc[0]; 633 589 ··· 825 775 int inst_idx = vinst->inst; 826 776 uint32_t tmp; 827 777 int vcn_inst; 778 + struct dpg_pause_state state = {.fw_based = VCN_DPG_STATE__UNPAUSE}; 828 779 829 780 vcn_inst = GET_INST(VCN, inst_idx); 781 + 782 + /* Unpause dpg */ 783 + vcn_v5_0_1_pause_dpg_mode(vinst, &state); 830 784 831 785 /* Wait for power status to be 1 */ 832 786 SOC15_WAIT_ON_RREG(VCN, vcn_inst, regUVD_POWER_STATUS, 1,
+16 -3
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.c
··· 173 173 unsigned int conn_index = aconnector->base.index; 174 174 175 175 guard(mutex)(&hdcp_w->mutex); 176 + drm_connector_get(&aconnector->base); 177 + if (hdcp_w->aconnector[conn_index]) 178 + drm_connector_put(&hdcp_w->aconnector[conn_index]->base); 176 179 hdcp_w->aconnector[conn_index] = aconnector; 177 180 178 181 memset(&link_adjust, 0, sizeof(link_adjust)); ··· 223 220 unsigned int conn_index = aconnector->base.index; 224 221 225 222 guard(mutex)(&hdcp_w->mutex); 226 - hdcp_w->aconnector[conn_index] = aconnector; 227 223 228 224 /* the removal of display will invoke auth reset -> hdcp destroy and 229 225 * we'd expect the Content Protection (CP) property changed back to ··· 238 236 } 239 237 240 238 mod_hdcp_remove_display(&hdcp_w->hdcp, aconnector->base.index, &hdcp_w->output); 241 - 239 + if (hdcp_w->aconnector[conn_index]) { 240 + drm_connector_put(&hdcp_w->aconnector[conn_index]->base); 241 + hdcp_w->aconnector[conn_index] = NULL; 242 + } 242 243 process_output(hdcp_w); 243 244 } 244 245 ··· 259 254 for (conn_index = 0; conn_index < AMDGPU_DM_MAX_DISPLAY_INDEX; conn_index++) { 260 255 hdcp_w->encryption_status[conn_index] = 261 256 MOD_HDCP_ENCRYPTION_STATUS_HDCP_OFF; 257 + if (hdcp_w->aconnector[conn_index]) { 258 + drm_connector_put(&hdcp_w->aconnector[conn_index]->base); 259 + hdcp_w->aconnector[conn_index] = NULL; 260 + } 262 261 } 263 262 264 263 process_output(hdcp_w); ··· 497 488 struct hdcp_workqueue *hdcp_work = handle; 498 489 struct amdgpu_dm_connector *aconnector = config->dm_stream_ctx; 499 490 int link_index = aconnector->dc_link->link_index; 491 + unsigned int conn_index = aconnector->base.index; 500 492 struct mod_hdcp_display *display = &hdcp_work[link_index].display; 501 493 struct mod_hdcp_link *link = &hdcp_work[link_index].link; 502 494 struct hdcp_workqueue *hdcp_w = &hdcp_work[link_index]; ··· 554 544 guard(mutex)(&hdcp_w->mutex); 555 545 556 546 mod_hdcp_add_display(&hdcp_w->hdcp, link, display, &hdcp_w->output); 557 - 547 + drm_connector_get(&aconnector->base); 548 + if (hdcp_w->aconnector[conn_index]) 549 + drm_connector_put(&hdcp_w->aconnector[conn_index]->base); 550 + hdcp_w->aconnector[conn_index] = aconnector; 558 551 process_output(hdcp_w); 559 552 } 560 553
+6
drivers/gpu/drm/drm_file.c
··· 964 964 struct drm_file *file = f->private_data; 965 965 struct drm_device *dev = file->minor->dev; 966 966 struct drm_printer p = drm_seq_file_printer(m); 967 + int idx; 968 + 969 + if (!drm_dev_enter(dev, &idx)) 970 + return; 967 971 968 972 drm_printf(&p, "drm-driver:\t%s\n", dev->driver->name); 969 973 drm_printf(&p, "drm-client-id:\t%llu\n", file->client_id); ··· 987 983 988 984 if (dev->driver->show_fdinfo) 989 985 dev->driver->show_fdinfo(&p, file); 986 + 987 + drm_dev_exit(idx); 990 988 } 991 989 EXPORT_SYMBOL(drm_show_fdinfo); 992 990
+1 -1
drivers/gpu/drm/drm_gpusvm.c
··· 1469 1469 } 1470 1470 i += 1 << order; 1471 1471 num_dma_mapped = i; 1472 + range->flags.has_dma_mapping = true; 1472 1473 } 1473 1474 1474 - range->flags.has_dma_mapping = true; 1475 1475 if (zdd) { 1476 1476 range->flags.has_devmem_pages = true; 1477 1477 range->dpagemap = dpagemap;
+5 -1
drivers/gpu/drm/drm_mipi_dbi.c
··· 404 404 u16 height = drm->mode_config.min_height; 405 405 u16 width = drm->mode_config.min_width; 406 406 struct mipi_dbi *dbi = &dbidev->dbi; 407 - size_t len = width * height * 2; 407 + const struct drm_format_info *dst_format; 408 + size_t len; 408 409 int idx; 409 410 410 411 if (!drm_dev_enter(drm, &idx)) 411 412 return; 413 + 414 + dst_format = drm_format_info(dbidev->pixel_format); 415 + len = drm_format_info_min_pitch(dst_format, 0, width) * height; 412 416 413 417 memset(dbidev->tx_buf, 0, len); 414 418
+6 -2
drivers/gpu/drm/i915/pxp/intel_pxp_gsccs.h
··· 23 23 24 24 int intel_pxp_gsccs_create_session(struct intel_pxp *pxp, int arb_session_id); 25 25 void intel_pxp_gsccs_end_arb_fw_session(struct intel_pxp *pxp, u32 arb_session_id); 26 + bool intel_pxp_gsccs_is_ready_for_sessions(struct intel_pxp *pxp); 26 27 27 28 #else 28 29 static inline void intel_pxp_gsccs_fini(struct intel_pxp *pxp) ··· 35 34 return 0; 36 35 } 37 36 38 - #endif 37 + static inline bool intel_pxp_gsccs_is_ready_for_sessions(struct intel_pxp *pxp) 38 + { 39 + return false; 40 + } 39 41 40 - bool intel_pxp_gsccs_is_ready_for_sessions(struct intel_pxp *pxp); 42 + #endif 41 43 42 44 #endif /*__INTEL_PXP_GSCCS_H__ */
+1 -1
drivers/gpu/drm/nouveau/nouveau_fence.c
··· 90 90 while (!list_empty(&fctx->pending)) { 91 91 fence = list_entry(fctx->pending.next, typeof(*fence), head); 92 92 93 - if (error) 93 + if (error && !dma_fence_is_signaled_locked(&fence->base)) 94 94 dma_fence_set_error(&fence->base, error); 95 95 96 96 if (nouveau_fence_signal(fence))
+3
drivers/gpu/drm/tests/drm_gem_shmem_test.c
··· 216 216 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, sgt); 217 217 KUNIT_EXPECT_NULL(test, shmem->sgt); 218 218 219 + ret = kunit_add_action_or_reset(test, kfree_wrapper, sgt); 220 + KUNIT_ASSERT_EQ(test, ret, 0); 221 + 219 222 ret = kunit_add_action_or_reset(test, sg_free_table_wrapper, sgt); 220 223 KUNIT_ASSERT_EQ(test, ret, 0); 221 224
+2 -1
drivers/gpu/drm/ttm/ttm_bo.c
··· 1093 1093 struct ttm_lru_walk walk; 1094 1094 /** @gfp_flags: The gfp flags to use for ttm_tt_swapout() */ 1095 1095 gfp_t gfp_flags; 1096 - 1096 + /** @hit_low: Whether we should attempt to swap BO's with low watermark threshold */ 1097 + /** @evict_low: If we cannot swap a bo when @try_low is false (first pass) */ 1097 1098 bool hit_low, evict_low; 1098 1099 }; 1099 1100
+12 -2
drivers/gpu/drm/xe/xe_eu_stall.c
··· 52 52 53 53 struct xe_gt *gt; 54 54 struct xe_bo *bo; 55 + /* Lock to protect data buffer pointers */ 56 + struct mutex xecore_buf_lock; 55 57 struct per_xecore_buf *xecore_buf; 56 58 struct { 57 59 bool reported_to_user; ··· 209 207 { 210 208 struct xe_device *xe = gt_to_xe(gt); 211 209 int ret; 210 + 211 + if (!xe_eu_stall_supported_on_platform(xe)) 212 + return 0; 212 213 213 214 gt->eu_stall = kzalloc(sizeof(*gt->eu_stall), GFP_KERNEL); 214 215 if (!gt->eu_stall) { ··· 383 378 u16 group, instance; 384 379 unsigned int xecore; 385 380 386 - mutex_lock(&gt->eu_stall->stream_lock); 381 + mutex_lock(&stream->xecore_buf_lock); 387 382 for_each_dss_steering(xecore, gt, group, instance) { 388 383 xecore_buf = &stream->xecore_buf[xecore]; 389 384 read_ptr = xecore_buf->read; ··· 401 396 set_bit(xecore, stream->data_drop.mask); 402 397 xecore_buf->write = write_ptr; 403 398 } 404 - mutex_unlock(&gt->eu_stall->stream_lock); 399 + mutex_unlock(&stream->xecore_buf_lock); 405 400 406 401 return min_data_present; 407 402 } ··· 516 511 unsigned int xecore; 517 512 int ret = 0; 518 513 514 + mutex_lock(&stream->xecore_buf_lock); 519 515 if (bitmap_weight(stream->data_drop.mask, XE_MAX_DSS_FUSE_BITS)) { 520 516 if (!stream->data_drop.reported_to_user) { 521 517 stream->data_drop.reported_to_user = true; 522 518 xe_gt_dbg(gt, "EU stall data dropped in XeCores: %*pb\n", 523 519 XE_MAX_DSS_FUSE_BITS, stream->data_drop.mask); 520 + mutex_unlock(&stream->xecore_buf_lock); 524 521 return -EIO; 525 522 } 526 523 stream->data_drop.reported_to_user = false; ··· 534 527 if (ret || count == total_size) 535 528 break; 536 529 } 530 + mutex_unlock(&stream->xecore_buf_lock); 537 531 return total_size ?: (ret ?: -EAGAIN); 538 532 } 539 533 ··· 591 583 { 592 584 struct xe_gt *gt = stream->gt; 593 585 586 + mutex_destroy(&stream->xecore_buf_lock); 594 587 gt->eu_stall->stream = NULL; 595 588 kfree(stream); 596 589 } ··· 727 718 } 728 719 729 720 init_waitqueue_head(&stream->poll_wq); 721 + mutex_init(&stream->xecore_buf_lock); 730 722 INIT_DELAYED_WORK(&stream->buf_poll_work, eu_stall_data_buf_poll_work_fn); 731 723 stream->per_xecore_buf_size = per_xecore_buf_size; 732 724 stream->sampling_rate_mult = props->sampling_rate_mult;
+2 -1
drivers/gpu/drm/xe/xe_eu_stall.h
··· 7 7 #define __XE_EU_STALL_H__ 8 8 9 9 #include "xe_gt_types.h" 10 + #include "xe_sriov.h" 10 11 11 12 size_t xe_eu_stall_get_per_xecore_buf_size(void); 12 13 size_t xe_eu_stall_data_record_size(struct xe_device *xe); ··· 20 19 21 20 static inline bool xe_eu_stall_supported_on_platform(struct xe_device *xe) 22 21 { 23 - return xe->info.platform == XE_PVC || GRAPHICS_VER(xe) >= 20; 22 + return !IS_SRIOV_VF(xe) && (xe->info.platform == XE_PVC || GRAPHICS_VER(xe) >= 20); 24 23 } 25 24 #endif
+1 -1
drivers/gpu/drm/xe/xe_guc_capture.c
··· 359 359 360 360 ext->reg = XE_REG(extlist->reg.__reg.addr); 361 361 ext->flags = FIELD_PREP(GUC_REGSET_STEERING_NEEDED, 1); 362 - ext->flags = FIELD_PREP(GUC_REGSET_STEERING_GROUP, slice_id); 362 + ext->flags |= FIELD_PREP(GUC_REGSET_STEERING_GROUP, slice_id); 363 363 ext->flags |= FIELD_PREP(GUC_REGSET_STEERING_INSTANCE, subslice_id); 364 364 ext->regname = extlist->name; 365 365 }
+1 -1
drivers/gpu/drm/xe/xe_svm.c
··· 79 79 80 80 range = kzalloc(sizeof(*range), GFP_KERNEL); 81 81 if (!range) 82 - return ERR_PTR(-ENOMEM); 82 + return NULL; 83 83 84 84 INIT_LIST_HEAD(&range->garbage_collector_link); 85 85 xe_vm_get(gpusvm_to_vm(gpusvm));
+2 -2
drivers/i2c/busses/i2c-imx-lpi2c.c
··· 1380 1380 return 0; 1381 1381 1382 1382 rpm_disable: 1383 - pm_runtime_put(&pdev->dev); 1384 - pm_runtime_disable(&pdev->dev); 1385 1383 pm_runtime_dont_use_autosuspend(&pdev->dev); 1384 + pm_runtime_put_sync(&pdev->dev); 1385 + pm_runtime_disable(&pdev->dev); 1386 1386 1387 1387 return ret; 1388 1388 }
+8
drivers/iommu/amd/init.c
··· 3664 3664 while (*uid == '0' && *(uid + 1)) 3665 3665 uid++; 3666 3666 3667 + if (strlen(hid) >= ACPIHID_HID_LEN) { 3668 + pr_err("Invalid command line: hid is too long\n"); 3669 + return 1; 3670 + } else if (strlen(uid) >= ACPIHID_UID_LEN) { 3671 + pr_err("Invalid command line: uid is too long\n"); 3672 + return 1; 3673 + } 3674 + 3667 3675 i = early_acpihid_map_size++; 3668 3676 memcpy(early_acpihid_map[i].hid, hid, strlen(hid)); 3669 3677 memcpy(early_acpihid_map[i].uid, uid, strlen(uid));
+6
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3-sva.c
··· 411 411 return ERR_CAST(smmu_domain); 412 412 smmu_domain->domain.type = IOMMU_DOMAIN_SVA; 413 413 smmu_domain->domain.ops = &arm_smmu_sva_domain_ops; 414 + 415 + /* 416 + * Choose page_size as the leaf page size for invalidation when 417 + * ARM_SMMU_FEAT_RANGE_INV is present 418 + */ 419 + smmu_domain->domain.pgsize_bitmap = PAGE_SIZE; 414 420 smmu_domain->smmu = smmu; 415 421 416 422 ret = xa_alloc(&arm_smmu_asid_xa, &asid, smmu_domain,
+18 -5
drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
··· 3388 3388 mutex_lock(&smmu->streams_mutex); 3389 3389 for (i = 0; i < fwspec->num_ids; i++) { 3390 3390 struct arm_smmu_stream *new_stream = &master->streams[i]; 3391 + struct rb_node *existing; 3391 3392 u32 sid = fwspec->ids[i]; 3392 3393 3393 3394 new_stream->id = sid; ··· 3399 3398 break; 3400 3399 3401 3400 /* Insert into SID tree */ 3402 - if (rb_find_add(&new_stream->node, &smmu->streams, 3403 - arm_smmu_streams_cmp_node)) { 3404 - dev_warn(master->dev, "stream %u already in tree\n", 3405 - sid); 3406 - ret = -EINVAL; 3401 + existing = rb_find_add(&new_stream->node, &smmu->streams, 3402 + arm_smmu_streams_cmp_node); 3403 + if (existing) { 3404 + struct arm_smmu_master *existing_master = 3405 + rb_entry(existing, struct arm_smmu_stream, node) 3406 + ->master; 3407 + 3408 + /* Bridged PCI devices may end up with duplicated IDs */ 3409 + if (existing_master == master) 3410 + continue; 3411 + 3412 + dev_warn(master->dev, 3413 + "Aliasing StreamID 0x%x (from %s) unsupported, expect DMA to be broken\n", 3414 + sid, dev_name(existing_master->dev)); 3415 + ret = -ENODEV; 3407 3416 break; 3408 3417 } 3409 3418 } ··· 4440 4429 reg = readl_relaxed(smmu->base + ARM_SMMU_IDR3); 4441 4430 if (FIELD_GET(IDR3_RIL, reg)) 4442 4431 smmu->features |= ARM_SMMU_FEAT_RANGE_INV; 4432 + if (FIELD_GET(IDR3_FWB, reg)) 4433 + smmu->features |= ARM_SMMU_FEAT_S2FWB; 4443 4434 4444 4435 /* IDR5 */ 4445 4436 reg = readl_relaxed(smmu->base + ARM_SMMU_IDR5);
+24 -15
drivers/iommu/intel/iommu.c
··· 3785 3785 3786 3786 intel_iommu_debugfs_create_dev(info); 3787 3787 3788 - /* 3789 - * The PCIe spec, in its wisdom, declares that the behaviour of the 3790 - * device is undefined if you enable PASID support after ATS support. 3791 - * So always enable PASID support on devices which have it, even if 3792 - * we can't yet know if we're ever going to use it. 3793 - */ 3794 - if (info->pasid_supported && 3795 - !pci_enable_pasid(pdev, info->pasid_supported & ~1)) 3796 - info->pasid_enabled = 1; 3797 - 3798 - if (sm_supported(iommu)) 3799 - iommu_enable_pci_ats(info); 3800 - iommu_enable_pci_pri(info); 3801 - 3802 3788 return &iommu->iommu; 3803 3789 free_table: 3804 3790 intel_pasid_free_table(dev); ··· 3794 3808 kfree(info); 3795 3809 3796 3810 return ERR_PTR(ret); 3811 + } 3812 + 3813 + static void intel_iommu_probe_finalize(struct device *dev) 3814 + { 3815 + struct device_domain_info *info = dev_iommu_priv_get(dev); 3816 + struct intel_iommu *iommu = info->iommu; 3817 + 3818 + /* 3819 + * The PCIe spec, in its wisdom, declares that the behaviour of the 3820 + * device is undefined if you enable PASID support after ATS support. 3821 + * So always enable PASID support on devices which have it, even if 3822 + * we can't yet know if we're ever going to use it. 3823 + */ 3824 + if (info->pasid_supported && 3825 + !pci_enable_pasid(to_pci_dev(dev), info->pasid_supported & ~1)) 3826 + info->pasid_enabled = 1; 3827 + 3828 + if (sm_supported(iommu) && !dev_is_real_dma_subdevice(dev)) 3829 + iommu_enable_pci_ats(info); 3830 + iommu_enable_pci_pri(info); 3797 3831 } 3798 3832 3799 3833 static void intel_iommu_release_device(struct device *dev) ··· 4397 4391 .domain_alloc_sva = intel_svm_domain_alloc, 4398 4392 .domain_alloc_nested = intel_iommu_domain_alloc_nested, 4399 4393 .probe_device = intel_iommu_probe_device, 4394 + .probe_finalize = intel_iommu_probe_finalize, 4400 4395 .release_device = intel_iommu_release_device, 4401 4396 .get_resv_regions = intel_iommu_get_resv_regions, 4402 4397 .device_group = intel_iommu_device_group, ··· 4438 4431 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e30, quirk_iommu_igfx); 4439 4432 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e40, quirk_iommu_igfx); 4440 4433 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x2e90, quirk_iommu_igfx); 4434 + 4435 + /* QM57/QS57 integrated gfx malfunctions with dmar */ 4436 + DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_iommu_igfx); 4441 4437 4442 4438 /* Broadwell igfx malfunctions with dmar */ 4443 4439 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x1606, quirk_iommu_igfx); ··· 4519 4509 } 4520 4510 } 4521 4511 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0040, quirk_calpella_no_shadow_gtt); 4522 - DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0044, quirk_calpella_no_shadow_gtt); 4523 4512 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x0062, quirk_calpella_no_shadow_gtt); 4524 4513 DECLARE_PCI_FIXUP_HEADER(PCI_VENDOR_ID_INTEL, 0x006a, quirk_calpella_no_shadow_gtt); 4525 4514
+3
drivers/irqchip/irq-qcom-mpm.c
··· 227 227 if (ret) 228 228 return ret; 229 229 230 + if (pin == GPIO_NO_WAKE_IRQ) 231 + return irq_domain_disconnect_hierarchy(domain, virq); 232 + 230 233 ret = irq_domain_set_hwirq_and_chip(domain, virq, pin, 231 234 &qcom_mpm_chip, priv); 232 235 if (ret)
+3 -2
drivers/md/dm-table.c
··· 524 524 } 525 525 argv = kmalloc_array(new_size, sizeof(*argv), gfp); 526 526 if (argv) { 527 - *size = new_size; 528 527 if (old_argv) 529 528 memcpy(argv, old_argv, *size * sizeof(*argv)); 529 + *size = new_size; 530 530 } 531 531 532 532 kfree(old_argv); ··· 1173 1173 1174 1174 t = dm_get_live_table(md, &srcu_idx); 1175 1175 if (!t) 1176 - return 0; 1176 + goto put_live_table; 1177 1177 1178 1178 for (unsigned int i = 0; i < t->num_targets; i++) { 1179 1179 struct dm_target *ti = dm_table_get_target(t, i); ··· 1184 1184 (void *)key); 1185 1185 } 1186 1186 1187 + put_live_table: 1187 1188 dm_put_live_table(md, srcu_idx); 1188 1189 return 0; 1189 1190 }
+1
drivers/media/cec/i2c/Kconfig
··· 16 16 17 17 config CEC_NXP_TDA9950 18 18 tristate "NXP Semiconductors TDA9950/TDA998X HDMI CEC" 19 + depends on I2C 19 20 select CEC_NOTIFIER 20 21 select CEC_CORE 21 22 default DRM_I2C_NXP_TDA998X
+4 -1
drivers/media/i2c/Kconfig
··· 1149 1149 1150 1150 config VIDEO_LT6911UXE 1151 1151 tristate "Lontium LT6911UXE decoder" 1152 - depends on ACPI && VIDEO_DEV 1152 + depends on ACPI && VIDEO_DEV && I2C 1153 1153 select V4L2_FWNODE 1154 + select V4L2_CCI_I2C 1155 + select MEDIA_CONTROLLER 1156 + select VIDEO_V4L2_SUBDEV_API 1154 1157 help 1155 1158 This is a Video4Linux2 sensor-level driver for the Lontium 1156 1159 LT6911UXE HDMI to MIPI CSI-2 bridge.
+1
drivers/media/platform/synopsys/hdmirx/Kconfig
··· 2 2 3 3 config VIDEO_SYNOPSYS_HDMIRX 4 4 tristate "Synopsys DesignWare HDMI Receiver driver" 5 + depends on ARCH_ROCKCHIP || COMPILE_TEST 5 6 depends on VIDEO_DEV 6 7 select MEDIA_CONTROLLER 7 8 select VIDEO_V4L2_SUBDEV_API
+2 -1
drivers/media/test-drivers/vivid/Kconfig
··· 32 32 33 33 config VIDEO_VIVID_OSD 34 34 bool "Enable Framebuffer for testing Output Overlay" 35 - depends on VIDEO_VIVID && FB 35 + depends on VIDEO_VIVID && FB_CORE 36 + depends on VIDEO_VIVID=m || FB_CORE=y 36 37 default y 37 38 select FB_IOMEM_HELPERS 38 39 help
+2 -1
drivers/net/can/m_can/m_can.c
··· 2379 2379 SET_NETDEV_DEV(net_dev, dev); 2380 2380 2381 2381 m_can_of_parse_mram(class_dev, mram_config_vals); 2382 + spin_lock_init(&class_dev->tx_handling_spinlock); 2382 2383 out: 2383 2384 return class_dev; 2384 2385 } ··· 2463 2462 2464 2463 void m_can_class_unregister(struct m_can_classdev *cdev) 2465 2464 { 2465 + unregister_candev(cdev->net); 2466 2466 if (cdev->is_peripheral) 2467 2467 can_rx_offload_del(&cdev->offload); 2468 - unregister_candev(cdev->net); 2469 2468 } 2470 2469 EXPORT_SYMBOL_GPL(m_can_class_unregister); 2471 2470
+1 -1
drivers/net/can/rockchip/rockchip_canfd-core.c
··· 937 937 struct rkcanfd_priv *priv = platform_get_drvdata(pdev); 938 938 struct net_device *ndev = priv->ndev; 939 939 940 - can_rx_offload_del(&priv->offload); 941 940 rkcanfd_unregister(priv); 941 + can_rx_offload_del(&priv->offload); 942 942 free_candev(ndev); 943 943 } 944 944
+33 -9
drivers/net/can/spi/mcp251xfd/mcp251xfd-core.c
··· 75 75 .brp_inc = 1, 76 76 }; 77 77 78 + /* The datasheet of the mcp2518fd (DS20006027B) specifies a range of 79 + * [-64,63] for TDCO, indicating a relative TDCO. 80 + * 81 + * Manual tests have shown, that using a relative TDCO configuration 82 + * results in bus off, while an absolute configuration works. 83 + * 84 + * For TDCO use the max value (63) from the data sheet, but 0 as the 85 + * minimum. 86 + */ 87 + static const struct can_tdc_const mcp251xfd_tdc_const = { 88 + .tdcv_min = 0, 89 + .tdcv_max = 63, 90 + .tdco_min = 0, 91 + .tdco_max = 63, 92 + .tdcf_min = 0, 93 + .tdcf_max = 0, 94 + }; 95 + 78 96 static const char *__mcp251xfd_get_model_str(enum mcp251xfd_model model) 79 97 { 80 98 switch (model) { ··· 528 510 { 529 511 const struct can_bittiming *bt = &priv->can.bittiming; 530 512 const struct can_bittiming *dbt = &priv->can.data_bittiming; 531 - u32 val = 0; 532 - s8 tdco; 513 + u32 tdcmod, val = 0; 533 514 int err; 534 515 535 516 /* CAN Control Register ··· 592 575 return err; 593 576 594 577 /* Transmitter Delay Compensation */ 595 - tdco = clamp_t(int, dbt->brp * (dbt->prop_seg + dbt->phase_seg1), 596 - -64, 63); 597 - val = FIELD_PREP(MCP251XFD_REG_TDC_TDCMOD_MASK, 598 - MCP251XFD_REG_TDC_TDCMOD_AUTO) | 599 - FIELD_PREP(MCP251XFD_REG_TDC_TDCO_MASK, tdco); 578 + if (priv->can.ctrlmode & CAN_CTRLMODE_TDC_AUTO) 579 + tdcmod = MCP251XFD_REG_TDC_TDCMOD_AUTO; 580 + else if (priv->can.ctrlmode & CAN_CTRLMODE_TDC_MANUAL) 581 + tdcmod = MCP251XFD_REG_TDC_TDCMOD_MANUAL; 582 + else 583 + tdcmod = MCP251XFD_REG_TDC_TDCMOD_DISABLED; 584 + 585 + val = FIELD_PREP(MCP251XFD_REG_TDC_TDCMOD_MASK, tdcmod) | 586 + FIELD_PREP(MCP251XFD_REG_TDC_TDCV_MASK, priv->can.tdc.tdcv) | 587 + FIELD_PREP(MCP251XFD_REG_TDC_TDCO_MASK, priv->can.tdc.tdco); 600 588 601 589 return regmap_write(priv->map_reg, MCP251XFD_REG_TDC, val); 602 590 } ··· 2105 2083 priv->can.do_get_berr_counter = mcp251xfd_get_berr_counter; 2106 2084 priv->can.bittiming_const = &mcp251xfd_bittiming_const; 2107 2085 priv->can.data_bittiming_const = &mcp251xfd_data_bittiming_const; 2086 + priv->can.tdc_const = &mcp251xfd_tdc_const; 2108 2087 priv->can.ctrlmode_supported = CAN_CTRLMODE_LOOPBACK | 2109 2088 CAN_CTRLMODE_LISTENONLY | CAN_CTRLMODE_BERR_REPORTING | 2110 2089 CAN_CTRLMODE_FD | CAN_CTRLMODE_FD_NON_ISO | 2111 - CAN_CTRLMODE_CC_LEN8_DLC; 2090 + CAN_CTRLMODE_CC_LEN8_DLC | CAN_CTRLMODE_TDC_AUTO | 2091 + CAN_CTRLMODE_TDC_MANUAL; 2112 2092 set_bit(MCP251XFD_FLAGS_DOWN, priv->flags); 2113 2093 priv->ndev = ndev; 2114 2094 priv->spi = spi; ··· 2198 2174 struct mcp251xfd_priv *priv = spi_get_drvdata(spi); 2199 2175 struct net_device *ndev = priv->ndev; 2200 2176 2201 - can_rx_offload_del(&priv->offload); 2202 2177 mcp251xfd_unregister(priv); 2178 + can_rx_offload_del(&priv->offload); 2203 2179 spi->max_speed_hz = priv->spi_max_speed_hz_orig; 2204 2180 free_candev(ndev); 2205 2181 }
+153 -60
drivers/net/dsa/b53/b53_common.c
··· 373 373 b53_read8(dev, B53_VLAN_PAGE, B53_VLAN_CTRL5, &vc5); 374 374 } 375 375 376 + vc1 &= ~VC1_RX_MCST_FWD_EN; 377 + 376 378 if (enable) { 377 379 vc0 |= VC0_VLAN_EN | VC0_VID_CHK_EN | VC0_VID_HASH_VID; 378 - vc1 |= VC1_RX_MCST_UNTAG_EN | VC1_RX_MCST_FWD_EN; 380 + vc1 |= VC1_RX_MCST_UNTAG_EN; 379 381 vc4 &= ~VC4_ING_VID_CHECK_MASK; 380 382 if (enable_filtering) { 381 383 vc4 |= VC4_ING_VID_VIO_DROP << VC4_ING_VID_CHECK_S; 382 384 vc5 |= VC5_DROP_VTABLE_MISS; 383 385 } else { 384 - vc4 |= VC4_ING_VID_VIO_FWD << VC4_ING_VID_CHECK_S; 386 + vc4 |= VC4_NO_ING_VID_CHK << VC4_ING_VID_CHECK_S; 385 387 vc5 &= ~VC5_DROP_VTABLE_MISS; 386 388 } 387 389 ··· 395 393 396 394 } else { 397 395 vc0 &= ~(VC0_VLAN_EN | VC0_VID_CHK_EN | VC0_VID_HASH_VID); 398 - vc1 &= ~(VC1_RX_MCST_UNTAG_EN | VC1_RX_MCST_FWD_EN); 396 + vc1 &= ~VC1_RX_MCST_UNTAG_EN; 399 397 vc4 &= ~VC4_ING_VID_CHECK_MASK; 400 398 vc5 &= ~VC5_DROP_VTABLE_MISS; 401 399 ··· 578 576 b53_write16(dev, B53_EEE_PAGE, B53_EEE_EN_CTRL, reg); 579 577 } 580 578 579 + int b53_setup_port(struct dsa_switch *ds, int port) 580 + { 581 + struct b53_device *dev = ds->priv; 582 + 583 + b53_port_set_ucast_flood(dev, port, true); 584 + b53_port_set_mcast_flood(dev, port, true); 585 + b53_port_set_learning(dev, port, false); 586 + 587 + return 0; 588 + } 589 + EXPORT_SYMBOL(b53_setup_port); 590 + 581 591 int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy) 582 592 { 583 593 struct b53_device *dev = ds->priv; ··· 601 587 return 0; 602 588 603 589 cpu_port = dsa_to_port(ds, port)->cpu_dp->index; 604 - 605 - b53_port_set_ucast_flood(dev, port, true); 606 - b53_port_set_mcast_flood(dev, port, true); 607 - b53_port_set_learning(dev, port, false); 608 590 609 591 if (dev->ops->irq_enable) 610 592 ret = dev->ops->irq_enable(dev, port); ··· 732 722 b53_write8(dev, B53_CTRL_PAGE, B53_PORT_CTRL(port), port_ctrl); 733 723 734 724 b53_brcm_hdr_setup(dev->ds, port); 735 - 736 - b53_port_set_ucast_flood(dev, port, true); 737 - b53_port_set_mcast_flood(dev, port, true); 738 - b53_port_set_learning(dev, port, false); 739 725 } 740 726 741 727 static void b53_enable_mib(struct b53_device *dev) ··· 767 761 return dev->tag_protocol == DSA_TAG_PROTO_NONE && dsa_is_cpu_port(ds, port); 768 762 } 769 763 764 + static bool b53_vlan_port_may_join_untagged(struct dsa_switch *ds, int port) 765 + { 766 + struct b53_device *dev = ds->priv; 767 + struct dsa_port *dp; 768 + 769 + if (!dev->vlan_filtering) 770 + return true; 771 + 772 + dp = dsa_to_port(ds, port); 773 + 774 + if (dsa_port_is_cpu(dp)) 775 + return true; 776 + 777 + return dp->bridge == NULL; 778 + } 779 + 770 780 int b53_configure_vlan(struct dsa_switch *ds) 771 781 { 772 782 struct b53_device *dev = ds->priv; ··· 801 779 b53_do_vlan_op(dev, VTA_CMD_CLEAR); 802 780 } 803 781 804 - b53_enable_vlan(dev, -1, dev->vlan_enabled, ds->vlan_filtering); 782 + b53_enable_vlan(dev, -1, dev->vlan_enabled, dev->vlan_filtering); 805 783 806 784 /* Create an untagged VLAN entry for the default PVID in case 807 785 * CONFIG_VLAN_8021Q is disabled and there are no calls to ··· 809 787 * entry. Do this only when the tagging protocol is not 810 788 * DSA_TAG_PROTO_NONE 811 789 */ 790 + v = &dev->vlans[def_vid]; 812 791 b53_for_each_port(dev, i) { 813 - v = &dev->vlans[def_vid]; 814 - v->members |= BIT(i); 815 - if (!b53_vlan_port_needs_forced_tagged(ds, i)) 816 - v->untag = v->members; 817 - b53_write16(dev, B53_VLAN_PAGE, 818 - B53_VLAN_PORT_DEF_TAG(i), def_vid); 819 - } 820 - 821 - /* Upon initial call we have not set-up any VLANs, but upon 822 - * system resume, we need to restore all VLAN entries. 823 - */ 824 - for (vid = def_vid; vid < dev->num_vlans; vid++) { 825 - v = &dev->vlans[vid]; 826 - 827 - if (!v->members) 792 + if (!b53_vlan_port_may_join_untagged(ds, i)) 828 793 continue; 829 794 830 - b53_set_vlan_entry(dev, vid, v); 831 - b53_fast_age_vlan(dev, vid); 795 + vl.members |= BIT(i); 796 + if (!b53_vlan_port_needs_forced_tagged(ds, i)) 797 + vl.untag = vl.members; 798 + b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(i), 799 + def_vid); 800 + } 801 + b53_set_vlan_entry(dev, def_vid, &vl); 802 + 803 + if (dev->vlan_filtering) { 804 + /* Upon initial call we have not set-up any VLANs, but upon 805 + * system resume, we need to restore all VLAN entries. 806 + */ 807 + for (vid = def_vid + 1; vid < dev->num_vlans; vid++) { 808 + v = &dev->vlans[vid]; 809 + 810 + if (!v->members) 811 + continue; 812 + 813 + b53_set_vlan_entry(dev, vid, v); 814 + b53_fast_age_vlan(dev, vid); 815 + } 816 + 817 + b53_for_each_port(dev, i) { 818 + if (!dsa_is_cpu_port(ds, i)) 819 + b53_write16(dev, B53_VLAN_PAGE, 820 + B53_VLAN_PORT_DEF_TAG(i), 821 + dev->ports[i].pvid); 822 + } 832 823 } 833 824 834 825 return 0; ··· 1160 1125 static int b53_setup(struct dsa_switch *ds) 1161 1126 { 1162 1127 struct b53_device *dev = ds->priv; 1128 + struct b53_vlan *vl; 1163 1129 unsigned int port; 1130 + u16 pvid; 1164 1131 int ret; 1165 1132 1166 1133 /* Request bridge PVID untagged when DSA_TAG_PROTO_NONE is set ··· 1170 1133 */ 1171 1134 ds->untag_bridge_pvid = dev->tag_protocol == DSA_TAG_PROTO_NONE; 1172 1135 1136 + /* The switch does not tell us the original VLAN for untagged 1137 + * packets, so keep the CPU port always tagged. 1138 + */ 1139 + ds->untag_vlan_aware_bridge_pvid = true; 1140 + 1173 1141 ret = b53_reset_switch(dev); 1174 1142 if (ret) { 1175 1143 dev_err(ds->dev, "failed to reset switch\n"); 1176 1144 return ret; 1145 + } 1146 + 1147 + /* setup default vlan for filtering mode */ 1148 + pvid = b53_default_pvid(dev); 1149 + vl = &dev->vlans[pvid]; 1150 + b53_for_each_port(dev, port) { 1151 + vl->members |= BIT(port); 1152 + if (!b53_vlan_port_needs_forced_tagged(ds, port)) 1153 + vl->untag |= BIT(port); 1177 1154 } 1178 1155 1179 1156 b53_reset_mib(dev); ··· 1543 1492 { 1544 1493 struct b53_device *dev = ds->priv; 1545 1494 1546 - b53_enable_vlan(dev, port, dev->vlan_enabled, vlan_filtering); 1495 + if (dev->vlan_filtering != vlan_filtering) { 1496 + dev->vlan_filtering = vlan_filtering; 1497 + b53_apply_config(dev); 1498 + } 1547 1499 1548 1500 return 0; 1549 1501 } ··· 1571 1517 if (vlan->vid >= dev->num_vlans) 1572 1518 return -ERANGE; 1573 1519 1574 - b53_enable_vlan(dev, port, true, ds->vlan_filtering); 1520 + b53_enable_vlan(dev, port, true, dev->vlan_filtering); 1575 1521 1576 1522 return 0; 1577 1523 } ··· 1584 1530 bool untagged = vlan->flags & BRIDGE_VLAN_INFO_UNTAGGED; 1585 1531 bool pvid = vlan->flags & BRIDGE_VLAN_INFO_PVID; 1586 1532 struct b53_vlan *vl; 1533 + u16 old_pvid, new_pvid; 1587 1534 int err; 1588 1535 1589 1536 err = b53_vlan_prepare(ds, port, vlan); 1590 1537 if (err) 1591 1538 return err; 1592 1539 1540 + if (vlan->vid == 0) 1541 + return 0; 1542 + 1543 + old_pvid = dev->ports[port].pvid; 1544 + if (pvid) 1545 + new_pvid = vlan->vid; 1546 + else if (!pvid && vlan->vid == old_pvid) 1547 + new_pvid = b53_default_pvid(dev); 1548 + else 1549 + new_pvid = old_pvid; 1550 + dev->ports[port].pvid = new_pvid; 1551 + 1593 1552 vl = &dev->vlans[vlan->vid]; 1594 1553 1595 - b53_get_vlan_entry(dev, vlan->vid, vl); 1596 - 1597 - if (vlan->vid == 0 && vlan->vid == b53_default_pvid(dev)) 1598 - untagged = true; 1554 + if (dsa_is_cpu_port(ds, port)) 1555 + untagged = false; 1599 1556 1600 1557 vl->members |= BIT(port); 1601 1558 if (untagged && !b53_vlan_port_needs_forced_tagged(ds, port)) ··· 1614 1549 else 1615 1550 vl->untag &= ~BIT(port); 1616 1551 1552 + if (!dev->vlan_filtering) 1553 + return 0; 1554 + 1617 1555 b53_set_vlan_entry(dev, vlan->vid, vl); 1618 1556 b53_fast_age_vlan(dev, vlan->vid); 1619 1557 1620 - if (pvid && !dsa_is_cpu_port(ds, port)) { 1558 + if (!dsa_is_cpu_port(ds, port) && new_pvid != old_pvid) { 1621 1559 b53_write16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port), 1622 - vlan->vid); 1623 - b53_fast_age_vlan(dev, vlan->vid); 1560 + new_pvid); 1561 + b53_fast_age_vlan(dev, old_pvid); 1624 1562 } 1625 1563 1626 1564 return 0; ··· 1638 1570 struct b53_vlan *vl; 1639 1571 u16 pvid; 1640 1572 1641 - b53_read16(dev, B53_VLAN_PAGE, B53_VLAN_PORT_DEF_TAG(port), &pvid); 1573 + if (vlan->vid == 0) 1574 + return 0; 1575 + 1576 + pvid = dev->ports[port].pvid; 1642 1577 1643 1578 vl = &dev->vlans[vlan->vid]; 1644 - 1645 - b53_get_vlan_entry(dev, vlan->vid, vl); 1646 1579 1647 1580 vl->members &= ~BIT(port); 1648 1581 1649 1582 if (pvid == vlan->vid) 1650 1583 pvid = b53_default_pvid(dev); 1584 + dev->ports[port].pvid = pvid; 1651 1585 1652 1586 if (untagged && !b53_vlan_port_needs_forced_tagged(ds, port)) 1653 1587 vl->untag &= ~(BIT(port)); 1588 + 1589 + if (!dev->vlan_filtering) 1590 + return 0; 1654 1591 1655 1592 b53_set_vlan_entry(dev, vlan->vid, vl); 1656 1593 b53_fast_age_vlan(dev, vlan->vid); ··· 1989 1916 bool *tx_fwd_offload, struct netlink_ext_ack *extack) 1990 1917 { 1991 1918 struct b53_device *dev = ds->priv; 1919 + struct b53_vlan *vl; 1992 1920 s8 cpu_port = dsa_to_port(ds, port)->cpu_dp->index; 1993 - u16 pvlan, reg; 1921 + u16 pvlan, reg, pvid; 1994 1922 unsigned int i; 1995 1923 1996 1924 /* On 7278, port 7 which connects to the ASP should only receive ··· 2000 1926 if (dev->chip_id == BCM7278_DEVICE_ID && port == 7) 2001 1927 return -EINVAL; 2002 1928 2003 - /* Make this port leave the all VLANs join since we will have proper 2004 - * VLAN entries from now on 2005 - */ 2006 - if (is58xx(dev)) { 2007 - b53_read16(dev, B53_VLAN_PAGE, B53_JOIN_ALL_VLAN_EN, &reg); 2008 - reg &= ~BIT(port); 2009 - if ((reg & BIT(cpu_port)) == BIT(cpu_port)) 2010 - reg &= ~BIT(cpu_port); 2011 - b53_write16(dev, B53_VLAN_PAGE, B53_JOIN_ALL_VLAN_EN, reg); 1929 + pvid = b53_default_pvid(dev); 1930 + vl = &dev->vlans[pvid]; 1931 + 1932 + if (dev->vlan_filtering) { 1933 + /* Make this port leave the all VLANs join since we will have 1934 + * proper VLAN entries from now on 1935 + */ 1936 + if (is58xx(dev)) { 1937 + b53_read16(dev, B53_VLAN_PAGE, B53_JOIN_ALL_VLAN_EN, 1938 + &reg); 1939 + reg &= ~BIT(port); 1940 + if ((reg & BIT(cpu_port)) == BIT(cpu_port)) 1941 + reg &= ~BIT(cpu_port); 1942 + b53_write16(dev, B53_VLAN_PAGE, B53_JOIN_ALL_VLAN_EN, 1943 + reg); 1944 + } 1945 + 1946 + b53_get_vlan_entry(dev, pvid, vl); 1947 + vl->members &= ~BIT(port); 1948 + if (vl->members == BIT(cpu_port)) 1949 + vl->members &= ~BIT(cpu_port); 1950 + vl->untag = vl->members; 1951 + b53_set_vlan_entry(dev, pvid, vl); 2012 1952 } 2013 1953 2014 1954 b53_read16(dev, B53_PVLAN_PAGE, B53_PVLAN_PORT_MASK(port), &pvlan); ··· 2055 1967 void b53_br_leave(struct dsa_switch *ds, int port, struct dsa_bridge bridge) 2056 1968 { 2057 1969 struct b53_device *dev = ds->priv; 2058 - struct b53_vlan *vl = &dev->vlans[0]; 1970 + struct b53_vlan *vl; 2059 1971 s8 cpu_port = dsa_to_port(ds, port)->cpu_dp->index; 2060 1972 unsigned int i; 2061 1973 u16 pvlan, reg, pvid; ··· 2081 1993 dev->ports[port].vlan_ctl_mask = pvlan; 2082 1994 2083 1995 pvid = b53_default_pvid(dev); 1996 + vl = &dev->vlans[pvid]; 2084 1997 2085 - /* Make this port join all VLANs without VLAN entries */ 2086 - if (is58xx(dev)) { 2087 - b53_read16(dev, B53_VLAN_PAGE, B53_JOIN_ALL_VLAN_EN, &reg); 2088 - reg |= BIT(port); 2089 - if (!(reg & BIT(cpu_port))) 2090 - reg |= BIT(cpu_port); 2091 - b53_write16(dev, B53_VLAN_PAGE, B53_JOIN_ALL_VLAN_EN, reg); 2092 - } else { 1998 + if (dev->vlan_filtering) { 1999 + /* Make this port join all VLANs without VLAN entries */ 2000 + if (is58xx(dev)) { 2001 + b53_read16(dev, B53_VLAN_PAGE, B53_JOIN_ALL_VLAN_EN, &reg); 2002 + reg |= BIT(port); 2003 + if (!(reg & BIT(cpu_port))) 2004 + reg |= BIT(cpu_port); 2005 + b53_write16(dev, B53_VLAN_PAGE, B53_JOIN_ALL_VLAN_EN, reg); 2006 + } 2007 + 2093 2008 b53_get_vlan_entry(dev, pvid, vl); 2094 2009 vl->members |= BIT(port) | BIT(cpu_port); 2095 2010 vl->untag |= BIT(port) | BIT(cpu_port); ··· 2391 2300 .phy_read = b53_phy_read16, 2392 2301 .phy_write = b53_phy_write16, 2393 2302 .phylink_get_caps = b53_phylink_get_caps, 2303 + .port_setup = b53_setup_port, 2394 2304 .port_enable = b53_enable_port, 2395 2305 .port_disable = b53_disable_port, 2396 2306 .support_eee = b53_support_eee, ··· 2849 2757 ds->ops = &b53_switch_ops; 2850 2758 ds->phylink_mac_ops = &b53_phylink_mac_ops; 2851 2759 dev->vlan_enabled = true; 2760 + dev->vlan_filtering = false; 2852 2761 /* Let DSA handle the case were multiple bridges span the same switch 2853 2762 * device and different VLAN awareness settings are requested, which 2854 2763 * would be breaking filtering semantics for any of the other bridge
+3
drivers/net/dsa/b53/b53_priv.h
··· 96 96 97 97 struct b53_port { 98 98 u16 vlan_ctl_mask; 99 + u16 pvid; 99 100 struct ethtool_keee eee; 100 101 }; 101 102 ··· 148 147 unsigned int num_vlans; 149 148 struct b53_vlan *vlans; 150 149 bool vlan_enabled; 150 + bool vlan_filtering; 151 151 unsigned int num_ports; 152 152 struct b53_port *ports; 153 153 ··· 384 382 enum dsa_tag_protocol mprot); 385 383 void b53_mirror_del(struct dsa_switch *ds, int port, 386 384 struct dsa_mall_mirror_tc_entry *mirror); 385 + int b53_setup_port(struct dsa_switch *ds, int port); 387 386 int b53_enable_port(struct dsa_switch *ds, int port, struct phy_device *phy); 388 387 void b53_disable_port(struct dsa_switch *ds, int port); 389 388 void b53_brcm_hdr_setup(struct dsa_switch *ds, int port);
+1
drivers/net/dsa/bcm_sf2.c
··· 1230 1230 .resume = bcm_sf2_sw_resume, 1231 1231 .get_wol = bcm_sf2_sw_get_wol, 1232 1232 .set_wol = bcm_sf2_sw_set_wol, 1233 + .port_setup = b53_setup_port, 1233 1234 .port_enable = bcm_sf2_port_setup, 1234 1235 .port_disable = bcm_sf2_port_disable, 1235 1236 .support_eee = b53_support_eee,
+6 -4
drivers/net/ethernet/airoha/airoha_npu.c
··· 104 104 u8 xpon_hal_api; 105 105 u8 wan_xsi; 106 106 u8 ct_joyme4; 107 - int ppe_type; 108 - int wan_mode; 109 - int wan_sel; 107 + u8 max_packet; 108 + u8 rsv[3]; 109 + u32 ppe_type; 110 + u32 wan_mode; 111 + u32 wan_sel; 110 112 } init_info; 111 113 struct { 112 - int func_id; 114 + u32 func_id; 113 115 u32 size; 114 116 u32 data; 115 117 } set_info;
+18 -29
drivers/net/ethernet/intel/ice/ice_adapter.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 // SPDX-FileCopyrightText: Copyright Red Hat 3 3 4 - #include <linux/bitfield.h> 5 4 #include <linux/cleanup.h> 6 5 #include <linux/mutex.h> 7 6 #include <linux/pci.h> ··· 13 14 static DEFINE_XARRAY(ice_adapters); 14 15 static DEFINE_MUTEX(ice_adapters_mutex); 15 16 16 - /* PCI bus number is 8 bits. Slot is 5 bits. Domain can have the rest. */ 17 - #define INDEX_FIELD_DOMAIN GENMASK(BITS_PER_LONG - 1, 13) 18 - #define INDEX_FIELD_DEV GENMASK(31, 16) 19 - #define INDEX_FIELD_BUS GENMASK(12, 5) 20 - #define INDEX_FIELD_SLOT GENMASK(4, 0) 21 - 22 - static unsigned long ice_adapter_index(const struct pci_dev *pdev) 17 + static unsigned long ice_adapter_index(u64 dsn) 23 18 { 24 - unsigned int domain = pci_domain_nr(pdev->bus); 25 - 26 - WARN_ON(domain > FIELD_MAX(INDEX_FIELD_DOMAIN)); 27 - 28 - switch (pdev->device) { 29 - case ICE_DEV_ID_E825C_BACKPLANE: 30 - case ICE_DEV_ID_E825C_QSFP: 31 - case ICE_DEV_ID_E825C_SFP: 32 - case ICE_DEV_ID_E825C_SGMII: 33 - return FIELD_PREP(INDEX_FIELD_DEV, pdev->device); 34 - default: 35 - return FIELD_PREP(INDEX_FIELD_DOMAIN, domain) | 36 - FIELD_PREP(INDEX_FIELD_BUS, pdev->bus->number) | 37 - FIELD_PREP(INDEX_FIELD_SLOT, PCI_SLOT(pdev->devfn)); 38 - } 19 + #if BITS_PER_LONG == 64 20 + return dsn; 21 + #else 22 + return (u32)dsn ^ (u32)(dsn >> 32); 23 + #endif 39 24 } 40 25 41 - static struct ice_adapter *ice_adapter_new(void) 26 + static struct ice_adapter *ice_adapter_new(u64 dsn) 42 27 { 43 28 struct ice_adapter *adapter; 44 29 ··· 30 47 if (!adapter) 31 48 return NULL; 32 49 50 + adapter->device_serial_number = dsn; 33 51 spin_lock_init(&adapter->ptp_gltsyn_time_lock); 34 52 refcount_set(&adapter->refcount, 1); 35 53 ··· 61 77 * Return: Pointer to ice_adapter on success. 62 78 * ERR_PTR() on error. -ENOMEM is the only possible error. 63 79 */ 64 - struct ice_adapter *ice_adapter_get(const struct pci_dev *pdev) 80 + struct ice_adapter *ice_adapter_get(struct pci_dev *pdev) 65 81 { 66 - unsigned long index = ice_adapter_index(pdev); 82 + u64 dsn = pci_get_dsn(pdev); 67 83 struct ice_adapter *adapter; 84 + unsigned long index; 68 85 int err; 69 86 87 + index = ice_adapter_index(dsn); 70 88 scoped_guard(mutex, &ice_adapters_mutex) { 71 89 err = xa_insert(&ice_adapters, index, NULL, GFP_KERNEL); 72 90 if (err == -EBUSY) { 73 91 adapter = xa_load(&ice_adapters, index); 74 92 refcount_inc(&adapter->refcount); 93 + WARN_ON_ONCE(adapter->device_serial_number != dsn); 75 94 return adapter; 76 95 } 77 96 if (err) 78 97 return ERR_PTR(err); 79 98 80 - adapter = ice_adapter_new(); 99 + adapter = ice_adapter_new(dsn); 81 100 if (!adapter) 82 101 return ERR_PTR(-ENOMEM); 83 102 xa_store(&ice_adapters, index, adapter, GFP_KERNEL); ··· 97 110 * 98 111 * Context: Process, may sleep. 99 112 */ 100 - void ice_adapter_put(const struct pci_dev *pdev) 113 + void ice_adapter_put(struct pci_dev *pdev) 101 114 { 102 - unsigned long index = ice_adapter_index(pdev); 115 + u64 dsn = pci_get_dsn(pdev); 103 116 struct ice_adapter *adapter; 117 + unsigned long index; 104 118 119 + index = ice_adapter_index(dsn); 105 120 scoped_guard(mutex, &ice_adapters_mutex) { 106 121 adapter = xa_load(&ice_adapters, index); 107 122 if (WARN_ON(!adapter))
+4 -2
drivers/net/ethernet/intel/ice/ice_adapter.h
··· 32 32 * @refcount: Reference count. struct ice_pf objects hold the references. 33 33 * @ctrl_pf: Control PF of the adapter 34 34 * @ports: Ports list 35 + * @device_serial_number: DSN cached for collision detection on 32bit systems 35 36 */ 36 37 struct ice_adapter { 37 38 refcount_t refcount; ··· 41 40 42 41 struct ice_pf *ctrl_pf; 43 42 struct ice_port_list ports; 43 + u64 device_serial_number; 44 44 }; 45 45 46 - struct ice_adapter *ice_adapter_get(const struct pci_dev *pdev); 47 - void ice_adapter_put(const struct pci_dev *pdev); 46 + struct ice_adapter *ice_adapter_get(struct pci_dev *pdev); 47 + void ice_adapter_put(struct pci_dev *pdev); 48 48 49 49 #endif /* _ICE_ADAPTER_H */
+12 -7
drivers/net/ethernet/mediatek/mtk_eth_soc.c
··· 3274 3274 static void mtk_dma_free(struct mtk_eth *eth) 3275 3275 { 3276 3276 const struct mtk_soc_data *soc = eth->soc; 3277 - int i; 3277 + int i, j, txqs = 1; 3278 3278 3279 - for (i = 0; i < MTK_MAX_DEVS; i++) 3280 - if (eth->netdev[i]) 3281 - netdev_reset_queue(eth->netdev[i]); 3279 + if (MTK_HAS_CAPS(eth->soc->caps, MTK_QDMA)) 3280 + txqs = MTK_QDMA_NUM_QUEUES; 3281 + 3282 + for (i = 0; i < MTK_MAX_DEVS; i++) { 3283 + if (!eth->netdev[i]) 3284 + continue; 3285 + 3286 + for (j = 0; j < txqs; j++) 3287 + netdev_tx_reset_subqueue(eth->netdev[i], j); 3288 + } 3289 + 3282 3290 if (!MTK_HAS_CAPS(soc->caps, MTK_SRAM) && eth->scratch_ring) { 3283 3291 dma_free_coherent(eth->dma_dev, 3284 3292 MTK_QDMA_RING_SIZE * soc->tx.desc_size, ··· 3561 3553 } 3562 3554 mtk_gdm_config(eth, target_mac->id, gdm_config); 3563 3555 } 3564 - /* Reset and enable PSE */ 3565 - mtk_w32(eth, RST_GL_PSE, MTK_RST_GL); 3566 - mtk_w32(eth, 0, MTK_RST_GL); 3567 3556 3568 3557 napi_enable(&eth->tx_napi); 3569 3558 napi_enable(&eth->rx_napi);
+4 -4
drivers/net/ethernet/meta/fbnic/fbnic.h
··· 157 157 void fbnic_devlink_register(struct fbnic_dev *fbd); 158 158 void fbnic_devlink_unregister(struct fbnic_dev *fbd); 159 159 160 - int fbnic_fw_enable_mbx(struct fbnic_dev *fbd); 161 - void fbnic_fw_disable_mbx(struct fbnic_dev *fbd); 160 + int fbnic_fw_request_mbx(struct fbnic_dev *fbd); 161 + void fbnic_fw_free_mbx(struct fbnic_dev *fbd); 162 162 163 163 void fbnic_hwmon_register(struct fbnic_dev *fbd); 164 164 void fbnic_hwmon_unregister(struct fbnic_dev *fbd); 165 165 166 - int fbnic_pcs_irq_enable(struct fbnic_dev *fbd); 167 - void fbnic_pcs_irq_disable(struct fbnic_dev *fbd); 166 + int fbnic_pcs_request_irq(struct fbnic_dev *fbd); 167 + void fbnic_pcs_free_irq(struct fbnic_dev *fbd); 168 168 169 169 void fbnic_napi_name_irqs(struct fbnic_dev *fbd); 170 170 int fbnic_napi_request_irq(struct fbnic_dev *fbd,
+2
drivers/net/ethernet/meta/fbnic/fbnic_csr.h
··· 818 818 /* PUL User Registers */ 819 819 #define FBNIC_CSR_START_PUL_USER 0x31000 /* CSR section delimiter */ 820 820 #define FBNIC_PUL_OB_TLP_HDR_AW_CFG 0x3103d /* 0xc40f4 */ 821 + #define FBNIC_PUL_OB_TLP_HDR_AW_CFG_FLUSH CSR_BIT(19) 821 822 #define FBNIC_PUL_OB_TLP_HDR_AW_CFG_BME CSR_BIT(18) 822 823 #define FBNIC_PUL_OB_TLP_HDR_AR_CFG 0x3103e /* 0xc40f8 */ 824 + #define FBNIC_PUL_OB_TLP_HDR_AR_CFG_FLUSH CSR_BIT(19) 823 825 #define FBNIC_PUL_OB_TLP_HDR_AR_CFG_BME CSR_BIT(18) 824 826 #define FBNIC_PUL_USER_OB_RD_TLP_CNT_31_0 \ 825 827 0x3106e /* 0xc41b8 */
+119 -78
drivers/net/ethernet/meta/fbnic/fbnic_fw.c
··· 17 17 { 18 18 u32 desc_offset = FBNIC_IPC_MBX(mbx_idx, desc_idx); 19 19 20 + /* Write the upper 32b and then the lower 32b. Doing this the 21 + * FW can then read lower, upper, lower to verify that the state 22 + * of the descriptor wasn't changed mid-transaction. 23 + */ 20 24 fw_wr32(fbd, desc_offset + 1, upper_32_bits(desc)); 21 25 fw_wrfl(fbd); 22 26 fw_wr32(fbd, desc_offset, lower_32_bits(desc)); 27 + } 28 + 29 + static void __fbnic_mbx_invalidate_desc(struct fbnic_dev *fbd, int mbx_idx, 30 + int desc_idx, u32 desc) 31 + { 32 + u32 desc_offset = FBNIC_IPC_MBX(mbx_idx, desc_idx); 33 + 34 + /* For initialization we write the lower 32b of the descriptor first. 35 + * This way we can set the state to mark it invalid before we clear the 36 + * upper 32b. 37 + */ 38 + fw_wr32(fbd, desc_offset, desc); 39 + fw_wrfl(fbd); 40 + fw_wr32(fbd, desc_offset + 1, 0); 23 41 } 24 42 25 43 static u64 __fbnic_mbx_rd_desc(struct fbnic_dev *fbd, int mbx_idx, int desc_idx) ··· 51 33 return desc; 52 34 } 53 35 54 - static void fbnic_mbx_init_desc_ring(struct fbnic_dev *fbd, int mbx_idx) 36 + static void fbnic_mbx_reset_desc_ring(struct fbnic_dev *fbd, int mbx_idx) 55 37 { 56 38 int desc_idx; 39 + 40 + /* Disable DMA transactions from the device, 41 + * and flush any transactions triggered during cleaning 42 + */ 43 + switch (mbx_idx) { 44 + case FBNIC_IPC_MBX_RX_IDX: 45 + wr32(fbd, FBNIC_PUL_OB_TLP_HDR_AW_CFG, 46 + FBNIC_PUL_OB_TLP_HDR_AW_CFG_FLUSH); 47 + break; 48 + case FBNIC_IPC_MBX_TX_IDX: 49 + wr32(fbd, FBNIC_PUL_OB_TLP_HDR_AR_CFG, 50 + FBNIC_PUL_OB_TLP_HDR_AR_CFG_FLUSH); 51 + break; 52 + } 53 + 54 + wrfl(fbd); 57 55 58 56 /* Initialize first descriptor to all 0s. Doing this gives us a 59 57 * solid stop for the firmware to hit when it is done looping 60 58 * through the ring. 61 59 */ 62 - __fbnic_mbx_wr_desc(fbd, mbx_idx, 0, 0); 63 - 64 - fw_wrfl(fbd); 60 + __fbnic_mbx_invalidate_desc(fbd, mbx_idx, 0, 0); 65 61 66 62 /* We then fill the rest of the ring starting at the end and moving 67 63 * back toward descriptor 0 with skip descriptors that have no 68 64 * length nor address, and tell the firmware that they can skip 69 65 * them and just move past them to the one we initialized to 0. 70 66 */ 71 - for (desc_idx = FBNIC_IPC_MBX_DESC_LEN; --desc_idx;) { 72 - __fbnic_mbx_wr_desc(fbd, mbx_idx, desc_idx, 73 - FBNIC_IPC_MBX_DESC_FW_CMPL | 74 - FBNIC_IPC_MBX_DESC_HOST_CMPL); 75 - fw_wrfl(fbd); 76 - } 67 + for (desc_idx = FBNIC_IPC_MBX_DESC_LEN; --desc_idx;) 68 + __fbnic_mbx_invalidate_desc(fbd, mbx_idx, desc_idx, 69 + FBNIC_IPC_MBX_DESC_FW_CMPL | 70 + FBNIC_IPC_MBX_DESC_HOST_CMPL); 77 71 } 78 72 79 73 void fbnic_mbx_init(struct fbnic_dev *fbd) ··· 106 76 wr32(fbd, FBNIC_INTR_CLEAR(0), 1u << FBNIC_FW_MSIX_ENTRY); 107 77 108 78 for (i = 0; i < FBNIC_IPC_MBX_INDICES; i++) 109 - fbnic_mbx_init_desc_ring(fbd, i); 79 + fbnic_mbx_reset_desc_ring(fbd, i); 110 80 } 111 81 112 82 static int fbnic_mbx_map_msg(struct fbnic_dev *fbd, int mbx_idx, ··· 171 141 { 172 142 int i; 173 143 174 - fbnic_mbx_init_desc_ring(fbd, mbx_idx); 144 + fbnic_mbx_reset_desc_ring(fbd, mbx_idx); 175 145 176 146 for (i = FBNIC_IPC_MBX_DESC_LEN; i--;) 177 147 fbnic_mbx_unmap_and_free_msg(fbd, mbx_idx, i); ··· 352 322 return err; 353 323 } 354 324 355 - /** 356 - * fbnic_fw_xmit_cap_msg - Allocate and populate a FW capabilities message 357 - * @fbd: FBNIC device structure 358 - * 359 - * Return: NULL on failure to allocate, error pointer on error, or pointer 360 - * to new TLV test message. 361 - * 362 - * Sends a single TLV header indicating the host wants the firmware to 363 - * confirm the capabilities and version. 364 - **/ 365 - static int fbnic_fw_xmit_cap_msg(struct fbnic_dev *fbd) 366 - { 367 - int err = fbnic_fw_xmit_simple_msg(fbd, FBNIC_TLV_MSG_ID_HOST_CAP_REQ); 368 - 369 - /* Return 0 if we are not calling this on ASIC */ 370 - return (err == -EOPNOTSUPP) ? 0 : err; 371 - } 372 - 373 - static void fbnic_mbx_postinit_desc_ring(struct fbnic_dev *fbd, int mbx_idx) 325 + static void fbnic_mbx_init_desc_ring(struct fbnic_dev *fbd, int mbx_idx) 374 326 { 375 327 struct fbnic_fw_mbx *mbx = &fbd->mbx[mbx_idx]; 376 - 377 - /* This is a one time init, so just exit if it is completed */ 378 - if (mbx->ready) 379 - return; 380 328 381 329 mbx->ready = true; 382 330 383 331 switch (mbx_idx) { 384 332 case FBNIC_IPC_MBX_RX_IDX: 333 + /* Enable DMA writes from the device */ 334 + wr32(fbd, FBNIC_PUL_OB_TLP_HDR_AW_CFG, 335 + FBNIC_PUL_OB_TLP_HDR_AW_CFG_BME); 336 + 385 337 /* Make sure we have a page for the FW to write to */ 386 338 fbnic_mbx_alloc_rx_msgs(fbd); 387 339 break; 388 340 case FBNIC_IPC_MBX_TX_IDX: 389 - /* Force version to 1 if we successfully requested an update 390 - * from the firmware. This should be overwritten once we get 391 - * the actual version from the firmware in the capabilities 392 - * request message. 393 - */ 394 - if (!fbnic_fw_xmit_cap_msg(fbd) && 395 - !fbd->fw_cap.running.mgmt.version) 396 - fbd->fw_cap.running.mgmt.version = 1; 341 + /* Enable DMA reads from the device */ 342 + wr32(fbd, FBNIC_PUL_OB_TLP_HDR_AR_CFG, 343 + FBNIC_PUL_OB_TLP_HDR_AR_CFG_BME); 397 344 break; 398 345 } 399 346 } 400 347 401 - static void fbnic_mbx_postinit(struct fbnic_dev *fbd) 348 + static bool fbnic_mbx_event(struct fbnic_dev *fbd) 402 349 { 403 - int i; 404 - 405 - /* We only need to do this on the first interrupt following init. 350 + /* We only need to do this on the first interrupt following reset. 406 351 * this primes the mailbox so that we will have cleared all the 407 352 * skip descriptors. 408 353 */ 409 354 if (!(rd32(fbd, FBNIC_INTR_STATUS(0)) & (1u << FBNIC_FW_MSIX_ENTRY))) 410 - return; 355 + return false; 411 356 412 357 wr32(fbd, FBNIC_INTR_CLEAR(0), 1u << FBNIC_FW_MSIX_ENTRY); 413 358 414 - for (i = 0; i < FBNIC_IPC_MBX_INDICES; i++) 415 - fbnic_mbx_postinit_desc_ring(fbd, i); 359 + return true; 416 360 } 417 361 418 362 /** ··· 863 859 864 860 void fbnic_mbx_poll(struct fbnic_dev *fbd) 865 861 { 866 - fbnic_mbx_postinit(fbd); 862 + fbnic_mbx_event(fbd); 867 863 868 864 fbnic_mbx_process_tx_msgs(fbd); 869 865 fbnic_mbx_process_rx_msgs(fbd); ··· 871 867 872 868 int fbnic_mbx_poll_tx_ready(struct fbnic_dev *fbd) 873 869 { 874 - struct fbnic_fw_mbx *tx_mbx; 875 - int attempts = 50; 870 + unsigned long timeout = jiffies + 10 * HZ + 1; 871 + int err, i; 876 872 877 - /* Immediate fail if BAR4 isn't there */ 878 - if (!fbnic_fw_present(fbd)) 879 - return -ENODEV; 873 + do { 874 + if (!time_is_after_jiffies(timeout)) 875 + return -ETIMEDOUT; 880 876 881 - tx_mbx = &fbd->mbx[FBNIC_IPC_MBX_TX_IDX]; 882 - while (!tx_mbx->ready && --attempts) { 883 877 /* Force the firmware to trigger an interrupt response to 884 878 * avoid the mailbox getting stuck closed if the interrupt 885 879 * is reset. 886 880 */ 887 - fbnic_mbx_init_desc_ring(fbd, FBNIC_IPC_MBX_TX_IDX); 881 + fbnic_mbx_reset_desc_ring(fbd, FBNIC_IPC_MBX_TX_IDX); 888 882 889 - msleep(200); 883 + /* Immediate fail if BAR4 went away */ 884 + if (!fbnic_fw_present(fbd)) 885 + return -ENODEV; 890 886 891 - fbnic_mbx_poll(fbd); 887 + msleep(20); 888 + } while (!fbnic_mbx_event(fbd)); 889 + 890 + /* FW has shown signs of life. Enable DMA and start Tx/Rx */ 891 + for (i = 0; i < FBNIC_IPC_MBX_INDICES; i++) 892 + fbnic_mbx_init_desc_ring(fbd, i); 893 + 894 + /* Request an update from the firmware. This should overwrite 895 + * mgmt.version once we get the actual version from the firmware 896 + * in the capabilities request message. 897 + */ 898 + err = fbnic_fw_xmit_simple_msg(fbd, FBNIC_TLV_MSG_ID_HOST_CAP_REQ); 899 + if (err) 900 + goto clean_mbx; 901 + 902 + /* Use "1" to indicate we entered the state waiting for a response */ 903 + fbd->fw_cap.running.mgmt.version = 1; 904 + 905 + return 0; 906 + clean_mbx: 907 + /* Cleanup Rx buffers and disable mailbox */ 908 + fbnic_mbx_clean(fbd); 909 + return err; 910 + } 911 + 912 + static void __fbnic_fw_evict_cmpl(struct fbnic_fw_completion *cmpl_data) 913 + { 914 + cmpl_data->result = -EPIPE; 915 + complete(&cmpl_data->done); 916 + } 917 + 918 + static void fbnic_mbx_evict_all_cmpl(struct fbnic_dev *fbd) 919 + { 920 + if (fbd->cmpl_data) { 921 + __fbnic_fw_evict_cmpl(fbd->cmpl_data); 922 + fbd->cmpl_data = NULL; 892 923 } 893 - 894 - return attempts ? 0 : -ETIMEDOUT; 895 924 } 896 925 897 926 void fbnic_mbx_flush_tx(struct fbnic_dev *fbd) 898 927 { 928 + unsigned long timeout = jiffies + 10 * HZ + 1; 899 929 struct fbnic_fw_mbx *tx_mbx; 900 - int attempts = 50; 901 - u8 count = 0; 902 - 903 - /* Nothing to do if there is no mailbox */ 904 - if (!fbnic_fw_present(fbd)) 905 - return; 930 + u8 tail; 906 931 907 932 /* Record current Rx stats */ 908 933 tx_mbx = &fbd->mbx[FBNIC_IPC_MBX_TX_IDX]; 909 934 910 - /* Nothing to do if mailbox never got to ready */ 911 - if (!tx_mbx->ready) 912 - return; 935 + spin_lock_irq(&fbd->fw_tx_lock); 936 + 937 + /* Clear ready to prevent any further attempts to transmit */ 938 + tx_mbx->ready = false; 939 + 940 + /* Read tail to determine the last tail state for the ring */ 941 + tail = tx_mbx->tail; 942 + 943 + /* Flush any completions as we are no longer processing Rx */ 944 + fbnic_mbx_evict_all_cmpl(fbd); 945 + 946 + spin_unlock_irq(&fbd->fw_tx_lock); 913 947 914 948 /* Give firmware time to process packet, 915 - * we will wait up to 10 seconds which is 50 waits of 200ms. 949 + * we will wait up to 10 seconds which is 500 waits of 20ms. 916 950 */ 917 951 do { 918 952 u8 head = tx_mbx->head; 919 953 920 - if (head == tx_mbx->tail) 954 + /* Tx ring is empty once head == tail */ 955 + if (head == tail) 921 956 break; 922 957 923 - msleep(200); 958 + msleep(20); 924 959 fbnic_mbx_process_tx_msgs(fbd); 925 - 926 - count += (tx_mbx->head - head) % FBNIC_IPC_MBX_DESC_LEN; 927 - } while (count < FBNIC_IPC_MBX_DESC_LEN && --attempts); 960 + } while (time_is_after_jiffies(timeout)); 928 961 } 929 962 930 963 void fbnic_get_fw_ver_commit_str(struct fbnic_dev *fbd, char *fw_version,
+99 -49
drivers/net/ethernet/meta/fbnic/fbnic_irq.c
··· 19 19 return IRQ_HANDLED; 20 20 } 21 21 22 - /** 23 - * fbnic_fw_enable_mbx - Configure and initialize Firmware Mailbox 24 - * @fbd: Pointer to device to initialize 25 - * 26 - * This function will initialize the firmware mailbox rings, enable the IRQ 27 - * and initialize the communication between the Firmware and the host. The 28 - * firmware is expected to respond to the initialization by sending an 29 - * interrupt essentially notifying the host that it has seen the 30 - * initialization and is now synced up. 31 - * 32 - * Return: non-zero on failure. 33 - **/ 34 - int fbnic_fw_enable_mbx(struct fbnic_dev *fbd) 22 + static int __fbnic_fw_enable_mbx(struct fbnic_dev *fbd, int vector) 35 23 { 36 - u32 vector = fbd->fw_msix_vector; 37 24 int err; 38 - 39 - /* Request the IRQ for FW Mailbox vector. */ 40 - err = request_threaded_irq(vector, NULL, &fbnic_fw_msix_intr, 41 - IRQF_ONESHOT, dev_name(fbd->dev), fbd); 42 - if (err) 43 - return err; 44 25 45 26 /* Initialize mailbox and attempt to poll it into ready state */ 46 27 fbnic_mbx_init(fbd); 47 28 err = fbnic_mbx_poll_tx_ready(fbd); 48 29 if (err) { 49 30 dev_warn(fbd->dev, "FW mailbox did not enter ready state\n"); 50 - free_irq(vector, fbd); 51 31 return err; 52 32 } 53 33 54 - /* Enable interrupts */ 34 + /* Enable interrupt and unmask the vector */ 35 + enable_irq(vector); 55 36 fbnic_wr32(fbd, FBNIC_INTR_MASK_CLEAR(0), 1u << FBNIC_FW_MSIX_ENTRY); 56 37 57 38 return 0; 58 39 } 59 40 60 41 /** 61 - * fbnic_fw_disable_mbx - Disable mailbox and place it in standby state 62 - * @fbd: Pointer to device to disable 42 + * fbnic_fw_request_mbx - Configure and initialize Firmware Mailbox 43 + * @fbd: Pointer to device to initialize 63 44 * 64 - * This function will disable the mailbox interrupt, free any messages still 65 - * in the mailbox and place it into a standby state. The firmware is 66 - * expected to see the update and assume that the host is in the reset state. 45 + * This function will allocate the IRQ and then reinitialize the mailbox 46 + * starting communication between the host and firmware. 47 + * 48 + * Return: non-zero on failure. 67 49 **/ 68 - void fbnic_fw_disable_mbx(struct fbnic_dev *fbd) 50 + int fbnic_fw_request_mbx(struct fbnic_dev *fbd) 69 51 { 70 - /* Disable interrupt and free vector */ 71 - fbnic_wr32(fbd, FBNIC_INTR_MASK_SET(0), 1u << FBNIC_FW_MSIX_ENTRY); 52 + struct pci_dev *pdev = to_pci_dev(fbd->dev); 53 + int vector, err; 72 54 73 - /* Free the vector */ 74 - free_irq(fbd->fw_msix_vector, fbd); 55 + WARN_ON(fbd->fw_msix_vector); 56 + 57 + vector = pci_irq_vector(pdev, FBNIC_FW_MSIX_ENTRY); 58 + if (vector < 0) 59 + return vector; 60 + 61 + /* Request the IRQ for FW Mailbox vector. */ 62 + err = request_threaded_irq(vector, NULL, &fbnic_fw_msix_intr, 63 + IRQF_ONESHOT | IRQF_NO_AUTOEN, 64 + dev_name(fbd->dev), fbd); 65 + if (err) 66 + return err; 67 + 68 + /* Initialize mailbox and attempt to poll it into ready state */ 69 + err = __fbnic_fw_enable_mbx(fbd, vector); 70 + if (err) 71 + free_irq(vector, fbd); 72 + 73 + fbd->fw_msix_vector = vector; 74 + 75 + return err; 76 + } 77 + 78 + /** 79 + * fbnic_fw_disable_mbx - Temporarily place mailbox in standby state 80 + * @fbd: Pointer to device 81 + * 82 + * Shutdown the mailbox by notifying the firmware to stop sending us logs, mask 83 + * and synchronize the IRQ, and then clean up the rings. 84 + **/ 85 + static void fbnic_fw_disable_mbx(struct fbnic_dev *fbd) 86 + { 87 + /* Disable interrupt and synchronize the IRQ */ 88 + disable_irq(fbd->fw_msix_vector); 89 + 90 + /* Mask the vector */ 91 + fbnic_wr32(fbd, FBNIC_INTR_MASK_SET(0), 1u << FBNIC_FW_MSIX_ENTRY); 75 92 76 93 /* Make sure disabling logs message is sent, must be done here to 77 94 * avoid risk of completing without a running interrupt. 78 95 */ 79 96 fbnic_mbx_flush_tx(fbd); 80 - 81 - /* Reset the mailboxes to the initialized state */ 82 97 fbnic_mbx_clean(fbd); 98 + } 99 + 100 + /** 101 + * fbnic_fw_free_mbx - Disable mailbox and place it in standby state 102 + * @fbd: Pointer to device to disable 103 + * 104 + * This function will disable the mailbox interrupt, free any messages still 105 + * in the mailbox and place it into a disabled state. The firmware is 106 + * expected to see the update and assume that the host is in the reset state. 107 + **/ 108 + void fbnic_fw_free_mbx(struct fbnic_dev *fbd) 109 + { 110 + /* Vector has already been freed */ 111 + if (!fbd->fw_msix_vector) 112 + return; 113 + 114 + fbnic_fw_disable_mbx(fbd); 115 + 116 + /* Free the vector */ 117 + free_irq(fbd->fw_msix_vector, fbd); 118 + fbd->fw_msix_vector = 0; 83 119 } 84 120 85 121 static irqreturn_t fbnic_pcs_msix_intr(int __always_unused irq, void *data) ··· 137 101 } 138 102 139 103 /** 140 - * fbnic_pcs_irq_enable - Configure the MAC to enable it to advertise link 104 + * fbnic_pcs_request_irq - Configure the PCS to enable it to advertise link 141 105 * @fbd: Pointer to device to initialize 142 106 * 143 107 * This function provides basic bringup for the MAC/PCS IRQ. For now the IRQ ··· 145 109 * 146 110 * Return: non-zero on failure. 147 111 **/ 148 - int fbnic_pcs_irq_enable(struct fbnic_dev *fbd) 112 + int fbnic_pcs_request_irq(struct fbnic_dev *fbd) 149 113 { 150 - u32 vector = fbd->pcs_msix_vector; 151 - int err; 114 + struct pci_dev *pdev = to_pci_dev(fbd->dev); 115 + int vector, err; 152 116 153 - /* Request the IRQ for MAC link vector. 154 - * Map MAC cause to it, and unmask it 117 + WARN_ON(fbd->pcs_msix_vector); 118 + 119 + vector = pci_irq_vector(pdev, FBNIC_PCS_MSIX_ENTRY); 120 + if (vector < 0) 121 + return vector; 122 + 123 + /* Request the IRQ for PCS link vector. 124 + * Map PCS cause to it, and unmask it 155 125 */ 156 126 err = request_irq(vector, &fbnic_pcs_msix_intr, 0, 157 127 fbd->netdev->name, fbd); 158 128 if (err) 159 129 return err; 160 130 131 + /* Map and enable interrupt, unmask vector after link is configured */ 161 132 fbnic_wr32(fbd, FBNIC_INTR_MSIX_CTRL(FBNIC_INTR_MSIX_CTRL_PCS_IDX), 162 133 FBNIC_PCS_MSIX_ENTRY | FBNIC_INTR_MSIX_CTRL_ENABLE); 134 + 135 + fbd->pcs_msix_vector = vector; 163 136 164 137 return 0; 165 138 } 166 139 167 140 /** 168 - * fbnic_pcs_irq_disable - Teardown the MAC IRQ to prepare for stopping 141 + * fbnic_pcs_free_irq - Teardown the PCS IRQ to prepare for stopping 169 142 * @fbd: Pointer to device that is stopping 170 143 * 171 - * This function undoes the work done in fbnic_pcs_irq_enable and prepares 144 + * This function undoes the work done in fbnic_pcs_request_irq and prepares 172 145 * the device to no longer receive traffic on the host interface. 173 146 **/ 174 - void fbnic_pcs_irq_disable(struct fbnic_dev *fbd) 147 + void fbnic_pcs_free_irq(struct fbnic_dev *fbd) 175 148 { 149 + /* Vector has already been freed */ 150 + if (!fbd->pcs_msix_vector) 151 + return; 152 + 176 153 /* Disable interrupt */ 177 154 fbnic_wr32(fbd, FBNIC_INTR_MSIX_CTRL(FBNIC_INTR_MSIX_CTRL_PCS_IDX), 178 155 FBNIC_PCS_MSIX_ENTRY); 156 + fbnic_wrfl(fbd); 157 + 158 + /* Synchronize IRQ to prevent race that would unmask vector */ 159 + synchronize_irq(fbd->pcs_msix_vector); 160 + 161 + /* Mask the vector */ 179 162 fbnic_wr32(fbd, FBNIC_INTR_MASK_SET(0), 1u << FBNIC_PCS_MSIX_ENTRY); 180 163 181 164 /* Free the vector */ 182 165 free_irq(fbd->pcs_msix_vector, fbd); 166 + fbd->pcs_msix_vector = 0; 183 167 } 184 168 185 169 void fbnic_synchronize_irq(struct fbnic_dev *fbd, int nr) ··· 282 226 { 283 227 struct pci_dev *pdev = to_pci_dev(fbd->dev); 284 228 285 - fbd->pcs_msix_vector = 0; 286 - fbd->fw_msix_vector = 0; 287 - 288 229 fbd->num_irqs = 0; 289 230 290 231 pci_free_irq_vectors(pdev); ··· 306 253 num_irqs, wanted_irqs); 307 254 308 255 fbd->num_irqs = num_irqs; 309 - 310 - fbd->pcs_msix_vector = pci_irq_vector(pdev, FBNIC_PCS_MSIX_ENTRY); 311 - fbd->fw_msix_vector = pci_irq_vector(pdev, FBNIC_FW_MSIX_ENTRY); 312 256 313 257 return 0; 314 258 }
-6
drivers/net/ethernet/meta/fbnic/fbnic_mac.c
··· 79 79 fbnic_init_readrq(fbd, FBNIC_QM_RNI_RBP_CTL, cls, readrq); 80 80 fbnic_init_mps(fbd, FBNIC_QM_RNI_RDE_CTL, cls, mps); 81 81 fbnic_init_mps(fbd, FBNIC_QM_RNI_RCM_CTL, cls, mps); 82 - 83 - /* Enable XALI AR/AW outbound */ 84 - wr32(fbd, FBNIC_PUL_OB_TLP_HDR_AW_CFG, 85 - FBNIC_PUL_OB_TLP_HDR_AW_CFG_BME); 86 - wr32(fbd, FBNIC_PUL_OB_TLP_HDR_AR_CFG, 87 - FBNIC_PUL_OB_TLP_HDR_AR_CFG_BME); 88 82 } 89 83 90 84 static void fbnic_mac_init_qm(struct fbnic_dev *fbd)
+3 -2
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c
··· 44 44 if (err) 45 45 goto time_stop; 46 46 47 - err = fbnic_pcs_irq_enable(fbd); 47 + err = fbnic_pcs_request_irq(fbd); 48 48 if (err) 49 49 goto time_stop; 50 + 50 51 /* Pull the BMC config and initialize the RPC */ 51 52 fbnic_bmc_rpc_init(fbd); 52 53 fbnic_rss_reinit(fbd, fbn); ··· 83 82 struct fbnic_net *fbn = netdev_priv(netdev); 84 83 85 84 fbnic_down(fbn); 86 - fbnic_pcs_irq_disable(fbn->fbd); 85 + fbnic_pcs_free_irq(fbn->fbd); 87 86 88 87 fbnic_time_stop(fbn); 89 88 fbnic_fw_xmit_ownership_msg(fbn->fbd, false);
+7 -7
drivers/net/ethernet/meta/fbnic/fbnic_pci.c
··· 283 283 goto free_irqs; 284 284 } 285 285 286 - err = fbnic_fw_enable_mbx(fbd); 286 + err = fbnic_fw_request_mbx(fbd); 287 287 if (err) { 288 288 dev_err(&pdev->dev, 289 289 "Firmware mailbox initialization failure\n"); ··· 364 364 fbnic_hwmon_unregister(fbd); 365 365 fbnic_dbg_fbd_exit(fbd); 366 366 fbnic_devlink_unregister(fbd); 367 - fbnic_fw_disable_mbx(fbd); 367 + fbnic_fw_free_mbx(fbd); 368 368 fbnic_free_irqs(fbd); 369 369 370 370 fbnic_devlink_free(fbd); ··· 388 388 rtnl_unlock(); 389 389 390 390 null_uc_addr: 391 - fbnic_fw_disable_mbx(fbd); 391 + fbnic_fw_free_mbx(fbd); 392 392 393 393 /* Free the IRQs so they aren't trying to occupy sleeping CPUs */ 394 394 fbnic_free_irqs(fbd); ··· 421 421 fbd->mac->init_regs(fbd); 422 422 423 423 /* Re-enable mailbox */ 424 - err = fbnic_fw_enable_mbx(fbd); 424 + err = fbnic_fw_request_mbx(fbd); 425 425 if (err) 426 426 goto err_free_irqs; 427 427 ··· 439 439 if (netif_running(netdev)) { 440 440 err = __fbnic_open(fbn); 441 441 if (err) 442 - goto err_disable_mbx; 442 + goto err_free_mbx; 443 443 } 444 444 445 445 rtnl_unlock(); 446 446 447 447 return 0; 448 - err_disable_mbx: 448 + err_free_mbx: 449 449 rtnl_unlock(); 450 - fbnic_fw_disable_mbx(fbd); 450 + fbnic_fw_free_mbx(fbd); 451 451 err_free_irqs: 452 452 fbnic_free_irqs(fbd); 453 453 err_invalidate_uc_addr:
+13 -2
drivers/net/ethernet/ti/icssg/icssg_common.c
··· 187 187 xdp_return_frame(xdpf); 188 188 break; 189 189 default: 190 - netdev_err(ndev, "tx_complete: invalid swdata type %d\n", swdata->type); 191 190 prueth_xmit_free(tx_chn, desc_tx); 192 191 ndev->stats.tx_dropped++; 193 192 continue; ··· 566 567 { 567 568 struct cppi5_host_desc_t *first_desc; 568 569 struct net_device *ndev = emac->ndev; 570 + struct netdev_queue *netif_txq; 569 571 struct prueth_tx_chn *tx_chn; 570 572 dma_addr_t desc_dma, buf_dma; 571 573 struct prueth_swdata *swdata; ··· 620 620 swdata->data.xdpf = xdpf; 621 621 } 622 622 623 + /* Report BQL before sending the packet */ 624 + netif_txq = netdev_get_tx_queue(ndev, tx_chn->id); 625 + netdev_tx_sent_queue(netif_txq, xdpf->len); 626 + 623 627 cppi5_hdesc_set_pktlen(first_desc, xdpf->len); 624 628 desc_dma = k3_cppi_desc_pool_virt2dma(tx_chn->desc_pool, first_desc); 625 629 626 630 ret = k3_udma_glue_push_tx_chn(tx_chn->tx_chn, first_desc, desc_dma); 627 631 if (ret) { 628 632 netdev_err(ndev, "xdp tx: push failed: %d\n", ret); 633 + netdev_tx_completed_queue(netif_txq, 1, xdpf->len); 629 634 goto drop_free_descs; 630 635 } 631 636 ··· 655 650 struct page *page, u32 *len) 656 651 { 657 652 struct net_device *ndev = emac->ndev; 653 + struct netdev_queue *netif_txq; 654 + int cpu = smp_processor_id(); 658 655 struct bpf_prog *xdp_prog; 659 656 struct xdp_frame *xdpf; 660 657 u32 pkt_len = *len; ··· 676 669 goto drop; 677 670 } 678 671 679 - q_idx = smp_processor_id() % emac->tx_ch_num; 672 + q_idx = cpu % emac->tx_ch_num; 673 + netif_txq = netdev_get_tx_queue(ndev, q_idx); 674 + __netif_tx_lock(netif_txq, cpu); 680 675 result = emac_xmit_xdp_frame(emac, xdpf, page, q_idx); 676 + __netif_tx_unlock(netif_txq); 681 677 if (result == ICSSG_XDP_CONSUMED) { 682 678 ndev->stats.tx_dropped++; 683 679 goto drop; ··· 989 979 ret = k3_udma_glue_push_tx_chn(tx_chn->tx_chn, first_desc, desc_dma); 990 980 if (ret) { 991 981 netdev_err(ndev, "tx: push failed: %d\n", ret); 982 + netdev_tx_completed_queue(netif_txq, 1, pkt_len); 992 983 goto drop_free_descs; 993 984 } 994 985
+10 -6
drivers/net/ethernet/ti/icssg/icssg_prueth.c
··· 1075 1075 { 1076 1076 struct prueth_emac *emac = netdev_priv(dev); 1077 1077 struct net_device *ndev = emac->ndev; 1078 + struct netdev_queue *netif_txq; 1079 + int cpu = smp_processor_id(); 1078 1080 struct xdp_frame *xdpf; 1079 1081 unsigned int q_idx; 1080 1082 int nxmit = 0; 1081 1083 u32 err; 1082 1084 int i; 1083 1085 1084 - q_idx = smp_processor_id() % emac->tx_ch_num; 1086 + q_idx = cpu % emac->tx_ch_num; 1087 + netif_txq = netdev_get_tx_queue(ndev, q_idx); 1085 1088 1086 1089 if (unlikely(flags & ~XDP_XMIT_FLAGS_MASK)) 1087 1090 return -EINVAL; 1088 1091 1092 + __netif_tx_lock(netif_txq, cpu); 1089 1093 for (i = 0; i < n; i++) { 1090 1094 xdpf = frames[i]; 1091 1095 err = emac_xmit_xdp_frame(emac, xdpf, NULL, q_idx); ··· 1099 1095 } 1100 1096 nxmit++; 1101 1097 } 1098 + __netif_tx_unlock(netif_txq); 1102 1099 1103 1100 return nxmit; 1104 1101 } ··· 1114 1109 static int emac_xdp_setup(struct prueth_emac *emac, struct netdev_bpf *bpf) 1115 1110 { 1116 1111 struct bpf_prog *prog = bpf->prog; 1117 - xdp_features_t val; 1118 - 1119 - val = NETDEV_XDP_ACT_BASIC | NETDEV_XDP_ACT_REDIRECT | 1120 - NETDEV_XDP_ACT_NDO_XMIT; 1121 - xdp_set_features_flag(emac->ndev, val); 1122 1112 1123 1113 if (!emac->xdpi.prog && !prog) 1124 1114 return 0; ··· 1291 1291 ndev->hw_features = NETIF_F_SG; 1292 1292 ndev->features = ndev->hw_features | NETIF_F_HW_VLAN_CTAG_FILTER; 1293 1293 ndev->hw_features |= NETIF_PRUETH_HSR_OFFLOAD_FEATURES; 1294 + xdp_set_features_flag(ndev, 1295 + NETDEV_XDP_ACT_BASIC | 1296 + NETDEV_XDP_ACT_REDIRECT | 1297 + NETDEV_XDP_ACT_NDO_XMIT); 1294 1298 1295 1299 netif_napi_add(ndev, &emac->napi_rx, icssg_napi_rx_poll); 1296 1300 hrtimer_setup(&emac->rx_hrtimer, &emac_rx_timer_callback, CLOCK_MONOTONIC,
+18 -5
drivers/net/virtio_net.c
··· 3383 3383 bool refill) 3384 3384 { 3385 3385 bool running = netif_running(vi->dev); 3386 + bool schedule_refill = false; 3386 3387 3387 3388 if (refill && !try_fill_recv(vi, rq, GFP_KERNEL)) 3388 - schedule_delayed_work(&vi->refill, 0); 3389 - 3389 + schedule_refill = true; 3390 3390 if (running) 3391 3391 virtnet_napi_enable(rq); 3392 + 3393 + if (schedule_refill) 3394 + schedule_delayed_work(&vi->refill, 0); 3392 3395 } 3393 3396 3394 3397 static void virtnet_rx_resume_all(struct virtnet_info *vi) ··· 3731 3728 succ: 3732 3729 vi->curr_queue_pairs = queue_pairs; 3733 3730 /* virtnet_open() will refill when device is going to up. */ 3734 - if (dev->flags & IFF_UP) 3731 + spin_lock_bh(&vi->refill_lock); 3732 + if (dev->flags & IFF_UP && vi->refill_enabled) 3735 3733 schedule_delayed_work(&vi->refill, 0); 3734 + spin_unlock_bh(&vi->refill_lock); 3736 3735 3737 3736 return 0; 3738 3737 } ··· 5678 5673 5679 5674 if (vi->device_stats_cap & VIRTIO_NET_STATS_TYPE_TX_SPEED) 5680 5675 tx->hw_drop_ratelimits = 0; 5676 + 5677 + netdev_stat_queue_sum(dev, 5678 + dev->real_num_rx_queues, vi->max_queue_pairs, rx, 5679 + dev->real_num_tx_queues, vi->max_queue_pairs, tx); 5681 5680 } 5682 5681 5683 5682 static const struct netdev_stat_ops virtnet_stat_ops = { ··· 5894 5885 5895 5886 hdr_dma = virtqueue_dma_map_single_attrs(sq->vq, &xsk_hdr, vi->hdr_len, 5896 5887 DMA_TO_DEVICE, 0); 5897 - if (virtqueue_dma_mapping_error(sq->vq, hdr_dma)) 5898 - return -ENOMEM; 5888 + if (virtqueue_dma_mapping_error(sq->vq, hdr_dma)) { 5889 + err = -ENOMEM; 5890 + goto err_free_buffs; 5891 + } 5899 5892 5900 5893 err = xsk_pool_dma_map(pool, dma_dev, 0); 5901 5894 if (err) ··· 5925 5914 err_xsk_map: 5926 5915 virtqueue_dma_unmap_single_attrs(rq->vq, hdr_dma, vi->hdr_len, 5927 5916 DMA_TO_DEVICE, 0); 5917 + err_free_buffs: 5918 + kvfree(rq->xsk_buffs); 5928 5919 return err; 5929 5920 } 5930 5921
+2
drivers/net/wireless/intel/iwlwifi/pcie/drv.c
··· 588 588 IWL_DEV_INFO(0x7A70, 0x1692, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name), 589 589 IWL_DEV_INFO(0x7AF0, 0x1691, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690s_name), 590 590 IWL_DEV_INFO(0x7AF0, 0x1692, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name), 591 + IWL_DEV_INFO(0x7F70, 0x1691, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690s_name), 592 + IWL_DEV_INFO(0x7F70, 0x1692, iwlax411_2ax_cfg_so_gf4_a0, iwl_ax411_killer_1690i_name), 591 593 592 594 IWL_DEV_INFO(0x271C, 0x0214, iwl9260_2ac_cfg, iwl9260_1_name), 593 595 IWL_DEV_INFO(0x7E40, 0x1691, iwl_cfg_ma, iwl_ax411_killer_1690s_name),
+1
drivers/nvme/host/Kconfig
··· 102 102 depends on NVME_TCP 103 103 select NET_HANDSHAKE 104 104 select KEYS 105 + select TLS 105 106 help 106 107 Enables TLS encryption for NVMe TCP using the netlink handshake API. 107 108
+7 -1
drivers/nvme/host/pci.c
··· 3575 3575 3576 3576 dev_info(dev->ctrl.device, "restart after slot reset\n"); 3577 3577 pci_restore_state(pdev); 3578 - if (!nvme_try_sched_reset(&dev->ctrl)) 3578 + if (nvme_try_sched_reset(&dev->ctrl)) 3579 3579 nvme_unquiesce_io_queues(&dev->ctrl); 3580 3580 return PCI_ERS_RESULT_RECOVERED; 3581 3581 } ··· 3623 3623 .driver_data = NVME_QUIRK_BOGUS_NID, }, 3624 3624 { PCI_DEVICE(0x1217, 0x8760), /* O2 Micro 64GB Steam Deck */ 3625 3625 .driver_data = NVME_QUIRK_DMAPOOL_ALIGN_512, }, 3626 + { PCI_DEVICE(0x126f, 0x1001), /* Silicon Motion generic */ 3627 + .driver_data = NVME_QUIRK_NO_DEEPEST_PS | 3628 + NVME_QUIRK_IGNORE_DEV_SUBNQN, }, 3626 3629 { PCI_DEVICE(0x126f, 0x2262), /* Silicon Motion generic */ 3627 3630 .driver_data = NVME_QUIRK_NO_DEEPEST_PS | 3628 3631 NVME_QUIRK_BOGUS_NID, }, ··· 3649 3646 NVME_QUIRK_IGNORE_DEV_SUBNQN, }, 3650 3647 { PCI_DEVICE(0x15b7, 0x5008), /* Sandisk SN530 */ 3651 3648 .driver_data = NVME_QUIRK_BROKEN_MSI }, 3649 + { PCI_DEVICE(0x15b7, 0x5009), /* Sandisk SN550 */ 3650 + .driver_data = NVME_QUIRK_BROKEN_MSI | 3651 + NVME_QUIRK_NO_DEEPEST_PS }, 3652 3652 { PCI_DEVICE(0x1987, 0x5012), /* Phison E12 */ 3653 3653 .driver_data = NVME_QUIRK_BOGUS_NID, }, 3654 3654 { PCI_DEVICE(0x1987, 0x5016), /* Phison E16 */
+29 -2
drivers/nvme/host/tcp.c
··· 1946 1946 cancel_work_sync(&queue->io_work); 1947 1947 } 1948 1948 1949 - static void nvme_tcp_stop_queue(struct nvme_ctrl *nctrl, int qid) 1949 + static void nvme_tcp_stop_queue_nowait(struct nvme_ctrl *nctrl, int qid) 1950 1950 { 1951 1951 struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl); 1952 1952 struct nvme_tcp_queue *queue = &ctrl->queues[qid]; ··· 1964 1964 queue->tls_enabled = false; 1965 1965 mutex_unlock(&queue->queue_lock); 1966 1966 } 1967 + 1968 + static void nvme_tcp_wait_queue(struct nvme_ctrl *nctrl, int qid) 1969 + { 1970 + struct nvme_tcp_ctrl *ctrl = to_tcp_ctrl(nctrl); 1971 + struct nvme_tcp_queue *queue = &ctrl->queues[qid]; 1972 + int timeout = 100; 1973 + 1974 + while (timeout > 0) { 1975 + if (!test_bit(NVME_TCP_Q_ALLOCATED, &queue->flags) || 1976 + !sk_wmem_alloc_get(queue->sock->sk)) 1977 + return; 1978 + msleep(2); 1979 + timeout -= 2; 1980 + } 1981 + dev_warn(nctrl->device, 1982 + "qid %d: timeout draining sock wmem allocation expired\n", 1983 + qid); 1984 + } 1985 + 1986 + static void nvme_tcp_stop_queue(struct nvme_ctrl *nctrl, int qid) 1987 + { 1988 + nvme_tcp_stop_queue_nowait(nctrl, qid); 1989 + nvme_tcp_wait_queue(nctrl, qid); 1990 + } 1991 + 1967 1992 1968 1993 static void nvme_tcp_setup_sock_ops(struct nvme_tcp_queue *queue) 1969 1994 { ··· 2057 2032 int i; 2058 2033 2059 2034 for (i = 1; i < ctrl->queue_count; i++) 2060 - nvme_tcp_stop_queue(ctrl, i); 2035 + nvme_tcp_stop_queue_nowait(ctrl, i); 2036 + for (i = 1; i < ctrl->queue_count; i++) 2037 + nvme_tcp_wait_queue(ctrl, i); 2061 2038 } 2062 2039 2063 2040 static int nvme_tcp_start_io_queues(struct nvme_ctrl *ctrl,
+1
drivers/nvme/target/Kconfig
··· 98 98 bool "NVMe over Fabrics TCP target TLS encryption support" 99 99 depends on NVME_TARGET_TCP 100 100 select NET_HANDSHAKE 101 + select TLS 101 102 help 102 103 Enables TLS encryption for the NVMe TCP target using the netlink handshake API. 103 104
+1 -2
drivers/nvme/target/auth.c
··· 600 600 pr_warn("%s: ctrl %d qid %d failed to refresh key, error %ld\n", 601 601 __func__, sq->ctrl->cntlid, sq->qid, PTR_ERR(tls_key)); 602 602 tls_key = NULL; 603 - kfree_sensitive(tls_psk); 604 603 } 605 604 if (sq->ctrl->tls_key) 606 605 key_put(sq->ctrl->tls_key); 607 606 sq->ctrl->tls_key = tls_key; 608 607 #endif 609 - 608 + kfree_sensitive(tls_psk); 610 609 out_free_digest: 611 610 kfree_sensitive(digest); 612 611 out_free_psk:
+3
drivers/nvme/target/tcp.c
··· 1560 1560 { 1561 1561 struct socket *sock = queue->sock; 1562 1562 1563 + if (!queue->state_change) 1564 + return; 1565 + 1563 1566 write_lock_bh(&sock->sk->sk_callback_lock); 1564 1567 sock->sk->sk_data_ready = queue->data_ready; 1565 1568 sock->sk->sk_state_change = queue->state_change;
-1
drivers/pci/hotplug/s390_pci_hpc.c
··· 59 59 60 60 pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn); 61 61 if (pdev && pci_num_vf(pdev)) { 62 - pci_dev_put(pdev); 63 62 rc = -EBUSY; 64 63 goto out; 65 64 }
+3 -3
drivers/pinctrl/freescale/pinctrl-imx.c
··· 37 37 struct pinctrl_dev *pctldev, 38 38 const char *name) 39 39 { 40 - const struct group_desc *grp = NULL; 40 + const struct group_desc *grp; 41 41 int i; 42 42 43 43 for (i = 0; i < pctldev->num_groups; i++) { 44 44 grp = pinctrl_generic_get_group(pctldev, i); 45 45 if (grp && !strcmp(grp->grp.name, name)) 46 - break; 46 + return grp; 47 47 } 48 48 49 - return grp; 49 + return NULL; 50 50 } 51 51 52 52 static void imx_pin_dbg_show(struct pinctrl_dev *pctldev, struct seq_file *s,
+1 -1
drivers/pinctrl/mediatek/mtk-eint.c
··· 449 449 return -EOPNOTSUPP; 450 450 451 451 virq = irq_find_mapping(eint->domain, eint_num); 452 - eint_offset = (eint_num % 4) * 8; 452 + eint_offset = (idx % 4) * 8; 453 453 d = irq_get_irq_data(virq); 454 454 455 455 set_offset = (idx / 4) * 4 + eint->regs->dbnc_set;
+70 -89
drivers/pinctrl/mediatek/pinctrl-airoha.c
··· 6 6 */ 7 7 8 8 #include <dt-bindings/pinctrl/mt65xx.h> 9 + #include <linux/bitfield.h> 9 10 #include <linux/bits.h> 10 11 #include <linux/cleanup.h> 11 12 #include <linux/gpio/driver.h> ··· 113 112 #define REG_LAN_LED1_MAPPING 0x0280 114 113 115 114 #define LAN4_LED_MAPPING_MASK GENMASK(18, 16) 116 - #define LAN4_PHY4_LED_MAP BIT(18) 117 - #define LAN4_PHY2_LED_MAP BIT(17) 118 - #define LAN4_PHY1_LED_MAP BIT(16) 119 - #define LAN4_PHY0_LED_MAP 0 120 - #define LAN4_PHY3_LED_MAP GENMASK(17, 16) 115 + #define LAN4_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN4_LED_MAPPING_MASK, (_n)) 121 116 122 117 #define LAN3_LED_MAPPING_MASK GENMASK(14, 12) 123 - #define LAN3_PHY4_LED_MAP BIT(14) 124 - #define LAN3_PHY2_LED_MAP BIT(13) 125 - #define LAN3_PHY1_LED_MAP BIT(12) 126 - #define LAN3_PHY0_LED_MAP 0 127 - #define LAN3_PHY3_LED_MAP GENMASK(13, 12) 118 + #define LAN3_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN3_LED_MAPPING_MASK, (_n)) 128 119 129 120 #define LAN2_LED_MAPPING_MASK GENMASK(10, 8) 130 - #define LAN2_PHY4_LED_MAP BIT(12) 131 - #define LAN2_PHY2_LED_MAP BIT(11) 132 - #define LAN2_PHY1_LED_MAP BIT(10) 133 - #define LAN2_PHY0_LED_MAP 0 134 - #define LAN2_PHY3_LED_MAP GENMASK(11, 10) 121 + #define LAN2_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN2_LED_MAPPING_MASK, (_n)) 135 122 136 123 #define LAN1_LED_MAPPING_MASK GENMASK(6, 4) 137 - #define LAN1_PHY4_LED_MAP BIT(6) 138 - #define LAN1_PHY2_LED_MAP BIT(5) 139 - #define LAN1_PHY1_LED_MAP BIT(4) 140 - #define LAN1_PHY0_LED_MAP 0 141 - #define LAN1_PHY3_LED_MAP GENMASK(5, 4) 124 + #define LAN1_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN1_LED_MAPPING_MASK, (_n)) 142 125 143 126 #define LAN0_LED_MAPPING_MASK GENMASK(2, 0) 144 - #define LAN0_PHY4_LED_MAP BIT(3) 145 - #define LAN0_PHY2_LED_MAP BIT(2) 146 - #define LAN0_PHY1_LED_MAP BIT(1) 147 - #define LAN0_PHY0_LED_MAP 0 148 - #define LAN0_PHY3_LED_MAP GENMASK(2, 1) 127 + #define LAN0_PHY_LED_MAP(_n) FIELD_PREP_CONST(LAN0_LED_MAPPING_MASK, (_n)) 149 128 150 129 /* CONF */ 151 130 #define REG_I2C_SDA_E2 0x001c ··· 1457 1476 .regmap[1] = { 1458 1477 AIROHA_FUNC_MUX, 1459 1478 REG_LAN_LED0_MAPPING, 1460 - LAN1_LED_MAPPING_MASK, 1461 - LAN1_PHY1_LED_MAP 1479 + LAN0_LED_MAPPING_MASK, 1480 + LAN0_PHY_LED_MAP(0) 1462 1481 }, 1463 1482 .regmap_size = 2, 1464 1483 }, { ··· 1472 1491 .regmap[1] = { 1473 1492 AIROHA_FUNC_MUX, 1474 1493 REG_LAN_LED0_MAPPING, 1475 - LAN2_LED_MAPPING_MASK, 1476 - LAN2_PHY1_LED_MAP 1494 + LAN1_LED_MAPPING_MASK, 1495 + LAN1_PHY_LED_MAP(0) 1477 1496 }, 1478 1497 .regmap_size = 2, 1479 1498 }, { ··· 1487 1506 .regmap[1] = { 1488 1507 AIROHA_FUNC_MUX, 1489 1508 REG_LAN_LED0_MAPPING, 1490 - LAN3_LED_MAPPING_MASK, 1491 - LAN3_PHY1_LED_MAP 1509 + LAN2_LED_MAPPING_MASK, 1510 + LAN2_PHY_LED_MAP(0) 1492 1511 }, 1493 1512 .regmap_size = 2, 1494 1513 }, { ··· 1502 1521 .regmap[1] = { 1503 1522 AIROHA_FUNC_MUX, 1504 1523 REG_LAN_LED0_MAPPING, 1505 - LAN4_LED_MAPPING_MASK, 1506 - LAN4_PHY1_LED_MAP 1524 + LAN3_LED_MAPPING_MASK, 1525 + LAN3_PHY_LED_MAP(0) 1507 1526 }, 1508 1527 .regmap_size = 2, 1509 1528 }, ··· 1521 1540 .regmap[1] = { 1522 1541 AIROHA_FUNC_MUX, 1523 1542 REG_LAN_LED0_MAPPING, 1524 - LAN1_LED_MAPPING_MASK, 1525 - LAN1_PHY2_LED_MAP 1543 + LAN0_LED_MAPPING_MASK, 1544 + LAN0_PHY_LED_MAP(1) 1526 1545 }, 1527 1546 .regmap_size = 2, 1528 1547 }, { ··· 1536 1555 .regmap[1] = { 1537 1556 AIROHA_FUNC_MUX, 1538 1557 REG_LAN_LED0_MAPPING, 1539 - LAN2_LED_MAPPING_MASK, 1540 - LAN2_PHY2_LED_MAP 1558 + LAN1_LED_MAPPING_MASK, 1559 + LAN1_PHY_LED_MAP(1) 1541 1560 }, 1542 1561 .regmap_size = 2, 1543 1562 }, { ··· 1551 1570 .regmap[1] = { 1552 1571 AIROHA_FUNC_MUX, 1553 1572 REG_LAN_LED0_MAPPING, 1554 - LAN3_LED_MAPPING_MASK, 1555 - LAN3_PHY2_LED_MAP 1573 + LAN2_LED_MAPPING_MASK, 1574 + LAN2_PHY_LED_MAP(1) 1556 1575 }, 1557 1576 .regmap_size = 2, 1558 1577 }, { ··· 1566 1585 .regmap[1] = { 1567 1586 AIROHA_FUNC_MUX, 1568 1587 REG_LAN_LED0_MAPPING, 1569 - LAN4_LED_MAPPING_MASK, 1570 - LAN4_PHY2_LED_MAP 1588 + LAN3_LED_MAPPING_MASK, 1589 + LAN3_PHY_LED_MAP(1) 1571 1590 }, 1572 1591 .regmap_size = 2, 1573 1592 }, ··· 1585 1604 .regmap[1] = { 1586 1605 AIROHA_FUNC_MUX, 1587 1606 REG_LAN_LED0_MAPPING, 1588 - LAN1_LED_MAPPING_MASK, 1589 - LAN1_PHY3_LED_MAP 1607 + LAN0_LED_MAPPING_MASK, 1608 + LAN0_PHY_LED_MAP(2) 1590 1609 }, 1591 1610 .regmap_size = 2, 1592 1611 }, { ··· 1600 1619 .regmap[1] = { 1601 1620 AIROHA_FUNC_MUX, 1602 1621 REG_LAN_LED0_MAPPING, 1603 - LAN2_LED_MAPPING_MASK, 1604 - LAN2_PHY3_LED_MAP 1622 + LAN1_LED_MAPPING_MASK, 1623 + LAN1_PHY_LED_MAP(2) 1605 1624 }, 1606 1625 .regmap_size = 2, 1607 1626 }, { ··· 1615 1634 .regmap[1] = { 1616 1635 AIROHA_FUNC_MUX, 1617 1636 REG_LAN_LED0_MAPPING, 1618 - LAN3_LED_MAPPING_MASK, 1619 - LAN3_PHY3_LED_MAP 1637 + LAN2_LED_MAPPING_MASK, 1638 + LAN2_PHY_LED_MAP(2) 1620 1639 }, 1621 1640 .regmap_size = 2, 1622 1641 }, { ··· 1630 1649 .regmap[1] = { 1631 1650 AIROHA_FUNC_MUX, 1632 1651 REG_LAN_LED0_MAPPING, 1633 - LAN4_LED_MAPPING_MASK, 1634 - LAN4_PHY3_LED_MAP 1652 + LAN3_LED_MAPPING_MASK, 1653 + LAN3_PHY_LED_MAP(2) 1635 1654 }, 1636 1655 .regmap_size = 2, 1637 1656 }, ··· 1649 1668 .regmap[1] = { 1650 1669 AIROHA_FUNC_MUX, 1651 1670 REG_LAN_LED0_MAPPING, 1652 - LAN1_LED_MAPPING_MASK, 1653 - LAN1_PHY4_LED_MAP 1671 + LAN0_LED_MAPPING_MASK, 1672 + LAN0_PHY_LED_MAP(3) 1654 1673 }, 1655 1674 .regmap_size = 2, 1656 1675 }, { ··· 1664 1683 .regmap[1] = { 1665 1684 AIROHA_FUNC_MUX, 1666 1685 REG_LAN_LED0_MAPPING, 1667 - LAN2_LED_MAPPING_MASK, 1668 - LAN2_PHY4_LED_MAP 1686 + LAN1_LED_MAPPING_MASK, 1687 + LAN1_PHY_LED_MAP(3) 1669 1688 }, 1670 1689 .regmap_size = 2, 1671 1690 }, { ··· 1679 1698 .regmap[1] = { 1680 1699 AIROHA_FUNC_MUX, 1681 1700 REG_LAN_LED0_MAPPING, 1682 - LAN3_LED_MAPPING_MASK, 1683 - LAN3_PHY4_LED_MAP 1701 + LAN2_LED_MAPPING_MASK, 1702 + LAN2_PHY_LED_MAP(3) 1684 1703 }, 1685 1704 .regmap_size = 2, 1686 1705 }, { ··· 1694 1713 .regmap[1] = { 1695 1714 AIROHA_FUNC_MUX, 1696 1715 REG_LAN_LED0_MAPPING, 1697 - LAN4_LED_MAPPING_MASK, 1698 - LAN4_PHY4_LED_MAP 1716 + LAN3_LED_MAPPING_MASK, 1717 + LAN3_PHY_LED_MAP(3) 1699 1718 }, 1700 1719 .regmap_size = 2, 1701 1720 }, ··· 1713 1732 .regmap[1] = { 1714 1733 AIROHA_FUNC_MUX, 1715 1734 REG_LAN_LED1_MAPPING, 1716 - LAN1_LED_MAPPING_MASK, 1717 - LAN1_PHY1_LED_MAP 1735 + LAN0_LED_MAPPING_MASK, 1736 + LAN0_PHY_LED_MAP(0) 1718 1737 }, 1719 1738 .regmap_size = 2, 1720 1739 }, { ··· 1728 1747 .regmap[1] = { 1729 1748 AIROHA_FUNC_MUX, 1730 1749 REG_LAN_LED1_MAPPING, 1731 - LAN2_LED_MAPPING_MASK, 1732 - LAN2_PHY1_LED_MAP 1750 + LAN1_LED_MAPPING_MASK, 1751 + LAN1_PHY_LED_MAP(0) 1733 1752 }, 1734 1753 .regmap_size = 2, 1735 1754 }, { ··· 1743 1762 .regmap[1] = { 1744 1763 AIROHA_FUNC_MUX, 1745 1764 REG_LAN_LED1_MAPPING, 1746 - LAN3_LED_MAPPING_MASK, 1747 - LAN3_PHY1_LED_MAP 1765 + LAN2_LED_MAPPING_MASK, 1766 + LAN2_PHY_LED_MAP(0) 1748 1767 }, 1749 1768 .regmap_size = 2, 1750 1769 }, { ··· 1758 1777 .regmap[1] = { 1759 1778 AIROHA_FUNC_MUX, 1760 1779 REG_LAN_LED1_MAPPING, 1761 - LAN4_LED_MAPPING_MASK, 1762 - LAN4_PHY1_LED_MAP 1780 + LAN3_LED_MAPPING_MASK, 1781 + LAN3_PHY_LED_MAP(0) 1763 1782 }, 1764 1783 .regmap_size = 2, 1765 1784 }, ··· 1777 1796 .regmap[1] = { 1778 1797 AIROHA_FUNC_MUX, 1779 1798 REG_LAN_LED1_MAPPING, 1780 - LAN1_LED_MAPPING_MASK, 1781 - LAN1_PHY2_LED_MAP 1799 + LAN0_LED_MAPPING_MASK, 1800 + LAN0_PHY_LED_MAP(1) 1782 1801 }, 1783 1802 .regmap_size = 2, 1784 1803 }, { ··· 1792 1811 .regmap[1] = { 1793 1812 AIROHA_FUNC_MUX, 1794 1813 REG_LAN_LED1_MAPPING, 1795 - LAN2_LED_MAPPING_MASK, 1796 - LAN2_PHY2_LED_MAP 1814 + LAN1_LED_MAPPING_MASK, 1815 + LAN1_PHY_LED_MAP(1) 1797 1816 }, 1798 1817 .regmap_size = 2, 1799 1818 }, { ··· 1807 1826 .regmap[1] = { 1808 1827 AIROHA_FUNC_MUX, 1809 1828 REG_LAN_LED1_MAPPING, 1810 - LAN3_LED_MAPPING_MASK, 1811 - LAN3_PHY2_LED_MAP 1829 + LAN2_LED_MAPPING_MASK, 1830 + LAN2_PHY_LED_MAP(1) 1812 1831 }, 1813 1832 .regmap_size = 2, 1814 1833 }, { ··· 1822 1841 .regmap[1] = { 1823 1842 AIROHA_FUNC_MUX, 1824 1843 REG_LAN_LED1_MAPPING, 1825 - LAN4_LED_MAPPING_MASK, 1826 - LAN4_PHY2_LED_MAP 1844 + LAN3_LED_MAPPING_MASK, 1845 + LAN3_PHY_LED_MAP(1) 1827 1846 }, 1828 1847 .regmap_size = 2, 1829 1848 }, ··· 1841 1860 .regmap[1] = { 1842 1861 AIROHA_FUNC_MUX, 1843 1862 REG_LAN_LED1_MAPPING, 1844 - LAN1_LED_MAPPING_MASK, 1845 - LAN1_PHY3_LED_MAP 1863 + LAN0_LED_MAPPING_MASK, 1864 + LAN0_PHY_LED_MAP(2) 1846 1865 }, 1847 1866 .regmap_size = 2, 1848 1867 }, { ··· 1856 1875 .regmap[1] = { 1857 1876 AIROHA_FUNC_MUX, 1858 1877 REG_LAN_LED1_MAPPING, 1859 - LAN2_LED_MAPPING_MASK, 1860 - LAN2_PHY3_LED_MAP 1878 + LAN1_LED_MAPPING_MASK, 1879 + LAN1_PHY_LED_MAP(2) 1861 1880 }, 1862 1881 .regmap_size = 2, 1863 1882 }, { ··· 1871 1890 .regmap[1] = { 1872 1891 AIROHA_FUNC_MUX, 1873 1892 REG_LAN_LED1_MAPPING, 1874 - LAN3_LED_MAPPING_MASK, 1875 - LAN3_PHY3_LED_MAP 1893 + LAN2_LED_MAPPING_MASK, 1894 + LAN2_PHY_LED_MAP(2) 1876 1895 }, 1877 1896 .regmap_size = 2, 1878 1897 }, { ··· 1886 1905 .regmap[1] = { 1887 1906 AIROHA_FUNC_MUX, 1888 1907 REG_LAN_LED1_MAPPING, 1889 - LAN4_LED_MAPPING_MASK, 1890 - LAN4_PHY3_LED_MAP 1908 + LAN3_LED_MAPPING_MASK, 1909 + LAN3_PHY_LED_MAP(2) 1891 1910 }, 1892 1911 .regmap_size = 2, 1893 1912 }, ··· 1905 1924 .regmap[1] = { 1906 1925 AIROHA_FUNC_MUX, 1907 1926 REG_LAN_LED1_MAPPING, 1908 - LAN1_LED_MAPPING_MASK, 1909 - LAN1_PHY4_LED_MAP 1927 + LAN0_LED_MAPPING_MASK, 1928 + LAN0_PHY_LED_MAP(3) 1910 1929 }, 1911 1930 .regmap_size = 2, 1912 1931 }, { ··· 1920 1939 .regmap[1] = { 1921 1940 AIROHA_FUNC_MUX, 1922 1941 REG_LAN_LED1_MAPPING, 1923 - LAN2_LED_MAPPING_MASK, 1924 - LAN2_PHY4_LED_MAP 1942 + LAN1_LED_MAPPING_MASK, 1943 + LAN1_PHY_LED_MAP(3) 1925 1944 }, 1926 1945 .regmap_size = 2, 1927 1946 }, { ··· 1935 1954 .regmap[1] = { 1936 1955 AIROHA_FUNC_MUX, 1937 1956 REG_LAN_LED1_MAPPING, 1938 - LAN3_LED_MAPPING_MASK, 1939 - LAN3_PHY4_LED_MAP 1957 + LAN2_LED_MAPPING_MASK, 1958 + LAN2_PHY_LED_MAP(3) 1940 1959 }, 1941 1960 .regmap_size = 2, 1942 1961 }, { ··· 1950 1969 .regmap[1] = { 1951 1970 AIROHA_FUNC_MUX, 1952 1971 REG_LAN_LED1_MAPPING, 1953 - LAN4_LED_MAPPING_MASK, 1954 - LAN4_PHY4_LED_MAP 1972 + LAN3_LED_MAPPING_MASK, 1973 + LAN3_PHY_LED_MAP(3) 1955 1974 }, 1956 1975 .regmap_size = 2, 1957 1976 },
+9 -3
drivers/pinctrl/mediatek/pinctrl-mtk-common.c
··· 1015 1015 if (!pctl->eint) 1016 1016 return -ENOMEM; 1017 1017 1018 - pctl->eint->base = devm_platform_ioremap_resource(pdev, 0); 1019 - if (IS_ERR(pctl->eint->base)) 1020 - return PTR_ERR(pctl->eint->base); 1018 + pctl->eint->nbase = 1; 1019 + /* mtk-eint expects an array */ 1020 + pctl->eint->base = devm_kzalloc(pctl->dev, sizeof(pctl->eint->base), GFP_KERNEL); 1021 + if (!pctl->eint->base) 1022 + return -ENOMEM; 1023 + 1024 + pctl->eint->base[0] = devm_platform_ioremap_resource(pdev, 0); 1025 + if (IS_ERR(pctl->eint->base[0])) 1026 + return PTR_ERR(pctl->eint->base[0]); 1021 1027 1022 1028 pctl->eint->irq = irq_of_parse_and_map(np, 0); 1023 1029 if (!pctl->eint->irq)
+1 -1
drivers/pinctrl/meson/pinctrl-meson.c
··· 487 487 case PIN_CONFIG_BIAS_PULL_DOWN: 488 488 case PIN_CONFIG_BIAS_PULL_UP: 489 489 if (meson_pinconf_get_pull(pc, pin) == param) 490 - arg = 1; 490 + arg = 60000; 491 491 else 492 492 return -EINVAL; 493 493 break;
+3 -1
drivers/pinctrl/qcom/pinctrl-sm8750.c
··· 46 46 .out_bit = 1, \ 47 47 .intr_enable_bit = 0, \ 48 48 .intr_status_bit = 0, \ 49 - .intr_target_bit = 5, \ 49 + .intr_wakeup_present_bit = 6, \ 50 + .intr_wakeup_enable_bit = 7, \ 51 + .intr_target_bit = 8, \ 50 52 .intr_target_kpss_val = 3, \ 51 53 .intr_raw_status_bit = 4, \ 52 54 .intr_polarity_bit = 1, \
+1 -2
drivers/s390/block/Kconfig
··· 5 5 config DCSSBLK 6 6 def_tristate m 7 7 prompt "DCSSBLK support" 8 - depends on S390 && BLOCK 8 + depends on S390 && BLOCK && (DAX || DAX=n) 9 9 help 10 10 Support for dcss block device 11 11 ··· 14 14 depends on DCSSBLK 15 15 # requires S390 ZONE_DEVICE support 16 16 depends on BROKEN 17 - select DAX 18 17 prompt "DCSSBLK DAX support" 19 18 help 20 19 Enable DAX operation for the dcss block device
+1 -1
drivers/scsi/myrb.c
··· 891 891 status = mmio_init_fn(pdev, base, &mbox); 892 892 if (status != MYRB_STATUS_SUCCESS) { 893 893 dev_err(&pdev->dev, 894 - "Failed to enable mailbox, statux %02X\n", 894 + "Failed to enable mailbox, status %02X\n", 895 895 status); 896 896 return false; 897 897 }
+13 -23
drivers/soundwire/intel_auxdevice.c
··· 353 353 /* use generic bandwidth allocation algorithm */ 354 354 sdw->cdns.bus.compute_params = sdw_compute_params; 355 355 356 - /* avoid resuming from pm_runtime suspend if it's not required */ 357 - dev_pm_set_driver_flags(dev, DPM_FLAG_SMART_SUSPEND); 358 - 359 356 ret = sdw_bus_master_add(bus, dev, dev->fwnode); 360 357 if (ret) { 361 358 dev_err(dev, "sdw_bus_master_add fail: %d\n", ret); ··· 637 640 return 0; 638 641 } 639 642 640 - if (pm_runtime_suspended(dev)) { 643 + /* Prevent runtime PM from racing with the code below. */ 644 + pm_runtime_disable(dev); 645 + 646 + if (pm_runtime_status_suspended(dev)) { 641 647 dev_dbg(dev, "pm_runtime status: suspended\n"); 642 648 643 649 clock_stop_quirks = sdw->link_res->clock_stop_quirks; ··· 648 648 if ((clock_stop_quirks & SDW_INTEL_CLK_STOP_BUS_RESET) || 649 649 !clock_stop_quirks) { 650 650 651 - if (pm_runtime_suspended(dev->parent)) { 651 + if (pm_runtime_status_suspended(dev->parent)) { 652 652 /* 653 653 * paranoia check: this should not happen with the .prepare 654 654 * resume to full power ··· 715 715 struct sdw_cdns *cdns = dev_get_drvdata(dev); 716 716 struct sdw_intel *sdw = cdns_to_intel(cdns); 717 717 struct sdw_bus *bus = &cdns->bus; 718 - int link_flags; 719 718 int ret; 720 719 721 720 if (bus->prop.hw_disabled || !sdw->startup_done) { 722 721 dev_dbg(dev, "SoundWire master %d is disabled or not-started, ignoring\n", 723 722 bus->link_id); 724 723 return 0; 725 - } 726 - 727 - if (pm_runtime_suspended(dev)) { 728 - dev_dbg(dev, "pm_runtime status was suspended, forcing active\n"); 729 - 730 - /* follow required sequence from runtime_pm.rst */ 731 - pm_runtime_disable(dev); 732 - pm_runtime_set_active(dev); 733 - pm_runtime_mark_last_busy(dev); 734 - pm_runtime_enable(dev); 735 - 736 - pm_runtime_resume(bus->dev); 737 - 738 - link_flags = md_flags >> (bus->link_id * 8); 739 - 740 - if (!(link_flags & SDW_INTEL_MASTER_DISABLE_PM_RUNTIME_IDLE)) 741 - pm_runtime_idle(dev); 742 724 } 743 725 744 726 ret = sdw_intel_link_power_up(sdw); ··· 741 759 sdw_intel_link_power_down(sdw); 742 760 return ret; 743 761 } 762 + 763 + /* 764 + * Runtime PM has been disabled in intel_suspend(), so set the status 765 + * to active because the device has just been resumed and re-enable 766 + * runtime PM. 767 + */ 768 + pm_runtime_set_active(dev); 769 + pm_runtime_enable(dev); 744 770 745 771 /* 746 772 * after system resume, the pm_runtime suspend() may kick in
+5 -1
drivers/spi/spi-mem.c
··· 596 596 ns_per_cycles = 1000000000 / op->max_freq; 597 597 ncycles += ((op->cmd.nbytes * 8) / op->cmd.buswidth) / (op->cmd.dtr ? 2 : 1); 598 598 ncycles += ((op->addr.nbytes * 8) / op->addr.buswidth) / (op->addr.dtr ? 2 : 1); 599 - ncycles += ((op->dummy.nbytes * 8) / op->dummy.buswidth) / (op->dummy.dtr ? 2 : 1); 599 + 600 + /* Dummy bytes are optional for some SPI flash memory operations */ 601 + if (op->dummy.nbytes) 602 + ncycles += ((op->dummy.nbytes * 8) / op->dummy.buswidth) / (op->dummy.dtr ? 2 : 1); 603 + 600 604 ncycles += ((op->data.nbytes * 8) / op->data.buswidth) / (op->data.dtr ? 2 : 1); 601 605 602 606 return ncycles * ns_per_cycles;
+2 -3
drivers/spi/spi-qpic-snand.c
··· 142 142 else if (reg == NAND_READ_LOCATION_1) 143 143 snandc->regs->read_location1 = locreg_val; 144 144 else if (reg == NAND_READ_LOCATION_2) 145 - snandc->regs->read_location1 = locreg_val; 145 + snandc->regs->read_location2 = locreg_val; 146 146 else if (reg == NAND_READ_LOCATION_3) 147 147 snandc->regs->read_location3 = locreg_val; 148 148 } ··· 1307 1307 snandc->qspi->addr1 = cpu_to_le32(s_op.addr1_reg << 16); 1308 1308 snandc->qspi->addr2 = cpu_to_le32(s_op.addr2_reg); 1309 1309 snandc->qspi->cmd = cpu_to_le32(cmd); 1310 - qcom_spi_block_erase(snandc); 1311 - return 0; 1310 + return qcom_spi_block_erase(snandc); 1312 1311 default: 1313 1312 break; 1314 1313 }
+4
drivers/spi/spi-stm32-ospi.c
··· 960 960 err_pm_enable: 961 961 pm_runtime_force_suspend(ospi->dev); 962 962 mutex_destroy(&ospi->lock); 963 + if (ospi->dma_chtx) 964 + dma_release_channel(ospi->dma_chtx); 965 + if (ospi->dma_chrx) 966 + dma_release_channel(ospi->dma_chrx); 963 967 964 968 return ret; 965 969 }
+3 -3
drivers/spi/spi-tegra114.c
··· 728 728 u32 inactive_cycles; 729 729 u8 cs_state; 730 730 731 - if (setup->unit != SPI_DELAY_UNIT_SCK || 732 - hold->unit != SPI_DELAY_UNIT_SCK || 733 - inactive->unit != SPI_DELAY_UNIT_SCK) { 731 + if ((setup->unit && setup->unit != SPI_DELAY_UNIT_SCK) || 732 + (hold->unit && hold->unit != SPI_DELAY_UNIT_SCK) || 733 + (inactive->unit && inactive->unit != SPI_DELAY_UNIT_SCK)) { 734 734 dev_err(&spi->dev, 735 735 "Invalid delay unit %d, should be SPI_DELAY_UNIT_SCK\n", 736 736 SPI_DELAY_UNIT_SCK);
-2
drivers/ufs/core/ufshcd.c
··· 7265 7265 err = -EINVAL; 7266 7266 } 7267 7267 } 7268 - ufshcd_add_query_upiu_trace(hba, err ? UFS_QUERY_ERR : UFS_QUERY_COMP, 7269 - (struct utp_upiu_req *)lrbp->ucd_rsp_ptr); 7270 7268 7271 7269 return err; 7272 7270 }
+25 -2
fs/bcachefs/btree_gc.c
··· 47 47 #define DROP_PREV_NODE 11 48 48 #define DID_FILL_FROM_SCAN 12 49 49 50 + /* 51 + * Returns true if it's a btree we can easily reconstruct, or otherwise won't 52 + * cause data loss if it's missing: 53 + */ 54 + static bool btree_id_important(enum btree_id btree) 55 + { 56 + if (btree_id_is_alloc(btree)) 57 + return false; 58 + 59 + switch (btree) { 60 + case BTREE_ID_quotas: 61 + case BTREE_ID_snapshot_trees: 62 + case BTREE_ID_logged_ops: 63 + case BTREE_ID_rebalance_work: 64 + case BTREE_ID_subvolume_children: 65 + return false; 66 + default: 67 + return true; 68 + } 69 + } 70 + 50 71 static const char * const bch2_gc_phase_strs[] = { 51 72 #define x(n) #n, 52 73 GC_PHASES() ··· 555 534 r->error = 0; 556 535 557 536 if (!bch2_btree_has_scanned_nodes(c, i)) { 558 - mustfix_fsck_err(trans, btree_root_unreadable_and_scan_found_nothing, 559 - "no nodes found for btree %s, continue?", buf.buf); 537 + __fsck_err(trans, 538 + FSCK_CAN_FIX|(!btree_id_important(i) ? FSCK_AUTOFIX : 0), 539 + btree_root_unreadable_and_scan_found_nothing, 540 + "no nodes found for btree %s, continue?", buf.buf); 560 541 bch2_btree_root_alloc_fake_trans(trans, i, 0); 561 542 } else { 562 543 bch2_btree_root_alloc_fake_trans(trans, i, 1);
+1 -1
fs/bcachefs/btree_journal_iter.c
··· 288 288 .size = max_t(size_t, keys->size, 8) * 2, 289 289 }; 290 290 291 - new_keys.data = kvmalloc_array(new_keys.size, sizeof(new_keys.data[0]), GFP_KERNEL); 291 + new_keys.data = bch2_kvmalloc(new_keys.size * sizeof(new_keys.data[0]), GFP_KERNEL); 292 292 if (!new_keys.data) { 293 293 bch_err(c, "%s: error allocating new key array (size %zu)", 294 294 __func__, new_keys.size);
+32 -17
fs/bcachefs/btree_update_interior.c
··· 1389 1389 printbuf_exit(&buf); 1390 1390 } 1391 1391 1392 - static void 1392 + static int 1393 1393 bch2_btree_insert_keys_interior(struct btree_update *as, 1394 1394 struct btree_trans *trans, 1395 1395 struct btree_path *path, ··· 1411 1411 insert = bkey_next(insert)) 1412 1412 bch2_insert_fixup_btree_ptr(as, trans, path, b, &node_iter, insert); 1413 1413 1414 - if (bch2_btree_node_check_topology(trans, b)) { 1414 + int ret = bch2_btree_node_check_topology(trans, b); 1415 + if (ret) { 1415 1416 struct printbuf buf = PRINTBUF; 1416 1417 1417 1418 for (struct bkey_i *k = keys->keys; ··· 1422 1421 prt_newline(&buf); 1423 1422 } 1424 1423 1425 - panic("%s(): check_topology error: inserted keys\n%s", __func__, buf.buf); 1424 + bch2_fs_fatal_error(as->c, "%ps -> %s(): check_topology error %s: inserted keys\n%s", 1425 + (void *) _RET_IP_, __func__, bch2_err_str(ret), buf.buf); 1426 + dump_stack(); 1427 + return ret; 1426 1428 } 1427 1429 1428 1430 memmove_u64s_down(keys->keys, insert, keys->top_p - insert->_data); 1429 1431 keys->top_p -= insert->_data - keys->keys_p; 1432 + return 0; 1430 1433 } 1431 1434 1432 1435 static bool key_deleted_in_insert(struct keylist *insert_keys, struct bpos pos) ··· 1564 1559 * nodes that were coalesced, and thus in the middle of a child node post 1565 1560 * coalescing: 1566 1561 */ 1567 - static void btree_split_insert_keys(struct btree_update *as, 1568 - struct btree_trans *trans, 1569 - btree_path_idx_t path_idx, 1570 - struct btree *b, 1571 - struct keylist *keys) 1562 + static int btree_split_insert_keys(struct btree_update *as, 1563 + struct btree_trans *trans, 1564 + btree_path_idx_t path_idx, 1565 + struct btree *b, 1566 + struct keylist *keys) 1572 1567 { 1573 1568 struct btree_path *path = trans->paths + path_idx; 1574 1569 ··· 1578 1573 1579 1574 bch2_btree_node_iter_init(&node_iter, b, &bch2_keylist_front(keys)->k.p); 1580 1575 1581 - bch2_btree_insert_keys_interior(as, trans, path, b, node_iter, keys); 1576 + int ret = bch2_btree_insert_keys_interior(as, trans, path, b, node_iter, keys); 1577 + if (ret) 1578 + return ret; 1582 1579 } 1580 + 1581 + return 0; 1583 1582 } 1584 1583 1585 1584 static int btree_split(struct btree_update *as, struct btree_trans *trans, ··· 1616 1607 __btree_split_node(as, trans, b, n, keys); 1617 1608 1618 1609 if (keys) { 1619 - btree_split_insert_keys(as, trans, path, n1, keys); 1620 - btree_split_insert_keys(as, trans, path, n2, keys); 1610 + ret = btree_split_insert_keys(as, trans, path, n1, keys) ?: 1611 + btree_split_insert_keys(as, trans, path, n2, keys); 1612 + if (ret) 1613 + goto err; 1621 1614 BUG_ON(!bch2_keylist_empty(keys)); 1622 1615 } 1623 1616 ··· 1665 1654 n3->sib_u64s[0] = U16_MAX; 1666 1655 n3->sib_u64s[1] = U16_MAX; 1667 1656 1668 - btree_split_insert_keys(as, trans, path, n3, &as->parent_keys); 1657 + ret = btree_split_insert_keys(as, trans, path, n3, &as->parent_keys); 1658 + if (ret) 1659 + goto err; 1669 1660 } 1670 1661 } else { 1671 1662 trace_and_count(c, btree_node_compact, trans, b); ··· 1675 1662 n1 = bch2_btree_node_alloc_replacement(as, trans, b); 1676 1663 1677 1664 if (keys) { 1678 - btree_split_insert_keys(as, trans, path, n1, keys); 1665 + ret = btree_split_insert_keys(as, trans, path, n1, keys); 1666 + if (ret) 1667 + goto err; 1679 1668 BUG_ON(!bch2_keylist_empty(keys)); 1680 1669 } 1681 1670 ··· 1824 1809 goto split; 1825 1810 } 1826 1811 1827 - ret = bch2_btree_node_check_topology(trans, b); 1812 + 1813 + ret = bch2_btree_node_check_topology(trans, b) ?: 1814 + bch2_btree_insert_keys_interior(as, trans, path, b, 1815 + path->l[b->c.level].iter, keys); 1828 1816 if (ret) { 1829 1817 bch2_btree_node_unlock_write(trans, path, b); 1830 1818 return ret; 1831 1819 } 1832 - 1833 - bch2_btree_insert_keys_interior(as, trans, path, b, 1834 - path->l[b->c.level].iter, keys); 1835 1820 1836 1821 trans_for_each_path_with_node(trans, b, linked, i) 1837 1822 bch2_btree_node_iter_peek(&linked->l[b->c.level].iter, b);
+10 -5
fs/bcachefs/buckets.c
··· 604 604 } 605 605 606 606 struct bpos bucket = PTR_BUCKET_POS(ca, &p.ptr); 607 + if (!bucket_valid(ca, bucket.offset)) { 608 + if (insert) { 609 + bch2_dev_bucket_missing(ca, bucket.offset); 610 + ret = -BCH_ERR_trigger_pointer; 611 + } 612 + goto err; 613 + } 607 614 608 615 if (flags & BTREE_TRIGGER_transactional) { 609 616 struct bkey_i_alloc_v4 *a = bch2_trans_start_alloc_update(trans, bucket, 0); ··· 1314 1307 old_bucket_gens = rcu_dereference_protected(ca->bucket_gens, 1); 1315 1308 1316 1309 if (resize) { 1317 - bucket_gens->nbuckets = min(bucket_gens->nbuckets, 1318 - old_bucket_gens->nbuckets); 1319 - bucket_gens->nbuckets_minus_first = 1320 - bucket_gens->nbuckets - bucket_gens->first_bucket; 1310 + u64 copy = min(bucket_gens->nbuckets, 1311 + old_bucket_gens->nbuckets); 1321 1312 memcpy(bucket_gens->b, 1322 1313 old_bucket_gens->b, 1323 - bucket_gens->nbuckets); 1314 + sizeof(bucket_gens->b[0]) * copy); 1324 1315 } 1325 1316 1326 1317 rcu_assign_pointer(ca->bucket_gens, bucket_gens);
+2 -2
fs/bcachefs/dirent.c
··· 685 685 vfs_d_type(d.v->d_type)); 686 686 if (ret) 687 687 ctx->pos = d.k->p.offset + 1; 688 - return ret; 688 + return !ret; 689 689 } 690 690 691 691 int bch2_readdir(struct bch_fs *c, subvol_inum inum, struct dir_context *ctx) ··· 710 710 if (ret2 > 0) 711 711 continue; 712 712 713 - ret2 ?: drop_locks_do(trans, bch2_dir_emit(ctx, dirent, target)); 713 + ret2 ?: (bch2_trans_unlock(trans), bch2_dir_emit(ctx, dirent, target)); 714 714 }))); 715 715 716 716 bch2_bkey_buf_exit(&sk, c);
+12 -13
fs/bcachefs/disk_groups.c
··· 470 470 471 471 int __bch2_dev_group_set(struct bch_fs *c, struct bch_dev *ca, const char *name) 472 472 { 473 - struct bch_member *mi; 474 - int ret, v = -1; 473 + lockdep_assert_held(&c->sb_lock); 475 474 476 - if (!strlen(name) || !strcmp(name, "none")) 477 - return 0; 478 475 479 - v = bch2_disk_path_find_or_create(&c->disk_sb, name); 480 - if (v < 0) 481 - return v; 476 + if (!strlen(name) || !strcmp(name, "none")) { 477 + struct bch_member *mi = bch2_members_v2_get_mut(c->disk_sb.sb, ca->dev_idx); 478 + SET_BCH_MEMBER_GROUP(mi, 0); 479 + } else { 480 + int v = bch2_disk_path_find_or_create(&c->disk_sb, name); 481 + if (v < 0) 482 + return v; 482 483 483 - ret = bch2_sb_disk_groups_to_cpu(c); 484 - if (ret) 485 - return ret; 484 + struct bch_member *mi = bch2_members_v2_get_mut(c->disk_sb.sb, ca->dev_idx); 485 + SET_BCH_MEMBER_GROUP(mi, v + 1); 486 + } 486 487 487 - mi = bch2_members_v2_get_mut(c->disk_sb.sb, ca->dev_idx); 488 - SET_BCH_MEMBER_GROUP(mi, v + 1); 489 - return 0; 488 + return bch2_sb_disk_groups_to_cpu(c); 490 489 } 491 490 492 491 int bch2_dev_group_set(struct bch_fs *c, struct bch_dev *ca, const char *name)
+2 -2
fs/bcachefs/ec.c
··· 2204 2204 2205 2205 static bool bch2_fs_ec_flush_done(struct bch_fs *c) 2206 2206 { 2207 - bool ret; 2207 + sched_annotate_sleep(); 2208 2208 2209 2209 mutex_lock(&c->ec_stripe_new_lock); 2210 - ret = list_empty(&c->ec_stripe_new_list); 2210 + bool ret = list_empty(&c->ec_stripe_new_list); 2211 2211 mutex_unlock(&c->ec_stripe_new_lock); 2212 2212 2213 2213 return ret;
+3 -1
fs/bcachefs/error.c
··· 478 478 } else if (!test_bit(BCH_FS_fsck_running, &c->flags)) { 479 479 if (c->opts.errors != BCH_ON_ERROR_continue || 480 480 !(flags & (FSCK_CAN_FIX|FSCK_CAN_IGNORE))) { 481 - prt_str(out, ", shutting down"); 481 + prt_str_indented(out, ", shutting down\n" 482 + "error not marked as autofix and not in fsck\n" 483 + "run fsck, and forward to devs so error can be marked for self-healing"); 482 484 inconsistent = true; 483 485 print = true; 484 486 ret = -BCH_ERR_fsck_errors_not_fixed;
+35 -9
fs/bcachefs/fs-io.c
··· 144 144 void __bch2_i_sectors_acct(struct bch_fs *c, struct bch_inode_info *inode, 145 145 struct quota_res *quota_res, s64 sectors) 146 146 { 147 - bch2_fs_inconsistent_on((s64) inode->v.i_blocks + sectors < 0, c, 148 - "inode %lu i_blocks underflow: %llu + %lli < 0 (ondisk %lli)", 149 - inode->v.i_ino, (u64) inode->v.i_blocks, sectors, 150 - inode->ei_inode.bi_sectors); 147 + if (unlikely((s64) inode->v.i_blocks + sectors < 0)) { 148 + struct printbuf buf = PRINTBUF; 149 + bch2_log_msg_start(c, &buf); 150 + prt_printf(&buf, "inode %lu i_blocks underflow: %llu + %lli < 0 (ondisk %lli)", 151 + inode->v.i_ino, (u64) inode->v.i_blocks, sectors, 152 + inode->ei_inode.bi_sectors); 153 + 154 + bool repeat = false, print = false, suppress = false; 155 + bch2_count_fsck_err(c, vfs_inode_i_blocks_underflow, buf.buf, &repeat, &print, &suppress); 156 + if (print) 157 + bch2_print_str(c, buf.buf); 158 + printbuf_exit(&buf); 159 + 160 + if (sectors < 0) 161 + sectors = -inode->v.i_blocks; 162 + else 163 + sectors = 0; 164 + } 165 + 151 166 inode->v.i_blocks += sectors; 152 167 153 168 #ifdef CONFIG_BCACHEFS_QUOTA ··· 517 502 goto err; 518 503 } 519 504 520 - bch2_fs_inconsistent_on(!inode->v.i_size && inode->v.i_blocks && 521 - !bch2_journal_error(&c->journal), c, 522 - "inode %lu truncated to 0 but i_blocks %llu (ondisk %lli)", 523 - inode->v.i_ino, (u64) inode->v.i_blocks, 524 - inode->ei_inode.bi_sectors); 505 + if (unlikely(!inode->v.i_size && inode->v.i_blocks && 506 + !bch2_journal_error(&c->journal))) { 507 + struct printbuf buf = PRINTBUF; 508 + bch2_log_msg_start(c, &buf); 509 + prt_printf(&buf, 510 + "inode %lu truncated to 0 but i_blocks %llu (ondisk %lli)", 511 + inode->v.i_ino, (u64) inode->v.i_blocks, 512 + inode->ei_inode.bi_sectors); 513 + 514 + bool repeat = false, print = false, suppress = false; 515 + bch2_count_fsck_err(c, vfs_inode_i_blocks_not_zero_at_truncate, buf.buf, 516 + &repeat, &print, &suppress); 517 + if (print) 518 + bch2_print_str(c, buf.buf); 519 + printbuf_exit(&buf); 520 + } 525 521 526 522 ret = bch2_setattr_nonsize(idmap, inode, iattr); 527 523 err:
+10 -5
fs/bcachefs/fs.c
··· 66 66 67 67 if (bch2_inode_casefold(c, &inode->ei_inode)) 68 68 inode->v.i_flags |= S_CASEFOLD; 69 + else 70 + inode->v.i_flags &= ~S_CASEFOLD; 69 71 } 70 72 71 73 void bch2_inode_update_after_write(struct btree_trans *trans, ··· 850 848 set_nlink(&inode->v, 0); 851 849 } 852 850 853 - if (IS_CASEFOLDED(vdir)) { 851 + if (IS_CASEFOLDED(vdir)) 854 852 d_invalidate(dentry); 855 - d_prune_aliases(&inode->v); 856 - } 857 853 err: 858 854 bch2_trans_put(trans); 859 855 bch2_unlock_inodes(INODE_UPDATE_LOCK, dir, inode); ··· 1464 1464 unsigned sectors = cur->kbuf.k->k.size; 1465 1465 s64 offset_into_extent = 0; 1466 1466 enum btree_id data_btree = BTREE_ID_extents; 1467 - int ret = bch2_read_indirect_extent(trans, &data_btree, &offset_into_extent, 1468 - &cur->kbuf); 1467 + ret = bch2_read_indirect_extent(trans, &data_btree, &offset_into_extent, 1468 + &cur->kbuf); 1469 1469 if (ret) 1470 1470 goto err; 1471 1471 ··· 2570 2570 ret = bch2_fs_start(c); 2571 2571 if (ret) 2572 2572 goto err_put_super; 2573 + 2574 + #ifdef CONFIG_UNICODE 2575 + sb->s_encoding = c->cf_encoding; 2576 + #endif 2577 + generic_set_sb_d_ops(sb); 2573 2578 2574 2579 vinode = bch2_vfs_inode_get(c, BCACHEFS_ROOT_SUBVOL_INUM); 2575 2580 ret = PTR_ERR_OR_ZERO(vinode);
+21
fs/bcachefs/io_write.c
··· 255 255 } 256 256 257 257 if (i_sectors_delta) { 258 + s64 bi_sectors = le64_to_cpu(inode->v.bi_sectors); 259 + if (unlikely(bi_sectors + i_sectors_delta < 0)) { 260 + struct bch_fs *c = trans->c; 261 + struct printbuf buf = PRINTBUF; 262 + bch2_log_msg_start(c, &buf); 263 + prt_printf(&buf, "inode %llu i_sectors underflow: %lli + %lli < 0", 264 + extent_iter->pos.inode, bi_sectors, i_sectors_delta); 265 + 266 + bool repeat = false, print = false, suppress = false; 267 + bch2_count_fsck_err(c, inode_i_sectors_underflow, buf.buf, 268 + &repeat, &print, &suppress); 269 + if (print) 270 + bch2_print_str(c, buf.buf); 271 + printbuf_exit(&buf); 272 + 273 + if (i_sectors_delta < 0) 274 + i_sectors_delta = -bi_sectors; 275 + else 276 + i_sectors_delta = 0; 277 + } 278 + 258 279 le64_add_cpu(&inode->v.bi_sectors, i_sectors_delta); 259 280 inode_update_flags = 0; 260 281 }
+1 -1
fs/bcachefs/journal_io.c
··· 1782 1782 struct bch_dev *ca = bch2_dev_get_ioref(c, ptr->dev, WRITE); 1783 1783 if (!ca) { 1784 1784 /* XXX: fix this */ 1785 - bch_err(c, "missing device for journal write\n"); 1785 + bch_err(c, "missing device %u for journal write", ptr->dev); 1786 1786 continue; 1787 1787 } 1788 1788
+3
fs/bcachefs/namei.c
··· 343 343 bool ret = false; 344 344 345 345 for (id = 0; id < Inode_opt_nr; id++) { 346 + if (!S_ISDIR(dst_u->bi_mode) && id == Inode_opt_casefold) 347 + continue; 348 + 346 349 /* Skip attributes that were explicitly set on this inode */ 347 350 if (dst_u->bi_fields_set & (1 << id)) 348 351 continue;
+4
fs/bcachefs/sb-downgrade.c
··· 20 20 * x(version, recovery_passes, errors...) 21 21 */ 22 22 #define UPGRADE_TABLE() \ 23 + x(snapshot_2, \ 24 + RECOVERY_PASS_ALL_FSCK, \ 25 + BCH_FSCK_ERR_subvol_root_wrong_bi_subvol, \ 26 + BCH_FSCK_ERR_subvol_not_master_and_not_snapshot) \ 23 27 x(backpointers, \ 24 28 RECOVERY_PASS_ALL_FSCK) \ 25 29 x(inode_v3, \
+9 -4
fs/bcachefs/sb-errors_format.h
··· 46 46 x(btree_node_unsupported_version, 34, 0) \ 47 47 x(btree_node_bset_older_than_sb_min, 35, 0) \ 48 48 x(btree_node_bset_newer_than_sb, 36, 0) \ 49 - x(btree_node_data_missing, 37, 0) \ 49 + x(btree_node_data_missing, 37, FSCK_AUTOFIX) \ 50 50 x(btree_node_bset_after_end, 38, 0) \ 51 51 x(btree_node_replicas_sectors_written_mismatch, 39, 0) \ 52 52 x(btree_node_replicas_data_mismatch, 40, 0) \ ··· 205 205 x(snapshot_bad_depth, 184, 0) \ 206 206 x(snapshot_bad_skiplist, 185, 0) \ 207 207 x(subvol_pos_bad, 186, 0) \ 208 - x(subvol_not_master_and_not_snapshot, 187, 0) \ 208 + x(subvol_not_master_and_not_snapshot, 187, FSCK_AUTOFIX) \ 209 209 x(subvol_to_missing_root, 188, 0) \ 210 - x(subvol_root_wrong_bi_subvol, 189, 0) \ 210 + x(subvol_root_wrong_bi_subvol, 189, FSCK_AUTOFIX) \ 211 211 x(bkey_in_missing_snapshot, 190, 0) \ 212 212 x(inode_pos_inode_nonzero, 191, 0) \ 213 213 x(inode_pos_blockdev_range, 192, 0) \ ··· 236 236 x(inode_has_child_snapshots_wrong, 287, 0) \ 237 237 x(inode_unreachable, 210, FSCK_AUTOFIX) \ 238 238 x(inode_journal_seq_in_future, 299, FSCK_AUTOFIX) \ 239 + x(inode_i_sectors_underflow, 312, FSCK_AUTOFIX) \ 240 + x(vfs_inode_i_blocks_underflow, 311, FSCK_AUTOFIX) \ 241 + x(vfs_inode_i_blocks_not_zero_at_truncate, 313, FSCK_AUTOFIX) \ 239 242 x(deleted_inode_but_clean, 211, FSCK_AUTOFIX) \ 240 243 x(deleted_inode_missing, 212, FSCK_AUTOFIX) \ 241 244 x(deleted_inode_is_dir, 213, FSCK_AUTOFIX) \ ··· 320 317 x(directory_size_mismatch, 303, FSCK_AUTOFIX) \ 321 318 x(dirent_cf_name_too_big, 304, 0) \ 322 319 x(dirent_stray_data_after_cf_name, 305, 0) \ 323 - x(MAX, 308, 0) 320 + x(rebalance_work_incorrectly_set, 309, FSCK_AUTOFIX) \ 321 + x(rebalance_work_incorrectly_unset, 310, FSCK_AUTOFIX) \ 322 + x(MAX, 314, 0) 324 323 325 324 enum bch_sb_error_id { 326 325 #define x(t, n, ...) BCH_FSCK_ERR_##t = n,
+4 -2
fs/bcachefs/sb-members.c
··· 15 15 bch2_fs_inconsistent(c, "pointer to nonexistent device %u", dev); 16 16 } 17 17 18 - void bch2_dev_bucket_missing(struct bch_fs *c, struct bpos bucket) 18 + void bch2_dev_bucket_missing(struct bch_dev *ca, u64 bucket) 19 19 { 20 - bch2_fs_inconsistent(c, "pointer to nonexistent bucket %llu:%llu", bucket.inode, bucket.offset); 20 + bch2_fs_inconsistent(ca->fs, 21 + "pointer to nonexistent bucket %llu on device %s (valid range %u-%llu)", 22 + bucket, ca->name, ca->mi.first_bucket, ca->mi.nbuckets); 21 23 } 22 24 23 25 #define x(t, n, ...) [n] = #t,
+8 -5
fs/bcachefs/sb-members.h
··· 249 249 static inline struct bch_dev *bch2_dev_bucket_tryget_noerror(struct bch_fs *c, struct bpos bucket) 250 250 { 251 251 struct bch_dev *ca = bch2_dev_tryget_noerror(c, bucket.inode); 252 - if (ca && !bucket_valid(ca, bucket.offset)) { 252 + if (ca && unlikely(!bucket_valid(ca, bucket.offset))) { 253 253 bch2_dev_put(ca); 254 254 ca = NULL; 255 255 } 256 256 return ca; 257 257 } 258 258 259 - void bch2_dev_bucket_missing(struct bch_fs *, struct bpos); 259 + void bch2_dev_bucket_missing(struct bch_dev *, u64); 260 260 261 261 static inline struct bch_dev *bch2_dev_bucket_tryget(struct bch_fs *c, struct bpos bucket) 262 262 { 263 - struct bch_dev *ca = bch2_dev_bucket_tryget_noerror(c, bucket); 264 - if (!ca) 265 - bch2_dev_bucket_missing(c, bucket); 263 + struct bch_dev *ca = bch2_dev_tryget(c, bucket.inode); 264 + if (ca && unlikely(!bucket_valid(ca, bucket.offset))) { 265 + bch2_dev_bucket_missing(ca, bucket.offset); 266 + bch2_dev_put(ca); 267 + ca = NULL; 268 + } 266 269 return ca; 267 270 } 268 271
+3 -2
fs/bcachefs/subvolume.c
··· 6 6 #include "errcode.h" 7 7 #include "error.h" 8 8 #include "fs.h" 9 + #include "recovery_passes.h" 9 10 #include "snapshot.h" 10 11 #include "subvolume.h" 11 12 ··· 45 44 ret = bch2_snapshot_lookup(trans, snapid, &snapshot); 46 45 47 46 if (bch2_err_matches(ret, ENOENT)) 48 - bch_err(c, "subvolume %llu points to nonexistent snapshot %u", 49 - k.k->p.offset, snapid); 47 + return bch2_run_explicit_recovery_pass(c, 48 + BCH_RECOVERY_PASS_reconstruct_snapshots) ?: ret; 50 49 if (ret) 51 50 return ret; 52 51
+27 -19
fs/bcachefs/super.c
··· 531 531 for (unsigned i = 0; i < BCH_TIME_STAT_NR; i++) 532 532 bch2_time_stats_exit(&c->times[i]); 533 533 534 + #ifdef CONFIG_UNICODE 535 + utf8_unload(c->cf_encoding); 536 + #endif 537 + 534 538 bch2_find_btree_nodes_exit(&c->found_btree_nodes); 535 539 bch2_free_pending_node_rewrites(c); 536 540 bch2_free_fsck_errs(c); ··· 827 823 if (ret) 828 824 goto err; 829 825 830 - #ifdef CONFIG_UNICODE 831 - /* Default encoding until we can potentially have more as an option. */ 832 - c->cf_encoding = utf8_load(BCH_FS_DEFAULT_UTF8_ENCODING); 833 - if (IS_ERR(c->cf_encoding)) { 834 - printk(KERN_ERR "Cannot load UTF-8 encoding for filesystem. Version: %u.%u.%u", 835 - unicode_major(BCH_FS_DEFAULT_UTF8_ENCODING), 836 - unicode_minor(BCH_FS_DEFAULT_UTF8_ENCODING), 837 - unicode_rev(BCH_FS_DEFAULT_UTF8_ENCODING)); 838 - ret = -EINVAL; 839 - goto err; 840 - } 841 - #else 842 - if (c->sb.features & BIT_ULL(BCH_FEATURE_casefolding)) { 843 - printk(KERN_ERR "Cannot mount a filesystem with casefolding on a kernel without CONFIG_UNICODE\n"); 844 - ret = -EINVAL; 845 - goto err; 846 - } 847 - #endif 848 - 849 826 pr_uuid(&name, c->sb.user_uuid.b); 850 827 ret = name.allocation_failure ? -BCH_ERR_ENOMEM_fs_name_alloc : 0; 851 828 if (ret) ··· 925 940 bch2_fs_fs_io_direct_init(c); 926 941 if (ret) 927 942 goto err; 943 + 944 + #ifdef CONFIG_UNICODE 945 + /* Default encoding until we can potentially have more as an option. */ 946 + c->cf_encoding = utf8_load(BCH_FS_DEFAULT_UTF8_ENCODING); 947 + if (IS_ERR(c->cf_encoding)) { 948 + printk(KERN_ERR "Cannot load UTF-8 encoding for filesystem. Version: %u.%u.%u", 949 + unicode_major(BCH_FS_DEFAULT_UTF8_ENCODING), 950 + unicode_minor(BCH_FS_DEFAULT_UTF8_ENCODING), 951 + unicode_rev(BCH_FS_DEFAULT_UTF8_ENCODING)); 952 + ret = -EINVAL; 953 + goto err; 954 + } 955 + bch_info(c, "Using encoding defined by superblock: utf8-%u.%u.%u", 956 + unicode_major(BCH_FS_DEFAULT_UTF8_ENCODING), 957 + unicode_minor(BCH_FS_DEFAULT_UTF8_ENCODING), 958 + unicode_rev(BCH_FS_DEFAULT_UTF8_ENCODING)); 959 + #else 960 + if (c->sb.features & BIT_ULL(BCH_FEATURE_casefolding)) { 961 + printk(KERN_ERR "Cannot mount a filesystem with casefolding on a kernel without CONFIG_UNICODE\n"); 962 + ret = -EINVAL; 963 + goto err; 964 + } 965 + #endif 928 966 929 967 for (i = 0; i < c->sb.nr_devices; i++) { 930 968 if (!bch2_member_exists(c->disk_sb.sb, i))
+7 -1
fs/bcachefs/xattr_format.h
··· 13 13 __u8 x_type; 14 14 __u8 x_name_len; 15 15 __le16 x_val_len; 16 - __u8 x_name[] __counted_by(x_name_len); 16 + /* 17 + * x_name contains the name and value counted by 18 + * x_name_len + x_val_len. The introduction of 19 + * __counted_by(x_name_len) caused a false positive 20 + * detection of an out of bounds write. 21 + */ 22 + __u8 x_name[]; 17 23 } __packed __aligned(8); 18 24 19 25 #endif /* _BCACHEFS_XATTR_FORMAT_H */
+1 -1
fs/btrfs/compression.c
··· 606 606 free_extent_map(em); 607 607 608 608 cb->nr_folios = DIV_ROUND_UP(compressed_len, PAGE_SIZE); 609 - cb->compressed_folios = kcalloc(cb->nr_folios, sizeof(struct page *), GFP_NOFS); 609 + cb->compressed_folios = kcalloc(cb->nr_folios, sizeof(struct folio *), GFP_NOFS); 610 610 if (!cb->compressed_folios) { 611 611 ret = BLK_STS_RESOURCE; 612 612 goto out_free_bio;
+2 -2
fs/btrfs/extent_io.c
··· 3508 3508 ASSERT(folio_test_locked(folio)); 3509 3509 xa_lock_irq(&folio->mapping->i_pages); 3510 3510 if (!folio_test_dirty(folio)) 3511 - __xa_clear_mark(&folio->mapping->i_pages, 3512 - folio_index(folio), PAGECACHE_TAG_DIRTY); 3511 + __xa_clear_mark(&folio->mapping->i_pages, folio->index, 3512 + PAGECACHE_TAG_DIRTY); 3513 3513 xa_unlock_irq(&folio->mapping->i_pages); 3514 3514 } 3515 3515
+2
fs/btrfs/extent_io.h
··· 298 298 */ 299 299 static inline int __pure num_extent_folios(const struct extent_buffer *eb) 300 300 { 301 + if (!eb->folios[0]) 302 + return 0; 301 303 if (folio_order(eb->folios[0])) 302 304 return 1; 303 305 return num_extent_pages(eb);
+2 -2
fs/btrfs/scrub.c
··· 1541 1541 u64 extent_gen; 1542 1542 int ret; 1543 1543 1544 - if (unlikely(!extent_root)) { 1545 - btrfs_err(fs_info, "no valid extent root for scrub"); 1544 + if (unlikely(!extent_root || !csum_root)) { 1545 + btrfs_err(fs_info, "no valid extent or csum root for scrub"); 1546 1546 return -EUCLEAN; 1547 1547 } 1548 1548 memset(stripe->sectors, 0, sizeof(struct scrub_sector_verification) *
+1 -90
fs/btrfs/volumes.c
··· 733 733 return has_metadata_uuid ? sb->metadata_uuid : sb->fsid; 734 734 } 735 735 736 - /* 737 - * We can have very weird soft links passed in. 738 - * One example is "/proc/self/fd/<fd>", which can be a soft link to 739 - * a block device. 740 - * 741 - * But it's never a good idea to use those weird names. 742 - * Here we check if the path (not following symlinks) is a good one inside 743 - * "/dev/". 744 - */ 745 - static bool is_good_dev_path(const char *dev_path) 746 - { 747 - struct path path = { .mnt = NULL, .dentry = NULL }; 748 - char *path_buf = NULL; 749 - char *resolved_path; 750 - bool is_good = false; 751 - int ret; 752 - 753 - if (!dev_path) 754 - goto out; 755 - 756 - path_buf = kmalloc(PATH_MAX, GFP_KERNEL); 757 - if (!path_buf) 758 - goto out; 759 - 760 - /* 761 - * Do not follow soft link, just check if the original path is inside 762 - * "/dev/". 763 - */ 764 - ret = kern_path(dev_path, 0, &path); 765 - if (ret) 766 - goto out; 767 - resolved_path = d_path(&path, path_buf, PATH_MAX); 768 - if (IS_ERR(resolved_path)) 769 - goto out; 770 - if (strncmp(resolved_path, "/dev/", strlen("/dev/"))) 771 - goto out; 772 - is_good = true; 773 - out: 774 - kfree(path_buf); 775 - path_put(&path); 776 - return is_good; 777 - } 778 - 779 - static int get_canonical_dev_path(const char *dev_path, char *canonical) 780 - { 781 - struct path path = { .mnt = NULL, .dentry = NULL }; 782 - char *path_buf = NULL; 783 - char *resolved_path; 784 - int ret; 785 - 786 - if (!dev_path) { 787 - ret = -EINVAL; 788 - goto out; 789 - } 790 - 791 - path_buf = kmalloc(PATH_MAX, GFP_KERNEL); 792 - if (!path_buf) { 793 - ret = -ENOMEM; 794 - goto out; 795 - } 796 - 797 - ret = kern_path(dev_path, LOOKUP_FOLLOW, &path); 798 - if (ret) 799 - goto out; 800 - resolved_path = d_path(&path, path_buf, PATH_MAX); 801 - if (IS_ERR(resolved_path)) { 802 - ret = PTR_ERR(resolved_path); 803 - goto out; 804 - } 805 - ret = strscpy(canonical, resolved_path, PATH_MAX); 806 - out: 807 - kfree(path_buf); 808 - path_put(&path); 809 - return ret; 810 - } 811 - 812 736 static bool is_same_device(struct btrfs_device *device, const char *new_path) 813 737 { 814 738 struct path old = { .mnt = NULL, .dentry = NULL }; ··· 1437 1513 bool new_device_added = false; 1438 1514 struct btrfs_device *device = NULL; 1439 1515 struct file *bdev_file; 1440 - char *canonical_path = NULL; 1441 1516 u64 bytenr; 1442 1517 dev_t devt; 1443 1518 int ret; 1444 1519 1445 1520 lockdep_assert_held(&uuid_mutex); 1446 1521 1447 - if (!is_good_dev_path(path)) { 1448 - canonical_path = kmalloc(PATH_MAX, GFP_KERNEL); 1449 - if (canonical_path) { 1450 - ret = get_canonical_dev_path(path, canonical_path); 1451 - if (ret < 0) { 1452 - kfree(canonical_path); 1453 - canonical_path = NULL; 1454 - } 1455 - } 1456 - } 1457 1522 /* 1458 1523 * Avoid an exclusive open here, as the systemd-udev may initiate the 1459 1524 * device scan which may race with the user's mount or mkfs command, ··· 1487 1574 goto free_disk_super; 1488 1575 } 1489 1576 1490 - device = device_list_add(canonical_path ? : path, disk_super, 1491 - &new_device_added); 1577 + device = device_list_add(path, disk_super, &new_device_added); 1492 1578 if (!IS_ERR(device) && new_device_added) 1493 1579 btrfs_free_stale_devices(device->devt, device); 1494 1580 ··· 1496 1584 1497 1585 error_bdev_put: 1498 1586 fput(bdev_file); 1499 - kfree(canonical_path); 1500 1587 1501 1588 return device; 1502 1589 }
+2 -2
fs/erofs/fileio.c
··· 150 150 io->rq->bio.bi_iter.bi_sector = io->dev.m_pa >> 9; 151 151 attached = 0; 152 152 } 153 - if (!attached++) 154 - erofs_onlinefolio_split(folio); 155 153 if (!bio_add_folio(&io->rq->bio, folio, len, cur)) 156 154 goto io_retry; 155 + if (!attached++) 156 + erofs_onlinefolio_split(folio); 157 157 io->dev.m_pa += len; 158 158 } 159 159 cur += len;
-1
fs/erofs/super.c
··· 357 357 enum { 358 358 Opt_user_xattr, Opt_acl, Opt_cache_strategy, Opt_dax, Opt_dax_enum, 359 359 Opt_device, Opt_fsid, Opt_domain_id, Opt_directio, 360 - Opt_err 361 360 }; 362 361 363 362 static const struct constant_table erofs_param_cache_strategy[] = {
+13 -16
fs/erofs/zdata.c
··· 79 79 /* L: whether partial decompression or not */ 80 80 bool partial; 81 81 82 - /* L: indicate several pageofs_outs or not */ 83 - bool multibases; 84 - 85 82 /* L: whether extra buffer allocations are best-effort */ 86 83 bool besteffort; 87 84 ··· 1043 1046 break; 1044 1047 1045 1048 erofs_onlinefolio_split(folio); 1046 - if (f->pcl->pageofs_out != (map->m_la & ~PAGE_MASK)) 1047 - f->pcl->multibases = true; 1048 1049 if (f->pcl->length < offset + end - map->m_la) { 1049 1050 f->pcl->length = offset + end - map->m_la; 1050 1051 f->pcl->pageofs_out = map->m_la & ~PAGE_MASK; ··· 1088 1093 struct page *onstack_pages[Z_EROFS_ONSTACK_PAGES]; 1089 1094 struct super_block *sb; 1090 1095 struct z_erofs_pcluster *pcl; 1091 - 1092 1096 /* pages with the longest decompressed length for deduplication */ 1093 1097 struct page **decompressed_pages; 1094 1098 /* pages to keep the compressed data */ ··· 1096 1102 struct list_head decompressed_secondary_bvecs; 1097 1103 struct page **pagepool; 1098 1104 unsigned int onstack_used, nr_pages; 1105 + /* indicate if temporary copies should be preserved for later use */ 1106 + bool keepxcpy; 1099 1107 }; 1100 1108 1101 1109 struct z_erofs_bvec_item { ··· 1108 1112 static void z_erofs_do_decompressed_bvec(struct z_erofs_backend *be, 1109 1113 struct z_erofs_bvec *bvec) 1110 1114 { 1115 + int poff = bvec->offset + be->pcl->pageofs_out; 1111 1116 struct z_erofs_bvec_item *item; 1112 - unsigned int pgnr; 1117 + struct page **page; 1113 1118 1114 - if (!((bvec->offset + be->pcl->pageofs_out) & ~PAGE_MASK) && 1115 - (bvec->end == PAGE_SIZE || 1116 - bvec->offset + bvec->end == be->pcl->length)) { 1117 - pgnr = (bvec->offset + be->pcl->pageofs_out) >> PAGE_SHIFT; 1118 - DBG_BUGON(pgnr >= be->nr_pages); 1119 - if (!be->decompressed_pages[pgnr]) { 1120 - be->decompressed_pages[pgnr] = bvec->page; 1119 + if (!(poff & ~PAGE_MASK) && (bvec->end == PAGE_SIZE || 1120 + bvec->offset + bvec->end == be->pcl->length)) { 1121 + DBG_BUGON((poff >> PAGE_SHIFT) >= be->nr_pages); 1122 + page = be->decompressed_pages + (poff >> PAGE_SHIFT); 1123 + if (!*page) { 1124 + *page = bvec->page; 1121 1125 return; 1122 1126 } 1127 + } else { 1128 + be->keepxcpy = true; 1123 1129 } 1124 1130 1125 1131 /* (cold path) one pcluster is requested multiple times */ ··· 1287 1289 .alg = pcl->algorithmformat, 1288 1290 .inplace_io = overlapped, 1289 1291 .partial_decoding = pcl->partial, 1290 - .fillgaps = pcl->multibases, 1292 + .fillgaps = be->keepxcpy, 1291 1293 .gfp = pcl->besteffort ? GFP_KERNEL : 1292 1294 GFP_NOWAIT | __GFP_NORETRY 1293 1295 }, be->pagepool); ··· 1344 1346 1345 1347 pcl->length = 0; 1346 1348 pcl->partial = true; 1347 - pcl->multibases = false; 1348 1349 pcl->besteffort = false; 1349 1350 pcl->bvset.nextpage = NULL; 1350 1351 pcl->vcnt = 0;
+2 -3
fs/smb/client/cifspdu.h
··· 1266 1266 typedef struct smb_com_setattr_req { 1267 1267 struct smb_hdr hdr; /* wct = 8 */ 1268 1268 __le16 attr; 1269 - __le16 time_low; 1270 - __le16 time_high; 1269 + __le32 last_write_time; 1271 1270 __le16 reserved[5]; /* must be zero */ 1272 - __u16 ByteCount; 1271 + __le16 ByteCount; 1273 1272 __u8 BufferFormat; /* 4 = ASCII */ 1274 1273 unsigned char fileName[]; 1275 1274 } __attribute__((packed)) SETATTR_REQ;
+4
fs/smb/client/cifsproto.h
··· 395 395 extern int CIFSSMBQFSPosixInfo(const unsigned int xid, struct cifs_tcon *tcon, 396 396 struct kstatfs *FSData); 397 397 398 + extern int SMBSetInformation(const unsigned int xid, struct cifs_tcon *tcon, 399 + const char *fileName, __le32 attributes, __le64 write_time, 400 + const struct nls_table *nls_codepage, 401 + struct cifs_sb_info *cifs_sb); 398 402 extern int CIFSSMBSetPathInfo(const unsigned int xid, struct cifs_tcon *tcon, 399 403 const char *fileName, const FILE_BASIC_INFO *data, 400 404 const struct nls_table *nls_codepage,
+57
fs/smb/client/cifssmb.c
··· 5171 5171 return rc; 5172 5172 } 5173 5173 5174 + int 5175 + SMBSetInformation(const unsigned int xid, struct cifs_tcon *tcon, 5176 + const char *fileName, __le32 attributes, __le64 write_time, 5177 + const struct nls_table *nls_codepage, 5178 + struct cifs_sb_info *cifs_sb) 5179 + { 5180 + SETATTR_REQ *pSMB; 5181 + SETATTR_RSP *pSMBr; 5182 + struct timespec64 ts; 5183 + int bytes_returned; 5184 + int name_len; 5185 + int rc; 5186 + 5187 + cifs_dbg(FYI, "In %s path %s\n", __func__, fileName); 5188 + 5189 + retry: 5190 + rc = smb_init(SMB_COM_SETATTR, 8, tcon, (void **) &pSMB, 5191 + (void **) &pSMBr); 5192 + if (rc) 5193 + return rc; 5194 + 5195 + if (pSMB->hdr.Flags2 & SMBFLG2_UNICODE) { 5196 + name_len = 5197 + cifsConvertToUTF16((__le16 *) pSMB->fileName, 5198 + fileName, PATH_MAX, nls_codepage, 5199 + cifs_remap(cifs_sb)); 5200 + name_len++; /* trailing null */ 5201 + name_len *= 2; 5202 + } else { 5203 + name_len = copy_path_name(pSMB->fileName, fileName); 5204 + } 5205 + /* Only few attributes can be set by this command, others are not accepted by Win9x. */ 5206 + pSMB->attr = cpu_to_le16(le32_to_cpu(attributes) & 5207 + (ATTR_READONLY | ATTR_HIDDEN | ATTR_SYSTEM | ATTR_ARCHIVE)); 5208 + /* Zero write time value (in both NT and SETATTR formats) means to not change it. */ 5209 + if (le64_to_cpu(write_time) != 0) { 5210 + ts = cifs_NTtimeToUnix(write_time); 5211 + pSMB->last_write_time = cpu_to_le32(ts.tv_sec); 5212 + } 5213 + pSMB->BufferFormat = 0x04; 5214 + name_len++; /* account for buffer type byte */ 5215 + inc_rfc1001_len(pSMB, (__u16)name_len); 5216 + pSMB->ByteCount = cpu_to_le16(name_len); 5217 + 5218 + rc = SendReceive(xid, tcon->ses, (struct smb_hdr *) pSMB, 5219 + (struct smb_hdr *) pSMBr, &bytes_returned, 0); 5220 + if (rc) 5221 + cifs_dbg(FYI, "Send error in %s = %d\n", __func__, rc); 5222 + 5223 + cifs_buf_release(pSMB); 5224 + 5225 + if (rc == -EAGAIN) 5226 + goto retry; 5227 + 5228 + return rc; 5229 + } 5230 + 5174 5231 /* Some legacy servers such as NT4 require that the file times be set on 5175 5232 an open handle, rather than by pathname - this is awkward due to 5176 5233 potential access conflicts on the open, but it is unavoidable for these
+1 -22
fs/smb/client/connect.c
··· 3753 3753 } 3754 3754 } 3755 3755 3756 - /* 3757 - * Clamp the rsize/wsize mount arguments if they are too big for the server 3758 - * and set the rsize/wsize to the negotiated values if not passed in by 3759 - * the user on mount 3760 - */ 3761 - if ((cifs_sb->ctx->wsize == 0) || 3762 - (cifs_sb->ctx->wsize > server->ops->negotiate_wsize(tcon, ctx))) { 3763 - cifs_sb->ctx->wsize = 3764 - round_down(server->ops->negotiate_wsize(tcon, ctx), PAGE_SIZE); 3765 - /* 3766 - * in the very unlikely event that the server sent a max write size under PAGE_SIZE, 3767 - * (which would get rounded down to 0) then reset wsize to absolute minimum eg 4096 3768 - */ 3769 - if (cifs_sb->ctx->wsize == 0) { 3770 - cifs_sb->ctx->wsize = PAGE_SIZE; 3771 - cifs_dbg(VFS, "wsize too small, reset to minimum ie PAGE_SIZE, usually 4096\n"); 3772 - } 3773 - } 3774 - if ((cifs_sb->ctx->rsize == 0) || 3775 - (cifs_sb->ctx->rsize > server->ops->negotiate_rsize(tcon, ctx))) 3776 - cifs_sb->ctx->rsize = server->ops->negotiate_rsize(tcon, ctx); 3777 - 3756 + cifs_negotiate_iosize(server, cifs_sb->ctx, tcon); 3778 3757 /* 3779 3758 * The cookie is initialized from volume info returned above. 3780 3759 * Inside cifs_fscache_get_super_cookie it checks
+2 -4
fs/smb/client/file.c
··· 160 160 server = cifs_pick_channel(tlink_tcon(req->cfile->tlink)->ses); 161 161 rdata->server = server; 162 162 163 - if (cifs_sb->ctx->rsize == 0) 164 - cifs_sb->ctx->rsize = 165 - server->ops->negotiate_rsize(tlink_tcon(req->cfile->tlink), 166 - cifs_sb->ctx); 163 + cifs_negotiate_rsize(server, cifs_sb->ctx, 164 + tlink_tcon(req->cfile->tlink)); 167 165 168 166 rc = server->ops->wait_mtu_credits(server, cifs_sb->ctx->rsize, 169 167 &size, &rdata->credits);
+6 -19
fs/smb/client/fs_context.c
··· 1021 1021 struct dentry *root = fc->root; 1022 1022 struct cifs_sb_info *cifs_sb = CIFS_SB(root->d_sb); 1023 1023 struct cifs_ses *ses = cifs_sb_master_tcon(cifs_sb)->ses; 1024 + unsigned int rsize = ctx->rsize, wsize = ctx->wsize; 1024 1025 char *new_password = NULL, *new_password2 = NULL; 1025 1026 bool need_recon = false; 1026 1027 int rc; ··· 1104 1103 STEAL_STRING(cifs_sb, ctx, iocharset); 1105 1104 1106 1105 /* if rsize or wsize not passed in on remount, use previous values */ 1107 - if (ctx->rsize == 0) 1108 - ctx->rsize = cifs_sb->ctx->rsize; 1109 - if (ctx->wsize == 0) 1110 - ctx->wsize = cifs_sb->ctx->wsize; 1111 - 1106 + ctx->rsize = rsize ? CIFS_ALIGN_RSIZE(fc, rsize) : cifs_sb->ctx->rsize; 1107 + ctx->wsize = wsize ? CIFS_ALIGN_WSIZE(fc, wsize) : cifs_sb->ctx->wsize; 1112 1108 1113 1109 smb3_cleanup_fs_context_contents(cifs_sb->ctx); 1114 1110 rc = smb3_fs_context_dup(cifs_sb->ctx, ctx); ··· 1310 1312 __func__); 1311 1313 goto cifs_parse_mount_err; 1312 1314 } 1313 - ctx->bsize = result.uint_32; 1315 + ctx->bsize = CIFS_ALIGN_BSIZE(fc, result.uint_32); 1314 1316 ctx->got_bsize = true; 1315 1317 break; 1316 1318 case Opt_rasize: ··· 1334 1336 ctx->rasize = result.uint_32; 1335 1337 break; 1336 1338 case Opt_rsize: 1337 - ctx->rsize = result.uint_32; 1339 + ctx->rsize = CIFS_ALIGN_RSIZE(fc, result.uint_32); 1338 1340 ctx->got_rsize = true; 1339 1341 ctx->vol_rsize = ctx->rsize; 1340 1342 break; 1341 1343 case Opt_wsize: 1342 - ctx->wsize = result.uint_32; 1344 + ctx->wsize = CIFS_ALIGN_WSIZE(fc, result.uint_32); 1343 1345 ctx->got_wsize = true; 1344 - if (ctx->wsize % PAGE_SIZE != 0) { 1345 - ctx->wsize = round_down(ctx->wsize, PAGE_SIZE); 1346 - if (ctx->wsize == 0) { 1347 - ctx->wsize = PAGE_SIZE; 1348 - cifs_dbg(VFS, "wsize too small, reset to minimum %ld\n", PAGE_SIZE); 1349 - } else { 1350 - cifs_dbg(VFS, 1351 - "wsize rounded down to %d to multiple of PAGE_SIZE %ld\n", 1352 - ctx->wsize, PAGE_SIZE); 1353 - } 1354 - } 1355 1346 ctx->vol_wsize = ctx->wsize; 1356 1347 break; 1357 1348 case Opt_acregmax:
+47
fs/smb/client/fs_context.h
··· 20 20 cifs_dbg(VFS, fmt, ## __VA_ARGS__); \ 21 21 } while (0) 22 22 23 + static inline size_t cifs_io_align(struct fs_context *fc, 24 + const char *name, size_t size) 25 + { 26 + if (!size || !IS_ALIGNED(size, PAGE_SIZE)) { 27 + cifs_errorf(fc, "unaligned %s, making it a multiple of %lu bytes\n", 28 + name, PAGE_SIZE); 29 + size = umax(round_down(size, PAGE_SIZE), PAGE_SIZE); 30 + } 31 + return size; 32 + } 33 + 34 + #define CIFS_ALIGN_WSIZE(_fc, _size) cifs_io_align(_fc, "wsize", _size) 35 + #define CIFS_ALIGN_RSIZE(_fc, _size) cifs_io_align(_fc, "rsize", _size) 36 + #define CIFS_ALIGN_BSIZE(_fc, _size) cifs_io_align(_fc, "bsize", _size) 37 + 23 38 enum smb_version { 24 39 Smb_1 = 1, 25 40 Smb_20, ··· 374 359 static inline void cifs_mount_unlock(void) 375 360 { 376 361 mutex_unlock(&cifs_mount_mutex); 362 + } 363 + 364 + static inline void cifs_negotiate_rsize(struct TCP_Server_Info *server, 365 + struct smb3_fs_context *ctx, 366 + struct cifs_tcon *tcon) 367 + { 368 + unsigned int size; 369 + 370 + size = umax(server->ops->negotiate_rsize(tcon, ctx), PAGE_SIZE); 371 + if (ctx->rsize) 372 + size = umax(umin(ctx->rsize, size), PAGE_SIZE); 373 + ctx->rsize = round_down(size, PAGE_SIZE); 374 + } 375 + 376 + static inline void cifs_negotiate_wsize(struct TCP_Server_Info *server, 377 + struct smb3_fs_context *ctx, 378 + struct cifs_tcon *tcon) 379 + { 380 + unsigned int size; 381 + 382 + size = umax(server->ops->negotiate_wsize(tcon, ctx), PAGE_SIZE); 383 + if (ctx->wsize) 384 + size = umax(umin(ctx->wsize, size), PAGE_SIZE); 385 + ctx->wsize = round_down(size, PAGE_SIZE); 386 + } 387 + 388 + static inline void cifs_negotiate_iosize(struct TCP_Server_Info *server, 389 + struct smb3_fs_context *ctx, 390 + struct cifs_tcon *tcon) 391 + { 392 + cifs_negotiate_rsize(server, ctx, tcon); 393 + cifs_negotiate_wsize(server, ctx, tcon); 377 394 } 378 395 379 396 #endif
+202 -21
fs/smb/client/smb1ops.c
··· 432 432 } 433 433 434 434 static unsigned int 435 - cifs_negotiate_wsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx) 435 + smb1_negotiate_wsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx) 436 436 { 437 437 __u64 unix_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); 438 438 struct TCP_Server_Info *server = tcon->ses->server; ··· 467 467 } 468 468 469 469 static unsigned int 470 - cifs_negotiate_rsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx) 470 + smb1_negotiate_rsize(struct cifs_tcon *tcon, struct smb3_fs_context *ctx) 471 471 { 472 472 __u64 unix_cap = le64_to_cpu(tcon->fsUnixInfo.Capability); 473 473 struct TCP_Server_Info *server = tcon->ses->server; ··· 543 543 const char *full_path, 544 544 struct cifs_open_info_data *data) 545 545 { 546 - int rc; 546 + int rc = -EOPNOTSUPP; 547 547 FILE_ALL_INFO fi = {}; 548 + struct cifs_search_info search_info = {}; 549 + bool non_unicode_wildcard = false; 548 550 549 551 data->reparse_point = false; 550 552 data->adjust_tz = false; 551 553 552 - /* could do find first instead but this returns more info */ 553 - rc = CIFSSMBQPathInfo(xid, tcon, full_path, &fi, 0 /* not legacy */, cifs_sb->local_nls, 554 - cifs_remap(cifs_sb)); 555 554 /* 556 - * BB optimize code so we do not make the above call when server claims 557 - * no NT SMB support and the above call failed at least once - set flag 558 - * in tcon or mount. 555 + * First try CIFSSMBQPathInfo() function which returns more info 556 + * (NumberOfLinks) than CIFSFindFirst() fallback function. 557 + * Some servers like Win9x do not support SMB_QUERY_FILE_ALL_INFO over 558 + * TRANS2_QUERY_PATH_INFORMATION, but supports it with filehandle over 559 + * TRANS2_QUERY_FILE_INFORMATION (function CIFSSMBQFileInfo(). But SMB 560 + * Open command on non-NT servers works only for files, does not work 561 + * for directories. And moreover Win9x SMB server returns bogus data in 562 + * SMB_QUERY_FILE_ALL_INFO Attributes field. So for non-NT servers, 563 + * do not even use CIFSSMBQPathInfo() or CIFSSMBQFileInfo() function. 559 564 */ 560 - if ((rc == -EOPNOTSUPP) || (rc == -EINVAL)) { 565 + if (tcon->ses->capabilities & CAP_NT_SMBS) 566 + rc = CIFSSMBQPathInfo(xid, tcon, full_path, &fi, 0 /* not legacy */, 567 + cifs_sb->local_nls, cifs_remap(cifs_sb)); 568 + 569 + /* 570 + * Non-UNICODE variant of fallback functions below expands wildcards, 571 + * so they cannot be used for querying paths with wildcard characters. 572 + */ 573 + if (rc && !(tcon->ses->capabilities & CAP_UNICODE) && strpbrk(full_path, "*?\"><")) 574 + non_unicode_wildcard = true; 575 + 576 + /* 577 + * Then fallback to CIFSFindFirst() which works also with non-NT servers 578 + * but does not does not provide NumberOfLinks. 579 + */ 580 + if ((rc == -EOPNOTSUPP || rc == -EINVAL) && 581 + !non_unicode_wildcard) { 582 + if (!(tcon->ses->capabilities & tcon->ses->server->vals->cap_nt_find)) 583 + search_info.info_level = SMB_FIND_FILE_INFO_STANDARD; 584 + else 585 + search_info.info_level = SMB_FIND_FILE_FULL_DIRECTORY_INFO; 586 + rc = CIFSFindFirst(xid, tcon, full_path, cifs_sb, NULL, 587 + CIFS_SEARCH_CLOSE_ALWAYS | CIFS_SEARCH_CLOSE_AT_END, 588 + &search_info, false); 589 + if (rc == 0) { 590 + if (!(tcon->ses->capabilities & tcon->ses->server->vals->cap_nt_find)) { 591 + FIND_FILE_STANDARD_INFO *di; 592 + int offset = tcon->ses->server->timeAdj; 593 + 594 + di = (FIND_FILE_STANDARD_INFO *)search_info.srch_entries_start; 595 + fi.CreationTime = cpu_to_le64(cifs_UnixTimeToNT(cnvrtDosUnixTm( 596 + di->CreationDate, di->CreationTime, offset))); 597 + fi.LastAccessTime = cpu_to_le64(cifs_UnixTimeToNT(cnvrtDosUnixTm( 598 + di->LastAccessDate, di->LastAccessTime, offset))); 599 + fi.LastWriteTime = cpu_to_le64(cifs_UnixTimeToNT(cnvrtDosUnixTm( 600 + di->LastWriteDate, di->LastWriteTime, offset))); 601 + fi.ChangeTime = fi.LastWriteTime; 602 + fi.Attributes = cpu_to_le32(le16_to_cpu(di->Attributes)); 603 + fi.AllocationSize = cpu_to_le64(le32_to_cpu(di->AllocationSize)); 604 + fi.EndOfFile = cpu_to_le64(le32_to_cpu(di->DataSize)); 605 + } else { 606 + FILE_FULL_DIRECTORY_INFO *di; 607 + 608 + di = (FILE_FULL_DIRECTORY_INFO *)search_info.srch_entries_start; 609 + fi.CreationTime = di->CreationTime; 610 + fi.LastAccessTime = di->LastAccessTime; 611 + fi.LastWriteTime = di->LastWriteTime; 612 + fi.ChangeTime = di->ChangeTime; 613 + fi.Attributes = di->ExtFileAttributes; 614 + fi.AllocationSize = di->AllocationSize; 615 + fi.EndOfFile = di->EndOfFile; 616 + fi.EASize = di->EaSize; 617 + } 618 + fi.NumberOfLinks = cpu_to_le32(1); 619 + fi.DeletePending = 0; 620 + fi.Directory = !!(le32_to_cpu(fi.Attributes) & ATTR_DIRECTORY); 621 + cifs_buf_release(search_info.ntwrk_buf_start); 622 + } else if (!full_path[0]) { 623 + /* 624 + * CIFSFindFirst() does not work on root path if the 625 + * root path was exported on the server from the top 626 + * level path (drive letter). 627 + */ 628 + rc = -EOPNOTSUPP; 629 + } 630 + } 631 + 632 + /* 633 + * If everything failed then fallback to the legacy SMB command 634 + * SMB_COM_QUERY_INFORMATION which works with all servers, but 635 + * provide just few information. 636 + */ 637 + if ((rc == -EOPNOTSUPP || rc == -EINVAL) && !non_unicode_wildcard) { 561 638 rc = SMBQueryInformation(xid, tcon, full_path, &fi, cifs_sb->local_nls, 562 639 cifs_remap(cifs_sb)); 563 640 data->adjust_tz = true; 641 + } else if ((rc == -EOPNOTSUPP || rc == -EINVAL) && non_unicode_wildcard) { 642 + /* Path with non-UNICODE wildcard character cannot exist. */ 643 + rc = -ENOENT; 564 644 } 565 645 566 646 if (!rc) { ··· 718 638 { 719 639 int rc; 720 640 FILE_ALL_INFO fi = {}; 641 + 642 + /* 643 + * CIFSSMBQFileInfo() for non-NT servers returns bogus data in 644 + * Attributes fields. So do not use this command for non-NT servers. 645 + */ 646 + if (!(tcon->ses->capabilities & CAP_NT_SMBS)) 647 + return -EOPNOTSUPP; 721 648 722 649 if (cfile->symlink_target) { 723 650 data->symlink_target = kstrdup(cfile->symlink_target, GFP_KERNEL); ··· 896 809 struct cifs_fid fid; 897 810 struct cifs_open_parms oparms; 898 811 struct cifsFileInfo *open_file; 812 + FILE_BASIC_INFO new_buf; 813 + struct cifs_open_info_data query_data; 814 + __le64 write_time = buf->LastWriteTime; 899 815 struct cifsInodeInfo *cinode = CIFS_I(inode); 900 816 struct cifs_sb_info *cifs_sb = CIFS_SB(inode->i_sb); 901 817 struct tcon_link *tlink = NULL; ··· 906 816 907 817 /* if the file is already open for write, just use that fileid */ 908 818 open_file = find_writable_file(cinode, FIND_WR_FSUID_ONLY); 819 + 909 820 if (open_file) { 910 821 fid.netfid = open_file->fid.netfid; 911 822 netpid = open_file->pid; 912 823 tcon = tlink_tcon(open_file->tlink); 913 - goto set_via_filehandle; 824 + } else { 825 + tlink = cifs_sb_tlink(cifs_sb); 826 + if (IS_ERR(tlink)) { 827 + rc = PTR_ERR(tlink); 828 + tlink = NULL; 829 + goto out; 830 + } 831 + tcon = tlink_tcon(tlink); 914 832 } 915 833 916 - tlink = cifs_sb_tlink(cifs_sb); 917 - if (IS_ERR(tlink)) { 918 - rc = PTR_ERR(tlink); 919 - tlink = NULL; 920 - goto out; 834 + /* 835 + * Non-NT servers interprets zero time value in SMB_SET_FILE_BASIC_INFO 836 + * over TRANS2_SET_FILE_INFORMATION as a valid time value. NT servers 837 + * interprets zero time value as do not change existing value on server. 838 + * API of ->set_file_info() callback expects that zero time value has 839 + * the NT meaning - do not change. Therefore if server is non-NT and 840 + * some time values in "buf" are zero, then fetch missing time values. 841 + */ 842 + if (!(tcon->ses->capabilities & CAP_NT_SMBS) && 843 + (!buf->CreationTime || !buf->LastAccessTime || 844 + !buf->LastWriteTime || !buf->ChangeTime)) { 845 + rc = cifs_query_path_info(xid, tcon, cifs_sb, full_path, &query_data); 846 + if (rc) { 847 + if (open_file) { 848 + cifsFileInfo_put(open_file); 849 + open_file = NULL; 850 + } 851 + goto out; 852 + } 853 + /* 854 + * Original write_time from buf->LastWriteTime is preserved 855 + * as SMBSetInformation() interprets zero as do not change. 856 + */ 857 + new_buf = *buf; 858 + buf = &new_buf; 859 + if (!buf->CreationTime) 860 + buf->CreationTime = query_data.fi.CreationTime; 861 + if (!buf->LastAccessTime) 862 + buf->LastAccessTime = query_data.fi.LastAccessTime; 863 + if (!buf->LastWriteTime) 864 + buf->LastWriteTime = query_data.fi.LastWriteTime; 865 + if (!buf->ChangeTime) 866 + buf->ChangeTime = query_data.fi.ChangeTime; 921 867 } 922 - tcon = tlink_tcon(tlink); 868 + 869 + if (open_file) 870 + goto set_via_filehandle; 923 871 924 872 rc = CIFSSMBSetPathInfo(xid, tcon, full_path, buf, cifs_sb->local_nls, 925 873 cifs_sb); ··· 978 850 .fid = &fid, 979 851 }; 980 852 981 - cifs_dbg(FYI, "calling SetFileInfo since SetPathInfo for times not supported by this server\n"); 982 - rc = CIFS_open(xid, &oparms, &oplock, NULL); 853 + if (S_ISDIR(inode->i_mode) && !(tcon->ses->capabilities & CAP_NT_SMBS)) { 854 + /* Opening directory path is not possible on non-NT servers. */ 855 + rc = -EOPNOTSUPP; 856 + } else { 857 + /* 858 + * Use cifs_open_file() instead of CIFS_open() as the 859 + * cifs_open_file() selects the correct function which 860 + * works also on non-NT servers. 861 + */ 862 + rc = cifs_open_file(xid, &oparms, &oplock, NULL); 863 + /* 864 + * Opening path for writing on non-NT servers is not 865 + * possible when the read-only attribute is already set. 866 + * Non-NT server in this case returns -EACCES. For those 867 + * servers the only possible way how to clear the read-only 868 + * bit is via SMB_COM_SETATTR command. 869 + */ 870 + if (rc == -EACCES && 871 + (cinode->cifsAttrs & ATTR_READONLY) && 872 + le32_to_cpu(buf->Attributes) != 0 && /* 0 = do not change attrs */ 873 + !(le32_to_cpu(buf->Attributes) & ATTR_READONLY) && 874 + !(tcon->ses->capabilities & CAP_NT_SMBS)) 875 + rc = -EOPNOTSUPP; 876 + } 877 + 878 + /* Fallback to SMB_COM_SETATTR command when absolutelty needed. */ 879 + if (rc == -EOPNOTSUPP) { 880 + cifs_dbg(FYI, "calling SetInformation since SetPathInfo for attrs/times not supported by this server\n"); 881 + rc = SMBSetInformation(xid, tcon, full_path, 882 + buf->Attributes != 0 ? buf->Attributes : cpu_to_le32(cinode->cifsAttrs), 883 + write_time, 884 + cifs_sb->local_nls, cifs_sb); 885 + if (rc == 0) 886 + cinode->cifsAttrs = le32_to_cpu(buf->Attributes); 887 + else 888 + rc = -EACCES; 889 + goto out; 890 + } 891 + 983 892 if (rc != 0) { 984 893 if (rc == -EIO) 985 894 rc = -EINVAL; ··· 1024 859 } 1025 860 1026 861 netpid = current->tgid; 862 + cifs_dbg(FYI, "calling SetFileInfo since SetPathInfo for attrs/times not supported by this server\n"); 1027 863 1028 864 set_via_filehandle: 1029 865 rc = CIFSSMBSetFileInfo(xid, tcon, buf, fid.netfid, netpid); ··· 1035 869 CIFSSMBClose(xid, tcon, fid.netfid); 1036 870 else 1037 871 cifsFileInfo_put(open_file); 872 + 873 + /* 874 + * Setting the read-only bit is not honered on non-NT servers when done 875 + * via open-semantics. So for setting it, use SMB_COM_SETATTR command. 876 + * This command works only after the file is closed, so use it only when 877 + * operation was called without the filehandle. 878 + */ 879 + if (open_file == NULL && 880 + !(tcon->ses->capabilities & CAP_NT_SMBS) && 881 + le32_to_cpu(buf->Attributes) & ATTR_READONLY) { 882 + SMBSetInformation(xid, tcon, full_path, 883 + buf->Attributes, 884 + 0 /* do not change write time */, 885 + cifs_sb->local_nls, cifs_sb); 886 + } 1038 887 out: 1039 888 if (tlink != NULL) 1040 889 cifs_put_tlink(tlink); ··· 1342 1161 .check_trans2 = cifs_check_trans2, 1343 1162 .need_neg = cifs_need_neg, 1344 1163 .negotiate = cifs_negotiate, 1345 - .negotiate_wsize = cifs_negotiate_wsize, 1346 - .negotiate_rsize = cifs_negotiate_rsize, 1164 + .negotiate_wsize = smb1_negotiate_wsize, 1165 + .negotiate_rsize = smb1_negotiate_rsize, 1347 1166 .sess_setup = CIFS_SessSetup, 1348 1167 .logoff = CIFSSMBLogoff, 1349 1168 .tree_connect = CIFSTCon,
+3 -6
fs/smb/client/smb2pdu.c
··· 2921 2921 req->CreateContextsOffset = cpu_to_le32( 2922 2922 sizeof(struct smb2_create_req) + 2923 2923 iov[1].iov_len); 2924 + le32_add_cpu(&req->CreateContextsLength, iov[n_iov-1].iov_len); 2924 2925 pc_buf = iov[n_iov-1].iov_base; 2925 2926 } 2926 2927 ··· 4093 4092 return; 4094 4093 4095 4094 spin_lock(&tcon->sb_list_lock); 4096 - list_for_each_entry(cifs_sb, &tcon->cifs_sb_list, tcon_sb_link) { 4097 - cifs_sb->ctx->rsize = 4098 - server->ops->negotiate_rsize(tcon, cifs_sb->ctx); 4099 - cifs_sb->ctx->wsize = 4100 - server->ops->negotiate_wsize(tcon, cifs_sb->ctx); 4101 - } 4095 + list_for_each_entry(cifs_sb, &tcon->cifs_sb_list, tcon_sb_link) 4096 + cifs_negotiate_iosize(server, cifs_sb->ctx, tcon); 4102 4097 spin_unlock(&tcon->sb_list_lock); 4103 4098 } 4104 4099
+5 -2
fs/smb/server/oplock.c
··· 1496 1496 1497 1497 if (le16_to_cpu(cc->DataOffset) + le32_to_cpu(cc->DataLength) < 1498 1498 sizeof(struct create_lease_v2) - 4) 1499 - return NULL; 1499 + goto err_out; 1500 1500 1501 1501 memcpy(lreq->lease_key, lc->lcontext.LeaseKey, SMB2_LEASE_KEY_SIZE); 1502 1502 lreq->req_state = lc->lcontext.LeaseState; ··· 1512 1512 1513 1513 if (le16_to_cpu(cc->DataOffset) + le32_to_cpu(cc->DataLength) < 1514 1514 sizeof(struct create_lease)) 1515 - return NULL; 1515 + goto err_out; 1516 1516 1517 1517 memcpy(lreq->lease_key, lc->lcontext.LeaseKey, SMB2_LEASE_KEY_SIZE); 1518 1518 lreq->req_state = lc->lcontext.LeaseState; ··· 1521 1521 lreq->version = 1; 1522 1522 } 1523 1523 return lreq; 1524 + err_out: 1525 + kfree(lreq); 1526 + return NULL; 1524 1527 } 1525 1528 1526 1529 /**
+5
fs/smb/server/smb2pdu.c
··· 633 633 return name; 634 634 } 635 635 636 + if (*name == '\0') { 637 + kfree(name); 638 + return ERR_PTR(-EINVAL); 639 + } 640 + 636 641 if (*name == '\\') { 637 642 pr_err("not allow directory name included leading slash\n"); 638 643 kfree(name);
+7
fs/smb/server/vfs.c
··· 426 426 goto out; 427 427 } 428 428 429 + if (v_len <= *pos) { 430 + pr_err("stream write position %lld is out of bounds (stream length: %zd)\n", 431 + *pos, v_len); 432 + err = -EINVAL; 433 + goto out; 434 + } 435 + 429 436 if (v_len < size) { 430 437 wbuf = kvzalloc(size, KSMBD_DEFAULT_GFP); 431 438 if (!wbuf) {
+26 -7
fs/smb/server/vfs_cache.c
··· 661 661 bool (*skip)(struct ksmbd_tree_connect *tcon, 662 662 struct ksmbd_file *fp)) 663 663 { 664 - unsigned int id; 665 - struct ksmbd_file *fp; 666 - int num = 0; 664 + struct ksmbd_file *fp; 665 + unsigned int id = 0; 666 + int num = 0; 667 667 668 - idr_for_each_entry(ft->idr, fp, id) { 669 - if (skip(tcon, fp)) 668 + while (1) { 669 + write_lock(&ft->lock); 670 + fp = idr_get_next(ft->idr, &id); 671 + if (!fp) { 672 + write_unlock(&ft->lock); 673 + break; 674 + } 675 + 676 + if (skip(tcon, fp) || 677 + !atomic_dec_and_test(&fp->refcount)) { 678 + id++; 679 + write_unlock(&ft->lock); 670 680 continue; 681 + } 671 682 672 683 set_close_state_blocked_works(fp); 684 + idr_remove(ft->idr, fp->volatile_id); 685 + fp->volatile_id = KSMBD_NO_FID; 686 + write_unlock(&ft->lock); 673 687 674 - if (!atomic_dec_and_test(&fp->refcount)) 675 - continue; 688 + down_write(&fp->f_ci->m_lock); 689 + list_del_init(&fp->node); 690 + up_write(&fp->f_ci->m_lock); 691 + 676 692 __ksmbd_close_fd(ft, fp); 693 + 677 694 num++; 695 + id++; 678 696 } 697 + 679 698 return num; 680 699 } 681 700
+54 -29
include/linux/cpufreq.h
··· 776 776 int cpufreq_generic_frequency_table_verify(struct cpufreq_policy_data *policy); 777 777 778 778 int cpufreq_table_index_unsorted(struct cpufreq_policy *policy, 779 - unsigned int target_freq, 780 - unsigned int relation); 779 + unsigned int target_freq, unsigned int min, 780 + unsigned int max, unsigned int relation); 781 781 int cpufreq_frequency_table_get_index(struct cpufreq_policy *policy, 782 782 unsigned int freq); 783 783 ··· 840 840 return best; 841 841 } 842 842 843 - /* Works only on sorted freq-tables */ 844 - static inline int cpufreq_table_find_index_l(struct cpufreq_policy *policy, 845 - unsigned int target_freq, 846 - bool efficiencies) 843 + static inline int find_index_l(struct cpufreq_policy *policy, 844 + unsigned int target_freq, 845 + unsigned int min, unsigned int max, 846 + bool efficiencies) 847 847 { 848 - target_freq = clamp_val(target_freq, policy->min, policy->max); 848 + target_freq = clamp_val(target_freq, min, max); 849 849 850 850 if (policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_ASCENDING) 851 851 return cpufreq_table_find_index_al(policy, target_freq, ··· 853 853 else 854 854 return cpufreq_table_find_index_dl(policy, target_freq, 855 855 efficiencies); 856 + } 857 + 858 + /* Works only on sorted freq-tables */ 859 + static inline int cpufreq_table_find_index_l(struct cpufreq_policy *policy, 860 + unsigned int target_freq, 861 + bool efficiencies) 862 + { 863 + return find_index_l(policy, target_freq, policy->min, policy->max, efficiencies); 856 864 } 857 865 858 866 /* Find highest freq at or below target in a table in ascending order */ ··· 916 908 return best; 917 909 } 918 910 919 - /* Works only on sorted freq-tables */ 920 - static inline int cpufreq_table_find_index_h(struct cpufreq_policy *policy, 921 - unsigned int target_freq, 922 - bool efficiencies) 911 + static inline int find_index_h(struct cpufreq_policy *policy, 912 + unsigned int target_freq, 913 + unsigned int min, unsigned int max, 914 + bool efficiencies) 923 915 { 924 - target_freq = clamp_val(target_freq, policy->min, policy->max); 916 + target_freq = clamp_val(target_freq, min, max); 925 917 926 918 if (policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_ASCENDING) 927 919 return cpufreq_table_find_index_ah(policy, target_freq, ··· 929 921 else 930 922 return cpufreq_table_find_index_dh(policy, target_freq, 931 923 efficiencies); 924 + } 925 + 926 + /* Works only on sorted freq-tables */ 927 + static inline int cpufreq_table_find_index_h(struct cpufreq_policy *policy, 928 + unsigned int target_freq, 929 + bool efficiencies) 930 + { 931 + return find_index_h(policy, target_freq, policy->min, policy->max, efficiencies); 932 932 } 933 933 934 934 /* Find closest freq to target in a table in ascending order */ ··· 1009 993 return best; 1010 994 } 1011 995 1012 - /* Works only on sorted freq-tables */ 1013 - static inline int cpufreq_table_find_index_c(struct cpufreq_policy *policy, 1014 - unsigned int target_freq, 1015 - bool efficiencies) 996 + static inline int find_index_c(struct cpufreq_policy *policy, 997 + unsigned int target_freq, 998 + unsigned int min, unsigned int max, 999 + bool efficiencies) 1016 1000 { 1017 - target_freq = clamp_val(target_freq, policy->min, policy->max); 1001 + target_freq = clamp_val(target_freq, min, max); 1018 1002 1019 1003 if (policy->freq_table_sorted == CPUFREQ_TABLE_SORTED_ASCENDING) 1020 1004 return cpufreq_table_find_index_ac(policy, target_freq, ··· 1024 1008 efficiencies); 1025 1009 } 1026 1010 1027 - static inline bool cpufreq_is_in_limits(struct cpufreq_policy *policy, int idx) 1011 + /* Works only on sorted freq-tables */ 1012 + static inline int cpufreq_table_find_index_c(struct cpufreq_policy *policy, 1013 + unsigned int target_freq, 1014 + bool efficiencies) 1015 + { 1016 + return find_index_c(policy, target_freq, policy->min, policy->max, efficiencies); 1017 + } 1018 + 1019 + static inline bool cpufreq_is_in_limits(struct cpufreq_policy *policy, 1020 + unsigned int min, unsigned int max, 1021 + int idx) 1028 1022 { 1029 1023 unsigned int freq; 1030 1024 ··· 1043 1017 1044 1018 freq = policy->freq_table[idx].frequency; 1045 1019 1046 - return freq == clamp_val(freq, policy->min, policy->max); 1020 + return freq == clamp_val(freq, min, max); 1047 1021 } 1048 1022 1049 1023 static inline int cpufreq_frequency_table_target(struct cpufreq_policy *policy, 1050 1024 unsigned int target_freq, 1025 + unsigned int min, 1026 + unsigned int max, 1051 1027 unsigned int relation) 1052 1028 { 1053 1029 bool efficiencies = policy->efficiencies_available && ··· 1060 1032 relation &= ~CPUFREQ_RELATION_E; 1061 1033 1062 1034 if (unlikely(policy->freq_table_sorted == CPUFREQ_TABLE_UNSORTED)) 1063 - return cpufreq_table_index_unsorted(policy, target_freq, 1064 - relation); 1035 + return cpufreq_table_index_unsorted(policy, target_freq, min, 1036 + max, relation); 1065 1037 retry: 1066 1038 switch (relation) { 1067 1039 case CPUFREQ_RELATION_L: 1068 - idx = cpufreq_table_find_index_l(policy, target_freq, 1069 - efficiencies); 1040 + idx = find_index_l(policy, target_freq, min, max, efficiencies); 1070 1041 break; 1071 1042 case CPUFREQ_RELATION_H: 1072 - idx = cpufreq_table_find_index_h(policy, target_freq, 1073 - efficiencies); 1043 + idx = find_index_h(policy, target_freq, min, max, efficiencies); 1074 1044 break; 1075 1045 case CPUFREQ_RELATION_C: 1076 - idx = cpufreq_table_find_index_c(policy, target_freq, 1077 - efficiencies); 1046 + idx = find_index_c(policy, target_freq, min, max, efficiencies); 1078 1047 break; 1079 1048 default: 1080 1049 WARN_ON_ONCE(1); 1081 1050 return 0; 1082 1051 } 1083 1052 1084 - /* Limit frequency index to honor policy->min/max */ 1085 - if (!cpufreq_is_in_limits(policy, idx) && efficiencies) { 1053 + /* Limit frequency index to honor min and max */ 1054 + if (!cpufreq_is_in_limits(policy, min, max, idx) && efficiencies) { 1086 1055 efficiencies = false; 1087 1056 goto retry; 1088 1057 }
+1 -1
include/linux/ieee80211.h
··· 1526 1526 struct { 1527 1527 u8 action_code; 1528 1528 u8 dialog_token; 1529 - u8 status_code; 1529 + __le16 status_code; 1530 1530 u8 variable[]; 1531 1531 } __packed ttlm_res; 1532 1532 struct {
+4 -4
include/linux/iommu.h
··· 440 440 void *dst_data, const struct iommu_user_data *src_data, 441 441 unsigned int data_type, size_t data_len, size_t min_len) 442 442 { 443 - if (src_data->type != data_type) 444 - return -EINVAL; 445 443 if (WARN_ON(!dst_data || !src_data)) 444 + return -EINVAL; 445 + if (src_data->type != data_type) 446 446 return -EINVAL; 447 447 if (src_data->len < min_len || data_len < src_data->len) 448 448 return -EINVAL; ··· 456 456 * include/uapi/linux/iommufd.h 457 457 * @user_data: Pointer to a struct iommu_user_data for user space data info 458 458 * @data_type: The data type of the @kdst. Must match with @user_data->type 459 - * @min_last: The last memember of the data structure @kdst points in the 460 - * initial version. 459 + * @min_last: The last member of the data structure @kdst points in the initial 460 + * version. 461 461 * Return 0 for success, otherwise -error. 462 462 */ 463 463 #define iommu_copy_struct_from_user(kdst, user_data, data_type, min_last) \
+1
include/linux/netdevice.h
··· 4972 4972 4973 4973 /* Functions used for secondary unicast and multicast support */ 4974 4974 void dev_set_rx_mode(struct net_device *dev); 4975 + int netif_set_promiscuity(struct net_device *dev, int inc); 4975 4976 int dev_set_promiscuity(struct net_device *dev, int inc); 4976 4977 int netif_set_allmulti(struct net_device *dev, int inc, bool notify); 4977 4978 int dev_set_allmulti(struct net_device *dev, int inc);
+6
include/net/netdev_queues.h
··· 105 105 struct netdev_queue_stats_tx *tx); 106 106 }; 107 107 108 + void netdev_stat_queue_sum(struct net_device *netdev, 109 + int rx_start, int rx_end, 110 + struct netdev_queue_stats_rx *rx_sum, 111 + int tx_start, int tx_end, 112 + struct netdev_queue_stats_tx *tx_sum); 113 + 108 114 /** 109 115 * struct netdev_queue_mgmt_ops - netdev ops for queue management 110 116 *
+1
include/sound/soc_sdw_utils.h
··· 226 226 bool playback); 227 227 int asoc_sdw_cs_spk_feedback_rtd_init(struct snd_soc_pcm_runtime *rtd, 228 228 struct snd_soc_dai *dai); 229 + int asoc_sdw_cs35l56_volume_limit(struct snd_soc_card *card, const char *name_prefix); 229 230 230 231 /* MAXIM codec support */ 231 232 int asoc_sdw_maxim_init(struct snd_soc_card *card,
+1 -1
include/sound/ump_convert.h
··· 19 19 /* context for converting from MIDI1 byte stream to UMP packet */ 20 20 struct ump_cvt_to_ump { 21 21 /* MIDI1 intermediate buffer */ 22 - unsigned char buf[4]; 22 + unsigned char buf[6]; /* up to 6 bytes for SysEx */ 23 23 int len; 24 24 int cmd_bytes; 25 25
+1 -1
include/trace/events/btrfs.h
··· 1928 1928 TP_PROTO(const struct btrfs_fs_info *fs_info, 1929 1929 const struct prelim_ref *oldref, 1930 1930 const struct prelim_ref *newref, u64 tree_size), 1931 - TP_ARGS(fs_info, newref, oldref, tree_size), 1931 + TP_ARGS(fs_info, oldref, newref, tree_size), 1932 1932 1933 1933 TP_STRUCT__entry_btrfs( 1934 1934 __field( u64, root_id )
+3
include/uapi/linux/bpf.h
··· 4968 4968 * the netns switch takes place from ingress to ingress without 4969 4969 * going through the CPU's backlog queue. 4970 4970 * 4971 + * *skb*\ **->mark** and *skb*\ **->tstamp** are not cleared during 4972 + * the netns switch. 4973 + * 4971 4974 * The *flags* argument is reserved and must be 0. The helper is 4972 4975 * currently only supported for tc BPF program types at the 4973 4976 * ingress hook and for veth and netkit target device types. The
+2 -2
io_uring/fdinfo.c
··· 123 123 seq_printf(m, "SqMask:\t0x%x\n", sq_mask); 124 124 seq_printf(m, "SqHead:\t%u\n", sq_head); 125 125 seq_printf(m, "SqTail:\t%u\n", sq_tail); 126 - seq_printf(m, "CachedSqHead:\t%u\n", ctx->cached_sq_head); 126 + seq_printf(m, "CachedSqHead:\t%u\n", data_race(ctx->cached_sq_head)); 127 127 seq_printf(m, "CqMask:\t0x%x\n", cq_mask); 128 128 seq_printf(m, "CqHead:\t%u\n", cq_head); 129 129 seq_printf(m, "CqTail:\t%u\n", cq_tail); 130 - seq_printf(m, "CachedCqTail:\t%u\n", ctx->cached_cq_tail); 130 + seq_printf(m, "CachedCqTail:\t%u\n", data_race(ctx->cached_cq_tail)); 131 131 seq_printf(m, "SQEs:\t%u\n", sq_tail - sq_head); 132 132 sq_entries = min(sq_tail - sq_head, ctx->sq_entries); 133 133 for (i = 0; i < sq_entries; i++) {
+1 -1
kernel/irq/msi.c
··· 761 761 static void msi_domain_debug_show(struct seq_file *m, struct irq_domain *d, 762 762 struct irq_data *irqd, int ind) 763 763 { 764 - struct msi_desc *desc = irq_data_get_msi_desc(irqd); 764 + struct msi_desc *desc = irqd ? irq_data_get_msi_desc(irqd) : NULL; 765 765 766 766 if (!desc) 767 767 return;
+1 -1
kernel/trace/ftrace.c
··· 3436 3436 3437 3437 /* Copy the subops hash */ 3438 3438 *filter_hash = alloc_and_copy_ftrace_hash(size_bits, subops_hash->filter_hash); 3439 - if (!filter_hash) 3439 + if (!*filter_hash) 3440 3440 return -ENOMEM; 3441 3441 /* Remove any notrace functions from the copy */ 3442 3442 remove_hash(*filter_hash, subops_hash->notrace_hash);
+6 -3
kernel/trace/trace.c
··· 6043 6043 tscratch = tr->scratch; 6044 6044 /* if there is no tscrach, module_delta must be NULL. */ 6045 6045 module_delta = READ_ONCE(tr->module_delta); 6046 - if (!module_delta || tscratch->entries[0].mod_addr > addr) 6046 + if (!module_delta || !tscratch->nr_entries || 6047 + tscratch->entries[0].mod_addr > addr) { 6047 6048 return addr + tr->text_delta; 6049 + } 6048 6050 6049 6051 /* Note that entries must be sorted. */ 6050 6052 nr_entries = tscratch->nr_entries; ··· 6823 6821 /* Copy the data into the page, so we can start over. */ 6824 6822 ret = trace_seq_to_buffer(&iter->seq, 6825 6823 page_address(spd.pages[i]), 6826 - trace_seq_used(&iter->seq)); 6824 + min((size_t)trace_seq_used(&iter->seq), 6825 + PAGE_SIZE)); 6827 6826 if (ret < 0) { 6828 6827 __free_page(spd.pages[i]); 6829 6828 break; 6830 6829 } 6831 6830 spd.partial[i].offset = 0; 6832 - spd.partial[i].len = trace_seq_used(&iter->seq); 6831 + spd.partial[i].len = ret; 6833 6832 6834 6833 trace_seq_init(&iter->seq); 6835 6834 }
+2 -2
kernel/trace/trace_output.c
··· 1042 1042 struct trace_event_call *call; 1043 1043 struct list_head *head; 1044 1044 1045 + lockdep_assert_held_read(&trace_event_sem); 1046 + 1045 1047 /* ftrace defined events have separate call structures */ 1046 1048 if (event->type <= __TRACE_LAST_TYPE) { 1047 1049 bool found = false; 1048 1050 1049 - down_read(&trace_event_sem); 1050 1051 list_for_each_entry(call, &ftrace_events, list) { 1051 1052 if (call->event.type == event->type) { 1052 1053 found = true; ··· 1057 1056 if (call->event.type > __TRACE_LAST_TYPE) 1058 1057 break; 1059 1058 } 1060 - up_read(&trace_event_sem); 1061 1059 if (!found) { 1062 1060 trace_seq_printf(&iter->seq, "UNKNOWN TYPE %d\n", event->type); 1063 1061 goto out;
+8 -22
mm/slub.c
··· 2028 2028 return 0; 2029 2029 } 2030 2030 2031 - /* Should be called only if mem_alloc_profiling_enabled() */ 2032 - static noinline void free_slab_obj_exts(struct slab *slab) 2031 + static inline void free_slab_obj_exts(struct slab *slab) 2033 2032 { 2034 2033 struct slabobj_ext *obj_exts; 2035 2034 ··· 2048 2049 slab->obj_exts = 0; 2049 2050 } 2050 2051 2051 - static inline bool need_slab_obj_ext(void) 2052 - { 2053 - if (mem_alloc_profiling_enabled()) 2054 - return true; 2055 - 2056 - /* 2057 - * CONFIG_MEMCG creates vector of obj_cgroup objects conditionally 2058 - * inside memcg_slab_post_alloc_hook. No other users for now. 2059 - */ 2060 - return false; 2061 - } 2062 - 2063 2052 #else /* CONFIG_SLAB_OBJ_EXT */ 2064 2053 2065 2054 static inline void init_slab_obj_exts(struct slab *slab) ··· 2062 2075 2063 2076 static inline void free_slab_obj_exts(struct slab *slab) 2064 2077 { 2065 - } 2066 - 2067 - static inline bool need_slab_obj_ext(void) 2068 - { 2069 - return false; 2070 2078 } 2071 2079 2072 2080 #endif /* CONFIG_SLAB_OBJ_EXT */ ··· 2111 2129 static inline void 2112 2130 alloc_tagging_slab_alloc_hook(struct kmem_cache *s, void *object, gfp_t flags) 2113 2131 { 2114 - if (need_slab_obj_ext()) 2132 + if (mem_alloc_profiling_enabled()) 2115 2133 __alloc_tagging_slab_alloc_hook(s, object, flags); 2116 2134 } 2117 2135 ··· 2583 2601 static __always_inline void unaccount_slab(struct slab *slab, int order, 2584 2602 struct kmem_cache *s) 2585 2603 { 2586 - if (memcg_kmem_online() || need_slab_obj_ext()) 2587 - free_slab_obj_exts(slab); 2604 + /* 2605 + * The slab object extensions should now be freed regardless of 2606 + * whether mem_alloc_profiling_enabled() or not because profiling 2607 + * might have been disabled after slab->obj_exts got allocated. 2608 + */ 2609 + free_slab_obj_exts(slab); 2588 2610 2589 2611 mod_node_page_state(slab_pgdat(slab), cache_vmstat_idx(s), 2590 2612 -(PAGE_SIZE << order));
+91 -60
net/can/gw.c
··· 130 130 u32 handled_frames; 131 131 u32 dropped_frames; 132 132 u32 deleted_frames; 133 - struct cf_mod mod; 133 + struct cf_mod __rcu *cf_mod; 134 134 union { 135 135 /* CAN frame data source */ 136 136 struct net_device *dev; ··· 459 459 struct cgw_job *gwj = (struct cgw_job *)data; 460 460 struct canfd_frame *cf; 461 461 struct sk_buff *nskb; 462 + struct cf_mod *mod; 462 463 int modidx = 0; 463 464 464 465 /* process strictly Classic CAN or CAN FD frames */ ··· 507 506 * When there is at least one modification function activated, 508 507 * we need to copy the skb as we want to modify skb->data. 509 508 */ 510 - if (gwj->mod.modfunc[0]) 509 + mod = rcu_dereference(gwj->cf_mod); 510 + if (mod->modfunc[0]) 511 511 nskb = skb_copy(skb, GFP_ATOMIC); 512 512 else 513 513 nskb = skb_clone(skb, GFP_ATOMIC); ··· 531 529 cf = (struct canfd_frame *)nskb->data; 532 530 533 531 /* perform preprocessed modification functions if there are any */ 534 - while (modidx < MAX_MODFUNCTIONS && gwj->mod.modfunc[modidx]) 535 - (*gwj->mod.modfunc[modidx++])(cf, &gwj->mod); 532 + while (modidx < MAX_MODFUNCTIONS && mod->modfunc[modidx]) 533 + (*mod->modfunc[modidx++])(cf, mod); 536 534 537 535 /* Has the CAN frame been modified? */ 538 536 if (modidx) { ··· 548 546 } 549 547 550 548 /* check for checksum updates */ 551 - if (gwj->mod.csumfunc.crc8) 552 - (*gwj->mod.csumfunc.crc8)(cf, &gwj->mod.csum.crc8); 549 + if (mod->csumfunc.crc8) 550 + (*mod->csumfunc.crc8)(cf, &mod->csum.crc8); 553 551 554 - if (gwj->mod.csumfunc.xor) 555 - (*gwj->mod.csumfunc.xor)(cf, &gwj->mod.csum.xor); 552 + if (mod->csumfunc.xor) 553 + (*mod->csumfunc.xor)(cf, &mod->csum.xor); 556 554 } 557 555 558 556 /* clear the skb timestamp if not configured the other way */ ··· 583 581 { 584 582 struct cgw_job *gwj = container_of(rcu_head, struct cgw_job, rcu); 585 583 584 + /* cgw_job::cf_mod is always accessed from the same cgw_job object within 585 + * the same RCU read section. Once cgw_job is scheduled for removal, 586 + * cf_mod can also be removed without mandating an additional grace period. 587 + */ 588 + kfree(rcu_access_pointer(gwj->cf_mod)); 586 589 kmem_cache_free(cgw_cache, gwj); 590 + } 591 + 592 + /* Return cgw_job::cf_mod with RTNL protected section */ 593 + static struct cf_mod *cgw_job_cf_mod(struct cgw_job *gwj) 594 + { 595 + return rcu_dereference_protected(gwj->cf_mod, rtnl_is_locked()); 587 596 } 588 597 589 598 static int cgw_notifier(struct notifier_block *nb, ··· 629 616 { 630 617 struct rtcanmsg *rtcan; 631 618 struct nlmsghdr *nlh; 619 + struct cf_mod *mod; 632 620 633 621 nlh = nlmsg_put(skb, pid, seq, type, sizeof(*rtcan), flags); 634 622 if (!nlh) ··· 664 650 goto cancel; 665 651 } 666 652 653 + mod = cgw_job_cf_mod(gwj); 667 654 if (gwj->flags & CGW_FLAGS_CAN_FD) { 668 655 struct cgw_fdframe_mod mb; 669 656 670 - if (gwj->mod.modtype.and) { 671 - memcpy(&mb.cf, &gwj->mod.modframe.and, sizeof(mb.cf)); 672 - mb.modtype = gwj->mod.modtype.and; 657 + if (mod->modtype.and) { 658 + memcpy(&mb.cf, &mod->modframe.and, sizeof(mb.cf)); 659 + mb.modtype = mod->modtype.and; 673 660 if (nla_put(skb, CGW_FDMOD_AND, sizeof(mb), &mb) < 0) 674 661 goto cancel; 675 662 } 676 663 677 - if (gwj->mod.modtype.or) { 678 - memcpy(&mb.cf, &gwj->mod.modframe.or, sizeof(mb.cf)); 679 - mb.modtype = gwj->mod.modtype.or; 664 + if (mod->modtype.or) { 665 + memcpy(&mb.cf, &mod->modframe.or, sizeof(mb.cf)); 666 + mb.modtype = mod->modtype.or; 680 667 if (nla_put(skb, CGW_FDMOD_OR, sizeof(mb), &mb) < 0) 681 668 goto cancel; 682 669 } 683 670 684 - if (gwj->mod.modtype.xor) { 685 - memcpy(&mb.cf, &gwj->mod.modframe.xor, sizeof(mb.cf)); 686 - mb.modtype = gwj->mod.modtype.xor; 671 + if (mod->modtype.xor) { 672 + memcpy(&mb.cf, &mod->modframe.xor, sizeof(mb.cf)); 673 + mb.modtype = mod->modtype.xor; 687 674 if (nla_put(skb, CGW_FDMOD_XOR, sizeof(mb), &mb) < 0) 688 675 goto cancel; 689 676 } 690 677 691 - if (gwj->mod.modtype.set) { 692 - memcpy(&mb.cf, &gwj->mod.modframe.set, sizeof(mb.cf)); 693 - mb.modtype = gwj->mod.modtype.set; 678 + if (mod->modtype.set) { 679 + memcpy(&mb.cf, &mod->modframe.set, sizeof(mb.cf)); 680 + mb.modtype = mod->modtype.set; 694 681 if (nla_put(skb, CGW_FDMOD_SET, sizeof(mb), &mb) < 0) 695 682 goto cancel; 696 683 } 697 684 } else { 698 685 struct cgw_frame_mod mb; 699 686 700 - if (gwj->mod.modtype.and) { 701 - memcpy(&mb.cf, &gwj->mod.modframe.and, sizeof(mb.cf)); 702 - mb.modtype = gwj->mod.modtype.and; 687 + if (mod->modtype.and) { 688 + memcpy(&mb.cf, &mod->modframe.and, sizeof(mb.cf)); 689 + mb.modtype = mod->modtype.and; 703 690 if (nla_put(skb, CGW_MOD_AND, sizeof(mb), &mb) < 0) 704 691 goto cancel; 705 692 } 706 693 707 - if (gwj->mod.modtype.or) { 708 - memcpy(&mb.cf, &gwj->mod.modframe.or, sizeof(mb.cf)); 709 - mb.modtype = gwj->mod.modtype.or; 694 + if (mod->modtype.or) { 695 + memcpy(&mb.cf, &mod->modframe.or, sizeof(mb.cf)); 696 + mb.modtype = mod->modtype.or; 710 697 if (nla_put(skb, CGW_MOD_OR, sizeof(mb), &mb) < 0) 711 698 goto cancel; 712 699 } 713 700 714 - if (gwj->mod.modtype.xor) { 715 - memcpy(&mb.cf, &gwj->mod.modframe.xor, sizeof(mb.cf)); 716 - mb.modtype = gwj->mod.modtype.xor; 701 + if (mod->modtype.xor) { 702 + memcpy(&mb.cf, &mod->modframe.xor, sizeof(mb.cf)); 703 + mb.modtype = mod->modtype.xor; 717 704 if (nla_put(skb, CGW_MOD_XOR, sizeof(mb), &mb) < 0) 718 705 goto cancel; 719 706 } 720 707 721 - if (gwj->mod.modtype.set) { 722 - memcpy(&mb.cf, &gwj->mod.modframe.set, sizeof(mb.cf)); 723 - mb.modtype = gwj->mod.modtype.set; 708 + if (mod->modtype.set) { 709 + memcpy(&mb.cf, &mod->modframe.set, sizeof(mb.cf)); 710 + mb.modtype = mod->modtype.set; 724 711 if (nla_put(skb, CGW_MOD_SET, sizeof(mb), &mb) < 0) 725 712 goto cancel; 726 713 } 727 714 } 728 715 729 - if (gwj->mod.uid) { 730 - if (nla_put_u32(skb, CGW_MOD_UID, gwj->mod.uid) < 0) 716 + if (mod->uid) { 717 + if (nla_put_u32(skb, CGW_MOD_UID, mod->uid) < 0) 731 718 goto cancel; 732 719 } 733 720 734 - if (gwj->mod.csumfunc.crc8) { 721 + if (mod->csumfunc.crc8) { 735 722 if (nla_put(skb, CGW_CS_CRC8, CGW_CS_CRC8_LEN, 736 - &gwj->mod.csum.crc8) < 0) 723 + &mod->csum.crc8) < 0) 737 724 goto cancel; 738 725 } 739 726 740 - if (gwj->mod.csumfunc.xor) { 727 + if (mod->csumfunc.xor) { 741 728 if (nla_put(skb, CGW_CS_XOR, CGW_CS_XOR_LEN, 742 - &gwj->mod.csum.xor) < 0) 729 + &mod->csum.xor) < 0) 743 730 goto cancel; 744 731 } 745 732 ··· 1074 1059 struct net *net = sock_net(skb->sk); 1075 1060 struct rtcanmsg *r; 1076 1061 struct cgw_job *gwj; 1077 - struct cf_mod mod; 1062 + struct cf_mod *mod; 1078 1063 struct can_can_gw ccgw; 1079 1064 u8 limhops = 0; 1080 1065 int err = 0; ··· 1093 1078 if (r->gwtype != CGW_TYPE_CAN_CAN) 1094 1079 return -EINVAL; 1095 1080 1096 - err = cgw_parse_attr(nlh, &mod, CGW_TYPE_CAN_CAN, &ccgw, &limhops); 1097 - if (err < 0) 1098 - return err; 1081 + mod = kmalloc(sizeof(*mod), GFP_KERNEL); 1082 + if (!mod) 1083 + return -ENOMEM; 1099 1084 1100 - if (mod.uid) { 1085 + err = cgw_parse_attr(nlh, mod, CGW_TYPE_CAN_CAN, &ccgw, &limhops); 1086 + if (err < 0) 1087 + goto out_free_cf; 1088 + 1089 + if (mod->uid) { 1101 1090 ASSERT_RTNL(); 1102 1091 1103 1092 /* check for updating an existing job with identical uid */ 1104 1093 hlist_for_each_entry(gwj, &net->can.cgw_list, list) { 1105 - if (gwj->mod.uid != mod.uid) 1094 + struct cf_mod *old_cf; 1095 + 1096 + old_cf = cgw_job_cf_mod(gwj); 1097 + if (old_cf->uid != mod->uid) 1106 1098 continue; 1107 1099 1108 1100 /* interfaces & filters must be identical */ 1109 - if (memcmp(&gwj->ccgw, &ccgw, sizeof(ccgw))) 1110 - return -EINVAL; 1101 + if (memcmp(&gwj->ccgw, &ccgw, sizeof(ccgw))) { 1102 + err = -EINVAL; 1103 + goto out_free_cf; 1104 + } 1111 1105 1112 - /* update modifications with disabled softirq & quit */ 1113 - local_bh_disable(); 1114 - memcpy(&gwj->mod, &mod, sizeof(mod)); 1115 - local_bh_enable(); 1106 + rcu_assign_pointer(gwj->cf_mod, mod); 1107 + kfree_rcu_mightsleep(old_cf); 1116 1108 return 0; 1117 1109 } 1118 1110 } 1119 1111 1120 1112 /* ifindex == 0 is not allowed for job creation */ 1121 - if (!ccgw.src_idx || !ccgw.dst_idx) 1122 - return -ENODEV; 1113 + if (!ccgw.src_idx || !ccgw.dst_idx) { 1114 + err = -ENODEV; 1115 + goto out_free_cf; 1116 + } 1123 1117 1124 1118 gwj = kmem_cache_alloc(cgw_cache, GFP_KERNEL); 1125 - if (!gwj) 1126 - return -ENOMEM; 1119 + if (!gwj) { 1120 + err = -ENOMEM; 1121 + goto out_free_cf; 1122 + } 1127 1123 1128 1124 gwj->handled_frames = 0; 1129 1125 gwj->dropped_frames = 0; ··· 1144 1118 gwj->limit_hops = limhops; 1145 1119 1146 1120 /* insert already parsed information */ 1147 - memcpy(&gwj->mod, &mod, sizeof(mod)); 1121 + RCU_INIT_POINTER(gwj->cf_mod, mod); 1148 1122 memcpy(&gwj->ccgw, &ccgw, sizeof(ccgw)); 1149 1123 1150 1124 err = -ENODEV; ··· 1178 1152 if (!err) 1179 1153 hlist_add_head_rcu(&gwj->list, &net->can.cgw_list); 1180 1154 out: 1181 - if (err) 1155 + if (err) { 1182 1156 kmem_cache_free(cgw_cache, gwj); 1183 - 1157 + out_free_cf: 1158 + kfree(mod); 1159 + } 1184 1160 return err; 1185 1161 } 1186 1162 ··· 1242 1214 1243 1215 /* remove only the first matching entry */ 1244 1216 hlist_for_each_entry_safe(gwj, nx, &net->can.cgw_list, list) { 1217 + struct cf_mod *cf_mod; 1218 + 1245 1219 if (gwj->flags != r->flags) 1246 1220 continue; 1247 1221 1248 1222 if (gwj->limit_hops != limhops) 1249 1223 continue; 1250 1224 1225 + cf_mod = cgw_job_cf_mod(gwj); 1251 1226 /* we have a match when uid is enabled and identical */ 1252 - if (gwj->mod.uid || mod.uid) { 1253 - if (gwj->mod.uid != mod.uid) 1227 + if (cf_mod->uid || mod.uid) { 1228 + if (cf_mod->uid != mod.uid) 1254 1229 continue; 1255 1230 } else { 1256 1231 /* no uid => check for identical modifications */ 1257 - if (memcmp(&gwj->mod, &mod, sizeof(mod))) 1232 + if (memcmp(cf_mod, &mod, sizeof(mod))) 1258 1233 continue; 1259 1234 } 1260 1235
+4 -14
net/core/dev.c
··· 9248 9248 return 0; 9249 9249 } 9250 9250 9251 - /** 9252 - * dev_set_promiscuity - update promiscuity count on a device 9253 - * @dev: device 9254 - * @inc: modifier 9255 - * 9256 - * Add or remove promiscuity from a device. While the count in the device 9257 - * remains above zero the interface remains promiscuous. Once it hits zero 9258 - * the device reverts back to normal filtering operation. A negative inc 9259 - * value is used to drop promiscuity on the device. 9260 - * Return 0 if successful or a negative errno code on error. 9261 - */ 9262 - int dev_set_promiscuity(struct net_device *dev, int inc) 9251 + int netif_set_promiscuity(struct net_device *dev, int inc) 9263 9252 { 9264 9253 unsigned int old_flags = dev->flags; 9265 9254 int err; ··· 9260 9271 dev_set_rx_mode(dev); 9261 9272 return err; 9262 9273 } 9263 - EXPORT_SYMBOL(dev_set_promiscuity); 9264 9274 9265 9275 int netif_set_allmulti(struct net_device *dev, int inc, bool notify) 9266 9276 { ··· 12008 12020 struct sk_buff *skb = NULL; 12009 12021 12010 12022 /* Shutdown queueing discipline. */ 12023 + netdev_lock_ops(dev); 12011 12024 dev_shutdown(dev); 12012 12025 dev_tcx_uninstall(dev); 12013 - netdev_lock_ops(dev); 12014 12026 dev_xdp_uninstall(dev); 12015 12027 dev_memory_provider_uninstall(dev); 12016 12028 netdev_unlock_ops(dev); ··· 12206 12218 synchronize_net(); 12207 12219 12208 12220 /* Shutdown queueing discipline. */ 12221 + netdev_lock_ops(dev); 12209 12222 dev_shutdown(dev); 12223 + netdev_unlock_ops(dev); 12210 12224 12211 12225 /* Notify protocols, that we are about to destroy 12212 12226 * this device. They should clean all the things.
+23
net/core/dev_api.c
··· 268 268 EXPORT_SYMBOL(dev_disable_lro); 269 269 270 270 /** 271 + * dev_set_promiscuity() - update promiscuity count on a device 272 + * @dev: device 273 + * @inc: modifier 274 + * 275 + * Add or remove promiscuity from a device. While the count in the device 276 + * remains above zero the interface remains promiscuous. Once it hits zero 277 + * the device reverts back to normal filtering operation. A negative inc 278 + * value is used to drop promiscuity on the device. 279 + * Return 0 if successful or a negative errno code on error. 280 + */ 281 + int dev_set_promiscuity(struct net_device *dev, int inc) 282 + { 283 + int ret; 284 + 285 + netdev_lock_ops(dev); 286 + ret = netif_set_promiscuity(dev, inc); 287 + netdev_unlock_ops(dev); 288 + 289 + return ret; 290 + } 291 + EXPORT_SYMBOL(dev_set_promiscuity); 292 + 293 + /** 271 294 * dev_set_allmulti() - update allmulti count on a device 272 295 * @dev: device 273 296 * @inc: modifier
+1
net/core/filter.c
··· 2509 2509 goto out_drop; 2510 2510 skb->dev = dev; 2511 2511 dev_sw_netstats_rx_add(dev, skb->len); 2512 + skb_scrub_packet(skb, false); 2512 2513 return -EAGAIN; 2513 2514 } 2514 2515 return flags & BPF_F_NEIGH ?
+50 -19
net/core/netdev-genl.c
··· 702 702 return 0; 703 703 } 704 704 705 + /** 706 + * netdev_stat_queue_sum() - add up queue stats from range of queues 707 + * @netdev: net_device 708 + * @rx_start: index of the first Rx queue to query 709 + * @rx_end: index after the last Rx queue (first *not* to query) 710 + * @rx_sum: output Rx stats, should be already initialized 711 + * @tx_start: index of the first Tx queue to query 712 + * @tx_end: index after the last Tx queue (first *not* to query) 713 + * @tx_sum: output Tx stats, should be already initialized 714 + * 715 + * Add stats from [start, end) range of queue IDs to *x_sum structs. 716 + * The sum structs must be already initialized. Usually this 717 + * helper is invoked from the .get_base_stats callbacks of drivers 718 + * to account for stats of disabled queues. In that case the ranges 719 + * are usually [netdev->real_num_*x_queues, netdev->num_*x_queues). 720 + */ 721 + void netdev_stat_queue_sum(struct net_device *netdev, 722 + int rx_start, int rx_end, 723 + struct netdev_queue_stats_rx *rx_sum, 724 + int tx_start, int tx_end, 725 + struct netdev_queue_stats_tx *tx_sum) 726 + { 727 + const struct netdev_stat_ops *ops; 728 + struct netdev_queue_stats_rx rx; 729 + struct netdev_queue_stats_tx tx; 730 + int i; 731 + 732 + ops = netdev->stat_ops; 733 + 734 + for (i = rx_start; i < rx_end; i++) { 735 + memset(&rx, 0xff, sizeof(rx)); 736 + if (ops->get_queue_stats_rx) 737 + ops->get_queue_stats_rx(netdev, i, &rx); 738 + netdev_nl_stats_add(rx_sum, &rx, sizeof(rx)); 739 + } 740 + for (i = tx_start; i < tx_end; i++) { 741 + memset(&tx, 0xff, sizeof(tx)); 742 + if (ops->get_queue_stats_tx) 743 + ops->get_queue_stats_tx(netdev, i, &tx); 744 + netdev_nl_stats_add(tx_sum, &tx, sizeof(tx)); 745 + } 746 + } 747 + EXPORT_SYMBOL(netdev_stat_queue_sum); 748 + 705 749 static int 706 750 netdev_nl_stats_by_netdev(struct net_device *netdev, struct sk_buff *rsp, 707 751 const struct genl_info *info) 708 752 { 709 - struct netdev_queue_stats_rx rx_sum, rx; 710 - struct netdev_queue_stats_tx tx_sum, tx; 711 - const struct netdev_stat_ops *ops; 753 + struct netdev_queue_stats_rx rx_sum; 754 + struct netdev_queue_stats_tx tx_sum; 712 755 void *hdr; 713 - int i; 714 756 715 - ops = netdev->stat_ops; 716 757 /* Netdev can't guarantee any complete counters */ 717 - if (!ops->get_base_stats) 758 + if (!netdev->stat_ops->get_base_stats) 718 759 return 0; 719 760 720 761 memset(&rx_sum, 0xff, sizeof(rx_sum)); 721 762 memset(&tx_sum, 0xff, sizeof(tx_sum)); 722 763 723 - ops->get_base_stats(netdev, &rx_sum, &tx_sum); 764 + netdev->stat_ops->get_base_stats(netdev, &rx_sum, &tx_sum); 724 765 725 766 /* The op was there, but nothing reported, don't bother */ 726 767 if (!memchr_inv(&rx_sum, 0xff, sizeof(rx_sum)) && ··· 774 733 if (nla_put_u32(rsp, NETDEV_A_QSTATS_IFINDEX, netdev->ifindex)) 775 734 goto nla_put_failure; 776 735 777 - for (i = 0; i < netdev->real_num_rx_queues; i++) { 778 - memset(&rx, 0xff, sizeof(rx)); 779 - if (ops->get_queue_stats_rx) 780 - ops->get_queue_stats_rx(netdev, i, &rx); 781 - netdev_nl_stats_add(&rx_sum, &rx, sizeof(rx)); 782 - } 783 - for (i = 0; i < netdev->real_num_tx_queues; i++) { 784 - memset(&tx, 0xff, sizeof(tx)); 785 - if (ops->get_queue_stats_tx) 786 - ops->get_queue_stats_tx(netdev, i, &tx); 787 - netdev_nl_stats_add(&tx_sum, &tx, sizeof(tx)); 788 - } 736 + netdev_stat_queue_sum(netdev, 0, netdev->real_num_rx_queues, &rx_sum, 737 + 0, netdev->real_num_tx_queues, &tx_sum); 789 738 790 739 if (netdev_nl_stats_write_rx(rsp, &rx_sum) || 791 740 netdev_nl_stats_write_tx(rsp, &tx_sum))
+9 -6
net/ipv6/addrconf.c
··· 3214 3214 struct in6_addr addr; 3215 3215 struct net_device *dev; 3216 3216 struct net *net = dev_net(idev->dev); 3217 - int scope, plen, offset = 0; 3217 + int scope, plen; 3218 3218 u32 pflags = 0; 3219 3219 3220 3220 ASSERT_RTNL(); 3221 3221 3222 3222 memset(&addr, 0, sizeof(struct in6_addr)); 3223 - /* in case of IP6GRE the dev_addr is an IPv6 and therefore we use only the last 4 bytes */ 3224 - if (idev->dev->addr_len == sizeof(struct in6_addr)) 3225 - offset = sizeof(struct in6_addr) - 4; 3226 - memcpy(&addr.s6_addr32[3], idev->dev->dev_addr + offset, 4); 3223 + memcpy(&addr.s6_addr32[3], idev->dev->dev_addr, 4); 3227 3224 3228 3225 if (!(idev->dev->flags & IFF_POINTOPOINT) && idev->dev->type == ARPHRD_SIT) { 3229 3226 scope = IPV6_ADDR_COMPATv4; ··· 3531 3534 return; 3532 3535 } 3533 3536 3534 - if (dev->type == ARPHRD_ETHER) { 3537 + /* Generate the IPv6 link-local address using addrconf_addr_gen(), 3538 + * unless we have an IPv4 GRE device not bound to an IP address and 3539 + * which is in EUI64 mode (as __ipv6_isatap_ifid() would fail in this 3540 + * case). Such devices fall back to add_v4_addrs() instead. 3541 + */ 3542 + if (!(dev->type == ARPHRD_IPGRE && *(__be32 *)dev->dev_addr == 0 && 3543 + idev->cnf.addr_gen_mode == IN6_ADDR_GEN_MODE_EUI64)) { 3535 3544 addrconf_addr_gen(idev, true); 3536 3545 return; 3537 3546 }
+6 -6
net/mac80211/mlme.c
··· 7675 7675 int hdr_len = offsetofend(struct ieee80211_mgmt, u.action.u.ttlm_res); 7676 7676 int ttlm_max_len = 2 + 1 + sizeof(struct ieee80211_ttlm_elem) + 1 + 7677 7677 2 * 2 * IEEE80211_TTLM_NUM_TIDS; 7678 + u16 status_code; 7678 7679 7679 7680 skb = dev_alloc_skb(local->tx_headroom + hdr_len + ttlm_max_len); 7680 7681 if (!skb) ··· 7698 7697 WARN_ON(1); 7699 7698 fallthrough; 7700 7699 case NEG_TTLM_RES_REJECT: 7701 - mgmt->u.action.u.ttlm_res.status_code = 7702 - WLAN_STATUS_DENIED_TID_TO_LINK_MAPPING; 7700 + status_code = WLAN_STATUS_DENIED_TID_TO_LINK_MAPPING; 7703 7701 break; 7704 7702 case NEG_TTLM_RES_ACCEPT: 7705 - mgmt->u.action.u.ttlm_res.status_code = WLAN_STATUS_SUCCESS; 7703 + status_code = WLAN_STATUS_SUCCESS; 7706 7704 break; 7707 7705 case NEG_TTLM_RES_SUGGEST_PREFERRED: 7708 - mgmt->u.action.u.ttlm_res.status_code = 7709 - WLAN_STATUS_PREF_TID_TO_LINK_MAPPING_SUGGESTED; 7706 + status_code = WLAN_STATUS_PREF_TID_TO_LINK_MAPPING_SUGGESTED; 7710 7707 ieee80211_neg_ttlm_add_suggested_map(skb, neg_ttlm); 7711 7708 break; 7712 7709 } 7713 7710 7711 + mgmt->u.action.u.ttlm_res.status_code = cpu_to_le16(status_code); 7714 7712 ieee80211_tx_skb(sdata, skb); 7715 7713 } 7716 7714 ··· 7875 7875 * This can be better implemented in the future, to handle request 7876 7876 * rejections. 7877 7877 */ 7878 - if (mgmt->u.action.u.ttlm_res.status_code != WLAN_STATUS_SUCCESS) 7878 + if (le16_to_cpu(mgmt->u.action.u.ttlm_res.status_code) != WLAN_STATUS_SUCCESS) 7879 7879 __ieee80211_disconnect(sdata); 7880 7880 } 7881 7881
+1 -1
net/netfilter/ipset/ip_set_hash_gen.h
··· 64 64 #define ahash_sizeof_regions(htable_bits) \ 65 65 (ahash_numof_locks(htable_bits) * sizeof(struct ip_set_region)) 66 66 #define ahash_region(n, htable_bits) \ 67 - ((n) % ahash_numof_locks(htable_bits)) 67 + ((n) / jhash_size(HTABLE_REGION_BITS)) 68 68 #define ahash_bucket_start(h, htable_bits) \ 69 69 ((htable_bits) < HTABLE_REGION_BITS ? 0 \ 70 70 : (h) * jhash_size(HTABLE_REGION_BITS))
+8 -19
net/netfilter/ipvs/ip_vs_xmit.c
··· 119 119 return false; 120 120 } 121 121 122 - /* Get route to daddr, update *saddr, optionally bind route to saddr */ 122 + /* Get route to daddr, optionally bind route to saddr */ 123 123 static struct rtable *do_output_route4(struct net *net, __be32 daddr, 124 - int rt_mode, __be32 *saddr) 124 + int rt_mode, __be32 *ret_saddr) 125 125 { 126 126 struct flowi4 fl4; 127 127 struct rtable *rt; 128 - bool loop = false; 129 128 130 129 memset(&fl4, 0, sizeof(fl4)); 131 130 fl4.daddr = daddr; ··· 134 135 retry: 135 136 rt = ip_route_output_key(net, &fl4); 136 137 if (IS_ERR(rt)) { 137 - /* Invalid saddr ? */ 138 - if (PTR_ERR(rt) == -EINVAL && *saddr && 139 - rt_mode & IP_VS_RT_MODE_CONNECT && !loop) { 140 - *saddr = 0; 141 - flowi4_update_output(&fl4, 0, daddr, 0); 142 - goto retry; 143 - } 144 138 IP_VS_DBG_RL("ip_route_output error, dest: %pI4\n", &daddr); 145 139 return NULL; 146 - } else if (!*saddr && rt_mode & IP_VS_RT_MODE_CONNECT && fl4.saddr) { 140 + } 141 + if (rt_mode & IP_VS_RT_MODE_CONNECT && fl4.saddr) { 147 142 ip_rt_put(rt); 148 - *saddr = fl4.saddr; 149 143 flowi4_update_output(&fl4, 0, daddr, fl4.saddr); 150 - loop = true; 144 + rt_mode = 0; 151 145 goto retry; 152 146 } 153 - *saddr = fl4.saddr; 147 + if (ret_saddr) 148 + *ret_saddr = fl4.saddr; 154 149 return rt; 155 150 } 156 151 ··· 337 344 if (ret_saddr) 338 345 *ret_saddr = dest_dst->dst_saddr.ip; 339 346 } else { 340 - __be32 saddr = htonl(INADDR_ANY); 341 - 342 347 noref = 0; 343 348 344 349 /* For such unconfigured boxes avoid many route lookups 345 350 * for performance reasons because we do not remember saddr 346 351 */ 347 352 rt_mode &= ~IP_VS_RT_MODE_CONNECT; 348 - rt = do_output_route4(net, daddr, rt_mode, &saddr); 353 + rt = do_output_route4(net, daddr, rt_mode, ret_saddr); 349 354 if (!rt) 350 355 goto err_unreach; 351 - if (ret_saddr) 352 - *ret_saddr = saddr; 353 356 } 354 357 355 358 local = (rt->rt_flags & RTCF_LOCAL) ? 1 : 0;
+1 -2
net/openvswitch/actions.c
··· 975 975 upcall.cmd = OVS_PACKET_CMD_ACTION; 976 976 upcall.mru = OVS_CB(skb)->mru; 977 977 978 - for (a = nla_data(attr), rem = nla_len(attr); rem > 0; 979 - a = nla_next(a, &rem)) { 978 + nla_for_each_nested(a, attr, rem) { 980 979 switch (nla_type(a)) { 981 980 case OVS_USERSPACE_ATTR_USERDATA: 982 981 upcall.userdata = a;
+6 -9
net/sched/sch_htb.c
··· 348 348 */ 349 349 static inline void htb_next_rb_node(struct rb_node **n) 350 350 { 351 - *n = rb_next(*n); 351 + if (*n) 352 + *n = rb_next(*n); 352 353 } 353 354 354 355 /** ··· 610 609 */ 611 610 static inline void htb_deactivate(struct htb_sched *q, struct htb_class *cl) 612 611 { 613 - WARN_ON(!cl->prio_activity); 614 - 612 + if (!cl->prio_activity) 613 + return; 615 614 htb_deactivate_prios(q, cl); 616 615 cl->prio_activity = 0; 617 616 } ··· 1486 1485 { 1487 1486 struct htb_class *cl = (struct htb_class *)arg; 1488 1487 1489 - if (!cl->prio_activity) 1490 - return; 1491 1488 htb_deactivate(qdisc_priv(sch), cl); 1492 1489 } 1493 1490 ··· 1739 1740 if (cl->parent) 1740 1741 cl->parent->children--; 1741 1742 1742 - if (cl->prio_activity) 1743 - htb_deactivate(q, cl); 1743 + htb_deactivate(q, cl); 1744 1744 1745 1745 if (cl->cmode != HTB_CAN_SEND) 1746 1746 htb_safe_rb_erase(&cl->pq_node, ··· 1947 1949 /* turn parent into inner node */ 1948 1950 qdisc_purge_queue(parent->leaf.q); 1949 1951 parent_qdisc = parent->leaf.q; 1950 - if (parent->prio_activity) 1951 - htb_deactivate(q, parent); 1952 + htb_deactivate(q, parent); 1952 1953 1953 1954 /* remove from evt list because of level change */ 1954 1955 if (parent->cmode != HTB_CAN_SEND) {
+1 -1
net/wireless/scan.c
··· 2681 2681 /* Required length for first defragmentation */ 2682 2682 buf_len = mle->datalen - 1; 2683 2683 for_each_element(elem, mle->data + mle->datalen, 2684 - ielen - sizeof(*mle) + mle->datalen) { 2684 + ie + ielen - mle->data - mle->datalen) { 2685 2685 if (elem->id != WLAN_EID_FRAGMENT) 2686 2686 break; 2687 2687
+81 -10
sound/pci/hda/patch_realtek.c
··· 441 441 alc_update_coef_idx(codec, 0x67, 0xf000, 0x3000); 442 442 fallthrough; 443 443 case 0x10ec0215: 444 + case 0x10ec0236: 445 + case 0x10ec0245: 446 + case 0x10ec0256: 447 + case 0x10ec0257: 444 448 case 0x10ec0285: 445 449 case 0x10ec0289: 446 450 alc_update_coef_idx(codec, 0x36, 1<<13, 0); ··· 452 448 case 0x10ec0230: 453 449 case 0x10ec0233: 454 450 case 0x10ec0235: 455 - case 0x10ec0236: 456 - case 0x10ec0245: 457 451 case 0x10ec0255: 458 - case 0x10ec0256: 459 452 case 0x19e58326: 460 - case 0x10ec0257: 461 453 case 0x10ec0282: 462 454 case 0x10ec0283: 463 455 case 0x10ec0286: ··· 6742 6742 codec->power_save_node = 0; 6743 6743 } 6744 6744 6745 + /* avoid DAC 0x06 for speaker switch 0x17; it has no volume control */ 6746 + static void alc274_fixup_hp_aio_bind_dacs(struct hda_codec *codec, 6747 + const struct hda_fixup *fix, int action) 6748 + { 6749 + static const hda_nid_t conn[] = { 0x02, 0x03 }; /* exclude 0x06 */ 6750 + /* The speaker is routed to the Node 0x06 by a mistake, thus the 6751 + * speaker's volume can't be adjusted since the node doesn't have 6752 + * Amp-out capability. Assure the speaker and lineout pin to be 6753 + * coupled with DAC NID 0x02. 6754 + */ 6755 + static const hda_nid_t preferred_pairs[] = { 6756 + 0x16, 0x02, 0x17, 0x02, 0x21, 0x03, 0 6757 + }; 6758 + struct alc_spec *spec = codec->spec; 6759 + 6760 + snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6761 + spec->gen.preferred_dacs = preferred_pairs; 6762 + } 6763 + 6745 6764 /* avoid DAC 0x06 for bass speaker 0x17; it has no volume control */ 6746 6765 static void alc289_fixup_asus_ga401(struct hda_codec *codec, 6747 6766 const struct hda_fixup *fix, int action) ··· 6965 6946 switch (action) { 6966 6947 case HDA_FIXUP_ACT_PRE_PROBE: 6967 6948 spec->micmute_led_polarity = 1; 6949 + /* needed for amp of back speakers */ 6950 + spec->gpio_mask |= 0x01; 6951 + spec->gpio_dir |= 0x01; 6952 + snd_hda_apply_pincfgs(codec, pincfgs); 6953 + /* share DAC to have unified volume control */ 6954 + snd_hda_override_conn_list(codec, 0x14, ARRAY_SIZE(conn), conn); 6955 + snd_hda_override_conn_list(codec, 0x17, ARRAY_SIZE(conn), conn); 6956 + break; 6957 + case HDA_FIXUP_ACT_INIT: 6958 + /* need to toggle GPIO to enable the amp of back speakers */ 6959 + alc_update_gpio_data(codec, 0x01, true); 6960 + msleep(100); 6961 + alc_update_gpio_data(codec, 0x01, false); 6962 + break; 6963 + } 6964 + } 6965 + 6966 + /* GPIO1 = amplifier on/off */ 6967 + static void alc285_fixup_hp_spectre_x360_df1(struct hda_codec *codec, 6968 + const struct hda_fixup *fix, 6969 + int action) 6970 + { 6971 + struct alc_spec *spec = codec->spec; 6972 + static const hda_nid_t conn[] = { 0x02 }; 6973 + static const struct hda_pintbl pincfgs[] = { 6974 + { 0x14, 0x90170110 }, /* front/high speakers */ 6975 + { 0x17, 0x90170130 }, /* back/bass speakers */ 6976 + { } 6977 + }; 6978 + 6979 + // enable mute led 6980 + alc285_fixup_hp_mute_led_coefbit(codec, fix, action); 6981 + 6982 + switch (action) { 6983 + case HDA_FIXUP_ACT_PRE_PROBE: 6968 6984 /* needed for amp of back speakers */ 6969 6985 spec->gpio_mask |= 0x01; 6970 6986 spec->gpio_dir |= 0x01; ··· 7815 7761 ALC280_FIXUP_HP_9480M, 7816 7762 ALC245_FIXUP_HP_X360_AMP, 7817 7763 ALC285_FIXUP_HP_SPECTRE_X360_EB1, 7764 + ALC285_FIXUP_HP_SPECTRE_X360_DF1, 7818 7765 ALC285_FIXUP_HP_ENVY_X360, 7819 7766 ALC288_FIXUP_DELL_HEADSET_MODE, 7820 7767 ALC288_FIXUP_DELL1_MIC_NO_PRESENCE, ··· 8025 7970 ALC294_FIXUP_BASS_SPEAKER_15, 8026 7971 ALC283_FIXUP_DELL_HP_RESUME, 8027 7972 ALC294_FIXUP_ASUS_CS35L41_SPI_2, 7973 + ALC274_FIXUP_HP_AIO_BIND_DACS, 8028 7974 }; 8029 7975 8030 7976 /* A special fixup for Lenovo C940 and Yoga Duet 7; ··· 9893 9837 .type = HDA_FIXUP_FUNC, 9894 9838 .v.func = alc285_fixup_hp_spectre_x360_eb1 9895 9839 }, 9840 + [ALC285_FIXUP_HP_SPECTRE_X360_DF1] = { 9841 + .type = HDA_FIXUP_FUNC, 9842 + .v.func = alc285_fixup_hp_spectre_x360_df1 9843 + }, 9896 9844 [ALC285_FIXUP_HP_ENVY_X360] = { 9897 9845 .type = HDA_FIXUP_FUNC, 9898 9846 .v.func = alc285_fixup_hp_envy_x360, ··· 10400 10340 .chained = true, 10401 10341 .chain_id = ALC294_FIXUP_ASUS_HEADSET_MIC, 10402 10342 }, 10343 + [ALC274_FIXUP_HP_AIO_BIND_DACS] = { 10344 + .type = HDA_FIXUP_FUNC, 10345 + .v.func = alc274_fixup_hp_aio_bind_dacs, 10346 + }, 10403 10347 }; 10404 10348 10405 10349 static const struct hda_quirk alc269_fixup_tbl[] = { ··· 10628 10564 SND_PCI_QUIRK(0x103c, 0x86c1, "HP Laptop 15-da3001TU", ALC236_FIXUP_HP_MUTE_LED_COEFBIT2), 10629 10565 SND_PCI_QUIRK(0x103c, 0x86c7, "HP Envy AiO 32", ALC274_FIXUP_HP_ENVY_GPIO), 10630 10566 SND_PCI_QUIRK(0x103c, 0x86e7, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10567 + SND_PCI_QUIRK(0x103c, 0x863e, "HP Spectre x360 15-df1xxx", ALC285_FIXUP_HP_SPECTRE_X360_DF1), 10631 10568 SND_PCI_QUIRK(0x103c, 0x86e8, "HP Spectre x360 15-eb0xxx", ALC285_FIXUP_HP_SPECTRE_X360_EB1), 10632 10569 SND_PCI_QUIRK(0x103c, 0x86f9, "HP Spectre x360 13-aw0xxx", ALC285_FIXUP_HP_SPECTRE_X360_MUTE_LED), 10633 10570 SND_PCI_QUIRK(0x103c, 0x8716, "HP Elite Dragonfly G2 Notebook PC", ALC285_FIXUP_HP_GPIO_AMP_INIT), ··· 10833 10768 SND_PCI_QUIRK(0x103c, 0x8ca7, "HP ZBook Fury", ALC245_FIXUP_CS35L41_SPI_2_HP_GPIO_LED), 10834 10769 SND_PCI_QUIRK(0x103c, 0x8caf, "HP Elite mt645 G8 Mobile Thin Client", ALC236_FIXUP_HP_MUTE_LED_MICMUTE_VREF), 10835 10770 SND_PCI_QUIRK(0x103c, 0x8cbd, "HP Pavilion Aero Laptop 13-bg0xxx", ALC245_FIXUP_HP_X360_MUTE_LEDS), 10836 - SND_PCI_QUIRK(0x103c, 0x8cdd, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2), 10837 - SND_PCI_QUIRK(0x103c, 0x8cde, "HP Spectre", ALC287_FIXUP_CS35L41_I2C_2), 10771 + SND_PCI_QUIRK(0x103c, 0x8cdd, "HP Spectre", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX), 10772 + SND_PCI_QUIRK(0x103c, 0x8cde, "HP OmniBook Ultra Flip Laptop 14t", ALC245_FIXUP_HP_SPECTRE_X360_EU0XXX), 10838 10773 SND_PCI_QUIRK(0x103c, 0x8cdf, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10839 10774 SND_PCI_QUIRK(0x103c, 0x8ce0, "HP SnowWhite", ALC287_FIXUP_CS35L41_I2C_2_HP_GPIO_LED), 10840 10775 SND_PCI_QUIRK(0x103c, 0x8cf5, "HP ZBook Studio 16", ALC245_FIXUP_CS35L41_SPI_4_HP_GPIO_LED), 10841 10776 SND_PCI_QUIRK(0x103c, 0x8d01, "HP ZBook Power 14 G12", ALC285_FIXUP_HP_GPIO_LED), 10777 + SND_PCI_QUIRK(0x103c, 0x8d18, "HP EliteStudio 8 AIO", ALC274_FIXUP_HP_AIO_BIND_DACS), 10842 10778 SND_PCI_QUIRK(0x103c, 0x8d84, "HP EliteBook X G1i", ALC285_FIXUP_HP_GPIO_LED), 10843 10779 SND_PCI_QUIRK(0x103c, 0x8d85, "HP EliteBook 14 G12", ALC285_FIXUP_HP_GPIO_LED), 10844 10780 SND_PCI_QUIRK(0x103c, 0x8d86, "HP Elite X360 14 G12", ALC285_FIXUP_HP_GPIO_LED), ··· 10859 10793 SND_PCI_QUIRK(0x103c, 0x8da1, "HP 16 Clipper OmniBook X", ALC287_FIXUP_CS35L41_I2C_2), 10860 10794 SND_PCI_QUIRK(0x103c, 0x8da7, "HP 14 Enstrom OmniBook X", ALC287_FIXUP_CS35L41_I2C_2), 10861 10795 SND_PCI_QUIRK(0x103c, 0x8da8, "HP 16 Piston OmniBook X", ALC287_FIXUP_CS35L41_I2C_2), 10796 + SND_PCI_QUIRK(0x103c, 0x8dd4, "HP EliteStudio 8 AIO", ALC274_FIXUP_HP_AIO_BIND_DACS), 10862 10797 SND_PCI_QUIRK(0x103c, 0x8de8, "HP Gemtree", ALC245_FIXUP_TAS2781_SPI_2), 10863 10798 SND_PCI_QUIRK(0x103c, 0x8de9, "HP Gemtree", ALC245_FIXUP_TAS2781_SPI_2), 10864 10799 SND_PCI_QUIRK(0x103c, 0x8dec, "HP EliteBook 640 G12", ALC236_FIXUP_HP_GPIO_LED), 10800 + SND_PCI_QUIRK(0x103c, 0x8ded, "HP EliteBook 640 G12", ALC236_FIXUP_HP_GPIO_LED), 10865 10801 SND_PCI_QUIRK(0x103c, 0x8dee, "HP EliteBook 660 G12", ALC236_FIXUP_HP_GPIO_LED), 10802 + SND_PCI_QUIRK(0x103c, 0x8def, "HP EliteBook 660 G12", ALC236_FIXUP_HP_GPIO_LED), 10866 10803 SND_PCI_QUIRK(0x103c, 0x8df0, "HP EliteBook 630 G12", ALC236_FIXUP_HP_GPIO_LED), 10804 + SND_PCI_QUIRK(0x103c, 0x8df1, "HP EliteBook 630 G12", ALC236_FIXUP_HP_GPIO_LED), 10867 10805 SND_PCI_QUIRK(0x103c, 0x8dfc, "HP EliteBook 645 G12", ALC236_FIXUP_HP_GPIO_LED), 10868 10806 SND_PCI_QUIRK(0x103c, 0x8dfe, "HP EliteBook 665 G12", ALC236_FIXUP_HP_GPIO_LED), 10869 10807 SND_PCI_QUIRK(0x103c, 0x8e11, "HP Trekker", ALC287_FIXUP_CS35L41_I2C_2), ··· 10913 10843 SND_PCI_QUIRK(0x1043, 0x12a3, "Asus N7691ZM", ALC269_FIXUP_ASUS_N7601ZM), 10914 10844 SND_PCI_QUIRK(0x1043, 0x12af, "ASUS UX582ZS", ALC245_FIXUP_CS35L41_SPI_2), 10915 10845 SND_PCI_QUIRK(0x1043, 0x12b4, "ASUS B3405CCA / P3405CCA", ALC294_FIXUP_ASUS_CS35L41_SPI_2), 10916 - SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC), 10917 - SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC), 10846 + SND_PCI_QUIRK(0x1043, 0x12e0, "ASUS X541SA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), 10847 + SND_PCI_QUIRK(0x1043, 0x12f0, "ASUS X541UV", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), 10918 10848 SND_PCI_QUIRK(0x1043, 0x1313, "Asus K42JZ", ALC269VB_FIXUP_ASUS_MIC_NO_PRESENCE), 10919 - SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC), 10849 + SND_PCI_QUIRK(0x1043, 0x13b0, "ASUS Z550SA", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), 10920 10850 SND_PCI_QUIRK(0x1043, 0x1427, "Asus Zenbook UX31E", ALC269VB_FIXUP_ASUS_ZENBOOK), 10921 10851 SND_PCI_QUIRK(0x1043, 0x1433, "ASUS GX650PY/PZ/PV/PU/PYV/PZV/PIV/PVV", ALC285_FIXUP_ASUS_I2C_HEADSET_MIC), 10922 10852 SND_PCI_QUIRK(0x1043, 0x1460, "Asus VivoBook 15", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), ··· 10970 10900 SND_PCI_QUIRK(0x1043, 0x1c92, "ASUS ROG Strix G15", ALC285_FIXUP_ASUS_G533Z_PINS), 10971 10901 SND_PCI_QUIRK(0x1043, 0x1c9f, "ASUS G614JU/JV/JI", ALC285_FIXUP_ASUS_HEADSET_MIC), 10972 10902 SND_PCI_QUIRK(0x1043, 0x1caf, "ASUS G634JY/JZ/JI/JG", ALC285_FIXUP_ASUS_SPI_REAR_SPEAKERS), 10973 - SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC), 10903 + SND_PCI_QUIRK(0x1043, 0x1ccd, "ASUS X555UB", ALC256_FIXUP_ASUS_MIC_NO_PRESENCE), 10974 10904 SND_PCI_QUIRK(0x1043, 0x1ccf, "ASUS G814JU/JV/JI", ALC245_FIXUP_CS35L41_SPI_2), 10975 10905 SND_PCI_QUIRK(0x1043, 0x1cdf, "ASUS G814JY/JZ/JG", ALC245_FIXUP_CS35L41_SPI_2), 10976 10906 SND_PCI_QUIRK(0x1043, 0x1cef, "ASUS G834JY/JZ/JI/JG", ALC285_FIXUP_ASUS_HEADSET_MIC), ··· 11564 11494 {.id = ALC295_FIXUP_HP_OMEN, .name = "alc295-hp-omen"}, 11565 11495 {.id = ALC285_FIXUP_HP_SPECTRE_X360, .name = "alc285-hp-spectre-x360"}, 11566 11496 {.id = ALC285_FIXUP_HP_SPECTRE_X360_EB1, .name = "alc285-hp-spectre-x360-eb1"}, 11497 + {.id = ALC285_FIXUP_HP_SPECTRE_X360_DF1, .name = "alc285-hp-spectre-x360-df1"}, 11567 11498 {.id = ALC285_FIXUP_HP_ENVY_X360, .name = "alc285-hp-envy-x360"}, 11568 11499 {.id = ALC287_FIXUP_IDEAPAD_BASS_SPK_AMP, .name = "alc287-ideapad-bass-spk-amp"}, 11569 11500 {.id = ALC287_FIXUP_YOGA9_14IAP7_BASS_SPK_PIN, .name = "alc287-yoga9-bass-spk-pin"},
+1 -1
sound/soc/amd/acp/acp-i2s.c
··· 97 97 struct acp_stream *stream; 98 98 int slot_len, no_of_slots; 99 99 100 - chip = dev_get_platdata(dev); 100 + chip = dev_get_drvdata(dev->parent); 101 101 switch (slot_width) { 102 102 case SLOT_WIDTH_8: 103 103 slot_len = 8;
+1 -1
sound/soc/amd/acp/acp-legacy-common.c
··· 450 450 struct snd_soc_acpi_mach *mach; 451 451 int size, platform; 452 452 453 - if (chip->flag == FLAG_AMD_LEGACY_ONLY_DMIC) { 453 + if (chip->flag == FLAG_AMD_LEGACY_ONLY_DMIC && chip->is_pdm_dev) { 454 454 platform = chip->acp_rev; 455 455 chip->mach_dev = platform_device_register_data(chip->dev, "acp-pdm-mach", 456 456 PLATFORM_DEVID_NONE, &platform,
+1 -1
sound/soc/amd/acp/acp-rembrandt.c
··· 199 199 200 200 static int rmb_pcm_resume(struct device *dev) 201 201 { 202 - struct acp_chip_info *chip = dev_get_platdata(dev); 202 + struct acp_chip_info *chip = dev_get_drvdata(dev->parent); 203 203 struct acp_stream *stream; 204 204 struct snd_pcm_substream *substream; 205 205 snd_pcm_uframes_t buf_in_frames;
+1 -1
sound/soc/amd/acp/acp-renoir.c
··· 146 146 147 147 static int rn_pcm_resume(struct device *dev) 148 148 { 149 - struct acp_chip_info *chip = dev_get_platdata(dev); 149 + struct acp_chip_info *chip = dev_get_drvdata(dev->parent); 150 150 struct acp_stream *stream; 151 151 struct snd_pcm_substream *substream; 152 152 snd_pcm_uframes_t buf_in_frames;
+1 -1
sound/soc/amd/acp/acp63.c
··· 250 250 251 251 static int acp63_pcm_resume(struct device *dev) 252 252 { 253 - struct acp_chip_info *chip = dev_get_platdata(dev); 253 + struct acp_chip_info *chip = dev_get_drvdata(dev->parent); 254 254 struct acp_stream *stream; 255 255 struct snd_pcm_substream *substream; 256 256 snd_pcm_uframes_t buf_in_frames;
+1 -1
sound/soc/amd/acp/acp70.c
··· 182 182 183 183 static int acp70_pcm_resume(struct device *dev) 184 184 { 185 - struct acp_chip_info *chip = dev_get_platdata(dev); 185 + struct acp_chip_info *chip = dev_get_drvdata(dev->parent); 186 186 struct acp_stream *stream; 187 187 struct snd_pcm_substream *substream; 188 188 snd_pcm_uframes_t buf_in_frames;
+3 -2
sound/soc/amd/ps/pci-ps.c
··· 193 193 struct amd_sdw_manager *amd_manager; 194 194 u32 ext_intr_stat, ext_intr_stat1; 195 195 u16 irq_flag = 0; 196 + u16 wake_irq_flag = 0; 196 197 u16 sdw_dma_irq_flag = 0; 197 198 198 199 adata = dev_id; ··· 232 231 } 233 232 234 233 if (adata->acp_rev >= ACP70_PCI_REV) 235 - irq_flag = check_and_handle_acp70_sdw_wake_irq(adata); 234 + wake_irq_flag = check_and_handle_acp70_sdw_wake_irq(adata); 236 235 237 236 if (ext_intr_stat & BIT(PDM_DMA_STAT)) { 238 237 ps_pdm_data = dev_get_drvdata(&adata->pdm_dev->dev); ··· 246 245 if (sdw_dma_irq_flag) 247 246 return IRQ_WAKE_THREAD; 248 247 249 - if (irq_flag) 248 + if (irq_flag | wake_irq_flag) 250 249 return IRQ_HANDLED; 251 250 else 252 251 return IRQ_NONE;
+2 -3
sound/soc/codecs/Kconfig
··· 776 776 tristate 777 777 778 778 config SND_SOC_CS_AMP_LIB_TEST 779 - tristate "KUnit test for Cirrus Logic cs-amp-lib" 780 - depends on KUNIT 779 + tristate "KUnit test for Cirrus Logic cs-amp-lib" if !KUNIT_ALL_TESTS 780 + depends on SND_SOC_CS_AMP_LIB && KUNIT 781 781 default KUNIT_ALL_TESTS 782 - select SND_SOC_CS_AMP_LIB 783 782 help 784 783 This builds KUnit tests for the Cirrus Logic common 785 784 amplifier library.
+7
sound/soc/codecs/cs42l43-jack.c
··· 654 654 655 655 reinit_completion(&priv->type_detect); 656 656 657 + regmap_update_bits(cs42l43->regmap, CS42L43_STEREO_MIC_CLAMP_CTRL, 658 + CS42L43_SMIC_HPAMP_CLAMP_DIS_FRC_VAL_MASK, 659 + CS42L43_SMIC_HPAMP_CLAMP_DIS_FRC_VAL_MASK); 660 + 657 661 cs42l43_start_hs_bias(priv, true); 658 662 regmap_update_bits(cs42l43->regmap, CS42L43_HS2, 659 663 CS42L43_HSDET_MODE_MASK, 0x3 << CS42L43_HSDET_MODE_SHIFT); ··· 668 664 regmap_update_bits(cs42l43->regmap, CS42L43_HS2, 669 665 CS42L43_HSDET_MODE_MASK, 0x2 << CS42L43_HSDET_MODE_SHIFT); 670 666 cs42l43_stop_hs_bias(priv); 667 + 668 + regmap_update_bits(cs42l43->regmap, CS42L43_STEREO_MIC_CLAMP_CTRL, 669 + CS42L43_SMIC_HPAMP_CLAMP_DIS_FRC_VAL_MASK, 0); 671 670 672 671 if (!time_left) 673 672 return -ETIMEDOUT;
+1 -1
sound/soc/fsl/imx-card.c
··· 544 544 if (!card->dai_link) 545 545 return -ENOMEM; 546 546 547 - data->link_data = devm_kcalloc(dev, num_links, sizeof(*link), GFP_KERNEL); 547 + data->link_data = devm_kcalloc(dev, num_links, sizeof(*link_data), GFP_KERNEL); 548 548 if (!data->link_data) 549 549 return -ENOMEM; 550 550
+2 -2
sound/soc/generic/simple-card-utils.c
··· 1174 1174 bool is_playback_only = of_property_read_bool(np, "playback-only"); 1175 1175 bool is_capture_only = of_property_read_bool(np, "capture-only"); 1176 1176 1177 - if (is_playback_only) 1177 + if (playback_only) 1178 1178 *playback_only = is_playback_only; 1179 - if (is_capture_only) 1179 + if (capture_only) 1180 1180 *capture_only = is_capture_only; 1181 1181 } 1182 1182 EXPORT_SYMBOL_GPL(graph_util_parse_link_direction);
+13
sound/soc/intel/boards/bytcr_rt5640.c
··· 576 576 BYT_RT5640_SSP0_AIF2 | 577 577 BYT_RT5640_MCLK_EN), 578 578 }, 579 + { /* Acer Aspire SW3-013 */ 580 + .matches = { 581 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 582 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire SW3-013"), 583 + }, 584 + .driver_data = (void *)(BYT_RT5640_DMIC1_MAP | 585 + BYT_RT5640_JD_SRC_JD2_IN4N | 586 + BYT_RT5640_OVCD_TH_2000UA | 587 + BYT_RT5640_OVCD_SF_0P75 | 588 + BYT_RT5640_DIFF_MIC | 589 + BYT_RT5640_SSP0_AIF1 | 590 + BYT_RT5640_MCLK_EN), 591 + }, 579 592 { 580 593 .matches = { 581 594 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+1 -1
sound/soc/intel/catpt/dsp.c
··· 156 156 { 157 157 unsigned long old; 158 158 u32 off = sram->start; 159 - u32 b = __ffs(mask); 159 + unsigned long b = __ffs(mask); 160 160 161 161 old = catpt_readl_pci(cdev, VDRTCTL0) & mask; 162 162 dev_dbg(cdev->dev, "SRAMPGE [0x%08lx] 0x%08lx -> 0x%08lx",
+2 -1
sound/soc/intel/common/soc-acpi-intel-ptl-match.c
··· 431 431 .mask = BIT(3), 432 432 .num_adr = ARRAY_SIZE(cs42l43_3_adr), 433 433 .adr_d = cs42l43_3_adr, 434 - } 434 + }, 435 + {} 435 436 }; 436 437 437 438 static const struct snd_soc_acpi_link_adr ptl_rt722_only[] = {
+1 -1
sound/soc/renesas/rz-ssi.c
··· 1244 1244 1245 1245 static const struct dev_pm_ops rz_ssi_pm_ops = { 1246 1246 RUNTIME_PM_OPS(rz_ssi_runtime_suspend, rz_ssi_runtime_resume, NULL) 1247 - SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) 1247 + NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, pm_runtime_force_resume) 1248 1248 }; 1249 1249 1250 1250 static struct platform_driver rz_ssi_driver = {
+4
sound/soc/sdw_utils/soc_sdw_bridge_cs35l56.c
··· 60 60 61 61 /* 4 x 16-bit sample slots and FSYNC=48000, BCLK=3.072 MHz */ 62 62 for_each_rtd_codec_dais(rtd, i, codec_dai) { 63 + ret = asoc_sdw_cs35l56_volume_limit(card, codec_dai->component->name_prefix); 64 + if (ret) 65 + return ret; 66 + 63 67 ret = snd_soc_dai_set_tdm_slot(codec_dai, tx_mask, rx_mask, 4, 16); 64 68 if (ret < 0) 65 69 return ret;
+10
sound/soc/sdw_utils/soc_sdw_cs42l43.c
··· 20 20 #include <sound/soc-dapm.h> 21 21 #include <sound/soc_sdw_utils.h> 22 22 23 + #define CS42L43_SPK_VOLUME_0DB 128 /* 0dB Max */ 24 + 23 25 static const struct snd_soc_dapm_route cs42l43_hs_map[] = { 24 26 { "Headphone", NULL, "cs42l43 AMP3_OUT" }, 25 27 { "Headphone", NULL, "cs42l43 AMP4_OUT" }, ··· 118 116 if (!card->components) 119 117 return -ENOMEM; 120 118 } 119 + 120 + ret = snd_soc_limit_volume(card, "cs42l43 Speaker Digital Volume", 121 + CS42L43_SPK_VOLUME_0DB); 122 + if (ret) 123 + dev_err(card->dev, "cs42l43 speaker volume limit failed: %d\n", ret); 124 + else 125 + dev_info(card->dev, "Setting CS42L43 Speaker volume limit to %d\n", 126 + CS42L43_SPK_VOLUME_0DB); 121 127 122 128 ret = snd_soc_dapm_add_routes(&card->dapm, cs42l43_spk_map, 123 129 ARRAY_SIZE(cs42l43_spk_map));
+24
sound/soc/sdw_utils/soc_sdw_cs_amp.c
··· 16 16 17 17 #define CODEC_NAME_SIZE 8 18 18 #define CS_AMP_CHANNELS_PER_AMP 4 19 + #define CS35L56_SPK_VOLUME_0DB 400 /* 0dB Max */ 20 + 21 + int asoc_sdw_cs35l56_volume_limit(struct snd_soc_card *card, const char *name_prefix) 22 + { 23 + char *volume_ctl_name; 24 + int ret; 25 + 26 + volume_ctl_name = kasprintf(GFP_KERNEL, "%s Speaker Volume", name_prefix); 27 + if (!volume_ctl_name) 28 + return -ENOMEM; 29 + 30 + ret = snd_soc_limit_volume(card, volume_ctl_name, CS35L56_SPK_VOLUME_0DB); 31 + if (ret) 32 + dev_err(card->dev, "%s limit set failed: %d\n", volume_ctl_name, ret); 33 + 34 + kfree(volume_ctl_name); 35 + return ret; 36 + } 37 + EXPORT_SYMBOL_NS(asoc_sdw_cs35l56_volume_limit, "SND_SOC_SDW_UTILS"); 19 38 20 39 int asoc_sdw_cs_spk_rtd_init(struct snd_soc_pcm_runtime *rtd, struct snd_soc_dai *dai) 21 40 { ··· 59 40 60 41 snprintf(widget_name, sizeof(widget_name), "%s SPK", 61 42 codec_dai->component->name_prefix); 43 + 44 + ret = asoc_sdw_cs35l56_volume_limit(card, codec_dai->component->name_prefix); 45 + if (ret) 46 + return ret; 47 + 62 48 ret = snd_soc_dapm_add_routes(&card->dapm, &route, 1); 63 49 if (ret) 64 50 return ret;
+2
sound/soc/sdw_utils/soc_sdw_rt_dmic.c
··· 29 29 mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "rt715-sdca"); 30 30 else 31 31 mic_name = devm_kasprintf(card->dev, GFP_KERNEL, "%s", component->name_prefix); 32 + if (!mic_name) 33 + return -ENOMEM; 32 34 33 35 card->components = devm_kasprintf(card->dev, GFP_KERNEL, 34 36 "%s mic:%s", card->components,
+4 -1
sound/soc/soc-pcm.c
··· 1584 1584 /* 1585 1585 * Filter for systems with 'component_chaining' enabled. 1586 1586 * This helps to avoid unnecessary re-configuration of an 1587 - * already active BE on such systems. 1587 + * already active BE on such systems and ensures the BE DAI 1588 + * widget is powered ON after hw_params() BE DAI callback. 1588 1589 */ 1589 1590 if (fe->card->component_chaining && 1590 1591 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_NEW) && 1592 + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN) && 1593 + (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_PARAMS) && 1591 1594 (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) 1592 1595 continue; 1593 1596
+11 -5
sound/soc/stm/stm32_sai_sub.c
··· 409 409 unsigned int rate) 410 410 { 411 411 struct platform_device *pdev = sai->pdev; 412 - unsigned int sai_ck_rate, sai_ck_max_rate, sai_curr_rate, sai_new_rate; 412 + unsigned int sai_ck_rate, sai_ck_max_rate, sai_ck_min_rate, sai_curr_rate, sai_new_rate; 413 413 int div, ret; 414 414 415 415 /* 416 - * Set maximum expected kernel clock frequency 416 + * Set minimum and maximum expected kernel clock frequency 417 417 * - mclk on or spdif: 418 418 * f_sai_ck = MCKDIV * mclk-fs * fs 419 419 * Here typical 256 ratio is assumed for mclk-fs ··· 423 423 * Set constraint MCKDIV * FRL <= 256, to ensure MCKDIV is in available range 424 424 * f_sai_ck = sai_ck_max_rate * pow_of_two(FRL) / 256 425 425 */ 426 + sai_ck_min_rate = rate * 256; 426 427 if (!(rate % SAI_RATE_11K)) 427 428 sai_ck_max_rate = SAI_MAX_SAMPLE_RATE_11K * 256; 428 429 else 429 430 sai_ck_max_rate = SAI_MAX_SAMPLE_RATE_8K * 256; 430 431 431 - if (!sai->sai_mclk && !STM_SAI_PROTOCOL_IS_SPDIF(sai)) 432 + if (!sai->sai_mclk && !STM_SAI_PROTOCOL_IS_SPDIF(sai)) { 433 + sai_ck_min_rate = rate * sai->fs_length; 432 434 sai_ck_max_rate /= DIV_ROUND_CLOSEST(256, roundup_pow_of_two(sai->fs_length)); 435 + } 433 436 434 437 /* 435 438 * Request exclusivity, as the clock is shared by SAI sub-blocks and by ··· 447 444 * return immediately. 448 445 */ 449 446 sai_curr_rate = clk_get_rate(sai->sai_ck); 450 - if (stm32_sai_rate_accurate(sai_ck_max_rate, sai_curr_rate)) 447 + dev_dbg(&pdev->dev, "kernel clock rate: min [%u], max [%u], current [%u]", 448 + sai_ck_min_rate, sai_ck_max_rate, sai_curr_rate); 449 + if (stm32_sai_rate_accurate(sai_ck_max_rate, sai_curr_rate) && 450 + sai_curr_rate >= sai_ck_min_rate) 451 451 return 0; 452 452 453 453 /* ··· 478 472 /* Try a lower frequency */ 479 473 div++; 480 474 sai_ck_rate = sai_ck_max_rate / div; 481 - } while (sai_ck_rate > rate); 475 + } while (sai_ck_rate >= sai_ck_min_rate); 482 476 483 477 /* No accurate rate found */ 484 478 dev_err(&pdev->dev, "Failed to find an accurate rate");
+7
sound/usb/endpoint.c
··· 926 926 { 927 927 int altset = set ? ep->altsetting : 0; 928 928 int err; 929 + int retries = 0; 930 + const int max_retries = 5; 929 931 930 932 if (ep->iface_ref->altset == altset) 931 933 return 0; ··· 937 935 938 936 usb_audio_dbg(chip, "Setting usb interface %d:%d for EP 0x%x\n", 939 937 ep->iface, altset, ep->ep_num); 938 + retry: 940 939 err = usb_set_interface(chip->dev, ep->iface, altset); 941 940 if (err < 0) { 941 + if (err == -EPROTO && ++retries <= max_retries) { 942 + msleep(5 * (1 << (retries - 1))); 943 + goto retry; 944 + } 942 945 usb_audio_err_ratelimited( 943 946 chip, "%d:%d: usb_set_interface failed (%d)\n", 944 947 ep->iface, altset, err);
+2 -1
sound/usb/format.c
··· 260 260 } 261 261 262 262 /* Jabra Evolve 65 headset */ 263 - if (chip->usb_id == USB_ID(0x0b0e, 0x030b)) { 263 + if (chip->usb_id == USB_ID(0x0b0e, 0x030b) || 264 + chip->usb_id == USB_ID(0x0b0e, 0x030c)) { 264 265 /* only 48kHz for playback while keeping 16kHz for capture */ 265 266 if (fp->nr_rates != 1) 266 267 return set_fixed_rate(fp, 48000, SNDRV_PCM_RATE_48000);
+12 -4
sound/usb/midi.c
··· 1885 1885 } 1886 1886 1887 1887 port_info = find_port_info(umidi, number); 1888 - name_format = port_info ? port_info->name : 1889 - (jack_name != default_jack_name ? "%s %s" : "%s %s %d"); 1890 - snprintf(substream->name, sizeof(substream->name), 1891 - name_format, umidi->card->shortname, jack_name, number + 1); 1888 + if (port_info || jack_name == default_jack_name || 1889 + strncmp(umidi->card->shortname, jack_name, strlen(umidi->card->shortname)) != 0) { 1890 + name_format = port_info ? port_info->name : 1891 + (jack_name != default_jack_name ? "%s %s" : "%s %s %d"); 1892 + snprintf(substream->name, sizeof(substream->name), 1893 + name_format, umidi->card->shortname, jack_name, number + 1); 1894 + } else { 1895 + /* The manufacturer included the iProduct name in the jack 1896 + * name, do not use both 1897 + */ 1898 + strscpy(substream->name, jack_name); 1899 + } 1892 1900 1893 1901 *rsubstream = substream; 1894 1902 }
+3
tools/include/uapi/linux/bpf.h
··· 4968 4968 * the netns switch takes place from ingress to ingress without 4969 4969 * going through the CPU's backlog queue. 4970 4970 * 4971 + * *skb*\ **->mark** and *skb*\ **->tstamp** are not cleared during 4972 + * the netns switch. 4973 + * 4971 4974 * The *flags* argument is reserved and must be 0. The helper is 4972 4975 * currently only supported for tc BPF program types at the 4973 4976 * ingress hook and for veth and netkit target device types. The
+12 -2
tools/lib/perf/Makefile
··· 42 42 TEST_ARGS := $(if $(V),-v) 43 43 44 44 INCLUDES = \ 45 + -I$(OUTPUT)arch/$(SRCARCH)/include/generated/uapi \ 45 46 -I$(srctree)/tools/lib/perf/include \ 46 47 -I$(srctree)/tools/lib/ \ 47 48 -I$(srctree)/tools/include \ ··· 100 99 $(call QUIET_CLEAN, libapi) 101 100 $(Q)$(MAKE) -C $(LIB_DIR) O=$(OUTPUT) clean >/dev/null 102 101 103 - $(LIBPERF_IN): FORCE 102 + uapi-asm := $(OUTPUT)arch/$(SRCARCH)/include/generated/uapi/asm 103 + ifeq ($(SRCARCH),arm64) 104 + syscall-y := $(uapi-asm)/unistd_64.h 105 + endif 106 + uapi-asm-generic: 107 + $(if $(syscall-y),\ 108 + $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.asm-headers obj=$(uapi-asm) \ 109 + generic=include/uapi/asm-generic $(syscall-y),) 110 + 111 + $(LIBPERF_IN): uapi-asm-generic FORCE 104 112 $(Q)$(MAKE) $(build)=libperf 105 113 106 114 $(LIBPERF_A): $(LIBPERF_IN) ··· 130 120 clean: $(LIBAPI)-clean 131 121 $(call QUIET_CLEAN, libperf) $(RM) $(LIBPERF_A) \ 132 122 *.o *~ *.a *.so *.so.$(VERSION) *.so.$(LIBPERF_VERSION) .*.d .*.cmd tests/*.o LIBPERF-CFLAGS $(LIBPERF_PC) \ 133 - $(TESTS_STATIC) $(TESTS_SHARED) 123 + $(TESTS_STATIC) $(TESTS_SHARED) $(syscall-y) 134 124 135 125 TESTS_IN = tests-in.o 136 126
+1 -1
tools/net/ynl/lib/ynl.c
··· 364 364 "Invalid attribute (binary %s)", policy->name); 365 365 return -1; 366 366 case YNL_PT_NUL_STR: 367 - if ((!policy->len || len <= policy->len) && !data[len - 1]) 367 + if (len && (!policy->len || len <= policy->len) && !data[len - 1]) 368 368 break; 369 369 yerr(yarg->ys, YNL_ERROR_ATTR_INVALID, 370 370 "Invalid attribute (string %s)", policy->name);
+1
tools/perf/Makefile.config
··· 29 29 $(call detected_var,SRCARCH) 30 30 31 31 CFLAGS += -I$(OUTPUT)arch/$(SRCARCH)/include/generated 32 + CFLAGS += -I$(OUTPUT)libperf/arch/$(SRCARCH)/include/generated/uapi 32 33 33 34 # Additional ARCH settings for ppc 34 35 ifeq ($(SRCARCH),powerpc)
+2
tools/testing/kunit/configs/all_tests.config
··· 20 20 21 21 CONFIG_PCI=y 22 22 CONFIG_USB4=y 23 + CONFIG_I2C=y 23 24 24 25 CONFIG_NET=y 25 26 CONFIG_MCTP=y ··· 54 53 CONFIG_SND=y 55 54 CONFIG_SND_SOC=y 56 55 CONFIG_SND_SOC_TOPOLOGY_BUILD=y 56 + CONFIG_SND_SOC_CS35L56_I2C=y
+27 -18
tools/testing/selftests/drivers/net/ping.py
··· 9 9 from lib.py import bkg, cmd, wait_port_listen, rand_port 10 10 from lib.py import defer, ethtool, ip 11 11 12 - remote_ifname="" 13 12 no_sleep=False 14 13 15 14 def _test_v4(cfg) -> None: 16 - cfg.require_ipver("4") 15 + if not cfg.addr_v["4"]: 16 + return 17 17 18 18 cmd("ping -c 1 -W0.5 " + cfg.remote_addr_v["4"]) 19 19 cmd("ping -c 1 -W0.5 " + cfg.addr_v["4"], host=cfg.remote) ··· 21 21 cmd("ping -s 65000 -c 1 -W0.5 " + cfg.addr_v["4"], host=cfg.remote) 22 22 23 23 def _test_v6(cfg) -> None: 24 - cfg.require_ipver("6") 24 + if not cfg.addr_v["6"]: 25 + return 25 26 26 27 cmd("ping -c 1 -W5 " + cfg.remote_addr_v["6"]) 27 28 cmd("ping -c 1 -W5 " + cfg.addr_v["6"], host=cfg.remote) ··· 58 57 59 58 def _set_xdp_generic_sb_on(cfg) -> None: 60 59 prog = cfg.net_lib_dir / "xdp_dummy.bpf.o" 61 - cmd(f"ip link set dev {remote_ifname} mtu 1500", shell=True, host=cfg.remote) 60 + cmd(f"ip link set dev {cfg.remote_ifname} mtu 1500", shell=True, host=cfg.remote) 62 61 cmd(f"ip link set dev {cfg.ifname} mtu 1500 xdpgeneric obj {prog} sec xdp", shell=True) 63 62 defer(cmd, f"ip link set dev {cfg.ifname} xdpgeneric off") 64 63 ··· 67 66 68 67 def _set_xdp_generic_mb_on(cfg) -> None: 69 68 prog = cfg.net_lib_dir / "xdp_dummy.bpf.o" 70 - cmd(f"ip link set dev {remote_ifname} mtu 9000", shell=True, host=cfg.remote) 71 - defer(ip, f"link set dev {remote_ifname} mtu 1500", host=cfg.remote) 69 + cmd(f"ip link set dev {cfg.remote_ifname} mtu 9000", shell=True, host=cfg.remote) 70 + defer(ip, f"link set dev {cfg.remote_ifname} mtu 1500", host=cfg.remote) 72 71 ip("link set dev %s mtu 9000 xdpgeneric obj %s sec xdp.frags" % (cfg.ifname, prog)) 73 72 defer(ip, f"link set dev {cfg.ifname} mtu 1500 xdpgeneric off") 74 73 ··· 77 76 78 77 def _set_xdp_native_sb_on(cfg) -> None: 79 78 prog = cfg.net_lib_dir / "xdp_dummy.bpf.o" 80 - cmd(f"ip link set dev {remote_ifname} mtu 1500", shell=True, host=cfg.remote) 79 + cmd(f"ip link set dev {cfg.remote_ifname} mtu 1500", shell=True, host=cfg.remote) 81 80 cmd(f"ip -j link set dev {cfg.ifname} mtu 1500 xdp obj {prog} sec xdp", shell=True) 82 81 defer(ip, f"link set dev {cfg.ifname} mtu 1500 xdp off") 83 82 xdp_info = ip("-d link show %s" % (cfg.ifname), json=True)[0] ··· 94 93 95 94 def _set_xdp_native_mb_on(cfg) -> None: 96 95 prog = cfg.net_lib_dir / "xdp_dummy.bpf.o" 97 - cmd(f"ip link set dev {remote_ifname} mtu 9000", shell=True, host=cfg.remote) 98 - defer(ip, f"link set dev {remote_ifname} mtu 1500", host=cfg.remote) 96 + cmd(f"ip link set dev {cfg.remote_ifname} mtu 9000", shell=True, host=cfg.remote) 97 + defer(ip, f"link set dev {cfg.remote_ifname} mtu 1500", host=cfg.remote) 99 98 try: 100 99 cmd(f"ip link set dev {cfg.ifname} mtu 9000 xdp obj {prog} sec xdp.frags", shell=True) 101 100 defer(ip, f"link set dev {cfg.ifname} mtu 1500 xdp off") ··· 113 112 except Exception as e: 114 113 raise KsftSkipEx('device does not support offloaded XDP') 115 114 defer(ip, f"link set dev {cfg.ifname} xdpoffload off") 116 - cmd(f"ip link set dev {remote_ifname} mtu 1500", shell=True, host=cfg.remote) 115 + cmd(f"ip link set dev {cfg.remote_ifname} mtu 1500", shell=True, host=cfg.remote) 117 116 118 117 if no_sleep != True: 119 118 time.sleep(10) 120 119 121 120 def get_interface_info(cfg) -> None: 122 - global remote_ifname 123 121 global no_sleep 124 122 125 - remote_info = cmd(f"ip -4 -o addr show to {cfg.remote_addr_v['4']} | awk '{{print $2}}'", shell=True, host=cfg.remote).stdout 126 - remote_ifname = remote_info.rstrip('\n') 127 - if remote_ifname == "": 123 + if cfg.remote_ifname == "": 128 124 raise KsftFailEx('Can not get remote interface') 129 125 local_info = ip("-d link show %s" % (cfg.ifname), json=True)[0] 130 126 if 'parentbus' in local_info and local_info['parentbus'] == "netdevsim": ··· 134 136 cmd(f"ip link set dev {cfg.ifname} xdp off ", shell=True) 135 137 cmd(f"ip link set dev {cfg.ifname} xdpgeneric off ", shell=True) 136 138 cmd(f"ip link set dev {cfg.ifname} xdpoffload off", shell=True) 137 - cmd(f"ip link set dev {remote_ifname} mtu 1500", shell=True, host=cfg.remote) 139 + cmd(f"ip link set dev {cfg.remote_ifname} mtu 1500", shell=True, host=cfg.remote) 138 140 139 - def test_default(cfg, netnl) -> None: 141 + def test_default_v4(cfg, netnl) -> None: 142 + cfg.require_ipver("4") 143 + 140 144 _set_offload_checksum(cfg, netnl, "off") 141 145 _test_v4(cfg) 142 - _test_v6(cfg) 143 146 _test_tcp(cfg) 144 147 _set_offload_checksum(cfg, netnl, "on") 145 148 _test_v4(cfg) 149 + _test_tcp(cfg) 150 + 151 + def test_default_v6(cfg, netnl) -> None: 152 + cfg.require_ipver("6") 153 + 154 + _set_offload_checksum(cfg, netnl, "off") 155 + _test_v6(cfg) 156 + _test_tcp(cfg) 157 + _set_offload_checksum(cfg, netnl, "on") 146 158 _test_v6(cfg) 147 159 _test_tcp(cfg) 148 160 ··· 210 202 with NetDrvEpEnv(__file__) as cfg: 211 203 get_interface_info(cfg) 212 204 set_interface_init(cfg) 213 - ksft_run([test_default, 205 + ksft_run([test_default_v4, 206 + test_default_v6, 214 207 test_xdp_generic_sb, 215 208 test_xdp_generic_mb, 216 209 test_xdp_native_sb,
+1
tools/testing/selftests/net/Makefile
··· 31 31 TEST_PROGS += ioam6.sh 32 32 TEST_PROGS += gro.sh 33 33 TEST_PROGS += gre_gso.sh 34 + TEST_PROGS += gre_ipv6_lladdr.sh 34 35 TEST_PROGS += cmsg_so_mark.sh 35 36 TEST_PROGS += cmsg_so_priority.sh 36 37 TEST_PROGS += test_so_rcv.sh
+177
tools/testing/selftests/net/gre_ipv6_lladdr.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + 4 + source ./lib.sh 5 + 6 + PAUSE_ON_FAIL="no" 7 + 8 + # The trap function handler 9 + # 10 + exit_cleanup_all() 11 + { 12 + cleanup_all_ns 13 + 14 + exit "${EXIT_STATUS}" 15 + } 16 + 17 + # Add fake IPv4 and IPv6 networks on the loopback device, to be used as 18 + # underlay by future GRE devices. 19 + # 20 + setup_basenet() 21 + { 22 + ip -netns "${NS0}" link set dev lo up 23 + ip -netns "${NS0}" address add dev lo 192.0.2.10/24 24 + ip -netns "${NS0}" address add dev lo 2001:db8::10/64 nodad 25 + } 26 + 27 + # Check if network device has an IPv6 link-local address assigned. 28 + # 29 + # Parameters: 30 + # 31 + # * $1: The network device to test 32 + # * $2: An extra regular expression that should be matched (to verify the 33 + # presence of extra attributes) 34 + # * $3: The expected return code from grep (to allow checking the absence of 35 + # a link-local address) 36 + # * $4: The user visible name for the scenario being tested 37 + # 38 + check_ipv6_ll_addr() 39 + { 40 + local DEV="$1" 41 + local EXTRA_MATCH="$2" 42 + local XRET="$3" 43 + local MSG="$4" 44 + 45 + RET=0 46 + set +e 47 + ip -netns "${NS0}" -6 address show dev "${DEV}" scope link | grep "fe80::" | grep -q "${EXTRA_MATCH}" 48 + check_err_fail "${XRET}" $? "" 49 + log_test "${MSG}" 50 + set -e 51 + } 52 + 53 + # Create a GRE device and verify that it gets an IPv6 link-local address as 54 + # expected. 55 + # 56 + # Parameters: 57 + # 58 + # * $1: The device type (gre, ip6gre, gretap or ip6gretap) 59 + # * $2: The local underlay IP address (can be an IPv4, an IPv6 or "any") 60 + # * $3: The remote underlay IP address (can be an IPv4, an IPv6 or "any") 61 + # * $4: The IPv6 interface identifier generation mode to use for the GRE 62 + # device (eui64, none, stable-privacy or random). 63 + # 64 + test_gre_device() 65 + { 66 + local GRE_TYPE="$1" 67 + local LOCAL_IP="$2" 68 + local REMOTE_IP="$3" 69 + local MODE="$4" 70 + local ADDR_GEN_MODE 71 + local MATCH_REGEXP 72 + local MSG 73 + 74 + ip link add netns "${NS0}" name gretest type "${GRE_TYPE}" local "${LOCAL_IP}" remote "${REMOTE_IP}" 75 + 76 + case "${MODE}" in 77 + "eui64") 78 + ADDR_GEN_MODE=0 79 + MATCH_REGEXP="" 80 + MSG="${GRE_TYPE}, mode: 0 (EUI64), ${LOCAL_IP} -> ${REMOTE_IP}" 81 + XRET=0 82 + ;; 83 + "none") 84 + ADDR_GEN_MODE=1 85 + MATCH_REGEXP="" 86 + MSG="${GRE_TYPE}, mode: 1 (none), ${LOCAL_IP} -> ${REMOTE_IP}" 87 + XRET=1 # No link-local address should be generated 88 + ;; 89 + "stable-privacy") 90 + ADDR_GEN_MODE=2 91 + MATCH_REGEXP="stable-privacy" 92 + MSG="${GRE_TYPE}, mode: 2 (stable privacy), ${LOCAL_IP} -> ${REMOTE_IP}" 93 + XRET=0 94 + # Initialise stable_secret (required for stable-privacy mode) 95 + ip netns exec "${NS0}" sysctl -qw net.ipv6.conf.gretest.stable_secret="2001:db8::abcd" 96 + ;; 97 + "random") 98 + ADDR_GEN_MODE=3 99 + MATCH_REGEXP="stable-privacy" 100 + MSG="${GRE_TYPE}, mode: 3 (random), ${LOCAL_IP} -> ${REMOTE_IP}" 101 + XRET=0 102 + ;; 103 + esac 104 + 105 + # Check that IPv6 link-local address is generated when device goes up 106 + ip netns exec "${NS0}" sysctl -qw net.ipv6.conf.gretest.addr_gen_mode="${ADDR_GEN_MODE}" 107 + ip -netns "${NS0}" link set dev gretest up 108 + check_ipv6_ll_addr gretest "${MATCH_REGEXP}" "${XRET}" "config: ${MSG}" 109 + 110 + # Now disable link-local address generation 111 + ip -netns "${NS0}" link set dev gretest down 112 + ip netns exec "${NS0}" sysctl -qw net.ipv6.conf.gretest.addr_gen_mode=1 113 + ip -netns "${NS0}" link set dev gretest up 114 + 115 + # Check that link-local address generation works when re-enabled while 116 + # the device is already up 117 + ip netns exec "${NS0}" sysctl -qw net.ipv6.conf.gretest.addr_gen_mode="${ADDR_GEN_MODE}" 118 + check_ipv6_ll_addr gretest "${MATCH_REGEXP}" "${XRET}" "update: ${MSG}" 119 + 120 + ip -netns "${NS0}" link del dev gretest 121 + } 122 + 123 + test_gre4() 124 + { 125 + local GRE_TYPE 126 + local MODE 127 + 128 + for GRE_TYPE in "gre" "gretap"; do 129 + printf "\n####\nTesting IPv6 link-local address generation on ${GRE_TYPE} devices\n####\n\n" 130 + 131 + for MODE in "eui64" "none" "stable-privacy" "random"; do 132 + test_gre_device "${GRE_TYPE}" 192.0.2.10 192.0.2.11 "${MODE}" 133 + test_gre_device "${GRE_TYPE}" any 192.0.2.11 "${MODE}" 134 + test_gre_device "${GRE_TYPE}" 192.0.2.10 any "${MODE}" 135 + done 136 + done 137 + } 138 + 139 + test_gre6() 140 + { 141 + local GRE_TYPE 142 + local MODE 143 + 144 + for GRE_TYPE in "ip6gre" "ip6gretap"; do 145 + printf "\n####\nTesting IPv6 link-local address generation on ${GRE_TYPE} devices\n####\n\n" 146 + 147 + for MODE in "eui64" "none" "stable-privacy" "random"; do 148 + test_gre_device "${GRE_TYPE}" 2001:db8::10 2001:db8::11 "${MODE}" 149 + test_gre_device "${GRE_TYPE}" any 2001:db8::11 "${MODE}" 150 + test_gre_device "${GRE_TYPE}" 2001:db8::10 any "${MODE}" 151 + done 152 + done 153 + } 154 + 155 + usage() 156 + { 157 + echo "Usage: $0 [-p]" 158 + exit 1 159 + } 160 + 161 + while getopts :p o 162 + do 163 + case $o in 164 + p) PAUSE_ON_FAIL="yes";; 165 + *) usage;; 166 + esac 167 + done 168 + 169 + setup_ns NS0 170 + 171 + set -e 172 + trap exit_cleanup_all EXIT 173 + 174 + setup_basenet 175 + 176 + test_gre4 177 + test_gre6
+35
tools/testing/selftests/tc-testing/tc-tests/infra/qdiscs.json
··· 538 538 "$TC qdisc del dev $DUMMY handle 1:0 root", 539 539 "$IP addr del 10.10.10.10/24 dev $DUMMY || true" 540 540 ] 541 + }, 542 + { 543 + "id": "62c4", 544 + "name": "Test HTB with FQ_CODEL - basic functionality", 545 + "category": [ 546 + "qdisc", 547 + "htb", 548 + "fq_codel" 549 + ], 550 + "plugins": { 551 + "requires": [ 552 + "nsPlugin", 553 + "scapyPlugin" 554 + ] 555 + }, 556 + "setup": [ 557 + "$TC qdisc add dev $DEV1 root handle 1: htb default 11", 558 + "$TC class add dev $DEV1 parent 1: classid 1:1 htb rate 10kbit", 559 + "$TC class add dev $DEV1 parent 1:1 classid 1:11 htb rate 10kbit prio 0 quantum 1486", 560 + "$TC qdisc add dev $DEV1 parent 1:11 fq_codel quantum 300 noecn", 561 + "sleep 0.5" 562 + ], 563 + "scapy": { 564 + "iface": "$DEV0", 565 + "count": 5, 566 + "packet": "Ether()/IP(dst='10.10.10.1', src='10.10.10.10')/TCP(sport=12345, dport=80)" 567 + }, 568 + "cmdUnderTest": "$TC -s qdisc show dev $DEV1", 569 + "expExitCode": "0", 570 + "verifyCmd": "$TC -s qdisc show dev $DEV1 | grep -A 5 'qdisc fq_codel'", 571 + "matchPattern": "Sent [0-9]+ bytes [0-9]+ pkt", 572 + "matchCount": "1", 573 + "teardown": [ 574 + "$TC qdisc del dev $DEV1 handle 1: root" 575 + ] 541 576 } 542 577 ]
+1
tools/testing/selftests/ublk/Makefile
··· 9 9 TEST_PROGS += test_generic_04.sh 10 10 TEST_PROGS += test_generic_05.sh 11 11 TEST_PROGS += test_generic_06.sh 12 + TEST_PROGS += test_generic_07.sh 12 13 13 14 TEST_PROGS += test_null_01.sh 14 15 TEST_PROGS += test_null_02.sh
+14 -8
tools/testing/selftests/ublk/kublk.c
··· 536 536 if (!(io->flags & UBLKSRV_IO_FREE)) 537 537 return 0; 538 538 539 - /* we issue because we need either fetching or committing */ 539 + /* 540 + * we issue because we need either fetching or committing or 541 + * getting data 542 + */ 540 543 if (!(io->flags & 541 - (UBLKSRV_NEED_FETCH_RQ | UBLKSRV_NEED_COMMIT_RQ_COMP))) 544 + (UBLKSRV_NEED_FETCH_RQ | UBLKSRV_NEED_COMMIT_RQ_COMP | UBLKSRV_NEED_GET_DATA))) 542 545 return 0; 543 546 544 - if (io->flags & UBLKSRV_NEED_COMMIT_RQ_COMP) 547 + if (io->flags & UBLKSRV_NEED_GET_DATA) 548 + cmd_op = UBLK_U_IO_NEED_GET_DATA; 549 + else if (io->flags & UBLKSRV_NEED_COMMIT_RQ_COMP) 545 550 cmd_op = UBLK_U_IO_COMMIT_AND_FETCH_REQ; 546 551 else if (io->flags & UBLKSRV_NEED_FETCH_RQ) 547 552 cmd_op = UBLK_U_IO_FETCH_REQ; ··· 663 658 assert(tag < q->q_depth); 664 659 if (q->tgt_ops->queue_io) 665 660 q->tgt_ops->queue_io(q, tag); 661 + } else if (cqe->res == UBLK_IO_RES_NEED_GET_DATA) { 662 + io->flags |= UBLKSRV_NEED_GET_DATA | UBLKSRV_IO_FREE; 663 + ublk_queue_io_cmd(q, io, tag); 666 664 } else { 667 665 /* 668 666 * COMMIT_REQ will be completed immediately since no fetching ··· 1245 1237 1246 1238 printf("%s %s -t [null|loop|stripe|fault_inject] [-q nr_queues] [-d depth] [-n dev_id]\n", 1247 1239 exe, recovery ? "recover" : "add"); 1248 - printf("\t[--foreground] [--quiet] [-z] [--debug_mask mask] [-r 0|1 ] [-g 0|1]\n"); 1240 + printf("\t[--foreground] [--quiet] [-z] [--debug_mask mask] [-r 0|1 ] [-g]\n"); 1249 1241 printf("\t[-e 0|1 ] [-i 0|1]\n"); 1250 1242 printf("\t[target options] [backfile1] [backfile2] ...\n"); 1251 1243 printf("\tdefault: nr_queues=2(max 32), depth=128(max 1024), dev_id=-1(auto allocation)\n"); ··· 1321 1313 1322 1314 opterr = 0; 1323 1315 optind = 2; 1324 - while ((opt = getopt_long(argc, argv, "t:n:d:q:r:e:i:az", 1316 + while ((opt = getopt_long(argc, argv, "t:n:d:q:r:e:i:gaz", 1325 1317 longopts, &option_idx)) != -1) { 1326 1318 switch (opt) { 1327 1319 case 'a': ··· 1359 1351 ctx.flags |= UBLK_F_USER_RECOVERY | UBLK_F_USER_RECOVERY_REISSUE; 1360 1352 break; 1361 1353 case 'g': 1362 - value = strtol(optarg, NULL, 10); 1363 - if (value) 1364 - ctx.flags |= UBLK_F_NEED_GET_DATA; 1354 + ctx.flags |= UBLK_F_NEED_GET_DATA; 1365 1355 break; 1366 1356 case 0: 1367 1357 if (!strcmp(longopts[option_idx].name, "debug_mask"))
+1
tools/testing/selftests/ublk/kublk.h
··· 115 115 #define UBLKSRV_NEED_FETCH_RQ (1UL << 0) 116 116 #define UBLKSRV_NEED_COMMIT_RQ_COMP (1UL << 1) 117 117 #define UBLKSRV_IO_FREE (1UL << 2) 118 + #define UBLKSRV_NEED_GET_DATA (1UL << 3) 118 119 unsigned short flags; 119 120 unsigned short refs; /* used by target code only */ 120 121
+28
tools/testing/selftests/ublk/test_generic_07.sh
··· 1 + #!/bin/bash 2 + # SPDX-License-Identifier: GPL-2.0 3 + 4 + . "$(cd "$(dirname "$0")" && pwd)"/test_common.sh 5 + 6 + TID="generic_07" 7 + ERR_CODE=0 8 + 9 + if ! _have_program fio; then 10 + exit "$UBLK_SKIP_CODE" 11 + fi 12 + 13 + _prep_test "generic" "test UBLK_F_NEED_GET_DATA" 14 + 15 + _create_backfile 0 256M 16 + dev_id=$(_add_ublk_dev -t loop -q 2 -g "${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 + if [ "$ERR_CODE" -eq 0 ]; then 23 + _mkfs_mount_test /dev/ublkb"${dev_id}" 24 + ERR_CODE=$? 25 + fi 26 + 27 + _cleanup_test "generic" 28 + _show_result $TID $ERR_CODE
+4 -4
tools/testing/selftests/ublk/test_stress_05.sh
··· 47 47 _create_backfile 1 256M 48 48 49 49 for reissue in $(seq 0 1); do 50 - ublk_io_and_remove 8G -t null -q 4 -g 1 -r 1 -i "$reissue" & 51 - ublk_io_and_remove 256M -t loop -q 4 -g 1 -r 1 -i "$reissue" "${UBLK_BACKFILES[0]}" & 50 + ublk_io_and_remove 8G -t null -q 4 -g -r 1 -i "$reissue" & 51 + ublk_io_and_remove 256M -t loop -q 4 -g -r 1 -i "$reissue" "${UBLK_BACKFILES[0]}" & 52 52 wait 53 53 done 54 54 55 55 if _have_feature "ZERO_COPY"; then 56 56 for reissue in $(seq 0 1); do 57 - ublk_io_and_remove 8G -t null -q 4 -g 1 -z -r 1 -i "$reissue" & 58 - ublk_io_and_remove 256M -t loop -q 4 -g 1 -z -r 1 -i "$reissue" "${UBLK_BACKFILES[1]}" & 57 + ublk_io_and_remove 8G -t null -q 4 -g -z -r 1 -i "$reissue" & 58 + ublk_io_and_remove 256M -t loop -q 4 -g -z -r 1 -i "$reissue" "${UBLK_BACKFILES[1]}" & 59 59 wait 60 60 done 61 61 fi