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

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

Conflicts:

drivers/net/ethernet/intel/ice/ice_main.c
418e53401e47 ("ice: move devlink port creation/deletion")
643ef23bd9dd ("ice: Introduce local var for readability")
https://lore.kernel.org/all/20230127124025.0dacef40@canb.auug.org.au/
https://lore.kernel.org/all/20230124005714.3996270-1-anthony.l.nguyen@intel.com/

drivers/net/ethernet/engleder/tsnep_main.c
3d53aaef4332 ("tsnep: Fix TX queue stop/wake for multiple queues")
25faa6a4c5ca ("tsnep: Replace TX spin_lock with __netif_tx_lock")
https://lore.kernel.org/all/20230127123604.36bb3e99@canb.auug.org.au/

net/netfilter/nf_conntrack_proto_sctp.c
13bd9b31a969 ("Revert "netfilter: conntrack: add sctp DATA_SENT state"")
a44b7651489f ("netfilter: conntrack: unify established states for SCTP paths")
f71cb8f45d09 ("netfilter: conntrack: sctp: use nf log infrastructure for invalid packets")
https://lore.kernel.org/all/20230127125052.674281f9@canb.auug.org.au/
https://lore.kernel.org/all/d36076f3-6add-a442-6d4b-ead9f7ffff86@tessares.net/

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

+2607 -1685
+7
CREDITS
··· 2489 2489 D: XF86_8514 2490 2490 D: cfdisk (curses based disk partitioning program) 2491 2491 2492 + N: Mat Martineau 2493 + E: mat@martineau.name 2494 + D: MPTCP subsystem co-maintainer 2020-2023 2495 + D: Keyctl restricted keyring and Diffie-Hellman UAPI 2496 + D: Bluetooth L2CAP ERTM mode and AMP 2497 + S: USA 2498 + 2492 2499 N: John S. Marvin 2493 2500 E: jsm@fc.hp.com 2494 2501 D: PA-RISC port
+23 -1
Documentation/devicetree/bindings/interconnect/qcom,rpm.yaml
··· 84 84 - qcom,msm8939-pcnoc 85 85 - qcom,msm8939-snoc 86 86 - qcom,msm8996-a1noc 87 - - qcom,msm8996-a2noc 88 87 - qcom,msm8996-bimc 89 88 - qcom,msm8996-cnoc 90 89 - qcom,msm8996-pnoc ··· 184 185 185 186 required: 186 187 - power-domains 188 + 189 + - if: 190 + properties: 191 + compatible: 192 + contains: 193 + enum: 194 + - qcom,msm8996-a2noc 195 + 196 + then: 197 + properties: 198 + clock-names: 199 + items: 200 + - const: bus 201 + - const: bus_a 202 + - const: aggre2_ufs_axi 203 + - const: ufs_axi 204 + 205 + clocks: 206 + items: 207 + - description: Bus Clock 208 + - description: Bus A Clock 209 + - description: Aggregate2 NoC UFS AXI Clock 210 + - description: UFS AXI Clock 187 211 188 212 - if: 189 213 properties:
+4 -4
Documentation/devicetree/bindings/phy/amlogic,meson-g12a-usb2-phy.yaml Documentation/devicetree/bindings/phy/amlogic,g12a-usb2-phy.yaml
··· 2 2 # Copyright 2019 BayLibre, SAS 3 3 %YAML 1.2 4 4 --- 5 - $id: "http://devicetree.org/schemas/phy/amlogic,meson-g12a-usb2-phy.yaml#" 5 + $id: "http://devicetree.org/schemas/phy/amlogic,g12a-usb2-phy.yaml#" 6 6 $schema: "http://devicetree.org/meta-schemas/core.yaml#" 7 7 8 8 title: Amlogic G12A USB2 PHY ··· 13 13 properties: 14 14 compatible: 15 15 enum: 16 - - amlogic,meson-g12a-usb2-phy 17 - - amlogic,meson-a1-usb2-phy 16 + - amlogic,g12a-usb2-phy 17 + - amlogic,a1-usb2-phy 18 18 19 19 reg: 20 20 maxItems: 1 ··· 68 68 examples: 69 69 - | 70 70 phy@36000 { 71 - compatible = "amlogic,meson-g12a-usb2-phy"; 71 + compatible = "amlogic,g12a-usb2-phy"; 72 72 reg = <0x36000 0x2000>; 73 73 clocks = <&xtal>; 74 74 clock-names = "xtal";
+3 -3
Documentation/devicetree/bindings/phy/amlogic,meson-g12a-usb3-pcie-phy.yaml Documentation/devicetree/bindings/phy/amlogic,g12a-usb3-pcie-phy.yaml
··· 2 2 # Copyright 2019 BayLibre, SAS 3 3 %YAML 1.2 4 4 --- 5 - $id: "http://devicetree.org/schemas/phy/amlogic,meson-g12a-usb3-pcie-phy.yaml#" 5 + $id: "http://devicetree.org/schemas/phy/amlogic,g12a-usb3-pcie-phy.yaml#" 6 6 $schema: "http://devicetree.org/meta-schemas/core.yaml#" 7 7 8 8 title: Amlogic G12A USB3 + PCIE Combo PHY ··· 13 13 properties: 14 14 compatible: 15 15 enum: 16 - - amlogic,meson-g12a-usb3-pcie-phy 16 + - amlogic,g12a-usb3-pcie-phy 17 17 18 18 reg: 19 19 maxItems: 1 ··· 49 49 examples: 50 50 - | 51 51 phy@46000 { 52 - compatible = "amlogic,meson-g12a-usb3-pcie-phy"; 52 + compatible = "amlogic,g12a-usb3-pcie-phy"; 53 53 reg = <0x46000 0x2000>; 54 54 clocks = <&ref_clk>; 55 55 clock-names = "ref_clk";
-1
Documentation/devicetree/bindings/phy/qcom,usb-hs-28nm.yaml
··· 16 16 compatible: 17 17 enum: 18 18 - qcom,usb-hs-28nm-femtophy 19 - - qcom,usb-hs-28nm-mdm9607 20 19 21 20 reg: 22 21 maxItems: 1
+2 -3
Documentation/devicetree/bindings/soc/qcom/qcom,apr-services.yaml
··· 39 39 qcom,protection-domain: 40 40 $ref: /schemas/types.yaml#/definitions/string-array 41 41 description: | 42 - Protection domain service name and path for APR service 43 - possible values are:: 42 + Protection domain service name and path for APR service (if supported). 43 + Possible values are:: 44 44 "avs/audio", "msm/adsp/audio_pd". 45 45 "kernel/elf_loader", "msm/modem/wlan_pd". 46 46 "tms/servreg", "msm/adsp/audio_pd". ··· 49 49 50 50 required: 51 51 - reg 52 - - qcom,protection-domain 53 52 54 53 additionalProperties: true
+1 -1
Documentation/kbuild/makefiles.rst
··· 1042 1042 1043 1043 When executing "make clean", the file "crc32table.h" will be deleted. 1044 1044 Kbuild will assume files to be in the same relative directory as the 1045 - Makefile, except if prefixed with $(objtree). 1045 + Makefile. 1046 1046 1047 1047 To exclude certain files or directories from make clean, use the 1048 1048 $(no-clean-files) variable.
+1 -1
Documentation/networking/bridge.rst
··· 8 8 userspace tools. 9 9 10 10 Documentation for Linux bridging is on: 11 - http://www.linuxfoundation.org/collaborate/workgroups/networking/bridge 11 + https://wiki.linuxfoundation.org/networking/bridge 12 12 13 13 The bridge-utilities are maintained at: 14 14 git://git.kernel.org/pub/scm/linux/kernel/git/shemminger/bridge-utils.git
+3 -7
Documentation/networking/nf_conntrack-sysctl.rst
··· 173 173 default 3 174 174 175 175 nf_conntrack_sctp_timeout_established - INTEGER (seconds) 176 - default 432000 (5 days) 176 + default 210 177 + 178 + Default is set to (hb_interval * path_max_retrans + rto_max) 177 179 178 180 nf_conntrack_sctp_timeout_shutdown_sent - INTEGER (seconds) 179 181 default 0.3 ··· 191 189 192 190 This timeout is used to setup conntrack entry on secondary paths. 193 191 Default is set to hb_interval. 194 - 195 - nf_conntrack_sctp_timeout_heartbeat_acked - INTEGER (seconds) 196 - default 210 197 - 198 - This timeout is used to setup conntrack entry on secondary paths. 199 - Default is set to (hb_interval * path_max_retrans + rto_max) 200 192 201 193 nf_conntrack_udp_timeout - INTEGER (seconds) 202 194 default 30
+8 -10
MAINTAINERS
··· 383 383 M: Robert Moore <robert.moore@intel.com> 384 384 M: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com> 385 385 L: linux-acpi@vger.kernel.org 386 - L: devel@acpica.org 386 + L: acpica-devel@lists.linuxfoundation.org 387 387 S: Supported 388 388 W: https://acpica.org/ 389 389 W: https://github.com/acpica/acpica/ ··· 7615 7615 F: drivers/firmware/efi/test/ 7616 7616 7617 7617 EFI VARIABLE FILESYSTEM 7618 - M: Matthew Garrett <matthew.garrett@nebula.com> 7619 7618 M: Jeremy Kerr <jk@ozlabs.org> 7620 7619 M: Ard Biesheuvel <ardb@kernel.org> 7621 7620 L: linux-efi@vger.kernel.org ··· 8466 8467 F: include/linux/fscache*.h 8467 8468 8468 8469 FSCRYPT: FILE SYSTEM LEVEL ENCRYPTION SUPPORT 8470 + M: Eric Biggers <ebiggers@kernel.org> 8469 8471 M: Theodore Y. Ts'o <tytso@mit.edu> 8470 8472 M: Jaegeuk Kim <jaegeuk@kernel.org> 8471 - M: Eric Biggers <ebiggers@kernel.org> 8472 8473 L: linux-fscrypt@vger.kernel.org 8473 8474 S: Supported 8474 8475 Q: https://patchwork.kernel.org/project/linux-fscrypt/list/ 8475 - T: git git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git 8476 + T: git https://git.kernel.org/pub/scm/fs/fscrypt/linux.git 8476 8477 F: Documentation/filesystems/fscrypt.rst 8477 8478 F: fs/crypto/ 8478 - F: include/linux/fscrypt*.h 8479 + F: include/linux/fscrypt.h 8479 8480 F: include/uapi/linux/fscrypt.h 8480 8481 8481 8482 FSI SUBSYSTEM ··· 8518 8519 FSVERITY: READ-ONLY FILE-BASED AUTHENTICITY PROTECTION 8519 8520 M: Eric Biggers <ebiggers@kernel.org> 8520 8521 M: Theodore Y. Ts'o <tytso@mit.edu> 8521 - L: linux-fscrypt@vger.kernel.org 8522 + L: fsverity@lists.linux.dev 8522 8523 S: Supported 8523 - Q: https://patchwork.kernel.org/project/linux-fscrypt/list/ 8524 - T: git git://git.kernel.org/pub/scm/fs/fscrypt/fscrypt.git fsverity 8524 + Q: https://patchwork.kernel.org/project/fsverity/list/ 8525 + T: git https://git.kernel.org/pub/scm/fs/fsverity/linux.git 8525 8526 F: Documentation/filesystems/fsverity.rst 8526 8527 F: fs/verity/ 8527 8528 F: include/linux/fsverity.h ··· 9297 9298 9298 9299 HISILICON DMA DRIVER 9299 9300 M: Zhou Wang <wangzhou1@hisilicon.com> 9300 - M: Jie Hai <haijie1@hisilicon.com> 9301 + M: Jie Hai <haijie1@huawei.com> 9301 9302 L: dmaengine@vger.kernel.org 9302 9303 S: Maintained 9303 9304 F: drivers/dma/hisi_dma.c ··· 14638 14639 F: net/netlabel/ 14639 14640 14640 14641 NETWORKING [MPTCP] 14641 - M: Mat Martineau <mathew.j.martineau@linux.intel.com> 14642 14642 M: Matthieu Baerts <matthieu.baerts@tessares.net> 14643 14643 L: netdev@vger.kernel.org 14644 14644 L: mptcp@lists.linux.dev
+15 -2
Makefile
··· 2 2 VERSION = 6 3 3 PATCHLEVEL = 2 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc4 5 + EXTRAVERSION = -rc5 6 6 NAME = Hurr durr I'ma ninja sloth 7 7 8 8 # *DOCUMENTATION* ··· 549 549 CFLAGS_KERNEL = 550 550 RUSTFLAGS_KERNEL = 551 551 AFLAGS_KERNEL = 552 - export LDFLAGS_vmlinux = 552 + LDFLAGS_vmlinux = 553 553 554 554 # Use USERINCLUDE when you must reference the UAPI directories only. 555 555 USERINCLUDE := \ ··· 1248 1248 @: 1249 1249 1250 1250 PHONY += vmlinux 1251 + # LDFLAGS_vmlinux in the top Makefile defines linker flags for the top vmlinux, 1252 + # not for decompressors. LDFLAGS_vmlinux in arch/*/boot/compressed/Makefile is 1253 + # unrelated; the decompressors just happen to have the same base name, 1254 + # arch/*/boot/compressed/vmlinux. 1255 + # Export LDFLAGS_vmlinux only to scripts/Makefile.vmlinux. 1256 + # 1257 + # _LDFLAGS_vmlinux is a workaround for the 'private export' bug: 1258 + # https://savannah.gnu.org/bugs/?61463 1259 + # For Make > 4.4, the following simple code will work: 1260 + # vmlinux: private export LDFLAGS_vmlinux := $(LDFLAGS_vmlinux) 1261 + vmlinux: private _LDFLAGS_vmlinux := $(LDFLAGS_vmlinux) 1262 + vmlinux: export LDFLAGS_vmlinux = $(_LDFLAGS_vmlinux) 1251 1263 vmlinux: vmlinux.o $(KBUILD_LDS) modpost 1252 1264 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.vmlinux 1253 1265 ··· 1545 1533 # *.ko are usually independent of vmlinux, but CONFIG_DEBUG_INFOBTF_MODULES 1546 1534 # is an exception. 1547 1535 ifdef CONFIG_DEBUG_INFO_BTF_MODULES 1536 + KBUILD_BUILTIN := 1 1548 1537 modules: vmlinux 1549 1538 endif 1550 1539
+2 -2
arch/arm/boot/dts/armada-38x.dtsi
··· 304 304 }; 305 305 306 306 gpio0: gpio@18100 { 307 - compatible = "marvell,armadaxp-gpio", 307 + compatible = "marvell,armada-370-gpio", 308 308 "marvell,orion-gpio"; 309 309 reg = <0x18100 0x40>, <0x181c0 0x08>; 310 310 reg-names = "gpio", "pwm"; ··· 323 323 }; 324 324 325 325 gpio1: gpio@18140 { 326 - compatible = "marvell,armadaxp-gpio", 326 + compatible = "marvell,armada-370-gpio", 327 327 "marvell,orion-gpio"; 328 328 reg = <0x18140 0x40>, <0x181c8 0x08>; 329 329 reg-names = "gpio", "pwm";
+2 -2
arch/arm/boot/dts/armada-39x.dtsi
··· 213 213 }; 214 214 215 215 gpio0: gpio@18100 { 216 - compatible = "marvell,armadaxp-gpio", "marvell,orion-gpio"; 216 + compatible = "marvell,orion-gpio"; 217 217 reg = <0x18100 0x40>; 218 218 ngpios = <32>; 219 219 gpio-controller; ··· 227 227 }; 228 228 229 229 gpio1: gpio@18140 { 230 - compatible = "marvell,armadaxp-gpio", "marvell,orion-gpio"; 230 + compatible = "marvell,orion-gpio"; 231 231 reg = <0x18140 0x40>; 232 232 ngpios = <28>; 233 233 gpio-controller;
+1 -1
arch/arm/boot/dts/imx53-ppd.dts
··· 488 488 scl-gpios = <&gpio3 21 GPIO_ACTIVE_HIGH>; 489 489 status = "okay"; 490 490 491 - i2c-switch@70 { 491 + i2c-mux@70 { 492 492 compatible = "nxp,pca9547"; 493 493 #address-cells = <1>; 494 494 #size-cells = <0>;
-1
arch/arm/boot/dts/imx6qdl-gw560x.dtsi
··· 632 632 &uart1 { 633 633 pinctrl-names = "default"; 634 634 pinctrl-0 = <&pinctrl_uart1>; 635 - uart-has-rtscts; 636 635 rts-gpios = <&gpio7 1 GPIO_ACTIVE_HIGH>; 637 636 status = "okay"; 638 637 };
+1 -1
arch/arm/boot/dts/imx6ul-pico-dwarf.dts
··· 32 32 }; 33 33 34 34 &i2c2 { 35 - clock_frequency = <100000>; 35 + clock-frequency = <100000>; 36 36 pinctrl-names = "default"; 37 37 pinctrl-0 = <&pinctrl_i2c2>; 38 38 status = "okay";
+2 -2
arch/arm/boot/dts/imx7d-pico-dwarf.dts
··· 32 32 }; 33 33 34 34 &i2c1 { 35 - clock_frequency = <100000>; 35 + clock-frequency = <100000>; 36 36 pinctrl-names = "default"; 37 37 pinctrl-0 = <&pinctrl_i2c1>; 38 38 status = "okay"; ··· 52 52 }; 53 53 54 54 &i2c4 { 55 - clock_frequency = <100000>; 55 + clock-frequency = <100000>; 56 56 pinctrl-names = "default"; 57 57 pinctrl-0 = <&pinctrl_i2c1>; 58 58 status = "okay";
+2 -2
arch/arm/boot/dts/imx7d-pico-nymph.dts
··· 43 43 }; 44 44 45 45 &i2c1 { 46 - clock_frequency = <100000>; 46 + clock-frequency = <100000>; 47 47 pinctrl-names = "default"; 48 48 pinctrl-0 = <&pinctrl_i2c1>; 49 49 status = "okay"; ··· 64 64 }; 65 65 66 66 &i2c2 { 67 - clock_frequency = <100000>; 67 + clock-frequency = <100000>; 68 68 pinctrl-names = "default"; 69 69 pinctrl-0 = <&pinctrl_i2c2>; 70 70 status = "okay";
+11 -11
arch/arm/boot/dts/qcom-apq8084-ifc6540.dts
··· 19 19 serial@f995e000 { 20 20 status = "okay"; 21 21 }; 22 - 23 - sdhci@f9824900 { 24 - bus-width = <8>; 25 - non-removable; 26 - status = "okay"; 27 - }; 28 - 29 - sdhci@f98a4900 { 30 - cd-gpios = <&tlmm 122 GPIO_ACTIVE_LOW>; 31 - bus-width = <4>; 32 - }; 33 22 }; 23 + }; 24 + 25 + &sdhc_1 { 26 + bus-width = <8>; 27 + non-removable; 28 + status = "okay"; 29 + }; 30 + 31 + &sdhc_2 { 32 + cd-gpios = <&tlmm 122 GPIO_ACTIVE_LOW>; 33 + bus-width = <4>; 34 34 };
+2 -2
arch/arm/boot/dts/qcom-apq8084.dtsi
··· 421 421 status = "disabled"; 422 422 }; 423 423 424 - mmc@f9824900 { 424 + sdhc_1: mmc@f9824900 { 425 425 compatible = "qcom,apq8084-sdhci", "qcom,sdhci-msm-v4"; 426 426 reg = <0xf9824900 0x11c>, <0xf9824000 0x800>; 427 427 reg-names = "hc", "core"; ··· 434 434 status = "disabled"; 435 435 }; 436 436 437 - mmc@f98a4900 { 437 + sdhc_2: mmc@f98a4900 { 438 438 compatible = "qcom,apq8084-sdhci", "qcom,sdhci-msm-v4"; 439 439 reg = <0xf98a4900 0x11c>, <0xf98a4000 0x800>; 440 440 reg-names = "hc", "core";
+1 -1
arch/arm/boot/dts/sam9x60.dtsi
··· 564 564 mpddrc: mpddrc@ffffe800 { 565 565 compatible = "microchip,sam9x60-ddramc", "atmel,sama5d3-ddramc"; 566 566 reg = <0xffffe800 0x200>; 567 - clocks = <&pmc PMC_TYPE_SYSTEM 2>, <&pmc PMC_TYPE_CORE PMC_MCK>; 567 + clocks = <&pmc PMC_TYPE_SYSTEM 2>, <&pmc PMC_TYPE_PERIPHERAL 49>; 568 568 clock-names = "ddrck", "mpddr"; 569 569 }; 570 570
+6 -2
arch/arm/boot/dts/stm32mp151a-prtt1l.dtsi
··· 101 101 102 102 &qspi { 103 103 pinctrl-names = "default", "sleep"; 104 - pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>; 105 - pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>; 104 + pinctrl-0 = <&qspi_clk_pins_a 105 + &qspi_bk1_pins_a 106 + &qspi_cs1_pins_a>; 107 + pinctrl-1 = <&qspi_clk_sleep_pins_a 108 + &qspi_bk1_sleep_pins_a 109 + &qspi_cs1_sleep_pins_a>; 106 110 reg = <0x58003000 0x1000>, <0x70000000 0x4000000>; 107 111 #address-cells = <1>; 108 112 #size-cells = <0>;
+6 -2
arch/arm/boot/dts/stm32mp157c-emstamp-argon.dtsi
··· 391 391 392 392 &qspi { 393 393 pinctrl-names = "default", "sleep"; 394 - pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>; 395 - pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>; 394 + pinctrl-0 = <&qspi_clk_pins_a 395 + &qspi_bk1_pins_a 396 + &qspi_cs1_pins_a>; 397 + pinctrl-1 = <&qspi_clk_sleep_pins_a 398 + &qspi_bk1_sleep_pins_a 399 + &qspi_cs1_sleep_pins_a>; 396 400 reg = <0x58003000 0x1000>, <0x70000000 0x4000000>; 397 401 #address-cells = <1>; 398 402 #size-cells = <0>;
+6 -2
arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi
··· 428 428 429 429 &qspi { 430 430 pinctrl-names = "default", "sleep"; 431 - pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>; 432 - pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>; 431 + pinctrl-0 = <&qspi_clk_pins_a 432 + &qspi_bk1_pins_a 433 + &qspi_cs1_pins_a>; 434 + pinctrl-1 = <&qspi_clk_sleep_pins_a 435 + &qspi_bk1_sleep_pins_a 436 + &qspi_cs1_sleep_pins_a>; 433 437 reg = <0x58003000 0x1000>, <0x70000000 0x4000000>; 434 438 #address-cells = <1>; 435 439 #size-cells = <0>;
+6 -2
arch/arm/boot/dts/stm32mp15xx-dhcor-som.dtsi
··· 247 247 248 248 &qspi { 249 249 pinctrl-names = "default", "sleep"; 250 - pinctrl-0 = <&qspi_clk_pins_a &qspi_bk1_pins_a>; 251 - pinctrl-1 = <&qspi_clk_sleep_pins_a &qspi_bk1_sleep_pins_a>; 250 + pinctrl-0 = <&qspi_clk_pins_a 251 + &qspi_bk1_pins_a 252 + &qspi_cs1_pins_a>; 253 + pinctrl-1 = <&qspi_clk_sleep_pins_a 254 + &qspi_bk1_sleep_pins_a 255 + &qspi_cs1_sleep_pins_a>; 252 256 reg = <0x58003000 0x1000>, <0x70000000 0x200000>; 253 257 #address-cells = <1>; 254 258 #size-cells = <0>;
+1 -1
arch/arm/boot/dts/vf610-zii-dev-rev-b.dts
··· 345 345 }; 346 346 347 347 &i2c2 { 348 - tca9548@70 { 348 + i2c-mux@70 { 349 349 compatible = "nxp,pca9548"; 350 350 pinctrl-0 = <&pinctrl_i2c_mux_reset>; 351 351 pinctrl-names = "default";
+1 -1
arch/arm/boot/dts/vf610-zii-dev-rev-c.dts
··· 340 340 }; 341 341 342 342 &i2c2 { 343 - tca9548@70 { 343 + i2c-mux@70 { 344 344 compatible = "nxp,pca9548"; 345 345 pinctrl-0 = <&pinctrl_i2c_mux_reset>; 346 346 pinctrl-names = "default";
-1
arch/arm/mach-footbridge/isa-rtc.c
··· 20 20 21 21 #include <linux/init.h> 22 22 #include <linux/mc146818rtc.h> 23 - #include <linux/bcd.h> 24 23 #include <linux/io.h> 25 24 26 25 #include "common.h"
+1
arch/arm/mach-imx/cpu-imx25.c
··· 23 23 24 24 np = of_find_compatible_node(NULL, NULL, "fsl,imx25-iim"); 25 25 iim_base = of_iomap(np, 0); 26 + of_node_put(np); 26 27 BUG_ON(!iim_base); 27 28 rev = readl(iim_base + MXC_IIMSREV); 28 29 iounmap(iim_base);
+1
arch/arm/mach-imx/cpu-imx27.c
··· 28 28 29 29 np = of_find_compatible_node(NULL, NULL, "fsl,imx27-ccm"); 30 30 ccm_base = of_iomap(np, 0); 31 + of_node_put(np); 31 32 BUG_ON(!ccm_base); 32 33 /* 33 34 * now we have access to the IO registers. As we need
+1
arch/arm/mach-imx/cpu-imx31.c
··· 39 39 40 40 np = of_find_compatible_node(NULL, NULL, "fsl,imx31-iim"); 41 41 iim_base = of_iomap(np, 0); 42 + of_node_put(np); 42 43 BUG_ON(!iim_base); 43 44 44 45 /* read SREV register from IIM module */
+1
arch/arm/mach-imx/cpu-imx35.c
··· 21 21 22 22 np = of_find_compatible_node(NULL, NULL, "fsl,imx35-iim"); 23 23 iim_base = of_iomap(np, 0); 24 + of_node_put(np); 24 25 BUG_ON(!iim_base); 25 26 26 27 rev = imx_readl(iim_base + MXC_IIMSREV);
+1
arch/arm/mach-imx/cpu-imx5.c
··· 28 28 29 29 np = of_find_compatible_node(NULL, NULL, compat); 30 30 iim_base = of_iomap(np, 0); 31 + of_node_put(np); 31 32 WARN_ON(!iim_base); 32 33 33 34 srev = readl(iim_base + IIM_SREV) & 0xff;
+1 -4
arch/arm/mach-omap1/Kconfig
··· 4 4 depends on ARCH_MULTI_V4T || ARCH_MULTI_V5 5 5 depends on CPU_LITTLE_ENDIAN 6 6 depends on ATAGS 7 + select ARCH_OMAP 7 8 select ARCH_HAS_HOLES_MEMORYMODEL 8 9 select ARCH_OMAP 9 10 select CLKSRC_MMIO ··· 45 44 select ARCH_OMAP_OTG 46 45 select CPU_ARM926T 47 46 select OMAP_DM_TIMER 48 - 49 - config ARCH_OMAP1_ANY 50 - select ARCH_OMAP 51 - def_bool ARCH_OMAP730 || ARCH_OMAP850 || ARCH_OMAP15XX || ARCH_OMAP16XX 52 47 53 48 config ARCH_OMAP 54 49 bool
-4
arch/arm/mach-omap1/Makefile
··· 3 3 # Makefile for the linux kernel. 4 4 # 5 5 6 - ifdef CONFIG_ARCH_OMAP1_ANY 7 - 8 6 # Common support 9 7 obj-y := io.o id.o sram-init.o sram.o time.o irq.o mux.o flash.o \ 10 8 serial.o devices.o dma.o omap-dma.o fb.o ··· 57 59 obj-$(CONFIG_ARCH_OMAP850) += gpio7xx.o 58 60 obj-$(CONFIG_ARCH_OMAP15XX) += gpio15xx.o 59 61 obj-$(CONFIG_ARCH_OMAP16XX) += gpio16xx.o 60 - 61 - endif
+1
arch/arm/mach-omap1/gpio15xx.c
··· 11 11 #include <linux/gpio.h> 12 12 #include <linux/platform_data/gpio-omap.h> 13 13 #include <linux/soc/ti/omap1-soc.h> 14 + #include <asm/irq.h> 14 15 15 16 #include "irqs.h" 16 17
+15 -17
arch/arm/mach-omap1/io.c
··· 22 22 * The machine specific code may provide the extra mapping besides the 23 23 * default mapping provided here. 24 24 */ 25 - static struct map_desc omap_io_desc[] __initdata = { 25 + #if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850) 26 + static struct map_desc omap7xx_io_desc[] __initdata = { 26 27 { 27 28 .virtual = OMAP1_IO_VIRT, 28 29 .pfn = __phys_to_pfn(OMAP1_IO_PHYS), 29 30 .length = OMAP1_IO_SIZE, 30 31 .type = MT_DEVICE 31 - } 32 - }; 33 - 34 - #if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850) 35 - static struct map_desc omap7xx_io_desc[] __initdata = { 32 + }, 36 33 { 37 34 .virtual = OMAP7XX_DSP_BASE, 38 35 .pfn = __phys_to_pfn(OMAP7XX_DSP_START), ··· 47 50 #ifdef CONFIG_ARCH_OMAP15XX 48 51 static struct map_desc omap1510_io_desc[] __initdata = { 49 52 { 53 + .virtual = OMAP1_IO_VIRT, 54 + .pfn = __phys_to_pfn(OMAP1_IO_PHYS), 55 + .length = OMAP1_IO_SIZE, 56 + .type = MT_DEVICE 57 + }, 58 + { 50 59 .virtual = OMAP1510_DSP_BASE, 51 60 .pfn = __phys_to_pfn(OMAP1510_DSP_START), 52 61 .length = OMAP1510_DSP_SIZE, ··· 69 66 #if defined(CONFIG_ARCH_OMAP16XX) 70 67 static struct map_desc omap16xx_io_desc[] __initdata = { 71 68 { 69 + .virtual = OMAP1_IO_VIRT, 70 + .pfn = __phys_to_pfn(OMAP1_IO_PHYS), 71 + .length = OMAP1_IO_SIZE, 72 + .type = MT_DEVICE 73 + }, 74 + { 72 75 .virtual = OMAP16XX_DSP_BASE, 73 76 .pfn = __phys_to_pfn(OMAP16XX_DSP_START), 74 77 .length = OMAP16XX_DSP_SIZE, ··· 88 79 }; 89 80 #endif 90 81 91 - /* 92 - * Maps common IO regions for omap1 93 - */ 94 - static void __init omap1_map_common_io(void) 95 - { 96 - iotable_init(omap_io_desc, ARRAY_SIZE(omap_io_desc)); 97 - } 98 - 99 82 #if defined (CONFIG_ARCH_OMAP730) || defined (CONFIG_ARCH_OMAP850) 100 83 void __init omap7xx_map_io(void) 101 84 { 102 - omap1_map_common_io(); 103 85 iotable_init(omap7xx_io_desc, ARRAY_SIZE(omap7xx_io_desc)); 104 86 } 105 87 #endif ··· 98 98 #ifdef CONFIG_ARCH_OMAP15XX 99 99 void __init omap15xx_map_io(void) 100 100 { 101 - omap1_map_common_io(); 102 101 iotable_init(omap1510_io_desc, ARRAY_SIZE(omap1510_io_desc)); 103 102 } 104 103 #endif ··· 105 106 #if defined(CONFIG_ARCH_OMAP16XX) 106 107 void __init omap16xx_map_io(void) 107 108 { 108 - omap1_map_common_io(); 109 109 iotable_init(omap16xx_io_desc, ARRAY_SIZE(omap16xx_io_desc)); 110 110 } 111 111 #endif
-21
arch/arm/mach-omap1/mcbsp.c
··· 89 89 #define OMAP1610_MCBSP2_BASE 0xfffb1000 90 90 #define OMAP1610_MCBSP3_BASE 0xe1017000 91 91 92 - #if defined(CONFIG_ARCH_OMAP730) || defined(CONFIG_ARCH_OMAP850) 93 92 struct resource omap7xx_mcbsp_res[][6] = { 94 93 { 95 94 { ··· 158 159 }; 159 160 #define OMAP7XX_MCBSP_RES_SZ ARRAY_SIZE(omap7xx_mcbsp_res[1]) 160 161 #define OMAP7XX_MCBSP_COUNT ARRAY_SIZE(omap7xx_mcbsp_res) 161 - #else 162 - #define omap7xx_mcbsp_res_0 NULL 163 - #define omap7xx_mcbsp_pdata NULL 164 - #define OMAP7XX_MCBSP_RES_SZ 0 165 - #define OMAP7XX_MCBSP_COUNT 0 166 - #endif 167 162 168 - #ifdef CONFIG_ARCH_OMAP15XX 169 163 struct resource omap15xx_mcbsp_res[][6] = { 170 164 { 171 165 { ··· 258 266 }; 259 267 #define OMAP15XX_MCBSP_RES_SZ ARRAY_SIZE(omap15xx_mcbsp_res[1]) 260 268 #define OMAP15XX_MCBSP_COUNT ARRAY_SIZE(omap15xx_mcbsp_res) 261 - #else 262 - #define omap15xx_mcbsp_res_0 NULL 263 - #define omap15xx_mcbsp_pdata NULL 264 - #define OMAP15XX_MCBSP_RES_SZ 0 265 - #define OMAP15XX_MCBSP_COUNT 0 266 - #endif 267 269 268 - #ifdef CONFIG_ARCH_OMAP16XX 269 270 struct resource omap16xx_mcbsp_res[][6] = { 270 271 { 271 272 { ··· 358 373 }; 359 374 #define OMAP16XX_MCBSP_RES_SZ ARRAY_SIZE(omap16xx_mcbsp_res[1]) 360 375 #define OMAP16XX_MCBSP_COUNT ARRAY_SIZE(omap16xx_mcbsp_res) 361 - #else 362 - #define omap16xx_mcbsp_res_0 NULL 363 - #define omap16xx_mcbsp_pdata NULL 364 - #define OMAP16XX_MCBSP_RES_SZ 0 365 - #define OMAP16XX_MCBSP_COUNT 0 366 - #endif 367 376 368 377 static void omap_mcbsp_register_board_cfg(struct resource *res, int res_count, 369 378 struct omap_mcbsp_platform_data *config, int size)
-7
arch/arm/mach-omap1/pm.h
··· 106 106 #define OMAP7XX_IDLECT3 0xfffece24 107 107 #define OMAP7XX_IDLE_LOOP_REQUEST 0x0C00 108 108 109 - #if !defined(CONFIG_ARCH_OMAP730) && \ 110 - !defined(CONFIG_ARCH_OMAP850) && \ 111 - !defined(CONFIG_ARCH_OMAP15XX) && \ 112 - !defined(CONFIG_ARCH_OMAP16XX) 113 - #warning "Power management for this processor not implemented yet" 114 - #endif 115 - 116 109 #ifndef __ASSEMBLER__ 117 110 118 111 #include <linux/clk.h>
+2
arch/arm/mach-pxa/Kconfig
··· 45 45 config MACH_PXA3XX_DT 46 46 bool "Support PXA3xx platforms from device tree" 47 47 select CPU_PXA300 48 + select CPU_PXA310 49 + select CPU_PXA320 48 50 select PINCTRL 49 51 select POWER_SUPPLY 50 52 select PXA3xx
+2 -6
arch/arm64/boot/dts/amlogic/meson-sm1-odroid-hc4.dts
··· 131 131 }; 132 132 133 133 &usb { 134 - phys = <&usb2_phy1>; 135 - phy-names = "usb2-phy1"; 136 - }; 137 - 138 - &usb2_phy0 { 139 - status = "disabled"; 134 + phys = <&usb2_phy0>, <&usb2_phy1>; 135 + phy-names = "usb2-phy0", "usb2-phy1"; 140 136 };
+1 -1
arch/arm64/boot/dts/freescale/fsl-ls1012a-qds.dts
··· 110 110 &i2c0 { 111 111 status = "okay"; 112 112 113 - pca9547@77 { 113 + i2c-mux@77 { 114 114 compatible = "nxp,pca9547"; 115 115 reg = <0x77>; 116 116 #address-cells = <1>;
+1 -1
arch/arm64/boot/dts/freescale/fsl-ls1043a-qds.dts
··· 89 89 &i2c0 { 90 90 status = "okay"; 91 91 92 - pca9547@77 { 92 + i2c-mux@77 { 93 93 compatible = "nxp,pca9547"; 94 94 reg = <0x77>; 95 95 #address-cells = <1>;
+1 -1
arch/arm64/boot/dts/freescale/fsl-ls1046a-qds.dts
··· 88 88 &i2c0 { 89 89 status = "okay"; 90 90 91 - pca9547@77 { 91 + i2c-mux@77 { 92 92 compatible = "nxp,pca9547"; 93 93 reg = <0x77>; 94 94 #address-cells = <1>;
+1 -1
arch/arm64/boot/dts/freescale/fsl-ls1088a-qds.dts
··· 53 53 &i2c0 { 54 54 status = "okay"; 55 55 56 - i2c-switch@77 { 56 + i2c-mux@77 { 57 57 compatible = "nxp,pca9547"; 58 58 reg = <0x77>; 59 59 #address-cells = <1>;
+1 -1
arch/arm64/boot/dts/freescale/fsl-ls1088a-rdb.dts
··· 136 136 &i2c0 { 137 137 status = "okay"; 138 138 139 - i2c-switch@77 { 139 + i2c-mux@77 { 140 140 compatible = "nxp,pca9547"; 141 141 reg = <0x77>; 142 142 #address-cells = <1>;
+1 -1
arch/arm64/boot/dts/freescale/fsl-ls1088a-ten64.dts
··· 245 245 &i2c3 { 246 246 status = "okay"; 247 247 248 - i2c-switch@70 { 248 + i2c-mux@70 { 249 249 compatible = "nxp,pca9540"; 250 250 #address-cells = <1>; 251 251 #size-cells = <0>;
+1 -1
arch/arm64/boot/dts/freescale/fsl-ls208xa-qds.dtsi
··· 103 103 104 104 &i2c0 { 105 105 status = "okay"; 106 - pca9547@77 { 106 + i2c-mux@77 { 107 107 compatible = "nxp,pca9547"; 108 108 reg = <0x77>; 109 109 #address-cells = <1>;
+1 -1
arch/arm64/boot/dts/freescale/fsl-ls208xa-rdb.dtsi
··· 44 44 45 45 &i2c0 { 46 46 status = "okay"; 47 - pca9547@75 { 47 + i2c-mux@75 { 48 48 compatible = "nxp,pca9547"; 49 49 reg = <0x75>; 50 50 #address-cells = <1>;
+1 -1
arch/arm64/boot/dts/freescale/fsl-lx2160a-cex7.dtsi
··· 54 54 &i2c0 { 55 55 status = "okay"; 56 56 57 - i2c-switch@77 { 57 + i2c-mux@77 { 58 58 compatible = "nxp,pca9547"; 59 59 #address-cells = <1>; 60 60 #size-cells = <0>;
+2 -2
arch/arm64/boot/dts/freescale/imx8mm-beacon-baseboard.dtsi
··· 120 120 &ecspi2 { 121 121 pinctrl-names = "default"; 122 122 pinctrl-0 = <&pinctrl_espi2>; 123 - cs-gpios = <&gpio5 9 GPIO_ACTIVE_LOW>; 123 + cs-gpios = <&gpio5 13 GPIO_ACTIVE_LOW>; 124 124 status = "okay"; 125 125 126 126 eeprom@0 { ··· 316 316 MX8MM_IOMUXC_ECSPI2_SCLK_ECSPI2_SCLK 0x82 317 317 MX8MM_IOMUXC_ECSPI2_MOSI_ECSPI2_MOSI 0x82 318 318 MX8MM_IOMUXC_ECSPI2_MISO_ECSPI2_MISO 0x82 319 - MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9 0x41 319 + MX8MM_IOMUXC_ECSPI2_SS0_GPIO5_IO13 0x41 320 320 >; 321 321 }; 322 322
+1 -1
arch/arm64/boot/dts/freescale/imx8mm-data-modul-edm-sbc.dts
··· 275 275 compatible = "rohm,bd71847"; 276 276 reg = <0x4b>; 277 277 #clock-cells = <0>; 278 - clocks = <&clk_xtal32k 0>; 278 + clocks = <&clk_xtal32k>; 279 279 clock-output-names = "clk-32k-out"; 280 280 pinctrl-names = "default"; 281 281 pinctrl-0 = <&pinctrl_pmic>;
+1 -1
arch/arm64/boot/dts/freescale/imx8mm-nitrogen-r2.dts
··· 214 214 pinctrl-0 = <&pinctrl_i2c3>; 215 215 status = "okay"; 216 216 217 - i2cmux@70 { 217 + i2c-mux@70 { 218 218 compatible = "nxp,pca9540"; 219 219 reg = <0x70>; 220 220 #address-cells = <1>;
+1
arch/arm64/boot/dts/freescale/imx8mm-venice-gw7901.dts
··· 771 771 &usbotg2 { 772 772 dr_mode = "host"; 773 773 vbus-supply = <&reg_usb2_vbus>; 774 + over-current-active-low; 774 775 status = "okay"; 775 776 }; 776 777
+1
arch/arm64/boot/dts/freescale/imx8mm-verdin-dahlia.dtsi
··· 9 9 simple-audio-card,bitclock-master = <&dailink_master>; 10 10 simple-audio-card,format = "i2s"; 11 11 simple-audio-card,frame-master = <&dailink_master>; 12 + simple-audio-card,mclk-fs = <256>; 12 13 simple-audio-card,name = "imx8mm-wm8904"; 13 14 simple-audio-card,routing = 14 15 "Headphone Jack", "HPOUTL",
+1
arch/arm64/boot/dts/freescale/imx8mm-verdin-dev.dtsi
··· 11 11 simple-audio-card,bitclock-master = <&dailink_master>; 12 12 simple-audio-card,format = "i2s"; 13 13 simple-audio-card,frame-master = <&dailink_master>; 14 + simple-audio-card,mclk-fs = <256>; 14 15 simple-audio-card,name = "imx8mm-nau8822"; 15 16 simple-audio-card,routing = 16 17 "Headphones", "LHP",
+2 -2
arch/arm64/boot/dts/freescale/imx8mp-evk.dts
··· 36 36 37 37 pcie0_refclk: pcie0-refclk { 38 38 compatible = "fixed-clock"; 39 - #clock-cells = <0>; 40 - clock-frequency = <100000000>; 39 + #clock-cells = <0>; 40 + clock-frequency = <100000000>; 41 41 }; 42 42 43 43 reg_can1_stby: regulator-can1-stby {
-10
arch/arm64/boot/dts/freescale/imx8mp-phycore-som.dtsi
··· 99 99 100 100 regulators { 101 101 buck1: BUCK1 { 102 - regulator-compatible = "BUCK1"; 103 102 regulator-min-microvolt = <600000>; 104 103 regulator-max-microvolt = <2187500>; 105 104 regulator-boot-on; ··· 107 108 }; 108 109 109 110 buck2: BUCK2 { 110 - regulator-compatible = "BUCK2"; 111 111 regulator-min-microvolt = <600000>; 112 112 regulator-max-microvolt = <2187500>; 113 113 regulator-boot-on; ··· 117 119 }; 118 120 119 121 buck4: BUCK4 { 120 - regulator-compatible = "BUCK4"; 121 122 regulator-min-microvolt = <600000>; 122 123 regulator-max-microvolt = <3400000>; 123 124 regulator-boot-on; ··· 124 127 }; 125 128 126 129 buck5: BUCK5 { 127 - regulator-compatible = "BUCK5"; 128 130 regulator-min-microvolt = <600000>; 129 131 regulator-max-microvolt = <3400000>; 130 132 regulator-boot-on; ··· 131 135 }; 132 136 133 137 buck6: BUCK6 { 134 - regulator-compatible = "BUCK6"; 135 138 regulator-min-microvolt = <600000>; 136 139 regulator-max-microvolt = <3400000>; 137 140 regulator-boot-on; ··· 138 143 }; 139 144 140 145 ldo1: LDO1 { 141 - regulator-compatible = "LDO1"; 142 146 regulator-min-microvolt = <1600000>; 143 147 regulator-max-microvolt = <3300000>; 144 148 regulator-boot-on; ··· 145 151 }; 146 152 147 153 ldo2: LDO2 { 148 - regulator-compatible = "LDO2"; 149 154 regulator-min-microvolt = <800000>; 150 155 regulator-max-microvolt = <1150000>; 151 156 regulator-boot-on; ··· 152 159 }; 153 160 154 161 ldo3: LDO3 { 155 - regulator-compatible = "LDO3"; 156 162 regulator-min-microvolt = <800000>; 157 163 regulator-max-microvolt = <3300000>; 158 164 regulator-boot-on; ··· 159 167 }; 160 168 161 169 ldo4: LDO4 { 162 - regulator-compatible = "LDO4"; 163 170 regulator-min-microvolt = <800000>; 164 171 regulator-max-microvolt = <3300000>; 165 172 }; 166 173 167 174 ldo5: LDO5 { 168 - regulator-compatible = "LDO5"; 169 175 regulator-min-microvolt = <1800000>; 170 176 regulator-max-microvolt = <3300000>; 171 177 regulator-boot-on;
+8 -7
arch/arm64/boot/dts/freescale/imx8mp.dtsi
··· 524 524 compatible = "fsl,imx8mp-gpc"; 525 525 reg = <0x303a0000 0x1000>; 526 526 interrupt-parent = <&gic>; 527 + interrupts = <GIC_SPI 87 IRQ_TYPE_LEVEL_HIGH>; 527 528 interrupt-controller; 528 529 #interrupt-cells = <3>; 529 530 ··· 591 590 reg = <IMX8MP_POWER_DOMAIN_MIPI_PHY2>; 592 591 }; 593 592 594 - pgc_hsiomix: power-domains@17 { 593 + pgc_hsiomix: power-domain@17 { 595 594 #power-domain-cells = <0>; 596 595 reg = <IMX8MP_POWER_DOMAIN_HSIOMIX>; 597 596 clocks = <&clk IMX8MP_CLK_HSIO_AXI>, ··· 1298 1297 reg = <0x32f10100 0x8>, 1299 1298 <0x381f0000 0x20>; 1300 1299 clocks = <&clk IMX8MP_CLK_HSIO_ROOT>, 1301 - <&clk IMX8MP_CLK_USB_ROOT>; 1300 + <&clk IMX8MP_CLK_USB_SUSP>; 1302 1301 clock-names = "hsio", "suspend"; 1303 1302 interrupts = <GIC_SPI 148 IRQ_TYPE_LEVEL_HIGH>; 1304 1303 power-domains = <&hsio_blk_ctrl IMX8MP_HSIOBLK_PD_USB>; ··· 1311 1310 usb_dwc3_0: usb@38100000 { 1312 1311 compatible = "snps,dwc3"; 1313 1312 reg = <0x38100000 0x10000>; 1314 - clocks = <&clk IMX8MP_CLK_HSIO_AXI>, 1313 + clocks = <&clk IMX8MP_CLK_USB_ROOT>, 1315 1314 <&clk IMX8MP_CLK_USB_CORE_REF>, 1316 - <&clk IMX8MP_CLK_USB_ROOT>; 1315 + <&clk IMX8MP_CLK_USB_SUSP>; 1317 1316 clock-names = "bus_early", "ref", "suspend"; 1318 1317 interrupts = <GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>; 1319 1318 phys = <&usb3_phy0>, <&usb3_phy0>; ··· 1340 1339 reg = <0x32f10108 0x8>, 1341 1340 <0x382f0000 0x20>; 1342 1341 clocks = <&clk IMX8MP_CLK_HSIO_ROOT>, 1343 - <&clk IMX8MP_CLK_USB_ROOT>; 1342 + <&clk IMX8MP_CLK_USB_SUSP>; 1344 1343 clock-names = "hsio", "suspend"; 1345 1344 interrupts = <GIC_SPI 149 IRQ_TYPE_LEVEL_HIGH>; 1346 1345 power-domains = <&hsio_blk_ctrl IMX8MP_HSIOBLK_PD_USB>; ··· 1353 1352 usb_dwc3_1: usb@38200000 { 1354 1353 compatible = "snps,dwc3"; 1355 1354 reg = <0x38200000 0x10000>; 1356 - clocks = <&clk IMX8MP_CLK_HSIO_AXI>, 1355 + clocks = <&clk IMX8MP_CLK_USB_ROOT>, 1357 1356 <&clk IMX8MP_CLK_USB_CORE_REF>, 1358 - <&clk IMX8MP_CLK_USB_ROOT>; 1357 + <&clk IMX8MP_CLK_USB_SUSP>; 1359 1358 clock-names = "bus_early", "ref", "suspend"; 1360 1359 interrupts = <GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>; 1361 1360 phys = <&usb3_phy1>, <&usb3_phy1>;
+2 -2
arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dts
··· 133 133 pinctrl-0 = <&pinctrl_i2c1>; 134 134 status = "okay"; 135 135 136 - i2cmux@70 { 136 + i2c-mux@70 { 137 137 compatible = "nxp,pca9546"; 138 138 pinctrl-names = "default"; 139 139 pinctrl-0 = <&pinctrl_i2c1_pca9546>; ··· 216 216 pinctrl-0 = <&pinctrl_i2c4>; 217 217 status = "okay"; 218 218 219 - pca9546: i2cmux@70 { 219 + pca9546: i2c-mux@70 { 220 220 compatible = "nxp,pca9546"; 221 221 reg = <0x70>; 222 222 #address-cells = <1>;
+2 -2
arch/arm64/boot/dts/freescale/imx8mq-thor96.dts
··· 339 339 bus-width = <4>; 340 340 non-removable; 341 341 no-sd; 342 - no-emmc; 342 + no-mmc; 343 343 status = "okay"; 344 344 345 345 brcmf: wifi@1 { ··· 359 359 cd-gpios = <&gpio2 12 GPIO_ACTIVE_LOW>; 360 360 bus-width = <4>; 361 361 no-sdio; 362 - no-emmc; 362 + no-mmc; 363 363 disable-wp; 364 364 status = "okay"; 365 365 };
+1 -1
arch/arm64/boot/dts/freescale/imx8qxp-mek.dts
··· 61 61 pinctrl-0 = <&pinctrl_lpi2c1 &pinctrl_ioexp_rst>; 62 62 status = "okay"; 63 63 64 - i2c-switch@71 { 64 + i2c-mux@71 { 65 65 compatible = "nxp,pca9646", "nxp,pca9546"; 66 66 #address-cells = <1>; 67 67 #size-cells = <0>;
+3 -3
arch/arm64/boot/dts/freescale/imx93-11x11-evk.dts
··· 152 152 153 153 pinctrl_usdhc1: usdhc1grp { 154 154 fsl,pins = < 155 - MX93_PAD_SD1_CLK__USDHC1_CLK 0x17fe 155 + MX93_PAD_SD1_CLK__USDHC1_CLK 0x15fe 156 156 MX93_PAD_SD1_CMD__USDHC1_CMD 0x13fe 157 157 MX93_PAD_SD1_DATA0__USDHC1_DATA0 0x13fe 158 158 MX93_PAD_SD1_DATA1__USDHC1_DATA1 0x13fe ··· 162 162 MX93_PAD_SD1_DATA5__USDHC1_DATA5 0x13fe 163 163 MX93_PAD_SD1_DATA6__USDHC1_DATA6 0x13fe 164 164 MX93_PAD_SD1_DATA7__USDHC1_DATA7 0x13fe 165 - MX93_PAD_SD1_STROBE__USDHC1_STROBE 0x17fe 165 + MX93_PAD_SD1_STROBE__USDHC1_STROBE 0x15fe 166 166 >; 167 167 }; 168 168 ··· 180 180 181 181 pinctrl_usdhc2: usdhc2grp { 182 182 fsl,pins = < 183 - MX93_PAD_SD2_CLK__USDHC2_CLK 0x17fe 183 + MX93_PAD_SD2_CLK__USDHC2_CLK 0x15fe 184 184 MX93_PAD_SD2_CMD__USDHC2_CMD 0x13fe 185 185 MX93_PAD_SD2_DATA0__USDHC2_DATA0 0x13fe 186 186 MX93_PAD_SD2_DATA1__USDHC2_DATA1 0x13fe
+1 -1
arch/arm64/boot/dts/marvell/ac5-98dx25xx.dtsi
··· 98 98 99 99 uart1: serial@12100 { 100 100 compatible = "snps,dw-apb-uart"; 101 - reg = <0x11000 0x100>; 101 + reg = <0x12100 0x100>; 102 102 reg-shift = <2>; 103 103 interrupts = <GIC_SPI 84 IRQ_TYPE_LEVEL_HIGH>; 104 104 reg-io-width = <1>;
+6
arch/arm64/boot/dts/qcom/msm8992-lg-bullhead.dtsi
··· 3 3 * Copyright (c) 2015, LGE Inc. All rights reserved. 4 4 * Copyright (c) 2016, The Linux Foundation. All rights reserved. 5 5 * Copyright (c) 2021, Petr Vorel <petr.vorel@gmail.com> 6 + * Copyright (c) 2022, Dominik Kobinski <dominikkobinski314@gmail.com> 6 7 */ 7 8 8 9 /dts-v1/; ··· 50 49 51 50 cont_splash_mem: memory@3400000 { 52 51 reg = <0 0x03400000 0 0x1200000>; 52 + no-map; 53 + }; 54 + 55 + removed_region: reserved@5000000 { 56 + reg = <0 0x05000000 0 0x2200000>; 53 57 no-map; 54 58 }; 55 59 };
+60 -17
arch/arm64/boot/dts/qcom/msm8992-xiaomi-libra.dts
··· 11 11 #include <dt-bindings/gpio/gpio.h> 12 12 #include <dt-bindings/input/gpio-keys.h> 13 13 14 + /delete-node/ &adsp_mem; 15 + /delete-node/ &audio_mem; 16 + /delete-node/ &mpss_mem; 17 + /delete-node/ &peripheral_region; 18 + /delete-node/ &rmtfs_mem; 19 + 14 20 / { 15 21 model = "Xiaomi Mi 4C"; 16 22 compatible = "xiaomi,libra", "qcom,msm8992"; ··· 76 70 #size-cells = <2>; 77 71 ranges; 78 72 79 - /* This is for getting crash logs using Android downstream kernels */ 73 + memory_hole: hole@6400000 { 74 + reg = <0 0x06400000 0 0x600000>; 75 + no-map; 76 + }; 77 + 78 + memory_hole2: hole2@6c00000 { 79 + reg = <0 0x06c00000 0 0x2400000>; 80 + no-map; 81 + }; 82 + 83 + mpss_mem: mpss@9000000 { 84 + reg = <0 0x09000000 0 0x5a00000>; 85 + no-map; 86 + }; 87 + 88 + tzapp: tzapp@ea00000 { 89 + reg = <0 0x0ea00000 0 0x1900000>; 90 + no-map; 91 + }; 92 + 93 + mdm_rfsa_mem: mdm-rfsa@ca0b0000 { 94 + reg = <0 0xca0b0000 0 0x10000>; 95 + no-map; 96 + }; 97 + 98 + rmtfs_mem: rmtfs@ca100000 { 99 + compatible = "qcom,rmtfs-mem"; 100 + reg = <0 0xca100000 0 0x180000>; 101 + no-map; 102 + 103 + qcom,client-id = <1>; 104 + }; 105 + 106 + audio_mem: audio@cb400000 { 107 + reg = <0 0xcb000000 0 0x400000>; 108 + no-mem; 109 + }; 110 + 111 + qseecom_mem: qseecom@cb400000 { 112 + reg = <0 0xcb400000 0 0x1c00000>; 113 + no-mem; 114 + }; 115 + 116 + adsp_rfsa_mem: adsp-rfsa@cd000000 { 117 + reg = <0 0xcd000000 0 0x10000>; 118 + no-map; 119 + }; 120 + 121 + sensor_rfsa_mem: sensor-rfsa@cd010000 { 122 + reg = <0 0xcd010000 0 0x10000>; 123 + no-map; 124 + }; 125 + 80 126 ramoops@dfc00000 { 81 127 compatible = "ramoops"; 82 - reg = <0x0 0xdfc00000 0x0 0x40000>; 128 + reg = <0 0xdfc00000 0 0x40000>; 83 129 console-size = <0x10000>; 84 130 record-size = <0x10000>; 85 131 ftrace-size = <0x10000>; 86 132 pmsg-size = <0x20000>; 87 - }; 88 - 89 - modem_region: modem_region@9000000 { 90 - reg = <0x0 0x9000000 0x0 0x5a00000>; 91 - no-map; 92 - }; 93 - 94 - tzapp: modem_region@ea00000 { 95 - reg = <0x0 0xea00000 0x0 0x1900000>; 96 - no-map; 97 133 }; 98 134 }; 99 135 }; ··· 176 128 177 129 &blsp2_uart2 { 178 130 status = "okay"; 179 - }; 180 - 181 - &peripheral_region { 182 - reg = <0x0 0x7400000 0x0 0x1c00000>; 183 - no-map; 184 131 }; 185 132 186 133 &pm8994_spmi_regulators {
-4
arch/arm64/boot/dts/qcom/msm8992.dtsi
··· 37 37 compatible = "qcom,rpmcc-msm8992", "qcom,rpmcc"; 38 38 }; 39 39 40 - &tcsr_mutex { 41 - compatible = "qcom,sfpb-mutex"; 42 - }; 43 - 44 40 &timer { 45 41 interrupts = <GIC_PPI 2 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>, 46 42 <GIC_PPI 3 (GIC_CPU_MASK_SIMPLE(4) | IRQ_TYPE_LEVEL_LOW)>,
+16 -3
arch/arm64/boot/dts/qcom/msm8994-huawei-angler-rev-101.dts
··· 9 9 10 10 #include "msm8994.dtsi" 11 11 12 - /* Angler's firmware does not report where the memory is allocated */ 13 - /delete-node/ &cont_splash_mem; 14 - 15 12 / { 16 13 model = "Huawei Nexus 6P"; 17 14 compatible = "huawei,angler", "qcom,msm8994"; ··· 24 27 25 28 chosen { 26 29 stdout-path = "serial0:115200n8"; 30 + }; 31 + 32 + reserved-memory { 33 + #address-cells = <2>; 34 + #size-cells = <2>; 35 + ranges; 36 + 37 + tzapp_mem: tzapp@4800000 { 38 + reg = <0 0x04800000 0 0x1900000>; 39 + no-map; 40 + }; 41 + 42 + removed_region: reserved@6300000 { 43 + reg = <0 0x06300000 0 0xD00000>; 44 + no-map; 45 + }; 27 46 }; 28 47 }; 29 48
+26 -57
arch/arm64/boot/dts/qcom/sc8280xp.dtsi
··· 10 10 #include <dt-bindings/interconnect/qcom,sc8280xp.h> 11 11 #include <dt-bindings/interrupt-controller/arm-gic.h> 12 12 #include <dt-bindings/mailbox/qcom-ipcc.h> 13 + #include <dt-bindings/phy/phy-qcom-qmp.h> 13 14 #include <dt-bindings/power/qcom-rpmpd.h> 14 15 #include <dt-bindings/soc/qcom,rpmh-rsc.h> 15 16 #include <dt-bindings/thermal/thermal.h> ··· 763 762 <0>, 764 763 <0>, 765 764 <0>, 766 - <&usb_0_ssphy>, 765 + <&usb_0_qmpphy QMP_USB43DP_USB3_PIPE_CLK>, 767 766 <0>, 768 767 <0>, 769 768 <0>, ··· 771 770 <0>, 772 771 <0>, 773 772 <0>, 774 - <&usb_1_ssphy>, 773 + <&usb_1_qmpphy QMP_USB43DP_USB3_PIPE_CLK>, 775 774 <0>, 776 775 <0>, 777 776 <0>, ··· 1674 1673 }; 1675 1674 }; 1676 1675 1677 - usb_0_qmpphy: phy-wrapper@88ec000 { 1676 + usb_0_qmpphy: phy@88eb000 { 1678 1677 compatible = "qcom,sc8280xp-qmp-usb43dp-phy"; 1679 - reg = <0 0x088ec000 0 0x1e4>, 1680 - <0 0x088eb000 0 0x40>, 1681 - <0 0x088ed000 0 0x1c8>; 1682 - #address-cells = <2>; 1683 - #size-cells = <2>; 1684 - ranges; 1678 + reg = <0 0x088eb000 0 0x4000>; 1685 1679 1686 1680 clocks = <&gcc GCC_USB3_PRIM_PHY_AUX_CLK>, 1687 - <&rpmhcc RPMH_CXO_CLK>, 1688 1681 <&gcc GCC_USB4_EUD_CLKREF_CLK>, 1689 - <&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>; 1690 - clock-names = "aux", "ref_clk_src", "ref", "com_aux"; 1691 - 1692 - resets = <&gcc GCC_USB3_PHY_PRIM_BCR>, 1693 - <&gcc GCC_USB3_DP_PHY_PRIM_BCR>; 1694 - reset-names = "phy", "common"; 1682 + <&gcc GCC_USB3_PRIM_PHY_COM_AUX_CLK>, 1683 + <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>; 1684 + clock-names = "aux", "ref", "com_aux", "usb3_pipe"; 1695 1685 1696 1686 power-domains = <&gcc USB30_PRIM_GDSC>; 1697 1687 1698 - status = "disabled"; 1688 + resets = <&gcc GCC_USB3_PHY_PRIM_BCR>, 1689 + <&gcc GCC_USB4_DP_PHY_PRIM_BCR>; 1690 + reset-names = "phy", "common"; 1699 1691 1700 - usb_0_ssphy: usb3-phy@88eb400 { 1701 - reg = <0 0x088eb400 0 0x100>, 1702 - <0 0x088eb600 0 0x3ec>, 1703 - <0 0x088ec400 0 0x364>, 1704 - <0 0x088eba00 0 0x100>, 1705 - <0 0x088ebc00 0 0x3ec>, 1706 - <0 0x088ec200 0 0x18>; 1707 - #phy-cells = <0>; 1708 - #clock-cells = <0>; 1709 - clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>; 1710 - clock-names = "pipe0"; 1711 - clock-output-names = "usb0_phy_pipe_clk_src"; 1712 - }; 1692 + #clock-cells = <1>; 1693 + #phy-cells = <1>; 1694 + 1695 + status = "disabled"; 1713 1696 }; 1714 1697 1715 1698 usb_1_hsphy: phy@8902000 { ··· 1710 1725 status = "disabled"; 1711 1726 }; 1712 1727 1713 - usb_1_qmpphy: phy-wrapper@8904000 { 1728 + usb_1_qmpphy: phy@8903000 { 1714 1729 compatible = "qcom,sc8280xp-qmp-usb43dp-phy"; 1715 - reg = <0 0x08904000 0 0x1e4>, 1716 - <0 0x08903000 0 0x40>, 1717 - <0 0x08905000 0 0x1c8>; 1718 - #address-cells = <2>; 1719 - #size-cells = <2>; 1720 - ranges; 1730 + reg = <0 0x08903000 0 0x4000>; 1721 1731 1722 1732 clocks = <&gcc GCC_USB3_SEC_PHY_AUX_CLK>, 1723 - <&rpmhcc RPMH_CXO_CLK>, 1724 1733 <&gcc GCC_USB4_CLKREF_CLK>, 1725 - <&gcc GCC_USB3_SEC_PHY_COM_AUX_CLK>; 1726 - clock-names = "aux", "ref_clk_src", "ref", "com_aux"; 1734 + <&gcc GCC_USB3_SEC_PHY_COM_AUX_CLK>, 1735 + <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>; 1736 + clock-names = "aux", "ref", "com_aux", "usb3_pipe"; 1737 + 1738 + power-domains = <&gcc USB30_SEC_GDSC>; 1727 1739 1728 1740 resets = <&gcc GCC_USB3_PHY_SEC_BCR>, 1729 1741 <&gcc GCC_USB4_1_DP_PHY_PRIM_BCR>; 1730 1742 reset-names = "phy", "common"; 1731 1743 1732 - power-domains = <&gcc USB30_SEC_GDSC>; 1744 + #clock-cells = <1>; 1745 + #phy-cells = <1>; 1733 1746 1734 1747 status = "disabled"; 1735 - 1736 - usb_1_ssphy: usb3-phy@8903400 { 1737 - reg = <0 0x08903400 0 0x100>, 1738 - <0 0x08903600 0 0x3ec>, 1739 - <0 0x08904400 0 0x364>, 1740 - <0 0x08903a00 0 0x100>, 1741 - <0 0x08903c00 0 0x3ec>, 1742 - <0 0x08904200 0 0x18>; 1743 - #phy-cells = <0>; 1744 - #clock-cells = <0>; 1745 - clocks = <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>; 1746 - clock-names = "pipe0"; 1747 - clock-output-names = "usb1_phy_pipe_clk_src"; 1748 - }; 1749 1748 }; 1750 1749 1751 1750 pmu@9091000 { ··· 1879 1910 reg = <0 0x0a600000 0 0xcd00>; 1880 1911 interrupts = <GIC_SPI 803 IRQ_TYPE_LEVEL_HIGH>; 1881 1912 iommus = <&apps_smmu 0x820 0x0>; 1882 - phys = <&usb_0_hsphy>, <&usb_0_ssphy>; 1913 + phys = <&usb_0_hsphy>, <&usb_0_qmpphy QMP_USB43DP_USB3_PHY>; 1883 1914 phy-names = "usb2-phy", "usb3-phy"; 1884 1915 }; 1885 1916 }; ··· 1933 1964 reg = <0 0x0a800000 0 0xcd00>; 1934 1965 interrupts = <GIC_SPI 810 IRQ_TYPE_LEVEL_HIGH>; 1935 1966 iommus = <&apps_smmu 0x860 0x0>; 1936 - phys = <&usb_1_hsphy>, <&usb_1_ssphy>; 1967 + phys = <&usb_1_hsphy>, <&usb_1_qmpphy QMP_USB43DP_USB3_PHY>; 1937 1968 phy-names = "usb2-phy", "usb3-phy"; 1938 1969 }; 1939 1970 };
-1
arch/arm64/boot/dts/qcom/sm8250.dtsi
··· 334 334 exit-latency-us = <6562>; 335 335 min-residency-us = <9987>; 336 336 local-timer-stop; 337 - status = "disabled"; 338 337 }; 339 338 }; 340 339 };
+2 -2
arch/arm64/boot/dts/qcom/sm8350.dtsi
··· 2382 2382 <&rpmhcc RPMH_CXO_CLK>; 2383 2383 clock-names = "iface", "core", "xo"; 2384 2384 resets = <&gcc GCC_SDCC2_BCR>; 2385 - interconnects = <&aggre2_noc MASTER_SDCC_2 0 &mc_virt SLAVE_EBI1 0>, 2386 - <&gem_noc MASTER_APPSS_PROC 0 &config_noc SLAVE_SDCC_2 0>; 2385 + interconnects = <&aggre2_noc MASTER_SDCC_2 &mc_virt SLAVE_EBI1>, 2386 + <&gem_noc MASTER_APPSS_PROC &config_noc SLAVE_SDCC_2>; 2387 2387 interconnect-names = "sdhc-ddr","cpu-sdhc"; 2388 2388 iommus = <&apps_smmu 0x4a0 0x0>; 2389 2389 power-domains = <&rpmhpd SM8350_CX>;
+9
arch/arm64/include/asm/efi.h
··· 48 48 }) 49 49 50 50 extern spinlock_t efi_rt_lock; 51 + extern u64 *efi_rt_stack_top; 51 52 efi_status_t __efi_rt_asm_wrapper(void *, const char *, ...); 53 + 54 + /* 55 + * efi_rt_stack_top[-1] contains the value the stack pointer had before 56 + * switching to the EFI runtime stack. 57 + */ 58 + #define current_in_efi() \ 59 + (!preemptible() && efi_rt_stack_top != NULL && \ 60 + on_task_stack(current, READ_ONCE(efi_rt_stack_top[-1]), 1)) 52 61 53 62 #define ARCH_EFI_IRQ_FLAGS_MASK (PSR_D_BIT | PSR_A_BIT | PSR_I_BIT | PSR_F_BIT) 54 63
+15
arch/arm64/include/asm/stacktrace.h
··· 106 106 #define stackinfo_get_sdei_critical() stackinfo_get_unknown() 107 107 #endif 108 108 109 + #ifdef CONFIG_EFI 110 + extern u64 *efi_rt_stack_top; 111 + 112 + static inline struct stack_info stackinfo_get_efi(void) 113 + { 114 + unsigned long high = (u64)efi_rt_stack_top; 115 + unsigned long low = high - THREAD_SIZE; 116 + 117 + return (struct stack_info) { 118 + .low = low, 119 + .high = high, 120 + }; 121 + } 122 + #endif 123 + 109 124 #endif /* __ASM_STACKTRACE_H */
+6
arch/arm64/kernel/efi-rt-wrapper.S
··· 46 46 mov x4, x6 47 47 blr x8 48 48 49 + mov x16, sp 49 50 mov sp, x29 51 + str xzr, [x16, #8] // clear recorded task SP value 52 + 50 53 ldp x1, x2, [sp, #16] 51 54 cmp x2, x18 52 55 ldp x29, x30, [sp], #112 ··· 73 70 74 71 SYM_CODE_START(__efi_rt_asm_recover) 75 72 mov sp, x30 73 + 74 + ldr_l x16, efi_rt_stack_top // clear recorded task SP value 75 + str xzr, [x16, #-8] 76 76 77 77 ldp x19, x20, [sp, #32] 78 78 ldp x21, x22, [sp, #48]
+2 -1
arch/arm64/kernel/efi.c
··· 11 11 #include <linux/init.h> 12 12 13 13 #include <asm/efi.h> 14 + #include <asm/stacktrace.h> 14 15 15 16 static bool region_is_misaligned(const efi_memory_desc_t *md) 16 17 { ··· 155 154 bool efi_runtime_fixup_exception(struct pt_regs *regs, const char *msg) 156 155 { 157 156 /* Check whether the exception occurred while running the firmware */ 158 - if (current_work() != &efi_rts_work.work || regs->pc >= TASK_SIZE_64) 157 + if (!current_in_efi() || regs->pc >= TASK_SIZE_64) 159 158 return false; 160 159 161 160 pr_err(FW_BUG "Unable to handle %s in EFI runtime service\n", msg);
+12
arch/arm64/kernel/stacktrace.c
··· 5 5 * Copyright (C) 2012 ARM Ltd. 6 6 */ 7 7 #include <linux/kernel.h> 8 + #include <linux/efi.h> 8 9 #include <linux/export.h> 9 10 #include <linux/ftrace.h> 10 11 #include <linux/sched.h> ··· 13 12 #include <linux/sched/task_stack.h> 14 13 #include <linux/stacktrace.h> 15 14 15 + #include <asm/efi.h> 16 16 #include <asm/irq.h> 17 17 #include <asm/stack_pointer.h> 18 18 #include <asm/stacktrace.h> ··· 188 186 : stackinfo_get_unknown(); \ 189 187 }) 190 188 189 + #define STACKINFO_EFI \ 190 + ({ \ 191 + ((task == current) && current_in_efi()) \ 192 + ? stackinfo_get_efi() \ 193 + : stackinfo_get_unknown(); \ 194 + }) 195 + 191 196 noinline noinstr void arch_stack_walk(stack_trace_consume_fn consume_entry, 192 197 void *cookie, struct task_struct *task, 193 198 struct pt_regs *regs) ··· 208 199 #if defined(CONFIG_VMAP_STACK) && defined(CONFIG_ARM_SDE_INTERFACE) 209 200 STACKINFO_SDEI(normal), 210 201 STACKINFO_SDEI(critical), 202 + #endif 203 + #ifdef CONFIG_EFI 204 + STACKINFO_EFI, 211 205 #endif 212 206 }; 213 207 struct unwind_state state = {
+1 -1
arch/arm64/kvm/guest.c
··· 1079 1079 1080 1080 /* uaccess failed, don't leave stale tags */ 1081 1081 if (num_tags != MTE_GRANULES_PER_PAGE) 1082 - mte_clear_page_tags(page); 1082 + mte_clear_page_tags(maddr); 1083 1083 set_page_mte_tagged(page); 1084 1084 1085 1085 kvm_release_pfn_dirty(pfn);
+11 -14
arch/arm64/kvm/vgic/vgic-v3.c
··· 350 350 * The deactivation of the doorbell interrupt will trigger the 351 351 * unmapping of the associated vPE. 352 352 */ 353 - static void unmap_all_vpes(struct vgic_dist *dist) 353 + static void unmap_all_vpes(struct kvm *kvm) 354 354 { 355 - struct irq_desc *desc; 355 + struct vgic_dist *dist = &kvm->arch.vgic; 356 356 int i; 357 357 358 - for (i = 0; i < dist->its_vm.nr_vpes; i++) { 359 - desc = irq_to_desc(dist->its_vm.vpes[i]->irq); 360 - irq_domain_deactivate_irq(irq_desc_get_irq_data(desc)); 361 - } 358 + for (i = 0; i < dist->its_vm.nr_vpes; i++) 359 + free_irq(dist->its_vm.vpes[i]->irq, kvm_get_vcpu(kvm, i)); 362 360 } 363 361 364 - static void map_all_vpes(struct vgic_dist *dist) 362 + static void map_all_vpes(struct kvm *kvm) 365 363 { 366 - struct irq_desc *desc; 364 + struct vgic_dist *dist = &kvm->arch.vgic; 367 365 int i; 368 366 369 - for (i = 0; i < dist->its_vm.nr_vpes; i++) { 370 - desc = irq_to_desc(dist->its_vm.vpes[i]->irq); 371 - irq_domain_activate_irq(irq_desc_get_irq_data(desc), false); 372 - } 367 + for (i = 0; i < dist->its_vm.nr_vpes; i++) 368 + WARN_ON(vgic_v4_request_vpe_irq(kvm_get_vcpu(kvm, i), 369 + dist->its_vm.vpes[i]->irq)); 373 370 } 374 371 375 372 /** ··· 391 394 * and enabling of the doorbells have already been done. 392 395 */ 393 396 if (kvm_vgic_global_state.has_gicv4_1) { 394 - unmap_all_vpes(dist); 397 + unmap_all_vpes(kvm); 395 398 vlpi_avail = true; 396 399 } 397 400 ··· 441 444 442 445 out: 443 446 if (vlpi_avail) 444 - map_all_vpes(dist); 447 + map_all_vpes(kvm); 445 448 446 449 return ret; 447 450 }
+6 -2
arch/arm64/kvm/vgic/vgic-v4.c
··· 222 222 *val = !!(*ptr & mask); 223 223 } 224 224 225 + int vgic_v4_request_vpe_irq(struct kvm_vcpu *vcpu, int irq) 226 + { 227 + return request_irq(irq, vgic_v4_doorbell_handler, 0, "vcpu", vcpu); 228 + } 229 + 225 230 /** 226 231 * vgic_v4_init - Initialize the GICv4 data structures 227 232 * @kvm: Pointer to the VM being initialized ··· 288 283 irq_flags &= ~IRQ_NOAUTOEN; 289 284 irq_set_status_flags(irq, irq_flags); 290 285 291 - ret = request_irq(irq, vgic_v4_doorbell_handler, 292 - 0, "vcpu", vcpu); 286 + ret = vgic_v4_request_vpe_irq(vcpu, irq); 293 287 if (ret) { 294 288 kvm_err("failed to allocate vcpu IRQ%d\n", irq); 295 289 /*
+1
arch/arm64/kvm/vgic/vgic.h
··· 331 331 void vgic_v4_teardown(struct kvm *kvm); 332 332 void vgic_v4_configure_vsgis(struct kvm *kvm); 333 333 void vgic_v4_get_vlpi_state(struct vgic_irq *irq, bool *val); 334 + int vgic_v4_request_vpe_irq(struct kvm_vcpu *vcpu, int irq); 334 335 335 336 #endif
+1 -1
arch/riscv/boot/dts/sifive/fu740-c000.dtsi
··· 328 328 bus-range = <0x0 0xff>; 329 329 ranges = <0x81000000 0x0 0x60080000 0x0 0x60080000 0x0 0x10000>, /* I/O */ 330 330 <0x82000000 0x0 0x60090000 0x0 0x60090000 0x0 0xff70000>, /* mem */ 331 - <0x82000000 0x0 0x70000000 0x0 0x70000000 0x0 0x1000000>, /* mem */ 331 + <0x82000000 0x0 0x70000000 0x0 0x70000000 0x0 0x10000000>, /* mem */ 332 332 <0xc3000000 0x20 0x00000000 0x20 0x00000000 0x20 0x00000000>; /* mem prefetchable */ 333 333 num-lanes = <0x8>; 334 334 interrupts = <56>, <57>, <58>, <59>, <60>, <61>, <62>, <63>, <64>;
+1
arch/x86/events/intel/core.c
··· 6339 6339 break; 6340 6340 6341 6341 case INTEL_FAM6_SAPPHIRERAPIDS_X: 6342 + case INTEL_FAM6_EMERALDRAPIDS_X: 6342 6343 pmem = true; 6343 6344 x86_pmu.late_ack = true; 6344 6345 memcpy(hw_cache_event_ids, spr_hw_cache_event_ids, sizeof(hw_cache_event_ids));
+1
arch/x86/events/intel/cstate.c
··· 677 677 X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_X, &icx_cstates), 678 678 X86_MATCH_INTEL_FAM6_MODEL(ICELAKE_D, &icx_cstates), 679 679 X86_MATCH_INTEL_FAM6_MODEL(SAPPHIRERAPIDS_X, &icx_cstates), 680 + X86_MATCH_INTEL_FAM6_MODEL(EMERALDRAPIDS_X, &icx_cstates), 680 681 681 682 X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE_L, &icl_cstates), 682 683 X86_MATCH_INTEL_FAM6_MODEL(TIGERLAKE, &icl_cstates),
+9
arch/x86/kernel/cpu/aperfmperf.c
··· 330 330 331 331 static void disable_freq_invariance_workfn(struct work_struct *work) 332 332 { 333 + int cpu; 334 + 333 335 static_branch_disable(&arch_scale_freq_key); 336 + 337 + /* 338 + * Set arch_freq_scale to a default value on all cpus 339 + * This negates the effect of scaling 340 + */ 341 + for_each_possible_cpu(cpu) 342 + per_cpu(arch_freq_scale, cpu) = SCHED_CAPACITY_SCALE; 334 343 } 335 344 336 345 static DECLARE_WORK(disable_freq_invariance_work,
+9 -12
arch/x86/kvm/vmx/vmx.c
··· 3440 3440 { 3441 3441 u32 ar; 3442 3442 3443 - if (var->unusable || !var->present) 3444 - ar = 1 << 16; 3445 - else { 3446 - ar = var->type & 15; 3447 - ar |= (var->s & 1) << 4; 3448 - ar |= (var->dpl & 3) << 5; 3449 - ar |= (var->present & 1) << 7; 3450 - ar |= (var->avl & 1) << 12; 3451 - ar |= (var->l & 1) << 13; 3452 - ar |= (var->db & 1) << 14; 3453 - ar |= (var->g & 1) << 15; 3454 - } 3443 + ar = var->type & 15; 3444 + ar |= (var->s & 1) << 4; 3445 + ar |= (var->dpl & 3) << 5; 3446 + ar |= (var->present & 1) << 7; 3447 + ar |= (var->avl & 1) << 12; 3448 + ar |= (var->l & 1) << 13; 3449 + ar |= (var->db & 1) << 14; 3450 + ar |= (var->g & 1) << 15; 3451 + ar |= (var->unusable || !var->present) << 16; 3455 3452 3456 3453 return ar; 3457 3454 }
+3 -5
block/bfq-cgroup.c
··· 316 316 317 317 static void bfqg_get(struct bfq_group *bfqg) 318 318 { 319 - bfqg->ref++; 319 + refcount_inc(&bfqg->ref); 320 320 } 321 321 322 322 static void bfqg_put(struct bfq_group *bfqg) 323 323 { 324 - bfqg->ref--; 325 - 326 - if (bfqg->ref == 0) 324 + if (refcount_dec_and_test(&bfqg->ref)) 327 325 kfree(bfqg); 328 326 } 329 327 ··· 528 530 } 529 531 530 532 /* see comments in bfq_bic_update_cgroup for why refcounting */ 531 - bfqg_get(bfqg); 533 + refcount_set(&bfqg->ref, 1); 532 534 return &bfqg->pd; 533 535 } 534 536
+1 -1
block/bfq-iosched.h
··· 928 928 char blkg_path[128]; 929 929 930 930 /* reference counter (see comments in bfq_bic_update_cgroup) */ 931 - int ref; 931 + refcount_t ref; 932 932 /* Is bfq_group still online? */ 933 933 bool online; 934 934
+4
block/blk-cgroup.c
··· 1455 1455 list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) 1456 1456 pol->pd_init_fn(blkg->pd[pol->plid]); 1457 1457 1458 + if (pol->pd_online_fn) 1459 + list_for_each_entry_reverse(blkg, &q->blkg_list, q_node) 1460 + pol->pd_online_fn(blkg->pd[pol->plid]); 1461 + 1458 1462 __set_bit(pol->plid, q->blkcg_pols); 1459 1463 ret = 0; 1460 1464
+5 -1
block/blk-mq.c
··· 2890 2890 struct blk_plug *plug, struct bio **bio, unsigned int nsegs) 2891 2891 { 2892 2892 struct request *rq; 2893 + enum hctx_type type, hctx_type; 2893 2894 2894 2895 if (!plug) 2895 2896 return NULL; ··· 2903 2902 return NULL; 2904 2903 } 2905 2904 2906 - if (blk_mq_get_hctx_type((*bio)->bi_opf) != rq->mq_hctx->type) 2905 + type = blk_mq_get_hctx_type((*bio)->bi_opf); 2906 + hctx_type = rq->mq_hctx->type; 2907 + if (type != hctx_type && 2908 + !(type == HCTX_TYPE_READ && hctx_type == HCTX_TYPE_DEFAULT)) 2907 2909 return NULL; 2908 2910 if (op_is_flush(rq->cmd_flags) != op_is_flush((*bio)->bi_opf)) 2909 2911 return NULL;
+3
drivers/accessibility/speakup/spk_ttyio.c
··· 354 354 { 355 355 struct tty_struct *tty = in_synth->dev; 356 356 357 + if (tty == NULL) 358 + return; 359 + 357 360 tty_lock(tty); 358 361 359 362 if (tty->ops->close)
+10
drivers/acpi/prmt.c
··· 236 236 efi_status_t status; 237 237 struct prm_context_buffer context; 238 238 239 + if (!efi_enabled(EFI_RUNTIME_SERVICES)) { 240 + pr_err_ratelimited("PRM: EFI runtime services no longer available\n"); 241 + return AE_NO_HANDLER; 242 + } 243 + 239 244 /* 240 245 * The returned acpi_status will always be AE_OK. Error values will be 241 246 * saved in the first byte of the PRM message buffer to be used by ASL. ··· 329 324 return; 330 325 331 326 pr_info("PRM: found %u modules\n", mc); 327 + 328 + if (!efi_enabled(EFI_RUNTIME_SERVICES)) { 329 + pr_err("PRM: EFI runtime services unavailable\n"); 330 + return; 331 + } 332 332 333 333 status = acpi_install_address_space_handler(ACPI_ROOT_OBJECT, 334 334 ACPI_ADR_SPACE_PLATFORM_RT,
+8
drivers/acpi/video_detect.c
··· 517 517 }, 518 518 { 519 519 .callback = video_detect_force_native, 520 + /* Acer Aspire 4810T */ 521 + .matches = { 522 + DMI_MATCH(DMI_SYS_VENDOR, "Acer"), 523 + DMI_MATCH(DMI_PRODUCT_NAME, "Aspire 4810T"), 524 + }, 525 + }, 526 + { 527 + .callback = video_detect_force_native, 520 528 /* Acer Aspire 5738z */ 521 529 .matches = { 522 530 DMI_MATCH(DMI_SYS_VENDOR, "Acer"),
+12 -6
drivers/base/property.c
··· 997 997 fwnode_graph_get_next_endpoint(const struct fwnode_handle *fwnode, 998 998 struct fwnode_handle *prev) 999 999 { 1000 + struct fwnode_handle *ep, *port_parent = NULL; 1000 1001 const struct fwnode_handle *parent; 1001 - struct fwnode_handle *ep; 1002 1002 1003 1003 /* 1004 1004 * If this function is in a loop and the previous iteration returned 1005 1005 * an endpoint from fwnode->secondary, then we need to use the secondary 1006 1006 * as parent rather than @fwnode. 1007 1007 */ 1008 - if (prev) 1009 - parent = fwnode_graph_get_port_parent(prev); 1010 - else 1008 + if (prev) { 1009 + port_parent = fwnode_graph_get_port_parent(prev); 1010 + parent = port_parent; 1011 + } else { 1011 1012 parent = fwnode; 1013 + } 1012 1014 if (IS_ERR_OR_NULL(parent)) 1013 1015 return NULL; 1014 1016 1015 1017 ep = fwnode_call_ptr_op(parent, graph_get_next_endpoint, prev); 1016 1018 if (ep) 1017 - return ep; 1019 + goto out_put_port_parent; 1018 1020 1019 - return fwnode_graph_get_next_endpoint(parent->secondary, NULL); 1021 + ep = fwnode_graph_get_next_endpoint(parent->secondary, NULL); 1022 + 1023 + out_put_port_parent: 1024 + fwnode_handle_put(port_parent); 1025 + return ep; 1020 1026 } 1021 1027 EXPORT_SYMBOL_GPL(fwnode_graph_get_next_endpoint); 1022 1028
+1 -1
drivers/base/test/test_async_driver_probe.c
··· 145 145 calltime = ktime_get(); 146 146 for_each_online_cpu(cpu) { 147 147 nid = cpu_to_node(cpu); 148 - pdev = &sync_dev[sync_id]; 148 + pdev = &async_dev[async_id]; 149 149 150 150 *pdev = test_platform_device_register_node("test_async_driver", 151 151 async_id,
+2
drivers/block/pktcdvd.c
··· 2400 2400 struct bio *split; 2401 2401 2402 2402 bio = bio_split_to_limits(bio); 2403 + if (!bio) 2404 + return; 2403 2405 2404 2406 pkt_dbg(2, pd, "start = %6llx stop = %6llx\n", 2405 2407 (unsigned long long)bio->bi_iter.bi_sector,
+1 -1
drivers/block/rnbd/rnbd-clt.c
··· 1440 1440 goto out_alloc; 1441 1441 } 1442 1442 1443 - ret = ida_alloc_max(&index_ida, 1 << (MINORBITS - RNBD_PART_BITS), 1443 + ret = ida_alloc_max(&index_ida, (1 << (MINORBITS - RNBD_PART_BITS)) - 1, 1444 1444 GFP_KERNEL); 1445 1445 if (ret < 0) { 1446 1446 pr_err("Failed to initialize device '%s' from session %s, allocating idr failed, err: %d\n",
+1 -1
drivers/comedi/drivers/adv_pci1760.c
··· 58 58 #define PCI1760_CMD_CLR_IMB2 0x00 /* Clears IMB2 */ 59 59 #define PCI1760_CMD_SET_DO 0x01 /* Set output state */ 60 60 #define PCI1760_CMD_GET_DO 0x02 /* Read output status */ 61 - #define PCI1760_CMD_GET_STATUS 0x03 /* Read current status */ 61 + #define PCI1760_CMD_GET_STATUS 0x07 /* Read current status */ 62 62 #define PCI1760_CMD_GET_FW_VER 0x0e /* Read firmware version */ 63 63 #define PCI1760_CMD_GET_HW_VER 0x0f /* Read hardware version */ 64 64 #define PCI1760_CMD_SET_PWM_HI(x) (0x10 + (x) * 2) /* Set "hi" period */
+4 -3
drivers/dma/dmaengine.c
··· 451 451 /* The channel is already in use, update client count */ 452 452 if (chan->client_count) { 453 453 __module_get(owner); 454 - goto out; 454 + chan->client_count++; 455 + return 0; 455 456 } 456 457 457 458 if (!try_module_get(owner)) ··· 471 470 goto err_out; 472 471 } 473 472 473 + chan->client_count++; 474 + 474 475 if (!dma_has_cap(DMA_PRIVATE, chan->device->cap_mask)) 475 476 balance_ref_count(chan); 476 477 477 - out: 478 - chan->client_count++; 479 478 return 0; 480 479 481 480 err_out:
+6
drivers/dma/dw-axi-dmac/dw-axi-dmac-platform.c
··· 1018 1018 1019 1019 /* The bad descriptor currently is in the head of vc list */ 1020 1020 vd = vchan_next_desc(&chan->vc); 1021 + if (!vd) { 1022 + dev_err(chan2dev(chan), "BUG: %s, IRQ with no descriptors\n", 1023 + axi_chan_name(chan)); 1024 + goto out; 1025 + } 1021 1026 /* Remove the completed descriptor from issued list */ 1022 1027 list_del(&vd->node); 1023 1028 ··· 1037 1032 /* Try to restart the controller */ 1038 1033 axi_chan_start_first_queued(chan); 1039 1034 1035 + out: 1040 1036 spin_unlock_irqrestore(&chan->vc.lock, flags); 1041 1037 } 1042 1038
+13 -3
drivers/dma/idxd/device.c
··· 1172 1172 spin_unlock(&ie->list_lock); 1173 1173 1174 1174 list_for_each_entry_safe(desc, itr, &flist, list) { 1175 + struct dma_async_tx_descriptor *tx; 1176 + 1175 1177 list_del(&desc->list); 1176 1178 ctype = desc->completion->status ? IDXD_COMPLETE_NORMAL : IDXD_COMPLETE_ABORT; 1179 + /* 1180 + * wq is being disabled. Any remaining descriptors are 1181 + * likely to be stuck and can be dropped. callback could 1182 + * point to code that is no longer accessible, for example 1183 + * if dmatest module has been unloaded. 1184 + */ 1185 + tx = &desc->txd; 1186 + tx->callback = NULL; 1187 + tx->callback_result = NULL; 1177 1188 idxd_dma_complete_txd(desc, ctype, true); 1178 1189 } 1179 1190 } ··· 1401 1390 err_irq: 1402 1391 idxd_wq_unmap_portal(wq); 1403 1392 err_map_portal: 1404 - rc = idxd_wq_disable(wq, false); 1405 - if (rc < 0) 1393 + if (idxd_wq_disable(wq, false)) 1406 1394 dev_dbg(dev, "wq %s disable failed\n", dev_name(wq_confdev(wq))); 1407 1395 err: 1408 1396 return rc; ··· 1418 1408 dev_warn(dev, "Clients has claim on wq %d: %d\n", 1419 1409 wq->id, idxd_wq_refcount(wq)); 1420 1410 1421 - idxd_wq_free_resources(wq); 1422 1411 idxd_wq_unmap_portal(wq); 1423 1412 idxd_wq_drain(wq); 1424 1413 idxd_wq_free_irq(wq); 1425 1414 idxd_wq_reset(wq); 1415 + idxd_wq_free_resources(wq); 1426 1416 percpu_ref_exit(&wq->wq_active); 1427 1417 wq->type = IDXD_WQT_NONE; 1428 1418 wq->client_count = 0;
+3 -1
drivers/dma/imx-sdma.c
··· 1521 1521 sdma_config_ownership(sdmac, false, true, false); 1522 1522 1523 1523 if (sdma_load_context(sdmac)) 1524 - goto err_desc_out; 1524 + goto err_bd_out; 1525 1525 1526 1526 return desc; 1527 1527 1528 + err_bd_out: 1529 + sdma_free_bd(desc); 1528 1530 err_desc_out: 1529 1531 kfree(desc); 1530 1532 err_out:
+5 -5
drivers/dma/lgm/lgm-dma.c
··· 914 914 } 915 915 } 916 916 917 - static int ldma_cfg_init(struct ldma_dev *d) 917 + static int ldma_parse_dt(struct ldma_dev *d) 918 918 { 919 919 struct fwnode_handle *fwnode = dev_fwnode(d->dev); 920 920 struct ldma_port *p; ··· 1661 1661 p->ldev = d; 1662 1662 } 1663 1663 1664 - ret = ldma_cfg_init(d); 1665 - if (ret) 1666 - return ret; 1667 - 1668 1664 dma_dev->dev = &pdev->dev; 1669 1665 1670 1666 ch_mask = (unsigned long)d->channels_mask; ··· 1670 1674 else 1671 1675 ldma_dma_init_v3X(j, d); 1672 1676 } 1677 + 1678 + ret = ldma_parse_dt(d); 1679 + if (ret) 1680 + return ret; 1673 1681 1674 1682 dma_dev->device_alloc_chan_resources = ldma_alloc_chan_resources; 1675 1683 dma_dev->device_free_chan_resources = ldma_free_chan_resources;
+4 -3
drivers/dma/ptdma/ptdma-dev.c
··· 71 71 bool soc = FIELD_GET(DWORD0_SOC, desc->dw0); 72 72 u8 *q_desc = (u8 *)&cmd_q->qbase[cmd_q->qidx]; 73 73 u32 tail; 74 + unsigned long flags; 74 75 75 76 if (soc) { 76 77 desc->dw0 |= FIELD_PREP(DWORD0_IOC, desc->dw0); 77 78 desc->dw0 &= ~DWORD0_SOC; 78 79 } 79 - mutex_lock(&cmd_q->q_mutex); 80 + spin_lock_irqsave(&cmd_q->q_lock, flags); 80 81 81 82 /* Copy 32-byte command descriptor to hw queue. */ 82 83 memcpy(q_desc, desc, 32); ··· 92 91 93 92 /* Turn the queue back on using our cached control register */ 94 93 pt_start_queue(cmd_q); 95 - mutex_unlock(&cmd_q->q_mutex); 94 + spin_unlock_irqrestore(&cmd_q->q_lock, flags); 96 95 97 96 return 0; 98 97 } ··· 200 199 201 200 cmd_q->pt = pt; 202 201 cmd_q->dma_pool = dma_pool; 203 - mutex_init(&cmd_q->q_mutex); 202 + spin_lock_init(&cmd_q->q_lock); 204 203 205 204 /* Page alignment satisfies our needs for N <= 128 */ 206 205 cmd_q->qsize = Q_SIZE(Q_DESC_SIZE);
+1 -1
drivers/dma/ptdma/ptdma.h
··· 196 196 struct ptdma_desc *qbase; 197 197 198 198 /* Aligned queue start address (per requirement) */ 199 - struct mutex q_mutex ____cacheline_aligned; 199 + spinlock_t q_lock ____cacheline_aligned; 200 200 unsigned int qidx; 201 201 202 202 unsigned int qsize;
+1
drivers/dma/qcom/gpi.c
··· 1756 1756 tre->dword[3] = u32_encode_bits(TRE_TYPE_GO, TRE_FLAGS_TYPE); 1757 1757 if (spi->cmd == SPI_RX) { 1758 1758 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_IEOB); 1759 + tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_LINK); 1759 1760 } else if (spi->cmd == SPI_TX) { 1760 1761 tre->dword[3] |= u32_encode_bits(1, TRE_FLAGS_CHAIN); 1761 1762 } else { /* SPI_DUPLEX */
+1
drivers/dma/tegra186-gpc-dma.c
··· 711 711 return err; 712 712 } 713 713 714 + vchan_terminate_vdesc(&tdc->dma_desc->vd); 714 715 tegra_dma_disable(tdc); 715 716 tdc->dma_desc = NULL; 716 717 }
+1 -1
drivers/dma/tegra210-adma.c
··· 221 221 int ret; 222 222 223 223 /* Clear any interrupts */ 224 - tdma_write(tdma, tdma->cdata->global_int_clear, 0x1); 224 + tdma_write(tdma, tdma->cdata->ch_base_offset + tdma->cdata->global_int_clear, 0x1); 225 225 226 226 /* Assert soft reset */ 227 227 tdma_write(tdma, ADMA_GLOBAL_SOFT_RESET, 0x1);
+3 -2
drivers/dma/ti/k3-udma.c
··· 762 762 if (uc->desc->dir == DMA_DEV_TO_MEM) { 763 763 udma_rchanrt_write(uc, UDMA_CHAN_RT_BCNT_REG, val); 764 764 udma_rchanrt_write(uc, UDMA_CHAN_RT_SBCNT_REG, val); 765 - udma_rchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val); 765 + if (uc->config.ep_type != PSIL_EP_NATIVE) 766 + udma_rchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val); 766 767 } else { 767 768 udma_tchanrt_write(uc, UDMA_CHAN_RT_BCNT_REG, val); 768 769 udma_tchanrt_write(uc, UDMA_CHAN_RT_SBCNT_REG, val); 769 - if (!uc->bchan) 770 + if (!uc->bchan && uc->config.ep_type != PSIL_EP_NATIVE) 770 771 udma_tchanrt_write(uc, UDMA_CHAN_RT_PEER_BCNT_REG, val); 771 772 } 772 773 }
+3 -1
drivers/dma/xilinx/xilinx_dma.c
··· 3143 3143 /* Initialize the channels */ 3144 3144 for_each_child_of_node(node, child) { 3145 3145 err = xilinx_dma_child_probe(xdev, child); 3146 - if (err < 0) 3146 + if (err < 0) { 3147 + of_node_put(child); 3147 3148 goto error; 3149 + } 3148 3150 } 3149 3151 3150 3152 if (xdev->dma_config->dmatype == XDMA_TYPE_VDMA) {
+7 -8
drivers/edac/edac_device.c
··· 34 34 static DEFINE_MUTEX(device_ctls_mutex); 35 35 static LIST_HEAD(edac_device_list); 36 36 37 + /* Default workqueue processing interval on this instance, in msecs */ 38 + #define DEFAULT_POLL_INTERVAL 1000 39 + 37 40 #ifdef CONFIG_EDAC_DEBUG 38 41 static void edac_device_dump_device(struct edac_device_ctl_info *edac_dev) 39 42 { ··· 339 336 * whole one second to save timers firing all over the period 340 337 * between integral seconds 341 338 */ 342 - if (edac_dev->poll_msec == 1000) 339 + if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) 343 340 edac_queue_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay)); 344 341 else 345 342 edac_queue_work(&edac_dev->work, edac_dev->delay); ··· 369 366 * timers firing on sub-second basis, while they are happy 370 367 * to fire together on the 1 second exactly 371 368 */ 372 - if (edac_dev->poll_msec == 1000) 369 + if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) 373 370 edac_queue_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay)); 374 371 else 375 372 edac_queue_work(&edac_dev->work, edac_dev->delay); ··· 403 400 edac_dev->delay = msecs_to_jiffies(msec); 404 401 405 402 /* See comment in edac_device_workq_setup() above */ 406 - if (edac_dev->poll_msec == 1000) 403 + if (edac_dev->poll_msec == DEFAULT_POLL_INTERVAL) 407 404 edac_mod_work(&edac_dev->work, round_jiffies_relative(edac_dev->delay)); 408 405 else 409 406 edac_mod_work(&edac_dev->work, edac_dev->delay); ··· 445 442 /* This instance is NOW RUNNING */ 446 443 edac_dev->op_state = OP_RUNNING_POLL; 447 444 448 - /* 449 - * enable workq processing on this instance, 450 - * default = 1000 msec 451 - */ 452 - edac_device_workq_setup(edac_dev, 1000); 445 + edac_device_workq_setup(edac_dev, edac_dev->poll_msec ?: DEFAULT_POLL_INTERVAL); 453 446 } else { 454 447 edac_dev->op_state = OP_RUNNING_INTERRUPT; 455 448 }
+2 -3
drivers/edac/qcom_edac.c
··· 252 252 static int 253 253 dump_syn_reg(struct edac_device_ctl_info *edev_ctl, int err_type, u32 bank) 254 254 { 255 - struct llcc_drv_data *drv = edev_ctl->pvt_info; 255 + struct llcc_drv_data *drv = edev_ctl->dev->platform_data; 256 256 int ret; 257 257 258 258 ret = dump_syn_reg_values(drv, bank, err_type); ··· 289 289 llcc_ecc_irq_handler(int irq, void *edev_ctl) 290 290 { 291 291 struct edac_device_ctl_info *edac_dev_ctl = edev_ctl; 292 - struct llcc_drv_data *drv = edac_dev_ctl->pvt_info; 292 + struct llcc_drv_data *drv = edac_dev_ctl->dev->platform_data; 293 293 irqreturn_t irq_rc = IRQ_NONE; 294 294 u32 drp_error, trp_error, i; 295 295 int ret; ··· 358 358 edev_ctl->dev_name = dev_name(dev); 359 359 edev_ctl->ctl_name = "llcc"; 360 360 edev_ctl->panic_on_ue = LLCC_ERP_PANIC_ON_UE; 361 - edev_ctl->pvt_info = llcc_driv_data; 362 361 363 362 rc = edac_device_add_device(edev_ctl); 364 363 if (rc)
+2
drivers/firmware/arm_scmi/driver.c
··· 910 910 xfer->hdr.protocol_id, xfer->hdr.seq, 911 911 xfer->hdr.poll_completion); 912 912 913 + /* Clear any stale status */ 914 + xfer->hdr.status = SCMI_SUCCESS; 913 915 xfer->state = SCMI_XFER_SENT_OK; 914 916 /* 915 917 * Even though spinlocking is not needed here since no race is possible
+6 -3
drivers/firmware/arm_scmi/shmem.c
··· 81 81 void shmem_fetch_response(struct scmi_shared_mem __iomem *shmem, 82 82 struct scmi_xfer *xfer) 83 83 { 84 + size_t len = ioread32(&shmem->length); 85 + 84 86 xfer->hdr.status = ioread32(shmem->msg_payload); 85 87 /* Skip the length of header and status in shmem area i.e 8 bytes */ 86 - xfer->rx.len = min_t(size_t, xfer->rx.len, 87 - ioread32(&shmem->length) - 8); 88 + xfer->rx.len = min_t(size_t, xfer->rx.len, len > 8 ? len - 8 : 0); 88 89 89 90 /* Take a copy to the rx buffer.. */ 90 91 memcpy_fromio(xfer->rx.buf, shmem->msg_payload + 4, xfer->rx.len); ··· 94 93 void shmem_fetch_notification(struct scmi_shared_mem __iomem *shmem, 95 94 size_t max_len, struct scmi_xfer *xfer) 96 95 { 96 + size_t len = ioread32(&shmem->length); 97 + 97 98 /* Skip only the length of header in shmem area i.e 4 bytes */ 98 - xfer->rx.len = min_t(size_t, max_len, ioread32(&shmem->length) - 4); 99 + xfer->rx.len = min_t(size_t, max_len, len > 4 ? len - 4 : 0); 99 100 100 101 /* Take a copy to the rx buffer.. */ 101 102 memcpy_fromio(xfer->rx.buf, shmem->msg_payload, xfer->rx.len);
+6 -1
drivers/firmware/arm_scmi/virtio.c
··· 160 160 } 161 161 162 162 vioch->shutdown_done = &vioch_shutdown_done; 163 - virtio_break_device(vioch->vqueue->vdev); 164 163 if (!vioch->is_rx && vioch->deferred_tx_wq) 165 164 /* Cannot be kicked anymore after this...*/ 166 165 vioch->deferred_tx_wq = NULL; ··· 481 482 struct scmi_chan_info *cinfo = p; 482 483 struct scmi_vio_channel *vioch = cinfo->transport_info; 483 484 485 + /* 486 + * Break device to inhibit further traffic flowing while shutting down 487 + * the channels: doing it later holding vioch->lock creates unsafe 488 + * locking dependency chains as reported by LOCKDEP. 489 + */ 490 + virtio_break_device(vioch->vqueue->vdev); 484 491 scmi_vio_channel_cleanup_sync(vioch); 485 492 486 493 scmi_free_channel(cinfo, data, id);
+4 -3
drivers/firmware/google/gsmi.c
··· 361 361 memcpy(data, gsmi_dev.data_buf->start, *data_size); 362 362 363 363 /* All variables are have the following attributes */ 364 - *attr = EFI_VARIABLE_NON_VOLATILE | 365 - EFI_VARIABLE_BOOTSERVICE_ACCESS | 366 - EFI_VARIABLE_RUNTIME_ACCESS; 364 + if (attr) 365 + *attr = EFI_VARIABLE_NON_VOLATILE | 366 + EFI_VARIABLE_BOOTSERVICE_ACCESS | 367 + EFI_VARIABLE_RUNTIME_ACCESS; 367 368 } 368 369 369 370 spin_unlock_irqrestore(&gsmi_dev.lock, flags);
+12 -1
drivers/gpio/gpio-mxc.c
··· 18 18 #include <linux/module.h> 19 19 #include <linux/platform_device.h> 20 20 #include <linux/slab.h> 21 + #include <linux/spinlock.h> 21 22 #include <linux/syscore_ops.h> 22 23 #include <linux/gpio/driver.h> 23 24 #include <linux/of.h> ··· 160 159 { 161 160 struct irq_chip_generic *gc = irq_data_get_irq_chip_data(d); 162 161 struct mxc_gpio_port *port = gc->private; 162 + unsigned long flags; 163 163 u32 bit, val; 164 164 u32 gpio_idx = d->hwirq; 165 165 int edge; ··· 199 197 return -EINVAL; 200 198 } 201 199 200 + raw_spin_lock_irqsave(&port->gc.bgpio_lock, flags); 201 + 202 202 if (GPIO_EDGE_SEL >= 0) { 203 203 val = readl(port->base + GPIO_EDGE_SEL); 204 204 if (edge == GPIO_INT_BOTH_EDGES) ··· 221 217 writel(1 << gpio_idx, port->base + GPIO_ISR); 222 218 port->pad_type[gpio_idx] = type; 223 219 224 - return 0; 220 + raw_spin_unlock_irqrestore(&port->gc.bgpio_lock, flags); 221 + 222 + return port->gc.direction_input(&port->gc, gpio_idx); 225 223 } 226 224 227 225 static void mxc_flip_edge(struct mxc_gpio_port *port, u32 gpio) 228 226 { 229 227 void __iomem *reg = port->base; 228 + unsigned long flags; 230 229 u32 bit, val; 231 230 int edge; 231 + 232 + raw_spin_lock_irqsave(&port->gc.bgpio_lock, flags); 232 233 233 234 reg += GPIO_ICR1 + ((gpio & 0x10) >> 2); /* lower or upper register */ 234 235 bit = gpio & 0xf; ··· 252 243 return; 253 244 } 254 245 writel(val | (edge << (bit << 1)), reg); 246 + 247 + raw_spin_unlock_irqrestore(&port->gc.bgpio_lock, flags); 255 248 } 256 249 257 250 /* handle 32 interrupts in one status register */
+15 -2
drivers/gpio/gpiolib-acpi.c
··· 385 385 } 386 386 387 387 static bool acpi_gpio_irq_is_wake(struct device *parent, 388 - struct acpi_resource_gpio *agpio) 388 + const struct acpi_resource_gpio *agpio) 389 389 { 390 390 unsigned int pin = agpio->pin_table[0]; 391 391 ··· 778 778 lookup->info.pin_config = agpio->pin_config; 779 779 lookup->info.debounce = agpio->debounce_timeout; 780 780 lookup->info.gpioint = gpioint; 781 - lookup->info.wake_capable = agpio->wake_capable == ACPI_WAKE_CAPABLE; 781 + lookup->info.wake_capable = acpi_gpio_irq_is_wake(&lookup->info.adev->dev, agpio); 782 782 783 783 /* 784 784 * Polarity and triggering are only specified for GpioInt ··· 1621 1621 }, 1622 1622 .driver_data = &(struct acpi_gpiolib_dmi_quirk) { 1623 1623 .ignore_interrupt = "AMDI0030:00@18", 1624 + }, 1625 + }, 1626 + { 1627 + /* 1628 + * Spurious wakeups from TP_ATTN# pin 1629 + * Found in BIOS 1.7.8 1630 + * https://gitlab.freedesktop.org/drm/amd/-/issues/1722#note_1720627 1631 + */ 1632 + .matches = { 1633 + DMI_MATCH(DMI_BOARD_NAME, "NL5xRU"), 1634 + }, 1635 + .driver_data = &(struct acpi_gpiolib_dmi_quirk) { 1636 + .ignore_wake = "ELAN0415:00@9", 1624 1637 }, 1625 1638 }, 1626 1639 {} /* Terminating entry */
+3
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
··· 156 156 return amdgpu_compute_multipipe == 1; 157 157 } 158 158 159 + if (adev->ip_versions[GC_HWIP][0] > IP_VERSION(9, 0, 0)) 160 + return true; 161 + 159 162 /* FIXME: spreading the queues across pipes causes perf regressions 160 163 * on POLARIS11 compute workloads */ 161 164 if (adev->asic_type == CHIP_POLARIS11)
+1
drivers/gpu/drm/amd/amdgpu/amdgpu_ids.c
··· 497 497 !--id_mgr->reserved_use_count) { 498 498 /* give the reserved ID back to normal round robin */ 499 499 list_add(&id_mgr->reserved->list, &id_mgr->ids_lru); 500 + id_mgr->reserved = NULL; 500 501 } 501 502 vm->reserved_vmid[vmhub] = false; 502 503 mutex_unlock(&id_mgr->lock);
+8 -2
drivers/gpu/drm/amd/amdgpu/amdgpu_job.c
··· 161 161 struct dma_fence *f; 162 162 unsigned i; 163 163 164 - /* use sched fence if available */ 165 - f = job->base.s_fence ? &job->base.s_fence->finished : &job->hw_fence; 164 + /* Check if any fences where initialized */ 165 + if (job->base.s_fence && job->base.s_fence->finished.ops) 166 + f = &job->base.s_fence->finished; 167 + else if (job->hw_fence.ops) 168 + f = &job->hw_fence; 169 + else 170 + f = NULL; 171 + 166 172 for (i = 0; i < job->num_ibs; ++i) 167 173 amdgpu_ib_free(ring->adev, &job->ibs[i], f); 168 174 }
+9 -2
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c
··· 1287 1287 1288 1288 switch (adev->ip_versions[GC_HWIP][0]) { 1289 1289 case IP_VERSION(11, 0, 0): 1290 - case IP_VERSION(11, 0, 1): 1291 1290 case IP_VERSION(11, 0, 2): 1292 1291 case IP_VERSION(11, 0, 3): 1293 - case IP_VERSION(11, 0, 4): 1294 1292 adev->gfx.me.num_me = 1; 1295 1293 adev->gfx.me.num_pipe_per_me = 1; 1296 1294 adev->gfx.me.num_queue_per_pipe = 1; 1297 1295 adev->gfx.mec.num_mec = 2; 1296 + adev->gfx.mec.num_pipe_per_mec = 4; 1297 + adev->gfx.mec.num_queue_per_pipe = 4; 1298 + break; 1299 + case IP_VERSION(11, 0, 1): 1300 + case IP_VERSION(11, 0, 4): 1301 + adev->gfx.me.num_me = 1; 1302 + adev->gfx.me.num_pipe_per_me = 1; 1303 + adev->gfx.me.num_queue_per_pipe = 1; 1304 + adev->gfx.mec.num_mec = 1; 1298 1305 adev->gfx.mec.num_pipe_per_mec = 4; 1299 1306 adev->gfx.mec.num_queue_per_pipe = 4; 1300 1307 break;
+4 -10
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 1503 1503 case IP_VERSION(3, 0, 1): 1504 1504 case IP_VERSION(3, 1, 2): 1505 1505 case IP_VERSION(3, 1, 3): 1506 - case IP_VERSION(3, 1, 4): 1507 - case IP_VERSION(3, 1, 5): 1508 1506 case IP_VERSION(3, 1, 6): 1509 1507 init_data.flags.gpu_vm_support = true; 1510 1508 break; ··· 1726 1728 if (adev->dm.vblank_control_workqueue) { 1727 1729 destroy_workqueue(adev->dm.vblank_control_workqueue); 1728 1730 adev->dm.vblank_control_workqueue = NULL; 1729 - } 1730 - 1731 - for (i = 0; i < adev->dm.display_indexes_num; i++) { 1732 - drm_encoder_cleanup(&adev->dm.mst_encoders[i].base); 1733 1731 } 1734 1732 1735 1733 amdgpu_dm_destroy_drm_device(&adev->dm); ··· 5305 5311 5306 5312 timing_out->aspect_ratio = get_aspect_ratio(mode_in); 5307 5313 5308 - stream->output_color_space = get_output_color_space(timing_out); 5309 - 5310 5314 stream->out_transfer_func->type = TF_TYPE_PREDEFINED; 5311 5315 stream->out_transfer_func->tf = TRANSFER_FUNCTION_SRGB; 5312 5316 if (stream->signal == SIGNAL_TYPE_HDMI_TYPE_A) { ··· 5315 5323 adjust_colour_depth_from_display_info(timing_out, info); 5316 5324 } 5317 5325 } 5326 + 5327 + stream->output_color_space = get_output_color_space(timing_out); 5318 5328 } 5319 5329 5320 5330 static void fill_audio_info(struct audio_info *audio_info, ··· 9524 9530 goto fail; 9525 9531 } 9526 9532 9527 - if (dm_old_con_state->abm_level != 9528 - dm_new_con_state->abm_level) 9533 + if (dm_old_con_state->abm_level != dm_new_con_state->abm_level || 9534 + dm_old_con_state->scaling != dm_new_con_state->scaling) 9529 9535 new_crtc_state->connectors_changed = true; 9530 9536 } 9531 9537
-1
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c
··· 468 468 static void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder) 469 469 { 470 470 drm_encoder_cleanup(encoder); 471 - kfree(encoder); 472 471 } 473 472 474 473 static const struct drm_encoder_funcs amdgpu_dm_encoder_funcs = {
+2 -2
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c
··· 90 90 { 0xE00, 0xF349, 0xFEB7, 0x1000, 0x6CE, 0x16E3, 91 91 0x24F, 0x200, 0xFCCB, 0xF535, 0xE00, 0x1000} }, 92 92 { COLOR_SPACE_YCBCR2020_TYPE, 93 - { 0x1000, 0xF149, 0xFEB7, 0x0000, 0x0868, 0x15B2, 94 - 0x01E6, 0x0000, 0xFB88, 0xF478, 0x1000, 0x0000} }, 93 + { 0x1000, 0xF149, 0xFEB7, 0x1004, 0x0868, 0x15B2, 94 + 0x01E6, 0x201, 0xFB88, 0xF478, 0x1000, 0x1004} }, 95 95 { COLOR_SPACE_YCBCR709_BLACK_TYPE, 96 96 { 0x0000, 0x0000, 0x0000, 0x1000, 0x0000, 0x0000, 97 97 0x0000, 0x0200, 0x0000, 0x0000, 0x0000, 0x1000} },
+6 -1
drivers/gpu/drm/amd/pm/swsmu/smu12/renoir_ppt.c
··· 1171 1171 int ret = 0; 1172 1172 uint32_t apu_percent = 0; 1173 1173 uint32_t dgpu_percent = 0; 1174 + struct amdgpu_device *adev = smu->adev; 1174 1175 1175 1176 1176 1177 ret = smu_cmn_get_metrics_table(smu, ··· 1197 1196 *value = metrics->AverageUvdActivity / 100; 1198 1197 break; 1199 1198 case METRICS_AVERAGE_SOCKETPOWER: 1200 - *value = (metrics->CurrentSocketPower << 8) / 1000; 1199 + if (((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 1)) && (adev->pm.fw_version >= 0x40000f)) || 1200 + ((adev->ip_versions[MP1_HWIP][0] == IP_VERSION(12, 0, 0)) && (adev->pm.fw_version >= 0x373200))) 1201 + *value = metrics->CurrentSocketPower << 8; 1202 + else 1203 + *value = (metrics->CurrentSocketPower << 8) / 1000; 1201 1204 break; 1202 1205 case METRICS_TEMPERATURE_EDGE: 1203 1206 *value = (metrics->GfxTemperature / 100) *
+7
drivers/gpu/drm/drm_fb_helper.c
··· 30 30 #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt 31 31 32 32 #include <linux/console.h> 33 + #include <linux/pci.h> 33 34 #include <linux/sysrq.h> 35 + #include <linux/vga_switcheroo.h> 34 36 35 37 #include <drm/drm_atomic.h> 36 38 #include <drm/drm_drv.h> ··· 1911 1909 return ret; 1912 1910 1913 1911 strcpy(fb_helper->fb->comm, "[fbcon]"); 1912 + 1913 + /* Set the fb info for vgaswitcheroo clients. Does nothing otherwise. */ 1914 + if (dev_is_pci(dev->dev)) 1915 + vga_switcheroo_client_fb_set(to_pci_dev(dev->dev), fb_helper->info); 1916 + 1914 1917 return 0; 1915 1918 } 1916 1919
+1 -1
drivers/gpu/drm/i915/display/skl_universal_plane.c
··· 1627 1627 u32 offset; 1628 1628 int ret; 1629 1629 1630 - if (w > max_width || w < min_width || h > max_height) { 1630 + if (w > max_width || w < min_width || h > max_height || h < 1) { 1631 1631 drm_dbg_kms(&dev_priv->drm, 1632 1632 "requested Y/RGB source size %dx%d outside limits (min: %dx1 max: %dx%d)\n", 1633 1633 w, h, min_width, max_width, max_height);
+4 -4
drivers/gpu/drm/i915/gem/selftests/huge_pages.c
··· 1847 1847 I915_SHRINK_ACTIVE); 1848 1848 i915_vma_unpin(vma); 1849 1849 if (err) 1850 - goto out_put; 1850 + goto out_wf; 1851 1851 1852 1852 /* 1853 1853 * Now that the pages are *unpinned* shrinking should invoke ··· 1863 1863 pr_err("unexpected pages mismatch, should_swap=%s\n", 1864 1864 str_yes_no(should_swap)); 1865 1865 err = -EINVAL; 1866 - goto out_put; 1866 + goto out_wf; 1867 1867 } 1868 1868 1869 1869 if (should_swap == (obj->mm.page_sizes.sg || obj->mm.page_sizes.phys)) { 1870 1870 pr_err("unexpected residual page-size bits, should_swap=%s\n", 1871 1871 str_yes_no(should_swap)); 1872 1872 err = -EINVAL; 1873 - goto out_put; 1873 + goto out_wf; 1874 1874 } 1875 1875 1876 1876 err = i915_vma_pin(vma, 0, 0, flags); 1877 1877 if (err) 1878 - goto out_put; 1878 + goto out_wf; 1879 1879 1880 1880 while (n--) { 1881 1881 err = cpu_check(obj, n, 0xdeadbeaf);
+7 -3
drivers/gpu/drm/i915/gt/intel_gt_regs.h
··· 429 429 #define RC_OP_FLUSH_ENABLE (1 << 0) 430 430 #define HIZ_RAW_STALL_OPT_DISABLE (1 << 2) 431 431 #define CACHE_MODE_1 _MMIO(0x7004) /* IVB+ */ 432 - #define PIXEL_SUBSPAN_COLLECT_OPT_DISABLE (1 << 6) 433 - #define GEN8_4x4_STC_OPTIMIZATION_DISABLE (1 << 6) 434 - #define GEN9_PARTIAL_RESOLVE_IN_VC_DISABLE (1 << 1) 432 + #define MSAA_OPTIMIZATION_REDUC_DISABLE REG_BIT(11) 433 + #define PIXEL_SUBSPAN_COLLECT_OPT_DISABLE REG_BIT(6) 434 + #define GEN8_4x4_STC_OPTIMIZATION_DISABLE REG_BIT(6) 435 + #define GEN9_PARTIAL_RESOLVE_IN_VC_DISABLE REG_BIT(1) 435 436 436 437 #define GEN7_GT_MODE _MMIO(0x7008) 437 438 #define GEN9_IZ_HASHING_MASK(slice) (0x3 << ((slice) * 2)) ··· 457 456 458 457 #define GEN8_L3CNTLREG _MMIO(0x7034) 459 458 #define GEN8_ERRDETBCTRL (1 << 9) 459 + 460 + #define PSS_MODE2 _MMIO(0x703c) 461 + #define SCOREBOARD_STALL_FLUSH_CONTROL REG_BIT(5) 460 462 461 463 #define GEN7_SC_INSTDONE _MMIO(0x7100) 462 464 #define GEN12_SC_INSTDONE_EXTRA _MMIO(0x7104)
+9 -1
drivers/gpu/drm/i915/gt/intel_workarounds.c
··· 771 771 772 772 /* Wa_14014947963:dg2 */ 773 773 if (IS_DG2_GRAPHICS_STEP(engine->i915, G10, STEP_B0, STEP_FOREVER) || 774 - IS_DG2_G11(engine->i915) || IS_DG2_G12(engine->i915)) 774 + IS_DG2_G11(engine->i915) || IS_DG2_G12(engine->i915)) 775 775 wa_masked_field_set(wal, VF_PREEMPTION, PREEMPTION_VERTEX_COUNT, 0x4000); 776 + 777 + /* Wa_18018764978:dg2 */ 778 + if (IS_DG2_GRAPHICS_STEP(engine->i915, G10, STEP_C0, STEP_FOREVER) || 779 + IS_DG2_G11(engine->i915) || IS_DG2_G12(engine->i915)) 780 + wa_masked_en(wal, PSS_MODE2, SCOREBOARD_STALL_FLUSH_CONTROL); 776 781 777 782 /* Wa_15010599737:dg2 */ 778 783 wa_mcr_masked_en(wal, CHICKEN_RASTER_1, DIS_SF_ROUND_NEAREST_EVEN); 784 + 785 + /* Wa_18019271663:dg2 */ 786 + wa_masked_en(wal, CACHE_MODE_1, MSAA_OPTIMIZATION_REDUC_DISABLE); 779 787 } 780 788 781 789 static void fakewa_disable_nestedbb_mode(struct intel_engine_cs *engine,
+1 -4
drivers/gpu/drm/i915/i915_driver.c
··· 1069 1069 */ 1070 1070 static void i915_driver_lastclose(struct drm_device *dev) 1071 1071 { 1072 - struct drm_i915_private *i915 = to_i915(dev); 1073 - 1074 1072 intel_fbdev_restore_mode(dev); 1075 1073 1076 - if (HAS_DISPLAY(i915)) 1077 - vga_switcheroo_process_delayed_switch(); 1074 + vga_switcheroo_process_delayed_switch(); 1078 1075 } 1079 1076 1080 1077 static void i915_driver_postclose(struct drm_device *dev, struct drm_file *file)
+2 -1
drivers/gpu/drm/i915/i915_pci.c
··· 423 423 .has_coherent_ggtt = true, \ 424 424 .has_llc = 1, \ 425 425 .has_rc6 = 1, \ 426 - .has_rc6p = 1, \ 426 + /* snb does support rc6p, but enabling it causes various issues */ \ 427 + .has_rc6p = 0, \ 427 428 .has_rps = true, \ 428 429 .dma_mask_size = 40, \ 429 430 .__runtime.ppgtt_type = INTEL_PPGTT_ALIASING, \
+5 -1
drivers/gpu/drm/i915/i915_switcheroo.c
··· 19 19 dev_err(&pdev->dev, "DRM not initialized, aborting switch.\n"); 20 20 return; 21 21 } 22 + if (!HAS_DISPLAY(i915)) { 23 + dev_err(&pdev->dev, "Device state not initialized, aborting switch.\n"); 24 + return; 25 + } 22 26 23 27 if (state == VGA_SWITCHEROO_ON) { 24 28 drm_info(&i915->drm, "switched on\n"); ··· 48 44 * locking inversion with the driver load path. And the access here is 49 45 * completely racy anyway. So don't bother with locking for now. 50 46 */ 51 - return i915 && atomic_read(&i915->drm.open_count) == 0; 47 + return i915 && HAS_DISPLAY(i915) && atomic_read(&i915->drm.open_count) == 0; 52 48 } 53 49 54 50 static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
+3 -2
drivers/gpu/drm/msm/adreno/adreno_device.c
··· 551 551 return 0; 552 552 } 553 553 554 + static int adreno_system_suspend(struct device *dev); 554 555 static void adreno_unbind(struct device *dev, struct device *master, 555 556 void *data) 556 557 { 557 558 struct msm_drm_private *priv = dev_get_drvdata(master); 558 559 struct msm_gpu *gpu = dev_to_gpu(dev); 559 560 560 - pm_runtime_force_suspend(dev); 561 + WARN_ON_ONCE(adreno_system_suspend(dev)); 561 562 gpu->funcs->destroy(gpu); 562 563 563 564 priv->gpu_pdev = NULL; ··· 610 609 611 610 static void adreno_shutdown(struct platform_device *pdev) 612 611 { 613 - pm_runtime_force_suspend(&pdev->dev); 612 + WARN_ON_ONCE(adreno_system_suspend(&pdev->dev)); 614 613 } 615 614 616 615 static const struct of_device_id dt_match[] = {
+4
drivers/gpu/drm/msm/adreno/adreno_gpu.c
··· 352 352 /* Ensure string is null terminated: */ 353 353 str[len] = '\0'; 354 354 355 + mutex_lock(&gpu->lock); 356 + 355 357 if (param == MSM_PARAM_COMM) { 356 358 paramp = &ctx->comm; 357 359 } else { ··· 362 360 363 361 kfree(*paramp); 364 362 *paramp = str; 363 + 364 + mutex_unlock(&gpu->lock); 365 365 366 366 return 0; 367 367 }
+2
drivers/gpu/drm/msm/msm_gpu.c
··· 335 335 struct msm_file_private *ctx = submit->queue->ctx; 336 336 struct task_struct *task; 337 337 338 + WARN_ON(!mutex_is_locked(&submit->gpu->lock)); 339 + 338 340 /* Note that kstrdup will return NULL if argument is NULL: */ 339 341 *comm = kstrdup(ctx->comm, GFP_KERNEL); 340 342 *cmd = kstrdup(ctx->cmdline, GFP_KERNEL);
+10 -2
drivers/gpu/drm/msm/msm_gpu.h
··· 376 376 */ 377 377 int sysprof; 378 378 379 - /** comm: Overridden task comm, see MSM_PARAM_COMM */ 379 + /** 380 + * comm: Overridden task comm, see MSM_PARAM_COMM 381 + * 382 + * Accessed under msm_gpu::lock 383 + */ 380 384 char *comm; 381 385 382 - /** cmdline: Overridden task cmdline, see MSM_PARAM_CMDLINE */ 386 + /** 387 + * cmdline: Overridden task cmdline, see MSM_PARAM_CMDLINE 388 + * 389 + * Accessed under msm_gpu::lock 390 + */ 383 391 char *cmdline; 384 392 385 393 /**
+2 -1
drivers/gpu/drm/panfrost/Kconfig
··· 3 3 config DRM_PANFROST 4 4 tristate "Panfrost (DRM support for ARM Mali Midgard/Bifrost GPUs)" 5 5 depends on DRM 6 - depends on ARM || ARM64 || (COMPILE_TEST && !GENERIC_ATOMIC64) 6 + depends on ARM || ARM64 || COMPILE_TEST 7 + depends on !GENERIC_ATOMIC64 # for IOMMU_IO_PGTABLE_LPAE 7 8 depends on MMU 8 9 select DRM_SCHED 9 10 select IOMMU_SUPPORT
+2 -4
drivers/gpu/drm/vc4/vc4_bo.c
··· 179 179 bo->validated_shader = NULL; 180 180 } 181 181 182 + mutex_destroy(&bo->madv_lock); 182 183 drm_gem_dma_free(&bo->base); 183 184 } 184 185 ··· 395 394 { 396 395 struct vc4_dev *vc4 = to_vc4_dev(dev); 397 396 struct vc4_bo *bo; 398 - int ret; 399 397 400 398 if (WARN_ON_ONCE(vc4->is_vc5)) 401 399 return ERR_PTR(-ENODEV); ··· 406 406 bo->madv = VC4_MADV_WILLNEED; 407 407 refcount_set(&bo->usecnt, 0); 408 408 409 - ret = drmm_mutex_init(dev, &bo->madv_lock); 410 - if (ret) 411 - return ERR_PTR(ret); 409 + mutex_init(&bo->madv_lock); 412 410 413 411 mutex_lock(&vc4->bo_lock); 414 412 bo->label = VC4_BO_TYPE_KERNEL;
drivers/gpu/drm/vmwgfx/vmwgfx_msg_arm64.h
+5 -2
drivers/infiniband/core/verbs.c
··· 2957 2957 bool __rdma_block_iter_next(struct ib_block_iter *biter) 2958 2958 { 2959 2959 unsigned int block_offset; 2960 + unsigned int sg_delta; 2960 2961 2961 2962 if (!biter->__sg_nents || !biter->__sg) 2962 2963 return false; 2963 2964 2964 2965 biter->__dma_addr = sg_dma_address(biter->__sg) + biter->__sg_advance; 2965 2966 block_offset = biter->__dma_addr & (BIT_ULL(biter->__pg_bit) - 1); 2966 - biter->__sg_advance += BIT_ULL(biter->__pg_bit) - block_offset; 2967 + sg_delta = BIT_ULL(biter->__pg_bit) - block_offset; 2967 2968 2968 - if (biter->__sg_advance >= sg_dma_len(biter->__sg)) { 2969 + if (sg_dma_len(biter->__sg) - biter->__sg_advance > sg_delta) { 2970 + biter->__sg_advance += sg_delta; 2971 + } else { 2969 2972 biter->__sg_advance = 0; 2970 2973 biter->__sg = sg_next(biter->__sg); 2971 2974 biter->__sg_nents--;
+141 -61
drivers/infiniband/hw/hfi1/user_exp_rcv.c
··· 23 23 static bool tid_rb_invalidate(struct mmu_interval_notifier *mni, 24 24 const struct mmu_notifier_range *range, 25 25 unsigned long cur_seq); 26 + static bool tid_cover_invalidate(struct mmu_interval_notifier *mni, 27 + const struct mmu_notifier_range *range, 28 + unsigned long cur_seq); 26 29 static int program_rcvarray(struct hfi1_filedata *fd, struct tid_user_buf *, 27 30 struct tid_group *grp, 28 31 unsigned int start, u16 count, 29 32 u32 *tidlist, unsigned int *tididx, 30 33 unsigned int *pmapped); 31 - static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo, 32 - struct tid_group **grp); 34 + static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo); 35 + static void __clear_tid_node(struct hfi1_filedata *fd, 36 + struct tid_rb_node *node); 33 37 static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node); 34 38 35 39 static const struct mmu_interval_notifier_ops tid_mn_ops = { 36 40 .invalidate = tid_rb_invalidate, 41 + }; 42 + static const struct mmu_interval_notifier_ops tid_cover_ops = { 43 + .invalidate = tid_cover_invalidate, 37 44 }; 38 45 39 46 /* ··· 260 253 tididx = 0, mapped, mapped_pages = 0; 261 254 u32 *tidlist = NULL; 262 255 struct tid_user_buf *tidbuf; 256 + unsigned long mmu_seq = 0; 263 257 264 258 if (!PAGE_ALIGNED(tinfo->vaddr)) 259 + return -EINVAL; 260 + if (tinfo->length == 0) 265 261 return -EINVAL; 266 262 267 263 tidbuf = kzalloc(sizeof(*tidbuf), GFP_KERNEL); 268 264 if (!tidbuf) 269 265 return -ENOMEM; 270 266 267 + mutex_init(&tidbuf->cover_mutex); 271 268 tidbuf->vaddr = tinfo->vaddr; 272 269 tidbuf->length = tinfo->length; 273 270 tidbuf->psets = kcalloc(uctxt->expected_count, sizeof(*tidbuf->psets), 274 271 GFP_KERNEL); 275 272 if (!tidbuf->psets) { 276 - kfree(tidbuf); 277 - return -ENOMEM; 273 + ret = -ENOMEM; 274 + goto fail_release_mem; 275 + } 276 + 277 + if (fd->use_mn) { 278 + ret = mmu_interval_notifier_insert( 279 + &tidbuf->notifier, current->mm, 280 + tidbuf->vaddr, tidbuf->npages * PAGE_SIZE, 281 + &tid_cover_ops); 282 + if (ret) 283 + goto fail_release_mem; 284 + mmu_seq = mmu_interval_read_begin(&tidbuf->notifier); 278 285 } 279 286 280 287 pinned = pin_rcv_pages(fd, tidbuf); 281 288 if (pinned <= 0) { 282 - kfree(tidbuf->psets); 283 - kfree(tidbuf); 284 - return pinned; 289 + ret = (pinned < 0) ? pinned : -ENOSPC; 290 + goto fail_unpin; 285 291 } 286 292 287 293 /* Find sets of physically contiguous pages */ 288 294 tidbuf->n_psets = find_phys_blocks(tidbuf, pinned); 289 295 290 - /* 291 - * We don't need to access this under a lock since tid_used is per 292 - * process and the same process cannot be in hfi1_user_exp_rcv_clear() 293 - * and hfi1_user_exp_rcv_setup() at the same time. 294 - */ 296 + /* Reserve the number of expected tids to be used. */ 295 297 spin_lock(&fd->tid_lock); 296 298 if (fd->tid_used + tidbuf->n_psets > fd->tid_limit) 297 299 pageset_count = fd->tid_limit - fd->tid_used; 298 300 else 299 301 pageset_count = tidbuf->n_psets; 302 + fd->tid_used += pageset_count; 300 303 spin_unlock(&fd->tid_lock); 301 304 302 - if (!pageset_count) 303 - goto bail; 305 + if (!pageset_count) { 306 + ret = -ENOSPC; 307 + goto fail_unreserve; 308 + } 304 309 305 310 ngroups = pageset_count / dd->rcv_entries.group_size; 306 311 tidlist = kcalloc(pageset_count, sizeof(*tidlist), GFP_KERNEL); 307 312 if (!tidlist) { 308 313 ret = -ENOMEM; 309 - goto nomem; 314 + goto fail_unreserve; 310 315 } 311 316 312 317 tididx = 0; ··· 414 395 } 415 396 unlock: 416 397 mutex_unlock(&uctxt->exp_mutex); 417 - nomem: 418 398 hfi1_cdbg(TID, "total mapped: tidpairs:%u pages:%u (%d)", tididx, 419 399 mapped_pages, ret); 420 - if (tididx) { 421 - spin_lock(&fd->tid_lock); 422 - fd->tid_used += tididx; 423 - spin_unlock(&fd->tid_lock); 424 - tinfo->tidcnt = tididx; 425 - tinfo->length = mapped_pages * PAGE_SIZE; 426 400 427 - if (copy_to_user(u64_to_user_ptr(tinfo->tidlist), 428 - tidlist, sizeof(tidlist[0]) * tididx)) { 429 - /* 430 - * On failure to copy to the user level, we need to undo 431 - * everything done so far so we don't leak resources. 432 - */ 433 - tinfo->tidlist = (unsigned long)&tidlist; 434 - hfi1_user_exp_rcv_clear(fd, tinfo); 435 - tinfo->tidlist = 0; 436 - ret = -EFAULT; 437 - goto bail; 401 + /* fail if nothing was programmed, set error if none provided */ 402 + if (tididx == 0) { 403 + if (ret >= 0) 404 + ret = -ENOSPC; 405 + goto fail_unreserve; 406 + } 407 + 408 + /* adjust reserved tid_used to actual count */ 409 + spin_lock(&fd->tid_lock); 410 + fd->tid_used -= pageset_count - tididx; 411 + spin_unlock(&fd->tid_lock); 412 + 413 + /* unpin all pages not covered by a TID */ 414 + unpin_rcv_pages(fd, tidbuf, NULL, mapped_pages, pinned - mapped_pages, 415 + false); 416 + 417 + if (fd->use_mn) { 418 + /* check for an invalidate during setup */ 419 + bool fail = false; 420 + 421 + mutex_lock(&tidbuf->cover_mutex); 422 + fail = mmu_interval_read_retry(&tidbuf->notifier, mmu_seq); 423 + mutex_unlock(&tidbuf->cover_mutex); 424 + 425 + if (fail) { 426 + ret = -EBUSY; 427 + goto fail_unprogram; 438 428 } 439 429 } 440 430 441 - /* 442 - * If not everything was mapped (due to insufficient RcvArray entries, 443 - * for example), unpin all unmapped pages so we can pin them nex time. 444 - */ 445 - if (mapped_pages != pinned) 446 - unpin_rcv_pages(fd, tidbuf, NULL, mapped_pages, 447 - (pinned - mapped_pages), false); 448 - bail: 449 - kfree(tidbuf->psets); 450 - kfree(tidlist); 431 + tinfo->tidcnt = tididx; 432 + tinfo->length = mapped_pages * PAGE_SIZE; 433 + 434 + if (copy_to_user(u64_to_user_ptr(tinfo->tidlist), 435 + tidlist, sizeof(tidlist[0]) * tididx)) { 436 + ret = -EFAULT; 437 + goto fail_unprogram; 438 + } 439 + 440 + if (fd->use_mn) 441 + mmu_interval_notifier_remove(&tidbuf->notifier); 451 442 kfree(tidbuf->pages); 443 + kfree(tidbuf->psets); 452 444 kfree(tidbuf); 453 - return ret > 0 ? 0 : ret; 445 + kfree(tidlist); 446 + return 0; 447 + 448 + fail_unprogram: 449 + /* unprogram, unmap, and unpin all allocated TIDs */ 450 + tinfo->tidlist = (unsigned long)tidlist; 451 + hfi1_user_exp_rcv_clear(fd, tinfo); 452 + tinfo->tidlist = 0; 453 + pinned = 0; /* nothing left to unpin */ 454 + pageset_count = 0; /* nothing left reserved */ 455 + fail_unreserve: 456 + spin_lock(&fd->tid_lock); 457 + fd->tid_used -= pageset_count; 458 + spin_unlock(&fd->tid_lock); 459 + fail_unpin: 460 + if (fd->use_mn) 461 + mmu_interval_notifier_remove(&tidbuf->notifier); 462 + if (pinned > 0) 463 + unpin_rcv_pages(fd, tidbuf, NULL, 0, pinned, false); 464 + fail_release_mem: 465 + kfree(tidbuf->pages); 466 + kfree(tidbuf->psets); 467 + kfree(tidbuf); 468 + kfree(tidlist); 469 + return ret; 454 470 } 455 471 456 472 int hfi1_user_exp_rcv_clear(struct hfi1_filedata *fd, ··· 506 452 507 453 mutex_lock(&uctxt->exp_mutex); 508 454 for (tididx = 0; tididx < tinfo->tidcnt; tididx++) { 509 - ret = unprogram_rcvarray(fd, tidinfo[tididx], NULL); 455 + ret = unprogram_rcvarray(fd, tidinfo[tididx]); 510 456 if (ret) { 511 457 hfi1_cdbg(TID, "Failed to unprogram rcv array %d", 512 458 ret); ··· 760 706 } 761 707 762 708 node->fdata = fd; 709 + mutex_init(&node->invalidate_mutex); 763 710 node->phys = page_to_phys(pages[0]); 764 711 node->npages = npages; 765 712 node->rcventry = rcventry; ··· 776 721 &tid_mn_ops); 777 722 if (ret) 778 723 goto out_unmap; 779 - /* 780 - * FIXME: This is in the wrong order, the notifier should be 781 - * established before the pages are pinned by pin_rcv_pages. 782 - */ 783 - mmu_interval_read_begin(&node->notifier); 784 724 } 785 725 fd->entry_to_rb[node->rcventry - uctxt->expected_base] = node; 786 726 ··· 795 745 return -EFAULT; 796 746 } 797 747 798 - static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo, 799 - struct tid_group **grp) 748 + static int unprogram_rcvarray(struct hfi1_filedata *fd, u32 tidinfo) 800 749 { 801 750 struct hfi1_ctxtdata *uctxt = fd->uctxt; 802 751 struct hfi1_devdata *dd = uctxt->dd; ··· 818 769 if (!node || node->rcventry != (uctxt->expected_base + rcventry)) 819 770 return -EBADF; 820 771 821 - if (grp) 822 - *grp = node->grp; 823 - 824 772 if (fd->use_mn) 825 773 mmu_interval_notifier_remove(&node->notifier); 826 774 cacheless_tid_rb_remove(fd, node); ··· 825 779 return 0; 826 780 } 827 781 828 - static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node) 782 + static void __clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node) 829 783 { 830 784 struct hfi1_ctxtdata *uctxt = fd->uctxt; 831 785 struct hfi1_devdata *dd = uctxt->dd; 786 + 787 + mutex_lock(&node->invalidate_mutex); 788 + if (node->freed) 789 + goto done; 790 + node->freed = true; 832 791 833 792 trace_hfi1_exp_tid_unreg(uctxt->ctxt, fd->subctxt, node->rcventry, 834 793 node->npages, 835 794 node->notifier.interval_tree.start, node->phys, 836 795 node->dma_addr); 837 796 838 - /* 839 - * Make sure device has seen the write before we unpin the 840 - * pages. 841 - */ 797 + /* Make sure device has seen the write before pages are unpinned */ 842 798 hfi1_put_tid(dd, node->rcventry, PT_INVALID_FLUSH, 0, 0); 843 799 844 800 unpin_rcv_pages(fd, NULL, node, 0, node->npages, true); 801 + done: 802 + mutex_unlock(&node->invalidate_mutex); 803 + } 804 + 805 + static void clear_tid_node(struct hfi1_filedata *fd, struct tid_rb_node *node) 806 + { 807 + struct hfi1_ctxtdata *uctxt = fd->uctxt; 808 + 809 + __clear_tid_node(fd, node); 845 810 846 811 node->grp->used--; 847 812 node->grp->map &= ~(1 << (node->rcventry - node->grp->base)); ··· 911 854 if (node->freed) 912 855 return true; 913 856 857 + /* take action only if unmapping */ 858 + if (range->event != MMU_NOTIFY_UNMAP) 859 + return true; 860 + 914 861 trace_hfi1_exp_tid_inval(uctxt->ctxt, fdata->subctxt, 915 862 node->notifier.interval_tree.start, 916 863 node->rcventry, node->npages, node->dma_addr); 917 - node->freed = true; 864 + 865 + /* clear the hardware rcvarray entry */ 866 + __clear_tid_node(fdata, node); 918 867 919 868 spin_lock(&fdata->invalid_lock); 920 869 if (fdata->invalid_tid_idx < uctxt->expected_count) { ··· 947 884 fdata->invalid_tid_idx++; 948 885 } 949 886 spin_unlock(&fdata->invalid_lock); 887 + return true; 888 + } 889 + 890 + static bool tid_cover_invalidate(struct mmu_interval_notifier *mni, 891 + const struct mmu_notifier_range *range, 892 + unsigned long cur_seq) 893 + { 894 + struct tid_user_buf *tidbuf = 895 + container_of(mni, struct tid_user_buf, notifier); 896 + 897 + /* take action only if unmapping */ 898 + if (range->event == MMU_NOTIFY_UNMAP) { 899 + mutex_lock(&tidbuf->cover_mutex); 900 + mmu_interval_set_seq(mni, cur_seq); 901 + mutex_unlock(&tidbuf->cover_mutex); 902 + } 903 + 950 904 return true; 951 905 } 952 906
+3
drivers/infiniband/hw/hfi1/user_exp_rcv.h
··· 16 16 }; 17 17 18 18 struct tid_user_buf { 19 + struct mmu_interval_notifier notifier; 20 + struct mutex cover_mutex; 19 21 unsigned long vaddr; 20 22 unsigned long length; 21 23 unsigned int npages; ··· 29 27 struct tid_rb_node { 30 28 struct mmu_interval_notifier notifier; 31 29 struct hfi1_filedata *fdata; 30 + struct mutex invalidate_mutex; /* covers hw removal */ 32 31 unsigned long phys; 33 32 struct tid_group *grp; 34 33 u32 rcventry;
+5 -5
drivers/infiniband/sw/rxe/rxe_param.h
··· 98 98 RXE_MAX_SRQ = DEFAULT_MAX_VALUE - RXE_MIN_SRQ_INDEX, 99 99 100 100 RXE_MIN_MR_INDEX = 0x00000001, 101 - RXE_MAX_MR_INDEX = DEFAULT_MAX_VALUE, 102 - RXE_MAX_MR = DEFAULT_MAX_VALUE - RXE_MIN_MR_INDEX, 103 - RXE_MIN_MW_INDEX = 0x00010001, 104 - RXE_MAX_MW_INDEX = 0x00020000, 105 - RXE_MAX_MW = 0x00001000, 101 + RXE_MAX_MR_INDEX = DEFAULT_MAX_VALUE >> 1, 102 + RXE_MAX_MR = RXE_MAX_MR_INDEX - RXE_MIN_MR_INDEX, 103 + RXE_MIN_MW_INDEX = RXE_MAX_MR_INDEX + 1, 104 + RXE_MAX_MW_INDEX = DEFAULT_MAX_VALUE, 105 + RXE_MAX_MW = RXE_MAX_MW_INDEX - RXE_MIN_MW_INDEX, 106 106 107 107 RXE_MAX_PKT_PER_ACK = 64, 108 108
+11 -11
drivers/infiniband/sw/rxe/rxe_pool.c
··· 23 23 .size = sizeof(struct rxe_ucontext), 24 24 .elem_offset = offsetof(struct rxe_ucontext, elem), 25 25 .min_index = 1, 26 - .max_index = UINT_MAX, 27 - .max_elem = UINT_MAX, 26 + .max_index = RXE_MAX_UCONTEXT, 27 + .max_elem = RXE_MAX_UCONTEXT, 28 28 }, 29 29 [RXE_TYPE_PD] = { 30 30 .name = "pd", 31 31 .size = sizeof(struct rxe_pd), 32 32 .elem_offset = offsetof(struct rxe_pd, elem), 33 33 .min_index = 1, 34 - .max_index = UINT_MAX, 35 - .max_elem = UINT_MAX, 34 + .max_index = RXE_MAX_PD, 35 + .max_elem = RXE_MAX_PD, 36 36 }, 37 37 [RXE_TYPE_AH] = { 38 38 .name = "ah", ··· 40 40 .elem_offset = offsetof(struct rxe_ah, elem), 41 41 .min_index = RXE_MIN_AH_INDEX, 42 42 .max_index = RXE_MAX_AH_INDEX, 43 - .max_elem = RXE_MAX_AH_INDEX - RXE_MIN_AH_INDEX + 1, 43 + .max_elem = RXE_MAX_AH, 44 44 }, 45 45 [RXE_TYPE_SRQ] = { 46 46 .name = "srq", ··· 49 49 .cleanup = rxe_srq_cleanup, 50 50 .min_index = RXE_MIN_SRQ_INDEX, 51 51 .max_index = RXE_MAX_SRQ_INDEX, 52 - .max_elem = RXE_MAX_SRQ_INDEX - RXE_MIN_SRQ_INDEX + 1, 52 + .max_elem = RXE_MAX_SRQ, 53 53 }, 54 54 [RXE_TYPE_QP] = { 55 55 .name = "qp", ··· 58 58 .cleanup = rxe_qp_cleanup, 59 59 .min_index = RXE_MIN_QP_INDEX, 60 60 .max_index = RXE_MAX_QP_INDEX, 61 - .max_elem = RXE_MAX_QP_INDEX - RXE_MIN_QP_INDEX + 1, 61 + .max_elem = RXE_MAX_QP, 62 62 }, 63 63 [RXE_TYPE_CQ] = { 64 64 .name = "cq", ··· 66 66 .elem_offset = offsetof(struct rxe_cq, elem), 67 67 .cleanup = rxe_cq_cleanup, 68 68 .min_index = 1, 69 - .max_index = UINT_MAX, 70 - .max_elem = UINT_MAX, 69 + .max_index = RXE_MAX_CQ, 70 + .max_elem = RXE_MAX_CQ, 71 71 }, 72 72 [RXE_TYPE_MR] = { 73 73 .name = "mr", ··· 76 76 .cleanup = rxe_mr_cleanup, 77 77 .min_index = RXE_MIN_MR_INDEX, 78 78 .max_index = RXE_MAX_MR_INDEX, 79 - .max_elem = RXE_MAX_MR_INDEX - RXE_MIN_MR_INDEX + 1, 79 + .max_elem = RXE_MAX_MR, 80 80 }, 81 81 [RXE_TYPE_MW] = { 82 82 .name = "mw", ··· 85 85 .cleanup = rxe_mw_cleanup, 86 86 .min_index = RXE_MIN_MW_INDEX, 87 87 .max_index = RXE_MAX_MW_INDEX, 88 - .max_elem = RXE_MAX_MW_INDEX - RXE_MIN_MW_INDEX + 1, 88 + .max_elem = RXE_MAX_MW, 89 89 }, 90 90 }; 91 91
+1 -1
drivers/interconnect/qcom/icc-rpm.c
··· 488 488 } 489 489 490 490 regmap_done: 491 - ret = devm_clk_bulk_get(dev, qp->num_clks, qp->bus_clks); 491 + ret = devm_clk_bulk_get_optional(dev, qp->num_clks, qp->bus_clks); 492 492 if (ret) 493 493 return ret; 494 494
+14 -5
drivers/interconnect/qcom/msm8996.c
··· 33 33 "aggre0_noc_mpu_cfg" 34 34 }; 35 35 36 + static const char * const bus_a2noc_clocks[] = { 37 + "bus", 38 + "bus_a", 39 + "aggre2_ufs_axi", 40 + "ufs_axi" 41 + }; 42 + 36 43 static const u16 mas_a0noc_common_links[] = { 37 44 MSM8996_SLAVE_A0NOC_SNOC 38 45 }; ··· 1813 1806 .reg_bits = 32, 1814 1807 .reg_stride = 4, 1815 1808 .val_bits = 32, 1816 - .max_register = 0x9000, 1809 + .max_register = 0x6000, 1817 1810 .fast_io = true 1818 1811 }; 1819 1812 ··· 1837 1830 .reg_bits = 32, 1838 1831 .reg_stride = 4, 1839 1832 .val_bits = 32, 1840 - .max_register = 0x7000, 1833 + .max_register = 0x5000, 1841 1834 .fast_io = true 1842 1835 }; 1843 1836 ··· 1858 1851 .reg_bits = 32, 1859 1852 .reg_stride = 4, 1860 1853 .val_bits = 32, 1861 - .max_register = 0xa000, 1854 + .max_register = 0x7000, 1862 1855 .fast_io = true 1863 1856 }; 1864 1857 ··· 1866 1859 .type = QCOM_ICC_NOC, 1867 1860 .nodes = a2noc_nodes, 1868 1861 .num_nodes = ARRAY_SIZE(a2noc_nodes), 1862 + .clocks = bus_a2noc_clocks, 1863 + .num_clocks = ARRAY_SIZE(bus_a2noc_clocks), 1869 1864 .regmap_cfg = &msm8996_a2noc_regmap_config 1870 1865 }; 1871 1866 ··· 1886 1877 .reg_bits = 32, 1887 1878 .reg_stride = 4, 1888 1879 .val_bits = 32, 1889 - .max_register = 0x62000, 1880 + .max_register = 0x5a000, 1890 1881 .fast_io = true 1891 1882 }; 1892 1883 ··· 1997 1988 .reg_bits = 32, 1998 1989 .reg_stride = 4, 1999 1990 .val_bits = 32, 2000 - .max_register = 0x20000, 1991 + .max_register = 0x1c000, 2001 1992 .fast_io = true 2002 1993 }; 2003 1994
+2 -2
drivers/md/md.c
··· 3644 3644 */ 3645 3645 static struct md_rdev *md_import_device(dev_t newdev, int super_format, int super_minor) 3646 3646 { 3647 - static struct md_rdev *claim_rdev; /* just for claiming the bdev */ 3647 + static struct md_rdev claim_rdev; /* just for claiming the bdev */ 3648 3648 struct md_rdev *rdev; 3649 3649 sector_t size; 3650 3650 int err; ··· 3662 3662 3663 3663 rdev->bdev = blkdev_get_by_dev(newdev, 3664 3664 FMODE_READ | FMODE_WRITE | FMODE_EXCL, 3665 - super_format == -2 ? claim_rdev : rdev); 3665 + super_format == -2 ? &claim_rdev : rdev); 3666 3666 if (IS_ERR(rdev->bdev)) { 3667 3667 pr_warn("md: could not open device unknown-block(%u,%u).\n", 3668 3668 MAJOR(newdev), MINOR(newdev));
+2 -4
drivers/memory/atmel-sdramc.c
··· 47 47 caps = of_device_get_match_data(&pdev->dev); 48 48 49 49 if (caps->has_ddrck) { 50 - clk = devm_clk_get(&pdev->dev, "ddrck"); 50 + clk = devm_clk_get_enabled(&pdev->dev, "ddrck"); 51 51 if (IS_ERR(clk)) 52 52 return PTR_ERR(clk); 53 - clk_prepare_enable(clk); 54 53 } 55 54 56 55 if (caps->has_mpddr_clk) { 57 - clk = devm_clk_get(&pdev->dev, "mpddr"); 56 + clk = devm_clk_get_enabled(&pdev->dev, "mpddr"); 58 57 if (IS_ERR(clk)) { 59 58 pr_err("AT91 RAMC: couldn't get mpddr clock\n"); 60 59 return PTR_ERR(clk); 61 60 } 62 - clk_prepare_enable(clk); 63 61 } 64 62 65 63 return 0;
+1 -2
drivers/memory/mvebu-devbus.c
··· 280 280 if (IS_ERR(devbus->base)) 281 281 return PTR_ERR(devbus->base); 282 282 283 - clk = devm_clk_get(&pdev->dev, NULL); 283 + clk = devm_clk_get_enabled(&pdev->dev, NULL); 284 284 if (IS_ERR(clk)) 285 285 return PTR_ERR(clk); 286 - clk_prepare_enable(clk); 287 286 288 287 /* 289 288 * Obtain clock period in picoseconds,
+2 -1
drivers/memory/omap-gpmc.c
··· 1918 1918 } 1919 1919 } 1920 1920 1921 - if (p->wait_pin > gpmc_nr_waitpins) { 1921 + if (p->wait_pin != GPMC_WAITPIN_INVALID && 1922 + p->wait_pin > gpmc_nr_waitpins) { 1922 1923 pr_err("%s: invalid wait-pin (%d)\n", __func__, p->wait_pin); 1923 1924 return -EINVAL; 1924 1925 }
-36
drivers/memory/tegra/tegra186.c
··· 22 22 #define MC_SID_STREAMID_SECURITY_WRITE_ACCESS_DISABLED BIT(16) 23 23 #define MC_SID_STREAMID_SECURITY_OVERRIDE BIT(8) 24 24 25 - static void tegra186_mc_program_sid(struct tegra_mc *mc) 26 - { 27 - unsigned int i; 28 - 29 - for (i = 0; i < mc->soc->num_clients; i++) { 30 - const struct tegra_mc_client *client = &mc->soc->clients[i]; 31 - u32 override, security; 32 - 33 - override = readl(mc->regs + client->regs.sid.override); 34 - security = readl(mc->regs + client->regs.sid.security); 35 - 36 - dev_dbg(mc->dev, "client %s: override: %x security: %x\n", 37 - client->name, override, security); 38 - 39 - dev_dbg(mc->dev, "setting SID %u for %s\n", client->sid, 40 - client->name); 41 - writel(client->sid, mc->regs + client->regs.sid.override); 42 - 43 - override = readl(mc->regs + client->regs.sid.override); 44 - security = readl(mc->regs + client->regs.sid.security); 45 - 46 - dev_dbg(mc->dev, "client %s: override: %x security: %x\n", 47 - client->name, override, security); 48 - } 49 - } 50 - 51 25 static int tegra186_mc_probe(struct tegra_mc *mc) 52 26 { 53 27 struct platform_device *pdev = to_platform_device(mc->dev); ··· 59 85 if (err < 0) 60 86 return err; 61 87 62 - tegra186_mc_program_sid(mc); 63 - 64 88 return 0; 65 89 } 66 90 67 91 static void tegra186_mc_remove(struct tegra_mc *mc) 68 92 { 69 93 of_platform_depopulate(mc->dev); 70 - } 71 - 72 - static int tegra186_mc_resume(struct tegra_mc *mc) 73 - { 74 - tegra186_mc_program_sid(mc); 75 - 76 - return 0; 77 94 } 78 95 79 96 #if IS_ENABLED(CONFIG_IOMMU_API) ··· 138 173 const struct tegra_mc_ops tegra186_mc_ops = { 139 174 .probe = tegra186_mc_probe, 140 175 .remove = tegra186_mc_remove, 141 - .resume = tegra186_mc_resume, 142 176 .probe_device = tegra186_mc_probe_device, 143 177 .handle_irq = tegra30_mc_handle_irq, 144 178 };
+41 -42
drivers/misc/fastrpc.c
··· 321 321 perm.vmid = QCOM_SCM_VMID_HLOS; 322 322 perm.perm = QCOM_SCM_PERM_RWX; 323 323 err = qcom_scm_assign_mem(map->phys, map->size, 324 - &(map->fl->cctx->vmperms[0].vmid), &perm, 1); 324 + &map->fl->cctx->perms, &perm, 1); 325 325 if (err) { 326 326 dev_err(map->fl->sctx->dev, "Failed to assign memory phys 0x%llx size 0x%llx err %d", 327 327 map->phys, map->size, err); ··· 334 334 dma_buf_put(map->buf); 335 335 } 336 336 337 + if (map->fl) { 338 + spin_lock(&map->fl->lock); 339 + list_del(&map->node); 340 + spin_unlock(&map->fl->lock); 341 + map->fl = NULL; 342 + } 343 + 337 344 kfree(map); 338 345 } 339 346 ··· 350 343 kref_put(&map->refcount, fastrpc_free_map); 351 344 } 352 345 353 - static void fastrpc_map_get(struct fastrpc_map *map) 346 + static int fastrpc_map_get(struct fastrpc_map *map) 354 347 { 355 - if (map) 356 - kref_get(&map->refcount); 348 + if (!map) 349 + return -ENOENT; 350 + 351 + return kref_get_unless_zero(&map->refcount) ? 0 : -ENOENT; 357 352 } 358 353 359 354 360 355 static int fastrpc_map_lookup(struct fastrpc_user *fl, int fd, 361 - struct fastrpc_map **ppmap) 356 + struct fastrpc_map **ppmap, bool take_ref) 362 357 { 358 + struct fastrpc_session_ctx *sess = fl->sctx; 363 359 struct fastrpc_map *map = NULL; 360 + int ret = -ENOENT; 364 361 365 - mutex_lock(&fl->mutex); 362 + spin_lock(&fl->lock); 366 363 list_for_each_entry(map, &fl->maps, node) { 367 - if (map->fd == fd) { 368 - *ppmap = map; 369 - mutex_unlock(&fl->mutex); 370 - return 0; 364 + if (map->fd != fd) 365 + continue; 366 + 367 + if (take_ref) { 368 + ret = fastrpc_map_get(map); 369 + if (ret) { 370 + dev_dbg(sess->dev, "%s: Failed to get map fd=%d ret=%d\n", 371 + __func__, fd, ret); 372 + break; 373 + } 371 374 } 375 + 376 + *ppmap = map; 377 + ret = 0; 378 + break; 372 379 } 373 - mutex_unlock(&fl->mutex); 374 - 375 - return -ENOENT; 376 - } 377 - 378 - static int fastrpc_map_find(struct fastrpc_user *fl, int fd, 379 - struct fastrpc_map **ppmap) 380 - { 381 - int ret = fastrpc_map_lookup(fl, fd, ppmap); 382 - 383 - if (!ret) 384 - fastrpc_map_get(*ppmap); 380 + spin_unlock(&fl->lock); 385 381 386 382 return ret; 387 383 } ··· 756 746 struct fastrpc_map *map = NULL; 757 747 int err = 0; 758 748 759 - if (!fastrpc_map_find(fl, fd, ppmap)) 749 + if (!fastrpc_map_lookup(fl, fd, ppmap, true)) 760 750 return 0; 761 751 762 752 map = kzalloc(sizeof(*map), GFP_KERNEL); ··· 798 788 * If subsystem VMIDs are defined in DTSI, then do 799 789 * hyp_assign from HLOS to those VM(s) 800 790 */ 801 - unsigned int perms = BIT(QCOM_SCM_VMID_HLOS); 802 - 803 791 map->attr = attr; 804 - err = qcom_scm_assign_mem(map->phys, (u64)map->size, &perms, 792 + err = qcom_scm_assign_mem(map->phys, (u64)map->size, &fl->cctx->perms, 805 793 fl->cctx->vmperms, fl->cctx->vmcount); 806 794 if (err) { 807 795 dev_err(sess->dev, "Failed to assign memory with phys 0x%llx size 0x%llx err %d", ··· 1078 1070 for (i = 0; i < FASTRPC_MAX_FDLIST; i++) { 1079 1071 if (!fdlist[i]) 1080 1072 break; 1081 - if (!fastrpc_map_lookup(fl, (int)fdlist[i], &mmap)) 1073 + if (!fastrpc_map_lookup(fl, (int)fdlist[i], &mmap, false)) 1082 1074 fastrpc_map_put(mmap); 1083 1075 } 1084 1076 ··· 1266 1258 1267 1259 /* Map if we have any heap VMIDs associated with this ADSP Static Process. */ 1268 1260 if (fl->cctx->vmcount) { 1269 - unsigned int perms = BIT(QCOM_SCM_VMID_HLOS); 1270 - 1271 1261 err = qcom_scm_assign_mem(fl->cctx->remote_heap->phys, 1272 - (u64)fl->cctx->remote_heap->size, &perms, 1262 + (u64)fl->cctx->remote_heap->size, 1263 + &fl->cctx->perms, 1273 1264 fl->cctx->vmperms, fl->cctx->vmcount); 1274 1265 if (err) { 1275 1266 dev_err(fl->sctx->dev, "Failed to assign memory with phys 0x%llx size 0x%llx err %d", ··· 1316 1309 perm.perm = QCOM_SCM_PERM_RWX; 1317 1310 err = qcom_scm_assign_mem(fl->cctx->remote_heap->phys, 1318 1311 (u64)fl->cctx->remote_heap->size, 1319 - &(fl->cctx->vmperms[0].vmid), &perm, 1); 1312 + &fl->cctx->perms, &perm, 1); 1320 1313 if (err) 1321 1314 dev_err(fl->sctx->dev, "Failed to assign memory phys 0x%llx size 0x%llx err %d", 1322 1315 fl->cctx->remote_heap->phys, fl->cctx->remote_heap->size, err); ··· 1440 1433 fl->init_mem = NULL; 1441 1434 fastrpc_buf_free(imem); 1442 1435 err_alloc: 1443 - if (map) { 1444 - spin_lock(&fl->lock); 1445 - list_del(&map->node); 1446 - spin_unlock(&fl->lock); 1447 - fastrpc_map_put(map); 1448 - } 1436 + fastrpc_map_put(map); 1449 1437 err: 1450 1438 kfree(args); 1451 1439 ··· 1516 1514 fastrpc_context_put(ctx); 1517 1515 } 1518 1516 1519 - list_for_each_entry_safe(map, m, &fl->maps, node) { 1520 - list_del(&map->node); 1517 + list_for_each_entry_safe(map, m, &fl->maps, node) 1521 1518 fastrpc_map_put(map); 1522 - } 1523 1519 1524 1520 list_for_each_entry_safe(buf, b, &fl->mmaps, node) { 1525 1521 list_del(&buf->node); ··· 1894 1894 /* Add memory to static PD pool, protection thru hypervisor */ 1895 1895 if (req.flags != ADSP_MMAP_REMOTE_HEAP_ADDR && fl->cctx->vmcount) { 1896 1896 struct qcom_scm_vmperm perm; 1897 - int err = 0; 1898 1897 1899 1898 perm.vmid = QCOM_SCM_VMID_HLOS; 1900 1899 perm.perm = QCOM_SCM_PERM_RWX; 1901 1900 err = qcom_scm_assign_mem(buf->phys, buf->size, 1902 - &(fl->cctx->vmperms[0].vmid), &perm, 1); 1901 + &fl->cctx->perms, &perm, 1); 1903 1902 if (err) { 1904 1903 dev_err(fl->sctx->dev, "Failed to assign memory phys 0x%llx size 0x%llx err %d", 1905 1904 buf->phys, buf->size, err);
+8 -4
drivers/misc/mei/bus.c
··· 702 702 if (cl->state == MEI_FILE_UNINITIALIZED) { 703 703 ret = mei_cl_link(cl); 704 704 if (ret) 705 - goto out; 705 + goto notlinked; 706 706 /* update pointers */ 707 707 cl->cldev = cldev; 708 708 } 709 709 710 710 ret = mei_cl_dma_alloc_and_map(cl, NULL, buffer_id, size); 711 - out: 711 + if (ret) 712 + mei_cl_unlink(cl); 713 + notlinked: 712 714 mutex_unlock(&bus->device_lock); 713 715 if (ret) 714 716 return ERR_PTR(ret); ··· 760 758 if (cl->state == MEI_FILE_UNINITIALIZED) { 761 759 ret = mei_cl_link(cl); 762 760 if (ret) 763 - goto out; 761 + goto notlinked; 764 762 /* update pointers */ 765 763 cl->cldev = cldev; 766 764 } ··· 787 785 } 788 786 789 787 out: 788 + if (ret) 789 + mei_cl_unlink(cl); 790 + notlinked: 790 791 mutex_unlock(&bus->device_lock); 791 792 792 793 return ret; ··· 1282 1277 mei_cl_flush_queues(cldev->cl, NULL); 1283 1278 mei_me_cl_put(cldev->me_cl); 1284 1279 mei_dev_bus_put(cldev->bus); 1285 - mei_cl_unlink(cldev->cl); 1286 1280 kfree(cldev->cl); 1287 1281 kfree(cldev); 1288 1282 }
+2
drivers/misc/mei/hw-me-regs.h
··· 111 111 112 112 #define MEI_DEV_ID_RPL_S 0x7A68 /* Raptor Lake Point S */ 113 113 114 + #define MEI_DEV_ID_MTL_M 0x7E70 /* Meteor Lake Point M */ 115 + 114 116 /* 115 117 * MEI HW Section 116 118 */
+2
drivers/misc/mei/pci-me.c
··· 118 118 119 119 {MEI_PCI_DEVICE(MEI_DEV_ID_RPL_S, MEI_ME_PCH15_CFG)}, 120 120 121 + {MEI_PCI_DEVICE(MEI_DEV_ID_MTL_M, MEI_ME_PCH15_CFG)}, 122 + 121 123 /* required last entry */ 122 124 {0, } 123 125 };
+19 -30
drivers/misc/vmw_vmci/vmci_guest.c
··· 56 56 57 57 bool exclusive_vectors; 58 58 59 - struct tasklet_struct datagram_tasklet; 60 - struct tasklet_struct bm_tasklet; 61 59 struct wait_queue_head inout_wq; 62 60 63 61 void *data_buffer; ··· 302 304 * This function assumes that it has exclusive access to the data 303 305 * in register(s) for the duration of the call. 304 306 */ 305 - static void vmci_dispatch_dgs(unsigned long data) 307 + static void vmci_dispatch_dgs(struct vmci_guest_device *vmci_dev) 306 308 { 307 - struct vmci_guest_device *vmci_dev = (struct vmci_guest_device *)data; 308 309 u8 *dg_in_buffer = vmci_dev->data_buffer; 309 310 struct vmci_datagram *dg; 310 311 size_t dg_in_buffer_size = VMCI_MAX_DG_SIZE; ··· 462 465 * Scans the notification bitmap for raised flags, clears them 463 466 * and handles the notifications. 464 467 */ 465 - static void vmci_process_bitmap(unsigned long data) 468 + static void vmci_process_bitmap(struct vmci_guest_device *dev) 466 469 { 467 - struct vmci_guest_device *dev = (struct vmci_guest_device *)data; 468 - 469 470 if (!dev->notification_bitmap) { 470 471 dev_dbg(dev->dev, "No bitmap present in %s\n", __func__); 471 472 return; ··· 481 486 struct vmci_guest_device *dev = _dev; 482 487 483 488 /* 484 - * If we are using MSI-X with exclusive vectors then we simply schedule 485 - * the datagram tasklet, since we know the interrupt was meant for us. 489 + * If we are using MSI-X with exclusive vectors then we simply call 490 + * vmci_dispatch_dgs(), since we know the interrupt was meant for us. 486 491 * Otherwise we must read the ICR to determine what to do. 487 492 */ 488 493 489 494 if (dev->exclusive_vectors) { 490 - tasklet_schedule(&dev->datagram_tasklet); 495 + vmci_dispatch_dgs(dev); 491 496 } else { 492 497 unsigned int icr; 493 498 ··· 497 502 return IRQ_NONE; 498 503 499 504 if (icr & VMCI_ICR_DATAGRAM) { 500 - tasklet_schedule(&dev->datagram_tasklet); 505 + vmci_dispatch_dgs(dev); 501 506 icr &= ~VMCI_ICR_DATAGRAM; 502 507 } 503 508 504 509 if (icr & VMCI_ICR_NOTIFICATION) { 505 - tasklet_schedule(&dev->bm_tasklet); 510 + vmci_process_bitmap(dev); 506 511 icr &= ~VMCI_ICR_NOTIFICATION; 507 512 } 508 513 ··· 531 536 struct vmci_guest_device *dev = _dev; 532 537 533 538 /* For MSI-X we can just assume it was meant for us. */ 534 - tasklet_schedule(&dev->bm_tasklet); 539 + vmci_process_bitmap(dev); 535 540 536 541 return IRQ_HANDLED; 537 542 } ··· 633 638 vmci_dev->iobase = iobase; 634 639 vmci_dev->mmio_base = mmio_base; 635 640 636 - tasklet_init(&vmci_dev->datagram_tasklet, 637 - vmci_dispatch_dgs, (unsigned long)vmci_dev); 638 - tasklet_init(&vmci_dev->bm_tasklet, 639 - vmci_process_bitmap, (unsigned long)vmci_dev); 640 641 init_waitqueue_head(&vmci_dev->inout_wq); 641 642 642 643 if (mmio_base != NULL) { ··· 799 808 * Request IRQ for legacy or MSI interrupts, or for first 800 809 * MSI-X vector. 801 810 */ 802 - error = request_irq(pci_irq_vector(pdev, 0), vmci_interrupt, 803 - IRQF_SHARED, KBUILD_MODNAME, vmci_dev); 811 + error = request_threaded_irq(pci_irq_vector(pdev, 0), NULL, 812 + vmci_interrupt, IRQF_SHARED, 813 + KBUILD_MODNAME, vmci_dev); 804 814 if (error) { 805 815 dev_err(&pdev->dev, "Irq %u in use: %d\n", 806 816 pci_irq_vector(pdev, 0), error); ··· 815 823 * between the vectors. 816 824 */ 817 825 if (vmci_dev->exclusive_vectors) { 818 - error = request_irq(pci_irq_vector(pdev, 1), 819 - vmci_interrupt_bm, 0, KBUILD_MODNAME, 820 - vmci_dev); 826 + error = request_threaded_irq(pci_irq_vector(pdev, 1), NULL, 827 + vmci_interrupt_bm, 0, 828 + KBUILD_MODNAME, vmci_dev); 821 829 if (error) { 822 830 dev_err(&pdev->dev, 823 831 "Failed to allocate irq %u: %d\n", ··· 825 833 goto err_free_irq; 826 834 } 827 835 if (caps_in_use & VMCI_CAPS_DMA_DATAGRAM) { 828 - error = request_irq(pci_irq_vector(pdev, 2), 829 - vmci_interrupt_dma_datagram, 830 - 0, KBUILD_MODNAME, vmci_dev); 836 + error = request_threaded_irq(pci_irq_vector(pdev, 2), 837 + NULL, 838 + vmci_interrupt_dma_datagram, 839 + 0, KBUILD_MODNAME, 840 + vmci_dev); 831 841 if (error) { 832 842 dev_err(&pdev->dev, 833 843 "Failed to allocate irq %u: %d\n", ··· 865 871 866 872 err_free_irq: 867 873 free_irq(pci_irq_vector(pdev, 0), vmci_dev); 868 - tasklet_kill(&vmci_dev->datagram_tasklet); 869 - tasklet_kill(&vmci_dev->bm_tasklet); 870 874 871 875 err_disable_msi: 872 876 pci_free_irq_vectors(pdev); ··· 934 942 } 935 943 free_irq(pci_irq_vector(pdev, 0), vmci_dev); 936 944 pci_free_irq_vectors(pdev); 937 - 938 - tasklet_kill(&vmci_dev->datagram_tasklet); 939 - tasklet_kill(&vmci_dev->bm_tasklet); 940 945 941 946 if (vmci_dev->notification_bitmap) { 942 947 /*
+15 -7
drivers/mmc/host/sdhci-esdhc-imx.c
··· 107 107 #define ESDHC_TUNING_START_TAP_DEFAULT 0x1 108 108 #define ESDHC_TUNING_START_TAP_MASK 0x7f 109 109 #define ESDHC_TUNING_CMD_CRC_CHECK_DISABLE (1 << 7) 110 + #define ESDHC_TUNING_STEP_DEFAULT 0x1 110 111 #define ESDHC_TUNING_STEP_MASK 0x00070000 111 112 #define ESDHC_TUNING_STEP_SHIFT 16 112 113 ··· 1369 1368 struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); 1370 1369 struct pltfm_imx_data *imx_data = sdhci_pltfm_priv(pltfm_host); 1371 1370 struct cqhci_host *cq_host = host->mmc->cqe_private; 1372 - int tmp; 1371 + u32 tmp; 1373 1372 1374 1373 if (esdhc_is_usdhc(imx_data)) { 1375 1374 /* ··· 1424 1423 1425 1424 if (imx_data->socdata->flags & ESDHC_FLAG_STD_TUNING) { 1426 1425 tmp = readl(host->ioaddr + ESDHC_TUNING_CTRL); 1427 - tmp |= ESDHC_STD_TUNING_EN | 1428 - ESDHC_TUNING_START_TAP_DEFAULT; 1429 - if (imx_data->boarddata.tuning_start_tap) { 1430 - tmp &= ~ESDHC_TUNING_START_TAP_MASK; 1426 + tmp |= ESDHC_STD_TUNING_EN; 1427 + 1428 + /* 1429 + * ROM code or bootloader may config the start tap 1430 + * and step, unmask them first. 1431 + */ 1432 + tmp &= ~(ESDHC_TUNING_START_TAP_MASK | ESDHC_TUNING_STEP_MASK); 1433 + if (imx_data->boarddata.tuning_start_tap) 1431 1434 tmp |= imx_data->boarddata.tuning_start_tap; 1432 - } 1435 + else 1436 + tmp |= ESDHC_TUNING_START_TAP_DEFAULT; 1433 1437 1434 1438 if (imx_data->boarddata.tuning_step) { 1435 - tmp &= ~ESDHC_TUNING_STEP_MASK; 1436 1439 tmp |= imx_data->boarddata.tuning_step 1440 + << ESDHC_TUNING_STEP_SHIFT; 1441 + } else { 1442 + tmp |= ESDHC_TUNING_STEP_DEFAULT 1437 1443 << ESDHC_TUNING_STEP_SHIFT; 1438 1444 } 1439 1445
+5 -3
drivers/mmc/host/sunxi-mmc.c
··· 1492 1492 struct sunxi_mmc_host *host = mmc_priv(mmc); 1493 1493 1494 1494 mmc_remove_host(mmc); 1495 - pm_runtime_force_suspend(&pdev->dev); 1496 - disable_irq(host->irq); 1497 - sunxi_mmc_disable(host); 1495 + pm_runtime_disable(&pdev->dev); 1496 + if (!pm_runtime_status_suspended(&pdev->dev)) { 1497 + disable_irq(host->irq); 1498 + sunxi_mmc_disable(host); 1499 + } 1498 1500 dma_free_coherent(&pdev->dev, PAGE_SIZE, host->sg_cpu, host->sg_dma); 1499 1501 mmc_free_host(mmc); 1500 1502
+4 -3
drivers/net/dsa/Kconfig
··· 35 35 the xrx200 / VR9 SoC. 36 36 37 37 config NET_DSA_MT7530 38 - tristate "MediaTek MT753x and MT7621 Ethernet switch support" 38 + tristate "MediaTek MT7530 and MT7531 Ethernet switch support" 39 39 select NET_DSA_TAG_MTK 40 40 select MEDIATEK_GE_PHY 41 41 help 42 - This enables support for the MediaTek MT7530, MT7531, and MT7621 43 - Ethernet switch chips. 42 + This enables support for the MediaTek MT7530 and MT7531 Ethernet 43 + switch chips. Multi-chip module MT7530 in MT7621AT, MT7621DAT, 44 + MT7621ST and MT7623AI SoCs is supported. 44 45 45 46 config NET_DSA_MV88E6060 46 47 tristate "Marvell 88E6060 ethernet switch chip support"
+1 -1
drivers/net/dsa/microchip/ksz9477_i2c.c
··· 104 104 }, 105 105 { 106 106 .compatible = "microchip,ksz8563", 107 - .data = &ksz_switch_chips[KSZ9893] 107 + .data = &ksz_switch_chips[KSZ8563] 108 108 }, 109 109 { 110 110 .compatible = "microchip,ksz9567",
+1 -1
drivers/net/ethernet/adi/adin1110.c
··· 356 356 357 357 if ((port_priv->flags & IFF_ALLMULTI && rxb->pkt_type == PACKET_MULTICAST) || 358 358 (port_priv->flags & IFF_BROADCAST && rxb->pkt_type == PACKET_BROADCAST)) 359 - rxb->offload_fwd_mark = 1; 359 + rxb->offload_fwd_mark = port_priv->priv->forwarding; 360 360 361 361 netif_rx(rxb); 362 362
+4 -4
drivers/net/ethernet/broadcom/tg3.c
··· 11166 11166 rtnl_lock(); 11167 11167 tg3_full_lock(tp, 0); 11168 11168 11169 - if (!netif_running(tp->dev)) { 11169 + if (tp->pcierr_recovery || !netif_running(tp->dev)) { 11170 11170 tg3_flag_clear(tp, RESET_TASK_PENDING); 11171 11171 tg3_full_unlock(tp); 11172 11172 rtnl_unlock(); ··· 18101 18101 18102 18102 netdev_info(netdev, "PCI I/O error detected\n"); 18103 18103 18104 + /* Want to make sure that the reset task doesn't run */ 18105 + tg3_reset_task_cancel(tp); 18106 + 18104 18107 rtnl_lock(); 18105 18108 18106 18109 /* Could be second call or maybe we don't have netdev yet */ ··· 18119 18116 tg3_netif_stop(tp); 18120 18117 18121 18118 tg3_timer_stop(tp); 18122 - 18123 - /* Want to make sure that the reset task doesn't run */ 18124 - tg3_reset_task_cancel(tp); 18125 18119 18126 18120 netif_device_detach(netdev); 18127 18121
+4 -4
drivers/net/ethernet/engleder/tsnep_main.c
··· 458 458 /* ring full, shall not happen because queue is stopped if full 459 459 * below 460 460 */ 461 - netif_stop_queue(tx->adapter->netdev); 461 + netif_stop_subqueue(tx->adapter->netdev, tx->queue_index); 462 462 463 463 return NETDEV_TX_BUSY; 464 464 } ··· 495 495 496 496 if (tsnep_tx_desc_available(tx) < (MAX_SKB_FRAGS + 1)) { 497 497 /* ring can get full with next frame */ 498 - netif_stop_queue(tx->adapter->netdev); 498 + netif_stop_subqueue(tx->adapter->netdev, tx->queue_index); 499 499 } 500 500 501 501 return NETDEV_TX_OK; ··· 701 701 } while (likely(budget)); 702 702 703 703 if ((tsnep_tx_desc_available(tx) >= ((MAX_SKB_FRAGS + 1) * 2)) && 704 - netif_queue_stopped(tx->adapter->netdev)) { 705 - netif_wake_queue(tx->adapter->netdev); 704 + netif_tx_queue_stopped(nq)) { 705 + netif_tx_wake_queue(nq); 706 706 } 707 707 708 708 __netif_tx_unlock(nq);
+3 -3
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c
··· 2410 2410 2411 2411 cleaned = qman_p_poll_dqrr(np->p, budget); 2412 2412 2413 + if (np->xdp_act & XDP_REDIRECT) 2414 + xdp_do_flush(); 2415 + 2413 2416 if (cleaned < budget) { 2414 2417 napi_complete_done(napi, cleaned); 2415 2418 qman_p_irqsource_add(np->p, QM_PIRQ_DQRI); 2416 2419 } else if (np->down) { 2417 2420 qman_p_irqsource_add(np->p, QM_PIRQ_DQRI); 2418 2421 } 2419 - 2420 - if (np->xdp_act & XDP_REDIRECT) 2421 - xdp_do_flush(); 2422 2422 2423 2423 return cleaned; 2424 2424 }
+6 -3
drivers/net/ethernet/freescale/dpaa2/dpaa2-eth.c
··· 1993 1993 if (rx_cleaned >= budget || 1994 1994 txconf_cleaned >= DPAA2_ETH_TXCONF_PER_NAPI) { 1995 1995 work_done = budget; 1996 + if (ch->xdp.res & XDP_REDIRECT) 1997 + xdp_do_flush(); 1996 1998 goto out; 1997 1999 } 1998 2000 } while (store_cleaned); 2001 + 2002 + if (ch->xdp.res & XDP_REDIRECT) 2003 + xdp_do_flush(); 1999 2004 2000 2005 /* Update NET DIM with the values for this CDAN */ 2001 2006 dpaa2_io_update_net_dim(ch->dpio, ch->stats.frames_per_cdan, ··· 2037 2032 txc_fq->dq_bytes = 0; 2038 2033 } 2039 2034 2040 - if (ch->xdp.res & XDP_REDIRECT) 2041 - xdp_do_flush_map(); 2042 - else if (rx_cleaned && ch->xdp.res & XDP_TX) 2035 + if (rx_cleaned && ch->xdp.res & XDP_TX) 2043 2036 dpaa2_eth_xdp_tx_flush(priv, ch, &priv->fq[flowid]); 2044 2037 2045 2038 return work_done;
+1 -1
drivers/net/ethernet/freescale/fec_main.c
··· 3244 3244 for (q = 0; q < fep->num_rx_queues; q++) { 3245 3245 rxq = fep->rx_queue[q]; 3246 3246 for (i = 0; i < rxq->bd.ring_size; i++) 3247 - page_pool_release_page(rxq->page_pool, rxq->rx_skb_info[i].page); 3247 + page_pool_put_full_page(rxq->page_pool, rxq->rx_skb_info[i].page, false); 3248 3248 3249 3249 for (i = 0; i < XDP_STATS_TOTAL; i++) 3250 3250 rxq->stats[i] = 0;
+1 -1
drivers/net/ethernet/intel/iavf/iavf.h
··· 249 249 250 250 /* board specific private data structure */ 251 251 struct iavf_adapter { 252 + struct workqueue_struct *wq; 252 253 struct work_struct reset_task; 253 254 struct work_struct adminq_task; 254 255 struct delayed_work client_task; ··· 460 459 461 460 /* needed by iavf_ethtool.c */ 462 461 extern char iavf_driver_name[]; 463 - extern struct workqueue_struct *iavf_wq; 464 462 465 463 static inline const char *iavf_state_str(enum iavf_state_t state) 466 464 {
+5 -5
drivers/net/ethernet/intel/iavf/iavf_ethtool.c
··· 532 532 if (changed_flags & IAVF_FLAG_LEGACY_RX) { 533 533 if (netif_running(netdev)) { 534 534 adapter->flags |= IAVF_FLAG_RESET_NEEDED; 535 - queue_work(iavf_wq, &adapter->reset_task); 535 + queue_work(adapter->wq, &adapter->reset_task); 536 536 } 537 537 } 538 538 ··· 672 672 673 673 if (netif_running(netdev)) { 674 674 adapter->flags |= IAVF_FLAG_RESET_NEEDED; 675 - queue_work(iavf_wq, &adapter->reset_task); 675 + queue_work(adapter->wq, &adapter->reset_task); 676 676 } 677 677 678 678 return 0; ··· 1433 1433 adapter->aq_required |= IAVF_FLAG_AQ_ADD_FDIR_FILTER; 1434 1434 spin_unlock_bh(&adapter->fdir_fltr_lock); 1435 1435 1436 - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); 1436 + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); 1437 1437 1438 1438 ret: 1439 1439 if (err && fltr) ··· 1474 1474 spin_unlock_bh(&adapter->fdir_fltr_lock); 1475 1475 1476 1476 if (fltr && fltr->state == IAVF_FDIR_FLTR_DEL_REQUEST) 1477 - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); 1477 + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); 1478 1478 1479 1479 return err; 1480 1480 } ··· 1658 1658 spin_unlock_bh(&adapter->adv_rss_lock); 1659 1659 1660 1660 if (!err) 1661 - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); 1661 + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); 1662 1662 1663 1663 mutex_unlock(&adapter->crit_lock); 1664 1664
+51 -62
drivers/net/ethernet/intel/iavf/iavf_main.c
··· 49 49 MODULE_LICENSE("GPL v2"); 50 50 51 51 static const struct net_device_ops iavf_netdev_ops; 52 - struct workqueue_struct *iavf_wq; 53 52 54 53 int iavf_status_to_errno(enum iavf_status status) 55 54 { ··· 276 277 if (!(adapter->flags & 277 278 (IAVF_FLAG_RESET_PENDING | IAVF_FLAG_RESET_NEEDED))) { 278 279 adapter->flags |= IAVF_FLAG_RESET_NEEDED; 279 - queue_work(iavf_wq, &adapter->reset_task); 280 + queue_work(adapter->wq, &adapter->reset_task); 280 281 } 281 282 } 282 283 ··· 290 291 void iavf_schedule_request_stats(struct iavf_adapter *adapter) 291 292 { 292 293 adapter->aq_required |= IAVF_FLAG_AQ_REQUEST_STATS; 293 - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); 294 + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); 294 295 } 295 296 296 297 /** ··· 410 411 411 412 if (adapter->state != __IAVF_REMOVE) 412 413 /* schedule work on the private workqueue */ 413 - queue_work(iavf_wq, &adapter->adminq_task); 414 + queue_work(adapter->wq, &adapter->adminq_task); 414 415 415 416 return IRQ_HANDLED; 416 417 } ··· 1033 1034 1034 1035 /* schedule the watchdog task to immediately process the request */ 1035 1036 if (f) { 1036 - queue_work(iavf_wq, &adapter->watchdog_task.work); 1037 + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); 1037 1038 return 0; 1038 1039 } 1039 1040 return -ENOMEM; ··· 1256 1257 adapter->aq_required |= IAVF_FLAG_AQ_ENABLE_QUEUES; 1257 1258 if (CLIENT_ENABLED(adapter)) 1258 1259 adapter->flags |= IAVF_FLAG_CLIENT_NEEDS_OPEN; 1259 - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); 1260 + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); 1260 1261 } 1261 1262 1262 1263 /** ··· 1413 1414 adapter->aq_required |= IAVF_FLAG_AQ_DISABLE_QUEUES; 1414 1415 } 1415 1416 1416 - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); 1417 + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); 1417 1418 } 1418 1419 1419 1420 /** ··· 2247 2248 2248 2249 if (aq_required) { 2249 2250 adapter->aq_required |= aq_required; 2250 - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 0); 2251 + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 0); 2251 2252 } 2252 2253 } 2253 2254 ··· 2692 2693 goto restart_watchdog; 2693 2694 } 2694 2695 2696 + if ((adapter->flags & IAVF_FLAG_SETUP_NETDEV_FEATURES) && 2697 + adapter->netdev_registered && 2698 + !test_bit(__IAVF_IN_REMOVE_TASK, &adapter->crit_section) && 2699 + rtnl_trylock()) { 2700 + netdev_update_features(adapter->netdev); 2701 + rtnl_unlock(); 2702 + adapter->flags &= ~IAVF_FLAG_SETUP_NETDEV_FEATURES; 2703 + } 2704 + 2695 2705 if (adapter->flags & IAVF_FLAG_PF_COMMS_FAILED) 2696 2706 iavf_change_state(adapter, __IAVF_COMM_FAILED); 2697 2707 ··· 2708 2700 adapter->aq_required = 0; 2709 2701 adapter->current_op = VIRTCHNL_OP_UNKNOWN; 2710 2702 mutex_unlock(&adapter->crit_lock); 2711 - queue_work(iavf_wq, &adapter->reset_task); 2703 + queue_work(adapter->wq, &adapter->reset_task); 2712 2704 return; 2713 2705 } 2714 2706 ··· 2716 2708 case __IAVF_STARTUP: 2717 2709 iavf_startup(adapter); 2718 2710 mutex_unlock(&adapter->crit_lock); 2719 - queue_delayed_work(iavf_wq, &adapter->watchdog_task, 2711 + queue_delayed_work(adapter->wq, &adapter->watchdog_task, 2720 2712 msecs_to_jiffies(30)); 2721 2713 return; 2722 2714 case __IAVF_INIT_VERSION_CHECK: 2723 2715 iavf_init_version_check(adapter); 2724 2716 mutex_unlock(&adapter->crit_lock); 2725 - queue_delayed_work(iavf_wq, &adapter->watchdog_task, 2717 + queue_delayed_work(adapter->wq, &adapter->watchdog_task, 2726 2718 msecs_to_jiffies(30)); 2727 2719 return; 2728 2720 case __IAVF_INIT_GET_RESOURCES: 2729 2721 iavf_init_get_resources(adapter); 2730 2722 mutex_unlock(&adapter->crit_lock); 2731 - queue_delayed_work(iavf_wq, &adapter->watchdog_task, 2723 + queue_delayed_work(adapter->wq, &adapter->watchdog_task, 2732 2724 msecs_to_jiffies(1)); 2733 2725 return; 2734 2726 case __IAVF_INIT_EXTENDED_CAPS: 2735 2727 iavf_init_process_extended_caps(adapter); 2736 2728 mutex_unlock(&adapter->crit_lock); 2737 - queue_delayed_work(iavf_wq, &adapter->watchdog_task, 2729 + queue_delayed_work(adapter->wq, &adapter->watchdog_task, 2738 2730 msecs_to_jiffies(1)); 2739 2731 return; 2740 2732 case __IAVF_INIT_CONFIG_ADAPTER: 2741 2733 iavf_init_config_adapter(adapter); 2742 2734 mutex_unlock(&adapter->crit_lock); 2743 - queue_delayed_work(iavf_wq, &adapter->watchdog_task, 2735 + queue_delayed_work(adapter->wq, &adapter->watchdog_task, 2744 2736 msecs_to_jiffies(1)); 2745 2737 return; 2746 2738 case __IAVF_INIT_FAILED: ··· 2759 2751 adapter->flags |= IAVF_FLAG_PF_COMMS_FAILED; 2760 2752 iavf_shutdown_adminq(hw); 2761 2753 mutex_unlock(&adapter->crit_lock); 2762 - queue_delayed_work(iavf_wq, 2754 + queue_delayed_work(adapter->wq, 2763 2755 &adapter->watchdog_task, (5 * HZ)); 2764 2756 return; 2765 2757 } 2766 2758 /* Try again from failed step*/ 2767 2759 iavf_change_state(adapter, adapter->last_state); 2768 2760 mutex_unlock(&adapter->crit_lock); 2769 - queue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ); 2761 + queue_delayed_work(adapter->wq, &adapter->watchdog_task, HZ); 2770 2762 return; 2771 2763 case __IAVF_COMM_FAILED: 2772 2764 if (test_bit(__IAVF_IN_REMOVE_TASK, ··· 2797 2789 adapter->aq_required = 0; 2798 2790 adapter->current_op = VIRTCHNL_OP_UNKNOWN; 2799 2791 mutex_unlock(&adapter->crit_lock); 2800 - queue_delayed_work(iavf_wq, 2792 + queue_delayed_work(adapter->wq, 2801 2793 &adapter->watchdog_task, 2802 2794 msecs_to_jiffies(10)); 2803 2795 return; 2804 2796 case __IAVF_RESETTING: 2805 2797 mutex_unlock(&adapter->crit_lock); 2806 - queue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ * 2); 2798 + queue_delayed_work(adapter->wq, &adapter->watchdog_task, 2799 + HZ * 2); 2807 2800 return; 2808 2801 case __IAVF_DOWN: 2809 2802 case __IAVF_DOWN_PENDING: ··· 2843 2834 adapter->aq_required = 0; 2844 2835 adapter->current_op = VIRTCHNL_OP_UNKNOWN; 2845 2836 dev_err(&adapter->pdev->dev, "Hardware reset detected\n"); 2846 - queue_work(iavf_wq, &adapter->reset_task); 2837 + queue_work(adapter->wq, &adapter->reset_task); 2847 2838 mutex_unlock(&adapter->crit_lock); 2848 - queue_delayed_work(iavf_wq, 2839 + queue_delayed_work(adapter->wq, 2849 2840 &adapter->watchdog_task, HZ * 2); 2850 2841 return; 2851 2842 } ··· 2854 2845 mutex_unlock(&adapter->crit_lock); 2855 2846 restart_watchdog: 2856 2847 if (adapter->state >= __IAVF_DOWN) 2857 - queue_work(iavf_wq, &adapter->adminq_task); 2848 + queue_work(adapter->wq, &adapter->adminq_task); 2858 2849 if (adapter->aq_required) 2859 - queue_delayed_work(iavf_wq, &adapter->watchdog_task, 2850 + queue_delayed_work(adapter->wq, &adapter->watchdog_task, 2860 2851 msecs_to_jiffies(20)); 2861 2852 else 2862 - queue_delayed_work(iavf_wq, &adapter->watchdog_task, HZ * 2); 2853 + queue_delayed_work(adapter->wq, &adapter->watchdog_task, 2854 + HZ * 2); 2863 2855 } 2864 2856 2865 2857 /** ··· 2962 2952 */ 2963 2953 if (!mutex_trylock(&adapter->crit_lock)) { 2964 2954 if (adapter->state != __IAVF_REMOVE) 2965 - queue_work(iavf_wq, &adapter->reset_task); 2955 + queue_work(adapter->wq, &adapter->reset_task); 2966 2956 2967 2957 goto reset_finish; 2968 2958 } ··· 3126 3116 bitmap_clear(adapter->vsi.active_cvlans, 0, VLAN_N_VID); 3127 3117 bitmap_clear(adapter->vsi.active_svlans, 0, VLAN_N_VID); 3128 3118 3129 - mod_delayed_work(iavf_wq, &adapter->watchdog_task, 2); 3119 + mod_delayed_work(adapter->wq, &adapter->watchdog_task, 2); 3130 3120 3131 3121 /* We were running when the reset started, so we need to restore some 3132 3122 * state here. ··· 3218 3208 if (adapter->state == __IAVF_REMOVE) 3219 3209 return; 3220 3210 3221 - queue_work(iavf_wq, &adapter->adminq_task); 3211 + queue_work(adapter->wq, &adapter->adminq_task); 3222 3212 goto out; 3223 3213 } 3224 3214 ··· 3242 3232 } while (pending); 3243 3233 mutex_unlock(&adapter->crit_lock); 3244 3234 3245 - if ((adapter->flags & IAVF_FLAG_SETUP_NETDEV_FEATURES)) { 3246 - if (adapter->netdev_registered || 3247 - !test_bit(__IAVF_IN_REMOVE_TASK, &adapter->crit_section)) { 3248 - struct net_device *netdev = adapter->netdev; 3249 - 3250 - rtnl_lock(); 3251 - netdev_update_features(netdev); 3252 - rtnl_unlock(); 3253 - /* Request VLAN offload settings */ 3254 - if (VLAN_V2_ALLOWED(adapter)) 3255 - iavf_set_vlan_offload_features 3256 - (adapter, 0, netdev->features); 3257 - 3258 - iavf_set_queue_vlan_tag_loc(adapter); 3259 - } 3260 - 3261 - adapter->flags &= ~IAVF_FLAG_SETUP_NETDEV_FEATURES; 3262 - } 3263 3235 if ((adapter->flags & 3264 3236 (IAVF_FLAG_RESET_PENDING | IAVF_FLAG_RESET_NEEDED)) || 3265 3237 adapter->state == __IAVF_RESETTING) ··· 4341 4349 4342 4350 if (netif_running(netdev)) { 4343 4351 adapter->flags |= IAVF_FLAG_RESET_NEEDED; 4344 - queue_work(iavf_wq, &adapter->reset_task); 4352 + queue_work(adapter->wq, &adapter->reset_task); 4345 4353 } 4346 4354 4347 4355 return 0; ··· 4890 4898 hw = &adapter->hw; 4891 4899 hw->back = adapter; 4892 4900 4901 + adapter->wq = alloc_ordered_workqueue("%s", WQ_MEM_RECLAIM, 4902 + iavf_driver_name); 4903 + if (!adapter->wq) { 4904 + err = -ENOMEM; 4905 + goto err_alloc_wq; 4906 + } 4907 + 4893 4908 adapter->msg_enable = BIT(DEFAULT_DEBUG_LEVEL_SHIFT) - 1; 4894 4909 iavf_change_state(adapter, __IAVF_STARTUP); 4895 4910 ··· 4941 4942 INIT_WORK(&adapter->adminq_task, iavf_adminq_task); 4942 4943 INIT_DELAYED_WORK(&adapter->watchdog_task, iavf_watchdog_task); 4943 4944 INIT_DELAYED_WORK(&adapter->client_task, iavf_client_task); 4944 - queue_delayed_work(iavf_wq, &adapter->watchdog_task, 4945 + queue_delayed_work(adapter->wq, &adapter->watchdog_task, 4945 4946 msecs_to_jiffies(5 * (pdev->devfn & 0x07))); 4946 4947 4947 4948 /* Setup the wait queue for indicating transition to down status */ ··· 4953 4954 return 0; 4954 4955 4955 4956 err_ioremap: 4957 + destroy_workqueue(adapter->wq); 4958 + err_alloc_wq: 4956 4959 free_netdev(netdev); 4957 4960 err_alloc_etherdev: 4958 4961 pci_disable_pcie_error_reporting(pdev); ··· 5024 5023 return err; 5025 5024 } 5026 5025 5027 - queue_work(iavf_wq, &adapter->reset_task); 5026 + queue_work(adapter->wq, &adapter->reset_task); 5028 5027 5029 5028 netif_device_attach(adapter->netdev); 5030 5029 ··· 5171 5170 } 5172 5171 spin_unlock_bh(&adapter->adv_rss_lock); 5173 5172 5173 + destroy_workqueue(adapter->wq); 5174 + 5174 5175 free_netdev(netdev); 5175 5176 5176 5177 pci_disable_pcie_error_reporting(pdev); ··· 5199 5196 **/ 5200 5197 static int __init iavf_init_module(void) 5201 5198 { 5202 - int ret; 5203 - 5204 5199 pr_info("iavf: %s\n", iavf_driver_string); 5205 5200 5206 5201 pr_info("%s\n", iavf_copyright); 5207 5202 5208 - iavf_wq = alloc_workqueue("%s", WQ_UNBOUND | WQ_MEM_RECLAIM, 1, 5209 - iavf_driver_name); 5210 - if (!iavf_wq) { 5211 - pr_err("%s: Failed to create workqueue\n", iavf_driver_name); 5212 - return -ENOMEM; 5213 - } 5214 - 5215 - ret = pci_register_driver(&iavf_driver); 5216 - if (ret) 5217 - destroy_workqueue(iavf_wq); 5218 - 5219 - return ret; 5203 + return pci_register_driver(&iavf_driver); 5220 5204 } 5221 5205 5222 5206 module_init(iavf_init_module); ··· 5217 5227 static void __exit iavf_exit_module(void) 5218 5228 { 5219 5229 pci_unregister_driver(&iavf_driver); 5220 - destroy_workqueue(iavf_wq); 5221 5230 } 5222 5231 5223 5232 module_exit(iavf_exit_module);
+9 -1
drivers/net/ethernet/intel/iavf/iavf_virtchnl.c
··· 1952 1952 if (!(adapter->flags & IAVF_FLAG_RESET_PENDING)) { 1953 1953 adapter->flags |= IAVF_FLAG_RESET_PENDING; 1954 1954 dev_info(&adapter->pdev->dev, "Scheduling reset task\n"); 1955 - queue_work(iavf_wq, &adapter->reset_task); 1955 + queue_work(adapter->wq, &adapter->reset_task); 1956 1956 } 1957 1957 break; 1958 1958 default: ··· 2226 2226 2227 2227 iavf_process_config(adapter); 2228 2228 adapter->flags |= IAVF_FLAG_SETUP_NETDEV_FEATURES; 2229 + 2230 + /* Request VLAN offload settings */ 2231 + if (VLAN_V2_ALLOWED(adapter)) 2232 + iavf_set_vlan_offload_features(adapter, 0, 2233 + netdev->features); 2234 + 2235 + iavf_set_queue_vlan_tag_loc(adapter); 2236 + 2229 2237 was_mac_changed = !ether_addr_equal(netdev->dev_addr, 2230 2238 adapter->hw.mac.addr); 2231 2239
-3
drivers/net/ethernet/intel/ice/ice_lib.c
··· 3235 3235 } 3236 3236 } 3237 3237 3238 - if (vsi->type == ICE_VSI_PF) 3239 - ice_devlink_destroy_pf_port(pf); 3240 - 3241 3238 if (vsi->type == ICE_VSI_VF && 3242 3239 vsi->agg_node && vsi->agg_node->valid) 3243 3240 vsi->agg_node->num_vsis--;
+17 -8
drivers/net/ethernet/intel/ice/ice_main.c
··· 4588 4588 } 4589 4589 4590 4590 /** 4591 - * ice_register_netdev - register netdev and devlink port 4591 + * ice_register_netdev - register netdev 4592 4592 * @pf: pointer to the PF struct 4593 4593 */ 4594 4594 static int ice_register_netdev(struct ice_pf *pf) ··· 4600 4600 if (!vsi || !vsi->netdev) 4601 4601 return -EIO; 4602 4602 4603 - err = ice_devlink_create_pf_port(pf); 4604 - if (err) 4605 - goto err_devlink_create; 4606 - 4607 - SET_NETDEV_DEVLINK_PORT(vsi->netdev, &pf->devlink_port); 4608 4603 err = register_netdev(vsi->netdev); 4609 4604 if (err) 4610 4605 goto err_register_netdev; ··· 4610 4615 4611 4616 return 0; 4612 4617 err_register_netdev: 4613 - ice_devlink_destroy_pf_port(pf); 4614 - err_devlink_create: 4615 4618 free_netdev(vsi->netdev); 4616 4619 vsi->netdev = NULL; 4617 4620 clear_bit(ICE_VSI_NETDEV_ALLOCD, vsi->state); ··· 4627 4634 ice_probe(struct pci_dev *pdev, const struct pci_device_id __always_unused *ent) 4628 4635 { 4629 4636 struct device *dev = &pdev->dev; 4637 + struct ice_vsi *vsi; 4630 4638 struct ice_pf *pf; 4631 4639 struct ice_hw *hw; 4632 4640 int i, err; ··· 4910 4916 pcie_print_link_status(pf->pdev); 4911 4917 4912 4918 probe_done: 4919 + err = ice_devlink_create_pf_port(pf); 4920 + if (err) 4921 + goto err_create_pf_port; 4922 + 4923 + vsi = ice_get_main_vsi(pf); 4924 + if (!vsi || !vsi->netdev) { 4925 + err = -EINVAL; 4926 + goto err_netdev_reg; 4927 + } 4928 + 4929 + SET_NETDEV_DEVLINK_PORT(vsi->netdev, &pf->devlink_port); 4930 + 4913 4931 err = ice_register_netdev(pf); 4914 4932 if (err) 4915 4933 goto err_netdev_reg; ··· 4959 4953 err_devlink_reg_param: 4960 4954 ice_devlink_unregister_params(pf); 4961 4955 err_netdev_reg: 4956 + ice_devlink_destroy_pf_port(pf); 4957 + err_create_pf_port: 4962 4958 err_send_version_unroll: 4963 4959 ice_vsi_release_all(pf); 4964 4960 err_alloc_sw_unroll: ··· 5092 5084 ice_setup_mc_magic_wake(pf); 5093 5085 ice_vsi_release_all(pf); 5094 5086 mutex_destroy(&hw->fdir_fltr_lock); 5087 + ice_devlink_destroy_pf_port(pf); 5095 5088 ice_set_wake(pf); 5096 5089 ice_free_irq_msix_misc(pf); 5097 5090 ice_for_each_vsi(pf, i) {
+3 -3
drivers/net/ethernet/microchip/lan966x/lan966x_fdma.c
··· 608 608 lan966x_fdma_rx_reload(rx); 609 609 } 610 610 611 - if (counter < weight && napi_complete_done(napi, counter)) 612 - lan_wr(0xff, lan966x, FDMA_INTR_DB_ENA); 613 - 614 611 if (redirect) 615 612 xdp_do_flush(); 613 + 614 + if (counter < weight && napi_complete_done(napi, counter)) 615 + lan_wr(0xff, lan966x, FDMA_INTR_DB_ENA); 616 616 617 617 return counter; 618 618 }
+8 -1
drivers/net/ethernet/microsoft/mana/gdma_main.c
··· 1259 1259 gic->handler = NULL; 1260 1260 gic->arg = NULL; 1261 1261 1262 + if (!i) 1263 + snprintf(gic->name, MANA_IRQ_NAME_SZ, "mana_hwc@pci:%s", 1264 + pci_name(pdev)); 1265 + else 1266 + snprintf(gic->name, MANA_IRQ_NAME_SZ, "mana_q%d@pci:%s", 1267 + i - 1, pci_name(pdev)); 1268 + 1262 1269 irq = pci_irq_vector(pdev, i); 1263 1270 if (irq < 0) { 1264 1271 err = irq; 1265 1272 goto free_mask; 1266 1273 } 1267 1274 1268 - err = request_irq(irq, mana_gd_intr, 0, "mana_intr", gic); 1275 + err = request_irq(irq, mana_gd_intr, 0, gic->name, gic); 1269 1276 if (err) 1270 1277 goto free_mask; 1271 1278 irq_set_affinity_and_hint(irq, req_mask);
+4 -3
drivers/net/ethernet/qlogic/qede/qede_fp.c
··· 1438 1438 rx_work_done = (likely(fp->type & QEDE_FASTPATH_RX) && 1439 1439 qede_has_rx_work(fp->rxq)) ? 1440 1440 qede_rx_int(fp, budget) : 0; 1441 + 1442 + if (fp->xdp_xmit & QEDE_XDP_REDIRECT) 1443 + xdp_do_flush(); 1444 + 1441 1445 /* Handle case where we are called by netpoll with a budget of 0 */ 1442 1446 if (rx_work_done < budget || !budget) { 1443 1447 if (!qede_poll_is_more_work(fp)) { ··· 1460 1456 fp->xdp_tx->tx_db.data.bd_prod = cpu_to_le16(xdp_prod); 1461 1457 qede_update_tx_producer(fp->xdp_tx); 1462 1458 } 1463 - 1464 - if (fp->xdp_xmit & QEDE_XDP_REDIRECT) 1465 - xdp_do_flush_map(); 1466 1459 1467 1460 return rx_work_done; 1468 1461 }
+8 -2
drivers/net/ethernet/renesas/ravb_main.c
··· 1101 1101 ravb_write(ndev, ~(EIS_QFS | EIS_RESERVED), EIS); 1102 1102 if (eis & EIS_QFS) { 1103 1103 ris2 = ravb_read(ndev, RIS2); 1104 - ravb_write(ndev, ~(RIS2_QFF0 | RIS2_RFFF | RIS2_RESERVED), 1104 + ravb_write(ndev, ~(RIS2_QFF0 | RIS2_QFF1 | RIS2_RFFF | RIS2_RESERVED), 1105 1105 RIS2); 1106 1106 1107 1107 /* Receive Descriptor Empty int */ 1108 1108 if (ris2 & RIS2_QFF0) 1109 1109 priv->stats[RAVB_BE].rx_over_errors++; 1110 1110 1111 - /* Receive Descriptor Empty int */ 1111 + /* Receive Descriptor Empty int */ 1112 1112 if (ris2 & RIS2_QFF1) 1113 1113 priv->stats[RAVB_NC].rx_over_errors++; 1114 1114 ··· 2973 2973 else 2974 2974 ret = ravb_close(ndev); 2975 2975 2976 + if (priv->info->ccc_gac) 2977 + ravb_ptp_stop(ndev); 2978 + 2976 2979 return ret; 2977 2980 } 2978 2981 ··· 3013 3010 3014 3011 /* Restore descriptor base address table */ 3015 3012 ravb_write(ndev, priv->desc_bat_dma, DBAT); 3013 + 3014 + if (priv->info->ccc_gac) 3015 + ravb_ptp_init(ndev, priv->pdev); 3016 3016 3017 3017 if (netif_running(ndev)) { 3018 3018 if (priv->wol_enabled) {
+13 -9
drivers/net/ethernet/renesas/rswitch.c
··· 1058 1058 port = NULL; 1059 1059 goto out; 1060 1060 } 1061 - if (index == rdev->etha->index) 1061 + if (index == rdev->etha->index) { 1062 + if (!of_device_is_available(port)) 1063 + port = NULL; 1062 1064 break; 1065 + } 1063 1066 } 1064 1067 1065 1068 out: ··· 1093 1090 1094 1091 port = rswitch_get_port_node(rdev); 1095 1092 if (!port) 1096 - return -ENODEV; 1093 + return 0; /* ignored */ 1097 1094 1098 1095 err = of_get_phy_mode(port, &rdev->etha->phy_interface); 1099 1096 of_node_put(port); ··· 1311 1308 { 1312 1309 int i, err; 1313 1310 1314 - for (i = 0; i < RSWITCH_NUM_PORTS; i++) { 1311 + rswitch_for_each_enabled_port(priv, i) { 1315 1312 err = rswitch_ether_port_init_one(priv->rdev[i]); 1316 1313 if (err) 1317 1314 goto err_init_one; 1318 1315 } 1319 1316 1320 - for (i = 0; i < RSWITCH_NUM_PORTS; i++) { 1317 + rswitch_for_each_enabled_port(priv, i) { 1321 1318 err = rswitch_serdes_init(priv->rdev[i]); 1322 1319 if (err) 1323 1320 goto err_serdes; ··· 1326 1323 return 0; 1327 1324 1328 1325 err_serdes: 1329 - for (i--; i >= 0; i--) 1326 + rswitch_for_each_enabled_port_continue_reverse(priv, i) 1330 1327 rswitch_serdes_deinit(priv->rdev[i]); 1331 1328 i = RSWITCH_NUM_PORTS; 1332 1329 1333 1330 err_init_one: 1334 - for (i--; i >= 0; i--) 1331 + rswitch_for_each_enabled_port_continue_reverse(priv, i) 1335 1332 rswitch_ether_port_deinit_one(priv->rdev[i]); 1336 1333 1337 1334 return err; ··· 1595 1592 netif_napi_add(ndev, &rdev->napi, rswitch_poll); 1596 1593 1597 1594 port = rswitch_get_port_node(rdev); 1595 + rdev->disabled = !port; 1598 1596 err = of_get_ethdev_address(port, ndev); 1599 1597 of_node_put(port); 1600 1598 if (err) { ··· 1695 1691 if (err) 1696 1692 goto err_ether_port_init_all; 1697 1693 1698 - for (i = 0; i < RSWITCH_NUM_PORTS; i++) { 1694 + rswitch_for_each_enabled_port(priv, i) { 1699 1695 err = register_netdev(priv->rdev[i]->ndev); 1700 1696 if (err) { 1701 - for (i--; i >= 0; i--) 1697 + rswitch_for_each_enabled_port_continue_reverse(priv, i) 1702 1698 unregister_netdev(priv->rdev[i]->ndev); 1703 1699 goto err_register_netdev; 1704 1700 } 1705 1701 } 1706 1702 1707 - for (i = 0; i < RSWITCH_NUM_PORTS; i++) 1703 + rswitch_for_each_enabled_port(priv, i) 1708 1704 netdev_info(priv->rdev[i]->ndev, "MAC address %pM\n", 1709 1705 priv->rdev[i]->ndev->dev_addr); 1710 1706
+12
drivers/net/ethernet/renesas/rswitch.h
··· 13 13 #define RSWITCH_MAX_NUM_QUEUES 128 14 14 15 15 #define RSWITCH_NUM_PORTS 3 16 + #define rswitch_for_each_enabled_port(priv, i) \ 17 + for (i = 0; i < RSWITCH_NUM_PORTS; i++) \ 18 + if (priv->rdev[i]->disabled) \ 19 + continue; \ 20 + else 21 + 22 + #define rswitch_for_each_enabled_port_continue_reverse(priv, i) \ 23 + for (i--; i >= 0; i--) \ 24 + if (priv->rdev[i]->disabled) \ 25 + continue; \ 26 + else 16 27 17 28 #define TX_RING_SIZE 1024 18 29 #define RX_RING_SIZE 1024 ··· 949 938 struct rswitch_gwca_queue *tx_queue; 950 939 struct rswitch_gwca_queue *rx_queue; 951 940 u8 ts_tag; 941 + bool disabled; 952 942 953 943 int port; 954 944 struct rswitch_etha *etha;
+16 -7
drivers/net/mdio/mdio-mux-meson-g12a.c
··· 4 4 */ 5 5 6 6 #include <linux/bitfield.h> 7 + #include <linux/delay.h> 7 8 #include <linux/clk.h> 8 9 #include <linux/clk-provider.h> 9 10 #include <linux/device.h> ··· 150 149 151 150 static int g12a_enable_internal_mdio(struct g12a_mdio_mux *priv) 152 151 { 152 + u32 value; 153 153 int ret; 154 154 155 155 /* Enable the phy clock */ ··· 164 162 165 163 /* Initialize ephy control */ 166 164 writel(EPHY_G12A_ID, priv->regs + ETH_PHY_CNTL0); 167 - writel(FIELD_PREP(PHY_CNTL1_ST_MODE, 3) | 168 - FIELD_PREP(PHY_CNTL1_ST_PHYADD, EPHY_DFLT_ADD) | 169 - FIELD_PREP(PHY_CNTL1_MII_MODE, EPHY_MODE_RMII) | 170 - PHY_CNTL1_CLK_EN | 171 - PHY_CNTL1_CLKFREQ | 172 - PHY_CNTL1_PHY_ENB, 173 - priv->regs + ETH_PHY_CNTL1); 165 + 166 + /* Make sure we get a 0 -> 1 transition on the enable bit */ 167 + value = FIELD_PREP(PHY_CNTL1_ST_MODE, 3) | 168 + FIELD_PREP(PHY_CNTL1_ST_PHYADD, EPHY_DFLT_ADD) | 169 + FIELD_PREP(PHY_CNTL1_MII_MODE, EPHY_MODE_RMII) | 170 + PHY_CNTL1_CLK_EN | 171 + PHY_CNTL1_CLKFREQ; 172 + writel(value, priv->regs + ETH_PHY_CNTL1); 174 173 writel(PHY_CNTL2_USE_INTERNAL | 175 174 PHY_CNTL2_SMI_SRC_MAC | 176 175 PHY_CNTL2_RX_CLK_EPHY, 177 176 priv->regs + ETH_PHY_CNTL2); 177 + 178 + value |= PHY_CNTL1_PHY_ENB; 179 + writel(value, priv->regs + ETH_PHY_CNTL1); 180 + 181 + /* The phy needs a bit of time to power up */ 182 + mdelay(10); 178 183 179 184 return 0; 180 185 }
+3 -3
drivers/net/virtio_net.c
··· 1798 1798 1799 1799 received = virtnet_receive(rq, budget, &xdp_xmit); 1800 1800 1801 + if (xdp_xmit & VIRTIO_XDP_REDIR) 1802 + xdp_do_flush(); 1803 + 1801 1804 /* Out of packets? */ 1802 1805 if (received < budget) 1803 1806 virtqueue_napi_complete(napi, rq->vq, received); 1804 - 1805 - if (xdp_xmit & VIRTIO_XDP_REDIR) 1806 - xdp_do_flush(); 1807 1807 1808 1808 if (xdp_xmit & VIRTIO_XDP_TX) { 1809 1809 sq = virtnet_xdp_get_sq(vi);
+20 -4
drivers/nvme/host/apple.c
··· 829 829 apple_nvme_remove_cq(anv); 830 830 } 831 831 832 - nvme_disable_ctrl(&anv->ctrl, shutdown); 832 + /* 833 + * Always disable the NVMe controller after shutdown. 834 + * We need to do this to bring it back up later anyway, and we 835 + * can't do it while the firmware is not running (e.g. in the 836 + * resume reset path before RTKit is initialized), so for Apple 837 + * controllers it makes sense to unconditionally do it here. 838 + * Additionally, this sequence of events is reliable, while 839 + * others (like disabling after bringing back the firmware on 840 + * resume) seem to run into trouble under some circumstances. 841 + * 842 + * Both U-Boot and m1n1 also use this convention (i.e. an ANS 843 + * NVMe controller is handed off with firmware shut down, in an 844 + * NVMe disabled state, after a clean shutdown). 845 + */ 846 + if (shutdown) 847 + nvme_disable_ctrl(&anv->ctrl, shutdown); 848 + nvme_disable_ctrl(&anv->ctrl, false); 833 849 } 834 850 835 851 WRITE_ONCE(anv->ioq.enabled, false); ··· 1001 985 goto out; 1002 986 } 1003 987 1004 - if (anv->ctrl.ctrl_config & NVME_CC_ENABLE) 1005 - apple_nvme_disable(anv, false); 1006 - 1007 988 /* RTKit must be shut down cleanly for the (soft)-reset to work */ 1008 989 if (apple_rtkit_is_running(anv->rtk)) { 990 + /* reset the controller if it is enabled */ 991 + if (anv->ctrl.ctrl_config & NVME_CC_ENABLE) 992 + apple_nvme_disable(anv, false); 1009 993 dev_dbg(anv->dev, "Trying to shut down RTKit before reset."); 1010 994 ret = apple_rtkit_shutdown(anv->rtk); 1011 995 if (ret)
+1 -1
drivers/nvme/host/pci.c
··· 1362 1362 else 1363 1363 nvme_poll_irqdisable(nvmeq); 1364 1364 1365 - if (blk_mq_request_completed(req)) { 1365 + if (blk_mq_rq_state(req) != MQ_RQ_IN_FLIGHT) { 1366 1366 dev_warn(dev->ctrl.device, 1367 1367 "I/O %d QID %d timeout, completion polled\n", 1368 1368 req->tag, nvmeq->qid);
+1 -1
drivers/phy/freescale/phy-fsl-imx8m-pcie.c
··· 255 255 imx8_phy->perst = 256 256 devm_reset_control_get_exclusive(dev, "perst"); 257 257 if (IS_ERR(imx8_phy->perst)) 258 - dev_err_probe(dev, PTR_ERR(imx8_phy->perst), 258 + return dev_err_probe(dev, PTR_ERR(imx8_phy->perst), 259 259 "Failed to get PCIE PHY PERST control\n"); 260 260 } 261 261
+3 -2
drivers/phy/phy-can-transceiver.c
··· 99 99 struct gpio_desc *standby_gpio; 100 100 struct gpio_desc *enable_gpio; 101 101 u32 max_bitrate = 0; 102 + int err; 102 103 103 104 can_transceiver_phy = devm_kzalloc(dev, sizeof(struct can_transceiver_phy), GFP_KERNEL); 104 105 if (!can_transceiver_phy) ··· 125 124 return PTR_ERR(phy); 126 125 } 127 126 128 - device_property_read_u32(dev, "max-bitrate", &max_bitrate); 129 - if (!max_bitrate) 127 + err = device_property_read_u32(dev, "max-bitrate", &max_bitrate); 128 + if ((err != -EINVAL) && !max_bitrate) 130 129 dev_warn(dev, "Invalid value for transceiver max bitrate. Ignoring bitrate limit\n"); 131 130 phy->attrs.max_link_rate = max_bitrate; 132 131
-13
drivers/phy/qualcomm/phy-qcom-usb-hs-28nm.c
··· 401 401 HSPHY_INIT_CFG(0x90, 0x60, 0), 402 402 }; 403 403 404 - static const struct hsphy_init_seq init_seq_mdm9607[] = { 405 - HSPHY_INIT_CFG(0x80, 0x44, 0), 406 - HSPHY_INIT_CFG(0x81, 0x38, 0), 407 - HSPHY_INIT_CFG(0x82, 0x24, 0), 408 - HSPHY_INIT_CFG(0x83, 0x13, 0), 409 - }; 410 - 411 404 static const struct hsphy_data hsphy_data_femtophy = { 412 405 .init_seq = init_seq_femtophy, 413 406 .init_seq_num = ARRAY_SIZE(init_seq_femtophy), 414 407 }; 415 408 416 - static const struct hsphy_data hsphy_data_mdm9607 = { 417 - .init_seq = init_seq_mdm9607, 418 - .init_seq_num = ARRAY_SIZE(init_seq_mdm9607), 419 - }; 420 - 421 409 static const struct of_device_id qcom_snps_hsphy_match[] = { 422 410 { .compatible = "qcom,usb-hs-28nm-femtophy", .data = &hsphy_data_femtophy, }, 423 - { .compatible = "qcom,usb-hs-28nm-mdm9607", .data = &hsphy_data_mdm9607, }, 424 411 { }, 425 412 }; 426 413 MODULE_DEVICE_TABLE(of, qcom_snps_hsphy_match);
+1 -1
drivers/phy/renesas/r8a779f0-ether-serdes.c
··· 126 126 r8a779f0_eth_serdes_write32(channel->addr, 0x0160, 0x180, 0x0007); 127 127 r8a779f0_eth_serdes_write32(channel->addr, 0x01ac, 0x180, 0x0000); 128 128 r8a779f0_eth_serdes_write32(channel->addr, 0x00c4, 0x180, 0x0310); 129 - r8a779f0_eth_serdes_write32(channel->addr, 0x00c8, 0x380, 0x0101); 129 + r8a779f0_eth_serdes_write32(channel->addr, 0x00c8, 0x180, 0x0101); 130 130 ret = r8a779f0_eth_serdes_reg_wait(channel, 0x00c8, 0x0180, BIT(0), 0); 131 131 if (ret) 132 132 return ret;
+3 -1
drivers/phy/rockchip/phy-rockchip-inno-usb2.c
··· 485 485 return ret; 486 486 487 487 ret = property_enable(base, &rport->port_cfg->phy_sus, false); 488 - if (ret) 488 + if (ret) { 489 + clk_disable_unprepare(rphy->clk480m); 489 490 return ret; 491 + } 490 492 491 493 /* waiting for the utmi_clk to become stable */ 492 494 usleep_range(1500, 2000);
+3
drivers/phy/sunplus/phy-sunplus-usb2.c
··· 254 254 return PTR_ERR(usbphy->phy_regs); 255 255 256 256 usbphy->moon4_res_mem = platform_get_resource_byname(pdev, IORESOURCE_MEM, "moon4"); 257 + if (!usbphy->moon4_res_mem) 258 + return -EINVAL; 259 + 257 260 usbphy->moon4_regs = devm_ioremap(&pdev->dev, usbphy->moon4_res_mem->start, 258 261 resource_size(usbphy->moon4_res_mem)); 259 262 if (!usbphy->moon4_regs)
+2 -2
drivers/phy/ti/Kconfig
··· 23 23 24 24 config PHY_AM654_SERDES 25 25 tristate "TI AM654 SERDES support" 26 - depends on OF && ARCH_K3 || COMPILE_TEST 26 + depends on OF && (ARCH_K3 || COMPILE_TEST) 27 27 depends on COMMON_CLK 28 28 select GENERIC_PHY 29 29 select MULTIPLEXER ··· 35 35 36 36 config PHY_J721E_WIZ 37 37 tristate "TI J721E WIZ (SERDES Wrapper) support" 38 - depends on OF && ARCH_K3 || COMPILE_TEST 38 + depends on OF && (ARCH_K3 || COMPILE_TEST) 39 39 depends on HAS_IOMEM && OF_ADDRESS 40 40 depends on COMMON_CLK 41 41 select GENERIC_PHY
+2 -1
drivers/pinctrl/nomadik/pinctrl-ab8500.c
··· 6 6 */ 7 7 8 8 #include <linux/kernel.h> 9 - #include <linux/gpio/driver.h> 10 9 #include <linux/pinctrl/pinctrl.h> 10 + 11 11 #include <linux/mfd/abx500/ab8500.h> 12 + 12 13 #include "pinctrl-abx500.h" 13 14 14 15 /* All the pins that can be used for GPIO and some other functions */
+2 -1
drivers/pinctrl/nomadik/pinctrl-ab8505.c
··· 6 6 */ 7 7 8 8 #include <linux/kernel.h> 9 - #include <linux/gpio/driver.h> 10 9 #include <linux/pinctrl/pinctrl.h> 10 + 11 11 #include <linux/mfd/abx500/ab8500.h> 12 + 12 13 #include "pinctrl-abx500.h" 13 14 14 15 /* All the pins that can be used for GPIO and some other functions */
+20 -16
drivers/pinctrl/nomadik/pinctrl-abx500.c
··· 6 6 * 7 7 * Driver allows to use AxB5xx unused pins to be used as GPIO 8 8 */ 9 - #include <linux/kernel.h> 10 - #include <linux/types.h> 11 - #include <linux/slab.h> 12 - #include <linux/init.h> 9 + #include <linux/bitops.h> 13 10 #include <linux/err.h> 11 + #include <linux/gpio/driver.h> 12 + #include <linux/init.h> 13 + #include <linux/interrupt.h> 14 + #include <linux/irq.h> 15 + #include <linux/irqdomain.h> 16 + #include <linux/kernel.h> 14 17 #include <linux/of.h> 15 18 #include <linux/of_device.h> 16 19 #include <linux/platform_device.h> 17 - #include <linux/gpio/driver.h> 18 - #include <linux/irq.h> 19 - #include <linux/irqdomain.h> 20 - #include <linux/interrupt.h> 21 - #include <linux/bitops.h> 20 + #include <linux/seq_file.h> 21 + #include <linux/slab.h> 22 + #include <linux/types.h> 23 + 22 24 #include <linux/mfd/abx500.h> 23 25 #include <linux/mfd/abx500/ab8500.h> 24 - #include <linux/pinctrl/pinctrl.h> 25 - #include <linux/pinctrl/consumer.h> 26 - #include <linux/pinctrl/pinmux.h> 27 - #include <linux/pinctrl/pinconf.h> 28 - #include <linux/pinctrl/pinconf-generic.h> 29 - #include <linux/pinctrl/machine.h> 30 26 31 - #include "pinctrl-abx500.h" 27 + #include <linux/pinctrl/consumer.h> 28 + #include <linux/pinctrl/machine.h> 29 + #include <linux/pinctrl/pinconf-generic.h> 30 + #include <linux/pinctrl/pinconf.h> 31 + #include <linux/pinctrl/pinctrl.h> 32 + #include <linux/pinctrl/pinmux.h> 33 + 32 34 #include "../core.h" 33 35 #include "../pinconf.h" 34 36 #include "../pinctrl-utils.h" 37 + 38 + #include "pinctrl-abx500.h" 35 39 36 40 /* 37 41 * GPIO registers offset
+4
drivers/pinctrl/nomadik/pinctrl-abx500.h
··· 2 2 #ifndef PINCTRL_PINCTRL_ABx500_H 3 3 #define PINCTRL_PINCTRL_ABx500_H 4 4 5 + #include <linux/types.h> 6 + 7 + struct pinctrl_pin_desc; 8 + 5 9 /* Package definitions */ 6 10 #define PINCTRL_AB8500 0 7 11 #define PINCTRL_AB8505 1
+3
drivers/pinctrl/nomadik/pinctrl-nomadik-db8500.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <linux/kernel.h> 3 + #include <linux/types.h> 4 + 3 5 #include <linux/pinctrl/pinctrl.h> 6 + 4 7 #include "pinctrl-nomadik.h" 5 8 6 9 /* All the pins that can be used for GPIO and some other functions */
+3
drivers/pinctrl/nomadik/pinctrl-nomadik-stn8815.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 2 #include <linux/kernel.h> 3 + #include <linux/types.h> 4 + 3 5 #include <linux/pinctrl/pinctrl.h> 6 + 4 7 #include "pinctrl-nomadik.h" 5 8 6 9 /* All the pins that can be used for GPIO and some other functions */
+18 -16
drivers/pinctrl/nomadik/pinctrl-nomadik.c
··· 7 7 * Rewritten based on work by Prafulla WADASKAR <prafulla.wadaskar@st.com> 8 8 * Copyright (C) 2011-2013 Linus Walleij <linus.walleij@linaro.org> 9 9 */ 10 - #include <linux/kernel.h> 11 - #include <linux/init.h> 12 - #include <linux/device.h> 13 - #include <linux/platform_device.h> 14 - #include <linux/io.h> 10 + #include <linux/bitops.h> 15 11 #include <linux/clk.h> 12 + #include <linux/device.h> 16 13 #include <linux/err.h> 17 14 #include <linux/gpio/driver.h> 18 - #include <linux/spinlock.h> 15 + #include <linux/init.h> 19 16 #include <linux/interrupt.h> 20 - #include <linux/slab.h> 21 - #include <linux/of_device.h> 17 + #include <linux/io.h> 18 + #include <linux/kernel.h> 22 19 #include <linux/of_address.h> 23 - #include <linux/bitops.h> 24 - #include <linux/pinctrl/machine.h> 25 - #include <linux/pinctrl/pinctrl.h> 26 - #include <linux/pinctrl/pinmux.h> 27 - #include <linux/pinctrl/pinconf.h> 20 + #include <linux/of_device.h> 21 + #include <linux/platform_device.h> 22 + #include <linux/seq_file.h> 23 + #include <linux/slab.h> 24 + #include <linux/spinlock.h> 25 + 28 26 /* Since we request GPIOs from ourself */ 29 27 #include <linux/pinctrl/consumer.h> 30 - #include "pinctrl-nomadik.h" 28 + #include <linux/pinctrl/machine.h> 29 + #include <linux/pinctrl/pinconf.h> 30 + #include <linux/pinctrl/pinctrl.h> 31 + #include <linux/pinctrl/pinmux.h> 32 + 31 33 #include "../core.h" 32 34 #include "../pinctrl-utils.h" 35 + 36 + #include "pinctrl-nomadik.h" 33 37 34 38 /* 35 39 * The GPIO module in the Nomadik family of Systems-on-Chip is an ··· 910 906 911 907 return (afunc ? NMK_GPIO_ALT_A : 0) | (bfunc ? NMK_GPIO_ALT_B : 0); 912 908 } 913 - 914 - #include <linux/seq_file.h> 915 909 916 910 static void nmk_gpio_dbg_show_one(struct seq_file *s, 917 911 struct pinctrl_dev *pctldev, struct gpio_chip *chip,
+5
drivers/pinctrl/nomadik/pinctrl-nomadik.h
··· 2 2 #ifndef PINCTRL_PINCTRL_NOMADIK_H 3 3 #define PINCTRL_PINCTRL_NOMADIK_H 4 4 5 + #include <linux/kernel.h> 6 + #include <linux/types.h> 7 + 8 + #include <linux/pinctrl/pinctrl.h> 9 + 5 10 /* Package definitions */ 6 11 #define PINCTRL_NMK_STN8815 0 7 12 #define PINCTRL_NMK_DB8500 1
+20 -11
drivers/pinctrl/pinctrl-rockchip.c
··· 926 926 RK_MUXROUTE_PMU(0, RK_PB5, 4, 0x0110, WRITE_MASK_VAL(3, 2, 1)), /* PWM1 IO mux M1 */ 927 927 RK_MUXROUTE_PMU(0, RK_PC1, 1, 0x0110, WRITE_MASK_VAL(5, 4, 0)), /* PWM2 IO mux M0 */ 928 928 RK_MUXROUTE_PMU(0, RK_PB6, 4, 0x0110, WRITE_MASK_VAL(5, 4, 1)), /* PWM2 IO mux M1 */ 929 - RK_MUXROUTE_PMU(0, RK_PB3, 2, 0x0300, WRITE_MASK_VAL(0, 0, 0)), /* CAN0 IO mux M0 */ 929 + RK_MUXROUTE_GRF(0, RK_PB3, 2, 0x0300, WRITE_MASK_VAL(0, 0, 0)), /* CAN0 IO mux M0 */ 930 930 RK_MUXROUTE_GRF(2, RK_PA1, 4, 0x0300, WRITE_MASK_VAL(0, 0, 1)), /* CAN0 IO mux M1 */ 931 931 RK_MUXROUTE_GRF(1, RK_PA1, 3, 0x0300, WRITE_MASK_VAL(2, 2, 0)), /* CAN1 IO mux M0 */ 932 932 RK_MUXROUTE_GRF(4, RK_PC3, 3, 0x0300, WRITE_MASK_VAL(2, 2, 1)), /* CAN1 IO mux M1 */ 933 933 RK_MUXROUTE_GRF(4, RK_PB5, 3, 0x0300, WRITE_MASK_VAL(4, 4, 0)), /* CAN2 IO mux M0 */ 934 934 RK_MUXROUTE_GRF(2, RK_PB2, 4, 0x0300, WRITE_MASK_VAL(4, 4, 1)), /* CAN2 IO mux M1 */ 935 935 RK_MUXROUTE_GRF(4, RK_PC4, 1, 0x0300, WRITE_MASK_VAL(6, 6, 0)), /* HPDIN IO mux M0 */ 936 - RK_MUXROUTE_PMU(0, RK_PC2, 2, 0x0300, WRITE_MASK_VAL(6, 6, 1)), /* HPDIN IO mux M1 */ 936 + RK_MUXROUTE_GRF(0, RK_PC2, 2, 0x0300, WRITE_MASK_VAL(6, 6, 1)), /* HPDIN IO mux M1 */ 937 937 RK_MUXROUTE_GRF(3, RK_PB1, 3, 0x0300, WRITE_MASK_VAL(8, 8, 0)), /* GMAC1 IO mux M0 */ 938 938 RK_MUXROUTE_GRF(4, RK_PA7, 3, 0x0300, WRITE_MASK_VAL(8, 8, 1)), /* GMAC1 IO mux M1 */ 939 939 RK_MUXROUTE_GRF(4, RK_PD1, 1, 0x0300, WRITE_MASK_VAL(10, 10, 0)), /* HDMITX IO mux M0 */ 940 - RK_MUXROUTE_PMU(0, RK_PC7, 1, 0x0300, WRITE_MASK_VAL(10, 10, 1)), /* HDMITX IO mux M1 */ 941 - RK_MUXROUTE_PMU(0, RK_PB6, 1, 0x0300, WRITE_MASK_VAL(14, 14, 0)), /* I2C2 IO mux M0 */ 940 + RK_MUXROUTE_GRF(0, RK_PC7, 1, 0x0300, WRITE_MASK_VAL(10, 10, 1)), /* HDMITX IO mux M1 */ 941 + RK_MUXROUTE_GRF(0, RK_PB6, 1, 0x0300, WRITE_MASK_VAL(14, 14, 0)), /* I2C2 IO mux M0 */ 942 942 RK_MUXROUTE_GRF(4, RK_PB4, 1, 0x0300, WRITE_MASK_VAL(14, 14, 1)), /* I2C2 IO mux M1 */ 943 943 RK_MUXROUTE_GRF(1, RK_PA0, 1, 0x0304, WRITE_MASK_VAL(0, 0, 0)), /* I2C3 IO mux M0 */ 944 944 RK_MUXROUTE_GRF(3, RK_PB6, 4, 0x0304, WRITE_MASK_VAL(0, 0, 1)), /* I2C3 IO mux M1 */ ··· 964 964 RK_MUXROUTE_GRF(4, RK_PC3, 1, 0x0308, WRITE_MASK_VAL(12, 12, 1)), /* PWM15 IO mux M1 */ 965 965 RK_MUXROUTE_GRF(3, RK_PD2, 3, 0x0308, WRITE_MASK_VAL(14, 14, 0)), /* SDMMC2 IO mux M0 */ 966 966 RK_MUXROUTE_GRF(3, RK_PA5, 5, 0x0308, WRITE_MASK_VAL(14, 14, 1)), /* SDMMC2 IO mux M1 */ 967 - RK_MUXROUTE_PMU(0, RK_PB5, 2, 0x030c, WRITE_MASK_VAL(0, 0, 0)), /* SPI0 IO mux M0 */ 967 + RK_MUXROUTE_GRF(0, RK_PB5, 2, 0x030c, WRITE_MASK_VAL(0, 0, 0)), /* SPI0 IO mux M0 */ 968 968 RK_MUXROUTE_GRF(2, RK_PD3, 3, 0x030c, WRITE_MASK_VAL(0, 0, 1)), /* SPI0 IO mux M1 */ 969 969 RK_MUXROUTE_GRF(2, RK_PB5, 3, 0x030c, WRITE_MASK_VAL(2, 2, 0)), /* SPI1 IO mux M0 */ 970 970 RK_MUXROUTE_GRF(3, RK_PC3, 3, 0x030c, WRITE_MASK_VAL(2, 2, 1)), /* SPI1 IO mux M1 */ ··· 973 973 RK_MUXROUTE_GRF(4, RK_PB3, 4, 0x030c, WRITE_MASK_VAL(6, 6, 0)), /* SPI3 IO mux M0 */ 974 974 RK_MUXROUTE_GRF(4, RK_PC2, 2, 0x030c, WRITE_MASK_VAL(6, 6, 1)), /* SPI3 IO mux M1 */ 975 975 RK_MUXROUTE_GRF(2, RK_PB4, 2, 0x030c, WRITE_MASK_VAL(8, 8, 0)), /* UART1 IO mux M0 */ 976 - RK_MUXROUTE_PMU(0, RK_PD1, 1, 0x030c, WRITE_MASK_VAL(8, 8, 1)), /* UART1 IO mux M1 */ 977 - RK_MUXROUTE_PMU(0, RK_PD1, 1, 0x030c, WRITE_MASK_VAL(10, 10, 0)), /* UART2 IO mux M0 */ 976 + RK_MUXROUTE_GRF(3, RK_PD6, 4, 0x030c, WRITE_MASK_VAL(8, 8, 1)), /* UART1 IO mux M1 */ 977 + RK_MUXROUTE_GRF(0, RK_PD1, 1, 0x030c, WRITE_MASK_VAL(10, 10, 0)), /* UART2 IO mux M0 */ 978 978 RK_MUXROUTE_GRF(1, RK_PD5, 2, 0x030c, WRITE_MASK_VAL(10, 10, 1)), /* UART2 IO mux M1 */ 979 979 RK_MUXROUTE_GRF(1, RK_PA1, 2, 0x030c, WRITE_MASK_VAL(12, 12, 0)), /* UART3 IO mux M0 */ 980 980 RK_MUXROUTE_GRF(3, RK_PB7, 4, 0x030c, WRITE_MASK_VAL(12, 12, 1)), /* UART3 IO mux M1 */ ··· 1004 1004 RK_MUXROUTE_GRF(3, RK_PD6, 5, 0x0314, WRITE_MASK_VAL(1, 0, 1)), /* PDM IO mux M1 */ 1005 1005 RK_MUXROUTE_GRF(4, RK_PA0, 4, 0x0314, WRITE_MASK_VAL(1, 0, 1)), /* PDM IO mux M1 */ 1006 1006 RK_MUXROUTE_GRF(3, RK_PC4, 5, 0x0314, WRITE_MASK_VAL(1, 0, 2)), /* PDM IO mux M2 */ 1007 - RK_MUXROUTE_PMU(0, RK_PA5, 3, 0x0314, WRITE_MASK_VAL(3, 2, 0)), /* PCIE20 IO mux M0 */ 1007 + RK_MUXROUTE_GRF(0, RK_PA5, 3, 0x0314, WRITE_MASK_VAL(3, 2, 0)), /* PCIE20 IO mux M0 */ 1008 1008 RK_MUXROUTE_GRF(2, RK_PD0, 4, 0x0314, WRITE_MASK_VAL(3, 2, 1)), /* PCIE20 IO mux M1 */ 1009 1009 RK_MUXROUTE_GRF(1, RK_PB0, 4, 0x0314, WRITE_MASK_VAL(3, 2, 2)), /* PCIE20 IO mux M2 */ 1010 - RK_MUXROUTE_PMU(0, RK_PA4, 3, 0x0314, WRITE_MASK_VAL(5, 4, 0)), /* PCIE30X1 IO mux M0 */ 1010 + RK_MUXROUTE_GRF(0, RK_PA4, 3, 0x0314, WRITE_MASK_VAL(5, 4, 0)), /* PCIE30X1 IO mux M0 */ 1011 1011 RK_MUXROUTE_GRF(2, RK_PD2, 4, 0x0314, WRITE_MASK_VAL(5, 4, 1)), /* PCIE30X1 IO mux M1 */ 1012 1012 RK_MUXROUTE_GRF(1, RK_PA5, 4, 0x0314, WRITE_MASK_VAL(5, 4, 2)), /* PCIE30X1 IO mux M2 */ 1013 - RK_MUXROUTE_PMU(0, RK_PA6, 2, 0x0314, WRITE_MASK_VAL(7, 6, 0)), /* PCIE30X2 IO mux M0 */ 1013 + RK_MUXROUTE_GRF(0, RK_PA6, 2, 0x0314, WRITE_MASK_VAL(7, 6, 0)), /* PCIE30X2 IO mux M0 */ 1014 1014 RK_MUXROUTE_GRF(2, RK_PD4, 4, 0x0314, WRITE_MASK_VAL(7, 6, 1)), /* PCIE30X2 IO mux M1 */ 1015 1015 RK_MUXROUTE_GRF(4, RK_PC2, 4, 0x0314, WRITE_MASK_VAL(7, 6, 2)), /* PCIE30X2 IO mux M2 */ 1016 1016 }; ··· 2436 2436 case RK3308: 2437 2437 case RK3368: 2438 2438 case RK3399: 2439 + case RK3568: 2439 2440 case RK3588: 2440 2441 pull_type = bank->pull_type[pin_num / 8]; 2441 2442 data >>= bit; 2442 2443 data &= (1 << RK3188_PULL_BITS_PER_PIN) - 1; 2444 + /* 2445 + * In the TRM, pull-up being 1 for everything except the GPIO0_D3-D6, 2446 + * where that pull up value becomes 3. 2447 + */ 2448 + if (ctrl->type == RK3568 && bank->bank_num == 0 && pin_num >= 27 && pin_num <= 30) { 2449 + if (data == 3) 2450 + data = 1; 2451 + } 2443 2452 2444 2453 return rockchip_pull_list[pull_type][data]; 2445 2454 default: ··· 2506 2497 } 2507 2498 } 2508 2499 /* 2509 - * In the TRM, pull-up being 1 for everything except the GPIO0_D0-D6, 2500 + * In the TRM, pull-up being 1 for everything except the GPIO0_D3-D6, 2510 2501 * where that pull up value becomes 3. 2511 2502 */ 2512 2503 if (ctrl->type == RK3568 && bank->bank_num == 0 && pin_num >= 27 && pin_num <= 30) {
+2 -5
drivers/pinctrl/sunplus/sppctl.c
··· 499 499 return 0; 500 500 } 501 501 502 - #ifdef CONFIG_DEBUG_FS 503 502 static void sppctl_gpio_dbg_show(struct seq_file *s, struct gpio_chip *chip) 504 503 { 505 504 const char *label; ··· 520 521 seq_puts(s, "\n"); 521 522 } 522 523 } 523 - #endif 524 524 525 525 static int sppctl_gpio_new(struct platform_device *pdev, struct sppctl_pdata *pctl) 526 526 { ··· 548 550 gchip->get = sppctl_gpio_get; 549 551 gchip->set = sppctl_gpio_set; 550 552 gchip->set_config = sppctl_gpio_set_config; 551 - #ifdef CONFIG_DEBUG_FS 552 - gchip->dbg_show = sppctl_gpio_dbg_show; 553 - #endif 553 + gchip->dbg_show = IS_ENABLED(CONFIG_DEBUG_FS) ? 554 + sppctl_gpio_dbg_show : NULL; 554 555 gchip->base = -1; 555 556 gchip->ngpio = sppctl_gpio_list_sz; 556 557 gchip->names = sppctl_gpio_list_s;
+1 -1
drivers/reset/Kconfig
··· 257 257 258 258 config RESET_TI_SCI 259 259 tristate "TI System Control Interface (TI-SCI) reset driver" 260 - depends on TI_SCI_PROTOCOL || COMPILE_TEST 260 + depends on TI_SCI_PROTOCOL || (COMPILE_TEST && TI_SCI_PROTOCOL=n) 261 261 help 262 262 This enables the reset driver support over TI System Control Interface 263 263 available on some new TI's SoCs. If you wish to use reset resources
+1 -3
drivers/reset/reset-uniphier-glue.c
··· 47 47 struct device *dev = &pdev->dev; 48 48 struct uniphier_glue_reset_priv *priv; 49 49 struct resource *res; 50 - resource_size_t size; 51 50 int i, ret; 52 51 53 52 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); ··· 59 60 return -EINVAL; 60 61 61 62 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 62 - size = resource_size(res); 63 63 priv->rdata.membase = devm_ioremap_resource(dev, res); 64 64 if (IS_ERR(priv->rdata.membase)) 65 65 return PTR_ERR(priv->rdata.membase); ··· 94 96 95 97 spin_lock_init(&priv->rdata.lock); 96 98 priv->rdata.rcdev.owner = THIS_MODULE; 97 - priv->rdata.rcdev.nr_resets = size * BITS_PER_BYTE; 99 + priv->rdata.rcdev.nr_resets = resource_size(res) * BITS_PER_BYTE; 98 100 priv->rdata.rcdev.ops = &reset_simple_ops; 99 101 priv->rdata.rcdev.of_node = dev->of_node; 100 102 priv->rdata.active_low = true;
+3 -2
drivers/scsi/device_handler/scsi_dh_alua.c
··· 981 981 * 982 982 * Returns true if and only if alua_rtpg_work() will be called asynchronously. 983 983 * That function is responsible for calling @qdata->fn(). 984 + * 985 + * Context: may be called from atomic context (alua_check()) only if the caller 986 + * holds an sdev reference. 984 987 */ 985 988 static bool alua_rtpg_queue(struct alua_port_group *pg, 986 989 struct scsi_device *sdev, ··· 991 988 { 992 989 int start_queue = 0; 993 990 unsigned long flags; 994 - 995 - might_sleep(); 996 991 997 992 if (WARN_ON_ONCE(!pg) || scsi_device_get(sdev)) 998 993 return false;
+1 -1
drivers/scsi/hpsa.c
··· 5850 5850 { 5851 5851 struct Scsi_Host *sh; 5852 5852 5853 - sh = scsi_host_alloc(&hpsa_driver_template, sizeof(h)); 5853 + sh = scsi_host_alloc(&hpsa_driver_template, sizeof(struct ctlr_info)); 5854 5854 if (sh == NULL) { 5855 5855 dev_err(&h->pdev->dev, "scsi_host_alloc failed\n"); 5856 5856 return -ENOMEM;
+16 -6
drivers/scsi/iscsi_tcp.c
··· 852 852 enum iscsi_host_param param, char *buf) 853 853 { 854 854 struct iscsi_sw_tcp_host *tcp_sw_host = iscsi_host_priv(shost); 855 - struct iscsi_session *session = tcp_sw_host->session; 855 + struct iscsi_session *session; 856 856 struct iscsi_conn *conn; 857 857 struct iscsi_tcp_conn *tcp_conn; 858 858 struct iscsi_sw_tcp_conn *tcp_sw_conn; ··· 862 862 863 863 switch (param) { 864 864 case ISCSI_HOST_PARAM_IPADDRESS: 865 + session = tcp_sw_host->session; 865 866 if (!session) 866 867 return -ENOTCONN; 867 868 ··· 963 962 if (!cls_session) 964 963 goto remove_host; 965 964 session = cls_session->dd_data; 966 - tcp_sw_host = iscsi_host_priv(shost); 967 - tcp_sw_host->session = session; 968 965 969 966 if (iscsi_tcp_r2tpool_alloc(session)) 970 967 goto remove_session; 968 + 969 + /* We are now fully setup so expose the session to sysfs. */ 970 + tcp_sw_host = iscsi_host_priv(shost); 971 + tcp_sw_host->session = session; 971 972 return cls_session; 972 973 973 974 remove_session: ··· 989 986 if (WARN_ON_ONCE(session->leadconn)) 990 987 return; 991 988 992 - iscsi_tcp_r2tpool_free(cls_session->dd_data); 993 - iscsi_session_teardown(cls_session); 994 - 989 + iscsi_session_remove(cls_session); 990 + /* 991 + * Our get_host_param needs to access the session, so remove the 992 + * host from sysfs before freeing the session to make sure userspace 993 + * is no longer accessing the callout. 994 + */ 995 995 iscsi_host_remove(shost, false); 996 + 997 + iscsi_tcp_r2tpool_free(cls_session->dd_data); 998 + 999 + iscsi_session_free(cls_session); 996 1000 iscsi_host_free(shost); 997 1001 } 998 1002
+31 -7
drivers/scsi/libiscsi.c
··· 3104 3104 } 3105 3105 EXPORT_SYMBOL_GPL(iscsi_session_setup); 3106 3106 3107 - /** 3108 - * iscsi_session_teardown - destroy session, host, and cls_session 3109 - * @cls_session: iscsi session 3107 + /* 3108 + * issi_session_remove - Remove session from iSCSI class. 3110 3109 */ 3111 - void iscsi_session_teardown(struct iscsi_cls_session *cls_session) 3110 + void iscsi_session_remove(struct iscsi_cls_session *cls_session) 3112 3111 { 3113 3112 struct iscsi_session *session = cls_session->dd_data; 3114 - struct module *owner = cls_session->transport->owner; 3115 3113 struct Scsi_Host *shost = session->host; 3116 3114 3117 3115 iscsi_remove_session(cls_session); 3116 + /* 3117 + * host removal only has to wait for its children to be removed from 3118 + * sysfs, and iscsi_tcp needs to do iscsi_host_remove before freeing 3119 + * the session, so drop the session count here. 3120 + */ 3121 + iscsi_host_dec_session_cnt(shost); 3122 + } 3123 + EXPORT_SYMBOL_GPL(iscsi_session_remove); 3124 + 3125 + /** 3126 + * iscsi_session_free - Free iscsi session and it's resources 3127 + * @cls_session: iscsi session 3128 + */ 3129 + void iscsi_session_free(struct iscsi_cls_session *cls_session) 3130 + { 3131 + struct iscsi_session *session = cls_session->dd_data; 3132 + struct module *owner = cls_session->transport->owner; 3118 3133 3119 3134 iscsi_pool_free(&session->cmdpool); 3120 3135 kfree(session->password); ··· 3147 3132 kfree(session->discovery_parent_type); 3148 3133 3149 3134 iscsi_free_session(cls_session); 3150 - 3151 - iscsi_host_dec_session_cnt(shost); 3152 3135 module_put(owner); 3136 + } 3137 + EXPORT_SYMBOL_GPL(iscsi_session_free); 3138 + 3139 + /** 3140 + * iscsi_session_teardown - destroy session and cls_session 3141 + * @cls_session: iscsi session 3142 + */ 3143 + void iscsi_session_teardown(struct iscsi_cls_session *cls_session) 3144 + { 3145 + iscsi_session_remove(cls_session); 3146 + iscsi_session_free(cls_session); 3153 3147 } 3154 3148 EXPORT_SYMBOL_GPL(iscsi_session_teardown); 3155 3149
+4 -3
drivers/soc/imx/imx8mp-blk-ctrl.c
··· 212 212 break; 213 213 case IMX8MP_HDMIBLK_PD_LCDIF: 214 214 regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL0, 215 - BIT(7) | BIT(16) | BIT(17) | BIT(18) | 215 + BIT(16) | BIT(17) | BIT(18) | 216 216 BIT(19) | BIT(20)); 217 217 regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(11)); 218 218 regmap_set_bits(bc->regmap, HDMI_RTX_RESET_CTL0, ··· 241 241 regmap_set_bits(bc->regmap, HDMI_TX_CONTROL0, BIT(1)); 242 242 break; 243 243 case IMX8MP_HDMIBLK_PD_HDMI_TX_PHY: 244 + regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL0, BIT(7)); 244 245 regmap_set_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(22) | BIT(24)); 245 246 regmap_set_bits(bc->regmap, HDMI_RTX_RESET_CTL0, BIT(12)); 246 247 regmap_clear_bits(bc->regmap, HDMI_TX_CONTROL0, BIT(3)); ··· 271 270 BIT(4) | BIT(5) | BIT(6)); 272 271 regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(11)); 273 272 regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL0, 274 - BIT(7) | BIT(16) | BIT(17) | BIT(18) | 273 + BIT(16) | BIT(17) | BIT(18) | 275 274 BIT(19) | BIT(20)); 276 275 break; 277 276 case IMX8MP_HDMIBLK_PD_PAI: ··· 299 298 case IMX8MP_HDMIBLK_PD_HDMI_TX_PHY: 300 299 regmap_set_bits(bc->regmap, HDMI_TX_CONTROL0, BIT(3)); 301 300 regmap_clear_bits(bc->regmap, HDMI_RTX_RESET_CTL0, BIT(12)); 301 + regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL0, BIT(7)); 302 302 regmap_clear_bits(bc->regmap, HDMI_RTX_CLK_CTL1, BIT(22) | BIT(24)); 303 303 break; 304 304 case IMX8MP_HDMIBLK_PD_HDCP: ··· 592 590 ret = PTR_ERR(domain->power_dev); 593 591 goto cleanup_pds; 594 592 } 595 - dev_set_name(domain->power_dev, "%s", data->name); 596 593 597 594 domain->genpd.name = data->name; 598 595 domain->genpd.power_on = imx8mp_blk_ctrl_power_on;
+2 -2
drivers/soc/imx/soc-imx8m.c
··· 66 66 ocotp_base = of_iomap(np, 0); 67 67 WARN_ON(!ocotp_base); 68 68 clk = of_clk_get_by_name(np, NULL); 69 - if (!clk) { 70 - WARN_ON(!clk); 69 + if (IS_ERR(clk)) { 70 + WARN_ON(IS_ERR(clk)); 71 71 return 0; 72 72 } 73 73
+2 -1
drivers/soc/qcom/apr.c
··· 461 461 goto out; 462 462 } 463 463 464 + /* Protection domain is optional, it does not exist on older platforms */ 464 465 ret = of_property_read_string_index(np, "qcom,protection-domain", 465 466 1, &adev->service_path); 466 - if (ret < 0) { 467 + if (ret < 0 && ret != -EINVAL) { 467 468 dev_err(dev, "Failed to read second value of qcom,protection-domain\n"); 468 469 goto out; 469 470 }
+5 -1
drivers/soc/qcom/cpr.c
··· 1708 1708 1709 1709 ret = of_genpd_add_provider_simple(dev->of_node, &drv->pd); 1710 1710 if (ret) 1711 - return ret; 1711 + goto err_remove_genpd; 1712 1712 1713 1713 platform_set_drvdata(pdev, drv); 1714 1714 cpr_debugfs_init(drv); 1715 1715 1716 1716 return 0; 1717 + 1718 + err_remove_genpd: 1719 + pm_genpd_remove(&drv->pd); 1720 + return ret; 1717 1721 } 1718 1722 1719 1723 static int cpr_remove(struct platform_device *pdev)
+1 -1
drivers/staging/vc04_services/include/linux/raspberrypi/vchiq.h
··· 86 86 87 87 struct vchiq_instance; 88 88 89 - extern enum vchiq_status vchiq_initialise(struct vchiq_instance **pinstance); 89 + extern int vchiq_initialise(struct vchiq_instance **pinstance); 90 90 extern enum vchiq_status vchiq_shutdown(struct vchiq_instance *instance); 91 91 extern enum vchiq_status vchiq_connect(struct vchiq_instance *instance); 92 92 extern enum vchiq_status vchiq_open_service(struct vchiq_instance *instance,
+2 -2
drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.h
··· 100 100 extern void 101 101 vchiq_dump_service_use_state(struct vchiq_state *state); 102 102 103 - extern enum vchiq_status 103 + extern int 104 104 vchiq_use_internal(struct vchiq_state *state, struct vchiq_service *service, 105 105 enum USE_TYPE_E use_type); 106 - extern enum vchiq_status 106 + extern int 107 107 vchiq_release_internal(struct vchiq_state *state, 108 108 struct vchiq_service *service); 109 109
+2 -2
drivers/target/target_core_tmr.c
··· 73 73 { 74 74 struct se_session *sess = se_cmd->se_sess; 75 75 76 - assert_spin_locked(&sess->sess_cmd_lock); 77 - WARN_ON_ONCE(!irqs_disabled()); 76 + lockdep_assert_held(&sess->sess_cmd_lock); 77 + 78 78 /* 79 79 * If command already reached CMD_T_COMPLETE state within 80 80 * target_complete_cmd() or CMD_T_FABRIC_STOP due to shutdown,
+10 -3
drivers/thermal/thermal_core.c
··· 909 909 cdev->devdata = devdata; 910 910 911 911 ret = cdev->ops->get_max_state(cdev, &cdev->max_state); 912 - if (ret) 913 - goto out_kfree_type; 912 + if (ret) { 913 + kfree(cdev->type); 914 + goto out_ida_remove; 915 + } 914 916 915 917 thermal_cooling_device_setup_sysfs(cdev); 918 + 916 919 ret = dev_set_name(&cdev->device, "cooling_device%d", cdev->id); 917 920 if (ret) { 921 + kfree(cdev->type); 918 922 thermal_cooling_device_destroy_sysfs(cdev); 919 - goto out_kfree_type; 923 + goto out_ida_remove; 920 924 } 925 + 921 926 ret = device_register(&cdev->device); 922 927 if (ret) 923 928 goto out_kfree_type; ··· 948 943 thermal_cooling_device_destroy_sysfs(cdev); 949 944 kfree(cdev->type); 950 945 put_device(&cdev->device); 946 + 947 + /* thermal_release() takes care of the rest */ 951 948 cdev = NULL; 952 949 out_ida_remove: 953 950 ida_free(&thermal_cdev_ida, id);
+4 -16
drivers/thunderbolt/retimer.c
··· 427 427 { 428 428 u32 status[TB_MAX_RETIMER_INDEX + 1] = {}; 429 429 int ret, i, last_idx = 0; 430 - struct usb4_port *usb4; 431 - 432 - usb4 = port->usb4; 433 - if (!usb4) 434 - return 0; 435 - 436 - pm_runtime_get_sync(&usb4->dev); 437 430 438 431 /* 439 432 * Send broadcast RT to make sure retimer indices facing this ··· 434 441 */ 435 442 ret = usb4_port_enumerate_retimers(port); 436 443 if (ret) 437 - goto out; 444 + return ret; 438 445 439 446 /* 440 447 * Enable sideband channel for each retimer. We can do this ··· 464 471 break; 465 472 } 466 473 467 - if (!last_idx) { 468 - ret = 0; 469 - goto out; 470 - } 474 + if (!last_idx) 475 + return 0; 471 476 472 477 /* Add on-board retimers if they do not exist already */ 478 + ret = 0; 473 479 for (i = 1; i <= last_idx; i++) { 474 480 struct tb_retimer *rt; 475 481 ··· 481 489 break; 482 490 } 483 491 } 484 - 485 - out: 486 - pm_runtime_mark_last_busy(&usb4->dev); 487 - pm_runtime_put_autosuspend(&usb4->dev); 488 492 489 493 return ret; 490 494 }
+15 -5
drivers/thunderbolt/tb.c
··· 628 628 * Downstream switch is reachable through two ports. 629 629 * Only scan on the primary port (link_nr == 0). 630 630 */ 631 + 632 + if (port->usb4) 633 + pm_runtime_get_sync(&port->usb4->dev); 634 + 631 635 if (tb_wait_for_port(port, false) <= 0) 632 - return; 636 + goto out_rpm_put; 633 637 if (port->remote) { 634 638 tb_port_dbg(port, "port already has a remote\n"); 635 - return; 639 + goto out_rpm_put; 636 640 } 637 641 638 642 tb_retimer_scan(port, true); ··· 651 647 */ 652 648 if (PTR_ERR(sw) == -EIO || PTR_ERR(sw) == -EADDRNOTAVAIL) 653 649 tb_scan_xdomain(port); 654 - return; 650 + goto out_rpm_put; 655 651 } 656 652 657 653 if (tb_switch_configure(sw)) { 658 654 tb_switch_put(sw); 659 - return; 655 + goto out_rpm_put; 660 656 } 661 657 662 658 /* ··· 685 681 686 682 if (tb_switch_add(sw)) { 687 683 tb_switch_put(sw); 688 - return; 684 + goto out_rpm_put; 689 685 } 690 686 691 687 /* Link the switches using both links if available */ ··· 737 733 738 734 tb_add_dp_resources(sw); 739 735 tb_scan_switch(sw); 736 + 737 + out_rpm_put: 738 + if (port->usb4) { 739 + pm_runtime_mark_last_busy(&port->usb4->dev); 740 + pm_runtime_put_autosuspend(&port->usb4->dev); 741 + } 740 742 } 741 743 742 744 static void tb_deactivate_and_free_tunnel(struct tb_tunnel *tunnel)
+1 -1
drivers/thunderbolt/tunnel.c
··· 1275 1275 return; 1276 1276 } else if (!ret) { 1277 1277 /* Use maximum link rate if the link valid is not set */ 1278 - ret = usb4_usb3_port_max_link_rate(tunnel->src_port); 1278 + ret = tb_usb3_max_link_rate(tunnel->dst_port, tunnel->src_port); 1279 1279 if (ret < 0) { 1280 1280 tb_tunnel_warn(tunnel, "failed to read maximum link rate\n"); 1281 1281 return;
+12 -5
drivers/thunderbolt/xdomain.c
··· 1419 1419 * registered, we notify the userspace that it has changed. 1420 1420 */ 1421 1421 if (!update) { 1422 - struct tb_port *port; 1422 + /* 1423 + * Now disable lane 1 if bonding was not enabled. Do 1424 + * this only if bonding was possible at the beginning 1425 + * (that is we are the connection manager and there are 1426 + * two lanes). 1427 + */ 1428 + if (xd->bonding_possible) { 1429 + struct tb_port *port; 1423 1430 1424 - /* Now disable lane 1 if bonding was not enabled */ 1425 - port = tb_port_at(xd->route, tb_xdomain_parent(xd)); 1426 - if (!port->bonded) 1427 - tb_port_disable(port->dual_link_port); 1431 + port = tb_port_at(xd->route, tb_xdomain_parent(xd)); 1432 + if (!port->bonded) 1433 + tb_port_disable(port->dual_link_port); 1434 + } 1428 1435 1429 1436 if (device_add(&xd->dev)) { 1430 1437 dev_err(&xd->dev, "failed to add XDomain device\n");
+14
drivers/tty/serial/8250/8250_exar.c
··· 43 43 #define PCI_DEVICE_ID_EXAR_XR17V4358 0x4358 44 44 #define PCI_DEVICE_ID_EXAR_XR17V8358 0x8358 45 45 46 + #define PCI_DEVICE_ID_SEALEVEL_710xC 0x1001 47 + #define PCI_DEVICE_ID_SEALEVEL_720xC 0x1002 48 + #define PCI_DEVICE_ID_SEALEVEL_740xC 0x1004 49 + #define PCI_DEVICE_ID_SEALEVEL_780xC 0x1008 50 + #define PCI_DEVICE_ID_SEALEVEL_716xC 0x1010 51 + 46 52 #define UART_EXAR_INT0 0x80 47 53 #define UART_EXAR_8XMODE 0x88 /* 8X sampling rate select */ 48 54 #define UART_EXAR_SLEEP 0x8b /* Sleep mode */ ··· 644 638 nr_ports = BIT(((pcidev->device & 0x38) >> 3) - 1); 645 639 else if (board->num_ports) 646 640 nr_ports = board->num_ports; 641 + else if (pcidev->vendor == PCI_VENDOR_ID_SEALEVEL) 642 + nr_ports = pcidev->device & 0xff; 647 643 else 648 644 nr_ports = pcidev->device & 0x0f; 649 645 ··· 872 864 EXAR_DEVICE(COMMTECH, 4224PCI335, pbn_fastcom335_4), 873 865 EXAR_DEVICE(COMMTECH, 2324PCI335, pbn_fastcom335_4), 874 866 EXAR_DEVICE(COMMTECH, 2328PCI335, pbn_fastcom335_8), 867 + 868 + EXAR_DEVICE(SEALEVEL, 710xC, pbn_exar_XR17V35x), 869 + EXAR_DEVICE(SEALEVEL, 720xC, pbn_exar_XR17V35x), 870 + EXAR_DEVICE(SEALEVEL, 740xC, pbn_exar_XR17V35x), 871 + EXAR_DEVICE(SEALEVEL, 780xC, pbn_exar_XR17V35x), 872 + EXAR_DEVICE(SEALEVEL, 716xC, pbn_exar_XR17V35x), 875 873 { 0, } 876 874 }; 877 875 MODULE_DEVICE_TABLE(pci, exar_pci_tbl);
+4 -4
drivers/tty/serial/amba-pl011.c
··· 1466 1466 struct circ_buf *xmit = &uap->port.state->xmit; 1467 1467 int count = uap->fifosize >> 1; 1468 1468 1469 + if ((uap->port.rs485.flags & SER_RS485_ENABLED) && 1470 + !uap->rs485_tx_started) 1471 + pl011_rs485_tx_start(uap); 1472 + 1469 1473 if (uap->port.x_char) { 1470 1474 if (!pl011_tx_char(uap, uap->port.x_char, from_irq)) 1471 1475 return true; ··· 1480 1476 pl011_stop_tx(&uap->port); 1481 1477 return false; 1482 1478 } 1483 - 1484 - if ((uap->port.rs485.flags & SER_RS485_ENABLED) && 1485 - !uap->rs485_tx_started) 1486 - pl011_rs485_tx_start(uap); 1487 1479 1488 1480 /* If we are using DMA mode, try to send some characters. */ 1489 1481 if (pl011_dma_tx_irq(uap))
+1 -7
drivers/tty/serial/atmel_serial.c
··· 2657 2657 else if (mr == ATMEL_US_PAR_ODD) 2658 2658 *parity = 'o'; 2659 2659 2660 - /* 2661 - * The serial core only rounds down when matching this to a 2662 - * supported baud rate. Make sure we don't end up slightly 2663 - * lower than one of those, as it would make us fall through 2664 - * to a much lower baud rate than we really want. 2665 - */ 2666 - *baud = port->uartclk / (16 * (quot - 1)); 2660 + *baud = port->uartclk / (16 * quot); 2667 2661 } 2668 2662 2669 2663 static int __init atmel_console_setup(struct console *co, char *options)
+1 -1
drivers/tty/serial/pch_uart.c
··· 749 749 uart_xmit_advance(port, sg_dma_len(sg)); 750 750 751 751 async_tx_ack(priv->desc_tx); 752 - dma_unmap_sg(port->dev, sg, priv->orig_nent, DMA_TO_DEVICE); 752 + dma_unmap_sg(port->dev, priv->sg_tx_p, priv->orig_nent, DMA_TO_DEVICE); 753 753 priv->tx_dma_use = 0; 754 754 priv->nent = 0; 755 755 priv->orig_nent = 0;
+24 -8
drivers/tty/serial/qcom_geni_serial.c
··· 864 864 return IRQ_HANDLED; 865 865 } 866 866 867 - static void get_tx_fifo_size(struct qcom_geni_serial_port *port) 867 + static int setup_fifos(struct qcom_geni_serial_port *port) 868 868 { 869 869 struct uart_port *uport; 870 + u32 old_rx_fifo_depth = port->rx_fifo_depth; 870 871 871 872 uport = &port->uport; 872 873 port->tx_fifo_depth = geni_se_get_tx_fifo_depth(&port->se); ··· 875 874 port->rx_fifo_depth = geni_se_get_rx_fifo_depth(&port->se); 876 875 uport->fifosize = 877 876 (port->tx_fifo_depth * port->tx_fifo_width) / BITS_PER_BYTE; 877 + 878 + if (port->rx_fifo && (old_rx_fifo_depth != port->rx_fifo_depth) && port->rx_fifo_depth) { 879 + port->rx_fifo = devm_krealloc(uport->dev, port->rx_fifo, 880 + port->rx_fifo_depth * sizeof(u32), 881 + GFP_KERNEL); 882 + if (!port->rx_fifo) 883 + return -ENOMEM; 884 + } 885 + 886 + return 0; 878 887 } 879 888 880 889 ··· 899 888 u32 rxstale = DEFAULT_BITS_PER_CHAR * STALE_TIMEOUT; 900 889 u32 proto; 901 890 u32 pin_swap; 891 + int ret; 902 892 903 893 proto = geni_se_read_proto(&port->se); 904 894 if (proto != GENI_SE_UART) { ··· 909 897 910 898 qcom_geni_serial_stop_rx(uport); 911 899 912 - get_tx_fifo_size(port); 900 + ret = setup_fifos(port); 901 + if (ret) 902 + return ret; 913 903 914 904 writel(rxstale, uport->membase + SE_UART_RX_STALE_CNT); 915 905 ··· 1530 1516 return 0; 1531 1517 } 1532 1518 1533 - static int __maybe_unused qcom_geni_serial_sys_suspend(struct device *dev) 1519 + static int qcom_geni_serial_sys_suspend(struct device *dev) 1534 1520 { 1535 1521 struct qcom_geni_serial_port *port = dev_get_drvdata(dev); 1536 1522 struct uart_port *uport = &port->uport; ··· 1547 1533 return uart_suspend_port(private_data->drv, uport); 1548 1534 } 1549 1535 1550 - static int __maybe_unused qcom_geni_serial_sys_resume(struct device *dev) 1536 + static int qcom_geni_serial_sys_resume(struct device *dev) 1551 1537 { 1552 1538 int ret; 1553 1539 struct qcom_geni_serial_port *port = dev_get_drvdata(dev); ··· 1595 1581 } 1596 1582 1597 1583 static const struct dev_pm_ops qcom_geni_serial_pm_ops = { 1598 - SET_SYSTEM_SLEEP_PM_OPS(qcom_geni_serial_sys_suspend, 1599 - qcom_geni_serial_sys_resume) 1600 - .restore = qcom_geni_serial_sys_hib_resume, 1601 - .thaw = qcom_geni_serial_sys_hib_resume, 1584 + .suspend = pm_sleep_ptr(qcom_geni_serial_sys_suspend), 1585 + .resume = pm_sleep_ptr(qcom_geni_serial_sys_resume), 1586 + .freeze = pm_sleep_ptr(qcom_geni_serial_sys_suspend), 1587 + .poweroff = pm_sleep_ptr(qcom_geni_serial_sys_suspend), 1588 + .restore = pm_sleep_ptr(qcom_geni_serial_sys_hib_resume), 1589 + .thaw = pm_sleep_ptr(qcom_geni_serial_sys_hib_resume), 1602 1590 }; 1603 1591 1604 1592 static const struct of_device_id qcom_geni_serial_match_table[] = {
+15 -14
drivers/ufs/core/ufshcd.c
··· 1234 1234 * clock scaling is in progress 1235 1235 */ 1236 1236 ufshcd_scsi_block_requests(hba); 1237 + mutex_lock(&hba->wb_mutex); 1237 1238 down_write(&hba->clk_scaling_lock); 1238 1239 1239 1240 if (!hba->clk_scaling.is_allowed || 1240 1241 ufshcd_wait_for_doorbell_clr(hba, DOORBELL_CLR_TOUT_US)) { 1241 1242 ret = -EBUSY; 1242 1243 up_write(&hba->clk_scaling_lock); 1244 + mutex_unlock(&hba->wb_mutex); 1243 1245 ufshcd_scsi_unblock_requests(hba); 1244 1246 goto out; 1245 1247 } ··· 1253 1251 return ret; 1254 1252 } 1255 1253 1256 - static void ufshcd_clock_scaling_unprepare(struct ufs_hba *hba, bool writelock) 1254 + static void ufshcd_clock_scaling_unprepare(struct ufs_hba *hba, int err, bool scale_up) 1257 1255 { 1258 - if (writelock) 1259 - up_write(&hba->clk_scaling_lock); 1260 - else 1261 - up_read(&hba->clk_scaling_lock); 1256 + up_write(&hba->clk_scaling_lock); 1257 + 1258 + /* Enable Write Booster if we have scaled up else disable it */ 1259 + if (ufshcd_enable_wb_if_scaling_up(hba) && !err) 1260 + ufshcd_wb_toggle(hba, scale_up); 1261 + 1262 + mutex_unlock(&hba->wb_mutex); 1263 + 1262 1264 ufshcd_scsi_unblock_requests(hba); 1263 1265 ufshcd_release(hba); 1264 1266 } ··· 1279 1273 static int ufshcd_devfreq_scale(struct ufs_hba *hba, bool scale_up) 1280 1274 { 1281 1275 int ret = 0; 1282 - bool is_writelock = true; 1283 1276 1284 1277 ret = ufshcd_clock_scaling_prepare(hba); 1285 1278 if (ret) ··· 1307 1302 } 1308 1303 } 1309 1304 1310 - /* Enable Write Booster if we have scaled up else disable it */ 1311 - if (ufshcd_enable_wb_if_scaling_up(hba)) { 1312 - downgrade_write(&hba->clk_scaling_lock); 1313 - is_writelock = false; 1314 - ufshcd_wb_toggle(hba, scale_up); 1315 - } 1316 - 1317 1305 out_unprepare: 1318 - ufshcd_clock_scaling_unprepare(hba, is_writelock); 1306 + ufshcd_clock_scaling_unprepare(hba, ret, scale_up); 1319 1307 return ret; 1320 1308 } 1321 1309 ··· 6064 6066 6065 6067 static void ufshcd_clk_scaling_allow(struct ufs_hba *hba, bool allow) 6066 6068 { 6069 + mutex_lock(&hba->wb_mutex); 6067 6070 down_write(&hba->clk_scaling_lock); 6068 6071 hba->clk_scaling.is_allowed = allow; 6069 6072 up_write(&hba->clk_scaling_lock); 6073 + mutex_unlock(&hba->wb_mutex); 6070 6074 } 6071 6075 6072 6076 static void ufshcd_clk_scaling_suspend(struct ufs_hba *hba, bool suspend) ··· 9793 9793 /* Initialize mutex for exception event control */ 9794 9794 mutex_init(&hba->ee_ctrl_mutex); 9795 9795 9796 + mutex_init(&hba->wb_mutex); 9796 9797 init_rwsem(&hba->clk_scaling_lock); 9797 9798 9798 9799 ufshcd_init_clk_gating(hba);
+12
drivers/usb/cdns3/cdns3-gadget.c
··· 2614 2614 u8 req_on_hw_ring = 0; 2615 2615 unsigned long flags; 2616 2616 int ret = 0; 2617 + int val; 2617 2618 2618 2619 if (!ep || !request || !ep->desc) 2619 2620 return -EINVAL; ··· 2650 2649 2651 2650 /* Update ring only if removed request is on pending_req_list list */ 2652 2651 if (req_on_hw_ring && link_trb) { 2652 + /* Stop DMA */ 2653 + writel(EP_CMD_DFLUSH, &priv_dev->regs->ep_cmd); 2654 + 2655 + /* wait for DFLUSH cleared */ 2656 + readl_poll_timeout_atomic(&priv_dev->regs->ep_cmd, val, 2657 + !(val & EP_CMD_DFLUSH), 1, 1000); 2658 + 2653 2659 link_trb->buffer = cpu_to_le32(TRB_BUFFER(priv_ep->trb_pool_dma + 2654 2660 ((priv_req->end_trb + 1) * TRB_SIZE))); 2655 2661 link_trb->control = cpu_to_le32((le32_to_cpu(link_trb->control) & TRB_CYCLE) | ··· 2667 2659 } 2668 2660 2669 2661 cdns3_gadget_giveback(priv_ep, priv_req, -ECONNRESET); 2662 + 2663 + req = cdns3_next_request(&priv_ep->pending_req_list); 2664 + if (req) 2665 + cdns3_rearm_transfer(priv_ep, 1); 2670 2666 2671 2667 not_found: 2672 2668 spin_unlock_irqrestore(&priv_dev->lock, flags);
+2 -2
drivers/usb/chipidea/core.c
··· 1294 1294 cable_id = &ci->platdata->id_extcon; 1295 1295 cable_vbus = &ci->platdata->vbus_extcon; 1296 1296 1297 - if ((!IS_ERR(cable_id->edev) || !IS_ERR(ci->role_switch)) 1297 + if ((!IS_ERR(cable_id->edev) || ci->role_switch) 1298 1298 && ci->is_otg && 1299 1299 (otgsc & OTGSC_IDIE) && (otgsc & OTGSC_IDIS)) 1300 1300 ci_irq(ci); 1301 1301 1302 - if ((!IS_ERR(cable_vbus->edev) || !IS_ERR(ci->role_switch)) 1302 + if ((!IS_ERR(cable_vbus->edev) || ci->role_switch) 1303 1303 && ci->is_otg && 1304 1304 (otgsc & OTGSC_BSVIE) && (otgsc & OTGSC_BSVIS)) 1305 1305 ci_irq(ci);
+13
drivers/usb/core/hub.c
··· 44 44 #define USB_PRODUCT_USB5534B 0x5534 45 45 #define USB_VENDOR_CYPRESS 0x04b4 46 46 #define USB_PRODUCT_CY7C65632 0x6570 47 + #define USB_VENDOR_TEXAS_INSTRUMENTS 0x0451 48 + #define USB_PRODUCT_TUSB8041_USB3 0x8140 49 + #define USB_PRODUCT_TUSB8041_USB2 0x8142 47 50 #define HUB_QUIRK_CHECK_PORT_AUTOSUSPEND 0x01 48 51 #define HUB_QUIRK_DISABLE_AUTOSUSPEND 0x02 49 52 ··· 5857 5854 .idVendor = USB_VENDOR_GENESYS_LOGIC, 5858 5855 .bInterfaceClass = USB_CLASS_HUB, 5859 5856 .driver_info = HUB_QUIRK_CHECK_PORT_AUTOSUSPEND}, 5857 + { .match_flags = USB_DEVICE_ID_MATCH_VENDOR 5858 + | USB_DEVICE_ID_MATCH_PRODUCT, 5859 + .idVendor = USB_VENDOR_TEXAS_INSTRUMENTS, 5860 + .idProduct = USB_PRODUCT_TUSB8041_USB2, 5861 + .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND}, 5862 + { .match_flags = USB_DEVICE_ID_MATCH_VENDOR 5863 + | USB_DEVICE_ID_MATCH_PRODUCT, 5864 + .idVendor = USB_VENDOR_TEXAS_INSTRUMENTS, 5865 + .idProduct = USB_PRODUCT_TUSB8041_USB3, 5866 + .driver_info = HUB_QUIRK_DISABLE_AUTOSUSPEND}, 5860 5867 { .match_flags = USB_DEVICE_ID_MATCH_DEV_CLASS, 5861 5868 .bDeviceClass = USB_CLASS_HUB}, 5862 5869 { .match_flags = USB_DEVICE_ID_MATCH_INT_CLASS,
+65
drivers/usb/core/usb-acpi.c
··· 37 37 } 38 38 EXPORT_SYMBOL_GPL(usb_acpi_power_manageable); 39 39 40 + #define UUID_USB_CONTROLLER_DSM "ce2ee385-00e6-48cb-9f05-2edb927c4899" 41 + #define USB_DSM_DISABLE_U1_U2_FOR_PORT 5 42 + 43 + /** 44 + * usb_acpi_port_lpm_incapable - check if lpm should be disabled for a port. 45 + * @hdev: USB device belonging to the usb hub 46 + * @index: zero based port index 47 + * 48 + * Some USB3 ports may not support USB3 link power management U1/U2 states 49 + * due to different retimer setup. ACPI provides _DSM method which returns 0x01 50 + * if U1 and U2 states should be disabled. Evaluate _DSM with: 51 + * Arg0: UUID = ce2ee385-00e6-48cb-9f05-2edb927c4899 52 + * Arg1: Revision ID = 0 53 + * Arg2: Function Index = 5 54 + * Arg3: (empty) 55 + * 56 + * Return 1 if USB3 port is LPM incapable, negative on error, otherwise 0 57 + */ 58 + 59 + int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index) 60 + { 61 + union acpi_object *obj; 62 + acpi_handle port_handle; 63 + int port1 = index + 1; 64 + guid_t guid; 65 + int ret; 66 + 67 + ret = guid_parse(UUID_USB_CONTROLLER_DSM, &guid); 68 + if (ret) 69 + return ret; 70 + 71 + port_handle = usb_get_hub_port_acpi_handle(hdev, port1); 72 + if (!port_handle) { 73 + dev_dbg(&hdev->dev, "port-%d no acpi handle\n", port1); 74 + return -ENODEV; 75 + } 76 + 77 + if (!acpi_check_dsm(port_handle, &guid, 0, 78 + BIT(USB_DSM_DISABLE_U1_U2_FOR_PORT))) { 79 + dev_dbg(&hdev->dev, "port-%d no _DSM function %d\n", 80 + port1, USB_DSM_DISABLE_U1_U2_FOR_PORT); 81 + return -ENODEV; 82 + } 83 + 84 + obj = acpi_evaluate_dsm(port_handle, &guid, 0, 85 + USB_DSM_DISABLE_U1_U2_FOR_PORT, NULL); 86 + 87 + if (!obj) 88 + return -ENODEV; 89 + 90 + if (obj->type != ACPI_TYPE_INTEGER) { 91 + dev_dbg(&hdev->dev, "evaluate port-%d _DSM failed\n", port1); 92 + ACPI_FREE(obj); 93 + return -EINVAL; 94 + } 95 + 96 + if (obj->integer.value == 0x01) 97 + ret = 1; 98 + 99 + ACPI_FREE(obj); 100 + 101 + return ret; 102 + } 103 + EXPORT_SYMBOL_GPL(usb_acpi_port_lpm_incapable); 104 + 40 105 /** 41 106 * usb_acpi_set_power_state - control usb port's power via acpi power 42 107 * resource
+1 -1
drivers/usb/dwc3/Kconfig
··· 3 3 config USB_DWC3 4 4 tristate "DesignWare USB3 DRD Core Support" 5 5 depends on (USB || USB_GADGET) && HAS_DMA 6 + depends on (EXTCON || EXTCON=n) 6 7 select USB_XHCI_PLATFORM if USB_XHCI_HCD 7 8 select USB_ROLE_SWITCH if USB_DWC3_DUAL_ROLE 8 9 help ··· 45 44 config USB_DWC3_DUAL_ROLE 46 45 bool "Dual Role mode" 47 46 depends on ((USB=y || USB=USB_DWC3) && (USB_GADGET=y || USB_GADGET=USB_DWC3)) 48 - depends on (EXTCON=y || EXTCON=USB_DWC3) 49 47 help 50 48 This is the default mode of working of DWC3 controller where 51 49 both host and gadget features are enabled.
+10 -2
drivers/usb/gadget/configfs.c
··· 393 393 WARN_ON(!list_empty(&gi->string_list)); 394 394 WARN_ON(!list_empty(&gi->available_func)); 395 395 kfree(gi->composite.gadget_driver.function); 396 + kfree(gi->composite.gadget_driver.driver.name); 396 397 kfree(gi); 397 398 } 398 399 ··· 1573 1572 .max_speed = USB_SPEED_SUPER_PLUS, 1574 1573 .driver = { 1575 1574 .owner = THIS_MODULE, 1576 - .name = "configfs-gadget", 1577 1575 }, 1578 1576 .match_existing_only = 1, 1579 1577 }; ··· 1623 1623 1624 1624 gi->composite.gadget_driver = configfs_driver_template; 1625 1625 1626 + gi->composite.gadget_driver.driver.name = kasprintf(GFP_KERNEL, 1627 + "configfs-gadget.%s", name); 1628 + if (!gi->composite.gadget_driver.driver.name) 1629 + goto err; 1630 + 1626 1631 gi->composite.gadget_driver.function = kstrdup(name, GFP_KERNEL); 1627 1632 gi->composite.name = gi->composite.gadget_driver.function; 1628 1633 1629 1634 if (!gi->composite.gadget_driver.function) 1630 - goto err; 1635 + goto out_free_driver_name; 1631 1636 1632 1637 return &gi->group; 1638 + 1639 + out_free_driver_name: 1640 + kfree(gi->composite.gadget_driver.driver.name); 1633 1641 err: 1634 1642 kfree(gi); 1635 1643 return ERR_PTR(-ENOMEM);
+7
drivers/usb/gadget/function/f_fs.c
··· 279 279 struct usb_request *req = ffs->ep0req; 280 280 int ret; 281 281 282 + if (!req) 283 + return -EINVAL; 284 + 282 285 req->zero = len < le16_to_cpu(ffs->ev.setup.wLength); 283 286 284 287 spin_unlock_irq(&ffs->ev.waitq.lock); ··· 1895 1892 ENTER(); 1896 1893 1897 1894 if (!WARN_ON(!ffs->gadget)) { 1895 + /* dequeue before freeing ep0req */ 1896 + usb_ep_dequeue(ffs->gadget->ep0, ffs->ep0req); 1897 + mutex_lock(&ffs->mutex); 1898 1898 usb_ep_free_request(ffs->gadget->ep0, ffs->ep0req); 1899 1899 ffs->ep0req = NULL; 1900 1900 ffs->gadget = NULL; 1901 1901 clear_bit(FFS_FL_BOUND, &ffs->flags); 1902 + mutex_unlock(&ffs->mutex); 1902 1903 ffs_data_put(ffs); 1903 1904 } 1904 1905 }
+3 -1
drivers/usb/gadget/function/f_ncm.c
··· 83 83 /* peak (theoretical) bulk transfer rate in bits-per-second */ 84 84 static inline unsigned ncm_bitrate(struct usb_gadget *g) 85 85 { 86 - if (gadget_is_superspeed(g) && g->speed >= USB_SPEED_SUPER_PLUS) 86 + if (!g) 87 + return 0; 88 + else if (gadget_is_superspeed(g) && g->speed >= USB_SPEED_SUPER_PLUS) 87 89 return 4250000000U; 88 90 else if (gadget_is_superspeed(g) && g->speed == USB_SPEED_SUPER) 89 91 return 3750000000U;
+21 -7
drivers/usb/gadget/legacy/inode.c
··· 229 229 */ 230 230 231 231 static const char *CHIP; 232 + static DEFINE_MUTEX(sb_mutex); /* Serialize superblock operations */ 232 233 233 234 /*----------------------------------------------------------------------*/ 234 235 ··· 2011 2010 { 2012 2011 struct inode *inode; 2013 2012 struct dev_data *dev; 2013 + int rc; 2014 2014 2015 - if (the_device) 2016 - return -ESRCH; 2015 + mutex_lock(&sb_mutex); 2016 + 2017 + if (the_device) { 2018 + rc = -ESRCH; 2019 + goto Done; 2020 + } 2017 2021 2018 2022 CHIP = usb_get_gadget_udc_name(); 2019 - if (!CHIP) 2020 - return -ENODEV; 2023 + if (!CHIP) { 2024 + rc = -ENODEV; 2025 + goto Done; 2026 + } 2021 2027 2022 2028 /* superblock */ 2023 2029 sb->s_blocksize = PAGE_SIZE; ··· 2061 2053 * from binding to a controller. 2062 2054 */ 2063 2055 the_device = dev; 2064 - return 0; 2056 + rc = 0; 2057 + goto Done; 2065 2058 2066 - Enomem: 2059 + Enomem: 2067 2060 kfree(CHIP); 2068 2061 CHIP = NULL; 2062 + rc = -ENOMEM; 2069 2063 2070 - return -ENOMEM; 2064 + Done: 2065 + mutex_unlock(&sb_mutex); 2066 + return rc; 2071 2067 } 2072 2068 2073 2069 /* "mount -t gadgetfs path /dev/gadget" ends up here */ ··· 2093 2081 static void 2094 2082 gadgetfs_kill_sb (struct super_block *sb) 2095 2083 { 2084 + mutex_lock(&sb_mutex); 2096 2085 kill_litter_super (sb); 2097 2086 if (the_device) { 2098 2087 put_dev (the_device); ··· 2101 2088 } 2102 2089 kfree(CHIP); 2103 2090 CHIP = NULL; 2091 + mutex_unlock(&sb_mutex); 2104 2092 } 2105 2093 2106 2094 /*----------------------------------------------------------------------*/
+3
drivers/usb/gadget/legacy/webcam.c
··· 293 293 (const struct uvc_descriptor_header *) &uvc_format_yuv, 294 294 (const struct uvc_descriptor_header *) &uvc_frame_yuv_360p, 295 295 (const struct uvc_descriptor_header *) &uvc_frame_yuv_720p, 296 + (const struct uvc_descriptor_header *) &uvc_color_matching, 296 297 (const struct uvc_descriptor_header *) &uvc_format_mjpg, 297 298 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p, 298 299 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p, ··· 306 305 (const struct uvc_descriptor_header *) &uvc_format_yuv, 307 306 (const struct uvc_descriptor_header *) &uvc_frame_yuv_360p, 308 307 (const struct uvc_descriptor_header *) &uvc_frame_yuv_720p, 308 + (const struct uvc_descriptor_header *) &uvc_color_matching, 309 309 (const struct uvc_descriptor_header *) &uvc_format_mjpg, 310 310 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p, 311 311 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p, ··· 319 317 (const struct uvc_descriptor_header *) &uvc_format_yuv, 320 318 (const struct uvc_descriptor_header *) &uvc_frame_yuv_360p, 321 319 (const struct uvc_descriptor_header *) &uvc_frame_yuv_720p, 320 + (const struct uvc_descriptor_header *) &uvc_color_matching, 322 321 (const struct uvc_descriptor_header *) &uvc_format_mjpg, 323 322 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_360p, 324 323 (const struct uvc_descriptor_header *) &uvc_frame_mjpg_720p,
+1 -1
drivers/usb/host/ehci-fsl.c
··· 29 29 #include "ehci-fsl.h" 30 30 31 31 #define DRIVER_DESC "Freescale EHCI Host controller driver" 32 - #define DRV_NAME "ehci-fsl" 32 + #define DRV_NAME "fsl-ehci" 33 33 34 34 static struct hc_driver __read_mostly fsl_ehci_hc_driver; 35 35
+45
drivers/usb/host/xhci-pci.c
··· 78 78 static struct hc_driver __read_mostly xhci_pci_hc_driver; 79 79 80 80 static int xhci_pci_setup(struct usb_hcd *hcd); 81 + static int xhci_pci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, 82 + struct usb_tt *tt, gfp_t mem_flags); 81 83 82 84 static const struct xhci_driver_overrides xhci_pci_overrides __initconst = { 83 85 .reset = xhci_pci_setup, 86 + .update_hub_device = xhci_pci_update_hub_device, 84 87 }; 85 88 86 89 /* called after powerup, by probe or system-pm "wakeup" */ ··· 355 352 NULL); 356 353 ACPI_FREE(obj); 357 354 } 355 + 356 + static void xhci_find_lpm_incapable_ports(struct usb_hcd *hcd, struct usb_device *hdev) 357 + { 358 + struct xhci_hcd *xhci = hcd_to_xhci(hcd); 359 + struct xhci_hub *rhub = &xhci->usb3_rhub; 360 + int ret; 361 + int i; 362 + 363 + /* This is not the usb3 roothub we are looking for */ 364 + if (hcd != rhub->hcd) 365 + return; 366 + 367 + if (hdev->maxchild > rhub->num_ports) { 368 + dev_err(&hdev->dev, "USB3 roothub port number mismatch\n"); 369 + return; 370 + } 371 + 372 + for (i = 0; i < hdev->maxchild; i++) { 373 + ret = usb_acpi_port_lpm_incapable(hdev, i); 374 + 375 + dev_dbg(&hdev->dev, "port-%d disable U1/U2 _DSM: %d\n", i + 1, ret); 376 + 377 + if (ret >= 0) { 378 + rhub->ports[i]->lpm_incapable = ret; 379 + continue; 380 + } 381 + } 382 + } 383 + 358 384 #else 359 385 static void xhci_pme_acpi_rtd3_enable(struct pci_dev *dev) { } 386 + static void xhci_find_lpm_incapable_ports(struct usb_hcd *hcd, struct usb_device *hdev) { } 360 387 #endif /* CONFIG_ACPI */ 361 388 362 389 /* called during probe() after chip reset completes */ ··· 417 384 418 385 /* Find any debug ports */ 419 386 return xhci_pci_reinit(xhci, pdev); 387 + } 388 + 389 + static int xhci_pci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, 390 + struct usb_tt *tt, gfp_t mem_flags) 391 + { 392 + /* Check if acpi claims some USB3 roothub ports are lpm incapable */ 393 + if (!hdev->parent) 394 + xhci_find_lpm_incapable_ports(hcd, hdev); 395 + 396 + return xhci_update_hub_device(hcd, hdev, tt, mem_flags); 420 397 } 421 398 422 399 /* ··· 497 454 498 455 if (xhci->quirks & XHCI_DEFAULT_PM_RUNTIME_ALLOW) 499 456 pm_runtime_allow(&dev->dev); 457 + 458 + dma_set_max_seg_size(&dev->dev, UINT_MAX); 500 459 501 460 return 0; 502 461
+4 -1
drivers/usb/host/xhci-ring.c
··· 1169 1169 struct xhci_virt_ep *ep; 1170 1170 struct xhci_ring *ring; 1171 1171 1172 - ep = &xhci->devs[slot_id]->eps[ep_index]; 1172 + ep = xhci_get_virt_ep(xhci, slot_id, ep_index); 1173 + if (!ep) 1174 + return; 1175 + 1173 1176 if ((ep->ep_state & EP_HAS_STREAMS) || 1174 1177 (ep->ep_state & EP_GETTING_NO_STREAMS)) { 1175 1178 int stream_id;
+17 -1
drivers/usb/host/xhci.c
··· 3974 3974 struct xhci_hcd *xhci = hcd_to_xhci(hcd); 3975 3975 struct xhci_virt_device *virt_dev; 3976 3976 struct xhci_slot_ctx *slot_ctx; 3977 + unsigned long flags; 3977 3978 int i, ret; 3978 3979 3979 3980 /* ··· 4001 4000 virt_dev->eps[i].ep_state &= ~EP_STOP_CMD_PENDING; 4002 4001 virt_dev->udev = NULL; 4003 4002 xhci_disable_slot(xhci, udev->slot_id); 4003 + 4004 + spin_lock_irqsave(&xhci->lock, flags); 4004 4005 xhci_free_virt_device(xhci, udev->slot_id); 4006 + spin_unlock_irqrestore(&xhci->lock, flags); 4007 + 4005 4008 } 4006 4009 4007 4010 int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id) ··· 5049 5044 struct usb_device *udev, enum usb3_link_state state) 5050 5045 { 5051 5046 struct xhci_hcd *xhci; 5047 + struct xhci_port *port; 5052 5048 u16 hub_encoded_timeout; 5053 5049 int mel; 5054 5050 int ret; ··· 5065 5059 5066 5060 if (xhci_check_tier_policy(xhci, udev, state) < 0) 5067 5061 return USB3_LPM_DISABLED; 5062 + 5063 + /* If connected to root port then check port can handle lpm */ 5064 + if (udev->parent && !udev->parent->parent) { 5065 + port = xhci->usb3_rhub.ports[udev->portnum - 1]; 5066 + if (port->lpm_incapable) 5067 + return USB3_LPM_DISABLED; 5068 + } 5068 5069 5069 5070 hub_encoded_timeout = xhci_calculate_lpm_timeout(hcd, udev, state); 5070 5071 mel = calculate_max_exit_latency(udev, state, hub_encoded_timeout); ··· 5132 5119 /* Once a hub descriptor is fetched for a device, we need to update the xHC's 5133 5120 * internal data structures for the device. 5134 5121 */ 5135 - static int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, 5122 + int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, 5136 5123 struct usb_tt *tt, gfp_t mem_flags) 5137 5124 { 5138 5125 struct xhci_hcd *xhci = hcd_to_xhci(hcd); ··· 5232 5219 xhci_free_command(xhci, config_cmd); 5233 5220 return ret; 5234 5221 } 5222 + EXPORT_SYMBOL_GPL(xhci_update_hub_device); 5235 5223 5236 5224 static int xhci_get_frame(struct usb_hcd *hcd) 5237 5225 { ··· 5516 5502 drv->check_bandwidth = over->check_bandwidth; 5517 5503 if (over->reset_bandwidth) 5518 5504 drv->reset_bandwidth = over->reset_bandwidth; 5505 + if (over->update_hub_device) 5506 + drv->update_hub_device = over->update_hub_device; 5519 5507 } 5520 5508 } 5521 5509 EXPORT_SYMBOL_GPL(xhci_init_driver);
+5
drivers/usb/host/xhci.h
··· 1735 1735 int hcd_portnum; 1736 1736 struct xhci_hub *rhub; 1737 1737 struct xhci_port_cap *port_cap; 1738 + unsigned int lpm_incapable:1; 1738 1739 }; 1739 1740 1740 1741 struct xhci_hub { ··· 1944 1943 struct usb_host_endpoint *ep); 1945 1944 int (*check_bandwidth)(struct usb_hcd *, struct usb_device *); 1946 1945 void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *); 1946 + int (*update_hub_device)(struct usb_hcd *hcd, struct usb_device *hdev, 1947 + struct usb_tt *tt, gfp_t mem_flags); 1947 1948 }; 1948 1949 1949 1950 #define XHCI_CFC_DELAY 10 ··· 2125 2122 struct usb_host_endpoint *ep); 2126 2123 int xhci_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); 2127 2124 void xhci_reset_bandwidth(struct usb_hcd *hcd, struct usb_device *udev); 2125 + int xhci_update_hub_device(struct usb_hcd *hcd, struct usb_device *hdev, 2126 + struct usb_tt *tt, gfp_t mem_flags); 2128 2127 int xhci_disable_slot(struct xhci_hcd *xhci, u32 slot_id); 2129 2128 int xhci_ext_cap_init(struct xhci_hcd *xhci); 2130 2129
+1 -1
drivers/usb/misc/iowarrior.c
··· 814 814 break; 815 815 816 816 case USB_DEVICE_ID_CODEMERCS_IOW100: 817 - dev->report_size = 13; 817 + dev->report_size = 12; 818 818 break; 819 819 } 820 820 }
+9 -9
drivers/usb/misc/onboard_usb_hub.c
··· 27 27 28 28 #include "onboard_usb_hub.h" 29 29 30 + static void onboard_hub_attach_usb_driver(struct work_struct *work); 31 + 30 32 static struct usb_device_driver onboard_hub_usbdev_driver; 33 + static DECLARE_WORK(attach_usb_driver_work, onboard_hub_attach_usb_driver); 31 34 32 35 /************************** Platform driver **************************/ 33 36 ··· 48 45 bool is_powered_on; 49 46 bool going_away; 50 47 struct list_head udev_list; 51 - struct work_struct attach_usb_driver_work; 52 48 struct mutex lock; 53 49 }; 54 50 ··· 273 271 * This needs to be done deferred to avoid self-deadlocks on systems 274 272 * with nested onboard hubs. 275 273 */ 276 - INIT_WORK(&hub->attach_usb_driver_work, onboard_hub_attach_usb_driver); 277 - schedule_work(&hub->attach_usb_driver_work); 274 + schedule_work(&attach_usb_driver_work); 278 275 279 276 return 0; 280 277 } ··· 285 284 struct usb_device *udev; 286 285 287 286 hub->going_away = true; 288 - 289 - if (&hub->attach_usb_driver_work != current_work()) 290 - cancel_work_sync(&hub->attach_usb_driver_work); 291 287 292 288 mutex_lock(&hub->lock); 293 289 ··· 431 433 { 432 434 int ret; 433 435 434 - ret = platform_driver_register(&onboard_hub_driver); 436 + ret = usb_register_device_driver(&onboard_hub_usbdev_driver, THIS_MODULE); 435 437 if (ret) 436 438 return ret; 437 439 438 - ret = usb_register_device_driver(&onboard_hub_usbdev_driver, THIS_MODULE); 440 + ret = platform_driver_register(&onboard_hub_driver); 439 441 if (ret) 440 - platform_driver_unregister(&onboard_hub_driver); 442 + usb_deregister_device_driver(&onboard_hub_usbdev_driver); 441 443 442 444 return ret; 443 445 } ··· 447 449 { 448 450 usb_deregister_device_driver(&onboard_hub_usbdev_driver); 449 451 platform_driver_unregister(&onboard_hub_driver); 452 + 453 + cancel_work_sync(&attach_usb_driver_work); 450 454 } 451 455 module_exit(onboard_hub_exit); 452 456
+3 -1
drivers/usb/musb/omap2430.c
··· 411 411 memset(musb_res, 0, sizeof(*musb_res) * ARRAY_SIZE(musb_res)); 412 412 413 413 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 414 - if (!res) 414 + if (!res) { 415 + ret = -EINVAL; 415 416 goto err2; 417 + } 416 418 417 419 musb_res[i].start = res->start; 418 420 musb_res[i].end = res->end;
+1
drivers/usb/serial/cp210x.c
··· 60 60 { USB_DEVICE(0x0846, 0x1100) }, /* NetGear Managed Switch M4100 series, M5300 series, M7100 series */ 61 61 { USB_DEVICE(0x08e6, 0x5501) }, /* Gemalto Prox-PU/CU contactless smartcard reader */ 62 62 { USB_DEVICE(0x08FD, 0x000A) }, /* Digianswer A/S , ZigBee/802.15.4 MAC Device */ 63 + { USB_DEVICE(0x0908, 0x0070) }, /* Siemens SCALANCE LPE-9000 USB Serial Console */ 63 64 { USB_DEVICE(0x0908, 0x01FF) }, /* Siemens RUGGEDCOM USB Serial Console */ 64 65 { USB_DEVICE(0x0988, 0x0578) }, /* Teraoka AD2000 */ 65 66 { USB_DEVICE(0x0B00, 0x3070) }, /* Ingenico 3070 */
+17
drivers/usb/serial/option.c
··· 255 255 #define QUECTEL_PRODUCT_EP06 0x0306 256 256 #define QUECTEL_PRODUCT_EM05G 0x030a 257 257 #define QUECTEL_PRODUCT_EM060K 0x030b 258 + #define QUECTEL_PRODUCT_EM05G_CS 0x030c 259 + #define QUECTEL_PRODUCT_EM05CN_SG 0x0310 258 260 #define QUECTEL_PRODUCT_EM05G_SG 0x0311 261 + #define QUECTEL_PRODUCT_EM05CN 0x0312 262 + #define QUECTEL_PRODUCT_EM05G_GR 0x0313 263 + #define QUECTEL_PRODUCT_EM05G_RS 0x0314 259 264 #define QUECTEL_PRODUCT_EM12 0x0512 260 265 #define QUECTEL_PRODUCT_RM500Q 0x0800 261 266 #define QUECTEL_PRODUCT_RM520N 0x0801 267 + #define QUECTEL_PRODUCT_EC200U 0x0901 262 268 #define QUECTEL_PRODUCT_EC200S_CN 0x6002 263 269 #define QUECTEL_PRODUCT_EC200T 0x6026 264 270 #define QUECTEL_PRODUCT_RM500K 0x7001 ··· 1165 1159 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0xff, 0xff), 1166 1160 .driver_info = RSVD(1) | RSVD(2) | RSVD(3) | RSVD(4) | NUMEP2 }, 1167 1161 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EP06, 0xff, 0, 0) }, 1162 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05CN, 0xff), 1163 + .driver_info = RSVD(6) | ZLP }, 1164 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05CN_SG, 0xff), 1165 + .driver_info = RSVD(6) | ZLP }, 1168 1166 { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G, 0xff), 1167 + .driver_info = RSVD(6) | ZLP }, 1168 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_CS, 0xff), 1169 + .driver_info = RSVD(6) | ZLP }, 1170 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_GR, 0xff), 1171 + .driver_info = RSVD(6) | ZLP }, 1172 + { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_RS, 0xff), 1169 1173 .driver_info = RSVD(6) | ZLP }, 1170 1174 { USB_DEVICE_INTERFACE_CLASS(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EM05G_SG, 0xff), 1171 1175 .driver_info = RSVD(6) | ZLP }, ··· 1196 1180 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0xff, 0x30) }, 1197 1181 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0x40) }, 1198 1182 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM520N, 0xff, 0, 0) }, 1183 + { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200U, 0xff, 0, 0) }, 1199 1184 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200S_CN, 0xff, 0, 0) }, 1200 1185 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_EC200T, 0xff, 0, 0) }, 1201 1186 { USB_DEVICE_AND_INTERFACE_INFO(QUECTEL_VENDOR_ID, QUECTEL_PRODUCT_RM500K, 0xff, 0x00, 0x00) },
+13
drivers/usb/storage/uas-detect.h
··· 116 116 if (le16_to_cpu(udev->descriptor.idVendor) == 0x0bc2) 117 117 flags |= US_FL_NO_ATA_1X; 118 118 119 + /* 120 + * RTL9210-based enclosure from HIKSEMI, MD202 reportedly have issues 121 + * with UAS. This isn't distinguishable with just idVendor and 122 + * idProduct, use manufacturer and product too. 123 + * 124 + * Reported-by: Hongling Zeng <zenghongling@kylinos.cn> 125 + */ 126 + if (le16_to_cpu(udev->descriptor.idVendor) == 0x0bda && 127 + le16_to_cpu(udev->descriptor.idProduct) == 0x9210 && 128 + (udev->manufacturer && !strcmp(udev->manufacturer, "HIKSEMI")) && 129 + (udev->product && !strcmp(udev->product, "MD202"))) 130 + flags |= US_FL_IGNORE_UAS; 131 + 119 132 usb_stor_adjust_quirks(udev, &flags); 120 133 121 134 if (flags & US_FL_IGNORE_UAS) {
-7
drivers/usb/storage/unusual_uas.h
··· 83 83 USB_SC_DEVICE, USB_PR_DEVICE, NULL, 84 84 US_FL_NO_REPORT_LUNS), 85 85 86 - /* Reported-by: Hongling Zeng <zenghongling@kylinos.cn> */ 87 - UNUSUAL_DEV(0x0bda, 0x9210, 0x0000, 0x9999, 88 - "Hiksemi", 89 - "External HDD", 90 - USB_SC_DEVICE, USB_PR_DEVICE, NULL, 91 - US_FL_IGNORE_UAS), 92 - 93 86 /* Reported-by: Benjamin Tissoires <benjamin.tissoires@redhat.com> */ 94 87 UNUSUAL_DEV(0x13fd, 0x3940, 0x0000, 0x9999, 95 88 "Initio Corporation",
+14 -8
drivers/usb/typec/altmodes/displayport.c
··· 419 419 [DP_PIN_ASSIGN_F] = "F", 420 420 }; 421 421 422 + /* 423 + * Helper function to extract a peripheral's currently supported 424 + * Pin Assignments from its DisplayPort alternate mode state. 425 + */ 426 + static u8 get_current_pin_assignments(struct dp_altmode *dp) 427 + { 428 + if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_UFP_U_AS_DFP_D) 429 + return DP_CAP_PIN_ASSIGN_DFP_D(dp->alt->vdo); 430 + else 431 + return DP_CAP_PIN_ASSIGN_UFP_D(dp->alt->vdo); 432 + } 433 + 422 434 static ssize_t 423 435 pin_assignment_store(struct device *dev, struct device_attribute *attr, 424 436 const char *buf, size_t size) ··· 457 445 goto out_unlock; 458 446 } 459 447 460 - if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_DFP_D) 461 - assignments = DP_CAP_UFP_D_PIN_ASSIGN(dp->alt->vdo); 462 - else 463 - assignments = DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo); 448 + assignments = get_current_pin_assignments(dp); 464 449 465 450 if (!(DP_CONF_GET_PIN_ASSIGN(conf) & assignments)) { 466 451 ret = -EINVAL; ··· 494 485 495 486 cur = get_count_order(DP_CONF_GET_PIN_ASSIGN(dp->data.conf)); 496 487 497 - if (DP_CONF_CURRENTLY(dp->data.conf) == DP_CONF_DFP_D) 498 - assignments = DP_CAP_UFP_D_PIN_ASSIGN(dp->alt->vdo); 499 - else 500 - assignments = DP_CAP_DFP_D_PIN_ASSIGN(dp->alt->vdo); 488 + assignments = get_current_pin_assignments(dp); 501 489 502 490 for (i = 0; assignments; assignments >>= 1, i++) { 503 491 if (assignments & 1) {
+3 -4
drivers/usb/typec/tcpm/tcpm.c
··· 4594 4594 tcpm_set_state(port, ready_state(port), 0); 4595 4595 break; 4596 4596 case DR_SWAP_CHANGE_DR: 4597 - if (port->data_role == TYPEC_HOST) { 4598 - tcpm_unregister_altmodes(port); 4597 + tcpm_unregister_altmodes(port); 4598 + if (port->data_role == TYPEC_HOST) 4599 4599 tcpm_set_roles(port, true, port->pwr_role, 4600 4600 TYPEC_DEVICE); 4601 - } else { 4601 + else 4602 4602 tcpm_set_roles(port, true, port->pwr_role, 4603 4603 TYPEC_HOST); 4604 - } 4605 4604 tcpm_ams_finish(port); 4606 4605 tcpm_set_state(port, ready_state(port), 0); 4607 4606 break;
+21 -3
drivers/usb/typec/ucsi/ucsi.c
··· 187 187 188 188 struct ucsi_work { 189 189 struct delayed_work work; 190 + struct list_head node; 190 191 unsigned long delay; 191 192 unsigned int count; 192 193 struct ucsi_connector *con; ··· 203 202 mutex_lock(&con->lock); 204 203 205 204 if (!con->partner) { 205 + list_del(&uwork->node); 206 206 mutex_unlock(&con->lock); 207 207 kfree(uwork); 208 208 return; ··· 211 209 212 210 ret = uwork->cb(con); 213 211 214 - if (uwork->count-- && (ret == -EBUSY || ret == -ETIMEDOUT)) 212 + if (uwork->count-- && (ret == -EBUSY || ret == -ETIMEDOUT)) { 215 213 queue_delayed_work(con->wq, &uwork->work, uwork->delay); 216 - else 214 + } else { 215 + list_del(&uwork->node); 217 216 kfree(uwork); 217 + } 218 218 219 219 mutex_unlock(&con->lock); 220 220 } ··· 240 236 uwork->con = con; 241 237 uwork->cb = cb; 242 238 239 + list_add_tail(&uwork->node, &con->partner_tasks); 243 240 queue_delayed_work(con->wq, &uwork->work, delay); 244 241 245 242 return 0; ··· 1061 1056 INIT_WORK(&con->work, ucsi_handle_connector_change); 1062 1057 init_completion(&con->complete); 1063 1058 mutex_init(&con->lock); 1059 + INIT_LIST_HEAD(&con->partner_tasks); 1064 1060 con->num = index + 1; 1065 1061 con->ucsi = ucsi; 1066 1062 ··· 1426 1420 ucsi_unregister_altmodes(&ucsi->connector[i], 1427 1421 UCSI_RECIPIENT_CON); 1428 1422 ucsi_unregister_port_psy(&ucsi->connector[i]); 1429 - if (ucsi->connector[i].wq) 1423 + 1424 + if (ucsi->connector[i].wq) { 1425 + struct ucsi_work *uwork; 1426 + 1427 + mutex_lock(&ucsi->connector[i].lock); 1428 + /* 1429 + * queue delayed items immediately so they can execute 1430 + * and free themselves before the wq is destroyed 1431 + */ 1432 + list_for_each_entry(uwork, &ucsi->connector[i].partner_tasks, node) 1433 + mod_delayed_work(ucsi->connector[i].wq, &uwork->work, 0); 1434 + mutex_unlock(&ucsi->connector[i].lock); 1430 1435 destroy_workqueue(ucsi->connector[i].wq); 1436 + } 1431 1437 typec_unregister_port(ucsi->connector[i].port); 1432 1438 } 1433 1439
+1
drivers/usb/typec/ucsi/ucsi.h
··· 322 322 struct work_struct work; 323 323 struct completion complete; 324 324 struct workqueue_struct *wq; 325 + struct list_head partner_tasks; 325 326 326 327 struct typec_port *port; 327 328 struct typec_partner *partner;
+20 -11
drivers/vfio/vfio_iommu_type1.c
··· 1856 1856 * significantly boosts non-hugetlbfs mappings and doesn't seem to hurt when 1857 1857 * hugetlbfs is in use. 1858 1858 */ 1859 - static void vfio_test_domain_fgsp(struct vfio_domain *domain) 1859 + static void vfio_test_domain_fgsp(struct vfio_domain *domain, struct list_head *regions) 1860 1860 { 1861 - struct page *pages; 1862 1861 int ret, order = get_order(PAGE_SIZE * 2); 1862 + struct vfio_iova *region; 1863 + struct page *pages; 1864 + dma_addr_t start; 1863 1865 1864 1866 pages = alloc_pages(GFP_KERNEL | __GFP_ZERO, order); 1865 1867 if (!pages) 1866 1868 return; 1867 1869 1868 - ret = iommu_map(domain->domain, 0, page_to_phys(pages), PAGE_SIZE * 2, 1869 - IOMMU_READ | IOMMU_WRITE | IOMMU_CACHE); 1870 - if (!ret) { 1871 - size_t unmapped = iommu_unmap(domain->domain, 0, PAGE_SIZE); 1870 + list_for_each_entry(region, regions, list) { 1871 + start = ALIGN(region->start, PAGE_SIZE * 2); 1872 + if (start >= region->end || (region->end - start < PAGE_SIZE * 2)) 1873 + continue; 1872 1874 1873 - if (unmapped == PAGE_SIZE) 1874 - iommu_unmap(domain->domain, PAGE_SIZE, PAGE_SIZE); 1875 - else 1876 - domain->fgsp = true; 1875 + ret = iommu_map(domain->domain, start, page_to_phys(pages), PAGE_SIZE * 2, 1876 + IOMMU_READ | IOMMU_WRITE | IOMMU_CACHE); 1877 + if (!ret) { 1878 + size_t unmapped = iommu_unmap(domain->domain, start, PAGE_SIZE); 1879 + 1880 + if (unmapped == PAGE_SIZE) 1881 + iommu_unmap(domain->domain, start + PAGE_SIZE, PAGE_SIZE); 1882 + else 1883 + domain->fgsp = true; 1884 + } 1885 + break; 1877 1886 } 1878 1887 1879 1888 __free_pages(pages, order); ··· 2335 2326 } 2336 2327 } 2337 2328 2338 - vfio_test_domain_fgsp(domain); 2329 + vfio_test_domain_fgsp(domain, &iova_copy); 2339 2330 2340 2331 /* replay mappings on new domains */ 2341 2332 ret = vfio_iommu_replay(iommu, domain);
+5 -1
drivers/w1/w1.c
··· 1166 1166 /* remainder if it woke up early */ 1167 1167 unsigned long jremain = 0; 1168 1168 1169 + atomic_inc(&dev->refcnt); 1170 + 1169 1171 for (;;) { 1170 1172 1171 1173 if (!jremain && dev->search_count) { ··· 1195 1193 */ 1196 1194 mutex_unlock(&dev->list_mutex); 1197 1195 1198 - if (kthread_should_stop()) 1196 + if (kthread_should_stop()) { 1197 + __set_current_state(TASK_RUNNING); 1199 1198 break; 1199 + } 1200 1200 1201 1201 /* Only sleep when the search is active. */ 1202 1202 if (dev->search_count) {
+2 -3
drivers/w1/w1_int.c
··· 51 51 dev->search_count = w1_search_count; 52 52 dev->enable_pullup = w1_enable_pullup; 53 53 54 - /* 1 for w1_process to decrement 55 - * 1 for __w1_remove_master_device to decrement 54 + /* For __w1_remove_master_device to decrement 56 55 */ 57 - atomic_set(&dev->refcnt, 2); 56 + atomic_set(&dev->refcnt, 1); 58 57 59 58 INIT_LIST_HEAD(&dev->slist); 60 59 INIT_LIST_HEAD(&dev->async_list);
+10 -3
fs/btrfs/file.c
··· 3541 3541 struct extent_buffer *leaf = path->nodes[0]; 3542 3542 struct btrfs_file_extent_item *extent; 3543 3543 u64 extent_end; 3544 + u8 type; 3544 3545 3545 3546 if (path->slots[0] >= btrfs_header_nritems(leaf)) { 3546 3547 ret = btrfs_next_leaf(root, path); ··· 3597 3596 3598 3597 extent = btrfs_item_ptr(leaf, path->slots[0], 3599 3598 struct btrfs_file_extent_item); 3599 + type = btrfs_file_extent_type(leaf, extent); 3600 3600 3601 - if (btrfs_file_extent_disk_bytenr(leaf, extent) == 0 || 3602 - btrfs_file_extent_type(leaf, extent) == 3603 - BTRFS_FILE_EXTENT_PREALLOC) { 3601 + /* 3602 + * Can't access the extent's disk_bytenr field if this is an 3603 + * inline extent, since at that offset, it's where the extent 3604 + * data starts. 3605 + */ 3606 + if (type == BTRFS_FILE_EXTENT_PREALLOC || 3607 + (type == BTRFS_FILE_EXTENT_REG && 3608 + btrfs_file_extent_disk_bytenr(leaf, extent) == 0)) { 3604 3609 /* 3605 3610 * Explicit hole or prealloc extent, search for delalloc. 3606 3611 * A prealloc extent is treated like a hole.
+17 -8
fs/btrfs/qgroup.c
··· 3367 3367 int err = -ENOMEM; 3368 3368 int ret = 0; 3369 3369 bool stopped = false; 3370 + bool did_leaf_rescans = false; 3370 3371 3371 3372 path = btrfs_alloc_path(); 3372 3373 if (!path) ··· 3388 3387 } 3389 3388 3390 3389 err = qgroup_rescan_leaf(trans, path); 3390 + did_leaf_rescans = true; 3391 3391 3392 3392 if (err > 0) 3393 3393 btrfs_commit_transaction(trans); ··· 3409 3407 mutex_unlock(&fs_info->qgroup_rescan_lock); 3410 3408 3411 3409 /* 3412 - * only update status, since the previous part has already updated the 3413 - * qgroup info. 3410 + * Only update status, since the previous part has already updated the 3411 + * qgroup info, and only if we did any actual work. This also prevents 3412 + * race with a concurrent quota disable, which has already set 3413 + * fs_info->quota_root to NULL and cleared BTRFS_FS_QUOTA_ENABLED at 3414 + * btrfs_quota_disable(). 3414 3415 */ 3415 - trans = btrfs_start_transaction(fs_info->quota_root, 1); 3416 - if (IS_ERR(trans)) { 3417 - err = PTR_ERR(trans); 3416 + if (did_leaf_rescans) { 3417 + trans = btrfs_start_transaction(fs_info->quota_root, 1); 3418 + if (IS_ERR(trans)) { 3419 + err = PTR_ERR(trans); 3420 + trans = NULL; 3421 + btrfs_err(fs_info, 3422 + "fail to start transaction for status update: %d", 3423 + err); 3424 + } 3425 + } else { 3418 3426 trans = NULL; 3419 - btrfs_err(fs_info, 3420 - "fail to start transaction for status update: %d", 3421 - err); 3422 3427 } 3423 3428 3424 3429 mutex_lock(&fs_info->qgroup_rescan_lock);
+25 -25
fs/btrfs/volumes.c
··· 2014 2014 return num_devices; 2015 2015 } 2016 2016 2017 + static void btrfs_scratch_superblock(struct btrfs_fs_info *fs_info, 2018 + struct block_device *bdev, int copy_num) 2019 + { 2020 + struct btrfs_super_block *disk_super; 2021 + const size_t len = sizeof(disk_super->magic); 2022 + const u64 bytenr = btrfs_sb_offset(copy_num); 2023 + int ret; 2024 + 2025 + disk_super = btrfs_read_disk_super(bdev, bytenr, bytenr); 2026 + if (IS_ERR(disk_super)) 2027 + return; 2028 + 2029 + memset(&disk_super->magic, 0, len); 2030 + folio_mark_dirty(virt_to_folio(disk_super)); 2031 + btrfs_release_disk_super(disk_super); 2032 + 2033 + ret = sync_blockdev_range(bdev, bytenr, bytenr + len - 1); 2034 + if (ret) 2035 + btrfs_warn(fs_info, "error clearing superblock number %d (%d)", 2036 + copy_num, ret); 2037 + } 2038 + 2017 2039 void btrfs_scratch_superblocks(struct btrfs_fs_info *fs_info, 2018 2040 struct block_device *bdev, 2019 2041 const char *device_path) 2020 2042 { 2021 - struct btrfs_super_block *disk_super; 2022 2043 int copy_num; 2023 2044 2024 2045 if (!bdev) 2025 2046 return; 2026 2047 2027 2048 for (copy_num = 0; copy_num < BTRFS_SUPER_MIRROR_MAX; copy_num++) { 2028 - struct page *page; 2029 - int ret; 2030 - 2031 - disk_super = btrfs_read_dev_one_super(bdev, copy_num, false); 2032 - if (IS_ERR(disk_super)) 2033 - continue; 2034 - 2035 - if (bdev_is_zoned(bdev)) { 2049 + if (bdev_is_zoned(bdev)) 2036 2050 btrfs_reset_sb_log_zones(bdev, copy_num); 2037 - continue; 2038 - } 2039 - 2040 - memset(&disk_super->magic, 0, sizeof(disk_super->magic)); 2041 - 2042 - page = virt_to_page(disk_super); 2043 - set_page_dirty(page); 2044 - lock_page(page); 2045 - /* write_on_page() unlocks the page */ 2046 - ret = write_one_page(page); 2047 - if (ret) 2048 - btrfs_warn(fs_info, 2049 - "error clearing superblock number %d (%d)", 2050 - copy_num, ret); 2051 - btrfs_release_disk_super(disk_super); 2052 - 2051 + else 2052 + btrfs_scratch_superblock(fs_info, bdev, copy_num); 2053 2053 } 2054 2054 2055 2055 /* Notify udev that device has changed */
+95 -146
fs/cifs/dfs_cache.c
··· 269 269 list_for_each_entry(t, &ce->tlist, list) { 270 270 seq_printf(m, " %s%s\n", 271 271 t->name, 272 - ce->tgthint == t ? " (target hint)" : ""); 272 + READ_ONCE(ce->tgthint) == t ? " (target hint)" : ""); 273 273 } 274 274 } 275 275 } ··· 321 321 cifs_dbg(FYI, "target list:\n"); 322 322 list_for_each_entry(t, &ce->tlist, list) { 323 323 cifs_dbg(FYI, " %s%s\n", t->name, 324 - ce->tgthint == t ? " (target hint)" : ""); 324 + READ_ONCE(ce->tgthint) == t ? " (target hint)" : ""); 325 325 } 326 326 } 327 327 ··· 427 427 /* Return target hint of a DFS cache entry */ 428 428 static inline char *get_tgt_name(const struct cache_entry *ce) 429 429 { 430 - struct cache_dfs_tgt *t = ce->tgthint; 430 + struct cache_dfs_tgt *t = READ_ONCE(ce->tgthint); 431 431 432 432 return t ? t->name : ERR_PTR(-ENOENT); 433 433 } ··· 470 470 static int copy_ref_data(const struct dfs_info3_param *refs, int numrefs, 471 471 struct cache_entry *ce, const char *tgthint) 472 472 { 473 + struct cache_dfs_tgt *target; 473 474 int i; 474 475 475 476 ce->ttl = max_t(int, refs[0].ttl, CACHE_MIN_TTL); ··· 497 496 ce->numtgts++; 498 497 } 499 498 500 - ce->tgthint = list_first_entry_or_null(&ce->tlist, 501 - struct cache_dfs_tgt, list); 499 + target = list_first_entry_or_null(&ce->tlist, struct cache_dfs_tgt, 500 + list); 501 + WRITE_ONCE(ce->tgthint, target); 502 502 503 503 return 0; 504 504 } ··· 560 558 } 561 559 562 560 /* Add a new DFS cache entry */ 563 - static int add_cache_entry_locked(struct dfs_info3_param *refs, int numrefs) 561 + static struct cache_entry *add_cache_entry_locked(struct dfs_info3_param *refs, 562 + int numrefs) 564 563 { 565 564 int rc; 566 565 struct cache_entry *ce; ··· 576 573 577 574 rc = cache_entry_hash(refs[0].path_name, strlen(refs[0].path_name), &hash); 578 575 if (rc) 579 - return rc; 576 + return ERR_PTR(rc); 580 577 581 578 ce = alloc_cache_entry(refs, numrefs); 582 579 if (IS_ERR(ce)) 583 - return PTR_ERR(ce); 580 + return ce; 584 581 585 582 spin_lock(&cache_ttl_lock); 586 583 if (!cache_ttl) { ··· 597 594 598 595 atomic_inc(&cache_count); 599 596 600 - return 0; 597 + return ce; 601 598 } 602 599 603 600 /* Check if two DFS paths are equal. @s1 and @s2 are expected to be in @cache_cp's charset */ ··· 644 641 * 645 642 * Use whole path components in the match. Must be called with htable_rw_lock held. 646 643 * 644 + * Return cached entry if successful. 647 645 * Return ERR_PTR(-ENOENT) if the entry is not found. 646 + * Return error ptr otherwise. 648 647 */ 649 648 static struct cache_entry *lookup_cache_entry(const char *path) 650 649 { ··· 716 711 static int update_cache_entry_locked(struct cache_entry *ce, const struct dfs_info3_param *refs, 717 712 int numrefs) 718 713 { 714 + struct cache_dfs_tgt *target; 715 + char *th = NULL; 719 716 int rc; 720 - char *s, *th = NULL; 721 717 722 718 WARN_ON(!rwsem_is_locked(&htable_rw_lock)); 723 719 724 - if (ce->tgthint) { 725 - s = ce->tgthint->name; 726 - th = kstrdup(s, GFP_ATOMIC); 720 + target = READ_ONCE(ce->tgthint); 721 + if (target) { 722 + th = kstrdup(target->name, GFP_ATOMIC); 727 723 if (!th) 728 724 return -ENOMEM; 729 725 } ··· 773 767 * 774 768 * For interlinks, cifs_mount() and expand_dfs_referral() are supposed to 775 769 * handle them properly. 770 + * 771 + * On success, return entry with acquired lock for reading, otherwise error ptr. 776 772 */ 777 - static int cache_refresh_path(const unsigned int xid, struct cifs_ses *ses, const char *path) 773 + static struct cache_entry *cache_refresh_path(const unsigned int xid, 774 + struct cifs_ses *ses, 775 + const char *path, 776 + bool force_refresh) 778 777 { 779 - int rc; 780 - struct cache_entry *ce; 781 778 struct dfs_info3_param *refs = NULL; 779 + struct cache_entry *ce; 782 780 int numrefs = 0; 783 - bool newent = false; 781 + int rc; 784 782 785 783 cifs_dbg(FYI, "%s: search path: %s\n", __func__, path); 786 784 787 - down_write(&htable_rw_lock); 785 + down_read(&htable_rw_lock); 788 786 789 787 ce = lookup_cache_entry(path); 790 788 if (!IS_ERR(ce)) { 791 - if (!cache_entry_expired(ce)) { 792 - dump_ce(ce); 793 - up_write(&htable_rw_lock); 794 - return 0; 795 - } 796 - } else { 797 - newent = true; 789 + if (!force_refresh && !cache_entry_expired(ce)) 790 + return ce; 791 + } else if (PTR_ERR(ce) != -ENOENT) { 792 + up_read(&htable_rw_lock); 793 + return ce; 798 794 } 799 795 800 796 /* 801 - * Either the entry was not found, or it is expired. 797 + * Unlock shared access as we don't want to hold any locks while getting 798 + * a new referral. The @ses used for performing the I/O could be 799 + * reconnecting and it acquires @htable_rw_lock to look up the dfs cache 800 + * in order to failover -- if necessary. 801 + */ 802 + up_read(&htable_rw_lock); 803 + 804 + /* 805 + * Either the entry was not found, or it is expired, or it is a forced 806 + * refresh. 802 807 * Request a new DFS referral in order to create or update a cache entry. 803 808 */ 804 809 rc = get_dfs_referral(xid, ses, path, &refs, &numrefs); 805 - if (rc) 806 - goto out_unlock; 810 + if (rc) { 811 + ce = ERR_PTR(rc); 812 + goto out; 813 + } 807 814 808 815 dump_refs(refs, numrefs); 809 816 810 - if (!newent) { 811 - rc = update_cache_entry_locked(ce, refs, numrefs); 812 - goto out_unlock; 817 + down_write(&htable_rw_lock); 818 + /* Re-check as another task might have it added or refreshed already */ 819 + ce = lookup_cache_entry(path); 820 + if (!IS_ERR(ce)) { 821 + if (force_refresh || cache_entry_expired(ce)) { 822 + rc = update_cache_entry_locked(ce, refs, numrefs); 823 + if (rc) 824 + ce = ERR_PTR(rc); 825 + } 826 + } else if (PTR_ERR(ce) == -ENOENT) { 827 + ce = add_cache_entry_locked(refs, numrefs); 813 828 } 814 829 815 - rc = add_cache_entry_locked(refs, numrefs); 830 + if (IS_ERR(ce)) { 831 + up_write(&htable_rw_lock); 832 + goto out; 833 + } 816 834 817 - out_unlock: 818 - up_write(&htable_rw_lock); 835 + downgrade_write(&htable_rw_lock); 836 + out: 819 837 free_dfs_info_array(refs, numrefs); 820 - return rc; 838 + return ce; 821 839 } 822 840 823 841 /* ··· 908 878 } 909 879 it->it_path_consumed = t->path_consumed; 910 880 911 - if (ce->tgthint == t) 881 + if (READ_ONCE(ce->tgthint) == t) 912 882 list_add(&it->it_list, head); 913 883 else 914 884 list_add_tail(&it->it_list, head); ··· 961 931 if (IS_ERR(npath)) 962 932 return PTR_ERR(npath); 963 933 964 - rc = cache_refresh_path(xid, ses, npath); 965 - if (rc) 966 - goto out_free_path; 967 - 968 - down_read(&htable_rw_lock); 969 - 970 - ce = lookup_cache_entry(npath); 934 + ce = cache_refresh_path(xid, ses, npath, false); 971 935 if (IS_ERR(ce)) { 972 - up_read(&htable_rw_lock); 973 936 rc = PTR_ERR(ce); 974 937 goto out_free_path; 975 938 } ··· 1026 1003 } 1027 1004 1028 1005 /** 1029 - * dfs_cache_update_tgthint - update target hint of a DFS cache entry 1030 - * 1031 - * If it doesn't find the cache entry, then it will get a DFS referral for @path 1032 - * and create a new entry. 1033 - * 1034 - * In case the cache entry exists but expired, it will get a DFS referral 1035 - * for @path and then update the respective cache entry. 1036 - * 1037 - * @xid: syscall id 1038 - * @ses: smb session 1039 - * @cp: codepage 1040 - * @remap: type of character remapping for paths 1041 - * @path: path to lookup in DFS referral cache 1042 - * @it: DFS target iterator 1043 - * 1044 - * Return zero if the target hint was updated successfully, otherwise non-zero. 1045 - */ 1046 - int dfs_cache_update_tgthint(const unsigned int xid, struct cifs_ses *ses, 1047 - const struct nls_table *cp, int remap, const char *path, 1048 - const struct dfs_cache_tgt_iterator *it) 1049 - { 1050 - int rc; 1051 - const char *npath; 1052 - struct cache_entry *ce; 1053 - struct cache_dfs_tgt *t; 1054 - 1055 - npath = dfs_cache_canonical_path(path, cp, remap); 1056 - if (IS_ERR(npath)) 1057 - return PTR_ERR(npath); 1058 - 1059 - cifs_dbg(FYI, "%s: update target hint - path: %s\n", __func__, npath); 1060 - 1061 - rc = cache_refresh_path(xid, ses, npath); 1062 - if (rc) 1063 - goto out_free_path; 1064 - 1065 - down_write(&htable_rw_lock); 1066 - 1067 - ce = lookup_cache_entry(npath); 1068 - if (IS_ERR(ce)) { 1069 - rc = PTR_ERR(ce); 1070 - goto out_unlock; 1071 - } 1072 - 1073 - t = ce->tgthint; 1074 - 1075 - if (likely(!strcasecmp(it->it_name, t->name))) 1076 - goto out_unlock; 1077 - 1078 - list_for_each_entry(t, &ce->tlist, list) { 1079 - if (!strcasecmp(t->name, it->it_name)) { 1080 - ce->tgthint = t; 1081 - cifs_dbg(FYI, "%s: new target hint: %s\n", __func__, 1082 - it->it_name); 1083 - break; 1084 - } 1085 - } 1086 - 1087 - out_unlock: 1088 - up_write(&htable_rw_lock); 1089 - out_free_path: 1090 - kfree(npath); 1091 - return rc; 1092 - } 1093 - 1094 - /** 1095 1006 * dfs_cache_noreq_update_tgthint - update target hint of a DFS cache entry 1096 1007 * without sending any requests to the currently connected server. 1097 1008 * ··· 1049 1092 1050 1093 cifs_dbg(FYI, "%s: path: %s\n", __func__, path); 1051 1094 1052 - if (!down_write_trylock(&htable_rw_lock)) 1053 - return; 1095 + down_read(&htable_rw_lock); 1054 1096 1055 1097 ce = lookup_cache_entry(path); 1056 1098 if (IS_ERR(ce)) 1057 1099 goto out_unlock; 1058 1100 1059 - t = ce->tgthint; 1101 + t = READ_ONCE(ce->tgthint); 1060 1102 1061 1103 if (unlikely(!strcasecmp(it->it_name, t->name))) 1062 1104 goto out_unlock; 1063 1105 1064 1106 list_for_each_entry(t, &ce->tlist, list) { 1065 1107 if (!strcasecmp(t->name, it->it_name)) { 1066 - ce->tgthint = t; 1108 + WRITE_ONCE(ce->tgthint, t); 1067 1109 cifs_dbg(FYI, "%s: new target hint: %s\n", __func__, 1068 1110 it->it_name); 1069 1111 break; ··· 1070 1114 } 1071 1115 1072 1116 out_unlock: 1073 - up_write(&htable_rw_lock); 1117 + up_read(&htable_rw_lock); 1074 1118 } 1075 1119 1076 1120 /** ··· 1276 1320 * Mark dfs tcon for reconnecting when the currently connected tcon does not match any of the new 1277 1321 * target shares in @refs. 1278 1322 */ 1279 - static void mark_for_reconnect_if_needed(struct cifs_tcon *tcon, struct dfs_cache_tgt_list *tl, 1280 - const struct dfs_info3_param *refs, int numrefs) 1323 + static void mark_for_reconnect_if_needed(struct TCP_Server_Info *server, 1324 + struct dfs_cache_tgt_list *old_tl, 1325 + struct dfs_cache_tgt_list *new_tl) 1281 1326 { 1282 - struct dfs_cache_tgt_iterator *it; 1283 - int i; 1327 + struct dfs_cache_tgt_iterator *oit, *nit; 1284 1328 1285 - for (it = dfs_cache_get_tgt_iterator(tl); it; it = dfs_cache_get_next_tgt(tl, it)) { 1286 - for (i = 0; i < numrefs; i++) { 1287 - if (target_share_equal(tcon->ses->server, dfs_cache_get_tgt_name(it), 1288 - refs[i].node_name)) 1329 + for (oit = dfs_cache_get_tgt_iterator(old_tl); oit; 1330 + oit = dfs_cache_get_next_tgt(old_tl, oit)) { 1331 + for (nit = dfs_cache_get_tgt_iterator(new_tl); nit; 1332 + nit = dfs_cache_get_next_tgt(new_tl, nit)) { 1333 + if (target_share_equal(server, 1334 + dfs_cache_get_tgt_name(oit), 1335 + dfs_cache_get_tgt_name(nit))) 1289 1336 return; 1290 1337 } 1291 1338 } 1292 1339 1293 1340 cifs_dbg(FYI, "%s: no cached or matched targets. mark dfs share for reconnect.\n", __func__); 1294 - cifs_signal_cifsd_for_reconnect(tcon->ses->server, true); 1341 + cifs_signal_cifsd_for_reconnect(server, true); 1295 1342 } 1296 1343 1297 1344 /* Refresh dfs referral of tcon and mark it for reconnect if needed */ 1298 1345 static int __refresh_tcon(const char *path, struct cifs_tcon *tcon, bool force_refresh) 1299 1346 { 1300 - struct dfs_cache_tgt_list tl = DFS_CACHE_TGT_LIST_INIT(tl); 1347 + struct dfs_cache_tgt_list old_tl = DFS_CACHE_TGT_LIST_INIT(old_tl); 1348 + struct dfs_cache_tgt_list new_tl = DFS_CACHE_TGT_LIST_INIT(new_tl); 1301 1349 struct cifs_ses *ses = CIFS_DFS_ROOT_SES(tcon->ses); 1302 1350 struct cifs_tcon *ipc = ses->tcon_ipc; 1303 - struct dfs_info3_param *refs = NULL; 1304 1351 bool needs_refresh = false; 1305 1352 struct cache_entry *ce; 1306 1353 unsigned int xid; 1307 - int numrefs = 0; 1308 1354 int rc = 0; 1309 1355 1310 1356 xid = get_xid(); ··· 1315 1357 ce = lookup_cache_entry(path); 1316 1358 needs_refresh = force_refresh || IS_ERR(ce) || cache_entry_expired(ce); 1317 1359 if (!IS_ERR(ce)) { 1318 - rc = get_targets(ce, &tl); 1319 - if (rc) 1320 - cifs_dbg(FYI, "%s: could not get dfs targets: %d\n", __func__, rc); 1360 + rc = get_targets(ce, &old_tl); 1361 + cifs_dbg(FYI, "%s: get_targets: %d\n", __func__, rc); 1321 1362 } 1322 1363 up_read(&htable_rw_lock); 1323 1364 ··· 1333 1376 } 1334 1377 spin_unlock(&ipc->tc_lock); 1335 1378 1336 - rc = get_dfs_referral(xid, ses, path, &refs, &numrefs); 1337 - if (!rc) { 1338 - /* Create or update a cache entry with the new referral */ 1339 - dump_refs(refs, numrefs); 1340 - 1341 - down_write(&htable_rw_lock); 1342 - ce = lookup_cache_entry(path); 1343 - if (IS_ERR(ce)) 1344 - add_cache_entry_locked(refs, numrefs); 1345 - else if (force_refresh || cache_entry_expired(ce)) 1346 - update_cache_entry_locked(ce, refs, numrefs); 1347 - up_write(&htable_rw_lock); 1348 - 1349 - mark_for_reconnect_if_needed(tcon, &tl, refs, numrefs); 1379 + ce = cache_refresh_path(xid, ses, path, true); 1380 + if (!IS_ERR(ce)) { 1381 + rc = get_targets(ce, &new_tl); 1382 + up_read(&htable_rw_lock); 1383 + cifs_dbg(FYI, "%s: get_targets: %d\n", __func__, rc); 1384 + mark_for_reconnect_if_needed(tcon->ses->server, &old_tl, &new_tl); 1350 1385 } 1351 1386 1352 1387 out: 1353 1388 free_xid(xid); 1354 - dfs_cache_free_tgts(&tl); 1355 - free_dfs_info_array(refs, numrefs); 1389 + dfs_cache_free_tgts(&old_tl); 1390 + dfs_cache_free_tgts(&new_tl); 1356 1391 return rc; 1357 1392 } 1358 1393
-3
fs/cifs/dfs_cache.h
··· 35 35 struct dfs_cache_tgt_list *tgt_list); 36 36 int dfs_cache_noreq_find(const char *path, struct dfs_info3_param *ref, 37 37 struct dfs_cache_tgt_list *tgt_list); 38 - int dfs_cache_update_tgthint(const unsigned int xid, struct cifs_ses *ses, 39 - const struct nls_table *cp, int remap, const char *path, 40 - const struct dfs_cache_tgt_iterator *it); 41 38 void dfs_cache_noreq_update_tgthint(const char *path, const struct dfs_cache_tgt_iterator *it); 42 39 int dfs_cache_get_tgt_referral(const char *path, const struct dfs_cache_tgt_iterator *it, 43 40 struct dfs_info3_param *ref);
+9 -6
fs/cifs/smb2pdu.c
··· 4163 4163 (struct smb2_hdr *)rdata->iov[0].iov_base; 4164 4164 struct cifs_credits credits = { .value = 0, .instance = 0 }; 4165 4165 struct smb_rqst rqst = { .rq_iov = &rdata->iov[1], 4166 - .rq_nvec = 1, 4167 - .rq_pages = rdata->pages, 4168 - .rq_offset = rdata->page_offset, 4169 - .rq_npages = rdata->nr_pages, 4170 - .rq_pagesz = rdata->pagesz, 4171 - .rq_tailsz = rdata->tailsz }; 4166 + .rq_nvec = 1, }; 4167 + 4168 + if (rdata->got_bytes) { 4169 + rqst.rq_pages = rdata->pages; 4170 + rqst.rq_offset = rdata->page_offset; 4171 + rqst.rq_npages = rdata->nr_pages; 4172 + rqst.rq_pagesz = rdata->pagesz; 4173 + rqst.rq_tailsz = rdata->tailsz; 4174 + } 4172 4175 4173 4176 WARN_ONCE(rdata->server != mid->server, 4174 4177 "rdata server %p != mid server %p",
+39 -1
fs/ext4/xattr.c
··· 81 81 struct mb_cache_entry **); 82 82 static __le32 ext4_xattr_hash_entry(char *name, size_t name_len, __le32 *value, 83 83 size_t value_count); 84 + static __le32 ext4_xattr_hash_entry_signed(char *name, size_t name_len, __le32 *value, 85 + size_t value_count); 84 86 static void ext4_xattr_rehash(struct ext4_xattr_header *); 85 87 86 88 static const struct xattr_handler * const ext4_xattr_handler_map[] = { ··· 472 470 tmp_data = cpu_to_le32(hash); 473 471 e_hash = ext4_xattr_hash_entry(entry->e_name, entry->e_name_len, 474 472 &tmp_data, 1); 473 + /* All good? */ 474 + if (e_hash == entry->e_hash) 475 + return 0; 476 + 477 + /* 478 + * Not good. Maybe the entry hash was calculated 479 + * using the buggy signed char version? 480 + */ 481 + e_hash = ext4_xattr_hash_entry_signed(entry->e_name, entry->e_name_len, 482 + &tmp_data, 1); 483 + /* Still no match - bad */ 475 484 if (e_hash != entry->e_hash) 476 485 return -EFSCORRUPTED; 486 + 487 + /* Let people know about old hash */ 488 + pr_warn_once("ext4: filesystem with signed xattr name hash"); 477 489 } 478 490 return 0; 479 491 } ··· 3097 3081 while (name_len--) { 3098 3082 hash = (hash << NAME_HASH_SHIFT) ^ 3099 3083 (hash >> (8*sizeof(hash) - NAME_HASH_SHIFT)) ^ 3100 - *name++; 3084 + (unsigned char)*name++; 3085 + } 3086 + while (value_count--) { 3087 + hash = (hash << VALUE_HASH_SHIFT) ^ 3088 + (hash >> (8*sizeof(hash) - VALUE_HASH_SHIFT)) ^ 3089 + le32_to_cpu(*value++); 3090 + } 3091 + return cpu_to_le32(hash); 3092 + } 3093 + 3094 + /* 3095 + * ext4_xattr_hash_entry_signed() 3096 + * 3097 + * Compute the hash of an extended attribute incorrectly. 3098 + */ 3099 + static __le32 ext4_xattr_hash_entry_signed(char *name, size_t name_len, __le32 *value, size_t value_count) 3100 + { 3101 + __u32 hash = 0; 3102 + 3103 + while (name_len--) { 3104 + hash = (hash << NAME_HASH_SHIFT) ^ 3105 + (hash >> (8*sizeof(hash) - NAME_HASH_SHIFT)) ^ 3106 + (signed char)*name++; 3101 3107 } 3102 3108 while (value_count--) { 3103 3109 hash = (hash << VALUE_HASH_SHIFT) ^
+61 -7
fs/fuse/acl.c
··· 11 11 #include <linux/posix_acl.h> 12 12 #include <linux/posix_acl_xattr.h> 13 13 14 - struct posix_acl *fuse_get_acl(struct inode *inode, int type, bool rcu) 14 + static struct posix_acl *__fuse_get_acl(struct fuse_conn *fc, 15 + struct user_namespace *mnt_userns, 16 + struct inode *inode, int type, bool rcu) 15 17 { 16 - struct fuse_conn *fc = get_fuse_conn(inode); 17 18 int size; 18 19 const char *name; 19 20 void *value = NULL; ··· 26 25 if (fuse_is_bad(inode)) 27 26 return ERR_PTR(-EIO); 28 27 29 - if (!fc->posix_acl || fc->no_getxattr) 28 + if (fc->no_getxattr) 30 29 return NULL; 31 30 32 31 if (type == ACL_TYPE_ACCESS) ··· 54 53 return acl; 55 54 } 56 55 56 + static inline bool fuse_no_acl(const struct fuse_conn *fc, 57 + const struct inode *inode) 58 + { 59 + /* 60 + * Refuse interacting with POSIX ACLs for daemons that 61 + * don't support FUSE_POSIX_ACL and are not mounted on 62 + * the host to retain backwards compatibility. 63 + */ 64 + return !fc->posix_acl && (i_user_ns(inode) != &init_user_ns); 65 + } 66 + 67 + struct posix_acl *fuse_get_acl(struct user_namespace *mnt_userns, 68 + struct dentry *dentry, int type) 69 + { 70 + struct inode *inode = d_inode(dentry); 71 + struct fuse_conn *fc = get_fuse_conn(inode); 72 + 73 + if (fuse_no_acl(fc, inode)) 74 + return ERR_PTR(-EOPNOTSUPP); 75 + 76 + return __fuse_get_acl(fc, mnt_userns, inode, type, false); 77 + } 78 + 79 + struct posix_acl *fuse_get_inode_acl(struct inode *inode, int type, bool rcu) 80 + { 81 + struct fuse_conn *fc = get_fuse_conn(inode); 82 + 83 + /* 84 + * FUSE daemons before FUSE_POSIX_ACL was introduced could get and set 85 + * POSIX ACLs without them being used for permission checking by the 86 + * vfs. Retain that behavior for backwards compatibility as there are 87 + * filesystems that do all permission checking for acls in the daemon 88 + * and not in the kernel. 89 + */ 90 + if (!fc->posix_acl) 91 + return NULL; 92 + 93 + return __fuse_get_acl(fc, &init_user_ns, inode, type, rcu); 94 + } 95 + 57 96 int fuse_set_acl(struct user_namespace *mnt_userns, struct dentry *dentry, 58 97 struct posix_acl *acl, int type) 59 98 { ··· 105 64 if (fuse_is_bad(inode)) 106 65 return -EIO; 107 66 108 - if (!fc->posix_acl || fc->no_setxattr) 67 + if (fc->no_setxattr || fuse_no_acl(fc, inode)) 109 68 return -EOPNOTSUPP; 110 69 111 70 if (type == ACL_TYPE_ACCESS) ··· 140 99 return ret; 141 100 } 142 101 143 - if (!vfsgid_in_group_p(i_gid_into_vfsgid(&init_user_ns, inode)) && 102 + /* 103 + * Fuse daemons without FUSE_POSIX_ACL never changed the passed 104 + * through POSIX ACLs. Such daemons don't expect setgid bits to 105 + * be stripped. 106 + */ 107 + if (fc->posix_acl && 108 + !vfsgid_in_group_p(i_gid_into_vfsgid(&init_user_ns, inode)) && 144 109 !capable_wrt_inode_uidgid(&init_user_ns, inode, CAP_FSETID)) 145 110 extra_flags |= FUSE_SETXATTR_ACL_KILL_SGID; 146 111 ··· 155 108 } else { 156 109 ret = fuse_removexattr(inode, name); 157 110 } 158 - forget_all_cached_acls(inode); 159 - fuse_invalidate_attr(inode); 111 + 112 + if (fc->posix_acl) { 113 + /* 114 + * Fuse daemons without FUSE_POSIX_ACL never cached POSIX ACLs 115 + * and didn't invalidate attributes. Retain that behavior. 116 + */ 117 + forget_all_cached_acls(inode); 118 + fuse_invalidate_attr(inode); 119 + } 160 120 161 121 return ret; 162 122 }
+4 -2
fs/fuse/dir.c
··· 1942 1942 .permission = fuse_permission, 1943 1943 .getattr = fuse_getattr, 1944 1944 .listxattr = fuse_listxattr, 1945 - .get_inode_acl = fuse_get_acl, 1945 + .get_inode_acl = fuse_get_inode_acl, 1946 + .get_acl = fuse_get_acl, 1946 1947 .set_acl = fuse_set_acl, 1947 1948 .fileattr_get = fuse_fileattr_get, 1948 1949 .fileattr_set = fuse_fileattr_set, ··· 1965 1964 .permission = fuse_permission, 1966 1965 .getattr = fuse_getattr, 1967 1966 .listxattr = fuse_listxattr, 1968 - .get_inode_acl = fuse_get_acl, 1967 + .get_inode_acl = fuse_get_inode_acl, 1968 + .get_acl = fuse_get_acl, 1969 1969 .set_acl = fuse_set_acl, 1970 1970 .fileattr_get = fuse_fileattr_get, 1971 1971 .fileattr_set = fuse_fileattr_set,
+3 -3
fs/fuse/fuse_i.h
··· 1264 1264 ssize_t fuse_listxattr(struct dentry *entry, char *list, size_t size); 1265 1265 int fuse_removexattr(struct inode *inode, const char *name); 1266 1266 extern const struct xattr_handler *fuse_xattr_handlers[]; 1267 - extern const struct xattr_handler *fuse_acl_xattr_handlers[]; 1268 - extern const struct xattr_handler *fuse_no_acl_xattr_handlers[]; 1269 1267 1270 1268 struct posix_acl; 1271 - struct posix_acl *fuse_get_acl(struct inode *inode, int type, bool rcu); 1269 + struct posix_acl *fuse_get_inode_acl(struct inode *inode, int type, bool rcu); 1270 + struct posix_acl *fuse_get_acl(struct user_namespace *mnt_userns, 1271 + struct dentry *dentry, int type); 1272 1272 int fuse_set_acl(struct user_namespace *mnt_userns, struct dentry *dentry, 1273 1273 struct posix_acl *acl, int type); 1274 1274
+10 -11
fs/fuse/inode.c
··· 311 311 fuse_dax_dontcache(inode, attr->flags); 312 312 } 313 313 314 - static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr) 314 + static void fuse_init_inode(struct inode *inode, struct fuse_attr *attr, 315 + struct fuse_conn *fc) 315 316 { 316 317 inode->i_mode = attr->mode & S_IFMT; 317 318 inode->i_size = attr->size; ··· 334 333 new_decode_dev(attr->rdev)); 335 334 } else 336 335 BUG(); 336 + /* 337 + * Ensure that we don't cache acls for daemons without FUSE_POSIX_ACL 338 + * so they see the exact same behavior as before. 339 + */ 340 + if (!fc->posix_acl) 341 + inode->i_acl = inode->i_default_acl = ACL_DONT_CACHE; 337 342 } 338 343 339 344 static int fuse_inode_eq(struct inode *inode, void *_nodeidp) ··· 379 372 if (!inode) 380 373 return NULL; 381 374 382 - fuse_init_inode(inode, attr); 375 + fuse_init_inode(inode, attr, fc); 383 376 get_fuse_inode(inode)->nodeid = nodeid; 384 377 inode->i_flags |= S_AUTOMOUNT; 385 378 goto done; ··· 395 388 if (!fc->writeback_cache || !S_ISREG(attr->mode)) 396 389 inode->i_flags |= S_NOCMTIME; 397 390 inode->i_generation = generation; 398 - fuse_init_inode(inode, attr); 391 + fuse_init_inode(inode, attr, fc); 399 392 unlock_new_inode(inode); 400 393 } else if (fuse_stale_inode(inode, generation, attr)) { 401 394 /* nodeid was reused, any I/O on the old inode should fail */ ··· 1181 1174 if ((flags & FUSE_POSIX_ACL)) { 1182 1175 fc->default_permissions = 1; 1183 1176 fc->posix_acl = 1; 1184 - fm->sb->s_xattr = fuse_acl_xattr_handlers; 1185 1177 } 1186 1178 if (flags & FUSE_CACHE_SYMLINKS) 1187 1179 fc->cache_symlinks = 1; ··· 1426 1420 if (sb->s_user_ns != &init_user_ns) 1427 1421 sb->s_iflags |= SB_I_UNTRUSTED_MOUNTER; 1428 1422 sb->s_flags &= ~(SB_NOSEC | SB_I_VERSION); 1429 - 1430 - /* 1431 - * If we are not in the initial user namespace posix 1432 - * acls must be translated. 1433 - */ 1434 - if (sb->s_user_ns != &init_user_ns) 1435 - sb->s_xattr = fuse_no_acl_xattr_handlers; 1436 1423 } 1437 1424 1438 1425 static int fuse_fill_super_submount(struct super_block *sb,
-51
fs/fuse/xattr.c
··· 203 203 return fuse_setxattr(inode, name, value, size, flags, 0); 204 204 } 205 205 206 - static bool no_xattr_list(struct dentry *dentry) 207 - { 208 - return false; 209 - } 210 - 211 - static int no_xattr_get(const struct xattr_handler *handler, 212 - struct dentry *dentry, struct inode *inode, 213 - const char *name, void *value, size_t size) 214 - { 215 - return -EOPNOTSUPP; 216 - } 217 - 218 - static int no_xattr_set(const struct xattr_handler *handler, 219 - struct user_namespace *mnt_userns, 220 - struct dentry *dentry, struct inode *nodee, 221 - const char *name, const void *value, 222 - size_t size, int flags) 223 - { 224 - return -EOPNOTSUPP; 225 - } 226 - 227 206 static const struct xattr_handler fuse_xattr_handler = { 228 207 .prefix = "", 229 208 .get = fuse_xattr_get, ··· 210 231 }; 211 232 212 233 const struct xattr_handler *fuse_xattr_handlers[] = { 213 - &fuse_xattr_handler, 214 - NULL 215 - }; 216 - 217 - const struct xattr_handler *fuse_acl_xattr_handlers[] = { 218 - &posix_acl_access_xattr_handler, 219 - &posix_acl_default_xattr_handler, 220 - &fuse_xattr_handler, 221 - NULL 222 - }; 223 - 224 - static const struct xattr_handler fuse_no_acl_access_xattr_handler = { 225 - .name = XATTR_NAME_POSIX_ACL_ACCESS, 226 - .flags = ACL_TYPE_ACCESS, 227 - .list = no_xattr_list, 228 - .get = no_xattr_get, 229 - .set = no_xattr_set, 230 - }; 231 - 232 - static const struct xattr_handler fuse_no_acl_default_xattr_handler = { 233 - .name = XATTR_NAME_POSIX_ACL_DEFAULT, 234 - .flags = ACL_TYPE_ACCESS, 235 - .list = no_xattr_list, 236 - .get = no_xattr_get, 237 - .set = no_xattr_set, 238 - }; 239 - 240 - const struct xattr_handler *fuse_no_acl_xattr_handlers[] = { 241 - &fuse_no_acl_access_xattr_handler, 242 - &fuse_no_acl_default_xattr_handler, 243 234 &fuse_xattr_handler, 244 235 NULL 245 236 };
+10 -1
fs/gfs2/log.c
··· 80 80 brelse(bd->bd_bh); 81 81 } 82 82 83 + static int __gfs2_writepage(struct page *page, struct writeback_control *wbc, 84 + void *data) 85 + { 86 + struct address_space *mapping = data; 87 + int ret = mapping->a_ops->writepage(page, wbc); 88 + mapping_set_error(mapping, ret); 89 + return ret; 90 + } 91 + 83 92 /** 84 93 * gfs2_ail1_start_one - Start I/O on a transaction 85 94 * @sdp: The superblock ··· 140 131 if (!mapping) 141 132 continue; 142 133 spin_unlock(&sdp->sd_ail_lock); 143 - ret = filemap_fdatawrite_wbc(mapping, wbc); 134 + ret = write_cache_pages(mapping, wbc, __gfs2_writepage, mapping); 144 135 if (need_resched()) { 145 136 blk_finish_plug(plug); 146 137 cond_resched();
+36 -25
fs/nfsd/filecache.c
··· 662 662 }; 663 663 664 664 /** 665 + * nfsd_file_cond_queue - conditionally unhash and queue a nfsd_file 666 + * @nf: nfsd_file to attempt to queue 667 + * @dispose: private list to queue successfully-put objects 668 + * 669 + * Unhash an nfsd_file, try to get a reference to it, and then put that 670 + * reference. If it's the last reference, queue it to the dispose list. 671 + */ 672 + static void 673 + nfsd_file_cond_queue(struct nfsd_file *nf, struct list_head *dispose) 674 + __must_hold(RCU) 675 + { 676 + int decrement = 1; 677 + 678 + /* If we raced with someone else unhashing, ignore it */ 679 + if (!nfsd_file_unhash(nf)) 680 + return; 681 + 682 + /* If we can't get a reference, ignore it */ 683 + if (!nfsd_file_get(nf)) 684 + return; 685 + 686 + /* Extra decrement if we remove from the LRU */ 687 + if (nfsd_file_lru_remove(nf)) 688 + ++decrement; 689 + 690 + /* If refcount goes to 0, then put on the dispose list */ 691 + if (refcount_sub_and_test(decrement, &nf->nf_ref)) { 692 + list_add(&nf->nf_lru, dispose); 693 + trace_nfsd_file_closing(nf); 694 + } 695 + } 696 + 697 + /** 665 698 * nfsd_file_queue_for_close: try to close out any open nfsd_files for an inode 666 699 * @inode: inode on which to close out nfsd_files 667 700 * @dispose: list on which to gather nfsd_files to close out ··· 721 688 722 689 rcu_read_lock(); 723 690 do { 724 - int decrement = 1; 725 - 726 691 nf = rhashtable_lookup(&nfsd_file_rhash_tbl, &key, 727 692 nfsd_file_rhash_params); 728 693 if (!nf) 729 694 break; 730 - 731 - /* If we raced with someone else unhashing, ignore it */ 732 - if (!nfsd_file_unhash(nf)) 733 - continue; 734 - 735 - /* If we can't get a reference, ignore it */ 736 - if (!nfsd_file_get(nf)) 737 - continue; 738 - 739 - /* Extra decrement if we remove from the LRU */ 740 - if (nfsd_file_lru_remove(nf)) 741 - ++decrement; 742 - 743 - /* If refcount goes to 0, then put on the dispose list */ 744 - if (refcount_sub_and_test(decrement, &nf->nf_ref)) { 745 - list_add(&nf->nf_lru, dispose); 746 - trace_nfsd_file_closing(nf); 747 - } 695 + nfsd_file_cond_queue(nf, dispose); 748 696 } while (1); 749 697 rcu_read_unlock(); 750 698 } ··· 942 928 943 929 nf = rhashtable_walk_next(&iter); 944 930 while (!IS_ERR_OR_NULL(nf)) { 945 - if (!net || nf->nf_net == net) { 946 - nfsd_file_unhash(nf); 947 - nfsd_file_lru_remove(nf); 948 - list_add(&nf->nf_lru, &dispose); 949 - } 931 + if (!net || nf->nf_net == net) 932 + nfsd_file_cond_queue(nf, &dispose); 950 933 nf = rhashtable_walk_next(&iter); 951 934 } 952 935
+4 -4
include/linux/firmware/xlnx-zynqmp.h
··· 545 545 const u64 address, 546 546 const enum zynqmp_pm_request_ack ack); 547 547 int zynqmp_pm_get_rpu_mode(u32 node_id, enum rpu_oper_mode *rpu_mode); 548 - int zynqmp_pm_set_rpu_mode(u32 node_id, u32 arg1); 549 - int zynqmp_pm_set_tcm_config(u32 node_id, u32 arg1); 548 + int zynqmp_pm_set_rpu_mode(u32 node_id, enum rpu_oper_mode rpu_mode); 549 + int zynqmp_pm_set_tcm_config(u32 node_id, enum rpu_tcm_comb tcm_mode); 550 550 int zynqmp_pm_set_sd_config(u32 node, enum pm_sd_config_type config, u32 value); 551 551 int zynqmp_pm_set_gem_config(u32 node, enum pm_gem_config_type config, 552 552 u32 value); ··· 845 845 return -ENODEV; 846 846 } 847 847 848 - static inline int zynqmp_pm_set_rpu_mode(u32 node_id, u32 arg1) 848 + static inline int zynqmp_pm_set_rpu_mode(u32 node_id, enum rpu_oper_mode rpu_mode) 849 849 { 850 850 return -ENODEV; 851 851 } 852 852 853 - static inline int zynqmp_pm_set_tcm_config(u32 node_id, u32 arg1) 853 + static inline int zynqmp_pm_set_tcm_config(u32 node_id, enum rpu_tcm_comb tcm_mode) 854 854 { 855 855 return -ENODEV; 856 856 }
+2 -2
include/linux/soc/ti/omap1-io.h
··· 5 5 #ifndef __ASSEMBLER__ 6 6 #include <linux/types.h> 7 7 8 - #ifdef CONFIG_ARCH_OMAP1_ANY 8 + #ifdef CONFIG_ARCH_OMAP1 9 9 /* 10 10 * NOTE: Please use ioremap + __raw_read/write where possible instead of these 11 11 */ ··· 15 15 extern void omap_writeb(u8 v, u32 pa); 16 16 extern void omap_writew(u16 v, u32 pa); 17 17 extern void omap_writel(u32 v, u32 pa); 18 - #else 18 + #elif defined(CONFIG_COMPILE_TEST) 19 19 static inline u8 omap_readb(u32 pa) { return 0; } 20 20 static inline u16 omap_readw(u32 pa) { return 0; } 21 21 static inline u32 omap_readl(u32 pa) { return 0; }
+10 -8
include/linux/usb.h
··· 267 267 } 268 268 269 269 /** 270 - * usb_set_intfdata() - associate driver-specific data with the interface 271 - * @intf: the usb interface 272 - * @data: pointer to the device priv structure or %NULL 270 + * usb_set_intfdata() - associate driver-specific data with an interface 271 + * @intf: USB interface 272 + * @data: driver data 273 273 * 274 - * Drivers should use this function in their probe() to associate their 275 - * driver-specific data with the usb interface. 274 + * Drivers can use this function in their probe() callbacks to associate 275 + * driver-specific data with an interface. 276 276 * 277 - * When disconnecting, the core will take care of setting @intf back to %NULL, 278 - * so no actions are needed on the driver side. The interface should not be set 279 - * to %NULL before all actions completed (e.g. no outsanding URB remaining). 277 + * Note that there is generally no need to clear the driver-data pointer even 278 + * if some drivers do so for historical or implementation-specific reasons. 280 279 */ 281 280 static inline void usb_set_intfdata(struct usb_interface *intf, void *data) 282 281 { ··· 773 774 extern int usb_acpi_set_power_state(struct usb_device *hdev, int index, 774 775 bool enable); 775 776 extern bool usb_acpi_power_manageable(struct usb_device *hdev, int index); 777 + extern int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index); 776 778 #else 777 779 static inline int usb_acpi_set_power_state(struct usb_device *hdev, int index, 778 780 bool enable) { return 0; } 779 781 static inline bool usb_acpi_power_manageable(struct usb_device *hdev, int index) 780 782 { return true; } 783 + static inline int usb_acpi_port_lpm_incapable(struct usb_device *hdev, int index) 784 + { return 0; } 781 785 #endif 782 786 783 787 /* USB autosuspend and autoresume */
+3
include/net/mana/gdma.h
··· 336 336 }; 337 337 }; 338 338 339 + #define MANA_IRQ_NAME_SZ 32 340 + 339 341 struct gdma_irq_context { 340 342 void (*handler)(void *arg); 341 343 void *arg; 344 + char name[MANA_IRQ_NAME_SZ]; 342 345 }; 343 346 344 347 struct gdma_context {
+2
include/scsi/libiscsi.h
··· 422 422 extern struct iscsi_cls_session * 423 423 iscsi_session_setup(struct iscsi_transport *, struct Scsi_Host *shost, 424 424 uint16_t, int, int, uint32_t, unsigned int); 425 + void iscsi_session_remove(struct iscsi_cls_session *cls_session); 426 + void iscsi_session_free(struct iscsi_cls_session *cls_session); 425 427 extern void iscsi_session_teardown(struct iscsi_cls_session *); 426 428 extern void iscsi_session_recovery_timedout(struct iscsi_cls_session *); 427 429 extern int iscsi_set_param(struct iscsi_cls_conn *cls_conn,
+1 -1
include/soc/bcm2835/raspberrypi-firmware.h
··· 170 170 171 171 #define RPI_FIRMWARE_CLK_RATE_REQUEST(_id) \ 172 172 { \ 173 - .id = _id, \ 173 + .id = cpu_to_le32(_id), \ 174 174 } 175 175 176 176 #if IS_ENABLED(CONFIG_RASPBERRYPI_FIRMWARE)
+1 -2
include/uapi/linux/netfilter/nf_conntrack_sctp.h
··· 15 15 SCTP_CONNTRACK_SHUTDOWN_RECD, 16 16 SCTP_CONNTRACK_SHUTDOWN_ACK_SENT, 17 17 SCTP_CONNTRACK_HEARTBEAT_SENT, 18 - SCTP_CONNTRACK_HEARTBEAT_ACKED, 19 - SCTP_CONNTRACK_DATA_SENT, 18 + SCTP_CONNTRACK_HEARTBEAT_ACKED, /* no longer used */ 20 19 SCTP_CONNTRACK_MAX 21 20 }; 22 21
+2
include/ufs/ufshcd.h
··· 808 808 * @urgent_bkops_lvl: keeps track of urgent bkops level for device 809 809 * @is_urgent_bkops_lvl_checked: keeps track if the urgent bkops level for 810 810 * device is known or not. 811 + * @wb_mutex: used to serialize devfreq and sysfs write booster toggling 811 812 * @clk_scaling_lock: used to serialize device commands and clock scaling 812 813 * @desc_size: descriptor sizes reported by device 813 814 * @scsi_block_reqs_cnt: reference counting for scsi block requests ··· 952 951 enum bkops_status urgent_bkops_lvl; 953 952 bool is_urgent_bkops_lvl_checked; 954 953 954 + struct mutex wb_mutex; 955 955 struct rw_semaphore clk_scaling_lock; 956 956 unsigned char desc_size[QUERY_DESC_IDN_MAX]; 957 957 atomic_t scsi_block_reqs_cnt;
+1 -1
init/Kconfig
··· 204 204 appended after any matching localversion* files, and after the value 205 205 set in CONFIG_LOCALVERSION. 206 206 207 - (The actual string used here is the first eight characters produced 207 + (The actual string used here is the first 12 characters produced 208 208 by running the command: 209 209 210 210 $ git rev-parse --verify HEAD
-1
init/version-timestamp.c
··· 2 2 3 3 #include <generated/compile.h> 4 4 #include <generated/utsrelease.h> 5 - #include <linux/version.h> 6 5 #include <linux/proc_ns.h> 7 6 #include <linux/refcount.h> 8 7 #include <linux/uts.h>
+2 -2
io_uring/io_uring.c
··· 3674 3674 3675 3675 if (ctx->flags & IORING_SETUP_SINGLE_ISSUER 3676 3676 && !(ctx->flags & IORING_SETUP_R_DISABLED)) 3677 - ctx->submitter_task = get_task_struct(current); 3677 + WRITE_ONCE(ctx->submitter_task, get_task_struct(current)); 3678 3678 3679 3679 file = io_uring_get_file(ctx); 3680 3680 if (IS_ERR(file)) { ··· 3868 3868 return -EBADFD; 3869 3869 3870 3870 if (ctx->flags & IORING_SETUP_SINGLE_ISSUER && !ctx->submitter_task) 3871 - ctx->submitter_task = get_task_struct(current); 3871 + WRITE_ONCE(ctx->submitter_task, get_task_struct(current)); 3872 3872 3873 3873 if (ctx->restrictions.registered) 3874 3874 ctx->restricted = 1;
+98 -64
io_uring/msg_ring.c
··· 25 25 u32 flags; 26 26 }; 27 27 28 - void io_msg_ring_cleanup(struct io_kiocb *req) 29 - { 30 - struct io_msg *msg = io_kiocb_to_cmd(req, struct io_msg); 31 - 32 - if (WARN_ON_ONCE(!msg->src_file)) 33 - return; 34 - 35 - fput(msg->src_file); 36 - msg->src_file = NULL; 37 - } 38 - 39 - static void io_msg_tw_complete(struct callback_head *head) 40 - { 41 - struct io_msg *msg = container_of(head, struct io_msg, tw); 42 - struct io_kiocb *req = cmd_to_io_kiocb(msg); 43 - struct io_ring_ctx *target_ctx = req->file->private_data; 44 - int ret = 0; 45 - 46 - if (current->flags & PF_EXITING) 47 - ret = -EOWNERDEAD; 48 - else if (!io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0)) 49 - ret = -EOVERFLOW; 50 - 51 - if (ret < 0) 52 - req_set_fail(req); 53 - io_req_queue_tw_complete(req, ret); 54 - } 55 - 56 - static int io_msg_ring_data(struct io_kiocb *req) 57 - { 58 - struct io_ring_ctx *target_ctx = req->file->private_data; 59 - struct io_msg *msg = io_kiocb_to_cmd(req, struct io_msg); 60 - 61 - if (msg->src_fd || msg->dst_fd || msg->flags) 62 - return -EINVAL; 63 - 64 - if (target_ctx->task_complete && current != target_ctx->submitter_task) { 65 - init_task_work(&msg->tw, io_msg_tw_complete); 66 - if (task_work_add(target_ctx->submitter_task, &msg->tw, 67 - TWA_SIGNAL_NO_IPI)) 68 - return -EOWNERDEAD; 69 - 70 - atomic_or(IORING_SQ_TASKRUN, &target_ctx->rings->sq_flags); 71 - return IOU_ISSUE_SKIP_COMPLETE; 72 - } 73 - 74 - if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0)) 75 - return 0; 76 - 77 - return -EOVERFLOW; 78 - } 79 - 80 - static void io_double_unlock_ctx(struct io_ring_ctx *octx, 81 - unsigned int issue_flags) 28 + static void io_double_unlock_ctx(struct io_ring_ctx *octx) 82 29 { 83 30 mutex_unlock(&octx->uring_lock); 84 31 } ··· 45 98 } 46 99 mutex_lock(&octx->uring_lock); 47 100 return 0; 101 + } 102 + 103 + void io_msg_ring_cleanup(struct io_kiocb *req) 104 + { 105 + struct io_msg *msg = io_kiocb_to_cmd(req, struct io_msg); 106 + 107 + if (WARN_ON_ONCE(!msg->src_file)) 108 + return; 109 + 110 + fput(msg->src_file); 111 + msg->src_file = NULL; 112 + } 113 + 114 + static inline bool io_msg_need_remote(struct io_ring_ctx *target_ctx) 115 + { 116 + if (!target_ctx->task_complete) 117 + return false; 118 + return current != target_ctx->submitter_task; 119 + } 120 + 121 + static int io_msg_exec_remote(struct io_kiocb *req, task_work_func_t func) 122 + { 123 + struct io_ring_ctx *ctx = req->file->private_data; 124 + struct io_msg *msg = io_kiocb_to_cmd(req, struct io_msg); 125 + struct task_struct *task = READ_ONCE(ctx->submitter_task); 126 + 127 + if (unlikely(!task)) 128 + return -EOWNERDEAD; 129 + 130 + init_task_work(&msg->tw, func); 131 + if (task_work_add(ctx->submitter_task, &msg->tw, TWA_SIGNAL)) 132 + return -EOWNERDEAD; 133 + 134 + return IOU_ISSUE_SKIP_COMPLETE; 135 + } 136 + 137 + static void io_msg_tw_complete(struct callback_head *head) 138 + { 139 + struct io_msg *msg = container_of(head, struct io_msg, tw); 140 + struct io_kiocb *req = cmd_to_io_kiocb(msg); 141 + struct io_ring_ctx *target_ctx = req->file->private_data; 142 + int ret = 0; 143 + 144 + if (current->flags & PF_EXITING) { 145 + ret = -EOWNERDEAD; 146 + } else { 147 + /* 148 + * If the target ring is using IOPOLL mode, then we need to be 149 + * holding the uring_lock for posting completions. Other ring 150 + * types rely on the regular completion locking, which is 151 + * handled while posting. 152 + */ 153 + if (target_ctx->flags & IORING_SETUP_IOPOLL) 154 + mutex_lock(&target_ctx->uring_lock); 155 + if (!io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0)) 156 + ret = -EOVERFLOW; 157 + if (target_ctx->flags & IORING_SETUP_IOPOLL) 158 + mutex_unlock(&target_ctx->uring_lock); 159 + } 160 + 161 + if (ret < 0) 162 + req_set_fail(req); 163 + io_req_queue_tw_complete(req, ret); 164 + } 165 + 166 + static int io_msg_ring_data(struct io_kiocb *req, unsigned int issue_flags) 167 + { 168 + struct io_ring_ctx *target_ctx = req->file->private_data; 169 + struct io_msg *msg = io_kiocb_to_cmd(req, struct io_msg); 170 + int ret; 171 + 172 + if (msg->src_fd || msg->dst_fd || msg->flags) 173 + return -EINVAL; 174 + if (target_ctx->flags & IORING_SETUP_R_DISABLED) 175 + return -EBADFD; 176 + 177 + if (io_msg_need_remote(target_ctx)) 178 + return io_msg_exec_remote(req, io_msg_tw_complete); 179 + 180 + ret = -EOVERFLOW; 181 + if (target_ctx->flags & IORING_SETUP_IOPOLL) { 182 + if (unlikely(io_double_lock_ctx(target_ctx, issue_flags))) 183 + return -EAGAIN; 184 + if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0)) 185 + ret = 0; 186 + io_double_unlock_ctx(target_ctx); 187 + } else { 188 + if (io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0)) 189 + ret = 0; 190 + } 191 + return ret; 48 192 } 49 193 50 194 static struct file *io_msg_grab_file(struct io_kiocb *req, unsigned int issue_flags) ··· 186 148 if (!io_post_aux_cqe(target_ctx, msg->user_data, msg->len, 0)) 187 149 ret = -EOVERFLOW; 188 150 out_unlock: 189 - io_double_unlock_ctx(target_ctx, issue_flags); 151 + io_double_unlock_ctx(target_ctx); 190 152 return ret; 191 153 } 192 154 ··· 212 174 213 175 if (target_ctx == ctx) 214 176 return -EINVAL; 177 + if (target_ctx->flags & IORING_SETUP_R_DISABLED) 178 + return -EBADFD; 215 179 if (!src_file) { 216 180 src_file = io_msg_grab_file(req, issue_flags); 217 181 if (!src_file) ··· 222 182 req->flags |= REQ_F_NEED_CLEANUP; 223 183 } 224 184 225 - if (target_ctx->task_complete && current != target_ctx->submitter_task) { 226 - init_task_work(&msg->tw, io_msg_tw_fd_complete); 227 - if (task_work_add(target_ctx->submitter_task, &msg->tw, 228 - TWA_SIGNAL)) 229 - return -EOWNERDEAD; 230 - 231 - return IOU_ISSUE_SKIP_COMPLETE; 232 - } 185 + if (io_msg_need_remote(target_ctx)) 186 + return io_msg_exec_remote(req, io_msg_tw_fd_complete); 233 187 return io_msg_install_complete(req, issue_flags); 234 188 } 235 189 ··· 258 224 259 225 switch (msg->cmd) { 260 226 case IORING_MSG_DATA: 261 - ret = io_msg_ring_data(req); 227 + ret = io_msg_ring_data(req, issue_flags); 262 228 break; 263 229 case IORING_MSG_SEND_FD: 264 230 ret = io_msg_send_fd(req, issue_flags);
+5 -1
io_uring/poll.c
··· 283 283 * to the waitqueue, so if we get nothing back, we 284 284 * should be safe and attempt a reissue. 285 285 */ 286 - if (unlikely(!req->cqe.res)) 286 + if (unlikely(!req->cqe.res)) { 287 + /* Multishot armed need not reissue */ 288 + if (!(req->apoll_events & EPOLLONESHOT)) 289 + continue; 287 290 return IOU_POLL_REISSUE; 291 + } 288 292 } 289 293 if (req->apoll_events & EPOLLONESHOT) 290 294 return IOU_POLL_DONE;
+2
kernel/gen_kheaders.sh
··· 14 14 arch/$SRCARCH/include/ 15 15 " 16 16 17 + type cpio > /dev/null 18 + 17 19 # Support incremental builds by skipping archive generation 18 20 # if timestamps of files being archived are not changed. 19 21
+21 -5
kernel/module/main.c
··· 2393 2393 sched_annotate_sleep(); 2394 2394 mutex_lock(&module_mutex); 2395 2395 mod = find_module_all(name, strlen(name), true); 2396 - ret = !mod || mod->state == MODULE_STATE_LIVE; 2396 + ret = !mod || mod->state == MODULE_STATE_LIVE 2397 + || mod->state == MODULE_STATE_GOING; 2397 2398 mutex_unlock(&module_mutex); 2398 2399 2399 2400 return ret; ··· 2570 2569 2571 2570 mod->state = MODULE_STATE_UNFORMED; 2572 2571 2573 - again: 2574 2572 mutex_lock(&module_mutex); 2575 2573 old = find_module_all(mod->name, strlen(mod->name), true); 2576 2574 if (old != NULL) { 2577 - if (old->state != MODULE_STATE_LIVE) { 2575 + if (old->state == MODULE_STATE_COMING 2576 + || old->state == MODULE_STATE_UNFORMED) { 2578 2577 /* Wait in case it fails to load. */ 2579 2578 mutex_unlock(&module_mutex); 2580 2579 err = wait_event_interruptible(module_wq, 2581 2580 finished_loading(mod->name)); 2582 2581 if (err) 2583 2582 goto out_unlocked; 2584 - goto again; 2583 + 2584 + /* The module might have gone in the meantime. */ 2585 + mutex_lock(&module_mutex); 2586 + old = find_module_all(mod->name, strlen(mod->name), 2587 + true); 2585 2588 } 2586 - err = -EEXIST; 2589 + 2590 + /* 2591 + * We are here only when the same module was being loaded. Do 2592 + * not try to load it again right now. It prevents long delays 2593 + * caused by serialized module load failures. It might happen 2594 + * when more devices of the same type trigger load of 2595 + * a particular module. 2596 + */ 2597 + if (old && old->state == MODULE_STATE_LIVE) 2598 + err = -EEXIST; 2599 + else 2600 + err = -EBUSY; 2587 2601 goto out; 2588 2602 } 2589 2603 mod_update_bounds(mod);
+8 -2
kernel/sched/core.c
··· 8290 8290 if (retval) 8291 8291 goto out_put_task; 8292 8292 8293 + /* 8294 + * With non-SMP configs, user_cpus_ptr/user_mask isn't used and 8295 + * alloc_user_cpus_ptr() returns NULL. 8296 + */ 8293 8297 user_mask = alloc_user_cpus_ptr(NUMA_NO_NODE); 8294 - if (IS_ENABLED(CONFIG_SMP) && !user_mask) { 8298 + if (user_mask) { 8299 + cpumask_copy(user_mask, in_mask); 8300 + } else if (IS_ENABLED(CONFIG_SMP)) { 8295 8301 retval = -ENOMEM; 8296 8302 goto out_put_task; 8297 8303 } 8298 - cpumask_copy(user_mask, in_mask); 8304 + 8299 8305 ac = (struct affinity_context){ 8300 8306 .new_mask = in_mask, 8301 8307 .user_mask = user_mask,
+26 -20
kernel/sched/fair.c
··· 7229 7229 eenv_task_busy_time(&eenv, p, prev_cpu); 7230 7230 7231 7231 for (; pd; pd = pd->next) { 7232 + unsigned long util_min = p_util_min, util_max = p_util_max; 7232 7233 unsigned long cpu_cap, cpu_thermal_cap, util; 7233 7234 unsigned long cur_delta, max_spare_cap = 0; 7234 7235 unsigned long rq_util_min, rq_util_max; 7235 - unsigned long util_min, util_max; 7236 7236 unsigned long prev_spare_cap = 0; 7237 7237 int max_spare_cap_cpu = -1; 7238 7238 unsigned long base_energy; ··· 7251 7251 eenv.pd_cap = 0; 7252 7252 7253 7253 for_each_cpu(cpu, cpus) { 7254 + struct rq *rq = cpu_rq(cpu); 7255 + 7254 7256 eenv.pd_cap += cpu_thermal_cap; 7255 7257 7256 7258 if (!cpumask_test_cpu(cpu, sched_domain_span(sd))) ··· 7271 7269 * much capacity we can get out of the CPU; this is 7272 7270 * aligned with sched_cpu_util(). 7273 7271 */ 7274 - if (uclamp_is_used()) { 7275 - if (uclamp_rq_is_idle(cpu_rq(cpu))) { 7276 - util_min = p_util_min; 7277 - util_max = p_util_max; 7278 - } else { 7279 - /* 7280 - * Open code uclamp_rq_util_with() except for 7281 - * the clamp() part. Ie: apply max aggregation 7282 - * only. util_fits_cpu() logic requires to 7283 - * operate on non clamped util but must use the 7284 - * max-aggregated uclamp_{min, max}. 7285 - */ 7286 - rq_util_min = uclamp_rq_get(cpu_rq(cpu), UCLAMP_MIN); 7287 - rq_util_max = uclamp_rq_get(cpu_rq(cpu), UCLAMP_MAX); 7272 + if (uclamp_is_used() && !uclamp_rq_is_idle(rq)) { 7273 + /* 7274 + * Open code uclamp_rq_util_with() except for 7275 + * the clamp() part. Ie: apply max aggregation 7276 + * only. util_fits_cpu() logic requires to 7277 + * operate on non clamped util but must use the 7278 + * max-aggregated uclamp_{min, max}. 7279 + */ 7280 + rq_util_min = uclamp_rq_get(rq, UCLAMP_MIN); 7281 + rq_util_max = uclamp_rq_get(rq, UCLAMP_MAX); 7288 7282 7289 - util_min = max(rq_util_min, p_util_min); 7290 - util_max = max(rq_util_max, p_util_max); 7291 - } 7283 + util_min = max(rq_util_min, p_util_min); 7284 + util_max = max(rq_util_max, p_util_max); 7292 7285 } 7293 7286 if (!util_fits_cpu(util, util_min, util_max, cpu)) 7294 7287 continue; ··· 8868 8871 * * Thermal pressure will impact all cpus in this perf domain 8869 8872 * equally. 8870 8873 */ 8871 - if (static_branch_unlikely(&sched_asym_cpucapacity)) { 8874 + if (sched_energy_enabled()) { 8872 8875 unsigned long inv_cap = capacity_orig - thermal_load_avg(rq); 8873 - struct perf_domain *pd = rcu_dereference(rq->rd->pd); 8876 + struct perf_domain *pd; 8874 8877 8878 + rcu_read_lock(); 8879 + 8880 + pd = rcu_dereference(rq->rd->pd); 8875 8881 rq->cpu_capacity_inverted = 0; 8876 8882 8877 8883 for (; pd; pd = pd->next) { 8878 8884 struct cpumask *pd_span = perf_domain_span(pd); 8879 8885 unsigned long pd_cap_orig, pd_cap; 8886 + 8887 + /* We can't be inverted against our own pd */ 8888 + if (cpumask_test_cpu(cpu_of(rq), pd_span)) 8889 + continue; 8880 8890 8881 8891 cpu = cpumask_any(pd_span); 8882 8892 pd_cap_orig = arch_scale_cpu_capacity(cpu); ··· 8909 8905 break; 8910 8906 } 8911 8907 } 8908 + 8909 + rcu_read_unlock(); 8912 8910 } 8913 8911 8914 8912 trace_sched_cpu_capacity_tp(rq);
+2
kernel/sys.c
··· 1442 1442 1443 1443 if (resource >= RLIM_NLIMITS) 1444 1444 return -EINVAL; 1445 + resource = array_index_nospec(resource, RLIM_NLIMITS); 1446 + 1445 1447 if (new_rlim) { 1446 1448 if (new_rlim->rlim_cur > new_rlim->rlim_max) 1447 1449 return -EINVAL;
+3
lib/nlattr.c
··· 10 10 #include <linux/kernel.h> 11 11 #include <linux/errno.h> 12 12 #include <linux/jiffies.h> 13 + #include <linux/nospec.h> 13 14 #include <linux/skbuff.h> 14 15 #include <linux/string.h> 15 16 #include <linux/types.h> ··· 382 381 if (type <= 0 || type > maxtype) 383 382 return 0; 384 383 384 + type = array_index_nospec(type, maxtype + 1); 385 385 pt = &policy[type]; 386 386 387 387 BUG_ON(pt->type > NLA_TYPE_MAX); ··· 598 596 } 599 597 continue; 600 598 } 599 + type = array_index_nospec(type, maxtype + 1); 601 600 if (policy) { 602 601 int err = validate_nla(nla, maxtype, policy, 603 602 validate, extack, depth);
+15 -10
lib/scatterlist.c
··· 470 470 return -EOPNOTSUPP; 471 471 472 472 if (sgt_append->prv) { 473 + unsigned long next_pfn = (page_to_phys(sg_page(sgt_append->prv)) + 474 + sgt_append->prv->offset + sgt_append->prv->length) / PAGE_SIZE; 475 + 473 476 if (WARN_ON(offset)) 474 477 return -EINVAL; 475 478 476 479 /* Merge contiguous pages into the last SG */ 477 480 prv_len = sgt_append->prv->length; 478 - last_pg = sg_page(sgt_append->prv); 479 - while (n_pages && pages_are_mergeable(pages[0], last_pg)) { 480 - if (sgt_append->prv->length + PAGE_SIZE > max_segment) 481 - break; 482 - sgt_append->prv->length += PAGE_SIZE; 483 - last_pg = pages[0]; 484 - pages++; 485 - n_pages--; 481 + if (page_to_pfn(pages[0]) == next_pfn) { 482 + last_pg = pfn_to_page(next_pfn - 1); 483 + while (n_pages && pages_are_mergeable(pages[0], last_pg)) { 484 + if (sgt_append->prv->length + PAGE_SIZE > max_segment) 485 + break; 486 + sgt_append->prv->length += PAGE_SIZE; 487 + last_pg = pages[0]; 488 + pages++; 489 + n_pages--; 490 + } 491 + if (!n_pages) 492 + goto out; 486 493 } 487 - if (!n_pages) 488 - goto out; 489 494 } 490 495 491 496 /* compute number of contiguous chunks */
+1 -1
net/core/net_namespace.c
··· 137 137 return 0; 138 138 139 139 if (ops->id && ops->size) { 140 - cleanup: 141 140 ng = rcu_dereference_protected(net->gen, 142 141 lockdep_is_held(&pernet_ops_rwsem)); 143 142 ng->ptr[*ops->id] = NULL; 144 143 } 145 144 145 + cleanup: 146 146 kfree(data); 147 147 148 148 out:
+2
net/ipv4/fib_semantics.c
··· 30 30 #include <linux/slab.h> 31 31 #include <linux/netlink.h> 32 32 #include <linux/hash.h> 33 + #include <linux/nospec.h> 33 34 34 35 #include <net/arp.h> 35 36 #include <net/inet_dscp.h> ··· 1023 1022 if (type > RTAX_MAX) 1024 1023 return false; 1025 1024 1025 + type = array_index_nospec(type, RTAX_MAX + 1); 1026 1026 if (type == RTAX_CC_ALGO) { 1027 1027 char tmp[TCP_CA_NAME_MAX]; 1028 1028 bool ecn_ca = false;
+2
net/ipv4/metrics.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0-only 2 2 #include <linux/netlink.h> 3 + #include <linux/nospec.h> 3 4 #include <linux/rtnetlink.h> 4 5 #include <linux/types.h> 5 6 #include <net/ip.h> ··· 26 25 return -EINVAL; 27 26 } 28 27 28 + type = array_index_nospec(type, RTAX_MAX + 1); 29 29 if (type == RTAX_CC_ALGO) { 30 30 char tmp[TCP_CA_NAME_MAX]; 31 31
+14 -1
net/ipv6/ip6_output.c
··· 547 547 pneigh_lookup(&nd_tbl, net, &hdr->daddr, skb->dev, 0)) { 548 548 int proxied = ip6_forward_proxy_check(skb); 549 549 if (proxied > 0) { 550 - hdr->hop_limit--; 550 + /* It's tempting to decrease the hop limit 551 + * here by 1, as we do at the end of the 552 + * function too. 553 + * 554 + * But that would be incorrect, as proxying is 555 + * not forwarding. The ip6_input function 556 + * will handle this packet locally, and it 557 + * depends on the hop limit being unchanged. 558 + * 559 + * One example is the NDP hop limit, that 560 + * always has to stay 255, but other would be 561 + * similar checks around RA packets, where the 562 + * user can even change the desired limit. 563 + */ 551 564 return ip6_input(skb); 552 565 } else if (proxied < 0) { 553 566 __IP6_INC_STATS(net, idev, IPSTATS_MIB_INDISCARDS);
+7 -3
net/mctp/af_mctp.c
··· 544 544 545 545 static void mctp_sk_close(struct sock *sk, long timeout) 546 546 { 547 - struct mctp_sock *msk = container_of(sk, struct mctp_sock, sk); 548 - 549 - del_timer_sync(&msk->key_expiry); 550 547 sk_common_release(sk); 551 548 } 552 549 ··· 577 580 spin_lock_irqsave(&key->lock, fl2); 578 581 __mctp_key_remove(key, net, fl2, MCTP_TRACE_KEY_CLOSED); 579 582 } 583 + sock_set_flag(sk, SOCK_DEAD); 580 584 spin_unlock_irqrestore(&net->mctp.keys_lock, flags); 585 + 586 + /* Since there are no more tag allocations (we have removed all of the 587 + * keys), stop any pending expiry events. the timer cannot be re-queued 588 + * as the sk is no longer observable 589 + */ 590 + del_timer_sync(&msk->key_expiry); 581 591 } 582 592 583 593 static struct proto mctp_proto = {
+21 -13
net/mctp/route.c
··· 147 147 key->valid = true; 148 148 spin_lock_init(&key->lock); 149 149 refcount_set(&key->refs, 1); 150 + sock_hold(key->sk); 150 151 151 152 return key; 152 153 } ··· 166 165 mctp_dev_release_key(key->dev, key); 167 166 spin_unlock_irqrestore(&key->lock, flags); 168 167 168 + sock_put(key->sk); 169 169 kfree(key); 170 170 } 171 171 ··· 178 176 int rc = 0; 179 177 180 178 spin_lock_irqsave(&net->mctp.keys_lock, flags); 179 + 180 + if (sock_flag(&msk->sk, SOCK_DEAD)) { 181 + rc = -EINVAL; 182 + goto out_unlock; 183 + } 181 184 182 185 hlist_for_each_entry(tmp, &net->mctp.keys, hlist) { 183 186 if (mctp_key_match(tmp, key->local_addr, key->peer_addr, ··· 205 198 hlist_add_head(&key->sklist, &msk->keys); 206 199 } 207 200 201 + out_unlock: 208 202 spin_unlock_irqrestore(&net->mctp.keys_lock, flags); 209 203 210 204 return rc; ··· 323 315 324 316 static int mctp_route_input(struct mctp_route *route, struct sk_buff *skb) 325 317 { 318 + struct mctp_sk_key *key, *any_key = NULL; 326 319 struct net *net = dev_net(skb->dev); 327 - struct mctp_sk_key *key; 328 320 struct mctp_sock *msk; 329 321 struct mctp_hdr *mh; 330 322 unsigned long f; ··· 369 361 * key for reassembly - we'll create a more specific 370 362 * one for future packets if required (ie, !EOM). 371 363 */ 372 - key = mctp_lookup_key(net, skb, MCTP_ADDR_ANY, &f); 373 - if (key) { 374 - msk = container_of(key->sk, 364 + any_key = mctp_lookup_key(net, skb, MCTP_ADDR_ANY, &f); 365 + if (any_key) { 366 + msk = container_of(any_key->sk, 375 367 struct mctp_sock, sk); 376 - spin_unlock_irqrestore(&key->lock, f); 377 - mctp_key_unref(key); 378 - key = NULL; 368 + spin_unlock_irqrestore(&any_key->lock, f); 379 369 } 380 370 } 381 371 ··· 425 419 * this function. 426 420 */ 427 421 rc = mctp_key_add(key, msk); 428 - if (rc) { 429 - kfree(key); 430 - } else { 422 + if (!rc) 431 423 trace_mctp_key_acquire(key); 432 424 433 - /* we don't need to release key->lock on exit */ 434 - mctp_key_unref(key); 435 - } 425 + /* we don't need to release key->lock on exit, so 426 + * clean up here and suppress the unlock via 427 + * setting to NULL 428 + */ 429 + mctp_key_unref(key); 436 430 key = NULL; 437 431 438 432 } else { ··· 479 473 spin_unlock_irqrestore(&key->lock, f); 480 474 mctp_key_unref(key); 481 475 } 476 + if (any_key) 477 + mctp_key_unref(any_key); 482 478 out: 483 479 if (rc) 484 480 kfree_skb(skb);
+74 -98
net/netfilter/nf_conntrack_proto_sctp.c
··· 27 27 #include <net/netfilter/nf_conntrack_ecache.h> 28 28 #include <net/netfilter/nf_conntrack_timeout.h> 29 29 30 - /* FIXME: Examine ipfilter's timeouts and conntrack transitions more 31 - closely. They're more complex. --RR 32 - 33 - And so for me for SCTP :D -Kiran */ 34 - 35 30 static const char *const sctp_conntrack_names[] = { 36 - "NONE", 37 - "CLOSED", 38 - "COOKIE_WAIT", 39 - "COOKIE_ECHOED", 40 - "ESTABLISHED", 41 - "SHUTDOWN_SENT", 42 - "SHUTDOWN_RECD", 43 - "SHUTDOWN_ACK_SENT", 44 - "HEARTBEAT_SENT", 45 - "HEARTBEAT_ACKED", 31 + [SCTP_CONNTRACK_NONE] = "NONE", 32 + [SCTP_CONNTRACK_CLOSED] = "CLOSED", 33 + [SCTP_CONNTRACK_COOKIE_WAIT] = "COOKIE_WAIT", 34 + [SCTP_CONNTRACK_COOKIE_ECHOED] = "COOKIE_ECHOED", 35 + [SCTP_CONNTRACK_ESTABLISHED] = "ESTABLISHED", 36 + [SCTP_CONNTRACK_SHUTDOWN_SENT] = "SHUTDOWN_SENT", 37 + [SCTP_CONNTRACK_SHUTDOWN_RECD] = "SHUTDOWN_RECD", 38 + [SCTP_CONNTRACK_SHUTDOWN_ACK_SENT] = "SHUTDOWN_ACK_SENT", 39 + [SCTP_CONNTRACK_HEARTBEAT_SENT] = "HEARTBEAT_SENT", 46 40 }; 47 41 48 42 #define SECS * HZ ··· 48 54 [SCTP_CONNTRACK_CLOSED] = 10 SECS, 49 55 [SCTP_CONNTRACK_COOKIE_WAIT] = 3 SECS, 50 56 [SCTP_CONNTRACK_COOKIE_ECHOED] = 3 SECS, 51 - [SCTP_CONNTRACK_ESTABLISHED] = 5 DAYS, 57 + [SCTP_CONNTRACK_ESTABLISHED] = 210 SECS, 52 58 [SCTP_CONNTRACK_SHUTDOWN_SENT] = 300 SECS / 1000, 53 59 [SCTP_CONNTRACK_SHUTDOWN_RECD] = 300 SECS / 1000, 54 60 [SCTP_CONNTRACK_SHUTDOWN_ACK_SENT] = 3 SECS, 55 61 [SCTP_CONNTRACK_HEARTBEAT_SENT] = 30 SECS, 56 - [SCTP_CONNTRACK_HEARTBEAT_ACKED] = 210 SECS, 57 - [SCTP_CONNTRACK_DATA_SENT] = 30 SECS, 58 62 }; 59 63 60 64 #define SCTP_FLAG_HEARTBEAT_VTAG_FAILED 1 ··· 66 74 #define sSR SCTP_CONNTRACK_SHUTDOWN_RECD 67 75 #define sSA SCTP_CONNTRACK_SHUTDOWN_ACK_SENT 68 76 #define sHS SCTP_CONNTRACK_HEARTBEAT_SENT 69 - #define sHA SCTP_CONNTRACK_HEARTBEAT_ACKED 70 - #define sDS SCTP_CONNTRACK_DATA_SENT 71 77 #define sIV SCTP_CONNTRACK_MAX 72 78 73 79 /* ··· 88 98 CLOSED - We have seen a SHUTDOWN_COMPLETE chunk in the direction of 89 99 the SHUTDOWN chunk. Connection is closed. 90 100 HEARTBEAT_SENT - We have seen a HEARTBEAT in a new flow. 91 - HEARTBEAT_ACKED - We have seen a HEARTBEAT-ACK/DATA/SACK in the direction 92 - opposite to that of the HEARTBEAT/DATA chunk. Secondary connection 93 - is established. 94 - DATA_SENT - We have seen a DATA/SACK in a new flow. 95 101 */ 96 102 97 103 /* TODO ··· 101 115 */ 102 116 103 117 /* SCTP conntrack state transitions */ 104 - static const u8 sctp_conntracks[2][12][SCTP_CONNTRACK_MAX] = { 118 + static const u8 sctp_conntracks[2][11][SCTP_CONNTRACK_MAX] = { 105 119 { 106 120 /* ORIGINAL */ 107 - /* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS, sHA, sDS */ 108 - /* init */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCW, sHA, sCW}, 109 - /* init_ack */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL, sHA, sCL}, 110 - /* abort */ {sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL}, 111 - /* shutdown */ {sCL, sCL, sCW, sCE, sSS, sSS, sSR, sSA, sCL, sSS, sCL}, 112 - /* shutdown_ack */ {sSA, sCL, sCW, sCE, sES, sSA, sSA, sSA, sSA, sHA, sSA}, 113 - /* error */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL, sHA, sCL},/* Can't have Stale cookie*/ 114 - /* cookie_echo */ {sCL, sCL, sCE, sCE, sES, sSS, sSR, sSA, sCL, sHA, sCL},/* 5.2.4 - Big TODO */ 115 - /* cookie_ack */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL, sHA, sCL},/* Can't come in orig dir */ 116 - /* shutdown_comp*/ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sCL, sCL, sHA, sCL}, 117 - /* heartbeat */ {sHS, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS, sHA, sDS}, 118 - /* heartbeat_ack*/ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS, sHA, sDS}, 119 - /* data/sack */ {sDS, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS, sHA, sDS} 121 + /* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS */ 122 + /* init */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCW}, 123 + /* init_ack */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL}, 124 + /* abort */ {sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sCL}, 125 + /* shutdown */ {sCL, sCL, sCW, sCE, sSS, sSS, sSR, sSA, sCL}, 126 + /* shutdown_ack */ {sSA, sCL, sCW, sCE, sES, sSA, sSA, sSA, sSA}, 127 + /* error */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL},/* Can't have Stale cookie*/ 128 + /* cookie_echo */ {sCL, sCL, sCE, sCE, sES, sSS, sSR, sSA, sCL},/* 5.2.4 - Big TODO */ 129 + /* cookie_ack */ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sCL},/* Can't come in orig dir */ 130 + /* shutdown_comp*/ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sCL, sCL}, 131 + /* heartbeat */ {sHS, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS}, 132 + /* heartbeat_ack*/ {sCL, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS}, 120 133 }, 121 134 { 122 135 /* REPLY */ 123 - /* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS, sHA, sDS */ 124 - /* init */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sIV, sHA, sIV},/* INIT in sCL Big TODO */ 125 - /* init_ack */ {sIV, sCW, sCW, sCE, sES, sSS, sSR, sSA, sIV, sHA, sIV}, 126 - /* abort */ {sIV, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sIV, sCL, sIV}, 127 - /* shutdown */ {sIV, sCL, sCW, sCE, sSR, sSS, sSR, sSA, sIV, sSR, sIV}, 128 - /* shutdown_ack */ {sIV, sCL, sCW, sCE, sES, sSA, sSA, sSA, sIV, sHA, sIV}, 129 - /* error */ {sIV, sCL, sCW, sCL, sES, sSS, sSR, sSA, sIV, sHA, sIV}, 130 - /* cookie_echo */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sIV, sHA, sIV},/* Can't come in reply dir */ 131 - /* cookie_ack */ {sIV, sCL, sCW, sES, sES, sSS, sSR, sSA, sIV, sHA, sIV}, 132 - /* shutdown_comp*/ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sCL, sIV, sHA, sIV}, 133 - /* heartbeat */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS, sHA, sHA}, 134 - /* heartbeat_ack*/ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHA, sHA, sHA}, 135 - /* data/sack */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHA, sHA, sHA}, 136 + /* sNO, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS */ 137 + /* init */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sIV},/* INIT in sCL Big TODO */ 138 + /* init_ack */ {sIV, sCW, sCW, sCE, sES, sSS, sSR, sSA, sIV}, 139 + /* abort */ {sIV, sCL, sCL, sCL, sCL, sCL, sCL, sCL, sIV}, 140 + /* shutdown */ {sIV, sCL, sCW, sCE, sSR, sSS, sSR, sSA, sIV}, 141 + /* shutdown_ack */ {sIV, sCL, sCW, sCE, sES, sSA, sSA, sSA, sIV}, 142 + /* error */ {sIV, sCL, sCW, sCL, sES, sSS, sSR, sSA, sIV}, 143 + /* cookie_echo */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sIV},/* Can't come in reply dir */ 144 + /* cookie_ack */ {sIV, sCL, sCW, sES, sES, sSS, sSR, sSA, sIV}, 145 + /* shutdown_comp*/ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sCL, sIV}, 146 + /* heartbeat */ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sHS}, 147 + /* heartbeat_ack*/ {sIV, sCL, sCW, sCE, sES, sSS, sSR, sSA, sES}, 136 148 } 137 149 }; 138 150 ··· 144 160 145 161 #define for_each_sctp_chunk(skb, sch, _sch, offset, dataoff, count) \ 146 162 for ((offset) = (dataoff) + sizeof(struct sctphdr), (count) = 0; \ 147 - (offset) < (skb)->len && \ 148 - ((sch) = skb_header_pointer((skb), (offset), sizeof(_sch), &(_sch))); \ 163 + ((sch) = skb_header_pointer((skb), (offset), sizeof(_sch), &(_sch))) && \ 164 + (sch)->length; \ 149 165 (offset) += (ntohs((sch)->length) + 3) & ~3, (count)++) 150 166 151 167 /* Some validity checks to make sure the chunks are fine */ ··· 229 245 case SCTP_CID_HEARTBEAT_ACK: 230 246 i = 10; 231 247 break; 232 - case SCTP_CID_DATA: 233 - case SCTP_CID_SACK: 234 - i = 11; 235 - break; 236 248 default: 237 249 /* Other chunks like DATA or SACK do not change the state */ 238 250 pr_debug("Unknown chunk type %d, Will stay in %s\n", ··· 278 298 ih->init_tag); 279 299 280 300 ct->proto.sctp.vtag[IP_CT_DIR_REPLY] = ih->init_tag; 281 - } else if (sch->type == SCTP_CID_HEARTBEAT || 282 - sch->type == SCTP_CID_DATA || 283 - sch->type == SCTP_CID_SACK) { 301 + } else if (sch->type == SCTP_CID_HEARTBEAT) { 284 302 pr_debug("Setting vtag %x for secondary conntrack\n", 285 303 sh->vtag); 286 304 ct->proto.sctp.vtag[IP_CT_DIR_ORIGINAL] = sh->vtag; ··· 364 386 365 387 if (!sctp_new(ct, skb, sh, dataoff)) 366 388 return -NF_ACCEPT; 367 - } else { 368 - /* Check the verification tag (Sec 8.5) */ 369 - if (!test_bit(SCTP_CID_INIT, map) && 370 - !test_bit(SCTP_CID_SHUTDOWN_COMPLETE, map) && 371 - !test_bit(SCTP_CID_COOKIE_ECHO, map) && 372 - !test_bit(SCTP_CID_ABORT, map) && 373 - !test_bit(SCTP_CID_SHUTDOWN_ACK, map) && 374 - !test_bit(SCTP_CID_HEARTBEAT, map) && 375 - !test_bit(SCTP_CID_HEARTBEAT_ACK, map) && 376 - sh->vtag != ct->proto.sctp.vtag[dir]) { 377 - nf_ct_l4proto_log_invalid(skb, ct, state, 378 - "verification tag check failed %x vs %x for dir %d", 379 - sh->vtag, ct->proto.sctp.vtag[dir], dir); 380 - goto out; 381 - } 389 + } 390 + 391 + /* Check the verification tag (Sec 8.5) */ 392 + if (!test_bit(SCTP_CID_INIT, map) && 393 + !test_bit(SCTP_CID_SHUTDOWN_COMPLETE, map) && 394 + !test_bit(SCTP_CID_COOKIE_ECHO, map) && 395 + !test_bit(SCTP_CID_ABORT, map) && 396 + !test_bit(SCTP_CID_SHUTDOWN_ACK, map) && 397 + !test_bit(SCTP_CID_HEARTBEAT, map) && 398 + !test_bit(SCTP_CID_HEARTBEAT_ACK, map) && 399 + sh->vtag != ct->proto.sctp.vtag[dir]) { 400 + nf_ct_l4proto_log_invalid(skb, ct, state, 401 + "verification tag check failed %x vs %x for dir %d", 402 + sh->vtag, ct->proto.sctp.vtag[dir], dir); 403 + goto out; 382 404 } 383 405 384 406 old_state = new_state = SCTP_CONNTRACK_NONE; ··· 386 408 for_each_sctp_chunk (skb, sch, _sch, offset, dataoff, count) { 387 409 /* Special cases of Verification tag check (Sec 8.5.1) */ 388 410 if (sch->type == SCTP_CID_INIT) { 389 - /* Sec 8.5.1 (A) */ 411 + /* (A) vtag MUST be zero */ 390 412 if (sh->vtag != 0) 391 413 goto out_unlock; 392 414 } else if (sch->type == SCTP_CID_ABORT) { 393 - /* Sec 8.5.1 (B) */ 394 - if (sh->vtag != ct->proto.sctp.vtag[dir] && 395 - sh->vtag != ct->proto.sctp.vtag[!dir]) 415 + /* (B) vtag MUST match own vtag if T flag is unset OR 416 + * MUST match peer's vtag if T flag is set 417 + */ 418 + if ((!(sch->flags & SCTP_CHUNK_FLAG_T) && 419 + sh->vtag != ct->proto.sctp.vtag[dir]) || 420 + ((sch->flags & SCTP_CHUNK_FLAG_T) && 421 + sh->vtag != ct->proto.sctp.vtag[!dir])) 396 422 goto out_unlock; 397 423 } else if (sch->type == SCTP_CID_SHUTDOWN_COMPLETE) { 398 - /* Sec 8.5.1 (C) */ 399 - if (sh->vtag != ct->proto.sctp.vtag[dir] && 400 - sh->vtag != ct->proto.sctp.vtag[!dir] && 401 - sch->flags & SCTP_CHUNK_FLAG_T) 424 + /* (C) vtag MUST match own vtag if T flag is unset OR 425 + * MUST match peer's vtag if T flag is set 426 + */ 427 + if ((!(sch->flags & SCTP_CHUNK_FLAG_T) && 428 + sh->vtag != ct->proto.sctp.vtag[dir]) || 429 + ((sch->flags & SCTP_CHUNK_FLAG_T) && 430 + sh->vtag != ct->proto.sctp.vtag[!dir])) 402 431 goto out_unlock; 403 432 } else if (sch->type == SCTP_CID_COOKIE_ECHO) { 404 - /* Sec 8.5.1 (D) */ 433 + /* (D) vtag must be same as init_vtag as found in INIT_ACK */ 405 434 if (sh->vtag != ct->proto.sctp.vtag[dir]) 406 435 goto out_unlock; 407 436 } else if (sch->type == SCTP_CID_HEARTBEAT) { ··· 444 459 ct->proto.sctp.vtag[!dir] = 0; 445 460 } else if (ct->proto.sctp.flags & SCTP_FLAG_HEARTBEAT_VTAG_FAILED) { 446 461 ct->proto.sctp.flags &= ~SCTP_FLAG_HEARTBEAT_VTAG_FAILED; 447 - } 448 - } else if (sch->type == SCTP_CID_DATA || sch->type == SCTP_CID_SACK) { 449 - if (ct->proto.sctp.vtag[dir] == 0) { 450 - pr_debug("Setting vtag %x for dir %d\n", sh->vtag, dir); 451 - ct->proto.sctp.vtag[dir] = sh->vtag; 452 462 } 453 463 } 454 464 ··· 483 503 } 484 504 485 505 ct->proto.sctp.state = new_state; 486 - if (old_state != new_state) 506 + if (old_state != new_state) { 487 507 nf_conntrack_event_cache(IPCT_PROTOINFO, ct); 508 + if (new_state == SCTP_CONNTRACK_ESTABLISHED && 509 + !test_and_set_bit(IPS_ASSURED_BIT, &ct->status)) 510 + nf_conntrack_event_cache(IPCT_ASSURED, ct); 511 + } 488 512 } 489 513 spin_unlock_bh(&ct->lock); 490 514 ··· 501 517 timeouts = nf_sctp_pernet(nf_ct_net(ct))->timeouts; 502 518 503 519 nf_ct_refresh_acct(ct, ctinfo, skb, timeouts[new_state]); 504 - 505 - if (old_state == SCTP_CONNTRACK_COOKIE_ECHOED && 506 - dir == IP_CT_DIR_REPLY && 507 - new_state == SCTP_CONNTRACK_ESTABLISHED) { 508 - set_bit(IPS_ASSURED_BIT, &ct->status); 509 - nf_conntrack_event_cache(IPCT_ASSURED, ct); 510 - } 511 520 512 521 return NF_ACCEPT; 513 522 ··· 662 685 [CTA_TIMEOUT_SCTP_SHUTDOWN_ACK_SENT] = { .type = NLA_U32 }, 663 686 [CTA_TIMEOUT_SCTP_HEARTBEAT_SENT] = { .type = NLA_U32 }, 664 687 [CTA_TIMEOUT_SCTP_HEARTBEAT_ACKED] = { .type = NLA_U32 }, 665 - [CTA_TIMEOUT_SCTP_DATA_SENT] = { .type = NLA_U32 }, 666 688 }; 667 689 #endif /* CONFIG_NF_CONNTRACK_TIMEOUT */ 668 690
-16
net/netfilter/nf_conntrack_standalone.c
··· 601 601 NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_SHUTDOWN_RECD, 602 602 NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_SHUTDOWN_ACK_SENT, 603 603 NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_HEARTBEAT_SENT, 604 - NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_HEARTBEAT_ACKED, 605 - NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_DATA_SENT, 606 604 #endif 607 605 #ifdef CONFIG_NF_CT_PROTO_DCCP 608 606 NF_SYSCTL_CT_PROTO_TIMEOUT_DCCP_REQUEST, ··· 885 887 .mode = 0644, 886 888 .proc_handler = proc_dointvec_jiffies, 887 889 }, 888 - [NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_HEARTBEAT_ACKED] = { 889 - .procname = "nf_conntrack_sctp_timeout_heartbeat_acked", 890 - .maxlen = sizeof(unsigned int), 891 - .mode = 0644, 892 - .proc_handler = proc_dointvec_jiffies, 893 - }, 894 - [NF_SYSCTL_CT_PROTO_TIMEOUT_SCTP_DATA_SENT] = { 895 - .procname = "nf_conntrack_sctp_timeout_data_sent", 896 - .maxlen = sizeof(unsigned int), 897 - .mode = 0644, 898 - .proc_handler = proc_dointvec_jiffies, 899 - }, 900 890 #endif 901 891 #ifdef CONFIG_NF_CT_PROTO_DCCP 902 892 [NF_SYSCTL_CT_PROTO_TIMEOUT_DCCP_REQUEST] = { ··· 1028 1042 XASSIGN(SHUTDOWN_RECD, sn); 1029 1043 XASSIGN(SHUTDOWN_ACK_SENT, sn); 1030 1044 XASSIGN(HEARTBEAT_SENT, sn); 1031 - XASSIGN(HEARTBEAT_ACKED, sn); 1032 - XASSIGN(DATA_SENT, sn); 1033 1045 #undef XASSIGN 1034 1046 #endif 1035 1047 }
+207 -131
net/netfilter/nft_set_rbtree.c
··· 38 38 return !nft_rbtree_interval_end(rbe); 39 39 } 40 40 41 - static bool nft_rbtree_equal(const struct nft_set *set, const void *this, 42 - const struct nft_rbtree_elem *interval) 41 + static int nft_rbtree_cmp(const struct nft_set *set, 42 + const struct nft_rbtree_elem *e1, 43 + const struct nft_rbtree_elem *e2) 43 44 { 44 - return memcmp(this, nft_set_ext_key(&interval->ext), set->klen) == 0; 45 + return memcmp(nft_set_ext_key(&e1->ext), nft_set_ext_key(&e2->ext), 46 + set->klen); 45 47 } 46 48 47 49 static bool __nft_rbtree_lookup(const struct net *net, const struct nft_set *set, ··· 54 52 const struct nft_rbtree_elem *rbe, *interval = NULL; 55 53 u8 genmask = nft_genmask_cur(net); 56 54 const struct rb_node *parent; 57 - const void *this; 58 55 int d; 59 56 60 57 parent = rcu_dereference_raw(priv->root.rb_node); ··· 63 62 64 63 rbe = rb_entry(parent, struct nft_rbtree_elem, node); 65 64 66 - this = nft_set_ext_key(&rbe->ext); 67 - d = memcmp(this, key, set->klen); 65 + d = memcmp(nft_set_ext_key(&rbe->ext), key, set->klen); 68 66 if (d < 0) { 69 67 parent = rcu_dereference_raw(parent->rb_left); 70 68 if (interval && 71 - nft_rbtree_equal(set, this, interval) && 69 + !nft_rbtree_cmp(set, rbe, interval) && 72 70 nft_rbtree_interval_end(rbe) && 73 71 nft_rbtree_interval_start(interval)) 74 72 continue; ··· 215 215 return rbe; 216 216 } 217 217 218 + static int nft_rbtree_gc_elem(const struct nft_set *__set, 219 + struct nft_rbtree *priv, 220 + struct nft_rbtree_elem *rbe) 221 + { 222 + struct nft_set *set = (struct nft_set *)__set; 223 + struct rb_node *prev = rb_prev(&rbe->node); 224 + struct nft_rbtree_elem *rbe_prev; 225 + struct nft_set_gc_batch *gcb; 226 + 227 + gcb = nft_set_gc_batch_check(set, NULL, GFP_ATOMIC); 228 + if (!gcb) 229 + return -ENOMEM; 230 + 231 + /* search for expired end interval coming before this element. */ 232 + do { 233 + rbe_prev = rb_entry(prev, struct nft_rbtree_elem, node); 234 + if (nft_rbtree_interval_end(rbe_prev)) 235 + break; 236 + 237 + prev = rb_prev(prev); 238 + } while (prev != NULL); 239 + 240 + rb_erase(&rbe_prev->node, &priv->root); 241 + rb_erase(&rbe->node, &priv->root); 242 + atomic_sub(2, &set->nelems); 243 + 244 + nft_set_gc_batch_add(gcb, rbe); 245 + nft_set_gc_batch_complete(gcb); 246 + 247 + return 0; 248 + } 249 + 250 + static bool nft_rbtree_update_first(const struct nft_set *set, 251 + struct nft_rbtree_elem *rbe, 252 + struct rb_node *first) 253 + { 254 + struct nft_rbtree_elem *first_elem; 255 + 256 + first_elem = rb_entry(first, struct nft_rbtree_elem, node); 257 + /* this element is closest to where the new element is to be inserted: 258 + * update the first element for the node list path. 259 + */ 260 + if (nft_rbtree_cmp(set, rbe, first_elem) < 0) 261 + return true; 262 + 263 + return false; 264 + } 265 + 218 266 static int __nft_rbtree_insert(const struct net *net, const struct nft_set *set, 219 267 struct nft_rbtree_elem *new, 220 268 struct nft_set_ext **ext) 221 269 { 222 - bool overlap = false, dup_end_left = false, dup_end_right = false; 270 + struct nft_rbtree_elem *rbe, *rbe_le = NULL, *rbe_ge = NULL; 271 + struct rb_node *node, *parent, **p, *first = NULL; 223 272 struct nft_rbtree *priv = nft_set_priv(set); 224 273 u8 genmask = nft_genmask_next(net); 225 - struct nft_rbtree_elem *rbe; 226 - struct rb_node *parent, **p; 227 - int d; 274 + int d, err; 228 275 229 - /* Detect overlaps as we descend the tree. Set the flag in these cases: 230 - * 231 - * a1. _ _ __>| ?_ _ __| (insert end before existing end) 232 - * a2. _ _ ___| ?_ _ _>| (insert end after existing end) 233 - * a3. _ _ ___? >|_ _ __| (insert start before existing end) 234 - * 235 - * and clear it later on, as we eventually reach the points indicated by 236 - * '?' above, in the cases described below. We'll always meet these 237 - * later, locally, due to tree ordering, and overlaps for the intervals 238 - * that are the closest together are always evaluated last. 239 - * 240 - * b1. _ _ __>| !_ _ __| (insert end before existing start) 241 - * b2. _ _ ___| !_ _ _>| (insert end after existing start) 242 - * b3. _ _ ___! >|_ _ __| (insert start after existing end, as a leaf) 243 - * '--' no nodes falling in this range 244 - * b4. >|_ _ ! (insert start before existing start) 245 - * 246 - * Case a3. resolves to b3.: 247 - * - if the inserted start element is the leftmost, because the '0' 248 - * element in the tree serves as end element 249 - * - otherwise, if an existing end is found immediately to the left. If 250 - * there are existing nodes in between, we need to further descend the 251 - * tree before we can conclude the new start isn't causing an overlap 252 - * 253 - * or to b4., which, preceded by a3., means we already traversed one or 254 - * more existing intervals entirely, from the right. 255 - * 256 - * For a new, rightmost pair of elements, we'll hit cases b3. and b2., 257 - * in that order. 258 - * 259 - * The flag is also cleared in two special cases: 260 - * 261 - * b5. |__ _ _!|<_ _ _ (insert start right before existing end) 262 - * b6. |__ _ >|!__ _ _ (insert end right after existing start) 263 - * 264 - * which always happen as last step and imply that no further 265 - * overlapping is possible. 266 - * 267 - * Another special case comes from the fact that start elements matching 268 - * an already existing start element are allowed: insertion is not 269 - * performed but we return -EEXIST in that case, and the error will be 270 - * cleared by the caller if NLM_F_EXCL is not present in the request. 271 - * This way, request for insertion of an exact overlap isn't reported as 272 - * error to userspace if not desired. 273 - * 274 - * However, if the existing start matches a pre-existing start, but the 275 - * end element doesn't match the corresponding pre-existing end element, 276 - * we need to report a partial overlap. This is a local condition that 277 - * can be noticed without need for a tracking flag, by checking for a 278 - * local duplicated end for a corresponding start, from left and right, 279 - * separately. 276 + /* Descend the tree to search for an existing element greater than the 277 + * key value to insert that is greater than the new element. This is the 278 + * first element to walk the ordered elements to find possible overlap. 280 279 */ 281 - 282 280 parent = NULL; 283 281 p = &priv->root.rb_node; 284 282 while (*p != NULL) { 285 283 parent = *p; 286 284 rbe = rb_entry(parent, struct nft_rbtree_elem, node); 287 - d = memcmp(nft_set_ext_key(&rbe->ext), 288 - nft_set_ext_key(&new->ext), 289 - set->klen); 285 + d = nft_rbtree_cmp(set, rbe, new); 286 + 290 287 if (d < 0) { 291 288 p = &parent->rb_left; 292 - 293 - if (nft_rbtree_interval_start(new)) { 294 - if (nft_rbtree_interval_end(rbe) && 295 - nft_set_elem_active(&rbe->ext, genmask) && 296 - !nft_set_elem_expired(&rbe->ext) && !*p) 297 - overlap = false; 298 - } else { 299 - if (dup_end_left && !*p) 300 - return -ENOTEMPTY; 301 - 302 - overlap = nft_rbtree_interval_end(rbe) && 303 - nft_set_elem_active(&rbe->ext, 304 - genmask) && 305 - !nft_set_elem_expired(&rbe->ext); 306 - 307 - if (overlap) { 308 - dup_end_right = true; 309 - continue; 310 - } 311 - } 312 289 } else if (d > 0) { 290 + if (!first || 291 + nft_rbtree_update_first(set, rbe, first)) 292 + first = &rbe->node; 293 + 313 294 p = &parent->rb_right; 314 - 315 - if (nft_rbtree_interval_end(new)) { 316 - if (dup_end_right && !*p) 317 - return -ENOTEMPTY; 318 - 319 - overlap = nft_rbtree_interval_end(rbe) && 320 - nft_set_elem_active(&rbe->ext, 321 - genmask) && 322 - !nft_set_elem_expired(&rbe->ext); 323 - 324 - if (overlap) { 325 - dup_end_left = true; 326 - continue; 327 - } 328 - } else if (nft_set_elem_active(&rbe->ext, genmask) && 329 - !nft_set_elem_expired(&rbe->ext)) { 330 - overlap = nft_rbtree_interval_end(rbe); 331 - } 332 295 } else { 333 - if (nft_rbtree_interval_end(rbe) && 334 - nft_rbtree_interval_start(new)) { 296 + if (nft_rbtree_interval_end(rbe)) 335 297 p = &parent->rb_left; 336 - 337 - if (nft_set_elem_active(&rbe->ext, genmask) && 338 - !nft_set_elem_expired(&rbe->ext)) 339 - overlap = false; 340 - } else if (nft_rbtree_interval_start(rbe) && 341 - nft_rbtree_interval_end(new)) { 298 + else 342 299 p = &parent->rb_right; 343 - 344 - if (nft_set_elem_active(&rbe->ext, genmask) && 345 - !nft_set_elem_expired(&rbe->ext)) 346 - overlap = false; 347 - } else if (nft_set_elem_active(&rbe->ext, genmask) && 348 - !nft_set_elem_expired(&rbe->ext)) { 349 - *ext = &rbe->ext; 350 - return -EEXIST; 351 - } else { 352 - overlap = false; 353 - if (nft_rbtree_interval_end(rbe)) 354 - p = &parent->rb_left; 355 - else 356 - p = &parent->rb_right; 357 - } 358 300 } 359 - 360 - dup_end_left = dup_end_right = false; 361 301 } 362 302 363 - if (overlap) 303 + if (!first) 304 + first = rb_first(&priv->root); 305 + 306 + /* Detect overlap by going through the list of valid tree nodes. 307 + * Values stored in the tree are in reversed order, starting from 308 + * highest to lowest value. 309 + */ 310 + for (node = first; node != NULL; node = rb_next(node)) { 311 + rbe = rb_entry(node, struct nft_rbtree_elem, node); 312 + 313 + if (!nft_set_elem_active(&rbe->ext, genmask)) 314 + continue; 315 + 316 + /* perform garbage collection to avoid bogus overlap reports. */ 317 + if (nft_set_elem_expired(&rbe->ext)) { 318 + err = nft_rbtree_gc_elem(set, priv, rbe); 319 + if (err < 0) 320 + return err; 321 + 322 + continue; 323 + } 324 + 325 + d = nft_rbtree_cmp(set, rbe, new); 326 + if (d == 0) { 327 + /* Matching end element: no need to look for an 328 + * overlapping greater or equal element. 329 + */ 330 + if (nft_rbtree_interval_end(rbe)) { 331 + rbe_le = rbe; 332 + break; 333 + } 334 + 335 + /* first element that is greater or equal to key value. */ 336 + if (!rbe_ge) { 337 + rbe_ge = rbe; 338 + continue; 339 + } 340 + 341 + /* this is a closer more or equal element, update it. */ 342 + if (nft_rbtree_cmp(set, rbe_ge, new) != 0) { 343 + rbe_ge = rbe; 344 + continue; 345 + } 346 + 347 + /* element is equal to key value, make sure flags are 348 + * the same, an existing more or equal start element 349 + * must not be replaced by more or equal end element. 350 + */ 351 + if ((nft_rbtree_interval_start(new) && 352 + nft_rbtree_interval_start(rbe_ge)) || 353 + (nft_rbtree_interval_end(new) && 354 + nft_rbtree_interval_end(rbe_ge))) { 355 + rbe_ge = rbe; 356 + continue; 357 + } 358 + } else if (d > 0) { 359 + /* annotate element greater than the new element. */ 360 + rbe_ge = rbe; 361 + continue; 362 + } else if (d < 0) { 363 + /* annotate element less than the new element. */ 364 + rbe_le = rbe; 365 + break; 366 + } 367 + } 368 + 369 + /* - new start element matching existing start element: full overlap 370 + * reported as -EEXIST, cleared by caller if NLM_F_EXCL is not given. 371 + */ 372 + if (rbe_ge && !nft_rbtree_cmp(set, new, rbe_ge) && 373 + nft_rbtree_interval_start(rbe_ge) == nft_rbtree_interval_start(new)) { 374 + *ext = &rbe_ge->ext; 375 + return -EEXIST; 376 + } 377 + 378 + /* - new end element matching existing end element: full overlap 379 + * reported as -EEXIST, cleared by caller if NLM_F_EXCL is not given. 380 + */ 381 + if (rbe_le && !nft_rbtree_cmp(set, new, rbe_le) && 382 + nft_rbtree_interval_end(rbe_le) == nft_rbtree_interval_end(new)) { 383 + *ext = &rbe_le->ext; 384 + return -EEXIST; 385 + } 386 + 387 + /* - new start element with existing closest, less or equal key value 388 + * being a start element: partial overlap, reported as -ENOTEMPTY. 389 + * Anonymous sets allow for two consecutive start element since they 390 + * are constant, skip them to avoid bogus overlap reports. 391 + */ 392 + if (!nft_set_is_anonymous(set) && rbe_le && 393 + nft_rbtree_interval_start(rbe_le) && nft_rbtree_interval_start(new)) 364 394 return -ENOTEMPTY; 395 + 396 + /* - new end element with existing closest, less or equal key value 397 + * being a end element: partial overlap, reported as -ENOTEMPTY. 398 + */ 399 + if (rbe_le && 400 + nft_rbtree_interval_end(rbe_le) && nft_rbtree_interval_end(new)) 401 + return -ENOTEMPTY; 402 + 403 + /* - new end element with existing closest, greater or equal key value 404 + * being an end element: partial overlap, reported as -ENOTEMPTY 405 + */ 406 + if (rbe_ge && 407 + nft_rbtree_interval_end(rbe_ge) && nft_rbtree_interval_end(new)) 408 + return -ENOTEMPTY; 409 + 410 + /* Accepted element: pick insertion point depending on key value */ 411 + parent = NULL; 412 + p = &priv->root.rb_node; 413 + while (*p != NULL) { 414 + parent = *p; 415 + rbe = rb_entry(parent, struct nft_rbtree_elem, node); 416 + d = nft_rbtree_cmp(set, rbe, new); 417 + 418 + if (d < 0) 419 + p = &parent->rb_left; 420 + else if (d > 0) 421 + p = &parent->rb_right; 422 + else if (nft_rbtree_interval_end(rbe)) 423 + p = &parent->rb_left; 424 + else 425 + p = &parent->rb_right; 426 + } 365 427 366 428 rb_link_node_rcu(&new->node, parent, p); 367 429 rb_insert_color(&new->node, &priv->root); ··· 563 501 struct nft_rbtree *priv; 564 502 struct rb_node *node; 565 503 struct nft_set *set; 504 + struct net *net; 505 + u8 genmask; 566 506 567 507 priv = container_of(work, struct nft_rbtree, gc_work.work); 568 508 set = nft_set_container_of(priv); 509 + net = read_pnet(&set->net); 510 + genmask = nft_genmask_cur(net); 569 511 570 512 write_lock_bh(&priv->lock); 571 513 write_seqcount_begin(&priv->count); 572 514 for (node = rb_first(&priv->root); node != NULL; node = rb_next(node)) { 573 515 rbe = rb_entry(node, struct nft_rbtree_elem, node); 574 516 517 + if (!nft_set_elem_active(&rbe->ext, genmask)) 518 + continue; 519 + 520 + /* elements are reversed in the rbtree for historical reasons, 521 + * from highest to lowest value, that is why end element is 522 + * always visited before the start element. 523 + */ 575 524 if (nft_rbtree_interval_end(rbe)) { 576 525 rbe_end = rbe; 577 526 continue; 578 527 } 579 528 if (!nft_set_elem_expired(&rbe->ext)) 580 529 continue; 581 - if (nft_set_elem_mark_busy(&rbe->ext)) 530 + 531 + if (nft_set_elem_mark_busy(&rbe->ext)) { 532 + rbe_end = NULL; 582 533 continue; 534 + } 583 535 584 536 if (rbe_prev) { 585 537 rb_erase(&rbe_prev->node, &priv->root);
+24 -14
net/netlink/af_netlink.c
··· 580 580 if (nlk_sk(sk)->bound) 581 581 goto err; 582 582 583 - nlk_sk(sk)->portid = portid; 583 + /* portid can be read locklessly from netlink_getname(). */ 584 + WRITE_ONCE(nlk_sk(sk)->portid, portid); 585 + 584 586 sock_hold(sk); 585 587 586 588 err = __netlink_insert(table, sk); ··· 1098 1096 return -EINVAL; 1099 1097 1100 1098 if (addr->sa_family == AF_UNSPEC) { 1101 - sk->sk_state = NETLINK_UNCONNECTED; 1102 - nlk->dst_portid = 0; 1103 - nlk->dst_group = 0; 1099 + /* paired with READ_ONCE() in netlink_getsockbyportid() */ 1100 + WRITE_ONCE(sk->sk_state, NETLINK_UNCONNECTED); 1101 + /* dst_portid and dst_group can be read locklessly */ 1102 + WRITE_ONCE(nlk->dst_portid, 0); 1103 + WRITE_ONCE(nlk->dst_group, 0); 1104 1104 return 0; 1105 1105 } 1106 1106 if (addr->sa_family != AF_NETLINK) ··· 1123 1119 err = netlink_autobind(sock); 1124 1120 1125 1121 if (err == 0) { 1126 - sk->sk_state = NETLINK_CONNECTED; 1127 - nlk->dst_portid = nladdr->nl_pid; 1128 - nlk->dst_group = ffs(nladdr->nl_groups); 1122 + /* paired with READ_ONCE() in netlink_getsockbyportid() */ 1123 + WRITE_ONCE(sk->sk_state, NETLINK_CONNECTED); 1124 + /* dst_portid and dst_group can be read locklessly */ 1125 + WRITE_ONCE(nlk->dst_portid, nladdr->nl_pid); 1126 + WRITE_ONCE(nlk->dst_group, ffs(nladdr->nl_groups)); 1129 1127 } 1130 1128 1131 1129 return err; ··· 1144 1138 nladdr->nl_pad = 0; 1145 1139 1146 1140 if (peer) { 1147 - nladdr->nl_pid = nlk->dst_portid; 1148 - nladdr->nl_groups = netlink_group_mask(nlk->dst_group); 1141 + /* Paired with WRITE_ONCE() in netlink_connect() */ 1142 + nladdr->nl_pid = READ_ONCE(nlk->dst_portid); 1143 + nladdr->nl_groups = netlink_group_mask(READ_ONCE(nlk->dst_group)); 1149 1144 } else { 1150 - nladdr->nl_pid = nlk->portid; 1145 + /* Paired with WRITE_ONCE() in netlink_insert() */ 1146 + nladdr->nl_pid = READ_ONCE(nlk->portid); 1151 1147 netlink_lock_table(); 1152 1148 nladdr->nl_groups = nlk->groups ? nlk->groups[0] : 0; 1153 1149 netlink_unlock_table(); ··· 1176 1168 1177 1169 /* Don't bother queuing skb if kernel socket has no input function */ 1178 1170 nlk = nlk_sk(sock); 1179 - if (sock->sk_state == NETLINK_CONNECTED && 1180 - nlk->dst_portid != nlk_sk(ssk)->portid) { 1171 + /* dst_portid and sk_state can be changed in netlink_connect() */ 1172 + if (READ_ONCE(sock->sk_state) == NETLINK_CONNECTED && 1173 + READ_ONCE(nlk->dst_portid) != nlk_sk(ssk)->portid) { 1181 1174 sock_put(sock); 1182 1175 return ERR_PTR(-ECONNREFUSED); 1183 1176 } ··· 1895 1886 goto out; 1896 1887 netlink_skb_flags |= NETLINK_SKB_DST; 1897 1888 } else { 1898 - dst_portid = nlk->dst_portid; 1899 - dst_group = nlk->dst_group; 1889 + /* Paired with WRITE_ONCE() in netlink_connect() */ 1890 + dst_portid = READ_ONCE(nlk->dst_portid); 1891 + dst_group = READ_ONCE(nlk->dst_group); 1900 1892 } 1901 1893 1902 1894 /* Paired with WRITE_ONCE() in netlink_insert() */
+1
net/netrom/nr_timer.c
··· 121 121 is accepted() it isn't 'dead' so doesn't get removed. */ 122 122 if (sock_flag(sk, SOCK_DESTROY) || 123 123 (sk->sk_state == TCP_LISTEN && sock_flag(sk, SOCK_DEAD))) { 124 + sock_hold(sk); 124 125 bh_unlock_sock(sk); 125 126 nr_destroy_socket(sk); 126 127 goto out;
-1
net/sched/sch_taprio.c
··· 1700 1700 int i; 1701 1701 1702 1702 hrtimer_cancel(&q->advance_timer); 1703 - qdisc_synchronize(sch); 1704 1703 1705 1704 if (q->qdiscs) { 1706 1705 for (i = 0; i < dev->num_tx_queues; i++)
+6
net/sctp/bind_addr.c
··· 73 73 } 74 74 } 75 75 76 + /* If somehow no addresses were found that can be used with this 77 + * scope, it's an error. 78 + */ 79 + if (list_empty(&dest->address_list)) 80 + error = -ENETUNREACH; 81 + 76 82 out: 77 83 if (error) 78 84 sctp_bind_addr_clean(dest);
+6
net/x25/af_x25.c
··· 482 482 int rc = -EOPNOTSUPP; 483 483 484 484 lock_sock(sk); 485 + if (sock->state != SS_UNCONNECTED) { 486 + rc = -EINVAL; 487 + release_sock(sk); 488 + return rc; 489 + } 490 + 485 491 if (sk->sk_state != TCP_LISTEN) { 486 492 memset(&x25_sk(sk)->dest_addr, 0, X25_ADDR_LEN); 487 493 sk->sk_max_ack_backlog = backlog;
+18 -11
rust/kernel/print.rs
··· 142 142 macro_rules! print_macro ( 143 143 // The non-continuation cases (most of them, e.g. `INFO`). 144 144 ($format_string:path, false, $($arg:tt)+) => ( 145 - // SAFETY: This hidden macro should only be called by the documented 146 - // printing macros which ensure the format string is one of the fixed 147 - // ones. All `__LOG_PREFIX`s are null-terminated as they are generated 148 - // by the `module!` proc macro or fixed values defined in a kernel 149 - // crate. 150 - unsafe { 151 - $crate::print::call_printk( 152 - &$format_string, 153 - crate::__LOG_PREFIX, 154 - format_args!($($arg)+), 155 - ); 145 + // To remain sound, `arg`s must be expanded outside the `unsafe` block. 146 + // Typically one would use a `let` binding for that; however, `format_args!` 147 + // takes borrows on the arguments, but does not extend the scope of temporaries. 148 + // Therefore, a `match` expression is used to keep them around, since 149 + // the scrutinee is kept until the end of the `match`. 150 + match format_args!($($arg)+) { 151 + // SAFETY: This hidden macro should only be called by the documented 152 + // printing macros which ensure the format string is one of the fixed 153 + // ones. All `__LOG_PREFIX`s are null-terminated as they are generated 154 + // by the `module!` proc macro or fixed values defined in a kernel 155 + // crate. 156 + args => unsafe { 157 + $crate::print::call_printk( 158 + &$format_string, 159 + crate::__LOG_PREFIX, 160 + args, 161 + ); 162 + } 156 163 } 157 164 ); 158 165
+14 -5
scripts/jobserver-exec
··· 26 26 # If the MAKEFLAGS variable contains multiple instances of the 27 27 # --jobserver-auth= option, the last one is relevant. 28 28 fds = opts[-1].split("=", 1)[1] 29 - reader, writer = [int(x) for x in fds.split(",", 1)] 30 - # Open a private copy of reader to avoid setting nonblocking 31 - # on an unexpecting process with the same reader fd. 32 - reader = os.open("/proc/self/fd/%d" % (reader), 33 - os.O_RDONLY | os.O_NONBLOCK) 29 + 30 + # Starting with GNU Make 4.4, named pipes are used for reader and writer. 31 + # Example argument: --jobserver-auth=fifo:/tmp/GMfifo8134 32 + _, _, path = fds.partition('fifo:') 33 + 34 + if path: 35 + reader = os.open(path, os.O_RDONLY | os.O_NONBLOCK) 36 + writer = os.open(path, os.O_WRONLY) 37 + else: 38 + reader, writer = [int(x) for x in fds.split(",", 1)] 39 + # Open a private copy of reader to avoid setting nonblocking 40 + # on an unexpecting process with the same reader fd. 41 + reader = os.open("/proc/self/fd/%d" % (reader), 42 + os.O_RDONLY | os.O_NONBLOCK) 34 43 35 44 # Read out as many jobserver slots as possible. 36 45 while True:
+1 -1
scripts/kconfig/.gitignore
··· 1 1 # SPDX-License-Identifier: GPL-2.0-only 2 2 /conf 3 3 /[gmnq]conf 4 + /[gmnq]conf-bin 4 5 /[gmnq]conf-cflags 5 6 /[gmnq]conf-libs 6 - /qconf-bin 7 7 /qconf-moc.cc
+1 -1
scripts/kconfig/Makefile
··· 209 209 $(obj)/gconf.o: | $(obj)/gconf-cflags 210 210 211 211 # check if necessary packages are available, and configure build flags 212 - cmd_conf_cfg = $< $(addprefix $(obj)/$*conf-, cflags libs bin) 212 + cmd_conf_cfg = $< $(addprefix $(obj)/$*conf-, cflags libs bin); touch $(obj)/$*conf-bin 213 213 214 214 $(obj)/%conf-cflags $(obj)/%conf-libs $(obj)/%conf-bin: $(src)/%conf-cfg.sh 215 215 $(call cmd,conf_cfg)
+1 -1
scripts/package/mkspec
··· 1 1 #!/bin/sh 2 2 # 3 3 # Output a simple RPM spec file. 4 - # This version assumes a minimum of RPM 4.0.3. 4 + # This version assumes a minimum of RPM 4.13 5 5 # 6 6 # The only gothic bit here is redefining install_post to avoid 7 7 # stripping the symbols from files in the kernel which we want
sound/soc/codecs/es8326.c
sound/soc/codecs/es8326.h
+1 -1
tools/testing/selftests/kvm/x86_64/nx_huge_pages_test.c
··· 241 241 while ((opt = getopt(argc, argv, "hp:t:r")) != -1) { 242 242 switch (opt) { 243 243 case 'p': 244 - reclaim_period_ms = atoi_non_negative("Reclaim period", optarg); 244 + reclaim_period_ms = atoi_positive("Reclaim period", optarg); 245 245 break; 246 246 case 't': 247 247 token = atoi_paranoid(optarg);
+3 -4
tools/testing/selftests/kvm/x86_64/xen_shinfo_test.c
··· 434 434 int main(int argc, char *argv[]) 435 435 { 436 436 struct timespec min_ts, max_ts, vm_ts; 437 + struct kvm_xen_hvm_attr evt_reset; 437 438 struct kvm_vm *vm; 438 439 pthread_t thread; 439 440 bool verbose; ··· 963 962 } 964 963 965 964 done: 966 - struct kvm_xen_hvm_attr evt_reset = { 967 - .type = KVM_XEN_ATTR_TYPE_EVTCHN, 968 - .u.evtchn.flags = KVM_XEN_EVTCHN_RESET, 969 - }; 965 + evt_reset.type = KVM_XEN_ATTR_TYPE_EVTCHN; 966 + evt_reset.u.evtchn.flags = KVM_XEN_EVTCHN_RESET; 970 967 vm_ioctl(vm, KVM_XEN_HVM_SET_ATTR, &evt_reset); 971 968 972 969 alarm(0);
+1 -1
tools/testing/selftests/lib.mk
··· 20 20 21 21 ifeq ($(CROSS_COMPILE),) 22 22 ifeq ($(CLANG_TARGET_FLAGS),) 23 - $(error Specify CROSS_COMPILE or add '--target=' option to lib.mk 23 + $(error Specify CROSS_COMPILE or add '--target=' option to lib.mk) 24 24 else 25 25 CLANG_FLAGS += --target=$(CLANG_TARGET_FLAGS) 26 26 endif # CLANG_TARGET_FLAGS
+3 -3
virt/kvm/vfio.c
··· 336 336 return -ENXIO; 337 337 } 338 338 339 - static void kvm_vfio_destroy(struct kvm_device *dev) 339 + static void kvm_vfio_release(struct kvm_device *dev) 340 340 { 341 341 struct kvm_vfio *kv = dev->private; 342 342 struct kvm_vfio_group *kvg, *tmp; ··· 355 355 kvm_vfio_update_coherency(dev); 356 356 357 357 kfree(kv); 358 - kfree(dev); /* alloc by kvm_ioctl_create_device, free by .destroy */ 358 + kfree(dev); /* alloc by kvm_ioctl_create_device, free by .release */ 359 359 } 360 360 361 361 static int kvm_vfio_create(struct kvm_device *dev, u32 type); ··· 363 363 static struct kvm_device_ops kvm_vfio_ops = { 364 364 .name = "kvm-vfio", 365 365 .create = kvm_vfio_create, 366 - .destroy = kvm_vfio_destroy, 366 + .release = kvm_vfio_release, 367 367 .set_attr = kvm_vfio_set_attr, 368 368 .has_attr = kvm_vfio_has_attr, 369 369 };