Unified · Split
| @@ -36,6 +36,7 @@ Andrew Morton <akpm@linux-foundation.org> · 35 unmodified lines | ||
| 36 | 36 | Andrew Murray <amurray@thegoodpenguin.co.uk> <amurray@embedded-bits.co.uk> |
| 37 | 37 | Andrew Murray <amurray@thegoodpenguin.co.uk> <andrew.murray@arm.com> |
| 38 | 38 | Andrew Vasquez <andrew.vasquez@qlogic.com> |
| 39 | +Andrey Konovalov <andreyknvl@gmail.com> <andreyknvl@google.com> | |
| 39 | 40 | Andrey Ryabinin <ryabinin.a.a@gmail.com> <a.ryabinin@samsung.com> |
| 40 | 41 | Andrey Ryabinin <ryabinin.a.a@gmail.com> <aryabinin@virtuozzo.com> |
| 41 | 42 | Andy Adamson <andros@citi.umich.edu> |
| @@ -65,6 +66,8 @@ Changbin Du <changbin.du@intel.com> <changbin.du@gmail.com> · 23 unmodified lines | ||
| 65 | 66 | Changbin Du <changbin.du@intel.com> <changbin.du@intel.com> |
| 66 | 67 | Chao Yu <chao@kernel.org> <chao2.yu@samsung.com> |
| 67 | 68 | Chao Yu <chao@kernel.org> <yuchao0@huawei.com> |
| 69 | +Chris Chiu <chris.chiu@canonical.com> <chiu@endlessm.com> | |
| 70 | +Chris Chiu <chris.chiu@canonical.com> <chiu@endlessos.org> | |
| 68 | 71 | Christophe Ricard <christophe.ricard@gmail.com> |
| 69 | 72 | Christoph Hellwig <hch@lst.de> |
| 70 | 73 | Corey Minyard <minyard@acm.org> |
| @@ -165,6 +168,7 @@ Johan Hovold <johan@kernel.org> <jhovold@gmail.com> · 94 unmodified lines | ||
| 165 | 168 | Johan Hovold <johan@kernel.org> <johan@hovoldconsulting.com> |
| 166 | 169 | John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de> |
| 167 | 170 | John Stultz <johnstul@us.ibm.com> |
| 171 | +Jordan Crouse <jordan@cosmicpenguin.net> <jcrouse@codeaurora.org> | |
| 168 | 172 | <josh@joshtriplett.org> <josh@freedesktop.org> |
| 169 | 173 | <josh@joshtriplett.org> <josh@kernel.org> |
| 170 | 174 | <josh@joshtriplett.org> <josht@linux.vnet.ibm.com> |
| @@ -250,8 +254,14 @@ Morten Welinder <welinder@anemone.rentec.com> · 79 unmodified lines | ||
| 250 | 254 | Morten Welinder <welinder@darter.rentec.com> |
| 251 | 255 | Morten Welinder <welinder@troll.com> |
| 252 | 256 | Mythri P K <mythripk@ti.com> |
| 257 | +Nadia Yvette Chambers <nyc@holomorphy.com> William Lee Irwin III <wli@holomorphy.com> | |
| 253 | 258 | Nathan Chancellor <nathan@kernel.org> <natechancellor@gmail.com> |
| 254 | 259 | Nguyen Anh Quynh <aquynh@gmail.com> |
| 260 | +Nicholas Piggin <npiggin@gmail.com> <npiggen@suse.de> | |
| 261 | +Nicholas Piggin <npiggin@gmail.com> <npiggin@kernel.dk> | |
| 262 | +Nicholas Piggin <npiggin@gmail.com> <npiggin@suse.de> | |
| 263 | +Nicholas Piggin <npiggin@gmail.com> <nickpiggin@yahoo.com.au> | |
| 264 | +Nicholas Piggin <npiggin@gmail.com> <piggin@cyberone.com.au> | |
| 255 | 265 | Nicolas Ferre <nicolas.ferre@microchip.com> <nicolas.ferre@atmel.com> |
| 256 | 266 | Nicolas Pitre <nico@fluxnic.net> <nicolas.pitre@linaro.org> |
| 257 | 267 | Nicolas Pitre <nico@fluxnic.net> <nico@linaro.org> |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | What: /sys/kernel/debug/moxtet/input |
| 2 | 2 | Date: March 2019 |
| 3 | 3 | KernelVersion: 5.3 |
| 4 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 4 | +Contact: Marek Behún <kabel@kernel.org> | |
| 5 | 5 | Description: (Read) Read input from the shift registers, in hexadecimal. |
| 6 | 6 | Returns N+1 bytes, where N is the number of Moxtet connected |
| 7 | 7 | modules. The first byte is from the CPU board itself. |
| @@ -19,7 +19,7 @@ Description: (Read) Read input from the shift registers, in hexadecimal. · 11 unmodified lines | ||
| 19 | 19 | What: /sys/kernel/debug/moxtet/output |
| 20 | 20 | Date: March 2019 |
| 21 | 21 | KernelVersion: 5.3 |
| 22 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 22 | +Contact: Marek Behún <kabel@kernel.org> | |
| 23 | 23 | Description: (RW) Read last written value to the shift registers, in |
| 24 | 24 | hexadecimal, or write values to the shift registers, also |
| 25 | 25 | in hexadecimal. |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | What: /sys/kernel/debug/turris-mox-rwtm/do_sign |
| 2 | 2 | Date: Jun 2020 |
| 3 | 3 | KernelVersion: 5.8 |
| 4 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 4 | +Contact: Marek Behún <kabel@kernel.org> | |
| 5 | 5 | Description: |
| 6 | 6 | |
| 7 | 7 | ======= =========================================================== |
| @@ -1,17 +1,17 @@ | ||
| 1 | 1 | What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_description |
| 2 | 2 | Date: March 2019 |
| 3 | 3 | KernelVersion: 5.3 |
| 4 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 4 | +Contact: Marek Behún <kabel@kernel.org> | |
| 5 | 5 | Description: (Read) Moxtet module description. Format: string |
| 6 | 6 | |
| 7 | 7 | What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_id |
| 8 | 8 | Date: March 2019 |
| 9 | 9 | KernelVersion: 5.3 |
| 10 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 10 | +Contact: Marek Behún <kabel@kernel.org> | |
| 11 | 11 | Description: (Read) Moxtet module ID. Format: %x |
| 12 | 12 | |
| 13 | 13 | What: /sys/bus/moxtet/devices/moxtet-<name>.<addr>/module_name |
| 14 | 14 | Date: March 2019 |
| 15 | 15 | KernelVersion: 5.3 |
| 16 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 16 | +Contact: Marek Behún <kabel@kernel.org> | |
| 17 | 17 | Description: (Read) Moxtet module name. Format: string |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | What: /sys/class/leds/<led>/device/brightness |
| 2 | 2 | Date: July 2020 |
| 3 | 3 | KernelVersion: 5.9 |
| 4 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 4 | +Contact: Marek Behún <kabel@kernel.org> | |
| 5 | 5 | Description: (RW) On the front panel of the Turris Omnia router there is also |
| 6 | 6 | a button which can be used to control the intensity of all the |
| 7 | 7 | LEDs at once, so that if they are too bright, user can dim them. |
| @@ -1,21 +1,21 @@ | ||
| 1 | 1 | What: /sys/firmware/turris-mox-rwtm/board_version |
| 2 | 2 | Date: August 2019 |
| 3 | 3 | KernelVersion: 5.4 |
| 4 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 4 | +Contact: Marek Behún <kabel@kernel.org> | |
| 5 | 5 | Description: (Read) Board version burned into eFuses of this Turris Mox board. |
| 6 | 6 | Format: %i |
| 7 | 7 | |
| 8 | 8 | What: /sys/firmware/turris-mox-rwtm/mac_address* |
| 9 | 9 | Date: August 2019 |
| 10 | 10 | KernelVersion: 5.4 |
| 11 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 11 | +Contact: Marek Behún <kabel@kernel.org> | |
| 12 | 12 | Description: (Read) MAC addresses burned into eFuses of this Turris Mox board. |
| 13 | 13 | Format: %pM |
| 14 | 14 | |
| 15 | 15 | What: /sys/firmware/turris-mox-rwtm/pubkey |
| 16 | 16 | Date: August 2019 |
| 17 | 17 | KernelVersion: 5.4 |
| 18 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 18 | +Contact: Marek Behún <kabel@kernel.org> | |
| 19 | 19 | Description: (Read) ECDSA public key (in pubkey hex compressed form) computed |
| 20 | 20 | as pair to the ECDSA private key burned into eFuses of this |
| 21 | 21 | Turris Mox Board. |
| @@ -24,7 +24,7 @@ Description: (Read) ECDSA public key (in pubkey hex compressed form) computed · 2 unmodified lines | ||
| 24 | 24 | What: /sys/firmware/turris-mox-rwtm/ram_size |
| 25 | 25 | Date: August 2019 |
| 26 | 26 | KernelVersion: 5.4 |
| 27 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 27 | +Contact: Marek Behún <kabel@kernel.org> | |
| 28 | 28 | Description: (Read) RAM size in MiB of this Turris Mox board as was detected |
| 29 | 29 | during manufacturing and burned into eFuses. Can be 512 or 1024. |
| 30 | 30 | Format: %i |
| @@ -32,6 +32,6 @@ Description: (Read) RAM size in MiB of this Turris Mox board as was detected · 1 unmodified line | ||
| 32 | 32 | What: /sys/firmware/turris-mox-rwtm/serial_number |
| 33 | 33 | Date: August 2019 |
| 34 | 34 | KernelVersion: 5.4 |
| 35 | −Contact: Marek Behún <marek.behun@nic.cz> | |
| 35 | +Contact: Marek Behún <kabel@kernel.org> | |
| 36 | 36 | Description: (Read) Serial number burned into eFuses of this Turris Mox device. |
| 37 | 37 | Format: %016X |
| @@ -33,7 +33,7 @@ Contact: xfs@oss.sgi.com · 32 unmodified lines | ||
| 33 | 33 | Description: |
| 34 | 34 | The current state of the log write grant head. It |
| 35 | 35 | represents the total log reservation of all currently |
| 36 | − oustanding transactions, including regrants due to | |
| 36 | + outstanding transactions, including regrants due to | |
| 37 | 37 | rolling transactions. The grant head is exported in |
| 38 | 38 | "cycle:bytes" format. |
| 39 | 39 | Users: xfstests |
| @@ -17,12 +17,12 @@ For ACPI on arm64, tables also fall into the following categories: · 16 unmodified lines | ||
| 17 | 17 | |
| 18 | 18 | - Recommended: BERT, EINJ, ERST, HEST, PCCT, SSDT |
| 19 | 19 | |
| 20 | − - Optional: BGRT, CPEP, CSRT, DBG2, DRTM, ECDT, FACS, FPDT, IORT, | |
| 21 | − MCHI, MPST, MSCT, NFIT, PMTT, RASF, SBST, SLIT, SPMI, SRAT, STAO, | |
| 22 | − TCPA, TPM2, UEFI, XENV | |
| 20 | + - Optional: BGRT, CPEP, CSRT, DBG2, DRTM, ECDT, FACS, FPDT, IBFT, | |
| 21 | + IORT, MCHI, MPST, MSCT, NFIT, PMTT, RASF, SBST, SLIT, SPMI, SRAT, | |
| 22 | + STAO, TCPA, TPM2, UEFI, XENV | |
| 23 | 23 | |
| 24 | − - Not supported: BOOT, DBGP, DMAR, ETDT, HPET, IBFT, IVRS, LPIT, | |
| 25 | − MSDM, OEMx, PSDT, RSDT, SLIC, WAET, WDAT, WDRT, WPBT | |
| 24 | + - Not supported: BOOT, DBGP, DMAR, ETDT, HPET, IVRS, LPIT, MSDM, OEMx, | |
| 25 | + PSDT, RSDT, SLIC, WAET, WDAT, WDRT, WPBT | |
| 26 | 26 | |
| 27 | 27 | ====== ======================================================================== |
| 28 | 28 | Table Usage for ARMv8 Linux |
| @@ -130,6 +130,9 @@ stable kernels. · 129 unmodified lines | ||
| 130 | 130 | | Marvell | ARM-MMU-500 | #582743 | N/A | |
| 131 | 131 | +----------------+-----------------+-----------------+-----------------------------+ |
| 132 | 132 | +----------------+-----------------+-----------------+-----------------------------+ |
| 133 | +| NVIDIA | Carmel Core | N/A | NVIDIA_CARMEL_CNP_ERRATUM | | |
| 134 | ++----------------+-----------------+-----------------+-----------------------------+ | |
| 135 | ++----------------+-----------------+-----------------+-----------------------------+ | |
| 133 | 136 | | Freescale/NXP | LS2080A/LS1043A | A-008585 | FSL_ERRATUM_A008585 | |
| 134 | 137 | +----------------+-----------------+-----------------+-----------------------------+ |
| 135 | 138 | +----------------+-----------------+-----------------+-----------------------------+ |
| @@ -32,7 +32,7 @@ Optional node properties: · 31 unmodified lines | ||
| 32 | 32 | - "#thermal-sensor-cells" Used to expose itself to thermal fw. |
| 33 | 33 | |
| 34 | 34 | Read more about iio bindings at |
| 35 | − Documentation/devicetree/bindings/iio/iio-bindings.txt | |
| 35 | + https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/ | |
| 36 | 36 | |
| 37 | 37 | Example: |
| 38 | 38 | ncp15wb473@0 { |
| @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines | ||
| 7 | 7 | title: Bindings for GPIO bitbanged I2C |
| 8 | 8 | |
| 9 | 9 | maintainers: |
| 10 | − - Wolfram Sang <wolfram@the-dreams.de> | |
| 10 | + - Wolfram Sang <wsa@kernel.org> | |
| 11 | 11 | |
| 12 | 12 | allOf: |
| 13 | 13 | - $ref: /schemas/i2c/i2c-controller.yaml# |
| @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines | ||
| 7 | 7 | title: Freescale Inter IC (I2C) and High Speed Inter IC (HS-I2C) for i.MX |
| 8 | 8 | |
| 9 | 9 | maintainers: |
| 10 | − - Wolfram Sang <wolfram@the-dreams.de> | |
| 10 | + - Oleksij Rempel <o.rempel@pengutronix.de> | |
| 11 | 11 | |
| 12 | 12 | allOf: |
| 13 | 13 | - $ref: /schemas/i2c/i2c-controller.yaml# |
| @@ -14,8 +14,9 @@ description: > · 13 unmodified lines | ||
| 14 | 14 | Industrial I/O subsystem bindings for ADC controller found in |
| 15 | 15 | Ingenic JZ47xx SoCs. |
| 16 | 16 | |
| 17 | − ADC clients must use the format described in iio-bindings.txt, giving | |
| 18 | − a phandle and IIO specifier pair ("io-channels") to the ADC controller. | |
| 17 | + ADC clients must use the format described in | |
| 18 | + https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml, | |
| 19 | + giving a phandle and IIO specifier pair ("io-channels") to the ADC controller. | |
| 19 | 20 | |
| 20 | 21 | properties: |
| 21 | 22 | compatible: |
| @@ -24,7 +24,9 @@ properties: · 23 unmodified lines | ||
| 24 | 24 | description: > |
| 25 | 25 | List of phandle and IIO specifier pairs. |
| 26 | 26 | Each pair defines one ADC channel to which a joystick axis is connected. |
| 27 | − See Documentation/devicetree/bindings/iio/iio-bindings.txt for details. | |
| 27 | + See | |
| 28 | + https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml | |
| 29 | + for details. | |
| 28 | 30 | |
| 29 | 31 | '#address-cells': |
| 30 | 32 | const: 1 |
| @@ -5,7 +5,10 @@ Required properties: · 4 unmodified lines | ||
| 5 | 5 | - compatible: must be "resistive-adc-touch" |
| 6 | 6 | The device must be connected to an ADC device that provides channels for |
| 7 | 7 | position measurement and optional pressure. |
| 8 | −Refer to ../iio/iio-bindings.txt for details | |
| 8 | +Refer to | |
| 9 | +https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml | |
| 10 | +for details | |
| 11 | + | |
| 9 | 12 | - iio-channels: must have at least two channels connected to an ADC device. |
| 10 | 13 | These should correspond to the channels exposed by the ADC device and should |
| 11 | 14 | have the right index as the ADC device registers them. These channels |
| @@ -23,6 +23,7 @@ properties: · 22 unmodified lines | ||
| 23 | 23 | - enum: |
| 24 | 24 | - ingenic,jz4775-intc |
| 25 | 25 | - ingenic,jz4770-intc |
| 26 | + - ingenic,jz4760b-intc | |
| 26 | 27 | - const: ingenic,jz4760-intc |
| 27 | 28 | - items: |
| 28 | 29 | - const: ingenic,x1000-intc |
| @@ -7,7 +7,7 @@ $schema: http://devicetree.org/meta-schemas/core.yaml# · 6 unmodified lines | ||
| 7 | 7 | title: CZ.NIC's Turris Omnia LEDs driver |
| 8 | 8 | |
| 9 | 9 | maintainers: |
| 10 | − - Marek Behún <marek.behun@nic.cz> | |
| 10 | + - Marek Behún <kabel@kernel.org> | |
| 11 | 11 | |
| 12 | 12 | description: |
| 13 | 13 | This module adds support for the RGB LEDs found on the front panel of the |
| @@ -72,7 +72,9 @@ Required child device properties: · 71 unmodified lines | ||
| 72 | 72 | pwm|regulator|rtc|sysctrl|usb]"; |
| 73 | 73 | |
| 74 | 74 | A few child devices require ADC channels from the GPADC node. Those follow the |
| 75 | − standard bindings from iio/iio-bindings.txt and iio/adc/adc.txt | |
| 75 | + standard bindings from | |
| 76 | + https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml | |
| 77 | + and Documentation/devicetree/bindings/iio/adc/adc.yaml | |
| 76 | 78 | |
| 77 | 79 | abx500-temp : io-channels "aux1" and "aux2" for measuring external |
| 78 | 80 | temperatures. |
| @@ -16,14 +16,14 @@ Optional subnodes: · 15 unmodified lines | ||
| 16 | 16 | The sub-functions of CPCAP get their own node with their own compatible values, |
| 17 | 17 | which are described in the following files: |
| 18 | 18 | |
| 19 | −- ../power/supply/cpcap-battery.txt | |
| 20 | −- ../power/supply/cpcap-charger.txt | |
| 21 | −- ../regulator/cpcap-regulator.txt | |
| 22 | −- ../phy/phy-cpcap-usb.txt | |
| 23 | −- ../input/cpcap-pwrbutton.txt | |
| 24 | −- ../rtc/cpcap-rtc.txt | |
| 25 | −- ../leds/leds-cpcap.txt | |
| 26 | −- ../iio/adc/cpcap-adc.txt | |
| 19 | +- Documentation/devicetree/bindings/power/supply/cpcap-battery.txt | |
| 20 | +- Documentation/devicetree/bindings/power/supply/cpcap-charger.txt | |
| 21 | +- Documentation/devicetree/bindings/regulator/cpcap-regulator.txt | |
| 22 | +- Documentation/devicetree/bindings/phy/phy-cpcap-usb.txt | |
| 23 | +- Documentation/devicetree/bindings/input/cpcap-pwrbutton.txt | |
| 24 | +- Documentation/devicetree/bindings/rtc/cpcap-rtc.txt | |
| 25 | +- Documentation/devicetree/bindings/leds/leds-cpcap.txt | |
| 26 | +- Documentation/devicetree/bindings/iio/adc/motorola,cpcap-adc.yaml | |
| 27 | 27 | |
| 28 | 28 | The only exception is the audio codec. Instead of a compatible value its |
| 29 | 29 | node must be named "audio-codec". |
| @@ -32,7 +32,7 @@ required: · 31 unmodified lines | ||
| 32 | 32 | - interrupts |
| 33 | 33 | - interrupt-names |
| 34 | 34 | |
| 35 | −additionalProperties: false | |
| 35 | +unevaluatedProperties: false | |
| 36 | 36 | |
| 37 | 37 | examples: |
| 38 | 38 | - | |
| @@ -49,7 +49,7 @@ properties: · 48 unmodified lines | ||
| 49 | 49 | description: |
| 50 | 50 | Reference to an nvmem node for the MAC address |
| 51 | 51 | |
| 52 | − nvmem-cells-names: | |
| 52 | + nvmem-cell-names: | |
| 53 | 53 | const: mac-address |
| 54 | 54 | |
| 55 | 55 | phy-connection-type: |
| @@ -65,6 +65,71 @@ KSZ9031: · 64 unmodified lines | ||
| 65 | 65 | step is 60ps. The default value is the neutral setting, so setting |
| 66 | 66 | rxc-skew-ps=<0> actually results in -900 picoseconds adjustment. |
| 67 | 67 | |
| 68 | + The KSZ9031 hardware supports a range of skew values from negative to | |
| 69 | + positive, where the specific range is property dependent. All values | |
| 70 | + specified in the devicetree are offset by the minimum value so they | |
| 71 | + can be represented as positive integers in the devicetree since it's | |
| 72 | + difficult to represent a negative number in the devictree. | |
| 73 | + | |
| 74 | + The following 5-bit values table apply to rxc-skew-ps and txc-skew-ps. | |
| 75 | + | |
| 76 | + Pad Skew Value Delay (ps) Devicetree Value | |
| 77 | + ------------------------------------------------------ | |
| 78 | + 0_0000 -900ps 0 | |
| 79 | + 0_0001 -840ps 60 | |
| 80 | + 0_0010 -780ps 120 | |
| 81 | + 0_0011 -720ps 180 | |
| 82 | + 0_0100 -660ps 240 | |
| 83 | + 0_0101 -600ps 300 | |
| 84 | + 0_0110 -540ps 360 | |
| 85 | + 0_0111 -480ps 420 | |
| 86 | + 0_1000 -420ps 480 | |
| 87 | + 0_1001 -360ps 540 | |
| 88 | + 0_1010 -300ps 600 | |
| 89 | + 0_1011 -240ps 660 | |
| 90 | + 0_1100 -180ps 720 | |
| 91 | + 0_1101 -120ps 780 | |
| 92 | + 0_1110 -60ps 840 | |
| 93 | + 0_1111 0ps 900 | |
| 94 | + 1_0000 60ps 960 | |
| 95 | + 1_0001 120ps 1020 | |
| 96 | + 1_0010 180ps 1080 | |
| 97 | + 1_0011 240ps 1140 | |
| 98 | + 1_0100 300ps 1200 | |
| 99 | + 1_0101 360ps 1260 | |
| 100 | + 1_0110 420ps 1320 | |
| 101 | + 1_0111 480ps 1380 | |
| 102 | + 1_1000 540ps 1440 | |
| 103 | + 1_1001 600ps 1500 | |
| 104 | + 1_1010 660ps 1560 | |
| 105 | + 1_1011 720ps 1620 | |
| 106 | + 1_1100 780ps 1680 | |
| 107 | + 1_1101 840ps 1740 | |
| 108 | + 1_1110 900ps 1800 | |
| 109 | + 1_1111 960ps 1860 | |
| 110 | + | |
| 111 | + The following 4-bit values table apply to the txdX-skew-ps, rxdX-skew-ps | |
| 112 | + data pads, and the rxdv-skew-ps, txen-skew-ps control pads. | |
| 113 | + | |
| 114 | + Pad Skew Value Delay (ps) Devicetree Value | |
| 115 | + ------------------------------------------------------ | |
| 116 | + 0000 -420ps 0 | |
| 117 | + 0001 -360ps 60 | |
| 118 | + 0010 -300ps 120 | |
| 119 | + 0011 -240ps 180 | |
| 120 | + 0100 -180ps 240 | |
| 121 | + 0101 -120ps 300 | |
| 122 | + 0110 -60ps 360 | |
| 123 | + 0111 0ps 420 | |
| 124 | + 1000 60ps 480 | |
| 125 | + 1001 120ps 540 | |
| 126 | + 1010 180ps 600 | |
| 127 | + 1011 240ps 660 | |
| 128 | + 1100 300ps 720 | |
| 129 | + 1101 360ps 780 | |
| 130 | + 1110 420ps 840 | |
| 131 | + 1111 480ps 900 | |
| 132 | + | |
| 68 | 133 | Optional properties: |
| 69 | 134 | |
| 70 | 135 | Maximum value of 1860, default value 900: |
| @@ -120,11 +185,21 @@ KSZ9131: · 49 unmodified lines | ||
| 120 | 185 | |
| 121 | 186 | Examples: |
| 122 | 187 | |
| 188 | + /* Attach to an Ethernet device with autodetected PHY */ | |
| 189 | + &enet { | |
| 190 | + rxc-skew-ps = <1800>; | |
| 191 | + rxdv-skew-ps = <0>; | |
| 192 | + txc-skew-ps = <1800>; | |
| 193 | + txen-skew-ps = <0>; | |
| 194 | + status = "okay"; | |
| 195 | + }; | |
| 196 | + | |
| 197 | + /* Attach to an explicitly-specified PHY */ | |
| 123 | 198 | mdio { |
| 124 | 199 | phy0: ethernet-phy@0 { |
| 125 | − rxc-skew-ps = <3000>; | |
| 200 | + rxc-skew-ps = <1800>; | |
| 126 | 201 | rxdv-skew-ps = <0>; |
| 127 | − txc-skew-ps = <3000>; | |
| 202 | + txc-skew-ps = <1800>; | |
| 128 | 203 | txen-skew-ps = <0>; |
| 129 | 204 | reg = <0>; |
| 130 | 205 | }; |
| @@ -133,3 +208,20 @@ Examples: · 2 unmodified lines | ||
| 133 | 208 | phy = <&phy0>; |
| 134 | 209 | phy-mode = "rgmii-id"; |
| 135 | 210 | }; |
| 211 | + | |
| 212 | +References | |
| 213 | + | |
| 214 | + Micrel ksz9021rl/rn Data Sheet, Revision 1.2. Dated 2/13/2014. | |
| 215 | + http://www.micrel.com/_PDF/Ethernet/datasheets/ksz9021rl-rn_ds.pdf | |
| 216 | + | |
| 217 | + Micrel ksz9031rnx Data Sheet, Revision 2.1. Dated 11/20/2014. | |
| 218 | + http://www.micrel.com/_PDF/Ethernet/datasheets/KSZ9031RNX.pdf | |
| 219 | + | |
| 220 | +Notes: | |
| 221 | + | |
| 222 | + Note that a previous version of the Micrel ksz9021rl/rn Data Sheet | |
| 223 | + was missing extended register 106 (transmit data pad skews), and | |
| 224 | + incorrectly specified the ps per step as 200ps/step instead of | |
| 225 | + 120ps/step. The latest update to this document reflects the latest | |
| 226 | + revision of the Micrel specification even though usage in the kernel | |
| 227 | + still reflects that incorrect document. | |
| @@ -21,6 +21,10 @@ properties: · 20 unmodified lines | ||
| 21 | 21 | - fsl,vf610-spdif |
| 22 | 22 | - fsl,imx6sx-spdif |
| 23 | 23 | - fsl,imx8qm-spdif |
| 24 | + - fsl,imx8qxp-spdif | |
| 25 | + - fsl,imx8mq-spdif | |
| 26 | + - fsl,imx8mm-spdif | |
| 27 | + - fsl,imx8mn-spdif | |
| 24 | 28 | |
| 25 | 29 | reg: |
| 26 | 30 | maxItems: 1 |
| @@ -613,6 +613,27 @@ Some of these date from the very introduction of KMS in 2008 ... · 612 unmodified lines | ||
| 613 | 613 | |
| 614 | 614 | Level: Intermediate |
| 615 | 615 | |
| 616 | +Remove automatic page mapping from dma-buf importing | |
| 617 | +---------------------------------------------------- | |
| 618 | + | |
| 619 | +When importing dma-bufs, the dma-buf and PRIME frameworks automatically map | |
| 620 | +imported pages into the importer's DMA area. drm_gem_prime_fd_to_handle() and | |
| 621 | +drm_gem_prime_handle_to_fd() require that importers call dma_buf_attach() | |
| 622 | +even if they never do actual device DMA, but only CPU access through | |
| 623 | +dma_buf_vmap(). This is a problem for USB devices, which do not support DMA | |
| 624 | +operations. | |
| 625 | + | |
| 626 | +To fix the issue, automatic page mappings should be removed from the | |
| 627 | +buffer-sharing code. Fixing this is a bit more involved, since the import/export | |
| 628 | +cache is also tied to &drm_gem_object.import_attach. Meanwhile we paper over | |
| 629 | +this problem for USB devices by fishing out the USB host controller device, as | |
| 630 | +long as that supports DMA. Otherwise importing can still needlessly fail. | |
| 631 | + | |
| 632 | +Contact: Thomas Zimmermann <tzimmermann@suse.de>, Daniel Vetter | |
| 633 | + | |
| 634 | +Level: Advanced | |
| 635 | + | |
| 636 | + | |
| 616 | 637 | Better Testing |
| 617 | 638 | ============== |
| 618 | 639 | |
| @@ -1988,7 +1988,7 @@ netif_carrier. · 1987 unmodified lines | ||
| 1988 | 1988 | If use_carrier is 0, then the MII monitor will first query the |
| 1989 | 1989 | device's (via ioctl) MII registers and check the link state. If that |
| 1990 | 1990 | request fails (not just that it returns carrier down), then the MII |
| 1991 | −monitor will make an ethtool ETHOOL_GLINK request to attempt to obtain | |
| 1991 | +monitor will make an ethtool ETHTOOL_GLINK request to attempt to obtain | |
| 1992 | 1992 | the same information. If both methods fail (i.e., the driver either |
| 1993 | 1993 | does not support or had some error in processing both the MII register |
| 1994 | 1994 | and ethtool requests), then the MII monitor will assume the link is |
| @@ -267,7 +267,7 @@ DATA PATH · 266 unmodified lines | ||
| 267 | 267 | Tx |
| 268 | 268 | -- |
| 269 | 269 | |
| 270 | −end_start_xmit() is called by the stack. This function does the following: | |
| 270 | +ena_start_xmit() is called by the stack. This function does the following: | |
| 271 | 271 | |
| 272 | 272 | - Maps data buffers (skb->data and frags). |
| 273 | 273 | - Populates ena_buf for the push buffer (if the driver and device are |
| @@ -52,7 +52,7 @@ purposes as a standard complementary tool. The system's view from · 51 unmodified lines | ||
| 52 | 52 | ``devlink-dpipe`` should change according to the changes done by the |
| 53 | 53 | standard configuration tools. |
| 54 | 54 | |
| 55 | −For example, it’s quiet common to implement Access Control Lists (ACL) | |
| 55 | +For example, it’s quite common to implement Access Control Lists (ACL) | |
| 56 | 56 | using Ternary Content Addressable Memory (TCAM). The TCAM memory can be |
| 57 | 57 | divided into TCAM regions. Complex TC filters can have multiple rules with |
| 58 | 58 | different priorities and different lookup keys. On the other hand hardware |
| @@ -151,7 +151,7 @@ representor netdevice. · 150 unmodified lines | ||
| 151 | 151 | ------------- |
| 152 | 152 | A subfunction devlink port is created but it is not active yet. That means the |
| 153 | 153 | entities are created on devlink side, the e-switch port representor is created, |
| 154 | −but the subfunction device itself it not created. A user might use e-switch port | |
| 154 | +but the subfunction device itself is not created. A user might use e-switch port | |
| 155 | 155 | representor to do settings, putting it into bridge, adding TC rules, etc. A user |
| 156 | 156 | might as well configure the hardware address (such as MAC address) of the |
| 157 | 157 | subfunction while subfunction is inactive. |
| @@ -173,7 +173,7 @@ Terms and Definitions · 15 unmodified lines | ||
| 173 | 173 | * - Term |
| 174 | 174 | - Definitions |
| 175 | 175 | * - ``PCI device`` |
| 176 | − - A physical PCI device having one or more PCI bus consists of one or | |
| 176 | + - A physical PCI device having one or more PCI buses consists of one or | |
| 177 | 177 | more PCI controllers. |
| 178 | 178 | * - ``PCI controller`` |
| 179 | 179 | - A controller consists of potentially multiple physical functions, |
| @@ -976,9 +976,9 @@ constraints on coalescing parameters and their values. · 975 unmodified lines | ||
| 976 | 976 | |
| 977 | 977 | |
| 978 | 978 | PAUSE_GET |
| 979 | −============ | |
| 979 | +========= | |
| 980 | 980 | |
| 981 | −Gets channel counts like ``ETHTOOL_GPAUSE`` ioctl request. | |
| 981 | +Gets pause frame settings like ``ETHTOOL_GPAUSEPARAM`` ioctl request. | |
| 982 | 982 | |
| 983 | 983 | Request contents: |
| 984 | 984 | |
| @@ -1007,7 +1007,7 @@ the statistics in the following structure: · 22 unmodified lines | ||
| 1007 | 1007 | Each member has a corresponding attribute defined. |
| 1008 | 1008 | |
| 1009 | 1009 | PAUSE_SET |
| 1010 | −============ | |
| 1010 | +========= | |
| 1011 | 1011 | |
| 1012 | 1012 | Sets pause parameters like ``ETHTOOL_GPAUSEPARAM`` ioctl request. |
| 1013 | 1013 | |
| @@ -1024,7 +1024,7 @@ Request contents: · 10 unmodified lines | ||
| 1024 | 1024 | EEE_GET |
| 1025 | 1025 | ======= |
| 1026 | 1026 | |
| 1027 | −Gets channel counts like ``ETHTOOL_GEEE`` ioctl request. | |
| 1027 | +Gets Energy Efficient Ethernet settings like ``ETHTOOL_GEEE`` ioctl request. | |
| 1028 | 1028 | |
| 1029 | 1029 | Request contents: |
| 1030 | 1030 | |
| @@ -1054,7 +1054,7 @@ first 32 are provided by the ``ethtool_ops`` callback. · 23 unmodified lines | ||
| 1054 | 1054 | EEE_SET |
| 1055 | 1055 | ======= |
| 1056 | 1056 | |
| 1057 | −Sets pause parameters like ``ETHTOOL_GEEEPARAM`` ioctl request. | |
| 1057 | +Sets Energy Efficient Ethernet parameters like ``ETHTOOL_SEEE`` ioctl request. | |
| 1058 | 1058 | |
| 1059 | 1059 | Request contents: |
| 1060 | 1060 | |
| @@ -1849,21 +1849,6 @@ ip6frag_low_thresh - INTEGER · 1848 unmodified lines | ||
| 1849 | 1849 | ip6frag_time - INTEGER |
| 1850 | 1850 | Time in seconds to keep an IPv6 fragment in memory. |
| 1851 | 1851 | |
| 1852 | −IPv6 Segment Routing: | |
| 1853 | − | |
| 1854 | −seg6_flowlabel - INTEGER | |
| 1855 | − Controls the behaviour of computing the flowlabel of outer | |
| 1856 | − IPv6 header in case of SR T.encaps | |
| 1857 | − | |
| 1858 | − == ======================================================= | |
| 1859 | − -1 set flowlabel to zero. | |
| 1860 | − 0 copy flowlabel from Inner packet in case of Inner IPv6 | |
| 1861 | − (Set flowlabel to 0 in case IPv4/L2) | |
| 1862 | − 1 Compute the flowlabel using seg6_make_flowlabel() | |
| 1863 | − == ======================================================= | |
| 1864 | − | |
| 1865 | − Default is 0. | |
| 1866 | − | |
| 1867 | 1852 | ``conf/default/*``: |
| 1868 | 1853 | Change the interface-specific default settings. |
| 1869 | 1854 | |
| @@ -142,73 +142,13 @@ Please send incremental versions on top of what has been merged in order to fix · 141 unmodified lines | ||
| 142 | 142 | the patches the way they would look like if your latest patch series was to be |
| 143 | 143 | merged. |
| 144 | 144 | |
| 145 | −How can I tell what patches are queued up for backporting to the various stable releases? | |
| 146 | −----------------------------------------------------------------------------------------- | |
| 147 | −Normally Greg Kroah-Hartman collects stable commits himself, but for | |
| 148 | −networking, Dave collects up patches he deems critical for the | |
| 149 | −networking subsystem, and then hands them off to Greg. | |
| 150 | − | |
| 151 | −There is a patchworks queue that you can see here: | |
| 152 | − | |
| 153 | − https://patchwork.kernel.org/bundle/netdev/stable/?state=* | |
| 154 | − | |
| 155 | −It contains the patches which Dave has selected, but not yet handed off | |
| 156 | −to Greg. If Greg already has the patch, then it will be here: | |
| 157 | − | |
| 158 | − https://git.kernel.org/pub/scm/linux/kernel/git/stable/stable-queue.git | |
| 159 | − | |
| 160 | −A quick way to find whether the patch is in this stable-queue is to | |
| 161 | −simply clone the repo, and then git grep the mainline commit ID, e.g. | |
| 162 | −:: | |
| 163 | − | |
| 164 | − stable-queue$ git grep -l 284041ef21fdf2e | |
| 165 | − releases/3.0.84/ipv6-fix-possible-crashes-in-ip6_cork_release.patch | |
| 166 | − releases/3.4.51/ipv6-fix-possible-crashes-in-ip6_cork_release.patch | |
| 167 | − releases/3.9.8/ipv6-fix-possible-crashes-in-ip6_cork_release.patch | |
| 168 | − stable/stable-queue$ | |
| 169 | − | |
| 170 | −I see a network patch and I think it should be backported to stable. Should I request it via stable@vger.kernel.org like the references in the kernel's Documentation/process/stable-kernel-rules.rst file say? | |
| 171 | −--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 172 | −No, not for networking. Check the stable queues as per above first | |
| 173 | −to see if it is already queued. If not, then send a mail to netdev, | |
| 174 | −listing the upstream commit ID and why you think it should be a stable | |
| 175 | −candidate. | |
| 176 | − | |
| 177 | −Before you jump to go do the above, do note that the normal stable rules | |
| 178 | −in :ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>` | |
| 179 | −still apply. So you need to explicitly indicate why it is a critical | |
| 180 | −fix and exactly what users are impacted. In addition, you need to | |
| 181 | −convince yourself that you *really* think it has been overlooked, | |
| 182 | −vs. having been considered and rejected. | |
| 183 | − | |
| 184 | −Generally speaking, the longer it has had a chance to "soak" in | |
| 185 | −mainline, the better the odds that it is an OK candidate for stable. So | |
| 186 | −scrambling to request a commit be added the day after it appears should | |
| 187 | −be avoided. | |
| 188 | − | |
| 189 | −I have created a network patch and I think it should be backported to stable. Should I add a Cc: stable@vger.kernel.org like the references in the kernel's Documentation/ directory say? | |
| 190 | −----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | |
| 191 | −No. See above answer. In short, if you think it really belongs in | |
| 192 | −stable, then ensure you write a decent commit log that describes who | |
| 193 | −gets impacted by the bug fix and how it manifests itself, and when the | |
| 194 | −bug was introduced. If you do that properly, then the commit will get | |
| 195 | −handled appropriately and most likely get put in the patchworks stable | |
| 196 | −queue if it really warrants it. | |
| 197 | − | |
| 198 | −If you think there is some valid information relating to it being in | |
| 199 | −stable that does *not* belong in the commit log, then use the three dash | |
| 200 | −marker line as described in | |
| 201 | −:ref:`Documentation/process/submitting-patches.rst <the_canonical_patch_format>` | |
| 202 | −to temporarily embed that information into the patch that you send. | |
| 203 | − | |
| 204 | −Are all networking bug fixes backported to all stable releases? | |
| 145 | +Are there special rules regarding stable submissions on netdev? | |
| 205 | 146 | --------------------------------------------------------------- |
| 206 | −Due to capacity, Dave could only take care of the backports for the | |
| 207 | −last two stable releases. For earlier stable releases, each stable | |
| 208 | −branch maintainer is supposed to take care of them. If you find any | |
| 209 | −patch is missing from an earlier stable branch, please notify | |
| 210 | −stable@vger.kernel.org with either a commit ID or a formal patch | |
| 211 | −backported, and CC Dave and other relevant networking developers. | |
| 147 | +While it used to be the case that netdev submissions were not supposed | |
| 148 | +to carry explicit ``CC: stable@vger.kernel.org`` tags that is no longer | |
| 149 | +the case today. Please follow the standard stable rules in | |
| 150 | +:ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>`, | |
| 151 | +and make sure you include appropriate Fixes tags! | |
| 212 | 152 | |
| 213 | 153 | Is the comment style convention different for the networking content? |
| 214 | 154 | --------------------------------------------------------------------- |
| @@ -24,3 +24,16 @@ seg6_require_hmac - INTEGER · 23 unmodified lines | ||
| 24 | 24 | * 1 - Drop SR packets without HMAC, validate SR packets with HMAC |
| 25 | 25 | |
| 26 | 26 | Default is 0. |
| 27 | + | |
| 28 | +seg6_flowlabel - INTEGER | |
| 29 | + Controls the behaviour of computing the flowlabel of outer | |
| 30 | + IPv6 header in case of SR T.encaps | |
| 31 | + | |
| 32 | + == ======================================================= | |
| 33 | + -1 set flowlabel to zero. | |
| 34 | + 0 copy flowlabel from Inner packet in case of Inner IPv6 | |
| 35 | + (Set flowlabel to 0 in case IPv4/L2) | |
| 36 | + 1 Compute the flowlabel using seg6_make_flowlabel() | |
| 37 | + == ======================================================= | |
| 38 | + | |
| 39 | + Default is 0. | |
| @@ -50,7 +50,7 @@ Callbacks to implement · 49 unmodified lines | ||
| 50 | 50 | |
| 51 | 51 | The NIC driver offering ipsec offload will need to implement these |
| 52 | 52 | callbacks to make the offload available to the network stack's |
| 53 | −XFRM subsytem. Additionally, the feature bits NETIF_F_HW_ESP and | |
| 53 | +XFRM subsystem. Additionally, the feature bits NETIF_F_HW_ESP and | |
| 54 | 54 | NETIF_F_HW_ESP_TX_CSUM will signal the availability of the offload. |
| 55 | 55 | |
| 56 | 56 | |
| @@ -35,12 +35,6 @@ Rules on what kind of patches are accepted, and which ones are not, into the · 34 unmodified lines | ||
| 35 | 35 | Procedure for submitting patches to the -stable tree |
| 36 | 36 | ---------------------------------------------------- |
| 37 | 37 | |
| 38 | − - If the patch covers files in net/ or drivers/net please follow netdev stable | |
| 39 | − submission guidelines as described in | |
| 40 | − :ref:`Documentation/networking/netdev-FAQ.rst <netdev-FAQ>` | |
| 41 | − after first checking the stable networking queue at | |
| 42 | − https://patchwork.kernel.org/bundle/netdev/stable/?state=* | |
| 43 | − to ensure the requested patch is not already queued up. | |
| 44 | 38 | - Security patches should not be handled (solely) by the -stable review |
| 45 | 39 | process but should follow the procedures in |
| 46 | 40 | :ref:`Documentation/admin-guide/security-bugs.rst <securitybugs>`. |
| @@ -250,11 +250,6 @@ should also read · 249 unmodified lines | ||
| 250 | 250 | :ref:`Documentation/process/stable-kernel-rules.rst <stable_kernel_rules>` |
| 251 | 251 | in addition to this file. |
| 252 | 252 | |
| 253 | −Note, however, that some subsystem maintainers want to come to their own | |
| 254 | −conclusions on which patches should go to the stable trees. The networking | |
| 255 | −maintainer, in particular, would rather not see individual developers | |
| 256 | −adding lines like the above to their patches. | |
| 257 | − | |
| 258 | 253 | If changes affect userland-kernel interfaces, please send the MAN-PAGES |
| 259 | 254 | maintainer (as listed in the MAINTAINERS file) a man-pages patch, or at |
| 260 | 255 | least a notification of the change, so that some information makes its way |
| @@ -182,6 +182,9 @@ is dependent on the CPU capability and the kernel configuration. The limit can · 181 unmodified lines | ||
| 182 | 182 | be retrieved using KVM_CAP_ARM_VM_IPA_SIZE of the KVM_CHECK_EXTENSION |
| 183 | 183 | ioctl() at run-time. |
| 184 | 184 | |
| 185 | +Creation of the VM will fail if the requested IPA size (whether it is | |
| 186 | +implicit or explicit) is unsupported on the host. | |
| 187 | + | |
| 185 | 188 | Please note that configuring the IPA size does not affect the capability |
| 186 | 189 | exposed by the guest CPUs in ID_AA64MMFR0_EL1[PARange]. It only affects |
| 187 | 190 | size of the address translated by the stage2 level (guest physical to |
| @@ -1492,7 +1495,8 @@ Fails if any VCPU has already been created. · 1304 unmodified lines | ||
| 1492 | 1495 | |
| 1493 | 1496 | Define which vcpu is the Bootstrap Processor (BSP). Values are the same |
| 1494 | 1497 | as the vcpu id in KVM_CREATE_VCPU. If this ioctl is not called, the default |
| 1495 | −is vcpu 0. | |
| 1498 | +is vcpu 0. This ioctl has to be called before vcpu creation, | |
| 1499 | +otherwise it will return EBUSY error. | |
| 1496 | 1500 | |
| 1497 | 1501 | |
| 1498 | 1502 | 4.42 KVM_GET_XSAVE |
| @@ -4803,8 +4807,10 @@ If an MSR access is not permitted through the filtering, it generates a · 3304 unmodified lines | ||
| 4803 | 4807 | allows user space to deflect and potentially handle various MSR accesses |
| 4804 | 4808 | into user space. |
| 4805 | 4809 | |
| 4806 | −If a vCPU is in running state while this ioctl is invoked, the vCPU may | |
| 4807 | −experience inconsistent filtering behavior on MSR accesses. | |
| 4810 | +Note, invoking this ioctl with a vCPU is running is inherently racy. However, | |
| 4811 | +KVM does guarantee that vCPUs will see either the previous filter or the new | |
| 4812 | +filter, e.g. MSRs with identical settings in both the old and new filter will | |
| 4813 | +have deterministic behavior. | |
| 4808 | 4814 | |
| 4809 | 4815 | 4.127 KVM_XEN_HVM_SET_ATTR |
| 4810 | 4816 | -------------------------- |
| @@ -261,8 +261,8 @@ ABI/API · 260 unmodified lines | ||
| 261 | 261 | L: linux-api@vger.kernel.org |
| 262 | 262 | F: include/linux/syscalls.h |
| 263 | 263 | F: kernel/sys_ni.c |
| 264 | −F: include/uapi/ | |
| 265 | −F: arch/*/include/uapi/ | |
| 264 | +X: include/uapi/ | |
| 265 | +X: arch/*/include/uapi/ | |
| 266 | 266 | |
| 267 | 267 | ABIT UGURU 1,2 HARDWARE MONITOR DRIVER |
| 268 | 268 | M: Hans de Goede <hdegoede@redhat.com> |
| @@ -1181,7 +1181,7 @@ M: Joel Fernandes <joel@joelfernandes.org> · 912 unmodified lines | ||
| 1181 | 1181 | M: Christian Brauner <christian@brauner.io> |
| 1182 | 1182 | M: Hridya Valsaraju <hridya@google.com> |
| 1183 | 1183 | M: Suren Baghdasaryan <surenb@google.com> |
| 1184 | −L: devel@driverdev.osuosl.org | |
| 1184 | +L: linux-kernel@vger.kernel.org | |
| 1185 | 1185 | S: Supported |
| 1186 | 1186 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git |
| 1187 | 1187 | F: drivers/android/ |
| @@ -1576,11 +1576,13 @@ R: Jernej Skrabec <jernej.skrabec@siol.net> · 388 unmodified lines | ||
| 1576 | 1576 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 1577 | 1577 | S: Maintained |
| 1578 | 1578 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/sunxi/linux.git |
| 1579 | +L: linux-sunxi@lists.linux.dev | |
| 1579 | 1580 | F: arch/arm/mach-sunxi/ |
| 1580 | 1581 | F: arch/arm64/boot/dts/allwinner/ |
| 1581 | 1582 | F: drivers/clk/sunxi-ng/ |
| 1582 | 1583 | F: drivers/pinctrl/sunxi/ |
| 1583 | 1584 | F: drivers/soc/sunxi/ |
| 1585 | +N: allwinner | |
| 1584 | 1586 | N: sun[x456789]i |
| 1585 | 1587 | N: sun50i |
| 1586 | 1588 | |
| @@ -1790,19 +1792,26 @@ F: drivers/net/ethernet/cortina/ · 203 unmodified lines | ||
| 1790 | 1792 | F: drivers/pinctrl/pinctrl-gemini.c |
| 1791 | 1793 | F: drivers/rtc/rtc-ftrtc010.c |
| 1792 | 1794 | |
| 1793 | −ARM/CZ.NIC TURRIS MOX SUPPORT | |
| 1794 | −M: Marek Behun <marek.behun@nic.cz> | |
| 1795 | +ARM/CZ.NIC TURRIS SUPPORT | |
| 1796 | +M: Marek Behun <kabel@kernel.org> | |
| 1795 | 1797 | S: Maintained |
| 1796 | −W: http://mox.turris.cz | |
| 1798 | +W: https://www.turris.cz/ | |
| 1797 | 1799 | F: Documentation/ABI/testing/debugfs-moxtet |
| 1798 | 1800 | F: Documentation/ABI/testing/sysfs-bus-moxtet-devices |
| 1799 | 1801 | F: Documentation/ABI/testing/sysfs-firmware-turris-mox-rwtm |
| 1800 | 1802 | F: Documentation/devicetree/bindings/bus/moxtet.txt |
| 1801 | 1803 | F: Documentation/devicetree/bindings/firmware/cznic,turris-mox-rwtm.txt |
| 1802 | 1804 | F: Documentation/devicetree/bindings/gpio/gpio-moxtet.txt |
| 1805 | +F: Documentation/devicetree/bindings/leds/cznic,turris-omnia-leds.yaml | |
| 1806 | +F: Documentation/devicetree/bindings/watchdog/armada-37xx-wdt.txt | |
| 1803 | 1807 | F: drivers/bus/moxtet.c |
| 1804 | 1808 | F: drivers/firmware/turris-mox-rwtm.c |
| 1809 | +F: drivers/leds/leds-turris-omnia.c | |
| 1810 | +F: drivers/mailbox/armada-37xx-rwtm-mailbox.c | |
| 1805 | 1811 | F: drivers/gpio/gpio-moxtet.c |
| 1812 | +F: drivers/watchdog/armada_37xx_wdt.c | |
| 1813 | +F: include/dt-bindings/bus/moxtet.h | |
| 1814 | +F: include/linux/armada-37xx-rwtm-mailbox.h | |
| 1806 | 1815 | F: include/linux/moxtet.h |
| 1807 | 1816 | |
| 1808 | 1817 | ARM/EZX SMARTPHONES (A780, A910, A1200, E680, ROKR E2 and ROKR E6) |
| @@ -2489,7 +2498,7 @@ N: sc27xx · 680 unmodified lines | ||
| 2489 | 2498 | N: sc2731 |
| 2490 | 2499 | |
| 2491 | 2500 | ARM/STI ARCHITECTURE |
| 2492 | −M: Patrice Chotard <patrice.chotard@st.com> | |
| 2501 | +M: Patrice Chotard <patrice.chotard@foss.st.com> | |
| 2493 | 2502 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 2494 | 2503 | S: Maintained |
| 2495 | 2504 | W: http://www.stlinux.com |
| @@ -2522,7 +2531,7 @@ F: include/linux/remoteproc/st_slim_rproc.h · 26 unmodified lines | ||
| 2522 | 2531 | |
| 2523 | 2532 | ARM/STM32 ARCHITECTURE |
| 2524 | 2533 | M: Maxime Coquelin <mcoquelin.stm32@gmail.com> |
| 2525 | −M: Alexandre Torgue <alexandre.torgue@st.com> | |
| 2534 | +M: Alexandre Torgue <alexandre.torgue@foss.st.com> | |
| 2526 | 2535 | L: linux-stm32@st-md-mailman.stormreply.com (moderated for non-subscribers) |
| 2527 | 2536 | L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) |
| 2528 | 2537 | S: Maintained |
| @@ -3115,7 +3124,7 @@ C: irc://irc.oftc.net/bcache · 586 unmodified lines | ||
| 3115 | 3124 | F: drivers/md/bcache/ |
| 3116 | 3125 | |
| 3117 | 3126 | BDISP ST MEDIA DRIVER |
| 3118 | −M: Fabien Dessenne <fabien.dessenne@st.com> | |
| 3127 | +M: Fabien Dessenne <fabien.dessenne@foss.st.com> | |
| 3119 | 3128 | L: linux-media@vger.kernel.org |
| 3120 | 3129 | S: Supported |
| 3121 | 3130 | W: https://linuxtv.org |
| @@ -3675,7 +3684,7 @@ M: bcm-kernel-feedback-list@broadcom.com · 553 unmodified lines | ||
| 3675 | 3684 | L: linux-pm@vger.kernel.org |
| 3676 | 3685 | S: Maintained |
| 3677 | 3686 | T: git git://github.com/broadcom/stblinux.git |
| 3678 | −F: drivers/soc/bcm/bcm-pmb.c | |
| 3687 | +F: drivers/soc/bcm/bcm63xx/bcm-pmb.c | |
| 3679 | 3688 | F: include/dt-bindings/soc/bcm-pmb.h |
| 3680 | 3689 | |
| 3681 | 3690 | BROADCOM SPECIFIC AMBA DRIVER (BCMA) |
| @@ -5080,7 +5089,7 @@ S: Maintained · 1398 unmodified lines | ||
| 5080 | 5089 | F: drivers/platform/x86/dell/dell-wmi.c |
| 5081 | 5090 | |
| 5082 | 5091 | DELTA ST MEDIA DRIVER |
| 5083 | −M: Hugues Fruchet <hugues.fruchet@st.com> | |
| 5092 | +M: Hugues Fruchet <hugues.fruchet@foss.st.com> | |
| 5084 | 5093 | L: linux-media@vger.kernel.org |
| 5085 | 5094 | S: Supported |
| 5086 | 5095 | W: https://linuxtv.org |
| @@ -5835,7 +5844,7 @@ M: David Airlie <airlied@linux.ie> · 748 unmodified lines | ||
| 5835 | 5844 | M: Daniel Vetter <daniel@ffwll.ch> |
| 5836 | 5845 | L: dri-devel@lists.freedesktop.org |
| 5837 | 5846 | S: Maintained |
| 5838 | −B: https://bugs.freedesktop.org/ | |
| 5847 | +B: https://gitlab.freedesktop.org/drm | |
| 5839 | 5848 | C: irc://chat.freenode.net/dri-devel |
| 5840 | 5849 | T: git git://anongit.freedesktop.org/drm/drm |
| 5841 | 5850 | F: Documentation/devicetree/bindings/display/ |
| @@ -6006,7 +6015,6 @@ F: drivers/gpu/drm/rockchip/ · 164 unmodified lines | ||
| 6006 | 6015 | |
| 6007 | 6016 | DRM DRIVERS FOR STI |
| 6008 | 6017 | M: Benjamin Gaignard <benjamin.gaignard@linaro.org> |
| 6009 | −M: Vincent Abriou <vincent.abriou@st.com> | |
| 6010 | 6018 | L: dri-devel@lists.freedesktop.org |
| 6011 | 6019 | S: Maintained |
| 6012 | 6020 | T: git git://anongit.freedesktop.org/drm/drm-misc |
| @@ -6014,10 +6022,9 @@ F: Documentation/devicetree/bindings/display/st,stih4xx.txt · 1 unmodified line | ||
| 6014 | 6022 | F: drivers/gpu/drm/sti |
| 6015 | 6023 | |
| 6016 | 6024 | DRM DRIVERS FOR STM |
| 6017 | −M: Yannick Fertre <yannick.fertre@st.com> | |
| 6018 | −M: Philippe Cornu <philippe.cornu@st.com> | |
| 6025 | +M: Yannick Fertre <yannick.fertre@foss.st.com> | |
| 6026 | +M: Philippe Cornu <philippe.cornu@foss.st.com> | |
| 6019 | 6027 | M: Benjamin Gaignard <benjamin.gaignard@linaro.org> |
| 6020 | −M: Vincent Abriou <vincent.abriou@st.com> | |
| 6021 | 6028 | L: dri-devel@lists.freedesktop.org |
| 6022 | 6029 | S: Maintained |
| 6023 | 6030 | T: git git://anongit.freedesktop.org/drm/drm-misc |
| @@ -7091,7 +7098,7 @@ S: Maintained · 1067 unmodified lines | ||
| 7091 | 7098 | F: drivers/i2c/busses/i2c-cpm.c |
| 7092 | 7099 | |
| 7093 | 7100 | FREESCALE IMX / MXC FEC DRIVER |
| 7094 | −M: Fugang Duan <fugang.duan@nxp.com> | |
| 7101 | +M: Joakim Zhang <qiangqing.zhang@nxp.com> | |
| 7095 | 7102 | L: netdev@vger.kernel.org |
| 7096 | 7103 | S: Maintained |
| 7097 | 7104 | F: Documentation/devicetree/bindings/net/fsl-fec.txt |
| @@ -7476,8 +7483,9 @@ F: include/uapi/asm-generic/ · 378 unmodified lines | ||
| 7476 | 7483 | GENERIC PHY FRAMEWORK |
| 7477 | 7484 | M: Kishon Vijay Abraham I <kishon@ti.com> |
| 7478 | 7485 | M: Vinod Koul <vkoul@kernel.org> |
| 7479 | −L: linux-kernel@vger.kernel.org | |
| 7486 | +L: linux-phy@lists.infradead.org | |
| 7480 | 7487 | S: Supported |
| 7488 | +Q: https://patchwork.kernel.org/project/linux-phy/list/ | |
| 7481 | 7489 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/phy/linux-phy.git |
| 7482 | 7490 | F: Documentation/devicetree/bindings/phy/ |
| 7483 | 7491 | F: drivers/phy/ |
| @@ -8116,7 +8124,6 @@ F: drivers/crypto/hisilicon/sec2/sec_main.c · 632 unmodified lines | ||
| 8116 | 8124 | |
| 8117 | 8125 | HISILICON STAGING DRIVERS FOR HIKEY 960/970 |
| 8118 | 8126 | M: Mauro Carvalho Chehab <mchehab+huawei@kernel.org> |
| 8119 | −L: devel@driverdev.osuosl.org | |
| 8120 | 8127 | S: Maintained |
| 8121 | 8128 | F: drivers/staging/hikey9xx/ |
| 8122 | 8129 | |
| @@ -8231,7 +8238,7 @@ F: include/linux/hugetlb.h · 108 unmodified lines | ||
| 8231 | 8238 | F: mm/hugetlb.c |
| 8232 | 8239 | |
| 8233 | 8240 | HVA ST MEDIA DRIVER |
| 8234 | −M: Jean-Christophe Trotin <jean-christophe.trotin@st.com> | |
| 8241 | +M: Jean-Christophe Trotin <jean-christophe.trotin@foss.st.com> | |
| 8235 | 8242 | L: linux-media@vger.kernel.org |
| 8236 | 8243 | S: Supported |
| 8237 | 8244 | W: https://linuxtv.org |
| @@ -8519,8 +8526,9 @@ F: drivers/pci/hotplug/rpaphp* · 281 unmodified lines | ||
| 8519 | 8526 | |
| 8520 | 8527 | IBM Power SRIOV Virtual NIC Device Driver |
| 8521 | 8528 | M: Dany Madden <drt@linux.ibm.com> |
| 8522 | −M: Lijun Pan <ljp@linux.ibm.com> | |
| 8523 | 8529 | M: Sukadev Bhattiprolu <sukadev@linux.ibm.com> |
| 8530 | +R: Thomas Falcon <tlfalcon@linux.ibm.com> | |
| 8531 | +R: Lijun Pan <lijunp213@gmail.com> | |
| 8524 | 8532 | L: netdev@vger.kernel.org |
| 8525 | 8533 | S: Supported |
| 8526 | 8534 | F: drivers/net/ethernet/ibm/ibmvnic.* |
| @@ -10030,7 +10038,6 @@ F: scripts/leaking_addresses.pl · 1503 unmodified lines | ||
| 10030 | 10038 | |
| 10031 | 10039 | LED SUBSYSTEM |
| 10032 | 10040 | M: Pavel Machek <pavel@ucw.cz> |
| 10033 | −R: Dan Murphy <dmurphy@ti.com> | |
| 10034 | 10041 | L: linux-leds@vger.kernel.org |
| 10035 | 10042 | S: Maintained |
| 10036 | 10043 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/pavel/linux-leds.git |
| @@ -10716,7 +10723,8 @@ F: drivers/net/ethernet/marvell/mvpp2/ · 679 unmodified lines | ||
| 10716 | 10723 | |
| 10717 | 10724 | MARVELL MWIFIEX WIRELESS DRIVER |
| 10718 | 10725 | M: Amitkumar Karwar <amitkarwar@gmail.com> |
| 10719 | −M: Ganapathi Bhat <ganapathi.bhat@nxp.com> | |
| 10726 | +M: Ganapathi Bhat <ganapathi017@gmail.com> | |
| 10727 | +M: Sharvari Harisangam <sharvari.harisangam@nxp.com> | |
| 10720 | 10728 | M: Xinming Hu <huxinming820@gmail.com> |
| 10721 | 10729 | L: linux-wireless@vger.kernel.org |
| 10722 | 10730 | S: Maintained |
| @@ -10905,7 +10913,6 @@ T: git git://linuxtv.org/media_tree.git · 182 unmodified lines | ||
| 10905 | 10913 | F: drivers/media/radio/radio-maxiradio* |
| 10906 | 10914 | |
| 10907 | 10915 | MCAN MMIO DEVICE DRIVER |
| 10908 | −M: Dan Murphy <dmurphy@ti.com> | |
| 10909 | 10916 | M: Pankaj Sharma <pankj.sharma@samsung.com> |
| 10910 | 10917 | L: linux-can@vger.kernel.org |
| 10911 | 10918 | S: Maintained |
| @@ -11166,7 +11173,7 @@ T: git git://linuxtv.org/media_tree.git · 254 unmodified lines | ||
| 11166 | 11173 | F: drivers/media/dvb-frontends/stv6111* |
| 11167 | 11174 | |
| 11168 | 11175 | MEDIA DRIVERS FOR STM32 - DCMI |
| 11169 | −M: Hugues Fruchet <hugues.fruchet@st.com> | |
| 11176 | +M: Hugues Fruchet <hugues.fruchet@foss.st.com> | |
| 11170 | 11177 | L: linux-media@vger.kernel.org |
| 11171 | 11178 | S: Supported |
| 11172 | 11179 | T: git git://linuxtv.org/media_tree.git |
| @@ -12537,7 +12544,7 @@ NETWORKING [MPTCP] · 1364 unmodified lines | ||
| 12537 | 12544 | M: Mat Martineau <mathew.j.martineau@linux.intel.com> |
| 12538 | 12545 | M: Matthieu Baerts <matthieu.baerts@tessares.net> |
| 12539 | 12546 | L: netdev@vger.kernel.org |
| 12540 | −L: mptcp@lists.01.org | |
| 12547 | +L: mptcp@lists.linux.dev | |
| 12541 | 12548 | S: Maintained |
| 12542 | 12549 | W: https://github.com/multipath-tcp/mptcp_net-next/wiki |
| 12543 | 12550 | B: https://github.com/multipath-tcp/mptcp_net-next/issues |
| @@ -14708,15 +14715,11 @@ F: drivers/net/ethernet/qlogic/qlcnic/ · 2164 unmodified lines | ||
| 14708 | 14715 | QLOGIC QLGE 10Gb ETHERNET DRIVER |
| 14709 | 14716 | M: Manish Chopra <manishc@marvell.com> |
| 14710 | 14717 | M: GR-Linux-NIC-Dev@marvell.com |
| 14711 | −L: netdev@vger.kernel.org | |
| 14712 | −S: Supported | |
| 14713 | −F: drivers/staging/qlge/ | |
| 14714 | − | |
| 14715 | −QLOGIC QLGE 10Gb ETHERNET DRIVER | |
| 14716 | 14718 | M: Coiby Xu <coiby.xu@gmail.com> |
| 14717 | 14719 | L: netdev@vger.kernel.org |
| 14718 | −S: Maintained | |
| 14720 | +S: Supported | |
| 14719 | 14721 | F: Documentation/networking/device_drivers/qlogic/qlge.rst |
| 14722 | +F: drivers/staging/qlge/ | |
| 14720 | 14723 | |
| 14721 | 14724 | QM1D1B0004 MEDIA DRIVER |
| 14722 | 14725 | M: Akihiro Tsukada <tskd08@gmail.com> |
| @@ -14856,6 +14859,14 @@ L: linux-arm-msm@vger.kernel.org · 133 unmodified lines | ||
| 14856 | 14859 | S: Maintained |
| 14857 | 14860 | F: drivers/iommu/arm/arm-smmu/qcom_iommu.c |
| 14858 | 14861 | |
| 14862 | +QUALCOMM IPC ROUTER (QRTR) DRIVER | |
| 14863 | +M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> | |
| 14864 | +L: linux-arm-msm@vger.kernel.org | |
| 14865 | +S: Maintained | |
| 14866 | +F: include/trace/events/qrtr.h | |
| 14867 | +F: include/uapi/linux/qrtr.h | |
| 14868 | +F: net/qrtr/ | |
| 14869 | + | |
| 14859 | 14870 | QUALCOMM IPCC MAILBOX DRIVER |
| 14860 | 14871 | M: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org> |
| 14861 | 14872 | L: linux-arm-msm@vger.kernel.org |
| @@ -15205,6 +15216,7 @@ F: fs/reiserfs/ · 343 unmodified lines | ||
| 15205 | 15216 | REMOTE PROCESSOR (REMOTEPROC) SUBSYSTEM |
| 15206 | 15217 | M: Ohad Ben-Cohen <ohad@wizery.com> |
| 15207 | 15218 | M: Bjorn Andersson <bjorn.andersson@linaro.org> |
| 15219 | +M: Mathieu Poirier <mathieu.poirier@linaro.org> | |
| 15208 | 15220 | L: linux-remoteproc@vger.kernel.org |
| 15209 | 15221 | S: Maintained |
| 15210 | 15222 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git rproc-next |
| @@ -15218,6 +15230,7 @@ F: include/linux/remoteproc/ · 7 unmodified lines | ||
| 15218 | 15230 | REMOTE PROCESSOR MESSAGING (RPMSG) SUBSYSTEM |
| 15219 | 15231 | M: Ohad Ben-Cohen <ohad@wizery.com> |
| 15220 | 15232 | M: Bjorn Andersson <bjorn.andersson@linaro.org> |
| 15233 | +M: Mathieu Poirier <mathieu.poirier@linaro.org> | |
| 15221 | 15234 | L: linux-remoteproc@vger.kernel.org |
| 15222 | 15235 | S: Maintained |
| 15223 | 15236 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/andersson/remoteproc.git rpmsg-next |
| @@ -15634,8 +15647,8 @@ F: Documentation/s390/pci.rst · 410 unmodified lines | ||
| 15634 | 15647 | |
| 15635 | 15648 | S390 VFIO AP DRIVER |
| 15636 | 15649 | M: Tony Krowiak <akrowiak@linux.ibm.com> |
| 15637 | −M: Pierre Morel <pmorel@linux.ibm.com> | |
| 15638 | 15650 | M: Halil Pasic <pasic@linux.ibm.com> |
| 15651 | +M: Jason Herne <jjherne@linux.ibm.com> | |
| 15639 | 15652 | L: linux-s390@vger.kernel.org |
| 15640 | 15653 | S: Supported |
| 15641 | 15654 | W: http://www.ibm.com/developerworks/linux/linux390/ |
| @@ -15647,6 +15660,7 @@ F: drivers/s390/crypto/vfio_ap_private.h · 5 unmodified lines | ||
| 15647 | 15660 | S390 VFIO-CCW DRIVER |
| 15648 | 15661 | M: Cornelia Huck <cohuck@redhat.com> |
| 15649 | 15662 | M: Eric Farman <farman@linux.ibm.com> |
| 15663 | +M: Matthew Rosato <mjrosato@linux.ibm.com> | |
| 15650 | 15664 | R: Halil Pasic <pasic@linux.ibm.com> |
| 15651 | 15665 | L: linux-s390@vger.kernel.org |
| 15652 | 15666 | L: kvm@vger.kernel.org |
| @@ -15657,6 +15671,7 @@ F: include/uapi/linux/vfio_ccw.h · 4 unmodified lines | ||
| 15657 | 15671 | |
| 15658 | 15672 | S390 VFIO-PCI DRIVER |
| 15659 | 15673 | M: Matthew Rosato <mjrosato@linux.ibm.com> |
| 15674 | +M: Eric Farman <farman@linux.ibm.com> | |
| 15660 | 15675 | L: linux-s390@vger.kernel.org |
| 15661 | 15676 | L: kvm@vger.kernel.org |
| 15662 | 15677 | S: Supported |
| @@ -16886,8 +16901,10 @@ F: tools/spi/ · 1223 unmodified lines | ||
| 16886 | 16901 | |
| 16887 | 16902 | SPIDERNET NETWORK DRIVER for CELL |
| 16888 | 16903 | M: Ishizaki Kou <kou.ishizaki@toshiba.co.jp> |
| 16904 | +M: Geoff Levand <geoff@infradead.org> | |
| 16889 | 16905 | L: netdev@vger.kernel.org |
| 16890 | −S: Supported | |
| 16906 | +L: linuxppc-dev@lists.ozlabs.org | |
| 16907 | +S: Maintained | |
| 16891 | 16908 | F: Documentation/networking/device_drivers/ethernet/toshiba/spider_net.rst |
| 16892 | 16909 | F: drivers/net/ethernet/toshiba/spider_net* |
| 16893 | 16910 | |
| @@ -16941,7 +16958,8 @@ F: Documentation/devicetree/bindings/media/i2c/st,st-mipid02.txt · 47 unmodified lines | ||
| 16941 | 16958 | F: drivers/media/i2c/st-mipid02.c |
| 16942 | 16959 | |
| 16943 | 16960 | ST STM32 I2C/SMBUS DRIVER |
| 16944 | −M: Pierre-Yves MORDRET <pierre-yves.mordret@st.com> | |
| 16961 | +M: Pierre-Yves MORDRET <pierre-yves.mordret@foss.st.com> | |
| 16962 | +M: Alain Volmat <alain.volmat@foss.st.com> | |
| 16945 | 16963 | L: linux-i2c@vger.kernel.org |
| 16946 | 16964 | S: Maintained |
| 16947 | 16965 | F: drivers/i2c/busses/i2c-stm32* |
| @@ -17039,7 +17057,7 @@ F: drivers/staging/vt665?/ · 91 unmodified lines | ||
| 17039 | 17057 | |
| 17040 | 17058 | STAGING SUBSYSTEM |
| 17041 | 17059 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| 17042 | −L: devel@driverdev.osuosl.org | |
| 17060 | +L: linux-staging@lists.linux.dev | |
| 17043 | 17061 | S: Supported |
| 17044 | 17062 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git |
| 17045 | 17063 | F: drivers/staging/ |
| @@ -17066,7 +17084,7 @@ F: kernel/jump_label.c · 20 unmodified lines | ||
| 17066 | 17084 | F: kernel/static_call.c |
| 17067 | 17085 | |
| 17068 | 17086 | STI AUDIO (ASoC) DRIVERS |
| 17069 | −M: Arnaud Pouliquen <arnaud.pouliquen@st.com> | |
| 17087 | +M: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> | |
| 17070 | 17088 | L: alsa-devel@alsa-project.org (moderated for non-subscribers) |
| 17071 | 17089 | S: Maintained |
| 17072 | 17090 | F: Documentation/devicetree/bindings/sound/st,sti-asoc-card.txt |
| @@ -17086,15 +17104,15 @@ T: git git://linuxtv.org/media_tree.git · 13 unmodified lines | ||
| 17086 | 17104 | F: drivers/media/usb/stk1160/ |
| 17087 | 17105 | |
| 17088 | 17106 | STM32 AUDIO (ASoC) DRIVERS |
| 17089 | −M: Olivier Moysan <olivier.moysan@st.com> | |
| 17090 | −M: Arnaud Pouliquen <arnaud.pouliquen@st.com> | |
| 17107 | +M: Olivier Moysan <olivier.moysan@foss.st.com> | |
| 17108 | +M: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com> | |
| 17091 | 17109 | L: alsa-devel@alsa-project.org (moderated for non-subscribers) |
| 17092 | 17110 | S: Maintained |
| 17093 | 17111 | F: Documentation/devicetree/bindings/iio/adc/st,stm32-*.yaml |
| 17094 | 17112 | F: sound/soc/stm/ |
| 17095 | 17113 | |
| 17096 | 17114 | STM32 TIMER/LPTIMER DRIVERS |
| 17097 | −M: Fabrice Gasnier <fabrice.gasnier@st.com> | |
| 17115 | +M: Fabrice Gasnier <fabrice.gasnier@foss.st.com> | |
| 17098 | 17116 | S: Maintained |
| 17099 | 17117 | F: Documentation/ABI/testing/*timer-stm32 |
| 17100 | 17118 | F: Documentation/devicetree/bindings/*/*stm32-*timer* |
| @@ -17104,7 +17122,7 @@ F: include/linux/*/stm32-*tim* · 3 unmodified lines | ||
| 17104 | 17122 | |
| 17105 | 17123 | STMMAC ETHERNET DRIVER |
| 17106 | 17124 | M: Giuseppe Cavallaro <peppe.cavallaro@st.com> |
| 17107 | −M: Alexandre Torgue <alexandre.torgue@st.com> | |
| 17125 | +M: Alexandre Torgue <alexandre.torgue@foss.st.com> | |
| 17108 | 17126 | M: Jose Abreu <joabreu@synopsys.com> |
| 17109 | 17127 | L: netdev@vger.kernel.org |
| 17110 | 17128 | S: Supported |
| @@ -17846,7 +17864,6 @@ S: Maintained · 735 unmodified lines | ||
| 17846 | 17864 | F: drivers/thermal/ti-soc-thermal/ |
| 17847 | 17865 | |
| 17848 | 17866 | TI BQ27XXX POWER SUPPLY DRIVER |
| 17849 | −R: Dan Murphy <dmurphy@ti.com> | |
| 17850 | 17867 | F: drivers/power/supply/bq27xxx_battery.c |
| 17851 | 17868 | F: drivers/power/supply/bq27xxx_battery_i2c.c |
| 17852 | 17869 | F: include/linux/power/bq27xxx_battery.h |
| @@ -17981,7 +17998,6 @@ S: Odd Fixes · 128 unmodified lines | ||
| 17981 | 17998 | F: sound/soc/codecs/tas571x* |
| 17982 | 17999 | |
| 17983 | 18000 | TI TCAN4X5X DEVICE DRIVER |
| 17984 | −M: Dan Murphy <dmurphy@ti.com> | |
| 17985 | 18001 | L: linux-can@vger.kernel.org |
| 17986 | 18002 | S: Maintained |
| 17987 | 18003 | F: Documentation/devicetree/bindings/net/can/tcan4x5x.txt |
| @@ -19134,7 +19150,7 @@ VME SUBSYSTEM · 1146 unmodified lines | ||
| 19134 | 19150 | M: Martyn Welch <martyn@welchs.me.uk> |
| 19135 | 19151 | M: Manohar Vanga <manohar.vanga@gmail.com> |
| 19136 | 19152 | M: Greg Kroah-Hartman <gregkh@linuxfoundation.org> |
| 19137 | −L: devel@driverdev.osuosl.org | |
| 19153 | +L: linux-kernel@vger.kernel.org | |
| 19138 | 19154 | S: Maintained |
| 19139 | 19155 | T: git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git |
| 19140 | 19156 | F: Documentation/driver-api/vme.rst |
| @@ -19165,7 +19181,7 @@ S: Maintained · 24 unmodified lines | ||
| 19165 | 19181 | F: drivers/infiniband/hw/vmw_pvrdma/ |
| 19166 | 19182 | |
| 19167 | 19183 | VMware PVSCSI driver |
| 19168 | −M: Jim Gill <jgill@vmware.com> | |
| 19184 | +M: Vishal Bhakta <vbhakta@vmware.com> | |
| 19169 | 19185 | M: VMware PV-Drivers <pv-drivers@vmware.com> |
| 19170 | 19186 | L: linux-scsi@vger.kernel.org |
| 19171 | 19187 | S: Maintained |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | VERSION = 5 |
| 3 | 3 | PATCHLEVEL = 12 |
| 4 | 4 | SUBLEVEL = 0 |
| 5 | −EXTRAVERSION = -rc2 | |
| 5 | +EXTRAVERSION = -rc8 | |
| 6 | 6 | NAME = Frozen Wasteland |
| 7 | 7 | |
| 8 | 8 | # *DOCUMENTATION* |
| @@ -264,7 +264,8 @@ no-dot-config-targets := $(clean-targets) \ · 255 unmodified lines | ||
| 264 | 264 | $(version_h) headers headers_% archheaders archscripts \ |
| 265 | 265 | %asm-generic kernelversion %src-pkg dt_binding_check \ |
| 266 | 266 | outputmakefile |
| 267 | −no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease | |
| 267 | +no-sync-config-targets := $(no-dot-config-targets) %install kernelrelease \ | |
| 268 | + image_name | |
| 268 | 269 | single-targets := %.a %.i %.ko %.lds %.ll %.lst %.mod %.o %.s %.symtypes %/ |
| 269 | 270 | |
| 270 | 271 | config-build := |
| @@ -478,6 +479,7 @@ USERINCLUDE := \ · 207 unmodified lines | ||
| 478 | 479 | -I$(objtree)/arch/$(SRCARCH)/include/generated/uapi \ |
| 479 | 480 | -I$(srctree)/include/uapi \ |
| 480 | 481 | -I$(objtree)/include/generated/uapi \ |
| 482 | + -include $(srctree)/include/linux/compiler-version.h \ | |
| 481 | 483 | -include $(srctree)/include/linux/kconfig.h |
| 482 | 484 | |
| 483 | 485 | # Use LINUXINCLUDE when you must reference the include/ directory. |
| @@ -632,13 +632,12 @@ config HAS_LTO_CLANG · 631 unmodified lines | ||
| 632 | 632 | def_bool y |
| 633 | 633 | # Clang >= 11: https://github.com/ClangBuiltLinux/linux/issues/510 |
| 634 | 634 | depends on CC_IS_CLANG && CLANG_VERSION >= 110000 && LD_IS_LLD |
| 635 | − depends on $(success,test $(LLVM) -eq 1) | |
| 636 | 635 | depends on $(success,test $(LLVM_IAS) -eq 1) |
| 637 | 636 | depends on $(success,$(NM) --help | head -n 1 | grep -qi llvm) |
| 638 | 637 | depends on $(success,$(AR) --help | head -n 1 | grep -qi llvm) |
| 639 | 638 | depends on ARCH_SUPPORTS_LTO_CLANG |
| 640 | 639 | depends on !FTRACE_MCOUNT_USE_RECORDMCOUNT |
| 641 | − depends on !KASAN | |
| 640 | + depends on !KASAN || KASAN_HW_TAGS | |
| 642 | 641 | depends on !GCOV_KERNEL |
| 643 | 642 | help |
| 644 | 643 | The compiler and Kconfig options support building with Clang's |
| @@ -16,7 +16,7 @@ · 15 unmodified lines | ||
| 16 | 16 | memory { |
| 17 | 17 | device_type = "memory"; |
| 18 | 18 | /* CONFIG_LINUX_RAM_BASE needs to match low mem start */ |
| 19 | − reg = <0x0 0x80000000 0x0 0x20000000 /* 512 MB low mem */ | |
| 19 | + reg = <0x0 0x80000000 0x0 0x40000000 /* 1 GB low mem */ | |
| 20 | 20 | 0x1 0x00000000 0x0 0x40000000>; /* 1 GB highmem */ |
| 21 | 21 | }; |
| 22 | 22 | |
| @@ -96,7 +96,7 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs, · 95 unmodified lines | ||
| 96 | 96 | sizeof(sf->uc.uc_mcontext.regs.scratch)); |
| 97 | 97 | err |= __copy_to_user(&sf->uc.uc_sigmask, set, sizeof(sigset_t)); |
| 98 | 98 | |
| 99 | − return err; | |
| 99 | + return err ? -EFAULT : 0; | |
| 100 | 100 | } |
| 101 | 101 | |
| 102 | 102 | static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf) |
| @@ -110,7 +110,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf) · 7 unmodified lines | ||
| 110 | 110 | &(sf->uc.uc_mcontext.regs.scratch), |
| 111 | 111 | sizeof(sf->uc.uc_mcontext.regs.scratch)); |
| 112 | 112 | if (err) |
| 113 | − return err; | |
| 113 | + return -EFAULT; | |
| 114 | 114 | |
| 115 | 115 | set_current_blocked(&set); |
| 116 | 116 | regs->bta = uregs.scratch.bta; |
| @@ -187,25 +187,26 @@ static void init_unwind_table(struct unwind_table *table, const char *name, · 186 unmodified lines | ||
| 187 | 187 | const void *table_start, unsigned long table_size, |
| 188 | 188 | const u8 *header_start, unsigned long header_size) |
| 189 | 189 | { |
| 190 | − const u8 *ptr = header_start + 4; | |
| 191 | − const u8 *end = header_start + header_size; | |
| 192 | − | |
| 193 | 190 | table->core.pc = (unsigned long)core_start; |
| 194 | 191 | table->core.range = core_size; |
| 195 | 192 | table->init.pc = (unsigned long)init_start; |
| 196 | 193 | table->init.range = init_size; |
| 197 | 194 | table->address = table_start; |
| 198 | 195 | table->size = table_size; |
| 199 | − | |
| 200 | − /* See if the linker provided table looks valid. */ | |
| 201 | − if (header_size <= 4 | |
| 202 | − || header_start[0] != 1 | |
| 203 | − || (void *)read_pointer(&ptr, end, header_start[1]) != table_start | |
| 204 | − || header_start[2] == DW_EH_PE_omit | |
| 205 | − || read_pointer(&ptr, end, header_start[2]) <= 0 | |
| 206 | − || header_start[3] == DW_EH_PE_omit) | |
| 207 | − header_start = NULL; | |
| 208 | − | |
| 196 | + /* To avoid the pointer addition with NULL pointer.*/ | |
| 197 | + if (header_start != NULL) { | |
| 198 | + const u8 *ptr = header_start + 4; | |
| 199 | + const u8 *end = header_start + header_size; | |
| 200 | + /* See if the linker provided table looks valid. */ | |
| 201 | + if (header_size <= 4 | |
| 202 | + || header_start[0] != 1 | |
| 203 | + || (void *)read_pointer(&ptr, end, header_start[1]) | |
| 204 | + != table_start | |
| 205 | + || header_start[2] == DW_EH_PE_omit | |
| 206 | + || read_pointer(&ptr, end, header_start[2]) <= 0 | |
| 207 | + || header_start[3] == DW_EH_PE_omit) | |
| 208 | + header_start = NULL; | |
| 209 | + } | |
| 209 | 210 | table->hdrsz = header_size; |
| 210 | 211 | smp_wmb(); |
| 211 | 212 | table->header = header_start; |
| @@ -348,6 +348,7 @@ config ARCH_EP93XX · 347 unmodified lines | ||
| 348 | 348 | select ARM_AMBA |
| 349 | 349 | imply ARM_PATCH_PHYS_VIRT |
| 350 | 350 | select ARM_VIC |
| 351 | + select GENERIC_IRQ_MULTI_HANDLER | |
| 351 | 352 | select AUTO_ZRELADDR |
| 352 | 353 | select CLKDEV_LOOKUP |
| 353 | 354 | select CLKSRC_MMIO |
| @@ -1292,9 +1293,15 @@ config KASAN_SHADOW_OFFSET · 938 unmodified lines | ||
| 1292 | 1293 | |
| 1293 | 1294 | config NR_CPUS |
| 1294 | 1295 | int "Maximum number of CPUs (2-32)" |
| 1295 | − range 2 32 | |
| 1296 | + range 2 16 if DEBUG_KMAP_LOCAL | |
| 1297 | + range 2 32 if !DEBUG_KMAP_LOCAL | |
| 1296 | 1298 | depends on SMP |
| 1297 | 1299 | default "4" |
| 1300 | + help | |
| 1301 | + The maximum number of CPUs that the kernel can support. | |
| 1302 | + Up to 32 CPUs can be supported, or up to 16 if kmap_local() | |
| 1303 | + debugging is enabled, which uses half of the per-CPU fixmap | |
| 1304 | + slots as guard regions. | |
| 1298 | 1305 | |
| 1299 | 1306 | config HOTPLUG_CPU |
| 1300 | 1307 | bool "Support for hot-pluggable CPUs" |
| @@ -40,6 +40,9 @@ · 39 unmodified lines | ||
| 40 | 40 | ethernet1 = &cpsw_emac1; |
| 41 | 41 | spi0 = &spi0; |
| 42 | 42 | spi1 = &spi1; |
| 43 | + mmc0 = &mmc1; | |
| 44 | + mmc1 = &mmc2; | |
| 45 | + mmc2 = &mmc3; | |
| 43 | 46 | }; |
| 44 | 47 | |
| 45 | 48 | cpus { |
| @@ -32,7 +32,8 @@ · 31 unmodified lines | ||
| 32 | 32 | ranges = <MBUS_ID(0xf0, 0x01) 0 0xf1000000 0x100000 |
| 33 | 33 | MBUS_ID(0x01, 0x1d) 0 0xfff00000 0x100000 |
| 34 | 34 | MBUS_ID(0x09, 0x19) 0 0xf1100000 0x10000 |
| 35 | − MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000>; | |
| 35 | + MBUS_ID(0x09, 0x15) 0 0xf1110000 0x10000 | |
| 36 | + MBUS_ID(0x0c, 0x04) 0 0xf1200000 0x100000>; | |
| 36 | 37 | |
| 37 | 38 | internal-regs { |
| 38 | 39 | |
| @@ -389,6 +390,7 @@ · 350 unmodified lines | ||
| 389 | 390 | phy1: ethernet-phy@1 { |
| 390 | 391 | compatible = "ethernet-phy-ieee802.3-c22"; |
| 391 | 392 | reg = <1>; |
| 393 | + marvell,reg-init = <3 18 0 0x4985>; | |
| 392 | 394 | |
| 393 | 395 | /* irq is connected to &pcawan pin 7 */ |
| 394 | 396 | }; |
| @@ -334,14 +334,6 @@ · 333 unmodified lines | ||
| 334 | 334 | }; |
| 335 | 335 | |
| 336 | 336 | &pinctrl { |
| 337 | − atmel,mux-mask = < | |
| 338 | − /* A B C */ | |
| 339 | − 0xFFFFFE7F 0xC0E0397F 0xEF00019D /* pioA */ | |
| 340 | − 0x03FFFFFF 0x02FC7E68 0x00780000 /* pioB */ | |
| 341 | − 0xffffffff 0xF83FFFFF 0xB800F3FC /* pioC */ | |
| 342 | − 0x003FFFFF 0x003F8000 0x00000000 /* pioD */ | |
| 343 | − >; | |
| 344 | − | |
| 345 | 337 | adc { |
| 346 | 338 | pinctrl_adc_default: adc_default { |
| 347 | 339 | atmel,pins = <AT91_PIOB 15 AT91_PERIPH_A AT91_PINCTRL_NONE>; |
| @@ -84,8 +84,8 @@ · 83 unmodified lines | ||
| 84 | 84 | pinctrl-0 = <&pinctrl_macb0_default>; |
| 85 | 85 | phy-mode = "rmii"; |
| 86 | 86 | |
| 87 | − ethernet-phy@0 { | |
| 88 | − reg = <0x0>; | |
| 87 | + ethernet-phy@7 { | |
| 88 | + reg = <0x7>; | |
| 89 | 89 | interrupt-parent = <&pioA>; |
| 90 | 90 | interrupts = <PIN_PD31 IRQ_TYPE_LEVEL_LOW>; |
| 91 | 91 | pinctrl-names = "default"; |
| @@ -308,14 +308,6 @@ · 307 unmodified lines | ||
| 308 | 308 | #reset-cells = <1>; |
| 309 | 309 | }; |
| 310 | 310 | |
| 311 | − bsc_intr: interrupt-controller@7ef00040 { | |
| 312 | − compatible = "brcm,bcm2711-l2-intc", "brcm,l2-intc"; | |
| 313 | − reg = <0x7ef00040 0x30>; | |
| 314 | − interrupts = <GIC_SPI 117 IRQ_TYPE_LEVEL_HIGH>; | |
| 315 | − interrupt-controller; | |
| 316 | − #interrupt-cells = <1>; | |
| 317 | − }; | |
| 318 | − | |
| 319 | 311 | aon_intr: interrupt-controller@7ef00100 { |
| 320 | 312 | compatible = "brcm,bcm2711-l2-intc", "brcm,l2-intc"; |
| 321 | 313 | reg = <0x7ef00100 0x30>; |
| @@ -362,8 +354,6 @@ · 40 unmodified lines | ||
| 362 | 354 | reg = <0x7ef04500 0x100>, <0x7ef00b00 0x300>; |
| 363 | 355 | reg-names = "bsc", "auto-i2c"; |
| 364 | 356 | clock-frequency = <97500>; |
| 365 | − interrupt-parent = <&bsc_intr>; | |
| 366 | − interrupts = <0>; | |
| 367 | 357 | status = "disabled"; |
| 368 | 358 | }; |
| 369 | 359 | |
| @@ -405,8 +395,6 @@ · 35 unmodified lines | ||
| 405 | 395 | reg = <0x7ef09500 0x100>, <0x7ef05b00 0x300>; |
| 406 | 396 | reg-names = "bsc", "auto-i2c"; |
| 407 | 397 | clock-frequency = <97500>; |
| 408 | − interrupt-parent = <&bsc_intr>; | |
| 409 | − interrupts = <1>; | |
| 410 | 398 | status = "disabled"; |
| 411 | 399 | }; |
| 412 | 400 | }; |
| @@ -433,6 +433,7 @@ · 432 unmodified lines | ||
| 433 | 433 | pinctrl-0 = <&pinctrl_usdhc2>; |
| 434 | 434 | cd-gpios = <&gpio1 4 GPIO_ACTIVE_LOW>; |
| 435 | 435 | wp-gpios = <&gpio1 2 GPIO_ACTIVE_HIGH>; |
| 436 | + vmmc-supply = <&vdd_sd1_reg>; | |
| 436 | 437 | status = "disabled"; |
| 437 | 438 | }; |
| 438 | 439 | |
| @@ -442,5 +443,6 @@ · 3 unmodified lines | ||
| 442 | 443 | &pinctrl_usdhc3_cdwp>; |
| 443 | 444 | cd-gpios = <&gpio1 27 GPIO_ACTIVE_LOW>; |
| 444 | 445 | wp-gpios = <&gpio1 29 GPIO_ACTIVE_HIGH>; |
| 446 | + vmmc-supply = <&vdd_sd0_reg>; | |
| 445 | 447 | status = "disabled"; |
| 446 | 448 | }; |
| @@ -210,9 +210,6 @@ · 209 unmodified lines | ||
| 210 | 210 | micrel,led-mode = <1>; |
| 211 | 211 | clocks = <&clks IMX6UL_CLK_ENET_REF>; |
| 212 | 212 | clock-names = "rmii-ref"; |
| 213 | − reset-gpios = <&gpio_spi 1 GPIO_ACTIVE_LOW>; | |
| 214 | − reset-assert-us = <10000>; | |
| 215 | − reset-deassert-us = <100>; | |
| 216 | 213 | |
| 217 | 214 | }; |
| 218 | 215 | |
| @@ -222,9 +219,6 @@ · 3 unmodified lines | ||
| 222 | 219 | micrel,led-mode = <1>; |
| 223 | 220 | clocks = <&clks IMX6UL_CLK_ENET2_REF>; |
| 224 | 221 | clock-names = "rmii-ref"; |
| 225 | − reset-gpios = <&gpio_spi 2 GPIO_ACTIVE_LOW>; | |
| 226 | − reset-assert-us = <10000>; | |
| 227 | − reset-deassert-us = <100>; | |
| 228 | 222 | }; |
| 229 | 223 | }; |
| 230 | 224 | }; |
| @@ -243,6 +237,22 @@ · 12 unmodified lines | ||
| 243 | 237 | status = "okay"; |
| 244 | 238 | }; |
| 245 | 239 | |
| 240 | +&gpio_spi { | |
| 241 | + eth0-phy-hog { | |
| 242 | + gpio-hog; | |
| 243 | + gpios = <1 GPIO_ACTIVE_HIGH>; | |
| 244 | + output-high; | |
| 245 | + line-name = "eth0-phy"; | |
| 246 | + }; | |
| 247 | + | |
| 248 | + eth1-phy-hog { | |
| 249 | + gpio-hog; | |
| 250 | + gpios = <2 GPIO_ACTIVE_HIGH>; | |
| 251 | + output-high; | |
| 252 | + line-name = "eth1-phy"; | |
| 253 | + }; | |
| 254 | +}; | |
| 255 | + | |
| 246 | 256 | &i2c1 { |
| 247 | 257 | clock-frequency = <100000>; |
| 248 | 258 | pinctrl-names = "default"; |
| @@ -14,5 +14,6 @@ · 13 unmodified lines | ||
| 14 | 14 | }; |
| 15 | 15 | |
| 16 | 16 | &gpmi { |
| 17 | + fsl,use-minimum-ecc; | |
| 17 | 18 | status = "okay"; |
| 18 | 19 | }; |
| @@ -24,6 +24,9 @@ · 23 unmodified lines | ||
| 24 | 24 | i2c0 = &i2c1; |
| 25 | 25 | i2c1 = &i2c2; |
| 26 | 26 | i2c2 = &i2c3; |
| 27 | + mmc0 = &mmc1; | |
| 28 | + mmc1 = &mmc2; | |
| 29 | + mmc2 = &mmc3; | |
| 27 | 30 | serial0 = &uart1; |
| 28 | 31 | serial1 = &uart2; |
| 29 | 32 | serial2 = &uart3; |
| @@ -22,6 +22,11 @@ · 21 unmodified lines | ||
| 22 | 22 | i2c1 = &i2c2; |
| 23 | 23 | i2c2 = &i2c3; |
| 24 | 24 | i2c3 = &i2c4; |
| 25 | + mmc0 = &mmc1; | |
| 26 | + mmc1 = &mmc2; | |
| 27 | + mmc2 = &mmc3; | |
| 28 | + mmc3 = &mmc4; | |
| 29 | + mmc4 = &mmc5; | |
| 25 | 30 | serial0 = &uart1; |
| 26 | 31 | serial1 = &uart2; |
| 27 | 32 | serial2 = &uart3; |
| @@ -770,14 +770,6 @@ · 769 unmodified lines | ||
| 770 | 770 | ti,max-div = <2>; |
| 771 | 771 | }; |
| 772 | 772 | |
| 773 | − sha2md5_fck: sha2md5_fck@15c8 { | |
| 774 | − #clock-cells = <0>; | |
| 775 | − compatible = "ti,gate-clock"; | |
| 776 | − clocks = <&l3_div_ck>; | |
| 777 | − ti,bit-shift = <1>; | |
| 778 | − reg = <0x15c8>; | |
| 779 | − }; | |
| 780 | − | |
| 781 | 773 | usb_phy_cm_clk32k: usb_phy_cm_clk32k@640 { |
| 782 | 774 | #clock-cells = <0>; |
| 783 | 775 | compatible = "ti,gate-clock"; |
| @@ -25,6 +25,11 @@ · 24 unmodified lines | ||
| 25 | 25 | i2c2 = &i2c3; |
| 26 | 26 | i2c3 = &i2c4; |
| 27 | 27 | i2c4 = &i2c5; |
| 28 | + mmc0 = &mmc1; | |
| 29 | + mmc1 = &mmc2; | |
| 30 | + mmc2 = &mmc3; | |
| 31 | + mmc3 = &mmc4; | |
| 32 | + mmc4 = &mmc5; | |
| 28 | 33 | serial0 = &uart1; |
| 29 | 34 | serial1 = &uart2; |
| 30 | 35 | serial2 = &uart3; |
| @@ -606,6 +606,15 @@ · 605 unmodified lines | ||
| 606 | 606 | compatible = "microchip,sam9x60-pinctrl", "atmel,at91sam9x5-pinctrl", "atmel,at91rm9200-pinctrl", "simple-bus"; |
| 607 | 607 | ranges = <0xfffff400 0xfffff400 0x800>; |
| 608 | 608 | |
| 609 | + /* mux-mask corresponding to sam9x60 SoC in TFBGA228L package */ | |
| 610 | + atmel,mux-mask = < | |
| 611 | + /* A B C */ | |
| 612 | + 0xffffffff 0xffe03fff 0xef00019d /* pioA */ | |
| 613 | + 0x03ffffff 0x02fc7e7f 0x00780000 /* pioB */ | |
| 614 | + 0xffffffff 0xffffffff 0xf83fffff /* pioC */ | |
| 615 | + 0x003fffff 0x003f8000 0x00000000 /* pioD */ | |
| 616 | + >; | |
| 617 | + | |
| 609 | 618 | pioA: gpio@fffff400 { |
| 610 | 619 | compatible = "microchip,sam9x60-gpio", "atmel,at91sam9x5-gpio", "atmel,at91rm9200-gpio"; |
| 611 | 620 | reg = <0xfffff400 0x200>; |
| @@ -15,14 +15,14 @@ · 14 unmodified lines | ||
| 15 | 15 | #include <asm/mach-types.h> |
| 16 | 16 | |
| 17 | 17 | /* cats host-specific stuff */ |
| 18 | −static int irqmap_cats[] __initdata = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 }; | |
| 18 | +static int irqmap_cats[] = { IRQ_PCI, IRQ_IN0, IRQ_IN1, IRQ_IN3 }; | |
| 19 | 19 | |
| 20 | 20 | static u8 cats_no_swizzle(struct pci_dev *dev, u8 *pin) |
| 21 | 21 | { |
| 22 | 22 | return 0; |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | −static int __init cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |
| 25 | +static int cats_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |
| 26 | 26 | { |
| 27 | 27 | if (dev->irq >= 255) |
| 28 | 28 | return -1; /* not a valid interrupt. */ |
| @@ -14,9 +14,9 @@ · 13 unmodified lines | ||
| 14 | 14 | #include <asm/mach/pci.h> |
| 15 | 15 | #include <asm/mach-types.h> |
| 16 | 16 | |
| 17 | −static int irqmap_ebsa285[] __initdata = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI }; | |
| 17 | +static int irqmap_ebsa285[] = { IRQ_IN3, IRQ_IN1, IRQ_IN0, IRQ_PCI }; | |
| 18 | 18 | |
| 19 | −static int __init ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |
| 19 | +static int ebsa285_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |
| 20 | 20 | { |
| 21 | 21 | if (dev->vendor == PCI_VENDOR_ID_CONTAQ && |
| 22 | 22 | dev->device == PCI_DEVICE_ID_CONTAQ_82C693) |
| @@ -18,7 +18,7 @@ · 17 unmodified lines | ||
| 18 | 18 | * We now use the slot ID instead of the device identifiers to select |
| 19 | 19 | * which interrupt is routed where. |
| 20 | 20 | */ |
| 21 | −static int __init netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |
| 21 | +static int netwinder_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |
| 22 | 22 | { |
| 23 | 23 | switch (slot) { |
| 24 | 24 | case 0: /* host bridge */ |
| @@ -14,13 +14,12 @@ · 13 unmodified lines | ||
| 14 | 14 | #include <asm/mach/pci.h> |
| 15 | 15 | #include <asm/mach-types.h> |
| 16 | 16 | |
| 17 | −static int irqmap_personal_server[] __initdata = { | |
| 17 | +static int irqmap_personal_server[] = { | |
| 18 | 18 | IRQ_IN0, IRQ_IN1, IRQ_IN2, IRQ_IN3, 0, 0, 0, |
| 19 | 19 | IRQ_DOORBELLHOST, IRQ_DMA1, IRQ_DMA2, IRQ_PCI |
| 20 | 20 | }; |
| 21 | 21 | |
| 22 | −static int __init personal_server_map_irq(const struct pci_dev *dev, u8 slot, | |
| 23 | − u8 pin) | |
| 22 | +static int personal_server_map_irq(const struct pci_dev *dev, u8 slot, u8 pin) | |
| 24 | 23 | { |
| 25 | 24 | unsigned char line; |
| 26 | 25 | |
| @@ -7,6 +7,7 @@ · 6 unmodified lines | ||
| 7 | 7 | #include <linux/module.h> |
| 8 | 8 | #include <linux/irq.h> |
| 9 | 9 | #include <linux/irqdomain.h> |
| 10 | +#include <linux/irqchip.h> | |
| 10 | 11 | #include <linux/io.h> |
| 11 | 12 | #include <linux/of.h> |
| 12 | 13 | #include <linux/of_address.h> |
| @@ -162,7 +163,7 @@ static void __exception_irq_entry avic_handle_irq(struct pt_regs *regs) · 149 unmodified lines | ||
| 162 | 163 | * interrupts. It registers the interrupt enable and disable functions |
| 163 | 164 | * to the kernel for each interrupt source. |
| 164 | 165 | */ |
| 165 | −void __init mxc_init_irq(void __iomem *irqbase) | |
| 166 | +static void __init mxc_init_irq(void __iomem *irqbase) | |
| 166 | 167 | { |
| 167 | 168 | struct device_node *np; |
| 168 | 169 | int irq_base; |
| @@ -220,3 +221,16 @@ void __init mxc_init_irq(void __iomem *irqbase) · 51 unmodified lines | ||
| 220 | 221 | |
| 221 | 222 | printk(KERN_INFO "MXC IRQ initialized\n"); |
| 222 | 223 | } |
| 224 | + | |
| 225 | +static int __init imx_avic_init(struct device_node *node, | |
| 226 | + struct device_node *parent) | |
| 227 | +{ | |
| 228 | + void __iomem *avic_base; | |
| 229 | + | |
| 230 | + avic_base = of_iomap(node, 0); | |
| 231 | + BUG_ON(!avic_base); | |
| 232 | + mxc_init_irq(avic_base); | |
| 233 | + return 0; | |
| 234 | +} | |
| 235 | + | |
| 236 | +IRQCHIP_DECLARE(imx_avic, "fsl,avic", imx_avic_init); | |
| @@ -22,7 +22,6 @@ void mx35_map_io(void); · 21 unmodified lines | ||
| 22 | 22 | void imx21_init_early(void); |
| 23 | 23 | void imx31_init_early(void); |
| 24 | 24 | void imx35_init_early(void); |
| 25 | −void mxc_init_irq(void __iomem *); | |
| 26 | 25 | void mx31_init_irq(void); |
| 27 | 26 | void mx35_init_irq(void); |
| 28 | 27 | void mxc_set_cpu_type(unsigned int type); |
| @@ -17,16 +17,6 @@ static void __init imx1_init_early(void) · 16 unmodified lines | ||
| 17 | 17 | mxc_set_cpu_type(MXC_CPU_MX1); |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | −static void __init imx1_init_irq(void) | |
| 21 | −{ | |
| 22 | − void __iomem *avic_addr; | |
| 23 | − | |
| 24 | − avic_addr = ioremap(MX1_AVIC_ADDR, SZ_4K); | |
| 25 | − WARN_ON(!avic_addr); | |
| 26 | − | |
| 27 | − mxc_init_irq(avic_addr); | |
| 28 | −} | |
| 29 | − | |
| 30 | 20 | static const char * const imx1_dt_board_compat[] __initconst = { |
| 31 | 21 | "fsl,imx1", |
| 32 | 22 | NULL |
| @@ -34,7 +24,6 @@ static const char * const imx1_dt_board_compat[] __initconst = { · 1 unmodified line | ||
| 34 | 24 | |
| 35 | 25 | DT_MACHINE_START(IMX1_DT, "Freescale i.MX1 (Device Tree Support)") |
| 36 | 26 | .init_early = imx1_init_early, |
| 37 | − .init_irq = imx1_init_irq, | |
| 38 | 27 | .dt_compat = imx1_dt_board_compat, |
| 39 | 28 | .restart = mxc_restart, |
| 40 | 29 | MACHINE_END |
| @@ -22,17 +22,6 @@ static void __init imx25_dt_init(void) · 21 unmodified lines | ||
| 22 | 22 | imx_aips_allow_unprivileged_access("fsl,imx25-aips"); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | −static void __init mx25_init_irq(void) | |
| 26 | −{ | |
| 27 | − struct device_node *np; | |
| 28 | − void __iomem *avic_base; | |
| 29 | − | |
| 30 | − np = of_find_compatible_node(NULL, NULL, "fsl,avic"); | |
| 31 | − avic_base = of_iomap(np, 0); | |
| 32 | − BUG_ON(!avic_base); | |
| 33 | − mxc_init_irq(avic_base); | |
| 34 | −} | |
| 35 | − | |
| 36 | 25 | static const char * const imx25_dt_board_compat[] __initconst = { |
| 37 | 26 | "fsl,imx25", |
| 38 | 27 | NULL |
| @@ -42,6 +31,5 @@ DT_MACHINE_START(IMX25_DT, "Freescale i.MX25 (Device Tree Support)") · 3 unmodified lines | ||
| 42 | 31 | .init_early = imx25_init_early, |
| 43 | 32 | .init_machine = imx25_dt_init, |
| 44 | 33 | .init_late = imx25_pm_init, |
| 45 | − .init_irq = mx25_init_irq, | |
| 46 | 34 | .dt_compat = imx25_dt_board_compat, |
| 47 | 35 | MACHINE_END |
| @@ -56,17 +56,6 @@ static void __init imx27_init_early(void) · 55 unmodified lines | ||
| 56 | 56 | mxc_set_cpu_type(MXC_CPU_MX27); |
| 57 | 57 | } |
| 58 | 58 | |
| 59 | −static void __init mx27_init_irq(void) | |
| 60 | −{ | |
| 61 | − void __iomem *avic_base; | |
| 62 | − struct device_node *np; | |
| 63 | − | |
| 64 | − np = of_find_compatible_node(NULL, NULL, "fsl,avic"); | |
| 65 | − avic_base = of_iomap(np, 0); | |
| 66 | − BUG_ON(!avic_base); | |
| 67 | − mxc_init_irq(avic_base); | |
| 68 | −} | |
| 69 | − | |
| 70 | 59 | static const char * const imx27_dt_board_compat[] __initconst = { |
| 71 | 60 | "fsl,imx27", |
| 72 | 61 | NULL |
| @@ -75,7 +64,6 @@ static const char * const imx27_dt_board_compat[] __initconst = { · 2 unmodified lines | ||
| 75 | 64 | DT_MACHINE_START(IMX27_DT, "Freescale i.MX27 (Device Tree Support)") |
| 76 | 65 | .map_io = mx27_map_io, |
| 77 | 66 | .init_early = imx27_init_early, |
| 78 | − .init_irq = mx27_init_irq, | |
| 79 | 67 | .init_late = imx27_pm_init, |
| 80 | 68 | .dt_compat = imx27_dt_board_compat, |
| 81 | 69 | MACHINE_END |
| @@ -14,6 +14,5 @@ static const char * const imx31_dt_board_compat[] __initconst = { · 13 unmodified lines | ||
| 14 | 14 | DT_MACHINE_START(IMX31_DT, "Freescale i.MX31 (Device Tree Support)") |
| 15 | 15 | .map_io = mx31_map_io, |
| 16 | 16 | .init_early = imx31_init_early, |
| 17 | − .init_irq = mx31_init_irq, | |
| 18 | 17 | .dt_compat = imx31_dt_board_compat, |
| 19 | 18 | MACHINE_END |
| @@ -27,6 +27,5 @@ DT_MACHINE_START(IMX35_DT, "Freescale i.MX35 (Device Tree Support)") · 26 unmodified lines | ||
| 27 | 27 | .l2c_aux_mask = ~0, |
| 28 | 28 | .map_io = mx35_map_io, |
| 29 | 29 | .init_early = imx35_init_early, |
| 30 | − .init_irq = mx35_init_irq, | |
| 31 | 30 | .dt_compat = imx35_dt_board_compat, |
| 32 | 31 | MACHINE_END |
| @@ -109,18 +109,6 @@ void __init imx31_init_early(void) · 108 unmodified lines | ||
| 109 | 109 | mx3_ccm_base = of_iomap(np, 0); |
| 110 | 110 | BUG_ON(!mx3_ccm_base); |
| 111 | 111 | } |
| 112 | − | |
| 113 | −void __init mx31_init_irq(void) | |
| 114 | −{ | |
| 115 | − void __iomem *avic_base; | |
| 116 | − struct device_node *np; | |
| 117 | − | |
| 118 | − np = of_find_compatible_node(NULL, NULL, "fsl,imx31-avic"); | |
| 119 | − avic_base = of_iomap(np, 0); | |
| 120 | − BUG_ON(!avic_base); | |
| 121 | − | |
| 122 | − mxc_init_irq(avic_base); | |
| 123 | −} | |
| 124 | 112 | #endif /* ifdef CONFIG_SOC_IMX31 */ |
| 125 | 113 | |
| 126 | 114 | #ifdef CONFIG_SOC_IMX35 |
| @@ -158,16 +146,4 @@ void __init imx35_init_early(void) · 31 unmodified lines | ||
| 158 | 146 | mx3_ccm_base = of_iomap(np, 0); |
| 159 | 147 | BUG_ON(!mx3_ccm_base); |
| 160 | 148 | } |
| 161 | − | |
| 162 | −void __init mx35_init_irq(void) | |
| 163 | −{ | |
| 164 | − void __iomem *avic_base; | |
| 165 | − struct device_node *np; | |
| 166 | − | |
| 167 | − np = of_find_compatible_node(NULL, NULL, "fsl,imx35-avic"); | |
| 168 | − avic_base = of_iomap(np, 0); | |
| 169 | − BUG_ON(!avic_base); | |
| 170 | − | |
| 171 | − mxc_init_irq(avic_base); | |
| 172 | −} | |
| 173 | 149 | #endif /* ifdef CONFIG_SOC_IMX35 */ |
| @@ -65,7 +65,7 @@ static void __init keystone_init(void) · 64 unmodified lines | ||
| 65 | 65 | static long long __init keystone_pv_fixup(void) |
| 66 | 66 | { |
| 67 | 67 | long long offset; |
| 68 | − phys_addr_t mem_start, mem_end; | |
| 68 | + u64 mem_start, mem_end; | |
| 69 | 69 | |
| 70 | 70 | mem_start = memblock_start_of_DRAM(); |
| 71 | 71 | mem_end = memblock_end_of_DRAM(); |
| @@ -78,7 +78,7 @@ static long long __init keystone_pv_fixup(void) · 6 unmodified lines | ||
| 78 | 78 | if (mem_start < KEYSTONE_HIGH_PHYS_START || |
| 79 | 79 | mem_end > KEYSTONE_HIGH_PHYS_END) { |
| 80 | 80 | pr_crit("Invalid address space for memory (%08llx-%08llx)\n", |
| 81 | − (u64)mem_start, (u64)mem_end); | |
| 81 | + mem_start, mem_end); | |
| 82 | 82 | return 0; |
| 83 | 83 | } |
| 84 | 84 | |
| @@ -15,6 +15,7 @@ · 14 unmodified lines | ||
| 15 | 15 | #include <linux/platform_data/gpio-omap.h> |
| 16 | 16 | |
| 17 | 17 | #include <asm/assembler.h> |
| 18 | +#include <asm/irq.h> | |
| 18 | 19 | |
| 19 | 20 | #include "ams-delta-fiq.h" |
| 20 | 21 | #include "board-ams-delta.h" |
| @@ -33,7 +33,7 @@ static void __init __maybe_unused omap_generic_init(void) · 32 unmodified lines | ||
| 33 | 33 | } |
| 34 | 34 | |
| 35 | 35 | /* Clocks are needed early, see drivers/clocksource for the rest */ |
| 36 | −void __init __maybe_unused omap_init_time_of(void) | |
| 36 | +static void __init __maybe_unused omap_init_time_of(void) | |
| 37 | 37 | { |
| 38 | 38 | omap_clk_init(); |
| 39 | 39 | timer_probe(); |
| @@ -9,6 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | #include <linux/arm-smccc.h> |
| 12 | +#include <linux/cpu_pm.h> | |
| 12 | 13 | #include <linux/kernel.h> |
| 13 | 14 | #include <linux/init.h> |
| 14 | 15 | #include <linux/io.h> |
| @@ -20,6 +21,7 @@ · 5 unmodified lines | ||
| 20 | 21 | |
| 21 | 22 | #include "common.h" |
| 22 | 23 | #include "omap-secure.h" |
| 24 | +#include "soc.h" | |
| 23 | 25 | |
| 24 | 26 | static phys_addr_t omap_secure_memblock_base; |
| 25 | 27 | |
| @@ -213,3 +215,40 @@ void __init omap_secure_init(void) · 187 unmodified lines | ||
| 213 | 215 | { |
| 214 | 216 | omap_optee_init_check(); |
| 215 | 217 | } |
| 218 | + | |
| 219 | +/* | |
| 220 | + * Dummy dispatcher call after core OSWR and MPU off. Updates the ROM return | |
| 221 | + * address after MMU has been re-enabled after CPU1 has been woken up again. | |
| 222 | + * Otherwise the ROM code will attempt to use the earlier physical return | |
| 223 | + * address that got set with MMU off when waking up CPU1. Only used on secure | |
| 224 | + * devices. | |
| 225 | + */ | |
| 226 | +static int cpu_notifier(struct notifier_block *nb, unsigned long cmd, void *v) | |
| 227 | +{ | |
| 228 | + switch (cmd) { | |
| 229 | + case CPU_CLUSTER_PM_EXIT: | |
| 230 | + omap_secure_dispatcher(OMAP4_PPA_SERVICE_0, | |
| 231 | + FLAG_START_CRITICAL, | |
| 232 | + 0, 0, 0, 0, 0); | |
| 233 | + break; | |
| 234 | + default: | |
| 235 | + break; | |
| 236 | + } | |
| 237 | + | |
| 238 | + return NOTIFY_OK; | |
| 239 | +} | |
| 240 | + | |
| 241 | +static struct notifier_block secure_notifier_block = { | |
| 242 | + .notifier_call = cpu_notifier, | |
| 243 | +}; | |
| 244 | + | |
| 245 | +static int __init secure_pm_init(void) | |
| 246 | +{ | |
| 247 | + if (omap_type() == OMAP2_DEVICE_TYPE_GP || !soc_is_omap44xx()) | |
| 248 | + return 0; | |
| 249 | + | |
| 250 | + cpu_pm_register_notifier(&secure_notifier_block); | |
| 251 | + | |
| 252 | + return 0; | |
| 253 | +} | |
| 254 | +omap_arch_initcall(secure_pm_init); | |
| @@ -50,6 +50,7 @@ · 49 unmodified lines | ||
| 50 | 50 | #define OMAP5_DRA7_MON_SET_ACR_INDEX 0x107 |
| 51 | 51 | |
| 52 | 52 | /* Secure PPA(Primary Protected Application) APIs */ |
| 53 | +#define OMAP4_PPA_SERVICE_0 0x21 | |
| 53 | 54 | #define OMAP4_PPA_L2_POR_INDEX 0x23 |
| 54 | 55 | #define OMAP4_PPA_CPU_ACTRL_SMP_INDEX 0x25 |
| 55 | 56 | |
| @@ -246,10 +246,10 @@ int __init omap4_cpcap_init(void) · 245 unmodified lines | ||
| 246 | 246 | omap_voltage_register_pmic(voltdm, &omap443x_max8952_mpu); |
| 247 | 247 | |
| 248 | 248 | if (of_machine_is_compatible("motorola,droid-bionic")) { |
| 249 | − voltdm = voltdm_lookup("mpu"); | |
| 249 | + voltdm = voltdm_lookup("core"); | |
| 250 | 250 | omap_voltage_register_pmic(voltdm, &omap_cpcap_core); |
| 251 | 251 | |
| 252 | − voltdm = voltdm_lookup("mpu"); | |
| 252 | + voltdm = voltdm_lookup("iva"); | |
| 253 | 253 | omap_voltage_register_pmic(voltdm, &omap_cpcap_iva); |
| 254 | 254 | } else { |
| 255 | 255 | voltdm = voltdm_lookup("core"); |
| @@ -88,34 +88,26 @@ static void __init sr_set_nvalues(struct omap_volt_data *volt_data, · 87 unmodified lines | ||
| 88 | 88 | |
| 89 | 89 | extern struct omap_sr_data omap_sr_pdata[]; |
| 90 | 90 | |
| 91 | −static int __init sr_dev_init(struct omap_hwmod *oh, void *user) | |
| 91 | +static int __init sr_init_by_name(const char *name, const char *voltdm) | |
| 92 | 92 | { |
| 93 | 93 | struct omap_sr_data *sr_data = NULL; |
| 94 | 94 | struct omap_volt_data *volt_data; |
| 95 | − struct omap_smartreflex_dev_attr *sr_dev_attr; | |
| 96 | 95 | static int i; |
| 97 | 96 | |
| 98 | − if (!strncmp(oh->name, "smartreflex_mpu_iva", 20) || | |
| 99 | − !strncmp(oh->name, "smartreflex_mpu", 16)) | |
| 97 | + if (!strncmp(name, "smartreflex_mpu_iva", 20) || | |
| 98 | + !strncmp(name, "smartreflex_mpu", 16)) | |
| 100 | 99 | sr_data = &omap_sr_pdata[OMAP_SR_MPU]; |
| 101 | − else if (!strncmp(oh->name, "smartreflex_core", 17)) | |
| 100 | + else if (!strncmp(name, "smartreflex_core", 17)) | |
| 102 | 101 | sr_data = &omap_sr_pdata[OMAP_SR_CORE]; |
| 103 | − else if (!strncmp(oh->name, "smartreflex_iva", 16)) | |
| 102 | + else if (!strncmp(name, "smartreflex_iva", 16)) | |
| 104 | 103 | sr_data = &omap_sr_pdata[OMAP_SR_IVA]; |
| 105 | 104 | |
| 106 | 105 | if (!sr_data) { |
| 107 | − pr_err("%s: Unknown instance %s\n", __func__, oh->name); | |
| 106 | + pr_err("%s: Unknown instance %s\n", __func__, name); | |
| 108 | 107 | return -EINVAL; |
| 109 | 108 | } |
| 110 | 109 | |
| 111 | − sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr; | |
| 112 | − if (!sr_dev_attr || !sr_dev_attr->sensor_voltdm_name) { | |
| 113 | − pr_err("%s: No voltage domain specified for %s. Cannot initialize\n", | |
| 114 | − __func__, oh->name); | |
| 115 | − goto exit; | |
| 116 | − } | |
| 117 | − | |
| 118 | − sr_data->name = oh->name; | |
| 110 | + sr_data->name = name; | |
| 119 | 111 | if (cpu_is_omap343x()) |
| 120 | 112 | sr_data->ip_type = 1; |
| 121 | 113 | else |
| @@ -136,10 +128,10 @@ static int __init sr_dev_init(struct omap_hwmod *oh, void *user) · 14 unmodified lines | ||
| 136 | 128 | } |
| 137 | 129 | } |
| 138 | 130 | |
| 139 | − sr_data->voltdm = voltdm_lookup(sr_dev_attr->sensor_voltdm_name); | |
| 131 | + sr_data->voltdm = voltdm_lookup(voltdm); | |
| 140 | 132 | if (!sr_data->voltdm) { |
| 141 | 133 | pr_err("%s: Unable to get voltage domain pointer for VDD %s\n", |
| 142 | − __func__, sr_dev_attr->sensor_voltdm_name); | |
| 134 | + __func__, voltdm); | |
| 143 | 135 | goto exit; |
| 144 | 136 | } |
| 145 | 137 | |
| @@ -160,6 +152,20 @@ exit: · 14 unmodified lines | ||
| 160 | 152 | return 0; |
| 161 | 153 | } |
| 162 | 154 | |
| 155 | +static int __init sr_dev_init(struct omap_hwmod *oh, void *user) | |
| 156 | +{ | |
| 157 | + struct omap_smartreflex_dev_attr *sr_dev_attr; | |
| 158 | + | |
| 159 | + sr_dev_attr = (struct omap_smartreflex_dev_attr *)oh->dev_attr; | |
| 160 | + if (!sr_dev_attr || !sr_dev_attr->sensor_voltdm_name) { | |
| 161 | + pr_err("%s: No voltage domain specified for %s. Cannot initialize\n", | |
| 162 | + __func__, oh->name); | |
| 163 | + return 0; | |
| 164 | + } | |
| 165 | + | |
| 166 | + return sr_init_by_name(oh->name, sr_dev_attr->sensor_voltdm_name); | |
| 167 | +} | |
| 168 | + | |
| 163 | 169 | /* |
| 164 | 170 | * API to be called from board files to enable smartreflex |
| 165 | 171 | * autocompensation at init. |
| @@ -169,7 +175,42 @@ void __init omap_enable_smartreflex_on_init(void) · 3 unmodified lines | ||
| 169 | 175 | sr_enable_on_init = true; |
| 170 | 176 | } |
| 171 | 177 | |
| 178 | +static const char * const omap4_sr_instances[] = { | |
| 179 | + "mpu", | |
| 180 | + "iva", | |
| 181 | + "core", | |
| 182 | +}; | |
| 183 | + | |
| 184 | +static const char * const dra7_sr_instances[] = { | |
| 185 | + "mpu", | |
| 186 | + "core", | |
| 187 | +}; | |
| 188 | + | |
| 172 | 189 | int __init omap_devinit_smartreflex(void) |
| 173 | 190 | { |
| 191 | + const char * const *sr_inst = NULL; | |
| 192 | + int i, nr_sr = 0; | |
| 193 | + | |
| 194 | + if (soc_is_omap44xx()) { | |
| 195 | + sr_inst = omap4_sr_instances; | |
| 196 | + nr_sr = ARRAY_SIZE(omap4_sr_instances); | |
| 197 | + | |
| 198 | + } else if (soc_is_dra7xx()) { | |
| 199 | + sr_inst = dra7_sr_instances; | |
| 200 | + nr_sr = ARRAY_SIZE(dra7_sr_instances); | |
| 201 | + } | |
| 202 | + | |
| 203 | + if (nr_sr) { | |
| 204 | + const char *name, *voltdm; | |
| 205 | + | |
| 206 | + for (i = 0; i < nr_sr; i++) { | |
| 207 | + name = kasprintf(GFP_KERNEL, "smartreflex_%s", sr_inst[i]); | |
| 208 | + voltdm = sr_inst[i]; | |
| 209 | + sr_init_by_name(name, voltdm); | |
| 210 | + } | |
| 211 | + | |
| 212 | + return 0; | |
| 213 | + } | |
| 214 | + | |
| 174 | 215 | return omap_hwmod_for_each_by_class("smartreflex", sr_dev_init, NULL); |
| 175 | 216 | } |
| @@ -502,16 +502,20 @@ static inline void mainstone_init_keypad(void) {} · 501 unmodified lines | ||
| 502 | 502 | #endif |
| 503 | 503 | |
| 504 | 504 | static int mst_pcmcia0_irqs[11] = { |
| 505 | − [0 ... 10] = -1, | |
| 505 | + [0 ... 4] = -1, | |
| 506 | 506 | [5] = MAINSTONE_S0_CD_IRQ, |
| 507 | + [6 ... 7] = -1, | |
| 507 | 508 | [8] = MAINSTONE_S0_STSCHG_IRQ, |
| 509 | + [9] = -1, | |
| 508 | 510 | [10] = MAINSTONE_S0_IRQ, |
| 509 | 511 | }; |
| 510 | 512 | |
| 511 | 513 | static int mst_pcmcia1_irqs[11] = { |
| 512 | − [0 ... 10] = -1, | |
| 514 | + [0 ... 4] = -1, | |
| 513 | 515 | [5] = MAINSTONE_S1_CD_IRQ, |
| 516 | + [6 ... 7] = -1, | |
| 514 | 517 | [8] = MAINSTONE_S1_STSCHG_IRQ, |
| 518 | + [9] = -1, | |
| 515 | 519 | [10] = MAINSTONE_S1_IRQ, |
| 516 | 520 | }; |
| 517 | 521 | |
| @@ -387,8 +387,7 @@ void __set_fixmap(enum fixed_addresses idx, phys_addr_t phys, pgprot_t prot) · 386 unmodified lines | ||
| 387 | 387 | pte_t *pte = pte_offset_fixmap(pmd_off_k(vaddr), vaddr); |
| 388 | 388 | |
| 389 | 389 | /* Make sure fixmap region does not exceed available allocation. */ |
| 390 | − BUILD_BUG_ON(FIXADDR_START + (__end_of_fixed_addresses * PAGE_SIZE) > | |
| 391 | − FIXADDR_END); | |
| 390 | + BUILD_BUG_ON(__fix_to_virt(__end_of_fixed_addresses) < FIXADDR_START); | |
| 392 | 391 | BUG_ON(idx >= __end_of_fixed_addresses); |
| 393 | 392 | |
| 394 | 393 | /* we only support device mappings until pgprot_kernel has been set */ |
| @@ -235,6 +235,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) · 234 unmodified lines | ||
| 235 | 235 | phys_addr_t mem_end; |
| 236 | 236 | phys_addr_t reg_start, reg_end; |
| 237 | 237 | unsigned int mem_max_regions; |
| 238 | + bool first = true; | |
| 238 | 239 | int num; |
| 239 | 240 | u64 i; |
| 240 | 241 | |
| @@ -263,7 +264,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) · 22 unmodified lines | ||
| 263 | 264 | #endif |
| 264 | 265 | |
| 265 | 266 | for_each_mem_range(i, ®_start, ®_end) { |
| 266 | − if (i == 0) { | |
| 267 | + if (first) { | |
| 267 | 268 | phys_addr_t phys_offset = PHYS_OFFSET; |
| 268 | 269 | |
| 269 | 270 | /* |
| @@ -275,6 +276,7 @@ void __init pmsav7_adjust_lowmem_bounds(void) · 5 unmodified lines | ||
| 275 | 276 | mem_start = reg_start; |
| 276 | 277 | mem_end = reg_end; |
| 277 | 278 | specified_mem_size = mem_end - mem_start; |
| 279 | + first = false; | |
| 278 | 280 | } else { |
| 279 | 281 | /* |
| 280 | 282 | * memblock auto merges contiguous blocks, remove |
| @@ -95,10 +95,11 @@ void __init pmsav8_adjust_lowmem_bounds(void) · 94 unmodified lines | ||
| 95 | 95 | { |
| 96 | 96 | phys_addr_t mem_end; |
| 97 | 97 | phys_addr_t reg_start, reg_end; |
| 98 | + bool first = true; | |
| 98 | 99 | u64 i; |
| 99 | 100 | |
| 100 | 101 | for_each_mem_range(i, ®_start, ®_end) { |
| 101 | − if (i == 0) { | |
| 102 | + if (first) { | |
| 102 | 103 | phys_addr_t phys_offset = PHYS_OFFSET; |
| 103 | 104 | |
| 104 | 105 | /* |
| @@ -107,6 +108,7 @@ void __init pmsav8_adjust_lowmem_bounds(void) · 2 unmodified lines | ||
| 107 | 108 | if (reg_start != phys_offset) |
| 108 | 109 | panic("First memory bank must be contiguous from PHYS_OFFSET"); |
| 109 | 110 | mem_end = reg_end; |
| 111 | + first = false; | |
| 110 | 112 | } else { |
| 111 | 113 | /* |
| 112 | 114 | * memblock auto merges contiguous blocks, remove |
| @@ -204,7 +204,7 @@ unsigned long uprobe_get_swbp_addr(struct pt_regs *regs) · 203 unmodified lines | ||
| 204 | 204 | static struct undef_hook uprobes_arm_break_hook = { |
| 205 | 205 | .instr_mask = 0x0fffffff, |
| 206 | 206 | .instr_val = (UPROBE_SWBP_ARM_INSN & 0x0fffffff), |
| 207 | − .cpsr_mask = MODE_MASK, | |
| 207 | + .cpsr_mask = (PSR_T_BIT | MODE_MASK), | |
| 208 | 208 | .cpsr_val = USR_MODE, |
| 209 | 209 | .fn = uprobe_trap_handler, |
| 210 | 210 | }; |
| @@ -212,7 +212,7 @@ static struct undef_hook uprobes_arm_break_hook = { · 1 unmodified line | ||
| 212 | 212 | static struct undef_hook uprobes_arm_ss_hook = { |
| 213 | 213 | .instr_mask = 0x0fffffff, |
| 214 | 214 | .instr_val = (UPROBE_SS_ARM_INSN & 0x0fffffff), |
| 215 | − .cpsr_mask = MODE_MASK, | |
| 215 | + .cpsr_mask = (PSR_T_BIT | MODE_MASK), | |
| 216 | 216 | .cpsr_val = USR_MODE, |
| 217 | 217 | .fn = uprobe_trap_handler, |
| 218 | 218 | }; |
| @@ -11,6 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | #include <xen/xen.h> |
| 13 | 13 | #include <xen/interface/memory.h> |
| 14 | +#include <xen/grant_table.h> | |
| 14 | 15 | #include <xen/page.h> |
| 15 | 16 | #include <xen/swiotlb-xen.h> |
| 16 | 17 | |
| @@ -109,7 +110,7 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, · 92 unmodified lines | ||
| 109 | 110 | map_ops[i].status = GNTST_general_error; |
| 110 | 111 | unmap.host_addr = map_ops[i].host_addr, |
| 111 | 112 | unmap.handle = map_ops[i].handle; |
| 112 | − map_ops[i].handle = ~0; | |
| 113 | + map_ops[i].handle = INVALID_GRANT_HANDLE; | |
| 113 | 114 | if (map_ops[i].flags & GNTMAP_device_map) |
| 114 | 115 | unmap.dev_bus_addr = map_ops[i].dev_bus_addr; |
| 115 | 116 | else |
| @@ -130,7 +131,6 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, · 14 unmodified lines | ||
| 130 | 131 | |
| 131 | 132 | return 0; |
| 132 | 133 | } |
| 133 | −EXPORT_SYMBOL_GPL(set_foreign_p2m_mapping); | |
| 134 | 134 | |
| 135 | 135 | int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops, |
| 136 | 136 | struct gnttab_unmap_grant_ref *kunmap_ops, |
| @@ -145,7 +145,6 @@ int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops, · 8 unmodified lines | ||
| 145 | 145 | |
| 146 | 146 | return 0; |
| 147 | 147 | } |
| 148 | −EXPORT_SYMBOL_GPL(clear_foreign_p2m_mapping); | |
| 149 | 148 | |
| 150 | 149 | bool __set_phys_to_machine_multi(unsigned long pfn, |
| 151 | 150 | unsigned long mfn, unsigned long nr_pages) |
| @@ -810,6 +810,16 @@ config QCOM_FALKOR_ERRATUM_E1041 · 809 unmodified lines | ||
| 810 | 810 | |
| 811 | 811 | If unsure, say Y. |
| 812 | 812 | |
| 813 | +config NVIDIA_CARMEL_CNP_ERRATUM | |
| 814 | + bool "NVIDIA Carmel CNP: CNP on Carmel semantically different than ARM cores" | |
| 815 | + default y | |
| 816 | + help | |
| 817 | + If CNP is enabled on Carmel cores, non-sharable TLBIs on a core will not | |
| 818 | + invalidate shared TLB entries installed by a different core, as it would | |
| 819 | + on standard ARM cores. | |
| 820 | + | |
| 821 | + If unsure, say Y. | |
| 822 | + | |
| 813 | 823 | config SOCIONEXT_SYNQUACER_PREITS |
| 814 | 824 | bool "Socionext Synquacer: Workaround for GICv3 pre-ITS" |
| 815 | 825 | default y |
| @@ -1055,8 +1065,6 @@ config HW_PERF_EVENTS · 239 unmodified lines | ||
| 1055 | 1065 | config SYS_SUPPORTS_HUGETLBFS |
| 1056 | 1066 | def_bool y |
| 1057 | 1067 | |
| 1058 | −config ARCH_WANT_HUGE_PMD_SHARE | |
| 1059 | − | |
| 1060 | 1068 | config ARCH_HAS_CACHE_LINE_SIZE |
| 1061 | 1069 | def_bool y |
| 1062 | 1070 | |
| @@ -1157,8 +1165,8 @@ config XEN · 94 unmodified lines | ||
| 1157 | 1165 | |
| 1158 | 1166 | config FORCE_MAX_ZONEORDER |
| 1159 | 1167 | int |
| 1160 | − default "14" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE) | |
| 1161 | − default "12" if (ARM64_16K_PAGES && TRANSPARENT_HUGEPAGE) | |
| 1168 | + default "14" if ARM64_64K_PAGES | |
| 1169 | + default "12" if ARM64_16K_PAGES | |
| 1162 | 1170 | default "11" |
| 1163 | 1171 | help |
| 1164 | 1172 | The kernel memory allocator divides physically contiguous memory |
| @@ -1398,10 +1406,13 @@ config ARM64_PAN · 233 unmodified lines | ||
| 1398 | 1406 | config AS_HAS_LDAPR |
| 1399 | 1407 | def_bool $(as-instr,.arch_extension rcpc) |
| 1400 | 1408 | |
| 1409 | +config AS_HAS_LSE_ATOMICS | |
| 1410 | + def_bool $(as-instr,.arch_extension lse) | |
| 1411 | + | |
| 1401 | 1412 | config ARM64_LSE_ATOMICS |
| 1402 | 1413 | bool |
| 1403 | 1414 | default ARM64_USE_LSE_ATOMICS |
| 1404 | − depends on $(as-instr,.arch_extension lse) | |
| 1415 | + depends on AS_HAS_LSE_ATOMICS | |
| 1405 | 1416 | |
| 1406 | 1417 | config ARM64_USE_LSE_ATOMICS |
| 1407 | 1418 | bool "Atomic instructions" |
| @@ -1658,6 +1669,7 @@ config ARM64_MTE · 250 unmodified lines | ||
| 1658 | 1669 | default y |
| 1659 | 1670 | depends on ARM64_AS_HAS_MTE && ARM64_TAGGED_ADDR_ABI |
| 1660 | 1671 | depends on AS_HAS_ARMV8_5 |
| 1672 | + depends on AS_HAS_LSE_ATOMICS | |
| 1661 | 1673 | # Required for tag checking in the uaccess routines |
| 1662 | 1674 | depends on ARM64_PAN |
| 1663 | 1675 | select ARCH_USES_HIGH_VMA_FLAGS |
| @@ -1855,12 +1867,6 @@ config CMDLINE_FROM_BOOTLOADER · 191 unmodified lines | ||
| 1855 | 1867 | the boot loader doesn't provide any, the default kernel command |
| 1856 | 1868 | string provided in CMDLINE will be used. |
| 1857 | 1869 | |
| 1858 | −config CMDLINE_EXTEND | |
| 1859 | − bool "Extend bootloader kernel arguments" | |
| 1860 | − help | |
| 1861 | − The command-line arguments provided by the boot loader will be | |
| 1862 | − appended to the default kernel command string. | |
| 1863 | − | |
| 1864 | 1870 | config CMDLINE_FORCE |
| 1865 | 1871 | bool "Always use the default kernel command string" |
| 1866 | 1872 | help |
| @@ -19,3 +19,7 @@ · 18 unmodified lines | ||
| 19 | 19 | }; |
| 20 | 20 | }; |
| 21 | 21 | }; |
| 22 | + | |
| 23 | +&mmc0 { | |
| 24 | + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 push-push switch */ | |
| 25 | +}; | |
| @@ -34,7 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | vmmc-supply = <®_dcdc1>; |
| 35 | 35 | disable-wp; |
| 36 | 36 | bus-width = <4>; |
| 37 | − cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ | |
| 37 | + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 push-pull switch */ | |
| 38 | 38 | status = "okay"; |
| 39 | 39 | }; |
| 40 | 40 | |
| @@ -289,10 +289,6 @@ · 288 unmodified lines | ||
| 289 | 289 | vcc-pm-supply = <®_aldo1>; |
| 290 | 290 | }; |
| 291 | 291 | |
| 292 | −&rtc { | |
| 293 | − clocks = <&ext_osc32k>; | |
| 294 | −}; | |
| 295 | − | |
| 296 | 292 | &spdif { |
| 297 | 293 | status = "okay"; |
| 298 | 294 | }; |
| @@ -995,9 +995,9 @@ · 994 unmodified lines | ||
| 995 | 995 | compatible = "allwinner,sun8i-a23-rsb"; |
| 996 | 996 | reg = <0x07083000 0x400>; |
| 997 | 997 | interrupts = <GIC_SPI 108 IRQ_TYPE_LEVEL_HIGH>; |
| 998 | − clocks = <&r_ccu 13>; | |
| 998 | + clocks = <&r_ccu CLK_R_APB2_RSB>; | |
| 999 | 999 | clock-frequency = <3000000>; |
| 1000 | − resets = <&r_ccu 7>; | |
| 1000 | + resets = <&r_ccu RST_R_APB2_RSB>; | |
| 1001 | 1001 | pinctrl-names = "default"; |
| 1002 | 1002 | pinctrl-0 = <&r_rsb_pins>; |
| 1003 | 1003 | status = "disabled"; |
| @@ -198,6 +198,7 @@ · 197 unmodified lines | ||
| 198 | 198 | ranges = <0x0 0x00 0x1700000 0x100000>; |
| 199 | 199 | reg = <0x00 0x1700000 0x0 0x100000>; |
| 200 | 200 | interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>; |
| 201 | + dma-coherent; | |
| 201 | 202 | |
| 202 | 203 | sec_jr0: jr@10000 { |
| 203 | 204 | compatible = "fsl,sec-v5.4-job-ring", |
| @@ -348,6 +348,7 @@ · 347 unmodified lines | ||
| 348 | 348 | ranges = <0x0 0x00 0x1700000 0x100000>; |
| 349 | 349 | reg = <0x00 0x1700000 0x0 0x100000>; |
| 350 | 350 | interrupts = <0 75 0x4>; |
| 351 | + dma-coherent; | |
| 351 | 352 | |
| 352 | 353 | sec_jr0: jr@10000 { |
| 353 | 354 | compatible = "fsl,sec-v5.4-job-ring", |
| @@ -354,6 +354,7 @@ · 353 unmodified lines | ||
| 354 | 354 | ranges = <0x0 0x00 0x1700000 0x100000>; |
| 355 | 355 | reg = <0x00 0x1700000 0x0 0x100000>; |
| 356 | 356 | interrupts = <GIC_SPI 75 IRQ_TYPE_LEVEL_HIGH>; |
| 357 | + dma-coherent; | |
| 357 | 358 | |
| 358 | 359 | sec_jr0: jr@10000 { |
| 359 | 360 | compatible = "fsl,sec-v5.4-job-ring", |
| @@ -124,7 +124,7 @@ · 123 unmodified lines | ||
| 124 | 124 | #define MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD 0x0A4 0x30C 0x000 0x0 0x0 |
| 125 | 125 | #define MX8MM_IOMUXC_SD1_CMD_GPIO2_IO1 0x0A4 0x30C 0x000 0x5 0x0 |
| 126 | 126 | #define MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0 0x0A8 0x310 0x000 0x0 0x0 |
| 127 | −#define MX8MM_IOMUXC_SD1_DATA0_GPIO2_IO2 0x0A8 0x31 0x000 0x5 0x0 | |
| 127 | +#define MX8MM_IOMUXC_SD1_DATA0_GPIO2_IO2 0x0A8 0x310 0x000 0x5 0x0 | |
| 128 | 128 | #define MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1 0x0AC 0x314 0x000 0x0 0x0 |
| 129 | 129 | #define MX8MM_IOMUXC_SD1_DATA1_GPIO2_IO3 0x0AC 0x314 0x000 0x5 0x0 |
| 130 | 130 | #define MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2 0x0B0 0x318 0x000 0x0 0x0 |
| @@ -35,7 +35,7 @@ · 34 unmodified lines | ||
| 35 | 35 | |
| 36 | 36 | &i2c2 { |
| 37 | 37 | clock-frequency = <400000>; |
| 38 | − pinctrl-names = "default"; | |
| 38 | + pinctrl-names = "default", "gpio"; | |
| 39 | 39 | pinctrl-0 = <&pinctrl_i2c2>; |
| 40 | 40 | pinctrl-1 = <&pinctrl_i2c2_gpio>; |
| 41 | 41 | sda-gpios = <&gpio5 17 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| @@ -67,7 +67,7 @@ · 66 unmodified lines | ||
| 67 | 67 | |
| 68 | 68 | &i2c1 { |
| 69 | 69 | clock-frequency = <400000>; |
| 70 | − pinctrl-names = "default"; | |
| 70 | + pinctrl-names = "default", "gpio"; | |
| 71 | 71 | pinctrl-0 = <&pinctrl_i2c1>; |
| 72 | 72 | pinctrl-1 = <&pinctrl_i2c1_gpio>; |
| 73 | 73 | sda-gpios = <&gpio5 15 (GPIO_ACTIVE_HIGH | GPIO_OPEN_DRAIN)>; |
| @@ -130,7 +130,7 @@ · 129 unmodified lines | ||
| 130 | 130 | #define MX8MQ_IOMUXC_SD1_CMD_USDHC1_CMD 0x0A4 0x30C 0x000 0x0 0x0 |
| 131 | 131 | #define MX8MQ_IOMUXC_SD1_CMD_GPIO2_IO1 0x0A4 0x30C 0x000 0x5 0x0 |
| 132 | 132 | #define MX8MQ_IOMUXC_SD1_DATA0_USDHC1_DATA0 0x0A8 0x310 0x000 0x0 0x0 |
| 133 | −#define MX8MQ_IOMUXC_SD1_DATA0_GPIO2_IO2 0x0A8 0x31 0x000 0x5 0x0 | |
| 133 | +#define MX8MQ_IOMUXC_SD1_DATA0_GPIO2_IO2 0x0A8 0x310 0x000 0x5 0x0 | |
| 134 | 134 | #define MX8MQ_IOMUXC_SD1_DATA1_USDHC1_DATA1 0x0AC 0x314 0x000 0x0 0x0 |
| 135 | 135 | #define MX8MQ_IOMUXC_SD1_DATA1_GPIO2_IO3 0x0AC 0x314 0x000 0x5 0x0 |
| 136 | 136 | #define MX8MQ_IOMUXC_SD1_DATA2_USDHC1_DATA2 0x0B0 0x318 0x000 0x0 0x0 |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: (GPL-2.0+ OR MIT) |
| 2 | 2 | /* |
| 3 | 3 | * Device Tree file for CZ.NIC Turris Mox Board |
| 4 | − * 2019 by Marek Behun <marek.behun@nic.cz> | |
| 4 | + * 2019 by Marek Behún <kabel@kernel.org> | |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | 7 | /dts-v1/; |
| @@ -310,9 +310,11 @@ · 309 unmodified lines | ||
| 310 | 310 | }; |
| 311 | 311 | |
| 312 | 312 | CP11X_LABEL(sata0): sata@540000 { |
| 313 | − compatible = "marvell,armada-8k-ahci"; | |
| 313 | + compatible = "marvell,armada-8k-ahci", | |
| 314 | + "generic-ahci"; | |
| 314 | 315 | reg = <0x540000 0x30000>; |
| 315 | 316 | dma-coherent; |
| 317 | + interrupts = <107 IRQ_TYPE_LEVEL_HIGH>; | |
| 316 | 318 | clocks = <&CP11X_LABEL(clk) 1 15>, |
| 317 | 319 | <&CP11X_LABEL(clk) 1 16>; |
| 318 | 320 | #address-cells = <1>; |
| @@ -320,12 +322,10 @@ · 1 unmodified line | ||
| 320 | 322 | status = "disabled"; |
| 321 | 323 | |
| 322 | 324 | sata-port@0 { |
| 323 | − interrupts = <109 IRQ_TYPE_LEVEL_HIGH>; | |
| 324 | 325 | reg = <0>; |
| 325 | 326 | }; |
| 326 | 327 | |
| 327 | 328 | sata-port@1 { |
| 328 | − interrupts = <107 IRQ_TYPE_LEVEL_HIGH>; | |
| 329 | 329 | reg = <1>; |
| 330 | 330 | }; |
| 331 | 331 | }; |
| @@ -97,9 +97,9 @@ · 96 unmodified lines | ||
| 97 | 97 | .popsection |
| 98 | 98 | .subsection 1 |
| 99 | 99 | 663: \insn2 |
| 100 | −664: .previous | |
| 101 | − .org . - (664b-663b) + (662b-661b) | |
| 100 | +664: .org . - (664b-663b) + (662b-661b) | |
| 102 | 101 | .org . - (662b-661b) + (664b-663b) |
| 102 | + .previous | |
| 103 | 103 | .endif |
| 104 | 104 | .endm |
| 105 | 105 | |
| @@ -169,11 +169,11 @@ · 63 unmodified lines | ||
| 169 | 169 | */ |
| 170 | 170 | .macro alternative_endif |
| 171 | 171 | 664: |
| 172 | + .org . - (664b-663b) + (662b-661b) | |
| 173 | + .org . - (662b-661b) + (664b-663b) | |
| 172 | 174 | .if .Lasm_alt_mode==0 |
| 173 | 175 | .previous |
| 174 | 176 | .endif |
| 175 | − .org . - (664b-663b) + (662b-661b) | |
| 176 | − .org . - (662b-661b) + (664b-663b) | |
| 177 | 177 | .endm |
| 178 | 178 | |
| 179 | 179 | /* |
| @@ -37,7 +37,7 @@ static inline __sum16 ip_fast_csum(const void *iph, unsigned int ihl) · 36 unmodified lines | ||
| 37 | 37 | } while (--n > 0); |
| 38 | 38 | |
| 39 | 39 | sum += ((sum >> 32) | (sum << 32)); |
| 40 | − return csum_fold((__force u32)(sum >> 32)); | |
| 40 | + return csum_fold((__force __wsum)(sum >> 32)); | |
| 41 | 41 | } |
| 42 | 42 | #define ip_fast_csum ip_fast_csum |
| 43 | 43 | |
| @@ -66,7 +66,8 @@ · 65 unmodified lines | ||
| 66 | 66 | #define ARM64_WORKAROUND_1508412 58 |
| 67 | 67 | #define ARM64_HAS_LDAPR 59 |
| 68 | 68 | #define ARM64_KVM_PROTECTED_MODE 60 |
| 69 | +#define ARM64_WORKAROUND_NVIDIA_CARMEL_CNP 61 | |
| 69 | 70 | |
| 70 | −#define ARM64_NCAPS 61 | |
| 71 | +#define ARM64_NCAPS 62 | |
| 71 | 72 | |
| 72 | 73 | #endif /* __ASM_CPUCAPS_H */ |
| @@ -278,6 +278,7 @@ · 277 unmodified lines | ||
| 278 | 278 | #define CPTR_EL2_DEFAULT CPTR_EL2_RES1 |
| 279 | 279 | |
| 280 | 280 | /* Hyp Debug Configuration Register bits */ |
| 281 | +#define MDCR_EL2_TTRF (1 << 19) | |
| 281 | 282 | #define MDCR_EL2_TPMS (1 << 14) |
| 282 | 283 | #define MDCR_EL2_E2PB_MASK (UL(0x3)) |
| 283 | 284 | #define MDCR_EL2_E2PB_SHIFT (UL(12)) |
| @@ -47,10 +47,10 @@ · 46 unmodified lines | ||
| 47 | 47 | #define __KVM_HOST_SMCCC_FUNC___kvm_flush_vm_context 2 |
| 48 | 48 | #define __KVM_HOST_SMCCC_FUNC___kvm_tlb_flush_vmid_ipa 3 |
| 49 | 49 | #define __KVM_HOST_SMCCC_FUNC___kvm_tlb_flush_vmid 4 |
| 50 | −#define __KVM_HOST_SMCCC_FUNC___kvm_tlb_flush_local_vmid 5 | |
| 50 | +#define __KVM_HOST_SMCCC_FUNC___kvm_flush_cpu_context 5 | |
| 51 | 51 | #define __KVM_HOST_SMCCC_FUNC___kvm_timer_set_cntvoff 6 |
| 52 | 52 | #define __KVM_HOST_SMCCC_FUNC___kvm_enable_ssbs 7 |
| 53 | −#define __KVM_HOST_SMCCC_FUNC___vgic_v3_get_ich_vtr_el2 8 | |
| 53 | +#define __KVM_HOST_SMCCC_FUNC___vgic_v3_get_gic_config 8 | |
| 54 | 54 | #define __KVM_HOST_SMCCC_FUNC___vgic_v3_read_vmcr 9 |
| 55 | 55 | #define __KVM_HOST_SMCCC_FUNC___vgic_v3_write_vmcr 10 |
| 56 | 56 | #define __KVM_HOST_SMCCC_FUNC___vgic_v3_init_lrs 11 |
| @@ -183,16 +183,16 @@ DECLARE_KVM_HYP_SYM(__bp_harden_hyp_vecs); · 126 unmodified lines | ||
| 183 | 183 | #define __bp_harden_hyp_vecs CHOOSE_HYP_SYM(__bp_harden_hyp_vecs) |
| 184 | 184 | |
| 185 | 185 | extern void __kvm_flush_vm_context(void); |
| 186 | +extern void __kvm_flush_cpu_context(struct kvm_s2_mmu *mmu); | |
| 186 | 187 | extern void __kvm_tlb_flush_vmid_ipa(struct kvm_s2_mmu *mmu, phys_addr_t ipa, |
| 187 | 188 | int level); |
| 188 | 189 | extern void __kvm_tlb_flush_vmid(struct kvm_s2_mmu *mmu); |
| 189 | −extern void __kvm_tlb_flush_local_vmid(struct kvm_s2_mmu *mmu); | |
| 190 | 190 | |
| 191 | 191 | extern void __kvm_timer_set_cntvoff(u64 cntvoff); |
| 192 | 192 | |
| 193 | 193 | extern int __kvm_vcpu_run(struct kvm_vcpu *vcpu); |
| 194 | 194 | |
| 195 | −extern u64 __vgic_v3_get_ich_vtr_el2(void); | |
| 195 | +extern u64 __vgic_v3_get_gic_config(void); | |
| 196 | 196 | extern u64 __vgic_v3_read_vmcr(void); |
| 197 | 197 | extern void __vgic_v3_write_vmcr(u32 vmcr); |
| 198 | 198 | extern void __vgic_v3_init_lrs(void); |
| @@ -83,6 +83,11 @@ void sysreg_restore_guest_state_vhe(struct kvm_cpu_context *ctxt); · 82 unmodified lines | ||
| 83 | 83 | void __debug_switch_to_guest(struct kvm_vcpu *vcpu); |
| 84 | 84 | void __debug_switch_to_host(struct kvm_vcpu *vcpu); |
| 85 | 85 | |
| 86 | +#ifdef __KVM_NVHE_HYPERVISOR__ | |
| 87 | +void __debug_save_host_buffers_nvhe(struct kvm_vcpu *vcpu); | |
| 88 | +void __debug_restore_host_buffers_nvhe(struct kvm_vcpu *vcpu); | |
| 89 | +#endif | |
| 90 | + | |
| 86 | 91 | void __fpsimd_save_state(struct user_fpsimd_state *fp_regs); |
| 87 | 92 | void __fpsimd_restore_state(struct user_fpsimd_state *fp_regs); |
| 88 | 93 | |
| @@ -97,7 +102,8 @@ bool kvm_host_psci_handler(struct kvm_cpu_context *host_ctxt); · 8 unmodified lines | ||
| 97 | 102 | |
| 98 | 103 | void __noreturn hyp_panic(void); |
| 99 | 104 | #ifdef __KVM_NVHE_HYPERVISOR__ |
| 100 | −void __noreturn __hyp_do_panic(bool restore_host, u64 spsr, u64 elr, u64 par); | |
| 105 | +void __noreturn __hyp_do_panic(struct kvm_cpu_context *host_ctxt, u64 spsr, | |
| 106 | + u64 elr, u64 par); | |
| 101 | 107 | #endif |
| 102 | 108 | |
| 103 | 109 | #endif /* __ARM64_KVM_HYP_H__ */ |
| @@ -328,6 +328,11 @@ static inline void *phys_to_virt(phys_addr_t x) · 327 unmodified lines | ||
| 328 | 328 | #define ARCH_PFN_OFFSET ((unsigned long)PHYS_PFN_OFFSET) |
| 329 | 329 | |
| 330 | 330 | #if !defined(CONFIG_SPARSEMEM_VMEMMAP) || defined(CONFIG_DEBUG_VIRTUAL) |
| 331 | +#define page_to_virt(x) ({ \ | |
| 332 | + __typeof__(x) __page = x; \ | |
| 333 | + void *__addr = __va(page_to_phys(__page)); \ | |
| 334 | + (void *)__tag_set((const void *)__addr, page_kasan_tag(__page));\ | |
| 335 | +}) | |
| 331 | 336 | #define virt_to_page(x) pfn_to_page(virt_to_pfn(x)) |
| 332 | 337 | #else |
| 333 | 338 | #define page_to_virt(x) ({ \ |
| @@ -63,23 +63,6 @@ static inline void cpu_switch_mm(pgd_t *pgd, struct mm_struct *mm) · 62 unmodified lines | ||
| 63 | 63 | extern u64 idmap_t0sz; |
| 64 | 64 | extern u64 idmap_ptrs_per_pgd; |
| 65 | 65 | |
| 66 | −static inline bool __cpu_uses_extended_idmap(void) | |
| 67 | −{ | |
| 68 | − if (IS_ENABLED(CONFIG_ARM64_VA_BITS_52)) | |
| 69 | − return false; | |
| 70 | − | |
| 71 | − return unlikely(idmap_t0sz != TCR_T0SZ(VA_BITS)); | |
| 72 | −} | |
| 73 | − | |
| 74 | −/* | |
| 75 | − * True if the extended ID map requires an extra level of translation table | |
| 76 | − * to be configured. | |
| 77 | − */ | |
| 78 | −static inline bool __cpu_uses_extended_idmap_level(void) | |
| 79 | −{ | |
| 80 | − return ARM64_HW_PGTABLE_LEVELS(64 - idmap_t0sz) > CONFIG_PGTABLE_LEVELS; | |
| 81 | −} | |
| 82 | − | |
| 83 | 66 | /* |
| 84 | 67 | * Ensure TCR.T0SZ is set to the provided value. |
| 85 | 68 | */ |
| @@ -66,7 +66,6 @@ extern bool arm64_use_ng_mappings; · 65 unmodified lines | ||
| 66 | 66 | #define _PAGE_DEFAULT (_PROT_DEFAULT | PTE_ATTRINDX(MT_NORMAL)) |
| 67 | 67 | |
| 68 | 68 | #define PAGE_KERNEL __pgprot(PROT_NORMAL) |
| 69 | −#define PAGE_KERNEL_TAGGED __pgprot(PROT_NORMAL_TAGGED) | |
| 70 | 69 | #define PAGE_KERNEL_RO __pgprot((PROT_NORMAL & ~PTE_WRITE) | PTE_RDONLY) |
| 71 | 70 | #define PAGE_KERNEL_ROX __pgprot((PROT_NORMAL & ~(PTE_WRITE | PTE_PXN)) | PTE_RDONLY) |
| 72 | 71 | #define PAGE_KERNEL_EXEC __pgprot(PROT_NORMAL & ~PTE_PXN) |
| @@ -486,6 +486,9 @@ static inline pmd_t pmd_mkdevmap(pmd_t pmd) · 485 unmodified lines | ||
| 486 | 486 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_NC) | PTE_PXN | PTE_UXN) |
| 487 | 487 | #define pgprot_device(prot) \ |
| 488 | 488 | __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_DEVICE_nGnRE) | PTE_PXN | PTE_UXN) |
| 489 | +#define pgprot_tagged(prot) \ | |
| 490 | + __pgprot_modify(prot, PTE_ATTRINDX_MASK, PTE_ATTRINDX(MT_NORMAL_TAGGED)) | |
| 491 | +#define pgprot_mhp pgprot_tagged | |
| 489 | 492 | /* |
| 490 | 493 | * DMA allocations for non-coherent devices use what the Arm architecture calls |
| 491 | 494 | * "Normal non-cacheable" memory, which permits speculation, unaligned accesses |
| @@ -251,6 +251,8 @@ unsigned long get_wchan(struct task_struct *p); · 250 unmodified lines | ||
| 251 | 251 | extern struct task_struct *cpu_switch_to(struct task_struct *prev, |
| 252 | 252 | struct task_struct *next); |
| 253 | 253 | |
| 254 | +asmlinkage void arm64_preempt_schedule_irq(void); | |
| 255 | + | |
| 254 | 256 | #define task_pt_regs(p) \ |
| 255 | 257 | ((struct pt_regs *)(THREAD_SIZE + task_stack_page(p)) - 1) |
| 256 | 258 | |
| @@ -796,6 +796,11 @@ · 795 unmodified lines | ||
| 796 | 796 | #define ID_AA64MMFR0_PARANGE_48 0x5 |
| 797 | 797 | #define ID_AA64MMFR0_PARANGE_52 0x6 |
| 798 | 798 | |
| 799 | +#define ID_AA64MMFR0_TGRAN_2_SUPPORTED_DEFAULT 0x0 | |
| 800 | +#define ID_AA64MMFR0_TGRAN_2_SUPPORTED_NONE 0x1 | |
| 801 | +#define ID_AA64MMFR0_TGRAN_2_SUPPORTED_MIN 0x2 | |
| 802 | +#define ID_AA64MMFR0_TGRAN_2_SUPPORTED_MAX 0x7 | |
| 803 | + | |
| 799 | 804 | #ifdef CONFIG_ARM64_PA_BITS_52 |
| 800 | 805 | #define ID_AA64MMFR0_PARANGE_MAX ID_AA64MMFR0_PARANGE_52 |
| 801 | 806 | #else |
| @@ -961,14 +966,17 @@ · 159 unmodified lines | ||
| 961 | 966 | #define ID_PFR1_PROGMOD_SHIFT 0 |
| 962 | 967 | |
| 963 | 968 | #if defined(CONFIG_ARM64_4K_PAGES) |
| 964 | −#define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN4_SHIFT | |
| 965 | −#define ID_AA64MMFR0_TGRAN_SUPPORTED ID_AA64MMFR0_TGRAN4_SUPPORTED | |
| 969 | +#define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN4_SHIFT | |
| 970 | +#define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN4_SUPPORTED | |
| 971 | +#define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX 0x7 | |
| 966 | 972 | #elif defined(CONFIG_ARM64_16K_PAGES) |
| 967 | −#define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN16_SHIFT | |
| 968 | −#define ID_AA64MMFR0_TGRAN_SUPPORTED ID_AA64MMFR0_TGRAN16_SUPPORTED | |
| 973 | +#define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN16_SHIFT | |
| 974 | +#define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN16_SUPPORTED | |
| 975 | +#define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX 0xF | |
| 969 | 976 | #elif defined(CONFIG_ARM64_64K_PAGES) |
| 970 | −#define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN64_SHIFT | |
| 971 | −#define ID_AA64MMFR0_TGRAN_SUPPORTED ID_AA64MMFR0_TGRAN64_SUPPORTED | |
| 977 | +#define ID_AA64MMFR0_TGRAN_SHIFT ID_AA64MMFR0_TGRAN64_SHIFT | |
| 978 | +#define ID_AA64MMFR0_TGRAN_SUPPORTED_MIN ID_AA64MMFR0_TGRAN64_SUPPORTED | |
| 979 | +#define ID_AA64MMFR0_TGRAN_SUPPORTED_MAX 0x7 | |
| 972 | 980 | #endif |
| 973 | 981 | |
| 974 | 982 | #define MVFR2_FPMISC_SHIFT 4 |
| @@ -55,6 +55,8 @@ void arch_setup_new_exec(void); · 54 unmodified lines | ||
| 55 | 55 | #define arch_setup_new_exec arch_setup_new_exec |
| 56 | 56 | |
| 57 | 57 | void arch_release_task_struct(struct task_struct *tsk); |
| 58 | +int arch_dup_task_struct(struct task_struct *dst, | |
| 59 | + struct task_struct *src); | |
| 58 | 60 | |
| 59 | 61 | #endif |
| 60 | 62 | |
| @@ -53,7 +53,7 @@ static inline unsigned long find_zero(unsigned long mask) · 52 unmodified lines | ||
| 53 | 53 | */ |
| 54 | 54 | static inline unsigned long load_unaligned_zeropad(const void *addr) |
| 55 | 55 | { |
| 56 | − unsigned long ret, offset; | |
| 56 | + unsigned long ret, tmp; | |
| 57 | 57 | |
| 58 | 58 | /* Load word from unaligned pointer addr */ |
| 59 | 59 | asm( |
| @@ -61,9 +61,9 @@ static inline unsigned long load_unaligned_zeropad(const void *addr) · 1 unmodified line | ||
| 61 | 61 | "2:\n" |
| 62 | 62 | " .pushsection .fixup,\"ax\"\n" |
| 63 | 63 | " .align 2\n" |
| 64 | − "3: and %1, %2, #0x7\n" | |
| 65 | − " bic %2, %2, #0x7\n" | |
| 66 | − " ldr %0, [%2]\n" | |
| 64 | + "3: bic %1, %2, #0x7\n" | |
| 65 | + " ldr %0, [%1]\n" | |
| 66 | + " and %1, %2, #0x7\n" | |
| 67 | 67 | " lsl %1, %1, #0x3\n" |
| 68 | 68 | #ifndef __AARCH64EB__ |
| 69 | 69 | " lsr %0, %0, %1\n" |
| @@ -73,7 +73,7 @@ static inline unsigned long load_unaligned_zeropad(const void *addr) · 3 unmodified lines | ||
| 73 | 73 | " b 2b\n" |
| 74 | 74 | " .popsection\n" |
| 75 | 75 | _ASM_EXTABLE(1b, 3b) |
| 76 | − : "=&r" (ret), "=&r" (offset) | |
| 76 | + : "=&r" (ret), "=&r" (tmp) | |
| 77 | 77 | : "r" (addr), "Q" (*(unsigned long *)addr)); |
| 78 | 78 | |
| 79 | 79 | return ret; |
| @@ -525,6 +525,14 @@ const struct arm64_cpu_capabilities arm64_errata[] = { · 524 unmodified lines | ||
| 525 | 525 | 0, 0, |
| 526 | 526 | 1, 0), |
| 527 | 527 | }, |
| 528 | +#endif | |
| 529 | +#ifdef CONFIG_NVIDIA_CARMEL_CNP_ERRATUM | |
| 530 | + { | |
| 531 | + /* NVIDIA Carmel */ | |
| 532 | + .desc = "NVIDIA Carmel CNP erratum", | |
| 533 | + .capability = ARM64_WORKAROUND_NVIDIA_CARMEL_CNP, | |
| 534 | + ERRATA_MIDR_ALL_VERSIONS(MIDR_NVIDIA_CARMEL), | |
| 535 | + }, | |
| 528 | 536 | #endif |
| 529 | 537 | { |
| 530 | 538 | } |
| @@ -383,7 +383,6 @@ static const struct arm64_ftr_bits ftr_id_aa64dfr0[] = { · 382 unmodified lines | ||
| 383 | 383 | * of support. |
| 384 | 384 | */ |
| 385 | 385 | S_ARM64_FTR_BITS(FTR_HIDDEN, FTR_NONSTRICT, FTR_EXACT, ID_AA64DFR0_PMUVER_SHIFT, 4, 0), |
| 386 | − ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, ID_AA64DFR0_TRACEVER_SHIFT, 4, 0), | |
| 387 | 386 | ARM64_FTR_BITS(FTR_HIDDEN, FTR_STRICT, FTR_EXACT, ID_AA64DFR0_DEBUGVER_SHIFT, 4, 0x6), |
| 388 | 387 | ARM64_FTR_END, |
| 389 | 388 | }; |
| @@ -1321,7 +1320,10 @@ has_useable_cnp(const struct arm64_cpu_capabilities *entry, int scope) · 931 unmodified lines | ||
| 1321 | 1320 | * may share TLB entries with a CPU stuck in the crashed |
| 1322 | 1321 | * kernel. |
| 1323 | 1322 | */ |
| 1324 | − if (is_kdump_kernel()) | |
| 1323 | + if (is_kdump_kernel()) | |
| 1324 | + return false; | |
| 1325 | + | |
| 1326 | + if (cpus_have_const_cap(ARM64_WORKAROUND_NVIDIA_CARMEL_CNP)) | |
| 1325 | 1327 | return false; |
| 1326 | 1328 | |
| 1327 | 1329 | return has_cpuid_feature(entry, scope); |
| @@ -353,7 +353,7 @@ static void __cpuinfo_store_cpu(struct cpuinfo_arm64 *info) · 352 unmodified lines | ||
| 353 | 353 | * with the CLIDR_EL1 fields to avoid triggering false warnings |
| 354 | 354 | * when there is a mismatch across the CPUs. Keep track of the |
| 355 | 355 | * effective value of the CTR_EL0 in our internal records for |
| 356 | − * acurate sanity check and feature enablement. | |
| 356 | + * accurate sanity check and feature enablement. | |
| 357 | 357 | */ |
| 358 | 358 | info->reg_ctr = read_cpuid_effective_cachetype(); |
| 359 | 359 | info->reg_dczid = read_cpuid(DCZID_EL0); |
| @@ -64,5 +64,7 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, · 63 unmodified lines | ||
| 64 | 64 | ssize_t elfcorehdr_read(char *buf, size_t count, u64 *ppos) |
| 65 | 65 | { |
| 66 | 66 | memcpy(buf, phys_to_virt((phys_addr_t)*ppos), count); |
| 67 | + *ppos += count; | |
| 68 | + | |
| 67 | 69 | return count; |
| 68 | 70 | } |
| @@ -148,16 +148,18 @@ alternative_cb_end · 147 unmodified lines | ||
| 148 | 148 | .endm |
| 149 | 149 | |
| 150 | 150 | /* Check for MTE asynchronous tag check faults */ |
| 151 | − .macro check_mte_async_tcf, flgs, tmp | |
| 151 | + .macro check_mte_async_tcf, tmp, ti_flags | |
| 152 | 152 | #ifdef CONFIG_ARM64_MTE |
| 153 | + .arch_extension lse | |
| 153 | 154 | alternative_if_not ARM64_MTE |
| 154 | 155 | b 1f |
| 155 | 156 | alternative_else_nop_endif |
| 156 | 157 | mrs_s \tmp, SYS_TFSRE0_EL1 |
| 157 | 158 | tbz \tmp, #SYS_TFSR_EL1_TF0_SHIFT, 1f |
| 158 | 159 | /* Asynchronous TCF occurred for TTBR0 access, set the TI flag */ |
| 159 | − orr \flgs, \flgs, #_TIF_MTE_ASYNC_FAULT | |
| 160 | − str \flgs, [tsk, #TSK_TI_FLAGS] | |
| 160 | + mov \tmp, #_TIF_MTE_ASYNC_FAULT | |
| 161 | + add \ti_flags, tsk, #TSK_TI_FLAGS | |
| 162 | + stset \tmp, [\ti_flags] | |
| 161 | 163 | msr_s SYS_TFSRE0_EL1, xzr |
| 162 | 164 | 1: |
| 163 | 165 | #endif |
| @@ -244,7 +246,7 @@ alternative_else_nop_endif · 80 unmodified lines | ||
| 244 | 246 | disable_step_tsk x19, x20 |
| 245 | 247 | |
| 246 | 248 | /* Check for asynchronous tag check faults in user space */ |
| 247 | − check_mte_async_tcf x19, x22 | |
| 249 | + check_mte_async_tcf x22, x23 | |
| 248 | 250 | apply_ssbd 1, x22, x23 |
| 249 | 251 | |
| 250 | 252 | ptrauth_keys_install_kernel tsk, x20, x22, x23 |
| @@ -319,7 +319,7 @@ SYM_FUNC_START_LOCAL(__create_page_tables) · 318 unmodified lines | ||
| 319 | 319 | */ |
| 320 | 320 | adrp x5, __idmap_text_end |
| 321 | 321 | clz x5, x5 |
| 322 | − cmp x5, TCR_T0SZ(VA_BITS) // default T0SZ small enough? | |
| 322 | + cmp x5, TCR_T0SZ(VA_BITS_MIN) // default T0SZ small enough? | |
| 323 | 323 | b.ge 1f // .. then skip VA range extension |
| 324 | 324 | |
| 325 | 325 | adr_l x6, idmap_t0sz |
| @@ -655,8 +655,10 @@ SYM_FUNC_END(__secondary_too_slow) · 329 unmodified lines | ||
| 655 | 655 | SYM_FUNC_START(__enable_mmu) |
| 656 | 656 | mrs x2, ID_AA64MMFR0_EL1 |
| 657 | 657 | ubfx x2, x2, #ID_AA64MMFR0_TGRAN_SHIFT, 4 |
| 658 | − cmp x2, #ID_AA64MMFR0_TGRAN_SUPPORTED | |
| 659 | − b.ne __no_granule_support | |
| 658 | + cmp x2, #ID_AA64MMFR0_TGRAN_SUPPORTED_MIN | |
| 659 | + b.lt __no_granule_support | |
| 660 | + cmp x2, #ID_AA64MMFR0_TGRAN_SUPPORTED_MAX | |
| 661 | + b.gt __no_granule_support | |
| 660 | 662 | update_early_cpu_boot_status 0, x2, x3 |
| 661 | 663 | adrp x2, idmap_pg_dir |
| 662 | 664 | phys_to_ttbr x1, x1 |
| @@ -163,33 +163,36 @@ static __init void __parse_cmdline(const char *cmdline, bool parse_aliases) · 162 unmodified lines | ||
| 163 | 163 | } while (1); |
| 164 | 164 | } |
| 165 | 165 | |
| 166 | −static __init void parse_cmdline(void) | |
| 166 | +static __init const u8 *get_bootargs_cmdline(void) | |
| 167 | 167 | { |
| 168 | − if (!IS_ENABLED(CONFIG_CMDLINE_FORCE)) { | |
| 169 | − const u8 *prop; | |
| 170 | − void *fdt; | |
| 171 | − int node; | |
| 168 | + const u8 *prop; | |
| 169 | + void *fdt; | |
| 170 | + int node; | |
| 172 | 171 | |
| 173 | − fdt = get_early_fdt_ptr(); | |
| 174 | − if (!fdt) | |
| 175 | − goto out; | |
| 172 | + fdt = get_early_fdt_ptr(); | |
| 173 | + if (!fdt) | |
| 174 | + return NULL; | |
| 176 | 175 | |
| 177 | − node = fdt_path_offset(fdt, "/chosen"); | |
| 178 | − if (node < 0) | |
| 179 | − goto out; | |
| 176 | + node = fdt_path_offset(fdt, "/chosen"); | |
| 177 | + if (node < 0) | |
| 178 | + return NULL; | |
| 180 | 179 | |
| 181 | − prop = fdt_getprop(fdt, node, "bootargs", NULL); | |
| 182 | − if (!prop) | |
| 183 | − goto out; | |
| 180 | + prop = fdt_getprop(fdt, node, "bootargs", NULL); | |
| 181 | + if (!prop) | |
| 182 | + return NULL; | |
| 184 | 183 | |
| 185 | − __parse_cmdline(prop, true); | |
| 184 | + return strlen(prop) ? prop : NULL; | |
| 185 | +} | |
| 186 | 186 | |
| 187 | − if (!IS_ENABLED(CONFIG_CMDLINE_EXTEND)) | |
| 188 | − return; | |
| 189 | − } | |
| 187 | +static __init void parse_cmdline(void) | |
| 188 | +{ | |
| 189 | + const u8 *prop = get_bootargs_cmdline(); | |
| 190 | 190 | |
| 191 | −out: | |
| 192 | − __parse_cmdline(CONFIG_CMDLINE, true); | |
| 191 | + if (IS_ENABLED(CONFIG_CMDLINE_FORCE) || !prop) | |
| 192 | + __parse_cmdline(CONFIG_CMDLINE, true); | |
| 193 | + | |
| 194 | + if (!IS_ENABLED(CONFIG_CMDLINE_FORCE) && prop) | |
| 195 | + __parse_cmdline(prop, true); | |
| 193 | 196 | } |
| 194 | 197 | |
| 195 | 198 | /* Keep checkers quiet */ |
| @@ -101,6 +101,9 @@ KVM_NVHE_ALIAS(__stop___kvm_ex_table); · 100 unmodified lines | ||
| 101 | 101 | /* Array containing bases of nVHE per-CPU memory regions. */ |
| 102 | 102 | KVM_NVHE_ALIAS(kvm_arm_hyp_percpu_base); |
| 103 | 103 | |
| 104 | +/* PMU available static key */ | |
| 105 | +KVM_NVHE_ALIAS(kvm_arm_pmu_available); | |
| 106 | + | |
| 104 | 107 | #endif /* CONFIG_KVM */ |
| 105 | 108 | |
| 106 | 109 | #endif /* __ARM64_KERNEL_IMAGE_VARS_H */ |
| @@ -460,7 +460,7 @@ static inline int armv8pmu_counter_has_overflowed(u32 pmnc, int idx) · 459 unmodified lines | ||
| 460 | 460 | return pmnc & BIT(ARMV8_IDX_TO_COUNTER(idx)); |
| 461 | 461 | } |
| 462 | 462 | |
| 463 | −static inline u32 armv8pmu_read_evcntr(int idx) | |
| 463 | +static inline u64 armv8pmu_read_evcntr(int idx) | |
| 464 | 464 | { |
| 465 | 465 | u32 counter = ARMV8_IDX_TO_COUNTER(idx); |
| 466 | 466 | |
| @@ -267,10 +267,12 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int fsr) · 266 unmodified lines | ||
| 267 | 267 | if (!instruction_pointer(regs)) |
| 268 | 268 | BUG(); |
| 269 | 269 | |
| 270 | − if (kcb->kprobe_status == KPROBE_REENTER) | |
| 270 | + if (kcb->kprobe_status == KPROBE_REENTER) { | |
| 271 | 271 | restore_previous_kprobe(kcb); |
| 272 | − else | |
| 272 | + } else { | |
| 273 | + kprobes_restore_local_irqflag(kcb, regs); | |
| 273 | 274 | reset_current_kprobe(); |
| 275 | + } | |
| 274 | 276 | |
| 275 | 277 | break; |
| 276 | 278 | case KPROBE_HIT_ACTIVE: |
| @@ -57,6 +57,8 @@ · 56 unmodified lines | ||
| 57 | 57 | #include <asm/processor.h> |
| 58 | 58 | #include <asm/pointer_auth.h> |
| 59 | 59 | #include <asm/stacktrace.h> |
| 60 | +#include <asm/switch_to.h> | |
| 61 | +#include <asm/system_misc.h> | |
| 60 | 62 | |
| 61 | 63 | #if defined(CONFIG_STACKPROTECTOR) && !defined(CONFIG_STACKPROTECTOR_PER_TASK) |
| 62 | 64 | #include <linux/stackprotector.h> |
| @@ -134,7 +134,7 @@ SYM_FUNC_START(_cpu_resume) · 133 unmodified lines | ||
| 134 | 134 | */ |
| 135 | 135 | bl cpu_do_resume |
| 136 | 136 | |
| 137 | −#if defined(CONFIG_KASAN) && CONFIG_KASAN_STACK | |
| 137 | +#if defined(CONFIG_KASAN) && defined(CONFIG_KASAN_STACK) | |
| 138 | 138 | mov x0, sp |
| 139 | 139 | bl kasan_unpoison_task_stack_below |
| 140 | 140 | #endif |
| @@ -194,8 +194,9 @@ void show_stack(struct task_struct *tsk, unsigned long *sp, const char *loglvl) · 193 unmodified lines | ||
| 194 | 194 | |
| 195 | 195 | #ifdef CONFIG_STACKTRACE |
| 196 | 196 | |
| 197 | −void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie, | |
| 198 | − struct task_struct *task, struct pt_regs *regs) | |
| 197 | +noinline void arch_stack_walk(stack_trace_consume_fn consume_entry, | |
| 198 | + void *cookie, struct task_struct *task, | |
| 199 | + struct pt_regs *regs) | |
| 199 | 200 | { |
| 200 | 201 | struct stackframe frame; |
| 201 | 202 | |
| @@ -203,8 +204,8 @@ void arch_stack_walk(stack_trace_consume_fn consume_entry, void *cookie, · 1 unmodified line | ||
| 203 | 204 | start_backtrace(&frame, regs->regs[29], regs->pc); |
| 204 | 205 | else if (task == current) |
| 205 | 206 | start_backtrace(&frame, |
| 206 | − (unsigned long)__builtin_frame_address(0), | |
| 207 | − (unsigned long)arch_stack_walk); | |
| 207 | + (unsigned long)__builtin_frame_address(1), | |
| 208 | + (unsigned long)__builtin_return_address(0)); | |
| 208 | 209 | else |
| 209 | 210 | start_backtrace(&frame, thread_saved_fp(task), |
| 210 | 211 | thread_saved_pc(task)); |
| @@ -385,11 +385,16 @@ void kvm_arch_vcpu_load(struct kvm_vcpu *vcpu, int cpu) · 384 unmodified lines | ||
| 385 | 385 | last_ran = this_cpu_ptr(mmu->last_vcpu_ran); |
| 386 | 386 | |
| 387 | 387 | /* |
| 388 | + * We guarantee that both TLBs and I-cache are private to each | |
| 389 | + * vcpu. If detecting that a vcpu from the same VM has | |
| 390 | + * previously run on the same physical CPU, call into the | |
| 391 | + * hypervisor code to nuke the relevant contexts. | |
| 392 | + * | |
| 388 | 393 | * We might get preempted before the vCPU actually runs, but |
| 389 | 394 | * over-invalidation doesn't affect correctness. |
| 390 | 395 | */ |
| 391 | 396 | if (*last_ran != vcpu->vcpu_id) { |
| 392 | − kvm_call_hyp(__kvm_tlb_flush_local_vmid, mmu); | |
| 397 | + kvm_call_hyp(__kvm_flush_cpu_context, mmu); | |
| 393 | 398 | *last_ran = vcpu->vcpu_id; |
| 394 | 399 | } |
| 395 | 400 | |
| @@ -89,6 +89,7 @@ void kvm_arm_reset_debug_ptr(struct kvm_vcpu *vcpu) · 88 unmodified lines | ||
| 89 | 89 | * - Debug ROM Address (MDCR_EL2_TDRA) |
| 90 | 90 | * - OS related registers (MDCR_EL2_TDOSA) |
| 91 | 91 | * - Statistical profiler (MDCR_EL2_TPMS/MDCR_EL2_E2PB) |
| 92 | + * - Self-hosted Trace Filter controls (MDCR_EL2_TTRF) | |
| 92 | 93 | * |
| 93 | 94 | * Additionally, KVM only traps guest accesses to the debug registers if |
| 94 | 95 | * the guest is not actively using them (see the KVM_ARM64_DEBUG_DIRTY |
| @@ -112,6 +113,7 @@ void kvm_arm_setup_debug(struct kvm_vcpu *vcpu) · 17 unmodified lines | ||
| 112 | 113 | vcpu->arch.mdcr_el2 = __this_cpu_read(mdcr_el2) & MDCR_EL2_HPMN_MASK; |
| 113 | 114 | vcpu->arch.mdcr_el2 |= (MDCR_EL2_TPM | |
| 114 | 115 | MDCR_EL2_TPMS | |
| 116 | + MDCR_EL2_TTRF | | |
| 115 | 117 | MDCR_EL2_TPMCR | |
| 116 | 118 | MDCR_EL2_TDRA | |
| 117 | 119 | MDCR_EL2_TDOSA); |
| @@ -85,8 +85,10 @@ SYM_INNER_LABEL(__guest_exit_panic, SYM_L_GLOBAL) · 84 unmodified lines | ||
| 85 | 85 | |
| 86 | 86 | // If the hyp context is loaded, go straight to hyp_panic |
| 87 | 87 | get_loaded_vcpu x0, x1 |
| 88 | − cbz x0, hyp_panic | |
| 88 | + cbnz x0, 1f | |
| 89 | + b hyp_panic | |
| 89 | 90 | |
| 91 | +1: | |
| 90 | 92 | // The hyp context is saved so make sure it is restored to allow |
| 91 | 93 | // hyp_panic to run at hyp and, subsequently, panic to run in the host. |
| 92 | 94 | // This makes use of __guest_exit to avoid duplication but sets the |
| @@ -94,7 +96,7 @@ SYM_INNER_LABEL(__guest_exit_panic, SYM_L_GLOBAL) · 1 unmodified line | ||
| 94 | 96 | // current state is saved to the guest context but it will only be |
| 95 | 97 | // accurate if the guest had been completely restored. |
| 96 | 98 | adr_this_cpu x0, kvm_hyp_ctxt, x1 |
| 97 | − adr x1, hyp_panic | |
| 99 | + adr_l x1, hyp_panic | |
| 98 | 100 | str x1, [x0, #CPU_XREG_OFFSET(30)] |
| 99 | 101 | |
| 100 | 102 | get_vcpu_ptr x1, x0 |
| @@ -146,7 +148,7 @@ SYM_INNER_LABEL(__guest_exit, SYM_L_GLOBAL) · 45 unmodified lines | ||
| 146 | 148 | // Now restore the hyp regs |
| 147 | 149 | restore_callee_saved_regs x2 |
| 148 | 150 | |
| 149 | − set_loaded_vcpu xzr, x1, x2 | |
| 151 | + set_loaded_vcpu xzr, x2, x3 | |
| 150 | 152 | |
| 151 | 153 | alternative_if ARM64_HAS_RAS_EXTN |
| 152 | 154 | // If we have the RAS extensions we can consume a pending error |
| @@ -90,15 +90,18 @@ static inline void __activate_traps_common(struct kvm_vcpu *vcpu) · 89 unmodified lines | ||
| 90 | 90 | * counter, which could make a PMXEVCNTR_EL0 access UNDEF at |
| 91 | 91 | * EL1 instead of being trapped to EL2. |
| 92 | 92 | */ |
| 93 | − write_sysreg(0, pmselr_el0); | |
| 94 | − write_sysreg(ARMV8_PMU_USERENR_MASK, pmuserenr_el0); | |
| 93 | + if (kvm_arm_support_pmu_v3()) { | |
| 94 | + write_sysreg(0, pmselr_el0); | |
| 95 | + write_sysreg(ARMV8_PMU_USERENR_MASK, pmuserenr_el0); | |
| 96 | + } | |
| 95 | 97 | write_sysreg(vcpu->arch.mdcr_el2, mdcr_el2); |
| 96 | 98 | } |
| 97 | 99 | |
| 98 | 100 | static inline void __deactivate_traps_common(void) |
| 99 | 101 | { |
| 100 | 102 | write_sysreg(0, hstr_el2); |
| 101 | − write_sysreg(0, pmuserenr_el0); | |
| 103 | + if (kvm_arm_support_pmu_v3()) | |
| 104 | + write_sysreg(0, pmuserenr_el0); | |
| 102 | 105 | } |
| 103 | 106 | |
| 104 | 107 | static inline void ___activate_traps(struct kvm_vcpu *vcpu) |
| @@ -58,16 +58,24 @@ static void __debug_restore_spe(u64 pmscr_el1) · 57 unmodified lines | ||
| 58 | 58 | write_sysreg_s(pmscr_el1, SYS_PMSCR_EL1); |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | −void __debug_switch_to_guest(struct kvm_vcpu *vcpu) | |
| 61 | +void __debug_save_host_buffers_nvhe(struct kvm_vcpu *vcpu) | |
| 62 | 62 | { |
| 63 | 63 | /* Disable and flush SPE data generation */ |
| 64 | 64 | __debug_save_spe(&vcpu->arch.host_debug_state.pmscr_el1); |
| 65 | +} | |
| 66 | + | |
| 67 | +void __debug_switch_to_guest(struct kvm_vcpu *vcpu) | |
| 68 | +{ | |
| 65 | 69 | __debug_switch_to_guest_common(vcpu); |
| 66 | 70 | } |
| 67 | 71 | |
| 68 | −void __debug_switch_to_host(struct kvm_vcpu *vcpu) | |
| 72 | +void __debug_restore_host_buffers_nvhe(struct kvm_vcpu *vcpu) | |
| 69 | 73 | { |
| 70 | 74 | __debug_restore_spe(vcpu->arch.host_debug_state.pmscr_el1); |
| 75 | +} | |
| 76 | + | |
| 77 | +void __debug_switch_to_host(struct kvm_vcpu *vcpu) | |
| 78 | +{ | |
| 71 | 79 | __debug_switch_to_host_common(vcpu); |
| 72 | 80 | } |
| 73 | 81 | |
| @@ -71,7 +71,8 @@ SYM_FUNC_START(__host_enter) · 70 unmodified lines | ||
| 71 | 71 | SYM_FUNC_END(__host_enter) |
| 72 | 72 | |
| 73 | 73 | /* |
| 74 | − * void __noreturn __hyp_do_panic(bool restore_host, u64 spsr, u64 elr, u64 par); | |
| 74 | + * void __noreturn __hyp_do_panic(struct kvm_cpu_context *host_ctxt, u64 spsr, | |
| 75 | + * u64 elr, u64 par); | |
| 75 | 76 | */ |
| 76 | 77 | SYM_FUNC_START(__hyp_do_panic) |
| 77 | 78 | /* Prepare and exit to the host's panic funciton. */ |
| @@ -82,9 +83,11 @@ SYM_FUNC_START(__hyp_do_panic) · 4 unmodified lines | ||
| 82 | 83 | hyp_kimg_va lr, x6 |
| 83 | 84 | msr elr_el2, lr |
| 84 | 85 | |
| 85 | − /* Set the panic format string. Use the, now free, LR as scratch. */ | |
| 86 | − ldr lr, =__hyp_panic_string | |
| 87 | − hyp_kimg_va lr, x6 | |
| 86 | + mov x29, x0 | |
| 87 | + | |
| 88 | + /* Load the format string into x0 and arguments into x1-7 */ | |
| 89 | + ldr x0, =__hyp_panic_string | |
| 90 | + hyp_kimg_va x0, x6 | |
| 88 | 91 | |
| 89 | 92 | /* Load the format arguments into x1-7. */ |
| 90 | 93 | mov x6, x3 |
| @@ -94,9 +97,7 @@ SYM_FUNC_START(__hyp_do_panic) · 3 unmodified lines | ||
| 94 | 97 | mrs x5, hpfar_el2 |
| 95 | 98 | |
| 96 | 99 | /* Enter the host, conditionally restoring the host context. */ |
| 97 | − cmp x0, xzr | |
| 98 | − mov x0, lr | |
| 99 | − b.eq __host_enter_without_restoring | |
| 100 | + cbz x29, __host_enter_without_restoring | |
| 100 | 101 | b __host_enter_for_panic |
| 101 | 102 | SYM_FUNC_END(__hyp_do_panic) |
| 102 | 103 | |
| @@ -46,11 +46,11 @@ static void handle___kvm_tlb_flush_vmid(struct kvm_cpu_context *host_ctxt) · 45 unmodified lines | ||
| 46 | 46 | __kvm_tlb_flush_vmid(kern_hyp_va(mmu)); |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | −static void handle___kvm_tlb_flush_local_vmid(struct kvm_cpu_context *host_ctxt) | |
| 49 | +static void handle___kvm_flush_cpu_context(struct kvm_cpu_context *host_ctxt) | |
| 50 | 50 | { |
| 51 | 51 | DECLARE_REG(struct kvm_s2_mmu *, mmu, host_ctxt, 1); |
| 52 | 52 | |
| 53 | − __kvm_tlb_flush_local_vmid(kern_hyp_va(mmu)); | |
| 53 | + __kvm_flush_cpu_context(kern_hyp_va(mmu)); | |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | 56 | static void handle___kvm_timer_set_cntvoff(struct kvm_cpu_context *host_ctxt) |
| @@ -67,9 +67,9 @@ static void handle___kvm_enable_ssbs(struct kvm_cpu_context *host_ctxt) · 10 unmodified lines | ||
| 67 | 67 | write_sysreg_el2(tmp, SYS_SCTLR); |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | −static void handle___vgic_v3_get_ich_vtr_el2(struct kvm_cpu_context *host_ctxt) | |
| 70 | +static void handle___vgic_v3_get_gic_config(struct kvm_cpu_context *host_ctxt) | |
| 71 | 71 | { |
| 72 | − cpu_reg(host_ctxt, 1) = __vgic_v3_get_ich_vtr_el2(); | |
| 72 | + cpu_reg(host_ctxt, 1) = __vgic_v3_get_gic_config(); | |
| 73 | 73 | } |
| 74 | 74 | |
| 75 | 75 | static void handle___vgic_v3_read_vmcr(struct kvm_cpu_context *host_ctxt) |
| @@ -115,10 +115,10 @@ static const hcall_t host_hcall[] = { · 39 unmodified lines | ||
| 115 | 115 | HANDLE_FUNC(__kvm_flush_vm_context), |
| 116 | 116 | HANDLE_FUNC(__kvm_tlb_flush_vmid_ipa), |
| 117 | 117 | HANDLE_FUNC(__kvm_tlb_flush_vmid), |
| 118 | − HANDLE_FUNC(__kvm_tlb_flush_local_vmid), | |
| 118 | + HANDLE_FUNC(__kvm_flush_cpu_context), | |
| 119 | 119 | HANDLE_FUNC(__kvm_timer_set_cntvoff), |
| 120 | 120 | HANDLE_FUNC(__kvm_enable_ssbs), |
| 121 | − HANDLE_FUNC(__vgic_v3_get_ich_vtr_el2), | |
| 121 | + HANDLE_FUNC(__vgic_v3_get_gic_config), | |
| 122 | 122 | HANDLE_FUNC(__vgic_v3_read_vmcr), |
| 123 | 123 | HANDLE_FUNC(__vgic_v3_write_vmcr), |
| 124 | 124 | HANDLE_FUNC(__vgic_v3_init_lrs), |
| @@ -192,6 +192,14 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu) · 191 unmodified lines | ||
| 192 | 192 | pmu_switch_needed = __pmu_switch_to_guest(host_ctxt); |
| 193 | 193 | |
| 194 | 194 | __sysreg_save_state_nvhe(host_ctxt); |
| 195 | + /* | |
| 196 | + * We must flush and disable the SPE buffer for nVHE, as | |
| 197 | + * the translation regime(EL1&0) is going to be loaded with | |
| 198 | + * that of the guest. And we must do this before we change the | |
| 199 | + * translation regime to EL2 (via MDCR_EL2_E2PB == 0) and | |
| 200 | + * before we load guest Stage1. | |
| 201 | + */ | |
| 202 | + __debug_save_host_buffers_nvhe(vcpu); | |
| 195 | 203 | |
| 196 | 204 | __adjust_pc(vcpu); |
| 197 | 205 | |
| @@ -234,11 +242,12 @@ int __kvm_vcpu_run(struct kvm_vcpu *vcpu) · 36 unmodified lines | ||
| 234 | 242 | if (vcpu->arch.flags & KVM_ARM64_FP_ENABLED) |
| 235 | 243 | __fpsimd_save_fpexc32(vcpu); |
| 236 | 244 | |
| 245 | + __debug_switch_to_host(vcpu); | |
| 237 | 246 | /* |
| 238 | 247 | * This must come after restoring the host sysregs, since a non-VHE |
| 239 | 248 | * system may enable SPE here and make use of the TTBRs. |
| 240 | 249 | */ |
| 241 | − __debug_switch_to_host(vcpu); | |
| 250 | + __debug_restore_host_buffers_nvhe(vcpu); | |
| 242 | 251 | |
| 243 | 252 | if (pmu_switch_needed) |
| 244 | 253 | __pmu_switch_to_host(host_ctxt); |
| @@ -257,7 +266,6 @@ void __noreturn hyp_panic(void) · 12 unmodified lines | ||
| 257 | 266 | u64 spsr = read_sysreg_el2(SYS_SPSR); |
| 258 | 267 | u64 elr = read_sysreg_el2(SYS_ELR); |
| 259 | 268 | u64 par = read_sysreg_par(); |
| 260 | − bool restore_host = true; | |
| 261 | 269 | struct kvm_cpu_context *host_ctxt; |
| 262 | 270 | struct kvm_vcpu *vcpu; |
| 263 | 271 | |
| @@ -271,7 +279,7 @@ void __noreturn hyp_panic(void) · 7 unmodified lines | ||
| 271 | 279 | __sysreg_restore_state_nvhe(host_ctxt); |
| 272 | 280 | } |
| 273 | 281 | |
| 274 | − __hyp_do_panic(restore_host, spsr, elr, par); | |
| 282 | + __hyp_do_panic(host_ctxt, spsr, elr, par); | |
| 275 | 283 | unreachable(); |
| 276 | 284 | } |
| 277 | 285 | |
| @@ -123,7 +123,7 @@ void __kvm_tlb_flush_vmid(struct kvm_s2_mmu *mmu) · 122 unmodified lines | ||
| 123 | 123 | __tlb_switch_to_host(&cxt); |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | −void __kvm_tlb_flush_local_vmid(struct kvm_s2_mmu *mmu) | |
| 126 | +void __kvm_flush_cpu_context(struct kvm_s2_mmu *mmu) | |
| 127 | 127 | { |
| 128 | 128 | struct tlb_inv_context cxt; |
| 129 | 129 | |
| @@ -131,6 +131,7 @@ void __kvm_tlb_flush_local_vmid(struct kvm_s2_mmu *mmu) · 1 unmodified line | ||
| 131 | 131 | __tlb_switch_to_guest(mmu, &cxt); |
| 132 | 132 | |
| 133 | 133 | __tlbi(vmalle1); |
| 134 | + asm volatile("ic iallu"); | |
| 134 | 135 | dsb(nsh); |
| 135 | 136 | isb(); |
| 136 | 137 | |
| @@ -223,6 +223,7 @@ static inline int __kvm_pgtable_visit(struct kvm_pgtable_walk_data *data, · 222 unmodified lines | ||
| 223 | 223 | goto out; |
| 224 | 224 | |
| 225 | 225 | if (!table) { |
| 226 | + data->addr = ALIGN_DOWN(data->addr, kvm_granule_size(level)); | |
| 226 | 227 | data->addr += kvm_granule_size(level); |
| 227 | 228 | goto out; |
| 228 | 229 | } |
| @@ -405,9 +405,54 @@ void __vgic_v3_init_lrs(void) · 404 unmodified lines | ||
| 405 | 405 | __gic_v3_set_lr(0, i); |
| 406 | 406 | } |
| 407 | 407 | |
| 408 | −u64 __vgic_v3_get_ich_vtr_el2(void) | |
| 408 | +/* | |
| 409 | + * Return the GIC CPU configuration: | |
| 410 | + * - [31:0] ICH_VTR_EL2 | |
| 411 | + * - [62:32] RES0 | |
| 412 | + * - [63] MMIO (GICv2) capable | |
| 413 | + */ | |
| 414 | +u64 __vgic_v3_get_gic_config(void) | |
| 409 | 415 | { |
| 410 | − return read_gicreg(ICH_VTR_EL2); | |
| 416 | + u64 val, sre = read_gicreg(ICC_SRE_EL1); | |
| 417 | + unsigned long flags = 0; | |
| 418 | + | |
| 419 | + /* | |
| 420 | + * To check whether we have a MMIO-based (GICv2 compatible) | |
| 421 | + * CPU interface, we need to disable the system register | |
| 422 | + * view. To do that safely, we have to prevent any interrupt | |
| 423 | + * from firing (which would be deadly). | |
| 424 | + * | |
| 425 | + * Note that this only makes sense on VHE, as interrupts are | |
| 426 | + * already masked for nVHE as part of the exception entry to | |
| 427 | + * EL2. | |
| 428 | + */ | |
| 429 | + if (has_vhe()) | |
| 430 | + flags = local_daif_save(); | |
| 431 | + | |
| 432 | + /* | |
| 433 | + * Table 11-2 "Permitted ICC_SRE_ELx.SRE settings" indicates | |
| 434 | + * that to be able to set ICC_SRE_EL1.SRE to 0, all the | |
| 435 | + * interrupt overrides must be set. You've got to love this. | |
| 436 | + */ | |
| 437 | + sysreg_clear_set(hcr_el2, 0, HCR_AMO | HCR_FMO | HCR_IMO); | |
| 438 | + isb(); | |
| 439 | + write_gicreg(0, ICC_SRE_EL1); | |
| 440 | + isb(); | |
| 441 | + | |
| 442 | + val = read_gicreg(ICC_SRE_EL1); | |
| 443 | + | |
| 444 | + write_gicreg(sre, ICC_SRE_EL1); | |
| 445 | + isb(); | |
| 446 | + sysreg_clear_set(hcr_el2, HCR_AMO | HCR_FMO | HCR_IMO, 0); | |
| 447 | + isb(); | |
| 448 | + | |
| 449 | + if (has_vhe()) | |
| 450 | + local_daif_restore(flags); | |
| 451 | + | |
| 452 | + val = (val & ICC_SRE_EL1_SRE) ? 0 : (1ULL << 63); | |
| 453 | + val |= read_gicreg(ICH_VTR_EL2); | |
| 454 | + | |
| 455 | + return val; | |
| 411 | 456 | } |
| 412 | 457 | |
| 413 | 458 | u64 __vgic_v3_read_vmcr(void) |
| @@ -127,7 +127,7 @@ void __kvm_tlb_flush_vmid(struct kvm_s2_mmu *mmu) · 126 unmodified lines | ||
| 127 | 127 | __tlb_switch_to_host(&cxt); |
| 128 | 128 | } |
| 129 | 129 | |
| 130 | −void __kvm_tlb_flush_local_vmid(struct kvm_s2_mmu *mmu) | |
| 130 | +void __kvm_flush_cpu_context(struct kvm_s2_mmu *mmu) | |
| 131 | 131 | { |
| 132 | 132 | struct tlb_inv_context cxt; |
| 133 | 133 | |
| @@ -135,6 +135,7 @@ void __kvm_tlb_flush_local_vmid(struct kvm_s2_mmu *mmu) · 1 unmodified line | ||
| 135 | 135 | __tlb_switch_to_guest(mmu, &cxt); |
| 136 | 136 | |
| 137 | 137 | __tlbi(vmalle1); |
| 138 | + asm volatile("ic iallu"); | |
| 138 | 139 | dsb(nsh); |
| 139 | 140 | isb(); |
| 140 | 141 | |
| @@ -1312,8 +1312,7 @@ int kvm_arch_prepare_memory_region(struct kvm *kvm, · 1311 unmodified lines | ||
| 1312 | 1312 | * Prevent userspace from creating a memory region outside of the IPA |
| 1313 | 1313 | * space addressable by the KVM guest IPA space. |
| 1314 | 1314 | */ |
| 1315 | − if (memslot->base_gfn + memslot->npages >= | |
| 1316 | − (kvm_phys_size(kvm) >> PAGE_SHIFT)) | |
| 1315 | + if ((memslot->base_gfn + memslot->npages) > (kvm_phys_size(kvm) >> PAGE_SHIFT)) | |
| 1317 | 1316 | return -EFAULT; |
| 1318 | 1317 | |
| 1319 | 1318 | mmap_read_lock(current->mm); |
| @@ -11,6 +11,8 @@ · 10 unmodified lines | ||
| 11 | 11 | |
| 12 | 12 | #include <asm/kvm_emulate.h> |
| 13 | 13 | |
| 14 | +DEFINE_STATIC_KEY_FALSE(kvm_arm_pmu_available); | |
| 15 | + | |
| 14 | 16 | static int kvm_is_in_guest(void) |
| 15 | 17 | { |
| 16 | 18 | return kvm_get_running_vcpu() != NULL; |
| @@ -48,6 +50,14 @@ static struct perf_guest_info_callbacks kvm_guest_cbs = { · 31 unmodified lines | ||
| 48 | 50 | |
| 49 | 51 | int kvm_perf_init(void) |
| 50 | 52 | { |
| 53 | + /* | |
| 54 | + * Check if HW_PERF_EVENTS are supported by checking the number of | |
| 55 | + * hardware performance counters. This could ensure the presence of | |
| 56 | + * a physical PMU and CONFIG_PERF_EVENT is selected. | |
| 57 | + */ | |
| 58 | + if (IS_ENABLED(CONFIG_ARM_PMU) && perf_num_counters() > 0) | |
| 59 | + static_branch_enable(&kvm_arm_pmu_available); | |
| 60 | + | |
| 51 | 61 | return perf_register_guest_info_callbacks(&kvm_guest_cbs); |
| 52 | 62 | } |
| 53 | 63 | |
| @@ -823,16 +823,6 @@ u64 kvm_pmu_get_pmceid(struct kvm_vcpu *vcpu, bool pmceid1) · 822 unmodified lines | ||
| 823 | 823 | return val & mask; |
| 824 | 824 | } |
| 825 | 825 | |
| 826 | −bool kvm_arm_support_pmu_v3(void) | |
| 827 | −{ | |
| 828 | − /* | |
| 829 | − * Check if HW_PERF_EVENTS are supported by checking the number of | |
| 830 | − * hardware performance counters. This could ensure the presence of | |
| 831 | − * a physical PMU and CONFIG_PERF_EVENT is selected. | |
| 832 | − */ | |
| 833 | − return (perf_num_counters() > 0); | |
| 834 | −} | |
| 835 | − | |
| 836 | 826 | int kvm_arm_pmu_v3_enable(struct kvm_vcpu *vcpu) |
| 837 | 827 | { |
| 838 | 828 | if (!kvm_vcpu_has_pmu(vcpu)) |
| @@ -311,23 +311,24 @@ int kvm_set_ipa_limit(void) · 310 unmodified lines | ||
| 311 | 311 | } |
| 312 | 312 | |
| 313 | 313 | switch (cpuid_feature_extract_unsigned_field(mmfr0, tgran_2)) { |
| 314 | − default: | |
| 315 | − case 1: | |
| 314 | + case ID_AA64MMFR0_TGRAN_2_SUPPORTED_NONE: | |
| 316 | 315 | kvm_err("PAGE_SIZE not supported at Stage-2, giving up\n"); |
| 317 | 316 | return -EINVAL; |
| 318 | − case 0: | |
| 317 | + case ID_AA64MMFR0_TGRAN_2_SUPPORTED_DEFAULT: | |
| 319 | 318 | kvm_debug("PAGE_SIZE supported at Stage-2 (default)\n"); |
| 320 | 319 | break; |
| 321 | − case 2: | |
| 320 | + case ID_AA64MMFR0_TGRAN_2_SUPPORTED_MIN ... ID_AA64MMFR0_TGRAN_2_SUPPORTED_MAX: | |
| 322 | 321 | kvm_debug("PAGE_SIZE supported at Stage-2 (advertised)\n"); |
| 323 | 322 | break; |
| 323 | + default: | |
| 324 | + kvm_err("Unsupported value for TGRAN_2, giving up\n"); | |
| 325 | + return -EINVAL; | |
| 324 | 326 | } |
| 325 | 327 | |
| 326 | 328 | kvm_ipa_limit = id_aa64mmfr0_parange_to_phys_shift(parange); |
| 327 | − WARN(kvm_ipa_limit < KVM_PHYS_SHIFT, | |
| 328 | − "KVM IPA Size Limit (%d bits) is smaller than default size\n", | |
| 329 | − kvm_ipa_limit); | |
| 330 | − kvm_info("IPA Size Limit: %d bits\n", kvm_ipa_limit); | |
| 329 | + kvm_info("IPA Size Limit: %d bits%s\n", kvm_ipa_limit, | |
| 330 | + ((kvm_ipa_limit < KVM_PHYS_SHIFT) ? | |
| 331 | + " (Reduced IPA size, limited VM/VMM compatibility)" : "")); | |
| 331 | 332 | |
| 332 | 333 | return 0; |
| 333 | 334 | } |
| @@ -356,6 +357,11 @@ int kvm_arm_setup_stage2(struct kvm *kvm, unsigned long type) · 22 unmodified lines | ||
| 356 | 357 | return -EINVAL; |
| 357 | 358 | } else { |
| 358 | 359 | phys_shift = KVM_PHYS_SHIFT; |
| 360 | + if (phys_shift > kvm_ipa_limit) { | |
| 361 | + pr_warn_once("%s using unsupported default IPA limit, upgrade your VMM\n", | |
| 362 | + current->comm); | |
| 363 | + return -EINVAL; | |
| 364 | + } | |
| 359 | 365 | } |
| 360 | 366 | |
| 361 | 367 | mmfr0 = read_sanitised_ftr_reg(SYS_ID_AA64MMFR0_EL1); |
| @@ -574,9 +574,13 @@ early_param("kvm-arm.vgic_v4_enable", early_gicv4_enable); · 573 unmodified lines | ||
| 574 | 574 | */ |
| 575 | 575 | int vgic_v3_probe(const struct gic_kvm_info *info) |
| 576 | 576 | { |
| 577 | − u32 ich_vtr_el2 = kvm_call_hyp_ret(__vgic_v3_get_ich_vtr_el2); | |
| 577 | + u64 ich_vtr_el2 = kvm_call_hyp_ret(__vgic_v3_get_gic_config); | |
| 578 | + bool has_v2; | |
| 578 | 579 | int ret; |
| 579 | 580 | |
| 581 | + has_v2 = ich_vtr_el2 >> 63; | |
| 582 | + ich_vtr_el2 = (u32)ich_vtr_el2; | |
| 583 | + | |
| 580 | 584 | /* |
| 581 | 585 | * The ListRegs field is 5 bits, but there is an architectural |
| 582 | 586 | * maximum of 16 list registers. Just ignore bit 4... |
| @@ -594,13 +598,15 @@ int vgic_v3_probe(const struct gic_kvm_info *info) · 11 unmodified lines | ||
| 594 | 598 | gicv4_enable ? "en" : "dis"); |
| 595 | 599 | } |
| 596 | 600 | |
| 601 | + kvm_vgic_global_state.vcpu_base = 0; | |
| 602 | + | |
| 597 | 603 | if (!info->vcpu.start) { |
| 598 | 604 | kvm_info("GICv3: no GICV resource entry\n"); |
| 599 | − kvm_vgic_global_state.vcpu_base = 0; | |
| 605 | + } else if (!has_v2) { | |
| 606 | + pr_warn(FW_BUG "CPU interface incapable of MMIO access\n"); | |
| 600 | 607 | } else if (!PAGE_ALIGNED(info->vcpu.start)) { |
| 601 | 608 | pr_warn("GICV physical address 0x%llx not page aligned\n", |
| 602 | 609 | (unsigned long long)info->vcpu.start); |
| 603 | − kvm_vgic_global_state.vcpu_base = 0; | |
| 604 | 610 | } else { |
| 605 | 611 | kvm_vgic_global_state.vcpu_base = info->vcpu.start; |
| 606 | 612 | kvm_vgic_global_state.can_emulate_gicv2 = true; |
| @@ -219,17 +219,40 @@ static void __init zone_sizes_init(unsigned long min, unsigned long max) · 218 unmodified lines | ||
| 219 | 219 | |
| 220 | 220 | int pfn_valid(unsigned long pfn) |
| 221 | 221 | { |
| 222 | − phys_addr_t addr = pfn << PAGE_SHIFT; | |
| 222 | + phys_addr_t addr = PFN_PHYS(pfn); | |
| 223 | 223 | |
| 224 | − if ((addr >> PAGE_SHIFT) != pfn) | |
| 224 | + /* | |
| 225 | + * Ensure the upper PAGE_SHIFT bits are clear in the | |
| 226 | + * pfn. Else it might lead to false positives when | |
| 227 | + * some of the upper bits are set, but the lower bits | |
| 228 | + * match a valid pfn. | |
| 229 | + */ | |
| 230 | + if (PHYS_PFN(addr) != pfn) | |
| 225 | 231 | return 0; |
| 226 | 232 | |
| 227 | 233 | #ifdef CONFIG_SPARSEMEM |
| 234 | +{ | |
| 235 | + struct mem_section *ms; | |
| 236 | + | |
| 228 | 237 | if (pfn_to_section_nr(pfn) >= NR_MEM_SECTIONS) |
| 229 | 238 | return 0; |
| 230 | 239 | |
| 231 | − if (!valid_section(__pfn_to_section(pfn))) | |
| 240 | + ms = __pfn_to_section(pfn); | |
| 241 | + if (!valid_section(ms)) | |
| 232 | 242 | return 0; |
| 243 | + | |
| 244 | + /* | |
| 245 | + * ZONE_DEVICE memory does not have the memblock entries. | |
| 246 | + * memblock_is_map_memory() check for ZONE_DEVICE based | |
| 247 | + * addresses will always fail. Even the normal hotplugged | |
| 248 | + * memory will never have MEMBLOCK_NOMAP flag set in their | |
| 249 | + * memblock entries. Skip memblock search for all non early | |
| 250 | + * memory sections covering all of hotplug memory including | |
| 251 | + * both normal and ZONE_DEVICE based. | |
| 252 | + */ | |
| 253 | + if (!early_section(ms)) | |
| 254 | + return pfn_section_valid(ms, pfn); | |
| 255 | +} | |
| 233 | 256 | #endif |
| 234 | 257 | return memblock_is_map_memory(addr); |
| 235 | 258 | } |
| @@ -40,7 +40,7 @@ · 39 unmodified lines | ||
| 40 | 40 | #define NO_BLOCK_MAPPINGS BIT(0) |
| 41 | 41 | #define NO_CONT_MAPPINGS BIT(1) |
| 42 | 42 | |
| 43 | −u64 idmap_t0sz = TCR_T0SZ(VA_BITS); | |
| 43 | +u64 idmap_t0sz = TCR_T0SZ(VA_BITS_MIN); | |
| 44 | 44 | u64 idmap_ptrs_per_pgd = PTRS_PER_PGD; |
| 45 | 45 | |
| 46 | 46 | u64 __section(".mmuoff.data.write") vabits_actual; |
| @@ -512,7 +512,8 @@ static void __init map_mem(pgd_t *pgdp) · 465 unmodified lines | ||
| 512 | 512 | * if MTE is present. Otherwise, it has the same attributes as |
| 513 | 513 | * PAGE_KERNEL. |
| 514 | 514 | */ |
| 515 | − __map_memblock(pgdp, start, end, PAGE_KERNEL_TAGGED, flags); | |
| 515 | + __map_memblock(pgdp, start, end, pgprot_tagged(PAGE_KERNEL), | |
| 516 | + flags); | |
| 516 | 517 | } |
| 517 | 518 | |
| 518 | 519 | /* |
| @@ -1447,6 +1448,22 @@ static void __remove_pgd_mapping(pgd_t *pgdir, unsigned long start, u64 size) · 928 unmodified lines | ||
| 1447 | 1448 | struct range arch_get_mappable_range(void) |
| 1448 | 1449 | { |
| 1449 | 1450 | struct range mhp_range; |
| 1451 | + u64 start_linear_pa = __pa(_PAGE_OFFSET(vabits_actual)); | |
| 1452 | + u64 end_linear_pa = __pa(PAGE_END - 1); | |
| 1453 | + | |
| 1454 | + if (IS_ENABLED(CONFIG_RANDOMIZE_BASE)) { | |
| 1455 | + /* | |
| 1456 | + * Check for a wrap, it is possible because of randomized linear | |
| 1457 | + * mapping the start physical address is actually bigger than | |
| 1458 | + * the end physical address. In this case set start to zero | |
| 1459 | + * because [0, end_linear_pa] range must still be able to cover | |
| 1460 | + * all addressable physical addresses. | |
| 1461 | + */ | |
| 1462 | + if (start_linear_pa > end_linear_pa) | |
| 1463 | + start_linear_pa = 0; | |
| 1464 | + } | |
| 1465 | + | |
| 1466 | + WARN_ON(start_linear_pa > end_linear_pa); | |
| 1450 | 1467 | |
| 1451 | 1468 | /* |
| 1452 | 1469 | * Linear mapping region is the range [PAGE_OFFSET..(PAGE_END - 1)] |
| @@ -1454,8 +1471,9 @@ struct range arch_get_mappable_range(void) · 1 unmodified line | ||
| 1454 | 1471 | * range which can be mapped inside this linear mapping range, must |
| 1455 | 1472 | * also be derived from its end points. |
| 1456 | 1473 | */ |
| 1457 | − mhp_range.start = __pa(_PAGE_OFFSET(vabits_actual)); | |
| 1458 | − mhp_range.end = __pa(PAGE_END - 1); | |
| 1474 | + mhp_range.start = start_linear_pa; | |
| 1475 | + mhp_range.end = end_linear_pa; | |
| 1476 | + | |
| 1459 | 1477 | return mhp_range; |
| 1460 | 1478 | } |
| 1461 | 1479 | |
| @@ -314,7 +314,7 @@ config FORCE_MAX_ZONEORDER · 313 unmodified lines | ||
| 314 | 314 | int "Maximum zone order" |
| 315 | 315 | default "11" |
| 316 | 316 | |
| 317 | −config RAM_BASE | |
| 317 | +config DRAM_BASE | |
| 318 | 318 | hex "DRAM start addr (the same with memory-section in dts)" |
| 319 | 319 | default 0x0 |
| 320 | 320 | |
| @@ -28,7 +28,7 @@ · 27 unmodified lines | ||
| 28 | 28 | #define SSEG_SIZE 0x20000000 |
| 29 | 29 | #define LOWMEM_LIMIT (SSEG_SIZE * 2) |
| 30 | 30 | |
| 31 | −#define PHYS_OFFSET_OFFSET (CONFIG_RAM_BASE & (SSEG_SIZE - 1)) | |
| 31 | +#define PHYS_OFFSET_OFFSET (CONFIG_DRAM_BASE & (SSEG_SIZE - 1)) | |
| 32 | 32 | |
| 33 | 33 | #ifndef __ASSEMBLY__ |
| 34 | 34 | |
| @@ -9,7 +9,7 @@ int arch_check_ftrace_location(struct kprobe *p) · 8 unmodified lines | ||
| 9 | 9 | return 0; |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | −/* Ftrace callback handler for kprobes -- called under preepmt disabed */ | |
| 12 | +/* Ftrace callback handler for kprobes -- called under preepmt disabled */ | |
| 13 | 13 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, |
| 14 | 14 | struct ftrace_ops *ops, struct ftrace_regs *fregs) |
| 15 | 15 | { |
| @@ -55,8 +55,6 @@ CONFIG_CHR_DEV_SG=m · 54 unmodified lines | ||
| 55 | 55 | CONFIG_SCSI_FC_ATTRS=y |
| 56 | 56 | CONFIG_SCSI_SYM53C8XX_2=y |
| 57 | 57 | CONFIG_SCSI_QLOGIC_1280=y |
| 58 | −CONFIG_ATA=y | |
| 59 | −CONFIG_ATA_PIIX=y | |
| 60 | 58 | CONFIG_SATA_VITESSE=y |
| 61 | 59 | CONFIG_MD=y |
| 62 | 60 | CONFIG_BLK_DEV_MD=m |
| @@ -54,8 +54,7 @@ · 53 unmodified lines | ||
| 54 | 54 | |
| 55 | 55 | static inline unsigned long user_stack_pointer(struct pt_regs *regs) |
| 56 | 56 | { |
| 57 | − /* FIXME: should this be bspstore + nr_dirty regs? */ | |
| 58 | − return regs->ar_bspstore; | |
| 57 | + return regs->r12; | |
| 59 | 58 | } |
| 60 | 59 | |
| 61 | 60 | static inline int is_syscall_success(struct pt_regs *regs) |
| @@ -79,11 +78,6 @@ static inline long regs_return_value(struct pt_regs *regs) · 17 unmodified lines | ||
| 79 | 78 | unsigned long __ip = instruction_pointer(regs); \ |
| 80 | 79 | (__ip & ~3UL) + ((__ip & 3UL) << 2); \ |
| 81 | 80 | }) |
| 82 | −/* | |
| 83 | − * Why not default? Because user_stack_pointer() on ia64 gives register | |
| 84 | − * stack backing store instead... | |
| 85 | − */ | |
| 86 | −#define current_user_stack_pointer() (current_pt_regs()->r12) | |
| 87 | 81 | |
| 88 | 82 | /* given a pointer to a task_struct, return the user's pt_regs */ |
| 89 | 83 | # define task_pt_regs(t) (((struct pt_regs *) ((char *) (t) + IA64_STK_OFFSET)) - 1) |
| @@ -32,7 +32,7 @@ static inline void syscall_rollback(struct task_struct *task, · 31 unmodified lines | ||
| 32 | 32 | static inline long syscall_get_error(struct task_struct *task, |
| 33 | 33 | struct pt_regs *regs) |
| 34 | 34 | { |
| 35 | − return regs->r10 == -1 ? regs->r8:0; | |
| 35 | + return regs->r10 == -1 ? -regs->r8:0; | |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | 38 | static inline long syscall_get_return_value(struct task_struct *task, |
| @@ -59,7 +59,7 @@ show_##name(struct device *dev, struct device_attribute *attr, \ · 58 unmodified lines | ||
| 59 | 59 | char *buf) \ |
| 60 | 60 | { \ |
| 61 | 61 | u32 cpu=dev->id; \ |
| 62 | − return sprintf(buf, "%lx\n", name[cpu]); \ | |
| 62 | + return sprintf(buf, "%llx\n", name[cpu]); \ | |
| 63 | 63 | } |
| 64 | 64 | |
| 65 | 65 | #define store(name) \ |
| @@ -86,9 +86,9 @@ store_call_start(struct device *dev, struct device_attribute *attr, · 20 unmodified lines | ||
| 86 | 86 | |
| 87 | 87 | #ifdef ERR_INJ_DEBUG |
| 88 | 88 | printk(KERN_DEBUG "pal_mc_err_inject for cpu%d:\n", cpu); |
| 89 | − printk(KERN_DEBUG "err_type_info=%lx,\n", err_type_info[cpu]); | |
| 90 | − printk(KERN_DEBUG "err_struct_info=%lx,\n", err_struct_info[cpu]); | |
| 91 | − printk(KERN_DEBUG "err_data_buffer=%lx, %lx, %lx.\n", | |
| 89 | + printk(KERN_DEBUG "err_type_info=%llx,\n", err_type_info[cpu]); | |
| 90 | + printk(KERN_DEBUG "err_struct_info=%llx,\n", err_struct_info[cpu]); | |
| 91 | + printk(KERN_DEBUG "err_data_buffer=%llx, %llx, %llx.\n", | |
| 92 | 92 | err_data_buffer[cpu].data1, |
| 93 | 93 | err_data_buffer[cpu].data2, |
| 94 | 94 | err_data_buffer[cpu].data3); |
| @@ -117,8 +117,8 @@ store_call_start(struct device *dev, struct device_attribute *attr, · 22 unmodified lines | ||
| 117 | 117 | |
| 118 | 118 | #ifdef ERR_INJ_DEBUG |
| 119 | 119 | printk(KERN_DEBUG "Returns: status=%d,\n", (int)status[cpu]); |
| 120 | − printk(KERN_DEBUG "capabilities=%lx,\n", capabilities[cpu]); | |
| 121 | − printk(KERN_DEBUG "resources=%lx\n", resources[cpu]); | |
| 120 | + printk(KERN_DEBUG "capabilities=%llx,\n", capabilities[cpu]); | |
| 121 | + printk(KERN_DEBUG "resources=%llx\n", resources[cpu]); | |
| 122 | 122 | #endif |
| 123 | 123 | return size; |
| 124 | 124 | } |
| @@ -131,7 +131,7 @@ show_virtual_to_phys(struct device *dev, struct device_attribute *attr, · 6 unmodified lines | ||
| 131 | 131 | char *buf) |
| 132 | 132 | { |
| 133 | 133 | unsigned int cpu=dev->id; |
| 134 | − return sprintf(buf, "%lx\n", phys_addr[cpu]); | |
| 134 | + return sprintf(buf, "%llx\n", phys_addr[cpu]); | |
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | static ssize_t |
| @@ -145,7 +145,7 @@ store_virtual_to_phys(struct device *dev, struct device_attribute *attr, · 7 unmodified lines | ||
| 145 | 145 | ret = get_user_pages_fast(virt_addr, 1, FOLL_WRITE, NULL); |
| 146 | 146 | if (ret<=0) { |
| 147 | 147 | #ifdef ERR_INJ_DEBUG |
| 148 | − printk("Virtual address %lx is not existing.\n",virt_addr); | |
| 148 | + printk("Virtual address %llx is not existing.\n", virt_addr); | |
| 149 | 149 | #endif |
| 150 | 150 | return -EINVAL; |
| 151 | 151 | } |
| @@ -163,7 +163,7 @@ show_err_data_buffer(struct device *dev, · 11 unmodified lines | ||
| 163 | 163 | { |
| 164 | 164 | unsigned int cpu=dev->id; |
| 165 | 165 | |
| 166 | − return sprintf(buf, "%lx, %lx, %lx\n", | |
| 166 | + return sprintf(buf, "%llx, %llx, %llx\n", | |
| 167 | 167 | err_data_buffer[cpu].data1, |
| 168 | 168 | err_data_buffer[cpu].data2, |
| 169 | 169 | err_data_buffer[cpu].data3); |
| @@ -178,13 +178,13 @@ store_err_data_buffer(struct device *dev, · 8 unmodified lines | ||
| 178 | 178 | int ret; |
| 179 | 179 | |
| 180 | 180 | #ifdef ERR_INJ_DEBUG |
| 181 | − printk("write err_data_buffer=[%lx,%lx,%lx] on cpu%d\n", | |
| 181 | + printk("write err_data_buffer=[%llx,%llx,%llx] on cpu%d\n", | |
| 182 | 182 | err_data_buffer[cpu].data1, |
| 183 | 183 | err_data_buffer[cpu].data2, |
| 184 | 184 | err_data_buffer[cpu].data3, |
| 185 | 185 | cpu); |
| 186 | 186 | #endif |
| 187 | − ret=sscanf(buf, "%lx, %lx, %lx", | |
| 187 | + ret = sscanf(buf, "%llx, %llx, %llx", | |
| 188 | 188 | &err_data_buffer[cpu].data1, |
| 189 | 189 | &err_data_buffer[cpu].data2, |
| 190 | 190 | &err_data_buffer[cpu].data3); |
| @@ -1824,7 +1824,7 @@ ia64_mca_cpu_init(void *cpu_data) · 1823 unmodified lines | ||
| 1824 | 1824 | data = mca_bootmem(); |
| 1825 | 1825 | first_time = 0; |
| 1826 | 1826 | } else |
| 1827 | − data = (void *)__get_free_pages(GFP_KERNEL, | |
| 1827 | + data = (void *)__get_free_pages(GFP_ATOMIC, | |
| 1828 | 1828 | get_order(sz)); |
| 1829 | 1829 | if (!data) |
| 1830 | 1830 | panic("Could not allocate MCA memory for cpu %d\n", |
| @@ -2013,27 +2013,39 @@ static void syscall_get_set_args_cb(struct unw_frame_info *info, void *data) · 2012 unmodified lines | ||
| 2013 | 2013 | { |
| 2014 | 2014 | struct syscall_get_set_args *args = data; |
| 2015 | 2015 | struct pt_regs *pt = args->regs; |
| 2016 | − unsigned long *krbs, cfm, ndirty; | |
| 2016 | + unsigned long *krbs, cfm, ndirty, nlocals, nouts; | |
| 2017 | 2017 | int i, count; |
| 2018 | 2018 | |
| 2019 | 2019 | if (unw_unwind_to_user(info) < 0) |
| 2020 | 2020 | return; |
| 2021 | 2021 | |
| 2022 | + /* | |
| 2023 | + * We get here via a few paths: | |
| 2024 | + * - break instruction: cfm is shared with caller. | |
| 2025 | + * syscall args are in out= regs, locals are non-empty. | |
| 2026 | + * - epsinstruction: cfm is set by br.call | |
| 2027 | + * locals don't exist. | |
| 2028 | + * | |
| 2029 | + * For both cases argguments are reachable in cfm.sof - cfm.sol. | |
| 2030 | + * CFM: [ ... | sor: 17..14 | sol : 13..7 | sof : 6..0 ] | |
| 2031 | + */ | |
| 2022 | 2032 | cfm = pt->cr_ifs; |
| 2033 | + nlocals = (cfm >> 7) & 0x7f; /* aka sol */ | |
| 2034 | + nouts = (cfm & 0x7f) - nlocals; /* aka sof - sol */ | |
| 2023 | 2035 | krbs = (unsigned long *)info->task + IA64_RBS_OFFSET/8; |
| 2024 | 2036 | ndirty = ia64_rse_num_regs(krbs, krbs + (pt->loadrs >> 19)); |
| 2025 | 2037 | |
| 2026 | 2038 | count = 0; |
| 2027 | 2039 | if (in_syscall(pt)) |
| 2028 | − count = min_t(int, args->n, cfm & 0x7f); | |
| 2040 | + count = min_t(int, args->n, nouts); | |
| 2029 | 2041 | |
| 2042 | + /* Iterate over outs. */ | |
| 2030 | 2043 | for (i = 0; i < count; i++) { |
| 2044 | + int j = ndirty + nlocals + i + args->i; | |
| 2031 | 2045 | if (args->rw) |
| 2032 | − *ia64_rse_skip_regs(krbs, ndirty + i + args->i) = | |
| 2033 | − args->args[i]; | |
| 2046 | + *ia64_rse_skip_regs(krbs, j) = args->args[i]; | |
| 2034 | 2047 | else |
| 2035 | − args->args[i] = *ia64_rse_skip_regs(krbs, | |
| 2036 | − ndirty + i + args->i); | |
| 2048 | + args->args[i] = *ia64_rse_skip_regs(krbs, j); | |
| 2037 | 2049 | } |
| 2038 | 2050 | |
| 2039 | 2051 | if (!args->rw) { |
| @@ -95,7 +95,7 @@ static int __init build_node_maps(unsigned long start, unsigned long len, · 94 unmodified lines | ||
| 95 | 95 | * acpi_boot_init() (which builds the node_to_cpu_mask array) hasn't been |
| 96 | 96 | * called yet. Note that node 0 will also count all non-existent cpus. |
| 97 | 97 | */ |
| 98 | −static int __meminit early_nr_cpus_node(int node) | |
| 98 | +static int early_nr_cpus_node(int node) | |
| 99 | 99 | { |
| 100 | 100 | int cpu, n = 0; |
| 101 | 101 | |
| @@ -110,7 +110,7 @@ static int __meminit early_nr_cpus_node(int node) · 8 unmodified lines | ||
| 110 | 110 | * compute_pernodesize - compute size of pernode data |
| 111 | 111 | * @node: the node id. |
| 112 | 112 | */ |
| 113 | −static unsigned long __meminit compute_pernodesize(int node) | |
| 113 | +static unsigned long compute_pernodesize(int node) | |
| 114 | 114 | { |
| 115 | 115 | unsigned long pernodesize = 0, cpus; |
| 116 | 116 | |
| @@ -367,7 +367,7 @@ static void __init reserve_pernode_space(void) · 250 unmodified lines | ||
| 367 | 367 | } |
| 368 | 368 | } |
| 369 | 369 | |
| 370 | −static void __meminit scatter_node_data(void) | |
| 370 | +static void scatter_node_data(void) | |
| 371 | 371 | { |
| 372 | 372 | pg_data_t **dst; |
| 373 | 373 | int node; |
| @@ -167,11 +167,11 @@ static inline __attribute_const__ int __virt_to_node_shift(void) · 166 unmodified lines | ||
| 167 | 167 | ((__p) - pgdat->node_mem_map) + pgdat->node_start_pfn; \ |
| 168 | 168 | }) |
| 169 | 169 | #else |
| 170 | −#define ARCH_PFN_OFFSET (m68k_memory[0].addr) | |
| 170 | +#define ARCH_PFN_OFFSET (m68k_memory[0].addr >> PAGE_SHIFT) | |
| 171 | 171 | #include <asm-generic/memory_model.h> |
| 172 | 172 | #endif |
| 173 | 173 | |
| 174 | −#define virt_addr_valid(kaddr) ((void *)(kaddr) >= (void *)PAGE_OFFSET && (void *)(kaddr) < high_memory) | |
| 174 | +#define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) | |
| 175 | 175 | #define pfn_valid(pfn) virt_addr_valid(pfn_to_virt(pfn)) |
| 176 | 176 | |
| 177 | 177 | #endif /* __ASSEMBLY__ */ |
| @@ -30,8 +30,8 @@ extern unsigned long memory_end; · 29 unmodified lines | ||
| 30 | 30 | #define page_to_pfn(page) virt_to_pfn(page_to_virt(page)) |
| 31 | 31 | #define pfn_valid(pfn) ((pfn) < max_mapnr) |
| 32 | 32 | |
| 33 | −#define virt_addr_valid(kaddr) (((void *)(kaddr) >= (void *)PAGE_OFFSET) && \ | |
| 34 | − ((void *)(kaddr) < (void *)memory_end)) | |
| 33 | +#define virt_addr_valid(kaddr) (((unsigned long)(kaddr) >= PAGE_OFFSET) && \ | |
| 34 | + ((unsigned long)(kaddr) < memory_end)) | |
| 35 | 35 | |
| 36 | 36 | #endif /* __ASSEMBLY__ */ |
| 37 | 37 | |
| @@ -14,6 +14,7 @@ · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | #include <asm/addrspace.h> |
| 16 | 16 | #include <asm/unaligned.h> |
| 17 | +#include <asm-generic/vmlinux.lds.h> | |
| 17 | 18 | |
| 18 | 19 | /* |
| 19 | 20 | * These two variables specify the free mem region |
| @@ -120,6 +121,13 @@ void decompress_kernel(unsigned long boot_heap_start) · 100 unmodified lines | ||
| 120 | 121 | /* last four bytes is always image size in little endian */ |
| 121 | 122 | image_size = get_unaligned_le32((void *)&__image_end - 4); |
| 122 | 123 | |
| 124 | + /* The device tree's address must be properly aligned */ | |
| 125 | + image_size = ALIGN(image_size, STRUCT_ALIGNMENT); | |
| 126 | + | |
| 127 | + puts("Copy device tree to address "); | |
| 128 | + puthex(VMLINUX_LOAD_ADDRESS_ULL + image_size); | |
| 129 | + puts("\n"); | |
| 130 | + | |
| 123 | 131 | /* copy dtb to where the booted kernel will expect it */ |
| 124 | 132 | memcpy((void *)VMLINUX_LOAD_ADDRESS_ULL + image_size, |
| 125 | 133 | __appended_dtb, dtb_size); |
| @@ -12,8 +12,8 @@ AFLAGS_chacha-core.o += -O2 # needed to fill branch delay slots · 11 unmodified lines | ||
| 12 | 12 | obj-$(CONFIG_CRYPTO_POLY1305_MIPS) += poly1305-mips.o |
| 13 | 13 | poly1305-mips-y := poly1305-core.o poly1305-glue.o |
| 14 | 14 | |
| 15 | −perlasm-flavour-$(CONFIG_CPU_MIPS32) := o32 | |
| 16 | −perlasm-flavour-$(CONFIG_CPU_MIPS64) := 64 | |
| 15 | +perlasm-flavour-$(CONFIG_32BIT) := o32 | |
| 16 | +perlasm-flavour-$(CONFIG_64BIT) := 64 | |
| 17 | 17 | |
| 18 | 18 | quiet_cmd_perlasm = PERLASM $@ |
| 19 | 19 | cmd_perlasm = $(PERL) $(<) $(perlasm-flavour-y) $(@) |
| @@ -24,8 +24,11 @@ extern void (*board_ebase_setup)(void); · 23 unmodified lines | ||
| 24 | 24 | extern void (*board_cache_error_setup)(void); |
| 25 | 25 | |
| 26 | 26 | extern int register_nmi_notifier(struct notifier_block *nb); |
| 27 | +extern void reserve_exception_space(phys_addr_t addr, unsigned long size); | |
| 27 | 28 | extern char except_vec_nmi[]; |
| 28 | 29 | |
| 30 | +#define VECTORSPACING 0x100 /* for EI/VI mode */ | |
| 31 | + | |
| 29 | 32 | #define nmi_notifier(fn, pri) \ |
| 30 | 33 | ({ \ |
| 31 | 34 | static struct notifier_block fn##_nb = { \ |
| @@ -26,6 +26,7 @@ · 25 unmodified lines | ||
| 26 | 26 | #include <asm/elf.h> |
| 27 | 27 | #include <asm/pgtable-bits.h> |
| 28 | 28 | #include <asm/spram.h> |
| 29 | +#include <asm/traps.h> | |
| 29 | 30 | #include <linux/uaccess.h> |
| 30 | 31 | |
| 31 | 32 | #include "fpu-probe.h" |
| @@ -1628,6 +1629,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) · 1596 unmodified lines | ||
| 1628 | 1629 | c->cputype = CPU_BMIPS3300; |
| 1629 | 1630 | __cpu_name[cpu] = "Broadcom BMIPS3300"; |
| 1630 | 1631 | set_elf_platform(cpu, "bmips3300"); |
| 1632 | + reserve_exception_space(0x400, VECTORSPACING * 64); | |
| 1631 | 1633 | break; |
| 1632 | 1634 | case PRID_IMP_BMIPS43XX: { |
| 1633 | 1635 | int rev = c->processor_id & PRID_REV_MASK; |
| @@ -1638,6 +1640,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) · 4 unmodified lines | ||
| 1638 | 1640 | __cpu_name[cpu] = "Broadcom BMIPS4380"; |
| 1639 | 1641 | set_elf_platform(cpu, "bmips4380"); |
| 1640 | 1642 | c->options |= MIPS_CPU_RIXI; |
| 1643 | + reserve_exception_space(0x400, VECTORSPACING * 64); | |
| 1641 | 1644 | } else { |
| 1642 | 1645 | c->cputype = CPU_BMIPS4350; |
| 1643 | 1646 | __cpu_name[cpu] = "Broadcom BMIPS4350"; |
| @@ -1654,6 +1657,7 @@ static inline void cpu_probe_broadcom(struct cpuinfo_mips *c, unsigned int cpu) · 10 unmodified lines | ||
| 1654 | 1657 | __cpu_name[cpu] = "Broadcom BMIPS5000"; |
| 1655 | 1658 | set_elf_platform(cpu, "bmips5000"); |
| 1656 | 1659 | c->options |= MIPS_CPU_ULRI | MIPS_CPU_RIXI; |
| 1660 | + reserve_exception_space(0x1000, VECTORSPACING * 64); | |
| 1657 | 1661 | break; |
| 1658 | 1662 | } |
| 1659 | 1663 | } |
| @@ -2133,6 +2137,8 @@ void cpu_probe(void) · 473 unmodified lines | ||
| 2133 | 2137 | if (cpu == 0) |
| 2134 | 2138 | __ua_limit = ~((1ull << cpu_vmbits) - 1); |
| 2135 | 2139 | #endif |
| 2140 | + | |
| 2141 | + reserve_exception_space(0, 0x1000); | |
| 2136 | 2142 | } |
| 2137 | 2143 | |
| 2138 | 2144 | void cpu_report(void) |
| @@ -21,6 +21,7 @@ · 20 unmodified lines | ||
| 21 | 21 | #include <asm/fpu.h> |
| 22 | 22 | #include <asm/mipsregs.h> |
| 23 | 23 | #include <asm/elf.h> |
| 24 | +#include <asm/traps.h> | |
| 24 | 25 | |
| 25 | 26 | #include "fpu-probe.h" |
| 26 | 27 | |
| @@ -158,6 +159,8 @@ void cpu_probe(void) · 131 unmodified lines | ||
| 158 | 159 | cpu_set_fpu_opts(c); |
| 159 | 160 | else |
| 160 | 161 | cpu_set_nofpu_opts(c); |
| 162 | + | |
| 163 | + reserve_exception_space(0, 0x400); | |
| 161 | 164 | } |
| 162 | 165 | |
| 163 | 166 | void cpu_report(void) |
| @@ -43,7 +43,7 @@ · 42 unmodified lines | ||
| 43 | 43 | #include <asm/prom.h> |
| 44 | 44 | |
| 45 | 45 | #ifdef CONFIG_MIPS_ELF_APPENDED_DTB |
| 46 | −const char __section(".appended_dtb") __appended_dtb[0x100000]; | |
| 46 | +char __section(".appended_dtb") __appended_dtb[0x100000]; | |
| 47 | 47 | #endif /* CONFIG_MIPS_ELF_APPENDED_DTB */ |
| 48 | 48 | |
| 49 | 49 | struct cpuinfo_mips cpu_data[NR_CPUS] __read_mostly; |
| @@ -2009,13 +2009,16 @@ void __noreturn nmi_exception_handler(struct pt_regs *regs) · 2008 unmodified lines | ||
| 2009 | 2009 | nmi_exit(); |
| 2010 | 2010 | } |
| 2011 | 2011 | |
| 2012 | −#define VECTORSPACING 0x100 /* for EI/VI mode */ | |
| 2013 | − | |
| 2014 | 2012 | unsigned long ebase; |
| 2015 | 2013 | EXPORT_SYMBOL_GPL(ebase); |
| 2016 | 2014 | unsigned long exception_handlers[32]; |
| 2017 | 2015 | unsigned long vi_handlers[64]; |
| 2018 | 2016 | |
| 2017 | +void reserve_exception_space(phys_addr_t addr, unsigned long size) | |
| 2018 | +{ | |
| 2019 | + memblock_reserve(addr, size); | |
| 2020 | +} | |
| 2021 | + | |
| 2019 | 2022 | void __init *set_except_vector(int n, void *addr) |
| 2020 | 2023 | { |
| 2021 | 2024 | unsigned long handler = (unsigned long) addr; |
| @@ -2367,10 +2370,7 @@ void __init trap_init(void) · 345 unmodified lines | ||
| 2367 | 2370 | |
| 2368 | 2371 | if (!cpu_has_mips_r2_r6) { |
| 2369 | 2372 | ebase = CAC_BASE; |
| 2370 | − ebase_pa = virt_to_phys((void *)ebase); | |
| 2371 | 2373 | vec_size = 0x400; |
| 2372 | − | |
| 2373 | − memblock_reserve(ebase_pa, vec_size); | |
| 2374 | 2374 | } else { |
| 2375 | 2375 | if (cpu_has_veic || cpu_has_vint) |
| 2376 | 2376 | vec_size = 0x200 + VECTORSPACING*64; |
| @@ -145,6 +145,7 @@ SECTIONS · 144 unmodified lines | ||
| 145 | 145 | } |
| 146 | 146 | |
| 147 | 147 | #ifdef CONFIG_MIPS_ELF_APPENDED_DTB |
| 148 | + STRUCT_ALIGN(); | |
| 148 | 149 | .appended_dtb : AT(ADDR(.appended_dtb) - LOAD_OFFSET) { |
| 149 | 150 | *(.appended_dtb) |
| 150 | 151 | KEEP(*(.appended_dtb)) |
| @@ -172,6 +173,11 @@ SECTIONS · 21 unmodified lines | ||
| 172 | 173 | #endif |
| 173 | 174 | |
| 174 | 175 | #ifdef CONFIG_MIPS_RAW_APPENDED_DTB |
| 176 | + .fill : { | |
| 177 | + FILL(0); | |
| 178 | + BYTE(0); | |
| 179 | + STRUCT_ALIGN(); | |
| 180 | + } | |
| 175 | 181 | __appended_dtb = .; |
| 176 | 182 | /* leave space for appended DTB */ |
| 177 | 183 | . += 0x100000; |
| @@ -238,7 +238,7 @@ void flush_dcache_page(struct page *page) · 237 unmodified lines | ||
| 238 | 238 | { |
| 239 | 239 | struct address_space *mapping; |
| 240 | 240 | |
| 241 | − mapping = page_mapping(page); | |
| 241 | + mapping = page_mapping_file(page); | |
| 242 | 242 | if (mapping && !mapping_mapped(mapping)) |
| 243 | 243 | set_bit(PG_dcache_dirty, &page->flags); |
| 244 | 244 | else { |
| @@ -203,9 +203,12 @@ config PREFETCH · 202 unmodified lines | ||
| 203 | 203 | def_bool y |
| 204 | 204 | depends on PA8X00 || PA7200 |
| 205 | 205 | |
| 206 | +config PARISC_HUGE_KERNEL | |
| 207 | + def_bool y if !MODULES || UBSAN || FTRACE || COMPILE_TEST | |
| 208 | + | |
| 206 | 209 | config MLONGCALLS |
| 207 | − def_bool y if !MODULES || UBSAN || FTRACE | |
| 208 | − bool "Enable the -mlong-calls compiler option for big kernels" if MODULES && !UBSAN && !FTRACE | |
| 210 | + def_bool y if PARISC_HUGE_KERNEL | |
| 211 | + bool "Enable the -mlong-calls compiler option for big kernels" if !PARISC_HUGE_KERNEL | |
| 209 | 212 | depends on PA8X00 |
| 210 | 213 | help |
| 211 | 214 | If you configure the kernel to include many drivers built-in instead |
| @@ -72,7 +72,7 @@ __cmpxchg(volatile void *ptr, unsigned long old, unsigned long new_, int size) · 71 unmodified lines | ||
| 72 | 72 | #endif |
| 73 | 73 | case 4: return __cmpxchg_u32((unsigned int *)ptr, |
| 74 | 74 | (unsigned int)old, (unsigned int)new_); |
| 75 | − case 1: return __cmpxchg_u8((u8 *)ptr, (u8)old, (u8)new_); | |
| 75 | + case 1: return __cmpxchg_u8((u8 *)ptr, old & 0xff, new_ & 0xff); | |
| 76 | 76 | } |
| 77 | 77 | __cmpxchg_called_with_bad_pointer(); |
| 78 | 78 | return old; |
| @@ -272,7 +272,6 @@ on downward growing arches, it looks like this: · 271 unmodified lines | ||
| 272 | 272 | regs->gr[23] = 0; \ |
| 273 | 273 | } while(0) |
| 274 | 274 | |
| 275 | −struct task_struct; | |
| 276 | 275 | struct mm_struct; |
| 277 | 276 | |
| 278 | 277 | /* Free all resources held by a thread. */ |
| @@ -567,8 +567,6 @@ static const struct user_regset_view user_parisc_native_view = { · 566 unmodified lines | ||
| 567 | 567 | }; |
| 568 | 568 | |
| 569 | 569 | #ifdef CONFIG_64BIT |
| 570 | −#include <linux/compat.h> | |
| 571 | − | |
| 572 | 570 | static int gpr32_get(struct task_struct *target, |
| 573 | 571 | const struct user_regset *regset, |
| 574 | 572 | struct membuf to) |
| @@ -5,34 +5,10 @@ · 4 unmodified lines | ||
| 5 | 5 | * Floating-point emulation code |
| 6 | 6 | * Copyright (C) 2001 Hewlett-Packard (Paul Bame) <bame@debian.org> |
| 7 | 7 | */ |
| 8 | −/* | |
| 9 | − * BEGIN_DESC | |
| 10 | − * | |
| 11 | − * File: | |
| 12 | − * @(#) pa/fp/fpu.h $Revision: 1.1 $ | |
| 13 | − * | |
| 14 | − * Purpose: | |
| 15 | − * <<please update with a synopis of the functionality provided by this file>> | |
| 16 | − * | |
| 17 | − * | |
| 18 | − * END_DESC | |
| 19 | −*/ | |
| 20 | − | |
| 21 | −#ifdef __NO_PA_HDRS | |
| 22 | − PA header file -- do not include this header file for non-PA builds. | |
| 23 | −#endif | |
| 24 | − | |
| 25 | 8 | |
| 26 | 9 | #ifndef _MACHINE_FPU_INCLUDED /* allows multiple inclusion */ |
| 27 | 10 | #define _MACHINE_FPU_INCLUDED |
| 28 | 11 | |
| 29 | −#if 0 | |
| 30 | −#ifndef _SYS_STDSYMS_INCLUDED | |
| 31 | −# include <sys/stdsyms.h> | |
| 32 | −#endif /* _SYS_STDSYMS_INCLUDED */ | |
| 33 | −#include <machine/pdc/pdc_rqsts.h> | |
| 34 | −#endif | |
| 35 | − | |
| 36 | 12 | #define PA83_FPU_FLAG 0x00000001 |
| 37 | 13 | #define PA89_FPU_FLAG 0x00000002 |
| 38 | 14 | #define PA2_0_FPU_FLAG 0x00000010 |
| @@ -43,21 +19,19 @@ · 4 unmodified lines | ||
| 43 | 19 | #define COPR_FP 0x00000080 /* Floating point -- Coprocessor 0 */ |
| 44 | 20 | #define SFU_MPY_DIVIDE 0x00008000 /* Multiply/Divide __ SFU 0 */ |
| 45 | 21 | |
| 46 | − | |
| 47 | 22 | #define EM_FPU_TYPE_OFFSET 272 |
| 48 | 23 | |
| 49 | 24 | /* version of EMULATION software for COPR,0,0 instruction */ |
| 50 | 25 | #define EMULATION_VERSION 4 |
| 51 | 26 | |
| 52 | 27 | /* |
| 53 | − * The only was to differeniate between TIMEX and ROLEX (or PCX-S and PCX-T) | |
| 54 | − * is thorough the potential type field from the PDC_MODEL call. The | |
| 55 | − * following flags are used at assist this differeniation. | |
| 28 | + * The only way to differentiate between TIMEX and ROLEX (or PCX-S and PCX-T) | |
| 29 | + * is through the potential type field from the PDC_MODEL call. | |
| 30 | + * The following flags are used to assist this differentiation. | |
| 56 | 31 | */ |
| 57 | 32 | |
| 58 | 33 | #define ROLEX_POTENTIAL_KEY_FLAGS PDC_MODEL_CPU_KEY_WORD_TO_IO |
| 59 | 34 | #define TIMEX_POTENTIAL_KEY_FLAGS (PDC_MODEL_CPU_KEY_QUAD_STORE | \ |
| 60 | 35 | PDC_MODEL_CPU_KEY_RECIP_SQRT) |
| 61 | 36 | |
| 62 | − | |
| 63 | 37 | #endif /* ! _MACHINE_FPU_INCLUDED */ |
| @@ -73,9 +73,10 @@ void __patch_exception(int exc, unsigned long addr); · 72 unmodified lines | ||
| 73 | 73 | #endif |
| 74 | 74 | |
| 75 | 75 | #define OP_RT_RA_MASK 0xffff0000UL |
| 76 | −#define LIS_R2 0x3c020000UL | |
| 77 | −#define ADDIS_R2_R12 0x3c4c0000UL | |
| 78 | −#define ADDI_R2_R2 0x38420000UL | |
| 76 | +#define LIS_R2 (PPC_INST_ADDIS | __PPC_RT(R2)) | |
| 77 | +#define ADDIS_R2_R12 (PPC_INST_ADDIS | __PPC_RT(R2) | __PPC_RA(R12)) | |
| 78 | +#define ADDI_R2_R2 (PPC_INST_ADDI | __PPC_RT(R2) | __PPC_RA(R2)) | |
| 79 | + | |
| 79 | 80 | |
| 80 | 81 | static inline unsigned long ppc_function_entry(void *func) |
| 81 | 82 | { |
| @@ -7,7 +7,7 @@ · 6 unmodified lines | ||
| 7 | 7 | #include <linux/bug.h> |
| 8 | 8 | #include <asm/cputable.h> |
| 9 | 9 | |
| 10 | −static inline bool early_cpu_has_feature(unsigned long feature) | |
| 10 | +static __always_inline bool early_cpu_has_feature(unsigned long feature) | |
| 11 | 11 | { |
| 12 | 12 | return !!((CPU_FTRS_ALWAYS & feature) || |
| 13 | 13 | (CPU_FTRS_POSSIBLE & cur_cpu_spec->cpu_features & feature)); |
| @@ -46,7 +46,7 @@ static __always_inline bool cpu_has_feature(unsigned long feature) · 32 unmodified lines | ||
| 46 | 46 | return static_branch_likely(&cpu_feature_keys[i]); |
| 47 | 47 | } |
| 48 | 48 | #else |
| 49 | −static inline bool cpu_has_feature(unsigned long feature) | |
| 49 | +static __always_inline bool cpu_has_feature(unsigned long feature) | |
| 50 | 50 | { |
| 51 | 51 | return early_cpu_has_feature(feature); |
| 52 | 52 | } |
| @@ -53,8 +53,8 @@ static inline void mtdcrx(unsigned int reg, unsigned int val) · 52 unmodified lines | ||
| 53 | 53 | #define mfdcr(rn) \ |
| 54 | 54 | ({unsigned int rval; \ |
| 55 | 55 | if (__builtin_constant_p(rn) && rn < 1024) \ |
| 56 | − asm volatile("mfdcr %0," __stringify(rn) \ | |
| 57 | − : "=r" (rval)); \ | |
| 56 | + asm volatile("mfdcr %0, %1" : "=r" (rval) \ | |
| 57 | + : "n" (rn)); \ | |
| 58 | 58 | else if (likely(cpu_has_feature(CPU_FTR_INDEXED_DCR))) \ |
| 59 | 59 | rval = mfdcrx(rn); \ |
| 60 | 60 | else \ |
| @@ -64,8 +64,8 @@ static inline void mtdcrx(unsigned int reg, unsigned int val) · 3 unmodified lines | ||
| 64 | 64 | #define mtdcr(rn, v) \ |
| 65 | 65 | do { \ |
| 66 | 66 | if (__builtin_constant_p(rn) && rn < 1024) \ |
| 67 | − asm volatile("mtdcr " __stringify(rn) ",%0" \ | |
| 68 | − : : "r" (v)); \ | |
| 67 | + asm volatile("mtdcr %0, %1" \ | |
| 68 | + : : "n" (rn), "r" (v)); \ | |
| 69 | 69 | else if (likely(cpu_has_feature(CPU_FTR_INDEXED_DCR))) \ |
| 70 | 70 | mtdcrx(rn, v); \ |
| 71 | 71 | else \ |
| @@ -410,7 +410,6 @@ DECLARE_INTERRUPT_HANDLER(altivec_assist_exception); · 409 unmodified lines | ||
| 410 | 410 | DECLARE_INTERRUPT_HANDLER(CacheLockingException); |
| 411 | 411 | DECLARE_INTERRUPT_HANDLER(SPEFloatingPointException); |
| 412 | 412 | DECLARE_INTERRUPT_HANDLER(SPEFloatingPointRoundException); |
| 413 | −DECLARE_INTERRUPT_HANDLER(unrecoverable_exception); | |
| 414 | 413 | DECLARE_INTERRUPT_HANDLER(WatchdogException); |
| 415 | 414 | DECLARE_INTERRUPT_HANDLER(kernel_bad_stack); |
| 416 | 415 | |
| @@ -437,6 +436,8 @@ DECLARE_INTERRUPT_HANDLER_NMI(hmi_exception_realmode); · 20 unmodified lines | ||
| 437 | 436 | |
| 438 | 437 | DECLARE_INTERRUPT_HANDLER_ASYNC(TAUException); |
| 439 | 438 | |
| 439 | +void unrecoverable_exception(struct pt_regs *regs); | |
| 440 | + | |
| 440 | 441 | void replay_system_reset(void); |
| 441 | 442 | void replay_soft_interrupts(void); |
| 442 | 443 | |
| @@ -228,7 +228,7 @@ enum { · 227 unmodified lines | ||
| 228 | 228 | #define MMU_FTRS_ALWAYS 0 |
| 229 | 229 | #endif |
| 230 | 230 | |
| 231 | −static inline bool early_mmu_has_feature(unsigned long feature) | |
| 231 | +static __always_inline bool early_mmu_has_feature(unsigned long feature) | |
| 232 | 232 | { |
| 233 | 233 | if (MMU_FTRS_ALWAYS & feature) |
| 234 | 234 | return true; |
| @@ -286,7 +286,7 @@ static inline void mmu_feature_keys_init(void) · 51 unmodified lines | ||
| 286 | 286 | |
| 287 | 287 | } |
| 288 | 288 | |
| 289 | −static inline bool mmu_has_feature(unsigned long feature) | |
| 289 | +static __always_inline bool mmu_has_feature(unsigned long feature) | |
| 290 | 290 | { |
| 291 | 291 | return early_mmu_has_feature(feature); |
| 292 | 292 | } |
| @@ -195,7 +195,7 @@ static inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc) · 194 unmodified lines | ||
| 195 | 195 | #define TRAP_FLAGS_MASK 0x11 |
| 196 | 196 | #define TRAP(regs) ((regs)->trap & ~TRAP_FLAGS_MASK) |
| 197 | 197 | #define FULL_REGS(regs) (((regs)->trap & 1) == 0) |
| 198 | −#define SET_FULL_REGS(regs) ((regs)->trap |= 1) | |
| 198 | +#define SET_FULL_REGS(regs) ((regs)->trap &= ~1) | |
| 199 | 199 | #endif |
| 200 | 200 | #define CHECK_FULL_REGS(regs) BUG_ON(!FULL_REGS(regs)) |
| 201 | 201 | #define NV_REG_POISON 0xdeadbeefdeadbeefUL |
| @@ -210,7 +210,7 @@ static inline void regs_set_return_value(struct pt_regs *regs, unsigned long rc) · 8 unmodified lines | ||
| 210 | 210 | #define TRAP_FLAGS_MASK 0x1F |
| 211 | 211 | #define TRAP(regs) ((regs)->trap & ~TRAP_FLAGS_MASK) |
| 212 | 212 | #define FULL_REGS(regs) (((regs)->trap & 1) == 0) |
| 213 | −#define SET_FULL_REGS(regs) ((regs)->trap |= 1) | |
| 213 | +#define SET_FULL_REGS(regs) ((regs)->trap &= ~1) | |
| 214 | 214 | #define IS_CRITICAL_EXC(regs) (((regs)->trap & 2) != 0) |
| 215 | 215 | #define IS_MCHECK_EXC(regs) (((regs)->trap & 4) != 0) |
| 216 | 216 | #define IS_DEBUG_EXC(regs) (((regs)->trap & 8) != 0) |
| @@ -71,6 +71,16 @@ static inline void disable_kernel_vsx(void) · 70 unmodified lines | ||
| 71 | 71 | { |
| 72 | 72 | msr_check_and_clear(MSR_FP|MSR_VEC|MSR_VSX); |
| 73 | 73 | } |
| 74 | +#else | |
| 75 | +static inline void enable_kernel_vsx(void) | |
| 76 | +{ | |
| 77 | + BUILD_BUG(); | |
| 78 | +} | |
| 79 | + | |
| 80 | +static inline void disable_kernel_vsx(void) | |
| 81 | +{ | |
| 82 | + BUILD_BUG(); | |
| 83 | +} | |
| 74 | 84 | #endif |
| 75 | 85 | |
| 76 | 86 | #ifdef CONFIG_SPE |
| @@ -113,7 +113,7 @@ struct vio_driver { · 112 unmodified lines | ||
| 113 | 113 | const char *name; |
| 114 | 114 | const struct vio_device_id *id_table; |
| 115 | 115 | int (*probe)(struct vio_dev *dev, const struct vio_device_id *id); |
| 116 | − int (*remove)(struct vio_dev *dev); | |
| 116 | + void (*remove)(struct vio_dev *dev); | |
| 117 | 117 | /* A driver must have a get_desired_dma() function to |
| 118 | 118 | * be loaded in a CMO environment if it uses DMA. |
| 119 | 119 | */ |
| @@ -191,3 +191,7 @@ $(obj)/prom_init_check: $(src)/prom_init_check.sh $(obj)/prom_init.o FORCE · 190 unmodified lines | ||
| 191 | 191 | targets += prom_init_check |
| 192 | 192 | |
| 193 | 193 | clean-files := vmlinux.lds |
| 194 | + | |
| 195 | +# Force dependency (incbin is bad) | |
| 196 | +$(obj)/vdso32_wrapper.o : $(obj)/vdso32/vdso32.so.dbg | |
| 197 | +$(obj)/vdso64_wrapper.o : $(obj)/vdso64/vdso64.so.dbg | |
| @@ -466,7 +466,7 @@ DEFINE_FIXED_SYMBOL(\name\()_common_real) · 465 unmodified lines | ||
| 466 | 466 | |
| 467 | 467 | ld r10,PACAKMSR(r13) /* get MSR value for kernel */ |
| 468 | 468 | /* MSR[RI] is clear iff using SRR regs */ |
| 469 | − .if IHSRR == EXC_HV_OR_STD | |
| 469 | + .if IHSRR_IF_HVMODE | |
| 470 | 470 | BEGIN_FTR_SECTION |
| 471 | 471 | xori r10,r10,MSR_RI |
| 472 | 472 | END_FTR_SECTION_IFCLR(CPU_FTR_HVMODE) |
| @@ -457,11 +457,12 @@ InstructionTLBMiss: · 456 unmodified lines | ||
| 457 | 457 | cmplw 0,r1,r3 |
| 458 | 458 | #endif |
| 459 | 459 | mfspr r2, SPRN_SDR1 |
| 460 | − li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC | |
| 460 | + li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC | _PAGE_USER | |
| 461 | 461 | rlwinm r2, r2, 28, 0xfffff000 |
| 462 | 462 | #ifdef CONFIG_MODULES |
| 463 | 463 | bgt- 112f |
| 464 | 464 | lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ |
| 465 | + li r1,_PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_EXEC | |
| 465 | 466 | addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ |
| 466 | 467 | #endif |
| 467 | 468 | 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ |
| @@ -520,10 +521,11 @@ DataLoadTLBMiss: · 52 unmodified lines | ||
| 520 | 521 | lis r1, TASK_SIZE@h /* check if kernel address */ |
| 521 | 522 | cmplw 0,r1,r3 |
| 522 | 523 | mfspr r2, SPRN_SDR1 |
| 523 | − li r1, _PAGE_PRESENT | _PAGE_ACCESSED | |
| 524 | + li r1, _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_USER | |
| 524 | 525 | rlwinm r2, r2, 28, 0xfffff000 |
| 525 | 526 | bgt- 112f |
| 526 | 527 | lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ |
| 528 | + li r1, _PAGE_PRESENT | _PAGE_ACCESSED | |
| 527 | 529 | addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ |
| 528 | 530 | 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ |
| 529 | 531 | lwz r2,0(r2) /* get pmd entry */ |
| @@ -597,10 +599,11 @@ DataStoreTLBMiss: · 67 unmodified lines | ||
| 597 | 599 | lis r1, TASK_SIZE@h /* check if kernel address */ |
| 598 | 600 | cmplw 0,r1,r3 |
| 599 | 601 | mfspr r2, SPRN_SDR1 |
| 600 | − li r1, _PAGE_RW | _PAGE_DIRTY | _PAGE_PRESENT | _PAGE_ACCESSED | |
| 602 | + li r1, _PAGE_RW | _PAGE_DIRTY | _PAGE_PRESENT | _PAGE_ACCESSED | _PAGE_USER | |
| 601 | 603 | rlwinm r2, r2, 28, 0xfffff000 |
| 602 | 604 | bgt- 112f |
| 603 | 605 | lis r2, (swapper_pg_dir - PAGE_OFFSET)@ha /* if kernel address, use */ |
| 606 | + li r1, _PAGE_RW | _PAGE_DIRTY | _PAGE_PRESENT | _PAGE_ACCESSED | |
| 604 | 607 | addi r2, r2, (swapper_pg_dir - PAGE_OFFSET)@l /* kernel page table */ |
| 605 | 608 | 112: rlwimi r2,r3,12,20,29 /* insert top 10 bits of address */ |
| 606 | 609 | lwz r2,0(r2) /* get pmd entry */ |
| @@ -149,7 +149,7 @@ notrace long system_call_exception(long r3, long r4, long r5, · 148 unmodified lines | ||
| 149 | 149 | * enabled when the interrupt handler returns (indicating a process-context / |
| 150 | 150 | * synchronous interrupt) then irqs_enabled should be true. |
| 151 | 151 | */ |
| 152 | −static notrace inline bool __prep_irq_for_enabled_exit(bool clear_ri) | |
| 152 | +static notrace __always_inline bool __prep_irq_for_enabled_exit(bool clear_ri) | |
| 153 | 153 | { |
| 154 | 154 | /* This must be done with RI=1 because tracing may touch vmaps */ |
| 155 | 155 | trace_hardirqs_on(); |
| @@ -436,7 +436,6 @@ again: · 280 unmodified lines | ||
| 436 | 436 | return ret; |
| 437 | 437 | } |
| 438 | 438 | |
| 439 | −void unrecoverable_exception(struct pt_regs *regs); | |
| 440 | 439 | void preempt_schedule_irq(void); |
| 441 | 440 | |
| 442 | 441 | notrace unsigned long interrupt_exit_kernel_prepare(struct pt_regs *regs, unsigned long msr) |
| @@ -6,11 +6,11 @@ · 5 unmodified lines | ||
| 6 | 6 | CFLAGS_ptrace-view.o += -DUTS_MACHINE='"$(UTS_MACHINE)"' |
| 7 | 7 | |
| 8 | 8 | obj-y += ptrace.o ptrace-view.o |
| 9 | −obj-$(CONFIG_PPC_FPU_REGS) += ptrace-fpu.o | |
| 9 | +obj-y += ptrace-fpu.o | |
| 10 | 10 | obj-$(CONFIG_COMPAT) += ptrace32.o |
| 11 | 11 | obj-$(CONFIG_VSX) += ptrace-vsx.o |
| 12 | 12 | ifneq ($(CONFIG_VSX),y) |
| 13 | −obj-$(CONFIG_PPC_FPU_REGS) += ptrace-novsx.o | |
| 13 | +obj-y += ptrace-novsx.o | |
| 14 | 14 | endif |
| 15 | 15 | obj-$(CONFIG_ALTIVEC) += ptrace-altivec.o |
| 16 | 16 | obj-$(CONFIG_SPE) += ptrace-spe.o |
| @@ -165,22 +165,8 @@ int ptrace_put_reg(struct task_struct *task, int regno, unsigned long data); · 164 unmodified lines | ||
| 165 | 165 | extern const struct user_regset_view user_ppc_native_view; |
| 166 | 166 | |
| 167 | 167 | /* ptrace-fpu */ |
| 168 | −#ifdef CONFIG_PPC_FPU_REGS | |
| 169 | 168 | int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data); |
| 170 | 169 | int ptrace_put_fpr(struct task_struct *child, int index, unsigned long data); |
| 171 | −#else | |
| 172 | −static inline int | |
| 173 | −ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data) | |
| 174 | −{ | |
| 175 | − return -EIO; | |
| 176 | −} | |
| 177 | − | |
| 178 | −static inline int | |
| 179 | −ptrace_put_fpr(struct task_struct *child, int index, unsigned long data) | |
| 180 | −{ | |
| 181 | − return -EIO; | |
| 182 | −} | |
| 183 | −#endif | |
| 184 | 170 | |
| 185 | 171 | /* ptrace-(no)adv */ |
| 186 | 172 | void ppc_gethwdinfo(struct ppc_debug_info *dbginfo); |
| @@ -8,32 +8,42 @@ · 7 unmodified lines | ||
| 8 | 8 | |
| 9 | 9 | int ptrace_get_fpr(struct task_struct *child, int index, unsigned long *data) |
| 10 | 10 | { |
| 11 | +#ifdef CONFIG_PPC_FPU_REGS | |
| 11 | 12 | unsigned int fpidx = index - PT_FPR0; |
| 13 | +#endif | |
| 12 | 14 | |
| 13 | 15 | if (index > PT_FPSCR) |
| 14 | 16 | return -EIO; |
| 15 | 17 | |
| 18 | +#ifdef CONFIG_PPC_FPU_REGS | |
| 16 | 19 | flush_fp_to_thread(child); |
| 17 | 20 | if (fpidx < (PT_FPSCR - PT_FPR0)) |
| 18 | 21 | memcpy(data, &child->thread.TS_FPR(fpidx), sizeof(long)); |
| 19 | 22 | else |
| 20 | 23 | *data = child->thread.fp_state.fpscr; |
| 24 | +#else | |
| 25 | + *data = 0; | |
| 26 | +#endif | |
| 21 | 27 | |
| 22 | 28 | return 0; |
| 23 | 29 | } |
| 24 | 30 | |
| 25 | 31 | int ptrace_put_fpr(struct task_struct *child, int index, unsigned long data) |
| 26 | 32 | { |
| 33 | +#ifdef CONFIG_PPC_FPU_REGS | |
| 27 | 34 | unsigned int fpidx = index - PT_FPR0; |
| 35 | +#endif | |
| 28 | 36 | |
| 29 | 37 | if (index > PT_FPSCR) |
| 30 | 38 | return -EIO; |
| 31 | 39 | |
| 40 | +#ifdef CONFIG_PPC_FPU_REGS | |
| 32 | 41 | flush_fp_to_thread(child); |
| 33 | 42 | if (fpidx < (PT_FPSCR - PT_FPR0)) |
| 34 | 43 | memcpy(&child->thread.TS_FPR(fpidx), &data, sizeof(long)); |
| 35 | 44 | else |
| 36 | 45 | child->thread.fp_state.fpscr = data; |
| 46 | +#endif | |
| 37 | 47 | |
| 38 | 48 | return 0; |
| 39 | 49 | } |
| @@ -21,12 +21,16 @@ · 20 unmodified lines | ||
| 21 | 21 | int fpr_get(struct task_struct *target, const struct user_regset *regset, |
| 22 | 22 | struct membuf to) |
| 23 | 23 | { |
| 24 | +#ifdef CONFIG_PPC_FPU_REGS | |
| 24 | 25 | BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != |
| 25 | 26 | offsetof(struct thread_fp_state, fpr[32])); |
| 26 | 27 | |
| 27 | 28 | flush_fp_to_thread(target); |
| 28 | 29 | |
| 29 | 30 | return membuf_write(&to, &target->thread.fp_state, 33 * sizeof(u64)); |
| 31 | +#else | |
| 32 | + return membuf_write(&to, &empty_zero_page, 33 * sizeof(u64)); | |
| 33 | +#endif | |
| 30 | 34 | } |
| 31 | 35 | |
| 32 | 36 | /* |
| @@ -46,6 +50,7 @@ int fpr_set(struct task_struct *target, const struct user_regset *regset, · 13 unmodified lines | ||
| 46 | 50 | unsigned int pos, unsigned int count, |
| 47 | 51 | const void *kbuf, const void __user *ubuf) |
| 48 | 52 | { |
| 53 | +#ifdef CONFIG_PPC_FPU_REGS | |
| 49 | 54 | BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != |
| 50 | 55 | offsetof(struct thread_fp_state, fpr[32])); |
| 51 | 56 | |
| @@ -53,4 +58,7 @@ int fpr_set(struct task_struct *target, const struct user_regset *regset, · 1 unmodified line | ||
| 53 | 58 | |
| 54 | 59 | return user_regset_copyin(&pos, &count, &kbuf, &ubuf, |
| 55 | 60 | &target->thread.fp_state, 0, -1); |
| 61 | +#else | |
| 62 | + return 0; | |
| 63 | +#endif | |
| 56 | 64 | } |
| @@ -522,13 +522,11 @@ static const struct user_regset native_regsets[] = { · 521 unmodified lines | ||
| 522 | 522 | .size = sizeof(long), .align = sizeof(long), |
| 523 | 523 | .regset_get = gpr_get, .set = gpr_set |
| 524 | 524 | }, |
| 525 | −#ifdef CONFIG_PPC_FPU_REGS | |
| 526 | 525 | [REGSET_FPR] = { |
| 527 | 526 | .core_note_type = NT_PRFPREG, .n = ELF_NFPREG, |
| 528 | 527 | .size = sizeof(double), .align = sizeof(double), |
| 529 | 528 | .regset_get = fpr_get, .set = fpr_set |
| 530 | 529 | }, |
| 531 | −#endif | |
| 532 | 530 | #ifdef CONFIG_ALTIVEC |
| 533 | 531 | [REGSET_VMX] = { |
| 534 | 532 | .core_note_type = NT_PPC_VMX, .n = 34, |
| @@ -775,7 +775,7 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, · 774 unmodified lines | ||
| 775 | 775 | else |
| 776 | 776 | prepare_save_user_regs(1); |
| 777 | 777 | |
| 778 | − if (!user_write_access_begin(frame, sizeof(*frame))) | |
| 778 | + if (!user_access_begin(frame, sizeof(*frame))) | |
| 779 | 779 | goto badframe; |
| 780 | 780 | |
| 781 | 781 | /* Put the siginfo & fill in most of the ucontext */ |
| @@ -809,17 +809,15 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, · 27 unmodified lines | ||
| 809 | 809 | unsafe_put_user(PPC_INST_ADDI + __NR_rt_sigreturn, &mctx->mc_pad[0], |
| 810 | 810 | failed); |
| 811 | 811 | unsafe_put_user(PPC_INST_SC, &mctx->mc_pad[1], failed); |
| 812 | + asm("dcbst %y0; sync; icbi %y0; sync" :: "Z" (mctx->mc_pad[0])); | |
| 812 | 813 | } |
| 813 | 814 | unsafe_put_sigset_t(&frame->uc.uc_sigmask, oldset, failed); |
| 814 | 815 | |
| 815 | − user_write_access_end(); | |
| 816 | + user_access_end(); | |
| 816 | 817 | |
| 817 | 818 | if (copy_siginfo_to_user(&frame->info, &ksig->info)) |
| 818 | 819 | goto badframe; |
| 819 | 820 | |
| 820 | − if (tramp == (unsigned long)mctx->mc_pad) | |
| 821 | − flush_icache_range(tramp, tramp + 2 * sizeof(unsigned long)); | |
| 822 | − | |
| 823 | 821 | regs->link = tramp; |
| 824 | 822 | |
| 825 | 823 | #ifdef CONFIG_PPC_FPU_REGS |
| @@ -844,7 +842,7 @@ int handle_rt_signal32(struct ksignal *ksig, sigset_t *oldset, · 18 unmodified lines | ||
| 844 | 842 | return 0; |
| 845 | 843 | |
| 846 | 844 | failed: |
| 847 | − user_write_access_end(); | |
| 845 | + user_access_end(); | |
| 848 | 846 | |
| 849 | 847 | badframe: |
| 850 | 848 | signal_fault(tsk, regs, "handle_rt_signal32", frame); |
| @@ -879,7 +877,7 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, · 28 unmodified lines | ||
| 879 | 877 | else |
| 880 | 878 | prepare_save_user_regs(1); |
| 881 | 879 | |
| 882 | − if (!user_write_access_begin(frame, sizeof(*frame))) | |
| 880 | + if (!user_access_begin(frame, sizeof(*frame))) | |
| 883 | 881 | goto badframe; |
| 884 | 882 | sc = (struct sigcontext __user *) &frame->sctx; |
| 885 | 883 | |
| @@ -908,11 +906,9 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, · 22 unmodified lines | ||
| 908 | 906 | /* Set up the sigreturn trampoline: li r0,sigret; sc */ |
| 909 | 907 | unsafe_put_user(PPC_INST_ADDI + __NR_sigreturn, &mctx->mc_pad[0], failed); |
| 910 | 908 | unsafe_put_user(PPC_INST_SC, &mctx->mc_pad[1], failed); |
| 909 | + asm("dcbst %y0; sync; icbi %y0; sync" :: "Z" (mctx->mc_pad[0])); | |
| 911 | 910 | } |
| 912 | − user_write_access_end(); | |
| 913 | − | |
| 914 | − if (tramp == (unsigned long)mctx->mc_pad) | |
| 915 | − flush_icache_range(tramp, tramp + 2 * sizeof(unsigned long)); | |
| 911 | + user_access_end(); | |
| 916 | 912 | |
| 917 | 913 | regs->link = tramp; |
| 918 | 914 | |
| @@ -935,7 +931,7 @@ int handle_signal32(struct ksignal *ksig, sigset_t *oldset, · 16 unmodified lines | ||
| 935 | 931 | return 0; |
| 936 | 932 | |
| 937 | 933 | failed: |
| 938 | − user_write_access_end(); | |
| 934 | + user_access_end(); | |
| 939 | 935 | |
| 940 | 936 | badframe: |
| 941 | 937 | signal_fault(tsk, regs, "handle_signal32", frame); |
| @@ -2170,7 +2170,7 @@ DEFINE_INTERRUPT_HANDLER(SPEFloatingPointRoundException) · 2169 unmodified lines | ||
| 2170 | 2170 | * in the MSR is 0. This indicates that SRR0/1 are live, and that |
| 2171 | 2171 | * we therefore lost state by taking this exception. |
| 2172 | 2172 | */ |
| 2173 | −DEFINE_INTERRUPT_HANDLER(unrecoverable_exception) | |
| 2173 | +void unrecoverable_exception(struct pt_regs *regs) | |
| 2174 | 2174 | { |
| 2175 | 2175 | pr_emerg("Unrecoverable exception %lx at %lx (msr=%lx)\n", |
| 2176 | 2176 | regs->trap, regs->nip, regs->msr); |
| @@ -65,3 +65,14 @@ V_FUNCTION_END(__kernel_clock_getres) · 64 unmodified lines | ||
| 65 | 65 | V_FUNCTION_BEGIN(__kernel_time) |
| 66 | 66 | cvdso_call_time __c_kernel_time |
| 67 | 67 | V_FUNCTION_END(__kernel_time) |
| 68 | + | |
| 69 | +/* Routines for restoring integer registers, called by the compiler. */ | |
| 70 | +/* Called with r11 pointing to the stack header word of the caller of the */ | |
| 71 | +/* function, just beyond the end of the integer restore area. */ | |
| 72 | +_GLOBAL(_restgpr_31_x) | |
| 73 | +_GLOBAL(_rest32gpr_31_x) | |
| 74 | + lwz r0,4(r11) | |
| 75 | + lwz r31,-4(r11) | |
| 76 | + mtlr r0 | |
| 77 | + mr r1,r11 | |
| 78 | + blr | |
| @@ -904,7 +904,7 @@ static nokprobe_inline int do_vsx_load(struct instruction_op *op, · 903 unmodified lines | ||
| 904 | 904 | if (!address_ok(regs, ea, size) || copy_mem_in(mem, ea, size, regs)) |
| 905 | 905 | return -EFAULT; |
| 906 | 906 | |
| 907 | − nr_vsx_regs = size / sizeof(__vector128); | |
| 907 | + nr_vsx_regs = max(1ul, size / sizeof(__vector128)); | |
| 908 | 908 | emulate_vsx_load(op, buf, mem, cross_endian); |
| 909 | 909 | preempt_disable(); |
| 910 | 910 | if (reg < 32) { |
| @@ -951,7 +951,7 @@ static nokprobe_inline int do_vsx_store(struct instruction_op *op, · 40 unmodified lines | ||
| 951 | 951 | if (!address_ok(regs, ea, size)) |
| 952 | 952 | return -EFAULT; |
| 953 | 953 | |
| 954 | − nr_vsx_regs = size / sizeof(__vector128); | |
| 954 | + nr_vsx_regs = max(1ul, size / sizeof(__vector128)); | |
| 955 | 955 | preempt_disable(); |
| 956 | 956 | if (reg < 32) { |
| 957 | 957 | /* FP regs + extensions */ |
| @@ -222,7 +222,7 @@ static inline void perf_get_data_addr(struct perf_event *event, struct pt_regs * · 221 unmodified lines | ||
| 222 | 222 | if (!(mmcra & MMCRA_SAMPLE_ENABLE) || sdar_valid) |
| 223 | 223 | *addrp = mfspr(SPRN_SDAR); |
| 224 | 224 | |
| 225 | − if (is_kernel_addr(mfspr(SPRN_SDAR)) && perf_allow_kernel(&event->attr) != 0) | |
| 225 | + if (is_kernel_addr(mfspr(SPRN_SDAR)) && event->attr.exclude_kernel) | |
| 226 | 226 | *addrp = 0; |
| 227 | 227 | } |
| 228 | 228 | |
| @@ -507,7 +507,7 @@ static void power_pmu_bhrb_read(struct perf_event *event, struct cpu_hw_events * · 278 unmodified lines | ||
| 507 | 507 | * addresses, hence include a check before filtering code |
| 508 | 508 | */ |
| 509 | 509 | if (!(ppmu->flags & PPMU_ARCH_31) && |
| 510 | − is_kernel_addr(addr) && perf_allow_kernel(&event->attr) != 0) | |
| 510 | + is_kernel_addr(addr) && event->attr.exclude_kernel) | |
| 511 | 511 | continue; |
| 512 | 512 | |
| 513 | 513 | /* Branches are read most recent first (ie. mfbhrb 0 is |
| @@ -887,7 +887,8 @@ static long pSeries_lpar_hpte_updatepp(unsigned long slot, · 886 unmodified lines | ||
| 887 | 887 | |
| 888 | 888 | want_v = hpte_encode_avpn(vpn, psize, ssize); |
| 889 | 889 | |
| 890 | − flags = (newpp & 7) | H_AVPN; | |
| 890 | + flags = (newpp & (HPTE_R_PP | HPTE_R_N | HPTE_R_KEY_LO)) | H_AVPN; | |
| 891 | + flags |= (newpp & HPTE_R_KEY_HI) >> 48; | |
| 891 | 892 | if (mmu_has_feature(MMU_FTR_KERNEL_RO)) |
| 892 | 893 | /* Move pp0 into bit 8 (IBM 55) */ |
| 893 | 894 | flags |= (newpp & HPTE_R_PP0) >> 55; |
| @@ -452,12 +452,28 @@ static int do_suspend(void) · 451 unmodified lines | ||
| 452 | 452 | return ret; |
| 453 | 453 | } |
| 454 | 454 | |
| 455 | +/** | |
| 456 | + * struct pseries_suspend_info - State shared between CPUs for join/suspend. | |
| 457 | + * @counter: Threads are to increment this upon resuming from suspend | |
| 458 | + * or if an error is received from H_JOIN. The thread which performs | |
| 459 | + * the first increment (i.e. sets it to 1) is responsible for | |
| 460 | + * waking the other threads. | |
| 461 | + * @done: False if join/suspend is in progress. True if the operation is | |
| 462 | + * complete (successful or not). | |
| 463 | + */ | |
| 464 | +struct pseries_suspend_info { | |
| 465 | + atomic_t counter; | |
| 466 | + bool done; | |
| 467 | +}; | |
| 468 | + | |
| 455 | 469 | static int do_join(void *arg) |
| 456 | 470 | { |
| 457 | − atomic_t *counter = arg; | |
| 471 | + struct pseries_suspend_info *info = arg; | |
| 472 | + atomic_t *counter = &info->counter; | |
| 458 | 473 | long hvrc; |
| 459 | 474 | int ret; |
| 460 | 475 | |
| 476 | +retry: | |
| 461 | 477 | /* Must ensure MSR.EE off for H_JOIN. */ |
| 462 | 478 | hard_irq_disable(); |
| 463 | 479 | hvrc = plpar_hcall_norets(H_JOIN); |
| @@ -473,8 +489,20 @@ static int do_join(void *arg) · 9 unmodified lines | ||
| 473 | 489 | case H_SUCCESS: |
| 474 | 490 | /* |
| 475 | 491 | * The suspend is complete and this cpu has received a |
| 476 | − * prod. | |
| 492 | + * prod, or we've received a stray prod from unrelated | |
| 493 | + * code (e.g. paravirt spinlocks) and we need to join | |
| 494 | + * again. | |
| 495 | + * | |
| 496 | + * This barrier orders the return from H_JOIN above vs | |
| 497 | + * the load of info->done. It pairs with the barrier | |
| 498 | + * in the wakeup/prod path below. | |
| 477 | 499 | */ |
| 500 | + smp_mb(); | |
| 501 | + if (READ_ONCE(info->done) == false) { | |
| 502 | + pr_info_ratelimited("premature return from H_JOIN on CPU %i, retrying", | |
| 503 | + smp_processor_id()); | |
| 504 | + goto retry; | |
| 505 | + } | |
| 478 | 506 | ret = 0; |
| 479 | 507 | break; |
| 480 | 508 | case H_BAD_MODE: |
| @@ -488,6 +516,13 @@ static int do_join(void *arg) · 7 unmodified lines | ||
| 488 | 516 | |
| 489 | 517 | if (atomic_inc_return(counter) == 1) { |
| 490 | 518 | pr_info("CPU %u waking all threads\n", smp_processor_id()); |
| 519 | + WRITE_ONCE(info->done, true); | |
| 520 | + /* | |
| 521 | + * This barrier orders the store to info->done vs subsequent | |
| 522 | + * H_PRODs to wake the other CPUs. It pairs with the barrier | |
| 523 | + * in the H_SUCCESS case above. | |
| 524 | + */ | |
| 525 | + smp_mb(); | |
| 491 | 526 | prod_others(); |
| 492 | 527 | } |
| 493 | 528 | /* |
| @@ -535,11 +570,16 @@ static int pseries_suspend(u64 handle) · 41 unmodified lines | ||
| 535 | 570 | int ret; |
| 536 | 571 | |
| 537 | 572 | while (true) { |
| 538 | − atomic_t counter = ATOMIC_INIT(0); | |
| 573 | + struct pseries_suspend_info info; | |
| 539 | 574 | unsigned long vasi_state; |
| 540 | 575 | int vasi_err; |
| 541 | 576 | |
| 542 | − ret = stop_machine(do_join, &counter, cpu_online_mask); | |
| 577 | + info = (struct pseries_suspend_info) { | |
| 578 | + .counter = ATOMIC_INIT(0), | |
| 579 | + .done = false, | |
| 580 | + }; | |
| 581 | + | |
| 582 | + ret = stop_machine(do_join, &info, cpu_online_mask); | |
| 543 | 583 | if (ret == 0) |
| 544 | 584 | break; |
| 545 | 585 | /* |
| @@ -4,6 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | * Copyright 2006-2007 Michael Ellerman, IBM Corp. |
| 5 | 5 | */ |
| 6 | 6 | |
| 7 | +#include <linux/crash_dump.h> | |
| 7 | 8 | #include <linux/device.h> |
| 8 | 9 | #include <linux/irq.h> |
| 9 | 10 | #include <linux/msi.h> |
| @@ -458,8 +459,28 @@ again: · 448 unmodified lines | ||
| 458 | 459 | return hwirq; |
| 459 | 460 | } |
| 460 | 461 | |
| 461 | − virq = irq_create_mapping_affinity(NULL, hwirq, | |
| 462 | − entry->affinity); | |
| 462 | + /* | |
| 463 | + * Depending on the number of online CPUs in the original | |
| 464 | + * kernel, it is likely for CPU #0 to be offline in a kdump | |
| 465 | + * kernel. The associated IRQs in the affinity mappings | |
| 466 | + * provided by irq_create_affinity_masks() are thus not | |
| 467 | + * started by irq_startup(), as per-design for managed IRQs. | |
| 468 | + * This can be a problem with multi-queue block devices driven | |
| 469 | + * by blk-mq : such a non-started IRQ is very likely paired | |
| 470 | + * with the single queue enforced by blk-mq during kdump (see | |
| 471 | + * blk_mq_alloc_tag_set()). This causes the device to remain | |
| 472 | + * silent and likely hangs the guest at some point. | |
| 473 | + * | |
| 474 | + * We don't really care for fine-grained affinity when doing | |
| 475 | + * kdump actually : simply ignore the pre-computed affinity | |
| 476 | + * masks in this case and let the default mask with all CPUs | |
| 477 | + * be used when creating the IRQ mappings. | |
| 478 | + */ | |
| 479 | + if (is_kdump_kernel()) | |
| 480 | + virq = irq_create_mapping(NULL, hwirq); | |
| 481 | + else | |
| 482 | + virq = irq_create_mapping_affinity(NULL, hwirq, | |
| 483 | + entry->affinity); | |
| 463 | 484 | |
| 464 | 485 | if (!virq) { |
| 465 | 486 | pr_debug("rtas_msi: Failed mapping hwirq %d\n", hwirq); |
| @@ -1261,7 +1261,6 @@ static int vio_bus_remove(struct device *dev) · 1260 unmodified lines | ||
| 1261 | 1261 | struct vio_dev *viodev = to_vio_dev(dev); |
| 1262 | 1262 | struct vio_driver *viodrv = to_vio_driver(dev->driver); |
| 1263 | 1263 | struct device *devptr; |
| 1264 | − int ret = 1; | |
| 1265 | 1264 | |
| 1266 | 1265 | /* |
| 1267 | 1266 | * Hold a reference to the device after the remove function is called |
| @@ -1270,13 +1269,13 @@ static int vio_bus_remove(struct device *dev) · 2 unmodified lines | ||
| 1270 | 1269 | devptr = get_device(dev); |
| 1271 | 1270 | |
| 1272 | 1271 | if (viodrv->remove) |
| 1273 | − ret = viodrv->remove(viodev); | |
| 1272 | + viodrv->remove(viodev); | |
| 1274 | 1273 | |
| 1275 | − if (!ret && firmware_has_feature(FW_FEATURE_CMO)) | |
| 1274 | + if (firmware_has_feature(FW_FEATURE_CMO)) | |
| 1276 | 1275 | vio_cmo_bus_remove(viodev); |
| 1277 | 1276 | |
| 1278 | 1277 | put_device(devptr); |
| 1279 | − return ret; | |
| 1278 | + return 0; | |
| 1280 | 1279 | } |
| 1281 | 1280 | |
| 1282 | 1281 | /** |
| @@ -93,7 +93,6 @@ config RISCV · 92 unmodified lines | ||
| 93 | 93 | select PCI_MSI if PCI |
| 94 | 94 | select RISCV_INTC |
| 95 | 95 | select RISCV_TIMER if RISCV_SBI |
| 96 | − select SPARSEMEM_STATIC if 32BIT | |
| 97 | 96 | select SPARSE_IRQ |
| 98 | 97 | select SYSCTL_EXCEPTION_TRACE |
| 99 | 98 | select THREAD_INFO_IN_TASK |
| @@ -154,7 +153,8 @@ config ARCH_FLATMEM_ENABLE · 54 unmodified lines | ||
| 154 | 153 | config ARCH_SPARSEMEM_ENABLE |
| 155 | 154 | def_bool y |
| 156 | 155 | depends on MMU |
| 157 | − select SPARSEMEM_VMEMMAP_ENABLE | |
| 156 | + select SPARSEMEM_STATIC if 32BIT && SPARSEMEM | |
| 157 | + select SPARSEMEM_VMEMMAP_ENABLE if 64BIT | |
| 158 | 158 | |
| 159 | 159 | config ARCH_SELECT_MEMORY_MODEL |
| 160 | 160 | def_bool ARCH_SPARSEMEM_ENABLE |
| @@ -314,7 +314,7 @@ endchoice · 153 unmodified lines | ||
| 314 | 314 | # Common NUMA Features |
| 315 | 315 | config NUMA |
| 316 | 316 | bool "NUMA Memory Allocation and Scheduler Support" |
| 317 | − depends on SMP | |
| 317 | + depends on SMP && MMU | |
| 318 | 318 | select GENERIC_ARCH_NUMA |
| 319 | 319 | select OF_NUMA |
| 320 | 320 | select ARCH_SUPPORTS_NUMA_BALANCING |
| @@ -31,6 +31,8 @@ config SOC_CANAAN · 30 unmodified lines | ||
| 31 | 31 | select SIFIVE_PLIC |
| 32 | 32 | select ARCH_HAS_RESET_CONTROLLER |
| 33 | 33 | select PINCTRL |
| 34 | + select COMMON_CLK | |
| 35 | + select COMMON_CLK_K210 | |
| 34 | 36 | help |
| 35 | 37 | This enables support for Canaan Kendryte K210 SoC platform hardware. |
| 36 | 38 | |
| @@ -9,4 +9,20 @@ long long __lshrti3(long long a, int b); · 8 unmodified lines | ||
| 9 | 9 | long long __ashrti3(long long a, int b); |
| 10 | 10 | long long __ashlti3(long long a, int b); |
| 11 | 11 | |
| 12 | + | |
| 13 | +#define DECLARE_DO_ERROR_INFO(name) asmlinkage void name(struct pt_regs *regs) | |
| 14 | + | |
| 15 | +DECLARE_DO_ERROR_INFO(do_trap_unknown); | |
| 16 | +DECLARE_DO_ERROR_INFO(do_trap_insn_misaligned); | |
| 17 | +DECLARE_DO_ERROR_INFO(do_trap_insn_fault); | |
| 18 | +DECLARE_DO_ERROR_INFO(do_trap_insn_illegal); | |
| 19 | +DECLARE_DO_ERROR_INFO(do_trap_load_fault); | |
| 20 | +DECLARE_DO_ERROR_INFO(do_trap_load_misaligned); | |
| 21 | +DECLARE_DO_ERROR_INFO(do_trap_store_misaligned); | |
| 22 | +DECLARE_DO_ERROR_INFO(do_trap_store_fault); | |
| 23 | +DECLARE_DO_ERROR_INFO(do_trap_ecall_u); | |
| 24 | +DECLARE_DO_ERROR_INFO(do_trap_ecall_s); | |
| 25 | +DECLARE_DO_ERROR_INFO(do_trap_ecall_m); | |
| 26 | +DECLARE_DO_ERROR_INFO(do_trap_break); | |
| 27 | + | |
| 12 | 28 | #endif /* _ASM_RISCV_PROTOTYPES_H */ |
| @@ -12,4 +12,6 @@ · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | #include <asm-generic/irq.h> |
| 14 | 14 | |
| 15 | +extern void __init init_IRQ(void); | |
| 16 | + | |
| 15 | 17 | #endif /* _ASM_RISCV_IRQ_H */ |
| @@ -71,6 +71,7 @@ int riscv_of_processor_hartid(struct device_node *node); · 70 unmodified lines | ||
| 71 | 71 | int riscv_of_parent_hartid(struct device_node *node); |
| 72 | 72 | |
| 73 | 73 | extern void riscv_fill_hwcap(void); |
| 74 | +extern int arch_dup_task_struct(struct task_struct *dst, struct task_struct *src); | |
| 74 | 75 | |
| 75 | 76 | #endif /* __ASSEMBLY__ */ |
| 76 | 77 | |
| @@ -119,6 +119,11 @@ extern int regs_query_register_offset(const char *name); · 118 unmodified lines | ||
| 119 | 119 | extern unsigned long regs_get_kernel_stack_nth(struct pt_regs *regs, |
| 120 | 120 | unsigned int n); |
| 121 | 121 | |
| 122 | +void prepare_ftrace_return(unsigned long *parent, unsigned long self_addr, | |
| 123 | + unsigned long frame_pointer); | |
| 124 | +int do_syscall_trace_enter(struct pt_regs *regs); | |
| 125 | +void do_syscall_trace_exit(struct pt_regs *regs); | |
| 126 | + | |
| 122 | 127 | /** |
| 123 | 128 | * regs_get_register() - get register value from its offset |
| 124 | 129 | * @regs: pt_regs from which register value is gotten |
| @@ -51,10 +51,10 @@ enum sbi_ext_rfence_fid { · 50 unmodified lines | ||
| 51 | 51 | SBI_EXT_RFENCE_REMOTE_FENCE_I = 0, |
| 52 | 52 | SBI_EXT_RFENCE_REMOTE_SFENCE_VMA, |
| 53 | 53 | SBI_EXT_RFENCE_REMOTE_SFENCE_VMA_ASID, |
| 54 | − SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA, | |
| 55 | 54 | SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA_VMID, |
| 56 | − SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA, | |
| 55 | + SBI_EXT_RFENCE_REMOTE_HFENCE_GVMA, | |
| 57 | 56 | SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA_ASID, |
| 57 | + SBI_EXT_RFENCE_REMOTE_HFENCE_VVMA, | |
| 58 | 58 | }; |
| 59 | 59 | |
| 60 | 60 | enum sbi_ext_hsm_fid { |
| @@ -88,4 +88,6 @@ static inline int read_current_timer(unsigned long *timer_val) · 87 unmodified lines | ||
| 88 | 88 | return 0; |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | +extern void time_init(void); | |
| 92 | + | |
| 91 | 93 | #endif /* _ASM_RISCV_TIMEX_H */ |
| @@ -306,7 +306,9 @@ do { \ · 305 unmodified lines | ||
| 306 | 306 | * data types like structures or arrays. |
| 307 | 307 | * |
| 308 | 308 | * @ptr must have pointer-to-simple-variable type, and @x must be assignable |
| 309 | − * to the result of dereferencing @ptr. | |
| 309 | + * to the result of dereferencing @ptr. The value of @x is copied to avoid | |
| 310 | + * re-ordering where @x is evaluated inside the block that enables user-space | |
| 311 | + * access (thus bypassing user space protection if @x is a function). | |
| 310 | 312 | * |
| 311 | 313 | * Caller must check the pointer with access_ok() before calling this |
| 312 | 314 | * function. |
| @@ -316,12 +318,13 @@ do { \ · 3 unmodified lines | ||
| 316 | 318 | #define __put_user(x, ptr) \ |
| 317 | 319 | ({ \ |
| 318 | 320 | __typeof__(*(ptr)) __user *__gu_ptr = (ptr); \ |
| 321 | + __typeof__(*__gu_ptr) __val = (x); \ | |
| 319 | 322 | long __pu_err = 0; \ |
| 320 | 323 | \ |
| 321 | 324 | __chk_user_ptr(__gu_ptr); \ |
| 322 | 325 | \ |
| 323 | 326 | __enable_user_access(); \ |
| 324 | − __put_user_nocheck(x, __gu_ptr, __pu_err); \ | |
| 327 | + __put_user_nocheck(__val, __gu_ptr, __pu_err); \ | |
| 325 | 328 | __disable_user_access(); \ |
| 326 | 329 | \ |
| 327 | 330 | __pu_err; \ |
| @@ -8,6 +8,7 @@ CFLAGS_REMOVE_ftrace.o = $(CC_FLAGS_FTRACE) · 7 unmodified lines | ||
| 8 | 8 | CFLAGS_REMOVE_patch.o = $(CC_FLAGS_FTRACE) |
| 9 | 9 | CFLAGS_REMOVE_sbi.o = $(CC_FLAGS_FTRACE) |
| 10 | 10 | endif |
| 11 | +CFLAGS_syscall_table.o += $(call cc-option,-Wno-override-init,) | |
| 11 | 12 | |
| 12 | 13 | extra-y += head.o |
| 13 | 14 | extra-y += vmlinux.lds |
| @@ -130,6 +130,9 @@ skip_context_tracking: · 129 unmodified lines | ||
| 130 | 130 | */ |
| 131 | 131 | andi t0, s1, SR_PIE |
| 132 | 132 | beqz t0, 1f |
| 133 | + /* kprobes, entered via ebreak, must have interrupts disabled. */ | |
| 134 | + li t0, EXC_BREAKPOINT | |
| 135 | + beq s4, t0, 1f | |
| 133 | 136 | #ifdef CONFIG_TRACE_IRQFLAGS |
| 134 | 137 | call trace_hardirqs_on |
| 135 | 138 | #endif |
| @@ -447,6 +450,7 @@ ENDPROC(__switch_to) · 311 unmodified lines | ||
| 447 | 450 | #endif |
| 448 | 451 | |
| 449 | 452 | .section ".rodata" |
| 453 | + .align LGREG | |
| 450 | 454 | /* Exception vector table */ |
| 451 | 455 | ENTRY(excp_vect_table) |
| 452 | 456 | RISCV_PTR do_trap_insn_misaligned |
| @@ -2,39 +2,47 @@ · 1 unmodified line | ||
| 2 | 2 | |
| 3 | 3 | #include <linux/kprobes.h> |
| 4 | 4 | |
| 5 | −/* Ftrace callback handler for kprobes -- called under preepmt disabed */ | |
| 5 | +/* Ftrace callback handler for kprobes -- called under preepmt disabled */ | |
| 6 | 6 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, |
| 7 | − struct ftrace_ops *ops, struct ftrace_regs *regs) | |
| 7 | + struct ftrace_ops *ops, struct ftrace_regs *fregs) | |
| 8 | 8 | { |
| 9 | 9 | struct kprobe *p; |
| 10 | + struct pt_regs *regs; | |
| 10 | 11 | struct kprobe_ctlblk *kcb; |
| 12 | + int bit; | |
| 11 | 13 | |
| 14 | + bit = ftrace_test_recursion_trylock(ip, parent_ip); | |
| 15 | + if (bit < 0) | |
| 16 | + return; | |
| 17 | + | |
| 18 | + preempt_disable_notrace(); | |
| 12 | 19 | p = get_kprobe((kprobe_opcode_t *)ip); |
| 13 | 20 | if (unlikely(!p) || kprobe_disabled(p)) |
| 14 | − return; | |
| 21 | + goto out; | |
| 15 | 22 | |
| 23 | + regs = ftrace_get_regs(fregs); | |
| 16 | 24 | kcb = get_kprobe_ctlblk(); |
| 17 | 25 | if (kprobe_running()) { |
| 18 | 26 | kprobes_inc_nmissed_count(p); |
| 19 | 27 | } else { |
| 20 | − unsigned long orig_ip = instruction_pointer(&(regs->regs)); | |
| 28 | + unsigned long orig_ip = instruction_pointer(regs); | |
| 21 | 29 | |
| 22 | − instruction_pointer_set(&(regs->regs), ip); | |
| 30 | + instruction_pointer_set(regs, ip); | |
| 23 | 31 | |
| 24 | 32 | __this_cpu_write(current_kprobe, p); |
| 25 | 33 | kcb->kprobe_status = KPROBE_HIT_ACTIVE; |
| 26 | − if (!p->pre_handler || !p->pre_handler(p, &(regs->regs))) { | |
| 34 | + if (!p->pre_handler || !p->pre_handler(p, regs)) { | |
| 27 | 35 | /* |
| 28 | 36 | * Emulate singlestep (and also recover regs->pc) |
| 29 | 37 | * as if there is a nop |
| 30 | 38 | */ |
| 31 | − instruction_pointer_set(&(regs->regs), | |
| 39 | + instruction_pointer_set(regs, | |
| 32 | 40 | (unsigned long)p->addr + MCOUNT_INSN_SIZE); |
| 33 | 41 | if (unlikely(p->post_handler)) { |
| 34 | 42 | kcb->kprobe_status = KPROBE_HIT_SSDONE; |
| 35 | − p->post_handler(p, &(regs->regs), 0); | |
| 43 | + p->post_handler(p, regs, 0); | |
| 36 | 44 | } |
| 37 | − instruction_pointer_set(&(regs->regs), orig_ip); | |
| 45 | + instruction_pointer_set(regs, orig_ip); | |
| 38 | 46 | } |
| 39 | 47 | |
| 40 | 48 | /* |
| @@ -43,6 +51,9 @@ void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, · 2 unmodified lines | ||
| 43 | 51 | */ |
| 44 | 52 | __this_cpu_write(current_kprobe, NULL); |
| 45 | 53 | } |
| 54 | +out: | |
| 55 | + preempt_enable_notrace(); | |
| 56 | + ftrace_test_recursion_unlock(bit); | |
| 46 | 57 | } |
| 47 | 58 | NOKPROBE_SYMBOL(kprobe_ftrace_handler); |
| 48 | 59 | |
| @@ -256,8 +256,7 @@ int __kprobes kprobe_fault_handler(struct pt_regs *regs, unsigned int trapnr) · 255 unmodified lines | ||
| 256 | 256 | * normal page fault. |
| 257 | 257 | */ |
| 258 | 258 | regs->epc = (unsigned long) cur->addr; |
| 259 | − if (!instruction_pointer(regs)) | |
| 260 | − BUG(); | |
| 259 | + BUG_ON(!instruction_pointer(regs)); | |
| 261 | 260 | |
| 262 | 261 | if (kcb->kprobe_status == KPROBE_REENTER) |
| 263 | 262 | restore_previous_kprobe(kcb); |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | #include <linux/cpu.h> |
| 11 | 11 | #include <linux/kernel.h> |
| 12 | 12 | #include <linux/sched.h> |
| 13 | +#include <linux/sched/debug.h> | |
| 13 | 14 | #include <linux/sched/task_stack.h> |
| 14 | 15 | #include <linux/tick.h> |
| 15 | 16 | #include <linux/ptrace.h> |
| @@ -116,7 +116,7 @@ void sbi_clear_ipi(void) · 115 unmodified lines | ||
| 116 | 116 | EXPORT_SYMBOL(sbi_clear_ipi); |
| 117 | 117 | |
| 118 | 118 | /** |
| 119 | − * sbi_set_timer_v01() - Program the timer for next timer event. | |
| 119 | + * __sbi_set_timer_v01() - Program the timer for next timer event. | |
| 120 | 120 | * @stime_value: The value after which next timer event should fire. |
| 121 | 121 | * |
| 122 | 122 | * Return: None |
| @@ -147,7 +147,8 @@ static void __init init_resources(void) · 146 unmodified lines | ||
| 147 | 147 | bss_res.end = __pa_symbol(__bss_stop) - 1; |
| 148 | 148 | bss_res.flags = IORESOURCE_SYSTEM_RAM | IORESOURCE_BUSY; |
| 149 | 149 | |
| 150 | − mem_res_sz = (memblock.memory.cnt + memblock.reserved.cnt) * sizeof(*mem_res); | |
| 150 | + /* + 1 as memblock_alloc() might increase memblock.reserved.cnt */ | |
| 151 | + mem_res_sz = (memblock.memory.cnt + memblock.reserved.cnt + 1) * sizeof(*mem_res); | |
| 151 | 152 | mem_res = memblock_alloc(mem_res_sz, SMP_CACHE_BYTES); |
| 152 | 153 | if (!mem_res) |
| 153 | 154 | panic("%s: Failed to allocate %zu bytes\n", __func__, mem_res_sz); |
| @@ -14,7 +14,7 @@ · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | #include <asm/stacktrace.h> |
| 16 | 16 | |
| 17 | −register const unsigned long sp_in_global __asm__("sp"); | |
| 17 | +register unsigned long sp_in_global __asm__("sp"); | |
| 18 | 18 | |
| 19 | 19 | #ifdef CONFIG_FRAME_POINTER |
| 20 | 20 | |
| @@ -9,6 +9,7 @@ · 8 unmodified lines | ||
| 9 | 9 | #include <linux/delay.h> |
| 10 | 10 | #include <asm/sbi.h> |
| 11 | 11 | #include <asm/processor.h> |
| 12 | +#include <asm/timex.h> | |
| 12 | 13 | |
| 13 | 14 | unsigned long riscv_timebase; |
| 14 | 15 | EXPORT_SYMBOL_GPL(riscv_timebase); |
| @@ -17,6 +17,7 @@ · 16 unmodified lines | ||
| 17 | 17 | #include <linux/module.h> |
| 18 | 18 | #include <linux/irq.h> |
| 19 | 19 | |
| 20 | +#include <asm/asm-prototypes.h> | |
| 20 | 21 | #include <asm/bug.h> |
| 21 | 22 | #include <asm/processor.h> |
| 22 | 23 | #include <asm/ptrace.h> |
| @@ -177,6 +178,7 @@ asmlinkage __visible void do_trap_break(struct pt_regs *regs) · 154 unmodified lines | ||
| 177 | 178 | else |
| 178 | 179 | die(regs, "Kernel BUG"); |
| 179 | 180 | } |
| 181 | +NOKPROBE_SYMBOL(do_trap_break); | |
| 180 | 182 | |
| 181 | 183 | #ifdef CONFIG_GENERIC_BUG |
| 182 | 184 | int is_valid_bugaddr(unsigned long pc) |
| @@ -328,3 +328,4 @@ good_area: · 327 unmodified lines | ||
| 328 | 328 | } |
| 329 | 329 | return; |
| 330 | 330 | } |
| 331 | +NOKPROBE_SYMBOL(do_page_fault); | |
| @@ -155,7 +155,7 @@ static void __init kasan_populate(void *start, void *end) · 154 unmodified lines | ||
| 155 | 155 | memset(start, KASAN_SHADOW_INIT, end - start); |
| 156 | 156 | } |
| 157 | 157 | |
| 158 | −void __init kasan_shallow_populate(void *start, void *end) | |
| 158 | +static void __init kasan_shallow_populate(void *start, void *end) | |
| 159 | 159 | { |
| 160 | 160 | unsigned long vaddr = (unsigned long)start & PAGE_MASK; |
| 161 | 161 | unsigned long vend = PAGE_ALIGN((unsigned long)end); |
| @@ -187,6 +187,8 @@ void __init kasan_shallow_populate(void *start, void *end) · 25 unmodified lines | ||
| 187 | 187 | } |
| 188 | 188 | vaddr += PAGE_SIZE; |
| 189 | 189 | } |
| 190 | + | |
| 191 | + local_flush_tlb_all(); | |
| 190 | 192 | } |
| 191 | 193 | |
| 192 | 194 | void __init kasan_init(void) |
| @@ -214,7 +216,7 @@ void __init kasan_init(void) · 21 unmodified lines | ||
| 214 | 216 | break; |
| 215 | 217 | |
| 216 | 218 | kasan_populate(kasan_mem_to_shadow(start), kasan_mem_to_shadow(end)); |
| 217 | − }; | |
| 219 | + } | |
| 218 | 220 | |
| 219 | 221 | for (i = 0; i < PTRS_PER_PTE; i++) |
| 220 | 222 | set_pte(&kasan_early_shadow_pte[i], |
| @@ -275,9 +275,9 @@ CONFIG_IP_VS_DH=m · 274 unmodified lines | ||
| 275 | 275 | CONFIG_IP_VS_SH=m |
| 276 | 276 | CONFIG_IP_VS_SED=m |
| 277 | 277 | CONFIG_IP_VS_NQ=m |
| 278 | +CONFIG_IP_VS_TWOS=m | |
| 278 | 279 | CONFIG_IP_VS_FTP=m |
| 279 | 280 | CONFIG_IP_VS_PE_SIP=m |
| 280 | −CONFIG_NF_TABLES_IPV4=y | |
| 281 | 281 | CONFIG_NFT_FIB_IPV4=m |
| 282 | 282 | CONFIG_NF_TABLES_ARP=y |
| 283 | 283 | CONFIG_IP_NF_IPTABLES=m |
| @@ -298,7 +298,6 @@ CONFIG_IP_NF_SECURITY=m · 14 unmodified lines | ||
| 298 | 298 | CONFIG_IP_NF_ARPTABLES=m |
| 299 | 299 | CONFIG_IP_NF_ARPFILTER=m |
| 300 | 300 | CONFIG_IP_NF_ARP_MANGLE=m |
| 301 | −CONFIG_NF_TABLES_IPV6=y | |
| 302 | 301 | CONFIG_NFT_FIB_IPV6=m |
| 303 | 302 | CONFIG_IP6_NF_IPTABLES=m |
| 304 | 303 | CONFIG_IP6_NF_MATCH_AH=m |
| @@ -481,7 +480,6 @@ CONFIG_NLMON=m · 176 unmodified lines | ||
| 481 | 480 | # CONFIG_NET_VENDOR_AQUANTIA is not set |
| 482 | 481 | # CONFIG_NET_VENDOR_ARC is not set |
| 483 | 482 | # CONFIG_NET_VENDOR_ATHEROS is not set |
| 484 | −# CONFIG_NET_VENDOR_AURORA is not set | |
| 485 | 483 | # CONFIG_NET_VENDOR_BROADCOM is not set |
| 486 | 484 | # CONFIG_NET_VENDOR_BROCADE is not set |
| 487 | 485 | # CONFIG_NET_VENDOR_CADENCE is not set |
| @@ -581,7 +579,6 @@ CONFIG_VIRTIO_BALLOON=m · 93 unmodified lines | ||
| 581 | 579 | CONFIG_VIRTIO_INPUT=y |
| 582 | 580 | CONFIG_VHOST_NET=m |
| 583 | 581 | CONFIG_VHOST_VSOCK=m |
| 584 | −# CONFIG_SURFACE_PLATFORMS is not set | |
| 585 | 582 | CONFIG_S390_CCW_IOMMU=y |
| 586 | 583 | CONFIG_S390_AP_IOMMU=y |
| 587 | 584 | CONFIG_EXT4_FS=y |
| @@ -635,6 +632,7 @@ CONFIG_NTFS_RW=y · 47 unmodified lines | ||
| 635 | 632 | CONFIG_PROC_KCORE=y |
| 636 | 633 | CONFIG_TMPFS=y |
| 637 | 634 | CONFIG_TMPFS_POSIX_ACL=y |
| 635 | +CONFIG_TMPFS_INODE64=y | |
| 638 | 636 | CONFIG_HUGETLBFS=y |
| 639 | 637 | CONFIG_CONFIGFS_FS=m |
| 640 | 638 | CONFIG_ECRYPT_FS=m |
| @@ -714,12 +712,8 @@ CONFIG_CRYPTO_VMAC=m · 73 unmodified lines | ||
| 714 | 712 | CONFIG_CRYPTO_CRC32=m |
| 715 | 713 | CONFIG_CRYPTO_BLAKE2S=m |
| 716 | 714 | CONFIG_CRYPTO_MICHAEL_MIC=m |
| 717 | −CONFIG_CRYPTO_RMD128=m | |
| 718 | 715 | CONFIG_CRYPTO_RMD160=m |
| 719 | −CONFIG_CRYPTO_RMD256=m | |
| 720 | −CONFIG_CRYPTO_RMD320=m | |
| 721 | 716 | CONFIG_CRYPTO_SHA3=m |
| 722 | −CONFIG_CRYPTO_TGR192=m | |
| 723 | 717 | CONFIG_CRYPTO_WP512=m |
| 724 | 718 | CONFIG_CRYPTO_AES_TI=m |
| 725 | 719 | CONFIG_CRYPTO_ANUBIS=m |
| @@ -731,7 +725,6 @@ CONFIG_CRYPTO_CAST6=m · 5 unmodified lines | ||
| 731 | 725 | CONFIG_CRYPTO_DES=m |
| 732 | 726 | CONFIG_CRYPTO_FCRYPT=m |
| 733 | 727 | CONFIG_CRYPTO_KHAZAD=m |
| 734 | −CONFIG_CRYPTO_SALSA20=m | |
| 735 | 728 | CONFIG_CRYPTO_SEED=m |
| 736 | 729 | CONFIG_CRYPTO_SERPENT=m |
| 737 | 730 | CONFIG_CRYPTO_SM4=m |
| @@ -796,12 +789,9 @@ CONFIG_DEBUG_OBJECTS_RCU_HEAD=y · 58 unmodified lines | ||
| 796 | 789 | CONFIG_DEBUG_OBJECTS_PERCPU_COUNTER=y |
| 797 | 790 | CONFIG_SLUB_DEBUG_ON=y |
| 798 | 791 | CONFIG_SLUB_STATS=y |
| 799 | −CONFIG_DEBUG_KMEMLEAK=y | |
| 800 | −CONFIG_DEBUG_KMEMLEAK_DEFAULT_OFF=y | |
| 801 | 792 | CONFIG_DEBUG_STACK_USAGE=y |
| 802 | 793 | CONFIG_DEBUG_VM=y |
| 803 | 794 | CONFIG_DEBUG_VM_VMACACHE=y |
| 804 | −CONFIG_DEBUG_VM_RB=y | |
| 805 | 795 | CONFIG_DEBUG_VM_PGFLAGS=y |
| 806 | 796 | CONFIG_DEBUG_MEMORY_INIT=y |
| 807 | 797 | CONFIG_MEMORY_NOTIFIER_ERROR_INJECT=m |
| @@ -838,6 +828,7 @@ CONFIG_BPF_KPROBE_OVERRIDE=y · 30 unmodified lines | ||
| 838 | 828 | CONFIG_HIST_TRIGGERS=y |
| 839 | 829 | CONFIG_FTRACE_STARTUP_TEST=y |
| 840 | 830 | # CONFIG_EVENT_TRACE_STARTUP_TEST is not set |
| 831 | +CONFIG_DEBUG_ENTRY=y | |
| 841 | 832 | CONFIG_NOTIFIER_ERROR_INJECTION=m |
| 842 | 833 | CONFIG_NETDEV_NOTIFIER_ERROR_INJECT=m |
| 843 | 834 | CONFIG_FAULT_INJECTION=y |
| @@ -861,4 +852,3 @@ CONFIG_PERCPU_TEST=m · 17 unmodified lines | ||
| 861 | 852 | CONFIG_ATOMIC64_SELFTEST=y |
| 862 | 853 | CONFIG_TEST_BITOPS=m |
| 863 | 854 | CONFIG_TEST_BPF=m |
| 864 | −CONFIG_DEBUG_ENTRY=y | |
| @@ -266,9 +266,9 @@ CONFIG_IP_VS_DH=m · 265 unmodified lines | ||
| 266 | 266 | CONFIG_IP_VS_SH=m |
| 267 | 267 | CONFIG_IP_VS_SED=m |
| 268 | 268 | CONFIG_IP_VS_NQ=m |
| 269 | +CONFIG_IP_VS_TWOS=m | |
| 269 | 270 | CONFIG_IP_VS_FTP=m |
| 270 | 271 | CONFIG_IP_VS_PE_SIP=m |
| 271 | −CONFIG_NF_TABLES_IPV4=y | |
| 272 | 272 | CONFIG_NFT_FIB_IPV4=m |
| 273 | 273 | CONFIG_NF_TABLES_ARP=y |
| 274 | 274 | CONFIG_IP_NF_IPTABLES=m |
| @@ -289,7 +289,6 @@ CONFIG_IP_NF_SECURITY=m · 14 unmodified lines | ||
| 289 | 289 | CONFIG_IP_NF_ARPTABLES=m |
| 290 | 290 | CONFIG_IP_NF_ARPFILTER=m |
| 291 | 291 | CONFIG_IP_NF_ARP_MANGLE=m |
| 292 | −CONFIG_NF_TABLES_IPV6=y | |
| 293 | 292 | CONFIG_NFT_FIB_IPV6=m |
| 294 | 293 | CONFIG_IP6_NF_IPTABLES=m |
| 295 | 294 | CONFIG_IP6_NF_MATCH_AH=m |
| @@ -473,7 +472,6 @@ CONFIG_NLMON=m · 177 unmodified lines | ||
| 473 | 472 | # CONFIG_NET_VENDOR_AQUANTIA is not set |
| 474 | 473 | # CONFIG_NET_VENDOR_ARC is not set |
| 475 | 474 | # CONFIG_NET_VENDOR_ATHEROS is not set |
| 476 | −# CONFIG_NET_VENDOR_AURORA is not set | |
| 477 | 475 | # CONFIG_NET_VENDOR_BROADCOM is not set |
| 478 | 476 | # CONFIG_NET_VENDOR_BROCADE is not set |
| 479 | 477 | # CONFIG_NET_VENDOR_CADENCE is not set |
| @@ -573,7 +571,6 @@ CONFIG_VIRTIO_BALLOON=m · 93 unmodified lines | ||
| 573 | 571 | CONFIG_VIRTIO_INPUT=y |
| 574 | 572 | CONFIG_VHOST_NET=m |
| 575 | 573 | CONFIG_VHOST_VSOCK=m |
| 576 | −# CONFIG_SURFACE_PLATFORMS is not set | |
| 577 | 574 | CONFIG_S390_CCW_IOMMU=y |
| 578 | 575 | CONFIG_S390_AP_IOMMU=y |
| 579 | 576 | CONFIG_EXT4_FS=y |
| @@ -623,6 +620,7 @@ CONFIG_NTFS_RW=y · 43 unmodified lines | ||
| 623 | 620 | CONFIG_PROC_KCORE=y |
| 624 | 621 | CONFIG_TMPFS=y |
| 625 | 622 | CONFIG_TMPFS_POSIX_ACL=y |
| 623 | +CONFIG_TMPFS_INODE64=y | |
| 626 | 624 | CONFIG_HUGETLBFS=y |
| 627 | 625 | CONFIG_CONFIGFS_FS=m |
| 628 | 626 | CONFIG_ECRYPT_FS=m |
| @@ -703,12 +701,8 @@ CONFIG_CRYPTO_VMAC=m · 74 unmodified lines | ||
| 703 | 701 | CONFIG_CRYPTO_CRC32=m |
| 704 | 702 | CONFIG_CRYPTO_BLAKE2S=m |
| 705 | 703 | CONFIG_CRYPTO_MICHAEL_MIC=m |
| 706 | −CONFIG_CRYPTO_RMD128=m | |
| 707 | 704 | CONFIG_CRYPTO_RMD160=m |
| 708 | −CONFIG_CRYPTO_RMD256=m | |
| 709 | −CONFIG_CRYPTO_RMD320=m | |
| 710 | 705 | CONFIG_CRYPTO_SHA3=m |
| 711 | −CONFIG_CRYPTO_TGR192=m | |
| 712 | 706 | CONFIG_CRYPTO_WP512=m |
| 713 | 707 | CONFIG_CRYPTO_AES_TI=m |
| 714 | 708 | CONFIG_CRYPTO_ANUBIS=m |
| @@ -720,7 +714,6 @@ CONFIG_CRYPTO_CAST6=m · 5 unmodified lines | ||
| 720 | 714 | CONFIG_CRYPTO_DES=m |
| 721 | 715 | CONFIG_CRYPTO_FCRYPT=m |
| 722 | 716 | CONFIG_CRYPTO_KHAZAD=m |
| 723 | −CONFIG_CRYPTO_SALSA20=m | |
| 724 | 717 | CONFIG_CRYPTO_SEED=m |
| 725 | 718 | CONFIG_CRYPTO_SERPENT=m |
| 726 | 719 | CONFIG_CRYPTO_SM4=m |
| @@ -26,7 +26,6 @@ CONFIG_CRASH_DUMP=y · 25 unmodified lines | ||
| 26 | 26 | # CONFIG_SECCOMP is not set |
| 27 | 27 | # CONFIG_GCC_PLUGINS is not set |
| 28 | 28 | CONFIG_PARTITION_ADVANCED=y |
| 29 | −CONFIG_IBM_PARTITION=y | |
| 30 | 29 | # CONFIG_CORE_DUMP_DEFAULT_ELF_HEADERS is not set |
| 31 | 30 | # CONFIG_COMPACTION is not set |
| 32 | 31 | # CONFIG_MIGRATION is not set |
| @@ -61,11 +60,9 @@ CONFIG_RAW_DRIVER=y · 28 unmodified lines | ||
| 61 | 60 | # CONFIG_HID is not set |
| 62 | 61 | # CONFIG_VIRTIO_MENU is not set |
| 63 | 62 | # CONFIG_VHOST_MENU is not set |
| 64 | −# CONFIG_SURFACE_PLATFORMS is not set | |
| 65 | 63 | # CONFIG_IOMMU_SUPPORT is not set |
| 66 | 64 | # CONFIG_DNOTIFY is not set |
| 67 | 65 | # CONFIG_INOTIFY_USER is not set |
| 68 | −CONFIG_CONFIGFS_FS=y | |
| 69 | 66 | # CONFIG_MISC_FILESYSTEMS is not set |
| 70 | 67 | # CONFIG_NETWORK_FILESYSTEMS is not set |
| 71 | 68 | CONFIG_LSM="yama,loadpin,safesetid,integrity" |
| @@ -14,12 +14,12 @@ · 13 unmodified lines | ||
| 14 | 14 | |
| 15 | 15 | struct s390_idle_data { |
| 16 | 16 | seqcount_t seqcount; |
| 17 | − unsigned long long idle_count; | |
| 18 | − unsigned long long idle_time; | |
| 19 | − unsigned long long clock_idle_enter; | |
| 20 | − unsigned long long clock_idle_exit; | |
| 21 | − unsigned long long timer_idle_enter; | |
| 22 | − unsigned long long timer_idle_exit; | |
| 17 | + unsigned long idle_count; | |
| 18 | + unsigned long idle_time; | |
| 19 | + unsigned long clock_idle_enter; | |
| 20 | + unsigned long clock_idle_exit; | |
| 21 | + unsigned long timer_idle_enter; | |
| 22 | + unsigned long timer_idle_exit; | |
| 23 | 23 | unsigned long mt_cycles_enter[8]; |
| 24 | 24 | }; |
| 25 | 25 | |
| @@ -202,7 +202,7 @@ extern unsigned int s390_pci_no_rid; · 201 unmodified lines | ||
| 202 | 202 | ----------------------------------------------------------------------------- */ |
| 203 | 203 | /* Base stuff */ |
| 204 | 204 | int zpci_create_device(u32 fid, u32 fh, enum zpci_state state); |
| 205 | −void zpci_remove_device(struct zpci_dev *zdev); | |
| 205 | +void zpci_remove_device(struct zpci_dev *zdev, bool set_error); | |
| 206 | 206 | int zpci_enable_device(struct zpci_dev *); |
| 207 | 207 | int zpci_disable_device(struct zpci_dev *); |
| 208 | 208 | int zpci_register_ioat(struct zpci_dev *, u8, u64, u64, u64); |
| @@ -12,6 +12,7 @@ enum stack_type { · 11 unmodified lines | ||
| 12 | 12 | STACK_TYPE_IRQ, |
| 13 | 13 | STACK_TYPE_NODAT, |
| 14 | 14 | STACK_TYPE_RESTART, |
| 15 | + STACK_TYPE_MCCK, | |
| 15 | 16 | }; |
| 16 | 17 | |
| 17 | 18 | struct stack_info { |
| @@ -98,10 +98,10 @@ extern unsigned char ptff_function_mask[16]; · 97 unmodified lines | ||
| 98 | 98 | |
| 99 | 99 | /* Query TOD offset result */ |
| 100 | 100 | struct ptff_qto { |
| 101 | − unsigned long long physical_clock; | |
| 102 | − unsigned long long tod_offset; | |
| 103 | − unsigned long long logical_tod_offset; | |
| 104 | − unsigned long long tod_epoch_difference; | |
| 101 | + unsigned long physical_clock; | |
| 102 | + unsigned long tod_offset; | |
| 103 | + unsigned long logical_tod_offset; | |
| 104 | + unsigned long tod_epoch_difference; | |
| 105 | 105 | } __packed; |
| 106 | 106 | |
| 107 | 107 | static inline int ptff_query(unsigned int nr) |
| @@ -151,9 +151,9 @@ struct ptff_qui { · 43 unmodified lines | ||
| 151 | 151 | rc; \ |
| 152 | 152 | }) |
| 153 | 153 | |
| 154 | −static inline unsigned long long local_tick_disable(void) | |
| 154 | +static inline unsigned long local_tick_disable(void) | |
| 155 | 155 | { |
| 156 | − unsigned long long old; | |
| 156 | + unsigned long old; | |
| 157 | 157 | |
| 158 | 158 | old = S390_lowcore.clock_comparator; |
| 159 | 159 | S390_lowcore.clock_comparator = clock_comparator_max; |
| @@ -161,7 +161,7 @@ static inline unsigned long long local_tick_disable(void) · 1 unmodified line | ||
| 161 | 161 | return old; |
| 162 | 162 | } |
| 163 | 163 | |
| 164 | −static inline void local_tick_enable(unsigned long long comp) | |
| 164 | +static inline void local_tick_enable(unsigned long comp) | |
| 165 | 165 | { |
| 166 | 166 | S390_lowcore.clock_comparator = comp; |
| 167 | 167 | set_clock_comparator(S390_lowcore.clock_comparator); |
| @@ -169,9 +169,9 @@ static inline void local_tick_enable(unsigned long long comp) · 1 unmodified line | ||
| 169 | 169 | |
| 170 | 170 | #define CLOCK_TICK_RATE 1193180 /* Underlying HZ */ |
| 171 | 171 | |
| 172 | −typedef unsigned long long cycles_t; | |
| 172 | +typedef unsigned long cycles_t; | |
| 173 | 173 | |
| 174 | −static inline unsigned long long get_tod_clock(void) | |
| 174 | +static inline unsigned long get_tod_clock(void) | |
| 175 | 175 | { |
| 176 | 176 | union tod_clock clk; |
| 177 | 177 | |
| @@ -179,10 +179,10 @@ static inline unsigned long long get_tod_clock(void) · 1 unmodified line | ||
| 179 | 179 | return clk.tod; |
| 180 | 180 | } |
| 181 | 181 | |
| 182 | −static inline unsigned long long get_tod_clock_fast(void) | |
| 182 | +static inline unsigned long get_tod_clock_fast(void) | |
| 183 | 183 | { |
| 184 | 184 | #ifdef CONFIG_HAVE_MARCH_Z9_109_FEATURES |
| 185 | − unsigned long long clk; | |
| 185 | + unsigned long clk; | |
| 186 | 186 | |
| 187 | 187 | asm volatile("stckf %0" : "=Q" (clk) : : "cc"); |
| 188 | 188 | return clk; |
| @@ -208,9 +208,9 @@ extern union tod_clock tod_clock_base; · 19 unmodified lines | ||
| 208 | 208 | * Therefore preemption must be disabled, otherwise the returned |
| 209 | 209 | * value is not guaranteed to be monotonic. |
| 210 | 210 | */ |
| 211 | −static inline unsigned long long get_tod_clock_monotonic(void) | |
| 211 | +static inline unsigned long get_tod_clock_monotonic(void) | |
| 212 | 212 | { |
| 213 | − unsigned long long tod; | |
| 213 | + unsigned long tod; | |
| 214 | 214 | |
| 215 | 215 | preempt_disable_notrace(); |
| 216 | 216 | tod = get_tod_clock() - tod_clock_base.tod; |
| @@ -237,7 +237,7 @@ static inline unsigned long long get_tod_clock_monotonic(void) · 20 unmodified lines | ||
| 237 | 237 | * -> ns = (th * 125) + ((tl * 125) >> 9); |
| 238 | 238 | * |
| 239 | 239 | */ |
| 240 | −static inline unsigned long long tod_to_ns(unsigned long long todval) | |
| 240 | +static inline unsigned long tod_to_ns(unsigned long todval) | |
| 241 | 241 | { |
| 242 | 242 | return ((todval >> 9) * 125) + (((todval & 0x1ff) * 125) >> 9); |
| 243 | 243 | } |
| @@ -249,10 +249,10 @@ static inline unsigned long long tod_to_ns(unsigned long long todval) · 5 unmodified lines | ||
| 249 | 249 | * |
| 250 | 250 | * Returns: true if a is later than b |
| 251 | 251 | */ |
| 252 | −static inline int tod_after(unsigned long long a, unsigned long long b) | |
| 252 | +static inline int tod_after(unsigned long a, unsigned long b) | |
| 253 | 253 | { |
| 254 | 254 | if (MACHINE_HAS_SCC) |
| 255 | − return (long long) a > (long long) b; | |
| 255 | + return (long) a > (long) b; | |
| 256 | 256 | return a > b; |
| 257 | 257 | } |
| 258 | 258 | |
| @@ -263,10 +263,10 @@ static inline int tod_after(unsigned long long a, unsigned long long b) · 4 unmodified lines | ||
| 263 | 263 | * |
| 264 | 264 | * Returns: true if a is later than b |
| 265 | 265 | */ |
| 266 | −static inline int tod_after_eq(unsigned long long a, unsigned long long b) | |
| 266 | +static inline int tod_after_eq(unsigned long a, unsigned long b) | |
| 267 | 267 | { |
| 268 | 268 | if (MACHINE_HAS_SCC) |
| 269 | − return (long long) a >= (long long) b; | |
| 269 | + return (long) a >= (long) b; | |
| 270 | 270 | return a >= b; |
| 271 | 271 | } |
| 272 | 272 | |
| @@ -6,7 +6,7 @@ · 5 unmodified lines | ||
| 6 | 6 | #include <vdso/datapage.h> |
| 7 | 7 | |
| 8 | 8 | struct arch_vdso_data { |
| 9 | − __u64 tod_steering_delta; | |
| 9 | + __s64 tod_steering_delta; | |
| 10 | 10 | __u64 tod_steering_end; |
| 11 | 11 | }; |
| 12 | 12 | |
File renamed without changes.
| @@ -37,10 +37,12 @@ static int diag8_noresponse(int cmdlen) · 36 unmodified lines | ||
| 37 | 37 | |
| 38 | 38 | static int diag8_response(int cmdlen, char *response, int *rlen) |
| 39 | 39 | { |
| 40 | + unsigned long _cmdlen = cmdlen | 0x40000000L; | |
| 41 | + unsigned long _rlen = *rlen; | |
| 40 | 42 | register unsigned long reg2 asm ("2") = (addr_t) cpcmd_buf; |
| 41 | 43 | register unsigned long reg3 asm ("3") = (addr_t) response; |
| 42 | − register unsigned long reg4 asm ("4") = cmdlen | 0x40000000L; | |
| 43 | − register unsigned long reg5 asm ("5") = *rlen; | |
| 44 | + register unsigned long reg4 asm ("4") = _cmdlen; | |
| 45 | + register unsigned long reg5 asm ("5") = _rlen; | |
| 44 | 46 | |
| 45 | 47 | asm volatile( |
| 46 | 48 | " diag %2,%0,0x8\n" |
| @@ -79,6 +79,15 @@ static bool in_nodat_stack(unsigned long sp, struct stack_info *info) · 78 unmodified lines | ||
| 79 | 79 | return in_stack(sp, info, STACK_TYPE_NODAT, top - THREAD_SIZE, top); |
| 80 | 80 | } |
| 81 | 81 | |
| 82 | +static bool in_mcck_stack(unsigned long sp, struct stack_info *info) | |
| 83 | +{ | |
| 84 | + unsigned long frame_size, top; | |
| 85 | + | |
| 86 | + frame_size = STACK_FRAME_OVERHEAD + sizeof(struct pt_regs); | |
| 87 | + top = S390_lowcore.mcck_stack + frame_size; | |
| 88 | + return in_stack(sp, info, STACK_TYPE_MCCK, top - THREAD_SIZE, top); | |
| 89 | +} | |
| 90 | + | |
| 82 | 91 | static bool in_restart_stack(unsigned long sp, struct stack_info *info) |
| 83 | 92 | { |
| 84 | 93 | unsigned long frame_size, top; |
| @@ -108,7 +117,8 @@ int get_stack_info(unsigned long sp, struct task_struct *task, · 23 unmodified lines | ||
| 108 | 117 | /* Check per-cpu stacks */ |
| 109 | 118 | if (!in_irq_stack(sp, info) && |
| 110 | 119 | !in_nodat_stack(sp, info) && |
| 111 | − !in_restart_stack(sp, info)) | |
| 120 | + !in_restart_stack(sp, info) && | |
| 121 | + !in_mcck_stack(sp, info)) | |
| 112 | 122 | goto unknown; |
| 113 | 123 | |
| 114 | 124 | recursion_check: |
| @@ -401,15 +401,13 @@ ENTRY(\name) · 400 unmodified lines | ||
| 401 | 401 | brasl %r14,.Lcleanup_sie_int |
| 402 | 402 | #endif |
| 403 | 403 | 0: CHECK_STACK __LC_SAVE_AREA_ASYNC |
| 404 | − lgr %r11,%r15 | |
| 405 | 404 | aghi %r15,-(STACK_FRAME_OVERHEAD + __PT_SIZE) |
| 406 | − stg %r11,__SF_BACKCHAIN(%r15) | |
| 407 | 405 | j 2f |
| 408 | 406 | 1: BPENTER __TI_flags(%r12),_TIF_ISOLATE_BP |
| 409 | 407 | lctlg %c1,%c1,__LC_KERNEL_ASCE |
| 410 | 408 | lg %r15,__LC_KERNEL_STACK |
| 411 | − xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) | |
| 412 | −2: la %r11,STACK_FRAME_OVERHEAD(%r15) | |
| 409 | +2: xc __SF_BACKCHAIN(8,%r15),__SF_BACKCHAIN(%r15) | |
| 410 | + la %r11,STACK_FRAME_OVERHEAD(%r15) | |
| 413 | 411 | stmg %r0,%r7,__PT_R0(%r11) |
| 414 | 412 | # clear user controlled registers to prevent speculative use |
| 415 | 413 | xgr %r0,%r0 |
| @@ -445,6 +443,7 @@ INT_HANDLER io_int_handler,__LC_IO_OLD_PSW,do_io_irq · 29 unmodified lines | ||
| 445 | 443 | * Load idle PSW. |
| 446 | 444 | */ |
| 447 | 445 | ENTRY(psw_idle) |
| 446 | + stg %r14,(__SF_GPRS+8*8)(%r15) | |
| 448 | 447 | stg %r3,__SF_EMPTY(%r15) |
| 449 | 448 | larl %r1,psw_idle_exit |
| 450 | 449 | stg %r1,__SF_EMPTY+8(%r15) |
| @@ -47,7 +47,7 @@ void account_idle_time_irq(void) · 46 unmodified lines | ||
| 47 | 47 | void arch_cpu_idle(void) |
| 48 | 48 | { |
| 49 | 49 | struct s390_idle_data *idle = this_cpu_ptr(&s390_idle); |
| 50 | − unsigned long long idle_time; | |
| 50 | + unsigned long idle_time; | |
| 51 | 51 | unsigned long psw_mask; |
| 52 | 52 | |
| 53 | 53 | /* Wait for external, I/O or machine check interrupt. */ |
| @@ -73,7 +73,7 @@ static ssize_t show_idle_count(struct device *dev, · 19 unmodified lines | ||
| 73 | 73 | struct device_attribute *attr, char *buf) |
| 74 | 74 | { |
| 75 | 75 | struct s390_idle_data *idle = &per_cpu(s390_idle, dev->id); |
| 76 | − unsigned long long idle_count; | |
| 76 | + unsigned long idle_count; | |
| 77 | 77 | unsigned int seq; |
| 78 | 78 | |
| 79 | 79 | do { |
| @@ -82,14 +82,14 @@ static ssize_t show_idle_count(struct device *dev, · 2 unmodified lines | ||
| 82 | 82 | if (READ_ONCE(idle->clock_idle_enter)) |
| 83 | 83 | idle_count++; |
| 84 | 84 | } while (read_seqcount_retry(&idle->seqcount, seq)); |
| 85 | − return sprintf(buf, "%llu\n", idle_count); | |
| 85 | + return sprintf(buf, "%lu\n", idle_count); | |
| 86 | 86 | } |
| 87 | 87 | DEVICE_ATTR(idle_count, 0444, show_idle_count, NULL); |
| 88 | 88 | |
| 89 | 89 | static ssize_t show_idle_time(struct device *dev, |
| 90 | 90 | struct device_attribute *attr, char *buf) |
| 91 | 91 | { |
| 92 | − unsigned long long now, idle_time, idle_enter, idle_exit, in_idle; | |
| 92 | + unsigned long now, idle_time, idle_enter, idle_exit, in_idle; | |
| 93 | 93 | struct s390_idle_data *idle = &per_cpu(s390_idle, dev->id); |
| 94 | 94 | unsigned int seq; |
| 95 | 95 | |
| @@ -109,14 +109,14 @@ static ssize_t show_idle_time(struct device *dev, · 13 unmodified lines | ||
| 109 | 109 | } |
| 110 | 110 | } |
| 111 | 111 | idle_time += in_idle; |
| 112 | − return sprintf(buf, "%llu\n", idle_time >> 12); | |
| 112 | + return sprintf(buf, "%lu\n", idle_time >> 12); | |
| 113 | 113 | } |
| 114 | 114 | DEVICE_ATTR(idle_time_us, 0444, show_idle_time, NULL); |
| 115 | 115 | |
| 116 | 116 | u64 arch_cpu_idle_time(int cpu) |
| 117 | 117 | { |
| 118 | 118 | struct s390_idle_data *idle = &per_cpu(s390_idle, cpu); |
| 119 | − unsigned long long now, idle_enter, idle_exit, in_idle; | |
| 119 | + unsigned long now, idle_enter, idle_exit, in_idle; | |
| 120 | 120 | unsigned int seq; |
| 121 | 121 | |
| 122 | 122 | do { |
| @@ -174,7 +174,7 @@ void noinstr do_ext_irq(struct pt_regs *regs) · 173 unmodified lines | ||
| 174 | 174 | |
| 175 | 175 | memcpy(®s->int_code, &S390_lowcore.ext_cpu_addr, 4); |
| 176 | 176 | regs->int_parm = S390_lowcore.ext_params; |
| 177 | − regs->int_parm_long = *(unsigned long *)S390_lowcore.ext_params2; | |
| 177 | + regs->int_parm_long = S390_lowcore.ext_params2; | |
| 178 | 178 | |
| 179 | 179 | from_idle = !user_mode(regs) && regs->psw.addr == (unsigned long)psw_idle_exit; |
| 180 | 180 | if (from_idle) |
| @@ -269,7 +269,7 @@ static int __hw_perf_event_init(struct perf_event *event, unsigned int type) · 268 unmodified lines | ||
| 269 | 269 | case CPUMF_CTR_SET_MAX: |
| 270 | 270 | /* The counter could not be associated to a counter set */ |
| 271 | 271 | return -EINVAL; |
| 272 | − }; | |
| 272 | + } | |
| 273 | 273 | |
| 274 | 274 | /* Initialize for using the CPU-measurement counter facility */ |
| 275 | 275 | if (!atomic_inc_not_zero(&num_events)) { |
| @@ -26,12 +26,10 @@ · 25 unmodified lines | ||
| 26 | 26 | #include <asm/timex.h> |
| 27 | 27 | #include <asm/debug.h> |
| 28 | 28 | |
| 29 | −#include <asm/perf_cpum_cf_diag.h> | |
| 29 | +#include <asm/hwctrset.h> | |
| 30 | 30 | |
| 31 | 31 | #define CF_DIAG_CTRSET_DEF 0xfeef /* Counter set header mark */ |
| 32 | −#define CF_DIAG_MIN_INTERVAL 60 /* Minimum counter set read */ | |
| 33 | 32 | /* interval in seconds */ |
| 34 | −static unsigned long cf_diag_interval = CF_DIAG_MIN_INTERVAL; | |
| 35 | 33 | static unsigned int cf_diag_cpu_speed; |
| 36 | 34 | static debug_info_t *cf_diag_dbg; |
| 37 | 35 | |
| @@ -729,7 +727,6 @@ static DEFINE_MUTEX(cf_diag_ctrset_mutex); · 691 unmodified lines | ||
| 729 | 727 | static struct cf_diag_ctrset { |
| 730 | 728 | unsigned long ctrset; /* Bit mask of counter set to read */ |
| 731 | 729 | cpumask_t mask; /* CPU mask to read from */ |
| 732 | − time64_t lastread; /* Epoch counter set last read */ | |
| 733 | 730 | } cf_diag_ctrset; |
| 734 | 731 | |
| 735 | 732 | static void cf_diag_ctrset_clear(void) |
| @@ -866,27 +863,16 @@ static int cf_diag_all_read(unsigned long arg) · 130 unmodified lines | ||
| 866 | 863 | { |
| 867 | 864 | struct cf_diag_call_on_cpu_parm p; |
| 868 | 865 | cpumask_var_t mask; |
| 869 | − time64_t now; | |
| 870 | − int rc = 0; | |
| 866 | + int rc; | |
| 871 | 867 | |
| 872 | 868 | debug_sprintf_event(cf_diag_dbg, 5, "%s\n", __func__); |
| 873 | 869 | if (!alloc_cpumask_var(&mask, GFP_KERNEL)) |
| 874 | 870 | return -ENOMEM; |
| 875 | − now = ktime_get_seconds(); | |
| 876 | − if (cf_diag_ctrset.lastread + cf_diag_interval > now) { | |
| 877 | − debug_sprintf_event(cf_diag_dbg, 5, "%s now %lld " | |
| 878 | − " lastread %lld\n", __func__, now, | |
| 879 | − cf_diag_ctrset.lastread); | |
| 880 | − rc = -EAGAIN; | |
| 881 | − goto out; | |
| 882 | − } else { | |
| 883 | − cf_diag_ctrset.lastread = now; | |
| 884 | − } | |
| 871 | + | |
| 885 | 872 | p.sets = cf_diag_ctrset.ctrset; |
| 886 | 873 | cpumask_and(mask, &cf_diag_ctrset.mask, cpu_online_mask); |
| 887 | 874 | on_each_cpu_mask(mask, cf_diag_cpu_read, &p, 1); |
| 888 | 875 | rc = cf_diag_all_copy(arg, mask); |
| 889 | −out: | |
| 890 | 876 | free_cpumask_var(mask); |
| 891 | 877 | debug_sprintf_event(cf_diag_dbg, 5, "%s rc %d\n", __func__, rc); |
| 892 | 878 | return rc; |
| @@ -982,7 +968,7 @@ static int cf_diag_all_start(void) · 89 unmodified lines | ||
| 982 | 968 | */ |
| 983 | 969 | static size_t cf_diag_needspace(unsigned int sets) |
| 984 | 970 | { |
| 985 | − struct cpu_cf_events *cpuhw = this_cpu_ptr(&cpu_cf_events); | |
| 971 | + struct cpu_cf_events *cpuhw = get_cpu_ptr(&cpu_cf_events); | |
| 986 | 972 | size_t bytes = 0; |
| 987 | 973 | int i; |
| 988 | 974 | |
| @@ -998,6 +984,7 @@ static size_t cf_diag_needspace(unsigned int sets) · 9 unmodified lines | ||
| 998 | 984 | sizeof(((struct s390_ctrset_cpudata *)0)->no_sets)); |
| 999 | 985 | debug_sprintf_event(cf_diag_dbg, 5, "%s bytes %ld\n", __func__, |
| 1000 | 986 | bytes); |
| 987 | + put_cpu_ptr(&cpu_cf_events); | |
| 1001 | 988 | return bytes; |
| 1002 | 989 | } |
| 1003 | 990 | |
| @@ -354,7 +354,7 @@ static int __init stack_realloc(void) · 353 unmodified lines | ||
| 354 | 354 | if (!new) |
| 355 | 355 | panic("Couldn't allocate machine check stack"); |
| 356 | 356 | WRITE_ONCE(S390_lowcore.mcck_stack, new + STACK_INIT_OFFSET); |
| 357 | − memblock_free(old, THREAD_SIZE); | |
| 357 | + memblock_free_late(old, THREAD_SIZE); | |
| 358 | 358 | return 0; |
| 359 | 359 | } |
| 360 | 360 | early_initcall(stack_realloc); |
| @@ -68,10 +68,10 @@ EXPORT_SYMBOL(s390_epoch_delta_notifier); · 67 unmodified lines | ||
| 68 | 68 | |
| 69 | 69 | unsigned char ptff_function_mask[16]; |
| 70 | 70 | |
| 71 | −static unsigned long long lpar_offset; | |
| 72 | −static unsigned long long initial_leap_seconds; | |
| 73 | −static unsigned long long tod_steering_end; | |
| 74 | −static long long tod_steering_delta; | |
| 71 | +static unsigned long lpar_offset; | |
| 72 | +static unsigned long initial_leap_seconds; | |
| 73 | +static unsigned long tod_steering_end; | |
| 74 | +static long tod_steering_delta; | |
| 75 | 75 | |
| 76 | 76 | /* |
| 77 | 77 | * Get time offsets with PTFF |
| @@ -80,10 +80,12 @@ void __init time_early_init(void) · 2 unmodified lines | ||
| 80 | 80 | { |
| 81 | 81 | struct ptff_qto qto; |
| 82 | 82 | struct ptff_qui qui; |
| 83 | + int cs; | |
| 83 | 84 | |
| 84 | 85 | /* Initialize TOD steering parameters */ |
| 85 | 86 | tod_steering_end = tod_clock_base.tod; |
| 86 | − vdso_data->arch_data.tod_steering_end = tod_steering_end; | |
| 87 | + for (cs = 0; cs < CS_BASES; cs++) | |
| 88 | + vdso_data[cs].arch_data.tod_steering_end = tod_steering_end; | |
| 87 | 89 | |
| 88 | 90 | if (!test_facility(28)) |
| 89 | 91 | return; |
| @@ -96,7 +98,7 @@ void __init time_early_init(void) · 6 unmodified lines | ||
| 96 | 98 | |
| 97 | 99 | /* get initial leap seconds */ |
| 98 | 100 | if (ptff_query(PTFF_QUI) && ptff(&qui, sizeof(qui), PTFF_QUI) == 0) |
| 99 | − initial_leap_seconds = (unsigned long long) | |
| 101 | + initial_leap_seconds = (unsigned long) | |
| 100 | 102 | ((long) qui.old_leap * 4096000000L); |
| 101 | 103 | } |
| 102 | 104 | |
| @@ -222,7 +224,7 @@ void __init read_persistent_wall_and_boot_offset(struct timespec64 *wall_time, · 119 unmodified lines | ||
| 222 | 224 | |
| 223 | 225 | static u64 read_tod_clock(struct clocksource *cs) |
| 224 | 226 | { |
| 225 | − unsigned long long now, adj; | |
| 227 | + unsigned long now, adj; | |
| 226 | 228 | |
| 227 | 229 | preempt_disable(); /* protect from changes to steering parameters */ |
| 228 | 230 | now = get_tod_clock(); |
| @@ -362,10 +364,11 @@ static inline int check_sync_clock(void) · 133 unmodified lines | ||
| 362 | 364 | * Apply clock delta to the global data structures. |
| 363 | 365 | * This is called once on the CPU that performed the clock sync. |
| 364 | 366 | */ |
| 365 | −static void clock_sync_global(unsigned long long delta) | |
| 367 | +static void clock_sync_global(unsigned long delta) | |
| 366 | 368 | { |
| 367 | 369 | unsigned long now, adj; |
| 368 | 370 | struct ptff_qto qto; |
| 371 | + int cs; | |
| 369 | 372 | |
| 370 | 373 | /* Fixup the monotonic sched clock. */ |
| 371 | 374 | tod_clock_base.eitod += delta; |
| @@ -378,10 +381,13 @@ static void clock_sync_global(unsigned long long delta) · 6 unmodified lines | ||
| 378 | 381 | -(adj >> 15) : (adj >> 15); |
| 379 | 382 | tod_steering_delta += delta; |
| 380 | 383 | if ((abs(tod_steering_delta) >> 48) != 0) |
| 381 | − panic("TOD clock sync offset %lli is too large to drift\n", | |
| 384 | + panic("TOD clock sync offset %li is too large to drift\n", | |
| 382 | 385 | tod_steering_delta); |
| 383 | 386 | tod_steering_end = now + (abs(tod_steering_delta) << 15); |
| 384 | − vdso_data->arch_data.tod_steering_end = tod_steering_end; | |
| 387 | + for (cs = 0; cs < CS_BASES; cs++) { | |
| 388 | + vdso_data[cs].arch_data.tod_steering_end = tod_steering_end; | |
| 389 | + vdso_data[cs].arch_data.tod_steering_delta = tod_steering_delta; | |
| 390 | + } | |
| 385 | 391 | |
| 386 | 392 | /* Update LPAR offset. */ |
| 387 | 393 | if (ptff_query(PTFF_QTO) && ptff(&qto, sizeof(qto), PTFF_QTO) == 0) |
| @@ -394,7 +400,7 @@ static void clock_sync_global(unsigned long long delta) · 6 unmodified lines | ||
| 394 | 400 | * Apply clock delta to the per-CPU data structures of this CPU. |
| 395 | 401 | * This is called for each online CPU after the call to clock_sync_global. |
| 396 | 402 | */ |
| 397 | −static void clock_sync_local(unsigned long long delta) | |
| 403 | +static void clock_sync_local(unsigned long delta) | |
| 398 | 404 | { |
| 399 | 405 | /* Add the delta to the clock comparator. */ |
| 400 | 406 | if (S390_lowcore.clock_comparator != clock_comparator_max) { |
| @@ -418,7 +424,7 @@ static void __init time_init_wq(void) · 17 unmodified lines | ||
| 418 | 424 | struct clock_sync_data { |
| 419 | 425 | atomic_t cpus; |
| 420 | 426 | int in_sync; |
| 421 | − unsigned long long clock_delta; | |
| 427 | + unsigned long clock_delta; | |
| 422 | 428 | }; |
| 423 | 429 | |
| 424 | 430 | /* |
| @@ -538,7 +544,7 @@ static int stpinfo_valid(void) · 113 unmodified lines | ||
| 538 | 544 | static int stp_sync_clock(void *data) |
| 539 | 545 | { |
| 540 | 546 | struct clock_sync_data *sync = data; |
| 541 | − unsigned long long clock_delta, flags; | |
| 547 | + u64 clock_delta, flags; | |
| 542 | 548 | static int first; |
| 543 | 549 | int rc; |
| 544 | 550 | |
| @@ -720,8 +726,8 @@ static ssize_t ctn_id_show(struct device *dev, · 175 unmodified lines | ||
| 720 | 726 | |
| 721 | 727 | mutex_lock(&stp_mutex); |
| 722 | 728 | if (stpinfo_valid()) |
| 723 | − ret = sprintf(buf, "%016llx\n", | |
| 724 | − *(unsigned long long *) stp_info.ctnid); | |
| 729 | + ret = sprintf(buf, "%016lx\n", | |
| 730 | + *(unsigned long *) stp_info.ctnid); | |
| 725 | 731 | mutex_unlock(&stp_mutex); |
| 726 | 732 | return ret; |
| 727 | 733 | } |
| @@ -794,7 +800,7 @@ static ssize_t leap_seconds_scheduled_show(struct device *dev, · 66 unmodified lines | ||
| 794 | 800 | if (!stzi.lsoib.p) |
| 795 | 801 | return sprintf(buf, "0,0\n"); |
| 796 | 802 | |
| 797 | − return sprintf(buf, "%llu,%d\n", | |
| 803 | + return sprintf(buf, "%lu,%d\n", | |
| 798 | 804 | tod_to_ns(stzi.lsoib.nlsout - TOD_UNIX_EPOCH) / NSEC_PER_SEC, |
| 799 | 805 | stzi.lsoib.nlso - stzi.lsoib.also); |
| 800 | 806 | } |
| @@ -76,8 +76,6 @@ static void cpu_group_map(cpumask_t *dst, struct mask_info *info, unsigned int c · 75 unmodified lines | ||
| 76 | 76 | } |
| 77 | 77 | info = info->next; |
| 78 | 78 | } |
| 79 | − if (cpumask_empty(&mask)) | |
| 80 | − cpumask_copy(&mask, cpumask_of(cpu)); | |
| 81 | 79 | break; |
| 82 | 80 | case TOPOLOGY_MODE_PACKAGE: |
| 83 | 81 | cpumask_copy(&mask, cpu_present_mask); |
| @@ -214,7 +214,7 @@ void vtime_flush(struct task_struct *tsk) · 213 unmodified lines | ||
| 214 | 214 | avg_steal = S390_lowcore.avg_steal_timer / 2; |
| 215 | 215 | if ((s64) steal > 0) { |
| 216 | 216 | S390_lowcore.steal_timer = 0; |
| 217 | − account_steal_time(steal); | |
| 217 | + account_steal_time(cputime_to_nsecs(steal)); | |
| 218 | 218 | avg_steal += steal; |
| 219 | 219 | } |
| 220 | 220 | S390_lowcore.avg_steal_timer = avg_steal; |
| @@ -1287,7 +1287,7 @@ static u64 __calculate_sltime(struct kvm_vcpu *vcpu) · 1286 unmodified lines | ||
| 1287 | 1287 | /* already expired? */ |
| 1288 | 1288 | if (cputm >> 63) |
| 1289 | 1289 | return 0; |
| 1290 | − return min(sltime, tod_to_ns(cputm)); | |
| 1290 | + return min_t(u64, sltime, tod_to_ns(cputm)); | |
| 1291 | 1291 | } |
| 1292 | 1292 | } else if (cpu_timer_interrupts_enabled(vcpu)) { |
| 1293 | 1293 | sltime = kvm_s390_get_cpu_timer(vcpu); |
| @@ -682,16 +682,36 @@ int zpci_disable_device(struct zpci_dev *zdev) · 681 unmodified lines | ||
| 682 | 682 | } |
| 683 | 683 | EXPORT_SYMBOL_GPL(zpci_disable_device); |
| 684 | 684 | |
| 685 | −void zpci_remove_device(struct zpci_dev *zdev) | |
| 685 | +/* zpci_remove_device - Removes the given zdev from the PCI core | |
| 686 | + * @zdev: the zdev to be removed from the PCI core | |
| 687 | + * @set_error: if true the device's error state is set to permanent failure | |
| 688 | + * | |
| 689 | + * Sets a zPCI device to a configured but offline state; the zPCI | |
| 690 | + * device is still accessible through its hotplug slot and the zPCI | |
| 691 | + * API but is removed from the common code PCI bus, making it | |
| 692 | + * no longer available to drivers. | |
| 693 | + */ | |
| 694 | +void zpci_remove_device(struct zpci_dev *zdev, bool set_error) | |
| 686 | 695 | { |
| 687 | 696 | struct zpci_bus *zbus = zdev->zbus; |
| 688 | 697 | struct pci_dev *pdev; |
| 689 | 698 | |
| 699 | + if (!zdev->zbus->bus) | |
| 700 | + return; | |
| 701 | + | |
| 690 | 702 | pdev = pci_get_slot(zbus->bus, zdev->devfn); |
| 691 | 703 | if (pdev) { |
| 692 | − if (pdev->is_virtfn) | |
| 693 | − return zpci_iov_remove_virtfn(pdev, zdev->vfn); | |
| 704 | + if (set_error) | |
| 705 | + pdev->error_state = pci_channel_io_perm_failure; | |
| 706 | + if (pdev->is_virtfn) { | |
| 707 | + zpci_iov_remove_virtfn(pdev, zdev->vfn); | |
| 708 | + /* balance pci_get_slot */ | |
| 709 | + pci_dev_put(pdev); | |
| 710 | + return; | |
| 711 | + } | |
| 694 | 712 | pci_stop_and_remove_bus_device_locked(pdev); |
| 713 | + /* balance pci_get_slot */ | |
| 714 | + pci_dev_put(pdev); | |
| 695 | 715 | } |
| 696 | 716 | } |
| 697 | 717 | |
| @@ -765,7 +785,7 @@ void zpci_release_device(struct kref *kref) · 67 unmodified lines | ||
| 765 | 785 | struct zpci_dev *zdev = container_of(kref, struct zpci_dev, kref); |
| 766 | 786 | |
| 767 | 787 | if (zdev->zbus->bus) |
| 768 | − zpci_remove_device(zdev); | |
| 788 | + zpci_remove_device(zdev, false); | |
| 769 | 789 | |
| 770 | 790 | switch (zdev->state) { |
| 771 | 791 | case ZPCI_FN_STATE_ONLINE: |
| @@ -76,13 +76,10 @@ void zpci_event_error(void *data) · 75 unmodified lines | ||
| 76 | 76 | static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) |
| 77 | 77 | { |
| 78 | 78 | struct zpci_dev *zdev = get_zdev_by_fid(ccdf->fid); |
| 79 | − struct pci_dev *pdev = NULL; | |
| 80 | 79 | enum zpci_state state; |
| 80 | + struct pci_dev *pdev; | |
| 81 | 81 | int ret; |
| 82 | 82 | |
| 83 | − if (zdev && zdev->zbus->bus) | |
| 84 | − pdev = pci_get_slot(zdev->zbus->bus, zdev->devfn); | |
| 85 | − | |
| 86 | 83 | zpci_err("avail CCDF:\n"); |
| 87 | 84 | zpci_err_hex(ccdf, sizeof(*ccdf)); |
| 88 | 85 | |
| @@ -124,8 +121,7 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) · 35 unmodified lines | ||
| 124 | 121 | case 0x0303: /* Deconfiguration requested */ |
| 125 | 122 | if (!zdev) |
| 126 | 123 | break; |
| 127 | − if (pdev) | |
| 128 | − zpci_remove_device(zdev); | |
| 124 | + zpci_remove_device(zdev, false); | |
| 129 | 125 | |
| 130 | 126 | ret = zpci_disable_device(zdev); |
| 131 | 127 | if (ret) |
| @@ -140,12 +136,10 @@ static void __zpci_event_availability(struct zpci_ccdf_avail *ccdf) · 8 unmodified lines | ||
| 140 | 136 | case 0x0304: /* Configured -> Standby|Reserved */ |
| 141 | 137 | if (!zdev) |
| 142 | 138 | break; |
| 143 | − if (pdev) { | |
| 144 | − /* Give the driver a hint that the function is | |
| 145 | − * already unusable. */ | |
| 146 | − pdev->error_state = pci_channel_io_perm_failure; | |
| 147 | − zpci_remove_device(zdev); | |
| 148 | − } | |
| 139 | + /* Give the driver a hint that the function is | |
| 140 | + * already unusable. | |
| 141 | + */ | |
| 142 | + zpci_remove_device(zdev, true); | |
| 149 | 143 | |
| 150 | 144 | zdev->fh = ccdf->fh; |
| 151 | 145 | zpci_disable_device(zdev); |
| @@ -93,7 +93,7 @@ CONFIG_NETDEVICES=y · 92 unmodified lines | ||
| 93 | 93 | CONFIG_NET_ETHERNET=y |
| 94 | 94 | CONFIG_MII=m |
| 95 | 95 | CONFIG_SUNLANCE=m |
| 96 | −CONFIG_HAPPYMEAL=m | |
| 96 | +CONFIG_HAPPYMEAL=y | |
| 97 | 97 | CONFIG_SUNGEM=m |
| 98 | 98 | CONFIG_SUNVNET=m |
| 99 | 99 | CONFIG_LDMVSW=m |
| @@ -234,9 +234,7 @@ CONFIG_CRYPTO_TWOFISH=m · 134 unmodified lines | ||
| 234 | 234 | CONFIG_CRC16=m |
| 235 | 235 | CONFIG_LIBCRC32C=m |
| 236 | 236 | CONFIG_VCC=m |
| 237 | −CONFIG_ATA=y | |
| 238 | 237 | CONFIG_PATA_CMD64X=y |
| 239 | −CONFIG_HAPPYMEAL=y | |
| 240 | 238 | CONFIG_IP_PNP=y |
| 241 | 239 | CONFIG_IP_PNP_DHCP=y |
| 242 | 240 | CONFIG_DEVTMPFS=y |
| @@ -8,7 +8,6 @@ · 7 unmodified lines | ||
| 8 | 8 | |
| 9 | 9 | #include <asm/ptrace.h> |
| 10 | 10 | #include <asm/processor.h> |
| 11 | −#include <asm/extable_64.h> | |
| 12 | 11 | #include <asm/spitfire.h> |
| 13 | 12 | #include <asm/adi.h> |
| 14 | 13 | |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | −#ifndef __ASM_EXTABLE64_H | |
| 3 | −#define __ASM_EXTABLE64_H | |
| 2 | +#ifndef __ASM_EXTABLE_H | |
| 3 | +#define __ASM_EXTABLE_H | |
| 4 | 4 | /* |
| 5 | 5 | * The exception table consists of pairs of addresses: the first is the |
| 6 | 6 | * address of an instruction that is allowed to fault, and the second is |
| @@ -50,16 +50,12 @@ struct thread_struct { · 49 unmodified lines | ||
| 50 | 50 | unsigned long fsr; |
| 51 | 51 | unsigned long fpqdepth; |
| 52 | 52 | struct fpq fpqueue[16]; |
| 53 | − unsigned long flags; | |
| 54 | 53 | mm_segment_t current_ds; |
| 55 | 54 | }; |
| 56 | 55 | |
| 57 | −#define SPARC_FLAG_KTHREAD 0x1 /* task is a kernel thread */ | |
| 58 | −#define SPARC_FLAG_UNALIGNED 0x2 /* is allowed to do unaligned accesses */ | |
| 59 | − | |
| 60 | 56 | #define INIT_THREAD { \ |
| 61 | − .flags = SPARC_FLAG_KTHREAD, \ | |
| 62 | 57 | .current_ds = KERNEL_DS, \ |
| 58 | + .kregs = (struct pt_regs *)(init_stack+THREAD_SIZE)-1 \ | |
| 63 | 59 | } |
| 64 | 60 | |
| 65 | 61 | /* Do necessary setup to start up a newly executed thread. */ |
| @@ -118,6 +118,7 @@ struct thread_info { · 117 unmodified lines | ||
| 118 | 118 | .task = &tsk, \ |
| 119 | 119 | .current_ds = ASI_P, \ |
| 120 | 120 | .preempt_count = INIT_PREEMPT_COUNT, \ |
| 121 | + .kregs = (struct pt_regs *)(init_stack+THREAD_SIZE)-1 \ | |
| 121 | 122 | } |
| 122 | 123 | |
| 123 | 124 | /* how to get the thread information struct from C */ |
| @@ -1,6 +1,9 @@ | ||
| 1 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | 2 | #ifndef ___ASM_SPARC_UACCESS_H |
| 3 | 3 | #define ___ASM_SPARC_UACCESS_H |
| 4 | + | |
| 5 | +#include <asm/extable.h> | |
| 6 | + | |
| 4 | 7 | #if defined(__sparc__) && defined(__arch64__) |
| 5 | 8 | #include <asm/uaccess_64.h> |
| 6 | 9 | #else |
| @@ -13,9 +13,6 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | #include <asm/processor.h> |
| 15 | 15 | |
| 16 | −#define ARCH_HAS_SORT_EXTABLE | |
| 17 | −#define ARCH_HAS_SEARCH_EXTABLE | |
| 18 | − | |
| 19 | 16 | /* Sparc is not segmented, however we need to be able to fool access_ok() |
| 20 | 17 | * when doing system calls from kernel mode legitimately. |
| 21 | 18 | * |
| @@ -40,36 +37,6 @@ · 18 unmodified lines | ||
| 40 | 37 | #define __access_ok(addr, size) (__user_ok((addr) & get_fs().seg, (size))) |
| 41 | 38 | #define access_ok(addr, size) __access_ok((unsigned long)(addr), size) |
| 42 | 39 | |
| 43 | −/* | |
| 44 | − * The exception table consists of pairs of addresses: the first is the | |
| 45 | − * address of an instruction that is allowed to fault, and the second is | |
| 46 | − * the address at which the program should continue. No registers are | |
| 47 | − * modified, so it is entirely up to the continuation code to figure out | |
| 48 | − * what to do. | |
| 49 | − * | |
| 50 | − * All the routines below use bits of fixup code that are out of line | |
| 51 | − * with the main instruction path. This means when everything is well, | |
| 52 | − * we don't even have to jump over them. Further, they do not intrude | |
| 53 | − * on our cache or tlb entries. | |
| 54 | − * | |
| 55 | − * There is a special way how to put a range of potentially faulting | |
| 56 | − * insns (like twenty ldd/std's with now intervening other instructions) | |
| 57 | − * You specify address of first in insn and 0 in fixup and in the next | |
| 58 | − * exception_table_entry you specify last potentially faulting insn + 1 | |
| 59 | − * and in fixup the routine which should handle the fault. | |
| 60 | − * That fixup code will get | |
| 61 | − * (faulting_insn_address - first_insn_in_the_range_address)/4 | |
| 62 | − * in %g2 (ie. index of the faulting instruction in the range). | |
| 63 | − */ | |
| 64 | − | |
| 65 | −struct exception_table_entry | |
| 66 | −{ | |
| 67 | − unsigned long insn, fixup; | |
| 68 | −}; | |
| 69 | − | |
| 70 | −/* Returns 0 if exception not found and fixup otherwise. */ | |
| 71 | −unsigned long search_extables_range(unsigned long addr, unsigned long *g2); | |
| 72 | − | |
| 73 | 40 | /* Uh, these should become the main single-value transfer routines.. |
| 74 | 41 | * They automatically use the right size if we just have the right |
| 75 | 42 | * pointer type.. |
| @@ -252,12 +219,7 @@ static inline unsigned long __clear_user(void __user *addr, unsigned long size) · 176 unmodified lines | ||
| 252 | 219 | unsigned long ret; |
| 253 | 220 | |
| 254 | 221 | __asm__ __volatile__ ( |
| 255 | − ".section __ex_table,#alloc\n\t" | |
| 256 | − ".align 4\n\t" | |
| 257 | − ".word 1f,3\n\t" | |
| 258 | − ".previous\n\t" | |
| 259 | 222 | "mov %2, %%o1\n" |
| 260 | − "1:\n\t" | |
| 261 | 223 | "call __bzero\n\t" |
| 262 | 224 | " mov %1, %%o0\n\t" |
| 263 | 225 | "mov %%o0, %0\n" |
| @@ -10,7 +10,6 @@ · 9 unmodified lines | ||
| 10 | 10 | #include <linux/string.h> |
| 11 | 11 | #include <asm/asi.h> |
| 12 | 12 | #include <asm/spitfire.h> |
| 13 | −#include <asm/extable_64.h> | |
| 14 | 13 | |
| 15 | 14 | #include <asm/processor.h> |
| 16 | 15 | |
| @@ -515,7 +515,7 @@ continue_boot: · 514 unmodified lines | ||
| 515 | 515 | |
| 516 | 516 | /* I want a kernel stack NOW! */ |
| 517 | 517 | set init_thread_union, %g1 |
| 518 | − set (THREAD_SIZE - STACKFRAME_SZ), %g2 | |
| 518 | + set (THREAD_SIZE - STACKFRAME_SZ - TRACEREG_SZ), %g2 | |
| 519 | 519 | add %g1, %g2, %sp |
| 520 | 520 | mov 0, %fp /* And for good luck */ |
| 521 | 521 | |
| @@ -706,7 +706,7 @@ tlb_fixup_done: · 705 unmodified lines | ||
| 706 | 706 | wr %g0, ASI_P, %asi |
| 707 | 707 | mov 1, %g1 |
| 708 | 708 | sllx %g1, THREAD_SHIFT, %g1 |
| 709 | − sub %g1, (STACKFRAME_SZ + STACK_BIAS), %g1 | |
| 709 | + sub %g1, (STACKFRAME_SZ + STACK_BIAS + TRACEREG_SZ), %g1 | |
| 710 | 710 | add %g6, %g1, %sp |
| 711 | 711 | |
| 712 | 712 | /* Set per-cpu pointer initially to zero, this makes |
| @@ -216,16 +216,6 @@ void flush_thread(void) · 215 unmodified lines | ||
| 216 | 216 | clear_thread_flag(TIF_USEDFPU); |
| 217 | 217 | #endif |
| 218 | 218 | } |
| 219 | − | |
| 220 | − /* This task is no longer a kernel thread. */ | |
| 221 | − if (current->thread.flags & SPARC_FLAG_KTHREAD) { | |
| 222 | − current->thread.flags &= ~SPARC_FLAG_KTHREAD; | |
| 223 | − | |
| 224 | − /* We must fixup kregs as well. */ | |
| 225 | − /* XXX This was not fixed for ti for a while, worked. Unused? */ | |
| 226 | − current->thread.kregs = (struct pt_regs *) | |
| 227 | − (task_stack_page(current) + (THREAD_SIZE - TRACEREG_SZ)); | |
| 228 | − } | |
| 229 | 219 | } |
| 230 | 220 | |
| 231 | 221 | static inline struct sparc_stackf __user * |
| @@ -313,7 +303,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, · 81 unmodified lines | ||
| 313 | 303 | extern int nwindows; |
| 314 | 304 | unsigned long psr; |
| 315 | 305 | memset(new_stack, 0, STACKFRAME_SZ + TRACEREG_SZ); |
| 316 | − p->thread.flags |= SPARC_FLAG_KTHREAD; | |
| 317 | 306 | p->thread.current_ds = KERNEL_DS; |
| 318 | 307 | ti->kpc = (((unsigned long) ret_from_kernel_thread) - 0x8); |
| 319 | 308 | childregs->u_regs[UREG_G1] = sp; /* function */ |
| @@ -325,7 +314,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg, · 5 unmodified lines | ||
| 325 | 314 | } |
| 326 | 315 | memcpy(new_stack, (char *)regs - STACKFRAME_SZ, STACKFRAME_SZ + TRACEREG_SZ); |
| 327 | 316 | childregs->u_regs[UREG_FP] = sp; |
| 328 | − p->thread.flags &= ~SPARC_FLAG_KTHREAD; | |
| 329 | 317 | p->thread.current_ds = USER_DS; |
| 330 | 318 | ti->kpc = (((unsigned long) ret_from_fork) - 0x8); |
| 331 | 319 | ti->kpsr = current->thread.fork_kpsr | PSR_PIL; |
| @@ -266,7 +266,6 @@ static __init void leon_patch(void) · 265 unmodified lines | ||
| 266 | 266 | } |
| 267 | 267 | |
| 268 | 268 | struct tt_entry *sparc_ttable; |
| 269 | −static struct pt_regs fake_swapper_regs; | |
| 270 | 269 | |
| 271 | 270 | /* Called from head_32.S - before we have setup anything |
| 272 | 271 | * in the kernel. Be very careful with what you do here. |
| @@ -363,8 +362,6 @@ void __init setup_arch(char **cmdline_p) · 90 unmodified lines | ||
| 363 | 362 | (*(linux_dbvec->teach_debugger))(); |
| 364 | 363 | } |
| 365 | 364 | |
| 366 | − init_task.thread.kregs = &fake_swapper_regs; | |
| 367 | − | |
| 368 | 365 | /* Run-time patch instructions to match the cpu model */ |
| 369 | 366 | per_cpu_patch(); |
| 370 | 367 | |
| @@ -165,8 +165,6 @@ extern int root_mountflags; · 164 unmodified lines | ||
| 165 | 165 | |
| 166 | 166 | char reboot_command[COMMAND_LINE_SIZE]; |
| 167 | 167 | |
| 168 | −static struct pt_regs fake_swapper_regs = { { 0, }, 0, 0, 0, 0 }; | |
| 169 | − | |
| 170 | 168 | static void __init per_cpu_patch(void) |
| 171 | 169 | { |
| 172 | 170 | struct cpuid_patch_entry *p; |
| @@ -661,8 +659,6 @@ void __init setup_arch(char **cmdline_p) · 488 unmodified lines | ||
| 661 | 659 | rd_image_start = ram_flags & RAMDISK_IMAGE_START_MASK; |
| 662 | 660 | #endif |
| 663 | 661 | |
| 664 | − task_thread_info(&init_task)->kregs = &fake_swapper_regs; | |
| 665 | − | |
| 666 | 662 | #ifdef CONFIG_IP_PNP |
| 667 | 663 | if (!ic_set_manually) { |
| 668 | 664 | phandle chosen = prom_finddevice("/chosen"); |
| @@ -275,14 +275,13 @@ bool is_no_fault_exception(struct pt_regs *regs) · 274 unmodified lines | ||
| 275 | 275 | asi = (regs->tstate >> 24); /* saved %asi */ |
| 276 | 276 | else |
| 277 | 277 | asi = (insn >> 5); /* immediate asi */ |
| 278 | − if ((asi & 0xf2) == ASI_PNF) { | |
| 279 | − if (insn & 0x1000000) { /* op3[5:4]=3 */ | |
| 280 | − handle_ldf_stq(insn, regs); | |
| 281 | − return true; | |
| 282 | − } else if (insn & 0x200000) { /* op3[2], stores */ | |
| 278 | + if ((asi & 0xf6) == ASI_PNF) { | |
| 279 | + if (insn & 0x200000) /* op3[2], stores */ | |
| 283 | 280 | return false; |
| 284 | − } | |
| 285 | − handle_ld_nf(insn, regs); | |
| 281 | + if (insn & 0x1000000) /* op3[5:4]=3 (fp) */ | |
| 282 | + handle_ldf_stq(insn, regs); | |
| 283 | + else | |
| 284 | + handle_ld_nf(insn, regs); | |
| 286 | 285 | return true; |
| 287 | 286 | } |
| 288 | 287 | } |
| @@ -16,6 +16,7 @@ · 15 unmodified lines | ||
| 16 | 16 | #include <linux/uaccess.h> |
| 17 | 17 | #include <linux/smp.h> |
| 18 | 18 | #include <linux/perf_event.h> |
| 19 | +#include <linux/extable.h> | |
| 19 | 20 | |
| 20 | 21 | #include <asm/setup.h> |
| 21 | 22 | |
| @@ -213,10 +214,10 @@ static inline int ok_for_kernel(unsigned int insn) · 191 unmodified lines | ||
| 213 | 214 | |
| 214 | 215 | static void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) |
| 215 | 216 | { |
| 216 | − unsigned long g2 = regs->u_regs [UREG_G2]; | |
| 217 | − unsigned long fixup = search_extables_range(regs->pc, &g2); | |
| 217 | + const struct exception_table_entry *entry; | |
| 218 | 218 | |
| 219 | − if (!fixup) { | |
| 219 | + entry = search_exception_tables(regs->pc); | |
| 220 | + if (!entry) { | |
| 220 | 221 | unsigned long address = compute_effective_address(regs, insn); |
| 221 | 222 | if(address < PAGE_SIZE) { |
| 222 | 223 | printk(KERN_ALERT "Unable to handle kernel NULL pointer dereference in mna handler"); |
| @@ -232,9 +233,8 @@ static void kernel_mna_trap_fault(struct pt_regs *regs, unsigned int insn) · 9 unmodified lines | ||
| 232 | 233 | die_if_kernel("Oops", regs); |
| 233 | 234 | /* Not reached */ |
| 234 | 235 | } |
| 235 | − regs->pc = fixup; | |
| 236 | + regs->pc = entry->fixup; | |
| 236 | 237 | regs->npc = regs->pc + 4; |
| 237 | − regs->u_regs [UREG_G2] = g2; | |
| 238 | 238 | } |
| 239 | 239 | |
| 240 | 240 | asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) |
| @@ -274,103 +274,9 @@ asmlinkage void kernel_unaligned_trap(struct pt_regs *regs, unsigned int insn) · 33 unmodified lines | ||
| 274 | 274 | } |
| 275 | 275 | } |
| 276 | 276 | |
| 277 | −static inline int ok_for_user(struct pt_regs *regs, unsigned int insn, | |
| 278 | − enum direction dir) | |
| 279 | −{ | |
| 280 | − unsigned int reg; | |
| 281 | − int size = ((insn >> 19) & 3) == 3 ? 8 : 4; | |
| 282 | − | |
| 283 | − if ((regs->pc | regs->npc) & 3) | |
| 284 | − return 0; | |
| 285 | − | |
| 286 | − /* Must access_ok() in all the necessary places. */ | |
| 287 | −#define WINREG_ADDR(regnum) \ | |
| 288 | − ((void __user *)(((unsigned long *)regs->u_regs[UREG_FP])+(regnum))) | |
| 289 | − | |
| 290 | − reg = (insn >> 25) & 0x1f; | |
| 291 | − if (reg >= 16) { | |
| 292 | − if (!access_ok(WINREG_ADDR(reg - 16), size)) | |
| 293 | − return -EFAULT; | |
| 294 | − } | |
| 295 | − reg = (insn >> 14) & 0x1f; | |
| 296 | − if (reg >= 16) { | |
| 297 | − if (!access_ok(WINREG_ADDR(reg - 16), size)) | |
| 298 | − return -EFAULT; | |
| 299 | − } | |
| 300 | − if (!(insn & 0x2000)) { | |
| 301 | − reg = (insn & 0x1f); | |
| 302 | − if (reg >= 16) { | |
| 303 | − if (!access_ok(WINREG_ADDR(reg - 16), size)) | |
| 304 | − return -EFAULT; | |
| 305 | − } | |
| 306 | − } | |
| 307 | −#undef WINREG_ADDR | |
| 308 | − return 0; | |
| 309 | −} | |
| 310 | − | |
| 311 | −static void user_mna_trap_fault(struct pt_regs *regs, unsigned int insn) | |
| 277 | +asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn) | |
| 312 | 278 | { |
| 313 | 279 | send_sig_fault(SIGBUS, BUS_ADRALN, |
| 314 | 280 | (void __user *)safe_compute_effective_address(regs, insn), |
| 315 | 281 | 0, current); |
| 316 | 282 | } |
| 317 | − | |
| 318 | −asmlinkage void user_unaligned_trap(struct pt_regs *regs, unsigned int insn) | |
| 319 | −{ | |
| 320 | − enum direction dir; | |
| 321 | − | |
| 322 | − if(!(current->thread.flags & SPARC_FLAG_UNALIGNED) || | |
| 323 | − (((insn >> 30) & 3) != 3)) | |
| 324 | − goto kill_user; | |
| 325 | − dir = decode_direction(insn); | |
| 326 | − if(!ok_for_user(regs, insn, dir)) { | |
| 327 | − goto kill_user; | |
| 328 | − } else { | |
| 329 | − int err, size = decode_access_size(insn); | |
| 330 | − unsigned long addr; | |
| 331 | − | |
| 332 | − if(floating_point_load_or_store_p(insn)) { | |
| 333 | − printk("User FPU load/store unaligned unsupported.\n"); | |
| 334 | − goto kill_user; | |
| 335 | − } | |
| 336 | − | |
| 337 | − addr = compute_effective_address(regs, insn); | |
| 338 | − perf_sw_event(PERF_COUNT_SW_ALIGNMENT_FAULTS, 1, regs, addr); | |
| 339 | − switch(dir) { | |
| 340 | − case load: | |
| 341 | − err = do_int_load(fetch_reg_addr(((insn>>25)&0x1f), | |
| 342 | − regs), | |
| 343 | − size, (unsigned long *) addr, | |
| 344 | − decode_signedness(insn)); | |
| 345 | − break; | |
| 346 | − | |
| 347 | − case store: | |
| 348 | − err = do_int_store(((insn>>25)&0x1f), size, | |
| 349 | − (unsigned long *) addr, regs); | |
| 350 | − break; | |
| 351 | − | |
| 352 | − case both: | |
| 353 | − /* | |
| 354 | − * This was supported in 2.4. However, we question | |
| 355 | − * the value of SWAP instruction across word boundaries. | |
| 356 | − */ | |
| 357 | − printk("Unaligned SWAP unsupported.\n"); | |
| 358 | − err = -EFAULT; | |
| 359 | − break; | |
| 360 | − | |
| 361 | − default: | |
| 362 | − unaligned_panic("Impossible user unaligned trap."); | |
| 363 | − goto out; | |
| 364 | − } | |
| 365 | − if (err) | |
| 366 | − goto kill_user; | |
| 367 | − else | |
| 368 | − advance(regs); | |
| 369 | − goto out; | |
| 370 | − } | |
| 371 | − | |
| 372 | −kill_user: | |
| 373 | − user_mna_trap_fault(regs, insn); | |
| 374 | −out: | |
| 375 | − ; | |
| 376 | −} | |
| @@ -155,13 +155,6 @@ cpout: retl ! get outta here · 154 unmodified lines | ||
| 155 | 155 | .text; \ |
| 156 | 156 | .align 4 |
| 157 | 157 | |
| 158 | −#define EXT(start,end) \ | |
| 159 | − .section __ex_table,ALLOC; \ | |
| 160 | − .align 4; \ | |
| 161 | − .word start, 0, end, cc_fault; \ | |
| 162 | − .text; \ | |
| 163 | − .align 4 | |
| 164 | − | |
| 165 | 158 | /* This aligned version executes typically in 8.5 superscalar cycles, this |
| 166 | 159 | * is the best I can do. I say 8.5 because the final add will pair with |
| 167 | 160 | * the next ldd in the main unrolled loop. Thus the pipe is always full. |
| @@ -169,20 +162,20 @@ cpout: retl ! get outta here · 1 unmodified line | ||
| 169 | 162 | * please check the fixup code below as well. |
| 170 | 163 | */ |
| 171 | 164 | #define CSUMCOPY_BIGCHUNK_ALIGNED(src, dst, sum, off, t0, t1, t2, t3, t4, t5, t6, t7) \ |
| 172 | − ldd [src + off + 0x00], t0; \ | |
| 173 | − ldd [src + off + 0x08], t2; \ | |
| 165 | + EX(ldd [src + off + 0x00], t0); \ | |
| 166 | + EX(ldd [src + off + 0x08], t2); \ | |
| 174 | 167 | addxcc t0, sum, sum; \ |
| 175 | − ldd [src + off + 0x10], t4; \ | |
| 168 | + EX(ldd [src + off + 0x10], t4); \ | |
| 176 | 169 | addxcc t1, sum, sum; \ |
| 177 | − ldd [src + off + 0x18], t6; \ | |
| 170 | + EX(ldd [src + off + 0x18], t6); \ | |
| 178 | 171 | addxcc t2, sum, sum; \ |
| 179 | − std t0, [dst + off + 0x00]; \ | |
| 172 | + EX(std t0, [dst + off + 0x00]); \ | |
| 180 | 173 | addxcc t3, sum, sum; \ |
| 181 | − std t2, [dst + off + 0x08]; \ | |
| 174 | + EX(std t2, [dst + off + 0x08]); \ | |
| 182 | 175 | addxcc t4, sum, sum; \ |
| 183 | − std t4, [dst + off + 0x10]; \ | |
| 176 | + EX(std t4, [dst + off + 0x10]); \ | |
| 184 | 177 | addxcc t5, sum, sum; \ |
| 185 | − std t6, [dst + off + 0x18]; \ | |
| 178 | + EX(std t6, [dst + off + 0x18]); \ | |
| 186 | 179 | addxcc t6, sum, sum; \ |
| 187 | 180 | addxcc t7, sum, sum; |
| 188 | 181 | |
| @@ -191,39 +184,39 @@ cpout: retl ! get outta here · 2 unmodified lines | ||
| 191 | 184 | * Viking MXCC into streaming mode. Ho hum... |
| 192 | 185 | */ |
| 193 | 186 | #define CSUMCOPY_BIGCHUNK(src, dst, sum, off, t0, t1, t2, t3, t4, t5, t6, t7) \ |
| 194 | − ldd [src + off + 0x00], t0; \ | |
| 195 | − ldd [src + off + 0x08], t2; \ | |
| 196 | − ldd [src + off + 0x10], t4; \ | |
| 197 | − ldd [src + off + 0x18], t6; \ | |
| 198 | − st t0, [dst + off + 0x00]; \ | |
| 187 | + EX(ldd [src + off + 0x00], t0); \ | |
| 188 | + EX(ldd [src + off + 0x08], t2); \ | |
| 189 | + EX(ldd [src + off + 0x10], t4); \ | |
| 190 | + EX(ldd [src + off + 0x18], t6); \ | |
| 191 | + EX(st t0, [dst + off + 0x00]); \ | |
| 199 | 192 | addxcc t0, sum, sum; \ |
| 200 | − st t1, [dst + off + 0x04]; \ | |
| 193 | + EX(st t1, [dst + off + 0x04]); \ | |
| 201 | 194 | addxcc t1, sum, sum; \ |
| 202 | − st t2, [dst + off + 0x08]; \ | |
| 195 | + EX(st t2, [dst + off + 0x08]); \ | |
| 203 | 196 | addxcc t2, sum, sum; \ |
| 204 | − st t3, [dst + off + 0x0c]; \ | |
| 197 | + EX(st t3, [dst + off + 0x0c]); \ | |
| 205 | 198 | addxcc t3, sum, sum; \ |
| 206 | − st t4, [dst + off + 0x10]; \ | |
| 199 | + EX(st t4, [dst + off + 0x10]); \ | |
| 207 | 200 | addxcc t4, sum, sum; \ |
| 208 | − st t5, [dst + off + 0x14]; \ | |
| 201 | + EX(st t5, [dst + off + 0x14]); \ | |
| 209 | 202 | addxcc t5, sum, sum; \ |
| 210 | − st t6, [dst + off + 0x18]; \ | |
| 203 | + EX(st t6, [dst + off + 0x18]); \ | |
| 211 | 204 | addxcc t6, sum, sum; \ |
| 212 | − st t7, [dst + off + 0x1c]; \ | |
| 205 | + EX(st t7, [dst + off + 0x1c]); \ | |
| 213 | 206 | addxcc t7, sum, sum; |
| 214 | 207 | |
| 215 | 208 | /* Yuck, 6 superscalar cycles... */ |
| 216 | 209 | #define CSUMCOPY_LASTCHUNK(src, dst, sum, off, t0, t1, t2, t3) \ |
| 217 | − ldd [src - off - 0x08], t0; \ | |
| 218 | − ldd [src - off - 0x00], t2; \ | |
| 210 | + EX(ldd [src - off - 0x08], t0); \ | |
| 211 | + EX(ldd [src - off - 0x00], t2); \ | |
| 219 | 212 | addxcc t0, sum, sum; \ |
| 220 | − st t0, [dst - off - 0x08]; \ | |
| 213 | + EX(st t0, [dst - off - 0x08]); \ | |
| 221 | 214 | addxcc t1, sum, sum; \ |
| 222 | − st t1, [dst - off - 0x04]; \ | |
| 215 | + EX(st t1, [dst - off - 0x04]); \ | |
| 223 | 216 | addxcc t2, sum, sum; \ |
| 224 | − st t2, [dst - off - 0x00]; \ | |
| 217 | + EX(st t2, [dst - off - 0x00]); \ | |
| 225 | 218 | addxcc t3, sum, sum; \ |
| 226 | − st t3, [dst - off + 0x04]; | |
| 219 | + EX(st t3, [dst - off + 0x04]); | |
| 227 | 220 | |
| 228 | 221 | /* Handle the end cruft code out of band for better cache patterns. */ |
| 229 | 222 | cc_end_cruft: |
| @@ -331,7 +324,6 @@ __csum_partial_copy_sparc_generic: · 101 unmodified lines | ||
| 331 | 324 | CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x20,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) |
| 332 | 325 | CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x40,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) |
| 333 | 326 | CSUMCOPY_BIGCHUNK(%o0,%o1,%g7,0x60,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) |
| 334 | −10: EXT(5b, 10b) ! note for exception handling | |
| 335 | 327 | sub %g1, 128, %g1 ! detract from length |
| 336 | 328 | addx %g0, %g7, %g7 ! add in last carry bit |
| 337 | 329 | andcc %g1, 0xffffff80, %g0 ! more to csum? |
| @@ -356,8 +348,7 @@ cctbl: CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x68,%g2,%g3,%g4,%g5) · 18 unmodified lines | ||
| 356 | 348 | CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x28,%g2,%g3,%g4,%g5) |
| 357 | 349 | CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x18,%g2,%g3,%g4,%g5) |
| 358 | 350 | CSUMCOPY_LASTCHUNK(%o0,%o1,%g7,0x08,%g2,%g3,%g4,%g5) |
| 359 | −12: EXT(cctbl, 12b) ! note for exception table handling | |
| 360 | − addx %g0, %g7, %g7 | |
| 351 | +12: addx %g0, %g7, %g7 | |
| 361 | 352 | andcc %o3, 0xf, %g0 ! check for low bits set |
| 362 | 353 | ccte: bne cc_end_cruft ! something left, handle it out of band |
| 363 | 354 | andcc %o3, 8, %g0 ! begin checks for that code |
| @@ -367,7 +358,6 @@ ccdbl: CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x00,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o · 3 unmodified lines | ||
| 367 | 358 | CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x20,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) |
| 368 | 359 | CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x40,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) |
| 369 | 360 | CSUMCOPY_BIGCHUNK_ALIGNED(%o0,%o1,%g7,0x60,%o4,%o5,%g2,%g3,%g4,%g5,%o2,%o3) |
| 370 | −11: EXT(ccdbl, 11b) ! note for exception table handling | |
| 371 | 361 | sub %g1, 128, %g1 ! detract from length |
| 372 | 362 | addx %g0, %g7, %g7 ! add in last carry bit |
| 373 | 363 | andcc %g1, 0xffffff80, %g0 ! more to csum? |
| @@ -21,98 +21,134 @@ · 20 unmodified lines | ||
| 21 | 21 | /* Work around cpp -rob */ |
| 22 | 22 | #define ALLOC #alloc |
| 23 | 23 | #define EXECINSTR #execinstr |
| 24 | + | |
| 25 | +#define EX_ENTRY(l1, l2) \ | |
| 26 | + .section __ex_table,ALLOC; \ | |
| 27 | + .align 4; \ | |
| 28 | + .word l1, l2; \ | |
| 29 | + .text; | |
| 30 | + | |
| 24 | 31 | #define EX(x,y,a,b) \ |
| 25 | 32 | 98: x,y; \ |
| 26 | 33 | .section .fixup,ALLOC,EXECINSTR; \ |
| 27 | 34 | .align 4; \ |
| 28 | −99: ba fixupretl; \ | |
| 29 | − a, b, %g3; \ | |
| 30 | − .section __ex_table,ALLOC; \ | |
| 31 | − .align 4; \ | |
| 32 | − .word 98b, 99b; \ | |
| 33 | − .text; \ | |
| 34 | − .align 4 | |
| 35 | +99: retl; \ | |
| 36 | + a, b, %o0; \ | |
| 37 | + EX_ENTRY(98b, 99b) | |
| 35 | 38 | |
| 36 | 39 | #define EX2(x,y,c,d,e,a,b) \ |
| 37 | 40 | 98: x,y; \ |
| 38 | 41 | .section .fixup,ALLOC,EXECINSTR; \ |
| 39 | 42 | .align 4; \ |
| 40 | 43 | 99: c, d, e; \ |
| 41 | − ba fixupretl; \ | |
| 42 | − a, b, %g3; \ | |
| 43 | − .section __ex_table,ALLOC; \ | |
| 44 | − .align 4; \ | |
| 45 | − .word 98b, 99b; \ | |
| 46 | − .text; \ | |
| 47 | − .align 4 | |
| 44 | + retl; \ | |
| 45 | + a, b, %o0; \ | |
| 46 | + EX_ENTRY(98b, 99b) | |
| 48 | 47 | |
| 49 | 48 | #define EXO2(x,y) \ |
| 50 | 49 | 98: x, y; \ |
| 51 | − .section __ex_table,ALLOC; \ | |
| 52 | − .align 4; \ | |
| 53 | − .word 98b, 97f; \ | |
| 54 | − .text; \ | |
| 55 | − .align 4 | |
| 50 | + EX_ENTRY(98b, 97f) | |
| 56 | 51 | |
| 57 | −#define EXT(start,end,handler) \ | |
| 58 | − .section __ex_table,ALLOC; \ | |
| 59 | − .align 4; \ | |
| 60 | − .word start, 0, end, handler; \ | |
| 61 | − .text; \ | |
| 62 | − .align 4 | |
| 52 | +#define LD(insn, src, offset, reg, label) \ | |
| 53 | +98: insn [%src + (offset)], %reg; \ | |
| 54 | + .section .fixup,ALLOC,EXECINSTR; \ | |
| 55 | +99: ba label; \ | |
| 56 | + mov offset, %g5; \ | |
| 57 | + EX_ENTRY(98b, 99b) | |
| 63 | 58 | |
| 64 | −/* Please do not change following macros unless you change logic used | |
| 65 | − * in .fixup at the end of this file as well | |
| 66 | − */ | |
| 59 | +#define ST(insn, dst, offset, reg, label) \ | |
| 60 | +98: insn %reg, [%dst + (offset)]; \ | |
| 61 | + .section .fixup,ALLOC,EXECINSTR; \ | |
| 62 | +99: ba label; \ | |
| 63 | + mov offset, %g5; \ | |
| 64 | + EX_ENTRY(98b, 99b) | |
| 67 | 65 | |
| 68 | 66 | /* Both these macros have to start with exactly the same insn */ |
| 67 | +/* left: g7 + (g1 % 128) - offset */ | |
| 69 | 68 | #define MOVE_BIGCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \ |
| 70 | − ldd [%src + (offset) + 0x00], %t0; \ | |
| 71 | − ldd [%src + (offset) + 0x08], %t2; \ | |
| 72 | − ldd [%src + (offset) + 0x10], %t4; \ | |
| 73 | − ldd [%src + (offset) + 0x18], %t6; \ | |
| 74 | − st %t0, [%dst + (offset) + 0x00]; \ | |
| 75 | − st %t1, [%dst + (offset) + 0x04]; \ | |
| 76 | − st %t2, [%dst + (offset) + 0x08]; \ | |
| 77 | − st %t3, [%dst + (offset) + 0x0c]; \ | |
| 78 | − st %t4, [%dst + (offset) + 0x10]; \ | |
| 79 | − st %t5, [%dst + (offset) + 0x14]; \ | |
| 80 | − st %t6, [%dst + (offset) + 0x18]; \ | |
| 81 | − st %t7, [%dst + (offset) + 0x1c]; | |
| 82 | − | |
| 69 | + LD(ldd, src, offset + 0x00, t0, bigchunk_fault) \ | |
| 70 | + LD(ldd, src, offset + 0x08, t2, bigchunk_fault) \ | |
| 71 | + LD(ldd, src, offset + 0x10, t4, bigchunk_fault) \ | |
| 72 | + LD(ldd, src, offset + 0x18, t6, bigchunk_fault) \ | |
| 73 | + ST(st, dst, offset + 0x00, t0, bigchunk_fault) \ | |
| 74 | + ST(st, dst, offset + 0x04, t1, bigchunk_fault) \ | |
| 75 | + ST(st, dst, offset + 0x08, t2, bigchunk_fault) \ | |
| 76 | + ST(st, dst, offset + 0x0c, t3, bigchunk_fault) \ | |
| 77 | + ST(st, dst, offset + 0x10, t4, bigchunk_fault) \ | |
| 78 | + ST(st, dst, offset + 0x14, t5, bigchunk_fault) \ | |
| 79 | + ST(st, dst, offset + 0x18, t6, bigchunk_fault) \ | |
| 80 | + ST(st, dst, offset + 0x1c, t7, bigchunk_fault) | |
| 81 | + | |
| 82 | +/* left: g7 + (g1 % 128) - offset */ | |
| 83 | 83 | #define MOVE_BIGALIGNCHUNK(src, dst, offset, t0, t1, t2, t3, t4, t5, t6, t7) \ |
| 84 | − ldd [%src + (offset) + 0x00], %t0; \ | |
| 85 | − ldd [%src + (offset) + 0x08], %t2; \ | |
| 86 | − ldd [%src + (offset) + 0x10], %t4; \ | |
| 87 | − ldd [%src + (offset) + 0x18], %t6; \ | |
| 88 | − std %t0, [%dst + (offset) + 0x00]; \ | |
| 89 | − std %t2, [%dst + (offset) + 0x08]; \ | |
| 90 | − std %t4, [%dst + (offset) + 0x10]; \ | |
| 91 | − std %t6, [%dst + (offset) + 0x18]; | |
| 84 | + LD(ldd, src, offset + 0x00, t0, bigchunk_fault) \ | |
| 85 | + LD(ldd, src, offset + 0x08, t2, bigchunk_fault) \ | |
| 86 | + LD(ldd, src, offset + 0x10, t4, bigchunk_fault) \ | |
| 87 | + LD(ldd, src, offset + 0x18, t6, bigchunk_fault) \ | |
| 88 | + ST(std, dst, offset + 0x00, t0, bigchunk_fault) \ | |
| 89 | + ST(std, dst, offset + 0x08, t2, bigchunk_fault) \ | |
| 90 | + ST(std, dst, offset + 0x10, t4, bigchunk_fault) \ | |
| 91 | + ST(std, dst, offset + 0x18, t6, bigchunk_fault) | |
| 92 | 92 | |
| 93 | + .section .fixup,#alloc,#execinstr | |
| 94 | +bigchunk_fault: | |
| 95 | + sub %g7, %g5, %o0 | |
| 96 | + and %g1, 127, %g1 | |
| 97 | + retl | |
| 98 | + add %o0, %g1, %o0 | |
| 99 | + | |
| 100 | +/* left: offset + 16 + (g1 % 16) */ | |
| 93 | 101 | #define MOVE_LASTCHUNK(src, dst, offset, t0, t1, t2, t3) \ |
| 94 | − ldd [%src - (offset) - 0x10], %t0; \ | |
| 95 | − ldd [%src - (offset) - 0x08], %t2; \ | |
| 96 | − st %t0, [%dst - (offset) - 0x10]; \ | |
| 97 | − st %t1, [%dst - (offset) - 0x0c]; \ | |
| 98 | − st %t2, [%dst - (offset) - 0x08]; \ | |
| 99 | − st %t3, [%dst - (offset) - 0x04]; | |
| 102 | + LD(ldd, src, -(offset + 0x10), t0, lastchunk_fault) \ | |
| 103 | + LD(ldd, src, -(offset + 0x08), t2, lastchunk_fault) \ | |
| 104 | + ST(st, dst, -(offset + 0x10), t0, lastchunk_fault) \ | |
| 105 | + ST(st, dst, -(offset + 0x0c), t1, lastchunk_fault) \ | |
| 106 | + ST(st, dst, -(offset + 0x08), t2, lastchunk_fault) \ | |
| 107 | + ST(st, dst, -(offset + 0x04), t3, lastchunk_fault) | |
| 100 | 108 | |
| 101 | −#define MOVE_HALFCHUNK(src, dst, offset, t0, t1, t2, t3) \ | |
| 102 | − lduh [%src + (offset) + 0x00], %t0; \ | |
| 103 | − lduh [%src + (offset) + 0x02], %t1; \ | |
| 104 | − lduh [%src + (offset) + 0x04], %t2; \ | |
| 105 | − lduh [%src + (offset) + 0x06], %t3; \ | |
| 106 | − sth %t0, [%dst + (offset) + 0x00]; \ | |
| 107 | − sth %t1, [%dst + (offset) + 0x02]; \ | |
| 108 | − sth %t2, [%dst + (offset) + 0x04]; \ | |
| 109 | − sth %t3, [%dst + (offset) + 0x06]; | |
| 109 | + .section .fixup,#alloc,#execinstr | |
| 110 | +lastchunk_fault: | |
| 111 | + and %g1, 15, %g1 | |
| 112 | + retl | |
| 113 | + sub %g1, %g5, %o0 | |
| 110 | 114 | |
| 115 | +/* left: o3 + (o2 % 16) - offset */ | |
| 116 | +#define MOVE_HALFCHUNK(src, dst, offset, t0, t1, t2, t3) \ | |
| 117 | + LD(lduh, src, offset + 0x00, t0, halfchunk_fault) \ | |
| 118 | + LD(lduh, src, offset + 0x02, t1, halfchunk_fault) \ | |
| 119 | + LD(lduh, src, offset + 0x04, t2, halfchunk_fault) \ | |
| 120 | + LD(lduh, src, offset + 0x06, t3, halfchunk_fault) \ | |
| 121 | + ST(sth, dst, offset + 0x00, t0, halfchunk_fault) \ | |
| 122 | + ST(sth, dst, offset + 0x02, t1, halfchunk_fault) \ | |
| 123 | + ST(sth, dst, offset + 0x04, t2, halfchunk_fault) \ | |
| 124 | + ST(sth, dst, offset + 0x06, t3, halfchunk_fault) | |
| 125 | + | |
| 126 | +/* left: o3 + (o2 % 16) + offset + 2 */ | |
| 111 | 127 | #define MOVE_SHORTCHUNK(src, dst, offset, t0, t1) \ |
| 112 | − ldub [%src - (offset) - 0x02], %t0; \ | |
| 113 | − ldub [%src - (offset) - 0x01], %t1; \ | |
| 114 | − stb %t0, [%dst - (offset) - 0x02]; \ | |
| 115 | − stb %t1, [%dst - (offset) - 0x01]; | |
| 128 | + LD(ldub, src, -(offset + 0x02), t0, halfchunk_fault) \ | |
| 129 | + LD(ldub, src, -(offset + 0x01), t1, halfchunk_fault) \ | |
| 130 | + ST(stb, dst, -(offset + 0x02), t0, halfchunk_fault) \ | |
| 131 | + ST(stb, dst, -(offset + 0x01), t1, halfchunk_fault) | |
| 132 | + | |
| 133 | + .section .fixup,#alloc,#execinstr | |
| 134 | +halfchunk_fault: | |
| 135 | + and %o2, 15, %o2 | |
| 136 | + sub %o3, %g5, %o3 | |
| 137 | + retl | |
| 138 | + add %o2, %o3, %o0 | |
| 139 | + | |
| 140 | +/* left: offset + 2 + (o2 % 2) */ | |
| 141 | +#define MOVE_LAST_SHORTCHUNK(src, dst, offset, t0, t1) \ | |
| 142 | + LD(ldub, src, -(offset + 0x02), t0, last_shortchunk_fault) \ | |
| 143 | + LD(ldub, src, -(offset + 0x01), t1, last_shortchunk_fault) \ | |
| 144 | + ST(stb, dst, -(offset + 0x02), t0, last_shortchunk_fault) \ | |
| 145 | + ST(stb, dst, -(offset + 0x01), t1, last_shortchunk_fault) | |
| 146 | + | |
| 147 | + .section .fixup,#alloc,#execinstr | |
| 148 | +last_shortchunk_fault: | |
| 149 | + and %o2, 1, %o2 | |
| 150 | + retl | |
| 151 | + sub %o2, %g5, %o0 | |
| 116 | 152 | |
| 117 | 153 | .text |
| 118 | 154 | .align 4 |
| @@ -182,8 +218,6 @@ __copy_user: /* %o0=dst %o1=src %o2=len */ · 63 unmodified lines | ||
| 182 | 218 | MOVE_BIGCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5) |
| 183 | 219 | MOVE_BIGCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5) |
| 184 | 220 | MOVE_BIGCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5) |
| 185 | −80: | |
| 186 | − EXT(5b, 80b, 50f) | |
| 187 | 221 | subcc %g7, 128, %g7 |
| 188 | 222 | add %o1, 128, %o1 |
| 189 | 223 | bne 5b |
| @@ -201,7 +235,6 @@ __copy_user: /* %o0=dst %o1=src %o2=len */ · 11 unmodified lines | ||
| 201 | 235 | jmpl %o5 + %lo(copy_user_table_end), %g0 |
| 202 | 236 | add %o0, %g7, %o0 |
| 203 | 237 | |
| 204 | −copy_user_table: | |
| 205 | 238 | MOVE_LASTCHUNK(o1, o0, 0x60, g2, g3, g4, g5) |
| 206 | 239 | MOVE_LASTCHUNK(o1, o0, 0x50, g2, g3, g4, g5) |
| 207 | 240 | MOVE_LASTCHUNK(o1, o0, 0x40, g2, g3, g4, g5) |
| @@ -210,7 +243,6 @@ copy_user_table: · 2 unmodified lines | ||
| 210 | 243 | MOVE_LASTCHUNK(o1, o0, 0x10, g2, g3, g4, g5) |
| 211 | 244 | MOVE_LASTCHUNK(o1, o0, 0x00, g2, g3, g4, g5) |
| 212 | 245 | copy_user_table_end: |
| 213 | − EXT(copy_user_table, copy_user_table_end, 51f) | |
| 214 | 246 | be copy_user_last7 |
| 215 | 247 | andcc %g1, 4, %g0 |
| 216 | 248 | |
| @@ -250,8 +282,6 @@ ldd_std: · 33 unmodified lines | ||
| 250 | 282 | MOVE_BIGALIGNCHUNK(o1, o0, 0x20, o2, o3, o4, o5, g2, g3, g4, g5) |
| 251 | 283 | MOVE_BIGALIGNCHUNK(o1, o0, 0x40, o2, o3, o4, o5, g2, g3, g4, g5) |
| 252 | 284 | MOVE_BIGALIGNCHUNK(o1, o0, 0x60, o2, o3, o4, o5, g2, g3, g4, g5) |
| 253 | −81: | |
| 254 | − EXT(ldd_std, 81b, 52f) | |
| 255 | 285 | subcc %g7, 128, %g7 |
| 256 | 286 | add %o1, 128, %o1 |
| 257 | 287 | bne ldd_std |
| @@ -290,8 +320,6 @@ cannot_optimize: · 32 unmodified lines | ||
| 290 | 320 | 10: |
| 291 | 321 | MOVE_HALFCHUNK(o1, o0, 0x00, g2, g3, g4, g5) |
| 292 | 322 | MOVE_HALFCHUNK(o1, o0, 0x08, g2, g3, g4, g5) |
| 293 | −82: | |
| 294 | − EXT(10b, 82b, 53f) | |
| 295 | 323 | subcc %o3, 0x10, %o3 |
| 296 | 324 | add %o1, 0x10, %o1 |
| 297 | 325 | bne 10b |
| @@ -308,8 +336,6 @@ byte_chunk: · 10 unmodified lines | ||
| 308 | 336 | MOVE_SHORTCHUNK(o1, o0, -0x0c, g2, g3) |
| 309 | 337 | MOVE_SHORTCHUNK(o1, o0, -0x0e, g2, g3) |
| 310 | 338 | MOVE_SHORTCHUNK(o1, o0, -0x10, g2, g3) |
| 311 | −83: | |
| 312 | − EXT(byte_chunk, 83b, 54f) | |
| 313 | 339 | subcc %o3, 0x10, %o3 |
| 314 | 340 | add %o1, 0x10, %o1 |
| 315 | 341 | bne byte_chunk |
| @@ -325,16 +351,14 @@ short_end: · 9 unmodified lines | ||
| 325 | 351 | add %o1, %o3, %o1 |
| 326 | 352 | jmpl %o5 + %lo(short_table_end), %g0 |
| 327 | 353 | andcc %o2, 1, %g0 |
| 328 | −84: | |
| 329 | − MOVE_SHORTCHUNK(o1, o0, 0x0c, g2, g3) | |
| 330 | − MOVE_SHORTCHUNK(o1, o0, 0x0a, g2, g3) | |
| 331 | − MOVE_SHORTCHUNK(o1, o0, 0x08, g2, g3) | |
| 332 | − MOVE_SHORTCHUNK(o1, o0, 0x06, g2, g3) | |
| 333 | − MOVE_SHORTCHUNK(o1, o0, 0x04, g2, g3) | |
| 334 | − MOVE_SHORTCHUNK(o1, o0, 0x02, g2, g3) | |
| 335 | − MOVE_SHORTCHUNK(o1, o0, 0x00, g2, g3) | |
| 354 | + MOVE_LAST_SHORTCHUNK(o1, o0, 0x0c, g2, g3) | |
| 355 | + MOVE_LAST_SHORTCHUNK(o1, o0, 0x0a, g2, g3) | |
| 356 | + MOVE_LAST_SHORTCHUNK(o1, o0, 0x08, g2, g3) | |
| 357 | + MOVE_LAST_SHORTCHUNK(o1, o0, 0x06, g2, g3) | |
| 358 | + MOVE_LAST_SHORTCHUNK(o1, o0, 0x04, g2, g3) | |
| 359 | + MOVE_LAST_SHORTCHUNK(o1, o0, 0x02, g2, g3) | |
| 360 | + MOVE_LAST_SHORTCHUNK(o1, o0, 0x00, g2, g3) | |
| 336 | 361 | short_table_end: |
| 337 | − EXT(84b, short_table_end, 55f) | |
| 338 | 362 | be 1f |
| 339 | 363 | nop |
| 340 | 364 | EX(ldub [%o1], %g2, add %g0, 1) |
| @@ -363,123 +387,8 @@ short_aligned_end: · 22 unmodified lines | ||
| 363 | 387 | .section .fixup,#alloc,#execinstr |
| 364 | 388 | .align 4 |
| 365 | 389 | 97: |
| 366 | − mov %o2, %g3 | |
| 367 | −fixupretl: | |
| 368 | 390 | retl |
| 369 | − mov %g3, %o0 | |
| 370 | − | |
| 371 | −/* exception routine sets %g2 to (broken_insn - first_insn)>>2 */ | |
| 372 | −50: | |
| 373 | −/* This magic counts how many bytes are left when crash in MOVE_BIGCHUNK | |
| 374 | − * happens. This is derived from the amount ldd reads, st stores, etc. | |
| 375 | − * x = g2 % 12; | |
| 376 | − * g3 = g1 + g7 - ((g2 / 12) * 32 + (x < 4) ? 0 : (x - 4) * 4); | |
| 377 | − * o0 += (g2 / 12) * 32; | |
| 378 | − */ | |
| 379 | − cmp %g2, 12 | |
| 380 | − add %o0, %g7, %o0 | |
| 381 | − bcs 1f | |
| 382 | − cmp %g2, 24 | |
| 383 | − bcs 2f | |
| 384 | − cmp %g2, 36 | |
| 385 | − bcs 3f | |
| 386 | − nop | |
| 387 | − sub %g2, 12, %g2 | |
| 388 | − sub %g7, 32, %g7 | |
| 389 | −3: sub %g2, 12, %g2 | |
| 390 | − sub %g7, 32, %g7 | |
| 391 | −2: sub %g2, 12, %g2 | |
| 392 | − sub %g7, 32, %g7 | |
| 393 | −1: cmp %g2, 4 | |
| 394 | − bcs,a 60f | |
| 395 | − clr %g2 | |
| 396 | − sub %g2, 4, %g2 | |
| 397 | − sll %g2, 2, %g2 | |
| 398 | −60: and %g1, 0x7f, %g3 | |
| 399 | − sub %o0, %g7, %o0 | |
| 400 | − add %g3, %g7, %g3 | |
| 401 | − ba fixupretl | |
| 402 | − sub %g3, %g2, %g3 | |
| 403 | −51: | |
| 404 | −/* i = 41 - g2; j = i % 6; | |
| 405 | − * g3 = (g1 & 15) + (i / 6) * 16 + (j < 4) ? (j + 1) * 4 : 16; | |
| 406 | − * o0 -= (i / 6) * 16 + 16; | |
| 407 | − */ | |
| 408 | − neg %g2 | |
| 409 | − and %g1, 0xf, %g1 | |
| 410 | − add %g2, 41, %g2 | |
| 411 | − add %o0, %g1, %o0 | |
| 412 | −1: cmp %g2, 6 | |
| 413 | − bcs,a 2f | |
| 414 | − cmp %g2, 4 | |
| 415 | − add %g1, 16, %g1 | |
| 416 | − b 1b | |
| 417 | − sub %g2, 6, %g2 | |
| 418 | −2: bcc,a 2f | |
| 419 | − mov 16, %g2 | |
| 420 | − inc %g2 | |
| 421 | − sll %g2, 2, %g2 | |
| 422 | −2: add %g1, %g2, %g3 | |
| 423 | − ba fixupretl | |
| 424 | − sub %o0, %g3, %o0 | |
| 425 | −52: | |
| 426 | −/* g3 = g1 + g7 - (g2 / 8) * 32 + (g2 & 4) ? (g2 & 3) * 8 : 0; | |
| 427 | − o0 += (g2 / 8) * 32 */ | |
| 428 | − andn %g2, 7, %g4 | |
| 429 | − add %o0, %g7, %o0 | |
| 430 | − andcc %g2, 4, %g0 | |
| 431 | − and %g2, 3, %g2 | |
| 432 | − sll %g4, 2, %g4 | |
| 433 | − sll %g2, 3, %g2 | |
| 434 | − bne 60b | |
| 435 | − sub %g7, %g4, %g7 | |
| 436 | − ba 60b | |
| 437 | − clr %g2 | |
| 438 | −53: | |
| 439 | −/* g3 = o3 + (o2 & 15) - (g2 & 8) - (g2 & 4) ? (g2 & 3) * 2 : 0; | |
| 440 | − o0 += (g2 & 8) */ | |
| 441 | − and %g2, 3, %g4 | |
| 442 | − andcc %g2, 4, %g0 | |
| 443 | − and %g2, 8, %g2 | |
| 444 | − sll %g4, 1, %g4 | |
| 445 | − be 1f | |
| 446 | − add %o0, %g2, %o0 | |
| 447 | − add %g2, %g4, %g2 | |
| 448 | −1: and %o2, 0xf, %g3 | |
| 449 | − add %g3, %o3, %g3 | |
| 450 | − ba fixupretl | |
| 451 | − sub %g3, %g2, %g3 | |
| 452 | −54: | |
| 453 | −/* g3 = o3 + (o2 & 15) - (g2 / 4) * 2 - (g2 & 2) ? (g2 & 1) : 0; | |
| 454 | − o0 += (g2 / 4) * 2 */ | |
| 455 | − srl %g2, 2, %o4 | |
| 456 | − and %g2, 1, %o5 | |
| 457 | − srl %g2, 1, %g2 | |
| 458 | − add %o4, %o4, %o4 | |
| 459 | − and %o5, %g2, %o5 | |
| 460 | − and %o2, 0xf, %o2 | |
| 461 | − add %o0, %o4, %o0 | |
| 462 | − sub %o3, %o5, %o3 | |
| 463 | − sub %o2, %o4, %o2 | |
| 464 | − ba fixupretl | |
| 465 | − add %o2, %o3, %g3 | |
| 466 | −55: | |
| 467 | −/* i = 27 - g2; | |
| 468 | − g3 = (o2 & 1) + i / 4 * 2 + !(i & 3); | |
| 469 | − o0 -= i / 4 * 2 + 1 */ | |
| 470 | − neg %g2 | |
| 471 | − and %o2, 1, %o2 | |
| 472 | − add %g2, 27, %g2 | |
| 473 | − srl %g2, 2, %o5 | |
| 474 | − andcc %g2, 3, %g0 | |
| 475 | − mov 1, %g2 | |
| 476 | − add %o5, %o5, %o5 | |
| 477 | − be,a 1f | |
| 478 | − clr %g2 | |
| 479 | −1: add %g2, %o5, %g3 | |
| 480 | − sub %o0, %g3, %o0 | |
| 481 | − ba fixupretl | |
| 482 | − add %g3, %o2, %g3 | |
| 391 | + mov %o2, %o0 | |
| 483 | 392 | |
| 484 | 393 | .globl __copy_user_end |
| 485 | 394 | __copy_user_end: |
| @@ -19,7 +19,7 @@ · 18 unmodified lines | ||
| 19 | 19 | 98: x,y; \ |
| 20 | 20 | .section .fixup,ALLOC,EXECINSTR; \ |
| 21 | 21 | .align 4; \ |
| 22 | −99: ba 30f; \ | |
| 22 | +99: retl; \ | |
| 23 | 23 | a, b, %o0; \ |
| 24 | 24 | .section __ex_table,ALLOC; \ |
| 25 | 25 | .align 4; \ |
| @@ -27,35 +27,44 @@ · 1 unmodified line | ||
| 27 | 27 | .text; \ |
| 28 | 28 | .align 4 |
| 29 | 29 | |
| 30 | −#define EXT(start,end,handler) \ | |
| 30 | +#define STORE(source, base, offset, n) \ | |
| 31 | +98: std source, [base + offset + n]; \ | |
| 32 | + .section .fixup,ALLOC,EXECINSTR; \ | |
| 33 | + .align 4; \ | |
| 34 | +99: ba 30f; \ | |
| 35 | + sub %o3, n - offset, %o3; \ | |
| 31 | 36 | .section __ex_table,ALLOC; \ |
| 32 | 37 | .align 4; \ |
| 33 | − .word start, 0, end, handler; \ | |
| 38 | + .word 98b, 99b; \ | |
| 34 | 39 | .text; \ |
| 35 | − .align 4 | |
| 40 | + .align 4; | |
| 41 | + | |
| 42 | +#define STORE_LAST(source, base, offset, n) \ | |
| 43 | + EX(std source, [base - offset - n], \ | |
| 44 | + add %o1, offset + n); | |
| 36 | 45 | |
| 37 | 46 | /* Please don't change these macros, unless you change the logic |
| 38 | 47 | * in the .fixup section below as well. |
| 39 | 48 | * Store 64 bytes at (BASE + OFFSET) using value SOURCE. */ |
| 40 | −#define ZERO_BIG_BLOCK(base, offset, source) \ | |
| 41 | − std source, [base + offset + 0x00]; \ | |
| 42 | − std source, [base + offset + 0x08]; \ | |
| 43 | − std source, [base + offset + 0x10]; \ | |
| 44 | − std source, [base + offset + 0x18]; \ | |
| 45 | − std source, [base + offset + 0x20]; \ | |
| 46 | − std source, [base + offset + 0x28]; \ | |
| 47 | − std source, [base + offset + 0x30]; \ | |
| 48 | − std source, [base + offset + 0x38]; | |
| 49 | +#define ZERO_BIG_BLOCK(base, offset, source) \ | |
| 50 | + STORE(source, base, offset, 0x00); \ | |
| 51 | + STORE(source, base, offset, 0x08); \ | |
| 52 | + STORE(source, base, offset, 0x10); \ | |
| 53 | + STORE(source, base, offset, 0x18); \ | |
| 54 | + STORE(source, base, offset, 0x20); \ | |
| 55 | + STORE(source, base, offset, 0x28); \ | |
| 56 | + STORE(source, base, offset, 0x30); \ | |
| 57 | + STORE(source, base, offset, 0x38); | |
| 49 | 58 | |
| 50 | 59 | #define ZERO_LAST_BLOCKS(base, offset, source) \ |
| 51 | − std source, [base - offset - 0x38]; \ | |
| 52 | − std source, [base - offset - 0x30]; \ | |
| 53 | − std source, [base - offset - 0x28]; \ | |
| 54 | − std source, [base - offset - 0x20]; \ | |
| 55 | − std source, [base - offset - 0x18]; \ | |
| 56 | − std source, [base - offset - 0x10]; \ | |
| 57 | − std source, [base - offset - 0x08]; \ | |
| 58 | − std source, [base - offset - 0x00]; | |
| 60 | + STORE_LAST(source, base, offset, 0x38); \ | |
| 61 | + STORE_LAST(source, base, offset, 0x30); \ | |
| 62 | + STORE_LAST(source, base, offset, 0x28); \ | |
| 63 | + STORE_LAST(source, base, offset, 0x20); \ | |
| 64 | + STORE_LAST(source, base, offset, 0x18); \ | |
| 65 | + STORE_LAST(source, base, offset, 0x10); \ | |
| 66 | + STORE_LAST(source, base, offset, 0x08); \ | |
| 67 | + STORE_LAST(source, base, offset, 0x00); | |
| 59 | 68 | |
| 60 | 69 | .text |
| 61 | 70 | .align 4 |
| @@ -68,8 +77,6 @@ __bzero_begin: · 6 unmodified lines | ||
| 68 | 77 | .globl memset |
| 69 | 78 | EXPORT_SYMBOL(__bzero) |
| 70 | 79 | EXPORT_SYMBOL(memset) |
| 71 | − .globl __memset_start, __memset_end | |
| 72 | −__memset_start: | |
| 73 | 80 | memset: |
| 74 | 81 | mov %o0, %g1 |
| 75 | 82 | mov 1, %g4 |
| @@ -122,8 +129,6 @@ __bzero: · 46 unmodified lines | ||
| 122 | 129 | ZERO_BIG_BLOCK(%o0, 0x00, %g2) |
| 123 | 130 | subcc %o3, 128, %o3 |
| 124 | 131 | ZERO_BIG_BLOCK(%o0, 0x40, %g2) |
| 125 | −11: | |
| 126 | − EXT(10b, 11b, 20f) | |
| 127 | 132 | bne 10b |
| 128 | 133 | add %o0, 128, %o0 |
| 129 | 134 | |
| @@ -138,11 +143,9 @@ __bzero: · 8 unmodified lines | ||
| 138 | 143 | jmp %o4 |
| 139 | 144 | add %o0, %o2, %o0 |
| 140 | 145 | |
| 141 | −12: | |
| 142 | 146 | ZERO_LAST_BLOCKS(%o0, 0x48, %g2) |
| 143 | 147 | ZERO_LAST_BLOCKS(%o0, 0x08, %g2) |
| 144 | 148 | 13: |
| 145 | − EXT(12b, 13b, 21f) | |
| 146 | 149 | be 8f |
| 147 | 150 | andcc %o1, 4, %g0 |
| 148 | 151 | |
| @@ -182,37 +185,13 @@ __bzero: · 33 unmodified lines | ||
| 182 | 185 | 5: |
| 183 | 186 | retl |
| 184 | 187 | clr %o0 |
| 185 | −__memset_end: | |
| 186 | 188 | |
| 187 | 189 | .section .fixup,#alloc,#execinstr |
| 188 | 190 | .align 4 |
| 189 | −20: | |
| 190 | − cmp %g2, 8 | |
| 191 | − bleu 1f | |
| 192 | − and %o1, 0x7f, %o1 | |
| 193 | − sub %g2, 9, %g2 | |
| 194 | − add %o3, 64, %o3 | |
| 195 | −1: | |
| 196 | − sll %g2, 3, %g2 | |
| 197 | − add %o3, %o1, %o0 | |
| 198 | − b 30f | |
| 199 | − sub %o0, %g2, %o0 | |
| 200 | −21: | |
| 201 | − mov 8, %o0 | |
| 202 | − and %o1, 7, %o1 | |
| 203 | − sub %o0, %g2, %o0 | |
| 204 | − sll %o0, 3, %o0 | |
| 205 | − b 30f | |
| 206 | − add %o0, %o1, %o0 | |
| 207 | 191 | 30: |
| 208 | −/* %o4 is faulting address, %o5 is %pc where fault occurred */ | |
| 209 | − save %sp, -104, %sp | |
| 210 | − mov %i5, %o0 | |
| 211 | − mov %i7, %o1 | |
| 212 | − call lookup_fault | |
| 213 | − mov %i4, %o2 | |
| 214 | − ret | |
| 215 | − restore | |
| 192 | + and %o1, 0x7f, %o1 | |
| 193 | + retl | |
| 194 | + add %o3, %o1, %o0 | |
| 216 | 195 | |
| 217 | 196 | .globl __bzero_end |
| 218 | 197 | __bzero_end: |
| @@ -8,7 +8,7 @@ ccflags-y := -Werror · 7 unmodified lines | ||
| 8 | 8 | obj-$(CONFIG_SPARC64) += ultra.o tlb.o tsb.o |
| 9 | 9 | obj-y += fault_$(BITS).o |
| 10 | 10 | obj-y += init_$(BITS).o |
| 11 | −obj-$(CONFIG_SPARC32) += extable.o srmmu.o iommu.o io-unit.o | |
| 11 | +obj-$(CONFIG_SPARC32) += srmmu.o iommu.o io-unit.o | |
| 12 | 12 | obj-$(CONFIG_SPARC32) += srmmu_access.o |
| 13 | 13 | obj-$(CONFIG_SPARC32) += hypersparc.o viking.o tsunami.o swift.o |
| 14 | 14 | obj-$(CONFIG_SPARC32) += leon_mm.o |
| @@ -1,107 +0,0 @@ | ||
| 1 | −// SPDX-License-Identifier: GPL-2.0 | |
| 2 | −/* | |
| 3 | − * linux/arch/sparc/mm/extable.c | |
| 4 | − */ | |
| 5 | − | |
| 6 | −#include <linux/module.h> | |
| 7 | −#include <linux/extable.h> | |
| 8 | −#include <linux/uaccess.h> | |
| 9 | − | |
| 10 | −void sort_extable(struct exception_table_entry *start, | |
| 11 | − struct exception_table_entry *finish) | |
| 12 | −{ | |
| 13 | −} | |
| 14 | − | |
| 15 | −/* Caller knows they are in a range if ret->fixup == 0 */ | |
| 16 | −const struct exception_table_entry * | |
| 17 | −search_extable(const struct exception_table_entry *base, | |
| 18 | − const size_t num, | |
| 19 | − unsigned long value) | |
| 20 | −{ | |
| 21 | − int i; | |
| 22 | − | |
| 23 | − /* Single insn entries are encoded as: | |
| 24 | − * word 1: insn address | |
| 25 | − * word 2: fixup code address | |
| 26 | − * | |
| 27 | − * Range entries are encoded as: | |
| 28 | − * word 1: first insn address | |
| 29 | − * word 2: 0 | |
| 30 | − * word 3: last insn address + 4 bytes | |
| 31 | − * word 4: fixup code address | |
| 32 | − * | |
| 33 | − * Deleted entries are encoded as: | |
| 34 | − * word 1: unused | |
| 35 | − * word 2: -1 | |
| 36 | − * | |
| 37 | − * See asm/uaccess.h for more details. | |
| 38 | − */ | |
| 39 | − | |
| 40 | − /* 1. Try to find an exact match. */ | |
| 41 | − for (i = 0; i < num; i++) { | |
| 42 | − if (base[i].fixup == 0) { | |
| 43 | − /* A range entry, skip both parts. */ | |
| 44 | − i++; | |
| 45 | − continue; | |
| 46 | − } | |
| 47 | − | |
| 48 | − /* A deleted entry; see trim_init_extable */ | |
| 49 | − if (base[i].fixup == -1) | |
| 50 | − continue; | |
| 51 | − | |
| 52 | − if (base[i].insn == value) | |
| 53 | − return &base[i]; | |
| 54 | − } | |
| 55 | − | |
| 56 | − /* 2. Try to find a range match. */ | |
| 57 | − for (i = 0; i < (num - 1); i++) { | |
| 58 | − if (base[i].fixup) | |
| 59 | − continue; | |
| 60 | − | |
| 61 | − if (base[i].insn <= value && base[i + 1].insn > value) | |
| 62 | − return &base[i]; | |
| 63 | − | |
| 64 | − i++; | |
| 65 | − } | |
| 66 | − | |
| 67 | − return NULL; | |
| 68 | −} | |
| 69 | − | |
| 70 | −#ifdef CONFIG_MODULES | |
| 71 | −/* We could memmove them around; easier to mark the trimmed ones. */ | |
| 72 | −void trim_init_extable(struct module *m) | |
| 73 | −{ | |
| 74 | − unsigned int i; | |
| 75 | − bool range; | |
| 76 | − | |
| 77 | − for (i = 0; i < m->num_exentries; i += range ? 2 : 1) { | |
| 78 | − range = m->extable[i].fixup == 0; | |
| 79 | − | |
| 80 | − if (within_module_init(m->extable[i].insn, m)) { | |
| 81 | − m->extable[i].fixup = -1; | |
| 82 | − if (range) | |
| 83 | − m->extable[i+1].fixup = -1; | |
| 84 | − } | |
| 85 | − if (range) | |
| 86 | − i++; | |
| 87 | − } | |
| 88 | −} | |
| 89 | −#endif /* CONFIG_MODULES */ | |
| 90 | − | |
| 91 | −/* Special extable search, which handles ranges. Returns fixup */ | |
| 92 | −unsigned long search_extables_range(unsigned long addr, unsigned long *g2) | |
| 93 | −{ | |
| 94 | − const struct exception_table_entry *entry; | |
| 95 | − | |
| 96 | − entry = search_exception_tables(addr); | |
| 97 | − if (!entry) | |
| 98 | − return 0; | |
| 99 | − | |
| 100 | − /* Inside range? Fix g2 and return correct fixup */ | |
| 101 | − if (!entry->fixup) { | |
| 102 | − *g2 = (addr - entry->insn) / 4; | |
| 103 | − return (entry + 1)->fixup; | |
| 104 | − } | |
| 105 | − | |
| 106 | − return entry->fixup; | |
| 107 | −} | |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | #include <linux/interrupt.h> |
| 24 | 24 | #include <linux/kdebug.h> |
| 25 | 25 | #include <linux/uaccess.h> |
| 26 | +#include <linux/extable.h> | |
| 26 | 27 | |
| 27 | 28 | #include <asm/page.h> |
| 28 | 29 | #include <asm/openprom.h> |
| @@ -54,54 +55,6 @@ static void __noreturn unhandled_fault(unsigned long address, · 25 unmodified lines | ||
| 54 | 55 | die_if_kernel("Oops", regs); |
| 55 | 56 | } |
| 56 | 57 | |
| 57 | −asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc, | |
| 58 | − unsigned long address) | |
| 59 | −{ | |
| 60 | − struct pt_regs regs; | |
| 61 | − unsigned long g2; | |
| 62 | − unsigned int insn; | |
| 63 | − int i; | |
| 64 | − | |
| 65 | − i = search_extables_range(ret_pc, &g2); | |
| 66 | − switch (i) { | |
| 67 | − case 3: | |
| 68 | − /* load & store will be handled by fixup */ | |
| 69 | − return 3; | |
| 70 | − | |
| 71 | − case 1: | |
| 72 | − /* store will be handled by fixup, load will bump out */ | |
| 73 | − /* for _to_ macros */ | |
| 74 | − insn = *((unsigned int *) pc); | |
| 75 | − if ((insn >> 21) & 1) | |
| 76 | − return 1; | |
| 77 | − break; | |
| 78 | − | |
| 79 | − case 2: | |
| 80 | − /* load will be handled by fixup, store will bump out */ | |
| 81 | − /* for _from_ macros */ | |
| 82 | − insn = *((unsigned int *) pc); | |
| 83 | − if (!((insn >> 21) & 1) || ((insn>>19)&0x3f) == 15) | |
| 84 | − return 2; | |
| 85 | − break; | |
| 86 | − | |
| 87 | − default: | |
| 88 | − break; | |
| 89 | − } | |
| 90 | − | |
| 91 | − memset(®s, 0, sizeof(regs)); | |
| 92 | − regs.pc = pc; | |
| 93 | − regs.npc = pc + 4; | |
| 94 | − __asm__ __volatile__( | |
| 95 | − "rd %%psr, %0\n\t" | |
| 96 | − "nop\n\t" | |
| 97 | − "nop\n\t" | |
| 98 | − "nop\n" : "=r" (regs.psr)); | |
| 99 | − unhandled_fault(address, current, ®s); | |
| 100 | − | |
| 101 | − /* Not reached */ | |
| 102 | − return 0; | |
| 103 | −} | |
| 104 | − | |
| 105 | 58 | static inline void |
| 106 | 59 | show_signal_msg(struct pt_regs *regs, int sig, int code, |
| 107 | 60 | unsigned long address, struct task_struct *tsk) |
| @@ -162,8 +115,6 @@ asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, · 54 unmodified lines | ||
| 162 | 115 | struct vm_area_struct *vma; |
| 163 | 116 | struct task_struct *tsk = current; |
| 164 | 117 | struct mm_struct *mm = tsk->mm; |
| 165 | − unsigned int fixup; | |
| 166 | − unsigned long g2; | |
| 167 | 118 | int from_user = !(regs->psr & PSR_PS); |
| 168 | 119 | int code; |
| 169 | 120 | vm_fault_t fault; |
| @@ -281,30 +232,19 @@ bad_area_nosemaphore: · 111 unmodified lines | ||
| 281 | 232 | |
| 282 | 233 | /* Is this in ex_table? */ |
| 283 | 234 | no_context: |
| 284 | − g2 = regs->u_regs[UREG_G2]; | |
| 285 | 235 | if (!from_user) { |
| 286 | − fixup = search_extables_range(regs->pc, &g2); | |
| 287 | − /* Values below 10 are reserved for other things */ | |
| 288 | − if (fixup > 10) { | |
| 289 | − extern const unsigned int __memset_start[]; | |
| 290 | − extern const unsigned int __memset_end[]; | |
| 236 | + const struct exception_table_entry *entry; | |
| 291 | 237 | |
| 238 | + entry = search_exception_tables(regs->pc); | |
| 292 | 239 | #ifdef DEBUG_EXCEPTIONS |
| 293 | − printk("Exception: PC<%08lx> faddr<%08lx>\n", | |
| 294 | − regs->pc, address); | |
| 295 | − printk("EX_TABLE: insn<%08lx> fixup<%08x> g2<%08lx>\n", | |
| 296 | − regs->pc, fixup, g2); | |
| 240 | + printk("Exception: PC<%08lx> faddr<%08lx>\n", | |
| 241 | + regs->pc, address); | |
| 242 | + printk("EX_TABLE: insn<%08lx> fixup<%08x>\n", | |
| 243 | + regs->pc, entry->fixup); | |
| 297 | 244 | #endif |
| 298 | − if ((regs->pc >= (unsigned long)__memset_start && | |
| 299 | − regs->pc < (unsigned long)__memset_end)) { | |
| 300 | − regs->u_regs[UREG_I4] = address; | |
| 301 | − regs->u_regs[UREG_I5] = regs->pc; | |
| 302 | − } | |
| 303 | − regs->u_regs[UREG_G2] = g2; | |
| 304 | − regs->pc = fixup; | |
| 305 | − regs->npc = regs->pc + 4; | |
| 306 | − return; | |
| 307 | − } | |
| 245 | + regs->pc = entry->fixup; | |
| 246 | + regs->npc = regs->pc + 4; | |
| 247 | + return; | |
| 308 | 248 | } |
| 309 | 249 | |
| 310 | 250 | unhandled_fault(address, tsk, regs); |
| @@ -1,7 +1,5 @@ | ||
| 1 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
| 2 | 2 | /* fault_32.c - visible as they are called from assembler */ |
| 3 | −asmlinkage int lookup_fault(unsigned long pc, unsigned long ret_pc, | |
| 4 | − unsigned long address); | |
| 5 | 3 | asmlinkage void do_sparc_fault(struct pt_regs *regs, int text_fault, int write, |
| 6 | 4 | unsigned long address); |
| 7 | 5 | |
| @@ -27,7 +27,7 @@ endif · 26 unmodified lines | ||
| 27 | 27 | REALMODE_CFLAGS := -m16 -g -Os -DDISABLE_BRANCH_PROFILING \ |
| 28 | 28 | -Wall -Wstrict-prototypes -march=i386 -mregparm=3 \ |
| 29 | 29 | -fno-strict-aliasing -fomit-frame-pointer -fno-pic \ |
| 30 | − -mno-mmx -mno-sse | |
| 30 | + -mno-mmx -mno-sse $(call cc-option,-fcf-protection=none) | |
| 31 | 31 | |
| 32 | 32 | REALMODE_CFLAGS += -ffreestanding |
| 33 | 33 | REALMODE_CFLAGS += -fno-stack-protector |
| @@ -128,7 +128,8 @@ static noinstr bool __do_fast_syscall_32(struct pt_regs *regs) · 127 unmodified lines | ||
| 128 | 128 | regs->ax = -EFAULT; |
| 129 | 129 | |
| 130 | 130 | instrumentation_end(); |
| 131 | − syscall_exit_to_user_mode(regs); | |
| 131 | + local_irq_disable(); | |
| 132 | + irqentry_exit_to_user_mode(regs); | |
| 132 | 133 | return false; |
| 133 | 134 | } |
| 134 | 135 | |
| @@ -210,6 +210,8 @@ SYM_CODE_START(entry_SYSCALL_compat) · 209 unmodified lines | ||
| 210 | 210 | /* Switch to the kernel stack */ |
| 211 | 211 | movq PER_CPU_VAR(cpu_current_top_of_stack), %rsp |
| 212 | 212 | |
| 213 | +SYM_INNER_LABEL(entry_SYSCALL_compat_safe_stack, SYM_L_GLOBAL) | |
| 214 | + | |
| 213 | 215 | /* Construct struct pt_regs on stack */ |
| 214 | 216 | pushq $__USER32_DS /* pt_regs->ss */ |
| 215 | 217 | pushq %r8 /* pt_regs->sp */ |
| @@ -81,7 +81,11 @@ DEFINE_STATIC_CALL_NULL(x86_pmu_swap_task_ctx, *x86_pmu.swap_task_ctx); · 80 unmodified lines | ||
| 81 | 81 | DEFINE_STATIC_CALL_NULL(x86_pmu_drain_pebs, *x86_pmu.drain_pebs); |
| 82 | 82 | DEFINE_STATIC_CALL_NULL(x86_pmu_pebs_aliases, *x86_pmu.pebs_aliases); |
| 83 | 83 | |
| 84 | −DEFINE_STATIC_CALL_NULL(x86_pmu_guest_get_msrs, *x86_pmu.guest_get_msrs); | |
| 84 | +/* | |
| 85 | + * This one is magic, it will get called even when PMU init fails (because | |
| 86 | + * there is no PMU), in which case it should simply return NULL. | |
| 87 | + */ | |
| 88 | +DEFINE_STATIC_CALL_RET0(x86_pmu_guest_get_msrs, *x86_pmu.guest_get_msrs); | |
| 85 | 89 | |
| 86 | 90 | u64 __read_mostly hw_cache_event_ids |
| 87 | 91 | [PERF_COUNT_HW_CACHE_MAX] |
| @@ -1944,13 +1948,6 @@ static void _x86_pmu_read(struct perf_event *event) · 1856 unmodified lines | ||
| 1944 | 1948 | x86_perf_event_update(event); |
| 1945 | 1949 | } |
| 1946 | 1950 | |
| 1947 | −static inline struct perf_guest_switch_msr * | |
| 1948 | −perf_guest_get_msrs_nop(int *nr) | |
| 1949 | −{ | |
| 1950 | − *nr = 0; | |
| 1951 | − return NULL; | |
| 1952 | −} | |
| 1953 | − | |
| 1954 | 1951 | static int __init init_hw_perf_events(void) |
| 1955 | 1952 | { |
| 1956 | 1953 | struct x86_pmu_quirk *quirk; |
| @@ -2025,7 +2022,7 @@ static int __init init_hw_perf_events(void) · 68 unmodified lines | ||
| 2025 | 2022 | x86_pmu.read = _x86_pmu_read; |
| 2026 | 2023 | |
| 2027 | 2024 | if (!x86_pmu.guest_get_msrs) |
| 2028 | − x86_pmu.guest_get_msrs = perf_guest_get_msrs_nop; | |
| 2025 | + x86_pmu.guest_get_msrs = (void *)&__static_call_return0; | |
| 2029 | 2026 | |
| 2030 | 2027 | x86_pmu_static_call_update(); |
| 2031 | 2028 | |
| @@ -3659,11 +3659,16 @@ static int intel_pmu_hw_config(struct perf_event *event) · 3658 unmodified lines | ||
| 3659 | 3659 | return ret; |
| 3660 | 3660 | |
| 3661 | 3661 | if (event->attr.precise_ip) { |
| 3662 | + if ((event->attr.config & INTEL_ARCH_EVENT_MASK) == INTEL_FIXED_VLBR_EVENT) | |
| 3663 | + return -EINVAL; | |
| 3664 | + | |
| 3662 | 3665 | if (!(event->attr.freq || (event->attr.wakeup_events && !event->attr.watermark))) { |
| 3663 | 3666 | event->hw.flags |= PERF_X86_EVENT_AUTO_RELOAD; |
| 3664 | 3667 | if (!(event->attr.sample_type & |
| 3665 | − ~intel_pmu_large_pebs_flags(event))) | |
| 3668 | + ~intel_pmu_large_pebs_flags(event))) { | |
| 3666 | 3669 | event->hw.flags |= PERF_X86_EVENT_LARGE_PEBS; |
| 3670 | + event->attach_state |= PERF_ATTACH_SCHED_CB; | |
| 3671 | + } | |
| 3667 | 3672 | } |
| 3668 | 3673 | if (x86_pmu.pebs_aliases) |
| 3669 | 3674 | x86_pmu.pebs_aliases(event); |
| @@ -3676,6 +3681,7 @@ static int intel_pmu_hw_config(struct perf_event *event) · 6 unmodified lines | ||
| 3676 | 3681 | ret = intel_pmu_setup_lbr_filter(event); |
| 3677 | 3682 | if (ret) |
| 3678 | 3683 | return ret; |
| 3684 | + event->attach_state |= PERF_ATTACH_SCHED_CB; | |
| 3679 | 3685 | |
| 3680 | 3686 | /* |
| 3681 | 3687 | * BTS is set up earlier in this path, so don't account twice |
| @@ -2010,7 +2010,7 @@ static void intel_pmu_drain_pebs_nhm(struct pt_regs *iregs, struct perf_sample_d · 2009 unmodified lines | ||
| 2010 | 2010 | */ |
| 2011 | 2011 | if (!pebs_status && cpuc->pebs_enabled && |
| 2012 | 2012 | !(cpuc->pebs_enabled & (cpuc->pebs_enabled-1))) |
| 2013 | − pebs_status = cpuc->pebs_enabled; | |
| 2013 | + pebs_status = p->status = cpuc->pebs_enabled; | |
| 2014 | 2014 | |
| 2015 | 2015 | bit = find_first_bit((unsigned long *)&pebs_status, |
| 2016 | 2016 | x86_pmu.max_pebs_events); |
| @@ -23,6 +23,8 @@ unsigned long insn_get_seg_base(struct pt_regs *regs, int seg_reg_idx); · 22 unmodified lines | ||
| 23 | 23 | int insn_get_code_seg_params(struct pt_regs *regs); |
| 24 | 24 | int insn_fetch_from_user(struct pt_regs *regs, |
| 25 | 25 | unsigned char buf[MAX_INSN_SIZE]); |
| 26 | +int insn_fetch_from_user_inatomic(struct pt_regs *regs, | |
| 27 | + unsigned char buf[MAX_INSN_SIZE]); | |
| 26 | 28 | bool insn_decode(struct insn *insn, struct pt_regs *regs, |
| 27 | 29 | unsigned char buf[MAX_INSN_SIZE], int buf_size); |
| 28 | 30 | |
| @@ -56,8 +56,13 @@ static inline bool kfence_protect_page(unsigned long addr, bool protect) · 55 unmodified lines | ||
| 56 | 56 | else |
| 57 | 57 | set_pte(pte, __pte(pte_val(*pte) | _PAGE_PRESENT)); |
| 58 | 58 | |
| 59 | − /* Flush this CPU's TLB. */ | |
| 59 | + /* | |
| 60 | + * Flush this CPU's TLB, assuming whoever did the allocation/free is | |
| 61 | + * likely to continue running on this CPU. | |
| 62 | + */ | |
| 63 | + preempt_disable(); | |
| 60 | 64 | flush_tlb_one_kernel(addr); |
| 65 | + preempt_enable(); | |
| 61 | 66 | return true; |
| 62 | 67 | } |
| 63 | 68 | |
| @@ -884,12 +884,29 @@ struct kvm_hv_syndbg { · 883 unmodified lines | ||
| 884 | 884 | u64 options; |
| 885 | 885 | }; |
| 886 | 886 | |
| 887 | +/* Current state of Hyper-V TSC page clocksource */ | |
| 888 | +enum hv_tsc_page_status { | |
| 889 | + /* TSC page was not set up or disabled */ | |
| 890 | + HV_TSC_PAGE_UNSET = 0, | |
| 891 | + /* TSC page MSR was written by the guest, update pending */ | |
| 892 | + HV_TSC_PAGE_GUEST_CHANGED, | |
| 893 | + /* TSC page MSR was written by KVM userspace, update pending */ | |
| 894 | + HV_TSC_PAGE_HOST_CHANGED, | |
| 895 | + /* TSC page was properly set up and is currently active */ | |
| 896 | + HV_TSC_PAGE_SET, | |
| 897 | + /* TSC page is currently being updated and therefore is inactive */ | |
| 898 | + HV_TSC_PAGE_UPDATING, | |
| 899 | + /* TSC page was set up with an inaccessible GPA */ | |
| 900 | + HV_TSC_PAGE_BROKEN, | |
| 901 | +}; | |
| 902 | + | |
| 887 | 903 | /* Hyper-V emulation context */ |
| 888 | 904 | struct kvm_hv { |
| 889 | 905 | struct mutex hv_lock; |
| 890 | 906 | u64 hv_guest_os_id; |
| 891 | 907 | u64 hv_hypercall; |
| 892 | 908 | u64 hv_tsc_page; |
| 909 | + enum hv_tsc_page_status hv_tsc_page_status; | |
| 893 | 910 | |
| 894 | 911 | /* Hyper-v based guest crash (NT kernel bugcheck) parameters */ |
| 895 | 912 | u64 hv_crash_param[HV_X64_MSR_CRASH_PARAMS]; |
| @@ -931,6 +948,12 @@ enum kvm_irqchip_mode { · 35 unmodified lines | ||
| 931 | 948 | KVM_IRQCHIP_SPLIT, /* created with KVM_CAP_SPLIT_IRQCHIP */ |
| 932 | 949 | }; |
| 933 | 950 | |
| 951 | +struct kvm_x86_msr_filter { | |
| 952 | + u8 count; | |
| 953 | + bool default_allow:1; | |
| 954 | + struct msr_bitmap_range ranges[16]; | |
| 955 | +}; | |
| 956 | + | |
| 934 | 957 | #define APICV_INHIBIT_REASON_DISABLE 0 |
| 935 | 958 | #define APICV_INHIBIT_REASON_HYPERV 1 |
| 936 | 959 | #define APICV_INHIBIT_REASON_NESTED 2 |
| @@ -963,7 +986,7 @@ struct kvm_arch { · 26 unmodified lines | ||
| 963 | 986 | struct kvm_pit *vpit; |
| 964 | 987 | atomic_t vapics_in_nmi_mode; |
| 965 | 988 | struct mutex apic_map_lock; |
| 966 | − struct kvm_apic_map *apic_map; | |
| 989 | + struct kvm_apic_map __rcu *apic_map; | |
| 967 | 990 | atomic_t apic_map_dirty; |
| 968 | 991 | |
| 969 | 992 | bool apic_access_page_done; |
| @@ -1025,18 +1048,13 @@ struct kvm_arch { · 55 unmodified lines | ||
| 1025 | 1048 | bool guest_can_read_msr_platform_info; |
| 1026 | 1049 | bool exception_payload_enabled; |
| 1027 | 1050 | |
| 1051 | + bool bus_lock_detection_enabled; | |
| 1052 | + | |
| 1028 | 1053 | /* Deflect RDMSR and WRMSR to user space when they trigger a #GP */ |
| 1029 | 1054 | u32 user_space_msr_mask; |
| 1055 | + struct kvm_x86_msr_filter __rcu *msr_filter; | |
| 1030 | 1056 | |
| 1031 | − struct { | |
| 1032 | − u8 count; | |
| 1033 | − bool default_allow:1; | |
| 1034 | − struct msr_bitmap_range ranges[16]; | |
| 1035 | − } msr_filter; | |
| 1036 | − | |
| 1037 | − bool bus_lock_detection_enabled; | |
| 1038 | − | |
| 1039 | − struct kvm_pmu_event_filter *pmu_event_filter; | |
| 1057 | + struct kvm_pmu_event_filter __rcu *pmu_event_filter; | |
| 1040 | 1058 | struct task_struct *nx_lpage_recovery_thread; |
| 1041 | 1059 | |
| 1042 | 1060 | #ifdef CONFIG_X86_64 |
| @@ -551,15 +551,6 @@ static inline void arch_thread_struct_whitelist(unsigned long *offset, · 550 unmodified lines | ||
| 551 | 551 | *size = fpu_kernel_xstate_size; |
| 552 | 552 | } |
| 553 | 553 | |
| 554 | −/* | |
| 555 | − * Thread-synchronous status. | |
| 556 | − * | |
| 557 | − * This is different from the flags in that nobody else | |
| 558 | − * ever touches our thread-synchronous status, so we don't | |
| 559 | − * have to worry about atomic accesses. | |
| 560 | − */ | |
| 561 | −#define TS_COMPAT 0x0002 /* 32bit syscall active (64BIT)*/ | |
| 562 | − | |
| 563 | 554 | static inline void |
| 564 | 555 | native_load_sp0(unsigned long sp0) |
| 565 | 556 | { |
| @@ -25,6 +25,7 @@ void __end_SYSENTER_singlestep_region(void); · 24 unmodified lines | ||
| 25 | 25 | void entry_SYSENTER_compat(void); |
| 26 | 26 | void __end_entry_SYSENTER_compat(void); |
| 27 | 27 | void entry_SYSCALL_compat(void); |
| 28 | +void entry_SYSCALL_compat_safe_stack(void); | |
| 28 | 29 | void entry_INT80_compat(void); |
| 29 | 30 | #ifdef CONFIG_XEN_PV |
| 30 | 31 | void xen_entry_INT80_compat(void); |
| @@ -94,6 +94,8 @@ struct pt_regs { · 93 unmodified lines | ||
| 94 | 94 | #include <asm/paravirt_types.h> |
| 95 | 95 | #endif |
| 96 | 96 | |
| 97 | +#include <asm/proto.h> | |
| 98 | + | |
| 97 | 99 | struct cpuinfo_x86; |
| 98 | 100 | struct task_struct; |
| 99 | 101 | |
| @@ -175,6 +177,19 @@ static inline bool any_64bit_mode(struct pt_regs *regs) · 75 unmodified lines | ||
| 175 | 177 | #ifdef CONFIG_X86_64 |
| 176 | 178 | #define current_user_stack_pointer() current_pt_regs()->sp |
| 177 | 179 | #define compat_user_stack_pointer() current_pt_regs()->sp |
| 180 | + | |
| 181 | +static inline bool ip_within_syscall_gap(struct pt_regs *regs) | |
| 182 | +{ | |
| 183 | + bool ret = (regs->ip >= (unsigned long)entry_SYSCALL_64 && | |
| 184 | + regs->ip < (unsigned long)entry_SYSCALL_64_safe_stack); | |
| 185 | + | |
| 186 | +#ifdef CONFIG_IA32_EMULATION | |
| 187 | + ret = ret || (regs->ip >= (unsigned long)entry_SYSCALL_compat && | |
| 188 | + regs->ip < (unsigned long)entry_SYSCALL_compat_safe_stack); | |
| 189 | +#endif | |
| 190 | + | |
| 191 | + return ret; | |
| 192 | +} | |
| 178 | 193 | #endif |
| 179 | 194 | |
| 180 | 195 | static inline unsigned long kernel_stack_pointer(struct pt_regs *regs) |
| @@ -58,9 +58,8 @@ static __always_inline unsigned long smap_save(void) · 57 unmodified lines | ||
| 58 | 58 | unsigned long flags; |
| 59 | 59 | |
| 60 | 60 | asm volatile ("# smap_save\n\t" |
| 61 | − ALTERNATIVE("jmp 1f", "", X86_FEATURE_SMAP) | |
| 62 | − "pushf; pop %0; " __ASM_CLAC "\n\t" | |
| 63 | − "1:" | |
| 61 | + ALTERNATIVE("", "pushf; pop %0; " __ASM_CLAC "\n\t", | |
| 62 | + X86_FEATURE_SMAP) | |
| 64 | 63 | : "=rm" (flags) : : "memory", "cc"); |
| 65 | 64 | |
| 66 | 65 | return flags; |
| @@ -69,9 +68,8 @@ static __always_inline unsigned long smap_save(void) · 2 unmodified lines | ||
| 69 | 68 | static __always_inline void smap_restore(unsigned long flags) |
| 70 | 69 | { |
| 71 | 70 | asm volatile ("# smap_restore\n\t" |
| 72 | − ALTERNATIVE("jmp 1f", "", X86_FEATURE_SMAP) | |
| 73 | − "push %0; popf\n\t" | |
| 74 | − "1:" | |
| 71 | + ALTERNATIVE("", "push %0; popf\n\t", | |
| 72 | + X86_FEATURE_SMAP) | |
| 75 | 73 | : : "g" (flags) : "memory", "cc"); |
| 76 | 74 | } |
| 77 | 75 | |
| @@ -132,6 +132,7 @@ void native_play_dead(void); · 131 unmodified lines | ||
| 132 | 132 | void play_dead_common(void); |
| 133 | 133 | void wbinvd_on_cpu(int cpu); |
| 134 | 134 | int wbinvd_on_all_cpus(void); |
| 135 | +void cond_wakeup_cpu0(void); | |
| 135 | 136 | |
| 136 | 137 | void native_smp_send_reschedule(int cpu); |
| 137 | 138 | void native_send_call_func_ipi(const struct cpumask *mask); |
| @@ -205,10 +205,23 @@ static inline int arch_within_stack_frames(const void * const stack, · 204 unmodified lines | ||
| 205 | 205 | |
| 206 | 206 | #endif |
| 207 | 207 | |
| 208 | +/* | |
| 209 | + * Thread-synchronous status. | |
| 210 | + * | |
| 211 | + * This is different from the flags in that nobody else | |
| 212 | + * ever touches our thread-synchronous status, so we don't | |
| 213 | + * have to worry about atomic accesses. | |
| 214 | + */ | |
| 215 | +#define TS_COMPAT 0x0002 /* 32bit syscall active (64BIT)*/ | |
| 216 | + | |
| 217 | +#ifndef __ASSEMBLY__ | |
| 208 | 218 | #ifdef CONFIG_COMPAT |
| 209 | 219 | #define TS_I386_REGS_POKED 0x0004 /* regs poked by 32-bit ptracer */ |
| 220 | + | |
| 221 | +#define arch_set_restart_data(restart) \ | |
| 222 | + do { restart->arch_data = current_thread_info()->status; } while (0) | |
| 223 | + | |
| 210 | 224 | #endif |
| 211 | −#ifndef __ASSEMBLY__ | |
| 212 | 225 | |
| 213 | 226 | #ifdef CONFIG_X86_32 |
| 214 | 227 | #define in_ia32_syscall() true |
| @@ -86,18 +86,6 @@ clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops, · 85 unmodified lines | ||
| 86 | 86 | } |
| 87 | 87 | #endif |
| 88 | 88 | |
| 89 | −/* | |
| 90 | − * The maximum amount of extra memory compared to the base size. The | |
| 91 | − * main scaling factor is the size of struct page. At extreme ratios | |
| 92 | − * of base:extra, all the base memory can be filled with page | |
| 93 | − * structures for the extra memory, leaving no space for anything | |
| 94 | − * else. | |
| 95 | − * | |
| 96 | − * 10x seems like a reasonable balance between scaling flexibility and | |
| 97 | − * leaving a practically usable system. | |
| 98 | − */ | |
| 99 | −#define XEN_EXTRA_MEM_RATIO (10) | |
| 100 | − | |
| 101 | 89 | /* |
| 102 | 90 | * Helper functions to write or read unsigned long values to/from |
| 103 | 91 | * memory, when the access may fault. |
| @@ -1554,10 +1554,18 @@ void __init acpi_boot_table_init(void) · 1553 unmodified lines | ||
| 1554 | 1554 | /* |
| 1555 | 1555 | * Initialize the ACPI boot-time table parser. |
| 1556 | 1556 | */ |
| 1557 | − if (acpi_table_init()) { | |
| 1557 | + if (acpi_locate_initial_tables()) | |
| 1558 | 1558 | disable_acpi(); |
| 1559 | − return; | |
| 1560 | − } | |
| 1559 | + else | |
| 1560 | + acpi_reserve_initial_tables(); | |
| 1561 | +} | |
| 1562 | + | |
| 1563 | +int __init early_acpi_boot_init(void) | |
| 1564 | +{ | |
| 1565 | + if (acpi_disabled) | |
| 1566 | + return 1; | |
| 1567 | + | |
| 1568 | + acpi_table_init_complete(); | |
| 1561 | 1569 | |
| 1562 | 1570 | acpi_table_parse(ACPI_SIG_BOOT, acpi_parse_sbf); |
| 1563 | 1571 | |
| @@ -1570,18 +1578,9 @@ void __init acpi_boot_table_init(void) · 6 unmodified lines | ||
| 1570 | 1578 | } else { |
| 1571 | 1579 | printk(KERN_WARNING PREFIX "Disabling ACPI support\n"); |
| 1572 | 1580 | disable_acpi(); |
| 1573 | − return; | |
| 1581 | + return 1; | |
| 1574 | 1582 | } |
| 1575 | 1583 | } |
| 1576 | −} | |
| 1577 | − | |
| 1578 | −int __init early_acpi_boot_init(void) | |
| 1579 | −{ | |
| 1580 | − /* | |
| 1581 | − * If acpi_disabled, bail out | |
| 1582 | − */ | |
| 1583 | − if (acpi_disabled) | |
| 1584 | − return 1; | |
| 1585 | 1584 | |
| 1586 | 1585 | /* |
| 1587 | 1586 | * Process the Multiple APIC Description Table (MADT), if present |
| @@ -115,7 +115,7 @@ SYM_FUNC_START(do_suspend_lowlevel) · 114 unmodified lines | ||
| 115 | 115 | movq pt_regs_r14(%rax), %r14 |
| 116 | 116 | movq pt_regs_r15(%rax), %r15 |
| 117 | 117 | |
| 118 | −#if defined(CONFIG_KASAN) && CONFIG_KASAN_STACK | |
| 118 | +#if defined(CONFIG_KASAN) && defined(CONFIG_KASAN_STACK) | |
| 119 | 119 | /* |
| 120 | 120 | * The suspend path may have poisoned some areas deeper in the stack, |
| 121 | 121 | * which we now need to unpoison. |
| @@ -2342,6 +2342,11 @@ static int cpuid_to_apicid[] = { · 2341 unmodified lines | ||
| 2342 | 2342 | [0 ... NR_CPUS - 1] = -1, |
| 2343 | 2343 | }; |
| 2344 | 2344 | |
| 2345 | +bool arch_match_cpu_phys_id(int cpu, u64 phys_id) | |
| 2346 | +{ | |
| 2347 | + return phys_id == cpuid_to_apicid[cpu]; | |
| 2348 | +} | |
| 2349 | + | |
| 2345 | 2350 | #ifdef CONFIG_SMP |
| 2346 | 2351 | /** |
| 2347 | 2352 | * apic_id_is_primary_thread - Check whether APIC ID belongs to a primary thread |
| @@ -1032,6 +1032,16 @@ static int mp_map_pin_to_irq(u32 gsi, int idx, int ioapic, int pin, · 1031 unmodified lines | ||
| 1032 | 1032 | if (idx >= 0 && test_bit(mp_irqs[idx].srcbus, mp_bus_not_pci)) { |
| 1033 | 1033 | irq = mp_irqs[idx].srcbusirq; |
| 1034 | 1034 | legacy = mp_is_legacy_irq(irq); |
| 1035 | + /* | |
| 1036 | + * IRQ2 is unusable for historical reasons on systems which | |
| 1037 | + * have a legacy PIC. See the comment vs. IRQ2 further down. | |
| 1038 | + * | |
| 1039 | + * If this gets removed at some point then the related code | |
| 1040 | + * in lapic_assign_system_vectors() needs to be adjusted as | |
| 1041 | + * well. | |
| 1042 | + */ | |
| 1043 | + if (legacy && irq == PIC_CASCADE_IR) | |
| 1044 | + return -EINVAL; | |
| 1035 | 1045 | } |
| 1036 | 1046 | |
| 1037 | 1047 | mutex_lock(&ioapic_mutex); |
| @@ -12,7 +12,7 @@ · 11 unmodified lines | ||
| 12 | 12 | |
| 13 | 13 | #include "common.h" |
| 14 | 14 | |
| 15 | −/* Ftrace callback handler for kprobes -- called under preepmt disabed */ | |
| 15 | +/* Ftrace callback handler for kprobes -- called under preepmt disabled */ | |
| 16 | 16 | void kprobe_ftrace_handler(unsigned long ip, unsigned long parent_ip, |
| 17 | 17 | struct ftrace_ops *ops, struct ftrace_regs *fregs) |
| 18 | 18 | { |
| @@ -836,28 +836,25 @@ static void kvm_kick_cpu(int cpu) · 835 unmodified lines | ||
| 836 | 836 | |
| 837 | 837 | static void kvm_wait(u8 *ptr, u8 val) |
| 838 | 838 | { |
| 839 | − unsigned long flags; | |
| 840 | − | |
| 841 | 839 | if (in_nmi()) |
| 842 | 840 | return; |
| 843 | 841 | |
| 844 | − local_irq_save(flags); | |
| 845 | − | |
| 846 | − if (READ_ONCE(*ptr) != val) | |
| 847 | − goto out; | |
| 848 | − | |
| 849 | 842 | /* |
| 850 | 843 | * halt until it's our turn and kicked. Note that we do safe halt |
| 851 | 844 | * for irq enabled case to avoid hang when lock info is overwritten |
| 852 | 845 | * in irq spinlock slowpath and no spurious interrupt occur to save us. |
| 853 | 846 | */ |
| 854 | − if (arch_irqs_disabled_flags(flags)) | |
| 855 | − halt(); | |
| 856 | − else | |
| 857 | − safe_halt(); | |
| 847 | + if (irqs_disabled()) { | |
| 848 | + if (READ_ONCE(*ptr) == val) | |
| 849 | + halt(); | |
| 850 | + } else { | |
| 851 | + local_irq_disable(); | |
| 858 | 852 | |
| 859 | −out: | |
| 860 | − local_irq_restore(flags); | |
| 853 | + if (READ_ONCE(*ptr) == val) | |
| 854 | + safe_halt(); | |
| 855 | + | |
| 856 | + local_irq_enable(); | |
| 857 | + } | |
| 861 | 858 | } |
| 862 | 859 | |
| 863 | 860 | #ifdef CONFIG_X86_32 |
| @@ -268,21 +268,20 @@ static void __init kvmclock_init_mem(void) · 267 unmodified lines | ||
| 268 | 268 | |
| 269 | 269 | static int __init kvm_setup_vsyscall_timeinfo(void) |
| 270 | 270 | { |
| 271 | −#ifdef CONFIG_X86_64 | |
| 272 | − u8 flags; | |
| 271 | + kvmclock_init_mem(); | |
| 273 | 272 | |
| 274 | − if (!per_cpu(hv_clock_per_cpu, 0) || !kvmclock_vsyscall) | |
| 275 | − return 0; | |
| 273 | +#ifdef CONFIG_X86_64 | |
| 274 | + if (per_cpu(hv_clock_per_cpu, 0) && kvmclock_vsyscall) { | |
| 275 | + u8 flags; | |
| 276 | 276 | |
| 277 | − flags = pvclock_read_flags(&hv_clock_boot[0].pvti); | |
| 278 | − if (!(flags & PVCLOCK_TSC_STABLE_BIT)) | |
| 279 | − return 0; | |
| 277 | + flags = pvclock_read_flags(&hv_clock_boot[0].pvti); | |
| 278 | + if (!(flags & PVCLOCK_TSC_STABLE_BIT)) | |
| 279 | + return 0; | |
| 280 | 280 | |
| 281 | − kvm_clock.vdso_clock_mode = VDSO_CLOCKMODE_PVCLOCK; | |
| 281 | + kvm_clock.vdso_clock_mode = VDSO_CLOCKMODE_PVCLOCK; | |
| 282 | + } | |
| 282 | 283 | #endif |
| 283 | 284 | |
| 284 | − kvmclock_init_mem(); | |
| 285 | − | |
| 286 | 285 | return 0; |
| 287 | 286 | } |
| 288 | 287 | early_initcall(kvm_setup_vsyscall_timeinfo); |
| @@ -1129,6 +1129,8 @@ void __init setup_arch(char **cmdline_p) · 1128 unmodified lines | ||
| 1129 | 1129 | reserve_initrd(); |
| 1130 | 1130 | |
| 1131 | 1131 | acpi_table_upgrade(); |
| 1132 | + /* Look for ACPI tables and reserve memory occupied by them. */ | |
| 1133 | + acpi_boot_table_init(); | |
| 1132 | 1134 | |
| 1133 | 1135 | vsmp_init(); |
| 1134 | 1136 | |
| @@ -1136,11 +1138,6 @@ void __init setup_arch(char **cmdline_p) · 1 unmodified line | ||
| 1136 | 1138 | |
| 1137 | 1139 | early_platform_quirks(); |
| 1138 | 1140 | |
| 1139 | − /* | |
| 1140 | − * Parse the ACPI tables for possible boot-time SMP configuration. | |
| 1141 | − */ | |
| 1142 | − acpi_boot_table_init(); | |
| 1143 | − | |
| 1144 | 1141 | early_acpi_boot_init(); |
| 1145 | 1142 | |
| 1146 | 1143 | initmem_init(); |
| @@ -121,8 +121,18 @@ static void __init setup_vc_stacks(int cpu) · 120 unmodified lines | ||
| 121 | 121 | cea_set_pte((void *)vaddr, pa, PAGE_KERNEL); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | −static __always_inline bool on_vc_stack(unsigned long sp) | |
| 124 | +static __always_inline bool on_vc_stack(struct pt_regs *regs) | |
| 125 | 125 | { |
| 126 | + unsigned long sp = regs->sp; | |
| 127 | + | |
| 128 | + /* User-mode RSP is not trusted */ | |
| 129 | + if (user_mode(regs)) | |
| 130 | + return false; | |
| 131 | + | |
| 132 | + /* SYSCALL gap still has user-mode RSP */ | |
| 133 | + if (ip_within_syscall_gap(regs)) | |
| 134 | + return false; | |
| 135 | + | |
| 126 | 136 | return ((sp >= __this_cpu_ist_bottom_va(VC)) && (sp < __this_cpu_ist_top_va(VC))); |
| 127 | 137 | } |
| 128 | 138 | |
| @@ -144,7 +154,7 @@ void noinstr __sev_es_ist_enter(struct pt_regs *regs) · 15 unmodified lines | ||
| 144 | 154 | old_ist = __this_cpu_read(cpu_tss_rw.x86_tss.ist[IST_INDEX_VC]); |
| 145 | 155 | |
| 146 | 156 | /* Make room on the IST stack */ |
| 147 | − if (on_vc_stack(regs->sp)) | |
| 157 | + if (on_vc_stack(regs)) | |
| 148 | 158 | new_ist = ALIGN_DOWN(regs->sp, 8) - sizeof(old_ist); |
| 149 | 159 | else |
| 150 | 160 | new_ist = old_ist - sizeof(old_ist); |
| @@ -248,7 +258,7 @@ static enum es_result vc_decode_insn(struct es_em_ctxt *ctxt) · 97 unmodified lines | ||
| 248 | 258 | int res; |
| 249 | 259 | |
| 250 | 260 | if (user_mode(ctxt->regs)) { |
| 251 | − res = insn_fetch_from_user(ctxt->regs, buffer); | |
| 261 | + res = insn_fetch_from_user_inatomic(ctxt->regs, buffer); | |
| 252 | 262 | if (!res) { |
| 253 | 263 | ctxt->fi.vector = X86_TRAP_PF; |
| 254 | 264 | ctxt->fi.error_code = X86_PF_INSTR | X86_PF_USER; |
| @@ -1248,13 +1258,12 @@ static __always_inline bool on_vc_fallback_stack(struct pt_regs *regs) · 993 unmodified lines | ||
| 1248 | 1258 | DEFINE_IDTENTRY_VC_SAFE_STACK(exc_vmm_communication) |
| 1249 | 1259 | { |
| 1250 | 1260 | struct sev_es_runtime_data *data = this_cpu_read(runtime_data); |
| 1261 | + irqentry_state_t irq_state; | |
| 1251 | 1262 | struct ghcb_state state; |
| 1252 | 1263 | struct es_em_ctxt ctxt; |
| 1253 | 1264 | enum es_result result; |
| 1254 | 1265 | struct ghcb *ghcb; |
| 1255 | 1266 | |
| 1256 | − lockdep_assert_irqs_disabled(); | |
| 1257 | − | |
| 1258 | 1267 | /* |
| 1259 | 1268 | * Handle #DB before calling into !noinstr code to avoid recursive #DB. |
| 1260 | 1269 | */ |
| @@ -1263,6 +1272,8 @@ DEFINE_IDTENTRY_VC_SAFE_STACK(exc_vmm_communication) · 2 unmodified lines | ||
| 1263 | 1272 | return; |
| 1264 | 1273 | } |
| 1265 | 1274 | |
| 1275 | + irq_state = irqentry_nmi_enter(regs); | |
| 1276 | + lockdep_assert_irqs_disabled(); | |
| 1266 | 1277 | instrumentation_begin(); |
| 1267 | 1278 | |
| 1268 | 1279 | /* |
| @@ -1325,6 +1336,7 @@ DEFINE_IDTENTRY_VC_SAFE_STACK(exc_vmm_communication) · 56 unmodified lines | ||
| 1325 | 1336 | |
| 1326 | 1337 | out: |
| 1327 | 1338 | instrumentation_end(); |
| 1339 | + irqentry_nmi_exit(regs, irq_state); | |
| 1328 | 1340 | |
| 1329 | 1341 | return; |
| 1330 | 1342 | |
| @@ -766,30 +766,8 @@ handle_signal(struct ksignal *ksig, struct pt_regs *regs) · 765 unmodified lines | ||
| 766 | 766 | |
| 767 | 767 | static inline unsigned long get_nr_restart_syscall(const struct pt_regs *regs) |
| 768 | 768 | { |
| 769 | − /* | |
| 770 | − * This function is fundamentally broken as currently | |
| 771 | − * implemented. | |
| 772 | − * | |
| 773 | − * The idea is that we want to trigger a call to the | |
| 774 | − * restart_block() syscall and that we want in_ia32_syscall(), | |
| 775 | − * in_x32_syscall(), etc. to match whatever they were in the | |
| 776 | − * syscall being restarted. We assume that the syscall | |
| 777 | − * instruction at (regs->ip - 2) matches whatever syscall | |
| 778 | − * instruction we used to enter in the first place. | |
| 779 | − * | |
| 780 | − * The problem is that we can get here when ptrace pokes | |
| 781 | − * syscall-like values into regs even if we're not in a syscall | |
| 782 | − * at all. | |
| 783 | − * | |
| 784 | − * For now, we maintain historical behavior and guess based on | |
| 785 | − * stored state. We could do better by saving the actual | |
| 786 | − * syscall arch in restart_block or (with caveats on x32) by | |
| 787 | − * checking if regs->ip points to 'int $0x80'. The current | |
| 788 | − * behavior is incorrect if a tracer has a different bitness | |
| 789 | − * than the tracee. | |
| 790 | − */ | |
| 791 | 769 | #ifdef CONFIG_IA32_EMULATION |
| 792 | − if (current_thread_info()->status & (TS_COMPAT|TS_I386_REGS_POKED)) | |
| 770 | + if (current->restart_block.arch_data & TS_COMPAT) | |
| 793 | 771 | return __NR_ia32_restart_syscall; |
| 794 | 772 | #endif |
| 795 | 773 | #ifdef CONFIG_X86_X32_ABI |
| @@ -1659,13 +1659,17 @@ void play_dead_common(void) · 1658 unmodified lines | ||
| 1659 | 1659 | local_irq_disable(); |
| 1660 | 1660 | } |
| 1661 | 1661 | |
| 1662 | −static bool wakeup_cpu0(void) | |
| 1662 | +/** | |
| 1663 | + * cond_wakeup_cpu0 - Wake up CPU0 if needed. | |
| 1664 | + * | |
| 1665 | + * If NMI wants to wake up CPU0, start CPU0. | |
| 1666 | + */ | |
| 1667 | +void cond_wakeup_cpu0(void) | |
| 1663 | 1668 | { |
| 1664 | 1669 | if (smp_processor_id() == 0 && enable_start_cpu0) |
| 1665 | − return true; | |
| 1666 | − | |
| 1667 | − return false; | |
| 1670 | + start_cpu0(); | |
| 1668 | 1671 | } |
| 1672 | +EXPORT_SYMBOL_GPL(cond_wakeup_cpu0); | |
| 1669 | 1673 | |
| 1670 | 1674 | /* |
| 1671 | 1675 | * We need to flush the caches before going to sleep, lest we have |
| @@ -1734,11 +1738,8 @@ static inline void mwait_play_dead(void) · 62 unmodified lines | ||
| 1734 | 1738 | __monitor(mwait_ptr, 0, 0); |
| 1735 | 1739 | mb(); |
| 1736 | 1740 | __mwait(eax, 0); |
| 1737 | − /* | |
| 1738 | − * If NMI wants to wake up CPU0, start CPU0. | |
| 1739 | − */ | |
| 1740 | − if (wakeup_cpu0()) | |
| 1741 | − start_cpu0(); | |
| 1741 | + | |
| 1742 | + cond_wakeup_cpu0(); | |
| 1742 | 1743 | } |
| 1743 | 1744 | } |
| 1744 | 1745 | |
| @@ -1749,11 +1750,8 @@ void hlt_play_dead(void) · 4 unmodified lines | ||
| 1749 | 1750 | |
| 1750 | 1751 | while (1) { |
| 1751 | 1752 | native_halt(); |
| 1752 | − /* | |
| 1753 | − * If NMI wants to wake up CPU0, start CPU0. | |
| 1754 | − */ | |
| 1755 | − if (wakeup_cpu0()) | |
| 1756 | − start_cpu0(); | |
| 1753 | + | |
| 1754 | + cond_wakeup_cpu0(); | |
| 1757 | 1755 | } |
| 1758 | 1756 | } |
| 1759 | 1757 | |
| @@ -556,7 +556,7 @@ DEFINE_IDTENTRY_ERRORCODE(exc_general_protection) · 555 unmodified lines | ||
| 556 | 556 | tsk->thread.trap_nr = X86_TRAP_GP; |
| 557 | 557 | |
| 558 | 558 | if (fixup_vdso_exception(regs, X86_TRAP_GP, error_code, 0)) |
| 559 | − return; | |
| 559 | + goto exit; | |
| 560 | 560 | |
| 561 | 561 | show_signal(tsk, SIGSEGV, "", desc, regs, error_code); |
| 562 | 562 | force_sig(SIGSEGV); |
| @@ -694,8 +694,7 @@ asmlinkage __visible noinstr struct pt_regs *vc_switch_off_ist(struct pt_regs *r · 131 unmodified lines | ||
| 694 | 694 | * In the SYSCALL entry path the RSP value comes from user-space - don't |
| 695 | 695 | * trust it and switch to the current kernel stack |
| 696 | 696 | */ |
| 697 | − if (regs->ip >= (unsigned long)entry_SYSCALL_64 && | |
| 698 | − regs->ip < (unsigned long)entry_SYSCALL_64_safe_stack) { | |
| 697 | + if (ip_within_syscall_gap(regs)) { | |
| 699 | 698 | sp = this_cpu_read(cpu_current_top_of_stack); |
| 700 | 699 | goto sync; |
| 701 | 700 | } |
| @@ -1058,7 +1057,7 @@ static void math_error(struct pt_regs *regs, int trapnr) · 356 unmodified lines | ||
| 1058 | 1057 | goto exit; |
| 1059 | 1058 | |
| 1060 | 1059 | if (fixup_vdso_exception(regs, trapnr, 0, 0)) |
| 1061 | − return; | |
| 1060 | + goto exit; | |
| 1062 | 1061 | |
| 1063 | 1062 | force_sig_fault(SIGFPE, si_code, |
| 1064 | 1063 | (void __user *)uprobe_get_trap_addr(regs)); |
| @@ -13,7 +13,7 @@ · 12 unmodified lines | ||
| 13 | 13 | |
| 14 | 14 | #define orc_warn_current(args...) \ |
| 15 | 15 | ({ \ |
| 16 | − if (state->task == current) \ | |
| 16 | + if (state->task == current && !state->error) \ | |
| 17 | 17 | orc_warn(args); \ |
| 18 | 18 | }) |
| 19 | 19 | |
| @@ -367,8 +367,8 @@ static bool deref_stack_regs(struct unwind_state *state, unsigned long addr, · 347 unmodified lines | ||
| 367 | 367 | if (!stack_access_ok(state, addr, sizeof(struct pt_regs))) |
| 368 | 368 | return false; |
| 369 | 369 | |
| 370 | − *ip = regs->ip; | |
| 371 | − *sp = regs->sp; | |
| 370 | + *ip = READ_ONCE_NOCHECK(regs->ip); | |
| 371 | + *sp = READ_ONCE_NOCHECK(regs->sp); | |
| 372 | 372 | return true; |
| 373 | 373 | } |
| 374 | 374 | |
| @@ -380,8 +380,8 @@ static bool deref_stack_iret_regs(struct unwind_state *state, unsigned long addr · 5 unmodified lines | ||
| 380 | 380 | if (!stack_access_ok(state, addr, IRET_FRAME_SIZE)) |
| 381 | 381 | return false; |
| 382 | 382 | |
| 383 | − *ip = regs->ip; | |
| 384 | − *sp = regs->sp; | |
| 383 | + *ip = READ_ONCE_NOCHECK(regs->ip); | |
| 384 | + *sp = READ_ONCE_NOCHECK(regs->sp); | |
| 385 | 385 | return true; |
| 386 | 386 | } |
| 387 | 387 | |
| @@ -402,12 +402,12 @@ static bool get_reg(struct unwind_state *state, unsigned int reg_off, · 14 unmodified lines | ||
| 402 | 402 | return false; |
| 403 | 403 | |
| 404 | 404 | if (state->full_regs) { |
| 405 | − *val = ((unsigned long *)state->regs)[reg]; | |
| 405 | + *val = READ_ONCE_NOCHECK(((unsigned long *)state->regs)[reg]); | |
| 406 | 406 | return true; |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | 409 | if (state->prev_regs) { |
| 410 | − *val = ((unsigned long *)state->prev_regs)[reg]; | |
| 410 | + *val = READ_ONCE_NOCHECK(((unsigned long *)state->prev_regs)[reg]); | |
| 411 | 411 | return true; |
| 412 | 412 | } |
| 413 | 413 | |
| @@ -1,6 +1,6 @@ | ||
| 1 | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | 2 | |
| 3 | −ccflags-y += -Iarch/x86/kvm | |
| 3 | +ccflags-y += -I $(srctree)/arch/x86/kvm | |
| 4 | 4 | ccflags-$(CONFIG_KVM_WERROR) += -Werror |
| 5 | 5 | |
| 6 | 6 | ifeq ($(CONFIG_FRAME_POINTER),y) |
| @@ -520,10 +520,10 @@ static u64 get_time_ref_counter(struct kvm *kvm) · 519 unmodified lines | ||
| 520 | 520 | u64 tsc; |
| 521 | 521 | |
| 522 | 522 | /* |
| 523 | − * The guest has not set up the TSC page or the clock isn't | |
| 524 | − * stable, fall back to get_kvmclock_ns. | |
| 523 | + * Fall back to get_kvmclock_ns() when TSC page hasn't been set up, | |
| 524 | + * is broken, disabled or being updated. | |
| 525 | 525 | */ |
| 526 | − if (!hv->tsc_ref.tsc_sequence) | |
| 526 | + if (hv->hv_tsc_page_status != HV_TSC_PAGE_SET) | |
| 527 | 527 | return div_u64(get_kvmclock_ns(kvm), 100); |
| 528 | 528 | |
| 529 | 529 | vcpu = kvm_get_vcpu(kvm, 0); |
| @@ -1077,6 +1077,21 @@ static bool compute_tsc_page_parameters(struct pvclock_vcpu_time_info *hv_clock, · 547 unmodified lines | ||
| 1077 | 1077 | return true; |
| 1078 | 1078 | } |
| 1079 | 1079 | |
| 1080 | +/* | |
| 1081 | + * Don't touch TSC page values if the guest has opted for TSC emulation after | |
| 1082 | + * migration. KVM doesn't fully support reenlightenment notifications and TSC | |
| 1083 | + * access emulation and Hyper-V is known to expect the values in TSC page to | |
| 1084 | + * stay constant before TSC access emulation is disabled from guest side | |
| 1085 | + * (HV_X64_MSR_TSC_EMULATION_STATUS). KVM userspace is expected to preserve TSC | |
| 1086 | + * frequency and guest visible TSC value across migration (and prevent it when | |
| 1087 | + * TSC scaling is unsupported). | |
| 1088 | + */ | |
| 1089 | +static inline bool tsc_page_update_unsafe(struct kvm_hv *hv) | |
| 1090 | +{ | |
| 1091 | + return (hv->hv_tsc_page_status != HV_TSC_PAGE_GUEST_CHANGED) && | |
| 1092 | + hv->hv_tsc_emulation_control; | |
| 1093 | +} | |
| 1094 | + | |
| 1080 | 1095 | void kvm_hv_setup_tsc_page(struct kvm *kvm, |
| 1081 | 1096 | struct pvclock_vcpu_time_info *hv_clock) |
| 1082 | 1097 | { |
| @@ -1087,7 +1102,8 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 4 unmodified lines | ||
| 1087 | 1102 | BUILD_BUG_ON(sizeof(tsc_seq) != sizeof(hv->tsc_ref.tsc_sequence)); |
| 1088 | 1103 | BUILD_BUG_ON(offsetof(struct ms_hyperv_tsc_page, tsc_sequence) != 0); |
| 1089 | 1104 | |
| 1090 | − if (!(hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE)) | |
| 1105 | + if (hv->hv_tsc_page_status == HV_TSC_PAGE_BROKEN || | |
| 1106 | + hv->hv_tsc_page_status == HV_TSC_PAGE_UNSET) | |
| 1091 | 1107 | return; |
| 1092 | 1108 | |
| 1093 | 1109 | mutex_lock(&hv->hv_lock); |
| @@ -1101,7 +1117,15 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 7 unmodified lines | ||
| 1101 | 1117 | */ |
| 1102 | 1118 | if (unlikely(kvm_read_guest(kvm, gfn_to_gpa(gfn), |
| 1103 | 1119 | &tsc_seq, sizeof(tsc_seq)))) |
| 1120 | + goto out_err; | |
| 1121 | + | |
| 1122 | + if (tsc_seq && tsc_page_update_unsafe(hv)) { | |
| 1123 | + if (kvm_read_guest(kvm, gfn_to_gpa(gfn), &hv->tsc_ref, sizeof(hv->tsc_ref))) | |
| 1124 | + goto out_err; | |
| 1125 | + | |
| 1126 | + hv->hv_tsc_page_status = HV_TSC_PAGE_SET; | |
| 1104 | 1127 | goto out_unlock; |
| 1128 | + } | |
| 1105 | 1129 | |
| 1106 | 1130 | /* |
| 1107 | 1131 | * While we're computing and writing the parameters, force the |
| @@ -1110,15 +1134,15 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 2 unmodified lines | ||
| 1110 | 1134 | hv->tsc_ref.tsc_sequence = 0; |
| 1111 | 1135 | if (kvm_write_guest(kvm, gfn_to_gpa(gfn), |
| 1112 | 1136 | &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence))) |
| 1113 | − goto out_unlock; | |
| 1137 | + goto out_err; | |
| 1114 | 1138 | |
| 1115 | 1139 | if (!compute_tsc_page_parameters(hv_clock, &hv->tsc_ref)) |
| 1116 | − goto out_unlock; | |
| 1140 | + goto out_err; | |
| 1117 | 1141 | |
| 1118 | 1142 | /* Ensure sequence is zero before writing the rest of the struct. */ |
| 1119 | 1143 | smp_wmb(); |
| 1120 | 1144 | if (kvm_write_guest(kvm, gfn_to_gpa(gfn), &hv->tsc_ref, sizeof(hv->tsc_ref))) |
| 1121 | − goto out_unlock; | |
| 1145 | + goto out_err; | |
| 1122 | 1146 | |
| 1123 | 1147 | /* |
| 1124 | 1148 | * Now switch to the TSC page mechanism by writing the sequence. |
| @@ -1131,8 +1155,45 @@ void kvm_hv_setup_tsc_page(struct kvm *kvm, · 6 unmodified lines | ||
| 1131 | 1155 | smp_wmb(); |
| 1132 | 1156 | |
| 1133 | 1157 | hv->tsc_ref.tsc_sequence = tsc_seq; |
| 1134 | − kvm_write_guest(kvm, gfn_to_gpa(gfn), | |
| 1135 | − &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence)); | |
| 1158 | + if (kvm_write_guest(kvm, gfn_to_gpa(gfn), | |
| 1159 | + &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence))) | |
| 1160 | + goto out_err; | |
| 1161 | + | |
| 1162 | + hv->hv_tsc_page_status = HV_TSC_PAGE_SET; | |
| 1163 | + goto out_unlock; | |
| 1164 | + | |
| 1165 | +out_err: | |
| 1166 | + hv->hv_tsc_page_status = HV_TSC_PAGE_BROKEN; | |
| 1167 | +out_unlock: | |
| 1168 | + mutex_unlock(&hv->hv_lock); | |
| 1169 | +} | |
| 1170 | + | |
| 1171 | +void kvm_hv_invalidate_tsc_page(struct kvm *kvm) | |
| 1172 | +{ | |
| 1173 | + struct kvm_hv *hv = to_kvm_hv(kvm); | |
| 1174 | + u64 gfn; | |
| 1175 | + | |
| 1176 | + if (hv->hv_tsc_page_status == HV_TSC_PAGE_BROKEN || | |
| 1177 | + hv->hv_tsc_page_status == HV_TSC_PAGE_UNSET || | |
| 1178 | + tsc_page_update_unsafe(hv)) | |
| 1179 | + return; | |
| 1180 | + | |
| 1181 | + mutex_lock(&hv->hv_lock); | |
| 1182 | + | |
| 1183 | + if (!(hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE)) | |
| 1184 | + goto out_unlock; | |
| 1185 | + | |
| 1186 | + /* Preserve HV_TSC_PAGE_GUEST_CHANGED/HV_TSC_PAGE_HOST_CHANGED states */ | |
| 1187 | + if (hv->hv_tsc_page_status == HV_TSC_PAGE_SET) | |
| 1188 | + hv->hv_tsc_page_status = HV_TSC_PAGE_UPDATING; | |
| 1189 | + | |
| 1190 | + gfn = hv->hv_tsc_page >> HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT; | |
| 1191 | + | |
| 1192 | + hv->tsc_ref.tsc_sequence = 0; | |
| 1193 | + if (kvm_write_guest(kvm, gfn_to_gpa(gfn), | |
| 1194 | + &hv->tsc_ref, sizeof(hv->tsc_ref.tsc_sequence))) | |
| 1195 | + hv->hv_tsc_page_status = HV_TSC_PAGE_BROKEN; | |
| 1196 | + | |
| 1136 | 1197 | out_unlock: |
| 1137 | 1198 | mutex_unlock(&hv->hv_lock); |
| 1138 | 1199 | } |
| @@ -1193,8 +1254,15 @@ static int kvm_hv_set_msr_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data, · 54 unmodified lines | ||
| 1193 | 1254 | } |
| 1194 | 1255 | case HV_X64_MSR_REFERENCE_TSC: |
| 1195 | 1256 | hv->hv_tsc_page = data; |
| 1196 | − if (hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE) | |
| 1257 | + if (hv->hv_tsc_page & HV_X64_MSR_TSC_REFERENCE_ENABLE) { | |
| 1258 | + if (!host) | |
| 1259 | + hv->hv_tsc_page_status = HV_TSC_PAGE_GUEST_CHANGED; | |
| 1260 | + else | |
| 1261 | + hv->hv_tsc_page_status = HV_TSC_PAGE_HOST_CHANGED; | |
| 1197 | 1262 | kvm_make_request(KVM_REQ_MASTERCLOCK_UPDATE, vcpu); |
| 1263 | + } else { | |
| 1264 | + hv->hv_tsc_page_status = HV_TSC_PAGE_UNSET; | |
| 1265 | + } | |
| 1198 | 1266 | break; |
| 1199 | 1267 | case HV_X64_MSR_CRASH_P0 ... HV_X64_MSR_CRASH_P4: |
| 1200 | 1268 | return kvm_hv_msr_set_crash_data(kvm, |
| @@ -1229,6 +1297,9 @@ static int kvm_hv_set_msr_pw(struct kvm_vcpu *vcpu, u32 msr, u64 data, · 28 unmodified lines | ||
| 1229 | 1297 | hv->hv_tsc_emulation_control = data; |
| 1230 | 1298 | break; |
| 1231 | 1299 | case HV_X64_MSR_TSC_EMULATION_STATUS: |
| 1300 | + if (data && !host) | |
| 1301 | + return 1; | |
| 1302 | + | |
| 1232 | 1303 | hv->hv_tsc_emulation_status = data; |
| 1233 | 1304 | break; |
| 1234 | 1305 | case HV_X64_MSR_TIME_REF_COUNT: |
| @@ -133,6 +133,7 @@ void kvm_hv_process_stimers(struct kvm_vcpu *vcpu); · 132 unmodified lines | ||
| 133 | 133 | |
| 134 | 134 | void kvm_hv_setup_tsc_page(struct kvm *kvm, |
| 135 | 135 | struct pvclock_vcpu_time_info *hv_clock); |
| 136 | +void kvm_hv_invalidate_tsc_page(struct kvm *kvm); | |
| 136 | 137 | |
| 137 | 138 | void kvm_hv_init_vm(struct kvm *kvm); |
| 138 | 139 | void kvm_hv_destroy_vm(struct kvm *kvm); |
| @@ -1642,7 +1642,16 @@ static void apic_timer_expired(struct kvm_lapic *apic, bool from_timer_fn) · 1641 unmodified lines | ||
| 1642 | 1642 | } |
| 1643 | 1643 | |
| 1644 | 1644 | if (kvm_use_posted_timer_interrupt(apic->vcpu)) { |
| 1645 | − kvm_wait_lapic_expire(vcpu); | |
| 1645 | + /* | |
| 1646 | + * Ensure the guest's timer has truly expired before posting an | |
| 1647 | + * interrupt. Open code the relevant checks to avoid querying | |
| 1648 | + * lapic_timer_int_injected(), which will be false since the | |
| 1649 | + * interrupt isn't yet injected. Waiting until after injecting | |
| 1650 | + * is not an option since that won't help a posted interrupt. | |
| 1651 | + */ | |
| 1652 | + if (vcpu->arch.apic->lapic_timer.expired_tscdeadline && | |
| 1653 | + vcpu->arch.apic->lapic_timer.timer_advance_ns) | |
| 1654 | + __kvm_wait_lapic_expire(vcpu); | |
| 1646 | 1655 | kvm_apic_inject_pending_timer_irqs(apic); |
| 1647 | 1656 | return; |
| 1648 | 1657 | } |
| @@ -2595,6 +2604,7 @@ int kvm_apic_set_state(struct kvm_vcpu *vcpu, struct kvm_lapic_state *s) · 946 unmodified lines | ||
| 2595 | 2604 | |
| 2596 | 2605 | apic_update_ppr(apic); |
| 2597 | 2606 | hrtimer_cancel(&apic->lapic_timer.timer); |
| 2607 | + apic->lapic_timer.expired_tscdeadline = 0; | |
| 2598 | 2608 | apic_update_lvtt(apic); |
| 2599 | 2609 | apic_manage_nmi_watchdog(apic, kvm_lapic_get_reg(apic, APIC_LVT0)); |
| 2600 | 2610 | update_divide_count(apic); |
| @@ -5884,6 +5884,7 @@ static void kvm_recover_nx_lpages(struct kvm *kvm) · 5883 unmodified lines | ||
| 5884 | 5884 | struct kvm_mmu_page *sp; |
| 5885 | 5885 | unsigned int ratio; |
| 5886 | 5886 | LIST_HEAD(invalid_list); |
| 5887 | + bool flush = false; | |
| 5887 | 5888 | ulong to_zap; |
| 5888 | 5889 | |
| 5889 | 5890 | rcu_idx = srcu_read_lock(&kvm->srcu); |
| @@ -5905,19 +5906,19 @@ static void kvm_recover_nx_lpages(struct kvm *kvm) · 15 unmodified lines | ||
| 5905 | 5906 | lpage_disallowed_link); |
| 5906 | 5907 | WARN_ON_ONCE(!sp->lpage_disallowed); |
| 5907 | 5908 | if (is_tdp_mmu_page(sp)) { |
| 5908 | − kvm_tdp_mmu_zap_gfn_range(kvm, sp->gfn, | |
| 5909 | − sp->gfn + KVM_PAGES_PER_HPAGE(sp->role.level)); | |
| 5909 | + flush |= kvm_tdp_mmu_zap_sp(kvm, sp); | |
| 5910 | 5910 | } else { |
| 5911 | 5911 | kvm_mmu_prepare_zap_page(kvm, sp, &invalid_list); |
| 5912 | 5912 | WARN_ON_ONCE(sp->lpage_disallowed); |
| 5913 | 5913 | } |
| 5914 | 5914 | |
| 5915 | 5915 | if (need_resched() || rwlock_needbreak(&kvm->mmu_lock)) { |
| 5916 | − kvm_mmu_commit_zap_page(kvm, &invalid_list); | |
| 5916 | + kvm_mmu_remote_flush_or_zap(kvm, &invalid_list, flush); | |
| 5917 | 5917 | cond_resched_rwlock_write(&kvm->mmu_lock); |
| 5918 | + flush = false; | |
| 5918 | 5919 | } |
| 5919 | 5920 | } |
| 5920 | − kvm_mmu_commit_zap_page(kvm, &invalid_list); | |
| 5921 | + kvm_mmu_remote_flush_or_zap(kvm, &invalid_list, flush); | |
| 5921 | 5922 | |
| 5922 | 5923 | write_unlock(&kvm->mmu_lock); |
| 5923 | 5924 | srcu_read_unlock(&kvm->srcu, rcu_idx); |
| @@ -78,6 +78,11 @@ static inline struct kvm_mmu_page *sptep_to_sp(u64 *sptep) · 77 unmodified lines | ||
| 78 | 78 | return to_shadow_page(__pa(sptep)); |
| 79 | 79 | } |
| 80 | 80 | |
| 81 | +static inline int kvm_mmu_page_as_id(struct kvm_mmu_page *sp) | |
| 82 | +{ | |
| 83 | + return sp->role.smm ? 1 : 0; | |
| 84 | +} | |
| 85 | + | |
| 81 | 86 | static inline bool kvm_vcpu_ad_need_write_protect(struct kvm_vcpu *vcpu) |
| 82 | 87 | { |
| 83 | 88 | /* |
| @@ -20,6 +20,21 @@ static gfn_t round_gfn_for_level(gfn_t gfn, int level) · 19 unmodified lines | ||
| 20 | 20 | return gfn & -KVM_PAGES_PER_HPAGE(level); |
| 21 | 21 | } |
| 22 | 22 | |
| 23 | +/* | |
| 24 | + * Return the TDP iterator to the root PT and allow it to continue its | |
| 25 | + * traversal over the paging structure from there. | |
| 26 | + */ | |
| 27 | +void tdp_iter_restart(struct tdp_iter *iter) | |
| 28 | +{ | |
| 29 | + iter->yielded_gfn = iter->next_last_level_gfn; | |
| 30 | + iter->level = iter->root_level; | |
| 31 | + | |
| 32 | + iter->gfn = round_gfn_for_level(iter->next_last_level_gfn, iter->level); | |
| 33 | + tdp_iter_refresh_sptep(iter); | |
| 34 | + | |
| 35 | + iter->valid = true; | |
| 36 | +} | |
| 37 | + | |
| 23 | 38 | /* |
| 24 | 39 | * Sets a TDP iterator to walk a pre-order traversal of the paging structure |
| 25 | 40 | * rooted at root_pt, starting with the walk to translate next_last_level_gfn. |
| @@ -31,16 +46,12 @@ void tdp_iter_start(struct tdp_iter *iter, u64 *root_pt, int root_level, · 5 unmodified lines | ||
| 31 | 46 | WARN_ON(root_level > PT64_ROOT_MAX_LEVEL); |
| 32 | 47 | |
| 33 | 48 | iter->next_last_level_gfn = next_last_level_gfn; |
| 34 | − iter->yielded_gfn = iter->next_last_level_gfn; | |
| 35 | 49 | iter->root_level = root_level; |
| 36 | 50 | iter->min_level = min_level; |
| 37 | − iter->level = root_level; | |
| 38 | − iter->pt_path[iter->level - 1] = (tdp_ptep_t)root_pt; | |
| 39 | − | |
| 40 | − iter->gfn = round_gfn_for_level(iter->next_last_level_gfn, iter->level); | |
| 41 | − tdp_iter_refresh_sptep(iter); | |
| 51 | + iter->pt_path[iter->root_level - 1] = (tdp_ptep_t)root_pt; | |
| 52 | + iter->as_id = kvm_mmu_page_as_id(sptep_to_sp(root_pt)); | |
| 42 | 53 | |
| 43 | − iter->valid = true; | |
| 54 | + tdp_iter_restart(iter); | |
| 44 | 55 | } |
| 45 | 56 | |
| 46 | 57 | /* |
| @@ -159,8 +170,3 @@ void tdp_iter_next(struct tdp_iter *iter) · 112 unmodified lines | ||
| 159 | 170 | iter->valid = false; |
| 160 | 171 | } |
| 161 | 172 | |
| 162 | −tdp_ptep_t tdp_iter_root_pt(struct tdp_iter *iter) | |
| 163 | −{ | |
| 164 | − return iter->pt_path[iter->root_level - 1]; | |
| 165 | −} | |
| 166 | − | |
| @@ -36,6 +36,8 @@ struct tdp_iter { · 35 unmodified lines | ||
| 36 | 36 | int min_level; |
| 37 | 37 | /* The iterator's current level within the paging structure */ |
| 38 | 38 | int level; |
| 39 | + /* The address space ID, i.e. SMM vs. regular. */ | |
| 40 | + int as_id; | |
| 39 | 41 | /* A snapshot of the value at sptep */ |
| 40 | 42 | u64 old_spte; |
| 41 | 43 | /* |
| @@ -62,6 +64,6 @@ tdp_ptep_t spte_to_child_pt(u64 pte, int level); · 20 unmodified lines | ||
| 62 | 64 | void tdp_iter_start(struct tdp_iter *iter, u64 *root_pt, int root_level, |
| 63 | 65 | int min_level, gfn_t next_last_level_gfn); |
| 64 | 66 | void tdp_iter_next(struct tdp_iter *iter); |
| 65 | −tdp_ptep_t tdp_iter_root_pt(struct tdp_iter *iter); | |
| 67 | +void tdp_iter_restart(struct tdp_iter *iter); | |
| 66 | 68 | |
| 67 | 69 | #endif /* __KVM_X86_MMU_TDP_ITER_H */ |
| @@ -86,7 +86,7 @@ static inline struct kvm_mmu_page *tdp_mmu_next_root(struct kvm *kvm, · 85 unmodified lines | ||
| 86 | 86 | list_for_each_entry(_root, &_kvm->arch.tdp_mmu_roots, link) |
| 87 | 87 | |
| 88 | 88 | static bool zap_gfn_range(struct kvm *kvm, struct kvm_mmu_page *root, |
| 89 | − gfn_t start, gfn_t end, bool can_yield); | |
| 89 | + gfn_t start, gfn_t end, bool can_yield, bool flush); | |
| 90 | 90 | |
| 91 | 91 | void kvm_tdp_mmu_free_root(struct kvm *kvm, struct kvm_mmu_page *root) |
| 92 | 92 | { |
| @@ -99,7 +99,7 @@ void kvm_tdp_mmu_free_root(struct kvm *kvm, struct kvm_mmu_page *root) · 6 unmodified lines | ||
| 99 | 99 | |
| 100 | 100 | list_del(&root->link); |
| 101 | 101 | |
| 102 | − zap_gfn_range(kvm, root, 0, max_gfn, false); | |
| 102 | + zap_gfn_range(kvm, root, 0, max_gfn, false, false); | |
| 103 | 103 | |
| 104 | 104 | free_page((unsigned long)root->spt); |
| 105 | 105 | kmem_cache_free(mmu_page_header_cache, root); |
| @@ -203,11 +203,6 @@ static void handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn, · 97 unmodified lines | ||
| 203 | 203 | u64 old_spte, u64 new_spte, int level, |
| 204 | 204 | bool shared); |
| 205 | 205 | |
| 206 | −static int kvm_mmu_page_as_id(struct kvm_mmu_page *sp) | |
| 207 | −{ | |
| 208 | − return sp->role.smm ? 1 : 0; | |
| 209 | −} | |
| 210 | − | |
| 211 | 206 | static void handle_changed_spte_acc_track(u64 old_spte, u64 new_spte, int level) |
| 212 | 207 | { |
| 213 | 208 | bool pfn_changed = spte_to_pfn(old_spte) != spte_to_pfn(new_spte); |
| @@ -301,11 +296,16 @@ static void tdp_mmu_unlink_page(struct kvm *kvm, struct kvm_mmu_page *sp, · 87 unmodified lines | ||
| 301 | 296 | * |
| 302 | 297 | * Given a page table that has been removed from the TDP paging structure, |
| 303 | 298 | * iterates through the page table to clear SPTEs and free child page tables. |
| 299 | + * | |
| 300 | + * Note that pt is passed in as a tdp_ptep_t, but it does not need RCU | |
| 301 | + * protection. Since this thread removed it from the paging structure, | |
| 302 | + * this thread will be responsible for ensuring the page is freed. Hence the | |
| 303 | + * early rcu_dereferences in the function. | |
| 304 | 304 | */ |
| 305 | −static void handle_removed_tdp_mmu_page(struct kvm *kvm, u64 *pt, | |
| 305 | +static void handle_removed_tdp_mmu_page(struct kvm *kvm, tdp_ptep_t pt, | |
| 306 | 306 | bool shared) |
| 307 | 307 | { |
| 308 | − struct kvm_mmu_page *sp = sptep_to_sp(pt); | |
| 308 | + struct kvm_mmu_page *sp = sptep_to_sp(rcu_dereference(pt)); | |
| 309 | 309 | int level = sp->role.level; |
| 310 | 310 | gfn_t base_gfn = sp->gfn; |
| 311 | 311 | u64 old_child_spte; |
| @@ -318,7 +318,7 @@ static void handle_removed_tdp_mmu_page(struct kvm *kvm, u64 *pt, · 6 unmodified lines | ||
| 318 | 318 | tdp_mmu_unlink_page(kvm, sp, shared); |
| 319 | 319 | |
| 320 | 320 | for (i = 0; i < PT64_ENT_PER_PAGE; i++) { |
| 321 | − sptep = pt + i; | |
| 321 | + sptep = rcu_dereference(pt) + i; | |
| 322 | 322 | gfn = base_gfn + (i * KVM_PAGES_PER_HPAGE(level - 1)); |
| 323 | 323 | |
| 324 | 324 | if (shared) { |
| @@ -337,7 +337,18 @@ static void handle_removed_tdp_mmu_page(struct kvm *kvm, u64 *pt, · 12 unmodified lines | ||
| 337 | 337 | cpu_relax(); |
| 338 | 338 | } |
| 339 | 339 | } else { |
| 340 | + /* | |
| 341 | + * If the SPTE is not MMU-present, there is no backing | |
| 342 | + * page associated with the SPTE and so no side effects | |
| 343 | + * that need to be recorded, and exclusive ownership of | |
| 344 | + * mmu_lock ensures the SPTE can't be made present. | |
| 345 | + * Note, zapping MMIO SPTEs is also unnecessary as they | |
| 346 | + * are guarded by the memslots generation, not by being | |
| 347 | + * unreachable. | |
| 348 | + */ | |
| 340 | 349 | old_child_spte = READ_ONCE(*sptep); |
| 350 | + if (!is_shadow_present_pte(old_child_spte)) | |
| 351 | + continue; | |
| 341 | 352 | |
| 342 | 353 | /* |
| 343 | 354 | * Marking the SPTE as a removed SPTE is not |
| @@ -481,10 +492,6 @@ static inline bool tdp_mmu_set_spte_atomic(struct kvm *kvm, · 137 unmodified lines | ||
| 481 | 492 | struct tdp_iter *iter, |
| 482 | 493 | u64 new_spte) |
| 483 | 494 | { |
| 484 | − u64 *root_pt = tdp_iter_root_pt(iter); | |
| 485 | − struct kvm_mmu_page *root = sptep_to_sp(root_pt); | |
| 486 | − int as_id = kvm_mmu_page_as_id(root); | |
| 487 | − | |
| 488 | 495 | lockdep_assert_held_read(&kvm->mmu_lock); |
| 489 | 496 | |
| 490 | 497 | /* |
| @@ -498,8 +505,8 @@ static inline bool tdp_mmu_set_spte_atomic(struct kvm *kvm, · 7 unmodified lines | ||
| 498 | 505 | new_spte) != iter->old_spte) |
| 499 | 506 | return false; |
| 500 | 507 | |
| 501 | − handle_changed_spte(kvm, as_id, iter->gfn, iter->old_spte, new_spte, | |
| 502 | − iter->level, true); | |
| 508 | + handle_changed_spte(kvm, iter->as_id, iter->gfn, iter->old_spte, | |
| 509 | + new_spte, iter->level, true); | |
| 503 | 510 | |
| 504 | 511 | return true; |
| 505 | 512 | } |
| @@ -527,7 +534,7 @@ static inline bool tdp_mmu_zap_spte_atomic(struct kvm *kvm, · 21 unmodified lines | ||
| 527 | 534 | * here since the SPTE is going from non-present |
| 528 | 535 | * to non-present. |
| 529 | 536 | */ |
| 530 | − WRITE_ONCE(*iter->sptep, 0); | |
| 537 | + WRITE_ONCE(*rcu_dereference(iter->sptep), 0); | |
| 531 | 538 | |
| 532 | 539 | return true; |
| 533 | 540 | } |
| @@ -553,10 +560,6 @@ static inline void __tdp_mmu_set_spte(struct kvm *kvm, struct tdp_iter *iter, · 19 unmodified lines | ||
| 553 | 560 | u64 new_spte, bool record_acc_track, |
| 554 | 561 | bool record_dirty_log) |
| 555 | 562 | { |
| 556 | − tdp_ptep_t root_pt = tdp_iter_root_pt(iter); | |
| 557 | − struct kvm_mmu_page *root = sptep_to_sp(root_pt); | |
| 558 | − int as_id = kvm_mmu_page_as_id(root); | |
| 559 | − | |
| 560 | 563 | lockdep_assert_held_write(&kvm->mmu_lock); |
| 561 | 564 | |
| 562 | 565 | /* |
| @@ -570,13 +573,13 @@ static inline void __tdp_mmu_set_spte(struct kvm *kvm, struct tdp_iter *iter, · 7 unmodified lines | ||
| 570 | 573 | |
| 571 | 574 | WRITE_ONCE(*rcu_dereference(iter->sptep), new_spte); |
| 572 | 575 | |
| 573 | − __handle_changed_spte(kvm, as_id, iter->gfn, iter->old_spte, new_spte, | |
| 574 | − iter->level, false); | |
| 576 | + __handle_changed_spte(kvm, iter->as_id, iter->gfn, iter->old_spte, | |
| 577 | + new_spte, iter->level, false); | |
| 575 | 578 | if (record_acc_track) |
| 576 | 579 | handle_changed_spte_acc_track(iter->old_spte, new_spte, |
| 577 | 580 | iter->level); |
| 578 | 581 | if (record_dirty_log) |
| 579 | − handle_changed_spte_dirty_log(kvm, as_id, iter->gfn, | |
| 582 | + handle_changed_spte_dirty_log(kvm, iter->as_id, iter->gfn, | |
| 580 | 583 | iter->old_spte, new_spte, |
| 581 | 584 | iter->level); |
| 582 | 585 | } |
| @@ -648,9 +651,7 @@ static inline bool tdp_mmu_iter_cond_resched(struct kvm *kvm, · 65 unmodified lines | ||
| 648 | 651 | |
| 649 | 652 | WARN_ON(iter->gfn > iter->next_last_level_gfn); |
| 650 | 653 | |
| 651 | − tdp_iter_start(iter, iter->pt_path[iter->root_level - 1], | |
| 652 | − iter->root_level, iter->min_level, | |
| 653 | − iter->next_last_level_gfn); | |
| 654 | + tdp_iter_restart(iter); | |
| 654 | 655 | |
| 655 | 656 | return true; |
| 656 | 657 | } |
| @@ -667,20 +668,21 @@ static inline bool tdp_mmu_iter_cond_resched(struct kvm *kvm, · 10 unmodified lines | ||
| 667 | 668 | * scheduler needs the CPU or there is contention on the MMU lock. If this |
| 668 | 669 | * function cannot yield, it will not release the MMU lock or reschedule and |
| 669 | 670 | * the caller must ensure it does not supply too large a GFN range, or the |
| 670 | − * operation can cause a soft lockup. | |
| 671 | + * operation can cause a soft lockup. Note, in some use cases a flush may be | |
| 672 | + * required by prior actions. Ensure the pending flush is performed prior to | |
| 673 | + * yielding. | |
| 671 | 674 | */ |
| 672 | 675 | static bool zap_gfn_range(struct kvm *kvm, struct kvm_mmu_page *root, |
| 673 | − gfn_t start, gfn_t end, bool can_yield) | |
| 676 | + gfn_t start, gfn_t end, bool can_yield, bool flush) | |
| 674 | 677 | { |
| 675 | 678 | struct tdp_iter iter; |
| 676 | − bool flush_needed = false; | |
| 677 | 679 | |
| 678 | 680 | rcu_read_lock(); |
| 679 | 681 | |
| 680 | 682 | tdp_root_for_each_pte(iter, root, start, end) { |
| 681 | 683 | if (can_yield && |
| 682 | − tdp_mmu_iter_cond_resched(kvm, &iter, flush_needed)) { | |
| 683 | − flush_needed = false; | |
| 684 | + tdp_mmu_iter_cond_resched(kvm, &iter, flush)) { | |
| 685 | + flush = false; | |
| 684 | 686 | continue; |
| 685 | 687 | } |
| 686 | 688 | |
| @@ -698,11 +700,11 @@ static bool zap_gfn_range(struct kvm *kvm, struct kvm_mmu_page *root, · 11 unmodified lines | ||
| 698 | 700 | continue; |
| 699 | 701 | |
| 700 | 702 | tdp_mmu_set_spte(kvm, &iter, 0); |
| 701 | − flush_needed = true; | |
| 703 | + flush = true; | |
| 702 | 704 | } |
| 703 | 705 | |
| 704 | 706 | rcu_read_unlock(); |
| 705 | − return flush_needed; | |
| 707 | + return flush; | |
| 706 | 708 | } |
| 707 | 709 | |
| 708 | 710 | /* |
| @@ -711,13 +713,14 @@ static bool zap_gfn_range(struct kvm *kvm, struct kvm_mmu_page *root, · 2 unmodified lines | ||
| 711 | 713 | * SPTEs have been cleared and a TLB flush is needed before releasing the |
| 712 | 714 | * MMU lock. |
| 713 | 715 | */ |
| 714 | −bool kvm_tdp_mmu_zap_gfn_range(struct kvm *kvm, gfn_t start, gfn_t end) | |
| 716 | +bool __kvm_tdp_mmu_zap_gfn_range(struct kvm *kvm, gfn_t start, gfn_t end, | |
| 717 | + bool can_yield) | |
| 715 | 718 | { |
| 716 | 719 | struct kvm_mmu_page *root; |
| 717 | 720 | bool flush = false; |
| 718 | 721 | |
| 719 | 722 | for_each_tdp_mmu_root_yield_safe(kvm, root) |
| 720 | − flush |= zap_gfn_range(kvm, root, start, end, true); | |
| 723 | + flush = zap_gfn_range(kvm, root, start, end, can_yield, flush); | |
| 721 | 724 | |
| 722 | 725 | return flush; |
| 723 | 726 | } |
| @@ -929,7 +932,7 @@ static int zap_gfn_range_hva_wrapper(struct kvm *kvm, · 205 unmodified lines | ||
| 929 | 932 | struct kvm_mmu_page *root, gfn_t start, |
| 930 | 933 | gfn_t end, unsigned long unused) |
| 931 | 934 | { |
| 932 | − return zap_gfn_range(kvm, root, start, end, false); | |
| 935 | + return zap_gfn_range(kvm, root, start, end, false, false); | |
| 933 | 936 | } |
| 934 | 937 | |
| 935 | 938 | int kvm_tdp_mmu_zap_hva_range(struct kvm *kvm, unsigned long start, |
| @@ -8,7 +8,29 @@ · 7 unmodified lines | ||
| 8 | 8 | hpa_t kvm_tdp_mmu_get_vcpu_root_hpa(struct kvm_vcpu *vcpu); |
| 9 | 9 | void kvm_tdp_mmu_free_root(struct kvm *kvm, struct kvm_mmu_page *root); |
| 10 | 10 | |
| 11 | −bool kvm_tdp_mmu_zap_gfn_range(struct kvm *kvm, gfn_t start, gfn_t end); | |
| 11 | +bool __kvm_tdp_mmu_zap_gfn_range(struct kvm *kvm, gfn_t start, gfn_t end, | |
| 12 | + bool can_yield); | |
| 13 | +static inline bool kvm_tdp_mmu_zap_gfn_range(struct kvm *kvm, gfn_t start, | |
| 14 | + gfn_t end) | |
| 15 | +{ | |
| 16 | + return __kvm_tdp_mmu_zap_gfn_range(kvm, start, end, true); | |
| 17 | +} | |
| 18 | +static inline bool kvm_tdp_mmu_zap_sp(struct kvm *kvm, struct kvm_mmu_page *sp) | |
| 19 | +{ | |
| 20 | + gfn_t end = sp->gfn + KVM_PAGES_PER_HPAGE(sp->role.level); | |
| 21 | + | |
| 22 | + /* | |
| 23 | + * Don't allow yielding, as the caller may have a flush pending. Note, | |
| 24 | + * if mmu_lock is held for write, zapping will never yield in this case, | |
| 25 | + * but explicitly disallow it for safety. The TDP MMU does not yield | |
| 26 | + * until it has made forward progress (steps sideways), and when zapping | |
| 27 | + * a single shadow page that it's guaranteed to see (thus the mmu_lock | |
| 28 | + * requirement), its "step sideways" will always step beyond the bounds | |
| 29 | + * of the shadow page's gfn range and stop iterating before yielding. | |
| 30 | + */ | |
| 31 | + lockdep_assert_held_write(&kvm->mmu_lock); | |
| 32 | + return __kvm_tdp_mmu_zap_gfn_range(kvm, sp->gfn, end, false); | |
| 33 | +} | |
| 12 | 34 | void kvm_tdp_mmu_zap_all(struct kvm *kvm); |
| 13 | 35 | |
| 14 | 36 | int kvm_tdp_mmu_map(struct kvm_vcpu *vcpu, gpa_t gpa, u32 error_code, |
| @@ -246,11 +246,18 @@ static bool nested_vmcb_check_controls(struct vmcb_control_area *control) · 245 unmodified lines | ||
| 246 | 246 | return true; |
| 247 | 247 | } |
| 248 | 248 | |
| 249 | −static bool nested_vmcb_checks(struct vcpu_svm *svm, struct vmcb *vmcb12) | |
| 249 | +static bool nested_vmcb_check_save(struct vcpu_svm *svm, struct vmcb *vmcb12) | |
| 250 | 250 | { |
| 251 | 251 | struct kvm_vcpu *vcpu = &svm->vcpu; |
| 252 | 252 | bool vmcb12_lma; |
| 253 | 253 | |
| 254 | + /* | |
| 255 | + * FIXME: these should be done after copying the fields, | |
| 256 | + * to avoid TOC/TOU races. For these save area checks | |
| 257 | + * the possible damage is limited since kvm_set_cr0 and | |
| 258 | + * kvm_set_cr4 handle failure; EFER_SVME is an exception | |
| 259 | + * so it is force-set later in nested_prepare_vmcb_save. | |
| 260 | + */ | |
| 254 | 261 | if ((vmcb12->save.efer & EFER_SVME) == 0) |
| 255 | 262 | return false; |
| 256 | 263 | |
| @@ -271,7 +278,7 @@ static bool nested_vmcb_checks(struct vcpu_svm *svm, struct vmcb *vmcb12) · 14 unmodified lines | ||
| 271 | 278 | if (!kvm_is_valid_cr4(&svm->vcpu, vmcb12->save.cr4)) |
| 272 | 279 | return false; |
| 273 | 280 | |
| 274 | − return nested_vmcb_check_controls(&vmcb12->control); | |
| 281 | + return true; | |
| 275 | 282 | } |
| 276 | 283 | |
| 277 | 284 | static void load_nested_vmcb_control(struct vcpu_svm *svm, |
| @@ -396,7 +403,14 @@ static void nested_prepare_vmcb_save(struct vcpu_svm *svm, struct vmcb *vmcb12) · 118 unmodified lines | ||
| 396 | 403 | svm->vmcb->save.gdtr = vmcb12->save.gdtr; |
| 397 | 404 | svm->vmcb->save.idtr = vmcb12->save.idtr; |
| 398 | 405 | kvm_set_rflags(&svm->vcpu, vmcb12->save.rflags | X86_EFLAGS_FIXED); |
| 399 | − svm_set_efer(&svm->vcpu, vmcb12->save.efer); | |
| 406 | + | |
| 407 | + /* | |
| 408 | + * Force-set EFER_SVME even though it is checked earlier on the | |
| 409 | + * VMCB12, because the guest can flip the bit between the check | |
| 410 | + * and now. Clearing EFER_SVME would call svm_free_nested. | |
| 411 | + */ | |
| 412 | + svm_set_efer(&svm->vcpu, vmcb12->save.efer | EFER_SVME); | |
| 413 | + | |
| 400 | 414 | svm_set_cr0(&svm->vcpu, vmcb12->save.cr0); |
| 401 | 415 | svm_set_cr4(&svm->vcpu, vmcb12->save.cr4); |
| 402 | 416 | svm->vmcb->save.cr2 = svm->vcpu.arch.cr2 = vmcb12->save.cr2; |
| @@ -468,7 +482,6 @@ int enter_svm_guest_mode(struct vcpu_svm *svm, u64 vmcb12_gpa, · 65 unmodified lines | ||
| 468 | 482 | |
| 469 | 483 | |
| 470 | 484 | svm->nested.vmcb12_gpa = vmcb12_gpa; |
| 471 | − load_nested_vmcb_control(svm, &vmcb12->control); | |
| 472 | 485 | nested_prepare_vmcb_control(svm); |
| 473 | 486 | nested_prepare_vmcb_save(svm, vmcb12); |
| 474 | 487 | |
| @@ -515,7 +528,10 @@ int nested_svm_vmrun(struct vcpu_svm *svm) · 40 unmodified lines | ||
| 515 | 528 | if (WARN_ON_ONCE(!svm->nested.initialized)) |
| 516 | 529 | return -EINVAL; |
| 517 | 530 | |
| 518 | − if (!nested_vmcb_checks(svm, vmcb12)) { | |
| 531 | + load_nested_vmcb_control(svm, &vmcb12->control); | |
| 532 | + | |
| 533 | + if (!nested_vmcb_check_save(svm, vmcb12) || | |
| 534 | + !nested_vmcb_check_controls(&svm->nested.ctl)) { | |
| 519 | 535 | vmcb12->control.exit_code = SVM_EXIT_ERR; |
| 520 | 536 | vmcb12->control.exit_code_hi = 0; |
| 521 | 537 | vmcb12->control.exit_info_1 = 0; |
| @@ -1209,6 +1225,8 @@ static int svm_set_nested_state(struct kvm_vcpu *vcpu, · 687 unmodified lines | ||
| 1209 | 1225 | */ |
| 1210 | 1226 | if (!(save->cr0 & X86_CR0_PG)) |
| 1211 | 1227 | goto out_free; |
| 1228 | + if (!(save->efer & EFER_SVME)) | |
| 1229 | + goto out_free; | |
| 1212 | 1230 | |
| 1213 | 1231 | /* |
| 1214 | 1232 | * All checks done, we can enter guest mode. L1 control fields |
| @@ -98,6 +98,8 @@ static enum index msr_to_index(u32 msr) · 97 unmodified lines | ||
| 98 | 98 | static inline struct kvm_pmc *get_gp_pmc_amd(struct kvm_pmu *pmu, u32 msr, |
| 99 | 99 | enum pmu_type type) |
| 100 | 100 | { |
| 101 | + struct kvm_vcpu *vcpu = pmu_to_vcpu(pmu); | |
| 102 | + | |
| 101 | 103 | switch (msr) { |
| 102 | 104 | case MSR_F15H_PERF_CTL0: |
| 103 | 105 | case MSR_F15H_PERF_CTL1: |
| @@ -105,6 +107,9 @@ static inline struct kvm_pmc *get_gp_pmc_amd(struct kvm_pmu *pmu, u32 msr, · 1 unmodified line | ||
| 105 | 107 | case MSR_F15H_PERF_CTL3: |
| 106 | 108 | case MSR_F15H_PERF_CTL4: |
| 107 | 109 | case MSR_F15H_PERF_CTL5: |
| 110 | + if (!guest_cpuid_has(vcpu, X86_FEATURE_PERFCTR_CORE)) | |
| 111 | + return NULL; | |
| 112 | + fallthrough; | |
| 108 | 113 | case MSR_K7_EVNTSEL0 ... MSR_K7_EVNTSEL3: |
| 109 | 114 | if (type != PMU_TYPE_EVNTSEL) |
| 110 | 115 | return NULL; |
| @@ -115,6 +120,9 @@ static inline struct kvm_pmc *get_gp_pmc_amd(struct kvm_pmu *pmu, u32 msr, · 4 unmodified lines | ||
| 115 | 120 | case MSR_F15H_PERF_CTR3: |
| 116 | 121 | case MSR_F15H_PERF_CTR4: |
| 117 | 122 | case MSR_F15H_PERF_CTR5: |
| 123 | + if (!guest_cpuid_has(vcpu, X86_FEATURE_PERFCTR_CORE)) | |
| 124 | + return NULL; | |
| 125 | + fallthrough; | |
| 118 | 126 | case MSR_K7_PERFCTR0 ... MSR_K7_PERFCTR3: |
| 119 | 127 | if (type != PMU_TYPE_COUNTER) |
| 120 | 128 | return NULL; |
| @@ -115,13 +115,6 @@ static const struct svm_direct_access_msrs { · 114 unmodified lines | ||
| 115 | 115 | { .index = MSR_INVALID, .always = false }, |
| 116 | 116 | }; |
| 117 | 117 | |
| 118 | −/* enable NPT for AMD64 and X86 with PAE */ | |
| 119 | −#if defined(CONFIG_X86_64) || defined(CONFIG_X86_PAE) | |
| 120 | −bool npt_enabled = true; | |
| 121 | −#else | |
| 122 | −bool npt_enabled; | |
| 123 | −#endif | |
| 124 | − | |
| 125 | 118 | /* |
| 126 | 119 | * These 2 parameters are used to config the controls for Pause-Loop Exiting: |
| 127 | 120 | * pause_filter_count: On processors that support Pause filtering(indicated |
| @@ -170,9 +163,12 @@ module_param(pause_filter_count_shrink, ushort, 0444); · 42 unmodified lines | ||
| 170 | 163 | static unsigned short pause_filter_count_max = KVM_SVM_DEFAULT_PLE_WINDOW_MAX; |
| 171 | 164 | module_param(pause_filter_count_max, ushort, 0444); |
| 172 | 165 | |
| 173 | −/* allow nested paging (virtualized MMU) for all guests */ | |
| 174 | −static int npt = true; | |
| 175 | −module_param(npt, int, S_IRUGO); | |
| 166 | +/* | |
| 167 | + * Use nested page tables by default. Note, NPT may get forced off by | |
| 168 | + * svm_hardware_setup() if it's unsupported by hardware or the host kernel. | |
| 169 | + */ | |
| 170 | +bool npt_enabled = true; | |
| 171 | +module_param_named(npt, npt_enabled, bool, 0444); | |
| 176 | 172 | |
| 177 | 173 | /* allow nested virtualization in KVM/SVM */ |
| 178 | 174 | static int nested = true; |
| @@ -988,10 +984,15 @@ static __init int svm_hardware_setup(void) · 809 unmodified lines | ||
| 988 | 984 | goto err; |
| 989 | 985 | } |
| 990 | 986 | |
| 991 | − if (!boot_cpu_has(X86_FEATURE_NPT)) | |
| 987 | + /* | |
| 988 | + * KVM's MMU doesn't support using 2-level paging for itself, and thus | |
| 989 | + * NPT isn't supported if the host is using 2-level paging since host | |
| 990 | + * CR4 is unchanged on VMRUN. | |
| 991 | + */ | |
| 992 | + if (!IS_ENABLED(CONFIG_X86_64) && !IS_ENABLED(CONFIG_X86_PAE)) | |
| 992 | 993 | npt_enabled = false; |
| 993 | 994 | |
| 994 | − if (npt_enabled && !npt) | |
| 995 | + if (!boot_cpu_has(X86_FEATURE_NPT)) | |
| 995 | 996 | npt_enabled = false; |
| 996 | 997 | |
| 997 | 998 | kvm_configure_mmu(npt_enabled, get_max_npt_level(), PG_LEVEL_1G); |
| @@ -6027,19 +6027,19 @@ static int __vmx_handle_exit(struct kvm_vcpu *vcpu, fastpath_t exit_fastpath) · 6026 unmodified lines | ||
| 6027 | 6027 | exit_reason.basic != EXIT_REASON_PML_FULL && |
| 6028 | 6028 | exit_reason.basic != EXIT_REASON_APIC_ACCESS && |
| 6029 | 6029 | exit_reason.basic != EXIT_REASON_TASK_SWITCH)) { |
| 6030 | + int ndata = 3; | |
| 6031 | + | |
| 6030 | 6032 | vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; |
| 6031 | 6033 | vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_DELIVERY_EV; |
| 6032 | − vcpu->run->internal.ndata = 3; | |
| 6033 | 6034 | vcpu->run->internal.data[0] = vectoring_info; |
| 6034 | 6035 | vcpu->run->internal.data[1] = exit_reason.full; |
| 6035 | 6036 | vcpu->run->internal.data[2] = vcpu->arch.exit_qualification; |
| 6036 | 6037 | if (exit_reason.basic == EXIT_REASON_EPT_MISCONFIG) { |
| 6037 | − vcpu->run->internal.ndata++; | |
| 6038 | − vcpu->run->internal.data[3] = | |
| 6038 | + vcpu->run->internal.data[ndata++] = | |
| 6039 | 6039 | vmcs_read64(GUEST_PHYSICAL_ADDRESS); |
| 6040 | 6040 | } |
| 6041 | − vcpu->run->internal.data[vcpu->run->internal.ndata++] = | |
| 6042 | − vcpu->arch.last_vmentry_cpu; | |
| 6041 | + vcpu->run->internal.data[ndata++] = vcpu->arch.last_vmentry_cpu; | |
| 6042 | + vcpu->run->internal.ndata = ndata; | |
| 6043 | 6043 | return 0; |
| 6044 | 6044 | } |
| 6045 | 6045 | |
| @@ -6580,8 +6580,8 @@ static void atomic_switch_perf_msrs(struct vcpu_vmx *vmx) · 534 unmodified lines | ||
| 6580 | 6580 | int i, nr_msrs; |
| 6581 | 6581 | struct perf_guest_switch_msr *msrs; |
| 6582 | 6582 | |
| 6583 | + /* Note, nr_msrs may be garbage if perf_guest_get_msrs() returns NULL. */ | |
| 6583 | 6584 | msrs = perf_guest_get_msrs(&nr_msrs); |
| 6584 | − | |
| 6585 | 6585 | if (!msrs) |
| 6586 | 6586 | return; |
| 6587 | 6587 | |
| @@ -271,8 +271,7 @@ static struct kmem_cache *x86_emulator_cache; · 270 unmodified lines | ||
| 271 | 271 | * When called, it means the previous get/set msr reached an invalid msr. |
| 272 | 272 | * Return true if we want to ignore/silent this failed msr access. |
| 273 | 273 | */ |
| 274 | −static bool kvm_msr_ignored_check(struct kvm_vcpu *vcpu, u32 msr, | |
| 275 | − u64 data, bool write) | |
| 274 | +static bool kvm_msr_ignored_check(u32 msr, u64 data, bool write) | |
| 276 | 275 | { |
| 277 | 276 | const char *op = write ? "wrmsr" : "rdmsr"; |
| 278 | 277 | |
| @@ -1445,7 +1444,7 @@ static int do_get_msr_feature(struct kvm_vcpu *vcpu, unsigned index, u64 *data) · 1166 unmodified lines | ||
| 1445 | 1444 | if (r == KVM_MSR_RET_INVALID) { |
| 1446 | 1445 | /* Unconditionally clear the output for simplicity */ |
| 1447 | 1446 | *data = 0; |
| 1448 | − if (kvm_msr_ignored_check(vcpu, index, 0, false)) | |
| 1447 | + if (kvm_msr_ignored_check(index, 0, false)) | |
| 1449 | 1448 | r = 0; |
| 1450 | 1449 | } |
| 1451 | 1450 | |
| @@ -1526,35 +1525,44 @@ EXPORT_SYMBOL_GPL(kvm_enable_efer_bits); · 74 unmodified lines | ||
| 1526 | 1525 | |
| 1527 | 1526 | bool kvm_msr_allowed(struct kvm_vcpu *vcpu, u32 index, u32 type) |
| 1528 | 1527 | { |
| 1528 | + struct kvm_x86_msr_filter *msr_filter; | |
| 1529 | + struct msr_bitmap_range *ranges; | |
| 1529 | 1530 | struct kvm *kvm = vcpu->kvm; |
| 1530 | − struct msr_bitmap_range *ranges = kvm->arch.msr_filter.ranges; | |
| 1531 | − u32 count = kvm->arch.msr_filter.count; | |
| 1532 | − u32 i; | |
| 1533 | − bool r = kvm->arch.msr_filter.default_allow; | |
| 1531 | + bool allowed; | |
| 1534 | 1532 | int idx; |
| 1533 | + u32 i; | |
| 1535 | 1534 | |
| 1536 | − /* MSR filtering not set up or x2APIC enabled, allow everything */ | |
| 1537 | − if (!count || (index >= 0x800 && index <= 0x8ff)) | |
| 1535 | + /* x2APIC MSRs do not support filtering. */ | |
| 1536 | + if (index >= 0x800 && index <= 0x8ff) | |
| 1538 | 1537 | return true; |
| 1539 | 1538 | |
| 1540 | − /* Prevent collision with set_msr_filter */ | |
| 1541 | 1539 | idx = srcu_read_lock(&kvm->srcu); |
| 1542 | 1540 | |
| 1543 | − for (i = 0; i < count; i++) { | |
| 1541 | + msr_filter = srcu_dereference(kvm->arch.msr_filter, &kvm->srcu); | |
| 1542 | + if (!msr_filter) { | |
| 1543 | + allowed = true; | |
| 1544 | + goto out; | |
| 1545 | + } | |
| 1546 | + | |
| 1547 | + allowed = msr_filter->default_allow; | |
| 1548 | + ranges = msr_filter->ranges; | |
| 1549 | + | |
| 1550 | + for (i = 0; i < msr_filter->count; i++) { | |
| 1544 | 1551 | u32 start = ranges[i].base; |
| 1545 | 1552 | u32 end = start + ranges[i].nmsrs; |
| 1546 | 1553 | u32 flags = ranges[i].flags; |
| 1547 | 1554 | unsigned long *bitmap = ranges[i].bitmap; |
| 1548 | 1555 | |
| 1549 | 1556 | if ((index >= start) && (index < end) && (flags & type)) { |
| 1550 | − r = !!test_bit(index - start, bitmap); | |
| 1557 | + allowed = !!test_bit(index - start, bitmap); | |
| 1551 | 1558 | break; |
| 1552 | 1559 | } |
| 1553 | 1560 | } |
| 1554 | 1561 | |
| 1562 | +out: | |
| 1555 | 1563 | srcu_read_unlock(&kvm->srcu, idx); |
| 1556 | 1564 | |
| 1557 | − return r; | |
| 1565 | + return allowed; | |
| 1558 | 1566 | } |
| 1559 | 1567 | EXPORT_SYMBOL_GPL(kvm_msr_allowed); |
| 1560 | 1568 | |
| @@ -1611,7 +1619,7 @@ static int kvm_set_msr_ignored_check(struct kvm_vcpu *vcpu, · 50 unmodified lines | ||
| 1611 | 1619 | int ret = __kvm_set_msr(vcpu, index, data, host_initiated); |
| 1612 | 1620 | |
| 1613 | 1621 | if (ret == KVM_MSR_RET_INVALID) |
| 1614 | − if (kvm_msr_ignored_check(vcpu, index, data, true)) | |
| 1622 | + if (kvm_msr_ignored_check(index, data, true)) | |
| 1615 | 1623 | ret = 0; |
| 1616 | 1624 | |
| 1617 | 1625 | return ret; |
| @@ -1649,7 +1657,7 @@ static int kvm_get_msr_ignored_check(struct kvm_vcpu *vcpu, · 31 unmodified lines | ||
| 1649 | 1657 | if (ret == KVM_MSR_RET_INVALID) { |
| 1650 | 1658 | /* Unconditionally clear *data for simplicity */ |
| 1651 | 1659 | *data = 0; |
| 1652 | − if (kvm_msr_ignored_check(vcpu, index, 0, false)) | |
| 1660 | + if (kvm_msr_ignored_check(index, 0, false)) | |
| 1653 | 1661 | ret = 0; |
| 1654 | 1662 | } |
| 1655 | 1663 | |
| @@ -2320,7 +2328,7 @@ static void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 data) · 664 unmodified lines | ||
| 2320 | 2328 | kvm_vcpu_write_tsc_offset(vcpu, offset); |
| 2321 | 2329 | raw_spin_unlock_irqrestore(&kvm->arch.tsc_write_lock, flags); |
| 2322 | 2330 | |
| 2323 | − spin_lock(&kvm->arch.pvclock_gtod_sync_lock); | |
| 2331 | + spin_lock_irqsave(&kvm->arch.pvclock_gtod_sync_lock, flags); | |
| 2324 | 2332 | if (!matched) { |
| 2325 | 2333 | kvm->arch.nr_vcpus_matched_tsc = 0; |
| 2326 | 2334 | } else if (!already_matched) { |
| @@ -2328,7 +2336,7 @@ static void kvm_synchronize_tsc(struct kvm_vcpu *vcpu, u64 data) · 1 unmodified line | ||
| 2328 | 2336 | } |
| 2329 | 2337 | |
| 2330 | 2338 | kvm_track_tsc_matching(vcpu); |
| 2331 | − spin_unlock(&kvm->arch.pvclock_gtod_sync_lock); | |
| 2339 | + spin_unlock_irqrestore(&kvm->arch.pvclock_gtod_sync_lock, flags); | |
| 2332 | 2340 | } |
| 2333 | 2341 | |
| 2334 | 2342 | static inline void adjust_tsc_offset_guest(struct kvm_vcpu *vcpu, |
| @@ -2550,11 +2558,16 @@ static void kvm_gen_update_masterclock(struct kvm *kvm) · 215 unmodified lines | ||
| 2550 | 2558 | int i; |
| 2551 | 2559 | struct kvm_vcpu *vcpu; |
| 2552 | 2560 | struct kvm_arch *ka = &kvm->arch; |
| 2561 | + unsigned long flags; | |
| 2562 | + | |
| 2563 | + kvm_hv_invalidate_tsc_page(kvm); | |
| 2553 | 2564 | |
| 2554 | − spin_lock(&ka->pvclock_gtod_sync_lock); | |
| 2555 | 2565 | kvm_make_mclock_inprogress_request(kvm); |
| 2566 | + | |
| 2556 | 2567 | /* no guest entries from this point */ |
| 2568 | + spin_lock_irqsave(&ka->pvclock_gtod_sync_lock, flags); | |
| 2557 | 2569 | pvclock_update_vm_gtod_copy(kvm); |
| 2570 | + spin_unlock_irqrestore(&ka->pvclock_gtod_sync_lock, flags); | |
| 2558 | 2571 | |
| 2559 | 2572 | kvm_for_each_vcpu(i, vcpu, kvm) |
| 2560 | 2573 | kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); |
| @@ -2562,8 +2575,6 @@ static void kvm_gen_update_masterclock(struct kvm *kvm) · 1 unmodified line | ||
| 2562 | 2575 | /* guest entries allowed */ |
| 2563 | 2576 | kvm_for_each_vcpu(i, vcpu, kvm) |
| 2564 | 2577 | kvm_clear_request(KVM_REQ_MCLOCK_INPROGRESS, vcpu); |
| 2565 | − | |
| 2566 | − spin_unlock(&ka->pvclock_gtod_sync_lock); | |
| 2567 | 2578 | #endif |
| 2568 | 2579 | } |
| 2569 | 2580 | |
| @@ -2571,17 +2582,18 @@ u64 get_kvmclock_ns(struct kvm *kvm) · 1 unmodified line | ||
| 2571 | 2582 | { |
| 2572 | 2583 | struct kvm_arch *ka = &kvm->arch; |
| 2573 | 2584 | struct pvclock_vcpu_time_info hv_clock; |
| 2585 | + unsigned long flags; | |
| 2574 | 2586 | u64 ret; |
| 2575 | 2587 | |
| 2576 | − spin_lock(&ka->pvclock_gtod_sync_lock); | |
| 2588 | + spin_lock_irqsave(&ka->pvclock_gtod_sync_lock, flags); | |
| 2577 | 2589 | if (!ka->use_master_clock) { |
| 2578 | − spin_unlock(&ka->pvclock_gtod_sync_lock); | |
| 2590 | + spin_unlock_irqrestore(&ka->pvclock_gtod_sync_lock, flags); | |
| 2579 | 2591 | return get_kvmclock_base_ns() + ka->kvmclock_offset; |
| 2580 | 2592 | } |
| 2581 | 2593 | |
| 2582 | 2594 | hv_clock.tsc_timestamp = ka->master_cycle_now; |
| 2583 | 2595 | hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset; |
| 2584 | − spin_unlock(&ka->pvclock_gtod_sync_lock); | |
| 2596 | + spin_unlock_irqrestore(&ka->pvclock_gtod_sync_lock, flags); | |
| 2585 | 2597 | |
| 2586 | 2598 | /* both __this_cpu_read() and rdtsc() should be on the same cpu */ |
| 2587 | 2599 | get_cpu(); |
| @@ -2675,13 +2687,13 @@ static int kvm_guest_time_update(struct kvm_vcpu *v) · 87 unmodified lines | ||
| 2675 | 2687 | * If the host uses TSC clock, then passthrough TSC as stable |
| 2676 | 2688 | * to the guest. |
| 2677 | 2689 | */ |
| 2678 | − spin_lock(&ka->pvclock_gtod_sync_lock); | |
| 2690 | + spin_lock_irqsave(&ka->pvclock_gtod_sync_lock, flags); | |
| 2679 | 2691 | use_master_clock = ka->use_master_clock; |
| 2680 | 2692 | if (use_master_clock) { |
| 2681 | 2693 | host_tsc = ka->master_cycle_now; |
| 2682 | 2694 | kernel_ns = ka->master_kernel_ns; |
| 2683 | 2695 | } |
| 2684 | − spin_unlock(&ka->pvclock_gtod_sync_lock); | |
| 2696 | + spin_unlock_irqrestore(&ka->pvclock_gtod_sync_lock, flags); | |
| 2685 | 2697 | |
| 2686 | 2698 | /* Keep irq disabled to prevent changes to the clock */ |
| 2687 | 2699 | local_irq_save(flags); |
| @@ -5352,25 +5364,34 @@ split_irqchip_unlock: · 2664 unmodified lines | ||
| 5352 | 5364 | return r; |
| 5353 | 5365 | } |
| 5354 | 5366 | |
| 5355 | −static void kvm_clear_msr_filter(struct kvm *kvm) | |
| 5367 | +static struct kvm_x86_msr_filter *kvm_alloc_msr_filter(bool default_allow) | |
| 5368 | +{ | |
| 5369 | + struct kvm_x86_msr_filter *msr_filter; | |
| 5370 | + | |
| 5371 | + msr_filter = kzalloc(sizeof(*msr_filter), GFP_KERNEL_ACCOUNT); | |
| 5372 | + if (!msr_filter) | |
| 5373 | + return NULL; | |
| 5374 | + | |
| 5375 | + msr_filter->default_allow = default_allow; | |
| 5376 | + return msr_filter; | |
| 5377 | +} | |
| 5378 | + | |
| 5379 | +static void kvm_free_msr_filter(struct kvm_x86_msr_filter *msr_filter) | |
| 5356 | 5380 | { |
| 5357 | 5381 | u32 i; |
| 5358 | − u32 count = kvm->arch.msr_filter.count; | |
| 5359 | − struct msr_bitmap_range ranges[16]; | |
| 5360 | 5382 | |
| 5361 | − mutex_lock(&kvm->lock); | |
| 5362 | − kvm->arch.msr_filter.count = 0; | |
| 5363 | − memcpy(ranges, kvm->arch.msr_filter.ranges, count * sizeof(ranges[0])); | |
| 5364 | − mutex_unlock(&kvm->lock); | |
| 5365 | − synchronize_srcu(&kvm->srcu); | |
| 5383 | + if (!msr_filter) | |
| 5384 | + return; | |
| 5385 | + | |
| 5386 | + for (i = 0; i < msr_filter->count; i++) | |
| 5387 | + kfree(msr_filter->ranges[i].bitmap); | |
| 5366 | 5388 | |
| 5367 | − for (i = 0; i < count; i++) | |
| 5368 | − kfree(ranges[i].bitmap); | |
| 5389 | + kfree(msr_filter); | |
| 5369 | 5390 | } |
| 5370 | 5391 | |
| 5371 | −static int kvm_add_msr_filter(struct kvm *kvm, struct kvm_msr_filter_range *user_range) | |
| 5392 | +static int kvm_add_msr_filter(struct kvm_x86_msr_filter *msr_filter, | |
| 5393 | + struct kvm_msr_filter_range *user_range) | |
| 5372 | 5394 | { |
| 5373 | − struct msr_bitmap_range *ranges = kvm->arch.msr_filter.ranges; | |
| 5374 | 5395 | struct msr_bitmap_range range; |
| 5375 | 5396 | unsigned long *bitmap = NULL; |
| 5376 | 5397 | size_t bitmap_size; |
| @@ -5404,11 +5425,9 @@ static int kvm_add_msr_filter(struct kvm *kvm, struct kvm_msr_filter_range *user · 27 unmodified lines | ||
| 5404 | 5425 | goto err; |
| 5405 | 5426 | } |
| 5406 | 5427 | |
| 5407 | − /* Everything ok, add this range identifier to our global pool */ | |
| 5408 | − ranges[kvm->arch.msr_filter.count] = range; | |
| 5409 | − /* Make sure we filled the array before we tell anyone to walk it */ | |
| 5410 | − smp_wmb(); | |
| 5411 | − kvm->arch.msr_filter.count++; | |
| 5428 | + /* Everything ok, add this range identifier. */ | |
| 5429 | + msr_filter->ranges[msr_filter->count] = range; | |
| 5430 | + msr_filter->count++; | |
| 5412 | 5431 | |
| 5413 | 5432 | return 0; |
| 5414 | 5433 | err: |
| @@ -5419,10 +5438,11 @@ err: · 4 unmodified lines | ||
| 5419 | 5438 | static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, void __user *argp) |
| 5420 | 5439 | { |
| 5421 | 5440 | struct kvm_msr_filter __user *user_msr_filter = argp; |
| 5441 | + struct kvm_x86_msr_filter *new_filter, *old_filter; | |
| 5422 | 5442 | struct kvm_msr_filter filter; |
| 5423 | 5443 | bool default_allow; |
| 5424 | − int r = 0; | |
| 5425 | 5444 | bool empty = true; |
| 5445 | + int r = 0; | |
| 5426 | 5446 | u32 i; |
| 5427 | 5447 | |
| 5428 | 5448 | if (copy_from_user(&filter, user_msr_filter, sizeof(filter))) |
| @@ -5435,25 +5455,32 @@ static int kvm_vm_ioctl_set_msr_filter(struct kvm *kvm, void __user *argp) · 6 unmodified lines | ||
| 5435 | 5455 | if (empty && !default_allow) |
| 5436 | 5456 | return -EINVAL; |
| 5437 | 5457 | |
| 5438 | − kvm_clear_msr_filter(kvm); | |
| 5439 | − | |
| 5440 | − kvm->arch.msr_filter.default_allow = default_allow; | |
| 5458 | + new_filter = kvm_alloc_msr_filter(default_allow); | |
| 5459 | + if (!new_filter) | |
| 5460 | + return -ENOMEM; | |
| 5441 | 5461 | |
| 5442 | − /* | |
| 5443 | − * Protect from concurrent calls to this function that could trigger | |
| 5444 | − * a TOCTOU violation on kvm->arch.msr_filter.count. | |
| 5445 | − */ | |
| 5446 | − mutex_lock(&kvm->lock); | |
| 5447 | 5462 | for (i = 0; i < ARRAY_SIZE(filter.ranges); i++) { |
| 5448 | − r = kvm_add_msr_filter(kvm, &filter.ranges[i]); | |
| 5449 | − if (r) | |
| 5450 | − break; | |
| 5463 | + r = kvm_add_msr_filter(new_filter, &filter.ranges[i]); | |
| 5464 | + if (r) { | |
| 5465 | + kvm_free_msr_filter(new_filter); | |
| 5466 | + return r; | |
| 5467 | + } | |
| 5451 | 5468 | } |
| 5452 | 5469 | |
| 5470 | + mutex_lock(&kvm->lock); | |
| 5471 | + | |
| 5472 | + /* The per-VM filter is protected by kvm->lock... */ | |
| 5473 | + old_filter = srcu_dereference_check(kvm->arch.msr_filter, &kvm->srcu, 1); | |
| 5474 | + | |
| 5475 | + rcu_assign_pointer(kvm->arch.msr_filter, new_filter); | |
| 5476 | + synchronize_srcu(&kvm->srcu); | |
| 5477 | + | |
| 5478 | + kvm_free_msr_filter(old_filter); | |
| 5479 | + | |
| 5453 | 5480 | kvm_make_all_cpus_request(kvm, KVM_REQ_MSR_FILTER_CHANGED); |
| 5454 | 5481 | mutex_unlock(&kvm->lock); |
| 5455 | 5482 | |
| 5456 | − return r; | |
| 5483 | + return 0; | |
| 5457 | 5484 | } |
| 5458 | 5485 | |
| 5459 | 5486 | long kvm_arch_vm_ioctl(struct file *filp, |
| @@ -5700,6 +5727,7 @@ set_pit2_out: · 240 unmodified lines | ||
| 5700 | 5727 | } |
| 5701 | 5728 | #endif |
| 5702 | 5729 | case KVM_SET_CLOCK: { |
| 5730 | + struct kvm_arch *ka = &kvm->arch; | |
| 5703 | 5731 | struct kvm_clock_data user_ns; |
| 5704 | 5732 | u64 now_ns; |
| 5705 | 5733 | |
| @@ -5718,8 +5746,22 @@ set_pit2_out: · 12 unmodified lines | ||
| 5718 | 5746 | * pvclock_update_vm_gtod_copy(). |
| 5719 | 5747 | */ |
| 5720 | 5748 | kvm_gen_update_masterclock(kvm); |
| 5721 | − now_ns = get_kvmclock_ns(kvm); | |
| 5722 | − kvm->arch.kvmclock_offset += user_ns.clock - now_ns; | |
| 5749 | + | |
| 5750 | + /* | |
| 5751 | + * This pairs with kvm_guest_time_update(): when masterclock is | |
| 5752 | + * in use, we use master_kernel_ns + kvmclock_offset to set | |
| 5753 | + * unsigned 'system_time' so if we use get_kvmclock_ns() (which | |
| 5754 | + * is slightly ahead) here we risk going negative on unsigned | |
| 5755 | + * 'system_time' when 'user_ns.clock' is very small. | |
| 5756 | + */ | |
| 5757 | + spin_lock_irq(&ka->pvclock_gtod_sync_lock); | |
| 5758 | + if (kvm->arch.use_master_clock) | |
| 5759 | + now_ns = ka->master_kernel_ns; | |
| 5760 | + else | |
| 5761 | + now_ns = get_kvmclock_base_ns(); | |
| 5762 | + ka->kvmclock_offset = user_ns.clock - now_ns; | |
| 5763 | + spin_unlock_irq(&ka->pvclock_gtod_sync_lock); | |
| 5764 | + | |
| 5723 | 5765 | kvm_make_all_cpus_request(kvm, KVM_REQ_CLOCK_UPDATE); |
| 5724 | 5766 | break; |
| 5725 | 5767 | } |
| @@ -6603,7 +6645,7 @@ static int kvm_emulate_wbinvd_noskip(struct kvm_vcpu *vcpu) · 877 unmodified lines | ||
| 6603 | 6645 | int cpu = get_cpu(); |
| 6604 | 6646 | |
| 6605 | 6647 | cpumask_set_cpu(cpu, vcpu->arch.wbinvd_dirty_mask); |
| 6606 | − smp_call_function_many(vcpu->arch.wbinvd_dirty_mask, | |
| 6648 | + on_each_cpu_mask(vcpu->arch.wbinvd_dirty_mask, | |
| 6607 | 6649 | wbinvd_ipi, NULL, 1); |
| 6608 | 6650 | put_cpu(); |
| 6609 | 6651 | cpumask_clear(vcpu->arch.wbinvd_dirty_mask); |
| @@ -7698,6 +7740,7 @@ static void kvm_hyperv_tsc_notifier(void) · 1088 unmodified lines | ||
| 7698 | 7740 | struct kvm *kvm; |
| 7699 | 7741 | struct kvm_vcpu *vcpu; |
| 7700 | 7742 | int cpu; |
| 7743 | + unsigned long flags; | |
| 7701 | 7744 | |
| 7702 | 7745 | mutex_lock(&kvm_lock); |
| 7703 | 7746 | list_for_each_entry(kvm, &vm_list, vm_list) |
| @@ -7713,17 +7756,15 @@ static void kvm_hyperv_tsc_notifier(void) · 9 unmodified lines | ||
| 7713 | 7756 | list_for_each_entry(kvm, &vm_list, vm_list) { |
| 7714 | 7757 | struct kvm_arch *ka = &kvm->arch; |
| 7715 | 7758 | |
| 7716 | − spin_lock(&ka->pvclock_gtod_sync_lock); | |
| 7717 | − | |
| 7759 | + spin_lock_irqsave(&ka->pvclock_gtod_sync_lock, flags); | |
| 7718 | 7760 | pvclock_update_vm_gtod_copy(kvm); |
| 7761 | + spin_unlock_irqrestore(&ka->pvclock_gtod_sync_lock, flags); | |
| 7719 | 7762 | |
| 7720 | 7763 | kvm_for_each_vcpu(cpu, vcpu, kvm) |
| 7721 | 7764 | kvm_make_request(KVM_REQ_CLOCK_UPDATE, vcpu); |
| 7722 | 7765 | |
| 7723 | 7766 | kvm_for_each_vcpu(cpu, vcpu, kvm) |
| 7724 | 7767 | kvm_clear_request(KVM_REQ_MCLOCK_INPROGRESS, vcpu); |
| 7725 | − | |
| 7726 | − spin_unlock(&ka->pvclock_gtod_sync_lock); | |
| 7727 | 7768 | } |
| 7728 | 7769 | mutex_unlock(&kvm_lock); |
| 7729 | 7770 | } |
| @@ -10601,7 +10642,7 @@ void __user * __x86_set_memory_region(struct kvm *kvm, int id, gpa_t gpa, · 2871 unmodified lines | ||
| 10601 | 10642 | return (void __user *)hva; |
| 10602 | 10643 | } else { |
| 10603 | 10644 | if (!slot || !slot->npages) |
| 10604 | − return 0; | |
| 10645 | + return NULL; | |
| 10605 | 10646 | |
| 10606 | 10647 | old_npages = slot->npages; |
| 10607 | 10648 | hva = slot->userspace_addr; |
| @@ -10634,8 +10675,6 @@ void kvm_arch_pre_destroy_vm(struct kvm *kvm) · 26 unmodified lines | ||
| 10634 | 10675 | |
| 10635 | 10676 | void kvm_arch_destroy_vm(struct kvm *kvm) |
| 10636 | 10677 | { |
| 10637 | − u32 i; | |
| 10638 | − | |
| 10639 | 10678 | if (current->mm == kvm->mm) { |
| 10640 | 10679 | /* |
| 10641 | 10680 | * Free memory regions allocated on behalf of userspace, |
| @@ -10651,8 +10690,7 @@ void kvm_arch_destroy_vm(struct kvm *kvm) · 9 unmodified lines | ||
| 10651 | 10690 | mutex_unlock(&kvm->slots_lock); |
| 10652 | 10691 | } |
| 10653 | 10692 | static_call_cond(kvm_x86_vm_destroy)(kvm); |
| 10654 | − for (i = 0; i < kvm->arch.msr_filter.count; i++) | |
| 10655 | − kfree(kvm->arch.msr_filter.ranges[i].bitmap); | |
| 10693 | + kvm_free_msr_filter(srcu_dereference_check(kvm->arch.msr_filter, &kvm->srcu, 1)); | |
| 10656 | 10694 | kvm_pic_destroy(kvm); |
| 10657 | 10695 | kvm_ioapic_destroy(kvm); |
| 10658 | 10696 | kvm_free_vcpus(kvm); |
| @@ -250,7 +250,6 @@ static inline bool kvm_vcpu_latch_init(struct kvm_vcpu *vcpu) · 249 unmodified lines | ||
| 250 | 250 | void kvm_write_wall_clock(struct kvm *kvm, gpa_t wall_clock, int sec_hi_ofs); |
| 251 | 251 | void kvm_inject_realmode_interrupt(struct kvm_vcpu *vcpu, int irq, int inc_eip); |
| 252 | 252 | |
| 253 | −void kvm_write_tsc(struct kvm_vcpu *vcpu, struct msr_data *msr); | |
| 254 | 253 | u64 get_kvmclock_ns(struct kvm *kvm); |
| 255 | 254 | |
| 256 | 255 | int kvm_read_guest_virt(struct kvm_vcpu *vcpu, |
| @@ -1415,6 +1415,25 @@ void __user *insn_get_addr_ref(struct insn *insn, struct pt_regs *regs) · 1414 unmodified lines | ||
| 1415 | 1415 | } |
| 1416 | 1416 | } |
| 1417 | 1417 | |
| 1418 | +static unsigned long insn_get_effective_ip(struct pt_regs *regs) | |
| 1419 | +{ | |
| 1420 | + unsigned long seg_base = 0; | |
| 1421 | + | |
| 1422 | + /* | |
| 1423 | + * If not in user-space long mode, a custom code segment could be in | |
| 1424 | + * use. This is true in protected mode (if the process defined a local | |
| 1425 | + * descriptor table), or virtual-8086 mode. In most of the cases | |
| 1426 | + * seg_base will be zero as in USER_CS. | |
| 1427 | + */ | |
| 1428 | + if (!user_64bit_mode(regs)) { | |
| 1429 | + seg_base = insn_get_seg_base(regs, INAT_SEG_REG_CS); | |
| 1430 | + if (seg_base == -1L) | |
| 1431 | + return 0; | |
| 1432 | + } | |
| 1433 | + | |
| 1434 | + return seg_base + regs->ip; | |
| 1435 | +} | |
| 1436 | + | |
| 1418 | 1437 | /** |
| 1419 | 1438 | * insn_fetch_from_user() - Copy instruction bytes from user-space memory |
| 1420 | 1439 | * @regs: Structure with register values as seen when entering kernel mode |
| @@ -1431,24 +1450,43 @@ void __user *insn_get_addr_ref(struct insn *insn, struct pt_regs *regs) · 10 unmodified lines | ||
| 1431 | 1450 | */ |
| 1432 | 1451 | int insn_fetch_from_user(struct pt_regs *regs, unsigned char buf[MAX_INSN_SIZE]) |
| 1433 | 1452 | { |
| 1434 | − unsigned long seg_base = 0; | |
| 1453 | + unsigned long ip; | |
| 1435 | 1454 | int not_copied; |
| 1436 | 1455 | |
| 1437 | − /* | |
| 1438 | − * If not in user-space long mode, a custom code segment could be in | |
| 1439 | − * use. This is true in protected mode (if the process defined a local | |
| 1440 | − * descriptor table), or virtual-8086 mode. In most of the cases | |
| 1441 | − * seg_base will be zero as in USER_CS. | |
| 1442 | − */ | |
| 1443 | − if (!user_64bit_mode(regs)) { | |
| 1444 | − seg_base = insn_get_seg_base(regs, INAT_SEG_REG_CS); | |
| 1445 | − if (seg_base == -1L) | |
| 1446 | − return 0; | |
| 1447 | − } | |
| 1456 | + ip = insn_get_effective_ip(regs); | |
| 1457 | + if (!ip) | |
| 1458 | + return 0; | |
| 1459 | + | |
| 1460 | + not_copied = copy_from_user(buf, (void __user *)ip, MAX_INSN_SIZE); | |
| 1448 | 1461 | |
| 1462 | + return MAX_INSN_SIZE - not_copied; | |
| 1463 | +} | |
| 1464 | + | |
| 1465 | +/** | |
| 1466 | + * insn_fetch_from_user_inatomic() - Copy instruction bytes from user-space memory | |
| 1467 | + * while in atomic code | |
| 1468 | + * @regs: Structure with register values as seen when entering kernel mode | |
| 1469 | + * @buf: Array to store the fetched instruction | |
| 1470 | + * | |
| 1471 | + * Gets the linear address of the instruction and copies the instruction bytes | |
| 1472 | + * to the buf. This function must be used in atomic context. | |
| 1473 | + * | |
| 1474 | + * Returns: | |
| 1475 | + * | |
| 1476 | + * Number of instruction bytes copied. | |
| 1477 | + * | |
| 1478 | + * 0 if nothing was copied. | |
| 1479 | + */ | |
| 1480 | +int insn_fetch_from_user_inatomic(struct pt_regs *regs, unsigned char buf[MAX_INSN_SIZE]) | |
| 1481 | +{ | |
| 1482 | + unsigned long ip; | |
| 1483 | + int not_copied; | |
| 1484 | + | |
| 1485 | + ip = insn_get_effective_ip(regs); | |
| 1486 | + if (!ip) | |
| 1487 | + return 0; | |
| 1449 | 1488 | |
| 1450 | − not_copied = copy_from_user(buf, (void __user *)(seg_base + regs->ip), | |
| 1451 | − MAX_INSN_SIZE); | |
| 1489 | + not_copied = __copy_from_user_inatomic(buf, (void __user *)ip, MAX_INSN_SIZE); | |
| 1452 | 1490 | |
| 1453 | 1491 | return MAX_INSN_SIZE - not_copied; |
| 1454 | 1492 | } |
| @@ -262,7 +262,7 @@ static void __init __set_clr_pte_enc(pte_t *kpte, int level, bool enc) · 261 unmodified lines | ||
| 262 | 262 | if (pgprot_val(old_prot) == pgprot_val(new_prot)) |
| 263 | 263 | return; |
| 264 | 264 | |
| 265 | − pa = pfn << page_level_shift(level); | |
| 265 | + pa = pfn << PAGE_SHIFT; | |
| 266 | 266 | size = page_level_size(level); |
| 267 | 267 | |
| 268 | 268 | /* |
| @@ -1349,6 +1349,7 @@ st: if (is_imm8(insn->off)) · 1348 unmodified lines | ||
| 1349 | 1349 | insn->imm == (BPF_XOR | BPF_FETCH)) { |
| 1350 | 1350 | u8 *branch_target; |
| 1351 | 1351 | bool is64 = BPF_SIZE(insn->code) == BPF_DW; |
| 1352 | + u32 real_src_reg = src_reg; | |
| 1352 | 1353 | |
| 1353 | 1354 | /* |
| 1354 | 1355 | * Can't be implemented with a single x86 insn. |
| @@ -1357,6 +1358,9 @@ st: if (is_imm8(insn->off)) · 2 unmodified lines | ||
| 1357 | 1358 | |
| 1358 | 1359 | /* Will need RAX as a CMPXCHG operand so save R0 */ |
| 1359 | 1360 | emit_mov_reg(&prog, true, BPF_REG_AX, BPF_REG_0); |
| 1361 | + if (src_reg == BPF_REG_0) | |
| 1362 | + real_src_reg = BPF_REG_AX; | |
| 1363 | + | |
| 1360 | 1364 | branch_target = prog; |
| 1361 | 1365 | /* Load old value */ |
| 1362 | 1366 | emit_ldx(&prog, BPF_SIZE(insn->code), |
| @@ -1366,9 +1370,9 @@ st: if (is_imm8(insn->off)) · 3 unmodified lines | ||
| 1366 | 1370 | * put the result in the AUX_REG. |
| 1367 | 1371 | */ |
| 1368 | 1372 | emit_mov_reg(&prog, is64, AUX_REG, BPF_REG_0); |
| 1369 | − maybe_emit_mod(&prog, AUX_REG, src_reg, is64); | |
| 1373 | + maybe_emit_mod(&prog, AUX_REG, real_src_reg, is64); | |
| 1370 | 1374 | EMIT2(simple_alu_opcodes[BPF_OP(insn->imm)], |
| 1371 | − add_2reg(0xC0, AUX_REG, src_reg)); | |
| 1375 | + add_2reg(0xC0, AUX_REG, real_src_reg)); | |
| 1372 | 1376 | /* Attempt to swap in new value */ |
| 1373 | 1377 | err = emit_atomic(&prog, BPF_CMPXCHG, |
| 1374 | 1378 | dst_reg, AUX_REG, insn->off, |
| @@ -1381,7 +1385,7 @@ st: if (is_imm8(insn->off)) · 6 unmodified lines | ||
| 1381 | 1385 | */ |
| 1382 | 1386 | EMIT2(X86_JNE, -(prog - branch_target) - 2); |
| 1383 | 1387 | /* Return the pre-modification value */ |
| 1384 | − emit_mov_reg(&prog, is64, src_reg, BPF_REG_0); | |
| 1388 | + emit_mov_reg(&prog, is64, real_src_reg, BPF_REG_0); | |
| 1385 | 1389 | /* Restore R0 after clobbering RAX */ |
| 1386 | 1390 | emit_mov_reg(&prog, true, BPF_REG_0, BPF_REG_AX); |
| 1387 | 1391 | break; |
| @@ -1685,7 +1689,16 @@ emit_jmp: · 297 unmodified lines | ||
| 1685 | 1689 | } |
| 1686 | 1690 | |
| 1687 | 1691 | if (image) { |
| 1688 | − if (unlikely(proglen + ilen > oldproglen)) { | |
| 1692 | + /* | |
| 1693 | + * When populating the image, assert that: | |
| 1694 | + * | |
| 1695 | + * i) We do not write beyond the allocated space, and | |
| 1696 | + * ii) addrs[i] did not change from the prior run, in order | |
| 1697 | + * to validate assumptions made for computing branch | |
| 1698 | + * displacements. | |
| 1699 | + */ | |
| 1700 | + if (unlikely(proglen + ilen > oldproglen || | |
| 1701 | + proglen + ilen != addrs[i])) { | |
| 1689 | 1702 | pr_err("bpf_jit: fatal error\n"); |
| 1690 | 1703 | return -EFAULT; |
| 1691 | 1704 | } |
| @@ -1932,7 +1945,7 @@ static int invoke_bpf_mod_ret(const struct btf_func_model *m, u8 **pprog, · 240 unmodified lines | ||
| 1932 | 1945 | * add rsp, 8 // skip eth_type_trans's frame |
| 1933 | 1946 | * ret // return to its caller |
| 1934 | 1947 | */ |
| 1935 | −int arch_prepare_bpf_trampoline(void *image, void *image_end, | |
| 1948 | +int arch_prepare_bpf_trampoline(struct bpf_tramp_image *im, void *image, void *image_end, | |
| 1936 | 1949 | const struct btf_func_model *m, u32 flags, |
| 1937 | 1950 | struct bpf_tramp_progs *tprogs, |
| 1938 | 1951 | void *orig_call) |
| @@ -1971,6 +1984,15 @@ int arch_prepare_bpf_trampoline(void *image, void *image_end, · 32 unmodified lines | ||
| 1971 | 1984 | |
| 1972 | 1985 | save_regs(m, &prog, nr_args, stack_size); |
| 1973 | 1986 | |
| 1987 | + if (flags & BPF_TRAMP_F_CALL_ORIG) { | |
| 1988 | + /* arg1: mov rdi, im */ | |
| 1989 | + emit_mov_imm64(&prog, BPF_REG_1, (long) im >> 32, (u32) (long) im); | |
| 1990 | + if (emit_call(&prog, __bpf_tramp_enter, prog)) { | |
| 1991 | + ret = -EINVAL; | |
| 1992 | + goto cleanup; | |
| 1993 | + } | |
| 1994 | + } | |
| 1995 | + | |
| 1974 | 1996 | if (fentry->nr_progs) |
| 1975 | 1997 | if (invoke_bpf(m, &prog, fentry, stack_size)) |
| 1976 | 1998 | return -EINVAL; |
| @@ -1989,8 +2011,7 @@ int arch_prepare_bpf_trampoline(void *image, void *image_end, · 12 unmodified lines | ||
| 1989 | 2011 | } |
| 1990 | 2012 | |
| 1991 | 2013 | if (flags & BPF_TRAMP_F_CALL_ORIG) { |
| 1992 | − if (fentry->nr_progs || fmod_ret->nr_progs) | |
| 1993 | − restore_regs(m, &prog, nr_args, stack_size); | |
| 2014 | + restore_regs(m, &prog, nr_args, stack_size); | |
| 1994 | 2015 | |
| 1995 | 2016 | /* call original function */ |
| 1996 | 2017 | if (emit_call(&prog, orig_call, prog)) { |
| @@ -1999,6 +2020,9 @@ int arch_prepare_bpf_trampoline(void *image, void *image_end, · 2 unmodified lines | ||
| 1999 | 2020 | } |
| 2000 | 2021 | /* remember return value in a stack for bpf prog to access */ |
| 2001 | 2022 | emit_stx(&prog, BPF_DW, BPF_REG_FP, BPF_REG_0, -8); |
| 2023 | + im->ip_after_call = prog; | |
| 2024 | + memcpy(prog, ideal_nops[NOP_ATOMIC5], X86_PATCH_SIZE); | |
| 2025 | + prog += X86_PATCH_SIZE; | |
| 2002 | 2026 | } |
| 2003 | 2027 | |
| 2004 | 2028 | if (fmod_ret->nr_progs) { |
| @@ -2029,9 +2053,17 @@ int arch_prepare_bpf_trampoline(void *image, void *image_end, · 24 unmodified lines | ||
| 2029 | 2053 | * the return value is only updated on the stack and still needs to be |
| 2030 | 2054 | * restored to R0. |
| 2031 | 2055 | */ |
| 2032 | − if (flags & BPF_TRAMP_F_CALL_ORIG) | |
| 2056 | + if (flags & BPF_TRAMP_F_CALL_ORIG) { | |
| 2057 | + im->ip_epilogue = prog; | |
| 2058 | + /* arg1: mov rdi, im */ | |
| 2059 | + emit_mov_imm64(&prog, BPF_REG_1, (long) im >> 32, (u32) (long) im); | |
| 2060 | + if (emit_call(&prog, __bpf_tramp_exit, prog)) { | |
| 2061 | + ret = -EINVAL; | |
| 2062 | + goto cleanup; | |
| 2063 | + } | |
| 2033 | 2064 | /* restore original return value back into RAX */ |
| 2034 | 2065 | emit_ldx(&prog, BPF_DW, BPF_REG_0, BPF_REG_FP, -8); |
| 2066 | + } | |
| 2035 | 2067 | |
| 2036 | 2068 | EMIT1(0x5B); /* pop rbx */ |
| 2037 | 2069 | EMIT1(0xC9); /* leave */ |
| @@ -2221,7 +2253,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *prog) · 183 unmodified lines | ||
| 2221 | 2253 | padding = true; |
| 2222 | 2254 | goto skip_init_addrs; |
| 2223 | 2255 | } |
| 2224 | − addrs = kmalloc_array(prog->len + 1, sizeof(*addrs), GFP_KERNEL); | |
| 2256 | + addrs = kvmalloc_array(prog->len + 1, sizeof(*addrs), GFP_KERNEL); | |
| 2225 | 2257 | if (!addrs) { |
| 2226 | 2258 | prog = orig_prog; |
| 2227 | 2259 | goto out_addrs; |
| @@ -2313,7 +2345,7 @@ out_image: · 85 unmodified lines | ||
| 2313 | 2345 | if (image) |
| 2314 | 2346 | bpf_prog_fill_jited_linfo(prog, addrs + 1); |
| 2315 | 2347 | out_addrs: |
| 2316 | − kfree(addrs); | |
| 2348 | + kvfree(addrs); | |
| 2317 | 2349 | kfree(jit_data); |
| 2318 | 2350 | prog->aux->jit_data = NULL; |
| 2319 | 2351 | } |
| @@ -2276,7 +2276,16 @@ notyet: · 2275 unmodified lines | ||
| 2276 | 2276 | } |
| 2277 | 2277 | |
| 2278 | 2278 | if (image) { |
| 2279 | − if (unlikely(proglen + ilen > oldproglen)) { | |
| 2279 | + /* | |
| 2280 | + * When populating the image, assert that: | |
| 2281 | + * | |
| 2282 | + * i) We do not write beyond the allocated space, and | |
| 2283 | + * ii) addrs[i] did not change from the prior run, in order | |
| 2284 | + * to validate assumptions made for computing branch | |
| 2285 | + * displacements. | |
| 2286 | + */ | |
| 2287 | + if (unlikely(proglen + ilen > oldproglen || | |
| 2288 | + proglen + ilen != addrs[i])) { | |
| 2280 | 2289 | pr_err("bpf_jit: fatal error\n"); |
| 2281 | 2290 | return -EFAULT; |
| 2282 | 2291 | } |
| @@ -27,7 +27,6 @@ · 26 unmodified lines | ||
| 27 | 27 | MODULE_LICENSE("GPL"); |
| 28 | 28 | MODULE_AUTHOR("Sébastien Hinderer <Sebastien.Hinderer@ens-lyon.org>"); |
| 29 | 29 | MODULE_DESCRIPTION("A power_off handler for Iris devices from EuroBraille"); |
| 30 | −MODULE_SUPPORTED_DEVICE("Eurobraille/Iris"); | |
| 31 | 30 | |
| 32 | 31 | static bool force; |
| 33 | 32 | |
| @@ -98,8 +98,8 @@ EXPORT_SYMBOL_GPL(xen_p2m_size); · 97 unmodified lines | ||
| 98 | 98 | unsigned long xen_max_p2m_pfn __read_mostly; |
| 99 | 99 | EXPORT_SYMBOL_GPL(xen_max_p2m_pfn); |
| 100 | 100 | |
| 101 | −#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG_LIMIT | |
| 102 | −#define P2M_LIMIT CONFIG_XEN_BALLOON_MEMORY_HOTPLUG_LIMIT | |
| 101 | +#ifdef CONFIG_XEN_MEMORY_HOTPLUG_LIMIT | |
| 102 | +#define P2M_LIMIT CONFIG_XEN_MEMORY_HOTPLUG_LIMIT | |
| 103 | 103 | #else |
| 104 | 104 | #define P2M_LIMIT 0 |
| 105 | 105 | #endif |
| @@ -416,9 +416,6 @@ void __init xen_vmalloc_p2m_tree(void) · 310 unmodified lines | ||
| 416 | 416 | xen_p2m_last_pfn = xen_max_p2m_pfn; |
| 417 | 417 | |
| 418 | 418 | p2m_limit = (phys_addr_t)P2M_LIMIT * 1024 * 1024 * 1024 / PAGE_SIZE; |
| 419 | − if (!p2m_limit && IS_ENABLED(CONFIG_XEN_UNPOPULATED_ALLOC)) | |
| 420 | − p2m_limit = xen_start_info->nr_pages * XEN_EXTRA_MEM_RATIO; | |
| 421 | − | |
| 422 | 419 | vm.flags = VM_ALLOC; |
| 423 | 420 | vm.size = ALIGN(sizeof(unsigned long) * max(xen_max_p2m_pfn, p2m_limit), |
| 424 | 421 | PMD_SIZE * PMDS_PER_MID_PAGE); |
| @@ -741,7 +738,7 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, · 316 unmodified lines | ||
| 741 | 738 | map_ops[i].status = GNTST_general_error; |
| 742 | 739 | unmap[0].host_addr = map_ops[i].host_addr, |
| 743 | 740 | unmap[0].handle = map_ops[i].handle; |
| 744 | − map_ops[i].handle = ~0; | |
| 741 | + map_ops[i].handle = INVALID_GRANT_HANDLE; | |
| 745 | 742 | if (map_ops[i].flags & GNTMAP_device_map) |
| 746 | 743 | unmap[0].dev_bus_addr = map_ops[i].dev_bus_addr; |
| 747 | 744 | else |
| @@ -751,7 +748,7 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, · 3 unmodified lines | ||
| 751 | 748 | kmap_ops[i].status = GNTST_general_error; |
| 752 | 749 | unmap[1].host_addr = kmap_ops[i].host_addr, |
| 753 | 750 | unmap[1].handle = kmap_ops[i].handle; |
| 754 | − kmap_ops[i].handle = ~0; | |
| 751 | + kmap_ops[i].handle = INVALID_GRANT_HANDLE; | |
| 755 | 752 | if (kmap_ops[i].flags & GNTMAP_device_map) |
| 756 | 753 | unmap[1].dev_bus_addr = kmap_ops[i].dev_bus_addr; |
| 757 | 754 | else |
| @@ -776,7 +773,6 @@ int set_foreign_p2m_mapping(struct gnttab_map_grant_ref *map_ops, · 18 unmodified lines | ||
| 776 | 773 | out: |
| 777 | 774 | return ret; |
| 778 | 775 | } |
| 779 | −EXPORT_SYMBOL_GPL(set_foreign_p2m_mapping); | |
| 780 | 776 | |
| 781 | 777 | int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops, |
| 782 | 778 | struct gnttab_unmap_grant_ref *kunmap_ops, |
| @@ -802,7 +798,6 @@ int clear_foreign_p2m_mapping(struct gnttab_unmap_grant_ref *unmap_ops, · 19 unmodified lines | ||
| 802 | 798 | |
| 803 | 799 | return ret; |
| 804 | 800 | } |
| 805 | −EXPORT_SYMBOL_GPL(clear_foreign_p2m_mapping); | |
| 806 | 801 | |
| 807 | 802 | #ifdef CONFIG_XEN_DEBUG_FS |
| 808 | 803 | #include <linux/debugfs.h> |
| @@ -59,6 +59,18 @@ static struct { · 58 unmodified lines | ||
| 59 | 59 | } xen_remap_buf __initdata __aligned(PAGE_SIZE); |
| 60 | 60 | static unsigned long xen_remap_mfn __initdata = INVALID_P2M_ENTRY; |
| 61 | 61 | |
| 62 | +/* | |
| 63 | + * The maximum amount of extra memory compared to the base size. The | |
| 64 | + * main scaling factor is the size of struct page. At extreme ratios | |
| 65 | + * of base:extra, all the base memory can be filled with page | |
| 66 | + * structures for the extra memory, leaving no space for anything | |
| 67 | + * else. | |
| 68 | + * | |
| 69 | + * 10x seems like a reasonable balance between scaling flexibility and | |
| 70 | + * leaving a practically usable system. | |
| 71 | + */ | |
| 72 | +#define EXTRA_MEM_RATIO (10) | |
| 73 | + | |
| 62 | 74 | static bool xen_512gb_limit __initdata = IS_ENABLED(CONFIG_XEN_512GB); |
| 63 | 75 | |
| 64 | 76 | static void __init xen_parse_512gb(void) |
| @@ -778,13 +790,13 @@ char * __init xen_memory_setup(void) · 713 unmodified lines | ||
| 778 | 790 | extra_pages += max_pages - max_pfn; |
| 779 | 791 | |
| 780 | 792 | /* |
| 781 | − * Clamp the amount of extra memory to a XEN_EXTRA_MEM_RATIO | |
| 793 | + * Clamp the amount of extra memory to a EXTRA_MEM_RATIO | |
| 782 | 794 | * factor the base size. |
| 783 | 795 | * |
| 784 | 796 | * Make sure we have no memory above max_pages, as this area |
| 785 | 797 | * isn't handled by the p2m management. |
| 786 | 798 | */ |
| 787 | − extra_pages = min3(XEN_EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM)), | |
| 799 | + extra_pages = min3(EXTRA_MEM_RATIO * min(max_pfn, PFN_DOWN(MAXMEM)), | |
| 788 | 800 | extra_pages, max_pages - max_pfn); |
| 789 | 801 | i = 0; |
| 790 | 802 | addr = xen_e820_table.entries[0].addr; |
| @@ -99,37 +99,6 @@ · 98 unmodified lines | ||
| 99 | 99 | LOAD_CP_REGS_TAB(6) |
| 100 | 100 | LOAD_CP_REGS_TAB(7) |
| 101 | 101 | |
| 102 | −/* | |
| 103 | − * coprocessor_flush(struct thread_info*, index) | |
| 104 | − * a2 a3 | |
| 105 | − * | |
| 106 | − * Save coprocessor registers for coprocessor 'index'. | |
| 107 | − * The register values are saved to or loaded from the coprocessor area | |
| 108 | − * inside the task_info structure. | |
| 109 | − * | |
| 110 | − * Note that this function doesn't update the coprocessor_owner information! | |
| 111 | − * | |
| 112 | − */ | |
| 113 | − | |
| 114 | −ENTRY(coprocessor_flush) | |
| 115 | − | |
| 116 | − /* reserve 4 bytes on stack to save a0 */ | |
| 117 | − abi_entry(4) | |
| 118 | − | |
| 119 | − s32i a0, a1, 0 | |
| 120 | − movi a0, .Lsave_cp_regs_jump_table | |
| 121 | − addx8 a3, a3, a0 | |
| 122 | − l32i a4, a3, 4 | |
| 123 | − l32i a3, a3, 0 | |
| 124 | − add a2, a2, a4 | |
| 125 | − beqz a3, 1f | |
| 126 | − callx0 a3 | |
| 127 | −1: l32i a0, a1, 0 | |
| 128 | − | |
| 129 | − abi_ret(4) | |
| 130 | − | |
| 131 | −ENDPROC(coprocessor_flush) | |
| 132 | − | |
| 133 | 102 | /* |
| 134 | 103 | * Entry condition: |
| 135 | 104 | * |
| @@ -245,6 +214,39 @@ ENTRY(fast_coprocessor) · 109 unmodified lines | ||
| 245 | 214 | |
| 246 | 215 | ENDPROC(fast_coprocessor) |
| 247 | 216 | |
| 217 | + .text | |
| 218 | + | |
| 219 | +/* | |
| 220 | + * coprocessor_flush(struct thread_info*, index) | |
| 221 | + * a2 a3 | |
| 222 | + * | |
| 223 | + * Save coprocessor registers for coprocessor 'index'. | |
| 224 | + * The register values are saved to or loaded from the coprocessor area | |
| 225 | + * inside the task_info structure. | |
| 226 | + * | |
| 227 | + * Note that this function doesn't update the coprocessor_owner information! | |
| 228 | + * | |
| 229 | + */ | |
| 230 | + | |
| 231 | +ENTRY(coprocessor_flush) | |
| 232 | + | |
| 233 | + /* reserve 4 bytes on stack to save a0 */ | |
| 234 | + abi_entry(4) | |
| 235 | + | |
| 236 | + s32i a0, a1, 0 | |
| 237 | + movi a0, .Lsave_cp_regs_jump_table | |
| 238 | + addx8 a3, a3, a0 | |
| 239 | + l32i a4, a3, 4 | |
| 240 | + l32i a3, a3, 0 | |
| 241 | + add a2, a2, a4 | |
| 242 | + beqz a3, 1f | |
| 243 | + callx0 a3 | |
| 244 | +1: l32i a0, a1, 0 | |
| 245 | + | |
| 246 | + abi_ret(4) | |
| 247 | + | |
| 248 | +ENDPROC(coprocessor_flush) | |
| 249 | + | |
| 248 | 250 | .data |
| 249 | 251 | |
| 250 | 252 | ENTRY(coprocessor_owner) |
| @@ -112,8 +112,11 @@ good_area: · 111 unmodified lines | ||
| 112 | 112 | */ |
| 113 | 113 | fault = handle_mm_fault(vma, address, flags, regs); |
| 114 | 114 | |
| 115 | − if (fault_signal_pending(fault, regs)) | |
| 115 | + if (fault_signal_pending(fault, regs)) { | |
| 116 | + if (!user_mode(regs)) | |
| 117 | + goto bad_page_fault; | |
| 116 | 118 | return; |
| 119 | + } | |
| 117 | 120 | |
| 118 | 121 | if (unlikely(fault & VM_FAULT_ERROR)) { |
| 119 | 122 | if (fault & VM_FAULT_OOM) |
| @@ -33,7 +33,7 @@ static struct biovec_slab { · 32 unmodified lines | ||
| 33 | 33 | { .nr_vecs = 16, .name = "biovec-16" }, |
| 34 | 34 | { .nr_vecs = 64, .name = "biovec-64" }, |
| 35 | 35 | { .nr_vecs = 128, .name = "biovec-128" }, |
| 36 | − { .nr_vecs = BIO_MAX_PAGES, .name = "biovec-max" }, | |
| 36 | + { .nr_vecs = BIO_MAX_VECS, .name = "biovec-max" }, | |
| 37 | 37 | }; |
| 38 | 38 | |
| 39 | 39 | static struct biovec_slab *biovec_slab(unsigned short nr_vecs) |
| @@ -46,7 +46,7 @@ static struct biovec_slab *biovec_slab(unsigned short nr_vecs) · 6 unmodified lines | ||
| 46 | 46 | return &bvec_slabs[1]; |
| 47 | 47 | case 65 ... 128: |
| 48 | 48 | return &bvec_slabs[2]; |
| 49 | − case 129 ... BIO_MAX_PAGES: | |
| 49 | + case 129 ... BIO_MAX_VECS: | |
| 50 | 50 | return &bvec_slabs[3]; |
| 51 | 51 | default: |
| 52 | 52 | BUG(); |
| @@ -151,9 +151,9 @@ out: · 98 unmodified lines | ||
| 151 | 151 | |
| 152 | 152 | void bvec_free(mempool_t *pool, struct bio_vec *bv, unsigned short nr_vecs) |
| 153 | 153 | { |
| 154 | − BIO_BUG_ON(nr_vecs > BIO_MAX_PAGES); | |
| 154 | + BIO_BUG_ON(nr_vecs > BIO_MAX_VECS); | |
| 155 | 155 | |
| 156 | − if (nr_vecs == BIO_MAX_PAGES) | |
| 156 | + if (nr_vecs == BIO_MAX_VECS) | |
| 157 | 157 | mempool_free(bv, pool); |
| 158 | 158 | else if (nr_vecs > BIO_INLINE_VECS) |
| 159 | 159 | kmem_cache_free(biovec_slab(nr_vecs)->slab, bv); |
| @@ -186,15 +186,15 @@ struct bio_vec *bvec_alloc(mempool_t *pool, unsigned short *nr_vecs, · 26 unmodified lines | ||
| 186 | 186 | /* |
| 187 | 187 | * Try a slab allocation first for all smaller allocations. If that |
| 188 | 188 | * fails and __GFP_DIRECT_RECLAIM is set retry with the mempool. |
| 189 | − * The mempool is sized to handle up to BIO_MAX_PAGES entries. | |
| 189 | + * The mempool is sized to handle up to BIO_MAX_VECS entries. | |
| 190 | 190 | */ |
| 191 | − if (*nr_vecs < BIO_MAX_PAGES) { | |
| 191 | + if (*nr_vecs < BIO_MAX_VECS) { | |
| 192 | 192 | struct bio_vec *bvl; |
| 193 | 193 | |
| 194 | 194 | bvl = kmem_cache_alloc(bvs->slab, bvec_alloc_gfp(gfp_mask)); |
| 195 | 195 | if (likely(bvl) || !(gfp_mask & __GFP_DIRECT_RECLAIM)) |
| 196 | 196 | return bvl; |
| 197 | − *nr_vecs = BIO_MAX_PAGES; | |
| 197 | + *nr_vecs = BIO_MAX_VECS; | |
| 198 | 198 | } |
| 199 | 199 | |
| 200 | 200 | return mempool_alloc(pool, gfp_mask); |
| @@ -277,7 +277,7 @@ static struct bio *__bio_chain_endio(struct bio *bio) · 76 unmodified lines | ||
| 277 | 277 | { |
| 278 | 278 | struct bio *parent = bio->bi_private; |
| 279 | 279 | |
| 280 | − if (!parent->bi_status) | |
| 280 | + if (bio->bi_status && !parent->bi_status) | |
| 281 | 281 | parent->bi_status = bio->bi_status; |
| 282 | 282 | bio_put(bio); |
| 283 | 283 | return parent; |
| @@ -949,7 +949,7 @@ void bio_release_pages(struct bio *bio, bool mark_dirty) · 665 unmodified lines | ||
| 949 | 949 | } |
| 950 | 950 | EXPORT_SYMBOL_GPL(bio_release_pages); |
| 951 | 951 | |
| 952 | −static int bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter) | |
| 952 | +static void __bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter) | |
| 953 | 953 | { |
| 954 | 954 | WARN_ON_ONCE(bio->bi_max_vecs); |
| 955 | 955 | |
| @@ -959,11 +959,26 @@ static int bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter) · 3 unmodified lines | ||
| 959 | 959 | bio->bi_iter.bi_size = iter->count; |
| 960 | 960 | bio_set_flag(bio, BIO_NO_PAGE_REF); |
| 961 | 961 | bio_set_flag(bio, BIO_CLONED); |
| 962 | +} | |
| 962 | 963 | |
| 964 | +static int bio_iov_bvec_set(struct bio *bio, struct iov_iter *iter) | |
| 965 | +{ | |
| 966 | + __bio_iov_bvec_set(bio, iter); | |
| 963 | 967 | iov_iter_advance(iter, iter->count); |
| 964 | 968 | return 0; |
| 965 | 969 | } |
| 966 | 970 | |
| 971 | +static int bio_iov_bvec_set_append(struct bio *bio, struct iov_iter *iter) | |
| 972 | +{ | |
| 973 | + struct request_queue *q = bio->bi_bdev->bd_disk->queue; | |
| 974 | + struct iov_iter i = *iter; | |
| 975 | + | |
| 976 | + iov_iter_truncate(&i, queue_max_zone_append_sectors(q) << 9); | |
| 977 | + __bio_iov_bvec_set(bio, &i); | |
| 978 | + iov_iter_advance(iter, i.count); | |
| 979 | + return 0; | |
| 980 | +} | |
| 981 | + | |
| 967 | 982 | #define PAGE_PTRS_PER_BVEC (sizeof(struct bio_vec) / sizeof(struct page *)) |
| 968 | 983 | |
| 969 | 984 | /** |
| @@ -1094,8 +1109,8 @@ int bio_iov_iter_get_pages(struct bio *bio, struct iov_iter *iter) · 124 unmodified lines | ||
| 1094 | 1109 | int ret = 0; |
| 1095 | 1110 | |
| 1096 | 1111 | if (iov_iter_is_bvec(iter)) { |
| 1097 | − if (WARN_ON_ONCE(bio_op(bio) == REQ_OP_ZONE_APPEND)) | |
| 1098 | − return -EINVAL; | |
| 1112 | + if (bio_op(bio) == REQ_OP_ZONE_APPEND) | |
| 1113 | + return bio_iov_bvec_set_append(bio, iter); | |
| 1099 | 1114 | return bio_iov_bvec_set(bio, iter); |
| 1100 | 1115 | } |
| 1101 | 1116 | |
| @@ -109,6 +109,7 @@ void blkg_rwstat_recursive_sum(struct blkcg_gq *blkg, struct blkcg_policy *pol, · 108 unmodified lines | ||
| 109 | 109 | |
| 110 | 110 | lockdep_assert_held(&blkg->q->queue_lock); |
| 111 | 111 | |
| 112 | + memset(sum, 0, sizeof(*sum)); | |
| 112 | 113 | rcu_read_lock(); |
| 113 | 114 | blkg_for_each_descendant_pre(pos_blkg, pos_css, blkg) { |
| 114 | 115 | struct blkg_rwstat *rwstat; |
| @@ -122,7 +123,7 @@ void blkg_rwstat_recursive_sum(struct blkcg_gq *blkg, struct blkcg_policy *pol, · 7 unmodified lines | ||
| 122 | 123 | rwstat = (void *)pos_blkg + off; |
| 123 | 124 | |
| 124 | 125 | for (i = 0; i < BLKG_RWSTAT_NR; i++) |
| 125 | − sum->cnt[i] = blkg_rwstat_read_counter(rwstat, i); | |
| 126 | + sum->cnt[i] += blkg_rwstat_read_counter(rwstat, i); | |
| 126 | 127 | } |
| 127 | 128 | rcu_read_unlock(); |
| 128 | 129 | } |
| @@ -219,7 +219,7 @@ static bool blk_crypto_split_bio_if_needed(struct bio **bio_ptr) · 218 unmodified lines | ||
| 219 | 219 | |
| 220 | 220 | bio_for_each_segment(bv, bio, iter) { |
| 221 | 221 | num_sectors += bv.bv_len >> SECTOR_SHIFT; |
| 222 | − if (++i == BIO_MAX_PAGES) | |
| 222 | + if (++i == BIO_MAX_VECS) | |
| 223 | 223 | break; |
| 224 | 224 | } |
| 225 | 225 | if (num_sectors < bio_sectors(bio)) { |
| @@ -296,7 +296,7 @@ static unsigned int __blkdev_sectors_to_bio_pages(sector_t nr_sects) · 295 unmodified lines | ||
| 296 | 296 | { |
| 297 | 297 | sector_t pages = DIV_ROUND_UP_SECTOR_T(nr_sects, PAGE_SIZE / 512); |
| 298 | 298 | |
| 299 | − return min(pages, (sector_t)BIO_MAX_PAGES); | |
| 299 | + return min(pages, (sector_t)BIO_MAX_VECS); | |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | static int __blkdev_issue_zero_pages(struct block_device *bdev, |
| @@ -249,7 +249,7 @@ static int bio_map_user_iov(struct request *rq, struct iov_iter *iter, · 248 unmodified lines | ||
| 249 | 249 | if (!iov_iter_count(iter)) |
| 250 | 250 | return -EINVAL; |
| 251 | 251 | |
| 252 | − bio = bio_kmalloc(gfp_mask, iov_iter_npages(iter, BIO_MAX_PAGES)); | |
| 252 | + bio = bio_kmalloc(gfp_mask, iov_iter_npages(iter, BIO_MAX_VECS)); | |
| 253 | 253 | if (!bio) |
| 254 | 254 | return -ENOMEM; |
| 255 | 255 | bio->bi_opf |= req_op(rq); |
| @@ -382,6 +382,14 @@ unsigned int blk_recalc_rq_segments(struct request *rq) · 381 unmodified lines | ||
| 382 | 382 | switch (bio_op(rq->bio)) { |
| 383 | 383 | case REQ_OP_DISCARD: |
| 384 | 384 | case REQ_OP_SECURE_ERASE: |
| 385 | + if (queue_max_discard_segments(rq->q) > 1) { | |
| 386 | + struct bio *bio = rq->bio; | |
| 387 | + | |
| 388 | + for_each_bio(bio) | |
| 389 | + nr_phys_segs++; | |
| 390 | + return nr_phys_segs; | |
| 391 | + } | |
| 392 | + return 1; | |
| 385 | 393 | case REQ_OP_WRITE_ZEROES: |
| 386 | 394 | return 0; |
| 387 | 395 | case REQ_OP_WRITE_SAME: |
| @@ -302,7 +302,6 @@ static const char *const rqf_name[] = { · 301 unmodified lines | ||
| 302 | 302 | RQF_NAME(QUIET), |
| 303 | 303 | RQF_NAME(ELVPRIV), |
| 304 | 304 | RQF_NAME(IO_STAT), |
| 305 | − RQF_NAME(ALLOCED), | |
| 306 | 305 | RQF_NAME(PM), |
| 307 | 306 | RQF_NAME(HASHED), |
| 308 | 307 | RQF_NAME(STATS), |
| @@ -240,7 +240,7 @@ int blkdev_zone_mgmt(struct block_device *bdev, enum req_opf op, · 239 unmodified lines | ||
| 240 | 240 | */ |
| 241 | 241 | if (op == REQ_OP_ZONE_RESET && |
| 242 | 242 | blkdev_allow_reset_all_zones(bdev, sector, nr_sectors)) { |
| 243 | − bio->bi_opf = REQ_OP_ZONE_RESET_ALL; | |
| 243 | + bio->bi_opf = REQ_OP_ZONE_RESET_ALL | REQ_SYNC; | |
| 244 | 244 | break; |
| 245 | 245 | } |
| 246 | 246 | |
| @@ -318,6 +318,22 @@ int blkdev_report_zones_ioctl(struct block_device *bdev, fmode_t mode, · 71 unmodified lines | ||
| 318 | 318 | return 0; |
| 319 | 319 | } |
| 320 | 320 | |
| 321 | +static int blkdev_truncate_zone_range(struct block_device *bdev, fmode_t mode, | |
| 322 | + const struct blk_zone_range *zrange) | |
| 323 | +{ | |
| 324 | + loff_t start, end; | |
| 325 | + | |
| 326 | + if (zrange->sector + zrange->nr_sectors <= zrange->sector || | |
| 327 | + zrange->sector + zrange->nr_sectors > get_capacity(bdev->bd_disk)) | |
| 328 | + /* Out of range */ | |
| 329 | + return -EINVAL; | |
| 330 | + | |
| 331 | + start = zrange->sector << SECTOR_SHIFT; | |
| 332 | + end = ((zrange->sector + zrange->nr_sectors) << SECTOR_SHIFT) - 1; | |
| 333 | + | |
| 334 | + return truncate_bdev_range(bdev, mode, start, end); | |
| 335 | +} | |
| 336 | + | |
| 321 | 337 | /* |
| 322 | 338 | * BLKRESETZONE, BLKOPENZONE, BLKCLOSEZONE and BLKFINISHZONE ioctl processing. |
| 323 | 339 | * Called from blkdev_ioctl. |
| @@ -329,6 +345,7 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode, · 5 unmodified lines | ||
| 329 | 345 | struct request_queue *q; |
| 330 | 346 | struct blk_zone_range zrange; |
| 331 | 347 | enum req_opf op; |
| 348 | + int ret; | |
| 332 | 349 | |
| 333 | 350 | if (!argp) |
| 334 | 351 | return -EINVAL; |
| @@ -352,6 +369,11 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode, · 17 unmodified lines | ||
| 352 | 369 | switch (cmd) { |
| 353 | 370 | case BLKRESETZONE: |
| 354 | 371 | op = REQ_OP_ZONE_RESET; |
| 372 | + | |
| 373 | + /* Invalidate the page cache, including dirty pages. */ | |
| 374 | + ret = blkdev_truncate_zone_range(bdev, mode, &zrange); | |
| 375 | + if (ret) | |
| 376 | + return ret; | |
| 355 | 377 | break; |
| 356 | 378 | case BLKOPENZONE: |
| 357 | 379 | op = REQ_OP_ZONE_OPEN; |
| @@ -366,8 +388,20 @@ int blkdev_zone_mgmt_ioctl(struct block_device *bdev, fmode_t mode, · 8 unmodified lines | ||
| 366 | 388 | return -ENOTTY; |
| 367 | 389 | } |
| 368 | 390 | |
| 369 | − return blkdev_zone_mgmt(bdev, op, zrange.sector, zrange.nr_sectors, | |
| 370 | − GFP_KERNEL); | |
| 391 | + ret = blkdev_zone_mgmt(bdev, op, zrange.sector, zrange.nr_sectors, | |
| 392 | + GFP_KERNEL); | |
| 393 | + | |
| 394 | + /* | |
| 395 | + * Invalidate the page cache again for zone reset: writes can only be | |
| 396 | + * direct for zoned devices so concurrent writes would not add any page | |
| 397 | + * to the page cache after/during reset. The page cache may be filled | |
| 398 | + * again due to concurrent reads though and dropping the pages for | |
| 399 | + * these is fine. | |
| 400 | + */ | |
| 401 | + if (!ret && cmd == BLKRESETZONE) | |
| 402 | + ret = blkdev_truncate_zone_range(bdev, mode, &zrange); | |
| 403 | + | |
| 404 | + return ret; | |
| 371 | 405 | } |
| 372 | 406 | |
| 373 | 407 | static inline unsigned long *blk_alloc_zone_bitmap(int node, |
| @@ -229,10 +229,10 @@ static struct bio *bounce_clone_bio(struct bio *bio_src) · 228 unmodified lines | ||
| 229 | 229 | * - The point of cloning the biovec is to produce a bio with a biovec |
| 230 | 230 | * the caller can modify: bi_idx and bi_bvec_done should be 0. |
| 231 | 231 | * |
| 232 | − * - The original bio could've had more than BIO_MAX_PAGES biovecs; if | |
| 232 | + * - The original bio could've had more than BIO_MAX_VECS biovecs; if | |
| 233 | 233 | * we tried to clone the whole thing bio_alloc_bioset() would fail. |
| 234 | 234 | * But the clone should succeed as long as the number of biovecs we |
| 235 | − * actually need to allocate is fewer than BIO_MAX_PAGES. | |
| 235 | + * actually need to allocate is fewer than BIO_MAX_VECS. | |
| 236 | 236 | * |
| 237 | 237 | * - Lastly, bi_vcnt should not be looked at or relied upon by code |
| 238 | 238 | * that does not own the bio - reason being drivers don't use it for |
| @@ -299,7 +299,7 @@ static void __blk_queue_bounce(struct request_queue *q, struct bio **bio_orig, · 60 unmodified lines | ||
| 299 | 299 | int sectors = 0; |
| 300 | 300 | |
| 301 | 301 | bio_for_each_segment(from, *bio_orig, iter) { |
| 302 | − if (i++ < BIO_MAX_PAGES) | |
| 302 | + if (i++ < BIO_MAX_VECS) | |
| 303 | 303 | sectors += from.bv_len >> 9; |
| 304 | 304 | if (page_to_pfn(from.bv_page) > q->limits.bounce_pfn) |
| 305 | 305 | bounce = true; |
| @@ -534,10 +534,8 @@ static void register_disk(struct device *parent, struct gendisk *disk, · 533 unmodified lines | ||
| 534 | 534 | kobject_create_and_add("holders", &ddev->kobj); |
| 535 | 535 | disk->slave_dir = kobject_create_and_add("slaves", &ddev->kobj); |
| 536 | 536 | |
| 537 | − if (disk->flags & GENHD_FL_HIDDEN) { | |
| 538 | − dev_set_uevent_suppress(ddev, 0); | |
| 537 | + if (disk->flags & GENHD_FL_HIDDEN) | |
| 539 | 538 | return; |
| 540 | − } | |
| 541 | 539 | |
| 542 | 540 | disk_scan_partitions(disk); |
| 543 | 541 | |
| @@ -322,6 +322,13 @@ static struct block_device *add_partition(struct gendisk *disk, int partno, · 321 unmodified lines | ||
| 322 | 322 | const char *dname; |
| 323 | 323 | int err; |
| 324 | 324 | |
| 325 | + /* | |
| 326 | + * disk_max_parts() won't be zero, either GENHD_FL_EXT_DEVT is set | |
| 327 | + * or 'minors' is passed to alloc_disk(). | |
| 328 | + */ | |
| 329 | + if (partno >= disk_max_parts(disk)) | |
| 330 | + return ERR_PTR(-EINVAL); | |
| 331 | + | |
| 325 | 332 | /* |
| 326 | 333 | * Partitions are not supported on zoned block devices that are used as |
| 327 | 334 | * such. |
| @@ -767,7 +767,7 @@ config CRYPTO_POLY1305_X86_64 · 766 unmodified lines | ||
| 767 | 767 | |
| 768 | 768 | config CRYPTO_POLY1305_MIPS |
| 769 | 769 | tristate "Poly1305 authenticator algorithm (MIPS optimized)" |
| 770 | − depends on CPU_MIPS32 || (CPU_MIPS64 && 64BIT) | |
| 770 | + depends on MIPS | |
| 771 | 771 | select CRYPTO_ARCH_HAVE_LIB_POLY1305 |
| 772 | 772 | |
| 773 | 773 | config CRYPTO_MD4 |
| @@ -99,13 +99,12 @@ acpi_status acpi_ns_root_initialize(void) · 98 unmodified lines | ||
| 99 | 99 | * just create and link the new node(s) here. |
| 100 | 100 | */ |
| 101 | 101 | new_node = |
| 102 | − ACPI_ALLOCATE_ZEROED(sizeof(struct acpi_namespace_node)); | |
| 102 | + acpi_ns_create_node(*ACPI_CAST_PTR(u32, init_val->name)); | |
| 103 | 103 | if (!new_node) { |
| 104 | 104 | status = AE_NO_MEMORY; |
| 105 | 105 | goto unlock_and_exit; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | − ACPI_COPY_NAMESEG(new_node->name.ascii, init_val->name); | |
| 109 | 108 | new_node->descriptor_type = ACPI_DESC_TYPE_NAMED; |
| 110 | 109 | new_node->type = init_val->type; |
| 111 | 110 | |
| @@ -9,6 +9,8 @@ · 8 unmodified lines | ||
| 9 | 9 | #ifndef _ACPI_INTERNAL_H_ |
| 10 | 10 | #define _ACPI_INTERNAL_H_ |
| 11 | 11 | |
| 12 | +#include <linux/idr.h> | |
| 13 | + | |
| 12 | 14 | #define PREFIX "ACPI: " |
| 13 | 15 | |
| 14 | 16 | int early_acpi_osi_init(void); |
| @@ -96,9 +98,11 @@ void acpi_scan_table_handler(u32 event, void *table, void *context); · 81 unmodified lines | ||
| 96 | 98 | |
| 97 | 99 | extern struct list_head acpi_bus_id_list; |
| 98 | 100 | |
| 101 | +#define ACPI_MAX_DEVICE_INSTANCES 4096 | |
| 102 | + | |
| 99 | 103 | struct acpi_device_bus_id { |
| 100 | 104 | const char *bus_id; |
| 101 | − unsigned int instance_no; | |
| 105 | + struct ida instance_ida; | |
| 102 | 106 | struct list_head node; |
| 103 | 107 | }; |
| 104 | 108 | |
| @@ -29,6 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | */ |
| 30 | 30 | #ifdef CONFIG_X86 |
| 31 | 31 | #include <asm/apic.h> |
| 32 | +#include <asm/cpu.h> | |
| 32 | 33 | #endif |
| 33 | 34 | |
| 34 | 35 | #define _COMPONENT ACPI_PROCESSOR_COMPONENT |
| @@ -541,6 +542,10 @@ static int acpi_idle_play_dead(struct cpuidle_device *dev, int index) · 506 unmodified lines | ||
| 541 | 542 | wait_for_freeze(); |
| 542 | 543 | } else |
| 543 | 544 | return -ENODEV; |
| 545 | + | |
| 546 | +#if defined(CONFIG_X86) && defined(CONFIG_HOTPLUG_CPU) | |
| 547 | + cond_wakeup_cpu0(); | |
| 548 | +#endif | |
| 544 | 549 | } |
| 545 | 550 | |
| 546 | 551 | /* Never reached */ |
| @@ -479,9 +479,8 @@ static void acpi_device_del(struct acpi_device *device) · 478 unmodified lines | ||
| 479 | 479 | list_for_each_entry(acpi_device_bus_id, &acpi_bus_id_list, node) |
| 480 | 480 | if (!strcmp(acpi_device_bus_id->bus_id, |
| 481 | 481 | acpi_device_hid(device))) { |
| 482 | − if (acpi_device_bus_id->instance_no > 0) | |
| 483 | − acpi_device_bus_id->instance_no--; | |
| 484 | − else { | |
| 482 | + ida_simple_remove(&acpi_device_bus_id->instance_ida, device->pnp.instance_no); | |
| 483 | + if (ida_is_empty(&acpi_device_bus_id->instance_ida)) { | |
| 485 | 484 | list_del(&acpi_device_bus_id->node); |
| 486 | 485 | kfree_const(acpi_device_bus_id->bus_id); |
| 487 | 486 | kfree(acpi_device_bus_id); |
| @@ -631,6 +630,21 @@ static struct acpi_device_bus_id *acpi_device_bus_id_match(const char *dev_id) · 143 unmodified lines | ||
| 631 | 630 | return NULL; |
| 632 | 631 | } |
| 633 | 632 | |
| 633 | +static int acpi_device_set_name(struct acpi_device *device, | |
| 634 | + struct acpi_device_bus_id *acpi_device_bus_id) | |
| 635 | +{ | |
| 636 | + struct ida *instance_ida = &acpi_device_bus_id->instance_ida; | |
| 637 | + int result; | |
| 638 | + | |
| 639 | + result = ida_simple_get(instance_ida, 0, ACPI_MAX_DEVICE_INSTANCES, GFP_KERNEL); | |
| 640 | + if (result < 0) | |
| 641 | + return result; | |
| 642 | + | |
| 643 | + device->pnp.instance_no = result; | |
| 644 | + dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, result); | |
| 645 | + return 0; | |
| 646 | +} | |
| 647 | + | |
| 634 | 648 | int acpi_device_add(struct acpi_device *device, |
| 635 | 649 | void (*release)(struct device *)) |
| 636 | 650 | { |
| @@ -665,7 +679,9 @@ int acpi_device_add(struct acpi_device *device, · 28 unmodified lines | ||
| 665 | 679 | |
| 666 | 680 | acpi_device_bus_id = acpi_device_bus_id_match(acpi_device_hid(device)); |
| 667 | 681 | if (acpi_device_bus_id) { |
| 668 | − acpi_device_bus_id->instance_no++; | |
| 682 | + result = acpi_device_set_name(device, acpi_device_bus_id); | |
| 683 | + if (result) | |
| 684 | + goto err_unlock; | |
| 669 | 685 | } else { |
| 670 | 686 | acpi_device_bus_id = kzalloc(sizeof(*acpi_device_bus_id), |
| 671 | 687 | GFP_KERNEL); |
| @@ -681,9 +697,16 @@ int acpi_device_add(struct acpi_device *device, · 9 unmodified lines | ||
| 681 | 697 | goto err_unlock; |
| 682 | 698 | } |
| 683 | 699 | |
| 700 | + ida_init(&acpi_device_bus_id->instance_ida); | |
| 701 | + | |
| 702 | + result = acpi_device_set_name(device, acpi_device_bus_id); | |
| 703 | + if (result) { | |
| 704 | + kfree(acpi_device_bus_id); | |
| 705 | + goto err_unlock; | |
| 706 | + } | |
| 707 | + | |
| 684 | 708 | list_add_tail(&acpi_device_bus_id->node, &acpi_bus_id_list); |
| 685 | 709 | } |
| 686 | − dev_set_name(&device->dev, "%s:%02x", acpi_device_bus_id->bus_id, acpi_device_bus_id->instance_no); | |
| 687 | 710 | |
| 688 | 711 | if (device->parent) |
| 689 | 712 | list_add_tail(&device->node, &device->parent->children); |
| @@ -1647,6 +1670,8 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, · 957 unmodified lines | ||
| 1647 | 1670 | device_initialize(&device->dev); |
| 1648 | 1671 | dev_set_uevent_suppress(&device->dev, true); |
| 1649 | 1672 | acpi_init_coherency(device); |
| 1673 | + /* Assume there are unmet deps to start with. */ | |
| 1674 | + device->dep_unmet = 1; | |
| 1650 | 1675 | } |
| 1651 | 1676 | |
| 1652 | 1677 | void acpi_device_add_finalize(struct acpi_device *device) |
| @@ -1910,6 +1935,8 @@ static void acpi_scan_dep_init(struct acpi_device *adev) · 257 unmodified lines | ||
| 1910 | 1935 | { |
| 1911 | 1936 | struct acpi_dep_data *dep; |
| 1912 | 1937 | |
| 1938 | + adev->dep_unmet = 0; | |
| 1939 | + | |
| 1913 | 1940 | mutex_lock(&acpi_dep_list_lock); |
| 1914 | 1941 | |
| 1915 | 1942 | list_for_each_entry(dep, &acpi_dep_list, node) { |
| @@ -1957,7 +1984,13 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, bool check_dep, · 41 unmodified lines | ||
| 1957 | 1984 | return AE_CTRL_DEPTH; |
| 1958 | 1985 | |
| 1959 | 1986 | acpi_scan_init_hotplug(device); |
| 1960 | − if (!check_dep) | |
| 1987 | + /* | |
| 1988 | + * If check_dep is true at this point, the device has no dependencies, | |
| 1989 | + * or the creation of the device object would have been postponed above. | |
| 1990 | + */ | |
| 1991 | + if (check_dep) | |
| 1992 | + device->dep_unmet = 0; | |
| 1993 | + else | |
| 1961 | 1994 | acpi_scan_dep_init(device); |
| 1962 | 1995 | |
| 1963 | 1996 | out: |
| @@ -780,7 +780,7 @@ acpi_status acpi_os_table_override(struct acpi_table_header *existing_table, · 779 unmodified lines | ||
| 780 | 780 | } |
| 781 | 781 | |
| 782 | 782 | /* |
| 783 | − * acpi_table_init() | |
| 783 | + * acpi_locate_initial_tables() | |
| 784 | 784 | * |
| 785 | 785 | * find RSDP, find and checksum SDT/XSDT. |
| 786 | 786 | * checksum all tables, print SDT/XSDT |
| @@ -788,7 +788,7 @@ acpi_status acpi_os_table_override(struct acpi_table_header *existing_table, · 1 unmodified line | ||
| 788 | 788 | * result: sdt_entry[] is initialized |
| 789 | 789 | */ |
| 790 | 790 | |
| 791 | −int __init acpi_table_init(void) | |
| 791 | +int __init acpi_locate_initial_tables(void) | |
| 792 | 792 | { |
| 793 | 793 | acpi_status status; |
| 794 | 794 | |
| @@ -803,9 +803,45 @@ int __init acpi_table_init(void) · 8 unmodified lines | ||
| 803 | 803 | status = acpi_initialize_tables(initial_tables, ACPI_MAX_TABLES, 0); |
| 804 | 804 | if (ACPI_FAILURE(status)) |
| 805 | 805 | return -EINVAL; |
| 806 | − acpi_table_initrd_scan(); | |
| 807 | 806 | |
| 807 | + return 0; | |
| 808 | +} | |
| 809 | + | |
| 810 | +void __init acpi_reserve_initial_tables(void) | |
| 811 | +{ | |
| 812 | + int i; | |
| 813 | + | |
| 814 | + for (i = 0; i < ACPI_MAX_TABLES; i++) { | |
| 815 | + struct acpi_table_desc *table_desc = &initial_tables[i]; | |
| 816 | + u64 start = table_desc->address; | |
| 817 | + u64 size = table_desc->length; | |
| 818 | + | |
| 819 | + if (!start || !size) | |
| 820 | + break; | |
| 821 | + | |
| 822 | + pr_info("Reserving %4s table memory at [mem 0x%llx-0x%llx]\n", | |
| 823 | + table_desc->signature.ascii, start, start + size - 1); | |
| 824 | + | |
| 825 | + memblock_reserve(start, size); | |
| 826 | + } | |
| 827 | +} | |
| 828 | + | |
| 829 | +void __init acpi_table_init_complete(void) | |
| 830 | +{ | |
| 831 | + acpi_table_initrd_scan(); | |
| 808 | 832 | check_multiple_madt(); |
| 833 | +} | |
| 834 | + | |
| 835 | +int __init acpi_table_init(void) | |
| 836 | +{ | |
| 837 | + int ret; | |
| 838 | + | |
| 839 | + ret = acpi_locate_initial_tables(); | |
| 840 | + if (ret) | |
| 841 | + return ret; | |
| 842 | + | |
| 843 | + acpi_table_init_complete(); | |
| 844 | + | |
| 809 | 845 | return 0; |
| 810 | 846 | } |
| 811 | 847 | |
| @@ -147,6 +147,7 @@ static const struct dmi_system_id video_detect_dmi_table[] = { · 146 unmodified lines | ||
| 147 | 147 | }, |
| 148 | 148 | }, |
| 149 | 149 | { |
| 150 | + .callback = video_detect_force_vendor, | |
| 150 | 151 | .ident = "Sony VPCEH3U1E", |
| 151 | 152 | .matches = { |
| 152 | 153 | DMI_MATCH(DMI_SYS_VENDOR, "Sony Corporation"), |
| @@ -2260,7 +2260,8 @@ out: · 2259 unmodified lines | ||
| 2260 | 2260 | return rc; |
| 2261 | 2261 | |
| 2262 | 2262 | err_eni_release: |
| 2263 | − eni_do_release(dev); | |
| 2263 | + dev->phy = NULL; | |
| 2264 | + iounmap(ENI_DEV(dev)->ioaddr); | |
| 2264 | 2265 | err_unregister: |
| 2265 | 2266 | atm_dev_deregister(dev); |
| 2266 | 2267 | err_free_consistent: |
| @@ -100,8 +100,6 @@ static LIST_HEAD(fore200e_boards); · 99 unmodified lines | ||
| 100 | 100 | |
| 101 | 101 | MODULE_AUTHOR("Christophe Lizzi - credits to Uwe Dannowski and Heikki Vatiainen"); |
| 102 | 102 | MODULE_DESCRIPTION("FORE Systems 200E-series ATM driver - version " FORE200E_VERSION); |
| 103 | −MODULE_SUPPORTED_DEVICE("PCA-200E, SBA-200E"); | |
| 104 | − | |
| 105 | 103 | |
| 106 | 104 | static const int fore200e_rx_buf_nbr[ BUFFER_SCHEME_NBR ][ BUFFER_MAGN_NBR ] = { |
| 107 | 105 | { BUFFER_S1_NBR, BUFFER_L1_NBR }, |
| @@ -262,7 +262,7 @@ static int idt77105_start(struct atm_dev *dev) · 261 unmodified lines | ||
| 262 | 262 | { |
| 263 | 263 | unsigned long flags; |
| 264 | 264 | |
| 265 | − if (!(dev->dev_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL))) | |
| 265 | + if (!(dev->phy_data = kmalloc(sizeof(struct idt77105_priv),GFP_KERNEL))) | |
| 266 | 266 | return -ENOMEM; |
| 267 | 267 | PRIV(dev)->dev = dev; |
| 268 | 268 | spin_lock_irqsave(&idt77105_priv_lock, flags); |
| @@ -337,7 +337,7 @@ static int idt77105_stop(struct atm_dev *dev) · 68 unmodified lines | ||
| 337 | 337 | else |
| 338 | 338 | idt77105_all = walk->next; |
| 339 | 339 | dev->phy = NULL; |
| 340 | − dev->dev_data = NULL; | |
| 340 | + dev->phy_data = NULL; | |
| 341 | 341 | kfree(walk); |
| 342 | 342 | break; |
| 343 | 343 | } |
| @@ -2233,6 +2233,7 @@ static int lanai_dev_open(struct atm_dev *atmdev) · 2232 unmodified lines | ||
| 2233 | 2233 | conf1_write(lanai); |
| 2234 | 2234 | #endif |
| 2235 | 2235 | iounmap(lanai->base); |
| 2236 | + lanai->base = NULL; | |
| 2236 | 2237 | error_pci: |
| 2237 | 2238 | pci_disable_device(lanai->pci); |
| 2238 | 2239 | error: |
| @@ -2245,6 +2246,8 @@ static int lanai_dev_open(struct atm_dev *atmdev) · 6 unmodified lines | ||
| 2245 | 2246 | static void lanai_dev_close(struct atm_dev *atmdev) |
| 2246 | 2247 | { |
| 2247 | 2248 | struct lanai_dev *lanai = (struct lanai_dev *) atmdev->dev_data; |
| 2249 | + if (lanai->base==NULL) | |
| 2250 | + return; | |
| 2248 | 2251 | printk(KERN_INFO DEV_LABEL "(itf %d): shutting down interface\n", |
| 2249 | 2252 | lanai->number); |
| 2250 | 2253 | lanai_timed_poll_stop(lanai); |
| @@ -2552,7 +2555,7 @@ static int lanai_init_one(struct pci_dev *pci, · 301 unmodified lines | ||
| 2552 | 2555 | struct atm_dev *atmdev; |
| 2553 | 2556 | int result; |
| 2554 | 2557 | |
| 2555 | − lanai = kmalloc(sizeof(*lanai), GFP_KERNEL); | |
| 2558 | + lanai = kzalloc(sizeof(*lanai), GFP_KERNEL); | |
| 2556 | 2559 | if (lanai == NULL) { |
| 2557 | 2560 | printk(KERN_ERR DEV_LABEL |
| 2558 | 2561 | ": couldn't allocate dev_data structure!\n"); |
| @@ -211,7 +211,7 @@ static void uPD98402_int(struct atm_dev *dev) · 210 unmodified lines | ||
| 211 | 211 | static int uPD98402_start(struct atm_dev *dev) |
| 212 | 212 | { |
| 213 | 213 | DPRINTK("phy_start\n"); |
| 214 | − if (!(dev->dev_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL))) | |
| 214 | + if (!(dev->phy_data = kmalloc(sizeof(struct uPD98402_priv),GFP_KERNEL))) | |
| 215 | 215 | return -ENOMEM; |
| 216 | 216 | spin_lock_init(&PRIV(dev)->lock); |
| 217 | 217 | memset(&PRIV(dev)->sonet_stats,0,sizeof(struct k_sonet_stats)); |
| @@ -470,12 +470,14 @@ static ssize_t charlcd_write(struct file *file, const char __user *buf, · 469 unmodified lines | ||
| 470 | 470 | char c; |
| 471 | 471 | |
| 472 | 472 | for (; count-- > 0; (*ppos)++, tmp++) { |
| 473 | − if (!in_interrupt() && (((count + 1) & 0x1f) == 0)) | |
| 473 | + if (((count + 1) & 0x1f) == 0) { | |
| 474 | 474 | /* |
| 475 | − * let's be a little nice with other processes | |
| 476 | − * that need some CPU | |
| 475 | + * charlcd_write() is invoked as a VFS->write() callback | |
| 476 | + * and as such it is always invoked from preemptible | |
| 477 | + * context and may sleep. | |
| 477 | 478 | */ |
| 478 | − schedule(); | |
| 479 | + cond_resched(); | |
| 480 | + } | |
| 479 | 481 | |
| 480 | 482 | if (get_user(c, tmp)) |
| 481 | 483 | return -EFAULT; |
| @@ -537,12 +539,8 @@ static void charlcd_puts(struct charlcd *lcd, const char *s) · 55 unmodified lines | ||
| 537 | 539 | int count = strlen(s); |
| 538 | 540 | |
| 539 | 541 | for (; count-- > 0; tmp++) { |
| 540 | − if (!in_interrupt() && (((count + 1) & 0x1f) == 0)) | |
| 541 | − /* | |
| 542 | − * let's be a little nice with other processes | |
| 543 | − * that need some CPU | |
| 544 | − */ | |
| 545 | − schedule(); | |
| 542 | + if (((count + 1) & 0x1f) == 0) | |
| 543 | + cond_resched(); | |
| 546 | 544 | |
| 547 | 545 | charlcd_write_char(lcd, *tmp); |
| 548 | 546 | } |
| @@ -97,6 +97,9 @@ static void deferred_probe_work_func(struct work_struct *work) · 96 unmodified lines | ||
| 97 | 97 | |
| 98 | 98 | get_device(dev); |
| 99 | 99 | |
| 100 | + kfree(dev->p->deferred_probe_reason); | |
| 101 | + dev->p->deferred_probe_reason = NULL; | |
| 102 | + | |
| 100 | 103 | /* |
| 101 | 104 | * Drop the mutex while probing each device; the probe path may |
| 102 | 105 | * manipulate the deferred list |
| @@ -289,14 +292,16 @@ int driver_deferred_probe_check_state(struct device *dev) · 186 unmodified lines | ||
| 289 | 292 | |
| 290 | 293 | static void deferred_probe_timeout_work_func(struct work_struct *work) |
| 291 | 294 | { |
| 292 | − struct device_private *private, *p; | |
| 295 | + struct device_private *p; | |
| 293 | 296 | |
| 294 | 297 | driver_deferred_probe_timeout = 0; |
| 295 | 298 | driver_deferred_probe_trigger(); |
| 296 | 299 | flush_work(&deferred_probe_work); |
| 297 | 300 | |
| 298 | − list_for_each_entry_safe(private, p, &deferred_probe_pending_list, deferred_probe) | |
| 299 | − dev_info(private->device, "deferred probe pending\n"); | |
| 301 | + mutex_lock(&deferred_probe_mutex); | |
| 302 | + list_for_each_entry(p, &deferred_probe_pending_list, deferred_probe) | |
| 303 | + dev_info(p->device, "deferred probe pending\n"); | |
| 304 | + mutex_unlock(&deferred_probe_mutex); | |
| 300 | 305 | wake_up_all(&probe_timeout_waitqueue); |
| 301 | 306 | } |
| 302 | 307 | static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_work_func); |
| @@ -305,7 +305,7 @@ static int rpm_get_suppliers(struct device *dev) · 304 unmodified lines | ||
| 305 | 305 | return 0; |
| 306 | 306 | } |
| 307 | 307 | |
| 308 | −static void rpm_put_suppliers(struct device *dev) | |
| 308 | +static void __rpm_put_suppliers(struct device *dev, bool try_to_suspend) | |
| 309 | 309 | { |
| 310 | 310 | struct device_link *link; |
| 311 | 311 | |
| @@ -313,10 +313,30 @@ static void rpm_put_suppliers(struct device *dev) · 1 unmodified line | ||
| 313 | 313 | device_links_read_lock_held()) { |
| 314 | 314 | |
| 315 | 315 | while (refcount_dec_not_one(&link->rpm_active)) |
| 316 | − pm_runtime_put(link->supplier); | |
| 316 | + pm_runtime_put_noidle(link->supplier); | |
| 317 | + | |
| 318 | + if (try_to_suspend) | |
| 319 | + pm_request_idle(link->supplier); | |
| 317 | 320 | } |
| 318 | 321 | } |
| 319 | 322 | |
| 323 | +static void rpm_put_suppliers(struct device *dev) | |
| 324 | +{ | |
| 325 | + __rpm_put_suppliers(dev, true); | |
| 326 | +} | |
| 327 | + | |
| 328 | +static void rpm_suspend_suppliers(struct device *dev) | |
| 329 | +{ | |
| 330 | + struct device_link *link; | |
| 331 | + int idx = device_links_read_lock(); | |
| 332 | + | |
| 333 | + list_for_each_entry_rcu(link, &dev->links.suppliers, c_node, | |
| 334 | + device_links_read_lock_held()) | |
| 335 | + pm_request_idle(link->supplier); | |
| 336 | + | |
| 337 | + device_links_read_unlock(idx); | |
| 338 | +} | |
| 339 | + | |
| 320 | 340 | /** |
| 321 | 341 | * __rpm_callback - Run a given runtime PM callback for a given device. |
| 322 | 342 | * @cb: Runtime PM callback to run. |
| @@ -325,27 +345,29 @@ static void rpm_put_suppliers(struct device *dev) · 2 unmodified lines | ||
| 325 | 345 | static int __rpm_callback(int (*cb)(struct device *), struct device *dev) |
| 326 | 346 | __releases(&dev->power.lock) __acquires(&dev->power.lock) |
| 327 | 347 | { |
| 328 | − bool use_links = dev->power.links_count > 0; | |
| 329 | − bool get = false; | |
| 330 | 348 | int retval, idx; |
| 331 | − bool put; | |
| 349 | + bool use_links = dev->power.links_count > 0; | |
| 332 | 350 | |
| 333 | 351 | if (dev->power.irq_safe) { |
| 334 | 352 | spin_unlock(&dev->power.lock); |
| 335 | − } else if (!use_links) { | |
| 336 | − spin_unlock_irq(&dev->power.lock); | |
| 337 | 353 | } else { |
| 338 | − get = dev->power.runtime_status == RPM_RESUMING; | |
| 339 | − | |
| 340 | 354 | spin_unlock_irq(&dev->power.lock); |
| 341 | 355 | |
| 342 | − /* Resume suppliers if necessary. */ | |
| 343 | − if (get) { | |
| 356 | + /* | |
| 357 | + * Resume suppliers if necessary. | |
| 358 | + * | |
| 359 | + * The device's runtime PM status cannot change until this | |
| 360 | + * routine returns, so it is safe to read the status outside of | |
| 361 | + * the lock. | |
| 362 | + */ | |
| 363 | + if (use_links && dev->power.runtime_status == RPM_RESUMING) { | |
| 344 | 364 | idx = device_links_read_lock(); |
| 345 | 365 | |
| 346 | 366 | retval = rpm_get_suppliers(dev); |
| 347 | − if (retval) | |
| 367 | + if (retval) { | |
| 368 | + rpm_put_suppliers(dev); | |
| 348 | 369 | goto fail; |
| 370 | + } | |
| 349 | 371 | |
| 350 | 372 | device_links_read_unlock(idx); |
| 351 | 373 | } |
| @@ -355,36 +377,24 @@ static int __rpm_callback(int (*cb)(struct device *), struct device *dev) · 3 unmodified lines | ||
| 355 | 377 | |
| 356 | 378 | if (dev->power.irq_safe) { |
| 357 | 379 | spin_lock(&dev->power.lock); |
| 358 | − return retval; | |
| 359 | − } | |
| 360 | − | |
| 361 | − spin_lock_irq(&dev->power.lock); | |
| 362 | − | |
| 363 | − if (!use_links) | |
| 364 | − return retval; | |
| 365 | − | |
| 366 | − /* | |
| 367 | − * If the device is suspending and the callback has returned success, | |
| 368 | − * drop the usage counters of the suppliers that have been reference | |
| 369 | − * counted on its resume. | |
| 370 | − * | |
| 371 | − * Do that if the resume fails too. | |
| 372 | − */ | |
| 373 | − put = dev->power.runtime_status == RPM_SUSPENDING && !retval; | |
| 374 | − if (put) | |
| 375 | − __update_runtime_status(dev, RPM_SUSPENDED); | |
| 376 | − else | |
| 377 | − put = get && retval; | |
| 378 | − | |
| 379 | − if (put) { | |
| 380 | − spin_unlock_irq(&dev->power.lock); | |
| 380 | + } else { | |
| 381 | + /* | |
| 382 | + * If the device is suspending and the callback has returned | |
| 383 | + * success, drop the usage counters of the suppliers that have | |
| 384 | + * been reference counted on its resume. | |
| 385 | + * | |
| 386 | + * Do that if resume fails too. | |
| 387 | + */ | |
| 388 | + if (use_links | |
| 389 | + && ((dev->power.runtime_status == RPM_SUSPENDING && !retval) | |
| 390 | + || (dev->power.runtime_status == RPM_RESUMING && retval))) { | |
| 391 | + idx = device_links_read_lock(); | |
| 381 | 392 | |
| 382 | − idx = device_links_read_lock(); | |
| 393 | + __rpm_put_suppliers(dev, false); | |
| 383 | 394 | |
| 384 | 395 | fail: |
| 385 | − rpm_put_suppliers(dev); | |
| 386 | − | |
| 387 | − device_links_read_unlock(idx); | |
| 396 | + device_links_read_unlock(idx); | |
| 397 | + } | |
| 388 | 398 | |
| 389 | 399 | spin_lock_irq(&dev->power.lock); |
| 390 | 400 | } |
| @@ -654,8 +664,11 @@ static int rpm_suspend(struct device *dev, int rpmflags) · 263 unmodified lines | ||
| 654 | 664 | goto out; |
| 655 | 665 | } |
| 656 | 666 | |
| 667 | + if (dev->power.irq_safe) | |
| 668 | + goto out; | |
| 669 | + | |
| 657 | 670 | /* Maybe the parent is now able to suspend. */ |
| 658 | − if (parent && !parent->power.ignore_children && !dev->power.irq_safe) { | |
| 671 | + if (parent && !parent->power.ignore_children) { | |
| 659 | 672 | spin_unlock(&dev->power.lock); |
| 660 | 673 | |
| 661 | 674 | spin_lock(&parent->power.lock); |
| @@ -664,6 +677,14 @@ static int rpm_suspend(struct device *dev, int rpmflags) · 2 unmodified lines | ||
| 664 | 677 | |
| 665 | 678 | spin_lock(&dev->power.lock); |
| 666 | 679 | } |
| 680 | + /* Maybe the suppliers are now able to suspend. */ | |
| 681 | + if (dev->power.links_count > 0) { | |
| 682 | + spin_unlock_irq(&dev->power.lock); | |
| 683 | + | |
| 684 | + rpm_suspend_suppliers(dev); | |
| 685 | + | |
| 686 | + spin_lock_irq(&dev->power.lock); | |
| 687 | + } | |
| 667 | 688 | |
| 668 | 689 | out: |
| 669 | 690 | trace_rpm_return_int_rcuidle(dev, _THIS_IP_, retval); |
| @@ -1669,8 +1690,8 @@ void pm_runtime_get_suppliers(struct device *dev) · 999 unmodified lines | ||
| 1669 | 1690 | device_links_read_lock_held()) |
| 1670 | 1691 | if (link->flags & DL_FLAG_PM_RUNTIME) { |
| 1671 | 1692 | link->supplier_preactivated = true; |
| 1672 | − refcount_inc(&link->rpm_active); | |
| 1673 | 1693 | pm_runtime_get_sync(link->supplier); |
| 1694 | + refcount_inc(&link->rpm_active); | |
| 1674 | 1695 | } |
| 1675 | 1696 | |
| 1676 | 1697 | device_links_read_unlock(idx); |
| @@ -1683,6 +1704,8 @@ void pm_runtime_get_suppliers(struct device *dev) · 6 unmodified lines | ||
| 1683 | 1704 | void pm_runtime_put_suppliers(struct device *dev) |
| 1684 | 1705 | { |
| 1685 | 1706 | struct device_link *link; |
| 1707 | + unsigned long flags; | |
| 1708 | + bool put; | |
| 1686 | 1709 | int idx; |
| 1687 | 1710 | |
| 1688 | 1711 | idx = device_links_read_lock(); |
| @@ -1691,7 +1714,11 @@ void pm_runtime_put_suppliers(struct device *dev) · 2 unmodified lines | ||
| 1691 | 1714 | device_links_read_lock_held()) |
| 1692 | 1715 | if (link->supplier_preactivated) { |
| 1693 | 1716 | link->supplier_preactivated = false; |
| 1694 | − if (refcount_dec_not_one(&link->rpm_active)) | |
| 1717 | + spin_lock_irqsave(&dev->power.lock, flags); | |
| 1718 | + put = pm_runtime_status_suspended(dev) && | |
| 1719 | + refcount_dec_not_one(&link->rpm_active); | |
| 1720 | + spin_unlock_irqrestore(&dev->power.lock, flags); | |
| 1721 | + if (put) | |
| 1695 | 1722 | pm_runtime_put(link->supplier); |
| 1696 | 1723 | } |
| 1697 | 1724 | |
| @@ -938,6 +938,9 @@ int software_node_register(const struct software_node *node) · 937 unmodified lines | ||
| 938 | 938 | if (software_node_to_swnode(node)) |
| 939 | 939 | return -EEXIST; |
| 940 | 940 | |
| 941 | + if (node->parent && !parent) | |
| 942 | + return -EINVAL; | |
| 943 | + | |
| 941 | 944 | return PTR_ERR_OR_ZERO(swnode_register(node, parent, 0)); |
| 942 | 945 | } |
| 943 | 946 | EXPORT_SYMBOL_GPL(software_node_register); |
| @@ -1002,25 +1005,33 @@ EXPORT_SYMBOL_GPL(fwnode_remove_software_node); · 58 unmodified lines | ||
| 1002 | 1005 | /** |
| 1003 | 1006 | * device_add_software_node - Assign software node to a device |
| 1004 | 1007 | * @dev: The device the software node is meant for. |
| 1005 | − * @swnode: The software node. | |
| 1008 | + * @node: The software node. | |
| 1006 | 1009 | * |
| 1007 | − * This function will register @swnode and make it the secondary firmware node | |
| 1008 | − * pointer of @dev. If @dev has no primary node, then @swnode will become the primary | |
| 1009 | − * node. | |
| 1010 | + * This function will make @node the secondary firmware node pointer of @dev. If | |
| 1011 | + * @dev has no primary node, then @node will become the primary node. The | |
| 1012 | + * function will register @node automatically if it wasn't already registered. | |
| 1010 | 1013 | */ |
| 1011 | −int device_add_software_node(struct device *dev, const struct software_node *swnode) | |
| 1014 | +int device_add_software_node(struct device *dev, const struct software_node *node) | |
| 1012 | 1015 | { |
| 1016 | + struct swnode *swnode; | |
| 1013 | 1017 | int ret; |
| 1014 | 1018 | |
| 1015 | 1019 | /* Only one software node per device. */ |
| 1016 | 1020 | if (dev_to_swnode(dev)) |
| 1017 | 1021 | return -EBUSY; |
| 1018 | 1022 | |
| 1019 | − ret = software_node_register(swnode); | |
| 1020 | − if (ret) | |
| 1021 | − return ret; | |
| 1023 | + swnode = software_node_to_swnode(node); | |
| 1024 | + if (swnode) { | |
| 1025 | + kobject_get(&swnode->kobj); | |
| 1026 | + } else { | |
| 1027 | + ret = software_node_register(node); | |
| 1028 | + if (ret) | |
| 1029 | + return ret; | |
| 1030 | + | |
| 1031 | + swnode = software_node_to_swnode(node); | |
| 1032 | + } | |
| 1022 | 1033 | |
| 1023 | − set_secondary_fwnode(dev, software_node_fwnode(swnode)); | |
| 1034 | + set_secondary_fwnode(dev, &swnode->fwnode); | |
| 1024 | 1035 | |
| 1025 | 1036 | return 0; |
| 1026 | 1037 | } |
| @@ -1324,7 +1324,7 @@ struct bm_extent { · 1323 unmodified lines | ||
| 1324 | 1324 | * A followup commit may allow even bigger BIO sizes, |
| 1325 | 1325 | * once we thought that through. */ |
| 1326 | 1326 | #define DRBD_MAX_BIO_SIZE (1U << 20) |
| 1327 | −#if DRBD_MAX_BIO_SIZE > (BIO_MAX_PAGES << PAGE_SHIFT) | |
| 1327 | +#if DRBD_MAX_BIO_SIZE > (BIO_MAX_VECS << PAGE_SHIFT) | |
| 1328 | 1328 | #error Architecture not supported: DRBD_MAX_BIO_SIZE > BIO_MAX_SIZE |
| 1329 | 1329 | #endif |
| 1330 | 1330 | #define DRBD_MAX_BIO_SIZE_SAFE (1U << 12) /* Works always = 4k */ |
| @@ -5091,7 +5091,6 @@ module_param(floppy, charp, 0); · 5090 unmodified lines | ||
| 5091 | 5091 | module_param(FLOPPY_IRQ, int, 0); |
| 5092 | 5092 | module_param(FLOPPY_DMA, int, 0); |
| 5093 | 5093 | MODULE_AUTHOR("Alain L. Knaff"); |
| 5094 | −MODULE_SUPPORTED_DEVICE("fd"); | |
| 5095 | 5094 | MODULE_LICENSE("GPL"); |
| 5096 | 5095 | |
| 5097 | 5096 | /* This doesn't actually get used other than for module information */ |
| @@ -1369,10 +1369,13 @@ static blk_status_t null_handle_cmd(struct nullb_cmd *cmd, sector_t sector, · 1368 unmodified lines | ||
| 1369 | 1369 | } |
| 1370 | 1370 | |
| 1371 | 1371 | if (dev->zoned) |
| 1372 | − cmd->error = null_process_zoned_cmd(cmd, op, | |
| 1373 | − sector, nr_sectors); | |
| 1372 | + sts = null_process_zoned_cmd(cmd, op, sector, nr_sectors); | |
| 1374 | 1373 | else |
| 1375 | − cmd->error = null_process_cmd(cmd, op, sector, nr_sectors); | |
| 1374 | + sts = null_process_cmd(cmd, op, sector, nr_sectors); | |
| 1375 | + | |
| 1376 | + /* Do not overwrite errors (e.g. timeout errors) */ | |
| 1377 | + if (cmd->error == BLK_STS_OK) | |
| 1378 | + cmd->error = sts; | |
| 1376 | 1379 | |
| 1377 | 1380 | out: |
| 1378 | 1381 | nullb_complete_cmd(cmd); |
| @@ -1451,8 +1454,20 @@ static bool should_requeue_request(struct request *rq) · 72 unmodified lines | ||
| 1451 | 1454 | |
| 1452 | 1455 | static enum blk_eh_timer_return null_timeout_rq(struct request *rq, bool res) |
| 1453 | 1456 | { |
| 1457 | + struct nullb_cmd *cmd = blk_mq_rq_to_pdu(rq); | |
| 1458 | + | |
| 1454 | 1459 | pr_info("rq %p timed out\n", rq); |
| 1455 | − blk_mq_complete_request(rq); | |
| 1460 | + | |
| 1461 | + /* | |
| 1462 | + * If the device is marked as blocking (i.e. memory backed or zoned | |
| 1463 | + * device), the submission path may be blocked waiting for resources | |
| 1464 | + * and cause real timeouts. For these real timeouts, the submission | |
| 1465 | + * path will complete the request using blk_mq_complete_request(). | |
| 1466 | + * Only fake timeouts need to execute blk_mq_complete_request() here. | |
| 1467 | + */ | |
| 1468 | + cmd->error = BLK_STS_TIMEOUT; | |
| 1469 | + if (cmd->fake_timeout) | |
| 1470 | + blk_mq_complete_request(rq); | |
| 1456 | 1471 | return BLK_EH_DONE; |
| 1457 | 1472 | } |
| 1458 | 1473 | |
| @@ -1473,6 +1488,7 @@ static blk_status_t null_queue_rq(struct blk_mq_hw_ctx *hctx, · 14 unmodified lines | ||
| 1473 | 1488 | cmd->rq = bd->rq; |
| 1474 | 1489 | cmd->error = BLK_STS_OK; |
| 1475 | 1490 | cmd->nq = nq; |
| 1491 | + cmd->fake_timeout = should_timeout_request(bd->rq); | |
| 1476 | 1492 | |
| 1477 | 1493 | blk_mq_start_request(bd->rq); |
| 1478 | 1494 | |
| @@ -1489,7 +1505,7 @@ static blk_status_t null_queue_rq(struct blk_mq_hw_ctx *hctx, · 10 unmodified lines | ||
| 1489 | 1505 | return BLK_STS_OK; |
| 1490 | 1506 | } |
| 1491 | 1507 | } |
| 1492 | − if (should_timeout_request(bd->rq)) | |
| 1508 | + if (cmd->fake_timeout) | |
| 1493 | 1509 | return BLK_STS_OK; |
| 1494 | 1510 | |
| 1495 | 1511 | return null_handle_cmd(cmd, sector, nr_sectors, req_op(bd->rq)); |
| @@ -22,6 +22,7 @@ struct nullb_cmd { · 21 unmodified lines | ||
| 22 | 22 | blk_status_t error; |
| 23 | 23 | struct nullb_queue *nq; |
| 24 | 24 | struct hrtimer timer; |
| 25 | + bool fake_timeout; | |
| 25 | 26 | }; |
| 26 | 27 | |
| 27 | 28 | struct nullb_queue { |
| @@ -871,6 +871,7 @@ static int rsxx_pci_probe(struct pci_dev *dev, · 870 unmodified lines | ||
| 871 | 871 | card->event_wq = create_singlethread_workqueue(DRIVER_NAME"_event"); |
| 872 | 872 | if (!card->event_wq) { |
| 873 | 873 | dev_err(CARD_TO_DEV(card), "Failed card event setup.\n"); |
| 874 | + st = -ENOMEM; | |
| 874 | 875 | goto failed_event_handler; |
| 875 | 876 | } |
| 876 | 877 | |
| @@ -877,6 +877,7 @@ static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) · 876 unmodified lines | ||
| 877 | 877 | if (card->mm_pages[0].desc == NULL || |
| 878 | 878 | card->mm_pages[1].desc == NULL) { |
| 879 | 879 | dev_printk(KERN_ERR, &card->dev->dev, "alloc failed\n"); |
| 880 | + ret = -ENOMEM; | |
| 880 | 881 | goto failed_alloc; |
| 881 | 882 | } |
| 882 | 883 | reset_page(&card->mm_pages[0]); |
| @@ -888,8 +889,10 @@ static int mm_pci_probe(struct pci_dev *dev, const struct pci_device_id *id) · 5 unmodified lines | ||
| 888 | 889 | spin_lock_init(&card->lock); |
| 889 | 890 | |
| 890 | 891 | card->queue = blk_alloc_queue(NUMA_NO_NODE); |
| 891 | − if (!card->queue) | |
| 892 | + if (!card->queue) { | |
| 893 | + ret = -ENOMEM; | |
| 892 | 894 | goto failed_alloc; |
| 895 | + } | |
| 893 | 896 | |
| 894 | 897 | tasklet_init(&card->tasklet, process_page, (unsigned long)card); |
| 895 | 898 | |
| @@ -891,7 +891,7 @@ next: · 890 unmodified lines | ||
| 891 | 891 | out: |
| 892 | 892 | for (i = last_map; i < num; i++) { |
| 893 | 893 | /* Don't zap current batch's valid persistent grants. */ |
| 894 | − if(i >= last_map + segs_to_map) | |
| 894 | + if(i >= map_until) | |
| 895 | 895 | pages[i]->persistent_gnt = NULL; |
| 896 | 896 | pages[i]->handle = BLKBACK_INVALID_HANDLE; |
| 897 | 897 | } |
| @@ -627,7 +627,7 @@ static ssize_t writeback_store(struct device *dev, · 626 unmodified lines | ||
| 627 | 627 | struct bio_vec bio_vec; |
| 628 | 628 | struct page *page; |
| 629 | 629 | ssize_t ret = len; |
| 630 | − int mode; | |
| 630 | + int mode, err; | |
| 631 | 631 | unsigned long blk_idx = 0; |
| 632 | 632 | |
| 633 | 633 | if (sysfs_streq(buf, "idle")) |
| @@ -638,8 +638,8 @@ static ssize_t writeback_store(struct device *dev, · 4 unmodified lines | ||
| 638 | 638 | if (strncmp(buf, PAGE_WB_SIG, sizeof(PAGE_WB_SIG) - 1)) |
| 639 | 639 | return -EINVAL; |
| 640 | 640 | |
| 641 | − ret = kstrtol(buf + sizeof(PAGE_WB_SIG) - 1, 10, &index); | |
| 642 | − if (ret || index >= nr_pages) | |
| 641 | + if (kstrtol(buf + sizeof(PAGE_WB_SIG) - 1, 10, &index) || | |
| 642 | + index >= nr_pages) | |
| 643 | 643 | return -EINVAL; |
| 644 | 644 | |
| 645 | 645 | nr_pages = 1; |
| @@ -663,7 +663,7 @@ static ssize_t writeback_store(struct device *dev, · 17 unmodified lines | ||
| 663 | 663 | goto release_init_lock; |
| 664 | 664 | } |
| 665 | 665 | |
| 666 | − while (nr_pages--) { | |
| 666 | + for (; nr_pages != 0; index++, nr_pages--) { | |
| 667 | 667 | struct bio_vec bvec; |
| 668 | 668 | |
| 669 | 669 | bvec.bv_page = page; |
| @@ -728,12 +728,17 @@ static ssize_t writeback_store(struct device *dev, · 58 unmodified lines | ||
| 728 | 728 | * XXX: A single page IO would be inefficient for write |
| 729 | 729 | * but it would be not bad as starter. |
| 730 | 730 | */ |
| 731 | − ret = submit_bio_wait(&bio); | |
| 732 | − if (ret) { | |
| 731 | + err = submit_bio_wait(&bio); | |
| 732 | + if (err) { | |
| 733 | 733 | zram_slot_lock(zram, index); |
| 734 | 734 | zram_clear_flag(zram, index, ZRAM_UNDER_WB); |
| 735 | 735 | zram_clear_flag(zram, index, ZRAM_IDLE); |
| 736 | 736 | zram_slot_unlock(zram, index); |
| 737 | + /* | |
| 738 | + * Return last IO error unless every IO were | |
| 739 | + * not suceeded. | |
| 740 | + */ | |
| 741 | + ret = err; | |
| 737 | 742 | continue; |
| 738 | 743 | } |
| 739 | 744 | |
| @@ -194,5 +194,4 @@ module_init(rsi_91x_bt_module_init); · 193 unmodified lines | ||
| 194 | 194 | module_exit(rsi_91x_bt_module_exit); |
| 195 | 195 | MODULE_AUTHOR("Redpine Signals Inc"); |
| 196 | 196 | MODULE_DESCRIPTION("RSI BT driver"); |
| 197 | −MODULE_SUPPORTED_DEVICE("RSI-BT"); | |
| 198 | 197 | MODULE_LICENSE("Dual BSD/GPL"); |
| @@ -4849,8 +4849,8 @@ static int btusb_probe(struct usb_interface *intf, · 4848 unmodified lines | ||
| 4849 | 4849 | data->diag = NULL; |
| 4850 | 4850 | } |
| 4851 | 4851 | |
| 4852 | − if (!enable_autosuspend) | |
| 4853 | − usb_disable_autosuspend(data->udev); | |
| 4852 | + if (enable_autosuspend) | |
| 4853 | + usb_enable_autosuspend(data->udev); | |
| 4854 | 4854 | |
| 4855 | 4855 | err = hci_register_dev(hdev); |
| 4856 | 4856 | if (err < 0) |
| @@ -4910,9 +4910,6 @@ static void btusb_disconnect(struct usb_interface *intf) · 53 unmodified lines | ||
| 4910 | 4910 | gpiod_put(data->reset_gpio); |
| 4911 | 4911 | |
| 4912 | 4912 | hci_free_dev(hdev); |
| 4913 | − | |
| 4914 | − if (!enable_autosuspend) | |
| 4915 | − usb_enable_autosuspend(data->udev); | |
| 4916 | 4913 | } |
| 4917 | 4914 | |
| 4918 | 4915 | #ifdef CONFIG_PM |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | /* |
| 3 | 3 | * Turris Mox module configuration bus driver |
| 4 | 4 | * |
| 5 | − * Copyright (C) 2019 Marek Behun <marek.behun@nic.cz> | |
| 5 | + * Copyright (C) 2019 Marek Behún <kabel@kernel.org> | |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | #include <dt-bindings/bus/moxtet.h> |
| @@ -879,6 +879,6 @@ static void __exit moxtet_exit(void) · 870 unmodified lines | ||
| 879 | 879 | } |
| 880 | 880 | module_exit(moxtet_exit); |
| 881 | 881 | |
| 882 | −MODULE_AUTHOR("Marek Behun <marek.behun@nic.cz>"); | |
| 882 | +MODULE_AUTHOR("Marek Behun <kabel@kernel.org>"); | |
| 883 | 883 | MODULE_DESCRIPTION("CZ.NIC's Turris Mox module configuration bus"); |
| 884 | 884 | MODULE_LICENSE("GPL v2"); |
| @@ -618,7 +618,7 @@ mvebu_mbus_find_bridge_hole(uint64_t *start, uint64_t *end) · 617 unmodified lines | ||
| 618 | 618 | * This part of the memory is above 4 GB, so we don't |
| 619 | 619 | * care for the MBus bridge hole. |
| 620 | 620 | */ |
| 621 | − if (reg_start >= 0x100000000ULL) | |
| 621 | + if ((u64)reg_start >= 0x100000000ULL) | |
| 622 | 622 | continue; |
| 623 | 623 | |
| 624 | 624 | /* |
| @@ -285,7 +285,7 @@ static int omap_l3_probe(struct platform_device *pdev) · 284 unmodified lines | ||
| 285 | 285 | */ |
| 286 | 286 | l3->debug_irq = platform_get_irq(pdev, 0); |
| 287 | 287 | ret = devm_request_irq(l3->dev, l3->debug_irq, l3_interrupt_handler, |
| 288 | − 0x0, "l3-dbg-irq", l3); | |
| 288 | + IRQF_NO_THREAD, "l3-dbg-irq", l3); | |
| 289 | 289 | if (ret) { |
| 290 | 290 | dev_err(l3->dev, "request_irq failed for %d\n", |
| 291 | 291 | l3->debug_irq); |
| @@ -294,7 +294,7 @@ static int omap_l3_probe(struct platform_device *pdev) · 2 unmodified lines | ||
| 294 | 294 | |
| 295 | 295 | l3->app_irq = platform_get_irq(pdev, 1); |
| 296 | 296 | ret = devm_request_irq(l3->dev, l3->app_irq, l3_interrupt_handler, |
| 297 | − 0x0, "l3-app-irq", l3); | |
| 297 | + IRQF_NO_THREAD, "l3-app-irq", l3); | |
| 298 | 298 | if (ret) |
| 299 | 299 | dev_err(l3->dev, "request_irq failed for %d\n", l3->app_irq); |
| 300 | 300 | |
| @@ -3053,7 +3053,9 @@ static int sysc_remove(struct platform_device *pdev) · 3052 unmodified lines | ||
| 3053 | 3053 | |
| 3054 | 3054 | pm_runtime_put_sync(&pdev->dev); |
| 3055 | 3055 | pm_runtime_disable(&pdev->dev); |
| 3056 | − reset_control_assert(ddata->rsts); | |
| 3056 | + | |
| 3057 | + if (!reset_control_status(ddata->rsts)) | |
| 3058 | + reset_control_assert(ddata->rsts); | |
| 3057 | 3059 | |
| 3058 | 3060 | unprepare: |
| 3059 | 3061 | sysc_unprepare(ddata); |
| @@ -125,7 +125,7 @@ config AGP_HP_ZX1 · 124 unmodified lines | ||
| 125 | 125 | |
| 126 | 126 | config AGP_PARISC |
| 127 | 127 | tristate "HP Quicksilver AGP support" |
| 128 | − depends on AGP && PARISC && 64BIT | |
| 128 | + depends on AGP && PARISC && 64BIT && IOMMU_SBA | |
| 129 | 129 | help |
| 130 | 130 | This option gives you AGP GART support for the HP Quicksilver |
| 131 | 131 | AGP bus adapter on HP PA-RISC machines (Ok, just on the C8000 |
| @@ -81,9 +81,6 @@ MODULE_DESCRIPTION("Driver for Applicom Profibus card"); · 80 unmodified lines | ||
| 81 | 81 | MODULE_LICENSE("GPL"); |
| 82 | 82 | MODULE_ALIAS_MISCDEV(AC_MINOR); |
| 83 | 83 | |
| 84 | −MODULE_SUPPORTED_DEVICE("ac"); | |
| 85 | − | |
| 86 | − | |
| 87 | 84 | static struct applicom_board { |
| 88 | 85 | unsigned long PhysIO; |
| 89 | 86 | void __iomem *RamIO; |
| @@ -54,10 +54,9 @@ static int pseries_rng_probe(struct vio_dev *dev, · 53 unmodified lines | ||
| 54 | 54 | return hwrng_register(&pseries_rng); |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | −static int pseries_rng_remove(struct vio_dev *dev) | |
| 57 | +static void pseries_rng_remove(struct vio_dev *dev) | |
| 58 | 58 | { |
| 59 | 59 | hwrng_unregister(&pseries_rng); |
| 60 | − return 0; | |
| 61 | 60 | } |
| 62 | 61 | |
| 63 | 62 | static const struct vio_device_id pseries_rng_driver_ids[] = { |
| @@ -64,7 +64,6 @@ · 63 unmodified lines | ||
| 64 | 64 | MODULE_LICENSE("GPL"); |
| 65 | 65 | MODULE_AUTHOR("Jonathan Buzzard <jonathan@buzzard.org.uk>"); |
| 66 | 66 | MODULE_DESCRIPTION("Toshiba laptop SMM driver"); |
| 67 | −MODULE_SUPPORTED_DEVICE("toshiba"); | |
| 68 | 67 | |
| 69 | 68 | static DEFINE_MUTEX(tosh_mutex); |
| 70 | 69 | static int tosh_fn; |
| @@ -343,7 +343,7 @@ static int ibmvtpm_crq_send_init_complete(struct ibmvtpm_dev *ibmvtpm) · 342 unmodified lines | ||
| 343 | 343 | * |
| 344 | 344 | * Return: Always 0. |
| 345 | 345 | */ |
| 346 | −static int tpm_ibmvtpm_remove(struct vio_dev *vdev) | |
| 346 | +static void tpm_ibmvtpm_remove(struct vio_dev *vdev) | |
| 347 | 347 | { |
| 348 | 348 | struct tpm_chip *chip = dev_get_drvdata(&vdev->dev); |
| 349 | 349 | struct ibmvtpm_dev *ibmvtpm = dev_get_drvdata(&chip->dev); |
| @@ -372,8 +372,6 @@ static int tpm_ibmvtpm_remove(struct vio_dev *vdev) · 22 unmodified lines | ||
| 372 | 372 | kfree(ibmvtpm); |
| 373 | 373 | /* For tpm_ibmvtpm_get_desired_dma */ |
| 374 | 374 | dev_set_drvdata(&vdev->dev, NULL); |
| 375 | − | |
| 376 | − return 0; | |
| 377 | 375 | } |
| 378 | 376 | |
| 379 | 377 | /** |
| @@ -66,7 +66,14 @@ EXPORT_SYMBOL_GPL(clk_fixed_factor_ops); · 65 unmodified lines | ||
| 66 | 66 | |
| 67 | 67 | static void devm_clk_hw_register_fixed_factor_release(struct device *dev, void *res) |
| 68 | 68 | { |
| 69 | − clk_hw_unregister_fixed_factor(&((struct clk_fixed_factor *)res)->hw); | |
| 69 | + struct clk_fixed_factor *fix = res; | |
| 70 | + | |
| 71 | + /* | |
| 72 | + * We can not use clk_hw_unregister_fixed_factor, since it will kfree() | |
| 73 | + * the hw, resulting in double free. Just unregister the hw and let | |
| 74 | + * devres code kfree() it. | |
| 75 | + */ | |
| 76 | + clk_hw_unregister(&fix->hw); | |
| 70 | 77 | } |
| 71 | 78 | |
| 72 | 79 | static struct clk_hw * |
| @@ -4357,20 +4357,19 @@ int clk_notifier_register(struct clk *clk, struct notifier_block *nb) · 4356 unmodified lines | ||
| 4357 | 4357 | /* search the list of notifiers for this clk */ |
| 4358 | 4358 | list_for_each_entry(cn, &clk_notifier_list, node) |
| 4359 | 4359 | if (cn->clk == clk) |
| 4360 | − break; | |
| 4360 | + goto found; | |
| 4361 | 4361 | |
| 4362 | 4362 | /* if clk wasn't in the notifier list, allocate new clk_notifier */ |
| 4363 | − if (cn->clk != clk) { | |
| 4364 | − cn = kzalloc(sizeof(*cn), GFP_KERNEL); | |
| 4365 | − if (!cn) | |
| 4366 | − goto out; | |
| 4363 | + cn = kzalloc(sizeof(*cn), GFP_KERNEL); | |
| 4364 | + if (!cn) | |
| 4365 | + goto out; | |
| 4367 | 4366 | |
| 4368 | − cn->clk = clk; | |
| 4369 | − srcu_init_notifier_head(&cn->notifier_head); | |
| 4367 | + cn->clk = clk; | |
| 4368 | + srcu_init_notifier_head(&cn->notifier_head); | |
| 4370 | 4369 | |
| 4371 | − list_add(&cn->node, &clk_notifier_list); | |
| 4372 | − } | |
| 4370 | + list_add(&cn->node, &clk_notifier_list); | |
| 4373 | 4371 | |
| 4372 | +found: | |
| 4374 | 4373 | ret = srcu_notifier_chain_register(&cn->notifier_head, nb); |
| 4375 | 4374 | |
| 4376 | 4375 | clk->core->notifier_count++; |
| @@ -4395,32 +4394,28 @@ EXPORT_SYMBOL_GPL(clk_notifier_register); · 18 unmodified lines | ||
| 4395 | 4394 | */ |
| 4396 | 4395 | int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb) |
| 4397 | 4396 | { |
| 4398 | − struct clk_notifier *cn = NULL; | |
| 4399 | − int ret = -EINVAL; | |
| 4397 | + struct clk_notifier *cn; | |
| 4398 | + int ret = -ENOENT; | |
| 4400 | 4399 | |
| 4401 | 4400 | if (!clk || !nb) |
| 4402 | 4401 | return -EINVAL; |
| 4403 | 4402 | |
| 4404 | 4403 | clk_prepare_lock(); |
| 4405 | 4404 | |
| 4406 | − list_for_each_entry(cn, &clk_notifier_list, node) | |
| 4407 | − if (cn->clk == clk) | |
| 4408 | − break; | |
| 4409 | − | |
| 4410 | − if (cn->clk == clk) { | |
| 4411 | − ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb); | |
| 4405 | + list_for_each_entry(cn, &clk_notifier_list, node) { | |
| 4406 | + if (cn->clk == clk) { | |
| 4407 | + ret = srcu_notifier_chain_unregister(&cn->notifier_head, nb); | |
| 4412 | 4408 | |
| 4413 | − clk->core->notifier_count--; | |
| 4409 | + clk->core->notifier_count--; | |
| 4414 | 4410 | |
| 4415 | − /* XXX the notifier code should handle this better */ | |
| 4416 | − if (!cn->notifier_head.head) { | |
| 4417 | − srcu_cleanup_notifier_head(&cn->notifier_head); | |
| 4418 | − list_del(&cn->node); | |
| 4419 | − kfree(cn); | |
| 4411 | + /* XXX the notifier code should handle this better */ | |
| 4412 | + if (!cn->notifier_head.head) { | |
| 4413 | + srcu_cleanup_notifier_head(&cn->notifier_head); | |
| 4414 | + list_del(&cn->node); | |
| 4415 | + kfree(cn); | |
| 4416 | + } | |
| 4417 | + break; | |
| 4420 | 4418 | } |
| 4421 | − | |
| 4422 | − } else { | |
| 4423 | − ret = -ENOENT; | |
| 4424 | 4419 | } |
| 4425 | 4420 | |
| 4426 | 4421 | clk_prepare_unlock(); |
| @@ -304,7 +304,7 @@ static struct clk_rcg2 cam_cc_bps_clk_src = { · 303 unmodified lines | ||
| 304 | 304 | .name = "cam_cc_bps_clk_src", |
| 305 | 305 | .parent_data = cam_cc_parent_data_2, |
| 306 | 306 | .num_parents = 5, |
| 307 | − .ops = &clk_rcg2_ops, | |
| 307 | + .ops = &clk_rcg2_shared_ops, | |
| 308 | 308 | }, |
| 309 | 309 | }; |
| 310 | 310 | |
| @@ -325,7 +325,7 @@ static struct clk_rcg2 cam_cc_cci_0_clk_src = { · 14 unmodified lines | ||
| 325 | 325 | .name = "cam_cc_cci_0_clk_src", |
| 326 | 326 | .parent_data = cam_cc_parent_data_5, |
| 327 | 327 | .num_parents = 3, |
| 328 | − .ops = &clk_rcg2_ops, | |
| 328 | + .ops = &clk_rcg2_shared_ops, | |
| 329 | 329 | }, |
| 330 | 330 | }; |
| 331 | 331 | |
| @@ -339,7 +339,7 @@ static struct clk_rcg2 cam_cc_cci_1_clk_src = { · 7 unmodified lines | ||
| 339 | 339 | .name = "cam_cc_cci_1_clk_src", |
| 340 | 340 | .parent_data = cam_cc_parent_data_5, |
| 341 | 341 | .num_parents = 3, |
| 342 | − .ops = &clk_rcg2_ops, | |
| 342 | + .ops = &clk_rcg2_shared_ops, | |
| 343 | 343 | }, |
| 344 | 344 | }; |
| 345 | 345 | |
| @@ -360,7 +360,7 @@ static struct clk_rcg2 cam_cc_cphy_rx_clk_src = { · 14 unmodified lines | ||
| 360 | 360 | .name = "cam_cc_cphy_rx_clk_src", |
| 361 | 361 | .parent_data = cam_cc_parent_data_3, |
| 362 | 362 | .num_parents = 6, |
| 363 | − .ops = &clk_rcg2_ops, | |
| 363 | + .ops = &clk_rcg2_shared_ops, | |
| 364 | 364 | }, |
| 365 | 365 | }; |
| 366 | 366 | |
| @@ -379,7 +379,7 @@ static struct clk_rcg2 cam_cc_csi0phytimer_clk_src = { · 12 unmodified lines | ||
| 379 | 379 | .name = "cam_cc_csi0phytimer_clk_src", |
| 380 | 380 | .parent_data = cam_cc_parent_data_0, |
| 381 | 381 | .num_parents = 4, |
| 382 | − .ops = &clk_rcg2_ops, | |
| 382 | + .ops = &clk_rcg2_shared_ops, | |
| 383 | 383 | }, |
| 384 | 384 | }; |
| 385 | 385 | |
| @@ -393,7 +393,7 @@ static struct clk_rcg2 cam_cc_csi1phytimer_clk_src = { · 7 unmodified lines | ||
| 393 | 393 | .name = "cam_cc_csi1phytimer_clk_src", |
| 394 | 394 | .parent_data = cam_cc_parent_data_0, |
| 395 | 395 | .num_parents = 4, |
| 396 | − .ops = &clk_rcg2_ops, | |
| 396 | + .ops = &clk_rcg2_shared_ops, | |
| 397 | 397 | }, |
| 398 | 398 | }; |
| 399 | 399 | |
| @@ -407,7 +407,7 @@ static struct clk_rcg2 cam_cc_csi2phytimer_clk_src = { · 7 unmodified lines | ||
| 407 | 407 | .name = "cam_cc_csi2phytimer_clk_src", |
| 408 | 408 | .parent_data = cam_cc_parent_data_0, |
| 409 | 409 | .num_parents = 4, |
| 410 | − .ops = &clk_rcg2_ops, | |
| 410 | + .ops = &clk_rcg2_shared_ops, | |
| 411 | 411 | }, |
| 412 | 412 | }; |
| 413 | 413 | |
| @@ -421,7 +421,7 @@ static struct clk_rcg2 cam_cc_csi3phytimer_clk_src = { · 7 unmodified lines | ||
| 421 | 421 | .name = "cam_cc_csi3phytimer_clk_src", |
| 422 | 422 | .parent_data = cam_cc_parent_data_0, |
| 423 | 423 | .num_parents = 4, |
| 424 | − .ops = &clk_rcg2_ops, | |
| 424 | + .ops = &clk_rcg2_shared_ops, | |
| 425 | 425 | }, |
| 426 | 426 | }; |
| 427 | 427 | |
| @@ -443,7 +443,7 @@ static struct clk_rcg2 cam_cc_fast_ahb_clk_src = { · 15 unmodified lines | ||
| 443 | 443 | .name = "cam_cc_fast_ahb_clk_src", |
| 444 | 444 | .parent_data = cam_cc_parent_data_0, |
| 445 | 445 | .num_parents = 4, |
| 446 | − .ops = &clk_rcg2_ops, | |
| 446 | + .ops = &clk_rcg2_shared_ops, | |
| 447 | 447 | }, |
| 448 | 448 | }; |
| 449 | 449 | |
| @@ -466,7 +466,7 @@ static struct clk_rcg2 cam_cc_icp_clk_src = { · 16 unmodified lines | ||
| 466 | 466 | .name = "cam_cc_icp_clk_src", |
| 467 | 467 | .parent_data = cam_cc_parent_data_2, |
| 468 | 468 | .num_parents = 5, |
| 469 | − .ops = &clk_rcg2_ops, | |
| 469 | + .ops = &clk_rcg2_shared_ops, | |
| 470 | 470 | }, |
| 471 | 471 | }; |
| 472 | 472 | |
| @@ -488,7 +488,7 @@ static struct clk_rcg2 cam_cc_ife_0_clk_src = { · 15 unmodified lines | ||
| 488 | 488 | .name = "cam_cc_ife_0_clk_src", |
| 489 | 489 | .parent_data = cam_cc_parent_data_4, |
| 490 | 490 | .num_parents = 4, |
| 491 | − .ops = &clk_rcg2_ops, | |
| 491 | + .ops = &clk_rcg2_shared_ops, | |
| 492 | 492 | }, |
| 493 | 493 | }; |
| 494 | 494 | |
| @@ -510,7 +510,7 @@ static struct clk_rcg2 cam_cc_ife_0_csid_clk_src = { · 15 unmodified lines | ||
| 510 | 510 | .name = "cam_cc_ife_0_csid_clk_src", |
| 511 | 511 | .parent_data = cam_cc_parent_data_3, |
| 512 | 512 | .num_parents = 6, |
| 513 | − .ops = &clk_rcg2_ops, | |
| 513 | + .ops = &clk_rcg2_shared_ops, | |
| 514 | 514 | }, |
| 515 | 515 | }; |
| 516 | 516 | |
| @@ -524,7 +524,7 @@ static struct clk_rcg2 cam_cc_ife_1_clk_src = { · 7 unmodified lines | ||
| 524 | 524 | .name = "cam_cc_ife_1_clk_src", |
| 525 | 525 | .parent_data = cam_cc_parent_data_4, |
| 526 | 526 | .num_parents = 4, |
| 527 | − .ops = &clk_rcg2_ops, | |
| 527 | + .ops = &clk_rcg2_shared_ops, | |
| 528 | 528 | }, |
| 529 | 529 | }; |
| 530 | 530 | |
| @@ -538,7 +538,7 @@ static struct clk_rcg2 cam_cc_ife_1_csid_clk_src = { · 7 unmodified lines | ||
| 538 | 538 | .name = "cam_cc_ife_1_csid_clk_src", |
| 539 | 539 | .parent_data = cam_cc_parent_data_3, |
| 540 | 540 | .num_parents = 6, |
| 541 | − .ops = &clk_rcg2_ops, | |
| 541 | + .ops = &clk_rcg2_shared_ops, | |
| 542 | 542 | }, |
| 543 | 543 | }; |
| 544 | 544 | |
| @@ -553,7 +553,7 @@ static struct clk_rcg2 cam_cc_ife_lite_clk_src = { · 8 unmodified lines | ||
| 553 | 553 | .parent_data = cam_cc_parent_data_4, |
| 554 | 554 | .num_parents = 4, |
| 555 | 555 | .flags = CLK_SET_RATE_PARENT, |
| 556 | − .ops = &clk_rcg2_ops, | |
| 556 | + .ops = &clk_rcg2_shared_ops, | |
| 557 | 557 | }, |
| 558 | 558 | }; |
| 559 | 559 | |
| @@ -567,7 +567,7 @@ static struct clk_rcg2 cam_cc_ife_lite_csid_clk_src = { · 7 unmodified lines | ||
| 567 | 567 | .name = "cam_cc_ife_lite_csid_clk_src", |
| 568 | 568 | .parent_data = cam_cc_parent_data_3, |
| 569 | 569 | .num_parents = 6, |
| 570 | − .ops = &clk_rcg2_ops, | |
| 570 | + .ops = &clk_rcg2_shared_ops, | |
| 571 | 571 | }, |
| 572 | 572 | }; |
| 573 | 573 | |
| @@ -590,7 +590,7 @@ static struct clk_rcg2 cam_cc_ipe_0_clk_src = { · 16 unmodified lines | ||
| 590 | 590 | .name = "cam_cc_ipe_0_clk_src", |
| 591 | 591 | .parent_data = cam_cc_parent_data_2, |
| 592 | 592 | .num_parents = 5, |
| 593 | − .ops = &clk_rcg2_ops, | |
| 593 | + .ops = &clk_rcg2_shared_ops, | |
| 594 | 594 | }, |
| 595 | 595 | }; |
| 596 | 596 | |
| @@ -613,7 +613,7 @@ static struct clk_rcg2 cam_cc_jpeg_clk_src = { · 16 unmodified lines | ||
| 613 | 613 | .name = "cam_cc_jpeg_clk_src", |
| 614 | 614 | .parent_data = cam_cc_parent_data_2, |
| 615 | 615 | .num_parents = 5, |
| 616 | − .ops = &clk_rcg2_ops, | |
| 616 | + .ops = &clk_rcg2_shared_ops, | |
| 617 | 617 | }, |
| 618 | 618 | }; |
| 619 | 619 | |
| @@ -635,7 +635,7 @@ static struct clk_rcg2 cam_cc_lrme_clk_src = { · 15 unmodified lines | ||
| 635 | 635 | .name = "cam_cc_lrme_clk_src", |
| 636 | 636 | .parent_data = cam_cc_parent_data_6, |
| 637 | 637 | .num_parents = 5, |
| 638 | − .ops = &clk_rcg2_ops, | |
| 638 | + .ops = &clk_rcg2_shared_ops, | |
| 639 | 639 | }, |
| 640 | 640 | }; |
| 641 | 641 | |
| @@ -656,7 +656,7 @@ static struct clk_rcg2 cam_cc_mclk0_clk_src = { · 14 unmodified lines | ||
| 656 | 656 | .name = "cam_cc_mclk0_clk_src", |
| 657 | 657 | .parent_data = cam_cc_parent_data_1, |
| 658 | 658 | .num_parents = 3, |
| 659 | − .ops = &clk_rcg2_ops, | |
| 659 | + .ops = &clk_rcg2_shared_ops, | |
| 660 | 660 | }, |
| 661 | 661 | }; |
| 662 | 662 | |
| @@ -670,7 +670,7 @@ static struct clk_rcg2 cam_cc_mclk1_clk_src = { · 7 unmodified lines | ||
| 670 | 670 | .name = "cam_cc_mclk1_clk_src", |
| 671 | 671 | .parent_data = cam_cc_parent_data_1, |
| 672 | 672 | .num_parents = 3, |
| 673 | − .ops = &clk_rcg2_ops, | |
| 673 | + .ops = &clk_rcg2_shared_ops, | |
| 674 | 674 | }, |
| 675 | 675 | }; |
| 676 | 676 | |
| @@ -684,7 +684,7 @@ static struct clk_rcg2 cam_cc_mclk2_clk_src = { · 7 unmodified lines | ||
| 684 | 684 | .name = "cam_cc_mclk2_clk_src", |
| 685 | 685 | .parent_data = cam_cc_parent_data_1, |
| 686 | 686 | .num_parents = 3, |
| 687 | − .ops = &clk_rcg2_ops, | |
| 687 | + .ops = &clk_rcg2_shared_ops, | |
| 688 | 688 | }, |
| 689 | 689 | }; |
| 690 | 690 | |
| @@ -698,7 +698,7 @@ static struct clk_rcg2 cam_cc_mclk3_clk_src = { · 7 unmodified lines | ||
| 698 | 698 | .name = "cam_cc_mclk3_clk_src", |
| 699 | 699 | .parent_data = cam_cc_parent_data_1, |
| 700 | 700 | .num_parents = 3, |
| 701 | − .ops = &clk_rcg2_ops, | |
| 701 | + .ops = &clk_rcg2_shared_ops, | |
| 702 | 702 | }, |
| 703 | 703 | }; |
| 704 | 704 | |
| @@ -712,7 +712,7 @@ static struct clk_rcg2 cam_cc_mclk4_clk_src = { · 7 unmodified lines | ||
| 712 | 712 | .name = "cam_cc_mclk4_clk_src", |
| 713 | 713 | .parent_data = cam_cc_parent_data_1, |
| 714 | 714 | .num_parents = 3, |
| 715 | − .ops = &clk_rcg2_ops, | |
| 715 | + .ops = &clk_rcg2_shared_ops, | |
| 716 | 716 | }, |
| 717 | 717 | }; |
| 718 | 718 | |
| @@ -732,7 +732,7 @@ static struct clk_rcg2 cam_cc_slow_ahb_clk_src = { · 13 unmodified lines | ||
| 732 | 732 | .parent_data = cam_cc_parent_data_0, |
| 733 | 733 | .num_parents = 4, |
| 734 | 734 | .flags = CLK_SET_RATE_PARENT | CLK_OPS_PARENT_ENABLE, |
| 735 | − .ops = &clk_rcg2_ops, | |
| 735 | + .ops = &clk_rcg2_shared_ops, | |
| 736 | 736 | }, |
| 737 | 737 | }; |
| 738 | 738 | |
| @@ -730,7 +730,8 @@ static int clk_gfx3d_determine_rate(struct clk_hw *hw, · 729 unmodified lines | ||
| 730 | 730 | struct clk_rate_request parent_req = { }; |
| 731 | 731 | struct clk_rcg2_gfx3d *cgfx = to_clk_rcg2_gfx3d(hw); |
| 732 | 732 | struct clk_hw *xo, *p0, *p1, *p2; |
| 733 | − unsigned long request, p0_rate; | |
| 733 | + unsigned long p0_rate; | |
| 734 | + u8 mux_div = cgfx->div; | |
| 734 | 735 | int ret; |
| 735 | 736 | |
| 736 | 737 | p0 = cgfx->hws[0]; |
| @@ -750,14 +751,15 @@ static int clk_gfx3d_determine_rate(struct clk_hw *hw, · 13 unmodified lines | ||
| 750 | 751 | return 0; |
| 751 | 752 | } |
| 752 | 753 | |
| 753 | − request = req->rate; | |
| 754 | − if (cgfx->div > 1) | |
| 755 | − parent_req.rate = request = request * cgfx->div; | |
| 754 | + if (mux_div == 0) | |
| 755 | + mux_div = 1; | |
| 756 | + | |
| 757 | + parent_req.rate = req->rate * mux_div; | |
| 756 | 758 | |
| 757 | 759 | /* This has to be a fixed rate PLL */ |
| 758 | 760 | p0_rate = clk_hw_get_rate(p0); |
| 759 | 761 | |
| 760 | − if (request == p0_rate) { | |
| 762 | + if (parent_req.rate == p0_rate) { | |
| 761 | 763 | req->rate = req->best_parent_rate = p0_rate; |
| 762 | 764 | req->best_parent_hw = p0; |
| 763 | 765 | return 0; |
| @@ -765,7 +767,7 @@ static int clk_gfx3d_determine_rate(struct clk_hw *hw, · 1 unmodified line | ||
| 765 | 767 | |
| 766 | 768 | if (req->best_parent_hw == p0) { |
| 767 | 769 | /* Are we going back to a previously used rate? */ |
| 768 | − if (clk_hw_get_rate(p2) == request) | |
| 770 | + if (clk_hw_get_rate(p2) == parent_req.rate) | |
| 769 | 771 | req->best_parent_hw = p2; |
| 770 | 772 | else |
| 771 | 773 | req->best_parent_hw = p1; |
| @@ -780,8 +782,7 @@ static int clk_gfx3d_determine_rate(struct clk_hw *hw, · 8 unmodified lines | ||
| 780 | 782 | return ret; |
| 781 | 783 | |
| 782 | 784 | req->rate = req->best_parent_rate = parent_req.rate; |
| 783 | − if (cgfx->div > 1) | |
| 784 | − req->rate /= cgfx->div; | |
| 785 | + req->rate /= mux_div; | |
| 785 | 786 | |
| 786 | 787 | return 0; |
| 787 | 788 | } |
| @@ -510,9 +510,12 @@ static const struct clk_rpmh_desc clk_rpmh_sm8350 = { · 509 unmodified lines | ||
| 510 | 510 | .num_clks = ARRAY_SIZE(sm8350_rpmh_clocks), |
| 511 | 511 | }; |
| 512 | 512 | |
| 513 | +/* Resource name must match resource id present in cmd-db */ | |
| 514 | +DEFINE_CLK_RPMH_ARC(sc7280, bi_tcxo, bi_tcxo_ao, "xo.lvl", 0x3, 4); | |
| 515 | + | |
| 513 | 516 | static struct clk_hw *sc7280_rpmh_clocks[] = { |
| 514 | − [RPMH_CXO_CLK] = &sdm845_bi_tcxo.hw, | |
| 515 | − [RPMH_CXO_CLK_A] = &sdm845_bi_tcxo_ao.hw, | |
| 517 | + [RPMH_CXO_CLK] = &sc7280_bi_tcxo.hw, | |
| 518 | + [RPMH_CXO_CLK_A] = &sc7280_bi_tcxo_ao.hw, | |
| 516 | 519 | [RPMH_LN_BB_CLK2] = &sdm845_ln_bb_clk2.hw, |
| 517 | 520 | [RPMH_LN_BB_CLK2_A] = &sdm845_ln_bb_clk2_ao.hw, |
| 518 | 521 | [RPMH_RF_CLK1] = &sdm845_rf_clk1.hw, |
| @@ -620,7 +620,7 @@ static struct clk_rcg2 gcc_sdcc1_apps_clk_src = { · 619 unmodified lines | ||
| 620 | 620 | .name = "gcc_sdcc1_apps_clk_src", |
| 621 | 621 | .parent_data = gcc_parent_data_1, |
| 622 | 622 | .num_parents = 5, |
| 623 | − .ops = &clk_rcg2_ops, | |
| 623 | + .ops = &clk_rcg2_floor_ops, | |
| 624 | 624 | }, |
| 625 | 625 | }; |
| 626 | 626 | |
| @@ -642,7 +642,7 @@ static struct clk_rcg2 gcc_sdcc1_ice_core_clk_src = { · 15 unmodified lines | ||
| 642 | 642 | .name = "gcc_sdcc1_ice_core_clk_src", |
| 643 | 643 | .parent_data = gcc_parent_data_0, |
| 644 | 644 | .num_parents = 4, |
| 645 | − .ops = &clk_rcg2_floor_ops, | |
| 645 | + .ops = &clk_rcg2_ops, | |
| 646 | 646 | }, |
| 647 | 647 | }; |
| 648 | 648 | |
| @@ -99,7 +99,7 @@ static unsigned long socfpga_clk_recalc_rate(struct clk_hw *hwclk, · 98 unmodified lines | ||
| 99 | 99 | val = readl(socfpgaclk->div_reg) >> socfpgaclk->shift; |
| 100 | 100 | val &= GENMASK(socfpgaclk->width - 1, 0); |
| 101 | 101 | /* Check for GPIO_DB_CLK by its offset */ |
| 102 | − if ((int) socfpgaclk->div_reg & SOCFPGA_GPIO_DB_CLK_OFFSET) | |
| 102 | + if ((uintptr_t) socfpgaclk->div_reg & SOCFPGA_GPIO_DB_CLK_OFFSET) | |
| 103 | 103 | div = val + 1; |
| 104 | 104 | else |
| 105 | 105 | div = (1 << val); |
| @@ -31,7 +31,7 @@ struct stm32_timer_cnt { · 30 unmodified lines | ||
| 31 | 31 | struct counter_device counter; |
| 32 | 32 | struct regmap *regmap; |
| 33 | 33 | struct clk *clk; |
| 34 | − u32 ceiling; | |
| 34 | + u32 max_arr; | |
| 35 | 35 | bool enabled; |
| 36 | 36 | struct stm32_timer_regs bak; |
| 37 | 37 | }; |
| @@ -44,13 +44,14 @@ struct stm32_timer_cnt { · 6 unmodified lines | ||
| 44 | 44 | * @STM32_COUNT_ENCODER_MODE_3: counts on both TI1FP1 and TI2FP2 edges |
| 45 | 45 | */ |
| 46 | 46 | enum stm32_count_function { |
| 47 | − STM32_COUNT_SLAVE_MODE_DISABLED = -1, | |
| 47 | + STM32_COUNT_SLAVE_MODE_DISABLED, | |
| 48 | 48 | STM32_COUNT_ENCODER_MODE_1, |
| 49 | 49 | STM32_COUNT_ENCODER_MODE_2, |
| 50 | 50 | STM32_COUNT_ENCODER_MODE_3, |
| 51 | 51 | }; |
| 52 | 52 | |
| 53 | 53 | static enum counter_count_function stm32_count_functions[] = { |
| 54 | + [STM32_COUNT_SLAVE_MODE_DISABLED] = COUNTER_COUNT_FUNCTION_INCREASE, | |
| 54 | 55 | [STM32_COUNT_ENCODER_MODE_1] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_A, |
| 55 | 56 | [STM32_COUNT_ENCODER_MODE_2] = COUNTER_COUNT_FUNCTION_QUADRATURE_X2_B, |
| 56 | 57 | [STM32_COUNT_ENCODER_MODE_3] = COUNTER_COUNT_FUNCTION_QUADRATURE_X4, |
| @@ -73,8 +74,10 @@ static int stm32_count_write(struct counter_device *counter, · 16 unmodified lines | ||
| 73 | 74 | const unsigned long val) |
| 74 | 75 | { |
| 75 | 76 | struct stm32_timer_cnt *const priv = counter->priv; |
| 77 | + u32 ceiling; | |
| 76 | 78 | |
| 77 | − if (val > priv->ceiling) | |
| 79 | + regmap_read(priv->regmap, TIM_ARR, &ceiling); | |
| 80 | + if (val > ceiling) | |
| 78 | 81 | return -EINVAL; |
| 79 | 82 | |
| 80 | 83 | return regmap_write(priv->regmap, TIM_CNT, val); |
| @@ -90,6 +93,9 @@ static int stm32_count_function_get(struct counter_device *counter, · 9 unmodified lines | ||
| 90 | 93 | regmap_read(priv->regmap, TIM_SMCR, &smcr); |
| 91 | 94 | |
| 92 | 95 | switch (smcr & TIM_SMCR_SMS) { |
| 96 | + case 0: | |
| 97 | + *function = STM32_COUNT_SLAVE_MODE_DISABLED; | |
| 98 | + return 0; | |
| 93 | 99 | case 1: |
| 94 | 100 | *function = STM32_COUNT_ENCODER_MODE_1; |
| 95 | 101 | return 0; |
| @@ -99,9 +105,9 @@ static int stm32_count_function_get(struct counter_device *counter, · 3 unmodified lines | ||
| 99 | 105 | case 3: |
| 100 | 106 | *function = STM32_COUNT_ENCODER_MODE_3; |
| 101 | 107 | return 0; |
| 108 | + default: | |
| 109 | + return -EINVAL; | |
| 102 | 110 | } |
| 103 | − | |
| 104 | − return -EINVAL; | |
| 105 | 111 | } |
| 106 | 112 | |
| 107 | 113 | static int stm32_count_function_set(struct counter_device *counter, |
| @@ -112,6 +118,9 @@ static int stm32_count_function_set(struct counter_device *counter, · 4 unmodified lines | ||
| 112 | 118 | u32 cr1, sms; |
| 113 | 119 | |
| 114 | 120 | switch (function) { |
| 121 | + case STM32_COUNT_SLAVE_MODE_DISABLED: | |
| 122 | + sms = 0; | |
| 123 | + break; | |
| 115 | 124 | case STM32_COUNT_ENCODER_MODE_1: |
| 116 | 125 | sms = 1; |
| 117 | 126 | break; |
| @@ -122,8 +131,7 @@ static int stm32_count_function_set(struct counter_device *counter, · 4 unmodified lines | ||
| 122 | 131 | sms = 3; |
| 123 | 132 | break; |
| 124 | 133 | default: |
| 125 | − sms = 0; | |
| 126 | − break; | |
| 134 | + return -EINVAL; | |
| 127 | 135 | } |
| 128 | 136 | |
| 129 | 137 | /* Store enable status */ |
| @@ -131,10 +139,6 @@ static int stm32_count_function_set(struct counter_device *counter, · 1 unmodified line | ||
| 131 | 139 | |
| 132 | 140 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_CEN, 0); |
| 133 | 141 | |
| 134 | − /* TIMx_ARR register shouldn't be buffered (ARPE=0) */ | |
| 135 | − regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); | |
| 136 | − regmap_write(priv->regmap, TIM_ARR, priv->ceiling); | |
| 137 | − | |
| 138 | 142 | regmap_update_bits(priv->regmap, TIM_SMCR, TIM_SMCR_SMS, sms); |
| 139 | 143 | |
| 140 | 144 | /* Make sure that registers are updated */ |
| @@ -185,11 +189,13 @@ static ssize_t stm32_count_ceiling_write(struct counter_device *counter, · 44 unmodified lines | ||
| 185 | 189 | if (ret) |
| 186 | 190 | return ret; |
| 187 | 191 | |
| 192 | + if (ceiling > priv->max_arr) | |
| 193 | + return -ERANGE; | |
| 194 | + | |
| 188 | 195 | /* TIMx_ARR register shouldn't be buffered (ARPE=0) */ |
| 189 | 196 | regmap_update_bits(priv->regmap, TIM_CR1, TIM_CR1_ARPE, 0); |
| 190 | 197 | regmap_write(priv->regmap, TIM_ARR, ceiling); |
| 191 | 198 | |
| 192 | − priv->ceiling = ceiling; | |
| 193 | 199 | return len; |
| 194 | 200 | } |
| 195 | 201 | |
| @@ -274,31 +280,36 @@ static int stm32_action_get(struct counter_device *counter, · 78 unmodified lines | ||
| 274 | 280 | size_t function; |
| 275 | 281 | int err; |
| 276 | 282 | |
| 277 | − /* Default action mode (e.g. STM32_COUNT_SLAVE_MODE_DISABLED) */ | |
| 278 | − *action = STM32_SYNAPSE_ACTION_NONE; | |
| 279 | − | |
| 280 | 283 | err = stm32_count_function_get(counter, count, &function); |
| 281 | 284 | if (err) |
| 282 | − return 0; | |
| 285 | + return err; | |
| 283 | 286 | |
| 284 | 287 | switch (function) { |
| 288 | + case STM32_COUNT_SLAVE_MODE_DISABLED: | |
| 289 | + /* counts on internal clock when CEN=1 */ | |
| 290 | + *action = STM32_SYNAPSE_ACTION_NONE; | |
| 291 | + return 0; | |
| 285 | 292 | case STM32_COUNT_ENCODER_MODE_1: |
| 286 | 293 | /* counts up/down on TI1FP1 edge depending on TI2FP2 level */ |
| 287 | 294 | if (synapse->signal->id == count->synapses[0].signal->id) |
| 288 | 295 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; |
| 289 | − break; | |
| 296 | + else | |
| 297 | + *action = STM32_SYNAPSE_ACTION_NONE; | |
| 298 | + return 0; | |
| 290 | 299 | case STM32_COUNT_ENCODER_MODE_2: |
| 291 | 300 | /* counts up/down on TI2FP2 edge depending on TI1FP1 level */ |
| 292 | 301 | if (synapse->signal->id == count->synapses[1].signal->id) |
| 293 | 302 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; |
| 294 | − break; | |
| 303 | + else | |
| 304 | + *action = STM32_SYNAPSE_ACTION_NONE; | |
| 305 | + return 0; | |
| 295 | 306 | case STM32_COUNT_ENCODER_MODE_3: |
| 296 | 307 | /* counts up/down on both TI1FP1 and TI2FP2 edges */ |
| 297 | 308 | *action = STM32_SYNAPSE_ACTION_BOTH_EDGES; |
| 298 | − break; | |
| 309 | + return 0; | |
| 310 | + default: | |
| 311 | + return -EINVAL; | |
| 299 | 312 | } |
| 300 | − | |
| 301 | − return 0; | |
| 302 | 313 | } |
| 303 | 314 | |
| 304 | 315 | static const struct counter_ops stm32_timer_cnt_ops = { |
| @@ -359,7 +370,7 @@ static int stm32_timer_cnt_probe(struct platform_device *pdev) · 54 unmodified lines | ||
| 359 | 370 | |
| 360 | 371 | priv->regmap = ddata->regmap; |
| 361 | 372 | priv->clk = ddata->clk; |
| 362 | − priv->ceiling = ddata->max_arr; | |
| 373 | + priv->max_arr = ddata->max_arr; | |
| 363 | 374 | |
| 364 | 375 | priv->counter.name = dev_name(dev); |
| 365 | 376 | priv->counter.parent = dev; |
| @@ -103,6 +103,8 @@ static const struct of_device_id whitelist[] __initconst = { · 102 unmodified lines | ||
| 103 | 103 | static const struct of_device_id blacklist[] __initconst = { |
| 104 | 104 | { .compatible = "allwinner,sun50i-h6", }, |
| 105 | 105 | |
| 106 | + { .compatible = "arm,vexpress", }, | |
| 107 | + | |
| 106 | 108 | { .compatible = "calxeda,highbank", }, |
| 107 | 109 | { .compatible = "calxeda,ecx-2000", }, |
| 108 | 110 | |
| @@ -267,7 +267,7 @@ struct freq_attr cpufreq_freq_attr_##_name##_freqs = \ · 266 unmodified lines | ||
| 267 | 267 | __ATTR_RO(_name##_frequencies) |
| 268 | 268 | |
| 269 | 269 | /* |
| 270 | − * show_scaling_available_frequencies - show available normal frequencies for | |
| 270 | + * scaling_available_frequencies_show - show available normal frequencies for | |
| 271 | 271 | * the specified CPU |
| 272 | 272 | */ |
| 273 | 273 | static ssize_t scaling_available_frequencies_show(struct cpufreq_policy *policy, |
| @@ -279,7 +279,7 @@ cpufreq_attr_available_freq(scaling_available); · 5 unmodified lines | ||
| 279 | 279 | EXPORT_SYMBOL_GPL(cpufreq_freq_attr_scaling_available_freqs); |
| 280 | 280 | |
| 281 | 281 | /* |
| 282 | − * show_available_boost_freqs - show available boost frequencies for | |
| 282 | + * scaling_boost_frequencies_show - show available boost frequencies for | |
| 283 | 283 | * the specified CPU |
| 284 | 284 | */ |
| 285 | 285 | static ssize_t scaling_boost_frequencies_show(struct cpufreq_policy *policy, |
| @@ -317,9 +317,9 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) · 316 unmodified lines | ||
| 317 | 317 | } |
| 318 | 318 | |
| 319 | 319 | base = ioremap(res->start, resource_size(res)); |
| 320 | − if (IS_ERR(base)) { | |
| 320 | + if (!base) { | |
| 321 | 321 | dev_err(dev, "failed to map resource %pR\n", res); |
| 322 | − ret = PTR_ERR(base); | |
| 322 | + ret = -ENOMEM; | |
| 323 | 323 | goto release_region; |
| 324 | 324 | } |
| 325 | 325 | |
| @@ -374,7 +374,7 @@ static int qcom_cpufreq_hw_cpu_init(struct cpufreq_policy *policy) · 48 unmodified lines | ||
| 374 | 374 | error: |
| 375 | 375 | kfree(data); |
| 376 | 376 | unmap_base: |
| 377 | − iounmap(data->base); | |
| 377 | + iounmap(base); | |
| 378 | 378 | release_region: |
| 379 | 379 | release_mem_region(res->start, resource_size(res)); |
| 380 | 380 | return ret; |
| @@ -1042,7 +1042,7 @@ error: · 1041 unmodified lines | ||
| 1042 | 1042 | return ret; |
| 1043 | 1043 | } |
| 1044 | 1044 | |
| 1045 | −static int nx842_remove(struct vio_dev *viodev) | |
| 1045 | +static void nx842_remove(struct vio_dev *viodev) | |
| 1046 | 1046 | { |
| 1047 | 1047 | struct nx842_devdata *old_devdata; |
| 1048 | 1048 | unsigned long flags; |
| @@ -1063,8 +1063,6 @@ static int nx842_remove(struct vio_dev *viodev) · 14 unmodified lines | ||
| 1063 | 1063 | if (old_devdata) |
| 1064 | 1064 | kfree(old_devdata->counters); |
| 1065 | 1065 | kfree(old_devdata); |
| 1066 | − | |
| 1067 | − return 0; | |
| 1068 | 1066 | } |
| 1069 | 1067 | |
| 1070 | 1068 | static const struct vio_device_id nx842_vio_driver_ids[] = { |
| @@ -783,7 +783,7 @@ static int nx_probe(struct vio_dev *viodev, const struct vio_device_id *id) · 782 unmodified lines | ||
| 783 | 783 | return nx_register_algs(); |
| 784 | 784 | } |
| 785 | 785 | |
| 786 | −static int nx_remove(struct vio_dev *viodev) | |
| 786 | +static void nx_remove(struct vio_dev *viodev) | |
| 787 | 787 | { |
| 788 | 788 | dev_dbg(&viodev->dev, "entering nx_remove for UA 0x%x\n", |
| 789 | 789 | viodev->unit_address); |
| @@ -811,8 +811,6 @@ static int nx_remove(struct vio_dev *viodev) · 21 unmodified lines | ||
| 811 | 811 | nx_unregister_skcipher(&nx_ecb_aes_alg, NX_FC_AES, |
| 812 | 812 | NX_MODE_AES_ECB); |
| 813 | 813 | } |
| 814 | − | |
| 815 | − return 0; | |
| 816 | 814 | } |
| 817 | 815 | |
| 818 | 816 | |
| @@ -4,6 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | #include <linux/security.h> |
| 5 | 5 | #include <linux/debugfs.h> |
| 6 | 6 | #include <linux/module.h> |
| 7 | +#include <linux/sizes.h> | |
| 7 | 8 | #include <linux/mutex.h> |
| 8 | 9 | #include <linux/cdev.h> |
| 9 | 10 | #include <linux/idr.h> |
| @@ -96,21 +97,18 @@ struct mbox_cmd { · 86 unmodified lines | ||
| 96 | 97 | * @dev: driver core device object |
| 97 | 98 | * @cdev: char dev core object for ioctl operations |
| 98 | 99 | * @cxlm: pointer to the parent device driver data |
| 99 | − * @ops_active: active user of @cxlm in ops handlers | |
| 100 | − * @ops_dead: completion when all @cxlm ops users have exited | |
| 101 | 100 | * @id: id number of this memdev instance. |
| 102 | 101 | */ |
| 103 | 102 | struct cxl_memdev { |
| 104 | 103 | struct device dev; |
| 105 | 104 | struct cdev cdev; |
| 106 | 105 | struct cxl_mem *cxlm; |
| 107 | − struct percpu_ref ops_active; | |
| 108 | − struct completion ops_dead; | |
| 109 | 106 | int id; |
| 110 | 107 | }; |
| 111 | 108 | |
| 112 | 109 | static int cxl_mem_major; |
| 113 | 110 | static DEFINE_IDA(cxl_memdev_ida); |
| 111 | +static DECLARE_RWSEM(cxl_memdev_rwsem); | |
| 114 | 112 | static struct dentry *cxl_debugfs; |
| 115 | 113 | static bool cxl_raw_allow_all; |
| 116 | 114 | |
| @@ -169,7 +167,7 @@ struct cxl_mem_command { · 52 unmodified lines | ||
| 169 | 167 | * table will be validated against the user's input. For example, if size_in is |
| 170 | 168 | * 0, and the user passed in 1, it is an error. |
| 171 | 169 | */ |
| 172 | −static struct cxl_mem_command mem_commands[] = { | |
| 170 | +static struct cxl_mem_command mem_commands[CXL_MEM_COMMAND_ID_MAX] = { | |
| 173 | 171 | CXL_CMD(IDENTIFY, 0, 0x43, CXL_CMD_FLAG_FORCE_ENABLE), |
| 174 | 172 | #ifdef CONFIG_CXL_MEM_RAW_COMMANDS |
| 175 | 173 | CXL_CMD(RAW, ~0, ~0, 0), |
| @@ -776,26 +774,43 @@ static long __cxl_memdev_ioctl(struct cxl_memdev *cxlmd, unsigned int cmd, · 600 unmodified lines | ||
| 776 | 774 | static long cxl_memdev_ioctl(struct file *file, unsigned int cmd, |
| 777 | 775 | unsigned long arg) |
| 778 | 776 | { |
| 779 | − struct cxl_memdev *cxlmd; | |
| 780 | − struct inode *inode; | |
| 781 | − int rc = -ENOTTY; | |
| 777 | + struct cxl_memdev *cxlmd = file->private_data; | |
| 778 | + int rc = -ENXIO; | |
| 782 | 779 | |
| 783 | − inode = file_inode(file); | |
| 784 | − cxlmd = container_of(inode->i_cdev, typeof(*cxlmd), cdev); | |
| 780 | + down_read(&cxl_memdev_rwsem); | |
| 781 | + if (cxlmd->cxlm) | |
| 782 | + rc = __cxl_memdev_ioctl(cxlmd, cmd, arg); | |
| 783 | + up_read(&cxl_memdev_rwsem); | |
| 785 | 784 | |
| 786 | − if (!percpu_ref_tryget_live(&cxlmd->ops_active)) | |
| 787 | − return -ENXIO; | |
| 785 | + return rc; | |
| 786 | +} | |
| 788 | 787 | |
| 789 | − rc = __cxl_memdev_ioctl(cxlmd, cmd, arg); | |
| 788 | +static int cxl_memdev_open(struct inode *inode, struct file *file) | |
| 789 | +{ | |
| 790 | + struct cxl_memdev *cxlmd = | |
| 791 | + container_of(inode->i_cdev, typeof(*cxlmd), cdev); | |
| 790 | 792 | |
| 791 | − percpu_ref_put(&cxlmd->ops_active); | |
| 793 | + get_device(&cxlmd->dev); | |
| 794 | + file->private_data = cxlmd; | |
| 792 | 795 | |
| 793 | − return rc; | |
| 796 | + return 0; | |
| 797 | +} | |
| 798 | + | |
| 799 | +static int cxl_memdev_release_file(struct inode *inode, struct file *file) | |
| 800 | +{ | |
| 801 | + struct cxl_memdev *cxlmd = | |
| 802 | + container_of(inode->i_cdev, typeof(*cxlmd), cdev); | |
| 803 | + | |
| 804 | + put_device(&cxlmd->dev); | |
| 805 | + | |
| 806 | + return 0; | |
| 794 | 807 | } |
| 795 | 808 | |
| 796 | 809 | static const struct file_operations cxl_memdev_fops = { |
| 797 | 810 | .owner = THIS_MODULE, |
| 798 | 811 | .unlocked_ioctl = cxl_memdev_ioctl, |
| 812 | + .open = cxl_memdev_open, | |
| 813 | + .release = cxl_memdev_release_file, | |
| 799 | 814 | .compat_ioctl = compat_ptr_ioctl, |
| 800 | 815 | .llseek = noop_llseek, |
| 801 | 816 | }; |
| @@ -984,7 +999,7 @@ static struct cxl_mem *cxl_mem_create(struct pci_dev *pdev, u32 reg_lo, · 182 unmodified lines | ||
| 984 | 999 | return NULL; |
| 985 | 1000 | } |
| 986 | 1001 | |
| 987 | − offset = ((u64)reg_hi << 32) | FIELD_GET(CXL_REGLOC_ADDR_MASK, reg_lo); | |
| 1002 | + offset = ((u64)reg_hi << 32) | (reg_lo & CXL_REGLOC_ADDR_MASK); | |
| 988 | 1003 | bar = FIELD_GET(CXL_REGLOC_BIR_MASK, reg_lo); |
| 989 | 1004 | |
| 990 | 1005 | /* Basic sanity check that BAR is big enough */ |
| @@ -1049,7 +1064,6 @@ static void cxl_memdev_release(struct device *dev) · 58 unmodified lines | ||
| 1049 | 1064 | { |
| 1050 | 1065 | struct cxl_memdev *cxlmd = to_cxl_memdev(dev); |
| 1051 | 1066 | |
| 1052 | − percpu_ref_exit(&cxlmd->ops_active); | |
| 1053 | 1067 | ida_free(&cxl_memdev_ida, cxlmd->id); |
| 1054 | 1068 | kfree(cxlmd); |
| 1055 | 1069 | } |
| @@ -1066,7 +1080,7 @@ static ssize_t firmware_version_show(struct device *dev, · 10 unmodified lines | ||
| 1066 | 1080 | struct cxl_memdev *cxlmd = to_cxl_memdev(dev); |
| 1067 | 1081 | struct cxl_mem *cxlm = cxlmd->cxlm; |
| 1068 | 1082 | |
| 1069 | − return sprintf(buf, "%.16s\n", cxlm->firmware_version); | |
| 1083 | + return sysfs_emit(buf, "%.16s\n", cxlm->firmware_version); | |
| 1070 | 1084 | } |
| 1071 | 1085 | static DEVICE_ATTR_RO(firmware_version); |
| 1072 | 1086 | |
| @@ -1076,7 +1090,7 @@ static ssize_t payload_max_show(struct device *dev, · 3 unmodified lines | ||
| 1076 | 1090 | struct cxl_memdev *cxlmd = to_cxl_memdev(dev); |
| 1077 | 1091 | struct cxl_mem *cxlm = cxlmd->cxlm; |
| 1078 | 1092 | |
| 1079 | − return sprintf(buf, "%zu\n", cxlm->payload_size); | |
| 1093 | + return sysfs_emit(buf, "%zu\n", cxlm->payload_size); | |
| 1080 | 1094 | } |
| 1081 | 1095 | static DEVICE_ATTR_RO(payload_max); |
| 1082 | 1096 | |
| @@ -1087,7 +1101,7 @@ static ssize_t ram_size_show(struct device *dev, struct device_attribute *attr, · 4 unmodified lines | ||
| 1087 | 1101 | struct cxl_mem *cxlm = cxlmd->cxlm; |
| 1088 | 1102 | unsigned long long len = range_len(&cxlm->ram_range); |
| 1089 | 1103 | |
| 1090 | − return sprintf(buf, "%#llx\n", len); | |
| 1104 | + return sysfs_emit(buf, "%#llx\n", len); | |
| 1091 | 1105 | } |
| 1092 | 1106 | |
| 1093 | 1107 | static struct device_attribute dev_attr_ram_size = |
| @@ -1100,7 +1114,7 @@ static ssize_t pmem_size_show(struct device *dev, struct device_attribute *attr, · 6 unmodified lines | ||
| 1100 | 1114 | struct cxl_mem *cxlm = cxlmd->cxlm; |
| 1101 | 1115 | unsigned long long len = range_len(&cxlm->pmem_range); |
| 1102 | 1116 | |
| 1103 | − return sprintf(buf, "%#llx\n", len); | |
| 1117 | + return sysfs_emit(buf, "%#llx\n", len); | |
| 1104 | 1118 | } |
| 1105 | 1119 | |
| 1106 | 1120 | static struct device_attribute dev_attr_pmem_size = |
| @@ -1150,27 +1164,24 @@ static const struct device_type cxl_memdev_type = { · 43 unmodified lines | ||
| 1150 | 1164 | .groups = cxl_memdev_attribute_groups, |
| 1151 | 1165 | }; |
| 1152 | 1166 | |
| 1153 | −static void cxlmdev_unregister(void *_cxlmd) | |
| 1167 | +static void cxl_memdev_shutdown(struct cxl_memdev *cxlmd) | |
| 1154 | 1168 | { |
| 1155 | − struct cxl_memdev *cxlmd = _cxlmd; | |
| 1156 | − struct device *dev = &cxlmd->dev; | |
| 1157 | − | |
| 1158 | − percpu_ref_kill(&cxlmd->ops_active); | |
| 1159 | − cdev_device_del(&cxlmd->cdev, dev); | |
| 1160 | − wait_for_completion(&cxlmd->ops_dead); | |
| 1169 | + down_write(&cxl_memdev_rwsem); | |
| 1161 | 1170 | cxlmd->cxlm = NULL; |
| 1162 | − put_device(dev); | |
| 1171 | + up_write(&cxl_memdev_rwsem); | |
| 1163 | 1172 | } |
| 1164 | 1173 | |
| 1165 | −static void cxlmdev_ops_active_release(struct percpu_ref *ref) | |
| 1174 | +static void cxl_memdev_unregister(void *_cxlmd) | |
| 1166 | 1175 | { |
| 1167 | − struct cxl_memdev *cxlmd = | |
| 1168 | − container_of(ref, typeof(*cxlmd), ops_active); | |
| 1176 | + struct cxl_memdev *cxlmd = _cxlmd; | |
| 1177 | + struct device *dev = &cxlmd->dev; | |
| 1169 | 1178 | |
| 1170 | − complete(&cxlmd->ops_dead); | |
| 1179 | + cdev_device_del(&cxlmd->cdev, dev); | |
| 1180 | + cxl_memdev_shutdown(cxlmd); | |
| 1181 | + put_device(dev); | |
| 1171 | 1182 | } |
| 1172 | 1183 | |
| 1173 | −static int cxl_mem_add_memdev(struct cxl_mem *cxlm) | |
| 1184 | +static struct cxl_memdev *cxl_memdev_alloc(struct cxl_mem *cxlm) | |
| 1174 | 1185 | { |
| 1175 | 1186 | struct pci_dev *pdev = cxlm->pdev; |
| 1176 | 1187 | struct cxl_memdev *cxlmd; |
| @@ -1180,22 +1191,11 @@ static int cxl_mem_add_memdev(struct cxl_mem *cxlm) · 3 unmodified lines | ||
| 1180 | 1191 | |
| 1181 | 1192 | cxlmd = kzalloc(sizeof(*cxlmd), GFP_KERNEL); |
| 1182 | 1193 | if (!cxlmd) |
| 1183 | − return -ENOMEM; | |
| 1184 | − init_completion(&cxlmd->ops_dead); | |
| 1185 | − | |
| 1186 | − /* | |
| 1187 | − * @cxlm is deallocated when the driver unbinds so operations | |
| 1188 | − * that are using it need to hold a live reference. | |
| 1189 | − */ | |
| 1190 | − cxlmd->cxlm = cxlm; | |
| 1191 | − rc = percpu_ref_init(&cxlmd->ops_active, cxlmdev_ops_active_release, 0, | |
| 1192 | − GFP_KERNEL); | |
| 1193 | − if (rc) | |
| 1194 | − goto err_ref; | |
| 1194 | + return ERR_PTR(-ENOMEM); | |
| 1195 | 1195 | |
| 1196 | 1196 | rc = ida_alloc_range(&cxl_memdev_ida, 0, CXL_MEM_MAX_DEVS, GFP_KERNEL); |
| 1197 | 1197 | if (rc < 0) |
| 1198 | − goto err_id; | |
| 1198 | + goto err; | |
| 1199 | 1199 | cxlmd->id = rc; |
| 1200 | 1200 | |
| 1201 | 1201 | dev = &cxlmd->dev; |
| @@ -1204,30 +1204,54 @@ static int cxl_mem_add_memdev(struct cxl_mem *cxlm) · 2 unmodified lines | ||
| 1204 | 1204 | dev->bus = &cxl_bus_type; |
| 1205 | 1205 | dev->devt = MKDEV(cxl_mem_major, cxlmd->id); |
| 1206 | 1206 | dev->type = &cxl_memdev_type; |
| 1207 | − dev_set_name(dev, "mem%d", cxlmd->id); | |
| 1207 | + device_set_pm_not_required(dev); | |
| 1208 | 1208 | |
| 1209 | 1209 | cdev = &cxlmd->cdev; |
| 1210 | 1210 | cdev_init(cdev, &cxl_memdev_fops); |
| 1211 | + return cxlmd; | |
| 1212 | + | |
| 1213 | +err: | |
| 1214 | + kfree(cxlmd); | |
| 1215 | + return ERR_PTR(rc); | |
| 1216 | +} | |
| 1217 | + | |
| 1218 | +static int cxl_mem_add_memdev(struct cxl_mem *cxlm) | |
| 1219 | +{ | |
| 1220 | + struct cxl_memdev *cxlmd; | |
| 1221 | + struct device *dev; | |
| 1222 | + struct cdev *cdev; | |
| 1223 | + int rc; | |
| 1224 | + | |
| 1225 | + cxlmd = cxl_memdev_alloc(cxlm); | |
| 1226 | + if (IS_ERR(cxlmd)) | |
| 1227 | + return PTR_ERR(cxlmd); | |
| 1228 | + | |
| 1229 | + dev = &cxlmd->dev; | |
| 1230 | + rc = dev_set_name(dev, "mem%d", cxlmd->id); | |
| 1231 | + if (rc) | |
| 1232 | + goto err; | |
| 1233 | + | |
| 1234 | + /* | |
| 1235 | + * Activate ioctl operations, no cxl_memdev_rwsem manipulation | |
| 1236 | + * needed as this is ordered with cdev_add() publishing the device. | |
| 1237 | + */ | |
| 1238 | + cxlmd->cxlm = cxlm; | |
| 1211 | 1239 | |
| 1240 | + cdev = &cxlmd->cdev; | |
| 1212 | 1241 | rc = cdev_device_add(cdev, dev); |
| 1213 | 1242 | if (rc) |
| 1214 | − goto err_add; | |
| 1243 | + goto err; | |
| 1215 | 1244 | |
| 1216 | − return devm_add_action_or_reset(dev->parent, cxlmdev_unregister, cxlmd); | |
| 1245 | + return devm_add_action_or_reset(dev->parent, cxl_memdev_unregister, | |
| 1246 | + cxlmd); | |
| 1217 | 1247 | |
| 1218 | −err_add: | |
| 1219 | − ida_free(&cxl_memdev_ida, cxlmd->id); | |
| 1220 | −err_id: | |
| 1248 | +err: | |
| 1221 | 1249 | /* |
| 1222 | − * Theoretically userspace could have already entered the fops, | |
| 1223 | − * so flush ops_active. | |
| 1250 | + * The cdev was briefly live, shutdown any ioctl operations that | |
| 1251 | + * saw that state. | |
| 1224 | 1252 | */ |
| 1225 | − percpu_ref_kill(&cxlmd->ops_active); | |
| 1226 | − wait_for_completion(&cxlmd->ops_dead); | |
| 1227 | − percpu_ref_exit(&cxlmd->ops_active); | |
| 1228 | −err_ref: | |
| 1229 | − kfree(cxlmd); | |
| 1230 | − | |
| 1253 | + cxl_memdev_shutdown(cxlmd); | |
| 1254 | + put_device(dev); | |
| 1231 | 1255 | return rc; |
| 1232 | 1256 | } |
| 1233 | 1257 | |
| @@ -1396,6 +1420,7 @@ out: · 162 unmodified lines | ||
| 1396 | 1420 | */ |
| 1397 | 1421 | static int cxl_mem_identify(struct cxl_mem *cxlm) |
| 1398 | 1422 | { |
| 1423 | + /* See CXL 2.0 Table 175 Identify Memory Device Output Payload */ | |
| 1399 | 1424 | struct cxl_mbox_identify { |
| 1400 | 1425 | char fw_revision[0x10]; |
| 1401 | 1426 | __le64 total_capacity; |
| @@ -1424,10 +1449,11 @@ static int cxl_mem_identify(struct cxl_mem *cxlm) · 22 unmodified lines | ||
| 1424 | 1449 | * For now, only the capacity is exported in sysfs |
| 1425 | 1450 | */ |
| 1426 | 1451 | cxlm->ram_range.start = 0; |
| 1427 | − cxlm->ram_range.end = le64_to_cpu(id.volatile_capacity) - 1; | |
| 1452 | + cxlm->ram_range.end = le64_to_cpu(id.volatile_capacity) * SZ_256M - 1; | |
| 1428 | 1453 | |
| 1429 | 1454 | cxlm->pmem_range.start = 0; |
| 1430 | − cxlm->pmem_range.end = le64_to_cpu(id.persistent_capacity) - 1; | |
| 1455 | + cxlm->pmem_range.end = | |
| 1456 | + le64_to_cpu(id.persistent_capacity) * SZ_256M - 1; | |
| 1431 | 1457 | |
| 1432 | 1458 | memcpy(cxlm->firmware_version, id.fw_revision, sizeof(id.fw_revision)); |
| 1433 | 1459 | |
| @@ -90,13 +90,11 @@ static ssize_t do_id_store(struct device_driver *drv, const char *buf, · 89 unmodified lines | ||
| 90 | 90 | list_add(&dax_id->list, &dax_drv->ids); |
| 91 | 91 | } else |
| 92 | 92 | rc = -ENOMEM; |
| 93 | − } else | |
| 94 | − /* nothing to remove */; | |
| 93 | + } | |
| 95 | 94 | } else if (action == ID_REMOVE) { |
| 96 | 95 | list_del(&dax_id->list); |
| 97 | 96 | kfree(dax_id); |
| 98 | − } else | |
| 99 | − /* dax_id already added */; | |
| 97 | + } | |
| 100 | 98 | mutex_unlock(&dax_bus_lock); |
| 101 | 99 | |
| 102 | 100 | if (rc < 0) |
| @@ -1086,6 +1086,7 @@ static int __dma_async_device_channel_register(struct dma_device *device, · 1085 unmodified lines | ||
| 1086 | 1086 | kfree(chan->dev); |
| 1087 | 1087 | err_free_local: |
| 1088 | 1088 | free_percpu(chan->local); |
| 1089 | + chan->local = NULL; | |
| 1089 | 1090 | return rc; |
| 1090 | 1091 | } |
| 1091 | 1092 | |
| @@ -10,6 +10,7 @@ config DW_DMAC_CORE · 9 unmodified lines | ||
| 10 | 10 | |
| 11 | 11 | config DW_DMAC |
| 12 | 12 | tristate "Synopsys DesignWare AHB DMA platform driver" |
| 13 | + depends on HAS_IOMEM | |
| 13 | 14 | select DW_DMAC_CORE |
| 14 | 15 | help |
| 15 | 16 | Support the Synopsys DesignWare AHB DMA controller. This |
| @@ -18,6 +19,7 @@ config DW_DMAC · 2 unmodified lines | ||
| 18 | 19 | config DW_DMAC_PCI |
| 19 | 20 | tristate "Synopsys DesignWare AHB DMA PCI driver" |
| 20 | 21 | depends on PCI |
| 22 | + depends on HAS_IOMEM | |
| 21 | 23 | select DW_DMAC_CORE |
| 22 | 24 | help |
| 23 | 25 | Support the Synopsys DesignWare AHB DMA controller on the |
| @@ -282,6 +282,22 @@ void idxd_wq_drain(struct idxd_wq *wq) · 281 unmodified lines | ||
| 282 | 282 | idxd_cmd_exec(idxd, IDXD_CMD_DRAIN_WQ, operand, NULL); |
| 283 | 283 | } |
| 284 | 284 | |
| 285 | +void idxd_wq_reset(struct idxd_wq *wq) | |
| 286 | +{ | |
| 287 | + struct idxd_device *idxd = wq->idxd; | |
| 288 | + struct device *dev = &idxd->pdev->dev; | |
| 289 | + u32 operand; | |
| 290 | + | |
| 291 | + if (wq->state != IDXD_WQ_ENABLED) { | |
| 292 | + dev_dbg(dev, "WQ %d in wrong state: %d\n", wq->id, wq->state); | |
| 293 | + return; | |
| 294 | + } | |
| 295 | + | |
| 296 | + operand = BIT(wq->id % 16) | ((wq->id / 16) << 16); | |
| 297 | + idxd_cmd_exec(idxd, IDXD_CMD_RESET_WQ, operand, NULL); | |
| 298 | + wq->state = IDXD_WQ_DISABLED; | |
| 299 | +} | |
| 300 | + | |
| 285 | 301 | int idxd_wq_map_portal(struct idxd_wq *wq) |
| 286 | 302 | { |
| 287 | 303 | struct idxd_device *idxd = wq->idxd; |
| @@ -363,8 +379,6 @@ int idxd_wq_disable_pasid(struct idxd_wq *wq) · 75 unmodified lines | ||
| 363 | 379 | void idxd_wq_disable_cleanup(struct idxd_wq *wq) |
| 364 | 380 | { |
| 365 | 381 | struct idxd_device *idxd = wq->idxd; |
| 366 | − struct device *dev = &idxd->pdev->dev; | |
| 367 | − int i, wq_offset; | |
| 368 | 382 | |
| 369 | 383 | lockdep_assert_held(&idxd->dev_lock); |
| 370 | 384 | memset(wq->wqcfg, 0, idxd->wqcfg_size); |
| @@ -376,14 +390,6 @@ void idxd_wq_disable_cleanup(struct idxd_wq *wq) · 5 unmodified lines | ||
| 376 | 390 | wq->ats_dis = 0; |
| 377 | 391 | clear_bit(WQ_FLAG_DEDICATED, &wq->flags); |
| 378 | 392 | memset(wq->name, 0, WQ_NAME_SIZE); |
| 379 | − | |
| 380 | − for (i = 0; i < WQCFG_STRIDES(idxd); i++) { | |
| 381 | − wq_offset = WQCFG_OFFSET(idxd, wq->id, i); | |
| 382 | − iowrite32(0, idxd->reg_base + wq_offset); | |
| 383 | − dev_dbg(dev, "WQ[%d][%d][%#x]: %#x\n", | |
| 384 | − wq->id, i, wq_offset, | |
| 385 | − ioread32(idxd->reg_base + wq_offset)); | |
| 386 | − } | |
| 387 | 393 | } |
| 388 | 394 | |
| 389 | 395 | /* Device control bits */ |
| @@ -574,6 +580,36 @@ void idxd_device_drain_pasid(struct idxd_device *idxd, int pasid) · 184 unmodified lines | ||
| 574 | 580 | } |
| 575 | 581 | |
| 576 | 582 | /* Device configuration bits */ |
| 583 | +void idxd_msix_perm_setup(struct idxd_device *idxd) | |
| 584 | +{ | |
| 585 | + union msix_perm mperm; | |
| 586 | + int i, msixcnt; | |
| 587 | + | |
| 588 | + msixcnt = pci_msix_vec_count(idxd->pdev); | |
| 589 | + if (msixcnt < 0) | |
| 590 | + return; | |
| 591 | + | |
| 592 | + mperm.bits = 0; | |
| 593 | + mperm.pasid = idxd->pasid; | |
| 594 | + mperm.pasid_en = device_pasid_enabled(idxd); | |
| 595 | + for (i = 1; i < msixcnt; i++) | |
| 596 | + iowrite32(mperm.bits, idxd->reg_base + idxd->msix_perm_offset + i * 8); | |
| 597 | +} | |
| 598 | + | |
| 599 | +void idxd_msix_perm_clear(struct idxd_device *idxd) | |
| 600 | +{ | |
| 601 | + union msix_perm mperm; | |
| 602 | + int i, msixcnt; | |
| 603 | + | |
| 604 | + msixcnt = pci_msix_vec_count(idxd->pdev); | |
| 605 | + if (msixcnt < 0) | |
| 606 | + return; | |
| 607 | + | |
| 608 | + mperm.bits = 0; | |
| 609 | + for (i = 1; i < msixcnt; i++) | |
| 610 | + iowrite32(mperm.bits, idxd->reg_base + idxd->msix_perm_offset + i * 8); | |
| 611 | +} | |
| 612 | + | |
| 577 | 613 | static void idxd_group_config_write(struct idxd_group *group) |
| 578 | 614 | { |
| 579 | 615 | struct idxd_device *idxd = group->idxd; |
| @@ -642,7 +678,14 @@ static int idxd_wq_config_write(struct idxd_wq *wq) · 62 unmodified lines | ||
| 642 | 678 | if (!wq->group) |
| 643 | 679 | return 0; |
| 644 | 680 | |
| 645 | − memset(wq->wqcfg, 0, idxd->wqcfg_size); | |
| 681 | + /* | |
| 682 | + * Instead of memset the entire shadow copy of WQCFG, copy from the hardware after | |
| 683 | + * wq reset. This will copy back the sticky values that are present on some devices. | |
| 684 | + */ | |
| 685 | + for (i = 0; i < WQCFG_STRIDES(idxd); i++) { | |
| 686 | + wq_offset = WQCFG_OFFSET(idxd, wq->id, i); | |
| 687 | + wq->wqcfg->bits[i] = ioread32(idxd->reg_base + wq_offset); | |
| 688 | + } | |
| 646 | 689 | |
| 647 | 690 | /* byte 0-3 */ |
| 648 | 691 | wq->wqcfg->wq_size = wq->size; |
| @@ -316,6 +316,8 @@ void idxd_unregister_driver(void); · 315 unmodified lines | ||
| 316 | 316 | struct bus_type *idxd_get_bus_type(struct idxd_device *idxd); |
| 317 | 317 | |
| 318 | 318 | /* device interrupt control */ |
| 319 | +void idxd_msix_perm_setup(struct idxd_device *idxd); | |
| 320 | +void idxd_msix_perm_clear(struct idxd_device *idxd); | |
| 319 | 321 | irqreturn_t idxd_irq_handler(int vec, void *data); |
| 320 | 322 | irqreturn_t idxd_misc_thread(int vec, void *data); |
| 321 | 323 | irqreturn_t idxd_wq_thread(int irq, void *data); |
| @@ -341,6 +343,7 @@ void idxd_wq_free_resources(struct idxd_wq *wq); · 19 unmodified lines | ||
| 341 | 343 | int idxd_wq_enable(struct idxd_wq *wq); |
| 342 | 344 | int idxd_wq_disable(struct idxd_wq *wq); |
| 343 | 345 | void idxd_wq_drain(struct idxd_wq *wq); |
| 346 | +void idxd_wq_reset(struct idxd_wq *wq); | |
| 344 | 347 | int idxd_wq_map_portal(struct idxd_wq *wq); |
| 345 | 348 | void idxd_wq_unmap_portal(struct idxd_wq *wq); |
| 346 | 349 | void idxd_wq_disable_cleanup(struct idxd_wq *wq); |
| @@ -65,7 +65,6 @@ static int idxd_setup_interrupts(struct idxd_device *idxd) · 64 unmodified lines | ||
| 65 | 65 | struct idxd_irq_entry *irq_entry; |
| 66 | 66 | int i, msixcnt; |
| 67 | 67 | int rc = 0; |
| 68 | − union msix_perm mperm; | |
| 69 | 68 | |
| 70 | 69 | msixcnt = pci_msix_vec_count(pdev); |
| 71 | 70 | if (msixcnt < 0) { |
| @@ -144,14 +143,7 @@ static int idxd_setup_interrupts(struct idxd_device *idxd) · 72 unmodified lines | ||
| 144 | 143 | } |
| 145 | 144 | |
| 146 | 145 | idxd_unmask_error_interrupts(idxd); |
| 147 | − | |
| 148 | − /* Setup MSIX permission table */ | |
| 149 | − mperm.bits = 0; | |
| 150 | − mperm.pasid = idxd->pasid; | |
| 151 | − mperm.pasid_en = device_pasid_enabled(idxd); | |
| 152 | − for (i = 1; i < msixcnt; i++) | |
| 153 | − iowrite32(mperm.bits, idxd->reg_base + idxd->msix_perm_offset + i * 8); | |
| 154 | − | |
| 146 | + idxd_msix_perm_setup(idxd); | |
| 155 | 147 | return 0; |
| 156 | 148 | |
| 157 | 149 | err_no_irq: |
| @@ -510,6 +502,7 @@ static void idxd_shutdown(struct pci_dev *pdev) · 352 unmodified lines | ||
| 510 | 502 | idxd_flush_work_list(irq_entry); |
| 511 | 503 | } |
| 512 | 504 | |
| 505 | + idxd_msix_perm_clear(idxd); | |
| 513 | 506 | destroy_workqueue(idxd->wq); |
| 514 | 507 | } |
| 515 | 508 | |
| @@ -124,7 +124,9 @@ static int process_misc_interrupts(struct idxd_device *idxd, u32 cause) · 123 unmodified lines | ||
| 124 | 124 | for (i = 0; i < 4; i++) |
| 125 | 125 | idxd->sw_err.bits[i] = ioread64(idxd->reg_base + |
| 126 | 126 | IDXD_SWERR_OFFSET + i * sizeof(u64)); |
| 127 | − iowrite64(IDXD_SWERR_ACK, idxd->reg_base + IDXD_SWERR_OFFSET); | |
| 127 | + | |
| 128 | + iowrite64(idxd->sw_err.bits[0] & IDXD_SWERR_ACK, | |
| 129 | + idxd->reg_base + IDXD_SWERR_OFFSET); | |
| 128 | 130 | |
| 129 | 131 | if (idxd->sw_err.valid && idxd->sw_err.wq_idx_valid) { |
| 130 | 132 | int id = idxd->sw_err.wq_idx; |
| @@ -275,7 +275,6 @@ static void disable_wq(struct idxd_wq *wq) · 274 unmodified lines | ||
| 275 | 275 | { |
| 276 | 276 | struct idxd_device *idxd = wq->idxd; |
| 277 | 277 | struct device *dev = &idxd->pdev->dev; |
| 278 | − int rc; | |
| 279 | 278 | |
| 280 | 279 | mutex_lock(&wq->wq_lock); |
| 281 | 280 | dev_dbg(dev, "%s removing WQ %s\n", __func__, dev_name(&wq->conf_dev)); |
| @@ -296,17 +295,13 @@ static void disable_wq(struct idxd_wq *wq) · 14 unmodified lines | ||
| 296 | 295 | idxd_wq_unmap_portal(wq); |
| 297 | 296 | |
| 298 | 297 | idxd_wq_drain(wq); |
| 299 | − rc = idxd_wq_disable(wq); | |
| 298 | + idxd_wq_reset(wq); | |
| 300 | 299 | |
| 301 | 300 | idxd_wq_free_resources(wq); |
| 302 | 301 | wq->client_count = 0; |
| 303 | 302 | mutex_unlock(&wq->wq_lock); |
| 304 | 303 | |
| 305 | − if (rc < 0) | |
| 306 | − dev_warn(dev, "Failed to disable %s: %d\n", | |
| 307 | − dev_name(&wq->conf_dev), rc); | |
| 308 | − else | |
| 309 | − dev_info(dev, "wq %s disabled\n", dev_name(&wq->conf_dev)); | |
| 304 | + dev_info(dev, "wq %s disabled\n", dev_name(&wq->conf_dev)); | |
| 310 | 305 | } |
| 311 | 306 | |
| 312 | 307 | static int idxd_config_bus_remove(struct device *dev) |
| @@ -989,7 +984,7 @@ static ssize_t wq_size_store(struct device *dev, · 676 unmodified lines | ||
| 989 | 984 | if (!test_bit(IDXD_FLAG_CONFIGURABLE, &idxd->flags)) |
| 990 | 985 | return -EPERM; |
| 991 | 986 | |
| 992 | − if (wq->state != IDXD_WQ_DISABLED) | |
| 987 | + if (idxd->state == IDXD_DEV_ENABLED) | |
| 993 | 988 | return -EPERM; |
| 994 | 989 | |
| 995 | 990 | if (size + total_claimed_wq_size(idxd) - wq->size > idxd->max_wq_size) |
| @@ -1449,8 +1444,14 @@ static ssize_t op_cap_show(struct device *dev, · 453 unmodified lines | ||
| 1449 | 1444 | { |
| 1450 | 1445 | struct idxd_device *idxd = |
| 1451 | 1446 | container_of(dev, struct idxd_device, conf_dev); |
| 1447 | + int i, rc = 0; | |
| 1448 | + | |
| 1449 | + for (i = 0; i < 4; i++) | |
| 1450 | + rc += sysfs_emit_at(buf, rc, "%#llx ", idxd->hw.opcap.bits[i]); | |
| 1452 | 1451 | |
| 1453 | − return sprintf(buf, "%#llx\n", idxd->hw.opcap.bits[0]); | |
| 1452 | + rc--; | |
| 1453 | + rc += sysfs_emit_at(buf, rc, "\n"); | |
| 1454 | + return rc; | |
| 1454 | 1455 | } |
| 1455 | 1456 | static DEVICE_ATTR_RO(op_cap); |
| 1456 | 1457 | |
| @@ -507,10 +507,8 @@ static int plx_dma_create(struct pci_dev *pdev) · 506 unmodified lines | ||
| 507 | 507 | |
| 508 | 508 | rc = request_irq(pci_irq_vector(pdev, 0), plx_dma_isr, 0, |
| 509 | 509 | KBUILD_MODNAME, plxdev); |
| 510 | − if (rc) { | |
| 511 | − kfree(plxdev); | |
| 512 | − return rc; | |
| 513 | − } | |
| 510 | + if (rc) | |
| 511 | + goto free_plx; | |
| 514 | 512 | |
| 515 | 513 | spin_lock_init(&plxdev->ring_lock); |
| 516 | 514 | tasklet_setup(&plxdev->desc_task, plx_dma_desc_task); |
| @@ -540,14 +538,20 @@ static int plx_dma_create(struct pci_dev *pdev) · 23 unmodified lines | ||
| 540 | 538 | rc = dma_async_device_register(dma); |
| 541 | 539 | if (rc) { |
| 542 | 540 | pci_err(pdev, "Failed to register dma device: %d\n", rc); |
| 543 | − free_irq(pci_irq_vector(pdev, 0), plxdev); | |
| 544 | − kfree(plxdev); | |
| 545 | − return rc; | |
| 541 | + goto put_device; | |
| 546 | 542 | } |
| 547 | 543 | |
| 548 | 544 | pci_set_drvdata(pdev, plxdev); |
| 549 | 545 | |
| 550 | 546 | return 0; |
| 547 | + | |
| 548 | +put_device: | |
| 549 | + put_device(&pdev->dev); | |
| 550 | + free_irq(pci_irq_vector(pdev, 0), plxdev); | |
| 551 | +free_plx: | |
| 552 | + kfree(plxdev); | |
| 553 | + | |
| 554 | + return rc; | |
| 551 | 555 | } |
| 552 | 556 | |
| 553 | 557 | static int plx_dma_probe(struct pci_dev *pdev, |
| @@ -723,7 +723,7 @@ static void tegra_dma_issue_pending(struct dma_chan *dc) · 722 unmodified lines | ||
| 723 | 723 | goto end; |
| 724 | 724 | } |
| 725 | 725 | if (!tdc->busy) { |
| 726 | − err = pm_runtime_get_sync(tdc->tdma->dev); | |
| 726 | + err = pm_runtime_resume_and_get(tdc->tdma->dev); | |
| 727 | 727 | if (err < 0) { |
| 728 | 728 | dev_err(tdc2dev(tdc), "Failed to enable DMA\n"); |
| 729 | 729 | goto end; |
| @@ -818,7 +818,7 @@ static void tegra_dma_synchronize(struct dma_chan *dc) · 88 unmodified lines | ||
| 818 | 818 | struct tegra_dma_channel *tdc = to_tegra_dma_chan(dc); |
| 819 | 819 | int err; |
| 820 | 820 | |
| 821 | − err = pm_runtime_get_sync(tdc->tdma->dev); | |
| 821 | + err = pm_runtime_resume_and_get(tdc->tdma->dev); | |
| 822 | 822 | if (err < 0) { |
| 823 | 823 | dev_err(tdc2dev(tdc), "Failed to synchronize DMA: %d\n", err); |
| 824 | 824 | return; |
| @@ -839,6 +839,7 @@ static void xilinx_dpdma_chan_queue_transfer(struct xilinx_dpdma_chan *chan) · 838 unmodified lines | ||
| 839 | 839 | struct xilinx_dpdma_tx_desc *desc; |
| 840 | 840 | struct virt_dma_desc *vdesc; |
| 841 | 841 | u32 reg, channels; |
| 842 | + bool first_frame; | |
| 842 | 843 | |
| 843 | 844 | lockdep_assert_held(&chan->lock); |
| 844 | 845 | |
| @@ -852,14 +853,6 @@ static void xilinx_dpdma_chan_queue_transfer(struct xilinx_dpdma_chan *chan) · 7 unmodified lines | ||
| 852 | 853 | chan->running = true; |
| 853 | 854 | } |
| 854 | 855 | |
| 855 | − if (chan->video_group) | |
| 856 | − channels = xilinx_dpdma_chan_video_group_ready(chan); | |
| 857 | − else | |
| 858 | − channels = BIT(chan->id); | |
| 859 | − | |
| 860 | − if (!channels) | |
| 861 | − return; | |
| 862 | − | |
| 863 | 856 | vdesc = vchan_next_desc(&chan->vchan); |
| 864 | 857 | if (!vdesc) |
| 865 | 858 | return; |
| @@ -884,13 +877,26 @@ static void xilinx_dpdma_chan_queue_transfer(struct xilinx_dpdma_chan *chan) · 18 unmodified lines | ||
| 884 | 877 | FIELD_PREP(XILINX_DPDMA_CH_DESC_START_ADDRE_MASK, |
| 885 | 878 | upper_32_bits(sw_desc->dma_addr))); |
| 886 | 879 | |
| 887 | − if (chan->first_frame) | |
| 880 | + first_frame = chan->first_frame; | |
| 881 | + chan->first_frame = false; | |
| 882 | + | |
| 883 | + if (chan->video_group) { | |
| 884 | + channels = xilinx_dpdma_chan_video_group_ready(chan); | |
| 885 | + /* | |
| 886 | + * Trigger the transfer only when all channels in the group are | |
| 887 | + * ready. | |
| 888 | + */ | |
| 889 | + if (!channels) | |
| 890 | + return; | |
| 891 | + } else { | |
| 892 | + channels = BIT(chan->id); | |
| 893 | + } | |
| 894 | + | |
| 895 | + if (first_frame) | |
| 888 | 896 | reg = XILINX_DPDMA_GBL_TRIG_MASK(channels); |
| 889 | 897 | else |
| 890 | 898 | reg = XILINX_DPDMA_GBL_RETRIG_MASK(channels); |
| 891 | 899 | |
| 892 | − chan->first_frame = false; | |
| 893 | − | |
| 894 | 900 | dpdma_write(xdev->reg, XILINX_DPDMA_GBL, reg); |
| 895 | 901 | } |
| 896 | 902 | |
| @@ -1042,13 +1048,14 @@ static int xilinx_dpdma_chan_stop(struct xilinx_dpdma_chan *chan) · 145 unmodified lines | ||
| 1042 | 1048 | */ |
| 1043 | 1049 | static void xilinx_dpdma_chan_done_irq(struct xilinx_dpdma_chan *chan) |
| 1044 | 1050 | { |
| 1045 | − struct xilinx_dpdma_tx_desc *active = chan->desc.active; | |
| 1051 | + struct xilinx_dpdma_tx_desc *active; | |
| 1046 | 1052 | unsigned long flags; |
| 1047 | 1053 | |
| 1048 | 1054 | spin_lock_irqsave(&chan->lock, flags); |
| 1049 | 1055 | |
| 1050 | 1056 | xilinx_dpdma_debugfs_desc_done_irq(chan); |
| 1051 | 1057 | |
| 1058 | + active = chan->desc.active; | |
| 1052 | 1059 | if (active) |
| 1053 | 1060 | vchan_cyclic_callback(&active->vdesc); |
| 1054 | 1061 | else |
| @@ -1241,6 +1241,7 @@ int extcon_dev_register(struct extcon_dev *edev) · 1240 unmodified lines | ||
| 1241 | 1241 | sizeof(*edev->nh), GFP_KERNEL); |
| 1242 | 1242 | if (!edev->nh) { |
| 1243 | 1243 | ret = -ENOMEM; |
| 1244 | + device_unregister(&edev->dev); | |
| 1244 | 1245 | goto err_dev; |
| 1245 | 1246 | } |
| 1246 | 1247 | |
| @@ -346,6 +346,7 @@ nosy_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 345 unmodified lines | ||
| 346 | 346 | struct client *client = file->private_data; |
| 347 | 347 | spinlock_t *client_list_lock = &client->lynx->client_list_lock; |
| 348 | 348 | struct nosy_stats stats; |
| 349 | + int ret; | |
| 349 | 350 | |
| 350 | 351 | switch (cmd) { |
| 351 | 352 | case NOSY_IOC_GET_STATS: |
| @@ -360,11 +361,15 @@ nosy_ioctl(struct file *file, unsigned int cmd, unsigned long arg) · 8 unmodified lines | ||
| 360 | 361 | return 0; |
| 361 | 362 | |
| 362 | 363 | case NOSY_IOC_START: |
| 364 | + ret = -EBUSY; | |
| 363 | 365 | spin_lock_irq(client_list_lock); |
| 364 | − list_add_tail(&client->link, &client->lynx->client_list); | |
| 366 | + if (list_empty(&client->link)) { | |
| 367 | + list_add_tail(&client->link, &client->lynx->client_list); | |
| 368 | + ret = 0; | |
| 369 | + } | |
| 365 | 370 | spin_unlock_irq(client_list_lock); |
| 366 | 371 | |
| 367 | − return 0; | |
| 372 | + return ret; | |
| 368 | 373 | |
| 369 | 374 | case NOSY_IOC_STOP: |
| 370 | 375 | spin_lock_irq(client_list_lock); |
| @@ -927,7 +927,7 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size) · 926 unmodified lines | ||
| 927 | 927 | } |
| 928 | 928 | |
| 929 | 929 | /* first try to find a slot in an existing linked list entry */ |
| 930 | − for (prsv = efi_memreserve_root->next; prsv; prsv = rsv->next) { | |
| 930 | + for (prsv = efi_memreserve_root->next; prsv; ) { | |
| 931 | 931 | rsv = memremap(prsv, sizeof(*rsv), MEMREMAP_WB); |
| 932 | 932 | index = atomic_fetch_add_unless(&rsv->count, 1, rsv->size); |
| 933 | 933 | if (index < rsv->size) { |
| @@ -937,6 +937,7 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size) · 3 unmodified lines | ||
| 937 | 937 | memunmap(rsv); |
| 938 | 938 | return efi_mem_reserve_iomem(addr, size); |
| 939 | 939 | } |
| 940 | + prsv = rsv->next; | |
| 940 | 941 | memunmap(rsv); |
| 941 | 942 | } |
| 942 | 943 | |
| @@ -24,7 +24,7 @@ efi_status_t check_platform_features(void) · 23 unmodified lines | ||
| 24 | 24 | return EFI_SUCCESS; |
| 25 | 25 | |
| 26 | 26 | tg = (read_cpuid(ID_AA64MMFR0_EL1) >> ID_AA64MMFR0_TGRAN_SHIFT) & 0xf; |
| 27 | − if (tg != ID_AA64MMFR0_TGRAN_SUPPORTED) { | |
| 27 | + if (tg < ID_AA64MMFR0_TGRAN_SUPPORTED_MIN || tg > ID_AA64MMFR0_TGRAN_SUPPORTED_MAX) { | |
| 28 | 28 | if (IS_ENABLED(CONFIG_ARM64_64K_PAGES)) |
| 29 | 29 | efi_err("This 64 KB granular kernel is not supported by your CPU\n"); |
| 30 | 30 | else |
| @@ -96,6 +96,18 @@ static void install_memreserve_table(void) · 95 unmodified lines | ||
| 96 | 96 | efi_err("Failed to install memreserve config table!\n"); |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | +static u32 get_supported_rt_services(void) | |
| 100 | +{ | |
| 101 | + const efi_rt_properties_table_t *rt_prop_table; | |
| 102 | + u32 supported = EFI_RT_SUPPORTED_ALL; | |
| 103 | + | |
| 104 | + rt_prop_table = get_efi_config_table(EFI_RT_PROPERTIES_TABLE_GUID); | |
| 105 | + if (rt_prop_table) | |
| 106 | + supported &= rt_prop_table->runtime_services_supported; | |
| 107 | + | |
| 108 | + return supported; | |
| 109 | +} | |
| 110 | + | |
| 99 | 111 | /* |
| 100 | 112 | * EFI entry point for the arm/arm64 EFI stubs. This is the entrypoint |
| 101 | 113 | * that is described in the PE/COFF header. Most of the code is the same |
| @@ -250,6 +262,10 @@ efi_status_t __efiapi efi_pe_entry(efi_handle_t handle, · 148 unmodified lines | ||
| 250 | 262 | (prop_tbl->memory_protection_attribute & |
| 251 | 263 | EFI_PROPERTIES_RUNTIME_MEMORY_PROTECTION_NON_EXECUTABLE_PE_DATA); |
| 252 | 264 | |
| 265 | + /* force efi_novamap if SetVirtualAddressMap() is unsupported */ | |
| 266 | + efi_novamap |= !(get_supported_rt_services() & | |
| 267 | + EFI_RT_SUPPORTED_SET_VIRTUAL_ADDRESS_MAP); | |
| 268 | + | |
| 253 | 269 | /* hibernation expects the runtime regions to stay in the same place */ |
| 254 | 270 | if (!IS_ENABLED(CONFIG_HIBERNATION) && !efi_nokaslr && !flat_va_mapping) { |
| 255 | 271 | /* |
| @@ -484,6 +484,10 @@ int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *), · 483 unmodified lines | ||
| 484 | 484 | } |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | + break; | |
| 488 | + case EFI_UNSUPPORTED: | |
| 489 | + err = -EOPNOTSUPP; | |
| 490 | + status = EFI_NOT_FOUND; | |
| 487 | 491 | break; |
| 488 | 492 | case EFI_NOT_FOUND: |
| 489 | 493 | break; |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | /* |
| 3 | 3 | * Turris Mox rWTM firmware driver |
| 4 | 4 | * |
| 5 | − * Copyright (C) 2019 Marek Behun <marek.behun@nic.cz> | |
| 5 | + * Copyright (C) 2019 Marek Behún <kabel@kernel.org> | |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | #include <linux/armada-37xx-rwtm-mailbox.h> |
| @@ -547,4 +547,4 @@ module_platform_driver(turris_mox_rwtm_driver); · 538 unmodified lines | ||
| 547 | 547 | |
| 548 | 548 | MODULE_LICENSE("GPL v2"); |
| 549 | 549 | MODULE_DESCRIPTION("Turris Mox rWTM firmware driver"); |
| 550 | −MODULE_AUTHOR("Marek Behun <marek.behun@nic.cz>"); | |
| 550 | +MODULE_AUTHOR("Marek Behun <kabel@kernel.org>"); | |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | /* |
| 3 | 3 | * Turris Mox Moxtet GPIO expander |
| 4 | 4 | * |
| 5 | − * Copyright (C) 2018 Marek Behun <marek.behun@nic.cz> | |
| 5 | + * Copyright (C) 2018 Marek Behún <kabel@kernel.org> | |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | #include <linux/bitops.h> |
| @@ -174,6 +174,6 @@ static struct moxtet_driver moxtet_gpio_driver = { · 165 unmodified lines | ||
| 174 | 174 | }; |
| 175 | 175 | module_moxtet_driver(moxtet_gpio_driver); |
| 176 | 176 | |
| 177 | −MODULE_AUTHOR("Marek Behun <marek.behun@nic.cz>"); | |
| 177 | +MODULE_AUTHOR("Marek Behun <kabel@kernel.org>"); | |
| 178 | 178 | MODULE_DESCRIPTION("Turris Mox Moxtet GPIO expander"); |
| 179 | 179 | MODULE_LICENSE("GPL v2"); |
| @@ -113,8 +113,29 @@ MODULE_DEVICE_TABLE(i2c, pca953x_id); · 112 unmodified lines | ||
| 113 | 113 | #ifdef CONFIG_GPIO_PCA953X_IRQ |
| 114 | 114 | |
| 115 | 115 | #include <linux/dmi.h> |
| 116 | −#include <linux/gpio.h> | |
| 117 | −#include <linux/list.h> | |
| 116 | + | |
| 117 | +static const struct acpi_gpio_params pca953x_irq_gpios = { 0, 0, true }; | |
| 118 | + | |
| 119 | +static const struct acpi_gpio_mapping pca953x_acpi_irq_gpios[] = { | |
| 120 | + { "irq-gpios", &pca953x_irq_gpios, 1, ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER }, | |
| 121 | + { } | |
| 122 | +}; | |
| 123 | + | |
| 124 | +static int pca953x_acpi_get_irq(struct device *dev) | |
| 125 | +{ | |
| 126 | + int ret; | |
| 127 | + | |
| 128 | + ret = devm_acpi_dev_add_driver_gpios(dev, pca953x_acpi_irq_gpios); | |
| 129 | + if (ret) | |
| 130 | + dev_warn(dev, "can't add GPIO ACPI mapping\n"); | |
| 131 | + | |
| 132 | + ret = acpi_dev_gpio_irq_get_by(ACPI_COMPANION(dev), "irq-gpios", 0); | |
| 133 | + if (ret < 0) | |
| 134 | + return ret; | |
| 135 | + | |
| 136 | + dev_info(dev, "ACPI interrupt quirk (IRQ %d)\n", ret); | |
| 137 | + return ret; | |
| 138 | +} | |
| 118 | 139 | |
| 119 | 140 | static const struct dmi_system_id pca953x_dmi_acpi_irq_info[] = { |
| 120 | 141 | { |
| @@ -133,59 +154,6 @@ static const struct dmi_system_id pca953x_dmi_acpi_irq_info[] = { · 12 unmodified lines | ||
| 133 | 154 | }, |
| 134 | 155 | {} |
| 135 | 156 | }; |
| 136 | − | |
| 137 | −#ifdef CONFIG_ACPI | |
| 138 | −static int pca953x_acpi_get_pin(struct acpi_resource *ares, void *data) | |
| 139 | −{ | |
| 140 | − struct acpi_resource_gpio *agpio; | |
| 141 | − int *pin = data; | |
| 142 | − | |
| 143 | − if (acpi_gpio_get_irq_resource(ares, &agpio)) | |
| 144 | − *pin = agpio->pin_table[0]; | |
| 145 | − return 1; | |
| 146 | −} | |
| 147 | − | |
| 148 | −static int pca953x_acpi_find_pin(struct device *dev) | |
| 149 | −{ | |
| 150 | − struct acpi_device *adev = ACPI_COMPANION(dev); | |
| 151 | − int pin = -ENOENT, ret; | |
| 152 | − LIST_HEAD(r); | |
| 153 | − | |
| 154 | − ret = acpi_dev_get_resources(adev, &r, pca953x_acpi_get_pin, &pin); | |
| 155 | − acpi_dev_free_resource_list(&r); | |
| 156 | − if (ret < 0) | |
| 157 | − return ret; | |
| 158 | − | |
| 159 | − return pin; | |
| 160 | −} | |
| 161 | −#else | |
| 162 | −static inline int pca953x_acpi_find_pin(struct device *dev) { return -ENXIO; } | |
| 163 | −#endif | |
| 164 | − | |
| 165 | −static int pca953x_acpi_get_irq(struct device *dev) | |
| 166 | −{ | |
| 167 | − int pin, ret; | |
| 168 | − | |
| 169 | − pin = pca953x_acpi_find_pin(dev); | |
| 170 | − if (pin < 0) | |
| 171 | − return pin; | |
| 172 | − | |
| 173 | − dev_info(dev, "Applying ACPI interrupt quirk (GPIO %d)\n", pin); | |
| 174 | − | |
| 175 | − if (!gpio_is_valid(pin)) | |
| 176 | − return -EINVAL; | |
| 177 | − | |
| 178 | − ret = gpio_request(pin, "pca953x interrupt"); | |
| 179 | − if (ret) | |
| 180 | − return ret; | |
| 181 | − | |
| 182 | − ret = gpio_to_irq(pin); | |
| 183 | − | |
| 184 | − /* When pin is used as an IRQ, no need to keep it requested */ | |
| 185 | − gpio_free(pin); | |
| 186 | − | |
| 187 | − return ret; | |
| 188 | −} | |
| 189 | 157 | #endif |
| 190 | 158 | |
| 191 | 159 | static const struct acpi_device_id pca953x_acpi_ids[] = { |
| @@ -174,7 +174,7 @@ static void acpi_gpiochip_request_irq(struct acpi_gpio_chip *acpi_gpio, · 173 unmodified lines | ||
| 174 | 174 | int ret, value; |
| 175 | 175 | |
| 176 | 176 | ret = request_threaded_irq(event->irq, NULL, event->handler, |
| 177 | − event->irqflags, "ACPI:Event", event); | |
| 177 | + event->irqflags | IRQF_ONESHOT, "ACPI:Event", event); | |
| 178 | 178 | if (ret) { |
| 179 | 179 | dev_err(acpi_gpio->chip->parent, |
| 180 | 180 | "Failed to setup interrupt handler for %d\n", |
| @@ -677,6 +677,7 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data) · 496 unmodified lines | ||
| 677 | 677 | if (!lookup->desc) { |
| 678 | 678 | const struct acpi_resource_gpio *agpio = &ares->data.gpio; |
| 679 | 679 | bool gpioint = agpio->connection_type == ACPI_RESOURCE_GPIO_TYPE_INT; |
| 680 | + struct gpio_desc *desc; | |
| 680 | 681 | u16 pin_index; |
| 681 | 682 | |
| 682 | 683 | if (lookup->info.quirks & ACPI_GPIO_QUIRK_ONLY_GPIOIO && gpioint) |
| @@ -689,8 +690,12 @@ static int acpi_populate_gpio_lookup(struct acpi_resource *ares, void *data) · 6 unmodified lines | ||
| 689 | 690 | if (pin_index >= agpio->pin_table_length) |
| 690 | 691 | return 1; |
| 691 | 692 | |
| 692 | − lookup->desc = acpi_get_gpiod(agpio->resource_source.string_ptr, | |
| 693 | + if (lookup->info.quirks & ACPI_GPIO_QUIRK_ABSOLUTE_NUMBER) | |
| 694 | + desc = gpio_to_desc(agpio->pin_table[pin_index]); | |
| 695 | + else | |
| 696 | + desc = acpi_get_gpiod(agpio->resource_source.string_ptr, | |
| 693 | 697 | agpio->pin_table[pin_index]); |
| 698 | + lookup->desc = desc; | |
| 694 | 699 | lookup->info.pin_config = agpio->pin_config; |
| 695 | 700 | lookup->info.debounce = agpio->debounce_timeout; |
| 696 | 701 | lookup->info.gpioint = gpioint; |
| @@ -940,8 +945,9 @@ struct gpio_desc *acpi_node_get_gpiod(struct fwnode_handle *fwnode, · 243 unmodified lines | ||
| 940 | 945 | } |
| 941 | 946 | |
| 942 | 947 | /** |
| 943 | − * acpi_dev_gpio_irq_get() - Find GpioInt and translate it to Linux IRQ number | |
| 948 | + * acpi_dev_gpio_irq_get_by() - Find GpioInt and translate it to Linux IRQ number | |
| 944 | 949 | * @adev: pointer to a ACPI device to get IRQ from |
| 950 | + * @name: optional name of GpioInt resource | |
| 945 | 951 | * @index: index of GpioInt resource (starting from %0) |
| 946 | 952 | * |
| 947 | 953 | * If the device has one or more GpioInt resources, this function can be |
| @@ -951,9 +957,12 @@ struct gpio_desc *acpi_node_get_gpiod(struct fwnode_handle *fwnode, · 3 unmodified lines | ||
| 951 | 957 | * The function is idempotent, though each time it runs it will configure GPIO |
| 952 | 958 | * pin direction according to the flags in GpioInt resource. |
| 953 | 959 | * |
| 960 | + * The function takes optional @name parameter. If the resource has a property | |
| 961 | + * name, then only those will be taken into account. | |
| 962 | + * | |
| 954 | 963 | * Return: Linux IRQ number (> %0) on success, negative errno on failure. |
| 955 | 964 | */ |
| 956 | −int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index) | |
| 965 | +int acpi_dev_gpio_irq_get_by(struct acpi_device *adev, const char *name, int index) | |
| 957 | 966 | { |
| 958 | 967 | int idx, i; |
| 959 | 968 | unsigned int irq_flags; |
| @@ -963,7 +972,7 @@ int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index) · 3 unmodified lines | ||
| 963 | 972 | struct acpi_gpio_info info; |
| 964 | 973 | struct gpio_desc *desc; |
| 965 | 974 | |
| 966 | − desc = acpi_get_gpiod_by_index(adev, NULL, i, &info); | |
| 975 | + desc = acpi_get_gpiod_by_index(adev, name, i, &info); | |
| 967 | 976 | |
| 968 | 977 | /* Ignore -EPROBE_DEFER, it only matters if idx matches */ |
| 969 | 978 | if (IS_ERR(desc) && PTR_ERR(desc) != -EPROBE_DEFER) |
| @@ -1008,7 +1017,7 @@ int acpi_dev_gpio_irq_get(struct acpi_device *adev, int index) · 38 unmodified lines | ||
| 1008 | 1017 | } |
| 1009 | 1018 | return -ENOENT; |
| 1010 | 1019 | } |
| 1011 | −EXPORT_SYMBOL_GPL(acpi_dev_gpio_irq_get); | |
| 1020 | +EXPORT_SYMBOL_GPL(acpi_dev_gpio_irq_get_by); | |
| 1012 | 1021 | |
| 1013 | 1022 | static acpi_status |
| 1014 | 1023 | acpi_gpio_adr_space_handler(u32 function, acpi_physical_address address, |
| @@ -458,6 +458,8 @@ static ssize_t export_store(struct class *class, · 457 unmodified lines | ||
| 458 | 458 | long gpio; |
| 459 | 459 | struct gpio_desc *desc; |
| 460 | 460 | int status; |
| 461 | + struct gpio_chip *gc; | |
| 462 | + int offset; | |
| 461 | 463 | |
| 462 | 464 | status = kstrtol(buf, 0, &gpio); |
| 463 | 465 | if (status < 0) |
| @@ -469,6 +471,12 @@ static ssize_t export_store(struct class *class, · 5 unmodified lines | ||
| 469 | 471 | pr_warn("%s: invalid GPIO %ld\n", __func__, gpio); |
| 470 | 472 | return -EINVAL; |
| 471 | 473 | } |
| 474 | + gc = desc->gdev->chip; | |
| 475 | + offset = gpio_chip_hwgpio(desc); | |
| 476 | + if (!gpiochip_line_is_valid(gc, offset)) { | |
| 477 | + pr_warn("%s: GPIO %ld masked\n", __func__, gpio); | |
| 478 | + return -EINVAL; | |
| 479 | + } | |
| 472 | 480 | |
| 473 | 481 | /* No extra locking here; FLAG_SYSFS just signifies that the |
| 474 | 482 | * request and export were done by on behalf of userspace, so |
| @@ -367,22 +367,18 @@ static int gpiochip_set_desc_names(struct gpio_chip *gc) · 366 unmodified lines | ||
| 367 | 367 | * |
| 368 | 368 | * Looks for device property "gpio-line-names" and if it exists assigns |
| 369 | 369 | * GPIO line names for the chip. The memory allocated for the assigned |
| 370 | − * names belong to the underlying software node and should not be released | |
| 370 | + * names belong to the underlying firmware node and should not be released | |
| 371 | 371 | * by the caller. |
| 372 | 372 | */ |
| 373 | 373 | static int devprop_gpiochip_set_names(struct gpio_chip *chip) |
| 374 | 374 | { |
| 375 | 375 | struct gpio_device *gdev = chip->gpiodev; |
| 376 | − struct device *dev = chip->parent; | |
| 376 | + struct fwnode_handle *fwnode = dev_fwnode(&gdev->dev); | |
| 377 | 377 | const char **names; |
| 378 | 378 | int ret, i; |
| 379 | 379 | int count; |
| 380 | 380 | |
| 381 | − /* GPIO chip may not have a parent device whose properties we inspect. */ | |
| 382 | − if (!dev) | |
| 383 | − return 0; | |
| 384 | − | |
| 385 | − count = device_property_string_array_count(dev, "gpio-line-names"); | |
| 381 | + count = fwnode_property_string_array_count(fwnode, "gpio-line-names"); | |
| 386 | 382 | if (count < 0) |
| 387 | 383 | return 0; |
| 388 | 384 | |
| @@ -396,7 +392,7 @@ static int devprop_gpiochip_set_names(struct gpio_chip *chip) · 7 unmodified lines | ||
| 396 | 392 | if (!names) |
| 397 | 393 | return -ENOMEM; |
| 398 | 394 | |
| 399 | − ret = device_property_read_string_array(dev, "gpio-line-names", | |
| 395 | + ret = fwnode_property_read_string_array(fwnode, "gpio-line-names", | |
| 400 | 396 | names, count); |
| 401 | 397 | if (ret < 0) { |
| 402 | 398 | dev_warn(&gdev->dev, "failed to read GPIO line names\n"); |
| @@ -474,9 +470,13 @@ EXPORT_SYMBOL_GPL(gpiochip_line_is_valid); · 71 unmodified lines | ||
| 474 | 470 | |
| 475 | 471 | static void gpiodevice_release(struct device *dev) |
| 476 | 472 | { |
| 477 | − struct gpio_device *gdev = dev_get_drvdata(dev); | |
| 473 | + struct gpio_device *gdev = container_of(dev, struct gpio_device, dev); | |
| 474 | + unsigned long flags; | |
| 478 | 475 | |
| 476 | + spin_lock_irqsave(&gpio_lock, flags); | |
| 479 | 477 | list_del(&gdev->list); |
| 478 | + spin_unlock_irqrestore(&gpio_lock, flags); | |
| 479 | + | |
| 480 | 480 | ida_free(&gpio_ida, gdev->id); |
| 481 | 481 | kfree_const(gdev->label); |
| 482 | 482 | kfree(gdev->descs); |
| @@ -571,6 +571,7 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 88 unmodified lines | ||
| 571 | 571 | struct lock_class_key *lock_key, |
| 572 | 572 | struct lock_class_key *request_key) |
| 573 | 573 | { |
| 574 | + struct fwnode_handle *fwnode = gc->parent ? dev_fwnode(gc->parent) : NULL; | |
| 574 | 575 | unsigned long flags; |
| 575 | 576 | int ret = 0; |
| 576 | 577 | unsigned i; |
| @@ -594,6 +595,12 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 17 unmodified lines | ||
| 594 | 595 | |
| 595 | 596 | of_gpio_dev_init(gc, gdev); |
| 596 | 597 | |
| 598 | + /* | |
| 599 | + * Assign fwnode depending on the result of the previous calls, | |
| 600 | + * if none of them succeed, assign it to the parent's one. | |
| 601 | + */ | |
| 602 | + gdev->dev.fwnode = dev_fwnode(&gdev->dev) ?: fwnode; | |
| 603 | + | |
| 597 | 604 | gdev->id = ida_alloc(&gpio_ida, GFP_KERNEL); |
| 598 | 605 | if (gdev->id < 0) { |
| 599 | 606 | ret = gdev->id; |
| @@ -605,7 +612,6 @@ int gpiochip_add_data_with_key(struct gpio_chip *gc, void *data, · 5 unmodified lines | ||
| 605 | 612 | goto err_free_ida; |
| 606 | 613 | |
| 607 | 614 | device_initialize(&gdev->dev); |
| 608 | − dev_set_drvdata(&gdev->dev, gdev); | |
| 609 | 615 | if (gc->parent && gc->parent->driver) |
| 610 | 616 | gdev->owner = gc->parent->driver->owner; |
| 611 | 617 | else if (gc->owner) |
| @@ -4257,7 +4263,8 @@ static int __init gpiolib_dev_init(void) · 3645 unmodified lines | ||
| 4257 | 4263 | return ret; |
| 4258 | 4264 | } |
| 4259 | 4265 | |
| 4260 | − if (driver_register(&gpio_stub_drv) < 0) { | |
| 4266 | + ret = driver_register(&gpio_stub_drv); | |
| 4267 | + if (ret < 0) { | |
| 4261 | 4268 | pr_err("gpiolib: could not register GPIO stub driver\n"); |
| 4262 | 4269 | bus_unregister(&gpio_bus_type); |
| 4263 | 4270 | return ret; |
| @@ -228,6 +228,7 @@ source "drivers/gpu/drm/arm/Kconfig" · 227 unmodified lines | ||
| 228 | 228 | config DRM_RADEON |
| 229 | 229 | tristate "ATI Radeon" |
| 230 | 230 | depends on DRM && PCI && MMU |
| 231 | + depends on AGP || !AGP | |
| 231 | 232 | select FW_LOADER |
| 232 | 233 | select DRM_KMS_HELPER |
| 233 | 234 | select DRM_TTM |
| @@ -180,6 +180,7 @@ extern uint amdgpu_smu_memory_pool_size; · 179 unmodified lines | ||
| 180 | 180 | extern uint amdgpu_dc_feature_mask; |
| 181 | 181 | extern uint amdgpu_dc_debug_mask; |
| 182 | 182 | extern uint amdgpu_dm_abm_level; |
| 183 | +extern int amdgpu_backlight; | |
| 183 | 184 | extern struct amdgpu_mgpu_info mgpu_info; |
| 184 | 185 | extern int amdgpu_ras_enable; |
| 185 | 186 | extern uint amdgpu_ras_mask; |
| @@ -1006,13 +1007,9 @@ struct amdgpu_device { · 820 unmodified lines | ||
| 1006 | 1007 | |
| 1007 | 1008 | /* s3/s4 mask */ |
| 1008 | 1009 | bool in_suspend; |
| 1009 | − bool in_hibernate; | |
| 1010 | − | |
| 1011 | − /* | |
| 1012 | − * The combination flag in_poweroff_reboot_com used to identify the poweroff | |
| 1013 | − * and reboot opt in the s0i3 system-wide suspend. | |
| 1014 | − */ | |
| 1015 | − bool in_poweroff_reboot_com; | |
| 1010 | + bool in_s3; | |
| 1011 | + bool in_s4; | |
| 1012 | + bool in_s0ix; | |
| 1016 | 1013 | |
| 1017 | 1014 | atomic_t in_gpu_reset; |
| 1018 | 1015 | enum pp_mp1_state mp1_state; |
| @@ -903,7 +903,7 @@ void amdgpu_acpi_fini(struct amdgpu_device *adev) · 902 unmodified lines | ||
| 903 | 903 | */ |
| 904 | 904 | bool amdgpu_acpi_is_s0ix_supported(struct amdgpu_device *adev) |
| 905 | 905 | { |
| 906 | −#if defined(CONFIG_AMD_PMC) | |
| 906 | +#if defined(CONFIG_AMD_PMC) || defined(CONFIG_AMD_PMC_MODULE) | |
| 907 | 907 | if (acpi_gbl_FADT.flags & ACPI_FADT_LOW_POWER_S0) { |
| 908 | 908 | if (adev->flags & AMD_IS_APU) |
| 909 | 909 | return true; |
| @@ -2371,6 +2371,10 @@ static int amdgpu_device_set_cg_state(struct amdgpu_device *adev, · 2370 unmodified lines | ||
| 2371 | 2371 | i = state == AMD_CG_STATE_GATE ? j : adev->num_ip_blocks - j - 1; |
| 2372 | 2372 | if (!adev->ip_blocks[i].status.late_initialized) |
| 2373 | 2373 | continue; |
| 2374 | + /* skip CG for GFX on S0ix */ | |
| 2375 | + if (adev->in_s0ix && | |
| 2376 | + adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX) | |
| 2377 | + continue; | |
| 2374 | 2378 | /* skip CG for VCE/UVD, it's handled specially */ |
| 2375 | 2379 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && |
| 2376 | 2380 | adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE && |
| @@ -2402,6 +2406,10 @@ static int amdgpu_device_set_pg_state(struct amdgpu_device *adev, enum amd_power · 25 unmodified lines | ||
| 2402 | 2406 | i = state == AMD_PG_STATE_GATE ? j : adev->num_ip_blocks - j - 1; |
| 2403 | 2407 | if (!adev->ip_blocks[i].status.late_initialized) |
| 2404 | 2408 | continue; |
| 2409 | + /* skip PG for GFX on S0ix */ | |
| 2410 | + if (adev->in_s0ix && | |
| 2411 | + adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX) | |
| 2412 | + continue; | |
| 2405 | 2413 | /* skip CG for VCE/UVD, it's handled specially */ |
| 2406 | 2414 | if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD && |
| 2407 | 2415 | adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_VCE && |
| @@ -2678,11 +2686,8 @@ static int amdgpu_device_ip_suspend_phase1(struct amdgpu_device *adev) · 270 unmodified lines | ||
| 2678 | 2686 | { |
| 2679 | 2687 | int i, r; |
| 2680 | 2688 | |
| 2681 | − if (adev->in_poweroff_reboot_com || | |
| 2682 | − !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev)) { | |
| 2683 | − amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE); | |
| 2684 | − amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE); | |
| 2685 | − } | |
| 2689 | + amdgpu_device_set_pg_state(adev, AMD_PG_STATE_UNGATE); | |
| 2690 | + amdgpu_device_set_cg_state(adev, AMD_CG_STATE_UNGATE); | |
| 2686 | 2691 | |
| 2687 | 2692 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { |
| 2688 | 2693 | if (!adev->ip_blocks[i].status.valid) |
| @@ -2722,6 +2727,9 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev) · 33 unmodified lines | ||
| 2722 | 2727 | { |
| 2723 | 2728 | int i, r; |
| 2724 | 2729 | |
| 2730 | + if (adev->in_s0ix) | |
| 2731 | + amdgpu_gfx_state_change_set(adev, sGpuChangeState_D3Entry); | |
| 2732 | + | |
| 2725 | 2733 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { |
| 2726 | 2734 | if (!adev->ip_blocks[i].status.valid) |
| 2727 | 2735 | continue; |
| @@ -2734,6 +2742,17 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev) · 6 unmodified lines | ||
| 2734 | 2742 | adev->ip_blocks[i].status.hw = false; |
| 2735 | 2743 | continue; |
| 2736 | 2744 | } |
| 2745 | + | |
| 2746 | + /* skip suspend of gfx and psp for S0ix | |
| 2747 | + * gfx is in gfxoff state, so on resume it will exit gfxoff just | |
| 2748 | + * like at runtime. PSP is also part of the always on hardware | |
| 2749 | + * so no need to suspend it. | |
| 2750 | + */ | |
| 2751 | + if (adev->in_s0ix && | |
| 2752 | + (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_PSP || | |
| 2753 | + adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX)) | |
| 2754 | + continue; | |
| 2755 | + | |
| 2737 | 2756 | /* XXX handle errors */ |
| 2738 | 2757 | r = adev->ip_blocks[i].version->funcs->suspend(adev); |
| 2739 | 2758 | /* XXX handle errors */ |
| @@ -3673,14 +3692,9 @@ void amdgpu_device_fini(struct amdgpu_device *adev) · 933 unmodified lines | ||
| 3673 | 3692 | */ |
| 3674 | 3693 | int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) |
| 3675 | 3694 | { |
| 3676 | − struct amdgpu_device *adev; | |
| 3677 | − struct drm_crtc *crtc; | |
| 3678 | − struct drm_connector *connector; | |
| 3679 | − struct drm_connector_list_iter iter; | |
| 3695 | + struct amdgpu_device *adev = drm_to_adev(dev); | |
| 3680 | 3696 | int r; |
| 3681 | 3697 | |
| 3682 | − adev = drm_to_adev(dev); | |
| 3683 | − | |
| 3684 | 3698 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) |
| 3685 | 3699 | return 0; |
| 3686 | 3700 | |
| @@ -3692,61 +3706,19 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) · 5 unmodified lines | ||
| 3692 | 3706 | |
| 3693 | 3707 | cancel_delayed_work_sync(&adev->delayed_init_work); |
| 3694 | 3708 | |
| 3695 | − if (!amdgpu_device_has_dc_support(adev)) { | |
| 3696 | − /* turn off display hw */ | |
| 3697 | − drm_modeset_lock_all(dev); | |
| 3698 | − drm_connector_list_iter_begin(dev, &iter); | |
| 3699 | − drm_for_each_connector_iter(connector, &iter) | |
| 3700 | − drm_helper_connector_dpms(connector, | |
| 3701 | − DRM_MODE_DPMS_OFF); | |
| 3702 | − drm_connector_list_iter_end(&iter); | |
| 3703 | − drm_modeset_unlock_all(dev); | |
| 3704 | − /* unpin the front buffers and cursors */ | |
| 3705 | − list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | |
| 3706 | − struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); | |
| 3707 | − struct drm_framebuffer *fb = crtc->primary->fb; | |
| 3708 | − struct amdgpu_bo *robj; | |
| 3709 | − | |
| 3710 | − if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) { | |
| 3711 | − struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); | |
| 3712 | − r = amdgpu_bo_reserve(aobj, true); | |
| 3713 | − if (r == 0) { | |
| 3714 | − amdgpu_bo_unpin(aobj); | |
| 3715 | − amdgpu_bo_unreserve(aobj); | |
| 3716 | − } | |
| 3717 | − } | |
| 3718 | − | |
| 3719 | − if (fb == NULL || fb->obj[0] == NULL) { | |
| 3720 | − continue; | |
| 3721 | − } | |
| 3722 | − robj = gem_to_amdgpu_bo(fb->obj[0]); | |
| 3723 | − /* don't unpin kernel fb objects */ | |
| 3724 | − if (!amdgpu_fbdev_robj_is_fb(adev, robj)) { | |
| 3725 | − r = amdgpu_bo_reserve(robj, true); | |
| 3726 | − if (r == 0) { | |
| 3727 | − amdgpu_bo_unpin(robj); | |
| 3728 | − amdgpu_bo_unreserve(robj); | |
| 3729 | − } | |
| 3730 | − } | |
| 3731 | − } | |
| 3732 | − } | |
| 3733 | − | |
| 3734 | 3709 | amdgpu_ras_suspend(adev); |
| 3735 | 3710 | |
| 3736 | 3711 | r = amdgpu_device_ip_suspend_phase1(adev); |
| 3737 | 3712 | |
| 3738 | − amdgpu_amdkfd_suspend(adev, adev->in_runpm); | |
| 3713 | + if (!adev->in_s0ix) | |
| 3714 | + amdgpu_amdkfd_suspend(adev, adev->in_runpm); | |
| 3739 | 3715 | |
| 3740 | 3716 | /* evict vram memory */ |
| 3741 | 3717 | amdgpu_bo_evict_vram(adev); |
| 3742 | 3718 | |
| 3743 | 3719 | amdgpu_fence_driver_suspend(adev); |
| 3744 | 3720 | |
| 3745 | − if (adev->in_poweroff_reboot_com || | |
| 3746 | − !amdgpu_acpi_is_s0ix_supported(adev) || amdgpu_in_reset(adev)) | |
| 3747 | − r = amdgpu_device_ip_suspend_phase2(adev); | |
| 3748 | − else | |
| 3749 | − amdgpu_gfx_state_change_set(adev, sGpuChangeState_D3Entry); | |
| 3721 | + r = amdgpu_device_ip_suspend_phase2(adev); | |
| 3750 | 3722 | /* evict remaining vram memory |
| 3751 | 3723 | * This second call to evict vram is to evict the gart page table |
| 3752 | 3724 | * using the CPU. |
| @@ -3768,16 +3740,13 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon) · 15 unmodified lines | ||
| 3768 | 3740 | */ |
| 3769 | 3741 | int amdgpu_device_resume(struct drm_device *dev, bool fbcon) |
| 3770 | 3742 | { |
| 3771 | − struct drm_connector *connector; | |
| 3772 | − struct drm_connector_list_iter iter; | |
| 3773 | 3743 | struct amdgpu_device *adev = drm_to_adev(dev); |
| 3774 | − struct drm_crtc *crtc; | |
| 3775 | 3744 | int r = 0; |
| 3776 | 3745 | |
| 3777 | 3746 | if (dev->switch_power_state == DRM_SWITCH_POWER_OFF) |
| 3778 | 3747 | return 0; |
| 3779 | 3748 | |
| 3780 | − if (amdgpu_acpi_is_s0ix_supported(adev)) | |
| 3749 | + if (adev->in_s0ix) | |
| 3781 | 3750 | amdgpu_gfx_state_change_set(adev, sGpuChangeState_D0Entry); |
| 3782 | 3751 | |
| 3783 | 3752 | /* post card */ |
| @@ -3802,50 +3771,17 @@ int amdgpu_device_resume(struct drm_device *dev, bool fbcon) · 18 unmodified lines | ||
| 3802 | 3771 | queue_delayed_work(system_wq, &adev->delayed_init_work, |
| 3803 | 3772 | msecs_to_jiffies(AMDGPU_RESUME_MS)); |
| 3804 | 3773 | |
| 3805 | − if (!amdgpu_device_has_dc_support(adev)) { | |
| 3806 | − /* pin cursors */ | |
| 3807 | − list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | |
| 3808 | − struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); | |
| 3809 | − | |
| 3810 | − if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) { | |
| 3811 | − struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); | |
| 3812 | − r = amdgpu_bo_reserve(aobj, true); | |
| 3813 | − if (r == 0) { | |
| 3814 | − r = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM); | |
| 3815 | − if (r != 0) | |
| 3816 | − dev_err(adev->dev, "Failed to pin cursor BO (%d)\n", r); | |
| 3817 | − amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj); | |
| 3818 | − amdgpu_bo_unreserve(aobj); | |
| 3819 | − } | |
| 3820 | − } | |
| 3821 | − } | |
| 3774 | + if (!adev->in_s0ix) { | |
| 3775 | + r = amdgpu_amdkfd_resume(adev, adev->in_runpm); | |
| 3776 | + if (r) | |
| 3777 | + return r; | |
| 3822 | 3778 | } |
| 3823 | − r = amdgpu_amdkfd_resume(adev, adev->in_runpm); | |
| 3824 | − if (r) | |
| 3825 | − return r; | |
| 3826 | 3779 | |
| 3827 | 3780 | /* Make sure IB tests flushed */ |
| 3828 | 3781 | flush_delayed_work(&adev->delayed_init_work); |
| 3829 | 3782 | |
| 3830 | − /* blat the mode back in */ | |
| 3831 | − if (fbcon) { | |
| 3832 | − if (!amdgpu_device_has_dc_support(adev)) { | |
| 3833 | − /* pre DCE11 */ | |
| 3834 | − drm_helper_resume_force_mode(dev); | |
| 3835 | − | |
| 3836 | − /* turn on display hw */ | |
| 3837 | − drm_modeset_lock_all(dev); | |
| 3838 | − | |
| 3839 | − drm_connector_list_iter_begin(dev, &iter); | |
| 3840 | − drm_for_each_connector_iter(connector, &iter) | |
| 3841 | − drm_helper_connector_dpms(connector, | |
| 3842 | − DRM_MODE_DPMS_ON); | |
| 3843 | − drm_connector_list_iter_end(&iter); | |
| 3844 | − | |
| 3845 | − drm_modeset_unlock_all(dev); | |
| 3846 | − } | |
| 3783 | + if (fbcon) | |
| 3847 | 3784 | amdgpu_fbdev_set_suspend(adev, 0); |
| 3848 | − } | |
| 3849 | 3785 | |
| 3850 | 3786 | drm_kms_helper_poll_enable(dev); |
| 3851 | 3787 | |
| @@ -1310,3 +1310,92 @@ bool amdgpu_crtc_get_scanout_position(struct drm_crtc *crtc, · 1309 unmodified lines | ||
| 1310 | 1310 | return amdgpu_display_get_crtc_scanoutpos(dev, pipe, 0, vpos, hpos, |
| 1311 | 1311 | stime, etime, mode); |
| 1312 | 1312 | } |
| 1313 | + | |
| 1314 | +int amdgpu_display_suspend_helper(struct amdgpu_device *adev) | |
| 1315 | +{ | |
| 1316 | + struct drm_device *dev = adev_to_drm(adev); | |
| 1317 | + struct drm_crtc *crtc; | |
| 1318 | + struct drm_connector *connector; | |
| 1319 | + struct drm_connector_list_iter iter; | |
| 1320 | + int r; | |
| 1321 | + | |
| 1322 | + /* turn off display hw */ | |
| 1323 | + drm_modeset_lock_all(dev); | |
| 1324 | + drm_connector_list_iter_begin(dev, &iter); | |
| 1325 | + drm_for_each_connector_iter(connector, &iter) | |
| 1326 | + drm_helper_connector_dpms(connector, | |
| 1327 | + DRM_MODE_DPMS_OFF); | |
| 1328 | + drm_connector_list_iter_end(&iter); | |
| 1329 | + drm_modeset_unlock_all(dev); | |
| 1330 | + /* unpin the front buffers and cursors */ | |
| 1331 | + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | |
| 1332 | + struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); | |
| 1333 | + struct drm_framebuffer *fb = crtc->primary->fb; | |
| 1334 | + struct amdgpu_bo *robj; | |
| 1335 | + | |
| 1336 | + if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) { | |
| 1337 | + struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); | |
| 1338 | + r = amdgpu_bo_reserve(aobj, true); | |
| 1339 | + if (r == 0) { | |
| 1340 | + amdgpu_bo_unpin(aobj); | |
| 1341 | + amdgpu_bo_unreserve(aobj); | |
| 1342 | + } | |
| 1343 | + } | |
| 1344 | + | |
| 1345 | + if (fb == NULL || fb->obj[0] == NULL) { | |
| 1346 | + continue; | |
| 1347 | + } | |
| 1348 | + robj = gem_to_amdgpu_bo(fb->obj[0]); | |
| 1349 | + /* don't unpin kernel fb objects */ | |
| 1350 | + if (!amdgpu_fbdev_robj_is_fb(adev, robj)) { | |
| 1351 | + r = amdgpu_bo_reserve(robj, true); | |
| 1352 | + if (r == 0) { | |
| 1353 | + amdgpu_bo_unpin(robj); | |
| 1354 | + amdgpu_bo_unreserve(robj); | |
| 1355 | + } | |
| 1356 | + } | |
| 1357 | + } | |
| 1358 | + return r; | |
| 1359 | +} | |
| 1360 | + | |
| 1361 | +int amdgpu_display_resume_helper(struct amdgpu_device *adev) | |
| 1362 | +{ | |
| 1363 | + struct drm_device *dev = adev_to_drm(adev); | |
| 1364 | + struct drm_connector *connector; | |
| 1365 | + struct drm_connector_list_iter iter; | |
| 1366 | + struct drm_crtc *crtc; | |
| 1367 | + int r; | |
| 1368 | + | |
| 1369 | + /* pin cursors */ | |
| 1370 | + list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | |
| 1371 | + struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); | |
| 1372 | + | |
| 1373 | + if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) { | |
| 1374 | + struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); | |
| 1375 | + r = amdgpu_bo_reserve(aobj, true); | |
| 1376 | + if (r == 0) { | |
| 1377 | + r = amdgpu_bo_pin(aobj, AMDGPU_GEM_DOMAIN_VRAM); | |
| 1378 | + if (r != 0) | |
| 1379 | + dev_err(adev->dev, "Failed to pin cursor BO (%d)\n", r); | |
| 1380 | + amdgpu_crtc->cursor_addr = amdgpu_bo_gpu_offset(aobj); | |
| 1381 | + amdgpu_bo_unreserve(aobj); | |
| 1382 | + } | |
| 1383 | + } | |
| 1384 | + } | |
| 1385 | + | |
| 1386 | + drm_helper_resume_force_mode(dev); | |
| 1387 | + | |
| 1388 | + /* turn on display hw */ | |
| 1389 | + drm_modeset_lock_all(dev); | |
| 1390 | + | |
| 1391 | + drm_connector_list_iter_begin(dev, &iter); | |
| 1392 | + drm_for_each_connector_iter(connector, &iter) | |
| 1393 | + drm_helper_connector_dpms(connector, | |
| 1394 | + DRM_MODE_DPMS_ON); | |
| 1395 | + drm_connector_list_iter_end(&iter); | |
| 1396 | + | |
| 1397 | + drm_modeset_unlock_all(dev); | |
| 1398 | + | |
| 1399 | + return 0; | |
| 1400 | +} | |
| 1401 | + | |
| @@ -47,4 +47,7 @@ amdgpu_display_user_framebuffer_create(struct drm_device *dev, · 46 unmodified lines | ||
| 47 | 47 | const struct drm_format_info * |
| 48 | 48 | amdgpu_lookup_format_info(u32 format, uint64_t modifier); |
| 49 | 49 | |
| 50 | +int amdgpu_display_suspend_helper(struct amdgpu_device *adev); | |
| 51 | +int amdgpu_display_resume_helper(struct amdgpu_device *adev); | |
| 52 | + | |
| 50 | 53 | #endif |
| @@ -781,6 +781,10 @@ uint amdgpu_dm_abm_level; · 780 unmodified lines | ||
| 781 | 781 | MODULE_PARM_DESC(abmlevel, "ABM level (0 = off (default), 1-4 = backlight reduction level) "); |
| 782 | 782 | module_param_named(abmlevel, amdgpu_dm_abm_level, uint, 0444); |
| 783 | 783 | |
| 784 | +int amdgpu_backlight = -1; | |
| 785 | +MODULE_PARM_DESC(backlight, "Backlight control (0 = pwm, 1 = aux, -1 auto (default))"); | |
| 786 | +module_param_named(backlight, amdgpu_backlight, bint, 0444); | |
| 787 | + | |
| 784 | 788 | /** |
| 785 | 789 | * DOC: tmz (int) |
| 786 | 790 | * Trusted Memory Zone (TMZ) is a method to protect data being written |
| @@ -1103,6 +1107,7 @@ static const struct pci_device_id pciidlist[] = { · 316 unmodified lines | ||
| 1103 | 1107 | {0x1002, 0x73A3, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, |
| 1104 | 1108 | {0x1002, 0x73AB, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, |
| 1105 | 1109 | {0x1002, 0x73AE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, |
| 1110 | + {0x1002, 0x73AF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, | |
| 1106 | 1111 | {0x1002, 0x73BF, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SIENNA_CICHLID}, |
| 1107 | 1112 | |
| 1108 | 1113 | /* Van Gogh */ |
| @@ -1270,24 +1275,35 @@ amdgpu_pci_shutdown(struct pci_dev *pdev) · 161 unmodified lines | ||
| 1270 | 1275 | */ |
| 1271 | 1276 | if (!amdgpu_passthrough(adev)) |
| 1272 | 1277 | adev->mp1_state = PP_MP1_STATE_UNLOAD; |
| 1273 | − adev->in_poweroff_reboot_com = true; | |
| 1274 | 1278 | amdgpu_device_ip_suspend(adev); |
| 1275 | − adev->in_poweroff_reboot_com = false; | |
| 1276 | 1279 | adev->mp1_state = PP_MP1_STATE_NONE; |
| 1277 | 1280 | } |
| 1278 | 1281 | |
| 1279 | 1282 | static int amdgpu_pmops_suspend(struct device *dev) |
| 1280 | 1283 | { |
| 1281 | 1284 | struct drm_device *drm_dev = dev_get_drvdata(dev); |
| 1285 | + struct amdgpu_device *adev = drm_to_adev(drm_dev); | |
| 1286 | + int r; | |
| 1282 | 1287 | |
| 1283 | − return amdgpu_device_suspend(drm_dev, true); | |
| 1288 | + if (amdgpu_acpi_is_s0ix_supported(adev)) | |
| 1289 | + adev->in_s0ix = true; | |
| 1290 | + adev->in_s3 = true; | |
| 1291 | + r = amdgpu_device_suspend(drm_dev, true); | |
| 1292 | + adev->in_s3 = false; | |
| 1293 | + | |
| 1294 | + return r; | |
| 1284 | 1295 | } |
| 1285 | 1296 | |
| 1286 | 1297 | static int amdgpu_pmops_resume(struct device *dev) |
| 1287 | 1298 | { |
| 1288 | 1299 | struct drm_device *drm_dev = dev_get_drvdata(dev); |
| 1300 | + struct amdgpu_device *adev = drm_to_adev(drm_dev); | |
| 1301 | + int r; | |
| 1289 | 1302 | |
| 1290 | − return amdgpu_device_resume(drm_dev, true); | |
| 1303 | + r = amdgpu_device_resume(drm_dev, true); | |
| 1304 | + if (amdgpu_acpi_is_s0ix_supported(adev)) | |
| 1305 | + adev->in_s0ix = false; | |
| 1306 | + return r; | |
| 1291 | 1307 | } |
| 1292 | 1308 | |
| 1293 | 1309 | static int amdgpu_pmops_freeze(struct device *dev) |
| @@ -1296,9 +1312,9 @@ static int amdgpu_pmops_freeze(struct device *dev) · 2 unmodified lines | ||
| 1296 | 1312 | struct amdgpu_device *adev = drm_to_adev(drm_dev); |
| 1297 | 1313 | int r; |
| 1298 | 1314 | |
| 1299 | − adev->in_hibernate = true; | |
| 1315 | + adev->in_s4 = true; | |
| 1300 | 1316 | r = amdgpu_device_suspend(drm_dev, true); |
| 1301 | − adev->in_hibernate = false; | |
| 1317 | + adev->in_s4 = false; | |
| 1302 | 1318 | if (r) |
| 1303 | 1319 | return r; |
| 1304 | 1320 | return amdgpu_asic_reset(adev); |
| @@ -1314,13 +1330,8 @@ static int amdgpu_pmops_thaw(struct device *dev) · 9 unmodified lines | ||
| 1314 | 1330 | static int amdgpu_pmops_poweroff(struct device *dev) |
| 1315 | 1331 | { |
| 1316 | 1332 | struct drm_device *drm_dev = dev_get_drvdata(dev); |
| 1317 | − struct amdgpu_device *adev = drm_to_adev(drm_dev); | |
| 1318 | − int r; | |
| 1319 | 1333 | |
| 1320 | − adev->in_poweroff_reboot_com = true; | |
| 1321 | − r = amdgpu_device_suspend(drm_dev, true); | |
| 1322 | − adev->in_poweroff_reboot_com = false; | |
| 1323 | − return r; | |
| 1334 | + return amdgpu_device_suspend(drm_dev, true); | |
| 1324 | 1335 | } |
| 1325 | 1336 | |
| 1326 | 1337 | static int amdgpu_pmops_restore(struct device *dev) |
| @@ -146,7 +146,7 @@ static int amdgpufb_create_pinned_object(struct amdgpu_fbdev *rfbdev, · 145 unmodified lines | ||
| 146 | 146 | size = mode_cmd->pitches[0] * height; |
| 147 | 147 | aligned_size = ALIGN(size, PAGE_SIZE); |
| 148 | 148 | ret = amdgpu_gem_object_create(adev, aligned_size, 0, domain, flags, |
| 149 | − ttm_bo_type_kernel, NULL, &gobj); | |
| 149 | + ttm_bo_type_device, NULL, &gobj); | |
| 150 | 150 | if (ret) { |
| 151 | 151 | pr_err("failed to allocate framebuffer (%d)\n", aligned_size); |
| 152 | 152 | return -ENOMEM; |
| @@ -778,9 +778,9 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 777 unmodified lines | ||
| 778 | 778 | dev_info->high_va_offset = AMDGPU_GMC_HOLE_END; |
| 779 | 779 | dev_info->high_va_max = AMDGPU_GMC_HOLE_END | vm_size; |
| 780 | 780 | } |
| 781 | − dev_info->virtual_address_alignment = max((int)PAGE_SIZE, AMDGPU_GPU_PAGE_SIZE); | |
| 781 | + dev_info->virtual_address_alignment = max_t(u32, PAGE_SIZE, AMDGPU_GPU_PAGE_SIZE); | |
| 782 | 782 | dev_info->pte_fragment_size = (1 << adev->vm_manager.fragment_size) * AMDGPU_GPU_PAGE_SIZE; |
| 783 | − dev_info->gart_page_size = AMDGPU_GPU_PAGE_SIZE; | |
| 783 | + dev_info->gart_page_size = max_t(u32, PAGE_SIZE, AMDGPU_GPU_PAGE_SIZE); | |
| 784 | 784 | dev_info->cu_active_number = adev->gfx.cu_info.number; |
| 785 | 785 | dev_info->cu_ao_mask = adev->gfx.cu_info.ao_cu_mask; |
| 786 | 786 | dev_info->ce_ram_size = adev->gfx.ce_ram_size; |
| @@ -1028,13 +1028,10 @@ int amdgpu_bo_evict_vram(struct amdgpu_device *adev) · 1027 unmodified lines | ||
| 1028 | 1028 | { |
| 1029 | 1029 | struct ttm_resource_manager *man; |
| 1030 | 1030 | |
| 1031 | − /* late 2.6.33 fix IGP hibernate - we need pm ops to do this correct */ | |
| 1032 | −#ifndef CONFIG_HIBERNATION | |
| 1033 | − if (adev->flags & AMD_IS_APU) { | |
| 1034 | − /* Useless to evict on IGP chips */ | |
| 1031 | + if (adev->in_s3 && (adev->flags & AMD_IS_APU)) { | |
| 1032 | + /* No need to evict vram on APUs for suspend to ram */ | |
| 1035 | 1033 | return 0; |
| 1036 | 1034 | } |
| 1037 | −#endif | |
| 1038 | 1035 | |
| 1039 | 1036 | man = ttm_manager_type(&adev->mman.bdev, TTM_PL_VRAM); |
| 1040 | 1037 | return ttm_resource_manager_evict_all(&adev->mman.bdev, man); |
| @@ -906,7 +906,7 @@ static int amdgpu_ttm_tt_pin_userptr(struct ttm_bo_device *bdev, · 905 unmodified lines | ||
| 906 | 906 | |
| 907 | 907 | /* Allocate an SG array and squash pages into it */ |
| 908 | 908 | r = sg_alloc_table_from_pages(ttm->sg, ttm->pages, ttm->num_pages, 0, |
| 909 | − ttm->num_pages << PAGE_SHIFT, | |
| 909 | + (u64)ttm->num_pages << PAGE_SHIFT, | |
| 910 | 910 | GFP_KERNEL); |
| 911 | 911 | if (r) |
| 912 | 912 | goto release_sg; |
| @@ -2197,8 +2197,8 @@ int amdgpu_vm_bo_map(struct amdgpu_device *adev, · 2196 unmodified lines | ||
| 2197 | 2197 | uint64_t eaddr; |
| 2198 | 2198 | |
| 2199 | 2199 | /* validate the parameters */ |
| 2200 | − if (saddr & AMDGPU_GPU_PAGE_MASK || offset & AMDGPU_GPU_PAGE_MASK || | |
| 2201 | − size == 0 || size & AMDGPU_GPU_PAGE_MASK) | |
| 2200 | + if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK || | |
| 2201 | + size == 0 || size & ~PAGE_MASK) | |
| 2202 | 2202 | return -EINVAL; |
| 2203 | 2203 | |
| 2204 | 2204 | /* make sure object fit at this offset */ |
| @@ -2263,8 +2263,8 @@ int amdgpu_vm_bo_replace_map(struct amdgpu_device *adev, · 58 unmodified lines | ||
| 2263 | 2263 | int r; |
| 2264 | 2264 | |
| 2265 | 2265 | /* validate the parameters */ |
| 2266 | − if (saddr & AMDGPU_GPU_PAGE_MASK || offset & AMDGPU_GPU_PAGE_MASK || | |
| 2267 | − size == 0 || size & AMDGPU_GPU_PAGE_MASK) | |
| 2266 | + if (saddr & ~PAGE_MASK || offset & ~PAGE_MASK || | |
| 2267 | + size == 0 || size & ~PAGE_MASK) | |
| 2268 | 2268 | return -EINVAL; |
| 2269 | 2269 | |
| 2270 | 2270 | /* make sure object fit at this offset */ |
| @@ -2409,7 +2409,7 @@ int amdgpu_vm_bo_clear_mappings(struct amdgpu_device *adev, · 138 unmodified lines | ||
| 2409 | 2409 | after->start = eaddr + 1; |
| 2410 | 2410 | after->last = tmp->last; |
| 2411 | 2411 | after->offset = tmp->offset; |
| 2412 | − after->offset += after->start - tmp->start; | |
| 2412 | + after->offset += (after->start - tmp->start) << PAGE_SHIFT; | |
| 2413 | 2413 | after->flags = tmp->flags; |
| 2414 | 2414 | after->bo_va = tmp->bo_va; |
| 2415 | 2415 | list_add(&after->list, &tmp->bo_va->invalids); |
| @@ -2897,6 +2897,11 @@ static int dce_v10_0_hw_fini(void *handle) · 2896 unmodified lines | ||
| 2897 | 2897 | static int dce_v10_0_suspend(void *handle) |
| 2898 | 2898 | { |
| 2899 | 2899 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
| 2900 | + int r; | |
| 2901 | + | |
| 2902 | + r = amdgpu_display_suspend_helper(adev); | |
| 2903 | + if (r) | |
| 2904 | + return r; | |
| 2900 | 2905 | |
| 2901 | 2906 | adev->mode_info.bl_level = |
| 2902 | 2907 | amdgpu_atombios_encoder_get_backlight_level_from_reg(adev); |
| @@ -2921,8 +2926,10 @@ static int dce_v10_0_resume(void *handle) · 18 unmodified lines | ||
| 2921 | 2926 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, |
| 2922 | 2927 | bl_level); |
| 2923 | 2928 | } |
| 2929 | + if (ret) | |
| 2930 | + return ret; | |
| 2924 | 2931 | |
| 2925 | − return ret; | |
| 2932 | + return amdgpu_display_resume_helper(adev); | |
| 2926 | 2933 | } |
| 2927 | 2934 | |
| 2928 | 2935 | static bool dce_v10_0_is_idle(void *handle) |
| @@ -3027,6 +3027,11 @@ static int dce_v11_0_hw_fini(void *handle) · 3026 unmodified lines | ||
| 3027 | 3027 | static int dce_v11_0_suspend(void *handle) |
| 3028 | 3028 | { |
| 3029 | 3029 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
| 3030 | + int r; | |
| 3031 | + | |
| 3032 | + r = amdgpu_display_suspend_helper(adev); | |
| 3033 | + if (r) | |
| 3034 | + return r; | |
| 3030 | 3035 | |
| 3031 | 3036 | adev->mode_info.bl_level = |
| 3032 | 3037 | amdgpu_atombios_encoder_get_backlight_level_from_reg(adev); |
| @@ -3051,8 +3056,10 @@ static int dce_v11_0_resume(void *handle) · 18 unmodified lines | ||
| 3051 | 3056 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, |
| 3052 | 3057 | bl_level); |
| 3053 | 3058 | } |
| 3059 | + if (ret) | |
| 3060 | + return ret; | |
| 3054 | 3061 | |
| 3055 | − return ret; | |
| 3062 | + return amdgpu_display_resume_helper(adev); | |
| 3056 | 3063 | } |
| 3057 | 3064 | |
| 3058 | 3065 | static bool dce_v11_0_is_idle(void *handle) |
| @@ -2770,7 +2770,11 @@ static int dce_v6_0_hw_fini(void *handle) · 2769 unmodified lines | ||
| 2770 | 2770 | static int dce_v6_0_suspend(void *handle) |
| 2771 | 2771 | { |
| 2772 | 2772 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
| 2773 | + int r; | |
| 2773 | 2774 | |
| 2775 | + r = amdgpu_display_suspend_helper(adev); | |
| 2776 | + if (r) | |
| 2777 | + return r; | |
| 2774 | 2778 | adev->mode_info.bl_level = |
| 2775 | 2779 | amdgpu_atombios_encoder_get_backlight_level_from_reg(adev); |
| 2776 | 2780 | |
| @@ -2794,8 +2798,10 @@ static int dce_v6_0_resume(void *handle) · 17 unmodified lines | ||
| 2794 | 2798 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, |
| 2795 | 2799 | bl_level); |
| 2796 | 2800 | } |
| 2801 | + if (ret) | |
| 2802 | + return ret; | |
| 2797 | 2803 | |
| 2798 | − return ret; | |
| 2804 | + return amdgpu_display_resume_helper(adev); | |
| 2799 | 2805 | } |
| 2800 | 2806 | |
| 2801 | 2807 | static bool dce_v6_0_is_idle(void *handle) |
| @@ -2796,6 +2796,11 @@ static int dce_v8_0_hw_fini(void *handle) · 2795 unmodified lines | ||
| 2796 | 2796 | static int dce_v8_0_suspend(void *handle) |
| 2797 | 2797 | { |
| 2798 | 2798 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
| 2799 | + int r; | |
| 2800 | + | |
| 2801 | + r = amdgpu_display_suspend_helper(adev); | |
| 2802 | + if (r) | |
| 2803 | + return r; | |
| 2799 | 2804 | |
| 2800 | 2805 | adev->mode_info.bl_level = |
| 2801 | 2806 | amdgpu_atombios_encoder_get_backlight_level_from_reg(adev); |
| @@ -2820,8 +2825,10 @@ static int dce_v8_0_resume(void *handle) · 18 unmodified lines | ||
| 2820 | 2825 | amdgpu_display_backlight_set_level(adev, adev->mode_info.bl_encoder, |
| 2821 | 2826 | bl_level); |
| 2822 | 2827 | } |
| 2828 | + if (ret) | |
| 2829 | + return ret; | |
| 2823 | 2830 | |
| 2824 | − return ret; | |
| 2831 | + return amdgpu_display_resume_helper(adev); | |
| 2825 | 2832 | } |
| 2826 | 2833 | |
| 2827 | 2834 | static bool dce_v8_0_is_idle(void *handle) |
| @@ -39,6 +39,7 @@ · 38 unmodified lines | ||
| 39 | 39 | #include "dce_v11_0.h" |
| 40 | 40 | #include "dce_virtual.h" |
| 41 | 41 | #include "ivsrcid/ivsrcid_vislands30.h" |
| 42 | +#include "amdgpu_display.h" | |
| 42 | 43 | |
| 43 | 44 | #define DCE_VIRTUAL_VBLANK_PERIOD 16666666 |
| 44 | 45 | |
| @@ -491,12 +492,24 @@ static int dce_virtual_hw_fini(void *handle) · 446 unmodified lines | ||
| 491 | 492 | |
| 492 | 493 | static int dce_virtual_suspend(void *handle) |
| 493 | 494 | { |
| 495 | + struct amdgpu_device *adev = (struct amdgpu_device *)handle; | |
| 496 | + int r; | |
| 497 | + | |
| 498 | + r = amdgpu_display_suspend_helper(adev); | |
| 499 | + if (r) | |
| 500 | + return r; | |
| 494 | 501 | return dce_virtual_hw_fini(handle); |
| 495 | 502 | } |
| 496 | 503 | |
| 497 | 504 | static int dce_virtual_resume(void *handle) |
| 498 | 505 | { |
| 499 | − return dce_virtual_hw_init(handle); | |
| 506 | + struct amdgpu_device *adev = (struct amdgpu_device *)handle; | |
| 507 | + int r; | |
| 508 | + | |
| 509 | + r = dce_virtual_hw_init(handle); | |
| 510 | + if (r) | |
| 511 | + return r; | |
| 512 | + return amdgpu_display_resume_helper(adev); | |
| 500 | 513 | } |
| 501 | 514 | |
| 502 | 515 | static bool dce_virtual_is_idle(void *handle) |
| @@ -155,7 +155,7 @@ static int dbgdev_diq_submit_ib(struct kfd_dbgdev *dbgdev, · 154 unmodified lines | ||
| 155 | 155 | |
| 156 | 156 | /* Wait till CP writes sync code: */ |
| 157 | 157 | status = amdkfd_fence_wait_timeout( |
| 158 | − (unsigned int *) rm_state, | |
| 158 | + rm_state, | |
| 159 | 159 | QUEUESTATE__ACTIVE, 1500); |
| 160 | 160 | |
| 161 | 161 | kfd_gtt_sa_free(dbgdev->dev, mem_obj); |
| @@ -1167,7 +1167,7 @@ static int start_cpsch(struct device_queue_manager *dqm) · 1166 unmodified lines | ||
| 1167 | 1167 | if (retval) |
| 1168 | 1168 | goto fail_allocate_vidmem; |
| 1169 | 1169 | |
| 1170 | − dqm->fence_addr = dqm->fence_mem->cpu_ptr; | |
| 1170 | + dqm->fence_addr = (uint64_t *)dqm->fence_mem->cpu_ptr; | |
| 1171 | 1171 | dqm->fence_gpu_addr = dqm->fence_mem->gpu_addr; |
| 1172 | 1172 | |
| 1173 | 1173 | init_interrupts(dqm); |
| @@ -1340,8 +1340,8 @@ out: · 166 unmodified lines | ||
| 1340 | 1340 | return retval; |
| 1341 | 1341 | } |
| 1342 | 1342 | |
| 1343 | −int amdkfd_fence_wait_timeout(unsigned int *fence_addr, | |
| 1344 | − unsigned int fence_value, | |
| 1343 | +int amdkfd_fence_wait_timeout(uint64_t *fence_addr, | |
| 1344 | + uint64_t fence_value, | |
| 1345 | 1345 | unsigned int timeout_ms) |
| 1346 | 1346 | { |
| 1347 | 1347 | unsigned long end_jiffies = msecs_to_jiffies(timeout_ms) + jiffies; |
| @@ -192,7 +192,7 @@ struct device_queue_manager { · 191 unmodified lines | ||
| 192 | 192 | uint16_t vmid_pasid[VMID_NUM]; |
| 193 | 193 | uint64_t pipelines_addr; |
| 194 | 194 | uint64_t fence_gpu_addr; |
| 195 | − unsigned int *fence_addr; | |
| 195 | + uint64_t *fence_addr; | |
| 196 | 196 | struct kfd_mem_obj *fence_mem; |
| 197 | 197 | bool active_runlist; |
| 198 | 198 | int sched_policy; |
| @@ -347,7 +347,7 @@ fail_create_runlist_ib: · 346 unmodified lines | ||
| 347 | 347 | } |
| 348 | 348 | |
| 349 | 349 | int pm_send_query_status(struct packet_manager *pm, uint64_t fence_address, |
| 350 | − uint32_t fence_value) | |
| 350 | + uint64_t fence_value) | |
| 351 | 351 | { |
| 352 | 352 | uint32_t *buffer, size; |
| 353 | 353 | int retval = 0; |
| @@ -283,7 +283,7 @@ static int pm_unmap_queues_v9(struct packet_manager *pm, uint32_t *buffer, · 282 unmodified lines | ||
| 283 | 283 | } |
| 284 | 284 | |
| 285 | 285 | static int pm_query_status_v9(struct packet_manager *pm, uint32_t *buffer, |
| 286 | − uint64_t fence_address, uint32_t fence_value) | |
| 286 | + uint64_t fence_address, uint64_t fence_value) | |
| 287 | 287 | { |
| 288 | 288 | struct pm4_mes_query_status *packet; |
| 289 | 289 | |
| @@ -263,7 +263,7 @@ static int pm_unmap_queues_vi(struct packet_manager *pm, uint32_t *buffer, · 262 unmodified lines | ||
| 263 | 263 | } |
| 264 | 264 | |
| 265 | 265 | static int pm_query_status_vi(struct packet_manager *pm, uint32_t *buffer, |
| 266 | − uint64_t fence_address, uint32_t fence_value) | |
| 266 | + uint64_t fence_address, uint64_t fence_value) | |
| 267 | 267 | { |
| 268 | 268 | struct pm4_mes_query_status *packet; |
| 269 | 269 | |
| @@ -1003,8 +1003,8 @@ int pqm_get_wave_state(struct process_queue_manager *pqm, · 1002 unmodified lines | ||
| 1003 | 1003 | u32 *ctl_stack_used_size, |
| 1004 | 1004 | u32 *save_area_used_size); |
| 1005 | 1005 | |
| 1006 | −int amdkfd_fence_wait_timeout(unsigned int *fence_addr, | |
| 1007 | − unsigned int fence_value, | |
| 1006 | +int amdkfd_fence_wait_timeout(uint64_t *fence_addr, | |
| 1007 | + uint64_t fence_value, | |
| 1008 | 1008 | unsigned int timeout_ms); |
| 1009 | 1009 | |
| 1010 | 1010 | /* Packet Manager */ |
| @@ -1040,7 +1040,7 @@ struct packet_manager_funcs { · 29 unmodified lines | ||
| 1040 | 1040 | uint32_t filter_param, bool reset, |
| 1041 | 1041 | unsigned int sdma_engine); |
| 1042 | 1042 | int (*query_status)(struct packet_manager *pm, uint32_t *buffer, |
| 1043 | − uint64_t fence_address, uint32_t fence_value); | |
| 1043 | + uint64_t fence_address, uint64_t fence_value); | |
| 1044 | 1044 | int (*release_mem)(uint64_t gpu_addr, uint32_t *buffer); |
| 1045 | 1045 | |
| 1046 | 1046 | /* Packet sizes */ |
| @@ -1062,7 +1062,7 @@ int pm_send_set_resources(struct packet_manager *pm, · 15 unmodified lines | ||
| 1062 | 1062 | struct scheduling_resources *res); |
| 1063 | 1063 | int pm_send_runlist(struct packet_manager *pm, struct list_head *dqm_queues); |
| 1064 | 1064 | int pm_send_query_status(struct packet_manager *pm, uint64_t fence_address, |
| 1065 | − uint32_t fence_value); | |
| 1065 | + uint64_t fence_value); | |
| 1066 | 1066 | |
| 1067 | 1067 | int pm_send_unmap_queue(struct packet_manager *pm, enum kfd_queue_type type, |
| 1068 | 1068 | enum kfd_unmap_queues_filter mode, |
| @@ -2267,6 +2267,11 @@ static void update_connector_ext_caps(struct amdgpu_dm_connector *aconnector) · 2266 unmodified lines | ||
| 2267 | 2267 | caps->ext_caps->bits.hdr_aux_backlight_control == 1) |
| 2268 | 2268 | caps->aux_support = true; |
| 2269 | 2269 | |
| 2270 | + if (amdgpu_backlight == 0) | |
| 2271 | + caps->aux_support = false; | |
| 2272 | + else if (amdgpu_backlight == 1) | |
| 2273 | + caps->aux_support = true; | |
| 2274 | + | |
| 2270 | 2275 | /* From the specification (CTA-861-G), for calculating the maximum |
| 2271 | 2276 | * luminance we need to use: |
| 2272 | 2277 | * Luminance = 50*2**(CV/32) |
| @@ -3185,19 +3190,6 @@ static void amdgpu_dm_update_backlight_caps(struct amdgpu_display_manager *dm) · 912 unmodified lines | ||
| 3185 | 3190 | #endif |
| 3186 | 3191 | } |
| 3187 | 3192 | |
| 3188 | −static int set_backlight_via_aux(struct dc_link *link, uint32_t brightness) | |
| 3189 | −{ | |
| 3190 | − bool rc; | |
| 3191 | − | |
| 3192 | − if (!link) | |
| 3193 | − return 1; | |
| 3194 | − | |
| 3195 | − rc = dc_link_set_backlight_level_nits(link, true, brightness, | |
| 3196 | − AUX_BL_DEFAULT_TRANSITION_TIME_MS); | |
| 3197 | − | |
| 3198 | − return rc ? 0 : 1; | |
| 3199 | −} | |
| 3200 | − | |
| 3201 | 3193 | static int get_brightness_range(const struct amdgpu_dm_backlight_caps *caps, |
| 3202 | 3194 | unsigned *min, unsigned *max) |
| 3203 | 3195 | { |
| @@ -3260,9 +3252,10 @@ static int amdgpu_dm_backlight_update_status(struct backlight_device *bd) · 56 unmodified lines | ||
| 3260 | 3252 | brightness = convert_brightness_from_user(&caps, bd->props.brightness); |
| 3261 | 3253 | // Change brightness based on AUX property |
| 3262 | 3254 | if (caps.aux_support) |
| 3263 | − return set_backlight_via_aux(link, brightness); | |
| 3264 | − | |
| 3265 | − rc = dc_link_set_backlight_level(dm->backlight_link, brightness, 0); | |
| 3255 | + rc = dc_link_set_backlight_level_nits(link, true, brightness, | |
| 3256 | + AUX_BL_DEFAULT_TRANSITION_TIME_MS); | |
| 3257 | + else | |
| 3258 | + rc = dc_link_set_backlight_level(dm->backlight_link, brightness, 0); | |
| 3266 | 3259 | |
| 3267 | 3260 | return rc ? 0 : 1; |
| 3268 | 3261 | } |
| @@ -3270,11 +3263,27 @@ static int amdgpu_dm_backlight_update_status(struct backlight_device *bd) · 1 unmodified line | ||
| 3270 | 3263 | static int amdgpu_dm_backlight_get_brightness(struct backlight_device *bd) |
| 3271 | 3264 | { |
| 3272 | 3265 | struct amdgpu_display_manager *dm = bl_get_data(bd); |
| 3273 | − int ret = dc_link_get_backlight_level(dm->backlight_link); | |
| 3266 | + struct amdgpu_dm_backlight_caps caps; | |
| 3267 | + | |
| 3268 | + amdgpu_dm_update_backlight_caps(dm); | |
| 3269 | + caps = dm->backlight_caps; | |
| 3270 | + | |
| 3271 | + if (caps.aux_support) { | |
| 3272 | + struct dc_link *link = (struct dc_link *)dm->backlight_link; | |
| 3273 | + u32 avg, peak; | |
| 3274 | + bool rc; | |
| 3274 | 3275 | |
| 3275 | − if (ret == DC_ERROR_UNEXPECTED) | |
| 3276 | − return bd->props.brightness; | |
| 3277 | − return convert_brightness_to_user(&dm->backlight_caps, ret); | |
| 3276 | + rc = dc_link_get_backlight_level_nits(link, &avg, &peak); | |
| 3277 | + if (!rc) | |
| 3278 | + return bd->props.brightness; | |
| 3279 | + return convert_brightness_to_user(&caps, avg); | |
| 3280 | + } else { | |
| 3281 | + int ret = dc_link_get_backlight_level(dm->backlight_link); | |
| 3282 | + | |
| 3283 | + if (ret == DC_ERROR_UNEXPECTED) | |
| 3284 | + return bd->props.brightness; | |
| 3285 | + return convert_brightness_to_user(&caps, ret); | |
| 3286 | + } | |
| 3278 | 3287 | } |
| 3279 | 3288 | |
| 3280 | 3289 | static const struct backlight_ops amdgpu_dm_backlight_ops = { |
| @@ -4716,6 +4725,7 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev, · 1435 unmodified lines | ||
| 4716 | 4725 | dc_plane_state->global_alpha_value = plane_info.global_alpha_value; |
| 4717 | 4726 | dc_plane_state->dcc = plane_info.dcc; |
| 4718 | 4727 | dc_plane_state->layer_index = plane_info.layer_index; // Always returns 0 |
| 4728 | + dc_plane_state->flip_int_enabled = true; | |
| 4719 | 4729 | |
| 4720 | 4730 | /* |
| 4721 | 4731 | * Always set input transfer function, since plane state is refreshed |
| @@ -2602,7 +2602,6 @@ bool dc_link_set_backlight_level(const struct dc_link *link, · 2601 unmodified lines | ||
| 2602 | 2602 | if (pipe_ctx->plane_state == NULL) |
| 2603 | 2603 | frame_ramp = 0; |
| 2604 | 2604 | } else { |
| 2605 | − ASSERT(false); | |
| 2606 | 2605 | return false; |
| 2607 | 2606 | } |
| 2608 | 2607 | |
| @@ -887,6 +887,7 @@ struct dc_plane_state { · 886 unmodified lines | ||
| 887 | 887 | int layer_index; |
| 888 | 888 | |
| 889 | 889 | union surface_update_flags update_flags; |
| 890 | + bool flip_int_enabled; | |
| 890 | 891 | /* private to DC core */ |
| 891 | 892 | struct dc_plane_status status; |
| 892 | 893 | struct dc_context *ctx; |
| @@ -1257,6 +1257,16 @@ void hubp1_soft_reset(struct hubp *hubp, bool reset) · 1256 unmodified lines | ||
| 1257 | 1257 | REG_UPDATE(DCHUBP_CNTL, HUBP_DISABLE, reset ? 1 : 0); |
| 1258 | 1258 | } |
| 1259 | 1259 | |
| 1260 | +void hubp1_set_flip_int(struct hubp *hubp) | |
| 1261 | +{ | |
| 1262 | + struct dcn10_hubp *hubp1 = TO_DCN10_HUBP(hubp); | |
| 1263 | + | |
| 1264 | + REG_UPDATE(DCSURF_SURFACE_FLIP_INTERRUPT, | |
| 1265 | + SURFACE_FLIP_INT_MASK, 1); | |
| 1266 | + | |
| 1267 | + return; | |
| 1268 | +} | |
| 1269 | + | |
| 1260 | 1270 | void hubp1_init(struct hubp *hubp) |
| 1261 | 1271 | { |
| 1262 | 1272 | //do nothing |
| @@ -1290,6 +1300,7 @@ static const struct hubp_funcs dcn10_hubp_funcs = { · 27 unmodified lines | ||
| 1290 | 1300 | .dmdata_load = NULL, |
| 1291 | 1301 | .hubp_soft_reset = hubp1_soft_reset, |
| 1292 | 1302 | .hubp_in_blank = hubp1_in_blank, |
| 1303 | + .hubp_set_flip_int = hubp1_set_flip_int, | |
| 1293 | 1304 | }; |
| 1294 | 1305 | |
| 1295 | 1306 | /*****************************************/ |
| @@ -74,6 +74,7 @@ · 73 unmodified lines | ||
| 74 | 74 | SRI(DCSURF_SURFACE_EARLIEST_INUSE_C, HUBPREQ, id),\ |
| 75 | 75 | SRI(DCSURF_SURFACE_EARLIEST_INUSE_HIGH_C, HUBPREQ, id),\ |
| 76 | 76 | SRI(DCSURF_SURFACE_CONTROL, HUBPREQ, id),\ |
| 77 | + SRI(DCSURF_SURFACE_FLIP_INTERRUPT, HUBPREQ, id),\ | |
| 77 | 78 | SRI(HUBPRET_CONTROL, HUBPRET, id),\ |
| 78 | 79 | SRI(DCN_EXPANSION_MODE, HUBPREQ, id),\ |
| 79 | 80 | SRI(DCHUBP_REQ_SIZE_CONFIG, HUBP, id),\ |
| @@ -183,6 +184,7 @@ · 103 unmodified lines | ||
| 183 | 184 | uint32_t DCSURF_SURFACE_EARLIEST_INUSE_C; \ |
| 184 | 185 | uint32_t DCSURF_SURFACE_EARLIEST_INUSE_HIGH_C; \ |
| 185 | 186 | uint32_t DCSURF_SURFACE_CONTROL; \ |
| 187 | + uint32_t DCSURF_SURFACE_FLIP_INTERRUPT; \ | |
| 186 | 188 | uint32_t HUBPRET_CONTROL; \ |
| 187 | 189 | uint32_t DCN_EXPANSION_MODE; \ |
| 188 | 190 | uint32_t DCHUBP_REQ_SIZE_CONFIG; \ |
| @@ -332,6 +334,7 @@ · 143 unmodified lines | ||
| 332 | 334 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_META_SURFACE_TMZ_C, mask_sh),\ |
| 333 | 335 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_EN, mask_sh),\ |
| 334 | 336 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_IND_64B_BLK, mask_sh),\ |
| 337 | + HUBP_SF(HUBPREQ0_DCSURF_SURFACE_FLIP_INTERRUPT, SURFACE_FLIP_INT_MASK, mask_sh),\ | |
| 335 | 338 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, DET_BUF_PLANE1_BASE_ADDRESS, mask_sh),\ |
| 336 | 339 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CB_B, mask_sh),\ |
| 337 | 340 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CR_R, mask_sh),\ |
| @@ -531,6 +534,7 @@ · 193 unmodified lines | ||
| 531 | 534 | type PRIMARY_SURFACE_DCC_IND_64B_BLK;\ |
| 532 | 535 | type SECONDARY_SURFACE_DCC_EN;\ |
| 533 | 536 | type SECONDARY_SURFACE_DCC_IND_64B_BLK;\ |
| 537 | + type SURFACE_FLIP_INT_MASK;\ | |
| 534 | 538 | type DET_BUF_PLANE1_BASE_ADDRESS;\ |
| 535 | 539 | type CROSSBAR_SRC_CB_B;\ |
| 536 | 540 | type CROSSBAR_SRC_CR_R;\ |
| @@ -777,4 +781,6 @@ void hubp1_read_state_common(struct hubp *hubp); · 240 unmodified lines | ||
| 777 | 781 | bool hubp1_in_blank(struct hubp *hubp); |
| 778 | 782 | void hubp1_soft_reset(struct hubp *hubp, bool reset); |
| 779 | 783 | |
| 784 | +void hubp1_set_flip_int(struct hubp *hubp); | |
| 785 | + | |
| 780 | 786 | #endif |
| @@ -2196,6 +2196,13 @@ static void dcn10_enable_plane( · 2195 unmodified lines | ||
| 2196 | 2196 | if (dc->debug.sanity_checks) { |
| 2197 | 2197 | hws->funcs.verify_allow_pstate_change_high(dc); |
| 2198 | 2198 | } |
| 2199 | + | |
| 2200 | + if (!pipe_ctx->top_pipe | |
| 2201 | + && pipe_ctx->plane_state | |
| 2202 | + && pipe_ctx->plane_state->flip_int_enabled | |
| 2203 | + && pipe_ctx->plane_res.hubp->funcs->hubp_set_flip_int) | |
| 2204 | + pipe_ctx->plane_res.hubp->funcs->hubp_set_flip_int(pipe_ctx->plane_res.hubp); | |
| 2205 | + | |
| 2199 | 2206 | } |
| 2200 | 2207 | |
| 2201 | 2208 | void dcn10_program_gamut_remap(struct pipe_ctx *pipe_ctx) |
| @@ -1597,6 +1597,7 @@ static struct hubp_funcs dcn20_hubp_funcs = { · 1596 unmodified lines | ||
| 1597 | 1597 | .validate_dml_output = hubp2_validate_dml_output, |
| 1598 | 1598 | .hubp_in_blank = hubp1_in_blank, |
| 1599 | 1599 | .hubp_soft_reset = hubp1_soft_reset, |
| 1600 | + .hubp_set_flip_int = hubp1_set_flip_int, | |
| 1600 | 1601 | }; |
| 1601 | 1602 | |
| 1602 | 1603 | |
| @@ -1146,6 +1146,12 @@ void dcn20_enable_plane( · 1145 unmodified lines | ||
| 1146 | 1146 | pipe_ctx->plane_res.hubp->funcs->hubp_set_vm_system_aperture_settings(pipe_ctx->plane_res.hubp, &apt); |
| 1147 | 1147 | } |
| 1148 | 1148 | |
| 1149 | + if (!pipe_ctx->top_pipe | |
| 1150 | + && pipe_ctx->plane_state | |
| 1151 | + && pipe_ctx->plane_state->flip_int_enabled | |
| 1152 | + && pipe_ctx->plane_res.hubp->funcs->hubp_set_flip_int) | |
| 1153 | + pipe_ctx->plane_res.hubp->funcs->hubp_set_flip_int(pipe_ctx->plane_res.hubp); | |
| 1154 | + | |
| 1149 | 1155 | // if (dc->debug.sanity_checks) { |
| 1150 | 1156 | // dcn10_verify_allow_pstate_change_high(dc); |
| 1151 | 1157 | // } |
| @@ -1501,38 +1507,8 @@ static void dcn20_update_dchubp_dpp( · 349 unmodified lines | ||
| 1501 | 1507 | if (pipe_ctx->update_flags.bits.enable || pipe_ctx->update_flags.bits.opp_changed |
| 1502 | 1508 | || pipe_ctx->stream->update_flags.bits.gamut_remap |
| 1503 | 1509 | || pipe_ctx->stream->update_flags.bits.out_csc) { |
| 1504 | − struct mpc *mpc = pipe_ctx->stream_res.opp->ctx->dc->res_pool->mpc; | |
| 1505 | − | |
| 1506 | − if (mpc->funcs->set_gamut_remap) { | |
| 1507 | − int i; | |
| 1508 | − int mpcc_id = hubp->inst; | |
| 1509 | − struct mpc_grph_gamut_adjustment adjust; | |
| 1510 | − bool enable_remap_dpp = false; | |
| 1511 | − | |
| 1512 | − memset(&adjust, 0, sizeof(adjust)); | |
| 1513 | − adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS; | |
| 1514 | − | |
| 1515 | − /* save the enablement of gamut remap for dpp */ | |
| 1516 | − enable_remap_dpp = pipe_ctx->stream->gamut_remap_matrix.enable_remap; | |
| 1517 | − | |
| 1518 | − /* force bypass gamut remap for dpp/cm */ | |
| 1519 | − pipe_ctx->stream->gamut_remap_matrix.enable_remap = false; | |
| 1520 | − dc->hwss.program_gamut_remap(pipe_ctx); | |
| 1521 | − | |
| 1522 | − /* restore gamut remap flag and use this remap into mpc */ | |
| 1523 | − pipe_ctx->stream->gamut_remap_matrix.enable_remap = enable_remap_dpp; | |
| 1524 | − | |
| 1525 | − /* build remap matrix for top plane if enabled */ | |
| 1526 | − if (enable_remap_dpp && pipe_ctx->top_pipe == NULL) { | |
| 1527 | − adjust.gamut_adjust_type = GRAPHICS_GAMUT_ADJUST_TYPE_SW; | |
| 1528 | − for (i = 0; i < CSC_TEMPERATURE_MATRIX_SIZE; i++) | |
| 1529 | − adjust.temperature_matrix[i] = | |
| 1530 | − pipe_ctx->stream->gamut_remap_matrix.matrix[i]; | |
| 1531 | − } | |
| 1532 | − mpc->funcs->set_gamut_remap(mpc, mpcc_id, &adjust); | |
| 1533 | − } else | |
| 1534 | − /* dpp/cm gamut remap*/ | |
| 1535 | − dc->hwss.program_gamut_remap(pipe_ctx); | |
| 1510 | + /* dpp/cm gamut remap*/ | |
| 1511 | + dc->hwss.program_gamut_remap(pipe_ctx); | |
| 1536 | 1512 | |
| 1537 | 1513 | /*call the dcn2 method which uses mpc csc*/ |
| 1538 | 1514 | dc->hwss.program_output_csc(dc, |
| @@ -341,8 +341,7 @@ void enc2_hw_init(struct link_encoder *enc) · 340 unmodified lines | ||
| 341 | 341 | } else { |
| 342 | 342 | AUX_REG_WRITE(AUX_DPHY_RX_CONTROL0, 0x103d1110); |
| 343 | 343 | |
| 344 | − AUX_REG_WRITE(AUX_DPHY_TX_CONTROL, 0x21c4d); | |
| 345 | − | |
| 344 | + AUX_REG_WRITE(AUX_DPHY_TX_CONTROL, 0x21c7a); | |
| 346 | 345 | } |
| 347 | 346 | |
| 348 | 347 | //AUX_DPHY_TX_REF_CONTROL'AUX_TX_REF_DIV HW default is 0x32; |
| @@ -838,6 +838,7 @@ static struct hubp_funcs dcn21_hubp_funcs = { · 837 unmodified lines | ||
| 838 | 838 | .hubp_set_flip_control_surface_gsl = hubp2_set_flip_control_surface_gsl, |
| 839 | 839 | .hubp_init = hubp21_init, |
| 840 | 840 | .validate_dml_output = hubp21_validate_dml_output, |
| 841 | + .hubp_set_flip_int = hubp1_set_flip_int, | |
| 841 | 842 | }; |
| 842 | 843 | |
| 843 | 844 | bool hubp21_construct( |
| @@ -296,7 +296,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn2_1_soc = { · 295 unmodified lines | ||
| 296 | 296 | .num_banks = 8, |
| 297 | 297 | .num_chans = 4, |
| 298 | 298 | .vmm_page_size_bytes = 4096, |
| 299 | − .dram_clock_change_latency_us = 11.72, | |
| 299 | + .dram_clock_change_latency_us = 23.84, | |
| 300 | 300 | .return_bus_width_bytes = 64, |
| 301 | 301 | .dispclk_dppclk_vco_speed_mhz = 3600, |
| 302 | 302 | .xfc_bus_transport_time_us = 4, |
| @@ -1062,8 +1062,6 @@ static void patch_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_s · 759 unmodified lines | ||
| 1062 | 1062 | { |
| 1063 | 1063 | int i; |
| 1064 | 1064 | |
| 1065 | − DC_FP_START(); | |
| 1066 | − | |
| 1067 | 1065 | if (dc->bb_overrides.sr_exit_time_ns) { |
| 1068 | 1066 | for (i = 0; i < WM_SET_COUNT; i++) { |
| 1069 | 1067 | dc->clk_mgr->bw_params->wm_table.entries[i].sr_exit_time_us = |
| @@ -1088,8 +1086,6 @@ static void patch_bounding_box(struct dc *dc, struct _vcs_dpi_soc_bounding_box_s · 18 unmodified lines | ||
| 1088 | 1086 | dc->bb_overrides.dram_clock_change_latency_ns / 1000.0; |
| 1089 | 1087 | } |
| 1090 | 1088 | } |
| 1091 | − | |
| 1092 | − DC_FP_END(); | |
| 1093 | 1089 | } |
| 1094 | 1090 | |
| 1095 | 1091 | void dcn21_calculate_wm( |
| @@ -1339,7 +1335,7 @@ static noinline bool dcn21_validate_bandwidth_fp(struct dc *dc, · 243 unmodified lines | ||
| 1339 | 1335 | int vlevel = 0; |
| 1340 | 1336 | int pipe_split_from[MAX_PIPES]; |
| 1341 | 1337 | int pipe_cnt = 0; |
| 1342 | − display_e2e_pipe_params_st *pipes = kzalloc(dc->res_pool->pipe_count * sizeof(display_e2e_pipe_params_st), GFP_KERNEL); | |
| 1338 | + display_e2e_pipe_params_st *pipes = kzalloc(dc->res_pool->pipe_count * sizeof(display_e2e_pipe_params_st), GFP_ATOMIC); | |
| 1343 | 1339 | DC_LOGGER_INIT(dc->ctx->logger); |
| 1344 | 1340 | |
| 1345 | 1341 | BW_VAL_TRACE_COUNT(); |
| @@ -1599,6 +1595,11 @@ static void update_bw_bounding_box(struct dc *dc, struct clk_bw_params *bw_param · 253 unmodified lines | ||
| 1599 | 1595 | dcn2_1_soc.num_chans = bw_params->num_channels; |
| 1600 | 1596 | |
| 1601 | 1597 | ASSERT(clk_table->num_entries); |
| 1598 | + /* Copy dcn2_1_soc.clock_limits to clock_limits to avoid copying over null states later */ | |
| 1599 | + for (i = 0; i < dcn2_1_soc.num_states + 1; i++) { | |
| 1600 | + clock_limits[i] = dcn2_1_soc.clock_limits[i]; | |
| 1601 | + } | |
| 1602 | + | |
| 1602 | 1603 | for (i = 0; i < clk_table->num_entries; i++) { |
| 1603 | 1604 | /* loop backwards*/ |
| 1604 | 1605 | for (closest_clk_lvl = 0, j = dcn2_1_soc.num_states - 1; j >= 0; j--) { |
| @@ -113,6 +113,7 @@ bool cm3_helper_translate_curve_to_hw_format( · 112 unmodified lines | ||
| 113 | 113 | struct pwl_result_data *rgb_resulted; |
| 114 | 114 | struct pwl_result_data *rgb; |
| 115 | 115 | struct pwl_result_data *rgb_plus_1; |
| 116 | + struct pwl_result_data *rgb_minus_1; | |
| 116 | 117 | struct fixed31_32 end_value; |
| 117 | 118 | |
| 118 | 119 | int32_t region_start, region_end; |
| @@ -140,7 +141,7 @@ bool cm3_helper_translate_curve_to_hw_format( · 21 unmodified lines | ||
| 140 | 141 | region_start = -MAX_LOW_POINT; |
| 141 | 142 | region_end = NUMBER_REGIONS - MAX_LOW_POINT; |
| 142 | 143 | } else { |
| 143 | − /* 10 segments | |
| 144 | + /* 11 segments | |
| 144 | 145 | * segment is from 2^-10 to 2^0 |
| 145 | 146 | * There are less than 256 points, for optimization |
| 146 | 147 | */ |
| @@ -154,9 +155,10 @@ bool cm3_helper_translate_curve_to_hw_format( · 7 unmodified lines | ||
| 154 | 155 | seg_distr[7] = 4; |
| 155 | 156 | seg_distr[8] = 4; |
| 156 | 157 | seg_distr[9] = 4; |
| 158 | + seg_distr[10] = 1; | |
| 157 | 159 | |
| 158 | 160 | region_start = -10; |
| 159 | − region_end = 0; | |
| 161 | + region_end = 1; | |
| 160 | 162 | } |
| 161 | 163 | |
| 162 | 164 | for (i = region_end - region_start; i < MAX_REGIONS_NUMBER ; i++) |
| @@ -189,6 +191,10 @@ bool cm3_helper_translate_curve_to_hw_format( · 26 unmodified lines | ||
| 189 | 191 | rgb_resulted[hw_points - 1].green = output_tf->tf_pts.green[start_index]; |
| 190 | 192 | rgb_resulted[hw_points - 1].blue = output_tf->tf_pts.blue[start_index]; |
| 191 | 193 | |
| 194 | + rgb_resulted[hw_points].red = rgb_resulted[hw_points - 1].red; | |
| 195 | + rgb_resulted[hw_points].green = rgb_resulted[hw_points - 1].green; | |
| 196 | + rgb_resulted[hw_points].blue = rgb_resulted[hw_points - 1].blue; | |
| 197 | + | |
| 192 | 198 | // All 3 color channels have same x |
| 193 | 199 | corner_points[0].red.x = dc_fixpt_pow(dc_fixpt_from_int(2), |
| 194 | 200 | dc_fixpt_from_int(region_start)); |
| @@ -259,15 +265,18 @@ bool cm3_helper_translate_curve_to_hw_format( · 64 unmodified lines | ||
| 259 | 265 | |
| 260 | 266 | rgb = rgb_resulted; |
| 261 | 267 | rgb_plus_1 = rgb_resulted + 1; |
| 268 | + rgb_minus_1 = rgb; | |
| 262 | 269 | |
| 263 | 270 | i = 1; |
| 264 | 271 | while (i != hw_points + 1) { |
| 265 | − if (dc_fixpt_lt(rgb_plus_1->red, rgb->red)) | |
| 266 | − rgb_plus_1->red = rgb->red; | |
| 267 | − if (dc_fixpt_lt(rgb_plus_1->green, rgb->green)) | |
| 268 | − rgb_plus_1->green = rgb->green; | |
| 269 | − if (dc_fixpt_lt(rgb_plus_1->blue, rgb->blue)) | |
| 270 | − rgb_plus_1->blue = rgb->blue; | |
| 272 | + if (i >= hw_points - 1) { | |
| 273 | + if (dc_fixpt_lt(rgb_plus_1->red, rgb->red)) | |
| 274 | + rgb_plus_1->red = dc_fixpt_add(rgb->red, rgb_minus_1->delta_red); | |
| 275 | + if (dc_fixpt_lt(rgb_plus_1->green, rgb->green)) | |
| 276 | + rgb_plus_1->green = dc_fixpt_add(rgb->green, rgb_minus_1->delta_green); | |
| 277 | + if (dc_fixpt_lt(rgb_plus_1->blue, rgb->blue)) | |
| 278 | + rgb_plus_1->blue = dc_fixpt_add(rgb->blue, rgb_minus_1->delta_blue); | |
| 279 | + } | |
| 271 | 280 | |
| 272 | 281 | rgb->delta_red = dc_fixpt_sub(rgb_plus_1->red, rgb->red); |
| 273 | 282 | rgb->delta_green = dc_fixpt_sub(rgb_plus_1->green, rgb->green); |
| @@ -283,6 +292,7 @@ bool cm3_helper_translate_curve_to_hw_format( · 9 unmodified lines | ||
| 283 | 292 | } |
| 284 | 293 | |
| 285 | 294 | ++rgb_plus_1; |
| 295 | + rgb_minus_1 = rgb; | |
| 286 | 296 | ++rgb; |
| 287 | 297 | ++i; |
| 288 | 298 | } |
| @@ -511,6 +511,7 @@ static struct hubp_funcs dcn30_hubp_funcs = { · 510 unmodified lines | ||
| 511 | 511 | .hubp_init = hubp3_init, |
| 512 | 512 | .hubp_in_blank = hubp1_in_blank, |
| 513 | 513 | .hubp_soft_reset = hubp1_soft_reset, |
| 514 | + .hubp_set_flip_int = hubp1_set_flip_int, | |
| 514 | 515 | }; |
| 515 | 516 | |
| 516 | 517 | bool hubp3_construct( |
| @@ -134,6 +134,7 @@ · 133 unmodified lines | ||
| 134 | 134 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_EN, mask_sh),\ |
| 135 | 135 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_IND_BLK, mask_sh),\ |
| 136 | 136 | HUBP_SF(HUBPREQ0_DCSURF_SURFACE_CONTROL, SECONDARY_SURFACE_DCC_IND_BLK_C, mask_sh),\ |
| 137 | + HUBP_SF(HUBPREQ0_DCSURF_SURFACE_FLIP_INTERRUPT, SURFACE_FLIP_INT_MASK, mask_sh),\ | |
| 137 | 138 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, DET_BUF_PLANE1_BASE_ADDRESS, mask_sh),\ |
| 138 | 139 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CB_B, mask_sh),\ |
| 139 | 140 | HUBP_SF(HUBPRET0_HUBPRET_CONTROL, CROSSBAR_SRC_CR_R, mask_sh),\ |
| @@ -2508,6 +2508,19 @@ static const struct resource_funcs dcn30_res_pool_funcs = { · 2507 unmodified lines | ||
| 2508 | 2508 | .patch_unknown_plane_state = dcn20_patch_unknown_plane_state, |
| 2509 | 2509 | }; |
| 2510 | 2510 | |
| 2511 | +#define CTX ctx | |
| 2512 | + | |
| 2513 | +#define REG(reg_name) \ | |
| 2514 | + (DCN_BASE.instance[0].segment[mm ## reg_name ## _BASE_IDX] + mm ## reg_name) | |
| 2515 | + | |
| 2516 | +static uint32_t read_pipe_fuses(struct dc_context *ctx) | |
| 2517 | +{ | |
| 2518 | + uint32_t value = REG_READ(CC_DC_PIPE_DIS); | |
| 2519 | + /* Support for max 6 pipes */ | |
| 2520 | + value = value & 0x3f; | |
| 2521 | + return value; | |
| 2522 | +} | |
| 2523 | + | |
| 2511 | 2524 | static bool dcn30_resource_construct( |
| 2512 | 2525 | uint8_t num_virtual_links, |
| 2513 | 2526 | struct dc *dc, |
| @@ -2517,6 +2530,15 @@ static bool dcn30_resource_construct( · 3 unmodified lines | ||
| 2517 | 2530 | struct dc_context *ctx = dc->ctx; |
| 2518 | 2531 | struct irq_service_init_data init_data; |
| 2519 | 2532 | struct ddc_service_init_data ddc_init_data; |
| 2533 | + uint32_t pipe_fuses = read_pipe_fuses(ctx); | |
| 2534 | + uint32_t num_pipes = 0; | |
| 2535 | + | |
| 2536 | + if (!(pipe_fuses == 0 || pipe_fuses == 0x3e)) { | |
| 2537 | + BREAK_TO_DEBUGGER(); | |
| 2538 | + dm_error("DC: Unexpected fuse recipe for navi2x !\n"); | |
| 2539 | + /* fault to single pipe */ | |
| 2540 | + pipe_fuses = 0x3e; | |
| 2541 | + } | |
| 2520 | 2542 | |
| 2521 | 2543 | DC_FP_START(); |
| 2522 | 2544 | |
| @@ -2650,6 +2672,15 @@ static bool dcn30_resource_construct( · 127 unmodified lines | ||
| 2650 | 2672 | /* PP Lib and SMU interfaces */ |
| 2651 | 2673 | init_soc_bounding_box(dc, pool); |
| 2652 | 2674 | |
| 2675 | + num_pipes = dcn3_0_ip.max_num_dpp; | |
| 2676 | + | |
| 2677 | + for (i = 0; i < dcn3_0_ip.max_num_dpp; i++) | |
| 2678 | + if (pipe_fuses & 1 << i) | |
| 2679 | + num_pipes--; | |
| 2680 | + | |
| 2681 | + dcn3_0_ip.max_num_dpp = num_pipes; | |
| 2682 | + dcn3_0_ip.max_num_otg = num_pipes; | |
| 2683 | + | |
| 2653 | 2684 | dml_init_instance(&dc->dml, &dcn3_0_soc, &dcn3_0_ip, DML_PROJECT_DCN30); |
| 2654 | 2685 | |
| 2655 | 2686 | /* IRQ */ |
| @@ -1619,12 +1619,106 @@ static void dcn301_update_bw_bounding_box(struct dc *dc, struct clk_bw_params *b · 1618 unmodified lines | ||
| 1619 | 1619 | dml_init_instance(&dc->dml, &dcn3_01_soc, &dcn3_01_ip, DML_PROJECT_DCN30); |
| 1620 | 1620 | } |
| 1621 | 1621 | |
| 1622 | +static void calculate_wm_set_for_vlevel( | |
| 1623 | + int vlevel, | |
| 1624 | + struct wm_range_table_entry *table_entry, | |
| 1625 | + struct dcn_watermarks *wm_set, | |
| 1626 | + struct display_mode_lib *dml, | |
| 1627 | + display_e2e_pipe_params_st *pipes, | |
| 1628 | + int pipe_cnt) | |
| 1629 | +{ | |
| 1630 | + double dram_clock_change_latency_cached = dml->soc.dram_clock_change_latency_us; | |
| 1631 | + | |
| 1632 | + ASSERT(vlevel < dml->soc.num_states); | |
| 1633 | + /* only pipe 0 is read for voltage and dcf/soc clocks */ | |
| 1634 | + pipes[0].clks_cfg.voltage = vlevel; | |
| 1635 | + pipes[0].clks_cfg.dcfclk_mhz = dml->soc.clock_limits[vlevel].dcfclk_mhz; | |
| 1636 | + pipes[0].clks_cfg.socclk_mhz = dml->soc.clock_limits[vlevel].socclk_mhz; | |
| 1637 | + | |
| 1638 | + dml->soc.dram_clock_change_latency_us = table_entry->pstate_latency_us; | |
| 1639 | + dml->soc.sr_exit_time_us = table_entry->sr_exit_time_us; | |
| 1640 | + dml->soc.sr_enter_plus_exit_time_us = table_entry->sr_enter_plus_exit_time_us; | |
| 1641 | + | |
| 1642 | + wm_set->urgent_ns = get_wm_urgent(dml, pipes, pipe_cnt) * 1000; | |
| 1643 | + wm_set->cstate_pstate.cstate_enter_plus_exit_ns = get_wm_stutter_enter_exit(dml, pipes, pipe_cnt) * 1000; | |
| 1644 | + wm_set->cstate_pstate.cstate_exit_ns = get_wm_stutter_exit(dml, pipes, pipe_cnt) * 1000; | |
| 1645 | + wm_set->cstate_pstate.pstate_change_ns = get_wm_dram_clock_change(dml, pipes, pipe_cnt) * 1000; | |
| 1646 | + wm_set->pte_meta_urgent_ns = get_wm_memory_trip(dml, pipes, pipe_cnt) * 1000; | |
| 1647 | + wm_set->frac_urg_bw_nom = get_fraction_of_urgent_bandwidth(dml, pipes, pipe_cnt) * 1000; | |
| 1648 | + wm_set->frac_urg_bw_flip = get_fraction_of_urgent_bandwidth_imm_flip(dml, pipes, pipe_cnt) * 1000; | |
| 1649 | + wm_set->urgent_latency_ns = get_urgent_latency(dml, pipes, pipe_cnt) * 1000; | |
| 1650 | + dml->soc.dram_clock_change_latency_us = dram_clock_change_latency_cached; | |
| 1651 | + | |
| 1652 | +} | |
| 1653 | + | |
| 1654 | +static void dcn301_calculate_wm_and_dlg( | |
| 1655 | + struct dc *dc, struct dc_state *context, | |
| 1656 | + display_e2e_pipe_params_st *pipes, | |
| 1657 | + int pipe_cnt, | |
| 1658 | + int vlevel_req) | |
| 1659 | +{ | |
| 1660 | + int i, pipe_idx; | |
| 1661 | + int vlevel, vlevel_max; | |
| 1662 | + struct wm_range_table_entry *table_entry; | |
| 1663 | + struct clk_bw_params *bw_params = dc->clk_mgr->bw_params; | |
| 1664 | + | |
| 1665 | + ASSERT(bw_params); | |
| 1666 | + | |
| 1667 | + vlevel_max = bw_params->clk_table.num_entries - 1; | |
| 1668 | + | |
| 1669 | + /* WM Set D */ | |
| 1670 | + table_entry = &bw_params->wm_table.entries[WM_D]; | |
| 1671 | + if (table_entry->wm_type == WM_TYPE_RETRAINING) | |
| 1672 | + vlevel = 0; | |
| 1673 | + else | |
| 1674 | + vlevel = vlevel_max; | |
| 1675 | + calculate_wm_set_for_vlevel(vlevel, table_entry, &context->bw_ctx.bw.dcn.watermarks.d, | |
| 1676 | + &context->bw_ctx.dml, pipes, pipe_cnt); | |
| 1677 | + /* WM Set C */ | |
| 1678 | + table_entry = &bw_params->wm_table.entries[WM_C]; | |
| 1679 | + vlevel = min(max(vlevel_req, 2), vlevel_max); | |
| 1680 | + calculate_wm_set_for_vlevel(vlevel, table_entry, &context->bw_ctx.bw.dcn.watermarks.c, | |
| 1681 | + &context->bw_ctx.dml, pipes, pipe_cnt); | |
| 1682 | + /* WM Set B */ | |
| 1683 | + table_entry = &bw_params->wm_table.entries[WM_B]; | |
| 1684 | + vlevel = min(max(vlevel_req, 1), vlevel_max); | |
| 1685 | + calculate_wm_set_for_vlevel(vlevel, table_entry, &context->bw_ctx.bw.dcn.watermarks.b, | |
| 1686 | + &context->bw_ctx.dml, pipes, pipe_cnt); | |
| 1687 | + | |
| 1688 | + /* WM Set A */ | |
| 1689 | + table_entry = &bw_params->wm_table.entries[WM_A]; | |
| 1690 | + vlevel = min(vlevel_req, vlevel_max); | |
| 1691 | + calculate_wm_set_for_vlevel(vlevel, table_entry, &context->bw_ctx.bw.dcn.watermarks.a, | |
| 1692 | + &context->bw_ctx.dml, pipes, pipe_cnt); | |
| 1693 | + | |
| 1694 | + for (i = 0, pipe_idx = 0; i < dc->res_pool->pipe_count; i++) { | |
| 1695 | + if (!context->res_ctx.pipe_ctx[i].stream) | |
| 1696 | + continue; | |
| 1697 | + | |
| 1698 | + pipes[pipe_idx].clks_cfg.dispclk_mhz = get_dispclk_calculated(&context->bw_ctx.dml, pipes, pipe_cnt); | |
| 1699 | + pipes[pipe_idx].clks_cfg.dppclk_mhz = get_dppclk_calculated(&context->bw_ctx.dml, pipes, pipe_cnt, pipe_idx); | |
| 1700 | + | |
| 1701 | + if (dc->config.forced_clocks) { | |
| 1702 | + pipes[pipe_idx].clks_cfg.dispclk_mhz = context->bw_ctx.dml.soc.clock_limits[0].dispclk_mhz; | |
| 1703 | + pipes[pipe_idx].clks_cfg.dppclk_mhz = context->bw_ctx.dml.soc.clock_limits[0].dppclk_mhz; | |
| 1704 | + } | |
| 1705 | + if (dc->debug.min_disp_clk_khz > pipes[pipe_idx].clks_cfg.dispclk_mhz * 1000) | |
| 1706 | + pipes[pipe_idx].clks_cfg.dispclk_mhz = dc->debug.min_disp_clk_khz / 1000.0; | |
| 1707 | + if (dc->debug.min_dpp_clk_khz > pipes[pipe_idx].clks_cfg.dppclk_mhz * 1000) | |
| 1708 | + pipes[pipe_idx].clks_cfg.dppclk_mhz = dc->debug.min_dpp_clk_khz / 1000.0; | |
| 1709 | + | |
| 1710 | + pipe_idx++; | |
| 1711 | + } | |
| 1712 | + | |
| 1713 | + dcn20_calculate_dlg_params(dc, context, pipes, pipe_cnt, vlevel); | |
| 1714 | +} | |
| 1715 | + | |
| 1622 | 1716 | static struct resource_funcs dcn301_res_pool_funcs = { |
| 1623 | 1717 | .destroy = dcn301_destroy_resource_pool, |
| 1624 | 1718 | .link_enc_create = dcn301_link_encoder_create, |
| 1625 | 1719 | .panel_cntl_create = dcn301_panel_cntl_create, |
| 1626 | 1720 | .validate_bandwidth = dcn30_validate_bandwidth, |
| 1627 | − .calculate_wm_and_dlg = dcn30_calculate_wm_and_dlg, | |
| 1721 | + .calculate_wm_and_dlg = dcn301_calculate_wm_and_dlg, | |
| 1628 | 1722 | .populate_dml_pipes = dcn30_populate_dml_pipes_from_context, |
| 1629 | 1723 | .acquire_idle_pipe_for_layer = dcn20_acquire_idle_pipe_for_layer, |
| 1630 | 1724 | .add_stream_to_ctx = dcn30_add_stream_to_ctx, |
| @@ -191,6 +191,8 @@ struct hubp_funcs { · 190 unmodified lines | ||
| 191 | 191 | bool (*hubp_in_blank)(struct hubp *hubp); |
| 192 | 192 | void (*hubp_soft_reset)(struct hubp *hubp, bool reset); |
| 193 | 193 | |
| 194 | + void (*hubp_set_flip_int)(struct hubp *hubp); | |
| 195 | + | |
| 194 | 196 | }; |
| 195 | 197 | |
| 196 | 198 | #endif |
| @@ -587,6 +587,48 @@ static int smu7_force_switch_to_arbf0(struct pp_hwmgr *hwmgr) · 586 unmodified lines | ||
| 587 | 587 | tmp, MC_CG_ARB_FREQ_F0); |
| 588 | 588 | } |
| 589 | 589 | |
| 590 | +static uint16_t smu7_override_pcie_speed(struct pp_hwmgr *hwmgr) | |
| 591 | +{ | |
| 592 | + struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); | |
| 593 | + uint16_t pcie_gen = 0; | |
| 594 | + | |
| 595 | + if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN4 && | |
| 596 | + adev->pm.pcie_gen_mask & CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN4) | |
| 597 | + pcie_gen = 3; | |
| 598 | + else if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3 && | |
| 599 | + adev->pm.pcie_gen_mask & CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN3) | |
| 600 | + pcie_gen = 2; | |
| 601 | + else if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2 && | |
| 602 | + adev->pm.pcie_gen_mask & CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN2) | |
| 603 | + pcie_gen = 1; | |
| 604 | + else if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN1 && | |
| 605 | + adev->pm.pcie_gen_mask & CAIL_ASIC_PCIE_LINK_SPEED_SUPPORT_GEN1) | |
| 606 | + pcie_gen = 0; | |
| 607 | + | |
| 608 | + return pcie_gen; | |
| 609 | +} | |
| 610 | + | |
| 611 | +static uint16_t smu7_override_pcie_width(struct pp_hwmgr *hwmgr) | |
| 612 | +{ | |
| 613 | + struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); | |
| 614 | + uint16_t pcie_width = 0; | |
| 615 | + | |
| 616 | + if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X16) | |
| 617 | + pcie_width = 16; | |
| 618 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X12) | |
| 619 | + pcie_width = 12; | |
| 620 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X8) | |
| 621 | + pcie_width = 8; | |
| 622 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X4) | |
| 623 | + pcie_width = 4; | |
| 624 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X2) | |
| 625 | + pcie_width = 2; | |
| 626 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X1) | |
| 627 | + pcie_width = 1; | |
| 628 | + | |
| 629 | + return pcie_width; | |
| 630 | +} | |
| 631 | + | |
| 590 | 632 | static int smu7_setup_default_pcie_table(struct pp_hwmgr *hwmgr) |
| 591 | 633 | { |
| 592 | 634 | struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend); |
| @@ -683,6 +725,11 @@ static int smu7_setup_default_pcie_table(struct pp_hwmgr *hwmgr) · 90 unmodified lines | ||
| 683 | 725 | PP_Min_PCIEGen), |
| 684 | 726 | get_pcie_lane_support(data->pcie_lane_cap, |
| 685 | 727 | PP_Max_PCIELane)); |
| 728 | + | |
| 729 | + if (data->pcie_dpm_key_disabled) | |
| 730 | + phm_setup_pcie_table_entry(&data->dpm_table.pcie_speed_table, | |
| 731 | + data->dpm_table.pcie_speed_table.count, | |
| 732 | + smu7_override_pcie_speed(hwmgr), smu7_override_pcie_width(hwmgr)); | |
| 686 | 733 | } |
| 687 | 734 | return 0; |
| 688 | 735 | } |
| @@ -1177,7 +1224,8 @@ static int smu7_enable_sclk_mclk_dpm(struct pp_hwmgr *hwmgr) · 488 unmodified lines | ||
| 1177 | 1224 | (hwmgr->chip_id == CHIP_POLARIS10) || |
| 1178 | 1225 | (hwmgr->chip_id == CHIP_POLARIS11) || |
| 1179 | 1226 | (hwmgr->chip_id == CHIP_POLARIS12) || |
| 1180 | − (hwmgr->chip_id == CHIP_TONGA)) | |
| 1227 | + (hwmgr->chip_id == CHIP_TONGA) || | |
| 1228 | + (hwmgr->chip_id == CHIP_TOPAZ)) | |
| 1181 | 1229 | PHM_WRITE_FIELD(hwmgr->device, MC_SEQ_CNTL_3, CAC_EN, 0x1); |
| 1182 | 1230 | |
| 1183 | 1231 | |
| @@ -1248,6 +1296,13 @@ static int smu7_start_dpm(struct pp_hwmgr *hwmgr) · 64 unmodified lines | ||
| 1248 | 1296 | NULL)), |
| 1249 | 1297 | "Failed to enable pcie DPM during DPM Start Function!", |
| 1250 | 1298 | return -EINVAL); |
| 1299 | + } else { | |
| 1300 | + PP_ASSERT_WITH_CODE( | |
| 1301 | + (0 == smum_send_msg_to_smc(hwmgr, | |
| 1302 | + PPSMC_MSG_PCIeDPM_Disable, | |
| 1303 | + NULL)), | |
| 1304 | + "Failed to disble pcie DPM during DPM Start Function!", | |
| 1305 | + return -EINVAL); | |
| 1251 | 1306 | } |
| 1252 | 1307 | |
| 1253 | 1308 | if (phm_cap_enabled(hwmgr->platform_descriptor.platformCaps, |
| @@ -3276,7 +3331,8 @@ static int smu7_apply_state_adjust_rules(struct pp_hwmgr *hwmgr, · 2022 unmodified lines | ||
| 3276 | 3331 | |
| 3277 | 3332 | disable_mclk_switching_for_display = ((1 < hwmgr->display_config->num_display) && |
| 3278 | 3333 | !hwmgr->display_config->multi_monitor_in_sync) || |
| 3279 | − smu7_vblank_too_short(hwmgr, hwmgr->display_config->min_vblank_time); | |
| 3334 | + (hwmgr->display_config->num_display && | |
| 3335 | + smu7_vblank_too_short(hwmgr, hwmgr->display_config->min_vblank_time)); | |
| 3280 | 3336 | |
| 3281 | 3337 | disable_mclk_switching = disable_mclk_switching_for_frame_lock || |
| 3282 | 3338 | disable_mclk_switching_for_display; |
| @@ -5216,10 +5272,10 @@ static int smu7_set_watermarks_for_clocks_ranges(struct pp_hwmgr *hwmgr, · 1933 unmodified lines | ||
| 5216 | 5272 | for (j = 0; j < dep_sclk_table->count; j++) { |
| 5217 | 5273 | valid_entry = false; |
| 5218 | 5274 | for (k = 0; k < watermarks->num_wm_sets; k++) { |
| 5219 | − if (dep_sclk_table->entries[i].clk / 10 >= watermarks->wm_clk_ranges[k].wm_min_eng_clk_in_khz && | |
| 5220 | − dep_sclk_table->entries[i].clk / 10 < watermarks->wm_clk_ranges[k].wm_max_eng_clk_in_khz && | |
| 5221 | − dep_mclk_table->entries[i].clk / 10 >= watermarks->wm_clk_ranges[k].wm_min_mem_clk_in_khz && | |
| 5222 | − dep_mclk_table->entries[i].clk / 10 < watermarks->wm_clk_ranges[k].wm_max_mem_clk_in_khz) { | |
| 5275 | + if (dep_sclk_table->entries[i].clk >= watermarks->wm_clk_ranges[k].wm_min_eng_clk_in_khz / 10 && | |
| 5276 | + dep_sclk_table->entries[i].clk < watermarks->wm_clk_ranges[k].wm_max_eng_clk_in_khz / 10 && | |
| 5277 | + dep_mclk_table->entries[i].clk >= watermarks->wm_clk_ranges[k].wm_min_mem_clk_in_khz / 10 && | |
| 5278 | + dep_mclk_table->entries[i].clk < watermarks->wm_clk_ranges[k].wm_max_mem_clk_in_khz / 10) { | |
| 5223 | 5279 | valid_entry = true; |
| 5224 | 5280 | table->DisplayWatermark[i][j] = watermarks->wm_clk_ranges[k].wm_set_id; |
| 5225 | 5281 | break; |
| @@ -54,6 +54,9 @@ · 53 unmodified lines | ||
| 54 | 54 | #include "smuio/smuio_9_0_offset.h" |
| 55 | 55 | #include "smuio/smuio_9_0_sh_mask.h" |
| 56 | 56 | |
| 57 | +#define smnPCIE_LC_SPEED_CNTL 0x11140290 | |
| 58 | +#define smnPCIE_LC_LINK_WIDTH_CNTL 0x11140288 | |
| 59 | + | |
| 57 | 60 | #define HBM_MEMORY_CHANNEL_WIDTH 128 |
| 58 | 61 | |
| 59 | 62 | static const uint32_t channel_number[] = {1, 2, 0, 4, 0, 8, 0, 16, 2}; |
| @@ -443,8 +446,7 @@ static void vega10_init_dpm_defaults(struct pp_hwmgr *hwmgr) · 383 unmodified lines | ||
| 443 | 446 | if (PP_CAP(PHM_PlatformCaps_VCEDPM)) |
| 444 | 447 | data->smu_features[GNLD_DPM_VCE].supported = true; |
| 445 | 448 | |
| 446 | − if (!data->registry_data.pcie_dpm_key_disabled) | |
| 447 | − data->smu_features[GNLD_DPM_LINK].supported = true; | |
| 449 | + data->smu_features[GNLD_DPM_LINK].supported = true; | |
| 448 | 450 | |
| 449 | 451 | if (!data->registry_data.dcefclk_dpm_key_disabled) |
| 450 | 452 | data->smu_features[GNLD_DPM_DCEFCLK].supported = true; |
| @@ -1505,6 +1507,55 @@ static int vega10_populate_single_lclk_level(struct pp_hwmgr *hwmgr, · 1054 unmodified lines | ||
| 1505 | 1507 | return 0; |
| 1506 | 1508 | } |
| 1507 | 1509 | |
| 1510 | +static int vega10_override_pcie_parameters(struct pp_hwmgr *hwmgr) | |
| 1511 | +{ | |
| 1512 | + struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); | |
| 1513 | + struct vega10_hwmgr *data = | |
| 1514 | + (struct vega10_hwmgr *)(hwmgr->backend); | |
| 1515 | + uint32_t pcie_gen = 0, pcie_width = 0; | |
| 1516 | + PPTable_t *pp_table = &(data->smc_state_table.pp_table); | |
| 1517 | + int i; | |
| 1518 | + | |
| 1519 | + if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN4) | |
| 1520 | + pcie_gen = 3; | |
| 1521 | + else if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3) | |
| 1522 | + pcie_gen = 2; | |
| 1523 | + else if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2) | |
| 1524 | + pcie_gen = 1; | |
| 1525 | + else if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN1) | |
| 1526 | + pcie_gen = 0; | |
| 1527 | + | |
| 1528 | + if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X16) | |
| 1529 | + pcie_width = 6; | |
| 1530 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X12) | |
| 1531 | + pcie_width = 5; | |
| 1532 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X8) | |
| 1533 | + pcie_width = 4; | |
| 1534 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X4) | |
| 1535 | + pcie_width = 3; | |
| 1536 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X2) | |
| 1537 | + pcie_width = 2; | |
| 1538 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X1) | |
| 1539 | + pcie_width = 1; | |
| 1540 | + | |
| 1541 | + for (i = 0; i < NUM_LINK_LEVELS; i++) { | |
| 1542 | + if (pp_table->PcieGenSpeed[i] > pcie_gen) | |
| 1543 | + pp_table->PcieGenSpeed[i] = pcie_gen; | |
| 1544 | + | |
| 1545 | + if (pp_table->PcieLaneCount[i] > pcie_width) | |
| 1546 | + pp_table->PcieLaneCount[i] = pcie_width; | |
| 1547 | + } | |
| 1548 | + | |
| 1549 | + if (data->registry_data.pcie_dpm_key_disabled) { | |
| 1550 | + for (i = 0; i < NUM_LINK_LEVELS; i++) { | |
| 1551 | + pp_table->PcieGenSpeed[i] = pcie_gen; | |
| 1552 | + pp_table->PcieLaneCount[i] = pcie_width; | |
| 1553 | + } | |
| 1554 | + } | |
| 1555 | + | |
| 1556 | + return 0; | |
| 1557 | +} | |
| 1558 | + | |
| 1508 | 1559 | static int vega10_populate_smc_link_levels(struct pp_hwmgr *hwmgr) |
| 1509 | 1560 | { |
| 1510 | 1561 | int result = -1; |
| @@ -2556,6 +2607,11 @@ static int vega10_init_smc_table(struct pp_hwmgr *hwmgr) · 1045 unmodified lines | ||
| 2556 | 2607 | "Failed to initialize Link Level!", |
| 2557 | 2608 | return result); |
| 2558 | 2609 | |
| 2610 | + result = vega10_override_pcie_parameters(hwmgr); | |
| 2611 | + PP_ASSERT_WITH_CODE(!result, | |
| 2612 | + "Failed to override pcie parameters!", | |
| 2613 | + return result); | |
| 2614 | + | |
| 2559 | 2615 | result = vega10_populate_all_graphic_levels(hwmgr); |
| 2560 | 2616 | PP_ASSERT_WITH_CODE(!result, |
| 2561 | 2617 | "Failed to initialize Graphics Level!", |
| @@ -2919,9 +2975,18 @@ static int vega10_start_dpm(struct pp_hwmgr *hwmgr, uint32_t bitmap) · 357 unmodified lines | ||
| 2919 | 2975 | } |
| 2920 | 2976 | } |
| 2921 | 2977 | |
| 2978 | + if (data->registry_data.pcie_dpm_key_disabled) { | |
| 2979 | + PP_ASSERT_WITH_CODE(!vega10_enable_smc_features(hwmgr, | |
| 2980 | + false, data->smu_features[GNLD_DPM_LINK].smu_feature_bitmap), | |
| 2981 | + "Attempt to Disable Link DPM feature Failed!", return -EINVAL); | |
| 2982 | + data->smu_features[GNLD_DPM_LINK].enabled = false; | |
| 2983 | + data->smu_features[GNLD_DPM_LINK].supported = false; | |
| 2984 | + } | |
| 2985 | + | |
| 2922 | 2986 | return 0; |
| 2923 | 2987 | } |
| 2924 | 2988 | |
| 2989 | + | |
| 2925 | 2990 | static int vega10_enable_disable_PCC_limit_feature(struct pp_hwmgr *hwmgr, bool enable) |
| 2926 | 2991 | { |
| 2927 | 2992 | struct vega10_hwmgr *data = hwmgr->backend; |
| @@ -4536,6 +4601,24 @@ static int vega10_set_ppfeature_status(struct pp_hwmgr *hwmgr, uint64_t new_ppfe · 1608 unmodified lines | ||
| 4536 | 4601 | return 0; |
| 4537 | 4602 | } |
| 4538 | 4603 | |
| 4604 | +static int vega10_get_current_pcie_link_width_level(struct pp_hwmgr *hwmgr) | |
| 4605 | +{ | |
| 4606 | + struct amdgpu_device *adev = hwmgr->adev; | |
| 4607 | + | |
| 4608 | + return (RREG32_PCIE(smnPCIE_LC_LINK_WIDTH_CNTL) & | |
| 4609 | + PCIE_LC_LINK_WIDTH_CNTL__LC_LINK_WIDTH_RD_MASK) | |
| 4610 | + >> PCIE_LC_LINK_WIDTH_CNTL__LC_LINK_WIDTH_RD__SHIFT; | |
| 4611 | +} | |
| 4612 | + | |
| 4613 | +static int vega10_get_current_pcie_link_speed_level(struct pp_hwmgr *hwmgr) | |
| 4614 | +{ | |
| 4615 | + struct amdgpu_device *adev = hwmgr->adev; | |
| 4616 | + | |
| 4617 | + return (RREG32_PCIE(smnPCIE_LC_SPEED_CNTL) & | |
| 4618 | + PSWUSP0_PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE_MASK) | |
| 4619 | + >> PSWUSP0_PCIE_LC_SPEED_CNTL__LC_CURRENT_DATA_RATE__SHIFT; | |
| 4620 | +} | |
| 4621 | + | |
| 4539 | 4622 | static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, |
| 4540 | 4623 | enum pp_clock_type type, char *buf) |
| 4541 | 4624 | { |
| @@ -4544,8 +4627,9 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, · 2 unmodified lines | ||
| 4544 | 4627 | struct vega10_single_dpm_table *mclk_table = &(data->dpm_table.mem_table); |
| 4545 | 4628 | struct vega10_single_dpm_table *soc_table = &(data->dpm_table.soc_table); |
| 4546 | 4629 | struct vega10_single_dpm_table *dcef_table = &(data->dpm_table.dcef_table); |
| 4547 | − struct vega10_pcie_table *pcie_table = &(data->dpm_table.pcie_table); | |
| 4548 | 4630 | struct vega10_odn_clock_voltage_dependency_table *podn_vdd_dep = NULL; |
| 4631 | + uint32_t gen_speed, lane_width, current_gen_speed, current_lane_width; | |
| 4632 | + PPTable_t *pptable = &(data->smc_state_table.pp_table); | |
| 4549 | 4633 | |
| 4550 | 4634 | int i, now, size = 0, count = 0; |
| 4551 | 4635 | |
| @@ -4602,15 +4686,31 @@ static int vega10_print_clock_levels(struct pp_hwmgr *hwmgr, · 50 unmodified lines | ||
| 4602 | 4686 | "*" : ""); |
| 4603 | 4687 | break; |
| 4604 | 4688 | case PP_PCIE: |
| 4605 | − smum_send_msg_to_smc(hwmgr, PPSMC_MSG_GetCurrentLinkIndex, &now); | |
| 4606 | − | |
| 4607 | − for (i = 0; i < pcie_table->count; i++) | |
| 4608 | − size += sprintf(buf + size, "%d: %s %s\n", i, | |
| 4609 | − (pcie_table->pcie_gen[i] == 0) ? "2.5GT/s, x1" : | |
| 4610 | − (pcie_table->pcie_gen[i] == 1) ? "5.0GT/s, x16" : | |
| 4611 | − (pcie_table->pcie_gen[i] == 2) ? "8.0GT/s, x16" : "", | |
| 4612 | − (i == now) ? "*" : ""); | |
| 4689 | + current_gen_speed = | |
| 4690 | + vega10_get_current_pcie_link_speed_level(hwmgr); | |
| 4691 | + current_lane_width = | |
| 4692 | + vega10_get_current_pcie_link_width_level(hwmgr); | |
| 4693 | + for (i = 0; i < NUM_LINK_LEVELS; i++) { | |
| 4694 | + gen_speed = pptable->PcieGenSpeed[i]; | |
| 4695 | + lane_width = pptable->PcieLaneCount[i]; | |
| 4696 | + | |
| 4697 | + size += sprintf(buf + size, "%d: %s %s %s\n", i, | |
| 4698 | + (gen_speed == 0) ? "2.5GT/s," : | |
| 4699 | + (gen_speed == 1) ? "5.0GT/s," : | |
| 4700 | + (gen_speed == 2) ? "8.0GT/s," : | |
| 4701 | + (gen_speed == 3) ? "16.0GT/s," : "", | |
| 4702 | + (lane_width == 1) ? "x1" : | |
| 4703 | + (lane_width == 2) ? "x2" : | |
| 4704 | + (lane_width == 3) ? "x4" : | |
| 4705 | + (lane_width == 4) ? "x8" : | |
| 4706 | + (lane_width == 5) ? "x12" : | |
| 4707 | + (lane_width == 6) ? "x16" : "", | |
| 4708 | + (current_gen_speed == gen_speed) && | |
| 4709 | + (current_lane_width == lane_width) ? | |
| 4710 | + "*" : ""); | |
| 4711 | + } | |
| 4613 | 4712 | break; |
| 4713 | + | |
| 4614 | 4714 | case OD_SCLK: |
| 4615 | 4715 | if (hwmgr->od_enabled) { |
| 4616 | 4716 | size = sprintf(buf, "%s:\n", "OD_SCLK"); |
| @@ -133,6 +133,7 @@ static void vega12_set_default_registry_data(struct pp_hwmgr *hwmgr) · 132 unmodified lines | ||
| 133 | 133 | data->registry_data.auto_wattman_debug = 0; |
| 134 | 134 | data->registry_data.auto_wattman_sample_period = 100; |
| 135 | 135 | data->registry_data.auto_wattman_threshold = 50; |
| 136 | + data->registry_data.pcie_dpm_key_disabled = !(hwmgr->feature_mask & PP_PCIE_DPM_MASK); | |
| 136 | 137 | } |
| 137 | 138 | |
| 138 | 139 | static int vega12_set_features_platform_caps(struct pp_hwmgr *hwmgr) |
| @@ -481,6 +482,90 @@ static void vega12_init_dpm_state(struct vega12_dpm_state *dpm_state) · 342 unmodified lines | ||
| 481 | 482 | dpm_state->hard_max_level = 0xffff; |
| 482 | 483 | } |
| 483 | 484 | |
| 485 | +static int vega12_override_pcie_parameters(struct pp_hwmgr *hwmgr) | |
| 486 | +{ | |
| 487 | + struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); | |
| 488 | + struct vega12_hwmgr *data = | |
| 489 | + (struct vega12_hwmgr *)(hwmgr->backend); | |
| 490 | + uint32_t pcie_gen = 0, pcie_width = 0, smu_pcie_arg, pcie_gen_arg, pcie_width_arg; | |
| 491 | + PPTable_t *pp_table = &(data->smc_state_table.pp_table); | |
| 492 | + int i; | |
| 493 | + int ret; | |
| 494 | + | |
| 495 | + if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN4) | |
| 496 | + pcie_gen = 3; | |
| 497 | + else if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN3) | |
| 498 | + pcie_gen = 2; | |
| 499 | + else if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN2) | |
| 500 | + pcie_gen = 1; | |
| 501 | + else if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN1) | |
| 502 | + pcie_gen = 0; | |
| 503 | + | |
| 504 | + if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X16) | |
| 505 | + pcie_width = 6; | |
| 506 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X12) | |
| 507 | + pcie_width = 5; | |
| 508 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X8) | |
| 509 | + pcie_width = 4; | |
| 510 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X4) | |
| 511 | + pcie_width = 3; | |
| 512 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X2) | |
| 513 | + pcie_width = 2; | |
| 514 | + else if (adev->pm.pcie_mlw_mask & CAIL_PCIE_LINK_WIDTH_SUPPORT_X1) | |
| 515 | + pcie_width = 1; | |
| 516 | + | |
| 517 | + /* Bit 31:16: LCLK DPM level. 0 is DPM0, and 1 is DPM1 | |
| 518 | + * Bit 15:8: PCIE GEN, 0 to 3 corresponds to GEN1 to GEN4 | |
| 519 | + * Bit 7:0: PCIE lane width, 1 to 7 corresponds is x1 to x32 | |
| 520 | + */ | |
| 521 | + for (i = 0; i < NUM_LINK_LEVELS; i++) { | |
| 522 | + pcie_gen_arg = (pp_table->PcieGenSpeed[i] > pcie_gen) ? pcie_gen : | |
| 523 | + pp_table->PcieGenSpeed[i]; | |
| 524 | + pcie_width_arg = (pp_table->PcieLaneCount[i] > pcie_width) ? pcie_width : | |
| 525 | + pp_table->PcieLaneCount[i]; | |
| 526 | + | |
| 527 | + if (pcie_gen_arg != pp_table->PcieGenSpeed[i] || pcie_width_arg != | |
| 528 | + pp_table->PcieLaneCount[i]) { | |
| 529 | + smu_pcie_arg = (i << 16) | (pcie_gen_arg << 8) | pcie_width_arg; | |
| 530 | + ret = smum_send_msg_to_smc_with_parameter(hwmgr, | |
| 531 | + PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, | |
| 532 | + NULL); | |
| 533 | + PP_ASSERT_WITH_CODE(!ret, | |
| 534 | + "[OverridePcieParameters] Attempt to override pcie params failed!", | |
| 535 | + return ret); | |
| 536 | + } | |
| 537 | + | |
| 538 | + /* update the pptable */ | |
| 539 | + pp_table->PcieGenSpeed[i] = pcie_gen_arg; | |
| 540 | + pp_table->PcieLaneCount[i] = pcie_width_arg; | |
| 541 | + } | |
| 542 | + | |
| 543 | + /* override to the highest if it's disabled from ppfeaturmask */ | |
| 544 | + if (data->registry_data.pcie_dpm_key_disabled) { | |
| 545 | + for (i = 0; i < NUM_LINK_LEVELS; i++) { | |
| 546 | + smu_pcie_arg = (i << 16) | (pcie_gen << 8) | pcie_width; | |
| 547 | + ret = smum_send_msg_to_smc_with_parameter(hwmgr, | |
| 548 | + PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, | |
| 549 | + NULL); | |
| 550 | + PP_ASSERT_WITH_CODE(!ret, | |
| 551 | + "[OverridePcieParameters] Attempt to override pcie params failed!", | |
| 552 | + return ret); | |
| 553 | + | |
| 554 | + pp_table->PcieGenSpeed[i] = pcie_gen; | |
| 555 | + pp_table->PcieLaneCount[i] = pcie_width; | |
| 556 | + } | |
| 557 | + ret = vega12_enable_smc_features(hwmgr, | |
| 558 | + false, | |
| 559 | + data->smu_features[GNLD_DPM_LINK].smu_feature_bitmap); | |
| 560 | + PP_ASSERT_WITH_CODE(!ret, | |
| 561 | + "Attempt to Disable DPM LINK Failed!", | |
| 562 | + return ret); | |
| 563 | + data->smu_features[GNLD_DPM_LINK].enabled = false; | |
| 564 | + data->smu_features[GNLD_DPM_LINK].supported = false; | |
| 565 | + } | |
| 566 | + return 0; | |
| 567 | +} | |
| 568 | + | |
| 484 | 569 | static int vega12_get_number_of_dpm_level(struct pp_hwmgr *hwmgr, |
| 485 | 570 | PPCLK_e clk_id, uint32_t *num_of_levels) |
| 486 | 571 | { |
| @@ -968,6 +1053,11 @@ static int vega12_enable_dpm_tasks(struct pp_hwmgr *hwmgr) · 481 unmodified lines | ||
| 968 | 1053 | "Failed to enable all smu features!", |
| 969 | 1054 | return result); |
| 970 | 1055 | |
| 1056 | + result = vega12_override_pcie_parameters(hwmgr); | |
| 1057 | + PP_ASSERT_WITH_CODE(!result, | |
| 1058 | + "[EnableDPMTasks] Failed to override pcie parameters!", | |
| 1059 | + return result); | |
| 1060 | + | |
| 971 | 1061 | tmp_result = vega12_power_control_set_level(hwmgr); |
| 972 | 1062 | PP_ASSERT_WITH_CODE(!tmp_result, |
| 973 | 1063 | "Failed to power control set level!", |
| @@ -171,6 +171,7 @@ static void vega20_set_default_registry_data(struct pp_hwmgr *hwmgr) · 170 unmodified lines | ||
| 171 | 171 | data->registry_data.gfxoff_controlled_by_driver = 1; |
| 172 | 172 | data->gfxoff_allowed = false; |
| 173 | 173 | data->counter_gfxoff = 0; |
| 174 | + data->registry_data.pcie_dpm_key_disabled = !(hwmgr->feature_mask & PP_PCIE_DPM_MASK); | |
| 174 | 175 | } |
| 175 | 176 | |
| 176 | 177 | static int vega20_set_features_platform_caps(struct pp_hwmgr *hwmgr) |
| @@ -831,7 +832,9 @@ static int vega20_override_pcie_parameters(struct pp_hwmgr *hwmgr) · 654 unmodified lines | ||
| 831 | 832 | struct amdgpu_device *adev = (struct amdgpu_device *)(hwmgr->adev); |
| 832 | 833 | struct vega20_hwmgr *data = |
| 833 | 834 | (struct vega20_hwmgr *)(hwmgr->backend); |
| 834 | − uint32_t pcie_gen = 0, pcie_width = 0, smu_pcie_arg; | |
| 835 | + uint32_t pcie_gen = 0, pcie_width = 0, smu_pcie_arg, pcie_gen_arg, pcie_width_arg; | |
| 836 | + PPTable_t *pp_table = &(data->smc_state_table.pp_table); | |
| 837 | + int i; | |
| 835 | 838 | int ret; |
| 836 | 839 | |
| 837 | 840 | if (adev->pm.pcie_gen_mask & CAIL_PCIE_LINK_SPEED_SUPPORT_GEN4) |
| @@ -860,17 +863,51 @@ static int vega20_override_pcie_parameters(struct pp_hwmgr *hwmgr) · 22 unmodified lines | ||
| 860 | 863 | * Bit 15:8: PCIE GEN, 0 to 3 corresponds to GEN1 to GEN4 |
| 861 | 864 | * Bit 7:0: PCIE lane width, 1 to 7 corresponds is x1 to x32 |
| 862 | 865 | */ |
| 863 | − smu_pcie_arg = (1 << 16) | (pcie_gen << 8) | pcie_width; | |
| 864 | − ret = smum_send_msg_to_smc_with_parameter(hwmgr, | |
| 865 | − PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, | |
| 866 | − NULL); | |
| 867 | − PP_ASSERT_WITH_CODE(!ret, | |
| 868 | − "[OverridePcieParameters] Attempt to override pcie params failed!", | |
| 869 | − return ret); | |
| 866 | + for (i = 0; i < NUM_LINK_LEVELS; i++) { | |
| 867 | + pcie_gen_arg = (pp_table->PcieGenSpeed[i] > pcie_gen) ? pcie_gen : | |
| 868 | + pp_table->PcieGenSpeed[i]; | |
| 869 | + pcie_width_arg = (pp_table->PcieLaneCount[i] > pcie_width) ? pcie_width : | |
| 870 | + pp_table->PcieLaneCount[i]; | |
| 871 | + | |
| 872 | + if (pcie_gen_arg != pp_table->PcieGenSpeed[i] || pcie_width_arg != | |
| 873 | + pp_table->PcieLaneCount[i]) { | |
| 874 | + smu_pcie_arg = (i << 16) | (pcie_gen_arg << 8) | pcie_width_arg; | |
| 875 | + ret = smum_send_msg_to_smc_with_parameter(hwmgr, | |
| 876 | + PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, | |
| 877 | + NULL); | |
| 878 | + PP_ASSERT_WITH_CODE(!ret, | |
| 879 | + "[OverridePcieParameters] Attempt to override pcie params failed!", | |
| 880 | + return ret); | |
| 881 | + } | |
| 882 | + | |
| 883 | + /* update the pptable */ | |
| 884 | + pp_table->PcieGenSpeed[i] = pcie_gen_arg; | |
| 885 | + pp_table->PcieLaneCount[i] = pcie_width_arg; | |
| 886 | + } | |
| 887 | + | |
| 888 | + /* override to the highest if it's disabled from ppfeaturmask */ | |
| 889 | + if (data->registry_data.pcie_dpm_key_disabled) { | |
| 890 | + for (i = 0; i < NUM_LINK_LEVELS; i++) { | |
| 891 | + smu_pcie_arg = (i << 16) | (pcie_gen << 8) | pcie_width; | |
| 892 | + ret = smum_send_msg_to_smc_with_parameter(hwmgr, | |
| 893 | + PPSMC_MSG_OverridePcieParameters, smu_pcie_arg, | |
| 894 | + NULL); | |
| 895 | + PP_ASSERT_WITH_CODE(!ret, | |
| 896 | + "[OverridePcieParameters] Attempt to override pcie params failed!", | |
| 897 | + return ret); | |
| 870 | 898 | |
| 871 | − data->pcie_parameters_override = true; | |
| 872 | − data->pcie_gen_level1 = pcie_gen; | |
| 873 | − data->pcie_width_level1 = pcie_width; | |
| 899 | + pp_table->PcieGenSpeed[i] = pcie_gen; | |
| 900 | + pp_table->PcieLaneCount[i] = pcie_width; | |
| 901 | + } | |
| 902 | + ret = vega20_enable_smc_features(hwmgr, | |
| 903 | + false, | |
| 904 | + data->smu_features[GNLD_DPM_LINK].smu_feature_bitmap); | |
| 905 | + PP_ASSERT_WITH_CODE(!ret, | |
| 906 | + "Attempt to Disable DPM LINK Failed!", | |
| 907 | + return ret); | |
| 908 | + data->smu_features[GNLD_DPM_LINK].enabled = false; | |
| 909 | + data->smu_features[GNLD_DPM_LINK].supported = false; | |
| 910 | + } | |
| 874 | 911 | |
| 875 | 912 | return 0; |
| 876 | 913 | } |
| @@ -3319,9 +3356,7 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 2442 unmodified lines | ||
| 3319 | 3356 | data->od8_settings.od8_settings_array; |
| 3320 | 3357 | OverDriveTable_t *od_table = |
| 3321 | 3358 | &(data->smc_state_table.overdrive_table); |
| 3322 | − struct phm_ppt_v3_information *pptable_information = | |
| 3323 | − (struct phm_ppt_v3_information *)hwmgr->pptable; | |
| 3324 | − PPTable_t *pptable = (PPTable_t *)pptable_information->smc_pptable; | |
| 3359 | + PPTable_t *pptable = &(data->smc_state_table.pp_table); | |
| 3325 | 3360 | struct pp_clock_levels_with_latency clocks; |
| 3326 | 3361 | struct vega20_single_dpm_table *fclk_dpm_table = |
| 3327 | 3362 | &(data->dpm_table.fclk_table); |
| @@ -3420,13 +3455,9 @@ static int vega20_print_clock_levels(struct pp_hwmgr *hwmgr, · 92 unmodified lines | ||
| 3420 | 3455 | current_lane_width = |
| 3421 | 3456 | vega20_get_current_pcie_link_width_level(hwmgr); |
| 3422 | 3457 | for (i = 0; i < NUM_LINK_LEVELS; i++) { |
| 3423 | − if (i == 1 && data->pcie_parameters_override) { | |
| 3424 | − gen_speed = data->pcie_gen_level1; | |
| 3425 | − lane_width = data->pcie_width_level1; | |
| 3426 | − } else { | |
| 3427 | − gen_speed = pptable->PcieGenSpeed[i]; | |
| 3428 | − lane_width = pptable->PcieLaneCount[i]; | |
| 3429 | − } | |
| 3458 | + gen_speed = pptable->PcieGenSpeed[i]; | |
| 3459 | + lane_width = pptable->PcieLaneCount[i]; | |
| 3460 | + | |
| 3430 | 3461 | size += sprintf(buf + size, "%d: %s %s %dMhz %s\n", i, |
| 3431 | 3462 | (gen_speed == 0) ? "2.5GT/s," : |
| 3432 | 3463 | (gen_speed == 1) ? "5.0GT/s," : |
| @@ -1294,7 +1294,7 @@ static int smu_disable_dpms(struct smu_context *smu) · 1293 unmodified lines | ||
| 1294 | 1294 | bool use_baco = !smu->is_apu && |
| 1295 | 1295 | ((amdgpu_in_reset(adev) && |
| 1296 | 1296 | (amdgpu_asic_reset_method(adev) == AMD_RESET_METHOD_BACO)) || |
| 1297 | − ((adev->in_runpm || adev->in_hibernate) && amdgpu_asic_supports_baco(adev))); | |
| 1297 | + ((adev->in_runpm || adev->in_s4) && amdgpu_asic_supports_baco(adev))); | |
| 1298 | 1298 | |
| 1299 | 1299 | /* |
| 1300 | 1300 | * For custom pptable uploading, skip the DPM features |
| @@ -1431,7 +1431,8 @@ static int smu_suspend(void *handle) · 130 unmodified lines | ||
| 1431 | 1431 | |
| 1432 | 1432 | smu->watermarks_bitmap &= ~(WATERMARKS_LOADED); |
| 1433 | 1433 | |
| 1434 | − if (smu->is_apu) | |
| 1434 | + /* skip CGPG when in S0ix */ | |
| 1435 | + if (smu->is_apu && !adev->in_s0ix) | |
| 1435 | 1436 | smu_set_gfx_cgpg(&adev->smu, false); |
| 1436 | 1437 | |
| 1437 | 1438 | return 0; |
| @@ -384,10 +384,15 @@ static int vangogh_dpm_set_jpeg_enable(struct smu_context *smu, bool enable) · 383 unmodified lines | ||
| 384 | 384 | |
| 385 | 385 | static bool vangogh_is_dpm_running(struct smu_context *smu) |
| 386 | 386 | { |
| 387 | + struct amdgpu_device *adev = smu->adev; | |
| 387 | 388 | int ret = 0; |
| 388 | 389 | uint32_t feature_mask[2]; |
| 389 | 390 | uint64_t feature_enabled; |
| 390 | 391 | |
| 392 | + /* we need to re-init after suspend so return false */ | |
| 393 | + if (adev->in_suspend) | |
| 394 | + return false; | |
| 395 | + | |
| 391 | 396 | ret = smu_cmn_get_enabled_32_bits_mask(smu, feature_mask, 2); |
| 392 | 397 | |
| 393 | 398 | if (ret) |
| @@ -2048,7 +2048,7 @@ static void drm_fbdev_cleanup(struct drm_fb_helper *fb_helper) · 2047 unmodified lines | ||
| 2048 | 2048 | |
| 2049 | 2049 | if (shadow) |
| 2050 | 2050 | vfree(shadow); |
| 2051 | − else | |
| 2051 | + else if (fb_helper->buffer) | |
| 2052 | 2052 | drm_client_buffer_vunmap(fb_helper->buffer); |
| 2053 | 2053 | |
| 2054 | 2054 | drm_client_framebuffer_delete(fb_helper->buffer); |
| @@ -357,13 +357,14 @@ static void drm_gem_shmem_vunmap_locked(struct drm_gem_shmem_object *shmem, · 356 unmodified lines | ||
| 357 | 357 | if (--shmem->vmap_use_count > 0) |
| 358 | 358 | return; |
| 359 | 359 | |
| 360 | − if (obj->import_attach) | |
| 360 | + if (obj->import_attach) { | |
| 361 | 361 | dma_buf_vunmap(obj->import_attach->dmabuf, map); |
| 362 | − else | |
| 362 | + } else { | |
| 363 | 363 | vunmap(shmem->vaddr); |
| 364 | + drm_gem_shmem_put_pages(shmem); | |
| 365 | + } | |
| 364 | 366 | |
| 365 | 367 | shmem->vaddr = NULL; |
| 366 | − drm_gem_shmem_put_pages(shmem); | |
| 367 | 368 | } |
| 368 | 369 | |
| 369 | 370 | /* |
| @@ -525,14 +526,28 @@ static vm_fault_t drm_gem_shmem_fault(struct vm_fault *vmf) · 155 unmodified lines | ||
| 525 | 526 | struct drm_gem_object *obj = vma->vm_private_data; |
| 526 | 527 | struct drm_gem_shmem_object *shmem = to_drm_gem_shmem_obj(obj); |
| 527 | 528 | loff_t num_pages = obj->size >> PAGE_SHIFT; |
| 529 | + vm_fault_t ret; | |
| 528 | 530 | struct page *page; |
| 531 | + pgoff_t page_offset; | |
| 529 | 532 | |
| 530 | − if (vmf->pgoff >= num_pages || WARN_ON_ONCE(!shmem->pages)) | |
| 531 | − return VM_FAULT_SIGBUS; | |
| 533 | + /* We don't use vmf->pgoff since that has the fake offset */ | |
| 534 | + page_offset = (vmf->address - vma->vm_start) >> PAGE_SHIFT; | |
| 532 | 535 | |
| 533 | − page = shmem->pages[vmf->pgoff]; | |
| 536 | + mutex_lock(&shmem->pages_lock); | |
| 534 | 537 | |
| 535 | − return vmf_insert_page(vma, vmf->address, page); | |
| 538 | + if (page_offset >= num_pages || | |
| 539 | + WARN_ON_ONCE(!shmem->pages) || | |
| 540 | + shmem->madv < 0) { | |
| 541 | + ret = VM_FAULT_SIGBUS; | |
| 542 | + } else { | |
| 543 | + page = shmem->pages[page_offset]; | |
| 544 | + | |
| 545 | + ret = vmf_insert_page(vma, vmf->address, page); | |
| 546 | + } | |
| 547 | + | |
| 548 | + mutex_unlock(&shmem->pages_lock); | |
| 549 | + | |
| 550 | + return ret; | |
| 536 | 551 | } |
| 537 | 552 | |
| 538 | 553 | static void drm_gem_shmem_vm_open(struct vm_area_struct *vma) |
| @@ -581,9 +596,6 @@ int drm_gem_shmem_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) · 42 unmodified lines | ||
| 581 | 596 | struct drm_gem_shmem_object *shmem; |
| 582 | 597 | int ret; |
| 583 | 598 | |
| 584 | − /* Remove the fake offset */ | |
| 585 | − vma->vm_pgoff -= drm_vma_node_start(&obj->vma_node); | |
| 586 | − | |
| 587 | 599 | if (obj->import_attach) { |
| 588 | 600 | /* Drop the reference drm_gem_mmap_obj() acquired.*/ |
| 589 | 601 | drm_gem_object_put(obj); |
| @@ -99,6 +99,8 @@ static int compat_drm_version(struct file *file, unsigned int cmd, · 98 unmodified lines | ||
| 99 | 99 | if (copy_from_user(&v32, (void __user *)arg, sizeof(v32))) |
| 100 | 100 | return -EFAULT; |
| 101 | 101 | |
| 102 | + memset(&v, 0, sizeof(v)); | |
| 103 | + | |
| 102 | 104 | v = (struct drm_version) { |
| 103 | 105 | .name_len = v32.name_len, |
| 104 | 106 | .name = compat_ptr(v32.name), |
| @@ -137,6 +139,9 @@ static int compat_drm_getunique(struct file *file, unsigned int cmd, · 32 unmodified lines | ||
| 137 | 139 | |
| 138 | 140 | if (copy_from_user(&uq32, (void __user *)arg, sizeof(uq32))) |
| 139 | 141 | return -EFAULT; |
| 142 | + | |
| 143 | + memset(&uq, 0, sizeof(uq)); | |
| 144 | + | |
| 140 | 145 | uq = (struct drm_unique){ |
| 141 | 146 | .unique_len = uq32.unique_len, |
| 142 | 147 | .unique = compat_ptr(uq32.unique), |
| @@ -265,6 +270,8 @@ static int compat_drm_getclient(struct file *file, unsigned int cmd, · 122 unmodified lines | ||
| 265 | 270 | if (copy_from_user(&c32, argp, sizeof(c32))) |
| 266 | 271 | return -EFAULT; |
| 267 | 272 | |
| 273 | + memset(&client, 0, sizeof(client)); | |
| 274 | + | |
| 268 | 275 | client.idx = c32.idx; |
| 269 | 276 | |
| 270 | 277 | err = drm_ioctl_kernel(file, drm_getclient, &client, 0); |
| @@ -852,6 +859,8 @@ static int compat_drm_wait_vblank(struct file *file, unsigned int cmd, · 581 unmodified lines | ||
| 852 | 859 | if (copy_from_user(&req32, argp, sizeof(req32))) |
| 853 | 860 | return -EFAULT; |
| 854 | 861 | |
| 862 | + memset(&req, 0, sizeof(req)); | |
| 863 | + | |
| 855 | 864 | req.request.type = req32.request.type; |
| 856 | 865 | req.request.sequence = req32.request.sequence; |
| 857 | 866 | req.request.signal = req32.request.signal; |
| @@ -889,6 +898,8 @@ static int compat_drm_mode_addfb2(struct file *file, unsigned int cmd, · 31 unmodified lines | ||
| 889 | 898 | struct drm_mode_fb_cmd2 req64; |
| 890 | 899 | int err; |
| 891 | 900 | |
| 901 | + memset(&req64, 0, sizeof(req64)); | |
| 902 | + | |
| 892 | 903 | if (copy_from_user(&req64, argp, |
| 893 | 904 | offsetof(drm_mode_fb_cmd232_t, modifier))) |
| 894 | 905 | return -EFAULT; |
| @@ -689,7 +689,8 @@ static int etnaviv_gem_userptr_get_pages(struct etnaviv_gem_object *etnaviv_obj) · 688 unmodified lines | ||
| 689 | 689 | struct page **pages = pvec + pinned; |
| 690 | 690 | |
| 691 | 691 | ret = pin_user_pages_fast(ptr, num_pages, |
| 692 | − !userptr->ro ? FOLL_WRITE : 0, pages); | |
| 692 | + FOLL_WRITE | FOLL_FORCE | FOLL_LONGTERM, | |
| 693 | + pages); | |
| 693 | 694 | if (ret < 0) { |
| 694 | 695 | unpin_user_pages(pvec, pinned); |
| 695 | 696 | kvfree(pvec); |
| @@ -13,7 +13,6 @@ · 12 unmodified lines | ||
| 13 | 13 | #include <linux/irq.h> |
| 14 | 14 | #include <linux/mfd/syscon.h> |
| 15 | 15 | #include <linux/of_device.h> |
| 16 | −#include <linux/of_gpio.h> | |
| 17 | 16 | #include <linux/platform_device.h> |
| 18 | 17 | #include <linux/pm_runtime.h> |
| 19 | 18 | #include <linux/regmap.h> |
| @@ -84,13 +84,31 @@ static void intel_dsm_platform_mux_info(acpi_handle dhandle) · 83 unmodified lines | ||
| 84 | 84 | return; |
| 85 | 85 | } |
| 86 | 86 | |
| 87 | + if (!pkg->package.count) { | |
| 88 | + DRM_DEBUG_DRIVER("no connection in _DSM\n"); | |
| 89 | + return; | |
| 90 | + } | |
| 91 | + | |
| 87 | 92 | connector_count = &pkg->package.elements[0]; |
| 88 | 93 | DRM_DEBUG_DRIVER("MUX info connectors: %lld\n", |
| 89 | 94 | (unsigned long long)connector_count->integer.value); |
| 90 | 95 | for (i = 1; i < pkg->package.count; i++) { |
| 91 | 96 | union acpi_object *obj = &pkg->package.elements[i]; |
| 92 | − union acpi_object *connector_id = &obj->package.elements[0]; | |
| 93 | − union acpi_object *info = &obj->package.elements[1]; | |
| 97 | + union acpi_object *connector_id; | |
| 98 | + union acpi_object *info; | |
| 99 | + | |
| 100 | + if (obj->type != ACPI_TYPE_PACKAGE || obj->package.count < 2) { | |
| 101 | + DRM_DEBUG_DRIVER("Invalid object for MUX #%d\n", i); | |
| 102 | + continue; | |
| 103 | + } | |
| 104 | + | |
| 105 | + connector_id = &obj->package.elements[0]; | |
| 106 | + info = &obj->package.elements[1]; | |
| 107 | + if (info->type != ACPI_TYPE_BUFFER || info->buffer.length < 4) { | |
| 108 | + DRM_DEBUG_DRIVER("Invalid info for MUX obj #%d\n", i); | |
| 109 | + continue; | |
| 110 | + } | |
| 111 | + | |
| 94 | 112 | DRM_DEBUG_DRIVER("Connector id: 0x%016llx\n", |
| 95 | 113 | (unsigned long long)connector_id->integer.value); |
| 96 | 114 | DRM_DEBUG_DRIVER(" port id: %s\n", |
| @@ -317,12 +317,13 @@ int intel_plane_atomic_check_with_state(const struct intel_crtc_state *old_crtc_ · 316 unmodified lines | ||
| 317 | 317 | if (!new_plane_state->hw.crtc && !old_plane_state->hw.crtc) |
| 318 | 318 | return 0; |
| 319 | 319 | |
| 320 | − new_crtc_state->enabled_planes |= BIT(plane->id); | |
| 321 | − | |
| 322 | 320 | ret = plane->check_plane(new_crtc_state, new_plane_state); |
| 323 | 321 | if (ret) |
| 324 | 322 | return ret; |
| 325 | 323 | |
| 324 | + if (fb) | |
| 325 | + new_crtc_state->enabled_planes |= BIT(plane->id); | |
| 326 | + | |
| 326 | 327 | /* FIXME pre-g4x don't work like this */ |
| 327 | 328 | if (new_plane_state->uapi.visible) |
| 328 | 329 | new_crtc_state->active_planes |= BIT(plane->id); |
| @@ -3619,9 +3619,7 @@ intel_dp_get_dpcd(struct intel_dp *intel_dp) · 3618 unmodified lines | ||
| 3619 | 3619 | { |
| 3620 | 3620 | int ret; |
| 3621 | 3621 | |
| 3622 | − intel_dp_lttpr_init(intel_dp); | |
| 3623 | − | |
| 3624 | − if (drm_dp_read_dpcd_caps(&intel_dp->aux, intel_dp->dpcd)) | |
| 3622 | + if (intel_dp_init_lttpr_and_dprx_caps(intel_dp) < 0) | |
| 3625 | 3623 | return false; |
| 3626 | 3624 | |
| 3627 | 3625 | /* |
| @@ -133,6 +133,7 @@ static u32 g4x_get_aux_send_ctl(struct intel_dp *intel_dp, · 132 unmodified lines | ||
| 133 | 133 | else |
| 134 | 134 | precharge = 5; |
| 135 | 135 | |
| 136 | + /* Max timeout value on G4x-BDW: 1.6ms */ | |
| 136 | 137 | if (IS_BROADWELL(dev_priv)) |
| 137 | 138 | timeout = DP_AUX_CH_CTL_TIME_OUT_600us; |
| 138 | 139 | else |
| @@ -159,6 +160,12 @@ static u32 skl_get_aux_send_ctl(struct intel_dp *intel_dp, · 20 unmodified lines | ||
| 159 | 160 | enum phy phy = intel_port_to_phy(i915, dig_port->base.port); |
| 160 | 161 | u32 ret; |
| 161 | 162 | |
| 163 | + /* | |
| 164 | + * Max timeout values: | |
| 165 | + * SKL-GLK: 1.6ms | |
| 166 | + * CNL: 3.2ms | |
| 167 | + * ICL+: 4ms | |
| 168 | + */ | |
| 162 | 169 | ret = DP_AUX_CH_CTL_SEND_BUSY | |
| 163 | 170 | DP_AUX_CH_CTL_DONE | |
| 164 | 171 | DP_AUX_CH_CTL_INTERRUPT | |
| @@ -646,7 +646,6 @@ int intel_dp_aux_init_backlight_funcs(struct intel_connector *connector) · 645 unmodified lines | ||
| 646 | 646 | break; |
| 647 | 647 | case INTEL_BACKLIGHT_DISPLAY_DDI: |
| 648 | 648 | try_intel_interface = true; |
| 649 | − try_vesa_interface = true; | |
| 650 | 649 | break; |
| 651 | 650 | default: |
| 652 | 651 | return -ENODEV; |
| @@ -34,6 +34,11 @@ intel_dp_dump_link_status(const u8 link_status[DP_LINK_STATUS_SIZE]) · 33 unmodified lines | ||
| 34 | 34 | link_status[3], link_status[4], link_status[5]); |
| 35 | 35 | } |
| 36 | 36 | |
| 37 | +static void intel_dp_reset_lttpr_common_caps(struct intel_dp *intel_dp) | |
| 38 | +{ | |
| 39 | + memset(&intel_dp->lttpr_common_caps, 0, sizeof(intel_dp->lttpr_common_caps)); | |
| 40 | +} | |
| 41 | + | |
| 37 | 42 | static void intel_dp_reset_lttpr_count(struct intel_dp *intel_dp) |
| 38 | 43 | { |
| 39 | 44 | intel_dp->lttpr_common_caps[DP_PHY_REPEATER_CNT - |
| @@ -81,19 +86,36 @@ static void intel_dp_read_lttpr_phy_caps(struct intel_dp *intel_dp, · 41 unmodified lines | ||
| 81 | 86 | |
| 82 | 87 | static bool intel_dp_read_lttpr_common_caps(struct intel_dp *intel_dp) |
| 83 | 88 | { |
| 84 | − if (drm_dp_read_lttpr_common_caps(&intel_dp->aux, | |
| 85 | − intel_dp->lttpr_common_caps) < 0) { | |
| 86 | − memset(intel_dp->lttpr_common_caps, 0, | |
| 87 | − sizeof(intel_dp->lttpr_common_caps)); | |
| 89 | + struct drm_i915_private *i915 = dp_to_i915(intel_dp); | |
| 90 | + | |
| 91 | + if (intel_dp_is_edp(intel_dp)) | |
| 88 | 92 | return false; |
| 89 | − } | |
| 93 | + | |
| 94 | + /* | |
| 95 | + * Detecting LTTPRs must be avoided on platforms with an AUX timeout | |
| 96 | + * period < 3.2ms. (see DP Standard v2.0, 2.11.2, 3.6.6.1). | |
| 97 | + */ | |
| 98 | + if (INTEL_GEN(i915) < 10) | |
| 99 | + return false; | |
| 100 | + | |
| 101 | + if (drm_dp_read_lttpr_common_caps(&intel_dp->aux, | |
| 102 | + intel_dp->lttpr_common_caps) < 0) | |
| 103 | + goto reset_caps; | |
| 90 | 104 | |
| 91 | 105 | drm_dbg_kms(&dp_to_i915(intel_dp)->drm, |
| 92 | 106 | "LTTPR common capabilities: %*ph\n", |
| 93 | 107 | (int)sizeof(intel_dp->lttpr_common_caps), |
| 94 | 108 | intel_dp->lttpr_common_caps); |
| 95 | 109 | |
| 110 | + /* The minimum value of LT_TUNABLE_PHY_REPEATER_FIELD_DATA_STRUCTURE_REV is 1.4 */ | |
| 111 | + if (intel_dp->lttpr_common_caps[0] < 0x14) | |
| 112 | + goto reset_caps; | |
| 113 | + | |
| 96 | 114 | return true; |
| 115 | + | |
| 116 | +reset_caps: | |
| 117 | + intel_dp_reset_lttpr_common_caps(intel_dp); | |
| 118 | + return false; | |
| 97 | 119 | } |
| 98 | 120 | |
| 99 | 121 | static bool |
| @@ -106,33 +128,49 @@ intel_dp_set_lttpr_transparent_mode(struct intel_dp *intel_dp, bool enable) · 6 unmodified lines | ||
| 106 | 128 | } |
| 107 | 129 | |
| 108 | 130 | /** |
| 109 | − * intel_dp_lttpr_init - detect LTTPRs and init the LTTPR link training mode | |
| 131 | + * intel_dp_init_lttpr_and_dprx_caps - detect LTTPR and DPRX caps, init the LTTPR link training mode | |
| 110 | 132 | * @intel_dp: Intel DP struct |
| 111 | 133 | * |
| 112 | − * Read the LTTPR common capabilities, switch to non-transparent link training | |
| 113 | − * mode if any is detected and read the PHY capabilities for all detected | |
| 114 | − * LTTPRs. In case of an LTTPR detection error or if the number of | |
| 134 | + * Read the LTTPR common and DPRX capabilities and switch to non-transparent | |
| 135 | + * link training mode if any is detected and read the PHY capabilities for all | |
| 136 | + * detected LTTPRs. In case of an LTTPR detection error or if the number of | |
| 115 | 137 | * LTTPRs is more than is supported (8), fall back to the no-LTTPR, |
| 116 | 138 | * transparent mode link training mode. |
| 117 | 139 | * |
| 118 | 140 | * Returns: |
| 119 | − * >0 if LTTPRs were detected and the non-transparent LT mode was set | |
| 141 | + * >0 if LTTPRs were detected and the non-transparent LT mode was set. The | |
| 142 | + * DPRX capabilities are read out. | |
| 120 | 143 | * 0 if no LTTPRs or more than 8 LTTPRs were detected or in case of a |
| 121 | − * detection failure and the transparent LT mode was set | |
| 144 | + * detection failure and the transparent LT mode was set. The DPRX | |
| 145 | + * capabilities are read out. | |
| 146 | + * <0 Reading out the DPRX capabilities failed. | |
| 122 | 147 | */ |
| 123 | −int intel_dp_lttpr_init(struct intel_dp *intel_dp) | |
| 148 | +int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp) | |
| 124 | 149 | { |
| 125 | 150 | int lttpr_count; |
| 126 | 151 | bool ret; |
| 127 | 152 | int i; |
| 128 | 153 | |
| 129 | − if (intel_dp_is_edp(intel_dp)) | |
| 130 | − return 0; | |
| 131 | − | |
| 132 | 154 | ret = intel_dp_read_lttpr_common_caps(intel_dp); |
| 155 | + | |
| 156 | + /* The DPTX shall read the DPRX caps after LTTPR detection. */ | |
| 157 | + if (drm_dp_read_dpcd_caps(&intel_dp->aux, intel_dp->dpcd)) { | |
| 158 | + intel_dp_reset_lttpr_common_caps(intel_dp); | |
| 159 | + return -EIO; | |
| 160 | + } | |
| 161 | + | |
| 133 | 162 | if (!ret) |
| 134 | 163 | return 0; |
| 135 | 164 | |
| 165 | + /* | |
| 166 | + * The 0xF0000-0xF02FF range is only valid if the DPCD revision is | |
| 167 | + * at least 1.4. | |
| 168 | + */ | |
| 169 | + if (intel_dp->dpcd[DP_DPCD_REV] < 0x14) { | |
| 170 | + intel_dp_reset_lttpr_common_caps(intel_dp); | |
| 171 | + return 0; | |
| 172 | + } | |
| 173 | + | |
| 136 | 174 | lttpr_count = drm_dp_lttpr_count(intel_dp->lttpr_common_caps); |
| 137 | 175 | /* |
| 138 | 176 | * Prevent setting LTTPR transparent mode explicitly if no LTTPRs are |
| @@ -172,7 +210,7 @@ int intel_dp_lttpr_init(struct intel_dp *intel_dp) · 33 unmodified lines | ||
| 172 | 210 | |
| 173 | 211 | return lttpr_count; |
| 174 | 212 | } |
| 175 | −EXPORT_SYMBOL(intel_dp_lttpr_init); | |
| 213 | +EXPORT_SYMBOL(intel_dp_init_lttpr_and_dprx_caps); | |
| 176 | 214 | |
| 177 | 215 | static u8 dp_voltage_max(u8 preemph) |
| 178 | 216 | { |
| @@ -807,7 +845,10 @@ void intel_dp_start_link_train(struct intel_dp *intel_dp, · 628 unmodified lines | ||
| 807 | 845 | * TODO: Reiniting LTTPRs here won't be needed once proper connector |
| 808 | 846 | * HW state readout is added. |
| 809 | 847 | */ |
| 810 | − int lttpr_count = intel_dp_lttpr_init(intel_dp); | |
| 848 | + int lttpr_count = intel_dp_init_lttpr_and_dprx_caps(intel_dp); | |
| 849 | + | |
| 850 | + if (lttpr_count < 0) | |
| 851 | + return; | |
| 811 | 852 | |
| 812 | 853 | if (!intel_dp_link_train_all_phys(intel_dp, crtc_state, lttpr_count)) |
| 813 | 854 | intel_dp_schedule_fallback_link_training(intel_dp, crtc_state); |
| @@ -11,7 +11,7 @@ · 10 unmodified lines | ||
| 11 | 11 | struct intel_crtc_state; |
| 12 | 12 | struct intel_dp; |
| 13 | 13 | |
| 14 | −int intel_dp_lttpr_init(struct intel_dp *intel_dp); | |
| 14 | +int intel_dp_init_lttpr_and_dprx_caps(struct intel_dp *intel_dp); | |
| 15 | 15 | |
| 16 | 16 | void intel_dp_get_adjust_train(struct intel_dp *intel_dp, |
| 17 | 17 | const struct intel_crtc_state *crtc_state, |
| @@ -1014,20 +1014,14 @@ static i915_reg_t dss_ctl1_reg(const struct intel_crtc_state *crtc_state) · 1013 unmodified lines | ||
| 1014 | 1014 | { |
| 1015 | 1015 | enum pipe pipe = to_intel_crtc(crtc_state->uapi.crtc)->pipe; |
| 1016 | 1016 | |
| 1017 | − if (crtc_state->cpu_transcoder == TRANSCODER_EDP) | |
| 1018 | − return DSS_CTL1; | |
| 1019 | − | |
| 1020 | − return ICL_PIPE_DSS_CTL1(pipe); | |
| 1017 | + return is_pipe_dsc(crtc_state) ? ICL_PIPE_DSS_CTL1(pipe) : DSS_CTL1; | |
| 1021 | 1018 | } |
| 1022 | 1019 | |
| 1023 | 1020 | static i915_reg_t dss_ctl2_reg(const struct intel_crtc_state *crtc_state) |
| 1024 | 1021 | { |
| 1025 | 1022 | enum pipe pipe = to_intel_crtc(crtc_state->uapi.crtc)->pipe; |
| 1026 | 1023 | |
| 1027 | − if (crtc_state->cpu_transcoder == TRANSCODER_EDP) | |
| 1028 | − return DSS_CTL2; | |
| 1029 | − | |
| 1030 | − return ICL_PIPE_DSS_CTL2(pipe); | |
| 1024 | + return is_pipe_dsc(crtc_state) ? ICL_PIPE_DSS_CTL2(pipe) : DSS_CTL2; | |
| 1031 | 1025 | } |
| 1032 | 1026 | |
| 1033 | 1027 | void intel_dsc_enable(struct intel_encoder *encoder, |
| @@ -992,14 +992,14 @@ static void intel_dsi_post_disable(struct intel_atomic_state *state, · 991 unmodified lines | ||
| 992 | 992 | * FIXME As we do with eDP, just make a note of the time here |
| 993 | 993 | * and perform the wait before the next panel power on. |
| 994 | 994 | */ |
| 995 | − intel_dsi_msleep(intel_dsi, intel_dsi->panel_pwr_cycle_delay); | |
| 995 | + msleep(intel_dsi->panel_pwr_cycle_delay); | |
| 996 | 996 | } |
| 997 | 997 | |
| 998 | 998 | static void intel_dsi_shutdown(struct intel_encoder *encoder) |
| 999 | 999 | { |
| 1000 | 1000 | struct intel_dsi *intel_dsi = enc_to_intel_dsi(encoder); |
| 1001 | 1001 | |
| 1002 | − intel_dsi_msleep(intel_dsi, intel_dsi->panel_pwr_cycle_delay); | |
| 1002 | + msleep(intel_dsi->panel_pwr_cycle_delay); | |
| 1003 | 1003 | } |
| 1004 | 1004 | |
| 1005 | 1005 | static bool intel_dsi_get_hw_state(struct intel_encoder *encoder, |
| @@ -713,9 +713,12 @@ static int engine_setup_common(struct intel_engine_cs *engine) · 712 unmodified lines | ||
| 713 | 713 | goto err_status; |
| 714 | 714 | } |
| 715 | 715 | |
| 716 | + err = intel_engine_init_cmd_parser(engine); | |
| 717 | + if (err) | |
| 718 | + goto err_cmd_parser; | |
| 719 | + | |
| 716 | 720 | intel_engine_init_active(engine, ENGINE_PHYSICAL); |
| 717 | 721 | intel_engine_init_execlists(engine); |
| 718 | − intel_engine_init_cmd_parser(engine); | |
| 719 | 722 | intel_engine_init__pm(engine); |
| 720 | 723 | intel_engine_init_retire(engine); |
| 721 | 724 | |
| @@ -732,6 +735,8 @@ static int engine_setup_common(struct intel_engine_cs *engine) · 10 unmodified lines | ||
| 732 | 735 | |
| 733 | 736 | return 0; |
| 734 | 737 | |
| 738 | +err_cmd_parser: | |
| 739 | + intel_breadcrumbs_free(engine->breadcrumbs); | |
| 735 | 740 | err_status: |
| 736 | 741 | cleanup_status_page(engine); |
| 737 | 742 | return err; |
| @@ -316,7 +316,18 @@ void i915_vma_revoke_fence(struct i915_vma *vma) · 315 unmodified lines | ||
| 316 | 316 | WRITE_ONCE(fence->vma, NULL); |
| 317 | 317 | vma->fence = NULL; |
| 318 | 318 | |
| 319 | − with_intel_runtime_pm_if_in_use(fence_to_uncore(fence)->rpm, wakeref) | |
| 319 | + /* | |
| 320 | + * Skip the write to HW if and only if the device is currently | |
| 321 | + * suspended. | |
| 322 | + * | |
| 323 | + * If the driver does not currently hold a wakeref (if_in_use == 0), | |
| 324 | + * the device may currently be runtime suspended, or it may be woken | |
| 325 | + * up before the suspend takes place. If the device is not suspended | |
| 326 | + * (powered down) and we skip clearing the fence register, the HW is | |
| 327 | + * left in an undefined state where we may end up with multiple | |
| 328 | + * registers overlapping. | |
| 329 | + */ | |
| 330 | + with_intel_runtime_pm_if_active(fence_to_uncore(fence)->rpm, wakeref) | |
| 320 | 331 | fence_write(fence); |
| 321 | 332 | } |
| 322 | 333 | |
| @@ -940,7 +940,7 @@ static void fini_hash_table(struct intel_engine_cs *engine) · 939 unmodified lines | ||
| 940 | 940 | * struct intel_engine_cs based on whether the platform requires software |
| 941 | 941 | * command parsing. |
| 942 | 942 | */ |
| 943 | −void intel_engine_init_cmd_parser(struct intel_engine_cs *engine) | |
| 943 | +int intel_engine_init_cmd_parser(struct intel_engine_cs *engine) | |
| 944 | 944 | { |
| 945 | 945 | const struct drm_i915_cmd_table *cmd_tables; |
| 946 | 946 | int cmd_table_count; |
| @@ -948,7 +948,7 @@ void intel_engine_init_cmd_parser(struct intel_engine_cs *engine) · 1 unmodified line | ||
| 948 | 948 | |
| 949 | 949 | if (!IS_GEN(engine->i915, 7) && !(IS_GEN(engine->i915, 9) && |
| 950 | 950 | engine->class == COPY_ENGINE_CLASS)) |
| 951 | − return; | |
| 951 | + return 0; | |
| 952 | 952 | |
| 953 | 953 | switch (engine->class) { |
| 954 | 954 | case RENDER_CLASS: |
| @@ -1013,19 +1013,19 @@ void intel_engine_init_cmd_parser(struct intel_engine_cs *engine) · 58 unmodified lines | ||
| 1013 | 1013 | break; |
| 1014 | 1014 | default: |
| 1015 | 1015 | MISSING_CASE(engine->class); |
| 1016 | − return; | |
| 1016 | + goto out; | |
| 1017 | 1017 | } |
| 1018 | 1018 | |
| 1019 | 1019 | if (!validate_cmds_sorted(engine, cmd_tables, cmd_table_count)) { |
| 1020 | 1020 | drm_err(&engine->i915->drm, |
| 1021 | 1021 | "%s: command descriptions are not sorted\n", |
| 1022 | 1022 | engine->name); |
| 1023 | − return; | |
| 1023 | + goto out; | |
| 1024 | 1024 | } |
| 1025 | 1025 | if (!validate_regs_sorted(engine)) { |
| 1026 | 1026 | drm_err(&engine->i915->drm, |
| 1027 | 1027 | "%s: registers are not sorted\n", engine->name); |
| 1028 | − return; | |
| 1028 | + goto out; | |
| 1029 | 1029 | } |
| 1030 | 1030 | |
| 1031 | 1031 | ret = init_hash_table(engine, cmd_tables, cmd_table_count); |
| @@ -1033,10 +1033,17 @@ void intel_engine_init_cmd_parser(struct intel_engine_cs *engine) · 1 unmodified line | ||
| 1033 | 1033 | drm_err(&engine->i915->drm, |
| 1034 | 1034 | "%s: initialised failed!\n", engine->name); |
| 1035 | 1035 | fini_hash_table(engine); |
| 1036 | − return; | |
| 1036 | + goto out; | |
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | engine->flags |= I915_ENGINE_USING_CMD_PARSER; |
| 1040 | + | |
| 1041 | +out: | |
| 1042 | + if (intel_engine_requires_cmd_parser(engine) && | |
| 1043 | + !intel_engine_using_cmd_parser(engine)) | |
| 1044 | + return -EINVAL; | |
| 1045 | + | |
| 1046 | + return 0; | |
| 1040 | 1047 | } |
| 1041 | 1048 | |
| 1042 | 1049 | /** |
| @@ -1952,7 +1952,7 @@ const char *i915_cache_level_str(struct drm_i915_private *i915, int type); · 1951 unmodified lines | ||
| 1952 | 1952 | |
| 1953 | 1953 | /* i915_cmd_parser.c */ |
| 1954 | 1954 | int i915_cmd_parser_get_version(struct drm_i915_private *dev_priv); |
| 1955 | −void intel_engine_init_cmd_parser(struct intel_engine_cs *engine); | |
| 1955 | +int intel_engine_init_cmd_parser(struct intel_engine_cs *engine); | |
| 1956 | 1956 | void intel_engine_cleanup_cmd_parser(struct intel_engine_cs *engine); |
| 1957 | 1957 | int intel_engine_cmd_parser(struct intel_engine_cs *engine, |
| 1958 | 1958 | struct i915_vma *batch, |
| @@ -603,7 +603,6 @@ static int append_oa_sample(struct i915_perf_stream *stream, · 602 unmodified lines | ||
| 603 | 603 | { |
| 604 | 604 | int report_size = stream->oa_buffer.format_size; |
| 605 | 605 | struct drm_i915_perf_record_header header; |
| 606 | − u32 sample_flags = stream->sample_flags; | |
| 607 | 606 | |
| 608 | 607 | header.type = DRM_I915_PERF_RECORD_SAMPLE; |
| 609 | 608 | header.pad = 0; |
| @@ -617,10 +616,8 @@ static int append_oa_sample(struct i915_perf_stream *stream, · 7 unmodified lines | ||
| 617 | 616 | return -EFAULT; |
| 618 | 617 | buf += sizeof(header); |
| 619 | 618 | |
| 620 | − if (sample_flags & SAMPLE_OA_REPORT) { | |
| 621 | − if (copy_to_user(buf, report, report_size)) | |
| 622 | − return -EFAULT; | |
| 623 | − } | |
| 619 | + if (copy_to_user(buf, report, report_size)) | |
| 620 | + return -EFAULT; | |
| 624 | 621 | |
| 625 | 622 | (*offset) += header.size; |
| 626 | 623 | |
| @@ -2682,7 +2679,7 @@ static void i915_oa_stream_enable(struct i915_perf_stream *stream) · 2055 unmodified lines | ||
| 2682 | 2679 | |
| 2683 | 2680 | stream->perf->ops.oa_enable(stream); |
| 2684 | 2681 | |
| 2685 | − if (stream->periodic) | |
| 2682 | + if (stream->sample_flags & SAMPLE_OA_REPORT) | |
| 2686 | 2683 | hrtimer_start(&stream->poll_check_timer, |
| 2687 | 2684 | ns_to_ktime(stream->poll_oa_period), |
| 2688 | 2685 | HRTIMER_MODE_REL_PINNED); |
| @@ -2745,7 +2742,7 @@ static void i915_oa_stream_disable(struct i915_perf_stream *stream) · 56 unmodified lines | ||
| 2745 | 2742 | { |
| 2746 | 2743 | stream->perf->ops.oa_disable(stream); |
| 2747 | 2744 | |
| 2748 | − if (stream->periodic) | |
| 2745 | + if (stream->sample_flags & SAMPLE_OA_REPORT) | |
| 2749 | 2746 | hrtimer_cancel(&stream->poll_check_timer); |
| 2750 | 2747 | } |
| 2751 | 2748 | |
| @@ -3028,7 +3025,7 @@ static ssize_t i915_perf_read(struct file *file, · 276 unmodified lines | ||
| 3028 | 3025 | * disabled stream as an error. In particular it might otherwise lead |
| 3029 | 3026 | * to a deadlock for blocking file descriptors... |
| 3030 | 3027 | */ |
| 3031 | − if (!stream->enabled) | |
| 3028 | + if (!stream->enabled || !(stream->sample_flags & SAMPLE_OA_REPORT)) | |
| 3032 | 3029 | return -EIO; |
| 3033 | 3030 | |
| 3034 | 3031 | if (!(file->f_flags & O_NONBLOCK)) { |
| @@ -3316,7 +3316,18 @@ static inline bool i915_mmio_reg_valid(i915_reg_t reg) · 3315 unmodified lines | ||
| 3316 | 3316 | |
| 3317 | 3317 | #define ILK_DISPLAY_CHICKEN1 _MMIO(0x42000) |
| 3318 | 3318 | #define ILK_FBCQ_DIS (1 << 22) |
| 3319 | −#define ILK_PABSTRETCH_DIS (1 << 21) | |
| 3319 | +#define ILK_PABSTRETCH_DIS REG_BIT(21) | |
| 3320 | +#define ILK_SABSTRETCH_DIS REG_BIT(20) | |
| 3321 | +#define IVB_PRI_STRETCH_MAX_MASK REG_GENMASK(21, 20) | |
| 3322 | +#define IVB_PRI_STRETCH_MAX_X8 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 0) | |
| 3323 | +#define IVB_PRI_STRETCH_MAX_X4 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 1) | |
| 3324 | +#define IVB_PRI_STRETCH_MAX_X2 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 2) | |
| 3325 | +#define IVB_PRI_STRETCH_MAX_X1 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 3) | |
| 3326 | +#define IVB_SPR_STRETCH_MAX_MASK REG_GENMASK(19, 18) | |
| 3327 | +#define IVB_SPR_STRETCH_MAX_X8 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 0) | |
| 3328 | +#define IVB_SPR_STRETCH_MAX_X4 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 1) | |
| 3329 | +#define IVB_SPR_STRETCH_MAX_X2 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 2) | |
| 3330 | +#define IVB_SPR_STRETCH_MAX_X1 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 3) | |
| 3320 | 3331 | |
| 3321 | 3332 | |
| 3322 | 3333 | /* |
| @@ -8039,6 +8050,16 @@ enum { · 4716 unmodified lines | ||
| 8039 | 8050 | |
| 8040 | 8051 | #define _CHICKEN_PIPESL_1_A 0x420b0 |
| 8041 | 8052 | #define _CHICKEN_PIPESL_1_B 0x420b4 |
| 8053 | +#define HSW_PRI_STRETCH_MAX_MASK REG_GENMASK(28, 27) | |
| 8054 | +#define HSW_PRI_STRETCH_MAX_X8 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 0) | |
| 8055 | +#define HSW_PRI_STRETCH_MAX_X4 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 1) | |
| 8056 | +#define HSW_PRI_STRETCH_MAX_X2 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 2) | |
| 8057 | +#define HSW_PRI_STRETCH_MAX_X1 REG_FIELD_PREP(HSW_PRI_STRETCH_MAX_MASK, 3) | |
| 8058 | +#define HSW_SPR_STRETCH_MAX_MASK REG_GENMASK(26, 25) | |
| 8059 | +#define HSW_SPR_STRETCH_MAX_X8 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 0) | |
| 8060 | +#define HSW_SPR_STRETCH_MAX_X4 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 1) | |
| 8061 | +#define HSW_SPR_STRETCH_MAX_X2 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 2) | |
| 8062 | +#define HSW_SPR_STRETCH_MAX_X1 REG_FIELD_PREP(HSW_SPR_STRETCH_MAX_MASK, 3) | |
| 8042 | 8063 | #define HSW_FBCQ_DIS (1 << 22) |
| 8043 | 8064 | #define BDW_DPRS_MASK_VBLANK_SRD (1 << 0) |
| 8044 | 8065 | #define CHICKEN_PIPESL_1(pipe) _MMIO_PIPE(pipe, _CHICKEN_PIPESL_1_A, _CHICKEN_PIPESL_1_B) |
| @@ -5471,12 +5471,12 @@ static int icl_build_plane_wm(struct intel_crtc_state *crtc_state, · 5470 unmodified lines | ||
| 5471 | 5471 | struct skl_plane_wm *wm = &crtc_state->wm.skl.raw.planes[plane_id]; |
| 5472 | 5472 | int ret; |
| 5473 | 5473 | |
| 5474 | − memset(wm, 0, sizeof(*wm)); | |
| 5475 | − | |
| 5476 | 5474 | /* Watermarks calculated in master */ |
| 5477 | 5475 | if (plane_state->planar_slave) |
| 5478 | 5476 | return 0; |
| 5479 | 5477 | |
| 5478 | + memset(wm, 0, sizeof(*wm)); | |
| 5479 | + | |
| 5480 | 5480 | if (plane_state->planar_linked_plane) { |
| 5481 | 5481 | const struct drm_framebuffer *fb = plane_state->hw.fb; |
| 5482 | 5482 | enum plane_id y_plane_id = plane_state->planar_linked_plane->id; |
| @@ -7245,11 +7245,16 @@ static void bdw_init_clock_gating(struct drm_i915_private *dev_priv) · 1762 unmodified lines | ||
| 7245 | 7245 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PAR1_1, |
| 7246 | 7246 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PAR1_1) | DPA_MASK_VBLANK_SRD); |
| 7247 | 7247 | |
| 7248 | − /* WaPsrDPRSUnmaskVBlankInSRD:bdw */ | |
| 7249 | 7248 | for_each_pipe(dev_priv, pipe) { |
| 7249 | + /* WaPsrDPRSUnmaskVBlankInSRD:bdw */ | |
| 7250 | 7250 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe), |
| 7251 | 7251 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe)) | |
| 7252 | 7252 | BDW_DPRS_MASK_VBLANK_SRD); |
| 7253 | + | |
| 7254 | + /* Undocumented but fixes async flip + VT-d corruption */ | |
| 7255 | + if (intel_vtd_active()) | |
| 7256 | + intel_uncore_rmw(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe), | |
| 7257 | + HSW_PRI_STRETCH_MAX_MASK, HSW_PRI_STRETCH_MAX_X1); | |
| 7253 | 7258 | } |
| 7254 | 7259 | |
| 7255 | 7260 | /* WaVSRefCountFullforceMissDisable:bdw */ |
| @@ -7285,11 +7290,20 @@ static void bdw_init_clock_gating(struct drm_i915_private *dev_priv) · 29 unmodified lines | ||
| 7285 | 7290 | |
| 7286 | 7291 | static void hsw_init_clock_gating(struct drm_i915_private *dev_priv) |
| 7287 | 7292 | { |
| 7293 | + enum pipe pipe; | |
| 7294 | + | |
| 7288 | 7295 | /* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */ |
| 7289 | 7296 | intel_uncore_write(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A), |
| 7290 | 7297 | intel_uncore_read(&dev_priv->uncore, CHICKEN_PIPESL_1(PIPE_A)) | |
| 7291 | 7298 | HSW_FBCQ_DIS); |
| 7292 | 7299 | |
| 7300 | + for_each_pipe(dev_priv, pipe) { | |
| 7301 | + /* Undocumented but fixes async flip + VT-d corruption */ | |
| 7302 | + if (intel_vtd_active()) | |
| 7303 | + intel_uncore_rmw(&dev_priv->uncore, CHICKEN_PIPESL_1(pipe), | |
| 7304 | + HSW_PRI_STRETCH_MAX_MASK, HSW_PRI_STRETCH_MAX_X1); | |
| 7305 | + } | |
| 7306 | + | |
| 7293 | 7307 | /* This is required by WaCatErrorRejectionIssue:hsw */ |
| 7294 | 7308 | intel_uncore_write(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG, |
| 7295 | 7309 | intel_uncore_read(&dev_priv->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG) | |
| @@ -412,12 +412,20 @@ intel_wakeref_t intel_runtime_pm_get(struct intel_runtime_pm *rpm) · 411 unmodified lines | ||
| 412 | 412 | } |
| 413 | 413 | |
| 414 | 414 | /** |
| 415 | − * intel_runtime_pm_get_if_in_use - grab a runtime pm reference if device in use | |
| 415 | + * __intel_runtime_pm_get_if_active - grab a runtime pm reference if device is active | |
| 416 | 416 | * @rpm: the intel_runtime_pm structure |
| 417 | + * @ignore_usecount: get a ref even if dev->power.usage_count is 0 | |
| 417 | 418 | * |
| 418 | 419 | * This function grabs a device-level runtime pm reference if the device is |
| 419 | − * already in use and ensures that it is powered up. It is illegal to try | |
| 420 | − * and access the HW should intel_runtime_pm_get_if_in_use() report failure. | |
| 420 | + * already active and ensures that it is powered up. It is illegal to try | |
| 421 | + * and access the HW should intel_runtime_pm_get_if_active() report failure. | |
| 422 | + * | |
| 423 | + * If @ignore_usecount=true, a reference will be acquired even if there is no | |
| 424 | + * user requiring the device to be powered up (dev->power.usage_count == 0). | |
| 425 | + * If the function returns false in this case then it's guaranteed that the | |
| 426 | + * device's runtime suspend hook has been called already or that it will be | |
| 427 | + * called (and hence it's also guaranteed that the device's runtime resume | |
| 428 | + * hook will be called eventually). | |
| 421 | 429 | * |
| 422 | 430 | * Any runtime pm reference obtained by this function must have a symmetric |
| 423 | 431 | * call to intel_runtime_pm_put() to release the reference again. |
| @@ -425,7 +433,8 @@ intel_wakeref_t intel_runtime_pm_get(struct intel_runtime_pm *rpm) · 1 unmodified line | ||
| 425 | 433 | * Returns: the wakeref cookie to pass to intel_runtime_pm_put(), evaluates |
| 426 | 434 | * as True if the wakeref was acquired, or False otherwise. |
| 427 | 435 | */ |
| 428 | −intel_wakeref_t intel_runtime_pm_get_if_in_use(struct intel_runtime_pm *rpm) | |
| 436 | +static intel_wakeref_t __intel_runtime_pm_get_if_active(struct intel_runtime_pm *rpm, | |
| 437 | + bool ignore_usecount) | |
| 429 | 438 | { |
| 430 | 439 | if (IS_ENABLED(CONFIG_PM)) { |
| 431 | 440 | /* |
| @@ -434,7 +443,7 @@ intel_wakeref_t intel_runtime_pm_get_if_in_use(struct intel_runtime_pm *rpm) · 2 unmodified lines | ||
| 434 | 443 | * function, since the power state is undefined. This applies |
| 435 | 444 | * atm to the late/early system suspend/resume handlers. |
| 436 | 445 | */ |
| 437 | − if (pm_runtime_get_if_in_use(rpm->kdev) <= 0) | |
| 446 | + if (pm_runtime_get_if_active(rpm->kdev, ignore_usecount) <= 0) | |
| 438 | 447 | return 0; |
| 439 | 448 | } |
| 440 | 449 | |
| @@ -443,6 +452,16 @@ intel_wakeref_t intel_runtime_pm_get_if_in_use(struct intel_runtime_pm *rpm) · 2 unmodified lines | ||
| 443 | 452 | return track_intel_runtime_pm_wakeref(rpm); |
| 444 | 453 | } |
| 445 | 454 | |
| 455 | +intel_wakeref_t intel_runtime_pm_get_if_in_use(struct intel_runtime_pm *rpm) | |
| 456 | +{ | |
| 457 | + return __intel_runtime_pm_get_if_active(rpm, false); | |
| 458 | +} | |
| 459 | + | |
| 460 | +intel_wakeref_t intel_runtime_pm_get_if_active(struct intel_runtime_pm *rpm) | |
| 461 | +{ | |
| 462 | + return __intel_runtime_pm_get_if_active(rpm, true); | |
| 463 | +} | |
| 464 | + | |
| 446 | 465 | /** |
| 447 | 466 | * intel_runtime_pm_get_noresume - grab a runtime pm reference |
| 448 | 467 | * @rpm: the intel_runtime_pm structure |
| @@ -177,6 +177,7 @@ void intel_runtime_pm_driver_release(struct intel_runtime_pm *rpm); · 176 unmodified lines | ||
| 177 | 177 | |
| 178 | 178 | intel_wakeref_t intel_runtime_pm_get(struct intel_runtime_pm *rpm); |
| 179 | 179 | intel_wakeref_t intel_runtime_pm_get_if_in_use(struct intel_runtime_pm *rpm); |
| 180 | +intel_wakeref_t intel_runtime_pm_get_if_active(struct intel_runtime_pm *rpm); | |
| 180 | 181 | intel_wakeref_t intel_runtime_pm_get_noresume(struct intel_runtime_pm *rpm); |
| 181 | 182 | intel_wakeref_t intel_runtime_pm_get_raw(struct intel_runtime_pm *rpm); |
| 182 | 183 | |
| @@ -188,6 +189,10 @@ intel_wakeref_t intel_runtime_pm_get_raw(struct intel_runtime_pm *rpm); · 5 unmodified lines | ||
| 188 | 189 | for ((wf) = intel_runtime_pm_get_if_in_use(rpm); (wf); \ |
| 189 | 190 | intel_runtime_pm_put((rpm), (wf)), (wf) = 0) |
| 190 | 191 | |
| 192 | +#define with_intel_runtime_pm_if_active(rpm, wf) \ | |
| 193 | + for ((wf) = intel_runtime_pm_get_if_active(rpm); (wf); \ | |
| 194 | + intel_runtime_pm_put((rpm), (wf)), (wf) = 0) | |
| 195 | + | |
| 191 | 196 | void intel_runtime_pm_put_unchecked(struct intel_runtime_pm *rpm); |
| 192 | 197 | #if IS_ENABLED(CONFIG_DRM_I915_DEBUG_RUNTIME_PM) |
| 193 | 198 | void intel_runtime_pm_put(struct intel_runtime_pm *rpm, intel_wakeref_t wref); |
| @@ -215,7 +215,7 @@ static int imx_drm_bind(struct device *dev) · 214 unmodified lines | ||
| 215 | 215 | |
| 216 | 216 | ret = drmm_mode_config_init(drm); |
| 217 | 217 | if (ret) |
| 218 | − return ret; | |
| 218 | + goto err_kms; | |
| 219 | 219 | |
| 220 | 220 | ret = drm_vblank_init(drm, MAX_CRTC); |
| 221 | 221 | if (ret) |
| @@ -197,6 +197,11 @@ static void imx_ldb_encoder_enable(struct drm_encoder *encoder) · 196 unmodified lines | ||
| 197 | 197 | int dual = ldb->ldb_ctrl & LDB_SPLIT_MODE_EN; |
| 198 | 198 | int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder); |
| 199 | 199 | |
| 200 | + if (mux < 0 || mux >= ARRAY_SIZE(ldb->clk_sel)) { | |
| 201 | + dev_warn(ldb->dev, "%s: invalid mux %d\n", __func__, mux); | |
| 202 | + return; | |
| 203 | + } | |
| 204 | + | |
| 200 | 205 | drm_panel_prepare(imx_ldb_ch->panel); |
| 201 | 206 | |
| 202 | 207 | if (dual) { |
| @@ -255,6 +260,11 @@ imx_ldb_encoder_atomic_mode_set(struct drm_encoder *encoder, · 52 unmodified lines | ||
| 255 | 260 | int mux = drm_of_encoder_active_port_id(imx_ldb_ch->child, encoder); |
| 256 | 261 | u32 bus_format = imx_ldb_ch->bus_format; |
| 257 | 262 | |
| 263 | + if (mux < 0 || mux >= ARRAY_SIZE(ldb->clk_sel)) { | |
| 264 | + dev_warn(ldb->dev, "%s: invalid mux %d\n", __func__, mux); | |
| 265 | + return; | |
| 266 | + } | |
| 267 | + | |
| 258 | 268 | if (mode->clock > 170000) { |
| 259 | 269 | dev_warn(ldb->dev, |
| 260 | 270 | "%s: mode exceeds 170 MHz pixel clock\n", __func__); |
| @@ -583,7 +593,7 @@ static int imx_ldb_bind(struct device *dev, struct device *master, void *data) · 322 unmodified lines | ||
| 583 | 593 | struct imx_ldb_channel *channel = &imx_ldb->channel[i]; |
| 584 | 594 | |
| 585 | 595 | if (!channel->ldb) |
| 586 | − break; | |
| 596 | + continue; | |
| 587 | 597 | |
| 588 | 598 | ret = imx_ldb_register(drm, channel); |
| 589 | 599 | if (ret) |
| @@ -482,6 +482,16 @@ static int meson_probe_remote(struct platform_device *pdev, · 481 unmodified lines | ||
| 482 | 482 | return count; |
| 483 | 483 | } |
| 484 | 484 | |
| 485 | +static void meson_drv_shutdown(struct platform_device *pdev) | |
| 486 | +{ | |
| 487 | + struct meson_drm *priv = dev_get_drvdata(&pdev->dev); | |
| 488 | + struct drm_device *drm = priv->drm; | |
| 489 | + | |
| 490 | + DRM_DEBUG_DRIVER("\n"); | |
| 491 | + drm_kms_helper_poll_fini(drm); | |
| 492 | + drm_atomic_helper_shutdown(drm); | |
| 493 | +} | |
| 494 | + | |
| 485 | 495 | static int meson_drv_probe(struct platform_device *pdev) |
| 486 | 496 | { |
| 487 | 497 | struct component_match *match = NULL; |
| @@ -553,6 +563,7 @@ static const struct dev_pm_ops meson_drv_pm_ops = { · 65 unmodified lines | ||
| 553 | 563 | |
| 554 | 564 | static struct platform_driver meson_drm_platform_driver = { |
| 555 | 565 | .probe = meson_drv_probe, |
| 566 | + .shutdown = meson_drv_shutdown, | |
| 556 | 567 | .driver = { |
| 557 | 568 | .name = "meson-drm", |
| 558 | 569 | .of_match_table = dt_match, |
| @@ -1386,8 +1386,8 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu) · 1385 unmodified lines | ||
| 1386 | 1386 | |
| 1387 | 1387 | static int a5xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value) |
| 1388 | 1388 | { |
| 1389 | − *value = gpu_read64(gpu, REG_A5XX_RBBM_PERFCTR_CP_0_LO, | |
| 1390 | − REG_A5XX_RBBM_PERFCTR_CP_0_HI); | |
| 1389 | + *value = gpu_read64(gpu, REG_A5XX_RBBM_ALWAYSON_COUNTER_LO, | |
| 1390 | + REG_A5XX_RBBM_ALWAYSON_COUNTER_HI); | |
| 1391 | 1391 | |
| 1392 | 1392 | return 0; |
| 1393 | 1393 | } |
| @@ -304,7 +304,7 @@ int a5xx_power_init(struct msm_gpu *gpu) · 303 unmodified lines | ||
| 304 | 304 | /* Set up the limits management */ |
| 305 | 305 | if (adreno_is_a530(adreno_gpu)) |
| 306 | 306 | a530_lm_setup(gpu); |
| 307 | − else | |
| 307 | + else if (adreno_is_a540(adreno_gpu)) | |
| 308 | 308 | a540_lm_setup(gpu); |
| 309 | 309 | |
| 310 | 310 | /* Set up SP/TP power collpase */ |
| @@ -339,7 +339,7 @@ void a6xx_gmu_clear_oob(struct a6xx_gmu *gmu, enum a6xx_gmu_oob_state state) · 338 unmodified lines | ||
| 339 | 339 | else |
| 340 | 340 | bit = a6xx_gmu_oob_bits[state].ack_new; |
| 341 | 341 | |
| 342 | − gmu_write(gmu, REG_A6XX_GMU_HOST2GMU_INTR_SET, bit); | |
| 342 | + gmu_write(gmu, REG_A6XX_GMU_HOST2GMU_INTR_SET, 1 << bit); | |
| 343 | 343 | } |
| 344 | 344 | |
| 345 | 345 | /* Enable CPU control of SPTP power power collapse */ |
| @@ -522,28 +522,73 @@ static int a6xx_cp_init(struct msm_gpu *gpu) · 521 unmodified lines | ||
| 522 | 522 | return a6xx_idle(gpu, ring) ? 0 : -EINVAL; |
| 523 | 523 | } |
| 524 | 524 | |
| 525 | −static void a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu, | |
| 525 | +/* | |
| 526 | + * Check that the microcode version is new enough to include several key | |
| 527 | + * security fixes. Return true if the ucode is safe. | |
| 528 | + */ | |
| 529 | +static bool a6xx_ucode_check_version(struct a6xx_gpu *a6xx_gpu, | |
| 526 | 530 | struct drm_gem_object *obj) |
| 527 | 531 | { |
| 532 | + struct adreno_gpu *adreno_gpu = &a6xx_gpu->base; | |
| 533 | + struct msm_gpu *gpu = &adreno_gpu->base; | |
| 528 | 534 | u32 *buf = msm_gem_get_vaddr(obj); |
| 535 | + bool ret = false; | |
| 529 | 536 | |
| 530 | 537 | if (IS_ERR(buf)) |
| 531 | − return; | |
| 538 | + return false; | |
| 532 | 539 | |
| 533 | 540 | /* |
| 534 | − * If the lowest nibble is 0xa that is an indication that this microcode | |
| 535 | − * has been patched. The actual version is in dword [3] but we only care | |
| 536 | − * about the patchlevel which is the lowest nibble of dword [3] | |
| 537 | − * | |
| 538 | − * Otherwise check that the firmware is greater than or equal to 1.90 | |
| 539 | − * which was the first version that had this fix built in | |
| 541 | + * Targets up to a640 (a618, a630 and a640) need to check for a | |
| 542 | + * microcode version that is patched to support the whereami opcode or | |
| 543 | + * one that is new enough to include it by default. | |
| 540 | 544 | */ |
| 541 | − if (((buf[0] & 0xf) == 0xa) && (buf[2] & 0xf) >= 1) | |
| 542 | − a6xx_gpu->has_whereami = true; | |
| 543 | − else if ((buf[0] & 0xfff) > 0x190) | |
| 544 | − a6xx_gpu->has_whereami = true; | |
| 545 | + if (adreno_is_a618(adreno_gpu) || adreno_is_a630(adreno_gpu) || | |
| 546 | + adreno_is_a640(adreno_gpu)) { | |
| 547 | + /* | |
| 548 | + * If the lowest nibble is 0xa that is an indication that this | |
| 549 | + * microcode has been patched. The actual version is in dword | |
| 550 | + * [3] but we only care about the patchlevel which is the lowest | |
| 551 | + * nibble of dword [3] | |
| 552 | + * | |
| 553 | + * Otherwise check that the firmware is greater than or equal | |
| 554 | + * to 1.90 which was the first version that had this fix built | |
| 555 | + * in | |
| 556 | + */ | |
| 557 | + if ((((buf[0] & 0xf) == 0xa) && (buf[2] & 0xf) >= 1) || | |
| 558 | + (buf[0] & 0xfff) >= 0x190) { | |
| 559 | + a6xx_gpu->has_whereami = true; | |
| 560 | + ret = true; | |
| 561 | + goto out; | |
| 562 | + } | |
| 545 | 563 | |
| 564 | + DRM_DEV_ERROR(&gpu->pdev->dev, | |
| 565 | + "a630 SQE ucode is too old. Have version %x need at least %x\n", | |
| 566 | + buf[0] & 0xfff, 0x190); | |
| 567 | + } else { | |
| 568 | + /* | |
| 569 | + * a650 tier targets don't need whereami but still need to be | |
| 570 | + * equal to or newer than 0.95 for other security fixes | |
| 571 | + */ | |
| 572 | + if (adreno_is_a650(adreno_gpu)) { | |
| 573 | + if ((buf[0] & 0xfff) >= 0x095) { | |
| 574 | + ret = true; | |
| 575 | + goto out; | |
| 576 | + } | |
| 577 | + | |
| 578 | + DRM_DEV_ERROR(&gpu->pdev->dev, | |
| 579 | + "a650 SQE ucode is too old. Have version %x need at least %x\n", | |
| 580 | + buf[0] & 0xfff, 0x095); | |
| 581 | + } | |
| 582 | + | |
| 583 | + /* | |
| 584 | + * When a660 is added those targets should return true here | |
| 585 | + * since those have all the critical security fixes built in | |
| 586 | + * from the start | |
| 587 | + */ | |
| 588 | + } | |
| 589 | +out: | |
| 546 | 590 | msm_gem_put_vaddr(obj); |
| 591 | + return ret; | |
| 547 | 592 | } |
| 548 | 593 | |
| 549 | 594 | static int a6xx_ucode_init(struct msm_gpu *gpu) |
| @@ -566,7 +611,13 @@ static int a6xx_ucode_init(struct msm_gpu *gpu) · 16 unmodified lines | ||
| 566 | 611 | } |
| 567 | 612 | |
| 568 | 613 | msm_gem_object_set_name(a6xx_gpu->sqe_bo, "sqefw"); |
| 569 | − a6xx_ucode_check_version(a6xx_gpu, a6xx_gpu->sqe_bo); | |
| 614 | + if (!a6xx_ucode_check_version(a6xx_gpu, a6xx_gpu->sqe_bo)) { | |
| 615 | + msm_gem_unpin_iova(a6xx_gpu->sqe_bo, gpu->aspace); | |
| 616 | + drm_gem_object_put(a6xx_gpu->sqe_bo); | |
| 617 | + | |
| 618 | + a6xx_gpu->sqe_bo = NULL; | |
| 619 | + return -EPERM; | |
| 620 | + } | |
| 570 | 621 | } |
| 571 | 622 | |
| 572 | 623 | gpu_write64(gpu, REG_A6XX_CP_SQE_INSTR_BASE_LO, |
| @@ -1177,8 +1228,8 @@ static int a6xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value) · 604 unmodified lines | ||
| 1177 | 1228 | /* Force the GPU power on so we can read this register */ |
| 1178 | 1229 | a6xx_gmu_set_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET); |
| 1179 | 1230 | |
| 1180 | − *value = gpu_read64(gpu, REG_A6XX_RBBM_PERFCTR_CP_0_LO, | |
| 1181 | − REG_A6XX_RBBM_PERFCTR_CP_0_HI); | |
| 1231 | + *value = gpu_read64(gpu, REG_A6XX_CP_ALWAYS_ON_COUNTER_LO, | |
| 1232 | + REG_A6XX_CP_ALWAYS_ON_COUNTER_HI); | |
| 1182 | 1233 | |
| 1183 | 1234 | a6xx_gmu_clear_oob(&a6xx_gpu->gmu, GMU_OOB_PERFCOUNTER_SET); |
| 1184 | 1235 | mutex_unlock(&perfcounter_oob); |
| @@ -1350,35 +1401,26 @@ static int a6xx_set_supported_hw(struct device *dev, struct a6xx_gpu *a6xx_gpu, · 165 unmodified lines | ||
| 1350 | 1401 | u32 revn) |
| 1351 | 1402 | { |
| 1352 | 1403 | struct opp_table *opp_table; |
| 1353 | − struct nvmem_cell *cell; | |
| 1354 | 1404 | u32 supp_hw = UINT_MAX; |
| 1355 | − void *buf; | |
| 1405 | + u16 speedbin; | |
| 1406 | + int ret; | |
| 1356 | 1407 | |
| 1357 | − cell = nvmem_cell_get(dev, "speed_bin"); | |
| 1408 | + ret = nvmem_cell_read_u16(dev, "speed_bin", &speedbin); | |
| 1358 | 1409 | /* |
| 1359 | 1410 | * -ENOENT means that the platform doesn't support speedbin which is |
| 1360 | 1411 | * fine |
| 1361 | 1412 | */ |
| 1362 | − if (PTR_ERR(cell) == -ENOENT) | |
| 1413 | + if (ret == -ENOENT) { | |
| 1363 | 1414 | return 0; |
| 1364 | − else if (IS_ERR(cell)) { | |
| 1365 | − DRM_DEV_ERROR(dev, | |
| 1366 | − "failed to read speed-bin. Some OPPs may not be supported by hardware"); | |
| 1367 | − goto done; | |
| 1368 | − } | |
| 1369 | − | |
| 1370 | − buf = nvmem_cell_read(cell, NULL); | |
| 1371 | − if (IS_ERR(buf)) { | |
| 1372 | − nvmem_cell_put(cell); | |
| 1415 | + } else if (ret) { | |
| 1373 | 1416 | DRM_DEV_ERROR(dev, |
| 1374 | − "failed to read speed-bin. Some OPPs may not be supported by hardware"); | |
| 1417 | + "failed to read speed-bin (%d). Some OPPs may not be supported by hardware", | |
| 1418 | + ret); | |
| 1375 | 1419 | goto done; |
| 1376 | 1420 | } |
| 1421 | + speedbin = le16_to_cpu(speedbin); | |
| 1377 | 1422 | |
| 1378 | − supp_hw = fuse_to_supp_hw(dev, revn, *((u32 *) buf)); | |
| 1379 | − | |
| 1380 | − kfree(buf); | |
| 1381 | − nvmem_cell_put(cell); | |
| 1423 | + supp_hw = fuse_to_supp_hw(dev, revn, speedbin); | |
| 1382 | 1424 | |
| 1383 | 1425 | done: |
| 1384 | 1426 | opp_table = dev_pm_opp_set_supported_hw(dev, &supp_hw, 1); |
| @@ -496,7 +496,9 @@ static void dpu_hw_ctl_intf_cfg_v1(struct dpu_hw_ctl *ctx, · 495 unmodified lines | ||
| 496 | 496 | |
| 497 | 497 | DPU_REG_WRITE(c, CTL_TOP, mode_sel); |
| 498 | 498 | DPU_REG_WRITE(c, CTL_INTF_ACTIVE, intf_active); |
| 499 | − DPU_REG_WRITE(c, CTL_MERGE_3D_ACTIVE, BIT(cfg->merge_3d - MERGE_3D_0)); | |
| 499 | + if (cfg->merge_3d) | |
| 500 | + DPU_REG_WRITE(c, CTL_MERGE_3D_ACTIVE, | |
| 501 | + BIT(cfg->merge_3d - MERGE_3D_0)); | |
| 500 | 502 | } |
| 501 | 503 | |
| 502 | 504 | static void dpu_hw_ctl_intf_cfg(struct dpu_hw_ctl *ctx, |
| @@ -43,6 +43,8 @@ · 42 unmodified lines | ||
| 43 | 43 | #define DPU_DEBUGFS_DIR "msm_dpu" |
| 44 | 44 | #define DPU_DEBUGFS_HWMASKNAME "hw_log_mask" |
| 45 | 45 | |
| 46 | +#define MIN_IB_BW 400000000ULL /* Min ib vote 400MB */ | |
| 47 | + | |
| 46 | 48 | static int dpu_kms_hw_init(struct msm_kms *kms); |
| 47 | 49 | static void _dpu_kms_mmu_destroy(struct dpu_kms *dpu_kms); |
| 48 | 50 | |
| @@ -931,6 +933,9 @@ static int dpu_kms_hw_init(struct msm_kms *kms) · 882 unmodified lines | ||
| 931 | 933 | DPU_DEBUG("REG_DMA is not defined"); |
| 932 | 934 | } |
| 933 | 935 | |
| 936 | + if (of_device_is_compatible(dev->dev->of_node, "qcom,sc7180-mdss")) | |
| 937 | + dpu_kms_parse_data_bus_icc_path(dpu_kms); | |
| 938 | + | |
| 934 | 939 | pm_runtime_get_sync(&dpu_kms->pdev->dev); |
| 935 | 940 | |
| 936 | 941 | dpu_kms->core_rev = readl_relaxed(dpu_kms->mmio + 0x0); |
| @@ -1032,9 +1037,6 @@ static int dpu_kms_hw_init(struct msm_kms *kms) · 95 unmodified lines | ||
| 1032 | 1037 | |
| 1033 | 1038 | dpu_vbif_init_memtypes(dpu_kms); |
| 1034 | 1039 | |
| 1035 | − if (of_device_is_compatible(dev->dev->of_node, "qcom,sc7180-mdss")) | |
| 1036 | − dpu_kms_parse_data_bus_icc_path(dpu_kms); | |
| 1037 | − | |
| 1038 | 1040 | pm_runtime_put_sync(&dpu_kms->pdev->dev); |
| 1039 | 1041 | |
| 1040 | 1042 | return 0; |
| @@ -1191,10 +1193,10 @@ static int __maybe_unused dpu_runtime_resume(struct device *dev) · 150 unmodified lines | ||
| 1191 | 1193 | |
| 1192 | 1194 | ddev = dpu_kms->dev; |
| 1193 | 1195 | |
| 1196 | + WARN_ON(!(dpu_kms->num_paths)); | |
| 1194 | 1197 | /* Min vote of BW is required before turning on AXI clk */ |
| 1195 | 1198 | for (i = 0; i < dpu_kms->num_paths; i++) |
| 1196 | − icc_set_bw(dpu_kms->path[i], 0, | |
| 1197 | − dpu_kms->catalog->perf.min_dram_ib); | |
| 1199 | + icc_set_bw(dpu_kms->path[i], 0, Bps_to_icc(MIN_IB_BW)); | |
| 1198 | 1200 | |
| 1199 | 1201 | rc = msm_dss_enable_clk(mp->clk_config, mp->num_clk, true); |
| 1200 | 1202 | if (rc) { |
| @@ -32,6 +32,8 @@ struct dp_aux_private { · 31 unmodified lines | ||
| 32 | 32 | struct drm_dp_aux dp_aux; |
| 33 | 33 | }; |
| 34 | 34 | |
| 35 | +#define MAX_AUX_RETRIES 5 | |
| 36 | + | |
| 35 | 37 | static const char *dp_aux_get_error(u32 aux_error) |
| 36 | 38 | { |
| 37 | 39 | switch (aux_error) { |
| @@ -377,6 +379,11 @@ static ssize_t dp_aux_transfer(struct drm_dp_aux *dp_aux, · 339 unmodified lines | ||
| 377 | 379 | ret = dp_aux_cmd_fifo_tx(aux, msg); |
| 378 | 380 | |
| 379 | 381 | if (ret < 0) { |
| 382 | + if (aux->native) { | |
| 383 | + aux->retry_cnt++; | |
| 384 | + if (!(aux->retry_cnt % MAX_AUX_RETRIES)) | |
| 385 | + dp_catalog_aux_update_cfg(aux->catalog); | |
| 386 | + } | |
| 380 | 387 | usleep_range(400, 500); /* at least 400us to next try */ |
| 381 | 388 | goto unlock_exit; |
| 382 | 389 | } |
| @@ -163,7 +163,7 @@ struct msm_dsi_pll *msm_dsi_pll_init(struct platform_device *pdev, · 162 unmodified lines | ||
| 163 | 163 | break; |
| 164 | 164 | case MSM_DSI_PHY_7NM: |
| 165 | 165 | case MSM_DSI_PHY_7NM_V4_1: |
| 166 | − pll = msm_dsi_pll_7nm_init(pdev, id); | |
| 166 | + pll = msm_dsi_pll_7nm_init(pdev, type, id); | |
| 167 | 167 | break; |
| 168 | 168 | default: |
| 169 | 169 | pll = ERR_PTR(-ENXIO); |
| @@ -117,10 +117,12 @@ msm_dsi_pll_10nm_init(struct platform_device *pdev, int id) · 116 unmodified lines | ||
| 117 | 117 | } |
| 118 | 118 | #endif |
| 119 | 119 | #ifdef CONFIG_DRM_MSM_DSI_7NM_PHY |
| 120 | −struct msm_dsi_pll *msm_dsi_pll_7nm_init(struct platform_device *pdev, int id); | |
| 120 | +struct msm_dsi_pll *msm_dsi_pll_7nm_init(struct platform_device *pdev, | |
| 121 | + enum msm_dsi_phy_type type, int id); | |
| 121 | 122 | #else |
| 122 | 123 | static inline struct msm_dsi_pll * |
| 123 | −msm_dsi_pll_7nm_init(struct platform_device *pdev, int id) | |
| 124 | +msm_dsi_pll_7nm_init(struct platform_device *pdev, | |
| 125 | + enum msm_dsi_phy_type type, int id) | |
| 124 | 126 | { |
| 125 | 127 | return ERR_PTR(-ENODEV); |
| 126 | 128 | } |
| @@ -325,7 +325,7 @@ static void dsi_pll_commit(struct dsi_pll_7nm *pll) · 324 unmodified lines | ||
| 325 | 325 | pll_write(base + REG_DSI_7nm_PHY_PLL_FRAC_DIV_START_LOW_1, reg->frac_div_start_low); |
| 326 | 326 | pll_write(base + REG_DSI_7nm_PHY_PLL_FRAC_DIV_START_MID_1, reg->frac_div_start_mid); |
| 327 | 327 | pll_write(base + REG_DSI_7nm_PHY_PLL_FRAC_DIV_START_HIGH_1, reg->frac_div_start_high); |
| 328 | − pll_write(base + REG_DSI_7nm_PHY_PLL_PLL_LOCKDET_RATE_1, 0x40); | |
| 328 | + pll_write(base + REG_DSI_7nm_PHY_PLL_PLL_LOCKDET_RATE_1, reg->pll_lockdet_rate); | |
| 329 | 329 | pll_write(base + REG_DSI_7nm_PHY_PLL_PLL_LOCK_DELAY, 0x06); |
| 330 | 330 | pll_write(base + REG_DSI_7nm_PHY_PLL_CMODE_1, 0x10); /* TODO: 0x00 for CPHY */ |
| 331 | 331 | pll_write(base + REG_DSI_7nm_PHY_PLL_CLOCK_INVERTERS, reg->pll_clock_inverters); |
| @@ -509,6 +509,7 @@ static unsigned long dsi_pll_7nm_vco_recalc_rate(struct clk_hw *hw, · 177 unmodified lines | ||
| 509 | 509 | { |
| 510 | 510 | struct msm_dsi_pll *pll = hw_clk_to_pll(hw); |
| 511 | 511 | struct dsi_pll_7nm *pll_7nm = to_pll_7nm(pll); |
| 512 | + struct dsi_pll_config *config = &pll_7nm->pll_configuration; | |
| 512 | 513 | void __iomem *base = pll_7nm->mmio; |
| 513 | 514 | u64 ref_clk = pll_7nm->vco_ref_clk_rate; |
| 514 | 515 | u64 vco_rate = 0x0; |
| @@ -529,9 +530,8 @@ static unsigned long dsi_pll_7nm_vco_recalc_rate(struct clk_hw *hw, · 14 unmodified lines | ||
| 529 | 530 | /* |
| 530 | 531 | * TODO: |
| 531 | 532 | * 1. Assumes prescaler is disabled |
| 532 | − * 2. Multiplier is 2^18. it should be 2^(num_of_frac_bits) | |
| 533 | 533 | */ |
| 534 | − multiplier = 1 << 18; | |
| 534 | + multiplier = 1 << config->frac_bits; | |
| 535 | 535 | pll_freq = dec * (ref_clk * 2); |
| 536 | 536 | tmp64 = (ref_clk * 2 * frac); |
| 537 | 537 | pll_freq += div_u64(tmp64, multiplier); |
| @@ -852,7 +852,8 @@ err_base_clk_hw: · 314 unmodified lines | ||
| 852 | 852 | return ret; |
| 853 | 853 | } |
| 854 | 854 | |
| 855 | −struct msm_dsi_pll *msm_dsi_pll_7nm_init(struct platform_device *pdev, int id) | |
| 855 | +struct msm_dsi_pll *msm_dsi_pll_7nm_init(struct platform_device *pdev, | |
| 856 | + enum msm_dsi_phy_type type, int id) | |
| 856 | 857 | { |
| 857 | 858 | struct dsi_pll_7nm *pll_7nm; |
| 858 | 859 | struct msm_dsi_pll *pll; |
| @@ -885,7 +886,7 @@ struct msm_dsi_pll *msm_dsi_pll_7nm_init(struct platform_device *pdev, int id) · 26 unmodified lines | ||
| 885 | 886 | pll = &pll_7nm->base; |
| 886 | 887 | pll->min_rate = 1000000000UL; |
| 887 | 888 | pll->max_rate = 3500000000UL; |
| 888 | − if (pll->type == MSM_DSI_PHY_7NM_V4_1) { | |
| 889 | + if (type == MSM_DSI_PHY_7NM_V4_1) { | |
| 889 | 890 | pll->min_rate = 600000000UL; |
| 890 | 891 | pll->max_rate = (unsigned long)5000000000ULL; |
| 891 | 892 | /* workaround for max rate overflowing on 32-bit builds: */ |
| @@ -57,10 +57,13 @@ static void vblank_put(struct msm_kms *kms, unsigned crtc_mask) · 56 unmodified lines | ||
| 57 | 57 | |
| 58 | 58 | static void lock_crtcs(struct msm_kms *kms, unsigned int crtc_mask) |
| 59 | 59 | { |
| 60 | + int crtc_index; | |
| 60 | 61 | struct drm_crtc *crtc; |
| 61 | 62 | |
| 62 | − for_each_crtc_mask(kms->dev, crtc, crtc_mask) | |
| 63 | − mutex_lock(&kms->commit_lock[drm_crtc_index(crtc)]); | |
| 63 | + for_each_crtc_mask(kms->dev, crtc, crtc_mask) { | |
| 64 | + crtc_index = drm_crtc_index(crtc); | |
| 65 | + mutex_lock_nested(&kms->commit_lock[crtc_index], crtc_index); | |
| 66 | + } | |
| 64 | 67 | } |
| 65 | 68 | |
| 66 | 69 | static void unlock_crtcs(struct msm_kms *kms, unsigned int crtc_mask) |
| @@ -570,6 +570,7 @@ err_free_priv: · 569 unmodified lines | ||
| 570 | 570 | kfree(priv); |
| 571 | 571 | err_put_drm_dev: |
| 572 | 572 | drm_dev_put(ddev); |
| 573 | + platform_set_drvdata(pdev, NULL); | |
| 573 | 574 | return ret; |
| 574 | 575 | } |
| 575 | 576 | |
| @@ -1072,6 +1073,10 @@ static int __maybe_unused msm_pm_resume(struct device *dev) · 496 unmodified lines | ||
| 1072 | 1073 | static int __maybe_unused msm_pm_prepare(struct device *dev) |
| 1073 | 1074 | { |
| 1074 | 1075 | struct drm_device *ddev = dev_get_drvdata(dev); |
| 1076 | + struct msm_drm_private *priv = ddev ? ddev->dev_private : NULL; | |
| 1077 | + | |
| 1078 | + if (!priv || !priv->kms) | |
| 1079 | + return 0; | |
| 1075 | 1080 | |
| 1076 | 1081 | return drm_mode_config_helper_suspend(ddev); |
| 1077 | 1082 | } |
| @@ -1079,6 +1084,10 @@ static int __maybe_unused msm_pm_prepare(struct device *dev) · 1 unmodified line | ||
| 1079 | 1084 | static void __maybe_unused msm_pm_complete(struct device *dev) |
| 1080 | 1085 | { |
| 1081 | 1086 | struct drm_device *ddev = dev_get_drvdata(dev); |
| 1087 | + struct msm_drm_private *priv = ddev ? ddev->dev_private : NULL; | |
| 1088 | + | |
| 1089 | + if (!priv || !priv->kms) | |
| 1090 | + return; | |
| 1082 | 1091 | |
| 1083 | 1092 | drm_mode_config_helper_resume(ddev); |
| 1084 | 1093 | } |
| @@ -1311,6 +1320,10 @@ static int msm_pdev_remove(struct platform_device *pdev) · 226 unmodified lines | ||
| 1311 | 1320 | static void msm_pdev_shutdown(struct platform_device *pdev) |
| 1312 | 1321 | { |
| 1313 | 1322 | struct drm_device *drm = platform_get_drvdata(pdev); |
| 1323 | + struct msm_drm_private *priv = drm ? drm->dev_private : NULL; | |
| 1324 | + | |
| 1325 | + if (!priv || !priv->kms) | |
| 1326 | + return; | |
| 1314 | 1327 | |
| 1315 | 1328 | drm_atomic_helper_shutdown(drm); |
| 1316 | 1329 | } |
| @@ -45,7 +45,7 @@ int msm_wait_fence(struct msm_fence_context *fctx, uint32_t fence, · 44 unmodified lines | ||
| 45 | 45 | int ret; |
| 46 | 46 | |
| 47 | 47 | if (fence > fctx->last_fence) { |
| 48 | − DRM_ERROR("%s: waiting on invalid fence: %u (of %u)\n", | |
| 48 | + DRM_ERROR_RATELIMITED("%s: waiting on invalid fence: %u (of %u)\n", | |
| 49 | 49 | fctx->name, fence, fctx->last_fence); |
| 50 | 50 | return -EINVAL; |
| 51 | 51 | } |
| @@ -157,7 +157,6 @@ struct msm_kms { · 156 unmodified lines | ||
| 157 | 157 | * from the crtc's pending_timer close to end of the frame: |
| 158 | 158 | */ |
| 159 | 159 | struct mutex commit_lock[MAX_CRTCS]; |
| 160 | − struct lock_class_key commit_lock_keys[MAX_CRTCS]; | |
| 161 | 160 | unsigned pending_crtc_mask; |
| 162 | 161 | struct msm_pending_timer pending_timers[MAX_CRTCS]; |
| 163 | 162 | }; |
| @@ -167,11 +166,8 @@ static inline int msm_kms_init(struct msm_kms *kms, · 3 unmodified lines | ||
| 167 | 166 | { |
| 168 | 167 | unsigned i, ret; |
| 169 | 168 | |
| 170 | − for (i = 0; i < ARRAY_SIZE(kms->commit_lock); i++) { | |
| 171 | − lockdep_register_key(&kms->commit_lock_keys[i]); | |
| 172 | − __mutex_init(&kms->commit_lock[i], "&kms->commit_lock[i]", | |
| 173 | − &kms->commit_lock_keys[i]); | |
| 174 | − } | |
| 169 | + for (i = 0; i < ARRAY_SIZE(kms->commit_lock); i++) | |
| 170 | + mutex_init(&kms->commit_lock[i]); | |
| 175 | 171 | |
| 176 | 172 | kms->funcs = funcs; |
| 177 | 173 | |
| @@ -2693,9 +2693,20 @@ nv50_display_create(struct drm_device *dev) · 2692 unmodified lines | ||
| 2693 | 2693 | else |
| 2694 | 2694 | nouveau_display(dev)->format_modifiers = disp50xx_modifiers; |
| 2695 | 2695 | |
| 2696 | − if (disp->disp->object.oclass >= GK104_DISP) { | |
| 2696 | + /* FIXME: 256x256 cursors are supported on Kepler, however unlike Maxwell and later | |
| 2697 | + * generations Kepler requires that we use small pages (4K) for cursor scanout surfaces. The | |
| 2698 | + * proper fix for this is to teach nouveau to migrate fbs being used for the cursor plane to | |
| 2699 | + * small page allocations in prepare_fb(). When this is implemented, we should also force | |
| 2700 | + * large pages (128K) for ovly fbs in order to fix Kepler ovlys. | |
| 2701 | + * But until then, just limit cursors to 128x128 - which is small enough to avoid ever using | |
| 2702 | + * large pages. | |
| 2703 | + */ | |
| 2704 | + if (disp->disp->object.oclass >= GM107_DISP) { | |
| 2697 | 2705 | dev->mode_config.cursor_width = 256; |
| 2698 | 2706 | dev->mode_config.cursor_height = 256; |
| 2707 | + } else if (disp->disp->object.oclass >= GK104_DISP) { | |
| 2708 | + dev->mode_config.cursor_width = 128; | |
| 2709 | + dev->mode_config.cursor_height = 128; | |
| 2699 | 2710 | } else { |
| 2700 | 2711 | dev->mode_config.cursor_width = 64; |
| 2701 | 2712 | dev->mode_config.cursor_height = 64; |
| @@ -551,12 +551,17 @@ nouveau_bo_sync_for_device(struct nouveau_bo *nvbo) · 550 unmodified lines | ||
| 551 | 551 | |
| 552 | 552 | if (!ttm_dma) |
| 553 | 553 | return; |
| 554 | + if (!ttm_dma->pages) { | |
| 555 | + NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma); | |
| 556 | + return; | |
| 557 | + } | |
| 554 | 558 | |
| 555 | 559 | /* Don't waste time looping if the object is coherent */ |
| 556 | 560 | if (nvbo->force_coherent) |
| 557 | 561 | return; |
| 558 | 562 | |
| 559 | − for (i = 0; i < ttm_dma->num_pages; ++i) { | |
| 563 | + i = 0; | |
| 564 | + while (i < ttm_dma->num_pages) { | |
| 560 | 565 | struct page *p = ttm_dma->pages[i]; |
| 561 | 566 | size_t num_pages = 1; |
| 562 | 567 | |
| @@ -582,12 +587,17 @@ nouveau_bo_sync_for_cpu(struct nouveau_bo *nvbo) · 19 unmodified lines | ||
| 582 | 587 | |
| 583 | 588 | if (!ttm_dma) |
| 584 | 589 | return; |
| 590 | + if (!ttm_dma->pages) { | |
| 591 | + NV_DEBUG(drm, "ttm_dma 0x%p: pages NULL\n", ttm_dma); | |
| 592 | + return; | |
| 593 | + } | |
| 585 | 594 | |
| 586 | 595 | /* Don't waste time looping if the object is coherent */ |
| 587 | 596 | if (nvbo->force_coherent) |
| 588 | 597 | return; |
| 589 | 598 | |
| 590 | − for (i = 0; i < ttm_dma->num_pages; ++i) { | |
| 599 | + i = 0; | |
| 600 | + while (i < ttm_dma->num_pages) { | |
| 591 | 601 | struct page *p = ttm_dma->pages[i]; |
| 592 | 602 | size_t num_pages = 1; |
| 593 | 603 | |
| @@ -2149,11 +2149,12 @@ static int dsi_vc_send_short(struct dsi_data *dsi, int vc, · 2148 unmodified lines | ||
| 2149 | 2149 | const struct mipi_dsi_msg *msg) |
| 2150 | 2150 | { |
| 2151 | 2151 | struct mipi_dsi_packet pkt; |
| 2152 | + int ret; | |
| 2152 | 2153 | u32 r; |
| 2153 | 2154 | |
| 2154 | − r = mipi_dsi_create_packet(&pkt, msg); | |
| 2155 | − if (r < 0) | |
| 2156 | − return r; | |
| 2155 | + ret = mipi_dsi_create_packet(&pkt, msg); | |
| 2156 | + if (ret < 0) | |
| 2157 | + return ret; | |
| 2157 | 2158 | |
| 2158 | 2159 | WARN_ON(!dsi_bus_is_locked(dsi)); |
| 2159 | 2160 | |
| @@ -37,6 +37,7 @@ struct dsic_panel_data { · 36 unmodified lines | ||
| 37 | 37 | u32 height_mm; |
| 38 | 38 | u32 max_hs_rate; |
| 39 | 39 | u32 max_lp_rate; |
| 40 | + bool te_support; | |
| 40 | 41 | }; |
| 41 | 42 | |
| 42 | 43 | struct panel_drv_data { |
| @@ -334,9 +335,11 @@ static int dsicm_power_on(struct panel_drv_data *ddata) · 291 unmodified lines | ||
| 334 | 335 | if (r) |
| 335 | 336 | goto err; |
| 336 | 337 | |
| 337 | − r = mipi_dsi_dcs_set_tear_on(ddata->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); | |
| 338 | − if (r) | |
| 339 | − goto err; | |
| 338 | + if (ddata->panel_data->te_support) { | |
| 339 | + r = mipi_dsi_dcs_set_tear_on(ddata->dsi, MIPI_DSI_DCS_TEAR_MODE_VBLANK); | |
| 340 | + if (r) | |
| 341 | + goto err; | |
| 342 | + } | |
| 340 | 343 | |
| 341 | 344 | /* possible panel bug */ |
| 342 | 345 | msleep(100); |
| @@ -619,6 +622,7 @@ static const struct dsic_panel_data taal_data = { · 276 unmodified lines | ||
| 619 | 622 | .height_mm = 0, |
| 620 | 623 | .max_hs_rate = 300000000, |
| 621 | 624 | .max_lp_rate = 10000000, |
| 625 | + .te_support = true, | |
| 622 | 626 | }; |
| 623 | 627 | |
| 624 | 628 | static const struct dsic_panel_data himalaya_data = { |
| @@ -629,6 +633,7 @@ static const struct dsic_panel_data himalaya_data = { · 4 unmodified lines | ||
| 629 | 633 | .height_mm = 88, |
| 630 | 634 | .max_hs_rate = 300000000, |
| 631 | 635 | .max_lp_rate = 10000000, |
| 636 | + .te_support = false, | |
| 632 | 637 | }; |
| 633 | 638 | |
| 634 | 639 | static const struct dsic_panel_data droid4_data = { |
| @@ -639,6 +644,7 @@ static const struct dsic_panel_data droid4_data = { · 4 unmodified lines | ||
| 639 | 644 | .height_mm = 89, |
| 640 | 645 | .max_hs_rate = 300000000, |
| 641 | 646 | .max_lp_rate = 10000000, |
| 647 | + .te_support = false, | |
| 642 | 648 | }; |
| 643 | 649 | |
| 644 | 650 | static const struct of_device_id dsicm_of_match[] = { |
| @@ -328,6 +328,7 @@ static void qxl_crtc_update_monitors_config(struct drm_crtc *crtc, · 327 unmodified lines | ||
| 328 | 328 | |
| 329 | 329 | head.id = i; |
| 330 | 330 | head.flags = 0; |
| 331 | + head.surface_id = 0; | |
| 331 | 332 | oldcount = qdev->monitors_config->count; |
| 332 | 333 | if (crtc->state->active) { |
| 333 | 334 | struct drm_display_mode *mode = &crtc->mode; |
| @@ -321,7 +321,7 @@ int qxl_alloc_release_reserved(struct qxl_device *qdev, unsigned long size, · 320 unmodified lines | ||
| 321 | 321 | int type, struct qxl_release **release, |
| 322 | 322 | struct qxl_bo **rbo) |
| 323 | 323 | { |
| 324 | − struct qxl_bo *bo; | |
| 324 | + struct qxl_bo *bo, *free_bo = NULL; | |
| 325 | 325 | int idr_ret; |
| 326 | 326 | int ret = 0; |
| 327 | 327 | union qxl_release_info *info; |
| @@ -347,7 +347,7 @@ int qxl_alloc_release_reserved(struct qxl_device *qdev, unsigned long size, · 19 unmodified lines | ||
| 347 | 347 | |
| 348 | 348 | mutex_lock(&qdev->release_mutex); |
| 349 | 349 | if (qdev->current_release_bo_offset[cur_idx] + 1 >= releases_per_bo[cur_idx]) { |
| 350 | − qxl_bo_unref(&qdev->current_release_bo[cur_idx]); | |
| 350 | + free_bo = qdev->current_release_bo[cur_idx]; | |
| 351 | 351 | qdev->current_release_bo_offset[cur_idx] = 0; |
| 352 | 352 | qdev->current_release_bo[cur_idx] = NULL; |
| 353 | 353 | } |
| @@ -355,6 +355,10 @@ int qxl_alloc_release_reserved(struct qxl_device *qdev, unsigned long size, · 1 unmodified line | ||
| 355 | 355 | ret = qxl_release_bo_alloc(qdev, &qdev->current_release_bo[cur_idx]); |
| 356 | 356 | if (ret) { |
| 357 | 357 | mutex_unlock(&qdev->release_mutex); |
| 358 | + if (free_bo) { | |
| 359 | + qxl_bo_unpin(free_bo); | |
| 360 | + qxl_bo_unref(&free_bo); | |
| 361 | + } | |
| 358 | 362 | qxl_release_free(qdev, *release); |
| 359 | 363 | return ret; |
| 360 | 364 | } |
| @@ -370,6 +374,10 @@ int qxl_alloc_release_reserved(struct qxl_device *qdev, unsigned long size, · 9 unmodified lines | ||
| 370 | 374 | *rbo = bo; |
| 371 | 375 | |
| 372 | 376 | mutex_unlock(&qdev->release_mutex); |
| 377 | + if (free_bo) { | |
| 378 | + qxl_bo_unpin(free_bo); | |
| 379 | + qxl_bo_unref(&free_bo); | |
| 380 | + } | |
| 373 | 381 | |
| 374 | 382 | ret = qxl_release_list_add(*release, bo); |
| 375 | 383 | qxl_bo_unref(&bo); |
| @@ -574,6 +574,8 @@ struct radeon_gem { · 573 unmodified lines | ||
| 574 | 574 | struct list_head objects; |
| 575 | 575 | }; |
| 576 | 576 | |
| 577 | +extern const struct drm_gem_object_funcs radeon_gem_object_funcs; | |
| 578 | + | |
| 577 | 579 | int radeon_gem_init(struct radeon_device *rdev); |
| 578 | 580 | void radeon_gem_fini(struct radeon_device *rdev); |
| 579 | 581 | int radeon_gem_object_create(struct radeon_device *rdev, unsigned long size, |
| @@ -43,7 +43,7 @@ struct sg_table *radeon_gem_prime_get_sg_table(struct drm_gem_object *obj); · 42 unmodified lines | ||
| 43 | 43 | int radeon_gem_prime_pin(struct drm_gem_object *obj); |
| 44 | 44 | void radeon_gem_prime_unpin(struct drm_gem_object *obj); |
| 45 | 45 | |
| 46 | −static const struct drm_gem_object_funcs radeon_gem_object_funcs; | |
| 46 | +const struct drm_gem_object_funcs radeon_gem_object_funcs; | |
| 47 | 47 | |
| 48 | 48 | static void radeon_gem_object_free(struct drm_gem_object *gobj) |
| 49 | 49 | { |
| @@ -227,7 +227,7 @@ static int radeon_gem_handle_lockup(struct radeon_device *rdev, int r) · 177 unmodified lines | ||
| 227 | 227 | return r; |
| 228 | 228 | } |
| 229 | 229 | |
| 230 | −static const struct drm_gem_object_funcs radeon_gem_object_funcs = { | |
| 230 | +const struct drm_gem_object_funcs radeon_gem_object_funcs = { | |
| 231 | 231 | .free = radeon_gem_object_free, |
| 232 | 232 | .open = radeon_gem_object_open, |
| 233 | 233 | .close = radeon_gem_object_close, |
| @@ -56,6 +56,8 @@ struct drm_gem_object *radeon_gem_prime_import_sg_table(struct drm_device *dev, · 55 unmodified lines | ||
| 56 | 56 | if (ret) |
| 57 | 57 | return ERR_PTR(ret); |
| 58 | 58 | |
| 59 | + bo->tbo.base.funcs = &radeon_gem_object_funcs; | |
| 60 | + | |
| 59 | 61 | mutex_lock(&rdev->gem.mutex); |
| 60 | 62 | list_add_tail(&bo->list, &rdev->gem.objects); |
| 61 | 63 | mutex_unlock(&rdev->gem.mutex); |
| @@ -364,7 +364,7 @@ static int radeon_ttm_tt_pin_userptr(struct ttm_bo_device *bdev, struct ttm_tt * · 363 unmodified lines | ||
| 364 | 364 | if (gtt->userflags & RADEON_GEM_USERPTR_ANONONLY) { |
| 365 | 365 | /* check that we only pin down anonymous memory |
| 366 | 366 | to prevent problems with writeback */ |
| 367 | − unsigned long end = gtt->userptr + ttm->num_pages * PAGE_SIZE; | |
| 367 | + unsigned long end = gtt->userptr + (u64)ttm->num_pages * PAGE_SIZE; | |
| 368 | 368 | struct vm_area_struct *vma; |
| 369 | 369 | vma = find_vma(gtt->usermm, gtt->userptr); |
| 370 | 370 | if (!vma || vma->vm_file || vma->vm_end < end) |
| @@ -386,7 +386,7 @@ static int radeon_ttm_tt_pin_userptr(struct ttm_bo_device *bdev, struct ttm_tt * · 15 unmodified lines | ||
| 386 | 386 | } while (pinned < ttm->num_pages); |
| 387 | 387 | |
| 388 | 388 | r = sg_alloc_table_from_pages(ttm->sg, ttm->pages, ttm->num_pages, 0, |
| 389 | − ttm->num_pages << PAGE_SHIFT, | |
| 389 | + (u64)ttm->num_pages << PAGE_SHIFT, | |
| 390 | 390 | GFP_KERNEL); |
| 391 | 391 | if (r) |
| 392 | 392 | goto release_sg; |
| @@ -48,21 +48,12 @@ static unsigned int rcar_du_encoder_count_ports(struct device_node *node) · 47 unmodified lines | ||
| 48 | 48 | static const struct drm_encoder_funcs rcar_du_encoder_funcs = { |
| 49 | 49 | }; |
| 50 | 50 | |
| 51 | −static void rcar_du_encoder_release(struct drm_device *dev, void *res) | |
| 52 | −{ | |
| 53 | − struct rcar_du_encoder *renc = res; | |
| 54 | − | |
| 55 | − drm_encoder_cleanup(&renc->base); | |
| 56 | − kfree(renc); | |
| 57 | −} | |
| 58 | − | |
| 59 | 51 | int rcar_du_encoder_init(struct rcar_du_device *rcdu, |
| 60 | 52 | enum rcar_du_output output, |
| 61 | 53 | struct device_node *enc_node) |
| 62 | 54 | { |
| 63 | 55 | struct rcar_du_encoder *renc; |
| 64 | 56 | struct drm_bridge *bridge; |
| 65 | − int ret; | |
| 66 | 57 | |
| 67 | 58 | /* |
| 68 | 59 | * Locate the DRM bridge from the DT node. For the DPAD outputs, if the |
| @@ -101,26 +92,16 @@ int rcar_du_encoder_init(struct rcar_du_device *rcdu, · 32 unmodified lines | ||
| 101 | 92 | return -ENOLINK; |
| 102 | 93 | } |
| 103 | 94 | |
| 104 | − renc = kzalloc(sizeof(*renc), GFP_KERNEL); | |
| 105 | − if (renc == NULL) | |
| 106 | − return -ENOMEM; | |
| 107 | − | |
| 108 | − renc->output = output; | |
| 109 | − | |
| 110 | 95 | dev_dbg(rcdu->dev, "initializing encoder %pOF for output %u\n", |
| 111 | 96 | enc_node, output); |
| 112 | 97 | |
| 113 | − ret = drm_encoder_init(&rcdu->ddev, &renc->base, &rcar_du_encoder_funcs, | |
| 114 | − DRM_MODE_ENCODER_NONE, NULL); | |
| 115 | − if (ret < 0) { | |
| 116 | − kfree(renc); | |
| 117 | − return ret; | |
| 118 | − } | |
| 98 | + renc = drmm_encoder_alloc(&rcdu->ddev, struct rcar_du_encoder, base, | |
| 99 | + &rcar_du_encoder_funcs, DRM_MODE_ENCODER_NONE, | |
| 100 | + NULL); | |
| 101 | + if (!renc) | |
| 102 | + return -ENOMEM; | |
| 119 | 103 | |
| 120 | − ret = drmm_add_action_or_reset(&rcdu->ddev, rcar_du_encoder_release, | |
| 121 | − renc); | |
| 122 | − if (ret) | |
| 123 | − return ret; | |
| 104 | + renc->output = output; | |
| 124 | 105 | |
| 125 | 106 | /* |
| 126 | 107 | * Attach the bridge to the encoder. The bridge will create the |
| @@ -1688,6 +1688,11 @@ static void tegra_dc_commit_state(struct tegra_dc *dc, · 1687 unmodified lines | ||
| 1688 | 1688 | dev_err(dc->dev, |
| 1689 | 1689 | "failed to set clock rate to %lu Hz\n", |
| 1690 | 1690 | state->pclk); |
| 1691 | + | |
| 1692 | + err = clk_set_rate(dc->clk, state->pclk); | |
| 1693 | + if (err < 0) | |
| 1694 | + dev_err(dc->dev, "failed to set clock %pC to %lu Hz: %d\n", | |
| 1695 | + dc->clk, state->pclk, err); | |
| 1691 | 1696 | } |
| 1692 | 1697 | |
| 1693 | 1698 | DRM_DEBUG_KMS("rate: %lu, div: %u\n", clk_get_rate(dc->clk), |
| @@ -1698,11 +1703,6 @@ static void tegra_dc_commit_state(struct tegra_dc *dc, · 4 unmodified lines | ||
| 1698 | 1703 | value = SHIFT_CLK_DIVIDER(state->div) | PIXEL_CLK_DIVIDER_PCD1; |
| 1699 | 1704 | tegra_dc_writel(dc, value, DC_DISP_DISP_CLOCK_CONTROL); |
| 1700 | 1705 | } |
| 1701 | − | |
| 1702 | − err = clk_set_rate(dc->clk, state->pclk); | |
| 1703 | − if (err < 0) | |
| 1704 | − dev_err(dc->dev, "failed to set clock %pC to %lu Hz: %d\n", | |
| 1705 | − dc->clk, state->pclk, err); | |
| 1706 | 1706 | } |
| 1707 | 1707 | |
| 1708 | 1708 | static void tegra_dc_stop(struct tegra_dc *dc) |
| @@ -2501,22 +2501,18 @@ static int tegra_dc_couple(struct tegra_dc *dc) · 792 unmodified lines | ||
| 2501 | 2501 | * POWER_CONTROL registers during CRTC enabling. |
| 2502 | 2502 | */ |
| 2503 | 2503 | if (dc->soc->coupled_pm && dc->pipe == 1) { |
| 2504 | − u32 flags = DL_FLAG_PM_RUNTIME | DL_FLAG_AUTOREMOVE_CONSUMER; | |
| 2505 | − struct device_link *link; | |
| 2506 | − struct device *partner; | |
| 2504 | + struct device *companion; | |
| 2505 | + struct tegra_dc *parent; | |
| 2507 | 2506 | |
| 2508 | − partner = driver_find_device(dc->dev->driver, NULL, NULL, | |
| 2509 | − tegra_dc_match_by_pipe); | |
| 2510 | − if (!partner) | |
| 2507 | + companion = driver_find_device(dc->dev->driver, NULL, (const void *)0, | |
| 2508 | + tegra_dc_match_by_pipe); | |
| 2509 | + if (!companion) | |
| 2511 | 2510 | return -EPROBE_DEFER; |
| 2512 | 2511 | |
| 2513 | − link = device_link_add(dc->dev, partner, flags); | |
| 2514 | − if (!link) { | |
| 2515 | − dev_err(dc->dev, "failed to link controllers\n"); | |
| 2516 | − return -EINVAL; | |
| 2517 | − } | |
| 2512 | + parent = dev_get_drvdata(companion); | |
| 2513 | + dc->client.parent = &parent->client; | |
| 2518 | 2514 | |
| 2519 | − dev_dbg(dc->dev, "coupled to %s\n", dev_name(partner)); | |
| 2515 | + dev_dbg(dc->dev, "coupled to %s\n", dev_name(companion)); | |
| 2520 | 2516 | } |
| 2521 | 2517 | |
| 2522 | 2518 | return 0; |
| @@ -3115,6 +3115,12 @@ static int tegra_sor_init(struct host1x_client *client) · 3114 unmodified lines | ||
| 3115 | 3115 | * kernel is possible. |
| 3116 | 3116 | */ |
| 3117 | 3117 | if (sor->rst) { |
| 3118 | + err = pm_runtime_resume_and_get(sor->dev); | |
| 3119 | + if (err < 0) { | |
| 3120 | + dev_err(sor->dev, "failed to get runtime PM: %d\n", err); | |
| 3121 | + return err; | |
| 3122 | + } | |
| 3123 | + | |
| 3118 | 3124 | err = reset_control_acquire(sor->rst); |
| 3119 | 3125 | if (err < 0) { |
| 3120 | 3126 | dev_err(sor->dev, "failed to acquire SOR reset: %d\n", |
| @@ -3148,6 +3154,7 @@ static int tegra_sor_init(struct host1x_client *client) · 27 unmodified lines | ||
| 3148 | 3154 | } |
| 3149 | 3155 | |
| 3150 | 3156 | reset_control_release(sor->rst); |
| 3157 | + pm_runtime_put(sor->dev); | |
| 3151 | 3158 | } |
| 3152 | 3159 | |
| 3153 | 3160 | err = clk_prepare_enable(sor->clk_safe); |
| @@ -83,6 +83,7 @@ MODULE_PARM_DESC(eco_mode, "Turn on Eco mode (less bright, more silent)"); · 82 unmodified lines | ||
| 83 | 83 | |
| 84 | 84 | struct gm12u320_device { |
| 85 | 85 | struct drm_device dev; |
| 86 | + struct device *dmadev; | |
| 86 | 87 | struct drm_simple_display_pipe pipe; |
| 87 | 88 | struct drm_connector conn; |
| 88 | 89 | unsigned char *cmd_buf; |
| @@ -601,6 +602,22 @@ static const uint64_t gm12u320_pipe_modifiers[] = { · 512 unmodified lines | ||
| 601 | 602 | DRM_FORMAT_MOD_INVALID |
| 602 | 603 | }; |
| 603 | 604 | |
| 605 | +/* | |
| 606 | + * FIXME: Dma-buf sharing requires DMA support by the importing device. | |
| 607 | + * This function is a workaround to make USB devices work as well. | |
| 608 | + * See todo.rst for how to fix the issue in the dma-buf framework. | |
| 609 | + */ | |
| 610 | +static struct drm_gem_object *gm12u320_gem_prime_import(struct drm_device *dev, | |
| 611 | + struct dma_buf *dma_buf) | |
| 612 | +{ | |
| 613 | + struct gm12u320_device *gm12u320 = to_gm12u320(dev); | |
| 614 | + | |
| 615 | + if (!gm12u320->dmadev) | |
| 616 | + return ERR_PTR(-ENODEV); | |
| 617 | + | |
| 618 | + return drm_gem_prime_import_dev(dev, dma_buf, gm12u320->dmadev); | |
| 619 | +} | |
| 620 | + | |
| 604 | 621 | DEFINE_DRM_GEM_FOPS(gm12u320_fops); |
| 605 | 622 | |
| 606 | 623 | static const struct drm_driver gm12u320_drm_driver = { |
| @@ -614,6 +631,7 @@ static const struct drm_driver gm12u320_drm_driver = { · 7 unmodified lines | ||
| 614 | 631 | |
| 615 | 632 | .fops = &gm12u320_fops, |
| 616 | 633 | DRM_GEM_SHMEM_DRIVER_OPS, |
| 634 | + .gem_prime_import = gm12u320_gem_prime_import, | |
| 617 | 635 | }; |
| 618 | 636 | |
| 619 | 637 | static const struct drm_mode_config_funcs gm12u320_mode_config_funcs = { |
| @@ -640,15 +658,18 @@ static int gm12u320_usb_probe(struct usb_interface *interface, · 20 unmodified lines | ||
| 640 | 658 | struct gm12u320_device, dev); |
| 641 | 659 | if (IS_ERR(gm12u320)) |
| 642 | 660 | return PTR_ERR(gm12u320); |
| 661 | + dev = &gm12u320->dev; | |
| 662 | + | |
| 663 | + gm12u320->dmadev = usb_intf_get_dma_device(to_usb_interface(dev->dev)); | |
| 664 | + if (!gm12u320->dmadev) | |
| 665 | + drm_warn(dev, "buffer sharing not supported"); /* not an error */ | |
| 643 | 666 | |
| 644 | 667 | INIT_DELAYED_WORK(&gm12u320->fb_update.work, gm12u320_fb_update_work); |
| 645 | 668 | mutex_init(&gm12u320->fb_update.lock); |
| 646 | 669 | |
| 647 | − dev = &gm12u320->dev; | |
| 648 | − | |
| 649 | 670 | ret = drmm_mode_config_init(dev); |
| 650 | 671 | if (ret) |
| 651 | − return ret; | |
| 672 | + goto err_put_device; | |
| 652 | 673 | |
| 653 | 674 | dev->mode_config.min_width = GM12U320_USER_WIDTH; |
| 654 | 675 | dev->mode_config.max_width = GM12U320_USER_WIDTH; |
| @@ -658,15 +679,15 @@ static int gm12u320_usb_probe(struct usb_interface *interface, · 3 unmodified lines | ||
| 658 | 679 | |
| 659 | 680 | ret = gm12u320_usb_alloc(gm12u320); |
| 660 | 681 | if (ret) |
| 661 | − return ret; | |
| 682 | + goto err_put_device; | |
| 662 | 683 | |
| 663 | 684 | ret = gm12u320_set_ecomode(gm12u320); |
| 664 | 685 | if (ret) |
| 665 | − return ret; | |
| 686 | + goto err_put_device; | |
| 666 | 687 | |
| 667 | 688 | ret = gm12u320_conn_init(gm12u320); |
| 668 | 689 | if (ret) |
| 669 | − return ret; | |
| 690 | + goto err_put_device; | |
| 670 | 691 | |
| 671 | 692 | ret = drm_simple_display_pipe_init(&gm12u320->dev, |
| 672 | 693 | &gm12u320->pipe, |
| @@ -676,24 +697,31 @@ static int gm12u320_usb_probe(struct usb_interface *interface, · 3 unmodified lines | ||
| 676 | 697 | gm12u320_pipe_modifiers, |
| 677 | 698 | &gm12u320->conn); |
| 678 | 699 | if (ret) |
| 679 | − return ret; | |
| 700 | + goto err_put_device; | |
| 680 | 701 | |
| 681 | 702 | drm_mode_config_reset(dev); |
| 682 | 703 | |
| 683 | 704 | usb_set_intfdata(interface, dev); |
| 684 | 705 | ret = drm_dev_register(dev, 0); |
| 685 | 706 | if (ret) |
| 686 | − return ret; | |
| 707 | + goto err_put_device; | |
| 687 | 708 | |
| 688 | 709 | drm_fbdev_generic_setup(dev, 0); |
| 689 | 710 | |
| 690 | 711 | return 0; |
| 712 | + | |
| 713 | +err_put_device: | |
| 714 | + put_device(gm12u320->dmadev); | |
| 715 | + return ret; | |
| 691 | 716 | } |
| 692 | 717 | |
| 693 | 718 | static void gm12u320_usb_disconnect(struct usb_interface *interface) |
| 694 | 719 | { |
| 695 | 720 | struct drm_device *dev = usb_get_intfdata(interface); |
| 721 | + struct gm12u320_device *gm12u320 = to_gm12u320(dev); | |
| 696 | 722 | |
| 723 | + put_device(gm12u320->dmadev); | |
| 724 | + gm12u320->dmadev = NULL; | |
| 697 | 725 | drm_dev_unplug(dev); |
| 698 | 726 | drm_atomic_helper_shutdown(dev); |
| 699 | 727 | } |
| @@ -136,7 +136,8 @@ void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo, · 135 unmodified lines | ||
| 136 | 136 | struct ttm_bo_device *bdev = bo->bdev; |
| 137 | 137 | struct ttm_resource_manager *man; |
| 138 | 138 | |
| 139 | − dma_resv_assert_held(bo->base.resv); | |
| 139 | + if (!bo->deleted) | |
| 140 | + dma_resv_assert_held(bo->base.resv); | |
| 140 | 141 | |
| 141 | 142 | if (bo->pin_count) { |
| 142 | 143 | ttm_bo_del_from_lru(bo); |
| @@ -508,8 +509,11 @@ static void ttm_bo_release(struct kref *kref) · 365 unmodified lines | ||
| 508 | 509 | * Make pinned bos immediately available to |
| 509 | 510 | * shrinkers, now that they are queued for |
| 510 | 511 | * destruction. |
| 512 | + * | |
| 513 | + * FIXME: QXL is triggering this. Can be removed when the | |
| 514 | + * driver is fixed. | |
| 511 | 515 | */ |
| 512 | − if (WARN_ON(bo->pin_count)) { | |
| 516 | + if (WARN_ON_ONCE(bo->pin_count)) { | |
| 513 | 517 | bo->pin_count = 0; |
| 514 | 518 | ttm_bo_move_to_lru_tail(bo, &bo->mem, NULL); |
| 515 | 519 | } |
| @@ -268,13 +268,13 @@ static void ttm_pool_type_init(struct ttm_pool_type *pt, struct ttm_pool *pool, · 267 unmodified lines | ||
| 268 | 268 | /* Remove a pool_type from the global shrinker list and free all pages */ |
| 269 | 269 | static void ttm_pool_type_fini(struct ttm_pool_type *pt) |
| 270 | 270 | { |
| 271 | − struct page *p, *tmp; | |
| 271 | + struct page *p; | |
| 272 | 272 | |
| 273 | 273 | mutex_lock(&shrinker_lock); |
| 274 | 274 | list_del(&pt->shrinker_list); |
| 275 | 275 | mutex_unlock(&shrinker_lock); |
| 276 | 276 | |
| 277 | − list_for_each_entry_safe(p, tmp, &pt->pages, lru) | |
| 277 | + while ((p = ttm_pool_type_take(pt))) | |
| 278 | 278 | ttm_pool_free_page(pt->pool, pt->caching, pt->order, p); |
| 279 | 279 | } |
| 280 | 280 | |
| @@ -32,6 +32,22 @@ static int udl_usb_resume(struct usb_interface *interface) · 31 unmodified lines | ||
| 32 | 32 | return drm_mode_config_helper_resume(dev); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | +/* | |
| 36 | + * FIXME: Dma-buf sharing requires DMA support by the importing device. | |
| 37 | + * This function is a workaround to make USB devices work as well. | |
| 38 | + * See todo.rst for how to fix the issue in the dma-buf framework. | |
| 39 | + */ | |
| 40 | +static struct drm_gem_object *udl_driver_gem_prime_import(struct drm_device *dev, | |
| 41 | + struct dma_buf *dma_buf) | |
| 42 | +{ | |
| 43 | + struct udl_device *udl = to_udl(dev); | |
| 44 | + | |
| 45 | + if (!udl->dmadev) | |
| 46 | + return ERR_PTR(-ENODEV); | |
| 47 | + | |
| 48 | + return drm_gem_prime_import_dev(dev, dma_buf, udl->dmadev); | |
| 49 | +} | |
| 50 | + | |
| 35 | 51 | DEFINE_DRM_GEM_FOPS(udl_driver_fops); |
| 36 | 52 | |
| 37 | 53 | static const struct drm_driver driver = { |
| @@ -40,6 +56,7 @@ static const struct drm_driver driver = { · 2 unmodified lines | ||
| 40 | 56 | /* GEM hooks */ |
| 41 | 57 | .fops = &udl_driver_fops, |
| 42 | 58 | DRM_GEM_SHMEM_DRIVER_OPS, |
| 59 | + .gem_prime_import = udl_driver_gem_prime_import, | |
| 43 | 60 | |
| 44 | 61 | .name = DRIVER_NAME, |
| 45 | 62 | .desc = DRIVER_DESC, |
| @@ -50,6 +50,7 @@ struct urb_list { · 49 unmodified lines | ||
| 50 | 50 | struct udl_device { |
| 51 | 51 | struct drm_device drm; |
| 52 | 52 | struct device *dev; |
| 53 | + struct device *dmadev; | |
| 53 | 54 | |
| 54 | 55 | struct drm_simple_display_pipe display_pipe; |
| 55 | 56 | |
| @@ -315,6 +315,10 @@ int udl_init(struct udl_device *udl) · 314 unmodified lines | ||
| 315 | 315 | |
| 316 | 316 | DRM_DEBUG("\n"); |
| 317 | 317 | |
| 318 | + udl->dmadev = usb_intf_get_dma_device(to_usb_interface(dev->dev)); | |
| 319 | + if (!udl->dmadev) | |
| 320 | + drm_warn(dev, "buffer sharing not supported"); /* not an error */ | |
| 321 | + | |
| 318 | 322 | mutex_init(&udl->gem_lock); |
| 319 | 323 | |
| 320 | 324 | if (!udl_parse_vendor_descriptor(udl)) { |
| @@ -343,12 +347,18 @@ int udl_init(struct udl_device *udl) · 22 unmodified lines | ||
| 343 | 347 | err: |
| 344 | 348 | if (udl->urbs.count) |
| 345 | 349 | udl_free_urb_list(dev); |
| 350 | + put_device(udl->dmadev); | |
| 346 | 351 | DRM_ERROR("%d\n", ret); |
| 347 | 352 | return ret; |
| 348 | 353 | } |
| 349 | 354 | |
| 350 | 355 | int udl_drop_usb(struct drm_device *dev) |
| 351 | 356 | { |
| 357 | + struct udl_device *udl = to_udl(dev); | |
| 358 | + | |
| 352 | 359 | udl_free_urb_list(dev); |
| 360 | + put_device(udl->dmadev); | |
| 361 | + udl->dmadev = NULL; | |
| 362 | + | |
| 353 | 363 | return 0; |
| 354 | 364 | } |
| @@ -210,6 +210,7 @@ static u32 vc4_get_fifo_full_level(struct vc4_crtc *vc4_crtc, u32 format) · 209 unmodified lines | ||
| 210 | 210 | { |
| 211 | 211 | const struct vc4_crtc_data *crtc_data = vc4_crtc_to_vc4_crtc_data(vc4_crtc); |
| 212 | 212 | const struct vc4_pv_data *pv_data = vc4_crtc_to_vc4_pv_data(vc4_crtc); |
| 213 | + struct vc4_dev *vc4 = to_vc4_dev(vc4_crtc->base.dev); | |
| 213 | 214 | u32 fifo_len_bytes = pv_data->fifo_depth; |
| 214 | 215 | |
| 215 | 216 | /* |
| @@ -238,6 +239,22 @@ static u32 vc4_get_fifo_full_level(struct vc4_crtc *vc4_crtc, u32 format) · 22 unmodified lines | ||
| 238 | 239 | if (crtc_data->hvs_output == 5) |
| 239 | 240 | return 32; |
| 240 | 241 | |
| 242 | + /* | |
| 243 | + * It looks like in some situations, we will overflow | |
| 244 | + * the PixelValve FIFO (with the bit 10 of PV stat being | |
| 245 | + * set) and stall the HVS / PV, eventually resulting in | |
| 246 | + * a page flip timeout. | |
| 247 | + * | |
| 248 | + * Displaying the video overlay during a playback with | |
| 249 | + * Kodi on an RPi3 seems to be a great solution with a | |
| 250 | + * failure rate around 50%. | |
| 251 | + * | |
| 252 | + * Removing 1 from the FIFO full level however | |
| 253 | + * seems to completely remove that issue. | |
| 254 | + */ | |
| 255 | + if (!vc4->hvs->hvs5) | |
| 256 | + return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX - 1; | |
| 257 | + | |
| 241 | 258 | return fifo_len_bytes - 3 * HVS_FIFO_LATENCY_PIX; |
| 242 | 259 | } |
| 243 | 260 | } |
| @@ -1146,7 +1146,6 @@ static void vc4_plane_atomic_async_update(struct drm_plane *plane, · 1145 unmodified lines | ||
| 1146 | 1146 | plane->state->src_y = state->src_y; |
| 1147 | 1147 | plane->state->src_w = state->src_w; |
| 1148 | 1148 | plane->state->src_h = state->src_h; |
| 1149 | − plane->state->src_h = state->src_h; | |
| 1150 | 1149 | plane->state->alpha = state->alpha; |
| 1151 | 1150 | plane->state->pixel_blend_mode = state->pixel_blend_mode; |
| 1152 | 1151 | plane->state->rotation = state->rotation; |
| @@ -481,11 +481,15 @@ static int vmw_cotable_resize(struct vmw_resource *res, size_t new_size) · 480 unmodified lines | ||
| 481 | 481 | vmw_bo_unreference(&old_buf); |
| 482 | 482 | res->id = vcotbl->type; |
| 483 | 483 | |
| 484 | + /* Release the pin acquired in vmw_bo_init */ | |
| 485 | + ttm_bo_unpin(bo); | |
| 486 | + | |
| 484 | 487 | return 0; |
| 485 | 488 | |
| 486 | 489 | out_map_new: |
| 487 | 490 | ttm_bo_kunmap(&old_map); |
| 488 | 491 | out_wait: |
| 492 | + ttm_bo_unpin(bo); | |
| 489 | 493 | ttm_bo_unreserve(bo); |
| 490 | 494 | vmw_bo_unreference(&buf); |
| 491 | 495 | |
| @@ -712,17 +712,8 @@ static int vmw_driver_load(struct vmw_private *dev_priv, u32 pci_id) · 711 unmodified lines | ||
| 712 | 712 | dev_priv->last_read_seqno = (uint32_t) -100; |
| 713 | 713 | dev_priv->drm.dev_private = dev_priv; |
| 714 | 714 | |
| 715 | − ret = vmw_setup_pci_resources(dev_priv, pci_id); | |
| 716 | − if (ret) | |
| 717 | − return ret; | |
| 718 | − ret = vmw_detect_version(dev_priv); | |
| 719 | − if (ret) | |
| 720 | − goto out_no_pci_or_version; | |
| 721 | − | |
| 722 | 715 | mutex_init(&dev_priv->cmdbuf_mutex); |
| 723 | − mutex_init(&dev_priv->release_mutex); | |
| 724 | 716 | mutex_init(&dev_priv->binding_mutex); |
| 725 | − mutex_init(&dev_priv->global_kms_state_mutex); | |
| 726 | 717 | ttm_lock_init(&dev_priv->reservation_sem); |
| 727 | 718 | spin_lock_init(&dev_priv->resource_lock); |
| 728 | 719 | spin_lock_init(&dev_priv->hw_lock); |
| @@ -730,6 +721,14 @@ static int vmw_driver_load(struct vmw_private *dev_priv, u32 pci_id) · 1 unmodified line | ||
| 730 | 721 | spin_lock_init(&dev_priv->cap_lock); |
| 731 | 722 | spin_lock_init(&dev_priv->cursor_lock); |
| 732 | 723 | |
| 724 | + ret = vmw_setup_pci_resources(dev_priv, pci_id); | |
| 725 | + if (ret) | |
| 726 | + return ret; | |
| 727 | + ret = vmw_detect_version(dev_priv); | |
| 728 | + if (ret) | |
| 729 | + goto out_no_pci_or_version; | |
| 730 | + | |
| 731 | + | |
| 733 | 732 | for (i = vmw_res_context; i < vmw_res_max; ++i) { |
| 734 | 733 | idr_init(&dev_priv->res_idr[i]); |
| 735 | 734 | INIT_LIST_HEAD(&dev_priv->res_lru[i]); |
| @@ -529,7 +529,6 @@ struct vmw_private { · 528 unmodified lines | ||
| 529 | 529 | struct vmw_overlay *overlay_priv; |
| 530 | 530 | struct drm_property *hotplug_mode_update_property; |
| 531 | 531 | struct drm_property *implicit_placement_property; |
| 532 | − struct mutex global_kms_state_mutex; | |
| 533 | 532 | spinlock_t cursor_lock; |
| 534 | 533 | struct drm_atomic_state *suspend_state; |
| 535 | 534 | |
| @@ -592,7 +591,6 @@ struct vmw_private { · 56 unmodified lines | ||
| 592 | 591 | bool refuse_hibernation; |
| 593 | 592 | bool suspend_locked; |
| 594 | 593 | |
| 595 | − struct mutex release_mutex; | |
| 596 | 594 | atomic_t num_fifo_resources; |
| 597 | 595 | |
| 598 | 596 | /* |
| @@ -1524,9 +1522,8 @@ static inline void vmw_bo_unreference(struct vmw_buffer_object **buf) · 925 unmodified lines | ||
| 1524 | 1522 | struct vmw_buffer_object *tmp_buf = *buf; |
| 1525 | 1523 | |
| 1526 | 1524 | *buf = NULL; |
| 1527 | − if (tmp_buf != NULL) { | |
| 1525 | + if (tmp_buf != NULL) | |
| 1528 | 1526 | ttm_bo_put(&tmp_buf->base); |
| 1529 | − } | |
| 1530 | 1527 | } |
| 1531 | 1528 | |
| 1532 | 1529 | static inline struct vmw_buffer_object * |
| @@ -94,6 +94,16 @@ static void vmw_mob_pt_setup(struct vmw_mob *mob, · 93 unmodified lines | ||
| 94 | 94 | struct vmw_piter data_iter, |
| 95 | 95 | unsigned long num_data_pages); |
| 96 | 96 | |
| 97 | + | |
| 98 | +static inline void vmw_bo_unpin_unlocked(struct ttm_buffer_object *bo) | |
| 99 | +{ | |
| 100 | + int ret = ttm_bo_reserve(bo, false, true, NULL); | |
| 101 | + BUG_ON(ret != 0); | |
| 102 | + ttm_bo_unpin(bo); | |
| 103 | + ttm_bo_unreserve(bo); | |
| 104 | +} | |
| 105 | + | |
| 106 | + | |
| 97 | 107 | /* |
| 98 | 108 | * vmw_setup_otable_base - Issue an object table base setup command to |
| 99 | 109 | * the device |
| @@ -277,6 +287,7 @@ out_no_setup: · 177 unmodified lines | ||
| 277 | 287 | &batch->otables[i]); |
| 278 | 288 | } |
| 279 | 289 | |
| 290 | + vmw_bo_unpin_unlocked(batch->otable_bo); | |
| 280 | 291 | ttm_bo_put(batch->otable_bo); |
| 281 | 292 | batch->otable_bo = NULL; |
| 282 | 293 | return ret; |
| @@ -340,6 +351,7 @@ static void vmw_otable_batch_takedown(struct vmw_private *dev_priv, · 57 unmodified lines | ||
| 340 | 351 | BUG_ON(ret != 0); |
| 341 | 352 | |
| 342 | 353 | vmw_bo_fence_single(bo, NULL); |
| 354 | + ttm_bo_unpin(bo); | |
| 343 | 355 | ttm_bo_unreserve(bo); |
| 344 | 356 | |
| 345 | 357 | ttm_bo_put(batch->otable_bo); |
| @@ -528,6 +540,7 @@ static void vmw_mob_pt_setup(struct vmw_mob *mob, · 182 unmodified lines | ||
| 528 | 540 | void vmw_mob_destroy(struct vmw_mob *mob) |
| 529 | 541 | { |
| 530 | 542 | if (mob->pt_bo) { |
| 543 | + vmw_bo_unpin_unlocked(mob->pt_bo); | |
| 531 | 544 | ttm_bo_put(mob->pt_bo); |
| 532 | 545 | mob->pt_bo = NULL; |
| 533 | 546 | } |
| @@ -643,6 +656,7 @@ int vmw_mob_bind(struct vmw_private *dev_priv, · 109 unmodified lines | ||
| 643 | 656 | out_no_cmd_space: |
| 644 | 657 | vmw_fifo_resource_dec(dev_priv); |
| 645 | 658 | if (pt_set_up) { |
| 659 | + vmw_bo_unpin_unlocked(mob->pt_bo); | |
| 646 | 660 | ttm_bo_put(mob->pt_bo); |
| 647 | 661 | mob->pt_bo = NULL; |
| 648 | 662 | } |
| @@ -500,8 +500,6 @@ vm_fault_t vmw_bo_vm_huge_fault(struct vm_fault *vmf, · 499 unmodified lines | ||
| 500 | 500 | vm_fault_t ret; |
| 501 | 501 | pgoff_t fault_page_size; |
| 502 | 502 | bool write = vmf->flags & FAULT_FLAG_WRITE; |
| 503 | − bool is_cow_mapping = | |
| 504 | − (vma->vm_flags & (VM_SHARED | VM_MAYWRITE)) == VM_MAYWRITE; | |
| 505 | 503 | |
| 506 | 504 | switch (pe_size) { |
| 507 | 505 | case PE_SIZE_PMD: |
| @@ -518,7 +516,7 @@ vm_fault_t vmw_bo_vm_huge_fault(struct vm_fault *vmf, · 10 unmodified lines | ||
| 518 | 516 | } |
| 519 | 517 | |
| 520 | 518 | /* Always do write dirty-tracking and COW on PTE level. */ |
| 521 | − if (write && (READ_ONCE(vbo->dirty) || is_cow_mapping)) | |
| 519 | + if (write && (READ_ONCE(vbo->dirty) || is_cow_mapping(vma->vm_flags))) | |
| 522 | 520 | return VM_FAULT_FALLBACK; |
| 523 | 521 | |
| 524 | 522 | ret = ttm_bo_vm_reserve(bo, vmf); |
| @@ -49,7 +49,7 @@ int vmw_mmap(struct file *filp, struct vm_area_struct *vma) · 48 unmodified lines | ||
| 49 | 49 | vma->vm_ops = &vmw_vm_ops; |
| 50 | 50 | |
| 51 | 51 | /* Use VM_PFNMAP rather than VM_MIXEDMAP if not a COW mapping */ |
| 52 | − if ((vma->vm_flags & (VM_SHARED | VM_MAYWRITE)) != VM_MAYWRITE) | |
| 52 | + if (!is_cow_mapping(vma->vm_flags)) | |
| 53 | 53 | vma->vm_flags = (vma->vm_flags & ~VM_MIXEDMAP) | VM_PFNMAP; |
| 54 | 54 | |
| 55 | 55 | return 0; |
| @@ -521,7 +521,7 @@ static int xen_drm_drv_init(struct xen_drm_front_info *front_info) · 520 unmodified lines | ||
| 521 | 521 | drm_dev = drm_dev_alloc(&xen_drm_driver, dev); |
| 522 | 522 | if (IS_ERR(drm_dev)) { |
| 523 | 523 | ret = PTR_ERR(drm_dev); |
| 524 | − goto fail; | |
| 524 | + goto fail_dev; | |
| 525 | 525 | } |
| 526 | 526 | |
| 527 | 527 | drm_info->drm_dev = drm_dev; |
| @@ -551,8 +551,10 @@ fail_modeset: · 23 unmodified lines | ||
| 551 | 551 | drm_kms_helper_poll_fini(drm_dev); |
| 552 | 552 | drm_mode_config_cleanup(drm_dev); |
| 553 | 553 | drm_dev_put(drm_dev); |
| 554 | −fail: | |
| 554 | +fail_dev: | |
| 555 | 555 | kfree(drm_info); |
| 556 | + front_info->drm_info = NULL; | |
| 557 | +fail: | |
| 556 | 558 | return ret; |
| 557 | 559 | } |
| 558 | 560 | |
| @@ -16,7 +16,6 @@ · 15 unmodified lines | ||
| 16 | 16 | struct drm_connector; |
| 17 | 17 | struct xen_drm_front_drm_info; |
| 18 | 18 | |
| 19 | −struct xen_drm_front_drm_info; | |
| 20 | 19 | |
| 21 | 20 | int xen_drm_front_conn_init(struct xen_drm_front_drm_info *drm_info, |
| 22 | 21 | struct drm_connector *connector); |
| @@ -705,8 +705,9 @@ void host1x_driver_unregister(struct host1x_driver *driver) · 704 unmodified lines | ||
| 705 | 705 | EXPORT_SYMBOL(host1x_driver_unregister); |
| 706 | 706 | |
| 707 | 707 | /** |
| 708 | − * host1x_client_register() - register a host1x client | |
| 708 | + * __host1x_client_register() - register a host1x client | |
| 709 | 709 | * @client: host1x client |
| 710 | + * @key: lock class key for the client-specific mutex | |
| 710 | 711 | * |
| 711 | 712 | * Registers a host1x client with each host1x controller instance. Note that |
| 712 | 713 | * each client will only match their parent host1x controller and will only be |
| @@ -715,13 +716,14 @@ EXPORT_SYMBOL(host1x_driver_unregister); · 2 unmodified lines | ||
| 715 | 716 | * device and call host1x_device_init(), which will in turn call each client's |
| 716 | 717 | * &host1x_client_ops.init implementation. |
| 717 | 718 | */ |
| 718 | −int host1x_client_register(struct host1x_client *client) | |
| 719 | +int __host1x_client_register(struct host1x_client *client, | |
| 720 | + struct lock_class_key *key) | |
| 719 | 721 | { |
| 720 | 722 | struct host1x *host1x; |
| 721 | 723 | int err; |
| 722 | 724 | |
| 723 | 725 | INIT_LIST_HEAD(&client->list); |
| 724 | − mutex_init(&client->lock); | |
| 726 | + __mutex_init(&client->lock, "host1x client lock", key); | |
| 725 | 727 | client->usecount = 0; |
| 726 | 728 | |
| 727 | 729 | mutex_lock(&devices_lock); |
| @@ -742,7 +744,7 @@ int host1x_client_register(struct host1x_client *client) · 14 unmodified lines | ||
| 742 | 744 | |
| 743 | 745 | return 0; |
| 744 | 746 | } |
| 745 | −EXPORT_SYMBOL(host1x_client_register); | |
| 747 | +EXPORT_SYMBOL(__host1x_client_register); | |
| 746 | 748 | |
| 747 | 749 | /** |
| 748 | 750 | * host1x_client_unregister() - unregister a host1x client |
| @@ -10,6 +10,7 @@ · 9 unmodified lines | ||
| 10 | 10 | #include <linux/bitops.h> |
| 11 | 11 | #include <linux/delay.h> |
| 12 | 12 | #include <linux/dma-mapping.h> |
| 13 | +#include <linux/dmi.h> | |
| 13 | 14 | #include <linux/interrupt.h> |
| 14 | 15 | #include <linux/io-64-nonatomic-lo-hi.h> |
| 15 | 16 | #include <linux/module.h> |
| @@ -22,9 +23,13 @@ · 6 unmodified lines | ||
| 22 | 23 | |
| 23 | 24 | #define ACEL_EN BIT(0) |
| 24 | 25 | #define GYRO_EN BIT(1) |
| 25 | −#define MAGNO_EN BIT(2) | |
| 26 | +#define MAGNO_EN BIT(2) | |
| 26 | 27 | #define ALS_EN BIT(19) |
| 27 | 28 | |
| 29 | +static int sensor_mask_override = -1; | |
| 30 | +module_param_named(sensor_mask, sensor_mask_override, int, 0444); | |
| 31 | +MODULE_PARM_DESC(sensor_mask, "override the detected sensors mask"); | |
| 32 | + | |
| 28 | 33 | void amd_start_sensor(struct amd_mp2_dev *privdata, struct amd_mp2_sensor_info info) |
| 29 | 34 | { |
| 30 | 35 | union sfh_cmd_param cmd_param; |
| @@ -73,12 +78,41 @@ void amd_stop_all_sensors(struct amd_mp2_dev *privdata) · 42 unmodified lines | ||
| 73 | 78 | writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0); |
| 74 | 79 | } |
| 75 | 80 | |
| 81 | +static const struct dmi_system_id dmi_sensor_mask_overrides[] = { | |
| 82 | + { | |
| 83 | + .matches = { | |
| 84 | + DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY x360 Convertible 13-ag0xxx"), | |
| 85 | + }, | |
| 86 | + .driver_data = (void *)(ACEL_EN | MAGNO_EN), | |
| 87 | + }, | |
| 88 | + { | |
| 89 | + .matches = { | |
| 90 | + DMI_MATCH(DMI_PRODUCT_NAME, "HP ENVY x360 Convertible 15-cp0xxx"), | |
| 91 | + }, | |
| 92 | + .driver_data = (void *)(ACEL_EN | MAGNO_EN), | |
| 93 | + }, | |
| 94 | + { } | |
| 95 | +}; | |
| 96 | + | |
| 76 | 97 | int amd_mp2_get_sensor_num(struct amd_mp2_dev *privdata, u8 *sensor_id) |
| 77 | 98 | { |
| 78 | 99 | int activestatus, num_of_sensors = 0; |
| 100 | + const struct dmi_system_id *dmi_id; | |
| 101 | + u32 activecontrolstatus; | |
| 102 | + | |
| 103 | + if (sensor_mask_override == -1) { | |
| 104 | + dmi_id = dmi_first_match(dmi_sensor_mask_overrides); | |
| 105 | + if (dmi_id) | |
| 106 | + sensor_mask_override = (long)dmi_id->driver_data; | |
| 107 | + } | |
| 108 | + | |
| 109 | + if (sensor_mask_override >= 0) { | |
| 110 | + activestatus = sensor_mask_override; | |
| 111 | + } else { | |
| 112 | + activecontrolstatus = readl(privdata->mmio + AMD_P2C_MSG3); | |
| 113 | + activestatus = activecontrolstatus >> 4; | |
| 114 | + } | |
| 79 | 115 | |
| 80 | − privdata->activecontrolstatus = readl(privdata->mmio + AMD_P2C_MSG3); | |
| 81 | − activestatus = privdata->activecontrolstatus >> 4; | |
| 82 | 116 | if (ACEL_EN & activestatus) |
| 83 | 117 | sensor_id[num_of_sensors++] = accel_idx; |
| 84 | 118 | |
| @@ -61,7 +61,6 @@ struct amd_mp2_dev { · 60 unmodified lines | ||
| 61 | 61 | struct pci_dev *pdev; |
| 62 | 62 | struct amdtp_cl_data *cl_data; |
| 63 | 63 | void __iomem *mmio; |
| 64 | − u32 activecontrolstatus; | |
| 65 | 64 | }; |
| 66 | 65 | |
| 67 | 66 | struct amd_mp2_sensor_info { |
| @@ -761,6 +761,7 @@ static int alps_input_configured(struct hid_device *hdev, struct hid_input *hi) · 760 unmodified lines | ||
| 761 | 761 | |
| 762 | 762 | if (input_register_device(data->input2)) { |
| 763 | 763 | input_free_device(input2); |
| 764 | + ret = -ENOENT; | |
| 764 | 765 | goto exit; |
| 765 | 766 | } |
| 766 | 767 | } |
| @@ -1221,6 +1221,9 @@ static const struct hid_device_id asus_devices[] = { · 1220 unmodified lines | ||
| 1221 | 1221 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, |
| 1222 | 1222 | USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD), |
| 1223 | 1223 | QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, |
| 1224 | + { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, | |
| 1225 | + USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2), | |
| 1226 | + QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD }, | |
| 1224 | 1227 | { HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK, |
| 1225 | 1228 | USB_DEVICE_ID_ASUSTEK_T100TA_KEYBOARD), |
| 1226 | 1229 | QUIRK_T100_KEYBOARD | QUIRK_NO_CONSUMER_USAGES }, |
| @@ -161,6 +161,7 @@ struct cp2112_device { · 160 unmodified lines | ||
| 161 | 161 | atomic_t read_avail; |
| 162 | 162 | atomic_t xfer_avail; |
| 163 | 163 | struct gpio_chip gc; |
| 164 | + struct irq_chip irq; | |
| 164 | 165 | u8 *in_out_buffer; |
| 165 | 166 | struct mutex lock; |
| 166 | 167 | |
| @@ -1175,16 +1176,6 @@ static int cp2112_gpio_irq_type(struct irq_data *d, unsigned int type) · 1008 unmodified lines | ||
| 1175 | 1176 | return 0; |
| 1176 | 1177 | } |
| 1177 | 1178 | |
| 1178 | −static struct irq_chip cp2112_gpio_irqchip = { | |
| 1179 | − .name = "cp2112-gpio", | |
| 1180 | − .irq_startup = cp2112_gpio_irq_startup, | |
| 1181 | − .irq_shutdown = cp2112_gpio_irq_shutdown, | |
| 1182 | − .irq_ack = cp2112_gpio_irq_ack, | |
| 1183 | − .irq_mask = cp2112_gpio_irq_mask, | |
| 1184 | − .irq_unmask = cp2112_gpio_irq_unmask, | |
| 1185 | − .irq_set_type = cp2112_gpio_irq_type, | |
| 1186 | −}; | |
| 1187 | − | |
| 1188 | 1179 | static int __maybe_unused cp2112_allocate_irq(struct cp2112_device *dev, |
| 1189 | 1180 | int pin) |
| 1190 | 1181 | { |
| @@ -1339,8 +1330,17 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id) · 148 unmodified lines | ||
| 1339 | 1330 | dev->gc.can_sleep = 1; |
| 1340 | 1331 | dev->gc.parent = &hdev->dev; |
| 1341 | 1332 | |
| 1333 | + dev->irq.name = "cp2112-gpio"; | |
| 1334 | + dev->irq.irq_startup = cp2112_gpio_irq_startup; | |
| 1335 | + dev->irq.irq_shutdown = cp2112_gpio_irq_shutdown; | |
| 1336 | + dev->irq.irq_ack = cp2112_gpio_irq_ack; | |
| 1337 | + dev->irq.irq_mask = cp2112_gpio_irq_mask; | |
| 1338 | + dev->irq.irq_unmask = cp2112_gpio_irq_unmask; | |
| 1339 | + dev->irq.irq_set_type = cp2112_gpio_irq_type; | |
| 1340 | + dev->irq.flags = IRQCHIP_MASK_ON_SUSPEND; | |
| 1341 | + | |
| 1342 | 1342 | girq = &dev->gc.irq; |
| 1343 | − girq->chip = &cp2112_gpio_irqchip; | |
| 1343 | + girq->chip = &dev->irq; | |
| 1344 | 1344 | /* The event comes from the outside so no parent handler */ |
| 1345 | 1345 | girq->parent_handler = NULL; |
| 1346 | 1346 | girq->num_parents = 0; |
| @@ -573,6 +573,8 @@ static void hammer_remove(struct hid_device *hdev) · 572 unmodified lines | ||
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | static const struct hid_device_id hammer_devices[] = { |
| 576 | + { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, | |
| 577 | + USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_DON) }, | |
| 576 | 578 | { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, |
| 577 | 579 | USB_VENDOR_ID_GOOGLE, USB_DEVICE_ID_GOOGLE_HAMMER) }, |
| 578 | 580 | { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, |
| @@ -194,6 +194,7 @@ · 193 unmodified lines | ||
| 194 | 194 | #define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD2 0x1837 |
| 195 | 195 | #define USB_DEVICE_ID_ASUSTEK_ROG_KEYBOARD3 0x1822 |
| 196 | 196 | #define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD 0x1866 |
| 197 | +#define USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2 0x19b6 | |
| 197 | 198 | #define USB_DEVICE_ID_ASUSTEK_FX503VD_KEYBOARD 0x1869 |
| 198 | 199 | |
| 199 | 200 | #define USB_VENDOR_ID_ATEN 0x0557 |
| @@ -493,6 +494,7 @@ · 293 unmodified lines | ||
| 493 | 494 | #define USB_DEVICE_ID_GOOGLE_MASTERBALL 0x503c |
| 494 | 495 | #define USB_DEVICE_ID_GOOGLE_MAGNEMITE 0x503d |
| 495 | 496 | #define USB_DEVICE_ID_GOOGLE_MOONBALL 0x5044 |
| 497 | +#define USB_DEVICE_ID_GOOGLE_DON 0x5050 | |
| 496 | 498 | |
| 497 | 499 | #define USB_VENDOR_ID_GOTOP 0x08f2 |
| 498 | 500 | #define USB_DEVICE_ID_SUPER_Q2 0x007f |
| @@ -2533,7 +2533,7 @@ static void wacom_wac_finger_slot(struct wacom_wac *wacom_wac, · 2532 unmodified lines | ||
| 2533 | 2533 | !wacom_wac->shared->is_touch_on) { |
| 2534 | 2534 | if (!wacom_wac->shared->touch_down) |
| 2535 | 2535 | return; |
| 2536 | − prox = 0; | |
| 2536 | + prox = false; | |
| 2537 | 2537 | } |
| 2538 | 2538 | |
| 2539 | 2539 | wacom_wac->hid_data.num_received++; |
| @@ -3574,8 +3574,6 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev, · 1034 unmodified lines | ||
| 3574 | 3574 | { |
| 3575 | 3575 | struct wacom_features *features = &wacom_wac->features; |
| 3576 | 3576 | |
| 3577 | − input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | |
| 3578 | − | |
| 3579 | 3577 | if (!(features->device_type & WACOM_DEVICETYPE_PEN)) |
| 3580 | 3578 | return -ENODEV; |
| 3581 | 3579 | |
| @@ -3590,6 +3588,7 @@ int wacom_setup_pen_input_capabilities(struct input_dev *input_dev, · 8 unmodified lines | ||
| 3590 | 3588 | return 0; |
| 3591 | 3589 | } |
| 3592 | 3590 | |
| 3591 | + input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | |
| 3593 | 3592 | __set_bit(BTN_TOUCH, input_dev->keybit); |
| 3594 | 3593 | __set_bit(ABS_MISC, input_dev->absbit); |
| 3595 | 3594 | |
| @@ -3742,8 +3741,6 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev, · 146 unmodified lines | ||
| 3742 | 3741 | { |
| 3743 | 3742 | struct wacom_features *features = &wacom_wac->features; |
| 3744 | 3743 | |
| 3745 | − input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | |
| 3746 | − | |
| 3747 | 3744 | if (!(features->device_type & WACOM_DEVICETYPE_TOUCH)) |
| 3748 | 3745 | return -ENODEV; |
| 3749 | 3746 | |
| @@ -3756,6 +3753,7 @@ int wacom_setup_touch_input_capabilities(struct input_dev *input_dev, · 6 unmodified lines | ||
| 3756 | 3753 | /* setup has already been done */ |
| 3757 | 3754 | return 0; |
| 3758 | 3755 | |
| 3756 | + input_dev->evbit[0] |= BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); | |
| 3759 | 3757 | __set_bit(BTN_TOUCH, input_dev->keybit); |
| 3760 | 3758 | |
| 3761 | 3759 | if (features->touch_max == 1) { |
| @@ -129,6 +129,7 @@ static int i2c_dw_set_timings_master(struct dw_i2c_dev *dev) · 128 unmodified lines | ||
| 129 | 129 | if ((comp_param1 & DW_IC_COMP_PARAM_1_SPEED_MODE_MASK) |
| 130 | 130 | != DW_IC_COMP_PARAM_1_SPEED_MODE_HIGH) { |
| 131 | 131 | dev_err(dev->dev, "High Speed not supported!\n"); |
| 132 | + t->bus_freq_hz = I2C_MAX_FAST_MODE_FREQ; | |
| 132 | 133 | dev->master_cfg &= ~DW_IC_CON_SPEED_MASK; |
| 133 | 134 | dev->master_cfg |= DW_IC_CON_SPEED_FAST; |
| 134 | 135 | dev->hs_hcnt = 0; |
| @@ -1,5 +1,5 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0-only |
| 2 | −/** | |
| 2 | +/* | |
| 3 | 3 | * i2c-exynos5.c - Samsung Exynos5 I2C Controller Driver |
| 4 | 4 | * |
| 5 | 5 | * Copyright (C) 2013 Samsung Electronics Co., Ltd. |
| @@ -1,7 +1,7 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | 2 | /* |
| 3 | 3 | * Copyright (c) 2014 Linaro Ltd. |
| 4 | − * Copyright (c) 2014 Hisilicon Limited. | |
| 4 | + * Copyright (c) 2014 HiSilicon Limited. | |
| 5 | 5 | * |
| 6 | 6 | * Now only support 7 bit address. |
| 7 | 7 | */ |
| @@ -525,8 +525,8 @@ static irqreturn_t jz4780_i2c_irq(int irqno, void *dev_id) · 524 unmodified lines | ||
| 525 | 525 | i2c_sta = jz4780_i2c_readw(i2c, JZ4780_I2C_STA); |
| 526 | 526 | data = *i2c->wbuf; |
| 527 | 527 | data &= ~JZ4780_I2C_DC_READ; |
| 528 | − if ((!i2c->stop_hold) && (i2c->cdata->version >= | |
| 529 | − ID_X1000)) | |
| 528 | + if ((i2c->wt_len == 1) && (!i2c->stop_hold) && | |
| 529 | + (i2c->cdata->version >= ID_X1000)) | |
| 530 | 530 | data |= X1000_I2C_DC_STOP; |
| 531 | 531 | jz4780_i2c_writew(i2c, JZ4780_I2C_DC, data); |
| 532 | 532 | i2c->wbuf++; |
| @@ -221,6 +221,10 @@ mv64xxx_i2c_hw_init(struct mv64xxx_i2c_data *drv_data) · 220 unmodified lines | ||
| 221 | 221 | writel(0, drv_data->reg_base + drv_data->reg_offsets.ext_addr); |
| 222 | 222 | writel(MV64XXX_I2C_REG_CONTROL_TWSIEN | MV64XXX_I2C_REG_CONTROL_STOP, |
| 223 | 223 | drv_data->reg_base + drv_data->reg_offsets.control); |
| 224 | + | |
| 225 | + if (drv_data->errata_delay) | |
| 226 | + udelay(5); | |
| 227 | + | |
| 224 | 228 | drv_data->state = MV64XXX_I2C_STATE_IDLE; |
| 225 | 229 | } |
| 226 | 230 | |
| @@ -534,7 +534,7 @@ static void stm32f4_i2c_handle_rx_addr(struct stm32f4_i2c_dev *i2c_dev) · 533 unmodified lines | ||
| 534 | 534 | default: |
| 535 | 535 | /* |
| 536 | 536 | * N-byte reception: |
| 537 | − * Enable ACK, reset POS (ACK postion) and clear ADDR flag. | |
| 537 | + * Enable ACK, reset POS (ACK position) and clear ADDR flag. | |
| 538 | 538 | * In that way, ACK will be sent as soon as the current byte |
| 539 | 539 | * will be received in the shift register |
| 540 | 540 | */ |
| @@ -378,7 +378,7 @@ static int i2c_gpio_init_recovery(struct i2c_adapter *adap) · 377 unmodified lines | ||
| 378 | 378 | static int i2c_init_recovery(struct i2c_adapter *adap) |
| 379 | 379 | { |
| 380 | 380 | struct i2c_bus_recovery_info *bri = adap->bus_recovery_info; |
| 381 | − char *err_str; | |
| 381 | + char *err_str, *err_level = KERN_ERR; | |
| 382 | 382 | |
| 383 | 383 | if (!bri) |
| 384 | 384 | return 0; |
| @@ -387,7 +387,8 @@ static int i2c_init_recovery(struct i2c_adapter *adap) · 2 unmodified lines | ||
| 387 | 387 | return -EPROBE_DEFER; |
| 388 | 388 | |
| 389 | 389 | if (!bri->recover_bus) { |
| 390 | − err_str = "no recover_bus() found"; | |
| 390 | + err_str = "no suitable method provided"; | |
| 391 | + err_level = KERN_DEBUG; | |
| 391 | 392 | goto err; |
| 392 | 393 | } |
| 393 | 394 | |
| @@ -414,7 +415,7 @@ static int i2c_init_recovery(struct i2c_adapter *adap) · 20 unmodified lines | ||
| 414 | 415 | |
| 415 | 416 | return 0; |
| 416 | 417 | err: |
| 417 | − dev_err(&adap->dev, "Not using recovery: %s\n", err_str); | |
| 418 | + dev_printk(err_level, &adap->dev, "Not using recovery: %s\n", err_str); | |
| 418 | 419 | adap->bus_recovery_info = NULL; |
| 419 | 420 | |
| 420 | 421 | return -EINVAL; |
| @@ -266,6 +266,8 @@ config ADI_AXI_ADC · 265 unmodified lines | ||
| 266 | 266 | select IIO_BUFFER |
| 267 | 267 | select IIO_BUFFER_HW_CONSUMER |
| 268 | 268 | select IIO_BUFFER_DMAENGINE |
| 269 | + depends on HAS_IOMEM | |
| 270 | + depends on OF | |
| 269 | 271 | help |
| 270 | 272 | Say yes here to build support for Analog Devices Generic |
| 271 | 273 | AXI ADC IP core. The IP core is used for interfacing with |
| @@ -923,6 +925,7 @@ config STM32_ADC_CORE · 651 unmodified lines | ||
| 923 | 925 | depends on ARCH_STM32 || COMPILE_TEST |
| 924 | 926 | depends on OF |
| 925 | 927 | depends on REGULATOR |
| 928 | + depends on HAS_IOMEM | |
| 926 | 929 | select IIO_BUFFER |
| 927 | 930 | select MFD_STM32_TIMERS |
| 928 | 931 | select IIO_STM32_TIMER_TRIGGER |
| @@ -918,7 +918,7 @@ static int ab8500_gpadc_read_raw(struct iio_dev *indio_dev, · 917 unmodified lines | ||
| 918 | 918 | return processed; |
| 919 | 919 | |
| 920 | 920 | /* Return millivolt or milliamps or millicentigrades */ |
| 921 | − *val = processed * 1000; | |
| 921 | + *val = processed; | |
| 922 | 922 | return IIO_VAL_INT; |
| 923 | 923 | } |
| 924 | 924 | |
| @@ -91,7 +91,7 @@ static int ad7949_spi_read_channel(struct ad7949_adc_chip *ad7949_adc, int *val, · 90 unmodified lines | ||
| 91 | 91 | int ret; |
| 92 | 92 | int i; |
| 93 | 93 | int bits_per_word = ad7949_adc->resolution; |
| 94 | − int mask = GENMASK(ad7949_adc->resolution, 0); | |
| 94 | + int mask = GENMASK(ad7949_adc->resolution - 1, 0); | |
| 95 | 95 | struct spi_message msg; |
| 96 | 96 | struct spi_transfer tx[] = { |
| 97 | 97 | { |
| @@ -597,7 +597,7 @@ static const struct vadc_channels vadc_chans[] = { · 596 unmodified lines | ||
| 597 | 597 | VADC_CHAN_NO_SCALE(P_MUX16_1_3, 1) |
| 598 | 598 | |
| 599 | 599 | VADC_CHAN_NO_SCALE(LR_MUX1_BAT_THERM, 0) |
| 600 | − VADC_CHAN_NO_SCALE(LR_MUX2_BAT_ID, 0) | |
| 600 | + VADC_CHAN_VOLT(LR_MUX2_BAT_ID, 0, SCALE_DEFAULT) | |
| 601 | 601 | VADC_CHAN_NO_SCALE(LR_MUX3_XO_THERM, 0) |
| 602 | 602 | VADC_CHAN_NO_SCALE(LR_MUX4_AMUX_THM1, 0) |
| 603 | 603 | VADC_CHAN_NO_SCALE(LR_MUX5_AMUX_THM2, 0) |
| @@ -551,6 +551,8 @@ static irqreturn_t mpu3050_trigger_handler(int irq, void *p) · 550 unmodified lines | ||
| 551 | 551 | MPU3050_FIFO_R, |
| 552 | 552 | &fifo_values[offset], |
| 553 | 553 | toread); |
| 554 | + if (ret) | |
| 555 | + goto out_trigger_unlock; | |
| 554 | 556 | |
| 555 | 557 | dev_dbg(mpu3050->dev, |
| 556 | 558 | "%04x %04x %04x %04x %04x\n", |
| @@ -15,7 +15,10 @@ · 14 unmodified lines | ||
| 15 | 15 | struct hid_humidity_state { |
| 16 | 16 | struct hid_sensor_common common_attributes; |
| 17 | 17 | struct hid_sensor_hub_attribute_info humidity_attr; |
| 18 | − s32 humidity_data; | |
| 18 | + struct { | |
| 19 | + s32 humidity_data; | |
| 20 | + u64 timestamp __aligned(8); | |
| 21 | + } scan; | |
| 19 | 22 | int scale_pre_decml; |
| 20 | 23 | int scale_post_decml; |
| 21 | 24 | int scale_precision; |
| @@ -125,9 +128,8 @@ static int humidity_proc_event(struct hid_sensor_hub_device *hsdev, · 103 unmodified lines | ||
| 125 | 128 | struct hid_humidity_state *humid_st = iio_priv(indio_dev); |
| 126 | 129 | |
| 127 | 130 | if (atomic_read(&humid_st->common_attributes.data_ready)) |
| 128 | − iio_push_to_buffers_with_timestamp(indio_dev, | |
| 129 | − &humid_st->humidity_data, | |
| 130 | − iio_get_time_ns(indio_dev)); | |
| 131 | + iio_push_to_buffers_with_timestamp(indio_dev, &humid_st->scan, | |
| 132 | + iio_get_time_ns(indio_dev)); | |
| 131 | 133 | |
| 132 | 134 | return 0; |
| 133 | 135 | } |
| @@ -142,7 +144,7 @@ static int humidity_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines | ||
| 142 | 144 | |
| 143 | 145 | switch (usage_id) { |
| 144 | 146 | case HID_USAGE_SENSOR_ATMOSPHERIC_HUMIDITY: |
| 145 | − humid_st->humidity_data = *(s32 *)raw_data; | |
| 147 | + humid_st->scan.humidity_data = *(s32 *)raw_data; | |
| 146 | 148 | |
| 147 | 149 | return 0; |
| 148 | 150 | default: |
| @@ -462,8 +462,7 @@ static int adis16400_initial_setup(struct iio_dev *indio_dev) · 461 unmodified lines | ||
| 462 | 462 | if (ret) |
| 463 | 463 | goto err_ret; |
| 464 | 464 | |
| 465 | − ret = sscanf(indio_dev->name, "adis%u\n", &device_id); | |
| 466 | − if (ret != 1) { | |
| 465 | + if (sscanf(indio_dev->name, "adis%u\n", &device_id) != 1) { | |
| 467 | 466 | ret = -EINVAL; |
| 468 | 467 | goto err_ret; |
| 469 | 468 | } |
| @@ -23,6 +23,9 @@ struct prox_state { · 22 unmodified lines | ||
| 23 | 23 | struct hid_sensor_common common_attributes; |
| 24 | 24 | struct hid_sensor_hub_attribute_info prox_attr; |
| 25 | 25 | u32 human_presence; |
| 26 | + int scale_pre_decml; | |
| 27 | + int scale_post_decml; | |
| 28 | + int scale_precision; | |
| 26 | 29 | }; |
| 27 | 30 | |
| 28 | 31 | /* Channel definitions */ |
| @@ -93,8 +96,9 @@ static int prox_read_raw(struct iio_dev *indio_dev, · 64 unmodified lines | ||
| 93 | 96 | ret_type = IIO_VAL_INT; |
| 94 | 97 | break; |
| 95 | 98 | case IIO_CHAN_INFO_SCALE: |
| 96 | − *val = prox_state->prox_attr.units; | |
| 97 | − ret_type = IIO_VAL_INT; | |
| 99 | + *val = prox_state->scale_pre_decml; | |
| 100 | + *val2 = prox_state->scale_post_decml; | |
| 101 | + ret_type = prox_state->scale_precision; | |
| 98 | 102 | break; |
| 99 | 103 | case IIO_CHAN_INFO_OFFSET: |
| 100 | 104 | *val = hid_sensor_convert_exponent( |
| @@ -234,6 +238,11 @@ static int prox_parse_report(struct platform_device *pdev, · 133 unmodified lines | ||
| 234 | 238 | HID_USAGE_SENSOR_HUMAN_PRESENCE, |
| 235 | 239 | &st->common_attributes.sensitivity); |
| 236 | 240 | |
| 241 | + st->scale_precision = hid_sensor_format_scale( | |
| 242 | + hsdev->usage, | |
| 243 | + &st->prox_attr, | |
| 244 | + &st->scale_pre_decml, &st->scale_post_decml); | |
| 245 | + | |
| 237 | 246 | return ret; |
| 238 | 247 | } |
| 239 | 248 | |
| @@ -15,7 +15,10 @@ · 14 unmodified lines | ||
| 15 | 15 | struct temperature_state { |
| 16 | 16 | struct hid_sensor_common common_attributes; |
| 17 | 17 | struct hid_sensor_hub_attribute_info temperature_attr; |
| 18 | − s32 temperature_data; | |
| 18 | + struct { | |
| 19 | + s32 temperature_data; | |
| 20 | + u64 timestamp __aligned(8); | |
| 21 | + } scan; | |
| 19 | 22 | int scale_pre_decml; |
| 20 | 23 | int scale_post_decml; |
| 21 | 24 | int scale_precision; |
| @@ -32,7 +35,7 @@ static const struct iio_chan_spec temperature_channels[] = { · 10 unmodified lines | ||
| 32 | 35 | BIT(IIO_CHAN_INFO_SAMP_FREQ) | |
| 33 | 36 | BIT(IIO_CHAN_INFO_HYSTERESIS), |
| 34 | 37 | }, |
| 35 | − IIO_CHAN_SOFT_TIMESTAMP(3), | |
| 38 | + IIO_CHAN_SOFT_TIMESTAMP(1), | |
| 36 | 39 | }; |
| 37 | 40 | |
| 38 | 41 | /* Adjust channel real bits based on report descriptor */ |
| @@ -123,9 +126,8 @@ static int temperature_proc_event(struct hid_sensor_hub_device *hsdev, · 84 unmodified lines | ||
| 123 | 126 | struct temperature_state *temp_st = iio_priv(indio_dev); |
| 124 | 127 | |
| 125 | 128 | if (atomic_read(&temp_st->common_attributes.data_ready)) |
| 126 | − iio_push_to_buffers_with_timestamp(indio_dev, | |
| 127 | − &temp_st->temperature_data, | |
| 128 | − iio_get_time_ns(indio_dev)); | |
| 129 | + iio_push_to_buffers_with_timestamp(indio_dev, &temp_st->scan, | |
| 130 | + iio_get_time_ns(indio_dev)); | |
| 129 | 131 | |
| 130 | 132 | return 0; |
| 131 | 133 | } |
| @@ -140,7 +142,7 @@ static int temperature_capture_sample(struct hid_sensor_hub_device *hsdev, · 8 unmodified lines | ||
| 140 | 142 | |
| 141 | 143 | switch (usage_id) { |
| 142 | 144 | case HID_USAGE_SENSOR_DATA_ENVIRONMENTAL_TEMPERATURE: |
| 143 | − temp_st->temperature_data = *(s32 *)raw_data; | |
| 145 | + temp_st->scan.temperature_data = *(s32 *)raw_data; | |
| 144 | 146 | return 0; |
| 145 | 147 | default: |
| 146 | 148 | return -EINVAL; |
| @@ -76,7 +76,9 @@ static struct workqueue_struct *addr_wq; · 75 unmodified lines | ||
| 76 | 76 | |
| 77 | 77 | static const struct nla_policy ib_nl_addr_policy[LS_NLA_TYPE_MAX] = { |
| 78 | 78 | [LS_NLA_TYPE_DGID] = {.type = NLA_BINARY, |
| 79 | − .len = sizeof(struct rdma_nla_ls_gid)}, | |
| 79 | + .len = sizeof(struct rdma_nla_ls_gid), | |
| 80 | + .validation_type = NLA_VALIDATE_MIN, | |
| 81 | + .min = sizeof(struct rdma_nla_ls_gid)}, | |
| 80 | 82 | }; |
| 81 | 83 | |
| 82 | 84 | static inline bool ib_nl_is_good_ip_resp(const struct nlmsghdr *nlh) |
| @@ -3610,13 +3610,14 @@ int c4iw_destroy_listen(struct iw_cm_id *cm_id) · 3609 unmodified lines | ||
| 3610 | 3610 | ep->com.local_addr.ss_family == AF_INET) { |
| 3611 | 3611 | err = cxgb4_remove_server_filter( |
| 3612 | 3612 | ep->com.dev->rdev.lldi.ports[0], ep->stid, |
| 3613 | − ep->com.dev->rdev.lldi.rxq_ids[0], 0); | |
| 3613 | + ep->com.dev->rdev.lldi.rxq_ids[0], false); | |
| 3614 | 3614 | } else { |
| 3615 | 3615 | struct sockaddr_in6 *sin6; |
| 3616 | 3616 | c4iw_init_wr_wait(ep->com.wr_waitp); |
| 3617 | 3617 | err = cxgb4_remove_server( |
| 3618 | 3618 | ep->com.dev->rdev.lldi.ports[0], ep->stid, |
| 3619 | − ep->com.dev->rdev.lldi.rxq_ids[0], 0); | |
| 3619 | + ep->com.dev->rdev.lldi.rxq_ids[0], | |
| 3620 | + ep->com.local_addr.ss_family == AF_INET6); | |
| 3620 | 3621 | if (err) |
| 3621 | 3622 | goto done; |
| 3622 | 3623 | err = c4iw_wait_for_reply(&ep->com.dev->rdev, ep->com.wr_waitp, |
| @@ -632,22 +632,11 @@ static void _dev_comp_vect_cpu_mask_clean_up(struct hfi1_devdata *dd, · 631 unmodified lines | ||
| 632 | 632 | */ |
| 633 | 633 | int hfi1_dev_affinity_init(struct hfi1_devdata *dd) |
| 634 | 634 | { |
| 635 | − int node = pcibus_to_node(dd->pcidev->bus); | |
| 636 | 635 | struct hfi1_affinity_node *entry; |
| 637 | 636 | const struct cpumask *local_mask; |
| 638 | 637 | int curr_cpu, possible, i, ret; |
| 639 | 638 | bool new_entry = false; |
| 640 | 639 | |
| 641 | − /* | |
| 642 | − * If the BIOS does not have the NUMA node information set, select | |
| 643 | − * NUMA 0 so we get consistent performance. | |
| 644 | − */ | |
| 645 | − if (node < 0) { | |
| 646 | − dd_dev_err(dd, "Invalid PCI NUMA node. Performance may be affected\n"); | |
| 647 | − node = 0; | |
| 648 | − } | |
| 649 | − dd->node = node; | |
| 650 | − | |
| 651 | 640 | local_mask = cpumask_of_node(dd->node); |
| 652 | 641 | if (cpumask_first(local_mask) >= nr_cpu_ids) |
| 653 | 642 | local_mask = topology_core_cpumask(0); |
| @@ -660,7 +649,7 @@ int hfi1_dev_affinity_init(struct hfi1_devdata *dd) · 6 unmodified lines | ||
| 660 | 649 | * create an entry in the global affinity structure and initialize it. |
| 661 | 650 | */ |
| 662 | 651 | if (!entry) { |
| 663 | − entry = node_affinity_allocate(node); | |
| 652 | + entry = node_affinity_allocate(dd->node); | |
| 664 | 653 | if (!entry) { |
| 665 | 654 | dd_dev_err(dd, |
| 666 | 655 | "Unable to allocate global affinity node\n"); |
| @@ -751,6 +740,7 @@ int hfi1_dev_affinity_init(struct hfi1_devdata *dd) · 84 unmodified lines | ||
| 751 | 740 | if (new_entry) |
| 752 | 741 | node_affinity_add_tail(entry); |
| 753 | 742 | |
| 743 | + dd->affinity_entry = entry; | |
| 754 | 744 | mutex_unlock(&node_affinity.lock); |
| 755 | 745 | |
| 756 | 746 | return 0; |
| @@ -766,10 +756,9 @@ void hfi1_dev_affinity_clean_up(struct hfi1_devdata *dd) · 9 unmodified lines | ||
| 766 | 756 | { |
| 767 | 757 | struct hfi1_affinity_node *entry; |
| 768 | 758 | |
| 769 | − if (dd->node < 0) | |
| 770 | − return; | |
| 771 | − | |
| 772 | 759 | mutex_lock(&node_affinity.lock); |
| 760 | + if (!dd->affinity_entry) | |
| 761 | + goto unlock; | |
| 773 | 762 | entry = node_affinity_lookup(dd->node); |
| 774 | 763 | if (!entry) |
| 775 | 764 | goto unlock; |
| @@ -780,8 +769,8 @@ void hfi1_dev_affinity_clean_up(struct hfi1_devdata *dd) · 4 unmodified lines | ||
| 780 | 769 | */ |
| 781 | 770 | _dev_comp_vect_cpu_mask_clean_up(dd, entry); |
| 782 | 771 | unlock: |
| 772 | + dd->affinity_entry = NULL; | |
| 783 | 773 | mutex_unlock(&node_affinity.lock); |
| 784 | − dd->node = NUMA_NO_NODE; | |
| 785 | 774 | } |
| 786 | 775 | |
| 787 | 776 | /* |
| @@ -1409,6 +1409,7 @@ struct hfi1_devdata { · 1408 unmodified lines | ||
| 1409 | 1409 | spinlock_t irq_src_lock; |
| 1410 | 1410 | int vnic_num_vports; |
| 1411 | 1411 | struct net_device *dummy_netdev; |
| 1412 | + struct hfi1_affinity_node *affinity_entry; | |
| 1412 | 1413 | |
| 1413 | 1414 | /* Keeps track of IPoIB RSM rule users */ |
| 1414 | 1415 | atomic_t ipoib_rsm_usr_num; |
| @@ -1277,7 +1277,6 @@ static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, · 1276 unmodified lines | ||
| 1277 | 1277 | dd->pport = (struct hfi1_pportdata *)(dd + 1); |
| 1278 | 1278 | dd->pcidev = pdev; |
| 1279 | 1279 | pci_set_drvdata(pdev, dd); |
| 1280 | − dd->node = NUMA_NO_NODE; | |
| 1281 | 1280 | |
| 1282 | 1281 | ret = xa_alloc_irq(&hfi1_dev_table, &dd->unit, dd, xa_limit_32b, |
| 1283 | 1282 | GFP_KERNEL); |
| @@ -1287,6 +1286,15 @@ static struct hfi1_devdata *hfi1_alloc_devdata(struct pci_dev *pdev, · 3 unmodified lines | ||
| 1287 | 1286 | goto bail; |
| 1288 | 1287 | } |
| 1289 | 1288 | rvt_set_ibdev_name(&dd->verbs_dev.rdi, "%s_%d", class_name(), dd->unit); |
| 1289 | + /* | |
| 1290 | + * If the BIOS does not have the NUMA node information set, select | |
| 1291 | + * NUMA 0 so we get consistent performance. | |
| 1292 | + */ | |
| 1293 | + dd->node = pcibus_to_node(pdev->bus); | |
| 1294 | + if (dd->node == NUMA_NO_NODE) { | |
| 1295 | + dd_dev_err(dd, "Invalid PCI NUMA node. Performance may be affected\n"); | |
| 1296 | + dd->node = 0; | |
| 1297 | + } | |
| 1290 | 1298 | |
| 1291 | 1299 | /* |
| 1292 | 1300 | * Initialize all locks for the device. This needs to be as early as |
| @@ -173,8 +173,7 @@ u32 hfi1_num_netdev_contexts(struct hfi1_devdata *dd, u32 available_contexts, · 172 unmodified lines | ||
| 173 | 173 | return 0; |
| 174 | 174 | } |
| 175 | 175 | |
| 176 | − cpumask_and(node_cpu_mask, cpu_mask, | |
| 177 | − cpumask_of_node(pcibus_to_node(dd->pcidev->bus))); | |
| 176 | + cpumask_and(node_cpu_mask, cpu_mask, cpumask_of_node(dd->node)); | |
| 178 | 177 | |
| 179 | 178 | available_cpus = cpumask_weight(node_cpu_mask); |
| 180 | 179 | |
| @@ -1194,8 +1194,10 @@ static void hns_roce_cmq_init_regs(struct hns_roce_dev *hr_dev, bool ring_type) · 1193 unmodified lines | ||
| 1194 | 1194 | upper_32_bits(dma)); |
| 1195 | 1195 | roce_write(hr_dev, ROCEE_TX_CMQ_DEPTH_REG, |
| 1196 | 1196 | (u32)ring->desc_num >> HNS_ROCE_CMQ_DESC_NUM_S); |
| 1197 | − roce_write(hr_dev, ROCEE_TX_CMQ_HEAD_REG, 0); | |
| 1197 | + | |
| 1198 | + /* Make sure to write tail first and then head */ | |
| 1198 | 1199 | roce_write(hr_dev, ROCEE_TX_CMQ_TAIL_REG, 0); |
| 1200 | + roce_write(hr_dev, ROCEE_TX_CMQ_HEAD_REG, 0); | |
| 1199 | 1201 | } else { |
| 1200 | 1202 | roce_write(hr_dev, ROCEE_RX_CMQ_BASEADDR_L_REG, (u32)dma); |
| 1201 | 1203 | roce_write(hr_dev, ROCEE_RX_CMQ_BASEADDR_H_REG, |
| @@ -1116,7 +1116,7 @@ static void devx_obj_build_destroy_cmd(void *in, void *out, void *din, · 1115 unmodified lines | ||
| 1116 | 1116 | case MLX5_CMD_OP_CREATE_MKEY: |
| 1117 | 1117 | MLX5_SET(destroy_mkey_in, din, opcode, |
| 1118 | 1118 | MLX5_CMD_OP_DESTROY_MKEY); |
| 1119 | − MLX5_SET(destroy_mkey_in, in, mkey_index, *obj_id); | |
| 1119 | + MLX5_SET(destroy_mkey_in, din, mkey_index, *obj_id); | |
| 1120 | 1120 | break; |
| 1121 | 1121 | case MLX5_CMD_OP_CREATE_CQ: |
| 1122 | 1122 | MLX5_SET(destroy_cq_in, din, opcode, MLX5_CMD_OP_DESTROY_CQ); |
| @@ -1078,7 +1078,7 @@ static int _create_kernel_qp(struct mlx5_ib_dev *dev, · 1077 unmodified lines | ||
| 1078 | 1078 | |
| 1079 | 1079 | qpc = MLX5_ADDR_OF(create_qp_in, *in, qpc); |
| 1080 | 1080 | MLX5_SET(qpc, qpc, uar_page, uar_index); |
| 1081 | − MLX5_SET(qpc, qpc, ts_format, MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT); | |
| 1081 | + MLX5_SET(qpc, qpc, ts_format, mlx5_get_qp_default_ts(dev->mdev)); | |
| 1082 | 1082 | MLX5_SET(qpc, qpc, log_page_size, qp->buf.page_shift - MLX5_ADAPTER_PAGE_SHIFT); |
| 1083 | 1083 | |
| 1084 | 1084 | /* Set "fast registration enabled" for all kernel QPs */ |
| @@ -1188,7 +1188,8 @@ static int get_rq_ts_format(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *send_cq) · 103 unmodified lines | ||
| 1188 | 1188 | } |
| 1189 | 1189 | return MLX5_RQC_TIMESTAMP_FORMAT_FREE_RUNNING; |
| 1190 | 1190 | } |
| 1191 | − return MLX5_RQC_TIMESTAMP_FORMAT_DEFAULT; | |
| 1191 | + return fr_supported ? MLX5_RQC_TIMESTAMP_FORMAT_FREE_RUNNING : | |
| 1192 | + MLX5_RQC_TIMESTAMP_FORMAT_DEFAULT; | |
| 1192 | 1193 | } |
| 1193 | 1194 | |
| 1194 | 1195 | static int get_sq_ts_format(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *send_cq) |
| @@ -1206,7 +1207,8 @@ static int get_sq_ts_format(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *send_cq) · 11 unmodified lines | ||
| 1206 | 1207 | } |
| 1207 | 1208 | return MLX5_SQC_TIMESTAMP_FORMAT_FREE_RUNNING; |
| 1208 | 1209 | } |
| 1209 | − return MLX5_SQC_TIMESTAMP_FORMAT_DEFAULT; | |
| 1210 | + return fr_supported ? MLX5_SQC_TIMESTAMP_FORMAT_FREE_RUNNING : | |
| 1211 | + MLX5_SQC_TIMESTAMP_FORMAT_DEFAULT; | |
| 1210 | 1212 | } |
| 1211 | 1213 | |
| 1212 | 1214 | static int get_qp_ts_format(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *send_cq, |
| @@ -1217,7 +1219,8 @@ static int get_qp_ts_format(struct mlx5_ib_dev *dev, struct mlx5_ib_cq *send_cq, · 4 unmodified lines | ||
| 1217 | 1219 | MLX5_QP_TIMESTAMP_FORMAT_CAP_FREE_RUNNING || |
| 1218 | 1220 | MLX5_CAP_ROCE(dev->mdev, qp_ts_format) == |
| 1219 | 1221 | MLX5_QP_TIMESTAMP_FORMAT_CAP_FREE_RUNNING_AND_REAL_TIME; |
| 1220 | − int ts_format = MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT; | |
| 1222 | + int ts_format = fr_supported ? MLX5_QPC_TIMESTAMP_FORMAT_FREE_RUNNING : | |
| 1223 | + MLX5_QPC_TIMESTAMP_FORMAT_DEFAULT; | |
| 1221 | 1224 | |
| 1222 | 1225 | if (recv_cq && |
| 1223 | 1226 | recv_cq->create_flags & IB_UVERBS_CQ_FLAGS_TIMESTAMP_COMPLETION) |
| @@ -1930,6 +1933,7 @@ static int create_xrc_tgt_qp(struct mlx5_ib_dev *dev, struct mlx5_ib_qp *qp, · 706 unmodified lines | ||
| 1930 | 1933 | if (qp->flags & IB_QP_CREATE_MANAGED_RECV) |
| 1931 | 1934 | MLX5_SET(qpc, qpc, cd_slave_receive, 1); |
| 1932 | 1935 | |
| 1936 | + MLX5_SET(qpc, qpc, ts_format, mlx5_get_qp_default_ts(dev->mdev)); | |
| 1933 | 1937 | MLX5_SET(qpc, qpc, rq_type, MLX5_SRQ_RQ); |
| 1934 | 1938 | MLX5_SET(qpc, qpc, no_sq, 1); |
| 1935 | 1939 | MLX5_SET(qpc, qpc, cqn_rcv, to_mcq(devr->c0)->mcq.cqn); |
| @@ -4873,6 +4877,7 @@ static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd, · 2937 unmodified lines | ||
| 4873 | 4877 | struct mlx5_ib_dev *dev; |
| 4874 | 4878 | int has_net_offloads; |
| 4875 | 4879 | __be64 *rq_pas0; |
| 4880 | + int ts_format; | |
| 4876 | 4881 | void *in; |
| 4877 | 4882 | void *rqc; |
| 4878 | 4883 | void *wq; |
| @@ -4881,6 +4886,10 @@ static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd, · 2 unmodified lines | ||
| 4881 | 4886 | |
| 4882 | 4887 | dev = to_mdev(pd->device); |
| 4883 | 4888 | |
| 4889 | + ts_format = get_rq_ts_format(dev, to_mcq(init_attr->cq)); | |
| 4890 | + if (ts_format < 0) | |
| 4891 | + return ts_format; | |
| 4892 | + | |
| 4884 | 4893 | inlen = MLX5_ST_SZ_BYTES(create_rq_in) + sizeof(u64) * rwq->rq_num_pas; |
| 4885 | 4894 | in = kvzalloc(inlen, GFP_KERNEL); |
| 4886 | 4895 | if (!in) |
| @@ -4890,6 +4899,7 @@ static int create_rq(struct mlx5_ib_rwq *rwq, struct ib_pd *pd, · 3 unmodified lines | ||
| 4890 | 4899 | rqc = MLX5_ADDR_OF(create_rq_in, in, ctx); |
| 4891 | 4900 | MLX5_SET(rqc, rqc, mem_rq_type, |
| 4892 | 4901 | MLX5_RQC_MEM_RQ_TYPE_MEMORY_RQ_INLINE); |
| 4902 | + MLX5_SET(rqc, rqc, ts_format, ts_format); | |
| 4893 | 4903 | MLX5_SET(rqc, rqc, user_index, rwq->user_index); |
| 4894 | 4904 | MLX5_SET(rqc, rqc, cqn, to_mcq(init_attr->cq)->mcq.cqn); |
| 4895 | 4905 | MLX5_SET(rqc, rqc, state, MLX5_RQC_STATE_RST); |
| @@ -1244,7 +1244,8 @@ static int qedr_check_qp_attrs(struct ib_pd *ibpd, struct qedr_dev *dev, · 1243 unmodified lines | ||
| 1244 | 1244 | * TGT QP isn't associated with RQ/SQ |
| 1245 | 1245 | */ |
| 1246 | 1246 | if ((attrs->qp_type != IB_QPT_GSI) && (dev->gsi_qp_created) && |
| 1247 | − (attrs->qp_type != IB_QPT_XRC_TGT)) { | |
| 1247 | + (attrs->qp_type != IB_QPT_XRC_TGT) && | |
| 1248 | + (attrs->qp_type != IB_QPT_XRC_INI)) { | |
| 1248 | 1249 | struct qedr_cq *send_cq = get_qedr_cq(attrs->send_cq); |
| 1249 | 1250 | struct qedr_cq *recv_cq = get_qedr_cq(attrs->recv_cq); |
| 1250 | 1251 | |
| @@ -2720,8 +2720,8 @@ void rtrs_clt_close(struct rtrs_clt *clt) · 2719 unmodified lines | ||
| 2720 | 2720 | |
| 2721 | 2721 | /* Now it is safe to iterate over all paths without locks */ |
| 2722 | 2722 | list_for_each_entry_safe(sess, tmp, &clt->paths_list, s.entry) { |
| 2723 | − rtrs_clt_destroy_sess_files(sess, NULL); | |
| 2724 | 2723 | rtrs_clt_close_conns(sess, true); |
| 2724 | + rtrs_clt_destroy_sess_files(sess, NULL); | |
| 2725 | 2725 | kobject_put(&sess->kobj); |
| 2726 | 2726 | } |
| 2727 | 2727 | free_clt(clt); |
| @@ -26,7 +26,6 @@ · 25 unmodified lines | ||
| 26 | 26 | |
| 27 | 27 | MODULE_AUTHOR("Vojtech Pavlik <vojtech@ucw.cz>"); |
| 28 | 28 | MODULE_DESCRIPTION("Joystick device interfaces"); |
| 29 | −MODULE_SUPPORTED_DEVICE("input/js"); | |
| 30 | 29 | MODULE_LICENSE("GPL"); |
| 31 | 30 | |
| 32 | 31 | #define JOYDEV_MINOR_BASE 0 |
| @@ -252,8 +252,8 @@ static int __init n64joy_probe(struct platform_device *pdev) · 251 unmodified lines | ||
| 252 | 252 | mutex_init(&priv->n64joy_mutex); |
| 253 | 253 | |
| 254 | 254 | priv->reg_base = devm_platform_ioremap_resource(pdev, 0); |
| 255 | − if (!priv->reg_base) { | |
| 256 | − err = -EINVAL; | |
| 255 | + if (IS_ERR(priv->reg_base)) { | |
| 256 | + err = PTR_ERR(priv->reg_base); | |
| 257 | 257 | goto fail; |
| 258 | 258 | } |
| 259 | 259 | |
| @@ -93,9 +93,15 @@ static irqreturn_t nspire_keypad_irq(int irq, void *dev_id) · 92 unmodified lines | ||
| 93 | 93 | return IRQ_HANDLED; |
| 94 | 94 | } |
| 95 | 95 | |
| 96 | −static int nspire_keypad_chip_init(struct nspire_keypad *keypad) | |
| 96 | +static int nspire_keypad_open(struct input_dev *input) | |
| 97 | 97 | { |
| 98 | + struct nspire_keypad *keypad = input_get_drvdata(input); | |
| 98 | 99 | unsigned long val = 0, cycles_per_us, delay_cycles, row_delay_cycles; |
| 100 | + int error; | |
| 101 | + | |
| 102 | + error = clk_prepare_enable(keypad->clk); | |
| 103 | + if (error) | |
| 104 | + return error; | |
| 99 | 105 | |
| 100 | 106 | cycles_per_us = (clk_get_rate(keypad->clk) / 1000000); |
| 101 | 107 | if (cycles_per_us == 0) |
| @@ -121,30 +127,6 @@ static int nspire_keypad_chip_init(struct nspire_keypad *keypad) · 19 unmodified lines | ||
| 121 | 127 | keypad->int_mask = 1 << 1; |
| 122 | 128 | writel(keypad->int_mask, keypad->reg_base + KEYPAD_INTMSK); |
| 123 | 129 | |
| 124 | − /* Disable GPIO interrupts to prevent hanging on touchpad */ | |
| 125 | − /* Possibly used to detect touchpad events */ | |
| 126 | − writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT); | |
| 127 | − /* Acknowledge existing interrupts */ | |
| 128 | − writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS); | |
| 129 | − | |
| 130 | − return 0; | |
| 131 | −} | |
| 132 | − | |
| 133 | −static int nspire_keypad_open(struct input_dev *input) | |
| 134 | −{ | |
| 135 | − struct nspire_keypad *keypad = input_get_drvdata(input); | |
| 136 | − int error; | |
| 137 | − | |
| 138 | − error = clk_prepare_enable(keypad->clk); | |
| 139 | − if (error) | |
| 140 | − return error; | |
| 141 | − | |
| 142 | − error = nspire_keypad_chip_init(keypad); | |
| 143 | − if (error) { | |
| 144 | − clk_disable_unprepare(keypad->clk); | |
| 145 | − return error; | |
| 146 | − } | |
| 147 | − | |
| 148 | 130 | return 0; |
| 149 | 131 | } |
| 150 | 132 | |
| @@ -152,6 +134,11 @@ static void nspire_keypad_close(struct input_dev *input) · 1 unmodified line | ||
| 152 | 134 | { |
| 153 | 135 | struct nspire_keypad *keypad = input_get_drvdata(input); |
| 154 | 136 | |
| 137 | + /* Disable interrupts */ | |
| 138 | + writel(0, keypad->reg_base + KEYPAD_INTMSK); | |
| 139 | + /* Acknowledge existing interrupts */ | |
| 140 | + writel(~0, keypad->reg_base + KEYPAD_INT); | |
| 141 | + | |
| 155 | 142 | clk_disable_unprepare(keypad->clk); |
| 156 | 143 | } |
| 157 | 144 | |
| @@ -210,6 +197,25 @@ static int nspire_keypad_probe(struct platform_device *pdev) · 52 unmodified lines | ||
| 210 | 197 | return -ENOMEM; |
| 211 | 198 | } |
| 212 | 199 | |
| 200 | + error = clk_prepare_enable(keypad->clk); | |
| 201 | + if (error) { | |
| 202 | + dev_err(&pdev->dev, "failed to enable clock\n"); | |
| 203 | + return error; | |
| 204 | + } | |
| 205 | + | |
| 206 | + /* Disable interrupts */ | |
| 207 | + writel(0, keypad->reg_base + KEYPAD_INTMSK); | |
| 208 | + /* Acknowledge existing interrupts */ | |
| 209 | + writel(~0, keypad->reg_base + KEYPAD_INT); | |
| 210 | + | |
| 211 | + /* Disable GPIO interrupts to prevent hanging on touchpad */ | |
| 212 | + /* Possibly used to detect touchpad events */ | |
| 213 | + writel(0, keypad->reg_base + KEYPAD_UNKNOWN_INT); | |
| 214 | + /* Acknowledge existing GPIO interrupts */ | |
| 215 | + writel(~0, keypad->reg_base + KEYPAD_UNKNOWN_INT_STS); | |
| 216 | + | |
| 217 | + clk_disable_unprepare(keypad->clk); | |
| 218 | + | |
| 213 | 219 | input_set_drvdata(input, keypad); |
| 214 | 220 | |
| 215 | 221 | input->id.bustype = BUS_HOST; |
| @@ -588,6 +588,7 @@ static const struct dmi_system_id i8042_dmi_noselftest_table[] = { · 587 unmodified lines | ||
| 588 | 588 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 589 | 589 | DMI_MATCH(DMI_CHASSIS_TYPE, "10"), /* Notebook */ |
| 590 | 590 | }, |
| 591 | + }, { | |
| 591 | 592 | .matches = { |
| 592 | 593 | DMI_MATCH(DMI_SYS_VENDOR, "ASUSTeK COMPUTER INC."), |
| 593 | 594 | DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */ |
| @@ -1441,7 +1441,7 @@ static int elants_i2c_probe(struct i2c_client *client, · 1440 unmodified lines | ||
| 1441 | 1441 | |
| 1442 | 1442 | touchscreen_parse_properties(ts->input, true, &ts->prop); |
| 1443 | 1443 | |
| 1444 | − if (ts->chip_id == EKTF3624) { | |
| 1444 | + if (ts->chip_id == EKTF3624 && ts->phy_x && ts->phy_y) { | |
| 1445 | 1445 | /* calculate resolution from size */ |
| 1446 | 1446 | ts->x_res = DIV_ROUND_CLOSEST(ts->prop.max_x, ts->phy_x); |
| 1447 | 1447 | ts->y_res = DIV_ROUND_CLOSEST(ts->prop.max_y, ts->phy_y); |
| @@ -1449,8 +1449,7 @@ static int elants_i2c_probe(struct i2c_client *client, · 1 unmodified line | ||
| 1449 | 1449 | |
| 1450 | 1450 | input_abs_set_res(ts->input, ABS_MT_POSITION_X, ts->x_res); |
| 1451 | 1451 | input_abs_set_res(ts->input, ABS_MT_POSITION_Y, ts->y_res); |
| 1452 | − if (ts->major_res > 0) | |
| 1453 | − input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, ts->major_res); | |
| 1452 | + input_abs_set_res(ts->input, ABS_MT_TOUCH_MAJOR, ts->major_res); | |
| 1454 | 1453 | |
| 1455 | 1454 | error = input_mt_init_slots(ts->input, MAX_CONTACT_NUM, |
| 1456 | 1455 | INPUT_MT_DIRECT | INPUT_MT_DROP_UNUSED); |
| @@ -145,8 +145,8 @@ static void s6sy761_report_coordinates(struct s6sy761_data *sdata, · 144 unmodified lines | ||
| 145 | 145 | u8 major = event[4]; |
| 146 | 146 | u8 minor = event[5]; |
| 147 | 147 | u8 z = event[6] & S6SY761_MASK_Z; |
| 148 | − u16 x = (event[1] << 3) | ((event[3] & S6SY761_MASK_X) >> 4); | |
| 149 | − u16 y = (event[2] << 3) | (event[3] & S6SY761_MASK_Y); | |
| 148 | + u16 x = (event[1] << 4) | ((event[3] & S6SY761_MASK_X) >> 4); | |
| 149 | + u16 y = (event[2] << 4) | (event[3] & S6SY761_MASK_Y); | |
| 150 | 150 | |
| 151 | 151 | input_mt_slot(sdata->input, tid); |
| 152 | 152 | |
| @@ -53,7 +53,7 @@ void icc_bulk_put(int num_paths, struct icc_bulk_data *paths) · 52 unmodified lines | ||
| 53 | 53 | EXPORT_SYMBOL_GPL(icc_bulk_put); |
| 54 | 54 | |
| 55 | 55 | /** |
| 56 | − * icc_bulk_set() - set bandwidth to a set of paths | |
| 56 | + * icc_bulk_set_bw() - set bandwidth to a set of paths | |
| 57 | 57 | * @num_paths: the number of icc_bulk_data |
| 58 | 58 | * @paths: the icc_bulk_data table containing the paths and bandwidth |
| 59 | 59 | * |
| @@ -942,6 +942,8 @@ int icc_link_destroy(struct icc_node *src, struct icc_node *dst) · 941 unmodified lines | ||
| 942 | 942 | GFP_KERNEL); |
| 943 | 943 | if (new) |
| 944 | 944 | src->links = new; |
| 945 | + else | |
| 946 | + ret = -ENOMEM; | |
| 945 | 947 | |
| 946 | 948 | out: |
| 947 | 949 | mutex_unlock(&icc_lock); |
| @@ -131,7 +131,7 @@ DEFINE_QNODE(mas_pcnoc_sdcc_1, MSM8939_MASTER_SDCC_1, 8, -1, -1, MSM8939_PNOC_IN · 130 unmodified lines | ||
| 131 | 131 | DEFINE_QNODE(mas_pcnoc_sdcc_2, MSM8939_MASTER_SDCC_2, 8, -1, -1, MSM8939_PNOC_INT_1); |
| 132 | 132 | DEFINE_QNODE(mas_qdss_bam, MSM8939_MASTER_QDSS_BAM, 8, -1, -1, MSM8939_SNOC_QDSS_INT); |
| 133 | 133 | DEFINE_QNODE(mas_qdss_etr, MSM8939_MASTER_QDSS_ETR, 8, -1, -1, MSM8939_SNOC_QDSS_INT); |
| 134 | −DEFINE_QNODE(mas_snoc_cfg, MSM8939_MASTER_SNOC_CFG, 4, 20, -1, MSM8939_SLAVE_SRVC_SNOC); | |
| 134 | +DEFINE_QNODE(mas_snoc_cfg, MSM8939_MASTER_SNOC_CFG, 4, -1, -1, MSM8939_SLAVE_SRVC_SNOC); | |
| 135 | 135 | DEFINE_QNODE(mas_spdm, MSM8939_MASTER_SPDM, 4, -1, -1, MSM8939_PNOC_MAS_0); |
| 136 | 136 | DEFINE_QNODE(mas_tcu0, MSM8939_MASTER_TCU0, 16, -1, -1, MSM8939_SLAVE_EBI_CH0, MSM8939_BIMC_SNOC_MAS, MSM8939_SLAVE_AMPSS_L2); |
| 137 | 137 | DEFINE_QNODE(mas_usb_hs1, MSM8939_MASTER_USB_HS1, 4, -1, -1, MSM8939_PNOC_MAS_1); |
| @@ -156,14 +156,14 @@ DEFINE_QNODE(pcnoc_snoc_mas, MSM8939_PNOC_SNOC_MAS, 8, 29, -1, MSM8939_PNOC_SNOC · 18 unmodified lines | ||
| 156 | 156 | DEFINE_QNODE(pcnoc_snoc_slv, MSM8939_PNOC_SNOC_SLV, 8, -1, 45, MSM8939_SNOC_INT_0, MSM8939_SNOC_INT_BIMC, MSM8939_SNOC_INT_1); |
| 157 | 157 | DEFINE_QNODE(qdss_int, MSM8939_SNOC_QDSS_INT, 8, -1, -1, MSM8939_SNOC_INT_0, MSM8939_SNOC_INT_BIMC); |
| 158 | 158 | DEFINE_QNODE(slv_apps_l2, MSM8939_SLAVE_AMPSS_L2, 16, -1, -1, 0); |
| 159 | −DEFINE_QNODE(slv_apss, MSM8939_SLAVE_APSS, 4, -1, 20, 0); | |
| 159 | +DEFINE_QNODE(slv_apss, MSM8939_SLAVE_APSS, 4, -1, -1, 0); | |
| 160 | 160 | DEFINE_QNODE(slv_audio, MSM8939_SLAVE_LPASS, 4, -1, -1, 0); |
| 161 | 161 | DEFINE_QNODE(slv_bimc_cfg, MSM8939_SLAVE_BIMC_CFG, 4, -1, -1, 0); |
| 162 | 162 | DEFINE_QNODE(slv_blsp_1, MSM8939_SLAVE_BLSP_1, 4, -1, -1, 0); |
| 163 | 163 | DEFINE_QNODE(slv_boot_rom, MSM8939_SLAVE_BOOT_ROM, 4, -1, -1, 0); |
| 164 | 164 | DEFINE_QNODE(slv_camera_cfg, MSM8939_SLAVE_CAMERA_CFG, 4, -1, -1, 0); |
| 165 | −DEFINE_QNODE(slv_cats_0, MSM8939_SLAVE_CATS_128, 16, -1, 106, 0); | |
| 166 | −DEFINE_QNODE(slv_cats_1, MSM8939_SLAVE_OCMEM_64, 8, -1, 107, 0); | |
| 165 | +DEFINE_QNODE(slv_cats_0, MSM8939_SLAVE_CATS_128, 16, -1, -1, 0); | |
| 166 | +DEFINE_QNODE(slv_cats_1, MSM8939_SLAVE_OCMEM_64, 8, -1, -1, 0); | |
| 167 | 167 | DEFINE_QNODE(slv_clk_ctl, MSM8939_SLAVE_CLK_CTL, 4, -1, -1, 0); |
| 168 | 168 | DEFINE_QNODE(slv_crypto_0_cfg, MSM8939_SLAVE_CRYPTO_0_CFG, 4, -1, -1, 0); |
| 169 | 169 | DEFINE_QNODE(slv_dehr_cfg, MSM8939_SLAVE_DEHR_CFG, 4, -1, -1, 0); |
| @@ -187,20 +187,20 @@ DEFINE_QNODE(slv_sdcc_2, MSM8939_SLAVE_SDCC_2, 4, -1, -1, 0); · 17 unmodified lines | ||
| 187 | 187 | DEFINE_QNODE(slv_security, MSM8939_SLAVE_SECURITY, 4, -1, -1, 0); |
| 188 | 188 | DEFINE_QNODE(slv_snoc_cfg, MSM8939_SLAVE_SNOC_CFG, 4, -1, -1, 0); |
| 189 | 189 | DEFINE_QNODE(slv_spdm, MSM8939_SLAVE_SPDM, 4, -1, -1, 0); |
| 190 | −DEFINE_QNODE(slv_srvc_snoc, MSM8939_SLAVE_SRVC_SNOC, 8, -1, 29, 0); | |
| 190 | +DEFINE_QNODE(slv_srvc_snoc, MSM8939_SLAVE_SRVC_SNOC, 8, -1, -1, 0); | |
| 191 | 191 | DEFINE_QNODE(slv_tcsr, MSM8939_SLAVE_TCSR, 4, -1, -1, 0); |
| 192 | 192 | DEFINE_QNODE(slv_tlmm, MSM8939_SLAVE_TLMM, 4, -1, -1, 0); |
| 193 | 193 | DEFINE_QNODE(slv_usb_hs1, MSM8939_SLAVE_USB_HS1, 4, -1, -1, 0); |
| 194 | 194 | DEFINE_QNODE(slv_usb_hs2, MSM8939_SLAVE_USB_HS2, 4, -1, -1, 0); |
| 195 | 195 | DEFINE_QNODE(slv_venus_cfg, MSM8939_SLAVE_VENUS_CFG, 4, -1, -1, 0); |
| 196 | −DEFINE_QNODE(snoc_bimc_0_mas, MSM8939_SNOC_BIMC_0_MAS, 16, 3, -1, MSM8939_SNOC_BIMC_0_SLV); | |
| 197 | −DEFINE_QNODE(snoc_bimc_0_slv, MSM8939_SNOC_BIMC_0_SLV, 16, -1, 24, MSM8939_SLAVE_EBI_CH0); | |
| 196 | +DEFINE_QNODE(snoc_bimc_0_mas, MSM8939_SNOC_BIMC_0_MAS, 16, -1, -1, MSM8939_SNOC_BIMC_0_SLV); | |
| 197 | +DEFINE_QNODE(snoc_bimc_0_slv, MSM8939_SNOC_BIMC_0_SLV, 16, -1, -1, MSM8939_SLAVE_EBI_CH0); | |
| 198 | 198 | DEFINE_QNODE(snoc_bimc_1_mas, MSM8939_SNOC_BIMC_1_MAS, 16, 76, -1, MSM8939_SNOC_BIMC_1_SLV); |
| 199 | 199 | DEFINE_QNODE(snoc_bimc_1_slv, MSM8939_SNOC_BIMC_1_SLV, 16, -1, 104, MSM8939_SLAVE_EBI_CH0); |
| 200 | 200 | DEFINE_QNODE(snoc_bimc_2_mas, MSM8939_SNOC_BIMC_2_MAS, 16, -1, -1, MSM8939_SNOC_BIMC_2_SLV); |
| 201 | 201 | DEFINE_QNODE(snoc_bimc_2_slv, MSM8939_SNOC_BIMC_2_SLV, 16, -1, -1, MSM8939_SLAVE_EBI_CH0); |
| 202 | 202 | DEFINE_QNODE(snoc_int_0, MSM8939_SNOC_INT_0, 8, 99, 130, MSM8939_SLAVE_QDSS_STM, MSM8939_SLAVE_IMEM, MSM8939_SNOC_PNOC_MAS); |
| 203 | −DEFINE_QNODE(snoc_int_1, MSM8939_SNOC_INT_1, 8, 100, 131, MSM8939_SLAVE_APSS, MSM8939_SLAVE_CATS_128, MSM8939_SLAVE_OCMEM_64); | |
| 203 | +DEFINE_QNODE(snoc_int_1, MSM8939_SNOC_INT_1, 8, -1, -1, MSM8939_SLAVE_APSS, MSM8939_SLAVE_CATS_128, MSM8939_SLAVE_OCMEM_64); | |
| 204 | 204 | DEFINE_QNODE(snoc_int_bimc, MSM8939_SNOC_INT_BIMC, 8, 101, 132, MSM8939_SNOC_BIMC_1_MAS); |
| 205 | 205 | DEFINE_QNODE(snoc_pcnoc_mas, MSM8939_SNOC_PNOC_MAS, 8, -1, -1, MSM8939_SNOC_PNOC_SLV); |
| 206 | 206 | DEFINE_QNODE(snoc_pcnoc_slv, MSM8939_SNOC_PNOC_SLV, 8, -1, -1, MSM8939_PNOC_INT_0); |
| @@ -2714,7 +2714,6 @@ static int __init early_amd_iommu_init(void) · 2713 unmodified lines | ||
| 2714 | 2714 | struct acpi_table_header *ivrs_base; |
| 2715 | 2715 | int i, remap_cache_sz, ret; |
| 2716 | 2716 | acpi_status status; |
| 2717 | − u32 pci_id; | |
| 2718 | 2717 | |
| 2719 | 2718 | if (!amd_iommu_detected) |
| 2720 | 2719 | return -ENODEV; |
| @@ -2804,16 +2803,6 @@ static int __init early_amd_iommu_init(void) · 83 unmodified lines | ||
| 2804 | 2803 | if (ret) |
| 2805 | 2804 | goto out; |
| 2806 | 2805 | |
| 2807 | − /* Disable IOMMU if there's Stoney Ridge graphics */ | |
| 2808 | − for (i = 0; i < 32; i++) { | |
| 2809 | − pci_id = read_pci_config(0, i, 0, 0); | |
| 2810 | − if ((pci_id & 0xffff) == 0x1002 && (pci_id >> 16) == 0x98e4) { | |
| 2811 | − pr_info("Disable IOMMU on Stoney Ridge\n"); | |
| 2812 | − amd_iommu_disabled = true; | |
| 2813 | − break; | |
| 2814 | − } | |
| 2815 | − } | |
| 2816 | − | |
| 2817 | 2806 | /* Disable any previously enabled IOMMUs */ |
| 2818 | 2807 | if (!is_kdump_kernel() || amd_iommu_disabled) |
| 2819 | 2808 | disable_iommus(); |
| @@ -2880,6 +2869,7 @@ static bool detect_ivrs(void) · 60 unmodified lines | ||
| 2880 | 2869 | { |
| 2881 | 2870 | struct acpi_table_header *ivrs_base; |
| 2882 | 2871 | acpi_status status; |
| 2872 | + int i; | |
| 2883 | 2873 | |
| 2884 | 2874 | status = acpi_get_table("IVRS", 0, &ivrs_base); |
| 2885 | 2875 | if (status == AE_NOT_FOUND) |
| @@ -2892,6 +2882,17 @@ static bool detect_ivrs(void) · 6 unmodified lines | ||
| 2892 | 2882 | |
| 2893 | 2883 | acpi_put_table(ivrs_base); |
| 2894 | 2884 | |
| 2885 | + /* Don't use IOMMU if there is Stoney Ridge graphics */ | |
| 2886 | + for (i = 0; i < 32; i++) { | |
| 2887 | + u32 pci_id; | |
| 2888 | + | |
| 2889 | + pci_id = read_pci_config(0, i, 0, 0); | |
| 2890 | + if ((pci_id & 0xffff) == 0x1002 && (pci_id >> 16) == 0x98e4) { | |
| 2891 | + pr_info("Disable IOMMU on Stoney Ridge\n"); | |
| 2892 | + return false; | |
| 2893 | + } | |
| 2894 | + } | |
| 2895 | + | |
| 2895 | 2896 | /* Make sure ACS will be enabled during PCI probe */ |
| 2896 | 2897 | pci_request_acs(); |
| 2897 | 2898 | |
| @@ -2918,12 +2919,12 @@ static int __init state_next(void) · 20 unmodified lines | ||
| 2918 | 2919 | } |
| 2919 | 2920 | break; |
| 2920 | 2921 | case IOMMU_IVRS_DETECTED: |
| 2921 | − ret = early_amd_iommu_init(); | |
| 2922 | − init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED; | |
| 2923 | − if (init_state == IOMMU_ACPI_FINISHED && amd_iommu_disabled) { | |
| 2924 | − pr_info("AMD IOMMU disabled\n"); | |
| 2922 | + if (amd_iommu_disabled) { | |
| 2925 | 2923 | init_state = IOMMU_CMDLINE_DISABLED; |
| 2926 | 2924 | ret = -EINVAL; |
| 2925 | + } else { | |
| 2926 | + ret = early_amd_iommu_init(); | |
| 2927 | + init_state = ret ? IOMMU_INIT_ERROR : IOMMU_ACPI_FINISHED; | |
| 2927 | 2928 | } |
| 2928 | 2929 | break; |
| 2929 | 2930 | case IOMMU_ACPI_FINISHED: |
| @@ -3001,8 +3002,11 @@ int __init amd_iommu_prepare(void) · 71 unmodified lines | ||
| 3001 | 3002 | amd_iommu_irq_remap = true; |
| 3002 | 3003 | |
| 3003 | 3004 | ret = iommu_go_to_state(IOMMU_ACPI_FINISHED); |
| 3004 | − if (ret) | |
| 3005 | + if (ret) { | |
| 3006 | + amd_iommu_irq_remap = false; | |
| 3005 | 3007 | return ret; |
| 3008 | + } | |
| 3009 | + | |
| 3006 | 3010 | return amd_iommu_irq_remap ? 0 : -ENODEV; |
| 3007 | 3011 | } |
| 3008 | 3012 | |
| @@ -849,12 +849,11 @@ static struct iommu_device *tegra_smmu_probe_device(struct device *dev) · 848 unmodified lines | ||
| 849 | 849 | smmu = tegra_smmu_find(args.np); |
| 850 | 850 | if (smmu) { |
| 851 | 851 | err = tegra_smmu_configure(smmu, dev, &args); |
| 852 | − of_node_put(args.np); | |
| 853 | 852 | |
| 854 | − if (err < 0) | |
| 853 | + if (err < 0) { | |
| 854 | + of_node_put(args.np); | |
| 855 | 855 | return ERR_PTR(err); |
| 856 | − | |
| 857 | − break; | |
| 856 | + } | |
| 858 | 857 | } |
| 859 | 858 | |
| 860 | 859 | of_node_put(args.np); |
| @@ -8,7 +8,6 @@ config IRQCHIP · 7 unmodified lines | ||
| 8 | 8 | config ARM_GIC |
| 9 | 9 | bool |
| 10 | 10 | select IRQ_DOMAIN_HIERARCHY |
| 11 | − select GENERIC_IRQ_MULTI_HANDLER | |
| 12 | 11 | select GENERIC_IRQ_EFFECTIVE_AFF_MASK |
| 13 | 12 | |
| 14 | 13 | config ARM_GIC_PM |
| @@ -33,7 +32,6 @@ config GIC_NON_BANKED · 18 unmodified lines | ||
| 33 | 32 | |
| 34 | 33 | config ARM_GIC_V3 |
| 35 | 34 | bool |
| 36 | − select GENERIC_IRQ_MULTI_HANDLER | |
| 37 | 35 | select IRQ_DOMAIN_HIERARCHY |
| 38 | 36 | select PARTITION_PERCPU |
| 39 | 37 | select GENERIC_IRQ_EFFECTIVE_AFF_MASK |
| @@ -64,7 +62,6 @@ config ARM_NVIC · 24 unmodified lines | ||
| 64 | 62 | config ARM_VIC |
| 65 | 63 | bool |
| 66 | 64 | select IRQ_DOMAIN |
| 67 | − select GENERIC_IRQ_MULTI_HANDLER | |
| 68 | 65 | |
| 69 | 66 | config ARM_VIC_NR |
| 70 | 67 | int |
| @@ -99,14 +96,12 @@ config ATMEL_AIC_IRQ · 28 unmodified lines | ||
| 99 | 96 | bool |
| 100 | 97 | select GENERIC_IRQ_CHIP |
| 101 | 98 | select IRQ_DOMAIN |
| 102 | − select GENERIC_IRQ_MULTI_HANDLER | |
| 103 | 99 | select SPARSE_IRQ |
| 104 | 100 | |
| 105 | 101 | config ATMEL_AIC5_IRQ |
| 106 | 102 | bool |
| 107 | 103 | select GENERIC_IRQ_CHIP |
| 108 | 104 | select IRQ_DOMAIN |
| 109 | − select GENERIC_IRQ_MULTI_HANDLER | |
| 110 | 105 | select SPARSE_IRQ |
| 111 | 106 | |
| 112 | 107 | config I8259 |
| @@ -153,7 +148,6 @@ config DW_APB_ICTL · 40 unmodified lines | ||
| 153 | 148 | config FARADAY_FTINTC010 |
| 154 | 149 | bool |
| 155 | 150 | select IRQ_DOMAIN |
| 156 | − select GENERIC_IRQ_MULTI_HANDLER | |
| 157 | 151 | select SPARSE_IRQ |
| 158 | 152 | |
| 159 | 153 | config HISILICON_IRQ_MBIGEN |
| @@ -169,7 +163,6 @@ config IMGPDC_IRQ · 9 unmodified lines | ||
| 169 | 163 | config IXP4XX_IRQ |
| 170 | 164 | bool |
| 171 | 165 | select IRQ_DOMAIN |
| 172 | − select GENERIC_IRQ_MULTI_HANDLER | |
| 173 | 166 | select SPARSE_IRQ |
| 174 | 167 | |
| 175 | 168 | config MADERA_IRQ |
| @@ -186,7 +179,6 @@ config CLPS711X_IRQCHIP · 10 unmodified lines | ||
| 186 | 179 | bool |
| 187 | 180 | depends on ARCH_CLPS711X |
| 188 | 181 | select IRQ_DOMAIN |
| 189 | − select GENERIC_IRQ_MULTI_HANDLER | |
| 190 | 182 | select SPARSE_IRQ |
| 191 | 183 | default y |
| 192 | 184 | |
| @@ -205,7 +197,6 @@ config OMAP_IRQCHIP · 12 unmodified lines | ||
| 205 | 197 | config ORION_IRQCHIP |
| 206 | 198 | bool |
| 207 | 199 | select IRQ_DOMAIN |
| 208 | − select GENERIC_IRQ_MULTI_HANDLER | |
| 209 | 200 | |
| 210 | 201 | config PIC32_EVIC |
| 211 | 202 | bool |
| @@ -179,5 +179,6 @@ err_free_tcu: · 178 unmodified lines | ||
| 179 | 179 | } |
| 180 | 180 | IRQCHIP_DECLARE(jz4740_tcu_irq, "ingenic,jz4740-tcu", ingenic_tcu_irq_init); |
| 181 | 181 | IRQCHIP_DECLARE(jz4725b_tcu_irq, "ingenic,jz4725b-tcu", ingenic_tcu_irq_init); |
| 182 | +IRQCHIP_DECLARE(jz4760_tcu_irq, "ingenic,jz4760-tcu", ingenic_tcu_irq_init); | |
| 182 | 183 | IRQCHIP_DECLARE(jz4770_tcu_irq, "ingenic,jz4770-tcu", ingenic_tcu_irq_init); |
| 183 | 184 | IRQCHIP_DECLARE(x1000_tcu_irq, "ingenic,x1000-tcu", ingenic_tcu_irq_init); |
| @@ -155,6 +155,7 @@ static int __init intc_2chip_of_init(struct device_node *node, · 154 unmodified lines | ||
| 155 | 155 | { |
| 156 | 156 | return ingenic_intc_of_init(node, 2); |
| 157 | 157 | } |
| 158 | +IRQCHIP_DECLARE(jz4760_intc, "ingenic,jz4760-intc", intc_2chip_of_init); | |
| 158 | 159 | IRQCHIP_DECLARE(jz4770_intc, "ingenic,jz4770-intc", intc_2chip_of_init); |
| 159 | 160 | IRQCHIP_DECLARE(jz4775_intc, "ingenic,jz4775-intc", intc_2chip_of_init); |
| 160 | 161 | IRQCHIP_DECLARE(jz4780_intc, "ingenic,jz4780-intc", intc_2chip_of_init); |
| @@ -721,7 +721,7 @@ u16 capi20_put_message(struct capi20_appl *ap, struct sk_buff *skb) · 720 unmodified lines | ||
| 721 | 721 | * Return value: CAPI result code |
| 722 | 722 | */ |
| 723 | 723 | |
| 724 | −u16 capi20_get_manufacturer(u32 contr, u8 *buf) | |
| 724 | +u16 capi20_get_manufacturer(u32 contr, u8 buf[CAPI_MANUFACTURER_LEN]) | |
| 725 | 725 | { |
| 726 | 726 | struct capi_ctr *ctr; |
| 727 | 727 | u16 ret; |
| @@ -787,7 +787,7 @@ u16 capi20_get_version(u32 contr, struct capi_version *verp) · 59 unmodified lines | ||
| 787 | 787 | * Return value: CAPI result code |
| 788 | 788 | */ |
| 789 | 789 | |
| 790 | −u16 capi20_get_serial(u32 contr, u8 *serial) | |
| 790 | +u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]) | |
| 791 | 791 | { |
| 792 | 792 | struct capi_ctr *ctr; |
| 793 | 793 | u16 ret; |
| @@ -694,7 +694,7 @@ isac_release(struct isac_hw *isac) · 693 unmodified lines | ||
| 694 | 694 | { |
| 695 | 695 | if (isac->type & IPAC_TYPE_ISACX) |
| 696 | 696 | WriteISAC(isac, ISACX_MASK, 0xff); |
| 697 | − else | |
| 697 | + else if (isac->type != 0) | |
| 698 | 698 | WriteISAC(isac, ISAC_MASK, 0xff); |
| 699 | 699 | if (isac->dch.timer.function != NULL) { |
| 700 | 700 | del_timer(&isac->dch.timer); |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | /* |
| 3 | 3 | * CZ.NIC's Turris Omnia LEDs driver |
| 4 | 4 | * |
| 5 | − * 2020 by Marek Behun <marek.behun@nic.cz> | |
| 5 | + * 2020 by Marek Behún <kabel@kernel.org> | |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | #include <linux/i2c.h> |
| @@ -287,6 +287,6 @@ static struct i2c_driver omnia_leds_driver = { · 278 unmodified lines | ||
| 287 | 287 | |
| 288 | 288 | module_i2c_driver(omnia_leds_driver); |
| 289 | 289 | |
| 290 | −MODULE_AUTHOR("Marek Behun <marek.behun@nic.cz>"); | |
| 290 | +MODULE_AUTHOR("Marek Behun <kabel@kernel.org>"); | |
| 291 | 291 | MODULE_DESCRIPTION("CZ.NIC's Turris Omnia LEDs"); |
| 292 | 292 | MODULE_LICENSE("GPL v2"); |
| @@ -51,10 +51,8 @@ static ssize_t ttyname_store(struct device *dev, · 50 unmodified lines | ||
| 51 | 51 | |
| 52 | 52 | if (size) { |
| 53 | 53 | ttyname = kmemdup_nul(buf, size, GFP_KERNEL); |
| 54 | − if (!ttyname) { | |
| 55 | − ret = -ENOMEM; | |
| 56 | − goto out_unlock; | |
| 57 | − } | |
| 54 | + if (!ttyname) | |
| 55 | + return -ENOMEM; | |
| 58 | 56 | } else { |
| 59 | 57 | ttyname = NULL; |
| 60 | 58 | } |
| @@ -69,7 +67,6 @@ static ssize_t ttyname_store(struct device *dev, · 8 unmodified lines | ||
| 69 | 67 | |
| 70 | 68 | trigger_data->ttyname = ttyname; |
| 71 | 69 | |
| 72 | −out_unlock: | |
| 73 | 70 | mutex_unlock(&trigger_data->mutex); |
| 74 | 71 | |
| 75 | 72 | if (ttyname && !running) |
| @@ -125,12 +122,12 @@ static void ledtrig_tty_work(struct work_struct *work) · 49 unmodified lines | ||
| 125 | 122 | |
| 126 | 123 | if (icount.rx != trigger_data->rx || |
| 127 | 124 | icount.tx != trigger_data->tx) { |
| 128 | − led_set_brightness(trigger_data->led_cdev, LED_ON); | |
| 125 | + led_set_brightness_sync(trigger_data->led_cdev, LED_ON); | |
| 129 | 126 | |
| 130 | 127 | trigger_data->rx = icount.rx; |
| 131 | 128 | trigger_data->tx = icount.tx; |
| 132 | 129 | } else { |
| 133 | − led_set_brightness(trigger_data->led_cdev, LED_OFF); | |
| 130 | + led_set_brightness_sync(trigger_data->led_cdev, LED_OFF); | |
| 134 | 131 | } |
| 135 | 132 | |
| 136 | 133 | out: |
| @@ -2,7 +2,7 @@ · 1 unmodified line | ||
| 2 | 2 | /* |
| 3 | 3 | * rWTM BIU Mailbox driver for Armada 37xx |
| 4 | 4 | * |
| 5 | − * Author: Marek Behun <marek.behun@nic.cz> | |
| 5 | + * Author: Marek Behún <kabel@kernel.org> | |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | 8 | #include <linux/device.h> |
| @@ -203,4 +203,4 @@ module_platform_driver(armada_37xx_mbox_driver); · 194 unmodified lines | ||
| 203 | 203 | |
| 204 | 204 | MODULE_LICENSE("GPL v2"); |
| 205 | 205 | MODULE_DESCRIPTION("rWTM BIU Mailbox driver for Armada 37xx"); |
| 206 | −MODULE_AUTHOR("Marek Behun <marek.behun@nic.cz>"); | |
| 206 | +MODULE_AUTHOR("Marek Behun <kabel@kernel.org>"); | |
| @@ -965,7 +965,7 @@ static int bcache_device_init(struct bcache_device *d, unsigned int block_size, · 964 unmodified lines | ||
| 965 | 965 | q->limits.max_hw_sectors = UINT_MAX; |
| 966 | 966 | q->limits.max_sectors = UINT_MAX; |
| 967 | 967 | q->limits.max_segment_size = UINT_MAX; |
| 968 | − q->limits.max_segments = BIO_MAX_PAGES; | |
| 968 | + q->limits.max_segments = BIO_MAX_VECS; | |
| 969 | 969 | blk_queue_max_discard_sectors(q, UINT_MAX); |
| 970 | 970 | q->limits.discard_granularity = 512; |
| 971 | 971 | q->limits.io_min = block_size; |
| @@ -229,7 +229,7 @@ static DEFINE_SPINLOCK(dm_crypt_clients_lock); · 228 unmodified lines | ||
| 229 | 229 | static unsigned dm_crypt_clients_n = 0; |
| 230 | 230 | static volatile unsigned long dm_crypt_pages_per_client; |
| 231 | 231 | #define DM_CRYPT_MEMORY_PERCENT 2 |
| 232 | −#define DM_CRYPT_MIN_PAGES_PER_CLIENT (BIO_MAX_PAGES * 16) | |
| 232 | +#define DM_CRYPT_MIN_PAGES_PER_CLIENT (BIO_MAX_VECS * 16) | |
| 233 | 233 | |
| 234 | 234 | static void clone_init(struct dm_crypt_io *, struct bio *); |
| 235 | 235 | static void kcryptd_queue_crypt(struct dm_crypt_io *io); |
| @@ -3246,7 +3246,7 @@ static int crypt_ctr(struct dm_target *ti, unsigned int argc, char **argv) · 3010 unmodified lines | ||
| 3246 | 3246 | ALIGN(sizeof(struct dm_crypt_io) + cc->dmreq_start + additional_req_size, |
| 3247 | 3247 | ARCH_KMALLOC_MINALIGN); |
| 3248 | 3248 | |
| 3249 | − ret = mempool_init(&cc->page_pool, BIO_MAX_PAGES, crypt_page_alloc, crypt_page_free, cc); | |
| 3249 | + ret = mempool_init(&cc->page_pool, BIO_MAX_VECS, crypt_page_alloc, crypt_page_free, cc); | |
| 3250 | 3250 | if (ret) { |
| 3251 | 3251 | ti->error = "Cannot allocate page mempool"; |
| 3252 | 3252 | goto bad; |
| @@ -3373,9 +3373,9 @@ static int crypt_map(struct dm_target *ti, struct bio *bio) · 120 unmodified lines | ||
| 3373 | 3373 | /* |
| 3374 | 3374 | * Check if bio is too large, split as needed. |
| 3375 | 3375 | */ |
| 3376 | − if (unlikely(bio->bi_iter.bi_size > (BIO_MAX_PAGES << PAGE_SHIFT)) && | |
| 3376 | + if (unlikely(bio->bi_iter.bi_size > (BIO_MAX_VECS << PAGE_SHIFT)) && | |
| 3377 | 3377 | (bio_data_dir(bio) == WRITE || cc->on_disk_tag_size)) |
| 3378 | − dm_accept_partial_bio(bio, ((BIO_MAX_PAGES << PAGE_SHIFT) >> SECTOR_SHIFT)); | |
| 3378 | + dm_accept_partial_bio(bio, ((BIO_MAX_VECS << PAGE_SHIFT) >> SECTOR_SHIFT)); | |
| 3379 | 3379 | |
| 3380 | 3380 | /* |
| 3381 | 3381 | * Ensure that bio is a multiple of internal sector encryption size |
| @@ -529,7 +529,7 @@ static int list_devices(struct file *filp, struct dm_ioctl *param, size_t param_ · 528 unmodified lines | ||
| 529 | 529 | * Grab our output buffer. |
| 530 | 530 | */ |
| 531 | 531 | nl = orig_nl = get_result_buffer(param, param_size, &len); |
| 532 | − if (len < needed) { | |
| 532 | + if (len < needed || len < sizeof(nl->dev)) { | |
| 533 | 533 | param->flags |= DM_BUFFER_FULL_FLAG; |
| 534 | 534 | goto out; |
| 535 | 535 | } |
| @@ -1594,6 +1594,13 @@ static int device_not_zoned_model(struct dm_target *ti, struct dm_dev *dev, · 1593 unmodified lines | ||
| 1594 | 1594 | return blk_queue_zoned_model(q) != *zoned_model; |
| 1595 | 1595 | } |
| 1596 | 1596 | |
| 1597 | +/* | |
| 1598 | + * Check the device zoned model based on the target feature flag. If the target | |
| 1599 | + * has the DM_TARGET_ZONED_HM feature flag set, host-managed zoned devices are | |
| 1600 | + * also accepted but all devices must have the same zoned model. If the target | |
| 1601 | + * has the DM_TARGET_MIXED_ZONED_MODEL feature set, the devices can have any | |
| 1602 | + * zoned model with all zoned devices having the same zone size. | |
| 1603 | + */ | |
| 1597 | 1604 | static bool dm_table_supports_zoned_model(struct dm_table *t, |
| 1598 | 1605 | enum blk_zoned_model zoned_model) |
| 1599 | 1606 | { |
| @@ -1603,13 +1610,15 @@ static bool dm_table_supports_zoned_model(struct dm_table *t, · 3 unmodified lines | ||
| 1603 | 1610 | for (i = 0; i < dm_table_get_num_targets(t); i++) { |
| 1604 | 1611 | ti = dm_table_get_target(t, i); |
| 1605 | 1612 | |
| 1606 | − if (zoned_model == BLK_ZONED_HM && | |
| 1607 | − !dm_target_supports_zoned_hm(ti->type)) | |
| 1608 | − return false; | |
| 1609 | − | |
| 1610 | − if (!ti->type->iterate_devices || | |
| 1611 | − ti->type->iterate_devices(ti, device_not_zoned_model, &zoned_model)) | |
| 1612 | − return false; | |
| 1613 | + if (dm_target_supports_zoned_hm(ti->type)) { | |
| 1614 | + if (!ti->type->iterate_devices || | |
| 1615 | + ti->type->iterate_devices(ti, device_not_zoned_model, | |
| 1616 | + &zoned_model)) | |
| 1617 | + return false; | |
| 1618 | + } else if (!dm_target_supports_mixed_zoned_model(ti->type)) { | |
| 1619 | + if (zoned_model == BLK_ZONED_HM) | |
| 1620 | + return false; | |
| 1621 | + } | |
| 1613 | 1622 | } |
| 1614 | 1623 | |
| 1615 | 1624 | return true; |
| @@ -1621,9 +1630,17 @@ static int device_not_matches_zone_sectors(struct dm_target *ti, struct dm_dev * · 5 unmodified lines | ||
| 1621 | 1630 | struct request_queue *q = bdev_get_queue(dev->bdev); |
| 1622 | 1631 | unsigned int *zone_sectors = data; |
| 1623 | 1632 | |
| 1633 | + if (!blk_queue_is_zoned(q)) | |
| 1634 | + return 0; | |
| 1635 | + | |
| 1624 | 1636 | return blk_queue_zone_sectors(q) != *zone_sectors; |
| 1625 | 1637 | } |
| 1626 | 1638 | |
| 1639 | +/* | |
| 1640 | + * Check consistency of zoned model and zone sectors across all targets. For | |
| 1641 | + * zone sectors, if the destination device is a zoned block device, it shall | |
| 1642 | + * have the specified zone_sectors. | |
| 1643 | + */ | |
| 1627 | 1644 | static int validate_hardware_zoned_model(struct dm_table *table, |
| 1628 | 1645 | enum blk_zoned_model zoned_model, |
| 1629 | 1646 | unsigned int zone_sectors) |
| @@ -1642,7 +1659,7 @@ static int validate_hardware_zoned_model(struct dm_table *table, · 12 unmodified lines | ||
| 1642 | 1659 | return -EINVAL; |
| 1643 | 1660 | |
| 1644 | 1661 | if (dm_table_any_dev_attr(table, device_not_matches_zone_sectors, &zone_sectors)) { |
| 1645 | − DMERR("%s: zone sectors is not consistent across all devices", | |
| 1662 | + DMERR("%s: zone sectors is not consistent across all zoned devices", | |
| 1646 | 1663 | dm_device_name(table->md)); |
| 1647 | 1664 | return -EINVAL; |
| 1648 | 1665 | } |
| @@ -65,7 +65,7 @@ static u8 *fec_read_parity(struct dm_verity *v, u64 rsb, int index, · 64 unmodified lines | ||
| 65 | 65 | u8 *res; |
| 66 | 66 | |
| 67 | 67 | position = (index + rsb) * v->fec->roots; |
| 68 | − block = div64_u64_rem(position, v->fec->roots << SECTOR_SHIFT, &rem); | |
| 68 | + block = div64_u64_rem(position, v->fec->io_size, &rem); | |
| 69 | 69 | *offset = (unsigned)rem; |
| 70 | 70 | |
| 71 | 71 | res = dm_bufio_read(v->fec->bufio, block, buf); |
| @@ -154,7 +154,7 @@ static int fec_decode_bufs(struct dm_verity *v, struct dm_verity_fec_io *fio, · 82 unmodified lines | ||
| 154 | 154 | |
| 155 | 155 | /* read the next block when we run out of parity bytes */ |
| 156 | 156 | offset += v->fec->roots; |
| 157 | − if (offset >= v->fec->roots << SECTOR_SHIFT) { | |
| 157 | + if (offset >= v->fec->io_size) { | |
| 158 | 158 | dm_bufio_release(buf); |
| 159 | 159 | |
| 160 | 160 | par = fec_read_parity(v, rsb, block_offset, &offset, &buf); |
| @@ -742,8 +742,13 @@ int verity_fec_ctr(struct dm_verity *v) · 581 unmodified lines | ||
| 742 | 742 | return -E2BIG; |
| 743 | 743 | } |
| 744 | 744 | |
| 745 | + if ((f->roots << SECTOR_SHIFT) & ((1 << v->data_dev_block_bits) - 1)) | |
| 746 | + f->io_size = 1 << v->data_dev_block_bits; | |
| 747 | + else | |
| 748 | + f->io_size = v->fec->roots << SECTOR_SHIFT; | |
| 749 | + | |
| 745 | 750 | f->bufio = dm_bufio_client_create(f->dev->bdev, |
| 746 | − f->roots << SECTOR_SHIFT, | |
| 751 | + f->io_size, | |
| 747 | 752 | 1, 0, NULL, NULL); |
| 748 | 753 | if (IS_ERR(f->bufio)) { |
| 749 | 754 | ti->error = "Cannot initialize FEC bufio client"; |
| @@ -36,6 +36,7 @@ struct dm_verity_fec { · 35 unmodified lines | ||
| 36 | 36 | struct dm_dev *dev; /* parity data device */ |
| 37 | 37 | struct dm_bufio_client *data_bufio; /* for data dev access */ |
| 38 | 38 | struct dm_bufio_client *bufio; /* for parity data access */ |
| 39 | + size_t io_size; /* IO size for roots */ | |
| 39 | 40 | sector_t start; /* parity data start in blocks */ |
| 40 | 41 | sector_t blocks; /* number of blocks covered */ |
| 41 | 42 | sector_t rounds; /* number of interleaving rounds */ |
| @@ -34,7 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | #define DM_VERITY_OPT_IGN_ZEROES "ignore_zero_blocks" |
| 35 | 35 | #define DM_VERITY_OPT_AT_MOST_ONCE "check_at_most_once" |
| 36 | 36 | |
| 37 | −#define DM_VERITY_OPTS_MAX (2 + DM_VERITY_OPTS_FEC + \ | |
| 37 | +#define DM_VERITY_OPTS_MAX (3 + DM_VERITY_OPTS_FEC + \ | |
| 38 | 38 | DM_VERITY_ROOT_HASH_VERIFICATION_OPTS) |
| 39 | 39 | |
| 40 | 40 | static unsigned dm_verity_prefetch_cluster = DM_VERITY_DEFAULT_PREFETCH_SIZE; |
| @@ -1892,10 +1892,10 @@ restart: · 1891 unmodified lines | ||
| 1892 | 1892 | list_add(&g->lru, &wbl.list); |
| 1893 | 1893 | wbl.size++; |
| 1894 | 1894 | g->write_in_progress = true; |
| 1895 | − g->wc_list_contiguous = BIO_MAX_PAGES; | |
| 1895 | + g->wc_list_contiguous = BIO_MAX_VECS; | |
| 1896 | 1896 | f = g; |
| 1897 | 1897 | e->wc_list_contiguous++; |
| 1898 | − if (unlikely(e->wc_list_contiguous == BIO_MAX_PAGES)) { | |
| 1898 | + if (unlikely(e->wc_list_contiguous == BIO_MAX_VECS)) { | |
| 1899 | 1899 | if (unlikely(wc->writeback_all)) { |
| 1900 | 1900 | next_node = rb_next(&f->rb_node); |
| 1901 | 1901 | if (likely(next_node)) |
| @@ -1143,7 +1143,7 @@ static int dmz_message(struct dm_target *ti, unsigned int argc, char **argv, · 1142 unmodified lines | ||
| 1143 | 1143 | static struct target_type dmz_type = { |
| 1144 | 1144 | .name = "zoned", |
| 1145 | 1145 | .version = {2, 0, 0}, |
| 1146 | − .features = DM_TARGET_SINGLETON | DM_TARGET_ZONED_HM, | |
| 1146 | + .features = DM_TARGET_SINGLETON | DM_TARGET_MIXED_ZONED_MODEL, | |
| 1147 | 1147 | .module = THIS_MODULE, |
| 1148 | 1148 | .ctr = dmz_ctr, |
| 1149 | 1149 | .dtr = dmz_dtr, |
| @@ -2036,7 +2036,10 @@ static struct dm_table *__bind(struct mapped_device *md, struct dm_table *t, · 2035 unmodified lines | ||
| 2036 | 2036 | if (size != dm_get_size(md)) |
| 2037 | 2037 | memset(&md->geometry, 0, sizeof(md->geometry)); |
| 2038 | 2038 | |
| 2039 | − set_capacity_and_notify(md->disk, size); | |
| 2039 | + if (!get_capacity(md->disk)) | |
| 2040 | + set_capacity(md->disk, size); | |
| 2041 | + else | |
| 2042 | + set_capacity_and_notify(md->disk, size); | |
| 2040 | 2043 | |
| 2041 | 2044 | dm_table_event_callback(t, event_callback, md); |
| 2042 | 2045 | |
| @@ -735,7 +735,7 @@ static void r5l_submit_current_io(struct r5l_log *log) · 734 unmodified lines | ||
| 735 | 735 | |
| 736 | 736 | static struct bio *r5l_bio_alloc(struct r5l_log *log) |
| 737 | 737 | { |
| 738 | − struct bio *bio = bio_alloc_bioset(GFP_NOIO, BIO_MAX_PAGES, &log->bs); | |
| 738 | + struct bio *bio = bio_alloc_bioset(GFP_NOIO, BIO_MAX_VECS, &log->bs); | |
| 739 | 739 | |
| 740 | 740 | bio_set_op_attrs(bio, REQ_OP_WRITE, 0); |
| 741 | 741 | bio_set_dev(bio, log->rdev->bdev); |
| @@ -1634,7 +1634,7 @@ static int r5l_recovery_allocate_ra_pool(struct r5l_log *log, · 892 unmodified lines | ||
| 1634 | 1634 | { |
| 1635 | 1635 | struct page *page; |
| 1636 | 1636 | |
| 1637 | − ctx->ra_bio = bio_alloc_bioset(GFP_KERNEL, BIO_MAX_PAGES, &log->bs); | |
| 1637 | + ctx->ra_bio = bio_alloc_bioset(GFP_KERNEL, BIO_MAX_VECS, &log->bs); | |
| 1638 | 1638 | if (!ctx->ra_bio) |
| 1639 | 1639 | return -ENOMEM; |
| 1640 | 1640 | |
| @@ -496,7 +496,7 @@ static void ppl_submit_iounit(struct ppl_io_unit *io) · 495 unmodified lines | ||
| 496 | 496 | if (!bio_add_page(bio, sh->ppl_page, PAGE_SIZE, 0)) { |
| 497 | 497 | struct bio *prev = bio; |
| 498 | 498 | |
| 499 | − bio = bio_alloc_bioset(GFP_NOIO, BIO_MAX_PAGES, | |
| 499 | + bio = bio_alloc_bioset(GFP_NOIO, BIO_MAX_VECS, | |
| 500 | 500 | &ppl_conf->bs); |
| 501 | 501 | bio->bi_opf = prev->bi_opf; |
| 502 | 502 | bio->bi_write_hint = prev->bi_write_hint; |
| @@ -430,4 +430,3 @@ MODULE_AUTHOR("Andreas Monitzer <andy@monitzer.com>"); · 429 unmodified lines | ||
| 430 | 430 | MODULE_AUTHOR("Ben Backx <ben@bbackx.com>"); |
| 431 | 431 | MODULE_DESCRIPTION("FireDTV DVB Driver"); |
| 432 | 432 | MODULE_LICENSE("GPL"); |
| 433 | −MODULE_SUPPORTED_DEVICE("FireDTV DVB"); | |
| @@ -41,7 +41,6 @@ MODULE_PARM_DESC(debug, · 40 unmodified lines | ||
| 41 | 41 | |
| 42 | 42 | MODULE_AUTHOR("Andy Walls"); |
| 43 | 43 | MODULE_DESCRIPTION("CX23418 ALSA Interface"); |
| 44 | −MODULE_SUPPORTED_DEVICE("CX23418 MPEG2 encoder"); | |
| 45 | 44 | MODULE_LICENSE("GPL"); |
| 46 | 45 | |
| 47 | 46 | MODULE_VERSION(CX18_VERSION); |
| @@ -232,7 +232,6 @@ MODULE_PARM_DESC(cx18_first_minor, · 231 unmodified lines | ||
| 232 | 232 | |
| 233 | 233 | MODULE_AUTHOR("Hans Verkuil"); |
| 234 | 234 | MODULE_DESCRIPTION("CX23418 driver"); |
| 235 | −MODULE_SUPPORTED_DEVICE("CX23418 MPEG2 encoder"); | |
| 236 | 235 | MODULE_LICENSE("GPL"); |
| 237 | 236 | |
| 238 | 237 | MODULE_VERSION(CX18_VERSION); |
| @@ -104,7 +104,6 @@ MODULE_PARM_DESC(index, "Index value for cx25821 capture interface(s)."); · 103 unmodified lines | ||
| 104 | 104 | MODULE_DESCRIPTION("ALSA driver module for cx25821 based capture cards"); |
| 105 | 105 | MODULE_AUTHOR("Hiep Huynh"); |
| 106 | 106 | MODULE_LICENSE("GPL"); |
| 107 | −MODULE_SUPPORTED_DEVICE("{{Conexant,25821}"); /* "{{Conexant,23881}," */ | |
| 108 | 107 | |
| 109 | 108 | static unsigned int debug; |
| 110 | 109 | module_param(debug, int, 0644); |
| @@ -98,7 +98,6 @@ MODULE_AUTHOR("Mauro Carvalho Chehab <mchehab@kernel.org>"); · 97 unmodified lines | ||
| 98 | 98 | MODULE_LICENSE("GPL v2"); |
| 99 | 99 | MODULE_VERSION(CX88_VERSION); |
| 100 | 100 | |
| 101 | −MODULE_SUPPORTED_DEVICE("{{Conexant,23881},{{Conexant,23882},{{Conexant,23883}"); | |
| 102 | 101 | static unsigned int debug; |
| 103 | 102 | module_param(debug, int, 0644); |
| 104 | 103 | MODULE_PARM_DESC(debug, "enable debug messages"); |
| @@ -38,7 +38,6 @@ MODULE_PARM_DESC(index, · 37 unmodified lines | ||
| 38 | 38 | |
| 39 | 39 | MODULE_AUTHOR("Andy Walls"); |
| 40 | 40 | MODULE_DESCRIPTION("CX23415/CX23416 ALSA Interface"); |
| 41 | −MODULE_SUPPORTED_DEVICE("CX23415/CX23416 MPEG2 encoder"); | |
| 42 | 41 | MODULE_LICENSE("GPL"); |
| 43 | 42 | |
| 44 | 43 | MODULE_VERSION(IVTV_VERSION); |
| @@ -275,9 +275,6 @@ MODULE_PARM_DESC(ivtv_first_minor, "Set device node number assigned to first car · 274 unmodified lines | ||
| 275 | 275 | |
| 276 | 276 | MODULE_AUTHOR("Kevin Thayer, Chris Kennedy, Hans Verkuil"); |
| 277 | 277 | MODULE_DESCRIPTION("CX23415/CX23416 driver"); |
| 278 | −MODULE_SUPPORTED_DEVICE | |
| 279 | − ("CX23415/CX23416 MPEG2 encoder (WinTV PVR-150/250/350/500,\n" | |
| 280 | − "\t\t\tYuan MPG series and similar)"); | |
| 281 | 278 | MODULE_LICENSE("GPL"); |
| 282 | 279 | |
| 283 | 280 | MODULE_VERSION(IVTV_VERSION); |
| @@ -1269,6 +1269,5 @@ late_initcall_sync(sta2x11_vip_init_module); · 1268 unmodified lines | ||
| 1269 | 1269 | MODULE_DESCRIPTION("STA2X11 Video Input Port driver"); |
| 1270 | 1270 | MODULE_AUTHOR("Wind River"); |
| 1271 | 1271 | MODULE_LICENSE("GPL v2"); |
| 1272 | −MODULE_SUPPORTED_DEVICE("sta2x11 video input"); | |
| 1273 | 1272 | MODULE_VERSION(DRV_VERSION); |
| 1274 | 1273 | MODULE_DEVICE_TABLE(pci, sta2x11_vip_pci_tbl); |
| @@ -1363,4 +1363,3 @@ module_platform_driver(atmel_isi_driver); · 1362 unmodified lines | ||
| 1363 | 1363 | MODULE_AUTHOR("Josh Wu <josh.wu@atmel.com>"); |
| 1364 | 1364 | MODULE_DESCRIPTION("The V4L2 driver for Atmel Linux"); |
| 1365 | 1365 | MODULE_LICENSE("GPL"); |
| 1366 | −MODULE_SUPPORTED_DEVICE("video"); | |
| @@ -330,4 +330,3 @@ module_platform_driver(atmel_isc_driver); · 329 unmodified lines | ||
| 330 | 330 | MODULE_AUTHOR("Songjun Wu"); |
| 331 | 331 | MODULE_DESCRIPTION("The V4L2 driver for Atmel-ISC"); |
| 332 | 332 | MODULE_LICENSE("GPL v2"); |
| 333 | −MODULE_SUPPORTED_DEVICE("video"); | |
| @@ -44,10 +44,6 @@ · 43 unmodified lines | ||
| 44 | 44 | MODULE_AUTHOR("Jonathan Corbet <corbet@lwn.net>"); |
| 45 | 45 | MODULE_DESCRIPTION("Marvell 88ALP01 CMOS Camera Controller driver"); |
| 46 | 46 | MODULE_LICENSE("GPL"); |
| 47 | −MODULE_SUPPORTED_DEVICE("Video"); | |
| 48 | − | |
| 49 | − | |
| 50 | − | |
| 51 | 47 | |
| 52 | 48 | struct cafe_camera { |
| 53 | 49 | int registered; /* Fully initialized? */ |
| @@ -1288,7 +1288,6 @@ static void rkisp1_params_config_parameter(struct rkisp1_params *params) · 1287 unmodified lines | ||
| 1288 | 1288 | memset(hst.hist_weight, 0x01, sizeof(hst.hist_weight)); |
| 1289 | 1289 | rkisp1_hst_config(params, &hst); |
| 1290 | 1290 | rkisp1_param_set_bits(params, RKISP1_CIF_ISP_HIST_PROP, |
| 1291 | − ~RKISP1_CIF_ISP_HIST_PROP_MODE_MASK | | |
| 1292 | 1291 | rkisp1_hst_params_default_config.mode); |
| 1293 | 1292 | |
| 1294 | 1293 | /* set the range */ |
| @@ -2149,4 +2149,3 @@ MODULE_AUTHOR("Yannick Fertre <yannick.fertre@st.com>"); · 2148 unmodified lines | ||
| 2149 | 2149 | MODULE_AUTHOR("Hugues Fruchet <hugues.fruchet@st.com>"); |
| 2150 | 2150 | MODULE_DESCRIPTION("STMicroelectronics STM32 Digital Camera Memory Interface driver"); |
| 2151 | 2151 | MODULE_LICENSE("GPL"); |
| 2152 | −MODULE_SUPPORTED_DEVICE("video"); | |
| @@ -245,7 +245,7 @@ static int vsp1_du_pipeline_setup_brx(struct vsp1_device *vsp1, · 244 unmodified lines | ||
| 245 | 245 | brx = &vsp1->bru->entity; |
| 246 | 246 | else if (pipe->brx && !drm_pipe->force_brx_release) |
| 247 | 247 | brx = pipe->brx; |
| 248 | − else if (!vsp1->bru->entity.pipe) | |
| 248 | + else if (vsp1_feature(vsp1, VSP1_HAS_BRU) && !vsp1->bru->entity.pipe) | |
| 249 | 249 | brx = &vsp1->bru->entity; |
| 250 | 250 | else |
| 251 | 251 | brx = &vsp1->brs->entity; |
| @@ -462,9 +462,9 @@ static int vsp1_du_pipeline_setup_inputs(struct vsp1_device *vsp1, · 210 unmodified lines | ||
| 462 | 462 | * make sure it is present in the pipeline's list of entities if it |
| 463 | 463 | * wasn't already. |
| 464 | 464 | */ |
| 465 | − if (!use_uif) { | |
| 465 | + if (drm_pipe->uif && !use_uif) { | |
| 466 | 466 | drm_pipe->uif->pipe = NULL; |
| 467 | − } else if (!drm_pipe->uif->pipe) { | |
| 467 | + } else if (drm_pipe->uif && !drm_pipe->uif->pipe) { | |
| 468 | 468 | drm_pipe->uif->pipe = pipe; |
| 469 | 469 | list_add_tail(&drm_pipe->uif->list_pipe, &pipe->entities); |
| 470 | 470 | } |
| @@ -5,6 +5,7 @@ obj-y += keymaps/ · 4 unmodified lines | ||
| 5 | 5 | obj-$(CONFIG_RC_CORE) += rc-core.o |
| 6 | 6 | rc-core-y := rc-main.o rc-ir-raw.o |
| 7 | 7 | rc-core-$(CONFIG_LIRC) += lirc_dev.o |
| 8 | +rc-core-$(CONFIG_MEDIA_CEC_RC) += keymaps/rc-cec.o | |
| 8 | 9 | rc-core-$(CONFIG_BPF_LIRC_MODE2) += bpf-lirc.o |
| 9 | 10 | obj-$(CONFIG_IR_NEC_DECODER) += ir-nec-decoder.o |
| 10 | 11 | obj-$(CONFIG_IR_RC5_DECODER) += ir-rc5-decoder.o |
| @@ -21,7 +21,6 @@ obj-$(CONFIG_RC_MAP) += rc-adstech-dvb-t-pci.o \ · 20 unmodified lines | ||
| 21 | 21 | rc-behold.o \ |
| 22 | 22 | rc-behold-columbus.o \ |
| 23 | 23 | rc-budget-ci-old.o \ |
| 24 | − rc-cec.o \ | |
| 25 | 24 | rc-cinergy-1400.o \ |
| 26 | 25 | rc-cinergy.o \ |
| 27 | 26 | rc-d680-dmb.o \ |
| @@ -1,5 +1,15 @@ | ||
| 1 | 1 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 2 | 2 | /* Keytable for the CEC remote control |
| 3 | + * | |
| 4 | + * This keymap is unusual in that it can't be built as a module, | |
| 5 | + * instead it is registered directly in rc-main.c if CONFIG_MEDIA_CEC_RC | |
| 6 | + * is set. This is because it can be called from drm_dp_cec_set_edid() via | |
| 7 | + * cec_register_adapter() in an asynchronous context, and it is not | |
| 8 | + * allowed to use request_module() to load rc-cec.ko in that case. | |
| 9 | + * | |
| 10 | + * Since this keymap is only used if CONFIG_MEDIA_CEC_RC is set, we | |
| 11 | + * just compile this keymap into the rc-core module and never as a | |
| 12 | + * separate module. | |
| 3 | 13 | * |
| 4 | 14 | * Copyright (c) 2015 by Kamil Debski |
| 5 | 15 | */ |
| @@ -152,7 +162,7 @@ static struct rc_map_table cec[] = { · 146 unmodified lines | ||
| 152 | 162 | /* 0x77-0xff: Reserved */ |
| 153 | 163 | }; |
| 154 | 164 | |
| 155 | −static struct rc_map_list cec_map = { | |
| 165 | +struct rc_map_list cec_map = { | |
| 156 | 166 | .map = { |
| 157 | 167 | .scan = cec, |
| 158 | 168 | .size = ARRAY_SIZE(cec), |
| @@ -160,19 +170,3 @@ static struct rc_map_list cec_map = { · 1 unmodified line | ||
| 160 | 170 | .name = RC_MAP_CEC, |
| 161 | 171 | } |
| 162 | 172 | }; |
| 163 | − | |
| 164 | −static int __init init_rc_map_cec(void) | |
| 165 | −{ | |
| 166 | − return rc_map_register(&cec_map); | |
| 167 | −} | |
| 168 | − | |
| 169 | −static void __exit exit_rc_map_cec(void) | |
| 170 | −{ | |
| 171 | − rc_map_unregister(&cec_map); | |
| 172 | −} | |
| 173 | − | |
| 174 | −module_init(init_rc_map_cec); | |
| 175 | −module_exit(exit_rc_map_cec); | |
| 176 | − | |
| 177 | −MODULE_LICENSE("GPL"); | |
| 178 | −MODULE_AUTHOR("Kamil Debski"); | |
| @@ -2069,6 +2069,9 @@ static int __init rc_core_init(void) · 2068 unmodified lines | ||
| 2069 | 2069 | |
| 2070 | 2070 | led_trigger_register_simple("rc-feedback", &led_feedback); |
| 2071 | 2071 | rc_map_register(&empty_map); |
| 2072 | +#ifdef CONFIG_MEDIA_CEC_RC | |
| 2073 | + rc_map_register(&cec_map); | |
| 2074 | +#endif | |
| 2072 | 2075 | |
| 2073 | 2076 | return 0; |
| 2074 | 2077 | } |
| @@ -2078,6 +2081,9 @@ static void __exit rc_core_exit(void) · 3 unmodified lines | ||
| 2078 | 2081 | lirc_dev_exit(); |
| 2079 | 2082 | class_unregister(&rc_class); |
| 2080 | 2083 | led_trigger_unregister_simple(led_feedback); |
| 2084 | +#ifdef CONFIG_MEDIA_CEC_RC | |
| 2085 | + rc_map_unregister(&cec_map); | |
| 2086 | +#endif | |
| 2081 | 2087 | rc_map_unregister(&empty_map); |
| 2082 | 2088 | } |
| 2083 | 2089 | |
| @@ -56,7 +56,6 @@ MODULE_PARM_DESC(flicker_mode, "Flicker frequency (0 (disabled), " __stringify(5 · 55 unmodified lines | ||
| 56 | 56 | |
| 57 | 57 | MODULE_AUTHOR("Steve Miller (STMicroelectronics) <steve.miller@st.com>"); |
| 58 | 58 | MODULE_DESCRIPTION("V4L-driver for STMicroelectronics CPiA2 based cameras"); |
| 59 | −MODULE_SUPPORTED_DEVICE("video"); | |
| 60 | 59 | MODULE_LICENSE("GPL"); |
| 61 | 60 | MODULE_VERSION(CPIA_VERSION); |
| 62 | 61 | |
| @@ -51,7 +51,6 @@ MODULE_PARM_DESC(index, "Index value for tm6000x capture interface(s)."); · 50 unmodified lines | ||
| 51 | 51 | MODULE_DESCRIPTION("ALSA driver module for tm5600/tm6000/tm6010 based TV cards"); |
| 52 | 52 | MODULE_AUTHOR("Mauro Carvalho Chehab"); |
| 53 | 53 | MODULE_LICENSE("GPL v2"); |
| 54 | −MODULE_SUPPORTED_DEVICE("{{Trident,tm5600},{{Trident,tm6000},{{Trident,tm6010}"); | |
| 55 | 54 | static unsigned int debug; |
| 56 | 55 | module_param(debug, int, 0644); |
| 57 | 56 | MODULE_PARM_DESC(debug, "enable debug messages"); |
| @@ -23,8 +23,6 @@ MODULE_DESCRIPTION("DVB driver extension module for tm5600/6000/6010 based TV ca · 22 unmodified lines | ||
| 23 | 23 | MODULE_AUTHOR("Mauro Carvalho Chehab"); |
| 24 | 24 | MODULE_LICENSE("GPL"); |
| 25 | 25 | |
| 26 | −MODULE_SUPPORTED_DEVICE("{{Trident, tm5600},{{Trident, tm6000},{{Trident, tm6010}"); | |
| 27 | − | |
| 28 | 26 | static int debug; |
| 29 | 27 | |
| 30 | 28 | module_param(debug, int, 0644); |
| @@ -371,7 +371,7 @@ void usbtv_audio_free(struct usbtv *usbtv) · 370 unmodified lines | ||
| 371 | 371 | cancel_work_sync(&usbtv->snd_trigger); |
| 372 | 372 | |
| 373 | 373 | if (usbtv->snd && usbtv->udev) { |
| 374 | − snd_card_free(usbtv->snd); | |
| 374 | + snd_card_free_when_closed(usbtv->snd); | |
| 375 | 375 | usbtv->snd = NULL; |
| 376 | 376 | } |
| 377 | 377 | } |
| @@ -72,7 +72,8 @@ static const struct dmi_system_id dmi_platform_info[] = { · 71 unmodified lines | ||
| 72 | 72 | {} |
| 73 | 73 | }; |
| 74 | 74 | |
| 75 | −static const struct resource intel_quark_i2c_res[] = { | |
| 75 | +/* This is used as a place holder and will be modified at run-time */ | |
| 76 | +static struct resource intel_quark_i2c_res[] = { | |
| 76 | 77 | [INTEL_QUARK_IORES_MEM] = { |
| 77 | 78 | .flags = IORESOURCE_MEM, |
| 78 | 79 | }, |
| @@ -85,7 +86,8 @@ static struct mfd_cell_acpi_match intel_quark_acpi_match_i2c = { · 6 unmodified lines | ||
| 85 | 86 | .adr = MFD_ACPI_MATCH_I2C, |
| 86 | 87 | }; |
| 87 | 88 | |
| 88 | −static const struct resource intel_quark_gpio_res[] = { | |
| 89 | +/* This is used as a place holder and will be modified at run-time */ | |
| 90 | +static struct resource intel_quark_gpio_res[] = { | |
| 89 | 91 | [INTEL_QUARK_IORES_MEM] = { |
| 90 | 92 | .flags = IORESOURCE_MEM, |
| 91 | 93 | }, |
| @@ -950,6 +950,11 @@ static int fastrpc_internal_invoke(struct fastrpc_user *fl, u32 kernel, · 949 unmodified lines | ||
| 950 | 950 | if (!fl->cctx->rpdev) |
| 951 | 951 | return -EPIPE; |
| 952 | 952 | |
| 953 | + if (handle == FASTRPC_INIT_HANDLE && !kernel) { | |
| 954 | + dev_warn_ratelimited(fl->sctx->dev, "user app trying to send a kernel RPC message (%d)\n", handle); | |
| 955 | + return -EPERM; | |
| 956 | + } | |
| 957 | + | |
| 953 | 958 | ctx = fastrpc_context_alloc(fl, kernel, sc, args); |
| 954 | 959 | if (IS_ERR(ctx)) |
| 955 | 960 | return PTR_ERR(ctx); |
| @@ -992,7 +992,6 @@ void hl_debugfs_add_device(struct hl_device *hdev) · 991 unmodified lines | ||
| 992 | 992 | struct hl_dbg_device_entry *dev_entry = &hdev->hl_debugfs; |
| 993 | 993 | int count = ARRAY_SIZE(hl_debugfs_list); |
| 994 | 994 | struct hl_debugfs_entry *entry; |
| 995 | − struct dentry *ent; | |
| 996 | 995 | int i; |
| 997 | 996 | |
| 998 | 997 | dev_entry->hdev = hdev; |
| @@ -1105,13 +1104,11 @@ void hl_debugfs_add_device(struct hl_device *hdev) · 106 unmodified lines | ||
| 1105 | 1104 | &hl_security_violations_fops); |
| 1106 | 1105 | |
| 1107 | 1106 | for (i = 0, entry = dev_entry->entry_arr ; i < count ; i++, entry++) { |
| 1108 | − | |
| 1109 | − ent = debugfs_create_file(hl_debugfs_list[i].name, | |
| 1107 | + debugfs_create_file(hl_debugfs_list[i].name, | |
| 1110 | 1108 | 0444, |
| 1111 | 1109 | dev_entry->root, |
| 1112 | 1110 | entry, |
| 1113 | 1111 | &hl_debugfs_fops); |
| 1114 | − entry->dent = ent; | |
| 1115 | 1112 | entry->info_ent = &hl_debugfs_list[i]; |
| 1116 | 1113 | entry->dev_entry = dev_entry; |
| 1117 | 1114 | } |
| @@ -93,12 +93,19 @@ void hl_hpriv_put(struct hl_fpriv *hpriv) · 92 unmodified lines | ||
| 93 | 93 | static int hl_device_release(struct inode *inode, struct file *filp) |
| 94 | 94 | { |
| 95 | 95 | struct hl_fpriv *hpriv = filp->private_data; |
| 96 | + struct hl_device *hdev = hpriv->hdev; | |
| 97 | + | |
| 98 | + filp->private_data = NULL; | |
| 99 | + | |
| 100 | + if (!hdev) { | |
| 101 | + pr_crit("Closing FD after device was removed. Memory leak will occur and it is advised to reboot.\n"); | |
| 102 | + put_pid(hpriv->taskpid); | |
| 103 | + return 0; | |
| 104 | + } | |
| 96 | 105 | |
| 97 | 106 | hl_cb_mgr_fini(hpriv->hdev, &hpriv->cb_mgr); |
| 98 | 107 | hl_ctx_mgr_fini(hpriv->hdev, &hpriv->ctx_mgr); |
| 99 | 108 | |
| 100 | − filp->private_data = NULL; | |
| 101 | − | |
| 102 | 109 | hl_hpriv_put(hpriv); |
| 103 | 110 | |
| 104 | 111 | return 0; |
| @@ -107,15 +114,20 @@ static int hl_device_release(struct inode *inode, struct file *filp) · 2 unmodified lines | ||
| 107 | 114 | static int hl_device_release_ctrl(struct inode *inode, struct file *filp) |
| 108 | 115 | { |
| 109 | 116 | struct hl_fpriv *hpriv = filp->private_data; |
| 110 | − struct hl_device *hdev; | |
| 117 | + struct hl_device *hdev = hpriv->hdev; | |
| 111 | 118 | |
| 112 | 119 | filp->private_data = NULL; |
| 113 | 120 | |
| 114 | − hdev = hpriv->hdev; | |
| 121 | + if (!hdev) { | |
| 122 | + pr_err("Closing FD after device was removed\n"); | |
| 123 | + goto out; | |
| 124 | + } | |
| 115 | 125 | |
| 116 | 126 | mutex_lock(&hdev->fpriv_list_lock); |
| 117 | 127 | list_del(&hpriv->dev_node); |
| 118 | 128 | mutex_unlock(&hdev->fpriv_list_lock); |
| 129 | +out: | |
| 130 | + put_pid(hpriv->taskpid); | |
| 119 | 131 | |
| 120 | 132 | kfree(hpriv); |
| 121 | 133 | |
| @@ -134,8 +146,14 @@ static int hl_device_release_ctrl(struct inode *inode, struct file *filp) · 12 unmodified lines | ||
| 134 | 146 | static int hl_mmap(struct file *filp, struct vm_area_struct *vma) |
| 135 | 147 | { |
| 136 | 148 | struct hl_fpriv *hpriv = filp->private_data; |
| 149 | + struct hl_device *hdev = hpriv->hdev; | |
| 137 | 150 | unsigned long vm_pgoff; |
| 138 | 151 | |
| 152 | + if (!hdev) { | |
| 153 | + pr_err_ratelimited("Trying to mmap after device was removed! Please close FD\n"); | |
| 154 | + return -ENODEV; | |
| 155 | + } | |
| 156 | + | |
| 139 | 157 | vm_pgoff = vma->vm_pgoff; |
| 140 | 158 | vma->vm_pgoff = HL_MMAP_OFFSET_VALUE_GET(vm_pgoff); |
| 141 | 159 | |
| @@ -883,6 +901,16 @@ wait_for_processes: · 741 unmodified lines | ||
| 883 | 901 | return -EBUSY; |
| 884 | 902 | } |
| 885 | 903 | |
| 904 | +static void device_disable_open_processes(struct hl_device *hdev) | |
| 905 | +{ | |
| 906 | + struct hl_fpriv *hpriv; | |
| 907 | + | |
| 908 | + mutex_lock(&hdev->fpriv_list_lock); | |
| 909 | + list_for_each_entry(hpriv, &hdev->fpriv_list, dev_node) | |
| 910 | + hpriv->hdev = NULL; | |
| 911 | + mutex_unlock(&hdev->fpriv_list_lock); | |
| 912 | +} | |
| 913 | + | |
| 886 | 914 | /* |
| 887 | 915 | * hl_device_reset - reset the device |
| 888 | 916 | * |
| @@ -1556,8 +1584,10 @@ void hl_device_fini(struct hl_device *hdev) · 667 unmodified lines | ||
| 1556 | 1584 | HL_PENDING_RESET_LONG_SEC); |
| 1557 | 1585 | |
| 1558 | 1586 | rc = device_kill_open_processes(hdev, HL_PENDING_RESET_LONG_SEC); |
| 1559 | − if (rc) | |
| 1587 | + if (rc) { | |
| 1560 | 1588 | dev_crit(hdev->dev, "Failed to kill all open processes\n"); |
| 1589 | + device_disable_open_processes(hdev); | |
| 1590 | + } | |
| 1561 | 1591 | |
| 1562 | 1592 | hl_cb_pool_fini(hdev); |
| 1563 | 1593 | |
| @@ -1465,12 +1465,10 @@ struct hl_info_list { · 1464 unmodified lines | ||
| 1465 | 1465 | |
| 1466 | 1466 | /** |
| 1467 | 1467 | * struct hl_debugfs_entry - debugfs dentry wrapper. |
| 1468 | − * @dent: base debugfs entry structure. | |
| 1469 | 1468 | * @info_ent: dentry realted ops. |
| 1470 | 1469 | * @dev_entry: ASIC specific debugfs manager. |
| 1471 | 1470 | */ |
| 1472 | 1471 | struct hl_debugfs_entry { |
| 1473 | − struct dentry *dent; | |
| 1474 | 1472 | const struct hl_info_list *info_ent; |
| 1475 | 1473 | struct hl_dbg_device_entry *dev_entry; |
| 1476 | 1474 | }; |
| @@ -5,6 +5,8 @@ · 4 unmodified lines | ||
| 5 | 5 | * All Rights Reserved. |
| 6 | 6 | */ |
| 7 | 7 | |
| 8 | +#define pr_fmt(fmt) "habanalabs: " fmt | |
| 9 | + | |
| 8 | 10 | #include <uapi/misc/habanalabs.h> |
| 9 | 11 | #include "habanalabs.h" |
| 10 | 12 | |
| @@ -682,6 +684,11 @@ long hl_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) · 671 unmodified lines | ||
| 682 | 684 | const struct hl_ioctl_desc *ioctl = NULL; |
| 683 | 685 | unsigned int nr = _IOC_NR(cmd); |
| 684 | 686 | |
| 687 | + if (!hdev) { | |
| 688 | + pr_err_ratelimited("Sending ioctl after device was removed! Please close FD\n"); | |
| 689 | + return -ENODEV; | |
| 690 | + } | |
| 691 | + | |
| 685 | 692 | if ((nr >= HL_COMMAND_START) && (nr < HL_COMMAND_END)) { |
| 686 | 693 | ioctl = &hl_ioctls[nr]; |
| 687 | 694 | } else { |
| @@ -700,6 +707,11 @@ long hl_ioctl_control(struct file *filep, unsigned int cmd, unsigned long arg) · 12 unmodified lines | ||
| 700 | 707 | const struct hl_ioctl_desc *ioctl = NULL; |
| 701 | 708 | unsigned int nr = _IOC_NR(cmd); |
| 702 | 709 | |
| 710 | + if (!hdev) { | |
| 711 | + pr_err_ratelimited("Sending ioctl after device was removed! Please close FD\n"); | |
| 712 | + return -ENODEV; | |
| 713 | + } | |
| 714 | + | |
| 703 | 715 | if (nr == _IOC_NR(HL_IOCTL_INFO)) { |
| 704 | 716 | ioctl = &hl_ioctls_control[nr]; |
| 705 | 717 | } else { |
| @@ -47,7 +47,7 @@ inline u32 hl_cq_inc_ptr(u32 ptr) · 46 unmodified lines | ||
| 47 | 47 | * Increment ptr by 1. If it reaches the number of event queue |
| 48 | 48 | * entries, set it to 0 |
| 49 | 49 | */ |
| 50 | −inline u32 hl_eq_inc_ptr(u32 ptr) | |
| 50 | +static inline u32 hl_eq_inc_ptr(u32 ptr) | |
| 51 | 51 | { |
| 52 | 52 | ptr++; |
| 53 | 53 | if (unlikely(ptr == HL_EQ_LENGTH)) |
| @@ -499,18 +499,32 @@ static void hl_mmu_pa_page_with_offset(struct hl_ctx *ctx, u64 virt_addr, · 498 unmodified lines | ||
| 499 | 499 | else /* HL_VA_RANGE_TYPE_DRAM */ |
| 500 | 500 | p = &prop->dmmu; |
| 501 | 501 | |
| 502 | − /* | |
| 503 | − * find the correct hop shift field in hl_mmu_properties structure | |
| 504 | − * in order to determine the right maks for the page offset. | |
| 505 | − */ | |
| 506 | − hop0_shift_off = offsetof(struct hl_mmu_properties, hop0_shift); | |
| 507 | − p = (char *)p + hop0_shift_off; | |
| 508 | − p = (char *)p + ((hops->used_hops - 1) * sizeof(u64)); | |
| 509 | − hop_shift = *(u64 *)p; | |
| 510 | − offset_mask = (1ull << hop_shift) - 1; | |
| 511 | − addr_mask = ~(offset_mask); | |
| 512 | − *phys_addr = (tmp_phys_addr & addr_mask) | | |
| 513 | − (virt_addr & offset_mask); | |
| 502 | + if ((hops->range_type == HL_VA_RANGE_TYPE_DRAM) && | |
| 503 | + !is_power_of_2(prop->dram_page_size)) { | |
| 504 | + u32 bit; | |
| 505 | + u64 page_offset_mask; | |
| 506 | + u64 phys_addr_mask; | |
| 507 | + | |
| 508 | + bit = __ffs64((u64)prop->dram_page_size); | |
| 509 | + page_offset_mask = ((1ull << bit) - 1); | |
| 510 | + phys_addr_mask = ~page_offset_mask; | |
| 511 | + *phys_addr = (tmp_phys_addr & phys_addr_mask) | | |
| 512 | + (virt_addr & page_offset_mask); | |
| 513 | + } else { | |
| 514 | + /* | |
| 515 | + * find the correct hop shift field in hl_mmu_properties | |
| 516 | + * structure in order to determine the right masks | |
| 517 | + * for the page offset. | |
| 518 | + */ | |
| 519 | + hop0_shift_off = offsetof(struct hl_mmu_properties, hop0_shift); | |
| 520 | + p = (char *)p + hop0_shift_off; | |
| 521 | + p = (char *)p + ((hops->used_hops - 1) * sizeof(u64)); | |
| 522 | + hop_shift = *(u64 *)p; | |
| 523 | + offset_mask = (1ull << hop_shift) - 1; | |
| 524 | + addr_mask = ~(offset_mask); | |
| 525 | + *phys_addr = (tmp_phys_addr & addr_mask) | | |
| 526 | + (virt_addr & offset_mask); | |
| 527 | + } | |
| 514 | 528 | } |
| 515 | 529 | |
| 516 | 530 | int hl_mmu_va_to_pa(struct hl_ctx *ctx, u64 virt_addr, u64 *phys_addr) |
| @@ -2288,15 +2288,13 @@ crq_failed: · 2287 unmodified lines | ||
| 2288 | 2288 | return -EPERM; |
| 2289 | 2289 | } |
| 2290 | 2290 | |
| 2291 | −static int ibmvmc_remove(struct vio_dev *vdev) | |
| 2291 | +static void ibmvmc_remove(struct vio_dev *vdev) | |
| 2292 | 2292 | { |
| 2293 | 2293 | struct crq_server_adapter *adapter = dev_get_drvdata(&vdev->dev); |
| 2294 | 2294 | |
| 2295 | 2295 | dev_info(adapter->dev, "Entering remove for UA 0x%x\n", |
| 2296 | 2296 | vdev->unit_address); |
| 2297 | 2297 | ibmvmc_release_crq_queue(adapter); |
| 2298 | − | |
| 2299 | − return 0; | |
| 2300 | 2298 | } |
| 2301 | 2299 | |
| 2302 | 2300 | static struct vio_device_id ibmvmc_device_table[] = { |
| @@ -2286,8 +2286,8 @@ int mei_cl_dma_alloc_and_map(struct mei_cl *cl, const struct file *fp, · 2285 unmodified lines | ||
| 2286 | 2286 | if (buffer_id == 0) |
| 2287 | 2287 | return -EINVAL; |
| 2288 | 2288 | |
| 2289 | − if (!mei_cl_is_connected(cl)) | |
| 2290 | − return -ENODEV; | |
| 2289 | + if (mei_cl_is_connected(cl)) | |
| 2290 | + return -EPROTO; | |
| 2291 | 2291 | |
| 2292 | 2292 | if (cl->dma_mapped) |
| 2293 | 2293 | return -EPROTO; |
| @@ -2327,9 +2327,7 @@ int mei_cl_dma_alloc_and_map(struct mei_cl *cl, const struct file *fp, · 33 unmodified lines | ||
| 2327 | 2327 | |
| 2328 | 2328 | mutex_unlock(&dev->device_lock); |
| 2329 | 2329 | wait_event_timeout(cl->wait, |
| 2330 | − cl->dma_mapped || | |
| 2331 | − cl->status || | |
| 2332 | − !mei_cl_is_connected(cl), | |
| 2330 | + cl->dma_mapped || cl->status, | |
| 2333 | 2331 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); |
| 2334 | 2332 | mutex_lock(&dev->device_lock); |
| 2335 | 2333 | |
| @@ -2376,8 +2374,9 @@ int mei_cl_dma_unmap(struct mei_cl *cl, const struct file *fp) · 40 unmodified lines | ||
| 2376 | 2374 | return -EOPNOTSUPP; |
| 2377 | 2375 | } |
| 2378 | 2376 | |
| 2379 | − if (!mei_cl_is_connected(cl)) | |
| 2380 | − return -ENODEV; | |
| 2377 | + /* do not allow unmap for connected client */ | |
| 2378 | + if (mei_cl_is_connected(cl)) | |
| 2379 | + return -EPROTO; | |
| 2381 | 2380 | |
| 2382 | 2381 | if (!cl->dma_mapped) |
| 2383 | 2382 | return -EPROTO; |
| @@ -2405,9 +2404,7 @@ int mei_cl_dma_unmap(struct mei_cl *cl, const struct file *fp) · 21 unmodified lines | ||
| 2405 | 2404 | |
| 2406 | 2405 | mutex_unlock(&dev->device_lock); |
| 2407 | 2406 | wait_event_timeout(cl->wait, |
| 2408 | − !cl->dma_mapped || | |
| 2409 | − cl->status || | |
| 2410 | − !mei_cl_is_connected(cl), | |
| 2407 | + !cl->dma_mapped || cl->status, | |
| 2411 | 2408 | mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); |
| 2412 | 2409 | mutex_lock(&dev->device_lock); |
| 2413 | 2410 | |
| @@ -140,6 +140,7 @@ static const struct of_device_id pvpanic_mmio_match[] = { · 139 unmodified lines | ||
| 140 | 140 | { .compatible = "qemu,pvpanic-mmio", }, |
| 141 | 141 | {} |
| 142 | 142 | }; |
| 143 | +MODULE_DEVICE_TABLE(of, pvpanic_mmio_match); | |
| 143 | 144 | |
| 144 | 145 | static const struct acpi_device_id pvpanic_device_ids[] = { |
| 145 | 146 | { "QEMU0001", 0 }, |
| @@ -399,11 +399,6 @@ void mmc_remove_card(struct mmc_card *card) · 398 unmodified lines | ||
| 399 | 399 | mmc_remove_card_debugfs(card); |
| 400 | 400 | #endif |
| 401 | 401 | |
| 402 | − if (host->cqe_enabled) { | |
| 403 | − host->cqe_ops->cqe_disable(host); | |
| 404 | − host->cqe_enabled = false; | |
| 405 | − } | |
| 406 | − | |
| 407 | 402 | if (mmc_card_present(card)) { |
| 408 | 403 | if (mmc_host_is_spi(card->host)) { |
| 409 | 404 | pr_info("%s: SPI card removed\n", |
| @@ -416,6 +411,10 @@ void mmc_remove_card(struct mmc_card *card) · 6 unmodified lines | ||
| 416 | 411 | of_node_put(card->dev.of_node); |
| 417 | 412 | } |
| 418 | 413 | |
| 414 | + if (host->cqe_enabled) { | |
| 415 | + host->cqe_ops->cqe_disable(host); | |
| 416 | + host->cqe_enabled = false; | |
| 417 | + } | |
| 418 | + | |
| 419 | 419 | put_device(&card->dev); |
| 420 | 420 | } |
| 421 | − | |
| @@ -423,10 +423,6 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) · 422 unmodified lines | ||
| 423 | 423 | |
| 424 | 424 | /* EXT_CSD value is in units of 10ms, but we store in ms */ |
| 425 | 425 | card->ext_csd.part_time = 10 * ext_csd[EXT_CSD_PART_SWITCH_TIME]; |
| 426 | − /* Some eMMC set the value too low so set a minimum */ | |
| 427 | − if (card->ext_csd.part_time && | |
| 428 | − card->ext_csd.part_time < MMC_MIN_PART_SWITCH_TIME) | |
| 429 | − card->ext_csd.part_time = MMC_MIN_PART_SWITCH_TIME; | |
| 430 | 426 | |
| 431 | 427 | /* Sleep / awake timeout in 100ns units */ |
| 432 | 428 | if (sa_shift > 0 && sa_shift <= 0x17) |
| @@ -616,6 +612,17 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd) · 183 unmodified lines | ||
| 616 | 612 | card->ext_csd.data_sector_size = 512; |
| 617 | 613 | } |
| 618 | 614 | |
| 615 | + /* | |
| 616 | + * GENERIC_CMD6_TIME is to be used "unless a specific timeout is defined | |
| 617 | + * when accessing a specific field", so use it here if there is no | |
| 618 | + * PARTITION_SWITCH_TIME. | |
| 619 | + */ | |
| 620 | + if (!card->ext_csd.part_time) | |
| 621 | + card->ext_csd.part_time = card->ext_csd.generic_cmd6_time; | |
| 622 | + /* Some eMMC set the value too low so set a minimum */ | |
| 623 | + if (card->ext_csd.part_time < MMC_MIN_PART_SWITCH_TIME) | |
| 624 | + card->ext_csd.part_time = MMC_MIN_PART_SWITCH_TIME; | |
| 625 | + | |
| 619 | 626 | /* eMMC v5 or later */ |
| 620 | 627 | if (card->ext_csd.rev >= 7) { |
| 621 | 628 | memcpy(card->ext_csd.fwrev, &ext_csd[EXT_CSD_FIRMWARE_VERSION], |
| @@ -1242,7 +1242,11 @@ mmci_start_command(struct mmci_host *host, struct mmc_command *cmd, u32 c) · 1241 unmodified lines | ||
| 1242 | 1242 | if (!cmd->busy_timeout) |
| 1243 | 1243 | cmd->busy_timeout = 10 * MSEC_PER_SEC; |
| 1244 | 1244 | |
| 1245 | − clks = (unsigned long long)cmd->busy_timeout * host->cclk; | |
| 1245 | + if (cmd->busy_timeout > host->mmc->max_busy_timeout) | |
| 1246 | + clks = (unsigned long long)host->mmc->max_busy_timeout * host->cclk; | |
| 1247 | + else | |
| 1248 | + clks = (unsigned long long)cmd->busy_timeout * host->cclk; | |
| 1249 | + | |
| 1246 | 1250 | do_div(clks, MSEC_PER_SEC); |
| 1247 | 1251 | writel_relaxed(clks, host->base + MMCIDATATIMER); |
| 1248 | 1252 | } |
| @@ -2151,6 +2155,10 @@ static int mmci_probe(struct amba_device *dev, · 902 unmodified lines | ||
| 2151 | 2155 | mmc->caps |= MMC_CAP_WAIT_WHILE_BUSY; |
| 2152 | 2156 | } |
| 2153 | 2157 | |
| 2158 | + /* Variants with mandatory busy timeout in HW needs R1B responses. */ | |
| 2159 | + if (variant->busy_timeout) | |
| 2160 | + mmc->caps |= MMC_CAP_NEED_RSP_BUSY; | |
| 2161 | + | |
| 2154 | 2162 | /* Prepare a CMD12 - needed to clear the DPSM on some variants. */ |
| 2155 | 2163 | host->stop_abort.opcode = MMC_STOP_TRANSMISSION; |
| 2156 | 2164 | host->stop_abort.arg = 0; |
| @@ -32,7 +32,6 @@ · 31 unmodified lines | ||
| 32 | 32 | |
| 33 | 33 | MODULE_AUTHOR("Eric Brower <ebrower@usa.net>"); |
| 34 | 34 | MODULE_DESCRIPTION("User-programmable flash device on Sun Microsystems boardsets"); |
| 35 | −MODULE_SUPPORTED_DEVICE(DRIVER_NAME); | |
| 36 | 35 | MODULE_LICENSE("GPL"); |
| 37 | 36 | MODULE_VERSION("2.1"); |
| 38 | 37 | |
| @@ -488,8 +488,8 @@ static int mtk_nfc_exec_instr(struct nand_chip *chip, · 487 unmodified lines | ||
| 488 | 488 | return 0; |
| 489 | 489 | case NAND_OP_WAITRDY_INSTR: |
| 490 | 490 | return readl_poll_timeout(nfc->regs + NFI_STA, status, |
| 491 | − status & STA_BUSY, 20, | |
| 492 | − instr->ctx.waitrdy.timeout_ms); | |
| 491 | + !(status & STA_BUSY), 20, | |
| 492 | + instr->ctx.waitrdy.timeout_ms * 1000); | |
| 493 | 493 | default: |
| 494 | 494 | break; |
| 495 | 495 | } |
| @@ -94,7 +94,7 @@ config WIREGUARD · 93 unmodified lines | ||
| 94 | 94 | select CRYPTO_BLAKE2S_ARM if ARM |
| 95 | 95 | select CRYPTO_CURVE25519_NEON if ARM && KERNEL_MODE_NEON |
| 96 | 96 | select CRYPTO_CHACHA_MIPS if CPU_MIPS32_R2 |
| 97 | − select CRYPTO_POLY1305_MIPS if CPU_MIPS32 || (CPU_MIPS64 && 64BIT) | |
| 97 | + select CRYPTO_POLY1305_MIPS if MIPS | |
| 98 | 98 | help |
| 99 | 99 | WireGuard is a secure, fast, and easy to use replacement for IPSec |
| 100 | 100 | that uses modern cryptography and clever networking tricks. It's |
| @@ -127,6 +127,8 @@ static int com20020pci_probe(struct pci_dev *pdev, · 126 unmodified lines | ||
| 127 | 127 | int i, ioaddr, ret; |
| 128 | 128 | struct resource *r; |
| 129 | 129 | |
| 130 | + ret = 0; | |
| 131 | + | |
| 130 | 132 | if (pci_enable_device(pdev)) |
| 131 | 133 | return -EIO; |
| 132 | 134 | |
| @@ -139,6 +141,8 @@ static int com20020pci_probe(struct pci_dev *pdev, · 6 unmodified lines | ||
| 139 | 141 | priv->ci = ci; |
| 140 | 142 | mm = &ci->misc_map; |
| 141 | 143 | |
| 144 | + pci_set_drvdata(pdev, priv); | |
| 145 | + | |
| 142 | 146 | INIT_LIST_HEAD(&priv->list_dev); |
| 143 | 147 | |
| 144 | 148 | if (mm->size) { |
| @@ -161,7 +165,7 @@ static int com20020pci_probe(struct pci_dev *pdev, · 16 unmodified lines | ||
| 161 | 165 | dev = alloc_arcdev(device); |
| 162 | 166 | if (!dev) { |
| 163 | 167 | ret = -ENOMEM; |
| 164 | − goto out_port; | |
| 168 | + break; | |
| 165 | 169 | } |
| 166 | 170 | dev->dev_port = i; |
| 167 | 171 | |
| @@ -178,7 +182,7 @@ static int com20020pci_probe(struct pci_dev *pdev, · 10 unmodified lines | ||
| 178 | 182 | pr_err("IO region %xh-%xh already allocated\n", |
| 179 | 183 | ioaddr, ioaddr + cm->size - 1); |
| 180 | 184 | ret = -EBUSY; |
| 181 | − goto out_port; | |
| 185 | + goto err_free_arcdev; | |
| 182 | 186 | } |
| 183 | 187 | |
| 184 | 188 | /* Dummy access after Reset |
| @@ -216,18 +220,18 @@ static int com20020pci_probe(struct pci_dev *pdev, · 31 unmodified lines | ||
| 216 | 220 | if (arcnet_inb(ioaddr, COM20020_REG_R_STATUS) == 0xFF) { |
| 217 | 221 | pr_err("IO address %Xh is empty!\n", ioaddr); |
| 218 | 222 | ret = -EIO; |
| 219 | − goto out_port; | |
| 223 | + goto err_free_arcdev; | |
| 220 | 224 | } |
| 221 | 225 | if (com20020_check(dev)) { |
| 222 | 226 | ret = -EIO; |
| 223 | − goto out_port; | |
| 227 | + goto err_free_arcdev; | |
| 224 | 228 | } |
| 225 | 229 | |
| 226 | 230 | card = devm_kzalloc(&pdev->dev, sizeof(struct com20020_dev), |
| 227 | 231 | GFP_KERNEL); |
| 228 | 232 | if (!card) { |
| 229 | 233 | ret = -ENOMEM; |
| 230 | − goto out_port; | |
| 234 | + goto err_free_arcdev; | |
| 231 | 235 | } |
| 232 | 236 | |
| 233 | 237 | card->index = i; |
| @@ -253,29 +257,29 @@ static int com20020pci_probe(struct pci_dev *pdev, · 19 unmodified lines | ||
| 253 | 257 | |
| 254 | 258 | ret = devm_led_classdev_register(&pdev->dev, &card->tx_led); |
| 255 | 259 | if (ret) |
| 256 | − goto out_port; | |
| 260 | + goto err_free_arcdev; | |
| 257 | 261 | |
| 258 | 262 | ret = devm_led_classdev_register(&pdev->dev, &card->recon_led); |
| 259 | 263 | if (ret) |
| 260 | − goto out_port; | |
| 264 | + goto err_free_arcdev; | |
| 261 | 265 | |
| 262 | 266 | dev_set_drvdata(&dev->dev, card); |
| 263 | 267 | |
| 264 | 268 | ret = com20020_found(dev, IRQF_SHARED); |
| 265 | 269 | if (ret) |
| 266 | − goto out_port; | |
| 270 | + goto err_free_arcdev; | |
| 267 | 271 | |
| 268 | 272 | devm_arcnet_led_init(dev, dev->dev_id, i); |
| 269 | 273 | |
| 270 | 274 | list_add(&card->list, &priv->list_dev); |
| 271 | − } | |
| 275 | + continue; | |
| 272 | 276 | |
| 273 | − pci_set_drvdata(pdev, priv); | |
| 274 | − | |
| 275 | − return 0; | |
| 276 | − | |
| 277 | −out_port: | |
| 278 | − com20020pci_remove(pdev); | |
| 277 | +err_free_arcdev: | |
| 278 | + free_arcdev(dev); | |
| 279 | + break; | |
| 280 | + } | |
| 281 | + if (ret) | |
| 282 | + com20020pci_remove(pdev); | |
| 279 | 283 | return ret; |
| 280 | 284 | } |
| 281 | 285 | |
| @@ -212,18 +212,6 @@ static const struct can_bittiming_const c_can_bittiming_const = { · 211 unmodified lines | ||
| 212 | 212 | .brp_inc = 1, |
| 213 | 213 | }; |
| 214 | 214 | |
| 215 | −static inline void c_can_pm_runtime_enable(const struct c_can_priv *priv) | |
| 216 | −{ | |
| 217 | − if (priv->device) | |
| 218 | − pm_runtime_enable(priv->device); | |
| 219 | −} | |
| 220 | − | |
| 221 | −static inline void c_can_pm_runtime_disable(const struct c_can_priv *priv) | |
| 222 | −{ | |
| 223 | − if (priv->device) | |
| 224 | − pm_runtime_disable(priv->device); | |
| 225 | −} | |
| 226 | − | |
| 227 | 215 | static inline void c_can_pm_runtime_get_sync(const struct c_can_priv *priv) |
| 228 | 216 | { |
| 229 | 217 | if (priv->device) |
| @@ -1335,7 +1323,6 @@ static const struct net_device_ops c_can_netdev_ops = { · 1105 unmodified lines | ||
| 1335 | 1323 | |
| 1336 | 1324 | int register_c_can_dev(struct net_device *dev) |
| 1337 | 1325 | { |
| 1338 | − struct c_can_priv *priv = netdev_priv(dev); | |
| 1339 | 1326 | int err; |
| 1340 | 1327 | |
| 1341 | 1328 | /* Deactivate pins to prevent DRA7 DCAN IP from being |
| @@ -1345,28 +1332,19 @@ int register_c_can_dev(struct net_device *dev) · 3 unmodified lines | ||
| 1345 | 1332 | */ |
| 1346 | 1333 | pinctrl_pm_select_sleep_state(dev->dev.parent); |
| 1347 | 1334 | |
| 1348 | − c_can_pm_runtime_enable(priv); | |
| 1349 | − | |
| 1350 | 1335 | dev->flags |= IFF_ECHO; /* we support local echo */ |
| 1351 | 1336 | dev->netdev_ops = &c_can_netdev_ops; |
| 1352 | 1337 | |
| 1353 | 1338 | err = register_candev(dev); |
| 1354 | − if (err) | |
| 1355 | − c_can_pm_runtime_disable(priv); | |
| 1356 | − else | |
| 1339 | + if (!err) | |
| 1357 | 1340 | devm_can_led_init(dev); |
| 1358 | − | |
| 1359 | 1341 | return err; |
| 1360 | 1342 | } |
| 1361 | 1343 | EXPORT_SYMBOL_GPL(register_c_can_dev); |
| 1362 | 1344 | |
| 1363 | 1345 | void unregister_c_can_dev(struct net_device *dev) |
| 1364 | 1346 | { |
| 1365 | − struct c_can_priv *priv = netdev_priv(dev); | |
| 1366 | − | |
| 1367 | 1347 | unregister_candev(dev); |
| 1368 | − | |
| 1369 | − c_can_pm_runtime_disable(priv); | |
| 1370 | 1348 | } |
| 1371 | 1349 | EXPORT_SYMBOL_GPL(unregister_c_can_dev); |
| 1372 | 1350 | |
| @@ -239,12 +239,13 @@ static void c_can_pci_remove(struct pci_dev *pdev) · 238 unmodified lines | ||
| 239 | 239 | { |
| 240 | 240 | struct net_device *dev = pci_get_drvdata(pdev); |
| 241 | 241 | struct c_can_priv *priv = netdev_priv(dev); |
| 242 | + void __iomem *addr = priv->base; | |
| 242 | 243 | |
| 243 | 244 | unregister_c_can_dev(dev); |
| 244 | 245 | |
| 245 | 246 | free_c_can_dev(dev); |
| 246 | 247 | |
| 247 | − pci_iounmap(pdev, priv->base); | |
| 248 | + pci_iounmap(pdev, addr); | |
| 248 | 249 | pci_disable_msi(pdev); |
| 249 | 250 | pci_clear_master(pdev); |
| 250 | 251 | pci_release_regions(pdev); |
| @@ -29,6 +29,7 @@ · 28 unmodified lines | ||
| 29 | 29 | #include <linux/list.h> |
| 30 | 30 | #include <linux/io.h> |
| 31 | 31 | #include <linux/platform_device.h> |
| 32 | +#include <linux/pm_runtime.h> | |
| 32 | 33 | #include <linux/clk.h> |
| 33 | 34 | #include <linux/of.h> |
| 34 | 35 | #include <linux/of_device.h> |
| @@ -386,6 +387,7 @@ static int c_can_plat_probe(struct platform_device *pdev) · 351 unmodified lines | ||
| 386 | 387 | platform_set_drvdata(pdev, dev); |
| 387 | 388 | SET_NETDEV_DEV(dev, &pdev->dev); |
| 388 | 389 | |
| 390 | + pm_runtime_enable(priv->device); | |
| 389 | 391 | ret = register_c_can_dev(dev); |
| 390 | 392 | if (ret) { |
| 391 | 393 | dev_err(&pdev->dev, "registering %s failed (err=%d)\n", |
| @@ -398,6 +400,7 @@ static int c_can_plat_probe(struct platform_device *pdev) · 6 unmodified lines | ||
| 398 | 400 | return 0; |
| 399 | 401 | |
| 400 | 402 | exit_free_device: |
| 403 | + pm_runtime_disable(priv->device); | |
| 401 | 404 | free_c_can_dev(dev); |
| 402 | 405 | exit: |
| 403 | 406 | dev_err(&pdev->dev, "probe failed\n"); |
| @@ -408,9 +411,10 @@ exit: · 4 unmodified lines | ||
| 408 | 411 | static int c_can_plat_remove(struct platform_device *pdev) |
| 409 | 412 | { |
| 410 | 413 | struct net_device *dev = platform_get_drvdata(pdev); |
| 414 | + struct c_can_priv *priv = netdev_priv(dev); | |
| 411 | 415 | |
| 412 | 416 | unregister_c_can_dev(dev); |
| 413 | − | |
| 417 | + pm_runtime_disable(priv->device); | |
| 414 | 418 | free_c_can_dev(dev); |
| 415 | 419 | |
| 416 | 420 | return 0; |
| @@ -355,6 +355,7 @@ static void can_dellink(struct net_device *dev, struct list_head *head) · 354 unmodified lines | ||
| 355 | 355 | |
| 356 | 356 | struct rtnl_link_ops can_link_ops __read_mostly = { |
| 357 | 357 | .kind = "can", |
| 358 | + .netns_refund = true, | |
| 358 | 359 | .maxtype = IFLA_CAN_MAX, |
| 359 | 360 | .policy = can_policy, |
| 360 | 361 | .setup = can_setup, |
| @@ -697,11 +697,17 @@ static int flexcan_chip_disable(struct flexcan_priv *priv) · 696 unmodified lines | ||
| 697 | 697 | static int flexcan_chip_freeze(struct flexcan_priv *priv) |
| 698 | 698 | { |
| 699 | 699 | struct flexcan_regs __iomem *regs = priv->regs; |
| 700 | − unsigned int timeout = 1000 * 1000 * 10 / priv->can.bittiming.bitrate; | |
| 700 | + unsigned int timeout; | |
| 701 | + u32 bitrate = priv->can.bittiming.bitrate; | |
| 701 | 702 | u32 reg; |
| 702 | 703 | |
| 704 | + if (bitrate) | |
| 705 | + timeout = 1000 * 1000 * 10 / bitrate; | |
| 706 | + else | |
| 707 | + timeout = FLEXCAN_TIMEOUT_US / 10; | |
| 708 | + | |
| 703 | 709 | reg = priv->read(®s->mcr); |
| 704 | − reg |= FLEXCAN_MCR_HALT; | |
| 710 | + reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT; | |
| 705 | 711 | priv->write(reg, ®s->mcr); |
| 706 | 712 | |
| 707 | 713 | while (timeout-- && !(priv->read(®s->mcr) & FLEXCAN_MCR_FRZ_ACK)) |
| @@ -1480,10 +1486,13 @@ static int flexcan_chip_start(struct net_device *dev) · 772 unmodified lines | ||
| 1480 | 1486 | |
| 1481 | 1487 | flexcan_set_bittiming(dev); |
| 1482 | 1488 | |
| 1489 | + /* set freeze, halt */ | |
| 1490 | + err = flexcan_chip_freeze(priv); | |
| 1491 | + if (err) | |
| 1492 | + goto out_chip_disable; | |
| 1493 | + | |
| 1483 | 1494 | /* MCR |
| 1484 | 1495 | * |
| 1485 | − * enable freeze | |
| 1486 | − * halt now | |
| 1487 | 1496 | * only supervisor access |
| 1488 | 1497 | * enable warning int |
| 1489 | 1498 | * enable individual RX masking |
| @@ -1492,9 +1501,8 @@ static int flexcan_chip_start(struct net_device *dev) · 2 unmodified lines | ||
| 1492 | 1501 | */ |
| 1493 | 1502 | reg_mcr = priv->read(®s->mcr); |
| 1494 | 1503 | reg_mcr &= ~FLEXCAN_MCR_MAXMB(0xff); |
| 1495 | − reg_mcr |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT | FLEXCAN_MCR_SUPV | | |
| 1496 | − FLEXCAN_MCR_WRN_EN | FLEXCAN_MCR_IRMQ | FLEXCAN_MCR_IDAM_C | | |
| 1497 | − FLEXCAN_MCR_MAXMB(priv->tx_mb_idx); | |
| 1504 | + reg_mcr |= FLEXCAN_MCR_SUPV | FLEXCAN_MCR_WRN_EN | FLEXCAN_MCR_IRMQ | | |
| 1505 | + FLEXCAN_MCR_IDAM_C | FLEXCAN_MCR_MAXMB(priv->tx_mb_idx); | |
| 1498 | 1506 | |
| 1499 | 1507 | /* MCR |
| 1500 | 1508 | * |
| @@ -1865,10 +1873,14 @@ static int register_flexcandev(struct net_device *dev) · 364 unmodified lines | ||
| 1865 | 1873 | if (err) |
| 1866 | 1874 | goto out_chip_disable; |
| 1867 | 1875 | |
| 1868 | − /* set freeze, halt and activate FIFO, restrict register access */ | |
| 1876 | + /* set freeze, halt */ | |
| 1877 | + err = flexcan_chip_freeze(priv); | |
| 1878 | + if (err) | |
| 1879 | + goto out_chip_disable; | |
| 1880 | + | |
| 1881 | + /* activate FIFO, restrict register access */ | |
| 1869 | 1882 | reg = priv->read(®s->mcr); |
| 1870 | − reg |= FLEXCAN_MCR_FRZ | FLEXCAN_MCR_HALT | | |
| 1871 | − FLEXCAN_MCR_FEN | FLEXCAN_MCR_SUPV; | |
| 1883 | + reg |= FLEXCAN_MCR_FEN | FLEXCAN_MCR_SUPV; | |
| 1872 | 1884 | priv->write(reg, ®s->mcr); |
| 1873 | 1885 | |
| 1874 | 1886 | /* Currently we only support newer versions of this core |
| @@ -57,6 +57,7 @@ MODULE_DESCRIPTION("CAN driver for Kvaser CAN/PCIe devices"); · 56 unmodified lines | ||
| 57 | 57 | #define KVASER_PCIEFD_KCAN_STAT_REG 0x418 |
| 58 | 58 | #define KVASER_PCIEFD_KCAN_MODE_REG 0x41c |
| 59 | 59 | #define KVASER_PCIEFD_KCAN_BTRN_REG 0x420 |
| 60 | +#define KVASER_PCIEFD_KCAN_BUS_LOAD_REG 0x424 | |
| 60 | 61 | #define KVASER_PCIEFD_KCAN_BTRD_REG 0x428 |
| 61 | 62 | #define KVASER_PCIEFD_KCAN_PWM_REG 0x430 |
| 62 | 63 | /* Loopback control register */ |
| @@ -949,6 +950,9 @@ static int kvaser_pciefd_setup_can_ctrls(struct kvaser_pciefd *pcie) · 886 unmodified lines | ||
| 949 | 950 | timer_setup(&can->bec_poll_timer, kvaser_pciefd_bec_poll_timer, |
| 950 | 951 | 0); |
| 951 | 952 | |
| 953 | + /* Disable Bus load reporting */ | |
| 954 | + iowrite32(0, can->reg_base + KVASER_PCIEFD_KCAN_BUS_LOAD_REG); | |
| 955 | + | |
| 952 | 956 | tx_npackets = ioread32(can->reg_base + |
| 953 | 957 | KVASER_PCIEFD_KCAN_TX_NPACKETS_REG); |
| 954 | 958 | if (((tx_npackets >> KVASER_PCIEFD_KCAN_TX_NPACKETS_MAX_SHIFT) & |
| @@ -501,9 +501,6 @@ static int m_can_do_rx_poll(struct net_device *dev, int quota) · 500 unmodified lines | ||
| 501 | 501 | } |
| 502 | 502 | |
| 503 | 503 | while ((rxfs & RXFS_FFL_MASK) && (quota > 0)) { |
| 504 | − if (rxfs & RXFS_RFL) | |
| 505 | − netdev_warn(dev, "Rx FIFO 0 Message Lost\n"); | |
| 506 | − | |
| 507 | 504 | m_can_read_fifo(dev, rxfs); |
| 508 | 505 | |
| 509 | 506 | quota--; |
| @@ -876,7 +873,7 @@ static int m_can_rx_peripheral(struct net_device *dev) · 366 unmodified lines | ||
| 876 | 873 | { |
| 877 | 874 | struct m_can_classdev *cdev = netdev_priv(dev); |
| 878 | 875 | |
| 879 | − m_can_rx_handler(dev, 1); | |
| 876 | + m_can_rx_handler(dev, M_CAN_NAPI_WEIGHT); | |
| 880 | 877 | |
| 881 | 878 | m_can_enable_all_interrupts(cdev); |
| 882 | 879 | |
| @@ -237,14 +237,14 @@ static int tcan4x5x_init(struct m_can_classdev *cdev) · 236 unmodified lines | ||
| 237 | 237 | if (ret) |
| 238 | 238 | return ret; |
| 239 | 239 | |
| 240 | + /* Zero out the MCAN buffers */ | |
| 241 | + m_can_init_ram(cdev); | |
| 242 | + | |
| 240 | 243 | ret = regmap_update_bits(tcan4x5x->regmap, TCAN4X5X_CONFIG, |
| 241 | 244 | TCAN4X5X_MODE_SEL_MASK, TCAN4X5X_MODE_NORMAL); |
| 242 | 245 | if (ret) |
| 243 | 246 | return ret; |
| 244 | 247 | |
| 245 | − /* Zero out the MCAN buffers */ | |
| 246 | − m_can_init_ram(cdev); | |
| 247 | − | |
| 248 | 248 | return ret; |
| 249 | 249 | } |
| 250 | 250 | |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); |
| 23 | 23 | MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCIe/M.2 FD family cards"); |
| 24 | −MODULE_SUPPORTED_DEVICE("PEAK PCAN PCIe/M.2 FD CAN cards"); | |
| 25 | 24 | MODULE_LICENSE("GPL v2"); |
| 26 | 25 | |
| 27 | 26 | #define PCIEFD_DRV_NAME "peak_pciefd" |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | MODULE_AUTHOR("Sebastian Haas <haas@ems-wuenche.com>"); |
| 23 | 23 | MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-PCI/PCIe/104P CAN cards"); |
| 24 | −MODULE_SUPPORTED_DEVICE("EMS CPC-PCI/PCIe/104P CAN card"); | |
| 25 | 24 | MODULE_LICENSE("GPL v2"); |
| 26 | 25 | |
| 27 | 26 | #define EMS_PCI_V1_MAX_CHAN 2 |
| @@ -21,7 +21,6 @@ · 20 unmodified lines | ||
| 21 | 21 | |
| 22 | 22 | MODULE_AUTHOR("Markus Plessing <plessing@ems-wuensche.com>"); |
| 23 | 23 | MODULE_DESCRIPTION("Socket-CAN driver for EMS CPC-CARD cards"); |
| 24 | −MODULE_SUPPORTED_DEVICE("EMS CPC-CARD CAN card"); | |
| 25 | 24 | MODULE_LICENSE("GPL v2"); |
| 26 | 25 | |
| 27 | 26 | #define EMS_PCMCIA_MAX_CHAN 2 |
| @@ -33,7 +33,6 @@ · 32 unmodified lines | ||
| 33 | 33 | |
| 34 | 34 | MODULE_AUTHOR("Per Dalen <per.dalen@cnw.se>"); |
| 35 | 35 | MODULE_DESCRIPTION("Socket-CAN driver for KVASER PCAN PCI cards"); |
| 36 | −MODULE_SUPPORTED_DEVICE("KVASER PCAN PCI CAN card"); | |
| 37 | 36 | MODULE_LICENSE("GPL v2"); |
| 38 | 37 | |
| 39 | 38 | #define MAX_NO_OF_CHANNELS 4 /* max no of channels on a single card */ |
| @@ -24,8 +24,6 @@ · 23 unmodified lines | ||
| 24 | 24 | |
| 25 | 25 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); |
| 26 | 26 | MODULE_DESCRIPTION("Socket-CAN driver for PEAK PCAN PCI family cards"); |
| 27 | −MODULE_SUPPORTED_DEVICE("PEAK PCAN PCI/PCIe/PCIeC miniPCI CAN cards"); | |
| 28 | −MODULE_SUPPORTED_DEVICE("PEAK PCAN miniPCIe/cPCI PC/104+ PCI/104e CAN Cards"); | |
| 29 | 27 | MODULE_LICENSE("GPL v2"); |
| 30 | 28 | |
| 31 | 29 | #define DRV_NAME "peak_pci" |
| @@ -22,7 +22,6 @@ · 21 unmodified lines | ||
| 22 | 22 | MODULE_AUTHOR("Stephane Grosjean <s.grosjean@peak-system.com>"); |
| 23 | 23 | MODULE_DESCRIPTION("CAN driver for PEAK-System PCAN-PC Cards"); |
| 24 | 24 | MODULE_LICENSE("GPL v2"); |
| 25 | −MODULE_SUPPORTED_DEVICE("PEAK PCAN-PC Card"); | |
| 26 | 25 | |
| 27 | 26 | /* PEAK-System PCMCIA driver name */ |
| 28 | 27 | #define PCC_NAME "peak_pcmcia" |
| @@ -25,18 +25,6 @@ · 24 unmodified lines | ||
| 25 | 25 | MODULE_AUTHOR("Pavel Cheblakov <P.B.Cheblakov@inp.nsk.su>"); |
| 26 | 26 | MODULE_DESCRIPTION("Socket-CAN driver for PLX90xx PCI-bridge cards with " |
| 27 | 27 | "the SJA1000 chips"); |
| 28 | −MODULE_SUPPORTED_DEVICE("Adlink PCI-7841/cPCI-7841, " | |
| 29 | − "Adlink PCI-7841/cPCI-7841 SE, " | |
| 30 | − "Marathon CAN-bus-PCI, " | |
| 31 | − "Marathon CAN-bus-PCIe, " | |
| 32 | − "TEWS TECHNOLOGIES TPMC810, " | |
| 33 | − "esd CAN-PCI/CPCI/PCI104/200, " | |
| 34 | − "esd CAN-PCI/PMC/266, " | |
| 35 | − "esd CAN-PCIe/2000, " | |
| 36 | − "Connect Tech Inc. CANpro/104-Plus Opto (CRG001), " | |
| 37 | − "IXXAT PC-I 04/PCI, " | |
| 38 | − "ELCUS CAN-200-PCI, " | |
| 39 | − "ASEM DUAL CAN-RAW") | |
| 40 | 28 | MODULE_LICENSE("GPL v2"); |
| 41 | 29 | |
| 42 | 30 | #define PLX_PCI_MAX_CHAN 2 |
| @@ -314,6 +314,18 @@ static int mcp251x_spi_trans(struct spi_device *spi, int len) · 313 unmodified lines | ||
| 314 | 314 | return ret; |
| 315 | 315 | } |
| 316 | 316 | |
| 317 | +static int mcp251x_spi_write(struct spi_device *spi, int len) | |
| 318 | +{ | |
| 319 | + struct mcp251x_priv *priv = spi_get_drvdata(spi); | |
| 320 | + int ret; | |
| 321 | + | |
| 322 | + ret = spi_write(spi, priv->spi_tx_buf, len); | |
| 323 | + if (ret) | |
| 324 | + dev_err(&spi->dev, "spi write failed: ret = %d\n", ret); | |
| 325 | + | |
| 326 | + return ret; | |
| 327 | +} | |
| 328 | + | |
| 317 | 329 | static u8 mcp251x_read_reg(struct spi_device *spi, u8 reg) |
| 318 | 330 | { |
| 319 | 331 | struct mcp251x_priv *priv = spi_get_drvdata(spi); |
| @@ -361,7 +373,7 @@ static void mcp251x_write_reg(struct spi_device *spi, u8 reg, u8 val) · 41 unmodified lines | ||
| 361 | 373 | priv->spi_tx_buf[1] = reg; |
| 362 | 374 | priv->spi_tx_buf[2] = val; |
| 363 | 375 | |
| 364 | − mcp251x_spi_trans(spi, 3); | |
| 376 | + mcp251x_spi_write(spi, 3); | |
| 365 | 377 | } |
| 366 | 378 | |
| 367 | 379 | static void mcp251x_write_2regs(struct spi_device *spi, u8 reg, u8 v1, u8 v2) |
| @@ -373,7 +385,7 @@ static void mcp251x_write_2regs(struct spi_device *spi, u8 reg, u8 v1, u8 v2) · 5 unmodified lines | ||
| 373 | 385 | priv->spi_tx_buf[2] = v1; |
| 374 | 386 | priv->spi_tx_buf[3] = v2; |
| 375 | 387 | |
| 376 | − mcp251x_spi_trans(spi, 4); | |
| 388 | + mcp251x_spi_write(spi, 4); | |
| 377 | 389 | } |
| 378 | 390 | |
| 379 | 391 | static void mcp251x_write_bits(struct spi_device *spi, u8 reg, |
| @@ -386,7 +398,7 @@ static void mcp251x_write_bits(struct spi_device *spi, u8 reg, · 6 unmodified lines | ||
| 386 | 398 | priv->spi_tx_buf[2] = mask; |
| 387 | 399 | priv->spi_tx_buf[3] = val; |
| 388 | 400 | |
| 389 | − mcp251x_spi_trans(spi, 4); | |
| 401 | + mcp251x_spi_write(spi, 4); | |
| 390 | 402 | } |
| 391 | 403 | |
| 392 | 404 | static u8 mcp251x_read_stat(struct spi_device *spi) |
| @@ -618,7 +630,7 @@ static void mcp251x_hw_tx_frame(struct spi_device *spi, u8 *buf, · 225 unmodified lines | ||
| 618 | 630 | buf[i]); |
| 619 | 631 | } else { |
| 620 | 632 | memcpy(priv->spi_tx_buf, buf, TXBDAT_OFF + len); |
| 621 | − mcp251x_spi_trans(spi, TXBDAT_OFF + len); | |
| 633 | + mcp251x_spi_write(spi, TXBDAT_OFF + len); | |
| 622 | 634 | } |
| 623 | 635 | } |
| 624 | 636 | |
| @@ -650,7 +662,7 @@ static void mcp251x_hw_tx(struct spi_device *spi, struct can_frame *frame, · 25 unmodified lines | ||
| 650 | 662 | |
| 651 | 663 | /* use INSTRUCTION_RTS, to avoid "repeated frame problem" */ |
| 652 | 664 | priv->spi_tx_buf[0] = INSTRUCTION_RTS(1 << tx_buf_idx); |
| 653 | − mcp251x_spi_trans(priv->spi, 1); | |
| 665 | + mcp251x_spi_write(priv->spi, 1); | |
| 654 | 666 | } |
| 655 | 667 | |
| 656 | 668 | static void mcp251x_hw_rx_frame(struct spi_device *spi, u8 *buf, |
| @@ -888,7 +900,7 @@ static int mcp251x_hw_reset(struct spi_device *spi) · 231 unmodified lines | ||
| 888 | 900 | mdelay(MCP251X_OST_DELAY_MS); |
| 889 | 901 | |
| 890 | 902 | priv->spi_tx_buf[0] = INSTRUCTION_RESET; |
| 891 | − ret = mcp251x_spi_trans(spi, 1); | |
| 903 | + ret = mcp251x_spi_write(spi, 1); | |
| 892 | 904 | if (ret) |
| 893 | 905 | return ret; |
| 894 | 906 | |
| @@ -335,8 +335,6 @@ static void mcp251xfd_ring_init(struct mcp251xfd_priv *priv) · 334 unmodified lines | ||
| 335 | 335 | u8 len; |
| 336 | 336 | int i, j; |
| 337 | 337 | |
| 338 | − netdev_reset_queue(priv->ndev); | |
| 339 | − | |
| 340 | 338 | /* TEF */ |
| 341 | 339 | tef_ring = priv->tef; |
| 342 | 340 | tef_ring->head = 0; |
| @@ -1249,8 +1247,7 @@ mcp251xfd_handle_tefif_recover(const struct mcp251xfd_priv *priv, const u32 seq) · 906 unmodified lines | ||
| 1249 | 1247 | |
| 1250 | 1248 | static int |
| 1251 | 1249 | mcp251xfd_handle_tefif_one(struct mcp251xfd_priv *priv, |
| 1252 | − const struct mcp251xfd_hw_tef_obj *hw_tef_obj, | |
| 1253 | − unsigned int *frame_len_ptr) | |
| 1250 | + const struct mcp251xfd_hw_tef_obj *hw_tef_obj) | |
| 1254 | 1251 | { |
| 1255 | 1252 | struct net_device_stats *stats = &priv->ndev->stats; |
| 1256 | 1253 | u32 seq, seq_masked, tef_tail_masked; |
| @@ -1272,8 +1269,7 @@ mcp251xfd_handle_tefif_one(struct mcp251xfd_priv *priv, · 15 unmodified lines | ||
| 1272 | 1269 | stats->tx_bytes += |
| 1273 | 1270 | can_rx_offload_get_echo_skb(&priv->offload, |
| 1274 | 1271 | mcp251xfd_get_tef_tail(priv), |
| 1275 | − hw_tef_obj->ts, | |
| 1276 | − frame_len_ptr); | |
| 1272 | + hw_tef_obj->ts, NULL); | |
| 1277 | 1273 | stats->tx_packets++; |
| 1278 | 1274 | priv->tef->tail++; |
| 1279 | 1275 | |
| @@ -1331,7 +1327,6 @@ mcp251xfd_tef_obj_read(const struct mcp251xfd_priv *priv, · 51 unmodified lines | ||
| 1331 | 1327 | static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv) |
| 1332 | 1328 | { |
| 1333 | 1329 | struct mcp251xfd_hw_tef_obj hw_tef_obj[MCP251XFD_TX_OBJ_NUM_MAX]; |
| 1334 | − unsigned int total_frame_len = 0; | |
| 1335 | 1330 | u8 tef_tail, len, l; |
| 1336 | 1331 | int err, i; |
| 1337 | 1332 | |
| @@ -1353,9 +1348,7 @@ static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv) · 15 unmodified lines | ||
| 1353 | 1348 | } |
| 1354 | 1349 | |
| 1355 | 1350 | for (i = 0; i < len; i++) { |
| 1356 | − unsigned int frame_len; | |
| 1357 | − | |
| 1358 | − err = mcp251xfd_handle_tefif_one(priv, &hw_tef_obj[i], &frame_len); | |
| 1351 | + err = mcp251xfd_handle_tefif_one(priv, &hw_tef_obj[i]); | |
| 1359 | 1352 | /* -EAGAIN means the Sequence Number in the TEF |
| 1360 | 1353 | * doesn't match our tef_tail. This can happen if we |
| 1361 | 1354 | * read the TEF objects too early. Leave loop let the |
| @@ -1365,8 +1358,6 @@ static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv) · 3 unmodified lines | ||
| 1365 | 1358 | goto out_netif_wake_queue; |
| 1366 | 1359 | if (err) |
| 1367 | 1360 | return err; |
| 1368 | − | |
| 1369 | − total_frame_len += frame_len; | |
| 1370 | 1361 | } |
| 1371 | 1362 | |
| 1372 | 1363 | out_netif_wake_queue: |
| @@ -1397,7 +1388,6 @@ static int mcp251xfd_handle_tefif(struct mcp251xfd_priv *priv) · 24 unmodified lines | ||
| 1397 | 1388 | return err; |
| 1398 | 1389 | |
| 1399 | 1390 | tx_ring->tail += len; |
| 1400 | − netdev_completed_queue(priv->ndev, len, total_frame_len); | |
| 1401 | 1391 | |
| 1402 | 1392 | err = mcp251xfd_check_tef_tail(priv); |
| 1403 | 1393 | if (err) |
| @@ -2443,7 +2433,6 @@ static netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb, · 1039 unmodified lines | ||
| 2443 | 2433 | struct mcp251xfd_priv *priv = netdev_priv(ndev); |
| 2444 | 2434 | struct mcp251xfd_tx_ring *tx_ring = priv->tx; |
| 2445 | 2435 | struct mcp251xfd_tx_obj *tx_obj; |
| 2446 | − unsigned int frame_len; | |
| 2447 | 2436 | u8 tx_head; |
| 2448 | 2437 | int err; |
| 2449 | 2438 | |
| @@ -2462,9 +2451,7 @@ static netdev_tx_t mcp251xfd_start_xmit(struct sk_buff *skb, · 12 unmodified lines | ||
| 2462 | 2451 | if (mcp251xfd_get_tx_free(tx_ring) == 0) |
| 2463 | 2452 | netif_stop_queue(ndev); |
| 2464 | 2453 | |
| 2465 | − frame_len = can_skb_get_frame_len(skb); | |
| 2466 | − can_put_echo_skb(skb, ndev, tx_head, frame_len); | |
| 2467 | − netdev_sent_queue(priv->ndev, frame_len); | |
| 2454 | + can_put_echo_skb(skb, ndev, tx_head, 0); | |
| 2468 | 2455 | |
| 2469 | 2456 | err = mcp251xfd_tx_obj_write(priv, tx_obj); |
| 2470 | 2457 | if (err) |
| @@ -73,6 +73,7 @@ config CAN_KVASER_USB · 72 unmodified lines | ||
| 73 | 73 | - Kvaser Memorator Pro 5xHS |
| 74 | 74 | - Kvaser USBcan Light 4xHS |
| 75 | 75 | - Kvaser USBcan Pro 2xHS v2 |
| 76 | + - Kvaser USBcan Pro 4xHS | |
| 76 | 77 | - Kvaser USBcan Pro 5xHS |
| 77 | 78 | - Kvaser U100 |
| 78 | 79 | - Kvaser U100P |
| @@ -86,8 +86,9 @@ · 85 unmodified lines | ||
| 86 | 86 | #define USB_U100_PRODUCT_ID 273 |
| 87 | 87 | #define USB_U100P_PRODUCT_ID 274 |
| 88 | 88 | #define USB_U100S_PRODUCT_ID 275 |
| 89 | +#define USB_USBCAN_PRO_4HS_PRODUCT_ID 276 | |
| 89 | 90 | #define USB_HYDRA_PRODUCT_ID_END \ |
| 90 | − USB_U100S_PRODUCT_ID | |
| 91 | + USB_USBCAN_PRO_4HS_PRODUCT_ID | |
| 91 | 92 | |
| 92 | 93 | static inline bool kvaser_is_leaf(const struct usb_device_id *id) |
| 93 | 94 | { |
| @@ -193,6 +194,7 @@ static const struct usb_device_id kvaser_usb_table[] = { · 99 unmodified lines | ||
| 193 | 194 | { USB_DEVICE(KVASER_VENDOR_ID, USB_U100_PRODUCT_ID) }, |
| 194 | 195 | { USB_DEVICE(KVASER_VENDOR_ID, USB_U100P_PRODUCT_ID) }, |
| 195 | 196 | { USB_DEVICE(KVASER_VENDOR_ID, USB_U100S_PRODUCT_ID) }, |
| 197 | + { USB_DEVICE(KVASER_VENDOR_ID, USB_USBCAN_PRO_4HS_PRODUCT_ID) }, | |
| 196 | 198 | { } |
| 197 | 199 | }; |
| 198 | 200 | MODULE_DEVICE_TABLE(usb, kvaser_usb_table); |
| @@ -18,8 +18,6 @@ · 17 unmodified lines | ||
| 18 | 18 | |
| 19 | 19 | #include "pcan_usb_core.h" |
| 20 | 20 | |
| 21 | −MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB adapter"); | |
| 22 | − | |
| 23 | 21 | /* PCAN-USB Endpoints */ |
| 24 | 22 | #define PCAN_USB_EP_CMDOUT 1 |
| 25 | 23 | #define PCAN_USB_EP_CMDIN (PCAN_USB_EP_CMDOUT | USB_DIR_IN) |
| @@ -857,7 +857,7 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter, · 856 unmodified lines | ||
| 857 | 857 | if (dev->adapter->dev_set_bus) { |
| 858 | 858 | err = dev->adapter->dev_set_bus(dev, 0); |
| 859 | 859 | if (err) |
| 860 | − goto lbl_unregister_candev; | |
| 860 | + goto adap_dev_free; | |
| 861 | 861 | } |
| 862 | 862 | |
| 863 | 863 | /* get device number early */ |
| @@ -869,6 +869,10 @@ static int peak_usb_create_dev(const struct peak_usb_adapter *peak_usb_adapter, · 5 unmodified lines | ||
| 869 | 869 | |
| 870 | 870 | return 0; |
| 871 | 871 | |
| 872 | +adap_dev_free: | |
| 873 | + if (dev->adapter->dev_free) | |
| 874 | + dev->adapter->dev_free(dev); | |
| 875 | + | |
| 872 | 876 | lbl_unregister_candev: |
| 873 | 877 | unregister_candev(netdev); |
| 874 | 878 | |
| @@ -16,9 +16,6 @@ · 15 unmodified lines | ||
| 16 | 16 | #include "pcan_usb_core.h" |
| 17 | 17 | #include "pcan_usb_pro.h" |
| 18 | 18 | |
| 19 | −MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB FD adapter"); | |
| 20 | −MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro FD adapter"); | |
| 21 | − | |
| 22 | 19 | #define PCAN_USBPROFD_CHANNEL_COUNT 2 |
| 23 | 20 | #define PCAN_USBFD_CHANNEL_COUNT 1 |
| 24 | 21 | |
| @@ -17,8 +17,6 @@ · 16 unmodified lines | ||
| 17 | 17 | #include "pcan_usb_core.h" |
| 18 | 18 | #include "pcan_usb_pro.h" |
| 19 | 19 | |
| 20 | −MODULE_SUPPORTED_DEVICE("PEAK-System PCAN-USB Pro adapter"); | |
| 21 | − | |
| 22 | 20 | #define PCAN_USBPRO_CHANNEL_COUNT 2 |
| 23 | 21 | |
| 24 | 22 | /* PCAN-USB Pro adapter internal clock (MHz) */ |
| @@ -1105,13 +1105,6 @@ static int b53_setup(struct dsa_switch *ds) · 1104 unmodified lines | ||
| 1105 | 1105 | b53_disable_port(ds, port); |
| 1106 | 1106 | } |
| 1107 | 1107 | |
| 1108 | − /* Let DSA handle the case were multiple bridges span the same switch | |
| 1109 | − * device and different VLAN awareness settings are requested, which | |
| 1110 | − * would be breaking filtering semantics for any of the other bridge | |
| 1111 | − * devices. (not hardware supported) | |
| 1112 | − */ | |
| 1113 | − ds->vlan_filtering_is_global = true; | |
| 1114 | − | |
| 1115 | 1108 | return b53_setup_devlink_resources(ds); |
| 1116 | 1109 | } |
| 1117 | 1110 | |
| @@ -2664,6 +2657,13 @@ struct b53_device *b53_switch_alloc(struct device *base, · 1546 unmodified lines | ||
| 2664 | 2657 | ds->ops = &b53_switch_ops; |
| 2665 | 2658 | ds->untag_bridge_pvid = true; |
| 2666 | 2659 | dev->vlan_enabled = true; |
| 2660 | + /* Let DSA handle the case were multiple bridges span the same switch | |
| 2661 | + * device and different VLAN awareness settings are requested, which | |
| 2662 | + * would be breaking filtering semantics for any of the other bridge | |
| 2663 | + * devices. (not hardware supported) | |
| 2664 | + */ | |
| 2665 | + ds->vlan_filtering_is_global = true; | |
| 2666 | + | |
| 2667 | 2667 | mutex_init(&dev->reg_mutex); |
| 2668 | 2668 | mutex_init(&dev->stats_mutex); |
| 2669 | 2669 | |
| @@ -114,7 +114,10 @@ static void bcm_sf2_imp_setup(struct dsa_switch *ds, int port) · 113 unmodified lines | ||
| 114 | 114 | /* Force link status for IMP port */ |
| 115 | 115 | reg = core_readl(priv, offset); |
| 116 | 116 | reg |= (MII_SW_OR | LINK_STS); |
| 117 | − reg &= ~GMII_SPEED_UP_2G; | |
| 117 | + if (priv->type == BCM4908_DEVICE_ID) | |
| 118 | + reg |= GMII_SPEED_UP_2G; | |
| 119 | + else | |
| 120 | + reg &= ~GMII_SPEED_UP_2G; | |
| 118 | 121 | core_writel(priv, reg, offset); |
| 119 | 122 | |
| 120 | 123 | /* Enable Broadcast, Multicast, Unicast forwarding to IMP port */ |
| @@ -406,7 +409,7 @@ static int bcm_sf2_sw_rst(struct bcm_sf2_priv *priv) · 285 unmodified lines | ||
| 406 | 409 | /* The watchdog reset does not work on 7278, we need to hit the |
| 407 | 410 | * "external" reset line through the reset controller. |
| 408 | 411 | */ |
| 409 | − if (priv->type == BCM7278_DEVICE_ID && !IS_ERR(priv->rcdev)) { | |
| 412 | + if (priv->type == BCM7278_DEVICE_ID) { | |
| 410 | 413 | ret = reset_control_assert(priv->rcdev); |
| 411 | 414 | if (ret) |
| 412 | 415 | return ret; |
| @@ -585,8 +588,10 @@ static u32 bcm_sf2_sw_get_phy_flags(struct dsa_switch *ds, int port) · 172 unmodified lines | ||
| 585 | 588 | * in bits 15:8 and the patch level in bits 7:0 which is exactly what |
| 586 | 589 | * the REG_PHY_REVISION register layout is. |
| 587 | 590 | */ |
| 588 | − | |
| 589 | − return priv->hw_params.gphy_rev; | |
| 591 | + if (priv->int_phy_mask & BIT(port)) | |
| 592 | + return priv->hw_params.gphy_rev; | |
| 593 | + else | |
| 594 | + return 0; | |
| 590 | 595 | } |
| 591 | 596 | |
| 592 | 597 | static void bcm_sf2_sw_validate(struct dsa_switch *ds, int port, |
| @@ -1265,7 +1270,7 @@ static int bcm_sf2_sw_probe(struct platform_device *pdev) · 672 unmodified lines | ||
| 1265 | 1270 | |
| 1266 | 1271 | priv->rcdev = devm_reset_control_get_optional_exclusive(&pdev->dev, |
| 1267 | 1272 | "switch"); |
| 1268 | − if (PTR_ERR(priv->rcdev) == -EPROBE_DEFER) | |
| 1273 | + if (IS_ERR(priv->rcdev)) | |
| 1269 | 1274 | return PTR_ERR(priv->rcdev); |
| 1270 | 1275 | |
| 1271 | 1276 | /* Auto-detection using standard registers will not work, so |
| @@ -1426,7 +1431,7 @@ static int bcm_sf2_sw_remove(struct platform_device *pdev) · 154 unmodified lines | ||
| 1426 | 1431 | bcm_sf2_mdio_unregister(priv); |
| 1427 | 1432 | clk_disable_unprepare(priv->clk_mdiv); |
| 1428 | 1433 | clk_disable_unprepare(priv->clk); |
| 1429 | − if (priv->type == BCM7278_DEVICE_ID && !IS_ERR(priv->rcdev)) | |
| 1434 | + if (priv->type == BCM7278_DEVICE_ID) | |
| 1430 | 1435 | reset_control_assert(priv->rcdev); |
| 1431 | 1436 | |
| 1432 | 1437 | return 0; |
| @@ -93,8 +93,12 @@ · 92 unmodified lines | ||
| 93 | 93 | |
| 94 | 94 | /* GSWIP MII Registers */ |
| 95 | 95 | #define GSWIP_MII_CFGp(p) (0x2 * (p)) |
| 96 | +#define GSWIP_MII_CFG_RESET BIT(15) | |
| 96 | 97 | #define GSWIP_MII_CFG_EN BIT(14) |
| 98 | +#define GSWIP_MII_CFG_ISOLATE BIT(13) | |
| 97 | 99 | #define GSWIP_MII_CFG_LDCLKDIS BIT(12) |
| 100 | +#define GSWIP_MII_CFG_RGMII_IBS BIT(8) | |
| 101 | +#define GSWIP_MII_CFG_RMII_CLK BIT(7) | |
| 98 | 102 | #define GSWIP_MII_CFG_MODE_MIIP 0x0 |
| 99 | 103 | #define GSWIP_MII_CFG_MODE_MIIM 0x1 |
| 100 | 104 | #define GSWIP_MII_CFG_MODE_RMIIP 0x2 |
| @@ -190,6 +194,23 @@ · 89 unmodified lines | ||
| 190 | 194 | #define GSWIP_PCE_DEFPVID(p) (0x486 + ((p) * 0xA)) |
| 191 | 195 | |
| 192 | 196 | #define GSWIP_MAC_FLEN 0x8C5 |
| 197 | +#define GSWIP_MAC_CTRL_0p(p) (0x903 + ((p) * 0xC)) | |
| 198 | +#define GSWIP_MAC_CTRL_0_PADEN BIT(8) | |
| 199 | +#define GSWIP_MAC_CTRL_0_FCS_EN BIT(7) | |
| 200 | +#define GSWIP_MAC_CTRL_0_FCON_MASK 0x0070 | |
| 201 | +#define GSWIP_MAC_CTRL_0_FCON_AUTO 0x0000 | |
| 202 | +#define GSWIP_MAC_CTRL_0_FCON_RX 0x0010 | |
| 203 | +#define GSWIP_MAC_CTRL_0_FCON_TX 0x0020 | |
| 204 | +#define GSWIP_MAC_CTRL_0_FCON_RXTX 0x0030 | |
| 205 | +#define GSWIP_MAC_CTRL_0_FCON_NONE 0x0040 | |
| 206 | +#define GSWIP_MAC_CTRL_0_FDUP_MASK 0x000C | |
| 207 | +#define GSWIP_MAC_CTRL_0_FDUP_AUTO 0x0000 | |
| 208 | +#define GSWIP_MAC_CTRL_0_FDUP_EN 0x0004 | |
| 209 | +#define GSWIP_MAC_CTRL_0_FDUP_DIS 0x000C | |
| 210 | +#define GSWIP_MAC_CTRL_0_GMII_MASK 0x0003 | |
| 211 | +#define GSWIP_MAC_CTRL_0_GMII_AUTO 0x0000 | |
| 212 | +#define GSWIP_MAC_CTRL_0_GMII_MII 0x0001 | |
| 213 | +#define GSWIP_MAC_CTRL_0_GMII_RGMII 0x0002 | |
| 193 | 214 | #define GSWIP_MAC_CTRL_2p(p) (0x905 + ((p) * 0xC)) |
| 194 | 215 | #define GSWIP_MAC_CTRL_2_MLEN BIT(3) /* Maximum Untagged Frame Lnegth */ |
| 195 | 216 | |
| @@ -653,16 +674,13 @@ static int gswip_port_enable(struct dsa_switch *ds, int port, · 457 unmodified lines | ||
| 653 | 674 | GSWIP_SDMA_PCTRLp(port)); |
| 654 | 675 | |
| 655 | 676 | if (!dsa_is_cpu_port(ds, port)) { |
| 656 | − u32 macconf = GSWIP_MDIO_PHY_LINK_AUTO | | |
| 657 | − GSWIP_MDIO_PHY_SPEED_AUTO | | |
| 658 | − GSWIP_MDIO_PHY_FDUP_AUTO | | |
| 659 | − GSWIP_MDIO_PHY_FCONTX_AUTO | | |
| 660 | − GSWIP_MDIO_PHY_FCONRX_AUTO | | |
| 661 | − (phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK); | |
| 662 | − | |
| 663 | − gswip_mdio_w(priv, macconf, GSWIP_MDIO_PHYp(port)); | |
| 664 | − /* Activate MDIO auto polling */ | |
| 665 | − gswip_mdio_mask(priv, 0, BIT(port), GSWIP_MDIO_MDC_CFG0); | |
| 677 | + u32 mdio_phy = 0; | |
| 678 | + | |
| 679 | + if (phydev) | |
| 680 | + mdio_phy = phydev->mdio.addr & GSWIP_MDIO_PHY_ADDR_MASK; | |
| 681 | + | |
| 682 | + gswip_mdio_mask(priv, GSWIP_MDIO_PHY_ADDR_MASK, mdio_phy, | |
| 683 | + GSWIP_MDIO_PHYp(port)); | |
| 666 | 684 | } |
| 667 | 685 | |
| 668 | 686 | return 0; |
| @@ -675,14 +693,6 @@ static void gswip_port_disable(struct dsa_switch *ds, int port) · 6 unmodified lines | ||
| 675 | 693 | if (!dsa_is_user_port(ds, port)) |
| 676 | 694 | return; |
| 677 | 695 | |
| 678 | − if (!dsa_is_cpu_port(ds, port)) { | |
| 679 | − gswip_mdio_mask(priv, GSWIP_MDIO_PHY_LINK_DOWN, | |
| 680 | − GSWIP_MDIO_PHY_LINK_MASK, | |
| 681 | − GSWIP_MDIO_PHYp(port)); | |
| 682 | − /* Deactivate MDIO auto polling */ | |
| 683 | − gswip_mdio_mask(priv, BIT(port), 0, GSWIP_MDIO_MDC_CFG0); | |
| 684 | − } | |
| 685 | − | |
| 686 | 696 | gswip_switch_mask(priv, GSWIP_FDMA_PCTRL_EN, 0, |
| 687 | 697 | GSWIP_FDMA_PCTRLp(port)); |
| 688 | 698 | gswip_switch_mask(priv, GSWIP_SDMA_PCTRL_EN, 0, |
| @@ -794,14 +804,32 @@ static int gswip_setup(struct dsa_switch *ds) · 105 unmodified lines | ||
| 794 | 804 | gswip_switch_w(priv, BIT(cpu_port), GSWIP_PCE_PMAP2); |
| 795 | 805 | gswip_switch_w(priv, BIT(cpu_port), GSWIP_PCE_PMAP3); |
| 796 | 806 | |
| 797 | − /* disable PHY auto polling */ | |
| 807 | + /* Deactivate MDIO PHY auto polling. Some PHYs as the AR8030 have an | |
| 808 | + * interoperability problem with this auto polling mechanism because | |
| 809 | + * their status registers think that the link is in a different state | |
| 810 | + * than it actually is. For the AR8030 it has the BMSR_ESTATEN bit set | |
| 811 | + * as well as ESTATUS_1000_TFULL and ESTATUS_1000_XFULL. This makes the | |
| 812 | + * auto polling state machine consider the link being negotiated with | |
| 813 | + * 1Gbit/s. Since the PHY itself is a Fast Ethernet RMII PHY this leads | |
| 814 | + * to the switch port being completely dead (RX and TX are both not | |
| 815 | + * working). | |
| 816 | + * Also with various other PHY / port combinations (PHY11G GPHY, PHY22F | |
| 817 | + * GPHY, external RGMII PEF7071/7072) any traffic would stop. Sometimes | |
| 818 | + * it would work fine for a few minutes to hours and then stop, on | |
| 819 | + * other device it would no traffic could be sent or received at all. | |
| 820 | + * Testing shows that when PHY auto polling is disabled these problems | |
| 821 | + * go away. | |
| 822 | + */ | |
| 798 | 823 | gswip_mdio_w(priv, 0x0, GSWIP_MDIO_MDC_CFG0); |
| 824 | + | |
| 799 | 825 | /* Configure the MDIO Clock 2.5 MHz */ |
| 800 | 826 | gswip_mdio_mask(priv, 0xff, 0x09, GSWIP_MDIO_MDC_CFG1); |
| 801 | 827 | |
| 802 | − /* Disable the xMII link */ | |
| 828 | + /* Disable the xMII interface and clear it's isolation bit */ | |
| 803 | 829 | for (i = 0; i < priv->hw_info->max_ports; i++) |
| 804 | − gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, i); | |
| 830 | + gswip_mii_mask_cfg(priv, | |
| 831 | + GSWIP_MII_CFG_EN | GSWIP_MII_CFG_ISOLATE, | |
| 832 | + 0, i); | |
| 805 | 833 | |
| 806 | 834 | /* enable special tag insertion on cpu port */ |
| 807 | 835 | gswip_switch_mask(priv, 0, GSWIP_FDMA_PCTRL_STEN, |
| @@ -1450,6 +1478,112 @@ unsupported: · 642 unmodified lines | ||
| 1450 | 1478 | return; |
| 1451 | 1479 | } |
| 1452 | 1480 | |
| 1481 | +static void gswip_port_set_link(struct gswip_priv *priv, int port, bool link) | |
| 1482 | +{ | |
| 1483 | + u32 mdio_phy; | |
| 1484 | + | |
| 1485 | + if (link) | |
| 1486 | + mdio_phy = GSWIP_MDIO_PHY_LINK_UP; | |
| 1487 | + else | |
| 1488 | + mdio_phy = GSWIP_MDIO_PHY_LINK_DOWN; | |
| 1489 | + | |
| 1490 | + gswip_mdio_mask(priv, GSWIP_MDIO_PHY_LINK_MASK, mdio_phy, | |
| 1491 | + GSWIP_MDIO_PHYp(port)); | |
| 1492 | +} | |
| 1493 | + | |
| 1494 | +static void gswip_port_set_speed(struct gswip_priv *priv, int port, int speed, | |
| 1495 | + phy_interface_t interface) | |
| 1496 | +{ | |
| 1497 | + u32 mdio_phy = 0, mii_cfg = 0, mac_ctrl_0 = 0; | |
| 1498 | + | |
| 1499 | + switch (speed) { | |
| 1500 | + case SPEED_10: | |
| 1501 | + mdio_phy = GSWIP_MDIO_PHY_SPEED_M10; | |
| 1502 | + | |
| 1503 | + if (interface == PHY_INTERFACE_MODE_RMII) | |
| 1504 | + mii_cfg = GSWIP_MII_CFG_RATE_M50; | |
| 1505 | + else | |
| 1506 | + mii_cfg = GSWIP_MII_CFG_RATE_M2P5; | |
| 1507 | + | |
| 1508 | + mac_ctrl_0 = GSWIP_MAC_CTRL_0_GMII_MII; | |
| 1509 | + break; | |
| 1510 | + | |
| 1511 | + case SPEED_100: | |
| 1512 | + mdio_phy = GSWIP_MDIO_PHY_SPEED_M100; | |
| 1513 | + | |
| 1514 | + if (interface == PHY_INTERFACE_MODE_RMII) | |
| 1515 | + mii_cfg = GSWIP_MII_CFG_RATE_M50; | |
| 1516 | + else | |
| 1517 | + mii_cfg = GSWIP_MII_CFG_RATE_M25; | |
| 1518 | + | |
| 1519 | + mac_ctrl_0 = GSWIP_MAC_CTRL_0_GMII_MII; | |
| 1520 | + break; | |
| 1521 | + | |
| 1522 | + case SPEED_1000: | |
| 1523 | + mdio_phy = GSWIP_MDIO_PHY_SPEED_G1; | |
| 1524 | + | |
| 1525 | + mii_cfg = GSWIP_MII_CFG_RATE_M125; | |
| 1526 | + | |
| 1527 | + mac_ctrl_0 = GSWIP_MAC_CTRL_0_GMII_RGMII; | |
| 1528 | + break; | |
| 1529 | + } | |
| 1530 | + | |
| 1531 | + gswip_mdio_mask(priv, GSWIP_MDIO_PHY_SPEED_MASK, mdio_phy, | |
| 1532 | + GSWIP_MDIO_PHYp(port)); | |
| 1533 | + gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_RATE_MASK, mii_cfg, port); | |
| 1534 | + gswip_switch_mask(priv, GSWIP_MAC_CTRL_0_GMII_MASK, mac_ctrl_0, | |
| 1535 | + GSWIP_MAC_CTRL_0p(port)); | |
| 1536 | +} | |
| 1537 | + | |
| 1538 | +static void gswip_port_set_duplex(struct gswip_priv *priv, int port, int duplex) | |
| 1539 | +{ | |
| 1540 | + u32 mac_ctrl_0, mdio_phy; | |
| 1541 | + | |
| 1542 | + if (duplex == DUPLEX_FULL) { | |
| 1543 | + mac_ctrl_0 = GSWIP_MAC_CTRL_0_FDUP_EN; | |
| 1544 | + mdio_phy = GSWIP_MDIO_PHY_FDUP_EN; | |
| 1545 | + } else { | |
| 1546 | + mac_ctrl_0 = GSWIP_MAC_CTRL_0_FDUP_DIS; | |
| 1547 | + mdio_phy = GSWIP_MDIO_PHY_FDUP_DIS; | |
| 1548 | + } | |
| 1549 | + | |
| 1550 | + gswip_switch_mask(priv, GSWIP_MAC_CTRL_0_FDUP_MASK, mac_ctrl_0, | |
| 1551 | + GSWIP_MAC_CTRL_0p(port)); | |
| 1552 | + gswip_mdio_mask(priv, GSWIP_MDIO_PHY_FDUP_MASK, mdio_phy, | |
| 1553 | + GSWIP_MDIO_PHYp(port)); | |
| 1554 | +} | |
| 1555 | + | |
| 1556 | +static void gswip_port_set_pause(struct gswip_priv *priv, int port, | |
| 1557 | + bool tx_pause, bool rx_pause) | |
| 1558 | +{ | |
| 1559 | + u32 mac_ctrl_0, mdio_phy; | |
| 1560 | + | |
| 1561 | + if (tx_pause && rx_pause) { | |
| 1562 | + mac_ctrl_0 = GSWIP_MAC_CTRL_0_FCON_RXTX; | |
| 1563 | + mdio_phy = GSWIP_MDIO_PHY_FCONTX_EN | | |
| 1564 | + GSWIP_MDIO_PHY_FCONRX_EN; | |
| 1565 | + } else if (tx_pause) { | |
| 1566 | + mac_ctrl_0 = GSWIP_MAC_CTRL_0_FCON_TX; | |
| 1567 | + mdio_phy = GSWIP_MDIO_PHY_FCONTX_EN | | |
| 1568 | + GSWIP_MDIO_PHY_FCONRX_DIS; | |
| 1569 | + } else if (rx_pause) { | |
| 1570 | + mac_ctrl_0 = GSWIP_MAC_CTRL_0_FCON_RX; | |
| 1571 | + mdio_phy = GSWIP_MDIO_PHY_FCONTX_DIS | | |
| 1572 | + GSWIP_MDIO_PHY_FCONRX_EN; | |
| 1573 | + } else { | |
| 1574 | + mac_ctrl_0 = GSWIP_MAC_CTRL_0_FCON_NONE; | |
| 1575 | + mdio_phy = GSWIP_MDIO_PHY_FCONTX_DIS | | |
| 1576 | + GSWIP_MDIO_PHY_FCONRX_DIS; | |
| 1577 | + } | |
| 1578 | + | |
| 1579 | + gswip_switch_mask(priv, GSWIP_MAC_CTRL_0_FCON_MASK, | |
| 1580 | + mac_ctrl_0, GSWIP_MAC_CTRL_0p(port)); | |
| 1581 | + gswip_mdio_mask(priv, | |
| 1582 | + GSWIP_MDIO_PHY_FCONTX_MASK | | |
| 1583 | + GSWIP_MDIO_PHY_FCONRX_MASK, | |
| 1584 | + mdio_phy, GSWIP_MDIO_PHYp(port)); | |
| 1585 | +} | |
| 1586 | + | |
| 1453 | 1587 | static void gswip_phylink_mac_config(struct dsa_switch *ds, int port, |
| 1454 | 1588 | unsigned int mode, |
| 1455 | 1589 | const struct phylink_link_state *state) |
| @@ -1469,6 +1603,9 @@ static void gswip_phylink_mac_config(struct dsa_switch *ds, int port, · 13 unmodified lines | ||
| 1469 | 1603 | break; |
| 1470 | 1604 | case PHY_INTERFACE_MODE_RMII: |
| 1471 | 1605 | miicfg |= GSWIP_MII_CFG_MODE_RMIIM; |
| 1606 | + | |
| 1607 | + /* Configure the RMII clock as output: */ | |
| 1608 | + miicfg |= GSWIP_MII_CFG_RMII_CLK; | |
| 1472 | 1609 | break; |
| 1473 | 1610 | case PHY_INTERFACE_MODE_RGMII: |
| 1474 | 1611 | case PHY_INTERFACE_MODE_RGMII_ID: |
| @@ -1481,7 +1618,11 @@ static void gswip_phylink_mac_config(struct dsa_switch *ds, int port, · 6 unmodified lines | ||
| 1481 | 1618 | "Unsupported interface: %d\n", state->interface); |
| 1482 | 1619 | return; |
| 1483 | 1620 | } |
| 1484 | − gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_MODE_MASK, miicfg, port); | |
| 1621 | + | |
| 1622 | + gswip_mii_mask_cfg(priv, | |
| 1623 | + GSWIP_MII_CFG_MODE_MASK | GSWIP_MII_CFG_RMII_CLK | | |
| 1624 | + GSWIP_MII_CFG_RGMII_IBS | GSWIP_MII_CFG_LDCLKDIS, | |
| 1625 | + miicfg, port); | |
| 1485 | 1626 | |
| 1486 | 1627 | switch (state->interface) { |
| 1487 | 1628 | case PHY_INTERFACE_MODE_RGMII_ID: |
| @@ -1506,6 +1647,9 @@ static void gswip_phylink_mac_link_down(struct dsa_switch *ds, int port, · 18 unmodified lines | ||
| 1506 | 1647 | struct gswip_priv *priv = ds->priv; |
| 1507 | 1648 | |
| 1508 | 1649 | gswip_mii_mask_cfg(priv, GSWIP_MII_CFG_EN, 0, port); |
| 1650 | + | |
| 1651 | + if (!dsa_is_cpu_port(ds, port)) | |
| 1652 | + gswip_port_set_link(priv, port, false); | |
| 1509 | 1653 | } |
| 1510 | 1654 | |
| 1511 | 1655 | static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port, |
| @@ -1517,6 +1661,13 @@ static void gswip_phylink_mac_link_up(struct dsa_switch *ds, int port, · 5 unmodified lines | ||
| 1517 | 1661 | { |
| 1518 | 1662 | struct gswip_priv *priv = ds->priv; |
| 1519 | 1663 | |
| 1664 | + if (!dsa_is_cpu_port(ds, port)) { | |
| 1665 | + gswip_port_set_link(priv, port, true); | |
| 1666 | + gswip_port_set_speed(priv, port, speed, interface); | |
| 1667 | + gswip_port_set_duplex(priv, port, duplex); | |
| 1668 | + gswip_port_set_pause(priv, port, tx_pause, rx_pause); | |
| 1669 | + } | |
| 1670 | + | |
| 1520 | 1671 | gswip_mii_mask_cfg(priv, 0, GSWIP_MII_CFG_EN, port); |
| 1521 | 1672 | } |
| 1522 | 1673 | |
| @@ -436,34 +436,32 @@ mt7530_pad_clk_setup(struct dsa_switch *ds, phy_interface_t interface) · 435 unmodified lines | ||
| 436 | 436 | TD_DM_DRVP(8) | TD_DM_DRVN(8)); |
| 437 | 437 | |
| 438 | 438 | /* Setup core clock for MT7530 */ |
| 439 | − if (!trgint) { | |
| 440 | − /* Disable MT7530 core clock */ | |
| 441 | − core_clear(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); | |
| 442 | − | |
| 443 | − /* Disable PLL, since phy_device has not yet been created | |
| 444 | − * provided for phy_[read,write]_mmd_indirect is called, we | |
| 445 | − * provide our own core_write_mmd_indirect to complete this | |
| 446 | − * function. | |
| 447 | − */ | |
| 448 | − core_write_mmd_indirect(priv, | |
| 449 | − CORE_GSWPLL_GRP1, | |
| 450 | − MDIO_MMD_VEND2, | |
| 451 | − 0); | |
| 452 | − | |
| 453 | − /* Set core clock into 500Mhz */ | |
| 454 | − core_write(priv, CORE_GSWPLL_GRP2, | |
| 455 | − RG_GSWPLL_POSDIV_500M(1) | | |
| 456 | − RG_GSWPLL_FBKDIV_500M(25)); | |
| 439 | + /* Disable MT7530 core clock */ | |
| 440 | + core_clear(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); | |
| 457 | 441 | |
| 458 | − /* Enable PLL */ | |
| 459 | − core_write(priv, CORE_GSWPLL_GRP1, | |
| 460 | − RG_GSWPLL_EN_PRE | | |
| 461 | − RG_GSWPLL_POSDIV_200M(2) | | |
| 462 | − RG_GSWPLL_FBKDIV_200M(32)); | |
| 463 | − | |
| 464 | − /* Enable MT7530 core clock */ | |
| 465 | − core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); | |
| 466 | − } | |
| 442 | + /* Disable PLL, since phy_device has not yet been created | |
| 443 | + * provided for phy_[read,write]_mmd_indirect is called, we | |
| 444 | + * provide our own core_write_mmd_indirect to complete this | |
| 445 | + * function. | |
| 446 | + */ | |
| 447 | + core_write_mmd_indirect(priv, | |
| 448 | + CORE_GSWPLL_GRP1, | |
| 449 | + MDIO_MMD_VEND2, | |
| 450 | + 0); | |
| 451 | + | |
| 452 | + /* Set core clock into 500Mhz */ | |
| 453 | + core_write(priv, CORE_GSWPLL_GRP2, | |
| 454 | + RG_GSWPLL_POSDIV_500M(1) | | |
| 455 | + RG_GSWPLL_FBKDIV_500M(25)); | |
| 456 | + | |
| 457 | + /* Enable PLL */ | |
| 458 | + core_write(priv, CORE_GSWPLL_GRP1, | |
| 459 | + RG_GSWPLL_EN_PRE | | |
| 460 | + RG_GSWPLL_POSDIV_200M(2) | | |
| 461 | + RG_GSWPLL_FBKDIV_200M(32)); | |
| 462 | + | |
| 463 | + /* Enable MT7530 core clock */ | |
| 464 | + core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); | |
| 467 | 465 | |
| 468 | 466 | /* Setup the MT7530 TRGMII Tx Clock */ |
| 469 | 467 | core_set(priv, CORE_TRGMII_GSW_CLK_CG, REG_GSWCK_EN); |
| @@ -1624,6 +1622,7 @@ mtk_get_tag_protocol(struct dsa_switch *ds, int port, · 1154 unmodified lines | ||
| 1624 | 1622 | } |
| 1625 | 1623 | } |
| 1626 | 1624 | |
| 1625 | +#ifdef CONFIG_GPIOLIB | |
| 1627 | 1626 | static inline u32 |
| 1628 | 1627 | mt7530_gpio_to_bit(unsigned int offset) |
| 1629 | 1628 | { |
| @@ -1726,6 +1725,7 @@ mt7530_setup_gpio(struct mt7530_priv *priv) · 96 unmodified lines | ||
| 1726 | 1725 | |
| 1727 | 1726 | return devm_gpiochip_add_data(dev, gc, priv); |
| 1728 | 1727 | } |
| 1728 | +#endif /* CONFIG_GPIOLIB */ | |
| 1729 | 1729 | |
| 1730 | 1730 | static int |
| 1731 | 1731 | mt7530_setup(struct dsa_switch *ds) |
| @@ -1868,11 +1868,13 @@ mt7530_setup(struct dsa_switch *ds) · 136 unmodified lines | ||
| 1868 | 1868 | } |
| 1869 | 1869 | } |
| 1870 | 1870 | |
| 1871 | +#ifdef CONFIG_GPIOLIB | |
| 1871 | 1872 | if (of_property_read_bool(priv->dev->of_node, "gpio-controller")) { |
| 1872 | 1873 | ret = mt7530_setup_gpio(priv); |
| 1873 | 1874 | if (ret) |
| 1874 | 1875 | return ret; |
| 1875 | 1876 | } |
| 1877 | +#endif /* CONFIG_GPIOLIB */ | |
| 1876 | 1878 | |
| 1877 | 1879 | mt7530_setup_port5(ds, interface); |
| 1878 | 1880 | |
| @@ -3026,10 +3026,17 @@ out_resources: · 3025 unmodified lines | ||
| 3026 | 3026 | return err; |
| 3027 | 3027 | } |
| 3028 | 3028 | |
| 3029 | +/* prod_id for switch families which do not have a PHY model number */ | |
| 3030 | +static const u16 family_prod_id_table[] = { | |
| 3031 | + [MV88E6XXX_FAMILY_6341] = MV88E6XXX_PORT_SWITCH_ID_PROD_6341, | |
| 3032 | + [MV88E6XXX_FAMILY_6390] = MV88E6XXX_PORT_SWITCH_ID_PROD_6390, | |
| 3033 | +}; | |
| 3034 | + | |
| 3029 | 3035 | static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg) |
| 3030 | 3036 | { |
| 3031 | 3037 | struct mv88e6xxx_mdio_bus *mdio_bus = bus->priv; |
| 3032 | 3038 | struct mv88e6xxx_chip *chip = mdio_bus->chip; |
| 3039 | + u16 prod_id; | |
| 3033 | 3040 | u16 val; |
| 3034 | 3041 | int err; |
| 3035 | 3042 | |
| @@ -3040,23 +3047,12 @@ static int mv88e6xxx_mdio_read(struct mii_bus *bus, int phy, int reg) · 4 unmodified lines | ||
| 3040 | 3047 | err = chip->info->ops->phy_read(chip, bus, phy, reg, &val); |
| 3041 | 3048 | mv88e6xxx_reg_unlock(chip); |
| 3042 | 3049 | |
| 3043 | − if (reg == MII_PHYSID2) { | |
| 3044 | − /* Some internal PHYs don't have a model number. */ | |
| 3045 | − if (chip->info->family != MV88E6XXX_FAMILY_6165) | |
| 3046 | − /* Then there is the 6165 family. It gets is | |
| 3047 | − * PHYs correct. But it can also have two | |
| 3048 | − * SERDES interfaces in the PHY address | |
| 3049 | − * space. And these don't have a model | |
| 3050 | − * number. But they are not PHYs, so we don't | |
| 3051 | − * want to give them something a PHY driver | |
| 3052 | − * will recognise. | |
| 3053 | − * | |
| 3054 | − * Use the mv88e6390 family model number | |
| 3055 | − * instead, for anything which really could be | |
| 3056 | − * a PHY, | |
| 3057 | − */ | |
| 3058 | − if (!(val & 0x3f0)) | |
| 3059 | − val |= MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >> 4; | |
| 3050 | + /* Some internal PHYs don't have a model number. */ | |
| 3051 | + if (reg == MII_PHYSID2 && !(val & 0x3f0) && | |
| 3052 | + chip->info->family < ARRAY_SIZE(family_prod_id_table)) { | |
| 3053 | + prod_id = family_prod_id_table[chip->info->family]; | |
| 3054 | + if (prod_id) | |
| 3055 | + val |= prod_id >> 4; | |
| 3060 | 3056 | } |
| 3061 | 3057 | |
| 3062 | 3058 | return err ? err : val; |
| @@ -1922,7 +1922,7 @@ out_unlock_ptp: · 1921 unmodified lines | ||
| 1922 | 1922 | speed = SPEED_1000; |
| 1923 | 1923 | else if (bmcr & BMCR_SPEED100) |
| 1924 | 1924 | speed = SPEED_100; |
| 1925 | − else if (bmcr & BMCR_SPEED10) | |
| 1925 | + else | |
| 1926 | 1926 | speed = SPEED_10; |
| 1927 | 1927 | |
| 1928 | 1928 | sja1105_sgmii_pcs_force_speed(priv, speed); |
| @@ -3369,14 +3369,14 @@ static int sja1105_port_ucast_bcast_flood(struct sja1105_private *priv, int to, · 1440 unmodified lines | ||
| 3369 | 3369 | if (flags.val & BR_FLOOD) |
| 3370 | 3370 | priv->ucast_egress_floods |= BIT(to); |
| 3371 | 3371 | else |
| 3372 | − priv->ucast_egress_floods |= BIT(to); | |
| 3372 | + priv->ucast_egress_floods &= ~BIT(to); | |
| 3373 | 3373 | } |
| 3374 | 3374 | |
| 3375 | 3375 | if (flags.mask & BR_BCAST_FLOOD) { |
| 3376 | 3376 | if (flags.val & BR_BCAST_FLOOD) |
| 3377 | 3377 | priv->bcast_egress_floods |= BIT(to); |
| 3378 | 3378 | else |
| 3379 | − priv->bcast_egress_floods |= BIT(to); | |
| 3379 | + priv->bcast_egress_floods &= ~BIT(to); | |
| 3380 | 3380 | } |
| 3381 | 3381 | |
| 3382 | 3382 | return sja1105_manage_flood_domains(priv); |
| @@ -528,7 +528,10 @@ static int xrs700x_hsr_join(struct dsa_switch *ds, int port, · 527 unmodified lines | ||
| 528 | 528 | return -EOPNOTSUPP; |
| 529 | 529 | |
| 530 | 530 | dsa_hsr_foreach_port(dp, ds, hsr) { |
| 531 | − partner = dp; | |
| 531 | + if (dp->index != port) { | |
| 532 | + partner = dp; | |
| 533 | + break; | |
| 534 | + } | |
| 532 | 535 | } |
| 533 | 536 | |
| 534 | 537 | /* We can't enable redundancy on the switch until both |
| @@ -582,7 +585,10 @@ static int xrs700x_hsr_leave(struct dsa_switch *ds, int port, · 47 unmodified lines | ||
| 582 | 585 | unsigned int val; |
| 583 | 586 | |
| 584 | 587 | dsa_hsr_foreach_port(dp, ds, hsr) { |
| 585 | − partner = dp; | |
| 588 | + if (dp->index != port) { | |
| 589 | + partner = dp; | |
| 590 | + break; | |
| 591 | + } | |
| 586 | 592 | } |
| 587 | 593 | |
| 588 | 594 | if (!partner) |
| @@ -1534,8 +1534,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) · 1533 unmodified lines | ||
| 1534 | 1534 | } |
| 1535 | 1535 | pci_set_master(pdev); |
| 1536 | 1536 | |
| 1537 | − ioaddr = pci_resource_start(pdev, 0); | |
| 1538 | − if (!ioaddr) { | |
| 1537 | + if (!pci_resource_len(pdev, 0)) { | |
| 1539 | 1538 | if (pcnet32_debug & NETIF_MSG_PROBE) |
| 1540 | 1539 | pr_err("card has no PCI IO resources, aborting\n"); |
| 1541 | 1540 | err = -ENODEV; |
| @@ -1548,6 +1547,8 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) · 6 unmodified lines | ||
| 1548 | 1547 | pr_err("architecture does not support 32bit PCI busmaster DMA\n"); |
| 1549 | 1548 | goto err_disable_dev; |
| 1550 | 1549 | } |
| 1550 | + | |
| 1551 | + ioaddr = pci_resource_start(pdev, 0); | |
| 1551 | 1552 | if (!request_region(ioaddr, PCNET32_TOTAL_SIZE, "pcnet32_probe_pci")) { |
| 1552 | 1553 | if (pcnet32_debug & NETIF_MSG_PROBE) |
| 1553 | 1554 | pr_err("io address range already allocated\n"); |
| @@ -180,9 +180,9 @@ · 179 unmodified lines | ||
| 180 | 180 | #define XGBE_DMA_SYS_AWCR 0x30303030 |
| 181 | 181 | |
| 182 | 182 | /* DMA cache settings - PCI device */ |
| 183 | −#define XGBE_DMA_PCI_ARCR 0x00000003 | |
| 184 | −#define XGBE_DMA_PCI_AWCR 0x13131313 | |
| 185 | −#define XGBE_DMA_PCI_AWARCR 0x00000313 | |
| 183 | +#define XGBE_DMA_PCI_ARCR 0x000f0f0f | |
| 184 | +#define XGBE_DMA_PCI_AWCR 0x0f0f0f0f | |
| 185 | +#define XGBE_DMA_PCI_AWARCR 0x00000f0f | |
| 186 | 186 | |
| 187 | 187 | /* DMA channel interrupt modes */ |
| 188 | 188 | #define XGBE_IRQ_MODE_EDGE 0 |
| @@ -1894,13 +1894,16 @@ static int alx_resume(struct device *dev) · 1893 unmodified lines | ||
| 1894 | 1894 | |
| 1895 | 1895 | if (!netif_running(alx->dev)) |
| 1896 | 1896 | return 0; |
| 1897 | − netif_device_attach(alx->dev); | |
| 1898 | 1897 | |
| 1899 | 1898 | rtnl_lock(); |
| 1900 | 1899 | err = __alx_open(alx, true); |
| 1901 | 1900 | rtnl_unlock(); |
| 1901 | + if (err) | |
| 1902 | + return err; | |
| 1902 | 1903 | |
| 1903 | − return err; | |
| 1904 | + netif_device_attach(alx->dev); | |
| 1905 | + | |
| 1906 | + return 0; | |
| 1904 | 1907 | } |
| 1905 | 1908 | |
| 1906 | 1909 | static SIMPLE_DEV_PM_OPS(alx_pm_ops, alx_suspend, alx_resume); |
| @@ -54,7 +54,7 @@ config B44_PCI · 53 unmodified lines | ||
| 54 | 54 | config BCM4908_ENET |
| 55 | 55 | tristate "Broadcom BCM4908 internal mac support" |
| 56 | 56 | depends on ARCH_BCM4908 || COMPILE_TEST |
| 57 | − default y | |
| 57 | + default y if ARCH_BCM4908 | |
| 58 | 58 | help |
| 59 | 59 | This driver supports Ethernet controller integrated into Broadcom |
| 60 | 60 | BCM4908 family SoCs. |
| @@ -172,6 +172,7 @@ static int bcm4908_dma_alloc_buf_descs(struct bcm4908_enet *enet, · 171 unmodified lines | ||
| 172 | 172 | |
| 173 | 173 | err_free_buf_descs: |
| 174 | 174 | dma_free_coherent(dev, size, ring->cpu_addr, ring->dma_addr); |
| 175 | + ring->cpu_addr = NULL; | |
| 175 | 176 | return -ENOMEM; |
| 176 | 177 | } |
| 177 | 178 | |
| @@ -592,6 +593,9 @@ static int bcm4908_enet_poll(struct napi_struct *napi, int weight) · 414 unmodified lines | ||
| 592 | 593 | bcm4908_enet_intrs_on(enet); |
| 593 | 594 | } |
| 594 | 595 | |
| 596 | + /* Hardware could disable ring if it run out of descriptors */ | |
| 597 | + bcm4908_enet_dma_rx_ring_enable(enet, &enet->rx_ring); | |
| 598 | + | |
| 595 | 599 | return handled; |
| 596 | 600 | } |
| 597 | 601 | |
| @@ -8556,10 +8556,18 @@ static void bnxt_setup_inta(struct bnxt *bp) · 8555 unmodified lines | ||
| 8556 | 8556 | bp->irq_tbl[0].handler = bnxt_inta; |
| 8557 | 8557 | } |
| 8558 | 8558 | |
| 8559 | +static int bnxt_init_int_mode(struct bnxt *bp); | |
| 8560 | + | |
| 8559 | 8561 | static int bnxt_setup_int_mode(struct bnxt *bp) |
| 8560 | 8562 | { |
| 8561 | 8563 | int rc; |
| 8562 | 8564 | |
| 8565 | + if (!bp->irq_tbl) { | |
| 8566 | + rc = bnxt_init_int_mode(bp); | |
| 8567 | + if (rc || !bp->irq_tbl) | |
| 8568 | + return rc ?: -ENODEV; | |
| 8569 | + } | |
| 8570 | + | |
| 8563 | 8571 | if (bp->flags & BNXT_FLAG_USING_MSIX) |
| 8564 | 8572 | bnxt_setup_msix(bp); |
| 8565 | 8573 | else |
| @@ -8744,7 +8752,7 @@ static int bnxt_init_inta(struct bnxt *bp) · 178 unmodified lines | ||
| 8744 | 8752 | |
| 8745 | 8753 | static int bnxt_init_int_mode(struct bnxt *bp) |
| 8746 | 8754 | { |
| 8747 | − int rc = 0; | |
| 8755 | + int rc = -ENODEV; | |
| 8748 | 8756 | |
| 8749 | 8757 | if (bp->flags & BNXT_FLAG_MSIX_CAP) |
| 8750 | 8758 | rc = bnxt_init_msix(bp); |
| @@ -9514,7 +9522,8 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up) · 763 unmodified lines | ||
| 9514 | 9522 | { |
| 9515 | 9523 | struct hwrm_func_drv_if_change_output *resp = bp->hwrm_cmd_resp_addr; |
| 9516 | 9524 | struct hwrm_func_drv_if_change_input req = {0}; |
| 9517 | − bool resc_reinit = false, fw_reset = false; | |
| 9525 | + bool fw_reset = !bp->irq_tbl; | |
| 9526 | + bool resc_reinit = false; | |
| 9518 | 9527 | int rc, retry = 0; |
| 9519 | 9528 | u32 flags = 0; |
| 9520 | 9529 | |
| @@ -9557,6 +9566,7 @@ static int bnxt_hwrm_if_change(struct bnxt *bp, bool up) · 36 unmodified lines | ||
| 9557 | 9566 | |
| 9558 | 9567 | if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state) && !fw_reset) { |
| 9559 | 9568 | netdev_err(bp->dev, "RESET_DONE not set during FW reset.\n"); |
| 9569 | + set_bit(BNXT_STATE_ABORT_ERR, &bp->state); | |
| 9560 | 9570 | return -ENODEV; |
| 9561 | 9571 | } |
| 9562 | 9572 | if (resc_reinit || fw_reset) { |
| @@ -9890,6 +9900,9 @@ static int bnxt_reinit_after_abort(struct bnxt *bp) · 327 unmodified lines | ||
| 9890 | 9900 | if (test_bit(BNXT_STATE_IN_FW_RESET, &bp->state)) |
| 9891 | 9901 | return -EBUSY; |
| 9892 | 9902 | |
| 9903 | + if (bp->dev->reg_state == NETREG_UNREGISTERED) | |
| 9904 | + return -ENODEV; | |
| 9905 | + | |
| 9893 | 9906 | rc = bnxt_fw_init_one(bp); |
| 9894 | 9907 | if (!rc) { |
| 9895 | 9908 | bnxt_clear_int_mode(bp); |
| @@ -3239,6 +3239,9 @@ static void gem_prog_cmp_regs(struct macb *bp, struct ethtool_rx_flow_spec *fs) · 3238 unmodified lines | ||
| 3239 | 3239 | bool cmp_b = false; |
| 3240 | 3240 | bool cmp_c = false; |
| 3241 | 3241 | |
| 3242 | + if (!macb_is_gem(bp)) | |
| 3243 | + return; | |
| 3244 | + | |
| 3242 | 3245 | tp4sp_v = &(fs->h_u.tcp_ip4_spec); |
| 3243 | 3246 | tp4sp_m = &(fs->m_u.tcp_ip4_spec); |
| 3244 | 3247 | |
| @@ -3607,6 +3610,7 @@ static void macb_restore_features(struct macb *bp) · 362 unmodified lines | ||
| 3607 | 3610 | { |
| 3608 | 3611 | struct net_device *netdev = bp->dev; |
| 3609 | 3612 | netdev_features_t features = netdev->features; |
| 3613 | + struct ethtool_rx_fs_item *item; | |
| 3610 | 3614 | |
| 3611 | 3615 | /* TX checksum offload */ |
| 3612 | 3616 | macb_set_txcsum_feature(bp, features); |
| @@ -3615,6 +3619,9 @@ static void macb_restore_features(struct macb *bp) · 2 unmodified lines | ||
| 3615 | 3619 | macb_set_rxcsum_feature(bp, features); |
| 3616 | 3620 | |
| 3617 | 3621 | /* RX Flow Filters */ |
| 3622 | + list_for_each_entry(item, &bp->rx_fs_list.list, list) | |
| 3623 | + gem_prog_cmp_regs(bp, &item->fs); | |
| 3624 | + | |
| 3618 | 3625 | macb_set_rxflow_feature(bp, features); |
| 3619 | 3626 | } |
| 3620 | 3627 | |
| @@ -3911,6 +3918,7 @@ static int macb_init(struct platform_device *pdev) · 290 unmodified lines | ||
| 3911 | 3918 | reg = gem_readl(bp, DCFG8); |
| 3912 | 3919 | bp->max_tuples = min((GEM_BFEXT(SCR2CMP, reg) / 3), |
| 3913 | 3920 | GEM_BFEXT(T2SCR, reg)); |
| 3921 | + INIT_LIST_HEAD(&bp->rx_fs_list.list); | |
| 3914 | 3922 | if (bp->max_tuples > 0) { |
| 3915 | 3923 | /* also needs one ethtype match to check IPv4 */ |
| 3916 | 3924 | if (GEM_BFEXT(SCR2ETH, reg) > 0) { |
| @@ -3921,7 +3929,6 @@ static int macb_init(struct platform_device *pdev) · 4 unmodified lines | ||
| 3921 | 3929 | /* Filtering is supported in hw but don't enable it in kernel now */ |
| 3922 | 3930 | dev->hw_features |= NETIF_F_NTUPLE; |
| 3923 | 3931 | /* init Rx flow definitions */ |
| 3924 | − INIT_LIST_HEAD(&bp->rx_fs_list.list); | |
| 3925 | 3932 | bp->rx_fs_list.count = 0; |
| 3926 | 3933 | spin_lock_init(&bp->rx_fs_lock); |
| 3927 | 3934 | } else |
| @@ -3954,6 +3961,13 @@ static int macb_init(struct platform_device *pdev) · 26 unmodified lines | ||
| 3954 | 3961 | return 0; |
| 3955 | 3962 | } |
| 3956 | 3963 | |
| 3964 | +static const struct macb_usrio_config macb_default_usrio = { | |
| 3965 | + .mii = MACB_BIT(MII), | |
| 3966 | + .rmii = MACB_BIT(RMII), | |
| 3967 | + .rgmii = GEM_BIT(RGMII), | |
| 3968 | + .refclk = MACB_BIT(CLKEN), | |
| 3969 | +}; | |
| 3970 | + | |
| 3957 | 3971 | #if defined(CONFIG_OF) |
| 3958 | 3972 | /* 1518 rounded up */ |
| 3959 | 3973 | #define AT91ETHER_MAX_RBUFF_SZ 0x600 |
| @@ -4439,13 +4453,6 @@ static int fu540_c000_init(struct platform_device *pdev) · 479 unmodified lines | ||
| 4439 | 4453 | return macb_init(pdev); |
| 4440 | 4454 | } |
| 4441 | 4455 | |
| 4442 | −static const struct macb_usrio_config macb_default_usrio = { | |
| 4443 | − .mii = MACB_BIT(MII), | |
| 4444 | − .rmii = MACB_BIT(RMII), | |
| 4445 | − .rgmii = GEM_BIT(RGMII), | |
| 4446 | − .refclk = MACB_BIT(CLKEN), | |
| 4447 | −}; | |
| 4448 | − | |
| 4449 | 4456 | static const struct macb_usrio_config sama7g5_usrio = { |
| 4450 | 4457 | .mii = 0, |
| 4451 | 4458 | .rmii = 1, |
| @@ -4594,6 +4601,7 @@ static const struct macb_config default_gem_config = { · 142 unmodified lines | ||
| 4594 | 4601 | .dma_burst_length = 16, |
| 4595 | 4602 | .clk_init = macb_clk_init, |
| 4596 | 4603 | .init = macb_init, |
| 4604 | + .usrio = &macb_default_usrio, | |
| 4597 | 4605 | .jumbo_max_len = 10240, |
| 4598 | 4606 | }; |
| 4599 | 4607 | |
| @@ -412,7 +412,7 @@ · 411 unmodified lines | ||
| 412 | 412 | | CN6XXX_INTR_M0UNWI_ERR \ |
| 413 | 413 | | CN6XXX_INTR_M1UPB0_ERR \ |
| 414 | 414 | | CN6XXX_INTR_M1UPWI_ERR \ |
| 415 | − | CN6XXX_INTR_M1UPB0_ERR \ | |
| 415 | + | CN6XXX_INTR_M1UNB0_ERR \ | |
| 416 | 416 | | CN6XXX_INTR_M1UNWI_ERR \ |
| 417 | 417 | | CN6XXX_INTR_INSTR_DB_OF_ERR \ |
| 418 | 418 | | CN6XXX_INTR_SLIST_DB_OF_ERR \ |
| @@ -1794,11 +1794,25 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init, · 1793 unmodified lines | ||
| 1794 | 1794 | struct cudbg_buffer temp_buff = { 0 }; |
| 1795 | 1795 | struct sge_qbase_reg_field *sge_qbase; |
| 1796 | 1796 | struct ireg_buf *ch_sge_dbg; |
| 1797 | + u8 padap_running = 0; | |
| 1797 | 1798 | int i, rc; |
| 1799 | + u32 size; | |
| 1798 | 1800 | |
| 1799 | − rc = cudbg_get_buff(pdbg_init, dbg_buff, | |
| 1800 | − sizeof(*ch_sge_dbg) * 2 + sizeof(*sge_qbase), | |
| 1801 | − &temp_buff); | |
| 1801 | + /* Accessing SGE_QBASE_MAP[0-3] and SGE_QBASE_INDEX regs can | |
| 1802 | + * lead to SGE missing doorbells under heavy traffic. So, only | |
| 1803 | + * collect them when adapter is idle. | |
| 1804 | + */ | |
| 1805 | + for_each_port(padap, i) { | |
| 1806 | + padap_running = netif_running(padap->port[i]); | |
| 1807 | + if (padap_running) | |
| 1808 | + break; | |
| 1809 | + } | |
| 1810 | + | |
| 1811 | + size = sizeof(*ch_sge_dbg) * 2; | |
| 1812 | + if (!padap_running) | |
| 1813 | + size += sizeof(*sge_qbase); | |
| 1814 | + | |
| 1815 | + rc = cudbg_get_buff(pdbg_init, dbg_buff, size, &temp_buff); | |
| 1802 | 1816 | if (rc) |
| 1803 | 1817 | return rc; |
| 1804 | 1818 | |
| @@ -1820,7 +1834,8 @@ int cudbg_collect_sge_indirect(struct cudbg_init *pdbg_init, · 15 unmodified lines | ||
| 1820 | 1834 | ch_sge_dbg++; |
| 1821 | 1835 | } |
| 1822 | 1836 | |
| 1823 | − if (CHELSIO_CHIP_VERSION(padap->params.chip) > CHELSIO_T5) { | |
| 1837 | + if (CHELSIO_CHIP_VERSION(padap->params.chip) > CHELSIO_T5 && | |
| 1838 | + !padap_running) { | |
| 1824 | 1839 | sge_qbase = (struct sge_qbase_reg_field *)ch_sge_dbg; |
| 1825 | 1840 | /* 1 addr reg SGE_QBASE_INDEX and 4 data reg |
| 1826 | 1841 | * SGE_QBASE_MAP[0-3] |
| @@ -2090,7 +2090,8 @@ void t4_get_regs(struct adapter *adap, void *buf, size_t buf_size) · 2089 unmodified lines | ||
| 2090 | 2090 | 0x1190, 0x1194, |
| 2091 | 2091 | 0x11a0, 0x11a4, |
| 2092 | 2092 | 0x11b0, 0x11b4, |
| 2093 | − 0x11fc, 0x1274, | |
| 2093 | + 0x11fc, 0x123c, | |
| 2094 | + 0x1254, 0x1274, | |
| 2094 | 2095 | 0x1280, 0x133c, |
| 2095 | 2096 | 0x1800, 0x18fc, |
| 2096 | 2097 | 0x3000, 0x302c, |
| @@ -349,18 +349,6 @@ static int chcr_set_tcb_field(struct chcr_ktls_info *tx_info, u16 word, · 348 unmodified lines | ||
| 349 | 349 | return cxgb4_ofld_send(tx_info->netdev, skb); |
| 350 | 350 | } |
| 351 | 351 | |
| 352 | −/* | |
| 353 | − * chcr_ktls_mark_tcb_close: mark tcb state to CLOSE | |
| 354 | − * @tx_info - driver specific tls info. | |
| 355 | − * return: NET_TX_OK/NET_XMIT_DROP. | |
| 356 | − */ | |
| 357 | −static int chcr_ktls_mark_tcb_close(struct chcr_ktls_info *tx_info) | |
| 358 | −{ | |
| 359 | − return chcr_set_tcb_field(tx_info, TCB_T_STATE_W, | |
| 360 | − TCB_T_STATE_V(TCB_T_STATE_M), | |
| 361 | − CHCR_TCB_STATE_CLOSED, 1); | |
| 362 | −} | |
| 363 | − | |
| 364 | 352 | /* |
| 365 | 353 | * chcr_ktls_dev_del: call back for tls_dev_del. |
| 366 | 354 | * Remove the tid and l2t entry and close the connection. |
| @@ -395,8 +383,6 @@ static void chcr_ktls_dev_del(struct net_device *netdev, · 28 unmodified lines | ||
| 395 | 383 | |
| 396 | 384 | /* clear tid */ |
| 397 | 385 | if (tx_info->tid != -1) { |
| 398 | − /* clear tcb state and then release tid */ | |
| 399 | − chcr_ktls_mark_tcb_close(tx_info); | |
| 400 | 386 | cxgb4_remove_tid(&tx_info->adap->tids, tx_info->tx_chan, |
| 401 | 387 | tx_info->tid, tx_info->ip_family); |
| 402 | 388 | } |
| @@ -574,7 +560,6 @@ static int chcr_ktls_dev_add(struct net_device *netdev, struct sock *sk, · 171 unmodified lines | ||
| 574 | 560 | return 0; |
| 575 | 561 | |
| 576 | 562 | free_tid: |
| 577 | − chcr_ktls_mark_tcb_close(tx_info); | |
| 578 | 563 | #if IS_ENABLED(CONFIG_IPV6) |
| 579 | 564 | /* clear clip entry */ |
| 580 | 565 | if (tx_info->ip_family == AF_INET6) |
| @@ -672,10 +657,6 @@ static int chcr_ktls_cpl_act_open_rpl(struct adapter *adap, · 91 unmodified lines | ||
| 672 | 657 | if (tx_info->pending_close) { |
| 673 | 658 | spin_unlock(&tx_info->lock); |
| 674 | 659 | if (!status) { |
| 675 | − /* it's a late success, tcb status is establised, | |
| 676 | − * mark it close. | |
| 677 | − */ | |
| 678 | − chcr_ktls_mark_tcb_close(tx_info); | |
| 679 | 660 | cxgb4_remove_tid(&tx_info->adap->tids, tx_info->tx_chan, |
| 680 | 661 | tid, tx_info->ip_family); |
| 681 | 662 | } |
| @@ -722,7 +703,7 @@ static int chcr_ktls_cpl_set_tcb_rpl(struct adapter *adap, unsigned char *input) · 40 unmodified lines | ||
| 722 | 703 | kvfree(tx_info); |
| 723 | 704 | return 0; |
| 724 | 705 | } |
| 725 | − tx_info->open_state = false; | |
| 706 | + tx_info->open_state = CH_KTLS_OPEN_SUCCESS; | |
| 726 | 707 | spin_unlock(&tx_info->lock); |
| 727 | 708 | |
| 728 | 709 | complete(&tx_info->completion); |
| @@ -930,7 +911,7 @@ chcr_ktls_get_tx_flits(u32 nr_frags, unsigned int key_ctx_len) · 201 unmodified lines | ||
| 930 | 911 | } |
| 931 | 912 | |
| 932 | 913 | /* |
| 933 | − * chcr_ktls_check_tcp_options: To check if there is any TCP option availbale | |
| 914 | + * chcr_ktls_check_tcp_options: To check if there is any TCP option available | |
| 934 | 915 | * other than timestamp. |
| 935 | 916 | * @skb - skb contains partial record.. |
| 936 | 917 | * return: 1 / 0 |
| @@ -1115,7 +1096,7 @@ static int chcr_ktls_xmit_wr_complete(struct sk_buff *skb, · 178 unmodified lines | ||
| 1115 | 1096 | } |
| 1116 | 1097 | |
| 1117 | 1098 | if (unlikely(credits < ETHTXQ_STOP_THRES)) { |
| 1118 | − /* Credits are below the threshold vaues, stop the queue after | |
| 1099 | + /* Credits are below the threshold values, stop the queue after | |
| 1119 | 1100 | * injecting the Work Request for this packet. |
| 1120 | 1101 | */ |
| 1121 | 1102 | chcr_eth_txq_stop(q); |
| @@ -1663,54 +1644,6 @@ static void chcr_ktls_copy_record_in_skb(struct sk_buff *nskb, · 541 unmodified lines | ||
| 1663 | 1644 | refcount_add(nskb->truesize, &nskb->sk->sk_wmem_alloc); |
| 1664 | 1645 | } |
| 1665 | 1646 | |
| 1666 | −/* | |
| 1667 | − * chcr_ktls_update_snd_una: Reset the SEND_UNA. It will be done to avoid | |
| 1668 | − * sending the same segment again. It will discard the segment which is before | |
| 1669 | − * the current tx max. | |
| 1670 | − * @tx_info - driver specific tls info. | |
| 1671 | − * @q - TX queue. | |
| 1672 | − * return: NET_TX_OK/NET_XMIT_DROP. | |
| 1673 | − */ | |
| 1674 | −static int chcr_ktls_update_snd_una(struct chcr_ktls_info *tx_info, | |
| 1675 | − struct sge_eth_txq *q) | |
| 1676 | −{ | |
| 1677 | − struct fw_ulptx_wr *wr; | |
| 1678 | − unsigned int ndesc; | |
| 1679 | − int credits; | |
| 1680 | − void *pos; | |
| 1681 | − u32 len; | |
| 1682 | − | |
| 1683 | − len = sizeof(*wr) + roundup(CHCR_SET_TCB_FIELD_LEN, 16); | |
| 1684 | − ndesc = DIV_ROUND_UP(len, 64); | |
| 1685 | − | |
| 1686 | − credits = chcr_txq_avail(&q->q) - ndesc; | |
| 1687 | − if (unlikely(credits < 0)) { | |
| 1688 | − chcr_eth_txq_stop(q); | |
| 1689 | − return NETDEV_TX_BUSY; | |
| 1690 | − } | |
| 1691 | − | |
| 1692 | − pos = &q->q.desc[q->q.pidx]; | |
| 1693 | − | |
| 1694 | − wr = pos; | |
| 1695 | − /* ULPTX wr */ | |
| 1696 | − wr->op_to_compl = htonl(FW_WR_OP_V(FW_ULPTX_WR)); | |
| 1697 | − wr->cookie = 0; | |
| 1698 | − /* fill len in wr field */ | |
| 1699 | − wr->flowid_len16 = htonl(FW_WR_LEN16_V(DIV_ROUND_UP(len, 16))); | |
| 1700 | − | |
| 1701 | − pos += sizeof(*wr); | |
| 1702 | − | |
| 1703 | − pos = chcr_write_cpl_set_tcb_ulp(tx_info, q, tx_info->tid, pos, | |
| 1704 | − TCB_SND_UNA_RAW_W, | |
| 1705 | − TCB_SND_UNA_RAW_V(TCB_SND_UNA_RAW_M), | |
| 1706 | − TCB_SND_UNA_RAW_V(0), 0); | |
| 1707 | − | |
| 1708 | − chcr_txq_advance(&q->q, ndesc); | |
| 1709 | − cxgb4_ring_tx_db(tx_info->adap, &q->q, ndesc); | |
| 1710 | − | |
| 1711 | − return 0; | |
| 1712 | −} | |
| 1713 | − | |
| 1714 | 1647 | /* |
| 1715 | 1648 | * chcr_end_part_handler: This handler will handle the record which |
| 1716 | 1649 | * is complete or if record's end part is received. T6 adapter has a issue that |
| @@ -1735,7 +1668,9 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info, · 18 unmodified lines | ||
| 1735 | 1668 | struct sge_eth_txq *q, u32 skb_offset, |
| 1736 | 1669 | u32 tls_end_offset, bool last_wr) |
| 1737 | 1670 | { |
| 1671 | + bool free_skb_if_tx_fails = false; | |
| 1738 | 1672 | struct sk_buff *nskb = NULL; |
| 1673 | + | |
| 1739 | 1674 | /* check if it is a complete record */ |
| 1740 | 1675 | if (tls_end_offset == record->len) { |
| 1741 | 1676 | nskb = skb; |
| @@ -1758,6 +1693,8 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info, · 16 unmodified lines | ||
| 1758 | 1693 | |
| 1759 | 1694 | if (last_wr) |
| 1760 | 1695 | dev_kfree_skb_any(skb); |
| 1696 | + else | |
| 1697 | + free_skb_if_tx_fails = true; | |
| 1761 | 1698 | |
| 1762 | 1699 | last_wr = true; |
| 1763 | 1700 | |
| @@ -1769,6 +1706,8 @@ static int chcr_end_part_handler(struct chcr_ktls_info *tx_info, · 5 unmodified lines | ||
| 1769 | 1706 | record->num_frags, |
| 1770 | 1707 | (last_wr && tcp_push_no_fin), |
| 1771 | 1708 | mss)) { |
| 1709 | + if (free_skb_if_tx_fails) | |
| 1710 | + dev_kfree_skb_any(skb); | |
| 1772 | 1711 | goto out; |
| 1773 | 1712 | } |
| 1774 | 1713 | tx_info->prev_seq = record->end_seq; |
| @@ -1905,11 +1844,6 @@ static int chcr_short_record_handler(struct chcr_ktls_info *tx_info, · 130 unmodified lines | ||
| 1905 | 1844 | /* reset tcp_seq as per the prior_data_required len */ |
| 1906 | 1845 | tcp_seq -= prior_data_len; |
| 1907 | 1846 | } |
| 1908 | − /* reset snd una, so the middle record won't send the already | |
| 1909 | − * sent part. | |
| 1910 | − */ | |
| 1911 | − if (chcr_ktls_update_snd_una(tx_info, q)) | |
| 1912 | − goto out; | |
| 1913 | 1847 | atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_middle_pkts); |
| 1914 | 1848 | } else { |
| 1915 | 1849 | atomic64_inc(&tx_info->adap->ch_ktls_stats.ktls_tx_start_pkts); |
| @@ -2006,16 +1940,15 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev) · 90 unmodified lines | ||
| 2006 | 1940 | |
| 2007 | 1941 | /* TCP segments can be in received either complete or partial. |
| 2008 | 1942 | * chcr_end_part_handler will handle cases if complete record or end |
| 2009 | − * part of the record is received. Incase of partial end part of record, | |
| 1943 | + * part of the record is received. In case of partial end part of record, | |
| 2010 | 1944 | * we will send the complete record again. |
| 2011 | 1945 | */ |
| 2012 | 1946 | |
| 1947 | + spin_lock_irqsave(&tx_ctx->base.lock, flags); | |
| 1948 | + | |
| 2013 | 1949 | do { |
| 2014 | − int i; | |
| 2015 | 1950 | |
| 2016 | 1951 | cxgb4_reclaim_completed_tx(adap, &q->q, true); |
| 2017 | − /* lock taken */ | |
| 2018 | − spin_lock_irqsave(&tx_ctx->base.lock, flags); | |
| 2019 | 1952 | /* fetch the tls record */ |
| 2020 | 1953 | record = tls_get_record(&tx_ctx->base, tcp_seq, |
| 2021 | 1954 | &tx_info->record_no); |
| @@ -2074,11 +2007,11 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev) · 52 unmodified lines | ||
| 2074 | 2007 | tls_end_offset, skb_offset, |
| 2075 | 2008 | 0); |
| 2076 | 2009 | |
| 2077 | − spin_unlock_irqrestore(&tx_ctx->base.lock, flags); | |
| 2078 | 2010 | if (ret) { |
| 2079 | 2011 | /* free the refcount taken earlier */ |
| 2080 | 2012 | if (tls_end_offset < data_len) |
| 2081 | 2013 | dev_kfree_skb_any(skb); |
| 2014 | + spin_unlock_irqrestore(&tx_ctx->base.lock, flags); | |
| 2082 | 2015 | goto out; |
| 2083 | 2016 | } |
| 2084 | 2017 | |
| @@ -2088,16 +2021,6 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev) · 3 unmodified lines | ||
| 2088 | 2021 | continue; |
| 2089 | 2022 | } |
| 2090 | 2023 | |
| 2091 | − /* increase page reference count of the record, so that there | |
| 2092 | − * won't be any chance of page free in middle if in case stack | |
| 2093 | − * receives ACK and try to delete the record. | |
| 2094 | − */ | |
| 2095 | − for (i = 0; i < record->num_frags; i++) | |
| 2096 | − __skb_frag_ref(&record->frags[i]); | |
| 2097 | − /* lock cleared */ | |
| 2098 | − spin_unlock_irqrestore(&tx_ctx->base.lock, flags); | |
| 2099 | − | |
| 2100 | − | |
| 2101 | 2024 | /* if a tls record is finishing in this SKB */ |
| 2102 | 2025 | if (tls_end_offset <= data_len) { |
| 2103 | 2026 | ret = chcr_end_part_handler(tx_info, skb, record, |
| @@ -2122,13 +2045,9 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev) · 18 unmodified lines | ||
| 2122 | 2045 | data_len = 0; |
| 2123 | 2046 | } |
| 2124 | 2047 | |
| 2125 | − /* clear the frag ref count which increased locally before */ | |
| 2126 | − for (i = 0; i < record->num_frags; i++) { | |
| 2127 | − /* clear the frag ref count */ | |
| 2128 | − __skb_frag_unref(&record->frags[i]); | |
| 2129 | − } | |
| 2130 | 2048 | /* if any failure, come out from the loop. */ |
| 2131 | 2049 | if (ret) { |
| 2050 | + spin_unlock_irqrestore(&tx_ctx->base.lock, flags); | |
| 2132 | 2051 | if (th->fin) |
| 2133 | 2052 | dev_kfree_skb_any(skb); |
| 2134 | 2053 | |
| @@ -2143,6 +2062,7 @@ static int chcr_ktls_xmit(struct sk_buff *skb, struct net_device *dev) · 8 unmodified lines | ||
| 2143 | 2062 | |
| 2144 | 2063 | } while (data_len > 0); |
| 2145 | 2064 | |
| 2065 | + spin_unlock_irqrestore(&tx_ctx->base.lock, flags); | |
| 2146 | 2066 | atomic64_inc(&port_stats->ktls_tx_encrypted_packets); |
| 2147 | 2067 | atomic64_add(skb_data_len, &port_stats->ktls_tx_encrypted_bytes); |
| 2148 | 2068 | |
| @@ -133,6 +133,8 @@ struct board_info { · 132 unmodified lines | ||
| 133 | 133 | u32 wake_state; |
| 134 | 134 | |
| 135 | 135 | int ip_summed; |
| 136 | + | |
| 137 | + struct regulator *power_supply; | |
| 136 | 138 | }; |
| 137 | 139 | |
| 138 | 140 | /* debug code */ |
| @@ -1449,7 +1451,7 @@ dm9000_probe(struct platform_device *pdev) · 1310 unmodified lines | ||
| 1449 | 1451 | if (ret) { |
| 1450 | 1452 | dev_err(dev, "failed to request reset gpio %d: %d\n", |
| 1451 | 1453 | reset_gpios, ret); |
| 1452 | − return -ENODEV; | |
| 1454 | + goto out_regulator_disable; | |
| 1453 | 1455 | } |
| 1454 | 1456 | |
| 1455 | 1457 | /* According to manual PWRST# Low Period Min 1ms */ |
| @@ -1461,14 +1463,18 @@ dm9000_probe(struct platform_device *pdev) · 5 unmodified lines | ||
| 1461 | 1463 | |
| 1462 | 1464 | if (!pdata) { |
| 1463 | 1465 | pdata = dm9000_parse_dt(&pdev->dev); |
| 1464 | − if (IS_ERR(pdata)) | |
| 1465 | − return PTR_ERR(pdata); | |
| 1466 | + if (IS_ERR(pdata)) { | |
| 1467 | + ret = PTR_ERR(pdata); | |
| 1468 | + goto out_regulator_disable; | |
| 1469 | + } | |
| 1466 | 1470 | } |
| 1467 | 1471 | |
| 1468 | 1472 | /* Init network device */ |
| 1469 | 1473 | ndev = alloc_etherdev(sizeof(struct board_info)); |
| 1470 | − if (!ndev) | |
| 1471 | − return -ENOMEM; | |
| 1474 | + if (!ndev) { | |
| 1475 | + ret = -ENOMEM; | |
| 1476 | + goto out_regulator_disable; | |
| 1477 | + } | |
| 1472 | 1478 | |
| 1473 | 1479 | SET_NETDEV_DEV(ndev, &pdev->dev); |
| 1474 | 1480 | |
| @@ -1479,6 +1485,8 @@ dm9000_probe(struct platform_device *pdev) · 4 unmodified lines | ||
| 1479 | 1485 | |
| 1480 | 1486 | db->dev = &pdev->dev; |
| 1481 | 1487 | db->ndev = ndev; |
| 1488 | + if (!IS_ERR(power)) | |
| 1489 | + db->power_supply = power; | |
| 1482 | 1490 | |
| 1483 | 1491 | spin_lock_init(&db->lock); |
| 1484 | 1492 | mutex_init(&db->addr_lock); |
| @@ -1501,7 +1509,7 @@ dm9000_probe(struct platform_device *pdev) · 16 unmodified lines | ||
| 1501 | 1509 | goto out; |
| 1502 | 1510 | } |
| 1503 | 1511 | |
| 1504 | − db->irq_wake = platform_get_irq(pdev, 1); | |
| 1512 | + db->irq_wake = platform_get_irq_optional(pdev, 1); | |
| 1505 | 1513 | if (db->irq_wake >= 0) { |
| 1506 | 1514 | dev_dbg(db->dev, "wakeup irq %d\n", db->irq_wake); |
| 1507 | 1515 | |
| @@ -1703,6 +1711,10 @@ out: · 195 unmodified lines | ||
| 1703 | 1711 | dm9000_release_board(pdev, db); |
| 1704 | 1712 | free_netdev(ndev); |
| 1705 | 1713 | |
| 1714 | +out_regulator_disable: | |
| 1715 | + if (!IS_ERR(power)) | |
| 1716 | + regulator_disable(power); | |
| 1717 | + | |
| 1706 | 1718 | return ret; |
| 1707 | 1719 | } |
| 1708 | 1720 | |
| @@ -1760,10 +1772,13 @@ static int · 51 unmodified lines | ||
| 1760 | 1772 | dm9000_drv_remove(struct platform_device *pdev) |
| 1761 | 1773 | { |
| 1762 | 1774 | struct net_device *ndev = platform_get_drvdata(pdev); |
| 1775 | + struct board_info *dm = to_dm9000_board(ndev); | |
| 1763 | 1776 | |
| 1764 | 1777 | unregister_netdev(ndev); |
| 1765 | − dm9000_release_board(pdev, netdev_priv(ndev)); | |
| 1778 | + dm9000_release_board(pdev, dm); | |
| 1766 | 1779 | free_netdev(ndev); /* free device structure */ |
| 1780 | + if (dm->power_supply) | |
| 1781 | + regulator_disable(dm->power_supply); | |
| 1767 | 1782 | |
| 1768 | 1783 | dev_dbg(&pdev->dev, "released and freed device\n"); |
| 1769 | 1784 | return 0; |
| @@ -1337,6 +1337,7 @@ static int ftgmac100_poll(struct napi_struct *napi, int budget) · 1336 unmodified lines | ||
| 1337 | 1337 | */ |
| 1338 | 1338 | if (unlikely(priv->need_mac_restart)) { |
| 1339 | 1339 | ftgmac100_start_hw(priv); |
| 1340 | + priv->need_mac_restart = false; | |
| 1340 | 1341 | |
| 1341 | 1342 | /* Re-enable "bad" interrupts */ |
| 1342 | 1343 | iowrite32(FTGMAC100_INT_BAD, |
| @@ -281,6 +281,8 @@ static int enetc_poll(struct napi_struct *napi, int budget) · 280 unmodified lines | ||
| 281 | 281 | int work_done; |
| 282 | 282 | int i; |
| 283 | 283 | |
| 284 | + enetc_lock_mdio(); | |
| 285 | + | |
| 284 | 286 | for (i = 0; i < v->count_tx_rings; i++) |
| 285 | 287 | if (!enetc_clean_tx_ring(&v->tx_ring[i], budget)) |
| 286 | 288 | complete = false; |
| @@ -291,8 +293,10 @@ static int enetc_poll(struct napi_struct *napi, int budget) · 4 unmodified lines | ||
| 291 | 293 | if (work_done) |
| 292 | 294 | v->rx_napi_work = true; |
| 293 | 295 | |
| 294 | − if (!complete) | |
| 296 | + if (!complete) { | |
| 297 | + enetc_unlock_mdio(); | |
| 295 | 298 | return budget; |
| 299 | + } | |
| 296 | 300 | |
| 297 | 301 | napi_complete_done(napi, work_done); |
| 298 | 302 | |
| @@ -301,8 +305,6 @@ static int enetc_poll(struct napi_struct *napi, int budget) · 2 unmodified lines | ||
| 301 | 305 | |
| 302 | 306 | v->rx_napi_work = false; |
| 303 | 307 | |
| 304 | − enetc_lock_mdio(); | |
| 305 | − | |
| 306 | 308 | /* enable interrupts */ |
| 307 | 309 | enetc_wr_reg_hot(v->rbier, ENETC_RBIER_RXTIE); |
| 308 | 310 | |
| @@ -327,8 +329,8 @@ static void enetc_get_tx_tstamp(struct enetc_hw *hw, union enetc_tx_bd *txbd, · 18 unmodified lines | ||
| 327 | 329 | { |
| 328 | 330 | u32 lo, hi, tstamp_lo; |
| 329 | 331 | |
| 330 | − lo = enetc_rd(hw, ENETC_SICTR0); | |
| 331 | − hi = enetc_rd(hw, ENETC_SICTR1); | |
| 332 | + lo = enetc_rd_hot(hw, ENETC_SICTR0); | |
| 333 | + hi = enetc_rd_hot(hw, ENETC_SICTR1); | |
| 332 | 334 | tstamp_lo = le32_to_cpu(txbd->wb.tstamp); |
| 333 | 335 | if (lo <= tstamp_lo) |
| 334 | 336 | hi -= 1; |
| @@ -342,6 +344,12 @@ static void enetc_tstamp_tx(struct sk_buff *skb, u64 tstamp) · 7 unmodified lines | ||
| 342 | 344 | if (skb_shinfo(skb)->tx_flags & SKBTX_IN_PROGRESS) { |
| 343 | 345 | memset(&shhwtstamps, 0, sizeof(shhwtstamps)); |
| 344 | 346 | shhwtstamps.hwtstamp = ns_to_ktime(tstamp); |
| 347 | + /* Ensure skb_mstamp_ns, which might have been populated with | |
| 348 | + * the txtime, is not mistaken for a software timestamp, | |
| 349 | + * because this will prevent the dispatch of our hardware | |
| 350 | + * timestamp to the socket. | |
| 351 | + */ | |
| 352 | + skb->tstamp = ktime_set(0, 0); | |
| 345 | 353 | skb_tstamp_tx(skb, &shhwtstamps); |
| 346 | 354 | } |
| 347 | 355 | } |
| @@ -358,9 +366,7 @@ static bool enetc_clean_tx_ring(struct enetc_bdr *tx_ring, int napi_budget) · 10 unmodified lines | ||
| 358 | 366 | i = tx_ring->next_to_clean; |
| 359 | 367 | tx_swbd = &tx_ring->tx_swbd[i]; |
| 360 | 368 | |
| 361 | − enetc_lock_mdio(); | |
| 362 | 369 | bds_to_clean = enetc_bd_ready_count(tx_ring, i); |
| 363 | − enetc_unlock_mdio(); | |
| 364 | 370 | |
| 365 | 371 | do_tstamp = false; |
| 366 | 372 | |
| @@ -403,8 +409,6 @@ static bool enetc_clean_tx_ring(struct enetc_bdr *tx_ring, int napi_budget) · 36 unmodified lines | ||
| 403 | 409 | tx_swbd = tx_ring->tx_swbd; |
| 404 | 410 | } |
| 405 | 411 | |
| 406 | − enetc_lock_mdio(); | |
| 407 | − | |
| 408 | 412 | /* BD iteration loop end */ |
| 409 | 413 | if (is_eof) { |
| 410 | 414 | tx_frm_cnt++; |
| @@ -415,8 +419,6 @@ static bool enetc_clean_tx_ring(struct enetc_bdr *tx_ring, int napi_budget) · 4 unmodified lines | ||
| 415 | 419 | |
189 more lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 199 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 42 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 137 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 98 lines aren’t shown here.
This diff is large: its 123 lines aren’t shown here.
This diff is large: its 68 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 83 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 113 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 101 lines aren’t shown here.
This diff is large: its 72 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 87 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 61 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 137 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 95 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 79 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 145 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 79 lines aren’t shown here.
This diff is large: its 251 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 96 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 92 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 95 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 104 lines aren’t shown here.
This diff is large: its 133 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 106 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 201 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 148 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 78 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 47 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 69 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 105 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 88 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 118 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 58 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 72 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 65 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 159 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 101 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 71 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 84 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 190 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 77 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 175 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 70 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 283 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 291 lines aren’t shown here.
This diff is large: its 291 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 65 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 85 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 204 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 122 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 318 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 64 lines aren’t shown here.
This diff is large: its 91 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 118 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 74 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 100 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 133 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 109 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 125 lines aren’t shown here.
This diff is large: its 77 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 71 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 299 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 125 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 56 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 63 lines aren’t shown here.
This diff is large: its 137 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 140 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 87 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 88 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 110 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 79 lines aren’t shown here.
This diff is large: its 42 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 100 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 111 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 111 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 195 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 2168 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 121 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 92 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 95 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 119 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 177 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 115 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 62 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 60 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 42 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 187 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 103 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 353 lines aren’t shown here.
This diff is large: its 563 lines aren’t shown here.
This diff is large: its 109 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 176 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 104 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 42 lines aren’t shown here.
This diff is large: its 112 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 99 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 112 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 54 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 60 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 304 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 89 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 48 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 223 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 111 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 92 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 78 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 51 lines aren’t shown here.
This diff is large: its 156 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 57 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 176 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 99 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 81 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 42 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 63 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 81 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 100 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 426 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 50 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 189 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 182 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 46 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 45 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 129 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 73 lines aren’t shown here.
This diff is large: its 28 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 43 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 136 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 80 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 65 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 161 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 581 lines aren’t shown here.
This diff is large: its 42 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 5 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 68 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 120 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 124 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 195 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 52 lines aren’t shown here.
This diff is large: its 49 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 157 lines aren’t shown here.
This diff is large: its 25 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 125 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 31 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 35 lines aren’t shown here.
This diff is large: its 44 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 40 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 5 lines aren’t shown here.
This diff is large: its 5 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 75 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 402 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 147 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 175 lines aren’t shown here.
This diff is large: its 30 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 41 lines aren’t shown here.
This diff is large: its 59 lines aren’t shown here.
This diff is large: its 5 lines aren’t shown here.
This diff is large: its 24 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 122 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 125 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 141 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 124 lines aren’t shown here.
This diff is large: its 39 lines aren’t shown here.
This diff is large: its 13 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 33 lines aren’t shown here.
This diff is large: its 12 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 36 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 11 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 37 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 5 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 89 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 8 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 6 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 53 lines aren’t shown here.
Empty file deleted.
This diff is large: its 10 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 34 lines aren’t shown here.
This diff is large: its 62 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 83 lines aren’t shown here.
This diff is large: its 20 lines aren’t shown here.
This diff is large: its 22 lines aren’t shown here.
This diff is large: its 32 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 103 lines aren’t shown here.
This diff is large: its 7 lines aren’t shown here.
This diff is large: its 26 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 27 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 19 lines aren’t shown here.
This diff is large: its 110 lines aren’t shown here.
This diff is large: its 96 lines aren’t shown here.
This diff is large: its 17 lines aren’t shown here.
This diff is large: its 29 lines aren’t shown here.
This diff is large: its 55 lines aren’t shown here.
This diff is large: its 4 lines aren’t shown here.
This diff is large: its 14 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 38 lines aren’t shown here.
This diff is large: its 16 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 135 lines aren’t shown here.
This diff is large: its 270 lines aren’t shown here.
This diff is large: its 167 lines aren’t shown here.
This diff is large: its 15 lines aren’t shown here.
This diff is large: its 21 lines aren’t shown here.
This diff is large: its 23 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 71 lines aren’t shown here.
This diff is large: its 42 lines aren’t shown here.
This diff is large: its 9 lines aren’t shown here.
This diff is large: its 100 lines aren’t shown here.
This diff is large: its 18 lines aren’t shown here.