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

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

Cross-merge networking fixes after downstream PR (net-6.12-rc7).

Conflicts:

drivers/net/ethernet/freescale/enetc/enetc_pf.c
e15c5506dd39 ("net: enetc: allocate vf_state during PF probes")
3774409fd4c6 ("net: enetc: build enetc_pf_common.c as a separate module")
https://lore.kernel.org/20241105114100.118bd35e@canb.auug.org.au

Adjacent changes:

drivers/net/ethernet/ti/am65-cpsw-nuss.c
de794169cf17 ("net: ethernet: ti: am65-cpsw: Fix multi queue Rx on J7")
4a7b2ba94a59 ("net: ethernet: ti: am65-cpsw: Use tstats instead of open coded version")

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

+3169 -1650
+3 -2
.mailmap
··· 199 199 Enric Balletbo i Serra <eballetbo@kernel.org> <enric.balletbo@collabora.com> 200 200 Enric Balletbo i Serra <eballetbo@kernel.org> <eballetbo@iseebcn.com> 201 201 Erik Kaneda <erik.kaneda@intel.com> <erik.schmauss@intel.com> 202 - Eugen Hristev <eugen.hristev@collabora.com> <eugen.hristev@microchip.com> 202 + Eugen Hristev <eugen.hristev@linaro.org> <eugen.hristev@microchip.com> 203 + Eugen Hristev <eugen.hristev@linaro.org> <eugen.hristev@collabora.com> 203 204 Evgeniy Polyakov <johnpol@2ka.mipt.ru> 204 205 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar> <ezequiel@collabora.com> 205 206 Faith Ekstrand <faith.ekstrand@collabora.com> <jason@jlekstrand.net> ··· 283 282 Jan Kuliga <jtkuliga.kdev@gmail.com> <jankul@alatek.krakow.pl> 284 283 Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@linux.intel.com> 285 284 Jarkko Sakkinen <jarkko@kernel.org> <jarkko@profian.com> 286 - Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@tuni.fi> 285 + Jarkko Sakkinen <jarkko@kernel.org> <jarkko.sakkinen@parity.io> 287 286 Jason Gunthorpe <jgg@ziepe.ca> <jgg@mellanox.com> 288 287 Jason Gunthorpe <jgg@ziepe.ca> <jgg@nvidia.com> 289 288 Jason Gunthorpe <jgg@ziepe.ca> <jgunthorpe@obsidianresearch.com>
+4
CREDITS
··· 1204 1204 S: D-57250 Netphen 1205 1205 S: Germany 1206 1206 1207 + N: Florian Fainelli 1208 + E: f.fainelli@gmail.com 1209 + D: DSA 1210 + 1207 1211 N: Rik Faith 1208 1212 E: faith@acm.org 1209 1213 D: Future Domain TMC-16x0 SCSI driver (author)
+10 -14
Documentation/devicetree/bindings/display/mediatek/mediatek,dpi.yaml
··· 63 63 - const: sleep 64 64 65 65 power-domains: 66 + description: | 67 + The MediaTek DPI module is typically associated with one of the 68 + following multimedia power domains: 69 + POWER_DOMAIN_DISPLAY 70 + POWER_DOMAIN_VDOSYS 71 + POWER_DOMAIN_MM 72 + The specific power domain used varies depending on the SoC design. 73 + 74 + It is recommended to explicitly add the appropriate power domain 75 + property to the DPI node in the device tree. 66 76 maxItems: 1 67 77 68 78 port: ··· 88 78 - clocks 89 79 - clock-names 90 80 - port 91 - 92 - allOf: 93 - - if: 94 - not: 95 - properties: 96 - compatible: 97 - contains: 98 - enum: 99 - - mediatek,mt6795-dpi 100 - - mediatek,mt8173-dpi 101 - - mediatek,mt8186-dpi 102 - then: 103 - properties: 104 - power-domains: false 105 81 106 82 additionalProperties: false 107 83
+19
Documentation/devicetree/bindings/display/mediatek/mediatek,split.yaml
··· 38 38 description: A phandle and PM domain specifier as defined by bindings of 39 39 the power controller specified by phandle. See 40 40 Documentation/devicetree/bindings/power/power-domain.yaml for details. 41 + maxItems: 1 41 42 42 43 mediatek,gce-client-reg: 43 44 description: ··· 58 57 clocks: 59 58 items: 60 59 - description: SPLIT Clock 60 + - description: Used for interfacing with the HDMI RX signal source. 61 + - description: Paired with receiving HDMI RX metadata. 62 + minItems: 1 61 63 62 64 required: 63 65 - compatible ··· 76 72 const: mediatek,mt8195-mdp3-split 77 73 78 74 then: 75 + properties: 76 + clocks: 77 + minItems: 3 78 + 79 79 required: 80 80 - mediatek,gce-client-reg 81 + 82 + - if: 83 + properties: 84 + compatible: 85 + contains: 86 + const: mediatek,mt8173-disp-split 87 + 88 + then: 89 + properties: 90 + clocks: 91 + maxItems: 1 81 92 82 93 additionalProperties: false 83 94
+1 -1
Documentation/devicetree/bindings/firmware/arm,scmi.yaml
··· 124 124 atomic mode of operation, even if requested. 125 125 default: 0 126 126 127 - max-rx-timeout-ms: 127 + arm,max-rx-timeout-ms: 128 128 description: 129 129 An optional time value, expressed in milliseconds, representing the 130 130 transport maximum timeout value for the receive channel. The value should
+21
Documentation/devicetree/bindings/iio/adc/adi,ad7380.yaml
··· 67 67 A 2.5V to 3.3V supply for the external reference voltage. When omitted, 68 68 the internal 2.5V reference is used. 69 69 70 + refin-supply: 71 + description: 72 + A 2.5V to 3.3V supply for external reference voltage, for ad7380-4 only. 73 + 70 74 aina-supply: 71 75 description: 72 76 The common mode voltage supply for the AINA- pin on pseudo-differential ··· 138 134 properties: 139 135 ainc-supply: false 140 136 aind-supply: false 137 + 138 + # ad7380-4 uses refin-supply as external reference. 139 + # All other chips from ad738x family use refio as optional external reference. 140 + # When refio-supply is omitted, internal reference is used. 141 + - if: 142 + properties: 143 + compatible: 144 + enum: 145 + - adi,ad7380-4 146 + then: 147 + properties: 148 + refio-supply: false 149 + required: 150 + - refin-supply 151 + else: 152 + properties: 153 + refin-supply: false 141 154 142 155 examples: 143 156 - |
+1 -1
Documentation/devicetree/bindings/net/xlnx,axi-ethernet.yaml
··· 61 61 - gmii 62 62 - rgmii 63 63 - sgmii 64 - - 1000BaseX 64 + - 1000base-x 65 65 66 66 xlnx,phy-type: 67 67 description:
+3 -2
Documentation/devicetree/bindings/phy/qcom,sc8280xp-qmp-pcie-phy.yaml
··· 154 154 - qcom,sm8550-qmp-gen4x2-pcie-phy 155 155 - qcom,sm8650-qmp-gen3x2-pcie-phy 156 156 - qcom,sm8650-qmp-gen4x2-pcie-phy 157 - - qcom,x1e80100-qmp-gen3x2-pcie-phy 158 - - qcom,x1e80100-qmp-gen4x2-pcie-phy 159 157 then: 160 158 properties: 161 159 clocks: ··· 169 171 - qcom,sc8280xp-qmp-gen3x1-pcie-phy 170 172 - qcom,sc8280xp-qmp-gen3x2-pcie-phy 171 173 - qcom,sc8280xp-qmp-gen3x4-pcie-phy 174 + - qcom,x1e80100-qmp-gen3x2-pcie-phy 175 + - qcom,x1e80100-qmp-gen4x2-pcie-phy 172 176 - qcom,x1e80100-qmp-gen4x4-pcie-phy 173 177 then: 174 178 properties: ··· 201 201 - qcom,sm8550-qmp-gen4x2-pcie-phy 202 202 - qcom,sm8650-qmp-gen4x2-pcie-phy 203 203 - qcom,x1e80100-qmp-gen4x2-pcie-phy 204 + - qcom,x1e80100-qmp-gen4x4-pcie-phy 204 205 then: 205 206 properties: 206 207 resets:
+1 -1
Documentation/filesystems/caching/cachefiles.rst
··· 115 115 116 116 This mask can also be set through sysfs, eg:: 117 117 118 - echo 5 >/sys/modules/cachefiles/parameters/debug 118 + echo 5 > /sys/module/cachefiles/parameters/debug 119 119 120 120 121 121 Starting the Cache
+11 -2
Documentation/iio/ad7380.rst
··· 41 41 Reference voltage 42 42 ----------------- 43 43 44 - 2 possible reference voltage sources are supported: 44 + ad7380-4 45 + ~~~~~~~~ 46 + 47 + ad7380-4 supports only an external reference voltage (2.5V to 3.3V). It must be 48 + declared in the device tree as ``refin-supply``. 49 + 50 + All other devices from ad738x family 51 + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 52 + 53 + All other devices from ad738x support 2 possible reference voltage sources: 45 54 46 55 - Internal reference (2.5V) 47 56 - External reference (2.5V to 3.3V) 48 57 49 58 The source is determined by the device tree. If ``refio-supply`` is present, 50 - then the external reference is used, else the internal reference is used. 59 + then it is used as external reference, else the internal reference is used. 51 60 52 61 Oversampling and resolution boost 53 62 ---------------------------------
-1
Documentation/netlink/specs/mptcp_pm.yaml
··· 293 293 doc: Get endpoint information 294 294 attribute-set: attr 295 295 dont-validate: [ strict ] 296 - flags: [ uns-admin-perm ] 297 296 do: &get-addr-attrs 298 297 request: 299 298 attributes:
+1 -1
Documentation/networking/j1939.rst
··· 121 121 122 122 On the other hand, when using PDU1 format, the PS-field contains a so-called 123 123 Destination Address, which is _not_ part of the PGN. When communicating a PGN 124 - from user space to kernel (or vice versa) and PDU2 format is used, the PS-field 124 + from user space to kernel (or vice versa) and PDU1 format is used, the PS-field 125 125 of the PGN shall be set to zero. The Destination Address shall be set 126 126 elsewhere. 127 127
+1 -1
Documentation/rust/arch-support.rst
··· 17 17 ============= ================ ============================================== 18 18 ``arm64`` Maintained Little Endian only. 19 19 ``loongarch`` Maintained \- 20 - ``riscv`` Maintained ``riscv64`` only. 20 + ``riscv`` Maintained ``riscv64`` and LLVM/Clang only. 21 21 ``um`` Maintained \- 22 22 ``x86`` Maintained ``x86_64`` only. 23 23 ============= ================ ==============================================
+60 -8
MAINTAINERS
··· 2852 2852 F: Documentation/devicetree/bindings/bus/qcom* 2853 2853 F: Documentation/devicetree/bindings/cache/qcom,llcc.yaml 2854 2854 F: Documentation/devicetree/bindings/firmware/qcom,scm.yaml 2855 - F: Documentation/devicetree/bindings/reserved-memory/qcom 2855 + F: Documentation/devicetree/bindings/reserved-memory/qcom* 2856 2856 F: Documentation/devicetree/bindings/soc/qcom/ 2857 2857 F: arch/arm/boot/dts/qcom/ 2858 2858 F: arch/arm/configs/qcom_defconfig ··· 3745 3745 AXI PWM GENERATOR 3746 3746 M: Michael Hennerich <michael.hennerich@analog.com> 3747 3747 M: Nuno Sá <nuno.sa@analog.com> 3748 + R: Trevor Gamblin <tgamblin@baylibre.com> 3748 3749 L: linux-pwm@vger.kernel.org 3749 3750 S: Supported 3750 3751 W: https://ez.analog.com/linux-software-drivers ··· 14155 14154 T: git git://linuxtv.org/media_tree.git 14156 14155 F: drivers/media/platform/nxp/imx-pxp.[ch] 14157 14156 14157 + MEDIA DRIVERS FOR ASCOT2E 14158 + M: Abylay Ospan <aospan@amazon.com> 14159 + L: linux-media@vger.kernel.org 14160 + S: Supported 14161 + W: https://linuxtv.org 14162 + W: http://netup.tv/ 14163 + T: git git://linuxtv.org/media_tree.git 14164 + F: drivers/media/dvb-frontends/ascot2e* 14165 + 14158 14166 MEDIA DRIVERS FOR CXD2099AR CI CONTROLLERS 14159 14167 M: Jasmin Jessich <jasmin@anw.at> 14160 14168 L: linux-media@vger.kernel.org ··· 14171 14161 W: https://linuxtv.org 14172 14162 T: git git://linuxtv.org/media_tree.git 14173 14163 F: drivers/media/dvb-frontends/cxd2099* 14164 + 14165 + MEDIA DRIVERS FOR CXD2841ER 14166 + M: Abylay Ospan <aospan@amazon.com> 14167 + L: linux-media@vger.kernel.org 14168 + S: Supported 14169 + W: https://linuxtv.org 14170 + W: http://netup.tv/ 14171 + T: git git://linuxtv.org/media_tree.git 14172 + F: drivers/media/dvb-frontends/cxd2841er* 14174 14173 14175 14174 MEDIA DRIVERS FOR CXD2880 14176 14175 M: Yasunari Takiguchi <Yasunari.Takiguchi@sony.com> ··· 14225 14206 F: drivers/media/platform/nxp/imx7-media-csi.c 14226 14207 F: drivers/media/platform/nxp/imx8mq-mipi-csi2.c 14227 14208 14209 + MEDIA DRIVERS FOR HELENE 14210 + M: Abylay Ospan <aospan@amazon.com> 14211 + L: linux-media@vger.kernel.org 14212 + S: Supported 14213 + W: https://linuxtv.org 14214 + W: http://netup.tv/ 14215 + T: git git://linuxtv.org/media_tree.git 14216 + F: drivers/media/dvb-frontends/helene* 14217 + 14218 + MEDIA DRIVERS FOR HORUS3A 14219 + M: Abylay Ospan <aospan@amazon.com> 14220 + L: linux-media@vger.kernel.org 14221 + S: Supported 14222 + W: https://linuxtv.org 14223 + W: http://netup.tv/ 14224 + T: git git://linuxtv.org/media_tree.git 14225 + F: drivers/media/dvb-frontends/horus3a* 14226 + 14227 + MEDIA DRIVERS FOR LNBH25 14228 + M: Abylay Ospan <aospan@amazon.com> 14229 + L: linux-media@vger.kernel.org 14230 + S: Supported 14231 + W: https://linuxtv.org 14232 + W: http://netup.tv/ 14233 + T: git git://linuxtv.org/media_tree.git 14234 + F: drivers/media/dvb-frontends/lnbh25* 14235 + 14228 14236 MEDIA DRIVERS FOR MXL5XX TUNER DEMODULATORS 14229 14237 L: linux-media@vger.kernel.org 14230 14238 S: Orphan 14231 14239 W: https://linuxtv.org 14232 14240 T: git git://linuxtv.org/media_tree.git 14233 14241 F: drivers/media/dvb-frontends/mxl5xx* 14242 + 14243 + MEDIA DRIVERS FOR NETUP PCI UNIVERSAL DVB devices 14244 + M: Abylay Ospan <aospan@amazon.com> 14245 + L: linux-media@vger.kernel.org 14246 + S: Supported 14247 + W: https://linuxtv.org 14248 + W: http://netup.tv/ 14249 + T: git git://linuxtv.org/media_tree.git 14250 + F: drivers/media/pci/netup_unidvb/* 14234 14251 14235 14252 MEDIA DRIVERS FOR NVIDIA TEGRA - VDE 14236 14253 M: Dmitry Osipenko <digetx@gmail.com> ··· 16104 16049 16105 16050 NETWORKING [DSA] 16106 16051 M: Andrew Lunn <andrew@lunn.ch> 16107 - M: Florian Fainelli <f.fainelli@gmail.com> 16108 16052 M: Vladimir Oltean <olteanv@gmail.com> 16109 16053 S: Maintained 16110 16054 F: Documentation/devicetree/bindings/net/dsa/ ··· 19875 19821 S: Maintained 19876 19822 Q: https://patchwork.kernel.org/project/linux-riscv/list/ 19877 19823 T: git https://git.kernel.org/pub/scm/linux/kernel/git/conor/linux.git/ 19878 - F: Documentation/devicetree/bindings/riscv/ 19879 - F: arch/riscv/boot/dts/ 19880 - X: arch/riscv/boot/dts/allwinner/ 19881 - X: arch/riscv/boot/dts/renesas/ 19882 - X: arch/riscv/boot/dts/sophgo/ 19883 - X: arch/riscv/boot/dts/thead/ 19824 + F: arch/riscv/boot/dts/canaan/ 19825 + F: arch/riscv/boot/dts/microchip/ 19826 + F: arch/riscv/boot/dts/sifive/ 19827 + F: arch/riscv/boot/dts/starfive/ 19884 19828 19885 19829 RISC-V PMU DRIVERS 19886 19830 M: Atish Patra <atishp@atishpatra.org>
+1 -1
Makefile
··· 2 2 VERSION = 6 3 3 PATCHLEVEL = 12 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc5 5 + EXTRAVERSION = -rc6 6 6 NAME = Baby Opossum Posse 7 7 8 8 # *DOCUMENTATION*
+2 -2
arch/Kconfig
··· 855 855 def_bool y 856 856 depends on $(cc-option,-fsanitize=kcfi -fsanitize-cfi-icall-experimental-normalize-integers) 857 857 # With GCOV/KASAN we need this fix: https://github.com/llvm/llvm-project/pull/104826 858 - depends on CLANG_VERSION >= 190000 || (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS) 858 + depends on CLANG_VERSION >= 190103 || (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS) 859 859 860 860 config HAVE_CFI_ICALL_NORMALIZE_INTEGERS_RUSTC 861 861 def_bool y 862 862 depends on HAVE_CFI_ICALL_NORMALIZE_INTEGERS_CLANG 863 863 depends on RUSTC_VERSION >= 107900 864 864 # With GCOV/KASAN we need this fix: https://github.com/rust-lang/rust/pull/129373 865 - depends on (RUSTC_LLVM_VERSION >= 190000 && RUSTC_VERSION >= 108200) || \ 865 + depends on (RUSTC_LLVM_VERSION >= 190103 && RUSTC_VERSION >= 108200) || \ 866 866 (!GCOV_KERNEL && !KASAN_GENERIC && !KASAN_SW_TAGS) 867 867 868 868 config CFI_PERMISSIVE
+2 -2
arch/arm/boot/dts/rockchip/rk3036-kylin.dts
··· 325 325 &i2c2 { 326 326 status = "okay"; 327 327 328 - rt5616: rt5616@1b { 329 - compatible = "rt5616"; 328 + rt5616: audio-codec@1b { 329 + compatible = "realtek,rt5616"; 330 330 reg = <0x1b>; 331 331 clocks = <&cru SCLK_I2S_OUT>; 332 332 clock-names = "mclk";
+7 -7
arch/arm/boot/dts/rockchip/rk3036.dtsi
··· 384 384 }; 385 385 }; 386 386 387 - acodec: acodec-ana@20030000 { 388 - compatible = "rk3036-codec"; 387 + acodec: audio-codec@20030000 { 388 + compatible = "rockchip,rk3036-codec"; 389 389 reg = <0x20030000 0x4000>; 390 - rockchip,grf = <&grf>; 391 390 clock-names = "acodec_pclk"; 392 391 clocks = <&cru PCLK_ACODEC>; 392 + rockchip,grf = <&grf>; 393 + #sound-dai-cells = <0>; 393 394 status = "disabled"; 394 395 }; 395 396 ··· 400 399 interrupts = <GIC_SPI 45 IRQ_TYPE_LEVEL_HIGH>; 401 400 clocks = <&cru PCLK_HDMI>; 402 401 clock-names = "pclk"; 403 - rockchip,grf = <&grf>; 404 402 pinctrl-names = "default"; 405 403 pinctrl-0 = <&hdmi_ctl>; 406 404 #sound-dai-cells = <0>; ··· 553 553 }; 554 554 555 555 spi: spi@20074000 { 556 - compatible = "rockchip,rockchip-spi"; 556 + compatible = "rockchip,rk3036-spi"; 557 557 reg = <0x20074000 0x1000>; 558 558 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; 559 - clocks = <&cru PCLK_SPI>, <&cru SCLK_SPI>; 560 - clock-names = "apb-pclk","spi_pclk"; 559 + clocks = <&cru SCLK_SPI>, <&cru PCLK_SPI>; 560 + clock-names = "spiclk", "apb_pclk"; 561 561 dmas = <&pdma 8>, <&pdma 9>; 562 562 dma-names = "tx", "rx"; 563 563 pinctrl-names = "default";
+6 -6
arch/arm64/boot/dts/freescale/imx8-ss-lvds0.dtsi
··· 14 14 compatible = "fsl,imx8qxp-lpcg"; 15 15 reg = <0x56243000 0x4>; 16 16 #clock-cells = <1>; 17 - clock-output-names = "mipi1_lis_lpcg_ipg_clk"; 17 + clock-output-names = "lvds0_lis_lpcg_ipg_clk"; 18 18 power-domains = <&pd IMX_SC_R_MIPI_1>; 19 19 }; 20 20 ··· 22 22 compatible = "fsl,imx8qxp-lpcg"; 23 23 reg = <0x5624300c 0x4>; 24 24 #clock-cells = <1>; 25 - clock-output-names = "mipi1_pwm_lpcg_clk", 26 - "mipi1_pwm_lpcg_ipg_clk", 27 - "mipi1_pwm_lpcg_32k_clk"; 25 + clock-output-names = "lvds0_pwm_lpcg_clk", 26 + "lvds0_pwm_lpcg_ipg_clk", 27 + "lvds0_pwm_lpcg_32k_clk"; 28 28 power-domains = <&pd IMX_SC_R_MIPI_1_PWM_0>; 29 29 }; 30 30 ··· 32 32 compatible = "fsl,imx8qxp-lpcg"; 33 33 reg = <0x56243010 0x4>; 34 34 #clock-cells = <1>; 35 - clock-output-names = "mipi1_i2c0_lpcg_clk", 36 - "mipi1_i2c0_lpcg_ipg_clk"; 35 + clock-output-names = "lvds0_i2c0_lpcg_clk", 36 + "lvds0_i2c0_lpcg_ipg_clk"; 37 37 power-domains = <&pd IMX_SC_R_MIPI_1_I2C_0>; 38 38 }; 39 39
+2 -2
arch/arm64/boot/dts/freescale/imx8-ss-vpu.dtsi
··· 15 15 mu_m0: mailbox@2d000000 { 16 16 compatible = "fsl,imx6sx-mu"; 17 17 reg = <0x2d000000 0x20000>; 18 - interrupts = <GIC_SPI 469 IRQ_TYPE_LEVEL_HIGH>; 18 + interrupts = <GIC_SPI 472 IRQ_TYPE_LEVEL_HIGH>; 19 19 #mbox-cells = <2>; 20 20 power-domains = <&pd IMX_SC_R_VPU_MU_0>; 21 21 status = "disabled"; ··· 24 24 mu1_m0: mailbox@2d020000 { 25 25 compatible = "fsl,imx6sx-mu"; 26 26 reg = <0x2d020000 0x20000>; 27 - interrupts = <GIC_SPI 470 IRQ_TYPE_LEVEL_HIGH>; 27 + interrupts = <GIC_SPI 473 IRQ_TYPE_LEVEL_HIGH>; 28 28 #mbox-cells = <2>; 29 29 power-domains = <&pd IMX_SC_R_VPU_MU_1>; 30 30 status = "disabled";
+12
arch/arm64/boot/dts/freescale/imx8mp-phyboard-pollux-rdk.dts
··· 218 218 }; 219 219 }; 220 220 221 + &media_blk_ctrl { 222 + /* 223 + * The LVDS panel on this device uses 72.4 MHz pixel clock, 224 + * set IMX8MP_VIDEO_PLL1 to 72.4 * 7 = 506.8 MHz so the LDB 225 + * serializer and LCDIFv3 scanout engine can reach accurate 226 + * pixel clock of exactly 72.4 MHz. 227 + */ 228 + assigned-clock-rates = <500000000>, <200000000>, 229 + <0>, <0>, <500000000>, 230 + <506800000>; 231 + }; 232 + 221 233 &snvs_pwrkey { 222 234 status = "okay"; 223 235 };
+1
arch/arm64/boot/dts/freescale/imx8mp-skov-revb-mi1010ait-1cp1.dts
··· 71 71 assigned-clock-rates = <500000000>, <200000000>, <0>, 72 72 /* IMX8MP_CLK_MEDIA_DISP2_PIX = pixelclk of lvds panel */ 73 73 <68900000>, 74 + <500000000>, 74 75 /* IMX8MP_VIDEO_PLL1 = IMX8MP_CLK_MEDIA_LDB * 2 */ 75 76 <964600000>; 76 77 };
+3 -3
arch/arm64/boot/dts/freescale/imx8mp.dtsi
··· 1261 1261 compatible = "fsl,imx8mp-usdhc", "fsl,imx8mm-usdhc", "fsl,imx7d-usdhc"; 1262 1262 reg = <0x30b40000 0x10000>; 1263 1263 interrupts = <GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>; 1264 - clocks = <&clk IMX8MP_CLK_DUMMY>, 1264 + clocks = <&clk IMX8MP_CLK_IPG_ROOT>, 1265 1265 <&clk IMX8MP_CLK_NAND_USDHC_BUS>, 1266 1266 <&clk IMX8MP_CLK_USDHC1_ROOT>; 1267 1267 clock-names = "ipg", "ahb", "per"; ··· 1275 1275 compatible = "fsl,imx8mp-usdhc", "fsl,imx8mm-usdhc", "fsl,imx7d-usdhc"; 1276 1276 reg = <0x30b50000 0x10000>; 1277 1277 interrupts = <GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>; 1278 - clocks = <&clk IMX8MP_CLK_DUMMY>, 1278 + clocks = <&clk IMX8MP_CLK_IPG_ROOT>, 1279 1279 <&clk IMX8MP_CLK_NAND_USDHC_BUS>, 1280 1280 <&clk IMX8MP_CLK_USDHC2_ROOT>; 1281 1281 clock-names = "ipg", "ahb", "per"; ··· 1289 1289 compatible = "fsl,imx8mp-usdhc", "fsl,imx8mm-usdhc", "fsl,imx7d-usdhc"; 1290 1290 reg = <0x30b60000 0x10000>; 1291 1291 interrupts = <GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>; 1292 - clocks = <&clk IMX8MP_CLK_DUMMY>, 1292 + clocks = <&clk IMX8MP_CLK_IPG_ROOT>, 1293 1293 <&clk IMX8MP_CLK_NAND_USDHC_BUS>, 1294 1294 <&clk IMX8MP_CLK_USDHC3_ROOT>; 1295 1295 clock-names = "ipg", "ahb", "per";
+8
arch/arm64/boot/dts/freescale/imx8qxp-ss-vpu.dtsi
··· 5 5 * Author: Alexander Stein 6 6 */ 7 7 8 + &mu_m0 { 9 + interrupts = <GIC_SPI 469 IRQ_TYPE_LEVEL_HIGH>; 10 + }; 11 + 12 + &mu1_m0 { 13 + interrupts = <GIC_SPI 470 IRQ_TYPE_LEVEL_HIGH>; 14 + }; 15 + 8 16 &vpu_core0 { 9 17 reg = <0x2d040000 0x10000>; 10 18 };
+1 -1
arch/arm64/boot/dts/freescale/imx8ulp.dtsi
··· 384 384 }; 385 385 386 386 flexspi2: spi@29810000 { 387 - compatible = "nxp,imx8mm-fspi"; 387 + compatible = "nxp,imx8ulp-fspi"; 388 388 reg = <0x29810000 0x10000>, <0x60000000 0x10000000>; 389 389 reg-names = "fspi_base", "fspi_mmap"; 390 390 #address-cells = <1>;
+1 -1
arch/arm64/boot/dts/qcom/msm8939.dtsi
··· 248 248 249 249 smd-edge { 250 250 interrupts = <GIC_SPI 168 IRQ_TYPE_EDGE_RISING>; 251 - mboxes = <&apcs1_mbox 0>; 251 + qcom,ipc = <&apcs1_mbox 8 0>; 252 252 qcom,smd-edge = <15>; 253 253 254 254 rpm_requests: rpm-requests {
+1 -1
arch/arm64/boot/dts/qcom/sm8450.dtsi
··· 1973 1973 1974 1974 clocks = <&gcc GCC_PCIE_1_PIPE_CLK>, 1975 1975 <&gcc GCC_PCIE_1_PIPE_CLK_SRC>, 1976 - <&pcie1_phy>, 1976 + <&pcie1_phy QMP_PCIE_PIPE_CLK>, 1977 1977 <&rpmhcc RPMH_CXO_CLK>, 1978 1978 <&gcc GCC_PCIE_1_AUX_CLK>, 1979 1979 <&gcc GCC_PCIE_1_CFG_AHB_CLK>,
+2
arch/arm64/boot/dts/qcom/x1e78100-lenovo-thinkpad-t14s.dts
··· 139 139 140 140 pinctrl-0 = <&nvme_reg_en>; 141 141 pinctrl-names = "default"; 142 + 143 + regulator-boot-on; 142 144 }; 143 145 144 146 vph_pwr: regulator-vph-pwr {
+2
arch/arm64/boot/dts/qcom/x1e80100-asus-vivobook-s15.dts
··· 134 134 135 135 pinctrl-0 = <&nvme_reg_en>; 136 136 pinctrl-names = "default"; 137 + 138 + regulator-boot-on; 137 139 }; 138 140 }; 139 141
+6 -4
arch/arm64/boot/dts/qcom/x1e80100-crd.dts
··· 177 177 compatible = "qcom,x1e80100-sndcard"; 178 178 model = "X1E80100-CRD"; 179 179 audio-routing = "WooferLeft IN", "WSA WSA_SPK1 OUT", 180 - "TwitterLeft IN", "WSA WSA_SPK2 OUT", 180 + "TweeterLeft IN", "WSA WSA_SPK2 OUT", 181 181 "WooferRight IN", "WSA2 WSA_SPK2 OUT", 182 - "TwitterRight IN", "WSA2 WSA_SPK2 OUT", 182 + "TweeterRight IN", "WSA2 WSA_SPK2 OUT", 183 183 "IN1_HPHL", "HPHL_OUT", 184 184 "IN2_HPHR", "HPHR_OUT", 185 185 "AMIC2", "MIC BIAS2", ··· 300 300 301 301 pinctrl-names = "default"; 302 302 pinctrl-0 = <&nvme_reg_en>; 303 + 304 + regulator-boot-on; 303 305 }; 304 306 305 307 vreg_wwan: regulator-wwan { ··· 935 933 reg = <0 1>; 936 934 reset-gpios = <&lpass_tlmm 12 GPIO_ACTIVE_LOW>; 937 935 #sound-dai-cells = <0>; 938 - sound-name-prefix = "TwitterLeft"; 936 + sound-name-prefix = "TweeterLeft"; 939 937 vdd-1p8-supply = <&vreg_l15b_1p8>; 940 938 vdd-io-supply = <&vreg_l12b_1p2>; 941 939 qcom,port-mapping = <4 5 6 7 11 13>; ··· 988 986 reg = <0 1>; 989 987 reset-gpios = <&lpass_tlmm 13 GPIO_ACTIVE_LOW>; 990 988 #sound-dai-cells = <0>; 991 - sound-name-prefix = "TwitterRight"; 989 + sound-name-prefix = "TweeterRight"; 992 990 vdd-1p8-supply = <&vreg_l15b_1p8>; 993 991 vdd-io-supply = <&vreg_l12b_1p2>; 994 992 qcom,port-mapping = <4 5 6 7 11 13>;
+2
arch/arm64/boot/dts/qcom/x1e80100-lenovo-yoga-slim7x.dts
··· 205 205 206 206 pinctrl-0 = <&nvme_reg_en>; 207 207 pinctrl-names = "default"; 208 + 209 + regulator-boot-on; 208 210 }; 209 211 }; 210 212
+2
arch/arm64/boot/dts/qcom/x1e80100-microsoft-romulus.dtsi
··· 164 164 165 165 pinctrl-0 = <&nvme_reg_en>; 166 166 pinctrl-names = "default"; 167 + 168 + regulator-boot-on; 167 169 }; 168 170 }; 169 171
+2
arch/arm64/boot/dts/qcom/x1e80100-qcp.dts
··· 253 253 254 254 pinctrl-names = "default"; 255 255 pinctrl-0 = <&nvme_reg_en>; 256 + 257 + regulator-boot-on; 256 258 }; 257 259 }; 258 260
+32 -21
arch/arm64/boot/dts/qcom/x1e80100.dtsi
··· 2924 2924 "mhi"; 2925 2925 #address-cells = <3>; 2926 2926 #size-cells = <2>; 2927 - ranges = <0x01000000 0 0x00000000 0 0x70200000 0 0x100000>, 2928 - <0x02000000 0 0x70300000 0 0x70300000 0 0x3d00000>; 2929 - bus-range = <0 0xff>; 2927 + ranges = <0x01000000 0x0 0x00000000 0x0 0x70200000 0x0 0x100000>, 2928 + <0x02000000 0x0 0x70300000 0x0 0x70300000 0x0 0x1d00000>; 2929 + bus-range = <0x00 0xff>; 2930 2930 2931 2931 dma-coherent; 2932 2932 2933 2933 linux,pci-domain = <6>; 2934 - num-lanes = <2>; 2934 + num-lanes = <4>; 2935 2935 2936 2936 interrupts = <GIC_SPI 773 IRQ_TYPE_LEVEL_HIGH>, 2937 2937 <GIC_SPI 774 IRQ_TYPE_LEVEL_HIGH>, ··· 2997 2997 }; 2998 2998 2999 2999 pcie6a_phy: phy@1bfc000 { 3000 - compatible = "qcom,x1e80100-qmp-gen4x2-pcie-phy"; 3001 - reg = <0 0x01bfc000 0 0x2000>; 3000 + compatible = "qcom,x1e80100-qmp-gen4x4-pcie-phy"; 3001 + reg = <0 0x01bfc000 0 0x2000>, 3002 + <0 0x01bfe000 0 0x2000>; 3002 3003 3003 3004 clocks = <&gcc GCC_PCIE_6A_PHY_AUX_CLK>, 3004 3005 <&gcc GCC_PCIE_6A_CFG_AHB_CLK>, 3005 - <&rpmhcc RPMH_CXO_CLK>, 3006 + <&tcsr TCSR_PCIE_4L_CLKREF_EN>, 3006 3007 <&gcc GCC_PCIE_6A_PHY_RCHNG_CLK>, 3007 - <&gcc GCC_PCIE_6A_PIPE_CLK>; 3008 + <&gcc GCC_PCIE_6A_PIPE_CLK>, 3009 + <&gcc GCC_PCIE_6A_PIPEDIV2_CLK>; 3008 3010 clock-names = "aux", 3009 3011 "cfg_ahb", 3010 3012 "ref", 3011 3013 "rchng", 3012 - "pipe"; 3014 + "pipe", 3015 + "pipediv2"; 3013 3016 3014 3017 resets = <&gcc GCC_PCIE_6A_PHY_BCR>, 3015 3018 <&gcc GCC_PCIE_6A_NOCSR_COM_PHY_BCR>; ··· 3023 3020 assigned-clock-rates = <100000000>; 3024 3021 3025 3022 power-domains = <&gcc GCC_PCIE_6_PHY_GDSC>; 3023 + 3024 + qcom,4ln-config-sel = <&tcsr 0x1a000 0>; 3026 3025 3027 3026 #clock-cells = <0>; 3028 3027 clock-output-names = "pcie6a_pipe_clk"; ··· 3102 3097 assigned-clocks = <&gcc GCC_PCIE_5_AUX_CLK>; 3103 3098 assigned-clock-rates = <19200000>; 3104 3099 3105 - interconnects = <&pcie_south_anoc MASTER_PCIE_5 QCOM_ICC_TAG_ALWAYS 3100 + interconnects = <&pcie_north_anoc MASTER_PCIE_5 QCOM_ICC_TAG_ALWAYS 3106 3101 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, 3107 3102 <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS 3108 3103 &cnoc_main SLAVE_PCIE_5 QCOM_ICC_TAG_ALWAYS>; ··· 3129 3124 3130 3125 clocks = <&gcc GCC_PCIE_5_AUX_CLK>, 3131 3126 <&gcc GCC_PCIE_5_CFG_AHB_CLK>, 3132 - <&rpmhcc RPMH_CXO_CLK>, 3127 + <&tcsr TCSR_PCIE_2L_5_CLKREF_EN>, 3133 3128 <&gcc GCC_PCIE_5_PHY_RCHNG_CLK>, 3134 - <&gcc GCC_PCIE_5_PIPE_CLK>; 3129 + <&gcc GCC_PCIE_5_PIPE_CLK>, 3130 + <&gcc GCC_PCIE_5_PIPEDIV2_CLK>; 3135 3131 clock-names = "aux", 3136 3132 "cfg_ahb", 3137 3133 "ref", 3138 3134 "rchng", 3139 - "pipe"; 3135 + "pipe", 3136 + "pipediv2"; 3140 3137 3141 3138 resets = <&gcc GCC_PCIE_5_PHY_BCR>; 3142 3139 reset-names = "phy"; ··· 3173 3166 "mhi"; 3174 3167 #address-cells = <3>; 3175 3168 #size-cells = <2>; 3176 - ranges = <0x01000000 0 0x00000000 0 0x7c200000 0 0x100000>, 3177 - <0x02000000 0 0x7c300000 0 0x7c300000 0 0x3d00000>; 3169 + ranges = <0x01000000 0x0 0x00000000 0x0 0x7c200000 0x0 0x100000>, 3170 + <0x02000000 0x0 0x7c300000 0x0 0x7c300000 0x0 0x1d00000>; 3178 3171 bus-range = <0x00 0xff>; 3179 3172 3180 3173 dma-coherent; ··· 3224 3217 assigned-clocks = <&gcc GCC_PCIE_4_AUX_CLK>; 3225 3218 assigned-clock-rates = <19200000>; 3226 3219 3227 - interconnects = <&pcie_south_anoc MASTER_PCIE_4 QCOM_ICC_TAG_ALWAYS 3220 + interconnects = <&pcie_north_anoc MASTER_PCIE_4 QCOM_ICC_TAG_ALWAYS 3228 3221 &mc_virt SLAVE_EBI1 QCOM_ICC_TAG_ALWAYS>, 3229 3222 <&gem_noc MASTER_APPSS_PROC QCOM_ICC_TAG_ALWAYS 3230 3223 &cnoc_main SLAVE_PCIE_4 QCOM_ICC_TAG_ALWAYS>; ··· 3261 3254 3262 3255 clocks = <&gcc GCC_PCIE_4_AUX_CLK>, 3263 3256 <&gcc GCC_PCIE_4_CFG_AHB_CLK>, 3264 - <&rpmhcc RPMH_CXO_CLK>, 3257 + <&tcsr TCSR_PCIE_2L_4_CLKREF_EN>, 3265 3258 <&gcc GCC_PCIE_4_PHY_RCHNG_CLK>, 3266 - <&gcc GCC_PCIE_4_PIPE_CLK>; 3259 + <&gcc GCC_PCIE_4_PIPE_CLK>, 3260 + <&gcc GCC_PCIE_4_PIPEDIV2_CLK>; 3267 3261 clock-names = "aux", 3268 3262 "cfg_ahb", 3269 3263 "ref", 3270 3264 "rchng", 3271 - "pipe"; 3265 + "pipe", 3266 + "pipediv2"; 3272 3267 3273 3268 resets = <&gcc GCC_PCIE_4_PHY_BCR>; 3274 3269 reset-names = "phy"; ··· 6093 6084 <0 0x25a00000 0 0x200000>, 6094 6085 <0 0x25c00000 0 0x200000>, 6095 6086 <0 0x25e00000 0 0x200000>, 6096 - <0 0x26000000 0 0x200000>; 6087 + <0 0x26000000 0 0x200000>, 6088 + <0 0x26200000 0 0x200000>; 6097 6089 reg-names = "llcc0_base", 6098 6090 "llcc1_base", 6099 6091 "llcc2_base", ··· 6103 6093 "llcc5_base", 6104 6094 "llcc6_base", 6105 6095 "llcc7_base", 6106 - "llcc_broadcast_base"; 6096 + "llcc_broadcast_base", 6097 + "llcc_broadcast_and_base"; 6107 6098 interrupts = <GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>; 6108 6099 }; 6109 6100
-1
arch/arm64/boot/dts/rockchip/px30-ringneck.dtsi
··· 66 66 bus-width = <8>; 67 67 cap-mmc-highspeed; 68 68 mmc-hs200-1_8v; 69 - supports-emmc; 70 69 mmc-pwrseq = <&emmc_pwrseq>; 71 70 non-removable; 72 71 vmmc-supply = <&vcc_3v3>;
+2 -2
arch/arm64/boot/dts/rockchip/rk3308-roc-cc.dts
··· 36 36 37 37 power_led: led-0 { 38 38 label = "firefly:red:power"; 39 - linux,default-trigger = "ir-power-click"; 39 + linux,default-trigger = "default-on"; 40 40 default-state = "on"; 41 41 gpios = <&gpio0 RK_PA6 GPIO_ACTIVE_HIGH>; 42 42 }; 43 43 44 44 user_led: led-1 { 45 45 label = "firefly:blue:user"; 46 - linux,default-trigger = "ir-user-click"; 46 + linux,default-trigger = "rc-feedback"; 47 47 default-state = "off"; 48 48 gpios = <&gpio0 RK_PB2 GPIO_ACTIVE_HIGH>; 49 49 };
-2
arch/arm64/boot/dts/rockchip/rk3328-nanopi-r2s-plus.dts
··· 24 24 disable-wp; 25 25 mmc-hs200-1_8v; 26 26 non-removable; 27 - num-slots = <1>; 28 27 pinctrl-names = "default"; 29 28 pinctrl-0 = <&emmc_clk &emmc_cmd &emmc_bus8>; 30 - supports-emmc; 31 29 status = "okay"; 32 30 };
+1 -2
arch/arm64/boot/dts/rockchip/rk3328.dtsi
··· 754 754 compatible = "rockchip,rk3328-dw-hdmi"; 755 755 reg = <0x0 0xff3c0000 0x0 0x20000>; 756 756 reg-io-width = <4>; 757 - interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>, 758 - <GIC_SPI 71 IRQ_TYPE_LEVEL_HIGH>; 757 + interrupts = <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; 759 758 clocks = <&cru PCLK_HDMI>, 760 759 <&cru SCLK_HDMI_SFC>, 761 760 <&cru SCLK_RTC32K>;
-1
arch/arm64/boot/dts/rockchip/rk3368-lion.dtsi
··· 61 61 fan: fan@18 { 62 62 compatible = "ti,amc6821"; 63 63 reg = <0x18>; 64 - #cooling-cells = <2>; 65 64 }; 66 65 67 66 rtc_twi: rtc@6f {
+1 -1
arch/arm64/boot/dts/rockchip/rk3399-eaidk-610.dts
··· 541 541 status = "okay"; 542 542 543 543 rt5651: audio-codec@1a { 544 - compatible = "rockchip,rt5651"; 544 + compatible = "realtek,rt5651"; 545 545 reg = <0x1a>; 546 546 clocks = <&cru SCLK_I2S_8CH_OUT>; 547 547 clock-names = "mclk";
-2
arch/arm64/boot/dts/rockchip/rk3399-pinephone-pro.dts
··· 166 166 regulator-max-microvolt = <1800000>; 167 167 vin-supply = <&vcc3v3_sys>; 168 168 gpio = <&gpio3 RK_PA5 GPIO_ACTIVE_HIGH>; 169 - pinctrl-names = "default"; 170 169 }; 171 170 172 171 /* MIPI DSI panel 2.8v supply */ ··· 177 178 regulator-max-microvolt = <2800000>; 178 179 vin-supply = <&vcc3v3_sys>; 179 180 gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_HIGH>; 180 - pinctrl-names = "default"; 181 181 }; 182 182 183 183 vibrator {
-1
arch/arm64/boot/dts/rockchip/rk3399-roc-pc-plus.dts
··· 114 114 es8388: es8388@11 { 115 115 compatible = "everest,es8388"; 116 116 reg = <0x11>; 117 - clock-names = "mclk"; 118 117 clocks = <&cru SCLK_I2S_8CH_OUT>; 119 118 #sound-dai-cells = <0>; 120 119 };
+1 -1
arch/arm64/boot/dts/rockchip/rk3399-rock960.dtsi
··· 576 576 bluetooth { 577 577 compatible = "brcm,bcm43438-bt"; 578 578 clocks = <&rk808 1>; 579 - clock-names = "ext_clock"; 579 + clock-names = "txco"; 580 580 device-wakeup-gpios = <&gpio2 RK_PD3 GPIO_ACTIVE_HIGH>; 581 581 host-wakeup-gpios = <&gpio0 RK_PA4 GPIO_ACTIVE_HIGH>; 582 582 shutdown-gpios = <&gpio0 RK_PB1 GPIO_ACTIVE_HIGH>;
+1 -1
arch/arm64/boot/dts/rockchip/rk3399-sapphire-excavator.dts
··· 163 163 status = "okay"; 164 164 165 165 rt5651: rt5651@1a { 166 - compatible = "rockchip,rt5651"; 166 + compatible = "realtek,rt5651"; 167 167 reg = <0x1a>; 168 168 clocks = <&cru SCLK_I2S_8CH_OUT>; 169 169 clock-names = "mclk";
+1 -1
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353p.dts
··· 92 92 }; 93 93 94 94 &i2c2 { 95 - pintctrl-names = "default"; 95 + pinctrl-names = "default"; 96 96 pinctrl-0 = <&i2c2m1_xfer>; 97 97 status = "okay"; 98 98
+1 -1
arch/arm64/boot/dts/rockchip/rk3566-anbernic-rg353v.dts
··· 79 79 }; 80 80 81 81 &i2c2 { 82 - pintctrl-names = "default"; 82 + pinctrl-names = "default"; 83 83 pinctrl-0 = <&i2c2m1_xfer>; 84 84 status = "okay"; 85 85
+3 -3
arch/arm64/boot/dts/rockchip/rk3566-box-demo.dts
··· 449 449 bluetooth { 450 450 compatible = "brcm,bcm43438-bt"; 451 451 clocks = <&pmucru CLK_RTC_32K>; 452 - clock-names = "ext_clock"; 453 - device-wake-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>; 454 - host-wake-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>; 452 + clock-names = "txco"; 453 + device-wakeup-gpios = <&gpio2 RK_PC1 GPIO_ACTIVE_HIGH>; 454 + host-wakeup-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>; 455 455 shutdown-gpios = <&gpio2 RK_PB7 GPIO_ACTIVE_HIGH>; 456 456 pinctrl-names = "default"; 457 457 pinctrl-0 = <&bt_host_wake_l &bt_wake_l &bt_enable_h>;
-1
arch/arm64/boot/dts/rockchip/rk3566-lubancat-1.dts
··· 507 507 non-removable; 508 508 pinctrl-names = "default"; 509 509 pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd>; 510 - supports-emmc; 511 510 status = "okay"; 512 511 }; 513 512
+3 -3
arch/arm64/boot/dts/rockchip/rk3566-pinenote.dtsi
··· 684 684 compatible = "brcm,bcm43438-bt"; 685 685 clocks = <&rk817 1>; 686 686 clock-names = "lpo"; 687 - device-wake-gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>; 688 - host-wake-gpios = <&gpio0 RK_PC3 GPIO_ACTIVE_HIGH>; 689 - reset-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_LOW>; 687 + device-wakeup-gpios = <&gpio0 RK_PC2 GPIO_ACTIVE_HIGH>; 688 + host-wakeup-gpios = <&gpio0 RK_PC3 GPIO_ACTIVE_HIGH>; 690 689 pinctrl-0 = <&bt_enable_h>, <&bt_host_wake_l>, <&bt_wake_h>; 691 690 pinctrl-names = "default"; 691 + shutdown-gpios = <&gpio0 RK_PC4 GPIO_ACTIVE_HIGH>; 692 692 vbat-supply = <&vcc_wl>; 693 693 vddio-supply = <&vcca_1v8_pmu>; 694 694 };
+1 -1
arch/arm64/boot/dts/rockchip/rk3566-radxa-cm3.dtsi
··· 402 402 clock-names = "lpo"; 403 403 device-wakeup-gpios = <&gpio2 RK_PB2 GPIO_ACTIVE_HIGH>; 404 404 host-wakeup-gpios = <&gpio2 RK_PB1 GPIO_ACTIVE_HIGH>; 405 - reset-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_LOW>; 406 405 pinctrl-names = "default"; 407 406 pinctrl-0 = <&bt_host_wake_h &bt_reg_on_h &bt_wake_host_h>; 407 + shutdown-gpios = <&gpio2 RK_PC0 GPIO_ACTIVE_HIGH>; 408 408 vbat-supply = <&vcc_3v3>; 409 409 vddio-supply = <&vcc_1v8>; 410 410 };
-1
arch/arm64/boot/dts/rockchip/rk3568-lubancat-2.dts
··· 589 589 non-removable; 590 590 pinctrl-names = "default"; 591 591 pinctrl-0 = <&emmc_bus8 &emmc_clk &emmc_cmd>; 592 - supports-emmc; 593 592 status = "okay"; 594 593 }; 595 594
-3
arch/arm64/boot/dts/rockchip/rk3568-roc-pc.dts
··· 272 272 regulator-name = "vdd_logic"; 273 273 regulator-always-on; 274 274 regulator-boot-on; 275 - regulator-init-microvolt = <900000>; 276 275 regulator-initial-mode = <0x2>; 277 276 regulator-min-microvolt = <500000>; 278 277 regulator-max-microvolt = <1350000>; ··· 284 285 285 286 vdd_gpu: DCDC_REG2 { 286 287 regulator-name = "vdd_gpu"; 287 - regulator-init-microvolt = <900000>; 288 288 regulator-initial-mode = <0x2>; 289 289 regulator-min-microvolt = <500000>; 290 290 regulator-max-microvolt = <1350000>; ··· 307 309 308 310 vdd_npu: DCDC_REG4 { 309 311 regulator-name = "vdd_npu"; 310 - regulator-init-microvolt = <900000>; 311 312 regulator-initial-mode = <0x2>; 312 313 regulator-min-microvolt = <500000>; 313 314 regulator-max-microvolt = <1350000>;
+12 -8
arch/arm64/boot/dts/rockchip/rk3588-base.dtsi
··· 337 337 cache-unified; 338 338 next-level-cache = <&l3_cache>; 339 339 }; 340 + }; 340 341 341 - l3_cache: l3-cache { 342 - compatible = "cache"; 343 - cache-size = <3145728>; 344 - cache-line-size = <64>; 345 - cache-sets = <4096>; 346 - cache-level = <3>; 347 - cache-unified; 348 - }; 342 + /* 343 + * The L3 cache belongs to the DynamIQ Shared Unit (DSU), 344 + * so it's represented here, outside the "cpus" node 345 + */ 346 + l3_cache: l3-cache { 347 + compatible = "cache"; 348 + cache-size = <3145728>; 349 + cache-line-size = <64>; 350 + cache-sets = <4096>; 351 + cache-level = <3>; 352 + cache-unified; 349 353 }; 350 354 351 355 display_subsystem: display-subsystem {
-1
arch/arm64/boot/dts/rockchip/rk3588-orangepi-5-plus.dts
··· 328 328 compatible = "everest,es8388"; 329 329 reg = <0x11>; 330 330 clocks = <&cru I2S0_8CH_MCLKOUT>; 331 - clock-names = "mclk"; 332 331 AVDD-supply = <&vcc_1v8_s0>; 333 332 DVDD-supply = <&vcc_1v8_s0>; 334 333 HPVDD-supply = <&vcc_3v3_s0>;
-1
arch/arm64/boot/dts/rockchip/rk3588-quartzpro64.dts
··· 316 316 assigned-clocks = <&cru I2S0_8CH_MCLKOUT>; 317 317 assigned-clock-rates = <12288000>; 318 318 clocks = <&cru I2S0_8CH_MCLKOUT>; 319 - clock-names = "mclk"; 320 319 AVDD-supply = <&avcc_1v8_codec_s0>; 321 320 DVDD-supply = <&avcc_1v8_codec_s0>; 322 321 HPVDD-supply = <&vcc_3v3_s0>;
+2 -2
arch/arm64/boot/dts/rockchip/rk3588-rock-5b.dts
··· 304 304 }; 305 305 306 306 cooling-maps { 307 - map1 { 307 + map0 { 308 308 trip = <&package_fan0>; 309 309 cooling-device = <&fan THERMAL_NO_LIMIT 1>; 310 310 }; 311 311 312 - map2 { 312 + map1 { 313 313 trip = <&package_fan1>; 314 314 cooling-device = <&fan 2 THERMAL_NO_LIMIT>; 315 315 };
-1
arch/arm64/boot/dts/rockchip/rk3588-toybrick-x0.dts
··· 428 428 regulator-boot-on; 429 429 regulator-min-microvolt = <550000>; 430 430 regulator-max-microvolt = <950000>; 431 - regulator-init-microvolt = <750000>; 432 431 regulator-ramp-delay = <12500>; 433 432 434 433 regulator-state-mem {
+1
arch/arm64/boot/dts/rockchip/rk3588-turing-rk1.dtsi
··· 296 296 pinctrl-names = "default"; 297 297 pinctrl-0 = <&pmic_pins>, <&rk806_dvs1_null>, 298 298 <&rk806_dvs2_null>, <&rk806_dvs3_null>; 299 + system-power-controller; 299 300 300 301 vcc1-supply = <&vcc5v0_sys>; 301 302 vcc2-supply = <&vcc5v0_sys>;
-1
arch/arm64/boot/dts/rockchip/rk3588s-indiedroid-nova.dts
··· 377 377 assigned-clock-rates = <12288000>; 378 378 assigned-clocks = <&cru I2S0_8CH_MCLKOUT>; 379 379 AVDD-supply = <&vcc_3v3_s3>; 380 - clock-names = "mclk"; 381 380 clocks = <&cru I2S0_8CH_MCLKOUT>; 382 381 DVDD-supply = <&vcc_1v8_s3>; 383 382 HPVDD-supply = <&vcc_3v3_s3>;
+78 -14
arch/arm64/kernel/signal.c
··· 19 19 #include <linux/ratelimit.h> 20 20 #include <linux/rseq.h> 21 21 #include <linux/syscalls.h> 22 + #include <linux/pkeys.h> 22 23 23 24 #include <asm/daifflags.h> 24 25 #include <asm/debug-monitors.h> ··· 67 66 unsigned long end_offset; 68 67 }; 69 68 69 + /* 70 + * Holds any EL0-controlled state that influences unprivileged memory accesses. 71 + * This includes both accesses done in userspace and uaccess done in the kernel. 72 + * 73 + * This state needs to be carefully managed to ensure that it doesn't cause 74 + * uaccess to fail when setting up the signal frame, and the signal handler 75 + * itself also expects a well-defined state when entered. 76 + */ 77 + struct user_access_state { 78 + u64 por_el0; 79 + }; 80 + 70 81 #define BASE_SIGFRAME_SIZE round_up(sizeof(struct rt_sigframe), 16) 71 82 #define TERMINATOR_SIZE round_up(sizeof(struct _aarch64_ctx), 16) 72 83 #define EXTRA_CONTEXT_SIZE round_up(sizeof(struct extra_context), 16) 84 + 85 + /* 86 + * Save the user access state into ua_state and reset it to disable any 87 + * restrictions. 88 + */ 89 + static void save_reset_user_access_state(struct user_access_state *ua_state) 90 + { 91 + if (system_supports_poe()) { 92 + u64 por_enable_all = 0; 93 + 94 + for (int pkey = 0; pkey < arch_max_pkey(); pkey++) 95 + por_enable_all |= POE_RXW << (pkey * POR_BITS_PER_PKEY); 96 + 97 + ua_state->por_el0 = read_sysreg_s(SYS_POR_EL0); 98 + write_sysreg_s(por_enable_all, SYS_POR_EL0); 99 + /* Ensure that any subsequent uaccess observes the updated value */ 100 + isb(); 101 + } 102 + } 103 + 104 + /* 105 + * Set the user access state for invoking the signal handler. 106 + * 107 + * No uaccess should be done after that function is called. 108 + */ 109 + static void set_handler_user_access_state(void) 110 + { 111 + if (system_supports_poe()) 112 + write_sysreg_s(POR_EL0_INIT, SYS_POR_EL0); 113 + } 114 + 115 + /* 116 + * Restore the user access state to the values saved in ua_state. 117 + * 118 + * No uaccess should be done after that function is called. 119 + */ 120 + static void restore_user_access_state(const struct user_access_state *ua_state) 121 + { 122 + if (system_supports_poe()) 123 + write_sysreg_s(ua_state->por_el0, SYS_POR_EL0); 124 + } 73 125 74 126 static void init_user_layout(struct rt_sigframe_user_layout *user) 75 127 { ··· 315 261 return err; 316 262 } 317 263 318 - static int preserve_poe_context(struct poe_context __user *ctx) 264 + static int preserve_poe_context(struct poe_context __user *ctx, 265 + const struct user_access_state *ua_state) 319 266 { 320 267 int err = 0; 321 268 322 269 __put_user_error(POE_MAGIC, &ctx->head.magic, err); 323 270 __put_user_error(sizeof(*ctx), &ctx->head.size, err); 324 - __put_user_error(read_sysreg_s(SYS_POR_EL0), &ctx->por_el0, err); 271 + __put_user_error(ua_state->por_el0, &ctx->por_el0, err); 325 272 326 273 return err; 327 274 } 328 275 329 - static int restore_poe_context(struct user_ctxs *user) 276 + static int restore_poe_context(struct user_ctxs *user, 277 + struct user_access_state *ua_state) 330 278 { 331 279 u64 por_el0; 332 280 int err = 0; ··· 338 282 339 283 __get_user_error(por_el0, &(user->poe->por_el0), err); 340 284 if (!err) 341 - write_sysreg_s(por_el0, SYS_POR_EL0); 285 + ua_state->por_el0 = por_el0; 342 286 343 287 return err; 344 288 } ··· 906 850 } 907 851 908 852 static int restore_sigframe(struct pt_regs *regs, 909 - struct rt_sigframe __user *sf) 853 + struct rt_sigframe __user *sf, 854 + struct user_access_state *ua_state) 910 855 { 911 856 sigset_t set; 912 857 int i, err; ··· 956 899 err = restore_zt_context(&user); 957 900 958 901 if (err == 0 && system_supports_poe() && user.poe) 959 - err = restore_poe_context(&user); 902 + err = restore_poe_context(&user, ua_state); 960 903 961 904 return err; 962 905 } ··· 965 908 { 966 909 struct pt_regs *regs = current_pt_regs(); 967 910 struct rt_sigframe __user *frame; 911 + struct user_access_state ua_state; 968 912 969 913 /* Always make any pending restarted system calls return -EINTR */ 970 914 current->restart_block.fn = do_no_restart_syscall; ··· 982 924 if (!access_ok(frame, sizeof (*frame))) 983 925 goto badframe; 984 926 985 - if (restore_sigframe(regs, frame)) 927 + if (restore_sigframe(regs, frame, &ua_state)) 986 928 goto badframe; 987 929 988 930 if (restore_altstack(&frame->uc.uc_stack)) 989 931 goto badframe; 932 + 933 + restore_user_access_state(&ua_state); 990 934 991 935 return regs->regs[0]; 992 936 ··· 1095 1035 } 1096 1036 1097 1037 static int setup_sigframe(struct rt_sigframe_user_layout *user, 1098 - struct pt_regs *regs, sigset_t *set) 1038 + struct pt_regs *regs, sigset_t *set, 1039 + const struct user_access_state *ua_state) 1099 1040 { 1100 1041 int i, err = 0; 1101 1042 struct rt_sigframe __user *sf = user->sigframe; ··· 1158 1097 struct poe_context __user *poe_ctx = 1159 1098 apply_user_offset(user, user->poe_offset); 1160 1099 1161 - err |= preserve_poe_context(poe_ctx); 1100 + err |= preserve_poe_context(poe_ctx, ua_state); 1162 1101 } 1163 - 1164 1102 1165 1103 /* ZA state if present */ 1166 1104 if (system_supports_sme() && err == 0 && user->za_offset) { ··· 1297 1237 sme_smstop(); 1298 1238 } 1299 1239 1300 - if (system_supports_poe()) 1301 - write_sysreg_s(POR_EL0_INIT, SYS_POR_EL0); 1302 - 1303 1240 if (ka->sa.sa_flags & SA_RESTORER) 1304 1241 sigtramp = ka->sa.sa_restorer; 1305 1242 else ··· 1310 1253 { 1311 1254 struct rt_sigframe_user_layout user; 1312 1255 struct rt_sigframe __user *frame; 1256 + struct user_access_state ua_state; 1313 1257 int err = 0; 1314 1258 1315 1259 fpsimd_signal_preserve_current_state(); ··· 1318 1260 if (get_sigframe(&user, ksig, regs)) 1319 1261 return 1; 1320 1262 1263 + save_reset_user_access_state(&ua_state); 1321 1264 frame = user.sigframe; 1322 1265 1323 1266 __put_user_error(0, &frame->uc.uc_flags, err); 1324 1267 __put_user_error(NULL, &frame->uc.uc_link, err); 1325 1268 1326 1269 err |= __save_altstack(&frame->uc.uc_stack, regs->sp); 1327 - err |= setup_sigframe(&user, regs, set); 1270 + err |= setup_sigframe(&user, regs, set, &ua_state); 1328 1271 if (err == 0) { 1329 1272 setup_return(regs, &ksig->ka, &user, usig); 1330 1273 if (ksig->ka.sa.sa_flags & SA_SIGINFO) { ··· 1334 1275 regs->regs[2] = (unsigned long)&frame->uc; 1335 1276 } 1336 1277 } 1278 + 1279 + if (err == 0) 1280 + set_handler_user_access_state(); 1281 + else 1282 + restore_user_access_state(&ua_state); 1337 1283 1338 1284 return err; 1339 1285 }
+1
arch/mips/kernel/cmpxchg.c
··· 102 102 return old; 103 103 } 104 104 } 105 + EXPORT_SYMBOL(__cmpxchg_small);
+1 -1
arch/riscv/Kconfig
··· 177 177 select HAVE_REGS_AND_STACK_ACCESS_API 178 178 select HAVE_RETHOOK if !XIP_KERNEL 179 179 select HAVE_RSEQ 180 - select HAVE_RUST if RUSTC_SUPPORTS_RISCV 180 + select HAVE_RUST if RUSTC_SUPPORTS_RISCV && CC_IS_CLANG 181 181 select HAVE_SAMPLE_FTRACE_DIRECT 182 182 select HAVE_SAMPLE_FTRACE_DIRECT_MULTI 183 183 select HAVE_STACKPROTECTOR
+3 -3
arch/riscv/boot/dts/sophgo/sg2042.dtsi
··· 112 112 compatible = "snps,dw-apb-gpio-port"; 113 113 gpio-controller; 114 114 #gpio-cells = <2>; 115 - snps,nr-gpios = <32>; 115 + ngpios = <32>; 116 116 reg = <0>; 117 117 interrupt-controller; 118 118 #interrupt-cells = <2>; ··· 134 134 compatible = "snps,dw-apb-gpio-port"; 135 135 gpio-controller; 136 136 #gpio-cells = <2>; 137 - snps,nr-gpios = <32>; 137 + ngpios = <32>; 138 138 reg = <0>; 139 139 interrupt-controller; 140 140 #interrupt-cells = <2>; ··· 156 156 compatible = "snps,dw-apb-gpio-port"; 157 157 gpio-controller; 158 158 #gpio-cells = <2>; 159 - snps,nr-gpios = <32>; 159 + ngpios = <32>; 160 160 reg = <0>; 161 161 interrupt-controller; 162 162 #interrupt-cells = <2>;
-2
arch/riscv/boot/dts/starfive/jh7110-common.dtsi
··· 128 128 assigned-clocks = <&ispcrg JH7110_ISPCLK_DOM4_APB_FUNC>, 129 129 <&ispcrg JH7110_ISPCLK_MIPI_RX0_PXL>; 130 130 assigned-clock-rates = <49500000>, <198000000>; 131 - status = "okay"; 132 131 133 132 ports { 134 133 #address-cells = <1>; ··· 150 151 &csi2rx { 151 152 assigned-clocks = <&ispcrg JH7110_ISPCLK_VIN_SYS>; 152 153 assigned-clock-rates = <297000000>; 153 - status = "okay"; 154 154 155 155 ports { 156 156 #address-cells = <1>;
+1 -2
arch/riscv/boot/dts/starfive/jh7110-pine64-star64.dts
··· 44 44 }; 45 45 46 46 &phy0 { 47 - rx-internal-delay-ps = <1900>; 48 - tx-internal-delay-ps = <1500>; 47 + rx-internal-delay-ps = <1500>; 49 48 motorcomm,rx-clk-drv-microamp = <2910>; 50 49 motorcomm,rx-data-drv-microamp = <2910>; 51 50 motorcomm,tx-clk-adj-enabled;
+6
arch/riscv/errata/Makefile
··· 2 2 KBUILD_CFLAGS += -fno-pie 3 3 endif 4 4 5 + ifdef CONFIG_RISCV_ALTERNATIVE_EARLY 6 + ifdef CONFIG_FORTIFY_SOURCE 7 + KBUILD_CFLAGS += -D__NO_FORTIFY 8 + endif 9 + endif 10 + 5 11 obj-$(CONFIG_ERRATA_ANDES) += andes/ 6 12 obj-$(CONFIG_ERRATA_SIFIVE) += sifive/ 7 13 obj-$(CONFIG_ERRATA_THEAD) += thead/
+5
arch/riscv/kernel/Makefile
··· 36 36 KASAN_SANITIZE_cpufeature.o := n 37 37 KASAN_SANITIZE_sbi_ecall.o := n 38 38 endif 39 + ifdef CONFIG_FORTIFY_SOURCE 40 + CFLAGS_alternative.o += -D__NO_FORTIFY 41 + CFLAGS_cpufeature.o += -D__NO_FORTIFY 42 + CFLAGS_sbi_ecall.o += -D__NO_FORTIFY 43 + endif 39 44 endif 40 45 41 46 extra-y += vmlinux.lds
+2 -2
arch/riscv/kernel/acpi.c
··· 210 210 if (!size) 211 211 return NULL; 212 212 213 - return early_ioremap(phys, size); 213 + return early_memremap(phys, size); 214 214 } 215 215 216 216 void __init __acpi_unmap_table(void __iomem *map, unsigned long size) ··· 218 218 if (!map || !size) 219 219 return; 220 220 221 - early_iounmap(map, size); 221 + early_memunmap(map, size); 222 222 } 223 223 224 224 void __iomem *acpi_os_ioremap(acpi_physical_address phys, acpi_size size)
-2
arch/riscv/kernel/asm-offsets.c
··· 4 4 * Copyright (C) 2017 SiFive 5 5 */ 6 6 7 - #define GENERATING_ASM_OFFSETS 8 - 9 7 #include <linux/kbuild.h> 10 8 #include <linux/mm.h> 11 9 #include <linux/sched.h>
+5 -2
arch/riscv/kernel/cacheinfo.c
··· 80 80 { 81 81 struct cpu_cacheinfo *this_cpu_ci = get_cpu_cacheinfo(cpu); 82 82 struct cacheinfo *this_leaf = this_cpu_ci->info_list; 83 - struct device_node *np = of_cpu_device_node_get(cpu); 84 - struct device_node *prev = NULL; 83 + struct device_node *np, *prev; 85 84 int levels = 1, level = 1; 86 85 87 86 if (!acpi_disabled) { ··· 103 104 } 104 105 return 0; 105 106 } 107 + 108 + np = of_cpu_device_node_get(cpu); 109 + if (!np) 110 + return -ENOENT; 106 111 107 112 if (of_property_read_bool(np, "cache-size")) 108 113 ci_leaf_init(this_leaf++, CACHE_TYPE_UNIFIED, level);
+1 -1
arch/riscv/kernel/cpu-hotplug.c
··· 58 58 if (cpu_ops->cpu_is_stopped) 59 59 ret = cpu_ops->cpu_is_stopped(cpu); 60 60 if (ret) 61 - pr_warn("CPU%d may not have stopped: %d\n", cpu, ret); 61 + pr_warn("CPU%u may not have stopped: %d\n", cpu, ret); 62 62 } 63 63 64 64 /*
+1 -1
arch/riscv/kernel/efi-header.S
··· 64 64 .long efi_header_end - _start // SizeOfHeaders 65 65 .long 0 // CheckSum 66 66 .short IMAGE_SUBSYSTEM_EFI_APPLICATION // Subsystem 67 - .short 0 // DllCharacteristics 67 + .short IMAGE_DLL_CHARACTERISTICS_NX_COMPAT // DllCharacteristics 68 68 .quad 0 // SizeOfStackReserve 69 69 .quad 0 // SizeOfStackCommit 70 70 .quad 0 // SizeOfHeapReserve
+5 -1
arch/riscv/kernel/pi/Makefile
··· 16 16 KBUILD_CFLAGS += -mcmodel=medany 17 17 18 18 CFLAGS_cmdline_early.o += -D__NO_FORTIFY 19 - CFLAGS_lib-fdt_ro.o += -D__NO_FORTIFY 20 19 CFLAGS_fdt_early.o += -D__NO_FORTIFY 20 + # lib/string.c already defines __NO_FORTIFY 21 + CFLAGS_ctype.o += -D__NO_FORTIFY 22 + CFLAGS_lib-fdt.o += -D__NO_FORTIFY 23 + CFLAGS_lib-fdt_ro.o += -D__NO_FORTIFY 24 + CFLAGS_archrandom_early.o += -D__NO_FORTIFY 21 25 22 26 $(obj)/%.pi.o: OBJCOPYFLAGS := --prefix-symbols=__pi_ \ 23 27 --remove-section=.note.gnu.property \
-2
arch/riscv/kernel/traps_misaligned.c
··· 136 136 #define REG_PTR(insn, pos, regs) \ 137 137 (ulong *)((ulong)(regs) + REG_OFFSET(insn, pos)) 138 138 139 - #define GET_RM(insn) (((insn) >> 12) & 7) 140 - 141 139 #define GET_RS1(insn, regs) (*REG_PTR(insn, SH_RS1, regs)) 142 140 #define GET_RS2(insn, regs) (*REG_PTR(insn, SH_RS2, regs)) 143 141 #define GET_RS1S(insn, regs) (*REG_PTR(RVC_RS1S(insn), 0, regs))
+1
arch/riscv/kernel/vdso/Makefile
··· 18 18 19 19 ccflags-y := -fno-stack-protector 20 20 ccflags-y += -DDISABLE_BRANCH_PROFILING 21 + ccflags-y += -fno-builtin 21 22 22 23 ifneq ($(c-gettimeofday-y),) 23 24 CFLAGS_vgettimeofday.o += -fPIC -include $(c-gettimeofday-y)
+4 -1
arch/x86/include/asm/amd_nb.h
··· 116 116 117 117 #define amd_nb_num(x) 0 118 118 #define amd_nb_has_feature(x) false 119 - #define node_to_amd_nb(x) NULL 119 + static inline struct amd_northbridge *node_to_amd_nb(int node) 120 + { 121 + return NULL; 122 + } 120 123 #define amd_gart_present(x) false 121 124 122 125 #endif
+17 -39
block/blk-map.c
··· 561 561 /* Prepare bio for passthrough IO given ITER_BVEC iter */ 562 562 static int blk_rq_map_user_bvec(struct request *rq, const struct iov_iter *iter) 563 563 { 564 - struct request_queue *q = rq->q; 565 - size_t nr_iter = iov_iter_count(iter); 566 - size_t nr_segs = iter->nr_segs; 567 - struct bio_vec *bvecs, *bvprvp = NULL; 568 - const struct queue_limits *lim = &q->limits; 569 - unsigned int nsegs = 0, bytes = 0; 564 + const struct queue_limits *lim = &rq->q->limits; 565 + unsigned int max_bytes = lim->max_hw_sectors << SECTOR_SHIFT; 566 + unsigned int nsegs; 570 567 struct bio *bio; 571 - size_t i; 568 + int ret; 572 569 573 - if (!nr_iter || (nr_iter >> SECTOR_SHIFT) > queue_max_hw_sectors(q)) 574 - return -EINVAL; 575 - if (nr_segs > queue_max_segments(q)) 570 + if (!iov_iter_count(iter) || iov_iter_count(iter) > max_bytes) 576 571 return -EINVAL; 577 572 578 - /* no iovecs to alloc, as we already have a BVEC iterator */ 573 + /* reuse the bvecs from the iterator instead of allocating new ones */ 579 574 bio = blk_rq_map_bio_alloc(rq, 0, GFP_KERNEL); 580 - if (bio == NULL) 575 + if (!bio) 581 576 return -ENOMEM; 582 - 583 577 bio_iov_bvec_set(bio, (struct iov_iter *)iter); 584 - blk_rq_bio_prep(rq, bio, nr_segs); 585 578 586 - /* loop to perform a bunch of sanity checks */ 587 - bvecs = (struct bio_vec *)iter->bvec; 588 - for (i = 0; i < nr_segs; i++) { 589 - struct bio_vec *bv = &bvecs[i]; 590 - 591 - /* 592 - * If the queue doesn't support SG gaps and adding this 593 - * offset would create a gap, fallback to copy. 594 - */ 595 - if (bvprvp && bvec_gap_to_prev(lim, bvprvp, bv->bv_offset)) { 596 - blk_mq_map_bio_put(bio); 597 - return -EREMOTEIO; 598 - } 599 - /* check full condition */ 600 - if (nsegs >= nr_segs || bytes > UINT_MAX - bv->bv_len) 601 - goto put_bio; 602 - if (bytes + bv->bv_len > nr_iter) 603 - break; 604 - 605 - nsegs++; 606 - bytes += bv->bv_len; 607 - bvprvp = bv; 579 + /* check that the data layout matches the hardware restrictions */ 580 + ret = bio_split_rw_at(bio, lim, &nsegs, max_bytes); 581 + if (ret) { 582 + /* if we would have to split the bio, copy instead */ 583 + if (ret > 0) 584 + ret = -EREMOTEIO; 585 + blk_mq_map_bio_put(bio); 586 + return ret; 608 587 } 588 + 589 + blk_rq_bio_prep(rq, bio, nsegs); 609 590 return 0; 610 - put_bio: 611 - blk_mq_map_bio_put(bio); 612 - return -EINVAL; 613 591 } 614 592 615 593 /**
+9
drivers/accel/ivpu/ivpu_debugfs.c
··· 108 108 return 0; 109 109 } 110 110 111 + static int firewall_irq_counter_show(struct seq_file *s, void *v) 112 + { 113 + struct ivpu_device *vdev = seq_to_ivpu(s); 114 + 115 + seq_printf(s, "%d\n", atomic_read(&vdev->hw->firewall_irq_counter)); 116 + return 0; 117 + } 118 + 111 119 static const struct drm_debugfs_info vdev_debugfs_list[] = { 112 120 {"bo_list", bo_list_show, 0}, 113 121 {"fw_name", fw_name_show, 0}, ··· 124 116 {"last_bootmode", last_bootmode_show, 0}, 125 117 {"reset_counter", reset_counter_show, 0}, 126 118 {"reset_pending", reset_pending_show, 0}, 119 + {"firewall_irq_counter", firewall_irq_counter_show, 0}, 127 120 }; 128 121 129 122 static ssize_t
+1
drivers/accel/ivpu/ivpu_hw.c
··· 249 249 platform_init(vdev); 250 250 wa_init(vdev); 251 251 timeouts_init(vdev); 252 + atomic_set(&vdev->hw->firewall_irq_counter, 0); 252 253 253 254 return 0; 254 255 }
+1
drivers/accel/ivpu/ivpu_hw.h
··· 52 52 int dma_bits; 53 53 ktime_t d0i3_entry_host_ts; 54 54 u64 d0i3_entry_vpu_ts; 55 + atomic_t firewall_irq_counter; 55 56 }; 56 57 57 58 int ivpu_hw_init(struct ivpu_device *vdev);
+4 -1
drivers/accel/ivpu/ivpu_hw_ip.c
··· 1062 1062 1063 1063 static void irq_noc_firewall_handler(struct ivpu_device *vdev) 1064 1064 { 1065 - ivpu_pm_trigger_recovery(vdev, "NOC Firewall IRQ"); 1065 + atomic_inc(&vdev->hw->firewall_irq_counter); 1066 + 1067 + ivpu_dbg(vdev, IRQ, "NOC Firewall interrupt detected, counter %d\n", 1068 + atomic_read(&vdev->hw->firewall_irq_counter)); 1066 1069 } 1067 1070 1068 1071 /* Handler for IRQs from NPU core */
+5 -4
drivers/acpi/cppc_acpi.c
··· 867 867 868 868 /* Store CPU Logical ID */ 869 869 cpc_ptr->cpu_id = pr->id; 870 - spin_lock_init(&cpc_ptr->rmw_lock); 870 + raw_spin_lock_init(&cpc_ptr->rmw_lock); 871 871 872 872 /* Parse PSD data for this CPU */ 873 873 ret = acpi_get_psd(cpc_ptr, handle); ··· 1087 1087 int pcc_ss_id = per_cpu(cpu_pcc_subspace_idx, cpu); 1088 1088 struct cpc_reg *reg = &reg_res->cpc_entry.reg; 1089 1089 struct cpc_desc *cpc_desc; 1090 + unsigned long flags; 1090 1091 1091 1092 size = GET_BIT_WIDTH(reg); 1092 1093 ··· 1127 1126 return -ENODEV; 1128 1127 } 1129 1128 1130 - spin_lock(&cpc_desc->rmw_lock); 1129 + raw_spin_lock_irqsave(&cpc_desc->rmw_lock, flags); 1131 1130 switch (size) { 1132 1131 case 8: 1133 1132 prev_val = readb_relaxed(vaddr); ··· 1142 1141 prev_val = readq_relaxed(vaddr); 1143 1142 break; 1144 1143 default: 1145 - spin_unlock(&cpc_desc->rmw_lock); 1144 + raw_spin_unlock_irqrestore(&cpc_desc->rmw_lock, flags); 1146 1145 return -EFAULT; 1147 1146 } 1148 1147 val = MASK_VAL_WRITE(reg, prev_val, val); ··· 1175 1174 } 1176 1175 1177 1176 if (reg->space_id == ACPI_ADR_SPACE_SYSTEM_MEMORY) 1178 - spin_unlock(&cpc_desc->rmw_lock); 1177 + raw_spin_unlock_irqrestore(&cpc_desc->rmw_lock, flags); 1179 1178 1180 1179 return ret_val; 1181 1180 }
+40 -8
drivers/base/core.c
··· 26 26 #include <linux/of.h> 27 27 #include <linux/of_device.h> 28 28 #include <linux/pm_runtime.h> 29 - #include <linux/rcupdate.h> 30 29 #include <linux/sched/mm.h> 31 30 #include <linux/sched/signal.h> 32 31 #include <linux/slab.h> ··· 2633 2634 static int dev_uevent(const struct kobject *kobj, struct kobj_uevent_env *env) 2634 2635 { 2635 2636 const struct device *dev = kobj_to_dev(kobj); 2636 - struct device_driver *driver; 2637 2637 int retval = 0; 2638 2638 2639 2639 /* add device node properties if present */ ··· 2661 2663 if (dev->type && dev->type->name) 2662 2664 add_uevent_var(env, "DEVTYPE=%s", dev->type->name); 2663 2665 2664 - /* Synchronize with module_remove_driver() */ 2665 - rcu_read_lock(); 2666 - driver = READ_ONCE(dev->driver); 2667 - if (driver) 2668 - add_uevent_var(env, "DRIVER=%s", driver->name); 2669 - rcu_read_unlock(); 2666 + if (dev->driver) 2667 + add_uevent_var(env, "DRIVER=%s", dev->driver->name); 2670 2668 2671 2669 /* Add common DT information about the device */ 2672 2670 of_device_uevent(dev, env); ··· 2732 2738 if (!env) 2733 2739 return -ENOMEM; 2734 2740 2741 + /* Synchronize with really_probe() */ 2742 + device_lock(dev); 2735 2743 /* let the kset specific function add its keys */ 2736 2744 retval = kset->uevent_ops->uevent(&dev->kobj, env); 2745 + device_unlock(dev); 2737 2746 if (retval) 2738 2747 goto out; 2739 2748 ··· 4033 4036 return error; 4034 4037 } 4035 4038 EXPORT_SYMBOL_GPL(device_for_each_child_reverse); 4039 + 4040 + /** 4041 + * device_for_each_child_reverse_from - device child iterator in reversed order. 4042 + * @parent: parent struct device. 4043 + * @from: optional starting point in child list 4044 + * @fn: function to be called for each device. 4045 + * @data: data for the callback. 4046 + * 4047 + * Iterate over @parent's child devices, starting at @from, and call @fn 4048 + * for each, passing it @data. This helper is identical to 4049 + * device_for_each_child_reverse() when @from is NULL. 4050 + * 4051 + * @fn is checked each iteration. If it returns anything other than 0, 4052 + * iteration stop and that value is returned to the caller of 4053 + * device_for_each_child_reverse_from(); 4054 + */ 4055 + int device_for_each_child_reverse_from(struct device *parent, 4056 + struct device *from, const void *data, 4057 + int (*fn)(struct device *, const void *)) 4058 + { 4059 + struct klist_iter i; 4060 + struct device *child; 4061 + int error = 0; 4062 + 4063 + if (!parent->p) 4064 + return 0; 4065 + 4066 + klist_iter_init_node(&parent->p->klist_children, &i, 4067 + (from ? &from->p->knode_parent : NULL)); 4068 + while ((child = prev_device(&i)) && !error) 4069 + error = fn(child, data); 4070 + klist_iter_exit(&i); 4071 + return error; 4072 + } 4073 + EXPORT_SYMBOL_GPL(device_for_each_child_reverse_from); 4036 4074 4037 4075 /** 4038 4076 * device_find_child - device iterator for locating a particular device.
-4
drivers/base/module.c
··· 7 7 #include <linux/errno.h> 8 8 #include <linux/slab.h> 9 9 #include <linux/string.h> 10 - #include <linux/rcupdate.h> 11 10 #include "base.h" 12 11 13 12 static char *make_driver_name(const struct device_driver *drv) ··· 100 101 101 102 if (!drv) 102 103 return; 103 - 104 - /* Synchronize with dev_uevent() */ 105 - synchronize_rcu(); 106 104 107 105 sysfs_remove_link(&drv->p->kobj, "module"); 108 106
-4
drivers/char/tpm/tpm-chip.c
··· 525 525 { 526 526 struct tpm_chip *chip = container_of(rng, struct tpm_chip, hwrng); 527 527 528 - /* Give back zero bytes, as TPM chip has not yet fully resumed: */ 529 - if (chip->flags & TPM_CHIP_FLAG_SUSPENDED) 530 - return 0; 531 - 532 528 return tpm_get_random(chip, data, max); 533 529 } 534 530
+22 -10
drivers/char/tpm/tpm-interface.c
··· 370 370 if (!chip) 371 371 return -ENODEV; 372 372 373 + rc = tpm_try_get_ops(chip); 374 + if (rc) { 375 + /* Can be safely set out of locks, as no action cannot race: */ 376 + chip->flags |= TPM_CHIP_FLAG_SUSPENDED; 377 + goto out; 378 + } 379 + 373 380 if (chip->flags & TPM_CHIP_FLAG_ALWAYS_POWERED) 374 381 goto suspended; 375 382 ··· 384 377 !pm_suspend_via_firmware()) 385 378 goto suspended; 386 379 387 - rc = tpm_try_get_ops(chip); 388 - if (!rc) { 389 - if (chip->flags & TPM_CHIP_FLAG_TPM2) { 390 - tpm2_end_auth_session(chip); 391 - tpm2_shutdown(chip, TPM2_SU_STATE); 392 - } else { 393 - rc = tpm1_pm_suspend(chip, tpm_suspend_pcr); 394 - } 395 - 396 - tpm_put_ops(chip); 380 + if (chip->flags & TPM_CHIP_FLAG_TPM2) { 381 + tpm2_end_auth_session(chip); 382 + tpm2_shutdown(chip, TPM2_SU_STATE); 383 + goto suspended; 397 384 } 385 + 386 + rc = tpm1_pm_suspend(chip, tpm_suspend_pcr); 398 387 399 388 suspended: 400 389 chip->flags |= TPM_CHIP_FLAG_SUSPENDED; 390 + tpm_put_ops(chip); 401 391 392 + out: 402 393 if (rc) 403 394 dev_err(dev, "Ignoring error %d while suspending\n", rc); 404 395 return 0; ··· 445 440 if (!chip) 446 441 return -ENODEV; 447 442 443 + /* Give back zero bytes, as TPM chip has not yet fully resumed: */ 444 + if (chip->flags & TPM_CHIP_FLAG_SUSPENDED) { 445 + rc = 0; 446 + goto out; 447 + } 448 + 448 449 if (chip->flags & TPM_CHIP_FLAG_TPM2) 449 450 rc = tpm2_get_random(chip, out, max); 450 451 else 451 452 rc = tpm1_get_random(chip, out, max); 452 453 454 + out: 453 455 tpm_put_ops(chip); 454 456 return rc; 455 457 }
+1
drivers/cxl/Kconfig
··· 60 60 default CXL_BUS 61 61 select ACPI_TABLE_LIB 62 62 select ACPI_HMAT 63 + select CXL_PORT 63 64 help 64 65 Enable support for host managed device memory (HDM) resources 65 66 published by a platform's ACPI CXL memory layout description. See
+14 -6
drivers/cxl/Makefile
··· 1 1 # SPDX-License-Identifier: GPL-2.0 2 + 3 + # Order is important here for the built-in case: 4 + # - 'core' first for fundamental init 5 + # - 'port' before platform root drivers like 'acpi' so that CXL-root ports 6 + # are immediately enabled 7 + # - 'mem' and 'pmem' before endpoint drivers so that memdevs are 8 + # immediately enabled 9 + # - 'pci' last, also mirrors the hardware enumeration hierarchy 2 10 obj-y += core/ 3 - obj-$(CONFIG_CXL_PCI) += cxl_pci.o 4 - obj-$(CONFIG_CXL_MEM) += cxl_mem.o 11 + obj-$(CONFIG_CXL_PORT) += cxl_port.o 5 12 obj-$(CONFIG_CXL_ACPI) += cxl_acpi.o 6 13 obj-$(CONFIG_CXL_PMEM) += cxl_pmem.o 7 - obj-$(CONFIG_CXL_PORT) += cxl_port.o 14 + obj-$(CONFIG_CXL_MEM) += cxl_mem.o 15 + obj-$(CONFIG_CXL_PCI) += cxl_pci.o 8 16 9 - cxl_mem-y := mem.o 10 - cxl_pci-y := pci.o 17 + cxl_port-y := port.o 11 18 cxl_acpi-y := acpi.o 12 19 cxl_pmem-y := pmem.o security.o 13 - cxl_port-y := port.o 20 + cxl_mem-y := mem.o 21 + cxl_pci-y := pci.o
+7
drivers/cxl/acpi.c
··· 924 924 925 925 /* load before dax_hmem sees 'Soft Reserved' CXL ranges */ 926 926 subsys_initcall(cxl_acpi_init); 927 + 928 + /* 929 + * Arrange for host-bridge ports to be active synchronous with 930 + * cxl_acpi_probe() exit. 931 + */ 932 + MODULE_SOFTDEP("pre: cxl_port"); 933 + 927 934 module_exit(cxl_acpi_exit); 928 935 MODULE_DESCRIPTION("CXL ACPI: Platform Support"); 929 936 MODULE_LICENSE("GPL v2");
+3
drivers/cxl/core/cdat.c
··· 641 641 void *ptr; 642 642 int rc; 643 643 644 + if (!dev_is_pci(cxlds->dev)) 645 + return -ENODEV; 646 + 644 647 if (cxlds->rcd) 645 648 return -ENODEV; 646 649
+42 -8
drivers/cxl/core/hdm.c
··· 712 712 return 0; 713 713 } 714 714 715 - static int cxl_decoder_reset(struct cxl_decoder *cxld) 715 + static int commit_reap(struct device *dev, const void *data) 716 + { 717 + struct cxl_port *port = to_cxl_port(dev->parent); 718 + struct cxl_decoder *cxld; 719 + 720 + if (!is_switch_decoder(dev) && !is_endpoint_decoder(dev)) 721 + return 0; 722 + 723 + cxld = to_cxl_decoder(dev); 724 + if (port->commit_end == cxld->id && 725 + ((cxld->flags & CXL_DECODER_F_ENABLE) == 0)) { 726 + port->commit_end--; 727 + dev_dbg(&port->dev, "reap: %s commit_end: %d\n", 728 + dev_name(&cxld->dev), port->commit_end); 729 + } 730 + 731 + return 0; 732 + } 733 + 734 + void cxl_port_commit_reap(struct cxl_decoder *cxld) 735 + { 736 + struct cxl_port *port = to_cxl_port(cxld->dev.parent); 737 + 738 + lockdep_assert_held_write(&cxl_region_rwsem); 739 + 740 + /* 741 + * Once the highest committed decoder is disabled, free any other 742 + * decoders that were pinned allocated by out-of-order release. 743 + */ 744 + port->commit_end--; 745 + dev_dbg(&port->dev, "reap: %s commit_end: %d\n", dev_name(&cxld->dev), 746 + port->commit_end); 747 + device_for_each_child_reverse_from(&port->dev, &cxld->dev, NULL, 748 + commit_reap); 749 + } 750 + EXPORT_SYMBOL_NS_GPL(cxl_port_commit_reap, CXL); 751 + 752 + static void cxl_decoder_reset(struct cxl_decoder *cxld) 716 753 { 717 754 struct cxl_port *port = to_cxl_port(cxld->dev.parent); 718 755 struct cxl_hdm *cxlhdm = dev_get_drvdata(&port->dev); ··· 758 721 u32 ctrl; 759 722 760 723 if ((cxld->flags & CXL_DECODER_F_ENABLE) == 0) 761 - return 0; 724 + return; 762 725 763 - if (port->commit_end != id) { 726 + if (port->commit_end == id) 727 + cxl_port_commit_reap(cxld); 728 + else 764 729 dev_dbg(&port->dev, 765 730 "%s: out of order reset, expected decoder%d.%d\n", 766 731 dev_name(&cxld->dev), port->id, port->commit_end); 767 - return -EBUSY; 768 - } 769 732 770 733 down_read(&cxl_dpa_rwsem); 771 734 ctrl = readl(hdm + CXL_HDM_DECODER0_CTRL_OFFSET(id)); ··· 778 741 writel(0, hdm + CXL_HDM_DECODER0_BASE_LOW_OFFSET(id)); 779 742 up_read(&cxl_dpa_rwsem); 780 743 781 - port->commit_end--; 782 744 cxld->flags &= ~CXL_DECODER_F_ENABLE; 783 745 784 746 /* Userspace is now responsible for reconfiguring this decoder */ ··· 787 751 cxled = to_cxl_endpoint_decoder(&cxld->dev); 788 752 cxled->state = CXL_DECODER_STATE_MANUAL; 789 753 } 790 - 791 - return 0; 792 754 } 793 755 794 756 static int cxl_setup_hdm_decoder_from_dvsec(
+10 -3
drivers/cxl/core/port.c
··· 2084 2084 2085 2085 static struct workqueue_struct *cxl_bus_wq; 2086 2086 2087 + static int cxl_rescan_attach(struct device *dev, void *data) 2088 + { 2089 + int rc = device_attach(dev); 2090 + 2091 + dev_vdbg(dev, "rescan: %s\n", rc ? "attach" : "detached"); 2092 + 2093 + return 0; 2094 + } 2095 + 2087 2096 static void cxl_bus_rescan_queue(struct work_struct *w) 2088 2097 { 2089 - int rc = bus_rescan_devices(&cxl_bus_type); 2090 - 2091 - pr_debug("CXL bus rescan result: %d\n", rc); 2098 + bus_for_each_dev(&cxl_bus_type, NULL, NULL, cxl_rescan_attach); 2092 2099 } 2093 2100 2094 2101 void cxl_bus_rescan(void)
+46 -45
drivers/cxl/core/region.c
··· 232 232 "Bypassing cpu_cache_invalidate_memregion() for testing!\n"); 233 233 return 0; 234 234 } else { 235 - dev_err(&cxlr->dev, 236 - "Failed to synchronize CPU cache state\n"); 235 + dev_WARN(&cxlr->dev, 236 + "Failed to synchronize CPU cache state\n"); 237 237 return -ENXIO; 238 238 } 239 239 } ··· 242 242 return 0; 243 243 } 244 244 245 - static int cxl_region_decode_reset(struct cxl_region *cxlr, int count) 245 + static void cxl_region_decode_reset(struct cxl_region *cxlr, int count) 246 246 { 247 247 struct cxl_region_params *p = &cxlr->params; 248 - int i, rc = 0; 248 + int i; 249 249 250 250 /* 251 - * Before region teardown attempt to flush, and if the flush 252 - * fails cancel the region teardown for data consistency 253 - * concerns 251 + * Before region teardown attempt to flush, evict any data cached for 252 + * this region, or scream loudly about missing arch / platform support 253 + * for CXL teardown. 254 254 */ 255 - rc = cxl_region_invalidate_memregion(cxlr); 256 - if (rc) 257 - return rc; 255 + cxl_region_invalidate_memregion(cxlr); 258 256 259 257 for (i = count - 1; i >= 0; i--) { 260 258 struct cxl_endpoint_decoder *cxled = p->targets[i]; ··· 275 277 cxl_rr = cxl_rr_load(iter, cxlr); 276 278 cxld = cxl_rr->decoder; 277 279 if (cxld->reset) 278 - rc = cxld->reset(cxld); 279 - if (rc) 280 - return rc; 280 + cxld->reset(cxld); 281 281 set_bit(CXL_REGION_F_NEEDS_RESET, &cxlr->flags); 282 282 } 283 283 284 284 endpoint_reset: 285 - rc = cxled->cxld.reset(&cxled->cxld); 286 - if (rc) 287 - return rc; 285 + cxled->cxld.reset(&cxled->cxld); 288 286 set_bit(CXL_REGION_F_NEEDS_RESET, &cxlr->flags); 289 287 } 290 288 291 289 /* all decoders associated with this region have been torn down */ 292 290 clear_bit(CXL_REGION_F_NEEDS_RESET, &cxlr->flags); 293 - 294 - return 0; 295 291 } 296 292 297 293 static int commit_decoder(struct cxl_decoder *cxld) ··· 401 409 * still pending. 402 410 */ 403 411 if (p->state == CXL_CONFIG_RESET_PENDING) { 404 - rc = cxl_region_decode_reset(cxlr, p->interleave_ways); 405 - /* 406 - * Revert to committed since there may still be active 407 - * decoders associated with this region, or move forward 408 - * to active to mark the reset successful 409 - */ 410 - if (rc) 411 - p->state = CXL_CONFIG_COMMIT; 412 - else 413 - p->state = CXL_CONFIG_ACTIVE; 412 + cxl_region_decode_reset(cxlr, p->interleave_ways); 413 + p->state = CXL_CONFIG_ACTIVE; 414 414 } 415 415 } 416 416 ··· 778 794 return rc; 779 795 } 780 796 797 + static int check_commit_order(struct device *dev, const void *data) 798 + { 799 + struct cxl_decoder *cxld = to_cxl_decoder(dev); 800 + 801 + /* 802 + * if port->commit_end is not the only free decoder, then out of 803 + * order shutdown has occurred, block further allocations until 804 + * that is resolved 805 + */ 806 + if (((cxld->flags & CXL_DECODER_F_ENABLE) == 0)) 807 + return -EBUSY; 808 + return 0; 809 + } 810 + 781 811 static int match_free_decoder(struct device *dev, void *data) 782 812 { 813 + struct cxl_port *port = to_cxl_port(dev->parent); 783 814 struct cxl_decoder *cxld; 784 - int *id = data; 815 + int rc; 785 816 786 817 if (!is_switch_decoder(dev)) 787 818 return 0; 788 819 789 820 cxld = to_cxl_decoder(dev); 790 821 791 - /* enforce ordered allocation */ 792 - if (cxld->id != *id) 822 + if (cxld->id != port->commit_end + 1) 793 823 return 0; 794 824 795 - if (!cxld->region) 796 - return 1; 825 + if (cxld->region) { 826 + dev_dbg(dev->parent, 827 + "next decoder to commit (%s) is already reserved (%s)\n", 828 + dev_name(dev), dev_name(&cxld->region->dev)); 829 + return 0; 830 + } 797 831 798 - (*id)++; 799 - 800 - return 0; 832 + rc = device_for_each_child_reverse_from(dev->parent, dev, NULL, 833 + check_commit_order); 834 + if (rc) { 835 + dev_dbg(dev->parent, 836 + "unable to allocate %s due to out of order shutdown\n", 837 + dev_name(dev)); 838 + return 0; 839 + } 840 + return 1; 801 841 } 802 842 803 843 static int match_auto_decoder(struct device *dev, void *data) ··· 848 840 struct cxl_region *cxlr) 849 841 { 850 842 struct device *dev; 851 - int id = 0; 852 843 853 844 if (port == cxled_to_port(cxled)) 854 845 return &cxled->cxld; ··· 856 849 dev = device_find_child(&port->dev, &cxlr->params, 857 850 match_auto_decoder); 858 851 else 859 - dev = device_find_child(&port->dev, &id, match_free_decoder); 852 + dev = device_find_child(&port->dev, NULL, match_free_decoder); 860 853 if (!dev) 861 854 return NULL; 862 855 /* ··· 2061 2054 get_device(&cxlr->dev); 2062 2055 2063 2056 if (p->state > CXL_CONFIG_ACTIVE) { 2064 - /* 2065 - * TODO: tear down all impacted regions if a device is 2066 - * removed out of order 2067 - */ 2068 - rc = cxl_region_decode_reset(cxlr, p->interleave_ways); 2069 - if (rc) 2070 - goto out; 2057 + cxl_region_decode_reset(cxlr, p->interleave_ways); 2071 2058 p->state = CXL_CONFIG_ACTIVE; 2072 2059 } 2073 2060
+14 -3
drivers/cxl/core/trace.h
··· 279 279 #define CXL_GMER_MEM_EVT_TYPE_ECC_ERROR 0x00 280 280 #define CXL_GMER_MEM_EVT_TYPE_INV_ADDR 0x01 281 281 #define CXL_GMER_MEM_EVT_TYPE_DATA_PATH_ERROR 0x02 282 - #define show_mem_event_type(type) __print_symbolic(type, \ 282 + #define show_gmer_mem_event_type(type) __print_symbolic(type, \ 283 283 { CXL_GMER_MEM_EVT_TYPE_ECC_ERROR, "ECC Error" }, \ 284 284 { CXL_GMER_MEM_EVT_TYPE_INV_ADDR, "Invalid Address" }, \ 285 285 { CXL_GMER_MEM_EVT_TYPE_DATA_PATH_ERROR, "Data Path Error" } \ ··· 373 373 "hpa=%llx region=%s region_uuid=%pUb", 374 374 __entry->dpa, show_dpa_flags(__entry->dpa_flags), 375 375 show_event_desc_flags(__entry->descriptor), 376 - show_mem_event_type(__entry->type), 376 + show_gmer_mem_event_type(__entry->type), 377 377 show_trans_type(__entry->transaction_type), 378 378 __entry->channel, __entry->rank, __entry->device, 379 379 __print_hex(__entry->comp_id, CXL_EVENT_GEN_MED_COMP_ID_SIZE), ··· 391 391 * DRAM Event Record defines many fields the same as the General Media Event 392 392 * Record. Reuse those definitions as appropriate. 393 393 */ 394 + #define CXL_DER_MEM_EVT_TYPE_ECC_ERROR 0x00 395 + #define CXL_DER_MEM_EVT_TYPE_SCRUB_MEDIA_ECC_ERROR 0x01 396 + #define CXL_DER_MEM_EVT_TYPE_INV_ADDR 0x02 397 + #define CXL_DER_MEM_EVT_TYPE_DATA_PATH_ERROR 0x03 398 + #define show_dram_mem_event_type(type) __print_symbolic(type, \ 399 + { CXL_DER_MEM_EVT_TYPE_ECC_ERROR, "ECC Error" }, \ 400 + { CXL_DER_MEM_EVT_TYPE_SCRUB_MEDIA_ECC_ERROR, "Scrub Media ECC Error" }, \ 401 + { CXL_DER_MEM_EVT_TYPE_INV_ADDR, "Invalid Address" }, \ 402 + { CXL_DER_MEM_EVT_TYPE_DATA_PATH_ERROR, "Data Path Error" } \ 403 + ) 404 + 394 405 #define CXL_DER_VALID_CHANNEL BIT(0) 395 406 #define CXL_DER_VALID_RANK BIT(1) 396 407 #define CXL_DER_VALID_NIBBLE BIT(2) ··· 488 477 "hpa=%llx region=%s region_uuid=%pUb", 489 478 __entry->dpa, show_dpa_flags(__entry->dpa_flags), 490 479 show_event_desc_flags(__entry->descriptor), 491 - show_mem_event_type(__entry->type), 480 + show_dram_mem_event_type(__entry->type), 492 481 show_trans_type(__entry->transaction_type), 493 482 __entry->channel, __entry->rank, __entry->nibble_mask, 494 483 __entry->bank_group, __entry->bank,
+2 -1
drivers/cxl/cxl.h
··· 359 359 struct cxl_region *region; 360 360 unsigned long flags; 361 361 int (*commit)(struct cxl_decoder *cxld); 362 - int (*reset)(struct cxl_decoder *cxld); 362 + void (*reset)(struct cxl_decoder *cxld); 363 363 }; 364 364 365 365 /* ··· 730 730 int cxl_num_decoders_committed(struct cxl_port *port); 731 731 bool is_cxl_port(const struct device *dev); 732 732 struct cxl_port *to_cxl_port(const struct device *dev); 733 + void cxl_port_commit_reap(struct cxl_decoder *cxld); 733 734 struct pci_bus; 734 735 int devm_cxl_register_pci_bus(struct device *host, struct device *uport_dev, 735 736 struct pci_bus *bus);
+16 -1
drivers/cxl/port.c
··· 208 208 }, 209 209 }; 210 210 211 - module_cxl_driver(cxl_port_driver); 211 + static int __init cxl_port_init(void) 212 + { 213 + return cxl_driver_register(&cxl_port_driver); 214 + } 215 + /* 216 + * Be ready to immediately enable ports emitted by the platform CXL root 217 + * (e.g. cxl_acpi) when CONFIG_CXL_PORT=y. 218 + */ 219 + subsys_initcall(cxl_port_init); 220 + 221 + static void __exit cxl_port_exit(void) 222 + { 223 + cxl_driver_unregister(&cxl_port_driver); 224 + } 225 + module_exit(cxl_port_exit); 226 + 212 227 MODULE_DESCRIPTION("CXL: Port enumeration and services"); 213 228 MODULE_LICENSE("GPL v2"); 214 229 MODULE_IMPORT_NS(CXL);
+14 -11
drivers/dma/sh/rz-dmac.c
··· 601 601 struct rz_dmac_chan *channel = to_rz_dmac_chan(chan); 602 602 u32 val; 603 603 604 - channel->src_per_address = config->src_addr; 605 604 channel->dst_per_address = config->dst_addr; 606 - 607 - val = rz_dmac_ds_to_val_mapping(config->dst_addr_width); 608 - if (val == CHCFG_DS_INVALID) 609 - return -EINVAL; 610 - 611 605 channel->chcfg &= ~CHCFG_FILL_DDS_MASK; 612 - channel->chcfg |= FIELD_PREP(CHCFG_FILL_DDS_MASK, val); 606 + if (channel->dst_per_address) { 607 + val = rz_dmac_ds_to_val_mapping(config->dst_addr_width); 608 + if (val == CHCFG_DS_INVALID) 609 + return -EINVAL; 613 610 614 - val = rz_dmac_ds_to_val_mapping(config->src_addr_width); 615 - if (val == CHCFG_DS_INVALID) 616 - return -EINVAL; 611 + channel->chcfg |= FIELD_PREP(CHCFG_FILL_DDS_MASK, val); 612 + } 617 613 614 + channel->src_per_address = config->src_addr; 618 615 channel->chcfg &= ~CHCFG_FILL_SDS_MASK; 619 - channel->chcfg |= FIELD_PREP(CHCFG_FILL_SDS_MASK, val); 616 + if (channel->src_per_address) { 617 + val = rz_dmac_ds_to_val_mapping(config->src_addr_width); 618 + if (val == CHCFG_DS_INVALID) 619 + return -EINVAL; 620 + 621 + channel->chcfg |= FIELD_PREP(CHCFG_FILL_SDS_MASK, val); 622 + } 620 623 621 624 return 0; 622 625 }
+47 -15
drivers/dma/ti/k3-udma.c
··· 3185 3185 3186 3186 d->static_tr.elcnt = elcnt; 3187 3187 3188 - /* 3189 - * PDMA must to close the packet when the channel is in packet mode. 3190 - * For TR mode when the channel is not cyclic we also need PDMA to close 3191 - * the packet otherwise the transfer will stall because PDMA holds on 3192 - * the data it has received from the peripheral. 3193 - */ 3194 3188 if (uc->config.pkt_mode || !uc->cyclic) { 3189 + /* 3190 + * PDMA must close the packet when the channel is in packet mode. 3191 + * For TR mode when the channel is not cyclic we also need PDMA 3192 + * to close the packet otherwise the transfer will stall because 3193 + * PDMA holds on the data it has received from the peripheral. 3194 + */ 3195 3195 unsigned int div = dev_width * elcnt; 3196 3196 3197 3197 if (uc->cyclic) 3198 3198 d->static_tr.bstcnt = d->residue / d->sglen / div; 3199 3199 else 3200 3200 d->static_tr.bstcnt = d->residue / div; 3201 + } else if (uc->ud->match_data->type == DMA_TYPE_BCDMA && 3202 + uc->config.dir == DMA_DEV_TO_MEM && 3203 + uc->cyclic) { 3204 + /* 3205 + * For cyclic mode with BCDMA we have to set EOP in each TR to 3206 + * prevent short packet errors seen on channel teardown. So the 3207 + * PDMA must close the packet after every TR transfer by setting 3208 + * burst count equal to the number of bytes transferred. 3209 + */ 3210 + struct cppi5_tr_type1_t *tr_req = d->hwdesc[0].tr_req_base; 3201 3211 3202 - if (uc->config.dir == DMA_DEV_TO_MEM && 3203 - d->static_tr.bstcnt > uc->ud->match_data->statictr_z_mask) 3204 - return -EINVAL; 3212 + d->static_tr.bstcnt = 3213 + (tr_req->icnt0 * tr_req->icnt1) / dev_width; 3205 3214 } else { 3206 3215 d->static_tr.bstcnt = 0; 3207 3216 } 3217 + 3218 + if (uc->config.dir == DMA_DEV_TO_MEM && 3219 + d->static_tr.bstcnt > uc->ud->match_data->statictr_z_mask) 3220 + return -EINVAL; 3208 3221 3209 3222 return 0; 3210 3223 } ··· 3463 3450 /* static TR for remote PDMA */ 3464 3451 if (udma_configure_statictr(uc, d, dev_width, burst)) { 3465 3452 dev_err(uc->ud->dev, 3466 - "%s: StaticTR Z is limited to maximum 4095 (%u)\n", 3467 - __func__, d->static_tr.bstcnt); 3453 + "%s: StaticTR Z is limited to maximum %u (%u)\n", 3454 + __func__, uc->ud->match_data->statictr_z_mask, 3455 + d->static_tr.bstcnt); 3468 3456 3469 3457 udma_free_hwdesc(uc, d); 3470 3458 kfree(d); ··· 3490 3476 u16 tr0_cnt0, tr0_cnt1, tr1_cnt0; 3491 3477 unsigned int i; 3492 3478 int num_tr; 3479 + u32 period_csf = 0; 3493 3480 3494 3481 num_tr = udma_get_tr_counters(period_len, __ffs(buf_addr), &tr0_cnt0, 3495 3482 &tr0_cnt1, &tr1_cnt0); ··· 3512 3497 else 3513 3498 period_addr = buf_addr | 3514 3499 ((u64)uc->config.asel << K3_ADDRESS_ASEL_SHIFT); 3500 + 3501 + /* 3502 + * For BCDMA <-> PDMA transfers, the EOP flag needs to be set on the 3503 + * last TR of a descriptor, to mark the packet as complete. 3504 + * This is required for getting the teardown completion message in case 3505 + * of TX, and to avoid short-packet error in case of RX. 3506 + * 3507 + * As we are in cyclic mode, we do not know which period might be the 3508 + * last one, so set the flag for each period. 3509 + */ 3510 + if (uc->config.ep_type == PSIL_EP_PDMA_XY && 3511 + uc->ud->match_data->type == DMA_TYPE_BCDMA) { 3512 + period_csf = CPPI5_TR_CSF_EOP; 3513 + } 3515 3514 3516 3515 for (i = 0; i < periods; i++) { 3517 3516 int tr_idx = i * num_tr; ··· 3554 3525 } 3555 3526 3556 3527 if (!(flags & DMA_PREP_INTERRUPT)) 3557 - cppi5_tr_csf_set(&tr_req[tr_idx].flags, 3558 - CPPI5_TR_CSF_SUPR_EVT); 3528 + period_csf |= CPPI5_TR_CSF_SUPR_EVT; 3529 + 3530 + if (period_csf) 3531 + cppi5_tr_csf_set(&tr_req[tr_idx].flags, period_csf); 3559 3532 3560 3533 period_addr += period_len; 3561 3534 } ··· 3686 3655 /* static TR for remote PDMA */ 3687 3656 if (udma_configure_statictr(uc, d, dev_width, burst)) { 3688 3657 dev_err(uc->ud->dev, 3689 - "%s: StaticTR Z is limited to maximum 4095 (%u)\n", 3690 - __func__, d->static_tr.bstcnt); 3658 + "%s: StaticTR Z is limited to maximum %u (%u)\n", 3659 + __func__, uc->ud->match_data->statictr_z_mask, 3660 + d->static_tr.bstcnt); 3691 3661 3692 3662 udma_free_hwdesc(uc, d); 3693 3663 kfree(d);
+5 -3
drivers/edac/qcom_edac.c
··· 342 342 int ecc_irq; 343 343 int rc; 344 344 345 - rc = qcom_llcc_core_setup(llcc_driv_data, llcc_driv_data->bcast_regmap); 346 - if (rc) 347 - return rc; 345 + if (!llcc_driv_data->ecc_irq_configured) { 346 + rc = qcom_llcc_core_setup(llcc_driv_data, llcc_driv_data->bcast_regmap); 347 + if (rc) 348 + return rc; 349 + } 348 350 349 351 /* Allocate edac control info */ 350 352 edev_ctl = edac_device_alloc_ctl_info(0, "qcom-llcc", 1, "bank",
+4 -3
drivers/firmware/arm_scmi/bus.c
··· 325 325 326 326 static void scmi_device_release(struct device *dev) 327 327 { 328 - kfree(to_scmi_dev(dev)); 328 + struct scmi_device *scmi_dev = to_scmi_dev(dev); 329 + 330 + kfree_const(scmi_dev->name); 331 + kfree(scmi_dev); 329 332 } 330 333 331 334 static void __scmi_device_destroy(struct scmi_device *scmi_dev) ··· 341 338 if (scmi_dev->protocol_id == SCMI_PROTOCOL_SYSTEM) 342 339 atomic_set(&scmi_syspower_registered, 0); 343 340 344 - kfree_const(scmi_dev->name); 345 341 ida_free(&scmi_bus_id, scmi_dev->id); 346 342 device_unregister(&scmi_dev->dev); 347 343 } ··· 412 410 413 411 return scmi_dev; 414 412 put_dev: 415 - kfree_const(scmi_dev->name); 416 413 put_device(&scmi_dev->dev); 417 414 ida_free(&scmi_bus_id, id); 418 415 return NULL;
+2
drivers/firmware/arm_scmi/common.h
··· 163 163 * used to initialize this channel 164 164 * @dev: Reference to device in the SCMI hierarchy corresponding to this 165 165 * channel 166 + * @is_p2a: A flag to identify a channel as P2A (RX) 166 167 * @rx_timeout_ms: The configured RX timeout in milliseconds. 167 168 * @handle: Pointer to SCMI entity handle 168 169 * @no_completion_irq: Flag to indicate that this channel has no completion ··· 175 174 struct scmi_chan_info { 176 175 int id; 177 176 struct device *dev; 177 + bool is_p2a; 178 178 unsigned int rx_timeout_ms; 179 179 struct scmi_handle *handle; 180 180 bool no_completion_irq;
+8 -2
drivers/firmware/arm_scmi/driver.c
··· 1048 1048 static inline void scmi_clear_channel(struct scmi_info *info, 1049 1049 struct scmi_chan_info *cinfo) 1050 1050 { 1051 + if (!cinfo->is_p2a) { 1052 + dev_warn(cinfo->dev, "Invalid clear on A2P channel !\n"); 1053 + return; 1054 + } 1055 + 1051 1056 if (info->desc->ops->clear_channel) 1052 1057 info->desc->ops->clear_channel(cinfo); 1053 1058 } ··· 2643 2638 if (!cinfo) 2644 2639 return -ENOMEM; 2645 2640 2641 + cinfo->is_p2a = !tx; 2646 2642 cinfo->rx_timeout_ms = info->desc->max_rx_timeout_ms; 2647 2643 2648 2644 /* Create a unique name for this transport device */ ··· 3048 3042 3049 3043 dev_info(dev, "Using %s\n", dev_driver_string(trans->supplier)); 3050 3044 3051 - ret = of_property_read_u32(dev->of_node, "max-rx-timeout-ms", 3045 + ret = of_property_read_u32(dev->of_node, "arm,max-rx-timeout-ms", 3052 3046 &trans->desc->max_rx_timeout_ms); 3053 3047 if (ret && ret != -EINVAL) 3054 - dev_err(dev, "Malformed max-rx-timeout-ms DT property.\n"); 3048 + dev_err(dev, "Malformed arm,max-rx-timeout-ms DT property.\n"); 3055 3049 3056 3050 dev_info(dev, "SCMI max-rx-timeout: %dms\n", 3057 3051 trans->desc->max_rx_timeout_ms);
+1 -1
drivers/firmware/arm_sdei.c
··· 763 763 int err; 764 764 765 765 /* unregister private events */ 766 - cpuhp_remove_state(sdei_entry_point); 766 + cpuhp_remove_state(sdei_hp_state); 767 767 768 768 err = sdei_unregister_shared(); 769 769 if (err)
+7 -35
drivers/firmware/microchip/mpfs-auto-update.c
··· 76 76 #define AUTO_UPDATE_INFO_SIZE SZ_1M 77 77 #define AUTO_UPDATE_BITSTREAM_BASE (AUTO_UPDATE_DIRECTORY_SIZE + AUTO_UPDATE_INFO_SIZE) 78 78 79 - #define AUTO_UPDATE_TIMEOUT_MS 60000 80 - 81 79 struct mpfs_auto_update_priv { 82 80 struct mpfs_sys_controller *sys_controller; 83 81 struct device *dev; 84 82 struct mtd_info *flash; 85 83 struct fw_upload *fw_uploader; 86 - struct completion programming_complete; 87 84 size_t size_per_bitstream; 88 85 bool cancel_request; 89 86 }; ··· 153 156 154 157 static enum fw_upload_err mpfs_auto_update_poll_complete(struct fw_upload *fw_uploader) 155 158 { 156 - struct mpfs_auto_update_priv *priv = fw_uploader->dd_handle; 157 - int ret; 158 - 159 - /* 160 - * There is no meaningful way to get the status of the programming while 161 - * it is in progress, so attempting anything other than waiting for it 162 - * to complete would be misplaced. 163 - */ 164 - ret = wait_for_completion_timeout(&priv->programming_complete, 165 - msecs_to_jiffies(AUTO_UPDATE_TIMEOUT_MS)); 166 - if (!ret) 167 - return FW_UPLOAD_ERR_TIMEOUT; 168 - 169 159 return FW_UPLOAD_ERR_NONE; 170 160 } 171 161 ··· 333 349 u32 offset, u32 size, u32 *written) 334 350 { 335 351 struct mpfs_auto_update_priv *priv = fw_uploader->dd_handle; 336 - enum fw_upload_err err = FW_UPLOAD_ERR_NONE; 337 352 int ret; 338 353 339 - reinit_completion(&priv->programming_complete); 340 - 341 354 ret = mpfs_auto_update_write_bitstream(fw_uploader, data, offset, size, written); 342 - if (ret) { 343 - err = FW_UPLOAD_ERR_RW_ERROR; 344 - goto out; 345 - } 355 + if (ret) 356 + return FW_UPLOAD_ERR_RW_ERROR; 346 357 347 - if (priv->cancel_request) { 348 - err = FW_UPLOAD_ERR_CANCELED; 349 - goto out; 350 - } 358 + if (priv->cancel_request) 359 + return FW_UPLOAD_ERR_CANCELED; 351 360 352 361 if (mpfs_auto_update_is_bitstream_info(data, size)) 353 - goto out; 362 + return FW_UPLOAD_ERR_NONE; 354 363 355 364 ret = mpfs_auto_update_verify_image(fw_uploader); 356 365 if (ret) 357 - err = FW_UPLOAD_ERR_FW_INVALID; 366 + return FW_UPLOAD_ERR_FW_INVALID; 358 367 359 - out: 360 - complete(&priv->programming_complete); 361 - 362 - return err; 368 + return FW_UPLOAD_ERR_NONE; 363 369 } 364 370 365 371 static const struct fw_upload_ops mpfs_auto_update_ops = { ··· 434 460 if (ret) 435 461 return dev_err_probe(dev, ret, 436 462 "The current bitstream does not support auto-update\n"); 437 - 438 - init_completion(&priv->programming_complete); 439 463 440 464 fw_uploader = firmware_upload_register(THIS_MODULE, dev, "mpfs-auto-update", 441 465 &mpfs_auto_update_ops, priv);
+14 -3
drivers/firmware/qcom/qcom_scm.c
··· 112 112 }; 113 113 114 114 #define QSEECOM_MAX_APP_NAME_SIZE 64 115 + #define SHMBRIDGE_RESULT_NOTSUPP 4 115 116 116 117 /* Each bit configures cold/warm boot address for one of the 4 CPUs */ 117 118 static const u8 qcom_scm_cpu_cold_bits[QCOM_SCM_BOOT_MAX_CPUS] = { ··· 217 216 218 217 struct qcom_tzmem_pool *qcom_scm_get_tzmem_pool(void) 219 218 { 220 - return __scm->mempool; 219 + return __scm ? __scm->mempool : NULL; 221 220 } 222 221 223 222 static enum qcom_scm_convention __get_convention(void) ··· 546 545 } else if (__qcom_scm_is_call_available(__scm->dev, QCOM_SCM_SVC_BOOT, 547 546 QCOM_SCM_BOOT_SET_DLOAD_MODE)) { 548 547 ret = __qcom_scm_set_dload_mode(__scm->dev, !!dload_mode); 549 - } else { 548 + } else if (dload_mode) { 550 549 dev_err(__scm->dev, 551 550 "No available mechanism for setting download mode\n"); 552 551 } ··· 1362 1361 1363 1362 int qcom_scm_shm_bridge_enable(void) 1364 1363 { 1364 + int ret; 1365 + 1365 1366 struct qcom_scm_desc desc = { 1366 1367 .svc = QCOM_SCM_SVC_MP, 1367 1368 .cmd = QCOM_SCM_MP_SHM_BRIDGE_ENABLE, ··· 1376 1373 QCOM_SCM_MP_SHM_BRIDGE_ENABLE)) 1377 1374 return -EOPNOTSUPP; 1378 1375 1379 - return qcom_scm_call(__scm->dev, &desc, &res) ?: res.result[0]; 1376 + ret = qcom_scm_call(__scm->dev, &desc, &res); 1377 + 1378 + if (ret) 1379 + return ret; 1380 + 1381 + if (res.result[0] == SHMBRIDGE_RESULT_NOTSUPP) 1382 + return -EOPNOTSUPP; 1383 + 1384 + return res.result[0]; 1380 1385 } 1381 1386 EXPORT_SYMBOL_GPL(qcom_scm_shm_bridge_enable); 1382 1387
+3 -1
drivers/gpio/gpio-sloppy-logic-analyzer.c
··· 234 234 if (!priv) 235 235 return -ENOMEM; 236 236 237 - devm_mutex_init(dev, &priv->blob_lock); 237 + ret = devm_mutex_init(dev, &priv->blob_lock); 238 + if (ret) 239 + return ret; 238 240 239 241 fops_buf_size_set(priv, GPIO_LA_DEFAULT_BUF_SIZE); 240 242
+1 -1
drivers/gpio/gpiolib-swnode.c
··· 64 64 struct fwnode_reference_args args; 65 65 struct gpio_desc *desc; 66 66 char propname[32]; /* 32 is max size of property name */ 67 - int ret; 67 + int ret = 0; 68 68 69 69 swnode = to_software_node(fwnode); 70 70 if (!swnode)
+3 -1
drivers/gpio/gpiolib.c
··· 4926 4926 return NULL; 4927 4927 4928 4928 s->private = priv; 4929 + if (*pos > 0) 4930 + priv->newline = true; 4929 4931 priv->idx = srcu_read_lock(&gpio_devices_srcu); 4930 4932 4931 4933 list_for_each_entry_srcu(gdev, &gpio_devices, list, ··· 4971 4969 4972 4970 gc = srcu_dereference(gdev->chip, &gdev->srcu); 4973 4971 if (!gc) { 4974 - seq_printf(s, "%s%s: (dangling chip)", 4972 + seq_printf(s, "%s%s: (dangling chip)\n", 4975 4973 priv->newline ? "\n" : "", 4976 4974 dev_name(&gdev->dev)); 4977 4975 return 0;
+1
drivers/gpu/drm/amd/display/dc/dml2/dml2_policy.c
··· 303 303 if (project == dml_project_dcn35 || 304 304 project == dml_project_dcn351) { 305 305 policy->DCCProgrammingAssumesScanDirectionUnknownFinal = false; 306 + policy->EnhancedPrefetchScheduleAccelerationFinal = 0; 306 307 policy->AllowForPStateChangeOrStutterInVBlankFinal = dml_prefetch_support_uclk_fclk_and_stutter_if_possible; /*new*/ 307 308 policy->UseOnlyMaxPrefetchModes = 1; 308 309 }
+3 -1
drivers/gpu/drm/amd/pm/swsmu/smu11/vangogh_ppt.c
··· 242 242 goto err0_out; 243 243 smu_table->metrics_time = 0; 244 244 245 - smu_table->gpu_metrics_table_size = max(sizeof(struct gpu_metrics_v2_3), sizeof(struct gpu_metrics_v2_2)); 245 + smu_table->gpu_metrics_table_size = sizeof(struct gpu_metrics_v2_2); 246 + smu_table->gpu_metrics_table_size = max(smu_table->gpu_metrics_table_size, sizeof(struct gpu_metrics_v2_3)); 247 + smu_table->gpu_metrics_table_size = max(smu_table->gpu_metrics_table_size, sizeof(struct gpu_metrics_v2_4)); 246 248 smu_table->gpu_metrics_table = kzalloc(smu_table->gpu_metrics_table_size, GFP_KERNEL); 247 249 if (!smu_table->gpu_metrics_table) 248 250 goto err1_out;
+3 -3
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c
··· 2485 2485 DpmActivityMonitorCoeffInt_t *activity_monitor = 2486 2486 &(activity_monitor_external.DpmActivityMonitorCoeffInt); 2487 2487 int workload_type, ret = 0; 2488 - u32 workload_mask; 2488 + u32 workload_mask, selected_workload_mask; 2489 2489 2490 2490 smu->power_profile_mode = input[size]; 2491 2491 ··· 2552 2552 if (workload_type < 0) 2553 2553 return -EINVAL; 2554 2554 2555 - workload_mask = 1 << workload_type; 2555 + selected_workload_mask = workload_mask = 1 << workload_type; 2556 2556 2557 2557 /* Add optimizations for SMU13.0.0/10. Reuse the power saving profile */ 2558 2558 if ((amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(13, 0, 0) && ··· 2572 2572 workload_mask, 2573 2573 NULL); 2574 2574 if (!ret) 2575 - smu->workload_mask = workload_mask; 2575 + smu->workload_mask = selected_workload_mask; 2576 2576 2577 2577 return ret; 2578 2578 }
+2 -2
drivers/gpu/drm/mediatek/mtk_crtc.c
··· 127 127 128 128 mtk_mutex_put(mtk_crtc->mutex); 129 129 #if IS_REACHABLE(CONFIG_MTK_CMDQ) 130 - cmdq_pkt_destroy(&mtk_crtc->cmdq_client, &mtk_crtc->cmdq_handle); 131 - 132 130 if (mtk_crtc->cmdq_client.chan) { 131 + cmdq_pkt_destroy(&mtk_crtc->cmdq_client, &mtk_crtc->cmdq_handle); 133 132 mbox_free_channel(mtk_crtc->cmdq_client.chan); 134 133 mtk_crtc->cmdq_client.chan = NULL; 135 134 } ··· 912 913 BIT(pipe), 913 914 mtk_crtc_plane_type(mtk_crtc->layer_nr, num_planes), 914 915 mtk_ddp_comp_supported_rotations(comp), 916 + mtk_ddp_comp_get_blend_modes(comp), 915 917 mtk_ddp_comp_get_formats(comp), 916 918 mtk_ddp_comp_get_num_formats(comp), i); 917 919 if (ret)
+2
drivers/gpu/drm/mediatek/mtk_ddp_comp.c
··· 363 363 .layer_config = mtk_ovl_layer_config, 364 364 .bgclr_in_on = mtk_ovl_bgclr_in_on, 365 365 .bgclr_in_off = mtk_ovl_bgclr_in_off, 366 + .get_blend_modes = mtk_ovl_get_blend_modes, 366 367 .get_formats = mtk_ovl_get_formats, 367 368 .get_num_formats = mtk_ovl_get_num_formats, 368 369 }; ··· 417 416 .disconnect = mtk_ovl_adaptor_disconnect, 418 417 .add = mtk_ovl_adaptor_add_comp, 419 418 .remove = mtk_ovl_adaptor_remove_comp, 419 + .get_blend_modes = mtk_ovl_adaptor_get_blend_modes, 420 420 .get_formats = mtk_ovl_adaptor_get_formats, 421 421 .get_num_formats = mtk_ovl_adaptor_get_num_formats, 422 422 .mode_valid = mtk_ovl_adaptor_mode_valid,
+10
drivers/gpu/drm/mediatek/mtk_ddp_comp.h
··· 80 80 void (*ctm_set)(struct device *dev, 81 81 struct drm_crtc_state *state); 82 82 struct device * (*dma_dev_get)(struct device *dev); 83 + u32 (*get_blend_modes)(struct device *dev); 83 84 const u32 *(*get_formats)(struct device *dev); 84 85 size_t (*get_num_formats)(struct device *dev); 85 86 void (*connect)(struct device *dev, struct device *mmsys_dev, unsigned int next); ··· 265 264 if (comp->funcs && comp->funcs->dma_dev_get) 266 265 return comp->funcs->dma_dev_get(comp->dev); 267 266 return comp->dev; 267 + } 268 + 269 + static inline 270 + u32 mtk_ddp_comp_get_blend_modes(struct mtk_ddp_comp *comp) 271 + { 272 + if (comp->funcs && comp->funcs->get_blend_modes) 273 + return comp->funcs->get_blend_modes(comp->dev); 274 + 275 + return 0; 268 276 } 269 277 270 278 static inline
+2
drivers/gpu/drm/mediatek/mtk_disp_drv.h
··· 103 103 void mtk_ovl_unregister_vblank_cb(struct device *dev); 104 104 void mtk_ovl_enable_vblank(struct device *dev); 105 105 void mtk_ovl_disable_vblank(struct device *dev); 106 + u32 mtk_ovl_get_blend_modes(struct device *dev); 106 107 const u32 *mtk_ovl_get_formats(struct device *dev); 107 108 size_t mtk_ovl_get_num_formats(struct device *dev); 108 109 ··· 132 131 void mtk_ovl_adaptor_stop(struct device *dev); 133 132 unsigned int mtk_ovl_adaptor_layer_nr(struct device *dev); 134 133 struct device *mtk_ovl_adaptor_dma_dev_get(struct device *dev); 134 + u32 mtk_ovl_adaptor_get_blend_modes(struct device *dev); 135 135 const u32 *mtk_ovl_adaptor_get_formats(struct device *dev); 136 136 size_t mtk_ovl_adaptor_get_num_formats(struct device *dev); 137 137 enum drm_mode_status mtk_ovl_adaptor_mode_valid(struct device *dev,
+55 -19
drivers/gpu/drm/mediatek/mtk_disp_ovl.c
··· 65 65 #define OVL_CON_CLRFMT_RGB (1 << 12) 66 66 #define OVL_CON_CLRFMT_ARGB8888 (2 << 12) 67 67 #define OVL_CON_CLRFMT_RGBA8888 (3 << 12) 68 - #define OVL_CON_CLRFMT_ABGR8888 (OVL_CON_CLRFMT_RGBA8888 | OVL_CON_BYTE_SWAP) 69 - #define OVL_CON_CLRFMT_BGRA8888 (OVL_CON_CLRFMT_ARGB8888 | OVL_CON_BYTE_SWAP) 68 + #define OVL_CON_CLRFMT_ABGR8888 (OVL_CON_CLRFMT_ARGB8888 | OVL_CON_BYTE_SWAP) 69 + #define OVL_CON_CLRFMT_BGRA8888 (OVL_CON_CLRFMT_RGBA8888 | OVL_CON_BYTE_SWAP) 70 70 #define OVL_CON_CLRFMT_UYVY (4 << 12) 71 71 #define OVL_CON_CLRFMT_YUYV (5 << 12) 72 72 #define OVL_CON_MTX_YUV_TO_RGB (6 << 16) ··· 146 146 bool fmt_rgb565_is_0; 147 147 bool smi_id_en; 148 148 bool supports_afbc; 149 + const u32 blend_modes; 149 150 const u32 *formats; 150 151 size_t num_formats; 151 152 bool supports_clrfmt_ext; ··· 213 212 struct mtk_disp_ovl *ovl = dev_get_drvdata(dev); 214 213 215 214 writel_relaxed(0x0, ovl->regs + DISP_REG_OVL_INTEN); 215 + } 216 + 217 + u32 mtk_ovl_get_blend_modes(struct device *dev) 218 + { 219 + struct mtk_disp_ovl *ovl = dev_get_drvdata(dev); 220 + 221 + return ovl->data->blend_modes; 216 222 } 217 223 218 224 const u32 *mtk_ovl_get_formats(struct device *dev) ··· 394 386 DISP_REG_OVL_RDMA_CTRL(idx)); 395 387 } 396 388 397 - static unsigned int ovl_fmt_convert(struct mtk_disp_ovl *ovl, unsigned int fmt, 398 - unsigned int blend_mode) 389 + static unsigned int mtk_ovl_fmt_convert(struct mtk_disp_ovl *ovl, 390 + struct mtk_plane_state *state) 399 391 { 400 - /* The return value in switch "MEM_MODE_INPUT_FORMAT_XXX" 401 - * is defined in mediatek HW data sheet. 402 - * The alphabet order in XXX is no relation to data 403 - * arrangement in memory. 392 + unsigned int fmt = state->pending.format; 393 + unsigned int blend_mode = DRM_MODE_BLEND_COVERAGE; 394 + 395 + /* 396 + * For the platforms where OVL_CON_CLRFMT_MAN is defined in the hardware data sheet 397 + * and supports premultiplied color formats, such as OVL_CON_CLRFMT_PARGB8888. 398 + * 399 + * Check blend_modes in the driver data to see if premultiplied mode is supported. 400 + * If not, use coverage mode instead to set it to the supported color formats. 401 + * 402 + * Current DRM assumption is that alpha is default premultiplied, so the bitmask of 403 + * blend_modes must include BIT(DRM_MODE_BLEND_PREMULTI). Otherwise, mtk_plane_init() 404 + * will get an error return from drm_plane_create_blend_mode_property() and 405 + * state->base.pixel_blend_mode should not be used. 404 406 */ 407 + if (ovl->data->blend_modes & BIT(DRM_MODE_BLEND_PREMULTI)) 408 + blend_mode = state->base.pixel_blend_mode; 409 + 405 410 switch (fmt) { 406 411 default: 407 412 case DRM_FORMAT_RGB565: ··· 492 471 return; 493 472 } 494 473 495 - con = ovl_fmt_convert(ovl, fmt, blend_mode); 474 + con = mtk_ovl_fmt_convert(ovl, state); 496 475 if (state->base.fb) { 497 - con |= OVL_CON_AEN; 498 476 con |= state->base.alpha & OVL_CON_ALPHA; 499 - } 500 477 501 - /* CONST_BLD must be enabled for XRGB formats although the alpha channel 502 - * can be ignored, or OVL will still read the value from memory. 503 - * For RGB888 related formats, whether CONST_BLD is enabled or not won't 504 - * affect the result. Therefore we use !has_alpha as the condition. 505 - */ 506 - if ((state->base.fb && !state->base.fb->format->has_alpha) || 507 - blend_mode == DRM_MODE_BLEND_PIXEL_NONE) 508 - ignore_pixel_alpha = OVL_CONST_BLEND; 478 + /* 479 + * For blend_modes supported SoCs, always enable alpha blending. 480 + * For blend_modes unsupported SoCs, enable alpha blending when has_alpha is set. 481 + */ 482 + if (blend_mode || state->base.fb->format->has_alpha) 483 + con |= OVL_CON_AEN; 484 + 485 + /* 486 + * Although the alpha channel can be ignored, CONST_BLD must be enabled 487 + * for XRGB format, otherwise OVL will still read the value from memory. 488 + * For RGB888 related formats, whether CONST_BLD is enabled or not won't 489 + * affect the result. Therefore we use !has_alpha as the condition. 490 + */ 491 + if (blend_mode == DRM_MODE_BLEND_PIXEL_NONE || !state->base.fb->format->has_alpha) 492 + ignore_pixel_alpha = OVL_CONST_BLEND; 493 + } 509 494 510 495 if (pending->rotation & DRM_MODE_REFLECT_Y) { 511 496 con |= OVL_CON_VIRT_FLIP; ··· 690 663 .layer_nr = 4, 691 664 .fmt_rgb565_is_0 = true, 692 665 .smi_id_en = true, 666 + .blend_modes = BIT(DRM_MODE_BLEND_PREMULTI) | 667 + BIT(DRM_MODE_BLEND_COVERAGE) | 668 + BIT(DRM_MODE_BLEND_PIXEL_NONE), 693 669 .formats = mt8173_formats, 694 670 .num_formats = ARRAY_SIZE(mt8173_formats), 695 671 }; ··· 703 673 .layer_nr = 2, 704 674 .fmt_rgb565_is_0 = true, 705 675 .smi_id_en = true, 676 + .blend_modes = BIT(DRM_MODE_BLEND_PREMULTI) | 677 + BIT(DRM_MODE_BLEND_COVERAGE) | 678 + BIT(DRM_MODE_BLEND_PIXEL_NONE), 706 679 .formats = mt8173_formats, 707 680 .num_formats = ARRAY_SIZE(mt8173_formats), 708 681 }; ··· 717 684 .fmt_rgb565_is_0 = true, 718 685 .smi_id_en = true, 719 686 .supports_afbc = true, 687 + .blend_modes = BIT(DRM_MODE_BLEND_PREMULTI) | 688 + BIT(DRM_MODE_BLEND_COVERAGE) | 689 + BIT(DRM_MODE_BLEND_PIXEL_NONE), 720 690 .formats = mt8195_formats, 721 691 .num_formats = ARRAY_SIZE(mt8195_formats), 722 692 .supports_clrfmt_ext = true,
+7
drivers/gpu/drm/mediatek/mtk_disp_ovl_adaptor.c
··· 400 400 mtk_ethdr_disable_vblank(ovl_adaptor->ovl_adaptor_comp[OVL_ADAPTOR_ETHDR0]); 401 401 } 402 402 403 + u32 mtk_ovl_adaptor_get_blend_modes(struct device *dev) 404 + { 405 + struct mtk_disp_ovl_adaptor *ovl_adaptor = dev_get_drvdata(dev); 406 + 407 + return mtk_ethdr_get_blend_modes(ovl_adaptor->ovl_adaptor_comp[OVL_ADAPTOR_ETHDR0]); 408 + } 409 + 403 410 const u32 *mtk_ovl_adaptor_get_formats(struct device *dev) 404 411 { 405 412 struct mtk_disp_ovl_adaptor *ovl_adaptor = dev_get_drvdata(dev);
+84 -1
drivers/gpu/drm/mediatek/mtk_dp.c
··· 145 145 u16 audio_m_div2_bit; 146 146 }; 147 147 148 + static const struct mtk_dp_efuse_fmt mt8188_dp_efuse_fmt[MTK_DP_CAL_MAX] = { 149 + [MTK_DP_CAL_GLB_BIAS_TRIM] = { 150 + .idx = 0, 151 + .shift = 10, 152 + .mask = 0x1f, 153 + .min_val = 1, 154 + .max_val = 0x1e, 155 + .default_val = 0xf, 156 + }, 157 + [MTK_DP_CAL_CLKTX_IMPSE] = { 158 + .idx = 0, 159 + .shift = 15, 160 + .mask = 0xf, 161 + .min_val = 1, 162 + .max_val = 0xe, 163 + .default_val = 0x8, 164 + }, 165 + [MTK_DP_CAL_LN_TX_IMPSEL_PMOS_0] = { 166 + .idx = 1, 167 + .shift = 0, 168 + .mask = 0xf, 169 + .min_val = 1, 170 + .max_val = 0xe, 171 + .default_val = 0x8, 172 + }, 173 + [MTK_DP_CAL_LN_TX_IMPSEL_PMOS_1] = { 174 + .idx = 1, 175 + .shift = 8, 176 + .mask = 0xf, 177 + .min_val = 1, 178 + .max_val = 0xe, 179 + .default_val = 0x8, 180 + }, 181 + [MTK_DP_CAL_LN_TX_IMPSEL_PMOS_2] = { 182 + .idx = 1, 183 + .shift = 16, 184 + .mask = 0xf, 185 + .min_val = 1, 186 + .max_val = 0xe, 187 + .default_val = 0x8, 188 + }, 189 + [MTK_DP_CAL_LN_TX_IMPSEL_PMOS_3] = { 190 + .idx = 1, 191 + .shift = 24, 192 + .mask = 0xf, 193 + .min_val = 1, 194 + .max_val = 0xe, 195 + .default_val = 0x8, 196 + }, 197 + [MTK_DP_CAL_LN_TX_IMPSEL_NMOS_0] = { 198 + .idx = 1, 199 + .shift = 4, 200 + .mask = 0xf, 201 + .min_val = 1, 202 + .max_val = 0xe, 203 + .default_val = 0x8, 204 + }, 205 + [MTK_DP_CAL_LN_TX_IMPSEL_NMOS_1] = { 206 + .idx = 1, 207 + .shift = 12, 208 + .mask = 0xf, 209 + .min_val = 1, 210 + .max_val = 0xe, 211 + .default_val = 0x8, 212 + }, 213 + [MTK_DP_CAL_LN_TX_IMPSEL_NMOS_2] = { 214 + .idx = 1, 215 + .shift = 20, 216 + .mask = 0xf, 217 + .min_val = 1, 218 + .max_val = 0xe, 219 + .default_val = 0x8, 220 + }, 221 + [MTK_DP_CAL_LN_TX_IMPSEL_NMOS_3] = { 222 + .idx = 1, 223 + .shift = 28, 224 + .mask = 0xf, 225 + .min_val = 1, 226 + .max_val = 0xe, 227 + .default_val = 0x8, 228 + }, 229 + }; 230 + 148 231 static const struct mtk_dp_efuse_fmt mt8195_edp_efuse_fmt[MTK_DP_CAL_MAX] = { 149 232 [MTK_DP_CAL_GLB_BIAS_TRIM] = { 150 233 .idx = 3, ··· 2854 2771 static const struct mtk_dp_data mt8188_dp_data = { 2855 2772 .bridge_type = DRM_MODE_CONNECTOR_DisplayPort, 2856 2773 .smc_cmd = MTK_DP_SIP_ATF_VIDEO_UNMUTE, 2857 - .efuse_fmt = mt8195_dp_efuse_fmt, 2774 + .efuse_fmt = mt8188_dp_efuse_fmt, 2858 2775 .audio_supported = true, 2859 2776 .audio_pkt_in_hblank_area = true, 2860 2777 .audio_m_div2_bit = MT8188_AUDIO_M_CODE_MULT_DIV_SEL_DP_ENC0_P0_DIV_2,
+7
drivers/gpu/drm/mediatek/mtk_ethdr.c
··· 145 145 return IRQ_HANDLED; 146 146 } 147 147 148 + u32 mtk_ethdr_get_blend_modes(struct device *dev) 149 + { 150 + return BIT(DRM_MODE_BLEND_PREMULTI) | 151 + BIT(DRM_MODE_BLEND_COVERAGE) | 152 + BIT(DRM_MODE_BLEND_PIXEL_NONE); 153 + } 154 + 148 155 void mtk_ethdr_layer_config(struct device *dev, unsigned int idx, 149 156 struct mtk_plane_state *state, 150 157 struct cmdq_pkt *cmdq_pkt)
+1
drivers/gpu/drm/mediatek/mtk_ethdr.h
··· 13 13 void mtk_ethdr_config(struct device *dev, unsigned int w, 14 14 unsigned int h, unsigned int vrefresh, 15 15 unsigned int bpc, struct cmdq_pkt *cmdq_pkt); 16 + u32 mtk_ethdr_get_blend_modes(struct device *dev); 16 17 void mtk_ethdr_layer_config(struct device *dev, unsigned int idx, 17 18 struct mtk_plane_state *state, 18 19 struct cmdq_pkt *cmdq_pkt);
+7 -8
drivers/gpu/drm/mediatek/mtk_plane.c
··· 320 320 321 321 int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane, 322 322 unsigned long possible_crtcs, enum drm_plane_type type, 323 - unsigned int supported_rotations, const u32 *formats, 324 - size_t num_formats, unsigned int plane_idx) 323 + unsigned int supported_rotations, const u32 blend_modes, 324 + const u32 *formats, size_t num_formats, unsigned int plane_idx) 325 325 { 326 326 int err; 327 327 ··· 366 366 if (err) 367 367 DRM_ERROR("failed to create property: alpha\n"); 368 368 369 - err = drm_plane_create_blend_mode_property(plane, 370 - BIT(DRM_MODE_BLEND_PREMULTI) | 371 - BIT(DRM_MODE_BLEND_COVERAGE) | 372 - BIT(DRM_MODE_BLEND_PIXEL_NONE)); 373 - if (err) 374 - DRM_ERROR("failed to create property: blend_mode\n"); 369 + if (blend_modes) { 370 + err = drm_plane_create_blend_mode_property(plane, blend_modes); 371 + if (err) 372 + DRM_ERROR("failed to create property: blend_mode\n"); 373 + } 375 374 376 375 drm_plane_helper_add(plane, &mtk_plane_helper_funcs); 377 376
+2 -2
drivers/gpu/drm/mediatek/mtk_plane.h
··· 48 48 49 49 int mtk_plane_init(struct drm_device *dev, struct drm_plane *plane, 50 50 unsigned long possible_crtcs, enum drm_plane_type type, 51 - unsigned int supported_rotations, const u32 *formats, 52 - size_t num_formats, unsigned int plane_idx); 51 + unsigned int supported_rotations, const u32 blend_modes, 52 + const u32 *formats, size_t num_formats, unsigned int plane_idx); 53 53 #endif
+2 -2
drivers/gpu/drm/panthor/panthor_fw.c
··· 487 487 struct panthor_fw_binary_iter *iter, 488 488 u32 ehdr) 489 489 { 490 + ssize_t vm_pgsz = panthor_vm_page_size(ptdev->fw->vm); 490 491 struct panthor_fw_binary_section_entry_hdr hdr; 491 492 struct panthor_fw_section *section; 492 493 u32 section_size; ··· 516 515 return -EINVAL; 517 516 } 518 517 519 - if ((hdr.va.start & ~PAGE_MASK) != 0 || 520 - (hdr.va.end & ~PAGE_MASK) != 0) { 518 + if (!IS_ALIGNED(hdr.va.start, vm_pgsz) || !IS_ALIGNED(hdr.va.end, vm_pgsz)) { 521 519 drm_err(&ptdev->base, "Firmware corrupted, virtual addresses not page aligned: 0x%x-0x%x\n", 522 520 hdr.va.start, hdr.va.end); 523 521 return -EINVAL;
+8 -3
drivers/gpu/drm/panthor/panthor_gem.c
··· 44 44 to_panthor_bo(bo->obj)->exclusive_vm_root_gem != panthor_vm_root_gem(vm))) 45 45 goto out_free_bo; 46 46 47 - ret = panthor_vm_unmap_range(vm, bo->va_node.start, 48 - panthor_kernel_bo_size(bo)); 47 + ret = panthor_vm_unmap_range(vm, bo->va_node.start, bo->va_node.size); 49 48 if (ret) 50 49 goto out_free_bo; 51 50 ··· 94 95 } 95 96 96 97 bo = to_panthor_bo(&obj->base); 97 - size = obj->base.size; 98 98 kbo->obj = &obj->base; 99 99 bo->flags = bo_flags; 100 100 101 + /* The system and GPU MMU page size might differ, which becomes a 102 + * problem for FW sections that need to be mapped at explicit address 103 + * since our PAGE_SIZE alignment might cover a VA range that's 104 + * expected to be used for another section. 105 + * Make sure we never map more than we need. 106 + */ 107 + size = ALIGN(size, panthor_vm_page_size(vm)); 101 108 ret = panthor_vm_alloc_va(vm, gpu_va, size, &kbo->va_node); 102 109 if (ret) 103 110 goto err_put_obj;
+13 -3
drivers/gpu/drm/panthor/panthor_mmu.c
··· 826 826 mutex_unlock(&ptdev->mmu->as.slots_lock); 827 827 } 828 828 829 + u32 panthor_vm_page_size(struct panthor_vm *vm) 830 + { 831 + const struct io_pgtable *pgt = io_pgtable_ops_to_pgtable(vm->pgtbl_ops); 832 + u32 pg_shift = ffs(pgt->cfg.pgsize_bitmap) - 1; 833 + 834 + return 1u << pg_shift; 835 + } 836 + 829 837 static void panthor_vm_stop(struct panthor_vm *vm) 830 838 { 831 839 drm_sched_stop(&vm->sched, NULL); ··· 1033 1025 panthor_vm_alloc_va(struct panthor_vm *vm, u64 va, u64 size, 1034 1026 struct drm_mm_node *va_node) 1035 1027 { 1028 + ssize_t vm_pgsz = panthor_vm_page_size(vm); 1036 1029 int ret; 1037 1030 1038 - if (!size || (size & ~PAGE_MASK)) 1031 + if (!size || !IS_ALIGNED(size, vm_pgsz)) 1039 1032 return -EINVAL; 1040 1033 1041 - if (va != PANTHOR_VM_KERNEL_AUTO_VA && (va & ~PAGE_MASK)) 1034 + if (va != PANTHOR_VM_KERNEL_AUTO_VA && !IS_ALIGNED(va, vm_pgsz)) 1042 1035 return -EINVAL; 1043 1036 1044 1037 mutex_lock(&vm->mm_lock); ··· 2375 2366 const struct drm_panthor_vm_bind_op *op, 2376 2367 struct panthor_vm_op_ctx *op_ctx) 2377 2368 { 2369 + ssize_t vm_pgsz = panthor_vm_page_size(vm); 2378 2370 struct drm_gem_object *gem; 2379 2371 int ret; 2380 2372 2381 2373 /* Aligned on page size. */ 2382 - if ((op->va | op->size) & ~PAGE_MASK) 2374 + if (!IS_ALIGNED(op->va | op->size, vm_pgsz)) 2383 2375 return -EINVAL; 2384 2376 2385 2377 switch (op->flags & DRM_PANTHOR_VM_BIND_OP_TYPE_MASK) {
+1
drivers/gpu/drm/panthor/panthor_mmu.h
··· 30 30 31 31 int panthor_vm_active(struct panthor_vm *vm); 32 32 void panthor_vm_idle(struct panthor_vm *vm); 33 + u32 panthor_vm_page_size(struct panthor_vm *vm); 33 34 int panthor_vm_as(struct panthor_vm *vm); 34 35 int panthor_vm_flush_all(struct panthor_vm *vm); 35 36
+16 -4
drivers/gpu/drm/panthor/panthor_sched.c
··· 589 589 * @timedout: True when a timeout occurred on any of the queues owned by 590 590 * this group. 591 591 * 592 - * Timeouts can be reported by drm_sched or by the FW. In any case, any 593 - * timeout situation is unrecoverable, and the group becomes useless. 594 - * We simply wait for all references to be dropped so we can release the 595 - * group object. 592 + * Timeouts can be reported by drm_sched or by the FW. If a reset is required, 593 + * and the group can't be suspended, this also leads to a timeout. In any case, 594 + * any timeout situation is unrecoverable, and the group becomes useless. We 595 + * simply wait for all references to be dropped so we can release the group 596 + * object. 596 597 */ 597 598 bool timedout; 598 599 ··· 2641 2640 csgs_upd_ctx_init(&upd_ctx); 2642 2641 while (slot_mask) { 2643 2642 u32 csg_id = ffs(slot_mask) - 1; 2643 + struct panthor_csg_slot *csg_slot = &sched->csg_slots[csg_id]; 2644 + 2645 + /* We consider group suspension failures as fatal and flag the 2646 + * group as unusable by setting timedout=true. 2647 + */ 2648 + csg_slot->group->timedout = true; 2644 2649 2645 2650 csgs_upd_ctx_queue_reqs(ptdev, &upd_ctx, csg_id, 2646 2651 CSG_STATE_TERMINATE, ··· 3412 3405 3413 3406 job->group = group_from_handle(gpool, group_handle); 3414 3407 if (!job->group) { 3408 + ret = -EINVAL; 3409 + goto err_put_job; 3410 + } 3411 + 3412 + if (!group_can_run(job->group)) { 3415 3413 ret = -EINVAL; 3416 3414 goto err_put_job; 3417 3415 }
+3 -2
drivers/gpu/drm/scheduler/sched_main.c
··· 1276 1276 sched->own_submit_wq = false; 1277 1277 } else { 1278 1278 #ifdef CONFIG_LOCKDEP 1279 - sched->submit_wq = alloc_ordered_workqueue_lockdep_map(name, 0, 1279 + sched->submit_wq = alloc_ordered_workqueue_lockdep_map(name, 1280 + WQ_MEM_RECLAIM, 1280 1281 &drm_sched_lockdep_map); 1281 1282 #else 1282 - sched->submit_wq = alloc_ordered_workqueue(name, 0); 1283 + sched->submit_wq = alloc_ordered_workqueue(name, WQ_MEM_RECLAIM); 1283 1284 #endif 1284 1285 if (!sched->submit_wq) 1285 1286 return -ENOMEM;
+2 -2
drivers/gpu/drm/tegra/drm.c
··· 1153 1153 1154 1154 if (host1x_drm_wants_iommu(dev) && device_iommu_mapped(dma_dev)) { 1155 1155 tegra->domain = iommu_paging_domain_alloc(dma_dev); 1156 - if (!tegra->domain) { 1157 - err = -ENOMEM; 1156 + if (IS_ERR(tegra->domain)) { 1157 + err = PTR_ERR(tegra->domain); 1158 1158 goto free; 1159 1159 } 1160 1160
+12 -12
drivers/gpu/drm/tests/drm_connector_test.c
··· 996 996 unsigned long long rate; 997 997 struct drm_device *drm = &priv->drm; 998 998 999 - mode = drm_display_mode_from_cea_vic(drm, 16); 999 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); 1000 1000 KUNIT_ASSERT_NOT_NULL(test, mode); 1001 1001 1002 1002 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); ··· 1017 1017 unsigned long long rate; 1018 1018 struct drm_device *drm = &priv->drm; 1019 1019 1020 - mode = drm_display_mode_from_cea_vic(drm, 16); 1020 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); 1021 1021 KUNIT_ASSERT_NOT_NULL(test, mode); 1022 1022 1023 1023 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); ··· 1038 1038 unsigned long long rate; 1039 1039 struct drm_device *drm = &priv->drm; 1040 1040 1041 - mode = drm_display_mode_from_cea_vic(drm, 1); 1041 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); 1042 1042 KUNIT_ASSERT_NOT_NULL(test, mode); 1043 1043 1044 1044 rate = drm_hdmi_compute_mode_clock(mode, 10, HDMI_COLORSPACE_RGB); ··· 1056 1056 unsigned long long rate; 1057 1057 struct drm_device *drm = &priv->drm; 1058 1058 1059 - mode = drm_display_mode_from_cea_vic(drm, 16); 1059 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); 1060 1060 KUNIT_ASSERT_NOT_NULL(test, mode); 1061 1061 1062 1062 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); ··· 1077 1077 unsigned long long rate; 1078 1078 struct drm_device *drm = &priv->drm; 1079 1079 1080 - mode = drm_display_mode_from_cea_vic(drm, 1); 1080 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); 1081 1081 KUNIT_ASSERT_NOT_NULL(test, mode); 1082 1082 1083 1083 rate = drm_hdmi_compute_mode_clock(mode, 12, HDMI_COLORSPACE_RGB); ··· 1095 1095 unsigned long long rate; 1096 1096 struct drm_device *drm = &priv->drm; 1097 1097 1098 - mode = drm_display_mode_from_cea_vic(drm, 6); 1098 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 6); 1099 1099 KUNIT_ASSERT_NOT_NULL(test, mode); 1100 1100 1101 1101 KUNIT_ASSERT_TRUE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); ··· 1118 1118 unsigned long long rate; 1119 1119 unsigned int vic = *(unsigned int *)test->param_value; 1120 1120 1121 - mode = drm_display_mode_from_cea_vic(drm, vic); 1121 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic); 1122 1122 KUNIT_ASSERT_NOT_NULL(test, mode); 1123 1123 1124 1124 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); ··· 1155 1155 drm_hdmi_compute_mode_clock_yuv420_vic_valid_tests[0]; 1156 1156 unsigned long long rate; 1157 1157 1158 - mode = drm_display_mode_from_cea_vic(drm, vic); 1158 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic); 1159 1159 KUNIT_ASSERT_NOT_NULL(test, mode); 1160 1160 1161 1161 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); ··· 1180 1180 drm_hdmi_compute_mode_clock_yuv420_vic_valid_tests[0]; 1181 1181 unsigned long long rate; 1182 1182 1183 - mode = drm_display_mode_from_cea_vic(drm, vic); 1183 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, vic); 1184 1184 KUNIT_ASSERT_NOT_NULL(test, mode); 1185 1185 1186 1186 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); ··· 1203 1203 struct drm_device *drm = &priv->drm; 1204 1204 unsigned long long rate; 1205 1205 1206 - mode = drm_display_mode_from_cea_vic(drm, 16); 1206 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); 1207 1207 KUNIT_ASSERT_NOT_NULL(test, mode); 1208 1208 1209 1209 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); ··· 1225 1225 struct drm_device *drm = &priv->drm; 1226 1226 unsigned long long rate; 1227 1227 1228 - mode = drm_display_mode_from_cea_vic(drm, 16); 1228 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); 1229 1229 KUNIT_ASSERT_NOT_NULL(test, mode); 1230 1230 1231 1231 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK); ··· 1247 1247 struct drm_device *drm = &priv->drm; 1248 1248 unsigned long long rate; 1249 1249 1250 - mode = drm_display_mode_from_cea_vic(drm, 16); 1250 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 16); 1251 1251 KUNIT_ASSERT_NOT_NULL(test, mode); 1252 1252 1253 1253 KUNIT_ASSERT_FALSE(test, mode->flags & DRM_MODE_FLAG_DBLCLK);
+4 -4
drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c
··· 441 441 ctx = drm_kunit_helper_acquire_ctx_alloc(test); 442 442 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); 443 443 444 - mode = drm_display_mode_from_cea_vic(drm, 1); 444 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); 445 445 KUNIT_ASSERT_NOT_NULL(test, mode); 446 446 447 447 drm = &priv->drm; ··· 555 555 ctx = drm_kunit_helper_acquire_ctx_alloc(test); 556 556 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); 557 557 558 - mode = drm_display_mode_from_cea_vic(drm, 1); 558 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); 559 559 KUNIT_ASSERT_NOT_NULL(test, mode); 560 560 561 561 drm = &priv->drm; ··· 671 671 ctx = drm_kunit_helper_acquire_ctx_alloc(test); 672 672 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); 673 673 674 - mode = drm_display_mode_from_cea_vic(drm, 1); 674 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); 675 675 KUNIT_ASSERT_NOT_NULL(test, mode); 676 676 677 677 drm = &priv->drm; ··· 1263 1263 ctx = drm_kunit_helper_acquire_ctx_alloc(test); 1264 1264 KUNIT_ASSERT_NOT_ERR_OR_NULL(test, ctx); 1265 1265 1266 - mode = drm_display_mode_from_cea_vic(drm, 1); 1266 + mode = drm_kunit_display_mode_from_cea_vic(test, drm, 1); 1267 1267 KUNIT_ASSERT_NOT_NULL(test, mode); 1268 1268 1269 1269 /*
+42
drivers/gpu/drm/tests/drm_kunit_helpers.c
··· 3 3 #include <drm/drm_atomic.h> 4 4 #include <drm/drm_atomic_helper.h> 5 5 #include <drm/drm_drv.h> 6 + #include <drm/drm_edid.h> 6 7 #include <drm/drm_fourcc.h> 7 8 #include <drm/drm_kunit_helpers.h> 8 9 #include <drm/drm_managed.h> ··· 311 310 return crtc; 312 311 } 313 312 EXPORT_SYMBOL_GPL(drm_kunit_helper_create_crtc); 313 + 314 + static void kunit_action_drm_mode_destroy(void *ptr) 315 + { 316 + struct drm_display_mode *mode = ptr; 317 + 318 + drm_mode_destroy(NULL, mode); 319 + } 320 + 321 + /** 322 + * drm_kunit_display_mode_from_cea_vic() - return a mode for CEA VIC 323 + for a KUnit test 324 + * @test: The test context object 325 + * @dev: DRM device 326 + * @video_code: CEA VIC of the mode 327 + * 328 + * Creates a new mode matching the specified CEA VIC for a KUnit test. 329 + * 330 + * Resources will be cleaned up automatically. 331 + * 332 + * Returns: A new drm_display_mode on success or NULL on failure 333 + */ 334 + struct drm_display_mode * 335 + drm_kunit_display_mode_from_cea_vic(struct kunit *test, struct drm_device *dev, 336 + u8 video_code) 337 + { 338 + struct drm_display_mode *mode; 339 + int ret; 340 + 341 + mode = drm_display_mode_from_cea_vic(dev, video_code); 342 + if (!mode) 343 + return NULL; 344 + 345 + ret = kunit_add_action_or_reset(test, 346 + kunit_action_drm_mode_destroy, 347 + mode); 348 + if (ret) 349 + return NULL; 350 + 351 + return mode; 352 + } 353 + EXPORT_SYMBOL_GPL(drm_kunit_display_mode_from_cea_vic); 314 354 315 355 MODULE_AUTHOR("Maxime Ripard <maxime@cerno.tech>"); 316 356 MODULE_DESCRIPTION("KUnit test suite helper functions");
+46 -25
drivers/gpu/drm/xe/display/xe_display.c
··· 309 309 } 310 310 311 311 /* TODO: System and runtime suspend/resume sequences will be sanitized as a follow-up. */ 312 - void xe_display_pm_runtime_suspend(struct xe_device *xe) 313 - { 314 - if (!xe->info.probe_display) 315 - return; 316 - 317 - if (xe->d3cold.allowed) 318 - xe_display_pm_suspend(xe, true); 319 - 320 - intel_hpd_poll_enable(xe); 321 - } 322 - 323 - void xe_display_pm_suspend(struct xe_device *xe, bool runtime) 312 + static void __xe_display_pm_suspend(struct xe_device *xe, bool runtime) 324 313 { 325 314 struct intel_display *display = &xe->display; 326 315 bool s2idle = suspend_to_idle(); ··· 342 353 intel_opregion_suspend(display, s2idle ? PCI_D1 : PCI_D3cold); 343 354 344 355 intel_dmc_suspend(xe); 356 + 357 + if (runtime && has_display(xe)) 358 + intel_hpd_poll_enable(xe); 359 + } 360 + 361 + void xe_display_pm_suspend(struct xe_device *xe) 362 + { 363 + __xe_display_pm_suspend(xe, false); 364 + } 365 + 366 + void xe_display_pm_runtime_suspend(struct xe_device *xe) 367 + { 368 + if (!xe->info.probe_display) 369 + return; 370 + 371 + if (xe->d3cold.allowed) { 372 + __xe_display_pm_suspend(xe, true); 373 + return; 374 + } 375 + 376 + intel_hpd_poll_enable(xe); 345 377 } 346 378 347 379 void xe_display_pm_suspend_late(struct xe_device *xe) ··· 376 366 intel_display_power_suspend_late(xe); 377 367 } 378 368 379 - void xe_display_pm_runtime_resume(struct xe_device *xe) 380 - { 381 - if (!xe->info.probe_display) 382 - return; 383 - 384 - intel_hpd_poll_disable(xe); 385 - 386 - if (xe->d3cold.allowed) 387 - xe_display_pm_resume(xe, true); 388 - } 389 - 390 369 void xe_display_pm_resume_early(struct xe_device *xe) 391 370 { 392 371 if (!xe->info.probe_display) ··· 386 387 intel_power_domains_resume(xe); 387 388 } 388 389 389 - void xe_display_pm_resume(struct xe_device *xe, bool runtime) 390 + static void __xe_display_pm_resume(struct xe_device *xe, bool runtime) 390 391 { 391 392 struct intel_display *display = &xe->display; 392 393 ··· 410 411 intel_display_driver_resume(xe); 411 412 drm_kms_helper_poll_enable(&xe->drm); 412 413 intel_display_driver_enable_user_access(xe); 413 - intel_hpd_poll_disable(xe); 414 414 } 415 + 416 + if (has_display(xe)) 417 + intel_hpd_poll_disable(xe); 415 418 416 419 intel_opregion_resume(display); 417 420 ··· 421 420 422 421 intel_power_domains_enable(xe); 423 422 } 423 + 424 + void xe_display_pm_resume(struct xe_device *xe) 425 + { 426 + __xe_display_pm_resume(xe, false); 427 + } 428 + 429 + void xe_display_pm_runtime_resume(struct xe_device *xe) 430 + { 431 + if (!xe->info.probe_display) 432 + return; 433 + 434 + if (xe->d3cold.allowed) { 435 + __xe_display_pm_resume(xe, true); 436 + return; 437 + } 438 + 439 + intel_hpd_init(xe); 440 + intel_hpd_poll_disable(xe); 441 + } 442 + 424 443 425 444 static void display_device_remove(struct drm_device *dev, void *arg) 426 445 {
+4 -4
drivers/gpu/drm/xe/display/xe_display.h
··· 34 34 void xe_display_irq_reset(struct xe_device *xe); 35 35 void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt); 36 36 37 - void xe_display_pm_suspend(struct xe_device *xe, bool runtime); 37 + void xe_display_pm_suspend(struct xe_device *xe); 38 38 void xe_display_pm_suspend_late(struct xe_device *xe); 39 39 void xe_display_pm_resume_early(struct xe_device *xe); 40 - void xe_display_pm_resume(struct xe_device *xe, bool runtime); 40 + void xe_display_pm_resume(struct xe_device *xe); 41 41 void xe_display_pm_runtime_suspend(struct xe_device *xe); 42 42 void xe_display_pm_runtime_resume(struct xe_device *xe); 43 43 ··· 65 65 static inline void xe_display_irq_reset(struct xe_device *xe) {} 66 66 static inline void xe_display_irq_postinstall(struct xe_device *xe, struct xe_gt *gt) {} 67 67 68 - static inline void xe_display_pm_suspend(struct xe_device *xe, bool runtime) {} 68 + static inline void xe_display_pm_suspend(struct xe_device *xe) {} 69 69 static inline void xe_display_pm_suspend_late(struct xe_device *xe) {} 70 70 static inline void xe_display_pm_resume_early(struct xe_device *xe) {} 71 - static inline void xe_display_pm_resume(struct xe_device *xe, bool runtime) {} 71 + static inline void xe_display_pm_resume(struct xe_device *xe) {} 72 72 static inline void xe_display_pm_runtime_suspend(struct xe_device *xe) {} 73 73 static inline void xe_display_pm_runtime_resume(struct xe_device *xe) {} 74 74
+10
drivers/gpu/drm/xe/xe_ggtt.c
··· 397 397 398 398 static void xe_ggtt_invalidate(struct xe_ggtt *ggtt) 399 399 { 400 + struct xe_device *xe = tile_to_xe(ggtt->tile); 401 + 402 + /* 403 + * XXX: Barrier for GGTT pages. Unsure exactly why this required but 404 + * without this LNL is having issues with the GuC reading scratch page 405 + * vs. correct GGTT page. Not particularly a hot code path so blindly 406 + * do a mmio read here which results in GuC reading correct GGTT page. 407 + */ 408 + xe_mmio_read32(xe_root_mmio_gt(xe), VF_CAP_REG); 409 + 400 410 /* Each GT in a tile has its own TLB to cache GGTT lookups */ 401 411 ggtt_invalidate_gt_tlb(ggtt->tile->primary_gt); 402 412 ggtt_invalidate_gt_tlb(ggtt->tile->media_gt);
+12 -6
drivers/gpu/drm/xe/xe_guc_submit.c
··· 916 916 static bool check_timeout(struct xe_exec_queue *q, struct xe_sched_job *job) 917 917 { 918 918 struct xe_gt *gt = guc_to_gt(exec_queue_to_guc(q)); 919 - u32 ctx_timestamp = xe_lrc_ctx_timestamp(q->lrc[0]); 920 - u32 ctx_job_timestamp = xe_lrc_ctx_job_timestamp(q->lrc[0]); 919 + u32 ctx_timestamp, ctx_job_timestamp; 921 920 u32 timeout_ms = q->sched_props.job_timeout_ms; 922 921 u32 diff; 923 922 u64 running_time_ms; 923 + 924 + if (!xe_sched_job_started(job)) { 925 + xe_gt_warn(gt, "Check job timeout: seqno=%u, lrc_seqno=%u, guc_id=%d, not started", 926 + xe_sched_job_seqno(job), xe_sched_job_lrc_seqno(job), 927 + q->guc->id); 928 + 929 + return xe_sched_invalidate_job(job, 2); 930 + } 931 + 932 + ctx_timestamp = xe_lrc_ctx_timestamp(q->lrc[0]); 933 + ctx_job_timestamp = xe_lrc_ctx_job_timestamp(q->lrc[0]); 924 934 925 935 /* 926 936 * Counter wraps at ~223s at the usual 19.2MHz, be paranoid catch ··· 1058 1048 skip_timeout_check = exec_queue_reset(q) || 1059 1049 exec_queue_killed_or_banned_or_wedged(q) || 1060 1050 exec_queue_destroyed(q); 1061 - 1062 - /* Job hasn't started, can't be timed out */ 1063 - if (!skip_timeout_check && !xe_sched_job_started(job)) 1064 - goto rearm; 1065 1051 1066 1052 /* 1067 1053 * XXX: Sampling timeout doesn't work in wedged mode as we have to
+3 -3
drivers/gpu/drm/xe/xe_pm.c
··· 123 123 for_each_gt(gt, xe, id) 124 124 xe_gt_suspend_prepare(gt); 125 125 126 - xe_display_pm_suspend(xe, false); 126 + xe_display_pm_suspend(xe); 127 127 128 128 /* FIXME: Super racey... */ 129 129 err = xe_bo_evict_all(xe); ··· 133 133 for_each_gt(gt, xe, id) { 134 134 err = xe_gt_suspend(gt); 135 135 if (err) { 136 - xe_display_pm_resume(xe, false); 136 + xe_display_pm_resume(xe); 137 137 goto err; 138 138 } 139 139 } ··· 187 187 for_each_gt(gt, xe, id) 188 188 xe_gt_resume(gt); 189 189 190 - xe_display_pm_resume(xe, false); 190 + xe_display_pm_resume(xe); 191 191 192 192 err = xe_bo_restore_user(xe); 193 193 if (err)
+1 -1
drivers/hid/hid-core.c
··· 1875 1875 1876 1876 u32 len = hid_report_len(report) + 7; 1877 1877 1878 - return kmalloc(len, flags); 1878 + return kzalloc(len, flags); 1879 1879 } 1880 1880 EXPORT_SYMBOL_GPL(hid_alloc_report_buf); 1881 1881
+1 -1
drivers/iio/adc/ad7124.c
··· 637 637 638 638 switch (info) { 639 639 case IIO_CHAN_INFO_SAMP_FREQ: 640 - if (val2 != 0) { 640 + if (val2 != 0 || val == 0) { 641 641 ret = -EINVAL; 642 642 break; 643 643 }
+78 -58
drivers/iio/adc/ad7380.c
··· 75 75 #define T_CONVERT_NS 190 /* conversion time */ 76 76 #define T_CONVERT_0_NS 10 /* 1st conversion start time (oversampling) */ 77 77 #define T_CONVERT_X_NS 500 /* xth conversion start time (oversampling) */ 78 + #define T_POWERUP_US 5000 /* Power up */ 78 79 79 80 struct ad7380_timing_specs { 80 81 const unsigned int t_csh_ns; /* CS minimum high time */ ··· 87 86 unsigned int num_channels; 88 87 unsigned int num_simult_channels; 89 88 bool has_mux; 89 + const char * const *supplies; 90 + unsigned int num_supplies; 91 + bool external_ref_only; 90 92 const char * const *vcm_supplies; 91 93 unsigned int num_vcm_supplies; 92 94 const unsigned long *available_scan_masks; ··· 247 243 DEFINE_AD7380_8_CHANNEL(ad7387_4_channels, 14, 0, u); 248 244 DEFINE_AD7380_8_CHANNEL(ad7388_4_channels, 12, 0, u); 249 245 246 + static const char * const ad7380_supplies[] = { 247 + "vcc", "vlogic", 248 + }; 249 + 250 250 static const char * const ad7380_2_channel_vcm_supplies[] = { 251 251 "aina", "ainb", 252 252 }; ··· 346 338 .channels = ad7380_channels, 347 339 .num_channels = ARRAY_SIZE(ad7380_channels), 348 340 .num_simult_channels = 2, 341 + .supplies = ad7380_supplies, 342 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 349 343 .available_scan_masks = ad7380_2_channel_scan_masks, 350 344 .timing_specs = &ad7380_timing, 351 345 }; ··· 357 347 .channels = ad7381_channels, 358 348 .num_channels = ARRAY_SIZE(ad7381_channels), 359 349 .num_simult_channels = 2, 350 + .supplies = ad7380_supplies, 351 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 360 352 .available_scan_masks = ad7380_2_channel_scan_masks, 361 353 .timing_specs = &ad7380_timing, 362 354 }; ··· 368 356 .channels = ad7383_channels, 369 357 .num_channels = ARRAY_SIZE(ad7383_channels), 370 358 .num_simult_channels = 2, 359 + .supplies = ad7380_supplies, 360 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 371 361 .vcm_supplies = ad7380_2_channel_vcm_supplies, 372 362 .num_vcm_supplies = ARRAY_SIZE(ad7380_2_channel_vcm_supplies), 373 363 .available_scan_masks = ad7380_2_channel_scan_masks, ··· 381 367 .channels = ad7384_channels, 382 368 .num_channels = ARRAY_SIZE(ad7384_channels), 383 369 .num_simult_channels = 2, 370 + .supplies = ad7380_supplies, 371 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 384 372 .vcm_supplies = ad7380_2_channel_vcm_supplies, 385 373 .num_vcm_supplies = ARRAY_SIZE(ad7380_2_channel_vcm_supplies), 386 374 .available_scan_masks = ad7380_2_channel_scan_masks, ··· 394 378 .channels = ad7386_channels, 395 379 .num_channels = ARRAY_SIZE(ad7386_channels), 396 380 .num_simult_channels = 2, 381 + .supplies = ad7380_supplies, 382 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 397 383 .has_mux = true, 398 384 .available_scan_masks = ad7380_2x2_channel_scan_masks, 399 385 .timing_specs = &ad7380_timing, ··· 406 388 .channels = ad7387_channels, 407 389 .num_channels = ARRAY_SIZE(ad7387_channels), 408 390 .num_simult_channels = 2, 391 + .supplies = ad7380_supplies, 392 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 409 393 .has_mux = true, 410 394 .available_scan_masks = ad7380_2x2_channel_scan_masks, 411 395 .timing_specs = &ad7380_timing, ··· 418 398 .channels = ad7388_channels, 419 399 .num_channels = ARRAY_SIZE(ad7388_channels), 420 400 .num_simult_channels = 2, 401 + .supplies = ad7380_supplies, 402 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 421 403 .has_mux = true, 422 404 .available_scan_masks = ad7380_2x2_channel_scan_masks, 423 405 .timing_specs = &ad7380_timing, ··· 430 408 .channels = ad7380_4_channels, 431 409 .num_channels = ARRAY_SIZE(ad7380_4_channels), 432 410 .num_simult_channels = 4, 411 + .supplies = ad7380_supplies, 412 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 413 + .external_ref_only = true, 433 414 .available_scan_masks = ad7380_4_channel_scan_masks, 434 415 .timing_specs = &ad7380_4_timing, 435 416 }; ··· 442 417 .channels = ad7381_4_channels, 443 418 .num_channels = ARRAY_SIZE(ad7381_4_channels), 444 419 .num_simult_channels = 4, 420 + .supplies = ad7380_supplies, 421 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 445 422 .available_scan_masks = ad7380_4_channel_scan_masks, 446 423 .timing_specs = &ad7380_4_timing, 447 424 }; ··· 453 426 .channels = ad7383_4_channels, 454 427 .num_channels = ARRAY_SIZE(ad7383_4_channels), 455 428 .num_simult_channels = 4, 429 + .supplies = ad7380_supplies, 430 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 456 431 .vcm_supplies = ad7380_4_channel_vcm_supplies, 457 432 .num_vcm_supplies = ARRAY_SIZE(ad7380_4_channel_vcm_supplies), 458 433 .available_scan_masks = ad7380_4_channel_scan_masks, ··· 466 437 .channels = ad7384_4_channels, 467 438 .num_channels = ARRAY_SIZE(ad7384_4_channels), 468 439 .num_simult_channels = 4, 440 + .supplies = ad7380_supplies, 441 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 469 442 .vcm_supplies = ad7380_4_channel_vcm_supplies, 470 443 .num_vcm_supplies = ARRAY_SIZE(ad7380_4_channel_vcm_supplies), 471 444 .available_scan_masks = ad7380_4_channel_scan_masks, ··· 479 448 .channels = ad7386_4_channels, 480 449 .num_channels = ARRAY_SIZE(ad7386_4_channels), 481 450 .num_simult_channels = 4, 451 + .supplies = ad7380_supplies, 452 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 482 453 .has_mux = true, 483 454 .available_scan_masks = ad7380_2x4_channel_scan_masks, 484 455 .timing_specs = &ad7380_4_timing, ··· 491 458 .channels = ad7387_4_channels, 492 459 .num_channels = ARRAY_SIZE(ad7387_4_channels), 493 460 .num_simult_channels = 4, 461 + .supplies = ad7380_supplies, 462 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 494 463 .has_mux = true, 495 464 .available_scan_masks = ad7380_2x4_channel_scan_masks, 496 465 .timing_specs = &ad7380_4_timing, ··· 503 468 .channels = ad7388_4_channels, 504 469 .num_channels = ARRAY_SIZE(ad7388_4_channels), 505 470 .num_simult_channels = 4, 471 + .supplies = ad7380_supplies, 472 + .num_supplies = ARRAY_SIZE(ad7380_supplies), 506 473 .has_mux = true, 507 474 .available_scan_masks = ad7380_2x4_channel_scan_masks, 508 475 .timing_specs = &ad7380_4_timing, ··· 993 956 .debugfs_reg_access = &ad7380_debugfs_reg_access, 994 957 }; 995 958 996 - static int ad7380_init(struct ad7380_state *st, struct regulator *vref) 959 + static int ad7380_init(struct ad7380_state *st, bool external_ref_en) 997 960 { 998 961 int ret; 999 962 ··· 1005 968 if (ret < 0) 1006 969 return ret; 1007 970 1008 - /* select internal or external reference voltage */ 1009 - ret = regmap_update_bits(st->regmap, AD7380_REG_ADDR_CONFIG1, 1010 - AD7380_CONFIG1_REFSEL, 1011 - FIELD_PREP(AD7380_CONFIG1_REFSEL, 1012 - vref ? 1 : 0)); 1013 - if (ret < 0) 1014 - return ret; 971 + if (external_ref_en) { 972 + /* select external reference voltage */ 973 + ret = regmap_set_bits(st->regmap, AD7380_REG_ADDR_CONFIG1, 974 + AD7380_CONFIG1_REFSEL); 975 + if (ret < 0) 976 + return ret; 977 + } 1015 978 1016 979 /* This is the default value after reset. */ 1017 980 st->oversampling_ratio = 1; ··· 1024 987 FIELD_PREP(AD7380_CONFIG2_SDO, 1)); 1025 988 } 1026 989 1027 - static void ad7380_regulator_disable(void *p) 1028 - { 1029 - regulator_disable(p); 1030 - } 1031 - 1032 990 static int ad7380_probe(struct spi_device *spi) 1033 991 { 1034 992 struct iio_dev *indio_dev; 1035 993 struct ad7380_state *st; 1036 - struct regulator *vref; 994 + bool external_ref_en; 1037 995 int ret, i; 1038 996 1039 997 indio_dev = devm_iio_device_alloc(&spi->dev, sizeof(*st)); ··· 1041 1009 if (!st->chip_info) 1042 1010 return dev_err_probe(&spi->dev, -EINVAL, "missing match data\n"); 1043 1011 1044 - vref = devm_regulator_get_optional(&spi->dev, "refio"); 1045 - if (IS_ERR(vref)) { 1046 - if (PTR_ERR(vref) != -ENODEV) 1047 - return dev_err_probe(&spi->dev, PTR_ERR(vref), 1048 - "Failed to get refio regulator\n"); 1012 + ret = devm_regulator_bulk_get_enable(&spi->dev, st->chip_info->num_supplies, 1013 + st->chip_info->supplies); 1049 1014 1050 - vref = NULL; 1051 - } 1015 + if (ret) 1016 + return dev_err_probe(&spi->dev, ret, 1017 + "Failed to enable power supplies\n"); 1018 + fsleep(T_POWERUP_US); 1052 1019 1053 - /* 1054 - * If there is no REFIO supply, then it means that we are using 1055 - * the internal 2.5V reference, otherwise REFIO is reference voltage. 1056 - */ 1057 - if (vref) { 1058 - ret = regulator_enable(vref); 1059 - if (ret) 1060 - return ret; 1061 - 1062 - ret = devm_add_action_or_reset(&spi->dev, 1063 - ad7380_regulator_disable, vref); 1064 - if (ret) 1065 - return ret; 1066 - 1067 - ret = regulator_get_voltage(vref); 1020 + if (st->chip_info->external_ref_only) { 1021 + ret = devm_regulator_get_enable_read_voltage(&spi->dev, 1022 + "refin"); 1068 1023 if (ret < 0) 1069 - return ret; 1024 + return dev_err_probe(&spi->dev, ret, 1025 + "Failed to get refin regulator\n"); 1070 1026 1071 1027 st->vref_mv = ret / 1000; 1028 + 1029 + /* these chips don't have a register bit for this */ 1030 + external_ref_en = false; 1072 1031 } else { 1073 - st->vref_mv = AD7380_INTERNAL_REF_MV; 1032 + /* 1033 + * If there is no REFIO supply, then it means that we are using 1034 + * the internal reference, otherwise REFIO is reference voltage. 1035 + */ 1036 + ret = devm_regulator_get_enable_read_voltage(&spi->dev, 1037 + "refio"); 1038 + if (ret < 0 && ret != -ENODEV) 1039 + return dev_err_probe(&spi->dev, ret, 1040 + "Failed to get refio regulator\n"); 1041 + 1042 + external_ref_en = ret != -ENODEV; 1043 + st->vref_mv = external_ref_en ? ret / 1000 : AD7380_INTERNAL_REF_MV; 1074 1044 } 1075 1045 1076 1046 if (st->chip_info->num_vcm_supplies > ARRAY_SIZE(st->vcm_mv)) ··· 1084 1050 * input pin. 1085 1051 */ 1086 1052 for (i = 0; i < st->chip_info->num_vcm_supplies; i++) { 1087 - struct regulator *vcm; 1053 + const char *vcm = st->chip_info->vcm_supplies[i]; 1088 1054 1089 - vcm = devm_regulator_get(&spi->dev, 1090 - st->chip_info->vcm_supplies[i]); 1091 - if (IS_ERR(vcm)) 1092 - return dev_err_probe(&spi->dev, PTR_ERR(vcm), 1093 - "Failed to get %s regulator\n", 1094 - st->chip_info->vcm_supplies[i]); 1095 - 1096 - ret = regulator_enable(vcm); 1097 - if (ret) 1098 - return ret; 1099 - 1100 - ret = devm_add_action_or_reset(&spi->dev, 1101 - ad7380_regulator_disable, vcm); 1102 - if (ret) 1103 - return ret; 1104 - 1105 - ret = regulator_get_voltage(vcm); 1055 + ret = devm_regulator_get_enable_read_voltage(&spi->dev, vcm); 1106 1056 if (ret < 0) 1107 - return ret; 1057 + return dev_err_probe(&spi->dev, ret, 1058 + "Failed to get %s regulator\n", 1059 + vcm); 1108 1060 1109 1061 st->vcm_mv[i] = ret / 1000; 1110 1062 } ··· 1155 1135 if (ret) 1156 1136 return ret; 1157 1137 1158 - ret = ad7380_init(st, vref); 1138 + ret = ad7380_init(st, external_ref_en); 1159 1139 if (ret) 1160 1140 return ret; 1161 1141
+1 -1
drivers/iio/dac/Kconfig
··· 380 380 config LTC2664 381 381 tristate "Analog Devices LTC2664 and LTC2672 DAC SPI driver" 382 382 depends on SPI 383 - select REGMAP 383 + select REGMAP_SPI 384 384 help 385 385 Say yes here to build support for Analog Devices 386 386 LTC2664 and LTC2672 converters (DAC).
+3 -1
drivers/iio/industrialio-gts-helper.c
··· 307 307 if (ret) 308 308 goto err_free_out; 309 309 310 + for (i = 0; i < gts->num_itime; i++) 311 + kfree(per_time_gains[i]); 310 312 kfree(per_time_gains); 311 313 gts->per_time_avail_scale_tables = per_time_scales; 312 314 313 315 return 0; 314 316 315 317 err_free_out: 316 - for (i--; i; i--) { 318 + for (i--; i >= 0; i--) { 317 319 kfree(per_time_scales[i]); 318 320 kfree(per_time_gains[i]); 319 321 }
+1 -1
drivers/iio/light/veml6030.c
··· 522 522 } 523 523 if (mask == IIO_CHAN_INFO_PROCESSED) { 524 524 *val = (reg * data->cur_resolution) / 10000; 525 - *val2 = (reg * data->cur_resolution) % 10000; 525 + *val2 = (reg * data->cur_resolution) % 10000 * 100; 526 526 return IIO_VAL_INT_PLUS_MICRO; 527 527 } 528 528 *val = reg;
+4
drivers/infiniband/hw/bnxt_re/qplib_fp.c
··· 1532 1532 u32 tbl_indx; 1533 1533 int rc; 1534 1534 1535 + spin_lock_bh(&rcfw->tbl_lock); 1535 1536 tbl_indx = map_qp_id_to_tbl_indx(qp->id, rcfw); 1536 1537 rcfw->qp_tbl[tbl_indx].qp_id = BNXT_QPLIB_QP_ID_INVALID; 1537 1538 rcfw->qp_tbl[tbl_indx].qp_handle = NULL; 1539 + spin_unlock_bh(&rcfw->tbl_lock); 1538 1540 1539 1541 bnxt_qplib_rcfw_cmd_prep((struct cmdq_base *)&req, 1540 1542 CMDQ_BASE_OPCODE_DESTROY_QP, ··· 1547 1545 sizeof(resp), 0); 1548 1546 rc = bnxt_qplib_rcfw_send_message(rcfw, &msg); 1549 1547 if (rc) { 1548 + spin_lock_bh(&rcfw->tbl_lock); 1550 1549 rcfw->qp_tbl[tbl_indx].qp_id = qp->id; 1551 1550 rcfw->qp_tbl[tbl_indx].qp_handle = qp; 1551 + spin_unlock_bh(&rcfw->tbl_lock); 1552 1552 return rc; 1553 1553 } 1554 1554
+19 -19
drivers/infiniband/hw/bnxt_re/qplib_rcfw.c
··· 290 290 struct bnxt_qplib_hwq *hwq; 291 291 u32 sw_prod, cmdq_prod; 292 292 struct pci_dev *pdev; 293 - unsigned long flags; 294 293 u16 cookie; 295 294 u8 *preq; 296 295 ··· 300 301 /* Cmdq are in 16-byte units, each request can consume 1 or more 301 302 * cmdqe 302 303 */ 303 - spin_lock_irqsave(&hwq->lock, flags); 304 + spin_lock_bh(&hwq->lock); 304 305 required_slots = bnxt_qplib_get_cmd_slots(msg->req); 305 306 free_slots = HWQ_FREE_SLOTS(hwq); 306 307 cookie = cmdq->seq_num & RCFW_MAX_COOKIE_VALUE; ··· 310 311 dev_info_ratelimited(&pdev->dev, 311 312 "CMDQ is full req/free %d/%d!", 312 313 required_slots, free_slots); 313 - spin_unlock_irqrestore(&hwq->lock, flags); 314 + spin_unlock_bh(&hwq->lock); 314 315 return -EAGAIN; 315 316 } 316 317 if (msg->block) ··· 366 367 wmb(); 367 368 writel(cmdq_prod, cmdq->cmdq_mbox.prod); 368 369 writel(RCFW_CMDQ_TRIG_VAL, cmdq->cmdq_mbox.db); 369 - spin_unlock_irqrestore(&hwq->lock, flags); 370 + spin_unlock_bh(&hwq->lock); 370 371 /* Return the CREQ response pointer */ 371 372 return 0; 372 373 } ··· 485 486 { 486 487 struct creq_qp_event *evnt = (struct creq_qp_event *)msg->resp; 487 488 struct bnxt_qplib_crsqe *crsqe; 488 - unsigned long flags; 489 489 u16 cookie; 490 490 int rc; 491 491 u8 opcode; ··· 510 512 rc = __poll_for_resp(rcfw, cookie); 511 513 512 514 if (rc) { 513 - spin_lock_irqsave(&rcfw->cmdq.hwq.lock, flags); 515 + spin_lock_bh(&rcfw->cmdq.hwq.lock); 514 516 crsqe = &rcfw->crsqe_tbl[cookie]; 515 517 crsqe->is_waiter_alive = false; 516 518 if (rc == -ENODEV) 517 519 set_bit(FIRMWARE_STALL_DETECTED, &rcfw->cmdq.flags); 518 - spin_unlock_irqrestore(&rcfw->cmdq.hwq.lock, flags); 520 + spin_unlock_bh(&rcfw->cmdq.hwq.lock); 519 521 return -ETIMEDOUT; 520 522 } 521 523 ··· 626 628 u16 cookie, blocked = 0; 627 629 bool is_waiter_alive; 628 630 struct pci_dev *pdev; 629 - unsigned long flags; 630 631 u32 wait_cmds = 0; 631 632 int rc = 0; 632 633 ··· 634 637 case CREQ_QP_EVENT_EVENT_QP_ERROR_NOTIFICATION: 635 638 err_event = (struct creq_qp_error_notification *)qp_event; 636 639 qp_id = le32_to_cpu(err_event->xid); 640 + spin_lock(&rcfw->tbl_lock); 637 641 tbl_indx = map_qp_id_to_tbl_indx(qp_id, rcfw); 638 642 qp = rcfw->qp_tbl[tbl_indx].qp_handle; 643 + if (!qp) { 644 + spin_unlock(&rcfw->tbl_lock); 645 + break; 646 + } 647 + bnxt_qplib_mark_qp_error(qp); 648 + rc = rcfw->creq.aeq_handler(rcfw, qp_event, qp); 649 + spin_unlock(&rcfw->tbl_lock); 639 650 dev_dbg(&pdev->dev, "Received QP error notification\n"); 640 651 dev_dbg(&pdev->dev, 641 652 "qpid 0x%x, req_err=0x%x, resp_err=0x%x\n", 642 653 qp_id, err_event->req_err_state_reason, 643 654 err_event->res_err_state_reason); 644 - if (!qp) 645 - break; 646 - bnxt_qplib_mark_qp_error(qp); 647 - rc = rcfw->creq.aeq_handler(rcfw, qp_event, qp); 648 655 break; 649 656 default: 650 657 /* ··· 660 659 * 661 660 */ 662 661 663 - spin_lock_irqsave_nested(&hwq->lock, flags, 664 - SINGLE_DEPTH_NESTING); 662 + spin_lock_nested(&hwq->lock, SINGLE_DEPTH_NESTING); 665 663 cookie = le16_to_cpu(qp_event->cookie); 666 664 blocked = cookie & RCFW_CMD_IS_BLOCKING; 667 665 cookie &= RCFW_MAX_COOKIE_VALUE; ··· 672 672 dev_info(&pdev->dev, 673 673 "rcfw timedout: cookie = %#x, free_slots = %d", 674 674 cookie, crsqe->free_slots); 675 - spin_unlock_irqrestore(&hwq->lock, flags); 675 + spin_unlock(&hwq->lock); 676 676 return rc; 677 677 } 678 678 ··· 720 720 __destroy_timedout_ah(rcfw, 721 721 (struct creq_create_ah_resp *) 722 722 qp_event); 723 - spin_unlock_irqrestore(&hwq->lock, flags); 723 + spin_unlock(&hwq->lock); 724 724 } 725 725 *num_wait += wait_cmds; 726 726 return rc; ··· 734 734 u32 type, budget = CREQ_ENTRY_POLL_BUDGET; 735 735 struct bnxt_qplib_hwq *hwq = &creq->hwq; 736 736 struct creq_base *creqe; 737 - unsigned long flags; 738 737 u32 num_wakeup = 0; 739 738 u32 hw_polled = 0; 740 739 741 740 /* Service the CREQ until budget is over */ 742 - spin_lock_irqsave(&hwq->lock, flags); 741 + spin_lock_bh(&hwq->lock); 743 742 while (budget > 0) { 744 743 creqe = bnxt_qplib_get_qe(hwq, hwq->cons, NULL); 745 744 if (!CREQ_CMP_VALID(creqe, creq->creq_db.dbinfo.flags)) ··· 781 782 if (hw_polled) 782 783 bnxt_qplib_ring_nq_db(&creq->creq_db.dbinfo, 783 784 rcfw->res->cctx, true); 784 - spin_unlock_irqrestore(&hwq->lock, flags); 785 + spin_unlock_bh(&hwq->lock); 785 786 if (num_wakeup) 786 787 wake_up_nr(&rcfw->cmdq.waitq, num_wakeup); 787 788 } ··· 977 978 GFP_KERNEL); 978 979 if (!rcfw->qp_tbl) 979 980 goto fail; 981 + spin_lock_init(&rcfw->tbl_lock); 980 982 981 983 rcfw->max_timeout = res->cctx->hwrm_cmd_max_timeout; 982 984
+2
drivers/infiniband/hw/bnxt_re/qplib_rcfw.h
··· 224 224 struct bnxt_qplib_crsqe *crsqe_tbl; 225 225 int qp_tbl_size; 226 226 struct bnxt_qplib_qp_node *qp_tbl; 227 + /* To synchronize the qp-handle hash table */ 228 + spinlock_t tbl_lock; 227 229 u64 oos_prev; 228 230 u32 init_oos_stats; 229 231 u32 cmdq_depth;
+1
drivers/infiniband/hw/cxgb4/provider.c
··· 473 473 .fill_res_cq_entry = c4iw_fill_res_cq_entry, 474 474 .fill_res_cm_id_entry = c4iw_fill_res_cm_id_entry, 475 475 .fill_res_mr_entry = c4iw_fill_res_mr_entry, 476 + .fill_res_qp_entry = c4iw_fill_res_qp_entry, 476 477 .get_dev_fw_str = get_dev_fw_str, 477 478 .get_dma_mr = c4iw_get_dma_mr, 478 479 .get_hw_stats = c4iw_get_mib,
+2 -2
drivers/infiniband/hw/mlx5/qp.c
··· 4268 4268 MLX5_SET(qpc, qpc, retry_count, attr->retry_cnt); 4269 4269 4270 4270 if (attr_mask & IB_QP_MAX_QP_RD_ATOMIC && attr->max_rd_atomic) 4271 - MLX5_SET(qpc, qpc, log_sra_max, ilog2(attr->max_rd_atomic)); 4271 + MLX5_SET(qpc, qpc, log_sra_max, fls(attr->max_rd_atomic - 1)); 4272 4272 4273 4273 if (attr_mask & IB_QP_SQ_PSN) 4274 4274 MLX5_SET(qpc, qpc, next_send_psn, attr->sq_psn); 4275 4275 4276 4276 if (attr_mask & IB_QP_MAX_DEST_RD_ATOMIC && attr->max_dest_rd_atomic) 4277 4277 MLX5_SET(qpc, qpc, log_rra_max, 4278 - ilog2(attr->max_dest_rd_atomic)); 4278 + fls(attr->max_dest_rd_atomic - 1)); 4279 4279 4280 4280 if (attr_mask & (IB_QP_ACCESS_FLAGS | IB_QP_MAX_DEST_RD_ATOMIC)) { 4281 4281 err = set_qpc_atomic_flags(qp, attr, attr_mask, qpc);
+73 -61
drivers/input/input.c
··· 119 119 120 120 handle = rcu_dereference(dev->grab); 121 121 if (handle) { 122 - count = handle->handler->events(handle, vals, count); 122 + count = handle->handle_events(handle, vals, count); 123 123 } else { 124 124 list_for_each_entry_rcu(handle, &dev->h_list, d_node) 125 125 if (handle->open) { 126 - count = handle->handler->events(handle, vals, 127 - count); 126 + count = handle->handle_events(handle, vals, 127 + count); 128 128 if (!count) 129 129 break; 130 130 } ··· 2534 2534 return 0; 2535 2535 } 2536 2536 2537 - /* 2538 - * An implementation of input_handler's events() method that simply 2539 - * invokes handler->event() method for each event one by one. 2540 - */ 2541 - static unsigned int input_handler_events_default(struct input_handle *handle, 2542 - struct input_value *vals, 2543 - unsigned int count) 2544 - { 2545 - struct input_handler *handler = handle->handler; 2546 - struct input_value *v; 2547 - 2548 - for (v = vals; v != vals + count; v++) 2549 - handler->event(handle, v->type, v->code, v->value); 2550 - 2551 - return count; 2552 - } 2553 - 2554 - /* 2555 - * An implementation of input_handler's events() method that invokes 2556 - * handler->filter() method for each event one by one and removes events 2557 - * that were filtered out from the "vals" array. 2558 - */ 2559 - static unsigned int input_handler_events_filter(struct input_handle *handle, 2560 - struct input_value *vals, 2561 - unsigned int count) 2562 - { 2563 - struct input_handler *handler = handle->handler; 2564 - struct input_value *end = vals; 2565 - struct input_value *v; 2566 - 2567 - for (v = vals; v != vals + count; v++) { 2568 - if (handler->filter(handle, v->type, v->code, v->value)) 2569 - continue; 2570 - if (end != v) 2571 - *end = *v; 2572 - end++; 2573 - } 2574 - 2575 - return end - vals; 2576 - } 2577 - 2578 - /* 2579 - * An implementation of input_handler's events() method that does nothing. 2580 - */ 2581 - static unsigned int input_handler_events_null(struct input_handle *handle, 2582 - struct input_value *vals, 2583 - unsigned int count) 2584 - { 2585 - return count; 2586 - } 2587 - 2588 2537 /** 2589 2538 * input_register_handler - register a new input handler 2590 2539 * @handler: handler to be registered ··· 2552 2603 return error; 2553 2604 2554 2605 INIT_LIST_HEAD(&handler->h_list); 2555 - 2556 - if (handler->filter) 2557 - handler->events = input_handler_events_filter; 2558 - else if (handler->event) 2559 - handler->events = input_handler_events_default; 2560 - else if (!handler->events) 2561 - handler->events = input_handler_events_null; 2562 2606 2563 2607 error = mutex_lock_interruptible(&input_mutex); 2564 2608 if (error) ··· 2626 2684 } 2627 2685 EXPORT_SYMBOL(input_handler_for_each_handle); 2628 2686 2687 + /* 2688 + * An implementation of input_handle's handle_events() method that simply 2689 + * invokes handler->event() method for each event one by one. 2690 + */ 2691 + static unsigned int input_handle_events_default(struct input_handle *handle, 2692 + struct input_value *vals, 2693 + unsigned int count) 2694 + { 2695 + struct input_handler *handler = handle->handler; 2696 + struct input_value *v; 2697 + 2698 + for (v = vals; v != vals + count; v++) 2699 + handler->event(handle, v->type, v->code, v->value); 2700 + 2701 + return count; 2702 + } 2703 + 2704 + /* 2705 + * An implementation of input_handle's handle_events() method that invokes 2706 + * handler->filter() method for each event one by one and removes events 2707 + * that were filtered out from the "vals" array. 2708 + */ 2709 + static unsigned int input_handle_events_filter(struct input_handle *handle, 2710 + struct input_value *vals, 2711 + unsigned int count) 2712 + { 2713 + struct input_handler *handler = handle->handler; 2714 + struct input_value *end = vals; 2715 + struct input_value *v; 2716 + 2717 + for (v = vals; v != vals + count; v++) { 2718 + if (handler->filter(handle, v->type, v->code, v->value)) 2719 + continue; 2720 + if (end != v) 2721 + *end = *v; 2722 + end++; 2723 + } 2724 + 2725 + return end - vals; 2726 + } 2727 + 2728 + /* 2729 + * An implementation of input_handle's handle_events() method that does nothing. 2730 + */ 2731 + static unsigned int input_handle_events_null(struct input_handle *handle, 2732 + struct input_value *vals, 2733 + unsigned int count) 2734 + { 2735 + return count; 2736 + } 2737 + 2738 + /* 2739 + * Sets up appropriate handle->event_handler based on the input_handler 2740 + * associated with the handle. 2741 + */ 2742 + static void input_handle_setup_event_handler(struct input_handle *handle) 2743 + { 2744 + struct input_handler *handler = handle->handler; 2745 + 2746 + if (handler->filter) 2747 + handle->handle_events = input_handle_events_filter; 2748 + else if (handler->event) 2749 + handle->handle_events = input_handle_events_default; 2750 + else if (handler->events) 2751 + handle->handle_events = handler->events; 2752 + else 2753 + handle->handle_events = input_handle_events_null; 2754 + } 2755 + 2629 2756 /** 2630 2757 * input_register_handle - register a new input handle 2631 2758 * @handle: handle to register ··· 2712 2701 struct input_dev *dev = handle->dev; 2713 2702 int error; 2714 2703 2704 + input_handle_setup_event_handler(handle); 2715 2705 /* 2716 2706 * We take dev->mutex here to prevent race with 2717 2707 * input_release_device().
+4 -2
drivers/input/keyboard/adp5588-keys.c
··· 822 822 { 823 823 struct i2c_client *client = to_i2c_client(dev); 824 824 825 - disable_irq(client->irq); 825 + if (client->irq) 826 + disable_irq(client->irq); 826 827 827 828 return 0; 828 829 } ··· 832 831 { 833 832 struct i2c_client *client = to_i2c_client(dev); 834 833 835 - enable_irq(client->irq); 834 + if (client->irq) 835 + enable_irq(client->irq); 836 836 837 837 return 0; 838 838 }
+18 -1
drivers/input/touchscreen/edt-ft5x06.c
··· 1121 1121 } 1122 1122 } 1123 1123 1124 + static void edt_ft5x06_exit_regmap(void *arg) 1125 + { 1126 + struct edt_ft5x06_ts_data *data = arg; 1127 + 1128 + if (!IS_ERR_OR_NULL(data->regmap)) 1129 + regmap_exit(data->regmap); 1130 + } 1131 + 1124 1132 static void edt_ft5x06_disable_regulators(void *arg) 1125 1133 { 1126 1134 struct edt_ft5x06_ts_data *data = arg; ··· 1161 1153 dev_err(&client->dev, "regmap allocation failed\n"); 1162 1154 return PTR_ERR(tsdata->regmap); 1163 1155 } 1156 + 1157 + /* 1158 + * We are not using devm_regmap_init_i2c() and instead install a 1159 + * custom action because we may replace regmap with M06-specific one 1160 + * and we need to make sure that it will not be released too early. 1161 + */ 1162 + error = devm_add_action_or_reset(&client->dev, edt_ft5x06_exit_regmap, 1163 + tsdata); 1164 + if (error) 1165 + return error; 1164 1166 1165 1167 chip_data = device_get_match_data(&client->dev); 1166 1168 if (!chip_data) ··· 1365 1347 struct edt_ft5x06_ts_data *tsdata = i2c_get_clientdata(client); 1366 1348 1367 1349 edt_ft5x06_ts_teardown_debugfs(tsdata); 1368 - regmap_exit(tsdata->regmap); 1369 1350 } 1370 1351 1371 1352 static int edt_ft5x06_ts_suspend(struct device *dev)
+12 -2
drivers/irqchip/irq-gic-v3-its.c
··· 3810 3810 * Check if we're racing against a VPE being destroyed, for 3811 3811 * which we don't want to allow a VMOVP. 3812 3812 */ 3813 - if (!atomic_read(&vpe->vmapp_count)) 3814 - return -EINVAL; 3813 + if (!atomic_read(&vpe->vmapp_count)) { 3814 + if (gic_requires_eager_mapping()) 3815 + return -EINVAL; 3816 + 3817 + /* 3818 + * If we lazily map the VPEs, this isn't an error and 3819 + * we can exit cleanly. 3820 + */ 3821 + cpu = cpumask_first(mask_val); 3822 + irq_data_update_effective_affinity(d, cpumask_of(cpu)); 3823 + return IRQ_SET_MASK_OK_DONE; 3824 + } 3815 3825 3816 3826 /* 3817 3827 * Changing affinity is mega expensive, so let's be as lazy as
+30 -29
drivers/md/dm-cache-target.c
··· 1905 1905 * This function gets called on the error paths of the constructor, so we 1906 1906 * have to cope with a partially initialised struct. 1907 1907 */ 1908 - static void destroy(struct cache *cache) 1908 + static void __destroy(struct cache *cache) 1909 1909 { 1910 - unsigned int i; 1911 - 1912 1910 mempool_exit(&cache->migration_pool); 1913 1911 1914 1912 if (cache->prison) 1915 1913 dm_bio_prison_destroy_v2(cache->prison); 1916 1914 1917 - cancel_delayed_work_sync(&cache->waker); 1918 1915 if (cache->wq) 1919 1916 destroy_workqueue(cache->wq); 1920 1917 ··· 1939 1942 if (cache->policy) 1940 1943 dm_cache_policy_destroy(cache->policy); 1941 1944 1945 + bioset_exit(&cache->bs); 1946 + 1947 + kfree(cache); 1948 + } 1949 + 1950 + static void destroy(struct cache *cache) 1951 + { 1952 + unsigned int i; 1953 + 1954 + cancel_delayed_work_sync(&cache->waker); 1955 + 1942 1956 for (i = 0; i < cache->nr_ctr_args ; i++) 1943 1957 kfree(cache->ctr_args[i]); 1944 1958 kfree(cache->ctr_args); 1945 1959 1946 - bioset_exit(&cache->bs); 1947 - 1948 - kfree(cache); 1960 + __destroy(cache); 1949 1961 } 1950 1962 1951 1963 static void cache_dtr(struct dm_target *ti) ··· 2009 2003 sector_t cache_sectors; 2010 2004 2011 2005 struct dm_dev *origin_dev; 2012 - sector_t origin_sectors; 2013 2006 2014 2007 uint32_t block_size; 2015 2008 ··· 2089 2084 static int parse_origin_dev(struct cache_args *ca, struct dm_arg_set *as, 2090 2085 char **error) 2091 2086 { 2087 + sector_t origin_sectors; 2092 2088 int r; 2093 2089 2094 2090 if (!at_least_one_arg(as, error)) ··· 2102 2096 return r; 2103 2097 } 2104 2098 2105 - ca->origin_sectors = get_dev_size(ca->origin_dev); 2106 - if (ca->ti->len > ca->origin_sectors) { 2099 + origin_sectors = get_dev_size(ca->origin_dev); 2100 + if (ca->ti->len > origin_sectors) { 2107 2101 *error = "Device size larger than cached device"; 2108 2102 return -EINVAL; 2109 2103 } ··· 2413 2407 2414 2408 ca->metadata_dev = ca->origin_dev = ca->cache_dev = NULL; 2415 2409 2416 - origin_blocks = cache->origin_sectors = ca->origin_sectors; 2410 + origin_blocks = cache->origin_sectors = ti->len; 2417 2411 origin_blocks = block_div(origin_blocks, ca->block_size); 2418 2412 cache->origin_blocks = to_oblock(origin_blocks); 2419 2413 ··· 2567 2561 *result = cache; 2568 2562 return 0; 2569 2563 bad: 2570 - destroy(cache); 2564 + __destroy(cache); 2571 2565 return r; 2572 2566 } 2573 2567 ··· 2618 2612 2619 2613 r = copy_ctr_args(cache, argc - 3, (const char **)argv + 3); 2620 2614 if (r) { 2621 - destroy(cache); 2615 + __destroy(cache); 2622 2616 goto out; 2623 2617 } 2624 2618 ··· 2901 2895 static bool can_resize(struct cache *cache, dm_cblock_t new_size) 2902 2896 { 2903 2897 if (from_cblock(new_size) > from_cblock(cache->cache_size)) { 2904 - if (cache->sized) { 2905 - DMERR("%s: unable to extend cache due to missing cache table reload", 2906 - cache_device_name(cache)); 2907 - return false; 2908 - } 2898 + DMERR("%s: unable to extend cache due to missing cache table reload", 2899 + cache_device_name(cache)); 2900 + return false; 2909 2901 } 2910 2902 2911 2903 /* 2912 2904 * We can't drop a dirty block when shrinking the cache. 2913 2905 */ 2914 - while (from_cblock(new_size) < from_cblock(cache->cache_size)) { 2915 - new_size = to_cblock(from_cblock(new_size) + 1); 2916 - if (is_dirty(cache, new_size)) { 2906 + if (cache->loaded_mappings) { 2907 + new_size = to_cblock(find_next_bit(cache->dirty_bitset, 2908 + from_cblock(cache->cache_size), 2909 + from_cblock(new_size))); 2910 + if (new_size != cache->cache_size) { 2917 2911 DMERR("%s: unable to shrink cache; cache block %llu is dirty", 2918 2912 cache_device_name(cache), 2919 2913 (unsigned long long) from_cblock(new_size)); ··· 2949 2943 /* 2950 2944 * Check to see if the cache has resized. 2951 2945 */ 2952 - if (!cache->sized) { 2953 - r = resize_cache_dev(cache, csize); 2954 - if (r) 2955 - return r; 2956 - 2957 - cache->sized = true; 2958 - 2959 - } else if (csize != cache->cache_size) { 2946 + if (!cache->sized || csize != cache->cache_size) { 2960 2947 if (!can_resize(cache, csize)) 2961 2948 return -EINVAL; 2962 2949 2963 2950 r = resize_cache_dev(cache, csize); 2964 2951 if (r) 2965 2952 return r; 2953 + 2954 + cache->sized = true; 2966 2955 } 2967 2956 2968 2957 if (!cache->loaded_mappings) {
+2 -2
drivers/md/dm-unstripe.c
··· 85 85 } 86 86 uc->physical_start = start; 87 87 88 - uc->unstripe_offset = uc->unstripe * uc->chunk_size; 89 - uc->unstripe_width = (uc->stripes - 1) * uc->chunk_size; 88 + uc->unstripe_offset = (sector_t)uc->unstripe * uc->chunk_size; 89 + uc->unstripe_width = (sector_t)(uc->stripes - 1) * uc->chunk_size; 90 90 uc->chunk_shift = is_power_of_2(uc->chunk_size) ? fls(uc->chunk_size) - 1 : 0; 91 91 92 92 tmp_len = ti->len;
+6 -3
drivers/md/dm-verity-target.c
··· 356 356 else if (verity_handle_err(v, 357 357 DM_VERITY_BLOCK_TYPE_METADATA, 358 358 hash_block)) { 359 - struct bio *bio = 360 - dm_bio_from_per_bio_data(io, 361 - v->ti->per_io_data_size); 359 + struct bio *bio; 360 + io->had_mismatch = true; 361 + bio = dm_bio_from_per_bio_data(io, v->ti->per_io_data_size); 362 362 dm_audit_log_bio(DM_MSG_PREFIX, "verify-metadata", bio, 363 363 block, 0); 364 364 r = -EIO; ··· 482 482 return -EIO; /* Error correction failed; Just return error */ 483 483 484 484 if (verity_handle_err(v, DM_VERITY_BLOCK_TYPE_DATA, blkno)) { 485 + io->had_mismatch = true; 485 486 dm_audit_log_bio(DM_MSG_PREFIX, "verify-data", bio, blkno, 0); 486 487 return -EIO; 487 488 } ··· 607 606 608 607 if (unlikely(status != BLK_STS_OK) && 609 608 unlikely(!(bio->bi_opf & REQ_RAHEAD)) && 609 + !io->had_mismatch && 610 610 !verity_is_system_shutting_down()) { 611 611 if (v->error_mode == DM_VERITY_MODE_PANIC) { 612 612 panic("dm-verity device has I/O error"); ··· 781 779 io->orig_bi_end_io = bio->bi_end_io; 782 780 io->block = bio->bi_iter.bi_sector >> (v->data_dev_block_bits - SECTOR_SHIFT); 783 781 io->n_blocks = bio->bi_iter.bi_size >> v->data_dev_block_bits; 782 + io->had_mismatch = false; 784 783 785 784 bio->bi_end_io = verity_end_io; 786 785 bio->bi_private = io;
+1
drivers/md/dm-verity.h
··· 92 92 sector_t block; 93 93 unsigned int n_blocks; 94 94 bool in_bh; 95 + bool had_mismatch; 95 96 96 97 struct work_struct work; 97 98 struct work_struct bh_work;
+3 -1
drivers/md/dm.c
··· 2290 2290 * override accordingly. 2291 2291 */ 2292 2292 md->disk = blk_alloc_disk(NULL, md->numa_node_id); 2293 - if (IS_ERR(md->disk)) 2293 + if (IS_ERR(md->disk)) { 2294 + md->disk = NULL; 2294 2295 goto bad; 2296 + } 2295 2297 md->queue = md->disk->queue; 2296 2298 2297 2299 init_waitqueue_head(&md->wait);
+2 -2
drivers/misc/mei/client.c
··· 321 321 return; 322 322 323 323 list_del(&cb->list); 324 - kfree(cb->buf.data); 324 + kvfree(cb->buf.data); 325 325 kfree(cb->ext_hdr); 326 326 kfree(cb); 327 327 } ··· 497 497 if (length == 0) 498 498 return cb; 499 499 500 - cb->buf.data = kmalloc(roundup(length, MEI_SLOT_SIZE), GFP_KERNEL); 500 + cb->buf.data = kvmalloc(roundup(length, MEI_SLOT_SIZE), GFP_KERNEL); 501 501 if (!cb->buf.data) { 502 502 mei_io_cb_free(cb); 503 503 return NULL;
+24 -14
drivers/mmc/host/sdhci-pci-gli.c
··· 892 892 gl9767_vhs_read(pdev); 893 893 } 894 894 895 + static void gl9767_set_low_power_negotiation(struct pci_dev *pdev, bool enable) 896 + { 897 + u32 value; 898 + 899 + gl9767_vhs_write(pdev); 900 + 901 + pci_read_config_dword(pdev, PCIE_GLI_9767_CFG, &value); 902 + if (enable) 903 + value &= ~PCIE_GLI_9767_CFG_LOW_PWR_OFF; 904 + else 905 + value |= PCIE_GLI_9767_CFG_LOW_PWR_OFF; 906 + pci_write_config_dword(pdev, PCIE_GLI_9767_CFG, value); 907 + 908 + gl9767_vhs_read(pdev); 909 + } 910 + 895 911 static void sdhci_gl9767_set_clock(struct sdhci_host *host, unsigned int clock) 896 912 { 897 913 struct sdhci_pci_slot *slot = sdhci_priv(host); 898 914 struct mmc_ios *ios = &host->mmc->ios; 899 915 struct pci_dev *pdev; 900 - u32 value; 901 916 u16 clk; 902 917 903 918 pdev = slot->chip->pdev; 904 919 host->mmc->actual_clock = 0; 905 920 906 - gl9767_vhs_write(pdev); 907 - 908 - pci_read_config_dword(pdev, PCIE_GLI_9767_CFG, &value); 909 - value |= PCIE_GLI_9767_CFG_LOW_PWR_OFF; 910 - pci_write_config_dword(pdev, PCIE_GLI_9767_CFG, value); 911 - 921 + gl9767_set_low_power_negotiation(pdev, false); 912 922 gl9767_disable_ssc_pll(pdev); 913 923 sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL); 914 924 915 - if (clock == 0) 925 + if (clock == 0) { 926 + gl9767_set_low_power_negotiation(pdev, true); 916 927 return; 928 + } 917 929 918 930 clk = sdhci_calc_clk(host, clock, &host->mmc->actual_clock); 919 931 if (clock == 200000000 && ios->timing == MMC_TIMING_UHS_SDR104) { ··· 934 922 } 935 923 936 924 sdhci_enable_clk(host, clk); 937 - 938 - pci_read_config_dword(pdev, PCIE_GLI_9767_CFG, &value); 939 - value &= ~PCIE_GLI_9767_CFG_LOW_PWR_OFF; 940 - pci_write_config_dword(pdev, PCIE_GLI_9767_CFG, value); 941 - 942 - gl9767_vhs_read(pdev); 925 + gl9767_set_low_power_negotiation(pdev, true); 943 926 } 944 927 945 928 static void gli_set_9767(struct sdhci_host *host) ··· 1068 1061 sdhci_writew(host, value, SDHCI_CLOCK_CONTROL); 1069 1062 } 1070 1063 1064 + pci_read_config_dword(pdev, PCIE_GLI_9767_CFG, &value); 1065 + value &= ~PCIE_GLI_9767_CFG_LOW_PWR_OFF; 1066 + pci_write_config_dword(pdev, PCIE_GLI_9767_CFG, value); 1071 1067 gl9767_vhs_read(pdev); 1072 1068 1073 1069 return 0;
+6 -1
drivers/net/can/c_can/c_can_main.c
··· 1011 1011 1012 1012 /* common for all type of bus errors */ 1013 1013 priv->can.can_stats.bus_error++; 1014 - stats->rx_errors++; 1015 1014 1016 1015 /* propagate the error condition to the CAN stack */ 1017 1016 skb = alloc_can_err_skb(dev, &cf); ··· 1026 1027 case LEC_STUFF_ERROR: 1027 1028 netdev_dbg(dev, "stuff error\n"); 1028 1029 cf->data[2] |= CAN_ERR_PROT_STUFF; 1030 + stats->rx_errors++; 1029 1031 break; 1030 1032 case LEC_FORM_ERROR: 1031 1033 netdev_dbg(dev, "form error\n"); 1032 1034 cf->data[2] |= CAN_ERR_PROT_FORM; 1035 + stats->rx_errors++; 1033 1036 break; 1034 1037 case LEC_ACK_ERROR: 1035 1038 netdev_dbg(dev, "ack error\n"); 1036 1039 cf->data[3] = CAN_ERR_PROT_LOC_ACK; 1040 + stats->tx_errors++; 1037 1041 break; 1038 1042 case LEC_BIT1_ERROR: 1039 1043 netdev_dbg(dev, "bit1 error\n"); 1040 1044 cf->data[2] |= CAN_ERR_PROT_BIT1; 1045 + stats->tx_errors++; 1041 1046 break; 1042 1047 case LEC_BIT0_ERROR: 1043 1048 netdev_dbg(dev, "bit0 error\n"); 1044 1049 cf->data[2] |= CAN_ERR_PROT_BIT0; 1050 + stats->tx_errors++; 1045 1051 break; 1046 1052 case LEC_CRC_ERROR: 1047 1053 netdev_dbg(dev, "CRC error\n"); 1048 1054 cf->data[3] = CAN_ERR_PROT_LOC_CRC_SEQ; 1055 + stats->rx_errors++; 1049 1056 break; 1050 1057 default: 1051 1058 break;
+1 -1
drivers/net/can/cc770/Kconfig
··· 7 7 8 8 config CAN_CC770_ISA 9 9 tristate "ISA Bus based legacy CC770 driver" 10 - depends on ISA 10 + depends on HAS_IOPORT 11 11 help 12 12 This driver adds legacy support for CC770 and AN82527 chips 13 13 connected to the ISA bus using I/O port, memory mapped or
+2 -1
drivers/net/can/m_can/m_can.c
··· 1765 1765 netif_stop_queue(dev); 1766 1766 1767 1767 m_can_stop(dev); 1768 - free_irq(dev->irq, dev); 1768 + if (dev->irq) 1769 + free_irq(dev->irq, dev); 1769 1770 1770 1771 m_can_clean(dev); 1771 1772
+2 -1
drivers/net/can/rockchip/Kconfig
··· 2 2 3 3 config CAN_ROCKCHIP_CANFD 4 4 tristate "Rockchip CAN-FD controller" 5 - depends on OF || COMPILE_TEST 5 + depends on OF 6 + depends on ARCH_ROCKCHIP || COMPILE_TEST 6 7 select CAN_RX_OFFLOAD 7 8 help 8 9 Say Y here if you want to use CAN-FD controller found on
+1 -1
drivers/net/can/sja1000/Kconfig
··· 87 87 88 88 config CAN_SJA1000_ISA 89 89 tristate "ISA Bus based legacy SJA1000 driver" 90 - depends on ISA 90 + depends on HAS_IOPORT 91 91 help 92 92 This driver adds legacy support for SJA1000 chips connected to 93 93 the ISA bus using I/O port, memory mapped or indirect access.
+5 -3
drivers/net/can/spi/mcp251xfd/mcp251xfd-ring.c
··· 2 2 // 3 3 // mcp251xfd - Microchip MCP251xFD Family CAN controller driver 4 4 // 5 - // Copyright (c) 2019, 2020, 2021 Pengutronix, 5 + // Copyright (c) 2019, 2020, 2021, 2024 Pengutronix, 6 6 // Marc Kleine-Budde <kernel@pengutronix.de> 7 7 // 8 8 // Based on: ··· 483 483 }; 484 484 const struct ethtool_coalesce ec = { 485 485 .rx_coalesce_usecs_irq = priv->rx_coalesce_usecs_irq, 486 - .rx_max_coalesced_frames_irq = priv->rx_obj_num_coalesce_irq, 486 + .rx_max_coalesced_frames_irq = priv->rx_obj_num_coalesce_irq == 0 ? 487 + 1 : priv->rx_obj_num_coalesce_irq, 487 488 .tx_coalesce_usecs_irq = priv->tx_coalesce_usecs_irq, 488 - .tx_max_coalesced_frames_irq = priv->tx_obj_num_coalesce_irq, 489 + .tx_max_coalesced_frames_irq = priv->tx_obj_num_coalesce_irq == 0 ? 490 + 1 : priv->tx_obj_num_coalesce_irq, 489 491 }; 490 492 struct can_ram_layout layout; 491 493
+7 -3
drivers/net/can/spi/mcp251xfd/mcp251xfd-tef.c
··· 16 16 17 17 #include "mcp251xfd.h" 18 18 19 - static inline bool mcp251xfd_tx_fifo_sta_full(u32 fifo_sta) 19 + static inline bool mcp251xfd_tx_fifo_sta_empty(u32 fifo_sta) 20 20 { 21 - return !(fifo_sta & MCP251XFD_REG_FIFOSTA_TFNRFNIF); 21 + return fifo_sta & MCP251XFD_REG_FIFOSTA_TFERFFIF; 22 22 } 23 23 24 24 static inline int ··· 122 122 if (err) 123 123 return err; 124 124 125 - if (mcp251xfd_tx_fifo_sta_full(fifo_sta)) { 125 + /* If the chip says the TX-FIFO is empty, but there are no TX 126 + * buffers free in the ring, we assume all have been sent. 127 + */ 128 + if (mcp251xfd_tx_fifo_sta_empty(fifo_sta) && 129 + mcp251xfd_get_tx_free(tx_ring) == 0) { 126 130 *len_p = tx_ring->obj_num; 127 131 return 0; 128 132 }
+16 -11
drivers/net/ethernet/arc/emac_main.c
··· 111 111 { 112 112 struct arc_emac_priv *priv = netdev_priv(ndev); 113 113 struct net_device_stats *stats = &ndev->stats; 114 + struct device *dev = ndev->dev.parent; 114 115 unsigned int i; 115 116 116 117 for (i = 0; i < TX_BD_NUM; i++) { ··· 141 140 stats->tx_bytes += skb->len; 142 141 } 143 142 144 - dma_unmap_single(&ndev->dev, dma_unmap_addr(tx_buff, addr), 143 + dma_unmap_single(dev, dma_unmap_addr(tx_buff, addr), 145 144 dma_unmap_len(tx_buff, len), DMA_TO_DEVICE); 146 145 147 146 /* return the sk_buff to system */ ··· 175 174 static int arc_emac_rx(struct net_device *ndev, int budget) 176 175 { 177 176 struct arc_emac_priv *priv = netdev_priv(ndev); 177 + struct device *dev = ndev->dev.parent; 178 178 unsigned int work_done; 179 179 180 180 for (work_done = 0; work_done < budget; work_done++) { ··· 225 223 continue; 226 224 } 227 225 228 - addr = dma_map_single(&ndev->dev, (void *)skb->data, 226 + addr = dma_map_single(dev, (void *)skb->data, 229 227 EMAC_BUFFER_SIZE, DMA_FROM_DEVICE); 230 - if (dma_mapping_error(&ndev->dev, addr)) { 228 + if (dma_mapping_error(dev, addr)) { 231 229 if (net_ratelimit()) 232 230 netdev_err(ndev, "cannot map dma buffer\n"); 233 231 dev_kfree_skb(skb); ··· 239 237 } 240 238 241 239 /* unmap previosly mapped skb */ 242 - dma_unmap_single(&ndev->dev, dma_unmap_addr(rx_buff, addr), 240 + dma_unmap_single(dev, dma_unmap_addr(rx_buff, addr), 243 241 dma_unmap_len(rx_buff, len), DMA_FROM_DEVICE); 244 242 245 243 pktlen = info & LEN_MASK; ··· 425 423 { 426 424 struct arc_emac_priv *priv = netdev_priv(ndev); 427 425 struct phy_device *phy_dev = ndev->phydev; 426 + struct device *dev = ndev->dev.parent; 428 427 int i; 429 428 430 429 phy_dev->autoneg = AUTONEG_ENABLE; ··· 448 445 if (unlikely(!rx_buff->skb)) 449 446 return -ENOMEM; 450 447 451 - addr = dma_map_single(&ndev->dev, (void *)rx_buff->skb->data, 448 + addr = dma_map_single(dev, (void *)rx_buff->skb->data, 452 449 EMAC_BUFFER_SIZE, DMA_FROM_DEVICE); 453 - if (dma_mapping_error(&ndev->dev, addr)) { 450 + if (dma_mapping_error(dev, addr)) { 454 451 netdev_err(ndev, "cannot dma map\n"); 455 452 dev_kfree_skb(rx_buff->skb); 456 453 return -ENOMEM; ··· 551 548 static void arc_free_tx_queue(struct net_device *ndev) 552 549 { 553 550 struct arc_emac_priv *priv = netdev_priv(ndev); 551 + struct device *dev = ndev->dev.parent; 554 552 unsigned int i; 555 553 556 554 for (i = 0; i < TX_BD_NUM; i++) { ··· 559 555 struct buffer_state *tx_buff = &priv->tx_buff[i]; 560 556 561 557 if (tx_buff->skb) { 562 - dma_unmap_single(&ndev->dev, 558 + dma_unmap_single(dev, 563 559 dma_unmap_addr(tx_buff, addr), 564 560 dma_unmap_len(tx_buff, len), 565 561 DMA_TO_DEVICE); ··· 583 579 static void arc_free_rx_queue(struct net_device *ndev) 584 580 { 585 581 struct arc_emac_priv *priv = netdev_priv(ndev); 582 + struct device *dev = ndev->dev.parent; 586 583 unsigned int i; 587 584 588 585 for (i = 0; i < RX_BD_NUM; i++) { ··· 591 586 struct buffer_state *rx_buff = &priv->rx_buff[i]; 592 587 593 588 if (rx_buff->skb) { 594 - dma_unmap_single(&ndev->dev, 589 + dma_unmap_single(dev, 595 590 dma_unmap_addr(rx_buff, addr), 596 591 dma_unmap_len(rx_buff, len), 597 592 DMA_FROM_DEVICE); ··· 684 679 unsigned int len, *txbd_curr = &priv->txbd_curr; 685 680 struct net_device_stats *stats = &ndev->stats; 686 681 __le32 *info = &priv->txbd[*txbd_curr].info; 682 + struct device *dev = ndev->dev.parent; 687 683 dma_addr_t addr; 688 684 689 685 if (skb_padto(skb, ETH_ZLEN)) ··· 698 692 return NETDEV_TX_BUSY; 699 693 } 700 694 701 - addr = dma_map_single(&ndev->dev, (void *)skb->data, len, 702 - DMA_TO_DEVICE); 695 + addr = dma_map_single(dev, (void *)skb->data, len, DMA_TO_DEVICE); 703 696 704 - if (unlikely(dma_mapping_error(&ndev->dev, addr))) { 697 + if (unlikely(dma_mapping_error(dev, addr))) { 705 698 stats->tx_dropped++; 706 699 stats->tx_errors++; 707 700 dev_kfree_skb_any(skb);
+8 -1
drivers/net/ethernet/arc/emac_mdio.c
··· 133 133 struct arc_emac_mdio_bus_data *data = &priv->bus_data; 134 134 struct device_node *np = priv->dev->of_node; 135 135 const char *name = "Synopsys MII Bus"; 136 + struct device_node *mdio_node; 136 137 struct mii_bus *bus; 137 138 int error; 138 139 ··· 165 164 166 165 snprintf(bus->id, MII_BUS_ID_SIZE, "%s", bus->name); 167 166 168 - error = of_mdiobus_register(bus, priv->dev->of_node); 167 + /* Backwards compatibility for EMAC nodes without MDIO subnode. */ 168 + mdio_node = of_get_child_by_name(np, "mdio"); 169 + if (!mdio_node) 170 + mdio_node = of_node_get(np); 171 + 172 + error = of_mdiobus_register(bus, mdio_node); 173 + of_node_put(mdio_node); 169 174 if (error) { 170 175 mdiobus_free(bus); 171 176 return dev_err_probe(priv->dev, error,
+1 -1
drivers/net/ethernet/freescale/dpaa/dpaa_eth_trace.h
··· 56 56 __entry->fd_format = qm_fd_get_format(fd); 57 57 __entry->fd_offset = qm_fd_get_offset(fd); 58 58 __entry->fd_length = qm_fd_get_length(fd); 59 - __entry->fd_status = fd->status; 59 + __entry->fd_status = __be32_to_cpu(fd->status); 60 60 __assign_str(name); 61 61 ), 62 62
+11 -10
drivers/net/ethernet/freescale/enetc/enetc_pf.c
··· 610 610 611 611 if (!num_vfs) { 612 612 enetc_msg_psi_free(pf); 613 - kfree(pf->vf_state); 614 613 pf->num_vfs = 0; 615 614 pci_disable_sriov(pdev); 616 615 } else { 617 616 pf->num_vfs = num_vfs; 618 - 619 - pf->vf_state = kcalloc(num_vfs, sizeof(struct enetc_vf_state), 620 - GFP_KERNEL); 621 - if (!pf->vf_state) { 622 - pf->num_vfs = 0; 623 - return -ENOMEM; 624 - } 625 617 626 618 err = enetc_msg_psi_init(pf); 627 619 if (err) { ··· 633 641 err_en_sriov: 634 642 enetc_msg_psi_free(pf); 635 643 err_msg_psi: 636 - kfree(pf->vf_state); 637 644 pf->num_vfs = 0; 638 645 639 646 return err; ··· 1014 1023 1015 1024 pf = enetc_si_priv(si); 1016 1025 pf->si = si; 1017 - pf->total_vfs = pci_sriov_get_totalvfs(pdev); 1018 1026 pf->ops = &enetc_pf_ops; 1027 + 1028 + pf->total_vfs = pci_sriov_get_totalvfs(pdev); 1029 + if (pf->total_vfs) { 1030 + pf->vf_state = kcalloc(pf->total_vfs, sizeof(struct enetc_vf_state), 1031 + GFP_KERNEL); 1032 + if (!pf->vf_state) 1033 + goto err_alloc_vf_state; 1034 + } 1019 1035 1020 1036 err = enetc_setup_mac_addresses(node, pf); 1021 1037 if (err) ··· 1100 1102 free_netdev(ndev); 1101 1103 err_alloc_netdev: 1102 1104 err_setup_mac_addresses: 1105 + kfree(pf->vf_state); 1106 + err_alloc_vf_state: 1103 1107 enetc_psi_destroy(pdev); 1104 1108 err_psi_create: 1105 1109 return err; ··· 1128 1128 enetc_free_si_resources(priv); 1129 1129 1130 1130 free_netdev(si->ndev); 1131 + kfree(pf->vf_state); 1131 1132 1132 1133 enetc_psi_destroy(pdev); 1133 1134 }
+8 -1
drivers/net/ethernet/freescale/enetc/enetc_vf.c
··· 78 78 { 79 79 struct enetc_ndev_priv *priv = netdev_priv(ndev); 80 80 struct sockaddr *saddr = addr; 81 + int err; 81 82 82 83 if (!is_valid_ether_addr(saddr->sa_data)) 83 84 return -EADDRNOTAVAIL; 84 85 85 - return enetc_msg_vsi_set_primary_mac_addr(priv, saddr); 86 + err = enetc_msg_vsi_set_primary_mac_addr(priv, saddr); 87 + if (err) 88 + return err; 89 + 90 + eth_hw_addr_set(ndev, saddr->sa_data); 91 + 92 + return 0; 86 93 } 87 94 88 95 static int enetc_vf_set_features(struct net_device *ndev,
+4 -1
drivers/net/ethernet/hisilicon/hns3/hnae3.c
··· 25 25 pci_id = pci_match_id(ae_algo->pdev_id_table, ae_dev->pdev); 26 26 if (!pci_id) 27 27 continue; 28 - if (IS_ENABLED(CONFIG_PCI_IOV)) 28 + if (IS_ENABLED(CONFIG_PCI_IOV)) { 29 + device_lock(&ae_dev->pdev->dev); 29 30 pci_disable_sriov(ae_dev->pdev); 31 + device_unlock(&ae_dev->pdev->dev); 32 + } 30 33 } 31 34 } 32 35 EXPORT_SYMBOL(hnae3_unregister_ae_algo_prepare);
+1 -3
drivers/net/ethernet/hisilicon/hns3/hns3_debugfs.c
··· 1293 1293 1294 1294 /* save the buffer addr until the last read operation */ 1295 1295 *save_buf = read_buf; 1296 - } 1297 1296 1298 - /* get data ready for the first time to read */ 1299 - if (!*ppos) { 1297 + /* get data ready for the first time to read */ 1300 1298 ret = hns3_dbg_read_cmd(dbg_data, hns3_dbg_cmd[index].cmd, 1301 1299 read_buf, hns3_dbg_cmd[index].buf_len); 1302 1300 if (ret)
+1 -58
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c
··· 11 11 #include <linux/irq.h> 12 12 #include <linux/ip.h> 13 13 #include <linux/ipv6.h> 14 - #include <linux/iommu.h> 15 14 #include <linux/module.h> 16 15 #include <linux/pci.h> 17 16 #include <linux/skbuff.h> ··· 379 380 380 381 #define HNS3_INVALID_PTYPE \ 381 382 ARRAY_SIZE(hns3_rx_ptype_tbl) 382 - 383 - static void hns3_dma_map_sync(struct device *dev, unsigned long iova) 384 - { 385 - struct iommu_domain *domain = iommu_get_domain_for_dev(dev); 386 - struct iommu_iotlb_gather iotlb_gather; 387 - size_t granule; 388 - 389 - if (!domain || !iommu_is_dma_domain(domain)) 390 - return; 391 - 392 - granule = 1 << __ffs(domain->pgsize_bitmap); 393 - iova = ALIGN_DOWN(iova, granule); 394 - iotlb_gather.start = iova; 395 - iotlb_gather.end = iova + granule - 1; 396 - iotlb_gather.pgsize = granule; 397 - 398 - iommu_iotlb_sync(domain, &iotlb_gather); 399 - } 400 383 401 384 static irqreturn_t hns3_irq_handle(int irq, void *vector) 402 385 { ··· 1032 1051 static void hns3_init_tx_spare_buffer(struct hns3_enet_ring *ring) 1033 1052 { 1034 1053 u32 alloc_size = ring->tqp->handle->kinfo.tx_spare_buf_size; 1035 - struct net_device *netdev = ring_to_netdev(ring); 1036 - struct hns3_nic_priv *priv = netdev_priv(netdev); 1037 1054 struct hns3_tx_spare *tx_spare; 1038 1055 struct page *page; 1039 1056 dma_addr_t dma; ··· 1073 1094 tx_spare->buf = page_address(page); 1074 1095 tx_spare->len = PAGE_SIZE << order; 1075 1096 ring->tx_spare = tx_spare; 1076 - ring->tx_copybreak = priv->tx_copybreak; 1077 1097 return; 1078 1098 1079 1099 dma_mapping_error: ··· 1724 1746 unsigned int type) 1725 1747 { 1726 1748 struct hns3_desc_cb *desc_cb = &ring->desc_cb[ring->next_to_use]; 1727 - struct hnae3_handle *handle = ring->tqp->handle; 1728 1749 struct device *dev = ring_to_dev(ring); 1729 - struct hnae3_ae_dev *ae_dev; 1730 1750 unsigned int size; 1731 1751 dma_addr_t dma; 1732 1752 ··· 1755 1779 hns3_ring_stats_update(ring, sw_err_cnt); 1756 1780 return -ENOMEM; 1757 1781 } 1758 - 1759 - /* Add a SYNC command to sync io-pgtale to avoid errors in pgtable 1760 - * prefetch 1761 - */ 1762 - ae_dev = hns3_get_ae_dev(handle); 1763 - if (ae_dev->dev_version >= HNAE3_DEVICE_VERSION_V3) 1764 - hns3_dma_map_sync(dev, dma); 1765 1782 1766 1783 desc_cb->priv = priv; 1767 1784 desc_cb->length = size; ··· 2452 2483 return ret; 2453 2484 } 2454 2485 2486 + netdev->features = features; 2455 2487 return 0; 2456 2488 } 2457 2489 ··· 4868 4898 devm_kfree(&pdev->dev, priv->tqp_vector); 4869 4899 } 4870 4900 4871 - static void hns3_update_tx_spare_buf_config(struct hns3_nic_priv *priv) 4872 - { 4873 - #define HNS3_MIN_SPARE_BUF_SIZE (2 * 1024 * 1024) 4874 - #define HNS3_MAX_PACKET_SIZE (64 * 1024) 4875 - 4876 - struct iommu_domain *domain = iommu_get_domain_for_dev(priv->dev); 4877 - struct hnae3_ae_dev *ae_dev = hns3_get_ae_dev(priv->ae_handle); 4878 - struct hnae3_handle *handle = priv->ae_handle; 4879 - 4880 - if (ae_dev->dev_version < HNAE3_DEVICE_VERSION_V3) 4881 - return; 4882 - 4883 - if (!(domain && iommu_is_dma_domain(domain))) 4884 - return; 4885 - 4886 - priv->min_tx_copybreak = HNS3_MAX_PACKET_SIZE; 4887 - priv->min_tx_spare_buf_size = HNS3_MIN_SPARE_BUF_SIZE; 4888 - 4889 - if (priv->tx_copybreak < priv->min_tx_copybreak) 4890 - priv->tx_copybreak = priv->min_tx_copybreak; 4891 - if (handle->kinfo.tx_spare_buf_size < priv->min_tx_spare_buf_size) 4892 - handle->kinfo.tx_spare_buf_size = priv->min_tx_spare_buf_size; 4893 - } 4894 - 4895 4901 static void hns3_ring_get_cfg(struct hnae3_queue *q, struct hns3_nic_priv *priv, 4896 4902 unsigned int ring_type) 4897 4903 { ··· 5101 5155 int i, j; 5102 5156 int ret; 5103 5157 5104 - hns3_update_tx_spare_buf_config(priv); 5105 5158 for (i = 0; i < ring_num; i++) { 5106 5159 ret = hns3_alloc_ring_memory(&priv->ring[i]); 5107 5160 if (ret) { ··· 5305 5360 priv->ae_handle = handle; 5306 5361 priv->tx_timeout_count = 0; 5307 5362 priv->max_non_tso_bd_num = ae_dev->dev_specs.max_non_tso_bd_num; 5308 - priv->min_tx_copybreak = 0; 5309 - priv->min_tx_spare_buf_size = 0; 5310 5363 set_bit(HNS3_NIC_STATE_DOWN, &priv->state); 5311 5364 5312 5365 handle->msg_enable = netif_msg_init(debug, DEFAULT_MSG_LEVEL);
-2
drivers/net/ethernet/hisilicon/hns3/hns3_enet.h
··· 596 596 struct hns3_enet_coalesce rx_coal; 597 597 u32 tx_copybreak; 598 598 u32 rx_copybreak; 599 - u32 min_tx_copybreak; 600 - u32 min_tx_spare_buf_size; 601 599 }; 602 600 603 601 union l3_hdr_info {
-33
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c
··· 1913 1913 return ret; 1914 1914 } 1915 1915 1916 - static int hns3_check_tx_copybreak(struct net_device *netdev, u32 copybreak) 1917 - { 1918 - struct hns3_nic_priv *priv = netdev_priv(netdev); 1919 - 1920 - if (copybreak < priv->min_tx_copybreak) { 1921 - netdev_err(netdev, "tx copybreak %u should be no less than %u!\n", 1922 - copybreak, priv->min_tx_copybreak); 1923 - return -EINVAL; 1924 - } 1925 - return 0; 1926 - } 1927 - 1928 - static int hns3_check_tx_spare_buf_size(struct net_device *netdev, u32 buf_size) 1929 - { 1930 - struct hns3_nic_priv *priv = netdev_priv(netdev); 1931 - 1932 - if (buf_size < priv->min_tx_spare_buf_size) { 1933 - netdev_err(netdev, 1934 - "tx spare buf size %u should be no less than %u!\n", 1935 - buf_size, priv->min_tx_spare_buf_size); 1936 - return -EINVAL; 1937 - } 1938 - return 0; 1939 - } 1940 - 1941 1916 static int hns3_set_tunable(struct net_device *netdev, 1942 1917 const struct ethtool_tunable *tuna, 1943 1918 const void *data) ··· 1929 1954 1930 1955 switch (tuna->id) { 1931 1956 case ETHTOOL_TX_COPYBREAK: 1932 - ret = hns3_check_tx_copybreak(netdev, *(u32 *)data); 1933 - if (ret) 1934 - return ret; 1935 - 1936 1957 priv->tx_copybreak = *(u32 *)data; 1937 1958 1938 1959 for (i = 0; i < h->kinfo.num_tqps; i++) ··· 1943 1972 1944 1973 break; 1945 1974 case ETHTOOL_TX_COPYBREAK_BUF_SIZE: 1946 - ret = hns3_check_tx_spare_buf_size(netdev, *(u32 *)data); 1947 - if (ret) 1948 - return ret; 1949 - 1950 1975 old_tx_spare_buf_size = h->kinfo.tx_spare_buf_size; 1951 1976 new_tx_spare_buf_size = *(u32 *)data; 1952 1977 netdev_info(netdev, "request to set tx spare buf size from %u to %u\n",
+9 -36
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c
··· 6 6 #include <linux/etherdevice.h> 7 7 #include <linux/init.h> 8 8 #include <linux/interrupt.h> 9 - #include <linux/irq.h> 10 9 #include <linux/kernel.h> 11 10 #include <linux/module.h> 12 11 #include <linux/netdevice.h> ··· 3574 3575 return ret; 3575 3576 } 3576 3577 3577 - static void hclge_set_reset_pending(struct hclge_dev *hdev, 3578 - enum hnae3_reset_type reset_type) 3579 - { 3580 - /* When an incorrect reset type is executed, the get_reset_level 3581 - * function generates the HNAE3_NONE_RESET flag. As a result, this 3582 - * type do not need to pending. 3583 - */ 3584 - if (reset_type != HNAE3_NONE_RESET) 3585 - set_bit(reset_type, &hdev->reset_pending); 3586 - } 3587 - 3588 3578 static u32 hclge_check_event_cause(struct hclge_dev *hdev, u32 *clearval) 3589 3579 { 3590 3580 u32 cmdq_src_reg, msix_src_reg, hw_err_src_reg; ··· 3594 3606 */ 3595 3607 if (BIT(HCLGE_VECTOR0_IMPRESET_INT_B) & msix_src_reg) { 3596 3608 dev_info(&hdev->pdev->dev, "IMP reset interrupt\n"); 3597 - hclge_set_reset_pending(hdev, HNAE3_IMP_RESET); 3609 + set_bit(HNAE3_IMP_RESET, &hdev->reset_pending); 3598 3610 set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state); 3599 3611 *clearval = BIT(HCLGE_VECTOR0_IMPRESET_INT_B); 3600 3612 hdev->rst_stats.imp_rst_cnt++; ··· 3604 3616 if (BIT(HCLGE_VECTOR0_GLOBALRESET_INT_B) & msix_src_reg) { 3605 3617 dev_info(&hdev->pdev->dev, "global reset interrupt\n"); 3606 3618 set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state); 3607 - hclge_set_reset_pending(hdev, HNAE3_GLOBAL_RESET); 3619 + set_bit(HNAE3_GLOBAL_RESET, &hdev->reset_pending); 3608 3620 *clearval = BIT(HCLGE_VECTOR0_GLOBALRESET_INT_B); 3609 3621 hdev->rst_stats.global_rst_cnt++; 3610 3622 return HCLGE_VECTOR0_EVENT_RST; ··· 3759 3771 snprintf(hdev->misc_vector.name, HNAE3_INT_NAME_LEN, "%s-misc-%s", 3760 3772 HCLGE_NAME, pci_name(hdev->pdev)); 3761 3773 ret = request_irq(hdev->misc_vector.vector_irq, hclge_misc_irq_handle, 3762 - IRQ_NOAUTOEN, hdev->misc_vector.name, hdev); 3774 + 0, hdev->misc_vector.name, hdev); 3763 3775 if (ret) { 3764 3776 hclge_free_vector(hdev, 0); 3765 3777 dev_err(&hdev->pdev->dev, "request misc irq(%d) fail\n", ··· 4052 4064 case HNAE3_FUNC_RESET: 4053 4065 dev_info(&pdev->dev, "PF reset requested\n"); 4054 4066 /* schedule again to check later */ 4055 - hclge_set_reset_pending(hdev, HNAE3_FUNC_RESET); 4067 + set_bit(HNAE3_FUNC_RESET, &hdev->reset_pending); 4056 4068 hclge_reset_task_schedule(hdev); 4057 4069 break; 4058 4070 default: ··· 4085 4097 rst_level = HNAE3_FLR_RESET; 4086 4098 clear_bit(HNAE3_FLR_RESET, addr); 4087 4099 } 4088 - 4089 - clear_bit(HNAE3_NONE_RESET, addr); 4090 4100 4091 4101 if (hdev->reset_type != HNAE3_NONE_RESET && 4092 4102 rst_level < hdev->reset_type) ··· 4227 4241 return false; 4228 4242 } else if (hdev->rst_stats.reset_fail_cnt < MAX_RESET_FAIL_CNT) { 4229 4243 hdev->rst_stats.reset_fail_cnt++; 4230 - hclge_set_reset_pending(hdev, hdev->reset_type); 4244 + set_bit(hdev->reset_type, &hdev->reset_pending); 4231 4245 dev_info(&hdev->pdev->dev, 4232 4246 "re-schedule reset task(%u)\n", 4233 4247 hdev->rst_stats.reset_fail_cnt); ··· 4470 4484 static void hclge_set_def_reset_request(struct hnae3_ae_dev *ae_dev, 4471 4485 enum hnae3_reset_type rst_type) 4472 4486 { 4473 - #define HCLGE_SUPPORT_RESET_TYPE \ 4474 - (BIT(HNAE3_FLR_RESET) | BIT(HNAE3_FUNC_RESET) | \ 4475 - BIT(HNAE3_GLOBAL_RESET) | BIT(HNAE3_IMP_RESET)) 4476 - 4477 4487 struct hclge_dev *hdev = ae_dev->priv; 4478 - 4479 - if (!(BIT(rst_type) & HCLGE_SUPPORT_RESET_TYPE)) { 4480 - /* To prevent reset triggered by hclge_reset_event */ 4481 - set_bit(HNAE3_NONE_RESET, &hdev->default_reset_request); 4482 - dev_warn(&hdev->pdev->dev, "unsupported reset type %d\n", 4483 - rst_type); 4484 - return; 4485 - } 4486 4488 4487 4489 set_bit(rst_type, &hdev->default_reset_request); 4488 4490 } ··· 11881 11907 11882 11908 hclge_init_rxd_adv_layout(hdev); 11883 11909 11910 + /* Enable MISC vector(vector0) */ 11911 + hclge_enable_vector(&hdev->misc_vector, true); 11912 + 11884 11913 ret = hclge_init_wol(hdev); 11885 11914 if (ret) 11886 11915 dev_warn(&pdev->dev, ··· 11895 11918 11896 11919 hclge_state_init(hdev); 11897 11920 hdev->last_reset_time = jiffies; 11898 - 11899 - /* Enable MISC vector(vector0) */ 11900 - enable_irq(hdev->misc_vector.vector_irq); 11901 - hclge_enable_vector(&hdev->misc_vector, true); 11902 11921 11903 11922 dev_info(&hdev->pdev->dev, "%s driver initialization finished.\n", 11904 11923 HCLGE_DRIVER_NAME); ··· 12301 12328 12302 12329 /* Disable MISC vector(vector0) */ 12303 12330 hclge_enable_vector(&hdev->misc_vector, false); 12304 - disable_irq(hdev->misc_vector.vector_irq); 12331 + synchronize_irq(hdev->misc_vector.vector_irq); 12305 12332 12306 12333 /* Disable all hw interrupts */ 12307 12334 hclge_config_mac_tnl_int(hdev, false);
-3
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_ptp.c
··· 58 58 struct hclge_dev *hdev = vport->back; 59 59 struct hclge_ptp *ptp = hdev->ptp; 60 60 61 - if (!ptp) 62 - return false; 63 - 64 61 if (!test_bit(HCLGE_PTP_FLAG_TX_EN, &ptp->flags) || 65 62 test_and_set_bit(HCLGE_STATE_PTP_TX_HANDLING, &hdev->state)) { 66 63 ptp->tx_skipped++;
+4 -5
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_regs.c
··· 510 510 static int hclge_fetch_pf_reg(struct hclge_dev *hdev, void *data, 511 511 struct hnae3_knic_private_info *kinfo) 512 512 { 513 + #define HCLGE_RING_REG_OFFSET 0x200 513 514 #define HCLGE_RING_INT_REG_OFFSET 0x4 514 515 515 - struct hnae3_queue *tqp; 516 516 int i, j, reg_num; 517 517 int data_num_sum; 518 518 u32 *reg = data; ··· 533 533 reg_num = ARRAY_SIZE(ring_reg_addr_list); 534 534 for (j = 0; j < kinfo->num_tqps; j++) { 535 535 reg += hclge_reg_get_tlv(HCLGE_REG_TAG_RING, reg_num, reg); 536 - tqp = kinfo->tqp[j]; 537 536 for (i = 0; i < reg_num; i++) 538 - *reg++ = readl_relaxed(tqp->io_base - 539 - HCLGE_TQP_REG_OFFSET + 540 - ring_reg_addr_list[i]); 537 + *reg++ = hclge_read_dev(&hdev->hw, 538 + ring_reg_addr_list[i] + 539 + HCLGE_RING_REG_OFFSET * j); 541 540 } 542 541 data_num_sum += (reg_num + HCLGE_REG_TLV_SPACE) * kinfo->num_tqps; 543 542
+7 -33
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_main.c
··· 1393 1393 return ret; 1394 1394 } 1395 1395 1396 - static void hclgevf_set_reset_pending(struct hclgevf_dev *hdev, 1397 - enum hnae3_reset_type reset_type) 1398 - { 1399 - /* When an incorrect reset type is executed, the get_reset_level 1400 - * function generates the HNAE3_NONE_RESET flag. As a result, this 1401 - * type do not need to pending. 1402 - */ 1403 - if (reset_type != HNAE3_NONE_RESET) 1404 - set_bit(reset_type, &hdev->reset_pending); 1405 - } 1406 - 1407 1396 static int hclgevf_reset_wait(struct hclgevf_dev *hdev) 1408 1397 { 1409 1398 #define HCLGEVF_RESET_WAIT_US 20000 ··· 1542 1553 hdev->rst_stats.rst_fail_cnt); 1543 1554 1544 1555 if (hdev->rst_stats.rst_fail_cnt < HCLGEVF_RESET_MAX_FAIL_CNT) 1545 - hclgevf_set_reset_pending(hdev, hdev->reset_type); 1556 + set_bit(hdev->reset_type, &hdev->reset_pending); 1546 1557 1547 1558 if (hclgevf_is_reset_pending(hdev)) { 1548 1559 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); ··· 1662 1673 clear_bit(HNAE3_FLR_RESET, addr); 1663 1674 } 1664 1675 1665 - clear_bit(HNAE3_NONE_RESET, addr); 1666 - 1667 1676 return rst_level; 1668 1677 } 1669 1678 ··· 1671 1684 struct hnae3_ae_dev *ae_dev = pci_get_drvdata(pdev); 1672 1685 struct hclgevf_dev *hdev = ae_dev->priv; 1673 1686 1687 + dev_info(&hdev->pdev->dev, "received reset request from VF enet\n"); 1688 + 1674 1689 if (hdev->default_reset_request) 1675 1690 hdev->reset_level = 1676 1691 hclgevf_get_reset_level(&hdev->default_reset_request); 1677 1692 else 1678 1693 hdev->reset_level = HNAE3_VF_FUNC_RESET; 1679 - 1680 - dev_info(&hdev->pdev->dev, "received reset request from VF enet, reset level is %d\n", 1681 - hdev->reset_level); 1682 1694 1683 1695 /* reset of this VF requested */ 1684 1696 set_bit(HCLGEVF_RESET_REQUESTED, &hdev->reset_state); ··· 1689 1703 static void hclgevf_set_def_reset_request(struct hnae3_ae_dev *ae_dev, 1690 1704 enum hnae3_reset_type rst_type) 1691 1705 { 1692 - #define HCLGEVF_SUPPORT_RESET_TYPE \ 1693 - (BIT(HNAE3_VF_RESET) | BIT(HNAE3_VF_FUNC_RESET) | \ 1694 - BIT(HNAE3_VF_PF_FUNC_RESET) | BIT(HNAE3_VF_FULL_RESET) | \ 1695 - BIT(HNAE3_FLR_RESET) | BIT(HNAE3_VF_EXP_RESET)) 1696 - 1697 1706 struct hclgevf_dev *hdev = ae_dev->priv; 1698 1707 1699 - if (!(BIT(rst_type) & HCLGEVF_SUPPORT_RESET_TYPE)) { 1700 - /* To prevent reset triggered by hclge_reset_event */ 1701 - set_bit(HNAE3_NONE_RESET, &hdev->default_reset_request); 1702 - dev_info(&hdev->pdev->dev, "unsupported reset type %d\n", 1703 - rst_type); 1704 - return; 1705 - } 1706 1708 set_bit(rst_type, &hdev->default_reset_request); 1707 1709 } 1708 1710 ··· 1847 1873 */ 1848 1874 if (hdev->reset_attempts > HCLGEVF_MAX_RESET_ATTEMPTS_CNT) { 1849 1875 /* prepare for full reset of stack + pcie interface */ 1850 - hclgevf_set_reset_pending(hdev, HNAE3_VF_FULL_RESET); 1876 + set_bit(HNAE3_VF_FULL_RESET, &hdev->reset_pending); 1851 1877 1852 1878 /* "defer" schedule the reset task again */ 1853 1879 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); 1854 1880 } else { 1855 1881 hdev->reset_attempts++; 1856 1882 1857 - hclgevf_set_reset_pending(hdev, hdev->reset_level); 1883 + set_bit(hdev->reset_level, &hdev->reset_pending); 1858 1884 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); 1859 1885 } 1860 1886 hclgevf_reset_task_schedule(hdev); ··· 1977 2003 rst_ing_reg = hclgevf_read_dev(&hdev->hw, HCLGEVF_RST_ING); 1978 2004 dev_info(&hdev->pdev->dev, 1979 2005 "receive reset interrupt 0x%x!\n", rst_ing_reg); 1980 - hclgevf_set_reset_pending(hdev, HNAE3_VF_RESET); 2006 + set_bit(HNAE3_VF_RESET, &hdev->reset_pending); 1981 2007 set_bit(HCLGEVF_RESET_PENDING, &hdev->reset_state); 1982 2008 set_bit(HCLGE_COMM_STATE_CMD_DISABLE, &hdev->hw.hw.comm_state); 1983 2009 *clearval = ~(1U << HCLGEVF_VECTOR0_RST_INT_B); ··· 2287 2313 clear_bit(HCLGEVF_STATE_RST_FAIL, &hdev->state); 2288 2314 2289 2315 INIT_DELAYED_WORK(&hdev->service_task, hclgevf_service_task); 2290 - timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0); 2291 2316 2292 2317 mutex_init(&hdev->mbx_resp.mbx_mutex); 2293 2318 sema_init(&hdev->reset_sem, 1); ··· 2986 3013 HCLGEVF_DRIVER_NAME); 2987 3014 2988 3015 hclgevf_task_schedule(hdev, round_jiffies_relative(HZ)); 3016 + timer_setup(&hdev->reset_timer, hclgevf_reset_timer, 0); 2989 3017 2990 3018 return 0; 2991 3019
+4 -5
drivers/net/ethernet/hisilicon/hns3/hns3vf/hclgevf_regs.c
··· 123 123 void hclgevf_get_regs(struct hnae3_handle *handle, u32 *version, 124 124 void *data) 125 125 { 126 + #define HCLGEVF_RING_REG_OFFSET 0x200 126 127 #define HCLGEVF_RING_INT_REG_OFFSET 0x4 127 128 128 129 struct hclgevf_dev *hdev = hclgevf_ae_get_hdev(handle); 129 - struct hnae3_queue *tqp; 130 130 int i, j, reg_um; 131 131 u32 *reg = data; 132 132 ··· 147 147 reg_um = ARRAY_SIZE(ring_reg_addr_list); 148 148 for (j = 0; j < hdev->num_tqps; j++) { 149 149 reg += hclgevf_reg_get_tlv(HCLGEVF_REG_TAG_RING, reg_um, reg); 150 - tqp = &hdev->htqp[j].q; 151 150 for (i = 0; i < reg_um; i++) 152 - *reg++ = readl_relaxed(tqp->io_base - 153 - HCLGEVF_TQP_REG_OFFSET + 154 - ring_reg_addr_list[i]); 151 + *reg++ = hclgevf_read_dev(&hdev->hw, 152 + ring_reg_addr_list[i] + 153 + HCLGEVF_RING_REG_OFFSET * j); 155 154 } 156 155 157 156 reg_um = ARRAY_SIZE(tqp_intr_reg_addr_list);
+4 -13
drivers/net/ethernet/intel/e1000e/ich8lan.c
··· 1205 1205 if (ret_val) 1206 1206 goto out; 1207 1207 1208 - if (hw->mac.type != e1000_pch_mtp) { 1209 - ret_val = e1000e_force_smbus(hw); 1210 - if (ret_val) { 1211 - e_dbg("Failed to force SMBUS: %d\n", ret_val); 1212 - goto release; 1213 - } 1208 + ret_val = e1000e_force_smbus(hw); 1209 + if (ret_val) { 1210 + e_dbg("Failed to force SMBUS: %d\n", ret_val); 1211 + goto release; 1214 1212 } 1215 1213 1216 1214 /* Si workaround for ULP entry flow on i127/rev6 h/w. Enable ··· 1271 1273 } 1272 1274 1273 1275 release: 1274 - if (hw->mac.type == e1000_pch_mtp) { 1275 - ret_val = e1000e_force_smbus(hw); 1276 - if (ret_val) 1277 - e_dbg("Failed to force SMBUS over MTL system: %d\n", 1278 - ret_val); 1279 - } 1280 - 1281 1276 hw->phy.ops.release(hw); 1282 1277 out: 1283 1278 if (ret_val)
+1
drivers/net/ethernet/intel/i40e/i40e.h
··· 755 755 I40E_FILTER_ACTIVE, /* Added to switch by FW */ 756 756 I40E_FILTER_FAILED, /* Rejected by FW */ 757 757 I40E_FILTER_REMOVE, /* To be removed */ 758 + I40E_FILTER_NEW_SYNC, /* New, not sent yet, is in i40e_sync_vsi_filters() */ 758 759 /* There is no 'removed' state; the filter struct is freed */ 759 760 }; 760 761 struct i40e_mac_filter {
+1
drivers/net/ethernet/intel/i40e/i40e_debugfs.c
··· 89 89 "ACTIVE", 90 90 "FAILED", 91 91 "REMOVE", 92 + "NEW_SYNC", 92 93 }; 93 94 94 95 /**
+10 -2
drivers/net/ethernet/intel/i40e/i40e_main.c
··· 1255 1255 1256 1256 hash_for_each_safe(vsi->mac_filter_hash, bkt, h, f, hlist) { 1257 1257 if (f->state == I40E_FILTER_NEW || 1258 + f->state == I40E_FILTER_NEW_SYNC || 1258 1259 f->state == I40E_FILTER_ACTIVE) 1259 1260 ++cnt; 1260 1261 } ··· 1442 1441 1443 1442 new->f = add_head; 1444 1443 new->state = add_head->state; 1444 + if (add_head->state == I40E_FILTER_NEW) 1445 + add_head->state = I40E_FILTER_NEW_SYNC; 1445 1446 1446 1447 /* Add the new filter to the tmp list */ 1447 1448 hlist_add_head(&new->hlist, tmp_add_list); ··· 1553 1550 return -ENOMEM; 1554 1551 new_mac->f = add_head; 1555 1552 new_mac->state = add_head->state; 1553 + if (add_head->state == I40E_FILTER_NEW) 1554 + add_head->state = I40E_FILTER_NEW_SYNC; 1556 1555 1557 1556 /* Add the new filter to the tmp list */ 1558 1557 hlist_add_head(&new_mac->hlist, tmp_add_list); ··· 2442 2437 i40e_aqc_broadcast_filter(struct i40e_vsi *vsi, const char *vsi_name, 2443 2438 struct i40e_mac_filter *f) 2444 2439 { 2445 - bool enable = f->state == I40E_FILTER_NEW; 2440 + bool enable = f->state == I40E_FILTER_NEW || 2441 + f->state == I40E_FILTER_NEW_SYNC; 2446 2442 struct i40e_hw *hw = &vsi->back->hw; 2447 2443 int aq_ret; 2448 2444 ··· 2617 2611 2618 2612 /* Add it to the hash list */ 2619 2613 hlist_add_head(&new->hlist, &tmp_add_list); 2614 + f->state = I40E_FILTER_NEW_SYNC; 2620 2615 } 2621 2616 2622 2617 /* Count the number of active (current and new) VLAN ··· 2769 2762 spin_lock_bh(&vsi->mac_filter_hash_lock); 2770 2763 hlist_for_each_entry_safe(new, h, &tmp_add_list, hlist) { 2771 2764 /* Only update the state if we're still NEW */ 2772 - if (new->f->state == I40E_FILTER_NEW) 2765 + if (new->f->state == I40E_FILTER_NEW || 2766 + new->f->state == I40E_FILTER_NEW_SYNC) 2773 2767 new->f->state = new->state; 2774 2768 hlist_del(&new->hlist); 2775 2769 netdev_hw_addr_refcnt(new->f, vsi->netdev, -1);
+2 -1
drivers/net/ethernet/intel/ice/ice_eswitch.c
··· 552 552 static void ice_eswitch_detach(struct ice_pf *pf, struct ice_repr *repr) 553 553 { 554 554 ice_eswitch_stop_reprs(pf); 555 + repr->ops.rem(repr); 556 + 555 557 xa_erase(&pf->eswitch.reprs, repr->id); 556 558 557 559 if (xa_empty(&pf->eswitch.reprs)) 558 560 ice_eswitch_disable_switchdev(pf); 559 561 560 562 ice_eswitch_release_repr(pf, repr); 561 - repr->ops.rem(repr); 562 563 ice_repr_destroy(repr); 563 564 564 565 if (xa_empty(&pf->eswitch.reprs)) {
+2 -1
drivers/net/ethernet/intel/ice/ice_ethtool_fdir.c
··· 1830 1830 ice_set_fdir_input_set(struct ice_vsi *vsi, struct ethtool_rx_flow_spec *fsp, 1831 1831 struct ice_fdir_fltr *input) 1832 1832 { 1833 - u16 dest_vsi, q_index = 0; 1833 + s16 q_index = ICE_FDIR_NO_QUEUE_IDX; 1834 1834 u16 orig_q_index = 0; 1835 1835 struct ice_pf *pf; 1836 1836 struct ice_hw *hw; 1837 1837 int flow_type; 1838 + u16 dest_vsi; 1838 1839 u8 dest_ctl; 1839 1840 1840 1841 if (!vsi || !fsp || !input)
+3 -1
drivers/net/ethernet/intel/ice/ice_fdir.h
··· 53 53 */ 54 54 #define ICE_FDIR_IPV4_PKT_FLAG_MF 0x20 55 55 56 + #define ICE_FDIR_NO_QUEUE_IDX -1 57 + 56 58 enum ice_fltr_prgm_desc_dest { 57 59 ICE_FLTR_PRGM_DESC_DEST_DROP_PKT, 58 60 ICE_FLTR_PRGM_DESC_DEST_DIRECT_PKT_QINDEX, ··· 188 186 u16 flex_fltr; 189 187 190 188 /* filter control */ 191 - u16 q_index; 189 + s16 q_index; 192 190 u16 orig_q_index; 193 191 u16 dest_vsi; 194 192 u8 dest_ctl;
+2 -2
drivers/net/ethernet/intel/idpf/idpf.h
··· 141 141 * @adapter: Adapter back pointer 142 142 * @vport: Vport back pointer 143 143 * @vport_id: Vport identifier 144 + * @link_speed_mbps: Link speed in mbps 144 145 * @vport_idx: Relative vport index 145 146 * @state: See enum idpf_vport_state 146 147 * @netstats: Packet and byte stats ··· 151 150 struct idpf_adapter *adapter; 152 151 struct idpf_vport *vport; 153 152 u32 vport_id; 153 + u32 link_speed_mbps; 154 154 u16 vport_idx; 155 155 enum idpf_vport_state state; 156 156 struct rtnl_link_stats64 netstats; ··· 289 287 * @tx_itr_profile: TX profiles for Dynamic Interrupt Moderation 290 288 * @port_stats: per port csum, header split, and other offload stats 291 289 * @link_up: True if link is up 292 - * @link_speed_mbps: Link speed in mbps 293 290 * @sw_marker_wq: workqueue for marker packets 294 291 */ 295 292 struct idpf_vport { ··· 332 331 struct idpf_port_stats port_stats; 333 332 334 333 bool link_up; 335 - u32 link_speed_mbps; 336 334 337 335 wait_queue_head_t sw_marker_wq; 338 336 };
+3 -8
drivers/net/ethernet/intel/idpf/idpf_ethtool.c
··· 1296 1296 static int idpf_get_link_ksettings(struct net_device *netdev, 1297 1297 struct ethtool_link_ksettings *cmd) 1298 1298 { 1299 - struct idpf_vport *vport; 1300 - 1301 - idpf_vport_ctrl_lock(netdev); 1302 - vport = idpf_netdev_to_vport(netdev); 1299 + struct idpf_netdev_priv *np = netdev_priv(netdev); 1303 1300 1304 1301 ethtool_link_ksettings_zero_link_mode(cmd, supported); 1305 1302 cmd->base.autoneg = AUTONEG_DISABLE; 1306 1303 cmd->base.port = PORT_NONE; 1307 - if (vport->link_up) { 1304 + if (netif_carrier_ok(netdev)) { 1308 1305 cmd->base.duplex = DUPLEX_FULL; 1309 - cmd->base.speed = vport->link_speed_mbps; 1306 + cmd->base.speed = np->link_speed_mbps; 1310 1307 } else { 1311 1308 cmd->base.duplex = DUPLEX_UNKNOWN; 1312 1309 cmd->base.speed = SPEED_UNKNOWN; 1313 1310 } 1314 - 1315 - idpf_vport_ctrl_unlock(netdev); 1316 1311 1317 1312 return 0; 1318 1313 }
+3 -2
drivers/net/ethernet/intel/idpf/idpf_lib.c
··· 1786 1786 */ 1787 1787 err = idpf_vc_core_init(adapter); 1788 1788 if (err) { 1789 + cancel_delayed_work_sync(&adapter->mbx_task); 1789 1790 idpf_deinit_dflt_mbx(adapter); 1790 1791 goto unlock_mutex; 1791 1792 } ··· 1861 1860 * mess with. Nothing below should use those variables from new_vport 1862 1861 * and should instead always refer to them in vport if they need to. 1863 1862 */ 1864 - memcpy(new_vport, vport, offsetof(struct idpf_vport, link_speed_mbps)); 1863 + memcpy(new_vport, vport, offsetof(struct idpf_vport, link_up)); 1865 1864 1866 1865 /* Adjust resource parameters prior to reallocating resources */ 1867 1866 switch (reset_cause) { ··· 1907 1906 /* Same comment as above regarding avoiding copying the wait_queues and 1908 1907 * mutexes applies here. We do not want to mess with those if possible. 1909 1908 */ 1910 - memcpy(vport, new_vport, offsetof(struct idpf_vport, link_speed_mbps)); 1909 + memcpy(vport, new_vport, offsetof(struct idpf_vport, link_up)); 1911 1910 1912 1911 if (reset_cause == IDPF_SR_Q_CHANGE) 1913 1912 idpf_vport_alloc_vec_indexes(vport);
+1 -2
drivers/net/ethernet/intel/idpf/idpf_virtchnl.c
··· 141 141 } 142 142 np = netdev_priv(vport->netdev); 143 143 144 - vport->link_speed_mbps = le32_to_cpu(v2e->link_speed); 144 + np->link_speed_mbps = le32_to_cpu(v2e->link_speed); 145 145 146 146 if (vport->link_up == v2e->link_status) 147 147 return; ··· 3063 3063 adapter->state = __IDPF_VER_CHECK; 3064 3064 if (adapter->vcxn_mngr) 3065 3065 idpf_vc_xn_shutdown(adapter->vcxn_mngr); 3066 - idpf_deinit_dflt_mbx(adapter); 3067 3066 set_bit(IDPF_HR_DRV_LOAD, adapter->flags); 3068 3067 queue_delayed_work(adapter->vc_event_wq, &adapter->vc_event_task, 3069 3068 msecs_to_jiffies(task_delay));
+1
drivers/net/ethernet/pensando/ionic/ionic_bus_pci.c
··· 394 394 err_out_pci: 395 395 ionic_dev_teardown(ionic); 396 396 ionic_clear_pci(ionic); 397 + ionic_debugfs_del_dev(ionic); 397 398 err_out: 398 399 mutex_destroy(&ionic->dev_cmd_lock); 399 400 ionic_devlink_free(ionic);
+1
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 3752 3752 /* Request the Wake IRQ in case of another line 3753 3753 * is used for WoL 3754 3754 */ 3755 + priv->wol_irq_disabled = true; 3755 3756 if (priv->wol_irq > 0 && priv->wol_irq != dev->irq) { 3756 3757 ret = request_irq(priv->wol_irq, stmmac_interrupt, 3757 3758 IRQF_SHARED, dev->name, dev);
+32 -43
drivers/net/ethernet/ti/am65-cpsw-nuss.c
··· 337 337 struct am65_cpsw_rx_chn *rx_chn = &common->rx_chns; 338 338 struct cppi5_host_desc_t *desc_rx; 339 339 struct device *dev = common->dev; 340 + struct am65_cpsw_swdata *swdata; 340 341 dma_addr_t desc_dma; 341 342 dma_addr_t buf_dma; 342 - void *swdata; 343 343 344 344 desc_rx = k3_cppi_desc_pool_alloc(rx_chn->desc_pool); 345 345 if (!desc_rx) { ··· 363 363 cppi5_hdesc_attach_buf(desc_rx, buf_dma, AM65_CPSW_MAX_PACKET_SIZE, 364 364 buf_dma, AM65_CPSW_MAX_PACKET_SIZE); 365 365 swdata = cppi5_hdesc_get_swdata(desc_rx); 366 - *((void **)swdata) = page_address(page); 366 + swdata->page = page; 367 + swdata->flow_id = flow_idx; 367 368 368 369 return k3_udma_glue_push_rx_chn(rx_chn->rx_chn, flow_idx, 369 370 desc_rx, desc_dma); ··· 520 519 521 520 static inline void am65_cpsw_put_page(struct am65_cpsw_rx_flow *flow, 522 521 struct page *page, 523 - bool allow_direct, 524 - int desc_idx) 522 + bool allow_direct) 525 523 { 526 524 page_pool_put_full_page(flow->page_pool, page, allow_direct); 527 - flow->pages[desc_idx] = NULL; 528 525 } 529 526 530 527 static void am65_cpsw_nuss_rx_cleanup(void *data, dma_addr_t desc_dma) 531 528 { 532 - struct am65_cpsw_rx_flow *flow = data; 529 + struct am65_cpsw_rx_chn *rx_chn = data; 533 530 struct cppi5_host_desc_t *desc_rx; 534 - struct am65_cpsw_rx_chn *rx_chn; 531 + struct am65_cpsw_swdata *swdata; 535 532 dma_addr_t buf_dma; 533 + struct page *page; 536 534 u32 buf_dma_len; 537 - void *page_addr; 538 - void **swdata; 539 - int desc_idx; 535 + u32 flow_id; 540 536 541 - rx_chn = &flow->common->rx_chns; 542 537 desc_rx = k3_cppi_desc_pool_dma2virt(rx_chn->desc_pool, desc_dma); 543 538 swdata = cppi5_hdesc_get_swdata(desc_rx); 544 - page_addr = *swdata; 539 + page = swdata->page; 540 + flow_id = swdata->flow_id; 545 541 cppi5_hdesc_get_obuf(desc_rx, &buf_dma, &buf_dma_len); 546 542 k3_udma_glue_rx_cppi5_to_dma_addr(rx_chn->rx_chn, &buf_dma); 547 543 dma_unmap_single(rx_chn->dma_dev, buf_dma, buf_dma_len, DMA_FROM_DEVICE); 548 544 k3_cppi_desc_pool_free(rx_chn->desc_pool, desc_rx); 549 545 550 - desc_idx = am65_cpsw_nuss_desc_idx(rx_chn->desc_pool, desc_rx, 551 - rx_chn->dsize_log2); 552 - am65_cpsw_put_page(flow, virt_to_page(page_addr), false, desc_idx); 546 + am65_cpsw_put_page(&rx_chn->flows[flow_id], page, false); 553 547 } 554 548 555 549 static void am65_cpsw_nuss_xmit_free(struct am65_cpsw_tx_chn *tx_chn, ··· 699 703 ret = -ENOMEM; 700 704 goto fail_rx; 701 705 } 702 - flow->pages[i] = page; 703 706 704 707 ret = am65_cpsw_nuss_rx_push(common, page, flow_idx); 705 708 if (ret < 0) { 706 709 dev_err(common->dev, 707 710 "cannot submit page to rx channel flow %d, error %d\n", 708 711 flow_idx, ret); 709 - am65_cpsw_put_page(flow, page, false, i); 712 + am65_cpsw_put_page(flow, page, false); 710 713 goto fail_rx; 711 714 } 712 715 } ··· 759 764 760 765 fail_rx: 761 766 for (i = 0; i < common->rx_ch_num_flows; i++) 762 - k3_udma_glue_reset_rx_chn(rx_chn->rx_chn, i, &rx_chn->flows[i], 763 - am65_cpsw_nuss_rx_cleanup, 0); 767 + k3_udma_glue_reset_rx_chn(rx_chn->rx_chn, i, rx_chn, 768 + am65_cpsw_nuss_rx_cleanup, !!i); 764 769 765 770 am65_cpsw_destroy_xdp_rxqs(common); 766 771 ··· 812 817 dev_err(common->dev, "rx teardown timeout\n"); 813 818 } 814 819 815 - for (i = 0; i < common->rx_ch_num_flows; i++) { 820 + for (i = common->rx_ch_num_flows - 1; i >= 0; i--) { 816 821 napi_disable(&rx_chn->flows[i].napi_rx); 817 822 hrtimer_cancel(&rx_chn->flows[i].rx_hrtimer); 818 - k3_udma_glue_reset_rx_chn(rx_chn->rx_chn, i, &rx_chn->flows[i], 819 - am65_cpsw_nuss_rx_cleanup, 0); 823 + k3_udma_glue_reset_rx_chn(rx_chn->rx_chn, i, rx_chn, 824 + am65_cpsw_nuss_rx_cleanup, !!i); 820 825 } 821 826 822 827 k3_udma_glue_disable_rx_chn(rx_chn->rx_chn); ··· 1023 1028 static int am65_cpsw_run_xdp(struct am65_cpsw_rx_flow *flow, 1024 1029 struct am65_cpsw_port *port, 1025 1030 struct xdp_buff *xdp, 1026 - int desc_idx, int cpu, int *len) 1031 + int cpu, int *len) 1027 1032 { 1028 1033 struct am65_cpsw_common *common = flow->common; 1029 1034 struct net_device *ndev = port->ndev; ··· 1085 1090 } 1086 1091 1087 1092 page = virt_to_head_page(xdp->data); 1088 - am65_cpsw_put_page(flow, page, true, desc_idx); 1093 + am65_cpsw_put_page(flow, page, true); 1089 1094 1090 1095 out: 1091 1096 return ret; ··· 1133 1138 struct am65_cpsw_ndev_priv *ndev_priv; 1134 1139 struct cppi5_host_desc_t *desc_rx; 1135 1140 struct device *dev = common->dev; 1141 + struct am65_cpsw_swdata *swdata; 1136 1142 struct page *page, *new_page; 1137 1143 dma_addr_t desc_dma, buf_dma; 1138 1144 struct am65_cpsw_port *port; 1139 - int headroom, desc_idx, ret; 1140 1145 struct net_device *ndev; 1141 1146 u32 flow_idx = flow->id; 1142 1147 struct sk_buff *skb; 1143 1148 struct xdp_buff xdp; 1149 + int headroom, ret; 1144 1150 void *page_addr; 1145 - void **swdata; 1146 1151 u32 *psdata; 1147 1152 1148 1153 *xdp_state = AM65_CPSW_XDP_PASS; ··· 1165 1170 __func__, flow_idx, &desc_dma); 1166 1171 1167 1172 swdata = cppi5_hdesc_get_swdata(desc_rx); 1168 - page_addr = *swdata; 1169 - page = virt_to_page(page_addr); 1173 + page = swdata->page; 1174 + page_addr = page_address(page); 1170 1175 cppi5_hdesc_get_obuf(desc_rx, &buf_dma, &buf_dma_len); 1171 1176 k3_udma_glue_rx_cppi5_to_dma_addr(rx_chn->rx_chn, &buf_dma); 1172 1177 pkt_len = cppi5_hdesc_get_pktlen(desc_rx); ··· 1182 1187 1183 1188 k3_cppi_desc_pool_free(rx_chn->desc_pool, desc_rx); 1184 1189 1185 - desc_idx = am65_cpsw_nuss_desc_idx(rx_chn->desc_pool, desc_rx, 1186 - rx_chn->dsize_log2); 1187 - 1188 1190 skb = am65_cpsw_build_skb(page_addr, ndev, 1189 1191 AM65_CPSW_MAX_PACKET_SIZE); 1190 1192 if (unlikely(!skb)) { ··· 1193 1201 xdp_init_buff(&xdp, PAGE_SIZE, &port->xdp_rxq[flow->id]); 1194 1202 xdp_prepare_buff(&xdp, page_addr, AM65_CPSW_HEADROOM, 1195 1203 pkt_len, false); 1196 - *xdp_state = am65_cpsw_run_xdp(flow, port, &xdp, desc_idx, 1204 + *xdp_state = am65_cpsw_run_xdp(flow, port, &xdp, 1197 1205 cpu, &pkt_len); 1198 1206 if (*xdp_state != AM65_CPSW_XDP_PASS) 1199 1207 goto allocate; ··· 1222 1230 return -ENOMEM; 1223 1231 } 1224 1232 1225 - flow->pages[desc_idx] = new_page; 1226 - 1227 1233 if (netif_dormant(ndev)) { 1228 - am65_cpsw_put_page(flow, new_page, true, desc_idx); 1234 + am65_cpsw_put_page(flow, new_page, true); 1229 1235 ndev->stats.rx_dropped++; 1230 1236 return 0; 1231 1237 } ··· 1231 1241 requeue: 1232 1242 ret = am65_cpsw_nuss_rx_push(common, new_page, flow_idx); 1233 1243 if (WARN_ON(ret < 0)) { 1234 - am65_cpsw_put_page(flow, new_page, true, desc_idx); 1244 + am65_cpsw_put_page(flow, new_page, true); 1235 1245 ndev->stats.rx_errors++; 1236 1246 ndev->stats.rx_dropped++; 1237 1247 } ··· 2333 2343 for (i = 0; i < common->rx_ch_num_flows; i++) { 2334 2344 flow = &rx_chn->flows[i]; 2335 2345 flow->page_pool = NULL; 2336 - flow->pages = devm_kcalloc(dev, AM65_CPSW_MAX_RX_DESC, 2337 - sizeof(*flow->pages), GFP_KERNEL); 2338 - if (!flow->pages) 2339 - return -ENOMEM; 2340 2346 } 2341 2347 2342 2348 rx_chn->rx_chn = k3_udma_glue_request_rx_chn(dev, "rx", &rx_cfg); ··· 2382 2396 flow = &rx_chn->flows[i]; 2383 2397 flow->id = i; 2384 2398 flow->common = common; 2399 + flow->irq = -EINVAL; 2385 2400 2386 2401 rx_flow_cfg.ring_rxfdq0_id = fdqring_id; 2387 2402 rx_flow_cfg.rx_cfg.size = max_desc_num; 2388 - rx_flow_cfg.rxfdq_cfg.size = max_desc_num; 2403 + /* share same FDQ for all flows */ 2404 + rx_flow_cfg.rxfdq_cfg.size = max_desc_num * rx_cfg.flow_id_num; 2389 2405 rx_flow_cfg.rxfdq_cfg.mode = common->pdata.fdqring_mode; 2390 2406 2391 2407 ret = k3_udma_glue_rx_flow_init(rx_chn->rx_chn, ··· 2425 2437 if (ret) { 2426 2438 dev_err(dev, "failure requesting rx %d irq %u, %d\n", 2427 2439 i, flow->irq, ret); 2440 + flow->irq = -EINVAL; 2428 2441 goto err; 2429 2442 } 2430 2443 } ··· 3263 3274 3264 3275 for (i = 0; i < common->rx_ch_num_flows; i++) 3265 3276 k3_udma_glue_reset_rx_chn(rx_chan->rx_chn, i, 3266 - &rx_chan->flows[i], 3267 - am65_cpsw_nuss_rx_cleanup, 0); 3277 + rx_chan, 3278 + am65_cpsw_nuss_rx_cleanup, !!i); 3268 3279 3269 3280 k3_udma_glue_disable_rx_chn(rx_chan->rx_chn); 3270 3281
+5 -1
drivers/net/ethernet/ti/am65-cpsw-nuss.h
··· 101 101 struct hrtimer rx_hrtimer; 102 102 unsigned long rx_pace_timeout; 103 103 struct page_pool *page_pool; 104 - struct page **pages; 105 104 char name[32]; 105 + }; 106 + 107 + struct am65_cpsw_swdata { 108 + u32 flow_id; 109 + struct page *page; 106 110 }; 107 111 108 112 struct am65_cpsw_rx_chn {
+3 -2
drivers/net/ethernet/vertexcom/mse102x.c
··· 222 222 struct mse102x_net_spi *mses = to_mse102x_spi(mse); 223 223 struct spi_transfer *xfer = &mses->spi_xfer; 224 224 struct spi_message *msg = &mses->spi_msg; 225 - struct sk_buff *tskb; 225 + struct sk_buff *tskb = NULL; 226 226 int ret; 227 227 228 228 netif_dbg(mse, tx_queued, mse->ndev, "%s: skb %p, %d@%p\n", ··· 235 235 if (!tskb) 236 236 return -ENOMEM; 237 237 238 - dev_kfree_skb(txp); 239 238 txp = tskb; 240 239 } 241 240 ··· 255 256 __func__, ret); 256 257 mse->stats.xfer_err++; 257 258 } 259 + 260 + dev_kfree_skb(tskb); 258 261 259 262 return ret; 260 263 }
+2 -2
drivers/net/ethernet/xilinx/xilinx_axienet_main.c
··· 924 924 skbuf_dma->sg_len = sg_len; 925 925 dma_tx_desc->callback_param = lp; 926 926 dma_tx_desc->callback_result = axienet_dma_tx_cb; 927 - dmaengine_submit(dma_tx_desc); 928 - dma_async_issue_pending(lp->tx_chan); 929 927 txq = skb_get_tx_queue(lp->ndev, skb); 930 928 netdev_tx_sent_queue(txq, skb->len); 931 929 netif_txq_maybe_stop(txq, CIRC_SPACE(lp->tx_ring_head, lp->tx_ring_tail, TX_BD_NUM_MAX), 932 930 MAX_SKB_FRAGS + 1, 2 * MAX_SKB_FRAGS); 933 931 932 + dmaengine_submit(dma_tx_desc); 933 + dma_async_issue_pending(lp->tx_chan); 934 934 return NETDEV_TX_OK; 935 935 936 936 xmit_error_unmap_sg:
+2
drivers/net/phy/dp83848.c
··· 147 147 /* IRQ related */ \ 148 148 .config_intr = dp83848_config_intr, \ 149 149 .handle_interrupt = dp83848_handle_interrupt, \ 150 + \ 151 + .flags = PHY_RST_AFTER_CLK_EN, \ 150 152 } 151 153 152 154 static struct phy_driver dp83848_driver[] = {
+100 -19
drivers/net/virtio_net.c
··· 365 365 * because table sizes may be differ according to the device configuration. 366 366 */ 367 367 #define VIRTIO_NET_RSS_MAX_KEY_SIZE 40 368 - #define VIRTIO_NET_RSS_MAX_TABLE_LEN 128 369 368 struct virtio_net_ctrl_rss { 370 369 u32 hash_types; 371 370 u16 indirection_table_mask; 372 371 u16 unclassified_queue; 373 - u16 indirection_table[VIRTIO_NET_RSS_MAX_TABLE_LEN]; 372 + u16 hash_cfg_reserved; /* for HASH_CONFIG (see virtio_net_hash_config for details) */ 374 373 u16 max_tx_vq; 375 374 u8 hash_key_length; 376 375 u8 key[VIRTIO_NET_RSS_MAX_KEY_SIZE]; 376 + 377 + u16 *indirection_table; 377 378 }; 378 379 379 380 /* Control VQ buffers: protected by the rtnl lock */ ··· 509 508 struct sk_buff *curr_skb, 510 509 struct page *page, void *buf, 511 510 int len, int truesize); 511 + 512 + static int rss_indirection_table_alloc(struct virtio_net_ctrl_rss *rss, u16 indir_table_size) 513 + { 514 + if (!indir_table_size) { 515 + rss->indirection_table = NULL; 516 + return 0; 517 + } 518 + 519 + rss->indirection_table = kmalloc_array(indir_table_size, sizeof(u16), GFP_KERNEL); 520 + if (!rss->indirection_table) 521 + return -ENOMEM; 522 + 523 + return 0; 524 + } 525 + 526 + static void rss_indirection_table_free(struct virtio_net_ctrl_rss *rss) 527 + { 528 + kfree(rss->indirection_table); 529 + } 512 530 513 531 static bool is_xdp_frame(void *ptr) 514 532 { ··· 3400 3380 dev_warn(&vi->dev->dev, "Failed to ack link announce.\n"); 3401 3381 } 3402 3382 3383 + static bool virtnet_commit_rss_command(struct virtnet_info *vi); 3384 + 3385 + static void virtnet_rss_update_by_qpairs(struct virtnet_info *vi, u16 queue_pairs) 3386 + { 3387 + u32 indir_val = 0; 3388 + int i = 0; 3389 + 3390 + for (; i < vi->rss_indir_table_size; ++i) { 3391 + indir_val = ethtool_rxfh_indir_default(i, queue_pairs); 3392 + vi->rss.indirection_table[i] = indir_val; 3393 + } 3394 + vi->rss.max_tx_vq = queue_pairs; 3395 + } 3396 + 3403 3397 static int virtnet_set_queues(struct virtnet_info *vi, u16 queue_pairs) 3404 3398 { 3405 3399 struct virtio_net_ctrl_mq *mq __free(kfree) = NULL; 3406 - struct scatterlist sg; 3400 + struct virtio_net_ctrl_rss old_rss; 3407 3401 struct net_device *dev = vi->dev; 3402 + struct scatterlist sg; 3408 3403 3409 3404 if (!vi->has_cvq || !virtio_has_feature(vi->vdev, VIRTIO_NET_F_MQ)) 3410 3405 return 0; 3406 + 3407 + /* Firstly check if we need update rss. Do updating if both (1) rss enabled and 3408 + * (2) no user configuration. 3409 + * 3410 + * During rss command processing, device updates queue_pairs using rss.max_tx_vq. That is, 3411 + * the device updates queue_pairs together with rss, so we can skip the sperate queue_pairs 3412 + * update (VIRTIO_NET_CTRL_MQ_VQ_PAIRS_SET below) and return directly. 3413 + */ 3414 + if (vi->has_rss && !netif_is_rxfh_configured(dev)) { 3415 + memcpy(&old_rss, &vi->rss, sizeof(old_rss)); 3416 + if (rss_indirection_table_alloc(&vi->rss, vi->rss_indir_table_size)) { 3417 + vi->rss.indirection_table = old_rss.indirection_table; 3418 + return -ENOMEM; 3419 + } 3420 + 3421 + virtnet_rss_update_by_qpairs(vi, queue_pairs); 3422 + 3423 + if (!virtnet_commit_rss_command(vi)) { 3424 + /* restore ctrl_rss if commit_rss_command failed */ 3425 + rss_indirection_table_free(&vi->rss); 3426 + memcpy(&vi->rss, &old_rss, sizeof(old_rss)); 3427 + 3428 + dev_warn(&dev->dev, "Fail to set num of queue pairs to %d, because committing RSS failed\n", 3429 + queue_pairs); 3430 + return -EINVAL; 3431 + } 3432 + rss_indirection_table_free(&old_rss); 3433 + goto succ; 3434 + } 3411 3435 3412 3436 mq = kzalloc(sizeof(*mq), GFP_KERNEL); 3413 3437 if (!mq) ··· 3465 3401 dev_warn(&dev->dev, "Fail to set num of queue pairs to %d\n", 3466 3402 queue_pairs); 3467 3403 return -EINVAL; 3468 - } else { 3469 - vi->curr_queue_pairs = queue_pairs; 3470 - /* virtnet_open() will refill when device is going to up. */ 3471 - if (dev->flags & IFF_UP) 3472 - schedule_delayed_work(&vi->refill, 0); 3473 3404 } 3405 + succ: 3406 + vi->curr_queue_pairs = queue_pairs; 3407 + /* virtnet_open() will refill when device is going to up. */ 3408 + if (dev->flags & IFF_UP) 3409 + schedule_delayed_work(&vi->refill, 0); 3474 3410 3475 3411 return 0; 3476 3412 } ··· 3898 3834 /* prepare sgs */ 3899 3835 sg_init_table(sgs, 4); 3900 3836 3901 - sg_buf_size = offsetof(struct virtio_net_ctrl_rss, indirection_table); 3837 + sg_buf_size = offsetof(struct virtio_net_ctrl_rss, hash_cfg_reserved); 3902 3838 sg_set_buf(&sgs[0], &vi->rss, sg_buf_size); 3903 3839 3904 - sg_buf_size = sizeof(uint16_t) * (vi->rss.indirection_table_mask + 1); 3905 - sg_set_buf(&sgs[1], vi->rss.indirection_table, sg_buf_size); 3840 + if (vi->has_rss) { 3841 + sg_buf_size = sizeof(uint16_t) * vi->rss_indir_table_size; 3842 + sg_set_buf(&sgs[1], vi->rss.indirection_table, sg_buf_size); 3843 + } else { 3844 + sg_set_buf(&sgs[1], &vi->rss.hash_cfg_reserved, sizeof(uint16_t)); 3845 + } 3906 3846 3907 3847 sg_buf_size = offsetof(struct virtio_net_ctrl_rss, key) 3908 3848 - offsetof(struct virtio_net_ctrl_rss, max_tx_vq); ··· 3930 3862 3931 3863 static void virtnet_init_default_rss(struct virtnet_info *vi) 3932 3864 { 3933 - u32 indir_val = 0; 3934 - int i = 0; 3935 - 3936 3865 vi->rss.hash_types = vi->rss_hash_types_supported; 3937 3866 vi->rss_hash_types_saved = vi->rss_hash_types_supported; 3938 3867 vi->rss.indirection_table_mask = vi->rss_indir_table_size 3939 3868 ? vi->rss_indir_table_size - 1 : 0; 3940 3869 vi->rss.unclassified_queue = 0; 3941 3870 3942 - for (; i < vi->rss_indir_table_size; ++i) { 3943 - indir_val = ethtool_rxfh_indir_default(i, vi->curr_queue_pairs); 3944 - vi->rss.indirection_table[i] = indir_val; 3945 - } 3871 + virtnet_rss_update_by_qpairs(vi, vi->curr_queue_pairs); 3946 3872 3947 - vi->rss.max_tx_vq = vi->has_rss ? vi->curr_queue_pairs : 0; 3948 3873 vi->rss.hash_key_length = vi->rss_key_size; 3949 3874 3950 3875 netdev_rss_key_fill(vi->rss.key, vi->rss_key_size); ··· 6500 6439 virtio_cread16(vdev, offsetof(struct virtio_net_config, 6501 6440 rss_max_indirection_table_length)); 6502 6441 } 6442 + err = rss_indirection_table_alloc(&vi->rss, vi->rss_indir_table_size); 6443 + if (err) 6444 + goto free; 6503 6445 6504 6446 if (vi->has_rss || vi->has_rss_hash_report) { 6505 6447 vi->rss_key_size = 6506 6448 virtio_cread8(vdev, offsetof(struct virtio_net_config, rss_max_key_size)); 6449 + if (vi->rss_key_size > VIRTIO_NET_RSS_MAX_KEY_SIZE) { 6450 + dev_err(&vdev->dev, "rss_max_key_size=%u exceeds the limit %u.\n", 6451 + vi->rss_key_size, VIRTIO_NET_RSS_MAX_KEY_SIZE); 6452 + err = -EINVAL; 6453 + goto free; 6454 + } 6507 6455 6508 6456 vi->rss_hash_types_supported = 6509 6457 virtio_cread32(vdev, offsetof(struct virtio_net_config, supported_hash_types)); ··· 6640 6570 6641 6571 virtio_device_ready(vdev); 6642 6572 6573 + if (vi->has_rss || vi->has_rss_hash_report) { 6574 + if (!virtnet_commit_rss_command(vi)) { 6575 + dev_warn(&vdev->dev, "RSS disabled because committing failed.\n"); 6576 + dev->hw_features &= ~NETIF_F_RXHASH; 6577 + vi->has_rss_hash_report = false; 6578 + vi->has_rss = false; 6579 + } 6580 + } 6581 + 6643 6582 virtnet_set_queues(vi, vi->curr_queue_pairs); 6644 6583 6645 6584 /* a random MAC address has been assigned, notify the device. ··· 6771 6692 net_failover_destroy(vi->failover); 6772 6693 6773 6694 remove_vq_common(vi); 6695 + 6696 + rss_indirection_table_free(&vi->rss); 6774 6697 6775 6698 free_netdev(vi->dev); 6776 6699 }
+1 -1
drivers/net/wwan/t7xx/t7xx_hif_dpmaif_rx.c
··· 226 226 return 0; 227 227 228 228 err_unmap_skbs: 229 - while (--i > 0) 229 + while (i--) 230 230 t7xx_unmap_bat_skb(dpmaif_ctrl->dev, bat_req->bat_skb, i); 231 231 232 232 return ret;
+42 -14
drivers/nvme/host/core.c
··· 92 92 "secondary APST latency tolerance in us"); 93 93 94 94 /* 95 + * Older kernels didn't enable protection information if it was at an offset. 96 + * Newer kernels do, so it breaks reads on the upgrade if such formats were 97 + * used in prior kernels since the metadata written did not contain a valid 98 + * checksum. 99 + */ 100 + static bool disable_pi_offsets = false; 101 + module_param(disable_pi_offsets, bool, 0444); 102 + MODULE_PARM_DESC(disable_pi_offsets, 103 + "disable protection information if it has an offset"); 104 + 105 + /* 95 106 * nvme_wq - hosts nvme related works that are not reset or delete 96 107 * nvme_reset_wq - hosts nvme reset works 97 108 * nvme_delete_wq - hosts nvme delete works ··· 1401 1390 nvme_start_keep_alive(ctrl); 1402 1391 } 1403 1392 1404 - /* 1405 - * In NVMe 1.0 the CNS field was just a binary controller or namespace 1406 - * flag, thus sending any new CNS opcodes has a big chance of not working. 1407 - * Qemu unfortunately had that bug after reporting a 1.1 version compliance 1408 - * (but not for any later version). 1409 - */ 1410 - static bool nvme_ctrl_limited_cns(struct nvme_ctrl *ctrl) 1393 + static bool nvme_id_cns_ok(struct nvme_ctrl *ctrl, u8 cns) 1411 1394 { 1412 - if (ctrl->quirks & NVME_QUIRK_IDENTIFY_CNS) 1413 - return ctrl->vs < NVME_VS(1, 2, 0); 1414 - return ctrl->vs < NVME_VS(1, 1, 0); 1395 + /* 1396 + * The CNS field occupies a full byte starting with NVMe 1.2 1397 + */ 1398 + if (ctrl->vs >= NVME_VS(1, 2, 0)) 1399 + return true; 1400 + 1401 + /* 1402 + * NVMe 1.1 expanded the CNS value to two bits, which means values 1403 + * larger than that could get truncated and treated as an incorrect 1404 + * value. 1405 + * 1406 + * Qemu implemented 1.0 behavior for controllers claiming 1.1 1407 + * compliance, so they need to be quirked here. 1408 + */ 1409 + if (ctrl->vs >= NVME_VS(1, 1, 0) && 1410 + !(ctrl->quirks & NVME_QUIRK_IDENTIFY_CNS)) 1411 + return cns <= 3; 1412 + 1413 + /* 1414 + * NVMe 1.0 used a single bit for the CNS value. 1415 + */ 1416 + return cns <= 1; 1415 1417 } 1416 1418 1417 1419 static int nvme_identify_ctrl(struct nvme_ctrl *dev, struct nvme_id_ctrl **id) ··· 1937 1913 1938 1914 if (head->pi_size && head->ms >= head->pi_size) 1939 1915 head->pi_type = id->dps & NVME_NS_DPS_PI_MASK; 1940 - if (!(id->dps & NVME_NS_DPS_PI_FIRST)) 1941 - info->pi_offset = head->ms - head->pi_size; 1916 + if (!(id->dps & NVME_NS_DPS_PI_FIRST)) { 1917 + if (disable_pi_offsets) 1918 + head->pi_type = 0; 1919 + else 1920 + info->pi_offset = head->ms - head->pi_size; 1921 + } 1942 1922 1943 1923 if (ctrl->ops->flags & NVME_F_FABRICS) { 1944 1924 /* ··· 3132 3104 ctrl->max_zeroes_sectors = 0; 3133 3105 3134 3106 if (ctrl->subsys->subtype != NVME_NQN_NVME || 3135 - nvme_ctrl_limited_cns(ctrl) || 3107 + !nvme_id_cns_ok(ctrl, NVME_ID_CNS_CS_CTRL) || 3136 3108 test_bit(NVME_CTRL_SKIP_ID_CNS_CS, &ctrl->flags)) 3137 3109 return 0; 3138 3110 ··· 4228 4200 } 4229 4201 4230 4202 mutex_lock(&ctrl->scan_lock); 4231 - if (nvme_ctrl_limited_cns(ctrl)) { 4203 + if (!nvme_id_cns_ok(ctrl, NVME_ID_CNS_NS_ACTIVE_LIST)) { 4232 4204 nvme_scan_ns_sequential(ctrl); 4233 4205 } else { 4234 4206 /*
+5 -2
drivers/nvme/host/ioctl.c
··· 421 421 struct io_uring_cmd *ioucmd = req->end_io_data; 422 422 struct nvme_uring_cmd_pdu *pdu = nvme_uring_cmd_pdu(ioucmd); 423 423 424 - if (nvme_req(req)->flags & NVME_REQ_CANCELLED) 424 + if (nvme_req(req)->flags & NVME_REQ_CANCELLED) { 425 425 pdu->status = -EINTR; 426 - else 426 + } else { 427 427 pdu->status = nvme_req(req)->status; 428 + if (!pdu->status) 429 + pdu->status = blk_status_to_errno(err); 430 + } 428 431 pdu->result = le64_to_cpu(nvme_req(req)->result.u64); 429 432 430 433 /*
+1
drivers/nvme/target/auth.c
··· 115 115 pr_debug("%s: ctrl %d failed to generate private key, err %d\n", 116 116 __func__, ctrl->cntlid, ret); 117 117 kfree_sensitive(ctrl->dh_key); 118 + ctrl->dh_key = NULL; 118 119 return ret; 119 120 } 120 121 ctrl->dh_keysize = crypto_kpp_maxsize(ctrl->dh_tfm);
+9 -5
drivers/pci/pci.c
··· 1067 1067 static void pci_enable_acs(struct pci_dev *dev) 1068 1068 { 1069 1069 struct pci_acs caps; 1070 + bool enable_acs = false; 1070 1071 int pos; 1072 + 1073 + /* If an iommu is present we start with kernel default caps */ 1074 + if (pci_acs_enable) { 1075 + if (pci_dev_specific_enable_acs(dev)) 1076 + enable_acs = true; 1077 + } 1071 1078 1072 1079 pos = dev->acs_cap; 1073 1080 if (!pos) ··· 1084 1077 pci_read_config_word(dev, pos + PCI_ACS_CTRL, &caps.ctrl); 1085 1078 caps.fw_ctrl = caps.ctrl; 1086 1079 1087 - /* If an iommu is present we start with kernel default caps */ 1088 - if (pci_acs_enable) { 1089 - if (pci_dev_specific_enable_acs(dev)) 1090 - pci_std_enable_acs(dev, &caps); 1091 - } 1080 + if (enable_acs) 1081 + pci_std_enable_acs(dev, &caps); 1092 1082 1093 1083 /* 1094 1084 * Always apply caps from the command line, even if there is no iommu.
+9 -3
drivers/phy/broadcom/phy-brcm-usb-init-synopsys.c
··· 153 153 } else { 154 154 USB_CTRL_SET(ctrl, USB_PM, XHC_SOFT_RESETB); 155 155 /* Required for COMMONONN to be set */ 156 - USB_XHCI_GBL_UNSET(xhci_gbl, GUSB2PHYCFG, U2_FREECLK_EXISTS); 156 + if (params->supported_port_modes != USB_CTLR_MODE_DRD) 157 + USB_XHCI_GBL_UNSET(xhci_gbl, GUSB2PHYCFG, 158 + U2_FREECLK_EXISTS); 157 159 } 158 160 } 159 161 ··· 330 328 /* 1 millisecond - for USB clocks to settle down */ 331 329 usleep_range(1000, 2000); 332 330 333 - /* Disable PHY when port is suspended */ 334 - USB_CTRL_SET(ctrl, P0_U2PHY_CFG1, COMMONONN); 331 + /* 332 + * Disable PHY when port is suspended 333 + * Does not work in DRD mode 334 + */ 335 + if (params->supported_port_modes != USB_CTLR_MODE_DRD) 336 + USB_CTRL_SET(ctrl, P0_U2PHY_CFG1, COMMONONN); 335 337 336 338 usb_wake_enable_7216(params, false); 337 339 usb_init_common(params);
+2
drivers/phy/broadcom/phy-brcm-usb-init.c
··· 220 220 0, /* USB_CTRL_SETUP_SCB2_EN_MASK */ 221 221 0, /* USB_CTRL_SETUP_SS_EHCI64BIT_EN_MASK */ 222 222 0, /* USB_CTRL_SETUP_STRAP_IPP_SEL_MASK */ 223 + 0, /* USB_CTRL_SETUP_OC3_DISABLE_PORT0_MASK */ 224 + 0, /* USB_CTRL_SETUP_OC3_DISABLE_PORT1_MASK */ 223 225 0, /* USB_CTRL_SETUP_OC3_DISABLE_MASK */ 224 226 0, /* USB_CTRL_PLL_CTL_PLL_IDDQ_PWRDN_MASK */ 225 227 0, /* USB_CTRL_USB_PM_BDC_SOFT_RESETB_MASK */
+11 -10
drivers/phy/cadence/phy-cadence-sierra.c
··· 174 174 #define SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG 0x150 175 175 #define SIERRA_DEQ_TAU_CTRL2_PREG 0x151 176 176 #define SIERRA_DEQ_TAU_CTRL3_PREG 0x152 177 - #define SIERRA_DEQ_OPENEYE_CTRL_PREG 0x158 177 + #define SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG 0x158 178 178 #define SIERRA_DEQ_CONCUR_EPIOFFSET_MODE_PREG 0x159 179 + #define SIERRA_DEQ_OPENEYE_CTRL_PREG 0x15C 179 180 #define SIERRA_DEQ_PICTRL_PREG 0x161 180 181 #define SIERRA_CPICAL_TMRVAL_MODE1_PREG 0x170 181 182 #define SIERRA_CPICAL_TMRVAL_MODE0_PREG 0x171 ··· 1734 1733 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 1735 1734 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 1736 1735 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 1737 - {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 1736 + {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG}, 1738 1737 {0x002B, SIERRA_CPI_TRIM_PREG}, 1739 1738 {0x0003, SIERRA_EPI_CTRL_PREG}, 1740 1739 {0x803F, SIERRA_SDFILT_H2L_A_PREG}, ··· 1798 1797 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 1799 1798 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 1800 1799 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 1801 - {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 1800 + {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG}, 1802 1801 {0x002B, SIERRA_CPI_TRIM_PREG}, 1803 1802 {0x0003, SIERRA_EPI_CTRL_PREG}, 1804 1803 {0x803F, SIERRA_SDFILT_H2L_A_PREG}, ··· 1875 1874 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 1876 1875 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 1877 1876 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 1878 - {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 1877 + {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG}, 1879 1878 {0x002B, SIERRA_CPI_TRIM_PREG}, 1880 1879 {0x0003, SIERRA_EPI_CTRL_PREG}, 1881 1880 {0x803F, SIERRA_SDFILT_H2L_A_PREG}, ··· 1942 1941 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 1943 1942 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 1944 1943 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 1945 - {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 1944 + {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG}, 1946 1945 {0x002B, SIERRA_CPI_TRIM_PREG}, 1947 1946 {0x0003, SIERRA_EPI_CTRL_PREG}, 1948 1947 {0x803F, SIERRA_SDFILT_H2L_A_PREG}, ··· 2013 2012 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 2014 2013 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 2015 2014 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 2016 - {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 2015 + {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG}, 2017 2016 {0x002B, SIERRA_CPI_TRIM_PREG}, 2018 2017 {0x0003, SIERRA_EPI_CTRL_PREG}, 2019 2018 {0x803F, SIERRA_SDFILT_H2L_A_PREG}, ··· 2080 2079 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 2081 2080 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 2082 2081 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 2083 - {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 2082 + {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG}, 2084 2083 {0x002B, SIERRA_CPI_TRIM_PREG}, 2085 2084 {0x0003, SIERRA_EPI_CTRL_PREG}, 2086 2085 {0x803F, SIERRA_SDFILT_H2L_A_PREG}, ··· 2141 2140 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 2142 2141 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 2143 2142 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 2144 - {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 2143 + {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG}, 2145 2144 {0x002B, SIERRA_CPI_TRIM_PREG}, 2146 2145 {0x0003, SIERRA_EPI_CTRL_PREG}, 2147 2146 {0x803F, SIERRA_SDFILT_H2L_A_PREG}, ··· 2216 2215 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 2217 2216 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 2218 2217 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 2219 - {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 2218 + {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG}, 2220 2219 {0x002B, SIERRA_CPI_TRIM_PREG}, 2221 2220 {0x0003, SIERRA_EPI_CTRL_PREG}, 2222 2221 {0x803F, SIERRA_SDFILT_H2L_A_PREG}, ··· 2285 2284 {0x3C0F, SIERRA_DEQ_TAU_CTRL1_SLOW_MAINT_PREG}, 2286 2285 {0x1C0C, SIERRA_DEQ_TAU_CTRL2_PREG}, 2287 2286 {0x0100, SIERRA_DEQ_TAU_CTRL3_PREG}, 2288 - {0x5E82, SIERRA_DEQ_OPENEYE_CTRL_PREG}, 2287 + {0x5E82, SIERRA_DEQ_TAU_EPIOFFSET_MODE_PREG}, 2289 2288 {0x002B, SIERRA_CPI_TRIM_PREG}, 2290 2289 {0x0003, SIERRA_EPI_CTRL_PREG}, 2291 2290 {0x803F, SIERRA_SDFILT_H2L_A_PREG},
+5 -5
drivers/phy/freescale/phy-fsl-imx8m-pcie.c
··· 141 141 IMX8MM_GPR_PCIE_REF_CLK_PLL); 142 142 usleep_range(100, 200); 143 143 144 - /* Do the PHY common block reset */ 145 - regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14, 146 - IMX8MM_GPR_PCIE_CMN_RST, 147 - IMX8MM_GPR_PCIE_CMN_RST); 148 - 149 144 switch (imx8_phy->drvdata->variant) { 150 145 case IMX8MP: 151 146 reset_control_deassert(imx8_phy->perst); ··· 150 155 usleep_range(200, 500); 151 156 break; 152 157 } 158 + 159 + /* Do the PHY common block reset */ 160 + regmap_update_bits(imx8_phy->iomuxc_gpr, IOMUXC_GPR14, 161 + IMX8MM_GPR_PCIE_CMN_RST, 162 + IMX8MM_GPR_PCIE_CMN_RST); 153 163 154 164 /* Polling to check the phy is ready or not. */ 155 165 ret = readl_poll_timeout(imx8_phy->base + IMX8MM_PCIE_PHY_CMN_REG075,
+1 -2
drivers/phy/qualcomm/phy-qcom-qmp-combo.c
··· 3673 3673 return -ENOMEM; 3674 3674 3675 3675 qmp->dev = dev; 3676 + dev_set_drvdata(dev, qmp); 3676 3677 3677 3678 qmp->orientation = TYPEC_ORIENTATION_NORMAL; 3678 3679 ··· 3749 3748 } 3750 3749 3751 3750 phy_set_drvdata(qmp->dp_phy, qmp); 3752 - 3753 - dev_set_drvdata(dev, qmp); 3754 3751 3755 3752 if (usb_np == dev->of_node) 3756 3753 phy_provider = devm_of_phy_provider_register(dev, qmp_combo_phy_xlate);
+4 -4
drivers/phy/qualcomm/phy-qcom-qmp-pcie.c
··· 3661 3661 3662 3662 .reset_list = sdm845_pciephy_reset_l, 3663 3663 .num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l), 3664 - .vreg_list = sm8550_qmp_phy_vreg_l, 3665 - .num_vregs = ARRAY_SIZE(sm8550_qmp_phy_vreg_l), 3664 + .vreg_list = qmp_phy_vreg_l, 3665 + .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 3666 3666 .regs = pciephy_v6_regs_layout, 3667 3667 3668 3668 .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL, ··· 3695 3695 3696 3696 .reset_list = sdm845_pciephy_reset_l, 3697 3697 .num_resets = ARRAY_SIZE(sdm845_pciephy_reset_l), 3698 - .vreg_list = sm8550_qmp_phy_vreg_l, 3699 - .num_vregs = ARRAY_SIZE(sm8550_qmp_phy_vreg_l), 3698 + .vreg_list = qmp_phy_vreg_l, 3699 + .num_vregs = ARRAY_SIZE(qmp_phy_vreg_l), 3700 3700 .regs = pciephy_v6_regs_layout, 3701 3701 3702 3702 .pwrdn_ctrl = SW_PWRDN | REFCLK_DRV_DSBL,
+1
drivers/phy/qualcomm/phy-qcom-qmp-usb-legacy.c
··· 1248 1248 return -ENOMEM; 1249 1249 1250 1250 qmp->dev = dev; 1251 + dev_set_drvdata(dev, qmp); 1251 1252 1252 1253 qmp->cfg = of_device_get_match_data(dev); 1253 1254 if (!qmp->cfg)
+1
drivers/phy/qualcomm/phy-qcom-qmp-usb.c
··· 2179 2179 return -ENOMEM; 2180 2180 2181 2181 qmp->dev = dev; 2182 + dev_set_drvdata(dev, qmp); 2182 2183 2183 2184 qmp->cfg = of_device_get_match_data(dev); 2184 2185 if (!qmp->cfg)
+1
drivers/phy/qualcomm/phy-qcom-qmp-usbc.c
··· 1050 1050 return -ENOMEM; 1051 1051 1052 1052 qmp->dev = dev; 1053 + dev_set_drvdata(dev, qmp); 1053 1054 1054 1055 qmp->orientation = TYPEC_ORIENTATION_NORMAL; 1055 1056
+1
drivers/phy/rockchip/Kconfig
··· 86 86 config PHY_ROCKCHIP_SAMSUNG_HDPTX 87 87 tristate "Rockchip Samsung HDMI/eDP Combo PHY driver" 88 88 depends on (ARCH_ROCKCHIP || COMPILE_TEST) && OF 89 + depends on COMMON_CLK 89 90 depends on HAS_IOMEM 90 91 select GENERIC_PHY 91 92 select MFD_SYSCON
+16
drivers/phy/starfive/phy-jh7110-usb.c
··· 10 10 #include <linux/clk.h> 11 11 #include <linux/err.h> 12 12 #include <linux/io.h> 13 + #include <linux/mfd/syscon.h> 13 14 #include <linux/module.h> 14 15 #include <linux/phy/phy.h> 15 16 #include <linux/platform_device.h> 17 + #include <linux/regmap.h> 16 18 #include <linux/usb/of.h> 17 19 18 20 #define USB_125M_CLK_RATE 125000000 19 21 #define USB_LS_KEEPALIVE_OFF 0x4 20 22 #define USB_LS_KEEPALIVE_ENABLE BIT(4) 21 23 24 + #define USB_PDRSTN_SPLIT BIT(17) 25 + #define SYSCON_USB_SPLIT_OFFSET 0x18 26 + 22 27 struct jh7110_usb2_phy { 23 28 struct phy *phy; 24 29 void __iomem *regs; 30 + struct regmap *sys_syscon; 25 31 struct clk *usb_125m_clk; 26 32 struct clk *app_125m; 27 33 enum phy_mode mode; ··· 66 60 phy->mode = mode; 67 61 usb2_set_ls_keepalive(phy, (mode != PHY_MODE_USB_DEVICE)); 68 62 } 63 + 64 + /* Connect usb 2.0 phy mode */ 65 + regmap_update_bits(phy->sys_syscon, SYSCON_USB_SPLIT_OFFSET, 66 + USB_PDRSTN_SPLIT, USB_PDRSTN_SPLIT); 69 67 70 68 return 0; 71 69 } ··· 138 128 139 129 phy_set_drvdata(phy->phy, phy); 140 130 phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); 131 + 132 + phy->sys_syscon = 133 + syscon_regmap_lookup_by_compatible("starfive,jh7110-sys-syscon"); 134 + if (IS_ERR(phy->sys_syscon)) 135 + return dev_err_probe(dev, PTR_ERR(phy->sys_syscon), 136 + "Failed to get sys-syscon\n"); 141 137 142 138 return PTR_ERR_OR_ZERO(phy_provider); 143 139 }
+2
drivers/phy/tegra/xusb.c
··· 699 699 return -ENOMEM; 700 700 701 701 lane = tegra_xusb_find_lane(port->padctl, "usb2", port->index); 702 + if (IS_ERR(lane)) 703 + return PTR_ERR(lane); 702 704 703 705 /* 704 706 * Assign phy dev to usb-phy dev. Host/device drivers can use phy
+2 -2
drivers/phy/ti/phy-j721e-wiz.c
··· 450 450 } else if (wiz->lane_phy_type[i] == PHY_TYPE_USXGMII) { 451 451 ret = regmap_field_write(wiz->p0_mac_src_sel[i], 0x3); 452 452 ret = regmap_field_write(wiz->p0_rxfclk_sel[i], 0x3); 453 - ret = regmap_field_write(wiz->p0_refclk_sel[i], 0x3); 454 - mode = LANE_MODE_GEN1; 453 + ret = regmap_field_write(wiz->p0_refclk_sel[i], 0x2); 454 + mode = LANE_MODE_GEN2; 455 455 } else { 456 456 continue; 457 457 }
+5
drivers/platform/x86/amd/pmc/pmc.c
··· 998 998 amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_LOW, &phys_addr_low, dev->s2d_msg_id, true); 999 999 amd_pmc_send_cmd(dev, S2D_PHYS_ADDR_HIGH, &phys_addr_hi, dev->s2d_msg_id, true); 1000 1000 1001 + if (!phys_addr_hi && !phys_addr_low) { 1002 + dev_err(dev->dev, "STB is not enabled on the system; disable enable_stb or contact system vendor\n"); 1003 + return -EINVAL; 1004 + } 1005 + 1001 1006 stb_phys_addr = ((u64)phys_addr_hi << 32 | phys_addr_low); 1002 1007 1003 1008 /* Clear msg_port for other SMU operation */
+1
drivers/platform/x86/amd/pmf/core.c
··· 261 261 dev->mtable_size = sizeof(dev->m_table); 262 262 break; 263 263 case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: 264 + case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: 264 265 dev->mtable_size = sizeof(dev->m_table_v2); 265 266 break; 266 267 default:
+1
drivers/platform/x86/amd/pmf/spc.c
··· 86 86 ARRAY_SIZE(dev->m_table.avg_core_c0residency), in); 87 87 break; 88 88 case PCI_DEVICE_ID_AMD_1AH_M20H_ROOT: 89 + case PCI_DEVICE_ID_AMD_1AH_M60H_ROOT: 89 90 memcpy(&dev->m_table_v2, dev->buf, dev->mtable_size); 90 91 in->ev_info.socket_power = dev->m_table_v2.apu_power + dev->m_table_v2.dgpu_power; 91 92 in->ev_info.skin_temperature = dev->m_table_v2.skin_temp;
+1
drivers/platform/x86/dell/dell-smbios-base.c
··· 576 576 int ret, wmi, smm; 577 577 578 578 if (!dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Dell System", NULL) && 579 + !dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "Alienware", NULL) && 579 580 !dmi_find_device(DMI_DEV_TYPE_OEM_STRING, "www.dell.com", NULL)) { 580 581 pr_err("Unable to run on non-Dell system\n"); 581 582 return -ENODEV;
+6
drivers/platform/x86/dell/dell-wmi-base.c
··· 80 80 static const struct key_entry dell_wmi_keymap_type_0000[] = { 81 81 { KE_IGNORE, 0x003a, { KEY_CAPSLOCK } }, 82 82 83 + /* Meta key lock */ 84 + { KE_IGNORE, 0xe000, { KEY_RIGHTMETA } }, 85 + 86 + /* Meta key unlock */ 87 + { KE_IGNORE, 0xe001, { KEY_RIGHTMETA } }, 88 + 83 89 /* Key code is followed by brightness level */ 84 90 { KE_KEY, 0xe005, { KEY_BRIGHTNESSDOWN } }, 85 91 { KE_KEY, 0xe006, { KEY_BRIGHTNESSUP } },
+3
drivers/platform/x86/ideapad-laptop.c
··· 1294 1294 { KE_KEY, 0x27 | IDEAPAD_WMI_KEY, { KEY_HELP } }, 1295 1295 /* Refresh Rate Toggle */ 1296 1296 { KE_KEY, 0x0a | IDEAPAD_WMI_KEY, { KEY_REFRESH_RATE_TOGGLE } }, 1297 + /* Specific to some newer models */ 1298 + { KE_KEY, 0x3e | IDEAPAD_WMI_KEY, { KEY_MICMUTE } }, 1299 + { KE_KEY, 0x3f | IDEAPAD_WMI_KEY, { KEY_RFKILL } }, 1297 1300 1298 1301 { KE_END }, 1299 1302 };
+25 -3
drivers/platform/x86/thinkpad_acpi.c
··· 7936 7936 static int fan_watchdog_maxinterval; 7937 7937 7938 7938 static bool fan_with_ns_addr; 7939 + static bool ecfw_with_fan_dec_rpm; 7939 7940 7940 7941 static struct mutex fan_mutex; 7941 7942 ··· 8683 8682 if (res < 0) 8684 8683 return res; 8685 8684 8686 - return sysfs_emit(buf, "%u\n", speed); 8685 + /* Check for fan speeds displayed in hexadecimal */ 8686 + if (!ecfw_with_fan_dec_rpm) 8687 + return sysfs_emit(buf, "%u\n", speed); 8688 + else 8689 + return sysfs_emit(buf, "%x\n", speed); 8687 8690 } 8688 8691 8689 8692 static DEVICE_ATTR(fan1_input, S_IRUGO, fan_fan1_input_show, NULL); ··· 8704 8699 if (res < 0) 8705 8700 return res; 8706 8701 8707 - return sysfs_emit(buf, "%u\n", speed); 8702 + /* Check for fan speeds displayed in hexadecimal */ 8703 + if (!ecfw_with_fan_dec_rpm) 8704 + return sysfs_emit(buf, "%u\n", speed); 8705 + else 8706 + return sysfs_emit(buf, "%x\n", speed); 8708 8707 } 8709 8708 8710 8709 static DEVICE_ATTR(fan2_input, S_IRUGO, fan_fan2_input_show, NULL); ··· 8784 8775 #define TPACPI_FAN_2CTL 0x0004 /* selects fan2 control */ 8785 8776 #define TPACPI_FAN_NOFAN 0x0008 /* no fan available */ 8786 8777 #define TPACPI_FAN_NS 0x0010 /* For EC with non-Standard register addresses */ 8778 + #define TPACPI_FAN_DECRPM 0x0020 /* For ECFW's with RPM in register as decimal */ 8787 8779 8788 8780 static const struct tpacpi_quirk fan_quirk_table[] __initconst = { 8789 8781 TPACPI_QEC_IBM('1', 'Y', TPACPI_FAN_Q1), ··· 8813 8803 TPACPI_Q_LNV3('R', '1', 'D', TPACPI_FAN_NS), /* 11e Gen5 GL-R */ 8814 8804 TPACPI_Q_LNV3('R', '0', 'V', TPACPI_FAN_NS), /* 11e Gen5 KL-Y */ 8815 8805 TPACPI_Q_LNV3('N', '1', 'O', TPACPI_FAN_NOFAN), /* X1 Tablet (2nd gen) */ 8806 + TPACPI_Q_LNV3('R', '0', 'Q', TPACPI_FAN_DECRPM),/* L480 */ 8816 8807 }; 8817 8808 8818 8809 static int __init fan_init(struct ibm_init_struct *iibm) ··· 8855 8844 pr_info("ECFW with non-standard fan reg control found\n"); 8856 8845 fan_with_ns_addr = 1; 8857 8846 /* Fan ctrl support from host is undefined for now */ 8847 + tp_features.fan_ctrl_status_undef = 1; 8848 + } 8849 + 8850 + /* Check for the EC/BIOS with RPM reported in decimal*/ 8851 + if (quirks & TPACPI_FAN_DECRPM) { 8852 + pr_info("ECFW with fan RPM as decimal in EC register\n"); 8853 + ecfw_with_fan_dec_rpm = 1; 8858 8854 tp_features.fan_ctrl_status_undef = 1; 8859 8855 } 8860 8856 ··· 9085 9067 if (rc < 0) 9086 9068 return rc; 9087 9069 9088 - seq_printf(m, "speed:\t\t%d\n", speed); 9070 + /* Check for fan speeds displayed in hexadecimal */ 9071 + if (!ecfw_with_fan_dec_rpm) 9072 + seq_printf(m, "speed:\t\t%d\n", speed); 9073 + else 9074 + seq_printf(m, "speed:\t\t%x\n", speed); 9089 9075 9090 9076 if (fan_status_access_mode == TPACPI_FAN_RD_TPEC_NS) { 9091 9077 /*
+3 -1
drivers/pwm/pwm-imx-tpm.c
··· 106 106 p->prescale = prescale; 107 107 108 108 period_count = (clock_unit + ((1 << prescale) >> 1)) >> prescale; 109 - p->mod = period_count; 109 + if (period_count == 0) 110 + return -EINVAL; 111 + p->mod = period_count - 1; 110 112 111 113 /* calculate real period HW can support */ 112 114 tmp = (u64)period_count << prescale;
+3
drivers/soc/qcom/llcc-qcom.c
··· 139 139 int size; 140 140 bool need_llcc_cfg; 141 141 bool no_edac; 142 + bool irq_configured; 142 143 }; 143 144 144 145 struct qcom_sct_config { ··· 719 718 .need_llcc_cfg = true, 720 719 .reg_offset = llcc_v2_1_reg_offset, 721 720 .edac_reg_offset = &llcc_v2_1_edac_reg_offset, 721 + .irq_configured = true, 722 722 }, 723 723 }; 724 724 ··· 1347 1345 drv_data->cfg = llcc_cfg; 1348 1346 drv_data->cfg_size = sz; 1349 1347 drv_data->edac_reg_offset = cfg->edac_reg_offset; 1348 + drv_data->ecc_irq_configured = cfg->irq_configured; 1350 1349 mutex_init(&drv_data->lock); 1351 1350 platform_set_drvdata(pdev, drv_data); 1352 1351
+22 -3
drivers/soc/qcom/pmic_glink.c
··· 4 4 * Copyright (c) 2022, Linaro Ltd 5 5 */ 6 6 #include <linux/auxiliary_bus.h> 7 + #include <linux/delay.h> 7 8 #include <linux/module.h> 8 9 #include <linux/of.h> 9 10 #include <linux/platform_device.h> ··· 13 12 #include <linux/soc/qcom/pdr.h> 14 13 #include <linux/soc/qcom/pmic_glink.h> 15 14 #include <linux/spinlock.h> 15 + 16 + #define PMIC_GLINK_SEND_TIMEOUT (5 * HZ) 16 17 17 18 enum { 18 19 PMIC_GLINK_CLIENT_BATT = 0, ··· 115 112 int pmic_glink_send(struct pmic_glink_client *client, void *data, size_t len) 116 113 { 117 114 struct pmic_glink *pg = client->pg; 115 + bool timeout_reached = false; 116 + unsigned long start; 118 117 int ret; 119 118 120 119 mutex_lock(&pg->state_lock); 121 - if (!pg->ept) 120 + if (!pg->ept) { 122 121 ret = -ECONNRESET; 123 - else 124 - ret = rpmsg_send(pg->ept, data, len); 122 + } else { 123 + start = jiffies; 124 + for (;;) { 125 + ret = rpmsg_send(pg->ept, data, len); 126 + if (ret != -EAGAIN) 127 + break; 128 + 129 + if (timeout_reached) { 130 + ret = -ETIMEDOUT; 131 + break; 132 + } 133 + 134 + usleep_range(1000, 5000); 135 + timeout_reached = time_after(jiffies, start + PMIC_GLINK_SEND_TIMEOUT); 136 + } 137 + } 125 138 mutex_unlock(&pg->state_lock); 126 139 127 140 return ret;
+7 -1
drivers/soc/qcom/socinfo.c
··· 786 786 qs->attr.revision = devm_kasprintf(&pdev->dev, GFP_KERNEL, "%u.%u", 787 787 SOCINFO_MAJOR(le32_to_cpu(info->ver)), 788 788 SOCINFO_MINOR(le32_to_cpu(info->ver))); 789 - if (offsetof(struct socinfo, serial_num) <= item_size) 789 + if (!qs->attr.soc_id || !qs->attr.revision) 790 + return -ENOMEM; 791 + 792 + if (offsetof(struct socinfo, serial_num) <= item_size) { 790 793 qs->attr.serial_number = devm_kasprintf(&pdev->dev, GFP_KERNEL, 791 794 "%u", 792 795 le32_to_cpu(info->serial_num)); 796 + if (!qs->attr.serial_number) 797 + return -ENOMEM; 798 + } 793 799 794 800 qs->soc_dev = soc_device_register(&qs->attr); 795 801 if (IS_ERR(qs->soc_dev))
+5 -2
drivers/staging/iio/frequency/ad9832.c
··· 129 129 static int ad9832_write_frequency(struct ad9832_state *st, 130 130 unsigned int addr, unsigned long fout) 131 131 { 132 + unsigned long clk_freq; 132 133 unsigned long regval; 133 134 134 - if (fout > (clk_get_rate(st->mclk) / 2)) 135 + clk_freq = clk_get_rate(st->mclk); 136 + 137 + if (!clk_freq || fout > (clk_freq / 2)) 135 138 return -EINVAL; 136 139 137 - regval = ad9832_calc_freqreg(clk_get_rate(st->mclk), fout); 140 + regval = ad9832_calc_freqreg(clk_freq, fout); 138 141 139 142 st->freq_data[0] = cpu_to_be16((AD9832_CMD_FRE8BITSW << CMD_SHIFT) | 140 143 (addr << ADD_SHIFT) |
+3 -2
drivers/thunderbolt/retimer.c
··· 516 516 */ 517 517 tb_retimer_set_inbound_sbtx(port); 518 518 519 - for (i = 1; i <= TB_MAX_RETIMER_INDEX; i++) { 519 + for (max = 1, i = 1; i <= TB_MAX_RETIMER_INDEX; i++) { 520 520 /* 521 521 * Last retimer is true only for the last on-board 522 522 * retimer (the one connected directly to the Type-C ··· 527 527 last_idx = i; 528 528 else if (ret < 0) 529 529 break; 530 + 531 + max = i; 530 532 } 531 533 532 - max = i; 533 534 ret = 0; 534 535 535 536 /* Add retimers if they do not exist already */
+42 -6
drivers/thunderbolt/tb.c
··· 288 288 device_for_each_child(&sw->dev, NULL, tb_increase_switch_tmu_accuracy); 289 289 } 290 290 291 + static int tb_switch_tmu_hifi_uni_required(struct device *dev, void *not_used) 292 + { 293 + struct tb_switch *sw = tb_to_switch(dev); 294 + 295 + if (sw && tb_switch_tmu_is_enabled(sw) && 296 + tb_switch_tmu_is_configured(sw, TB_SWITCH_TMU_MODE_HIFI_UNI)) 297 + return 1; 298 + 299 + return device_for_each_child(dev, NULL, 300 + tb_switch_tmu_hifi_uni_required); 301 + } 302 + 303 + static bool tb_tmu_hifi_uni_required(struct tb *tb) 304 + { 305 + return device_for_each_child(&tb->dev, NULL, 306 + tb_switch_tmu_hifi_uni_required) == 1; 307 + } 308 + 291 309 static int tb_enable_tmu(struct tb_switch *sw) 292 310 { 293 311 int ret; ··· 320 302 ret = tb_switch_tmu_configure(sw, 321 303 TB_SWITCH_TMU_MODE_MEDRES_ENHANCED_UNI); 322 304 if (ret == -EOPNOTSUPP) { 323 - if (tb_switch_clx_is_enabled(sw, TB_CL1)) 324 - ret = tb_switch_tmu_configure(sw, 325 - TB_SWITCH_TMU_MODE_LOWRES); 326 - else 327 - ret = tb_switch_tmu_configure(sw, 328 - TB_SWITCH_TMU_MODE_HIFI_BI); 305 + if (tb_switch_clx_is_enabled(sw, TB_CL1)) { 306 + /* 307 + * Figure out uni-directional HiFi TMU requirements 308 + * currently in the domain. If there are no 309 + * uni-directional HiFi requirements we can put the TMU 310 + * into LowRes mode. 311 + * 312 + * Deliberately skip bi-directional HiFi links 313 + * as these work independently of other links 314 + * (and they do not allow any CL states anyway). 315 + */ 316 + if (tb_tmu_hifi_uni_required(sw->tb)) 317 + ret = tb_switch_tmu_configure(sw, 318 + TB_SWITCH_TMU_MODE_HIFI_UNI); 319 + else 320 + ret = tb_switch_tmu_configure(sw, 321 + TB_SWITCH_TMU_MODE_LOWRES); 322 + } else { 323 + ret = tb_switch_tmu_configure(sw, TB_SWITCH_TMU_MODE_HIFI_BI); 324 + } 325 + 326 + /* If not supported, fallback to bi-directional HiFi */ 327 + if (ret == -EOPNOTSUPP) 328 + ret = tb_switch_tmu_configure(sw, TB_SWITCH_TMU_MODE_HIFI_BI); 329 329 } 330 330 if (ret) 331 331 return ret;
+2 -2
drivers/usb/core/usb-acpi.c
··· 170 170 struct fwnode_handle *nhi_fwnode __free(fwnode_handle) = 171 171 fwnode_find_reference(dev_fwnode(&port_dev->dev), "usb4-host-interface", 0); 172 172 173 - if (IS_ERR(nhi_fwnode)) 173 + if (IS_ERR(nhi_fwnode) || !nhi_fwnode->dev) 174 174 return 0; 175 175 176 176 link = device_link_add(&port_dev->child->dev, nhi_fwnode->dev, 177 - DL_FLAG_AUTOREMOVE_CONSUMER | 177 + DL_FLAG_STATELESS | 178 178 DL_FLAG_RPM_ACTIVE | 179 179 DL_FLAG_PM_RUNTIME); 180 180 if (!link) {
-1
drivers/usb/dwc2/params.c
··· 23 23 p->max_transfer_size = 65535; 24 24 p->max_packet_count = 511; 25 25 p->ahbcfg = 0x10; 26 - p->no_clock_gating = true; 27 26 } 28 27 29 28 static void dwc2_set_his_params(struct dwc2_hsotg *hsotg)
+4 -2
drivers/usb/host/xhci-pci.c
··· 640 640 pm_runtime_put_noidle(&dev->dev); 641 641 642 642 if (pci_choose_state(dev, PMSG_SUSPEND) == PCI_D0) 643 - pm_runtime_forbid(&dev->dev); 643 + pm_runtime_get(&dev->dev); 644 644 else if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) 645 645 pm_runtime_allow(&dev->dev); 646 646 ··· 683 683 684 684 xhci->xhc_state |= XHCI_STATE_REMOVING; 685 685 686 - if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) 686 + if (pci_choose_state(dev, PMSG_SUSPEND) == PCI_D0) 687 + pm_runtime_put(&dev->dev); 688 + else if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) 687 689 pm_runtime_forbid(&dev->dev); 688 690 689 691 if (xhci->shared_hcd) {
+8 -8
drivers/usb/host/xhci-ring.c
··· 1718 1718 1719 1719 trace_xhci_handle_command(xhci->cmd_ring, &cmd_trb->generic); 1720 1720 1721 + cmd_comp_code = GET_COMP_CODE(le32_to_cpu(event->status)); 1722 + 1723 + /* If CMD ring stopped we own the trbs between enqueue and dequeue */ 1724 + if (cmd_comp_code == COMP_COMMAND_RING_STOPPED) { 1725 + complete_all(&xhci->cmd_ring_stop_completion); 1726 + return; 1727 + } 1728 + 1721 1729 cmd_dequeue_dma = xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg, 1722 1730 cmd_trb); 1723 1731 /* ··· 1741 1733 cmd = list_first_entry(&xhci->cmd_list, struct xhci_command, cmd_list); 1742 1734 1743 1735 cancel_delayed_work(&xhci->cmd_timer); 1744 - 1745 - cmd_comp_code = GET_COMP_CODE(le32_to_cpu(event->status)); 1746 - 1747 - /* If CMD ring stopped we own the trbs between enqueue and dequeue */ 1748 - if (cmd_comp_code == COMP_COMMAND_RING_STOPPED) { 1749 - complete_all(&xhci->cmd_ring_stop_completion); 1750 - return; 1751 - } 1752 1736 1753 1737 if (cmd->command_trb != xhci->cmd_ring->dequeue) { 1754 1738 xhci_err(xhci,
+1 -1
drivers/usb/phy/phy.c
··· 628 628 { 629 629 int r; 630 630 631 - r = devres_destroy(dev, devm_usb_phy_release, devm_usb_phy_match, phy); 631 + r = devres_release(dev, devm_usb_phy_release, devm_usb_phy_match, phy); 632 632 dev_WARN_ONCE(dev, r, "couldn't find PHY resource\n"); 633 633 } 634 634 EXPORT_SYMBOL_GPL(devm_usb_put_phy);
+4 -2
drivers/usb/typec/class.c
··· 2293 2293 const struct typec_altmode_ops *ops, void *drvdata, 2294 2294 struct typec_altmode **altmodes, size_t n) 2295 2295 { 2296 - struct fwnode_handle *altmodes_node, *child; 2296 + struct fwnode_handle *child; 2297 2297 struct typec_altmode_desc desc; 2298 2298 struct typec_altmode *alt; 2299 2299 size_t index = 0; ··· 2301 2301 u32 vdo; 2302 2302 int ret; 2303 2303 2304 - altmodes_node = device_get_named_child_node(&port->dev, "altmodes"); 2304 + struct fwnode_handle *altmodes_node __free(fwnode_handle) = 2305 + device_get_named_child_node(&port->dev, "altmodes"); 2306 + 2305 2307 if (!altmodes_node) 2306 2308 return; /* No altmodes specified */ 2307 2309
+6 -4
drivers/usb/typec/tcpm/qcom/qcom_pmic_typec.c
··· 93 93 return -EINVAL; 94 94 95 95 bridge_dev = devm_drm_dp_hpd_bridge_alloc(tcpm->dev, to_of_node(tcpm->tcpc.fwnode)); 96 - if (IS_ERR(bridge_dev)) 97 - return PTR_ERR(bridge_dev); 96 + if (IS_ERR(bridge_dev)) { 97 + ret = PTR_ERR(bridge_dev); 98 + goto fwnode_remove; 99 + } 98 100 99 101 tcpm->tcpm_port = tcpm_register_port(tcpm->dev, &tcpm->tcpc); 100 102 if (IS_ERR(tcpm->tcpm_port)) { ··· 125 123 port_unregister: 126 124 tcpm_unregister_port(tcpm->tcpm_port); 127 125 fwnode_remove: 128 - fwnode_remove_software_node(tcpm->tcpc.fwnode); 126 + fwnode_handle_put(tcpm->tcpc.fwnode); 129 127 130 128 return ret; 131 129 } ··· 137 135 tcpm->pdphy_stop(tcpm); 138 136 tcpm->port_stop(tcpm); 139 137 tcpm_unregister_port(tcpm->tcpm_port); 140 - fwnode_remove_software_node(tcpm->tcpc.fwnode); 138 + fwnode_handle_put(tcpm->tcpc.fwnode); 141 139 } 142 140 143 141 static const struct pmic_typec_resources pm8150b_typec_res = {
+7 -3
drivers/usb/typec/tcpm/tcpm.c
··· 4515 4515 return ERROR_RECOVERY; 4516 4516 if (port->pwr_role == TYPEC_SOURCE) 4517 4517 return SRC_UNATTACHED; 4518 - if (port->state == SNK_WAIT_CAPABILITIES_TIMEOUT) 4518 + if (port->state == SNK_WAIT_CAPABILITIES || 4519 + port->state == SNK_WAIT_CAPABILITIES_TIMEOUT) 4519 4520 return SNK_READY; 4520 4521 return SNK_UNATTACHED; 4521 4522 } ··· 5044 5043 tcpm_set_state(port, SNK_SOFT_RESET, 5045 5044 PD_T_SINK_WAIT_CAP); 5046 5045 } else { 5047 - tcpm_set_state(port, SNK_WAIT_CAPABILITIES_TIMEOUT, 5048 - PD_T_SINK_WAIT_CAP); 5046 + if (!port->self_powered) 5047 + upcoming_state = SNK_WAIT_CAPABILITIES_TIMEOUT; 5048 + else 5049 + upcoming_state = hard_reset_state(port); 5050 + tcpm_set_state(port, upcoming_state, PD_T_SINK_WAIT_CAP); 5049 5051 } 5050 5052 break; 5051 5053 case SNK_WAIT_CAPABILITIES_TIMEOUT:
+25
fs/afs/dir.c
··· 12 12 #include <linux/swap.h> 13 13 #include <linux/ctype.h> 14 14 #include <linux/sched.h> 15 + #include <linux/iversion.h> 15 16 #include <linux/task_io_accounting_ops.h> 16 17 #include "internal.h" 17 18 #include "afs_fs.h" ··· 1824 1823 1825 1824 static void afs_rename_success(struct afs_operation *op) 1826 1825 { 1826 + struct afs_vnode *vnode = AFS_FS_I(d_inode(op->dentry)); 1827 + 1827 1828 _enter("op=%08x", op->debug_id); 1828 1829 1829 1830 op->ctime = op->file[0].scb.status.mtime_client; ··· 1834 1831 if (op->file[1].vnode != op->file[0].vnode) { 1835 1832 op->ctime = op->file[1].scb.status.mtime_client; 1836 1833 afs_vnode_commit_status(op, &op->file[1]); 1834 + } 1835 + 1836 + /* If we're moving a subdir between dirs, we need to update 1837 + * its DV counter too as the ".." will be altered. 1838 + */ 1839 + if (S_ISDIR(vnode->netfs.inode.i_mode) && 1840 + op->file[0].vnode != op->file[1].vnode) { 1841 + u64 new_dv; 1842 + 1843 + write_seqlock(&vnode->cb_lock); 1844 + 1845 + new_dv = vnode->status.data_version + 1; 1846 + vnode->status.data_version = new_dv; 1847 + inode_set_iversion_raw(&vnode->netfs.inode, new_dv); 1848 + 1849 + write_sequnlock(&vnode->cb_lock); 1837 1850 } 1838 1851 } 1839 1852 ··· 1891 1872 afs_edit_dir_add(new_dvnode, &new_dentry->d_name, 1892 1873 &vnode->fid, afs_edit_dir_for_rename_2); 1893 1874 } 1875 + 1876 + if (S_ISDIR(vnode->netfs.inode.i_mode) && 1877 + new_dvnode != orig_dvnode && 1878 + test_bit(AFS_VNODE_DIR_VALID, &vnode->flags)) 1879 + afs_edit_dir_update_dotdot(vnode, new_dvnode, 1880 + afs_edit_dir_for_rename_sub); 1894 1881 1895 1882 new_inode = d_inode(new_dentry); 1896 1883 if (new_inode) {
+89 -2
fs/afs/dir_edit.c
··· 127 127 /* 128 128 * Scan a directory block looking for a dirent of the right name. 129 129 */ 130 - static int afs_dir_scan_block(union afs_xdr_dir_block *block, struct qstr *name, 130 + static int afs_dir_scan_block(const union afs_xdr_dir_block *block, const struct qstr *name, 131 131 unsigned int blocknum) 132 132 { 133 - union afs_xdr_dirent *de; 133 + const union afs_xdr_dirent *de; 134 134 u64 bitmap; 135 135 int d, len, n; 136 136 ··· 491 491 0, 0, 0, 0, name->name); 492 492 clear_bit(AFS_VNODE_DIR_VALID, &vnode->flags); 493 493 goto out_unmap; 494 + } 495 + 496 + /* 497 + * Edit a subdirectory that has been moved between directories to update the 498 + * ".." entry. 499 + */ 500 + void afs_edit_dir_update_dotdot(struct afs_vnode *vnode, struct afs_vnode *new_dvnode, 501 + enum afs_edit_dir_reason why) 502 + { 503 + union afs_xdr_dir_block *block; 504 + union afs_xdr_dirent *de; 505 + struct folio *folio; 506 + unsigned int nr_blocks, b; 507 + pgoff_t index; 508 + loff_t i_size; 509 + int slot; 510 + 511 + _enter(""); 512 + 513 + i_size = i_size_read(&vnode->netfs.inode); 514 + if (i_size < AFS_DIR_BLOCK_SIZE) { 515 + clear_bit(AFS_VNODE_DIR_VALID, &vnode->flags); 516 + return; 517 + } 518 + nr_blocks = i_size / AFS_DIR_BLOCK_SIZE; 519 + 520 + /* Find a block that has sufficient slots available. Each folio 521 + * contains two or more directory blocks. 522 + */ 523 + for (b = 0; b < nr_blocks; b++) { 524 + index = b / AFS_DIR_BLOCKS_PER_PAGE; 525 + folio = afs_dir_get_folio(vnode, index); 526 + if (!folio) 527 + goto error; 528 + 529 + block = kmap_local_folio(folio, b * AFS_DIR_BLOCK_SIZE - folio_pos(folio)); 530 + 531 + /* Abandon the edit if we got a callback break. */ 532 + if (!test_bit(AFS_VNODE_DIR_VALID, &vnode->flags)) 533 + goto invalidated; 534 + 535 + slot = afs_dir_scan_block(block, &dotdot_name, b); 536 + if (slot >= 0) 537 + goto found_dirent; 538 + 539 + kunmap_local(block); 540 + folio_unlock(folio); 541 + folio_put(folio); 542 + } 543 + 544 + /* Didn't find the dirent to clobber. Download the directory again. */ 545 + trace_afs_edit_dir(vnode, why, afs_edit_dir_update_nodd, 546 + 0, 0, 0, 0, ".."); 547 + clear_bit(AFS_VNODE_DIR_VALID, &vnode->flags); 548 + goto out; 549 + 550 + found_dirent: 551 + de = &block->dirents[slot]; 552 + de->u.vnode = htonl(new_dvnode->fid.vnode); 553 + de->u.unique = htonl(new_dvnode->fid.unique); 554 + 555 + trace_afs_edit_dir(vnode, why, afs_edit_dir_update_dd, b, slot, 556 + ntohl(de->u.vnode), ntohl(de->u.unique), ".."); 557 + 558 + kunmap_local(block); 559 + folio_unlock(folio); 560 + folio_put(folio); 561 + inode_set_iversion_raw(&vnode->netfs.inode, vnode->status.data_version); 562 + 563 + out: 564 + _leave(""); 565 + return; 566 + 567 + invalidated: 568 + kunmap_local(block); 569 + folio_unlock(folio); 570 + folio_put(folio); 571 + trace_afs_edit_dir(vnode, why, afs_edit_dir_update_inval, 572 + 0, 0, 0, 0, ".."); 573 + clear_bit(AFS_VNODE_DIR_VALID, &vnode->flags); 574 + goto out; 575 + 576 + error: 577 + trace_afs_edit_dir(vnode, why, afs_edit_dir_update_error, 578 + 0, 0, 0, 0, ".."); 579 + clear_bit(AFS_VNODE_DIR_VALID, &vnode->flags); 580 + goto out; 494 581 }
+2
fs/afs/internal.h
··· 1073 1073 extern void afs_edit_dir_add(struct afs_vnode *, struct qstr *, struct afs_fid *, 1074 1074 enum afs_edit_dir_reason); 1075 1075 extern void afs_edit_dir_remove(struct afs_vnode *, struct qstr *, enum afs_edit_dir_reason); 1076 + void afs_edit_dir_update_dotdot(struct afs_vnode *vnode, struct afs_vnode *new_dvnode, 1077 + enum afs_edit_dir_reason why); 1076 1078 1077 1079 /* 1078 1080 * dir_silly.c
+2 -3
fs/autofs/dev-ioctl.c
··· 110 110 */ 111 111 static int validate_dev_ioctl(int cmd, struct autofs_dev_ioctl *param) 112 112 { 113 + unsigned int inr = _IOC_NR(cmd); 113 114 int err; 114 115 115 116 err = check_dev_ioctl_version(cmd, param); ··· 134 133 * check_name() return for AUTOFS_DEV_IOCTL_TIMEOUT_CMD. 135 134 */ 136 135 err = check_name(param->path); 137 - if (cmd == AUTOFS_DEV_IOCTL_TIMEOUT_CMD) 136 + if (inr == AUTOFS_DEV_IOCTL_TIMEOUT_CMD) 138 137 err = err ? 0 : -EINVAL; 139 138 if (err) { 140 139 pr_warn("invalid path supplied for cmd(0x%08x)\n", ··· 142 141 goto out; 143 142 } 144 143 } else { 145 - unsigned int inr = _IOC_NR(cmd); 146 - 147 144 if (inr == AUTOFS_DEV_IOCTL_OPENMOUNT_CMD || 148 145 inr == AUTOFS_DEV_IOCTL_REQUESTER_CMD || 149 146 inr == AUTOFS_DEV_IOCTL_ISMOUNTPOINT_CMD) {
+3
fs/bcachefs/alloc_background.h
··· 168 168 static inline u64 alloc_lru_idx_fragmentation(struct bch_alloc_v4 a, 169 169 struct bch_dev *ca) 170 170 { 171 + if (a.data_type >= BCH_DATA_NR) 172 + return 0; 173 + 171 174 if (!data_type_movable(a.data_type) || 172 175 !bch2_bucket_sectors_fragmented(ca, a)) 173 176 return 0;
+16 -3
fs/bcachefs/alloc_foreground.c
··· 162 162 ARRAY_SIZE(c->open_buckets_partial)); 163 163 164 164 spin_lock(&c->freelist_lock); 165 + rcu_read_lock(); 166 + bch2_dev_rcu(c, ob->dev)->nr_partial_buckets++; 167 + rcu_read_unlock(); 168 + 165 169 ob->on_partial_list = true; 166 170 c->open_buckets_partial[c->open_buckets_partial_nr++] = 167 171 ob - c->open_buckets; ··· 976 972 u64 avail; 977 973 978 974 bch2_dev_usage_read_fast(ca, &usage); 979 - avail = dev_buckets_free(ca, usage, watermark); 975 + avail = dev_buckets_free(ca, usage, watermark) + ca->nr_partial_buckets; 980 976 if (!avail) 981 977 continue; 982 978 ··· 984 980 c->open_buckets_partial_nr, 985 981 i); 986 982 ob->on_partial_list = false; 983 + 984 + rcu_read_lock(); 985 + bch2_dev_rcu(c, ob->dev)->nr_partial_buckets--; 986 + rcu_read_unlock(); 987 987 988 988 ret = add_new_bucket(c, ptrs, devs_may_alloc, 989 989 nr_replicas, nr_effective, ··· 1199 1191 --c->open_buckets_partial_nr; 1200 1192 swap(c->open_buckets_partial[i], 1201 1193 c->open_buckets_partial[c->open_buckets_partial_nr]); 1194 + 1202 1195 ob->on_partial_list = false; 1196 + 1197 + rcu_read_lock(); 1198 + bch2_dev_rcu(c, ob->dev)->nr_partial_buckets--; 1199 + rcu_read_unlock(); 1200 + 1203 1201 spin_unlock(&c->freelist_lock); 1204 1202 bch2_open_bucket_put(c, ob); 1205 1203 spin_lock(&c->freelist_lock); ··· 1624 1610 ob < c->open_buckets + ARRAY_SIZE(c->open_buckets); 1625 1611 ob++) { 1626 1612 spin_lock(&ob->lock); 1627 - if (ob->valid && !ob->on_partial_list && 1628 - (!ca || ob->dev == ca->dev_idx)) 1613 + if (ob->valid && (!ca || ob->dev == ca->dev_idx)) 1629 1614 bch2_open_bucket_to_text(out, c, ob); 1630 1615 spin_unlock(&ob->lock); 1631 1616 }
+1
fs/bcachefs/bcachefs.h
··· 555 555 u64 alloc_cursor[3]; 556 556 557 557 unsigned nr_open_buckets; 558 + unsigned nr_partial_buckets; 558 559 unsigned nr_btree_reserve; 559 560 560 561 size_t inc_gen_needs_gc;
+13
fs/bcachefs/btree_iter.c
··· 882 882 __bch2_btree_and_journal_iter_init_node_iter(trans, &jiter, l->b, l->iter, path->pos); 883 883 884 884 k = bch2_btree_and_journal_iter_peek(&jiter); 885 + if (!k.k) { 886 + struct printbuf buf = PRINTBUF; 887 + 888 + prt_str(&buf, "node not found at pos "); 889 + bch2_bpos_to_text(&buf, path->pos); 890 + prt_str(&buf, " at btree "); 891 + bch2_btree_pos_to_text(&buf, c, l->b); 892 + 893 + ret = bch2_fs_topology_error(c, "%s", buf.buf); 894 + printbuf_exit(&buf); 895 + goto err; 896 + } 885 897 886 898 bch2_bkey_buf_reassemble(out, c, k); 887 899 ··· 901 889 c->opts.btree_node_prefetch) 902 890 ret = btree_path_prefetch_j(trans, path, &jiter); 903 891 892 + err: 904 893 bch2_btree_and_journal_iter_exit(&jiter); 905 894 return ret; 906 895 }
+12 -9
fs/bcachefs/data_update.c
··· 236 236 if (((1U << i) & m->data_opts.rewrite_ptrs) && 237 237 (ptr = bch2_extent_has_ptr(old, p, bkey_i_to_s(insert))) && 238 238 !ptr->cached) { 239 - bch2_extent_ptr_set_cached(bkey_i_to_s(insert), ptr); 239 + bch2_extent_ptr_set_cached(c, &m->op.opts, 240 + bkey_i_to_s(insert), ptr); 240 241 rewrites_found |= 1U << i; 241 242 } 242 243 i++; ··· 285 284 durability - ptr_durability >= m->op.opts.data_replicas) { 286 285 durability -= ptr_durability; 287 286 288 - bch2_extent_ptr_set_cached(bkey_i_to_s(insert), &entry->ptr); 287 + bch2_extent_ptr_set_cached(c, &m->op.opts, 288 + bkey_i_to_s(insert), &entry->ptr); 289 289 goto restart_drop_extra_replicas; 290 290 } 291 291 } ··· 297 295 bch2_extent_ptr_decoded_append(insert, &p); 298 296 299 297 bch2_bkey_narrow_crcs(insert, (struct bch_extent_crc_unpacked) { 0 }); 300 - bch2_extent_normalize(c, bkey_i_to_s(insert)); 298 + bch2_extent_normalize_by_opts(c, &m->op.opts, bkey_i_to_s(insert)); 301 299 302 300 ret = bch2_sum_sector_overwrites(trans, &iter, insert, 303 301 &should_check_enospc, ··· 560 558 int bch2_extent_drop_ptrs(struct btree_trans *trans, 561 559 struct btree_iter *iter, 562 560 struct bkey_s_c k, 563 - struct data_update_opts data_opts) 561 + struct bch_io_opts *io_opts, 562 + struct data_update_opts *data_opts) 564 563 { 565 564 struct bch_fs *c = trans->c; 566 565 struct bkey_i *n; ··· 572 569 if (ret) 573 570 return ret; 574 571 575 - while (data_opts.kill_ptrs) { 576 - unsigned i = 0, drop = __fls(data_opts.kill_ptrs); 572 + while (data_opts->kill_ptrs) { 573 + unsigned i = 0, drop = __fls(data_opts->kill_ptrs); 577 574 578 575 bch2_bkey_drop_ptrs_noerror(bkey_i_to_s(n), ptr, i++ == drop); 579 - data_opts.kill_ptrs ^= 1U << drop; 576 + data_opts->kill_ptrs ^= 1U << drop; 580 577 } 581 578 582 579 /* ··· 584 581 * will do the appropriate thing with it (turning it into a 585 582 * KEY_TYPE_error key, or just a discard if it was a cached extent) 586 583 */ 587 - bch2_extent_normalize(c, bkey_i_to_s(n)); 584 + bch2_extent_normalize_by_opts(c, io_opts, bkey_i_to_s(n)); 588 585 589 586 /* 590 587 * Since we're not inserting through an extent iterator ··· 723 720 m->data_opts.rewrite_ptrs = 0; 724 721 /* if iter == NULL, it's just a promote */ 725 722 if (iter) 726 - ret = bch2_extent_drop_ptrs(trans, iter, k, m->data_opts); 723 + ret = bch2_extent_drop_ptrs(trans, iter, k, &io_opts, &m->data_opts); 727 724 goto out; 728 725 } 729 726
+2 -1
fs/bcachefs/data_update.h
··· 40 40 int bch2_extent_drop_ptrs(struct btree_trans *, 41 41 struct btree_iter *, 42 42 struct bkey_s_c, 43 - struct data_update_opts); 43 + struct bch_io_opts *, 44 + struct data_update_opts *); 44 45 45 46 void bch2_data_update_exit(struct data_update *); 46 47 int bch2_data_update_init(struct btree_trans *, struct btree_iter *,
+4
fs/bcachefs/ec.c
··· 1870 1870 } 1871 1871 1872 1872 h = ec_new_stripe_head_alloc(c, disk_label, algo, redundancy, watermark); 1873 + if (!h) { 1874 + h = ERR_PTR(-BCH_ERR_ENOMEM_stripe_head_alloc); 1875 + goto err; 1876 + } 1873 1877 found: 1874 1878 if (h->rw_devs_change_count != c->rw_devs_change_count) 1875 1879 ec_stripe_head_devs_update(c, h);
+2
fs/bcachefs/errcode.h
··· 83 83 x(ENOMEM, ENOMEM_fs_other_alloc) \ 84 84 x(ENOMEM, ENOMEM_dev_alloc) \ 85 85 x(ENOMEM, ENOMEM_disk_accounting) \ 86 + x(ENOMEM, ENOMEM_stripe_head_alloc) \ 86 87 x(ENOSPC, ENOSPC_disk_reservation) \ 87 88 x(ENOSPC, ENOSPC_bucket_alloc) \ 88 89 x(ENOSPC, ENOSPC_disk_label_add) \ ··· 223 222 x(BCH_ERR_invalid_sb_layout, invalid_sb_layout_type) \ 224 223 x(BCH_ERR_invalid_sb_layout, invalid_sb_layout_nr_superblocks) \ 225 224 x(BCH_ERR_invalid_sb_layout, invalid_sb_layout_superblocks_overlap) \ 225 + x(BCH_ERR_invalid_sb_layout, invalid_sb_layout_sb_max_size_bits) \ 226 226 x(BCH_ERR_invalid_sb, invalid_sb_members_missing) \ 227 227 x(BCH_ERR_invalid_sb, invalid_sb_members) \ 228 228 x(BCH_ERR_invalid_sb, invalid_sb_disk_groups) \
+71 -17
fs/bcachefs/extents.c
··· 978 978 return NULL; 979 979 } 980 980 981 - void bch2_extent_ptr_set_cached(struct bkey_s k, struct bch_extent_ptr *ptr) 981 + static bool want_cached_ptr(struct bch_fs *c, struct bch_io_opts *opts, 982 + struct bch_extent_ptr *ptr) 983 + { 984 + if (!opts->promote_target || 985 + !bch2_dev_in_target(c, ptr->dev, opts->promote_target)) 986 + return false; 987 + 988 + struct bch_dev *ca = bch2_dev_rcu_noerror(c, ptr->dev); 989 + 990 + return ca && bch2_dev_is_readable(ca) && !dev_ptr_stale_rcu(ca, ptr); 991 + } 992 + 993 + void bch2_extent_ptr_set_cached(struct bch_fs *c, 994 + struct bch_io_opts *opts, 995 + struct bkey_s k, 996 + struct bch_extent_ptr *ptr) 982 997 { 983 998 struct bkey_ptrs ptrs = bch2_bkey_ptrs(k); 984 999 union bch_extent_entry *entry; 985 - union bch_extent_entry *ec = NULL; 1000 + struct extent_ptr_decoded p; 986 1001 987 - bkey_extent_entry_for_each(ptrs, entry) { 988 - if (&entry->ptr == ptr) { 989 - ptr->cached = true; 990 - if (ec) 991 - extent_entry_drop(k, ec); 992 - return; 993 - } 994 - 995 - if (extent_entry_is_stripe_ptr(entry)) 996 - ec = entry; 997 - else if (extent_entry_is_ptr(entry)) 998 - ec = NULL; 1002 + rcu_read_lock(); 1003 + if (!want_cached_ptr(c, opts, ptr)) { 1004 + bch2_bkey_drop_ptr_noerror(k, ptr); 1005 + goto out; 999 1006 } 1000 1007 1008 + /* 1009 + * Stripes can't contain cached data, for - reasons. 1010 + * 1011 + * Possibly something we can fix in the future? 1012 + */ 1013 + bkey_for_each_ptr_decode(k.k, ptrs, p, entry) 1014 + if (&entry->ptr == ptr) { 1015 + if (p.has_ec) 1016 + bch2_bkey_drop_ptr_noerror(k, ptr); 1017 + else 1018 + ptr->cached = true; 1019 + goto out; 1020 + } 1021 + 1001 1022 BUG(); 1023 + out: 1024 + rcu_read_unlock(); 1002 1025 } 1003 1026 1004 1027 /* 1005 - * bch_extent_normalize - clean up an extent, dropping stale pointers etc. 1028 + * bch2_extent_normalize - clean up an extent, dropping stale pointers etc. 1006 1029 * 1007 1030 * Returns true if @k should be dropped entirely 1008 1031 * ··· 1039 1016 rcu_read_lock(); 1040 1017 bch2_bkey_drop_ptrs(k, ptr, 1041 1018 ptr->cached && 1042 - (ca = bch2_dev_rcu(c, ptr->dev)) && 1043 - dev_ptr_stale_rcu(ca, ptr) > 0); 1019 + (!(ca = bch2_dev_rcu(c, ptr->dev)) || 1020 + dev_ptr_stale_rcu(ca, ptr) > 0)); 1021 + rcu_read_unlock(); 1022 + 1023 + return bkey_deleted(k.k); 1024 + } 1025 + 1026 + /* 1027 + * bch2_extent_normalize_by_opts - clean up an extent, dropping stale pointers etc. 1028 + * 1029 + * Like bch2_extent_normalize(), but also only keeps a single cached pointer on 1030 + * the promote target. 1031 + */ 1032 + bool bch2_extent_normalize_by_opts(struct bch_fs *c, 1033 + struct bch_io_opts *opts, 1034 + struct bkey_s k) 1035 + { 1036 + struct bkey_ptrs ptrs; 1037 + bool have_cached_ptr; 1038 + 1039 + rcu_read_lock(); 1040 + restart_drop_ptrs: 1041 + ptrs = bch2_bkey_ptrs(k); 1042 + have_cached_ptr = false; 1043 + 1044 + bkey_for_each_ptr(ptrs, ptr) 1045 + if (ptr->cached) { 1046 + if (have_cached_ptr || !want_cached_ptr(c, opts, ptr)) { 1047 + bch2_bkey_drop_ptr(k, ptr); 1048 + goto restart_drop_ptrs; 1049 + } 1050 + have_cached_ptr = true; 1051 + } 1044 1052 rcu_read_unlock(); 1045 1053 1046 1054 return bkey_deleted(k.k);
+4 -1
fs/bcachefs/extents.h
··· 686 686 struct bch_extent_ptr * 687 687 bch2_extent_has_ptr(struct bkey_s_c, struct extent_ptr_decoded, struct bkey_s); 688 688 689 - void bch2_extent_ptr_set_cached(struct bkey_s, struct bch_extent_ptr *); 689 + void bch2_extent_ptr_set_cached(struct bch_fs *, struct bch_io_opts *, 690 + struct bkey_s, struct bch_extent_ptr *); 690 691 692 + bool bch2_extent_normalize_by_opts(struct bch_fs *, struct bch_io_opts *, struct bkey_s); 691 693 bool bch2_extent_normalize(struct bch_fs *, struct bkey_s); 694 + 692 695 void bch2_extent_ptr_to_text(struct printbuf *out, struct bch_fs *, const struct bch_extent_ptr *); 693 696 void bch2_bkey_ptrs_to_text(struct printbuf *, struct bch_fs *, 694 697 struct bkey_s_c);
+13 -4
fs/bcachefs/fs-io.c
··· 587 587 POS(inode->v.i_ino, start_sector), 588 588 BTREE_ITER_slots|BTREE_ITER_intent); 589 589 590 - while (!ret && bkey_lt(iter.pos, end_pos)) { 590 + while (!ret) { 591 591 s64 i_sectors_delta = 0; 592 592 struct quota_res quota_res = { 0 }; 593 593 struct bkey_s_c k; ··· 597 597 u32 snapshot; 598 598 599 599 bch2_trans_begin(trans); 600 + 601 + if (bkey_ge(iter.pos, end_pos)) 602 + break; 600 603 601 604 ret = bch2_subvolume_get_snapshot(trans, 602 605 inode->ei_inum.subvol, &snapshot); ··· 637 634 if (bch2_clamp_data_hole(&inode->v, 638 635 &hole_start, 639 636 &hole_end, 640 - opts.data_replicas, true)) 637 + opts.data_replicas, true)) { 641 638 ret = drop_locks_do(trans, 642 639 (bch2_clamp_data_hole(&inode->v, 643 640 &hole_start, 644 641 &hole_end, 645 642 opts.data_replicas, false), 0)); 643 + if (ret) 644 + goto bkey_err; 645 + } 646 646 bch2_btree_iter_set_pos(&iter, POS(iter.pos.inode, hole_start)); 647 647 648 648 if (ret) ··· 673 667 bch2_i_sectors_acct(c, inode, &quota_res, i_sectors_delta); 674 668 675 669 if (bch2_mark_pagecache_reserved(inode, &hole_start, 676 - iter.pos.offset, true)) 677 - drop_locks_do(trans, 670 + iter.pos.offset, true)) { 671 + ret = drop_locks_do(trans, 678 672 bch2_mark_pagecache_reserved(inode, &hole_start, 679 673 iter.pos.offset, false)); 674 + if (ret) 675 + goto bkey_err; 676 + } 680 677 bkey_err: 681 678 bch2_quota_reservation_put(c, inode, &quota_res); 682 679 if (bch2_err_matches(ret, BCH_ERR_transaction_restart))
+1 -1
fs/bcachefs/move.c
··· 266 266 if (!data_opts.rewrite_ptrs && 267 267 !data_opts.extra_replicas) { 268 268 if (data_opts.kill_ptrs) 269 - return bch2_extent_drop_ptrs(trans, iter, k, data_opts); 269 + return bch2_extent_drop_ptrs(trans, iter, k, &io_opts, &data_opts); 270 270 return 0; 271 271 } 272 272
+11 -3
fs/bcachefs/recovery.c
··· 94 94 __set_bit_le64(BCH_FSCK_ERR_accounting_mismatch, ext->errors_silent); 95 95 c->sb.compat &= ~(1ULL << BCH_COMPAT_alloc_info); 96 96 97 - bch2_write_super(c); 98 - mutex_unlock(&c->sb_lock); 99 - 100 97 c->opts.recovery_passes |= bch2_recovery_passes_from_stable(le64_to_cpu(ext->recovery_passes_required[0])); 101 98 99 + bch2_write_super(c); 100 + mutex_unlock(&c->sb_lock); 102 101 103 102 bch2_shoot_down_journal_keys(c, BTREE_ID_alloc, 104 103 0, BTREE_MAX_DEPTH, POS_MIN, SPOS_MAX); ··· 1001 1002 struct bch_inode_unpacked root_inode, lostfound_inode; 1002 1003 struct bkey_inode_buf packed_inode; 1003 1004 struct qstr lostfound = QSTR("lost+found"); 1005 + struct bch_member *m; 1004 1006 int ret; 1005 1007 1006 1008 bch_notice(c, "initializing new filesystem"); ··· 1018 1018 SET_BCH_SB_VERSION_UPGRADE_COMPLETE(c->disk_sb.sb, bcachefs_metadata_version_current); 1019 1019 bch2_write_super(c); 1020 1020 } 1021 + 1022 + for_each_member_device(c, ca) { 1023 + m = bch2_members_v2_get_mut(c->disk_sb.sb, ca->dev_idx); 1024 + SET_BCH_MEMBER_FREESPACE_INITIALIZED(m, false); 1025 + ca->mi = bch2_mi_to_cpu(m); 1026 + } 1027 + 1028 + bch2_write_super(c); 1021 1029 mutex_unlock(&c->sb_lock); 1022 1030 1023 1031 c->curr_recovery_pass = BCH_RECOVERY_PASS_NR;
+3
fs/bcachefs/sb-downgrade.c
··· 143 143 144 144 static int have_stripes(struct bch_fs *c) 145 145 { 146 + if (IS_ERR_OR_NULL(c->btree_roots_known[BTREE_ID_stripes].b)) 147 + return 0; 148 + 146 149 return !btree_node_fake(c->btree_roots_known[BTREE_ID_stripes].b); 147 150 } 148 151
+5
fs/bcachefs/super-io.c
··· 287 287 return -BCH_ERR_invalid_sb_layout_nr_superblocks; 288 288 } 289 289 290 + if (layout->sb_max_size_bits > BCH_SB_LAYOUT_SIZE_BITS_MAX) { 291 + prt_printf(out, "Invalid superblock layout: max_size_bits too high"); 292 + return -BCH_ERR_invalid_sb_layout_sb_max_size_bits; 293 + } 294 + 290 295 max_sectors = 1 << layout->sb_max_size_bits; 291 296 292 297 prev_offset = le64_to_cpu(layout->sb_offset[0]);
+13 -24
fs/btrfs/bio.c
··· 49 49 bbio->end_io = end_io; 50 50 bbio->private = private; 51 51 atomic_set(&bbio->pending_ios, 1); 52 + WRITE_ONCE(bbio->status, BLK_STS_OK); 52 53 } 53 54 54 55 /* ··· 114 113 } 115 114 } 116 115 117 - static void btrfs_orig_write_end_io(struct bio *bio); 118 - 119 - static void btrfs_bbio_propagate_error(struct btrfs_bio *bbio, 120 - struct btrfs_bio *orig_bbio) 121 - { 122 - /* 123 - * For writes we tolerate nr_mirrors - 1 write failures, so we can't 124 - * just blindly propagate a write failure here. Instead increment the 125 - * error count in the original I/O context so that it is guaranteed to 126 - * be larger than the error tolerance. 127 - */ 128 - if (bbio->bio.bi_end_io == &btrfs_orig_write_end_io) { 129 - struct btrfs_io_stripe *orig_stripe = orig_bbio->bio.bi_private; 130 - struct btrfs_io_context *orig_bioc = orig_stripe->bioc; 131 - 132 - atomic_add(orig_bioc->max_errors, &orig_bioc->error); 133 - } else { 134 - orig_bbio->bio.bi_status = bbio->bio.bi_status; 135 - } 136 - } 137 - 138 116 void btrfs_bio_end_io(struct btrfs_bio *bbio, blk_status_t status) 139 117 { 140 118 bbio->bio.bi_status = status; 141 119 if (bbio->bio.bi_pool == &btrfs_clone_bioset) { 142 120 struct btrfs_bio *orig_bbio = bbio->private; 143 121 144 - if (bbio->bio.bi_status) 145 - btrfs_bbio_propagate_error(bbio, orig_bbio); 146 122 btrfs_cleanup_bio(bbio); 147 123 bbio = orig_bbio; 148 124 } 149 125 150 - if (atomic_dec_and_test(&bbio->pending_ios)) 126 + /* 127 + * At this point, bbio always points to the original btrfs_bio. Save 128 + * the first error in it. 129 + */ 130 + if (status != BLK_STS_OK) 131 + cmpxchg(&bbio->status, BLK_STS_OK, status); 132 + 133 + if (atomic_dec_and_test(&bbio->pending_ios)) { 134 + /* Load split bio's error which might be set above. */ 135 + if (status == BLK_STS_OK) 136 + bbio->bio.bi_status = READ_ONCE(bbio->status); 151 137 __btrfs_bio_end_io(bbio); 138 + } 152 139 } 153 140 154 141 static int next_repair_mirror(struct btrfs_failed_bio *fbio, int cur_mirror)
+3
fs/btrfs/bio.h
··· 79 79 /* File system that this I/O operates on. */ 80 80 struct btrfs_fs_info *fs_info; 81 81 82 + /* Save the first error status of split bio. */ 83 + blk_status_t status; 84 + 82 85 /* 83 86 * This member must come last, bio_alloc_bioset will allocate enough 84 87 * bytes for entire btrfs_bio but relies on bio being last.
+5 -5
fs/btrfs/defrag.c
··· 763 763 * We can get a merged extent, in that case, we need to re-search 764 764 * tree to get the original em for defrag. 765 765 * 766 - * If @newer_than is 0 or em::generation < newer_than, we can trust 767 - * this em, as either we don't care about the generation, or the 768 - * merged extent map will be rejected anyway. 766 + * This is because even if we have adjacent extents that are contiguous 767 + * and compatible (same type and flags), we still want to defrag them 768 + * so that we use less metadata (extent items in the extent tree and 769 + * file extent items in the inode's subvolume tree). 769 770 */ 770 - if (em && (em->flags & EXTENT_FLAG_MERGED) && 771 - newer_than && em->generation >= newer_than) { 771 + if (em && (em->flags & EXTENT_FLAG_MERGED)) { 772 772 free_extent_map(em); 773 773 em = NULL; 774 774 }
+6 -1
fs/btrfs/extent_map.c
··· 230 230 if (extent_map_end(prev) != next->start) 231 231 return false; 232 232 233 - if (prev->flags != next->flags) 233 + /* 234 + * The merged flag is not an on-disk flag, it just indicates we had the 235 + * extent maps of 2 (or more) adjacent extents merged, so factor it out. 236 + */ 237 + if ((prev->flags & ~EXTENT_FLAG_MERGED) != 238 + (next->flags & ~EXTENT_FLAG_MERGED)) 234 239 return false; 235 240 236 241 if (next->disk_bytenr < EXTENT_MAP_LAST_BYTE - 1)
+1
fs/btrfs/volumes.c
··· 1105 1105 if (device->bdev) { 1106 1106 fs_devices->open_devices--; 1107 1107 device->bdev = NULL; 1108 + device->bdev_file = NULL; 1108 1109 } 1109 1110 clear_bit(BTRFS_DEV_STATE_WRITEABLE, &device->dev_state); 1110 1111 btrfs_destroy_dev_zone_info(device);
+30 -19
fs/dax.c
··· 1262 1262 { 1263 1263 struct iomap *iomap = &iter->iomap; 1264 1264 const struct iomap *srcmap = iomap_iter_srcmap(iter); 1265 - loff_t pos = iter->pos; 1266 - loff_t length = iomap_length(iter); 1265 + loff_t copy_pos = iter->pos; 1266 + u64 copy_len = iomap_length(iter); 1267 + u32 mod; 1267 1268 int id = 0; 1268 1269 s64 ret = 0; 1269 1270 void *daddr = NULL, *saddr = NULL; 1270 1271 1271 - /* don't bother with blocks that are not shared to start with */ 1272 - if (!(iomap->flags & IOMAP_F_SHARED)) 1273 - return length; 1272 + if (!iomap_want_unshare_iter(iter)) 1273 + return iomap_length(iter); 1274 1274 1275 - id = dax_read_lock(); 1276 - ret = dax_iomap_direct_access(iomap, pos, length, &daddr, NULL); 1277 - if (ret < 0) 1278 - goto out_unlock; 1279 - 1280 - /* zero the distance if srcmap is HOLE or UNWRITTEN */ 1281 - if (srcmap->flags & IOMAP_F_SHARED || srcmap->type == IOMAP_UNWRITTEN) { 1282 - memset(daddr, 0, length); 1283 - dax_flush(iomap->dax_dev, daddr, length); 1284 - ret = length; 1285 - goto out_unlock; 1275 + /* 1276 + * Extend the file range to be aligned to fsblock/pagesize, because 1277 + * we need to copy entire blocks, not just the byte range specified. 1278 + * Invalidate the mapping because we're about to CoW. 1279 + */ 1280 + mod = offset_in_page(copy_pos); 1281 + if (mod) { 1282 + copy_len += mod; 1283 + copy_pos -= mod; 1286 1284 } 1287 1285 1288 - ret = dax_iomap_direct_access(srcmap, pos, length, &saddr, NULL); 1286 + mod = offset_in_page(copy_pos + copy_len); 1287 + if (mod) 1288 + copy_len += PAGE_SIZE - mod; 1289 + 1290 + invalidate_inode_pages2_range(iter->inode->i_mapping, 1291 + copy_pos >> PAGE_SHIFT, 1292 + (copy_pos + copy_len - 1) >> PAGE_SHIFT); 1293 + 1294 + id = dax_read_lock(); 1295 + ret = dax_iomap_direct_access(iomap, copy_pos, copy_len, &daddr, NULL); 1289 1296 if (ret < 0) 1290 1297 goto out_unlock; 1291 1298 1292 - if (copy_mc_to_kernel(daddr, saddr, length) == 0) 1293 - ret = length; 1299 + ret = dax_iomap_direct_access(srcmap, copy_pos, copy_len, &saddr, NULL); 1300 + if (ret < 0) 1301 + goto out_unlock; 1302 + 1303 + if (copy_mc_to_kernel(daddr, saddr, copy_len) == 0) 1304 + ret = iomap_length(iter); 1294 1305 else 1295 1306 ret = -EIO; 1296 1307
+3 -1
fs/erofs/super.c
··· 709 709 if (IS_ENABLED(CONFIG_EROFS_FS_ONDEMAND) && sbi->fsid) 710 710 return get_tree_nodev(fc, erofs_fc_fill_super); 711 711 712 - ret = get_tree_bdev(fc, erofs_fc_fill_super); 712 + ret = get_tree_bdev_flags(fc, erofs_fc_fill_super, 713 + IS_ENABLED(CONFIG_EROFS_FS_BACKED_BY_FILE) ? 714 + GET_TREE_BDEV_QUIET_LOOKUP : 0); 713 715 #ifdef CONFIG_EROFS_FS_BACKED_BY_FILE 714 716 if (ret == -ENOTBLK) { 715 717 if (!fc->source)
+1 -16
fs/iomap/buffered-io.c
··· 1277 1277 loff_t length = iomap_length(iter); 1278 1278 loff_t written = 0; 1279 1279 1280 - /* Don't bother with blocks that are not shared to start with. */ 1281 - if (!(iomap->flags & IOMAP_F_SHARED)) 1282 - return length; 1283 - 1284 - /* 1285 - * Don't bother with delalloc reservations, holes or unwritten extents. 1286 - * 1287 - * Note that we use srcmap directly instead of iomap_iter_srcmap as 1288 - * unsharing requires providing a separate source map, and the presence 1289 - * of one is a good indicator that unsharing is needed, unlike 1290 - * IOMAP_F_SHARED which can be set for any data that goes into the COW 1291 - * fork for XFS. 1292 - */ 1293 - if (iter->srcmap.type == IOMAP_HOLE || 1294 - iter->srcmap.type == IOMAP_DELALLOC || 1295 - iter->srcmap.type == IOMAP_UNWRITTEN) 1280 + if (!iomap_want_unshare_iter(iter)) 1296 1281 return length; 1297 1282 1298 1283 do {
+1 -2
fs/nfs/client.c
··· 181 181 #if IS_ENABLED(CONFIG_NFS_LOCALIO) 182 182 seqlock_init(&clp->cl_boot_lock); 183 183 ktime_get_real_ts64(&clp->cl_nfssvc_boot); 184 - clp->cl_uuid.net = NULL; 185 - clp->cl_uuid.dom = NULL; 184 + nfs_uuid_init(&clp->cl_uuid); 186 185 spin_lock_init(&clp->cl_localio_lock); 187 186 #endif /* CONFIG_NFS_LOCALIO */ 188 187
+47 -23
fs/nfs/inode.c
··· 205 205 nfs_fscache_invalidate(inode, 0); 206 206 flags &= ~NFS_INO_REVAL_FORCED; 207 207 208 - nfsi->cache_validity |= flags; 208 + flags |= nfsi->cache_validity; 209 + if (inode->i_mapping->nrpages == 0) 210 + flags &= ~NFS_INO_INVALID_DATA; 209 211 210 - if (inode->i_mapping->nrpages == 0) { 211 - nfsi->cache_validity &= ~NFS_INO_INVALID_DATA; 212 - nfs_ooo_clear(nfsi); 213 - } else if (nfsi->cache_validity & NFS_INO_INVALID_DATA) { 212 + /* pairs with nfs_clear_invalid_mapping()'s smp_load_acquire() */ 213 + smp_store_release(&nfsi->cache_validity, flags); 214 + 215 + if (inode->i_mapping->nrpages == 0 || 216 + nfsi->cache_validity & NFS_INO_INVALID_DATA) { 214 217 nfs_ooo_clear(nfsi); 215 218 } 216 219 trace_nfs_set_cache_invalid(inode, 0); ··· 631 628 } 632 629 } 633 630 631 + static void nfs_update_timestamps(struct inode *inode, unsigned int ia_valid) 632 + { 633 + enum file_time_flags time_flags = 0; 634 + unsigned int cache_flags = 0; 635 + 636 + if (ia_valid & ATTR_MTIME) { 637 + time_flags |= S_MTIME | S_CTIME; 638 + cache_flags |= NFS_INO_INVALID_CTIME | NFS_INO_INVALID_MTIME; 639 + } 640 + if (ia_valid & ATTR_ATIME) { 641 + time_flags |= S_ATIME; 642 + cache_flags |= NFS_INO_INVALID_ATIME; 643 + } 644 + inode_update_timestamps(inode, time_flags); 645 + NFS_I(inode)->cache_validity &= ~cache_flags; 646 + } 647 + 634 648 void nfs_update_delegated_atime(struct inode *inode) 635 649 { 636 650 spin_lock(&inode->i_lock); 637 - if (nfs_have_delegated_atime(inode)) { 638 - inode_update_timestamps(inode, S_ATIME); 639 - NFS_I(inode)->cache_validity &= ~NFS_INO_INVALID_ATIME; 640 - } 651 + if (nfs_have_delegated_atime(inode)) 652 + nfs_update_timestamps(inode, ATTR_ATIME); 641 653 spin_unlock(&inode->i_lock); 642 654 } 643 655 644 656 void nfs_update_delegated_mtime_locked(struct inode *inode) 645 657 { 646 - if (nfs_have_delegated_mtime(inode)) { 647 - inode_update_timestamps(inode, S_CTIME | S_MTIME); 648 - NFS_I(inode)->cache_validity &= ~(NFS_INO_INVALID_CTIME | 649 - NFS_INO_INVALID_MTIME); 650 - } 658 + if (nfs_have_delegated_mtime(inode)) 659 + nfs_update_timestamps(inode, ATTR_MTIME); 651 660 } 652 661 653 662 void nfs_update_delegated_mtime(struct inode *inode) ··· 697 682 attr->ia_valid &= ~ATTR_SIZE; 698 683 } 699 684 700 - if (nfs_have_delegated_mtime(inode)) { 701 - if (attr->ia_valid & ATTR_MTIME) { 702 - nfs_update_delegated_mtime(inode); 703 - attr->ia_valid &= ~ATTR_MTIME; 704 - } 705 - if (attr->ia_valid & ATTR_ATIME) { 706 - nfs_update_delegated_atime(inode); 707 - attr->ia_valid &= ~ATTR_ATIME; 708 - } 685 + if (nfs_have_delegated_mtime(inode) && attr->ia_valid & ATTR_MTIME) { 686 + spin_lock(&inode->i_lock); 687 + nfs_update_timestamps(inode, attr->ia_valid); 688 + spin_unlock(&inode->i_lock); 689 + attr->ia_valid &= ~(ATTR_MTIME | ATTR_ATIME); 690 + } else if (nfs_have_delegated_atime(inode) && 691 + attr->ia_valid & ATTR_ATIME && 692 + !(attr->ia_valid & ATTR_MTIME)) { 693 + nfs_update_delegated_atime(inode); 694 + attr->ia_valid &= ~ATTR_ATIME; 709 695 } 710 696 711 697 /* Optimization: if the end result is no change, don't RPC */ ··· 1424 1408 TASK_KILLABLE|TASK_FREEZABLE_UNSAFE); 1425 1409 if (ret) 1426 1410 goto out; 1411 + smp_rmb(); /* pairs with smp_wmb() below */ 1412 + if (test_bit(NFS_INO_INVALIDATING, bitlock)) 1413 + continue; 1414 + /* pairs with nfs_set_cache_invalid()'s smp_store_release() */ 1415 + if (!(smp_load_acquire(&nfsi->cache_validity) & NFS_INO_INVALID_DATA)) 1416 + goto out; 1417 + /* Slow-path that double-checks with spinlock held */ 1427 1418 spin_lock(&inode->i_lock); 1428 1419 if (test_bit(NFS_INO_INVALIDATING, bitlock)) { 1429 1420 spin_unlock(&inode->i_lock); ··· 1656 1633 fattr->gencount = nfs_inc_attr_generation_counter(); 1657 1634 fattr->owner_name = NULL; 1658 1635 fattr->group_name = NULL; 1636 + fattr->mdsthreshold = NULL; 1659 1637 } 1660 1638 EXPORT_SYMBOL_GPL(nfs_fattr_init); 1661 1639
+2 -1
fs/nfs/localio.c
··· 205 205 nfs_local_disable(clp); 206 206 } 207 207 208 - nfs_uuid_begin(&clp->cl_uuid); 208 + if (!nfs_uuid_begin(&clp->cl_uuid)) 209 + return; 209 210 if (nfs_server_uuid_is_local(clp)) 210 211 nfs_local_enable(clp); 211 212 nfs_uuid_end(&clp->cl_uuid);
+4
fs/nfs/nfs4proc.c
··· 3452 3452 adjust_flags |= NFS_INO_INVALID_MODE; 3453 3453 if (sattr->ia_valid & (ATTR_UID | ATTR_GID)) 3454 3454 adjust_flags |= NFS_INO_INVALID_OTHER; 3455 + if (sattr->ia_valid & ATTR_ATIME) 3456 + adjust_flags |= NFS_INO_INVALID_ATIME; 3457 + if (sattr->ia_valid & ATTR_MTIME) 3458 + adjust_flags |= NFS_INO_INVALID_MTIME; 3455 3459 3456 3460 do { 3457 3461 nfs4_bitmap_copy_adjust(bitmask, nfs4_bitmask(server, fattr->label),
+9 -1
fs/nfs/super.c
··· 885 885 * Now ask the mount server to map our export path 886 886 * to a file handle. 887 887 */ 888 - status = nfs_mount(&request, ctx->timeo, ctx->retrans); 888 + if ((request.protocol == XPRT_TRANSPORT_UDP) == 889 + !(ctx->flags & NFS_MOUNT_TCP)) 890 + /* 891 + * NFS protocol and mount protocol are both UDP or neither UDP 892 + * so timeouts are compatible. Use NFS timeouts for MOUNT 893 + */ 894 + status = nfs_mount(&request, ctx->timeo, ctx->retrans); 895 + else 896 + status = nfs_mount(&request, NFS_UNSPEC_TIMEO, NFS_UNSPEC_RETRANS); 889 897 if (status != 0) { 890 898 dfprintk(MOUNT, "NFS: unable to mount server %s, error %d\n", 891 899 request.hostname, status);
+18 -5
fs/nfs_common/nfslocalio.c
··· 5 5 */ 6 6 7 7 #include <linux/module.h> 8 - #include <linux/rculist.h> 8 + #include <linux/list.h> 9 9 #include <linux/nfslocalio.h> 10 10 #include <net/netns/generic.h> 11 11 ··· 20 20 */ 21 21 static LIST_HEAD(nfs_uuids); 22 22 23 - void nfs_uuid_begin(nfs_uuid_t *nfs_uuid) 23 + void nfs_uuid_init(nfs_uuid_t *nfs_uuid) 24 24 { 25 25 nfs_uuid->net = NULL; 26 26 nfs_uuid->dom = NULL; 27 - uuid_gen(&nfs_uuid->uuid); 27 + INIT_LIST_HEAD(&nfs_uuid->list); 28 + } 29 + EXPORT_SYMBOL_GPL(nfs_uuid_init); 28 30 31 + bool nfs_uuid_begin(nfs_uuid_t *nfs_uuid) 32 + { 29 33 spin_lock(&nfs_uuid_lock); 30 - list_add_tail_rcu(&nfs_uuid->list, &nfs_uuids); 34 + /* Is this nfs_uuid already in use? */ 35 + if (!list_empty(&nfs_uuid->list)) { 36 + spin_unlock(&nfs_uuid_lock); 37 + return false; 38 + } 39 + uuid_gen(&nfs_uuid->uuid); 40 + list_add_tail(&nfs_uuid->list, &nfs_uuids); 31 41 spin_unlock(&nfs_uuid_lock); 42 + 43 + return true; 32 44 } 33 45 EXPORT_SYMBOL_GPL(nfs_uuid_begin); 34 46 ··· 48 36 { 49 37 if (nfs_uuid->net == NULL) { 50 38 spin_lock(&nfs_uuid_lock); 51 - list_del_init(&nfs_uuid->list); 39 + if (nfs_uuid->net == NULL) 40 + list_del_init(&nfs_uuid->list); 52 41 spin_unlock(&nfs_uuid_lock); 53 42 } 54 43 }
+4 -6
fs/nfsd/nfs4proc.c
··· 1841 1841 if (!async_copy) 1842 1842 goto out_err; 1843 1843 async_copy->cp_nn = nn; 1844 - /* Arbitrary cap on number of pending async copy operations */ 1845 - if (atomic_inc_return(&nn->pending_async_copies) > 1846 - (int)rqstp->rq_pool->sp_nrthreads) { 1847 - atomic_dec(&nn->pending_async_copies); 1848 - goto out_err; 1849 - } 1850 1844 INIT_LIST_HEAD(&async_copy->copies); 1851 1845 refcount_set(&async_copy->refcount, 1); 1846 + /* Arbitrary cap on number of pending async copy operations */ 1847 + if (atomic_inc_return(&nn->pending_async_copies) > 1848 + (int)rqstp->rq_pool->sp_nrthreads) 1849 + goto out_err; 1852 1850 async_copy->cp_src = kmalloc(sizeof(*async_copy->cp_src), GFP_KERNEL); 1853 1851 if (!async_copy->cp_src) 1854 1852 goto out_err;
+3
fs/nilfs2/namei.c
··· 157 157 /* slow symlink */ 158 158 inode->i_op = &nilfs_symlink_inode_operations; 159 159 inode_nohighmem(inode); 160 + mapping_set_gfp_mask(inode->i_mapping, 161 + mapping_gfp_constraint(inode->i_mapping, 162 + ~__GFP_FS)); 160 163 inode->i_mapping->a_ops = &nilfs_aops; 161 164 err = page_symlink(inode, symname, l); 162 165 if (err)
+1 -1
fs/proc/softirqs.c
··· 20 20 for (i = 0; i < NR_SOFTIRQS; i++) { 21 21 seq_printf(p, "%12s:", softirq_to_name[i]); 22 22 for_each_possible_cpu(j) 23 - seq_printf(p, " %10u", kstat_softirqs_cpu(i, j)); 23 + seq_put_decimal_ull_width(p, " ", kstat_softirqs_cpu(i, j), 10); 24 24 seq_putc(p, '\n'); 25 25 } 26 26 return 0;
+5 -4
fs/squashfs/file_direct.c
··· 30 30 int mask = (1 << (msblk->block_log - PAGE_SHIFT)) - 1; 31 31 loff_t start_index = folio->index & ~mask; 32 32 loff_t end_index = start_index | mask; 33 - int i, n, pages, bytes, res = -ENOMEM; 33 + loff_t index; 34 + int i, pages, bytes, res = -ENOMEM; 34 35 struct page **page, *last_page; 35 36 struct squashfs_page_actor *actor; 36 37 void *pageaddr; ··· 46 45 return res; 47 46 48 47 /* Try to grab all the pages covered by the Squashfs block */ 49 - for (i = 0, n = start_index; n <= end_index; n++) { 50 - page[i] = (n == folio->index) ? target_page : 51 - grab_cache_page_nowait(target_page->mapping, n); 48 + for (i = 0, index = start_index; index <= end_index; index++) { 49 + page[i] = (index == folio->index) ? target_page : 50 + grab_cache_page_nowait(target_page->mapping, index); 52 51 53 52 if (page[i] == NULL) 54 53 continue;
+20 -6
fs/super.c
··· 1596 1596 EXPORT_SYMBOL_GPL(setup_bdev_super); 1597 1597 1598 1598 /** 1599 - * get_tree_bdev - Get a superblock based on a single block device 1599 + * get_tree_bdev_flags - Get a superblock based on a single block device 1600 1600 * @fc: The filesystem context holding the parameters 1601 1601 * @fill_super: Helper to initialise a new superblock 1602 + * @flags: GET_TREE_BDEV_* flags 1602 1603 */ 1603 - int get_tree_bdev(struct fs_context *fc, 1604 - int (*fill_super)(struct super_block *, 1605 - struct fs_context *)) 1604 + int get_tree_bdev_flags(struct fs_context *fc, 1605 + int (*fill_super)(struct super_block *sb, 1606 + struct fs_context *fc), unsigned int flags) 1606 1607 { 1607 1608 struct super_block *s; 1608 1609 int error = 0; ··· 1614 1613 1615 1614 error = lookup_bdev(fc->source, &dev); 1616 1615 if (error) { 1617 - errorf(fc, "%s: Can't lookup blockdev", fc->source); 1616 + if (!(flags & GET_TREE_BDEV_QUIET_LOOKUP)) 1617 + errorf(fc, "%s: Can't lookup blockdev", fc->source); 1618 1618 return error; 1619 1619 } 1620 - 1621 1620 fc->sb_flags |= SB_NOSEC; 1622 1621 s = sget_dev(fc, dev); 1623 1622 if (IS_ERR(s)) ··· 1644 1643 BUG_ON(fc->root); 1645 1644 fc->root = dget(s->s_root); 1646 1645 return 0; 1646 + } 1647 + EXPORT_SYMBOL_GPL(get_tree_bdev_flags); 1648 + 1649 + /** 1650 + * get_tree_bdev - Get a superblock based on a single block device 1651 + * @fc: The filesystem context holding the parameters 1652 + * @fill_super: Helper to initialise a new superblock 1653 + */ 1654 + int get_tree_bdev(struct fs_context *fc, 1655 + int (*fill_super)(struct super_block *, 1656 + struct fs_context *)) 1657 + { 1658 + return get_tree_bdev_flags(fc, fill_super, 0); 1647 1659 } 1648 1660 EXPORT_SYMBOL(get_tree_bdev); 1649 1661
+9 -3
fs/tracefs/inode.c
··· 392 392 struct tracefs_fs_info *sb_opts = sb->s_fs_info; 393 393 struct tracefs_fs_info *new_opts = fc->s_fs_info; 394 394 395 + if (!new_opts) 396 + return 0; 397 + 395 398 sync_filesystem(sb); 396 399 /* structure copy of new mount options to sb */ 397 400 *sb_opts = *new_opts; ··· 481 478 sb->s_op = &tracefs_super_operations; 482 479 sb->s_d_op = &tracefs_dentry_operations; 483 480 484 - tracefs_apply_options(sb, false); 485 - 486 481 return 0; 487 482 } 488 483 489 484 static int tracefs_get_tree(struct fs_context *fc) 490 485 { 491 - return get_tree_single(fc, tracefs_fill_super); 486 + int err = get_tree_single(fc, tracefs_fill_super); 487 + 488 + if (err) 489 + return err; 490 + 491 + return tracefs_reconfigure(fc); 492 492 } 493 493 494 494 static void tracefs_free_fc(struct fs_context *fc)
+1 -1
fs/xfs/libxfs/xfs_alloc.c
··· 1923 1923 error = -EFSCORRUPTED; 1924 1924 goto error0; 1925 1925 } 1926 - if (flen < bestrlen) 1926 + if (flen <= bestrlen) 1927 1927 break; 1928 1928 busy = xfs_alloc_compute_aligned(args, fbno, flen, 1929 1929 &rbno, &rlen, &busy_gen);
+51 -54
fs/xfs/xfs_filestream.c
··· 64 64 struct xfs_perag *pag; 65 65 struct xfs_perag *max_pag = NULL; 66 66 xfs_extlen_t minlen = *longest; 67 - xfs_extlen_t free = 0, minfree, maxfree = 0; 67 + xfs_extlen_t minfree, maxfree = 0; 68 68 xfs_agnumber_t agno; 69 69 bool first_pass = true; 70 - int err; 71 70 72 71 /* 2% of an AG's blocks must be free for it to be chosen. */ 73 72 minfree = mp->m_sb.sb_agblocks / 50; 74 73 75 74 restart: 76 75 for_each_perag_wrap(mp, start_agno, agno, pag) { 76 + int err; 77 + 77 78 trace_xfs_filestream_scan(pag, pino); 79 + 78 80 *longest = 0; 79 81 err = xfs_bmap_longest_free_extent(pag, NULL, longest); 80 82 if (err) { 81 - if (err != -EAGAIN) 82 - break; 83 - /* Couldn't lock the AGF, skip this AG. */ 84 - err = 0; 85 - continue; 83 + if (err == -EAGAIN) { 84 + /* Couldn't lock the AGF, skip this AG. */ 85 + err = 0; 86 + continue; 87 + } 88 + xfs_perag_rele(pag); 89 + if (max_pag) 90 + xfs_perag_rele(max_pag); 91 + return err; 86 92 } 87 93 88 94 /* Keep track of the AG with the most free blocks. */ ··· 113 107 !(flags & XFS_PICK_USERDATA) || 114 108 (flags & XFS_PICK_LOWSPACE))) { 115 109 /* Break out, retaining the reference on the AG. */ 116 - free = pag->pagf_freeblks; 117 - break; 110 + if (max_pag) 111 + xfs_perag_rele(max_pag); 112 + goto done; 118 113 } 119 114 } 120 115 ··· 123 116 atomic_dec(&pag->pagf_fstrms); 124 117 } 125 118 126 - if (err) { 127 - xfs_perag_rele(pag); 128 - if (max_pag) 129 - xfs_perag_rele(max_pag); 130 - return err; 119 + /* 120 + * Allow a second pass to give xfs_bmap_longest_free_extent() another 121 + * attempt at locking AGFs that it might have skipped over before we 122 + * fail. 123 + */ 124 + if (first_pass) { 125 + first_pass = false; 126 + goto restart; 131 127 } 132 128 133 - if (!pag) { 134 - /* 135 - * Allow a second pass to give xfs_bmap_longest_free_extent() 136 - * another attempt at locking AGFs that it might have skipped 137 - * over before we fail. 138 - */ 139 - if (first_pass) { 140 - first_pass = false; 141 - goto restart; 142 - } 143 - 144 - /* 145 - * We must be low on data space, so run a final lowspace 146 - * optimised selection pass if we haven't already. 147 - */ 148 - if (!(flags & XFS_PICK_LOWSPACE)) { 149 - flags |= XFS_PICK_LOWSPACE; 150 - goto restart; 151 - } 152 - 153 - /* 154 - * No unassociated AGs are available, so select the AG with the 155 - * most free space, regardless of whether it's already in use by 156 - * another filestream. It none suit, just use whatever AG we can 157 - * grab. 158 - */ 159 - if (!max_pag) { 160 - for_each_perag_wrap(args->mp, 0, start_agno, args->pag) 161 - break; 162 - atomic_inc(&args->pag->pagf_fstrms); 163 - *longest = 0; 164 - } else { 165 - pag = max_pag; 166 - free = maxfree; 167 - atomic_inc(&pag->pagf_fstrms); 168 - } 169 - } else if (max_pag) { 170 - xfs_perag_rele(max_pag); 129 + /* 130 + * We must be low on data space, so run a final lowspace optimised 131 + * selection pass if we haven't already. 132 + */ 133 + if (!(flags & XFS_PICK_LOWSPACE)) { 134 + flags |= XFS_PICK_LOWSPACE; 135 + goto restart; 171 136 } 172 137 173 - trace_xfs_filestream_pick(pag, pino, free); 138 + /* 139 + * No unassociated AGs are available, so select the AG with the most 140 + * free space, regardless of whether it's already in use by another 141 + * filestream. It none suit, just use whatever AG we can grab. 142 + */ 143 + if (!max_pag) { 144 + for_each_perag_wrap(args->mp, 0, start_agno, pag) { 145 + max_pag = pag; 146 + break; 147 + } 148 + 149 + /* Bail if there are no AGs at all to select from. */ 150 + if (!max_pag) 151 + return -ENOSPC; 152 + } 153 + 154 + pag = max_pag; 155 + atomic_inc(&pag->pagf_fstrms); 156 + done: 157 + trace_xfs_filestream_pick(pag, pino); 174 158 args->pag = pag; 175 159 return 0; 176 - 177 160 } 178 161 179 162 static struct xfs_inode *
+1 -1
fs/xfs/xfs_inode.c
··· 1409 1409 1410 1410 if (S_ISREG(VFS_I(ip)->i_mode) && 1411 1411 (ip->i_disk_size != 0 || XFS_ISIZE(ip) != 0 || 1412 - ip->i_df.if_nextents > 0 || ip->i_delayed_blks > 0)) 1412 + xfs_inode_has_filedata(ip))) 1413 1413 truncate = 1; 1414 1414 1415 1415 if (xfs_iflags_test(ip, XFS_IQUOTAUNCHECKED)) {
+5
fs/xfs/xfs_inode.h
··· 292 292 return xfs_is_reflink_inode(ip) || xfs_is_always_cow_inode(ip); 293 293 } 294 294 295 + static inline bool xfs_inode_has_filedata(const struct xfs_inode *ip) 296 + { 297 + return ip->i_df.if_nextents > 0 || ip->i_delayed_blks > 0; 298 + } 299 + 295 300 /* 296 301 * Check if an inode has any data in the COW fork. This might be often false 297 302 * even for inodes with the reflink flag when there is no pending COW operation.
+2 -2
fs/xfs/xfs_ioctl.c
··· 481 481 482 482 if (rtflag != XFS_IS_REALTIME_INODE(ip)) { 483 483 /* Can't change realtime flag if any extents are allocated. */ 484 - if (ip->i_df.if_nextents || ip->i_delayed_blks) 484 + if (xfs_inode_has_filedata(ip)) 485 485 return -EINVAL; 486 486 487 487 /* ··· 602 602 if (!fa->fsx_valid) 603 603 return 0; 604 604 605 - if (S_ISREG(VFS_I(ip)->i_mode) && ip->i_df.if_nextents && 605 + if (S_ISREG(VFS_I(ip)->i_mode) && xfs_inode_has_filedata(ip) && 606 606 XFS_FSB_TO_B(mp, ip->i_extsize) != fa->fsx_extsize) 607 607 return -EINVAL; 608 608
+1 -1
fs/xfs/xfs_iomap.c
··· 707 707 return false; 708 708 709 709 /* when zeroing we don't have to COW holes or unwritten extents */ 710 - if (flags & IOMAP_ZERO) { 710 + if (flags & (IOMAP_UNSHARE | IOMAP_ZERO)) { 711 711 if (!nimaps || 712 712 imap->br_startblock == HOLESTARTBLOCK || 713 713 imap->br_state == XFS_EXT_UNWRITTEN)
+5 -10
fs/xfs/xfs_trace.h
··· 691 691 DEFINE_FILESTREAM_EVENT(xfs_filestream_scan); 692 692 693 693 TRACE_EVENT(xfs_filestream_pick, 694 - TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino, xfs_extlen_t free), 695 - TP_ARGS(pag, ino, free), 694 + TP_PROTO(struct xfs_perag *pag, xfs_ino_t ino), 695 + TP_ARGS(pag, ino), 696 696 TP_STRUCT__entry( 697 697 __field(dev_t, dev) 698 698 __field(xfs_ino_t, ino) ··· 703 703 TP_fast_assign( 704 704 __entry->dev = pag->pag_mount->m_super->s_dev; 705 705 __entry->ino = ino; 706 - if (pag) { 707 - __entry->agno = pag->pag_agno; 708 - __entry->streams = atomic_read(&pag->pagf_fstrms); 709 - } else { 710 - __entry->agno = NULLAGNUMBER; 711 - __entry->streams = 0; 712 - } 713 - __entry->free = free; 706 + __entry->agno = pag->pag_agno; 707 + __entry->streams = atomic_read(&pag->pagf_fstrms); 708 + __entry->free = pag->pagf_freeblks; 714 709 ), 715 710 TP_printk("dev %d:%d ino 0x%llx agno 0x%x streams %d free %d", 716 711 MAJOR(__entry->dev), MINOR(__entry->dev),
+1 -1
include/acpi/cppc_acpi.h
··· 65 65 int write_cmd_status; 66 66 int write_cmd_id; 67 67 /* Lock used for RMW operations in cpc_write() */ 68 - spinlock_t rmw_lock; 68 + raw_spinlock_t rmw_lock; 69 69 struct cpc_register_resource cpc_regs[MAX_CPC_REG_ENT]; 70 70 struct acpi_psd_package domain_info; 71 71 struct kobject kobj;
+4
include/drm/drm_kunit_helpers.h
··· 120 120 const struct drm_crtc_funcs *funcs, 121 121 const struct drm_crtc_helper_funcs *helper_funcs); 122 122 123 + struct drm_display_mode * 124 + drm_kunit_display_mode_from_cea_vic(struct kunit *test, struct drm_device *dev, 125 + u8 video_code); 126 + 123 127 #endif // DRM_KUNIT_HELPERS_H_
+10 -6
include/linux/alloc_tag.h
··· 135 135 #endif 136 136 137 137 /* Caller should verify both ref and tag to be valid */ 138 - static inline void __alloc_tag_ref_set(union codetag_ref *ref, struct alloc_tag *tag) 138 + static inline bool __alloc_tag_ref_set(union codetag_ref *ref, struct alloc_tag *tag) 139 139 { 140 140 alloc_tag_add_check(ref, tag); 141 141 if (!ref || !tag) 142 - return; 142 + return false; 143 143 144 144 ref->ct = &tag->ct; 145 + return true; 145 146 } 146 147 147 - static inline void alloc_tag_ref_set(union codetag_ref *ref, struct alloc_tag *tag) 148 + static inline bool alloc_tag_ref_set(union codetag_ref *ref, struct alloc_tag *tag) 148 149 { 149 - __alloc_tag_ref_set(ref, tag); 150 + if (unlikely(!__alloc_tag_ref_set(ref, tag))) 151 + return false; 152 + 150 153 /* 151 154 * We need in increment the call counter every time we have a new 152 155 * allocation or when we split a large allocation into smaller ones. ··· 157 154 * counter because when we free each part the counter will be decremented. 158 155 */ 159 156 this_cpu_inc(tag->counters->calls); 157 + return true; 160 158 } 161 159 162 160 static inline void alloc_tag_add(union codetag_ref *ref, struct alloc_tag *tag, size_t bytes) 163 161 { 164 - alloc_tag_ref_set(ref, tag); 165 - this_cpu_add(tag->counters->bytes, bytes); 162 + if (likely(alloc_tag_ref_set(ref, tag))) 163 + this_cpu_add(tag->counters->bytes, bytes); 166 164 } 167 165 168 166 static inline void alloc_tag_sub(union codetag_ref *ref, size_t bytes)
+4
include/linux/compiler-gcc.h
··· 80 80 #define __noscs __attribute__((__no_sanitize__("shadow-call-stack"))) 81 81 #endif 82 82 83 + #ifdef __SANITIZE_HWADDRESS__ 84 + #define __no_sanitize_address __attribute__((__no_sanitize__("hwaddress"))) 85 + #else 83 86 #define __no_sanitize_address __attribute__((__no_sanitize_address__)) 87 + #endif 84 88 85 89 #if defined(__SANITIZE_THREAD__) 86 90 #define __no_sanitize_thread __attribute__((__no_sanitize_thread__))
+3
include/linux/device.h
··· 1078 1078 int (*fn)(struct device *dev, void *data)); 1079 1079 int device_for_each_child_reverse(struct device *dev, void *data, 1080 1080 int (*fn)(struct device *dev, void *data)); 1081 + int device_for_each_child_reverse_from(struct device *parent, 1082 + struct device *from, const void *data, 1083 + int (*fn)(struct device *, const void *)); 1081 1084 struct device *device_find_child(struct device *dev, void *data, 1082 1085 int (*match)(struct device *dev, void *data)); 1083 1086 struct device *device_find_child_by_name(struct device *parent,
+6
include/linux/fs_context.h
··· 160 160 161 161 int setup_bdev_super(struct super_block *sb, int sb_flags, 162 162 struct fs_context *fc); 163 + 164 + #define GET_TREE_BDEV_QUIET_LOOKUP 0x0001 165 + int get_tree_bdev_flags(struct fs_context *fc, 166 + int (*fill_super)(struct super_block *sb, 167 + struct fs_context *fc), unsigned int flags); 168 + 163 169 extern int get_tree_bdev(struct fs_context *fc, 164 170 int (*fill_super)(struct super_block *sb, 165 171 struct fs_context *fc));
+9 -1
include/linux/input.h
··· 339 339 * @name: name given to the handle by handler that created it 340 340 * @dev: input device the handle is attached to 341 341 * @handler: handler that works with the device through this handle 342 + * @handle_events: event sequence handler. It is set up by the input core 343 + * according to event handling method specified in the @handler. See 344 + * input_handle_setup_event_handler(). 345 + * This method is being called by the input core with interrupts disabled 346 + * and dev->event_lock spinlock held and so it may not sleep. 342 347 * @d_node: used to put the handle on device's list of attached handles 343 348 * @h_node: used to put the handle on handler's list of handles from which 344 349 * it gets events 345 350 */ 346 351 struct input_handle { 347 - 348 352 void *private; 349 353 350 354 int open; ··· 356 352 357 353 struct input_dev *dev; 358 354 struct input_handler *handler; 355 + 356 + unsigned int (*handle_events)(struct input_handle *handle, 357 + struct input_value *vals, 358 + unsigned int count); 359 359 360 360 struct list_head d_node; 361 361 struct list_head h_node;
+19
include/linux/iomap.h
··· 270 270 return round_up(pos + written, i_blocksize(inode)); 271 271 } 272 272 273 + /* 274 + * Check if the range needs to be unshared for a FALLOC_FL_UNSHARE_RANGE 275 + * operation. 276 + * 277 + * Don't bother with blocks that are not shared to start with; or mappings that 278 + * cannot be shared, such as inline data, delalloc reservations, holes or 279 + * unwritten extents. 280 + * 281 + * Note that we use srcmap directly instead of iomap_iter_srcmap as unsharing 282 + * requires providing a separate source map, and the presence of one is a good 283 + * indicator that unsharing is needed, unlike IOMAP_F_SHARED which can be set 284 + * for any data that goes into the COW fork for XFS. 285 + */ 286 + static inline bool iomap_want_unshare_iter(const struct iomap_iter *iter) 287 + { 288 + return (iter->iomap.flags & IOMAP_F_SHARED) && 289 + iter->srcmap.type == IOMAP_MAPPED; 290 + } 291 + 273 292 ssize_t iomap_file_buffered_write(struct kiocb *iocb, struct iov_iter *from, 274 293 const struct iomap_ops *ops, void *private); 275 294 int iomap_read_folio(struct folio *folio, const struct iomap_ops *ops);
+3 -4
include/linux/mmzone.h
··· 458 458 459 459 enum { 460 460 MM_LEAF_TOTAL, /* total leaf entries */ 461 - MM_LEAF_OLD, /* old leaf entries */ 462 461 MM_LEAF_YOUNG, /* young leaf entries */ 463 - MM_NONLEAF_TOTAL, /* total non-leaf entries */ 464 462 MM_NONLEAF_FOUND, /* non-leaf entries found in Bloom filters */ 465 463 MM_NONLEAF_ADDED, /* non-leaf entries added to Bloom filters */ 466 464 NR_MM_STATS ··· 555 557 556 558 void lru_gen_init_pgdat(struct pglist_data *pgdat); 557 559 void lru_gen_init_lruvec(struct lruvec *lruvec); 558 - void lru_gen_look_around(struct page_vma_mapped_walk *pvmw); 560 + bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw); 559 561 560 562 void lru_gen_init_memcg(struct mem_cgroup *memcg); 561 563 void lru_gen_exit_memcg(struct mem_cgroup *memcg); ··· 574 576 { 575 577 } 576 578 577 - static inline void lru_gen_look_around(struct page_vma_mapped_walk *pvmw) 579 + static inline bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw) 578 580 { 581 + return false; 579 582 } 580 583 581 584 static inline void lru_gen_init_memcg(struct mem_cgroup *memcg)
+2 -1
include/linux/nfslocalio.h
··· 32 32 struct auth_domain *dom; /* auth_domain for localio */ 33 33 } nfs_uuid_t; 34 34 35 - void nfs_uuid_begin(nfs_uuid_t *); 35 + void nfs_uuid_init(nfs_uuid_t *); 36 + bool nfs_uuid_begin(nfs_uuid_t *); 36 37 void nfs_uuid_end(nfs_uuid_t *); 37 38 void nfs_uuid_is_local(const uuid_t *, struct list_head *, 38 39 struct net *, struct auth_domain *, struct module *);
+8
include/linux/page-flags.h
··· 975 975 } \ 976 976 static __always_inline void __folio_set_##fname(struct folio *folio) \ 977 977 { \ 978 + if (folio_test_##fname(folio)) \ 979 + return; \ 978 980 VM_BUG_ON_FOLIO(data_race(folio->page.page_type) != UINT_MAX, \ 979 981 folio); \ 980 982 folio->page.page_type = (unsigned int)PGTY_##lname << 24; \ 981 983 } \ 982 984 static __always_inline void __folio_clear_##fname(struct folio *folio) \ 983 985 { \ 986 + if (folio->page.page_type == UINT_MAX) \ 987 + return; \ 984 988 VM_BUG_ON_FOLIO(!folio_test_##fname(folio), folio); \ 985 989 folio->page.page_type = UINT_MAX; \ 986 990 } ··· 997 993 } \ 998 994 static __always_inline void __SetPage##uname(struct page *page) \ 999 995 { \ 996 + if (Page##uname(page)) \ 997 + return; \ 1000 998 VM_BUG_ON_PAGE(data_race(page->page_type) != UINT_MAX, page); \ 1001 999 page->page_type = (unsigned int)PGTY_##lname << 24; \ 1002 1000 } \ 1003 1001 static __always_inline void __ClearPage##uname(struct page *page) \ 1004 1002 { \ 1003 + if (page->page_type == UINT_MAX) \ 1004 + return; \ 1005 1005 VM_BUG_ON_PAGE(!Page##uname(page), page); \ 1006 1006 page->page_type = UINT_MAX; \ 1007 1007 }
+2
include/linux/soc/qcom/llcc-qcom.h
··· 125 125 * @num_banks: Number of llcc banks 126 126 * @bitmap: Bit map to track the active slice ids 127 127 * @ecc_irq: interrupt for llcc cache error detection and reporting 128 + * @ecc_irq_configured: 'True' if firmware has already configured the irq propagation 128 129 * @version: Indicates the LLCC version 129 130 */ 130 131 struct llcc_drv_data { ··· 140 139 u32 num_banks; 141 140 unsigned long *bitmap; 142 141 int ecc_irq; 142 + bool ecc_irq_configured; 143 143 u32 version; 144 144 }; 145 145
+1
include/linux/swap.h
··· 335 335 * list. 336 336 */ 337 337 struct work_struct discard_work; /* discard worker */ 338 + struct work_struct reclaim_work; /* reclaim worker */ 338 339 struct list_head discard_clusters; /* discard clusters list */ 339 340 struct plist_node avail_lists[]; /* 340 341 * entries in swap_avail_heads, one
+8
include/linux/tick.h
··· 251 251 if (tick_nohz_full_enabled()) 252 252 tick_nohz_dep_set_task(tsk, bit); 253 253 } 254 + 254 255 static inline void tick_dep_clear_task(struct task_struct *tsk, 255 256 enum tick_dep_bits bit) 256 257 { 257 258 if (tick_nohz_full_enabled()) 258 259 tick_nohz_dep_clear_task(tsk, bit); 259 260 } 261 + 262 + static inline void tick_dep_init_task(struct task_struct *tsk) 263 + { 264 + atomic_set(&tsk->tick_dep_mask, 0); 265 + } 266 + 260 267 static inline void tick_dep_set_signal(struct task_struct *tsk, 261 268 enum tick_dep_bits bit) 262 269 { ··· 297 290 enum tick_dep_bits bit) { } 298 291 static inline void tick_dep_clear_task(struct task_struct *tsk, 299 292 enum tick_dep_bits bit) { } 293 + static inline void tick_dep_init_task(struct task_struct *tsk) { } 300 294 static inline void tick_dep_set_signal(struct task_struct *tsk, 301 295 enum tick_dep_bits bit) { } 302 296 static inline void tick_dep_clear_signal(struct signal_struct *signal,
+4
include/net/netfilter/nf_tables.h
··· 1103 1103 * @name: name of the chain 1104 1104 * @udlen: user data length 1105 1105 * @udata: user data in the chain 1106 + * @rcu_head: rcu head for deferred release 1106 1107 * @blob_next: rule blob pointer to the next in the chain 1107 1108 */ 1108 1109 struct nft_chain { ··· 1121 1120 char *name; 1122 1121 u16 udlen; 1123 1122 u8 *udata; 1123 + struct rcu_head rcu_head; 1124 1124 1125 1125 /* Only used during control plane commit phase: */ 1126 1126 struct nft_rule_blob *blob_next; ··· 1265 1263 * @sets: sets in the table 1266 1264 * @objects: stateful objects in the table 1267 1265 * @flowtables: flow tables in the table 1266 + * @net: netnamespace this table belongs to 1268 1267 * @hgenerator: handle generator state 1269 1268 * @handle: table handle 1270 1269 * @use: number of chain references to this table ··· 1285 1282 struct list_head sets; 1286 1283 struct list_head objects; 1287 1284 struct list_head flowtables; 1285 + possible_net_t net; 1288 1286 u64 hgenerator; 1289 1287 u64 handle; 1290 1288 u32 use;
+6 -1
include/trace/events/afs.h
··· 331 331 EM(afs_edit_dir_delete, "delete") \ 332 332 EM(afs_edit_dir_delete_error, "d_err ") \ 333 333 EM(afs_edit_dir_delete_inval, "d_invl") \ 334 - E_(afs_edit_dir_delete_noent, "d_nent") 334 + EM(afs_edit_dir_delete_noent, "d_nent") \ 335 + EM(afs_edit_dir_update_dd, "u_ddot") \ 336 + EM(afs_edit_dir_update_error, "u_fail") \ 337 + EM(afs_edit_dir_update_inval, "u_invl") \ 338 + E_(afs_edit_dir_update_nodd, "u_nodd") 335 339 336 340 #define afs_edit_dir_reasons \ 337 341 EM(afs_edit_dir_for_create, "Create") \ ··· 344 340 EM(afs_edit_dir_for_rename_0, "Renam0") \ 345 341 EM(afs_edit_dir_for_rename_1, "Renam1") \ 346 342 EM(afs_edit_dir_for_rename_2, "Renam2") \ 343 + EM(afs_edit_dir_for_rename_sub, "RnmSub") \ 347 344 EM(afs_edit_dir_for_rmdir, "RmDir ") \ 348 345 EM(afs_edit_dir_for_silly_0, "S_Ren0") \ 349 346 EM(afs_edit_dir_for_silly_1, "S_Ren1") \
+1
include/trace/events/rxrpc.h
··· 287 287 EM(rxrpc_call_see_input, "SEE input ") \ 288 288 EM(rxrpc_call_see_release, "SEE release ") \ 289 289 EM(rxrpc_call_see_userid_exists, "SEE u-exists") \ 290 + EM(rxrpc_call_see_waiting_call, "SEE q-conn ") \ 290 291 E_(rxrpc_call_see_zap, "SEE zap ") 291 292 292 293 #define rxrpc_txqueue_traces \
+21 -2
io_uring/rw.c
··· 1014 1014 return IOU_OK; 1015 1015 } 1016 1016 1017 + static bool io_kiocb_start_write(struct io_kiocb *req, struct kiocb *kiocb) 1018 + { 1019 + struct inode *inode; 1020 + bool ret; 1021 + 1022 + if (!(req->flags & REQ_F_ISREG)) 1023 + return true; 1024 + if (!(kiocb->ki_flags & IOCB_NOWAIT)) { 1025 + kiocb_start_write(kiocb); 1026 + return true; 1027 + } 1028 + 1029 + inode = file_inode(kiocb->ki_filp); 1030 + ret = sb_start_write_trylock(inode->i_sb); 1031 + if (ret) 1032 + __sb_writers_release(inode->i_sb, SB_FREEZE_WRITE); 1033 + return ret; 1034 + } 1035 + 1017 1036 int io_write(struct io_kiocb *req, unsigned int issue_flags) 1018 1037 { 1019 1038 bool force_nonblock = issue_flags & IO_URING_F_NONBLOCK; ··· 1070 1051 if (unlikely(ret)) 1071 1052 return ret; 1072 1053 1073 - if (req->flags & REQ_F_ISREG) 1074 - kiocb_start_write(kiocb); 1054 + if (unlikely(!io_kiocb_start_write(req, kiocb))) 1055 + return -EAGAIN; 1075 1056 kiocb->ki_flags |= IOCB_WRITE; 1076 1057 1077 1058 if (likely(req->file->f_op->write_iter))
+1 -1
kernel/events/core.c
··· 13959 13959 } 13960 13960 13961 13961 /* migrate */ 13962 - list_for_each_entry_rcu(pmu, &pmus, entry, lockdep_is_held(&pmus_srcu)) { 13962 + list_for_each_entry(pmu, &pmus, entry) { 13963 13963 if (pmu->scope == PERF_PMU_SCOPE_NONE || 13964 13964 WARN_ON_ONCE(pmu->scope >= PERF_PMU_MAX_SCOPE)) 13965 13965 continue;
+2
kernel/fork.c
··· 105 105 #include <linux/rseq.h> 106 106 #include <uapi/linux/pidfd.h> 107 107 #include <linux/pidfs.h> 108 + #include <linux/tick.h> 108 109 109 110 #include <asm/pgalloc.h> 110 111 #include <linux/uaccess.h> ··· 2293 2292 acct_clear_integrals(p); 2294 2293 2295 2294 posix_cputimers_init(&p->posix_cputimers); 2295 + tick_dep_init_task(p); 2296 2296 2297 2297 p->io_context = NULL; 2298 2298 audit_set_context(p, NULL);
+1 -1
kernel/irq/msi.c
··· 718 718 ret = ops->msi_init(domain, info, virq + i, hwirq + i, arg); 719 719 if (ret < 0) { 720 720 if (ops->msi_free) { 721 - for (i--; i > 0; i--) 721 + for (i--; i >= 0; i--) 722 722 ops->msi_free(domain, info, virq + i); 723 723 } 724 724 irq_domain_free_irqs_top(domain, virq, nr_irqs);
+4 -4
kernel/sched/core.c
··· 4711 4711 if (rt_prio(p->prio)) { 4712 4712 p->sched_class = &rt_sched_class; 4713 4713 #ifdef CONFIG_SCHED_CLASS_EXT 4714 - } else if (task_should_scx(p)) { 4714 + } else if (task_should_scx(p->policy)) { 4715 4715 p->sched_class = &ext_sched_class; 4716 4716 #endif 4717 4717 } else { ··· 7025 7025 } 7026 7026 EXPORT_SYMBOL(default_wake_function); 7027 7027 7028 - const struct sched_class *__setscheduler_class(struct task_struct *p, int prio) 7028 + const struct sched_class *__setscheduler_class(int policy, int prio) 7029 7029 { 7030 7030 if (dl_prio(prio)) 7031 7031 return &dl_sched_class; ··· 7034 7034 return &rt_sched_class; 7035 7035 7036 7036 #ifdef CONFIG_SCHED_CLASS_EXT 7037 - if (task_should_scx(p)) 7037 + if (task_should_scx(policy)) 7038 7038 return &ext_sched_class; 7039 7039 #endif 7040 7040 ··· 7142 7142 queue_flag &= ~DEQUEUE_MOVE; 7143 7143 7144 7144 prev_class = p->sched_class; 7145 - next_class = __setscheduler_class(p, prio); 7145 + next_class = __setscheduler_class(p->policy, prio); 7146 7146 7147 7147 if (prev_class != next_class && p->se.sched_delayed) 7148 7148 dequeue_task(rq, p, DEQUEUE_SLEEP | DEQUEUE_DELAYED | DEQUEUE_NOCLOCK);
+14 -4
kernel/sched/ext.c
··· 4257 4257 * Used by sched_fork() and __setscheduler_prio() to pick the matching 4258 4258 * sched_class. dl/rt are already handled. 4259 4259 */ 4260 - bool task_should_scx(struct task_struct *p) 4260 + bool task_should_scx(int policy) 4261 4261 { 4262 4262 if (!scx_enabled() || 4263 4263 unlikely(scx_ops_enable_state() == SCX_OPS_DISABLING)) 4264 4264 return false; 4265 4265 if (READ_ONCE(scx_switching_all)) 4266 4266 return true; 4267 - return p->policy == SCHED_EXT; 4267 + return policy == SCHED_EXT; 4268 4268 } 4269 4269 4270 4270 /** ··· 4494 4494 scx_task_iter_start(&sti); 4495 4495 while ((p = scx_task_iter_next_locked(&sti))) { 4496 4496 const struct sched_class *old_class = p->sched_class; 4497 + const struct sched_class *new_class = 4498 + __setscheduler_class(p->policy, p->prio); 4497 4499 struct sched_enq_and_set_ctx ctx; 4500 + 4501 + if (old_class != new_class && p->se.sched_delayed) 4502 + dequeue_task(task_rq(p), p, DEQUEUE_SLEEP | DEQUEUE_DELAYED); 4498 4503 4499 4504 sched_deq_and_put_task(p, DEQUEUE_SAVE | DEQUEUE_MOVE, &ctx); 4500 4505 4501 - p->sched_class = __setscheduler_class(p, p->prio); 4506 + p->sched_class = new_class; 4502 4507 check_class_changing(task_rq(p), p, old_class); 4503 4508 4504 4509 sched_enq_and_set_task(&ctx); ··· 5209 5204 scx_task_iter_start(&sti); 5210 5205 while ((p = scx_task_iter_next_locked(&sti))) { 5211 5206 const struct sched_class *old_class = p->sched_class; 5207 + const struct sched_class *new_class = 5208 + __setscheduler_class(p->policy, p->prio); 5212 5209 struct sched_enq_and_set_ctx ctx; 5210 + 5211 + if (old_class != new_class && p->se.sched_delayed) 5212 + dequeue_task(task_rq(p), p, DEQUEUE_SLEEP | DEQUEUE_DELAYED); 5213 5213 5214 5214 sched_deq_and_put_task(p, DEQUEUE_SAVE | DEQUEUE_MOVE, &ctx); 5215 5215 5216 5216 p->scx.slice = SCX_SLICE_DFL; 5217 - p->sched_class = __setscheduler_class(p, p->prio); 5217 + p->sched_class = new_class; 5218 5218 check_class_changing(task_rq(p), p, old_class); 5219 5219 5220 5220 sched_enq_and_set_task(&ctx);
+1 -1
kernel/sched/ext.h
··· 18 18 void scx_rq_activate(struct rq *rq); 19 19 void scx_rq_deactivate(struct rq *rq); 20 20 int scx_check_setscheduler(struct task_struct *p, int policy); 21 - bool task_should_scx(struct task_struct *p); 21 + bool task_should_scx(int policy); 22 22 void init_sched_ext_class(void); 23 23 24 24 static inline u32 scx_cpuperf_target(s32 cpu)
+17 -10
kernel/sched/fair.c
··· 3369 3369 vma = vma_next(&vmi); 3370 3370 } 3371 3371 3372 - do { 3372 + for (; vma; vma = vma_next(&vmi)) { 3373 3373 if (!vma_migratable(vma) || !vma_policy_mof(vma) || 3374 3374 is_vm_hugetlb_page(vma) || (vma->vm_flags & VM_MIXEDMAP)) { 3375 3375 trace_sched_skip_vma_numa(mm, vma, NUMAB_SKIP_UNSUITABLE); ··· 3491 3491 */ 3492 3492 if (vma_pids_forced) 3493 3493 break; 3494 - } for_each_vma(vmi, vma); 3494 + } 3495 3495 3496 3496 /* 3497 3497 * If no VMAs are remaining and VMAs were skipped due to the PID ··· 5625 5625 struct sched_entity *se = pick_eevdf(cfs_rq); 5626 5626 if (se->sched_delayed) { 5627 5627 dequeue_entities(rq, se, DEQUEUE_SLEEP | DEQUEUE_DELAYED); 5628 - SCHED_WARN_ON(se->sched_delayed); 5629 - SCHED_WARN_ON(se->on_rq); 5628 + /* 5629 + * Must not reference @se again, see __block_task(). 5630 + */ 5630 5631 return NULL; 5631 5632 } 5632 5633 return se; ··· 7177 7176 /* Fix-up what dequeue_task_fair() skipped */ 7178 7177 hrtick_update(rq); 7179 7178 7180 - /* Fix-up what block_task() skipped. */ 7179 + /* 7180 + * Fix-up what block_task() skipped. 7181 + * 7182 + * Must be last, @p might not be valid after this. 7183 + */ 7181 7184 __block_task(rq, p); 7182 7185 } 7183 7186 ··· 7198 7193 if (!(p->se.sched_delayed && (task_on_rq_migrating(p) || (flags & DEQUEUE_SAVE)))) 7199 7194 util_est_dequeue(&rq->cfs, p); 7200 7195 7201 - if (dequeue_entities(rq, &p->se, flags) < 0) { 7202 - util_est_update(&rq->cfs, p, DEQUEUE_SLEEP); 7203 - return false; 7204 - } 7205 - 7206 7196 util_est_update(&rq->cfs, p, flags & DEQUEUE_SLEEP); 7197 + if (dequeue_entities(rq, &p->se, flags) < 0) 7198 + return false; 7199 + 7200 + /* 7201 + * Must not reference @p after dequeue_entities(DEQUEUE_DELAYED). 7202 + */ 7203 + 7207 7204 hrtick_update(rq); 7208 7205 return true; 7209 7206 }
+33 -3
kernel/sched/sched.h
··· 2769 2769 2770 2770 static inline void __block_task(struct rq *rq, struct task_struct *p) 2771 2771 { 2772 - WRITE_ONCE(p->on_rq, 0); 2773 - ASSERT_EXCLUSIVE_WRITER(p->on_rq); 2774 2772 if (p->sched_contributes_to_load) 2775 2773 rq->nr_uninterruptible++; 2776 2774 ··· 2776 2778 atomic_inc(&rq->nr_iowait); 2777 2779 delayacct_blkio_start(); 2778 2780 } 2781 + 2782 + ASSERT_EXCLUSIVE_WRITER(p->on_rq); 2783 + 2784 + /* 2785 + * The moment this write goes through, ttwu() can swoop in and migrate 2786 + * this task, rendering our rq->__lock ineffective. 2787 + * 2788 + * __schedule() try_to_wake_up() 2789 + * LOCK rq->__lock LOCK p->pi_lock 2790 + * pick_next_task() 2791 + * pick_next_task_fair() 2792 + * pick_next_entity() 2793 + * dequeue_entities() 2794 + * __block_task() 2795 + * RELEASE p->on_rq = 0 if (p->on_rq && ...) 2796 + * break; 2797 + * 2798 + * ACQUIRE (after ctrl-dep) 2799 + * 2800 + * cpu = select_task_rq(); 2801 + * set_task_cpu(p, cpu); 2802 + * ttwu_queue() 2803 + * ttwu_do_activate() 2804 + * LOCK rq->__lock 2805 + * activate_task() 2806 + * STORE p->on_rq = 1 2807 + * UNLOCK rq->__lock 2808 + * 2809 + * Callers must ensure to not reference @p after this -- we no longer 2810 + * own it. 2811 + */ 2812 + smp_store_release(&p->on_rq, 0); 2779 2813 } 2780 2814 2781 2815 extern void activate_task(struct rq *rq, struct task_struct *p, int flags); ··· 3830 3800 3831 3801 extern int __sched_setscheduler(struct task_struct *p, const struct sched_attr *attr, bool user, bool pi); 3832 3802 extern int __sched_setaffinity(struct task_struct *p, struct affinity_context *ctx); 3833 - extern const struct sched_class *__setscheduler_class(struct task_struct *p, int prio); 3803 + extern const struct sched_class *__setscheduler_class(int policy, int prio); 3834 3804 extern void set_load_weight(struct task_struct *p, bool update_load); 3835 3805 extern void enqueue_task(struct rq *rq, struct task_struct *p, int flags); 3836 3806 extern bool dequeue_task(struct rq *rq, struct task_struct *p, int flags);
+1 -1
kernel/sched/syscalls.c
··· 707 707 } 708 708 709 709 prev_class = p->sched_class; 710 - next_class = __setscheduler_class(p, newprio); 710 + next_class = __setscheduler_class(policy, newprio); 711 711 712 712 if (prev_class != next_class && p->se.sched_delayed) 713 713 dequeue_task(rq, p, DEQUEUE_SLEEP | DEQUEUE_DELAYED | DEQUEUE_NOCLOCK);
+4
kernel/trace/trace.c
··· 5501 5501 5502 5502 static const char readme_msg[] = 5503 5503 "tracing mini-HOWTO:\n\n" 5504 + "By default tracefs removes all OTH file permission bits.\n" 5505 + "When mounting tracefs an optional group id can be specified\n" 5506 + "which adds the group to every directory and file in tracefs:\n\n" 5507 + "\t e.g. mount -t tracefs [-o [gid=<gid>]] nodev /sys/kernel/tracing\n\n" 5504 5508 "# echo 0 > tracing_on : quick way to disable tracing\n" 5505 5509 "# echo 1 > tracing_on : quick way to re-enable tracing\n\n" 5506 5510 " Important files:\n"
+2 -5
lib/Kconfig.kasan
··· 22 22 config CC_HAS_KASAN_GENERIC 23 23 def_bool $(cc-option, -fsanitize=kernel-address) 24 24 25 - # GCC appears to ignore no_sanitize_address when -fsanitize=kernel-hwaddress 26 - # is passed. See https://bugzilla.kernel.org/show_bug.cgi?id=218854 (and 27 - # the linked LKML thread) for more details. 28 25 config CC_HAS_KASAN_SW_TAGS 29 - def_bool !CC_IS_GCC && $(cc-option, -fsanitize=kernel-hwaddress) 26 + def_bool $(cc-option, -fsanitize=kernel-hwaddress) 30 27 31 28 # This option is only required for software KASAN modes. 32 29 # Old GCC versions do not have proper support for no_sanitize_address. ··· 98 101 help 99 102 Enables Software Tag-Based KASAN. 100 103 101 - Requires Clang. 104 + Requires GCC 11+ or Clang. 102 105 103 106 Supported only on arm64 CPUs and relies on Top Byte Ignore. 104 107
+15 -10
lib/iov_iter.c
··· 461 461 size_t bytes, struct iov_iter *i) 462 462 { 463 463 size_t n, copied = 0; 464 + bool uses_kmap = IS_ENABLED(CONFIG_DEBUG_KMAP_LOCAL_FORCE_MAP) || 465 + PageHighMem(page); 464 466 465 467 if (!page_copy_sane(page, offset, bytes)) 466 468 return 0; ··· 473 471 char *p; 474 472 475 473 n = bytes - copied; 476 - if (PageHighMem(page)) { 474 + if (uses_kmap) { 477 475 page += offset / PAGE_SIZE; 478 476 offset %= PAGE_SIZE; 479 477 n = min_t(size_t, n, PAGE_SIZE - offset); ··· 484 482 kunmap_atomic(p); 485 483 copied += n; 486 484 offset += n; 487 - } while (PageHighMem(page) && copied != bytes && n > 0); 485 + } while (uses_kmap && copied != bytes && n > 0); 488 486 489 487 return copied; 490 488 } ··· 1023 1021 size_t offset = iov_offset, fsize = folioq_folio_size(folioq, slot); 1024 1022 size_t part = PAGE_SIZE - offset % PAGE_SIZE; 1025 1023 1026 - part = umin(part, umin(maxsize - extracted, fsize - offset)); 1027 - count -= part; 1028 - iov_offset += part; 1029 - extracted += part; 1024 + if (offset < fsize) { 1025 + part = umin(part, umin(maxsize - extracted, fsize - offset)); 1026 + count -= part; 1027 + iov_offset += part; 1028 + extracted += part; 1030 1029 1031 - *pages = folio_page(folio, offset / PAGE_SIZE); 1032 - get_page(*pages); 1033 - pages++; 1034 - maxpages--; 1030 + *pages = folio_page(folio, offset / PAGE_SIZE); 1031 + get_page(*pages); 1032 + pages++; 1033 + maxpages--; 1034 + } 1035 + 1035 1036 if (maxpages == 0 || extracted >= maxsize) 1036 1037 break; 1037 1038
+19 -14
mm/gup.c
··· 2394 2394 } 2395 2395 2396 2396 /* 2397 - * Check whether all folios are *allowed* to be pinned indefinitely (longterm). 2397 + * Check whether all folios are *allowed* to be pinned indefinitely (long term). 2398 2398 * Rather confusingly, all folios in the range are required to be pinned via 2399 2399 * FOLL_PIN, before calling this routine. 2400 2400 * 2401 - * If any folios in the range are not allowed to be pinned, then this routine 2402 - * will migrate those folios away, unpin all the folios in the range and return 2403 - * -EAGAIN. The caller should re-pin the entire range with FOLL_PIN and then 2404 - * call this routine again. 2401 + * Return values: 2405 2402 * 2406 - * If an error other than -EAGAIN occurs, this indicates a migration failure. 2407 - * The caller should give up, and propagate the error back up the call stack. 2408 - * 2409 - * If everything is OK and all folios in the range are allowed to be pinned, 2403 + * 0: if everything is OK and all folios in the range are allowed to be pinned, 2410 2404 * then this routine leaves all folios pinned and returns zero for success. 2405 + * 2406 + * -EAGAIN: if any folios in the range are not allowed to be pinned, then this 2407 + * routine will migrate those folios away, unpin all the folios in the range. If 2408 + * migration of the entire set of folios succeeds, then -EAGAIN is returned. The 2409 + * caller should re-pin the entire range with FOLL_PIN and then call this 2410 + * routine again. 2411 + * 2412 + * -ENOMEM, or any other -errno: if an error *other* than -EAGAIN occurs, this 2413 + * indicates a migration failure. The caller should give up, and propagate the 2414 + * error back up the call stack. The caller does not need to unpin any folios in 2415 + * that case, because this routine will do the unpinning. 2411 2416 */ 2412 2417 static long check_and_migrate_movable_folios(unsigned long nr_folios, 2413 2418 struct folio **folios) ··· 2430 2425 } 2431 2426 2432 2427 /* 2433 - * This routine just converts all the pages in the @pages array to folios and 2434 - * calls check_and_migrate_movable_folios() to do the heavy lifting. 2435 - * 2436 - * Please see the check_and_migrate_movable_folios() documentation for details. 2428 + * Return values and behavior are the same as those for 2429 + * check_and_migrate_movable_folios(). 2437 2430 */ 2438 2431 static long check_and_migrate_movable_pages(unsigned long nr_pages, 2439 2432 struct page **pages) ··· 2440 2437 long i, ret; 2441 2438 2442 2439 folios = kmalloc_array(nr_pages, sizeof(*folios), GFP_KERNEL); 2443 - if (!folios) 2440 + if (!folios) { 2441 + unpin_user_pages(pages, nr_pages); 2444 2442 return -ENOMEM; 2443 + } 2445 2444 2446 2445 for (i = 0; i < nr_pages; i++) 2447 2446 folios[i] = page_folio(pages[i]);
-27
mm/kasan/kasan_test_c.c
··· 1810 1810 free_pages((unsigned long)p_ptr, 1); 1811 1811 } 1812 1812 1813 - static void vmalloc_percpu(struct kunit *test) 1814 - { 1815 - char __percpu *ptr; 1816 - int cpu; 1817 - 1818 - /* 1819 - * This test is specifically crafted for the software tag-based mode, 1820 - * the only tag-based mode that poisons percpu mappings. 1821 - */ 1822 - KASAN_TEST_NEEDS_CONFIG_ON(test, CONFIG_KASAN_SW_TAGS); 1823 - 1824 - ptr = __alloc_percpu(PAGE_SIZE, PAGE_SIZE); 1825 - 1826 - for_each_possible_cpu(cpu) { 1827 - char *c_ptr = per_cpu_ptr(ptr, cpu); 1828 - 1829 - KUNIT_EXPECT_GE(test, (u8)get_tag(c_ptr), (u8)KASAN_TAG_MIN); 1830 - KUNIT_EXPECT_LT(test, (u8)get_tag(c_ptr), (u8)KASAN_TAG_KERNEL); 1831 - 1832 - /* Make sure that in-bounds accesses don't crash the kernel. */ 1833 - *c_ptr = 0; 1834 - } 1835 - 1836 - free_percpu(ptr); 1837 - } 1838 - 1839 1813 /* 1840 1814 * Check that the assigned pointer tag falls within the [KASAN_TAG_MIN, 1841 1815 * KASAN_TAG_KERNEL) range (note: excluding the match-all tag) for tag-based ··· 1997 2023 KUNIT_CASE(vmalloc_oob), 1998 2024 KUNIT_CASE(vmap_tags), 1999 2025 KUNIT_CASE(vm_map_ram_tags), 2000 - KUNIT_CASE(vmalloc_percpu), 2001 2026 KUNIT_CASE(match_all_not_assigned), 2002 2027 KUNIT_CASE(match_all_ptr_tag), 2003 2028 KUNIT_CASE(match_all_mem_tag),
+3 -2
mm/migrate.c
··· 206 206 pte_t newpte; 207 207 void *addr; 208 208 209 - VM_BUG_ON_PAGE(PageCompound(page), page); 209 + if (PageCompound(page)) 210 + return false; 210 211 VM_BUG_ON_PAGE(!PageAnon(page), page); 211 212 VM_BUG_ON_PAGE(!PageLocked(page), page); 212 213 VM_BUG_ON_PAGE(pte_present(*pvmw->pte), page); ··· 1178 1177 * not accounted to NR_ISOLATED_*. They can be recognized 1179 1178 * as __folio_test_movable 1180 1179 */ 1181 - if (likely(!__folio_test_movable(src))) 1180 + if (likely(!__folio_test_movable(src)) && reason != MR_DEMOTION) 1182 1181 mod_node_page_state(folio_pgdat(src), NR_ISOLATED_ANON + 1183 1182 folio_is_file_lru(src), -folio_nr_pages(src)); 1184 1183
+2 -1
mm/mmap.c
··· 900 900 901 901 if (get_area) { 902 902 addr = get_area(file, addr, len, pgoff, flags); 903 - } else if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) { 903 + } else if (IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE) 904 + && IS_ALIGNED(len, PMD_SIZE)) { 904 905 /* Ensures that larger anonymous mappings are THP aligned. */ 905 906 addr = thp_get_unmapped_area_vmflags(file, addr, len, 906 907 pgoff, flags, vm_flags);
+2 -2
mm/page_io.c
··· 570 570 * attempt to access it in the page fault retry time check. 571 571 */ 572 572 get_task_struct(current); 573 - count_vm_event(PSWPIN); 573 + count_vm_events(PSWPIN, folio_nr_pages(folio)); 574 574 submit_bio_wait(&bio); 575 575 __end_swap_bio_read(&bio); 576 576 put_task_struct(current); ··· 585 585 bio->bi_iter.bi_sector = swap_folio_sector(folio); 586 586 bio->bi_end_io = end_swap_bio_read; 587 587 bio_add_folio_nofail(bio, folio, folio_size(folio), 0); 588 - count_vm_event(PSWPIN); 588 + count_vm_events(PSWPIN, folio_nr_pages(folio)); 589 589 submit_bio(bio); 590 590 } 591 591
+3 -6
mm/rmap.c
··· 885 885 return false; 886 886 } 887 887 888 - if (pvmw.pte) { 889 - if (lru_gen_enabled() && 890 - pte_young(ptep_get(pvmw.pte))) { 891 - lru_gen_look_around(&pvmw); 888 + if (lru_gen_enabled() && pvmw.pte) { 889 + if (lru_gen_look_around(&pvmw)) 892 890 referenced++; 893 - } 894 - 891 + } else if (pvmw.pte) { 895 892 if (ptep_clear_flush_young_notify(vma, address, 896 893 pvmw.pte)) 897 894 referenced++;
+5 -3
mm/shrinker.c
··· 76 76 77 77 int alloc_shrinker_info(struct mem_cgroup *memcg) 78 78 { 79 - struct shrinker_info *info; 80 79 int nid, ret = 0; 81 80 int array_size = 0; 82 81 83 82 mutex_lock(&shrinker_mutex); 84 83 array_size = shrinker_unit_size(shrinker_nr_max); 85 84 for_each_node(nid) { 86 - info = kvzalloc_node(sizeof(*info) + array_size, GFP_KERNEL, nid); 85 + struct shrinker_info *info = kvzalloc_node(sizeof(*info) + array_size, 86 + GFP_KERNEL, nid); 87 87 if (!info) 88 88 goto err; 89 89 info->map_nr_max = shrinker_nr_max; 90 - if (shrinker_unit_alloc(info, NULL, nid)) 90 + if (shrinker_unit_alloc(info, NULL, nid)) { 91 + kvfree(info); 91 92 goto err; 93 + } 92 94 rcu_assign_pointer(memcg->nodeinfo[nid]->shrinker_info, info); 93 95 } 94 96 mutex_unlock(&shrinker_mutex);
+30 -19
mm/swapfile.c
··· 731 731 return offset; 732 732 } 733 733 734 - static void swap_reclaim_full_clusters(struct swap_info_struct *si) 734 + /* Return true if reclaimed a whole cluster */ 735 + static void swap_reclaim_full_clusters(struct swap_info_struct *si, bool force) 735 736 { 736 737 long to_scan = 1; 737 738 unsigned long offset, end; 738 739 struct swap_cluster_info *ci; 739 740 unsigned char *map = si->swap_map; 740 - int nr_reclaim, total_reclaimed = 0; 741 + int nr_reclaim; 741 742 742 - if (atomic_long_read(&nr_swap_pages) <= SWAPFILE_CLUSTER) 743 + if (force) 743 744 to_scan = si->inuse_pages / SWAPFILE_CLUSTER; 744 745 745 746 while (!list_empty(&si->full_clusters)) { ··· 750 749 end = min(si->max, offset + SWAPFILE_CLUSTER); 751 750 to_scan--; 752 751 752 + spin_unlock(&si->lock); 753 753 while (offset < end) { 754 754 if (READ_ONCE(map[offset]) == SWAP_HAS_CACHE) { 755 - spin_unlock(&si->lock); 756 755 nr_reclaim = __try_to_reclaim_swap(si, offset, 757 756 TTRS_ANYWAY | TTRS_DIRECT); 758 - spin_lock(&si->lock); 759 - if (nr_reclaim > 0) { 760 - offset += nr_reclaim; 761 - total_reclaimed += nr_reclaim; 762 - continue; 763 - } else if (nr_reclaim < 0) { 764 - offset += -nr_reclaim; 757 + if (nr_reclaim) { 758 + offset += abs(nr_reclaim); 765 759 continue; 766 760 } 767 761 } 768 762 offset++; 769 763 } 770 - if (to_scan <= 0 || total_reclaimed) 764 + spin_lock(&si->lock); 765 + 766 + if (to_scan <= 0) 771 767 break; 772 768 } 769 + } 770 + 771 + static void swap_reclaim_work(struct work_struct *work) 772 + { 773 + struct swap_info_struct *si; 774 + 775 + si = container_of(work, struct swap_info_struct, reclaim_work); 776 + 777 + spin_lock(&si->lock); 778 + swap_reclaim_full_clusters(si, true); 779 + spin_unlock(&si->lock); 773 780 } 774 781 775 782 /* ··· 808 799 VM_BUG_ON(!found); 809 800 goto done; 810 801 } 802 + 803 + /* Try reclaim from full clusters if free clusters list is drained */ 804 + if (vm_swap_full()) 805 + swap_reclaim_full_clusters(si, false); 811 806 812 807 if (order < PMD_ORDER) { 813 808 unsigned int frags = 0; ··· 894 881 } 895 882 896 883 done: 897 - /* Try reclaim from full clusters if device is nearfull */ 898 - if (vm_swap_full() && (!found || (si->pages - si->inuse_pages) < SWAPFILE_CLUSTER)) { 899 - swap_reclaim_full_clusters(si); 900 - if (!found && !order && si->pages != si->inuse_pages) 901 - goto new_cluster; 902 - } 903 - 904 884 cluster->next[order] = offset; 905 885 return found; 906 886 } ··· 928 922 si->lowest_bit = si->max; 929 923 si->highest_bit = 0; 930 924 del_from_avail_list(si); 925 + 926 + if (vm_swap_full()) 927 + schedule_work(&si->reclaim_work); 931 928 } 932 929 } 933 930 ··· 2825 2816 wait_for_completion(&p->comp); 2826 2817 2827 2818 flush_work(&p->discard_work); 2819 + flush_work(&p->reclaim_work); 2828 2820 2829 2821 destroy_swap_extents(p); 2830 2822 if (p->flags & SWP_CONTINUED) ··· 3386 3376 return PTR_ERR(si); 3387 3377 3388 3378 INIT_WORK(&si->discard_work, swap_discard_work); 3379 + INIT_WORK(&si->reclaim_work, swap_reclaim_work); 3389 3380 3390 3381 name = getname(specialfile); 3391 3382 if (IS_ERR(name)) {
+54 -48
mm/vmscan.c
··· 56 56 #include <linux/khugepaged.h> 57 57 #include <linux/rculist_nulls.h> 58 58 #include <linux/random.h> 59 + #include <linux/mmu_notifier.h> 59 60 60 61 #include <asm/tlbflush.h> 61 62 #include <asm/div64.h> ··· 3295 3294 return false; 3296 3295 } 3297 3296 3298 - static unsigned long get_pte_pfn(pte_t pte, struct vm_area_struct *vma, unsigned long addr) 3297 + static unsigned long get_pte_pfn(pte_t pte, struct vm_area_struct *vma, unsigned long addr, 3298 + struct pglist_data *pgdat) 3299 3299 { 3300 3300 unsigned long pfn = pte_pfn(pte); 3301 3301 ··· 3308 3306 if (WARN_ON_ONCE(pte_devmap(pte) || pte_special(pte))) 3309 3307 return -1; 3310 3308 3309 + if (!pte_young(pte) && !mm_has_notifiers(vma->vm_mm)) 3310 + return -1; 3311 + 3311 3312 if (WARN_ON_ONCE(!pfn_valid(pfn))) 3313 + return -1; 3314 + 3315 + if (pfn < pgdat->node_start_pfn || pfn >= pgdat_end_pfn(pgdat)) 3312 3316 return -1; 3313 3317 3314 3318 return pfn; 3315 3319 } 3316 3320 3317 - static unsigned long get_pmd_pfn(pmd_t pmd, struct vm_area_struct *vma, unsigned long addr) 3321 + static unsigned long get_pmd_pfn(pmd_t pmd, struct vm_area_struct *vma, unsigned long addr, 3322 + struct pglist_data *pgdat) 3318 3323 { 3319 3324 unsigned long pfn = pmd_pfn(pmd); 3320 3325 ··· 3333 3324 if (WARN_ON_ONCE(pmd_devmap(pmd))) 3334 3325 return -1; 3335 3326 3327 + if (!pmd_young(pmd) && !mm_has_notifiers(vma->vm_mm)) 3328 + return -1; 3329 + 3336 3330 if (WARN_ON_ONCE(!pfn_valid(pfn))) 3331 + return -1; 3332 + 3333 + if (pfn < pgdat->node_start_pfn || pfn >= pgdat_end_pfn(pgdat)) 3337 3334 return -1; 3338 3335 3339 3336 return pfn; ··· 3349 3334 struct pglist_data *pgdat, bool can_swap) 3350 3335 { 3351 3336 struct folio *folio; 3352 - 3353 - /* try to avoid unnecessary memory loads */ 3354 - if (pfn < pgdat->node_start_pfn || pfn >= pgdat_end_pfn(pgdat)) 3355 - return NULL; 3356 3337 3357 3338 folio = pfn_folio(pfn); 3358 3339 if (folio_nid(folio) != pgdat->node_id) ··· 3405 3394 total++; 3406 3395 walk->mm_stats[MM_LEAF_TOTAL]++; 3407 3396 3408 - pfn = get_pte_pfn(ptent, args->vma, addr); 3397 + pfn = get_pte_pfn(ptent, args->vma, addr, pgdat); 3409 3398 if (pfn == -1) 3410 3399 continue; 3411 - 3412 - if (!pte_young(ptent)) { 3413 - walk->mm_stats[MM_LEAF_OLD]++; 3414 - continue; 3415 - } 3416 3400 3417 3401 folio = get_pfn_folio(pfn, memcg, pgdat, walk->can_swap); 3418 3402 if (!folio) 3419 3403 continue; 3420 3404 3421 - if (!ptep_test_and_clear_young(args->vma, addr, pte + i)) 3422 - VM_WARN_ON_ONCE(true); 3405 + if (!ptep_clear_young_notify(args->vma, addr, pte + i)) 3406 + continue; 3423 3407 3424 3408 young++; 3425 3409 walk->mm_stats[MM_LEAF_YOUNG]++; ··· 3480 3474 /* don't round down the first address */ 3481 3475 addr = i ? (*first & PMD_MASK) + i * PMD_SIZE : *first; 3482 3476 3483 - pfn = get_pmd_pfn(pmd[i], vma, addr); 3484 - if (pfn == -1) 3477 + if (!pmd_present(pmd[i])) 3485 3478 goto next; 3486 3479 3487 3480 if (!pmd_trans_huge(pmd[i])) { 3488 - if (!walk->force_scan && should_clear_pmd_young()) 3481 + if (!walk->force_scan && should_clear_pmd_young() && 3482 + !mm_has_notifiers(args->mm)) 3489 3483 pmdp_test_and_clear_young(vma, addr, pmd + i); 3490 3484 goto next; 3491 3485 } 3486 + 3487 + pfn = get_pmd_pfn(pmd[i], vma, addr, pgdat); 3488 + if (pfn == -1) 3489 + goto next; 3492 3490 3493 3491 folio = get_pfn_folio(pfn, memcg, pgdat, walk->can_swap); 3494 3492 if (!folio) 3495 3493 goto next; 3496 3494 3497 - if (!pmdp_test_and_clear_young(vma, addr, pmd + i)) 3495 + if (!pmdp_clear_young_notify(vma, addr, pmd + i)) 3498 3496 goto next; 3499 3497 3500 3498 walk->mm_stats[MM_LEAF_YOUNG]++; ··· 3556 3546 } 3557 3547 3558 3548 if (pmd_trans_huge(val)) { 3559 - unsigned long pfn = pmd_pfn(val); 3560 3549 struct pglist_data *pgdat = lruvec_pgdat(walk->lruvec); 3550 + unsigned long pfn = get_pmd_pfn(val, vma, addr, pgdat); 3561 3551 3562 3552 walk->mm_stats[MM_LEAF_TOTAL]++; 3563 3553 3564 - if (!pmd_young(val)) { 3565 - walk->mm_stats[MM_LEAF_OLD]++; 3566 - continue; 3567 - } 3568 - 3569 - /* try to avoid unnecessary memory loads */ 3570 - if (pfn < pgdat->node_start_pfn || pfn >= pgdat_end_pfn(pgdat)) 3571 - continue; 3572 - 3573 - walk_pmd_range_locked(pud, addr, vma, args, bitmap, &first); 3554 + if (pfn != -1) 3555 + walk_pmd_range_locked(pud, addr, vma, args, bitmap, &first); 3574 3556 continue; 3575 3557 } 3576 3558 3577 - walk->mm_stats[MM_NONLEAF_TOTAL]++; 3578 - 3579 - if (!walk->force_scan && should_clear_pmd_young()) { 3559 + if (!walk->force_scan && should_clear_pmd_young() && 3560 + !mm_has_notifiers(args->mm)) { 3580 3561 if (!pmd_young(val)) 3581 3562 continue; 3582 3563 ··· 4041 4040 * the PTE table to the Bloom filter. This forms a feedback loop between the 4042 4041 * eviction and the aging. 4043 4042 */ 4044 - void lru_gen_look_around(struct page_vma_mapped_walk *pvmw) 4043 + bool lru_gen_look_around(struct page_vma_mapped_walk *pvmw) 4045 4044 { 4046 4045 int i; 4047 4046 unsigned long start; 4048 4047 unsigned long end; 4049 4048 struct lru_gen_mm_walk *walk; 4050 - int young = 0; 4049 + int young = 1; 4051 4050 pte_t *pte = pvmw->pte; 4052 4051 unsigned long addr = pvmw->address; 4053 4052 struct vm_area_struct *vma = pvmw->vma; ··· 4063 4062 lockdep_assert_held(pvmw->ptl); 4064 4063 VM_WARN_ON_ONCE_FOLIO(folio_test_lru(folio), folio); 4065 4064 4065 + if (!ptep_clear_young_notify(vma, addr, pte)) 4066 + return false; 4067 + 4066 4068 if (spin_is_contended(pvmw->ptl)) 4067 - return; 4069 + return true; 4068 4070 4069 4071 /* exclude special VMAs containing anon pages from COW */ 4070 4072 if (vma->vm_flags & VM_SPECIAL) 4071 - return; 4073 + return true; 4072 4074 4073 4075 /* avoid taking the LRU lock under the PTL when possible */ 4074 4076 walk = current->reclaim_state ? current->reclaim_state->mm_walk : NULL; 4075 4077 4076 4078 start = max(addr & PMD_MASK, vma->vm_start); 4077 4079 end = min(addr | ~PMD_MASK, vma->vm_end - 1) + 1; 4080 + 4081 + if (end - start == PAGE_SIZE) 4082 + return true; 4078 4083 4079 4084 if (end - start > MIN_LRU_BATCH * PAGE_SIZE) { 4080 4085 if (addr - start < MIN_LRU_BATCH * PAGE_SIZE / 2) ··· 4095 4088 4096 4089 /* folio_update_gen() requires stable folio_memcg() */ 4097 4090 if (!mem_cgroup_trylock_pages(memcg)) 4098 - return; 4091 + return true; 4099 4092 4100 4093 arch_enter_lazy_mmu_mode(); 4101 4094 ··· 4105 4098 unsigned long pfn; 4106 4099 pte_t ptent = ptep_get(pte + i); 4107 4100 4108 - pfn = get_pte_pfn(ptent, vma, addr); 4101 + pfn = get_pte_pfn(ptent, vma, addr, pgdat); 4109 4102 if (pfn == -1) 4110 - continue; 4111 - 4112 - if (!pte_young(ptent)) 4113 4103 continue; 4114 4104 4115 4105 folio = get_pfn_folio(pfn, memcg, pgdat, can_swap); 4116 4106 if (!folio) 4117 4107 continue; 4118 4108 4119 - if (!ptep_test_and_clear_young(vma, addr, pte + i)) 4120 - VM_WARN_ON_ONCE(true); 4109 + if (!ptep_clear_young_notify(vma, addr, pte + i)) 4110 + continue; 4121 4111 4122 4112 young++; 4123 4113 ··· 4144 4140 /* feedback from rmap walkers to page table walkers */ 4145 4141 if (mm_state && suitable_to_scan(i, young)) 4146 4142 update_bloom_filter(mm_state, max_seq, pvmw->pmd); 4143 + 4144 + return true; 4147 4145 } 4148 4146 4149 4147 /****************************************************************************** ··· 5260 5254 for (tier = 0; tier < MAX_NR_TIERS; tier++) { 5261 5255 seq_printf(m, " %10d", tier); 5262 5256 for (type = 0; type < ANON_AND_FILE; type++) { 5263 - const char *s = " "; 5257 + const char *s = "xxx"; 5264 5258 unsigned long n[3] = {}; 5265 5259 5266 5260 if (seq == max_seq) { 5267 - s = "RT "; 5261 + s = "RTx"; 5268 5262 n[0] = READ_ONCE(lrugen->avg_refaulted[type][tier]); 5269 5263 n[1] = READ_ONCE(lrugen->avg_total[type][tier]); 5270 5264 } else if (seq == min_seq[type] || NR_HIST_GENS > 1) { ··· 5286 5280 5287 5281 seq_puts(m, " "); 5288 5282 for (i = 0; i < NR_MM_STATS; i++) { 5289 - const char *s = " "; 5283 + const char *s = "xxxx"; 5290 5284 unsigned long n = 0; 5291 5285 5292 5286 if (seq == max_seq && NR_HIST_GENS == 1) { 5293 - s = "LOYNFA"; 5287 + s = "TYFA"; 5294 5288 n = READ_ONCE(mm_state->stats[hist][i]); 5295 5289 } else if (seq != max_seq && NR_HIST_GENS > 1) { 5296 - s = "loynfa"; 5290 + s = "tyfa"; 5297 5291 n = READ_ONCE(mm_state->stats[hist][i]); 5298 5292 } 5299 5293
-1
net/mptcp/mptcp_pm_gen.c
··· 112 112 .dumpit = mptcp_pm_nl_get_addr_dumpit, 113 113 .policy = mptcp_pm_get_addr_nl_policy, 114 114 .maxattr = MPTCP_PM_ATTR_TOKEN, 115 - .flags = GENL_UNS_ADMIN_PERM, 116 115 }, 117 116 { 118 117 .cmd = MPTCP_PM_CMD_FLUSH_ADDRS,
+2 -1
net/mptcp/pm_userspace.c
··· 91 91 struct mptcp_pm_addr_entry *addr) 92 92 { 93 93 struct mptcp_pm_addr_entry *entry, *tmp; 94 + struct sock *sk = (struct sock *)msk; 94 95 95 96 list_for_each_entry_safe(entry, tmp, &msk->pm.userspace_pm_local_addr_list, list) { 96 97 if (mptcp_addresses_equal(&entry->addr, &addr->addr, false)) { ··· 99 98 * be used multiple times (e.g. fullmesh mode). 100 99 */ 101 100 list_del_rcu(&entry->list); 102 - kfree(entry); 101 + sock_kfree_s(sk, entry, sizeof(*entry)); 103 102 msk->pm.local_addr_used--; 104 103 return 0; 105 104 }
+34 -7
net/netfilter/nf_tables_api.c
··· 1495 1495 INIT_LIST_HEAD(&table->sets); 1496 1496 INIT_LIST_HEAD(&table->objects); 1497 1497 INIT_LIST_HEAD(&table->flowtables); 1498 + write_pnet(&table->net, net); 1498 1499 table->family = family; 1499 1500 table->flags = flags; 1500 1501 table->handle = ++nft_net->table_handle; ··· 11453 11452 } 11454 11453 EXPORT_SYMBOL_GPL(nft_data_dump); 11455 11454 11456 - int __nft_release_basechain(struct nft_ctx *ctx) 11455 + static void __nft_release_basechain_now(struct nft_ctx *ctx) 11457 11456 { 11458 11457 struct nft_rule *rule, *nr; 11459 11458 11460 - if (WARN_ON(!nft_is_base_chain(ctx->chain))) 11459 + list_for_each_entry_safe(rule, nr, &ctx->chain->rules, list) { 11460 + list_del(&rule->list); 11461 + nf_tables_rule_release(ctx, rule); 11462 + } 11463 + nf_tables_chain_destroy(ctx->chain); 11464 + } 11465 + 11466 + static void nft_release_basechain_rcu(struct rcu_head *head) 11467 + { 11468 + struct nft_chain *chain = container_of(head, struct nft_chain, rcu_head); 11469 + struct nft_ctx ctx = { 11470 + .family = chain->table->family, 11471 + .chain = chain, 11472 + .net = read_pnet(&chain->table->net), 11473 + }; 11474 + 11475 + __nft_release_basechain_now(&ctx); 11476 + put_net(ctx.net); 11477 + } 11478 + 11479 + int __nft_release_basechain(struct nft_ctx *ctx) 11480 + { 11481 + struct nft_rule *rule; 11482 + 11483 + if (WARN_ON_ONCE(!nft_is_base_chain(ctx->chain))) 11461 11484 return 0; 11462 11485 11463 11486 nf_tables_unregister_hook(ctx->net, ctx->chain->table, ctx->chain); 11464 - list_for_each_entry_safe(rule, nr, &ctx->chain->rules, list) { 11465 - list_del(&rule->list); 11487 + list_for_each_entry(rule, &ctx->chain->rules, list) 11466 11488 nft_use_dec(&ctx->chain->use); 11467 - nf_tables_rule_release(ctx, rule); 11468 - } 11489 + 11469 11490 nft_chain_del(ctx->chain); 11470 11491 nft_use_dec(&ctx->table->use); 11471 - nf_tables_chain_destroy(ctx->chain); 11492 + 11493 + if (maybe_get_net(ctx->net)) 11494 + call_rcu(&ctx->chain->rcu_head, nft_release_basechain_rcu); 11495 + else 11496 + __nft_release_basechain_now(ctx); 11472 11497 11473 11498 return 0; 11474 11499 }
+4
net/rxrpc/conn_client.c
··· 516 516 517 517 spin_lock(&local->client_call_lock); 518 518 list_move_tail(&call->wait_link, &bundle->waiting_calls); 519 + rxrpc_see_call(call, rxrpc_call_see_waiting_call); 519 520 spin_unlock(&local->client_call_lock); 520 521 521 522 if (rxrpc_bundle_has_space(bundle)) ··· 587 586 _debug("call is waiting"); 588 587 ASSERTCMP(call->call_id, ==, 0); 589 588 ASSERT(!test_bit(RXRPC_CALL_EXPOSED, &call->flags)); 589 + /* May still be on ->new_client_calls. */ 590 + spin_lock(&local->client_call_lock); 590 591 list_del_init(&call->wait_link); 592 + spin_unlock(&local->client_call_lock); 591 593 return; 592 594 } 593 595
+1 -1
net/sctp/sm_statefuns.c
··· 3751 3751 } 3752 3752 3753 3753 ch = (struct sctp_chunkhdr *)ch_end; 3754 - } while (ch_end < skb_tail_pointer(skb)); 3754 + } while (ch_end + sizeof(*ch) < skb_tail_pointer(skb)); 3755 3755 3756 3756 if (ootb_shut_ack) 3757 3757 return sctp_sf_shut_8_4_5(net, ep, asoc, type, arg, commands);
+3 -1
net/smc/af_smc.c
··· 3359 3359 else 3360 3360 rc = smc_create_clcsk(net, sk, family); 3361 3361 3362 - if (rc) 3362 + if (rc) { 3363 3363 sk_common_release(sk); 3364 + sock->sk = NULL; 3365 + } 3364 3366 out: 3365 3367 return rc; 3366 3368 }
+2 -6
net/smc/smc_ib.c
··· 899 899 struct ib_device *ibdev = smcibdev->ibdev; 900 900 struct net_device *ndev; 901 901 902 - if (!ibdev->ops.get_netdev) 903 - return; 904 - ndev = ibdev->ops.get_netdev(ibdev, port + 1); 902 + ndev = ib_device_get_netdev(ibdev, port + 1); 905 903 if (ndev) { 906 904 smcibdev->ndev_ifidx[port] = ndev->ifindex; 907 905 dev_put(ndev); ··· 919 921 port_cnt = smcibdev->ibdev->phys_port_cnt; 920 922 for (i = 0; i < min_t(size_t, port_cnt, SMC_MAX_PORTS); i++) { 921 923 libdev = smcibdev->ibdev; 922 - if (!libdev->ops.get_netdev) 923 - continue; 924 - lndev = libdev->ops.get_netdev(libdev, i + 1); 924 + lndev = ib_device_get_netdev(libdev, i + 1); 925 925 dev_put(lndev); 926 926 if (lndev != ndev) 927 927 continue;
+1 -3
net/smc/smc_pnet.c
··· 1054 1054 for (i = 1; i <= SMC_MAX_PORTS; i++) { 1055 1055 if (!rdma_is_port_valid(ibdev->ibdev, i)) 1056 1056 continue; 1057 - if (!ibdev->ibdev->ops.get_netdev) 1058 - continue; 1059 - ndev = ibdev->ibdev->ops.get_netdev(ibdev->ibdev, i); 1057 + ndev = ib_device_get_netdev(ibdev->ibdev, i); 1060 1058 if (!ndev) 1061 1059 continue; 1062 1060 dev_put(ndev);
+1
net/sunrpc/xprtrdma/ib_client.c
··· 153 153 } 154 154 155 155 trace_rpcrdma_client_remove_one_done(device); 156 + xa_destroy(&rd->rd_xa); 156 157 kfree(rd); 157 158 } 158 159
+1
net/sunrpc/xprtsock.c
··· 2459 2459 case -EHOSTUNREACH: 2460 2460 case -EADDRINUSE: 2461 2461 case -ENOBUFS: 2462 + case -ENOTCONN: 2462 2463 break; 2463 2464 default: 2464 2465 printk("%s: connect returned unhandled error %d\n",
+6 -1
scripts/Makefile.package
··· 62 62 63 63 PHONY += rpm-pkg srcrpm-pkg binrpm-pkg 64 64 65 + ifneq ($(CC),$(HOSTCC)) 66 + rpm-no-devel = --without=devel 67 + endif 68 + 65 69 rpm-pkg: private build-type := a 66 70 srcrpm-pkg: private build-type := s 67 71 binrpm-pkg: private build-type := b ··· 76 72 --define='_topdir $(abspath rpmbuild)' \ 77 73 $(if $(filter a b, $(build-type)), \ 78 74 --target $(UTS_MACHINE)-linux --build-in-place --noprep --define='_smp_mflags %{nil}' \ 79 - $$(rpm -q rpm >/dev/null 2>&1 || echo --nodeps)) \ 75 + $$(rpm -q rpm >/dev/null 2>&1 || echo --nodeps) \ 76 + $(rpm-no-devel)) \ 80 77 $(RPMOPTS)) 81 78 82 79 # deb-pkg srcdeb-pkg bindeb-pkg
+12 -1
scripts/kconfig/menu.c
··· 533 533 534 534 bool menu_is_visible(struct menu *menu) 535 535 { 536 + struct menu *child; 536 537 struct symbol *sym; 537 538 tristate visible; 538 539 ··· 552 551 } else 553 552 visible = menu->prompt->visible.tri = expr_calc_value(menu->prompt->visible.expr); 554 553 555 - return visible != no; 554 + if (visible != no) 555 + return true; 556 + 557 + if (!sym || sym_get_tristate_value(menu->sym) == no) 558 + return false; 559 + 560 + for (child = menu->list; child; child = child->next) 561 + if (menu_is_visible(child)) 562 + return true; 563 + 564 + return false; 556 565 } 557 566 558 567 const char *menu_get_prompt(const struct menu *menu)
+6 -6
scripts/mod/file2alias.c
··· 567 567 void *symval, char *alias) 568 568 { 569 569 DEF_FIELD_ADDR(symval, acpi_device_id, id); 570 - DEF_FIELD_ADDR(symval, acpi_device_id, cls); 571 - DEF_FIELD_ADDR(symval, acpi_device_id, cls_msk); 570 + DEF_FIELD(symval, acpi_device_id, cls); 571 + DEF_FIELD(symval, acpi_device_id, cls_msk); 572 572 573 573 if (id && strlen((const char *)*id)) 574 574 sprintf(alias, "acpi*:%s:*", *id); 575 - else if (cls) { 575 + else { 576 576 int i, byte_shift, cnt = 0; 577 577 unsigned int msk; 578 578 ··· 580 580 cnt = 6; 581 581 for (i = 1; i <= 3; i++) { 582 582 byte_shift = 8 * (3-i); 583 - msk = (*cls_msk >> byte_shift) & 0xFF; 583 + msk = (cls_msk >> byte_shift) & 0xFF; 584 584 if (msk) 585 585 sprintf(&alias[cnt], "%02x", 586 - (*cls >> byte_shift) & 0xFF); 586 + (cls >> byte_shift) & 0xFF); 587 587 else 588 588 sprintf(&alias[cnt], "??"); 589 589 cnt += 2; ··· 743 743 for (i = min / BITS_PER_LONG; i < max / BITS_PER_LONG + 1; i++) 744 744 arr[i] = TO_NATIVE(arr[i]); 745 745 for (i = min; i < max; i++) 746 - if (arr[i / BITS_PER_LONG] & (1L << (i%BITS_PER_LONG))) 746 + if (arr[i / BITS_PER_LONG] & (1ULL << (i%BITS_PER_LONG))) 747 747 sprintf(alias + strlen(alias), "%X,*", i); 748 748 } 749 749
+3 -2
scripts/mod/sumversion.c
··· 392 392 /* Calc and record src checksum. */ 393 393 void get_src_version(const char *modname, char sum[], unsigned sumlen) 394 394 { 395 - char *buf; 395 + char *buf, *pos; 396 396 struct md4_ctx md; 397 397 char *fname; 398 398 char filelist[PATH_MAX + 1]; ··· 401 401 snprintf(filelist, sizeof(filelist), "%s.mod", modname); 402 402 403 403 buf = read_text_file(filelist); 404 + pos = buf; 404 405 405 406 md4_init(&md); 406 - while ((fname = strsep(&buf, "\n"))) { 407 + while ((fname = strsep(&pos, "\n"))) { 407 408 if (!*fname) 408 409 continue; 409 410 if (!(is_static_library(fname)) &&
+1 -1
scripts/package/builddeb
··· 123 123 pdir=debian/$1 124 124 version=${1#linux-headers-} 125 125 126 - "${srctree}/scripts/package/install-extmod-build" "${pdir}/usr/src/linux-headers-${version}" 126 + CC="${DEB_HOST_GNU_TYPE}-gcc" "${srctree}/scripts/package/install-extmod-build" "${pdir}/usr/src/linux-headers-${version}" 127 127 128 128 mkdir -p $pdir/lib/modules/$version/ 129 129 ln -s /usr/src/linux-headers-$version $pdir/lib/modules/$version/build
+2 -4
scripts/package/install-extmod-build
··· 44 44 fi 45 45 } | tar -c -f - -T - | tar -xf - -C "${destdir}" 46 46 47 - # When ${CC} and ${HOSTCC} differ, we are likely cross-compiling. Rebuild host 48 - # programs using ${CC}. This assumes CC=${CROSS_COMPILE}gcc, which is usually 49 - # the case for package building. It does not cross-compile when CC=clang. 47 + # When ${CC} and ${HOSTCC} differ, rebuild host programs using ${CC}. 50 48 # 51 49 # This caters to host programs that participate in Kbuild. objtool and 52 50 # resolve_btfids are out of scope. 53 - if [ "${CC}" != "${HOSTCC}" ] && is_enabled CONFIG_CC_CAN_LINK; then 51 + if [ "${CC}" != "${HOSTCC}" ]; then 54 52 echo "Rebuilding host programs with ${CC}..." 55 53 56 54 cat <<-'EOF' > "${destdir}/Kbuild"
+9 -1
scripts/package/mkdebian
··· 179 179 180 180 echo $debarch > debian/arch 181 181 182 + host_gnu=$(dpkg-architecture -a "${debarch}" -q DEB_HOST_GNU_TYPE | sed 's/_/-/g') 183 + 182 184 # Generate a simple changelog template 183 185 cat <<EOF > debian/changelog 184 186 $sourcename ($packageversion) $distribution; urgency=low ··· 198 196 Maintainer: $maintainer 199 197 Rules-Requires-Root: no 200 198 Build-Depends: debhelper-compat (= 12) 201 - Build-Depends-Arch: bc, bison, cpio, flex, kmod, libelf-dev:native, libssl-dev:native, rsync 199 + Build-Depends-Arch: bc, bison, cpio, flex, 200 + gcc-${host_gnu} <!pkg.${sourcename}.nokernelheaders>, 201 + kmod, libelf-dev:native, 202 + libssl-dev:native, libssl-dev <!pkg.${sourcename}.nokernelheaders>, 203 + rsync 202 204 Homepage: https://www.kernel.org/ 203 205 204 206 Package: $packagename-$version ··· 230 224 231 225 Package: linux-headers-$version 232 226 Architecture: $debarch 227 + Build-Profiles: <!pkg.${sourcename}.nokernelheaders> 233 228 Description: Linux kernel headers for $version on $debarch 234 229 This package provides kernel header files for $version on $debarch 235 230 . ··· 245 238 Package: linux-image-$version-dbg 246 239 Section: debug 247 240 Architecture: $debarch 241 + Build-Profiles: <!pkg.${sourcename}.nokerneldbg> 248 242 Description: Linux kernel debugging symbols for $version 249 243 This package will come in handy if you need to debug the kernel. It provides 250 244 all the necessary debug symbols for the kernel and its modules.
+1 -1
scripts/rustc-llvm-version.sh
··· 13 13 echo $((10000 * $1 + 100 * $2 + $3)) 14 14 } 15 15 16 - if output=$("$@" --version --verbose 2>/dev/null | grep LLVM); then 16 + if output=$("$@" --version --verbose 2>/dev/null | grep -E 'LLVM.*[0-9]+\.[0-9]+\.[0-9]+'); then 17 17 set -- $output 18 18 get_canonical_version $3 19 19 else
+5 -2
security/keys/keyring.c
··· 772 772 for (; slot < ASSOC_ARRAY_FAN_OUT; slot++) { 773 773 ptr = READ_ONCE(node->slots[slot]); 774 774 775 - if (assoc_array_ptr_is_meta(ptr) && node->back_pointer) 776 - goto descend_to_node; 775 + if (assoc_array_ptr_is_meta(ptr)) { 776 + if (node->back_pointer || 777 + assoc_array_ptr_is_shortcut(ptr)) 778 + goto descend_to_node; 779 + } 777 780 778 781 if (!keyring_ptr_is_keyring(ptr)) 779 782 continue;
+5 -4
security/keys/trusted-keys/trusted_dcp.c
··· 133 133 struct scatterlist src_sg, dst_sg; 134 134 struct crypto_aead *aead; 135 135 int ret; 136 + DECLARE_CRYPTO_WAIT(wait); 136 137 137 138 aead = crypto_alloc_aead("gcm(aes)", 0, CRYPTO_ALG_ASYNC); 138 139 if (IS_ERR(aead)) { ··· 164 163 } 165 164 166 165 aead_request_set_crypt(aead_req, &src_sg, &dst_sg, len, nonce); 167 - aead_request_set_callback(aead_req, CRYPTO_TFM_REQ_MAY_SLEEP, NULL, 168 - NULL); 166 + aead_request_set_callback(aead_req, CRYPTO_TFM_REQ_MAY_SLEEP, 167 + crypto_req_done, &wait); 169 168 aead_request_set_ad(aead_req, 0); 170 169 171 170 if (crypto_aead_setkey(aead, key, AES_KEYSIZE_128)) { ··· 175 174 } 176 175 177 176 if (do_encrypt) 178 - ret = crypto_aead_encrypt(aead_req); 177 + ret = crypto_wait_req(crypto_aead_encrypt(aead_req), &wait); 179 178 else 180 - ret = crypto_aead_decrypt(aead_req); 179 + ret = crypto_wait_req(crypto_aead_decrypt(aead_req), &wait); 181 180 182 181 free_req: 183 182 aead_request_free(aead_req);
+5 -4
tools/mm/page-types.c
··· 22 22 #include <time.h> 23 23 #include <setjmp.h> 24 24 #include <signal.h> 25 + #include <inttypes.h> 25 26 #include <sys/types.h> 26 27 #include <sys/errno.h> 27 28 #include <sys/fcntl.h> ··· 392 391 if (opt_file) 393 392 printf("%lx\t", voff); 394 393 if (opt_list_cgroup) 395 - printf("@%llu\t", (unsigned long long)cgroup0); 394 + printf("@%" PRIu64 "\t", cgroup0); 396 395 if (opt_list_mapcnt) 397 - printf("%lu\t", mapcnt0); 396 + printf("%" PRIu64 "\t", mapcnt0); 398 397 printf("%lx\t%lx\t%s\n", 399 398 index, count, page_flag_name(flags0)); 400 399 } ··· 420 419 if (opt_file) 421 420 printf("%lx\t", voffset); 422 421 if (opt_list_cgroup) 423 - printf("@%llu\t", (unsigned long long)cgroup); 422 + printf("@%" PRIu64 "\t", cgroup) 424 423 if (opt_list_mapcnt) 425 - printf("%lu\t", mapcnt); 424 + printf("%" PRIu64 "\t", mapcnt); 426 425 427 426 printf("%lx\t%s\n", offset, page_flag_name(flags)); 428 427 }
+3 -1
tools/mm/slabinfo.c
··· 1297 1297 slab->cpu_partial_free = get_obj("cpu_partial_free"); 1298 1298 slab->alloc_node_mismatch = get_obj("alloc_node_mismatch"); 1299 1299 slab->deactivate_bypass = get_obj("deactivate_bypass"); 1300 - chdir(".."); 1300 + if (chdir("..")) 1301 + fatal("Unable to chdir from slab ../%s\n", 1302 + slab->name); 1301 1303 if (slab->name[0] == ':') 1302 1304 alias_targets++; 1303 1305 slab++;
+108 -92
tools/testing/cxl/test/cxl.c
··· 693 693 return 0; 694 694 } 695 695 696 - static int mock_decoder_reset(struct cxl_decoder *cxld) 696 + static void mock_decoder_reset(struct cxl_decoder *cxld) 697 697 { 698 698 struct cxl_port *port = to_cxl_port(cxld->dev.parent); 699 699 int id = cxld->id; 700 700 701 701 if ((cxld->flags & CXL_DECODER_F_ENABLE) == 0) 702 - return 0; 702 + return; 703 703 704 704 dev_dbg(&port->dev, "%s reset\n", dev_name(&cxld->dev)); 705 - if (port->commit_end != id) { 705 + if (port->commit_end == id) 706 + cxl_port_commit_reap(cxld); 707 + else 706 708 dev_dbg(&port->dev, 707 709 "%s: out of order reset, expected decoder%d.%d\n", 708 710 dev_name(&cxld->dev), port->id, port->commit_end); 709 - return -EBUSY; 710 - } 711 - 712 - port->commit_end--; 713 711 cxld->flags &= ~CXL_DECODER_F_ENABLE; 714 - 715 - return 0; 716 712 } 717 713 718 714 static void default_mock_decoder(struct cxl_decoder *cxld) ··· 1058 1062 #define SZ_64G (SZ_32G * 2) 1059 1063 #endif 1060 1064 1061 - static __init int cxl_rch_init(void) 1065 + static __init int cxl_rch_topo_init(void) 1062 1066 { 1063 1067 int rc, i; 1064 1068 ··· 1086 1090 goto err_bridge; 1087 1091 } 1088 1092 1089 - for (i = 0; i < ARRAY_SIZE(cxl_rcd); i++) { 1090 - int idx = NR_MEM_MULTI + NR_MEM_SINGLE + i; 1091 - struct platform_device *rch = cxl_rch[i]; 1092 - struct platform_device *pdev; 1093 - 1094 - pdev = platform_device_alloc("cxl_rcd", idx); 1095 - if (!pdev) 1096 - goto err_mem; 1097 - pdev->dev.parent = &rch->dev; 1098 - set_dev_node(&pdev->dev, i % 2); 1099 - 1100 - rc = platform_device_add(pdev); 1101 - if (rc) { 1102 - platform_device_put(pdev); 1103 - goto err_mem; 1104 - } 1105 - cxl_rcd[i] = pdev; 1106 - } 1107 - 1108 1093 return 0; 1109 1094 1110 - err_mem: 1111 - for (i = ARRAY_SIZE(cxl_rcd) - 1; i >= 0; i--) 1112 - platform_device_unregister(cxl_rcd[i]); 1113 1095 err_bridge: 1114 1096 for (i = ARRAY_SIZE(cxl_rch) - 1; i >= 0; i--) { 1115 1097 struct platform_device *pdev = cxl_rch[i]; ··· 1101 1127 return rc; 1102 1128 } 1103 1129 1104 - static void cxl_rch_exit(void) 1130 + static void cxl_rch_topo_exit(void) 1105 1131 { 1106 1132 int i; 1107 1133 1108 - for (i = ARRAY_SIZE(cxl_rcd) - 1; i >= 0; i--) 1109 - platform_device_unregister(cxl_rcd[i]); 1110 1134 for (i = ARRAY_SIZE(cxl_rch) - 1; i >= 0; i--) { 1111 1135 struct platform_device *pdev = cxl_rch[i]; 1112 1136 ··· 1115 1143 } 1116 1144 } 1117 1145 1118 - static __init int cxl_single_init(void) 1146 + static __init int cxl_single_topo_init(void) 1119 1147 { 1120 1148 int i, rc; 1121 1149 ··· 1200 1228 cxl_swd_single[i] = pdev; 1201 1229 } 1202 1230 1203 - for (i = 0; i < ARRAY_SIZE(cxl_mem_single); i++) { 1204 - struct platform_device *dport = cxl_swd_single[i]; 1205 - struct platform_device *pdev; 1206 - 1207 - pdev = platform_device_alloc("cxl_mem", NR_MEM_MULTI + i); 1208 - if (!pdev) 1209 - goto err_mem; 1210 - pdev->dev.parent = &dport->dev; 1211 - set_dev_node(&pdev->dev, i % 2); 1212 - 1213 - rc = platform_device_add(pdev); 1214 - if (rc) { 1215 - platform_device_put(pdev); 1216 - goto err_mem; 1217 - } 1218 - cxl_mem_single[i] = pdev; 1219 - } 1220 - 1221 1231 return 0; 1222 1232 1223 - err_mem: 1224 - for (i = ARRAY_SIZE(cxl_mem_single) - 1; i >= 0; i--) 1225 - platform_device_unregister(cxl_mem_single[i]); 1226 1233 err_dport: 1227 1234 for (i = ARRAY_SIZE(cxl_swd_single) - 1; i >= 0; i--) 1228 1235 platform_device_unregister(cxl_swd_single[i]); ··· 1224 1273 return rc; 1225 1274 } 1226 1275 1227 - static void cxl_single_exit(void) 1276 + static void cxl_single_topo_exit(void) 1228 1277 { 1229 1278 int i; 1230 1279 1231 - for (i = ARRAY_SIZE(cxl_mem_single) - 1; i >= 0; i--) 1232 - platform_device_unregister(cxl_mem_single[i]); 1233 1280 for (i = ARRAY_SIZE(cxl_swd_single) - 1; i >= 0; i--) 1234 1281 platform_device_unregister(cxl_swd_single[i]); 1235 1282 for (i = ARRAY_SIZE(cxl_swu_single) - 1; i >= 0; i--) ··· 1242 1293 sysfs_remove_link(&pdev->dev.kobj, "physical_node"); 1243 1294 platform_device_unregister(cxl_hb_single[i]); 1244 1295 } 1296 + } 1297 + 1298 + static void cxl_mem_exit(void) 1299 + { 1300 + int i; 1301 + 1302 + for (i = ARRAY_SIZE(cxl_rcd) - 1; i >= 0; i--) 1303 + platform_device_unregister(cxl_rcd[i]); 1304 + for (i = ARRAY_SIZE(cxl_mem_single) - 1; i >= 0; i--) 1305 + platform_device_unregister(cxl_mem_single[i]); 1306 + for (i = ARRAY_SIZE(cxl_mem) - 1; i >= 0; i--) 1307 + platform_device_unregister(cxl_mem[i]); 1308 + } 1309 + 1310 + static int cxl_mem_init(void) 1311 + { 1312 + int i, rc; 1313 + 1314 + for (i = 0; i < ARRAY_SIZE(cxl_mem); i++) { 1315 + struct platform_device *dport = cxl_switch_dport[i]; 1316 + struct platform_device *pdev; 1317 + 1318 + pdev = platform_device_alloc("cxl_mem", i); 1319 + if (!pdev) 1320 + goto err_mem; 1321 + pdev->dev.parent = &dport->dev; 1322 + set_dev_node(&pdev->dev, i % 2); 1323 + 1324 + rc = platform_device_add(pdev); 1325 + if (rc) { 1326 + platform_device_put(pdev); 1327 + goto err_mem; 1328 + } 1329 + cxl_mem[i] = pdev; 1330 + } 1331 + 1332 + for (i = 0; i < ARRAY_SIZE(cxl_mem_single); i++) { 1333 + struct platform_device *dport = cxl_swd_single[i]; 1334 + struct platform_device *pdev; 1335 + 1336 + pdev = platform_device_alloc("cxl_mem", NR_MEM_MULTI + i); 1337 + if (!pdev) 1338 + goto err_single; 1339 + pdev->dev.parent = &dport->dev; 1340 + set_dev_node(&pdev->dev, i % 2); 1341 + 1342 + rc = platform_device_add(pdev); 1343 + if (rc) { 1344 + platform_device_put(pdev); 1345 + goto err_single; 1346 + } 1347 + cxl_mem_single[i] = pdev; 1348 + } 1349 + 1350 + for (i = 0; i < ARRAY_SIZE(cxl_rcd); i++) { 1351 + int idx = NR_MEM_MULTI + NR_MEM_SINGLE + i; 1352 + struct platform_device *rch = cxl_rch[i]; 1353 + struct platform_device *pdev; 1354 + 1355 + pdev = platform_device_alloc("cxl_rcd", idx); 1356 + if (!pdev) 1357 + goto err_rcd; 1358 + pdev->dev.parent = &rch->dev; 1359 + set_dev_node(&pdev->dev, i % 2); 1360 + 1361 + rc = platform_device_add(pdev); 1362 + if (rc) { 1363 + platform_device_put(pdev); 1364 + goto err_rcd; 1365 + } 1366 + cxl_rcd[i] = pdev; 1367 + } 1368 + 1369 + return 0; 1370 + 1371 + err_rcd: 1372 + for (i = ARRAY_SIZE(cxl_rcd) - 1; i >= 0; i--) 1373 + platform_device_unregister(cxl_rcd[i]); 1374 + err_single: 1375 + for (i = ARRAY_SIZE(cxl_mem_single) - 1; i >= 0; i--) 1376 + platform_device_unregister(cxl_mem_single[i]); 1377 + err_mem: 1378 + for (i = ARRAY_SIZE(cxl_mem) - 1; i >= 0; i--) 1379 + platform_device_unregister(cxl_mem[i]); 1380 + return rc; 1245 1381 } 1246 1382 1247 1383 static __init int cxl_test_init(void) ··· 1441 1407 cxl_switch_dport[i] = pdev; 1442 1408 } 1443 1409 1444 - for (i = 0; i < ARRAY_SIZE(cxl_mem); i++) { 1445 - struct platform_device *dport = cxl_switch_dport[i]; 1446 - struct platform_device *pdev; 1447 - 1448 - pdev = platform_device_alloc("cxl_mem", i); 1449 - if (!pdev) 1450 - goto err_mem; 1451 - pdev->dev.parent = &dport->dev; 1452 - set_dev_node(&pdev->dev, i % 2); 1453 - 1454 - rc = platform_device_add(pdev); 1455 - if (rc) { 1456 - platform_device_put(pdev); 1457 - goto err_mem; 1458 - } 1459 - cxl_mem[i] = pdev; 1460 - } 1461 - 1462 - rc = cxl_single_init(); 1410 + rc = cxl_single_topo_init(); 1463 1411 if (rc) 1464 - goto err_mem; 1412 + goto err_dport; 1465 1413 1466 - rc = cxl_rch_init(); 1414 + rc = cxl_rch_topo_init(); 1467 1415 if (rc) 1468 1416 goto err_single; 1469 1417 ··· 1458 1442 1459 1443 rc = platform_device_add(cxl_acpi); 1460 1444 if (rc) 1461 - goto err_add; 1445 + goto err_root; 1446 + 1447 + rc = cxl_mem_init(); 1448 + if (rc) 1449 + goto err_root; 1462 1450 1463 1451 return 0; 1464 1452 1465 - err_add: 1453 + err_root: 1466 1454 platform_device_put(cxl_acpi); 1467 1455 err_rch: 1468 - cxl_rch_exit(); 1456 + cxl_rch_topo_exit(); 1469 1457 err_single: 1470 - cxl_single_exit(); 1471 - err_mem: 1472 - for (i = ARRAY_SIZE(cxl_mem) - 1; i >= 0; i--) 1473 - platform_device_unregister(cxl_mem[i]); 1458 + cxl_single_topo_exit(); 1474 1459 err_dport: 1475 1460 for (i = ARRAY_SIZE(cxl_switch_dport) - 1; i >= 0; i--) 1476 1461 platform_device_unregister(cxl_switch_dport[i]); ··· 1503 1486 { 1504 1487 int i; 1505 1488 1489 + cxl_mem_exit(); 1506 1490 platform_device_unregister(cxl_acpi); 1507 - cxl_rch_exit(); 1508 - cxl_single_exit(); 1509 - for (i = ARRAY_SIZE(cxl_mem) - 1; i >= 0; i--) 1510 - platform_device_unregister(cxl_mem[i]); 1491 + cxl_rch_topo_exit(); 1492 + cxl_single_topo_exit(); 1511 1493 for (i = ARRAY_SIZE(cxl_switch_dport) - 1; i >= 0; i--) 1512 1494 platform_device_unregister(cxl_switch_dport[i]); 1513 1495 for (i = ARRAY_SIZE(cxl_switch_uport) - 1; i >= 0; i--)
+1
tools/testing/cxl/test/mem.c
··· 1673 1673 .name = KBUILD_MODNAME, 1674 1674 .dev_groups = cxl_mock_mem_groups, 1675 1675 .groups = cxl_mock_mem_core_groups, 1676 + .probe_type = PROBE_PREFER_ASYNCHRONOUS, 1676 1677 }, 1677 1678 }; 1678 1679
+101
tools/testing/selftests/ftrace/test.d/00basic/mount_options.tc
··· 1 + #!/bin/sh 2 + # SPDX-License-Identifier: GPL-2.0 3 + # description: Test tracefs GID mount option 4 + # requires: "[gid=<gid>]":README 5 + 6 + fail() { 7 + local msg="$1" 8 + 9 + echo "FAILED: $msg" 10 + exit_fail 11 + } 12 + 13 + find_alternate_gid() { 14 + local original_gid="$1" 15 + tac /etc/group | grep -v ":$original_gid:" | head -1 | cut -d: -f3 16 + } 17 + 18 + mount_tracefs_with_options() { 19 + local mount_point="$1" 20 + local options="$2" 21 + 22 + mount -t tracefs -o "$options" nodev "$mount_point" 23 + 24 + setup 25 + } 26 + 27 + unmount_tracefs() { 28 + local mount_point="$1" 29 + 30 + # Need to make sure the mount isn't busy so that we can umount it 31 + (cd $mount_point; finish_ftrace;) 32 + 33 + cleanup 34 + } 35 + 36 + create_instance() { 37 + local mount_point="$1" 38 + local instance="$mount_point/instances/$(mktemp -u test-XXXXXX)" 39 + 40 + mkdir "$instance" 41 + echo "$instance" 42 + } 43 + 44 + remove_instance() { 45 + local instance="$1" 46 + 47 + rmdir "$instance" 48 + } 49 + 50 + check_gid() { 51 + local mount_point="$1" 52 + local expected_gid="$2" 53 + 54 + echo "Checking permission group ..." 55 + 56 + cd "$mount_point" 57 + 58 + for file in "." "events" "events/sched" "events/sched/sched_switch" "events/sched/sched_switch/enable"; do 59 + local gid=`stat -c "%g" $file` 60 + if [ "$gid" -ne "$expected_gid" ]; then 61 + cd - # Return to the previous working directory (tracefs root) 62 + fail "$(realpath $file): Expected group $expected_gid; Got group $gid" 63 + fi 64 + done 65 + 66 + cd - # Return to the previous working directory (tracefs root) 67 + } 68 + 69 + test_gid_mount_option() { 70 + local mount_point=$(get_mount_point) 71 + local mount_options=$(get_mnt_options "$mount_point") 72 + local original_group=$(stat -c "%g" .) 73 + local other_group=$(find_alternate_gid "$original_group") 74 + 75 + # Set up mount options with new GID for testing 76 + local new_options=`echo "$mount_options" | sed -e "s/gid=[0-9]*/gid=$other_group/"` 77 + if [ "$new_options" = "$mount_options" ]; then 78 + new_options="$mount_options,gid=$other_group" 79 + mount_options="$mount_options,gid=$original_group" 80 + fi 81 + 82 + # Unmount existing tracefs instance and mount with new GID 83 + unmount_tracefs "$mount_point" 84 + mount_tracefs_with_options "$mount_point" "$new_options" 85 + 86 + check_gid "$mount_point" "$other_group" 87 + 88 + # Check that files created after the mount inherit the GID 89 + local instance=$(create_instance "$mount_point") 90 + check_gid "$instance" "$other_group" 91 + remove_instance "$instance" 92 + 93 + # Unmount and remount with the original GID 94 + unmount_tracefs "$mount_point" 95 + mount_tracefs_with_options "$mount_point" "$mount_options" 96 + check_gid "$mount_point" "$original_group" 97 + } 98 + 99 + test_gid_mount_option 100 + 101 + exit 0
+3 -13
tools/testing/selftests/ftrace/test.d/00basic/test_ownership.tc
··· 1 1 #!/bin/sh 2 2 # SPDX-License-Identifier: GPL-2.0 3 3 # description: Test file and directory ownership changes for eventfs 4 + # requires: "[gid=<gid>]":README 4 5 5 6 original_group=`stat -c "%g" .` 6 7 original_owner=`stat -c "%u" .` 7 8 8 - mount_point=`stat -c '%m' .` 9 + local mount_point=$(get_mount_point) 9 10 10 - # If stat -c '%m' does not work (e.g. busybox) or failed, try to use the 11 - # current working directory (which should be a tracefs) as the mount point. 12 - if [ ! -d "$mount_point" ]; then 13 - if mount | grep -qw $PWD ; then 14 - mount_point=$PWD 15 - else 16 - # If PWD doesn't work, that is an environmental problem. 17 - exit_unresolved 18 - fi 19 - fi 20 - 21 - mount_options=`mount | grep "$mount_point" | sed -e 's/.*(\(.*\)).*/\1/'` 11 + mount_options=$(get_mnt_options "$mount_point") 22 12 23 13 # find another owner and group that is not the original 24 14 other_group=`tac /etc/group | grep -v ":$original_group:" | head -1 | cut -d: -f3`
+25
tools/testing/selftests/ftrace/test.d/functions
··· 193 193 # " Command: " and "^\n" => 13 194 194 test $(expr 13 + $pos) -eq $N 195 195 } 196 + 197 + # Helper to get the tracefs mount point 198 + get_mount_point() { 199 + local mount_point=`stat -c '%m' .` 200 + 201 + # If stat -c '%m' does not work (e.g. busybox) or failed, try to use the 202 + # current working directory (which should be a tracefs) as the mount point. 203 + if [ ! -d "$mount_point" ]; then 204 + if mount | grep -qw "$PWD"; then 205 + mount_point=$PWD 206 + else 207 + # If PWD doesn't work, that is an environmental problem. 208 + exit_unresolved 209 + fi 210 + fi 211 + echo "$mount_point" 212 + } 213 + 214 + # Helper function to retrieve mount options for a given mount point 215 + get_mnt_options() { 216 + local mnt_point="$1" 217 + local opts=$(mount | grep -m1 "$mnt_point" | sed -e 's/.*(\(.*\)).*/\1/') 218 + 219 + echo "$opts" 220 + }
+7 -2
tools/testing/selftests/intel_pstate/run.sh
··· 44 44 exit $ksft_skip 45 45 fi 46 46 47 + if ! command -v cpupower &> /dev/null; then 48 + echo $msg cpupower could not be found, please install it >&2 49 + exit $ksft_skip 50 + fi 51 + 47 52 max_cpus=$(($(nproc)-1)) 48 53 49 54 function run_test () { ··· 92 87 93 88 # Get the ranges from cpupower 94 89 _min_freq=$(cpupower frequency-info -l | tail -1 | awk ' { print $1 } ') 95 - min_freq=$(($_min_freq / 1000)) 90 + min_freq=$((_min_freq / 1000)) 96 91 _max_freq=$(cpupower frequency-info -l | tail -1 | awk ' { print $2 } ') 97 - max_freq=$(($_max_freq / 1000)) 92 + max_freq=$((_max_freq / 1000)) 98 93 99 94 100 95 [ $EVALUATE_ONLY -eq 0 ] && for freq in `seq $max_freq -100 $min_freq`
+9
tools/testing/selftests/mount_setattr/mount_setattr_test.c
··· 1414 1414 ASSERT_EQ(expected_uid_gid(-EBADF, "/tmp/B/b", 0, 0, 0), 0); 1415 1415 ASSERT_EQ(expected_uid_gid(-EBADF, "/tmp/B/BB/b", 0, 0, 0), 0); 1416 1416 1417 + ASSERT_EQ(mount("testing", "/mnt/A", "ramfs", MS_NOATIME | MS_NODEV, 1418 + "size=100000,mode=700"), 0); 1419 + 1420 + ASSERT_EQ(mkdir("/mnt/A/AA", 0777), 0); 1421 + 1422 + ASSERT_EQ(mount("/tmp", "/mnt/A/AA", NULL, MS_BIND | MS_REC, NULL), 0); 1423 + 1417 1424 open_tree_fd = sys_open_tree(-EBADF, "/mnt/A", 1418 1425 AT_RECURSIVE | 1419 1426 AT_EMPTY_PATH | ··· 1440 1433 ASSERT_EQ(expected_uid_gid(-EBADF, "/tmp/B/BB/b", 0, 0, 0), 0); 1441 1434 ASSERT_EQ(expected_uid_gid(open_tree_fd, "B/b", 0, 0, 0), 0); 1442 1435 ASSERT_EQ(expected_uid_gid(open_tree_fd, "B/BB/b", 0, 0, 0), 0); 1436 + 1437 + (void)umount2("/mnt/A", MNT_DETACH); 1443 1438 } 1444 1439 1445 1440 TEST_F(mount_setattr, mount_attr_nosymfollow)
+6
tools/testing/selftests/watchdog/watchdog-test.c
··· 334 334 335 335 printf("Watchdog Ticking Away!\n"); 336 336 337 + /* 338 + * Register the signals 339 + */ 337 340 signal(SIGINT, term); 341 + signal(SIGTERM, term); 342 + signal(SIGKILL, term); 343 + signal(SIGQUIT, term); 338 344 339 345 while (1) { 340 346 keep_alive();
+1
tools/usb/usbip/src/usbip_detach.c
··· 68 68 } 69 69 70 70 if (!found) { 71 + ret = -1; 71 72 err("Invalid port %s > maxports %d", 72 73 port, vhci_driver->nports); 73 74 goto call_driver_close;