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.

ASoC: stm32: sai: fix device and OF node leaks on

Merge series from Johan Hovold <johan@kernel.org>:

This series fixes device and OF node reference leaks during probe and
a clock prepare imbalance on probe failures.

Included is a related cleanup of an error path.

+2027 -1147
+1
.mailmap
··· 438 438 Krzysztof Kozlowski <krzk@kernel.org> <k.kozlowski.k@gmail.com> 439 439 Krzysztof Kozlowski <krzk@kernel.org> <k.kozlowski@samsung.com> 440 440 Krzysztof Kozlowski <krzk@kernel.org> <krzysztof.kozlowski@canonical.com> 441 + Krzysztof Kozlowski <krzk@kernel.org> <krzysztof.kozlowski@linaro.org> 441 442 Krzysztof Wilczyński <kwilczynski@kernel.org> <krzysztof.wilczynski@linux.com> 442 443 Krzysztof Wilczyński <kwilczynski@kernel.org> <kw@linux.com> 443 444 Kshitiz Godara <quic_kgodara@quicinc.com> <kgodara@codeaurora.org>
+14 -12
Documentation/devicetree/bindings/pinctrl/toshiba,visconti-pinctrl.yaml
··· 50 50 groups: 51 51 description: 52 52 Name of the pin group to use for the functions. 53 - $ref: /schemas/types.yaml#/definitions/string 54 - enum: [i2c0_grp, i2c1_grp, i2c2_grp, i2c3_grp, i2c4_grp, 55 - i2c5_grp, i2c6_grp, i2c7_grp, i2c8_grp, 56 - spi0_grp, spi0_cs0_grp, spi0_cs1_grp, spi0_cs2_grp, 57 - spi1_grp, spi2_grp, spi3_grp, spi4_grp, spi5_grp, spi6_grp, 58 - uart0_grp, uart1_grp, uart2_grp, uart3_grp, 59 - pwm0_gpio4_grp, pwm0_gpio8_grp, pwm0_gpio12_grp, 60 - pwm0_gpio16_grp, pwm1_gpio5_grp, pwm1_gpio9_grp, 61 - pwm1_gpio13_grp, pwm1_gpio17_grp, pwm2_gpio6_grp, 62 - pwm2_gpio10_grp, pwm2_gpio14_grp, pwm2_gpio18_grp, 63 - pwm3_gpio7_grp, pwm3_gpio11_grp, pwm3_gpio15_grp, 64 - pwm3_gpio19_grp, pcmif_out_grp, pcmif_in_grp] 53 + items: 54 + enum: [i2c0_grp, i2c1_grp, i2c2_grp, i2c3_grp, i2c4_grp, 55 + i2c5_grp, i2c6_grp, i2c7_grp, i2c8_grp, 56 + spi0_grp, spi0_cs0_grp, spi0_cs1_grp, spi0_cs2_grp, 57 + spi1_grp, spi2_grp, spi3_grp, spi4_grp, spi5_grp, spi6_grp, 58 + uart0_grp, uart1_grp, uart2_grp, uart3_grp, 59 + pwm0_gpio4_grp, pwm0_gpio8_grp, pwm0_gpio12_grp, 60 + pwm0_gpio16_grp, pwm1_gpio5_grp, pwm1_gpio9_grp, 61 + pwm1_gpio13_grp, pwm1_gpio17_grp, pwm2_gpio6_grp, 62 + pwm2_gpio10_grp, pwm2_gpio14_grp, pwm2_gpio18_grp, 63 + pwm3_gpio7_grp, pwm3_gpio11_grp, pwm3_gpio15_grp, 64 + pwm3_gpio19_grp, pcmif_out_grp, pcmif_in_grp] 65 + minItems: 1 66 + maxItems: 8 65 67 66 68 drive-strength: 67 69 enum: [2, 4, 6, 8, 16, 24, 32]
+1
Documentation/devicetree/bindings/pinctrl/xlnx,versal-pinctrl.yaml
··· 74 74 75 75 '^conf': 76 76 type: object 77 + unevaluatedProperties: false 77 78 description: 78 79 Pinctrl node's client devices use subnodes for pin configurations, 79 80 which in turn use the standard properties below.
+18 -7
Documentation/input/event-codes.rst
··· 400 400 All other axes retain their meaning. A device must not mix 401 401 regular directional axes and accelerometer axes on the same event node. 402 402 403 - INPUT_PROP_HAPTIC_TOUCHPAD 404 - -------------------------- 403 + INPUT_PROP_PRESSUREPAD 404 + ---------------------- 405 405 406 - The INPUT_PROP_HAPTIC_TOUCHPAD property indicates that device: 407 - - supports simple haptic auto and manual triggering 406 + The INPUT_PROP_PRESSUREPAD property indicates that the device provides 407 + simulated haptic feedback (e.g. a vibrator motor situated below the surface) 408 + instead of physical haptic feedback (e.g. a hinge). This property is only set 409 + if the device: 410 + 408 411 - can differentiate between at least 5 fingers 409 412 - uses correct resolution for the X/Y (units and value) 410 - - reports correct force per touch, and correct units for them (newtons or grams) 411 413 - follows the MT protocol type B 412 414 415 + If the simulated haptic feedback is controllable by userspace the device must: 416 + 417 + - support simple haptic auto and manual triggering, and 418 + - report correct force per touch, and correct units for them (newtons or grams), and 419 + - provide the EV_FF FF_HAPTIC force feedback effect. 420 + 413 421 Summing up, such devices follow the MS spec for input devices in 414 - Win8 and Win8.1, and in addition support the Simple haptic controller HID table, 415 - and report correct units for the pressure. 422 + Win8 and Win8.1, and in addition may support the Simple haptic controller HID 423 + table, and report correct units for the pressure. 424 + 425 + Where applicable, this property is set in addition to INPUT_PROP_BUTTONPAD, it 426 + does not replace that property. 416 427 417 428 Guidelines 418 429 ==========
+1
Documentation/wmi/driver-development-guide.rst
··· 54 54 :: 55 55 56 56 static const struct wmi_device_id foo_id_table[] = { 57 + /* Only use uppercase letters! */ 57 58 { "936DA01F-9ABD-4D9D-80C7-02AF85C822A8", NULL }, 58 59 { } 59 60 };
+14 -11
MAINTAINERS
··· 3927 3927 F: include/linux/async_tx.h 3928 3928 3929 3929 AT24 EEPROM DRIVER 3930 - M: Bartosz Golaszewski <brgl@bgdev.pl> 3930 + M: Bartosz Golaszewski <brgl@kernel.org> 3931 3931 L: linux-i2c@vger.kernel.org 3932 3932 S: Maintained 3933 3933 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git ··· 9267 9267 L: bridge@lists.linux.dev 9268 9268 L: netdev@vger.kernel.org 9269 9269 S: Maintained 9270 - W: http://www.linuxfoundation.org/en/Net:Bridge 9271 9270 F: include/linux/if_bridge.h 9272 9271 F: include/uapi/linux/if_bridge.h 9273 9272 F: include/linux/netfilter_bridge/ ··· 10679 10680 10680 10681 GPIO SUBSYSTEM 10681 10682 M: Linus Walleij <linus.walleij@linaro.org> 10682 - M: Bartosz Golaszewski <brgl@bgdev.pl> 10683 + M: Bartosz Golaszewski <brgl@kernel.org> 10683 10684 L: linux-gpio@vger.kernel.org 10684 10685 S: Maintained 10685 10686 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git ··· 10696 10697 K: devm_gpiod_unhinge 10697 10698 10698 10699 GPIO UAPI 10699 - M: Bartosz Golaszewski <brgl@bgdev.pl> 10700 + M: Bartosz Golaszewski <brgl@kernel.org> 10700 10701 R: Kent Gibson <warthog618@gmail.com> 10701 10702 L: linux-gpio@vger.kernel.org 10702 10703 S: Maintained ··· 15310 15311 F: include/linux/mfd/max7360.h 15311 15312 15312 15313 MAXIM MAX77650 PMIC MFD DRIVER 15313 - M: Bartosz Golaszewski <brgl@bgdev.pl> 15314 + M: Bartosz Golaszewski <brgl@kernel.org> 15314 15315 L: linux-kernel@vger.kernel.org 15315 15316 S: Maintained 15316 15317 F: Documentation/devicetree/bindings/*/*max77650.yaml ··· 16206 16207 M: Krzysztof Kozlowski <krzk@kernel.org> 16207 16208 L: linux-kernel@vger.kernel.org 16208 16209 S: Maintained 16209 - B: mailto:krzysztof.kozlowski@linaro.org 16210 + B: mailto:krzk@kernel.org 16210 16211 T: git git://git.kernel.org/pub/scm/linux/kernel/git/krzk/linux-mem-ctrl.git 16211 16212 F: Documentation/devicetree/bindings/memory-controllers/ 16212 16213 F: drivers/memory/ ··· 18781 18782 F: arch/arm/*omap*/*clock* 18782 18783 18783 18784 OMAP DEVICE TREE SUPPORT 18785 + M: Aaro Koskinen <aaro.koskinen@iki.fi> 18786 + M: Andreas Kemnade <andreas@kemnade.info> 18787 + M: Kevin Hilman <khilman@baylibre.com> 18788 + M: Roger Quadros <rogerq@kernel.org> 18784 18789 M: Tony Lindgren <tony@atomide.com> 18785 18790 L: linux-omap@vger.kernel.org 18786 18791 L: devicetree@vger.kernel.org ··· 19904 19901 F: include/linux/pci-p2pdma.h 19905 19902 19906 19903 PCI POWER CONTROL 19907 - M: Bartosz Golaszewski <brgl@bgdev.pl> 19904 + M: Bartosz Golaszewski <brgl@kernel.org> 19908 19905 L: linux-pci@vger.kernel.org 19909 19906 S: Maintained 19910 19907 T: git git://git.kernel.org/pub/scm/linux/kernel/git/pci/pci.git ··· 20501 20498 F: kernel/configs/nopm.config 20502 20499 20503 20500 POWER SEQUENCING 20504 - M: Bartosz Golaszewski <brgl@bgdev.pl> 20501 + M: Bartosz Golaszewski <brgl@kernel.org> 20505 20502 L: linux-pm@vger.kernel.org 20506 20503 S: Maintained 20507 20504 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git ··· 21183 21180 F: drivers/i2c/busses/i2c-qcom-cci.c 21184 21181 21185 21182 QUALCOMM INTERCONNECT BWMON DRIVER 21186 - M: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org> 21183 + M: Krzysztof Kozlowski <krzk@kernel.org> 21187 21184 L: linux-arm-msm@vger.kernel.org 21188 21185 S: Maintained 21189 21186 F: Documentation/devicetree/bindings/interconnect/qcom,msm8998-bwmon.yaml ··· 21304 21301 F: drivers/tee/qcomtee/ 21305 21302 21306 21303 QUALCOMM TRUST ZONE MEMORY ALLOCATOR 21307 - M: Bartosz Golaszewski <bartosz.golaszewski@linaro.org> 21304 + M: Bartosz Golaszewski <brgl@kernel.org> 21308 21305 L: linux-arm-msm@vger.kernel.org 21309 21306 S: Maintained 21310 21307 F: drivers/firmware/qcom/qcom_tzmem.c ··· 25672 25669 F: drivers/crypto/ti/ 25673 25670 25674 25671 TI DAVINCI MACHINE SUPPORT 25675 - M: Bartosz Golaszewski <brgl@bgdev.pl> 25672 + M: Bartosz Golaszewski <brgl@kernel.org> 25676 25673 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 25677 25674 S: Maintained 25678 25675 T: git git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux.git
+1 -1
Makefile
··· 2 2 VERSION = 6 3 3 PATCHLEVEL = 18 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc6 5 + EXTRAVERSION = -rc7 6 6 NAME = Baby Opossum Posse 7 7 8 8 # *DOCUMENTATION*
+14
arch/arm/boot/dts/aspeed/aspeed-bmc-facebook-fuji-data64.dts
··· 1254 1254 max-frequency = <25000000>; 1255 1255 bus-width = <4>; 1256 1256 }; 1257 + 1258 + /* 1259 + * FIXME: rgmii delay is introduced by MAC (configured in u-boot now) 1260 + * instead of PCB on fuji board, so the "phy-mode" should be updated to 1261 + * "rgmii-[tx|rx]id" when the aspeed-mac driver can handle the delay 1262 + * properly. 1263 + */ 1264 + &mac3 { 1265 + status = "okay"; 1266 + phy-mode = "rgmii"; 1267 + phy-handle = <&ethphy3>; 1268 + pinctrl-names = "default"; 1269 + pinctrl-0 = <&pinctrl_rgmii4_default>; 1270 + };
+2 -2
arch/arm/boot/dts/broadcom/bcm47189-luxul-xap-1440.dts
··· 55 55 mdio { 56 56 /delete-node/ switch@1e; 57 57 58 - bcm54210e: ethernet-phy@0 { 59 - reg = <0>; 58 + bcm54210e: ethernet-phy@25 { 59 + reg = <25>; 60 60 }; 61 61 }; 62 62 };
+2 -2
arch/arm/boot/dts/nxp/imx/imx51-zii-rdu1.dts
··· 259 259 pinctrl-0 = <&pinctrl_audmux>; 260 260 status = "okay"; 261 261 262 - ssi2 { 262 + mux-ssi2 { 263 263 fsl,audmux-port = <1>; 264 264 fsl,port-config = < 265 265 (IMX_AUDMUX_V2_PTCR_SYN | ··· 271 271 >; 272 272 }; 273 273 274 - aud3 { 274 + mux-aud3 { 275 275 fsl,audmux-port = <2>; 276 276 fsl,port-config = < 277 277 IMX_AUDMUX_V2_PTCR_SYN
+1 -1
arch/arm/boot/dts/nxp/imx/imx6ull-engicam-microgea-rmm.dts
··· 136 136 interrupt-parent = <&gpio2>; 137 137 interrupts = <8 IRQ_TYPE_EDGE_FALLING>; 138 138 reset-gpios = <&gpio2 14 GPIO_ACTIVE_LOW>; 139 - report-rate-hz = <6>; 139 + report-rate-hz = <60>; 140 140 /* settings valid only for Hycon touchscreen */ 141 141 touchscreen-size-x = <1280>; 142 142 touchscreen-size-y = <800>;
+10
arch/arm64/boot/dts/broadcom/bcm2712-rpi-5-b.dts
··· 18 18 19 19 #include "bcm2712-rpi-5-b-ovl-rp1.dts" 20 20 21 + / { 22 + aliases { 23 + ethernet0 = &rp1_eth; 24 + }; 25 + }; 26 + 21 27 &pcie2 { 22 28 #include "rp1-nexus.dtsi" 23 29 }; 24 30 25 31 &rp1_eth { 32 + assigned-clocks = <&rp1_clocks RP1_CLK_ETH_TSU>, 33 + <&rp1_clocks RP1_CLK_ETH>; 34 + assigned-clock-rates = <50000000>, 35 + <125000000>; 26 36 status = "okay"; 27 37 phy-mode = "rgmii-id"; 28 38 phy-handle = <&phy1>;
-2
arch/arm64/boot/dts/freescale/imx8-ss-img.dtsi
··· 67 67 power-domains = <&pd IMX_SC_R_CSI_0>; 68 68 fsl,channel = <0>; 69 69 fsl,num-irqs = <32>; 70 - status = "disabled"; 71 70 }; 72 71 73 72 gpio0_mipi_csi0: gpio@58222000 { ··· 143 144 power-domains = <&pd IMX_SC_R_CSI_1>; 144 145 fsl,channel = <0>; 145 146 fsl,num-irqs = <32>; 146 - status = "disabled"; 147 147 }; 148 148 149 149 gpio0_mipi_csi1: gpio@58242000 {
+19 -5
arch/arm64/boot/dts/freescale/imx8mp-kontron-bl-osm-s.dts
··· 16 16 ethernet1 = &eqos; 17 17 }; 18 18 19 - extcon_usbc: usbc { 20 - compatible = "linux,extcon-usb-gpio"; 19 + connector { 20 + compatible = "gpio-usb-b-connector", "usb-b-connector"; 21 + id-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; 22 + label = "Type-C"; 21 23 pinctrl-names = "default"; 22 24 pinctrl-0 = <&pinctrl_usb1_id>; 23 - id-gpios = <&gpio1 10 GPIO_ACTIVE_HIGH>; 25 + type = "micro"; 26 + vbus-supply = <&reg_usb1_vbus>; 27 + 28 + port { 29 + usb_dr_connector: endpoint { 30 + remote-endpoint = <&usb3_dwc>; 31 + }; 32 + }; 24 33 }; 25 34 26 35 leds { ··· 253 244 hnp-disable; 254 245 srp-disable; 255 246 dr_mode = "otg"; 256 - extcon = <&extcon_usbc>; 257 247 usb-role-switch; 248 + role-switch-default-mode = "peripheral"; 258 249 status = "okay"; 250 + 251 + port { 252 + usb3_dwc: endpoint { 253 + remote-endpoint = <&usb_dr_connector>; 254 + }; 255 + }; 259 256 }; 260 257 261 258 &usb_dwc3_1 { ··· 288 273 }; 289 274 290 275 &usb3_phy0 { 291 - vbus-supply = <&reg_usb1_vbus>; 292 276 status = "okay"; 293 277 }; 294 278
+2 -1
arch/arm64/boot/dts/freescale/imx95.dtsi
··· 1886 1886 assigned-clock-rates = <3600000000>, <100000000>, <10000000>; 1887 1887 assigned-clock-parents = <0>, <0>, 1888 1888 <&scmi_clk IMX95_CLK_SYSPLL1_PFD1_DIV2>; 1889 - msi-map = <0x0 &its 0x98 0x1>; 1889 + msi-map = <0x0 &its 0x10 0x1>; 1890 1890 power-domains = <&scmi_devpd IMX95_PD_HSIO_TOP>; 1891 1891 status = "disabled"; 1892 1892 }; ··· 1963 1963 assigned-clock-rates = <3600000000>, <100000000>, <10000000>; 1964 1964 assigned-clock-parents = <0>, <0>, 1965 1965 <&scmi_clk IMX95_CLK_SYSPLL1_PFD1_DIV2>; 1966 + msi-map = <0x0 &its 0x98 0x1>; 1966 1967 power-domains = <&scmi_devpd IMX95_PD_HSIO_TOP>; 1967 1968 status = "disabled"; 1968 1969 };
+1
arch/arm64/boot/dts/nvidia/tegra194-p3668.dtsi
··· 42 42 interrupt-parent = <&gpio>; 43 43 interrupts = <TEGRA194_MAIN_GPIO(G, 4) IRQ_TYPE_LEVEL_LOW>; 44 44 #phy-cells = <0>; 45 + wakeup-source; 45 46 }; 46 47 }; 47 48 };
-1
arch/arm64/boot/dts/rockchip/rk3328.dtsi
··· 598 598 pinctrl-2 = <&otp_pin>; 599 599 resets = <&cru SRST_TSADC>; 600 600 reset-names = "tsadc-apb"; 601 - rockchip,grf = <&grf>; 602 601 rockchip,hw-tshut-temp = <100000>; 603 602 #thermal-sensor-cells = <1>; 604 603 status = "disabled";
+1 -1
arch/arm64/boot/dts/rockchip/rk3399-op1.dtsi
··· 3 3 * Copyright (c) 2016-2017 Fuzhou Rockchip Electronics Co., Ltd 4 4 */ 5 5 6 - #include "rk3399.dtsi" 6 + #include "rk3399-base.dtsi" 7 7 8 8 / { 9 9 cluster0_opp: opp-table-0 {
+5 -5
arch/arm64/boot/dts/rockchip/rk3399-puma-haikou-video-demo.dtso
··· 45 45 46 46 cam_dovdd_1v8: regulator-cam-dovdd-1v8 { 47 47 compatible = "regulator-fixed"; 48 - gpio = <&pca9670 3 GPIO_ACTIVE_LOW>; 49 - regulator-max-microvolt = <1800000>; 50 - regulator-min-microvolt = <1800000>; 51 - regulator-name = "cam-dovdd-1v8"; 52 - vin-supply = <&vcc1v8_video>; 48 + gpio = <&pca9670 3 GPIO_ACTIVE_LOW>; 49 + regulator-max-microvolt = <1800000>; 50 + regulator-min-microvolt = <1800000>; 51 + regulator-name = "cam-dovdd-1v8"; 52 + vin-supply = <&vcc1v8_video>; 53 53 }; 54 54 55 55 cam_dvdd_1v2: regulator-cam-dvdd-1v2 {
+3 -3
arch/arm64/boot/dts/rockchip/rk3566-bigtreetech-cb2.dtsi
··· 120 120 compatible = "regulator-fixed"; 121 121 regulator-name = "vcc3v3_pcie"; 122 122 enable-active-high; 123 - gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>; 123 + gpios = <&gpio4 RK_PB1 GPIO_ACTIVE_HIGH>; 124 124 pinctrl-names = "default"; 125 125 pinctrl-0 = <&pcie_drv>; 126 126 regulator-always-on; ··· 187 187 vcc5v0_usb2b: regulator-vcc5v0-usb2b { 188 188 compatible = "regulator-fixed"; 189 189 enable-active-high; 190 - gpio = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>; 190 + gpio = <&gpio4 RK_PC4 GPIO_ACTIVE_HIGH>; 191 191 pinctrl-names = "default"; 192 192 pinctrl-0 = <&vcc5v0_usb2b_en>; 193 193 regulator-name = "vcc5v0_usb2b"; ··· 199 199 vcc5v0_usb2t: regulator-vcc5v0-usb2t { 200 200 compatible = "regulator-fixed"; 201 201 enable-active-high; 202 - gpios = <&gpio0 RK_PD5 GPIO_ACTIVE_HIGH>; 202 + gpios = <&gpio3 RK_PD5 GPIO_ACTIVE_HIGH>; 203 203 pinctrl-names = "default"; 204 204 pinctrl-0 = <&vcc5v0_usb2t_en>; 205 205 regulator-name = "vcc5v0_usb2t";
+1 -1
arch/arm64/boot/dts/rockchip/rk3566-pinetab2.dtsi
··· 789 789 vccio1-supply = <&vccio_acodec>; 790 790 vccio2-supply = <&vcc_1v8>; 791 791 vccio3-supply = <&vccio_sd>; 792 - vccio4-supply = <&vcc_1v8>; 792 + vccio4-supply = <&vcca1v8_pmu>; 793 793 vccio5-supply = <&vcc_1v8>; 794 794 vccio6-supply = <&vcc1v8_dvp>; 795 795 vccio7-supply = <&vcc_3v3>;
+2
arch/arm64/boot/dts/rockchip/rk3568-odroid-m1.dts
··· 482 482 }; 483 483 484 484 &i2s1_8ch { 485 + pinctrl-names = "default"; 486 + pinctrl-0 = <&i2s1m0_sclktx &i2s1m0_lrcktx &i2s1m0_sdi0 &i2s1m0_sdo0>; 485 487 rockchip,trcm-sync-tx-only; 486 488 status = "okay"; 487 489 };
-14
arch/arm64/boot/dts/rockchip/rk3576.dtsi
··· 276 276 opp-microvolt = <900000 900000 950000>; 277 277 clock-latency-ns = <40000>; 278 278 }; 279 - 280 - opp-2208000000 { 281 - opp-hz = /bits/ 64 <2208000000>; 282 - opp-microvolt = <950000 950000 950000>; 283 - clock-latency-ns = <40000>; 284 - }; 285 279 }; 286 280 287 281 cluster1_opp_table: opp-table-cluster1 { ··· 340 346 opp-2208000000 { 341 347 opp-hz = /bits/ 64 <2208000000>; 342 348 opp-microvolt = <925000 925000 950000>; 343 - clock-latency-ns = <40000>; 344 - }; 345 - 346 - opp-2304000000 { 347 - opp-hz = /bits/ 64 <2304000000>; 348 - opp-microvolt = <950000 950000 950000>; 349 349 clock-latency-ns = <40000>; 350 350 }; 351 351 }; ··· 2549 2561 interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>; 2550 2562 pinctrl-names = "default"; 2551 2563 pinctrl-0 = <&i2c9m0_xfer>; 2552 - resets = <&cru SRST_I2C9>, <&cru SRST_P_I2C9>; 2553 - reset-names = "i2c", "apb"; 2554 2564 #address-cells = <1>; 2555 2565 #size-cells = <0>; 2556 2566 status = "disabled";
+1 -1
arch/arm64/boot/dts/rockchip/rk3588-opp.dtsi
··· 115 115 }; 116 116 }; 117 117 118 - gpu_opp_table: opp-table { 118 + gpu_opp_table: opp-table-gpu { 119 119 compatible = "operating-points-v2"; 120 120 121 121 opp-300000000 {
+1 -3
arch/arm64/boot/dts/rockchip/rk3588-tiger.dtsi
··· 382 382 cap-mmc-highspeed; 383 383 mmc-ddr-1_8v; 384 384 mmc-hs200-1_8v; 385 - mmc-hs400-1_8v; 386 - mmc-hs400-enhanced-strobe; 387 385 mmc-pwrseq = <&emmc_pwrseq>; 388 386 no-sdio; 389 387 no-sd; 390 388 non-removable; 391 389 pinctrl-names = "default"; 392 - pinctrl-0 = <&emmc_bus8 &emmc_cmd &emmc_clk &emmc_data_strobe>; 390 + pinctrl-0 = <&emmc_bus8 &emmc_cmd &emmc_clk>; 393 391 vmmc-supply = <&vcc_3v3_s3>; 394 392 vqmmc-supply = <&vcc_1v8_s3>; 395 393 status = "okay";
+1 -1
arch/arm64/boot/dts/rockchip/rk3588j.dtsi
··· 66 66 }; 67 67 }; 68 68 69 - gpu_opp_table: opp-table { 69 + gpu_opp_table: opp-table-gpu { 70 70 compatible = "operating-points-v2"; 71 71 72 72 opp-300000000 {
+2 -2
arch/arm64/boot/dts/rockchip/rk3588s-orangepi-5.dts
··· 14 14 gpios = <&gpio0 RK_PC5 GPIO_ACTIVE_HIGH>; 15 15 regulator-name = "vcc3v3_pcie20"; 16 16 regulator-boot-on; 17 - regulator-min-microvolt = <1800000>; 18 - regulator-max-microvolt = <1800000>; 17 + regulator-min-microvolt = <3300000>; 18 + regulator-max-microvolt = <3300000>; 19 19 startup-delay-us = <50000>; 20 20 vin-supply = <&vcc5v0_sys>; 21 21 };
+1 -1
arch/arm64/configs/defconfig
··· 1341 1341 CONFIG_COMMON_CLK_VC3=y 1342 1342 CONFIG_COMMON_CLK_VC5=y 1343 1343 CONFIG_COMMON_CLK_BD718XX=m 1344 - CONFIG_CLK_RASPBERRYPI=m 1344 + CONFIG_CLK_RASPBERRYPI=y 1345 1345 CONFIG_CLK_IMX8MM=y 1346 1346 CONFIG_CLK_IMX8MN=y 1347 1347 CONFIG_CLK_IMX8MP=y
+2 -2
arch/arm64/include/asm/page.h
··· 33 33 unsigned long vaddr); 34 34 #define vma_alloc_zeroed_movable_folio vma_alloc_zeroed_movable_folio 35 35 36 - void tag_clear_highpage(struct page *to); 37 - #define __HAVE_ARCH_TAG_CLEAR_HIGHPAGE 36 + bool tag_clear_highpages(struct page *to, int numpages); 37 + #define __HAVE_ARCH_TAG_CLEAR_HIGHPAGES 38 38 39 39 #define clear_user_page(page, vaddr, pg) clear_page(page) 40 40 #define copy_user_page(to, from, vaddr, pg) copy_page(to, from)
+1 -1
arch/arm64/kvm/arm.c
··· 624 624 kvm_timer_vcpu_load(vcpu); 625 625 kvm_vgic_load(vcpu); 626 626 kvm_vcpu_load_debug(vcpu); 627 + kvm_vcpu_load_fgt(vcpu); 627 628 if (has_vhe()) 628 629 kvm_vcpu_load_vhe(vcpu); 629 630 kvm_arch_vcpu_load_fp(vcpu); ··· 643 642 vcpu->arch.hcr_el2 |= HCR_TWI; 644 643 645 644 vcpu_set_pauth_traps(vcpu); 646 - kvm_vcpu_load_fgt(vcpu); 647 645 648 646 if (is_protected_kvm_enabled()) { 649 647 kvm_call_hyp_nvhe(__pkvm_vcpu_load,
+5 -1
arch/arm64/kvm/sys_regs.c
··· 5609 5609 5610 5610 guard(mutex)(&kvm->arch.config_lock); 5611 5611 5612 - if (!irqchip_in_kernel(kvm)) { 5612 + /* 5613 + * This hacks into the ID registers, so only perform it when the 5614 + * first vcpu runs, or the kvm_set_vm_id_reg() helper will scream. 5615 + */ 5616 + if (!irqchip_in_kernel(kvm) && !kvm_vm_has_ran_once(kvm)) { 5613 5617 u64 val; 5614 5618 5615 5619 val = kvm_read_vm_id_reg(kvm, SYS_ID_AA64PFR0_EL1) & ~ID_AA64PFR0_EL1_GIC;
+11 -10
arch/arm64/mm/fault.c
··· 967 967 return vma_alloc_folio(flags, 0, vma, vaddr); 968 968 } 969 969 970 - void tag_clear_highpage(struct page *page) 970 + bool tag_clear_highpages(struct page *page, int numpages) 971 971 { 972 972 /* 973 973 * Check if MTE is supported and fall back to clear_highpage(). 974 974 * get_huge_zero_folio() unconditionally passes __GFP_ZEROTAGS and 975 - * post_alloc_hook() will invoke tag_clear_highpage(). 975 + * post_alloc_hook() will invoke tag_clear_highpages(). 976 976 */ 977 - if (!system_supports_mte()) { 978 - clear_highpage(page); 979 - return; 980 - } 977 + if (!system_supports_mte()) 978 + return false; 981 979 982 - /* Newly allocated page, shouldn't have been tagged yet */ 983 - WARN_ON_ONCE(!try_page_mte_tagging(page)); 984 - mte_zero_clear_page_tags(page_address(page)); 985 - set_page_mte_tagged(page); 980 + /* Newly allocated pages, shouldn't have been tagged yet */ 981 + for (int i = 0; i < numpages; i++, page++) { 982 + WARN_ON_ONCE(!try_page_mte_tagging(page)); 983 + mte_zero_clear_page_tags(page_address(page)); 984 + set_page_mte_tagged(page); 985 + } 986 + return true; 986 987 }
+21
arch/loongarch/include/asm/cpu.h
··· 55 55 CPU_LAST 56 56 }; 57 57 58 + static inline char *id_to_core_name(unsigned int id) 59 + { 60 + if ((id & PRID_COMP_MASK) != PRID_COMP_LOONGSON) 61 + return "Unknown"; 62 + 63 + switch (id & PRID_SERIES_MASK) { 64 + case PRID_SERIES_LA132: 65 + return "LA132"; 66 + case PRID_SERIES_LA264: 67 + return "LA264"; 68 + case PRID_SERIES_LA364: 69 + return "LA364"; 70 + case PRID_SERIES_LA464: 71 + return "LA464"; 72 + case PRID_SERIES_LA664: 73 + return "LA664"; 74 + default: 75 + return "Unknown"; 76 + } 77 + } 78 + 58 79 #endif /* !__ASSEMBLER__ */ 59 80 60 81 /*
+18 -22
arch/loongarch/include/uapi/asm/ptrace.h
··· 10 10 11 11 #include <linux/types.h> 12 12 13 - #ifndef __KERNEL__ 14 - #include <stdint.h> 15 - #endif 16 - 17 13 /* 18 14 * For PTRACE_{POKE,PEEK}USR. 0 - 31 are GPRs, 19 15 * 32 is syscall's original ARG0, 33 is PC, 34 is BADVADDR. ··· 37 41 } __attribute__((aligned(8))); 38 42 39 43 struct user_fp_state { 40 - uint64_t fpr[32]; 41 - uint64_t fcc; 42 - uint32_t fcsr; 44 + __u64 fpr[32]; 45 + __u64 fcc; 46 + __u32 fcsr; 43 47 }; 44 48 45 49 struct user_lsx_state { 46 50 /* 32 registers, 128 bits width per register. */ 47 - uint64_t vregs[32*2]; 51 + __u64 vregs[32*2]; 48 52 }; 49 53 50 54 struct user_lasx_state { 51 55 /* 32 registers, 256 bits width per register. */ 52 - uint64_t vregs[32*4]; 56 + __u64 vregs[32*4]; 53 57 }; 54 58 55 59 struct user_lbt_state { 56 - uint64_t scr[4]; 57 - uint32_t eflags; 58 - uint32_t ftop; 60 + __u64 scr[4]; 61 + __u32 eflags; 62 + __u32 ftop; 59 63 }; 60 64 61 65 struct user_watch_state { 62 - uint64_t dbg_info; 66 + __u64 dbg_info; 63 67 struct { 64 - uint64_t addr; 65 - uint64_t mask; 66 - uint32_t ctrl; 67 - uint32_t pad; 68 + __u64 addr; 69 + __u64 mask; 70 + __u32 ctrl; 71 + __u32 pad; 68 72 } dbg_regs[8]; 69 73 }; 70 74 71 75 struct user_watch_state_v2 { 72 - uint64_t dbg_info; 76 + __u64 dbg_info; 73 77 struct { 74 - uint64_t addr; 75 - uint64_t mask; 76 - uint32_t ctrl; 77 - uint32_t pad; 78 + __u64 addr; 79 + __u64 mask; 80 + __u32 ctrl; 81 + __u32 pad; 78 82 } dbg_regs[14]; 79 83 }; 80 84
+11 -23
arch/loongarch/kernel/cpu-probe.c
··· 277 277 uint32_t config; 278 278 uint64_t *vendor = (void *)(&cpu_full_name[VENDOR_OFFSET]); 279 279 uint64_t *cpuname = (void *)(&cpu_full_name[CPUNAME_OFFSET]); 280 - const char *core_name = "Unknown"; 280 + const char *core_name = id_to_core_name(c->processor_id); 281 281 282 282 switch (BIT(fls(c->isa_level) - 1)) { 283 283 case LOONGARCH_CPU_ISA_LA32R: ··· 291 291 break; 292 292 } 293 293 294 - switch (c->processor_id & PRID_SERIES_MASK) { 295 - case PRID_SERIES_LA132: 296 - core_name = "LA132"; 297 - break; 298 - case PRID_SERIES_LA264: 299 - core_name = "LA264"; 300 - break; 301 - case PRID_SERIES_LA364: 302 - core_name = "LA364"; 303 - break; 304 - case PRID_SERIES_LA464: 305 - core_name = "LA464"; 306 - break; 307 - case PRID_SERIES_LA664: 308 - core_name = "LA664"; 309 - break; 310 - } 311 - 312 294 pr_info("%s Processor probed (%s Core)\n", __cpu_family[cpu], core_name); 313 295 314 - if (!cpu_has_iocsr) 296 + if (!cpu_has_iocsr) { 297 + __cpu_full_name[cpu] = "Unknown"; 315 298 return; 316 - 317 - if (!__cpu_full_name[cpu]) 318 - __cpu_full_name[cpu] = cpu_full_name; 299 + } 319 300 320 301 *vendor = iocsr_read64(LOONGARCH_IOCSR_VENDOR); 321 302 *cpuname = iocsr_read64(LOONGARCH_IOCSR_CPUNAME); 303 + 304 + if (!__cpu_full_name[cpu]) { 305 + if (((char *)vendor)[0] == 0) 306 + __cpu_full_name[cpu] = "Unknown"; 307 + else 308 + __cpu_full_name[cpu] = cpu_full_name; 309 + } 322 310 323 311 config = iocsr_read32(LOONGARCH_IOCSR_FEATURES); 324 312 if (config & IOCSRF_CSRIPI)
+2
arch/loongarch/kernel/machine_kexec.c
··· 237 237 #ifdef CONFIG_SMP 238 238 crash_smp_send_stop(); 239 239 #endif 240 + machine_kexec_mask_interrupts(); 240 241 cpumask_set_cpu(crashing_cpu, &cpus_in_crash); 241 242 242 243 pr_info("Starting crashdump kernel...\n"); ··· 275 274 276 275 /* We do not want to be bothered. */ 277 276 local_irq_disable(); 277 + machine_kexec_mask_interrupts(); 278 278 279 279 pr_notice("EFI boot flag: 0x%lx\n", efi_boot); 280 280 pr_notice("Command line addr: 0x%lx\n", cmdline_ptr);
+18 -42
arch/loongarch/kernel/numa.c
··· 158 158 159 159 #ifdef CONFIG_ACPI_NUMA 160 160 161 - /* 162 - * add_numamem_region 163 - * 164 - * Add a uasable memory region described by BIOS. The 165 - * routine gets each intersection between BIOS's region 166 - * and node's region, and adds them into node's memblock 167 - * pool. 168 - * 169 - */ 170 - static void __init add_numamem_region(u64 start, u64 end, u32 type) 171 - { 172 - u32 node = pa_to_nid(start); 173 - u64 size = end - start; 174 - static unsigned long num_physpages; 161 + static unsigned long num_physpages; 175 162 176 - if (start >= end) { 177 - pr_debug("Invalid region: %016llx-%016llx\n", start, end); 178 - return; 179 - } 180 - 181 - num_physpages += (size >> PAGE_SHIFT); 182 - pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx Bytes\n", 183 - node, type, start, size); 184 - pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", 185 - start >> PAGE_SHIFT, end >> PAGE_SHIFT, num_physpages); 186 - memblock_set_node(start, size, &memblock.memory, node); 187 - } 188 - 189 - static void __init init_node_memblock(void) 163 + static void __init info_node_memblock(void) 190 164 { 191 165 u32 mem_type; 192 166 u64 mem_end, mem_start, mem_size; ··· 180 206 case EFI_BOOT_SERVICES_DATA: 181 207 case EFI_PERSISTENT_MEMORY: 182 208 case EFI_CONVENTIONAL_MEMORY: 183 - add_numamem_region(mem_start, mem_end, mem_type); 209 + num_physpages += (mem_size >> PAGE_SHIFT); 210 + pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx Bytes\n", 211 + (u32)pa_to_nid(mem_start), mem_type, mem_start, mem_size); 212 + pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", 213 + mem_start >> PAGE_SHIFT, mem_end >> PAGE_SHIFT, num_physpages); 184 214 break; 185 215 case EFI_PAL_CODE: 186 216 case EFI_UNUSABLE_MEMORY: 187 217 case EFI_ACPI_RECLAIM_MEMORY: 188 - add_numamem_region(mem_start, mem_end, mem_type); 218 + num_physpages += (mem_size >> PAGE_SHIFT); 219 + pr_info("Node%d: mem_type:%d, mem_start:0x%llx, mem_size:0x%llx Bytes\n", 220 + (u32)pa_to_nid(mem_start), mem_type, mem_start, mem_size); 221 + pr_info(" start_pfn:0x%llx, end_pfn:0x%llx, num_physpages:0x%lx\n", 222 + mem_start >> PAGE_SHIFT, mem_end >> PAGE_SHIFT, num_physpages); 189 223 fallthrough; 190 224 case EFI_RESERVED_TYPE: 191 225 case EFI_RUNTIME_SERVICES_CODE: ··· 231 249 for (i = 0; i < NR_CPUS; i++) 232 250 set_cpuid_to_node(i, NUMA_NO_NODE); 233 251 234 - numa_reset_distance(); 235 - nodes_clear(numa_nodes_parsed); 236 - nodes_clear(node_possible_map); 237 - nodes_clear(node_online_map); 238 - WARN_ON(memblock_clear_hotplug(0, PHYS_ADDR_MAX)); 239 - 240 252 /* Parse SRAT and SLIT if provided by firmware. */ 241 - ret = acpi_disabled ? fake_numa_init() : acpi_numa_init(); 253 + if (!acpi_disabled) 254 + ret = numa_memblks_init(acpi_numa_init, false); 255 + else 256 + ret = numa_memblks_init(fake_numa_init, false); 257 + 242 258 if (ret < 0) 243 259 return ret; 244 260 245 - node_possible_map = numa_nodes_parsed; 246 - if (WARN_ON(nodes_empty(node_possible_map))) 247 - return -EINVAL; 248 - 249 - init_node_memblock(); 261 + info_node_memblock(); 250 262 if (!memblock_validate_numa_coverage(SZ_1M)) 251 263 return -EINVAL; 252 264
+2
arch/loongarch/kernel/proc.c
··· 17 17 { 18 18 unsigned long n = (unsigned long) v - 1; 19 19 unsigned int isa = cpu_data[n].isa_level; 20 + unsigned int prid = cpu_data[n].processor_id; 20 21 unsigned int version = cpu_data[n].processor_id & 0xff; 21 22 unsigned int fp_version = cpu_data[n].fpu_vers; 22 23 ··· 38 37 seq_printf(m, "global_id\t\t: %d\n", cpu_data[n].global_id); 39 38 seq_printf(m, "CPU Family\t\t: %s\n", __cpu_family[n]); 40 39 seq_printf(m, "Model Name\t\t: %s\n", __cpu_full_name[n]); 40 + seq_printf(m, "PRID\t\t\t: %s (%08x)\n", id_to_core_name(prid), prid); 41 41 seq_printf(m, "CPU Revision\t\t: 0x%02x\n", version); 42 42 seq_printf(m, "FPU Revision\t\t: 0x%02x\n", fp_version); 43 43 seq_printf(m, "CPU MHz\t\t\t: %llu.%02llu\n",
+3
arch/loongarch/net/bpf_jit.c
··· 1624 1624 /* Direct jump skips 5 NOP instructions */ 1625 1625 else if (is_bpf_text_address((unsigned long)orig_call)) 1626 1626 orig_call += LOONGARCH_BPF_FENTRY_NBYTES; 1627 + /* Module tracing not supported - cause kernel lockups */ 1628 + else if (is_module_text_address((unsigned long)orig_call)) 1629 + return -ENOTSUPP; 1627 1630 1628 1631 if (flags & BPF_TRAMP_F_CALL_ORIG) { 1629 1632 move_addr(ctx, LOONGARCH_GPR_A0, (const u64)im);
+4 -4
arch/loongarch/pci/pci.c
··· 50 50 */ 51 51 lsize = cpu_last_level_cache_line_size(); 52 52 53 - BUG_ON(!lsize); 53 + if (lsize) { 54 + pci_dfl_cache_line_size = lsize >> 2; 54 55 55 - pci_dfl_cache_line_size = lsize >> 2; 56 - 57 - pr_debug("PCI: pci_cache_line_size set to %d bytes\n", lsize); 56 + pr_debug("PCI: pci_cache_line_size set to %d bytes\n", lsize); 57 + } 58 58 59 59 return 0; 60 60 }
+1 -1
arch/mips/boot/dts/econet/en751221.dtsi
··· 18 18 19 19 cpu@0 { 20 20 device_type = "cpu"; 21 - compatible = "mips,mips24KEc"; 21 + compatible = "mips,mips34Kc"; 22 22 reg = <0>; 23 23 }; 24 24 };
+1 -1
arch/mips/kernel/process.c
··· 692 692 /* Space for the VDSO, data page & GIC user page */ 693 693 if (current->thread.abi) { 694 694 top -= PAGE_ALIGN(current->thread.abi->vdso->size); 695 - top -= PAGE_SIZE; 695 + top -= VDSO_NR_PAGES * PAGE_SIZE; 696 696 top -= mips_gic_present() ? PAGE_SIZE : 0; 697 697 698 698 /* Space to randomize the VDSO base */
+64 -38
arch/mips/mm/tlb-r4k.c
··· 15 15 #include <linux/mm.h> 16 16 #include <linux/hugetlb.h> 17 17 #include <linux/export.h> 18 + #include <linux/sort.h> 18 19 19 20 #include <asm/cpu.h> 20 21 #include <asm/cpu-type.h> ··· 509 508 510 509 __setup("ntlb=", set_ntlb); 511 510 512 - /* Initialise all TLB entries with unique values */ 511 + 512 + /* Comparison function for EntryHi VPN fields. */ 513 + static int r4k_vpn_cmp(const void *a, const void *b) 514 + { 515 + long v = *(unsigned long *)a - *(unsigned long *)b; 516 + int s = sizeof(long) > sizeof(int) ? sizeof(long) * 8 - 1: 0; 517 + return s ? (v != 0) | v >> s : v; 518 + } 519 + 520 + /* 521 + * Initialise all TLB entries with unique values that do not clash with 522 + * what we have been handed over and what we'll be using ourselves. 523 + */ 513 524 static void r4k_tlb_uniquify(void) 514 525 { 515 - int entry = num_wired_entries(); 526 + unsigned long tlb_vpns[1 << MIPS_CONF1_TLBS_SIZE]; 527 + int tlbsize = current_cpu_data.tlbsize; 528 + int start = num_wired_entries(); 529 + unsigned long vpn_mask; 530 + int cnt, ent, idx, i; 531 + 532 + vpn_mask = GENMASK(cpu_vmbits - 1, 13); 533 + vpn_mask |= IS_ENABLED(CONFIG_64BIT) ? 3ULL << 62 : 1 << 31; 516 534 517 535 htw_stop(); 536 + 537 + for (i = start, cnt = 0; i < tlbsize; i++, cnt++) { 538 + unsigned long vpn; 539 + 540 + write_c0_index(i); 541 + mtc0_tlbr_hazard(); 542 + tlb_read(); 543 + tlb_read_hazard(); 544 + vpn = read_c0_entryhi(); 545 + vpn &= vpn_mask & PAGE_MASK; 546 + tlb_vpns[cnt] = vpn; 547 + 548 + /* Prevent any large pages from overlapping regular ones. */ 549 + write_c0_pagemask(read_c0_pagemask() & PM_DEFAULT_MASK); 550 + mtc0_tlbw_hazard(); 551 + tlb_write_indexed(); 552 + tlbw_use_hazard(); 553 + } 554 + 555 + sort(tlb_vpns, cnt, sizeof(tlb_vpns[0]), r4k_vpn_cmp, NULL); 556 + 557 + write_c0_pagemask(PM_DEFAULT_MASK); 518 558 write_c0_entrylo0(0); 519 559 write_c0_entrylo1(0); 520 560 521 - while (entry < current_cpu_data.tlbsize) { 522 - unsigned long asid_mask = cpu_asid_mask(&current_cpu_data); 523 - unsigned long asid = 0; 524 - int idx; 561 + idx = 0; 562 + ent = tlbsize; 563 + for (i = start; i < tlbsize; i++) 564 + while (1) { 565 + unsigned long entryhi, vpn; 525 566 526 - /* Skip wired MMID to make ginvt_mmid work */ 527 - if (cpu_has_mmid) 528 - asid = MMID_KERNEL_WIRED + 1; 567 + entryhi = UNIQUE_ENTRYHI(ent); 568 + vpn = entryhi & vpn_mask & PAGE_MASK; 529 569 530 - /* Check for match before using UNIQUE_ENTRYHI */ 531 - do { 532 - if (cpu_has_mmid) { 533 - write_c0_memorymapid(asid); 534 - write_c0_entryhi(UNIQUE_ENTRYHI(entry)); 535 - } else { 536 - write_c0_entryhi(UNIQUE_ENTRYHI(entry) | asid); 537 - } 538 - mtc0_tlbw_hazard(); 539 - tlb_probe(); 540 - tlb_probe_hazard(); 541 - idx = read_c0_index(); 542 - /* No match or match is on current entry */ 543 - if (idx < 0 || idx == entry) 570 + if (idx >= cnt || vpn < tlb_vpns[idx]) { 571 + write_c0_entryhi(entryhi); 572 + write_c0_index(i); 573 + mtc0_tlbw_hazard(); 574 + tlb_write_indexed(); 575 + ent++; 544 576 break; 545 - /* 546 - * If we hit a match, we need to try again with 547 - * a different ASID. 548 - */ 549 - asid++; 550 - } while (asid < asid_mask); 551 - 552 - if (idx >= 0 && idx != entry) 553 - panic("Unable to uniquify TLB entry %d", idx); 554 - 555 - write_c0_index(entry); 556 - mtc0_tlbw_hazard(); 557 - tlb_write_indexed(); 558 - entry++; 559 - } 577 + } else if (vpn == tlb_vpns[idx]) { 578 + ent++; 579 + } else { 580 + idx++; 581 + } 582 + } 560 583 561 584 tlbw_use_hazard(); 562 585 htw_start(); ··· 627 602 628 603 /* From this point on the ARC firmware is dead. */ 629 604 r4k_tlb_uniquify(); 605 + local_flush_tlb_all(); 630 606 631 607 /* Did I tell you that ARC SUCKS? */ 632 608 }
+13 -7
arch/mips/mti-malta/malta-init.c
··· 241 241 #endif 242 242 243 243 /* 244 - * Setup the Malta max (2GB) memory for PCI DMA in host bridge 245 - * in transparent addressing mode. 244 + * Set up memory mapping in host bridge for PCI DMA masters, 245 + * in transparent addressing mode. For EVA use the Malta 246 + * maximum of 2 GiB memory in the alias space at 0x80000000 247 + * as per PHYS_OFFSET. Otherwise use 256 MiB of memory in 248 + * the regular space, avoiding mapping the PCI MMIO window 249 + * for DMA as it seems to confuse the system controller's 250 + * logic, causing PCI MMIO to stop working. 246 251 */ 247 - mask = PHYS_OFFSET | PCI_BASE_ADDRESS_MEM_PREFETCH; 248 - MSC_WRITE(MSC01_PCI_BAR0, mask); 249 - MSC_WRITE(MSC01_PCI_HEAD4, mask); 252 + mask = PHYS_OFFSET ? PHYS_OFFSET : 0xf0000000; 253 + MSC_WRITE(MSC01_PCI_BAR0, 254 + mask | PCI_BASE_ADDRESS_MEM_PREFETCH); 255 + MSC_WRITE(MSC01_PCI_HEAD4, 256 + PHYS_OFFSET | PCI_BASE_ADDRESS_MEM_PREFETCH); 250 257 251 - mask &= MSC01_PCI_BAR0_SIZE_MSK; 252 258 MSC_WRITE(MSC01_PCI_P2SCMSKL, mask); 253 - MSC_WRITE(MSC01_PCI_P2SCMAPL, mask); 259 + MSC_WRITE(MSC01_PCI_P2SCMAPL, PHYS_OFFSET); 254 260 255 261 /* Don't handle target retries indefinitely. */ 256 262 if ((data & MSC01_PCI_CFG_MAXRTRY_MSK) ==
+1 -1
arch/riscv/include/asm/vendorid_list.h
··· 7 7 8 8 #define ANDES_VENDOR_ID 0x31e 9 9 #define MICROCHIP_VENDOR_ID 0x029 10 + #define MIPS_VENDOR_ID 0x127 10 11 #define SIFIVE_VENDOR_ID 0x489 11 12 #define THEAD_VENDOR_ID 0x5b7 12 - #define MIPS_VENDOR_ID 0x722 13 13 14 14 #endif
+5 -1
arch/riscv/kernel/sbi.c
··· 648 648 649 649 void __init sbi_init(void) 650 650 { 651 + bool srst_power_off = false; 651 652 int ret; 652 653 653 - sbi_set_power_off(); 654 654 ret = sbi_get_spec_version(); 655 655 if (ret > 0) 656 656 sbi_spec_version = ret; ··· 683 683 sbi_probe_extension(SBI_EXT_SRST)) { 684 684 pr_info("SBI SRST extension detected\n"); 685 685 register_platform_power_off(sbi_srst_power_off); 686 + srst_power_off = true; 686 687 sbi_srst_reboot_nb.notifier_call = sbi_srst_reboot; 687 688 sbi_srst_reboot_nb.priority = 192; 688 689 register_restart_handler(&sbi_srst_reboot_nb); ··· 703 702 __sbi_send_ipi = __sbi_send_ipi_v01; 704 703 __sbi_rfence = __sbi_rfence_v01; 705 704 } 705 + 706 + if (!srst_power_off) 707 + sbi_set_power_off(); 706 708 }
-2
arch/x86/events/intel/uncore.c
··· 1325 1325 continue; 1326 1326 1327 1327 pmu = &type->pmus[UNCORE_PCI_DEV_IDX(ids->driver_data)]; 1328 - if (!pmu) 1329 - continue; 1330 1328 1331 1329 if (uncore_pci_get_dev_die_info(pci_sub_dev, &die)) 1332 1330 continue;
+8 -1
arch/x86/kvm/svm/svm.c
··· 705 705 706 706 static void svm_recalc_lbr_msr_intercepts(struct kvm_vcpu *vcpu) 707 707 { 708 - bool intercept = !(to_svm(vcpu)->vmcb->control.virt_ext & LBR_CTL_ENABLE_MASK); 708 + struct vcpu_svm *svm = to_svm(vcpu); 709 + bool intercept = !(svm->vmcb->control.virt_ext & LBR_CTL_ENABLE_MASK); 710 + 711 + if (intercept == svm->lbr_msrs_intercepted) 712 + return; 709 713 710 714 svm_set_intercept_for_msr(vcpu, MSR_IA32_LASTBRANCHFROMIP, MSR_TYPE_RW, intercept); 711 715 svm_set_intercept_for_msr(vcpu, MSR_IA32_LASTBRANCHTOIP, MSR_TYPE_RW, intercept); ··· 718 714 719 715 if (sev_es_guest(vcpu->kvm)) 720 716 svm_set_intercept_for_msr(vcpu, MSR_IA32_DEBUGCTLMSR, MSR_TYPE_RW, intercept); 717 + 718 + svm->lbr_msrs_intercepted = intercept; 721 719 } 722 720 723 721 void svm_vcpu_free_msrpm(void *msrpm) ··· 1227 1221 } 1228 1222 1229 1223 svm->x2avic_msrs_intercepted = true; 1224 + svm->lbr_msrs_intercepted = true; 1230 1225 1231 1226 svm->vmcb01.ptr = page_address(vmcb01_page); 1232 1227 svm->vmcb01.pa = __sme_set(page_to_pfn(vmcb01_page) << PAGE_SHIFT);
+1
arch/x86/kvm/svm/svm.h
··· 336 336 bool guest_state_loaded; 337 337 338 338 bool x2avic_msrs_intercepted; 339 + bool lbr_msrs_intercepted; 339 340 340 341 /* Guest GIF value, used when vGIF is not enabled */ 341 342 bool guest_gif;
+1 -1
block/bdev.c
··· 231 231 232 232 EXPORT_SYMBOL(sb_set_blocksize); 233 233 234 - int sb_min_blocksize(struct super_block *sb, int size) 234 + int __must_check sb_min_blocksize(struct super_block *sb, int size) 235 235 { 236 236 int minsize = bdev_logical_block_size(sb->s_bdev); 237 237 if (size < minsize)
+41 -23
drivers/acpi/apei/einj-core.c
··· 182 182 183 183 static void __iomem *einj_param; 184 184 static u32 v5param_size; 185 + static u32 v66param_size; 185 186 static bool is_v2; 186 187 187 188 static void einj_exec_ctx_init(struct apei_exec_context *ctx) ··· 284 283 acpi_os_unmap_iomem(p, sizeof(v)); 285 284 } 286 285 286 + static u32 einjv2_init(struct einjv2_extension_struct *e) 287 + { 288 + if (e->revision != 1) { 289 + pr_info("Unknown v2 extension revision %u\n", e->revision); 290 + return 0; 291 + } 292 + if (e->length < sizeof(*e) || e->length > PAGE_SIZE) { 293 + pr_info(FW_BUG "Bad1 v2 extension length %u\n", e->length); 294 + return 0; 295 + } 296 + if ((e->length - sizeof(*e)) % sizeof(e->component_arr[0])) { 297 + pr_info(FW_BUG "Bad2 v2 extension length %u\n", e->length); 298 + return 0; 299 + } 300 + 301 + return (e->length - sizeof(*e)) / sizeof(e->component_arr[0]); 302 + } 303 + 287 304 static void __iomem *einj_get_parameter_address(void) 288 305 { 289 306 int i; ··· 329 310 v5param_size = sizeof(v5param); 330 311 p = acpi_os_map_iomem(pa_v5, sizeof(*p)); 331 312 if (p) { 332 - int offset, len; 333 - 334 313 memcpy_fromio(&v5param, p, v5param_size); 335 314 acpi5 = 1; 336 315 check_vendor_extension(pa_v5, &v5param); 337 - if (is_v2 && available_error_type & ACPI65_EINJV2_SUPP) { 338 - len = v5param.einjv2_struct.length; 339 - offset = offsetof(struct einjv2_extension_struct, component_arr); 340 - max_nr_components = (len - offset) / 341 - sizeof(v5param.einjv2_struct.component_arr[0]); 342 - /* 343 - * The first call to acpi_os_map_iomem above does not include the 344 - * component array, instead it is used to read and calculate maximum 345 - * number of components supported by the system. Below, the mapping 346 - * is expanded to include the component array. 347 - */ 316 + if (available_error_type & ACPI65_EINJV2_SUPP) { 317 + struct einjv2_extension_struct *e; 318 + 319 + e = &v5param.einjv2_struct; 320 + max_nr_components = einjv2_init(e); 321 + 322 + /* remap including einjv2_extension_struct */ 348 323 acpi_os_unmap_iomem(p, v5param_size); 349 - offset = offsetof(struct set_error_type_with_address, einjv2_struct); 350 - v5param_size = offset + struct_size(&v5param.einjv2_struct, 351 - component_arr, max_nr_components); 352 - p = acpi_os_map_iomem(pa_v5, v5param_size); 324 + v66param_size = v5param_size - sizeof(*e) + e->length; 325 + p = acpi_os_map_iomem(pa_v5, v66param_size); 353 326 } 327 + 354 328 return p; 355 329 } 356 330 } ··· 539 527 u64 param3, u64 param4) 540 528 { 541 529 struct apei_exec_context ctx; 530 + u32 param_size = is_v2 ? v66param_size : v5param_size; 542 531 u64 val, trigger_paddr, timeout = FIRMWARE_TIMEOUT; 543 532 int i, rc; 544 533 ··· 552 539 if (acpi5) { 553 540 struct set_error_type_with_address *v5param; 554 541 555 - v5param = kmalloc(v5param_size, GFP_KERNEL); 542 + v5param = kmalloc(param_size, GFP_KERNEL); 556 543 if (!v5param) 557 544 return -ENOMEM; 558 545 559 - memcpy_fromio(v5param, einj_param, v5param_size); 546 + memcpy_fromio(v5param, einj_param, param_size); 560 547 v5param->type = type; 561 548 if (type & ACPI5_VENDOR_BIT) { 562 549 switch (vendor_flags) { ··· 614 601 break; 615 602 } 616 603 } 617 - memcpy_toio(einj_param, v5param, v5param_size); 604 + memcpy_toio(einj_param, v5param, param_size); 618 605 kfree(v5param); 619 606 } else { 620 607 rc = apei_exec_run(&ctx, ACPI_EINJ_SET_ERROR_TYPE); ··· 1145 1132 struct apei_exec_context ctx; 1146 1133 1147 1134 if (einj_param) { 1148 - acpi_size size = (acpi5) ? 1149 - v5param_size : 1150 - sizeof(struct einj_parameter); 1135 + acpi_size size; 1136 + 1137 + if (v66param_size) 1138 + size = v66param_size; 1139 + else if (acpi5) 1140 + size = v5param_size; 1141 + else 1142 + size = sizeof(struct einj_parameter); 1151 1143 1152 1144 acpi_os_unmap_iomem(einj_param, size); 1153 1145 if (vendor_errors.size)
+10
drivers/ata/libata-core.c
··· 3006 3006 } 3007 3007 3008 3008 dev->n_sectors = ata_id_n_sectors(id); 3009 + if (ata_id_is_locked(id)) { 3010 + /* 3011 + * If Security locked, set capacity to zero to prevent 3012 + * any I/O, e.g. partition scanning, as any I/O to a 3013 + * locked drive will result in user visible errors. 3014 + */ 3015 + ata_dev_info(dev, 3016 + "Security locked, setting capacity to zero\n"); 3017 + dev->n_sectors = 0; 3018 + } 3009 3019 3010 3020 /* get current R/W Multiple count setting */ 3011 3021 if ((dev->id[47] >> 8) == 0x80 && (dev->id[59] & 0x100)) {
+10 -1
drivers/ata/libata-scsi.c
··· 992 992 return; 993 993 } 994 994 995 + if (ata_id_is_locked(dev->id)) { 996 + /* Security locked */ 997 + /* LOGICAL UNIT ACCESS NOT AUTHORIZED */ 998 + ata_scsi_set_sense(dev, cmd, DATA_PROTECT, 0x74, 0x71); 999 + return; 1000 + } 1001 + 995 1002 if (!(qc->flags & ATA_QCFLAG_RTF_FILLED)) { 996 1003 ata_dev_dbg(dev, 997 1004 "Missing result TF: reporting aborted command\n"); ··· 4901 4894 spin_unlock_irqrestore(ap->lock, flags); 4902 4895 if (do_resume) { 4903 4896 ret = scsi_resume_device(sdev); 4904 - if (ret == -EWOULDBLOCK) 4897 + if (ret == -EWOULDBLOCK) { 4898 + scsi_device_put(sdev); 4905 4899 goto unlock_scan; 4900 + } 4906 4901 dev->flags &= ~ATA_DFLAG_RESUMING; 4907 4902 } 4908 4903 ret = scsi_rescan_device(sdev);
+16 -9
drivers/base/power/main.c
··· 888 888 TRACE_DEVICE(dev); 889 889 TRACE_RESUME(0); 890 890 891 - if (dev->power.syscore || dev->power.direct_complete) 891 + if (dev->power.direct_complete) 892 892 goto Out; 893 893 894 894 if (!dev->power.is_late_suspended) 895 895 goto Out; 896 + 897 + if (dev->power.syscore) 898 + goto Skip; 896 899 897 900 if (!dpm_wait_for_superior(dev, async)) 898 901 goto Out; ··· 929 926 930 927 Skip: 931 928 dev->power.is_late_suspended = false; 929 + pm_runtime_enable(dev); 932 930 933 931 Out: 934 932 TRACE_RESUME(error); 935 933 936 - pm_runtime_enable(dev); 937 934 complete_all(&dev->power.completion); 938 935 939 936 if (error) { ··· 1618 1615 TRACE_DEVICE(dev); 1619 1616 TRACE_SUSPEND(0); 1620 1617 1621 - /* 1622 - * Disable runtime PM for the device without checking if there is a 1623 - * pending resume request for it. 1624 - */ 1625 - __pm_runtime_disable(dev, false); 1626 - 1627 1618 dpm_wait_for_subordinate(dev, async); 1628 1619 1629 1620 if (READ_ONCE(async_error)) ··· 1628 1631 goto Complete; 1629 1632 } 1630 1633 1631 - if (dev->power.syscore || dev->power.direct_complete) 1634 + if (dev->power.direct_complete) 1632 1635 goto Complete; 1636 + 1637 + /* 1638 + * Disable runtime PM for the device without checking if there is a 1639 + * pending resume request for it. 1640 + */ 1641 + __pm_runtime_disable(dev, false); 1642 + 1643 + if (dev->power.syscore) 1644 + goto Skip; 1633 1645 1634 1646 if (dev->pm_domain) { 1635 1647 info = "late power domain "; ··· 1670 1664 WRITE_ONCE(async_error, error); 1671 1665 dpm_save_failed_dev(dev_name(dev)); 1672 1666 pm_dev_err(dev, state, async ? " async late" : " late", error); 1667 + pm_runtime_enable(dev); 1673 1668 goto Complete; 1674 1669 } 1675 1670 dpm_propagate_wakeup_to_parent(dev);
+2 -2
drivers/clk/sunxi-ng/ccu-sun55i-a523-r.c
··· 121 121 &r_apb0_clk.common.hw, 0x1cc, BIT(0), 0); 122 122 123 123 static SUNXI_CCU_GATE_HW(bus_r_dma_clk, "bus-r-dma", 124 - &r_apb0_clk.common.hw, 0x1dc, BIT(0), 0); 124 + &r_apb0_clk.common.hw, 0x1dc, BIT(0), CLK_IS_CRITICAL); 125 125 static SUNXI_CCU_GATE_HW(bus_r_rtc_clk, "bus-r-rtc", 126 126 &r_apb0_clk.common.hw, 0x20c, BIT(0), 0); 127 127 static SUNXI_CCU_GATE_HW(bus_r_cpucfg_clk, "bus-r-cpucfg", 128 - &r_apb0_clk.common.hw, 0x22c, BIT(0), 0); 128 + &r_apb0_clk.common.hw, 0x22c, BIT(0), CLK_IS_CRITICAL); 129 129 130 130 static struct ccu_common *sun55i_a523_r_ccu_clks[] = { 131 131 &r_ahb_clk.common,
+1 -1
drivers/clk/sunxi-ng/ccu-sun55i-a523.c
··· 300 300 .m = _SUNXI_CCU_DIV(16, 6), 301 301 .sdm = _SUNXI_CCU_SDM(pll_audio0_sdm_table, BIT(24), 302 302 0x178, BIT(31)), 303 - .min_rate = 180000000U, 303 + .min_rate = 90000000U, 304 304 .max_rate = 3000000000U, 305 305 .common = { 306 306 .reg = 0x078,
+7 -2
drivers/gpio/gpiolib-cdev.c
··· 2548 2548 container_of(nb, struct gpio_chardev_data, lineinfo_changed_nb); 2549 2549 struct lineinfo_changed_ctx *ctx; 2550 2550 struct gpio_desc *desc = data; 2551 + struct file *fp; 2551 2552 2552 2553 if (!test_bit(gpio_chip_hwgpio(desc), cdev->watched_lines)) 2554 + return NOTIFY_DONE; 2555 + 2556 + /* Keep the file descriptor alive for the duration of the notification. */ 2557 + fp = get_file_active(&cdev->fp); 2558 + if (!fp) 2559 + /* Chardev file descriptor was or is being released. */ 2553 2560 return NOTIFY_DONE; 2554 2561 2555 2562 /* ··· 2582 2575 /* Keep the GPIO device alive until we emit the event. */ 2583 2576 ctx->gdev = gpio_device_get(desc->gdev); 2584 2577 ctx->cdev = cdev; 2585 - /* Keep the file descriptor alive too. */ 2586 - get_file(ctx->cdev->fp); 2587 2578 2588 2579 INIT_WORK(&ctx->work, lineinfo_changed_func); 2589 2580 queue_work(ctx->gdev->line_state_wq, &ctx->work);
+2 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c
··· 3414 3414 (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX || 3415 3415 adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA)) 3416 3416 continue; 3417 - /* skip CG for VCE/UVD, it's handled specially */ 3417 + /* skip CG for VCE/UVD/VPE, it's handled specially */ 3418 3418 if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && 3419 3419 adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE && 3420 3420 adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCN && 3421 + adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VPE && 3421 3422 adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_JPEG && 3422 3423 adev->ip_blocks[i].version->funcs->set_powergating_state) { 3423 3424 /* enable powergating to save power */
+1 -1
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
··· 1372 1372 mem->mem_type == AMDGPU_PL_MMIO_REMAP)) { 1373 1373 flags |= AMDGPU_PTE_SYSTEM; 1374 1374 1375 - if (ttm->caching == ttm_cached) 1375 + if (ttm && ttm->caching == ttm_cached) 1376 1376 flags |= AMDGPU_PTE_SNOOPED; 1377 1377 } 1378 1378
+2 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c
··· 2078 2078 struct amdgpu_bo *bo = before->bo_va->base.bo; 2079 2079 2080 2080 amdgpu_vm_it_insert(before, &vm->va); 2081 - if (before->flags & AMDGPU_PTE_PRT_FLAG(adev)) 2081 + if (before->flags & AMDGPU_VM_PAGE_PRT) 2082 2082 amdgpu_vm_prt_get(adev); 2083 2083 2084 2084 if (amdgpu_vm_is_bo_always_valid(vm, bo) && ··· 2093 2093 struct amdgpu_bo *bo = after->bo_va->base.bo; 2094 2094 2095 2095 amdgpu_vm_it_insert(after, &vm->va); 2096 - if (after->flags & AMDGPU_PTE_PRT_FLAG(adev)) 2096 + if (after->flags & AMDGPU_VM_PAGE_PRT) 2097 2097 amdgpu_vm_prt_get(adev); 2098 2098 2099 2099 if (amdgpu_vm_is_bo_always_valid(vm, bo) &&
+2 -2
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
··· 5872 5872 if (flags & AMDGPU_IB_PREEMPTED) 5873 5873 control |= INDIRECT_BUFFER_PRE_RESUME(1); 5874 5874 5875 - if (vmid) 5875 + if (vmid && !ring->adev->gfx.rs64_enable) 5876 5876 gfx_v11_0_ring_emit_de_meta(ring, 5877 - (!amdgpu_sriov_vf(ring->adev) && flags & AMDGPU_IB_PREEMPTED) ? true : false); 5877 + !amdgpu_sriov_vf(ring->adev) && (flags & AMDGPU_IB_PREEMPTED)); 5878 5878 } 5879 5879 5880 5880 amdgpu_ring_write(ring, header);
+1 -1
drivers/gpu/drm/amd/amdgpu/vcn_v4_0_3.c
··· 141 141 adev->vcn.supported_reset = 142 142 amdgpu_get_soft_full_reset_mask(&adev->vcn.inst[0].ring_enc[0]); 143 143 144 - if (amdgpu_dpm_reset_vcn_is_supported(adev)) 144 + if (amdgpu_dpm_reset_vcn_is_supported(adev) && !amdgpu_sriov_vf(adev)) 145 145 adev->vcn.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE; 146 146 147 147 return 0;
+3 -1
drivers/gpu/drm/amd/amdgpu/vcn_v5_0_1.c
··· 122 122 123 123 switch (amdgpu_ip_version(adev, MP0_HWIP, 0)) { 124 124 case IP_VERSION(13, 0, 12): 125 - if ((adev->psp.sos.fw_version >= 0x00450025) && amdgpu_dpm_reset_vcn_is_supported(adev)) 125 + if ((adev->psp.sos.fw_version >= 0x00450025) && 126 + amdgpu_dpm_reset_vcn_is_supported(adev) && 127 + !amdgpu_sriov_vf(adev)) 126 128 adev->vcn.supported_reset |= AMDGPU_RESET_TYPE_PER_QUEUE; 127 129 break; 128 130 default:
+138
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 3859 3859 update_subconnector_property(aconnector); 3860 3860 } 3861 3861 3862 + static bool are_sinks_equal(const struct dc_sink *sink1, const struct dc_sink *sink2) 3863 + { 3864 + if (!sink1 || !sink2) 3865 + return false; 3866 + if (sink1->sink_signal != sink2->sink_signal) 3867 + return false; 3868 + 3869 + if (sink1->dc_edid.length != sink2->dc_edid.length) 3870 + return false; 3871 + 3872 + if (memcmp(sink1->dc_edid.raw_edid, sink2->dc_edid.raw_edid, 3873 + sink1->dc_edid.length) != 0) 3874 + return false; 3875 + return true; 3876 + } 3877 + 3878 + 3879 + /** 3880 + * DOC: hdmi_hpd_debounce_work 3881 + * 3882 + * HDMI HPD debounce delay in milliseconds. When an HDMI display toggles HPD 3883 + * (such as during power save transitions), this delay determines how long to 3884 + * wait before processing the HPD event. This allows distinguishing between a 3885 + * physical unplug (>hdmi_hpd_debounce_delay) 3886 + * and a spontaneous RX HPD toggle (<hdmi_hpd_debounce_delay). 3887 + * 3888 + * If the toggle is less than this delay, the driver compares sink capabilities 3889 + * and permits a hotplug event if they changed. 3890 + * 3891 + * The default value of 1500ms was chosen based on experimental testing with 3892 + * various monitors that exhibit spontaneous HPD toggling behavior. 3893 + */ 3894 + static void hdmi_hpd_debounce_work(struct work_struct *work) 3895 + { 3896 + struct amdgpu_dm_connector *aconnector = 3897 + container_of(to_delayed_work(work), struct amdgpu_dm_connector, 3898 + hdmi_hpd_debounce_work); 3899 + struct drm_connector *connector = &aconnector->base; 3900 + struct drm_device *dev = connector->dev; 3901 + struct amdgpu_device *adev = drm_to_adev(dev); 3902 + struct dc *dc = aconnector->dc_link->ctx->dc; 3903 + bool fake_reconnect = false; 3904 + bool reallow_idle = false; 3905 + bool ret = false; 3906 + guard(mutex)(&aconnector->hpd_lock); 3907 + 3908 + /* Re-detect the display */ 3909 + scoped_guard(mutex, &adev->dm.dc_lock) { 3910 + if (dc->caps.ips_support && dc->ctx->dmub_srv->idle_allowed) { 3911 + dc_allow_idle_optimizations(dc, false); 3912 + reallow_idle = true; 3913 + } 3914 + ret = dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD); 3915 + } 3916 + 3917 + if (ret) { 3918 + /* Apply workaround delay for certain panels */ 3919 + apply_delay_after_dpcd_poweroff(adev, aconnector->dc_sink); 3920 + /* Compare sinks to determine if this was a spontaneous HPD toggle */ 3921 + if (are_sinks_equal(aconnector->dc_link->local_sink, aconnector->hdmi_prev_sink)) { 3922 + /* 3923 + * Sinks match - this was a spontaneous HDMI HPD toggle. 3924 + */ 3925 + drm_dbg_kms(dev, "HDMI HPD: Sink unchanged after debounce, internal re-enable\n"); 3926 + fake_reconnect = true; 3927 + } 3928 + 3929 + /* Update connector state */ 3930 + amdgpu_dm_update_connector_after_detect(aconnector); 3931 + 3932 + drm_modeset_lock_all(dev); 3933 + dm_restore_drm_connector_state(dev, connector); 3934 + drm_modeset_unlock_all(dev); 3935 + 3936 + /* Only notify OS if sink actually changed */ 3937 + if (!fake_reconnect && aconnector->base.force == DRM_FORCE_UNSPECIFIED) 3938 + drm_kms_helper_hotplug_event(dev); 3939 + } 3940 + 3941 + /* Release the cached sink reference */ 3942 + if (aconnector->hdmi_prev_sink) { 3943 + dc_sink_release(aconnector->hdmi_prev_sink); 3944 + aconnector->hdmi_prev_sink = NULL; 3945 + } 3946 + 3947 + scoped_guard(mutex, &adev->dm.dc_lock) { 3948 + if (reallow_idle && dc->caps.ips_support) 3949 + dc_allow_idle_optimizations(dc, true); 3950 + } 3951 + } 3952 + 3862 3953 static void handle_hpd_irq_helper(struct amdgpu_dm_connector *aconnector) 3863 3954 { 3864 3955 struct drm_connector *connector = &aconnector->base; ··· 3959 3868 struct dm_connector_state *dm_con_state = to_dm_connector_state(connector->state); 3960 3869 struct dc *dc = aconnector->dc_link->ctx->dc; 3961 3870 bool ret = false; 3871 + bool debounce_required = false; 3962 3872 3963 3873 if (adev->dm.disable_hpd_irq) 3964 3874 return; ··· 3982 3890 if (!dc_link_detect_connection_type(aconnector->dc_link, &new_connection_type)) 3983 3891 drm_err(adev_to_drm(adev), "KMS: Failed to detect connector\n"); 3984 3892 3893 + /* 3894 + * Check for HDMI disconnect with debounce enabled. 3895 + */ 3896 + debounce_required = (aconnector->hdmi_hpd_debounce_delay_ms > 0 && 3897 + dc_is_hdmi_signal(aconnector->dc_link->connector_signal) && 3898 + new_connection_type == dc_connection_none && 3899 + aconnector->dc_link->local_sink != NULL); 3900 + 3985 3901 if (aconnector->base.force && new_connection_type == dc_connection_none) { 3986 3902 emulated_link_detect(aconnector->dc_link); 3987 3903 ··· 3999 3899 4000 3900 if (aconnector->base.force == DRM_FORCE_UNSPECIFIED) 4001 3901 drm_kms_helper_connector_hotplug_event(connector); 3902 + } else if (debounce_required) { 3903 + /* 3904 + * HDMI disconnect detected - schedule delayed work instead of 3905 + * processing immediately. This allows us to coalesce spurious 3906 + * HDMI signals from physical unplugs. 3907 + */ 3908 + drm_dbg_kms(dev, "HDMI HPD: Disconnect detected, scheduling debounce work (%u ms)\n", 3909 + aconnector->hdmi_hpd_debounce_delay_ms); 3910 + 3911 + /* Cache the current sink for later comparison */ 3912 + if (aconnector->hdmi_prev_sink) 3913 + dc_sink_release(aconnector->hdmi_prev_sink); 3914 + aconnector->hdmi_prev_sink = aconnector->dc_link->local_sink; 3915 + if (aconnector->hdmi_prev_sink) 3916 + dc_sink_retain(aconnector->hdmi_prev_sink); 3917 + 3918 + /* Schedule delayed detection. */ 3919 + if (mod_delayed_work(system_wq, 3920 + &aconnector->hdmi_hpd_debounce_work, 3921 + msecs_to_jiffies(aconnector->hdmi_hpd_debounce_delay_ms))) 3922 + drm_dbg_kms(dev, "HDMI HPD: Re-scheduled debounce work\n"); 3923 + 4002 3924 } else { 3925 + 3926 + /* If the aconnector->hdmi_hpd_debounce_work is scheduled, exit early */ 3927 + if (delayed_work_pending(&aconnector->hdmi_hpd_debounce_work)) 3928 + return; 3929 + 4003 3930 scoped_guard(mutex, &adev->dm.dc_lock) { 4004 3931 dc_exit_ips_for_hw_access(dc); 4005 3932 ret = dc_link_detect(aconnector->dc_link, DETECT_REASON_HPD); ··· 7515 7388 if (aconnector->mst_mgr.dev) 7516 7389 drm_dp_mst_topology_mgr_destroy(&aconnector->mst_mgr); 7517 7390 7391 + /* Cancel and flush any pending HDMI HPD debounce work */ 7392 + cancel_delayed_work_sync(&aconnector->hdmi_hpd_debounce_work); 7393 + if (aconnector->hdmi_prev_sink) { 7394 + dc_sink_release(aconnector->hdmi_prev_sink); 7395 + aconnector->hdmi_prev_sink = NULL; 7396 + } 7397 + 7518 7398 if (aconnector->bl_idx != -1) { 7519 7399 backlight_device_unregister(dm->backlight_dev[aconnector->bl_idx]); 7520 7400 dm->backlight_dev[aconnector->bl_idx] = NULL; ··· 8682 8548 memset(&aconnector->vsdb_info, 0, sizeof(aconnector->vsdb_info)); 8683 8549 mutex_init(&aconnector->hpd_lock); 8684 8550 mutex_init(&aconnector->handle_mst_msg_ready); 8551 + 8552 + aconnector->hdmi_hpd_debounce_delay_ms = AMDGPU_DM_HDMI_HPD_DEBOUNCE_MS; 8553 + INIT_DELAYED_WORK(&aconnector->hdmi_hpd_debounce_work, hdmi_hpd_debounce_work); 8554 + aconnector->hdmi_prev_sink = NULL; 8685 8555 8686 8556 /* 8687 8557 * configure support HPD hot plug connector_>polled default value is 0
+6
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h
··· 59 59 60 60 #define AMDGPU_HDR_MULT_DEFAULT (0x100000000LL) 61 61 62 + #define AMDGPU_DM_HDMI_HPD_DEBOUNCE_MS 1500 62 63 /* 63 64 #include "include/amdgpu_dal_power_if.h" 64 65 #include "amdgpu_dm_irq.h" ··· 820 819 bool pack_sdp_v1_3; 821 820 enum adaptive_sync_type as_type; 822 821 struct amdgpu_hdmi_vsdb_info vsdb_info; 822 + 823 + /* HDMI HPD debounce support */ 824 + unsigned int hdmi_hpd_debounce_delay_ms; 825 + struct delayed_work hdmi_hpd_debounce_work; 826 + struct dc_sink *hdmi_prev_sink; 823 827 }; 824 828 825 829 static inline void amdgpu_dm_set_mst_status(uint8_t *status,
+23 -36
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
··· 884 884 }; 885 885 886 886 #if defined(CONFIG_DRM_AMD_DC_FP) 887 - static uint16_t get_fec_overhead_multiplier(struct dc_link *dc_link) 887 + static uint64_t kbps_to_pbn(int kbps, bool is_peak_pbn) 888 888 { 889 - u8 link_coding_cap; 890 - uint16_t fec_overhead_multiplier_x1000 = PBN_FEC_OVERHEAD_MULTIPLIER_8B_10B; 889 + uint64_t effective_kbps = (uint64_t)kbps; 891 890 892 - link_coding_cap = dc_link_dp_mst_decide_link_encoding_format(dc_link); 893 - if (link_coding_cap == DP_128b_132b_ENCODING) 894 - fec_overhead_multiplier_x1000 = PBN_FEC_OVERHEAD_MULTIPLIER_128B_132B; 891 + if (is_peak_pbn) { // add 0.6% (1006/1000) overhead into effective kbps 892 + effective_kbps *= 1006; 893 + effective_kbps = div_u64(effective_kbps, 1000); 894 + } 895 895 896 - return fec_overhead_multiplier_x1000; 896 + return (uint64_t) DIV64_U64_ROUND_UP(effective_kbps * 64, (54 * 8 * 1000)); 897 897 } 898 898 899 - static int kbps_to_peak_pbn(int kbps, uint16_t fec_overhead_multiplier_x1000) 899 + static uint32_t pbn_to_kbps(unsigned int pbn, bool with_margin) 900 900 { 901 - u64 peak_kbps = kbps; 901 + uint64_t pbn_effective = (uint64_t)pbn; 902 902 903 - peak_kbps *= 1006; 904 - peak_kbps *= fec_overhead_multiplier_x1000; 905 - peak_kbps = div_u64(peak_kbps, 1000 * 1000); 906 - return (int) DIV64_U64_ROUND_UP(peak_kbps * 64, (54 * 8 * 1000)); 903 + if (with_margin) // deduct 0.6% (994/1000) overhead from effective pbn 904 + pbn_effective *= (1000000 / PEAK_FACTOR_X1000); 905 + else 906 + pbn_effective *= 1000; 907 + 908 + return DIV_U64_ROUND_UP(pbn_effective * 8 * 54, 64); 907 909 } 908 910 909 911 static void set_dsc_configs_from_fairness_vars(struct dsc_mst_fairness_params *params, ··· 976 974 dc_dsc_get_default_config_option(param.sink->ctx->dc, &dsc_options); 977 975 dsc_options.max_target_bpp_limit_override_x16 = drm_connector->display_info.max_dsc_bpp * 16; 978 976 979 - kbps = div_u64((u64)pbn * 994 * 8 * 54, 64); 977 + kbps = pbn_to_kbps(pbn, false); 980 978 dc_dsc_compute_config( 981 979 param.sink->ctx->dc->res_pool->dscs[0], 982 980 &param.sink->dsc_caps.dsc_dec_caps, ··· 1005 1003 int link_timeslots_used; 1006 1004 int fair_pbn_alloc; 1007 1005 int ret = 0; 1008 - uint16_t fec_overhead_multiplier_x1000 = get_fec_overhead_multiplier(dc_link); 1009 1006 1010 1007 for (i = 0; i < count; i++) { 1011 1008 if (vars[i + k].dsc_enabled) { 1012 1009 initial_slack[i] = 1013 - kbps_to_peak_pbn(params[i].bw_range.max_kbps, fec_overhead_multiplier_x1000) - vars[i + k].pbn; 1010 + kbps_to_pbn(params[i].bw_range.max_kbps, false) - vars[i + k].pbn; 1014 1011 bpp_increased[i] = false; 1015 1012 remaining_to_increase += 1; 1016 1013 } else { ··· 1105 1104 int next_index; 1106 1105 int remaining_to_try = 0; 1107 1106 int ret; 1108 - uint16_t fec_overhead_multiplier_x1000 = get_fec_overhead_multiplier(dc_link); 1109 1107 int var_pbn; 1110 1108 1111 1109 for (i = 0; i < count; i++) { ··· 1137 1137 1138 1138 DRM_DEBUG_DRIVER("MST_DSC index #%d, try no compression\n", next_index); 1139 1139 var_pbn = vars[next_index].pbn; 1140 - vars[next_index].pbn = kbps_to_peak_pbn(params[next_index].bw_range.stream_kbps, fec_overhead_multiplier_x1000); 1140 + vars[next_index].pbn = kbps_to_pbn(params[next_index].bw_range.stream_kbps, true); 1141 1141 ret = drm_dp_atomic_find_time_slots(state, 1142 1142 params[next_index].port->mgr, 1143 1143 params[next_index].port, ··· 1197 1197 int count = 0; 1198 1198 int i, k, ret; 1199 1199 bool debugfs_overwrite = false; 1200 - uint16_t fec_overhead_multiplier_x1000 = get_fec_overhead_multiplier(dc_link); 1201 1200 struct drm_connector_state *new_conn_state; 1202 1201 1203 1202 memset(params, 0, sizeof(params)); ··· 1277 1278 DRM_DEBUG_DRIVER("MST_DSC Try no compression\n"); 1278 1279 for (i = 0; i < count; i++) { 1279 1280 vars[i + k].aconnector = params[i].aconnector; 1280 - vars[i + k].pbn = kbps_to_peak_pbn(params[i].bw_range.stream_kbps, fec_overhead_multiplier_x1000); 1281 + vars[i + k].pbn = kbps_to_pbn(params[i].bw_range.stream_kbps, false); 1281 1282 vars[i + k].dsc_enabled = false; 1282 1283 vars[i + k].bpp_x16 = 0; 1283 1284 ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr, params[i].port, ··· 1299 1300 DRM_DEBUG_DRIVER("MST_DSC Try max compression\n"); 1300 1301 for (i = 0; i < count; i++) { 1301 1302 if (params[i].compression_possible && params[i].clock_force_enable != DSC_CLK_FORCE_DISABLE) { 1302 - vars[i + k].pbn = kbps_to_peak_pbn(params[i].bw_range.min_kbps, fec_overhead_multiplier_x1000); 1303 + vars[i + k].pbn = kbps_to_pbn(params[i].bw_range.min_kbps, false); 1303 1304 vars[i + k].dsc_enabled = true; 1304 1305 vars[i + k].bpp_x16 = params[i].bw_range.min_target_bpp_x16; 1305 1306 ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr, ··· 1307 1308 if (ret < 0) 1308 1309 return ret; 1309 1310 } else { 1310 - vars[i + k].pbn = kbps_to_peak_pbn(params[i].bw_range.stream_kbps, fec_overhead_multiplier_x1000); 1311 + vars[i + k].pbn = kbps_to_pbn(params[i].bw_range.stream_kbps, false); 1311 1312 vars[i + k].dsc_enabled = false; 1312 1313 vars[i + k].bpp_x16 = 0; 1313 1314 ret = drm_dp_atomic_find_time_slots(state, params[i].port->mgr, ··· 1762 1763 return ret; 1763 1764 } 1764 1765 1765 - static uint32_t kbps_from_pbn(unsigned int pbn) 1766 - { 1767 - uint64_t kbps = (uint64_t)pbn; 1768 - 1769 - kbps *= (1000000 / PEAK_FACTOR_X1000); 1770 - kbps *= 8; 1771 - kbps *= 54; 1772 - kbps /= 64; 1773 - 1774 - return (uint32_t)kbps; 1775 - } 1776 - 1777 1766 static bool is_dsc_common_config_possible(struct dc_stream_state *stream, 1778 1767 struct dc_dsc_bw_range *bw_range) 1779 1768 { ··· 1860 1873 dc_link_get_highest_encoding_format(stream->link)); 1861 1874 cur_link_settings = stream->link->verified_link_cap; 1862 1875 root_link_bw_in_kbps = dc_link_bandwidth_kbps(aconnector->dc_link, &cur_link_settings); 1863 - virtual_channel_bw_in_kbps = kbps_from_pbn(aconnector->mst_output_port->full_pbn); 1876 + virtual_channel_bw_in_kbps = pbn_to_kbps(aconnector->mst_output_port->full_pbn, true); 1864 1877 1865 1878 /* pick the end to end bw bottleneck */ 1866 1879 end_to_end_bw_in_kbps = min(root_link_bw_in_kbps, virtual_channel_bw_in_kbps); ··· 1913 1926 immediate_upstream_port = aconnector->mst_output_port->parent->port_parent; 1914 1927 1915 1928 if (immediate_upstream_port) { 1916 - virtual_channel_bw_in_kbps = kbps_from_pbn(immediate_upstream_port->full_pbn); 1929 + virtual_channel_bw_in_kbps = pbn_to_kbps(immediate_upstream_port->full_pbn, true); 1917 1930 virtual_channel_bw_in_kbps = min(root_link_bw_in_kbps, virtual_channel_bw_in_kbps); 1918 1931 } else { 1919 1932 /* For topology LCT 1 case - only one mstb*/
+3 -1
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c
··· 394 394 display_count = dcn35_get_active_display_cnt_wa(dc, context, &all_active_disps); 395 395 if (new_clocks->dtbclk_en && !new_clocks->ref_dtbclk_khz) 396 396 new_clocks->ref_dtbclk_khz = 600000; 397 + else if (!new_clocks->dtbclk_en && new_clocks->ref_dtbclk_khz > 590000) 398 + new_clocks->ref_dtbclk_khz = 0; 397 399 398 400 /* 399 401 * if it is safe to lower, but we are already in the lower state, we don't have to do anything ··· 437 435 438 436 actual_dtbclk = REG_READ(CLK1_CLK4_CURRENT_CNT); 439 437 440 - if (actual_dtbclk) { 438 + if (actual_dtbclk > 590000) { 441 439 clk_mgr_base->clks.ref_dtbclk_khz = new_clocks->ref_dtbclk_khz; 442 440 clk_mgr_base->clks.dtbclk_en = new_clocks->dtbclk_en; 443 441 }
+1 -1
drivers/gpu/drm/amd/display/dc/dccg/dcn35/dcn35_dccg.c
··· 1411 1411 __func__, params->otg_inst, params->pixclk_khz, 1412 1412 params->ref_dtbclk_khz, req_dtbclk_khz, phase, modulo); 1413 1413 1414 - } else { 1414 + } else if (!params->ref_dtbclk_khz && !req_dtbclk_khz) { 1415 1415 switch (params->otg_inst) { 1416 1416 case 0: 1417 1417 REG_UPDATE(DCCG_GATE_DISABLE_CNTL5, DTBCLK_P0_GATE_DISABLE, 0);
+8
drivers/gpu/drm/amd/display/dc/hwss/dcn20/dcn20_hwseq.c
··· 614 614 * DOMAIN11_PGFSM_PWR_STATUS, pwr_status, 615 615 * 1, 1000); 616 616 */ 617 + 618 + /* Force disable cursor on plane powerdown on DPP 5 using dpp_force_disable_cursor */ 619 + if (!power_on) { 620 + struct dpp *dpp5 = hws->ctx->dc->res_pool->dpps[dpp_inst]; 621 + if (dpp5 && dpp5->funcs->dpp_force_disable_cursor) 622 + dpp5->funcs->dpp_force_disable_cursor(dpp5); 623 + } 624 + 617 625 break; 618 626 default: 619 627 BREAK_TO_DEBUGGER();
+2 -2
drivers/gpu/drm/drm_plane.c
··· 210 210 formats_size = sizeof(__u32) * plane->format_count; 211 211 if (WARN_ON(!formats_size)) { 212 212 /* 0 formats are never expected */ 213 - return 0; 213 + return ERR_PTR(-EINVAL); 214 214 } 215 215 216 216 modifiers_size = ··· 226 226 227 227 blob = drm_property_create_blob(dev, blob_size, NULL); 228 228 if (IS_ERR(blob)) 229 - return NULL; 229 + return blob; 230 230 231 231 blob_data = blob->data; 232 232 blob_data->version = FORMAT_BLOB_CURRENT;
+6 -8
drivers/gpu/drm/i915/display/intel_cx0_phy.c
··· 39 39 struct intel_display *display = to_intel_display(encoder); 40 40 enum phy phy = intel_encoder_to_phy(encoder); 41 41 42 - /* PTL doesn't have a PHY connected to PORT B; as such, 43 - * there will never be a case where PTL uses PHY B. 44 - * WCL uses PORT A and B with the C10 PHY. 45 - * Reusing the condition for WCL and extending it for PORT B 46 - * should not cause any issues for PTL. 47 - */ 48 - if (display->platform.pantherlake && phy < PHY_C) 49 - return true; 42 + if (display->platform.pantherlake) { 43 + if (display->platform.pantherlake_wildcatlake) 44 + return phy <= PHY_B; 45 + else 46 + return phy == PHY_A; 47 + } 50 48 51 49 if ((display->platform.lunarlake || display->platform.meteorlake) && phy < PHY_C) 52 50 return true;
+13
drivers/gpu/drm/i915/display/intel_display_device.c
··· 1404 1404 PLATFORM_GROUP(dgfx), 1405 1405 }; 1406 1406 1407 + static const u16 wcl_ids[] = { 1408 + INTEL_WCL_IDS(ID), 1409 + 0 1410 + }; 1411 + 1407 1412 static const struct platform_desc ptl_desc = { 1408 1413 PLATFORM(pantherlake), 1414 + .subplatforms = (const struct subplatform_desc[]) { 1415 + { 1416 + SUBPLATFORM(pantherlake, wildcatlake), 1417 + .pciidlist = wcl_ids, 1418 + }, 1419 + {}, 1420 + } 1409 1421 }; 1410 1422 1411 1423 __diag_pop(); ··· 1494 1482 INTEL_LNL_IDS(INTEL_DISPLAY_DEVICE, &lnl_desc), 1495 1483 INTEL_BMG_IDS(INTEL_DISPLAY_DEVICE, &bmg_desc), 1496 1484 INTEL_PTL_IDS(INTEL_DISPLAY_DEVICE, &ptl_desc), 1485 + INTEL_WCL_IDS(INTEL_DISPLAY_DEVICE, &ptl_desc), 1497 1486 }; 1498 1487 1499 1488 static const struct {
+3 -1
drivers/gpu/drm/i915/display/intel_display_device.h
··· 101 101 /* Display ver 14.1 (based on GMD ID) */ \ 102 102 func(battlemage) \ 103 103 /* Display ver 30 (based on GMD ID) */ \ 104 - func(pantherlake) 104 + func(pantherlake) \ 105 + func(pantherlake_wildcatlake) 106 + 105 107 106 108 #define __MEMBER(name) unsigned long name:1; 107 109 #define __COUNT(x) 1 +
+7 -3
drivers/gpu/drm/i915/display/intel_dmc.c
··· 127 127 #define DISPLAY_VER13_DMC_MAX_FW_SIZE 0x20000 128 128 #define DISPLAY_VER12_DMC_MAX_FW_SIZE ICL_DMC_MAX_FW_SIZE 129 129 130 + #define XE3LPD_3002_DMC_PATH DMC_PATH(xe3lpd_3002) 131 + MODULE_FIRMWARE(XE3LPD_3002_DMC_PATH); 132 + 130 133 #define XE3LPD_DMC_PATH DMC_PATH(xe3lpd) 131 134 MODULE_FIRMWARE(XE3LPD_DMC_PATH); 132 135 ··· 186 183 { 187 184 const char *fw_path = NULL; 188 185 u32 max_fw_size = 0; 189 - 190 - if (DISPLAY_VERx100(display) == 3002 || 191 - DISPLAY_VERx100(display) == 3000) { 186 + if (DISPLAY_VERx100(display) == 3002) { 187 + fw_path = XE3LPD_3002_DMC_PATH; 188 + max_fw_size = XE2LPD_DMC_MAX_FW_SIZE; 189 + } else if (DISPLAY_VERx100(display) == 3000) { 192 190 fw_path = XE3LPD_DMC_PATH; 193 191 max_fw_size = XE2LPD_DMC_MAX_FW_SIZE; 194 192 } else if (DISPLAY_VERx100(display) == 2000) {
+2
drivers/gpu/drm/nouveau/nvkm/falcon/fw.c
··· 159 159 nvkm_memory_unref(&fw->inst); 160 160 nvkm_falcon_fw_dtor_sigs(fw); 161 161 nvkm_firmware_dtor(&fw->fw); 162 + kfree(fw->boot); 163 + fw->boot = NULL; 162 164 } 163 165 164 166 static const struct nvkm_firmware_func
-7
drivers/gpu/drm/radeon/radeon_fence.c
··· 360 360 if (atomic64_read(&rdev->fence_drv[ring].last_seq) >= seq) 361 361 return true; 362 362 363 - if (down_read_trylock(&rdev->exclusive_lock)) { 364 - radeon_fence_process(rdev, ring); 365 - up_read(&rdev->exclusive_lock); 366 - 367 - if (atomic64_read(&rdev->fence_drv[ring].last_seq) >= seq) 368 - return true; 369 - } 370 363 return false; 371 364 } 372 365
+1
drivers/gpu/drm/tegra/dc.c
··· 3148 3148 dc->client.parent = &parent->client; 3149 3149 3150 3150 dev_dbg(dc->dev, "coupled to %s\n", dev_name(companion)); 3151 + put_device(companion); 3151 3152 } 3152 3153 3153 3154 return 0;
-9
drivers/gpu/drm/tegra/dsi.c
··· 913 913 u32 value; 914 914 int err; 915 915 916 - /* If the bootloader enabled DSI it needs to be disabled 917 - * in order for the panel initialization commands to be 918 - * properly sent. 919 - */ 920 - value = tegra_dsi_readl(dsi, DSI_POWER_CONTROL); 921 - 922 - if (value & DSI_POWER_CONTROL_ENABLE) 923 - tegra_dsi_disable(dsi); 924 - 925 916 err = tegra_dsi_prepare(dsi); 926 917 if (err < 0) { 927 918 dev_err(dsi->dev, "failed to prepare: %d\n", err);
+5 -2
drivers/gpu/drm/tegra/uapi.c
··· 114 114 if (err) 115 115 goto put_channel; 116 116 117 - if (supported) 117 + if (supported) { 118 + struct pid *pid = get_task_pid(current, PIDTYPE_TGID); 118 119 context->memory_context = host1x_memory_context_alloc( 119 - host, client->base.dev, get_task_pid(current, PIDTYPE_TGID)); 120 + host, client->base.dev, pid); 121 + put_pid(pid); 122 + } 120 123 121 124 if (IS_ERR(context->memory_context)) { 122 125 if (PTR_ERR(context->memory_context) != -EOPNOTSUPP) {
-1
drivers/gpu/drm/xe/Kconfig
··· 13 13 select TMPFS 14 14 select DRM_BUDDY 15 15 select DRM_CLIENT_SELECTION 16 - select DRM_EXEC 17 16 select DRM_KMS_HELPER 18 17 select DRM_KUNIT_TEST_HELPERS if DRM_XE_KUNIT_TEST != n 19 18 select DRM_PANEL
+1 -1
drivers/gpu/drm/xe/tests/xe_mocs.c
··· 49 49 fw_ref = xe_force_wake_get(gt_to_fw(gt), XE_FORCEWAKE_ALL); 50 50 if (!xe_force_wake_ref_has_domain(fw_ref, XE_FORCEWAKE_ALL)) { 51 51 xe_force_wake_put(gt_to_fw(gt), fw_ref); 52 - KUNIT_ASSERT_TRUE_MSG(test, true, "Forcewake Failed.\n"); 52 + KUNIT_FAIL_AND_ABORT(test, "Forcewake Failed.\n"); 53 53 } 54 54 55 55 for (i = 0; i < info->num_mocs_regs; i++) {
+1 -17
drivers/gpu/drm/xe/xe_irq.c
··· 847 847 return 0; 848 848 } 849 849 850 - static irqreturn_t guc2host_irq_handler(int irq, void *arg) 851 - { 852 - struct xe_device *xe = arg; 853 - struct xe_tile *tile; 854 - u8 id; 855 - 856 - if (!atomic_read(&xe->irq.enabled)) 857 - return IRQ_NONE; 858 - 859 - for_each_tile(tile, xe, id) 860 - xe_guc_irq_handler(&tile->primary_gt->uc.guc, 861 - GUC_INTR_GUC2HOST); 862 - 863 - return IRQ_HANDLED; 864 - } 865 - 866 850 static irqreturn_t xe_irq_msix_default_hwe_handler(int irq, void *arg) 867 851 { 868 852 unsigned int tile_id, gt_id; ··· 963 979 u16 msix; 964 980 965 981 msix = GUC2HOST_MSIX; 966 - err = xe_irq_msix_request_irq(xe, guc2host_irq_handler, xe, 982 + err = xe_irq_msix_request_irq(xe, xe_irq_handler(xe), xe, 967 983 DRIVER_NAME "-guc2host", false, &msix); 968 984 if (err) 969 985 return err;
+1
drivers/gpu/drm/xe/xe_pci.c
··· 375 375 INTEL_LNL_IDS(INTEL_VGA_DEVICE, &lnl_desc), 376 376 INTEL_BMG_IDS(INTEL_VGA_DEVICE, &bmg_desc), 377 377 INTEL_PTL_IDS(INTEL_VGA_DEVICE, &ptl_desc), 378 + INTEL_WCL_IDS(INTEL_VGA_DEVICE, &ptl_desc), 378 379 { } 379 380 }; 380 381 MODULE_DEVICE_TABLE(pci, pciidlist);
+4 -2
drivers/gpu/drm/xe/xe_vm.c
··· 3369 3369 op == DRM_XE_VM_BIND_OP_PREFETCH) || 3370 3370 XE_IOCTL_DBG(xe, prefetch_region && 3371 3371 op != DRM_XE_VM_BIND_OP_PREFETCH) || 3372 - XE_IOCTL_DBG(xe, (prefetch_region != DRM_XE_CONSULT_MEM_ADVISE_PREF_LOC && 3373 - !(BIT(prefetch_region) & xe->info.mem_region_mask))) || 3372 + XE_IOCTL_DBG(xe, (prefetch_region != DRM_XE_CONSULT_MEM_ADVISE_PREF_LOC && 3373 + /* Guard against undefined shift in BIT(prefetch_region) */ 3374 + (prefetch_region >= (sizeof(xe->info.mem_region_mask) * 8) || 3375 + !(BIT(prefetch_region) & xe->info.mem_region_mask)))) || 3374 3376 XE_IOCTL_DBG(xe, obj && 3375 3377 op == DRM_XE_VM_BIND_OP_UNMAP) || 3376 3378 XE_IOCTL_DBG(xe, (flags & DRM_XE_VM_BIND_FLAG_MADVISE_AUTORESET) &&
+2
drivers/hid/amd-sfh-hid/sfh1_1/amd_sfh_init.c
··· 194 194 if (rc) 195 195 goto cleanup; 196 196 197 + mp2_ops->stop(privdata, cl_data->sensor_idx[i]); 198 + amd_sfh_wait_for_response(privdata, cl_data->sensor_idx[i], DISABLE_SENSOR); 197 199 writel(0, privdata->mmio + amd_get_p2c_val(privdata, 0)); 198 200 mp2_ops->start(privdata, info); 199 201 status = amd_sfh_wait_for_response
+1
drivers/hid/hid-apple.c
··· 355 355 356 356 static const struct apple_non_apple_keyboard non_apple_keyboards[] = { 357 357 { "SONiX USB DEVICE" }, 358 + { "SONiX AK870 PRO" }, 358 359 { "Keychron" }, 359 360 { "AONE" }, 360 361 { "GANSS" },
+2 -3
drivers/hid/hid-corsair-void.c
··· 553 553 554 554 if (IS_ERR(new_supply)) { 555 555 hid_err(drvdata->hid_dev, 556 - "failed to register battery '%s' (reason: %ld)\n", 557 - drvdata->battery_desc.name, 558 - PTR_ERR(new_supply)); 556 + "failed to register battery '%s' (reason: %pe)\n", 557 + drvdata->battery_desc.name, new_supply); 559 558 return; 560 559 } 561 560
+4 -2
drivers/hid/hid-elecom.c
··· 75 75 */ 76 76 mouse_button_fixup(hdev, rdesc, *rsize, 20, 28, 22, 14, 8); 77 77 break; 78 - case USB_DEVICE_ID_ELECOM_M_XT3URBK: 78 + case USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB: 79 + case USB_DEVICE_ID_ELECOM_M_XT3URBK_018F: 79 80 case USB_DEVICE_ID_ELECOM_M_XT3DRBK: 80 81 case USB_DEVICE_ID_ELECOM_M_XT4DRBK: 81 82 /* ··· 120 119 static const struct hid_device_id elecom_devices[] = { 121 120 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) }, 122 121 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XGL20DLBK) }, 123 - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK) }, 122 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB) }, 123 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_018F) }, 124 124 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) }, 125 125 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) }, 126 126 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) },
+1 -1
drivers/hid/hid-haptic.c
··· 86 86 if (hi->application == HID_DG_TOUCHPAD) { 87 87 if (haptic->auto_trigger_report && 88 88 haptic->manual_trigger_report) { 89 - __set_bit(INPUT_PROP_HAPTIC_TOUCHPAD, hi->input->propbit); 89 + __set_bit(INPUT_PROP_PRESSUREPAD, hi->input->propbit); 90 90 return 1; 91 91 } 92 92 return 0;
+5 -3
drivers/hid/hid-ids.h
··· 449 449 #define USB_VENDOR_ID_ELECOM 0x056e 450 450 #define USB_DEVICE_ID_ELECOM_BM084 0x0061 451 451 #define USB_DEVICE_ID_ELECOM_M_XGL20DLBK 0x00e6 452 - #define USB_DEVICE_ID_ELECOM_M_XT3URBK 0x00fb 452 + #define USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB 0x00fb 453 + #define USB_DEVICE_ID_ELECOM_M_XT3URBK_018F 0x018f 453 454 #define USB_DEVICE_ID_ELECOM_M_XT3DRBK 0x00fc 454 455 #define USB_DEVICE_ID_ELECOM_M_XT4DRBK 0x00fd 455 456 #define USB_DEVICE_ID_ELECOM_M_DT1URBK 0x00fe ··· 719 718 #define USB_DEVICE_ID_ITE_LENOVO_YOGA2 0x8350 720 719 #define I2C_DEVICE_ID_ITE_LENOVO_LEGION_Y720 0x837a 721 720 #define USB_DEVICE_ID_ITE_LENOVO_YOGA900 0x8396 721 + #define I2C_DEVICE_ID_ITE_LENOVO_YOGA_SLIM_7X_KEYBOARD 0x8987 722 722 #define USB_DEVICE_ID_ITE8595 0x8595 723 723 #define USB_DEVICE_ID_ITE_MEDION_E1239T 0xce50 724 724 ··· 1545 1543 #define USB_VENDOR_ID_SIGNOTEC 0x2133 1546 1544 #define USB_DEVICE_ID_SIGNOTEC_VIEWSONIC_PD1011 0x0018 1547 1545 1548 - #define USB_VENDOR_ID_SMARTLINKTECHNOLOGY 0x4c4a 1549 - #define USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155 0x4155 1546 + #define USB_VENDOR_ID_JIELI_SDK_DEFAULT 0x4c4a 1547 + #define USB_DEVICE_ID_JIELI_SDK_4155 0x4155 1550 1548 1551 1549 #endif
+3 -2
drivers/hid/hid-input.c
··· 399 399 { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, I2C_DEVICE_ID_CHROMEBOOK_TROGDOR_POMPOM), 400 400 HID_BATTERY_QUIRK_AVOID_QUERY }, 401 401 /* 402 - * Elan I2C-HID touchscreens seem to all report a non present battery, 403 - * set HID_BATTERY_QUIRK_IGNORE for all Elan I2C-HID devices. 402 + * Elan HID touchscreens seem to all report a non present battery, 403 + * set HID_BATTERY_QUIRK_IGNORE for all Elan I2C and USB HID devices. 404 404 */ 405 405 { HID_I2C_DEVICE(USB_VENDOR_ID_ELAN, HID_ANY_ID), HID_BATTERY_QUIRK_IGNORE }, 406 + { HID_USB_DEVICE(USB_VENDOR_ID_ELAN, HID_ANY_ID), HID_BATTERY_QUIRK_IGNORE }, 406 407 {} 407 408 }; 408 409
+17
drivers/hid/hid-lenovo.c
··· 148 148 0x81, 0x01, /* Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position) */ 149 149 }; 150 150 151 + static const __u8 lenovo_yoga7x_kbd_need_fixup_collection[] = { 152 + 0x15, 0x00, // Logical Minimum (0) 153 + 0x25, 0x65, // Logical Maximum (101) 154 + 0x05, 0x07, // Usage Page (Keyboard) 155 + 0x19, 0x00, // Usage Minimum (0) 156 + 0x29, 0xDD, // Usage Maximum (221) 157 + }; 158 + 151 159 static const __u8 *lenovo_report_fixup(struct hid_device *hdev, __u8 *rdesc, 152 160 unsigned int *rsize) 153 161 { ··· 183 175 rdesc[256] = 0x01; /* report count = 0x01 */ 184 176 rdesc[258] = 0x00; /* input = 0x00 */ 185 177 rdesc[260] = 0x01; /* report count (2) = 0x01 */ 178 + } 179 + break; 180 + case I2C_DEVICE_ID_ITE_LENOVO_YOGA_SLIM_7X_KEYBOARD: 181 + if (*rsize == 176 && 182 + memcmp(&rdesc[52], lenovo_yoga7x_kbd_need_fixup_collection, 183 + sizeof(lenovo_yoga7x_kbd_need_fixup_collection)) == 0) { 184 + rdesc[55] = rdesc[61]; // logical maximum = usage maximum 186 185 } 187 186 break; 188 187 } ··· 1553 1538 USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X12_TAB) }, 1554 1539 { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, 1555 1540 USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_X12_TAB2) }, 1541 + { HID_DEVICE(BUS_I2C, HID_GROUP_GENERIC, 1542 + USB_VENDOR_ID_ITE, I2C_DEVICE_ID_ITE_LENOVO_YOGA_SLIM_7X_KEYBOARD) }, 1556 1543 { } 1557 1544 }; 1558 1545
+2 -5
drivers/hid/hid-ntrig.c
··· 142 142 int ret; 143 143 char buf[20]; 144 144 struct usb_device *usb_dev = hid_to_usb_dev(hdev); 145 - unsigned char *data = kmalloc(8, GFP_KERNEL); 145 + unsigned char *data __free(kfree) = kmalloc(8, GFP_KERNEL); 146 146 147 147 if (!hid_is_usb(hdev)) 148 148 return; 149 149 150 150 if (!data) 151 - goto err_free; 151 + return; 152 152 153 153 ret = usb_control_msg(usb_dev, usb_rcvctrlpipe(usb_dev, 0), 154 154 USB_REQ_CLEAR_FEATURE, ··· 163 163 hid_info(hdev, "Firmware version: %s (%02x%02x %02x%02x)\n", 164 164 buf, data[2], data[3], data[4], data[5]); 165 165 } 166 - 167 - err_free: 168 - kfree(data); 169 166 } 170 167 171 168 static ssize_t show_phys_width(struct device *dev,
+2
drivers/hid/hid-playstation.c
··· 1942 1942 "Failed to retrieve DualShock4 calibration info: %d\n", 1943 1943 ret); 1944 1944 ret = -EILSEQ; 1945 + kfree(buf); 1945 1946 goto transfer_failed; 1946 1947 } else { 1947 1948 break; ··· 1960 1959 1961 1960 if (ret) { 1962 1961 hid_warn(hdev, "Failed to retrieve DualShock4 calibration info: %d\n", ret); 1962 + kfree(buf); 1963 1963 goto transfer_failed; 1964 1964 } 1965 1965 }
+14 -2
drivers/hid/hid-quirks.c
··· 410 410 #if IS_ENABLED(CONFIG_HID_ELECOM) 411 411 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_BM084) }, 412 412 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XGL20DLBK) }, 413 - { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK) }, 413 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_00FB) }, 414 + { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3URBK_018F) }, 414 415 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT3DRBK) }, 415 416 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) }, 416 417 { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) }, ··· 916 915 #endif 917 916 { HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) }, 918 917 { HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473) }, 919 - { HID_USB_DEVICE(USB_VENDOR_ID_SMARTLINKTECHNOLOGY, USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155) }, 920 918 { } 921 919 }; 922 920 ··· 1063 1063 if (!strncmp(hdev->name, elan_acpi_id[i].id, 1064 1064 strlen(elan_acpi_id[i].id))) 1065 1065 return true; 1066 + break; 1067 + case USB_VENDOR_ID_JIELI_SDK_DEFAULT: 1068 + /* 1069 + * Multiple USB devices with identical IDs (mic & touchscreen). 1070 + * The touch screen requires hid core processing, but the 1071 + * microphone does not. They can be distinguished by manufacturer 1072 + * and serial number. 1073 + */ 1074 + if (hdev->product == USB_DEVICE_ID_JIELI_SDK_4155 && 1075 + strncmp(hdev->name, "SmartlinkTechnology", 19) == 0 && 1076 + strncmp(hdev->uniq, "20201111000001", 14) == 0) 1077 + return true; 1066 1078 break; 1067 1079 } 1068 1080
+3 -1
drivers/hid/hid-uclogic-params.c
··· 1369 1369 event_hook->hdev = hdev; 1370 1370 event_hook->size = ARRAY_SIZE(reconnect_event); 1371 1371 event_hook->event = kmemdup(reconnect_event, event_hook->size, GFP_KERNEL); 1372 - if (!event_hook->event) 1372 + if (!event_hook->event) { 1373 + kfree(event_hook); 1373 1374 return -ENOMEM; 1375 + } 1374 1376 1375 1377 list_add_tail(&event_hook->list, &p->event_hooks->list); 1376 1378
+2 -2
drivers/hid/usbhid/hid-pidff.c
··· 806 806 807 807 static int pidff_needs_playback(struct pidff_device *pidff, int effect_id, int n) 808 808 { 809 - return pidff->effect[effect_id].is_infinite || 810 - pidff->effect[effect_id].loop_count != n; 809 + return !pidff->effect[effect_id].is_infinite || 810 + pidff->effect[effect_id].loop_count != n; 811 811 } 812 812 813 813 /*
+6
drivers/input/keyboard/cros_ec_keyb.c
··· 261 261 case EC_MKBP_EVENT_KEY_MATRIX: 262 262 pm_wakeup_event(ckdev->dev, 0); 263 263 264 + if (!ckdev->idev) { 265 + dev_warn_once(ckdev->dev, 266 + "Unexpected key matrix event\n"); 267 + return NOTIFY_OK; 268 + } 269 + 264 270 if (ckdev->ec->event_size != ckdev->cols) { 265 271 dev_err(ckdev->dev, 266 272 "Discarded incomplete key matrix event.\n");
+1 -1
drivers/input/keyboard/imx_sc_key.c
··· 158 158 return error; 159 159 } 160 160 161 - error = devm_add_action_or_reset(&pdev->dev, imx_sc_key_action, &priv); 161 + error = devm_add_action_or_reset(&pdev->dev, imx_sc_key_action, priv); 162 162 if (error) 163 163 return error; 164 164
+9
drivers/input/tablet/pegasus_notetaker.c
··· 63 63 #define BUTTON_PRESSED 0xb5 64 64 #define COMMAND_VERSION 0xa9 65 65 66 + /* 1 Status + 1 Color + 2 X + 2 Y = 6 bytes */ 67 + #define NOTETAKER_PACKET_SIZE 6 68 + 66 69 /* in xy data packet */ 67 70 #define BATTERY_NO_REPORT 0x40 68 71 #define BATTERY_LOW 0x41 ··· 314 311 } 315 312 316 313 pegasus->data_len = usb_maxpacket(dev, pipe); 314 + if (pegasus->data_len < NOTETAKER_PACKET_SIZE) { 315 + dev_err(&intf->dev, "packet size is too small (%d)\n", 316 + pegasus->data_len); 317 + error = -EINVAL; 318 + goto err_free_mem; 319 + } 317 320 318 321 pegasus->data = usb_alloc_coherent(dev, pegasus->data_len, GFP_KERNEL, 319 322 &pegasus->data_dma);
+2 -26
drivers/input/touchscreen/goodix.c
··· 796 796 797 797 usleep_range(6000, 10000); /* T4: > 5ms */ 798 798 799 - /* 800 - * Put the reset pin back in to input / high-impedance mode to save 801 - * power. Only do this in the non ACPI case since some ACPI boards 802 - * don't have a pull-up, so there the reset pin must stay active-high. 803 - */ 804 - if (ts->irq_pin_access_method == IRQ_PIN_ACCESS_GPIO) { 805 - error = gpiod_direction_input(ts->gpiod_rst); 806 - if (error) 807 - goto error; 808 - } 809 - 810 799 return 0; 811 800 812 801 error: ··· 946 957 return -EINVAL; 947 958 } 948 959 949 - /* 950 - * Normally we put the reset pin in input / high-impedance mode to save 951 - * power. But some x86/ACPI boards don't have a pull-up, so for the ACPI 952 - * case, leave the pin as is. This results in the pin not being touched 953 - * at all on x86/ACPI boards, except when needed for error-recover. 954 - */ 955 - ts->gpiod_rst_flags = GPIOD_ASIS; 956 - 957 960 return devm_acpi_dev_add_driver_gpios(dev, gpio_mapping); 958 961 } 959 962 #else ··· 969 988 if (!ts->client) 970 989 return -EINVAL; 971 990 dev = &ts->client->dev; 972 - 973 - /* 974 - * By default we request the reset pin as input, leaving it in 975 - * high-impedance when not resetting the controller to save power. 976 - */ 977 - ts->gpiod_rst_flags = GPIOD_IN; 978 991 979 992 ts->avdd28 = devm_regulator_get(dev, "AVDD28"); 980 993 if (IS_ERR(ts->avdd28)) ··· 994 1019 ts->gpiod_int = gpiod; 995 1020 996 1021 /* Get the reset line GPIO pin number */ 997 - gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, ts->gpiod_rst_flags); 1022 + gpiod = devm_gpiod_get_optional(dev, GOODIX_GPIO_RST_NAME, GPIOD_ASIS); 998 1023 if (IS_ERR(gpiod)) 999 1024 return dev_err_probe(dev, PTR_ERR(gpiod), "Failed to get %s GPIO\n", 1000 1025 GOODIX_GPIO_RST_NAME); ··· 1532 1557 static const struct acpi_device_id goodix_acpi_match[] = { 1533 1558 { "GDIX1001", 0 }, 1534 1559 { "GDIX1002", 0 }, 1560 + { "GDIX1003", 0 }, 1535 1561 { "GDX9110", 0 }, 1536 1562 { } 1537 1563 };
-1
drivers/input/touchscreen/goodix.h
··· 88 88 struct gpio_desc *gpiod_rst; 89 89 int gpio_count; 90 90 int gpio_int_idx; 91 - enum gpiod_flags gpiod_rst_flags; 92 91 char id[GOODIX_ID_MAX_LEN + 1]; 93 92 char cfg_name[64]; 94 93 u16 version;
+2 -2
drivers/memory/tegra/tegra210.c
··· 1015 1015 }, 1016 1016 }, 1017 1017 }, { 1018 - .id = TEGRA210_MC_SESRD, 1018 + .id = TEGRA210_MC_SESWR, 1019 1019 .name = "seswr", 1020 1020 .swgroup = TEGRA_SWGROUP_SE, 1021 1021 .regs = { ··· 1079 1079 }, 1080 1080 }, 1081 1081 }, { 1082 - .id = TEGRA210_MC_ETRR, 1082 + .id = TEGRA210_MC_ETRW, 1083 1083 .name = "etrw", 1084 1084 .swgroup = TEGRA_SWGROUP_ETR, 1085 1085 .regs = {
+4 -2
drivers/mtd/mtdchar.c
··· 599 599 uint8_t *datbuf = NULL, *oobbuf = NULL; 600 600 size_t datbuf_len, oobbuf_len; 601 601 int ret = 0; 602 + u64 end; 602 603 603 604 if (copy_from_user(&req, argp, sizeof(req))) 604 605 return -EFAULT; ··· 619 618 req.len &= 0xffffffff; 620 619 req.ooblen &= 0xffffffff; 621 620 622 - if (req.start + req.len > mtd->size) 621 + if (check_add_overflow(req.start, req.len, &end) || end > mtd->size) 623 622 return -EINVAL; 624 623 625 624 datbuf_len = min_t(size_t, req.len, mtd->erasesize); ··· 699 698 size_t datbuf_len, oobbuf_len; 700 699 size_t orig_len, orig_ooblen; 701 700 int ret = 0; 701 + u64 end; 702 702 703 703 if (copy_from_user(&req, argp, sizeof(req))) 704 704 return -EFAULT; ··· 726 724 req.len &= 0xffffffff; 727 725 req.ooblen &= 0xffffffff; 728 726 729 - if (req.start + req.len > mtd->size) { 727 + if (check_add_overflow(req.start, req.len, &end) || end > mtd->size) { 730 728 ret = -EINVAL; 731 729 goto out; 732 730 }
+1 -1
drivers/mtd/nand/Kconfig
··· 63 63 64 64 config MTD_NAND_ECC_REALTEK 65 65 tristate "Realtek RTL93xx hardware ECC engine" 66 - depends on HAS_IOMEM 66 + depends on HAS_IOMEM && HAS_DMA 67 67 depends on MACH_REALTEK_RTL || COMPILE_TEST 68 68 select MTD_NAND_ECC 69 69 help
+3 -3
drivers/mtd/nand/ecc-realtek.c
··· 380 380 nand_ecc_cleanup_req_tweaking(&ctx->req_ctx); 381 381 } 382 382 383 - static struct nand_ecc_engine_ops rtl_ecc_engine_ops = { 383 + static const struct nand_ecc_engine_ops rtl_ecc_engine_ops = { 384 384 .init_ctx = rtl_ecc_init_ctx, 385 385 .cleanup_ctx = rtl_ecc_cleanup_ctx, 386 386 .prepare_io_req = rtl_ecc_prepare_io_req, ··· 418 418 419 419 rtlc->buf = dma_alloc_noncoherent(dev, RTL_ECC_DMA_SIZE, &rtlc->buf_dma, 420 420 DMA_BIDIRECTIONAL, GFP_KERNEL); 421 - if (IS_ERR(rtlc->buf)) 422 - return PTR_ERR(rtlc->buf); 421 + if (!rtlc->buf) 422 + return -ENOMEM; 423 423 424 424 rtlc->dev = dev; 425 425 rtlc->engine.dev = dev;
+1 -1
drivers/mtd/nand/onenand/onenand_samsung.c
··· 906 906 err = devm_request_irq(&pdev->dev, r->start, 907 907 s5pc110_onenand_irq, 908 908 IRQF_SHARED, "onenand", 909 - &onenand); 909 + onenand); 910 910 if (err) { 911 911 dev_err(&pdev->dev, "failed to get irq\n"); 912 912 return err;
+2 -1
drivers/mtd/nand/raw/cadence-nand-controller.c
··· 2871 2871 static int cadence_nand_init(struct cdns_nand_ctrl *cdns_ctrl) 2872 2872 { 2873 2873 dma_cap_mask_t mask; 2874 - struct dma_device *dma_dev = cdns_ctrl->dmac->device; 2874 + struct dma_device *dma_dev; 2875 2875 int ret; 2876 2876 2877 2877 cdns_ctrl->cdma_desc = dma_alloc_coherent(cdns_ctrl->dev, ··· 2915 2915 } 2916 2916 } 2917 2917 2918 + dma_dev = cdns_ctrl->dmac->device; 2918 2919 cdns_ctrl->io.iova_dma = dma_map_resource(dma_dev->dev, cdns_ctrl->io.dma, 2919 2920 cdns_ctrl->io.size, 2920 2921 DMA_BIDIRECTIONAL, 0);
+1 -1
drivers/mtd/nand/spi/fmsh.c
··· 58 58 SPINAND_INFO_OP_VARIANTS(&read_cache_variants, 59 59 &write_cache_variants, 60 60 &update_cache_variants), 61 - SPINAND_HAS_QE_BIT, 61 + 0, 62 62 SPINAND_ECCINFO(&fm25s01a_ooblayout, NULL)), 63 63 }; 64 64
+12 -2
drivers/net/dsa/hirschmann/hellcreek_ptp.c
··· 376 376 hellcreek_set_brightness(hellcreek, STATUS_OUT_IS_GM, 1); 377 377 378 378 /* Register both leds */ 379 - led_classdev_register(hellcreek->dev, &hellcreek->led_sync_good); 380 - led_classdev_register(hellcreek->dev, &hellcreek->led_is_gm); 379 + ret = led_classdev_register(hellcreek->dev, &hellcreek->led_sync_good); 380 + if (ret) { 381 + dev_err(hellcreek->dev, "Failed to register sync_good LED\n"); 382 + goto out; 383 + } 384 + 385 + ret = led_classdev_register(hellcreek->dev, &hellcreek->led_is_gm); 386 + if (ret) { 387 + dev_err(hellcreek->dev, "Failed to register is_gm LED\n"); 388 + led_classdev_unregister(&hellcreek->led_sync_good); 389 + goto out; 390 + } 381 391 382 392 ret = 0; 383 393
+1
drivers/net/dsa/microchip/lan937x_main.c
··· 540 540 ksz_pread16(dev, port, reg, &data16); 541 541 542 542 /* Update tune Adjust */ 543 + data16 &= ~PORT_TUNE_ADJ; 543 544 data16 |= FIELD_PREP(PORT_TUNE_ADJ, val); 544 545 ksz_pwrite16(dev, port, reg, data16); 545 546
+1 -1
drivers/net/ethernet/airoha/airoha_ppe.c
··· 282 282 if (!airoha_is_valid_gdm_port(eth, port)) 283 283 return -EINVAL; 284 284 285 - if (dsa_port >= 0) 285 + if (dsa_port >= 0 || eth->ports[1]) 286 286 pse_port = port->id == 4 ? FE_PSE_PORT_GDM4 287 287 : port->id; 288 288 else
+4 -3
drivers/net/ethernet/emulex/benet/be_main.c
··· 1296 1296 (adapter->bmc_filt_mask & BMC_FILT_MULTICAST) 1297 1297 1298 1298 static bool be_send_pkt_to_bmc(struct be_adapter *adapter, 1299 - struct sk_buff **skb) 1299 + struct sk_buff **skb, 1300 + struct be_wrb_params *wrb_params) 1300 1301 { 1301 1302 struct ethhdr *eh = (struct ethhdr *)(*skb)->data; 1302 1303 bool os2bmc = false; ··· 1361 1360 * to BMC, asic expects the vlan to be inline in the packet. 1362 1361 */ 1363 1362 if (os2bmc) 1364 - *skb = be_insert_vlan_in_pkt(adapter, *skb, NULL); 1363 + *skb = be_insert_vlan_in_pkt(adapter, *skb, wrb_params); 1365 1364 1366 1365 return os2bmc; 1367 1366 } ··· 1388 1387 /* if os2bmc is enabled and if the pkt is destined to bmc, 1389 1388 * enqueue the pkt a 2nd time with mgmt bit set. 1390 1389 */ 1391 - if (be_send_pkt_to_bmc(adapter, &skb)) { 1390 + if (be_send_pkt_to_bmc(adapter, &skb, &wrb_params)) { 1392 1391 BE_WRB_F_SET(wrb_params.features, OS2BMC, 1); 1393 1392 wrb_cnt = be_xmit_enqueue(adapter, txo, skb, &wrb_params); 1394 1393 if (unlikely(!wrb_cnt))
+19 -3
drivers/net/ethernet/intel/ice/ice_ptp.c
··· 3246 3246 3247 3247 err = ice_ptp_init_port(pf, &ptp->port); 3248 3248 if (err) 3249 - goto err_exit; 3249 + goto err_clean_pf; 3250 3250 3251 3251 /* Start the PHY timestamping block */ 3252 3252 ice_ptp_reset_phy_timestamping(pf); ··· 3263 3263 dev_info(ice_pf_to_dev(pf), "PTP init successful\n"); 3264 3264 return; 3265 3265 3266 + err_clean_pf: 3267 + mutex_destroy(&ptp->port.ps_lock); 3268 + ice_ptp_cleanup_pf(pf); 3266 3269 err_exit: 3267 3270 /* If we registered a PTP clock, release it */ 3268 3271 if (pf->ptp.clock) { 3269 3272 ptp_clock_unregister(ptp->clock); 3270 3273 pf->ptp.clock = NULL; 3271 3274 } 3272 - ptp->state = ICE_PTP_ERROR; 3275 + /* Keep ICE_PTP_UNINIT state to avoid ambiguity at driver unload 3276 + * and to avoid duplicated resources release. 3277 + */ 3278 + ptp->state = ICE_PTP_UNINIT; 3273 3279 dev_err(ice_pf_to_dev(pf), "PTP failed %d\n", err); 3274 3280 } 3275 3281 ··· 3288 3282 */ 3289 3283 void ice_ptp_release(struct ice_pf *pf) 3290 3284 { 3291 - if (pf->ptp.state != ICE_PTP_READY) 3285 + if (pf->ptp.state == ICE_PTP_UNINIT) 3292 3286 return; 3287 + 3288 + if (pf->ptp.state != ICE_PTP_READY) { 3289 + mutex_destroy(&pf->ptp.port.ps_lock); 3290 + ice_ptp_cleanup_pf(pf); 3291 + if (pf->ptp.clock) { 3292 + ptp_clock_unregister(pf->ptp.clock); 3293 + pf->ptp.clock = NULL; 3294 + } 3295 + return; 3296 + } 3293 3297 3294 3298 pf->ptp.state = ICE_PTP_UNINIT; 3295 3299
+2
drivers/net/ethernet/intel/idpf/idpf_main.c
··· 63 63 destroy_workqueue(adapter->vc_event_wq); 64 64 65 65 for (i = 0; i < adapter->max_vports; i++) { 66 + if (!adapter->vport_config[i]) 67 + continue; 66 68 kfree(adapter->vport_config[i]->user_config.q_coalesce); 67 69 kfree(adapter->vport_config[i]); 68 70 adapter->vport_config[i] = NULL;
+2 -4
drivers/net/ethernet/mellanox/mlx5/core/pci_irq.c
··· 324 324 free_irq(irq->map.virq, &irq->nh); 325 325 err_req_irq: 326 326 #ifdef CONFIG_RFS_ACCEL 327 - if (i && rmap && *rmap) { 328 - free_irq_cpu_rmap(*rmap); 329 - *rmap = NULL; 330 - } 327 + if (i && rmap && *rmap) 328 + irq_cpu_rmap_remove(*rmap, irq->map.virq); 331 329 err_irq_rmap: 332 330 #endif 333 331 if (i && pci_msix_can_alloc_dyn(dev->pdev))
+2
drivers/net/ethernet/mellanox/mlxsw/core_linecards.c
··· 601 601 err = devlink_info_version_fixed_put(req, 602 602 DEVLINK_INFO_VERSION_GENERIC_FW_PSID, 603 603 info->psid); 604 + if (err) 605 + goto unlock; 604 606 605 607 sprintf(buf, "%u.%u.%u", info->fw_major, info->fw_minor, 606 608 info->fw_sub_minor);
+4 -2
drivers/net/ethernet/mellanox/mlxsw/spectrum_flower.c
··· 830 830 return -EINVAL; 831 831 832 832 rule = mlxsw_sp_acl_rule_lookup(mlxsw_sp, ruleset, f->cookie); 833 - if (!rule) 834 - return -EINVAL; 833 + if (!rule) { 834 + err = -EINVAL; 835 + goto err_rule_get_stats; 836 + } 835 837 836 838 err = mlxsw_sp_acl_rule_get_stats(mlxsw_sp, rule, &packets, &bytes, 837 839 &drops, &lastuse, &used_hw_stats);
+3 -2
drivers/net/ethernet/qlogic/qede/qede_fp.c
··· 4 4 * Copyright (c) 2019-2020 Marvell International Ltd. 5 5 */ 6 6 7 + #include <linux/array_size.h> 7 8 #include <linux/netdevice.h> 8 9 #include <linux/etherdevice.h> 9 10 #include <linux/skbuff.h> ··· 961 960 { 962 961 int i; 963 962 964 - for (i = 0; cqe->len_list[i]; i++) 963 + for (i = 0; cqe->len_list[i] && i < ARRAY_SIZE(cqe->len_list); i++) 965 964 qede_fill_frag_skb(edev, rxq, cqe->tpa_agg_index, 966 965 le16_to_cpu(cqe->len_list[i])); 967 966 ··· 986 985 dma_unmap_page(rxq->dev, tpa_info->buffer.mapping, 987 986 PAGE_SIZE, rxq->data_direction); 988 987 989 - for (i = 0; cqe->len_list[i]; i++) 988 + for (i = 0; cqe->len_list[i] && i < ARRAY_SIZE(cqe->len_list); i++) 990 989 qede_fill_frag_skb(edev, rxq, cqe->tpa_agg_index, 991 990 le16_to_cpu(cqe->len_list[i])); 992 991 if (unlikely(i > 1))
+34 -11
drivers/net/ethernet/toshiba/ps3_gelic_net.c
··· 260 260 if (atomic_dec_if_positive(&card->users) == 0) { 261 261 pr_debug("%s: real do\n", __func__); 262 262 napi_disable(&card->napi); 263 + timer_delete_sync(&card->rx_oom_timer); 263 264 /* 264 265 * Disable irq. Wireless interrupts will 265 266 * be disabled later if any ··· 971 970 * gelic_card_decode_one_descr - processes an rx descriptor 972 971 * @card: card structure 973 972 * 974 - * returns 1 if a packet has been sent to the stack, otherwise 0 973 + * returns 1 if a packet has been sent to the stack, -ENOMEM on skb alloc 974 + * failure, otherwise 0 975 975 * 976 976 * processes an rx descriptor by iommu-unmapping the data buffer and passing 977 977 * the packet up to the stack ··· 983 981 struct gelic_descr_chain *chain = &card->rx_chain; 984 982 struct gelic_descr *descr = chain->head; 985 983 struct net_device *netdev = NULL; 986 - int dmac_chain_ended; 984 + int dmac_chain_ended = 0; 985 + int prepare_rx_ret; 987 986 988 987 status = gelic_descr_get_status(descr); 989 988 990 989 if (status == GELIC_DESCR_DMA_CARDOWNED) 991 990 return 0; 992 991 993 - if (status == GELIC_DESCR_DMA_NOT_IN_USE) { 992 + if (status == GELIC_DESCR_DMA_NOT_IN_USE || !descr->skb) { 994 993 dev_dbg(ctodev(card), "dormant descr? %p\n", descr); 995 - return 0; 994 + dmac_chain_ended = 1; 995 + goto refill; 996 996 } 997 997 998 998 /* netdevice select */ ··· 1052 1048 refill: 1053 1049 1054 1050 /* is the current descriptor terminated with next_descr == NULL? */ 1055 - dmac_chain_ended = 1056 - be32_to_cpu(descr->hw_regs.dmac_cmd_status) & 1057 - GELIC_DESCR_RX_DMA_CHAIN_END; 1051 + if (!dmac_chain_ended) 1052 + dmac_chain_ended = 1053 + be32_to_cpu(descr->hw_regs.dmac_cmd_status) & 1054 + GELIC_DESCR_RX_DMA_CHAIN_END; 1058 1055 /* 1059 1056 * So that always DMAC can see the end 1060 1057 * of the descriptor chain to avoid ··· 1067 1062 gelic_descr_set_status(descr, GELIC_DESCR_DMA_NOT_IN_USE); 1068 1063 1069 1064 /* 1070 - * this call can fail, but for now, just leave this 1071 - * descriptor without skb 1065 + * this call can fail, propagate the error 1072 1066 */ 1073 - gelic_descr_prepare_rx(card, descr); 1067 + prepare_rx_ret = gelic_descr_prepare_rx(card, descr); 1068 + if (prepare_rx_ret) 1069 + return prepare_rx_ret; 1074 1070 1075 1071 chain->tail = descr; 1076 1072 chain->head = descr->next; ··· 1093 1087 return 1; 1094 1088 } 1095 1089 1090 + static void gelic_rx_oom_timer(struct timer_list *t) 1091 + { 1092 + struct gelic_card *card = timer_container_of(card, t, rx_oom_timer); 1093 + 1094 + napi_schedule(&card->napi); 1095 + } 1096 + 1096 1097 /** 1097 1098 * gelic_net_poll - NAPI poll function called by the stack to return packets 1098 1099 * @napi: napi structure ··· 1112 1099 { 1113 1100 struct gelic_card *card = container_of(napi, struct gelic_card, napi); 1114 1101 int packets_done = 0; 1102 + int work_result = 0; 1115 1103 1116 1104 while (packets_done < budget) { 1117 - if (!gelic_card_decode_one_descr(card)) 1105 + work_result = gelic_card_decode_one_descr(card); 1106 + if (work_result != 1) 1118 1107 break; 1119 1108 1120 1109 packets_done++; 1110 + } 1111 + 1112 + if (work_result == -ENOMEM) { 1113 + napi_complete_done(napi, packets_done); 1114 + mod_timer(&card->rx_oom_timer, jiffies + 1); 1115 + return packets_done; 1121 1116 } 1122 1117 1123 1118 if (packets_done < budget) { ··· 1596 1575 atomic_set(&card->tx_timeout_task_counter, 0); 1597 1576 mutex_init(&card->updown_lock); 1598 1577 atomic_set(&card->users, 0); 1578 + 1579 + timer_setup(&card->rx_oom_timer, gelic_rx_oom_timer, 0); 1599 1580 1600 1581 return card; 1601 1582 }
+1
drivers/net/ethernet/toshiba/ps3_gelic_net.h
··· 268 268 struct gelic_card { 269 269 struct napi_struct napi; 270 270 struct net_device *netdev[GELIC_PORT_MAX]; 271 + struct timer_list rx_oom_timer; 271 272 /* 272 273 * hypervisor requires irq_status should be 273 274 * 8 bytes aligned, but u64 member is
+3
drivers/net/phy/phylink.c
··· 637 637 638 638 static void phylink_fill_fixedlink_supported(unsigned long *supported) 639 639 { 640 + linkmode_set_bit(ETHTOOL_LINK_MODE_Pause_BIT, supported); 641 + linkmode_set_bit(ETHTOOL_LINK_MODE_Asym_Pause_BIT, supported); 642 + linkmode_set_bit(ETHTOOL_LINK_MODE_Autoneg_BIT, supported); 640 643 linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Half_BIT, supported); 641 644 linkmode_set_bit(ETHTOOL_LINK_MODE_10baseT_Full_BIT, supported); 642 645 linkmode_set_bit(ETHTOOL_LINK_MODE_100baseT_Half_BIT, supported);
+20 -18
drivers/net/veth.c
··· 392 392 } 393 393 /* Restore Eth hdr pulled by dev_forward_skb/eth_type_trans */ 394 394 __skb_push(skb, ETH_HLEN); 395 - /* Depend on prior success packets started NAPI consumer via 396 - * __veth_xdp_flush(). Cancel TXQ stop if consumer stopped, 397 - * paired with empty check in veth_poll(). 398 - */ 399 395 netif_tx_stop_queue(txq); 400 - smp_mb__after_atomic(); 401 - if (unlikely(__ptr_ring_empty(&rq->xdp_ring))) 402 - netif_tx_wake_queue(txq); 396 + /* Makes sure NAPI peer consumer runs. Consumer is responsible 397 + * for starting txq again, until then ndo_start_xmit (this 398 + * function) will not be invoked by the netstack again. 399 + */ 400 + __veth_xdp_flush(rq); 403 401 break; 404 402 case NET_RX_DROP: /* same as NET_XMIT_DROP */ 405 403 drop: ··· 898 900 struct veth_xdp_tx_bq *bq, 899 901 struct veth_stats *stats) 900 902 { 901 - struct veth_priv *priv = netdev_priv(rq->dev); 902 - int queue_idx = rq->xdp_rxq.queue_index; 903 - struct netdev_queue *peer_txq; 904 - struct net_device *peer_dev; 905 903 int i, done = 0, n_xdpf = 0; 906 904 void *xdpf[VETH_XDP_BATCH]; 907 - 908 - /* NAPI functions as RCU section */ 909 - peer_dev = rcu_dereference_check(priv->peer, rcu_read_lock_bh_held()); 910 - peer_txq = peer_dev ? netdev_get_tx_queue(peer_dev, queue_idx) : NULL; 911 905 912 906 for (i = 0; i < budget; i++) { 913 907 void *ptr = __ptr_ring_consume(&rq->xdp_ring); ··· 949 959 rq->stats.vs.xdp_packets += done; 950 960 u64_stats_update_end(&rq->stats.syncp); 951 961 952 - if (peer_txq && unlikely(netif_tx_queue_stopped(peer_txq))) 953 - netif_tx_wake_queue(peer_txq); 954 - 955 962 return done; 956 963 } 957 964 ··· 956 969 { 957 970 struct veth_rq *rq = 958 971 container_of(napi, struct veth_rq, xdp_napi); 972 + struct veth_priv *priv = netdev_priv(rq->dev); 973 + int queue_idx = rq->xdp_rxq.queue_index; 974 + struct netdev_queue *peer_txq; 959 975 struct veth_stats stats = {}; 976 + struct net_device *peer_dev; 960 977 struct veth_xdp_tx_bq bq; 961 978 int done; 962 979 963 980 bq.count = 0; 981 + 982 + /* NAPI functions as RCU section */ 983 + peer_dev = rcu_dereference_check(priv->peer, rcu_read_lock_bh_held()); 984 + peer_txq = peer_dev ? netdev_get_tx_queue(peer_dev, queue_idx) : NULL; 964 985 965 986 xdp_set_return_frame_no_direct(); 966 987 done = veth_xdp_rcv(rq, budget, &bq, &stats); ··· 990 995 if (stats.xdp_tx > 0) 991 996 veth_xdp_flush(rq, &bq); 992 997 xdp_clear_return_frame_no_direct(); 998 + 999 + /* Release backpressure per NAPI poll */ 1000 + smp_rmb(); /* Paired with netif_tx_stop_queue set_bit */ 1001 + if (peer_txq && netif_tx_queue_stopped(peer_txq)) { 1002 + txq_trans_cond_update(peer_txq); 1003 + netif_tx_wake_queue(peer_txq); 1004 + } 993 1005 994 1006 return done; 995 1007 }
+7
drivers/net/wireless/realtek/rtw89/fw.c
··· 7694 7694 INIT_LIST_HEAD(&list); 7695 7695 7696 7696 list_for_each_entry_safe(ch_info, tmp, &scan_info->chan_list, list) { 7697 + /* The operating channel (tx_null == true) should 7698 + * not be last in the list, to avoid breaking 7699 + * RTL8851BU and RTL8832BU. 7700 + */ 7701 + if (list_len + 1 == RTW89_SCAN_LIST_LIMIT_AX && ch_info->tx_null) 7702 + break; 7703 + 7697 7704 list_move_tail(&ch_info->list, &list); 7698 7705 7699 7706 list_len++;
+2 -1
drivers/nvme/host/core.c
··· 4901 4901 */ 4902 4902 nvme_stop_keep_alive(ctrl); 4903 4903 blk_mq_destroy_queue(ctrl->admin_q); 4904 - blk_put_queue(ctrl->admin_q); 4905 4904 if (ctrl->ops->flags & NVME_F_FABRICS) { 4906 4905 blk_mq_destroy_queue(ctrl->fabrics_q); 4907 4906 blk_put_queue(ctrl->fabrics_q); ··· 5044 5045 container_of(dev, struct nvme_ctrl, ctrl_device); 5045 5046 struct nvme_subsystem *subsys = ctrl->subsys; 5046 5047 5048 + if (ctrl->admin_q) 5049 + blk_put_queue(ctrl->admin_q); 5047 5050 if (!subsys || ctrl->instance != subsys->instance) 5048 5051 ida_free(&nvme_instance_ida, ctrl->instance); 5049 5052 nvme_free_cels(ctrl);
+8 -7
drivers/nvme/host/fc.c
··· 2355 2355 container_of(ref, struct nvme_fc_ctrl, ref); 2356 2356 unsigned long flags; 2357 2357 2358 - if (ctrl->ctrl.tagset) 2359 - nvme_remove_io_tag_set(&ctrl->ctrl); 2360 - 2361 2358 /* remove from rport list */ 2362 2359 spin_lock_irqsave(&ctrl->rport->lock, flags); 2363 2360 list_del(&ctrl->ctrl_list); 2364 2361 spin_unlock_irqrestore(&ctrl->rport->lock, flags); 2365 - 2366 - nvme_unquiesce_admin_queue(&ctrl->ctrl); 2367 - nvme_remove_admin_tag_set(&ctrl->ctrl); 2368 2362 2369 2363 kfree(ctrl->queues); 2370 2364 ··· 3253 3259 { 3254 3260 struct nvme_fc_ctrl *ctrl = to_fc_ctrl(nctrl); 3255 3261 3256 - cancel_work_sync(&ctrl->ioerr_work); 3257 3262 cancel_delayed_work_sync(&ctrl->connect_work); 3263 + 3258 3264 /* 3259 3265 * kill the association on the link side. this will block 3260 3266 * waiting for io to terminate 3261 3267 */ 3262 3268 nvme_fc_delete_association(ctrl); 3269 + cancel_work_sync(&ctrl->ioerr_work); 3270 + 3271 + if (ctrl->ctrl.tagset) 3272 + nvme_remove_io_tag_set(&ctrl->ctrl); 3273 + 3274 + nvme_unquiesce_admin_queue(&ctrl->ctrl); 3275 + nvme_remove_admin_tag_set(&ctrl->ctrl); 3263 3276 } 3264 3277 3265 3278 static void
+1 -1
drivers/nvme/host/multipath.c
··· 793 793 return; 794 794 } 795 795 nvme_add_ns_head_cdev(head); 796 - kblockd_schedule_work(&head->partition_scan_work); 796 + queue_work(nvme_wq, &head->partition_scan_work); 797 797 } 798 798 799 799 nvme_mpath_add_sysfs_link(ns->head);
+2 -2
drivers/nvme/target/auth.c
··· 298 298 const char *hash_name; 299 299 u8 *challenge = req->sq->dhchap_c1; 300 300 struct nvme_dhchap_key *transformed_key; 301 - u8 buf[4], sc_c = ctrl->concat ? 1 : 0; 301 + u8 buf[4]; 302 302 int ret; 303 303 304 304 hash_name = nvme_auth_hmac_name(ctrl->shash_id); ··· 367 367 ret = crypto_shash_update(shash, buf, 2); 368 368 if (ret) 369 369 goto out; 370 - *buf = sc_c; 370 + *buf = req->sq->sc_c; 371 371 ret = crypto_shash_update(shash, buf, 1); 372 372 if (ret) 373 373 goto out;
+1
drivers/nvme/target/fabrics-cmd-auth.c
··· 43 43 data->auth_protocol[0].dhchap.halen, 44 44 data->auth_protocol[0].dhchap.dhlen); 45 45 req->sq->dhchap_tid = le16_to_cpu(data->t_id); 46 + req->sq->sc_c = data->sc_c; 46 47 if (data->sc_c != NVME_AUTH_SECP_NOSC) { 47 48 if (!IS_ENABLED(CONFIG_NVME_TARGET_TCP_TLS)) 48 49 return NVME_AUTH_DHCHAP_FAILURE_CONCAT_MISMATCH;
+1
drivers/nvme/target/nvmet.h
··· 159 159 bool authenticated; 160 160 struct delayed_work auth_expired_work; 161 161 u16 dhchap_tid; 162 + u8 sc_c; 162 163 u8 dhchap_status; 163 164 u8 dhchap_step; 164 165 u8 *dhchap_c1;
+1 -1
drivers/perf/riscv_pmu_sbi.c
··· 1109 1109 /* compute hardware counter index */ 1110 1110 hidx = info->csr - CSR_CYCLE; 1111 1111 1112 - /* check if the corresponding bit is set in sscountovf or overflow mask in shmem */ 1112 + /* check if the corresponding bit is set in scountovf or overflow mask in shmem */ 1113 1113 if (!(overflow & BIT(hidx))) 1114 1114 continue; 1115 1115
+18 -3
drivers/pinctrl/cirrus/pinctrl-cs42l43.c
··· 532 532 return ret; 533 533 } 534 534 535 + static void cs42l43_fwnode_put(void *data) 536 + { 537 + fwnode_handle_put(data); 538 + } 539 + 535 540 static int cs42l43_pin_probe(struct platform_device *pdev) 536 541 { 537 542 struct cs42l43 *cs42l43 = dev_get_drvdata(pdev->dev.parent); ··· 568 563 priv->gpio_chip.ngpio = CS42L43_NUM_GPIOS; 569 564 570 565 if (is_of_node(fwnode)) { 571 - fwnode = fwnode_get_named_child_node(fwnode, "pinctrl"); 566 + struct fwnode_handle *child; 572 567 573 - if (fwnode && !fwnode->dev) 574 - fwnode->dev = priv->dev; 568 + child = fwnode_get_named_child_node(fwnode, "pinctrl"); 569 + if (child) { 570 + ret = devm_add_action_or_reset(&pdev->dev, 571 + cs42l43_fwnode_put, child); 572 + if (ret) { 573 + fwnode_handle_put(child); 574 + return ret; 575 + } 576 + if (!child->dev) 577 + child->dev = priv->dev; 578 + fwnode = child; 579 + } 575 580 } 576 581 577 582 priv->gpio_chip.fwnode = fwnode;
+1 -3
drivers/pinctrl/mediatek/pinctrl-mt8189.c
··· 1642 1642 }; 1643 1643 1644 1644 static const char * const mt8189_pinctrl_register_base_names[] = { 1645 - "gpio_base", "iocfg_bm0_base", "iocfg_bm1_base", "iocfg_bm2_base", "iocfg_lm_base", 1646 - "iocfg_lt0_base", "iocfg_lt1_base", "iocfg_rb0_base", "iocfg_rb1_base", 1647 - "iocfg_rt_base" 1645 + "base", "lm", "rb0", "rb1", "bm0", "bm1", "bm2", "lt0", "lt1", "rt", 1648 1646 }; 1649 1647 1650 1648 static const struct mtk_eint_hw mt8189_eint_hw = {
+2 -4
drivers/pinctrl/mediatek/pinctrl-mt8196.c
··· 1801 1801 }; 1802 1802 1803 1803 static const char * const mt8196_pinctrl_register_base_names[] = { 1804 - "iocfg0", "iocfg_rt", "iocfg_rm1", "iocfg_rm2", 1805 - "iocfg_rb", "iocfg_bm1", "iocfg_bm2", "iocfg_bm3", 1806 - "iocfg_lt", "iocfg_lm1", "iocfg_lm2", "iocfg_lb1", 1807 - "iocfg_lb2", "iocfg_tm1", "iocfg_tm2", "iocfg_tm3", 1804 + "base", "rt", "rm1", "rm2", "rb", "bm1", "bm2", "bm3", 1805 + "lt", "lm1", "lm2", "lb1", "lb2", "tm1", "tm2", "tm3", 1808 1806 }; 1809 1807 1810 1808 static const struct mtk_eint_hw mt8196_eint_hw = {
+2 -1
drivers/pinctrl/nxp/pinctrl-s32cc.c
··· 392 392 393 393 gpio_pin->pin_id = offset; 394 394 gpio_pin->config = config; 395 + INIT_LIST_HEAD(&gpio_pin->list); 395 396 396 397 spin_lock_irqsave(&ipctl->gpio_configs_lock, flags); 397 398 list_add(&gpio_pin->list, &ipctl->gpio_configs); ··· 952 951 spin_lock_init(&ipctl->gpio_configs_lock); 953 952 954 953 s32_pinctrl_desc = 955 - devm_kmalloc(&pdev->dev, sizeof(*s32_pinctrl_desc), GFP_KERNEL); 954 + devm_kzalloc(&pdev->dev, sizeof(*s32_pinctrl_desc), GFP_KERNEL); 956 955 if (!s32_pinctrl_desc) 957 956 return -ENOMEM; 958 957
+1 -1
drivers/pinctrl/qcom/pinctrl-msm.c
··· 189 189 */ 190 190 if (d && i != gpio_func && 191 191 !test_and_set_bit(d->hwirq, pctrl->disabled_for_mux)) 192 - disable_irq(irq); 192 + disable_irq_nosync(irq); 193 193 194 194 raw_spin_lock_irqsave(&pctrl->lock, flags); 195 195
+1
drivers/pinctrl/realtek/Kconfig
··· 6 6 default y 7 7 select PINMUX 8 8 select GENERIC_PINCONF 9 + select REGMAP_MMIO 9 10 10 11 config PINCTRL_RTD1619B 11 12 tristate "Realtek DHC 1619B pin controller driver"
+1
drivers/platform/x86/Kconfig
··· 545 545 config MSI_WMI_PLATFORM 546 546 tristate "MSI WMI Platform features" 547 547 depends on ACPI_WMI 548 + depends on DMI 548 549 depends on HWMON 549 550 help 550 551 Say Y here if you want to have support for WMI-based platform features
+4
drivers/platform/x86/acer-wmi.c
··· 102 102 103 103 enum acer_wmi_event_ids { 104 104 WMID_HOTKEY_EVENT = 0x1, 105 + WMID_BACKLIGHT_EVENT = 0x4, 105 106 WMID_ACCEL_OR_KBD_DOCK_EVENT = 0x5, 106 107 WMID_GAMING_TURBO_KEY_EVENT = 0x7, 107 108 WMID_AC_EVENT = 0x8, ··· 2369 2368 } 2370 2369 sparse_keymap_report_event(acer_wmi_input_dev, scancode, 1, true); 2371 2370 } 2371 + break; 2372 + case WMID_BACKLIGHT_EVENT: 2373 + /* Already handled by acpi-video */ 2372 2374 break; 2373 2375 case WMID_ACCEL_OR_KBD_DOCK_EVENT: 2374 2376 acer_gsensor_event();
+25
drivers/platform/x86/amd/pmc/pmc-quirks.c
··· 122 122 DMI_MATCH(DMI_PRODUCT_NAME, "21A1"), 123 123 } 124 124 }, 125 + { 126 + .ident = "ROG Xbox Ally RC73YA", 127 + .driver_data = &quirk_spurious_8042, 128 + .matches = { 129 + DMI_MATCH(DMI_BOARD_VENDOR, "ASUSTeK COMPUTER INC."), 130 + DMI_MATCH(DMI_BOARD_NAME, "RC73YA"), 131 + } 132 + }, 125 133 /* https://bugzilla.kernel.org/show_bug.cgi?id=218024 */ 126 134 { 127 135 .ident = "V14 G4 AMN", ··· 210 202 .matches = { 211 203 DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 212 204 DMI_MATCH(DMI_PRODUCT_NAME, "82ND"), 205 + } 206 + }, 207 + /* https://gitlab.freedesktop.org/drm/amd/-/issues/4618 */ 208 + { 209 + .ident = "Lenovo Legion Go 2", 210 + .driver_data = &quirk_s2idle_bug, 211 + .matches = { 212 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 213 + DMI_MATCH(DMI_PRODUCT_NAME, "83N0"), 214 + } 215 + }, 216 + { 217 + .ident = "Lenovo Legion Go 2", 218 + .driver_data = &quirk_s2idle_bug, 219 + .matches = { 220 + DMI_MATCH(DMI_BOARD_VENDOR, "LENOVO"), 221 + DMI_MATCH(DMI_PRODUCT_NAME, "83N1"), 213 222 } 214 223 }, 215 224 /* https://gitlab.freedesktop.org/drm/amd/-/issues/2684 */
+3
drivers/platform/x86/amd/pmc/pmc.c
··· 106 106 switch (dev->cpu_id) { 107 107 case AMD_CPU_ID_PCO: 108 108 case AMD_CPU_ID_RN: 109 + case AMD_CPU_ID_VG: 109 110 case AMD_CPU_ID_YC: 110 111 case AMD_CPU_ID_CB: 111 112 dev->num_ips = 12; ··· 518 517 case AMD_CPU_ID_PCO: 519 518 return MSG_OS_HINT_PCO; 520 519 case AMD_CPU_ID_RN: 520 + case AMD_CPU_ID_VG: 521 521 case AMD_CPU_ID_YC: 522 522 case AMD_CPU_ID_CB: 523 523 case AMD_CPU_ID_PS: ··· 719 717 { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_RV) }, 720 718 { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_SP) }, 721 719 { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_SHP) }, 720 + { PCI_DEVICE(PCI_VENDOR_ID_AMD, AMD_CPU_ID_VG) }, 722 721 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M20H_ROOT) }, 723 722 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_1AH_M60H_ROOT) }, 724 723 { }
+1
drivers/platform/x86/amd/pmc/pmc.h
··· 156 156 #define AMD_CPU_ID_RN 0x1630 157 157 #define AMD_CPU_ID_PCO AMD_CPU_ID_RV 158 158 #define AMD_CPU_ID_CZN AMD_CPU_ID_RN 159 + #define AMD_CPU_ID_VG 0x1645 159 160 #define AMD_CPU_ID_YC 0x14B5 160 161 #define AMD_CPU_ID_CB 0x14D8 161 162 #define AMD_CPU_ID_PS 0x14E8
+28 -84
drivers/platform/x86/dell/alienware-wmi-wmax.c
··· 90 90 91 91 static const struct dmi_system_id awcc_dmi_table[] __initconst = { 92 92 { 93 + .ident = "Alienware 16 Aurora", 94 + .matches = { 95 + DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 96 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware 16 Aurora"), 97 + }, 98 + .driver_data = &g_series_quirks, 99 + }, 100 + { 93 101 .ident = "Alienware Area-51m", 94 102 .matches = { 95 103 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), ··· 106 98 .driver_data = &generic_quirks, 107 99 }, 108 100 { 109 - .ident = "Alienware Area-51m R2", 101 + .ident = "Alienware m15", 110 102 .matches = { 111 103 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 112 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware Area-51m R2"), 104 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m15"), 113 105 }, 114 106 .driver_data = &generic_quirks, 115 107 }, 116 108 { 117 - .ident = "Alienware m15 R5", 109 + .ident = "Alienware m16 R1 AMD", 118 110 .matches = { 119 111 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 120 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m15 R5"), 121 - }, 122 - .driver_data = &generic_quirks, 123 - }, 124 - { 125 - .ident = "Alienware m15 R7", 126 - .matches = { 127 - DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 128 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m15 R7"), 112 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m16 R1 AMD"), 129 113 }, 130 114 .driver_data = &generic_quirks, 131 115 }, ··· 130 130 .driver_data = &g_series_quirks, 131 131 }, 132 132 { 133 - .ident = "Alienware m16 R1 AMD", 134 - .matches = { 135 - DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 136 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m16 R1 AMD"), 137 - }, 138 - .driver_data = &generic_quirks, 139 - }, 140 - { 141 133 .ident = "Alienware m16 R2", 142 134 .matches = { 143 135 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), ··· 138 146 .driver_data = &generic_quirks, 139 147 }, 140 148 { 141 - .ident = "Alienware m17 R5", 149 + .ident = "Alienware m17", 142 150 .matches = { 143 151 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 144 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17 R5 AMD"), 152 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m17"), 145 153 }, 146 154 .driver_data = &generic_quirks, 147 155 }, 148 156 { 149 - .ident = "Alienware m18 R2", 157 + .ident = "Alienware m18", 150 158 .matches = { 151 159 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 152 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18 R2"), 160 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware m18"), 153 161 }, 154 162 .driver_data = &generic_quirks, 155 163 }, 156 164 { 157 - .ident = "Alienware x15 R1", 165 + .ident = "Alienware x15", 158 166 .matches = { 159 167 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 160 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15 R1"), 168 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15"), 161 169 }, 162 170 .driver_data = &generic_quirks, 163 171 }, 164 172 { 165 - .ident = "Alienware x15 R2", 173 + .ident = "Alienware x17", 166 174 .matches = { 167 175 DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 168 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x15 R2"), 176 + DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x17"), 169 177 }, 170 178 .driver_data = &generic_quirks, 171 179 }, 172 180 { 173 - .ident = "Alienware x17 R2", 174 - .matches = { 175 - DMI_MATCH(DMI_SYS_VENDOR, "Alienware"), 176 - DMI_MATCH(DMI_PRODUCT_NAME, "Alienware x17 R2"), 177 - }, 178 - .driver_data = &generic_quirks, 179 - }, 180 - { 181 - .ident = "Dell Inc. G15 5510", 181 + .ident = "Dell Inc. G15", 182 182 .matches = { 183 183 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 184 - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5510"), 184 + DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15"), 185 185 }, 186 186 .driver_data = &g_series_quirks, 187 187 }, 188 188 { 189 - .ident = "Dell Inc. G15 5511", 189 + .ident = "Dell Inc. G16", 190 190 .matches = { 191 191 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 192 - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5511"), 192 + DMI_MATCH(DMI_PRODUCT_NAME, "Dell G16"), 193 193 }, 194 194 .driver_data = &g_series_quirks, 195 195 }, 196 196 { 197 - .ident = "Dell Inc. G15 5515", 197 + .ident = "Dell Inc. G3", 198 198 .matches = { 199 199 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 200 - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5515"), 200 + DMI_MATCH(DMI_PRODUCT_NAME, "G3"), 201 201 }, 202 202 .driver_data = &g_series_quirks, 203 203 }, 204 204 { 205 - .ident = "Dell Inc. G15 5530", 205 + .ident = "Dell Inc. G5", 206 206 .matches = { 207 207 DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 208 - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G15 5530"), 209 - }, 210 - .driver_data = &g_series_quirks, 211 - }, 212 - { 213 - .ident = "Dell Inc. G16 7630", 214 - .matches = { 215 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 216 - DMI_MATCH(DMI_PRODUCT_NAME, "Dell G16 7630"), 217 - }, 218 - .driver_data = &g_series_quirks, 219 - }, 220 - { 221 - .ident = "Dell Inc. G3 3500", 222 - .matches = { 223 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 224 - DMI_MATCH(DMI_PRODUCT_NAME, "G3 3500"), 225 - }, 226 - .driver_data = &g_series_quirks, 227 - }, 228 - { 229 - .ident = "Dell Inc. G3 3590", 230 - .matches = { 231 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 232 - DMI_MATCH(DMI_PRODUCT_NAME, "G3 3590"), 233 - }, 234 - .driver_data = &g_series_quirks, 235 - }, 236 - { 237 - .ident = "Dell Inc. G5 5500", 238 - .matches = { 239 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 240 - DMI_MATCH(DMI_PRODUCT_NAME, "G5 5500"), 241 - }, 242 - .driver_data = &g_series_quirks, 243 - }, 244 - { 245 - .ident = "Dell Inc. G5 5505", 246 - .matches = { 247 - DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), 248 - DMI_MATCH(DMI_PRODUCT_NAME, "G5 5505"), 208 + DMI_MATCH(DMI_PRODUCT_NAME, "G5"), 249 209 }, 250 210 .driver_data = &g_series_quirks, 251 211 },
+4 -2
drivers/platform/x86/hp/hp-wmi.c
··· 92 92 "8A25" 93 93 }; 94 94 95 - /* DMI Board names of Victus 16-r1000 and Victus 16-s1000 laptops */ 95 + /* DMI Board names of Victus 16-r and Victus 16-s laptops */ 96 96 static const char * const victus_s_thermal_profile_boards[] = { 97 - "8C99", "8C9C" 97 + "8BBE", "8BD4", "8BD5", 98 + "8C78", "8C99", "8C9C", 99 + "8D41", 98 100 }; 99 101 100 102 enum hp_wmi_radio {
+4
drivers/platform/x86/huawei-wmi.c
··· 81 81 { KE_KEY, 0x289, { KEY_WLAN } }, 82 82 // Huawei |M| key 83 83 { KE_KEY, 0x28a, { KEY_CONFIG } }, 84 + // HONOR YOYO key 85 + { KE_KEY, 0x28b, { KEY_NOTIFICATION_CENTER } }, 86 + // HONOR print screen 87 + { KE_KEY, 0x28e, { KEY_PRINT } }, 84 88 // Keyboard backlit 85 89 { KE_IGNORE, 0x293, { KEY_KBDILLUMTOGGLE } }, 86 90 { KE_IGNORE, 0x294, { KEY_KBDILLUMUP } },
+1
drivers/platform/x86/intel/hid.c
··· 55 55 { "INTC10CB" }, 56 56 { "INTC10CC" }, 57 57 { "INTC10F1" }, 58 + { "INTC10F2" }, 58 59 { } 59 60 }; 60 61 MODULE_DEVICE_TABLE(acpi, intel_hid_ids);
+2 -2
drivers/platform/x86/intel/speed_select_if/isst_if_mmio.c
··· 108 108 109 109 ret = pci_read_config_dword(pdev, 0xD0, &mmio_base); 110 110 if (ret) 111 - return ret; 111 + return pcibios_err_to_errno(ret); 112 112 113 113 ret = pci_read_config_dword(pdev, 0xFC, &pcu_base); 114 114 if (ret) 115 - return ret; 115 + return pcibios_err_to_errno(ret); 116 116 117 117 pcu_base &= GENMASK(10, 0); 118 118 base_addr = (u64)mmio_base << 23 | (u64) pcu_base << 12;
+5 -4
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h
··· 40 40 * @agent_type_mask: Bit mask of all hardware agents for this domain 41 41 * @uncore_attr_group: Attribute group storage 42 42 * @max_freq_khz_kobj_attr: Storage for kobject attribute max_freq_khz 43 - * @mix_freq_khz_kobj_attr: Storage for kobject attribute min_freq_khz 43 + * @min_freq_khz_kobj_attr: Storage for kobject attribute min_freq_khz 44 44 * @initial_max_freq_khz_kobj_attr: Storage for kobject attribute initial_max_freq_khz 45 45 * @initial_min_freq_khz_kobj_attr: Storage for kobject attribute initial_min_freq_khz 46 46 * @current_freq_khz_kobj_attr: Storage for kobject attribute current_freq_khz ··· 48 48 * @fabric_cluster_id_kobj_attr: Storage for kobject attribute fabric_cluster_id 49 49 * @package_id_kobj_attr: Storage for kobject attribute package_id 50 50 * @elc_low_threshold_percent_kobj_attr: 51 - Storage for kobject attribute elc_low_threshold_percent 51 + * Storage for kobject attribute elc_low_threshold_percent 52 52 * @elc_high_threshold_percent_kobj_attr: 53 - Storage for kobject attribute elc_high_threshold_percent 53 + * Storage for kobject attribute elc_high_threshold_percent 54 54 * @elc_high_threshold_enable_kobj_attr: 55 - Storage for kobject attribute elc_high_threshold_enable 55 + * Storage for kobject attribute elc_high_threshold_enable 56 56 * @elc_floor_freq_khz_kobj_attr: Storage for kobject attribute elc_floor_freq_khz 57 57 * @agent_types_kobj_attr: Storage for kobject attribute agent_type 58 + * @die_id_kobj_attr: Attribute storage for die_id information 58 59 * @uncore_attrs: Attribute storage for group creation 59 60 * 60 61 * This structure is used to encapsulate all data related to uncore sysfs
+4
drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c
··· 256 256 X86_MATCH_VFM(INTEL_ARROWLAKE, NULL), 257 257 X86_MATCH_VFM(INTEL_ARROWLAKE_H, NULL), 258 258 X86_MATCH_VFM(INTEL_LUNARLAKE_M, NULL), 259 + X86_MATCH_VFM(INTEL_PANTHERLAKE_L, NULL), 260 + X86_MATCH_VFM(INTEL_WILDCATLAKE_L, NULL), 261 + X86_MATCH_VFM(INTEL_NOVALAKE, NULL), 262 + X86_MATCH_VFM(INTEL_NOVALAKE_L, NULL), 259 263 {} 260 264 }; 261 265 MODULE_DEVICE_TABLE(x86cpu, intel_uncore_cpu_ids);
+41 -2
drivers/platform/x86/msi-wmi-platform.c
··· 14 14 #include <linux/debugfs.h> 15 15 #include <linux/device.h> 16 16 #include <linux/device/driver.h> 17 + #include <linux/dmi.h> 17 18 #include <linux/errno.h> 18 19 #include <linux/hwmon.h> 19 20 #include <linux/kernel.h> ··· 29 28 30 29 #define DRIVER_NAME "msi-wmi-platform" 31 30 32 - #define MSI_PLATFORM_GUID "ABBC0F6E-8EA1-11d1-00A0-C90629100000" 31 + #define MSI_PLATFORM_GUID "ABBC0F6E-8EA1-11D1-00A0-C90629100000" 33 32 34 33 #define MSI_WMI_PLATFORM_INTERFACE_VERSION 2 35 34 ··· 449 448 .probe = msi_wmi_platform_probe, 450 449 .no_singleton = true, 451 450 }; 452 - module_wmi_driver(msi_wmi_platform_driver); 451 + 452 + /* 453 + * MSI reused the WMI GUID from the WMI-ACPI sample code provided by Microsoft, 454 + * so other manufacturers might use it as well for their WMI-ACPI implementations. 455 + */ 456 + static const struct dmi_system_id msi_wmi_platform_whitelist[] __initconst = { 457 + { 458 + .matches = { 459 + DMI_MATCH(DMI_SYS_VENDOR, "MICRO-STAR INT"), 460 + }, 461 + }, 462 + { 463 + .matches = { 464 + DMI_MATCH(DMI_SYS_VENDOR, "Micro-Star International"), 465 + }, 466 + }, 467 + { } 468 + }; 469 + 470 + static int __init msi_wmi_platform_module_init(void) 471 + { 472 + if (!dmi_check_system(msi_wmi_platform_whitelist)) { 473 + if (!force) 474 + return -ENODEV; 475 + 476 + pr_warn("Ignoring DMI whitelist\n"); 477 + } 478 + 479 + return wmi_driver_register(&msi_wmi_platform_driver); 480 + } 481 + 482 + static void __exit msi_wmi_platform_module_exit(void) 483 + { 484 + wmi_driver_unregister(&msi_wmi_platform_driver); 485 + } 486 + 487 + module_init(msi_wmi_platform_module_init); 488 + module_exit(msi_wmi_platform_module_exit); 489 + 453 490 454 491 MODULE_AUTHOR("Armin Wolf <W_Armin@gmx.de>"); 455 492 MODULE_DESCRIPTION("MSI WMI platform features");
+2 -2
drivers/pwm/pwm-adp5585.c
··· 190 190 return 0; 191 191 } 192 192 193 - static const struct adp5585_pwm_chip adp5589_pwm_chip_info = { 193 + static const struct adp5585_pwm_chip adp5585_pwm_chip_info = { 194 194 .pwm_cfg = ADP5585_PWM_CFG, 195 195 .pwm_offt_low = ADP5585_PWM_OFFT_LOW, 196 196 .pwm_ont_low = ADP5585_PWM_ONT_LOW, 197 197 }; 198 198 199 - static const struct adp5585_pwm_chip adp5585_pwm_chip_info = { 199 + static const struct adp5585_pwm_chip adp5589_pwm_chip_info = { 200 200 .pwm_cfg = ADP5589_PWM_CFG, 201 201 .pwm_offt_low = ADP5589_PWM_OFFT_LOW, 202 202 .pwm_ont_low = ADP5589_PWM_ONT_LOW,
+2 -2
drivers/reset/reset-imx8mp-audiomix.c
··· 14 14 #include <linux/reset-controller.h> 15 15 16 16 #define IMX8MP_AUDIOMIX_EARC_RESET_OFFSET 0x200 17 - #define IMX8MP_AUDIOMIX_EARC_RESET_MASK BIT(1) 18 - #define IMX8MP_AUDIOMIX_EARC_PHY_RESET_MASK BIT(2) 17 + #define IMX8MP_AUDIOMIX_EARC_RESET_MASK BIT(0) 18 + #define IMX8MP_AUDIOMIX_EARC_PHY_RESET_MASK BIT(1) 19 19 20 20 #define IMX8MP_AUDIOMIX_DSP_RUNSTALL_OFFSET 0x108 21 21 #define IMX8MP_AUDIOMIX_DSP_RUNSTALL_MASK BIT(5)
-1
drivers/s390/net/ctcm_mpc.c
··· 701 701 702 702 grp->sweep_req_pend_num--; 703 703 ctcmpc_send_sweep_resp(ch); 704 - kfree(mpcginfo); 705 704 return; 706 705 } 707 706
+9 -1
drivers/scsi/sg.c
··· 2208 2208 write_lock_irqsave(&sfp->rq_list_lock, iflags); 2209 2209 while (!list_empty(&sfp->rq_list)) { 2210 2210 srp = list_first_entry(&sfp->rq_list, Sg_request, entry); 2211 - sg_finish_rem_req(srp); 2212 2211 list_del(&srp->entry); 2212 + write_unlock_irqrestore(&sfp->rq_list_lock, iflags); 2213 + 2214 + sg_finish_rem_req(srp); 2215 + /* 2216 + * sg_rq_end_io() uses srp->parentfp. Hence, only clear 2217 + * srp->parentfp after blk_mq_free_request() has been called. 2218 + */ 2213 2219 srp->parentfp = NULL; 2220 + 2221 + write_lock_irqsave(&sfp->rq_list_lock, iflags); 2214 2222 } 2215 2223 write_unlock_irqrestore(&sfp->rq_list_lock, iflags); 2216 2224
+3
drivers/target/loopback/tcm_loop.c
··· 894 894 struct tcm_loop_tpg, tl_se_tpg); 895 895 struct tcm_loop_hba *tl_hba = tl_tpg->tl_hba; 896 896 897 + if (!tl_hba->sh) 898 + return -ENODEV; 899 + 897 900 return snprintf(page, PAGE_SIZE, "%d:0:%d\n", 898 901 tl_hba->sh->host_no, tl_tpg->tl_tpgt); 899 902 }
+66 -12
fs/afs/cell.c
··· 229 229 * @name: The name of the cell. 230 230 * @namesz: The strlen of the cell name. 231 231 * @vllist: A colon/comma separated list of numeric IP addresses or NULL. 232 - * @excl: T if an error should be given if the cell name already exists. 232 + * @reason: The reason we're doing the lookup 233 233 * @trace: The reason to be logged if the lookup is successful. 234 234 * 235 235 * Look up a cell record by name and query the DNS for VL server addresses if ··· 239 239 */ 240 240 struct afs_cell *afs_lookup_cell(struct afs_net *net, 241 241 const char *name, unsigned int namesz, 242 - const char *vllist, bool excl, 242 + const char *vllist, 243 + enum afs_lookup_cell_for reason, 243 244 enum afs_cell_trace trace) 244 245 { 245 246 struct afs_cell *cell, *candidate, *cursor; ··· 248 247 enum afs_cell_state state; 249 248 int ret, n; 250 249 251 - _enter("%s,%s", name, vllist); 250 + _enter("%s,%s,%u", name, vllist, reason); 252 251 253 - if (!excl) { 252 + if (reason != AFS_LOOKUP_CELL_PRELOAD) { 254 253 cell = afs_find_cell(net, name, namesz, trace); 255 - if (!IS_ERR(cell)) 254 + if (!IS_ERR(cell)) { 255 + if (reason == AFS_LOOKUP_CELL_DYNROOT) 256 + goto no_wait; 257 + if (cell->state == AFS_CELL_SETTING_UP || 258 + cell->state == AFS_CELL_UNLOOKED) 259 + goto lookup_cell; 256 260 goto wait_for_cell; 261 + } 257 262 } 258 263 259 264 /* Assume we're probably going to create a cell and preallocate and ··· 305 298 rb_insert_color(&cell->net_node, &net->cells); 306 299 up_write(&net->cells_lock); 307 300 308 - afs_queue_cell(cell, afs_cell_trace_queue_new); 301 + lookup_cell: 302 + if (reason != AFS_LOOKUP_CELL_PRELOAD && 303 + reason != AFS_LOOKUP_CELL_ROOTCELL) { 304 + set_bit(AFS_CELL_FL_DO_LOOKUP, &cell->flags); 305 + afs_queue_cell(cell, afs_cell_trace_queue_new); 306 + } 309 307 310 308 wait_for_cell: 311 - _debug("wait_for_cell"); 312 309 state = smp_load_acquire(&cell->state); /* vs error */ 313 - if (state != AFS_CELL_ACTIVE && 314 - state != AFS_CELL_DEAD) { 310 + switch (state) { 311 + case AFS_CELL_ACTIVE: 312 + case AFS_CELL_DEAD: 313 + break; 314 + case AFS_CELL_UNLOOKED: 315 + default: 316 + if (reason == AFS_LOOKUP_CELL_PRELOAD || 317 + reason == AFS_LOOKUP_CELL_ROOTCELL) 318 + break; 319 + _debug("wait_for_cell"); 315 320 afs_see_cell(cell, afs_cell_trace_wait); 316 321 wait_var_event(&cell->state, 317 322 ({ 318 323 state = smp_load_acquire(&cell->state); /* vs error */ 319 324 state == AFS_CELL_ACTIVE || state == AFS_CELL_DEAD; 320 325 })); 326 + _debug("waited_for_cell %d %d", cell->state, cell->error); 321 327 } 322 328 329 + no_wait: 323 330 /* Check the state obtained from the wait check. */ 331 + state = smp_load_acquire(&cell->state); /* vs error */ 324 332 if (state == AFS_CELL_DEAD) { 325 333 ret = cell->error; 326 334 goto error; 335 + } 336 + if (state == AFS_CELL_ACTIVE) { 337 + switch (cell->dns_status) { 338 + case DNS_LOOKUP_NOT_DONE: 339 + if (cell->dns_source == DNS_RECORD_FROM_CONFIG) { 340 + ret = 0; 341 + break; 342 + } 343 + fallthrough; 344 + default: 345 + ret = -EIO; 346 + goto error; 347 + case DNS_LOOKUP_GOOD: 348 + case DNS_LOOKUP_GOOD_WITH_BAD: 349 + ret = 0; 350 + break; 351 + case DNS_LOOKUP_GOT_NOT_FOUND: 352 + ret = -ENOENT; 353 + goto error; 354 + case DNS_LOOKUP_BAD: 355 + ret = -EREMOTEIO; 356 + goto error; 357 + case DNS_LOOKUP_GOT_LOCAL_FAILURE: 358 + case DNS_LOOKUP_GOT_TEMP_FAILURE: 359 + case DNS_LOOKUP_GOT_NS_FAILURE: 360 + ret = -EDESTADDRREQ; 361 + goto error; 362 + } 327 363 } 328 364 329 365 _leave(" = %p [cell]", cell); ··· 375 325 cell_already_exists: 376 326 _debug("cell exists"); 377 327 cell = cursor; 378 - if (excl) { 328 + if (reason == AFS_LOOKUP_CELL_PRELOAD) { 379 329 ret = -EEXIST; 380 330 } else { 381 331 afs_use_cell(cursor, trace); ··· 434 384 return -EINVAL; 435 385 436 386 /* allocate a cell record for the root/workstation cell */ 437 - new_root = afs_lookup_cell(net, rootcell, len, vllist, false, 387 + new_root = afs_lookup_cell(net, rootcell, len, vllist, 388 + AFS_LOOKUP_CELL_ROOTCELL, 438 389 afs_cell_trace_use_lookup_ws); 439 390 if (IS_ERR(new_root)) { 440 391 _leave(" = %ld", PTR_ERR(new_root)); ··· 828 777 switch (cell->state) { 829 778 case AFS_CELL_SETTING_UP: 830 779 goto set_up_cell; 780 + case AFS_CELL_UNLOOKED: 831 781 case AFS_CELL_ACTIVE: 832 782 goto cell_is_active; 833 783 case AFS_CELL_REMOVING: ··· 849 797 goto remove_cell; 850 798 } 851 799 852 - afs_set_cell_state(cell, AFS_CELL_ACTIVE); 800 + afs_set_cell_state(cell, AFS_CELL_UNLOOKED); 853 801 854 802 cell_is_active: 855 803 if (afs_has_cell_expired(cell, &next_manage)) ··· 859 807 ret = afs_update_cell(cell); 860 808 if (ret < 0) 861 809 cell->error = ret; 810 + if (cell->state == AFS_CELL_UNLOOKED) 811 + afs_set_cell_state(cell, AFS_CELL_ACTIVE); 862 812 } 863 813 864 814 if (next_manage < TIME64_MAX && cell->net->live) {
+2 -1
fs/afs/dynroot.c
··· 108 108 dotted = true; 109 109 } 110 110 111 - cell = afs_lookup_cell(net, name, len, NULL, false, 111 + cell = afs_lookup_cell(net, name, len, NULL, 112 + AFS_LOOKUP_CELL_DYNROOT, 112 113 afs_cell_trace_use_lookup_dynroot); 113 114 if (IS_ERR(cell)) { 114 115 ret = PTR_ERR(cell);
+11 -1
fs/afs/internal.h
··· 343 343 344 344 enum afs_cell_state { 345 345 AFS_CELL_SETTING_UP, 346 + AFS_CELL_UNLOOKED, 346 347 AFS_CELL_ACTIVE, 347 348 AFS_CELL_REMOVING, 348 349 AFS_CELL_DEAD, ··· 1050 1049 extern int afs_cell_init(struct afs_net *, const char *); 1051 1050 extern struct afs_cell *afs_find_cell(struct afs_net *, const char *, unsigned, 1052 1051 enum afs_cell_trace); 1052 + enum afs_lookup_cell_for { 1053 + AFS_LOOKUP_CELL_DYNROOT, 1054 + AFS_LOOKUP_CELL_MOUNTPOINT, 1055 + AFS_LOOKUP_CELL_DIRECT_MOUNT, 1056 + AFS_LOOKUP_CELL_PRELOAD, 1057 + AFS_LOOKUP_CELL_ROOTCELL, 1058 + AFS_LOOKUP_CELL_ALIAS_CHECK, 1059 + }; 1053 1060 struct afs_cell *afs_lookup_cell(struct afs_net *net, 1054 1061 const char *name, unsigned int namesz, 1055 - const char *vllist, bool excl, 1062 + const char *vllist, 1063 + enum afs_lookup_cell_for reason, 1056 1064 enum afs_cell_trace trace); 1057 1065 extern struct afs_cell *afs_use_cell(struct afs_cell *, enum afs_cell_trace); 1058 1066 void afs_unuse_cell(struct afs_cell *cell, enum afs_cell_trace reason);
+2 -1
fs/afs/mntpt.c
··· 107 107 if (size > AFS_MAXCELLNAME) 108 108 return -ENAMETOOLONG; 109 109 110 - cell = afs_lookup_cell(ctx->net, p, size, NULL, false, 110 + cell = afs_lookup_cell(ctx->net, p, size, NULL, 111 + AFS_LOOKUP_CELL_MOUNTPOINT, 111 112 afs_cell_trace_use_lookup_mntpt); 112 113 if (IS_ERR(cell)) { 113 114 pr_err("kAFS: unable to lookup cell '%pd'\n", mntpt);
+2 -1
fs/afs/proc.c
··· 122 122 if (strcmp(buf, "add") == 0) { 123 123 struct afs_cell *cell; 124 124 125 - cell = afs_lookup_cell(net, name, strlen(name), args, true, 125 + cell = afs_lookup_cell(net, name, strlen(name), args, 126 + AFS_LOOKUP_CELL_PRELOAD, 126 127 afs_cell_trace_use_lookup_add); 127 128 if (IS_ERR(cell)) { 128 129 ret = PTR_ERR(cell);
+1 -1
fs/afs/super.c
··· 290 290 /* lookup the cell record */ 291 291 if (cellname) { 292 292 cell = afs_lookup_cell(ctx->net, cellname, cellnamesz, 293 - NULL, false, 293 + NULL, AFS_LOOKUP_CELL_DIRECT_MOUNT, 294 294 afs_cell_trace_use_lookup_mount); 295 295 if (IS_ERR(cell)) { 296 296 pr_err("kAFS: unable to lookup cell '%*.*s'\n",
+2 -1
fs/afs/vl_alias.c
··· 269 269 if (!name_len || name_len > AFS_MAXCELLNAME) 270 270 master = ERR_PTR(-EOPNOTSUPP); 271 271 else 272 - master = afs_lookup_cell(cell->net, cell_name, name_len, NULL, false, 272 + master = afs_lookup_cell(cell->net, cell_name, name_len, NULL, 273 + AFS_LOOKUP_CELL_ALIAS_CHECK, 273 274 afs_cell_trace_use_lookup_canonical); 274 275 kfree(cell_name); 275 276 if (IS_ERR(master))
+18 -1
fs/bfs/inode.c
··· 61 61 off = (ino - BFS_ROOT_INO) % BFS_INODES_PER_BLOCK; 62 62 di = (struct bfs_inode *)bh->b_data + off; 63 63 64 - inode->i_mode = 0x0000FFFF & le32_to_cpu(di->i_mode); 64 + /* 65 + * https://martin.hinner.info/fs/bfs/bfs-structure.html explains that 66 + * BFS in SCO UnixWare environment used only lower 9 bits of di->i_mode 67 + * value. This means that, although bfs_write_inode() saves whole 68 + * inode->i_mode bits (which include S_IFMT bits and S_IS{UID,GID,VTX} 69 + * bits), middle 7 bits of di->i_mode value can be garbage when these 70 + * bits were not saved by bfs_write_inode(). 71 + * Since we can't tell whether middle 7 bits are garbage, use only 72 + * lower 12 bits (i.e. tolerate S_IS{UID,GID,VTX} bits possibly being 73 + * garbage) and reconstruct S_IFMT bits for Linux environment from 74 + * di->i_vtype value. 75 + */ 76 + inode->i_mode = 0x00000FFF & le32_to_cpu(di->i_mode); 65 77 if (le32_to_cpu(di->i_vtype) == BFS_VDIR) { 66 78 inode->i_mode |= S_IFDIR; 67 79 inode->i_op = &bfs_dir_inops; ··· 83 71 inode->i_op = &bfs_file_inops; 84 72 inode->i_fop = &bfs_file_operations; 85 73 inode->i_mapping->a_ops = &bfs_aops; 74 + } else { 75 + brelse(bh); 76 + printf("Unknown vtype=%u %s:%08lx\n", 77 + le32_to_cpu(di->i_vtype), inode->i_sb->s_id, ino); 78 + goto error; 86 79 } 87 80 88 81 BFS_I(inode)->i_sblock = le32_to_cpu(di->i_sblock);
+3 -1
fs/binfmt_misc.c
··· 837 837 inode_unlock(d_inode(root)); 838 838 839 839 if (err) { 840 - if (f) 840 + if (f) { 841 + exe_file_allow_write_access(f); 841 842 filp_close(f, NULL); 843 + } 842 844 kfree(e); 843 845 return err; 844 846 }
+1
fs/efivarfs/super.c
··· 533 533 .init_fs_context = efivarfs_init_fs_context, 534 534 .kill_sb = efivarfs_kill_sb, 535 535 .parameters = efivarfs_parameters, 536 + .fs_flags = FS_POWER_FREEZE, 536 537 }; 537 538 538 539 static __init int efivarfs_init(void)
+4 -1
fs/exfat/super.c
··· 433 433 struct exfat_sb_info *sbi = EXFAT_SB(sb); 434 434 435 435 /* set block size to read super block */ 436 - sb_min_blocksize(sb, 512); 436 + if (!sb_min_blocksize(sb, 512)) { 437 + exfat_err(sb, "unable to set blocksize"); 438 + return -EINVAL; 439 + } 437 440 438 441 /* read boot sector */ 439 442 sbi->boot_bh = sb_bread(sb, 0);
+5 -1
fs/fat/inode.c
··· 1595 1595 1596 1596 setup(sb); /* flavour-specific stuff that needs options */ 1597 1597 1598 + error = -EINVAL; 1599 + if (!sb_min_blocksize(sb, 512)) { 1600 + fat_msg(sb, KERN_ERR, "unable to set blocksize"); 1601 + goto out_fail; 1602 + } 1598 1603 error = -EIO; 1599 - sb_min_blocksize(sb, 512); 1600 1604 bh = sb_bread(sb, 0); 1601 1605 if (bh == NULL) { 1602 1606 fat_msg(sb, KERN_ERR, "unable to read boot sector");
+1 -1
fs/fuse/virtio_fs.c
··· 373 373 374 374 sprintf(buff, "%d", i); 375 375 fsvq->kobj = kobject_create_and_add(buff, fs->mqs_kobj); 376 - if (!fs->mqs_kobj) { 376 + if (!fsvq->kobj) { 377 377 ret = -ENOMEM; 378 378 goto out_del; 379 379 }
+18 -11
fs/hostfs/hostfs_kern.c
··· 979 979 { 980 980 struct hostfs_fs_info *fsi = fc->s_fs_info; 981 981 struct fs_parse_result result; 982 - char *host_root; 982 + char *host_root, *tmp_root; 983 983 int opt; 984 984 985 985 opt = fs_parse(fc, hostfs_param_specs, param, &result); ··· 990 990 case Opt_hostfs: 991 991 host_root = param->string; 992 992 if (!*host_root) 993 - host_root = ""; 994 - fsi->host_root_path = 995 - kasprintf(GFP_KERNEL, "%s/%s", root_ino, host_root); 996 - if (fsi->host_root_path == NULL) 993 + break; 994 + tmp_root = kasprintf(GFP_KERNEL, "%s%s", 995 + fsi->host_root_path, host_root); 996 + if (!tmp_root) 997 997 return -ENOMEM; 998 + kfree(fsi->host_root_path); 999 + fsi->host_root_path = tmp_root; 998 1000 break; 999 1001 } 1000 1002 ··· 1006 1004 static int hostfs_parse_monolithic(struct fs_context *fc, void *data) 1007 1005 { 1008 1006 struct hostfs_fs_info *fsi = fc->s_fs_info; 1009 - char *host_root = (char *)data; 1007 + char *tmp_root, *host_root = (char *)data; 1010 1008 1011 1009 /* NULL is printed as '(null)' by printf(): avoid that. */ 1012 1010 if (host_root == NULL) 1013 - host_root = ""; 1011 + return 0; 1014 1012 1015 - fsi->host_root_path = 1016 - kasprintf(GFP_KERNEL, "%s/%s", root_ino, host_root); 1017 - if (fsi->host_root_path == NULL) 1013 + tmp_root = kasprintf(GFP_KERNEL, "%s%s", fsi->host_root_path, host_root); 1014 + if (!tmp_root) 1018 1015 return -ENOMEM; 1019 - 1016 + kfree(fsi->host_root_path); 1017 + fsi->host_root_path = tmp_root; 1020 1018 return 0; 1021 1019 } 1022 1020 ··· 1051 1049 if (!fsi) 1052 1050 return -ENOMEM; 1053 1051 1052 + fsi->host_root_path = kasprintf(GFP_KERNEL, "%s/", root_ino); 1053 + if (!fsi->host_root_path) { 1054 + kfree(fsi); 1055 + return -ENOMEM; 1056 + } 1054 1057 fc->s_fs_info = fsi; 1055 1058 fc->ops = &hostfs_context_ops; 1056 1059 return 0;
+12
fs/inode.c
··· 1967 1967 } 1968 1968 EXPORT_SYMBOL(iput); 1969 1969 1970 + /** 1971 + * iput_not_last - put an inode assuming this is not the last reference 1972 + * @inode: inode to put 1973 + */ 1974 + void iput_not_last(struct inode *inode) 1975 + { 1976 + VFS_BUG_ON_INODE(atomic_read(&inode->i_count) < 2, inode); 1977 + 1978 + WARN_ON(atomic_sub_return(1, &inode->i_count) == 0); 1979 + } 1980 + EXPORT_SYMBOL(iput_not_last); 1981 + 1970 1982 #ifdef CONFIG_BLOCK 1971 1983 /** 1972 1984 * bmap - find a block number in a file
+5
fs/isofs/inode.c
··· 610 610 goto out_freesbi; 611 611 } 612 612 opt->blocksize = sb_min_blocksize(s, opt->blocksize); 613 + if (!opt->blocksize) { 614 + printk(KERN_ERR 615 + "ISOFS: unable to set blocksize\n"); 616 + goto out_freesbi; 617 + } 613 618 614 619 sbi->s_high_sierra = 0; /* default is iso9660 */ 615 620 sbi->s_session = opt->session;
+18 -28
fs/namespace.c
··· 132 132 */ 133 133 __cacheline_aligned_in_smp DEFINE_SEQLOCK(mount_lock); 134 134 135 - static inline struct mnt_namespace *node_to_mnt_ns(const struct rb_node *node) 136 - { 137 - struct ns_common *ns; 138 - 139 - if (!node) 140 - return NULL; 141 - ns = rb_entry(node, struct ns_common, ns_tree_node); 142 - return container_of(ns, struct mnt_namespace, ns); 143 - } 144 - 145 135 static void mnt_ns_release(struct mnt_namespace *ns) 146 136 { 147 137 /* keep alive for {list,stat}mount() */ ··· 141 151 kfree(ns); 142 152 } 143 153 } 144 - DEFINE_FREE(mnt_ns_release, struct mnt_namespace *, if (_T) mnt_ns_release(_T)) 154 + DEFINE_FREE(mnt_ns_release, struct mnt_namespace *, 155 + if (!IS_ERR(_T)) mnt_ns_release(_T)) 145 156 146 157 static void mnt_ns_release_rcu(struct rcu_head *rcu) 147 158 { ··· 5445 5454 ret = statmount_sb_source(s, seq); 5446 5455 break; 5447 5456 case STATMOUNT_MNT_UIDMAP: 5448 - sm->mnt_uidmap = start; 5457 + offp = &sm->mnt_uidmap; 5449 5458 ret = statmount_mnt_uidmap(s, seq); 5450 5459 break; 5451 5460 case STATMOUNT_MNT_GIDMAP: 5452 - sm->mnt_gidmap = start; 5461 + offp = &sm->mnt_gidmap; 5453 5462 ret = statmount_mnt_gidmap(s, seq); 5454 5463 break; 5455 5464 default: ··· 5727 5736 ret = copy_struct_from_user(kreq, sizeof(*kreq), req, usize); 5728 5737 if (ret) 5729 5738 return ret; 5730 - if (kreq->spare != 0) 5739 + if (kreq->mnt_ns_fd != 0 && kreq->mnt_ns_id) 5731 5740 return -EINVAL; 5732 5741 /* The first valid unique mount id is MNT_UNIQUE_ID_OFFSET + 1. */ 5733 5742 if (kreq->mnt_id <= MNT_UNIQUE_ID_OFFSET) ··· 5744 5753 { 5745 5754 struct mnt_namespace *mnt_ns; 5746 5755 5747 - if (kreq->mnt_ns_id && kreq->spare) 5748 - return ERR_PTR(-EINVAL); 5749 - 5750 - if (kreq->mnt_ns_id) 5751 - return lookup_mnt_ns(kreq->mnt_ns_id); 5752 - 5753 - if (kreq->spare) { 5756 + if (kreq->mnt_ns_id) { 5757 + mnt_ns = lookup_mnt_ns(kreq->mnt_ns_id); 5758 + } else if (kreq->mnt_ns_fd) { 5754 5759 struct ns_common *ns; 5755 5760 5756 - CLASS(fd, f)(kreq->spare); 5761 + CLASS(fd, f)(kreq->mnt_ns_fd); 5757 5762 if (fd_empty(f)) 5758 5763 return ERR_PTR(-EBADF); 5759 5764 ··· 5764 5777 } else { 5765 5778 mnt_ns = current->nsproxy->mnt_ns; 5766 5779 } 5780 + if (!mnt_ns) 5781 + return ERR_PTR(-ENOENT); 5767 5782 5768 5783 refcount_inc(&mnt_ns->passive); 5769 5784 return mnt_ns; ··· 5790 5801 return ret; 5791 5802 5792 5803 ns = grab_requested_mnt_ns(&kreq); 5793 - if (!ns) 5794 - return -ENOENT; 5804 + if (IS_ERR(ns)) 5805 + return PTR_ERR(ns); 5795 5806 5796 5807 if (kreq.mnt_ns_id && (ns != current->nsproxy->mnt_ns) && 5797 5808 !ns_capable_noaudit(ns->user_ns, CAP_SYS_ADMIN)) ··· 5901 5912 static inline int prepare_klistmount(struct klistmount *kls, struct mnt_id_req *kreq, 5902 5913 size_t nr_mnt_ids) 5903 5914 { 5904 - 5905 5915 u64 last_mnt_id = kreq->param; 5916 + struct mnt_namespace *ns; 5906 5917 5907 5918 /* The first valid unique mount id is MNT_UNIQUE_ID_OFFSET + 1. */ 5908 5919 if (last_mnt_id != 0 && last_mnt_id <= MNT_UNIQUE_ID_OFFSET) ··· 5916 5927 if (!kls->kmnt_ids) 5917 5928 return -ENOMEM; 5918 5929 5919 - kls->ns = grab_requested_mnt_ns(kreq); 5920 - if (!kls->ns) 5921 - return -ENOENT; 5930 + ns = grab_requested_mnt_ns(kreq); 5931 + if (IS_ERR(ns)) 5932 + return PTR_ERR(ns); 5933 + kls->ns = ns; 5922 5934 5923 5935 kls->mnt_parent_id = kreq->mnt_id; 5924 5936 return 0;
+38 -3
fs/smb/client/cached_dir.c
··· 16 16 static void free_cached_dir(struct cached_fid *cfid); 17 17 static void smb2_close_cached_fid(struct kref *ref); 18 18 static void cfids_laundromat_worker(struct work_struct *work); 19 + static void close_cached_dir_locked(struct cached_fid *cfid); 19 20 20 21 struct cached_dir_dentry { 21 22 struct list_head entry; ··· 389 388 * lease. Release one here, and the second below. 390 389 */ 391 390 cfid->has_lease = false; 392 - close_cached_dir(cfid); 391 + close_cached_dir_locked(cfid); 393 392 } 394 393 spin_unlock(&cfids->cfid_list_lock); 395 394 ··· 481 480 spin_lock(&cfid->cfids->cfid_list_lock); 482 481 if (cfid->has_lease) { 483 482 cfid->has_lease = false; 484 - close_cached_dir(cfid); 483 + close_cached_dir_locked(cfid); 485 484 } 486 485 spin_unlock(&cfid->cfids->cfid_list_lock); 487 486 close_cached_dir(cfid); 488 487 } 489 488 490 - 489 + /** 490 + * close_cached_dir - drop a reference of a cached dir 491 + * 492 + * The release function will be called with cfid_list_lock held to remove the 493 + * cached dirs from the list before any other thread can take another @cfid 494 + * ref. Must not be called with cfid_list_lock held; use 495 + * close_cached_dir_locked() called instead. 496 + * 497 + * @cfid: cached dir 498 + */ 491 499 void close_cached_dir(struct cached_fid *cfid) 492 500 { 501 + lockdep_assert_not_held(&cfid->cfids->cfid_list_lock); 493 502 kref_put_lock(&cfid->refcount, smb2_close_cached_fid, &cfid->cfids->cfid_list_lock); 503 + } 504 + 505 + /** 506 + * close_cached_dir_locked - put a reference of a cached dir with 507 + * cfid_list_lock held 508 + * 509 + * Calling close_cached_dir() with cfid_list_lock held has the potential effect 510 + * of causing a deadlock if the invariant of refcount >= 2 is false. 511 + * 512 + * This function is used in paths that hold cfid_list_lock and expect at least 513 + * two references. If that invariant is violated, WARNs and returns without 514 + * dropping a reference; the final put must still go through 515 + * close_cached_dir(). 516 + * 517 + * @cfid: cached dir 518 + */ 519 + static void close_cached_dir_locked(struct cached_fid *cfid) 520 + { 521 + lockdep_assert_held(&cfid->cfids->cfid_list_lock); 522 + 523 + if (WARN_ON(kref_read(&cfid->refcount) < 2)) 524 + return; 525 + 526 + kref_put(&cfid->refcount, smb2_close_cached_fid); 494 527 } 495 528 496 529 /*
+22
fs/smb/client/cifssmb.c
··· 1363 1363 if (rdata->result == -ENODATA) { 1364 1364 rdata->result = 0; 1365 1365 __set_bit(NETFS_SREQ_HIT_EOF, &rdata->subreq.flags); 1366 + trace_smb3_read_err(rdata->rreq->debug_id, 1367 + rdata->subreq.debug_index, 1368 + rdata->xid, 1369 + rdata->req->cfile->fid.persistent_fid, 1370 + tcon->tid, tcon->ses->Suid, 1371 + rdata->subreq.start + rdata->subreq.transferred, 1372 + rdata->subreq.len - rdata->subreq.transferred, 1373 + rdata->result); 1366 1374 } else { 1367 1375 size_t trans = rdata->subreq.transferred + rdata->got_bytes; 1368 1376 if (trans < rdata->subreq.len && ··· 1382 1374 } 1383 1375 if (rdata->got_bytes) 1384 1376 __set_bit(NETFS_SREQ_MADE_PROGRESS, &rdata->subreq.flags); 1377 + trace_smb3_read_done(rdata->rreq->debug_id, 1378 + rdata->subreq.debug_index, 1379 + rdata->xid, 1380 + rdata->req->cfile->fid.persistent_fid, 1381 + tcon->tid, tcon->ses->Suid, 1382 + rdata->subreq.start + rdata->subreq.transferred, 1383 + rdata->got_bytes); 1385 1384 } 1386 1385 1387 1386 trace_smb3_rw_credits(rreq_debug_id, subreq_debug_index, rdata->credits.value, ··· 1459 1444 rdata->iov[0].iov_len = 4; 1460 1445 rdata->iov[1].iov_base = (char *)smb + 4; 1461 1446 rdata->iov[1].iov_len = get_rfc1002_length(smb); 1447 + 1448 + trace_smb3_read_enter(rdata->rreq->debug_id, 1449 + rdata->subreq.debug_index, 1450 + rdata->xid, 1451 + rdata->req->cfile->fid.netfid, 1452 + tcon->tid, tcon->ses->Suid, 1453 + rdata->subreq.start, rdata->subreq.len); 1462 1454 1463 1455 rc = cifs_call_async(tcon->ses->server, &rqst, cifs_readv_receive, 1464 1456 cifs_readv_callback, NULL, rdata, 0, NULL);
+4
fs/smb/client/fs_context.c
··· 1834 1834 ctx->password = NULL; 1835 1835 kfree_sensitive(ctx->password2); 1836 1836 ctx->password2 = NULL; 1837 + kfree(ctx->source); 1838 + ctx->source = NULL; 1839 + kfree(fc->source); 1840 + fc->source = NULL; 1837 1841 return -EINVAL; 1838 1842 } 1839 1843
+10 -3
fs/super.c
··· 1183 1183 1184 1184 static const char *filesystems_freeze_ptr = "filesystems_freeze"; 1185 1185 1186 - static void filesystems_freeze_callback(struct super_block *sb, void *unused) 1186 + static void filesystems_freeze_callback(struct super_block *sb, void *freeze_all_ptr) 1187 1187 { 1188 1188 if (!sb->s_op->freeze_fs && !sb->s_op->freeze_super) 1189 + return; 1190 + 1191 + if (freeze_all_ptr && !(sb->s_type->fs_flags & FS_POWER_FREEZE)) 1189 1192 return; 1190 1193 1191 1194 if (!get_active_super(sb)) ··· 1204 1201 deactivate_super(sb); 1205 1202 } 1206 1203 1207 - void filesystems_freeze(void) 1204 + void filesystems_freeze(bool freeze_all) 1208 1205 { 1209 - __iterate_supers(filesystems_freeze_callback, NULL, 1206 + void *freeze_all_ptr = NULL; 1207 + 1208 + if (freeze_all) 1209 + freeze_all_ptr = &freeze_all; 1210 + __iterate_supers(filesystems_freeze_callback, freeze_all_ptr, 1210 1211 SUPER_ITER_UNLOCKED | SUPER_ITER_REVERSE); 1211 1212 } 1212 1213
+4 -1
fs/xfs/xfs_super.c
··· 1693 1693 if (error) 1694 1694 return error; 1695 1695 1696 - sb_min_blocksize(sb, BBSIZE); 1696 + if (!sb_min_blocksize(sb, BBSIZE)) { 1697 + xfs_err(mp, "unable to set blocksize"); 1698 + return -EINVAL; 1699 + } 1697 1700 sb->s_xattr = xfs_xattr_handlers; 1698 1701 sb->s_export_op = &xfs_export_operations; 1699 1702 #ifdef CONFIG_XFS_QUOTA
+4 -1
include/drm/intel/pciids.h
··· 877 877 MACRO__(0xB08F, ## __VA_ARGS__), \ 878 878 MACRO__(0xB090, ## __VA_ARGS__), \ 879 879 MACRO__(0xB0A0, ## __VA_ARGS__), \ 880 - MACRO__(0xB0B0, ## __VA_ARGS__), \ 880 + MACRO__(0xB0B0, ## __VA_ARGS__) 881 + 882 + /* WCL */ 883 + #define INTEL_WCL_IDS(MACRO__, ...) \ 881 884 MACRO__(0xFD80, ## __VA_ARGS__), \ 882 885 MACRO__(0xFD81, ## __VA_ARGS__) 883 886
+1
include/linux/ata.h
··· 566 566 #define ata_id_has_ncq(id) ((id)[ATA_ID_SATA_CAPABILITY] & (1 << 8)) 567 567 #define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) 568 568 #define ata_id_removable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) 569 + #define ata_id_is_locked(id) (((id)[ATA_ID_DLF] & 0x7) == 0x7) 569 570 #define ata_id_has_atapi_AN(id) \ 570 571 ((((id)[ATA_ID_SATA_CAPABILITY] != 0x0000) && \ 571 572 ((id)[ATA_ID_SATA_CAPABILITY] != 0xffff)) && \
+5 -3
include/linux/fs.h
··· 2689 2689 #define FS_ALLOW_IDMAP 32 /* FS has been updated to handle vfs idmappings. */ 2690 2690 #define FS_MGTIME 64 /* FS uses multigrain timestamps */ 2691 2691 #define FS_LBS 128 /* FS supports LBS */ 2692 + #define FS_POWER_FREEZE 256 /* Always freeze on suspend/hibernate */ 2692 2693 #define FS_RENAME_DOES_D_MOVE 32768 /* FS will handle d_move() during rename() internally. */ 2693 2694 int (*init_fs_context)(struct fs_context *); 2694 2695 const struct fs_parameter_spec *parameters; ··· 2824 2823 2825 2824 extern void ihold(struct inode * inode); 2826 2825 extern void iput(struct inode *); 2826 + void iput_not_last(struct inode *); 2827 2827 int inode_update_timestamps(struct inode *inode, int flags); 2828 2828 int generic_update_time(struct inode *, int); 2829 2829 ··· 3425 3423 extern void inode_sb_list_add(struct inode *inode); 3426 3424 extern void inode_add_lru(struct inode *inode); 3427 3425 3428 - extern int sb_set_blocksize(struct super_block *, int); 3429 - extern int sb_min_blocksize(struct super_block *, int); 3426 + int sb_set_blocksize(struct super_block *sb, int size); 3427 + int __must_check sb_min_blocksize(struct super_block *sb, int size); 3430 3428 3431 3429 int generic_file_mmap(struct file *, struct vm_area_struct *); 3432 3430 int generic_file_mmap_prepare(struct vm_area_desc *desc); ··· 3608 3606 extern void iterate_supers(void (*f)(struct super_block *, void *), void *arg); 3609 3607 extern void iterate_supers_type(struct file_system_type *, 3610 3608 void (*)(struct super_block *, void *), void *); 3611 - void filesystems_freeze(void); 3609 + void filesystems_freeze(bool freeze_all); 3612 3610 void filesystems_thaw(void); 3613 3611 3614 3612 extern int dcache_dir_open(struct inode *, struct file *);
+4 -2
include/linux/highmem.h
··· 249 249 kunmap_local(kaddr); 250 250 } 251 251 252 - #ifndef __HAVE_ARCH_TAG_CLEAR_HIGHPAGE 252 + #ifndef __HAVE_ARCH_TAG_CLEAR_HIGHPAGES 253 253 254 - static inline void tag_clear_highpage(struct page *page) 254 + /* Return false to let people know we did not initialize the pages */ 255 + static inline bool tag_clear_highpages(struct page *page, int numpages) 255 256 { 257 + return false; 256 258 } 257 259 258 260 #endif
+2 -1
include/net/xfrm.h
··· 536 536 537 537 static inline const struct xfrm_mode *xfrm_ip2inner_mode(struct xfrm_state *x, int ipproto) 538 538 { 539 - if ((ipproto == IPPROTO_IPIP && x->props.family == AF_INET) || 539 + if ((x->sel.family != AF_UNSPEC) || 540 + (ipproto == IPPROTO_IPIP && x->props.family == AF_INET) || 540 541 (ipproto == IPPROTO_IPV6 && x->props.family == AF_INET6)) 541 542 return &x->inner_mode; 542 543 else
+1 -1
include/uapi/linux/input-event-codes.h
··· 27 27 #define INPUT_PROP_TOPBUTTONPAD 0x04 /* softbuttons at top of pad */ 28 28 #define INPUT_PROP_POINTING_STICK 0x05 /* is a pointing stick */ 29 29 #define INPUT_PROP_ACCELEROMETER 0x06 /* has accelerometer */ 30 - #define INPUT_PROP_HAPTIC_TOUCHPAD 0x07 /* is a haptic touchpad */ 30 + #define INPUT_PROP_PRESSUREPAD 0x07 /* pressure triggers clicks */ 31 31 32 32 #define INPUT_PROP_MAX 0x1f 33 33 #define INPUT_PROP_CNT (INPUT_PROP_MAX + 1)
+27 -23
include/uapi/linux/isst_if.h
··· 52 52 /** 53 53 * struct isst_if_cpu_maps - structure for CPU map IOCTL 54 54 * @cmd_count: Number of CPU mapping command in cpu_map[] 55 - * @cpu_map[]: Holds one or more CPU map data structure 55 + * @cpu_map: Holds one or more CPU map data structure 56 56 * 57 57 * This structure used with ioctl ISST_IF_GET_PHY_ID to send 58 58 * one or more CPU mapping commands. Here IOCTL return value indicates ··· 82 82 83 83 /** 84 84 * struct isst_if_io_regs - structure for IO register commands 85 - * @cmd_count: Number of io reg commands in io_reg[] 86 - * @io_reg[]: Holds one or more io_reg command structure 85 + * @req_count: Number of io reg commands in io_reg[] 86 + * @io_reg: Holds one or more io_reg command structure 87 87 * 88 88 * This structure used with ioctl ISST_IF_IO_CMD to send 89 89 * one or more read/write commands to PUNIT. Here IOCTL return value ··· 120 120 /** 121 121 * struct isst_if_mbox_cmds - structure for mailbox commands 122 122 * @cmd_count: Number of mailbox commands in mbox_cmd[] 123 - * @mbox_cmd[]: Holds one or more mbox commands 123 + * @mbox_cmd: Holds one or more mbox commands 124 124 * 125 125 * This structure used with ioctl ISST_IF_MBOX_COMMAND to send 126 126 * one or more mailbox commands to PUNIT. Here IOCTL return value ··· 152 152 /** 153 153 * struct isst_if_msr_cmds - structure for msr commands 154 154 * @cmd_count: Number of mailbox commands in msr_cmd[] 155 - * @msr_cmd[]: Holds one or more msr commands 155 + * @msr_cmd: Holds one or more msr commands 156 156 * 157 157 * This structure used with ioctl ISST_IF_MSR_COMMAND to send 158 158 * one or more MSR commands. IOCTL return value indicates number of ··· 167 167 * struct isst_core_power - Structure to get/set core_power feature 168 168 * @get_set: 0: Get, 1: Set 169 169 * @socket_id: Socket/package id 170 - * @power_domain: Power Domain id 170 + * @power_domain_id: Power Domain id 171 171 * @enable: Feature enable status 172 + * @supported: Power domain supports SST_CP interface 172 173 * @priority_type: Priority type for the feature (ordered/proportional) 173 174 * 174 175 * Structure to get/set core_power feature state using IOCTL ··· 188 187 * struct isst_clos_param - Structure to get/set clos praram 189 188 * @get_set: 0: Get, 1: Set 190 189 * @socket_id: Socket/package id 191 - * @power_domain: Power Domain id 192 - * clos: Clos ID for the parameters 193 - * min_freq_mhz: Minimum frequency in MHz 194 - * max_freq_mhz: Maximum frequency in MHz 195 - * prop_prio: Proportional priority from 0-15 190 + * @power_domain_id: Power Domain id 191 + * @clos: Clos ID for the parameters 192 + * @min_freq_mhz: Minimum frequency in MHz 193 + * @max_freq_mhz: Maximum frequency in MHz 194 + * @prop_prio: Proportional priority from 0-15 196 195 * 197 196 * Structure to get/set per clos property using IOCTL 198 197 * ISST_IF_CLOS_PARAM. ··· 210 209 /** 211 210 * struct isst_if_clos_assoc - Structure to assign clos to a CPU 212 211 * @socket_id: Socket/package id 213 - * @power_domain: Power Domain id 212 + * @power_domain_id: Power Domain id 214 213 * @logical_cpu: CPU number 215 214 * @clos: Clos ID to assign to the logical CPU 216 215 * ··· 229 228 * @get_set: Request is for get or set 230 229 * @punit_cpu_map: Set to 1 if the CPU number is punit numbering not 231 230 * Linux CPU number 231 + * @assoc_info: CLOS data for this CPU 232 232 * 233 233 * Structure used to get/set associate CPUs to clos using IOCTL 234 234 * ISST_IF_CLOS_ASSOC. ··· 259 257 /** 260 258 * struct isst_perf_level_info - Structure to get information on SST-PP levels 261 259 * @socket_id: Socket/package id 262 - * @power_domain: Power Domain id 260 + * @power_domain_id: Power Domain id 263 261 * @logical_cpu: CPU number 264 262 * @clos: Clos ID to assign to the logical CPU 265 263 * @max_level: Maximum performance level supported by the platform ··· 269 267 * @feature_state: SST-BF and SST-TF (enabled/disabled) status at current level 270 268 * @locked: SST-PP performance level change is locked/unlocked 271 269 * @enabled: SST-PP feature is enabled or not 272 - * @sst-tf_support: SST-TF support status at this level 273 - * @sst-bf_support: SST-BF support status at this level 270 + * @sst_tf_support: SST-TF support status at this level 271 + * @sst_bf_support: SST-BF support status at this level 274 272 * 275 273 * Structure to get SST-PP details using IOCTL ISST_IF_PERF_LEVELS. 276 274 */ ··· 291 289 /** 292 290 * struct isst_perf_level_control - Structure to set SST-PP level 293 291 * @socket_id: Socket/package id 294 - * @power_domain: Power Domain id 292 + * @power_domain_id: Power Domain id 295 293 * @level: level to set 296 294 * 297 295 * Structure used change SST-PP level using IOCTL ISST_IF_PERF_SET_LEVEL. ··· 305 303 /** 306 304 * struct isst_perf_feature_control - Structure to activate SST-BF/SST-TF 307 305 * @socket_id: Socket/package id 308 - * @power_domain: Power Domain id 306 + * @power_domain_id: Power Domain id 309 307 * @feature: bit 0 = SST-BF state, bit 1 = SST-TF state 310 308 * 311 309 * Structure used to enable SST-BF/SST-TF using IOCTL ISST_IF_PERF_SET_FEATURE. ··· 322 320 /** 323 321 * struct isst_perf_level_data_info - Structure to get SST-PP level details 324 322 * @socket_id: Socket/package id 325 - * @power_domain: Power Domain id 323 + * @power_domain_id: Power Domain id 326 324 * @level: SST-PP level for which caller wants to get information 327 325 * @tdp_ratio: TDP Ratio 328 326 * @base_freq_mhz: Base frequency in MHz ··· 343 341 * @pm_fabric_freq_mhz: Fabric (Uncore) minimum frequency 344 342 * @max_buckets: Maximum trl buckets 345 343 * @max_trl_levels: Maximum trl levels 346 - * @bucket_core_counts[TRL_MAX_BUCKETS]: Number of cores per bucket 347 - * @trl_freq_mhz[TRL_MAX_LEVELS][TRL_MAX_BUCKETS]: maximum frequency 344 + * @bucket_core_counts: Number of cores per bucket 345 + * @trl_freq_mhz: maximum frequency 348 346 * for a bucket and trl level 349 347 * 350 348 * Structure used to get information on frequencies and TDP for a SST-PP ··· 404 402 /** 405 403 * struct isst_perf_level_cpu_mask - Structure to get SST-PP level CPU mask 406 404 * @socket_id: Socket/package id 407 - * @power_domain: Power Domain id 405 + * @power_domain_id: Power Domain id 408 406 * @level: SST-PP level for which caller wants to get information 409 407 * @punit_cpu_map: Set to 1 if the CPU number is punit numbering not 410 408 * Linux CPU number. If 0 CPU buffer is copied to user space ··· 432 430 /** 433 431 * struct isst_base_freq_info - Structure to get SST-BF frequencies 434 432 * @socket_id: Socket/package id 435 - * @power_domain: Power Domain id 433 + * @power_domain_id: Power Domain id 436 434 * @level: SST-PP level for which caller wants to get information 437 435 * @high_base_freq_mhz: High priority CPU base frequency 438 436 * @low_base_freq_mhz: Low priority CPU base frequency ··· 455 453 /** 456 454 * struct isst_turbo_freq_info - Structure to get SST-TF frequencies 457 455 * @socket_id: Socket/package id 458 - * @power_domain: Power Domain id 456 + * @power_domain_id: Power Domain id 459 457 * @level: SST-PP level for which caller wants to get information 460 458 * @max_clip_freqs: Maximum number of low priority core clipping frequencies 459 + * @max_buckets: Maximum trl buckets 460 + * @max_trl_levels: Maximum trl levels 461 461 * @lp_clip_freq_mhz: Clip frequencies per trl level 462 462 * @bucket_core_counts: Maximum number of cores for a bucket 463 463 * @trl_freq_mhz: Frequencies per trl level for each bucket
+1 -1
include/uapi/linux/mount.h
··· 197 197 */ 198 198 struct mnt_id_req { 199 199 __u32 size; 200 - __u32 spare; 200 + __u32 mnt_ns_fd; 201 201 __u64 mnt_id; 202 202 __u64 param; 203 203 __u64 mnt_ns_id;
+14 -9
include/uapi/linux/tee.h
··· 249 249 * @cancel_id: [in] Cancellation id, a unique value to identify this request 250 250 * @session: [out] Session id 251 251 * @ret: [out] return value 252 - * @ret_origin [out] origin of the return value 253 - * @num_params [in] number of parameters following this struct 252 + * @ret_origin: [out] origin of the return value 253 + * @num_params: [in] number of &struct tee_ioctl_param entries in @params 254 + * @params: array of ioctl parameters 254 255 */ 255 256 struct tee_ioctl_open_session_arg { 256 257 __u8 uuid[TEE_IOCTL_UUID_LEN]; ··· 277 276 struct tee_ioctl_buf_data) 278 277 279 278 /** 280 - * struct tee_ioctl_invoke_func_arg - Invokes a function in a Trusted 281 - * Application 279 + * struct tee_ioctl_invoke_arg - Invokes a function in a Trusted Application 282 280 * @func: [in] Trusted Application function, specific to the TA 283 281 * @session: [in] Session id 284 282 * @cancel_id: [in] Cancellation id, a unique value to identify this request 285 283 * @ret: [out] return value 286 - * @ret_origin [out] origin of the return value 287 - * @num_params [in] number of parameters following this struct 284 + * @ret_origin: [out] origin of the return value 285 + * @num_params: [in] number of parameters following this struct 286 + * @params: array of ioctl parameters 288 287 */ 289 288 struct tee_ioctl_invoke_arg { 290 289 __u32 func; ··· 339 338 /** 340 339 * struct tee_iocl_supp_recv_arg - Receive a request for a supplicant function 341 340 * @func: [in] supplicant function 342 - * @num_params [in/out] number of parameters following this struct 341 + * @num_params: [in/out] number of &struct tee_ioctl_param entries in @params 342 + * @params: array of ioctl parameters 343 343 * 344 344 * @num_params is the number of params that tee-supplicant has room to 345 345 * receive when input, @num_params is the number of actual params ··· 365 363 /** 366 364 * struct tee_iocl_supp_send_arg - Send a response to a received request 367 365 * @ret: [out] return value 368 - * @num_params [in] number of parameters following this struct 366 + * @num_params: [in] number of &struct tee_ioctl_param entries in @params 367 + * @params: array of ioctl parameters 369 368 */ 370 369 struct tee_iocl_supp_send_arg { 371 370 __u32 ret; ··· 457 454 */ 458 455 459 456 /** 460 - * struct tee_ioctl_invoke_func_arg - Invokes an object in a Trusted Application 457 + * struct tee_ioctl_object_invoke_arg - Invokes an object in a 458 + * Trusted Application 461 459 * @id: [in] Object id 462 460 * @op: [in] Object operation, specific to the object 463 461 * @ret: [out] return value 464 462 * @num_params: [in] number of parameters following this struct 463 + * @params: array of ioctl parameters 465 464 */ 466 465 struct tee_ioctl_object_invoke_arg { 467 466 __u64 id;
+1 -1
io_uring/cmd_net.c
··· 127 127 128 128 if (!unlikely(skb_queue_empty(&list))) { 129 129 scoped_guard(spinlock_irqsave, &q->lock) 130 - skb_queue_splice(q, &list); 130 + skb_queue_splice(&list, q); 131 131 } 132 132 return -EAGAIN; 133 133 }
+1 -1
kernel/events/core.c
··· 11901 11901 11902 11902 static void cpu_clock_event_del(struct perf_event *event, int flags) 11903 11903 { 11904 - cpu_clock_event_stop(event, flags); 11904 + cpu_clock_event_stop(event, PERF_EF_UPDATE); 11905 11905 } 11906 11906 11907 11907 static void cpu_clock_event_read(struct perf_event *event)
+3 -6
kernel/power/hibernate.c
··· 821 821 goto Restore; 822 822 823 823 ksys_sync_helper(); 824 - if (filesystem_freeze_enabled) 825 - filesystems_freeze(); 824 + filesystems_freeze(filesystem_freeze_enabled); 826 825 827 826 error = freeze_processes(); 828 827 if (error) ··· 927 928 if (error) 928 929 goto restore; 929 930 930 - if (filesystem_freeze_enabled) 931 - filesystems_freeze(); 931 + filesystems_freeze(filesystem_freeze_enabled); 932 932 933 933 error = freeze_processes(); 934 934 if (error) ··· 1077 1079 if (error) 1078 1080 goto Restore; 1079 1081 1080 - if (filesystem_freeze_enabled) 1081 - filesystems_freeze(); 1082 + filesystems_freeze(filesystem_freeze_enabled); 1082 1083 1083 1084 pm_pr_dbg("Preparing processes for hibernation restore.\n"); 1084 1085 error = freeze_processes();
+1 -2
kernel/power/suspend.c
··· 375 375 if (error) 376 376 goto Restore; 377 377 378 - if (filesystem_freeze_enabled) 379 - filesystems_freeze(); 378 + filesystems_freeze(filesystem_freeze_enabled); 380 379 trace_suspend_resume(TPS("freeze_processes"), 0, true); 381 380 error = suspend_freeze_processes(); 382 381 trace_suspend_resume(TPS("freeze_processes"), 0, false);
+17 -14
kernel/sched/ext.c
··· 25 25 * guarantee system safety. Maintain a dedicated task list which contains every 26 26 * task between its fork and eventual free. 27 27 */ 28 - static DEFINE_SPINLOCK(scx_tasks_lock); 28 + static DEFINE_RAW_SPINLOCK(scx_tasks_lock); 29 29 static LIST_HEAD(scx_tasks); 30 30 31 31 /* ops enable/disable */ ··· 476 476 BUILD_BUG_ON(__SCX_DSQ_ITER_ALL_FLAGS & 477 477 ((1U << __SCX_DSQ_LNODE_PRIV_SHIFT) - 1)); 478 478 479 - spin_lock_irq(&scx_tasks_lock); 479 + raw_spin_lock_irq(&scx_tasks_lock); 480 480 481 481 iter->cursor = (struct sched_ext_entity){ .flags = SCX_TASK_CURSOR }; 482 482 list_add(&iter->cursor.tasks_node, &scx_tasks); ··· 507 507 __scx_task_iter_rq_unlock(iter); 508 508 if (iter->list_locked) { 509 509 iter->list_locked = false; 510 - spin_unlock_irq(&scx_tasks_lock); 510 + raw_spin_unlock_irq(&scx_tasks_lock); 511 511 } 512 512 } 513 513 514 514 static void __scx_task_iter_maybe_relock(struct scx_task_iter *iter) 515 515 { 516 516 if (!iter->list_locked) { 517 - spin_lock_irq(&scx_tasks_lock); 517 + raw_spin_lock_irq(&scx_tasks_lock); 518 518 iter->list_locked = true; 519 519 } 520 520 } ··· 2940 2940 } 2941 2941 } 2942 2942 2943 - spin_lock_irq(&scx_tasks_lock); 2943 + raw_spin_lock_irq(&scx_tasks_lock); 2944 2944 list_add_tail(&p->scx.tasks_node, &scx_tasks); 2945 - spin_unlock_irq(&scx_tasks_lock); 2945 + raw_spin_unlock_irq(&scx_tasks_lock); 2946 2946 2947 2947 percpu_up_read(&scx_fork_rwsem); 2948 2948 } ··· 2966 2966 { 2967 2967 unsigned long flags; 2968 2968 2969 - spin_lock_irqsave(&scx_tasks_lock, flags); 2969 + raw_spin_lock_irqsave(&scx_tasks_lock, flags); 2970 2970 list_del_init(&p->scx.tasks_node); 2971 - spin_unlock_irqrestore(&scx_tasks_lock, flags); 2971 + raw_spin_unlock_irqrestore(&scx_tasks_lock, flags); 2972 2972 2973 2973 /* 2974 2974 * @p is off scx_tasks and wholly ours. scx_enable()'s READY -> ENABLED ··· 4276 4276 size_t avail, used; 4277 4277 bool idle; 4278 4278 4279 - rq_lock(rq, &rf); 4279 + rq_lock_irqsave(rq, &rf); 4280 4280 4281 4281 idle = list_empty(&rq->scx.runnable_list) && 4282 4282 rq->curr->sched_class == &idle_sched_class; ··· 4345 4345 list_for_each_entry(p, &rq->scx.runnable_list, scx.runnable_node) 4346 4346 scx_dump_task(&s, &dctx, p, ' '); 4347 4347 next: 4348 - rq_unlock(rq, &rf); 4348 + rq_unlock_irqrestore(rq, &rf); 4349 4349 } 4350 4350 4351 4351 dump_newline(&s); ··· 4479 4479 goto err_free_gdsqs; 4480 4480 4481 4481 sch->helper = kthread_run_worker(0, "sched_ext_helper"); 4482 - if (!sch->helper) 4482 + if (IS_ERR(sch->helper)) { 4483 + ret = PTR_ERR(sch->helper); 4483 4484 goto err_free_pcpu; 4485 + } 4486 + 4484 4487 sched_set_fifo(sch->helper->task); 4485 4488 4486 4489 atomic_set(&sch->exit_kind, SCX_EXIT_NONE); ··· 5324 5321 BUG_ON(!zalloc_cpumask_var_node(&rq->scx.cpus_to_kick_if_idle, GFP_KERNEL, n)); 5325 5322 BUG_ON(!zalloc_cpumask_var_node(&rq->scx.cpus_to_preempt, GFP_KERNEL, n)); 5326 5323 BUG_ON(!zalloc_cpumask_var_node(&rq->scx.cpus_to_wait, GFP_KERNEL, n)); 5327 - init_irq_work(&rq->scx.deferred_irq_work, deferred_irq_workfn); 5328 - init_irq_work(&rq->scx.kick_cpus_irq_work, kick_cpus_irq_workfn); 5324 + rq->scx.deferred_irq_work = IRQ_WORK_INIT_HARD(deferred_irq_workfn); 5325 + rq->scx.kick_cpus_irq_work = IRQ_WORK_INIT_HARD(kick_cpus_irq_workfn); 5329 5326 5330 5327 if (cpu_online(cpu)) 5331 5328 cpu_rq(cpu)->scx.flags |= SCX_RQ_ONLINE; ··· 6404 6401 6405 6402 guard(rcu)(); 6406 6403 6407 - sch = rcu_dereference(sch); 6404 + sch = rcu_dereference(scx_root); 6408 6405 if (unlikely(!sch)) 6409 6406 return; 6410 6407
+5 -6
kernel/time/tick-sched.c
··· 1152 1152 return false; 1153 1153 } 1154 1154 1155 - if (ratelimit >= 10) 1156 - return false; 1157 - 1158 1155 /* On RT, softirq handling may be waiting on some lock */ 1159 1156 if (local_bh_blocked()) 1160 1157 return false; 1161 1158 1162 - pr_warn("NOHZ tick-stop error: local softirq work is pending, handler #%02x!!!\n", 1163 - pending); 1164 - ratelimit++; 1159 + if (ratelimit < 10) { 1160 + pr_warn("NOHZ tick-stop error: local softirq work is pending, handler #%02x!!!\n", 1161 + pending); 1162 + ratelimit++; 1163 + } 1165 1164 1166 1165 return true; 1167 1166 }
+12 -9
kernel/time/timekeeping.c
··· 3060 3060 static int __init tk_aux_sysfs_init(void) 3061 3061 { 3062 3062 struct kobject *auxo, *tko = kobject_create_and_add("time", kernel_kobj); 3063 + int ret = -ENOMEM; 3063 3064 3064 3065 if (!tko) 3065 - return -ENOMEM; 3066 + return ret; 3066 3067 3067 3068 auxo = kobject_create_and_add("aux_clocks", tko); 3068 - if (!auxo) { 3069 - kobject_put(tko); 3070 - return -ENOMEM; 3071 - } 3069 + if (!auxo) 3070 + goto err_clean; 3072 3071 3073 3072 for (int i = 0; i < MAX_AUX_CLOCKS; i++) { 3074 3073 char id[2] = { [0] = '0' + i, }; 3075 3074 struct kobject *clk = kobject_create_and_add(id, auxo); 3076 3075 3077 3076 if (!clk) 3078 - return -ENOMEM; 3077 + goto err_clean; 3079 3078 3080 - int ret = sysfs_create_group(clk, &aux_clock_enable_attr_group); 3081 - 3079 + ret = sysfs_create_group(clk, &aux_clock_enable_attr_group); 3082 3080 if (ret) 3083 - return ret; 3081 + goto err_clean; 3084 3082 } 3085 3083 return 0; 3084 + 3085 + err_clean: 3086 + kobject_put(auxo); 3087 + kobject_put(tko); 3088 + return ret; 3086 3089 } 3087 3090 late_initcall(tk_aux_sysfs_init); 3088 3091
+4 -3
kernel/time/timer.c
··· 1458 1458 1459 1459 base = lock_timer_base(timer, &flags); 1460 1460 1461 - if (base->running_timer != timer) 1461 + if (base->running_timer != timer) { 1462 1462 ret = detach_if_pending(timer, base, true); 1463 - if (shutdown) 1464 - timer->function = NULL; 1463 + if (shutdown) 1464 + timer->function = NULL; 1465 + } 1465 1466 1466 1467 raw_spin_unlock_irqrestore(&base->lock, flags); 1467 1468
+1
lib/crypto/tests/sha256_kunit.c
··· 68 68 rand_bytes(data1_buf, max_data_len); 69 69 rand_bytes(data2_buf, max_data_len); 70 70 rand_bytes(salt, sizeof(salt)); 71 + memset(ctx, 0, sizeof(*ctx)); 71 72 72 73 for (size_t i = 0; i < 500; i++) { 73 74 size_t salt_len = rand_length(sizeof(salt));
+2 -1
mm/memblock.c
··· 1826 1826 */ 1827 1827 unsigned long __init memblock_estimated_nr_free_pages(void) 1828 1828 { 1829 - return PHYS_PFN(memblock_phys_mem_size() - memblock_reserved_size()); 1829 + return PHYS_PFN(memblock_phys_mem_size() - 1830 + memblock_reserved_kern_size(MEMBLOCK_ALLOC_ANYWHERE, NUMA_NO_NODE)); 1830 1831 } 1831 1832 1832 1833 /* lowest address */
+26 -6
mm/mempool.c
··· 68 68 } else if (pool->free == mempool_free_pages) { 69 69 /* Mempools backed by page allocator */ 70 70 int order = (int)(long)pool->pool_data; 71 - void *addr = kmap_local_page((struct page *)element); 72 71 73 - __check_element(pool, addr, 1UL << (PAGE_SHIFT + order)); 74 - kunmap_local(addr); 72 + #ifdef CONFIG_HIGHMEM 73 + for (int i = 0; i < (1 << order); i++) { 74 + struct page *page = (struct page *)element; 75 + void *addr = kmap_local_page(page + i); 76 + 77 + __check_element(pool, addr, PAGE_SIZE); 78 + kunmap_local(addr); 79 + } 80 + #else 81 + void *addr = page_address((struct page *)element); 82 + 83 + __check_element(pool, addr, PAGE_SIZE << order); 84 + #endif 75 85 } 76 86 } 77 87 ··· 107 97 } else if (pool->alloc == mempool_alloc_pages) { 108 98 /* Mempools backed by page allocator */ 109 99 int order = (int)(long)pool->pool_data; 110 - void *addr = kmap_local_page((struct page *)element); 111 100 112 - __poison_element(addr, 1UL << (PAGE_SHIFT + order)); 113 - kunmap_local(addr); 101 + #ifdef CONFIG_HIGHMEM 102 + for (int i = 0; i < (1 << order); i++) { 103 + struct page *page = (struct page *)element; 104 + void *addr = kmap_local_page(page + i); 105 + 106 + __poison_element(addr, PAGE_SIZE); 107 + kunmap_local(addr); 108 + } 109 + #else 110 + void *addr = page_address((struct page *)element); 111 + 112 + __poison_element(addr, PAGE_SIZE << order); 113 + #endif 114 114 } 115 115 } 116 116 #else /* CONFIG_SLUB_DEBUG_ON */
+2 -7
mm/page_alloc.c
··· 1822 1822 * If memory tags should be zeroed 1823 1823 * (which happens only when memory should be initialized as well). 1824 1824 */ 1825 - if (zero_tags) { 1826 - /* Initialize both memory and memory tags. */ 1827 - for (i = 0; i != 1 << order; ++i) 1828 - tag_clear_highpage(page + i); 1825 + if (zero_tags) 1826 + init = !tag_clear_highpages(page, 1 << order); 1829 1827 1830 - /* Take note that memory was initialized by the loop above. */ 1831 - init = false; 1832 - } 1833 1828 if (!should_skip_kasan_unpoison(gfp_flags) && 1834 1829 kasan_unpoison_pages(page, order, init)) { 1835 1830 /* Take note that memory was initialized by KASAN. */
+7 -8
mm/shmem.c
··· 131 131 #define SHMEM_SEEN_INODES 2 132 132 #define SHMEM_SEEN_HUGE 4 133 133 #define SHMEM_SEEN_INUMS 8 134 - #define SHMEM_SEEN_NOSWAP 16 135 - #define SHMEM_SEEN_QUOTA 32 134 + #define SHMEM_SEEN_QUOTA 16 136 135 }; 137 136 138 137 #ifdef CONFIG_TRANSPARENT_HUGEPAGE ··· 4679 4680 "Turning off swap in unprivileged tmpfs mounts unsupported"); 4680 4681 } 4681 4682 ctx->noswap = true; 4682 - ctx->seen |= SHMEM_SEEN_NOSWAP; 4683 4683 break; 4684 4684 case Opt_quota: 4685 4685 if (fc->user_ns != &init_user_ns) ··· 4828 4830 err = "Current inum too high to switch to 32-bit inums"; 4829 4831 goto out; 4830 4832 } 4831 - if ((ctx->seen & SHMEM_SEEN_NOSWAP) && ctx->noswap && !sbinfo->noswap) { 4833 + 4834 + /* 4835 + * "noswap" doesn't use fsparam_flag_no, i.e. there's no "swap" 4836 + * counterpart for (re-)enabling swap. 4837 + */ 4838 + if (ctx->noswap && !sbinfo->noswap) { 4832 4839 err = "Cannot disable swap on remount"; 4833 - goto out; 4834 - } 4835 - if (!(ctx->seen & SHMEM_SEEN_NOSWAP) && !ctx->noswap && sbinfo->noswap) { 4836 - err = "Cannot enable swap on remount if it was disabled on first mount"; 4837 4840 goto out; 4838 4841 } 4839 4842
+3
net/core/dev_ioctl.c
··· 443 443 struct ifreq ifrr; 444 444 int err; 445 445 446 + if (!kernel_cfg->ifr) 447 + return -EINVAL; 448 + 446 449 strscpy_pad(ifrr.ifr_name, dev->name, IFNAMSIZ); 447 450 ifrr.ifr_ifru = kernel_cfg->ifr->ifr_ifru; 448 451
+3 -1
net/devlink/rate.c
··· 828 828 if (!devlink_rate->parent) 829 829 continue; 830 830 831 - refcount_dec(&devlink_rate->parent->refcnt); 832 831 if (devlink_rate_is_leaf(devlink_rate)) 833 832 ops->rate_leaf_parent_set(devlink_rate, NULL, devlink_rate->priv, 834 833 NULL, NULL); 835 834 else if (devlink_rate_is_node(devlink_rate)) 836 835 ops->rate_node_parent_set(devlink_rate, NULL, devlink_rate->priv, 837 836 NULL, NULL); 837 + 838 + refcount_dec(&devlink_rate->parent->refcnt); 839 + devlink_rate->parent = NULL; 838 840 } 839 841 list_for_each_entry_safe(devlink_rate, tmp, &devlink->rate_list, list) { 840 842 if (devlink_rate_is_node(devlink_rate)) {
+4 -2
net/ipv4/esp4_offload.c
··· 122 122 struct sk_buff *skb, 123 123 netdev_features_t features) 124 124 { 125 - __be16 type = x->inner_mode.family == AF_INET6 ? htons(ETH_P_IPV6) 126 - : htons(ETH_P_IP); 125 + const struct xfrm_mode *inner_mode = xfrm_ip2inner_mode(x, 126 + XFRM_MODE_SKB_CB(skb)->protocol); 127 + __be16 type = inner_mode->family == AF_INET6 ? htons(ETH_P_IPV6) 128 + : htons(ETH_P_IP); 127 129 128 130 return skb_eth_gso_segment(skb, features, type); 129 131 }
+4 -2
net/ipv6/esp6_offload.c
··· 158 158 struct sk_buff *skb, 159 159 netdev_features_t features) 160 160 { 161 - __be16 type = x->inner_mode.family == AF_INET ? htons(ETH_P_IP) 162 - : htons(ETH_P_IPV6); 161 + const struct xfrm_mode *inner_mode = xfrm_ip2inner_mode(x, 162 + XFRM_MODE_SKB_CB(skb)->protocol); 163 + __be16 type = inner_mode->family == AF_INET ? htons(ETH_P_IP) 164 + : htons(ETH_P_IPV6); 163 165 164 166 return skb_eth_gso_segment(skb, features, type); 165 167 }
+3 -3
net/l2tp/l2tp_core.c
··· 1246 1246 else 1247 1247 l2tp_build_l2tpv3_header(session, __skb_push(skb, session->hdr_len)); 1248 1248 1249 - /* Reset skb netfilter state */ 1250 - memset(&(IPCB(skb)->opt), 0, sizeof(IPCB(skb)->opt)); 1251 - IPCB(skb)->flags &= ~(IPSKB_XFRM_TUNNEL_SIZE | IPSKB_XFRM_TRANSFORMED | IPSKB_REROUTED); 1249 + /* Reset control buffer */ 1250 + memset(skb->cb, 0, sizeof(skb->cb)); 1251 + 1252 1252 nf_reset_ct(skb); 1253 1253 1254 1254 /* L2TP uses its own lockdep subclass to avoid lockdep splats caused by
+53 -1
net/mptcp/options.c
··· 838 838 839 839 opts->suboptions = 0; 840 840 841 + /* Force later mptcp_write_options(), but do not use any actual 842 + * option space. 843 + */ 841 844 if (unlikely(__mptcp_check_fallback(msk) && !mptcp_check_infinite_map(skb))) 842 - return false; 845 + return true; 843 846 844 847 if (unlikely(skb && TCP_SKB_CB(skb)->tcp_flags & TCPHDR_RST)) { 845 848 if (mptcp_established_options_fastclose(sk, &opt_size, remaining, opts) || ··· 1044 1041 WRITE_ONCE(msk->snd_una, new_snd_una); 1045 1042 } 1046 1043 1044 + static void rwin_update(struct mptcp_sock *msk, struct sock *ssk, 1045 + struct sk_buff *skb) 1046 + { 1047 + struct mptcp_subflow_context *subflow = mptcp_subflow_ctx(ssk); 1048 + struct tcp_sock *tp = tcp_sk(ssk); 1049 + u64 mptcp_rcv_wnd; 1050 + 1051 + /* Avoid touching extra cachelines if TCP is going to accept this 1052 + * skb without filling the TCP-level window even with a possibly 1053 + * outdated mptcp-level rwin. 1054 + */ 1055 + if (!skb->len || skb->len < tcp_receive_window(tp)) 1056 + return; 1057 + 1058 + mptcp_rcv_wnd = atomic64_read(&msk->rcv_wnd_sent); 1059 + if (!after64(mptcp_rcv_wnd, subflow->rcv_wnd_sent)) 1060 + return; 1061 + 1062 + /* Some other subflow grew the mptcp-level rwin since rcv_wup, 1063 + * resync. 1064 + */ 1065 + tp->rcv_wnd += mptcp_rcv_wnd - subflow->rcv_wnd_sent; 1066 + subflow->rcv_wnd_sent = mptcp_rcv_wnd; 1067 + } 1068 + 1047 1069 static void ack_update_msk(struct mptcp_sock *msk, 1048 1070 struct sock *ssk, 1049 1071 struct mptcp_options_received *mp_opt) ··· 1236 1208 */ 1237 1209 if (mp_opt.use_ack) 1238 1210 ack_update_msk(msk, sk, &mp_opt); 1211 + rwin_update(msk, sk, skb); 1239 1212 1240 1213 /* Zero-data-length packets are dropped by the caller and not 1241 1214 * propagated to the MPTCP layer, so the skb extension does not ··· 1323 1294 1324 1295 if (rcv_wnd_new != rcv_wnd_old) { 1325 1296 raise_win: 1297 + /* The msk-level rcv wnd is after the tcp level one, 1298 + * sync the latter. 1299 + */ 1300 + rcv_wnd_new = rcv_wnd_old; 1326 1301 win = rcv_wnd_old - ack_seq; 1327 1302 tp->rcv_wnd = min_t(u64, win, U32_MAX); 1328 1303 new_win = tp->rcv_wnd; ··· 1349 1316 } 1350 1317 1351 1318 update_wspace: 1319 + WRITE_ONCE(msk->old_wspace, tp->rcv_wnd); 1320 + subflow->rcv_wnd_sent = rcv_wnd_new; 1321 + } 1322 + 1323 + static void mptcp_track_rwin(struct tcp_sock *tp) 1324 + { 1325 + const struct sock *ssk = (const struct sock *)tp; 1326 + struct mptcp_subflow_context *subflow; 1327 + struct mptcp_sock *msk; 1328 + 1329 + if (!ssk) 1330 + return; 1331 + 1332 + subflow = mptcp_subflow_ctx(ssk); 1333 + msk = mptcp_sk(subflow->conn); 1352 1334 WRITE_ONCE(msk->old_wspace, tp->rcv_wnd); 1353 1335 } 1354 1336 ··· 1658 1610 TCPOLEN_MPTCP_RST, 1659 1611 opts->reset_transient, 1660 1612 opts->reset_reason); 1613 + return; 1614 + } else if (unlikely(!opts->suboptions)) { 1615 + /* Fallback to TCP */ 1616 + mptcp_track_rwin(tp); 1661 1617 return; 1662 1618 } 1663 1619
+13 -7
net/mptcp/pm.c
··· 18 18 u8 retrans_times; 19 19 struct timer_list add_timer; 20 20 struct mptcp_sock *sock; 21 + struct rcu_head rcu; 21 22 }; 22 23 23 24 static DEFINE_SPINLOCK(mptcp_pm_list_lock); ··· 156 155 157 156 entry = mptcp_pm_del_add_timer(msk, addr, false); 158 157 ret = entry; 159 - kfree(entry); 158 + kfree_rcu(entry, rcu); 160 159 161 160 return ret; 162 161 } ··· 346 345 { 347 346 struct mptcp_pm_add_entry *entry; 348 347 struct sock *sk = (struct sock *)msk; 349 - struct timer_list *add_timer = NULL; 348 + bool stop_timer = false; 349 + 350 + rcu_read_lock(); 350 351 351 352 spin_lock_bh(&msk->pm.lock); 352 353 entry = mptcp_lookup_anno_list_by_saddr(msk, addr); 353 354 if (entry && (!check_id || entry->addr.id == addr->id)) { 354 355 entry->retrans_times = ADD_ADDR_RETRANS_MAX; 355 - add_timer = &entry->add_timer; 356 + stop_timer = true; 356 357 } 357 358 if (!check_id && entry) 358 359 list_del(&entry->list); 359 360 spin_unlock_bh(&msk->pm.lock); 360 361 361 - /* no lock, because sk_stop_timer_sync() is calling timer_delete_sync() */ 362 - if (add_timer) 363 - sk_stop_timer_sync(sk, add_timer); 362 + /* Note: entry might have been removed by another thread. 363 + * We hold rcu_read_lock() to ensure it is not freed under us. 364 + */ 365 + if (stop_timer) 366 + sk_stop_timer_sync(sk, &entry->add_timer); 364 367 368 + rcu_read_unlock(); 365 369 return entry; 366 370 } 367 371 ··· 421 415 422 416 list_for_each_entry_safe(entry, tmp, &free_list, list) { 423 417 sk_stop_timer_sync(sk, &entry->add_timer); 424 - kfree(entry); 418 + kfree_rcu(entry, rcu); 425 419 } 426 420 } 427 421
+1 -1
net/mptcp/pm_kernel.c
··· 672 672 673 673 void mptcp_pm_nl_rm_addr(struct mptcp_sock *msk, u8 rm_id) 674 674 { 675 - if (rm_id && WARN_ON_ONCE(msk->pm.add_addr_accepted == 0)) { 675 + if (rm_id && !WARN_ON_ONCE(msk->pm.add_addr_accepted == 0)) { 676 676 u8 limit_add_addr_accepted = 677 677 mptcp_pm_get_limit_add_addr_accepted(msk); 678 678
+53 -25
net/mptcp/protocol.c
··· 78 78 if (__mptcp_check_fallback(msk)) 79 79 return true; 80 80 81 + /* The caller possibly is not holding the msk socket lock, but 82 + * in the fallback case only the current subflow is touching 83 + * the OoO queue. 84 + */ 85 + if (!RB_EMPTY_ROOT(&msk->out_of_order_queue)) 86 + return false; 87 + 81 88 spin_lock_bh(&msk->fallback_lock); 82 89 if (!msk->allow_infinite_fallback) { 83 90 spin_unlock_bh(&msk->fallback_lock); ··· 944 937 945 938 bool mptcp_schedule_work(struct sock *sk) 946 939 { 947 - if (inet_sk_state_load(sk) != TCP_CLOSE && 948 - schedule_work(&mptcp_sk(sk)->work)) { 949 - /* each subflow already holds a reference to the sk, and the 950 - * workqueue is invoked by a subflow, so sk can't go away here. 951 - */ 952 - sock_hold(sk); 940 + if (inet_sk_state_load(sk) == TCP_CLOSE) 941 + return false; 942 + 943 + /* Get a reference on this socket, mptcp_worker() will release it. 944 + * As mptcp_worker() might complete before us, we can not avoid 945 + * a sock_hold()/sock_put() if schedule_work() returns false. 946 + */ 947 + sock_hold(sk); 948 + 949 + if (schedule_work(&mptcp_sk(sk)->work)) 953 950 return true; 954 - } 951 + 952 + sock_put(sk); 955 953 return false; 956 954 } 957 955 ··· 2411 2399 2412 2400 /* flags for __mptcp_close_ssk() */ 2413 2401 #define MPTCP_CF_PUSH BIT(1) 2414 - #define MPTCP_CF_FASTCLOSE BIT(2) 2415 2402 2416 2403 /* be sure to send a reset only if the caller asked for it, also 2417 2404 * clean completely the subflow status when the subflow reaches ··· 2421 2410 unsigned int flags) 2422 2411 { 2423 2412 if (((1 << ssk->sk_state) & (TCPF_CLOSE | TCPF_LISTEN)) || 2424 - (flags & MPTCP_CF_FASTCLOSE)) { 2413 + subflow->send_fastclose) { 2425 2414 /* The MPTCP code never wait on the subflow sockets, TCP-level 2426 2415 * disconnect should never fail 2427 2416 */ ··· 2468 2457 2469 2458 lock_sock_nested(ssk, SINGLE_DEPTH_NESTING); 2470 2459 2471 - if ((flags & MPTCP_CF_FASTCLOSE) && !__mptcp_check_fallback(msk)) { 2472 - /* be sure to force the tcp_close path 2473 - * to generate the egress reset 2474 - */ 2475 - ssk->sk_lingertime = 0; 2476 - sock_set_flag(ssk, SOCK_LINGER); 2477 - subflow->send_fastclose = 1; 2478 - } 2460 + if (subflow->send_fastclose && ssk->sk_state != TCP_CLOSE) 2461 + tcp_set_state(ssk, TCP_CLOSE); 2479 2462 2480 2463 need_push = (flags & MPTCP_CF_PUSH) && __mptcp_retransmit_pending_data(sk); 2481 2464 if (!dispose_it) { ··· 2565 2560 2566 2561 if (ssk_state != TCP_CLOSE && 2567 2562 (ssk_state != TCP_CLOSE_WAIT || 2568 - inet_sk_state_load(sk) != TCP_ESTABLISHED)) 2563 + inet_sk_state_load(sk) != TCP_ESTABLISHED || 2564 + __mptcp_check_fallback(msk))) 2569 2565 continue; 2570 2566 2571 2567 /* 'subflow_data_ready' will re-sched once rx queue is empty */ ··· 2774 2768 struct mptcp_sock *msk = mptcp_sk(sk); 2775 2769 2776 2770 mptcp_set_state(sk, TCP_CLOSE); 2777 - mptcp_for_each_subflow_safe(msk, subflow, tmp) 2778 - __mptcp_close_ssk(sk, mptcp_subflow_tcp_sock(subflow), 2779 - subflow, MPTCP_CF_FASTCLOSE); 2771 + 2772 + /* Explicitly send the fastclose reset as need */ 2773 + if (__mptcp_check_fallback(msk)) 2774 + return; 2775 + 2776 + mptcp_for_each_subflow_safe(msk, subflow, tmp) { 2777 + struct sock *ssk = mptcp_subflow_tcp_sock(subflow); 2778 + 2779 + lock_sock(ssk); 2780 + 2781 + /* Some subflow socket states don't allow/need a reset.*/ 2782 + if ((1 << ssk->sk_state) & (TCPF_LISTEN | TCPF_CLOSE)) 2783 + goto unlock; 2784 + 2785 + subflow->send_fastclose = 1; 2786 + tcp_send_active_reset(ssk, ssk->sk_allocation, 2787 + SK_RST_REASON_TCP_ABORT_ON_CLOSE); 2788 + unlock: 2789 + release_sock(ssk); 2790 + } 2780 2791 } 2781 2792 2782 2793 static void mptcp_worker(struct work_struct *work) ··· 2820 2797 __mptcp_close_subflow(sk); 2821 2798 2822 2799 if (mptcp_close_tout_expired(sk)) { 2800 + struct mptcp_subflow_context *subflow, *tmp; 2801 + 2823 2802 mptcp_do_fastclose(sk); 2803 + mptcp_for_each_subflow_safe(msk, subflow, tmp) 2804 + __mptcp_close_ssk(sk, subflow->tcp_sock, subflow, 0); 2824 2805 mptcp_close_wake_up(sk); 2825 2806 } 2826 2807 ··· 3249 3222 /* msk->subflow is still intact, the following will not free the first 3250 3223 * subflow 3251 3224 */ 3252 - mptcp_destroy_common(msk, MPTCP_CF_FASTCLOSE); 3225 + mptcp_do_fastclose(sk); 3226 + mptcp_destroy_common(msk); 3253 3227 3254 3228 /* The first subflow is already in TCP_CLOSE status, the following 3255 3229 * can't overlap with a fallback anymore ··· 3429 3401 msk->rcvq_space.space = TCP_INIT_CWND * TCP_MSS_DEFAULT; 3430 3402 } 3431 3403 3432 - void mptcp_destroy_common(struct mptcp_sock *msk, unsigned int flags) 3404 + void mptcp_destroy_common(struct mptcp_sock *msk) 3433 3405 { 3434 3406 struct mptcp_subflow_context *subflow, *tmp; 3435 3407 struct sock *sk = (struct sock *)msk; ··· 3438 3410 3439 3411 /* join list will be eventually flushed (with rst) at sock lock release time */ 3440 3412 mptcp_for_each_subflow_safe(msk, subflow, tmp) 3441 - __mptcp_close_ssk(sk, mptcp_subflow_tcp_sock(subflow), subflow, flags); 3413 + __mptcp_close_ssk(sk, mptcp_subflow_tcp_sock(subflow), subflow, 0); 3442 3414 3443 3415 __skb_queue_purge(&sk->sk_receive_queue); 3444 3416 skb_rbtree_purge(&msk->out_of_order_queue); ··· 3456 3428 3457 3429 /* allow the following to close even the initial subflow */ 3458 3430 msk->free_first = 1; 3459 - mptcp_destroy_common(msk, 0); 3431 + mptcp_destroy_common(msk); 3460 3432 sk_sockets_allocated_dec(sk); 3461 3433 } 3462 3434
+2 -1
net/mptcp/protocol.h
··· 509 509 u64 remote_key; 510 510 u64 idsn; 511 511 u64 map_seq; 512 + u64 rcv_wnd_sent; 512 513 u32 snd_isn; 513 514 u32 token; 514 515 u32 rel_write_seq; ··· 977 976 local_bh_enable(); 978 977 } 979 978 980 - void mptcp_destroy_common(struct mptcp_sock *msk, unsigned int flags); 979 + void mptcp_destroy_common(struct mptcp_sock *msk); 981 980 982 981 #define MPTCP_TOKEN_MAX_RETRIES 4 983 982
+1 -67
net/openvswitch/actions.c
··· 572 572 return 0; 573 573 } 574 574 575 - static int set_nsh(struct sk_buff *skb, struct sw_flow_key *flow_key, 576 - const struct nlattr *a) 577 - { 578 - struct nshhdr *nh; 579 - size_t length; 580 - int err; 581 - u8 flags; 582 - u8 ttl; 583 - int i; 584 - 585 - struct ovs_key_nsh key; 586 - struct ovs_key_nsh mask; 587 - 588 - err = nsh_key_from_nlattr(a, &key, &mask); 589 - if (err) 590 - return err; 591 - 592 - /* Make sure the NSH base header is there */ 593 - if (!pskb_may_pull(skb, skb_network_offset(skb) + NSH_BASE_HDR_LEN)) 594 - return -ENOMEM; 595 - 596 - nh = nsh_hdr(skb); 597 - length = nsh_hdr_len(nh); 598 - 599 - /* Make sure the whole NSH header is there */ 600 - err = skb_ensure_writable(skb, skb_network_offset(skb) + 601 - length); 602 - if (unlikely(err)) 603 - return err; 604 - 605 - nh = nsh_hdr(skb); 606 - skb_postpull_rcsum(skb, nh, length); 607 - flags = nsh_get_flags(nh); 608 - flags = OVS_MASKED(flags, key.base.flags, mask.base.flags); 609 - flow_key->nsh.base.flags = flags; 610 - ttl = nsh_get_ttl(nh); 611 - ttl = OVS_MASKED(ttl, key.base.ttl, mask.base.ttl); 612 - flow_key->nsh.base.ttl = ttl; 613 - nsh_set_flags_and_ttl(nh, flags, ttl); 614 - nh->path_hdr = OVS_MASKED(nh->path_hdr, key.base.path_hdr, 615 - mask.base.path_hdr); 616 - flow_key->nsh.base.path_hdr = nh->path_hdr; 617 - switch (nh->mdtype) { 618 - case NSH_M_TYPE1: 619 - for (i = 0; i < NSH_MD1_CONTEXT_SIZE; i++) { 620 - nh->md1.context[i] = 621 - OVS_MASKED(nh->md1.context[i], key.context[i], 622 - mask.context[i]); 623 - } 624 - memcpy(flow_key->nsh.context, nh->md1.context, 625 - sizeof(nh->md1.context)); 626 - break; 627 - case NSH_M_TYPE2: 628 - memset(flow_key->nsh.context, 0, 629 - sizeof(flow_key->nsh.context)); 630 - break; 631 - default: 632 - return -EINVAL; 633 - } 634 - skb_postpush_rcsum(skb, nh, length); 635 - return 0; 636 - } 637 - 638 575 /* Must follow skb_ensure_writable() since that can move the skb data. */ 639 576 static void set_tp_port(struct sk_buff *skb, __be16 *port, 640 577 __be16 new_port, __sum16 *check) ··· 1067 1130 get_mask(a, struct ovs_key_ethernet *)); 1068 1131 break; 1069 1132 1070 - case OVS_KEY_ATTR_NSH: 1071 - err = set_nsh(skb, flow_key, a); 1072 - break; 1073 - 1074 1133 case OVS_KEY_ATTR_IPV4: 1075 1134 err = set_ipv4(skb, flow_key, nla_data(a), 1076 1135 get_mask(a, struct ovs_key_ipv4 *)); ··· 1103 1170 case OVS_KEY_ATTR_CT_LABELS: 1104 1171 case OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV4: 1105 1172 case OVS_KEY_ATTR_CT_ORIG_TUPLE_IPV6: 1173 + case OVS_KEY_ATTR_NSH: 1106 1174 err = -EINVAL; 1107 1175 break; 1108 1176 }
+8 -56
net/openvswitch/flow_netlink.c
··· 1305 1305 return 0; 1306 1306 } 1307 1307 1308 + /* 1309 + * Constructs NSH header 'nh' from attributes of OVS_ACTION_ATTR_PUSH_NSH, 1310 + * where 'nh' points to a memory block of 'size' bytes. It's assumed that 1311 + * attributes were previously validated with validate_push_nsh(). 1312 + */ 1308 1313 int nsh_hdr_from_nlattr(const struct nlattr *attr, 1309 1314 struct nshhdr *nh, size_t size) 1310 1315 { ··· 1319 1314 u8 ttl = 0; 1320 1315 int mdlen = 0; 1321 1316 1322 - /* validate_nsh has check this, so we needn't do duplicate check here 1323 - */ 1324 1317 if (size < NSH_BASE_HDR_LEN) 1325 1318 return -ENOBUFS; 1326 1319 ··· 1358 1355 /* nsh header length = NSH_BASE_HDR_LEN + mdlen */ 1359 1356 nh->ver_flags_ttl_len = 0; 1360 1357 nsh_set_flags_ttl_len(nh, flags, ttl, NSH_BASE_HDR_LEN + mdlen); 1361 - 1362 - return 0; 1363 - } 1364 - 1365 - int nsh_key_from_nlattr(const struct nlattr *attr, 1366 - struct ovs_key_nsh *nsh, struct ovs_key_nsh *nsh_mask) 1367 - { 1368 - struct nlattr *a; 1369 - int rem; 1370 - 1371 - /* validate_nsh has check this, so we needn't do duplicate check here 1372 - */ 1373 - nla_for_each_nested(a, attr, rem) { 1374 - int type = nla_type(a); 1375 - 1376 - switch (type) { 1377 - case OVS_NSH_KEY_ATTR_BASE: { 1378 - const struct ovs_nsh_key_base *base = nla_data(a); 1379 - const struct ovs_nsh_key_base *base_mask = base + 1; 1380 - 1381 - nsh->base = *base; 1382 - nsh_mask->base = *base_mask; 1383 - break; 1384 - } 1385 - case OVS_NSH_KEY_ATTR_MD1: { 1386 - const struct ovs_nsh_key_md1 *md1 = nla_data(a); 1387 - const struct ovs_nsh_key_md1 *md1_mask = md1 + 1; 1388 - 1389 - memcpy(nsh->context, md1->context, sizeof(*md1)); 1390 - memcpy(nsh_mask->context, md1_mask->context, 1391 - sizeof(*md1_mask)); 1392 - break; 1393 - } 1394 - case OVS_NSH_KEY_ATTR_MD2: 1395 - /* Not supported yet */ 1396 - return -ENOTSUPP; 1397 - default: 1398 - return -EINVAL; 1399 - } 1400 - } 1401 1358 1402 1359 return 0; 1403 1360 } ··· 2802 2839 return err; 2803 2840 } 2804 2841 2805 - static bool validate_nsh(const struct nlattr *attr, bool is_mask, 2806 - bool is_push_nsh, bool log) 2842 + static bool validate_push_nsh(const struct nlattr *attr, bool log) 2807 2843 { 2808 2844 struct sw_flow_match match; 2809 2845 struct sw_flow_key key; 2810 - int ret = 0; 2811 2846 2812 2847 ovs_match_init(&match, &key, true, NULL); 2813 - ret = nsh_key_put_from_nlattr(attr, &match, is_mask, 2814 - is_push_nsh, log); 2815 - return !ret; 2848 + return !nsh_key_put_from_nlattr(attr, &match, false, true, log); 2816 2849 } 2817 2850 2818 2851 /* Return false if there are any non-masked bits set. ··· 2954 2995 flow_key->ip.proto != IPPROTO_SCTP) 2955 2996 return -EINVAL; 2956 2997 2957 - break; 2958 - 2959 - case OVS_KEY_ATTR_NSH: 2960 - if (eth_type != htons(ETH_P_NSH)) 2961 - return -EINVAL; 2962 - if (!validate_nsh(nla_data(a), masked, false, log)) 2963 - return -EINVAL; 2964 2998 break; 2965 2999 2966 3000 default: ··· 3389 3437 return -EINVAL; 3390 3438 } 3391 3439 mac_proto = MAC_PROTO_NONE; 3392 - if (!validate_nsh(nla_data(a), false, true, true)) 3440 + if (!validate_push_nsh(nla_data(a), log)) 3393 3441 return -EINVAL; 3394 3442 break; 3395 3443
-2
net/openvswitch/flow_netlink.h
··· 65 65 void ovs_nla_free_flow_actions(struct sw_flow_actions *); 66 66 void ovs_nla_free_flow_actions_rcu(struct sw_flow_actions *); 67 67 68 - int nsh_key_from_nlattr(const struct nlattr *attr, struct ovs_key_nsh *nsh, 69 - struct ovs_key_nsh *nsh_mask); 70 68 int nsh_hdr_from_nlattr(const struct nlattr *attr, struct nshhdr *nh, 71 69 size_t size); 72 70
+1 -2
net/unix/af_unix.c
··· 2954 2954 2955 2955 u = unix_sk(sk); 2956 2956 2957 + redo: 2957 2958 /* Lock the socket to prevent queue disordering 2958 2959 * while sleeps in memcpy_tomsg 2959 2960 */ ··· 2966 2965 struct sk_buff *skb, *last; 2967 2966 int chunk; 2968 2967 2969 - redo: 2970 2968 unix_state_lock(sk); 2971 2969 if (sock_flag(sk, SOCK_DEAD)) { 2972 2970 err = -ECONNRESET; ··· 3015 3015 goto out; 3016 3016 } 3017 3017 3018 - mutex_lock(&u->iolock); 3019 3018 goto redo; 3020 3019 unlock: 3021 3020 unix_state_unlock(sk);
+31 -9
net/vmw_vsock/af_vsock.c
··· 1661 1661 timeout = schedule_timeout(timeout); 1662 1662 lock_sock(sk); 1663 1663 1664 - if (signal_pending(current)) { 1665 - err = sock_intr_errno(timeout); 1666 - sk->sk_state = sk->sk_state == TCP_ESTABLISHED ? TCP_CLOSING : TCP_CLOSE; 1667 - sock->state = SS_UNCONNECTED; 1668 - vsock_transport_cancel_pkt(vsk); 1669 - vsock_remove_connected(vsk); 1670 - goto out_wait; 1671 - } else if ((sk->sk_state != TCP_ESTABLISHED) && (timeout == 0)) { 1672 - err = -ETIMEDOUT; 1664 + /* Connection established. Whatever happens to socket once we 1665 + * release it, that's not connect()'s concern. No need to go 1666 + * into signal and timeout handling. Call it a day. 1667 + * 1668 + * Note that allowing to "reset" an already established socket 1669 + * here is racy and insecure. 1670 + */ 1671 + if (sk->sk_state == TCP_ESTABLISHED) 1672 + break; 1673 + 1674 + /* If connection was _not_ established and a signal/timeout came 1675 + * to be, we want the socket's state reset. User space may want 1676 + * to retry. 1677 + * 1678 + * sk_state != TCP_ESTABLISHED implies that socket is not on 1679 + * vsock_connected_table. We keep the binding and the transport 1680 + * assigned. 1681 + */ 1682 + if (signal_pending(current) || timeout == 0) { 1683 + err = timeout == 0 ? -ETIMEDOUT : sock_intr_errno(timeout); 1684 + 1685 + /* Listener might have already responded with 1686 + * VIRTIO_VSOCK_OP_RESPONSE. Its handling expects our 1687 + * sk_state == TCP_SYN_SENT, which hereby we break. 1688 + * In such case VIRTIO_VSOCK_OP_RST will follow. 1689 + */ 1673 1690 sk->sk_state = TCP_CLOSE; 1674 1691 sock->state = SS_UNCONNECTED; 1692 + 1693 + /* Try to cancel VIRTIO_VSOCK_OP_REQUEST skb sent out by 1694 + * transport->connect(). 1695 + */ 1675 1696 vsock_transport_cancel_pkt(vsk); 1697 + 1676 1698 goto out_wait; 1677 1699 } 1678 1700
+1 -1
net/xfrm/xfrm_device.c
··· 438 438 439 439 check_tunnel_size = x->xso.type == XFRM_DEV_OFFLOAD_PACKET && 440 440 x->props.mode == XFRM_MODE_TUNNEL; 441 - switch (x->inner_mode.family) { 441 + switch (skb_dst(skb)->ops->family) { 442 442 case AF_INET: 443 443 /* Check for IPv4 options */ 444 444 if (ip_hdr(skb)->ihl != 5)
+6 -2
net/xfrm/xfrm_output.c
··· 698 698 return; 699 699 700 700 if (x->outer_mode.encap == XFRM_MODE_TUNNEL) { 701 - switch (x->outer_mode.family) { 701 + switch (skb_dst(skb)->ops->family) { 702 702 case AF_INET: 703 703 xo->inner_ipproto = ip_hdr(skb)->protocol; 704 704 break; ··· 772 772 /* Exclusive direct xmit for tunnel mode, as 773 773 * some filtering or matching rules may apply 774 774 * in transport mode. 775 + * Locally generated packets also require 776 + * the normal XFRM path for L2 header setup, 777 + * as the hardware needs the L2 header to match 778 + * for encryption, so skip direct output as well. 775 779 */ 776 - if (x->props.mode == XFRM_MODE_TUNNEL) 780 + if (x->props.mode == XFRM_MODE_TUNNEL && !skb->sk) 777 781 return xfrm_dev_direct_output(sk, x, skb); 778 782 779 783 return xfrm_output_resume(sk, skb, 0);
+22 -8
net/xfrm/xfrm_state.c
··· 592 592 } 593 593 EXPORT_SYMBOL(xfrm_state_free); 594 594 595 + static void xfrm_state_delete_tunnel(struct xfrm_state *x); 595 596 static void xfrm_state_gc_destroy(struct xfrm_state *x) 596 597 { 597 598 if (x->mode_cbs && x->mode_cbs->destroy_state) ··· 608 607 kfree(x->replay_esn); 609 608 kfree(x->preplay_esn); 610 609 xfrm_unset_type_offload(x); 610 + xfrm_state_delete_tunnel(x); 611 611 if (x->type) { 612 612 x->type->destructor(x); 613 613 xfrm_put_type(x->type); ··· 808 806 } 809 807 EXPORT_SYMBOL(__xfrm_state_destroy); 810 808 811 - static void xfrm_state_delete_tunnel(struct xfrm_state *x); 812 809 int __xfrm_state_delete(struct xfrm_state *x) 813 810 { 814 811 struct net *net = xs_net(x); ··· 2074 2073 return x; 2075 2074 2076 2075 error: 2076 + x->km.state = XFRM_STATE_DEAD; 2077 2077 xfrm_state_put(x); 2078 2078 out: 2079 2079 return NULL; ··· 2159 2157 xfrm_state_insert(xc); 2160 2158 } else { 2161 2159 if (xfrm_state_add(xc) < 0) 2162 - goto error; 2160 + goto error_add; 2163 2161 } 2164 2162 2165 2163 return xc; 2164 + error_add: 2165 + if (xuo) 2166 + xfrm_dev_state_delete(xc); 2166 2167 error: 2168 + xc->km.state = XFRM_STATE_DEAD; 2167 2169 xfrm_state_put(xc); 2168 2170 return NULL; 2169 2171 } ··· 2197 2191 } 2198 2192 2199 2193 if (x1->km.state == XFRM_STATE_ACQ) { 2200 - if (x->dir && x1->dir != x->dir) 2194 + if (x->dir && x1->dir != x->dir) { 2195 + to_put = x1; 2201 2196 goto out; 2197 + } 2202 2198 2203 2199 __xfrm_state_insert(x); 2204 2200 x = NULL; 2205 2201 } else { 2206 - if (x1->dir != x->dir) 2202 + if (x1->dir != x->dir) { 2203 + to_put = x1; 2207 2204 goto out; 2205 + } 2208 2206 } 2209 2207 err = 0; 2210 2208 ··· 3308 3298 void xfrm_state_fini(struct net *net) 3309 3299 { 3310 3300 unsigned int sz; 3301 + int i; 3311 3302 3312 3303 flush_work(&net->xfrm.state_hash_work); 3313 3304 xfrm_state_flush(net, 0, false); ··· 3316 3305 3317 3306 WARN_ON(!list_empty(&net->xfrm.state_all)); 3318 3307 3308 + for (i = 0; i <= net->xfrm.state_hmask; i++) { 3309 + WARN_ON(!hlist_empty(net->xfrm.state_byseq + i)); 3310 + WARN_ON(!hlist_empty(net->xfrm.state_byspi + i)); 3311 + WARN_ON(!hlist_empty(net->xfrm.state_bysrc + i)); 3312 + WARN_ON(!hlist_empty(net->xfrm.state_bydst + i)); 3313 + } 3314 + 3319 3315 sz = (net->xfrm.state_hmask + 1) * sizeof(struct hlist_head); 3320 - WARN_ON(!hlist_empty(net->xfrm.state_byseq)); 3321 3316 xfrm_hash_free(net->xfrm.state_byseq, sz); 3322 - WARN_ON(!hlist_empty(net->xfrm.state_byspi)); 3323 3317 xfrm_hash_free(net->xfrm.state_byspi, sz); 3324 - WARN_ON(!hlist_empty(net->xfrm.state_bysrc)); 3325 3318 xfrm_hash_free(net->xfrm.state_bysrc, sz); 3326 - WARN_ON(!hlist_empty(net->xfrm.state_bydst)); 3327 3319 xfrm_hash_free(net->xfrm.state_bydst, sz); 3328 3320 free_percpu(net->xfrm.state_cache_input); 3329 3321 }
+7 -1
net/xfrm/xfrm_user.c
··· 947 947 948 948 if (attrs[XFRMA_SA_PCPU]) { 949 949 x->pcpu_num = nla_get_u32(attrs[XFRMA_SA_PCPU]); 950 - if (x->pcpu_num >= num_possible_cpus()) 950 + if (x->pcpu_num >= num_possible_cpus()) { 951 + err = -ERANGE; 952 + NL_SET_ERR_MSG(extack, "pCPU number too big"); 951 953 goto error; 954 + } 952 955 } 953 956 954 957 err = __xfrm_init_state(x, extack); ··· 3038 3035 } 3039 3036 3040 3037 xfrm_state_free(x); 3038 + xfrm_dev_policy_delete(xp); 3039 + xfrm_dev_policy_free(xp); 3040 + security_xfrm_policy_free(xp->security); 3041 3041 kfree(xp); 3042 3042 3043 3043 return 0;
+6
samples/vfs/test-statx.c
··· 19 19 #include <time.h> 20 20 #include <sys/syscall.h> 21 21 #include <sys/types.h> 22 + 23 + // Work around glibc header silliness 24 + #undef AT_RENAME_NOREPLACE 25 + #undef AT_RENAME_EXCHANGE 26 + #undef AT_RENAME_WHITEOUT 27 + 22 28 #include <linux/stat.h> 23 29 #include <linux/fcntl.h> 24 30 #define statx foo
+6
samples/watch_queue/watch_test.c
··· 16 16 #include <errno.h> 17 17 #include <sys/ioctl.h> 18 18 #include <limits.h> 19 + 20 + // Work around glibc header silliness 21 + #undef AT_RENAME_NOREPLACE 22 + #undef AT_RENAME_EXCHANGE 23 + #undef AT_RENAME_WHITEOUT 24 + 19 25 #include <linux/watch_queue.h> 20 26 #include <linux/unistd.h> 21 27 #include <linux/keyctl.h>
+3 -4
security/landlock/fs.c
··· 1335 1335 * At this point, we own the ihold() reference that was 1336 1336 * originally set up by get_inode_object() and the 1337 1337 * __iget() reference that we just set in this loop 1338 - * walk. Therefore the following call to iput() will 1339 - * not sleep nor drop the inode because there is now at 1340 - * least two references to it. 1338 + * walk. Therefore there are at least two references 1339 + * on the inode. 1341 1340 */ 1342 - iput(inode); 1341 + iput_not_last(inode); 1343 1342 } else { 1344 1343 spin_unlock(&object->lock); 1345 1344 rcu_read_unlock();
+128 -123
security/selinux/hooks.c
··· 210 210 */ 211 211 static void cred_init_security(void) 212 212 { 213 - struct task_security_struct *tsec; 213 + struct cred_security_struct *crsec; 214 214 215 215 /* NOTE: the lsm framework zeros out the buffer on allocation */ 216 216 217 - tsec = selinux_cred(unrcu_pointer(current->real_cred)); 218 - tsec->osid = tsec->sid = tsec->avdcache.sid = SECINITSID_KERNEL; 217 + crsec = selinux_cred(unrcu_pointer(current->real_cred)); 218 + crsec->osid = crsec->sid = SECINITSID_KERNEL; 219 219 } 220 220 221 221 /* ··· 223 223 */ 224 224 static inline u32 cred_sid(const struct cred *cred) 225 225 { 226 - const struct task_security_struct *tsec; 226 + const struct cred_security_struct *crsec; 227 227 228 - tsec = selinux_cred(cred); 229 - return tsec->sid; 228 + crsec = selinux_cred(cred); 229 + return crsec->sid; 230 230 } 231 231 232 232 static void __ad_net_init(struct common_audit_data *ad, ··· 437 437 struct superblock_security_struct *sbsec, 438 438 const struct cred *cred) 439 439 { 440 - const struct task_security_struct *tsec = selinux_cred(cred); 440 + const struct cred_security_struct *crsec = selinux_cred(cred); 441 441 int rc; 442 442 443 - rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, 443 + rc = avc_has_perm(crsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, 444 444 FILESYSTEM__RELABELFROM, NULL); 445 445 if (rc) 446 446 return rc; 447 447 448 - rc = avc_has_perm(tsec->sid, sid, SECCLASS_FILESYSTEM, 448 + rc = avc_has_perm(crsec->sid, sid, SECCLASS_FILESYSTEM, 449 449 FILESYSTEM__RELABELTO, NULL); 450 450 return rc; 451 451 } ··· 454 454 struct superblock_security_struct *sbsec, 455 455 const struct cred *cred) 456 456 { 457 - const struct task_security_struct *tsec = selinux_cred(cred); 457 + const struct cred_security_struct *crsec = selinux_cred(cred); 458 458 int rc; 459 - rc = avc_has_perm(tsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, 459 + rc = avc_has_perm(crsec->sid, sbsec->sid, SECCLASS_FILESYSTEM, 460 460 FILESYSTEM__RELABELFROM, NULL); 461 461 if (rc) 462 462 return rc; ··· 1788 1788 * Determine the label for an inode that might be unioned. 1789 1789 */ 1790 1790 static int 1791 - selinux_determine_inode_label(const struct task_security_struct *tsec, 1791 + selinux_determine_inode_label(const struct cred_security_struct *crsec, 1792 1792 struct inode *dir, 1793 1793 const struct qstr *name, u16 tclass, 1794 1794 u32 *_new_isid) ··· 1800 1800 (sbsec->behavior == SECURITY_FS_USE_MNTPOINT)) { 1801 1801 *_new_isid = sbsec->mntpoint_sid; 1802 1802 } else if ((sbsec->flags & SBLABEL_MNT) && 1803 - tsec->create_sid) { 1804 - *_new_isid = tsec->create_sid; 1803 + crsec->create_sid) { 1804 + *_new_isid = crsec->create_sid; 1805 1805 } else { 1806 1806 const struct inode_security_struct *dsec = inode_security(dir); 1807 - return security_transition_sid(tsec->sid, 1807 + return security_transition_sid(crsec->sid, 1808 1808 dsec->sid, tclass, 1809 1809 name, _new_isid); 1810 1810 } ··· 1817 1817 struct dentry *dentry, 1818 1818 u16 tclass) 1819 1819 { 1820 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 1820 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 1821 1821 struct inode_security_struct *dsec; 1822 1822 struct superblock_security_struct *sbsec; 1823 1823 u32 sid, newsid; ··· 1827 1827 dsec = inode_security(dir); 1828 1828 sbsec = selinux_superblock(dir->i_sb); 1829 1829 1830 - sid = tsec->sid; 1830 + sid = crsec->sid; 1831 1831 1832 1832 ad.type = LSM_AUDIT_DATA_DENTRY; 1833 1833 ad.u.dentry = dentry; ··· 1838 1838 if (rc) 1839 1839 return rc; 1840 1840 1841 - rc = selinux_determine_inode_label(tsec, dir, &dentry->d_name, tclass, 1841 + rc = selinux_determine_inode_label(crsec, dir, &dentry->d_name, tclass, 1842 1842 &newsid); 1843 1843 if (rc) 1844 1844 return rc; ··· 2251 2251 } 2252 2252 2253 2253 static int check_nnp_nosuid(const struct linux_binprm *bprm, 2254 - const struct task_security_struct *old_tsec, 2255 - const struct task_security_struct *new_tsec) 2254 + const struct cred_security_struct *old_crsec, 2255 + const struct cred_security_struct *new_crsec) 2256 2256 { 2257 2257 int nnp = (bprm->unsafe & LSM_UNSAFE_NO_NEW_PRIVS); 2258 2258 int nosuid = !mnt_may_suid(bprm->file->f_path.mnt); ··· 2262 2262 if (!nnp && !nosuid) 2263 2263 return 0; /* neither NNP nor nosuid */ 2264 2264 2265 - if (new_tsec->sid == old_tsec->sid) 2265 + if (new_crsec->sid == old_crsec->sid) 2266 2266 return 0; /* No change in credentials */ 2267 2267 2268 2268 /* ··· 2277 2277 av |= PROCESS2__NNP_TRANSITION; 2278 2278 if (nosuid) 2279 2279 av |= PROCESS2__NOSUID_TRANSITION; 2280 - rc = avc_has_perm(old_tsec->sid, new_tsec->sid, 2280 + rc = avc_has_perm(old_crsec->sid, new_crsec->sid, 2281 2281 SECCLASS_PROCESS2, av, NULL); 2282 2282 if (!rc) 2283 2283 return 0; ··· 2288 2288 * i.e. SIDs that are guaranteed to only be allowed a subset 2289 2289 * of the permissions of the current SID. 2290 2290 */ 2291 - rc = security_bounded_transition(old_tsec->sid, 2292 - new_tsec->sid); 2291 + rc = security_bounded_transition(old_crsec->sid, 2292 + new_crsec->sid); 2293 2293 if (!rc) 2294 2294 return 0; 2295 2295 ··· 2305 2305 2306 2306 static int selinux_bprm_creds_for_exec(struct linux_binprm *bprm) 2307 2307 { 2308 - const struct task_security_struct *old_tsec; 2309 - struct task_security_struct *new_tsec; 2308 + const struct cred_security_struct *old_crsec; 2309 + struct cred_security_struct *new_crsec; 2310 2310 struct inode_security_struct *isec; 2311 2311 struct common_audit_data ad; 2312 2312 struct inode *inode = file_inode(bprm->file); ··· 2315 2315 /* SELinux context only depends on initial program or script and not 2316 2316 * the script interpreter */ 2317 2317 2318 - old_tsec = selinux_cred(current_cred()); 2319 - new_tsec = selinux_cred(bprm->cred); 2318 + old_crsec = selinux_cred(current_cred()); 2319 + new_crsec = selinux_cred(bprm->cred); 2320 2320 isec = inode_security(inode); 2321 2321 2322 2322 /* Default to the current task SID. */ 2323 - new_tsec->sid = old_tsec->sid; 2324 - new_tsec->osid = old_tsec->sid; 2323 + new_crsec->sid = old_crsec->sid; 2324 + new_crsec->osid = old_crsec->sid; 2325 2325 2326 2326 /* Reset fs, key, and sock SIDs on execve. */ 2327 - new_tsec->create_sid = 0; 2328 - new_tsec->keycreate_sid = 0; 2329 - new_tsec->sockcreate_sid = 0; 2327 + new_crsec->create_sid = 0; 2328 + new_crsec->keycreate_sid = 0; 2329 + new_crsec->sockcreate_sid = 0; 2330 2330 2331 2331 /* 2332 2332 * Before policy is loaded, label any task outside kernel space ··· 2335 2335 * (if the policy chooses to set SECINITSID_INIT != SECINITSID_KERNEL). 2336 2336 */ 2337 2337 if (!selinux_initialized()) { 2338 - new_tsec->sid = SECINITSID_INIT; 2338 + new_crsec->sid = SECINITSID_INIT; 2339 2339 /* also clear the exec_sid just in case */ 2340 - new_tsec->exec_sid = 0; 2340 + new_crsec->exec_sid = 0; 2341 2341 return 0; 2342 2342 } 2343 2343 2344 - if (old_tsec->exec_sid) { 2345 - new_tsec->sid = old_tsec->exec_sid; 2344 + if (old_crsec->exec_sid) { 2345 + new_crsec->sid = old_crsec->exec_sid; 2346 2346 /* Reset exec SID on execve. */ 2347 - new_tsec->exec_sid = 0; 2347 + new_crsec->exec_sid = 0; 2348 2348 2349 2349 /* Fail on NNP or nosuid if not an allowed transition. */ 2350 - rc = check_nnp_nosuid(bprm, old_tsec, new_tsec); 2350 + rc = check_nnp_nosuid(bprm, old_crsec, new_crsec); 2351 2351 if (rc) 2352 2352 return rc; 2353 2353 } else { 2354 2354 /* Check for a default transition on this program. */ 2355 - rc = security_transition_sid(old_tsec->sid, 2355 + rc = security_transition_sid(old_crsec->sid, 2356 2356 isec->sid, SECCLASS_PROCESS, NULL, 2357 - &new_tsec->sid); 2357 + &new_crsec->sid); 2358 2358 if (rc) 2359 2359 return rc; 2360 2360 ··· 2362 2362 * Fallback to old SID on NNP or nosuid if not an allowed 2363 2363 * transition. 2364 2364 */ 2365 - rc = check_nnp_nosuid(bprm, old_tsec, new_tsec); 2365 + rc = check_nnp_nosuid(bprm, old_crsec, new_crsec); 2366 2366 if (rc) 2367 - new_tsec->sid = old_tsec->sid; 2367 + new_crsec->sid = old_crsec->sid; 2368 2368 } 2369 2369 2370 2370 ad.type = LSM_AUDIT_DATA_FILE; 2371 2371 ad.u.file = bprm->file; 2372 2372 2373 - if (new_tsec->sid == old_tsec->sid) { 2374 - rc = avc_has_perm(old_tsec->sid, isec->sid, 2373 + if (new_crsec->sid == old_crsec->sid) { 2374 + rc = avc_has_perm(old_crsec->sid, isec->sid, 2375 2375 SECCLASS_FILE, FILE__EXECUTE_NO_TRANS, &ad); 2376 2376 if (rc) 2377 2377 return rc; 2378 2378 } else { 2379 2379 /* Check permissions for the transition. */ 2380 - rc = avc_has_perm(old_tsec->sid, new_tsec->sid, 2380 + rc = avc_has_perm(old_crsec->sid, new_crsec->sid, 2381 2381 SECCLASS_PROCESS, PROCESS__TRANSITION, &ad); 2382 2382 if (rc) 2383 2383 return rc; 2384 2384 2385 - rc = avc_has_perm(new_tsec->sid, isec->sid, 2385 + rc = avc_has_perm(new_crsec->sid, isec->sid, 2386 2386 SECCLASS_FILE, FILE__ENTRYPOINT, &ad); 2387 2387 if (rc) 2388 2388 return rc; 2389 2389 2390 2390 /* Check for shared state */ 2391 2391 if (bprm->unsafe & LSM_UNSAFE_SHARE) { 2392 - rc = avc_has_perm(old_tsec->sid, new_tsec->sid, 2392 + rc = avc_has_perm(old_crsec->sid, new_crsec->sid, 2393 2393 SECCLASS_PROCESS, PROCESS__SHARE, 2394 2394 NULL); 2395 2395 if (rc) ··· 2401 2401 if (bprm->unsafe & LSM_UNSAFE_PTRACE) { 2402 2402 u32 ptsid = ptrace_parent_sid(); 2403 2403 if (ptsid != 0) { 2404 - rc = avc_has_perm(ptsid, new_tsec->sid, 2404 + rc = avc_has_perm(ptsid, new_crsec->sid, 2405 2405 SECCLASS_PROCESS, 2406 2406 PROCESS__PTRACE, NULL); 2407 2407 if (rc) ··· 2415 2415 /* Enable secure mode for SIDs transitions unless 2416 2416 the noatsecure permission is granted between 2417 2417 the two SIDs, i.e. ahp returns 0. */ 2418 - rc = avc_has_perm(old_tsec->sid, new_tsec->sid, 2418 + rc = avc_has_perm(old_crsec->sid, new_crsec->sid, 2419 2419 SECCLASS_PROCESS, PROCESS__NOATSECURE, 2420 2420 NULL); 2421 2421 bprm->secureexec |= !!rc; ··· 2483 2483 */ 2484 2484 static void selinux_bprm_committing_creds(const struct linux_binprm *bprm) 2485 2485 { 2486 - struct task_security_struct *new_tsec; 2486 + struct cred_security_struct *new_crsec; 2487 2487 struct rlimit *rlim, *initrlim; 2488 2488 int rc, i; 2489 2489 2490 - new_tsec = selinux_cred(bprm->cred); 2491 - if (new_tsec->sid == new_tsec->osid) 2490 + new_crsec = selinux_cred(bprm->cred); 2491 + if (new_crsec->sid == new_crsec->osid) 2492 2492 return; 2493 2493 2494 2494 /* Close files for which the new task SID is not authorized. */ ··· 2507 2507 * higher than the default soft limit for cases where the default is 2508 2508 * lower than the hard limit, e.g. RLIMIT_CORE or RLIMIT_STACK. 2509 2509 */ 2510 - rc = avc_has_perm(new_tsec->osid, new_tsec->sid, SECCLASS_PROCESS, 2510 + rc = avc_has_perm(new_crsec->osid, new_crsec->sid, SECCLASS_PROCESS, 2511 2511 PROCESS__RLIMITINH, NULL); 2512 2512 if (rc) { 2513 2513 /* protect against do_prlimit() */ ··· 2529 2529 */ 2530 2530 static void selinux_bprm_committed_creds(const struct linux_binprm *bprm) 2531 2531 { 2532 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 2532 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 2533 2533 u32 osid, sid; 2534 2534 int rc; 2535 2535 2536 - osid = tsec->osid; 2537 - sid = tsec->sid; 2536 + osid = crsec->osid; 2537 + sid = crsec->sid; 2538 2538 2539 2539 if (sid == osid) 2540 2540 return; ··· 2911 2911 { 2912 2912 u32 newsid; 2913 2913 int rc; 2914 - struct task_security_struct *tsec; 2914 + struct cred_security_struct *crsec; 2915 2915 2916 2916 rc = selinux_determine_inode_label(selinux_cred(old), 2917 2917 d_inode(dentry->d_parent), name, ··· 2920 2920 if (rc) 2921 2921 return rc; 2922 2922 2923 - tsec = selinux_cred(new); 2924 - tsec->create_sid = newsid; 2923 + crsec = selinux_cred(new); 2924 + crsec->create_sid = newsid; 2925 2925 return 0; 2926 2926 } 2927 2927 ··· 2929 2929 const struct qstr *qstr, 2930 2930 struct xattr *xattrs, int *xattr_count) 2931 2931 { 2932 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 2932 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 2933 2933 struct superblock_security_struct *sbsec; 2934 2934 struct xattr *xattr = lsm_get_xattr_slot(xattrs, xattr_count); 2935 2935 u32 newsid, clen; ··· 2939 2939 2940 2940 sbsec = selinux_superblock(dir->i_sb); 2941 2941 2942 - newsid = tsec->create_sid; 2942 + newsid = crsec->create_sid; 2943 2943 newsclass = inode_mode_to_security_class(inode->i_mode); 2944 - rc = selinux_determine_inode_label(tsec, dir, qstr, newsclass, &newsid); 2944 + rc = selinux_determine_inode_label(crsec, dir, qstr, newsclass, &newsid); 2945 2945 if (rc) 2946 2946 return rc; 2947 2947 ··· 3113 3113 static inline void task_avdcache_reset(struct task_security_struct *tsec) 3114 3114 { 3115 3115 memset(&tsec->avdcache.dir, 0, sizeof(tsec->avdcache.dir)); 3116 - tsec->avdcache.sid = tsec->sid; 3116 + tsec->avdcache.sid = current_sid(); 3117 3117 tsec->avdcache.seqno = avc_policy_seqno(); 3118 3118 tsec->avdcache.dir_spot = TSEC_AVDC_DIR_SIZE - 1; 3119 3119 } ··· 3137 3137 if (isec->sclass != SECCLASS_DIR) 3138 3138 return -ENOENT; 3139 3139 3140 - if (unlikely(tsec->sid != tsec->avdcache.sid || 3140 + if (unlikely(current_sid() != tsec->avdcache.sid || 3141 3141 tsec->avdcache.seqno != avc_policy_seqno())) { 3142 3142 task_avdcache_reset(tsec); 3143 3143 return -ENOENT; ··· 3201 3201 { 3202 3202 int mask; 3203 3203 u32 perms; 3204 + u32 sid = current_sid(); 3204 3205 struct task_security_struct *tsec; 3205 3206 struct inode_security_struct *isec; 3206 3207 struct avdc_entry *avdc; ··· 3214 3213 if (!mask) 3215 3214 return 0; 3216 3215 3217 - tsec = selinux_cred(current_cred()); 3218 - if (task_avdcache_permnoaudit(tsec)) 3216 + tsec = selinux_task(current); 3217 + if (task_avdcache_permnoaudit(tsec, sid)) 3219 3218 return 0; 3220 3219 3221 3220 isec = inode_security_rcu(inode, requested & MAY_NOT_BLOCK); ··· 3235 3234 struct av_decision avd; 3236 3235 3237 3236 /* Cache miss. */ 3238 - rc = avc_has_perm_noaudit(tsec->sid, isec->sid, isec->sclass, 3237 + rc = avc_has_perm_noaudit(sid, isec->sid, isec->sclass, 3239 3238 perms, 0, &avd); 3240 3239 audited = avc_audit_required(perms, &avd, rc, 3241 3240 (requested & MAY_ACCESS) ? FILE__AUDIT_ACCESS : 0, ··· 3286 3285 { 3287 3286 struct task_security_struct *tsec; 3288 3287 3289 - tsec = selinux_cred(current_cred()); 3288 + tsec = selinux_task(current); 3290 3289 3291 - if (task_avdcache_permnoaudit(tsec)) 3290 + if (task_avdcache_permnoaudit(tsec, current_sid())) 3292 3291 return 0; 3293 3292 3294 3293 return path_has_perm(current_cred(), path, FILE__GETATTR); ··· 3660 3659 static int selinux_inode_copy_up(struct dentry *src, struct cred **new) 3661 3660 { 3662 3661 struct lsm_prop prop; 3663 - struct task_security_struct *tsec; 3662 + struct cred_security_struct *crsec; 3664 3663 struct cred *new_creds = *new; 3665 3664 3666 3665 if (new_creds == NULL) { ··· 3669 3668 return -ENOMEM; 3670 3669 } 3671 3670 3672 - tsec = selinux_cred(new_creds); 3671 + crsec = selinux_cred(new_creds); 3673 3672 /* Get label from overlay inode and set it in create_sid */ 3674 3673 selinux_inode_getlsmprop(d_inode(src), &prop); 3675 - tsec->create_sid = prop.selinux.secid; 3674 + crsec->create_sid = prop.selinux.secid; 3676 3675 *new = new_creds; 3677 3676 return 0; 3678 3677 } ··· 3698 3697 static int selinux_kernfs_init_security(struct kernfs_node *kn_dir, 3699 3698 struct kernfs_node *kn) 3700 3699 { 3701 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 3700 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 3702 3701 u32 parent_sid, newsid, clen; 3703 3702 int rc; 3704 3703 char *context; ··· 3726 3725 if (rc) 3727 3726 return rc; 3728 3727 3729 - if (tsec->create_sid) { 3730 - newsid = tsec->create_sid; 3728 + if (crsec->create_sid) { 3729 + newsid = crsec->create_sid; 3731 3730 } else { 3732 3731 u16 secclass = inode_mode_to_security_class(kn->mode); 3733 3732 const char *kn_name; ··· 3738 3737 q.name = kn_name; 3739 3738 q.hash_len = hashlen_string(kn_dir, kn_name); 3740 3739 3741 - rc = security_transition_sid(tsec->sid, 3740 + rc = security_transition_sid(crsec->sid, 3742 3741 parent_sid, secclass, &q, 3743 3742 &newsid); 3744 3743 if (rc) ··· 4152 4151 u64 clone_flags) 4153 4152 { 4154 4153 u32 sid = current_sid(); 4154 + struct task_security_struct *old_tsec = selinux_task(current); 4155 + struct task_security_struct *new_tsec = selinux_task(task); 4155 4156 4157 + *new_tsec = *old_tsec; 4156 4158 return avc_has_perm(sid, sid, SECCLASS_PROCESS, PROCESS__FORK, NULL); 4157 4159 } 4158 4160 ··· 4165 4161 static int selinux_cred_prepare(struct cred *new, const struct cred *old, 4166 4162 gfp_t gfp) 4167 4163 { 4168 - const struct task_security_struct *old_tsec = selinux_cred(old); 4169 - struct task_security_struct *tsec = selinux_cred(new); 4164 + const struct cred_security_struct *old_crsec = selinux_cred(old); 4165 + struct cred_security_struct *crsec = selinux_cred(new); 4170 4166 4171 - *tsec = *old_tsec; 4167 + *crsec = *old_crsec; 4172 4168 return 0; 4173 4169 } 4174 4170 ··· 4177 4173 */ 4178 4174 static void selinux_cred_transfer(struct cred *new, const struct cred *old) 4179 4175 { 4180 - const struct task_security_struct *old_tsec = selinux_cred(old); 4181 - struct task_security_struct *tsec = selinux_cred(new); 4176 + const struct cred_security_struct *old_crsec = selinux_cred(old); 4177 + struct cred_security_struct *crsec = selinux_cred(new); 4182 4178 4183 - *tsec = *old_tsec; 4179 + *crsec = *old_crsec; 4184 4180 } 4185 4181 4186 4182 static void selinux_cred_getsecid(const struct cred *c, u32 *secid) ··· 4199 4195 */ 4200 4196 static int selinux_kernel_act_as(struct cred *new, u32 secid) 4201 4197 { 4202 - struct task_security_struct *tsec = selinux_cred(new); 4198 + struct cred_security_struct *crsec = selinux_cred(new); 4203 4199 u32 sid = current_sid(); 4204 4200 int ret; 4205 4201 ··· 4208 4204 KERNEL_SERVICE__USE_AS_OVERRIDE, 4209 4205 NULL); 4210 4206 if (ret == 0) { 4211 - tsec->sid = secid; 4212 - tsec->create_sid = 0; 4213 - tsec->keycreate_sid = 0; 4214 - tsec->sockcreate_sid = 0; 4207 + crsec->sid = secid; 4208 + crsec->create_sid = 0; 4209 + crsec->keycreate_sid = 0; 4210 + crsec->sockcreate_sid = 0; 4215 4211 } 4216 4212 return ret; 4217 4213 } ··· 4223 4219 static int selinux_kernel_create_files_as(struct cred *new, struct inode *inode) 4224 4220 { 4225 4221 struct inode_security_struct *isec = inode_security(inode); 4226 - struct task_security_struct *tsec = selinux_cred(new); 4222 + struct cred_security_struct *crsec = selinux_cred(new); 4227 4223 u32 sid = current_sid(); 4228 4224 int ret; 4229 4225 ··· 4233 4229 NULL); 4234 4230 4235 4231 if (ret == 0) 4236 - tsec->create_sid = isec->sid; 4232 + crsec->create_sid = isec->sid; 4237 4233 return ret; 4238 4234 } 4239 4235 ··· 4748 4744 4749 4745 /* socket security operations */ 4750 4746 4751 - static int socket_sockcreate_sid(const struct task_security_struct *tsec, 4747 + static int socket_sockcreate_sid(const struct cred_security_struct *crsec, 4752 4748 u16 secclass, u32 *socksid) 4753 4749 { 4754 - if (tsec->sockcreate_sid > SECSID_NULL) { 4755 - *socksid = tsec->sockcreate_sid; 4750 + if (crsec->sockcreate_sid > SECSID_NULL) { 4751 + *socksid = crsec->sockcreate_sid; 4756 4752 return 0; 4757 4753 } 4758 4754 4759 - return security_transition_sid(tsec->sid, tsec->sid, 4755 + return security_transition_sid(crsec->sid, crsec->sid, 4760 4756 secclass, NULL, socksid); 4761 4757 } 4762 4758 ··· 4801 4797 static int selinux_socket_create(int family, int type, 4802 4798 int protocol, int kern) 4803 4799 { 4804 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 4800 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 4805 4801 u32 newsid; 4806 4802 u16 secclass; 4807 4803 int rc; ··· 4810 4806 return 0; 4811 4807 4812 4808 secclass = socket_type_to_security_class(family, type, protocol); 4813 - rc = socket_sockcreate_sid(tsec, secclass, &newsid); 4809 + rc = socket_sockcreate_sid(crsec, secclass, &newsid); 4814 4810 if (rc) 4815 4811 return rc; 4816 4812 4817 - return avc_has_perm(tsec->sid, newsid, secclass, SOCKET__CREATE, NULL); 4813 + return avc_has_perm(crsec->sid, newsid, secclass, SOCKET__CREATE, NULL); 4818 4814 } 4819 4815 4820 4816 static int selinux_socket_post_create(struct socket *sock, int family, 4821 4817 int type, int protocol, int kern) 4822 4818 { 4823 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 4819 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 4824 4820 struct inode_security_struct *isec = inode_security_novalidate(SOCK_INODE(sock)); 4825 4821 struct sk_security_struct *sksec; 4826 4822 u16 sclass = socket_type_to_security_class(family, type, protocol); ··· 4828 4824 int err = 0; 4829 4825 4830 4826 if (!kern) { 4831 - err = socket_sockcreate_sid(tsec, sclass, &sid); 4827 + err = socket_sockcreate_sid(crsec, sclass, &sid); 4832 4828 if (err) 4833 4829 return err; 4834 4830 } ··· 6530 6526 static int selinux_lsm_getattr(unsigned int attr, struct task_struct *p, 6531 6527 char **value) 6532 6528 { 6533 - const struct task_security_struct *tsec; 6529 + const struct cred_security_struct *crsec; 6534 6530 int error; 6535 6531 u32 sid; 6536 6532 u32 len; 6537 6533 6538 6534 rcu_read_lock(); 6539 - tsec = selinux_cred(__task_cred(p)); 6535 + crsec = selinux_cred(__task_cred(p)); 6540 6536 if (p != current) { 6541 - error = avc_has_perm(current_sid(), tsec->sid, 6537 + error = avc_has_perm(current_sid(), crsec->sid, 6542 6538 SECCLASS_PROCESS, PROCESS__GETATTR, NULL); 6543 6539 if (error) 6544 6540 goto err_unlock; 6545 6541 } 6546 6542 switch (attr) { 6547 6543 case LSM_ATTR_CURRENT: 6548 - sid = tsec->sid; 6544 + sid = crsec->sid; 6549 6545 break; 6550 6546 case LSM_ATTR_PREV: 6551 - sid = tsec->osid; 6547 + sid = crsec->osid; 6552 6548 break; 6553 6549 case LSM_ATTR_EXEC: 6554 - sid = tsec->exec_sid; 6550 + sid = crsec->exec_sid; 6555 6551 break; 6556 6552 case LSM_ATTR_FSCREATE: 6557 - sid = tsec->create_sid; 6553 + sid = crsec->create_sid; 6558 6554 break; 6559 6555 case LSM_ATTR_KEYCREATE: 6560 - sid = tsec->keycreate_sid; 6556 + sid = crsec->keycreate_sid; 6561 6557 break; 6562 6558 case LSM_ATTR_SOCKCREATE: 6563 - sid = tsec->sockcreate_sid; 6559 + sid = crsec->sockcreate_sid; 6564 6560 break; 6565 6561 default: 6566 6562 error = -EOPNOTSUPP; ··· 6585 6581 6586 6582 static int selinux_lsm_setattr(u64 attr, void *value, size_t size) 6587 6583 { 6588 - struct task_security_struct *tsec; 6584 + struct cred_security_struct *crsec; 6589 6585 struct cred *new; 6590 6586 u32 mysid = current_sid(), sid = 0, ptsid; 6591 6587 int error; ··· 6671 6667 operation. See selinux_bprm_creds_for_exec for the execve 6672 6668 checks and may_create for the file creation checks. The 6673 6669 operation will then fail if the context is not permitted. */ 6674 - tsec = selinux_cred(new); 6670 + crsec = selinux_cred(new); 6675 6671 if (attr == LSM_ATTR_EXEC) { 6676 - tsec->exec_sid = sid; 6672 + crsec->exec_sid = sid; 6677 6673 } else if (attr == LSM_ATTR_FSCREATE) { 6678 - tsec->create_sid = sid; 6674 + crsec->create_sid = sid; 6679 6675 } else if (attr == LSM_ATTR_KEYCREATE) { 6680 6676 if (sid) { 6681 6677 error = avc_has_perm(mysid, sid, ··· 6683 6679 if (error) 6684 6680 goto abort_change; 6685 6681 } 6686 - tsec->keycreate_sid = sid; 6682 + crsec->keycreate_sid = sid; 6687 6683 } else if (attr == LSM_ATTR_SOCKCREATE) { 6688 - tsec->sockcreate_sid = sid; 6684 + crsec->sockcreate_sid = sid; 6689 6685 } else if (attr == LSM_ATTR_CURRENT) { 6690 6686 error = -EINVAL; 6691 6687 if (sid == 0) 6692 6688 goto abort_change; 6693 6689 6694 6690 if (!current_is_single_threaded()) { 6695 - error = security_bounded_transition(tsec->sid, sid); 6691 + error = security_bounded_transition(crsec->sid, sid); 6696 6692 if (error) 6697 6693 goto abort_change; 6698 6694 } 6699 6695 6700 6696 /* Check permissions for the transition. */ 6701 - error = avc_has_perm(tsec->sid, sid, SECCLASS_PROCESS, 6697 + error = avc_has_perm(crsec->sid, sid, SECCLASS_PROCESS, 6702 6698 PROCESS__DYNTRANSITION, NULL); 6703 6699 if (error) 6704 6700 goto abort_change; ··· 6713 6709 goto abort_change; 6714 6710 } 6715 6711 6716 - tsec->sid = sid; 6712 + crsec->sid = sid; 6717 6713 } else { 6718 6714 error = -EINVAL; 6719 6715 goto abort_change; ··· 6880 6876 static int selinux_key_alloc(struct key *k, const struct cred *cred, 6881 6877 unsigned long flags) 6882 6878 { 6883 - const struct task_security_struct *tsec; 6879 + const struct cred_security_struct *crsec; 6884 6880 struct key_security_struct *ksec = selinux_key(k); 6885 6881 6886 - tsec = selinux_cred(cred); 6887 - if (tsec->keycreate_sid) 6888 - ksec->sid = tsec->keycreate_sid; 6882 + crsec = selinux_cred(cred); 6883 + if (crsec->keycreate_sid) 6884 + ksec->sid = crsec->keycreate_sid; 6889 6885 else 6890 - ksec->sid = tsec->sid; 6886 + ksec->sid = crsec->sid; 6891 6887 6892 6888 return 0; 6893 6889 } ··· 7141 7137 #endif 7142 7138 7143 7139 struct lsm_blob_sizes selinux_blob_sizes __ro_after_init = { 7144 - .lbs_cred = sizeof(struct task_security_struct), 7140 + .lbs_cred = sizeof(struct cred_security_struct), 7141 + .lbs_task = sizeof(struct task_security_struct), 7145 7142 .lbs_file = sizeof(struct file_security_struct), 7146 7143 .lbs_inode = sizeof(struct inode_security_struct), 7147 7144 .lbs_ipc = sizeof(struct ipc_security_struct),
+16 -6
security/selinux/include/objsec.h
··· 37 37 bool permissive; /* AVC permissive flag */ 38 38 }; 39 39 40 - struct task_security_struct { 40 + struct cred_security_struct { 41 41 u32 osid; /* SID prior to last execve */ 42 42 u32 sid; /* current SID */ 43 43 u32 exec_sid; /* exec SID */ 44 44 u32 create_sid; /* fscreate SID */ 45 45 u32 keycreate_sid; /* keycreate SID */ 46 46 u32 sockcreate_sid; /* fscreate SID */ 47 + } __randomize_layout; 48 + 49 + struct task_security_struct { 47 50 #define TSEC_AVDC_DIR_SIZE (1 << 2) 48 51 struct { 49 52 u32 sid; /* current SID for cached entries */ ··· 57 54 } avdcache; 58 55 } __randomize_layout; 59 56 60 - static inline bool task_avdcache_permnoaudit(struct task_security_struct *tsec) 57 + static inline bool task_avdcache_permnoaudit(struct task_security_struct *tsec, 58 + u32 sid) 61 59 { 62 60 return (tsec->avdcache.permissive_neveraudit && 63 - tsec->sid == tsec->avdcache.sid && 61 + sid == tsec->avdcache.sid && 64 62 tsec->avdcache.seqno == avc_policy_seqno()); 65 63 } 66 64 ··· 176 172 }; 177 173 178 174 extern struct lsm_blob_sizes selinux_blob_sizes; 179 - static inline struct task_security_struct *selinux_cred(const struct cred *cred) 175 + static inline struct cred_security_struct *selinux_cred(const struct cred *cred) 180 176 { 181 177 return cred->security + selinux_blob_sizes.lbs_cred; 178 + } 179 + 180 + static inline struct task_security_struct * 181 + selinux_task(const struct task_struct *task) 182 + { 183 + return task->security + selinux_blob_sizes.lbs_task; 182 184 } 183 185 184 186 static inline struct file_security_struct *selinux_file(const struct file *file) ··· 217 207 */ 218 208 static inline u32 current_sid(void) 219 209 { 220 - const struct task_security_struct *tsec = selinux_cred(current_cred()); 210 + const struct cred_security_struct *crsec = selinux_cred(current_cred()); 221 211 222 - return tsec->sid; 212 + return crsec->sid; 223 213 } 224 214 225 215 static inline struct superblock_security_struct *
+4 -10
sound/soc/stm/stm32_sai.c
··· 138 138 if (!pdev) { 139 139 dev_err(&sai_client->pdev->dev, 140 140 "Device not found for node %pOFn\n", np_provider); 141 - of_node_put(np_provider); 142 141 return -ENODEV; 143 142 } 144 143 145 144 sai_provider = platform_get_drvdata(pdev); 145 + put_device(&pdev->dev); 146 146 if (!sai_provider) { 147 147 dev_err(&sai_client->pdev->dev, 148 148 "SAI sync provider data not found\n"); 149 - ret = -EINVAL; 150 - goto error; 149 + return -EINVAL; 151 150 } 152 151 153 152 /* Configure sync client */ 154 153 ret = stm32_sai_sync_conf_client(sai_client, synci); 155 154 if (ret < 0) 156 - goto error; 155 + return ret; 157 156 158 157 /* Configure sync provider */ 159 - ret = stm32_sai_sync_conf_provider(sai_provider, synco); 160 - 161 - error: 162 - put_device(&pdev->dev); 163 - of_node_put(np_provider); 164 - return ret; 158 + return stm32_sai_sync_conf_provider(sai_provider, synco); 165 159 } 166 160 167 161 static int stm32_sai_get_parent_clk(struct stm32_sai_data *sai)
+40 -17
sound/soc/stm/stm32_sai_sub.c
··· 1586 1586 dev_err(&pdev->dev, 1587 1587 "External synchro not supported\n"); 1588 1588 of_node_put(args.np); 1589 - return -EINVAL; 1589 + ret = -EINVAL; 1590 + goto err_put_sync_provider; 1590 1591 } 1591 1592 sai->sync = SAI_SYNC_EXTERNAL; 1592 1593 ··· 1596 1595 (sai->synci > (SAI_GCR_SYNCIN_MAX + 1))) { 1597 1596 dev_err(&pdev->dev, "Wrong SAI index\n"); 1598 1597 of_node_put(args.np); 1599 - return -EINVAL; 1598 + ret = -EINVAL; 1599 + goto err_put_sync_provider; 1600 1600 } 1601 1601 1602 1602 if (of_property_match_string(args.np, "compatible", ··· 1611 1609 if (!sai->synco) { 1612 1610 dev_err(&pdev->dev, "Unknown SAI sub-block\n"); 1613 1611 of_node_put(args.np); 1614 - return -EINVAL; 1612 + ret = -EINVAL; 1613 + goto err_put_sync_provider; 1615 1614 } 1616 1615 } 1617 1616 ··· 1622 1619 1623 1620 of_node_put(args.np); 1624 1621 sai->sai_ck = devm_clk_get(&pdev->dev, "sai_ck"); 1625 - if (IS_ERR(sai->sai_ck)) 1626 - return dev_err_probe(&pdev->dev, PTR_ERR(sai->sai_ck), 1627 - "Missing kernel clock sai_ck\n"); 1622 + if (IS_ERR(sai->sai_ck)) { 1623 + ret = dev_err_probe(&pdev->dev, PTR_ERR(sai->sai_ck), 1624 + "Missing kernel clock sai_ck\n"); 1625 + goto err_put_sync_provider; 1626 + } 1628 1627 1629 1628 ret = clk_prepare(sai->pdata->pclk); 1630 1629 if (ret < 0) 1631 - return ret; 1630 + goto err_put_sync_provider; 1632 1631 1633 1632 if (STM_SAI_IS_F4(sai->pdata)) 1634 1633 return 0; ··· 1639 1634 if (of_property_present(np, "#clock-cells")) { 1640 1635 ret = stm32_sai_add_mclk_provider(sai); 1641 1636 if (ret < 0) 1642 - return ret; 1637 + goto err_unprepare_pclk; 1643 1638 } else { 1644 1639 sai->sai_mclk = devm_clk_get_optional(&pdev->dev, "MCLK"); 1645 - if (IS_ERR(sai->sai_mclk)) 1646 - return PTR_ERR(sai->sai_mclk); 1640 + if (IS_ERR(sai->sai_mclk)) { 1641 + ret = PTR_ERR(sai->sai_mclk); 1642 + goto err_unprepare_pclk; 1643 + } 1647 1644 } 1648 1645 1649 1646 return 0; 1647 + 1648 + err_unprepare_pclk: 1649 + clk_unprepare(sai->pdata->pclk); 1650 + err_put_sync_provider: 1651 + of_node_put(sai->np_sync_provider); 1652 + 1653 + return ret; 1650 1654 } 1651 1655 1652 1656 static int stm32_sai_sub_probe(struct platform_device *pdev) ··· 1702 1688 IRQF_SHARED, dev_name(&pdev->dev), sai); 1703 1689 if (ret) { 1704 1690 dev_err(&pdev->dev, "IRQ request returned %d\n", ret); 1705 - return ret; 1691 + goto err_unprepare_pclk; 1706 1692 } 1707 1693 1708 1694 if (STM_SAI_PROTOCOL_IS_SPDIF(sai)) 1709 1695 conf = &stm32_sai_pcm_config_spdif; 1710 1696 1711 1697 ret = snd_dmaengine_pcm_register(&pdev->dev, conf, 0); 1712 - if (ret) 1713 - return dev_err_probe(&pdev->dev, ret, "Could not register pcm dma\n"); 1698 + if (ret) { 1699 + ret = dev_err_probe(&pdev->dev, ret, "Could not register pcm dma\n"); 1700 + goto err_unprepare_pclk; 1701 + } 1714 1702 1715 1703 ret = snd_soc_register_component(&pdev->dev, &stm32_component, 1716 1704 &sai->cpu_dai_drv, 1); 1717 - if (ret) { 1718 - snd_dmaengine_pcm_unregister(&pdev->dev); 1719 - return ret; 1720 - } 1705 + if (ret) 1706 + goto err_deregister_pcm_dma; 1721 1707 1722 1708 pm_runtime_enable(&pdev->dev); 1723 1709 1724 1710 return 0; 1711 + 1712 + err_deregister_pcm_dma: 1713 + snd_dmaengine_pcm_unregister(&pdev->dev); 1714 + err_unprepare_pclk: 1715 + clk_unprepare(sai->pdata->pclk); 1716 + of_node_put(sai->np_sync_provider); 1717 + 1718 + return ret; 1725 1719 } 1726 1720 1727 1721 static void stm32_sai_sub_remove(struct platform_device *pdev) ··· 1740 1718 snd_dmaengine_pcm_unregister(&pdev->dev); 1741 1719 snd_soc_unregister_component(&pdev->dev); 1742 1720 pm_runtime_disable(&pdev->dev); 1721 + of_node_put(sai->np_sync_provider); 1743 1722 } 1744 1723 1745 1724 static int stm32_sai_sub_suspend(struct device *dev)
+3 -2
tools/arch/riscv/include/asm/csr.h
··· 167 167 #define VSIP_TO_HVIP_SHIFT (IRQ_VS_SOFT - IRQ_S_SOFT) 168 168 #define VSIP_VALID_MASK ((_AC(1, UL) << IRQ_S_SOFT) | \ 169 169 (_AC(1, UL) << IRQ_S_TIMER) | \ 170 - (_AC(1, UL) << IRQ_S_EXT)) 170 + (_AC(1, UL) << IRQ_S_EXT) | \ 171 + (_AC(1, UL) << IRQ_PMU_OVF)) 171 172 172 173 /* AIA CSR bits */ 173 174 #define TOPI_IID_SHIFT 16 ··· 281 280 #define CSR_HPMCOUNTER30H 0xc9e 282 281 #define CSR_HPMCOUNTER31H 0xc9f 283 282 284 - #define CSR_SSCOUNTOVF 0xda0 283 + #define CSR_SCOUNTOVF 0xda0 285 284 286 285 #define CSR_SSTATUS 0x100 287 286 #define CSR_SIE 0x104
+1
tools/testing/selftests/net/.gitignore
··· 45 45 socket 46 46 so_incoming_cpu 47 47 so_netns_cookie 48 + so_peek_off 48 49 so_txtime 49 50 so_rcv_listener 50 51 stress_reuseport_listen
+1
tools/testing/selftests/net/af_unix/Makefile
··· 6 6 scm_inq \ 7 7 scm_pidfd \ 8 8 scm_rights \ 9 + so_peek_off \ 9 10 unix_connect \ 10 11 # end of TEST_GEN_PROGS 11 12
+162
tools/testing/selftests/net/af_unix/so_peek_off.c
··· 1 + // SPDX-License-Identifier: GPL-2.0 2 + /* Copyright 2025 Google LLC */ 3 + 4 + #include <stdlib.h> 5 + #include <unistd.h> 6 + 7 + #include <sys/socket.h> 8 + 9 + #include "../../kselftest_harness.h" 10 + 11 + FIXTURE(so_peek_off) 12 + { 13 + int fd[2]; /* 0: sender, 1: receiver */ 14 + }; 15 + 16 + FIXTURE_VARIANT(so_peek_off) 17 + { 18 + int type; 19 + }; 20 + 21 + FIXTURE_VARIANT_ADD(so_peek_off, stream) 22 + { 23 + .type = SOCK_STREAM, 24 + }; 25 + 26 + FIXTURE_VARIANT_ADD(so_peek_off, dgram) 27 + { 28 + .type = SOCK_DGRAM, 29 + }; 30 + 31 + FIXTURE_VARIANT_ADD(so_peek_off, seqpacket) 32 + { 33 + .type = SOCK_SEQPACKET, 34 + }; 35 + 36 + FIXTURE_SETUP(so_peek_off) 37 + { 38 + struct timeval timeout = { 39 + .tv_sec = 0, 40 + .tv_usec = 3000, 41 + }; 42 + int ret; 43 + 44 + ret = socketpair(AF_UNIX, variant->type, 0, self->fd); 45 + ASSERT_EQ(0, ret); 46 + 47 + ret = setsockopt(self->fd[1], SOL_SOCKET, SO_RCVTIMEO_NEW, 48 + &timeout, sizeof(timeout)); 49 + ASSERT_EQ(0, ret); 50 + 51 + ret = setsockopt(self->fd[1], SOL_SOCKET, SO_PEEK_OFF, 52 + &(int){0}, sizeof(int)); 53 + ASSERT_EQ(0, ret); 54 + } 55 + 56 + FIXTURE_TEARDOWN(so_peek_off) 57 + { 58 + close_range(self->fd[0], self->fd[1], 0); 59 + } 60 + 61 + #define sendeq(fd, str, flags) \ 62 + do { \ 63 + int bytes, len = strlen(str); \ 64 + \ 65 + bytes = send(fd, str, len, flags); \ 66 + ASSERT_EQ(len, bytes); \ 67 + } while (0) 68 + 69 + #define recveq(fd, str, buflen, flags) \ 70 + do { \ 71 + char buf[(buflen) + 1] = {}; \ 72 + int bytes; \ 73 + \ 74 + bytes = recv(fd, buf, buflen, flags); \ 75 + ASSERT_NE(-1, bytes); \ 76 + ASSERT_STREQ(str, buf); \ 77 + } while (0) 78 + 79 + #define async \ 80 + for (pid_t pid = (pid = fork(), \ 81 + pid < 0 ? \ 82 + __TH_LOG("Failed to start async {}"), \ 83 + _metadata->exit_code = KSFT_FAIL, \ 84 + __bail(1, _metadata), \ 85 + 0xdead : \ 86 + pid); \ 87 + !pid; exit(0)) 88 + 89 + TEST_F(so_peek_off, single_chunk) 90 + { 91 + sendeq(self->fd[0], "aaaabbbb", 0); 92 + 93 + recveq(self->fd[1], "aaaa", 4, MSG_PEEK); 94 + recveq(self->fd[1], "bbbb", 100, MSG_PEEK); 95 + } 96 + 97 + TEST_F(so_peek_off, two_chunks) 98 + { 99 + sendeq(self->fd[0], "aaaa", 0); 100 + sendeq(self->fd[0], "bbbb", 0); 101 + 102 + recveq(self->fd[1], "aaaa", 4, MSG_PEEK); 103 + recveq(self->fd[1], "bbbb", 100, MSG_PEEK); 104 + } 105 + 106 + TEST_F(so_peek_off, two_chunks_blocking) 107 + { 108 + async { 109 + usleep(1000); 110 + sendeq(self->fd[0], "aaaa", 0); 111 + } 112 + 113 + recveq(self->fd[1], "aaaa", 4, MSG_PEEK); 114 + 115 + async { 116 + usleep(1000); 117 + sendeq(self->fd[0], "bbbb", 0); 118 + } 119 + 120 + /* goto again; -> goto redo; in unix_stream_read_generic(). */ 121 + recveq(self->fd[1], "bbbb", 100, MSG_PEEK); 122 + } 123 + 124 + TEST_F(so_peek_off, two_chunks_overlap) 125 + { 126 + sendeq(self->fd[0], "aaaa", 0); 127 + recveq(self->fd[1], "aa", 2, MSG_PEEK); 128 + 129 + sendeq(self->fd[0], "bbbb", 0); 130 + 131 + if (variant->type == SOCK_STREAM) { 132 + /* SOCK_STREAM tries to fill the buffer. */ 133 + recveq(self->fd[1], "aabb", 4, MSG_PEEK); 134 + recveq(self->fd[1], "bb", 100, MSG_PEEK); 135 + } else { 136 + /* SOCK_DGRAM and SOCK_SEQPACKET returns at the skb boundary. */ 137 + recveq(self->fd[1], "aa", 100, MSG_PEEK); 138 + recveq(self->fd[1], "bbbb", 100, MSG_PEEK); 139 + } 140 + } 141 + 142 + TEST_F(so_peek_off, two_chunks_overlap_blocking) 143 + { 144 + async { 145 + usleep(1000); 146 + sendeq(self->fd[0], "aaaa", 0); 147 + } 148 + 149 + recveq(self->fd[1], "aa", 2, MSG_PEEK); 150 + 151 + async { 152 + usleep(1000); 153 + sendeq(self->fd[0], "bbbb", 0); 154 + } 155 + 156 + /* Even SOCK_STREAM does not wait if at least one byte is read. */ 157 + recveq(self->fd[1], "aa", 100, MSG_PEEK); 158 + 159 + recveq(self->fd[1], "bbbb", 100, MSG_PEEK); 160 + } 161 + 162 + TEST_HARNESS_MAIN
+7
tools/testing/selftests/net/forwarding/lib_sh_test.sh
··· 30 30 do_test "tfail" false 31 31 } 32 32 33 + tfail2() 34 + { 35 + do_test "tfail2" false 36 + } 37 + 33 38 txfail() 34 39 { 35 40 FAIL_TO_XFAIL=yes do_test "txfail" false ··· 137 132 ret_subtest $ksft_fail "tfail" txfail tfail 138 133 139 134 ret_subtest $ksft_xfail "txfail" txfail txfail 135 + 136 + ret_subtest $ksft_fail "tfail2" tfail2 tfail 140 137 } 141 138 142 139 exit_status_tests_run()
+1 -1
tools/testing/selftests/net/lib.sh
··· 43 43 weights[$i]=$((weight++)) 44 44 done 45 45 46 - if [[ ${weights[$a]} > ${weights[$b]} ]]; then 46 + if [[ ${weights[$a]} -ge ${weights[$b]} ]]; then 47 47 echo "$a" 48 48 return 0 49 49 else
+16 -11
tools/testing/selftests/net/mptcp/mptcp_join.sh
··· 3500 3500 fastclose_tests() 3501 3501 { 3502 3502 if reset_check_counter "fastclose test" "MPTcpExtMPFastcloseTx"; then 3503 - MPTCP_LIB_SUBTEST_FLAKY=1 3504 3503 test_linkfail=1024 fastclose=client \ 3505 3504 run_tests $ns1 $ns2 10.0.1.1 3506 3505 chk_join_nr 0 0 0 ··· 3508 3509 fi 3509 3510 3510 3511 if reset_check_counter "fastclose server test" "MPTcpExtMPFastcloseRx"; then 3511 - MPTCP_LIB_SUBTEST_FLAKY=1 3512 3512 test_linkfail=1024 fastclose=server \ 3513 3513 run_tests $ns1 $ns2 10.0.1.1 3514 3514 join_rst_nr=1 \ ··· 3804 3806 continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then 3805 3807 set_userspace_pm $ns1 3806 3808 pm_nl_set_limits $ns2 2 2 3807 - { test_linkfail=128 speed=5 \ 3809 + { timeout_test=120 test_linkfail=128 speed=5 \ 3808 3810 run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null 3809 3811 local tests_pid=$! 3810 3812 wait_mpj $ns1 ··· 3837 3839 continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then 3838 3840 set_userspace_pm $ns2 3839 3841 pm_nl_set_limits $ns1 0 1 3840 - { test_linkfail=128 speed=5 \ 3842 + { timeout_test=120 test_linkfail=128 speed=5 \ 3841 3843 run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null 3842 3844 local tests_pid=$! 3843 3845 wait_mpj $ns2 ··· 3865 3867 continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then 3866 3868 set_userspace_pm $ns2 3867 3869 pm_nl_set_limits $ns1 0 1 3868 - { test_linkfail=128 speed=5 \ 3870 + { timeout_test=120 test_linkfail=128 speed=5 \ 3869 3871 run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null 3870 3872 local tests_pid=$! 3871 3873 wait_mpj $ns2 ··· 3886 3888 continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then 3887 3889 set_userspace_pm $ns2 3888 3890 pm_nl_set_limits $ns1 0 1 3889 - { test_linkfail=128 speed=5 \ 3891 + { timeout_test=120 test_linkfail=128 speed=5 \ 3890 3892 run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null 3891 3893 local tests_pid=$! 3892 3894 wait_mpj $ns2 ··· 3910 3912 continue_if mptcp_lib_has_file '/proc/sys/net/mptcp/pm_type'; then 3911 3913 set_userspace_pm $ns1 3912 3914 pm_nl_set_limits $ns2 1 1 3913 - { test_linkfail=128 speed=5 \ 3915 + { timeout_test=120 test_linkfail=128 speed=5 \ 3914 3916 run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null 3915 3917 local tests_pid=$! 3916 3918 wait_mpj $ns1 ··· 3941 3943 pm_nl_set_limits $ns1 2 2 3942 3944 pm_nl_set_limits $ns2 2 2 3943 3945 pm_nl_add_endpoint $ns1 10.0.2.1 flags signal 3944 - { test_linkfail=128 speed=slow \ 3946 + { timeout_test=120 test_linkfail=128 speed=slow \ 3945 3947 run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null 3946 3948 local tests_pid=$! 3947 3949 ··· 3968 3970 pm_nl_set_limits $ns2 0 3 3969 3971 pm_nl_add_endpoint $ns2 10.0.1.2 id 1 dev ns2eth1 flags subflow 3970 3972 pm_nl_add_endpoint $ns2 10.0.2.2 id 2 dev ns2eth2 flags subflow 3971 - { test_linkfail=128 speed=5 \ 3973 + { timeout_test=120 test_linkfail=128 speed=5 \ 3972 3974 run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null 3973 3975 local tests_pid=$! 3974 3976 ··· 4046 4048 # broadcast IP: no packet for this address will be received on ns1 4047 4049 pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal 4048 4050 pm_nl_add_endpoint $ns1 10.0.1.1 id 42 flags signal 4049 - { test_linkfail=128 speed=5 \ 4051 + { timeout_test=120 test_linkfail=128 speed=5 \ 4050 4052 run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null 4051 4053 local tests_pid=$! 4052 4054 ··· 4055 4057 $ns1 10.0.2.1 id 1 flags signal 4056 4058 chk_subflow_nr "before delete" 2 4057 4059 chk_mptcp_info subflows 1 subflows 1 4060 + chk_mptcp_info add_addr_signal 2 add_addr_accepted 1 4058 4061 4059 4062 pm_nl_del_endpoint $ns1 1 10.0.2.1 4060 4063 pm_nl_del_endpoint $ns1 2 224.0.0.1 4061 4064 sleep 0.5 4062 4065 chk_subflow_nr "after delete" 1 4063 4066 chk_mptcp_info subflows 0 subflows 0 4067 + chk_mptcp_info add_addr_signal 0 add_addr_accepted 0 4064 4068 4065 4069 pm_nl_add_endpoint $ns1 10.0.2.1 id 1 flags signal 4066 4070 pm_nl_add_endpoint $ns1 10.0.3.1 id 2 flags signal 4067 4071 wait_mpj $ns2 4068 4072 chk_subflow_nr "after re-add" 3 4069 4073 chk_mptcp_info subflows 2 subflows 2 4074 + chk_mptcp_info add_addr_signal 2 add_addr_accepted 2 4070 4075 4071 4076 pm_nl_del_endpoint $ns1 42 10.0.1.1 4072 4077 sleep 0.5 4073 4078 chk_subflow_nr "after delete ID 0" 2 4074 4079 chk_mptcp_info subflows 2 subflows 2 4080 + chk_mptcp_info add_addr_signal 2 add_addr_accepted 2 4075 4081 4076 4082 pm_nl_add_endpoint $ns1 10.0.1.1 id 99 flags signal 4077 4083 wait_mpj $ns2 4078 4084 chk_subflow_nr "after re-add ID 0" 3 4079 4085 chk_mptcp_info subflows 3 subflows 3 4086 + chk_mptcp_info add_addr_signal 3 add_addr_accepted 2 4080 4087 4081 4088 pm_nl_del_endpoint $ns1 99 10.0.1.1 4082 4089 sleep 0.5 4083 4090 chk_subflow_nr "after re-delete ID 0" 2 4084 4091 chk_mptcp_info subflows 2 subflows 2 4092 + chk_mptcp_info add_addr_signal 2 add_addr_accepted 2 4085 4093 4086 4094 pm_nl_add_endpoint $ns1 10.0.1.1 id 88 flags signal 4087 4095 wait_mpj $ns2 4088 4096 chk_subflow_nr "after re-re-add ID 0" 3 4089 4097 chk_mptcp_info subflows 3 subflows 3 4098 + chk_mptcp_info add_addr_signal 3 add_addr_accepted 2 4090 4099 mptcp_lib_kill_group_wait $tests_pid 4091 4100 4092 4101 kill_events_pids ··· 4126 4121 # broadcast IP: no packet for this address will be received on ns1 4127 4122 pm_nl_add_endpoint $ns1 224.0.0.1 id 2 flags signal 4128 4123 pm_nl_add_endpoint $ns2 10.0.3.2 id 3 flags subflow 4129 - { test_linkfail=128 speed=20 \ 4124 + { timeout_test=120 test_linkfail=128 speed=20 \ 4130 4125 run_tests $ns1 $ns2 10.0.1.1 & } 2>/dev/null 4131 4126 local tests_pid=$! 4132 4127