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

No conflicts.

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

+2795 -1910
+1
CREDITS
··· 971 971 N: Daniel Drake 972 972 E: dsd@gentoo.org 973 973 D: USBAT02 CompactFlash support in usb-storage 974 + D: ZD1211RW wireless driver 974 975 S: UK 975 976 976 977 N: Oleg Drokin
-2
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi83.yaml
··· 50 50 data-lanes: 51 51 description: array of physical DSI data lane indexes. 52 52 minItems: 1 53 - maxItems: 4 54 53 items: 55 54 - const: 1 56 55 - const: 2 ··· 70 71 data-lanes: 71 72 description: array of physical DSI data lane indexes. 72 73 minItems: 1 73 - maxItems: 4 74 74 items: 75 75 - const: 1 76 76 - const: 2
+1 -1
Documentation/devicetree/bindings/display/bridge/ti,sn65dsi86.yaml
··· 18 18 const: ti,sn65dsi86 19 19 20 20 reg: 21 - const: 0x2d 21 + enum: [ 0x2c, 0x2d ] 22 22 23 23 enable-gpios: 24 24 maxItems: 1
+42 -4
Documentation/devicetree/bindings/interconnect/qcom,sdm660.yaml
··· 31 31 32 32 clocks: 33 33 minItems: 1 34 - maxItems: 3 34 + maxItems: 7 35 35 36 36 clock-names: 37 37 minItems: 1 38 - maxItems: 3 38 + maxItems: 7 39 39 40 40 required: 41 41 - compatible ··· 72 72 contains: 73 73 enum: 74 74 - qcom,sdm660-a2noc 75 + then: 76 + properties: 77 + clocks: 78 + items: 79 + - description: Bus Clock. 80 + - description: Bus A Clock. 81 + - description: IPA Clock. 82 + - description: UFS AXI Clock. 83 + - description: Aggregate2 UFS AXI Clock. 84 + - description: Aggregate2 USB3 AXI Clock. 85 + - description: Config NoC USB2 AXI Clock. 86 + clock-names: 87 + items: 88 + - const: bus 89 + - const: bus_a 90 + - const: ipa 91 + - const: ufs_axi 92 + - const: aggre2_ufs_axi 93 + - const: aggre2_usb3_axi 94 + - const: cfg_noc_usb2_axi 95 + 96 + - if: 97 + properties: 98 + compatible: 99 + contains: 100 + enum: 75 101 - qcom,sdm660-bimc 76 102 - qcom,sdm660-cnoc 77 103 - qcom,sdm660-gnoc ··· 117 91 - | 118 92 #include <dt-bindings/clock/qcom,rpmcc.h> 119 93 #include <dt-bindings/clock/qcom,mmcc-sdm660.h> 94 + #include <dt-bindings/clock/qcom,gcc-sdm660.h> 120 95 121 96 bimc: interconnect@1008000 { 122 97 compatible = "qcom,sdm660-bimc"; ··· 150 123 compatible = "qcom,sdm660-a2noc"; 151 124 reg = <0x01704000 0xc100>; 152 125 #interconnect-cells = <1>; 153 - clock-names = "bus", "bus_a"; 126 + clock-names = "bus", 127 + "bus_a", 128 + "ipa", 129 + "ufs_axi", 130 + "aggre2_ufs_axi", 131 + "aggre2_usb3_axi", 132 + "cfg_noc_usb2_axi"; 154 133 clocks = <&rpmcc RPM_SMD_AGGR2_NOC_CLK>, 155 - <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>; 134 + <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>, 135 + <&rpmcc RPM_SMD_IPA_CLK>, 136 + <&gcc GCC_UFS_AXI_CLK>, 137 + <&gcc GCC_AGGRE2_UFS_AXI_CLK>, 138 + <&gcc GCC_AGGRE2_USB3_AXI_CLK>, 139 + <&gcc GCC_CFG_NOC_USB2_AXI_CLK>; 156 140 }; 157 141 158 142 mnoc: interconnect@1745000 {
+1 -1
Documentation/devicetree/bindings/media/i2c/ovti,ov5647.yaml
··· 31 31 maxItems: 1 32 32 33 33 port: 34 - $ref: /schemas/graph.yaml#/properties/port 34 + $ref: /schemas/graph.yaml#/$defs/port-base 35 35 additionalProperties: false 36 36 37 37 properties:
+1 -1
Documentation/devicetree/bindings/media/i2c/ovti,ov9282.yaml
··· 38 38 39 39 port: 40 40 additionalProperties: false 41 - $ref: /schemas/graph.yaml#/properties/port 41 + $ref: /schemas/graph.yaml#/$defs/port-base 42 42 43 43 properties: 44 44 endpoint:
+1 -1
Documentation/devicetree/bindings/media/i2c/sony,imx335.yaml
··· 38 38 39 39 port: 40 40 additionalProperties: false 41 - $ref: /schemas/graph.yaml#/properties/port 41 + $ref: /schemas/graph.yaml#/$defs/port-base 42 42 43 43 properties: 44 44 endpoint:
+1 -1
Documentation/devicetree/bindings/media/i2c/sony,imx412.yaml
··· 38 38 39 39 port: 40 40 additionalProperties: false 41 - $ref: /schemas/graph.yaml#/properties/port 41 + $ref: /schemas/graph.yaml#/$defs/port-base 42 42 43 43 properties: 44 44 endpoint:
+1 -3
Documentation/devicetree/bindings/mmc/snps,dwcmshc-sdhci.yaml
··· 20 20 - snps,dwcmshc-sdhci 21 21 22 22 reg: 23 - minItems: 1 24 - items: 25 - - description: Offset and length of the register set for the device 23 + maxItems: 1 26 24 27 25 interrupts: 28 26 maxItems: 1
+1 -1
Documentation/devicetree/bindings/net/dsa/marvell.txt
··· 83 83 #interrupt-cells = <2>; 84 84 85 85 switch0: switch@0 { 86 - compatible = "marvell,mv88e6390"; 86 + compatible = "marvell,mv88e6190"; 87 87 reg = <0>; 88 88 reset-gpios = <&gpio5 1 GPIO_ACTIVE_LOW>; 89 89
-1
Documentation/devicetree/bindings/net/nxp,dwmac-imx.yaml
··· 34 34 35 35 clocks: 36 36 minItems: 3 37 - maxItems: 5 38 37 items: 39 38 - description: MAC host clock 40 39 - description: MAC apb clock
-1
Documentation/devicetree/bindings/pci/fsl,imx6q-pcie.yaml
··· 41 41 - description: builtin MSI controller. 42 42 43 43 interrupt-names: 44 - minItems: 1 45 44 items: 46 45 - const: msi 47 46
-17
Documentation/hwmon/k10temp.rst
··· 132 132 Core Complex Die (CCD) temperatures. Up to 8 such temperatures are reported 133 133 as temp{3..10}_input, labeled Tccd{1..8}. Actual support depends on the CPU 134 134 variant. 135 - 136 - Various Family 17h and 18h CPUs report voltage and current telemetry 137 - information. The following attributes may be reported. 138 - 139 - Attribute Label Description 140 - =============== ======= ================ 141 - in0_input Vcore Core voltage 142 - in1_input Vsoc SoC voltage 143 - curr1_input Icore Core current 144 - curr2_input Isoc SoC current 145 - =============== ======= ================ 146 - 147 - Current values are raw (unscaled) as reported by the CPU. Core current is 148 - reported as multiples of 1A / LSB. SoC is reported as multiples of 0.25A 149 - / LSB. The real current is board specific. Reported currents should be seen 150 - as rough guidance, and should be scaled using sensors3.conf as appropriate 151 - for a given board.
+13 -9
MAINTAINERS
··· 414 414 F: drivers/acpi/pmic/ 415 415 416 416 ACPI THERMAL DRIVER 417 - M: Zhang Rui <rui.zhang@intel.com> 417 + M: Rafael J. Wysocki <rafael@kernel.org> 418 + R: Zhang Rui <rui.zhang@intel.com> 418 419 L: linux-acpi@vger.kernel.org 419 420 S: Supported 420 421 W: https://01.org/linux-acpi ··· 1276 1275 1277 1276 APPLE DART IOMMU DRIVER 1278 1277 M: Sven Peter <sven@svenpeter.dev> 1278 + R: Alyssa Rosenzweig <alyssa@rosenzweig.io> 1279 1279 L: iommu@lists.linux-foundation.org 1280 1280 S: Maintained 1281 1281 F: Documentation/devicetree/bindings/iommu/apple,dart.yaml ··· 1713 1711 1714 1712 ARM/APPLE MACHINE SUPPORT 1715 1713 M: Hector Martin <marcan@marcan.st> 1714 + M: Sven Peter <sven@svenpeter.dev> 1715 + R: Alyssa Rosenzweig <alyssa@rosenzweig.io> 1716 1716 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 1717 1717 S: Maintained 1718 1718 W: https://asahilinux.org ··· 2240 2236 2241 2237 ARM/MStar/Sigmastar Armv7 SoC support 2242 2238 M: Daniel Palmer <daniel@thingy.jp> 2239 + M: Romain Perier <romain.perier@gmail.com> 2243 2240 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2244 2241 S: Maintained 2245 2242 W: http://linux-chenxing.org/ ··· 2717 2712 2718 2713 ARM/TEXAS INSTRUMENTS K3 ARCHITECTURE 2719 2714 M: Nishanth Menon <nm@ti.com> 2715 + M: Vignesh Raghavendra <vigneshr@ti.com> 2720 2716 M: Tero Kristo <kristo@kernel.org> 2721 2717 L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) 2722 2718 S: Supported ··· 4662 4656 T: git git://git.samba.org/sfrench/cifs-2.6.git 4663 4657 F: Documentation/admin-guide/cifs/ 4664 4658 F: fs/cifs/ 4665 - F: fs/cifs_common/ 4659 + F: fs/smbfs_common/ 4666 4660 4667 4661 COMPACTPCI HOTPLUG CORE 4668 4662 M: Scott Murray <scott@spiteful.org> ··· 8614 8608 F: drivers/iio/humidity/hts221* 8615 8609 8616 8610 HUAWEI ETHERNET DRIVER 8617 - M: Bin Luo <luobin9@huawei.com> 8618 8611 L: netdev@vger.kernel.org 8619 - S: Supported 8612 + S: Orphan 8620 8613 F: Documentation/networking/device_drivers/ethernet/huawei/hinic.rst 8621 8614 F: drivers/net/ethernet/huawei/hinic/ 8622 8615 ··· 10199 10194 L: linux-cifs@vger.kernel.org 10200 10195 S: Maintained 10201 10196 T: git git://git.samba.org/ksmbd.git 10202 - F: fs/cifs_common/ 10203 10197 F: fs/ksmbd/ 10198 + F: fs/smbfs_common/ 10204 10199 10205 10200 KERNEL UNIT TESTING FRAMEWORK (KUnit) 10206 10201 M: Brendan Higgins <brendanhiggins@google.com> ··· 17798 17793 17799 17794 STAGING - OLPC SECONDARY DISPLAY CONTROLLER (DCON) 17800 17795 M: Jens Frederich <jfrederich@gmail.com> 17801 - M: Daniel Drake <dsd@laptop.org> 17802 17796 M: Jon Nettleton <jon.nettleton@gmail.com> 17803 17797 S: Maintained 17804 17798 W: http://wiki.laptop.org/go/DCON ··· 18553 18549 F: drivers/media/radio/radio-raremono.c 18554 18550 18555 18551 THERMAL 18556 - M: Zhang Rui <rui.zhang@intel.com> 18552 + M: Rafael J. Wysocki <rafael@kernel.org> 18557 18553 M: Daniel Lezcano <daniel.lezcano@linaro.org> 18558 18554 R: Amit Kucheria <amitk@kernel.org> 18555 + R: Zhang Rui <rui.zhang@intel.com> 18559 18556 L: linux-pm@vger.kernel.org 18560 18557 S: Supported 18561 18558 Q: https://patchwork.kernel.org/project/linux-pm/list/ 18562 - T: git git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git 18559 + T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal 18563 18560 F: Documentation/devicetree/bindings/thermal/ 18564 18561 F: drivers/thermal/ 18565 18562 F: include/linux/cpu_cooling.h ··· 20703 20698 F: mm/zbud.c 20704 20699 20705 20700 ZD1211RW WIRELESS DRIVER 20706 - M: Daniel Drake <dsd@gentoo.org> 20707 20701 M: Ulrich Kunitz <kune@deine-taler.de> 20708 20702 L: linux-wireless@vger.kernel.org 20709 20703 L: zd1211-devs@lists.sourceforge.net (subscribers-only)
+1 -1
Makefile
··· 2 2 VERSION = 5 3 3 PATCHLEVEL = 15 4 4 SUBLEVEL = 0 5 - EXTRAVERSION = -rc3 5 + EXTRAVERSION = -rc4 6 6 NAME = Opossums on Parade 7 7 8 8 # *DOCUMENTATION*
-1
arch/arm/boot/dts/at91-sama5d27_som1_ek.dts
··· 71 71 isc: isc@f0008000 { 72 72 pinctrl-names = "default"; 73 73 pinctrl-0 = <&pinctrl_isc_base &pinctrl_isc_data_8bit &pinctrl_isc_data_9_10 &pinctrl_isc_data_11_12>; 74 - status = "okay"; 75 74 }; 76 75 77 76 qspi1: spi@f0024000 {
+39 -6
arch/arm/boot/dts/at91-sama7g5ek.dts
··· 196 196 197 197 regulator-state-standby { 198 198 regulator-on-in-suspend; 199 + regulator-suspend-microvolt = <1350000>; 199 200 regulator-mode = <4>; 200 201 }; 201 202 202 203 regulator-state-mem { 203 204 regulator-on-in-suspend; 205 + regulator-suspend-microvolt = <1350000>; 204 206 regulator-mode = <4>; 205 207 }; 206 208 }; ··· 355 353 #address-cells = <1>; 356 354 #size-cells = <0>; 357 355 pinctrl-names = "default"; 358 - pinctrl-0 = <&pinctrl_gmac0_default &pinctrl_gmac0_txck_default &pinctrl_gmac0_phy_irq>; 356 + pinctrl-0 = <&pinctrl_gmac0_default 357 + &pinctrl_gmac0_mdio_default 358 + &pinctrl_gmac0_txck_default 359 + &pinctrl_gmac0_phy_irq>; 359 360 phy-mode = "rgmii-id"; 360 361 status = "okay"; 361 362 ··· 373 368 #address-cells = <1>; 374 369 #size-cells = <0>; 375 370 pinctrl-names = "default"; 376 - pinctrl-0 = <&pinctrl_gmac1_default &pinctrl_gmac1_phy_irq>; 371 + pinctrl-0 = <&pinctrl_gmac1_default 372 + &pinctrl_gmac1_mdio_default 373 + &pinctrl_gmac1_phy_irq>; 377 374 phy-mode = "rmii"; 378 375 status = "okay"; 379 376 ··· 430 423 <PIN_PA15__G0_TXEN>, 431 424 <PIN_PA30__G0_RXCK>, 432 425 <PIN_PA18__G0_RXDV>, 433 - <PIN_PA22__G0_MDC>, 434 - <PIN_PA23__G0_MDIO>, 435 426 <PIN_PA25__G0_125CK>; 427 + slew-rate = <0>; 428 + bias-disable; 429 + }; 430 + 431 + pinctrl_gmac0_mdio_default: gmac0_mdio_default { 432 + pinmux = <PIN_PA22__G0_MDC>, 433 + <PIN_PA23__G0_MDIO>; 436 434 bias-disable; 437 435 }; 438 436 439 437 pinctrl_gmac0_txck_default: gmac0_txck_default { 440 438 pinmux = <PIN_PA24__G0_TXCK>; 439 + slew-rate = <0>; 441 440 bias-pull-up; 442 441 }; 443 442 ··· 460 447 <PIN_PD25__G1_RX0>, 461 448 <PIN_PD26__G1_RX1>, 462 449 <PIN_PD27__G1_RXER>, 463 - <PIN_PD24__G1_RXDV>, 464 - <PIN_PD28__G1_MDC>, 450 + <PIN_PD24__G1_RXDV>; 451 + slew-rate = <0>; 452 + bias-disable; 453 + }; 454 + 455 + pinctrl_gmac1_mdio_default: gmac1_mdio_default { 456 + pinmux = <PIN_PD28__G1_MDC>, 465 457 <PIN_PD29__G1_MDIO>; 466 458 bias-disable; 467 459 }; ··· 558 540 <PIN_PA8__SDMMC0_DAT5>, 559 541 <PIN_PA9__SDMMC0_DAT6>, 560 542 <PIN_PA10__SDMMC0_DAT7>; 543 + slew-rate = <0>; 561 544 bias-pull-up; 562 545 }; 563 546 ··· 566 547 pinmux = <PIN_PA0__SDMMC0_CK>, 567 548 <PIN_PA2__SDMMC0_RSTN>, 568 549 <PIN_PA11__SDMMC0_DS>; 550 + slew-rate = <0>; 569 551 bias-pull-up; 570 552 }; 571 553 }; ··· 578 558 <PIN_PC0__SDMMC1_DAT1>, 579 559 <PIN_PC1__SDMMC1_DAT2>, 580 560 <PIN_PC2__SDMMC1_DAT3>; 561 + slew-rate = <0>; 581 562 bias-pull-up; 582 563 }; 583 564 ··· 587 566 <PIN_PB28__SDMMC1_RSTN>, 588 567 <PIN_PC5__SDMMC1_1V8SEL>, 589 568 <PIN_PC4__SDMMC1_CD>; 569 + slew-rate = <0>; 590 570 bias-pull-up; 591 571 }; 592 572 }; ··· 599 577 <PIN_PD6__SDMMC2_DAT1>, 600 578 <PIN_PD7__SDMMC2_DAT2>, 601 579 <PIN_PD8__SDMMC2_DAT3>; 580 + slew-rate = <0>; 602 581 bias-pull-up; 603 582 }; 604 583 605 584 ck { 606 585 pinmux = <PIN_PD4__SDMMC2_CK>; 586 + slew-rate = <0>; 607 587 bias-pull-up; 608 588 }; 609 589 }; ··· 656 632 sdhci-caps-mask = <0x0 0x00200000>; 657 633 pinctrl-names = "default"; 658 634 pinctrl-0 = <&pinctrl_sdmmc2_default>; 635 + }; 636 + 637 + &shdwc { 638 + atmel,shdwc-debouncer = <976>; 639 + status = "okay"; 640 + 641 + input@0 { 642 + reg = <0>; 643 + }; 659 644 }; 660 645 661 646 &spdifrx {
+2 -2
arch/arm/boot/dts/imx53-m53menlo.dts
··· 56 56 panel { 57 57 compatible = "edt,etm0700g0dh6"; 58 58 pinctrl-0 = <&pinctrl_display_gpio>; 59 + pinctrl-names = "default"; 59 60 enable-gpios = <&gpio6 0 GPIO_ACTIVE_HIGH>; 60 61 61 62 port { ··· 77 76 regulator-name = "vbus"; 78 77 regulator-min-microvolt = <5000000>; 79 78 regulator-max-microvolt = <5000000>; 80 - gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>; 81 - enable-active-high; 79 + gpio = <&gpio1 2 0>; 82 80 }; 83 81 }; 84 82
+5
arch/arm/boot/dts/imx6dl-yapp4-common.dtsi
··· 5 5 #include <dt-bindings/gpio/gpio.h> 6 6 #include <dt-bindings/interrupt-controller/irq.h> 7 7 #include <dt-bindings/input/input.h> 8 + #include <dt-bindings/leds/common.h> 8 9 #include <dt-bindings/pwm/pwm.h> 9 10 10 11 / { ··· 278 277 led-cur = /bits/ 8 <0x20>; 279 278 max-cur = /bits/ 8 <0x60>; 280 279 reg = <0>; 280 + color = <LED_COLOR_ID_RED>; 281 281 }; 282 282 283 283 chan@1 { ··· 286 284 led-cur = /bits/ 8 <0x20>; 287 285 max-cur = /bits/ 8 <0x60>; 288 286 reg = <1>; 287 + color = <LED_COLOR_ID_GREEN>; 289 288 }; 290 289 291 290 chan@2 { ··· 294 291 led-cur = /bits/ 8 <0x20>; 295 292 max-cur = /bits/ 8 <0x60>; 296 293 reg = <2>; 294 + color = <LED_COLOR_ID_BLUE>; 297 295 }; 298 296 299 297 chan@3 { ··· 302 298 led-cur = /bits/ 8 <0x0>; 303 299 max-cur = /bits/ 8 <0x0>; 304 300 reg = <3>; 301 + color = <LED_COLOR_ID_WHITE>; 305 302 }; 306 303 }; 307 304
+11
arch/arm/boot/dts/imx6qdl-pico.dtsi
··· 176 176 pinctrl-0 = <&pinctrl_enet>; 177 177 phy-mode = "rgmii-id"; 178 178 phy-reset-gpios = <&gpio1 26 GPIO_ACTIVE_LOW>; 179 + phy-handle = <&phy>; 179 180 status = "okay"; 181 + 182 + mdio { 183 + #address-cells = <1>; 184 + #size-cells = <0>; 185 + 186 + phy: ethernet-phy@1 { 187 + reg = <1>; 188 + qca,clk-out-frequency = <125000000>; 189 + }; 190 + }; 180 191 }; 181 192 182 193 &hdmi {
+2 -2
arch/arm/boot/dts/imx6sx-sdb.dts
··· 114 114 compatible = "micron,n25q256a", "jedec,spi-nor"; 115 115 spi-max-frequency = <29000000>; 116 116 spi-rx-bus-width = <4>; 117 - spi-tx-bus-width = <4>; 117 + spi-tx-bus-width = <1>; 118 118 reg = <0>; 119 119 }; 120 120 ··· 124 124 compatible = "micron,n25q256a", "jedec,spi-nor"; 125 125 spi-max-frequency = <29000000>; 126 126 spi-rx-bus-width = <4>; 127 - spi-tx-bus-width = <4>; 127 + spi-tx-bus-width = <1>; 128 128 reg = <2>; 129 129 }; 130 130 };
+1 -1
arch/arm/boot/dts/imx6ul-14x14-evk.dtsi
··· 292 292 compatible = "micron,n25q256a", "jedec,spi-nor"; 293 293 spi-max-frequency = <29000000>; 294 294 spi-rx-bus-width = <4>; 295 - spi-tx-bus-width = <4>; 295 + spi-tx-bus-width = <1>; 296 296 reg = <0>; 297 297 }; 298 298 };
+1 -1
arch/arm/boot/dts/omap3430-sdp.dts
··· 101 101 102 102 nand@1,0 { 103 103 compatible = "ti,omap2-nand"; 104 - reg = <0 0 4>; /* CS0, offset 0, IO size 4 */ 104 + reg = <1 0 4>; /* CS1, offset 0, IO size 4 */ 105 105 interrupt-parent = <&gpmc>; 106 106 interrupts = <0 IRQ_TYPE_NONE>, /* fifoevent */ 107 107 <1 IRQ_TYPE_NONE>; /* termcount */
+7 -8
arch/arm/boot/dts/qcom-apq8064.dtsi
··· 198 198 clock-frequency = <19200000>; 199 199 }; 200 200 201 - pxo_board { 201 + pxo_board: pxo_board { 202 202 compatible = "fixed-clock"; 203 203 #clock-cells = <0>; 204 204 clock-frequency = <27000000>; ··· 1148 1148 }; 1149 1149 1150 1150 gpu: adreno-3xx@4300000 { 1151 - compatible = "qcom,adreno-3xx"; 1151 + compatible = "qcom,adreno-320.2", "qcom,adreno"; 1152 1152 reg = <0x04300000 0x20000>; 1153 1153 reg-names = "kgsl_3d0_reg_memory"; 1154 1154 interrupts = <GIC_SPI 80 IRQ_TYPE_LEVEL_HIGH>; 1155 1155 interrupt-names = "kgsl_3d0_irq"; 1156 1156 clock-names = 1157 - "core_clk", 1158 - "iface_clk", 1159 - "mem_clk", 1160 - "mem_iface_clk"; 1157 + "core", 1158 + "iface", 1159 + "mem", 1160 + "mem_iface"; 1161 1161 clocks = 1162 1162 <&mmcc GFX3D_CLK>, 1163 1163 <&mmcc GFX3D_AHB_CLK>, 1164 1164 <&mmcc GFX3D_AXI_CLK>, 1165 1165 <&mmcc MMSS_IMEM_AHB_CLK>; 1166 - qcom,chipid = <0x03020002>; 1167 1166 1168 1167 iommus = <&gfx3d 0 1169 1168 &gfx3d 1 ··· 1305 1306 reg-names = "dsi_pll", "dsi_phy", "dsi_phy_regulator"; 1306 1307 clock-names = "iface_clk", "ref"; 1307 1308 clocks = <&mmcc DSI_M_AHB_CLK>, 1308 - <&cxo_board>; 1309 + <&pxo_board>; 1309 1310 }; 1310 1311 1311 1312
+39
arch/arm/boot/dts/sama7g5.dtsi
··· 75 75 #size-cells = <1>; 76 76 ranges; 77 77 78 + securam: securam@e0000000 { 79 + compatible = "microchip,sama7g5-securam", "atmel,sama5d2-securam", "mmio-sram"; 80 + reg = <0xe0000000 0x4000>; 81 + clocks = <&pmc PMC_TYPE_PERIPHERAL 18>; 82 + #address-cells = <1>; 83 + #size-cells = <1>; 84 + ranges = <0 0xe0000000 0x4000>; 85 + no-memory-wc; 86 + status = "okay"; 87 + }; 88 + 78 89 secumod: secumod@e0004000 { 79 90 compatible = "microchip,sama7g5-secumod", "atmel,sama5d2-secumod", "syscon"; 80 91 reg = <0xe0004000 0x4000>; ··· 122 111 clock-names = "td_slck", "md_slck", "main_xtal"; 123 112 }; 124 113 114 + shdwc: shdwc@e001d010 { 115 + compatible = "microchip,sama7g5-shdwc", "syscon"; 116 + reg = <0xe001d010 0x10>; 117 + clocks = <&clk32k 0>; 118 + #address-cells = <1>; 119 + #size-cells = <0>; 120 + atmel,wakeup-rtc-timer; 121 + atmel,wakeup-rtt-timer; 122 + status = "disabled"; 123 + }; 124 + 125 125 rtt: rtt@e001d020 { 126 126 compatible = "microchip,sama7g5-rtt", "microchip,sam9x60-rtt", "atmel,at91sam9260-rtt"; 127 127 reg = <0xe001d020 0x30>; ··· 157 135 reg = <0xe001d180 0x24>; 158 136 interrupts = <GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>; 159 137 clocks = <&clk32k 0>; 138 + }; 139 + 140 + chipid@e0020000 { 141 + compatible = "microchip,sama7g5-chipid"; 142 + reg = <0xe0020000 0x8>; 160 143 }; 161 144 162 145 sdmmc0: mmc@e1204000 { ··· 540 513 dma-names = "rx", "tx"; 541 514 status = "disabled"; 542 515 }; 516 + }; 517 + 518 + uddrc: uddrc@e3800000 { 519 + compatible = "microchip,sama7g5-uddrc"; 520 + reg = <0xe3800000 0x4000>; 521 + status = "okay"; 522 + }; 523 + 524 + ddr3phy: ddr3phy@e3804000 { 525 + compatible = "microchip,sama7g5-ddr3phy"; 526 + reg = <0xe3804000 0x1000>; 527 + status = "okay"; 543 528 }; 544 529 545 530 gic: interrupt-controller@e8c11000 {
+60 -7
arch/arm/boot/dts/vexpress-v2m-rs1.dtsi
··· 17 17 * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT 18 18 * CHANGES TO vexpress-v2m.dtsi! 19 19 */ 20 + #include <dt-bindings/interrupt-controller/arm-gic.h> 20 21 21 22 / { 22 23 v2m_fixed_3v3: fixed-regulator-0 { ··· 102 101 }; 103 102 104 103 bus@8000000 { 105 - motherboard-bus { 106 - model = "V2M-P1"; 104 + compatible = "simple-bus"; 105 + #address-cells = <1>; 106 + #size-cells = <1>; 107 + 108 + #interrupt-cells = <1>; 109 + interrupt-map-mask = <0 63>; 110 + interrupt-map = <0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, 111 + <0 1 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, 112 + <0 2 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>, 113 + <0 3 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, 114 + <0 4 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>, 115 + <0 5 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>, 116 + <0 6 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>, 117 + <0 7 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>, 118 + <0 8 &gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, 119 + <0 9 &gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, 120 + <0 10 &gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, 121 + <0 11 &gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>, 122 + <0 12 &gic GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>, 123 + <0 13 &gic GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>, 124 + <0 14 &gic GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>, 125 + <0 15 &gic GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>, 126 + <0 16 &gic GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>, 127 + <0 17 &gic GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>, 128 + <0 18 &gic GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>, 129 + <0 19 &gic GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>, 130 + <0 20 &gic GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>, 131 + <0 21 &gic GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>, 132 + <0 22 &gic GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>, 133 + <0 23 &gic GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>, 134 + <0 24 &gic GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>, 135 + <0 25 &gic GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>, 136 + <0 26 &gic GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>, 137 + <0 27 &gic GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>, 138 + <0 28 &gic GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>, 139 + <0 29 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>, 140 + <0 30 &gic GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>, 141 + <0 31 &gic GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>, 142 + <0 32 &gic GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>, 143 + <0 33 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>, 144 + <0 34 &gic GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>, 145 + <0 35 &gic GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>, 146 + <0 36 &gic GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>, 147 + <0 37 &gic GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>, 148 + <0 38 &gic GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>, 149 + <0 39 &gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, 150 + <0 40 &gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>, 151 + <0 41 &gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>, 152 + <0 42 &gic GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; 153 + 154 + motherboard-bus@8000000 { 107 155 arm,hbi = <0x190>; 108 156 arm,vexpress,site = <0>; 109 - arm,v2m-memory-map = "rs1"; 110 157 compatible = "arm,vexpress,v2m-p1", "simple-bus"; 111 158 #address-cells = <2>; /* SMB chipselect number and offset */ 112 159 #size-cells = <1>; 113 - #interrupt-cells = <1>; 114 - ranges; 160 + ranges = <0 0 0x08000000 0x04000000>, 161 + <1 0 0x14000000 0x04000000>, 162 + <2 0 0x18000000 0x04000000>, 163 + <3 0 0x1c000000 0x04000000>, 164 + <4 0 0x0c000000 0x04000000>, 165 + <5 0 0x10000000 0x04000000>; 115 166 116 167 nor_flash: flash@0 { 117 168 compatible = "arm,vexpress-flash", "cfi-flash"; ··· 268 215 clock-names = "apb_pclk"; 269 216 }; 270 217 271 - mmci@50000 { 218 + mmc@50000 { 272 219 compatible = "arm,pl180", "arm,primecell"; 273 220 reg = <0x050000 0x1000>; 274 221 interrupts = <9>, <10>; ··· 328 275 clock-names = "uartclk", "apb_pclk"; 329 276 }; 330 277 331 - wdt@f0000 { 278 + watchdog@f0000 { 332 279 compatible = "arm,sp805", "arm,primecell"; 333 280 reg = <0x0f0000 0x1000>; 334 281 interrupts = <0>;
+60 -5
arch/arm/boot/dts/vexpress-v2m.dtsi
··· 17 17 * TAKE CARE WHEN MAINTAINING THIS FILE TO PROPAGATE ANY RELEVANT 18 18 * CHANGES TO vexpress-v2m-rs1.dtsi! 19 19 */ 20 + #include <dt-bindings/interrupt-controller/arm-gic.h> 20 21 21 22 / { 22 - bus@4000000 { 23 - motherboard { 24 - model = "V2M-P1"; 23 + bus@40000000 { 24 + compatible = "simple-bus"; 25 + #address-cells = <1>; 26 + #size-cells = <1>; 27 + ranges = <0x40000000 0x40000000 0x10000000>, 28 + <0x10000000 0x10000000 0x00020000>; 29 + 30 + #interrupt-cells = <1>; 31 + interrupt-map-mask = <0 63>; 32 + interrupt-map = <0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, 33 + <0 1 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, 34 + <0 2 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>, 35 + <0 3 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, 36 + <0 4 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>, 37 + <0 5 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>, 38 + <0 6 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>, 39 + <0 7 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>, 40 + <0 8 &gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, 41 + <0 9 &gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, 42 + <0 10 &gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, 43 + <0 11 &gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>, 44 + <0 12 &gic GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>, 45 + <0 13 &gic GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>, 46 + <0 14 &gic GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>, 47 + <0 15 &gic GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>, 48 + <0 16 &gic GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>, 49 + <0 17 &gic GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>, 50 + <0 18 &gic GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>, 51 + <0 19 &gic GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>, 52 + <0 20 &gic GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>, 53 + <0 21 &gic GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>, 54 + <0 22 &gic GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>, 55 + <0 23 &gic GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>, 56 + <0 24 &gic GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>, 57 + <0 25 &gic GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>, 58 + <0 26 &gic GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>, 59 + <0 27 &gic GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>, 60 + <0 28 &gic GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>, 61 + <0 29 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>, 62 + <0 30 &gic GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>, 63 + <0 31 &gic GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>, 64 + <0 32 &gic GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>, 65 + <0 33 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>, 66 + <0 34 &gic GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>, 67 + <0 35 &gic GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>, 68 + <0 36 &gic GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>, 69 + <0 37 &gic GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>, 70 + <0 38 &gic GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>, 71 + <0 39 &gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, 72 + <0 40 &gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>, 73 + <0 41 &gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>, 74 + <0 42 &gic GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; 75 + 76 + motherboard-bus@40000000 { 25 77 arm,hbi = <0x190>; 26 78 arm,vexpress,site = <0>; 27 79 compatible = "arm,vexpress,v2m-p1", "simple-bus"; 28 80 #address-cells = <2>; /* SMB chipselect number and offset */ 29 81 #size-cells = <1>; 30 - #interrupt-cells = <1>; 31 - ranges; 82 + ranges = <0 0 0x40000000 0x04000000>, 83 + <1 0 0x44000000 0x04000000>, 84 + <2 0 0x48000000 0x04000000>, 85 + <3 0 0x4c000000 0x04000000>, 86 + <7 0 0x10000000 0x00020000>; 32 87 33 88 flash@0,00000000 { 34 89 compatible = "arm,vexpress-flash", "cfi-flash";
+1 -56
arch/arm/boot/dts/vexpress-v2p-ca15-tc1.dts
··· 237 237 }; 238 238 239 239 bus@8000000 { 240 - compatible = "simple-bus"; 241 - 242 - #address-cells = <2>; 243 - #size-cells = <1>; 244 - ranges = <0 0 0 0x08000000 0x04000000>, 245 - <1 0 0 0x14000000 0x04000000>, 246 - <2 0 0 0x18000000 0x04000000>, 247 - <3 0 0 0x1c000000 0x04000000>, 248 - <4 0 0 0x0c000000 0x04000000>, 249 - <5 0 0 0x10000000 0x04000000>; 250 - 251 - #interrupt-cells = <1>; 252 - interrupt-map-mask = <0 0 63>; 253 - interrupt-map = <0 0 0 &gic 0 0 4>, 254 - <0 0 1 &gic 0 1 4>, 255 - <0 0 2 &gic 0 2 4>, 256 - <0 0 3 &gic 0 3 4>, 257 - <0 0 4 &gic 0 4 4>, 258 - <0 0 5 &gic 0 5 4>, 259 - <0 0 6 &gic 0 6 4>, 260 - <0 0 7 &gic 0 7 4>, 261 - <0 0 8 &gic 0 8 4>, 262 - <0 0 9 &gic 0 9 4>, 263 - <0 0 10 &gic 0 10 4>, 264 - <0 0 11 &gic 0 11 4>, 265 - <0 0 12 &gic 0 12 4>, 266 - <0 0 13 &gic 0 13 4>, 267 - <0 0 14 &gic 0 14 4>, 268 - <0 0 15 &gic 0 15 4>, 269 - <0 0 16 &gic 0 16 4>, 270 - <0 0 17 &gic 0 17 4>, 271 - <0 0 18 &gic 0 18 4>, 272 - <0 0 19 &gic 0 19 4>, 273 - <0 0 20 &gic 0 20 4>, 274 - <0 0 21 &gic 0 21 4>, 275 - <0 0 22 &gic 0 22 4>, 276 - <0 0 23 &gic 0 23 4>, 277 - <0 0 24 &gic 0 24 4>, 278 - <0 0 25 &gic 0 25 4>, 279 - <0 0 26 &gic 0 26 4>, 280 - <0 0 27 &gic 0 27 4>, 281 - <0 0 28 &gic 0 28 4>, 282 - <0 0 29 &gic 0 29 4>, 283 - <0 0 30 &gic 0 30 4>, 284 - <0 0 31 &gic 0 31 4>, 285 - <0 0 32 &gic 0 32 4>, 286 - <0 0 33 &gic 0 33 4>, 287 - <0 0 34 &gic 0 34 4>, 288 - <0 0 35 &gic 0 35 4>, 289 - <0 0 36 &gic 0 36 4>, 290 - <0 0 37 &gic 0 37 4>, 291 - <0 0 38 &gic 0 38 4>, 292 - <0 0 39 &gic 0 39 4>, 293 - <0 0 40 &gic 0 40 4>, 294 - <0 0 41 &gic 0 41 4>, 295 - <0 0 42 &gic 0 42 4>; 240 + ranges = <0x8000000 0 0x8000000 0x18000000>; 296 241 }; 297 242 298 243 site2: hsb@40000000 {
+1 -56
arch/arm/boot/dts/vexpress-v2p-ca15_a7.dts
··· 609 609 }; 610 610 611 611 smb: bus@8000000 { 612 - compatible = "simple-bus"; 613 - 614 - #address-cells = <2>; 615 - #size-cells = <1>; 616 - ranges = <0 0 0 0x08000000 0x04000000>, 617 - <1 0 0 0x14000000 0x04000000>, 618 - <2 0 0 0x18000000 0x04000000>, 619 - <3 0 0 0x1c000000 0x04000000>, 620 - <4 0 0 0x0c000000 0x04000000>, 621 - <5 0 0 0x10000000 0x04000000>; 622 - 623 - #interrupt-cells = <1>; 624 - interrupt-map-mask = <0 0 63>; 625 - interrupt-map = <0 0 0 &gic 0 0 4>, 626 - <0 0 1 &gic 0 1 4>, 627 - <0 0 2 &gic 0 2 4>, 628 - <0 0 3 &gic 0 3 4>, 629 - <0 0 4 &gic 0 4 4>, 630 - <0 0 5 &gic 0 5 4>, 631 - <0 0 6 &gic 0 6 4>, 632 - <0 0 7 &gic 0 7 4>, 633 - <0 0 8 &gic 0 8 4>, 634 - <0 0 9 &gic 0 9 4>, 635 - <0 0 10 &gic 0 10 4>, 636 - <0 0 11 &gic 0 11 4>, 637 - <0 0 12 &gic 0 12 4>, 638 - <0 0 13 &gic 0 13 4>, 639 - <0 0 14 &gic 0 14 4>, 640 - <0 0 15 &gic 0 15 4>, 641 - <0 0 16 &gic 0 16 4>, 642 - <0 0 17 &gic 0 17 4>, 643 - <0 0 18 &gic 0 18 4>, 644 - <0 0 19 &gic 0 19 4>, 645 - <0 0 20 &gic 0 20 4>, 646 - <0 0 21 &gic 0 21 4>, 647 - <0 0 22 &gic 0 22 4>, 648 - <0 0 23 &gic 0 23 4>, 649 - <0 0 24 &gic 0 24 4>, 650 - <0 0 25 &gic 0 25 4>, 651 - <0 0 26 &gic 0 26 4>, 652 - <0 0 27 &gic 0 27 4>, 653 - <0 0 28 &gic 0 28 4>, 654 - <0 0 29 &gic 0 29 4>, 655 - <0 0 30 &gic 0 30 4>, 656 - <0 0 31 &gic 0 31 4>, 657 - <0 0 32 &gic 0 32 4>, 658 - <0 0 33 &gic 0 33 4>, 659 - <0 0 34 &gic 0 34 4>, 660 - <0 0 35 &gic 0 35 4>, 661 - <0 0 36 &gic 0 36 4>, 662 - <0 0 37 &gic 0 37 4>, 663 - <0 0 38 &gic 0 38 4>, 664 - <0 0 39 &gic 0 39 4>, 665 - <0 0 40 &gic 0 40 4>, 666 - <0 0 41 &gic 0 41 4>, 667 - <0 0 42 &gic 0 42 4>; 612 + ranges = <0x8000000 0 0x8000000 0x18000000>; 668 613 }; 669 614 670 615 site2: hsb@40000000 {
+1 -56
arch/arm/boot/dts/vexpress-v2p-ca5s.dts
··· 207 207 }; 208 208 209 209 smb: bus@8000000 { 210 - compatible = "simple-bus"; 211 - 212 - #address-cells = <2>; 213 - #size-cells = <1>; 214 - ranges = <0 0 0x08000000 0x04000000>, 215 - <1 0 0x14000000 0x04000000>, 216 - <2 0 0x18000000 0x04000000>, 217 - <3 0 0x1c000000 0x04000000>, 218 - <4 0 0x0c000000 0x04000000>, 219 - <5 0 0x10000000 0x04000000>; 220 - 221 - #interrupt-cells = <1>; 222 - interrupt-map-mask = <0 0 63>; 223 - interrupt-map = <0 0 0 &gic 0 0 4>, 224 - <0 0 1 &gic 0 1 4>, 225 - <0 0 2 &gic 0 2 4>, 226 - <0 0 3 &gic 0 3 4>, 227 - <0 0 4 &gic 0 4 4>, 228 - <0 0 5 &gic 0 5 4>, 229 - <0 0 6 &gic 0 6 4>, 230 - <0 0 7 &gic 0 7 4>, 231 - <0 0 8 &gic 0 8 4>, 232 - <0 0 9 &gic 0 9 4>, 233 - <0 0 10 &gic 0 10 4>, 234 - <0 0 11 &gic 0 11 4>, 235 - <0 0 12 &gic 0 12 4>, 236 - <0 0 13 &gic 0 13 4>, 237 - <0 0 14 &gic 0 14 4>, 238 - <0 0 15 &gic 0 15 4>, 239 - <0 0 16 &gic 0 16 4>, 240 - <0 0 17 &gic 0 17 4>, 241 - <0 0 18 &gic 0 18 4>, 242 - <0 0 19 &gic 0 19 4>, 243 - <0 0 20 &gic 0 20 4>, 244 - <0 0 21 &gic 0 21 4>, 245 - <0 0 22 &gic 0 22 4>, 246 - <0 0 23 &gic 0 23 4>, 247 - <0 0 24 &gic 0 24 4>, 248 - <0 0 25 &gic 0 25 4>, 249 - <0 0 26 &gic 0 26 4>, 250 - <0 0 27 &gic 0 27 4>, 251 - <0 0 28 &gic 0 28 4>, 252 - <0 0 29 &gic 0 29 4>, 253 - <0 0 30 &gic 0 30 4>, 254 - <0 0 31 &gic 0 31 4>, 255 - <0 0 32 &gic 0 32 4>, 256 - <0 0 33 &gic 0 33 4>, 257 - <0 0 34 &gic 0 34 4>, 258 - <0 0 35 &gic 0 35 4>, 259 - <0 0 36 &gic 0 36 4>, 260 - <0 0 37 &gic 0 37 4>, 261 - <0 0 38 &gic 0 38 4>, 262 - <0 0 39 &gic 0 39 4>, 263 - <0 0 40 &gic 0 40 4>, 264 - <0 0 41 &gic 0 41 4>, 265 - <0 0 42 &gic 0 42 4>; 210 + ranges = <0 0x8000000 0x18000000>; 266 211 }; 267 212 268 213 site2: hsb@40000000 {
-58
arch/arm/boot/dts/vexpress-v2p-ca9.dts
··· 295 295 }; 296 296 }; 297 297 298 - smb: bus@4000000 { 299 - compatible = "simple-bus"; 300 - 301 - #address-cells = <2>; 302 - #size-cells = <1>; 303 - ranges = <0 0 0x40000000 0x04000000>, 304 - <1 0 0x44000000 0x04000000>, 305 - <2 0 0x48000000 0x04000000>, 306 - <3 0 0x4c000000 0x04000000>, 307 - <7 0 0x10000000 0x00020000>; 308 - 309 - #interrupt-cells = <1>; 310 - interrupt-map-mask = <0 0 63>; 311 - interrupt-map = <0 0 0 &gic 0 0 4>, 312 - <0 0 1 &gic 0 1 4>, 313 - <0 0 2 &gic 0 2 4>, 314 - <0 0 3 &gic 0 3 4>, 315 - <0 0 4 &gic 0 4 4>, 316 - <0 0 5 &gic 0 5 4>, 317 - <0 0 6 &gic 0 6 4>, 318 - <0 0 7 &gic 0 7 4>, 319 - <0 0 8 &gic 0 8 4>, 320 - <0 0 9 &gic 0 9 4>, 321 - <0 0 10 &gic 0 10 4>, 322 - <0 0 11 &gic 0 11 4>, 323 - <0 0 12 &gic 0 12 4>, 324 - <0 0 13 &gic 0 13 4>, 325 - <0 0 14 &gic 0 14 4>, 326 - <0 0 15 &gic 0 15 4>, 327 - <0 0 16 &gic 0 16 4>, 328 - <0 0 17 &gic 0 17 4>, 329 - <0 0 18 &gic 0 18 4>, 330 - <0 0 19 &gic 0 19 4>, 331 - <0 0 20 &gic 0 20 4>, 332 - <0 0 21 &gic 0 21 4>, 333 - <0 0 22 &gic 0 22 4>, 334 - <0 0 23 &gic 0 23 4>, 335 - <0 0 24 &gic 0 24 4>, 336 - <0 0 25 &gic 0 25 4>, 337 - <0 0 26 &gic 0 26 4>, 338 - <0 0 27 &gic 0 27 4>, 339 - <0 0 28 &gic 0 28 4>, 340 - <0 0 29 &gic 0 29 4>, 341 - <0 0 30 &gic 0 30 4>, 342 - <0 0 31 &gic 0 31 4>, 343 - <0 0 32 &gic 0 32 4>, 344 - <0 0 33 &gic 0 33 4>, 345 - <0 0 34 &gic 0 34 4>, 346 - <0 0 35 &gic 0 35 4>, 347 - <0 0 36 &gic 0 36 4>, 348 - <0 0 37 &gic 0 37 4>, 349 - <0 0 38 &gic 0 38 4>, 350 - <0 0 39 &gic 0 39 4>, 351 - <0 0 40 &gic 0 40 4>, 352 - <0 0 41 &gic 0 41 4>, 353 - <0 0 42 &gic 0 42 4>; 354 - }; 355 - 356 298 site2: hsb@e0000000 { 357 299 compatible = "simple-bus"; 358 300 #address-cells = <1>;
+3 -1
arch/arm/common/sharpsl_param.c
··· 40 40 41 41 void sharpsl_save_param(void) 42 42 { 43 - memcpy(&sharpsl_param, param_start(PARAM_BASE), sizeof(struct sharpsl_param_info)); 43 + struct sharpsl_param_info *params = param_start(PARAM_BASE); 44 + 45 + memcpy(&sharpsl_param, params, sizeof(*params)); 44 46 45 47 if (sharpsl_param.comadj_keyword != COMADJ_MAGIC) 46 48 sharpsl_param.comadj=-1;
+1
arch/arm/configs/gemini_defconfig
··· 76 76 CONFIG_DRM=y 77 77 CONFIG_DRM_PANEL_ILITEK_IL9322=y 78 78 CONFIG_DRM_TVE200=y 79 + CONFIG_FB=y 79 80 CONFIG_LOGO=y 80 81 CONFIG_USB=y 81 82 CONFIG_USB_MON=y
+1
arch/arm/configs/imx_v6_v7_defconfig
··· 292 292 CONFIG_DRM_IMX_HDMI=y 293 293 CONFIG_DRM_ETNAVIV=y 294 294 CONFIG_DRM_MXSFB=y 295 + CONFIG_FB=y 295 296 CONFIG_FB_MODE_HELPERS=y 296 297 CONFIG_LCD_CLASS_DEVICE=y 297 298 CONFIG_LCD_L4F00242T03=y
+3
arch/arm/configs/multi_v7_defconfig
··· 456 456 CONFIG_PINCTRL_PALMAS=y 457 457 CONFIG_PINCTRL_OWL=y 458 458 CONFIG_PINCTRL_S500=y 459 + CONFIG_PINCTRL_MSM=y 459 460 CONFIG_PINCTRL_APQ8064=y 460 461 CONFIG_PINCTRL_APQ8084=y 461 462 CONFIG_PINCTRL_IPQ8064=y ··· 726 725 CONFIG_DRM_LIMA=m 727 726 CONFIG_DRM_PANFROST=m 728 727 CONFIG_DRM_ASPEED_GFX=m 728 + CONFIG_FB=y 729 729 CONFIG_FB_EFI=y 730 730 CONFIG_FB_WM8505=y 731 731 CONFIG_FB_SH_MOBILE_LCDC=y ··· 1124 1122 CONFIG_OMAP_USB2=y 1125 1123 CONFIG_TI_PIPE3=y 1126 1124 CONFIG_TWL4030_USB=m 1125 + CONFIG_RAS=y 1127 1126 CONFIG_NVMEM_IMX_OCOTP=y 1128 1127 CONFIG_ROCKCHIP_EFUSE=m 1129 1128 CONFIG_NVMEM_SUNXI_SID=y
+114 -16
arch/arm/mach-at91/pm.c
··· 47 47 unsigned long ddr_phy_calibration[BACKUP_DDR_PHY_CALIBRATION]; 48 48 }; 49 49 50 + /* 51 + * struct at91_pm_sfrbu_offsets: registers mapping for SFRBU 52 + * @pswbu: power switch BU control registers 53 + */ 54 + struct at91_pm_sfrbu_regs { 55 + struct { 56 + u32 key; 57 + u32 ctrl; 58 + u32 state; 59 + u32 softsw; 60 + } pswbu; 61 + }; 62 + 50 63 /** 51 64 * struct at91_soc_pm - AT91 SoC power management data structure 52 65 * @config_shdwc_ws: wakeup sources configuration function for SHDWC 53 66 * @config_pmc_ws: wakeup srouces configuration function for PMC 54 67 * @ws_ids: wakup sources of_device_id array 55 68 * @data: PM data to be used on last phase of suspend 69 + * @sfrbu_regs: SFRBU registers mapping 56 70 * @bu: backup unit mapped data (for backup mode) 57 71 * @memcs: memory chip select 58 72 */ ··· 76 62 const struct of_device_id *ws_ids; 77 63 struct at91_pm_bu *bu; 78 64 struct at91_pm_data data; 65 + struct at91_pm_sfrbu_regs sfrbu_regs; 79 66 void *memcs; 80 67 }; 81 68 ··· 371 356 return 0; 372 357 } 373 358 359 + static void at91_pm_switch_ba_to_vbat(void) 360 + { 361 + unsigned int offset = offsetof(struct at91_pm_sfrbu_regs, pswbu); 362 + unsigned int val; 363 + 364 + /* Just for safety. */ 365 + if (!soc_pm.data.sfrbu) 366 + return; 367 + 368 + val = readl(soc_pm.data.sfrbu + offset); 369 + 370 + /* Already on VBAT. */ 371 + if (!(val & soc_pm.sfrbu_regs.pswbu.state)) 372 + return; 373 + 374 + val &= ~soc_pm.sfrbu_regs.pswbu.softsw; 375 + val |= soc_pm.sfrbu_regs.pswbu.key | soc_pm.sfrbu_regs.pswbu.ctrl; 376 + writel(val, soc_pm.data.sfrbu + offset); 377 + 378 + /* Wait for update. */ 379 + val = readl(soc_pm.data.sfrbu + offset); 380 + while (val & soc_pm.sfrbu_regs.pswbu.state) 381 + val = readl(soc_pm.data.sfrbu + offset); 382 + } 383 + 374 384 static void at91_pm_suspend(suspend_state_t state) 375 385 { 376 386 if (soc_pm.data.mode == AT91_PM_BACKUP) { 387 + at91_pm_switch_ba_to_vbat(); 388 + 377 389 cpu_suspend(0, at91_suspend_finish); 378 390 379 391 /* The SRAM is lost between suspend cycles */ ··· 631 589 { /* Sentinel. */ }, 632 590 }; 633 591 634 - static __init void at91_dt_ramc(bool phy_mandatory) 592 + static __init int at91_dt_ramc(bool phy_mandatory) 635 593 { 636 594 struct device_node *np; 637 595 const struct of_device_id *of_id; 638 596 int idx = 0; 639 597 void *standby = NULL; 640 598 const struct ramc_info *ramc; 599 + int ret; 641 600 642 601 for_each_matching_node_and_match(np, ramc_ids, &of_id) { 643 602 soc_pm.data.ramc[idx] = of_iomap(np, 0); 644 - if (!soc_pm.data.ramc[idx]) 645 - panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx); 603 + if (!soc_pm.data.ramc[idx]) { 604 + pr_err("unable to map ramc[%d] cpu registers\n", idx); 605 + ret = -ENOMEM; 606 + goto unmap_ramc; 607 + } 646 608 647 609 ramc = of_id->data; 648 610 if (ramc) { ··· 658 612 idx++; 659 613 } 660 614 661 - if (!idx) 662 - panic(pr_fmt("unable to find compatible ram controller node in dtb\n")); 615 + if (!idx) { 616 + pr_err("unable to find compatible ram controller node in dtb\n"); 617 + ret = -ENODEV; 618 + goto unmap_ramc; 619 + } 663 620 664 621 /* Lookup for DDR PHY node, if any. */ 665 622 for_each_matching_node_and_match(np, ramc_phy_ids, &of_id) { 666 623 soc_pm.data.ramc_phy = of_iomap(np, 0); 667 - if (!soc_pm.data.ramc_phy) 668 - panic(pr_fmt("unable to map ramc phy cpu registers\n")); 624 + if (!soc_pm.data.ramc_phy) { 625 + pr_err("unable to map ramc phy cpu registers\n"); 626 + ret = -ENOMEM; 627 + goto unmap_ramc; 628 + } 669 629 } 670 630 671 - if (phy_mandatory && !soc_pm.data.ramc_phy) 672 - panic(pr_fmt("DDR PHY is mandatory!\n")); 631 + if (phy_mandatory && !soc_pm.data.ramc_phy) { 632 + pr_err("DDR PHY is mandatory!\n"); 633 + ret = -ENODEV; 634 + goto unmap_ramc; 635 + } 673 636 674 637 if (!standby) { 675 638 pr_warn("ramc no standby function available\n"); 676 - return; 639 + return 0; 677 640 } 678 641 679 642 at91_cpuidle_device.dev.platform_data = standby; 643 + 644 + return 0; 645 + 646 + unmap_ramc: 647 + while (idx) 648 + iounmap(soc_pm.data.ramc[--idx]); 649 + 650 + return ret; 680 651 } 681 652 682 653 static void at91rm9200_idle(void) ··· 1080 1017 1081 1018 void __init at91rm9200_pm_init(void) 1082 1019 { 1020 + int ret; 1021 + 1083 1022 if (!IS_ENABLED(CONFIG_SOC_AT91RM9200)) 1084 1023 return; 1085 1024 ··· 1093 1028 soc_pm.data.standby_mode = AT91_PM_STANDBY; 1094 1029 soc_pm.data.suspend_mode = AT91_PM_ULP0; 1095 1030 1096 - at91_dt_ramc(false); 1031 + ret = at91_dt_ramc(false); 1032 + if (ret) 1033 + return; 1097 1034 1098 1035 /* 1099 1036 * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. ··· 1113 1046 static const int iomaps[] __initconst = { 1114 1047 [AT91_PM_ULP1] = AT91_PM_IOMAP(SHDWC), 1115 1048 }; 1049 + int ret; 1116 1050 1117 1051 if (!IS_ENABLED(CONFIG_SOC_SAM9X60)) 1118 1052 return; 1119 1053 1120 1054 at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); 1121 1055 at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps)); 1122 - at91_dt_ramc(false); 1056 + ret = at91_dt_ramc(false); 1057 + if (ret) 1058 + return; 1059 + 1123 1060 at91_pm_init(NULL); 1124 1061 1125 1062 soc_pm.ws_ids = sam9x60_ws_ids; ··· 1132 1061 1133 1062 void __init at91sam9_pm_init(void) 1134 1063 { 1064 + int ret; 1065 + 1135 1066 if (!IS_ENABLED(CONFIG_SOC_AT91SAM9)) 1136 1067 return; 1137 1068 ··· 1145 1072 soc_pm.data.standby_mode = AT91_PM_STANDBY; 1146 1073 soc_pm.data.suspend_mode = AT91_PM_ULP0; 1147 1074 1148 - at91_dt_ramc(false); 1075 + ret = at91_dt_ramc(false); 1076 + if (ret) 1077 + return; 1078 + 1149 1079 at91_pm_init(at91sam9_idle); 1150 1080 } 1151 1081 ··· 1157 1081 static const int modes[] __initconst = { 1158 1082 AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP0_FAST, 1159 1083 }; 1084 + int ret; 1160 1085 1161 1086 if (!IS_ENABLED(CONFIG_SOC_SAMA5)) 1162 1087 return; 1163 1088 1164 1089 at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); 1165 - at91_dt_ramc(false); 1090 + ret = at91_dt_ramc(false); 1091 + if (ret) 1092 + return; 1093 + 1166 1094 at91_pm_init(NULL); 1167 1095 } 1168 1096 ··· 1181 1101 [AT91_PM_BACKUP] = AT91_PM_IOMAP(SHDWC) | 1182 1102 AT91_PM_IOMAP(SFRBU), 1183 1103 }; 1104 + int ret; 1184 1105 1185 1106 if (!IS_ENABLED(CONFIG_SOC_SAMA5D2)) 1186 1107 return; 1187 1108 1188 1109 at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); 1189 1110 at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps)); 1190 - at91_dt_ramc(false); 1111 + ret = at91_dt_ramc(false); 1112 + if (ret) 1113 + return; 1114 + 1191 1115 at91_pm_init(NULL); 1192 1116 1193 1117 soc_pm.ws_ids = sama5d2_ws_ids; 1194 1118 soc_pm.config_shdwc_ws = at91_sama5d2_config_shdwc_ws; 1195 1119 soc_pm.config_pmc_ws = at91_sama5d2_config_pmc_ws; 1120 + 1121 + soc_pm.sfrbu_regs.pswbu.key = (0x4BD20C << 8); 1122 + soc_pm.sfrbu_regs.pswbu.ctrl = BIT(0); 1123 + soc_pm.sfrbu_regs.pswbu.softsw = BIT(1); 1124 + soc_pm.sfrbu_regs.pswbu.state = BIT(3); 1196 1125 } 1197 1126 1198 1127 void __init sama7_pm_init(void) ··· 1216 1127 [AT91_PM_BACKUP] = AT91_PM_IOMAP(SFRBU) | 1217 1128 AT91_PM_IOMAP(SHDWC), 1218 1129 }; 1130 + int ret; 1219 1131 1220 1132 if (!IS_ENABLED(CONFIG_SOC_SAMA7)) 1221 1133 return; 1222 1134 1223 1135 at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); 1224 1136 1225 - at91_dt_ramc(true); 1137 + ret = at91_dt_ramc(true); 1138 + if (ret) 1139 + return; 1140 + 1226 1141 at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps)); 1227 1142 at91_pm_init(NULL); 1228 1143 1229 1144 soc_pm.ws_ids = sama7g5_ws_ids; 1230 1145 soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws; 1146 + 1147 + soc_pm.sfrbu_regs.pswbu.key = (0x4BD20C << 8); 1148 + soc_pm.sfrbu_regs.pswbu.ctrl = BIT(0); 1149 + soc_pm.sfrbu_regs.pswbu.softsw = BIT(1); 1150 + soc_pm.sfrbu_regs.pswbu.state = BIT(2); 1231 1151 } 1232 1152 1233 1153 static int __init at91_pm_modes_select(char *str)
+37 -13
arch/arm/mach-at91/pm_suspend.S
··· 1014 1014 mov tmp1, #0 1015 1015 mcr p15, 0, tmp1, c7, c10, 4 1016 1016 1017 - ldr tmp1, [r0, #PM_DATA_PMC] 1018 - str tmp1, .pmc_base 1019 - ldr tmp1, [r0, #PM_DATA_RAMC0] 1020 - str tmp1, .sramc_base 1021 - ldr tmp1, [r0, #PM_DATA_RAMC1] 1022 - str tmp1, .sramc1_base 1023 - ldr tmp1, [r0, #PM_DATA_RAMC_PHY] 1024 - str tmp1, .sramc_phy_base 1025 - ldr tmp1, [r0, #PM_DATA_MEMCTRL] 1026 - str tmp1, .memtype 1027 - ldr tmp1, [r0, #PM_DATA_MODE] 1028 - str tmp1, .pm_mode 1017 + /* Flush tlb. */ 1018 + mov r4, #0 1019 + mcr p15, 0, r4, c8, c7, 0 1020 + 1029 1021 ldr tmp1, [r0, #PM_DATA_PMC_MCKR_OFFSET] 1030 1022 str tmp1, .mckr_offset 1031 1023 ldr tmp1, [r0, #PM_DATA_PMC_VERSION] 1032 1024 str tmp1, .pmc_version 1033 - /* Both ldrne below are here to preload their address in the TLB */ 1025 + ldr tmp1, [r0, #PM_DATA_MEMCTRL] 1026 + str tmp1, .memtype 1027 + ldr tmp1, [r0, #PM_DATA_MODE] 1028 + str tmp1, .pm_mode 1029 + 1030 + /* 1031 + * ldrne below are here to preload their address in the TLB as access 1032 + * to RAM may be limited while in self-refresh. 1033 + */ 1034 + ldr tmp1, [r0, #PM_DATA_PMC] 1035 + str tmp1, .pmc_base 1036 + cmp tmp1, #0 1037 + ldrne tmp2, [tmp1, #0] 1038 + 1039 + ldr tmp1, [r0, #PM_DATA_RAMC0] 1040 + str tmp1, .sramc_base 1041 + cmp tmp1, #0 1042 + ldrne tmp2, [tmp1, #0] 1043 + 1044 + ldr tmp1, [r0, #PM_DATA_RAMC1] 1045 + str tmp1, .sramc1_base 1046 + cmp tmp1, #0 1047 + ldrne tmp2, [tmp1, #0] 1048 + 1049 + #ifndef CONFIG_SOC_SAM_V4_V5 1050 + /* ldrne below are here to preload their address in the TLB */ 1051 + ldr tmp1, [r0, #PM_DATA_RAMC_PHY] 1052 + str tmp1, .sramc_phy_base 1053 + cmp tmp1, #0 1054 + ldrne tmp2, [tmp1, #0] 1055 + 1034 1056 ldr tmp1, [r0, #PM_DATA_SHDWC] 1035 1057 str tmp1, .shdwc 1036 1058 cmp tmp1, #0 1037 1059 ldrne tmp2, [tmp1, #0] 1060 + 1038 1061 ldr tmp1, [r0, #PM_DATA_SFRBU] 1039 1062 str tmp1, .sfrbu 1040 1063 cmp tmp1, #0 1041 1064 ldrne tmp2, [tmp1, #0x10] 1065 + #endif 1042 1066 1043 1067 /* Active the self-refresh mode */ 1044 1068 at91_sramc_self_refresh_ena
+2 -2
arch/arm/mach-dove/include/mach/uncompress.h
··· 11 11 12 12 #define LSR_THRE 0x20 13 13 14 - static void putc(const char c) 14 + static inline void putc(const char c) 15 15 { 16 16 int i; 17 17 ··· 24 24 *UART_THR = c; 25 25 } 26 26 27 - static void flush(void) 27 + static inline void flush(void) 28 28 { 29 29 } 30 30
+3
arch/arm/mach-imx/mach-imx6q.c
··· 172 172 imx_get_soc_revision()); 173 173 174 174 imx6q_enet_phy_init(); 175 + 176 + of_platform_default_populate(NULL, NULL, NULL); 177 + 175 178 imx_anatop_init(); 176 179 cpu_is_imx6q() ? imx6q_pm_init() : imx6dl_pm_init(); 177 180 imx6q_1588_init();
+2
arch/arm/mach-imx/pm-imx6.c
··· 10 10 #include <linux/io.h> 11 11 #include <linux/irq.h> 12 12 #include <linux/genalloc.h> 13 + #include <linux/irqchip/arm-gic.h> 13 14 #include <linux/mfd/syscon.h> 14 15 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h> 15 16 #include <linux/of.h> ··· 620 619 621 620 static void imx6_pm_stby_poweroff(void) 622 621 { 622 + gic_cpu_if_down(0); 623 623 imx6_set_lpm(STOP_POWER_OFF); 624 624 imx6q_suspend_finish(0); 625 625
-12
arch/arm/mach-omap1/include/mach/memory.h
··· 9 9 /* REVISIT: omap1 legacy drivers still rely on this */ 10 10 #include <mach/soc.h> 11 11 12 - /* 13 - * Bus address is physical address, except for OMAP-1510 Local Bus. 14 - * OMAP-1510 bus address is translated into a Local Bus address if the 15 - * OMAP bus type is lbus. We do the address translation based on the 16 - * device overriding the defaults used in the dma-mapping API. 17 - */ 18 - 19 - /* 20 - * OMAP-1510 Local Bus address offset 21 - */ 22 - #define OMAP1510_LB_OFFSET UL(0x30000000) 23 - 24 12 #endif
+82 -34
arch/arm/mach-omap1/usb.c
··· 11 11 #include <linux/platform_device.h> 12 12 #include <linux/dma-map-ops.h> 13 13 #include <linux/io.h> 14 + #include <linux/delay.h> 14 15 15 16 #include <asm/irq.h> 16 17 ··· 207 206 208 207 #endif 209 208 210 - #if IS_ENABLED(CONFIG_USB_OHCI_HCD) 211 - 212 209 /* The dmamask must be set for OHCI to work */ 213 210 static u64 ohci_dmamask = ~(u32)0; 214 211 ··· 235 236 236 237 static inline void ohci_device_init(struct omap_usb_config *pdata) 237 238 { 239 + if (!IS_ENABLED(CONFIG_USB_OHCI_HCD)) 240 + return; 241 + 238 242 if (cpu_is_omap7xx()) 239 243 ohci_resources[1].start = INT_7XX_USB_HHC_1; 240 244 pdata->ohci_device = &ohci_device; 241 245 pdata->ocpi_enable = &ocpi_enable; 242 246 } 243 - 244 - #else 245 - 246 - static inline void ohci_device_init(struct omap_usb_config *pdata) 247 - { 248 - } 249 - 250 - #endif 251 247 252 248 #if defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG) 253 249 ··· 528 534 } 529 535 530 536 #ifdef CONFIG_ARCH_OMAP15XX 537 + /* OMAP-1510 OHCI has its own MMU for DMA */ 538 + #define OMAP1510_LB_MEMSIZE 32 /* Should be same as SDRAM size */ 539 + #define OMAP1510_LB_CLOCK_DIV 0xfffec10c 540 + #define OMAP1510_LB_MMU_CTL 0xfffec208 541 + #define OMAP1510_LB_MMU_LCK 0xfffec224 542 + #define OMAP1510_LB_MMU_LD_TLB 0xfffec228 543 + #define OMAP1510_LB_MMU_CAM_H 0xfffec22c 544 + #define OMAP1510_LB_MMU_CAM_L 0xfffec230 545 + #define OMAP1510_LB_MMU_RAM_H 0xfffec234 546 + #define OMAP1510_LB_MMU_RAM_L 0xfffec238 547 + 548 + /* 549 + * Bus address is physical address, except for OMAP-1510 Local Bus. 550 + * OMAP-1510 bus address is translated into a Local Bus address if the 551 + * OMAP bus type is lbus. 552 + */ 553 + #define OMAP1510_LB_OFFSET UL(0x30000000) 554 + 555 + /* 556 + * OMAP-1510 specific Local Bus clock on/off 557 + */ 558 + static int omap_1510_local_bus_power(int on) 559 + { 560 + if (on) { 561 + omap_writel((1 << 1) | (1 << 0), OMAP1510_LB_MMU_CTL); 562 + udelay(200); 563 + } else { 564 + omap_writel(0, OMAP1510_LB_MMU_CTL); 565 + } 566 + 567 + return 0; 568 + } 569 + 570 + /* 571 + * OMAP-1510 specific Local Bus initialization 572 + * NOTE: This assumes 32MB memory size in OMAP1510LB_MEMSIZE. 573 + * See also arch/mach-omap/memory.h for __virt_to_dma() and 574 + * __dma_to_virt() which need to match with the physical 575 + * Local Bus address below. 576 + */ 577 + static int omap_1510_local_bus_init(void) 578 + { 579 + unsigned int tlb; 580 + unsigned long lbaddr, physaddr; 581 + 582 + omap_writel((omap_readl(OMAP1510_LB_CLOCK_DIV) & 0xfffffff8) | 0x4, 583 + OMAP1510_LB_CLOCK_DIV); 584 + 585 + /* Configure the Local Bus MMU table */ 586 + for (tlb = 0; tlb < OMAP1510_LB_MEMSIZE; tlb++) { 587 + lbaddr = tlb * 0x00100000 + OMAP1510_LB_OFFSET; 588 + physaddr = tlb * 0x00100000 + PHYS_OFFSET; 589 + omap_writel((lbaddr & 0x0fffffff) >> 22, OMAP1510_LB_MMU_CAM_H); 590 + omap_writel(((lbaddr & 0x003ffc00) >> 6) | 0xc, 591 + OMAP1510_LB_MMU_CAM_L); 592 + omap_writel(physaddr >> 16, OMAP1510_LB_MMU_RAM_H); 593 + omap_writel((physaddr & 0x0000fc00) | 0x300, OMAP1510_LB_MMU_RAM_L); 594 + omap_writel(tlb << 4, OMAP1510_LB_MMU_LCK); 595 + omap_writel(0x1, OMAP1510_LB_MMU_LD_TLB); 596 + } 597 + 598 + /* Enable the walking table */ 599 + omap_writel(omap_readl(OMAP1510_LB_MMU_CTL) | (1 << 3), OMAP1510_LB_MMU_CTL); 600 + udelay(200); 601 + 602 + return 0; 603 + } 604 + 605 + static void omap_1510_local_bus_reset(void) 606 + { 607 + omap_1510_local_bus_power(1); 608 + omap_1510_local_bus_init(); 609 + } 531 610 532 611 /* ULPD_DPLL_CTRL */ 533 612 #define DPLL_IOB (1 << 13) ··· 609 542 610 543 /* ULPD_APLL_CTRL */ 611 544 #define APLL_NDPLL_SWITCH (1 << 0) 612 - 613 - static int omap_1510_usb_ohci_notifier(struct notifier_block *nb, 614 - unsigned long event, void *data) 615 - { 616 - struct device *dev = data; 617 - 618 - if (event != BUS_NOTIFY_ADD_DEVICE) 619 - return NOTIFY_DONE; 620 - 621 - if (strncmp(dev_name(dev), "ohci", 4) == 0 && 622 - dma_direct_set_offset(dev, PHYS_OFFSET, OMAP1510_LB_OFFSET, 623 - (u64)-1)) 624 - WARN_ONCE(1, "failed to set DMA offset\n"); 625 - return NOTIFY_OK; 626 - } 627 - 628 - static struct notifier_block omap_1510_usb_ohci_nb = { 629 - .notifier_call = omap_1510_usb_ohci_notifier, 630 - }; 631 545 632 546 static void __init omap_1510_usb_init(struct omap_usb_config *config) 633 547 { ··· 664 616 } 665 617 #endif 666 618 667 - #if IS_ENABLED(CONFIG_USB_OHCI_HCD) 668 - if (config->register_host) { 619 + if (IS_ENABLED(CONFIG_USB_OHCI_HCD) && config->register_host) { 669 620 int status; 670 621 671 - bus_register_notifier(&platform_bus_type, 672 - &omap_1510_usb_ohci_nb); 673 622 ohci_device.dev.platform_data = config; 623 + dma_direct_set_offset(&ohci_device.dev, PHYS_OFFSET, 624 + OMAP1510_LB_OFFSET, (u64)-1); 674 625 status = platform_device_register(&ohci_device); 675 626 if (status) 676 627 pr_debug("can't register OHCI device, %d\n", status); 677 628 /* hcd explicitly gates 48MHz */ 629 + 630 + config->lb_reset = omap_1510_local_bus_reset; 678 631 } 679 - #endif 680 632 } 681 633 682 634 #else
+2
arch/arm/mach-omap2/omap_hwmod.c
··· 3614 3614 oh->flags |= HWMOD_SWSUP_SIDLE_ACT; 3615 3615 if (data->cfg->quirks & SYSC_QUIRK_SWSUP_MSTANDBY) 3616 3616 oh->flags |= HWMOD_SWSUP_MSTANDBY; 3617 + if (data->cfg->quirks & SYSC_QUIRK_CLKDM_NOAUTO) 3618 + oh->flags |= HWMOD_CLKDM_NOAUTO; 3617 3619 3618 3620 error = omap_hwmod_check_module(dev, oh, data, sysc_fields, 3619 3621 rev_offs, sysc_offs, syss_offs,
+19
arch/arm/net/bpf_jit_32.c
··· 36 36 * +-----+ 37 37 * |RSVD | JIT scratchpad 38 38 * current ARM_SP => +-----+ <= (BPF_FP - STACK_SIZE + SCRATCH_SIZE) 39 + * | ... | caller-saved registers 40 + * +-----+ 41 + * | ... | arguments passed on stack 42 + * ARM_SP during call => +-----| 39 43 * | | 40 44 * | ... | Function call stack 41 45 * | | ··· 67 63 * 68 64 * When popping registers off the stack at the end of a BPF function, we 69 65 * reference them via the current ARM_FP register. 66 + * 67 + * Some eBPF operations are implemented via a call to a helper function. 68 + * Such calls are "invisible" in the eBPF code, so it is up to the calling 69 + * program to preserve any caller-saved ARM registers during the call. The 70 + * JIT emits code to push and pop those registers onto the stack, immediately 71 + * above the callee stack frame. 70 72 */ 71 73 #define CALLEE_MASK (1 << ARM_R4 | 1 << ARM_R5 | 1 << ARM_R6 | \ 72 74 1 << ARM_R7 | 1 << ARM_R8 | 1 << ARM_R9 | \ 73 75 1 << ARM_FP) 74 76 #define CALLEE_PUSH_MASK (CALLEE_MASK | 1 << ARM_LR) 75 77 #define CALLEE_POP_MASK (CALLEE_MASK | 1 << ARM_PC) 78 + 79 + #define CALLER_MASK (1 << ARM_R0 | 1 << ARM_R1 | 1 << ARM_R2 | 1 << ARM_R3) 76 80 77 81 enum { 78 82 /* Stack layout - these are offsets from (top of stack - 4) */ ··· 476 464 477 465 static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op) 478 466 { 467 + const int exclude_mask = BIT(ARM_R0) | BIT(ARM_R1); 479 468 const s8 *tmp = bpf2a32[TMP_REG_1]; 480 469 481 470 #if __LINUX_ARM_ARCH__ == 7 ··· 508 495 emit(ARM_MOV_R(ARM_R0, rm), ctx); 509 496 } 510 497 498 + /* Push caller-saved registers on stack */ 499 + emit(ARM_PUSH(CALLER_MASK & ~exclude_mask), ctx); 500 + 511 501 /* Call appropriate function */ 512 502 emit_mov_i(ARM_IP, op == BPF_DIV ? 513 503 (u32)jit_udiv32 : (u32)jit_mod32, ctx); 514 504 emit_blx_r(ARM_IP, ctx); 505 + 506 + /* Restore caller-saved registers from stack */ 507 + emit(ARM_POP(CALLER_MASK & ~exclude_mask), ctx); 515 508 516 509 /* Save return value */ 517 510 if (rd != ARM_R0)
-1
arch/arm64/boot/dts/arm/foundation-v8.dtsi
··· 115 115 116 116 bus@8000000 { 117 117 compatible = "arm,vexpress,v2m-p1", "simple-bus"; 118 - arm,v2m-memory-map = "rs1"; 119 118 #address-cells = <2>; /* SMB chipselect number and offset */ 120 119 #size-cells = <1>; 121 120
-23
arch/arm64/boot/dts/arm/fvp-base-revc.dts
··· 192 192 remote-endpoint = <&clcd_pads>; 193 193 }; 194 194 }; 195 - 196 - panel-timing { 197 - clock-frequency = <63500127>; 198 - hactive = <1024>; 199 - hback-porch = <152>; 200 - hfront-porch = <48>; 201 - hsync-len = <104>; 202 - vactive = <768>; 203 - vback-porch = <23>; 204 - vfront-porch = <3>; 205 - vsync-len = <4>; 206 - }; 207 195 }; 208 196 209 197 bus@8000000 { 210 - compatible = "simple-bus"; 211 - 212 - #address-cells = <2>; 213 - #size-cells = <1>; 214 - ranges = <0 0 0 0x08000000 0x04000000>, 215 - <1 0 0 0x14000000 0x04000000>, 216 - <2 0 0 0x18000000 0x04000000>, 217 - <3 0 0 0x1c000000 0x04000000>, 218 - <4 0 0 0x0c000000 0x04000000>, 219 - <5 0 0 0x10000000 0x04000000>; 220 - 221 198 #interrupt-cells = <1>; 222 199 interrupt-map-mask = <0 0 63>; 223 200 interrupt-map = <0 0 0 &gic 0 0 GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
-12
arch/arm64/boot/dts/arm/juno-base.dtsi
··· 27 27 reg = <0x0 0x2b1f0000 0x0 0x1000>; 28 28 interrupts = <GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>, 29 29 <GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>; 30 - interrupt-names = "mhu_lpri_rx", 31 - "mhu_hpri_rx"; 32 30 #mbox-cells = <1>; 33 31 clocks = <&soc_refclk100mhz>; 34 32 clock-names = "apb_pclk"; ··· 802 804 }; 803 805 804 806 bus@8000000 { 805 - compatible = "simple-bus"; 806 - #address-cells = <2>; 807 - #size-cells = <1>; 808 - ranges = <0 0 0 0x08000000 0x04000000>, 809 - <1 0 0 0x14000000 0x04000000>, 810 - <2 0 0 0x18000000 0x04000000>, 811 - <3 0 0 0x1c000000 0x04000000>, 812 - <4 0 0 0x0c000000 0x04000000>, 813 - <5 0 0 0x10000000 0x04000000>; 814 - 815 807 #interrupt-cells = <1>; 816 808 interrupt-map-mask = <0 0 15>; 817 809 interrupt-map = <0 0 0 &gic 0 GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>,
+14 -7
arch/arm64/boot/dts/arm/juno-motherboard.dtsi
··· 92 92 }; 93 93 94 94 bus@8000000 { 95 - motherboard-bus { 95 + compatible = "simple-bus"; 96 + #address-cells = <2>; 97 + #size-cells = <1>; 98 + ranges = <0 0x8000000 0 0x8000000 0x18000000>; 99 + 100 + motherboard-bus@8000000 { 96 101 compatible = "arm,vexpress,v2p-p1", "simple-bus"; 97 102 #address-cells = <2>; /* SMB chipselect number and offset */ 98 103 #size-cells = <1>; 99 - #interrupt-cells = <1>; 100 - ranges; 101 - model = "V2M-Juno"; 104 + ranges = <0 0 0 0x08000000 0x04000000>, 105 + <1 0 0 0x14000000 0x04000000>, 106 + <2 0 0 0x18000000 0x04000000>, 107 + <3 0 0 0x1c000000 0x04000000>, 108 + <4 0 0 0x0c000000 0x04000000>, 109 + <5 0 0 0x10000000 0x04000000>; 102 110 arm,hbi = <0x252>; 103 111 arm,vexpress,site = <0>; 104 - arm,v2m-memory-map = "rs1"; 105 112 106 113 flash@0 { 107 114 /* 2 * 32MiB NOR Flash memory mounted on CS0 */ ··· 225 218 }; 226 219 }; 227 220 228 - mmci@50000 { 221 + mmc@50000 { 229 222 compatible = "arm,pl180", "arm,primecell"; 230 223 reg = <0x050000 0x1000>; 231 224 interrupts = <5>; ··· 253 246 clock-names = "KMIREFCLK", "apb_pclk"; 254 247 }; 255 248 256 - wdt@f0000 { 249 + watchdog@f0000 { 257 250 compatible = "arm,sp805", "arm,primecell"; 258 251 reg = <0x0f0000 0x10000>; 259 252 interrupts = <7>;
-11
arch/arm64/boot/dts/arm/rtsm_ve-aemv8a.dts
··· 133 133 }; 134 134 135 135 bus@8000000 { 136 - compatible = "simple-bus"; 137 - 138 - #address-cells = <2>; 139 - #size-cells = <1>; 140 - ranges = <0 0 0 0x08000000 0x04000000>, 141 - <1 0 0 0x14000000 0x04000000>, 142 - <2 0 0 0x18000000 0x04000000>, 143 - <3 0 0 0x1c000000 0x04000000>, 144 - <4 0 0 0x0c000000 0x04000000>, 145 - <5 0 0 0x10000000 0x04000000>; 146 - 147 136 #interrupt-cells = <1>; 148 137 interrupt-map-mask = <0 0 63>; 149 138 interrupt-map = <0 0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>,
+1 -1
arch/arm64/boot/dts/arm/rtsm_ve-motherboard-rs2.dtsi
··· 6 6 */ 7 7 / { 8 8 bus@8000000 { 9 - motherboard-bus { 9 + motherboard-bus@8000000 { 10 10 arm,v2m-memory-map = "rs2"; 11 11 12 12 iofpga-bus@300000000 {
+14 -6
arch/arm64/boot/dts/arm/rtsm_ve-motherboard.dtsi
··· 77 77 }; 78 78 79 79 bus@8000000 { 80 - motherboard-bus { 81 - arm,v2m-memory-map = "rs1"; 80 + compatible = "simple-bus"; 81 + #address-cells = <2>; 82 + #size-cells = <1>; 83 + ranges = <0 0x8000000 0 0x8000000 0x18000000>; 84 + 85 + motherboard-bus@8000000 { 82 86 compatible = "arm,vexpress,v2m-p1", "simple-bus"; 83 87 #address-cells = <2>; /* SMB chipselect number and offset */ 84 88 #size-cells = <1>; 85 - #interrupt-cells = <1>; 86 - ranges; 89 + ranges = <0 0 0 0x08000000 0x04000000>, 90 + <1 0 0 0x14000000 0x04000000>, 91 + <2 0 0 0x18000000 0x04000000>, 92 + <3 0 0 0x1c000000 0x04000000>, 93 + <4 0 0 0x0c000000 0x04000000>, 94 + <5 0 0 0x10000000 0x04000000>; 87 95 88 96 flash@0 { 89 97 compatible = "arm,vexpress-flash", "cfi-flash"; ··· 138 130 clock-names = "apb_pclk"; 139 131 }; 140 132 141 - mmci@50000 { 133 + mmc@50000 { 142 134 compatible = "arm,pl180", "arm,primecell"; 143 135 reg = <0x050000 0x1000>; 144 136 interrupts = <9>, <10>; ··· 198 190 clock-names = "uartclk", "apb_pclk"; 199 191 }; 200 192 201 - wdt@f0000 { 193 + watchdog@f0000 { 202 194 compatible = "arm,sp805", "arm,primecell"; 203 195 reg = <0x0f0000 0x1000>; 204 196 interrupts = <0>;
+1 -56
arch/arm64/boot/dts/arm/vexpress-v2f-1xv7-ca53x2.dts
··· 145 145 }; 146 146 147 147 smb: bus@8000000 { 148 - compatible = "simple-bus"; 149 - 150 - #address-cells = <2>; 151 - #size-cells = <1>; 152 - ranges = <0 0 0 0x08000000 0x04000000>, 153 - <1 0 0 0x14000000 0x04000000>, 154 - <2 0 0 0x18000000 0x04000000>, 155 - <3 0 0 0x1c000000 0x04000000>, 156 - <4 0 0 0x0c000000 0x04000000>, 157 - <5 0 0 0x10000000 0x04000000>; 158 - 159 - #interrupt-cells = <1>; 160 - interrupt-map-mask = <0 0 63>; 161 - interrupt-map = <0 0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, 162 - <0 0 1 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, 163 - <0 0 2 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>, 164 - <0 0 3 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, 165 - <0 0 4 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>, 166 - <0 0 5 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>, 167 - <0 0 6 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>, 168 - <0 0 7 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>, 169 - <0 0 8 &gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, 170 - <0 0 9 &gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, 171 - <0 0 10 &gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, 172 - <0 0 11 &gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>, 173 - <0 0 12 &gic GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>, 174 - <0 0 13 &gic GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>, 175 - <0 0 14 &gic GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>, 176 - <0 0 15 &gic GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>, 177 - <0 0 16 &gic GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>, 178 - <0 0 17 &gic GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>, 179 - <0 0 18 &gic GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>, 180 - <0 0 19 &gic GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>, 181 - <0 0 20 &gic GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>, 182 - <0 0 21 &gic GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>, 183 - <0 0 22 &gic GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>, 184 - <0 0 23 &gic GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>, 185 - <0 0 24 &gic GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>, 186 - <0 0 25 &gic GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>, 187 - <0 0 26 &gic GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>, 188 - <0 0 27 &gic GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>, 189 - <0 0 28 &gic GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>, 190 - <0 0 29 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>, 191 - <0 0 30 &gic GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>, 192 - <0 0 31 &gic GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>, 193 - <0 0 32 &gic GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>, 194 - <0 0 33 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>, 195 - <0 0 34 &gic GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>, 196 - <0 0 35 &gic GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>, 197 - <0 0 36 &gic GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>, 198 - <0 0 37 &gic GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>, 199 - <0 0 38 &gic GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>, 200 - <0 0 39 &gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, 201 - <0 0 40 &gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>, 202 - <0 0 41 &gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>, 203 - <0 0 42 &gic GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; 148 + ranges = <0x8000000 0 0x8000000 0x18000000>; 204 149 }; 205 150 };
+2 -2
arch/arm64/boot/dts/freescale/fsl-ls1028a.dtsi
··· 405 405 interrupts = <GIC_SPI 63 IRQ_TYPE_LEVEL_HIGH>; 406 406 clock-frequency = <0>; /* fixed up by bootloader */ 407 407 clocks = <&clockgen QORIQ_CLK_HWACCEL 1>; 408 - voltage-ranges = <1800 1800 3300 3300>; 408 + voltage-ranges = <1800 1800>; 409 409 sdhci,auto-cmd12; 410 - broken-cd; 410 + non-removable; 411 411 little-endian; 412 412 bus-width = <4>; 413 413 status = "disabled";
+1 -1
arch/arm64/boot/dts/freescale/imx8mm-beacon-som.dtsi
··· 91 91 #size-cells = <1>; 92 92 compatible = "jedec,spi-nor"; 93 93 spi-max-frequency = <80000000>; 94 - spi-tx-bus-width = <4>; 94 + spi-tx-bus-width = <1>; 95 95 spi-rx-bus-width = <4>; 96 96 }; 97 97 };
+1 -1
arch/arm64/boot/dts/freescale/imx8mm-evk.dts
··· 48 48 #size-cells = <1>; 49 49 compatible = "jedec,spi-nor"; 50 50 spi-max-frequency = <80000000>; 51 - spi-tx-bus-width = <4>; 51 + spi-tx-bus-width = <1>; 52 52 spi-rx-bus-width = <4>; 53 53 }; 54 54 };
+1
arch/arm64/boot/dts/freescale/imx8mm-kontron-n801x-som.dtsi
··· 102 102 regulator-min-microvolt = <850000>; 103 103 regulator-max-microvolt = <950000>; 104 104 regulator-boot-on; 105 + regulator-always-on; 105 106 regulator-ramp-delay = <3125>; 106 107 nxp,dvs-run-voltage = <950000>; 107 108 nxp,dvs-standby-voltage = <850000>;
+1 -1
arch/arm64/boot/dts/freescale/imx8mm-venice-gw7902.dts
··· 647 647 pinctrl_hog: hoggrp { 648 648 fsl,pins = < 649 649 MX8MM_IOMUXC_NAND_CE0_B_GPIO3_IO1 0x40000159 /* M2_GDIS# */ 650 - MX8MM_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x40000041 /* M2_RST# */ 650 + MX8MM_IOMUXC_GPIO1_IO13_GPIO1_IO13 0x40000041 /* M2_RST# */ 651 651 MX8MM_IOMUXC_NAND_DATA01_GPIO3_IO7 0x40000119 /* M2_OFF# */ 652 652 MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x40000159 /* M2_WDIS# */ 653 653 MX8MM_IOMUXC_SAI1_TXD2_GPIO4_IO14 0x40000041 /* AMP GPIO1 */
+1 -1
arch/arm64/boot/dts/freescale/imx8mn-beacon-som.dtsi
··· 101 101 #size-cells = <1>; 102 102 compatible = "jedec,spi-nor"; 103 103 spi-max-frequency = <80000000>; 104 - spi-tx-bus-width = <4>; 104 + spi-tx-bus-width = <1>; 105 105 spi-rx-bus-width = <4>; 106 106 }; 107 107 };
+1 -1
arch/arm64/boot/dts/freescale/imx8mn-venice-gw7902.dts
··· 633 633 pinctrl_hog: hoggrp { 634 634 fsl,pins = < 635 635 MX8MN_IOMUXC_NAND_CE0_B_GPIO3_IO1 0x40000159 /* M2_GDIS# */ 636 - MX8MN_IOMUXC_GPIO1_IO12_GPIO1_IO12 0x40000041 /* M2_RST# */ 636 + MX8MN_IOMUXC_GPIO1_IO13_GPIO1_IO13 0x40000041 /* M2_RST# */ 637 637 MX8MN_IOMUXC_NAND_DATA01_GPIO3_IO7 0x40000119 /* M2_OFF# */ 638 638 MX8MN_IOMUXC_GPIO1_IO15_GPIO1_IO15 0x40000159 /* M2_WDIS# */ 639 639 MX8MN_IOMUXC_SAI2_RXFS_GPIO4_IO21 0x40000041 /* APP GPIO1 */
+1 -1
arch/arm64/boot/dts/freescale/imx8mp-phycore-som.dtsi
··· 74 74 compatible = "jedec,spi-nor"; 75 75 reg = <0>; 76 76 spi-max-frequency = <80000000>; 77 - spi-tx-bus-width = <4>; 77 + spi-tx-bus-width = <1>; 78 78 spi-rx-bus-width = <4>; 79 79 }; 80 80 };
+2
arch/arm64/boot/dts/freescale/imx8mq-evk.dts
··· 337 337 #size-cells = <1>; 338 338 compatible = "micron,n25q256a", "jedec,spi-nor"; 339 339 spi-max-frequency = <29000000>; 340 + spi-tx-bus-width = <1>; 341 + spi-rx-bus-width = <4>; 340 342 }; 341 343 }; 342 344
+1 -1
arch/arm64/boot/dts/freescale/imx8mq-kontron-pitx-imx8m.dts
··· 281 281 #address-cells = <1>; 282 282 #size-cells = <1>; 283 283 reg = <0>; 284 - spi-tx-bus-width = <4>; 284 + spi-tx-bus-width = <1>; 285 285 spi-rx-bus-width = <4>; 286 286 m25p,fast-read; 287 287 spi-max-frequency = <50000000>;
+3 -1
arch/arm64/boot/dts/qcom/pm8150.dtsi
··· 48 48 #size-cells = <0>; 49 49 50 50 pon: power-on@800 { 51 - compatible = "qcom,pm8916-pon"; 51 + compatible = "qcom,pm8998-pon"; 52 52 reg = <0x0800>; 53 + mode-bootloader = <0x2>; 54 + mode-recovery = <0x1>; 53 55 54 56 pon_pwrkey: pwrkey { 55 57 compatible = "qcom,pm8941-pwrkey";
+10
arch/arm64/boot/dts/qcom/qrb5165-rb5.dts
··· 804 804 }; 805 805 }; 806 806 807 + &pon_pwrkey { 808 + status = "okay"; 809 + }; 810 + 811 + &pon_resin { 812 + status = "okay"; 813 + 814 + linux,code = <KEY_VOLUMEDOWN>; 815 + }; 816 + 807 817 &qupv3_id_0 { 808 818 status = "okay"; 809 819 };
+4 -5
arch/arm64/boot/dts/qcom/sc7180-trogdor.dtsi
··· 273 273 "Headphone Jack", "HPOL", 274 274 "Headphone Jack", "HPOR"; 275 275 276 - #sound-dai-cells = <0>; 277 276 #address-cells = <1>; 278 277 #size-cells = <0>; 279 278 ··· 300 301 }; 301 302 }; 302 303 303 - dai-link@2 { 304 + dai-link@5 { 304 305 link-name = "MultiMedia2"; 305 - reg = <2>; 306 + reg = <LPASS_DP_RX>; 306 307 cpu { 307 - sound-dai = <&lpass_cpu 2>; 308 + sound-dai = <&lpass_cpu LPASS_DP_RX>; 308 309 }; 309 310 310 311 codec { ··· 781 782 qcom,playback-sd-lines = <0>; 782 783 }; 783 784 784 - hdmi-primary@0 { 785 + hdmi@5 { 785 786 reg = <LPASS_DP_RX>; 786 787 }; 787 788 };
+3 -3
arch/arm64/boot/dts/qcom/sc7280.dtsi
··· 1850 1850 1851 1851 cpufreq_hw: cpufreq@18591000 { 1852 1852 compatible = "qcom,cpufreq-epss"; 1853 - reg = <0 0x18591100 0 0x900>, 1854 - <0 0x18592100 0 0x900>, 1855 - <0 0x18593100 0 0x900>; 1853 + reg = <0 0x18591000 0 0x1000>, 1854 + <0 0x18592000 0 0x1000>, 1855 + <0 0x18593000 0 0x1000>; 1856 1856 clocks = <&rpmhcc RPMH_CXO_CLK>, <&gcc GCC_GPLL0>; 1857 1857 clock-names = "xo", "alternate"; 1858 1858 #freq-domain-cells = <1>;
+13 -2
arch/arm64/boot/dts/qcom/sdm630.dtsi
··· 654 654 compatible = "qcom,sdm660-a2noc"; 655 655 reg = <0x01704000 0xc100>; 656 656 #interconnect-cells = <1>; 657 - clock-names = "bus", "bus_a"; 657 + clock-names = "bus", 658 + "bus_a", 659 + "ipa", 660 + "ufs_axi", 661 + "aggre2_ufs_axi", 662 + "aggre2_usb3_axi", 663 + "cfg_noc_usb2_axi"; 658 664 clocks = <&rpmcc RPM_SMD_AGGR2_NOC_CLK>, 659 - <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>; 665 + <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>, 666 + <&rpmcc RPM_SMD_IPA_CLK>, 667 + <&gcc GCC_UFS_AXI_CLK>, 668 + <&gcc GCC_AGGRE2_UFS_AXI_CLK>, 669 + <&gcc GCC_AGGRE2_USB3_AXI_CLK>, 670 + <&gcc GCC_CFG_NOC_USB2_AXI_CLK>; 660 671 }; 661 672 662 673 mnoc: interconnect@1745000 {
+13 -8
arch/arm64/boot/dts/qcom/sdm845.dtsi
··· 128 128 no-map; 129 129 }; 130 130 131 - wlan_msa_mem: memory@8c400000 { 132 - reg = <0 0x8c400000 0 0x100000>; 131 + ipa_fw_mem: memory@8c400000 { 132 + reg = <0 0x8c400000 0 0x10000>; 133 133 no-map; 134 134 }; 135 135 136 - gpu_mem: memory@8c515000 { 137 - reg = <0 0x8c515000 0 0x2000>; 136 + ipa_gsi_mem: memory@8c410000 { 137 + reg = <0 0x8c410000 0 0x5000>; 138 138 no-map; 139 139 }; 140 140 141 - ipa_fw_mem: memory@8c517000 { 142 - reg = <0 0x8c517000 0 0x5a000>; 141 + gpu_mem: memory@8c415000 { 142 + reg = <0 0x8c415000 0 0x2000>; 143 143 no-map; 144 144 }; 145 145 146 - adsp_mem: memory@8c600000 { 147 - reg = <0 0x8c600000 0 0x1a00000>; 146 + adsp_mem: memory@8c500000 { 147 + reg = <0 0x8c500000 0 0x1a00000>; 148 + no-map; 149 + }; 150 + 151 + wlan_msa_mem: memory@8df00000 { 152 + reg = <0 0x8df00000 0 0x100000>; 148 153 no-map; 149 154 }; 150 155
+34
arch/arm64/boot/dts/qcom/sdm850-lenovo-yoga-c630.dts
··· 16 16 #include "sdm850.dtsi" 17 17 #include "pm8998.dtsi" 18 18 19 + /* 20 + * Update following upstream (sdm845.dtsi) reserved 21 + * memory mappings for firmware loading to succeed 22 + * and enable the IPA device. 23 + */ 24 + /delete-node/ &ipa_fw_mem; 25 + /delete-node/ &ipa_gsi_mem; 26 + /delete-node/ &gpu_mem; 27 + /delete-node/ &adsp_mem; 28 + /delete-node/ &wlan_msa_mem; 29 + 19 30 / { 20 31 model = "Lenovo Yoga C630"; 21 32 compatible = "lenovo,yoga-c630", "qcom,sdm845"; ··· 66 55 remote-endpoint = <&sn65dsi86_out>; 67 56 }; 68 57 }; 58 + }; 59 + }; 60 + 61 + /* Reserved memory changes for IPA */ 62 + reserved-memory { 63 + wlan_msa_mem: memory@8c400000 { 64 + reg = <0 0x8c400000 0 0x100000>; 65 + no-map; 66 + }; 67 + 68 + gpu_mem: memory@8c515000 { 69 + reg = <0 0x8c515000 0 0x2000>; 70 + no-map; 71 + }; 72 + 73 + ipa_fw_mem: memory@8c517000 { 74 + reg = <0 0x8c517000 0 0x5a000>; 75 + no-map; 76 + }; 77 + 78 + adsp_mem: memory@8c600000 { 79 + reg = <0 0x8c600000 0 0x1a00000>; 80 + no-map; 69 81 }; 70 82 }; 71 83
+1 -22
arch/mips/include/asm/mips-cps.h
··· 10 10 #include <linux/io.h> 11 11 #include <linux/types.h> 12 12 13 - #include <asm/mips-boards/launch.h> 14 - 15 13 extern unsigned long __cps_access_bad_size(void) 16 14 __compiletime_error("Bad size for CPS accessor"); 17 15 ··· 165 167 */ 166 168 static inline unsigned int mips_cps_numcores(unsigned int cluster) 167 169 { 168 - unsigned int ncores; 169 - 170 170 if (!mips_cm_present()) 171 171 return 0; 172 172 173 173 /* Add one before masking to handle 0xff indicating no cores */ 174 - ncores = (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES; 175 - 176 - if (IS_ENABLED(CONFIG_SOC_MT7621)) { 177 - struct cpulaunch *launch; 178 - 179 - /* 180 - * Ralink MT7621S SoC is single core, but the GCR_CONFIG method 181 - * always reports 2 cores. Check the second core's LAUNCH_FREADY 182 - * flag to detect if the second core is missing. This method 183 - * only works before the core has been started. 184 - */ 185 - launch = (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH); 186 - launch += 2; /* MT7621 has 2 VPEs per core */ 187 - if (!(launch->flags & LAUNCH_FREADY)) 188 - ncores = 1; 189 - } 190 - 191 - return ncores; 174 + return (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES; 192 175 } 193 176 194 177 /**
+1 -1
arch/powerpc/boot/dts/fsl/t1023rdb.dts
··· 154 154 155 155 fm1mac3: ethernet@e4000 { 156 156 phy-handle = <&sgmii_aqr_phy3>; 157 - phy-connection-type = "sgmii-2500"; 157 + phy-connection-type = "2500base-x"; 158 158 sleep = <&rcpm 0x20000000>; 159 159 }; 160 160
+1
arch/x86/events/core.c
··· 2465 2465 if (err) { 2466 2466 if (event->destroy) 2467 2467 event->destroy(event); 2468 + event->destroy = NULL; 2468 2469 } 2469 2470 2470 2471 if (READ_ONCE(x86_pmu.attr_rdpmc) &&
+1
arch/x86/events/intel/core.c
··· 263 263 INTEL_EVENT_CONSTRAINT_RANGE(0xa8, 0xb0, 0xf), 264 264 INTEL_EVENT_CONSTRAINT_RANGE(0xb7, 0xbd, 0xf), 265 265 INTEL_EVENT_CONSTRAINT_RANGE(0xd0, 0xe6, 0xf), 266 + INTEL_EVENT_CONSTRAINT(0xef, 0xf), 266 267 INTEL_EVENT_CONSTRAINT_RANGE(0xf0, 0xf4, 0xf), 267 268 EVENT_CONSTRAINT_END 268 269 };
+15 -5
arch/x86/hyperv/hv_apic.c
··· 122 122 ipi_arg->reserved = 0; 123 123 ipi_arg->vp_set.valid_bank_mask = 0; 124 124 125 - if (!cpumask_equal(mask, cpu_present_mask)) { 125 + /* 126 + * Use HV_GENERIC_SET_ALL and avoid converting cpumask to VP_SET 127 + * when the IPI is sent to all currently present CPUs. 128 + */ 129 + if (!cpumask_equal(mask, cpu_present_mask) || exclude_self) { 126 130 ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K; 127 131 if (exclude_self) 128 132 nr_bank = cpumask_to_vpset_noself(&(ipi_arg->vp_set), mask); 129 133 else 130 134 nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask); 131 - } 132 - if (nr_bank < 0) 133 - goto ipi_mask_ex_done; 134 - if (!nr_bank) 135 + 136 + /* 137 + * 'nr_bank <= 0' means some CPUs in cpumask can't be 138 + * represented in VP_SET. Return an error and fall back to 139 + * native (architectural) method of sending IPIs. 140 + */ 141 + if (nr_bank <= 0) 142 + goto ipi_mask_ex_done; 143 + } else { 135 144 ipi_arg->vp_set.format = HV_GENERIC_SET_ALL; 145 + } 136 146 137 147 status = hv_do_rep_hypercall(HVCALL_SEND_IPI_EX, 0, nr_bank, 138 148 ipi_arg, NULL);
+14
arch/x86/include/asm/kvmclock.h
··· 2 2 #ifndef _ASM_X86_KVM_CLOCK_H 3 3 #define _ASM_X86_KVM_CLOCK_H 4 4 5 + #include <linux/percpu.h> 6 + 5 7 extern struct clocksource kvm_clock; 8 + 9 + DECLARE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu); 10 + 11 + static inline struct pvclock_vcpu_time_info *this_cpu_pvti(void) 12 + { 13 + return &this_cpu_read(hv_clock_per_cpu)->pvti; 14 + } 15 + 16 + static inline struct pvclock_vsyscall_time_info *this_cpu_hvclock(void) 17 + { 18 + return this_cpu_read(hv_clock_per_cpu); 19 + } 6 20 7 21 #endif /* _ASM_X86_KVM_CLOCK_H */
+2 -11
arch/x86/kernel/kvmclock.c
··· 49 49 static struct pvclock_vsyscall_time_info 50 50 hv_clock_boot[HVC_BOOT_ARRAY_SIZE] __bss_decrypted __aligned(PAGE_SIZE); 51 51 static struct pvclock_wall_clock wall_clock __bss_decrypted; 52 - static DEFINE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu); 53 52 static struct pvclock_vsyscall_time_info *hvclock_mem; 54 - 55 - static inline struct pvclock_vcpu_time_info *this_cpu_pvti(void) 56 - { 57 - return &this_cpu_read(hv_clock_per_cpu)->pvti; 58 - } 59 - 60 - static inline struct pvclock_vsyscall_time_info *this_cpu_hvclock(void) 61 - { 62 - return this_cpu_read(hv_clock_per_cpu); 63 - } 53 + DEFINE_PER_CPU(struct pvclock_vsyscall_time_info *, hv_clock_per_cpu); 54 + EXPORT_PER_CPU_SYMBOL_GPL(hv_clock_per_cpu); 64 55 65 56 /* 66 57 * The wallclock is the time of day when we booted. Since then, some time may
+2 -2
arch/x86/kvm/cpuid.c
··· 65 65 for (i = 0; i < nent; i++) { 66 66 e = &entries[i]; 67 67 68 - if (e->function == function && (e->index == index || 69 - !(e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX))) 68 + if (e->function == function && 69 + (!(e->flags & KVM_CPUID_FLAG_SIGNIFCANT_INDEX) || e->index == index)) 70 70 return e; 71 71 } 72 72
-1
arch/x86/kvm/emulate.c
··· 435 435 __FOP_RET(#op) 436 436 437 437 asm(".pushsection .fixup, \"ax\"\n" 438 - ".global kvm_fastop_exception \n" 439 438 "kvm_fastop_exception: xor %esi, %esi; ret\n" 440 439 ".popsection"); 441 440
+1 -1
arch/x86/kvm/vmx/vmx.c
··· 6848 6848 */ 6849 6849 tsx_ctrl = vmx_find_uret_msr(vmx, MSR_IA32_TSX_CTRL); 6850 6850 if (tsx_ctrl) 6851 - vmx->guest_uret_msrs[i].mask = ~(u64)TSX_CTRL_CPUID_CLEAR; 6851 + tsx_ctrl->mask = ~(u64)TSX_CTRL_CPUID_CLEAR; 6852 6852 } 6853 6853 6854 6854 err = alloc_loaded_vmcs(&vmx->vmcs01);
+3 -13
block/bfq-iosched.c
··· 2662 2662 * are likely to increase the throughput. 2663 2663 */ 2664 2664 bfqq->new_bfqq = new_bfqq; 2665 - /* 2666 - * The above assignment schedules the following redirections: 2667 - * each time some I/O for bfqq arrives, the process that 2668 - * generated that I/O is disassociated from bfqq and 2669 - * associated with new_bfqq. Here we increases new_bfqq->ref 2670 - * in advance, adding the number of processes that are 2671 - * expected to be associated with new_bfqq as they happen to 2672 - * issue I/O. 2673 - */ 2674 2665 new_bfqq->ref += process_refs; 2675 2666 return new_bfqq; 2676 2667 } ··· 2723 2732 void *io_struct, bool request, struct bfq_io_cq *bic) 2724 2733 { 2725 2734 struct bfq_queue *in_service_bfqq, *new_bfqq; 2726 - 2727 - /* if a merge has already been setup, then proceed with that first */ 2728 - if (bfqq->new_bfqq) 2729 - return bfqq->new_bfqq; 2730 2735 2731 2736 /* 2732 2737 * Check delayed stable merge for rotational or non-queueing ··· 2824 2837 */ 2825 2838 if (bfq_too_late_for_merging(bfqq)) 2826 2839 return NULL; 2840 + 2841 + if (bfqq->new_bfqq) 2842 + return bfqq->new_bfqq; 2827 2843 2828 2844 if (!io_struct || unlikely(bfqq == &bfqd->oom_bfqq)) 2829 2845 return NULL;
+12
drivers/acpi/nfit/core.c
··· 3007 3007 ndr_desc->target_node = NUMA_NO_NODE; 3008 3008 } 3009 3009 3010 + /* Fallback to address based numa information if node lookup failed */ 3011 + if (ndr_desc->numa_node == NUMA_NO_NODE) { 3012 + ndr_desc->numa_node = memory_add_physaddr_to_nid(spa->address); 3013 + dev_info(acpi_desc->dev, "changing numa node from %d to %d for nfit region [%pa-%pa]", 3014 + NUMA_NO_NODE, ndr_desc->numa_node, &res.start, &res.end); 3015 + } 3016 + if (ndr_desc->target_node == NUMA_NO_NODE) { 3017 + ndr_desc->target_node = phys_to_target_node(spa->address); 3018 + dev_info(acpi_desc->dev, "changing target node from %d to %d for nfit region [%pa-%pa]", 3019 + NUMA_NO_NODE, ndr_desc->numa_node, &res.start, &res.end); 3020 + } 3021 + 3010 3022 /* 3011 3023 * Persistence domain bits are hierarchical, if 3012 3024 * ACPI_NFIT_CAPABILITY_CACHE_FLUSH is set then
+63 -27
drivers/base/core.c
··· 95 95 96 96 list_add(&link->s_hook, &sup->consumers); 97 97 list_add(&link->c_hook, &con->suppliers); 98 + pr_debug("%pfwP Linked as a fwnode consumer to %pfwP\n", 99 + con, sup); 98 100 out: 99 101 mutex_unlock(&fwnode_link_lock); 100 102 101 103 return ret; 104 + } 105 + 106 + /** 107 + * __fwnode_link_del - Delete a link between two fwnode_handles. 108 + * @link: the fwnode_link to be deleted 109 + * 110 + * The fwnode_link_lock needs to be held when this function is called. 111 + */ 112 + static void __fwnode_link_del(struct fwnode_link *link) 113 + { 114 + pr_debug("%pfwP Dropping the fwnode link to %pfwP\n", 115 + link->consumer, link->supplier); 116 + list_del(&link->s_hook); 117 + list_del(&link->c_hook); 118 + kfree(link); 102 119 } 103 120 104 121 /** ··· 129 112 struct fwnode_link *link, *tmp; 130 113 131 114 mutex_lock(&fwnode_link_lock); 132 - list_for_each_entry_safe(link, tmp, &fwnode->suppliers, c_hook) { 133 - list_del(&link->s_hook); 134 - list_del(&link->c_hook); 135 - kfree(link); 136 - } 115 + list_for_each_entry_safe(link, tmp, &fwnode->suppliers, c_hook) 116 + __fwnode_link_del(link); 137 117 mutex_unlock(&fwnode_link_lock); 138 118 } 139 119 ··· 145 131 struct fwnode_link *link, *tmp; 146 132 147 133 mutex_lock(&fwnode_link_lock); 148 - list_for_each_entry_safe(link, tmp, &fwnode->consumers, s_hook) { 149 - list_del(&link->s_hook); 150 - list_del(&link->c_hook); 151 - kfree(link); 152 - } 134 + list_for_each_entry_safe(link, tmp, &fwnode->consumers, s_hook) 135 + __fwnode_link_del(link); 153 136 mutex_unlock(&fwnode_link_lock); 154 137 } 155 138 ··· 986 975 { 987 976 struct device_link *link; 988 977 int ret = 0; 978 + struct fwnode_handle *sup_fw; 989 979 990 980 /* 991 981 * Device waiting for supplier to become available is not allowed to ··· 995 983 mutex_lock(&fwnode_link_lock); 996 984 if (dev->fwnode && !list_empty(&dev->fwnode->suppliers) && 997 985 !fw_devlink_is_permissive()) { 998 - dev_dbg(dev, "probe deferral - wait for supplier %pfwP\n", 999 - list_first_entry(&dev->fwnode->suppliers, 1000 - struct fwnode_link, 1001 - c_hook)->supplier); 986 + sup_fw = list_first_entry(&dev->fwnode->suppliers, 987 + struct fwnode_link, 988 + c_hook)->supplier; 989 + dev_err_probe(dev, -EPROBE_DEFER, "wait for supplier %pfwP\n", 990 + sup_fw); 1002 991 mutex_unlock(&fwnode_link_lock); 1003 992 return -EPROBE_DEFER; 1004 993 } ··· 1014 1001 if (link->status != DL_STATE_AVAILABLE && 1015 1002 !(link->flags & DL_FLAG_SYNC_STATE_ONLY)) { 1016 1003 device_links_missing_supplier(dev); 1017 - dev_dbg(dev, "probe deferral - supplier %s not ready\n", 1018 - dev_name(link->supplier)); 1004 + dev_err_probe(dev, -EPROBE_DEFER, 1005 + "supplier %s not ready\n", 1006 + dev_name(link->supplier)); 1019 1007 ret = -EPROBE_DEFER; 1020 1008 break; 1021 1009 } ··· 1736 1722 struct device *sup_dev; 1737 1723 int ret = 0; 1738 1724 1725 + /* 1726 + * In some cases, a device P might also be a supplier to its child node 1727 + * C. However, this would defer the probe of C until the probe of P 1728 + * completes successfully. This is perfectly fine in the device driver 1729 + * model. device_add() doesn't guarantee probe completion of the device 1730 + * by the time it returns. 1731 + * 1732 + * However, there are a few drivers that assume C will finish probing 1733 + * as soon as it's added and before P finishes probing. So, we provide 1734 + * a flag to let fw_devlink know not to delay the probe of C until the 1735 + * probe of P completes successfully. 1736 + * 1737 + * When such a flag is set, we can't create device links where P is the 1738 + * supplier of C as that would delay the probe of C. 1739 + */ 1740 + if (sup_handle->flags & FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD && 1741 + fwnode_is_ancestor_of(sup_handle, con->fwnode)) 1742 + return -EINVAL; 1743 + 1739 1744 sup_dev = get_dev_from_fwnode(sup_handle); 1740 1745 if (sup_dev) { 1741 1746 /* ··· 1805 1772 * be broken by applying logic. Check for these types of cycles and 1806 1773 * break them so that devices in the cycle probe properly. 1807 1774 * 1808 - * If the supplier's parent is dependent on the consumer, then 1809 - * the consumer-supplier dependency is a false dependency. So, 1810 - * treat it as an invalid link. 1775 + * If the supplier's parent is dependent on the consumer, then the 1776 + * consumer and supplier have a cyclic dependency. Since fw_devlink 1777 + * can't tell which of the inferred dependencies are incorrect, don't 1778 + * enforce probe ordering between any of the devices in this cyclic 1779 + * dependency. Do this by relaxing all the fw_devlink device links in 1780 + * this cycle and by treating the fwnode link between the consumer and 1781 + * the supplier as an invalid dependency. 1811 1782 */ 1812 1783 sup_dev = fwnode_get_next_parent_dev(sup_handle); 1813 1784 if (sup_dev && device_is_dependent(con, sup_dev)) { 1814 - dev_dbg(con, "Not linking to %pfwP - False link\n", 1815 - sup_handle); 1785 + dev_info(con, "Fixing up cyclic dependency with %pfwP (%s)\n", 1786 + sup_handle, dev_name(sup_dev)); 1787 + device_links_write_lock(); 1788 + fw_devlink_relax_cycle(con, sup_dev); 1789 + device_links_write_unlock(); 1816 1790 ret = -EINVAL; 1817 1791 } else { 1818 1792 /* ··· 1898 1858 if (!own_link || ret == -EAGAIN) 1899 1859 continue; 1900 1860 1901 - list_del(&link->s_hook); 1902 - list_del(&link->c_hook); 1903 - kfree(link); 1861 + __fwnode_link_del(link); 1904 1862 } 1905 1863 } 1906 1864 ··· 1950 1912 if (!own_link || ret == -EAGAIN) 1951 1913 continue; 1952 1914 1953 - list_del(&link->s_hook); 1954 - list_del(&link->c_hook); 1955 - kfree(link); 1915 + __fwnode_link_del(link); 1956 1916 1957 1917 /* If no device link was created, nothing more to do. */ 1958 1918 if (ret)
+17 -12
drivers/block/nbd.c
··· 97 97 98 98 atomic_t recv_threads; 99 99 wait_queue_head_t recv_wq; 100 - loff_t blksize; 100 + unsigned int blksize_bits; 101 101 loff_t bytesize; 102 102 #if IS_ENABLED(CONFIG_DEBUG_FS) 103 103 struct dentry *dbg_dir; 104 104 #endif 105 105 }; 106 + 107 + static inline unsigned int nbd_blksize(struct nbd_config *config) 108 + { 109 + return 1u << config->blksize_bits; 110 + } 106 111 107 112 struct nbd_device { 108 113 struct blk_mq_tag_set tag_set; ··· 151 146 152 147 #define NBD_MAGIC 0x68797548 153 148 154 - #define NBD_DEF_BLKSIZE 1024 149 + #define NBD_DEF_BLKSIZE_BITS 10 155 150 156 151 static unsigned int nbds_max = 16; 157 152 static int max_part = 16; ··· 322 317 loff_t blksize) 323 318 { 324 319 if (!blksize) 325 - blksize = NBD_DEF_BLKSIZE; 320 + blksize = 1u << NBD_DEF_BLKSIZE_BITS; 326 321 if (blksize < 512 || blksize > PAGE_SIZE || !is_power_of_2(blksize)) 327 322 return -EINVAL; 328 323 329 324 nbd->config->bytesize = bytesize; 330 - nbd->config->blksize = blksize; 325 + nbd->config->blksize_bits = __ffs(blksize); 331 326 332 327 if (!nbd->task_recv) 333 328 return 0; ··· 1342 1337 args->index = i; 1343 1338 queue_work(nbd->recv_workq, &args->work); 1344 1339 } 1345 - return nbd_set_size(nbd, config->bytesize, config->blksize); 1340 + return nbd_set_size(nbd, config->bytesize, nbd_blksize(config)); 1346 1341 } 1347 1342 1348 1343 static int nbd_start_device_ioctl(struct nbd_device *nbd, struct block_device *bdev) ··· 1411 1406 case NBD_SET_BLKSIZE: 1412 1407 return nbd_set_size(nbd, config->bytesize, arg); 1413 1408 case NBD_SET_SIZE: 1414 - return nbd_set_size(nbd, arg, config->blksize); 1409 + return nbd_set_size(nbd, arg, nbd_blksize(config)); 1415 1410 case NBD_SET_SIZE_BLOCKS: 1416 - if (check_mul_overflow((loff_t)arg, config->blksize, &bytesize)) 1411 + if (check_shl_overflow(arg, config->blksize_bits, &bytesize)) 1417 1412 return -EINVAL; 1418 - return nbd_set_size(nbd, bytesize, config->blksize); 1413 + return nbd_set_size(nbd, bytesize, nbd_blksize(config)); 1419 1414 case NBD_SET_TIMEOUT: 1420 1415 nbd_set_cmd_timeout(nbd, arg); 1421 1416 return 0; ··· 1481 1476 atomic_set(&config->recv_threads, 0); 1482 1477 init_waitqueue_head(&config->recv_wq); 1483 1478 init_waitqueue_head(&config->conn_wait); 1484 - config->blksize = NBD_DEF_BLKSIZE; 1479 + config->blksize_bits = NBD_DEF_BLKSIZE_BITS; 1485 1480 atomic_set(&config->live_connections, 0); 1486 1481 try_module_get(THIS_MODULE); 1487 1482 return config; ··· 1609 1604 debugfs_create_file("tasks", 0444, dir, nbd, &nbd_dbg_tasks_fops); 1610 1605 debugfs_create_u64("size_bytes", 0444, dir, &config->bytesize); 1611 1606 debugfs_create_u32("timeout", 0444, dir, &nbd->tag_set.timeout); 1612 - debugfs_create_u64("blocksize", 0444, dir, &config->blksize); 1607 + debugfs_create_u32("blocksize_bits", 0444, dir, &config->blksize_bits); 1613 1608 debugfs_create_file("flags", 0444, dir, nbd, &nbd_dbg_flags_fops); 1614 1609 1615 1610 return 0; ··· 1831 1826 static int nbd_genl_size_set(struct genl_info *info, struct nbd_device *nbd) 1832 1827 { 1833 1828 struct nbd_config *config = nbd->config; 1834 - u64 bsize = config->blksize; 1829 + u64 bsize = nbd_blksize(config); 1835 1830 u64 bytes = config->bytesize; 1836 1831 1837 1832 if (info->attrs[NBD_ATTR_SIZE_BYTES]) ··· 1840 1835 if (info->attrs[NBD_ATTR_BLOCK_SIZE_BYTES]) 1841 1836 bsize = nla_get_u64(info->attrs[NBD_ATTR_BLOCK_SIZE_BYTES]); 1842 1837 1843 - if (bytes != config->bytesize || bsize != config->blksize) 1838 + if (bytes != config->bytesize || bsize != nbd_blksize(config)) 1844 1839 return nbd_set_size(nbd, bytes, bsize); 1845 1840 return 0; 1846 1841 }
+4
drivers/bus/ti-sysc.c
··· 1464 1464 /* Quirks that need to be set based on detected module */ 1465 1465 SYSC_QUIRK("aess", 0, 0, 0x10, -ENODEV, 0x40000000, 0xffffffff, 1466 1466 SYSC_MODULE_QUIRK_AESS), 1467 + /* Errata i893 handling for dra7 dcan1 and 2 */ 1468 + SYSC_QUIRK("dcan", 0x4ae3c000, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff, 1469 + SYSC_QUIRK_CLKDM_NOAUTO), 1467 1470 SYSC_QUIRK("dcan", 0x48480000, 0x20, -ENODEV, -ENODEV, 0xa3170504, 0xffffffff, 1468 1471 SYSC_QUIRK_CLKDM_NOAUTO), 1469 1472 SYSC_QUIRK("dss", 0x4832a000, 0, 0x10, 0x14, 0x00000020, 0xffffffff, ··· 2957 2954 break; 2958 2955 case SOC_AM3: 2959 2956 sysc_add_disabled(0x48310000); /* rng */ 2957 + break; 2960 2958 default: 2961 2959 break; 2962 2960 }
+1 -1
drivers/firmware/Kconfig
··· 204 204 205 205 config QCOM_SCM 206 206 tristate "Qcom SCM driver" 207 - depends on ARM || ARM64 207 + depends on ARCH_QCOM || COMPILE_TEST 208 208 depends on HAVE_ARM_SMCCC 209 209 select RESET_CONTROLLER 210 210
+1 -1
drivers/firmware/arm_scmi/Kconfig
··· 68 68 69 69 config ARM_SCMI_TRANSPORT_VIRTIO 70 70 bool "SCMI transport based on VirtIO" 71 - depends on VIRTIO 71 + depends on VIRTIO=y || VIRTIO=ARM_SCMI_PROTOCOL 72 72 select ARM_SCMI_HAVE_TRANSPORT 73 73 select ARM_SCMI_HAVE_MSG 74 74 help
+31 -13
drivers/firmware/arm_scmi/virtio.c
··· 110 110 if (vioch->is_rx) { 111 111 scmi_vio_feed_vq_rx(vioch, msg); 112 112 } else { 113 - unsigned long flags; 114 - 115 - spin_lock_irqsave(&vioch->lock, flags); 113 + /* Here IRQs are assumed to be already disabled by the caller */ 114 + spin_lock(&vioch->lock); 116 115 list_add(&msg->list, &vioch->free_list); 117 - spin_unlock_irqrestore(&vioch->lock, flags); 116 + spin_unlock(&vioch->lock); 118 117 } 119 118 } 120 119 121 120 static void scmi_vio_complete_cb(struct virtqueue *vqueue) 122 121 { 123 122 unsigned long ready_flags; 124 - unsigned long flags; 125 123 unsigned int length; 126 124 struct scmi_vio_channel *vioch; 127 125 struct scmi_vio_msg *msg; ··· 138 140 goto unlock_ready_out; 139 141 } 140 142 141 - spin_lock_irqsave(&vioch->lock, flags); 143 + /* IRQs already disabled here no need to irqsave */ 144 + spin_lock(&vioch->lock); 142 145 if (cb_enabled) { 143 146 virtqueue_disable_cb(vqueue); 144 147 cb_enabled = false; ··· 150 151 goto unlock_out; 151 152 cb_enabled = true; 152 153 } 153 - spin_unlock_irqrestore(&vioch->lock, flags); 154 + spin_unlock(&vioch->lock); 154 155 155 156 if (msg) { 156 157 msg->rx_len = length; ··· 160 161 scmi_finalize_message(vioch, msg); 161 162 } 162 163 164 + /* 165 + * Release ready_lock and re-enable IRQs between loop iterations 166 + * to allow virtio_chan_free() to possibly kick in and set the 167 + * flag vioch->ready to false even in between processing of 168 + * messages, so as to force outstanding messages to be ignored 169 + * when system is shutting down. 170 + */ 163 171 spin_unlock_irqrestore(&vioch->ready_lock, ready_flags); 164 172 } 165 173 166 174 unlock_out: 167 - spin_unlock_irqrestore(&vioch->lock, flags); 175 + spin_unlock(&vioch->lock); 168 176 unlock_ready_out: 169 177 spin_unlock_irqrestore(&vioch->ready_lock, ready_flags); 170 178 } ··· 390 384 struct virtqueue *vqs[VIRTIO_SCMI_VQ_MAX_CNT]; 391 385 392 386 /* Only one SCMI VirtiO device allowed */ 393 - if (scmi_vdev) 394 - return -EINVAL; 387 + if (scmi_vdev) { 388 + dev_err(dev, 389 + "One SCMI Virtio device was already initialized: only one allowed.\n"); 390 + return -EBUSY; 391 + } 395 392 396 393 have_vq_rx = scmi_vio_have_vq_rx(vdev); 397 394 vq_cnt = have_vq_rx ? VIRTIO_SCMI_VQ_MAX_CNT : 1; ··· 437 428 } 438 429 439 430 vdev->priv = channels; 440 - scmi_vdev = vdev; 431 + /* Ensure initialized scmi_vdev is visible */ 432 + smp_store_mb(scmi_vdev, vdev); 441 433 442 434 return 0; 443 435 } 444 436 445 437 static void scmi_vio_remove(struct virtio_device *vdev) 446 438 { 439 + /* 440 + * Once we get here, virtio_chan_free() will have already been called by 441 + * the SCMI core for any existing channel and, as a consequence, all the 442 + * virtio channels will have been already marked NOT ready, causing any 443 + * outstanding message on any vqueue to be ignored by complete_cb: now 444 + * we can just stop processing buffers and destroy the vqueues. 445 + */ 447 446 vdev->config->reset(vdev); 448 447 vdev->config->del_vqs(vdev); 449 - scmi_vdev = NULL; 448 + /* Ensure scmi_vdev is visible as NULL */ 449 + smp_store_mb(scmi_vdev, NULL); 450 450 } 451 451 452 452 static int scmi_vio_validate(struct virtio_device *vdev) ··· 494 476 return register_virtio_driver(&virtio_scmi_driver); 495 477 } 496 478 497 - static void __exit virtio_scmi_exit(void) 479 + static void virtio_scmi_exit(void) 498 480 { 499 481 unregister_virtio_driver(&virtio_scmi_driver); 500 482 }
+31
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c
··· 837 837 return 0; 838 838 } 839 839 840 + /* Mirrors the is_displayable check in radeonsi's gfx6_compute_surface */ 841 + static int check_tiling_flags_gfx6(struct amdgpu_framebuffer *afb) 842 + { 843 + u64 micro_tile_mode; 844 + 845 + /* Zero swizzle mode means linear */ 846 + if (AMDGPU_TILING_GET(afb->tiling_flags, SWIZZLE_MODE) == 0) 847 + return 0; 848 + 849 + micro_tile_mode = AMDGPU_TILING_GET(afb->tiling_flags, MICRO_TILE_MODE); 850 + switch (micro_tile_mode) { 851 + case 0: /* DISPLAY */ 852 + case 3: /* RENDER */ 853 + return 0; 854 + default: 855 + drm_dbg_kms(afb->base.dev, 856 + "Micro tile mode %llu not supported for scanout\n", 857 + micro_tile_mode); 858 + return -EINVAL; 859 + } 860 + } 861 + 840 862 static void get_block_dimensions(unsigned int block_log2, unsigned int cpp, 841 863 unsigned int *width, unsigned int *height) 842 864 { ··· 1125 1103 const struct drm_mode_fb_cmd2 *mode_cmd, 1126 1104 struct drm_gem_object *obj) 1127 1105 { 1106 + struct amdgpu_device *adev = drm_to_adev(dev); 1128 1107 int ret, i; 1129 1108 1130 1109 /* ··· 1144 1121 ret = amdgpu_display_get_fb_info(rfb, &rfb->tiling_flags, &rfb->tmz_surface); 1145 1122 if (ret) 1146 1123 return ret; 1124 + 1125 + if (!dev->mode_config.allow_fb_modifiers) { 1126 + drm_WARN_ONCE(dev, adev->family >= AMDGPU_FAMILY_AI, 1127 + "GFX9+ requires FB check based on format modifier\n"); 1128 + ret = check_tiling_flags_gfx6(rfb); 1129 + if (ret) 1130 + return ret; 1131 + } 1147 1132 1148 1133 if (dev->mode_config.allow_fb_modifiers && 1149 1134 !(rfb->base.flags & DRM_MODE_FB_MODIFIERS)) {
+1 -1
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
··· 3599 3599 3600 3600 /* set static priority for a queue/ring */ 3601 3601 gfx_v9_0_mqd_set_priority(ring, mqd); 3602 - mqd->cp_hqd_quantum = RREG32(mmCP_HQD_QUANTUM); 3602 + mqd->cp_hqd_quantum = RREG32_SOC15(GC, 0, mmCP_HQD_QUANTUM); 3603 3603 3604 3604 /* map_queues packet doesn't need activate the queue, 3605 3605 * so only kiq need set this field.
+2 -1
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c
··· 1098 1098 { 1099 1099 struct amdgpu_device *adev = (struct amdgpu_device *)handle; 1100 1100 1101 + gmc_v10_0_gart_disable(adev); 1102 + 1101 1103 if (amdgpu_sriov_vf(adev)) { 1102 1104 /* full access mode, so don't touch any GMC register */ 1103 1105 DRM_DEBUG("For SRIOV client, shouldn't do anything.\n"); ··· 1108 1106 1109 1107 amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0); 1110 1108 amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0); 1111 - gmc_v10_0_gart_disable(adev); 1112 1109 1113 1110 return 0; 1114 1111 }
+2 -1
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c
··· 1794 1794 { 1795 1795 struct amdgpu_device *adev = (struct amdgpu_device *)handle; 1796 1796 1797 + gmc_v9_0_gart_disable(adev); 1798 + 1797 1799 if (amdgpu_sriov_vf(adev)) { 1798 1800 /* full access mode, so don't touch any GMC register */ 1799 1801 DRM_DEBUG("For SRIOV client, shouldn't do anything.\n"); ··· 1804 1802 1805 1803 amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0); 1806 1804 amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0); 1807 - gmc_v9_0_gart_disable(adev); 1808 1805 1809 1806 return 0; 1810 1807 }
+8
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c
··· 868 868 msleep(1000); 869 869 } 870 870 871 + /* TODO: check whether can submit a doorbell request to raise 872 + * a doorbell fence to exit gfxoff. 873 + */ 874 + if (adev->in_s0ix) 875 + amdgpu_gfx_off_ctrl(adev, false); 876 + 871 877 sdma_v5_2_soft_reset(adev); 872 878 /* unhalt the MEs */ 873 879 sdma_v5_2_enable(adev, true); ··· 882 876 883 877 /* start the gfx rings and rlc compute queues */ 884 878 r = sdma_v5_2_gfx_resume(adev); 879 + if (adev->in_s0ix) 880 + amdgpu_gfx_off_ctrl(adev, true); 885 881 if (r) 886 882 return r; 887 883 r = sdma_v5_2_rlc_resume(adev);
+2
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
··· 1115 1115 1116 1116 init_data.asic_id.pci_revision_id = adev->pdev->revision; 1117 1117 init_data.asic_id.hw_internal_rev = adev->external_rev_id; 1118 + init_data.asic_id.chip_id = adev->pdev->device; 1118 1119 1119 1120 init_data.asic_id.vram_width = adev->gmc.vram_width; 1120 1121 /* TODO: initialize init_data.asic_id.vram_type here!!!! */ ··· 1720 1719 linear_lut[i] = 0xFFFF * i / 15; 1721 1720 1722 1721 params.set = 0; 1722 + params.backlight_ramping_override = false; 1723 1723 params.backlight_ramping_start = 0xCCCC; 1724 1724 params.backlight_ramping_reduction = 0xCCCCCCCC; 1725 1725 params.backlight_lut_array_size = 16;
+1 -3
drivers/gpu/drm/exynos/exynos5433_drm_decon.c
··· 793 793 { 794 794 struct device *dev = &pdev->dev; 795 795 struct decon_context *ctx; 796 - struct resource *res; 797 796 int ret; 798 797 int i; 799 798 ··· 817 818 ctx->clks[i] = clk; 818 819 } 819 820 820 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 821 - ctx->addr = devm_ioremap_resource(dev, res); 821 + ctx->addr = devm_platform_ioremap_resource(pdev, 0); 822 822 if (IS_ERR(ctx->addr)) 823 823 return PTR_ERR(ctx->addr); 824 824
+1 -3
drivers/gpu/drm/exynos/exynos_drm_dsi.c
··· 1738 1738 static int exynos_dsi_probe(struct platform_device *pdev) 1739 1739 { 1740 1740 struct device *dev = &pdev->dev; 1741 - struct resource *res; 1742 1741 struct exynos_dsi *dsi; 1743 1742 int ret, i; 1744 1743 ··· 1788 1789 } 1789 1790 } 1790 1791 1791 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1792 - dsi->reg_base = devm_ioremap_resource(dev, res); 1792 + dsi->reg_base = devm_platform_ioremap_resource(pdev, 0); 1793 1793 if (IS_ERR(dsi->reg_base)) 1794 1794 return PTR_ERR(dsi->reg_base); 1795 1795
+1 -4
drivers/gpu/drm/exynos/exynos_drm_fimc.c
··· 85 85 /* 86 86 * A structure of fimc context. 87 87 * 88 - * @regs_res: register resources. 89 88 * @regs: memory mapped io registers. 90 89 * @lock: locking of operations. 91 90 * @clocks: fimc clocks. ··· 102 103 struct exynos_drm_ipp_formats *formats; 103 104 unsigned int num_formats; 104 105 105 - struct resource *regs_res; 106 106 void __iomem *regs; 107 107 spinlock_t lock; 108 108 struct clk *clocks[FIMC_CLKS_MAX]; ··· 1325 1327 ctx->num_formats = num_formats; 1326 1328 1327 1329 /* resource memory */ 1328 - ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1329 - ctx->regs = devm_ioremap_resource(dev, ctx->regs_res); 1330 + ctx->regs = devm_platform_ioremap_resource(pdev, 0); 1330 1331 if (IS_ERR(ctx->regs)) 1331 1332 return PTR_ERR(ctx->regs); 1332 1333
+1 -3
drivers/gpu/drm/exynos/exynos_drm_fimd.c
··· 1202 1202 return PTR_ERR(ctx->lcd_clk); 1203 1203 } 1204 1204 1205 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1206 - 1207 - ctx->regs = devm_ioremap_resource(dev, res); 1205 + ctx->regs = devm_platform_ioremap_resource(pdev, 0); 1208 1206 if (IS_ERR(ctx->regs)) 1209 1207 return PTR_ERR(ctx->regs); 1210 1208
+1 -4
drivers/gpu/drm/exynos/exynos_drm_g2d.c
··· 1449 1449 static int g2d_probe(struct platform_device *pdev) 1450 1450 { 1451 1451 struct device *dev = &pdev->dev; 1452 - struct resource *res; 1453 1452 struct g2d_data *g2d; 1454 1453 int ret; 1455 1454 ··· 1490 1491 clear_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags); 1491 1492 clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags); 1492 1493 1493 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1494 - 1495 - g2d->regs = devm_ioremap_resource(dev, res); 1494 + g2d->regs = devm_platform_ioremap_resource(pdev, 0); 1496 1495 if (IS_ERR(g2d->regs)) { 1497 1496 ret = PTR_ERR(g2d->regs); 1498 1497 goto err_put_clk;
+1 -5
drivers/gpu/drm/exynos/exynos_drm_gsc.c
··· 86 86 /* 87 87 * A structure of gsc context. 88 88 * 89 - * @regs_res: register resources. 90 89 * @regs: memory mapped io registers. 91 90 * @gsc_clk: gsc gate clock. 92 91 * @sc: scaler infomations. ··· 102 103 struct exynos_drm_ipp_formats *formats; 103 104 unsigned int num_formats; 104 105 105 - struct resource *regs_res; 106 106 void __iomem *regs; 107 107 const char **clk_names; 108 108 struct clk *clocks[GSC_MAX_CLOCKS]; ··· 1270 1272 } 1271 1273 } 1272 1274 1273 - /* resource memory */ 1274 - ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1275 - ctx->regs = devm_ioremap_resource(dev, ctx->regs_res); 1275 + ctx->regs = devm_platform_ioremap_resource(pdev, 0); 1276 1276 if (IS_ERR(ctx->regs)) 1277 1277 return PTR_ERR(ctx->regs); 1278 1278
+1 -3
drivers/gpu/drm/exynos/exynos_drm_rotator.c
··· 278 278 static int rotator_probe(struct platform_device *pdev) 279 279 { 280 280 struct device *dev = &pdev->dev; 281 - struct resource *regs_res; 282 281 struct rot_context *rot; 283 282 const struct rot_variant *variant; 284 283 int irq; ··· 291 292 rot->formats = variant->formats; 292 293 rot->num_formats = variant->num_formats; 293 294 rot->dev = dev; 294 - regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 295 - rot->regs = devm_ioremap_resource(dev, regs_res); 295 + rot->regs = devm_platform_ioremap_resource(pdev, 0); 296 296 if (IS_ERR(rot->regs)) 297 297 return PTR_ERR(rot->regs); 298 298
+1 -3
drivers/gpu/drm/exynos/exynos_drm_scaler.c
··· 485 485 static int scaler_probe(struct platform_device *pdev) 486 486 { 487 487 struct device *dev = &pdev->dev; 488 - struct resource *regs_res; 489 488 struct scaler_context *scaler; 490 489 int irq; 491 490 int ret, i; ··· 497 498 (struct scaler_data *)of_device_get_match_data(dev); 498 499 499 500 scaler->dev = dev; 500 - regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 501 - scaler->regs = devm_ioremap_resource(dev, regs_res); 501 + scaler->regs = devm_platform_ioremap_resource(pdev, 0); 502 502 if (IS_ERR(scaler->regs)) 503 503 return PTR_ERR(scaler->regs); 504 504
+1 -3
drivers/gpu/drm/exynos/exynos_hdmi.c
··· 1957 1957 struct hdmi_audio_infoframe *audio_infoframe; 1958 1958 struct device *dev = &pdev->dev; 1959 1959 struct hdmi_context *hdata; 1960 - struct resource *res; 1961 1960 int ret; 1962 1961 1963 1962 hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL); ··· 1978 1979 return ret; 1979 1980 } 1980 1981 1981 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1982 - hdata->regs = devm_ioremap_resource(dev, res); 1982 + hdata->regs = devm_platform_ioremap_resource(pdev, 0); 1983 1983 if (IS_ERR(hdata->regs)) { 1984 1984 ret = PTR_ERR(hdata->regs); 1985 1985 return ret;
+3 -2
drivers/gpu/drm/i915/gt/intel_context.c
··· 362 362 return 0; 363 363 } 364 364 365 - static int sw_fence_dummy_notify(struct i915_sw_fence *sf, 366 - enum i915_sw_fence_notify state) 365 + static int __i915_sw_fence_call 366 + sw_fence_dummy_notify(struct i915_sw_fence *sf, 367 + enum i915_sw_fence_notify state) 367 368 { 368 369 return NOTIFY_DONE; 369 370 }
-2
drivers/gpu/drm/i915/gt/intel_rps.c
··· 882 882 if (!intel_rps_is_enabled(rps)) 883 883 return; 884 884 885 - GEM_BUG_ON(atomic_read(&rps->num_waiters)); 886 - 887 885 if (!intel_rps_clear_active(rps)) 888 886 return; 889 887
+5 -5
drivers/gpu/drm/i915/gt/uc/abi/guc_communication_ctb_abi.h
··· 102 102 * | +-------+--------------------------------------------------------------+ 103 103 * | | 7:0 | NUM_DWORDS = length (in dwords) of the embedded HXG message | 104 104 * +---+-------+--------------------------------------------------------------+ 105 - * | 1 | 31:0 | +--------------------------------------------------------+ | 106 - * +---+-------+ | | | 107 - * |...| | | Embedded `HXG Message`_ | | 108 - * +---+-------+ | | | 109 - * | n | 31:0 | +--------------------------------------------------------+ | 105 + * | 1 | 31:0 | | 106 + * +---+-------+ | 107 + * |...| | [Embedded `HXG Message`_] | 108 + * +---+-------+ | 109 + * | n | 31:0 | | 110 110 * +---+-------+--------------------------------------------------------------+ 111 111 */ 112 112
+5 -5
drivers/gpu/drm/i915/gt/uc/abi/guc_communication_mmio_abi.h
··· 38 38 * +---+-------+--------------------------------------------------------------+ 39 39 * | | Bits | Description | 40 40 * +===+=======+==============================================================+ 41 - * | 0 | 31:0 | +--------------------------------------------------------+ | 42 - * +---+-------+ | | | 43 - * |...| | | Embedded `HXG Message`_ | | 44 - * +---+-------+ | | | 45 - * | n | 31:0 | +--------------------------------------------------------+ | 41 + * | 0 | 31:0 | | 42 + * +---+-------+ | 43 + * |...| | [Embedded `HXG Message`_] | 44 + * +---+-------+ | 45 + * | n | 31:0 | | 46 46 * +---+-------+--------------------------------------------------------------+ 47 47 */ 48 48
+2 -2
drivers/gpu/drm/i915/gvt/scheduler.c
··· 576 576 577 577 /* No one is going to touch shadow bb from now on. */ 578 578 i915_gem_object_flush_map(bb->obj); 579 - i915_gem_object_unlock(bb->obj); 579 + i915_gem_ww_ctx_fini(&ww); 580 580 } 581 581 } 582 582 return 0; ··· 630 630 return ret; 631 631 } 632 632 633 - i915_gem_object_unlock(wa_ctx->indirect_ctx.obj); 633 + i915_gem_ww_ctx_fini(&ww); 634 634 635 635 /* FIXME: we are not tracking our pinned VMA leaving it 636 636 * up to the core to fix up the stray pin_count upon
+2 -9
drivers/gpu/drm/i915/i915_request.c
··· 829 829 i915_sw_fence_init(&rq->submit, submit_notify); 830 830 i915_sw_fence_init(&rq->semaphore, semaphore_notify); 831 831 832 - dma_fence_init(&rq->fence, &i915_fence_ops, &rq->lock, 0, 0); 833 - 834 832 rq->capture_list = NULL; 835 833 836 834 init_llist_head(&rq->execute_cb); ··· 903 905 rq->ring = ce->ring; 904 906 rq->execution_mask = ce->engine->mask; 905 907 906 - kref_init(&rq->fence.refcount); 907 - rq->fence.flags = 0; 908 - rq->fence.error = 0; 909 - INIT_LIST_HEAD(&rq->fence.cb_list); 910 - 911 908 ret = intel_timeline_get_seqno(tl, rq, &seqno); 912 909 if (ret) 913 910 goto err_free; 914 911 915 - rq->fence.context = tl->fence_context; 916 - rq->fence.seqno = seqno; 912 + dma_fence_init(&rq->fence, &i915_fence_ops, &rq->lock, 913 + tl->fence_context, seqno); 917 914 918 915 RCU_INIT_POINTER(rq->timeline, tl); 919 916 rq->hwsp_seqno = tl->hwsp_seqno;
-3
drivers/gpu/drm/tegra/dc.c
··· 1845 1845 bool prepare_bandwidth_transition) 1846 1846 { 1847 1847 const struct tegra_plane_state *old_tegra_state, *new_tegra_state; 1848 - const struct tegra_dc_state *old_dc_state, *new_dc_state; 1849 1848 u32 i, new_avg_bw, old_avg_bw, new_peak_bw, old_peak_bw; 1850 1849 const struct drm_plane_state *old_plane_state; 1851 1850 const struct drm_crtc_state *old_crtc_state; ··· 1857 1858 return; 1858 1859 1859 1860 old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); 1860 - old_dc_state = to_const_dc_state(old_crtc_state); 1861 - new_dc_state = to_const_dc_state(crtc->state); 1862 1861 1863 1862 if (!crtc->state->active) { 1864 1863 if (!old_crtc_state->active)
-6
drivers/gpu/drm/tegra/dc.h
··· 35 35 return NULL; 36 36 } 37 37 38 - static inline const struct tegra_dc_state * 39 - to_const_dc_state(const struct drm_crtc_state *state) 40 - { 41 - return to_dc_state((struct drm_crtc_state *)state); 42 - } 43 - 44 38 struct tegra_dc_stats { 45 39 unsigned long frames; 46 40 unsigned long vblank;
+1 -1
drivers/gpu/drm/tegra/uapi.c
··· 222 222 mapping->iova = sg_dma_address(mapping->sgt->sgl); 223 223 } 224 224 225 - mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->size; 225 + mapping->iova_end = mapping->iova + host1x_to_tegra_bo(mapping->bo)->gem.size; 226 226 227 227 err = xa_alloc(&context->mappings, &args->mapping, mapping, XA_LIMIT(1, U32_MAX), 228 228 GFP_KERNEL);
+4 -2
drivers/gpu/host1x/fence.c
··· 15 15 #include "intr.h" 16 16 #include "syncpt.h" 17 17 18 - DEFINE_SPINLOCK(lock); 18 + static DEFINE_SPINLOCK(lock); 19 19 20 20 struct host1x_syncpt_fence { 21 21 struct dma_fence base; ··· 152 152 return ERR_PTR(-ENOMEM); 153 153 154 154 fence->waiter = kzalloc(sizeof(*fence->waiter), GFP_KERNEL); 155 - if (!fence->waiter) 155 + if (!fence->waiter) { 156 + kfree(fence); 156 157 return ERR_PTR(-ENOMEM); 158 + } 157 159 158 160 fence->sp = sp; 159 161 fence->threshold = threshold;
-6
drivers/hwmon/k10temp.c
··· 362 362 HWMON_T_INPUT | HWMON_T_LABEL, 363 363 HWMON_T_INPUT | HWMON_T_LABEL, 364 364 HWMON_T_INPUT | HWMON_T_LABEL), 365 - HWMON_CHANNEL_INFO(in, 366 - HWMON_I_INPUT | HWMON_I_LABEL, 367 - HWMON_I_INPUT | HWMON_I_LABEL), 368 - HWMON_CHANNEL_INFO(curr, 369 - HWMON_C_INPUT | HWMON_C_LABEL, 370 - HWMON_C_INPUT | HWMON_C_LABEL), 371 365 NULL 372 366 }; 373 367
+6 -2
drivers/hwmon/ltc2947-core.c
··· 989 989 return ret; 990 990 991 991 /* check external clock presence */ 992 - extclk = devm_clk_get(st->dev, NULL); 993 - if (!IS_ERR(extclk)) { 992 + extclk = devm_clk_get_optional(st->dev, NULL); 993 + if (IS_ERR(extclk)) 994 + return dev_err_probe(st->dev, PTR_ERR(extclk), 995 + "Failed to get external clock\n"); 996 + 997 + if (extclk) { 994 998 unsigned long rate_hz; 995 999 u8 pre = 0, div, tbctl; 996 1000 u64 aux;
+9 -3
drivers/hwmon/mlxreg-fan.c
··· 315 315 { 316 316 struct mlxreg_fan *fan = cdev->devdata; 317 317 unsigned long cur_state; 318 + int i, config = 0; 318 319 u32 regval; 319 - int i; 320 320 int err; 321 321 322 322 /* ··· 329 329 * overwritten. 330 330 */ 331 331 if (state >= MLXREG_FAN_SPEED_MIN && state <= MLXREG_FAN_SPEED_MAX) { 332 + /* 333 + * This is configuration change, which is only supported through sysfs. 334 + * For configuration non-zero value is to be returned to avoid thermal 335 + * statistics update. 336 + */ 337 + config = 1; 332 338 state -= MLXREG_FAN_MAX_STATE; 333 339 for (i = 0; i < state; i++) 334 340 fan->cooling_levels[i] = state; ··· 349 343 350 344 cur_state = MLXREG_FAN_PWM_DUTY2STATE(regval); 351 345 if (state < cur_state) 352 - return 0; 346 + return config; 353 347 354 348 state = cur_state; 355 349 } ··· 365 359 dev_err(fan->dev, "Failed to write PWM duty\n"); 366 360 return err; 367 361 } 368 - return 0; 362 + return config; 369 363 } 370 364 371 365 static const struct thermal_cooling_device_ops mlxreg_fan_cooling_ops = {
+5 -12
drivers/hwmon/occ/common.c
··· 340 340 if (val == OCC_TEMP_SENSOR_FAULT) 341 341 return -EREMOTEIO; 342 342 343 - /* 344 - * VRM doesn't return temperature, only alarm bit. This 345 - * attribute maps to tempX_alarm instead of tempX_input for 346 - * VRM 347 - */ 348 - if (temp->fru_type != OCC_FRU_TYPE_VRM) { 349 - /* sensor not ready */ 350 - if (val == 0) 351 - return -EAGAIN; 343 + /* sensor not ready */ 344 + if (val == 0) 345 + return -EAGAIN; 352 346 353 - val *= 1000; 354 - } 347 + val *= 1000; 355 348 break; 356 349 case 2: 357 350 val = temp->fru_type; ··· 879 886 0, i); 880 887 attr++; 881 888 882 - if (sensors->temp.version > 1 && 889 + if (sensors->temp.version == 2 && 883 890 temp->fru_type == OCC_FRU_TYPE_VRM) { 884 891 snprintf(attr->name, sizeof(attr->name), 885 892 "temp%d_alarm", s);
+8 -2
drivers/hwmon/pmbus/ibm-cffps.c
··· 171 171 cmd = CFFPS_SN_CMD; 172 172 break; 173 173 case CFFPS_DEBUGFS_MAX_POWER_OUT: 174 - rc = i2c_smbus_read_word_swapped(psu->client, 175 - CFFPS_MAX_POWER_OUT_CMD); 174 + if (psu->version == cffps1) { 175 + rc = i2c_smbus_read_word_swapped(psu->client, 176 + CFFPS_MAX_POWER_OUT_CMD); 177 + } else { 178 + rc = i2c_smbus_read_word_data(psu->client, 179 + CFFPS_MAX_POWER_OUT_CMD); 180 + } 181 + 176 182 if (rc < 0) 177 183 return rc; 178 184
+1 -1
drivers/hwmon/pmbus/mp2975.c
··· 54 54 55 55 #define MP2975_RAIL2_FUNC (PMBUS_HAVE_VOUT | PMBUS_HAVE_STATUS_VOUT | \ 56 56 PMBUS_HAVE_IOUT | PMBUS_HAVE_STATUS_IOUT | \ 57 - PMBUS_PHASE_VIRTUAL) 57 + PMBUS_HAVE_POUT | PMBUS_PHASE_VIRTUAL) 58 58 59 59 struct mp2975_data { 60 60 struct pmbus_driver_info info;
+40 -33
drivers/hwmon/tmp421.c
··· 100 100 s16 temp[4]; 101 101 }; 102 102 103 - static int temp_from_s16(s16 reg) 103 + static int temp_from_raw(u16 reg, bool extended) 104 104 { 105 105 /* Mask out status bits */ 106 106 int temp = reg & ~0xf; 107 107 108 - return (temp * 1000 + 128) / 256; 108 + if (extended) 109 + temp = temp - 64 * 256; 110 + else 111 + temp = (s16)temp; 112 + 113 + return DIV_ROUND_CLOSEST(temp * 1000, 256); 109 114 } 110 115 111 - static int temp_from_u16(u16 reg) 116 + static int tmp421_update_device(struct tmp421_data *data) 112 117 { 113 - /* Mask out status bits */ 114 - int temp = reg & ~0xf; 115 - 116 - /* Add offset for extended temperature range. */ 117 - temp -= 64 * 256; 118 - 119 - return (temp * 1000 + 128) / 256; 120 - } 121 - 122 - static struct tmp421_data *tmp421_update_device(struct device *dev) 123 - { 124 - struct tmp421_data *data = dev_get_drvdata(dev); 125 118 struct i2c_client *client = data->client; 119 + int ret = 0; 126 120 int i; 127 121 128 122 mutex_lock(&data->update_lock); 129 123 130 124 if (time_after(jiffies, data->last_updated + (HZ / 2)) || 131 125 !data->valid) { 132 - data->config = i2c_smbus_read_byte_data(client, 133 - TMP421_CONFIG_REG_1); 126 + ret = i2c_smbus_read_byte_data(client, TMP421_CONFIG_REG_1); 127 + if (ret < 0) 128 + goto exit; 129 + data->config = ret; 134 130 135 131 for (i = 0; i < data->channels; i++) { 136 - data->temp[i] = i2c_smbus_read_byte_data(client, 137 - TMP421_TEMP_MSB[i]) << 8; 138 - data->temp[i] |= i2c_smbus_read_byte_data(client, 139 - TMP421_TEMP_LSB[i]); 132 + ret = i2c_smbus_read_byte_data(client, TMP421_TEMP_MSB[i]); 133 + if (ret < 0) 134 + goto exit; 135 + data->temp[i] = ret << 8; 136 + 137 + ret = i2c_smbus_read_byte_data(client, TMP421_TEMP_LSB[i]); 138 + if (ret < 0) 139 + goto exit; 140 + data->temp[i] |= ret; 140 141 } 141 142 data->last_updated = jiffies; 142 143 data->valid = 1; 143 144 } 144 145 146 + exit: 145 147 mutex_unlock(&data->update_lock); 146 148 147 - return data; 149 + if (ret < 0) { 150 + data->valid = 0; 151 + return ret; 152 + } 153 + 154 + return 0; 148 155 } 149 156 150 157 static int tmp421_read(struct device *dev, enum hwmon_sensor_types type, 151 158 u32 attr, int channel, long *val) 152 159 { 153 - struct tmp421_data *tmp421 = tmp421_update_device(dev); 160 + struct tmp421_data *tmp421 = dev_get_drvdata(dev); 161 + int ret = 0; 162 + 163 + ret = tmp421_update_device(tmp421); 164 + if (ret) 165 + return ret; 154 166 155 167 switch (attr) { 156 168 case hwmon_temp_input: 157 - if (tmp421->config & TMP421_CONFIG_RANGE) 158 - *val = temp_from_u16(tmp421->temp[channel]); 159 - else 160 - *val = temp_from_s16(tmp421->temp[channel]); 169 + *val = temp_from_raw(tmp421->temp[channel], 170 + tmp421->config & TMP421_CONFIG_RANGE); 161 171 return 0; 162 172 case hwmon_temp_fault: 163 173 /* 164 - * The OPEN bit signals a fault. This is bit 0 of the temperature 165 - * register (low byte). 174 + * Any of OPEN or /PVLD bits indicate a hardware mulfunction 175 + * and the conversion result may be incorrect 166 176 */ 167 - *val = tmp421->temp[channel] & 0x01; 177 + *val = !!(tmp421->temp[channel] & 0x03); 168 178 return 0; 169 179 default: 170 180 return -EOPNOTSUPP; ··· 187 177 { 188 178 switch (attr) { 189 179 case hwmon_temp_fault: 190 - if (channel == 0) 191 - return 0; 192 - return 0444; 193 180 case hwmon_temp_input: 194 181 return 0444; 195 182 default:
+11 -18
drivers/hwmon/w83791d.c
··· 273 273 char valid; /* !=0 if following fields are valid */ 274 274 unsigned long last_updated; /* In jiffies */ 275 275 276 - /* array of 2 pointers to subclients */ 277 - struct i2c_client *lm75[2]; 278 - 279 276 /* volts */ 280 277 u8 in[NUMBER_OF_VIN]; /* Register value */ 281 278 u8 in_max[NUMBER_OF_VIN]; /* Register value */ ··· 1254 1257 static int w83791d_detect_subclients(struct i2c_client *client) 1255 1258 { 1256 1259 struct i2c_adapter *adapter = client->adapter; 1257 - struct w83791d_data *data = i2c_get_clientdata(client); 1258 1260 int address = client->addr; 1259 1261 int i, id; 1260 1262 u8 val; ··· 1276 1280 } 1277 1281 1278 1282 val = w83791d_read(client, W83791D_REG_I2C_SUBADDR); 1279 - if (!(val & 0x08)) 1280 - data->lm75[0] = devm_i2c_new_dummy_device(&client->dev, adapter, 1281 - 0x48 + (val & 0x7)); 1282 - if (!(val & 0x80)) { 1283 - if (!IS_ERR(data->lm75[0]) && 1284 - ((val & 0x7) == ((val >> 4) & 0x7))) { 1285 - dev_err(&client->dev, 1286 - "duplicate addresses 0x%x, " 1287 - "use force_subclient\n", 1288 - data->lm75[0]->addr); 1289 - return -ENODEV; 1290 - } 1291 - data->lm75[1] = devm_i2c_new_dummy_device(&client->dev, adapter, 1292 - 0x48 + ((val >> 4) & 0x7)); 1283 + 1284 + if (!(val & 0x88) && (val & 0x7) == ((val >> 4) & 0x7)) { 1285 + dev_err(&client->dev, 1286 + "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (val & 0x7)); 1287 + return -ENODEV; 1293 1288 } 1289 + 1290 + if (!(val & 0x08)) 1291 + devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + (val & 0x7)); 1292 + 1293 + if (!(val & 0x80)) 1294 + devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + ((val >> 4) & 0x7)); 1294 1295 1295 1296 return 0; 1296 1297 }
+11 -17
drivers/hwmon/w83792d.c
··· 264 264 char valid; /* !=0 if following fields are valid */ 265 265 unsigned long last_updated; /* In jiffies */ 266 266 267 - /* array of 2 pointers to subclients */ 268 - struct i2c_client *lm75[2]; 269 - 270 267 u8 in[9]; /* Register value */ 271 268 u8 in_max[9]; /* Register value */ 272 269 u8 in_min[9]; /* Register value */ ··· 924 927 int address = new_client->addr; 925 928 u8 val; 926 929 struct i2c_adapter *adapter = new_client->adapter; 927 - struct w83792d_data *data = i2c_get_clientdata(new_client); 928 930 929 931 id = i2c_adapter_id(adapter); 930 932 if (force_subclients[0] == id && force_subclients[1] == address) { ··· 942 946 } 943 947 944 948 val = w83792d_read_value(new_client, W83792D_REG_I2C_SUBADDR); 945 - if (!(val & 0x08)) 946 - data->lm75[0] = devm_i2c_new_dummy_device(&new_client->dev, adapter, 947 - 0x48 + (val & 0x7)); 948 - if (!(val & 0x80)) { 949 - if (!IS_ERR(data->lm75[0]) && 950 - ((val & 0x7) == ((val >> 4) & 0x7))) { 951 - dev_err(&new_client->dev, 952 - "duplicate addresses 0x%x, use force_subclient\n", 953 - data->lm75[0]->addr); 954 - return -ENODEV; 955 - } 956 - data->lm75[1] = devm_i2c_new_dummy_device(&new_client->dev, adapter, 957 - 0x48 + ((val >> 4) & 0x7)); 949 + 950 + if (!(val & 0x88) && (val & 0x7) == ((val >> 4) & 0x7)) { 951 + dev_err(&new_client->dev, 952 + "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (val & 0x7)); 953 + return -ENODEV; 958 954 } 955 + 956 + if (!(val & 0x08)) 957 + devm_i2c_new_dummy_device(&new_client->dev, adapter, 0x48 + (val & 0x7)); 958 + 959 + if (!(val & 0x80)) 960 + devm_i2c_new_dummy_device(&new_client->dev, adapter, 0x48 + ((val >> 4) & 0x7)); 959 961 960 962 return 0; 961 963 }
+11 -15
drivers/hwmon/w83793.c
··· 202 202 } 203 203 204 204 struct w83793_data { 205 - struct i2c_client *lm75[2]; 206 205 struct device *hwmon_dev; 207 206 struct mutex update_lock; 208 207 char valid; /* !=0 if following fields are valid */ ··· 1565 1566 int address = client->addr; 1566 1567 u8 tmp; 1567 1568 struct i2c_adapter *adapter = client->adapter; 1568 - struct w83793_data *data = i2c_get_clientdata(client); 1569 1569 1570 1570 id = i2c_adapter_id(adapter); 1571 1571 if (force_subclients[0] == id && force_subclients[1] == address) { ··· 1584 1586 } 1585 1587 1586 1588 tmp = w83793_read_value(client, W83793_REG_I2C_SUBADDR); 1587 - if (!(tmp & 0x08)) 1588 - data->lm75[0] = devm_i2c_new_dummy_device(&client->dev, adapter, 1589 - 0x48 + (tmp & 0x7)); 1590 - if (!(tmp & 0x80)) { 1591 - if (!IS_ERR(data->lm75[0]) 1592 - && ((tmp & 0x7) == ((tmp >> 4) & 0x7))) { 1593 - dev_err(&client->dev, 1594 - "duplicate addresses 0x%x, " 1595 - "use force_subclients\n", data->lm75[0]->addr); 1596 - return -ENODEV; 1597 - } 1598 - data->lm75[1] = devm_i2c_new_dummy_device(&client->dev, adapter, 1599 - 0x48 + ((tmp >> 4) & 0x7)); 1589 + 1590 + if (!(tmp & 0x88) && (tmp & 0x7) == ((tmp >> 4) & 0x7)) { 1591 + dev_err(&client->dev, 1592 + "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (tmp & 0x7)); 1593 + return -ENODEV; 1600 1594 } 1595 + 1596 + if (!(tmp & 0x08)) 1597 + devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + (tmp & 0x7)); 1598 + 1599 + if (!(tmp & 0x80)) 1600 + devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + ((tmp >> 4) & 0x7)); 1601 1601 1602 1602 return 0; 1603 1603 }
+19 -6
drivers/interconnect/qcom/sdm660.c
··· 44 44 #define NOC_PERM_MODE_BYPASS (1 << NOC_QOS_MODE_BYPASS) 45 45 46 46 #define NOC_QOS_PRIORITYn_ADDR(n) (0x8 + (n * 0x1000)) 47 - #define NOC_QOS_PRIORITY_MASK 0xf 47 + #define NOC_QOS_PRIORITY_P1_MASK 0xc 48 + #define NOC_QOS_PRIORITY_P0_MASK 0x3 48 49 #define NOC_QOS_PRIORITY_P1_SHIFT 0x2 49 - #define NOC_QOS_PRIORITY_P0_SHIFT 0x3 50 50 51 51 #define NOC_QOS_MODEn_ADDR(n) (0xc + (n * 0x1000)) 52 52 #define NOC_QOS_MODEn_MASK 0x3 ··· 171 171 { .id = "bus" }, 172 172 { .id = "bus_a" }, 173 173 { .id = "iface" }, 174 + }; 175 + 176 + static const struct clk_bulk_data bus_a2noc_clocks[] = { 177 + { .id = "bus" }, 178 + { .id = "bus_a" }, 179 + { .id = "ipa" }, 180 + { .id = "ufs_axi" }, 181 + { .id = "aggre2_ufs_axi" }, 182 + { .id = "aggre2_usb3_axi" }, 183 + { .id = "cfg_noc_usb2_axi" }, 174 184 }; 175 185 176 186 /** ··· 317 307 DEFINE_QNODE(slv_prng, SDM660_SLAVE_PRNG, 4, -1, 44, true, -1, 0, -1, 0); 318 308 DEFINE_QNODE(slv_spdm, SDM660_SLAVE_SPDM, 4, -1, 60, true, -1, 0, -1, 0); 319 309 DEFINE_QNODE(slv_qdss_cfg, SDM660_SLAVE_QDSS_CFG, 4, -1, 63, true, -1, 0, -1, 0); 320 - DEFINE_QNODE(slv_cnoc_mnoc_cfg, SDM660_SLAVE_BLSP_1, 4, -1, 66, true, -1, 0, -1, SDM660_MASTER_CNOC_MNOC_CFG); 310 + DEFINE_QNODE(slv_cnoc_mnoc_cfg, SDM660_SLAVE_CNOC_MNOC_CFG, 4, -1, 66, true, -1, 0, -1, SDM660_MASTER_CNOC_MNOC_CFG); 321 311 DEFINE_QNODE(slv_snoc_cfg, SDM660_SLAVE_SNOC_CFG, 4, -1, 70, true, -1, 0, -1, 0); 322 312 DEFINE_QNODE(slv_qm_cfg, SDM660_SLAVE_QM_CFG, 4, -1, 212, true, -1, 0, -1, 0); 323 313 DEFINE_QNODE(slv_clk_ctl, SDM660_SLAVE_CLK_CTL, 4, -1, 47, true, -1, 0, -1, 0); ··· 634 624 /* Must be updated one at a time, P1 first, P0 last */ 635 625 val = qos->areq_prio << NOC_QOS_PRIORITY_P1_SHIFT; 636 626 rc = regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port), 637 - NOC_QOS_PRIORITY_MASK, val); 627 + NOC_QOS_PRIORITY_P1_MASK, val); 638 628 if (rc) 639 629 return rc; 640 630 641 - val = qos->prio_level << NOC_QOS_PRIORITY_P0_SHIFT; 642 631 return regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port), 643 - NOC_QOS_PRIORITY_MASK, val); 632 + NOC_QOS_PRIORITY_P0_MASK, qos->prio_level); 644 633 } 645 634 646 635 static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw) ··· 819 810 qp->bus_clks = devm_kmemdup(dev, bus_mm_clocks, 820 811 sizeof(bus_mm_clocks), GFP_KERNEL); 821 812 qp->num_clks = ARRAY_SIZE(bus_mm_clocks); 813 + } else if (of_device_is_compatible(dev->of_node, "qcom,sdm660-a2noc")) { 814 + qp->bus_clks = devm_kmemdup(dev, bus_a2noc_clocks, 815 + sizeof(bus_a2noc_clocks), GFP_KERNEL); 816 + qp->num_clks = ARRAY_SIZE(bus_a2noc_clocks); 822 817 } else { 823 818 if (of_device_is_compatible(dev->of_node, "qcom,sdm660-bimc")) 824 819 qp->is_bimc_node = true;
+35 -21
drivers/iommu/apple-dart.c
··· 183 183 184 184 static struct platform_driver apple_dart_driver; 185 185 static const struct iommu_ops apple_dart_iommu_ops; 186 - static const struct iommu_flush_ops apple_dart_tlb_ops; 187 186 188 187 static struct apple_dart_domain *to_dart_domain(struct iommu_domain *dom) 189 188 { ··· 337 338 apple_dart_domain_flush_tlb(to_dart_domain(domain)); 338 339 } 339 340 340 - static void apple_dart_tlb_flush_all(void *cookie) 341 - { 342 - apple_dart_domain_flush_tlb(cookie); 343 - } 344 - 345 - static void apple_dart_tlb_flush_walk(unsigned long iova, size_t size, 346 - size_t granule, void *cookie) 347 - { 348 - apple_dart_domain_flush_tlb(cookie); 349 - } 350 - 351 - static const struct iommu_flush_ops apple_dart_tlb_ops = { 352 - .tlb_flush_all = apple_dart_tlb_flush_all, 353 - .tlb_flush_walk = apple_dart_tlb_flush_walk, 354 - }; 355 - 356 341 static phys_addr_t apple_dart_iova_to_phys(struct iommu_domain *domain, 357 342 dma_addr_t iova) 358 343 { ··· 418 435 .ias = 32, 419 436 .oas = 36, 420 437 .coherent_walk = 1, 421 - .tlb = &apple_dart_tlb_ops, 422 438 .iommu_dev = dart->dev, 423 439 }; 424 440 ··· 643 661 return -EINVAL; 644 662 } 645 663 664 + static DEFINE_MUTEX(apple_dart_groups_lock); 665 + 666 + static void apple_dart_release_group(void *iommu_data) 667 + { 668 + int i, sid; 669 + struct apple_dart_stream_map *stream_map; 670 + struct apple_dart_master_cfg *group_master_cfg = iommu_data; 671 + 672 + mutex_lock(&apple_dart_groups_lock); 673 + 674 + for_each_stream_map(i, group_master_cfg, stream_map) 675 + for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) 676 + stream_map->dart->sid2group[sid] = NULL; 677 + 678 + kfree(iommu_data); 679 + mutex_unlock(&apple_dart_groups_lock); 680 + } 681 + 646 682 static struct iommu_group *apple_dart_device_group(struct device *dev) 647 683 { 648 - static DEFINE_MUTEX(lock); 649 684 int i, sid; 650 685 struct apple_dart_master_cfg *cfg = dev_iommu_priv_get(dev); 651 686 struct apple_dart_stream_map *stream_map; 687 + struct apple_dart_master_cfg *group_master_cfg; 652 688 struct iommu_group *group = NULL; 653 689 struct iommu_group *res = ERR_PTR(-EINVAL); 654 690 655 - mutex_lock(&lock); 691 + mutex_lock(&apple_dart_groups_lock); 656 692 657 693 for_each_stream_map(i, cfg, stream_map) { 658 694 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) { ··· 698 698 #endif 699 699 group = generic_device_group(dev); 700 700 701 + res = ERR_PTR(-ENOMEM); 702 + if (!group) 703 + goto out; 704 + 705 + group_master_cfg = kzalloc(sizeof(*group_master_cfg), GFP_KERNEL); 706 + if (!group_master_cfg) { 707 + iommu_group_put(group); 708 + goto out; 709 + } 710 + 711 + memcpy(group_master_cfg, cfg, sizeof(*group_master_cfg)); 712 + iommu_group_set_iommudata(group, group_master_cfg, 713 + apple_dart_release_group); 714 + 701 715 for_each_stream_map(i, cfg, stream_map) 702 716 for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) 703 717 stream_map->dart->sid2group[sid] = group; ··· 719 705 res = group; 720 706 721 707 out: 722 - mutex_unlock(&lock); 708 + mutex_unlock(&apple_dart_groups_lock); 723 709 return res; 724 710 } 725 711
+3 -3
drivers/iommu/intel/dmar.c
··· 1942 1942 reason = dmar_get_fault_reason(fault_reason, &fault_type); 1943 1943 1944 1944 if (fault_type == INTR_REMAP) 1945 - pr_err("[INTR-REMAP] Request device [0x%02x:0x%02x.%d] fault index 0x%llx [fault reason 0x%02x] %s\n", 1945 + pr_err("[INTR-REMAP] Request device [%02x:%02x.%d] fault index 0x%llx [fault reason 0x%02x] %s\n", 1946 1946 source_id >> 8, PCI_SLOT(source_id & 0xFF), 1947 1947 PCI_FUNC(source_id & 0xFF), addr >> 48, 1948 1948 fault_reason, reason); 1949 1949 else if (pasid == INVALID_IOASID) 1950 - pr_err("[%s NO_PASID] Request device [0x%02x:0x%02x.%d] fault addr 0x%llx [fault reason 0x%02x] %s\n", 1950 + pr_err("[%s NO_PASID] Request device [%02x:%02x.%d] fault addr 0x%llx [fault reason 0x%02x] %s\n", 1951 1951 type ? "DMA Read" : "DMA Write", 1952 1952 source_id >> 8, PCI_SLOT(source_id & 0xFF), 1953 1953 PCI_FUNC(source_id & 0xFF), addr, 1954 1954 fault_reason, reason); 1955 1955 else 1956 - pr_err("[%s PASID 0x%x] Request device [0x%02x:0x%02x.%d] fault addr 0x%llx [fault reason 0x%02x] %s\n", 1956 + pr_err("[%s PASID 0x%x] Request device [%02x:%02x.%d] fault addr 0x%llx [fault reason 0x%02x] %s\n", 1957 1957 type ? "DMA Read" : "DMA Write", pasid, 1958 1958 source_id >> 8, PCI_SLOT(source_id & 0xFF), 1959 1959 PCI_FUNC(source_id & 0xFF), addr,
+47 -16
drivers/ipack/devices/ipoctal.c
··· 33 33 unsigned int pointer_read; 34 34 unsigned int pointer_write; 35 35 struct tty_port tty_port; 36 + bool tty_registered; 36 37 union scc2698_channel __iomem *regs; 37 38 union scc2698_block __iomem *block_regs; 38 39 unsigned int board_id; ··· 82 81 return 0; 83 82 } 84 83 85 - static int ipoctal_open(struct tty_struct *tty, struct file *file) 84 + static int ipoctal_install(struct tty_driver *driver, struct tty_struct *tty) 86 85 { 87 86 struct ipoctal_channel *channel = dev_get_drvdata(tty->dev); 88 87 struct ipoctal *ipoctal = chan_to_ipoctal(channel, tty->index); 89 - int err; 90 - 91 - tty->driver_data = channel; 88 + int res; 92 89 93 90 if (!ipack_get_carrier(ipoctal->dev)) 94 91 return -EBUSY; 95 92 96 - err = tty_port_open(&channel->tty_port, tty, file); 97 - if (err) 98 - ipack_put_carrier(ipoctal->dev); 93 + res = tty_standard_install(driver, tty); 94 + if (res) 95 + goto err_put_carrier; 99 96 100 - return err; 97 + tty->driver_data = channel; 98 + 99 + return 0; 100 + 101 + err_put_carrier: 102 + ipack_put_carrier(ipoctal->dev); 103 + 104 + return res; 105 + } 106 + 107 + static int ipoctal_open(struct tty_struct *tty, struct file *file) 108 + { 109 + struct ipoctal_channel *channel = tty->driver_data; 110 + 111 + return tty_port_open(&channel->tty_port, tty, file); 101 112 } 102 113 103 114 static void ipoctal_reset_stats(struct ipoctal_stats *stats) ··· 277 264 int res; 278 265 int i; 279 266 struct tty_driver *tty; 280 - char name[20]; 281 267 struct ipoctal_channel *channel; 282 268 struct ipack_region *region; 283 269 void __iomem *addr; ··· 367 355 /* Fill struct tty_driver with ipoctal data */ 368 356 tty->owner = THIS_MODULE; 369 357 tty->driver_name = KBUILD_MODNAME; 370 - sprintf(name, KBUILD_MODNAME ".%d.%d.", bus_nr, slot); 371 - tty->name = name; 358 + tty->name = kasprintf(GFP_KERNEL, KBUILD_MODNAME ".%d.%d.", bus_nr, slot); 359 + if (!tty->name) { 360 + res = -ENOMEM; 361 + goto err_put_driver; 362 + } 372 363 tty->major = 0; 373 364 374 365 tty->minor_start = 0; ··· 386 371 res = tty_register_driver(tty); 387 372 if (res) { 388 373 dev_err(&ipoctal->dev->dev, "Can't register tty driver.\n"); 389 - tty_driver_kref_put(tty); 390 - return res; 374 + goto err_free_name; 391 375 } 392 376 393 377 /* Save struct tty_driver for use it when uninstalling the device */ ··· 397 383 398 384 channel = &ipoctal->channel[i]; 399 385 tty_port_init(&channel->tty_port); 400 - tty_port_alloc_xmit_buf(&channel->tty_port); 386 + res = tty_port_alloc_xmit_buf(&channel->tty_port); 387 + if (res) 388 + continue; 401 389 channel->tty_port.ops = &ipoctal_tty_port_ops; 402 390 403 391 ipoctal_reset_stats(&channel->stats); ··· 407 391 spin_lock_init(&channel->lock); 408 392 channel->pointer_read = 0; 409 393 channel->pointer_write = 0; 410 - tty_dev = tty_port_register_device(&channel->tty_port, tty, i, NULL); 394 + tty_dev = tty_port_register_device_attr(&channel->tty_port, tty, 395 + i, NULL, channel, NULL); 411 396 if (IS_ERR(tty_dev)) { 412 397 dev_err(&ipoctal->dev->dev, "Failed to register tty device.\n"); 398 + tty_port_free_xmit_buf(&channel->tty_port); 413 399 tty_port_destroy(&channel->tty_port); 414 400 continue; 415 401 } 416 - dev_set_drvdata(tty_dev, channel); 402 + channel->tty_registered = true; 417 403 } 418 404 419 405 /* ··· 427 409 ipoctal_irq_handler, ipoctal); 428 410 429 411 return 0; 412 + 413 + err_free_name: 414 + kfree(tty->name); 415 + err_put_driver: 416 + tty_driver_kref_put(tty); 417 + 418 + return res; 430 419 } 431 420 432 421 static inline int ipoctal_copy_write_buffer(struct ipoctal_channel *channel, ··· 673 648 674 649 static const struct tty_operations ipoctal_fops = { 675 650 .ioctl = NULL, 651 + .install = ipoctal_install, 676 652 .open = ipoctal_open, 677 653 .close = ipoctal_close, 678 654 .write = ipoctal_write_tty, ··· 716 690 717 691 for (i = 0; i < NR_CHANNELS; i++) { 718 692 struct ipoctal_channel *channel = &ipoctal->channel[i]; 693 + 694 + if (!channel->tty_registered) 695 + continue; 696 + 719 697 tty_unregister_device(ipoctal->tty_drv, i); 720 698 tty_port_free_xmit_buf(&channel->tty_port); 721 699 tty_port_destroy(&channel->tty_port); 722 700 } 723 701 724 702 tty_unregister_driver(ipoctal->tty_drv); 703 + kfree(ipoctal->tty_drv->name); 725 704 tty_driver_kref_put(ipoctal->tty_drv); 726 705 kfree(ipoctal); 727 706 }
+1 -1
drivers/net/ethernet/google/gve/gve.h
··· 779 779 gve_num_tx_qpls(priv)); 780 780 781 781 /* we are out of rx qpls */ 782 - if (id == priv->qpl_cfg.qpl_map_size) 782 + if (id == gve_num_tx_qpls(priv) + gve_num_rx_qpls(priv)) 783 783 return NULL; 784 784 785 785 set_bit(id, priv->qpl_cfg.qpl_id_map);
+29 -16
drivers/net/ethernet/google/gve/gve_main.c
··· 41 41 { 42 42 struct gve_priv *priv = netdev_priv(dev); 43 43 unsigned int start; 44 + u64 packets, bytes; 44 45 int ring; 45 46 46 47 if (priv->rx) { ··· 49 48 do { 50 49 start = 51 50 u64_stats_fetch_begin(&priv->rx[ring].statss); 52 - s->rx_packets += priv->rx[ring].rpackets; 53 - s->rx_bytes += priv->rx[ring].rbytes; 51 + packets = priv->rx[ring].rpackets; 52 + bytes = priv->rx[ring].rbytes; 54 53 } while (u64_stats_fetch_retry(&priv->rx[ring].statss, 55 54 start)); 55 + s->rx_packets += packets; 56 + s->rx_bytes += bytes; 56 57 } 57 58 } 58 59 if (priv->tx) { ··· 62 59 do { 63 60 start = 64 61 u64_stats_fetch_begin(&priv->tx[ring].statss); 65 - s->tx_packets += priv->tx[ring].pkt_done; 66 - s->tx_bytes += priv->tx[ring].bytes_done; 62 + packets = priv->tx[ring].pkt_done; 63 + bytes = priv->tx[ring].bytes_done; 67 64 } while (u64_stats_fetch_retry(&priv->tx[ring].statss, 68 65 start)); 66 + s->tx_packets += packets; 67 + s->tx_bytes += bytes; 69 68 } 70 69 } 71 70 } ··· 87 82 88 83 static void gve_free_counter_array(struct gve_priv *priv) 89 84 { 85 + if (!priv->counter_array) 86 + return; 87 + 90 88 dma_free_coherent(&priv->pdev->dev, 91 89 priv->num_event_counters * 92 90 sizeof(*priv->counter_array), ··· 150 142 151 143 static void gve_free_stats_report(struct gve_priv *priv) 152 144 { 145 + if (!priv->stats_report) 146 + return; 147 + 153 148 del_timer_sync(&priv->stats_report_timer); 154 149 dma_free_coherent(&priv->pdev->dev, priv->stats_report_len, 155 150 priv->stats_report, priv->stats_report_bus); ··· 381 370 { 382 371 int i; 383 372 384 - if (priv->msix_vectors) { 385 - /* Free the irqs */ 386 - for (i = 0; i < priv->num_ntfy_blks; i++) { 387 - struct gve_notify_block *block = &priv->ntfy_blocks[i]; 388 - int msix_idx = i; 373 + if (!priv->msix_vectors) 374 + return; 389 375 390 - irq_set_affinity_hint(priv->msix_vectors[msix_idx].vector, 391 - NULL); 392 - free_irq(priv->msix_vectors[msix_idx].vector, block); 393 - } 394 - free_irq(priv->msix_vectors[priv->mgmt_msix_idx].vector, priv); 376 + /* Free the irqs */ 377 + for (i = 0; i < priv->num_ntfy_blks; i++) { 378 + struct gve_notify_block *block = &priv->ntfy_blocks[i]; 379 + int msix_idx = i; 380 + 381 + irq_set_affinity_hint(priv->msix_vectors[msix_idx].vector, 382 + NULL); 383 + free_irq(priv->msix_vectors[msix_idx].vector, block); 395 384 } 385 + free_irq(priv->msix_vectors[priv->mgmt_msix_idx].vector, priv); 396 386 dma_free_coherent(&priv->pdev->dev, 397 387 priv->num_ntfy_blks * sizeof(*priv->ntfy_blocks), 398 388 priv->ntfy_blocks, priv->ntfy_block_bus); ··· 1196 1184 1197 1185 void gve_handle_report_stats(struct gve_priv *priv) 1198 1186 { 1199 - int idx, stats_idx = 0, tx_bytes; 1200 - unsigned int start = 0; 1201 1187 struct stats *stats = priv->stats_report->stats; 1188 + int idx, stats_idx = 0; 1189 + unsigned int start = 0; 1190 + u64 tx_bytes; 1202 1191 1203 1192 if (!gve_get_report_stats(priv)) 1204 1193 return;
+7 -1
drivers/net/ethernet/google/gve/gve_rx.c
··· 104 104 if (!rx->data.page_info) 105 105 return -ENOMEM; 106 106 107 - if (!rx->data.raw_addressing) 107 + if (!rx->data.raw_addressing) { 108 108 rx->data.qpl = gve_assign_rx_qpl(priv); 109 + if (!rx->data.qpl) { 110 + kvfree(rx->data.page_info); 111 + rx->data.page_info = NULL; 112 + return -ENOMEM; 113 + } 114 + } 109 115 for (i = 0; i < slots; i++) { 110 116 if (!rx->data.raw_addressing) { 111 117 struct page *page = rx->data.qpl->pages[i];
+3 -2
drivers/net/ethernet/intel/i40e/i40e_main.c
··· 4871 4871 { 4872 4872 int i; 4873 4873 4874 - i40e_free_misc_vector(pf); 4874 + if (test_bit(__I40E_MISC_IRQ_REQUESTED, pf->state)) 4875 + i40e_free_misc_vector(pf); 4875 4876 4876 4877 i40e_put_lump(pf->irq_pile, pf->iwarp_base_vector, 4877 4878 I40E_IWARP_IRQ_PILE_ID); ··· 10114 10113 if (pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOMEM) { 10115 10114 /* retry with a larger buffer */ 10116 10115 buf_len = data_size; 10117 - } else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK) { 10116 + } else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK || err) { 10118 10117 dev_info(&pf->pdev->dev, 10119 10118 "capability discovery failed, err %s aq_err %s\n", 10120 10119 i40e_stat_str(&pf->hw, err),
-1
drivers/net/ethernet/intel/iavf/iavf_main.c
··· 1965 1965 } 1966 1966 adapter->aq_required = 0; 1967 1967 adapter->current_op = VIRTCHNL_OP_UNKNOWN; 1968 - mutex_unlock(&adapter->crit_lock); 1969 1968 queue_delayed_work(iavf_wq, 1970 1969 &adapter->watchdog_task, 1971 1970 msecs_to_jiffies(10));
+2 -2
drivers/net/ethernet/mscc/ocelot_vcap.c
··· 998 998 } 999 999 1000 1000 struct ocelot_vcap_filter * 1001 - ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block, int cookie, 1002 - bool tc_offload) 1001 + ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block, 1002 + unsigned long cookie, bool tc_offload) 1003 1003 { 1004 1004 struct ocelot_vcap_filter *filter; 1005 1005
+3 -1
drivers/net/ethernet/pensando/ionic/ionic_lif.c
··· 1293 1293 if (err && err != -EEXIST) { 1294 1294 /* set the state back to NEW so we can try again later */ 1295 1295 f = ionic_rx_filter_by_addr(lif, addr); 1296 - if (f && f->state == IONIC_FILTER_STATE_SYNCED) 1296 + if (f && f->state == IONIC_FILTER_STATE_SYNCED) { 1297 1297 f->state = IONIC_FILTER_STATE_NEW; 1298 + set_bit(IONIC_LIF_F_FILTER_SYNC_NEEDED, lif->state); 1299 + } 1298 1300 1299 1301 spin_unlock_bh(&lif->rx_filters.lock); 1300 1302
-3
drivers/net/ethernet/pensando/ionic/ionic_rx_filter.c
··· 349 349 list_for_each_entry_safe(sync_item, spos, &sync_add_list, list) { 350 350 (void)ionic_lif_addr_add(lif, sync_item->f.cmd.mac.addr); 351 351 352 - if (sync_item->f.state != IONIC_FILTER_STATE_SYNCED) 353 - set_bit(IONIC_LIF_F_FILTER_SYNC_NEEDED, lif->state); 354 - 355 352 list_del(&sync_item->list); 356 353 devm_kfree(dev, sync_item); 357 354 }
+5
drivers/net/ethernet/stmicro/stmmac/dwmac-rk.c
··· 21 21 #include <linux/delay.h> 22 22 #include <linux/mfd/syscon.h> 23 23 #include <linux/regmap.h> 24 + #include <linux/pm_runtime.h> 24 25 25 26 #include "stmmac_platform.h" 26 27 ··· 1529 1528 return ret; 1530 1529 } 1531 1530 1531 + pm_runtime_get_sync(dev); 1532 + 1532 1533 if (bsp_priv->integrated_phy) 1533 1534 rk_gmac_integrated_phy_powerup(bsp_priv); 1534 1535 ··· 1541 1538 { 1542 1539 if (gmac->integrated_phy) 1543 1540 rk_gmac_integrated_phy_powerdown(gmac); 1541 + 1542 + pm_runtime_put_sync(&gmac->pdev->dev); 1544 1543 1545 1544 phy_power_on(gmac, false); 1546 1545 gmac_clk_enable(gmac, false);
+5 -1
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c
··· 477 477 stmmac_lpi_entry_timer_config(priv, 0); 478 478 del_timer_sync(&priv->eee_ctrl_timer); 479 479 stmmac_set_eee_timer(priv, priv->hw, 0, eee_tw_timer); 480 + if (priv->hw->xpcs) 481 + xpcs_config_eee(priv->hw->xpcs, 482 + priv->plat->mult_fact_100ns, 483 + false); 480 484 } 481 485 mutex_unlock(&priv->lock); 482 486 return false; ··· 1042 1038 stmmac_mac_set(priv, priv->ioaddr, false); 1043 1039 priv->eee_active = false; 1044 1040 priv->tx_lpi_enabled = false; 1045 - stmmac_eee_init(priv); 1041 + priv->eee_enabled = stmmac_eee_init(priv); 1046 1042 stmmac_set_eee_pls(priv, priv->hw, false); 1047 1043 1048 1044 if (priv->dma_cap.fpesel)
+36 -9
drivers/net/pcs/pcs-xpcs.c
··· 666 666 { 667 667 int ret; 668 668 669 + ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL0); 670 + if (ret < 0) 671 + return ret; 672 + 669 673 if (enable) { 670 674 /* Enable EEE */ 671 675 ret = DW_VR_MII_EEE_LTX_EN | DW_VR_MII_EEE_LRX_EN | ··· 677 673 DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL | 678 674 mult_fact_100ns << DW_VR_MII_EEE_MULT_FACT_100NS_SHIFT; 679 675 } else { 680 - ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL0); 681 - if (ret < 0) 682 - return ret; 683 676 ret &= ~(DW_VR_MII_EEE_LTX_EN | DW_VR_MII_EEE_LRX_EN | 684 677 DW_VR_MII_EEE_TX_QUIET_EN | DW_VR_MII_EEE_RX_QUIET_EN | 685 678 DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL | ··· 691 690 if (ret < 0) 692 691 return ret; 693 692 694 - ret |= DW_VR_MII_EEE_TRN_LPI; 693 + if (enable) 694 + ret |= DW_VR_MII_EEE_TRN_LPI; 695 + else 696 + ret &= ~DW_VR_MII_EEE_TRN_LPI; 697 + 695 698 return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL1, ret); 696 699 } 697 700 EXPORT_SYMBOL_GPL(xpcs_config_eee); 698 701 699 702 static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, unsigned int mode) 700 703 { 701 - int ret; 704 + int ret, mdio_ctrl; 702 705 703 706 /* For AN for C37 SGMII mode, the settings are :- 704 - * 1) VR_MII_AN_CTRL Bit(2:1)[PCS_MODE] = 10b (SGMII AN) 705 - * 2) VR_MII_AN_CTRL Bit(3) [TX_CONFIG] = 0b (MAC side SGMII) 707 + * 1) VR_MII_MMD_CTRL Bit(12) [AN_ENABLE] = 0b (Disable SGMII AN in case 708 + it is already enabled) 709 + * 2) VR_MII_AN_CTRL Bit(2:1)[PCS_MODE] = 10b (SGMII AN) 710 + * 3) VR_MII_AN_CTRL Bit(3) [TX_CONFIG] = 0b (MAC side SGMII) 706 711 * DW xPCS used with DW EQoS MAC is always MAC side SGMII. 707 - * 3) VR_MII_DIG_CTRL1 Bit(9) [MAC_AUTO_SW] = 1b (Automatic 712 + * 4) VR_MII_DIG_CTRL1 Bit(9) [MAC_AUTO_SW] = 1b (Automatic 708 713 * speed/duplex mode change by HW after SGMII AN complete) 714 + * 5) VR_MII_MMD_CTRL Bit(12) [AN_ENABLE] = 1b (Enable SGMII AN) 709 715 * 710 716 * Note: Since it is MAC side SGMII, there is no need to set 711 717 * SR_MII_AN_ADV. MAC side SGMII receives AN Tx Config from ··· 720 712 * between PHY and Link Partner. There is also no need to 721 713 * trigger AN restart for MAC-side SGMII. 722 714 */ 715 + mdio_ctrl = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL); 716 + if (mdio_ctrl < 0) 717 + return mdio_ctrl; 718 + 719 + if (mdio_ctrl & AN_CL37_EN) { 720 + ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL, 721 + mdio_ctrl & ~AN_CL37_EN); 722 + if (ret < 0) 723 + return ret; 724 + } 725 + 723 726 ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL); 724 727 if (ret < 0) 725 728 return ret; ··· 755 736 else 756 737 ret &= ~DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW; 757 738 758 - return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1, ret); 739 + ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1, ret); 740 + if (ret < 0) 741 + return ret; 742 + 743 + if (phylink_autoneg_inband(mode)) 744 + ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL, 745 + mdio_ctrl | AN_CL37_EN); 746 + 747 + return ret; 759 748 } 760 749 761 750 static int xpcs_config_2500basex(struct dw_xpcs *xpcs)
+11 -1
drivers/net/phy/mdio_bus.c
··· 525 525 NULL == bus->read || NULL == bus->write) 526 526 return -EINVAL; 527 527 528 + if (bus->parent && bus->parent->of_node) 529 + bus->parent->of_node->fwnode.flags |= 530 + FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD; 531 + 528 532 BUG_ON(bus->state != MDIOBUS_ALLOCATED && 529 533 bus->state != MDIOBUS_UNREGISTERED); 530 534 ··· 538 534 bus->dev.groups = NULL; 539 535 dev_set_name(&bus->dev, "%s", bus->id); 540 536 537 + /* We need to set state to MDIOBUS_UNREGISTERED to correctly release 538 + * the device in mdiobus_free() 539 + * 540 + * State will be updated later in this function in case of success 541 + */ 542 + bus->state = MDIOBUS_UNREGISTERED; 543 + 541 544 err = device_register(&bus->dev); 542 545 if (err) { 543 546 pr_err("mii_bus %s failed to register\n", bus->id); 544 - put_device(&bus->dev); 545 547 return -EINVAL; 546 548 } 547 549
+1 -1
drivers/net/phy/sfp.c
··· 134 134 [SFP_S_LINK_UP] = "link_up", 135 135 [SFP_S_TX_FAULT] = "tx_fault", 136 136 [SFP_S_REINIT] = "reinit", 137 - [SFP_S_TX_DISABLE] = "rx_disable", 137 + [SFP_S_TX_DISABLE] = "tx_disable", 138 138 }; 139 139 140 140 static const char *sm_state_to_str(unsigned short sm_state)
+15 -1
drivers/net/usb/r8152.c
··· 767 767 PHY_RESET, 768 768 SCHEDULE_TASKLET, 769 769 GREEN_ETHERNET, 770 + RX_EPROTO, 770 771 }; 771 772 772 773 #define DEVICE_ID_THINKPAD_THUNDERBOLT3_DOCK_GEN2 0x3082 ··· 1771 1770 rtl_set_unplug(tp); 1772 1771 netif_device_detach(tp->netdev); 1773 1772 return; 1773 + case -EPROTO: 1774 + urb->actual_length = 0; 1775 + spin_lock_irqsave(&tp->rx_lock, flags); 1776 + list_add_tail(&agg->list, &tp->rx_done); 1777 + spin_unlock_irqrestore(&tp->rx_lock, flags); 1778 + set_bit(RX_EPROTO, &tp->flags); 1779 + schedule_delayed_work(&tp->schedule, 1); 1780 + return; 1774 1781 case -ENOENT: 1775 1782 return; /* the urb is in unlink state */ 1776 1783 case -ETIME: ··· 2434 2425 if (list_empty(&tp->rx_done)) 2435 2426 goto out1; 2436 2427 2428 + clear_bit(RX_EPROTO, &tp->flags); 2437 2429 INIT_LIST_HEAD(&rx_queue); 2438 2430 spin_lock_irqsave(&tp->rx_lock, flags); 2439 2431 list_splice_init(&tp->rx_done, &rx_queue); ··· 2451 2441 2452 2442 agg = list_entry(cursor, struct rx_agg, list); 2453 2443 urb = agg->urb; 2454 - if (urb->actual_length < ETH_ZLEN) 2444 + if (urb->status != 0 || urb->actual_length < ETH_ZLEN) 2455 2445 goto submit; 2456 2446 2457 2447 agg_free = rtl_get_free_rx(tp, GFP_ATOMIC); ··· 6652 6642 if (test_and_clear_bit(SCHEDULE_TASKLET, &tp->flags) && 6653 6643 netif_carrier_ok(tp->netdev)) 6654 6644 tasklet_schedule(&tp->tx_tl); 6645 + 6646 + if (test_and_clear_bit(RX_EPROTO, &tp->flags) && 6647 + !list_empty(&tp->rx_done)) 6648 + napi_schedule(&tp->napi); 6655 6649 6656 6650 mutex_unlock(&tp->control); 6657 6651
+1 -3
drivers/net/wireless/ath/ath5k/Kconfig
··· 3 3 tristate "Atheros 5xxx wireless cards support" 4 4 depends on (PCI || ATH25) && MAC80211 5 5 select ATH_COMMON 6 - select MAC80211_LEDS 7 - select LEDS_CLASS 8 - select NEW_LEDS 6 + select MAC80211_LEDS if LEDS_CLASS=y || LEDS_CLASS=MAC80211 9 7 select ATH5K_AHB if ATH25 10 8 select ATH5K_PCI if !ATH25 11 9 help
+6 -4
drivers/net/wireless/ath/ath5k/led.c
··· 89 89 90 90 void ath5k_led_enable(struct ath5k_hw *ah) 91 91 { 92 - if (test_bit(ATH_STAT_LEDSOFT, ah->status)) { 92 + if (IS_ENABLED(CONFIG_MAC80211_LEDS) && 93 + test_bit(ATH_STAT_LEDSOFT, ah->status)) { 93 94 ath5k_hw_set_gpio_output(ah, ah->led_pin); 94 95 ath5k_led_off(ah); 95 96 } ··· 105 104 106 105 void ath5k_led_off(struct ath5k_hw *ah) 107 106 { 108 - if (!test_bit(ATH_STAT_LEDSOFT, ah->status)) 107 + if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || 108 + !test_bit(ATH_STAT_LEDSOFT, ah->status)) 109 109 return; 110 110 ath5k_hw_set_gpio(ah, ah->led_pin, !ah->led_on); 111 111 } ··· 148 146 static void 149 147 ath5k_unregister_led(struct ath5k_led *led) 150 148 { 151 - if (!led->ah) 149 + if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !led->ah) 152 150 return; 153 151 led_classdev_unregister(&led->led_dev); 154 152 ath5k_led_off(led->ah); ··· 171 169 char name[ATH5K_LED_MAX_NAME_LEN + 1]; 172 170 const struct pci_device_id *match; 173 171 174 - if (!ah->pdev) 172 + if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !ah->pdev) 175 173 return 0; 176 174 177 175 #ifdef CONFIG_ATH5K_AHB
+6 -11
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c
··· 7463 7463 s32 found_index; 7464 7464 int i; 7465 7465 7466 + country_codes = drvr->settings->country_codes; 7467 + if (!country_codes) { 7468 + brcmf_dbg(TRACE, "No country codes configured for device\n"); 7469 + return -EINVAL; 7470 + } 7471 + 7466 7472 if ((alpha2[0] == ccreq->country_abbrev[0]) && 7467 7473 (alpha2[1] == ccreq->country_abbrev[1])) { 7468 7474 brcmf_dbg(TRACE, "Country code already set\n"); 7469 7475 return -EAGAIN; 7470 - } 7471 - 7472 - country_codes = drvr->settings->country_codes; 7473 - if (!country_codes) { 7474 - brcmf_dbg(TRACE, "No country codes configured for device, using ISO3166 code and 0 rev\n"); 7475 - memset(ccreq, 0, sizeof(*ccreq)); 7476 - ccreq->country_abbrev[0] = alpha2[0]; 7477 - ccreq->country_abbrev[1] = alpha2[1]; 7478 - ccreq->ccode[0] = alpha2[0]; 7479 - ccreq->ccode[1] = alpha2[1]; 7480 - return 0; 7481 7476 } 7482 7477 7483 7478 found_index = -1;
+3 -2
drivers/net/wireless/intel/iwlwifi/mvm/d3.c
··· 160 160 mvm->ptk_icvlen = key->icv_len; 161 161 mvm->gtk_ivlen = key->iv_len; 162 162 mvm->gtk_icvlen = key->icv_len; 163 + mutex_unlock(&mvm->mutex); 163 164 164 165 /* don't upload key again */ 165 166 return; ··· 361 360 if (sta) { 362 361 rsc = data->rsc->ucast_rsc; 363 362 } else { 364 - if (WARN_ON(data->gtks > ARRAY_SIZE(data->gtk_ids))) 363 + if (WARN_ON(data->gtks >= ARRAY_SIZE(data->gtk_ids))) 365 364 return; 366 365 data->gtk_ids[data->gtks] = key->keyidx; 367 366 rsc = data->rsc->mcast_rsc[data->gtks % 2]; 368 - if (WARN_ON(key->keyidx > 367 + if (WARN_ON(key->keyidx >= 369 368 ARRAY_SIZE(data->rsc->mcast_key_id_map))) 370 369 return; 371 370 data->rsc->mcast_key_id_map[key->keyidx] = data->gtks % 2;
+2 -1
drivers/net/wireless/intel/iwlwifi/mvm/time-event.c
··· 662 662 u32 *uid) 663 663 { 664 664 u32 id; 665 - struct iwl_mvm_vif *mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif); 665 + struct iwl_mvm_vif *mvmvif; 666 666 enum nl80211_iftype iftype; 667 667 668 668 if (!te_data->vif) 669 669 return false; 670 670 671 + mvmvif = iwl_mvm_vif_from_mac80211(te_data->vif); 671 672 iftype = te_data->vif->type; 672 673 673 674 /*
+2
drivers/net/wireless/intel/iwlwifi/pcie/drv.c
··· 547 547 IWL_DEV_INFO(0x43F0, 0x0074, iwl_ax201_cfg_qu_hr, NULL), 548 548 IWL_DEV_INFO(0x43F0, 0x0078, iwl_ax201_cfg_qu_hr, NULL), 549 549 IWL_DEV_INFO(0x43F0, 0x007C, iwl_ax201_cfg_qu_hr, NULL), 550 + IWL_DEV_INFO(0x43F0, 0x1651, killer1650s_2ax_cfg_qu_b0_hr_b0, iwl_ax201_killer_1650s_name), 551 + IWL_DEV_INFO(0x43F0, 0x1652, killer1650i_2ax_cfg_qu_b0_hr_b0, iwl_ax201_killer_1650i_name), 550 552 IWL_DEV_INFO(0x43F0, 0x2074, iwl_ax201_cfg_qu_hr, NULL), 551 553 IWL_DEV_INFO(0x43F0, 0x4070, iwl_ax201_cfg_qu_hr, NULL), 552 554 IWL_DEV_INFO(0xA0F0, 0x0070, iwl_ax201_cfg_qu_hr, NULL),
+2 -2
drivers/net/wireless/marvell/mwifiex/sta_tx.c
··· 62 62 63 63 pkt_type = mwifiex_is_skb_mgmt_frame(skb) ? PKT_TYPE_MGMT : 0; 64 64 65 - pad = ((void *)skb->data - (sizeof(*local_tx_pd) + hroom)- 66 - NULL) & (MWIFIEX_DMA_ALIGN_SZ - 1); 65 + pad = ((uintptr_t)skb->data - (sizeof(*local_tx_pd) + hroom)) & 66 + (MWIFIEX_DMA_ALIGN_SZ - 1); 67 67 skb_push(skb, sizeof(*local_tx_pd) + pad); 68 68 69 69 local_tx_pd = (struct txpd *) skb->data;
+2 -2
drivers/net/wireless/marvell/mwifiex/uap_txrx.c
··· 475 475 476 476 pkt_type = mwifiex_is_skb_mgmt_frame(skb) ? PKT_TYPE_MGMT : 0; 477 477 478 - pad = ((void *)skb->data - (sizeof(*txpd) + hroom) - NULL) & 479 - (MWIFIEX_DMA_ALIGN_SZ - 1); 478 + pad = ((uintptr_t)skb->data - (sizeof(*txpd) + hroom)) & 479 + (MWIFIEX_DMA_ALIGN_SZ - 1); 480 480 481 481 skb_push(skb, sizeof(*txpd) + pad); 482 482
+1 -4
drivers/nvdimm/pmem.c
··· 380 380 struct nd_pfn_sb *pfn_sb; 381 381 struct pmem_device *pmem; 382 382 struct request_queue *q; 383 - struct device *gendev; 384 383 struct gendisk *disk; 385 384 void *addr; 386 385 int rc; ··· 488 489 } 489 490 dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); 490 491 pmem->dax_dev = dax_dev; 491 - gendev = disk_to_dev(disk); 492 - gendev->groups = pmem_attribute_groups; 493 492 494 - device_add_disk(dev, disk, NULL); 493 + device_add_disk(dev, disk, pmem_attribute_groups); 495 494 if (devm_add_action_or_reset(dev, pmem_release_disk, pmem)) 496 495 return -ENOMEM; 497 496
+3 -1
drivers/nvme/host/core.c
··· 978 978 blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req) 979 979 { 980 980 struct nvme_command *cmd = nvme_req(req)->cmd; 981 + struct nvme_ctrl *ctrl = nvme_req(req)->ctrl; 981 982 blk_status_t ret = BLK_STS_OK; 982 983 983 984 if (!(req->rq_flags & RQF_DONTPREP)) { ··· 1027 1026 return BLK_STS_IOERR; 1028 1027 } 1029 1028 1030 - nvme_req(req)->genctr++; 1029 + if (!(ctrl->quirks & NVME_QUIRK_SKIP_CID_GEN)) 1030 + nvme_req(req)->genctr++; 1031 1031 cmd->common.command_id = nvme_cid(req); 1032 1032 trace_nvme_setup_cmd(req, cmd); 1033 1033 return ret;
+6
drivers/nvme/host/nvme.h
··· 138 138 * 48 bits. 139 139 */ 140 140 NVME_QUIRK_DMA_ADDRESS_BITS_48 = (1 << 16), 141 + 142 + /* 143 + * The controller requires the command_id value be be limited, so skip 144 + * encoding the generation sequence number. 145 + */ 146 + NVME_QUIRK_SKIP_CID_GEN = (1 << 17), 141 147 }; 142 148 143 149 /*
+2 -1
drivers/nvme/host/pci.c
··· 3369 3369 { PCI_DEVICE(PCI_VENDOR_ID_APPLE, 0x2005), 3370 3370 .driver_data = NVME_QUIRK_SINGLE_VECTOR | 3371 3371 NVME_QUIRK_128_BYTES_SQES | 3372 - NVME_QUIRK_SHARED_TAGS }, 3372 + NVME_QUIRK_SHARED_TAGS | 3373 + NVME_QUIRK_SKIP_CID_GEN }, 3373 3374 3374 3375 { PCI_DEVICE_CLASS(PCI_CLASS_STORAGE_EXPRESS, 0xffffff) }, 3375 3376 { 0, }
+10 -3
drivers/pci/controller/pci-hyperv.c
··· 3301 3301 return 0; 3302 3302 3303 3303 if (!keep_devs) { 3304 - /* Delete any children which might still exist. */ 3304 + struct list_head removed; 3305 + 3306 + /* Move all present children to the list on stack */ 3307 + INIT_LIST_HEAD(&removed); 3305 3308 spin_lock_irqsave(&hbus->device_list_lock, flags); 3306 - list_for_each_entry_safe(hpdev, tmp, &hbus->children, list_entry) { 3309 + list_for_each_entry_safe(hpdev, tmp, &hbus->children, list_entry) 3310 + list_move_tail(&hpdev->list_entry, &removed); 3311 + spin_unlock_irqrestore(&hbus->device_list_lock, flags); 3312 + 3313 + /* Remove all children in the list */ 3314 + list_for_each_entry_safe(hpdev, tmp, &removed, list_entry) { 3307 3315 list_del(&hpdev->list_entry); 3308 3316 if (hpdev->pci_slot) 3309 3317 pci_destroy_slot(hpdev->pci_slot); ··· 3319 3311 put_pcichild(hpdev); 3320 3312 put_pcichild(hpdev); 3321 3313 } 3322 - spin_unlock_irqrestore(&hbus->device_list_lock, flags); 3323 3314 } 3324 3315 3325 3316 ret = hv_send_resources_released(hdev);
+2 -7
drivers/ptp/ptp_kvm_x86.c
··· 15 15 #include <linux/ptp_clock_kernel.h> 16 16 #include <linux/ptp_kvm.h> 17 17 18 - struct pvclock_vsyscall_time_info *hv_clock; 19 - 20 18 static phys_addr_t clock_pair_gpa; 21 19 static struct kvm_clock_pairing clock_pair; 22 20 ··· 26 28 return -ENODEV; 27 29 28 30 clock_pair_gpa = slow_virt_to_phys(&clock_pair); 29 - hv_clock = pvclock_get_pvti_cpu0_va(); 30 - if (!hv_clock) 31 + if (!pvclock_get_pvti_cpu0_va()) 31 32 return -ENODEV; 32 33 33 34 ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, clock_pair_gpa, ··· 61 64 struct pvclock_vcpu_time_info *src; 62 65 unsigned int version; 63 66 long ret; 64 - int cpu; 65 67 66 - cpu = smp_processor_id(); 67 - src = &hv_clock[cpu].pvti; 68 + src = this_cpu_pvti(); 68 69 69 70 do { 70 71 /*
+1
drivers/ptp/ptp_pch.c
··· 644 644 }, 645 645 {0} 646 646 }; 647 + MODULE_DEVICE_TABLE(pci, pch_ieee1588_pcidev_id); 647 648 648 649 static SIMPLE_DEV_PM_OPS(pch_pm_ops, pch_suspend, pch_resume); 649 650
+5 -3
drivers/s390/cio/blacklist.c
··· 262 262 263 263 if (strcmp("free", parm) == 0) { 264 264 rc = blacklist_parse_parameters(buf, free, 0); 265 - /* There could be subchannels without proper devices connected. 266 - * evaluate all the entries 265 + /* 266 + * Evaluate the subchannels without an online device. This way, 267 + * no path-verification will be triggered on those subchannels 268 + * and it avoids unnecessary delays. 267 269 */ 268 - css_schedule_eval_all(); 270 + css_schedule_eval_cond(CSS_EVAL_NOT_ONLINE, 0); 269 271 } else if (strcmp("add", parm) == 0) 270 272 rc = blacklist_parse_parameters(buf, add, 0); 271 273 else if (strcmp("purge", parm) == 0)
+31 -9
drivers/s390/cio/css.c
··· 788 788 return 0; 789 789 } 790 790 791 - void css_schedule_eval_all_unreg(unsigned long delay) 791 + static int __unset_online(struct device *dev, void *data) 792 + { 793 + struct idset *set = data; 794 + struct subchannel *sch = to_subchannel(dev); 795 + struct ccw_device *cdev = sch_get_cdev(sch); 796 + 797 + if (cdev && cdev->online) 798 + idset_sch_del(set, sch->schid); 799 + 800 + return 0; 801 + } 802 + 803 + void css_schedule_eval_cond(enum css_eval_cond cond, unsigned long delay) 792 804 { 793 805 unsigned long flags; 794 - struct idset *unreg_set; 806 + struct idset *set; 795 807 796 808 /* Find unregistered subchannels. */ 797 - unreg_set = idset_sch_new(); 798 - if (!unreg_set) { 809 + set = idset_sch_new(); 810 + if (!set) { 799 811 /* Fallback. */ 800 812 css_schedule_eval_all(); 801 813 return; 802 814 } 803 - idset_fill(unreg_set); 804 - bus_for_each_dev(&css_bus_type, NULL, unreg_set, __unset_registered); 815 + idset_fill(set); 816 + switch (cond) { 817 + case CSS_EVAL_UNREG: 818 + bus_for_each_dev(&css_bus_type, NULL, set, __unset_registered); 819 + break; 820 + case CSS_EVAL_NOT_ONLINE: 821 + bus_for_each_dev(&css_bus_type, NULL, set, __unset_online); 822 + break; 823 + default: 824 + break; 825 + } 826 + 805 827 /* Apply to slow_subchannel_set. */ 806 828 spin_lock_irqsave(&slow_subchannel_lock, flags); 807 - idset_add_set(slow_subchannel_set, unreg_set); 829 + idset_add_set(slow_subchannel_set, set); 808 830 atomic_set(&css_eval_scheduled, 1); 809 831 queue_delayed_work(cio_work_q, &slow_path_work, delay); 810 832 spin_unlock_irqrestore(&slow_subchannel_lock, flags); 811 - idset_free(unreg_set); 833 + idset_free(set); 812 834 } 813 835 814 836 void css_wait_for_slow_path(void) ··· 842 820 void css_schedule_reprobe(void) 843 821 { 844 822 /* Schedule with a delay to allow merging of subsequent calls. */ 845 - css_schedule_eval_all_unreg(1 * HZ); 823 + css_schedule_eval_cond(CSS_EVAL_UNREG, 1 * HZ); 846 824 } 847 825 EXPORT_SYMBOL_GPL(css_schedule_reprobe); 848 826
+9 -1
drivers/s390/cio/css.h
··· 34 34 #define SNID_STATE3_MULTI_PATH 1 35 35 #define SNID_STATE3_SINGLE_PATH 0 36 36 37 + /* 38 + * Conditions used to specify which subchannels need evaluation 39 + */ 40 + enum css_eval_cond { 41 + CSS_EVAL_UNREG, /* unregistered subchannels */ 42 + CSS_EVAL_NOT_ONLINE /* sch without an online-device */ 43 + }; 44 + 37 45 struct path_state { 38 46 __u8 state1 : 2; /* path state value 1 */ 39 47 __u8 state2 : 2; /* path state value 2 */ ··· 144 136 /* Helper functions to build lists for the slow path. */ 145 137 void css_schedule_eval(struct subchannel_id schid); 146 138 void css_schedule_eval_all(void); 147 - void css_schedule_eval_all_unreg(unsigned long delay); 139 + void css_schedule_eval_cond(enum css_eval_cond, unsigned long delay); 148 140 int css_complete_work(void); 149 141 150 142 int sch_is_pseudo_sch(struct subchannel *);
+1
drivers/scsi/csiostor/csio_init.c
··· 1254 1254 MODULE_VERSION(CSIO_DRV_VERSION); 1255 1255 MODULE_FIRMWARE(FW_FNAME_T5); 1256 1256 MODULE_FIRMWARE(FW_FNAME_T6); 1257 + MODULE_SOFTDEP("pre: cxgb4");
+2 -2
drivers/scsi/qla2xxx/qla_isr.c
··· 2634 2634 } 2635 2635 2636 2636 if (unlikely(logit)) 2637 - ql_log(ql_log_warn, fcport->vha, 0x5060, 2637 + ql_log(ql_dbg_io, fcport->vha, 0x5060, 2638 2638 "NVME-%s ERR Handling - hdl=%x status(%x) tr_len:%x resid=%x ox_id=%x\n", 2639 2639 sp->name, sp->handle, comp_status, 2640 2640 fd->transferred_length, le32_to_cpu(sts->residual_len), ··· 3491 3491 3492 3492 out: 3493 3493 if (logit) 3494 - ql_log(ql_log_warn, fcport->vha, 0x3022, 3494 + ql_log(ql_dbg_io, fcport->vha, 0x3022, 3495 3495 "FCP command status: 0x%x-0x%x (0x%x) nexus=%ld:%d:%llu portid=%02x%02x%02x oxid=0x%x cdb=%10phN len=0x%x rsp_info=0x%x resid=0x%x fw_resid=0x%x sp=%p cp=%p.\n", 3496 3496 comp_status, scsi_status, res, vha->host_no, 3497 3497 cp->device->id, cp->device->lun, fcport->d_id.b.domain,
+1 -1
drivers/scsi/ses.c
··· 118 118 static int ses_send_diag(struct scsi_device *sdev, int page_code, 119 119 void *buf, int bufflen) 120 120 { 121 - u32 result; 121 + int result; 122 122 123 123 unsigned char cmd[] = { 124 124 SEND_DIAGNOSTIC,
+1 -2
drivers/scsi/ufs/ufshcd.c
··· 318 318 static void ufshcd_add_tm_upiu_trace(struct ufs_hba *hba, unsigned int tag, 319 319 enum ufs_trace_str_t str_t) 320 320 { 321 - int off = (int)tag - hba->nutrs; 322 - struct utp_task_req_desc *descp = &hba->utmrdl_base_addr[off]; 321 + struct utp_task_req_desc *descp = &hba->utmrdl_base_addr[tag]; 323 322 324 323 if (!trace_ufshcd_upiu_enabled()) 325 324 return;
+2 -2
drivers/scsi/virtio_scsi.c
··· 300 300 } 301 301 break; 302 302 default: 303 - pr_info("Unsupport virtio scsi event reason %x\n", event->reason); 303 + pr_info("Unsupported virtio scsi event reason %x\n", event->reason); 304 304 } 305 305 } 306 306 ··· 392 392 virtscsi_handle_param_change(vscsi, event); 393 393 break; 394 394 default: 395 - pr_err("Unsupport virtio scsi event %x\n", event->event); 395 + pr_err("Unsupported virtio scsi event %x\n", event->event); 396 396 } 397 397 virtscsi_kick_event(vscsi, event_node); 398 398 }
+1 -1
drivers/soc/qcom/mdt_loader.c
··· 98 98 if (ehdr->e_phnum < 2) 99 99 return ERR_PTR(-EINVAL); 100 100 101 - if (phdrs[0].p_type == PT_LOAD || phdrs[1].p_type == PT_LOAD) 101 + if (phdrs[0].p_type == PT_LOAD) 102 102 return ERR_PTR(-EINVAL); 103 103 104 104 if ((phdrs[1].p_flags & QCOM_MDT_TYPE_MASK) != QCOM_MDT_TYPE_HASH)
+1 -1
drivers/soc/qcom/socinfo.c
··· 628 628 /* Feed the soc specific unique data into entropy pool */ 629 629 add_device_randomness(info, item_size); 630 630 631 - platform_set_drvdata(pdev, qs->soc_dev); 631 + platform_set_drvdata(pdev, qs); 632 632 633 633 return 0; 634 634 }
+16 -13
drivers/soc/ti/omap_prm.c
··· 825 825 writel_relaxed(v, reset->prm->base + reset->prm->data->rstctrl); 826 826 spin_unlock_irqrestore(&reset->lock, flags); 827 827 828 - if (!has_rstst) 829 - goto exit; 830 - 831 - /* wait for the status to be set */ 828 + /* wait for the reset bit to clear */ 832 829 ret = readl_relaxed_poll_timeout_atomic(reset->prm->base + 833 - reset->prm->data->rstst, 834 - v, v & BIT(st_bit), 1, 835 - OMAP_RESET_MAX_WAIT); 830 + reset->prm->data->rstctrl, 831 + v, !(v & BIT(id)), 1, 832 + OMAP_RESET_MAX_WAIT); 836 833 if (ret) 837 834 pr_err("%s: timedout waiting for %s:%lu\n", __func__, 838 835 reset->prm->data->name, id); 839 836 840 - exit: 841 - if (reset->clkdm) { 842 - /* At least dra7 iva needs a delay before clkdm idle */ 843 - if (has_rstst) 844 - udelay(1); 845 - pdata->clkdm_allow_idle(reset->clkdm); 837 + /* wait for the status to be set */ 838 + if (has_rstst) { 839 + ret = readl_relaxed_poll_timeout_atomic(reset->prm->base + 840 + reset->prm->data->rstst, 841 + v, v & BIT(st_bit), 1, 842 + OMAP_RESET_MAX_WAIT); 843 + if (ret) 844 + pr_err("%s: timedout waiting for %s:%lu\n", __func__, 845 + reset->prm->data->name, id); 846 846 } 847 + 848 + if (reset->clkdm) 849 + pdata->clkdm_allow_idle(reset->clkdm); 847 850 848 851 return ret; 849 852 }
+2
drivers/staging/media/atomisp/pci/hive_isp_css_common/host/input_system.c
··· 1646 1646 default: 1647 1647 return INPUT_SYSTEM_ERR_PARAMETER_NOT_SUPPORTED; 1648 1648 } 1649 + 1650 + return INPUT_SYSTEM_ERR_NO_ERROR; 1649 1651 } 1650 1652 1651 1653 // Test flags and set structure.
+1 -1
drivers/tee/optee/shm_pool.c
··· 35 35 unsigned int nr_pages = 1 << order, i; 36 36 struct page **pages; 37 37 38 - pages = kcalloc(nr_pages, sizeof(pages), GFP_KERNEL); 38 + pages = kcalloc(nr_pages, sizeof(*pages), GFP_KERNEL); 39 39 if (!pages) { 40 40 rc = -ENOMEM; 41 41 goto err;
+2 -70
drivers/usb/host/ohci-omap.c
··· 40 40 #include <mach/usb.h> 41 41 42 42 43 - /* OMAP-1510 OHCI has its own MMU for DMA */ 44 - #define OMAP1510_LB_MEMSIZE 32 /* Should be same as SDRAM size */ 45 - #define OMAP1510_LB_CLOCK_DIV 0xfffec10c 46 - #define OMAP1510_LB_MMU_CTL 0xfffec208 47 - #define OMAP1510_LB_MMU_LCK 0xfffec224 48 - #define OMAP1510_LB_MMU_LD_TLB 0xfffec228 49 - #define OMAP1510_LB_MMU_CAM_H 0xfffec22c 50 - #define OMAP1510_LB_MMU_CAM_L 0xfffec230 51 - #define OMAP1510_LB_MMU_RAM_H 0xfffec234 52 - #define OMAP1510_LB_MMU_RAM_L 0xfffec238 53 - 54 43 #define DRIVER_DESC "OHCI OMAP driver" 55 44 56 45 struct ohci_omap_priv { ··· 92 103 93 104 return 0; 94 105 } 95 - 96 - #ifdef CONFIG_ARCH_OMAP15XX 97 - /* 98 - * OMAP-1510 specific Local Bus clock on/off 99 - */ 100 - static int omap_1510_local_bus_power(int on) 101 - { 102 - if (on) { 103 - omap_writel((1 << 1) | (1 << 0), OMAP1510_LB_MMU_CTL); 104 - udelay(200); 105 - } else { 106 - omap_writel(0, OMAP1510_LB_MMU_CTL); 107 - } 108 - 109 - return 0; 110 - } 111 - 112 - /* 113 - * OMAP-1510 specific Local Bus initialization 114 - * NOTE: This assumes 32MB memory size in OMAP1510LB_MEMSIZE. 115 - * See also arch/mach-omap/memory.h for __virt_to_dma() and 116 - * __dma_to_virt() which need to match with the physical 117 - * Local Bus address below. 118 - */ 119 - static int omap_1510_local_bus_init(void) 120 - { 121 - unsigned int tlb; 122 - unsigned long lbaddr, physaddr; 123 - 124 - omap_writel((omap_readl(OMAP1510_LB_CLOCK_DIV) & 0xfffffff8) | 0x4, 125 - OMAP1510_LB_CLOCK_DIV); 126 - 127 - /* Configure the Local Bus MMU table */ 128 - for (tlb = 0; tlb < OMAP1510_LB_MEMSIZE; tlb++) { 129 - lbaddr = tlb * 0x00100000 + OMAP1510_LB_OFFSET; 130 - physaddr = tlb * 0x00100000 + PHYS_OFFSET; 131 - omap_writel((lbaddr & 0x0fffffff) >> 22, OMAP1510_LB_MMU_CAM_H); 132 - omap_writel(((lbaddr & 0x003ffc00) >> 6) | 0xc, 133 - OMAP1510_LB_MMU_CAM_L); 134 - omap_writel(physaddr >> 16, OMAP1510_LB_MMU_RAM_H); 135 - omap_writel((physaddr & 0x0000fc00) | 0x300, OMAP1510_LB_MMU_RAM_L); 136 - omap_writel(tlb << 4, OMAP1510_LB_MMU_LCK); 137 - omap_writel(0x1, OMAP1510_LB_MMU_LD_TLB); 138 - } 139 - 140 - /* Enable the walking table */ 141 - omap_writel(omap_readl(OMAP1510_LB_MMU_CTL) | (1 << 3), OMAP1510_LB_MMU_CTL); 142 - udelay(200); 143 - 144 - return 0; 145 - } 146 - #else 147 - #define omap_1510_local_bus_power(x) {} 148 - #define omap_1510_local_bus_init() {} 149 - #endif 150 106 151 107 #ifdef CONFIG_USB_OTG 152 108 ··· 163 229 164 230 omap_ohci_clock_power(priv, 1); 165 231 166 - if (cpu_is_omap15xx()) { 167 - omap_1510_local_bus_power(1); 168 - omap_1510_local_bus_init(); 169 - } 232 + if (config->lb_reset) 233 + config->lb_reset(); 170 234 171 235 ret = ohci_setup(hcd); 172 236 if (ret < 0)
+4 -4
fs/9p/cache.c
··· 23 23 .version = 0, 24 24 }; 25 25 26 - /** 26 + /* 27 27 * v9fs_random_cachetag - Generate a random tag to be associated 28 28 * with a new cache session. 29 29 * ··· 233 233 unlock_page(page); 234 234 } 235 235 236 - /** 236 + /* 237 237 * __v9fs_readpage_from_fscache - read a page from cache 238 238 * 239 239 * Returns 0 if the pages are in cache and a BIO is submitted, ··· 268 268 } 269 269 } 270 270 271 - /** 271 + /* 272 272 * __v9fs_readpages_from_fscache - read multiple pages from cache 273 273 * 274 274 * Returns 0 if the pages are in cache and a BIO is submitted, ··· 308 308 } 309 309 } 310 310 311 - /** 311 + /* 312 312 * __v9fs_readpage_to_fscache - write a page to the cache 313 313 * 314 314 */
+7 -7
fs/9p/fid.c
··· 19 19 #include "v9fs_vfs.h" 20 20 #include "fid.h" 21 21 22 + static inline void __add_fid(struct dentry *dentry, struct p9_fid *fid) 23 + { 24 + hlist_add_head(&fid->dlist, (struct hlist_head *)&dentry->d_fsdata); 25 + } 26 + 27 + 22 28 /** 23 29 * v9fs_fid_add - add a fid to a dentry 24 30 * @dentry: dentry that the fid is being added to 25 31 * @fid: fid to add 26 32 * 27 33 */ 28 - 29 - static inline void __add_fid(struct dentry *dentry, struct p9_fid *fid) 30 - { 31 - hlist_add_head(&fid->dlist, (struct hlist_head *)&dentry->d_fsdata); 32 - } 33 - 34 34 void v9fs_fid_add(struct dentry *dentry, struct p9_fid *fid) 35 35 { 36 36 spin_lock(&dentry->d_lock); ··· 67 67 68 68 /** 69 69 * v9fs_open_fid_add - add an open fid to an inode 70 - * @dentry: inode that the fid is being added to 70 + * @inode: inode that the fid is being added to 71 71 * @fid: fid to add 72 72 * 73 73 */
+3 -5
fs/9p/v9fs.c
··· 155 155 /** 156 156 * v9fs_parse_options - parse mount options into session structure 157 157 * @v9ses: existing v9fs session information 158 + * @opts: The mount option string 158 159 * 159 160 * Return 0 upon success, -ERRNO upon failure. 160 161 */ ··· 543 542 static struct kobject *v9fs_kobj; 544 543 545 544 #ifdef CONFIG_9P_FSCACHE 546 - /** 547 - * caches_show - list caches associated with a session 548 - * 549 - * Returns the size of buffer written. 545 + /* 546 + * List caches associated with a session 550 547 */ 551 - 552 548 static ssize_t caches_show(struct kobject *kobj, 553 549 struct kobj_attribute *attr, 554 550 char *buf)
+9 -5
fs/9p/vfs_addr.c
··· 30 30 31 31 /** 32 32 * v9fs_fid_readpage - read an entire page in from 9P 33 - * 34 - * @fid: fid being read 33 + * @data: Opaque pointer to the fid being read 35 34 * @page: structure to page 36 35 * 37 36 */ ··· 115 116 116 117 /** 117 118 * v9fs_release_page - release the private state associated with a page 119 + * @page: The page to be released 120 + * @gfp: The caller's allocation restrictions 118 121 * 119 122 * Returns 1 if the page can be released, false otherwise. 120 123 */ ··· 130 129 131 130 /** 132 131 * v9fs_invalidate_page - Invalidate a page completely or partially 133 - * 134 - * @page: structure to page 135 - * @offset: offset in the page 132 + * @page: The page to be invalidated 133 + * @offset: offset of the invalidated region 134 + * @length: length of the invalidated region 136 135 */ 137 136 138 137 static void v9fs_invalidate_page(struct page *page, unsigned int offset, ··· 200 199 201 200 /** 202 201 * v9fs_launder_page - Writeback a dirty page 202 + * @page: The page to be cleaned up 203 + * 203 204 * Returns 0 on success. 204 205 */ 205 206 ··· 222 219 /** 223 220 * v9fs_direct_IO - 9P address space operation for direct I/O 224 221 * @iocb: target I/O control block 222 + * @iter: The data/buffer to use 225 223 * 226 224 * The presence of v9fs_direct_IO() in the address space ops vector 227 225 * allowes open() O_DIRECT flags which would have failed otherwise.
+12 -21
fs/9p/vfs_file.c
··· 359 359 } 360 360 361 361 /** 362 - * v9fs_file_read - read from a file 363 - * @filp: file pointer to read 364 - * @udata: user data buffer to read data into 365 - * @count: size of buffer 366 - * @offset: offset at which to read data 362 + * v9fs_file_read_iter - read from a file 363 + * @iocb: The operation parameters 364 + * @to: The buffer to read into 367 365 * 368 366 */ 369 - 370 367 static ssize_t 371 368 v9fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) 372 369 { ··· 385 388 } 386 389 387 390 /** 388 - * v9fs_file_write - write to a file 389 - * @filp: file pointer to write 390 - * @data: data buffer to write data from 391 - * @count: size of buffer 392 - * @offset: offset at which to write data 391 + * v9fs_file_write_iter - write to a file 392 + * @iocb: The operation parameters 393 + * @from: The data to write 393 394 * 394 395 */ 395 396 static ssize_t ··· 556 561 } 557 562 558 563 /** 559 - * v9fs_mmap_file_read - read from a file 560 - * @filp: file pointer to read 561 - * @data: user data buffer to read data into 562 - * @count: size of buffer 563 - * @offset: offset at which to read data 564 + * v9fs_mmap_file_read_iter - read from a file 565 + * @iocb: The operation parameters 566 + * @to: The buffer to read into 564 567 * 565 568 */ 566 569 static ssize_t ··· 569 576 } 570 577 571 578 /** 572 - * v9fs_mmap_file_write - write to a file 573 - * @filp: file pointer to write 574 - * @data: data buffer to write data from 575 - * @count: size of buffer 576 - * @offset: offset at which to write data 579 + * v9fs_mmap_file_write_iter - write to a file 580 + * @iocb: The operation parameters 581 + * @from: The data to write 577 582 * 578 583 */ 579 584 static ssize_t
+16 -8
fs/9p/vfs_inode.c
··· 218 218 219 219 /** 220 220 * v9fs_alloc_inode - helper function to allocate an inode 221 - * 221 + * @sb: The superblock to allocate the inode from 222 222 */ 223 223 struct inode *v9fs_alloc_inode(struct super_block *sb) 224 224 { ··· 238 238 239 239 /** 240 240 * v9fs_free_inode - destroy an inode 241 - * 241 + * @inode: The inode to be freed 242 242 */ 243 243 244 244 void v9fs_free_inode(struct inode *inode) ··· 343 343 * v9fs_get_inode - helper function to setup an inode 344 344 * @sb: superblock 345 345 * @mode: mode to setup inode with 346 - * 346 + * @rdev: The device numbers to set 347 347 */ 348 348 349 349 struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t rdev) ··· 369 369 } 370 370 371 371 /** 372 - * v9fs_clear_inode - release an inode 372 + * v9fs_evict_inode - Remove an inode from the inode cache 373 373 * @inode: inode to release 374 374 * 375 375 */ ··· 665 665 666 666 /** 667 667 * v9fs_vfs_create - VFS hook to create a regular file 668 + * @mnt_userns: The user namespace of the mount 669 + * @dir: The parent directory 670 + * @dentry: The name of file to be created 671 + * @mode: The UNIX file mode to set 672 + * @excl: True if the file must not yet exist 668 673 * 669 674 * open(.., O_CREAT) is handled in v9fs_vfs_atomic_open(). This is only called 670 675 * for mknod(2). 671 - * 672 - * @dir: directory inode that is being created 673 - * @dentry: dentry that is being deleted 674 - * @mode: create permissions 675 676 * 676 677 */ 677 678 ··· 697 696 698 697 /** 699 698 * v9fs_vfs_mkdir - VFS mkdir hook to create a directory 699 + * @mnt_userns: The user namespace of the mount 700 700 * @dir: inode that is being unlinked 701 701 * @dentry: dentry that is being unlinked 702 702 * @mode: mode for new directory ··· 902 900 903 901 /** 904 902 * v9fs_vfs_rename - VFS hook to rename an inode 903 + * @mnt_userns: The user namespace of the mount 905 904 * @old_dir: old dir inode 906 905 * @old_dentry: old dentry 907 906 * @new_dir: new dir inode 908 907 * @new_dentry: new dentry 908 + * @flags: RENAME_* flags 909 909 * 910 910 */ 911 911 ··· 1013 1009 1014 1010 /** 1015 1011 * v9fs_vfs_getattr - retrieve file metadata 1012 + * @mnt_userns: The user namespace of the mount 1016 1013 * @path: Object to query 1017 1014 * @stat: metadata structure to populate 1018 1015 * @request_mask: Mask of STATX_xxx flags indicating the caller's interests ··· 1055 1050 1056 1051 /** 1057 1052 * v9fs_vfs_setattr - set file metadata 1053 + * @mnt_userns: The user namespace of the mount 1058 1054 * @dentry: file whose metadata to set 1059 1055 * @iattr: metadata assignment structure 1060 1056 * ··· 1291 1285 1292 1286 /** 1293 1287 * v9fs_vfs_symlink - helper function to create symlinks 1288 + * @mnt_userns: The user namespace of the mount 1294 1289 * @dir: directory inode containing symlink 1295 1290 * @dentry: dentry for symlink 1296 1291 * @symname: symlink data ··· 1347 1340 1348 1341 /** 1349 1342 * v9fs_vfs_mknod - create a special file 1343 + * @mnt_userns: The user namespace of the mount 1350 1344 * @dir: inode destination for new link 1351 1345 * @dentry: dentry for file 1352 1346 * @mode: mode for creation
+9 -2
fs/9p/vfs_inode_dotl.c
··· 37 37 struct dentry *dentry, umode_t omode, dev_t rdev); 38 38 39 39 /** 40 - * v9fs_get_fsgid_for_create - Helper function to get the gid for creating a 40 + * v9fs_get_fsgid_for_create - Helper function to get the gid for a new object 41 + * @dir_inode: The directory inode 42 + * 43 + * Helper function to get the gid for creating a 41 44 * new file system object. This checks the S_ISGID to determine the owning 42 45 * group of the new file system object. 43 46 */ ··· 214 211 215 212 /** 216 213 * v9fs_vfs_create_dotl - VFS hook to create files for 9P2000.L protocol. 214 + * @mnt_userns: The user namespace of the mount 217 215 * @dir: directory inode that is being created 218 216 * @dentry: dentry that is being deleted 219 217 * @omode: create permissions 218 + * @excl: True if the file must not yet exist 220 219 * 221 220 */ 222 - 223 221 static int 224 222 v9fs_vfs_create_dotl(struct user_namespace *mnt_userns, struct inode *dir, 225 223 struct dentry *dentry, umode_t omode, bool excl) ··· 365 361 366 362 /** 367 363 * v9fs_vfs_mkdir_dotl - VFS mkdir hook to create a directory 364 + * @mnt_userns: The user namespace of the mount 368 365 * @dir: inode that is being unlinked 369 366 * @dentry: dentry that is being unlinked 370 367 * @omode: mode for new directory ··· 542 537 543 538 /** 544 539 * v9fs_vfs_setattr_dotl - set file metadata 540 + * @mnt_userns: The user namespace of the mount 545 541 * @dentry: file whose metadata to set 546 542 * @iattr: metadata assignment structure 547 543 * ··· 822 816 823 817 /** 824 818 * v9fs_vfs_mknod_dotl - create a special file 819 + * @mnt_userns: The user namespace of the mount 825 820 * @dir: inode destination for new link 826 821 * @dentry: dentry for file 827 822 * @omode: mode for creation
+2 -2
fs/afs/dir_silly.c
··· 86 86 return afs_do_sync_operation(op); 87 87 } 88 88 89 - /** 90 - * afs_sillyrename - Perform a silly-rename of a dentry 89 + /* 90 + * Perform silly-rename of a dentry. 91 91 * 92 92 * AFS is stateless and the server doesn't know when the client is holding a 93 93 * file open. To prevent application problems when a file is unlinked while
+1 -2
fs/afs/write.c
··· 974 974 iov_iter_bvec(&iter, WRITE, bv, 1, bv[0].bv_len); 975 975 976 976 trace_afs_page_dirty(vnode, tracepoint_string("launder"), page); 977 - ret = afs_store_data(vnode, &iter, (loff_t)page->index * PAGE_SIZE, 978 - true); 977 + ret = afs_store_data(vnode, &iter, page_offset(page) + f, true); 979 978 } 980 979 981 980 trace_afs_page_dirty(vnode, tracepoint_string("laundered"), page);
+1 -1
fs/binfmt_elf.c
··· 630 630 631 631 vaddr = eppnt->p_vaddr; 632 632 if (interp_elf_ex->e_type == ET_EXEC || load_addr_set) 633 - elf_type |= MAP_FIXED_NOREPLACE; 633 + elf_type |= MAP_FIXED; 634 634 else if (no_base && interp_elf_ex->e_type == ET_DYN) 635 635 load_addr = -vaddr; 636 636
+1 -1
fs/debugfs/inode.c
··· 528 528 { 529 529 struct dentry *de = debugfs_create_file(name, mode, parent, data, fops); 530 530 531 - if (de) 531 + if (!IS_ERR(de)) 532 532 d_inode(de)->i_size = file_size; 533 533 } 534 534 EXPORT_SYMBOL_GPL(debugfs_create_file_size);
+3 -3
fs/ext4/dir.c
··· 551 551 struct dir_private_info *info = file->private_data; 552 552 struct inode *inode = file_inode(file); 553 553 struct fname *fname; 554 - int ret; 554 + int ret = 0; 555 555 556 556 if (!info) { 557 557 info = ext4_htree_create_dir_info(file, ctx->pos); ··· 599 599 info->curr_minor_hash, 600 600 &info->next_hash); 601 601 if (ret < 0) 602 - return ret; 602 + goto finished; 603 603 if (ret == 0) { 604 604 ctx->pos = ext4_get_htree_eof(file); 605 605 break; ··· 630 630 } 631 631 finished: 632 632 info->last_pos = ctx->pos; 633 - return 0; 633 + return ret < 0 ? ret : 0; 634 634 } 635 635 636 636 static int ext4_release_dir(struct inode *inode, struct file *filp)
-3
fs/ext4/ext4.h
··· 3593 3593 unsigned flags, 3594 3594 struct page **pagep, 3595 3595 void **fsdata); 3596 - extern int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos, 3597 - unsigned len, unsigned copied, 3598 - struct page *page); 3599 3596 extern int ext4_try_add_inline_entry(handle_t *handle, 3600 3597 struct ext4_filename *fname, 3601 3598 struct inode *dir, struct inode *inode);
+14 -5
fs/ext4/extents.c
··· 5916 5916 } 5917 5917 5918 5918 /* Check if *cur is a hole and if it is, skip it */ 5919 - static void skip_hole(struct inode *inode, ext4_lblk_t *cur) 5919 + static int skip_hole(struct inode *inode, ext4_lblk_t *cur) 5920 5920 { 5921 5921 int ret; 5922 5922 struct ext4_map_blocks map; ··· 5925 5925 map.m_len = ((inode->i_size) >> inode->i_sb->s_blocksize_bits) - *cur; 5926 5926 5927 5927 ret = ext4_map_blocks(NULL, inode, &map, 0); 5928 + if (ret < 0) 5929 + return ret; 5928 5930 if (ret != 0) 5929 - return; 5931 + return 0; 5930 5932 *cur = *cur + map.m_len; 5933 + return 0; 5931 5934 } 5932 5935 5933 5936 /* Count number of blocks used by this inode and update i_blocks */ ··· 5979 5976 * iblocks by total number of differences found. 5980 5977 */ 5981 5978 cur = 0; 5982 - skip_hole(inode, &cur); 5979 + ret = skip_hole(inode, &cur); 5980 + if (ret < 0) 5981 + goto out; 5983 5982 path = ext4_find_extent(inode, cur, NULL, 0); 5984 5983 if (IS_ERR(path)) 5985 5984 goto out; ··· 6000 5995 } 6001 5996 cur = max(cur + 1, le32_to_cpu(ex->ee_block) + 6002 5997 ext4_ext_get_actual_len(ex)); 6003 - skip_hole(inode, &cur); 6004 - 5998 + ret = skip_hole(inode, &cur); 5999 + if (ret < 0) { 6000 + ext4_ext_drop_refs(path); 6001 + kfree(path); 6002 + break; 6003 + } 6005 6004 path2 = ext4_find_extent(inode, cur, NULL, 0); 6006 6005 if (IS_ERR(path2)) { 6007 6006 ext4_ext_drop_refs(path);
+6
fs/ext4/fast_commit.c
··· 892 892 sizeof(lrange), (u8 *)&lrange, crc)) 893 893 return -ENOSPC; 894 894 } else { 895 + unsigned int max = (map.m_flags & EXT4_MAP_UNWRITTEN) ? 896 + EXT_UNWRITTEN_MAX_LEN : EXT_INIT_MAX_LEN; 897 + 898 + /* Limit the number of blocks in one extent */ 899 + map.m_len = min(max, map.m_len); 900 + 895 901 fc_ext.fc_ino = cpu_to_le32(inode->i_ino); 896 902 ex = (struct ext4_extent *)&fc_ext.fc_ex; 897 903 ex->ee_block = cpu_to_le32(map.m_lblk);
+85 -65
fs/ext4/inline.c
··· 7 7 #include <linux/iomap.h> 8 8 #include <linux/fiemap.h> 9 9 #include <linux/iversion.h> 10 + #include <linux/backing-dev.h> 10 11 11 12 #include "ext4_jbd2.h" 12 13 #include "ext4.h" ··· 734 733 int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len, 735 734 unsigned copied, struct page *page) 736 735 { 737 - int ret, no_expand; 736 + handle_t *handle = ext4_journal_current_handle(); 737 + int no_expand; 738 738 void *kaddr; 739 739 struct ext4_iloc iloc; 740 + int ret = 0, ret2; 740 741 741 - if (unlikely(copied < len)) { 742 - if (!PageUptodate(page)) { 743 - copied = 0; 742 + if (unlikely(copied < len) && !PageUptodate(page)) 743 + copied = 0; 744 + 745 + if (likely(copied)) { 746 + ret = ext4_get_inode_loc(inode, &iloc); 747 + if (ret) { 748 + unlock_page(page); 749 + put_page(page); 750 + ext4_std_error(inode->i_sb, ret); 744 751 goto out; 745 752 } 746 - } 753 + ext4_write_lock_xattr(inode, &no_expand); 754 + BUG_ON(!ext4_has_inline_data(inode)); 747 755 748 - ret = ext4_get_inode_loc(inode, &iloc); 749 - if (ret) { 750 - ext4_std_error(inode->i_sb, ret); 751 - copied = 0; 752 - goto out; 753 - } 756 + /* 757 + * ei->i_inline_off may have changed since 758 + * ext4_write_begin() called 759 + * ext4_try_to_write_inline_data() 760 + */ 761 + (void) ext4_find_inline_data_nolock(inode); 754 762 755 - ext4_write_lock_xattr(inode, &no_expand); 756 - BUG_ON(!ext4_has_inline_data(inode)); 763 + kaddr = kmap_atomic(page); 764 + ext4_write_inline_data(inode, &iloc, kaddr, pos, copied); 765 + kunmap_atomic(kaddr); 766 + SetPageUptodate(page); 767 + /* clear page dirty so that writepages wouldn't work for us. */ 768 + ClearPageDirty(page); 769 + 770 + ext4_write_unlock_xattr(inode, &no_expand); 771 + brelse(iloc.bh); 772 + 773 + /* 774 + * It's important to update i_size while still holding page 775 + * lock: page writeout could otherwise come in and zero 776 + * beyond i_size. 777 + */ 778 + ext4_update_inode_size(inode, pos + copied); 779 + } 780 + unlock_page(page); 781 + put_page(page); 757 782 758 783 /* 759 - * ei->i_inline_off may have changed since ext4_write_begin() 760 - * called ext4_try_to_write_inline_data() 784 + * Don't mark the inode dirty under page lock. First, it unnecessarily 785 + * makes the holding time of page lock longer. Second, it forces lock 786 + * ordering of page lock and transaction start for journaling 787 + * filesystems. 761 788 */ 762 - (void) ext4_find_inline_data_nolock(inode); 763 - 764 - kaddr = kmap_atomic(page); 765 - ext4_write_inline_data(inode, &iloc, kaddr, pos, len); 766 - kunmap_atomic(kaddr); 767 - SetPageUptodate(page); 768 - /* clear page dirty so that writepages wouldn't work for us. */ 769 - ClearPageDirty(page); 770 - 771 - ext4_write_unlock_xattr(inode, &no_expand); 772 - brelse(iloc.bh); 773 - mark_inode_dirty(inode); 789 + if (likely(copied)) 790 + mark_inode_dirty(inode); 774 791 out: 775 - return copied; 792 + /* 793 + * If we didn't copy as much data as expected, we need to trim back 794 + * size of xattr containing inline data. 795 + */ 796 + if (pos + len > inode->i_size && ext4_can_truncate(inode)) 797 + ext4_orphan_add(handle, inode); 798 + 799 + ret2 = ext4_journal_stop(handle); 800 + if (!ret) 801 + ret = ret2; 802 + if (pos + len > inode->i_size) { 803 + ext4_truncate_failed_write(inode); 804 + /* 805 + * If truncate failed early the inode might still be 806 + * on the orphan list; we need to make sure the inode 807 + * is removed from the orphan list in that case. 808 + */ 809 + if (inode->i_nlink) 810 + ext4_orphan_del(NULL, inode); 811 + } 812 + return ret ? ret : copied; 776 813 } 777 814 778 815 struct buffer_head * ··· 990 951 out: 991 952 brelse(iloc.bh); 992 953 return ret; 993 - } 994 - 995 - int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos, 996 - unsigned len, unsigned copied, 997 - struct page *page) 998 - { 999 - int ret; 1000 - 1001 - ret = ext4_write_inline_data_end(inode, pos, len, copied, page); 1002 - if (ret < 0) { 1003 - unlock_page(page); 1004 - put_page(page); 1005 - return ret; 1006 - } 1007 - copied = ret; 1008 - 1009 - /* 1010 - * No need to use i_size_read() here, the i_size 1011 - * cannot change under us because we hold i_mutex. 1012 - * 1013 - * But it's important to update i_size while still holding page lock: 1014 - * page writeout could otherwise come in and zero beyond i_size. 1015 - */ 1016 - if (pos+copied > inode->i_size) 1017 - i_size_write(inode, pos+copied); 1018 - unlock_page(page); 1019 - put_page(page); 1020 - 1021 - /* 1022 - * Don't mark the inode dirty under page lock. First, it unnecessarily 1023 - * makes the holding time of page lock longer. Second, it forces lock 1024 - * ordering of page lock and transaction start for journaling 1025 - * filesystems. 1026 - */ 1027 - mark_inode_dirty(inode); 1028 - 1029 - return copied; 1030 954 } 1031 955 1032 956 #ifdef INLINE_DIR_DEBUG ··· 1919 1917 EXT4_I(inode)->i_disksize = i_size; 1920 1918 1921 1919 if (i_size < inline_size) { 1920 + /* 1921 + * if there's inline data to truncate and this file was 1922 + * converted to extents after that inline data was written, 1923 + * the extent status cache must be cleared to avoid leaving 1924 + * behind stale delayed allocated extent entries 1925 + */ 1926 + if (!ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) { 1927 + retry: 1928 + err = ext4_es_remove_extent(inode, 0, EXT_MAX_BLOCKS); 1929 + if (err == -ENOMEM) { 1930 + cond_resched(); 1931 + congestion_wait(BLK_RW_ASYNC, HZ/50); 1932 + goto retry; 1933 + } 1934 + if (err) 1935 + goto out_error; 1936 + } 1937 + 1922 1938 /* Clear the content in the xattr space. */ 1923 1939 if (inline_size > EXT4_MIN_INLINE_DATA_SIZE) { 1924 1940 if ((err = ext4_xattr_ibody_find(inode, &i, &is)) != 0)
+60 -118
fs/ext4/inode.c
··· 1284 1284 loff_t old_size = inode->i_size; 1285 1285 int ret = 0, ret2; 1286 1286 int i_size_changed = 0; 1287 - int inline_data = ext4_has_inline_data(inode); 1288 1287 bool verity = ext4_verity_in_progress(inode); 1289 1288 1290 1289 trace_ext4_write_end(inode, pos, len, copied); 1291 - if (inline_data) { 1292 - ret = ext4_write_inline_data_end(inode, pos, len, 1293 - copied, page); 1294 - if (ret < 0) { 1295 - unlock_page(page); 1296 - put_page(page); 1297 - goto errout; 1298 - } 1299 - copied = ret; 1300 - } else 1301 - copied = block_write_end(file, mapping, pos, 1302 - len, copied, page, fsdata); 1290 + 1291 + if (ext4_has_inline_data(inode)) 1292 + return ext4_write_inline_data_end(inode, pos, len, copied, page); 1293 + 1294 + copied = block_write_end(file, mapping, pos, len, copied, page, fsdata); 1303 1295 /* 1304 1296 * it's important to update i_size while still holding page lock: 1305 1297 * page writeout could otherwise come in and zero beyond i_size. ··· 1312 1320 * ordering of page lock and transaction start for journaling 1313 1321 * filesystems. 1314 1322 */ 1315 - if (i_size_changed || inline_data) 1323 + if (i_size_changed) 1316 1324 ret = ext4_mark_inode_dirty(handle, inode); 1317 1325 1318 1326 if (pos + len > inode->i_size && !verity && ext4_can_truncate(inode)) ··· 1321 1329 * inode->i_size. So truncate them 1322 1330 */ 1323 1331 ext4_orphan_add(handle, inode); 1324 - errout: 1332 + 1325 1333 ret2 = ext4_journal_stop(handle); 1326 1334 if (!ret) 1327 1335 ret = ret2; ··· 1387 1395 int partial = 0; 1388 1396 unsigned from, to; 1389 1397 int size_changed = 0; 1390 - int inline_data = ext4_has_inline_data(inode); 1391 1398 bool verity = ext4_verity_in_progress(inode); 1392 1399 1393 1400 trace_ext4_journalled_write_end(inode, pos, len, copied); ··· 1395 1404 1396 1405 BUG_ON(!ext4_handle_valid(handle)); 1397 1406 1398 - if (inline_data) { 1399 - ret = ext4_write_inline_data_end(inode, pos, len, 1400 - copied, page); 1401 - if (ret < 0) { 1402 - unlock_page(page); 1403 - put_page(page); 1404 - goto errout; 1405 - } 1406 - copied = ret; 1407 - } else if (unlikely(copied < len) && !PageUptodate(page)) { 1407 + if (ext4_has_inline_data(inode)) 1408 + return ext4_write_inline_data_end(inode, pos, len, copied, page); 1409 + 1410 + if (unlikely(copied < len) && !PageUptodate(page)) { 1408 1411 copied = 0; 1409 1412 ext4_journalled_zero_new_buffers(handle, inode, page, from, to); 1410 1413 } else { ··· 1421 1436 if (old_size < pos && !verity) 1422 1437 pagecache_isize_extended(inode, old_size, pos); 1423 1438 1424 - if (size_changed || inline_data) { 1439 + if (size_changed) { 1425 1440 ret2 = ext4_mark_inode_dirty(handle, inode); 1426 1441 if (!ret) 1427 1442 ret = ret2; ··· 1434 1449 */ 1435 1450 ext4_orphan_add(handle, inode); 1436 1451 1437 - errout: 1438 1452 ret2 = ext4_journal_stop(handle); 1439 1453 if (!ret) 1440 1454 ret = ret2; ··· 1628 1644 struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); 1629 1645 int ret; 1630 1646 bool allocated = false; 1647 + bool reserved = false; 1631 1648 1632 1649 /* 1633 1650 * If the cluster containing lblk is shared with a delayed, ··· 1645 1660 ret = ext4_da_reserve_space(inode); 1646 1661 if (ret != 0) /* ENOSPC */ 1647 1662 goto errout; 1663 + reserved = true; 1648 1664 } else { /* bigalloc */ 1649 1665 if (!ext4_es_scan_clu(inode, &ext4_es_is_delonly, lblk)) { 1650 1666 if (!ext4_es_scan_clu(inode, ··· 1658 1672 ret = ext4_da_reserve_space(inode); 1659 1673 if (ret != 0) /* ENOSPC */ 1660 1674 goto errout; 1675 + reserved = true; 1661 1676 } else { 1662 1677 allocated = true; 1663 1678 } ··· 1669 1682 } 1670 1683 1671 1684 ret = ext4_es_insert_delayed_block(inode, lblk, allocated); 1685 + if (ret && reserved) 1686 + ext4_da_release_space(inode, 1); 1672 1687 1673 1688 errout: 1674 1689 return ret; ··· 1711 1722 } 1712 1723 1713 1724 /* 1714 - * Delayed extent could be allocated by fallocate. 1715 - * So we need to check it. 1725 + * the buffer head associated with a delayed and not unwritten 1726 + * block found in the extent status cache must contain an 1727 + * invalid block number and have its BH_New and BH_Delay bits 1728 + * set, reflecting the state assigned when the block was 1729 + * initially delayed allocated 1716 1730 */ 1717 - if (ext4_es_is_delayed(&es) && !ext4_es_is_unwritten(&es)) { 1718 - map_bh(bh, inode->i_sb, invalid_block); 1719 - set_buffer_new(bh); 1720 - set_buffer_delay(bh); 1731 + if (ext4_es_is_delonly(&es)) { 1732 + BUG_ON(bh->b_blocknr != invalid_block); 1733 + BUG_ON(!buffer_new(bh)); 1734 + BUG_ON(!buffer_delay(bh)); 1721 1735 return 0; 1722 1736 } 1723 1737 ··· 2924 2932 return 0; 2925 2933 } 2926 2934 2927 - /* We always reserve for an inode update; the superblock could be there too */ 2928 - static int ext4_da_write_credits(struct inode *inode, loff_t pos, unsigned len) 2929 - { 2930 - if (likely(ext4_has_feature_large_file(inode->i_sb))) 2931 - return 1; 2932 - 2933 - if (pos + len <= 0x7fffffffULL) 2934 - return 1; 2935 - 2936 - /* We might need to update the superblock to set LARGE_FILE */ 2937 - return 2; 2938 - } 2939 - 2940 2935 static int ext4_da_write_begin(struct file *file, struct address_space *mapping, 2941 2936 loff_t pos, unsigned len, unsigned flags, 2942 2937 struct page **pagep, void **fsdata) ··· 2932 2953 struct page *page; 2933 2954 pgoff_t index; 2934 2955 struct inode *inode = mapping->host; 2935 - handle_t *handle; 2936 2956 2937 2957 if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) 2938 2958 return -EIO; ··· 2957 2979 return 0; 2958 2980 } 2959 2981 2960 - /* 2961 - * grab_cache_page_write_begin() can take a long time if the 2962 - * system is thrashing due to memory pressure, or if the page 2963 - * is being written back. So grab it first before we start 2964 - * the transaction handle. This also allows us to allocate 2965 - * the page (if needed) without using GFP_NOFS. 2966 - */ 2967 - retry_grab: 2982 + retry: 2968 2983 page = grab_cache_page_write_begin(mapping, index, flags); 2969 2984 if (!page) 2970 2985 return -ENOMEM; 2971 - unlock_page(page); 2972 2986 2973 - /* 2974 - * With delayed allocation, we don't log the i_disksize update 2975 - * if there is delayed block allocation. But we still need 2976 - * to journalling the i_disksize update if writes to the end 2977 - * of file which has an already mapped buffer. 2978 - */ 2979 - retry_journal: 2980 - handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE, 2981 - ext4_da_write_credits(inode, pos, len)); 2982 - if (IS_ERR(handle)) { 2983 - put_page(page); 2984 - return PTR_ERR(handle); 2985 - } 2986 - 2987 - lock_page(page); 2988 - if (page->mapping != mapping) { 2989 - /* The page got truncated from under us */ 2990 - unlock_page(page); 2991 - put_page(page); 2992 - ext4_journal_stop(handle); 2993 - goto retry_grab; 2994 - } 2995 2987 /* In case writeback began while the page was unlocked */ 2996 2988 wait_for_stable_page(page); 2997 2989 ··· 2973 3025 #endif 2974 3026 if (ret < 0) { 2975 3027 unlock_page(page); 2976 - ext4_journal_stop(handle); 3028 + put_page(page); 2977 3029 /* 2978 3030 * block_write_begin may have instantiated a few blocks 2979 3031 * outside i_size. Trim these off again. Don't need 2980 - * i_size_read because we hold i_mutex. 3032 + * i_size_read because we hold inode lock. 2981 3033 */ 2982 3034 if (pos + len > inode->i_size) 2983 3035 ext4_truncate_failed_write(inode); 2984 3036 2985 3037 if (ret == -ENOSPC && 2986 3038 ext4_should_retry_alloc(inode->i_sb, &retries)) 2987 - goto retry_journal; 2988 - 2989 - put_page(page); 3039 + goto retry; 2990 3040 return ret; 2991 3041 } 2992 3042 ··· 3021 3075 struct page *page, void *fsdata) 3022 3076 { 3023 3077 struct inode *inode = mapping->host; 3024 - int ret = 0, ret2; 3025 - handle_t *handle = ext4_journal_current_handle(); 3026 3078 loff_t new_i_size; 3027 3079 unsigned long start, end; 3028 3080 int write_mode = (int)(unsigned long)fsdata; ··· 3030 3086 len, copied, page, fsdata); 3031 3087 3032 3088 trace_ext4_da_write_end(inode, pos, len, copied); 3033 - start = pos & (PAGE_SIZE - 1); 3034 - end = start + copied - 1; 3035 - 3036 - /* 3037 - * generic_write_end() will run mark_inode_dirty() if i_size 3038 - * changes. So let's piggyback the i_disksize mark_inode_dirty 3039 - * into that. 3040 - */ 3041 - new_i_size = pos + copied; 3042 - if (copied && new_i_size > EXT4_I(inode)->i_disksize) { 3043 - if (ext4_has_inline_data(inode) || 3044 - ext4_da_should_update_i_disksize(page, end)) { 3045 - ext4_update_i_disksize(inode, new_i_size); 3046 - /* We need to mark inode dirty even if 3047 - * new_i_size is less that inode->i_size 3048 - * bu greater than i_disksize.(hint delalloc) 3049 - */ 3050 - ret = ext4_mark_inode_dirty(handle, inode); 3051 - } 3052 - } 3053 3089 3054 3090 if (write_mode != CONVERT_INLINE_DATA && 3055 3091 ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA) && 3056 3092 ext4_has_inline_data(inode)) 3057 - ret2 = ext4_da_write_inline_data_end(inode, pos, len, copied, 3058 - page); 3059 - else 3060 - ret2 = generic_write_end(file, mapping, pos, len, copied, 3061 - page, fsdata); 3093 + return ext4_write_inline_data_end(inode, pos, len, copied, page); 3062 3094 3063 - copied = ret2; 3064 - if (ret2 < 0) 3065 - ret = ret2; 3066 - ret2 = ext4_journal_stop(handle); 3067 - if (unlikely(ret2 && !ret)) 3068 - ret = ret2; 3095 + start = pos & (PAGE_SIZE - 1); 3096 + end = start + copied - 1; 3069 3097 3070 - return ret ? ret : copied; 3098 + /* 3099 + * Since we are holding inode lock, we are sure i_disksize <= 3100 + * i_size. We also know that if i_disksize < i_size, there are 3101 + * delalloc writes pending in the range upto i_size. If the end of 3102 + * the current write is <= i_size, there's no need to touch 3103 + * i_disksize since writeback will push i_disksize upto i_size 3104 + * eventually. If the end of the current write is > i_size and 3105 + * inside an allocated block (ext4_da_should_update_i_disksize() 3106 + * check), we need to update i_disksize here as neither 3107 + * ext4_writepage() nor certain ext4_writepages() paths not 3108 + * allocating blocks update i_disksize. 3109 + * 3110 + * Note that we defer inode dirtying to generic_write_end() / 3111 + * ext4_da_write_inline_data_end(). 3112 + */ 3113 + new_i_size = pos + copied; 3114 + if (copied && new_i_size > inode->i_size && 3115 + ext4_da_should_update_i_disksize(page, end)) 3116 + ext4_update_i_disksize(inode, new_i_size); 3117 + 3118 + return generic_write_end(file, mapping, pos, len, copied, page, fsdata); 3071 3119 } 3072 3120 3073 3121 /* ··· 4276 4340 goto has_buffer; 4277 4341 4278 4342 lock_buffer(bh); 4343 + if (ext4_buffer_uptodate(bh)) { 4344 + /* Someone brought it uptodate while we waited */ 4345 + unlock_buffer(bh); 4346 + goto has_buffer; 4347 + } 4348 + 4279 4349 /* 4280 4350 * If we have all information of the inode in memory and this 4281 4351 * is the only valid inode in the block, we need not read the
+15 -6
fs/ext4/super.c
··· 658 658 * constraints, it may not be safe to do it right here so we 659 659 * defer superblock flushing to a workqueue. 660 660 */ 661 - if (continue_fs) 661 + if (continue_fs && journal) 662 662 schedule_work(&EXT4_SB(sb)->s_error_work); 663 663 else 664 664 ext4_commit_super(sb); ··· 1350 1350 true); 1351 1351 dump_stack(); 1352 1352 } 1353 + 1354 + if (EXT4_I(inode)->i_reserved_data_blocks) 1355 + ext4_msg(inode->i_sb, KERN_ERR, 1356 + "Inode %lu (%p): i_reserved_data_blocks (%u) not cleared!", 1357 + inode->i_ino, EXT4_I(inode), 1358 + EXT4_I(inode)->i_reserved_data_blocks); 1353 1359 } 1354 1360 1355 1361 static void init_once(void *foo) ··· 3027 3021 */ 3028 3022 static loff_t ext4_max_bitmap_size(int bits, int has_huge_files) 3029 3023 { 3030 - loff_t res = EXT4_NDIR_BLOCKS; 3024 + unsigned long long upper_limit, res = EXT4_NDIR_BLOCKS; 3031 3025 int meta_blocks; 3032 - loff_t upper_limit; 3033 - /* This is calculated to be the largest file size for a dense, block 3026 + 3027 + /* 3028 + * This is calculated to be the largest file size for a dense, block 3034 3029 * mapped file such that the file's total number of 512-byte sectors, 3035 3030 * including data and all indirect blocks, does not exceed (2^48 - 1). 3036 3031 * 3037 3032 * __u32 i_blocks_lo and _u16 i_blocks_high represent the total 3038 3033 * number of 512-byte sectors of the file. 3039 3034 */ 3040 - 3041 3035 if (!has_huge_files) { 3042 3036 /* 3043 3037 * !has_huge_files or implies that the inode i_block field ··· 3080 3074 if (res > MAX_LFS_FILESIZE) 3081 3075 res = MAX_LFS_FILESIZE; 3082 3076 3083 - return res; 3077 + return (loff_t)res; 3084 3078 } 3085 3079 3086 3080 static ext4_fsblk_t descriptor_loc(struct super_block *sb, ··· 5048 5042 sbi->s_ea_block_cache = NULL; 5049 5043 5050 5044 if (sbi->s_journal) { 5045 + /* flush s_error_work before journal destroy. */ 5046 + flush_work(&sbi->s_error_work); 5051 5047 jbd2_journal_destroy(sbi->s_journal); 5052 5048 sbi->s_journal = NULL; 5053 5049 } 5054 5050 failed_mount3a: 5055 5051 ext4_es_unregister_shrinker(sbi); 5056 5052 failed_mount3: 5053 + /* flush s_error_work before sbi destroy */ 5057 5054 flush_work(&sbi->s_error_work); 5058 5055 del_timer_sync(&sbi->s_err_report); 5059 5056 ext4_stop_mmpd(sbi);
+1 -1
fs/fscache/object.c
··· 77 77 static WORK_STATE(PARENT_READY, "PRDY", fscache_parent_ready); 78 78 static WORK_STATE(ABORT_INIT, "ABRT", fscache_abort_initialisation); 79 79 static WORK_STATE(LOOK_UP_OBJECT, "LOOK", fscache_look_up_object); 80 - static WORK_STATE(CREATE_OBJECT, "CRTO", fscache_look_up_object); 81 80 static WORK_STATE(OBJECT_AVAILABLE, "AVBL", fscache_object_available); 82 81 static WORK_STATE(JUMPSTART_DEPS, "JUMP", fscache_jumpstart_dependents); 83 82 ··· 906 907 * @object: The object to ask about 907 908 * @data: The auxiliary data for the object 908 909 * @datalen: The size of the auxiliary data 910 + * @object_size: The size of the object according to the server. 909 911 * 910 912 * This function consults the netfs about the coherency state of an object. 911 913 * The caller must be holding a ref on cookie->n_active (held by
+3
fs/fscache/operation.c
··· 22 22 23 23 /** 24 24 * fscache_operation_init - Do basic initialisation of an operation 25 + * @cookie: The cookie to operate on 25 26 * @op: The operation to initialise 27 + * @processor: The function to perform the operation 28 + * @cancel: A function to handle operation cancellation 26 29 * @release: The release function to assign 27 30 * 28 31 * Do basic initialisation of an operation. The caller must still set flags,
+1 -4
fs/io-wq.c
··· 584 584 585 585 if (!get_signal(&ksig)) 586 586 continue; 587 - if (fatal_signal_pending(current) || 588 - signal_group_exit(current->signal)) 589 - break; 590 - continue; 587 + break; 591 588 } 592 589 last_timeout = !ret; 593 590 }
+2 -15
fs/io_uring.c
··· 403 403 struct wait_queue_head cq_wait; 404 404 unsigned cq_extra; 405 405 atomic_t cq_timeouts; 406 - struct fasync_struct *cq_fasync; 407 406 unsigned cq_last_tm_flush; 408 407 } ____cacheline_aligned_in_smp; 409 408 ··· 1613 1614 wake_up(&ctx->sq_data->wait); 1614 1615 if (io_should_trigger_evfd(ctx)) 1615 1616 eventfd_signal(ctx->cq_ev_fd, 1); 1616 - if (waitqueue_active(&ctx->poll_wait)) { 1617 + if (waitqueue_active(&ctx->poll_wait)) 1617 1618 wake_up_interruptible(&ctx->poll_wait); 1618 - kill_fasync(&ctx->cq_fasync, SIGIO, POLL_IN); 1619 - } 1620 1619 } 1621 1620 1622 1621 static void io_cqring_ev_posted_iopoll(struct io_ring_ctx *ctx) ··· 1628 1631 } 1629 1632 if (io_should_trigger_evfd(ctx)) 1630 1633 eventfd_signal(ctx->cq_ev_fd, 1); 1631 - if (waitqueue_active(&ctx->poll_wait)) { 1634 + if (waitqueue_active(&ctx->poll_wait)) 1632 1635 wake_up_interruptible(&ctx->poll_wait); 1633 - kill_fasync(&ctx->cq_fasync, SIGIO, POLL_IN); 1634 - } 1635 1636 } 1636 1637 1637 1638 /* Returns true if there are no backlogged entries after the flush */ ··· 9340 9345 return mask; 9341 9346 } 9342 9347 9343 - static int io_uring_fasync(int fd, struct file *file, int on) 9344 - { 9345 - struct io_ring_ctx *ctx = file->private_data; 9346 - 9347 - return fasync_helper(fd, file, on, &ctx->cq_fasync); 9348 - } 9349 - 9350 9348 static int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id) 9351 9349 { 9352 9350 const struct cred *creds; ··· 10133 10145 .mmap_capabilities = io_uring_nommu_mmap_capabilities, 10134 10146 #endif 10135 10147 .poll = io_uring_poll, 10136 - .fasync = io_uring_fasync, 10137 10148 #ifdef CONFIG_PROC_FS 10138 10149 .show_fdinfo = io_uring_show_fdinfo, 10139 10150 #endif
+7 -2
fs/kernfs/dir.c
··· 1116 1116 if (!inode) 1117 1117 inode = ERR_PTR(-ENOMEM); 1118 1118 } 1119 - /* Needed only for negative dentry validation */ 1120 - if (!inode) 1119 + /* 1120 + * Needed for negative dentry validation. 1121 + * The negative dentry can be created in kernfs_iop_lookup() 1122 + * or transforms from positive dentry in dentry_unlink_inode() 1123 + * called from vfs_rmdir(). 1124 + */ 1125 + if (!IS_ERR(inode)) 1121 1126 kernfs_set_rev(parent, dentry); 1122 1127 up_read(&kernfs_rwsem); 1123 1128
-205
fs/ksmbd/auth.c
··· 68 68 memcpy(buf, NEGOTIATE_GSS_HEADER, AUTH_GSS_LENGTH); 69 69 } 70 70 71 - static void 72 - str_to_key(unsigned char *str, unsigned char *key) 73 - { 74 - int i; 75 - 76 - key[0] = str[0] >> 1; 77 - key[1] = ((str[0] & 0x01) << 6) | (str[1] >> 2); 78 - key[2] = ((str[1] & 0x03) << 5) | (str[2] >> 3); 79 - key[3] = ((str[2] & 0x07) << 4) | (str[3] >> 4); 80 - key[4] = ((str[3] & 0x0F) << 3) | (str[4] >> 5); 81 - key[5] = ((str[4] & 0x1F) << 2) | (str[5] >> 6); 82 - key[6] = ((str[5] & 0x3F) << 1) | (str[6] >> 7); 83 - key[7] = str[6] & 0x7F; 84 - for (i = 0; i < 8; i++) 85 - key[i] = (key[i] << 1); 86 - } 87 - 88 - static int 89 - smbhash(unsigned char *out, const unsigned char *in, unsigned char *key) 90 - { 91 - unsigned char key2[8]; 92 - struct des_ctx ctx; 93 - 94 - if (fips_enabled) { 95 - ksmbd_debug(AUTH, "FIPS compliance enabled: DES not permitted\n"); 96 - return -ENOENT; 97 - } 98 - 99 - str_to_key(key, key2); 100 - des_expand_key(&ctx, key2, DES_KEY_SIZE); 101 - des_encrypt(&ctx, out, in); 102 - memzero_explicit(&ctx, sizeof(ctx)); 103 - return 0; 104 - } 105 - 106 - static int ksmbd_enc_p24(unsigned char *p21, const unsigned char *c8, unsigned char *p24) 107 - { 108 - int rc; 109 - 110 - rc = smbhash(p24, c8, p21); 111 - if (rc) 112 - return rc; 113 - rc = smbhash(p24 + 8, c8, p21 + 7); 114 - if (rc) 115 - return rc; 116 - return smbhash(p24 + 16, c8, p21 + 14); 117 - } 118 - 119 - /* produce a md4 message digest from data of length n bytes */ 120 - static int ksmbd_enc_md4(unsigned char *md4_hash, unsigned char *link_str, 121 - int link_len) 122 - { 123 - int rc; 124 - struct ksmbd_crypto_ctx *ctx; 125 - 126 - ctx = ksmbd_crypto_ctx_find_md4(); 127 - if (!ctx) { 128 - ksmbd_debug(AUTH, "Crypto md4 allocation error\n"); 129 - return -ENOMEM; 130 - } 131 - 132 - rc = crypto_shash_init(CRYPTO_MD4(ctx)); 133 - if (rc) { 134 - ksmbd_debug(AUTH, "Could not init md4 shash\n"); 135 - goto out; 136 - } 137 - 138 - rc = crypto_shash_update(CRYPTO_MD4(ctx), link_str, link_len); 139 - if (rc) { 140 - ksmbd_debug(AUTH, "Could not update with link_str\n"); 141 - goto out; 142 - } 143 - 144 - rc = crypto_shash_final(CRYPTO_MD4(ctx), md4_hash); 145 - if (rc) 146 - ksmbd_debug(AUTH, "Could not generate md4 hash\n"); 147 - out: 148 - ksmbd_release_crypto_ctx(ctx); 149 - return rc; 150 - } 151 - 152 - static int ksmbd_enc_update_sess_key(unsigned char *md5_hash, char *nonce, 153 - char *server_challenge, int len) 154 - { 155 - int rc; 156 - struct ksmbd_crypto_ctx *ctx; 157 - 158 - ctx = ksmbd_crypto_ctx_find_md5(); 159 - if (!ctx) { 160 - ksmbd_debug(AUTH, "Crypto md5 allocation error\n"); 161 - return -ENOMEM; 162 - } 163 - 164 - rc = crypto_shash_init(CRYPTO_MD5(ctx)); 165 - if (rc) { 166 - ksmbd_debug(AUTH, "Could not init md5 shash\n"); 167 - goto out; 168 - } 169 - 170 - rc = crypto_shash_update(CRYPTO_MD5(ctx), server_challenge, len); 171 - if (rc) { 172 - ksmbd_debug(AUTH, "Could not update with challenge\n"); 173 - goto out; 174 - } 175 - 176 - rc = crypto_shash_update(CRYPTO_MD5(ctx), nonce, len); 177 - if (rc) { 178 - ksmbd_debug(AUTH, "Could not update with nonce\n"); 179 - goto out; 180 - } 181 - 182 - rc = crypto_shash_final(CRYPTO_MD5(ctx), md5_hash); 183 - if (rc) 184 - ksmbd_debug(AUTH, "Could not generate md5 hash\n"); 185 - out: 186 - ksmbd_release_crypto_ctx(ctx); 187 - return rc; 188 - } 189 - 190 71 /** 191 72 * ksmbd_gen_sess_key() - function to generate session key 192 73 * @sess: session of connection ··· 206 325 } 207 326 208 327 /** 209 - * ksmbd_auth_ntlm() - NTLM authentication handler 210 - * @sess: session of connection 211 - * @pw_buf: NTLM challenge response 212 - * @passkey: user password 213 - * 214 - * Return: 0 on success, error number on error 215 - */ 216 - int ksmbd_auth_ntlm(struct ksmbd_session *sess, char *pw_buf) 217 - { 218 - int rc; 219 - unsigned char p21[21]; 220 - char key[CIFS_AUTH_RESP_SIZE]; 221 - 222 - memset(p21, '\0', 21); 223 - memcpy(p21, user_passkey(sess->user), CIFS_NTHASH_SIZE); 224 - rc = ksmbd_enc_p24(p21, sess->ntlmssp.cryptkey, key); 225 - if (rc) { 226 - pr_err("password processing failed\n"); 227 - return rc; 228 - } 229 - 230 - ksmbd_enc_md4(sess->sess_key, user_passkey(sess->user), 231 - CIFS_SMB1_SESSKEY_SIZE); 232 - memcpy(sess->sess_key + CIFS_SMB1_SESSKEY_SIZE, key, 233 - CIFS_AUTH_RESP_SIZE); 234 - sess->sequence_number = 1; 235 - 236 - if (strncmp(pw_buf, key, CIFS_AUTH_RESP_SIZE) != 0) { 237 - ksmbd_debug(AUTH, "ntlmv1 authentication failed\n"); 238 - return -EINVAL; 239 - } 240 - 241 - ksmbd_debug(AUTH, "ntlmv1 authentication pass\n"); 242 - return 0; 243 - } 244 - 245 - /** 246 328 * ksmbd_auth_ntlmv2() - NTLMv2 authentication handler 247 329 * @sess: session of connection 248 330 * @ntlmv2: NTLMv2 challenge response ··· 286 442 } 287 443 288 444 /** 289 - * __ksmbd_auth_ntlmv2() - NTLM2(extended security) authentication handler 290 - * @sess: session of connection 291 - * @client_nonce: client nonce from LM response. 292 - * @ntlm_resp: ntlm response data from client. 293 - * 294 - * Return: 0 on success, error number on error 295 - */ 296 - static int __ksmbd_auth_ntlmv2(struct ksmbd_session *sess, char *client_nonce, 297 - char *ntlm_resp) 298 - { 299 - char sess_key[CIFS_SMB1_SESSKEY_SIZE] = {0}; 300 - int rc; 301 - unsigned char p21[21]; 302 - char key[CIFS_AUTH_RESP_SIZE]; 303 - 304 - rc = ksmbd_enc_update_sess_key(sess_key, 305 - client_nonce, 306 - (char *)sess->ntlmssp.cryptkey, 8); 307 - if (rc) { 308 - pr_err("password processing failed\n"); 309 - goto out; 310 - } 311 - 312 - memset(p21, '\0', 21); 313 - memcpy(p21, user_passkey(sess->user), CIFS_NTHASH_SIZE); 314 - rc = ksmbd_enc_p24(p21, sess_key, key); 315 - if (rc) { 316 - pr_err("password processing failed\n"); 317 - goto out; 318 - } 319 - 320 - if (memcmp(ntlm_resp, key, CIFS_AUTH_RESP_SIZE) != 0) 321 - rc = -EINVAL; 322 - out: 323 - return rc; 324 - } 325 - 326 - /** 327 445 * ksmbd_decode_ntlmssp_auth_blob() - helper function to construct 328 446 * authenticate blob 329 447 * @authblob: authenticate blob source pointer ··· 317 511 lm_off = le32_to_cpu(authblob->LmChallengeResponse.BufferOffset); 318 512 nt_off = le32_to_cpu(authblob->NtChallengeResponse.BufferOffset); 319 513 nt_len = le16_to_cpu(authblob->NtChallengeResponse.Length); 320 - 321 - /* process NTLM authentication */ 322 - if (nt_len == CIFS_AUTH_RESP_SIZE) { 323 - if (le32_to_cpu(authblob->NegotiateFlags) & 324 - NTLMSSP_NEGOTIATE_EXTENDED_SEC) 325 - return __ksmbd_auth_ntlmv2(sess, (char *)authblob + 326 - lm_off, (char *)authblob + nt_off); 327 - else 328 - return ksmbd_auth_ntlm(sess, (char *)authblob + 329 - nt_off); 330 - } 331 514 332 515 /* TODO : use domain name that imported from configuration file */ 333 516 domain_name = smb_strndup_from_utf16((const char *)authblob +
-16
fs/ksmbd/crypto_ctx.c
··· 81 81 case CRYPTO_SHASH_SHA512: 82 82 tfm = crypto_alloc_shash("sha512", 0, 0); 83 83 break; 84 - case CRYPTO_SHASH_MD4: 85 - tfm = crypto_alloc_shash("md4", 0, 0); 86 - break; 87 - case CRYPTO_SHASH_MD5: 88 - tfm = crypto_alloc_shash("md5", 0, 0); 89 - break; 90 84 default: 91 85 return NULL; 92 86 } ··· 206 212 struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha512(void) 207 213 { 208 214 return ____crypto_shash_ctx_find(CRYPTO_SHASH_SHA512); 209 - } 210 - 211 - struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md4(void) 212 - { 213 - return ____crypto_shash_ctx_find(CRYPTO_SHASH_MD4); 214 - } 215 - 216 - struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md5(void) 217 - { 218 - return ____crypto_shash_ctx_find(CRYPTO_SHASH_MD5); 219 215 } 220 216 221 217 static struct ksmbd_crypto_ctx *____crypto_aead_ctx_find(int id)
-8
fs/ksmbd/crypto_ctx.h
··· 15 15 CRYPTO_SHASH_CMACAES, 16 16 CRYPTO_SHASH_SHA256, 17 17 CRYPTO_SHASH_SHA512, 18 - CRYPTO_SHASH_MD4, 19 - CRYPTO_SHASH_MD5, 20 18 CRYPTO_SHASH_MAX, 21 19 }; 22 20 ··· 41 43 #define CRYPTO_CMACAES(c) ((c)->desc[CRYPTO_SHASH_CMACAES]) 42 44 #define CRYPTO_SHA256(c) ((c)->desc[CRYPTO_SHASH_SHA256]) 43 45 #define CRYPTO_SHA512(c) ((c)->desc[CRYPTO_SHASH_SHA512]) 44 - #define CRYPTO_MD4(c) ((c)->desc[CRYPTO_SHASH_MD4]) 45 - #define CRYPTO_MD5(c) ((c)->desc[CRYPTO_SHASH_MD5]) 46 46 47 47 #define CRYPTO_HMACMD5_TFM(c) ((c)->desc[CRYPTO_SHASH_HMACMD5]->tfm) 48 48 #define CRYPTO_HMACSHA256_TFM(c)\ ··· 48 52 #define CRYPTO_CMACAES_TFM(c) ((c)->desc[CRYPTO_SHASH_CMACAES]->tfm) 49 53 #define CRYPTO_SHA256_TFM(c) ((c)->desc[CRYPTO_SHASH_SHA256]->tfm) 50 54 #define CRYPTO_SHA512_TFM(c) ((c)->desc[CRYPTO_SHASH_SHA512]->tfm) 51 - #define CRYPTO_MD4_TFM(c) ((c)->desc[CRYPTO_SHASH_MD4]->tfm) 52 - #define CRYPTO_MD5_TFM(c) ((c)->desc[CRYPTO_SHASH_MD5]->tfm) 53 55 54 56 #define CRYPTO_GCM(c) ((c)->ccmaes[CRYPTO_AEAD_AES_GCM]) 55 57 #define CRYPTO_CCM(c) ((c)->ccmaes[CRYPTO_AEAD_AES_CCM]) ··· 58 64 struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_cmacaes(void); 59 65 struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha512(void); 60 66 struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha256(void); 61 - struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md4(void); 62 - struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md5(void); 63 67 struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_gcm(void); 64 68 struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_ccm(void); 65 69 void ksmbd_crypto_destroy(void);
+7 -10
fs/ksmbd/misc.c
··· 162 162 { 163 163 char *ab_pathname; 164 164 165 - if (strlen(filename) == 0) { 166 - ab_pathname = kmalloc(2, GFP_KERNEL); 167 - ab_pathname[0] = '\\'; 168 - ab_pathname[1] = '\0'; 169 - } else { 170 - ab_pathname = kstrdup(filename, GFP_KERNEL); 171 - if (!ab_pathname) 172 - return NULL; 165 + if (strlen(filename) == 0) 166 + filename = "\\"; 173 167 174 - ksmbd_conv_path_to_windows(ab_pathname); 175 - } 168 + ab_pathname = kstrdup(filename, GFP_KERNEL); 169 + if (!ab_pathname) 170 + return NULL; 171 + 172 + ksmbd_conv_path_to_windows(ab_pathname); 176 173 return ab_pathname; 177 174 } 178 175
+31 -10
fs/ksmbd/oplock.c
··· 1451 1451 */ 1452 1452 struct create_context *smb2_find_context_vals(void *open_req, const char *tag) 1453 1453 { 1454 - char *data_offset; 1455 1454 struct create_context *cc; 1456 1455 unsigned int next = 0; 1457 1456 char *name; 1458 1457 struct smb2_create_req *req = (struct smb2_create_req *)open_req; 1458 + unsigned int remain_len, name_off, name_len, value_off, value_len, 1459 + cc_len; 1459 1460 1460 - data_offset = (char *)req + 4 + le32_to_cpu(req->CreateContextsOffset); 1461 - cc = (struct create_context *)data_offset; 1461 + /* 1462 + * CreateContextsOffset and CreateContextsLength are guaranteed to 1463 + * be valid because of ksmbd_smb2_check_message(). 1464 + */ 1465 + cc = (struct create_context *)((char *)req + 4 + 1466 + le32_to_cpu(req->CreateContextsOffset)); 1467 + remain_len = le32_to_cpu(req->CreateContextsLength); 1462 1468 do { 1463 - int val; 1464 - 1465 1469 cc = (struct create_context *)((char *)cc + next); 1466 - name = le16_to_cpu(cc->NameOffset) + (char *)cc; 1467 - val = le16_to_cpu(cc->NameLength); 1468 - if (val < 4) 1470 + if (remain_len < offsetof(struct create_context, Buffer)) 1469 1471 return ERR_PTR(-EINVAL); 1470 1472 1471 - if (memcmp(name, tag, val) == 0) 1472 - return cc; 1473 1473 next = le32_to_cpu(cc->Next); 1474 + name_off = le16_to_cpu(cc->NameOffset); 1475 + name_len = le16_to_cpu(cc->NameLength); 1476 + value_off = le16_to_cpu(cc->DataOffset); 1477 + value_len = le32_to_cpu(cc->DataLength); 1478 + cc_len = next ? next : remain_len; 1479 + 1480 + if ((next & 0x7) != 0 || 1481 + next > remain_len || 1482 + name_off != offsetof(struct create_context, Buffer) || 1483 + name_len < 4 || 1484 + name_off + name_len > cc_len || 1485 + (value_off & 0x7) != 0 || 1486 + (value_off && (value_off < name_off + name_len)) || 1487 + ((u64)value_off + value_len > cc_len)) 1488 + return ERR_PTR(-EINVAL); 1489 + 1490 + name = (char *)cc + name_off; 1491 + if (memcmp(name, tag, name_len) == 0) 1492 + return cc; 1493 + 1494 + remain_len -= next; 1474 1495 } while (next != 0); 1475 1496 1476 1497 return NULL;
+197 -61
fs/ksmbd/smb2pdu.c
··· 459 459 bool is_chained_smb2_message(struct ksmbd_work *work) 460 460 { 461 461 struct smb2_hdr *hdr = work->request_buf; 462 - unsigned int len; 462 + unsigned int len, next_cmd; 463 463 464 464 if (hdr->ProtocolId != SMB2_PROTO_NUMBER) 465 465 return false; 466 466 467 467 hdr = ksmbd_req_buf_next(work); 468 - if (le32_to_cpu(hdr->NextCommand) > 0) { 468 + next_cmd = le32_to_cpu(hdr->NextCommand); 469 + if (next_cmd > 0) { 470 + if ((u64)work->next_smb2_rcv_hdr_off + next_cmd + 471 + __SMB2_HEADER_STRUCTURE_SIZE > 472 + get_rfc1002_len(work->request_buf)) { 473 + pr_err("next command(%u) offset exceeds smb msg size\n", 474 + next_cmd); 475 + return false; 476 + } 477 + 469 478 ksmbd_debug(SMB, "got SMB2 chained command\n"); 470 479 init_chained_smb2_rsp(work); 471 480 return true; ··· 1067 1058 struct smb2_negotiate_req *req = work->request_buf; 1068 1059 struct smb2_negotiate_rsp *rsp = work->response_buf; 1069 1060 int rc = 0; 1061 + unsigned int smb2_buf_len, smb2_neg_size; 1070 1062 __le32 status; 1071 1063 1072 1064 ksmbd_debug(SMB, "Received negotiate request\n"); ··· 1083 1073 rsp->hdr.Status = STATUS_INVALID_PARAMETER; 1084 1074 rc = -EINVAL; 1085 1075 goto err_out; 1076 + } 1077 + 1078 + smb2_buf_len = get_rfc1002_len(work->request_buf); 1079 + smb2_neg_size = offsetof(struct smb2_negotiate_req, Dialects) - 4; 1080 + if (smb2_neg_size > smb2_buf_len) { 1081 + rsp->hdr.Status = STATUS_INVALID_PARAMETER; 1082 + rc = -EINVAL; 1083 + goto err_out; 1084 + } 1085 + 1086 + if (conn->dialect == SMB311_PROT_ID) { 1087 + unsigned int nego_ctxt_off = le32_to_cpu(req->NegotiateContextOffset); 1088 + 1089 + if (smb2_buf_len < nego_ctxt_off) { 1090 + rsp->hdr.Status = STATUS_INVALID_PARAMETER; 1091 + rc = -EINVAL; 1092 + goto err_out; 1093 + } 1094 + 1095 + if (smb2_neg_size > nego_ctxt_off) { 1096 + rsp->hdr.Status = STATUS_INVALID_PARAMETER; 1097 + rc = -EINVAL; 1098 + goto err_out; 1099 + } 1100 + 1101 + if (smb2_neg_size + le16_to_cpu(req->DialectCount) * sizeof(__le16) > 1102 + nego_ctxt_off) { 1103 + rsp->hdr.Status = STATUS_INVALID_PARAMETER; 1104 + rc = -EINVAL; 1105 + goto err_out; 1106 + } 1107 + } else { 1108 + if (smb2_neg_size + le16_to_cpu(req->DialectCount) * sizeof(__le16) > 1109 + smb2_buf_len) { 1110 + rsp->hdr.Status = STATUS_INVALID_PARAMETER; 1111 + rc = -EINVAL; 1112 + goto err_out; 1113 + } 1086 1114 } 1087 1115 1088 1116 conn->cli_cap = le32_to_cpu(req->Capabilities); ··· 2141 2093 * smb2_set_ea() - handler for setting extended attributes using set 2142 2094 * info command 2143 2095 * @eabuf: set info command buffer 2096 + * @buf_len: set info command buffer length 2144 2097 * @path: dentry path for get ea 2145 2098 * 2146 2099 * Return: 0 on success, otherwise error 2147 2100 */ 2148 - static int smb2_set_ea(struct smb2_ea_info *eabuf, struct path *path) 2101 + static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len, 2102 + struct path *path) 2149 2103 { 2150 2104 struct user_namespace *user_ns = mnt_user_ns(path->mnt); 2151 2105 char *attr_name = NULL, *value; 2152 2106 int rc = 0; 2153 - int next = 0; 2107 + unsigned int next = 0; 2108 + 2109 + if (buf_len < sizeof(struct smb2_ea_info) + eabuf->EaNameLength + 2110 + le16_to_cpu(eabuf->EaValueLength)) 2111 + return -EINVAL; 2154 2112 2155 2113 attr_name = kmalloc(XATTR_NAME_MAX + 1, GFP_KERNEL); 2156 2114 if (!attr_name) ··· 2221 2167 2222 2168 next: 2223 2169 next = le32_to_cpu(eabuf->NextEntryOffset); 2170 + if (next == 0 || buf_len < next) 2171 + break; 2172 + buf_len -= next; 2224 2173 eabuf = (struct smb2_ea_info *)((char *)eabuf + next); 2174 + if (next < (u32)eabuf->EaNameLength + le16_to_cpu(eabuf->EaValueLength)) 2175 + break; 2176 + 2225 2177 } while (next != 0); 2226 2178 2227 2179 kfree(attr_name); ··· 2427 2367 ksmbd_debug(SMB, 2428 2368 "Set ACLs using SMB2_CREATE_SD_BUFFER context\n"); 2429 2369 sd_buf = (struct create_sd_buf_req *)context; 2370 + if (le16_to_cpu(context->DataOffset) + 2371 + le32_to_cpu(context->DataLength) < 2372 + sizeof(struct create_sd_buf_req)) 2373 + return -EINVAL; 2430 2374 return set_info_sec(work->conn, work->tcon, path, &sd_buf->ntsd, 2431 2375 le32_to_cpu(sd_buf->ccontext.DataLength), true); 2432 2376 } ··· 2625 2561 goto err_out1; 2626 2562 } else if (context) { 2627 2563 ea_buf = (struct create_ea_buf_req *)context; 2564 + if (le16_to_cpu(context->DataOffset) + 2565 + le32_to_cpu(context->DataLength) < 2566 + sizeof(struct create_ea_buf_req)) { 2567 + rc = -EINVAL; 2568 + goto err_out1; 2569 + } 2628 2570 if (req->CreateOptions & FILE_NO_EA_KNOWLEDGE_LE) { 2629 2571 rsp->hdr.Status = STATUS_ACCESS_DENIED; 2630 2572 rc = -EACCES; ··· 2669 2599 } else if (context) { 2670 2600 struct create_posix *posix = 2671 2601 (struct create_posix *)context; 2602 + if (le16_to_cpu(context->DataOffset) + 2603 + le32_to_cpu(context->DataLength) < 2604 + sizeof(struct create_posix)) { 2605 + rc = -EINVAL; 2606 + goto err_out1; 2607 + } 2672 2608 ksmbd_debug(SMB, "get posix context\n"); 2673 2609 2674 2610 posix_mode = le32_to_cpu(posix->Mode); ··· 2824 2748 created = true; 2825 2749 user_ns = mnt_user_ns(path.mnt); 2826 2750 if (ea_buf) { 2827 - rc = smb2_set_ea(&ea_buf->ea, &path); 2751 + if (le32_to_cpu(ea_buf->ccontext.DataLength) < 2752 + sizeof(struct smb2_ea_info)) { 2753 + rc = -EINVAL; 2754 + goto err_out; 2755 + } 2756 + 2757 + rc = smb2_set_ea(&ea_buf->ea, 2758 + le32_to_cpu(ea_buf->ccontext.DataLength), 2759 + &path); 2828 2760 if (rc == -EOPNOTSUPP) 2829 2761 rc = 0; 2830 2762 else if (rc) ··· 3065 2981 rc = PTR_ERR(az_req); 3066 2982 goto err_out; 3067 2983 } else if (az_req) { 3068 - loff_t alloc_size = le64_to_cpu(az_req->AllocationSize); 2984 + loff_t alloc_size; 3069 2985 int err; 3070 2986 2987 + if (le16_to_cpu(az_req->ccontext.DataOffset) + 2988 + le32_to_cpu(az_req->ccontext.DataLength) < 2989 + sizeof(struct create_alloc_size_req)) { 2990 + rc = -EINVAL; 2991 + goto err_out; 2992 + } 2993 + alloc_size = le64_to_cpu(az_req->AllocationSize); 3071 2994 ksmbd_debug(SMB, 3072 2995 "request smb2 create allocate size : %llu\n", 3073 2996 alloc_size); ··· 4243 4152 static int get_file_basic_info(struct smb2_query_info_rsp *rsp, 4244 4153 struct ksmbd_file *fp, void *rsp_org) 4245 4154 { 4246 - struct smb2_file_all_info *basic_info; 4155 + struct smb2_file_basic_info *basic_info; 4247 4156 struct kstat stat; 4248 4157 u64 time; 4249 4158 ··· 4253 4162 return -EACCES; 4254 4163 } 4255 4164 4256 - basic_info = (struct smb2_file_all_info *)rsp->Buffer; 4165 + basic_info = (struct smb2_file_basic_info *)rsp->Buffer; 4257 4166 generic_fillattr(file_mnt_user_ns(fp->filp), file_inode(fp->filp), 4258 4167 &stat); 4259 4168 basic_info->CreationTime = cpu_to_le64(fp->create_time); ··· 4266 4175 basic_info->Attributes = fp->f_ci->m_fattr; 4267 4176 basic_info->Pad1 = 0; 4268 4177 rsp->OutputBufferLength = 4269 - cpu_to_le32(offsetof(struct smb2_file_all_info, AllocationSize)); 4270 - inc_rfc1001_len(rsp_org, offsetof(struct smb2_file_all_info, 4271 - AllocationSize)); 4178 + cpu_to_le32(sizeof(struct smb2_file_basic_info)); 4179 + inc_rfc1001_len(rsp_org, sizeof(struct smb2_file_basic_info)); 4272 4180 return 0; 4273 4181 } 4274 4182 ··· 5423 5333 static int smb2_create_link(struct ksmbd_work *work, 5424 5334 struct ksmbd_share_config *share, 5425 5335 struct smb2_file_link_info *file_info, 5426 - struct file *filp, 5336 + unsigned int buf_len, struct file *filp, 5427 5337 struct nls_table *local_nls) 5428 5338 { 5429 5339 char *link_name = NULL, *target_name = NULL, *pathname = NULL; 5430 5340 struct path path; 5431 5341 bool file_present = true; 5432 5342 int rc; 5343 + 5344 + if (buf_len < (u64)sizeof(struct smb2_file_link_info) + 5345 + le32_to_cpu(file_info->FileNameLength)) 5346 + return -EINVAL; 5433 5347 5434 5348 ksmbd_debug(SMB, "setting FILE_LINK_INFORMATION\n"); 5435 5349 pathname = kmalloc(PATH_MAX, GFP_KERNEL); ··· 5494 5400 return rc; 5495 5401 } 5496 5402 5497 - static int set_file_basic_info(struct ksmbd_file *fp, char *buf, 5403 + static int set_file_basic_info(struct ksmbd_file *fp, 5404 + struct smb2_file_basic_info *file_info, 5498 5405 struct ksmbd_share_config *share) 5499 5406 { 5500 - struct smb2_file_all_info *file_info; 5501 5407 struct iattr attrs; 5502 5408 struct timespec64 ctime; 5503 5409 struct file *filp; ··· 5508 5414 if (!(fp->daccess & FILE_WRITE_ATTRIBUTES_LE)) 5509 5415 return -EACCES; 5510 5416 5511 - file_info = (struct smb2_file_all_info *)buf; 5512 5417 attrs.ia_valid = 0; 5513 5418 filp = fp->filp; 5514 5419 inode = file_inode(filp); ··· 5584 5491 } 5585 5492 5586 5493 static int set_file_allocation_info(struct ksmbd_work *work, 5587 - struct ksmbd_file *fp, char *buf) 5494 + struct ksmbd_file *fp, 5495 + struct smb2_file_alloc_info *file_alloc_info) 5588 5496 { 5589 5497 /* 5590 5498 * TODO : It's working fine only when store dos attributes ··· 5593 5499 * properly with any smb.conf option 5594 5500 */ 5595 5501 5596 - struct smb2_file_alloc_info *file_alloc_info; 5597 5502 loff_t alloc_blks; 5598 5503 struct inode *inode; 5599 5504 int rc; ··· 5600 5507 if (!(fp->daccess & FILE_WRITE_DATA_LE)) 5601 5508 return -EACCES; 5602 5509 5603 - file_alloc_info = (struct smb2_file_alloc_info *)buf; 5604 5510 alloc_blks = (le64_to_cpu(file_alloc_info->AllocationSize) + 511) >> 9; 5605 5511 inode = file_inode(fp->filp); 5606 5512 ··· 5635 5543 } 5636 5544 5637 5545 static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp, 5638 - char *buf) 5546 + struct smb2_file_eof_info *file_eof_info) 5639 5547 { 5640 - struct smb2_file_eof_info *file_eof_info; 5641 5548 loff_t newsize; 5642 5549 struct inode *inode; 5643 5550 int rc; ··· 5644 5553 if (!(fp->daccess & FILE_WRITE_DATA_LE)) 5645 5554 return -EACCES; 5646 5555 5647 - file_eof_info = (struct smb2_file_eof_info *)buf; 5648 5556 newsize = le64_to_cpu(file_eof_info->EndOfFile); 5649 5557 inode = file_inode(fp->filp); 5650 5558 ··· 5670 5580 } 5671 5581 5672 5582 static int set_rename_info(struct ksmbd_work *work, struct ksmbd_file *fp, 5673 - char *buf) 5583 + struct smb2_file_rename_info *rename_info, 5584 + unsigned int buf_len) 5674 5585 { 5675 5586 struct user_namespace *user_ns; 5676 5587 struct ksmbd_file *parent_fp; ··· 5683 5592 pr_err("no right to delete : 0x%x\n", fp->daccess); 5684 5593 return -EACCES; 5685 5594 } 5595 + 5596 + if (buf_len < (u64)sizeof(struct smb2_file_rename_info) + 5597 + le32_to_cpu(rename_info->FileNameLength)) 5598 + return -EINVAL; 5686 5599 5687 5600 user_ns = file_mnt_user_ns(fp->filp); 5688 5601 if (ksmbd_stream_fd(fp)) ··· 5710 5615 } 5711 5616 } 5712 5617 next: 5713 - return smb2_rename(work, fp, user_ns, 5714 - (struct smb2_file_rename_info *)buf, 5618 + return smb2_rename(work, fp, user_ns, rename_info, 5715 5619 work->sess->conn->local_nls); 5716 5620 } 5717 5621 5718 - static int set_file_disposition_info(struct ksmbd_file *fp, char *buf) 5622 + static int set_file_disposition_info(struct ksmbd_file *fp, 5623 + struct smb2_file_disposition_info *file_info) 5719 5624 { 5720 - struct smb2_file_disposition_info *file_info; 5721 5625 struct inode *inode; 5722 5626 5723 5627 if (!(fp->daccess & FILE_DELETE_LE)) { ··· 5725 5631 } 5726 5632 5727 5633 inode = file_inode(fp->filp); 5728 - file_info = (struct smb2_file_disposition_info *)buf; 5729 5634 if (file_info->DeletePending) { 5730 5635 if (S_ISDIR(inode->i_mode) && 5731 5636 ksmbd_vfs_empty_dir(fp) == -ENOTEMPTY) ··· 5736 5643 return 0; 5737 5644 } 5738 5645 5739 - static int set_file_position_info(struct ksmbd_file *fp, char *buf) 5646 + static int set_file_position_info(struct ksmbd_file *fp, 5647 + struct smb2_file_pos_info *file_info) 5740 5648 { 5741 - struct smb2_file_pos_info *file_info; 5742 5649 loff_t current_byte_offset; 5743 5650 unsigned long sector_size; 5744 5651 struct inode *inode; 5745 5652 5746 5653 inode = file_inode(fp->filp); 5747 - file_info = (struct smb2_file_pos_info *)buf; 5748 5654 current_byte_offset = le64_to_cpu(file_info->CurrentByteOffset); 5749 5655 sector_size = inode->i_sb->s_blocksize; 5750 5656 ··· 5759 5667 return 0; 5760 5668 } 5761 5669 5762 - static int set_file_mode_info(struct ksmbd_file *fp, char *buf) 5670 + static int set_file_mode_info(struct ksmbd_file *fp, 5671 + struct smb2_file_mode_info *file_info) 5763 5672 { 5764 - struct smb2_file_mode_info *file_info; 5765 5673 __le32 mode; 5766 5674 5767 - file_info = (struct smb2_file_mode_info *)buf; 5768 5675 mode = file_info->Mode; 5769 5676 5770 5677 if ((mode & ~FILE_MODE_INFO_MASK) || ··· 5793 5702 * TODO: need to implement an error handling for STATUS_INFO_LENGTH_MISMATCH 5794 5703 */ 5795 5704 static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp, 5796 - int info_class, char *buf, 5705 + struct smb2_set_info_req *req, 5797 5706 struct ksmbd_share_config *share) 5798 5707 { 5799 - switch (info_class) { 5708 + unsigned int buf_len = le32_to_cpu(req->BufferLength); 5709 + 5710 + switch (req->FileInfoClass) { 5800 5711 case FILE_BASIC_INFORMATION: 5801 - return set_file_basic_info(fp, buf, share); 5712 + { 5713 + if (buf_len < sizeof(struct smb2_file_basic_info)) 5714 + return -EINVAL; 5802 5715 5716 + return set_file_basic_info(fp, (struct smb2_file_basic_info *)req->Buffer, share); 5717 + } 5803 5718 case FILE_ALLOCATION_INFORMATION: 5804 - return set_file_allocation_info(work, fp, buf); 5719 + { 5720 + if (buf_len < sizeof(struct smb2_file_alloc_info)) 5721 + return -EINVAL; 5805 5722 5723 + return set_file_allocation_info(work, fp, 5724 + (struct smb2_file_alloc_info *)req->Buffer); 5725 + } 5806 5726 case FILE_END_OF_FILE_INFORMATION: 5807 - return set_end_of_file_info(work, fp, buf); 5727 + { 5728 + if (buf_len < sizeof(struct smb2_file_eof_info)) 5729 + return -EINVAL; 5808 5730 5731 + return set_end_of_file_info(work, fp, 5732 + (struct smb2_file_eof_info *)req->Buffer); 5733 + } 5809 5734 case FILE_RENAME_INFORMATION: 5735 + { 5810 5736 if (!test_tree_conn_flag(work->tcon, KSMBD_TREE_CONN_FLAG_WRITABLE)) { 5811 5737 ksmbd_debug(SMB, 5812 5738 "User does not have write permission\n"); 5813 5739 return -EACCES; 5814 5740 } 5815 - return set_rename_info(work, fp, buf); 5816 5741 5742 + if (buf_len < sizeof(struct smb2_file_rename_info)) 5743 + return -EINVAL; 5744 + 5745 + return set_rename_info(work, fp, 5746 + (struct smb2_file_rename_info *)req->Buffer, 5747 + buf_len); 5748 + } 5817 5749 case FILE_LINK_INFORMATION: 5818 - return smb2_create_link(work, work->tcon->share_conf, 5819 - (struct smb2_file_link_info *)buf, fp->filp, 5820 - work->sess->conn->local_nls); 5750 + { 5751 + if (buf_len < sizeof(struct smb2_file_link_info)) 5752 + return -EINVAL; 5821 5753 5754 + return smb2_create_link(work, work->tcon->share_conf, 5755 + (struct smb2_file_link_info *)req->Buffer, 5756 + buf_len, fp->filp, 5757 + work->sess->conn->local_nls); 5758 + } 5822 5759 case FILE_DISPOSITION_INFORMATION: 5760 + { 5823 5761 if (!test_tree_conn_flag(work->tcon, KSMBD_TREE_CONN_FLAG_WRITABLE)) { 5824 5762 ksmbd_debug(SMB, 5825 5763 "User does not have write permission\n"); 5826 5764 return -EACCES; 5827 5765 } 5828 - return set_file_disposition_info(fp, buf); 5829 5766 5767 + if (buf_len < sizeof(struct smb2_file_disposition_info)) 5768 + return -EINVAL; 5769 + 5770 + return set_file_disposition_info(fp, 5771 + (struct smb2_file_disposition_info *)req->Buffer); 5772 + } 5830 5773 case FILE_FULL_EA_INFORMATION: 5831 5774 { 5832 5775 if (!(fp->daccess & FILE_WRITE_EA_LE)) { ··· 5869 5744 return -EACCES; 5870 5745 } 5871 5746 5872 - return smb2_set_ea((struct smb2_ea_info *)buf, 5873 - &fp->filp->f_path); 5874 - } 5747 + if (buf_len < sizeof(struct smb2_ea_info)) 5748 + return -EINVAL; 5875 5749 5750 + return smb2_set_ea((struct smb2_ea_info *)req->Buffer, 5751 + buf_len, &fp->filp->f_path); 5752 + } 5876 5753 case FILE_POSITION_INFORMATION: 5877 - return set_file_position_info(fp, buf); 5754 + { 5755 + if (buf_len < sizeof(struct smb2_file_pos_info)) 5756 + return -EINVAL; 5878 5757 5758 + return set_file_position_info(fp, (struct smb2_file_pos_info *)req->Buffer); 5759 + } 5879 5760 case FILE_MODE_INFORMATION: 5880 - return set_file_mode_info(fp, buf); 5761 + { 5762 + if (buf_len < sizeof(struct smb2_file_mode_info)) 5763 + return -EINVAL; 5764 + 5765 + return set_file_mode_info(fp, (struct smb2_file_mode_info *)req->Buffer); 5766 + } 5881 5767 } 5882 5768 5883 - pr_err("Unimplemented Fileinfoclass :%d\n", info_class); 5769 + pr_err("Unimplemented Fileinfoclass :%d\n", req->FileInfoClass); 5884 5770 return -EOPNOTSUPP; 5885 5771 } 5886 5772 ··· 5952 5816 switch (req->InfoType) { 5953 5817 case SMB2_O_INFO_FILE: 5954 5818 ksmbd_debug(SMB, "GOT SMB2_O_INFO_FILE\n"); 5955 - rc = smb2_set_info_file(work, fp, req->FileInfoClass, 5956 - req->Buffer, work->tcon->share_conf); 5819 + rc = smb2_set_info_file(work, fp, req, work->tcon->share_conf); 5957 5820 break; 5958 5821 case SMB2_O_INFO_SECURITY: 5959 5822 ksmbd_debug(SMB, "GOT SMB2_O_INFO_SECURITY\n"); ··· 8306 8171 8307 8172 WORK_BUFFERS(work, req, rsp); 8308 8173 8309 - if (le16_to_cpu(req->Command) == SMB2_NEGOTIATE_HE) 8174 + if (le16_to_cpu(req->Command) == SMB2_NEGOTIATE_HE && 8175 + conn->preauth_info) 8310 8176 ksmbd_gen_preauth_integrity_hash(conn, (char *)rsp, 8311 8177 conn->preauth_info->Preauth_HashValue); 8312 8178 ··· 8414 8278 unsigned int buf_data_size = pdu_length + 4 - 8415 8279 sizeof(struct smb2_transform_hdr); 8416 8280 struct smb2_transform_hdr *tr_hdr = (struct smb2_transform_hdr *)buf; 8417 - unsigned int orig_len = le32_to_cpu(tr_hdr->OriginalMessageSize); 8418 8281 int rc = 0; 8419 - 8420 - sess = ksmbd_session_lookup_all(conn, le64_to_cpu(tr_hdr->SessionId)); 8421 - if (!sess) { 8422 - pr_err("invalid session id(%llx) in transform header\n", 8423 - le64_to_cpu(tr_hdr->SessionId)); 8424 - return -ECONNABORTED; 8425 - } 8426 8282 8427 8283 if (pdu_length + 4 < 8428 8284 sizeof(struct smb2_transform_hdr) + sizeof(struct smb2_hdr)) { ··· 8423 8295 return -ECONNABORTED; 8424 8296 } 8425 8297 8426 - if (pdu_length + 4 < orig_len + sizeof(struct smb2_transform_hdr)) { 8298 + if (pdu_length + 4 < 8299 + le32_to_cpu(tr_hdr->OriginalMessageSize) + sizeof(struct smb2_transform_hdr)) { 8427 8300 pr_err("Transform message is broken\n"); 8301 + return -ECONNABORTED; 8302 + } 8303 + 8304 + sess = ksmbd_session_lookup_all(conn, le64_to_cpu(tr_hdr->SessionId)); 8305 + if (!sess) { 8306 + pr_err("invalid session id(%llx) in transform header\n", 8307 + le64_to_cpu(tr_hdr->SessionId)); 8428 8308 return -ECONNABORTED; 8429 8309 } 8430 8310
+9
fs/ksmbd/smb2pdu.h
··· 1464 1464 char FileName[1]; 1465 1465 } __packed; /* level 18 Query */ 1466 1466 1467 + struct smb2_file_basic_info { /* data block encoding of response to level 18 */ 1468 + __le64 CreationTime; /* Beginning of FILE_BASIC_INFO equivalent */ 1469 + __le64 LastAccessTime; 1470 + __le64 LastWriteTime; 1471 + __le64 ChangeTime; 1472 + __le32 Attributes; 1473 + __u32 Pad1; /* End of FILE_BASIC_INFO_INFO equivalent */ 1474 + } __packed; 1475 + 1467 1476 struct smb2_file_alt_name_info { 1468 1477 __le32 FileNameLength; 1469 1478 char FileName[0];
+28 -19
fs/ksmbd/smb_common.c
··· 155 155 */ 156 156 bool ksmbd_smb_request(struct ksmbd_conn *conn) 157 157 { 158 - int type = *(char *)conn->request_buf; 159 - 160 - switch (type) { 161 - case RFC1002_SESSION_MESSAGE: 162 - /* Regular SMB request */ 163 - return true; 164 - case RFC1002_SESSION_KEEP_ALIVE: 165 - ksmbd_debug(SMB, "RFC 1002 session keep alive\n"); 166 - break; 167 - default: 168 - ksmbd_debug(SMB, "RFC 1002 unknown request type 0x%x\n", type); 169 - } 170 - 171 - return false; 158 + return conn->request_buf[0] == 0; 172 159 } 173 160 174 161 static bool supported_protocol(int idx) ··· 169 182 idx <= server_conf.max_protocol); 170 183 } 171 184 172 - static char *next_dialect(char *dialect, int *next_off) 185 + static char *next_dialect(char *dialect, int *next_off, int bcount) 173 186 { 174 187 dialect = dialect + *next_off; 175 - *next_off = strlen(dialect); 188 + *next_off = strnlen(dialect, bcount); 189 + if (dialect[*next_off] != '\0') 190 + return NULL; 176 191 return dialect; 177 192 } 178 193 ··· 189 200 dialect = cli_dialects; 190 201 bcount = le16_to_cpu(byte_count); 191 202 do { 192 - dialect = next_dialect(dialect, &next); 203 + dialect = next_dialect(dialect, &next, bcount); 204 + if (!dialect) 205 + break; 193 206 ksmbd_debug(SMB, "client requested dialect %s\n", 194 207 dialect); 195 208 if (!strcmp(dialect, smb1_protos[i].name)) { ··· 239 248 240 249 static int ksmbd_negotiate_smb_dialect(void *buf) 241 250 { 242 - __le32 proto; 251 + int smb_buf_length = get_rfc1002_len(buf); 252 + __le32 proto = ((struct smb2_hdr *)buf)->ProtocolId; 243 253 244 - proto = ((struct smb2_hdr *)buf)->ProtocolId; 245 254 if (proto == SMB2_PROTO_NUMBER) { 246 255 struct smb2_negotiate_req *req; 256 + int smb2_neg_size = 257 + offsetof(struct smb2_negotiate_req, Dialects) - 4; 247 258 248 259 req = (struct smb2_negotiate_req *)buf; 260 + if (smb2_neg_size > smb_buf_length) 261 + goto err_out; 262 + 263 + if (smb2_neg_size + le16_to_cpu(req->DialectCount) * sizeof(__le16) > 264 + smb_buf_length) 265 + goto err_out; 266 + 249 267 return ksmbd_lookup_dialect_by_id(req->Dialects, 250 268 req->DialectCount); 251 269 } ··· 264 264 struct smb_negotiate_req *req; 265 265 266 266 req = (struct smb_negotiate_req *)buf; 267 + if (le16_to_cpu(req->ByteCount) < 2) 268 + goto err_out; 269 + 270 + if (offsetof(struct smb_negotiate_req, DialectsArray) - 4 + 271 + le16_to_cpu(req->ByteCount) > smb_buf_length) { 272 + goto err_out; 273 + } 274 + 267 275 return ksmbd_lookup_dialect_by_name(req->DialectsArray, 268 276 req->ByteCount); 269 277 } 270 278 279 + err_out: 271 280 return BAD_PROT_ID; 272 281 } 273 282
-8
fs/ksmbd/smb_common.h
··· 48 48 #define CIFS_DEFAULT_IOSIZE (64 * 1024) 49 49 #define MAX_CIFS_SMALL_BUFFER_SIZE 448 /* big enough for most */ 50 50 51 - /* RFC 1002 session packet types */ 52 - #define RFC1002_SESSION_MESSAGE 0x00 53 - #define RFC1002_SESSION_REQUEST 0x81 54 - #define RFC1002_POSITIVE_SESSION_RESPONSE 0x82 55 - #define RFC1002_NEGATIVE_SESSION_RESPONSE 0x83 56 - #define RFC1002_RETARGET_SESSION_RESPONSE 0x84 57 - #define RFC1002_SESSION_KEEP_ALIVE 0x85 58 - 59 51 /* Responses when opening a file. */ 60 52 #define F_SUPERSEDED 0 61 53 #define F_OPENED 1
+19 -2
fs/ksmbd/smbacl.c
··· 380 380 { 381 381 int i, ret; 382 382 int num_aces = 0; 383 - int acl_size; 383 + unsigned int acl_size; 384 384 char *acl_base; 385 385 struct smb_ace **ppace; 386 386 struct posix_acl_entry *cf_pace, *cf_pdace; ··· 392 392 return; 393 393 394 394 /* validate that we do not go past end of acl */ 395 - if (end_of_acl <= (char *)pdacl || 395 + if (end_of_acl < (char *)pdacl + sizeof(struct smb_acl) || 396 396 end_of_acl < (char *)pdacl + le16_to_cpu(pdacl->size)) { 397 397 pr_err("ACL too small to parse DACL\n"); 398 398 return; ··· 431 431 * user/group/other have no permissions 432 432 */ 433 433 for (i = 0; i < num_aces; ++i) { 434 + if (end_of_acl - acl_base < acl_size) 435 + break; 436 + 434 437 ppace[i] = (struct smb_ace *)(acl_base + acl_size); 435 438 acl_base = (char *)ppace[i]; 439 + acl_size = offsetof(struct smb_ace, sid) + 440 + offsetof(struct smb_sid, sub_auth); 441 + 442 + if (end_of_acl - acl_base < acl_size || 443 + ppace[i]->sid.num_subauth > SID_MAX_SUB_AUTHORITIES || 444 + (end_of_acl - acl_base < 445 + acl_size + sizeof(__le32) * ppace[i]->sid.num_subauth) || 446 + (le16_to_cpu(ppace[i]->size) < 447 + acl_size + sizeof(__le32) * ppace[i]->sid.num_subauth)) 448 + break; 449 + 436 450 acl_size = le16_to_cpu(ppace[i]->size); 437 451 ppace[i]->access_req = 438 452 smb_map_generic_desired_access(ppace[i]->access_req); ··· 820 806 821 807 if (!pntsd) 822 808 return -EIO; 809 + 810 + if (acl_len < sizeof(struct smb_ntsd)) 811 + return -EINVAL; 823 812 824 813 owner_sid_ptr = (struct smb_sid *)((char *)pntsd + 825 814 le32_to_cpu(pntsd->osidoffset));
+2 -2
fs/ksmbd/transport_tcp.c
··· 215 215 * ksmbd_kthread_fn() - listen to new SMB connections and callback server 216 216 * @p: arguments to forker thread 217 217 * 218 - * Return: Returns a task_struct or ERR_PTR 218 + * Return: 0 on success, error number otherwise 219 219 */ 220 220 static int ksmbd_kthread_fn(void *p) 221 221 { ··· 387 387 /** 388 388 * create_socket - create socket for ksmbd/0 389 389 * 390 - * Return: Returns a task_struct or ERR_PTR 390 + * Return: 0 on success, error number otherwise 391 391 */ 392 392 static int create_socket(struct interface *iface) 393 393 {
+1 -1
fs/netfs/read_helper.c
··· 150 150 { 151 151 struct iov_iter iter; 152 152 153 - iov_iter_xarray(&iter, WRITE, &subreq->rreq->mapping->i_pages, 153 + iov_iter_xarray(&iter, READ, &subreq->rreq->mapping->i_pages, 154 154 subreq->start + subreq->transferred, 155 155 subreq->len - subreq->transferred); 156 156 iov_iter_zero(iov_iter_count(&iter), &iter);
-1
fs/nfs_common/grace.c
··· 42 42 43 43 /** 44 44 * locks_end_grace 45 - * @net: net namespace that this lock manager belongs to 46 45 * @lm: who this grace period is for 47 46 * 48 47 * Call this function to state that the given lock manager is ready to
+1 -1
fs/nfsd/filecache.c
··· 542 542 } 543 543 544 544 /** 545 - * nfsd_file_close_inode_sync - attempt to forcibly close a nfsd_file 545 + * nfsd_file_close_inode - attempt a delayed close of a nfsd_file 546 546 * @inode: inode of the file to attempt to remove 547 547 * 548 548 * Walk the whole hash bucket, looking for any files that correspond to "inode".
+11 -8
fs/nfsd/nfs4xdr.c
··· 3544 3544 goto fail; 3545 3545 cd->rd_maxcount -= entry_bytes; 3546 3546 /* 3547 - * RFC 3530 14.2.24 describes rd_dircount as only a "hint", so 3548 - * let's always let through the first entry, at least: 3547 + * RFC 3530 14.2.24 describes rd_dircount as only a "hint", and 3548 + * notes that it could be zero. If it is zero, then the server 3549 + * should enforce only the rd_maxcount value. 3549 3550 */ 3550 - if (!cd->rd_dircount) 3551 - goto fail; 3552 - name_and_cookie = 4 + 4 * XDR_QUADLEN(namlen) + 8; 3553 - if (name_and_cookie > cd->rd_dircount && cd->cookie_offset) 3554 - goto fail; 3555 - cd->rd_dircount -= min(cd->rd_dircount, name_and_cookie); 3551 + if (cd->rd_dircount) { 3552 + name_and_cookie = 4 + 4 * XDR_QUADLEN(namlen) + 8; 3553 + if (name_and_cookie > cd->rd_dircount && cd->cookie_offset) 3554 + goto fail; 3555 + cd->rd_dircount -= min(cd->rd_dircount, name_and_cookie); 3556 + if (!cd->rd_dircount) 3557 + cd->rd_maxcount = 0; 3558 + } 3556 3559 3557 3560 cd->cookie_offset = cookie_offset; 3558 3561 skip_entry:
+5 -2
fs/nfsd/nfsctl.c
··· 793 793 svc_xprt_put(xprt); 794 794 } 795 795 out_err: 796 - nfsd_destroy(net); 796 + if (!list_empty(&nn->nfsd_serv->sv_permsocks)) 797 + nn->nfsd_serv->sv_nrthreads--; 798 + else 799 + nfsd_destroy(net); 797 800 return err; 798 801 } 799 802 ··· 1548 1545 goto out_free_all; 1549 1546 return 0; 1550 1547 out_free_all: 1551 - unregister_pernet_subsys(&nfsd_net_ops); 1548 + unregister_filesystem(&nfsd_fs_type); 1552 1549 out_free_exports: 1553 1550 remove_proc_entry("fs/nfs/exports", NULL); 1554 1551 remove_proc_entry("fs/nfs", NULL);
+7 -3
fs/overlayfs/dir.c
··· 1219 1219 goto out_dput; 1220 1220 } 1221 1221 } else { 1222 - if (!d_is_negative(newdentry) && 1223 - (!new_opaque || !ovl_is_whiteout(newdentry))) 1224 - goto out_dput; 1222 + if (!d_is_negative(newdentry)) { 1223 + if (!new_opaque || !ovl_is_whiteout(newdentry)) 1224 + goto out_dput; 1225 + } else { 1226 + if (flags & RENAME_EXCHANGE) 1227 + goto out_dput; 1228 + } 1225 1229 } 1226 1230 1227 1231 if (olddentry == trap)
+14 -1
fs/overlayfs/file.c
··· 296 296 if (ret) 297 297 return ret; 298 298 299 + ret = -EINVAL; 300 + if (iocb->ki_flags & IOCB_DIRECT && 301 + (!real.file->f_mapping->a_ops || 302 + !real.file->f_mapping->a_ops->direct_IO)) 303 + goto out_fdput; 304 + 299 305 old_cred = ovl_override_creds(file_inode(file)->i_sb); 300 306 if (is_sync_kiocb(iocb)) { 301 307 ret = vfs_iter_read(real.file, iter, &iocb->ki_pos, ··· 326 320 out: 327 321 revert_creds(old_cred); 328 322 ovl_file_accessed(file); 329 - 323 + out_fdput: 330 324 fdput(real); 331 325 332 326 return ret; ··· 354 348 ret = ovl_real_fdget(file, &real); 355 349 if (ret) 356 350 goto out_unlock; 351 + 352 + ret = -EINVAL; 353 + if (iocb->ki_flags & IOCB_DIRECT && 354 + (!real.file->f_mapping->a_ops || 355 + !real.file->f_mapping->a_ops->direct_IO)) 356 + goto out_fdput; 357 357 358 358 if (!ovl_should_sync(OVL_FS(inode->i_sb))) 359 359 ifl &= ~(IOCB_DSYNC | IOCB_SYNC); ··· 396 384 } 397 385 out: 398 386 revert_creds(old_cred); 387 + out_fdput: 399 388 fdput(real); 400 389 401 390 out_unlock:
+4 -3
include/linux/cpumask.h
··· 996 996 * cpumask; Typically used by bin_attribute to export cpumask bitmask 997 997 * ABI. 998 998 * 999 - * Returns the length of how many bytes have been copied. 999 + * Returns the length of how many bytes have been copied, excluding 1000 + * terminating '\0'. 1000 1001 */ 1001 1002 static inline ssize_t 1002 1003 cpumap_print_bitmask_to_buf(char *buf, const struct cpumask *mask, 1003 1004 loff_t off, size_t count) 1004 1005 { 1005 1006 return bitmap_print_bitmask_to_buf(buf, cpumask_bits(mask), 1006 - nr_cpu_ids, off, count); 1007 + nr_cpu_ids, off, count) - 1; 1007 1008 } 1008 1009 1009 1010 /** ··· 1019 1018 loff_t off, size_t count) 1020 1019 { 1021 1020 return bitmap_print_list_to_buf(buf, cpumask_bits(mask), 1022 - nr_cpu_ids, off, count); 1021 + nr_cpu_ids, off, count) - 1; 1023 1022 } 1024 1023 1025 1024 #if NR_CPUS <= BITS_PER_LONG
+1 -1
include/linux/etherdevice.h
··· 314 314 */ 315 315 static inline void eth_hw_addr_set(struct net_device *dev, const u8 *addr) 316 316 { 317 - ether_addr_copy(dev->dev_addr, addr); 317 + __dev_addr_set(dev, addr, ETH_ALEN); 318 318 } 319 319 320 320 /**
+8 -3
include/linux/fwnode.h
··· 22 22 * LINKS_ADDED: The fwnode has already be parsed to add fwnode links. 23 23 * NOT_DEVICE: The fwnode will never be populated as a struct device. 24 24 * INITIALIZED: The hardware corresponding to fwnode has been initialized. 25 + * NEEDS_CHILD_BOUND_ON_ADD: For this fwnode/device to probe successfully, its 26 + * driver needs its child devices to be bound with 27 + * their respective drivers as soon as they are 28 + * added. 25 29 */ 26 - #define FWNODE_FLAG_LINKS_ADDED BIT(0) 27 - #define FWNODE_FLAG_NOT_DEVICE BIT(1) 28 - #define FWNODE_FLAG_INITIALIZED BIT(2) 30 + #define FWNODE_FLAG_LINKS_ADDED BIT(0) 31 + #define FWNODE_FLAG_NOT_DEVICE BIT(1) 32 + #define FWNODE_FLAG_INITIALIZED BIT(2) 33 + #define FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD BIT(3) 29 34 30 35 struct fwnode_handle { 31 36 struct fwnode_handle *secondary;
+3 -1
include/linux/perf_event.h
··· 684 684 /* 685 685 * timestamp shadows the actual context timing but it can 686 686 * be safely used in NMI interrupt context. It reflects the 687 - * context time as it was when the event was last scheduled in. 687 + * context time as it was when the event was last scheduled in, 688 + * or when ctx_sched_in failed to schedule the event because we 689 + * run out of PMC. 688 690 * 689 691 * ctx_time already accounts for ctx->timestamp. Therefore to 690 692 * compute ctx_time for a sample, simply add perf_clock().
+2
include/linux/platform_data/usb-omap1.h
··· 48 48 u32 (*usb2_init)(unsigned nwires, unsigned alt_pingroup); 49 49 50 50 int (*ocpi_enable)(void); 51 + 52 + void (*lb_reset)(void); 51 53 }; 52 54 53 55 #endif /* __LINUX_USB_OMAP1_H */
+1 -1
include/linux/sched.h
··· 1720 1720 #define tsk_used_math(p) ((p)->flags & PF_USED_MATH) 1721 1721 #define used_math() tsk_used_math(current) 1722 1722 1723 - static inline bool is_percpu_thread(void) 1723 + static __always_inline bool is_percpu_thread(void) 1724 1724 { 1725 1725 #ifdef CONFIG_SMP 1726 1726 return (current->flags & PF_NO_SETAFFINITY) &&
-1
include/net/netfilter/ipv6/nf_defrag_ipv6.h
··· 17 17 struct nft_ct_frag6_pernet { 18 18 struct ctl_table_header *nf_frag_frags_hdr; 19 19 struct fqdir *fqdir; 20 - unsigned int users; 21 20 }; 22 21 23 22 #endif /* _NF_DEFRAG_IPV6_H */
+1 -1
include/net/netfilter/nf_tables.h
··· 1202 1202 1203 1203 void nft_obj_notify(struct net *net, const struct nft_table *table, 1204 1204 struct nft_object *obj, u32 portid, u32 seq, 1205 - int event, int family, int report, gfp_t gfp); 1205 + int event, u16 flags, int family, int report, gfp_t gfp); 1206 1206 1207 1207 /** 1208 1208 * struct nft_object_type - stateful object type
+6
include/net/netns/netfilter.h
··· 27 27 #if IS_ENABLED(CONFIG_DECNET) 28 28 struct nf_hook_entries __rcu *hooks_decnet[NF_DN_NUMHOOKS]; 29 29 #endif 30 + #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV4) 31 + unsigned int defrag_ipv4_users; 32 + #endif 33 + #if IS_ENABLED(CONFIG_NF_DEFRAG_IPV6) 34 + unsigned int defrag_ipv6_users; 35 + #endif 30 36 }; 31 37 #endif
+1
include/net/sock.h
··· 307 307 * @sk_priority: %SO_PRIORITY setting 308 308 * @sk_type: socket type (%SOCK_STREAM, etc) 309 309 * @sk_protocol: which protocol this socket belongs in this network family 310 + * @sk_peer_lock: lock protecting @sk_peer_pid and @sk_peer_cred 310 311 * @sk_peer_pid: &struct pid for this socket's peer 311 312 * @sk_peer_cred: %SO_PEERCRED setting 312 313 * @sk_rcvlowat: %SO_RCVLOWAT setting
+2 -2
include/soc/mscc/ocelot_vcap.h
··· 704 704 int ocelot_vcap_filter_del(struct ocelot *ocelot, 705 705 struct ocelot_vcap_filter *rule); 706 706 struct ocelot_vcap_filter * 707 - ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block, int id, 708 - bool tc_offload); 707 + ocelot_vcap_block_find_filter_by_id(struct ocelot_vcap_block *block, 708 + unsigned long cookie, bool tc_offload); 709 709 710 710 #endif /* _OCELOT_VCAP_H_ */
+3 -3
include/trace/events/cachefiles.h
··· 178 178 ), 179 179 180 180 TP_fast_assign( 181 - __entry->obj = obj->fscache.debug_id; 181 + __entry->obj = obj ? obj->fscache.debug_id : UINT_MAX; 182 182 __entry->de = de; 183 183 __entry->why = why; 184 184 ), ··· 205 205 ), 206 206 207 207 TP_fast_assign( 208 - __entry->obj = obj->fscache.debug_id; 208 + __entry->obj = obj ? obj->fscache.debug_id : UINT_MAX; 209 209 __entry->de = de; 210 210 __entry->to = to; 211 211 __entry->why = why; ··· 305 305 ), 306 306 307 307 TP_fast_assign( 308 - __entry->obj = obj->fscache.debug_id; 308 + __entry->obj = obj ? obj->fscache.debug_id : UINT_MAX; 309 309 __entry->de = de; 310 310 __entry->why = why; 311 311 ),
+1 -1
include/uapi/linux/hyperv.h
··· 26 26 #ifndef _UAPI_HYPERV_H 27 27 #define _UAPI_HYPERV_H 28 28 29 - #include <linux/uuid.h> 29 + #include <linux/types.h> 30 30 31 31 /* 32 32 * Framework version for util services.
+9 -6
include/uapi/linux/xfrm.h
··· 213 213 XFRM_MSG_GETSPDINFO, 214 214 #define XFRM_MSG_GETSPDINFO XFRM_MSG_GETSPDINFO 215 215 216 + XFRM_MSG_MAPPING, 217 + #define XFRM_MSG_MAPPING XFRM_MSG_MAPPING 218 + 216 219 XFRM_MSG_SETDEFAULT, 217 220 #define XFRM_MSG_SETDEFAULT XFRM_MSG_SETDEFAULT 218 221 XFRM_MSG_GETDEFAULT, 219 222 #define XFRM_MSG_GETDEFAULT XFRM_MSG_GETDEFAULT 220 - 221 - XFRM_MSG_MAPPING, 222 - #define XFRM_MSG_MAPPING XFRM_MSG_MAPPING 223 223 __XFRM_MSG_MAX 224 224 }; 225 225 #define XFRM_MSG_MAX (__XFRM_MSG_MAX - 1) ··· 514 514 #define XFRM_OFFLOAD_INBOUND 2 515 515 516 516 struct xfrm_userpolicy_default { 517 - #define XFRM_USERPOLICY_DIRMASK_MAX (sizeof(__u8) * 8) 518 - __u8 dirmask; 519 - __u8 action; 517 + #define XFRM_USERPOLICY_UNSPEC 0 518 + #define XFRM_USERPOLICY_BLOCK 1 519 + #define XFRM_USERPOLICY_ACCEPT 2 520 + __u8 in; 521 + __u8 fwd; 522 + __u8 out; 520 523 }; 521 524 522 525 #ifndef __KERNEL__
+2 -1
kernel/bpf/stackmap.c
··· 63 63 64 64 static int prealloc_elems_and_freelist(struct bpf_stack_map *smap) 65 65 { 66 - u32 elem_size = sizeof(struct stack_map_bucket) + smap->map.value_size; 66 + u64 elem_size = sizeof(struct stack_map_bucket) + 67 + (u64)smap->map.value_size; 67 68 int err; 68 69 69 70 smap->elems = bpf_map_area_alloc(elem_size * smap->map.max_entries,
+30 -4
kernel/events/core.c
··· 3707 3707 return 0; 3708 3708 } 3709 3709 3710 + static inline bool event_update_userpage(struct perf_event *event) 3711 + { 3712 + if (likely(!atomic_read(&event->mmap_count))) 3713 + return false; 3714 + 3715 + perf_event_update_time(event); 3716 + perf_set_shadow_time(event, event->ctx); 3717 + perf_event_update_userpage(event); 3718 + 3719 + return true; 3720 + } 3721 + 3722 + static inline void group_update_userpage(struct perf_event *group_event) 3723 + { 3724 + struct perf_event *event; 3725 + 3726 + if (!event_update_userpage(group_event)) 3727 + return; 3728 + 3729 + for_each_sibling_event(event, group_event) 3730 + event_update_userpage(event); 3731 + } 3732 + 3710 3733 static int merge_sched_in(struct perf_event *event, void *data) 3711 3734 { 3712 3735 struct perf_event_context *ctx = event->ctx; ··· 3748 3725 } 3749 3726 3750 3727 if (event->state == PERF_EVENT_STATE_INACTIVE) { 3728 + *can_add_hw = 0; 3751 3729 if (event->attr.pinned) { 3752 3730 perf_cgroup_event_disable(event, ctx); 3753 3731 perf_event_set_state(event, PERF_EVENT_STATE_ERROR); 3732 + } else { 3733 + ctx->rotate_necessary = 1; 3734 + perf_mux_hrtimer_restart(cpuctx); 3735 + group_update_userpage(event); 3754 3736 } 3755 - 3756 - *can_add_hw = 0; 3757 - ctx->rotate_necessary = 1; 3758 - perf_mux_hrtimer_restart(cpuctx); 3759 3737 } 3760 3738 3761 3739 return 0; ··· 6348 6324 6349 6325 ring_buffer_attach(event, rb); 6350 6326 6327 + perf_event_update_time(event); 6328 + perf_set_shadow_time(event, event->ctx); 6351 6329 perf_event_init_userpage(event); 6352 6330 perf_event_update_userpage(event); 6353 6331 } else {
+7 -1
kernel/sched/debug.c
··· 173 173 size_t cnt, loff_t *ppos) 174 174 { 175 175 char buf[16]; 176 + unsigned int scaling; 176 177 177 178 if (cnt > 15) 178 179 cnt = 15; 179 180 180 181 if (copy_from_user(&buf, ubuf, cnt)) 181 182 return -EFAULT; 183 + buf[cnt] = '\0'; 182 184 183 - if (kstrtouint(buf, 10, &sysctl_sched_tunable_scaling)) 185 + if (kstrtouint(buf, 10, &scaling)) 184 186 return -EINVAL; 185 187 188 + if (scaling >= SCHED_TUNABLESCALING_END) 189 + return -EINVAL; 190 + 191 + sysctl_sched_tunable_scaling = scaling; 186 192 if (sched_update_scaling()) 187 193 return -EINVAL; 188 194
+5 -1
kernel/sched/fair.c
··· 4936 4936 /* update hierarchical throttle state */ 4937 4937 walk_tg_tree_from(cfs_rq->tg, tg_nop, tg_unthrottle_up, (void *)rq); 4938 4938 4939 - if (!cfs_rq->load.weight) 4939 + /* Nothing to run but something to decay (on_list)? Complete the branch */ 4940 + if (!cfs_rq->load.weight) { 4941 + if (cfs_rq->on_list) 4942 + goto unthrottle_throttle; 4940 4943 return; 4944 + } 4941 4945 4942 4946 task_delta = cfs_rq->h_nr_running; 4943 4947 idle_task_delta = cfs_rq->idle_h_nr_running;
+2 -1
net/bridge/br_netlink.c
··· 1666 1666 } 1667 1667 1668 1668 return numvls * nla_total_size(sizeof(struct bridge_vlan_xstats)) + 1669 - nla_total_size(sizeof(struct br_mcast_stats)) + 1669 + nla_total_size_64bit(sizeof(struct br_mcast_stats)) + 1670 + (p ? nla_total_size_64bit(sizeof(p->stp_xstats)) : 0) + 1670 1671 nla_total_size(0); 1671 1672 } 1672 1673
+1 -1
net/core/rtnetlink.c
··· 5262 5262 static size_t if_nlmsg_stats_size(const struct net_device *dev, 5263 5263 u32 filter_mask) 5264 5264 { 5265 - size_t size = 0; 5265 + size_t size = NLMSG_ALIGN(sizeof(struct if_stats_msg)); 5266 5266 5267 5267 if (stats_attr_valid(filter_mask, IFLA_STATS_LINK_64, 0)) 5268 5268 size += nla_total_size_64bit(sizeof(struct rtnl_link_stats64));
+1 -1
net/dsa/tag_dsa.c
··· 210 210 cmd = dsa_header[0] >> 6; 211 211 switch (cmd) { 212 212 case DSA_CMD_FORWARD: 213 - trunk = !!(dsa_header[1] & 7); 213 + trunk = !!(dsa_header[1] & 4); 214 214 break; 215 215 216 216 case DSA_CMD_TO_CPU:
+3 -1
net/ipv4/inet_hashtables.c
··· 242 242 243 243 if (!inet_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif)) 244 244 return -1; 245 + score = sk->sk_bound_dev_if ? 2 : 1; 245 246 246 - score = sk->sk_family == PF_INET ? 2 : 1; 247 + if (sk->sk_family == PF_INET) 248 + score++; 247 249 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id()) 248 250 score++; 249 251 }
+9 -21
net/ipv4/netfilter/nf_defrag_ipv4.c
··· 20 20 #endif 21 21 #include <net/netfilter/nf_conntrack_zones.h> 22 22 23 - static unsigned int defrag4_pernet_id __read_mostly; 24 23 static DEFINE_MUTEX(defrag4_mutex); 25 - 26 - struct defrag4_pernet { 27 - unsigned int users; 28 - }; 29 24 30 25 static int nf_ct_ipv4_gather_frags(struct net *net, struct sk_buff *skb, 31 26 u_int32_t user) ··· 106 111 107 112 static void __net_exit defrag4_net_exit(struct net *net) 108 113 { 109 - struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id); 110 - 111 - if (nf_defrag->users) { 114 + if (net->nf.defrag_ipv4_users) { 112 115 nf_unregister_net_hooks(net, ipv4_defrag_ops, 113 116 ARRAY_SIZE(ipv4_defrag_ops)); 114 - nf_defrag->users = 0; 117 + net->nf.defrag_ipv4_users = 0; 115 118 } 116 119 } 117 120 118 121 static struct pernet_operations defrag4_net_ops = { 119 122 .exit = defrag4_net_exit, 120 - .id = &defrag4_pernet_id, 121 - .size = sizeof(struct defrag4_pernet), 122 123 }; 123 124 124 125 static int __init nf_defrag_init(void) ··· 129 138 130 139 int nf_defrag_ipv4_enable(struct net *net) 131 140 { 132 - struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id); 133 141 int err = 0; 134 142 135 143 mutex_lock(&defrag4_mutex); 136 - if (nf_defrag->users == UINT_MAX) { 144 + if (net->nf.defrag_ipv4_users == UINT_MAX) { 137 145 err = -EOVERFLOW; 138 146 goto out_unlock; 139 147 } 140 148 141 - if (nf_defrag->users) { 142 - nf_defrag->users++; 149 + if (net->nf.defrag_ipv4_users) { 150 + net->nf.defrag_ipv4_users++; 143 151 goto out_unlock; 144 152 } 145 153 146 154 err = nf_register_net_hooks(net, ipv4_defrag_ops, 147 155 ARRAY_SIZE(ipv4_defrag_ops)); 148 156 if (err == 0) 149 - nf_defrag->users = 1; 157 + net->nf.defrag_ipv4_users = 1; 150 158 151 159 out_unlock: 152 160 mutex_unlock(&defrag4_mutex); ··· 155 165 156 166 void nf_defrag_ipv4_disable(struct net *net) 157 167 { 158 - struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id); 159 - 160 168 mutex_lock(&defrag4_mutex); 161 - if (nf_defrag->users) { 162 - nf_defrag->users--; 163 - if (nf_defrag->users == 0) 169 + if (net->nf.defrag_ipv4_users) { 170 + net->nf.defrag_ipv4_users--; 171 + if (net->nf.defrag_ipv4_users == 0) 164 172 nf_unregister_net_hooks(net, ipv4_defrag_ops, 165 173 ARRAY_SIZE(ipv4_defrag_ops)); 166 174 }
+2 -1
net/ipv4/udp.c
··· 390 390 dif, sdif); 391 391 if (!dev_match) 392 392 return -1; 393 - score += 4; 393 + if (sk->sk_bound_dev_if) 394 + score += 4; 394 395 395 396 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id()) 396 397 score++;
+1 -1
net/ipv6/inet6_hashtables.c
··· 106 106 if (!inet_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif)) 107 107 return -1; 108 108 109 - score = 1; 109 + score = sk->sk_bound_dev_if ? 2 : 1; 110 110 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id()) 111 111 score++; 112 112 }
+1 -1
net/ipv6/netfilter/nf_conntrack_reasm.c
··· 33 33 34 34 static const char nf_frags_cache_name[] = "nf-frags"; 35 35 36 - unsigned int nf_frag_pernet_id __read_mostly; 36 + static unsigned int nf_frag_pernet_id __read_mostly; 37 37 static struct inet_frags nf_frags; 38 38 39 39 static struct nft_ct_frag6_pernet *nf_frag_pernet(struct net *net)
+9 -16
net/ipv6/netfilter/nf_defrag_ipv6_hooks.c
··· 25 25 #include <net/netfilter/nf_conntrack_zones.h> 26 26 #include <net/netfilter/ipv6/nf_defrag_ipv6.h> 27 27 28 - extern unsigned int nf_frag_pernet_id; 29 - 30 28 static DEFINE_MUTEX(defrag6_mutex); 31 29 32 30 static enum ip6_defrag_users nf_ct6_defrag_user(unsigned int hooknum, ··· 89 91 90 92 static void __net_exit defrag6_net_exit(struct net *net) 91 93 { 92 - struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id); 93 - 94 - if (nf_frag->users) { 94 + if (net->nf.defrag_ipv6_users) { 95 95 nf_unregister_net_hooks(net, ipv6_defrag_ops, 96 96 ARRAY_SIZE(ipv6_defrag_ops)); 97 - nf_frag->users = 0; 97 + net->nf.defrag_ipv6_users = 0; 98 98 } 99 99 } 100 100 ··· 130 134 131 135 int nf_defrag_ipv6_enable(struct net *net) 132 136 { 133 - struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id); 134 137 int err = 0; 135 138 136 139 mutex_lock(&defrag6_mutex); 137 - if (nf_frag->users == UINT_MAX) { 140 + if (net->nf.defrag_ipv6_users == UINT_MAX) { 138 141 err = -EOVERFLOW; 139 142 goto out_unlock; 140 143 } 141 144 142 - if (nf_frag->users) { 143 - nf_frag->users++; 145 + if (net->nf.defrag_ipv6_users) { 146 + net->nf.defrag_ipv6_users++; 144 147 goto out_unlock; 145 148 } 146 149 147 150 err = nf_register_net_hooks(net, ipv6_defrag_ops, 148 151 ARRAY_SIZE(ipv6_defrag_ops)); 149 152 if (err == 0) 150 - nf_frag->users = 1; 153 + net->nf.defrag_ipv6_users = 1; 151 154 152 155 out_unlock: 153 156 mutex_unlock(&defrag6_mutex); ··· 156 161 157 162 void nf_defrag_ipv6_disable(struct net *net) 158 163 { 159 - struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id); 160 - 161 164 mutex_lock(&defrag6_mutex); 162 - if (nf_frag->users) { 163 - nf_frag->users--; 164 - if (nf_frag->users == 0) 165 + if (net->nf.defrag_ipv6_users) { 166 + net->nf.defrag_ipv6_users--; 167 + if (net->nf.defrag_ipv6_users == 0) 165 168 nf_unregister_net_hooks(net, ipv6_defrag_ops, 166 169 ARRAY_SIZE(ipv6_defrag_ops)); 167 170 }
+2 -1
net/ipv6/udp.c
··· 133 133 dev_match = udp_sk_bound_dev_eq(net, sk->sk_bound_dev_if, dif, sdif); 134 134 if (!dev_match) 135 135 return -1; 136 - score++; 136 + if (sk->sk_bound_dev_if) 137 + score++; 137 138 138 139 if (READ_ONCE(sk->sk_incoming_cpu) == raw_smp_processor_id()) 139 140 score++;
+64 -27
net/netfilter/nf_tables_api.c
··· 780 780 { 781 781 struct nftables_pernet *nft_net; 782 782 struct sk_buff *skb; 783 + u16 flags = 0; 783 784 int err; 784 785 785 786 if (!ctx->report && ··· 791 790 if (skb == NULL) 792 791 goto err; 793 792 793 + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) 794 + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); 795 + 794 796 err = nf_tables_fill_table_info(skb, ctx->net, ctx->portid, ctx->seq, 795 - event, 0, ctx->family, ctx->table); 797 + event, flags, ctx->family, ctx->table); 796 798 if (err < 0) { 797 799 kfree_skb(skb); 798 800 goto err; ··· 1567 1563 { 1568 1564 struct nftables_pernet *nft_net; 1569 1565 struct sk_buff *skb; 1566 + u16 flags = 0; 1570 1567 int err; 1571 1568 1572 1569 if (!ctx->report && ··· 1578 1573 if (skb == NULL) 1579 1574 goto err; 1580 1575 1576 + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) 1577 + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); 1578 + 1581 1579 err = nf_tables_fill_chain_info(skb, ctx->net, ctx->portid, ctx->seq, 1582 - event, 0, ctx->family, ctx->table, 1580 + event, flags, ctx->family, ctx->table, 1583 1581 ctx->chain); 1584 1582 if (err < 0) { 1585 1583 kfree_skb(skb); ··· 2874 2866 u32 flags, int family, 2875 2867 const struct nft_table *table, 2876 2868 const struct nft_chain *chain, 2877 - const struct nft_rule *rule, 2878 - const struct nft_rule *prule) 2869 + const struct nft_rule *rule, u64 handle) 2879 2870 { 2880 2871 struct nlmsghdr *nlh; 2881 2872 const struct nft_expr *expr, *next; ··· 2894 2887 NFTA_RULE_PAD)) 2895 2888 goto nla_put_failure; 2896 2889 2897 - if (event != NFT_MSG_DELRULE && prule) { 2898 - if (nla_put_be64(skb, NFTA_RULE_POSITION, 2899 - cpu_to_be64(prule->handle), 2890 + if (event != NFT_MSG_DELRULE && handle) { 2891 + if (nla_put_be64(skb, NFTA_RULE_POSITION, cpu_to_be64(handle), 2900 2892 NFTA_RULE_PAD)) 2901 2893 goto nla_put_failure; 2902 2894 } ··· 2931 2925 const struct nft_rule *rule, int event) 2932 2926 { 2933 2927 struct nftables_pernet *nft_net = nft_pernet(ctx->net); 2928 + const struct nft_rule *prule; 2934 2929 struct sk_buff *skb; 2930 + u64 handle = 0; 2931 + u16 flags = 0; 2935 2932 int err; 2936 2933 2937 2934 if (!ctx->report && ··· 2945 2936 if (skb == NULL) 2946 2937 goto err; 2947 2938 2939 + if (event == NFT_MSG_NEWRULE && 2940 + !list_is_first(&rule->list, &ctx->chain->rules) && 2941 + !list_is_last(&rule->list, &ctx->chain->rules)) { 2942 + prule = list_prev_entry(rule, list); 2943 + handle = prule->handle; 2944 + } 2945 + if (ctx->flags & (NLM_F_APPEND | NLM_F_REPLACE)) 2946 + flags |= NLM_F_APPEND; 2947 + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) 2948 + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); 2949 + 2948 2950 err = nf_tables_fill_rule_info(skb, ctx->net, ctx->portid, ctx->seq, 2949 - event, 0, ctx->family, ctx->table, 2950 - ctx->chain, rule, NULL); 2951 + event, flags, ctx->family, ctx->table, 2952 + ctx->chain, rule, handle); 2951 2953 if (err < 0) { 2952 2954 kfree_skb(skb); 2953 2955 goto err; ··· 2984 2964 struct net *net = sock_net(skb->sk); 2985 2965 const struct nft_rule *rule, *prule; 2986 2966 unsigned int s_idx = cb->args[0]; 2967 + u64 handle; 2987 2968 2988 2969 prule = NULL; 2989 2970 list_for_each_entry_rcu(rule, &chain->rules, list) { ··· 2996 2975 memset(&cb->args[1], 0, 2997 2976 sizeof(cb->args) - sizeof(cb->args[0])); 2998 2977 } 2978 + if (prule) 2979 + handle = prule->handle; 2980 + else 2981 + handle = 0; 2982 + 2999 2983 if (nf_tables_fill_rule_info(skb, net, NETLINK_CB(cb->skb).portid, 3000 2984 cb->nlh->nlmsg_seq, 3001 2985 NFT_MSG_NEWRULE, 3002 2986 NLM_F_MULTI | NLM_F_APPEND, 3003 2987 table->family, 3004 - table, chain, rule, prule) < 0) 2988 + table, chain, rule, handle) < 0) 3005 2989 return 1; 3006 2990 3007 2991 nl_dump_check_consistent(cb, nlmsg_hdr(skb)); ··· 3169 3143 3170 3144 err = nf_tables_fill_rule_info(skb2, net, NETLINK_CB(skb).portid, 3171 3145 info->nlh->nlmsg_seq, NFT_MSG_NEWRULE, 0, 3172 - family, table, chain, rule, NULL); 3146 + family, table, chain, rule, 0); 3173 3147 if (err < 0) 3174 3148 goto err_fill_rule_info; 3175 3149 ··· 3429 3403 } 3430 3404 3431 3405 if (info->nlh->nlmsg_flags & NLM_F_REPLACE) { 3406 + err = nft_delrule(&ctx, old_rule); 3407 + if (err < 0) 3408 + goto err_destroy_flow_rule; 3409 + 3432 3410 trans = nft_trans_rule_add(&ctx, NFT_MSG_NEWRULE, rule); 3433 3411 if (trans == NULL) { 3434 3412 err = -ENOMEM; 3435 3413 goto err_destroy_flow_rule; 3436 3414 } 3437 - err = nft_delrule(&ctx, old_rule); 3438 - if (err < 0) { 3439 - nft_trans_destroy(trans); 3440 - goto err_destroy_flow_rule; 3441 - } 3442 - 3443 3415 list_add_tail_rcu(&rule->list, &old_rule->list); 3444 3416 } else { 3445 3417 trans = nft_trans_rule_add(&ctx, NFT_MSG_NEWRULE, rule); ··· 3967 3943 gfp_t gfp_flags) 3968 3944 { 3969 3945 struct nftables_pernet *nft_net = nft_pernet(ctx->net); 3970 - struct sk_buff *skb; 3971 3946 u32 portid = ctx->portid; 3947 + struct sk_buff *skb; 3948 + u16 flags = 0; 3972 3949 int err; 3973 3950 3974 3951 if (!ctx->report && ··· 3980 3955 if (skb == NULL) 3981 3956 goto err; 3982 3957 3983 - err = nf_tables_fill_set(skb, ctx, set, event, 0); 3958 + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) 3959 + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); 3960 + 3961 + err = nf_tables_fill_set(skb, ctx, set, event, flags); 3984 3962 if (err < 0) { 3985 3963 kfree_skb(skb); 3986 3964 goto err; ··· 5259 5231 static void nf_tables_setelem_notify(const struct nft_ctx *ctx, 5260 5232 const struct nft_set *set, 5261 5233 const struct nft_set_elem *elem, 5262 - int event, u16 flags) 5234 + int event) 5263 5235 { 5264 5236 struct nftables_pernet *nft_net; 5265 5237 struct net *net = ctx->net; 5266 5238 u32 portid = ctx->portid; 5267 5239 struct sk_buff *skb; 5240 + u16 flags = 0; 5268 5241 int err; 5269 5242 5270 5243 if (!ctx->report && !nfnetlink_has_listeners(net, NFNLGRP_NFTABLES)) ··· 5274 5245 skb = nlmsg_new(NLMSG_GOODSIZE, GFP_KERNEL); 5275 5246 if (skb == NULL) 5276 5247 goto err; 5248 + 5249 + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) 5250 + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); 5277 5251 5278 5252 err = nf_tables_fill_setelem_info(skb, ctx, 0, portid, event, flags, 5279 5253 set, elem); ··· 6953 6921 6954 6922 void nft_obj_notify(struct net *net, const struct nft_table *table, 6955 6923 struct nft_object *obj, u32 portid, u32 seq, int event, 6956 - int family, int report, gfp_t gfp) 6924 + u16 flags, int family, int report, gfp_t gfp) 6957 6925 { 6958 6926 struct nftables_pernet *nft_net = nft_pernet(net); 6959 6927 struct sk_buff *skb; ··· 6978 6946 if (skb == NULL) 6979 6947 goto err; 6980 6948 6981 - err = nf_tables_fill_obj_info(skb, net, portid, seq, event, 0, family, 6982 - table, obj, false); 6949 + err = nf_tables_fill_obj_info(skb, net, portid, seq, event, 6950 + flags & (NLM_F_CREATE | NLM_F_EXCL), 6951 + family, table, obj, false); 6983 6952 if (err < 0) { 6984 6953 kfree_skb(skb); 6985 6954 goto err; ··· 6997 6964 struct nft_object *obj, int event) 6998 6965 { 6999 6966 nft_obj_notify(ctx->net, ctx->table, obj, ctx->portid, ctx->seq, event, 7000 - ctx->family, ctx->report, GFP_KERNEL); 6967 + ctx->flags, ctx->family, ctx->report, GFP_KERNEL); 7001 6968 } 7002 6969 7003 6970 /* ··· 7778 7745 { 7779 7746 struct nftables_pernet *nft_net = nft_pernet(ctx->net); 7780 7747 struct sk_buff *skb; 7748 + u16 flags = 0; 7781 7749 int err; 7782 7750 7783 7751 if (!ctx->report && ··· 7789 7755 if (skb == NULL) 7790 7756 goto err; 7791 7757 7758 + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) 7759 + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); 7760 + 7792 7761 err = nf_tables_fill_flowtable_info(skb, ctx->net, ctx->portid, 7793 - ctx->seq, event, 0, 7762 + ctx->seq, event, flags, 7794 7763 ctx->family, flowtable, hook_list); 7795 7764 if (err < 0) { 7796 7765 kfree_skb(skb); ··· 8671 8634 nft_setelem_activate(net, te->set, &te->elem); 8672 8635 nf_tables_setelem_notify(&trans->ctx, te->set, 8673 8636 &te->elem, 8674 - NFT_MSG_NEWSETELEM, 0); 8637 + NFT_MSG_NEWSETELEM); 8675 8638 nft_trans_destroy(trans); 8676 8639 break; 8677 8640 case NFT_MSG_DELSETELEM: ··· 8679 8642 8680 8643 nf_tables_setelem_notify(&trans->ctx, te->set, 8681 8644 &te->elem, 8682 - NFT_MSG_DELSETELEM, 0); 8645 + NFT_MSG_DELSETELEM); 8683 8646 nft_setelem_remove(net, te->set, &te->elem); 8684 8647 if (!nft_setelem_is_catchall(te->set, &te->elem)) { 8685 8648 atomic_dec(&te->set->nelems);
+1 -1
net/netfilter/nft_quota.c
··· 60 60 if (overquota && 61 61 !test_and_set_bit(NFT_QUOTA_DEPLETED_BIT, &priv->flags)) 62 62 nft_obj_notify(nft_net(pkt), obj->key.table, obj, 0, 0, 63 - NFT_MSG_NEWOBJ, nft_pf(pkt), 0, GFP_ATOMIC); 63 + NFT_MSG_NEWOBJ, 0, nft_pf(pkt), 0, GFP_ATOMIC); 64 64 } 65 65 66 66 static int nft_quota_do_init(const struct nlattr * const tb[],
+10 -4
net/netlink/af_netlink.c
··· 594 594 595 595 /* We need to ensure that the socket is hashed and visible. */ 596 596 smp_wmb(); 597 - nlk_sk(sk)->bound = portid; 597 + /* Paired with lockless reads from netlink_bind(), 598 + * netlink_connect() and netlink_sendmsg(). 599 + */ 600 + WRITE_ONCE(nlk_sk(sk)->bound, portid); 598 601 599 602 err: 600 603 release_sock(sk); ··· 1015 1012 if (nlk->ngroups < BITS_PER_LONG) 1016 1013 groups &= (1UL << nlk->ngroups) - 1; 1017 1014 1018 - bound = nlk->bound; 1015 + /* Paired with WRITE_ONCE() in netlink_insert() */ 1016 + bound = READ_ONCE(nlk->bound); 1019 1017 if (bound) { 1020 1018 /* Ensure nlk->portid is up-to-date. */ 1021 1019 smp_rmb(); ··· 1102 1098 1103 1099 /* No need for barriers here as we return to user-space without 1104 1100 * using any of the bound attributes. 1101 + * Paired with WRITE_ONCE() in netlink_insert(). 1105 1102 */ 1106 - if (!nlk->bound) 1103 + if (!READ_ONCE(nlk->bound)) 1107 1104 err = netlink_autobind(sock); 1108 1105 1109 1106 if (err == 0) { ··· 1874 1869 dst_group = nlk->dst_group; 1875 1870 } 1876 1871 1877 - if (!nlk->bound) { 1872 + /* Paired with WRITE_ONCE() in netlink_insert() */ 1873 + if (!READ_ONCE(nlk->bound)) { 1878 1874 err = netlink_autobind(sock); 1879 1875 if (err) 1880 1876 goto out;
+3
net/sched/sch_fifo.c
··· 233 233 if (strncmp(q->ops->id + 1, "fifo", 4) != 0) 234 234 return 0; 235 235 236 + if (!q->ops->change) 237 + return 0; 238 + 236 239 nla = kmalloc(nla_attr_size(sizeof(struct tc_fifo_qopt)), GFP_KERNEL); 237 240 if (nla) { 238 241 nla->nla_type = RTM_NEWQDISC;
+4
net/sched/sch_taprio.c
··· 1641 1641 list_del(&q->taprio_list); 1642 1642 spin_unlock(&taprio_list_lock); 1643 1643 1644 + /* Note that taprio_reset() might not be called if an error 1645 + * happens in qdisc_create(), after taprio_init() has been called. 1646 + */ 1647 + hrtimer_cancel(&q->advance_timer); 1644 1648 1645 1649 taprio_disable_offload(dev, q, NULL); 1646 1650
+1 -1
net/sunrpc/auth_gss/svcauth_gss.c
··· 645 645 } 646 646 __set_bit(seq_num % GSS_SEQ_WIN, sd->sd_win); 647 647 goto ok; 648 - } else if (seq_num <= sd->sd_max - GSS_SEQ_WIN) { 648 + } else if (seq_num + GSS_SEQ_WIN <= sd->sd_max) { 649 649 goto toolow; 650 650 } 651 651 if (__test_and_set_bit(seq_num % GSS_SEQ_WIN, sd->sd_win))
+5 -4
net/unix/af_unix.c
··· 2882 2882 2883 2883 unix_state_lock(sk); 2884 2884 sk->sk_shutdown |= mode; 2885 + if ((sk->sk_type == SOCK_STREAM || sk->sk_type == SOCK_SEQPACKET) && 2886 + mode == SHUTDOWN_MASK) 2887 + sk->sk_state = TCP_CLOSE; 2885 2888 other = unix_peer(sk); 2886 2889 if (other) 2887 2890 sock_hold(other); ··· 2907 2904 other->sk_shutdown |= peer_mode; 2908 2905 unix_state_unlock(other); 2909 2906 other->sk_state_change(other); 2910 - if (peer_mode == SHUTDOWN_MASK) { 2907 + if (peer_mode == SHUTDOWN_MASK) 2911 2908 sk_wake_async(other, SOCK_WAKE_WAITD, POLL_HUP); 2912 - other->sk_state = TCP_CLOSE; 2913 - } else if (peer_mode & RCV_SHUTDOWN) { 2909 + else if (peer_mode & RCV_SHUTDOWN) 2914 2910 sk_wake_async(other, SOCK_WAKE_WAITD, POLL_IN); 2915 - } 2916 2911 } 2917 2912 if (other) 2918 2913 sock_put(other);
+55 -12
net/xfrm/xfrm_user.c
··· 1961 1961 return skb; 1962 1962 } 1963 1963 1964 + static int xfrm_notify_userpolicy(struct net *net) 1965 + { 1966 + struct xfrm_userpolicy_default *up; 1967 + int len = NLMSG_ALIGN(sizeof(*up)); 1968 + struct nlmsghdr *nlh; 1969 + struct sk_buff *skb; 1970 + int err; 1971 + 1972 + skb = nlmsg_new(len, GFP_ATOMIC); 1973 + if (skb == NULL) 1974 + return -ENOMEM; 1975 + 1976 + nlh = nlmsg_put(skb, 0, 0, XFRM_MSG_GETDEFAULT, sizeof(*up), 0); 1977 + if (nlh == NULL) { 1978 + kfree_skb(skb); 1979 + return -EMSGSIZE; 1980 + } 1981 + 1982 + up = nlmsg_data(nlh); 1983 + up->in = net->xfrm.policy_default & XFRM_POL_DEFAULT_IN ? 1984 + XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT; 1985 + up->fwd = net->xfrm.policy_default & XFRM_POL_DEFAULT_FWD ? 1986 + XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT; 1987 + up->out = net->xfrm.policy_default & XFRM_POL_DEFAULT_OUT ? 1988 + XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT; 1989 + 1990 + nlmsg_end(skb, nlh); 1991 + 1992 + rcu_read_lock(); 1993 + err = xfrm_nlmsg_multicast(net, skb, 0, XFRMNLGRP_POLICY); 1994 + rcu_read_unlock(); 1995 + 1996 + return err; 1997 + } 1998 + 1964 1999 static int xfrm_set_default(struct sk_buff *skb, struct nlmsghdr *nlh, 1965 2000 struct nlattr **attrs) 1966 2001 { 1967 2002 struct net *net = sock_net(skb->sk); 1968 2003 struct xfrm_userpolicy_default *up = nlmsg_data(nlh); 1969 - u8 dirmask; 1970 - u8 old_default = net->xfrm.policy_default; 1971 2004 1972 - if (up->dirmask >= XFRM_USERPOLICY_DIRMASK_MAX) 1973 - return -EINVAL; 2005 + if (up->in == XFRM_USERPOLICY_BLOCK) 2006 + net->xfrm.policy_default |= XFRM_POL_DEFAULT_IN; 2007 + else if (up->in == XFRM_USERPOLICY_ACCEPT) 2008 + net->xfrm.policy_default &= ~XFRM_POL_DEFAULT_IN; 1974 2009 1975 - dirmask = (1 << up->dirmask) & XFRM_POL_DEFAULT_MASK; 2010 + if (up->fwd == XFRM_USERPOLICY_BLOCK) 2011 + net->xfrm.policy_default |= XFRM_POL_DEFAULT_FWD; 2012 + else if (up->fwd == XFRM_USERPOLICY_ACCEPT) 2013 + net->xfrm.policy_default &= ~XFRM_POL_DEFAULT_FWD; 1976 2014 1977 - net->xfrm.policy_default = (old_default & (0xff ^ dirmask)) 1978 - | (up->action << up->dirmask); 2015 + if (up->out == XFRM_USERPOLICY_BLOCK) 2016 + net->xfrm.policy_default |= XFRM_POL_DEFAULT_OUT; 2017 + else if (up->out == XFRM_USERPOLICY_ACCEPT) 2018 + net->xfrm.policy_default &= ~XFRM_POL_DEFAULT_OUT; 1979 2019 1980 2020 rt_genid_bump_all(net); 1981 2021 2022 + xfrm_notify_userpolicy(net); 1982 2023 return 0; 1983 2024 } 1984 2025 ··· 2029 1988 struct sk_buff *r_skb; 2030 1989 struct nlmsghdr *r_nlh; 2031 1990 struct net *net = sock_net(skb->sk); 2032 - struct xfrm_userpolicy_default *r_up, *up; 1991 + struct xfrm_userpolicy_default *r_up; 2033 1992 int len = NLMSG_ALIGN(sizeof(struct xfrm_userpolicy_default)); 2034 1993 u32 portid = NETLINK_CB(skb).portid; 2035 1994 u32 seq = nlh->nlmsg_seq; 2036 - 2037 - up = nlmsg_data(nlh); 2038 1995 2039 1996 r_skb = nlmsg_new(len, GFP_ATOMIC); 2040 1997 if (!r_skb) ··· 2046 2007 2047 2008 r_up = nlmsg_data(r_nlh); 2048 2009 2049 - r_up->action = ((net->xfrm.policy_default & (1 << up->dirmask)) >> up->dirmask); 2050 - r_up->dirmask = up->dirmask; 2010 + r_up->in = net->xfrm.policy_default & XFRM_POL_DEFAULT_IN ? 2011 + XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT; 2012 + r_up->fwd = net->xfrm.policy_default & XFRM_POL_DEFAULT_FWD ? 2013 + XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT; 2014 + r_up->out = net->xfrm.policy_default & XFRM_POL_DEFAULT_OUT ? 2015 + XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT; 2051 2016 nlmsg_end(r_skb, r_nlh); 2052 2017 2053 2018 return nlmsg_unicast(net->xfrm.nlsk, r_skb, portid);
+8 -9
samples/bpf/Makefile
··· 322 322 323 323 -include $(BPF_SAMPLES_PATH)/Makefile.target 324 324 325 - VMLINUX_BTF_PATHS ?= $(if $(O),$(O)/vmlinux) \ 326 - $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux) \ 327 - ../../../../vmlinux \ 328 - /sys/kernel/btf/vmlinux \ 329 - /boot/vmlinux-$(shell uname -r) 325 + VMLINUX_BTF_PATHS ?= $(abspath $(if $(O),$(O)/vmlinux)) \ 326 + $(abspath $(if $(KBUILD_OUTPUT),$(KBUILD_OUTPUT)/vmlinux)) \ 327 + $(abspath ./vmlinux) 330 328 VMLINUX_BTF ?= $(abspath $(firstword $(wildcard $(VMLINUX_BTF_PATHS)))) 331 - 332 - ifeq ($(VMLINUX_BTF),) 333 - $(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)") 334 - endif 335 329 336 330 $(obj)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) 337 331 ifeq ($(VMLINUX_H),) 338 332 $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@ 339 333 else 340 334 $(Q)cp "$(VMLINUX_H)" $@ 335 + endif 336 + 337 + ifeq ($(VMLINUX_BTF),) 338 + $(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)",\ 339 + build the kernel or set VMLINUX_BTF variable) 341 340 endif 342 341 343 342 clean-files += vmlinux.h
+1 -1
samples/bpf/bpf_insn.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0 */ 1 + /* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ 2 2 /* eBPF instruction mini library */ 3 3 #ifndef __BPF_INSN_H 4 4 #define __BPF_INSN_H
-5
samples/bpf/xdp_redirect_map_multi.bpf.c
··· 5 5 #include "xdp_sample.bpf.h" 6 6 #include "xdp_sample_shared.h" 7 7 8 - enum { 9 - BPF_F_BROADCAST = (1ULL << 3), 10 - BPF_F_EXCLUDE_INGRESS = (1ULL << 4), 11 - }; 12 - 13 8 struct { 14 9 __uint(type, BPF_MAP_TYPE_DEVMAP_HASH); 15 10 __uint(key_size, sizeof(int));
+3 -1
security/selinux/nlmsgtab.c
··· 126 126 { XFRM_MSG_NEWSPDINFO, NETLINK_XFRM_SOCKET__NLMSG_WRITE }, 127 127 { XFRM_MSG_GETSPDINFO, NETLINK_XFRM_SOCKET__NLMSG_READ }, 128 128 { XFRM_MSG_MAPPING, NETLINK_XFRM_SOCKET__NLMSG_READ }, 129 + { XFRM_MSG_SETDEFAULT, NETLINK_XFRM_SOCKET__NLMSG_WRITE }, 130 + { XFRM_MSG_GETDEFAULT, NETLINK_XFRM_SOCKET__NLMSG_READ }, 129 131 }; 130 132 131 133 static const struct nlmsg_perm nlmsg_audit_perms[] = ··· 191 189 * structures at the top of this file with the new mappings 192 190 * before updating the BUILD_BUG_ON() macro! 193 191 */ 194 - BUILD_BUG_ON(XFRM_MSG_MAX != XFRM_MSG_MAPPING); 192 + BUILD_BUG_ON(XFRM_MSG_MAX != XFRM_MSG_GETDEFAULT); 195 193 err = nlmsg_perm(nlmsg_type, perm, nlmsg_xfrm_perms, 196 194 sizeof(nlmsg_xfrm_perms)); 197 195 break;
+1
tools/include/uapi/sound/asound.h
··· 784 784 785 785 #define SNDRV_RAWMIDI_IOCTL_PVERSION _IOR('W', 0x00, int) 786 786 #define SNDRV_RAWMIDI_IOCTL_INFO _IOR('W', 0x01, struct snd_rawmidi_info) 787 + #define SNDRV_RAWMIDI_IOCTL_USER_PVERSION _IOW('W', 0x02, int) 787 788 #define SNDRV_RAWMIDI_IOCTL_PARAMS _IOWR('W', 0x10, struct snd_rawmidi_params) 788 789 #define SNDRV_RAWMIDI_IOCTL_STATUS _IOWR('W', 0x20, struct snd_rawmidi_status) 789 790 #define SNDRV_RAWMIDI_IOCTL_DROP _IOW('W', 0x30, int)
+2 -1
tools/lib/bpf/libbpf.c
··· 7024 7024 7025 7025 if (obj->gen_loader) { 7026 7026 /* reset FDs */ 7027 - btf__set_fd(obj->btf, -1); 7027 + if (obj->btf) 7028 + btf__set_fd(obj->btf, -1); 7028 7029 for (i = 0; i < obj->nr_maps; i++) 7029 7030 obj->maps[i].fd = -1; 7030 7031 if (!err)
+1
tools/lib/bpf/strset.c
··· 88 88 89 89 hashmap__free(set->strs_hash); 90 90 free(set->strs_data); 91 + free(set); 91 92 } 92 93 93 94 size_t strset__data_size(const struct strset *set)
+30 -8
tools/objtool/special.c
··· 58 58 { 59 59 } 60 60 61 + static bool reloc2sec_off(struct reloc *reloc, struct section **sec, unsigned long *off) 62 + { 63 + switch (reloc->sym->type) { 64 + case STT_FUNC: 65 + *sec = reloc->sym->sec; 66 + *off = reloc->sym->offset + reloc->addend; 67 + return true; 68 + 69 + case STT_SECTION: 70 + *sec = reloc->sym->sec; 71 + *off = reloc->addend; 72 + return true; 73 + 74 + default: 75 + return false; 76 + } 77 + } 78 + 61 79 static int get_alt_entry(struct elf *elf, struct special_entry *entry, 62 80 struct section *sec, int idx, 63 81 struct special_alt *alt) ··· 109 91 WARN_FUNC("can't find orig reloc", sec, offset + entry->orig); 110 92 return -1; 111 93 } 112 - if (orig_reloc->sym->type != STT_SECTION) { 113 - WARN_FUNC("don't know how to handle non-section reloc symbol %s", 114 - sec, offset + entry->orig, orig_reloc->sym->name); 94 + if (!reloc2sec_off(orig_reloc, &alt->orig_sec, &alt->orig_off)) { 95 + WARN_FUNC("don't know how to handle reloc symbol type %d: %s", 96 + sec, offset + entry->orig, 97 + orig_reloc->sym->type, 98 + orig_reloc->sym->name); 115 99 return -1; 116 100 } 117 - 118 - alt->orig_sec = orig_reloc->sym->sec; 119 - alt->orig_off = orig_reloc->addend; 120 101 121 102 if (!entry->group || alt->new_len) { 122 103 new_reloc = find_reloc_by_dest(elf, sec, offset + entry->new); ··· 133 116 if (arch_is_retpoline(new_reloc->sym)) 134 117 return 1; 135 118 136 - alt->new_sec = new_reloc->sym->sec; 137 - alt->new_off = (unsigned int)new_reloc->addend; 119 + if (!reloc2sec_off(new_reloc, &alt->new_sec, &alt->new_off)) { 120 + WARN_FUNC("don't know how to handle reloc symbol type %d: %s", 121 + sec, offset + entry->new, 122 + new_reloc->sym->type, 123 + new_reloc->sym->name); 124 + return -1; 125 + } 138 126 139 127 /* _ASM_EXTABLE_EX hack */ 140 128 if (alt->new_off >= 0x7ffffff0)
+1 -1
tools/perf/Makefile.config
··· 143 143 ifdef CSINCLUDES 144 144 LIBOPENCSD_CFLAGS := -I$(CSINCLUDES) 145 145 endif 146 - OPENCSDLIBS := -lopencsd_c_api -lopencsd 146 + OPENCSDLIBS := -lopencsd_c_api -lopencsd -lstdc++ 147 147 ifdef CSLIBS 148 148 LIBOPENCSD_LDFLAGS := -L$(CSLIBS) 149 149 endif
+1 -1
tools/perf/Makefile.perf
··· 802 802 803 803 $(patsubst perf-%,%.o,$(PROGRAMS)): $(wildcard */*.h) 804 804 805 - LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(LDFLAGS)' 805 + LIBTRACEEVENT_FLAGS += plugin_dir=$(plugindir_SQ) 'EXTRA_CFLAGS=$(EXTRA_CFLAGS)' 'LDFLAGS=$(filter-out -static,$(LDFLAGS))' 806 806 807 807 $(LIBTRACEEVENT): FORCE 808 808 $(Q)$(MAKE) -C $(TRACE_EVENT_DIR) $(LIBTRACEEVENT_FLAGS) O=$(OUTPUT) $(OUTPUT)libtraceevent.a
+2
tools/perf/pmu-events/jevents.c
··· 1285 1285 } 1286 1286 1287 1287 free_arch_std_events(); 1288 + free_sys_event_tables(); 1288 1289 free(mapfile); 1289 1290 return 0; 1290 1291 ··· 1307 1306 create_empty_mapping(output_file); 1308 1307 err_out: 1309 1308 free_arch_std_events(); 1309 + free_sys_event_tables(); 1310 1310 free(mapfile); 1311 1311 return ret; 1312 1312 }
+97
tools/perf/tests/attr/test-stat-default
··· 68 68 type=0 69 69 config=5 70 70 optional=1 71 + 72 + # PERF_TYPE_RAW / slots (0x400) 73 + [event11:base-stat] 74 + fd=11 75 + group_fd=-1 76 + type=4 77 + config=1024 78 + read_format=15 79 + optional=1 80 + 81 + # PERF_TYPE_RAW / topdown-retiring (0x8000) 82 + [event12:base-stat] 83 + fd=12 84 + group_fd=11 85 + type=4 86 + config=32768 87 + disabled=0 88 + enable_on_exec=0 89 + read_format=15 90 + optional=1 91 + 92 + # PERF_TYPE_RAW / topdown-bad-spec (0x8100) 93 + [event13:base-stat] 94 + fd=13 95 + group_fd=11 96 + type=4 97 + config=33024 98 + disabled=0 99 + enable_on_exec=0 100 + read_format=15 101 + optional=1 102 + 103 + # PERF_TYPE_RAW / topdown-fe-bound (0x8200) 104 + [event14:base-stat] 105 + fd=14 106 + group_fd=11 107 + type=4 108 + config=33280 109 + disabled=0 110 + enable_on_exec=0 111 + read_format=15 112 + optional=1 113 + 114 + # PERF_TYPE_RAW / topdown-be-bound (0x8300) 115 + [event15:base-stat] 116 + fd=15 117 + group_fd=11 118 + type=4 119 + config=33536 120 + disabled=0 121 + enable_on_exec=0 122 + read_format=15 123 + optional=1 124 + 125 + # PERF_TYPE_RAW / topdown-heavy-ops (0x8400) 126 + [event16:base-stat] 127 + fd=16 128 + group_fd=11 129 + type=4 130 + config=33792 131 + disabled=0 132 + enable_on_exec=0 133 + read_format=15 134 + optional=1 135 + 136 + # PERF_TYPE_RAW / topdown-br-mispredict (0x8500) 137 + [event17:base-stat] 138 + fd=17 139 + group_fd=11 140 + type=4 141 + config=34048 142 + disabled=0 143 + enable_on_exec=0 144 + read_format=15 145 + optional=1 146 + 147 + # PERF_TYPE_RAW / topdown-fetch-lat (0x8600) 148 + [event18:base-stat] 149 + fd=18 150 + group_fd=11 151 + type=4 152 + config=34304 153 + disabled=0 154 + enable_on_exec=0 155 + read_format=15 156 + optional=1 157 + 158 + # PERF_TYPE_RAW / topdown-mem-bound (0x8700) 159 + [event19:base-stat] 160 + fd=19 161 + group_fd=11 162 + type=4 163 + config=34560 164 + disabled=0 165 + enable_on_exec=0 166 + read_format=15 167 + optional=1
+105 -8
tools/perf/tests/attr/test-stat-detailed-1
··· 70 70 config=5 71 71 optional=1 72 72 73 + # PERF_TYPE_RAW / slots (0x400) 74 + [event11:base-stat] 75 + fd=11 76 + group_fd=-1 77 + type=4 78 + config=1024 79 + read_format=15 80 + optional=1 81 + 82 + # PERF_TYPE_RAW / topdown-retiring (0x8000) 83 + [event12:base-stat] 84 + fd=12 85 + group_fd=11 86 + type=4 87 + config=32768 88 + disabled=0 89 + enable_on_exec=0 90 + read_format=15 91 + optional=1 92 + 93 + # PERF_TYPE_RAW / topdown-bad-spec (0x8100) 94 + [event13:base-stat] 95 + fd=13 96 + group_fd=11 97 + type=4 98 + config=33024 99 + disabled=0 100 + enable_on_exec=0 101 + read_format=15 102 + optional=1 103 + 104 + # PERF_TYPE_RAW / topdown-fe-bound (0x8200) 105 + [event14:base-stat] 106 + fd=14 107 + group_fd=11 108 + type=4 109 + config=33280 110 + disabled=0 111 + enable_on_exec=0 112 + read_format=15 113 + optional=1 114 + 115 + # PERF_TYPE_RAW / topdown-be-bound (0x8300) 116 + [event15:base-stat] 117 + fd=15 118 + group_fd=11 119 + type=4 120 + config=33536 121 + disabled=0 122 + enable_on_exec=0 123 + read_format=15 124 + optional=1 125 + 126 + # PERF_TYPE_RAW / topdown-heavy-ops (0x8400) 127 + [event16:base-stat] 128 + fd=16 129 + group_fd=11 130 + type=4 131 + config=33792 132 + disabled=0 133 + enable_on_exec=0 134 + read_format=15 135 + optional=1 136 + 137 + # PERF_TYPE_RAW / topdown-br-mispredict (0x8500) 138 + [event17:base-stat] 139 + fd=17 140 + group_fd=11 141 + type=4 142 + config=34048 143 + disabled=0 144 + enable_on_exec=0 145 + read_format=15 146 + optional=1 147 + 148 + # PERF_TYPE_RAW / topdown-fetch-lat (0x8600) 149 + [event18:base-stat] 150 + fd=18 151 + group_fd=11 152 + type=4 153 + config=34304 154 + disabled=0 155 + enable_on_exec=0 156 + read_format=15 157 + optional=1 158 + 159 + # PERF_TYPE_RAW / topdown-mem-bound (0x8700) 160 + [event19:base-stat] 161 + fd=19 162 + group_fd=11 163 + type=4 164 + config=34560 165 + disabled=0 166 + enable_on_exec=0 167 + read_format=15 168 + optional=1 169 + 73 170 # PERF_TYPE_HW_CACHE / 74 171 # PERF_COUNT_HW_CACHE_L1D << 0 | 75 172 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 76 173 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 77 - [event11:base-stat] 78 - fd=11 174 + [event20:base-stat] 175 + fd=20 79 176 type=3 80 177 config=0 81 178 optional=1 ··· 181 84 # PERF_COUNT_HW_CACHE_L1D << 0 | 182 85 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 183 86 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 184 - [event12:base-stat] 185 - fd=12 87 + [event21:base-stat] 88 + fd=21 186 89 type=3 187 90 config=65536 188 91 optional=1 ··· 191 94 # PERF_COUNT_HW_CACHE_LL << 0 | 192 95 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 193 96 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 194 - [event13:base-stat] 195 - fd=13 97 + [event22:base-stat] 98 + fd=22 196 99 type=3 197 100 config=2 198 101 optional=1 ··· 201 104 # PERF_COUNT_HW_CACHE_LL << 0 | 202 105 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 203 106 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 204 - [event14:base-stat] 205 - fd=14 107 + [event23:base-stat] 108 + fd=23 206 109 type=3 207 110 config=65538 208 111 optional=1
+117 -20
tools/perf/tests/attr/test-stat-detailed-2
··· 70 70 config=5 71 71 optional=1 72 72 73 + # PERF_TYPE_RAW / slots (0x400) 74 + [event11:base-stat] 75 + fd=11 76 + group_fd=-1 77 + type=4 78 + config=1024 79 + read_format=15 80 + optional=1 81 + 82 + # PERF_TYPE_RAW / topdown-retiring (0x8000) 83 + [event12:base-stat] 84 + fd=12 85 + group_fd=11 86 + type=4 87 + config=32768 88 + disabled=0 89 + enable_on_exec=0 90 + read_format=15 91 + optional=1 92 + 93 + # PERF_TYPE_RAW / topdown-bad-spec (0x8100) 94 + [event13:base-stat] 95 + fd=13 96 + group_fd=11 97 + type=4 98 + config=33024 99 + disabled=0 100 + enable_on_exec=0 101 + read_format=15 102 + optional=1 103 + 104 + # PERF_TYPE_RAW / topdown-fe-bound (0x8200) 105 + [event14:base-stat] 106 + fd=14 107 + group_fd=11 108 + type=4 109 + config=33280 110 + disabled=0 111 + enable_on_exec=0 112 + read_format=15 113 + optional=1 114 + 115 + # PERF_TYPE_RAW / topdown-be-bound (0x8300) 116 + [event15:base-stat] 117 + fd=15 118 + group_fd=11 119 + type=4 120 + config=33536 121 + disabled=0 122 + enable_on_exec=0 123 + read_format=15 124 + optional=1 125 + 126 + # PERF_TYPE_RAW / topdown-heavy-ops (0x8400) 127 + [event16:base-stat] 128 + fd=16 129 + group_fd=11 130 + type=4 131 + config=33792 132 + disabled=0 133 + enable_on_exec=0 134 + read_format=15 135 + optional=1 136 + 137 + # PERF_TYPE_RAW / topdown-br-mispredict (0x8500) 138 + [event17:base-stat] 139 + fd=17 140 + group_fd=11 141 + type=4 142 + config=34048 143 + disabled=0 144 + enable_on_exec=0 145 + read_format=15 146 + optional=1 147 + 148 + # PERF_TYPE_RAW / topdown-fetch-lat (0x8600) 149 + [event18:base-stat] 150 + fd=18 151 + group_fd=11 152 + type=4 153 + config=34304 154 + disabled=0 155 + enable_on_exec=0 156 + read_format=15 157 + optional=1 158 + 159 + # PERF_TYPE_RAW / topdown-mem-bound (0x8700) 160 + [event19:base-stat] 161 + fd=19 162 + group_fd=11 163 + type=4 164 + config=34560 165 + disabled=0 166 + enable_on_exec=0 167 + read_format=15 168 + optional=1 169 + 73 170 # PERF_TYPE_HW_CACHE / 74 171 # PERF_COUNT_HW_CACHE_L1D << 0 | 75 172 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 76 173 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 77 - [event11:base-stat] 78 - fd=11 174 + [event20:base-stat] 175 + fd=20 79 176 type=3 80 177 config=0 81 178 optional=1 ··· 181 84 # PERF_COUNT_HW_CACHE_L1D << 0 | 182 85 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 183 86 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 184 - [event12:base-stat] 185 - fd=12 87 + [event21:base-stat] 88 + fd=21 186 89 type=3 187 90 config=65536 188 91 optional=1 ··· 191 94 # PERF_COUNT_HW_CACHE_LL << 0 | 192 95 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 193 96 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 194 - [event13:base-stat] 195 - fd=13 97 + [event22:base-stat] 98 + fd=22 196 99 type=3 197 100 config=2 198 101 optional=1 ··· 201 104 # PERF_COUNT_HW_CACHE_LL << 0 | 202 105 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 203 106 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 204 - [event14:base-stat] 205 - fd=14 107 + [event23:base-stat] 108 + fd=23 206 109 type=3 207 110 config=65538 208 111 optional=1 ··· 211 114 # PERF_COUNT_HW_CACHE_L1I << 0 | 212 115 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 213 116 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 214 - [event15:base-stat] 215 - fd=15 117 + [event24:base-stat] 118 + fd=24 216 119 type=3 217 120 config=1 218 121 optional=1 ··· 221 124 # PERF_COUNT_HW_CACHE_L1I << 0 | 222 125 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 223 126 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 224 - [event16:base-stat] 225 - fd=16 127 + [event25:base-stat] 128 + fd=25 226 129 type=3 227 130 config=65537 228 131 optional=1 ··· 231 134 # PERF_COUNT_HW_CACHE_DTLB << 0 | 232 135 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 233 136 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 234 - [event17:base-stat] 235 - fd=17 137 + [event26:base-stat] 138 + fd=26 236 139 type=3 237 140 config=3 238 141 optional=1 ··· 241 144 # PERF_COUNT_HW_CACHE_DTLB << 0 | 242 145 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 243 146 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 244 - [event18:base-stat] 245 - fd=18 147 + [event27:base-stat] 148 + fd=27 246 149 type=3 247 150 config=65539 248 151 optional=1 ··· 251 154 # PERF_COUNT_HW_CACHE_ITLB << 0 | 252 155 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 253 156 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 254 - [event19:base-stat] 255 - fd=19 157 + [event28:base-stat] 158 + fd=28 256 159 type=3 257 160 config=4 258 161 optional=1 ··· 261 164 # PERF_COUNT_HW_CACHE_ITLB << 0 | 262 165 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 263 166 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 264 - [event20:base-stat] 265 - fd=20 167 + [event29:base-stat] 168 + fd=29 266 169 type=3 267 170 config=65540 268 171 optional=1
+121 -24
tools/perf/tests/attr/test-stat-detailed-3
··· 70 70 config=5 71 71 optional=1 72 72 73 + # PERF_TYPE_RAW / slots (0x400) 74 + [event11:base-stat] 75 + fd=11 76 + group_fd=-1 77 + type=4 78 + config=1024 79 + read_format=15 80 + optional=1 81 + 82 + # PERF_TYPE_RAW / topdown-retiring (0x8000) 83 + [event12:base-stat] 84 + fd=12 85 + group_fd=11 86 + type=4 87 + config=32768 88 + disabled=0 89 + enable_on_exec=0 90 + read_format=15 91 + optional=1 92 + 93 + # PERF_TYPE_RAW / topdown-bad-spec (0x8100) 94 + [event13:base-stat] 95 + fd=13 96 + group_fd=11 97 + type=4 98 + config=33024 99 + disabled=0 100 + enable_on_exec=0 101 + read_format=15 102 + optional=1 103 + 104 + # PERF_TYPE_RAW / topdown-fe-bound (0x8200) 105 + [event14:base-stat] 106 + fd=14 107 + group_fd=11 108 + type=4 109 + config=33280 110 + disabled=0 111 + enable_on_exec=0 112 + read_format=15 113 + optional=1 114 + 115 + # PERF_TYPE_RAW / topdown-be-bound (0x8300) 116 + [event15:base-stat] 117 + fd=15 118 + group_fd=11 119 + type=4 120 + config=33536 121 + disabled=0 122 + enable_on_exec=0 123 + read_format=15 124 + optional=1 125 + 126 + # PERF_TYPE_RAW / topdown-heavy-ops (0x8400) 127 + [event16:base-stat] 128 + fd=16 129 + group_fd=11 130 + type=4 131 + config=33792 132 + disabled=0 133 + enable_on_exec=0 134 + read_format=15 135 + optional=1 136 + 137 + # PERF_TYPE_RAW / topdown-br-mispredict (0x8500) 138 + [event17:base-stat] 139 + fd=17 140 + group_fd=11 141 + type=4 142 + config=34048 143 + disabled=0 144 + enable_on_exec=0 145 + read_format=15 146 + optional=1 147 + 148 + # PERF_TYPE_RAW / topdown-fetch-lat (0x8600) 149 + [event18:base-stat] 150 + fd=18 151 + group_fd=11 152 + type=4 153 + config=34304 154 + disabled=0 155 + enable_on_exec=0 156 + read_format=15 157 + optional=1 158 + 159 + # PERF_TYPE_RAW / topdown-mem-bound (0x8700) 160 + [event19:base-stat] 161 + fd=19 162 + group_fd=11 163 + type=4 164 + config=34560 165 + disabled=0 166 + enable_on_exec=0 167 + read_format=15 168 + optional=1 169 + 73 170 # PERF_TYPE_HW_CACHE / 74 171 # PERF_COUNT_HW_CACHE_L1D << 0 | 75 172 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 76 173 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 77 - [event11:base-stat] 78 - fd=11 174 + [event20:base-stat] 175 + fd=20 79 176 type=3 80 177 config=0 81 178 optional=1 ··· 181 84 # PERF_COUNT_HW_CACHE_L1D << 0 | 182 85 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 183 86 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 184 - [event12:base-stat] 185 - fd=12 87 + [event21:base-stat] 88 + fd=21 186 89 type=3 187 90 config=65536 188 91 optional=1 ··· 191 94 # PERF_COUNT_HW_CACHE_LL << 0 | 192 95 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 193 96 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 194 - [event13:base-stat] 195 - fd=13 97 + [event22:base-stat] 98 + fd=22 196 99 type=3 197 100 config=2 198 101 optional=1 ··· 201 104 # PERF_COUNT_HW_CACHE_LL << 0 | 202 105 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 203 106 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 204 - [event14:base-stat] 205 - fd=14 107 + [event23:base-stat] 108 + fd=23 206 109 type=3 207 110 config=65538 208 111 optional=1 ··· 211 114 # PERF_COUNT_HW_CACHE_L1I << 0 | 212 115 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 213 116 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 214 - [event15:base-stat] 215 - fd=15 117 + [event24:base-stat] 118 + fd=24 216 119 type=3 217 120 config=1 218 121 optional=1 ··· 221 124 # PERF_COUNT_HW_CACHE_L1I << 0 | 222 125 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 223 126 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 224 - [event16:base-stat] 225 - fd=16 127 + [event25:base-stat] 128 + fd=25 226 129 type=3 227 130 config=65537 228 131 optional=1 ··· 231 134 # PERF_COUNT_HW_CACHE_DTLB << 0 | 232 135 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 233 136 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 234 - [event17:base-stat] 235 - fd=17 137 + [event26:base-stat] 138 + fd=26 236 139 type=3 237 140 config=3 238 141 optional=1 ··· 241 144 # PERF_COUNT_HW_CACHE_DTLB << 0 | 242 145 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 243 146 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 244 - [event18:base-stat] 245 - fd=18 147 + [event27:base-stat] 148 + fd=27 246 149 type=3 247 150 config=65539 248 151 optional=1 ··· 251 154 # PERF_COUNT_HW_CACHE_ITLB << 0 | 252 155 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 253 156 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 254 - [event19:base-stat] 255 - fd=19 157 + [event28:base-stat] 158 + fd=28 256 159 type=3 257 160 config=4 258 161 optional=1 ··· 261 164 # PERF_COUNT_HW_CACHE_ITLB << 0 | 262 165 # (PERF_COUNT_HW_CACHE_OP_READ << 8) | 263 166 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 264 - [event20:base-stat] 265 - fd=20 167 + [event29:base-stat] 168 + fd=29 266 169 type=3 267 170 config=65540 268 171 optional=1 ··· 271 174 # PERF_COUNT_HW_CACHE_L1D << 0 | 272 175 # (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) | 273 176 # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) 274 - [event21:base-stat] 275 - fd=21 177 + [event30:base-stat] 178 + fd=30 276 179 type=3 277 180 config=512 278 181 optional=1 ··· 281 184 # PERF_COUNT_HW_CACHE_L1D << 0 | 282 185 # (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) | 283 186 # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) 284 - [event22:base-stat] 285 - fd=22 187 + [event31:base-stat] 188 + fd=31 286 189 type=3 287 190 config=66048 288 191 optional=1
+4 -1
tools/testing/selftests/drivers/dma-buf/udmabuf.c
··· 1 1 // SPDX-License-Identifier: GPL-2.0 2 + #define _GNU_SOURCE 3 + #define __EXPORTED_HEADERS__ 4 + 2 5 #include <stdio.h> 3 6 #include <stdlib.h> 4 7 #include <unistd.h> 5 8 #include <string.h> 6 9 #include <errno.h> 7 - #include <linux/fcntl.h> 10 + #include <fcntl.h> 8 11 #include <malloc.h> 9 12 10 13 #include <sys/ioctl.h>
+1 -1
tools/testing/selftests/kvm/include/x86_64/processor.h
··· 315 315 #define GET_XMM(__xmm) \ 316 316 ({ \ 317 317 unsigned long __val; \ 318 - asm volatile("movq %%"#__xmm", %0" : "=r"(__val) : : #__xmm); \ 318 + asm volatile("movq %%"#__xmm", %0" : "=r"(__val)); \ 319 319 __val; \ 320 320 }) 321 321
+59 -10
tools/testing/selftests/kvm/rseq_test.c
··· 10 10 #include <signal.h> 11 11 #include <syscall.h> 12 12 #include <sys/ioctl.h> 13 + #include <sys/sysinfo.h> 13 14 #include <asm/barrier.h> 14 15 #include <linux/atomic.h> 15 16 #include <linux/rseq.h> ··· 40 39 41 40 static pthread_t migration_thread; 42 41 static cpu_set_t possible_mask; 42 + static int min_cpu, max_cpu; 43 43 static bool done; 44 44 45 45 static atomic_t seq_cnt; ··· 59 57 TEST_ASSERT(!r, "rseq failed, errno = %d (%s)", errno, strerror(errno)); 60 58 } 61 59 60 + static int next_cpu(int cpu) 61 + { 62 + /* 63 + * Advance to the next CPU, skipping those that weren't in the original 64 + * affinity set. Sadly, there is no CPU_SET_FOR_EACH, and cpu_set_t's 65 + * data storage is considered as opaque. Note, if this task is pinned 66 + * to a small set of discontigous CPUs, e.g. 2 and 1023, this loop will 67 + * burn a lot cycles and the test will take longer than normal to 68 + * complete. 69 + */ 70 + do { 71 + cpu++; 72 + if (cpu > max_cpu) { 73 + cpu = min_cpu; 74 + TEST_ASSERT(CPU_ISSET(cpu, &possible_mask), 75 + "Min CPU = %d must always be usable", cpu); 76 + break; 77 + } 78 + } while (!CPU_ISSET(cpu, &possible_mask)); 79 + 80 + return cpu; 81 + } 82 + 62 83 static void *migration_worker(void *ign) 63 84 { 64 85 cpu_set_t allowed_mask; 65 - int r, i, nr_cpus, cpu; 86 + int r, i, cpu; 66 87 67 88 CPU_ZERO(&allowed_mask); 68 89 69 - nr_cpus = CPU_COUNT(&possible_mask); 70 - 71 - for (i = 0; i < NR_TASK_MIGRATIONS; i++) { 72 - cpu = i % nr_cpus; 73 - if (!CPU_ISSET(cpu, &possible_mask)) 74 - continue; 75 - 90 + for (i = 0, cpu = min_cpu; i < NR_TASK_MIGRATIONS; i++, cpu = next_cpu(cpu)) { 76 91 CPU_SET(cpu, &allowed_mask); 77 92 78 93 /* ··· 173 154 return NULL; 174 155 } 175 156 157 + static int calc_min_max_cpu(void) 158 + { 159 + int i, cnt, nproc; 160 + 161 + if (CPU_COUNT(&possible_mask) < 2) 162 + return -EINVAL; 163 + 164 + /* 165 + * CPU_SET doesn't provide a FOR_EACH helper, get the min/max CPU that 166 + * this task is affined to in order to reduce the time spent querying 167 + * unusable CPUs, e.g. if this task is pinned to a small percentage of 168 + * total CPUs. 169 + */ 170 + nproc = get_nprocs_conf(); 171 + min_cpu = -1; 172 + max_cpu = -1; 173 + cnt = 0; 174 + 175 + for (i = 0; i < nproc; i++) { 176 + if (!CPU_ISSET(i, &possible_mask)) 177 + continue; 178 + if (min_cpu == -1) 179 + min_cpu = i; 180 + max_cpu = i; 181 + cnt++; 182 + } 183 + 184 + return (cnt < 2) ? -EINVAL : 0; 185 + } 186 + 176 187 int main(int argc, char *argv[]) 177 188 { 178 189 int r, i, snapshot; ··· 216 167 TEST_ASSERT(!r, "sched_getaffinity failed, errno = %d (%s)", errno, 217 168 strerror(errno)); 218 169 219 - if (CPU_COUNT(&possible_mask) < 2) { 220 - print_skip("Only one CPU, task migration not possible\n"); 170 + if (calc_min_max_cpu()) { 171 + print_skip("Only one usable CPU, task migration not possible"); 221 172 exit(KSFT_SKIP); 222 173 } 223 174