No conflicts.
Unified · Split
| @@ -971,6 +971,7 @@ D: PowerPC · 970 unmodified lines | ||
| 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 |
| @@ -50,7 +50,6 @@ properties: · 49 unmodified lines | ||
| 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 |
| @@ -71,7 +70,6 @@ properties: · 14 unmodified lines | ||
| 71 | 70 | data-lanes: |
| 72 | 71 | description: array of physical DSI data lane indexes. |
| 73 | 72 | minItems: 1 |
| 74 | − maxItems: 4 | |
| 75 | 73 | items: |
| 76 | 74 | - const: 1 |
| 77 | 75 | - const: 2 |
| @@ -18,7 +18,7 @@ properties: · 17 unmodified lines | ||
| 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 |
| @@ -31,11 +31,11 @@ properties: · 30 unmodified lines | ||
| 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,6 +72,32 @@ allOf: · 30 unmodified lines | ||
| 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 |
| @@ -91,6 +117,7 @@ examples: · 13 unmodified lines | ||
| 91 | 117 | - | |
| 92 | 118 | #include <dt-bindings/clock/qcom,rpmcc.h> |
| 93 | 119 | #include <dt-bindings/clock/qcom,mmcc-sdm660.h> |
| 120 | + #include <dt-bindings/clock/qcom,gcc-sdm660.h> | |
| 94 | 121 | |
| 95 | 122 | bimc: interconnect@1008000 { |
| 96 | 123 | compatible = "qcom,sdm660-bimc"; |
| @@ -123,9 +150,20 @@ examples: · 26 unmodified lines | ||
| 123 | 150 | compatible = "qcom,sdm660-a2noc"; |
| 124 | 151 | reg = <0x01704000 0xc100>; |
| 125 | 152 | #interconnect-cells = <1>; |
| 126 | − clock-names = "bus", "bus_a"; | |
| 153 | + clock-names = "bus", | |
| 154 | + "bus_a", | |
| 155 | + "ipa", | |
| 156 | + "ufs_axi", | |
| 157 | + "aggre2_ufs_axi", | |
| 158 | + "aggre2_usb3_axi", | |
| 159 | + "cfg_noc_usb2_axi"; | |
| 127 | 160 | clocks = <&rpmcc RPM_SMD_AGGR2_NOC_CLK>, |
| 128 | − <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>; | |
| 161 | + <&rpmcc RPM_SMD_AGGR2_NOC_A_CLK>, | |
| 162 | + <&rpmcc RPM_SMD_IPA_CLK>, | |
| 163 | + <&gcc GCC_UFS_AXI_CLK>, | |
| 164 | + <&gcc GCC_AGGRE2_UFS_AXI_CLK>, | |
| 165 | + <&gcc GCC_AGGRE2_USB3_AXI_CLK>, | |
| 166 | + <&gcc GCC_CFG_NOC_USB2_AXI_CLK>; | |
| 129 | 167 | }; |
| 130 | 168 | |
| 131 | 169 | mnoc: interconnect@1745000 { |
| @@ -31,7 +31,7 @@ properties: · 30 unmodified lines | ||
| 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: |
| @@ -38,7 +38,7 @@ properties: · 37 unmodified lines | ||
| 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: |
| @@ -38,7 +38,7 @@ properties: · 37 unmodified lines | ||
| 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: |
| @@ -38,7 +38,7 @@ properties: · 37 unmodified lines | ||
| 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: |
| @@ -20,9 +20,7 @@ properties: · 19 unmodified lines | ||
| 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 |
| @@ -83,7 +83,7 @@ Example: · 82 unmodified lines | ||
| 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 | |
| @@ -34,7 +34,6 @@ properties: · 33 unmodified lines | ||
| 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 |
| @@ -41,7 +41,6 @@ properties: · 40 unmodified lines | ||
| 41 | 41 | - description: builtin MSI controller. |
| 42 | 42 | |
| 43 | 43 | interrupt-names: |
| 44 | − minItems: 1 | |
| 45 | 44 | items: |
| 46 | 45 | - const: msi |
| 47 | 46 | |
| @@ -132,20 +132,3 @@ On Family 17h and Family 18h CPUs, additional temperature sensors may report · 131 unmodified lines | ||
| 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. | |
| @@ -414,7 +414,8 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 413 unmodified lines | ||
| 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 |
| @@ -1275,6 +1276,7 @@ F: drivers/input/mouse/bcm5974.c · 854 unmodified lines | ||
| 1275 | 1276 | |
| 1276 | 1277 | APPLE DART IOMMU DRIVER |
| 1277 | 1278 | M: Sven Peter <sven@svenpeter.dev> |
| 1279 | +R: Alyssa Rosenzweig <alyssa@rosenzweig.io> | |
| 1278 | 1280 | L: iommu@lists.linux-foundation.org |
| 1279 | 1281 | S: Maintained |
| 1280 | 1282 | F: Documentation/devicetree/bindings/iommu/apple,dart.yaml |
| @@ -1711,6 +1713,8 @@ F: drivers/*/*alpine* · 430 unmodified lines | ||
| 1711 | 1713 | |
| 1712 | 1714 | ARM/APPLE MACHINE SUPPORT |
| 1713 | 1715 | M: Hector Martin <marcan@marcan.st> |
| 1716 | +M: Sven Peter <sven@svenpeter.dev> | |
| 1717 | +R: Alyssa Rosenzweig <alyssa@rosenzweig.io> | |
| 1714 | 1718 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 1715 | 1719 | S: Maintained |
| 1716 | 1720 | W: https://asahilinux.org |
| @@ -2236,6 +2240,7 @@ F: arch/arm/mach-pxa/mioa701.c · 519 unmodified lines | ||
| 2236 | 2240 | |
| 2237 | 2241 | ARM/MStar/Sigmastar Armv7 SoC support |
| 2238 | 2242 | M: Daniel Palmer <daniel@thingy.jp> |
| 2243 | +M: Romain Perier <romain.perier@gmail.com> | |
| 2239 | 2244 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 2240 | 2245 | S: Maintained |
| 2241 | 2246 | W: http://linux-chenxing.org/ |
| @@ -2712,6 +2717,7 @@ F: drivers/power/reset/keystone-reset.c · 470 unmodified lines | ||
| 2712 | 2717 | |
| 2713 | 2718 | ARM/TEXAS INSTRUMENTS K3 ARCHITECTURE |
| 2714 | 2719 | M: Nishanth Menon <nm@ti.com> |
| 2720 | +M: Vignesh Raghavendra <vigneshr@ti.com> | |
| 2715 | 2721 | M: Tero Kristo <kristo@kernel.org> |
| 2716 | 2722 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 2717 | 2723 | S: Supported |
| @@ -4656,7 +4662,7 @@ W: http://linux-cifs.samba.org/ · 1938 unmodified lines | ||
| 4656 | 4662 | T: git git://git.samba.org/sfrench/cifs-2.6.git |
| 4657 | 4663 | F: Documentation/admin-guide/cifs/ |
| 4658 | 4664 | F: fs/cifs/ |
| 4659 | −F: fs/cifs_common/ | |
| 4665 | +F: fs/smbfs_common/ | |
| 4660 | 4666 | |
| 4661 | 4667 | COMPACTPCI HOTPLUG CORE |
| 4662 | 4668 | M: Scott Murray <scott@spiteful.org> |
| @@ -8608,9 +8614,8 @@ F: Documentation/devicetree/bindings/iio/humidity/st,hts221.yaml · 3945 unmodified lines | ||
| 8608 | 8614 | F: drivers/iio/humidity/hts221* |
| 8609 | 8615 | |
| 8610 | 8616 | HUAWEI ETHERNET DRIVER |
| 8611 | −M: Bin Luo <luobin9@huawei.com> | |
| 8612 | 8617 | L: netdev@vger.kernel.org |
| 8613 | −S: Supported | |
| 8618 | +S: Orphan | |
| 8614 | 8619 | F: Documentation/networking/device_drivers/ethernet/huawei/hinic.rst |
| 8615 | 8620 | F: drivers/net/ethernet/huawei/hinic/ |
| 8616 | 8621 | |
| @@ -10194,8 +10199,8 @@ M: Hyunchul Lee <hyc.lee@gmail.com> · 1577 unmodified lines | ||
| 10194 | 10199 | L: linux-cifs@vger.kernel.org |
| 10195 | 10200 | S: Maintained |
| 10196 | 10201 | T: git git://git.samba.org/ksmbd.git |
| 10197 | −F: fs/cifs_common/ | |
| 10198 | 10202 | F: fs/ksmbd/ |
| 10203 | +F: fs/smbfs_common/ | |
| 10199 | 10204 | |
| 10200 | 10205 | KERNEL UNIT TESTING FRAMEWORK (KUnit) |
| 10201 | 10206 | M: Brendan Higgins <brendanhiggins@google.com> |
| @@ -17793,7 +17798,6 @@ F: drivers/staging/nvec/ · 7591 unmodified lines | ||
| 17793 | 17798 | |
| 17794 | 17799 | STAGING - OLPC SECONDARY DISPLAY CONTROLLER (DCON) |
| 17795 | 17800 | M: Jens Frederich <jfrederich@gmail.com> |
| 17796 | −M: Daniel Drake <dsd@laptop.org> | |
| 17797 | 17801 | M: Jon Nettleton <jon.nettleton@gmail.com> |
| 17798 | 17802 | S: Maintained |
| 17799 | 17803 | W: http://wiki.laptop.org/go/DCON |
| @@ -18549,13 +18553,14 @@ T: git git://linuxtv.org/media_tree.git · 749 unmodified lines | ||
| 18549 | 18553 | F: drivers/media/radio/radio-raremono.c |
| 18550 | 18554 | |
| 18551 | 18555 | THERMAL |
| 18552 | −M: Zhang Rui <rui.zhang@intel.com> | |
| 18556 | +M: Rafael J. Wysocki <rafael@kernel.org> | |
| 18553 | 18557 | M: Daniel Lezcano <daniel.lezcano@linaro.org> |
| 18554 | 18558 | R: Amit Kucheria <amitk@kernel.org> |
| 18559 | +R: Zhang Rui <rui.zhang@intel.com> | |
| 18555 | 18560 | L: linux-pm@vger.kernel.org |
| 18556 | 18561 | S: Supported |
| 18557 | 18562 | Q: https://patchwork.kernel.org/project/linux-pm/list/ |
| 18558 | −T: git git://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git | |
| 18563 | +T: git git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git thermal | |
| 18559 | 18564 | F: Documentation/devicetree/bindings/thermal/ |
| 18560 | 18565 | F: drivers/thermal/ |
| 18561 | 18566 | F: include/linux/cpu_cooling.h |
| @@ -20698,7 +20703,6 @@ S: Maintained · 2136 unmodified lines | ||
| 20698 | 20703 | F: mm/zbud.c |
| 20699 | 20704 | |
| 20700 | 20705 | ZD1211RW WIRELESS DRIVER |
| 20701 | −M: Daniel Drake <dsd@gentoo.org> | |
| 20702 | 20706 | M: Ulrich Kunitz <kune@deine-taler.de> |
| 20703 | 20707 | L: linux-wireless@vger.kernel.org |
| 20704 | 20708 | L: zd1211-devs@lists.sourceforge.net (subscribers-only) |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 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* |
| @@ -71,7 +71,6 @@ · 70 unmodified lines | ||
| 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 { |
| @@ -196,11 +196,13 @@ · 195 unmodified lines | ||
| 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 | }; |
| @@ -353,7 +355,10 @@ · 146 unmodified lines | ||
| 353 | 355 | #address-cells = <1>; |
| 354 | 356 | #size-cells = <0>; |
| 355 | 357 | pinctrl-names = "default"; |
| 356 | − pinctrl-0 = <&pinctrl_gmac0_default &pinctrl_gmac0_txck_default &pinctrl_gmac0_phy_irq>; | |
| 358 | + pinctrl-0 = <&pinctrl_gmac0_default | |
| 359 | + &pinctrl_gmac0_mdio_default | |
| 360 | + &pinctrl_gmac0_txck_default | |
| 361 | + &pinctrl_gmac0_phy_irq>; | |
| 357 | 362 | phy-mode = "rgmii-id"; |
| 358 | 363 | status = "okay"; |
| 359 | 364 | |
| @@ -368,7 +373,9 @@ · 8 unmodified lines | ||
| 368 | 373 | #address-cells = <1>; |
| 369 | 374 | #size-cells = <0>; |
| 370 | 375 | pinctrl-names = "default"; |
| 371 | − pinctrl-0 = <&pinctrl_gmac1_default &pinctrl_gmac1_phy_irq>; | |
| 376 | + pinctrl-0 = <&pinctrl_gmac1_default | |
| 377 | + &pinctrl_gmac1_mdio_default | |
| 378 | + &pinctrl_gmac1_phy_irq>; | |
| 372 | 379 | phy-mode = "rmii"; |
| 373 | 380 | status = "okay"; |
| 374 | 381 | |
| @@ -423,14 +430,20 @@ · 48 unmodified lines | ||
| 423 | 430 | <PIN_PA15__G0_TXEN>, |
| 424 | 431 | <PIN_PA30__G0_RXCK>, |
| 425 | 432 | <PIN_PA18__G0_RXDV>, |
| 426 | − <PIN_PA22__G0_MDC>, | |
| 427 | − <PIN_PA23__G0_MDIO>, | |
| 428 | 433 | <PIN_PA25__G0_125CK>; |
| 434 | + slew-rate = <0>; | |
| 435 | + bias-disable; | |
| 436 | + }; | |
| 437 | + | |
| 438 | + pinctrl_gmac0_mdio_default: gmac0_mdio_default { | |
| 439 | + pinmux = <PIN_PA22__G0_MDC>, | |
| 440 | + <PIN_PA23__G0_MDIO>; | |
| 429 | 441 | bias-disable; |
| 430 | 442 | }; |
| 431 | 443 | |
| 432 | 444 | pinctrl_gmac0_txck_default: gmac0_txck_default { |
| 433 | 445 | pinmux = <PIN_PA24__G0_TXCK>; |
| 446 | + slew-rate = <0>; | |
| 434 | 447 | bias-pull-up; |
| 435 | 448 | }; |
| 436 | 449 | |
| @@ -447,8 +460,13 @@ · 10 unmodified lines | ||
| 447 | 460 | <PIN_PD25__G1_RX0>, |
| 448 | 461 | <PIN_PD26__G1_RX1>, |
| 449 | 462 | <PIN_PD27__G1_RXER>, |
| 450 | − <PIN_PD24__G1_RXDV>, | |
| 451 | − <PIN_PD28__G1_MDC>, | |
| 463 | + <PIN_PD24__G1_RXDV>; | |
| 464 | + slew-rate = <0>; | |
| 465 | + bias-disable; | |
| 466 | + }; | |
| 467 | + | |
| 468 | + pinctrl_gmac1_mdio_default: gmac1_mdio_default { | |
| 469 | + pinmux = <PIN_PD28__G1_MDC>, | |
| 452 | 470 | <PIN_PD29__G1_MDIO>; |
| 453 | 471 | bias-disable; |
| 454 | 472 | }; |
| @@ -540,6 +558,7 @@ · 85 unmodified lines | ||
| 540 | 558 | <PIN_PA8__SDMMC0_DAT5>, |
| 541 | 559 | <PIN_PA9__SDMMC0_DAT6>, |
| 542 | 560 | <PIN_PA10__SDMMC0_DAT7>; |
| 561 | + slew-rate = <0>; | |
| 543 | 562 | bias-pull-up; |
| 544 | 563 | }; |
| 545 | 564 | |
| @@ -547,6 +566,7 @@ · 1 unmodified line | ||
| 547 | 566 | pinmux = <PIN_PA0__SDMMC0_CK>, |
| 548 | 567 | <PIN_PA2__SDMMC0_RSTN>, |
| 549 | 568 | <PIN_PA11__SDMMC0_DS>; |
| 569 | + slew-rate = <0>; | |
| 550 | 570 | bias-pull-up; |
| 551 | 571 | }; |
| 552 | 572 | }; |
| @@ -558,6 +578,7 @@ · 5 unmodified lines | ||
| 558 | 578 | <PIN_PC0__SDMMC1_DAT1>, |
| 559 | 579 | <PIN_PC1__SDMMC1_DAT2>, |
| 560 | 580 | <PIN_PC2__SDMMC1_DAT3>; |
| 581 | + slew-rate = <0>; | |
| 561 | 582 | bias-pull-up; |
| 562 | 583 | }; |
| 563 | 584 | |
| @@ -566,6 +587,7 @@ · 2 unmodified lines | ||
| 566 | 587 | <PIN_PB28__SDMMC1_RSTN>, |
| 567 | 588 | <PIN_PC5__SDMMC1_1V8SEL>, |
| 568 | 589 | <PIN_PC4__SDMMC1_CD>; |
| 590 | + slew-rate = <0>; | |
| 569 | 591 | bias-pull-up; |
| 570 | 592 | }; |
| 571 | 593 | }; |
| @@ -577,11 +599,13 @@ · 5 unmodified lines | ||
| 577 | 599 | <PIN_PD6__SDMMC2_DAT1>, |
| 578 | 600 | <PIN_PD7__SDMMC2_DAT2>, |
| 579 | 601 | <PIN_PD8__SDMMC2_DAT3>; |
| 602 | + slew-rate = <0>; | |
| 580 | 603 | bias-pull-up; |
| 581 | 604 | }; |
| 582 | 605 | |
| 583 | 606 | ck { |
| 584 | 607 | pinmux = <PIN_PD4__SDMMC2_CK>; |
| 608 | + slew-rate = <0>; | |
| 585 | 609 | bias-pull-up; |
| 586 | 610 | }; |
| 587 | 611 | }; |
| @@ -634,6 +658,15 @@ · 46 unmodified lines | ||
| 634 | 658 | pinctrl-0 = <&pinctrl_sdmmc2_default>; |
| 635 | 659 | }; |
| 636 | 660 | |
| 661 | +&shdwc { | |
| 662 | + atmel,shdwc-debouncer = <976>; | |
| 663 | + status = "okay"; | |
| 664 | + | |
| 665 | + input@0 { | |
| 666 | + reg = <0>; | |
| 667 | + }; | |
| 668 | +}; | |
| 669 | + | |
| 637 | 670 | &spdifrx { |
| 638 | 671 | pinctrl-names = "default"; |
| 639 | 672 | pinctrl-0 = <&pinctrl_spdifrx_default>; |
| @@ -56,6 +56,7 @@ · 55 unmodified lines | ||
| 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 { |
| @@ -76,8 +77,7 @@ · 14 unmodified lines | ||
| 76 | 77 | regulator-name = "vbus"; |
| 77 | 78 | regulator-min-microvolt = <5000000>; |
| 78 | 79 | regulator-max-microvolt = <5000000>; |
| 79 | − gpio = <&gpio1 2 GPIO_ACTIVE_HIGH>; | |
| 80 | − enable-active-high; | |
| 80 | + gpio = <&gpio1 2 0>; | |
| 81 | 81 | }; |
| 82 | 82 | }; |
| 83 | 83 | |
| @@ -5,6 +5,7 @@ · 4 unmodified lines | ||
| 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 | / { |
| @@ -277,6 +278,7 @@ · 266 unmodified lines | ||
| 277 | 278 | led-cur = /bits/ 8 <0x20>; |
| 278 | 279 | max-cur = /bits/ 8 <0x60>; |
| 279 | 280 | reg = <0>; |
| 281 | + color = <LED_COLOR_ID_RED>; | |
| 280 | 282 | }; |
| 281 | 283 | |
| 282 | 284 | chan@1 { |
| @@ -284,6 +286,7 @@ · 1 unmodified line | ||
| 284 | 286 | led-cur = /bits/ 8 <0x20>; |
| 285 | 287 | max-cur = /bits/ 8 <0x60>; |
| 286 | 288 | reg = <1>; |
| 289 | + color = <LED_COLOR_ID_GREEN>; | |
| 287 | 290 | }; |
| 288 | 291 | |
| 289 | 292 | chan@2 { |
| @@ -291,6 +294,7 @@ · 1 unmodified line | ||
| 291 | 294 | led-cur = /bits/ 8 <0x20>; |
| 292 | 295 | max-cur = /bits/ 8 <0x60>; |
| 293 | 296 | reg = <2>; |
| 297 | + color = <LED_COLOR_ID_BLUE>; | |
| 294 | 298 | }; |
| 295 | 299 | |
| 296 | 300 | chan@3 { |
| @@ -298,6 +302,7 @@ · 1 unmodified line | ||
| 298 | 302 | led-cur = /bits/ 8 <0x0>; |
| 299 | 303 | max-cur = /bits/ 8 <0x0>; |
| 300 | 304 | reg = <3>; |
| 305 | + color = <LED_COLOR_ID_WHITE>; | |
| 301 | 306 | }; |
| 302 | 307 | }; |
| 303 | 308 | |
| @@ -176,7 +176,18 @@ · 175 unmodified lines | ||
| 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 { |
| @@ -114,7 +114,7 @@ · 113 unmodified lines | ||
| 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,7 +124,7 @@ · 3 unmodified lines | ||
| 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 | }; |
| @@ -292,7 +292,7 @@ · 291 unmodified lines | ||
| 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 | }; |
| @@ -101,7 +101,7 @@ · 100 unmodified lines | ||
| 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 */ |
| @@ -198,7 +198,7 @@ · 197 unmodified lines | ||
| 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,22 +1148,21 @@ · 943 unmodified lines | ||
| 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 |
| @@ -1306,7 +1305,7 @@ · 136 unmodified lines | ||
| 1306 | 1305 | reg-names = "dsi_pll", "dsi_phy", "dsi_phy_regulator"; |
| 1307 | 1306 | clock-names = "iface_clk", "ref"; |
| 1308 | 1307 | clocks = <&mmcc DSI_M_AHB_CLK>, |
| 1309 | − <&cxo_board>; | |
| 1308 | + <&pxo_board>; | |
| 1310 | 1309 | }; |
| 1311 | 1310 | |
| 1312 | 1311 | |
| @@ -75,6 +75,17 @@ · 74 unmodified lines | ||
| 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>; |
| @@ -111,6 +122,17 @@ · 30 unmodified lines | ||
| 111 | 122 | clock-names = "td_slck", "md_slck", "main_xtal"; |
| 112 | 123 | }; |
| 113 | 124 | |
| 125 | + shdwc: shdwc@e001d010 { | |
| 126 | + compatible = "microchip,sama7g5-shdwc", "syscon"; | |
| 127 | + reg = <0xe001d010 0x10>; | |
| 128 | + clocks = <&clk32k 0>; | |
| 129 | + #address-cells = <1>; | |
| 130 | + #size-cells = <0>; | |
| 131 | + atmel,wakeup-rtc-timer; | |
| 132 | + atmel,wakeup-rtt-timer; | |
| 133 | + status = "disabled"; | |
| 134 | + }; | |
| 135 | + | |
| 114 | 136 | rtt: rtt@e001d020 { |
| 115 | 137 | compatible = "microchip,sama7g5-rtt", "microchip,sam9x60-rtt", "atmel,at91sam9260-rtt"; |
| 116 | 138 | reg = <0xe001d020 0x30>; |
| @@ -137,6 +159,11 @@ · 20 unmodified lines | ||
| 137 | 159 | clocks = <&clk32k 0>; |
| 138 | 160 | }; |
| 139 | 161 | |
| 162 | + chipid@e0020000 { | |
| 163 | + compatible = "microchip,sama7g5-chipid"; | |
| 164 | + reg = <0xe0020000 0x8>; | |
| 165 | + }; | |
| 166 | + | |
| 140 | 167 | sdmmc0: mmc@e1204000 { |
| 141 | 168 | compatible = "microchip,sama7g5-sdhci", "microchip,sam9x60-sdhci"; |
| 142 | 169 | reg = <0xe1204000 0x4000>; |
| @@ -515,6 +542,18 @@ · 372 unmodified lines | ||
| 515 | 542 | }; |
| 516 | 543 | }; |
| 517 | 544 | |
| 545 | + uddrc: uddrc@e3800000 { | |
| 546 | + compatible = "microchip,sama7g5-uddrc"; | |
| 547 | + reg = <0xe3800000 0x4000>; | |
| 548 | + status = "okay"; | |
| 549 | + }; | |
| 550 | + | |
| 551 | + ddr3phy: ddr3phy@e3804000 { | |
| 552 | + compatible = "microchip,sama7g5-ddr3phy"; | |
| 553 | + reg = <0xe3804000 0x1000>; | |
| 554 | + status = "okay"; | |
| 555 | + }; | |
| 556 | + | |
| 518 | 557 | gic: interrupt-controller@e8c11000 { |
| 519 | 558 | compatible = "arm,cortex-a7-gic"; |
| 520 | 559 | #interrupt-cells = <3>; |
| @@ -17,6 +17,7 @@ · 16 unmodified lines | ||
| 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 { |
| @@ -101,16 +102,68 @@ · 78 unmodified lines | ||
| 101 | 102 | }; |
| 102 | 103 | |
| 103 | 104 | bus@8000000 { |
| 104 | − motherboard-bus { | |
| 105 | − model = "V2M-P1"; | |
| 105 | + compatible = "simple-bus"; | |
| 106 | + #address-cells = <1>; | |
| 107 | + #size-cells = <1>; | |
| 108 | + | |
| 109 | + #interrupt-cells = <1>; | |
| 110 | + interrupt-map-mask = <0 63>; | |
| 111 | + interrupt-map = <0 0 &gic GIC_SPI 0 IRQ_TYPE_LEVEL_HIGH>, | |
| 112 | + <0 1 &gic GIC_SPI 1 IRQ_TYPE_LEVEL_HIGH>, | |
| 113 | + <0 2 &gic GIC_SPI 2 IRQ_TYPE_LEVEL_HIGH>, | |
| 114 | + <0 3 &gic GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>, | |
| 115 | + <0 4 &gic GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>, | |
| 116 | + <0 5 &gic GIC_SPI 5 IRQ_TYPE_LEVEL_HIGH>, | |
| 117 | + <0 6 &gic GIC_SPI 6 IRQ_TYPE_LEVEL_HIGH>, | |
| 118 | + <0 7 &gic GIC_SPI 7 IRQ_TYPE_LEVEL_HIGH>, | |
| 119 | + <0 8 &gic GIC_SPI 8 IRQ_TYPE_LEVEL_HIGH>, | |
| 120 | + <0 9 &gic GIC_SPI 9 IRQ_TYPE_LEVEL_HIGH>, | |
| 121 | + <0 10 &gic GIC_SPI 10 IRQ_TYPE_LEVEL_HIGH>, | |
| 122 | + <0 11 &gic GIC_SPI 11 IRQ_TYPE_LEVEL_HIGH>, | |
| 123 | + <0 12 &gic GIC_SPI 12 IRQ_TYPE_LEVEL_HIGH>, | |
| 124 | + <0 13 &gic GIC_SPI 13 IRQ_TYPE_LEVEL_HIGH>, | |
| 125 | + <0 14 &gic GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>, | |
| 126 | + <0 15 &gic GIC_SPI 15 IRQ_TYPE_LEVEL_HIGH>, | |
| 127 | + <0 16 &gic GIC_SPI 16 IRQ_TYPE_LEVEL_HIGH>, | |
| 128 | + <0 17 &gic GIC_SPI 17 IRQ_TYPE_LEVEL_HIGH>, | |
| 129 | + <0 18 &gic GIC_SPI 18 IRQ_TYPE_LEVEL_HIGH>, | |
| 130 | + <0 19 &gic GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>, | |
| 131 | + <0 20 &gic GIC_SPI 20 IRQ_TYPE_LEVEL_HIGH>, | |
| 132 | + <0 21 &gic GIC_SPI 21 IRQ_TYPE_LEVEL_HIGH>, | |
| 133 | + <0 22 &gic GIC_SPI 22 IRQ_TYPE_LEVEL_HIGH>, | |
| 134 | + <0 23 &gic GIC_SPI 23 IRQ_TYPE_LEVEL_HIGH>, | |
| 135 | + <0 24 &gic GIC_SPI 24 IRQ_TYPE_LEVEL_HIGH>, | |
| 136 | + <0 25 &gic GIC_SPI 25 IRQ_TYPE_LEVEL_HIGH>, | |
| 137 | + <0 26 &gic GIC_SPI 26 IRQ_TYPE_LEVEL_HIGH>, | |
| 138 | + <0 27 &gic GIC_SPI 27 IRQ_TYPE_LEVEL_HIGH>, | |
| 139 | + <0 28 &gic GIC_SPI 28 IRQ_TYPE_LEVEL_HIGH>, | |
| 140 | + <0 29 &gic GIC_SPI 29 IRQ_TYPE_LEVEL_HIGH>, | |
| 141 | + <0 30 &gic GIC_SPI 30 IRQ_TYPE_LEVEL_HIGH>, | |
| 142 | + <0 31 &gic GIC_SPI 31 IRQ_TYPE_LEVEL_HIGH>, | |
| 143 | + <0 32 &gic GIC_SPI 32 IRQ_TYPE_LEVEL_HIGH>, | |
| 144 | + <0 33 &gic GIC_SPI 33 IRQ_TYPE_LEVEL_HIGH>, | |
| 145 | + <0 34 &gic GIC_SPI 34 IRQ_TYPE_LEVEL_HIGH>, | |
| 146 | + <0 35 &gic GIC_SPI 35 IRQ_TYPE_LEVEL_HIGH>, | |
| 147 | + <0 36 &gic GIC_SPI 36 IRQ_TYPE_LEVEL_HIGH>, | |
| 148 | + <0 37 &gic GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>, | |
| 149 | + <0 38 &gic GIC_SPI 38 IRQ_TYPE_LEVEL_HIGH>, | |
| 150 | + <0 39 &gic GIC_SPI 39 IRQ_TYPE_LEVEL_HIGH>, | |
| 151 | + <0 40 &gic GIC_SPI 40 IRQ_TYPE_LEVEL_HIGH>, | |
| 152 | + <0 41 &gic GIC_SPI 41 IRQ_TYPE_LEVEL_HIGH>, | |
| 153 | + <0 42 &gic GIC_SPI 42 IRQ_TYPE_LEVEL_HIGH>; | |
| 154 | + | |
| 155 | + motherboard-bus@8000000 { | |
| 106 | 156 | arm,hbi = <0x190>; |
| 107 | 157 | arm,vexpress,site = <0>; |
| 108 | − arm,v2m-memory-map = "rs1"; | |
| 109 | 158 | compatible = "arm,vexpress,v2m-p1", "simple-bus"; |
| 110 | 159 | #address-cells = <2>; /* SMB chipselect number and offset */ |
| 111 | 160 | #size-cells = <1>; |
| 112 | − #interrupt-cells = <1>; | |
| 113 | − ranges; | |
| 161 | + ranges = <0 0 0x08000000 0x04000000>, | |
| 162 | + <1 0 0x14000000 0x04000000>, | |
| 163 | + <2 0 0x18000000 0x04000000>, | |
| 164 | + <3 0 0x1c000000 0x04000000>, | |
| 165 | + <4 0 0x0c000000 0x04000000>, | |
| 166 | + <5 0 0x10000000 0x04000000>; | |
| 114 | 167 | |
| 115 | 168 | nor_flash: flash@0 { |
| 116 | 169 | compatible = "arm,vexpress-flash", "cfi-flash"; |
| @@ -215,7 +268,7 @@ · 98 unmodified lines | ||
| 215 | 268 | clock-names = "apb_pclk"; |
| 216 | 269 | }; |
| 217 | 270 | |
| 218 | − mmci@50000 { | |
| 271 | + mmc@50000 { | |
| 219 | 272 | compatible = "arm,pl180", "arm,primecell"; |
| 220 | 273 | reg = <0x050000 0x1000>; |
| 221 | 274 | interrupts = <9>, <10>; |
| @@ -275,7 +328,7 @@ · 53 unmodified lines | ||
| 275 | 328 | clock-names = "uartclk", "apb_pclk"; |
| 276 | 329 | }; |
| 277 | 330 | |
| 278 | − wdt@f0000 { | |
| 331 | + watchdog@f0000 { | |
| 279 | 332 | compatible = "arm,sp805", "arm,primecell"; |
| 280 | 333 | reg = <0x0f0000 0x1000>; |
| 281 | 334 | interrupts = <0>; |
| @@ -17,18 +17,73 @@ · 16 unmodified lines | ||
| 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"; |
| @@ -237,62 +237,7 @@ · 236 unmodified lines | ||
| 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 { |
| @@ -609,62 +609,7 @@ · 608 unmodified lines | ||
| 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 { |
| @@ -207,62 +207,7 @@ · 206 unmodified lines | ||
| 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 { |
| @@ -295,64 +295,6 @@ · 294 unmodified lines | ||
| 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>; |
| @@ -40,7 +40,9 @@ EXPORT_SYMBOL(sharpsl_param); · 39 unmodified lines | ||
| 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; |
| @@ -76,6 +76,7 @@ CONFIG_REGULATOR_FIXED_VOLTAGE=y · 75 unmodified lines | ||
| 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 |
| @@ -292,6 +292,7 @@ CONFIG_DRM_IMX_LDB=y · 291 unmodified lines | ||
| 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 |
| @@ -456,6 +456,7 @@ CONFIG_PINCTRL_STMFX=y · 455 unmodified lines | ||
| 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 |
| @@ -725,6 +726,7 @@ CONFIG_DRM_PL111=m · 263 unmodified lines | ||
| 725 | 726 | CONFIG_DRM_LIMA=m |
| 726 | 727 | CONFIG_DRM_PANFROST=m |
| 727 | 728 | CONFIG_DRM_ASPEED_GFX=m |
| 729 | +CONFIG_FB=y | |
| 728 | 730 | CONFIG_FB_EFI=y |
| 729 | 731 | CONFIG_FB_WM8505=y |
| 730 | 732 | CONFIG_FB_SH_MOBILE_LCDC=y |
| @@ -1122,6 +1124,7 @@ CONFIG_PHY_DM816X_USB=m · 391 unmodified lines | ||
| 1122 | 1124 | CONFIG_OMAP_USB2=y |
| 1123 | 1125 | CONFIG_TI_PIPE3=y |
| 1124 | 1126 | CONFIG_TWL4030_USB=m |
| 1127 | +CONFIG_RAS=y | |
| 1125 | 1128 | CONFIG_NVMEM_IMX_OCOTP=y |
| 1126 | 1129 | CONFIG_ROCKCHIP_EFUSE=m |
| 1127 | 1130 | CONFIG_NVMEM_SUNXI_SID=y |
| @@ -47,12 +47,26 @@ struct at91_pm_bu { · 46 unmodified lines | ||
| 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 | */ |
| @@ -62,6 +76,7 @@ struct at91_soc_pm { · 3 unmodified lines | ||
| 62 | 76 | const struct of_device_id *ws_ids; |
| 63 | 77 | struct at91_pm_bu *bu; |
| 64 | 78 | struct at91_pm_data data; |
| 79 | + struct at91_pm_sfrbu_regs sfrbu_regs; | |
| 65 | 80 | void *memcs; |
| 66 | 81 | }; |
| 67 | 82 | |
| @@ -356,9 +371,36 @@ static int at91_suspend_finish(unsigned long val) · 288 unmodified lines | ||
| 356 | 371 | return 0; |
| 357 | 372 | } |
| 358 | 373 | |
| 374 | +static void at91_pm_switch_ba_to_vbat(void) | |
| 375 | +{ | |
| 376 | + unsigned int offset = offsetof(struct at91_pm_sfrbu_regs, pswbu); | |
| 377 | + unsigned int val; | |
| 378 | + | |
| 379 | + /* Just for safety. */ | |
| 380 | + if (!soc_pm.data.sfrbu) | |
| 381 | + return; | |
| 382 | + | |
| 383 | + val = readl(soc_pm.data.sfrbu + offset); | |
| 384 | + | |
| 385 | + /* Already on VBAT. */ | |
| 386 | + if (!(val & soc_pm.sfrbu_regs.pswbu.state)) | |
| 387 | + return; | |
| 388 | + | |
| 389 | + val &= ~soc_pm.sfrbu_regs.pswbu.softsw; | |
| 390 | + val |= soc_pm.sfrbu_regs.pswbu.key | soc_pm.sfrbu_regs.pswbu.ctrl; | |
| 391 | + writel(val, soc_pm.data.sfrbu + offset); | |
| 392 | + | |
| 393 | + /* Wait for update. */ | |
| 394 | + val = readl(soc_pm.data.sfrbu + offset); | |
| 395 | + while (val & soc_pm.sfrbu_regs.pswbu.state) | |
| 396 | + val = readl(soc_pm.data.sfrbu + offset); | |
| 397 | +} | |
| 398 | + | |
| 359 | 399 | static void at91_pm_suspend(suspend_state_t state) |
| 360 | 400 | { |
| 361 | 401 | if (soc_pm.data.mode == AT91_PM_BACKUP) { |
| 402 | + at91_pm_switch_ba_to_vbat(); | |
| 403 | + | |
| 362 | 404 | cpu_suspend(0, at91_suspend_finish); |
| 363 | 405 | |
| 364 | 406 | /* The SRAM is lost between suspend cycles */ |
| @@ -589,18 +631,22 @@ static const struct of_device_id ramc_phy_ids[] __initconst = { · 224 unmodified lines | ||
| 589 | 631 | { /* Sentinel. */ }, |
| 590 | 632 | }; |
| 591 | 633 | |
| 592 | −static __init void at91_dt_ramc(bool phy_mandatory) | |
| 634 | +static __init int at91_dt_ramc(bool phy_mandatory) | |
| 593 | 635 | { |
| 594 | 636 | struct device_node *np; |
| 595 | 637 | const struct of_device_id *of_id; |
| 596 | 638 | int idx = 0; |
| 597 | 639 | void *standby = NULL; |
| 598 | 640 | const struct ramc_info *ramc; |
| 641 | + int ret; | |
| 599 | 642 | |
| 600 | 643 | for_each_matching_node_and_match(np, ramc_ids, &of_id) { |
| 601 | 644 | soc_pm.data.ramc[idx] = of_iomap(np, 0); |
| 602 | − if (!soc_pm.data.ramc[idx]) | |
| 603 | − panic(pr_fmt("unable to map ramc[%d] cpu registers\n"), idx); | |
| 645 | + if (!soc_pm.data.ramc[idx]) { | |
| 646 | + pr_err("unable to map ramc[%d] cpu registers\n", idx); | |
| 647 | + ret = -ENOMEM; | |
| 648 | + goto unmap_ramc; | |
| 649 | + } | |
| 604 | 650 | |
| 605 | 651 | ramc = of_id->data; |
| 606 | 652 | if (ramc) { |
| @@ -612,25 +658,42 @@ static __init void at91_dt_ramc(bool phy_mandatory) · 5 unmodified lines | ||
| 612 | 658 | idx++; |
| 613 | 659 | } |
| 614 | 660 | |
| 615 | − if (!idx) | |
| 616 | − panic(pr_fmt("unable to find compatible ram controller node in dtb\n")); | |
| 661 | + if (!idx) { | |
| 662 | + pr_err("unable to find compatible ram controller node in dtb\n"); | |
| 663 | + ret = -ENODEV; | |
| 664 | + goto unmap_ramc; | |
| 665 | + } | |
| 617 | 666 | |
| 618 | 667 | /* Lookup for DDR PHY node, if any. */ |
| 619 | 668 | for_each_matching_node_and_match(np, ramc_phy_ids, &of_id) { |
| 620 | 669 | soc_pm.data.ramc_phy = of_iomap(np, 0); |
| 621 | − if (!soc_pm.data.ramc_phy) | |
| 622 | − panic(pr_fmt("unable to map ramc phy cpu registers\n")); | |
| 670 | + if (!soc_pm.data.ramc_phy) { | |
| 671 | + pr_err("unable to map ramc phy cpu registers\n"); | |
| 672 | + ret = -ENOMEM; | |
| 673 | + goto unmap_ramc; | |
| 674 | + } | |
| 623 | 675 | } |
| 624 | 676 | |
| 625 | − if (phy_mandatory && !soc_pm.data.ramc_phy) | |
| 626 | − panic(pr_fmt("DDR PHY is mandatory!\n")); | |
| 677 | + if (phy_mandatory && !soc_pm.data.ramc_phy) { | |
| 678 | + pr_err("DDR PHY is mandatory!\n"); | |
| 679 | + ret = -ENODEV; | |
| 680 | + goto unmap_ramc; | |
| 681 | + } | |
| 627 | 682 | |
| 628 | 683 | if (!standby) { |
| 629 | 684 | pr_warn("ramc no standby function available\n"); |
| 630 | − return; | |
| 685 | + return 0; | |
| 631 | 686 | } |
| 632 | 687 | |
| 633 | 688 | at91_cpuidle_device.dev.platform_data = standby; |
| 689 | + | |
| 690 | + return 0; | |
| 691 | + | |
| 692 | +unmap_ramc: | |
| 693 | + while (idx) | |
| 694 | + iounmap(soc_pm.data.ramc[--idx]); | |
| 695 | + | |
| 696 | + return ret; | |
| 634 | 697 | } |
| 635 | 698 | |
| 636 | 699 | static void at91rm9200_idle(void) |
| @@ -1017,6 +1080,8 @@ static void __init at91_pm_init(void (*pm_idle)(void)) · 380 unmodified lines | ||
| 1017 | 1080 | |
| 1018 | 1081 | void __init at91rm9200_pm_init(void) |
| 1019 | 1082 | { |
| 1083 | + int ret; | |
| 1084 | + | |
| 1020 | 1085 | if (!IS_ENABLED(CONFIG_SOC_AT91RM9200)) |
| 1021 | 1086 | return; |
| 1022 | 1087 | |
| @@ -1028,7 +1093,9 @@ void __init at91rm9200_pm_init(void) · 5 unmodified lines | ||
| 1028 | 1093 | soc_pm.data.standby_mode = AT91_PM_STANDBY; |
| 1029 | 1094 | soc_pm.data.suspend_mode = AT91_PM_ULP0; |
| 1030 | 1095 | |
| 1031 | − at91_dt_ramc(false); | |
| 1096 | + ret = at91_dt_ramc(false); | |
| 1097 | + if (ret) | |
| 1098 | + return; | |
| 1032 | 1099 | |
| 1033 | 1100 | /* |
| 1034 | 1101 | * AT91RM9200 SDRAM low-power mode cannot be used with self-refresh. |
| @@ -1046,13 +1113,17 @@ void __init sam9x60_pm_init(void) · 11 unmodified lines | ||
| 1046 | 1113 | static const int iomaps[] __initconst = { |
| 1047 | 1114 | [AT91_PM_ULP1] = AT91_PM_IOMAP(SHDWC), |
| 1048 | 1115 | }; |
| 1116 | + int ret; | |
| 1049 | 1117 | |
| 1050 | 1118 | if (!IS_ENABLED(CONFIG_SOC_SAM9X60)) |
| 1051 | 1119 | return; |
| 1052 | 1120 | |
| 1053 | 1121 | at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); |
| 1054 | 1122 | at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps)); |
| 1055 | − at91_dt_ramc(false); | |
| 1123 | + ret = at91_dt_ramc(false); | |
| 1124 | + if (ret) | |
| 1125 | + return; | |
| 1126 | + | |
| 1056 | 1127 | at91_pm_init(NULL); |
| 1057 | 1128 | |
| 1058 | 1129 | soc_pm.ws_ids = sam9x60_ws_ids; |
| @@ -1061,6 +1132,8 @@ void __init sam9x60_pm_init(void) · 2 unmodified lines | ||
| 1061 | 1132 | |
| 1062 | 1133 | void __init at91sam9_pm_init(void) |
| 1063 | 1134 | { |
| 1135 | + int ret; | |
| 1136 | + | |
| 1064 | 1137 | if (!IS_ENABLED(CONFIG_SOC_AT91SAM9)) |
| 1065 | 1138 | return; |
| 1066 | 1139 | |
| @@ -1072,7 +1145,10 @@ void __init at91sam9_pm_init(void) · 5 unmodified lines | ||
| 1072 | 1145 | soc_pm.data.standby_mode = AT91_PM_STANDBY; |
| 1073 | 1146 | soc_pm.data.suspend_mode = AT91_PM_ULP0; |
| 1074 | 1147 | |
| 1075 | − at91_dt_ramc(false); | |
| 1148 | + ret = at91_dt_ramc(false); | |
| 1149 | + if (ret) | |
| 1150 | + return; | |
| 1151 | + | |
| 1076 | 1152 | at91_pm_init(at91sam9_idle); |
| 1077 | 1153 | } |
| 1078 | 1154 | |
| @@ -1081,12 +1157,16 @@ void __init sama5_pm_init(void) · 2 unmodified lines | ||
| 1081 | 1157 | static const int modes[] __initconst = { |
| 1082 | 1158 | AT91_PM_STANDBY, AT91_PM_ULP0, AT91_PM_ULP0_FAST, |
| 1083 | 1159 | }; |
| 1160 | + int ret; | |
| 1084 | 1161 | |
| 1085 | 1162 | if (!IS_ENABLED(CONFIG_SOC_SAMA5)) |
| 1086 | 1163 | return; |
| 1087 | 1164 | |
| 1088 | 1165 | at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); |
| 1089 | − at91_dt_ramc(false); | |
| 1166 | + ret = at91_dt_ramc(false); | |
| 1167 | + if (ret) | |
| 1168 | + return; | |
| 1169 | + | |
| 1090 | 1170 | at91_pm_init(NULL); |
| 1091 | 1171 | } |
| 1092 | 1172 | |
| @@ -1101,18 +1181,27 @@ void __init sama5d2_pm_init(void) · 8 unmodified lines | ||
| 1101 | 1181 | [AT91_PM_BACKUP] = AT91_PM_IOMAP(SHDWC) | |
| 1102 | 1182 | AT91_PM_IOMAP(SFRBU), |
| 1103 | 1183 | }; |
| 1184 | + int ret; | |
| 1104 | 1185 | |
| 1105 | 1186 | if (!IS_ENABLED(CONFIG_SOC_SAMA5D2)) |
| 1106 | 1187 | return; |
| 1107 | 1188 | |
| 1108 | 1189 | at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); |
| 1109 | 1190 | at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps)); |
| 1110 | − at91_dt_ramc(false); | |
| 1191 | + ret = at91_dt_ramc(false); | |
| 1192 | + if (ret) | |
| 1193 | + return; | |
| 1194 | + | |
| 1111 | 1195 | at91_pm_init(NULL); |
| 1112 | 1196 | |
| 1113 | 1197 | soc_pm.ws_ids = sama5d2_ws_ids; |
| 1114 | 1198 | soc_pm.config_shdwc_ws = at91_sama5d2_config_shdwc_ws; |
| 1115 | 1199 | soc_pm.config_pmc_ws = at91_sama5d2_config_pmc_ws; |
| 1200 | + | |
| 1201 | + soc_pm.sfrbu_regs.pswbu.key = (0x4BD20C << 8); | |
| 1202 | + soc_pm.sfrbu_regs.pswbu.ctrl = BIT(0); | |
| 1203 | + soc_pm.sfrbu_regs.pswbu.softsw = BIT(1); | |
| 1204 | + soc_pm.sfrbu_regs.pswbu.state = BIT(3); | |
| 1116 | 1205 | } |
| 1117 | 1206 | |
| 1118 | 1207 | void __init sama7_pm_init(void) |
| @@ -1127,18 +1216,27 @@ void __init sama7_pm_init(void) · 8 unmodified lines | ||
| 1127 | 1216 | [AT91_PM_BACKUP] = AT91_PM_IOMAP(SFRBU) | |
| 1128 | 1217 | AT91_PM_IOMAP(SHDWC), |
| 1129 | 1218 | }; |
| 1219 | + int ret; | |
| 1130 | 1220 | |
| 1131 | 1221 | if (!IS_ENABLED(CONFIG_SOC_SAMA7)) |
| 1132 | 1222 | return; |
| 1133 | 1223 | |
| 1134 | 1224 | at91_pm_modes_validate(modes, ARRAY_SIZE(modes)); |
| 1135 | 1225 | |
| 1136 | − at91_dt_ramc(true); | |
| 1226 | + ret = at91_dt_ramc(true); | |
| 1227 | + if (ret) | |
| 1228 | + return; | |
| 1229 | + | |
| 1137 | 1230 | at91_pm_modes_init(iomaps, ARRAY_SIZE(iomaps)); |
| 1138 | 1231 | at91_pm_init(NULL); |
| 1139 | 1232 | |
| 1140 | 1233 | soc_pm.ws_ids = sama7g5_ws_ids; |
| 1141 | 1234 | soc_pm.config_pmc_ws = at91_sam9x60_config_pmc_ws; |
| 1235 | + | |
| 1236 | + soc_pm.sfrbu_regs.pswbu.key = (0x4BD20C << 8); | |
| 1237 | + soc_pm.sfrbu_regs.pswbu.ctrl = BIT(0); | |
| 1238 | + soc_pm.sfrbu_regs.pswbu.softsw = BIT(1); | |
| 1239 | + soc_pm.sfrbu_regs.pswbu.state = BIT(2); | |
| 1142 | 1240 | } |
| 1143 | 1241 | |
| 1144 | 1242 | static int __init at91_pm_modes_select(char *str) |
| @@ -1014,31 +1014,55 @@ ENTRY(at91_pm_suspend_in_sram) · 1013 unmodified lines | ||
| 1014 | 1014 | mov tmp1, #0 |
| 1015 | 1015 | mcr p15, 0, tmp1, c7, c10, 4 |
| 1016 | 1016 | |
| 1017 | + /* Flush tlb. */ | |
| 1018 | + mov r4, #0 | |
| 1019 | + mcr p15, 0, r4, c8, c7, 0 | |
| 1020 | + | |
| 1021 | + ldr tmp1, [r0, #PM_DATA_PMC_MCKR_OFFSET] | |
| 1022 | + str tmp1, .mckr_offset | |
| 1023 | + ldr tmp1, [r0, #PM_DATA_PMC_VERSION] | |
| 1024 | + str tmp1, .pmc_version | |
| 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 | + */ | |
| 1017 | 1034 | ldr tmp1, [r0, #PM_DATA_PMC] |
| 1018 | 1035 | str tmp1, .pmc_base |
| 1036 | + cmp tmp1, #0 | |
| 1037 | + ldrne tmp2, [tmp1, #0] | |
| 1038 | + | |
| 1019 | 1039 | ldr tmp1, [r0, #PM_DATA_RAMC0] |
| 1020 | 1040 | str tmp1, .sramc_base |
| 1041 | + cmp tmp1, #0 | |
| 1042 | + ldrne tmp2, [tmp1, #0] | |
| 1043 | + | |
| 1021 | 1044 | ldr tmp1, [r0, #PM_DATA_RAMC1] |
| 1022 | 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 */ | |
| 1023 | 1051 | ldr tmp1, [r0, #PM_DATA_RAMC_PHY] |
| 1024 | 1052 | 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 | |
| 1029 | − ldr tmp1, [r0, #PM_DATA_PMC_MCKR_OFFSET] | |
| 1030 | − str tmp1, .mckr_offset | |
| 1031 | − ldr tmp1, [r0, #PM_DATA_PMC_VERSION] | |
| 1032 | − str tmp1, .pmc_version | |
| 1033 | − /* Both ldrne below are here to preload their address in the TLB */ | |
| 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 |
| @@ -11,7 +11,7 @@ · 10 unmodified lines | ||
| 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,7 +24,7 @@ static void putc(const char c) · 6 unmodified lines | ||
| 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 | |
| @@ -172,6 +172,9 @@ static void __init imx6q_init_machine(void) · 171 unmodified lines | ||
| 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(); |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | ||
| 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> |
| @@ -619,6 +620,7 @@ static void __init imx6_pm_common_init(const struct imx6_pm_socdata · 603 unmodified lines | ||
| 619 | 620 | |
| 620 | 621 | static void imx6_pm_stby_poweroff(void) |
| 621 | 622 | { |
| 623 | + gic_cpu_if_down(0); | |
| 622 | 624 | imx6_set_lpm(STOP_POWER_OFF); |
| 623 | 625 | imx6q_suspend_finish(0); |
| 624 | 626 | |
| @@ -9,16 +9,4 @@ · 8 unmodified lines | ||
| 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 |
| @@ -11,6 +11,7 @@ · 10 unmodified lines | ||
| 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 | |
| @@ -206,8 +207,6 @@ static inline void udc_device_init(struct omap_usb_config *pdata) · 189 unmodified lines | ||
| 206 | 207 | |
| 207 | 208 | #endif |
| 208 | 209 | |
| 209 | −#if IS_ENABLED(CONFIG_USB_OHCI_HCD) | |
| 210 | − | |
| 211 | 210 | /* The dmamask must be set for OHCI to work */ |
| 212 | 211 | static u64 ohci_dmamask = ~(u32)0; |
| 213 | 212 | |
| @@ -236,20 +235,15 @@ static struct platform_device ohci_device = { · 22 unmodified lines | ||
| 236 | 235 | |
| 237 | 236 | static inline void ohci_device_init(struct omap_usb_config *pdata) |
| 238 | 237 | { |
| 238 | + if (!IS_ENABLED(CONFIG_USB_OHCI_HCD)) | |
| 239 | + return; | |
| 240 | + | |
| 239 | 241 | if (cpu_is_omap7xx()) |
| 240 | 242 | ohci_resources[1].start = INT_7XX_USB_HHC_1; |
| 241 | 243 | pdata->ohci_device = &ohci_device; |
| 242 | 244 | pdata->ocpi_enable = &ocpi_enable; |
| 243 | 245 | } |
| 244 | 246 | |
| 245 | −#else | |
| 246 | − | |
| 247 | −static inline void ohci_device_init(struct omap_usb_config *pdata) | |
| 248 | −{ | |
| 249 | −} | |
| 250 | − | |
| 251 | −#endif | |
| 252 | − | |
| 253 | 247 | #if defined(CONFIG_USB_OTG) && defined(CONFIG_ARCH_OMAP_OTG) |
| 254 | 248 | |
| 255 | 249 | static struct resource otg_resources[] = { |
| @@ -534,33 +528,87 @@ bad: · 278 unmodified lines | ||
| 534 | 528 | } |
| 535 | 529 | |
| 536 | 530 | #ifdef CONFIG_ARCH_OMAP15XX |
| 531 | +/* OMAP-1510 OHCI has its own MMU for DMA */ | |
| 532 | +#define OMAP1510_LB_MEMSIZE 32 /* Should be same as SDRAM size */ | |
| 533 | +#define OMAP1510_LB_CLOCK_DIV 0xfffec10c | |
| 534 | +#define OMAP1510_LB_MMU_CTL 0xfffec208 | |
| 535 | +#define OMAP1510_LB_MMU_LCK 0xfffec224 | |
| 536 | +#define OMAP1510_LB_MMU_LD_TLB 0xfffec228 | |
| 537 | +#define OMAP1510_LB_MMU_CAM_H 0xfffec22c | |
| 538 | +#define OMAP1510_LB_MMU_CAM_L 0xfffec230 | |
| 539 | +#define OMAP1510_LB_MMU_RAM_H 0xfffec234 | |
| 540 | +#define OMAP1510_LB_MMU_RAM_L 0xfffec238 | |
| 537 | 541 | |
| 538 | −/* ULPD_DPLL_CTRL */ | |
| 539 | −#define DPLL_IOB (1 << 13) | |
| 540 | −#define DPLL_PLL_ENABLE (1 << 4) | |
| 541 | −#define DPLL_LOCK (1 << 0) | |
| 542 | +/* | |
| 543 | + * Bus address is physical address, except for OMAP-1510 Local Bus. | |
| 544 | + * OMAP-1510 bus address is translated into a Local Bus address if the | |
| 545 | + * OMAP bus type is lbus. | |
| 546 | + */ | |
| 547 | +#define OMAP1510_LB_OFFSET UL(0x30000000) | |
| 542 | 548 | |
| 543 | −/* ULPD_APLL_CTRL */ | |
| 544 | −#define APLL_NDPLL_SWITCH (1 << 0) | |
| 549 | +/* | |
| 550 | + * OMAP-1510 specific Local Bus clock on/off | |
| 551 | + */ | |
| 552 | +static int omap_1510_local_bus_power(int on) | |
| 553 | +{ | |
| 554 | + if (on) { | |
| 555 | + omap_writel((1 << 1) | (1 << 0), OMAP1510_LB_MMU_CTL); | |
| 556 | + udelay(200); | |
| 557 | + } else { | |
| 558 | + omap_writel(0, OMAP1510_LB_MMU_CTL); | |
| 559 | + } | |
| 545 | 560 | |
| 546 | −static int omap_1510_usb_ohci_notifier(struct notifier_block *nb, | |
| 547 | − unsigned long event, void *data) | |
| 561 | + return 0; | |
| 562 | +} | |
| 563 | + | |
| 564 | +/* | |
| 565 | + * OMAP-1510 specific Local Bus initialization | |
| 566 | + * NOTE: This assumes 32MB memory size in OMAP1510LB_MEMSIZE. | |
| 567 | + * See also arch/mach-omap/memory.h for __virt_to_dma() and | |
| 568 | + * __dma_to_virt() which need to match with the physical | |
| 569 | + * Local Bus address below. | |
| 570 | + */ | |
| 571 | +static int omap_1510_local_bus_init(void) | |
| 548 | 572 | { |
| 549 | − struct device *dev = data; | |
| 573 | + unsigned int tlb; | |
| 574 | + unsigned long lbaddr, physaddr; | |
| 575 | + | |
| 576 | + omap_writel((omap_readl(OMAP1510_LB_CLOCK_DIV) & 0xfffffff8) | 0x4, | |
| 577 | + OMAP1510_LB_CLOCK_DIV); | |
| 578 | + | |
| 579 | + /* Configure the Local Bus MMU table */ | |
| 580 | + for (tlb = 0; tlb < OMAP1510_LB_MEMSIZE; tlb++) { | |
| 581 | + lbaddr = tlb * 0x00100000 + OMAP1510_LB_OFFSET; | |
| 582 | + physaddr = tlb * 0x00100000 + PHYS_OFFSET; | |
| 583 | + omap_writel((lbaddr & 0x0fffffff) >> 22, OMAP1510_LB_MMU_CAM_H); | |
| 584 | + omap_writel(((lbaddr & 0x003ffc00) >> 6) | 0xc, | |
| 585 | + OMAP1510_LB_MMU_CAM_L); | |
| 586 | + omap_writel(physaddr >> 16, OMAP1510_LB_MMU_RAM_H); | |
| 587 | + omap_writel((physaddr & 0x0000fc00) | 0x300, OMAP1510_LB_MMU_RAM_L); | |
| 588 | + omap_writel(tlb << 4, OMAP1510_LB_MMU_LCK); | |
| 589 | + omap_writel(0x1, OMAP1510_LB_MMU_LD_TLB); | |
| 590 | + } | |
| 550 | 591 | |
| 551 | − if (event != BUS_NOTIFY_ADD_DEVICE) | |
| 552 | − return NOTIFY_DONE; | |
| 592 | + /* Enable the walking table */ | |
| 593 | + omap_writel(omap_readl(OMAP1510_LB_MMU_CTL) | (1 << 3), OMAP1510_LB_MMU_CTL); | |
| 594 | + udelay(200); | |
| 553 | 595 | |
| 554 | − if (strncmp(dev_name(dev), "ohci", 4) == 0 && | |
| 555 | − dma_direct_set_offset(dev, PHYS_OFFSET, OMAP1510_LB_OFFSET, | |
| 556 | − (u64)-1)) | |
| 557 | − WARN_ONCE(1, "failed to set DMA offset\n"); | |
| 558 | − return NOTIFY_OK; | |
| 596 | + return 0; | |
| 559 | 597 | } |
| 560 | 598 | |
| 561 | −static struct notifier_block omap_1510_usb_ohci_nb = { | |
| 562 | − .notifier_call = omap_1510_usb_ohci_notifier, | |
| 563 | −}; | |
| 599 | +static void omap_1510_local_bus_reset(void) | |
| 600 | +{ | |
| 601 | + omap_1510_local_bus_power(1); | |
| 602 | + omap_1510_local_bus_init(); | |
| 603 | +} | |
| 604 | + | |
| 605 | +/* ULPD_DPLL_CTRL */ | |
| 606 | +#define DPLL_IOB (1 << 13) | |
| 607 | +#define DPLL_PLL_ENABLE (1 << 4) | |
| 608 | +#define DPLL_LOCK (1 << 0) | |
| 609 | + | |
| 610 | +/* ULPD_APLL_CTRL */ | |
| 611 | +#define APLL_NDPLL_SWITCH (1 << 0) | |
| 564 | 612 | |
| 565 | 613 | static void __init omap_1510_usb_init(struct omap_usb_config *config) |
| 566 | 614 | { |
| @@ -616,19 +664,19 @@ static void __init omap_1510_usb_init(struct omap_usb_config *config) · 49 unmodified lines | ||
| 616 | 664 | } |
| 617 | 665 | #endif |
| 618 | 666 | |
| 619 | −#if IS_ENABLED(CONFIG_USB_OHCI_HCD) | |
| 620 | − if (config->register_host) { | |
| 667 | + if (IS_ENABLED(CONFIG_USB_OHCI_HCD) && config->register_host) { | |
| 621 | 668 | int status; |
| 622 | 669 | |
| 623 | − bus_register_notifier(&platform_bus_type, | |
| 624 | − &omap_1510_usb_ohci_nb); | |
| 625 | 670 | ohci_device.dev.platform_data = config; |
| 671 | + dma_direct_set_offset(&ohci_device.dev, PHYS_OFFSET, | |
| 672 | + OMAP1510_LB_OFFSET, (u64)-1); | |
| 626 | 673 | status = platform_device_register(&ohci_device); |
| 627 | 674 | if (status) |
| 628 | 675 | pr_debug("can't register OHCI device, %d\n", status); |
| 629 | 676 | /* hcd explicitly gates 48MHz */ |
| 677 | + | |
| 678 | + config->lb_reset = omap_1510_local_bus_reset; | |
| 630 | 679 | } |
| 631 | −#endif | |
| 632 | 680 | } |
| 633 | 681 | |
| 634 | 682 | #else |
| @@ -3614,6 +3614,8 @@ int omap_hwmod_init_module(struct device *dev, · 3613 unmodified lines | ||
| 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, |
| @@ -36,6 +36,10 @@ · 35 unmodified lines | ||
| 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 | * | | |
| @@ -63,6 +67,12 @@ · 21 unmodified lines | ||
| 63 | 67 | * |
| 64 | 68 | * When popping registers off the stack at the end of a BPF function, we |
| 65 | 69 | * reference them via the current ARM_FP register. |
| 70 | + * | |
| 71 | + * Some eBPF operations are implemented via a call to a helper function. | |
| 72 | + * Such calls are "invisible" in the eBPF code, so it is up to the calling | |
| 73 | + * program to preserve any caller-saved ARM registers during the call. The | |
| 74 | + * JIT emits code to push and pop those registers onto the stack, immediately | |
| 75 | + * above the callee stack frame. | |
| 66 | 76 | */ |
| 67 | 77 | #define CALLEE_MASK (1 << ARM_R4 | 1 << ARM_R5 | 1 << ARM_R6 | \ |
| 68 | 78 | 1 << ARM_R7 | 1 << ARM_R8 | 1 << ARM_R9 | \ |
| @@ -70,6 +80,8 @@ · 1 unmodified line | ||
| 70 | 80 | #define CALLEE_PUSH_MASK (CALLEE_MASK | 1 << ARM_LR) |
| 71 | 81 | #define CALLEE_POP_MASK (CALLEE_MASK | 1 << ARM_PC) |
| 72 | 82 | |
| 83 | +#define CALLER_MASK (1 << ARM_R0 | 1 << ARM_R1 | 1 << ARM_R2 | 1 << ARM_R3) | |
| 84 | + | |
| 73 | 85 | enum { |
| 74 | 86 | /* Stack layout - these are offsets from (top of stack - 4) */ |
| 75 | 87 | BPF_R2_HI, |
| @@ -464,6 +476,7 @@ static inline int epilogue_offset(const struct jit_ctx *ctx) · 388 unmodified lines | ||
| 464 | 476 | |
| 465 | 477 | static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op) |
| 466 | 478 | { |
| 479 | + const int exclude_mask = BIT(ARM_R0) | BIT(ARM_R1); | |
| 467 | 480 | const s8 *tmp = bpf2a32[TMP_REG_1]; |
| 468 | 481 | |
| 469 | 482 | #if __LINUX_ARM_ARCH__ == 7 |
| @@ -495,11 +508,17 @@ static inline void emit_udivmod(u8 rd, u8 rm, u8 rn, struct jit_ctx *ctx, u8 op) · 25 unmodified lines | ||
| 495 | 508 | emit(ARM_MOV_R(ARM_R0, rm), ctx); |
| 496 | 509 | } |
| 497 | 510 | |
| 511 | + /* Push caller-saved registers on stack */ | |
| 512 | + emit(ARM_PUSH(CALLER_MASK & ~exclude_mask), ctx); | |
| 513 | + | |
| 498 | 514 | /* Call appropriate function */ |
| 499 | 515 | emit_mov_i(ARM_IP, op == BPF_DIV ? |
| 500 | 516 | (u32)jit_udiv32 : (u32)jit_mod32, ctx); |
| 501 | 517 | emit_blx_r(ARM_IP, ctx); |
| 502 | 518 | |
| 519 | + /* Restore caller-saved registers from stack */ | |
| 520 | + emit(ARM_POP(CALLER_MASK & ~exclude_mask), ctx); | |
| 521 | + | |
| 503 | 522 | /* Save return value */ |
| 504 | 523 | if (rd != ARM_R0) |
| 505 | 524 | emit(ARM_MOV_R(rd, ARM_R0), ctx); |
| @@ -115,7 +115,6 @@ · 114 unmodified lines | ||
| 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 | |
| @@ -192,32 +192,9 @@ · 191 unmodified lines | ||
| 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>, |
| @@ -27,8 +27,6 @@ · 26 unmodified lines | ||
| 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"; |
| @@ -804,16 +802,6 @@ · 769 unmodified lines | ||
| 804 | 802 | }; |
| 805 | 803 | |
| 806 | 804 | bus@8000000 { |
| 807 | − compatible = "simple-bus"; | |
| 808 | − #address-cells = <2>; | |
| 809 | − #size-cells = <1>; | |
| 810 | − ranges = <0 0 0 0x08000000 0x04000000>, | |
| 811 | − <1 0 0 0x14000000 0x04000000>, | |
| 812 | − <2 0 0 0x18000000 0x04000000>, | |
| 813 | − <3 0 0 0x1c000000 0x04000000>, | |
| 814 | − <4 0 0 0x0c000000 0x04000000>, | |
| 815 | − <5 0 0 0x10000000 0x04000000>; | |
| 816 | − | |
| 817 | 805 | #interrupt-cells = <1>; |
| 818 | 806 | interrupt-map-mask = <0 0 15>; |
| 819 | 807 | interrupt-map = <0 0 0 &gic 0 GIC_SPI 68 IRQ_TYPE_LEVEL_HIGH>, |
| @@ -92,16 +92,23 @@ · 91 unmodified lines | ||
| 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 */ |
| @@ -218,7 +225,7 @@ · 110 unmodified lines | ||
| 218 | 225 | }; |
| 219 | 226 | }; |
| 220 | 227 | |
| 221 | − mmci@50000 { | |
| 228 | + mmc@50000 { | |
| 222 | 229 | compatible = "arm,pl180", "arm,primecell"; |
| 223 | 230 | reg = <0x050000 0x1000>; |
| 224 | 231 | interrupts = <5>; |
| @@ -246,7 +253,7 @@ · 21 unmodified lines | ||
| 246 | 253 | clock-names = "KMIREFCLK", "apb_pclk"; |
| 247 | 254 | }; |
| 248 | 255 | |
| 249 | − wdt@f0000 { | |
| 256 | + watchdog@f0000 { | |
| 250 | 257 | compatible = "arm,sp805", "arm,primecell"; |
| 251 | 258 | reg = <0x0f0000 0x10000>; |
| 252 | 259 | interrupts = <7>; |
| @@ -133,17 +133,6 @@ · 132 unmodified lines | ||
| 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>, |
| @@ -6,7 +6,7 @@ · 5 unmodified lines | ||
| 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 { |
| @@ -77,13 +77,21 @@ · 76 unmodified lines | ||
| 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"; |
| @@ -130,7 +138,7 @@ · 40 unmodified lines | ||
| 130 | 138 | clock-names = "apb_pclk"; |
| 131 | 139 | }; |
| 132 | 140 | |
| 133 | − mmci@50000 { | |
| 141 | + mmc@50000 { | |
| 134 | 142 | compatible = "arm,pl180", "arm,primecell"; |
| 135 | 143 | reg = <0x050000 0x1000>; |
| 136 | 144 | interrupts = <9>, <10>; |
| @@ -190,7 +198,7 @@ · 53 unmodified lines | ||
| 190 | 198 | clock-names = "uartclk", "apb_pclk"; |
| 191 | 199 | }; |
| 192 | 200 | |
| 193 | − wdt@f0000 { | |
| 201 | + watchdog@f0000 { | |
| 194 | 202 | compatible = "arm,sp805", "arm,primecell"; |
| 195 | 203 | reg = <0x0f0000 0x1000>; |
| 196 | 204 | interrupts = <0>; |
| @@ -145,61 +145,6 @@ · 144 unmodified lines | ||
| 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 | }; |
| @@ -405,9 +405,9 @@ · 404 unmodified lines | ||
| 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"; |
| @@ -91,7 +91,7 @@ · 90 unmodified lines | ||
| 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 | }; |
| @@ -48,7 +48,7 @@ · 47 unmodified lines | ||
| 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 | }; |
| @@ -102,6 +102,7 @@ · 101 unmodified lines | ||
| 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>; |
| @@ -647,7 +647,7 @@ · 646 unmodified lines | ||
| 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 */ |
| @@ -101,7 +101,7 @@ · 100 unmodified lines | ||
| 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 | }; |
| @@ -633,7 +633,7 @@ · 632 unmodified lines | ||
| 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 */ |
| @@ -74,7 +74,7 @@ · 73 unmodified lines | ||
| 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 | }; |
| @@ -337,6 +337,8 @@ · 336 unmodified lines | ||
| 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 | |
| @@ -281,7 +281,7 @@ · 280 unmodified lines | ||
| 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>; |
| @@ -48,8 +48,10 @@ · 47 unmodified lines | ||
| 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"; |
| @@ -804,6 +804,16 @@ · 803 unmodified lines | ||
| 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 | }; |
| @@ -273,7 +273,6 @@ · 272 unmodified lines | ||
| 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 | |
| @@ -301,11 +300,11 @@ · 21 unmodified lines | ||
| 301 | 300 | }; |
| 302 | 301 | }; |
| 303 | 302 | |
| 304 | − dai-link@2 { | |
| 303 | + dai-link@5 { | |
| 305 | 304 | link-name = "MultiMedia2"; |
| 306 | − reg = <2>; | |
| 305 | + reg = <LPASS_DP_RX>; | |
| 307 | 306 | cpu { |
| 308 | − sound-dai = <&lpass_cpu 2>; | |
| 307 | + sound-dai = <&lpass_cpu LPASS_DP_RX>; | |
| 309 | 308 | }; |
| 310 | 309 | |
| 311 | 310 | codec { |
| @@ -782,7 +781,7 @@ hp_i2c: &i2c9 { · 470 unmodified lines | ||
| 782 | 781 | qcom,playback-sd-lines = <0>; |
| 783 | 782 | }; |
| 784 | 783 | |
| 785 | − hdmi-primary@0 { | |
| 784 | + hdmi@5 { | |
| 786 | 785 | reg = <LPASS_DP_RX>; |
| 787 | 786 | }; |
| 788 | 787 | }; |
| @@ -1850,9 +1850,9 @@ · 1849 unmodified lines | ||
| 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>; |
| @@ -654,9 +654,20 @@ · 653 unmodified lines | ||
| 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 { |
| @@ -128,23 +128,28 @@ · 127 unmodified lines | ||
| 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 | |
| @@ -16,6 +16,17 @@ · 15 unmodified lines | ||
| 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"; |
| @@ -58,6 +69,29 @@ · 36 unmodified lines | ||
| 58 | 69 | }; |
| 59 | 70 | }; |
| 60 | 71 | |
| 72 | + /* Reserved memory changes for IPA */ | |
| 73 | + reserved-memory { | |
| 74 | + wlan_msa_mem: memory@8c400000 { | |
| 75 | + reg = <0 0x8c400000 0 0x100000>; | |
| 76 | + no-map; | |
| 77 | + }; | |
| 78 | + | |
| 79 | + gpu_mem: memory@8c515000 { | |
| 80 | + reg = <0 0x8c515000 0 0x2000>; | |
| 81 | + no-map; | |
| 82 | + }; | |
| 83 | + | |
| 84 | + ipa_fw_mem: memory@8c517000 { | |
| 85 | + reg = <0 0x8c517000 0 0x5a000>; | |
| 86 | + no-map; | |
| 87 | + }; | |
| 88 | + | |
| 89 | + adsp_mem: memory@8c600000 { | |
| 90 | + reg = <0 0x8c600000 0 0x1a00000>; | |
| 91 | + no-map; | |
| 92 | + }; | |
| 93 | + }; | |
| 94 | + | |
| 61 | 95 | sn65dsi86_refclk: sn65dsi86-refclk { |
| 62 | 96 | compatible = "fixed-clock"; |
| 63 | 97 | #clock-cells = <0>; |
| @@ -10,8 +10,6 @@ · 9 unmodified lines | ||
| 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 | |
| @@ -167,30 +165,11 @@ static inline uint64_t mips_cps_cluster_config(unsigned int cluster) · 149 unmodified lines | ||
| 167 | 165 | */ |
| 168 | 166 | static inline unsigned int mips_cps_numcores(unsigned int cluster) |
| 169 | 167 | { |
| 170 | − unsigned int ncores; | |
| 171 | − | |
| 172 | 168 | if (!mips_cm_present()) |
| 173 | 169 | return 0; |
| 174 | 170 | |
| 175 | 171 | /* Add one before masking to handle 0xff indicating no cores */ |
| 176 | − ncores = (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES; | |
| 177 | − | |
| 178 | − if (IS_ENABLED(CONFIG_SOC_MT7621)) { | |
| 179 | − struct cpulaunch *launch; | |
| 180 | − | |
| 181 | − /* | |
| 182 | − * Ralink MT7621S SoC is single core, but the GCR_CONFIG method | |
| 183 | − * always reports 2 cores. Check the second core's LAUNCH_FREADY | |
| 184 | − * flag to detect if the second core is missing. This method | |
| 185 | − * only works before the core has been started. | |
| 186 | − */ | |
| 187 | − launch = (struct cpulaunch *)CKSEG0ADDR(CPULAUNCH); | |
| 188 | − launch += 2; /* MT7621 has 2 VPEs per core */ | |
| 189 | − if (!(launch->flags & LAUNCH_FREADY)) | |
| 190 | − ncores = 1; | |
| 191 | − } | |
| 192 | − | |
| 193 | − return ncores; | |
| 172 | + return (mips_cps_cluster_config(cluster) + 1) & CM_GCR_CONFIG_PCORES; | |
| 194 | 173 | } |
| 195 | 174 | |
| 196 | 175 | /** |
| @@ -154,7 +154,7 @@ · 153 unmodified lines | ||
| 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 | |
| @@ -2465,6 +2465,7 @@ static int x86_pmu_event_init(struct perf_event *event) · 2464 unmodified lines | ||
| 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) && |
| @@ -263,6 +263,7 @@ static struct event_constraint intel_icl_event_constraints[] = { · 262 unmodified lines | ||
| 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 | }; |
| @@ -122,17 +122,27 @@ static bool __send_ipi_mask_ex(const struct cpumask *mask, int vector, · 121 unmodified lines | ||
| 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); |
| @@ -2,6 +2,20 @@ · 1 unmodified line | ||
| 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; |
| 6 | 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 | +} | |
| 20 | + | |
| 7 | 21 | #endif /* _ASM_X86_KVM_CLOCK_H */ |
| @@ -49,18 +49,9 @@ early_param("no-kvmclock-vsyscall", parse_no_kvmclock_vsyscall); · 48 unmodified lines | ||
| 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 |
| @@ -65,8 +65,8 @@ static inline struct kvm_cpuid_entry2 *cpuid_entry2_find( · 64 unmodified lines | ||
| 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 | |
| @@ -435,7 +435,6 @@ static int fastop(struct x86_emulate_ctxt *ctxt, fastop_t fop); · 434 unmodified lines | ||
| 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 | |
| @@ -6848,7 +6848,7 @@ static int vmx_create_vcpu(struct kvm_vcpu *vcpu) · 6847 unmodified lines | ||
| 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); |
| @@ -2662,15 +2662,6 @@ bfq_setup_merge(struct bfq_queue *bfqq, struct bfq_queue *new_bfqq) · 2661 unmodified lines | ||
| 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 | } |
| @@ -2733,10 +2724,6 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, · 56 unmodified lines | ||
| 2733 | 2724 | { |
| 2734 | 2725 | struct bfq_queue *in_service_bfqq, *new_bfqq; |
| 2735 | 2726 | |
| 2736 | − /* if a merge has already been setup, then proceed with that first */ | |
| 2737 | − if (bfqq->new_bfqq) | |
| 2738 | − return bfqq->new_bfqq; | |
| 2739 | − | |
| 2740 | 2727 | /* |
| 2741 | 2728 | * Check delayed stable merge for rotational or non-queueing |
| 2742 | 2729 | * devs. For this branch to be executed, bfqq must not be |
| @@ -2838,6 +2825,9 @@ bfq_setup_cooperator(struct bfq_data *bfqd, struct bfq_queue *bfqq, · 95 unmodified lines | ||
| 2838 | 2825 | if (bfq_too_late_for_merging(bfqq)) |
| 2839 | 2826 | return NULL; |
| 2840 | 2827 | |
| 2828 | + if (bfqq->new_bfqq) | |
| 2829 | + return bfqq->new_bfqq; | |
| 2830 | + | |
| 2841 | 2831 | if (!io_struct || unlikely(bfqq == &bfqd->oom_bfqq)) |
| 2842 | 2832 | return NULL; |
| 2843 | 2833 | |
| @@ -3007,6 +3007,18 @@ static int acpi_nfit_register_region(struct acpi_nfit_desc *acpi_desc, · 3006 unmodified lines | ||
| 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 |
| @@ -95,12 +95,29 @@ int fwnode_link_add(struct fwnode_handle *con, struct fwnode_handle *sup) · 94 unmodified lines | ||
| 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; |
| 102 | 104 | } |
| 103 | 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); | |
| 119 | +} | |
| 120 | + | |
| 104 | 121 | /** |
| 105 | 122 | * fwnode_links_purge_suppliers - Delete all supplier links of fwnode_handle. |
| 106 | 123 | * @fwnode: fwnode whose supplier links need to be deleted |
| @@ -112,11 +129,8 @@ static void fwnode_links_purge_suppliers(struct fwnode_handle *fwnode) · 5 unmodified lines | ||
| 112 | 129 | struct fwnode_link *link, *tmp; |
| 113 | 130 | |
| 114 | 131 | mutex_lock(&fwnode_link_lock); |
| 115 | − list_for_each_entry_safe(link, tmp, &fwnode->suppliers, c_hook) { | |
| 116 | − list_del(&link->s_hook); | |
| 117 | − list_del(&link->c_hook); | |
| 118 | − kfree(link); | |
| 119 | − } | |
| 132 | + list_for_each_entry_safe(link, tmp, &fwnode->suppliers, c_hook) | |
| 133 | + __fwnode_link_del(link); | |
| 120 | 134 | mutex_unlock(&fwnode_link_lock); |
| 121 | 135 | } |
| 122 | 136 | |
| @@ -131,11 +145,8 @@ static void fwnode_links_purge_consumers(struct fwnode_handle *fwnode) · 8 unmodified lines | ||
| 131 | 145 | struct fwnode_link *link, *tmp; |
| 132 | 146 | |
| 133 | 147 | mutex_lock(&fwnode_link_lock); |
| 134 | − list_for_each_entry_safe(link, tmp, &fwnode->consumers, s_hook) { | |
| 135 | − list_del(&link->s_hook); | |
| 136 | − list_del(&link->c_hook); | |
| 137 | − kfree(link); | |
| 138 | − } | |
| 148 | + list_for_each_entry_safe(link, tmp, &fwnode->consumers, s_hook) | |
| 149 | + __fwnode_link_del(link); | |
| 139 | 150 | mutex_unlock(&fwnode_link_lock); |
| 140 | 151 | } |
| 141 | 152 | |
| @@ -975,6 +986,7 @@ int device_links_check_suppliers(struct device *dev) · 833 unmodified lines | ||
| 975 | 986 | { |
| 976 | 987 | struct device_link *link; |
| 977 | 988 | int ret = 0; |
| 989 | + struct fwnode_handle *sup_fw; | |
| 978 | 990 | |
| 979 | 991 | /* |
| 980 | 992 | * Device waiting for supplier to become available is not allowed to |
| @@ -983,10 +995,11 @@ int device_links_check_suppliers(struct device *dev) · 2 unmodified lines | ||
| 983 | 995 | mutex_lock(&fwnode_link_lock); |
| 984 | 996 | if (dev->fwnode && !list_empty(&dev->fwnode->suppliers) && |
| 985 | 997 | !fw_devlink_is_permissive()) { |
| 986 | − dev_dbg(dev, "probe deferral - wait for supplier %pfwP\n", | |
| 987 | − list_first_entry(&dev->fwnode->suppliers, | |
| 988 | − struct fwnode_link, | |
| 989 | − c_hook)->supplier); | |
| 998 | + sup_fw = list_first_entry(&dev->fwnode->suppliers, | |
| 999 | + struct fwnode_link, | |
| 1000 | + c_hook)->supplier; | |
| 1001 | + dev_err_probe(dev, -EPROBE_DEFER, "wait for supplier %pfwP\n", | |
| 1002 | + sup_fw); | |
| 990 | 1003 | mutex_unlock(&fwnode_link_lock); |
| 991 | 1004 | return -EPROBE_DEFER; |
| 992 | 1005 | } |
| @@ -1001,8 +1014,9 @@ int device_links_check_suppliers(struct device *dev) · 8 unmodified lines | ||
| 1001 | 1014 | if (link->status != DL_STATE_AVAILABLE && |
| 1002 | 1015 | !(link->flags & DL_FLAG_SYNC_STATE_ONLY)) { |
| 1003 | 1016 | device_links_missing_supplier(dev); |
| 1004 | − dev_dbg(dev, "probe deferral - supplier %s not ready\n", | |
| 1005 | − dev_name(link->supplier)); | |
| 1017 | + dev_err_probe(dev, -EPROBE_DEFER, | |
| 1018 | + "supplier %s not ready\n", | |
| 1019 | + dev_name(link->supplier)); | |
| 1006 | 1020 | ret = -EPROBE_DEFER; |
| 1007 | 1021 | break; |
| 1008 | 1022 | } |
| @@ -1722,6 +1736,25 @@ static int fw_devlink_create_devlink(struct device *con, · 713 unmodified lines | ||
| 1722 | 1736 | struct device *sup_dev; |
| 1723 | 1737 | int ret = 0; |
| 1724 | 1738 | |
| 1739 | + /* | |
| 1740 | + * In some cases, a device P might also be a supplier to its child node | |
| 1741 | + * C. However, this would defer the probe of C until the probe of P | |
| 1742 | + * completes successfully. This is perfectly fine in the device driver | |
| 1743 | + * model. device_add() doesn't guarantee probe completion of the device | |
| 1744 | + * by the time it returns. | |
| 1745 | + * | |
| 1746 | + * However, there are a few drivers that assume C will finish probing | |
| 1747 | + * as soon as it's added and before P finishes probing. So, we provide | |
| 1748 | + * a flag to let fw_devlink know not to delay the probe of C until the | |
| 1749 | + * probe of P completes successfully. | |
| 1750 | + * | |
| 1751 | + * When such a flag is set, we can't create device links where P is the | |
| 1752 | + * supplier of C as that would delay the probe of C. | |
| 1753 | + */ | |
| 1754 | + if (sup_handle->flags & FWNODE_FLAG_NEEDS_CHILD_BOUND_ON_ADD && | |
| 1755 | + fwnode_is_ancestor_of(sup_handle, con->fwnode)) | |
| 1756 | + return -EINVAL; | |
| 1757 | + | |
| 1725 | 1758 | sup_dev = get_dev_from_fwnode(sup_handle); |
| 1726 | 1759 | if (sup_dev) { |
| 1727 | 1760 | /* |
| @@ -1772,14 +1805,21 @@ static int fw_devlink_create_devlink(struct device *con, · 44 unmodified lines | ||
| 1772 | 1805 | * be broken by applying logic. Check for these types of cycles and |
| 1773 | 1806 | * break them so that devices in the cycle probe properly. |
| 1774 | 1807 | * |
| 1775 | − * If the supplier's parent is dependent on the consumer, then | |
| 1776 | − * the consumer-supplier dependency is a false dependency. So, | |
| 1777 | − * treat it as an invalid link. | |
| 1808 | + * If the supplier's parent is dependent on the consumer, then the | |
| 1809 | + * consumer and supplier have a cyclic dependency. Since fw_devlink | |
| 1810 | + * can't tell which of the inferred dependencies are incorrect, don't | |
| 1811 | + * enforce probe ordering between any of the devices in this cyclic | |
| 1812 | + * dependency. Do this by relaxing all the fw_devlink device links in | |
| 1813 | + * this cycle and by treating the fwnode link between the consumer and | |
| 1814 | + * the supplier as an invalid dependency. | |
| 1778 | 1815 | */ |
| 1779 | 1816 | sup_dev = fwnode_get_next_parent_dev(sup_handle); |
| 1780 | 1817 | if (sup_dev && device_is_dependent(con, sup_dev)) { |
| 1781 | − dev_dbg(con, "Not linking to %pfwP - False link\n", | |
| 1782 | − sup_handle); | |
| 1818 | + dev_info(con, "Fixing up cyclic dependency with %pfwP (%s)\n", | |
| 1819 | + sup_handle, dev_name(sup_dev)); | |
| 1820 | + device_links_write_lock(); | |
| 1821 | + fw_devlink_relax_cycle(con, sup_dev); | |
| 1822 | + device_links_write_unlock(); | |
| 1783 | 1823 | ret = -EINVAL; |
| 1784 | 1824 | } else { |
| 1785 | 1825 | /* |
| @@ -1858,9 +1898,7 @@ static void __fw_devlink_link_to_consumers(struct device *dev) · 72 unmodified lines | ||
| 1858 | 1898 | if (!own_link || ret == -EAGAIN) |
| 1859 | 1899 | continue; |
| 1860 | 1900 | |
| 1861 | − list_del(&link->s_hook); | |
| 1862 | − list_del(&link->c_hook); | |
| 1863 | − kfree(link); | |
| 1901 | + __fwnode_link_del(link); | |
| 1864 | 1902 | } |
| 1865 | 1903 | } |
| 1866 | 1904 | |
| @@ -1912,9 +1950,7 @@ static void __fw_devlink_link_to_suppliers(struct device *dev, · 45 unmodified lines | ||
| 1912 | 1950 | if (!own_link || ret == -EAGAIN) |
| 1913 | 1951 | continue; |
| 1914 | 1952 | |
| 1915 | − list_del(&link->s_hook); | |
| 1916 | − list_del(&link->c_hook); | |
| 1917 | − kfree(link); | |
| 1953 | + __fwnode_link_del(link); | |
| 1918 | 1954 | |
| 1919 | 1955 | /* If no device link was created, nothing more to do. */ |
| 1920 | 1956 | if (ret) |
| @@ -97,13 +97,18 @@ struct nbd_config { · 96 unmodified lines | ||
| 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 | 106 | |
| 107 | +static inline unsigned int nbd_blksize(struct nbd_config *config) | |
| 108 | +{ | |
| 109 | + return 1u << config->blksize_bits; | |
| 110 | +} | |
| 111 | + | |
| 107 | 112 | struct nbd_device { |
| 108 | 113 | struct blk_mq_tag_set tag_set; |
| 109 | 114 | |
| @@ -146,7 +151,7 @@ static struct dentry *nbd_dbg_dir; · 36 unmodified lines | ||
| 146 | 151 | |
| 147 | 152 | #define NBD_MAGIC 0x68797548 |
| 148 | 153 | |
| 149 | −#define NBD_DEF_BLKSIZE 1024 | |
| 154 | +#define NBD_DEF_BLKSIZE_BITS 10 | |
| 150 | 155 | |
| 151 | 156 | static unsigned int nbds_max = 16; |
| 152 | 157 | static int max_part = 16; |
| @@ -317,12 +322,12 @@ static int nbd_set_size(struct nbd_device *nbd, loff_t bytesize, · 164 unmodified lines | ||
| 317 | 322 | loff_t blksize) |
| 318 | 323 | { |
| 319 | 324 | if (!blksize) |
| 320 | − blksize = NBD_DEF_BLKSIZE; | |
| 325 | + blksize = 1u << NBD_DEF_BLKSIZE_BITS; | |
| 321 | 326 | if (blksize < 512 || blksize > PAGE_SIZE || !is_power_of_2(blksize)) |
| 322 | 327 | return -EINVAL; |
| 323 | 328 | |
| 324 | 329 | nbd->config->bytesize = bytesize; |
| 325 | − nbd->config->blksize = blksize; | |
| 330 | + nbd->config->blksize_bits = __ffs(blksize); | |
| 326 | 331 | |
| 327 | 332 | if (!nbd->task_recv) |
| 328 | 333 | return 0; |
| @@ -1337,7 +1342,7 @@ static int nbd_start_device(struct nbd_device *nbd) · 1008 unmodified lines | ||
| 1337 | 1342 | args->index = i; |
| 1338 | 1343 | queue_work(nbd->recv_workq, &args->work); |
| 1339 | 1344 | } |
| 1340 | − return nbd_set_size(nbd, config->bytesize, config->blksize); | |
| 1345 | + return nbd_set_size(nbd, config->bytesize, nbd_blksize(config)); | |
| 1341 | 1346 | } |
| 1342 | 1347 | |
| 1343 | 1348 | static int nbd_start_device_ioctl(struct nbd_device *nbd, struct block_device *bdev) |
| @@ -1406,11 +1411,11 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd, · 62 unmodified lines | ||
| 1406 | 1411 | case NBD_SET_BLKSIZE: |
| 1407 | 1412 | return nbd_set_size(nbd, config->bytesize, arg); |
| 1408 | 1413 | case NBD_SET_SIZE: |
| 1409 | − return nbd_set_size(nbd, arg, config->blksize); | |
| 1414 | + return nbd_set_size(nbd, arg, nbd_blksize(config)); | |
| 1410 | 1415 | case NBD_SET_SIZE_BLOCKS: |
| 1411 | − if (check_mul_overflow((loff_t)arg, config->blksize, &bytesize)) | |
| 1416 | + if (check_shl_overflow(arg, config->blksize_bits, &bytesize)) | |
| 1412 | 1417 | return -EINVAL; |
| 1413 | − return nbd_set_size(nbd, bytesize, config->blksize); | |
| 1418 | + return nbd_set_size(nbd, bytesize, nbd_blksize(config)); | |
| 1414 | 1419 | case NBD_SET_TIMEOUT: |
| 1415 | 1420 | nbd_set_cmd_timeout(nbd, arg); |
| 1416 | 1421 | return 0; |
| @@ -1476,7 +1481,7 @@ static struct nbd_config *nbd_alloc_config(void) · 59 unmodified lines | ||
| 1476 | 1481 | atomic_set(&config->recv_threads, 0); |
| 1477 | 1482 | init_waitqueue_head(&config->recv_wq); |
| 1478 | 1483 | init_waitqueue_head(&config->conn_wait); |
| 1479 | − config->blksize = NBD_DEF_BLKSIZE; | |
| 1484 | + config->blksize_bits = NBD_DEF_BLKSIZE_BITS; | |
| 1480 | 1485 | atomic_set(&config->live_connections, 0); |
| 1481 | 1486 | try_module_get(THIS_MODULE); |
| 1482 | 1487 | return config; |
| @@ -1604,7 +1609,7 @@ static int nbd_dev_dbg_init(struct nbd_device *nbd) · 121 unmodified lines | ||
| 1604 | 1609 | debugfs_create_file("tasks", 0444, dir, nbd, &nbd_dbg_tasks_fops); |
| 1605 | 1610 | debugfs_create_u64("size_bytes", 0444, dir, &config->bytesize); |
| 1606 | 1611 | debugfs_create_u32("timeout", 0444, dir, &nbd->tag_set.timeout); |
| 1607 | − debugfs_create_u64("blocksize", 0444, dir, &config->blksize); | |
| 1612 | + debugfs_create_u32("blocksize_bits", 0444, dir, &config->blksize_bits); | |
| 1608 | 1613 | debugfs_create_file("flags", 0444, dir, nbd, &nbd_dbg_flags_fops); |
| 1609 | 1614 | |
| 1610 | 1615 | return 0; |
| @@ -1826,7 +1831,7 @@ nbd_device_policy[NBD_DEVICE_ATTR_MAX + 1] = { · 215 unmodified lines | ||
| 1826 | 1831 | static int nbd_genl_size_set(struct genl_info *info, struct nbd_device *nbd) |
| 1827 | 1832 | { |
| 1828 | 1833 | struct nbd_config *config = nbd->config; |
| 1829 | − u64 bsize = config->blksize; | |
| 1834 | + u64 bsize = nbd_blksize(config); | |
| 1830 | 1835 | u64 bytes = config->bytesize; |
| 1831 | 1836 | |
| 1832 | 1837 | if (info->attrs[NBD_ATTR_SIZE_BYTES]) |
| @@ -1835,7 +1840,7 @@ static int nbd_genl_size_set(struct genl_info *info, struct nbd_device *nbd) · 2 unmodified lines | ||
| 1835 | 1840 | if (info->attrs[NBD_ATTR_BLOCK_SIZE_BYTES]) |
| 1836 | 1841 | bsize = nla_get_u64(info->attrs[NBD_ATTR_BLOCK_SIZE_BYTES]); |
| 1837 | 1842 | |
| 1838 | − if (bytes != config->bytesize || bsize != config->blksize) | |
| 1843 | + if (bytes != config->bytesize || bsize != nbd_blksize(config)) | |
| 1839 | 1844 | return nbd_set_size(nbd, bytes, bsize); |
| 1840 | 1845 | return 0; |
| 1841 | 1846 | } |
| @@ -1464,6 +1464,9 @@ static const struct sysc_revision_quirk sysc_revision_quirks[] = { · 1463 unmodified lines | ||
| 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, |
| @@ -2954,6 +2957,7 @@ static int sysc_init_soc(struct sysc *ddata) · 1484 unmodified lines | ||
| 2954 | 2957 | break; |
| 2955 | 2958 | case SOC_AM3: |
| 2956 | 2959 | sysc_add_disabled(0x48310000); /* rng */ |
| 2960 | + break; | |
| 2957 | 2961 | default: |
| 2958 | 2962 | break; |
| 2959 | 2963 | } |
| @@ -204,7 +204,7 @@ config INTEL_STRATIX10_RSU · 203 unmodified lines | ||
| 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 | |
| @@ -68,7 +68,7 @@ config ARM_SCMI_TRANSPORT_SMC · 67 unmodified lines | ||
| 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 |
| @@ -110,18 +110,16 @@ static void scmi_finalize_message(struct scmi_vio_channel *vioch, · 109 unmodified lines | ||
| 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; |
| @@ -140,7 +138,8 @@ static void scmi_vio_complete_cb(struct virtqueue *vqueue) · 12 unmodified lines | ||
| 140 | 138 | goto unlock_ready_out; |
| 141 | 139 | } |
| 142 | 140 | |
| 143 | − spin_lock_irqsave(&vioch->lock, flags); | |
| 141 | + /* IRQs already disabled here no need to irqsave */ | |
| 142 | + spin_lock(&vioch->lock); | |
| 144 | 143 | if (cb_enabled) { |
| 145 | 144 | virtqueue_disable_cb(vqueue); |
| 146 | 145 | cb_enabled = false; |
| @@ -151,7 +150,7 @@ static void scmi_vio_complete_cb(struct virtqueue *vqueue) · 4 unmodified lines | ||
| 151 | 150 | goto unlock_out; |
| 152 | 151 | cb_enabled = true; |
| 153 | 152 | } |
| 154 | − spin_unlock_irqrestore(&vioch->lock, flags); | |
| 153 | + spin_unlock(&vioch->lock); | |
| 155 | 154 | |
| 156 | 155 | if (msg) { |
| 157 | 156 | msg->rx_len = length; |
| @@ -161,11 +160,18 @@ static void scmi_vio_complete_cb(struct virtqueue *vqueue) · 3 unmodified lines | ||
| 161 | 160 | scmi_finalize_message(vioch, msg); |
| 162 | 161 | } |
| 163 | 162 | |
| 163 | + /* | |
| 164 | + * Release ready_lock and re-enable IRQs between loop iterations | |
| 165 | + * to allow virtio_chan_free() to possibly kick in and set the | |
| 166 | + * flag vioch->ready to false even in between processing of | |
| 167 | + * messages, so as to force outstanding messages to be ignored | |
| 168 | + * when system is shutting down. | |
| 169 | + */ | |
| 164 | 170 | spin_unlock_irqrestore(&vioch->ready_lock, ready_flags); |
| 165 | 171 | } |
| 166 | 172 | |
| 167 | 173 | unlock_out: |
| 168 | − spin_unlock_irqrestore(&vioch->lock, flags); | |
| 174 | + spin_unlock(&vioch->lock); | |
| 169 | 175 | unlock_ready_out: |
| 170 | 176 | spin_unlock_irqrestore(&vioch->ready_lock, ready_flags); |
| 171 | 177 | } |
| @@ -384,8 +390,11 @@ static int scmi_vio_probe(struct virtio_device *vdev) · 212 unmodified lines | ||
| 384 | 390 | struct virtqueue *vqs[VIRTIO_SCMI_VQ_MAX_CNT]; |
| 385 | 391 | |
| 386 | 392 | /* Only one SCMI VirtiO device allowed */ |
| 387 | − if (scmi_vdev) | |
| 388 | − return -EINVAL; | |
| 393 | + if (scmi_vdev) { | |
| 394 | + dev_err(dev, | |
| 395 | + "One SCMI Virtio device was already initialized: only one allowed.\n"); | |
| 396 | + return -EBUSY; | |
| 397 | + } | |
| 389 | 398 | |
| 390 | 399 | have_vq_rx = scmi_vio_have_vq_rx(vdev); |
| 391 | 400 | vq_cnt = have_vq_rx ? VIRTIO_SCMI_VQ_MAX_CNT : 1; |
| @@ -428,16 +437,25 @@ static int scmi_vio_probe(struct virtio_device *vdev) · 36 unmodified lines | ||
| 428 | 437 | } |
| 429 | 438 | |
| 430 | 439 | vdev->priv = channels; |
| 431 | − scmi_vdev = vdev; | |
| 440 | + /* Ensure initialized scmi_vdev is visible */ | |
| 441 | + smp_store_mb(scmi_vdev, vdev); | |
| 432 | 442 | |
| 433 | 443 | return 0; |
| 434 | 444 | } |
| 435 | 445 | |
| 436 | 446 | static void scmi_vio_remove(struct virtio_device *vdev) |
| 437 | 447 | { |
| 448 | + /* | |
| 449 | + * Once we get here, virtio_chan_free() will have already been called by | |
| 450 | + * the SCMI core for any existing channel and, as a consequence, all the | |
| 451 | + * virtio channels will have been already marked NOT ready, causing any | |
| 452 | + * outstanding message on any vqueue to be ignored by complete_cb: now | |
| 453 | + * we can just stop processing buffers and destroy the vqueues. | |
| 454 | + */ | |
| 438 | 455 | vdev->config->reset(vdev); |
| 439 | 456 | vdev->config->del_vqs(vdev); |
| 440 | − scmi_vdev = NULL; | |
| 457 | + /* Ensure scmi_vdev is visible as NULL */ | |
| 458 | + smp_store_mb(scmi_vdev, NULL); | |
| 441 | 459 | } |
| 442 | 460 | |
| 443 | 461 | static int scmi_vio_validate(struct virtio_device *vdev) |
| @@ -476,7 +494,7 @@ static int __init virtio_scmi_init(void) · 32 unmodified lines | ||
| 476 | 494 | return register_virtio_driver(&virtio_scmi_driver); |
| 477 | 495 | } |
| 478 | 496 | |
| 479 | −static void __exit virtio_scmi_exit(void) | |
| 497 | +static void virtio_scmi_exit(void) | |
| 480 | 498 | { |
| 481 | 499 | unregister_virtio_driver(&virtio_scmi_driver); |
| 482 | 500 | } |
| @@ -837,6 +837,28 @@ static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb) · 836 unmodified lines | ||
| 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 | { |
| @@ -1103,6 +1125,7 @@ int amdgpu_display_framebuffer_init(struct drm_device *dev, · 260 unmodified lines | ||
| 1103 | 1125 | const struct drm_mode_fb_cmd2 *mode_cmd, |
| 1104 | 1126 | struct drm_gem_object *obj) |
| 1105 | 1127 | { |
| 1128 | + struct amdgpu_device *adev = drm_to_adev(dev); | |
| 1106 | 1129 | int ret, i; |
| 1107 | 1130 | |
| 1108 | 1131 | /* |
| @@ -1122,6 +1145,14 @@ int amdgpu_display_framebuffer_init(struct drm_device *dev, · 13 unmodified lines | ||
| 1122 | 1145 | if (ret) |
| 1123 | 1146 | return ret; |
| 1124 | 1147 | |
| 1148 | + if (!dev->mode_config.allow_fb_modifiers) { | |
| 1149 | + drm_WARN_ONCE(dev, adev->family >= AMDGPU_FAMILY_AI, | |
| 1150 | + "GFX9+ requires FB check based on format modifier\n"); | |
| 1151 | + ret = check_tiling_flags_gfx6(rfb); | |
| 1152 | + if (ret) | |
| 1153 | + return ret; | |
| 1154 | + } | |
| 1155 | + | |
| 1125 | 1156 | if (dev->mode_config.allow_fb_modifiers && |
| 1126 | 1157 | !(rfb->base.flags & DRM_MODE_FB_MODIFIERS)) { |
| 1127 | 1158 | ret = convert_tiling_flags_to_modifier(rfb); |
| @@ -3599,7 +3599,7 @@ static int gfx_v9_0_mqd_init(struct amdgpu_ring *ring) · 3598 unmodified lines | ||
| 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. |
| @@ -1098,6 +1098,8 @@ static int gmc_v10_0_hw_fini(void *handle) · 1097 unmodified lines | ||
| 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"); |
| @@ -1106,7 +1108,6 @@ static int gmc_v10_0_hw_fini(void *handle) · 2 unmodified lines | ||
| 1106 | 1108 | |
| 1107 | 1109 | amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0); |
| 1108 | 1110 | amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0); |
| 1109 | − gmc_v10_0_gart_disable(adev); | |
| 1110 | 1111 | |
| 1111 | 1112 | return 0; |
| 1112 | 1113 | } |
| @@ -1794,6 +1794,8 @@ static int gmc_v9_0_hw_fini(void *handle) · 1793 unmodified lines | ||
| 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"); |
| @@ -1802,7 +1804,6 @@ static int gmc_v9_0_hw_fini(void *handle) · 2 unmodified lines | ||
| 1802 | 1804 | |
| 1803 | 1805 | amdgpu_irq_put(adev, &adev->gmc.ecc_irq, 0); |
| 1804 | 1806 | amdgpu_irq_put(adev, &adev->gmc.vm_fault, 0); |
| 1805 | − gmc_v9_0_gart_disable(adev); | |
| 1806 | 1807 | |
| 1807 | 1808 | return 0; |
| 1808 | 1809 | } |
| @@ -868,6 +868,12 @@ static int sdma_v5_2_start(struct amdgpu_device *adev) · 867 unmodified lines | ||
| 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); |
| @@ -876,6 +882,8 @@ static int sdma_v5_2_start(struct amdgpu_device *adev) · 2 unmodified lines | ||
| 876 | 882 | |
| 877 | 883 | /* start the gfx rings and rlc compute queues */ |
| 878 | 884 | r = sdma_v5_2_gfx_resume(adev); |
| 885 | + if (adev->in_s0ix) | |
| 886 | + amdgpu_gfx_off_ctrl(adev, true); | |
| 879 | 887 | if (r) |
| 880 | 888 | return r; |
| 881 | 889 | r = sdma_v5_2_rlc_resume(adev); |
| @@ -1115,6 +1115,7 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 1114 unmodified lines | ||
| 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!!!! */ |
| @@ -1719,6 +1720,7 @@ static int dm_late_init(void *handle) · 598 unmodified lines | ||
| 1719 | 1720 | linear_lut[i] = 0xFFFF * i / 15; |
| 1720 | 1721 | |
| 1721 | 1722 | params.set = 0; |
| 1723 | + params.backlight_ramping_override = false; | |
| 1722 | 1724 | params.backlight_ramping_start = 0xCCCC; |
| 1723 | 1725 | params.backlight_ramping_reduction = 0xCCCCCCCC; |
| 1724 | 1726 | params.backlight_lut_array_size = 16; |
| @@ -1826,14 +1826,13 @@ bool perform_link_training_with_retries( · 1825 unmodified lines | ||
| 1826 | 1826 | if (panel_mode == DP_PANEL_MODE_EDP) { |
| 1827 | 1827 | struct cp_psp *cp_psp = &stream->ctx->cp_psp; |
| 1828 | 1828 | |
| 1829 | − if (cp_psp && cp_psp->funcs.enable_assr) { | |
| 1830 | − if (!cp_psp->funcs.enable_assr(cp_psp->handle, link)) { | |
| 1831 | − /* since eDP implies ASSR on, change panel | |
| 1832 | − * mode to disable ASSR | |
| 1833 | − */ | |
| 1834 | − panel_mode = DP_PANEL_MODE_DEFAULT; | |
| 1835 | − } | |
| 1836 | − } | |
| 1829 | + if (cp_psp && cp_psp->funcs.enable_assr) | |
| 1830 | + /* ASSR is bound to fail with unsigned PSP | |
| 1831 | + * verstage used during devlopment phase. | |
| 1832 | + * Report and continue with eDP panel mode to | |
| 1833 | + * perform eDP link training with right settings | |
| 1834 | + */ | |
| 1835 | + cp_psp->funcs.enable_assr(cp_psp->handle, link); | |
| 1837 | 1836 | } |
| 1838 | 1837 | #endif |
| 1839 | 1838 | |
| @@ -793,7 +793,6 @@ static int exynos5433_decon_probe(struct platform_device *pdev) · 792 unmodified lines | ||
| 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 | |
| @@ -818,8 +817,7 @@ static int exynos5433_decon_probe(struct platform_device *pdev) · 18 unmodified lines | ||
| 818 | 817 | ctx->clks[i] = clk; |
| 819 | 818 | } |
| 820 | 819 | |
| 821 | − res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | |
| 822 | − ctx->addr = devm_ioremap_resource(dev, res); | |
| 820 | + ctx->addr = devm_platform_ioremap_resource(pdev, 0); | |
| 823 | 821 | if (IS_ERR(ctx->addr)) |
| 824 | 822 | return PTR_ERR(ctx->addr); |
| 825 | 823 | |
| @@ -1738,7 +1738,6 @@ static const struct component_ops exynos_dsi_component_ops = { · 1737 unmodified lines | ||
| 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 | |
| @@ -1789,8 +1788,7 @@ static int exynos_dsi_probe(struct platform_device *pdev) · 44 unmodified lines | ||
| 1789 | 1788 | } |
| 1790 | 1789 | } |
| 1791 | 1790 | |
| 1792 | − res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | |
| 1793 | − dsi->reg_base = devm_ioremap_resource(dev, res); | |
| 1791 | + dsi->reg_base = devm_platform_ioremap_resource(pdev, 0); | |
| 1794 | 1792 | if (IS_ERR(dsi->reg_base)) |
| 1795 | 1793 | return PTR_ERR(dsi->reg_base); |
| 1796 | 1794 | |
| @@ -85,7 +85,6 @@ struct fimc_scaler { · 84 unmodified lines | ||
| 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. |
| @@ -103,7 +102,6 @@ struct fimc_context { · 11 unmodified lines | ||
| 103 | 102 | struct exynos_drm_ipp_formats *formats; |
| 104 | 103 | unsigned int num_formats; |
| 105 | 104 | |
| 106 | − struct resource *regs_res; | |
| 107 | 105 | void __iomem *regs; |
| 108 | 106 | spinlock_t lock; |
| 109 | 107 | struct clk *clocks[FIMC_CLKS_MAX]; |
| @@ -1327,8 +1325,7 @@ static int fimc_probe(struct platform_device *pdev) · 1217 unmodified lines | ||
| 1327 | 1325 | ctx->num_formats = num_formats; |
| 1328 | 1326 | |
| 1329 | 1327 | /* resource memory */ |
| 1330 | − ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | |
| 1331 | − ctx->regs = devm_ioremap_resource(dev, ctx->regs_res); | |
| 1328 | + ctx->regs = devm_platform_ioremap_resource(pdev, 0); | |
| 1332 | 1329 | if (IS_ERR(ctx->regs)) |
| 1333 | 1330 | return PTR_ERR(ctx->regs); |
| 1334 | 1331 | |
| @@ -1202,9 +1202,7 @@ static int fimd_probe(struct platform_device *pdev) · 1201 unmodified lines | ||
| 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 | |
| @@ -1449,7 +1449,6 @@ static const struct component_ops g2d_component_ops = { · 1448 unmodified lines | ||
| 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 | |
| @@ -1491,9 +1490,7 @@ static int g2d_probe(struct platform_device *pdev) · 35 unmodified lines | ||
| 1491 | 1490 | clear_bit(G2D_BIT_SUSPEND_RUNQUEUE, &g2d->flags); |
| 1492 | 1491 | clear_bit(G2D_BIT_ENGINE_BUSY, &g2d->flags); |
| 1493 | 1492 | |
| 1494 | − res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | |
| 1495 | − | |
| 1496 | − g2d->regs = devm_ioremap_resource(dev, res); | |
| 1493 | + g2d->regs = devm_platform_ioremap_resource(pdev, 0); | |
| 1497 | 1494 | if (IS_ERR(g2d->regs)) { |
| 1498 | 1495 | ret = PTR_ERR(g2d->regs); |
| 1499 | 1496 | goto err_put_clk; |
| @@ -86,7 +86,6 @@ struct gsc_scaler { · 85 unmodified lines | ||
| 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. |
| @@ -103,7 +102,6 @@ struct gsc_context { · 10 unmodified lines | ||
| 103 | 102 | struct exynos_drm_ipp_formats *formats; |
| 104 | 103 | unsigned int num_formats; |
| 105 | 104 | |
| 106 | − struct resource *regs_res; | |
| 107 | 105 | void __iomem *regs; |
| 108 | 106 | const char **clk_names; |
| 109 | 107 | struct clk *clocks[GSC_MAX_CLOCKS]; |
| @@ -1272,9 +1270,7 @@ static int gsc_probe(struct platform_device *pdev) · 1162 unmodified lines | ||
| 1272 | 1270 | } |
| 1273 | 1271 | } |
| 1274 | 1272 | |
| 1275 | − /* resource memory */ | |
| 1276 | − ctx->regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | |
| 1277 | − ctx->regs = devm_ioremap_resource(dev, ctx->regs_res); | |
| 1273 | + ctx->regs = devm_platform_ioremap_resource(pdev, 0); | |
| 1278 | 1274 | if (IS_ERR(ctx->regs)) |
| 1279 | 1275 | return PTR_ERR(ctx->regs); |
| 1280 | 1276 | |
| @@ -278,7 +278,6 @@ static const struct component_ops rotator_component_ops = { · 277 unmodified lines | ||
| 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; |
| @@ -292,8 +291,7 @@ static int rotator_probe(struct platform_device *pdev) · 7 unmodified lines | ||
| 292 | 291 | rot->formats = variant->formats; |
| 293 | 292 | rot->num_formats = variant->num_formats; |
| 294 | 293 | rot->dev = dev; |
| 295 | − regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | |
| 296 | − rot->regs = devm_ioremap_resource(dev, regs_res); | |
| 294 | + rot->regs = devm_platform_ioremap_resource(pdev, 0); | |
| 297 | 295 | if (IS_ERR(rot->regs)) |
| 298 | 296 | return PTR_ERR(rot->regs); |
| 299 | 297 | |
| @@ -485,7 +485,6 @@ static const struct component_ops scaler_component_ops = { · 484 unmodified lines | ||
| 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; |
| @@ -498,8 +497,7 @@ static int scaler_probe(struct platform_device *pdev) · 6 unmodified lines | ||
| 498 | 497 | (struct scaler_data *)of_device_get_match_data(dev); |
| 499 | 498 | |
| 500 | 499 | scaler->dev = dev; |
| 501 | − regs_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | |
| 502 | − scaler->regs = devm_ioremap_resource(dev, regs_res); | |
| 500 | + scaler->regs = devm_platform_ioremap_resource(pdev, 0); | |
| 503 | 501 | if (IS_ERR(scaler->regs)) |
| 504 | 502 | return PTR_ERR(scaler->regs); |
| 505 | 503 | |
| @@ -1957,7 +1957,6 @@ static int hdmi_probe(struct platform_device *pdev) · 1956 unmodified lines | ||
| 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); |
| @@ -1979,8 +1978,7 @@ static int hdmi_probe(struct platform_device *pdev) · 15 unmodified lines | ||
| 1979 | 1978 | return ret; |
| 1980 | 1979 | } |
| 1981 | 1980 | |
| 1982 | − res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | |
| 1983 | − hdata->regs = devm_ioremap_resource(dev, res); | |
| 1981 | + hdata->regs = devm_platform_ioremap_resource(pdev, 0); | |
| 1984 | 1982 | if (IS_ERR(hdata->regs)) { |
| 1985 | 1983 | ret = PTR_ERR(hdata->regs); |
| 1986 | 1984 | return ret; |
| @@ -362,8 +362,9 @@ static int __intel_context_active(struct i915_active *active) · 361 unmodified lines | ||
| 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 | } |
| @@ -882,8 +882,6 @@ void intel_rps_park(struct intel_rps *rps) · 881 unmodified lines | ||
| 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 | |
| @@ -102,11 +102,11 @@ static_assert(sizeof(struct guc_ct_buffer_desc) == 64); · 101 unmodified lines | ||
| 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 | |
| @@ -38,11 +38,11 @@ · 37 unmodified lines | ||
| 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 | |
| @@ -576,7 +576,7 @@ retry: · 575 unmodified lines | ||
| 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,7 +630,7 @@ retry: · 47 unmodified lines | ||
| 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 |
| @@ -829,8 +829,6 @@ static void __i915_request_ctor(void *arg) · 828 unmodified lines | ||
| 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); |
| @@ -905,17 +903,12 @@ __i915_request_create(struct intel_context *ce, gfp_t gfp) · 68 unmodified lines | ||
| 905 | 903 | rq->ring = ce->ring; |
| 906 | 904 | rq->execution_mask = ce->engine->mask; |
| 907 | 905 | |
| 908 | − kref_init(&rq->fence.refcount); | |
| 909 | − rq->fence.flags = 0; | |
| 910 | − rq->fence.error = 0; | |
| 911 | − INIT_LIST_HEAD(&rq->fence.cb_list); | |
| 912 | − | |
| 913 | 906 | ret = intel_timeline_get_seqno(tl, rq, &seqno); |
| 914 | 907 | if (ret) |
| 915 | 908 | goto err_free; |
| 916 | 909 | |
| 917 | − rq->fence.context = tl->fence_context; | |
| 918 | − rq->fence.seqno = seqno; | |
| 910 | + dma_fence_init(&rq->fence, &i915_fence_ops, &rq->lock, | |
| 911 | + tl->fence_context, seqno); | |
| 919 | 912 | |
| 920 | 913 | RCU_INIT_POINTER(rq->timeline, tl); |
| 921 | 914 | rq->hwsp_seqno = tl->hwsp_seqno; |
| @@ -1845,7 +1845,6 @@ tegra_crtc_update_memory_bandwidth(struct drm_crtc *crtc, · 1844 unmodified lines | ||
| 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; |
| @@ -1858,8 +1857,6 @@ tegra_crtc_update_memory_bandwidth(struct drm_crtc *crtc, · 6 unmodified lines | ||
| 1858 | 1857 | return; |
| 1859 | 1858 | |
| 1860 | 1859 | old_crtc_state = drm_atomic_get_old_crtc_state(state, crtc); |
| 1861 | − old_dc_state = to_const_dc_state(old_crtc_state); | |
| 1862 | − new_dc_state = to_const_dc_state(crtc->state); | |
| 1863 | 1860 | |
| 1864 | 1861 | if (!crtc->state->active) { |
| 1865 | 1862 | if (!old_crtc_state->active) |
| @@ -35,12 +35,6 @@ static inline struct tegra_dc_state *to_dc_state(struct drm_crtc_state *state) · 34 unmodified lines | ||
| 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; |
| @@ -222,7 +222,7 @@ int tegra_drm_ioctl_channel_map(struct drm_device *drm, void *data, struct drm_f · 221 unmodified lines | ||
| 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); |
| @@ -15,7 +15,7 @@ · 14 unmodified lines | ||
| 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,8 +152,10 @@ struct dma_fence *host1x_fence_create(struct host1x_syncpt *sp, u32 threshold) · 130 unmodified lines | ||
| 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; |
| @@ -362,12 +362,6 @@ static const struct hwmon_channel_info *k10temp_info[] = { · 361 unmodified lines | ||
| 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 | |
| @@ -989,8 +989,12 @@ static int ltc2947_setup(struct ltc2947_data *st) · 988 unmodified lines | ||
| 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; |
| @@ -315,8 +315,8 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, · 314 unmodified lines | ||
| 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,6 +329,12 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, · 6 unmodified lines | ||
| 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; |
| @@ -343,7 +349,7 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, · 8 unmodified lines | ||
| 343 | 349 | |
| 344 | 350 | cur_state = MLXREG_FAN_PWM_DUTY2STATE(regval); |
| 345 | 351 | if (state < cur_state) |
| 346 | − return 0; | |
| 352 | + return config; | |
| 347 | 353 | |
| 348 | 354 | state = cur_state; |
| 349 | 355 | } |
| @@ -359,7 +365,7 @@ static int mlxreg_fan_set_cur_state(struct thermal_cooling_device *cdev, · 9 unmodified lines | ||
| 359 | 365 | dev_err(fan->dev, "Failed to write PWM duty\n"); |
| 360 | 366 | return err; |
| 361 | 367 | } |
| 362 | − return 0; | |
| 368 | + return config; | |
| 363 | 369 | } |
| 364 | 370 | |
| 365 | 371 | static const struct thermal_cooling_device_ops mlxreg_fan_cooling_ops = { |
| @@ -340,18 +340,11 @@ static ssize_t occ_show_temp_10(struct device *dev, · 339 unmodified lines | ||
| 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; |
| @@ -886,7 +879,7 @@ static int occ_setup_sensor_attrs(struct occ *occ) · 528 unmodified lines | ||
| 886 | 879 | 0, i); |
| 887 | 880 | attr++; |
| 888 | 881 | |
| 889 | − if (sensors->temp.version > 1 && | |
| 882 | + if (sensors->temp.version == 2 && | |
| 890 | 883 | temp->fru_type == OCC_FRU_TYPE_VRM) { |
| 891 | 884 | snprintf(attr->name, sizeof(attr->name), |
| 892 | 885 | "temp%d_alarm", s); |
| @@ -171,8 +171,14 @@ static ssize_t ibm_cffps_debugfs_read(struct file *file, char __user *buf, · 170 unmodified lines | ||
| 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 | |
| @@ -54,7 +54,7 @@ · 53 unmodified lines | ||
| 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; |
| @@ -100,71 +100,81 @@ struct tmp421_data { · 99 unmodified lines | ||
| 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; | |
| 109 | −} | |
| 110 | − | |
| 111 | −static int temp_from_u16(u16 reg) | |
| 112 | −{ | |
| 113 | − /* Mask out status bits */ | |
| 114 | − int temp = reg & ~0xf; | |
| 115 | − | |
| 116 | − /* Add offset for extended temperature range. */ | |
| 117 | − temp -= 64 * 256; | |
| 108 | + if (extended) | |
| 109 | + temp = temp - 64 * 256; | |
| 110 | + else | |
| 111 | + temp = (s16)temp; | |
| 118 | 112 | |
| 119 | − return (temp * 1000 + 128) / 256; | |
| 113 | + return DIV_ROUND_CLOSEST(temp * 1000, 256); | |
| 120 | 114 | } |
| 121 | 115 | |
| 122 | −static struct tmp421_data *tmp421_update_device(struct device *dev) | |
| 116 | +static int tmp421_update_device(struct tmp421_data *data) | |
| 123 | 117 | { |
| 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; |
| @@ -177,9 +187,6 @@ static umode_t tmp421_is_visible(const void *data, enum hwmon_sensor_types type, · 6 unmodified lines | ||
| 177 | 187 | { |
| 178 | 188 | switch (attr) { |
| 179 | 189 | case hwmon_temp_fault: |
| 180 | − if (channel == 0) | |
| 181 | − return 0; | |
| 182 | − return 0444; | |
| 183 | 190 | case hwmon_temp_input: |
| 184 | 191 | return 0444; |
| 185 | 192 | default: |
| @@ -273,9 +273,6 @@ struct w83791d_data { · 272 unmodified lines | ||
| 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 */ |
| @@ -1257,7 +1254,6 @@ static const struct attribute_group w83791d_group_fanpwm45 = { · 975 unmodified lines | ||
| 1257 | 1254 | static int w83791d_detect_subclients(struct i2c_client *client) |
| 1258 | 1255 | { |
| 1259 | 1256 | struct i2c_adapter *adapter = client->adapter; |
| 1260 | − struct w83791d_data *data = i2c_get_clientdata(client); | |
| 1261 | 1257 | int address = client->addr; |
| 1262 | 1258 | int i, id; |
| 1263 | 1259 | u8 val; |
| @@ -1280,22 +1276,19 @@ static int w83791d_detect_subclients(struct i2c_client *client) · 16 unmodified lines | ||
| 1280 | 1276 | } |
| 1281 | 1277 | |
| 1282 | 1278 | val = w83791d_read(client, W83791D_REG_I2C_SUBADDR); |
| 1283 | − if (!(val & 0x08)) | |
| 1284 | − data->lm75[0] = devm_i2c_new_dummy_device(&client->dev, adapter, | |
| 1285 | − 0x48 + (val & 0x7)); | |
| 1286 | − if (!(val & 0x80)) { | |
| 1287 | − if (!IS_ERR(data->lm75[0]) && | |
| 1288 | − ((val & 0x7) == ((val >> 4) & 0x7))) { | |
| 1289 | − dev_err(&client->dev, | |
| 1290 | − "duplicate addresses 0x%x, " | |
| 1291 | − "use force_subclient\n", | |
| 1292 | − data->lm75[0]->addr); | |
| 1293 | − return -ENODEV; | |
| 1294 | − } | |
| 1295 | − data->lm75[1] = devm_i2c_new_dummy_device(&client->dev, adapter, | |
| 1296 | − 0x48 + ((val >> 4) & 0x7)); | |
| 1279 | + | |
| 1280 | + if (!(val & 0x88) && (val & 0x7) == ((val >> 4) & 0x7)) { | |
| 1281 | + dev_err(&client->dev, | |
| 1282 | + "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (val & 0x7)); | |
| 1283 | + return -ENODEV; | |
| 1297 | 1284 | } |
| 1298 | 1285 | |
| 1286 | + if (!(val & 0x08)) | |
| 1287 | + devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + (val & 0x7)); | |
| 1288 | + | |
| 1289 | + if (!(val & 0x80)) | |
| 1290 | + devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + ((val >> 4) & 0x7)); | |
| 1291 | + | |
| 1299 | 1292 | return 0; |
| 1300 | 1293 | } |
| 1301 | 1294 | |
| @@ -264,9 +264,6 @@ struct w83792d_data { · 263 unmodified lines | ||
| 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 */ |
| @@ -927,7 +924,6 @@ w83792d_detect_subclients(struct i2c_client *new_client) · 654 unmodified lines | ||
| 927 | 924 | int address = new_client->addr; |
| 928 | 925 | u8 val; |
| 929 | 926 | struct i2c_adapter *adapter = new_client->adapter; |
| 930 | − struct w83792d_data *data = i2c_get_clientdata(new_client); | |
| 931 | 927 | |
| 932 | 928 | id = i2c_adapter_id(adapter); |
| 933 | 929 | if (force_subclients[0] == id && force_subclients[1] == address) { |
| @@ -946,21 +942,19 @@ w83792d_detect_subclients(struct i2c_client *new_client) · 12 unmodified lines | ||
| 946 | 942 | } |
| 947 | 943 | |
| 948 | 944 | val = w83792d_read_value(new_client, W83792D_REG_I2C_SUBADDR); |
| 949 | − if (!(val & 0x08)) | |
| 950 | − data->lm75[0] = devm_i2c_new_dummy_device(&new_client->dev, adapter, | |
| 951 | − 0x48 + (val & 0x7)); | |
| 952 | − if (!(val & 0x80)) { | |
| 953 | − if (!IS_ERR(data->lm75[0]) && | |
| 954 | − ((val & 0x7) == ((val >> 4) & 0x7))) { | |
| 955 | − dev_err(&new_client->dev, | |
| 956 | − "duplicate addresses 0x%x, use force_subclient\n", | |
| 957 | − data->lm75[0]->addr); | |
| 958 | − return -ENODEV; | |
| 959 | − } | |
| 960 | − data->lm75[1] = devm_i2c_new_dummy_device(&new_client->dev, adapter, | |
| 961 | − 0x48 + ((val >> 4) & 0x7)); | |
| 945 | + | |
| 946 | + if (!(val & 0x88) && (val & 0x7) == ((val >> 4) & 0x7)) { | |
| 947 | + dev_err(&new_client->dev, | |
| 948 | + "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (val & 0x7)); | |
| 949 | + return -ENODEV; | |
| 962 | 950 | } |
| 963 | 951 | |
| 952 | + if (!(val & 0x08)) | |
| 953 | + devm_i2c_new_dummy_device(&new_client->dev, adapter, 0x48 + (val & 0x7)); | |
| 954 | + | |
| 955 | + if (!(val & 0x80)) | |
| 956 | + devm_i2c_new_dummy_device(&new_client->dev, adapter, 0x48 + ((val >> 4) & 0x7)); | |
| 957 | + | |
| 964 | 958 | return 0; |
| 965 | 959 | } |
| 966 | 960 | |
| @@ -202,7 +202,6 @@ static inline s8 TEMP_TO_REG(long val, s8 min, s8 max) · 201 unmodified lines | ||
| 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 */ |
| @@ -1566,7 +1565,6 @@ w83793_detect_subclients(struct i2c_client *client) · 1357 unmodified lines | ||
| 1566 | 1565 | int address = client->addr; |
| 1567 | 1566 | u8 tmp; |
| 1568 | 1567 | struct i2c_adapter *adapter = client->adapter; |
| 1569 | − struct w83793_data *data = i2c_get_clientdata(client); | |
| 1570 | 1568 | |
| 1571 | 1569 | id = i2c_adapter_id(adapter); |
| 1572 | 1570 | if (force_subclients[0] == id && force_subclients[1] == address) { |
| @@ -1586,21 +1584,19 @@ w83793_detect_subclients(struct i2c_client *client) · 13 unmodified lines | ||
| 1586 | 1584 | } |
| 1587 | 1585 | |
| 1588 | 1586 | tmp = w83793_read_value(client, W83793_REG_I2C_SUBADDR); |
| 1589 | − if (!(tmp & 0x08)) | |
| 1590 | − data->lm75[0] = devm_i2c_new_dummy_device(&client->dev, adapter, | |
| 1591 | − 0x48 + (tmp & 0x7)); | |
| 1592 | − if (!(tmp & 0x80)) { | |
| 1593 | − if (!IS_ERR(data->lm75[0]) | |
| 1594 | − && ((tmp & 0x7) == ((tmp >> 4) & 0x7))) { | |
| 1595 | − dev_err(&client->dev, | |
| 1596 | − "duplicate addresses 0x%x, " | |
| 1597 | − "use force_subclients\n", data->lm75[0]->addr); | |
| 1598 | − return -ENODEV; | |
| 1599 | − } | |
| 1600 | − data->lm75[1] = devm_i2c_new_dummy_device(&client->dev, adapter, | |
| 1601 | − 0x48 + ((tmp >> 4) & 0x7)); | |
| 1587 | + | |
| 1588 | + if (!(tmp & 0x88) && (tmp & 0x7) == ((tmp >> 4) & 0x7)) { | |
| 1589 | + dev_err(&client->dev, | |
| 1590 | + "duplicate addresses 0x%x, use force_subclient\n", 0x48 + (tmp & 0x7)); | |
| 1591 | + return -ENODEV; | |
| 1602 | 1592 | } |
| 1603 | 1593 | |
| 1594 | + if (!(tmp & 0x08)) | |
| 1595 | + devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + (tmp & 0x7)); | |
| 1596 | + | |
| 1597 | + if (!(tmp & 0x80)) | |
| 1598 | + devm_i2c_new_dummy_device(&client->dev, adapter, 0x48 + ((tmp >> 4) & 0x7)); | |
| 1599 | + | |
| 1604 | 1600 | return 0; |
| 1605 | 1601 | } |
| 1606 | 1602 | |
| @@ -44,9 +44,9 @@ · 43 unmodified lines | ||
| 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 |
| @@ -173,6 +173,16 @@ static const struct clk_bulk_data bus_mm_clocks[] = { · 120 unmodified lines | ||
| 173 | 173 | { .id = "iface" }, |
| 174 | 174 | }; |
| 175 | 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" }, | |
| 184 | +}; | |
| 185 | + | |
| 176 | 186 | /** |
| 177 | 187 | * struct qcom_icc_provider - Qualcomm specific interconnect provider |
| 178 | 188 | * @provider: generic interconnect provider |
| @@ -307,7 +317,7 @@ DEFINE_QNODE(slv_bimc_cfg, SDM660_SLAVE_BIMC_CFG, 4, -1, 56, true, -1, 0, -1, 0) · 128 unmodified lines | ||
| 307 | 317 | DEFINE_QNODE(slv_prng, SDM660_SLAVE_PRNG, 4, -1, 44, true, -1, 0, -1, 0); |
| 308 | 318 | DEFINE_QNODE(slv_spdm, SDM660_SLAVE_SPDM, 4, -1, 60, true, -1, 0, -1, 0); |
| 309 | 319 | DEFINE_QNODE(slv_qdss_cfg, SDM660_SLAVE_QDSS_CFG, 4, -1, 63, true, -1, 0, -1, 0); |
| 310 | −DEFINE_QNODE(slv_cnoc_mnoc_cfg, SDM660_SLAVE_BLSP_1, 4, -1, 66, true, -1, 0, -1, SDM660_MASTER_CNOC_MNOC_CFG); | |
| 320 | +DEFINE_QNODE(slv_cnoc_mnoc_cfg, SDM660_SLAVE_CNOC_MNOC_CFG, 4, -1, 66, true, -1, 0, -1, SDM660_MASTER_CNOC_MNOC_CFG); | |
| 311 | 321 | DEFINE_QNODE(slv_snoc_cfg, SDM660_SLAVE_SNOC_CFG, 4, -1, 70, true, -1, 0, -1, 0); |
| 312 | 322 | DEFINE_QNODE(slv_qm_cfg, SDM660_SLAVE_QM_CFG, 4, -1, 212, true, -1, 0, -1, 0); |
| 313 | 323 | DEFINE_QNODE(slv_clk_ctl, SDM660_SLAVE_CLK_CTL, 4, -1, 47, true, -1, 0, -1, 0); |
| @@ -624,13 +634,12 @@ static int qcom_icc_noc_set_qos_priority(struct regmap *rmap, · 310 unmodified lines | ||
| 624 | 634 | /* Must be updated one at a time, P1 first, P0 last */ |
| 625 | 635 | val = qos->areq_prio << NOC_QOS_PRIORITY_P1_SHIFT; |
| 626 | 636 | rc = regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port), |
| 627 | − NOC_QOS_PRIORITY_MASK, val); | |
| 637 | + NOC_QOS_PRIORITY_P1_MASK, val); | |
| 628 | 638 | if (rc) |
| 629 | 639 | return rc; |
| 630 | 640 | |
| 631 | − val = qos->prio_level << NOC_QOS_PRIORITY_P0_SHIFT; | |
| 632 | 641 | return regmap_update_bits(rmap, NOC_QOS_PRIORITYn_ADDR(qos->qos_port), |
| 633 | − NOC_QOS_PRIORITY_MASK, val); | |
| 642 | + NOC_QOS_PRIORITY_P0_MASK, qos->prio_level); | |
| 634 | 643 | } |
| 635 | 644 | |
| 636 | 645 | static int qcom_icc_set_noc_qos(struct icc_node *src, u64 max_bw) |
| @@ -810,6 +819,10 @@ static int qnoc_probe(struct platform_device *pdev) · 173 unmodified lines | ||
| 810 | 819 | qp->bus_clks = devm_kmemdup(dev, bus_mm_clocks, |
| 811 | 820 | sizeof(bus_mm_clocks), GFP_KERNEL); |
| 812 | 821 | qp->num_clks = ARRAY_SIZE(bus_mm_clocks); |
| 822 | + } else if (of_device_is_compatible(dev->of_node, "qcom,sdm660-a2noc")) { | |
| 823 | + qp->bus_clks = devm_kmemdup(dev, bus_a2noc_clocks, | |
| 824 | + sizeof(bus_a2noc_clocks), GFP_KERNEL); | |
| 825 | + qp->num_clks = ARRAY_SIZE(bus_a2noc_clocks); | |
| 813 | 826 | } else { |
| 814 | 827 | if (of_device_is_compatible(dev->of_node, "qcom,sdm660-bimc")) |
| 815 | 828 | qp->is_bimc_node = true; |
| @@ -183,7 +183,6 @@ struct apple_dart_master_cfg { · 182 unmodified lines | ||
| 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 | { |
| @@ -338,22 +337,6 @@ static void apple_dart_iotlb_sync_map(struct iommu_domain *domain, · 148 unmodified lines | ||
| 338 | 337 | apple_dart_domain_flush_tlb(to_dart_domain(domain)); |
| 339 | 338 | } |
| 340 | 339 | |
| 341 | −static void apple_dart_tlb_flush_all(void *cookie) | |
| 342 | −{ | |
| 343 | − apple_dart_domain_flush_tlb(cookie); | |
| 344 | −} | |
| 345 | − | |
| 346 | −static void apple_dart_tlb_flush_walk(unsigned long iova, size_t size, | |
| 347 | − size_t granule, void *cookie) | |
| 348 | −{ | |
| 349 | − apple_dart_domain_flush_tlb(cookie); | |
| 350 | −} | |
| 351 | − | |
| 352 | −static const struct iommu_flush_ops apple_dart_tlb_ops = { | |
| 353 | − .tlb_flush_all = apple_dart_tlb_flush_all, | |
| 354 | − .tlb_flush_walk = apple_dart_tlb_flush_walk, | |
| 355 | −}; | |
| 356 | − | |
| 357 | 340 | static phys_addr_t apple_dart_iova_to_phys(struct iommu_domain *domain, |
| 358 | 341 | dma_addr_t iova) |
| 359 | 342 | { |
| @@ -435,7 +418,6 @@ static int apple_dart_finalize_domain(struct iommu_domain *domain, · 75 unmodified lines | ||
| 435 | 418 | .ias = 32, |
| 436 | 419 | .oas = 36, |
| 437 | 420 | .coherent_walk = 1, |
| 438 | − .tlb = &apple_dart_tlb_ops, | |
| 439 | 421 | .iommu_dev = dart->dev, |
| 440 | 422 | }; |
| 441 | 423 | |
| @@ -661,16 +643,34 @@ static int apple_dart_of_xlate(struct device *dev, struct of_phandle_args *args) · 219 unmodified lines | ||
| 661 | 643 | return -EINVAL; |
| 662 | 644 | } |
| 663 | 645 | |
| 646 | +static DEFINE_MUTEX(apple_dart_groups_lock); | |
| 647 | + | |
| 648 | +static void apple_dart_release_group(void *iommu_data) | |
| 649 | +{ | |
| 650 | + int i, sid; | |
| 651 | + struct apple_dart_stream_map *stream_map; | |
| 652 | + struct apple_dart_master_cfg *group_master_cfg = iommu_data; | |
| 653 | + | |
| 654 | + mutex_lock(&apple_dart_groups_lock); | |
| 655 | + | |
| 656 | + for_each_stream_map(i, group_master_cfg, stream_map) | |
| 657 | + for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) | |
| 658 | + stream_map->dart->sid2group[sid] = NULL; | |
| 659 | + | |
| 660 | + kfree(iommu_data); | |
| 661 | + mutex_unlock(&apple_dart_groups_lock); | |
| 662 | +} | |
| 663 | + | |
| 664 | 664 | static struct iommu_group *apple_dart_device_group(struct device *dev) |
| 665 | 665 | { |
| 666 | − static DEFINE_MUTEX(lock); | |
| 667 | 666 | int i, sid; |
| 668 | 667 | struct apple_dart_master_cfg *cfg = dev_iommu_priv_get(dev); |
| 669 | 668 | struct apple_dart_stream_map *stream_map; |
| 669 | + struct apple_dart_master_cfg *group_master_cfg; | |
| 670 | 670 | struct iommu_group *group = NULL; |
| 671 | 671 | struct iommu_group *res = ERR_PTR(-EINVAL); |
| 672 | 672 | |
| 673 | − mutex_lock(&lock); | |
| 673 | + mutex_lock(&apple_dart_groups_lock); | |
| 674 | 674 | |
| 675 | 675 | for_each_stream_map(i, cfg, stream_map) { |
| 676 | 676 | for_each_set_bit(sid, &stream_map->sidmap, DART_MAX_STREAMS) { |
| @@ -698,6 +698,20 @@ static struct iommu_group *apple_dart_device_group(struct device *dev) · 21 unmodified lines | ||
| 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; |
| @@ -705,7 +719,7 @@ static struct iommu_group *apple_dart_device_group(struct device *dev) · 1 unmodified line | ||
| 705 | 719 | res = group; |
| 706 | 720 | |
| 707 | 721 | out: |
| 708 | − mutex_unlock(&lock); | |
| 722 | + mutex_unlock(&apple_dart_groups_lock); | |
| 709 | 723 | return res; |
| 710 | 724 | } |
| 711 | 725 | |
| @@ -1942,18 +1942,18 @@ static int dmar_fault_do_one(struct intel_iommu *iommu, int type, · 1941 unmodified lines | ||
| 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, |
| @@ -33,6 +33,7 @@ struct ipoctal_channel { · 32 unmodified lines | ||
| 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; |
| @@ -81,22 +82,34 @@ static int ipoctal_port_activate(struct tty_port *port, struct tty_struct *tty) · 42 unmodified lines | ||
| 81 | 82 | return 0; |
| 82 | 83 | } |
| 83 | 84 | |
| 84 | −static int ipoctal_open(struct tty_struct *tty, struct file *file) | |
| 85 | +static int ipoctal_install(struct tty_driver *driver, struct tty_struct *tty) | |
| 85 | 86 | { |
| 86 | 87 | struct ipoctal_channel *channel = dev_get_drvdata(tty->dev); |
| 87 | 88 | struct ipoctal *ipoctal = chan_to_ipoctal(channel, tty->index); |
| 88 | − int err; | |
| 89 | − | |
| 90 | − tty->driver_data = channel; | |
| 89 | + int res; | |
| 91 | 90 | |
| 92 | 91 | if (!ipack_get_carrier(ipoctal->dev)) |
| 93 | 92 | return -EBUSY; |
| 94 | 93 | |
| 95 | − err = tty_port_open(&channel->tty_port, tty, file); | |
| 96 | − if (err) | |
| 97 | − ipack_put_carrier(ipoctal->dev); | |
| 94 | + res = tty_standard_install(driver, tty); | |
| 95 | + if (res) | |
| 96 | + goto err_put_carrier; | |
| 97 | + | |
| 98 | + tty->driver_data = channel; | |
| 99 | + | |
| 100 | + return 0; | |
| 101 | + | |
| 102 | +err_put_carrier: | |
| 103 | + ipack_put_carrier(ipoctal->dev); | |
| 104 | + | |
| 105 | + return res; | |
| 106 | +} | |
| 107 | + | |
| 108 | +static int ipoctal_open(struct tty_struct *tty, struct file *file) | |
| 109 | +{ | |
| 110 | + struct ipoctal_channel *channel = tty->driver_data; | |
| 98 | 111 | |
| 99 | − return err; | |
| 112 | + return tty_port_open(&channel->tty_port, tty, file); | |
| 100 | 113 | } |
| 101 | 114 | |
| 102 | 115 | static void ipoctal_reset_stats(struct ipoctal_stats *stats) |
| @@ -264,7 +277,6 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 161 unmodified lines | ||
| 264 | 277 | int res; |
| 265 | 278 | int i; |
| 266 | 279 | struct tty_driver *tty; |
| 267 | − char name[20]; | |
| 268 | 280 | struct ipoctal_channel *channel; |
| 269 | 281 | struct ipack_region *region; |
| 270 | 282 | void __iomem *addr; |
| @@ -355,8 +367,11 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 84 unmodified lines | ||
| 355 | 367 | /* Fill struct tty_driver with ipoctal data */ |
| 356 | 368 | tty->owner = THIS_MODULE; |
| 357 | 369 | tty->driver_name = KBUILD_MODNAME; |
| 358 | − sprintf(name, KBUILD_MODNAME ".%d.%d.", bus_nr, slot); | |
| 359 | − tty->name = name; | |
| 370 | + tty->name = kasprintf(GFP_KERNEL, KBUILD_MODNAME ".%d.%d.", bus_nr, slot); | |
| 371 | + if (!tty->name) { | |
| 372 | + res = -ENOMEM; | |
| 373 | + goto err_put_driver; | |
| 374 | + } | |
| 360 | 375 | tty->major = 0; |
| 361 | 376 | |
| 362 | 377 | tty->minor_start = 0; |
| @@ -371,8 +386,7 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 8 unmodified lines | ||
| 371 | 386 | res = tty_register_driver(tty); |
| 372 | 387 | if (res) { |
| 373 | 388 | dev_err(&ipoctal->dev->dev, "Can't register tty driver.\n"); |
| 374 | − tty_driver_kref_put(tty); | |
| 375 | − return res; | |
| 389 | + goto err_free_name; | |
| 376 | 390 | } |
| 377 | 391 | |
| 378 | 392 | /* Save struct tty_driver for use it when uninstalling the device */ |
| @@ -383,7 +397,9 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 4 unmodified lines | ||
| 383 | 397 | |
| 384 | 398 | channel = &ipoctal->channel[i]; |
| 385 | 399 | tty_port_init(&channel->tty_port); |
| 386 | − tty_port_alloc_xmit_buf(&channel->tty_port); | |
| 400 | + res = tty_port_alloc_xmit_buf(&channel->tty_port); | |
| 401 | + if (res) | |
| 402 | + continue; | |
| 387 | 403 | channel->tty_port.ops = &ipoctal_tty_port_ops; |
| 388 | 404 | |
| 389 | 405 | ipoctal_reset_stats(&channel->stats); |
| @@ -391,13 +407,15 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 1 unmodified line | ||
| 391 | 407 | spin_lock_init(&channel->lock); |
| 392 | 408 | channel->pointer_read = 0; |
| 393 | 409 | channel->pointer_write = 0; |
| 394 | − tty_dev = tty_port_register_device(&channel->tty_port, tty, i, NULL); | |
| 410 | + tty_dev = tty_port_register_device_attr(&channel->tty_port, tty, | |
| 411 | + i, NULL, channel, NULL); | |
| 395 | 412 | if (IS_ERR(tty_dev)) { |
| 396 | 413 | dev_err(&ipoctal->dev->dev, "Failed to register tty device.\n"); |
| 414 | + tty_port_free_xmit_buf(&channel->tty_port); | |
| 397 | 415 | tty_port_destroy(&channel->tty_port); |
| 398 | 416 | continue; |
| 399 | 417 | } |
| 400 | − dev_set_drvdata(tty_dev, channel); | |
| 418 | + channel->tty_registered = true; | |
| 401 | 419 | } |
| 402 | 420 | |
| 403 | 421 | /* |
| @@ -409,6 +427,13 @@ static int ipoctal_inst_slot(struct ipoctal *ipoctal, unsigned int bus_nr, · 5 unmodified lines | ||
| 409 | 427 | ipoctal_irq_handler, ipoctal); |
| 410 | 428 | |
| 411 | 429 | return 0; |
| 430 | + | |
| 431 | +err_free_name: | |
| 432 | + kfree(tty->name); | |
| 433 | +err_put_driver: | |
| 434 | + tty_driver_kref_put(tty); | |
| 435 | + | |
| 436 | + return res; | |
| 412 | 437 | } |
| 413 | 438 | |
| 414 | 439 | static inline int ipoctal_copy_write_buffer(struct ipoctal_channel *channel, |
| @@ -648,6 +673,7 @@ static void ipoctal_cleanup(struct tty_struct *tty) · 233 unmodified lines | ||
| 648 | 673 | |
| 649 | 674 | static const struct tty_operations ipoctal_fops = { |
| 650 | 675 | .ioctl = NULL, |
| 676 | + .install = ipoctal_install, | |
| 651 | 677 | .open = ipoctal_open, |
| 652 | 678 | .close = ipoctal_close, |
| 653 | 679 | .write = ipoctal_write_tty, |
| @@ -690,12 +716,17 @@ static void __ipoctal_remove(struct ipoctal *ipoctal) · 36 unmodified lines | ||
| 690 | 716 | |
| 691 | 717 | for (i = 0; i < NR_CHANNELS; i++) { |
| 692 | 718 | struct ipoctal_channel *channel = &ipoctal->channel[i]; |
| 719 | + | |
| 720 | + if (!channel->tty_registered) | |
| 721 | + continue; | |
| 722 | + | |
| 693 | 723 | tty_unregister_device(ipoctal->tty_drv, i); |
| 694 | 724 | tty_port_free_xmit_buf(&channel->tty_port); |
| 695 | 725 | tty_port_destroy(&channel->tty_port); |
| 696 | 726 | } |
| 697 | 727 | |
| 698 | 728 | tty_unregister_driver(ipoctal->tty_drv); |
| 729 | + kfree(ipoctal->tty_drv->name); | |
| 699 | 730 | tty_driver_kref_put(ipoctal->tty_drv); |
| 700 | 731 | kfree(ipoctal); |
| 701 | 732 | } |
| @@ -779,7 +779,7 @@ struct gve_queue_page_list *gve_assign_rx_qpl(struct gve_priv *priv) · 778 unmodified lines | ||
| 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); |
| @@ -41,6 +41,7 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s) · 40 unmodified lines | ||
| 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) { |
| @@ -48,10 +49,12 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s) · 1 unmodified line | ||
| 48 | 49 | do { |
| 49 | 50 | start = |
| 50 | 51 | u64_stats_fetch_begin(&priv->rx[ring].statss); |
| 51 | − s->rx_packets += priv->rx[ring].rpackets; | |
| 52 | − s->rx_bytes += priv->rx[ring].rbytes; | |
| 52 | + packets = priv->rx[ring].rpackets; | |
| 53 | + bytes = priv->rx[ring].rbytes; | |
| 53 | 54 | } while (u64_stats_fetch_retry(&priv->rx[ring].statss, |
| 54 | 55 | start)); |
| 56 | + s->rx_packets += packets; | |
| 57 | + s->rx_bytes += bytes; | |
| 55 | 58 | } |
| 56 | 59 | } |
| 57 | 60 | if (priv->tx) { |
| @@ -59,10 +62,12 @@ static void gve_get_stats(struct net_device *dev, struct rtnl_link_stats64 *s) · 1 unmodified line | ||
| 59 | 62 | do { |
| 60 | 63 | start = |
| 61 | 64 | u64_stats_fetch_begin(&priv->tx[ring].statss); |
| 62 | − s->tx_packets += priv->tx[ring].pkt_done; | |
| 63 | − s->tx_bytes += priv->tx[ring].bytes_done; | |
| 65 | + packets = priv->tx[ring].pkt_done; | |
| 66 | + bytes = priv->tx[ring].bytes_done; | |
| 64 | 67 | } while (u64_stats_fetch_retry(&priv->tx[ring].statss, |
| 65 | 68 | start)); |
| 69 | + s->tx_packets += packets; | |
| 70 | + s->tx_bytes += bytes; | |
| 66 | 71 | } |
| 67 | 72 | } |
| 68 | 73 | } |
| @@ -82,6 +87,9 @@ static int gve_alloc_counter_array(struct gve_priv *priv) · 13 unmodified lines | ||
| 82 | 87 | |
| 83 | 88 | static void gve_free_counter_array(struct gve_priv *priv) |
| 84 | 89 | { |
| 90 | + if (!priv->counter_array) | |
| 91 | + return; | |
| 92 | + | |
| 85 | 93 | dma_free_coherent(&priv->pdev->dev, |
| 86 | 94 | priv->num_event_counters * |
| 87 | 95 | sizeof(*priv->counter_array), |
| @@ -142,6 +150,9 @@ static int gve_alloc_stats_report(struct gve_priv *priv) · 54 unmodified lines | ||
| 142 | 150 | |
| 143 | 151 | static void gve_free_stats_report(struct gve_priv *priv) |
| 144 | 152 | { |
| 153 | + if (!priv->stats_report) | |
| 154 | + return; | |
| 155 | + | |
| 145 | 156 | del_timer_sync(&priv->stats_report_timer); |
| 146 | 157 | dma_free_coherent(&priv->pdev->dev, priv->stats_report_len, |
| 147 | 158 | priv->stats_report, priv->stats_report_bus); |
| @@ -370,18 +381,19 @@ static void gve_free_notify_blocks(struct gve_priv *priv) · 222 unmodified lines | ||
| 370 | 381 | { |
| 371 | 382 | int i; |
| 372 | 383 | |
| 373 | − if (priv->msix_vectors) { | |
| 374 | − /* Free the irqs */ | |
| 375 | − for (i = 0; i < priv->num_ntfy_blks; i++) { | |
| 376 | − struct gve_notify_block *block = &priv->ntfy_blocks[i]; | |
| 377 | − int msix_idx = i; | |
| 384 | + if (!priv->msix_vectors) | |
| 385 | + return; | |
| 378 | 386 | |
| 379 | − irq_set_affinity_hint(priv->msix_vectors[msix_idx].vector, | |
| 380 | − NULL); | |
| 381 | − free_irq(priv->msix_vectors[msix_idx].vector, block); | |
| 382 | − } | |
| 383 | − free_irq(priv->msix_vectors[priv->mgmt_msix_idx].vector, priv); | |
| 387 | + /* Free the irqs */ | |
| 388 | + for (i = 0; i < priv->num_ntfy_blks; i++) { | |
| 389 | + struct gve_notify_block *block = &priv->ntfy_blocks[i]; | |
| 390 | + int msix_idx = i; | |
| 391 | + | |
| 392 | + irq_set_affinity_hint(priv->msix_vectors[msix_idx].vector, | |
| 393 | + NULL); | |
| 394 | + free_irq(priv->msix_vectors[msix_idx].vector, block); | |
| 384 | 395 | } |
| 396 | + free_irq(priv->msix_vectors[priv->mgmt_msix_idx].vector, priv); | |
| 385 | 397 | dma_free_coherent(&priv->pdev->dev, |
| 386 | 398 | priv->num_ntfy_blks * sizeof(*priv->ntfy_blocks), |
| 387 | 399 | priv->ntfy_blocks, priv->ntfy_block_bus); |
| @@ -1184,9 +1196,10 @@ static void gve_handle_reset(struct gve_priv *priv) · 796 unmodified lines | ||
| 1184 | 1196 | |
| 1185 | 1197 | void gve_handle_report_stats(struct gve_priv *priv) |
| 1186 | 1198 | { |
| 1187 | − int idx, stats_idx = 0, tx_bytes; | |
| 1188 | − unsigned int start = 0; | |
| 1189 | 1199 | struct stats *stats = priv->stats_report->stats; |
| 1200 | + int idx, stats_idx = 0; | |
| 1201 | + unsigned int start = 0; | |
| 1202 | + u64 tx_bytes; | |
| 1190 | 1203 | |
| 1191 | 1204 | if (!gve_get_report_stats(priv)) |
| 1192 | 1205 | return; |
| @@ -104,8 +104,14 @@ static int gve_prefill_rx_pages(struct gve_rx_ring *rx) · 103 unmodified lines | ||
| 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]; |
| @@ -4871,7 +4871,8 @@ static void i40e_clear_interrupt_scheme(struct i40e_pf *pf) · 4870 unmodified lines | ||
| 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); |
| @@ -10113,7 +10114,7 @@ static int i40e_get_capabilities(struct i40e_pf *pf, · 5235 unmodified lines | ||
| 10113 | 10114 | if (pf->hw.aq.asq_last_status == I40E_AQ_RC_ENOMEM) { |
| 10114 | 10115 | /* retry with a larger buffer */ |
| 10115 | 10116 | buf_len = data_size; |
| 10116 | − } else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK) { | |
| 10117 | + } else if (pf->hw.aq.asq_last_status != I40E_AQ_RC_OK || err) { | |
| 10117 | 10118 | dev_info(&pf->pdev->dev, |
| 10118 | 10119 | "capability discovery failed, err %s aq_err %s\n", |
| 10119 | 10120 | i40e_stat_str(&pf->hw, err), |
| @@ -1965,7 +1965,6 @@ static void iavf_watchdog_task(struct work_struct *work) · 1964 unmodified lines | ||
| 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)); |
| @@ -998,8 +998,8 @@ ocelot_vcap_block_find_filter_by_index(struct ocelot_vcap_block *block, · 997 unmodified lines | ||
| 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 | |
| @@ -1293,8 +1293,10 @@ int ionic_lif_addr_add(struct ionic_lif *lif, const u8 *addr) · 1292 unmodified lines | ||
| 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 | |
| @@ -349,9 +349,6 @@ loop_out: · 348 unmodified lines | ||
| 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 | } |
| @@ -21,6 +21,7 @@ · 20 unmodified lines | ||
| 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 | |
| @@ -1528,6 +1529,8 @@ static int rk_gmac_powerup(struct rk_priv_data *bsp_priv) · 1501 unmodified lines | ||
| 1528 | 1529 | return ret; |
| 1529 | 1530 | } |
| 1530 | 1531 | |
| 1532 | + pm_runtime_get_sync(dev); | |
| 1533 | + | |
| 1531 | 1534 | if (bsp_priv->integrated_phy) |
| 1532 | 1535 | rk_gmac_integrated_phy_powerup(bsp_priv); |
| 1533 | 1536 | |
| @@ -1539,6 +1542,8 @@ static void rk_gmac_powerdown(struct rk_priv_data *gmac) · 5 unmodified lines | ||
| 1539 | 1542 | if (gmac->integrated_phy) |
| 1540 | 1543 | rk_gmac_integrated_phy_powerdown(gmac); |
| 1541 | 1544 | |
| 1545 | + pm_runtime_put_sync(&gmac->pdev->dev); | |
| 1546 | + | |
| 1542 | 1547 | phy_power_on(gmac, false); |
| 1543 | 1548 | gmac_clk_enable(gmac, false); |
| 1544 | 1549 | } |
| @@ -477,6 +477,10 @@ bool stmmac_eee_init(struct stmmac_priv *priv) · 476 unmodified lines | ||
| 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; |
| @@ -1038,7 +1042,7 @@ static void stmmac_mac_link_down(struct phylink_config *config, · 555 unmodified lines | ||
| 1038 | 1042 | stmmac_mac_set(priv, priv->ioaddr, false); |
| 1039 | 1043 | priv->eee_active = false; |
| 1040 | 1044 | priv->tx_lpi_enabled = false; |
| 1041 | − stmmac_eee_init(priv); | |
| 1045 | + priv->eee_enabled = stmmac_eee_init(priv); | |
| 1042 | 1046 | stmmac_set_eee_pls(priv, priv->hw, false); |
| 1043 | 1047 | |
| 1044 | 1048 | if (priv->dma_cap.fpesel) |
| @@ -666,6 +666,10 @@ int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) · 665 unmodified lines | ||
| 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 | |
| @@ -673,9 +677,6 @@ int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) · 1 unmodified line | ||
| 673 | 677 | DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL | |
| 674 | 678 | mult_fact_100ns << DW_VR_MII_EEE_MULT_FACT_100NS_SHIFT; |
| 675 | 679 | } else { |
| 676 | − ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL0); | |
| 677 | − if (ret < 0) | |
| 678 | − return ret; | |
| 679 | 680 | ret &= ~(DW_VR_MII_EEE_LTX_EN | DW_VR_MII_EEE_LRX_EN | |
| 680 | 681 | DW_VR_MII_EEE_TX_QUIET_EN | DW_VR_MII_EEE_RX_QUIET_EN | |
| 681 | 682 | DW_VR_MII_EEE_TX_EN_CTRL | DW_VR_MII_EEE_RX_EN_CTRL | |
| @@ -690,21 +691,28 @@ int xpcs_config_eee(struct dw_xpcs *xpcs, int mult_fact_100ns, int enable) · 8 unmodified lines | ||
| 690 | 691 | if (ret < 0) |
| 691 | 692 | return ret; |
| 692 | 693 | |
| 693 | − ret |= DW_VR_MII_EEE_TRN_LPI; | |
| 694 | + if (enable) | |
| 695 | + ret |= DW_VR_MII_EEE_TRN_LPI; | |
| 696 | + else | |
| 697 | + ret &= ~DW_VR_MII_EEE_TRN_LPI; | |
| 698 | + | |
| 694 | 699 | return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_EEE_MCTRL1, ret); |
| 695 | 700 | } |
| 696 | 701 | EXPORT_SYMBOL_GPL(xpcs_config_eee); |
| 697 | 702 | |
| 698 | 703 | static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, unsigned int mode) |
| 699 | 704 | { |
| 700 | − int ret; | |
| 705 | + int ret, mdio_ctrl; | |
| 701 | 706 | |
| 702 | 707 | /* For AN for C37 SGMII mode, the settings are :- |
| 703 | − * 1) VR_MII_AN_CTRL Bit(2:1)[PCS_MODE] = 10b (SGMII AN) | |
| 704 | − * 2) VR_MII_AN_CTRL Bit(3) [TX_CONFIG] = 0b (MAC side SGMII) | |
| 708 | + * 1) VR_MII_MMD_CTRL Bit(12) [AN_ENABLE] = 0b (Disable SGMII AN in case | |
| 709 | + it is already enabled) | |
| 710 | + * 2) VR_MII_AN_CTRL Bit(2:1)[PCS_MODE] = 10b (SGMII AN) | |
| 711 | + * 3) VR_MII_AN_CTRL Bit(3) [TX_CONFIG] = 0b (MAC side SGMII) | |
| 705 | 712 | * DW xPCS used with DW EQoS MAC is always MAC side SGMII. |
| 706 | − * 3) VR_MII_DIG_CTRL1 Bit(9) [MAC_AUTO_SW] = 1b (Automatic | |
| 713 | + * 4) VR_MII_DIG_CTRL1 Bit(9) [MAC_AUTO_SW] = 1b (Automatic | |
| 707 | 714 | * speed/duplex mode change by HW after SGMII AN complete) |
| 715 | + * 5) VR_MII_MMD_CTRL Bit(12) [AN_ENABLE] = 1b (Enable SGMII AN) | |
| 708 | 716 | * |
| 709 | 717 | * Note: Since it is MAC side SGMII, there is no need to set |
| 710 | 718 | * SR_MII_AN_ADV. MAC side SGMII receives AN Tx Config from |
| @@ -712,6 +720,17 @@ static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, unsigned int mode) · 1 unmodified line | ||
| 712 | 720 | * between PHY and Link Partner. There is also no need to |
| 713 | 721 | * trigger AN restart for MAC-side SGMII. |
| 714 | 722 | */ |
| 723 | + mdio_ctrl = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL); | |
| 724 | + if (mdio_ctrl < 0) | |
| 725 | + return mdio_ctrl; | |
| 726 | + | |
| 727 | + if (mdio_ctrl & AN_CL37_EN) { | |
| 728 | + ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL, | |
| 729 | + mdio_ctrl & ~AN_CL37_EN); | |
| 730 | + if (ret < 0) | |
| 731 | + return ret; | |
| 732 | + } | |
| 733 | + | |
| 715 | 734 | ret = xpcs_read(xpcs, MDIO_MMD_VEND2, DW_VR_MII_AN_CTRL); |
| 716 | 735 | if (ret < 0) |
| 717 | 736 | return ret; |
| @@ -736,7 +755,15 @@ static int xpcs_config_aneg_c37_sgmii(struct dw_xpcs *xpcs, unsigned int mode) · 18 unmodified lines | ||
| 736 | 755 | else |
| 737 | 756 | ret &= ~DW_VR_MII_DIG_CTRL1_MAC_AUTO_SW; |
| 738 | 757 | |
| 739 | − return xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1, ret); | |
| 758 | + ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_DIG_CTRL1, ret); | |
| 759 | + if (ret < 0) | |
| 760 | + return ret; | |
| 761 | + | |
| 762 | + if (phylink_autoneg_inband(mode)) | |
| 763 | + ret = xpcs_write(xpcs, MDIO_MMD_VEND2, DW_VR_MII_MMD_CTRL, | |
| 764 | + mdio_ctrl | AN_CL37_EN); | |
| 765 | + | |
| 766 | + return ret; | |
| 740 | 767 | } |
| 741 | 768 | |
| 742 | 769 | static int xpcs_config_2500basex(struct dw_xpcs *xpcs) |
| @@ -525,6 +525,10 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) · 524 unmodified lines | ||
| 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 | |
| @@ -534,10 +538,16 @@ int __mdiobus_register(struct mii_bus *bus, struct module *owner) · 3 unmodified lines | ||
| 534 | 538 | bus->dev.groups = NULL; |
| 535 | 539 | dev_set_name(&bus->dev, "%s", bus->id); |
| 536 | 540 | |
| 541 | + /* We need to set state to MDIOBUS_UNREGISTERED to correctly release | |
| 542 | + * the device in mdiobus_free() | |
| 543 | + * | |
| 544 | + * State will be updated later in this function in case of success | |
| 545 | + */ | |
| 546 | + bus->state = MDIOBUS_UNREGISTERED; | |
| 547 | + | |
| 537 | 548 | err = device_register(&bus->dev); |
| 538 | 549 | if (err) { |
| 539 | 550 | pr_err("mii_bus %s failed to register\n", bus->id); |
| 540 | − put_device(&bus->dev); | |
| 541 | 551 | return -EINVAL; |
| 542 | 552 | } |
| 543 | 553 | |
| @@ -134,7 +134,7 @@ static const char * const sm_state_strings[] = { · 133 unmodified lines | ||
| 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) |
| @@ -767,6 +767,7 @@ enum rtl8152_flags { · 766 unmodified lines | ||
| 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 |
| @@ -1770,6 +1771,14 @@ static void read_bulk_callback(struct urb *urb) · 997 unmodified lines | ||
| 1770 | 1771 | rtl_set_unplug(tp); |
| 1771 | 1772 | netif_device_detach(tp->netdev); |
| 1772 | 1773 | return; |
| 1774 | + case -EPROTO: | |
| 1775 | + urb->actual_length = 0; | |
| 1776 | + spin_lock_irqsave(&tp->rx_lock, flags); | |
| 1777 | + list_add_tail(&agg->list, &tp->rx_done); | |
| 1778 | + spin_unlock_irqrestore(&tp->rx_lock, flags); | |
| 1779 | + set_bit(RX_EPROTO, &tp->flags); | |
| 1780 | + schedule_delayed_work(&tp->schedule, 1); | |
| 1781 | + return; | |
| 1773 | 1782 | case -ENOENT: |
| 1774 | 1783 | return; /* the urb is in unlink state */ |
| 1775 | 1784 | case -ETIME: |
| @@ -2425,6 +2434,7 @@ static int rx_bottom(struct r8152 *tp, int budget) · 649 unmodified lines | ||
| 2425 | 2434 | if (list_empty(&tp->rx_done)) |
| 2426 | 2435 | goto out1; |
| 2427 | 2436 | |
| 2437 | + clear_bit(RX_EPROTO, &tp->flags); | |
| 2428 | 2438 | INIT_LIST_HEAD(&rx_queue); |
| 2429 | 2439 | spin_lock_irqsave(&tp->rx_lock, flags); |
| 2430 | 2440 | list_splice_init(&tp->rx_done, &rx_queue); |
| @@ -2441,7 +2451,7 @@ static int rx_bottom(struct r8152 *tp, int budget) · 10 unmodified lines | ||
| 2441 | 2451 | |
| 2442 | 2452 | agg = list_entry(cursor, struct rx_agg, list); |
| 2443 | 2453 | urb = agg->urb; |
| 2444 | − if (urb->actual_length < ETH_ZLEN) | |
| 2454 | + if (urb->status != 0 || urb->actual_length < ETH_ZLEN) | |
| 2445 | 2455 | goto submit; |
| 2446 | 2456 | |
| 2447 | 2457 | agg_free = rtl_get_free_rx(tp, GFP_ATOMIC); |
| @@ -6643,6 +6653,10 @@ static void rtl_work_func_t(struct work_struct *work) · 4195 unmodified lines | ||
| 6643 | 6653 | netif_carrier_ok(tp->netdev)) |
| 6644 | 6654 | tasklet_schedule(&tp->tx_tl); |
| 6645 | 6655 | |
| 6656 | + if (test_and_clear_bit(RX_EPROTO, &tp->flags) && | |
| 6657 | + !list_empty(&tp->rx_done)) | |
| 6658 | + napi_schedule(&tp->napi); | |
| 6659 | + | |
| 6646 | 6660 | mutex_unlock(&tp->control); |
| 6647 | 6661 | |
| 6648 | 6662 | out1: |
| @@ -3,9 +3,7 @@ config ATH5K · 2 unmodified lines | ||
| 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 |
| @@ -89,7 +89,8 @@ static const struct pci_device_id ath5k_led_devices[] = { · 88 unmodified lines | ||
| 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 | } |
| @@ -104,7 +105,8 @@ static void ath5k_led_on(struct ath5k_hw *ah) · 8 unmodified lines | ||
| 104 | 105 | |
| 105 | 106 | void ath5k_led_off(struct ath5k_hw *ah) |
| 106 | 107 | { |
| 107 | − if (!test_bit(ATH_STAT_LEDSOFT, ah->status)) | |
| 108 | + if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || | |
| 109 | + !test_bit(ATH_STAT_LEDSOFT, ah->status)) | |
| 108 | 110 | return; |
| 109 | 111 | ath5k_hw_set_gpio(ah, ah->led_pin, !ah->led_on); |
| 110 | 112 | } |
| @@ -146,7 +148,7 @@ ath5k_register_led(struct ath5k_hw *ah, struct ath5k_led *led, · 35 unmodified lines | ||
| 146 | 148 | static void |
| 147 | 149 | ath5k_unregister_led(struct ath5k_led *led) |
| 148 | 150 | { |
| 149 | − if (!led->ah) | |
| 151 | + if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !led->ah) | |
| 150 | 152 | return; |
| 151 | 153 | led_classdev_unregister(&led->led_dev); |
| 152 | 154 | ath5k_led_off(led->ah); |
| @@ -169,7 +171,7 @@ int ath5k_init_leds(struct ath5k_hw *ah) · 16 unmodified lines | ||
| 169 | 171 | char name[ATH5K_LED_MAX_NAME_LEN + 1]; |
| 170 | 172 | const struct pci_device_id *match; |
| 171 | 173 | |
| 172 | − if (!ah->pdev) | |
| 174 | + if (!IS_ENABLED(CONFIG_MAC80211_LEDS) || !ah->pdev) | |
| 173 | 175 | return 0; |
| 174 | 176 | |
| 175 | 177 | #ifdef CONFIG_ATH5K_AHB |
| @@ -7463,23 +7463,18 @@ static s32 brcmf_translate_country_code(struct brcmf_pub *drvr, char alpha2[2], · 7462 unmodified lines | ||
| 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 | 7476 | } |
| 7471 | 7477 | |
| 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 | − } | |
| 7482 | − | |
| 7483 | 7478 | found_index = -1; |
| 7484 | 7479 | for (i = 0; i < country_codes->table_size; i++) { |
| 7485 | 7480 | cc = &country_codes->table[i]; |
| @@ -160,6 +160,7 @@ static void iwl_mvm_wowlan_program_keys(struct ieee80211_hw *hw, · 159 unmodified lines | ||
| 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; |
| @@ -360,11 +361,11 @@ static void iwl_mvm_wowlan_get_rsc_v5_data(struct ieee80211_hw *hw, · 194 unmodified lines | ||
| 360 | 361 | if (sta) { |
| 361 | 362 | rsc = data->rsc->ucast_rsc; |
| 362 | 363 | } else { |
| 363 | − if (WARN_ON(data->gtks > ARRAY_SIZE(data->gtk_ids))) | |
| 364 | + if (WARN_ON(data->gtks >= ARRAY_SIZE(data->gtk_ids))) | |
| 364 | 365 | return; |
| 365 | 366 | data->gtk_ids[data->gtks] = key->keyidx; |
| 366 | 367 | rsc = data->rsc->mcast_rsc[data->gtks % 2]; |
| 367 | − if (WARN_ON(key->keyidx > | |
| 368 | + if (WARN_ON(key->keyidx >= | |
| 368 | 369 | ARRAY_SIZE(data->rsc->mcast_key_id_map))) |
| 369 | 370 | return; |
| 370 | 371 | data->rsc->mcast_key_id_map[key->keyidx] = data->gtks % 2; |
| @@ -662,12 +662,13 @@ static bool __iwl_mvm_remove_time_event(struct iwl_mvm *mvm, · 661 unmodified lines | ||
| 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 | /* |
| @@ -547,6 +547,8 @@ static const struct iwl_dev_info iwl_dev_info_table[] = { · 546 unmodified lines | ||
| 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), |
| @@ -62,8 +62,8 @@ void *mwifiex_process_sta_txpd(struct mwifiex_private *priv, · 61 unmodified lines | ||
| 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; |
| @@ -475,8 +475,8 @@ void *mwifiex_process_uap_txpd(struct mwifiex_private *priv, · 474 unmodified lines | ||
| 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 | |
| @@ -380,7 +380,6 @@ static int pmem_attach_disk(struct device *dev, · 379 unmodified lines | ||
| 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; |
| @@ -489,10 +488,8 @@ static int pmem_attach_disk(struct device *dev, · 102 unmodified lines | ||
| 489 | 488 | } |
| 490 | 489 | dax_write_cache(dax_dev, nvdimm_has_cache(nd_region)); |
| 491 | 490 | pmem->dax_dev = dax_dev; |
| 492 | − gendev = disk_to_dev(disk); | |
| 493 | − gendev->groups = pmem_attribute_groups; | |
| 494 | 491 | |
| 495 | − device_add_disk(dev, disk, NULL); | |
| 492 | + device_add_disk(dev, disk, pmem_attribute_groups); | |
| 496 | 493 | if (devm_add_action_or_reset(dev, pmem_release_disk, pmem)) |
| 497 | 494 | return -ENOMEM; |
| 498 | 495 | |
| @@ -978,6 +978,7 @@ EXPORT_SYMBOL_GPL(nvme_cleanup_cmd); · 977 unmodified lines | ||
| 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)) { |
| @@ -1026,7 +1027,8 @@ blk_status_t nvme_setup_cmd(struct nvme_ns *ns, struct request *req) · 42 unmodified lines | ||
| 1026 | 1027 | return BLK_STS_IOERR; |
| 1027 | 1028 | } |
| 1028 | 1029 | |
| 1029 | − nvme_req(req)->genctr++; | |
| 1030 | + if (!(ctrl->quirks & NVME_QUIRK_SKIP_CID_GEN)) | |
| 1031 | + nvme_req(req)->genctr++; | |
| 1030 | 1032 | cmd->common.command_id = nvme_cid(req); |
| 1031 | 1033 | trace_nvme_setup_cmd(req, cmd); |
| 1032 | 1034 | return ret; |
| @@ -138,6 +138,12 @@ enum nvme_quirks { · 137 unmodified lines | ||
| 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 | /* |
| @@ -3369,7 +3369,8 @@ static const struct pci_device_id nvme_id_table[] = { · 3368 unmodified lines | ||
| 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, } |
| @@ -3301,9 +3301,17 @@ static int hv_pci_bus_exit(struct hv_device *hdev, bool keep_devs) · 3300 unmodified lines | ||
| 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); |
| @@ -3311,7 +3319,6 @@ static int hv_pci_bus_exit(struct hv_device *hdev, bool keep_devs) · 1 unmodified line | ||
| 3311 | 3319 | put_pcichild(hpdev); |
| 3312 | 3320 | put_pcichild(hpdev); |
| 3313 | 3321 | } |
| 3314 | − spin_unlock_irqrestore(&hbus->device_list_lock, flags); | |
| 3315 | 3322 | } |
| 3316 | 3323 | |
| 3317 | 3324 | ret = hv_send_resources_released(hdev); |
| @@ -15,8 +15,6 @@ · 14 unmodified lines | ||
| 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 | |
| @@ -28,8 +26,7 @@ int kvm_arch_ptp_init(void) · 5 unmodified lines | ||
| 28 | 26 | return -ENODEV; |
| 29 | 27 | |
| 30 | 28 | clock_pair_gpa = slow_virt_to_phys(&clock_pair); |
| 31 | − hv_clock = pvclock_get_pvti_cpu0_va(); | |
| 32 | − if (!hv_clock) | |
| 29 | + if (!pvclock_get_pvti_cpu0_va()) | |
| 33 | 30 | return -ENODEV; |
| 34 | 31 | |
| 35 | 32 | ret = kvm_hypercall2(KVM_HC_CLOCK_PAIRING, clock_pair_gpa, |
| @@ -64,10 +61,8 @@ int kvm_arch_ptp_get_crosststamp(u64 *cycle, struct timespec64 *tspec, · 28 unmodified lines | ||
| 64 | 61 | struct pvclock_vcpu_time_info *src; |
| 65 | 62 | unsigned int version; |
| 66 | 63 | long ret; |
| 67 | − int cpu; | |
| 68 | 64 | |
| 69 | − cpu = smp_processor_id(); | |
| 70 | − src = &hv_clock[cpu].pvti; | |
| 65 | + src = this_cpu_pvti(); | |
| 71 | 66 | |
| 72 | 67 | do { |
| 73 | 68 | /* |
| @@ -644,6 +644,7 @@ static const struct pci_device_id pch_ieee1588_pcidev_id[] = { · 643 unmodified lines | ||
| 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 | |
| @@ -262,10 +262,12 @@ static int blacklist_parse_proc_parameters(char *buf) · 261 unmodified lines | ||
| 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) |
| @@ -788,27 +788,49 @@ static int __unset_registered(struct device *dev, void *data) · 787 unmodified lines | ||
| 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) |
| @@ -820,7 +842,7 @@ void css_wait_for_slow_path(void) · 5 unmodified lines | ||
| 820 | 842 | void css_schedule_reprobe(void) |
| 821 | 843 | { |
| 822 | 844 | /* Schedule with a delay to allow merging of subsequent calls. */ |
| 823 | − css_schedule_eval_all_unreg(1 * HZ); | |
| 845 | + css_schedule_eval_cond(CSS_EVAL_UNREG, 1 * HZ); | |
| 824 | 846 | } |
| 825 | 847 | EXPORT_SYMBOL_GPL(css_schedule_reprobe); |
| 826 | 848 | |
| @@ -34,6 +34,14 @@ · 33 unmodified lines | ||
| 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 */ |
| @@ -136,7 +144,7 @@ static inline struct channel_subsystem *css_by_id(u8 cssid) · 96 unmodified lines | ||
| 136 | 144 | /* Helper functions to build lists for the slow path. */ |
| 137 | 145 | void css_schedule_eval(struct subchannel_id schid); |
| 138 | 146 | void css_schedule_eval_all(void); |
| 139 | −void css_schedule_eval_all_unreg(unsigned long delay); | |
| 147 | +void css_schedule_eval_cond(enum css_eval_cond, unsigned long delay); | |
| 140 | 148 | int css_complete_work(void); |
| 141 | 149 | |
| 142 | 150 | int sch_is_pseudo_sch(struct subchannel *); |
| @@ -1254,3 +1254,4 @@ MODULE_DEVICE_TABLE(pci, csio_pci_tbl); · 1253 unmodified lines | ||
| 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"); | |
| @@ -2634,7 +2634,7 @@ static void qla24xx_nvme_iocb_entry(scsi_qla_host_t *vha, struct req_que *req, · 2633 unmodified lines | ||
| 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,7 +3491,7 @@ check_scsi_status: · 850 unmodified lines | ||
| 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, |
| @@ -118,7 +118,7 @@ static int ses_recv_diag(struct scsi_device *sdev, int page_code, · 117 unmodified lines | ||
| 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, |
| @@ -318,8 +318,7 @@ static void ufshcd_add_query_upiu_trace(struct ufs_hba *hba, · 317 unmodified lines | ||
| 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; |
| @@ -300,7 +300,7 @@ static void virtscsi_handle_transport_reset(struct virtio_scsi *vscsi, · 299 unmodified lines | ||
| 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,7 +392,7 @@ static void virtscsi_handle_event(struct work_struct *work) · 85 unmodified lines | ||
| 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 | } |
| @@ -98,7 +98,7 @@ void *qcom_mdt_read_metadata(const struct firmware *fw, size_t *data_len) · 97 unmodified lines | ||
| 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) |
| @@ -628,7 +628,7 @@ static int qcom_socinfo_probe(struct platform_device *pdev) · 627 unmodified lines | ||
| 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 | } |
| @@ -825,25 +825,28 @@ static int omap_reset_deassert(struct reset_controller_dev *rcdev, · 824 unmodified lines | ||
| 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; | |
| 828 | + /* wait for the reset bit to clear */ | |
| 829 | + ret = readl_relaxed_poll_timeout_atomic(reset->prm->base + | |
| 830 | + reset->prm->data->rstctrl, | |
| 831 | + v, !(v & BIT(id)), 1, | |
| 832 | + OMAP_RESET_MAX_WAIT); | |
| 833 | + if (ret) | |
| 834 | + pr_err("%s: timedout waiting for %s:%lu\n", __func__, | |
| 835 | + reset->prm->data->name, id); | |
| 830 | 836 | |
| 831 | 837 | /* wait for the status to be set */ |
| 832 | − ret = readl_relaxed_poll_timeout_atomic(reset->prm->base + | |
| 838 | + if (has_rstst) { | |
| 839 | + ret = readl_relaxed_poll_timeout_atomic(reset->prm->base + | |
| 833 | 840 | reset->prm->data->rstst, |
| 834 | 841 | v, v & BIT(st_bit), 1, |
| 835 | 842 | OMAP_RESET_MAX_WAIT); |
| 836 | − if (ret) | |
| 837 | − pr_err("%s: timedout waiting for %s:%lu\n", __func__, | |
| 838 | − reset->prm->data->name, id); | |
| 843 | + if (ret) | |
| 844 | + pr_err("%s: timedout waiting for %s:%lu\n", __func__, | |
| 845 | + reset->prm->data->name, id); | |
| 846 | + } | |
| 839 | 847 | |
| 840 | −exit: | |
| 841 | − if (reset->clkdm) { | |
| 842 | − /* At least dra7 iva needs a delay before clkdm idle */ | |
| 843 | − if (has_rstst) | |
| 844 | − udelay(1); | |
| 848 | + if (reset->clkdm) | |
| 845 | 849 | pdata->clkdm_allow_idle(reset->clkdm); |
| 846 | − } | |
| 847 | 850 | |
| 848 | 851 | return ret; |
| 849 | 852 | } |
| @@ -1646,6 +1646,8 @@ static input_system_err_t input_system_configure_channel_sensor( · 1645 unmodified lines | ||
| 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. |
| @@ -35,7 +35,7 @@ static int pool_op_alloc(struct tee_shm_pool_mgr *poolm, · 34 unmodified lines | ||
| 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; |
| @@ -40,17 +40,6 @@ · 39 unmodified lines | ||
| 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 { |
| @@ -104,61 +93,6 @@ static int omap_ohci_transceiver_power(struct ohci_omap_priv *priv, int on) · 47 unmodified lines | ||
| 104 | 93 | return 0; |
| 105 | 94 | } |
| 106 | 95 | |
| 107 | −#ifdef CONFIG_ARCH_OMAP15XX | |
| 108 | −/* | |
| 109 | − * OMAP-1510 specific Local Bus clock on/off | |
| 110 | − */ | |
| 111 | −static int omap_1510_local_bus_power(int on) | |
| 112 | −{ | |
| 113 | − if (on) { | |
| 114 | − omap_writel((1 << 1) | (1 << 0), OMAP1510_LB_MMU_CTL); | |
| 115 | − udelay(200); | |
| 116 | − } else { | |
| 117 | − omap_writel(0, OMAP1510_LB_MMU_CTL); | |
| 118 | − } | |
| 119 | − | |
| 120 | − return 0; | |
| 121 | −} | |
| 122 | − | |
| 123 | −/* | |
| 124 | − * OMAP-1510 specific Local Bus initialization | |
| 125 | − * NOTE: This assumes 32MB memory size in OMAP1510LB_MEMSIZE. | |
| 126 | − * See also arch/mach-omap/memory.h for __virt_to_dma() and | |
| 127 | − * __dma_to_virt() which need to match with the physical | |
| 128 | − * Local Bus address below. | |
| 129 | − */ | |
| 130 | −static int omap_1510_local_bus_init(void) | |
| 131 | −{ | |
| 132 | − unsigned int tlb; | |
| 133 | − unsigned long lbaddr, physaddr; | |
| 134 | − | |
| 135 | − omap_writel((omap_readl(OMAP1510_LB_CLOCK_DIV) & 0xfffffff8) | 0x4, | |
| 136 | − OMAP1510_LB_CLOCK_DIV); | |
| 137 | − | |
| 138 | − /* Configure the Local Bus MMU table */ | |
| 139 | − for (tlb = 0; tlb < OMAP1510_LB_MEMSIZE; tlb++) { | |
| 140 | − lbaddr = tlb * 0x00100000 + OMAP1510_LB_OFFSET; | |
| 141 | − physaddr = tlb * 0x00100000 + PHYS_OFFSET; | |
| 142 | − omap_writel((lbaddr & 0x0fffffff) >> 22, OMAP1510_LB_MMU_CAM_H); | |
| 143 | − omap_writel(((lbaddr & 0x003ffc00) >> 6) | 0xc, | |
| 144 | − OMAP1510_LB_MMU_CAM_L); | |
| 145 | − omap_writel(physaddr >> 16, OMAP1510_LB_MMU_RAM_H); | |
| 146 | − omap_writel((physaddr & 0x0000fc00) | 0x300, OMAP1510_LB_MMU_RAM_L); | |
| 147 | − omap_writel(tlb << 4, OMAP1510_LB_MMU_LCK); | |
| 148 | − omap_writel(0x1, OMAP1510_LB_MMU_LD_TLB); | |
| 149 | − } | |
| 150 | − | |
| 151 | − /* Enable the walking table */ | |
| 152 | − omap_writel(omap_readl(OMAP1510_LB_MMU_CTL) | (1 << 3), OMAP1510_LB_MMU_CTL); | |
| 153 | − udelay(200); | |
| 154 | − | |
| 155 | − return 0; | |
| 156 | −} | |
| 157 | −#else | |
| 158 | −#define omap_1510_local_bus_power(x) {} | |
| 159 | −#define omap_1510_local_bus_init() {} | |
| 160 | −#endif | |
| 161 | − | |
| 162 | 96 | #ifdef CONFIG_USB_OTG |
| 163 | 97 | |
| 164 | 98 | static void start_hnp(struct ohci_hcd *ohci) |
| @@ -229,10 +163,8 @@ static int ohci_omap_reset(struct usb_hcd *hcd) · 64 unmodified lines | ||
| 229 | 163 | |
| 230 | 164 | omap_ohci_clock_power(priv, 1); |
| 231 | 165 | |
| 232 | − if (cpu_is_omap15xx()) { | |
| 233 | − omap_1510_local_bus_power(1); | |
| 234 | − omap_1510_local_bus_init(); | |
| 235 | − } | |
| 166 | + if (config->lb_reset) | |
| 167 | + config->lb_reset(); | |
| 236 | 168 | |
| 237 | 169 | ret = ohci_setup(hcd); |
| 238 | 170 | if (ret < 0) |
| @@ -23,7 +23,7 @@ struct fscache_netfs v9fs_cache_netfs = { · 22 unmodified lines | ||
| 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,7 +233,7 @@ static void v9fs_vfs_readpage_complete(struct page *page, void *data, · 203 unmodified lines | ||
| 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,7 +268,7 @@ int __v9fs_readpage_from_fscache(struct inode *inode, struct page *page) · 28 unmodified lines | ||
| 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,7 +308,7 @@ int __v9fs_readpages_from_fscache(struct inode *inode, · 33 unmodified lines | ||
| 308 | 308 | } |
| 309 | 309 | } |
| 310 | 310 | |
| 311 | −/** | |
| 311 | +/* | |
| 312 | 312 | * __v9fs_readpage_to_fscache - write a page to the cache |
| 313 | 313 | * |
| 314 | 314 | */ |
| @@ -19,18 +19,18 @@ · 18 unmodified lines | ||
| 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,7 +67,7 @@ static struct p9_fid *v9fs_fid_find_inode(struct inode *inode, kuid_t uid) · 30 unmodified lines | ||
| 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 | */ |
| @@ -155,6 +155,7 @@ int v9fs_show_options(struct seq_file *m, struct dentry *root) · 154 unmodified lines | ||
| 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 | */ |
| @@ -542,12 +543,9 @@ extern int v9fs_error_init(void); · 381 unmodified lines | ||
| 542 | 543 | static struct kobject *v9fs_kobj; |
| 543 | 544 | |
| 544 | 545 | #ifdef CONFIG_9P_FSCACHE |
| 545 | −/** | |
| 546 | − * caches_show - list caches associated with a session | |
| 547 | − * | |
| 548 | − * Returns the size of buffer written. | |
| 546 | +/* | |
| 547 | + * List caches associated with a session | |
| 549 | 548 | */ |
| 550 | − | |
| 551 | 549 | static ssize_t caches_show(struct kobject *kobj, |
| 552 | 550 | struct kobj_attribute *attr, |
| 553 | 551 | char *buf) |
| @@ -30,8 +30,7 @@ · 29 unmodified lines | ||
| 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 | */ |
| @@ -116,6 +115,8 @@ static int v9fs_vfs_readpages(struct file *filp, struct address_space *mapping, · 78 unmodified lines | ||
| 116 | 115 | |
| 117 | 116 | /** |
| 118 | 117 | * v9fs_release_page - release the private state associated with a page |
| 118 | + * @page: The page to be released | |
| 119 | + * @gfp: The caller's allocation restrictions | |
| 119 | 120 | * |
| 120 | 121 | * Returns 1 if the page can be released, false otherwise. |
| 121 | 122 | */ |
| @@ -129,9 +130,9 @@ static int v9fs_release_page(struct page *page, gfp_t gfp) · 7 unmodified lines | ||
| 129 | 130 | |
| 130 | 131 | /** |
| 131 | 132 | * v9fs_invalidate_page - Invalidate a page completely or partially |
| 132 | − * | |
| 133 | − * @page: structure to page | |
| 134 | − * @offset: offset in the page | |
| 133 | + * @page: The page to be invalidated | |
| 134 | + * @offset: offset of the invalidated region | |
| 135 | + * @length: length of the invalidated region | |
| 135 | 136 | */ |
| 136 | 137 | |
| 137 | 138 | static void v9fs_invalidate_page(struct page *page, unsigned int offset, |
| @@ -199,6 +200,8 @@ static int v9fs_vfs_writepage(struct page *page, struct writeback_control *wbc) · 61 unmodified lines | ||
| 199 | 200 | |
| 200 | 201 | /** |
| 201 | 202 | * v9fs_launder_page - Writeback a dirty page |
| 203 | + * @page: The page to be cleaned up | |
| 204 | + * | |
| 202 | 205 | * Returns 0 on success. |
| 203 | 206 | */ |
| 204 | 207 | |
| @@ -219,6 +222,7 @@ static int v9fs_launder_page(struct page *page) · 14 unmodified lines | ||
| 219 | 222 | /** |
| 220 | 223 | * v9fs_direct_IO - 9P address space operation for direct I/O |
| 221 | 224 | * @iocb: target I/O control block |
| 225 | + * @iter: The data/buffer to use | |
| 222 | 226 | * |
| 223 | 227 | * The presence of v9fs_direct_IO() in the address space ops vector |
| 224 | 228 | * allowes open() O_DIRECT flags which would have failed otherwise. |
| @@ -359,14 +359,11 @@ out_err: · 358 unmodified lines | ||
| 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 | { |
| @@ -388,11 +385,9 @@ v9fs_file_read_iter(struct kiocb *iocb, struct iov_iter *to) · 15 unmodified lines | ||
| 388 | 385 | } |
| 389 | 386 | |
| 390 | 387 | /** |
| 391 | − * v9fs_file_write - write to a file | |
| 392 | − * @filp: file pointer to write | |
| 393 | − * @data: data buffer to write data from | |
| 394 | − * @count: size of buffer | |
| 395 | − * @offset: offset at which to write data | |
| 388 | + * v9fs_file_write_iter - write to a file | |
| 389 | + * @iocb: The operation parameters | |
| 390 | + * @from: The data to write | |
| 396 | 391 | * |
| 397 | 392 | */ |
| 398 | 393 | static ssize_t |
| @@ -561,11 +556,9 @@ out_unlock: · 162 unmodified lines | ||
| 561 | 556 | } |
| 562 | 557 | |
| 563 | 558 | /** |
| 564 | − * v9fs_mmap_file_read - read from a file | |
| 565 | − * @filp: file pointer to read | |
| 566 | − * @data: user data buffer to read data into | |
| 567 | − * @count: size of buffer | |
| 568 | − * @offset: offset at which to read data | |
| 559 | + * v9fs_mmap_file_read_iter - read from a file | |
| 560 | + * @iocb: The operation parameters | |
| 561 | + * @to: The buffer to read into | |
| 569 | 562 | * |
| 570 | 563 | */ |
| 571 | 564 | static ssize_t |
| @@ -576,11 +569,9 @@ v9fs_mmap_file_read_iter(struct kiocb *iocb, struct iov_iter *to) · 4 unmodified lines | ||
| 576 | 569 | } |
| 577 | 570 | |
| 578 | 571 | /** |
| 579 | − * v9fs_mmap_file_write - write to a file | |
| 580 | − * @filp: file pointer to write | |
| 581 | − * @data: data buffer to write data from | |
| 582 | − * @count: size of buffer | |
| 583 | − * @offset: offset at which to write data | |
| 572 | + * v9fs_mmap_file_write_iter - write to a file | |
| 573 | + * @iocb: The operation parameters | |
| 574 | + * @from: The data to write | |
| 584 | 575 | * |
| 585 | 576 | */ |
| 586 | 577 | static ssize_t |
| @@ -218,7 +218,7 @@ v9fs_blank_wstat(struct p9_wstat *wstat) · 217 unmodified lines | ||
| 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,7 +238,7 @@ struct inode *v9fs_alloc_inode(struct super_block *sb) · 13 unmodified lines | ||
| 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,7 +343,7 @@ error: · 98 unmodified lines | ||
| 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,7 +369,7 @@ struct inode *v9fs_get_inode(struct super_block *sb, umode_t mode, dev_t rdev) · 19 unmodified lines | ||
| 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,14 +665,15 @@ error: · 289 unmodified lines | ||
| 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 | 676 | * |
| 672 | − * @dir: directory inode that is being created | |
| 673 | − * @dentry: dentry that is being deleted | |
| 674 | − * @mode: create permissions | |
| 675 | − * | |
| 676 | 677 | */ |
| 677 | 678 | |
| 678 | 679 | static int |
| @@ -696,6 +697,7 @@ v9fs_vfs_create(struct user_namespace *mnt_userns, struct inode *dir, · 17 unmodified lines | ||
| 696 | 697 | |
| 697 | 698 | /** |
| 698 | 699 | * v9fs_vfs_mkdir - VFS mkdir hook to create a directory |
| 700 | + * @mnt_userns: The user namespace of the mount | |
| 699 | 701 | * @dir: inode that is being unlinked |
| 700 | 702 | * @dentry: dentry that is being unlinked |
| 701 | 703 | * @mode: mode for new directory |
| @@ -900,10 +902,12 @@ int v9fs_vfs_rmdir(struct inode *i, struct dentry *d) · 198 unmodified lines | ||
| 900 | 902 | |
| 901 | 903 | /** |
| 902 | 904 | * v9fs_vfs_rename - VFS hook to rename an inode |
| 905 | + * @mnt_userns: The user namespace of the mount | |
| 903 | 906 | * @old_dir: old dir inode |
| 904 | 907 | * @old_dentry: old dentry |
| 905 | 908 | * @new_dir: new dir inode |
| 906 | 909 | * @new_dentry: new dentry |
| 910 | + * @flags: RENAME_* flags | |
| 907 | 911 | * |
| 908 | 912 | */ |
| 909 | 913 | |
| @@ -1009,6 +1013,7 @@ done: · 99 unmodified lines | ||
| 1009 | 1013 | |
| 1010 | 1014 | /** |
| 1011 | 1015 | * v9fs_vfs_getattr - retrieve file metadata |
| 1016 | + * @mnt_userns: The user namespace of the mount | |
| 1012 | 1017 | * @path: Object to query |
| 1013 | 1018 | * @stat: metadata structure to populate |
| 1014 | 1019 | * @request_mask: Mask of STATX_xxx flags indicating the caller's interests |
| @@ -1050,6 +1055,7 @@ v9fs_vfs_getattr(struct user_namespace *mnt_userns, const struct path *path, · 35 unmodified lines | ||
| 1050 | 1055 | |
| 1051 | 1056 | /** |
| 1052 | 1057 | * v9fs_vfs_setattr - set file metadata |
| 1058 | + * @mnt_userns: The user namespace of the mount | |
| 1053 | 1059 | * @dentry: file whose metadata to set |
| 1054 | 1060 | * @iattr: metadata assignment structure |
| 1055 | 1061 | * |
| @@ -1285,6 +1291,7 @@ static int v9fs_vfs_mkspecial(struct inode *dir, struct dentry *dentry, · 229 unmodified lines | ||
| 1285 | 1291 | |
| 1286 | 1292 | /** |
| 1287 | 1293 | * v9fs_vfs_symlink - helper function to create symlinks |
| 1294 | + * @mnt_userns: The user namespace of the mount | |
| 1288 | 1295 | * @dir: directory inode containing symlink |
| 1289 | 1296 | * @dentry: dentry for symlink |
| 1290 | 1297 | * @symname: symlink data |
| @@ -1340,6 +1347,7 @@ v9fs_vfs_link(struct dentry *old_dentry, struct inode *dir, · 49 unmodified lines | ||
| 1340 | 1347 | |
| 1341 | 1348 | /** |
| 1342 | 1349 | * v9fs_vfs_mknod - create a special file |
| 1350 | + * @mnt_userns: The user namespace of the mount | |
| 1343 | 1351 | * @dir: inode destination for new link |
| 1344 | 1352 | * @dentry: dentry for file |
| 1345 | 1353 | * @mode: mode for creation |
| @@ -37,7 +37,10 @@ v9fs_vfs_mknod_dotl(struct user_namespace *mnt_userns, struct inode *dir, · 36 unmodified lines | ||
| 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 | */ |
| @@ -211,12 +214,13 @@ int v9fs_open_to_dotl_flags(int flags) · 167 unmodified lines | ||
| 211 | 214 | |
| 212 | 215 | /** |
| 213 | 216 | * v9fs_vfs_create_dotl - VFS hook to create files for 9P2000.L protocol. |
| 217 | + * @mnt_userns: The user namespace of the mount | |
| 214 | 218 | * @dir: directory inode that is being created |
| 215 | 219 | * @dentry: dentry that is being deleted |
| 216 | 220 | * @omode: create permissions |
| 221 | + * @excl: True if the file must not yet exist | |
| 217 | 222 | * |
| 218 | 223 | */ |
| 219 | − | |
| 220 | 224 | static int |
| 221 | 225 | v9fs_vfs_create_dotl(struct user_namespace *mnt_userns, struct inode *dir, |
| 222 | 226 | struct dentry *dentry, umode_t omode, bool excl) |
| @@ -361,6 +365,7 @@ err_clunk_old_fid: · 138 unmodified lines | ||
| 361 | 365 | |
| 362 | 366 | /** |
| 363 | 367 | * v9fs_vfs_mkdir_dotl - VFS mkdir hook to create a directory |
| 368 | + * @mnt_userns: The user namespace of the mount | |
| 364 | 369 | * @dir: inode that is being unlinked |
| 365 | 370 | * @dentry: dentry that is being unlinked |
| 366 | 371 | * @omode: mode for new directory |
| @@ -537,6 +542,7 @@ static int v9fs_mapped_iattr_valid(int iattr_valid) · 170 unmodified lines | ||
| 537 | 542 | |
| 538 | 543 | /** |
| 539 | 544 | * v9fs_vfs_setattr_dotl - set file metadata |
| 545 | + * @mnt_userns: The user namespace of the mount | |
| 540 | 546 | * @dentry: file whose metadata to set |
| 541 | 547 | * @iattr: metadata assignment structure |
| 542 | 548 | * |
| @@ -816,6 +822,7 @@ v9fs_vfs_link_dotl(struct dentry *old_dentry, struct inode *dir, · 273 unmodified lines | ||
| 816 | 822 | |
| 817 | 823 | /** |
| 818 | 824 | * v9fs_vfs_mknod_dotl - create a special file |
| 825 | + * @mnt_userns: The user namespace of the mount | |
| 819 | 826 | * @dir: inode destination for new link |
| 820 | 827 | * @dentry: dentry for file |
| 821 | 828 | * @omode: mode for creation |
| @@ -86,8 +86,8 @@ static int afs_do_silly_rename(struct afs_vnode *dvnode, struct afs_vnode *vnode · 85 unmodified lines | ||
| 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 |
| @@ -974,8 +974,7 @@ int afs_launder_page(struct page *page) · 973 unmodified lines | ||
| 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); |
| @@ -630,7 +630,7 @@ static unsigned long load_elf_interp(struct elfhdr *interp_elf_ex, · 629 unmodified lines | ||
| 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 | |
| @@ -528,7 +528,7 @@ void debugfs_create_file_size(const char *name, umode_t mode, · 527 unmodified lines | ||
| 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); |
| @@ -551,7 +551,7 @@ static int ext4_dx_readdir(struct file *file, struct dir_context *ctx) · 550 unmodified lines | ||
| 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,7 +599,7 @@ static int ext4_dx_readdir(struct file *file, struct dir_context *ctx) · 41 unmodified lines | ||
| 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,7 +630,7 @@ static int ext4_dx_readdir(struct file *file, struct dir_context *ctx) · 24 unmodified lines | ||
| 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) |
| @@ -3593,9 +3593,6 @@ extern int ext4_da_write_inline_data_begin(struct address_space *mapping, · 3592 unmodified lines | ||
| 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); |
| @@ -5916,7 +5916,7 @@ void ext4_ext_replay_shrink_inode(struct inode *inode, ext4_lblk_t end) · 5915 unmodified lines | ||
| 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,9 +5925,12 @@ static void skip_hole(struct inode *inode, ext4_lblk_t *cur) · 2 unmodified lines | ||
| 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 */ |
| @@ -5976,7 +5979,9 @@ int ext4_ext_replay_set_iblocks(struct inode *inode) · 42 unmodified lines | ||
| 5976 | 5979 | * iblocks by total number of differences found. |
| 5977 | 5980 | */ |
| 5978 | 5981 | cur = 0; |
| 5979 | − skip_hole(inode, &cur); | |
| 5982 | + ret = skip_hole(inode, &cur); | |
| 5983 | + if (ret < 0) | |
| 5984 | + goto out; | |
| 5980 | 5985 | path = ext4_find_extent(inode, cur, NULL, 0); |
| 5981 | 5986 | if (IS_ERR(path)) |
| 5982 | 5987 | goto out; |
| @@ -5995,8 +6000,12 @@ int ext4_ext_replay_set_iblocks(struct inode *inode) · 12 unmodified lines | ||
| 5995 | 6000 | } |
| 5996 | 6001 | cur = max(cur + 1, le32_to_cpu(ex->ee_block) + |
| 5997 | 6002 | ext4_ext_get_actual_len(ex)); |
| 5998 | − skip_hole(inode, &cur); | |
| 5999 | − | |
| 6003 | + ret = skip_hole(inode, &cur); | |
| 6004 | + if (ret < 0) { | |
| 6005 | + ext4_ext_drop_refs(path); | |
| 6006 | + kfree(path); | |
| 6007 | + break; | |
| 6008 | + } | |
| 6000 | 6009 | path2 = ext4_find_extent(inode, cur, NULL, 0); |
| 6001 | 6010 | if (IS_ERR(path2)) { |
| 6002 | 6011 | ext4_ext_drop_refs(path); |
| @@ -892,6 +892,12 @@ static int ext4_fc_write_inode_data(struct inode *inode, u32 *crc) · 891 unmodified lines | ||
| 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); |
| @@ -7,6 +7,7 @@ · 6 unmodified lines | ||
| 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" |
| @@ -733,45 +734,83 @@ convert: · 720 unmodified lines | ||
| 733 | 734 | int ext4_write_inline_data_end(struct inode *inode, loff_t pos, unsigned len, |
| 734 | 735 | unsigned copied, struct page *page) |
| 735 | 736 | { |
| 736 | − int ret, no_expand; | |
| 737 | + handle_t *handle = ext4_journal_current_handle(); | |
| 738 | + int no_expand; | |
| 737 | 739 | void *kaddr; |
| 738 | 740 | struct ext4_iloc iloc; |
| 741 | + int ret = 0, ret2; | |
| 742 | + | |
| 743 | + if (unlikely(copied < len) && !PageUptodate(page)) | |
| 744 | + copied = 0; | |
| 739 | 745 | |
| 740 | − if (unlikely(copied < len)) { | |
| 741 | − if (!PageUptodate(page)) { | |
| 742 | − copied = 0; | |
| 746 | + if (likely(copied)) { | |
| 747 | + ret = ext4_get_inode_loc(inode, &iloc); | |
| 748 | + if (ret) { | |
| 749 | + unlock_page(page); | |
| 750 | + put_page(page); | |
| 751 | + ext4_std_error(inode->i_sb, ret); | |
| 743 | 752 | goto out; |
| 744 | 753 | } |
| 745 | − } | |
| 754 | + ext4_write_lock_xattr(inode, &no_expand); | |
| 755 | + BUG_ON(!ext4_has_inline_data(inode)); | |
| 746 | 756 | |
| 747 | − ret = ext4_get_inode_loc(inode, &iloc); | |
| 748 | − if (ret) { | |
| 749 | − ext4_std_error(inode->i_sb, ret); | |
| 750 | − copied = 0; | |
| 751 | − goto out; | |
| 752 | − } | |
| 757 | + /* | |
| 758 | + * ei->i_inline_off may have changed since | |
| 759 | + * ext4_write_begin() called | |
| 760 | + * ext4_try_to_write_inline_data() | |
| 761 | + */ | |
| 762 | + (void) ext4_find_inline_data_nolock(inode); | |
| 753 | 763 | |
| 754 | − ext4_write_lock_xattr(inode, &no_expand); | |
| 755 | − BUG_ON(!ext4_has_inline_data(inode)); | |
| 764 | + kaddr = kmap_atomic(page); | |
| 765 | + ext4_write_inline_data(inode, &iloc, kaddr, pos, copied); | |
| 766 | + kunmap_atomic(kaddr); | |
| 767 | + SetPageUptodate(page); | |
| 768 | + /* clear page dirty so that writepages wouldn't work for us. */ | |
| 769 | + ClearPageDirty(page); | |
| 756 | 770 | |
| 757 | − /* | |
| 758 | − * ei->i_inline_off may have changed since ext4_write_begin() | |
| 759 | − * called ext4_try_to_write_inline_data() | |
| 760 | − */ | |
| 761 | − (void) ext4_find_inline_data_nolock(inode); | |
| 771 | + ext4_write_unlock_xattr(inode, &no_expand); | |
| 772 | + brelse(iloc.bh); | |
| 762 | 773 | |
| 763 | − kaddr = kmap_atomic(page); | |
| 764 | − ext4_write_inline_data(inode, &iloc, kaddr, pos, len); | |
| 765 | − kunmap_atomic(kaddr); | |
| 766 | − SetPageUptodate(page); | |
| 767 | − /* clear page dirty so that writepages wouldn't work for us. */ | |
| 768 | − ClearPageDirty(page); | |
| 774 | + /* | |
| 775 | + * It's important to update i_size while still holding page | |
| 776 | + * lock: page writeout could otherwise come in and zero | |
| 777 | + * beyond i_size. | |
| 778 | + */ | |
| 779 | + ext4_update_inode_size(inode, pos + copied); | |
| 780 | + } | |
| 781 | + unlock_page(page); | |
| 782 | + put_page(page); | |
| 769 | 783 | |
| 770 | − ext4_write_unlock_xattr(inode, &no_expand); | |
| 771 | − brelse(iloc.bh); | |
| 772 | − mark_inode_dirty(inode); | |
| 784 | + /* | |
| 785 | + * Don't mark the inode dirty under page lock. First, it unnecessarily | |
| 786 | + * makes the holding time of page lock longer. Second, it forces lock | |
| 787 | + * ordering of page lock and transaction start for journaling | |
| 788 | + * filesystems. | |
| 789 | + */ | |
| 790 | + if (likely(copied)) | |
| 791 | + mark_inode_dirty(inode); | |
| 773 | 792 | out: |
| 774 | − return copied; | |
| 793 | + /* | |
| 794 | + * If we didn't copy as much data as expected, we need to trim back | |
| 795 | + * size of xattr containing inline data. | |
| 796 | + */ | |
| 797 | + if (pos + len > inode->i_size && ext4_can_truncate(inode)) | |
| 798 | + ext4_orphan_add(handle, inode); | |
| 799 | + | |
| 800 | + ret2 = ext4_journal_stop(handle); | |
| 801 | + if (!ret) | |
| 802 | + ret = ret2; | |
| 803 | + if (pos + len > inode->i_size) { | |
| 804 | + ext4_truncate_failed_write(inode); | |
| 805 | + /* | |
| 806 | + * If truncate failed early the inode might still be | |
| 807 | + * on the orphan list; we need to make sure the inode | |
| 808 | + * is removed from the orphan list in that case. | |
| 809 | + */ | |
| 810 | + if (inode->i_nlink) | |
| 811 | + ext4_orphan_del(NULL, inode); | |
| 812 | + } | |
| 813 | + return ret ? ret : copied; | |
| 775 | 814 | } |
| 776 | 815 | |
| 777 | 816 | struct buffer_head * |
| @@ -953,43 +992,6 @@ out: · 175 unmodified lines | ||
| 953 | 992 | return ret; |
| 954 | 993 | } |
| 955 | 994 | |
| 956 | −int ext4_da_write_inline_data_end(struct inode *inode, loff_t pos, | |
| 957 | − unsigned len, unsigned copied, | |
| 958 | − struct page *page) | |
| 959 | −{ | |
| 960 | − int ret; | |
| 961 | − | |
| 962 | − ret = ext4_write_inline_data_end(inode, pos, len, copied, page); | |
| 963 | − if (ret < 0) { | |
| 964 | − unlock_page(page); | |
| 965 | − put_page(page); | |
| 966 | − return ret; | |
| 967 | − } | |
| 968 | − copied = ret; | |
| 969 | − | |
| 970 | − /* | |
| 971 | − * No need to use i_size_read() here, the i_size | |
| 972 | − * cannot change under us because we hold i_mutex. | |
| 973 | − * | |
| 974 | − * But it's important to update i_size while still holding page lock: | |
| 975 | − * page writeout could otherwise come in and zero beyond i_size. | |
| 976 | − */ | |
| 977 | − if (pos+copied > inode->i_size) | |
| 978 | − i_size_write(inode, pos+copied); | |
| 979 | − unlock_page(page); | |
| 980 | − put_page(page); | |
| 981 | − | |
| 982 | − /* | |
| 983 | − * Don't mark the inode dirty under page lock. First, it unnecessarily | |
| 984 | − * makes the holding time of page lock longer. Second, it forces lock | |
| 985 | − * ordering of page lock and transaction start for journaling | |
| 986 | − * filesystems. | |
| 987 | − */ | |
| 988 | − mark_inode_dirty(inode); | |
| 989 | − | |
| 990 | − return copied; | |
| 991 | −} | |
| 992 | − | |
| 993 | 995 | #ifdef INLINE_DIR_DEBUG |
| 994 | 996 | void ext4_show_inline_dir(struct inode *dir, struct buffer_head *bh, |
| 995 | 997 | void *inline_start, int inline_size) |
| @@ -1917,6 +1919,24 @@ int ext4_inline_data_truncate(struct inode *inode, int *has_inline) · 921 unmodified lines | ||
| 1917 | 1919 | EXT4_I(inode)->i_disksize = i_size; |
| 1918 | 1920 | |
| 1919 | 1921 | if (i_size < inline_size) { |
| 1922 | + /* | |
| 1923 | + * if there's inline data to truncate and this file was | |
| 1924 | + * converted to extents after that inline data was written, | |
| 1925 | + * the extent status cache must be cleared to avoid leaving | |
| 1926 | + * behind stale delayed allocated extent entries | |
| 1927 | + */ | |
| 1928 | + if (!ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA)) { | |
| 1929 | +retry: | |
| 1930 | + err = ext4_es_remove_extent(inode, 0, EXT_MAX_BLOCKS); | |
| 1931 | + if (err == -ENOMEM) { | |
| 1932 | + cond_resched(); | |
| 1933 | + congestion_wait(BLK_RW_ASYNC, HZ/50); | |
| 1934 | + goto retry; | |
| 1935 | + } | |
| 1936 | + if (err) | |
| 1937 | + goto out_error; | |
| 1938 | + } | |
| 1939 | + | |
| 1920 | 1940 | /* Clear the content in the xattr space. */ |
| 1921 | 1941 | if (inline_size > EXT4_MIN_INLINE_DATA_SIZE) { |
| 1922 | 1942 | if ((err = ext4_xattr_ibody_find(inode, &i, &is)) != 0) |
| @@ -1284,22 +1284,14 @@ static int ext4_write_end(struct file *file, · 1283 unmodified lines | ||
| 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. |
| @@ -1320,7 +1312,7 @@ static int ext4_write_end(struct file *file, · 14 unmodified lines | ||
| 1320 | 1312 | * ordering of page lock and transaction start for journaling |
| 1321 | 1313 | * filesystems. |
| 1322 | 1314 | */ |
| 1323 | − if (i_size_changed || inline_data) | |
| 1315 | + if (i_size_changed) | |
| 1324 | 1316 | ret = ext4_mark_inode_dirty(handle, inode); |
| 1325 | 1317 | |
| 1326 | 1318 | if (pos + len > inode->i_size && !verity && ext4_can_truncate(inode)) |
| @@ -1329,7 +1321,7 @@ static int ext4_write_end(struct file *file, · 2 unmodified lines | ||
| 1329 | 1321 | * inode->i_size. So truncate them |
| 1330 | 1322 | */ |
| 1331 | 1323 | ext4_orphan_add(handle, inode); |
| 1332 | −errout: | |
| 1324 | + | |
| 1333 | 1325 | ret2 = ext4_journal_stop(handle); |
| 1334 | 1326 | if (!ret) |
| 1335 | 1327 | ret = ret2; |
| @@ -1395,7 +1387,6 @@ static int ext4_journalled_write_end(struct file *file, · 59 unmodified lines | ||
| 1395 | 1387 | int partial = 0; |
| 1396 | 1388 | unsigned from, to; |
| 1397 | 1389 | int size_changed = 0; |
| 1398 | − int inline_data = ext4_has_inline_data(inode); | |
| 1399 | 1390 | bool verity = ext4_verity_in_progress(inode); |
| 1400 | 1391 | |
| 1401 | 1392 | trace_ext4_journalled_write_end(inode, pos, len, copied); |
| @@ -1404,16 +1395,10 @@ static int ext4_journalled_write_end(struct file *file, · 2 unmodified lines | ||
| 1404 | 1395 | |
| 1405 | 1396 | BUG_ON(!ext4_handle_valid(handle)); |
| 1406 | 1397 | |
| 1407 | − if (inline_data) { | |
| 1408 | − ret = ext4_write_inline_data_end(inode, pos, len, | |
| 1409 | − copied, page); | |
| 1410 | − if (ret < 0) { | |
| 1411 | − unlock_page(page); | |
| 1412 | − put_page(page); | |
| 1413 | − goto errout; | |
| 1414 | − } | |
| 1415 | − copied = ret; | |
| 1416 | − } else if (unlikely(copied < len) && !PageUptodate(page)) { | |
| 1398 | + if (ext4_has_inline_data(inode)) | |
| 1399 | + return ext4_write_inline_data_end(inode, pos, len, copied, page); | |
| 1400 | + | |
| 1401 | + if (unlikely(copied < len) && !PageUptodate(page)) { | |
| 1417 | 1402 | copied = 0; |
| 1418 | 1403 | ext4_journalled_zero_new_buffers(handle, inode, page, from, to); |
| 1419 | 1404 | } else { |
| @@ -1436,7 +1421,7 @@ static int ext4_journalled_write_end(struct file *file, · 16 unmodified lines | ||
| 1436 | 1421 | if (old_size < pos && !verity) |
| 1437 | 1422 | pagecache_isize_extended(inode, old_size, pos); |
| 1438 | 1423 | |
| 1439 | − if (size_changed || inline_data) { | |
| 1424 | + if (size_changed) { | |
| 1440 | 1425 | ret2 = ext4_mark_inode_dirty(handle, inode); |
| 1441 | 1426 | if (!ret) |
| 1442 | 1427 | ret = ret2; |
| @@ -1449,7 +1434,6 @@ static int ext4_journalled_write_end(struct file *file, · 6 unmodified lines | ||
| 1449 | 1434 | */ |
| 1450 | 1435 | ext4_orphan_add(handle, inode); |
| 1451 | 1436 | |
| 1452 | −errout: | |
| 1453 | 1437 | ret2 = ext4_journal_stop(handle); |
| 1454 | 1438 | if (!ret) |
| 1455 | 1439 | ret = ret2; |
| @@ -1644,6 +1628,7 @@ static int ext4_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk) · 188 unmodified lines | ||
| 1644 | 1628 | struct ext4_sb_info *sbi = EXT4_SB(inode->i_sb); |
| 1645 | 1629 | int ret; |
| 1646 | 1630 | bool allocated = false; |
| 1631 | + bool reserved = false; | |
| 1647 | 1632 | |
| 1648 | 1633 | /* |
| 1649 | 1634 | * If the cluster containing lblk is shared with a delayed, |
| @@ -1660,6 +1645,7 @@ static int ext4_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk) · 10 unmodified lines | ||
| 1660 | 1645 | ret = ext4_da_reserve_space(inode); |
| 1661 | 1646 | if (ret != 0) /* ENOSPC */ |
| 1662 | 1647 | goto errout; |
| 1648 | + reserved = true; | |
| 1663 | 1649 | } else { /* bigalloc */ |
| 1664 | 1650 | if (!ext4_es_scan_clu(inode, &ext4_es_is_delonly, lblk)) { |
| 1665 | 1651 | if (!ext4_es_scan_clu(inode, |
| @@ -1672,6 +1658,7 @@ static int ext4_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk) · 6 unmodified lines | ||
| 1672 | 1658 | ret = ext4_da_reserve_space(inode); |
| 1673 | 1659 | if (ret != 0) /* ENOSPC */ |
| 1674 | 1660 | goto errout; |
| 1661 | + reserved = true; | |
| 1675 | 1662 | } else { |
| 1676 | 1663 | allocated = true; |
| 1677 | 1664 | } |
| @@ -1682,6 +1669,8 @@ static int ext4_insert_delayed_block(struct inode *inode, ext4_lblk_t lblk) · 4 unmodified lines | ||
| 1682 | 1669 | } |
| 1683 | 1670 | |
| 1684 | 1671 | ret = ext4_es_insert_delayed_block(inode, lblk, allocated); |
| 1672 | + if (ret && reserved) | |
| 1673 | + ext4_da_release_space(inode, 1); | |
| 1685 | 1674 | |
| 1686 | 1675 | errout: |
| 1687 | 1676 | return ret; |
| @@ -1722,13 +1711,16 @@ static int ext4_da_map_blocks(struct inode *inode, sector_t iblock, · 34 unmodified lines | ||
| 1722 | 1711 | } |
| 1723 | 1712 | |
| 1724 | 1713 | /* |
| 1725 | − * Delayed extent could be allocated by fallocate. | |
| 1726 | − * So we need to check it. | |
| 1714 | + * the buffer head associated with a delayed and not unwritten | |
| 1715 | + * block found in the extent status cache must contain an | |
| 1716 | + * invalid block number and have its BH_New and BH_Delay bits | |
| 1717 | + * set, reflecting the state assigned when the block was | |
| 1718 | + * initially delayed allocated | |
| 1727 | 1719 | */ |
| 1728 | − if (ext4_es_is_delayed(&es) && !ext4_es_is_unwritten(&es)) { | |
| 1729 | − map_bh(bh, inode->i_sb, invalid_block); | |
| 1730 | − set_buffer_new(bh); | |
| 1731 | − set_buffer_delay(bh); | |
| 1720 | + if (ext4_es_is_delonly(&es)) { | |
| 1721 | + BUG_ON(bh->b_blocknr != invalid_block); | |
| 1722 | + BUG_ON(!buffer_new(bh)); | |
| 1723 | + BUG_ON(!buffer_delay(bh)); | |
| 1732 | 1724 | return 0; |
| 1733 | 1725 | } |
| 1734 | 1726 | |
| @@ -2932,19 +2924,6 @@ static int ext4_nonda_switch(struct super_block *sb) · 1197 unmodified lines | ||
| 2932 | 2924 | return 0; |
| 2933 | 2925 | } |
| 2934 | 2926 | |
| 2935 | −/* We always reserve for an inode update; the superblock could be there too */ | |
| 2936 | −static int ext4_da_write_credits(struct inode *inode, loff_t pos, unsigned len) | |
| 2937 | −{ | |
| 2938 | − if (likely(ext4_has_feature_large_file(inode->i_sb))) | |
| 2939 | − return 1; | |
| 2940 | − | |
| 2941 | − if (pos + len <= 0x7fffffffULL) | |
| 2942 | − return 1; | |
| 2943 | − | |
| 2944 | − /* We might need to update the superblock to set LARGE_FILE */ | |
| 2945 | − return 2; | |
| 2946 | −} | |
| 2947 | − | |
| 2948 | 2927 | static int ext4_da_write_begin(struct file *file, struct address_space *mapping, |
| 2949 | 2928 | loff_t pos, unsigned len, unsigned flags, |
| 2950 | 2929 | struct page **pagep, void **fsdata) |
| @@ -2953,7 +2932,6 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping, · 2 unmodified lines | ||
| 2953 | 2932 | struct page *page; |
| 2954 | 2933 | pgoff_t index; |
| 2955 | 2934 | struct inode *inode = mapping->host; |
| 2956 | − handle_t *handle; | |
| 2957 | 2935 | |
| 2958 | 2936 | if (unlikely(ext4_forced_shutdown(EXT4_SB(inode->i_sb)))) |
| 2959 | 2937 | return -EIO; |
| @@ -2979,41 +2957,11 @@ static int ext4_da_write_begin(struct file *file, struct address_space *mapping, · 19 unmodified lines | ||
| 2979 | 2957 | return 0; |
| 2980 | 2958 | } |
| 2981 | 2959 | |
| 2982 | − /* | |
| 2983 | − * grab_cache_page_write_begin() can take a long time if the | |
| 2984 | − * system is thrashing due to memory pressure, or if the page | |
| 2985 | − * is being written back. So grab it first before we start | |
| 2986 | − * the transaction handle. This also allows us to allocate | |
| 2987 | − * the page (if needed) without using GFP_NOFS. | |
| 2988 | − */ | |
| 2989 | −retry_grab: | |
| 2960 | +retry: | |
| 2990 | 2961 | page = grab_cache_page_write_begin(mapping, index, flags); |
| 2991 | 2962 | if (!page) |
| 2992 | 2963 | return -ENOMEM; |
| 2993 | − unlock_page(page); | |
| 2994 | 2964 | |
| 2995 | − /* | |
| 2996 | − * With delayed allocation, we don't log the i_disksize update | |
| 2997 | − * if there is delayed block allocation. But we still need | |
| 2998 | − * to journalling the i_disksize update if writes to the end | |
| 2999 | − * of file which has an already mapped buffer. | |
| 3000 | − */ | |
| 3001 | −retry_journal: | |
| 3002 | − handle = ext4_journal_start(inode, EXT4_HT_WRITE_PAGE, | |
| 3003 | − ext4_da_write_credits(inode, pos, len)); | |
| 3004 | − if (IS_ERR(handle)) { | |
| 3005 | − put_page(page); | |
| 3006 | − return PTR_ERR(handle); | |
| 3007 | − } | |
| 3008 | − | |
| 3009 | − lock_page(page); | |
| 3010 | − if (page->mapping != mapping) { | |
| 3011 | − /* The page got truncated from under us */ | |
| 3012 | − unlock_page(page); | |
| 3013 | − put_page(page); | |
| 3014 | − ext4_journal_stop(handle); | |
| 3015 | − goto retry_grab; | |
| 3016 | − } | |
| 3017 | 2965 | /* In case writeback began while the page was unlocked */ |
| 3018 | 2966 | wait_for_stable_page(page); |
| 3019 | 2967 | |
| @@ -3025,20 +2973,18 @@ retry_journal: · 5 unmodified lines | ||
| 3025 | 2973 | #endif |
| 3026 | 2974 | if (ret < 0) { |
| 3027 | 2975 | unlock_page(page); |
| 3028 | − ext4_journal_stop(handle); | |
| 2976 | + put_page(page); | |
| 3029 | 2977 | /* |
| 3030 | 2978 | * block_write_begin may have instantiated a few blocks |
| 3031 | 2979 | * outside i_size. Trim these off again. Don't need |
| 3032 | − * i_size_read because we hold i_mutex. | |
| 2980 | + * i_size_read because we hold inode lock. | |
| 3033 | 2981 | */ |
| 3034 | 2982 | if (pos + len > inode->i_size) |
| 3035 | 2983 | ext4_truncate_failed_write(inode); |
| 3036 | 2984 | |
| 3037 | 2985 | if (ret == -ENOSPC && |
| 3038 | 2986 | ext4_should_retry_alloc(inode->i_sb, &retries)) |
| 3039 | − goto retry_journal; | |
| 3040 | − | |
| 3041 | − put_page(page); | |
| 2987 | + goto retry; | |
| 3042 | 2988 | return ret; |
| 3043 | 2989 | } |
| 3044 | 2990 | |
| @@ -3075,8 +3021,6 @@ static int ext4_da_write_end(struct file *file, · 30 unmodified lines | ||
| 3075 | 3021 | struct page *page, void *fsdata) |
| 3076 | 3022 | { |
| 3077 | 3023 | struct inode *inode = mapping->host; |
| 3078 | − int ret = 0, ret2; | |
| 3079 | − handle_t *handle = ext4_journal_current_handle(); | |
| 3080 | 3024 | loff_t new_i_size; |
| 3081 | 3025 | unsigned long start, end; |
| 3082 | 3026 | int write_mode = (int)(unsigned long)fsdata; |
| @@ -3086,44 +3030,36 @@ static int ext4_da_write_end(struct file *file, · 3 unmodified lines | ||
| 3086 | 3030 | len, copied, page, fsdata); |
| 3087 | 3031 | |
| 3088 | 3032 | trace_ext4_da_write_end(inode, pos, len, copied); |
| 3033 | + | |
| 3034 | + if (write_mode != CONVERT_INLINE_DATA && | |
| 3035 | + ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA) && | |
| 3036 | + ext4_has_inline_data(inode)) | |
| 3037 | + return ext4_write_inline_data_end(inode, pos, len, copied, page); | |
| 3038 | + | |
| 3089 | 3039 | start = pos & (PAGE_SIZE - 1); |
| 3090 | 3040 | end = start + copied - 1; |
| 3091 | 3041 | |
| 3092 | 3042 | /* |
| 3093 | − * generic_write_end() will run mark_inode_dirty() if i_size | |
| 3094 | − * changes. So let's piggyback the i_disksize mark_inode_dirty | |
| 3095 | − * into that. | |
| 3043 | + * Since we are holding inode lock, we are sure i_disksize <= | |
| 3044 | + * i_size. We also know that if i_disksize < i_size, there are | |
| 3045 | + * delalloc writes pending in the range upto i_size. If the end of | |
| 3046 | + * the current write is <= i_size, there's no need to touch | |
| 3047 | + * i_disksize since writeback will push i_disksize upto i_size | |
| 3048 | + * eventually. If the end of the current write is > i_size and | |
| 3049 | + * inside an allocated block (ext4_da_should_update_i_disksize() | |
| 3050 | + * check), we need to update i_disksize here as neither | |
| 3051 | + * ext4_writepage() nor certain ext4_writepages() paths not | |
| 3052 | + * allocating blocks update i_disksize. | |
| 3053 | + * | |
| 3054 | + * Note that we defer inode dirtying to generic_write_end() / | |
| 3055 | + * ext4_da_write_inline_data_end(). | |
| 3096 | 3056 | */ |
| 3097 | 3057 | new_i_size = pos + copied; |
| 3098 | − if (copied && new_i_size > EXT4_I(inode)->i_disksize) { | |
| 3099 | − if (ext4_has_inline_data(inode) || | |
| 3100 | − ext4_da_should_update_i_disksize(page, end)) { | |
| 3101 | − ext4_update_i_disksize(inode, new_i_size); | |
| 3102 | − /* We need to mark inode dirty even if | |
| 3103 | − * new_i_size is less that inode->i_size | |
| 3104 | − * bu greater than i_disksize.(hint delalloc) | |
| 3105 | − */ | |
| 3106 | − ret = ext4_mark_inode_dirty(handle, inode); | |
| 3107 | − } | |
| 3108 | − } | |
| 3058 | + if (copied && new_i_size > inode->i_size && | |
| 3059 | + ext4_da_should_update_i_disksize(page, end)) | |
| 3060 | + ext4_update_i_disksize(inode, new_i_size); | |
| 3109 | 3061 | |
| 3110 | − if (write_mode != CONVERT_INLINE_DATA && | |
| 3111 | − ext4_test_inode_state(inode, EXT4_STATE_MAY_INLINE_DATA) && | |
| 3112 | − ext4_has_inline_data(inode)) | |
| 3113 | − ret2 = ext4_da_write_inline_data_end(inode, pos, len, copied, | |
| 3114 | − page); | |
| 3115 | − else | |
| 3116 | − ret2 = generic_write_end(file, mapping, pos, len, copied, | |
| 3117 | − page, fsdata); | |
| 3118 | − | |
| 3119 | − copied = ret2; | |
| 3120 | − if (ret2 < 0) | |
| 3121 | − ret = ret2; | |
| 3122 | − ret2 = ext4_journal_stop(handle); | |
| 3123 | − if (unlikely(ret2 && !ret)) | |
| 3124 | − ret = ret2; | |
| 3125 | − | |
| 3126 | − return ret ? ret : copied; | |
| 3062 | + return generic_write_end(file, mapping, pos, len, copied, page, fsdata); | |
| 3127 | 3063 | } |
| 3128 | 3064 | |
| 3129 | 3065 | /* |
| @@ -4340,6 +4276,12 @@ static int __ext4_get_inode_loc(struct super_block *sb, unsigned long ino, · 1210 unmodified lines | ||
| 4340 | 4276 | goto has_buffer; |
| 4341 | 4277 | |
| 4342 | 4278 | lock_buffer(bh); |
| 4279 | + if (ext4_buffer_uptodate(bh)) { | |
| 4280 | + /* Someone brought it uptodate while we waited */ | |
| 4281 | + unlock_buffer(bh); | |
| 4282 | + goto has_buffer; | |
| 4283 | + } | |
| 4284 | + | |
| 4343 | 4285 | /* |
| 4344 | 4286 | * If we have all information of the inode in memory and this |
| 4345 | 4287 | * is the only valid inode in the block, we need not read the |
| @@ -658,7 +658,7 @@ static void ext4_handle_error(struct super_block *sb, bool force_ro, int error, · 657 unmodified lines | ||
| 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,6 +1350,12 @@ static void ext4_destroy_inode(struct inode *inode) · 685 unmodified lines | ||
| 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) |
| @@ -3021,17 +3027,17 @@ static loff_t ext4_max_size(int blkbits, int has_huge_files) · 1665 unmodified lines | ||
| 3021 | 3027 | */ |
| 3022 | 3028 | static loff_t ext4_max_bitmap_size(int bits, int has_huge_files) |
| 3023 | 3029 | { |
| 3024 | − loff_t res = EXT4_NDIR_BLOCKS; | |
| 3030 | + unsigned long long upper_limit, res = EXT4_NDIR_BLOCKS; | |
| 3025 | 3031 | int meta_blocks; |
| 3026 | − loff_t upper_limit; | |
| 3027 | − /* This is calculated to be the largest file size for a dense, block | |
| 3032 | + | |
| 3033 | + /* | |
| 3034 | + * This is calculated to be the largest file size for a dense, block | |
| 3028 | 3035 | * mapped file such that the file's total number of 512-byte sectors, |
| 3029 | 3036 | * including data and all indirect blocks, does not exceed (2^48 - 1). |
| 3030 | 3037 | * |
| 3031 | 3038 | * __u32 i_blocks_lo and _u16 i_blocks_high represent the total |
| 3032 | 3039 | * number of 512-byte sectors of the file. |
| 3033 | 3040 | */ |
| 3034 | − | |
| 3035 | 3041 | if (!has_huge_files) { |
| 3036 | 3042 | /* |
| 3037 | 3043 | * !has_huge_files or implies that the inode i_block field |
| @@ -3074,7 +3080,7 @@ static loff_t ext4_max_bitmap_size(int bits, int has_huge_files) · 36 unmodified lines | ||
| 3074 | 3080 | if (res > MAX_LFS_FILESIZE) |
| 3075 | 3081 | res = MAX_LFS_FILESIZE; |
| 3076 | 3082 | |
| 3077 | − return res; | |
| 3083 | + return (loff_t)res; | |
| 3078 | 3084 | } |
| 3079 | 3085 | |
| 3080 | 3086 | static ext4_fsblk_t descriptor_loc(struct super_block *sb, |
| @@ -5042,12 +5048,15 @@ failed_mount_wq: · 1961 unmodified lines | ||
| 5042 | 5048 | sbi->s_ea_block_cache = NULL; |
| 5043 | 5049 | |
| 5044 | 5050 | if (sbi->s_journal) { |
| 5051 | + /* flush s_error_work before journal destroy. */ | |
| 5052 | + flush_work(&sbi->s_error_work); | |
| 5045 | 5053 | jbd2_journal_destroy(sbi->s_journal); |
| 5046 | 5054 | sbi->s_journal = NULL; |
| 5047 | 5055 | } |
| 5048 | 5056 | failed_mount3a: |
| 5049 | 5057 | ext4_es_unregister_shrinker(sbi); |
| 5050 | 5058 | failed_mount3: |
| 5059 | + /* flush s_error_work before sbi destroy */ | |
| 5051 | 5060 | flush_work(&sbi->s_error_work); |
| 5052 | 5061 | del_timer_sync(&sbi->s_err_report); |
| 5053 | 5062 | ext4_stop_mmpd(sbi); |
| @@ -77,7 +77,6 @@ static WORK_STATE(INIT_OBJECT, "INIT", fscache_initialise_object); · 76 unmodified lines | ||
| 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 | |
| @@ -907,6 +906,7 @@ static void fscache_dequeue_object(struct fscache_object *object) · 823 unmodified lines | ||
| 907 | 906 | * @object: The object to ask about |
| 908 | 907 | * @data: The auxiliary data for the object |
| 909 | 908 | * @datalen: The size of the auxiliary data |
| 909 | + * @object_size: The size of the object according to the server. | |
| 910 | 910 | * |
| 911 | 911 | * This function consults the netfs about the coherency state of an object. |
| 912 | 912 | * The caller must be holding a ref on cookie->n_active (held by |
| @@ -22,7 +22,10 @@ static void fscache_operation_dummy_cancel(struct fscache_operation *op) · 21 unmodified lines | ||
| 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, |
| @@ -584,10 +584,7 @@ loop: · 583 unmodified lines | ||
| 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 | } |
| @@ -403,7 +403,6 @@ struct io_ring_ctx { · 402 unmodified lines | ||
| 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 | |
| @@ -1614,10 +1613,8 @@ static void io_cqring_ev_posted(struct io_ring_ctx *ctx) · 1204 unmodified lines | ||
| 1614 | 1613 | wake_up(&ctx->sq_data->wait); |
| 1615 | 1614 | if (io_should_trigger_evfd(ctx)) |
| 1616 | 1615 | eventfd_signal(ctx->cq_ev_fd, 1); |
| 1617 | − if (waitqueue_active(&ctx->poll_wait)) { | |
| 1616 | + if (waitqueue_active(&ctx->poll_wait)) | |
| 1618 | 1617 | wake_up_interruptible(&ctx->poll_wait); |
| 1619 | − kill_fasync(&ctx->cq_fasync, SIGIO, POLL_IN); | |
| 1620 | − } | |
| 1621 | 1618 | } |
| 1622 | 1619 | |
| 1623 | 1620 | static void io_cqring_ev_posted_iopoll(struct io_ring_ctx *ctx) |
| @@ -1631,10 +1628,8 @@ static void io_cqring_ev_posted_iopoll(struct io_ring_ctx *ctx) · 7 unmodified lines | ||
| 1631 | 1628 | } |
| 1632 | 1629 | if (io_should_trigger_evfd(ctx)) |
| 1633 | 1630 | eventfd_signal(ctx->cq_ev_fd, 1); |
| 1634 | − if (waitqueue_active(&ctx->poll_wait)) { | |
| 1631 | + if (waitqueue_active(&ctx->poll_wait)) | |
| 1635 | 1632 | wake_up_interruptible(&ctx->poll_wait); |
| 1636 | − kill_fasync(&ctx->cq_fasync, SIGIO, POLL_IN); | |
| 1637 | − } | |
| 1638 | 1633 | } |
| 1639 | 1634 | |
| 1640 | 1635 | /* Returns true if there are no backlogged entries after the flush */ |
| @@ -9345,13 +9340,6 @@ static __poll_t io_uring_poll(struct file *file, poll_table *wait) · 7704 unmodified lines | ||
| 9345 | 9340 | return mask; |
| 9346 | 9341 | } |
| 9347 | 9342 | |
| 9348 | −static int io_uring_fasync(int fd, struct file *file, int on) | |
| 9349 | −{ | |
| 9350 | − struct io_ring_ctx *ctx = file->private_data; | |
| 9351 | − | |
| 9352 | − return fasync_helper(fd, file, on, &ctx->cq_fasync); | |
| 9353 | −} | |
| 9354 | − | |
| 9355 | 9343 | static int io_unregister_personality(struct io_ring_ctx *ctx, unsigned id) |
| 9356 | 9344 | { |
| 9357 | 9345 | const struct cred *creds; |
| @@ -10145,7 +10133,6 @@ static const struct file_operations io_uring_fops = { · 787 unmodified lines | ||
| 10145 | 10133 | .mmap_capabilities = io_uring_nommu_mmap_capabilities, |
| 10146 | 10134 | #endif |
| 10147 | 10135 | .poll = io_uring_poll, |
| 10148 | − .fasync = io_uring_fasync, | |
| 10149 | 10136 | #ifdef CONFIG_PROC_FS |
| 10150 | 10137 | .show_fdinfo = io_uring_show_fdinfo, |
| 10151 | 10138 | #endif |
| @@ -1116,8 +1116,13 @@ static struct dentry *kernfs_iop_lookup(struct inode *dir, · 1115 unmodified lines | ||
| 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 | |
| @@ -68,125 +68,6 @@ void ksmbd_copy_gss_neg_header(void *buf) · 67 unmodified lines | ||
| 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 |
| @@ -324,43 +205,6 @@ out: · 131 unmodified lines | ||
| 324 | 205 | return ret; |
| 325 | 206 | } |
| 326 | 207 | |
| 327 | −/** | |
| 328 | − * ksmbd_auth_ntlm() - NTLM authentication handler | |
| 329 | − * @sess: session of connection | |
| 330 | − * @pw_buf: NTLM challenge response | |
| 331 | − * @passkey: user password | |
| 332 | − * | |
| 333 | − * Return: 0 on success, error number on error | |
| 334 | − */ | |
| 335 | −int ksmbd_auth_ntlm(struct ksmbd_session *sess, char *pw_buf) | |
| 336 | −{ | |
| 337 | − int rc; | |
| 338 | − unsigned char p21[21]; | |
| 339 | − char key[CIFS_AUTH_RESP_SIZE]; | |
| 340 | − | |
| 341 | − memset(p21, '\0', 21); | |
| 342 | − memcpy(p21, user_passkey(sess->user), CIFS_NTHASH_SIZE); | |
| 343 | − rc = ksmbd_enc_p24(p21, sess->ntlmssp.cryptkey, key); | |
| 344 | − if (rc) { | |
| 345 | − pr_err("password processing failed\n"); | |
| 346 | − return rc; | |
| 347 | − } | |
| 348 | − | |
| 349 | − ksmbd_enc_md4(sess->sess_key, user_passkey(sess->user), | |
| 350 | − CIFS_SMB1_SESSKEY_SIZE); | |
| 351 | − memcpy(sess->sess_key + CIFS_SMB1_SESSKEY_SIZE, key, | |
| 352 | − CIFS_AUTH_RESP_SIZE); | |
| 353 | − sess->sequence_number = 1; | |
| 354 | − | |
| 355 | − if (strncmp(pw_buf, key, CIFS_AUTH_RESP_SIZE) != 0) { | |
| 356 | − ksmbd_debug(AUTH, "ntlmv1 authentication failed\n"); | |
| 357 | − return -EINVAL; | |
| 358 | − } | |
| 359 | − | |
| 360 | − ksmbd_debug(AUTH, "ntlmv1 authentication pass\n"); | |
| 361 | − return 0; | |
| 362 | −} | |
| 363 | − | |
| 364 | 208 | /** |
| 365 | 209 | * ksmbd_auth_ntlmv2() - NTLMv2 authentication handler |
| 366 | 210 | * @sess: session of connection |
| @@ -441,44 +285,6 @@ out: · 74 unmodified lines | ||
| 441 | 285 | return rc; |
| 442 | 286 | } |
| 443 | 287 | |
| 444 | −/** | |
| 445 | − * __ksmbd_auth_ntlmv2() - NTLM2(extended security) authentication handler | |
| 446 | − * @sess: session of connection | |
| 447 | − * @client_nonce: client nonce from LM response. | |
| 448 | − * @ntlm_resp: ntlm response data from client. | |
| 449 | − * | |
| 450 | − * Return: 0 on success, error number on error | |
| 451 | − */ | |
| 452 | −static int __ksmbd_auth_ntlmv2(struct ksmbd_session *sess, char *client_nonce, | |
| 453 | − char *ntlm_resp) | |
| 454 | −{ | |
| 455 | − char sess_key[CIFS_SMB1_SESSKEY_SIZE] = {0}; | |
| 456 | − int rc; | |
| 457 | − unsigned char p21[21]; | |
| 458 | − char key[CIFS_AUTH_RESP_SIZE]; | |
| 459 | − | |
| 460 | − rc = ksmbd_enc_update_sess_key(sess_key, | |
| 461 | − client_nonce, | |
| 462 | − (char *)sess->ntlmssp.cryptkey, 8); | |
| 463 | − if (rc) { | |
| 464 | − pr_err("password processing failed\n"); | |
| 465 | − goto out; | |
| 466 | − } | |
| 467 | − | |
| 468 | − memset(p21, '\0', 21); | |
| 469 | − memcpy(p21, user_passkey(sess->user), CIFS_NTHASH_SIZE); | |
| 470 | − rc = ksmbd_enc_p24(p21, sess_key, key); | |
| 471 | − if (rc) { | |
| 472 | − pr_err("password processing failed\n"); | |
| 473 | − goto out; | |
| 474 | − } | |
| 475 | − | |
| 476 | − if (memcmp(ntlm_resp, key, CIFS_AUTH_RESP_SIZE) != 0) | |
| 477 | − rc = -EINVAL; | |
| 478 | −out: | |
| 479 | − return rc; | |
| 480 | −} | |
| 481 | − | |
| 482 | 288 | /** |
| 483 | 289 | * ksmbd_decode_ntlmssp_auth_blob() - helper function to construct |
| 484 | 290 | * authenticate blob |
| @@ -512,17 +318,6 @@ int ksmbd_decode_ntlmssp_auth_blob(struct authenticate_message *authblob, · 27 unmodified lines | ||
| 512 | 318 | nt_off = le32_to_cpu(authblob->NtChallengeResponse.BufferOffset); |
| 513 | 319 | nt_len = le16_to_cpu(authblob->NtChallengeResponse.Length); |
| 514 | 320 | |
| 515 | − /* process NTLM authentication */ | |
| 516 | − if (nt_len == CIFS_AUTH_RESP_SIZE) { | |
| 517 | − if (le32_to_cpu(authblob->NegotiateFlags) & | |
| 518 | − NTLMSSP_NEGOTIATE_EXTENDED_SEC) | |
| 519 | − return __ksmbd_auth_ntlmv2(sess, (char *)authblob + | |
| 520 | − lm_off, (char *)authblob + nt_off); | |
| 521 | − else | |
| 522 | − return ksmbd_auth_ntlm(sess, (char *)authblob + | |
| 523 | − nt_off); | |
| 524 | − } | |
| 525 | − | |
| 526 | 321 | /* TODO : use domain name that imported from configuration file */ |
| 527 | 322 | domain_name = smb_strndup_from_utf16((const char *)authblob + |
| 528 | 323 | le32_to_cpu(authblob->DomainName.BufferOffset), |
| @@ -81,12 +81,6 @@ static struct shash_desc *alloc_shash_desc(int id) · 80 unmodified lines | ||
| 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 | } |
| @@ -214,16 +208,6 @@ struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha512(void) · 121 unmodified lines | ||
| 214 | 208 | return ____crypto_shash_ctx_find(CRYPTO_SHASH_SHA512); |
| 215 | 209 | } |
| 216 | 210 | |
| 217 | −struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md4(void) | |
| 218 | −{ | |
| 219 | − return ____crypto_shash_ctx_find(CRYPTO_SHASH_MD4); | |
| 220 | −} | |
| 221 | − | |
| 222 | −struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md5(void) | |
| 223 | −{ | |
| 224 | − return ____crypto_shash_ctx_find(CRYPTO_SHASH_MD5); | |
| 225 | −} | |
| 226 | − | |
| 227 | 211 | static struct ksmbd_crypto_ctx *____crypto_aead_ctx_find(int id) |
| 228 | 212 | { |
| 229 | 213 | struct ksmbd_crypto_ctx *ctx; |
| @@ -15,8 +15,6 @@ enum { · 14 unmodified lines | ||
| 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 | |
| @@ -43,8 +41,6 @@ struct ksmbd_crypto_ctx { · 20 unmodified lines | ||
| 43 | 41 | #define CRYPTO_CMACAES(c) ((c)->desc[CRYPTO_SHASH_CMACAES]) |
| 44 | 42 | #define CRYPTO_SHA256(c) ((c)->desc[CRYPTO_SHASH_SHA256]) |
| 45 | 43 | #define CRYPTO_SHA512(c) ((c)->desc[CRYPTO_SHASH_SHA512]) |
| 46 | −#define CRYPTO_MD4(c) ((c)->desc[CRYPTO_SHASH_MD4]) | |
| 47 | −#define CRYPTO_MD5(c) ((c)->desc[CRYPTO_SHASH_MD5]) | |
| 48 | 44 | |
| 49 | 45 | #define CRYPTO_HMACMD5_TFM(c) ((c)->desc[CRYPTO_SHASH_HMACMD5]->tfm) |
| 50 | 46 | #define CRYPTO_HMACSHA256_TFM(c)\ |
| @@ -52,8 +48,6 @@ struct ksmbd_crypto_ctx { · 1 unmodified line | ||
| 52 | 48 | #define CRYPTO_CMACAES_TFM(c) ((c)->desc[CRYPTO_SHASH_CMACAES]->tfm) |
| 53 | 49 | #define CRYPTO_SHA256_TFM(c) ((c)->desc[CRYPTO_SHASH_SHA256]->tfm) |
| 54 | 50 | #define CRYPTO_SHA512_TFM(c) ((c)->desc[CRYPTO_SHASH_SHA512]->tfm) |
| 55 | −#define CRYPTO_MD4_TFM(c) ((c)->desc[CRYPTO_SHASH_MD4]->tfm) | |
| 56 | −#define CRYPTO_MD5_TFM(c) ((c)->desc[CRYPTO_SHASH_MD5]->tfm) | |
| 57 | 51 | |
| 58 | 52 | #define CRYPTO_GCM(c) ((c)->ccmaes[CRYPTO_AEAD_AES_GCM]) |
| 59 | 53 | #define CRYPTO_CCM(c) ((c)->ccmaes[CRYPTO_AEAD_AES_CCM]) |
| @@ -64,8 +58,6 @@ struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_hmacsha256(void); · 4 unmodified lines | ||
| 64 | 58 | struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_cmacaes(void); |
| 65 | 59 | struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha512(void); |
| 66 | 60 | struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_sha256(void); |
| 67 | −struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md4(void); | |
| 68 | −struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_md5(void); | |
| 69 | 61 | struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_gcm(void); |
| 70 | 62 | struct ksmbd_crypto_ctx *ksmbd_crypto_ctx_find_ccm(void); |
| 71 | 63 | void ksmbd_crypto_destroy(void); |
| @@ -162,17 +162,14 @@ char *convert_to_nt_pathname(char *filename) · 161 unmodified lines | ||
| 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 | |
| @@ -1451,26 +1451,47 @@ struct lease_ctx_info *parse_lease_state(void *open_req) · 1450 unmodified lines | ||
| 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; |
| @@ -459,13 +459,22 @@ static void init_chained_smb2_rsp(struct ksmbd_work *work) · 458 unmodified lines | ||
| 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; |
| @@ -1058,6 +1067,7 @@ int smb2_handle_negotiate(struct ksmbd_work *work) · 586 unmodified lines | ||
| 1058 | 1067 | struct smb2_negotiate_req *req = work->request_buf; |
| 1059 | 1068 | struct smb2_negotiate_rsp *rsp = work->response_buf; |
| 1060 | 1069 | int rc = 0; |
| 1070 | + unsigned int smb2_buf_len, smb2_neg_size; | |
| 1061 | 1071 | __le32 status; |
| 1062 | 1072 | |
| 1063 | 1073 | ksmbd_debug(SMB, "Received negotiate request\n"); |
| @@ -1075,6 +1085,44 @@ int smb2_handle_negotiate(struct ksmbd_work *work) · 11 unmodified lines | ||
| 1075 | 1085 | goto err_out; |
| 1076 | 1086 | } |
| 1077 | 1087 | |
| 1088 | + smb2_buf_len = get_rfc1002_len(work->request_buf); | |
| 1089 | + smb2_neg_size = offsetof(struct smb2_negotiate_req, Dialects) - 4; | |
| 1090 | + if (smb2_neg_size > smb2_buf_len) { | |
| 1091 | + rsp->hdr.Status = STATUS_INVALID_PARAMETER; | |
| 1092 | + rc = -EINVAL; | |
| 1093 | + goto err_out; | |
| 1094 | + } | |
| 1095 | + | |
| 1096 | + if (conn->dialect == SMB311_PROT_ID) { | |
| 1097 | + unsigned int nego_ctxt_off = le32_to_cpu(req->NegotiateContextOffset); | |
| 1098 | + | |
| 1099 | + if (smb2_buf_len < nego_ctxt_off) { | |
| 1100 | + rsp->hdr.Status = STATUS_INVALID_PARAMETER; | |
| 1101 | + rc = -EINVAL; | |
| 1102 | + goto err_out; | |
| 1103 | + } | |
| 1104 | + | |
| 1105 | + if (smb2_neg_size > nego_ctxt_off) { | |
| 1106 | + rsp->hdr.Status = STATUS_INVALID_PARAMETER; | |
| 1107 | + rc = -EINVAL; | |
| 1108 | + goto err_out; | |
| 1109 | + } | |
| 1110 | + | |
| 1111 | + if (smb2_neg_size + le16_to_cpu(req->DialectCount) * sizeof(__le16) > | |
| 1112 | + nego_ctxt_off) { | |
| 1113 | + rsp->hdr.Status = STATUS_INVALID_PARAMETER; | |
| 1114 | + rc = -EINVAL; | |
| 1115 | + goto err_out; | |
| 1116 | + } | |
| 1117 | + } else { | |
| 1118 | + if (smb2_neg_size + le16_to_cpu(req->DialectCount) * sizeof(__le16) > | |
| 1119 | + smb2_buf_len) { | |
| 1120 | + rsp->hdr.Status = STATUS_INVALID_PARAMETER; | |
| 1121 | + rc = -EINVAL; | |
| 1122 | + goto err_out; | |
| 1123 | + } | |
| 1124 | + } | |
| 1125 | + | |
| 1078 | 1126 | conn->cli_cap = le32_to_cpu(req->Capabilities); |
| 1079 | 1127 | switch (conn->dialect) { |
| 1080 | 1128 | case SMB311_PROT_ID: |
| @@ -2093,16 +2141,22 @@ out: · 1012 unmodified lines | ||
| 2093 | 2141 | * smb2_set_ea() - handler for setting extended attributes using set |
| 2094 | 2142 | * info command |
| 2095 | 2143 | * @eabuf: set info command buffer |
| 2144 | + * @buf_len: set info command buffer length | |
| 2096 | 2145 | * @path: dentry path for get ea |
| 2097 | 2146 | * |
| 2098 | 2147 | * Return: 0 on success, otherwise error |
| 2099 | 2148 | */ |
| 2100 | −static int smb2_set_ea(struct smb2_ea_info *eabuf, struct path *path) | |
| 2149 | +static int smb2_set_ea(struct smb2_ea_info *eabuf, unsigned int buf_len, | |
| 2150 | + struct path *path) | |
| 2101 | 2151 | { |
| 2102 | 2152 | struct user_namespace *user_ns = mnt_user_ns(path->mnt); |
| 2103 | 2153 | char *attr_name = NULL, *value; |
| 2104 | 2154 | int rc = 0; |
| 2105 | − int next = 0; | |
| 2155 | + unsigned int next = 0; | |
| 2156 | + | |
| 2157 | + if (buf_len < sizeof(struct smb2_ea_info) + eabuf->EaNameLength + | |
| 2158 | + le16_to_cpu(eabuf->EaValueLength)) | |
| 2159 | + return -EINVAL; | |
| 2106 | 2160 | |
| 2107 | 2161 | attr_name = kmalloc(XATTR_NAME_MAX + 1, GFP_KERNEL); |
| 2108 | 2162 | if (!attr_name) |
| @@ -2167,7 +2221,13 @@ static int smb2_set_ea(struct smb2_ea_info *eabuf, struct path *path) · 58 unmodified lines | ||
| 2167 | 2221 | |
| 2168 | 2222 | next: |
| 2169 | 2223 | next = le32_to_cpu(eabuf->NextEntryOffset); |
| 2224 | + if (next == 0 || buf_len < next) | |
| 2225 | + break; | |
| 2226 | + buf_len -= next; | |
| 2170 | 2227 | eabuf = (struct smb2_ea_info *)((char *)eabuf + next); |
| 2228 | + if (next < (u32)eabuf->EaNameLength + le16_to_cpu(eabuf->EaValueLength)) | |
| 2229 | + break; | |
| 2230 | + | |
| 2171 | 2231 | } while (next != 0); |
| 2172 | 2232 | |
| 2173 | 2233 | kfree(attr_name); |
| @@ -2367,6 +2427,10 @@ static int smb2_create_sd_buffer(struct ksmbd_work *work, · 193 unmodified lines | ||
| 2367 | 2427 | ksmbd_debug(SMB, |
| 2368 | 2428 | "Set ACLs using SMB2_CREATE_SD_BUFFER context\n"); |
| 2369 | 2429 | sd_buf = (struct create_sd_buf_req *)context; |
| 2430 | + if (le16_to_cpu(context->DataOffset) + | |
| 2431 | + le32_to_cpu(context->DataLength) < | |
| 2432 | + sizeof(struct create_sd_buf_req)) | |
| 2433 | + return -EINVAL; | |
| 2370 | 2434 | return set_info_sec(work->conn, work->tcon, path, &sd_buf->ntsd, |
| 2371 | 2435 | le32_to_cpu(sd_buf->ccontext.DataLength), true); |
| 2372 | 2436 | } |
| @@ -2561,6 +2625,12 @@ int smb2_open(struct ksmbd_work *work) · 188 unmodified lines | ||
| 2561 | 2625 | goto err_out1; |
| 2562 | 2626 | } else if (context) { |
| 2563 | 2627 | ea_buf = (struct create_ea_buf_req *)context; |
| 2628 | + if (le16_to_cpu(context->DataOffset) + | |
| 2629 | + le32_to_cpu(context->DataLength) < | |
| 2630 | + sizeof(struct create_ea_buf_req)) { | |
| 2631 | + rc = -EINVAL; | |
| 2632 | + goto err_out1; | |
| 2633 | + } | |
| 2564 | 2634 | if (req->CreateOptions & FILE_NO_EA_KNOWLEDGE_LE) { |
| 2565 | 2635 | rsp->hdr.Status = STATUS_ACCESS_DENIED; |
| 2566 | 2636 | rc = -EACCES; |
| @@ -2599,6 +2669,12 @@ int smb2_open(struct ksmbd_work *work) · 32 unmodified lines | ||
| 2599 | 2669 | } else if (context) { |
| 2600 | 2670 | struct create_posix *posix = |
| 2601 | 2671 | (struct create_posix *)context; |
| 2672 | + if (le16_to_cpu(context->DataOffset) + | |
| 2673 | + le32_to_cpu(context->DataLength) < | |
| 2674 | + sizeof(struct create_posix)) { | |
| 2675 | + rc = -EINVAL; | |
| 2676 | + goto err_out1; | |
| 2677 | + } | |
| 2602 | 2678 | ksmbd_debug(SMB, "get posix context\n"); |
| 2603 | 2679 | |
| 2604 | 2680 | posix_mode = le32_to_cpu(posix->Mode); |
| @@ -2748,7 +2824,15 @@ int smb2_open(struct ksmbd_work *work) · 143 unmodified lines | ||
| 2748 | 2824 | created = true; |
| 2749 | 2825 | user_ns = mnt_user_ns(path.mnt); |
| 2750 | 2826 | if (ea_buf) { |
| 2751 | − rc = smb2_set_ea(&ea_buf->ea, &path); | |
| 2827 | + if (le32_to_cpu(ea_buf->ccontext.DataLength) < | |
| 2828 | + sizeof(struct smb2_ea_info)) { | |
| 2829 | + rc = -EINVAL; | |
| 2830 | + goto err_out; | |
| 2831 | + } | |
| 2832 | + | |
| 2833 | + rc = smb2_set_ea(&ea_buf->ea, | |
| 2834 | + le32_to_cpu(ea_buf->ccontext.DataLength), | |
| 2835 | + &path); | |
| 2752 | 2836 | if (rc == -EOPNOTSUPP) |
| 2753 | 2837 | rc = 0; |
| 2754 | 2838 | else if (rc) |
| @@ -2981,9 +3065,16 @@ int smb2_open(struct ksmbd_work *work) · 226 unmodified lines | ||
| 2981 | 3065 | rc = PTR_ERR(az_req); |
| 2982 | 3066 | goto err_out; |
| 2983 | 3067 | } else if (az_req) { |
| 2984 | − loff_t alloc_size = le64_to_cpu(az_req->AllocationSize); | |
| 3068 | + loff_t alloc_size; | |
| 2985 | 3069 | int err; |
| 2986 | 3070 | |
| 3071 | + if (le16_to_cpu(az_req->ccontext.DataOffset) + | |
| 3072 | + le32_to_cpu(az_req->ccontext.DataLength) < | |
| 3073 | + sizeof(struct create_alloc_size_req)) { | |
| 3074 | + rc = -EINVAL; | |
| 3075 | + goto err_out; | |
| 3076 | + } | |
| 3077 | + alloc_size = le64_to_cpu(az_req->AllocationSize); | |
| 2987 | 3078 | ksmbd_debug(SMB, |
| 2988 | 3079 | "request smb2 create allocate size : %llu\n", |
| 2989 | 3080 | alloc_size); |
| @@ -4152,7 +4243,7 @@ static void get_file_access_info(struct smb2_query_info_rsp *rsp, · 1162 unmodified lines | ||
| 4152 | 4243 | static int get_file_basic_info(struct smb2_query_info_rsp *rsp, |
| 4153 | 4244 | struct ksmbd_file *fp, void *rsp_org) |
| 4154 | 4245 | { |
| 4155 | − struct smb2_file_all_info *basic_info; | |
| 4246 | + struct smb2_file_basic_info *basic_info; | |
| 4156 | 4247 | struct kstat stat; |
| 4157 | 4248 | u64 time; |
| 4158 | 4249 | |
| @@ -4162,7 +4253,7 @@ static int get_file_basic_info(struct smb2_query_info_rsp *rsp, · 3 unmodified lines | ||
| 4162 | 4253 | return -EACCES; |
| 4163 | 4254 | } |
| 4164 | 4255 | |
| 4165 | − basic_info = (struct smb2_file_all_info *)rsp->Buffer; | |
| 4256 | + basic_info = (struct smb2_file_basic_info *)rsp->Buffer; | |
| 4166 | 4257 | generic_fillattr(file_mnt_user_ns(fp->filp), file_inode(fp->filp), |
| 4167 | 4258 | &stat); |
| 4168 | 4259 | basic_info->CreationTime = cpu_to_le64(fp->create_time); |
| @@ -4175,9 +4266,8 @@ static int get_file_basic_info(struct smb2_query_info_rsp *rsp, · 6 unmodified lines | ||
| 4175 | 4266 | basic_info->Attributes = fp->f_ci->m_fattr; |
| 4176 | 4267 | basic_info->Pad1 = 0; |
| 4177 | 4268 | rsp->OutputBufferLength = |
| 4178 | − cpu_to_le32(offsetof(struct smb2_file_all_info, AllocationSize)); | |
| 4179 | − inc_rfc1001_len(rsp_org, offsetof(struct smb2_file_all_info, | |
| 4180 | − AllocationSize)); | |
| 4269 | + cpu_to_le32(sizeof(struct smb2_file_basic_info)); | |
| 4270 | + inc_rfc1001_len(rsp_org, sizeof(struct smb2_file_basic_info)); | |
| 4181 | 4271 | return 0; |
| 4182 | 4272 | } |
| 4183 | 4273 | |
| @@ -5333,7 +5423,7 @@ out: · 1149 unmodified lines | ||
| 5333 | 5423 | static int smb2_create_link(struct ksmbd_work *work, |
| 5334 | 5424 | struct ksmbd_share_config *share, |
| 5335 | 5425 | struct smb2_file_link_info *file_info, |
| 5336 | − struct file *filp, | |
| 5426 | + unsigned int buf_len, struct file *filp, | |
| 5337 | 5427 | struct nls_table *local_nls) |
| 5338 | 5428 | { |
| 5339 | 5429 | char *link_name = NULL, *target_name = NULL, *pathname = NULL; |
| @@ -5341,6 +5431,10 @@ static int smb2_create_link(struct ksmbd_work *work, · 1 unmodified line | ||
| 5341 | 5431 | bool file_present = true; |
| 5342 | 5432 | int rc; |
| 5343 | 5433 | |
| 5434 | + if (buf_len < (u64)sizeof(struct smb2_file_link_info) + | |
| 5435 | + le32_to_cpu(file_info->FileNameLength)) | |
| 5436 | + return -EINVAL; | |
| 5437 | + | |
| 5344 | 5438 | ksmbd_debug(SMB, "setting FILE_LINK_INFORMATION\n"); |
| 5345 | 5439 | pathname = kmalloc(PATH_MAX, GFP_KERNEL); |
| 5346 | 5440 | if (!pathname) |
| @@ -5400,10 +5494,10 @@ out: · 53 unmodified lines | ||
| 5400 | 5494 | return rc; |
| 5401 | 5495 | } |
| 5402 | 5496 | |
| 5403 | −static int set_file_basic_info(struct ksmbd_file *fp, char *buf, | |
| 5497 | +static int set_file_basic_info(struct ksmbd_file *fp, | |
| 5498 | + struct smb2_file_basic_info *file_info, | |
| 5404 | 5499 | struct ksmbd_share_config *share) |
| 5405 | 5500 | { |
| 5406 | − struct smb2_file_all_info *file_info; | |
| 5407 | 5501 | struct iattr attrs; |
| 5408 | 5502 | struct timespec64 ctime; |
| 5409 | 5503 | struct file *filp; |
| @@ -5414,7 +5508,6 @@ static int set_file_basic_info(struct ksmbd_file *fp, char *buf, · 4 unmodified lines | ||
| 5414 | 5508 | if (!(fp->daccess & FILE_WRITE_ATTRIBUTES_LE)) |
| 5415 | 5509 | return -EACCES; |
| 5416 | 5510 | |
| 5417 | − file_info = (struct smb2_file_all_info *)buf; | |
| 5418 | 5511 | attrs.ia_valid = 0; |
| 5419 | 5512 | filp = fp->filp; |
| 5420 | 5513 | inode = file_inode(filp); |
| @@ -5491,7 +5584,8 @@ static int set_file_basic_info(struct ksmbd_file *fp, char *buf, · 70 unmodified lines | ||
| 5491 | 5584 | } |
| 5492 | 5585 | |
| 5493 | 5586 | static int set_file_allocation_info(struct ksmbd_work *work, |
| 5494 | − struct ksmbd_file *fp, char *buf) | |
| 5587 | + struct ksmbd_file *fp, | |
| 5588 | + struct smb2_file_alloc_info *file_alloc_info) | |
| 5495 | 5589 | { |
| 5496 | 5590 | /* |
| 5497 | 5591 | * TODO : It's working fine only when store dos attributes |
| @@ -5499,7 +5593,6 @@ static int set_file_allocation_info(struct ksmbd_work *work, · 1 unmodified line | ||
| 5499 | 5593 | * properly with any smb.conf option |
| 5500 | 5594 | */ |
| 5501 | 5595 | |
| 5502 | − struct smb2_file_alloc_info *file_alloc_info; | |
| 5503 | 5596 | loff_t alloc_blks; |
| 5504 | 5597 | struct inode *inode; |
| 5505 | 5598 | int rc; |
| @@ -5507,7 +5600,6 @@ static int set_file_allocation_info(struct ksmbd_work *work, · 1 unmodified line | ||
| 5507 | 5600 | if (!(fp->daccess & FILE_WRITE_DATA_LE)) |
| 5508 | 5601 | return -EACCES; |
| 5509 | 5602 | |
| 5510 | − file_alloc_info = (struct smb2_file_alloc_info *)buf; | |
| 5511 | 5603 | alloc_blks = (le64_to_cpu(file_alloc_info->AllocationSize) + 511) >> 9; |
| 5512 | 5604 | inode = file_inode(fp->filp); |
| 5513 | 5605 | |
| @@ -5543,9 +5635,8 @@ static int set_file_allocation_info(struct ksmbd_work *work, · 29 unmodified lines | ||
| 5543 | 5635 | } |
| 5544 | 5636 | |
| 5545 | 5637 | static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp, |
| 5546 | − char *buf) | |
| 5638 | + struct smb2_file_eof_info *file_eof_info) | |
| 5547 | 5639 | { |
| 5548 | − struct smb2_file_eof_info *file_eof_info; | |
| 5549 | 5640 | loff_t newsize; |
| 5550 | 5641 | struct inode *inode; |
| 5551 | 5642 | int rc; |
| @@ -5553,7 +5644,6 @@ static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp, · 1 unmodified line | ||
| 5553 | 5644 | if (!(fp->daccess & FILE_WRITE_DATA_LE)) |
| 5554 | 5645 | return -EACCES; |
| 5555 | 5646 | |
| 5556 | − file_eof_info = (struct smb2_file_eof_info *)buf; | |
| 5557 | 5647 | newsize = le64_to_cpu(file_eof_info->EndOfFile); |
| 5558 | 5648 | inode = file_inode(fp->filp); |
| 5559 | 5649 | |
| @@ -5580,7 +5670,8 @@ static int set_end_of_file_info(struct ksmbd_work *work, struct ksmbd_file *fp, · 20 unmodified lines | ||
| 5580 | 5670 | } |
| 5581 | 5671 | |
| 5582 | 5672 | static int set_rename_info(struct ksmbd_work *work, struct ksmbd_file *fp, |
| 5583 | − char *buf) | |
| 5673 | + struct smb2_file_rename_info *rename_info, | |
| 5674 | + unsigned int buf_len) | |
| 5584 | 5675 | { |
| 5585 | 5676 | struct user_namespace *user_ns; |
| 5586 | 5677 | struct ksmbd_file *parent_fp; |
| @@ -5593,6 +5684,10 @@ static int set_rename_info(struct ksmbd_work *work, struct ksmbd_file *fp, · 6 unmodified lines | ||
| 5593 | 5684 | return -EACCES; |
| 5594 | 5685 | } |
| 5595 | 5686 | |
| 5687 | + if (buf_len < (u64)sizeof(struct smb2_file_rename_info) + | |
| 5688 | + le32_to_cpu(rename_info->FileNameLength)) | |
| 5689 | + return -EINVAL; | |
| 5690 | + | |
| 5596 | 5691 | user_ns = file_mnt_user_ns(fp->filp); |
| 5597 | 5692 | if (ksmbd_stream_fd(fp)) |
| 5598 | 5693 | goto next; |
| @@ -5615,14 +5710,13 @@ static int set_rename_info(struct ksmbd_work *work, struct ksmbd_file *fp, · 16 unmodified lines | ||
| 5615 | 5710 | } |
| 5616 | 5711 | } |
| 5617 | 5712 | next: |
| 5618 | − return smb2_rename(work, fp, user_ns, | |
| 5619 | − (struct smb2_file_rename_info *)buf, | |
| 5713 | + return smb2_rename(work, fp, user_ns, rename_info, | |
| 5620 | 5714 | work->sess->conn->local_nls); |
| 5621 | 5715 | } |
| 5622 | 5716 | |
| 5623 | −static int set_file_disposition_info(struct ksmbd_file *fp, char *buf) | |
| 5717 | +static int set_file_disposition_info(struct ksmbd_file *fp, | |
| 5718 | + struct smb2_file_disposition_info *file_info) | |
| 5624 | 5719 | { |
| 5625 | − struct smb2_file_disposition_info *file_info; | |
| 5626 | 5720 | struct inode *inode; |
| 5627 | 5721 | |
| 5628 | 5722 | if (!(fp->daccess & FILE_DELETE_LE)) { |
| @@ -5631,7 +5725,6 @@ static int set_file_disposition_info(struct ksmbd_file *fp, char *buf) · 2 unmodified lines | ||
| 5631 | 5725 | } |
| 5632 | 5726 | |
| 5633 | 5727 | inode = file_inode(fp->filp); |
| 5634 | − file_info = (struct smb2_file_disposition_info *)buf; | |
| 5635 | 5728 | if (file_info->DeletePending) { |
| 5636 | 5729 | if (S_ISDIR(inode->i_mode) && |
| 5637 | 5730 | ksmbd_vfs_empty_dir(fp) == -ENOTEMPTY) |
| @@ -5643,15 +5736,14 @@ static int set_file_disposition_info(struct ksmbd_file *fp, char *buf) · 5 unmodified lines | ||
| 5643 | 5736 | return 0; |
| 5644 | 5737 | } |
| 5645 | 5738 | |
| 5646 | −static int set_file_position_info(struct ksmbd_file *fp, char *buf) | |
| 5739 | +static int set_file_position_info(struct ksmbd_file *fp, | |
| 5740 | + struct smb2_file_pos_info *file_info) | |
| 5647 | 5741 | { |
| 5648 | − struct smb2_file_pos_info *file_info; | |
| 5649 | 5742 | loff_t current_byte_offset; |
| 5650 | 5743 | unsigned long sector_size; |
| 5651 | 5744 | struct inode *inode; |
| 5652 | 5745 | |
| 5653 | 5746 | inode = file_inode(fp->filp); |
| 5654 | − file_info = (struct smb2_file_pos_info *)buf; | |
| 5655 | 5747 | current_byte_offset = le64_to_cpu(file_info->CurrentByteOffset); |
| 5656 | 5748 | sector_size = inode->i_sb->s_blocksize; |
| 5657 | 5749 | |
| @@ -5667,12 +5759,11 @@ static int set_file_position_info(struct ksmbd_file *fp, char *buf) · 9 unmodified lines | ||
| 5667 | 5759 | return 0; |
| 5668 | 5760 | } |
| 5669 | 5761 | |
| 5670 | −static int set_file_mode_info(struct ksmbd_file *fp, char *buf) | |
| 5762 | +static int set_file_mode_info(struct ksmbd_file *fp, | |
| 5763 | + struct smb2_file_mode_info *file_info) | |
| 5671 | 5764 | { |
| 5672 | − struct smb2_file_mode_info *file_info; | |
| 5673 | 5765 | __le32 mode; |
| 5674 | 5766 | |
| 5675 | − file_info = (struct smb2_file_mode_info *)buf; | |
| 5676 | 5767 | mode = file_info->Mode; |
| 5677 | 5768 | |
| 5678 | 5769 | if ((mode & ~FILE_MODE_INFO_MASK) || |
| @@ -5702,40 +5793,74 @@ static int set_file_mode_info(struct ksmbd_file *fp, char *buf) · 23 unmodified lines | ||
| 5702 | 5793 | * TODO: need to implement an error handling for STATUS_INFO_LENGTH_MISMATCH |
| 5703 | 5794 | */ |
| 5704 | 5795 | static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp, |
| 5705 | − int info_class, char *buf, | |
| 5796 | + struct smb2_set_info_req *req, | |
| 5706 | 5797 | struct ksmbd_share_config *share) |
| 5707 | 5798 | { |
| 5708 | − switch (info_class) { | |
| 5799 | + unsigned int buf_len = le32_to_cpu(req->BufferLength); | |
| 5800 | + | |
| 5801 | + switch (req->FileInfoClass) { | |
| 5709 | 5802 | case FILE_BASIC_INFORMATION: |
| 5710 | − return set_file_basic_info(fp, buf, share); | |
| 5803 | + { | |
| 5804 | + if (buf_len < sizeof(struct smb2_file_basic_info)) | |
| 5805 | + return -EINVAL; | |
| 5711 | 5806 | |
| 5807 | + return set_file_basic_info(fp, (struct smb2_file_basic_info *)req->Buffer, share); | |
| 5808 | + } | |
| 5712 | 5809 | case FILE_ALLOCATION_INFORMATION: |
| 5713 | − return set_file_allocation_info(work, fp, buf); | |
| 5810 | + { | |
| 5811 | + if (buf_len < sizeof(struct smb2_file_alloc_info)) | |
| 5812 | + return -EINVAL; | |
| 5714 | 5813 | |
| 5814 | + return set_file_allocation_info(work, fp, | |
| 5815 | + (struct smb2_file_alloc_info *)req->Buffer); | |
| 5816 | + } | |
| 5715 | 5817 | case FILE_END_OF_FILE_INFORMATION: |
| 5716 | − return set_end_of_file_info(work, fp, buf); | |
| 5818 | + { | |
| 5819 | + if (buf_len < sizeof(struct smb2_file_eof_info)) | |
| 5820 | + return -EINVAL; | |
| 5717 | 5821 | |
| 5822 | + return set_end_of_file_info(work, fp, | |
| 5823 | + (struct smb2_file_eof_info *)req->Buffer); | |
| 5824 | + } | |
| 5718 | 5825 | case FILE_RENAME_INFORMATION: |
| 5826 | + { | |
| 5719 | 5827 | if (!test_tree_conn_flag(work->tcon, KSMBD_TREE_CONN_FLAG_WRITABLE)) { |
| 5720 | 5828 | ksmbd_debug(SMB, |
| 5721 | 5829 | "User does not have write permission\n"); |
| 5722 | 5830 | return -EACCES; |
| 5723 | 5831 | } |
| 5724 | − return set_rename_info(work, fp, buf); | |
| 5725 | 5832 | |
| 5833 | + if (buf_len < sizeof(struct smb2_file_rename_info)) | |
| 5834 | + return -EINVAL; | |
| 5835 | + | |
| 5836 | + return set_rename_info(work, fp, | |
| 5837 | + (struct smb2_file_rename_info *)req->Buffer, | |
| 5838 | + buf_len); | |
| 5839 | + } | |
| 5726 | 5840 | case FILE_LINK_INFORMATION: |
| 5841 | + { | |
| 5842 | + if (buf_len < sizeof(struct smb2_file_link_info)) | |
| 5843 | + return -EINVAL; | |
| 5844 | + | |
| 5727 | 5845 | return smb2_create_link(work, work->tcon->share_conf, |
| 5728 | − (struct smb2_file_link_info *)buf, fp->filp, | |
| 5846 | + (struct smb2_file_link_info *)req->Buffer, | |
| 5847 | + buf_len, fp->filp, | |
| 5729 | 5848 | work->sess->conn->local_nls); |
| 5730 | − | |
| 5849 | + } | |
| 5731 | 5850 | case FILE_DISPOSITION_INFORMATION: |
| 5851 | + { | |
| 5732 | 5852 | if (!test_tree_conn_flag(work->tcon, KSMBD_TREE_CONN_FLAG_WRITABLE)) { |
| 5733 | 5853 | ksmbd_debug(SMB, |
| 5734 | 5854 | "User does not have write permission\n"); |
| 5735 | 5855 | return -EACCES; |
| 5736 | 5856 | } |
| 5737 | − return set_file_disposition_info(fp, buf); | |
| 5738 | 5857 | |
| 5858 | + if (buf_len < sizeof(struct smb2_file_disposition_info)) | |
| 5859 | + return -EINVAL; | |
| 5860 | + | |
| 5861 | + return set_file_disposition_info(fp, | |
| 5862 | + (struct smb2_file_disposition_info *)req->Buffer); | |
| 5863 | + } | |
| 5739 | 5864 | case FILE_FULL_EA_INFORMATION: |
| 5740 | 5865 | { |
| 5741 | 5866 | if (!(fp->daccess & FILE_WRITE_EA_LE)) { |
| @@ -5744,18 +5869,29 @@ static int smb2_set_info_file(struct ksmbd_work *work, struct ksmbd_file *fp, · 2 unmodified lines | ||
| 5744 | 5869 | return -EACCES; |
| 5745 | 5870 | } |
| 5746 | 5871 | |
| 5747 | − return smb2_set_ea((struct smb2_ea_info *)buf, | |
| 5748 | − &fp->filp->f_path); | |
| 5749 | − } | |
| 5872 | + if (buf_len < sizeof(struct smb2_ea_info)) | |
| 5873 | + return -EINVAL; | |
| 5750 | 5874 | |
| 5875 | + return smb2_set_ea((struct smb2_ea_info *)req->Buffer, | |
| 5876 | + buf_len, &fp->filp->f_path); | |
| 5877 | + } | |
| 5751 | 5878 | case FILE_POSITION_INFORMATION: |
| 5752 | − return set_file_position_info(fp, buf); | |
| 5879 | + { | |
| 5880 | + if (buf_len < sizeof(struct smb2_file_pos_info)) | |
| 5881 | + return -EINVAL; | |
| 5753 | 5882 | |
| 5883 | + return set_file_position_info(fp, (struct smb2_file_pos_info *)req->Buffer); | |
| 5884 | + } | |
| 5754 | 5885 | case FILE_MODE_INFORMATION: |
| 5755 | − return set_file_mode_info(fp, buf); | |
| 5886 | + { | |
| 5887 | + if (buf_len < sizeof(struct smb2_file_mode_info)) | |
| 5888 | + return -EINVAL; | |
| 5889 | + | |
| 5890 | + return set_file_mode_info(fp, (struct smb2_file_mode_info *)req->Buffer); | |
| 5891 | + } | |
| 5756 | 5892 | } |
| 5757 | 5893 | |
| 5758 | − pr_err("Unimplemented Fileinfoclass :%d\n", info_class); | |
| 5894 | + pr_err("Unimplemented Fileinfoclass :%d\n", req->FileInfoClass); | |
| 5759 | 5895 | return -EOPNOTSUPP; |
| 5760 | 5896 | } |
| 5761 | 5897 | |
| @@ -5816,8 +5952,7 @@ int smb2_set_info(struct ksmbd_work *work) · 54 unmodified lines | ||
| 5816 | 5952 | switch (req->InfoType) { |
| 5817 | 5953 | case SMB2_O_INFO_FILE: |
| 5818 | 5954 | ksmbd_debug(SMB, "GOT SMB2_O_INFO_FILE\n"); |
| 5819 | − rc = smb2_set_info_file(work, fp, req->FileInfoClass, | |
| 5820 | − req->Buffer, work->tcon->share_conf); | |
| 5955 | + rc = smb2_set_info_file(work, fp, req, work->tcon->share_conf); | |
| 5821 | 5956 | break; |
| 5822 | 5957 | case SMB2_O_INFO_SECURITY: |
| 5823 | 5958 | ksmbd_debug(SMB, "GOT SMB2_O_INFO_SECURITY\n"); |
| @@ -8171,7 +8306,8 @@ void smb3_preauth_hash_rsp(struct ksmbd_work *work) · 2347 unmodified lines | ||
| 8171 | 8306 | |
| 8172 | 8307 | WORK_BUFFERS(work, req, rsp); |
| 8173 | 8308 | |
| 8174 | − if (le16_to_cpu(req->Command) == SMB2_NEGOTIATE_HE) | |
| 8309 | + if (le16_to_cpu(req->Command) == SMB2_NEGOTIATE_HE && | |
| 8310 | + conn->preauth_info) | |
| 8175 | 8311 | ksmbd_gen_preauth_integrity_hash(conn, (char *)rsp, |
| 8176 | 8312 | conn->preauth_info->Preauth_HashValue); |
| 8177 | 8313 | |
| @@ -8278,16 +8414,8 @@ int smb3_decrypt_req(struct ksmbd_work *work) · 100 unmodified lines | ||
| 8278 | 8414 | unsigned int buf_data_size = pdu_length + 4 - |
| 8279 | 8415 | sizeof(struct smb2_transform_hdr); |
| 8280 | 8416 | struct smb2_transform_hdr *tr_hdr = (struct smb2_transform_hdr *)buf; |
| 8281 | − unsigned int orig_len = le32_to_cpu(tr_hdr->OriginalMessageSize); | |
| 8282 | 8417 | int rc = 0; |
| 8283 | 8418 | |
| 8284 | − sess = ksmbd_session_lookup_all(conn, le64_to_cpu(tr_hdr->SessionId)); | |
| 8285 | − if (!sess) { | |
| 8286 | − pr_err("invalid session id(%llx) in transform header\n", | |
| 8287 | − le64_to_cpu(tr_hdr->SessionId)); | |
| 8288 | − return -ECONNABORTED; | |
| 8289 | − } | |
| 8290 | − | |
| 8291 | 8419 | if (pdu_length + 4 < |
| 8292 | 8420 | sizeof(struct smb2_transform_hdr) + sizeof(struct smb2_hdr)) { |
| 8293 | 8421 | pr_err("Transform message is too small (%u)\n", |
| @@ -8295,11 +8423,19 @@ int smb3_decrypt_req(struct ksmbd_work *work) · 1 unmodified line | ||
| 8295 | 8423 | return -ECONNABORTED; |
| 8296 | 8424 | } |
| 8297 | 8425 | |
| 8298 | − if (pdu_length + 4 < orig_len + sizeof(struct smb2_transform_hdr)) { | |
| 8426 | + if (pdu_length + 4 < | |
| 8427 | + le32_to_cpu(tr_hdr->OriginalMessageSize) + sizeof(struct smb2_transform_hdr)) { | |
| 8299 | 8428 | pr_err("Transform message is broken\n"); |
| 8300 | 8429 | return -ECONNABORTED; |
| 8301 | 8430 | } |
| 8302 | 8431 | |
| 8432 | + sess = ksmbd_session_lookup_all(conn, le64_to_cpu(tr_hdr->SessionId)); | |
| 8433 | + if (!sess) { | |
| 8434 | + pr_err("invalid session id(%llx) in transform header\n", | |
| 8435 | + le64_to_cpu(tr_hdr->SessionId)); | |
| 8436 | + return -ECONNABORTED; | |
| 8437 | + } | |
| 8438 | + | |
| 8303 | 8439 | iov[0].iov_base = buf; |
| 8304 | 8440 | iov[0].iov_len = sizeof(struct smb2_transform_hdr); |
| 8305 | 8441 | iov[1].iov_base = buf + sizeof(struct smb2_transform_hdr); |
| @@ -1464,6 +1464,15 @@ struct smb2_file_all_info { /* data block encoding of response to level 18 */ · 1463 unmodified lines | ||
| 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]; |
| @@ -155,20 +155,7 @@ int ksmbd_verify_smb_message(struct ksmbd_work *work) · 154 unmodified lines | ||
| 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) |
| @@ -182,10 +169,12 @@ static bool supported_protocol(int idx) · 7 unmodified lines | ||
| 182 | 169 | idx <= server_conf.max_protocol); |
| 183 | 170 | } |
| 184 | 171 | |
| 185 | −static char *next_dialect(char *dialect, int *next_off) | |
| 172 | +static char *next_dialect(char *dialect, int *next_off, int bcount) | |
| 186 | 173 | { |
| 187 | 174 | dialect = dialect + *next_off; |
| 188 | − *next_off = strlen(dialect); | |
| 175 | + *next_off = strnlen(dialect, bcount); | |
| 176 | + if (dialect[*next_off] != '\0') | |
| 177 | + return NULL; | |
| 189 | 178 | return dialect; |
| 190 | 179 | } |
| 191 | 180 | |
| @@ -200,7 +189,9 @@ static int ksmbd_lookup_dialect_by_name(char *cli_dialects, __le16 byte_count) · 8 unmodified lines | ||
| 200 | 189 | dialect = cli_dialects; |
| 201 | 190 | bcount = le16_to_cpu(byte_count); |
| 202 | 191 | do { |
| 203 | − dialect = next_dialect(dialect, &next); | |
| 192 | + dialect = next_dialect(dialect, &next, bcount); | |
| 193 | + if (!dialect) | |
| 194 | + break; | |
| 204 | 195 | ksmbd_debug(SMB, "client requested dialect %s\n", |
| 205 | 196 | dialect); |
| 206 | 197 | if (!strcmp(dialect, smb1_protos[i].name)) { |
| @@ -248,13 +239,22 @@ int ksmbd_lookup_dialect_by_id(__le16 *cli_dialects, __le16 dialects_count) · 41 unmodified lines | ||
| 248 | 239 | |
| 249 | 240 | static int ksmbd_negotiate_smb_dialect(void *buf) |
| 250 | 241 | { |
| 251 | − __le32 proto; | |
| 242 | + int smb_buf_length = get_rfc1002_len(buf); | |
| 243 | + __le32 proto = ((struct smb2_hdr *)buf)->ProtocolId; | |
| 252 | 244 | |
| 253 | − proto = ((struct smb2_hdr *)buf)->ProtocolId; | |
| 254 | 245 | if (proto == SMB2_PROTO_NUMBER) { |
| 255 | 246 | struct smb2_negotiate_req *req; |
| 247 | + int smb2_neg_size = | |
| 248 | + offsetof(struct smb2_negotiate_req, Dialects) - 4; | |
| 256 | 249 | |
| 257 | 250 | req = (struct smb2_negotiate_req *)buf; |
| 251 | + if (smb2_neg_size > smb_buf_length) | |
| 252 | + goto err_out; | |
| 253 | + | |
| 254 | + if (smb2_neg_size + le16_to_cpu(req->DialectCount) * sizeof(__le16) > | |
| 255 | + smb_buf_length) | |
| 256 | + goto err_out; | |
| 257 | + | |
| 258 | 258 | return ksmbd_lookup_dialect_by_id(req->Dialects, |
| 259 | 259 | req->DialectCount); |
| 260 | 260 | } |
| @@ -264,10 +264,19 @@ static int ksmbd_negotiate_smb_dialect(void *buf) · 3 unmodified lines | ||
| 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 | |
| @@ -48,14 +48,6 @@ · 47 unmodified lines | ||
| 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 |
| @@ -380,7 +380,7 @@ static void parse_dacl(struct user_namespace *user_ns, · 379 unmodified lines | ||
| 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,7 +392,7 @@ static void parse_dacl(struct user_namespace *user_ns, · 5 unmodified lines | ||
| 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,8 +431,22 @@ static void parse_dacl(struct user_namespace *user_ns, · 32 unmodified lines | ||
| 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); |
| @@ -807,6 +821,9 @@ int parse_sec_desc(struct user_namespace *user_ns, struct smb_ntsd *pntsd, · 368 unmodified lines | ||
| 807 | 821 | if (!pntsd) |
| 808 | 822 | return -EIO; |
| 809 | 823 | |
| 824 | + if (acl_len < sizeof(struct smb_ntsd)) | |
| 825 | + return -EINVAL; | |
| 826 | + | |
| 810 | 827 | owner_sid_ptr = (struct smb_sid *)((char *)pntsd + |
| 811 | 828 | le32_to_cpu(pntsd->osidoffset)); |
| 812 | 829 | group_sid_ptr = (struct smb_sid *)((char *)pntsd + |
| @@ -215,7 +215,7 @@ out_error: · 214 unmodified lines | ||
| 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,7 +387,7 @@ static void tcp_destroy_socket(struct socket *ksmbd_socket) · 165 unmodified lines | ||
| 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 | { |
| @@ -150,7 +150,7 @@ static void netfs_clear_unread(struct netfs_read_subrequest *subreq) · 149 unmodified lines | ||
| 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); |
| @@ -42,7 +42,6 @@ EXPORT_SYMBOL_GPL(locks_start_grace); · 41 unmodified lines | ||
| 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 |
| @@ -542,7 +542,7 @@ nfsd_file_close_inode_sync(struct inode *inode) · 541 unmodified lines | ||
| 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". |
| @@ -3544,15 +3544,18 @@ nfsd4_encode_dirent(void *ccdv, const char *name, int namlen, · 3543 unmodified lines | ||
| 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: |
| @@ -793,7 +793,10 @@ out_close: · 792 unmodified lines | ||
| 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 | |
| @@ -1545,7 +1548,7 @@ static int __init init_nfsd(void) · 745 unmodified lines | ||
| 1545 | 1548 | goto out_free_all; |
| 1546 | 1549 | return 0; |
| 1547 | 1550 | out_free_all: |
| 1548 | − unregister_pernet_subsys(&nfsd_net_ops); | |
| 1551 | + unregister_filesystem(&nfsd_fs_type); | |
| 1549 | 1552 | out_free_exports: |
| 1550 | 1553 | remove_proc_entry("fs/nfs/exports", NULL); |
| 1551 | 1554 | remove_proc_entry("fs/nfs", NULL); |
| @@ -1219,9 +1219,13 @@ static int ovl_rename(struct user_namespace *mnt_userns, struct inode *olddir, · 1218 unmodified lines | ||
| 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) |
| @@ -296,6 +296,12 @@ static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *iter) · 295 unmodified lines | ||
| 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, |
| @@ -320,7 +326,7 @@ static ssize_t ovl_read_iter(struct kiocb *iocb, struct iov_iter *iter) · 18 unmodified lines | ||
| 320 | 326 | out: |
| 321 | 327 | revert_creds(old_cred); |
| 322 | 328 | ovl_file_accessed(file); |
| 323 | − | |
| 329 | +out_fdput: | |
| 324 | 330 | fdput(real); |
| 325 | 331 | |
| 326 | 332 | return ret; |
| @@ -349,6 +355,12 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter) · 22 unmodified lines | ||
| 349 | 355 | if (ret) |
| 350 | 356 | goto out_unlock; |
| 351 | 357 | |
| 358 | + ret = -EINVAL; | |
| 359 | + if (iocb->ki_flags & IOCB_DIRECT && | |
| 360 | + (!real.file->f_mapping->a_ops || | |
| 361 | + !real.file->f_mapping->a_ops->direct_IO)) | |
| 362 | + goto out_fdput; | |
| 363 | + | |
| 352 | 364 | if (!ovl_should_sync(OVL_FS(inode->i_sb))) |
| 353 | 365 | ifl &= ~(IOCB_DSYNC | IOCB_SYNC); |
| 354 | 366 | |
| @@ -384,6 +396,7 @@ static ssize_t ovl_write_iter(struct kiocb *iocb, struct iov_iter *iter) · 29 unmodified lines | ||
| 384 | 396 | } |
| 385 | 397 | out: |
| 386 | 398 | revert_creds(old_cred); |
| 399 | +out_fdput: | |
| 387 | 400 | fdput(real); |
| 388 | 401 | |
| 389 | 402 | out_unlock: |
| @@ -996,14 +996,15 @@ cpumap_print_to_pagebuf(bool list, char *buf, const struct cpumask *mask) · 995 unmodified lines | ||
| 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 | /** |
| @@ -1018,7 +1019,7 @@ cpumap_print_list_to_buf(char *buf, const struct cpumask *mask, · 8 unmodified lines | ||
| 1018 | 1019 | loff_t off, size_t count) |
| 1019 | 1020 | { |
| 1020 | 1021 | return bitmap_print_list_to_buf(buf, cpumask_bits(mask), |
| 1021 | − nr_cpu_ids, off, count); | |
| 1022 | + nr_cpu_ids, off, count) - 1; | |
| 1022 | 1023 | } |
| 1023 | 1024 | |
| 1024 | 1025 | #if NR_CPUS <= BITS_PER_LONG |
| @@ -314,7 +314,7 @@ static inline void ether_addr_copy(u8 *dst, const u8 *src) · 313 unmodified lines | ||
| 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 | /** |
| @@ -22,10 +22,15 @@ struct device; · 21 unmodified lines | ||
| 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; |
| @@ -684,7 +684,9 @@ struct perf_event { · 683 unmodified lines | ||
| 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(). |
| @@ -48,6 +48,8 @@ struct omap_usb_config { · 47 unmodified lines | ||
| 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 */ |
| @@ -1720,7 +1720,7 @@ extern struct pid *cad_pid; · 1719 unmodified lines | ||
| 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) && |
| @@ -17,7 +17,6 @@ struct inet_frags_ctl; · 16 unmodified lines | ||
| 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 */ |
| @@ -1202,7 +1202,7 @@ struct nft_object *nft_obj_lookup(const struct net *net, · 1201 unmodified lines | ||
| 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 |
| @@ -27,5 +27,11 @@ struct netns_nf { · 26 unmodified lines | ||
| 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 |
| @@ -307,6 +307,7 @@ struct bpf_local_storage; · 306 unmodified lines | ||
| 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 |
| @@ -704,7 +704,7 @@ int ocelot_vcap_filter_add(struct ocelot *ocelot, · 703 unmodified lines | ||
| 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_ */ |
| @@ -178,7 +178,7 @@ TRACE_EVENT(cachefiles_unlink, · 177 unmodified lines | ||
| 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,7 +205,7 @@ TRACE_EVENT(cachefiles_rename, · 20 unmodified lines | ||
| 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,7 +305,7 @@ TRACE_EVENT(cachefiles_mark_buried, · 93 unmodified lines | ||
| 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 | ), |
| @@ -26,7 +26,7 @@ · 25 unmodified lines | ||
| 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. |
| @@ -213,13 +213,13 @@ enum { · 212 unmodified lines | ||
| 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,9 +514,12 @@ struct xfrm_user_offload { · 288 unmodified lines | ||
| 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__ |
| @@ -63,7 +63,8 @@ static inline int stack_map_data_size(struct bpf_map *map) · 62 unmodified lines | ||
| 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, |
| @@ -3707,6 +3707,29 @@ static noinline int visit_groups_merge(struct perf_cpu_context *cpuctx, · 3706 unmodified lines | ||
| 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; |
| @@ -3725,14 +3748,15 @@ static int merge_sched_in(struct perf_event *event, void *data) · 12 unmodified lines | ||
| 3725 | 3748 | } |
| 3726 | 3749 | |
| 3727 | 3750 | if (event->state == PERF_EVENT_STATE_INACTIVE) { |
| 3751 | + *can_add_hw = 0; | |
| 3728 | 3752 | if (event->attr.pinned) { |
| 3729 | 3753 | perf_cgroup_event_disable(event, ctx); |
| 3730 | 3754 | perf_event_set_state(event, PERF_EVENT_STATE_ERROR); |
| 3755 | + } else { | |
| 3756 | + ctx->rotate_necessary = 1; | |
| 3757 | + perf_mux_hrtimer_restart(cpuctx); | |
| 3758 | + group_update_userpage(event); | |
| 3731 | 3759 | } |
| 3732 | − | |
| 3733 | − *can_add_hw = 0; | |
| 3734 | − ctx->rotate_necessary = 1; | |
| 3735 | − perf_mux_hrtimer_restart(cpuctx); | |
| 3736 | 3760 | } |
| 3737 | 3761 | |
| 3738 | 3762 | return 0; |
| @@ -6324,6 +6348,8 @@ accounting: · 2585 unmodified lines | ||
| 6324 | 6348 | |
| 6325 | 6349 | ring_buffer_attach(event, rb); |
| 6326 | 6350 | |
| 6351 | + perf_event_update_time(event); | |
| 6352 | + perf_set_shadow_time(event, event->ctx); | |
| 6327 | 6353 | perf_event_init_userpage(event); |
| 6328 | 6354 | perf_event_update_userpage(event); |
| 6329 | 6355 | } else { |
| @@ -173,16 +173,22 @@ static ssize_t sched_scaling_write(struct file *filp, const char __user *ubuf, · 172 unmodified lines | ||
| 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 | |
| @@ -4936,8 +4936,12 @@ void unthrottle_cfs_rq(struct cfs_rq *cfs_rq) · 4935 unmodified lines | ||
| 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; |
| @@ -1666,7 +1666,8 @@ static size_t br_get_linkxstats_size(const struct net_device *dev, int attr) · 1665 unmodified lines | ||
| 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 | |
| @@ -5262,7 +5262,7 @@ nla_put_failure: · 5261 unmodified lines | ||
| 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)); |
| @@ -210,7 +210,7 @@ static struct sk_buff *dsa_rcv_ll(struct sk_buff *skb, struct net_device *dev, · 209 unmodified lines | ||
| 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: |
| @@ -242,8 +242,10 @@ static inline int compute_score(struct sock *sk, struct net *net, · 241 unmodified lines | ||
| 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 | } |
| @@ -20,13 +20,8 @@ · 19 unmodified lines | ||
| 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 | 24 | |
| 26 | −struct defrag4_pernet { | |
| 27 | − unsigned int users; | |
| 28 | −}; | |
| 29 | − | |
| 30 | 25 | static int nf_ct_ipv4_gather_frags(struct net *net, struct sk_buff *skb, |
| 31 | 26 | u_int32_t user) |
| 32 | 27 | { |
| @@ -111,19 +106,15 @@ static const struct nf_hook_ops ipv4_defrag_ops[] = { · 78 unmodified lines | ||
| 111 | 106 | |
| 112 | 107 | static void __net_exit defrag4_net_exit(struct net *net) |
| 113 | 108 | { |
| 114 | − struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id); | |
| 115 | − | |
| 116 | − if (nf_defrag->users) { | |
| 109 | + if (net->nf.defrag_ipv4_users) { | |
| 117 | 110 | nf_unregister_net_hooks(net, ipv4_defrag_ops, |
| 118 | 111 | ARRAY_SIZE(ipv4_defrag_ops)); |
| 119 | − nf_defrag->users = 0; | |
| 112 | + net->nf.defrag_ipv4_users = 0; | |
| 120 | 113 | } |
| 121 | 114 | } |
| 122 | 115 | |
| 123 | 116 | static struct pernet_operations defrag4_net_ops = { |
| 124 | 117 | .exit = defrag4_net_exit, |
| 125 | − .id = &defrag4_pernet_id, | |
| 126 | − .size = sizeof(struct defrag4_pernet), | |
| 127 | 118 | }; |
| 128 | 119 | |
| 129 | 120 | static int __init nf_defrag_init(void) |
| @@ -138,24 +129,23 @@ static void __exit nf_defrag_fini(void) · 8 unmodified lines | ||
| 138 | 129 | |
| 139 | 130 | int nf_defrag_ipv4_enable(struct net *net) |
| 140 | 131 | { |
| 141 | − struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id); | |
| 142 | 132 | int err = 0; |
| 143 | 133 | |
| 144 | 134 | mutex_lock(&defrag4_mutex); |
| 145 | − if (nf_defrag->users == UINT_MAX) { | |
| 135 | + if (net->nf.defrag_ipv4_users == UINT_MAX) { | |
| 146 | 136 | err = -EOVERFLOW; |
| 147 | 137 | goto out_unlock; |
| 148 | 138 | } |
| 149 | 139 | |
| 150 | − if (nf_defrag->users) { | |
| 151 | − nf_defrag->users++; | |
| 140 | + if (net->nf.defrag_ipv4_users) { | |
| 141 | + net->nf.defrag_ipv4_users++; | |
| 152 | 142 | goto out_unlock; |
| 153 | 143 | } |
| 154 | 144 | |
| 155 | 145 | err = nf_register_net_hooks(net, ipv4_defrag_ops, |
| 156 | 146 | ARRAY_SIZE(ipv4_defrag_ops)); |
| 157 | 147 | if (err == 0) |
| 158 | − nf_defrag->users = 1; | |
| 148 | + net->nf.defrag_ipv4_users = 1; | |
| 159 | 149 | |
| 160 | 150 | out_unlock: |
| 161 | 151 | mutex_unlock(&defrag4_mutex); |
| @@ -165,12 +155,10 @@ EXPORT_SYMBOL_GPL(nf_defrag_ipv4_enable); · 3 unmodified lines | ||
| 165 | 155 | |
| 166 | 156 | void nf_defrag_ipv4_disable(struct net *net) |
| 167 | 157 | { |
| 168 | − struct defrag4_pernet *nf_defrag = net_generic(net, defrag4_pernet_id); | |
| 169 | − | |
| 170 | 158 | mutex_lock(&defrag4_mutex); |
| 171 | − if (nf_defrag->users) { | |
| 172 | − nf_defrag->users--; | |
| 173 | − if (nf_defrag->users == 0) | |
| 159 | + if (net->nf.defrag_ipv4_users) { | |
| 160 | + net->nf.defrag_ipv4_users--; | |
| 161 | + if (net->nf.defrag_ipv4_users == 0) | |
| 174 | 162 | nf_unregister_net_hooks(net, ipv4_defrag_ops, |
| 175 | 163 | ARRAY_SIZE(ipv4_defrag_ops)); |
| 176 | 164 | } |
| @@ -390,7 +390,8 @@ static int compute_score(struct sock *sk, struct net *net, · 389 unmodified lines | ||
| 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++; |
| @@ -106,7 +106,7 @@ static inline int compute_score(struct sock *sk, struct net *net, · 105 unmodified lines | ||
| 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 | } |
| @@ -33,7 +33,7 @@ · 32 unmodified lines | ||
| 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) |
| @@ -25,8 +25,6 @@ · 24 unmodified lines | ||
| 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, |
| @@ -91,12 +89,10 @@ static const struct nf_hook_ops ipv6_defrag_ops[] = { · 58 unmodified lines | ||
| 91 | 89 | |
| 92 | 90 | static void __net_exit defrag6_net_exit(struct net *net) |
| 93 | 91 | { |
| 94 | − struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id); | |
| 95 | − | |
| 96 | − if (nf_frag->users) { | |
| 92 | + if (net->nf.defrag_ipv6_users) { | |
| 97 | 93 | nf_unregister_net_hooks(net, ipv6_defrag_ops, |
| 98 | 94 | ARRAY_SIZE(ipv6_defrag_ops)); |
| 99 | − nf_frag->users = 0; | |
| 95 | + net->nf.defrag_ipv6_users = 0; | |
| 100 | 96 | } |
| 101 | 97 | } |
| 102 | 98 | |
| @@ -134,24 +130,23 @@ static void __exit nf_defrag_fini(void) · 31 unmodified lines | ||
| 134 | 130 | |
| 135 | 131 | int nf_defrag_ipv6_enable(struct net *net) |
| 136 | 132 | { |
| 137 | − struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id); | |
| 138 | 133 | int err = 0; |
| 139 | 134 | |
| 140 | 135 | mutex_lock(&defrag6_mutex); |
| 141 | − if (nf_frag->users == UINT_MAX) { | |
| 136 | + if (net->nf.defrag_ipv6_users == UINT_MAX) { | |
| 142 | 137 | err = -EOVERFLOW; |
| 143 | 138 | goto out_unlock; |
| 144 | 139 | } |
| 145 | 140 | |
| 146 | − if (nf_frag->users) { | |
| 147 | − nf_frag->users++; | |
| 141 | + if (net->nf.defrag_ipv6_users) { | |
| 142 | + net->nf.defrag_ipv6_users++; | |
| 148 | 143 | goto out_unlock; |
| 149 | 144 | } |
| 150 | 145 | |
| 151 | 146 | err = nf_register_net_hooks(net, ipv6_defrag_ops, |
| 152 | 147 | ARRAY_SIZE(ipv6_defrag_ops)); |
| 153 | 148 | if (err == 0) |
| 154 | − nf_frag->users = 1; | |
| 149 | + net->nf.defrag_ipv6_users = 1; | |
| 155 | 150 | |
| 156 | 151 | out_unlock: |
| 157 | 152 | mutex_unlock(&defrag6_mutex); |
| @@ -161,12 +156,10 @@ EXPORT_SYMBOL_GPL(nf_defrag_ipv6_enable); · 3 unmodified lines | ||
| 161 | 156 | |
| 162 | 157 | void nf_defrag_ipv6_disable(struct net *net) |
| 163 | 158 | { |
| 164 | − struct nft_ct_frag6_pernet *nf_frag = net_generic(net, nf_frag_pernet_id); | |
| 165 | − | |
| 166 | 159 | mutex_lock(&defrag6_mutex); |
| 167 | − if (nf_frag->users) { | |
| 168 | − nf_frag->users--; | |
| 169 | − if (nf_frag->users == 0) | |
| 160 | + if (net->nf.defrag_ipv6_users) { | |
| 161 | + net->nf.defrag_ipv6_users--; | |
| 162 | + if (net->nf.defrag_ipv6_users == 0) | |
| 170 | 163 | nf_unregister_net_hooks(net, ipv6_defrag_ops, |
| 171 | 164 | ARRAY_SIZE(ipv6_defrag_ops)); |
| 172 | 165 | } |
| @@ -133,7 +133,8 @@ static int compute_score(struct sock *sk, struct net *net, · 132 unmodified lines | ||
| 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++; |
| @@ -780,6 +780,7 @@ static void nf_tables_table_notify(const struct nft_ctx *ctx, int event) · 779 unmodified lines | ||
| 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 && |
| @@ -790,8 +791,11 @@ static void nf_tables_table_notify(const struct nft_ctx *ctx, int event) · 4 unmodified lines | ||
| 790 | 791 | if (skb == NULL) |
| 791 | 792 | goto err; |
| 792 | 793 | |
| 794 | + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) | |
| 795 | + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); | |
| 796 | + | |
| 793 | 797 | err = nf_tables_fill_table_info(skb, ctx->net, ctx->portid, ctx->seq, |
| 794 | − event, 0, ctx->family, ctx->table); | |
| 798 | + event, flags, ctx->family, ctx->table); | |
| 795 | 799 | if (err < 0) { |
| 796 | 800 | kfree_skb(skb); |
| 797 | 801 | goto err; |
| @@ -1563,6 +1567,7 @@ static void nf_tables_chain_notify(const struct nft_ctx *ctx, int event) · 765 unmodified lines | ||
| 1563 | 1567 | { |
| 1564 | 1568 | struct nftables_pernet *nft_net; |
| 1565 | 1569 | struct sk_buff *skb; |
| 1570 | + u16 flags = 0; | |
| 1566 | 1571 | int err; |
| 1567 | 1572 | |
| 1568 | 1573 | if (!ctx->report && |
| @@ -1573,8 +1578,11 @@ static void nf_tables_chain_notify(const struct nft_ctx *ctx, int event) · 4 unmodified lines | ||
| 1573 | 1578 | if (skb == NULL) |
| 1574 | 1579 | goto err; |
| 1575 | 1580 | |
| 1581 | + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) | |
| 1582 | + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); | |
| 1583 | + | |
| 1576 | 1584 | err = nf_tables_fill_chain_info(skb, ctx->net, ctx->portid, ctx->seq, |
| 1577 | − event, 0, ctx->family, ctx->table, | |
| 1585 | + event, flags, ctx->family, ctx->table, | |
| 1578 | 1586 | ctx->chain); |
| 1579 | 1587 | if (err < 0) { |
| 1580 | 1588 | kfree_skb(skb); |
| @@ -2866,8 +2874,7 @@ static int nf_tables_fill_rule_info(struct sk_buff *skb, struct net *net, · 1285 unmodified lines | ||
| 2866 | 2874 | u32 flags, int family, |
| 2867 | 2875 | const struct nft_table *table, |
| 2868 | 2876 | const struct nft_chain *chain, |
| 2869 | − const struct nft_rule *rule, | |
| 2870 | − const struct nft_rule *prule) | |
| 2877 | + const struct nft_rule *rule, u64 handle) | |
| 2871 | 2878 | { |
| 2872 | 2879 | struct nlmsghdr *nlh; |
| 2873 | 2880 | const struct nft_expr *expr, *next; |
| @@ -2887,9 +2894,8 @@ static int nf_tables_fill_rule_info(struct sk_buff *skb, struct net *net, · 13 unmodified lines | ||
| 2887 | 2894 | NFTA_RULE_PAD)) |
| 2888 | 2895 | goto nla_put_failure; |
| 2889 | 2896 | |
| 2890 | − if (event != NFT_MSG_DELRULE && prule) { | |
| 2891 | − if (nla_put_be64(skb, NFTA_RULE_POSITION, | |
| 2892 | − cpu_to_be64(prule->handle), | |
| 2897 | + if (event != NFT_MSG_DELRULE && handle) { | |
| 2898 | + if (nla_put_be64(skb, NFTA_RULE_POSITION, cpu_to_be64(handle), | |
| 2893 | 2899 | NFTA_RULE_PAD)) |
| 2894 | 2900 | goto nla_put_failure; |
| 2895 | 2901 | } |
| @@ -2925,7 +2931,10 @@ static void nf_tables_rule_notify(const struct nft_ctx *ctx, · 29 unmodified lines | ||
| 2925 | 2931 | const struct nft_rule *rule, int event) |
| 2926 | 2932 | { |
| 2927 | 2933 | struct nftables_pernet *nft_net = nft_pernet(ctx->net); |
| 2934 | + const struct nft_rule *prule; | |
| 2928 | 2935 | struct sk_buff *skb; |
| 2936 | + u64 handle = 0; | |
| 2937 | + u16 flags = 0; | |
| 2929 | 2938 | int err; |
| 2930 | 2939 | |
| 2931 | 2940 | if (!ctx->report && |
| @@ -2936,9 +2945,20 @@ static void nf_tables_rule_notify(const struct nft_ctx *ctx, · 4 unmodified lines | ||
| 2936 | 2945 | if (skb == NULL) |
| 2937 | 2946 | goto err; |
| 2938 | 2947 | |
| 2948 | + if (event == NFT_MSG_NEWRULE && | |
| 2949 | + !list_is_first(&rule->list, &ctx->chain->rules) && | |
| 2950 | + !list_is_last(&rule->list, &ctx->chain->rules)) { | |
| 2951 | + prule = list_prev_entry(rule, list); | |
| 2952 | + handle = prule->handle; | |
| 2953 | + } | |
| 2954 | + if (ctx->flags & (NLM_F_APPEND | NLM_F_REPLACE)) | |
| 2955 | + flags |= NLM_F_APPEND; | |
| 2956 | + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) | |
| 2957 | + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); | |
| 2958 | + | |
| 2939 | 2959 | err = nf_tables_fill_rule_info(skb, ctx->net, ctx->portid, ctx->seq, |
| 2940 | − event, 0, ctx->family, ctx->table, | |
| 2941 | − ctx->chain, rule, NULL); | |
| 2960 | + event, flags, ctx->family, ctx->table, | |
| 2961 | + ctx->chain, rule, handle); | |
| 2942 | 2962 | if (err < 0) { |
| 2943 | 2963 | kfree_skb(skb); |
| 2944 | 2964 | goto err; |
| @@ -2964,6 +2984,7 @@ static int __nf_tables_dump_rules(struct sk_buff *skb, · 19 unmodified lines | ||
| 2964 | 2984 | struct net *net = sock_net(skb->sk); |
| 2965 | 2985 | const struct nft_rule *rule, *prule; |
| 2966 | 2986 | unsigned int s_idx = cb->args[0]; |
| 2987 | + u64 handle; | |
| 2967 | 2988 | |
| 2968 | 2989 | prule = NULL; |
| 2969 | 2990 | list_for_each_entry_rcu(rule, &chain->rules, list) { |
| @@ -2975,12 +2996,17 @@ static int __nf_tables_dump_rules(struct sk_buff *skb, · 5 unmodified lines | ||
| 2975 | 2996 | memset(&cb->args[1], 0, |
| 2976 | 2997 | sizeof(cb->args) - sizeof(cb->args[0])); |
| 2977 | 2998 | } |
| 2999 | + if (prule) | |
| 3000 | + handle = prule->handle; | |
| 3001 | + else | |
| 3002 | + handle = 0; | |
| 3003 | + | |
| 2978 | 3004 | if (nf_tables_fill_rule_info(skb, net, NETLINK_CB(cb->skb).portid, |
| 2979 | 3005 | cb->nlh->nlmsg_seq, |
| 2980 | 3006 | NFT_MSG_NEWRULE, |
| 2981 | 3007 | NLM_F_MULTI | NLM_F_APPEND, |
| 2982 | 3008 | table->family, |
| 2983 | − table, chain, rule, prule) < 0) | |
| 3009 | + table, chain, rule, handle) < 0) | |
| 2984 | 3010 | return 1; |
| 2985 | 3011 | |
| 2986 | 3012 | nl_dump_check_consistent(cb, nlmsg_hdr(skb)); |
| @@ -3143,7 +3169,7 @@ static int nf_tables_getrule(struct sk_buff *skb, const struct nfnl_info *info, · 156 unmodified lines | ||
| 3143 | 3169 | |
| 3144 | 3170 | err = nf_tables_fill_rule_info(skb2, net, NETLINK_CB(skb).portid, |
| 3145 | 3171 | info->nlh->nlmsg_seq, NFT_MSG_NEWRULE, 0, |
| 3146 | − family, table, chain, rule, NULL); | |
| 3172 | + family, table, chain, rule, 0); | |
| 3147 | 3173 | if (err < 0) |
| 3148 | 3174 | goto err_fill_rule_info; |
| 3149 | 3175 | |
| @@ -3403,17 +3429,15 @@ static int nf_tables_newrule(struct sk_buff *skb, const struct nfnl_info *info, · 253 unmodified lines | ||
| 3403 | 3429 | } |
| 3404 | 3430 | |
| 3405 | 3431 | if (info->nlh->nlmsg_flags & NLM_F_REPLACE) { |
| 3432 | + err = nft_delrule(&ctx, old_rule); | |
| 3433 | + if (err < 0) | |
| 3434 | + goto err_destroy_flow_rule; | |
| 3435 | + | |
| 3406 | 3436 | trans = nft_trans_rule_add(&ctx, NFT_MSG_NEWRULE, rule); |
| 3407 | 3437 | if (trans == NULL) { |
| 3408 | 3438 | err = -ENOMEM; |
| 3409 | 3439 | goto err_destroy_flow_rule; |
| 3410 | 3440 | } |
| 3411 | − err = nft_delrule(&ctx, old_rule); | |
| 3412 | − if (err < 0) { | |
| 3413 | − nft_trans_destroy(trans); | |
| 3414 | − goto err_destroy_flow_rule; | |
| 3415 | − } | |
| 3416 | − | |
| 3417 | 3441 | list_add_tail_rcu(&rule->list, &old_rule->list); |
| 3418 | 3442 | } else { |
| 3419 | 3443 | trans = nft_trans_rule_add(&ctx, NFT_MSG_NEWRULE, rule); |
| @@ -3943,8 +3967,9 @@ static void nf_tables_set_notify(const struct nft_ctx *ctx, · 523 unmodified lines | ||
| 3943 | 3967 | gfp_t gfp_flags) |
| 3944 | 3968 | { |
| 3945 | 3969 | struct nftables_pernet *nft_net = nft_pernet(ctx->net); |
| 3946 | − struct sk_buff *skb; | |
| 3947 | 3970 | u32 portid = ctx->portid; |
| 3971 | + struct sk_buff *skb; | |
| 3972 | + u16 flags = 0; | |
| 3948 | 3973 | int err; |
| 3949 | 3974 | |
| 3950 | 3975 | if (!ctx->report && |
| @@ -3955,7 +3980,10 @@ static void nf_tables_set_notify(const struct nft_ctx *ctx, · 4 unmodified lines | ||
| 3955 | 3980 | if (skb == NULL) |
| 3956 | 3981 | goto err; |
| 3957 | 3982 | |
| 3958 | − err = nf_tables_fill_set(skb, ctx, set, event, 0); | |
| 3983 | + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) | |
| 3984 | + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); | |
| 3985 | + | |
| 3986 | + err = nf_tables_fill_set(skb, ctx, set, event, flags); | |
| 3959 | 3987 | if (err < 0) { |
| 3960 | 3988 | kfree_skb(skb); |
| 3961 | 3989 | goto err; |
| @@ -5231,12 +5259,13 @@ static int nf_tables_getsetelem(struct sk_buff *skb, · 1269 unmodified lines | ||
| 5231 | 5259 | static void nf_tables_setelem_notify(const struct nft_ctx *ctx, |
| 5232 | 5260 | const struct nft_set *set, |
| 5233 | 5261 | const struct nft_set_elem *elem, |
| 5234 | − int event, u16 flags) | |
| 5262 | + int event) | |
| 5235 | 5263 | { |
| 5236 | 5264 | struct nftables_pernet *nft_net; |
| 5237 | 5265 | struct net *net = ctx->net; |
| 5238 | 5266 | u32 portid = ctx->portid; |
| 5239 | 5267 | struct sk_buff *skb; |
| 5268 | + u16 flags = 0; | |
| 5240 | 5269 | int err; |
| 5241 | 5270 | |
| 5242 | 5271 | if (!ctx->report && !nfnetlink_has_listeners(net, NFNLGRP_NFTABLES)) |
| @@ -5246,6 +5275,9 @@ static void nf_tables_setelem_notify(const struct nft_ctx *ctx, · 3 unmodified lines | ||
| 5246 | 5275 | if (skb == NULL) |
| 5247 | 5276 | goto err; |
| 5248 | 5277 | |
| 5278 | + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) | |
| 5279 | + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); | |
| 5280 | + | |
| 5249 | 5281 | err = nf_tables_fill_setelem_info(skb, ctx, 0, portid, event, flags, |
| 5250 | 5282 | set, elem); |
| 5251 | 5283 | if (err < 0) { |
| @@ -6921,7 +6953,7 @@ static int nf_tables_delobj(struct sk_buff *skb, const struct nfnl_info *info, · 1669 unmodified lines | ||
| 6921 | 6953 | |
| 6922 | 6954 | void nft_obj_notify(struct net *net, const struct nft_table *table, |
| 6923 | 6955 | struct nft_object *obj, u32 portid, u32 seq, int event, |
| 6924 | − int family, int report, gfp_t gfp) | |
| 6956 | + u16 flags, int family, int report, gfp_t gfp) | |
| 6925 | 6957 | { |
| 6926 | 6958 | struct nftables_pernet *nft_net = nft_pernet(net); |
| 6927 | 6959 | struct sk_buff *skb; |
| @@ -6946,8 +6978,9 @@ void nft_obj_notify(struct net *net, const struct nft_table *table, · 18 unmodified lines | ||
| 6946 | 6978 | if (skb == NULL) |
| 6947 | 6979 | goto err; |
| 6948 | 6980 | |
| 6949 | − err = nf_tables_fill_obj_info(skb, net, portid, seq, event, 0, family, | |
| 6950 | − table, obj, false); | |
| 6981 | + err = nf_tables_fill_obj_info(skb, net, portid, seq, event, | |
| 6982 | + flags & (NLM_F_CREATE | NLM_F_EXCL), | |
| 6983 | + family, table, obj, false); | |
| 6951 | 6984 | if (err < 0) { |
| 6952 | 6985 | kfree_skb(skb); |
| 6953 | 6986 | goto err; |
| @@ -6964,7 +6997,7 @@ static void nf_tables_obj_notify(const struct nft_ctx *ctx, · 10 unmodified lines | ||
| 6964 | 6997 | struct nft_object *obj, int event) |
| 6965 | 6998 | { |
| 6966 | 6999 | nft_obj_notify(ctx->net, ctx->table, obj, ctx->portid, ctx->seq, event, |
| 6967 | − ctx->family, ctx->report, GFP_KERNEL); | |
| 7000 | + ctx->flags, ctx->family, ctx->report, GFP_KERNEL); | |
| 6968 | 7001 | } |
| 6969 | 7002 | |
| 6970 | 7003 | /* |
| @@ -7745,6 +7778,7 @@ static void nf_tables_flowtable_notify(struct nft_ctx *ctx, · 774 unmodified lines | ||
| 7745 | 7778 | { |
| 7746 | 7779 | struct nftables_pernet *nft_net = nft_pernet(ctx->net); |
| 7747 | 7780 | struct sk_buff *skb; |
| 7781 | + u16 flags = 0; | |
| 7748 | 7782 | int err; |
| 7749 | 7783 | |
| 7750 | 7784 | if (!ctx->report && |
| @@ -7755,8 +7789,11 @@ static void nf_tables_flowtable_notify(struct nft_ctx *ctx, · 4 unmodified lines | ||
| 7755 | 7789 | if (skb == NULL) |
| 7756 | 7790 | goto err; |
| 7757 | 7791 | |
| 7792 | + if (ctx->flags & (NLM_F_CREATE | NLM_F_EXCL)) | |
| 7793 | + flags |= ctx->flags & (NLM_F_CREATE | NLM_F_EXCL); | |
| 7794 | + | |
| 7758 | 7795 | err = nf_tables_fill_flowtable_info(skb, ctx->net, ctx->portid, |
| 7759 | − ctx->seq, event, 0, | |
| 7796 | + ctx->seq, event, flags, | |
| 7760 | 7797 | ctx->family, flowtable, hook_list); |
| 7761 | 7798 | if (err < 0) { |
| 7762 | 7799 | kfree_skb(skb); |
| @@ -8634,7 +8671,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) · 871 unmodified lines | ||
| 8634 | 8671 | nft_setelem_activate(net, te->set, &te->elem); |
| 8635 | 8672 | nf_tables_setelem_notify(&trans->ctx, te->set, |
| 8636 | 8673 | &te->elem, |
| 8637 | − NFT_MSG_NEWSETELEM, 0); | |
| 8674 | + NFT_MSG_NEWSETELEM); | |
| 8638 | 8675 | nft_trans_destroy(trans); |
| 8639 | 8676 | break; |
| 8640 | 8677 | case NFT_MSG_DELSETELEM: |
| @@ -8642,7 +8679,7 @@ static int nf_tables_commit(struct net *net, struct sk_buff *skb) · 1 unmodified line | ||
| 8642 | 8679 | |
| 8643 | 8680 | nf_tables_setelem_notify(&trans->ctx, te->set, |
| 8644 | 8681 | &te->elem, |
| 8645 | − NFT_MSG_DELSETELEM, 0); | |
| 8682 | + NFT_MSG_DELSETELEM); | |
| 8646 | 8683 | nft_setelem_remove(net, te->set, &te->elem); |
| 8647 | 8684 | if (!nft_setelem_is_catchall(te->set, &te->elem)) { |
| 8648 | 8685 | atomic_dec(&te->set->nelems); |
| @@ -60,7 +60,7 @@ static void nft_quota_obj_eval(struct nft_object *obj, · 59 unmodified lines | ||
| 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[], |
| @@ -594,7 +594,10 @@ static int netlink_insert(struct sock *sk, u32 portid) · 593 unmodified lines | ||
| 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); |
| @@ -1012,7 +1015,8 @@ static int netlink_bind(struct socket *sock, struct sockaddr *addr, · 411 unmodified lines | ||
| 1012 | 1015 | if (nlk->ngroups < BITS_PER_LONG) |
| 1013 | 1016 | groups &= (1UL << nlk->ngroups) - 1; |
| 1014 | 1017 | |
| 1015 | − bound = nlk->bound; | |
| 1018 | + /* Paired with WRITE_ONCE() in netlink_insert() */ | |
| 1019 | + bound = READ_ONCE(nlk->bound); | |
| 1016 | 1020 | if (bound) { |
| 1017 | 1021 | /* Ensure nlk->portid is up-to-date. */ |
| 1018 | 1022 | smp_rmb(); |
| @@ -1098,8 +1102,9 @@ static int netlink_connect(struct socket *sock, struct sockaddr *addr, · 79 unmodified lines | ||
| 1098 | 1102 | |
| 1099 | 1103 | /* No need for barriers here as we return to user-space without |
| 1100 | 1104 | * using any of the bound attributes. |
| 1105 | + * Paired with WRITE_ONCE() in netlink_insert(). | |
| 1101 | 1106 | */ |
| 1102 | − if (!nlk->bound) | |
| 1107 | + if (!READ_ONCE(nlk->bound)) | |
| 1103 | 1108 | err = netlink_autobind(sock); |
| 1104 | 1109 | |
| 1105 | 1110 | if (err == 0) { |
| @@ -1869,7 +1874,8 @@ static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) · 763 unmodified lines | ||
| 1869 | 1874 | dst_group = nlk->dst_group; |
| 1870 | 1875 | } |
| 1871 | 1876 | |
| 1872 | − if (!nlk->bound) { | |
| 1877 | + /* Paired with WRITE_ONCE() in netlink_insert() */ | |
| 1878 | + if (!READ_ONCE(nlk->bound)) { | |
| 1873 | 1879 | err = netlink_autobind(sock); |
| 1874 | 1880 | if (err) |
| 1875 | 1881 | goto out; |
| @@ -233,6 +233,9 @@ int fifo_set_limit(struct Qdisc *q, unsigned int limit) · 232 unmodified lines | ||
| 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; |
| @@ -1641,6 +1641,10 @@ static void taprio_destroy(struct Qdisc *sch) · 1640 unmodified lines | ||
| 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 | |
| @@ -645,7 +645,7 @@ static bool gss_check_seq_num(const struct svc_rqst *rqstp, struct rsc *rsci, · 644 unmodified lines | ||
| 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)) |
| @@ -2882,6 +2882,9 @@ static int unix_shutdown(struct socket *sock, int mode) · 2881 unmodified lines | ||
| 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); |
| @@ -2904,12 +2907,10 @@ static int unix_shutdown(struct socket *sock, int mode) · 16 unmodified lines | ||
| 2904 | 2907 | other->sk_shutdown |= peer_mode; |
| 2905 | 2908 | unix_state_unlock(other); |
| 2906 | 2909 | other->sk_state_change(other); |
| 2907 | − if (peer_mode == SHUTDOWN_MASK) { | |
| 2910 | + if (peer_mode == SHUTDOWN_MASK) | |
| 2908 | 2911 | sk_wake_async(other, SOCK_WAKE_WAITD, POLL_HUP); |
| 2909 | − other->sk_state = TCP_CLOSE; | |
| 2910 | − } else if (peer_mode & RCV_SHUTDOWN) { | |
| 2912 | + else if (peer_mode & RCV_SHUTDOWN) | |
| 2911 | 2913 | sk_wake_async(other, SOCK_WAKE_WAITD, POLL_IN); |
| 2912 | − } | |
| 2913 | 2914 | } |
| 2914 | 2915 | if (other) |
| 2915 | 2916 | sock_put(other); |
| @@ -1961,24 +1961,65 @@ static struct sk_buff *xfrm_policy_netlink(struct sk_buff *in_skb, · 1960 unmodified lines | ||
| 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 | |
| @@ -1988,13 +2029,11 @@ static int xfrm_get_default(struct sk_buff *skb, struct nlmsghdr *nlh, · 3 unmodified lines | ||
| 1988 | 2029 | struct sk_buff *r_skb; |
| 1989 | 2030 | struct nlmsghdr *r_nlh; |
| 1990 | 2031 | struct net *net = sock_net(skb->sk); |
| 1991 | − struct xfrm_userpolicy_default *r_up, *up; | |
| 2032 | + struct xfrm_userpolicy_default *r_up; | |
| 1992 | 2033 | int len = NLMSG_ALIGN(sizeof(struct xfrm_userpolicy_default)); |
| 1993 | 2034 | u32 portid = NETLINK_CB(skb).portid; |
| 1994 | 2035 | u32 seq = nlh->nlmsg_seq; |
| 1995 | 2036 | |
| 1996 | − up = nlmsg_data(nlh); | |
| 1997 | − | |
| 1998 | 2037 | r_skb = nlmsg_new(len, GFP_ATOMIC); |
| 1999 | 2038 | if (!r_skb) |
| 2000 | 2039 | return -ENOMEM; |
| @@ -2007,8 +2046,12 @@ static int xfrm_get_default(struct sk_buff *skb, struct nlmsghdr *nlh, · 6 unmodified lines | ||
| 2007 | 2046 | |
| 2008 | 2047 | r_up = nlmsg_data(r_nlh); |
| 2009 | 2048 | |
| 2010 | − r_up->action = ((net->xfrm.policy_default & (1 << up->dirmask)) >> up->dirmask); | |
| 2011 | − r_up->dirmask = up->dirmask; | |
| 2049 | + r_up->in = net->xfrm.policy_default & XFRM_POL_DEFAULT_IN ? | |
| 2050 | + XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT; | |
| 2051 | + r_up->fwd = net->xfrm.policy_default & XFRM_POL_DEFAULT_FWD ? | |
| 2052 | + XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT; | |
| 2053 | + r_up->out = net->xfrm.policy_default & XFRM_POL_DEFAULT_OUT ? | |
| 2054 | + XFRM_USERPOLICY_BLOCK : XFRM_USERPOLICY_ACCEPT; | |
| 2012 | 2055 | nlmsg_end(r_skb, r_nlh); |
| 2013 | 2056 | |
| 2014 | 2057 | return nlmsg_unicast(net->xfrm.nlsk, r_skb, portid); |
| @@ -322,17 +322,11 @@ $(obj)/hbm_edt_kern.o: $(src)/hbm.h $(src)/hbm_kern.h · 321 unmodified lines | ||
| 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 | 329 | |
| 332 | −ifeq ($(VMLINUX_BTF),) | |
| 333 | −$(error Cannot find a vmlinux for VMLINUX_BTF at any of "$(VMLINUX_BTF_PATHS)") | |
| 334 | −endif | |
| 335 | − | |
| 336 | 330 | $(obj)/vmlinux.h: $(VMLINUX_BTF) $(BPFTOOL) |
| 337 | 331 | ifeq ($(VMLINUX_H),) |
| 338 | 332 | $(Q)$(BPFTOOL) btf dump file $(VMLINUX_BTF) format c > $@ |
| @@ -340,6 +334,11 @@ else · 1 unmodified line | ||
| 340 | 334 | $(Q)cp "$(VMLINUX_H)" $@ |
| 341 | 335 | endif |
| 342 | 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) | |
| 340 | +endif | |
| 341 | + | |
| 343 | 342 | clean-files += vmlinux.h |
| 344 | 343 | |
| 345 | 344 | # Get Clang's default includes on this system, as opposed to those seen by |
| @@ -1,4 +1,4 @@ | ||
| 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,11 +5,6 @@ · 4 unmodified lines | ||
| 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)); |
| @@ -126,6 +126,8 @@ static const struct nlmsg_perm nlmsg_xfrm_perms[] = · 125 unmodified lines | ||
| 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[] = |
| @@ -189,7 +191,7 @@ int selinux_nlmsg_lookup(u16 sclass, u16 nlmsg_type, u32 *perm) · 57 unmodified lines | ||
| 189 | 191 | * structures at the top of this file with the new mappings |
| 190 | 192 | * before updating the BUILD_BUG_ON() macro! |
| 191 | 193 | */ |
| 192 | − BUILD_BUG_ON(XFRM_MSG_MAX != XFRM_MSG_MAPPING); | |
| 194 | + BUILD_BUG_ON(XFRM_MSG_MAX != XFRM_MSG_GETDEFAULT); | |
| 193 | 195 | err = nlmsg_perm(nlmsg_type, perm, nlmsg_xfrm_perms, |
| 194 | 196 | sizeof(nlmsg_xfrm_perms)); |
| 195 | 197 | break; |
| @@ -784,6 +784,7 @@ struct snd_rawmidi_status { · 783 unmodified lines | ||
| 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) |
| @@ -7024,7 +7024,8 @@ int bpf_object__load_xattr(struct bpf_object_load_attr *attr) · 7023 unmodified lines | ||
| 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) |
| @@ -88,6 +88,7 @@ void strset__free(struct strset *set) · 87 unmodified lines | ||
| 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) |
| @@ -58,6 +58,24 @@ void __weak arch_handle_alternative(unsigned short feature, struct special_alt * · 57 unmodified lines | ||
| 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) |
| @@ -91,15 +109,14 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry, · 27 unmodified lines | ||
| 91 | 109 | WARN_FUNC("can't find orig reloc", sec, offset + entry->orig); |
| 92 | 110 | return -1; |
| 93 | 111 | } |
| 94 | − if (orig_reloc->sym->type != STT_SECTION) { | |
| 95 | − WARN_FUNC("don't know how to handle non-section reloc symbol %s", | |
| 96 | − sec, offset + entry->orig, orig_reloc->sym->name); | |
| 112 | + if (!reloc2sec_off(orig_reloc, &alt->orig_sec, &alt->orig_off)) { | |
| 113 | + WARN_FUNC("don't know how to handle reloc symbol type %d: %s", | |
| 114 | + sec, offset + entry->orig, | |
| 115 | + orig_reloc->sym->type, | |
| 116 | + orig_reloc->sym->name); | |
| 97 | 117 | return -1; |
| 98 | 118 | } |
| 99 | 119 | |
| 100 | − alt->orig_sec = orig_reloc->sym->sec; | |
| 101 | − alt->orig_off = orig_reloc->addend; | |
| 102 | − | |
| 103 | 120 | if (!entry->group || alt->new_len) { |
| 104 | 121 | new_reloc = find_reloc_by_dest(elf, sec, offset + entry->new); |
| 105 | 122 | if (!new_reloc) { |
| @@ -116,8 +133,13 @@ static int get_alt_entry(struct elf *elf, struct special_entry *entry, · 10 unmodified lines | ||
| 116 | 133 | if (arch_is_retpoline(new_reloc->sym)) |
| 117 | 134 | return 1; |
| 118 | 135 | |
| 119 | − alt->new_sec = new_reloc->sym->sec; | |
| 120 | − alt->new_off = (unsigned int)new_reloc->addend; | |
| 136 | + if (!reloc2sec_off(new_reloc, &alt->new_sec, &alt->new_off)) { | |
| 137 | + WARN_FUNC("don't know how to handle reloc symbol type %d: %s", | |
| 138 | + sec, offset + entry->new, | |
| 139 | + new_reloc->sym->type, | |
| 140 | + new_reloc->sym->name); | |
| 141 | + return -1; | |
| 142 | + } | |
| 121 | 143 | |
| 122 | 144 | /* _ASM_EXTABLE_EX hack */ |
| 123 | 145 | if (alt->new_off >= 0x7ffffff0) |
| @@ -143,7 +143,7 @@ FEATURE_CHECK_LDFLAGS-libcrypto = -lcrypto · 142 unmodified lines | ||
| 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 |
| @@ -802,7 +802,7 @@ endif · 801 unmodified lines | ||
| 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 |
| @@ -1285,6 +1285,7 @@ int main(int argc, char *argv[]) · 1284 unmodified lines | ||
| 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 | |
| @@ -1306,6 +1307,7 @@ err_close_eventsfp: · 15 unmodified lines | ||
| 1306 | 1307 | create_empty_mapping(output_file); |
| 1307 | 1308 | err_out: |
| 1308 | 1309 | free_arch_std_events(); |
| 1310 | + free_sys_event_tables(); | |
| 1309 | 1311 | free(mapfile); |
| 1310 | 1312 | return ret; |
| 1311 | 1313 | } |
| @@ -68,3 +68,100 @@ fd=10 · 67 unmodified lines | ||
| 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 | |
| @@ -70,12 +70,109 @@ type=0 · 69 unmodified lines | ||
| 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 |
| @@ -84,8 +181,8 @@ optional=1 · 2 unmodified lines | ||
| 84 | 181 | # PERF_COUNT_HW_CACHE_L1D << 0 | |
| 85 | 182 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 86 | 183 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 87 | −[event12:base-stat] | |
| 88 | −fd=12 | |
| 184 | +[event21:base-stat] | |
| 185 | +fd=21 | |
| 89 | 186 | type=3 |
| 90 | 187 | config=65536 |
| 91 | 188 | optional=1 |
| @@ -94,8 +191,8 @@ optional=1 · 2 unmodified lines | ||
| 94 | 191 | # PERF_COUNT_HW_CACHE_LL << 0 | |
| 95 | 192 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 96 | 193 | # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) |
| 97 | −[event13:base-stat] | |
| 98 | −fd=13 | |
| 194 | +[event22:base-stat] | |
| 195 | +fd=22 | |
| 99 | 196 | type=3 |
| 100 | 197 | config=2 |
| 101 | 198 | optional=1 |
| @@ -104,8 +201,8 @@ optional=1 · 2 unmodified lines | ||
| 104 | 201 | # PERF_COUNT_HW_CACHE_LL << 0 | |
| 105 | 202 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 106 | 203 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 107 | −[event14:base-stat] | |
| 108 | −fd=14 | |
| 204 | +[event23:base-stat] | |
| 205 | +fd=23 | |
| 109 | 206 | type=3 |
| 110 | 207 | config=65538 |
| 111 | 208 | optional=1 |
| @@ -70,12 +70,109 @@ type=0 · 69 unmodified lines | ||
| 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 |
| @@ -84,8 +181,8 @@ optional=1 · 2 unmodified lines | ||
| 84 | 181 | # PERF_COUNT_HW_CACHE_L1D << 0 | |
| 85 | 182 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 86 | 183 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 87 | −[event12:base-stat] | |
| 88 | −fd=12 | |
| 184 | +[event21:base-stat] | |
| 185 | +fd=21 | |
| 89 | 186 | type=3 |
| 90 | 187 | config=65536 |
| 91 | 188 | optional=1 |
| @@ -94,8 +191,8 @@ optional=1 · 2 unmodified lines | ||
| 94 | 191 | # PERF_COUNT_HW_CACHE_LL << 0 | |
| 95 | 192 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 96 | 193 | # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) |
| 97 | −[event13:base-stat] | |
| 98 | −fd=13 | |
| 194 | +[event22:base-stat] | |
| 195 | +fd=22 | |
| 99 | 196 | type=3 |
| 100 | 197 | config=2 |
| 101 | 198 | optional=1 |
| @@ -104,8 +201,8 @@ optional=1 · 2 unmodified lines | ||
| 104 | 201 | # PERF_COUNT_HW_CACHE_LL << 0 | |
| 105 | 202 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 106 | 203 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 107 | −[event14:base-stat] | |
| 108 | −fd=14 | |
| 204 | +[event23:base-stat] | |
| 205 | +fd=23 | |
| 109 | 206 | type=3 |
| 110 | 207 | config=65538 |
| 111 | 208 | optional=1 |
| @@ -114,8 +211,8 @@ optional=1 · 2 unmodified lines | ||
| 114 | 211 | # PERF_COUNT_HW_CACHE_L1I << 0 | |
| 115 | 212 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 116 | 213 | # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) |
| 117 | −[event15:base-stat] | |
| 118 | −fd=15 | |
| 214 | +[event24:base-stat] | |
| 215 | +fd=24 | |
| 119 | 216 | type=3 |
| 120 | 217 | config=1 |
| 121 | 218 | optional=1 |
| @@ -124,8 +221,8 @@ optional=1 · 2 unmodified lines | ||
| 124 | 221 | # PERF_COUNT_HW_CACHE_L1I << 0 | |
| 125 | 222 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 126 | 223 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 127 | −[event16:base-stat] | |
| 128 | −fd=16 | |
| 224 | +[event25:base-stat] | |
| 225 | +fd=25 | |
| 129 | 226 | type=3 |
| 130 | 227 | config=65537 |
| 131 | 228 | optional=1 |
| @@ -134,8 +231,8 @@ optional=1 · 2 unmodified lines | ||
| 134 | 231 | # PERF_COUNT_HW_CACHE_DTLB << 0 | |
| 135 | 232 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 136 | 233 | # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) |
| 137 | −[event17:base-stat] | |
| 138 | −fd=17 | |
| 234 | +[event26:base-stat] | |
| 235 | +fd=26 | |
| 139 | 236 | type=3 |
| 140 | 237 | config=3 |
| 141 | 238 | optional=1 |
| @@ -144,8 +241,8 @@ optional=1 · 2 unmodified lines | ||
| 144 | 241 | # PERF_COUNT_HW_CACHE_DTLB << 0 | |
| 145 | 242 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 146 | 243 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 147 | −[event18:base-stat] | |
| 148 | −fd=18 | |
| 244 | +[event27:base-stat] | |
| 245 | +fd=27 | |
| 149 | 246 | type=3 |
| 150 | 247 | config=65539 |
| 151 | 248 | optional=1 |
| @@ -154,8 +251,8 @@ optional=1 · 2 unmodified lines | ||
| 154 | 251 | # PERF_COUNT_HW_CACHE_ITLB << 0 | |
| 155 | 252 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 156 | 253 | # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) |
| 157 | −[event19:base-stat] | |
| 158 | −fd=19 | |
| 254 | +[event28:base-stat] | |
| 255 | +fd=28 | |
| 159 | 256 | type=3 |
| 160 | 257 | config=4 |
| 161 | 258 | optional=1 |
| @@ -164,8 +261,8 @@ optional=1 · 2 unmodified lines | ||
| 164 | 261 | # PERF_COUNT_HW_CACHE_ITLB << 0 | |
| 165 | 262 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 166 | 263 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 167 | −[event20:base-stat] | |
| 168 | −fd=20 | |
| 264 | +[event29:base-stat] | |
| 265 | +fd=29 | |
| 169 | 266 | type=3 |
| 170 | 267 | config=65540 |
| 171 | 268 | optional=1 |
| @@ -70,12 +70,109 @@ type=0 · 69 unmodified lines | ||
| 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 |
| @@ -84,8 +181,8 @@ optional=1 · 2 unmodified lines | ||
| 84 | 181 | # PERF_COUNT_HW_CACHE_L1D << 0 | |
| 85 | 182 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 86 | 183 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 87 | −[event12:base-stat] | |
| 88 | −fd=12 | |
| 184 | +[event21:base-stat] | |
| 185 | +fd=21 | |
| 89 | 186 | type=3 |
| 90 | 187 | config=65536 |
| 91 | 188 | optional=1 |
| @@ -94,8 +191,8 @@ optional=1 · 2 unmodified lines | ||
| 94 | 191 | # PERF_COUNT_HW_CACHE_LL << 0 | |
| 95 | 192 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 96 | 193 | # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) |
| 97 | −[event13:base-stat] | |
| 98 | −fd=13 | |
| 194 | +[event22:base-stat] | |
| 195 | +fd=22 | |
| 99 | 196 | type=3 |
| 100 | 197 | config=2 |
| 101 | 198 | optional=1 |
| @@ -104,8 +201,8 @@ optional=1 · 2 unmodified lines | ||
| 104 | 201 | # PERF_COUNT_HW_CACHE_LL << 0 | |
| 105 | 202 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 106 | 203 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 107 | −[event14:base-stat] | |
| 108 | −fd=14 | |
| 204 | +[event23:base-stat] | |
| 205 | +fd=23 | |
| 109 | 206 | type=3 |
| 110 | 207 | config=65538 |
| 111 | 208 | optional=1 |
| @@ -114,8 +211,8 @@ optional=1 · 2 unmodified lines | ||
| 114 | 211 | # PERF_COUNT_HW_CACHE_L1I << 0 | |
| 115 | 212 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 116 | 213 | # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) |
| 117 | −[event15:base-stat] | |
| 118 | −fd=15 | |
| 214 | +[event24:base-stat] | |
| 215 | +fd=24 | |
| 119 | 216 | type=3 |
| 120 | 217 | config=1 |
| 121 | 218 | optional=1 |
| @@ -124,8 +221,8 @@ optional=1 · 2 unmodified lines | ||
| 124 | 221 | # PERF_COUNT_HW_CACHE_L1I << 0 | |
| 125 | 222 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 126 | 223 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 127 | −[event16:base-stat] | |
| 128 | −fd=16 | |
| 224 | +[event25:base-stat] | |
| 225 | +fd=25 | |
| 129 | 226 | type=3 |
| 130 | 227 | config=65537 |
| 131 | 228 | optional=1 |
| @@ -134,8 +231,8 @@ optional=1 · 2 unmodified lines | ||
| 134 | 231 | # PERF_COUNT_HW_CACHE_DTLB << 0 | |
| 135 | 232 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 136 | 233 | # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) |
| 137 | −[event17:base-stat] | |
| 138 | −fd=17 | |
| 234 | +[event26:base-stat] | |
| 235 | +fd=26 | |
| 139 | 236 | type=3 |
| 140 | 237 | config=3 |
| 141 | 238 | optional=1 |
| @@ -144,8 +241,8 @@ optional=1 · 2 unmodified lines | ||
| 144 | 241 | # PERF_COUNT_HW_CACHE_DTLB << 0 | |
| 145 | 242 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 146 | 243 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 147 | −[event18:base-stat] | |
| 148 | −fd=18 | |
| 244 | +[event27:base-stat] | |
| 245 | +fd=27 | |
| 149 | 246 | type=3 |
| 150 | 247 | config=65539 |
| 151 | 248 | optional=1 |
| @@ -154,8 +251,8 @@ optional=1 · 2 unmodified lines | ||
| 154 | 251 | # PERF_COUNT_HW_CACHE_ITLB << 0 | |
| 155 | 252 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 156 | 253 | # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) |
| 157 | −[event19:base-stat] | |
| 158 | −fd=19 | |
| 254 | +[event28:base-stat] | |
| 255 | +fd=28 | |
| 159 | 256 | type=3 |
| 160 | 257 | config=4 |
| 161 | 258 | optional=1 |
| @@ -164,8 +261,8 @@ optional=1 · 2 unmodified lines | ||
| 164 | 261 | # PERF_COUNT_HW_CACHE_ITLB << 0 | |
| 165 | 262 | # (PERF_COUNT_HW_CACHE_OP_READ << 8) | |
| 166 | 263 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 167 | −[event20:base-stat] | |
| 168 | −fd=20 | |
| 264 | +[event29:base-stat] | |
| 265 | +fd=29 | |
| 169 | 266 | type=3 |
| 170 | 267 | config=65540 |
| 171 | 268 | optional=1 |
| @@ -174,8 +271,8 @@ optional=1 · 2 unmodified lines | ||
| 174 | 271 | # PERF_COUNT_HW_CACHE_L1D << 0 | |
| 175 | 272 | # (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) | |
| 176 | 273 | # (PERF_COUNT_HW_CACHE_RESULT_ACCESS << 16) |
| 177 | −[event21:base-stat] | |
| 178 | −fd=21 | |
| 274 | +[event30:base-stat] | |
| 275 | +fd=30 | |
| 179 | 276 | type=3 |
| 180 | 277 | config=512 |
| 181 | 278 | optional=1 |
| @@ -184,8 +281,8 @@ optional=1 · 2 unmodified lines | ||
| 184 | 281 | # PERF_COUNT_HW_CACHE_L1D << 0 | |
| 185 | 282 | # (PERF_COUNT_HW_CACHE_OP_PREFETCH << 8) | |
| 186 | 283 | # (PERF_COUNT_HW_CACHE_RESULT_MISS << 16) |
| 187 | −[event22:base-stat] | |
| 188 | −fd=22 | |
| 284 | +[event31:base-stat] | |
| 285 | +fd=31 | |
| 189 | 286 | type=3 |
| 190 | 287 | config=66048 |
| 191 | 288 | optional=1 |
| @@ -1,10 +1,13 @@ | ||
| 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> |
| @@ -315,7 +315,7 @@ static inline void set_xmm(int n, unsigned long val) · 314 unmodified lines | ||
| 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 | |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | ||
| 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> |
| @@ -39,6 +40,7 @@ static __thread volatile struct rseq __rseq = { · 23 unmodified lines | ||
| 39 | 40 | |
| 40 | 41 | static pthread_t migration_thread; |
| 41 | 42 | static cpu_set_t possible_mask; |
| 43 | +static int min_cpu, max_cpu; | |
| 42 | 44 | static bool done; |
| 43 | 45 | |
| 44 | 46 | static atomic_t seq_cnt; |
| @@ -57,20 +59,37 @@ static void sys_rseq(int flags) · 12 unmodified lines | ||
| 57 | 59 | TEST_ASSERT(!r, "rseq failed, errno = %d (%s)", errno, strerror(errno)); |
| 58 | 60 | } |
| 59 | 61 | |
| 62 | +static int next_cpu(int cpu) | |
| 63 | +{ | |
| 64 | + /* | |
| 65 | + * Advance to the next CPU, skipping those that weren't in the original | |
| 66 | + * affinity set. Sadly, there is no CPU_SET_FOR_EACH, and cpu_set_t's | |
| 67 | + * data storage is considered as opaque. Note, if this task is pinned | |
| 68 | + * to a small set of discontigous CPUs, e.g. 2 and 1023, this loop will | |
| 69 | + * burn a lot cycles and the test will take longer than normal to | |
| 70 | + * complete. | |
| 71 | + */ | |
| 72 | + do { | |
| 73 | + cpu++; | |
| 74 | + if (cpu > max_cpu) { | |
| 75 | + cpu = min_cpu; | |
| 76 | + TEST_ASSERT(CPU_ISSET(cpu, &possible_mask), | |
| 77 | + "Min CPU = %d must always be usable", cpu); | |
| 78 | + break; | |
| 79 | + } | |
| 80 | + } while (!CPU_ISSET(cpu, &possible_mask)); | |
| 81 | + | |
| 82 | + return cpu; | |
| 83 | +} | |
| 84 | + | |
| 60 | 85 | static void *migration_worker(void *ign) |
| 61 | 86 | { |
| 62 | 87 | cpu_set_t allowed_mask; |
| 63 | − int r, i, nr_cpus, cpu; | |
| 88 | + int r, i, cpu; | |
| 64 | 89 | |
| 65 | 90 | CPU_ZERO(&allowed_mask); |
| 66 | 91 | |
| 67 | − nr_cpus = CPU_COUNT(&possible_mask); | |
| 68 | − | |
| 69 | − for (i = 0; i < NR_TASK_MIGRATIONS; i++) { | |
| 70 | − cpu = i % nr_cpus; | |
| 71 | − if (!CPU_ISSET(cpu, &possible_mask)) | |
| 72 | − continue; | |
| 73 | − | |
| 92 | + for (i = 0, cpu = min_cpu; i < NR_TASK_MIGRATIONS; i++, cpu = next_cpu(cpu)) { | |
| 74 | 93 | CPU_SET(cpu, &allowed_mask); |
| 75 | 94 | |
| 76 | 95 | /* |
| @@ -154,6 +173,36 @@ static void *migration_worker(void *ign) · 77 unmodified lines | ||
| 154 | 173 | return NULL; |
| 155 | 174 | } |
| 156 | 175 | |
| 176 | +static int calc_min_max_cpu(void) | |
| 177 | +{ | |
| 178 | + int i, cnt, nproc; | |
| 179 | + | |
| 180 | + if (CPU_COUNT(&possible_mask) < 2) | |
| 181 | + return -EINVAL; | |
| 182 | + | |
| 183 | + /* | |
| 184 | + * CPU_SET doesn't provide a FOR_EACH helper, get the min/max CPU that | |
| 185 | + * this task is affined to in order to reduce the time spent querying | |
| 186 | + * unusable CPUs, e.g. if this task is pinned to a small percentage of | |
| 187 | + * total CPUs. | |
| 188 | + */ | |
| 189 | + nproc = get_nprocs_conf(); | |
| 190 | + min_cpu = -1; | |
| 191 | + max_cpu = -1; | |
| 192 | + cnt = 0; | |
| 193 | + | |
| 194 | + for (i = 0; i < nproc; i++) { | |
| 195 | + if (!CPU_ISSET(i, &possible_mask)) | |
| 196 | + continue; | |
| 197 | + if (min_cpu == -1) | |
| 198 | + min_cpu = i; | |
| 199 | + max_cpu = i; | |
| 200 | + cnt++; | |
| 201 | + } | |
| 202 | + | |
| 203 | + return (cnt < 2) ? -EINVAL : 0; | |
| 204 | +} | |
| 205 | + | |
| 157 | 206 | int main(int argc, char *argv[]) |
| 158 | 207 | { |
| 159 | 208 | int r, i, snapshot; |
| @@ -167,8 +216,8 @@ int main(int argc, char *argv[]) · 7 unmodified lines | ||
| 167 | 216 | TEST_ASSERT(!r, "sched_getaffinity failed, errno = %d (%s)", errno, |
| 168 | 217 | strerror(errno)); |
| 169 | 218 | |
| 170 | − if (CPU_COUNT(&possible_mask) < 2) { | |
| 171 | − print_skip("Only one CPU, task migration not possible\n"); | |
| 219 | + if (calc_min_max_cpu()) { | |
| 220 | + print_skip("Only one usable CPU, task migration not possible"); | |
| 172 | 221 | exit(KSFT_SKIP); |
| 173 | 222 | } |
| 174 | 223 | |